From be9bcfded485956764fe77b778ef49c868fa0c49 Mon Sep 17 00:00:00 2001 From: "Matt Johnson (via Claude)" Date: Tue, 9 Jun 2026 06:29:18 +0000 Subject: [PATCH] feat: swpc multi-line wire + GUI wired to real adapter_config keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit swpc_handler.py: rewrite _render() to multi-line format (emoji + New: prefix + scale/type — detail line — SWPC · time tag). Extract message and time fields from envelope for line 2/3. Environment.tsx: replace empty SWPC panel with broadcast threshold controls — geomag Kp floor (G1-G5), flare class floor (M1-X10), proton pfu floor (S1-S4). Full adapter_config save/load/discard wiring. Co-Authored-By: Claude Opus 4.6 --- dashboard-frontend/src/pages/Environment.tsx | 87 ++- meshai/central/swpc_handler.py | 63 +- .../dashboard/static/assets/index-CM6OazXs.js | 543 ++++++++++++++++++ .../dashboard/static/assets/index-DzHEJ_0f.js | 543 ------------------ meshai/dashboard/static/index.html | 2 +- 5 files changed, 676 insertions(+), 562 deletions(-) create mode 100644 meshai/dashboard/static/assets/index-CM6OazXs.js delete mode 100644 meshai/dashboard/static/assets/index-DzHEJ_0f.js diff --git a/dashboard-frontend/src/pages/Environment.tsx b/dashboard-frontend/src/pages/Environment.tsx index 0457d56..cf9ed70 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 } +// SWPC adapter config shape +interface SwpcConfig { + geomag_kp_floor: number + flare_class_floor: string + proton_pfu_floor: number +} + interface TomtomConfig { min_magnitude: number drop_non_present: boolean @@ -288,6 +295,12 @@ export default function Environment() { min_danger_level: 3, }) const [avalancheOriginal, setAvalancheOriginal] = useState("") + const [swpcConfig, setSwpcConfig] = useState({ + geomag_kp_floor: 7.0, + flare_class_floor: "X1", + proton_pfu_floor: 10.0, + }) + const [swpcOriginal, setSwpcOriginal] = useState("") useEffect(() => { @@ -403,6 +416,21 @@ export default function Environment() { } } catch { /* adapter-config optional */ } + // Load adapter-config for swpc + try { + const swpcRes = await fetch("/api/adapter-config/swpc") + if (swpcRes.ok) { + const swpcData = await swpcRes.json() + const cfg: SwpcConfig = { + geomag_kp_floor: swpcData.geomag_kp_floor?.value ?? 7.0, + flare_class_floor: swpcData.flare_class_floor?.value ?? "X1", + proton_pfu_floor: swpcData.proton_pfu_floor?.value ?? 10.0, + } + setSwpcConfig(cfg) + setSwpcOriginal(JSON.stringify(cfg)) + } + } catch { /* adapter-config optional */ } + } catch (e) { setError(e instanceof Error ? e.message : 'Failed to load config') } finally { @@ -431,7 +459,8 @@ export default function Environment() { const hasWzdxChanges = JSON.stringify(wzdxConfig) !== wzdxOriginal const hasNwsChanges = JSON.stringify(nwsConfig) !== nwsOriginal const hasAvalancheChanges = JSON.stringify(avalancheConfig) !== avalancheOriginal - const hasChanges = hasEnvChanges || hasWfigsChanges || hasFiresChanges || hasTomtomChanges || hasRoads511Changes || hasWzdxChanges || hasNwsChanges || hasAvalancheChanges + const hasSwpcChanges = JSON.stringify(swpcConfig) !== swpcOriginal + const hasChanges = hasEnvChanges || hasWfigsChanges || hasFiresChanges || hasTomtomChanges || hasRoads511Changes || hasWzdxChanges || hasNwsChanges || hasAvalancheChanges || hasSwpcChanges const saveAdapterConfig = async (adapterName: string, key: string, value: unknown) => { @@ -565,6 +594,21 @@ const save = async () => { setAvalancheOriginal(JSON.stringify(avalancheConfig)) } + // Save swpc adapter config changes + if (hasSwpcChanges) { + const orig = JSON.parse(swpcOriginal) as SwpcConfig + if (swpcConfig.geomag_kp_floor !== orig.geomag_kp_floor) { + await saveAdapterConfig("swpc", "geomag_kp_floor", swpcConfig.geomag_kp_floor) + } + if (swpcConfig.flare_class_floor !== orig.flare_class_floor) { + await saveAdapterConfig("swpc", "flare_class_floor", swpcConfig.flare_class_floor) + } + if (swpcConfig.proton_pfu_floor !== orig.proton_pfu_floor) { + await saveAdapterConfig("swpc", "proton_pfu_floor", swpcConfig.proton_pfu_floor) + } + setSwpcOriginal(JSON.stringify(swpcConfig)) + } + setSuccess('Config saved') setTimeout(() => setSuccess(null), 3000) } catch (e) { @@ -583,6 +627,7 @@ const save = async () => { setWzdxConfig(JSON.parse(wzdxOriginal || JSON.stringify(wzdxConfig))) setNwsConfig(JSON.parse(nwsOriginal || JSON.stringify(nwsConfig))) setAvalancheConfig(JSON.parse(avalancheOriginal || JSON.stringify(avalancheConfig))) + setSwpcConfig(JSON.parse(swpcOriginal || JSON.stringify(swpcConfig))) } const restart = async () => { try { await fetch('/api/restart', { method: 'POST' }); setRestartRequired(false); setSuccess('Restart initiated') } @@ -642,7 +687,45 @@ const save = async () => { )} ) - case 'swpc': return
No additional settings.
+ case 'swpc': return ( +
+
+
+ Broadcast Thresholds +
+
+ setSwpcConfig({ ...swpcConfig, geomag_kp_floor: Number(v) })} + 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" /> + setSwpcConfig({ ...swpcConfig, flare_class_floor: v })} + 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" /> + setSwpcConfig({ ...swpcConfig, proton_pfu_floor: Number(v) })} + 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 (
up({ ducting: { ...env.ducting, tick_seconds: v } })} min={60} /> diff --git a/meshai/central/swpc_handler.py b/meshai/central/swpc_handler.py index f9cd90a..c899089 100644 --- a/meshai/central/swpc_handler.py +++ b/meshai/central/swpc_handler.py @@ -14,10 +14,14 @@ Three Central sub-adapters all route here: swpc_alerts -> parse alert payload (flare class, geomag, proton scale) swpc_protons -> check >=10 MeV proton flux threshold -Wire format (Matt's approved option C): - 🌌 Strong geomagnetic storm (G3/Kp7) -- HF degraded, aurora possible - 🔆 Major solar flare (R3/X1.2) -- HF radio fading ~30 min, GPS may glitch - ☢️ Solar radiation storm (S1) -- polar HF radio affected +Wire format (multi-line, matches Fire/Quake/Avalanche style): + Line 1: {emoji} New: {scale} {type} — {key fact} + Line 2: supporting detail (impact summary / message, truncated 120 chars) + Line 3: SWPC · {time tag} + + Geomag: 🧲 New: G3 Geomagnetic Storm — Kp7 + Flare: ☀️ New: X1.2 Solar Flare — R3 + Proton: ☢️ New: S1 Radiation Storm — 10 pfu """ from __future__ import annotations from meshai.adapter_config import adapter_config @@ -293,33 +297,60 @@ def handle_swpc(envelope: dict, subject: str, "SELECT last_broadcast_at FROM swpc_events WHERE event_id=?", (event_id,)).fetchone() + # Extract optional detail and time tag for multi-line render. + _detail = d.get("message") or d.get("description") or "" + if isinstance(_detail, str): + _detail = _detail.strip()[:120] + else: + _detail = "" + _time_tag = "" + _t_raw = d.get("time") or d.get("issued_at") or d.get("issue_time") or "" + if isinstance(_t_raw, str) and _t_raw: + _time_tag = _t_raw[:16].replace("T", " ") + if row is None: _upsert_swpc(conn, event_id=event_id, adapter=adapter, payload_json=payload_json, occurred_at=occurred_at or now, first_seen_at=now, set_last_broadcast=False) - wire = _render(event_kind, scale_code, label, scalar_str) + wire = _render(event_kind, scale_code, label, scalar_str, + is_update=False, detail=_detail, time_tag=_time_tag) _attach_commit(data, event_id=event_id, event_log_row_id=log_id) return wire if row["last_broadcast_at"] is None: - wire = _render(event_kind, scale_code, label, scalar_str) + wire = _render(event_kind, scale_code, label, scalar_str, + is_update=False, detail=_detail, time_tag=_time_tag) _attach_commit(data, event_id=event_id, event_log_row_id=log_id) return wire + # Already broadcast — return None (no Update re-broadcast for SWPC; + # space weather events are point-in-time, not evolving like fires). return None -def _render(event_kind, scale_code, label, scalar_str) -> str: +def _render(event_kind, scale_code, label, scalar_str, + *, is_update: bool = False, detail: str = "", + time_tag: str = "") -> str: + prefix = "Update:" if is_update else "New:" + if event_kind == "geomag": - return (f"🌌 {label.title()} geomagnetic storm ({scale_code}/{scalar_str}) " - f"-- HF degraded, aurora possible") - if event_kind == "flare": - return (f"🔆 Major solar flare ({scale_code}/{scalar_str}) " - f"-- HF radio fading ~30 min, GPS may glitch") - if event_kind == "proton": - return (f"☢️ Solar radiation storm ({scale_code}/{scalar_str}) " - f"-- polar HF radio affected") - return f"⚠️ Space weather event ({scale_code or '?'})" + line1 = f"🧲 {prefix} {scale_code} Geomagnetic Storm — {scalar_str}" + line2 = detail[:120] if detail else "HF degraded, aurora possible" + line3 = f"SWPC · {time_tag}" if time_tag else "SWPC" + elif event_kind == "flare": + line1 = f"☀️ {prefix} {scalar_str} Solar Flare — {scale_code}" + line2 = detail[:120] if detail else "HF radio fading, GPS may glitch" + line3 = f"SWPC · {time_tag}" if time_tag else "SWPC" + elif event_kind == "proton": + line1 = f"☢️ {prefix} {scale_code} Radiation Storm — {scalar_str}" + line2 = detail[:120] if detail else "Polar HF radio affected" + line3 = f"SWPC · {time_tag}" if time_tag else "SWPC" + else: + line1 = f"⚠️ {prefix} Space Weather Event — {scale_code or '?'}" + line2 = detail[:120] if detail else None + line3 = f"SWPC · {time_tag}" if time_tag else "SWPC" + + return "\n".join(l for l in [line1, line2, line3] if l) def _upsert_swpc(conn, *, event_id, adapter, payload_json, occurred_at, diff --git a/meshai/dashboard/static/assets/index-CM6OazXs.js b/meshai/dashboard/static/assets/index-CM6OazXs.js new file mode 100644 index 0000000..b89768c --- /dev/null +++ b/meshai/dashboard/static/assets/index-CM6OazXs.js @@ -0,0 +1,543 @@ +function Loe(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 Wg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var L7={exports:{}},KS={},O7={exports:{}},St={};/** + * @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 T0=Symbol.for("react.element"),Ooe=Symbol.for("react.portal"),Ioe=Symbol.for("react.fragment"),Eoe=Symbol.for("react.strict_mode"),Noe=Symbol.for("react.profiler"),Doe=Symbol.for("react.provider"),joe=Symbol.for("react.context"),Roe=Symbol.for("react.forward_ref"),Boe=Symbol.for("react.suspense"),zoe=Symbol.for("react.memo"),$oe=Symbol.for("react.lazy"),M5=Symbol.iterator;function Foe(e){return e===null||typeof e!="object"?null:(e=M5&&e[M5]||e["@@iterator"],typeof e=="function"?e:null)}var I7={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E7=Object.assign,N7={};function Dv(e,t,r){this.props=e,this.context=t,this.refs=N7,this.updater=r||I7}Dv.prototype.isReactComponent={};Dv.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")};Dv.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function D7(){}D7.prototype=Dv.prototype;function HE(e,t,r){this.props=e,this.context=t,this.refs=N7,this.updater=r||I7}var UE=HE.prototype=new D7;UE.constructor=HE;E7(UE,Dv.prototype);UE.isPureReactComponent=!0;var P5=Array.isArray,j7=Object.prototype.hasOwnProperty,ZE={current:null},R7={key:!0,ref:!0,__self:!0,__source:!0};function B7(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)j7.call(t,n)&&!R7.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1>>1,Y=B[Z];if(0>>1;Zi(ce,U))dei(Oe,ce)?(B[Z]=Oe,B[de]=U,Z=de):(B[Z]=ce,B[te]=U,Z=te);else if(dei(Oe,U))B[Z]=Oe,B[de]=U,Z=de;else break e}}return H}function i(B,H){var U=B.sortIndex-H.sortIndex;return U!==0?U:B.id-H.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,f=null,h=3,d=!1,v=!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 b(B){for(var H=r(u);H!==null;){if(H.callback===null)n(u);else if(H.startTime<=B)n(u),H.sortIndex=H.expirationTime,t(l,H);else break;H=r(u)}}function S(B){if(m=!1,b(B),!v)if(r(l)!==null)v=!0,F(T);else{var H=r(u);H!==null&&$(S,H.startTime-B)}}function T(B,H){v=!1,m&&(m=!1,x(P),P=-1),d=!0;var U=h;try{for(b(H),f=r(l);f!==null&&(!(f.expirationTime>H)||B&&!E());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,h=f.priorityLevel;var Y=Z(f.expirationTime<=H);H=e.unstable_now(),typeof Y=="function"?f.callback=Y:f===r(l)&&n(l),b(H)}else n(l);f=r(l)}if(f!==null)var K=!0;else{var te=r(u);te!==null&&$(S,te.startTime-H),K=!1}return K}finally{f=null,h=U,d=!1}}var C=!1,A=null,P=-1,O=5,k=-1;function E(){return!(e.unstable_now()-kB||125Z?(B.sortIndex=U,t(u,B),r(l)===null&&B===r(u)&&(m?(x(P),P=-1):m=!0,$(S,U-Z))):(B.sortIndex=Y,t(l,B),v||d||(v=!0,F(T))),B},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(B){var H=h;return function(){var U=h;h=H;try{return B.apply(this,arguments)}finally{h=U}}}})(G7);V7.exports=G7;var Qoe=V7.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 ese=G,Zi=Qoe;function we(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"),uk=Object.prototype.hasOwnProperty,tse=/^[: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]*$/,L5={},O5={};function rse(e){return uk.call(O5,e)?!0:uk.call(L5,e)?!1:tse.test(e)?O5[e]=!0:(L5[e]=!0,!1)}function nse(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 ise(e,t,r,n){if(t===null||typeof t>"u"||nse(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 fi(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 In={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){In[e]=new fi(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];In[t]=new fi(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){In[e]=new fi(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){In[e]=new fi(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){In[e]=new fi(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){In[e]=new fi(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){In[e]=new fi(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){In[e]=new fi(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){In[e]=new fi(e,5,!1,e.toLowerCase(),null,!1,!1)});var XE=/[\-:]([a-z])/g;function qE(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(XE,qE);In[t]=new fi(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(XE,qE);In[t]=new fi(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(XE,qE);In[t]=new fi(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){In[e]=new fi(e,1,!1,e.toLowerCase(),null,!1,!1)});In.xlinkHref=new fi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){In[e]=new fi(e,1,!1,e.toLowerCase(),null,!0,!0)});function KE(e,t,r,n){var i=In.hasOwnProperty(t)?In[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{kA=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Hg(e):""}function ase(e){switch(e.tag){case 5:return Hg(e.type);case 16:return Hg("Lazy");case 13:return Hg("Suspense");case 19:return Hg("SuspenseList");case 0:case 2:case 15:return e=LA(e.type,!1),e;case 11:return e=LA(e.type.render,!1),e;case 1:return e=LA(e.type,!0),e;default:return""}}function dk(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 rd:return"Fragment";case td:return"Portal";case ck:return"Profiler";case JE:return"StrictMode";case fk:return"Suspense";case hk:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case U7:return(e.displayName||"Context")+".Consumer";case H7:return(e._context.displayName||"Context")+".Provider";case QE:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case eN:return t=e.displayName||null,t!==null?t:dk(e.type)||"Memo";case zl:t=e._payload,e=e._init;try{return dk(e(t))}catch{}}return null}function ose(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 dk(t);case 8:return t===JE?"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 Tu(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Y7(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sse(e){var t=Y7(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 Rx(e){e._valueTracker||(e._valueTracker=sse(e))}function X7(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Y7(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function h1(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 vk(e,t){var r=t.checked;return _r({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function E5(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Tu(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 q7(e,t){t=t.checked,t!=null&&KE(e,"checked",t,!1)}function pk(e,t){q7(e,t);var r=Tu(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")?gk(e,t.type,r):t.hasOwnProperty("defaultValue")&&gk(e,t.type,Tu(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function N5(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 gk(e,t,r){(t!=="number"||h1(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ug=Array.isArray;function Sd(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Bx.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Vm(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var um={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},lse=["Webkit","ms","Moz","O"];Object.keys(um).forEach(function(e){lse.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),um[t]=um[e]})});function e9(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||um.hasOwnProperty(e)&&um[e]?(""+t).trim():t+"px"}function t9(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=e9(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var use=_r({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 xk(e,t){if(t){if(use[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(we(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(we(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(we(61))}if(t.style!=null&&typeof t.style!="object")throw Error(we(62))}}function _k(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 bk=null;function tN(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wk=null,Td=null,Cd=null;function R5(e){if(e=M0(e)){if(typeof wk!="function")throw Error(we(280));var t=e.stateNode;t&&(t=rT(t),wk(e.stateNode,e.type,t))}}function r9(e){Td?Cd?Cd.push(e):Cd=[e]:Td=e}function n9(){if(Td){var e=Td,t=Cd;if(Cd=Td=null,R5(e),t)for(e=0;e>>=0,e===0?32:31-(_se(e)/bse|0)|0}var zx=64,$x=4194304;function Zg(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 g1(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=Zg(s):(a&=o,a!==0&&(n=Zg(a)))}else o=r&~i,o!==0?n=Zg(o):a!==0&&(n=Zg(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 C0(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ao(t),e[t]=r}function Cse(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=fm),U5=" ",Z5=!1;function S9(e,t){switch(e){case"keyup":return Qse.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function T9(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var nd=!1;function tle(e,t){switch(e){case"compositionend":return T9(t);case"keypress":return t.which!==32?null:(Z5=!0,U5);case"textInput":return e=t.data,e===U5&&Z5?null:e;default:return null}}function rle(e,t){if(nd)return e==="compositionend"||!uN&&S9(e,t)?(e=b9(),Eb=oN=Zl=null,nd=!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=K5(r)}}function P9(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?P9(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function k9(){for(var e=window,t=h1();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=h1(e.document)}return t}function cN(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 fle(e){var t=k9(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&P9(r.ownerDocument.documentElement,r)){if(n!==null&&cN(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=J5(r,a);var o=J5(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,id=null,Pk=null,dm=null,kk=!1;function Q5(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;kk||id==null||id!==h1(n)||(n=id,"selectionStart"in n&&cN(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}),dm&&Ym(dm,n)||(dm=n,n=x1(Pk,"onSelect"),0sd||(e.current=Dk[sd],Dk[sd]=null,sd--)}function rr(e,t){sd++,Dk[sd]=e.current,e.current=t}var Cu={},Kn=ju(Cu),bi=ju(!1),Sf=Cu;function Fd(e,t){var r=e.type.contextTypes;if(!r)return Cu;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 wi(e){return e=e.childContextTypes,e!=null}function b1(){ur(bi),ur(Kn)}function oB(e,t,r){if(Kn.current!==Cu)throw Error(we(168));rr(Kn,t),rr(bi,r)}function B9(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(we(108,ose(e)||"Unknown",i));return _r({},r,n)}function w1(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Cu,Sf=Kn.current,rr(Kn,e),rr(bi,bi.current),!0}function sB(e,t,r){var n=e.stateNode;if(!n)throw Error(we(169));r?(e=B9(e,t,Sf),n.__reactInternalMemoizedMergedChildContext=e,ur(bi),ur(Kn),rr(Kn,e)):ur(bi),rr(bi,r)}var Es=null,nT=!1,WA=!1;function z9(e){Es===null?Es=[e]:Es.push(e)}function Sle(e){nT=!0,z9(e)}function Ru(){if(!WA&&Es!==null){WA=!0;var e=0,t=Vt;try{var r=Es;for(Vt=1;e>=o,i-=o,Ds=1<<32-ao(t)+i|r<P?(O=A,A=null):O=A.sibling;var k=h(x,A,b[P],S);if(k===null){A===null&&(A=O);break}e&&A&&k.alternate===null&&t(x,A),_=a(k,_,P),C===null?T=k:C.sibling=k,C=k,A=O}if(P===b.length)return r(x,A),cr&&Ic(x,P),T;if(A===null){for(;PP?(O=A,A=null):O=A.sibling;var E=h(x,A,k.value,S);if(E===null){A===null&&(A=O);break}e&&A&&E.alternate===null&&t(x,A),_=a(E,_,P),C===null?T=E:C.sibling=E,C=E,A=O}if(k.done)return r(x,A),cr&&Ic(x,P),T;if(A===null){for(;!k.done;P++,k=b.next())k=f(x,k.value,S),k!==null&&(_=a(k,_,P),C===null?T=k:C.sibling=k,C=k);return cr&&Ic(x,P),T}for(A=n(x,A);!k.done;P++,k=b.next())k=d(A,x,P,k.value,S),k!==null&&(e&&k.alternate!==null&&A.delete(k.key===null?P:k.key),_=a(k,_,P),C===null?T=k:C.sibling=k,C=k);return e&&A.forEach(function(N){return t(x,N)}),cr&&Ic(x,P),T}function y(x,_,b,S){if(typeof b=="object"&&b!==null&&b.type===rd&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case jx:e:{for(var T=b.key,C=_;C!==null;){if(C.key===T){if(T=b.type,T===rd){if(C.tag===7){r(x,C.sibling),_=i(C,b.props.children),_.return=x,x=_;break e}}else if(C.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===zl&&cB(T)===C.type){r(x,C.sibling),_=i(C,b.props),_.ref=Qp(x,C,b),_.return=x,x=_;break e}r(x,C);break}else t(x,C);C=C.sibling}b.type===rd?(_=ff(b.props.children,x.mode,S,b.key),_.return=x,x=_):(S=Fb(b.type,b.key,b.props,null,x.mode,S),S.ref=Qp(x,_,b),S.return=x,x=S)}return o(x);case td:e:{for(C=b.key;_!==null;){if(_.key===C)if(_.tag===4&&_.stateNode.containerInfo===b.containerInfo&&_.stateNode.implementation===b.implementation){r(x,_.sibling),_=i(_,b.children||[]),_.return=x,x=_;break e}else{r(x,_);break}else t(x,_);_=_.sibling}_=JA(b,x.mode,S),_.return=x,x=_}return o(x);case zl:return C=b._init,y(x,_,C(b._payload),S)}if(Ug(b))return v(x,_,b,S);if(Yp(b))return m(x,_,b,S);Zx(x,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,_!==null&&_.tag===6?(r(x,_.sibling),_=i(_,b),_.return=x,x=_):(r(x,_),_=KA(b,x.mode,S),_.return=x,x=_),o(x)):r(x,_)}return y}var Gd=G9(!0),W9=G9(!1),C1=ju(null),A1=null,cd=null,vN=null;function pN(){vN=cd=A1=null}function gN(e){var t=C1.current;ur(C1),e._currentValue=t}function Bk(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 Md(e,t){A1=e,vN=cd=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(xi=!0),e.firstContext=null)}function Ma(e){var t=e._currentValue;if(vN!==e)if(e={context:e,memoizedValue:t,next:null},cd===null){if(A1===null)throw Error(we(308));cd=e,A1.dependencies={lanes:0,firstContext:e}}else cd=cd.next=e;return t}var Xc=null;function mN(e){Xc===null?Xc=[e]:Xc.push(e)}function H9(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,mN(t)):(r.next=i.next,i.next=r),t.interleaved=r,rl(e,n)}function rl(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 $l=!1;function yN(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function U9(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 Ws(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function uu(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Lt&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,rl(e,r)}return i=n.interleaved,i===null?(t.next=t,mN(n)):(t.next=i.next,i.next=t),n.interleaved=t,rl(e,r)}function Db(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,nN(e,r)}}function fB(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 M1(e,t,r,n){var i=e.updateQueue;$l=!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 f=i.baseState;o=0,c=u=l=null,s=a;do{var h=s.lane,d=s.eventTime;if((n&h)===h){c!==null&&(c=c.next={eventTime:d,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var v=e,m=s;switch(h=t,d=r,m.tag){case 1:if(v=m.payload,typeof v=="function"){f=v.call(d,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=m.payload,h=typeof v=="function"?v.call(d,f,h):v,h==null)break e;f=_r({},f,h);break e;case 2:$l=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[s]:h.push(s))}else d={eventTime:d,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=d,l=f):c=c.next=d,o|=h;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;h=s,s=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(c===null&&(l=f),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);Af|=o,e.lanes=o,e.memoizedState=f}}function hB(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=UA.transition;UA.transition={};try{e(!1),t()}finally{Vt=r,UA.transition=n}}function uZ(){return Pa().memoizedState}function Mle(e,t,r){var n=fu(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},cZ(e))fZ(t,r);else if(r=H9(e,t,r,n),r!==null){var i=ai();oo(r,e,n,i),hZ(r,t,n)}}function Ple(e,t,r){var n=fu(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(cZ(e))fZ(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,fo(s,o)){var l=t.interleaved;l===null?(i.next=i,mN(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=H9(e,t,i,n),r!==null&&(i=ai(),oo(r,e,n,i),hZ(r,t,n))}}function cZ(e){var t=e.alternate;return e===mr||t!==null&&t===mr}function fZ(e,t){vm=k1=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function hZ(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,nN(e,r)}}var L1={readContext:Ma,useCallback:zn,useContext:zn,useEffect:zn,useImperativeHandle:zn,useInsertionEffect:zn,useLayoutEffect:zn,useMemo:zn,useReducer:zn,useRef:zn,useState:zn,useDebugValue:zn,useDeferredValue:zn,useTransition:zn,useMutableSource:zn,useSyncExternalStore:zn,useId:zn,unstable_isNewReconciler:!1},kle={readContext:Ma,useCallback:function(e,t){return No().memoizedState=[e,t===void 0?null:t],e},useContext:Ma,useEffect:vB,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Rb(4194308,4,iZ.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Rb(4194308,4,e,t)},useInsertionEffect:function(e,t){return Rb(4,2,e,t)},useMemo:function(e,t){var r=No();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=No();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=Mle.bind(null,mr,e),[n.memoizedState,e]},useRef:function(e){var t=No();return e={current:e},t.memoizedState=e},useState:dB,useDebugValue:AN,useDeferredValue:function(e){return No().memoizedState=e},useTransition:function(){var e=dB(!1),t=e[0];return e=Ale.bind(null,e[1]),No().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=mr,i=No();if(cr){if(r===void 0)throw Error(we(407));r=r()}else{if(r=t(),yn===null)throw Error(we(349));Cf&30||q9(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,vB(J9.bind(null,n,a,e),[e]),n.flags|=2048,ry(9,K9.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=No(),t=yn.identifierPrefix;if(cr){var r=js,n=Ds;r=(n&~(1<<32-ao(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=ey++,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[jo]=t,e[Km]=n,wZ(e,t,!1,!1),t.stateNode=e;e:{switch(o=_k(r,n),r){case"dialog":or("cancel",e),or("close",e),i=n;break;case"iframe":case"object":case"embed":or("load",e),i=n;break;case"video":case"audio":for(i=0;iUd&&(t.flags|=128,n=!0,eg(a,!1),t.lanes=4194304)}else{if(!n)if(e=P1(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),eg(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!cr)return $n(t),null}else 2*jr()-a.renderingStartTime>Ud&&r!==1073741824&&(t.flags|=128,n=!0,eg(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=jr(),t.sibling=null,r=gr.current,rr(gr,n?r&1|2:r&1),t):($n(t),null);case 22:case 23:return IN(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Ei&1073741824&&($n(t),t.subtreeFlags&6&&(t.flags|=8192)):$n(t),null;case 24:return null;case 25:return null}throw Error(we(156,t.tag))}function Rle(e,t){switch(hN(t),t.tag){case 1:return wi(t.type)&&b1(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wd(),ur(bi),ur(Kn),bN(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return _N(t),null;case 13:if(ur(gr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(we(340));Vd()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ur(gr),null;case 4:return Wd(),null;case 10:return gN(t.type._context),null;case 22:case 23:return IN(),null;case 24:return null;default:return null}}var Xx=!1,Un=!1,Ble=typeof WeakSet=="function"?WeakSet:Set,ze=null;function fd(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Sr(e,t,n)}else r.current=null}function Zk(e,t,r){try{r()}catch(n){Sr(e,t,n)}}var CB=!1;function zle(e,t){if(Lk=m1,e=k9(),cN(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,f=e,h=null;t:for(;;){for(var d;f!==r||i!==0&&f.nodeType!==3||(s=o+i),f!==a||n!==0&&f.nodeType!==3||(l=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===e)break t;if(h===r&&++u===i&&(s=o),h===a&&++c===n&&(l=o),(d=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=d}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ok={focusedElem:e,selectionRange:r},m1=!1,ze=t;ze!==null;)if(t=ze,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ze=e;else for(;ze!==null;){t=ze;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var m=v.memoizedProps,y=v.memoizedState,x=t.stateNode,_=x.getSnapshotBeforeUpdate(t.elementType===t.type?m:Xa(t.type,m),y);x.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(we(163))}}catch(S){Sr(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,ze=e;break}ze=t.return}return v=CB,CB=!1,v}function pm(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&&Zk(t,r,a)}i=i.next}while(i!==n)}}function oT(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 Yk(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 CZ(e){var t=e.alternate;t!==null&&(e.alternate=null,CZ(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jo],delete t[Km],delete t[Nk],delete t[ble],delete t[wle])),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 AZ(e){return e.tag===5||e.tag===3||e.tag===4}function AB(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||AZ(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 Xk(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=_1));else if(n!==4&&(e=e.child,e!==null))for(Xk(e,t,r),e=e.sibling;e!==null;)Xk(e,t,r),e=e.sibling}function qk(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(qk(e,t,r),e=e.sibling;e!==null;)qk(e,t,r),e=e.sibling}var Cn=null,Ka=!1;function Cl(e,t,r){for(r=r.child;r!==null;)MZ(e,t,r),r=r.sibling}function MZ(e,t,r){if(Zo&&typeof Zo.onCommitFiberUnmount=="function")try{Zo.onCommitFiberUnmount(JS,r)}catch{}switch(r.tag){case 5:Un||fd(r,t);case 6:var n=Cn,i=Ka;Cn=null,Cl(e,t,r),Cn=n,Ka=i,Cn!==null&&(Ka?(e=Cn,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Cn.removeChild(r.stateNode));break;case 18:Cn!==null&&(Ka?(e=Cn,r=r.stateNode,e.nodeType===8?GA(e.parentNode,r):e.nodeType===1&&GA(e,r),Um(e)):GA(Cn,r.stateNode));break;case 4:n=Cn,i=Ka,Cn=r.stateNode.containerInfo,Ka=!0,Cl(e,t,r),Cn=n,Ka=i;break;case 0:case 11:case 14:case 15:if(!Un&&(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)&&Zk(r,t,o),i=i.next}while(i!==n)}Cl(e,t,r);break;case 1:if(!Un&&(fd(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Sr(r,t,s)}Cl(e,t,r);break;case 21:Cl(e,t,r);break;case 22:r.mode&1?(Un=(n=Un)||r.memoizedState!==null,Cl(e,t,r),Un=n):Cl(e,t,r);break;default:Cl(e,t,r)}}function MB(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Ble),t.forEach(function(n){var i=Yle.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Va(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=jr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Fle(n/1960))-n,10e?16:e,Yl===null)var n=!1;else{if(e=Yl,Yl=null,E1=0,Lt&6)throw Error(we(331));var i=Lt;for(Lt|=4,ze=e.current;ze!==null;){var a=ze,o=a.child;if(ze.flags&16){var s=a.deletions;if(s!==null){for(var l=0;ljr()-LN?cf(e,0):kN|=r),Si(e,t)}function DZ(e,t){t===0&&(e.mode&1?(t=$x,$x<<=1,!($x&130023424)&&($x=4194304)):t=1);var r=ai();e=rl(e,t),e!==null&&(C0(e,t,r),Si(e,r))}function Zle(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),DZ(e,r)}function Yle(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(we(314))}n!==null&&n.delete(t),DZ(e,r)}var jZ;jZ=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||bi.current)xi=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return xi=!1,Dle(e,t,r);xi=!!(e.flags&131072)}else xi=!1,cr&&t.flags&1048576&&$9(t,T1,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Bb(e,t),e=t.pendingProps;var i=Fd(t,Kn.current);Md(t,r),i=SN(null,t,n,e,i,r);var a=TN();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,wi(n)?(a=!0,w1(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,yN(t),i.updater=aT,t.stateNode=i,i._reactInternals=t,$k(t,n,e,r),t=Gk(null,t,n,!0,a,r)):(t.tag=0,cr&&a&&fN(t),ei(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Bb(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=qle(n),e=Xa(n,e),i){case 0:t=Vk(null,t,n,e,r);break e;case 1:t=wB(null,t,n,e,r);break e;case 11:t=_B(null,t,n,e,r);break e;case 14:t=bB(null,t,n,Xa(n.type,e),r);break e}throw Error(we(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Xa(n,i),Vk(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Xa(n,i),wB(e,t,n,i,r);case 3:e:{if(xZ(t),e===null)throw Error(we(387));n=t.pendingProps,a=t.memoizedState,i=a.element,U9(e,t),M1(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=Hd(Error(we(423)),t),t=SB(e,t,n,r,i);break e}else if(n!==i){i=Hd(Error(we(424)),t),t=SB(e,t,n,r,i);break e}else for($i=lu(t.stateNode.containerInfo.firstChild),Hi=t,cr=!0,eo=null,r=W9(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Vd(),n===i){t=nl(e,t,r);break e}ei(e,t,n,r)}t=t.child}return t;case 5:return Z9(t),e===null&&Rk(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Ik(n,i)?o=null:a!==null&&Ik(n,a)&&(t.flags|=32),yZ(e,t),ei(e,t,o,r),t.child;case 6:return e===null&&Rk(t),null;case 13:return _Z(e,t,r);case 4:return xN(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Gd(t,null,n,r):ei(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Xa(n,i),_B(e,t,n,i,r);case 7:return ei(e,t,t.pendingProps,r),t.child;case 8:return ei(e,t,t.pendingProps.children,r),t.child;case 12:return ei(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,rr(C1,n._currentValue),n._currentValue=o,a!==null)if(fo(a.value,o)){if(a.children===i.children&&!bi.current){t=nl(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=Ws(-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),Bk(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(we(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),Bk(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}ei(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Md(t,r),i=Ma(i),n=n(i),t.flags|=1,ei(e,t,n,r),t.child;case 14:return n=t.type,i=Xa(n,t.pendingProps),i=Xa(n.type,i),bB(e,t,n,i,r);case 15:return gZ(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Xa(n,i),Bb(e,t),t.tag=1,wi(n)?(e=!0,w1(t)):e=!1,Md(t,r),dZ(t,n,i),$k(t,n,i,r),Gk(null,t,n,!0,e,r);case 19:return bZ(e,t,r);case 22:return mZ(e,t,r)}throw Error(we(156,t.tag))};function RZ(e,t){return c9(e,t)}function Xle(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 xa(e,t,r,n){return new Xle(e,t,r,n)}function NN(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qle(e){if(typeof e=="function")return NN(e)?1:0;if(e!=null){if(e=e.$$typeof,e===QE)return 11;if(e===eN)return 14}return 2}function hu(e,t){var r=e.alternate;return r===null?(r=xa(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 Fb(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")NN(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case rd:return ff(r.children,i,a,t);case JE:o=8,i|=8;break;case ck:return e=xa(12,r,t,i|2),e.elementType=ck,e.lanes=a,e;case fk:return e=xa(13,r,t,i),e.elementType=fk,e.lanes=a,e;case hk:return e=xa(19,r,t,i),e.elementType=hk,e.lanes=a,e;case Z7:return lT(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H7:o=10;break e;case U7:o=9;break e;case QE:o=11;break e;case eN:o=14;break e;case zl:o=16,n=null;break e}throw Error(we(130,e==null?e:typeof e,""))}return t=xa(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function ff(e,t,r,n){return e=xa(7,e,n,t),e.lanes=r,e}function lT(e,t,r,n){return e=xa(22,e,n,t),e.elementType=Z7,e.lanes=r,e.stateNode={isHidden:!1},e}function KA(e,t,r){return e=xa(6,e,null,t),e.lanes=r,e}function JA(e,t,r){return t=xa(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Kle(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=IA(0),this.expirationTimes=IA(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=IA(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function DN(e,t,r,n,i,a,o,s,l){return e=new Kle(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=xa(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},yN(a),e}function Jle(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(FZ)}catch(e){console.error(e)}}FZ(),F7.exports=Yi;var VZ=F7.exports,DB=VZ;lk.createRoot=DB.createRoot,lk.hydrateRoot=DB.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 iy(){return iy=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function zN(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function iue(){return Math.random().toString(36).substr(2,8)}function RB(e,t){return{usr:e.state,key:e.key,idx:t}}function tL(e,t,r,n){return r===void 0&&(r=null),iy({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Bv(t):t,{state:r,key:t&&t.key||n||iue()})}function j1(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 Bv(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 aue(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=Xl.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(iy({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function f(){s=Xl.Pop;let y=c(),x=y==null?null:y-u;u=y,l&&l({action:s,location:m.location,delta:x})}function h(y,x){s=Xl.Push;let _=tL(m.location,y,x);u=c()+1;let b=RB(_,u),S=m.createHref(_);try{o.pushState(b,"",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=Xl.Replace;let _=tL(m.location,y,x);u=c();let b=RB(_,u),S=m.createHref(_);o.replaceState(b,"",S),a&&l&&l({action:s,location:m.location,delta:0})}function v(y){let x=i.location.origin!=="null"?i.location.origin:i.location.href,_=typeof y=="string"?y:j1(y);return _=_.replace(/ $/,"%20"),Ur(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(jB,f),l=y,()=>{i.removeEventListener(jB,f),l=null}},createHref(y){return t(i,y)},createURL:v,encodeLocation(y){let x=v(y);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:d,go(y){return o.go(y)}};return m}var BB;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(BB||(BB={}));function oue(e,t,r){return r===void 0&&(r="/"),sue(e,t,r)}function sue(e,t,r,n){let i=typeof t=="string"?Bv(t):t,a=$N(i.pathname||"/",r);if(a==null)return null;let o=GZ(e);lue(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("/")&&(Ur(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=du([n,l.relativePath]),c=r.concat(l);a.children&&a.children.length>0&&(Ur(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),GZ(a.children,t,c,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:pue(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 WZ(a.path))i(a,o,l)}),t}function WZ(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=WZ(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 lue(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:gue(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const uue=/^:[\w-]+$/,cue=3,fue=2,hue=1,due=10,vue=-2,zB=e=>e==="*";function pue(e,t){let r=e.split("/"),n=r.length;return r.some(zB)&&(n+=vue),t&&(n+=fue),r.filter(i=>!zB(i)).reduce((i,a)=>i+(uue.test(a)?cue:a===""?hue:due),n)}function gue(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 mue(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:h,isOptional:d}=c;if(h==="*"){let m=s[f]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const v=s[f];return d&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function xue(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),zN(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 _ue(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return zN(!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 $N(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 bue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wue=e=>bue.test(e);function Sue(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?Bv(e):e,a;if(r)if(wue(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),zN(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=$B(r.substring(1),"/"):a=$B(r,t)}else a=t;return{pathname:a,search:Aue(n),hash:Mue(i)}}function $B(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 QA(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 Tue(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function HZ(e,t){let r=Tue(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function UZ(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=Bv(e):(i=iy({},e),Ur(!i.pathname||!i.pathname.includes("?"),QA("?","pathname","search",i)),Ur(!i.pathname||!i.pathname.includes("#"),QA("#","pathname","hash",i)),Ur(!i.search||!i.search.includes("#"),QA("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}s=f>=0?t[f]:"/"}let l=Sue(i,s),u=o&&o!=="/"&&o.endsWith("/"),c=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const du=e=>e.join("/").replace(/\/\/+/g,"/"),Cue=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Aue=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Mue=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Pue(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ZZ=["post","put","patch","delete"];new Set(ZZ);const kue=["get",...ZZ];new Set(kue);/** + * 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 ay(){return ay=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 f=UZ(u,JSON.parse(o),a,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:du([t,f.pathname])),(c.replace?n.replace:n.push)(f,c.state,c)},[t,n,o,a,e])}function KZ(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=G.useContext(Uf),{matches:i}=G.useContext(Zf),{pathname:a}=zv(),o=JSON.stringify(HZ(i,n.v7_relativeSplatPath));return G.useMemo(()=>UZ(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function Eue(e,t){return Nue(e,t)}function Nue(e,t,r,n){k0()||Ur(!1);let{navigator:i}=G.useContext(Uf),{matches:a}=G.useContext(Zf),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=zv(),c;if(t){var f;let y=typeof t=="string"?Bv(t):t;l==="/"||(f=y.pathname)!=null&&f.startsWith(l)||Ur(!1),c=y}else c=u;let h=c.pathname||"/",d=h;if(l!=="/"){let y=l.replace(/^\//,"").split("/");d="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let v=oue(e,{pathname:d}),m=zue(v&&v.map(y=>Object.assign({},y,{params:Object.assign({},s,y.params),pathname:du([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:du([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,r,n);return t&&m?G.createElement(dT.Provider,{value:{location:ay({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Xl.Pop}},m):m}function Due(){let e=Gue(),t=Pue(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 jue=G.createElement(Due,null);class Rue 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(Zf.Provider,{value:this.props.routeContext},G.createElement(YZ.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Bue(e){let{routeContext:t,match:r,children:n}=e,i=G.useContext(FN);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),G.createElement(Zf.Provider,{value:t},n)}function zue(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(f=>f.route.id&&(s==null?void 0:s[f.route.id])!==void 0);c>=0||Ur(!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,f,h)=>{let d,v=!1,m=null,y=null;r&&(d=s&&f.route.id?s[f.route.id]:void 0,m=f.route.errorElement||jue,l&&(u<0&&h===0?(Hue("route-fallback"),v=!0,y=null):u===h&&(v=!0,y=f.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,h+1)),_=()=>{let b;return d?b=m:v?b=y:f.route.Component?b=G.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=c,G.createElement(Bue,{match:f,routeContext:{outlet:c,matches:x,isDataRoute:r!=null},children:b})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?G.createElement(Rue,{location:r.location,revalidation:r.revalidation,component:m,error:d,children:_(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):_()},null)}var JZ=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(JZ||{}),QZ=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}(QZ||{});function $ue(e){let t=G.useContext(FN);return t||Ur(!1),t}function Fue(e){let t=G.useContext(Lue);return t||Ur(!1),t}function Vue(e){let t=G.useContext(Zf);return t||Ur(!1),t}function eY(e){let t=Vue(),r=t.matches[t.matches.length-1];return r.route.id||Ur(!1),r.route.id}function Gue(){var e;let t=G.useContext(YZ),r=Fue(),n=eY();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function Wue(){let{router:e}=$ue(JZ.UseNavigateStable),t=eY(QZ.UseNavigateStable),r=G.useRef(!1);return XZ(()=>{r.current=!0}),G.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,ay({fromRouteId:t},a)))},[e,t])}const FB={};function Hue(e,t,r){FB[e]||(FB[e]=!0)}function Uue(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Ha(e){Ur(!1)}function Zue(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Xl.Pop,navigator:a,static:o=!1,future:s}=e;k0()&&Ur(!1);let l=t.replace(/^\/*/,"/"),u=G.useMemo(()=>({basename:l,navigator:a,static:o,future:ay({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=Bv(n));let{pathname:c="/",search:f="",hash:h="",state:d=null,key:v="default"}=n,m=G.useMemo(()=>{let y=$N(c,l);return y==null?null:{location:{pathname:y,search:f,hash:h,state:d,key:v},navigationType:i}},[l,c,f,h,d,v,i]);return m==null?null:G.createElement(Uf.Provider,{value:u},G.createElement(dT.Provider,{children:r,value:m}))}function Yue(e){let{children:t,location:r}=e;return Eue(rL(t),r)}new Promise(()=>{});function rL(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,rL(n.props.children,a));return}n.type!==Ha&&Ur(!1),!n.props.index||!n.props.children||Ur(!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=rL(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 nL(){return nL=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function que(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kue(e,t){return e.button===0&&(!t||t==="_self")&&!que(e)}const Jue=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Que="6";try{window.__reactRouterVersion=Que}catch{}const ece="startTransition",VB=Uoe[ece];function tce(e){let{basename:t,children:r,future:n,window:i}=e,a=G.useRef();a.current==null&&(a.current=nue({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(f=>{u&&VB?VB(()=>l(f)):l(f)},[l,u]);return G.useLayoutEffect(()=>o.listen(c),[o,c]),G.useEffect(()=>Uue(n),[n]),G.createElement(Zue,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const rce=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nce=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ice=G.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:c,viewTransition:f}=t,h=Xue(t,Jue),{basename:d}=G.useContext(Uf),v,m=!1;if(typeof u=="string"&&nce.test(u)&&(v=u,rce))try{let b=new URL(window.location.href),S=u.startsWith("//")?new URL(b.protocol+u):new URL(u),T=$N(S.pathname,d);S.origin===b.origin&&T!=null?u=T+S.search+S.hash:m=!0}catch{}let y=Oue(u,{relative:i}),x=ace(u,{replace:o,state:s,target:l,preventScrollReset:c,relative:i,viewTransition:f});function _(b){n&&n(b),b.defaultPrevented||x(b)}return G.createElement("a",nL({},h,{href:v||y,onClick:m||a?n:_,ref:r,target:l}))});var GB;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(GB||(GB={}));var WB;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(WB||(WB={}));function ace(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=qZ(),u=zv(),c=KZ(e,{relative:o});return G.useCallback(f=>{if(Kue(f,r)){f.preventDefault();let h=n!==void 0?n:j1(u)===j1(c);l(e,{replace:h,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 oce=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tY=(...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 sce={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 lce=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,...sce,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:tY("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 Fe=(e,t)=>{const r=G.forwardRef(({className:n,...i},a)=>G.createElement(lce,{ref:a,iconNode:t,className:tY(`lucide-${oce(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 $v=Fe("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 e2=Fe("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 uce=Fe("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 oy=Fe("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 rY=Fe("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 cce=Fe("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 fce=Fe("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 hce=Fe("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 vT=Fe("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 ts=Fe("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 Bu=Fe("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 dce=Fe("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 Au=Fe("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 vce=Fe("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 Mu=Fe("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 VN=Fe("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 Pf=Fe("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 pce=Fe("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 Pu=Fe("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 gce=Fe("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 nY=Fe("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 mce=Fe("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 iY=Fe("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 yce=Fe("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 aY=Fe("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 pT=Fe("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 Zd=Fe("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 oY=Fe("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 GN=Fe("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 WN=Fe("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 gT=Fe("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 xce=Fe("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 _ce=Fe("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 mT=Fe("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 sY=Fe("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 lY=Fe("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 L0=Fe("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 bce=Fe("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 Fv=Fe("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 wce=Fe("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 HN=Fe("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 yT=Fe("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 uY=Fe("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 Vv=Fe("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 ho=Fe("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 sy=Fe("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 xT=Fe("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 Sce=Fe("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 _T=Fe("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 UN=Fe("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 bT=Fe("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 iL=Fe("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 Tce=Fe("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 cY=Fe("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 ZN=Fe("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 Cce=Fe("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 fY=Fe("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 hY=Fe("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 O0=Fe("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 il=Fe("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 Ace=Fe("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 dY=Fe("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 wT=Fe("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 vo=Fe("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 ly=Fe("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 qi(e){const t=await fetch(e);if(!t.ok)throw new Error(`API error: ${t.status} ${t.statusText}`);return t.json()}async function HB(){return qi("/api/status")}async function Mce(){return qi("/api/health")}async function Pce(){return qi("/api/nodes")}async function kce(){return qi("/api/edges")}async function Lce(){return qi("/api/sources")}async function vY(){return qi("/api/alerts/active")}async function UB(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),qi(`/api/alerts/history?${i.toString()}`)}async function Oce(){return qi("/api/subscriptions")}async function pY(){return qi("/api/env/status")}async function gY(){return qi("/api/env/active")}async function Ice(){return qi("/api/env/swpc")}async function Ece(){return qi("/api/env/ducting")}async function Nce(){return qi("/api/regions")}function YN(){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),f=G.useCallback(()=>{var v;if(((v=l.current)==null?void 0:v.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),f()},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(()=>(f(),()=>{u.current&&clearTimeout(u.current),l.current&&l.current.close()}),[f]),{connected:e,lastHealth:r,lastAlert:i,lastMessage:o}}const mY=G.createContext(null);function Dce(){const e=G.useContext(mY);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}function jce(e){switch(e==null?void 0:e.toLowerCase()){case"critical":case"emergency":return{bg:"bg-red-500/10",border:"border-red-500",icon:Mu,iconColor:"text-red-500"};case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:il,iconColor:"text-amber-500"};default:return{bg:"bg-blue-500/10",border:"border-blue-500",icon:mT,iconColor:"text-blue-500"}}}function Rce({toast:e,onDismiss:t,onNavigate:r}){const n=jce(e.alert.severity),i=n.icon;return G.useEffect(()=>{const a=setTimeout(t,8e3);return()=>clearTimeout(a)},[t]),p.jsx("div",{className:`${n.bg} border ${n.border} rounded-lg shadow-lg overflow-hidden animate-slide-in cursor-pointer`,onClick:r,role:"alert",children:p.jsxs("div",{className:"flex items-start gap-3 p-4",children:[p.jsx("div",{className:`w-1 self-stretch -ml-4 -my-4 ${n.border.replace("border","bg")}`}),p.jsx(i,{size:18,className:n.iconColor}),p.jsxs("div",{className:"flex-1 min-w-0 pr-2",children:[p.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())}),p.jsx("div",{className:"text-sm text-slate-300 line-clamp-2",children:e.alert.message})]}),p.jsx("button",{onClick:a=>{a.stopPropagation(),t()},className:"text-slate-400 hover:text-slate-200 transition-colors",children:p.jsx(vo,{size:16})})]})})}function Bce({children:e}){const[t,r]=G.useState([]),n=qZ(),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 p.jsxs(mY.Provider,{value:{addToast:i},children:[e,p.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=>p.jsx("div",{className:"pointer-events-auto",children:p.jsx(Rce,{toast:s,onDismiss:()=>a(s.id),onNavigate:o})},s.id))})]})}const ST="meshai.restartRequired.v1";function ZB(){try{const e=localStorage.getItem(ST);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 zce(e){const t={required:!0,changedKeys:[...new Set(e)],ts:Date.now()};localStorage.setItem(ST,JSON.stringify(t)),window.dispatchEvent(new CustomEvent("meshai:restart-required",{detail:t}))}function YB(){localStorage.removeItem(ST),window.dispatchEvent(new CustomEvent("meshai:restart-required",{detail:{required:!1,changedKeys:[],ts:0}}))}function $ce(){const[e,t]=G.useState(()=>ZB()),[r,n]=G.useState(!1),[i,a]=G.useState(null);G.useEffect(()=>{const l=c=>{const f=c.detail;t(f)},u=c=>{c.key===ST&&t(ZB())};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}`)}YB()}catch(l){a(String(l)),n(!1)}},[]),s=G.useCallback(()=>{YB()},[]);return e.required?p.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:[p.jsx(il,{className:"w-4 h-4 flex-shrink-0 text-yellow-300"}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("strong",{children:"Container restart required"}),e.changedKeys.length>0&&p.jsxs("span",{className:"text-yellow-300 ml-2",children:["(",e.changedKeys.length," key",e.changedKeys.length===1?"":"s",":"," ",p.jsxs("span",{className:"font-mono text-xs",children:[e.changedKeys.slice(0,3).join(", "),e.changedKeys.length>3?", …":""]}),")"]}),p.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&&p.jsx("div",{className:"text-red-400 text-xs mt-1",children:i})]}),p.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:[p.jsx(Sce,{className:`w-3 h-3 ${r?"animate-spin":""}`}),r?"Restarting…":"Restart now"]}),p.jsx("button",{onClick:s,className:"text-yellow-300 hover:text-white px-1",title:"Dismiss (you can still restart later)",children:p.jsx(vo,{className:"w-4 h-4"})})]}):null}const yY=[{path:"/",label:"Dashboard",icon:lY},{path:"/mesh",label:"Mesh",icon:ho},{path:"/environment",label:"Environment",icon:Pu},{path:"/config",label:"Config",icon:cY},{path:"/alerts",label:"Alerts",icon:oy},{path:"/notifications",label:"Notifications",icon:uce},{path:"/reference",label:"Reference",icon:rY},{path:"/adapter-config",label:"Adapter Config",icon:ZN},{path:"/gauge-sites",label:"Gauge Sites",icon:pT},{path:"/town-anchors",label:"Town Anchors",icon:Fv}];function Fce(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 Vce(e){const t=yY.find(r=>r.path===e);return(t==null?void 0:t.label)||"Dashboard"}function Gce({children:e}){var h;const t=zv(),{connected:r,lastAlert:n}=YN(),{addToast:i}=Dce(),[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(()=>{HB().then(o).catch(console.error);const d=setInterval(()=>{HB().then(o).catch(console.error)},3e4);return()=>clearInterval(d)},[]),G.useEffect(()=>{const d=setInterval(()=>c(new Date),1e3);return()=>clearInterval(d)},[]);const f=u.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return p.jsxs("div",{className:"flex h-screen overflow-hidden bg-bg text-slate-200",children:[p.jsxs("aside",{className:"w-[220px] flex-shrink-0 bg-bg-card border-r border-border flex flex-col overflow-y-auto",children:[p.jsx("div",{className:"p-5 border-b border-border",children:p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-blue-500 to-blue-700 flex items-center justify-center text-white font-bold text-xl",children:"M"}),p.jsxs("div",{children:[p.jsx("div",{className:"font-semibold text-lg",children:"MeshAI"}),p.jsxs("div",{className:"text-xs text-slate-500 font-mono",children:["v",(a==null?void 0:a.version)||"..."]})]})]})}),p.jsx("nav",{className:"flex-1 py-4",children:yY.map(d=>{const v=t.pathname===d.path,m=d.icon;return p.jsxs(ice,{to:d.path,className:`flex items-center gap-3 px-5 py-3 text-sm transition-colors relative ${v?"text-blue-400 bg-blue-500/10":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover"}`,children:[v&&p.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500"}),p.jsx(m,{size:18}),d.label]},d.path)})}),p.jsxs("div",{className:"p-5 border-t border-border",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("div",{className:`w-2 h-2 rounded-full ${a!=null&&a.connected?"bg-green-500":"bg-red-500"}`}),p.jsx("span",{className:"text-xs text-slate-400",children:a!=null&&a.connected?"Connected":"Disconnected"})]}),p.jsxs("div",{className:"text-xs text-slate-500 font-mono truncate",children:[(h=a==null?void 0:a.connection_type)==null?void 0:h.toUpperCase(),": ",a==null?void 0:a.connection_target]}),p.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:["Uptime: ",a?Fce(a.uptime_seconds):"..."]})]})]}),p.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p.jsxs("header",{className:"h-14 flex-shrink-0 border-b border-border bg-bg-card flex items-center justify-between px-6",children:[p.jsx("h1",{className:"text-lg font-semibold",children:Vce(t.pathname)}),p.jsxs("div",{className:"flex items-center gap-6",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:`w-2 h-2 rounded-full ${r?"bg-green-500 animate-pulse-slow":"bg-slate-500"}`}),p.jsx("span",{className:"text-xs text-slate-400",children:r?"Live":"Offline"})]}),p.jsxs("div",{className:"text-sm font-mono text-slate-400",children:[f," MT"]})]})]}),p.jsxs("main",{className:"flex-1 overflow-y-auto p-6",children:[p.jsx($ce,{}),e]})]})]})}function xY(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}var Vhe=Fhe,Ghe=CT;function Whe(e,t){var r=this.__data__,n=Ghe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Hhe=Whe,Uhe=Phe,Zhe=jhe,Yhe=zhe,Xhe=Vhe,qhe=Hhe;function Uv(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},Kc=function(t){return kf(t)&&t.indexOf("%")===t.length-1},Me=function(t){return gve(t)&&!Yv(t)},_ve=function(t){return mt(t)},rn=function(t){return Me(t)||kf(t)},bve=0,Xv=function(t){var r=++bve;return"".concat(t||"").concat(r)},Lf=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Me(t)&&!kf(t))return n;var a;if(Kc(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return Yv(a)&&(a=n),i&&a>r&&(a=r),a},qh=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},wve=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kve(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function oL(e){"@babel/helpers - typeof";return oL=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oL(e)}var oz={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Hs=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},sz=null,n2=null,oD=function e(t){if(t===sz&&Array.isArray(n2))return n2;var r=[];return G.Children.forEach(t,function(n){mt(n)||(fve.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),n2=r,sz=t,r};function Ta(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Hs(i)}):n=[Hs(t)],oD(e).forEach(function(i){var a=Sa(i,"type.displayName")||Sa(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function Ni(e,t){var r=Ta(e,t);return r&&r[0]}var lz=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!Me(n)||n<=0||!Me(i)||i<=0)},Lve=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Ove=function(t){return t&&t.type&&kf(t.type)&&Lve.indexOf(t.type)>=0},IY=function(t){return t&&oL(t)==="object"&&"clipDot"in t},Ive=function(t,r,n,i){var a,o=(a=r2==null?void 0:r2[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!pt(t)&&(i&&o.includes(r)||Cve.includes(r))||n&&aD.includes(r)},vt=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(G.isValidElement(t)&&(i=t.props),!Wv(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;Ive((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},sL=function e(t,r){if(t===r)return!0;var n=G.Children.count(t);if(n!==G.Children.count(r))return!1;if(n===0)return!0;if(n===1)return uz(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Rve(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uL(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,l=e.desc,u=jve(e,Dve),c=i||{width:r,height:n,x:0,y:0},f=Ct("recharts-surface",a);return Q.createElement("svg",lL({},vt(u,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(c.x," ").concat(c.y," ").concat(c.width," ").concat(c.height)}),Q.createElement("title",null,s),Q.createElement("desc",null,l),t)}var Bve=["children","className"];function cL(){return cL=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $ve(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var nr=Q.forwardRef(function(e,t){var r=e.children,n=e.className,i=zve(e,Bve),a=Ct("recharts-layer",n);return Q.createElement("g",cL({className:a},vt(i,!0),{ref:t}),r)}),hf=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:Gve(e,t,r)}var Hve=Wve,Uve="\\ud800-\\udfff",Zve="\\u0300-\\u036f",Yve="\\ufe20-\\ufe2f",Xve="\\u20d0-\\u20ff",qve=Zve+Yve+Xve,Kve="\\ufe0e\\ufe0f",Jve="\\u200d",Qve=RegExp("["+Jve+Uve+qve+Kve+"]");function epe(e){return Qve.test(e)}var EY=epe;function tpe(e){return e.split("")}var rpe=tpe,NY="\\ud800-\\udfff",npe="\\u0300-\\u036f",ipe="\\ufe20-\\ufe2f",ape="\\u20d0-\\u20ff",ope=npe+ipe+ape,spe="\\ufe0e\\ufe0f",lpe="["+NY+"]",fL="["+ope+"]",hL="\\ud83c[\\udffb-\\udfff]",upe="(?:"+fL+"|"+hL+")",DY="[^"+NY+"]",jY="(?:\\ud83c[\\udde6-\\uddff]){2}",RY="[\\ud800-\\udbff][\\udc00-\\udfff]",cpe="\\u200d",BY=upe+"?",zY="["+spe+"]?",fpe="(?:"+cpe+"(?:"+[DY,jY,RY].join("|")+")"+zY+BY+")*",hpe=zY+BY+fpe,dpe="(?:"+[DY+fL+"?",fL,jY,RY,lpe].join("|")+")",vpe=RegExp(hL+"(?="+hL+")|"+dpe+hpe,"g");function ppe(e){return e.match(vpe)||[]}var gpe=ppe,mpe=rpe,ype=EY,xpe=gpe;function _pe(e){return ype(e)?xpe(e):mpe(e)}var bpe=_pe,wpe=Hve,Spe=EY,Tpe=bpe,Cpe=AY;function Ape(e){return function(t){t=Cpe(t);var r=Spe(t)?Tpe(t):void 0,n=r?r[0]:t.charAt(0),i=r?wpe(r,1).join(""):t.slice(1);return n[e]()+i}}var Mpe=Ape,Ppe=Mpe,kpe=Ppe("toUpperCase"),Lpe=kpe;const zT=Yt(Lpe);function tr(e){return function(){return e}}const $Y=Math.cos,$1=Math.sin,yo=Math.sqrt,F1=Math.PI,$T=2*F1,dL=Math.PI,vL=2*dL,Nc=1e-6,Ope=vL-Nc;function FY(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return FY;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;iNc)if(!(Math.abs(f*l-u*c)>Nc)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let d=n-o,v=i-s,m=l*l+u*u,y=d*d+v*v,x=Math.sqrt(m),_=Math.sqrt(h),b=a*Math.tan((dL-Math.acos((m+h-y)/(2*x*_)))/2),S=b/_,T=b/x;Math.abs(S-1)>Nc&&this._append`L${t+S*c},${r+S*f}`,this._append`A${a},${a},0,0,${+(f*d>c*v)},${this._x1=t+T*l},${this._y1=r+T*u}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=t+s,c=r+l,f=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>Nc||Math.abs(this._y1-c)>Nc)&&this._append`L${u},${c}`,n&&(h<0&&(h=h%vL+vL),h>Ope?this._append`A${n},${n},0,1,${f},${t-s},${r-l}A${n},${n},0,1,${f},${this._x1=u},${this._y1=c}`:h>Nc&&this._append`A${n},${n},0,${+(h>=dL)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function sD(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Epe(t)}function lD(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function VY(e){this._context=e}VY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function FT(e){return new VY(e)}function GY(e){return e[0]}function WY(e){return e[1]}function HY(e,t){var r=tr(!0),n=null,i=FT,a=null,o=sD(s);e=typeof e=="function"?e:e===void 0?GY:tr(e),t=typeof t=="function"?t:t===void 0?WY:tr(t);function s(l){var u,c=(l=lD(l)).length,f,h=!1,d;for(n==null&&(a=i(d=o())),u=0;u<=c;++u)!(u=d;--v)s.point(b[v],S[v]);s.lineEnd(),s.areaEnd()}x&&(b[h]=+e(y,h,f),S[h]=+t(y,h,f),s.point(n?+n(y,h,f):b[h],r?+r(y,h,f):S[h]))}if(_)return s=null,_+""||null}function c(){return HY().defined(i).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:tr(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:tr(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:tr(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:tr(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:tr(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:tr(+f),u):r},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(r)},u.lineX1=function(){return c().x(n).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:tr(!!f),u):i},u.curve=function(f){return arguments.length?(o=f,a!=null&&(s=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=s=null:s=o(a=f),u):a},u}class UY{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Npe(e){return new UY(e,!0)}function Dpe(e){return new UY(e,!1)}const uD={draw(e,t){const r=yo(t/F1);e.moveTo(r,0),e.arc(0,0,r,0,$T)}},jpe={draw(e,t){const r=yo(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},ZY=yo(1/3),Rpe=ZY*2,Bpe={draw(e,t){const r=yo(t/Rpe),n=r*ZY;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},zpe={draw(e,t){const r=yo(t),n=-r/2;e.rect(n,n,r,r)}},$pe=.8908130915292852,YY=$1(F1/10)/$1(7*F1/10),Fpe=$1($T/10)*YY,Vpe=-$Y($T/10)*YY,Gpe={draw(e,t){const r=yo(t*$pe),n=Fpe*r,i=Vpe*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=$T*a/5,s=$Y(o),l=$1(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},i2=yo(3),Wpe={draw(e,t){const r=-yo(t/(i2*3));e.moveTo(0,r*2),e.lineTo(-i2*r,-r),e.lineTo(i2*r,-r),e.closePath()}},na=-.5,ia=yo(3)/2,pL=1/yo(12),Hpe=(pL/2+1)*3,Upe={draw(e,t){const r=yo(t/Hpe),n=r/2,i=r*pL,a=n,o=r*pL+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(na*n-ia*i,ia*n+na*i),e.lineTo(na*a-ia*o,ia*a+na*o),e.lineTo(na*s-ia*l,ia*s+na*l),e.lineTo(na*n+ia*i,na*i-ia*n),e.lineTo(na*a+ia*o,na*o-ia*a),e.lineTo(na*s+ia*l,na*l-ia*s),e.closePath()}};function Zpe(e,t){let r=null,n=sD(i);e=typeof e=="function"?e:tr(e||uD),t=typeof t=="function"?t:tr(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:tr(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:tr(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function V1(){}function G1(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function XY(e){this._context=e}XY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:G1(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:G1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ype(e){return new XY(e)}function qY(e){this._context=e}qY.prototype={areaStart:V1,areaEnd:V1,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:G1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Xpe(e){return new qY(e)}function KY(e){this._context=e}KY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:G1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qpe(e){return new KY(e)}function JY(e){this._context=e}JY.prototype={areaStart:V1,areaEnd:V1,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Kpe(e){return new JY(e)}function fz(e){return e<0?-1:1}function hz(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(fz(a)+fz(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function dz(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function a2(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function W1(e){this._context=e}W1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:a2(this,this._t0,dz(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,a2(this,dz(this,r=hz(this,e,t)),r);break;default:a2(this,this._t0,r=hz(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function QY(e){this._context=new eX(e)}(QY.prototype=Object.create(W1.prototype)).point=function(e,t){W1.prototype.point.call(this,t,e)};function eX(e){this._context=e}eX.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function Jpe(e){return new W1(e)}function Qpe(e){return new QY(e)}function tX(e){this._context=e}tX.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=vz(e),i=vz(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function tge(e){return new VT(e,.5)}function rge(e){return new VT(e,0)}function nge(e){return new VT(e,1)}function Yd(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r=0;)r[t]=t;return r}function ige(e,t){return e[t]}function age(e){const t=[];return t.key=e,t}function oge(){var e=tr([]),t=gL,r=Yd,n=ige;function i(a){var o=Array.from(e.apply(this,arguments),age),s,l=o.length,u=-1,c;for(const f of a)for(s=0,++u;s0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function pge(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var rX={symbolCircle:uD,symbolCross:jpe,symbolDiamond:Bpe,symbolSquare:zpe,symbolStar:Gpe,symbolTriangle:Wpe,symbolWye:Upe},gge=Math.PI/180,mge=function(t){var r="symbol".concat(zT(t));return rX[r]||uD},yge=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*gge;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},xge=function(t,r){rX["symbol".concat(zT(t))]=r},cD=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,l=vge(t,cge),u=gz(gz({},l),{},{type:n,size:a,sizeType:s}),c=function(){var y=mge(n),x=Zpe().type(y).size(yge(a,s,n));return x()},f=u.className,h=u.cx,d=u.cy,v=vt(u,!0);return h===+h&&d===+d&&a===+a?Q.createElement("path",mL({},v,{className:Ct("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(d,")"),d:c()})):null};cD.registerSymbol=xge;function Xd(e){"@babel/helpers - typeof";return Xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xd(e)}function yL(){return yL=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var _=d.inactive?u:d.color;return Q.createElement("li",yL({className:y,style:f,key:"legend-item-".concat(v)},z1(n.props,d,v)),Q.createElement(uL,{width:o,height:o,viewBox:c,style:h},n.renderIcon(d)),Q.createElement("span",{className:"recharts-legend-item-text",style:{color:_}},m?m(x,d,v):x))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return Q.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(G.PureComponent);cy(fD,"displayName","Legend");cy(fD,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var kge=AT;function Lge(){this.__data__=new kge,this.size=0}var Oge=Lge;function Ige(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Ege=Ige;function Nge(e){return this.__data__.get(e)}var Dge=Nge;function jge(e){return this.__data__.has(e)}var Rge=jge,Bge=AT,zge=JN,$ge=QN,Fge=200;function Vge(e,t){var r=this.__data__;if(r instanceof Bge){var n=r.__data__;if(!zge||n.lengths))return!1;var u=a.get(e),c=a.get(t);if(u&&c)return u==t&&c==e;var f=-1,h=!0,d=r&cme?new ome:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=vye}var pD=pye,gye=ml,mye=pD,yye=yl,xye="[object Arguments]",_ye="[object Array]",bye="[object Boolean]",wye="[object Date]",Sye="[object Error]",Tye="[object Function]",Cye="[object Map]",Aye="[object Number]",Mye="[object Object]",Pye="[object RegExp]",kye="[object Set]",Lye="[object String]",Oye="[object WeakMap]",Iye="[object ArrayBuffer]",Eye="[object DataView]",Nye="[object Float32Array]",Dye="[object Float64Array]",jye="[object Int8Array]",Rye="[object Int16Array]",Bye="[object Int32Array]",zye="[object Uint8Array]",$ye="[object Uint8ClampedArray]",Fye="[object Uint16Array]",Vye="[object Uint32Array]",sr={};sr[Nye]=sr[Dye]=sr[jye]=sr[Rye]=sr[Bye]=sr[zye]=sr[$ye]=sr[Fye]=sr[Vye]=!0;sr[xye]=sr[_ye]=sr[Iye]=sr[bye]=sr[Eye]=sr[wye]=sr[Sye]=sr[Tye]=sr[Cye]=sr[Aye]=sr[Mye]=sr[Pye]=sr[kye]=sr[Lye]=sr[Oye]=!1;function Gye(e){return yye(e)&&mye(e.length)&&!!sr[gye(e)]}var Wye=Gye;function Hye(e){return function(t){return e(t)}}var dX=Hye,Y1={exports:{}};Y1.exports;(function(e,t){var r=_Y,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(Y1,Y1.exports);var Uye=Y1.exports,Zye=Wye,Yye=dX,Sz=Uye,Tz=Sz&&Sz.isTypedArray,Xye=Tz?Yye(Tz):Zye,vX=Xye,qye=Qme,Kye=dD,Jye=Ai,Qye=hX,e0e=vD,t0e=vX,r0e=Object.prototype,n0e=r0e.hasOwnProperty;function i0e(e,t){var r=Jye(e),n=!r&&Kye(e),i=!r&&!n&&Qye(e),a=!r&&!n&&!i&&t0e(e),o=r||n||i||a,s=o?qye(e.length,String):[],l=s.length;for(var u in e)(t||n0e.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||e0e(u,l)))&&s.push(u);return s}var a0e=i0e,o0e=Object.prototype;function s0e(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||o0e;return e===r}var l0e=s0e;function u0e(e,t){return function(r){return e(t(r))}}var pX=u0e,c0e=pX,f0e=c0e(Object.keys,Object),h0e=f0e,d0e=l0e,v0e=h0e,p0e=Object.prototype,g0e=p0e.hasOwnProperty;function m0e(e){if(!d0e(e))return v0e(e);var t=[];for(var r in Object(e))g0e.call(e,r)&&r!="constructor"&&t.push(r);return t}var y0e=m0e,x0e=qN,_0e=pD;function b0e(e){return e!=null&&_0e(e.length)&&!x0e(e)}var GT=b0e,w0e=a0e,S0e=y0e,T0e=GT;function C0e(e){return T0e(e)?w0e(e):S0e(e)}var gD=C0e,A0e=Fme,M0e=Kme,P0e=gD;function k0e(e){return A0e(e,P0e,M0e)}var L0e=k0e,Cz=L0e,O0e=1,I0e=Object.prototype,E0e=I0e.hasOwnProperty;function N0e(e,t,r,n,i,a){var o=r&O0e,s=Cz(e),l=s.length,u=Cz(t),c=u.length;if(l!=c&&!o)return!1;for(var f=l;f--;){var h=s[f];if(!(o?h in t:E0e.call(t,h)))return!1}var d=a.get(e),v=a.get(t);if(d&&v)return d==t&&v==e;var m=!0;a.set(e,t),a.set(t,e);for(var y=o;++f-1}var E_e=I_e;function N_e(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=X_e){var u=t?null:Z_e(e);if(u)return Y_e(u);o=!1,i=U_e,l=new G_e}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function fbe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function hbe(e){return e.value}function dbe(e,t){if(Q.isValidElement(e))return Q.cloneElement(e,t);if(typeof e=="function")return Q.createElement(e,t);t.ref;var r=cbe(t,rbe);return Q.createElement(fD,r)}var Fz=1,Ld=function(e){function t(){var r;nbe(this,t);for(var n=arguments.length,i=new Array(n),a=0;aFz||Math.abs(i.height-this.lastBoundingBox.height)>Fz)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ss({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,u=i.chartWidth,c=i.chartHeight,f,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var d=this.getBBoxSnapshot();f={left:((u||0)-d.width)/2}}else f=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var v=this.getBBoxSnapshot();h={top:((c||0)-v.height)/2}}else h=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Ss(Ss({},f),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,c=i.payload,f=Ss(Ss({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return Q.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(d){n.wrapperNode=d}},dbe(a,Ss(Ss({},this.props),{},{payload:bX(c,u,hbe)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Ss(Ss({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&Me(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(G.PureComponent);WT(Ld,"displayName","Legend");WT(Ld,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Vz=I0,vbe=dD,pbe=Ai,Gz=Vz?Vz.isConcatSpreadable:void 0;function gbe(e){return pbe(e)||vbe(e)||!!(Gz&&e&&e[Gz])}var mbe=gbe,ybe=cX,xbe=mbe;function TX(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=xbe),i||(i=[]);++a0&&r(s)?t>1?TX(s,t-1,r,n,i):ybe(i,s):n||(i[i.length]=s)}return i}var CX=TX;function _be(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var bbe=_be,wbe=bbe,Sbe=wbe(),Tbe=Sbe,Cbe=Tbe,Abe=gD;function Mbe(e,t){return e&&Cbe(e,t,Abe)}var AX=Mbe,Pbe=GT;function kbe(e,t){return function(r,n){if(r==null)return r;if(!Pbe(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++at||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var Gbe=Vbe,u2=tD,Wbe=rD,Hbe=Qv,Ube=MX,Zbe=Bbe,Ybe=dX,Xbe=Gbe,qbe=Jv,Kbe=Ai;function Jbe(e,t,r){t.length?t=u2(t,function(a){return Kbe(a)?function(o){return Wbe(o,a.length===1?a[0]:a)}:a}):t=[qbe];var n=-1;t=u2(t,Ybe(Hbe));var i=Ube(e,function(a,o,s){var l=u2(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return Zbe(i,function(a,o){return Xbe(a,o,r)})}var Qbe=Jbe;function e1e(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var t1e=e1e,r1e=t1e,Hz=Math.max;function n1e(e,t,r){return t=Hz(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=Hz(n.length-t,0),o=Array(a);++i0){if(++t>=d1e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var m1e=g1e,y1e=h1e,x1e=m1e,_1e=x1e(y1e),b1e=_1e,w1e=Jv,S1e=i1e,T1e=b1e;function C1e(e,t){return T1e(S1e(e,t,w1e),e+"")}var A1e=C1e,M1e=KN,P1e=GT,k1e=vD,L1e=zu;function O1e(e,t,r){if(!L1e(r))return!1;var n=typeof t;return(n=="number"?P1e(r)&&k1e(t,r.length):n=="string"&&t in r)?M1e(r[t],e):!1}var HT=O1e,I1e=CX,E1e=Qbe,N1e=A1e,Zz=HT,D1e=N1e(function(e,t){if(e==null)return[];var r=t.length;return r>1&&Zz(e,t[0],t[1])?t=[]:r>2&&Zz(t[0],t[1],t[2])&&(t=[t[0]]),E1e(e,I1e(t,1),[])}),j1e=D1e;const xD=Yt(j1e);function fy(e){"@babel/helpers - typeof";return fy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fy(e)}function AL(){return AL=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(ng,"-left"),Me(r)&&t&&Me(t.x)&&r=t.y),"".concat(ng,"-top"),Me(n)&&t&&Me(t.y)&&nm?Math.max(c,l[n]):Math.max(f,l[n])}function K1e(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function J1e(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,c,f;return o.height>0&&o.width>0&&r?(c=qz({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=qz({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=K1e({translateX:c,translateY:f,useTranslate3d:s})):u=X1e,{cssProperties:u,cssClasses:q1e({translateX:c,translateY:f,coordinate:r})}}function Kd(e){"@babel/helpers - typeof";return Kd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kd(e)}function Kz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Jz(e){for(var t=1;tQz||Math.abs(n.height-this.state.lastBoundingBox.height)>Qz)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,u=i.children,c=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,d=i.offset,v=i.position,m=i.reverseDirection,y=i.useTranslate3d,x=i.viewBox,_=i.wrapperStyle,b=J1e({allowEscapeViewBox:o,coordinate:c,offsetTopLeft:d,position:v,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:x}),S=b.cssClasses,T=b.cssProperties,C=Jz(Jz({transition:h&&a?"transform ".concat(s,"ms ").concat(l):void 0},T),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},_);return Q.createElement("div",{tabIndex:-1,className:S,style:C,ref:function(P){n.wrapperNode=P}},u)}}])}(G.PureComponent),lwe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Xf={isSsr:lwe()};function Jd(e){"@babel/helpers - typeof";return Jd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jd(e)}function e4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function t4(e){for(var t=1;t0;return Q.createElement(swe,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:h,active:a,coordinate:c,hasPayload:C,offset:d,position:y,reverseDirection:x,useTranslate3d:_,viewBox:b,wrapperStyle:S},ywe(u,t4(t4({},this.props),{},{payload:T})))}}])}(G.PureComponent);_D(Ls,"displayName","Tooltip");_D(Ls,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Xf.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var xwe=fs,_we=function(){return xwe.Date.now()},bwe=_we,wwe=/\s/;function Swe(e){for(var t=e.length;t--&&wwe.test(e.charAt(t)););return t}var Twe=Swe,Cwe=Twe,Awe=/^\s+/;function Mwe(e){return e&&e.slice(0,Cwe(e)+1).replace(Awe,"")}var Pwe=Mwe,kwe=Pwe,r4=zu,Lwe=Gv,n4=NaN,Owe=/^[-+]0x[0-9a-f]+$/i,Iwe=/^0b[01]+$/i,Ewe=/^0o[0-7]+$/i,Nwe=parseInt;function Dwe(e){if(typeof e=="number")return e;if(Lwe(e))return n4;if(r4(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=r4(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=kwe(e);var r=Iwe.test(e);return r||Ewe.test(e)?Nwe(e.slice(2),r?2:8):Owe.test(e)?n4:+e}var EX=Dwe,jwe=zu,f2=bwe,i4=EX,Rwe="Expected a function",Bwe=Math.max,zwe=Math.min;function $we(e,t,r){var n,i,a,o,s,l,u=0,c=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(Rwe);t=i4(t)||0,jwe(r)&&(c=!!r.leading,f="maxWait"in r,a=f?Bwe(i4(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h);function d(C){var A=n,P=i;return n=i=void 0,u=C,o=e.apply(P,A),o}function v(C){return u=C,s=setTimeout(x,t),c?d(C):o}function m(C){var A=C-l,P=C-u,O=t-A;return f?zwe(O,a-P):O}function y(C){var A=C-l,P=C-u;return l===void 0||A>=t||A<0||f&&P>=a}function x(){var C=f2();if(y(C))return _(C);s=setTimeout(x,m(C))}function _(C){return s=void 0,h&&n?d(C):(n=i=void 0,o)}function b(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function S(){return s===void 0?o:_(f2())}function T(){var C=f2(),A=y(C);if(n=arguments,i=this,l=C,A){if(s===void 0)return v(l);if(f)return clearTimeout(s),s=setTimeout(x,t),d(l)}return s===void 0&&(s=setTimeout(x,t)),o}return T.cancel=b,T.flush=S,T}var Fwe=$we,Vwe=Fwe,Gwe=zu,Wwe="Expected a function";function Hwe(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(Wwe);return Gwe(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Vwe(e,t,{leading:n,maxWait:t,trailing:i})}var Uwe=Hwe;const NX=Yt(Uwe);function dy(e){"@babel/helpers - typeof";return dy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dy(e)}function a4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function t_(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(D=NX(D,m,{trailing:!0,leading:!1}));var z=new ResizeObserver(D),V=T.current.getBoundingClientRect(),F=V.width,$=V.height;return E(F,$),z.observe(T.current),function(){z.disconnect()}},[E,m]);var N=G.useMemo(function(){var D=O.containerWidth,z=O.containerHeight;if(D<0||z<0)return null;hf(Kc(o)||Kc(l),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,l),hf(!r||r>0,"The aspect(%s) must be greater than zero.",r);var V=Kc(o)?D:o,F=Kc(l)?z:l;r&&r>0&&(V?F=V/r:F&&(V=F*r),h&&F>h&&(F=h)),hf(V>0||F>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,V,F,o,l,c,f,r);var $=!Array.isArray(d)&&Hs(d.type).endsWith("Chart");return Q.Children.map(d,function(B){return Q.isValidElement(B)?G.cloneElement(B,t_({width:V,height:F},$?{style:t_({height:"100%",width:"100%",maxHeight:F,maxWidth:V},B.props.style)}:{})):B})},[r,d,l,h,f,c,O,o]);return Q.createElement("div",{id:y?"".concat(y):void 0,className:Ct("recharts-responsive-container",x),style:t_(t_({},S),{},{width:o,height:l,minWidth:c,minHeight:f,maxHeight:h}),ref:T},N)}),jX=function(t){return null};jX.displayName="Cell";function vy(e){"@babel/helpers - typeof";return vy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vy(e)}function s4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function LL(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Xf.isSsr)return{width:0,height:0};var n=oSe(r),i=JSON.stringify({text:t,copyStyle:n});if(_h.widthCache[i])return _h.widthCache[i];try{var a=document.getElementById(l4);a||(a=document.createElement("span"),a.setAttribute("id",l4),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=LL(LL({},aSe),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return _h.widthCache[i]=l,++_h.cacheCount>iSe&&(_h.cacheCount=0,_h.widthCache={}),l}catch{return{width:0,height:0}}},sSe=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function py(e){"@babel/helpers - typeof";return py=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},py(e)}function J1(e,t){return fSe(e)||cSe(e,t)||uSe(e,t)||lSe()}function lSe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uSe(e,t){if(e){if(typeof e=="string")return u4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u4(e,t)}}function u4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function CSe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function p4(e,t){return kSe(e)||PSe(e,t)||MSe(e,t)||ASe()}function ASe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MSe(e,t){if(e){if(typeof e=="string")return g4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g4(e,t)}}function g4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return V.reduce(function(F,$){var B=$.word,H=$.width,U=F[F.length-1];if(U&&(i==null||a||U.width+H+n$.width?F:$})};if(!c)return d;for(var m="…",y=function(V){var F=f.slice(0,V),$=$X({breakAll:u,style:l,children:F+m}).wordsWithComputedWidth,B=h($),H=B.length>o||v(B).width>Number(i);return[H,B]},x=0,_=f.length-1,b=0,S;x<=_&&b<=f.length-1;){var T=Math.floor((x+_)/2),C=T-1,A=y(C),P=p4(A,2),O=P[0],k=P[1],E=y(T),N=p4(E,1),D=N[0];if(!O&&!D&&(x=T+1),O&&D&&(_=T-1),!O&&D){S=k;break}b++}return S||d},m4=function(t){var r=mt(t)?[]:t.toString().split(zX);return[{words:r}]},OSe=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!Xf.isSsr){var l,u,c=$X({breakAll:o,children:i,style:a});if(c){var f=c.wordsWithComputedWidth,h=c.spaceWidth;l=f,u=h}else return m4(i);return LSe({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return m4(i)},y4="#808080",Q1=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,c=t.scaleToFit,f=c===void 0?!1:c,h=t.textAnchor,d=h===void 0?"start":h,v=t.verticalAnchor,m=v===void 0?"end":v,y=t.fill,x=y===void 0?y4:y,_=v4(t,SSe),b=G.useMemo(function(){return OSe({breakAll:_.breakAll,children:_.children,maxLines:_.maxLines,scaleToFit:f,style:_.style,width:_.width})},[_.breakAll,_.children,_.maxLines,f,_.style,_.width]),S=_.dx,T=_.dy,C=_.angle,A=_.className,P=_.breakAll,O=v4(_,TSe);if(!rn(n)||!rn(a))return null;var k=n+(Me(S)?S:0),E=a+(Me(T)?T:0),N;switch(m){case"start":N=h2("calc(".concat(u,")"));break;case"middle":N=h2("calc(".concat((b.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:N=h2("calc(".concat(b.length-1," * -").concat(s,")"));break}var D=[];if(f){var z=b[0].width,V=_.width;D.push("scale(".concat((Me(V)?V/z:1)/z,")"))}return C&&D.push("rotate(".concat(C,", ").concat(k,", ").concat(E,")")),D.length&&(O.transform=D.join(" ")),Q.createElement("text",OL({},vt(O,!0),{x:k,y:E,className:Ct("recharts-text",A),textAnchor:d,fill:x.includes("url")?y4:x}),b.map(function(F,$){var B=F.words.join(P?"":" ");return Q.createElement("tspan",{x:k,dy:$===0?N:s,key:"".concat(B,"-").concat($)},B)}))};function vu(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function ISe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function bD(e){let t,r,n;e.length!==2?(t=vu,r=(s,l)=>vu(e(s),l),n=(s,l)=>e(s)-l):(t=e===vu||e===ISe?e:ESe,r=e,n=e);function i(s,l,u=0,c=s.length){if(u>>1;r(s[f],l)<0?u=f+1:c=f}while(u>>1;r(s[f],l)<=0?u=f+1:c=f}while(uu&&n(s[f-1],l)>-n(s[f],l)?f-1:f}return{left:i,center:o,right:a}}function ESe(){return 0}function FX(e){return e===null?NaN:+e}function*NSe(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const DSe=bD(vu),E0=DSe.right;bD(FX).center;class x4 extends Map{constructor(t,r=BSe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(_4(this,t))}has(t){return super.has(_4(this,t))}set(t,r){return super.set(jSe(this,t),r)}delete(t){return super.delete(RSe(this,t))}}function _4({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function jSe({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function RSe({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function BSe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function zSe(e=vu){if(e===vu)return VX;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function VX(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const $Se=Math.sqrt(50),FSe=Math.sqrt(10),VSe=Math.sqrt(2);function ew(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=$Se?10:a>=FSe?5:a>=VSe?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function w4(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function GX(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?VX:zSe(i);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,c=Math.log(l),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),d=Math.max(r,Math.floor(t-u*f/l+h)),v=Math.min(n,Math.floor(t+(l-u)*f/l+h));GX(e,t,d,v,i)}const a=e[t];let o=r,s=n;for(ig(e,r,t),i(e[n],a)>0&&ig(e,r,n);o0;)--s}i(e[r],a)===0?ig(e,r,s):(++s,ig(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function ig(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function GSe(e,t,r){if(e=Float64Array.from(NSe(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return w4(e);if(t>=1)return b4(e);var n,i=(n-1)*t,a=Math.floor(i),o=b4(GX(e,a).subarray(0,a+1)),s=w4(e.subarray(a+1));return o+(s-o)*(i-a)}}function WSe(e,t,r=FX){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function HSe(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?n_(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?n_(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ZSe.exec(e))?new _i(t[1],t[2],t[3],1):(t=YSe.exec(e))?new _i(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=XSe.exec(e))?n_(t[1],t[2],t[3],t[4]):(t=qSe.exec(e))?n_(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=KSe.exec(e))?k4(t[1],t[2]/100,t[3]/100,1):(t=JSe.exec(e))?k4(t[1],t[2]/100,t[3]/100,t[4]):S4.hasOwnProperty(e)?A4(S4[e]):e==="transparent"?new _i(NaN,NaN,NaN,0):null}function A4(e){return new _i(e>>16&255,e>>8&255,e&255,1)}function n_(e,t,r,n){return n<=0&&(e=t=r=NaN),new _i(e,t,r,n)}function tTe(e){return e instanceof N0||(e=xy(e)),e?(e=e.rgb(),new _i(e.r,e.g,e.b,e.opacity)):new _i}function jL(e,t,r,n){return arguments.length===1?tTe(e):new _i(e,t,r,n??1)}function _i(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}SD(_i,jL,HX(N0,{brighter(e){return e=e==null?tw:Math.pow(tw,e),new _i(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?my:Math.pow(my,e),new _i(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _i(df(this.r),df(this.g),df(this.b),rw(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:M4,formatHex:M4,formatHex8:rTe,formatRgb:P4,toString:P4}));function M4(){return`#${Jc(this.r)}${Jc(this.g)}${Jc(this.b)}`}function rTe(){return`#${Jc(this.r)}${Jc(this.g)}${Jc(this.b)}${Jc((isNaN(this.opacity)?1:this.opacity)*255)}`}function P4(){const e=rw(this.opacity);return`${e===1?"rgb(":"rgba("}${df(this.r)}, ${df(this.g)}, ${df(this.b)}${e===1?")":`, ${e})`}`}function rw(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function df(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Jc(e){return e=df(e),(e<16?"0":"")+e.toString(16)}function k4(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new to(e,t,r,n)}function UX(e){if(e instanceof to)return new to(e.h,e.s,e.l,e.opacity);if(e instanceof N0||(e=xy(e)),!e)return new to;if(e instanceof to)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new to(o,s,l,e.opacity)}function nTe(e,t,r,n){return arguments.length===1?UX(e):new to(e,t,r,n??1)}function to(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}SD(to,nTe,HX(N0,{brighter(e){return e=e==null?tw:Math.pow(tw,e),new to(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?my:Math.pow(my,e),new to(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new _i(d2(e>=240?e-240:e+120,i,n),d2(e,i,n),d2(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new to(L4(this.h),i_(this.s),i_(this.l),rw(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=rw(this.opacity);return`${e===1?"hsl(":"hsla("}${L4(this.h)}, ${i_(this.s)*100}%, ${i_(this.l)*100}%${e===1?")":`, ${e})`}`}}));function L4(e){return e=(e||0)%360,e<0?e+360:e}function i_(e){return Math.max(0,Math.min(1,e||0))}function d2(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const TD=e=>()=>e;function iTe(e,t){return function(r){return e+r*t}}function aTe(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function oTe(e){return(e=+e)==1?ZX:function(t,r){return r-t?aTe(t,r,e):TD(isNaN(t)?r:t)}}function ZX(e,t){var r=t-e;return r?iTe(e,r):TD(isNaN(e)?t:e)}const O4=function e(t){var r=oTe(t);function n(i,a){var o=r((i=jL(i)).r,(a=jL(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=ZX(i.opacity,a.opacity);return function(c){return i.r=o(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return n.gamma=e,n}(1);function sTe(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:nw(n,i)})),r=v2.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function yTe(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?xTe:yTe,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(l||(l=s(e.map(n),t,r)))(n(o(h)))}return f.invert=function(h){return o(i((u||(u=s(t,e.map(n),nw)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,iw),c()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),c()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=CD,c()},f.clamp=function(h){return arguments.length?(o=h?!0:ii,c()):o!==ii},f.interpolate=function(h){return arguments.length?(r=h,c()):r},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,d){return n=h,i=d,c()}}function AD(){return UT()(ii,ii)}function _Te(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function aw(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Qd(e){return e=aw(Math.abs(e)),e?e[1]:NaN}function bTe(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function wTe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var STe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function _y(e){if(!(t=STe.exec(e)))throw new Error("invalid format: "+e);var t;return new MD({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}_y.prototype=MD.prototype;function MD(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}MD.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function TTe(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var ow;function CTe(e,t){var r=aw(e,t);if(!r)return ow=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(ow=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+aw(e,Math.max(0,t+a-1))[0]}function E4(e,t){var r=aw(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const N4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:_Te,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>E4(e*100,t),r:E4,s:CTe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function D4(e){return e}var j4=Array.prototype.map,R4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ATe(e){var t=e.grouping===void 0||e.thousands===void 0?D4:bTe(j4.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?D4:wTe(j4.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=_y(f);var d=f.fill,v=f.align,m=f.sign,y=f.symbol,x=f.zero,_=f.width,b=f.comma,S=f.precision,T=f.trim,C=f.type;C==="n"?(b=!0,C="g"):N4[C]||(S===void 0&&(S=12),T=!0,C="g"),(x||d==="0"&&v==="=")&&(x=!0,d="0",v="=");var A=(h&&h.prefix!==void 0?h.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():""),P=(y==="$"?n:/[%p]/.test(C)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),O=N4[C],k=/[defgprs%]/.test(C);S=S===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function E(N){var D=A,z=P,V,F,$;if(C==="c")z=O(N)+z,N="";else{N=+N;var B=N<0||1/N<0;if(N=isNaN(N)?l:O(Math.abs(N),S),T&&(N=TTe(N)),B&&+N==0&&m!=="+"&&(B=!1),D=(B?m==="("?m:s:m==="-"||m==="("?"":m)+D,z=(C==="s"&&!isNaN(N)&&ow!==void 0?R4[8+ow/3]:"")+z+(B&&m==="("?")":""),k){for(V=-1,F=N.length;++V$||$>57){z=($===46?i+N.slice(V+1):N.slice(V))+z,N=N.slice(0,V);break}}}b&&!x&&(N=t(N,1/0));var H=D.length+N.length+z.length,U=H<_?new Array(_-H+1).join(d):"";switch(b&&x&&(N=t(U+N,U.length?_-z.length:1/0),U=""),v){case"<":N=D+N+z+U;break;case"=":N=D+U+N+z;break;case"^":N=U.slice(0,H=U.length>>1)+D+N+z+U.slice(H);break;default:N=U+D+N+z;break}return a(N)}return E.toString=function(){return f+""},E}function c(f,h){var d=Math.max(-8,Math.min(8,Math.floor(Qd(h)/3)))*3,v=Math.pow(10,-d),m=u((f=_y(f),f.type="f",f),{suffix:R4[8+d/3]});return function(y){return m(v*y)}}return{format:u,formatPrefix:c}}var a_,PD,YX;MTe({thousands:",",grouping:[3],currency:["$",""]});function MTe(e){return a_=ATe(e),PD=a_.format,YX=a_.formatPrefix,a_}function PTe(e){return Math.max(0,-Qd(Math.abs(e)))}function kTe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Qd(t)/3)))*3-Qd(Math.abs(e)))}function LTe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Qd(t)-Qd(e))+1}function XX(e,t,r,n){var i=NL(e,t,r),a;switch(n=_y(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=kTe(i,o))&&(n.precision=a),YX(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=LTe(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=PTe(i))&&(n.precision=a-(n.type==="%")*2);break}}return PD(n)}function $u(e){var t=e.domain;return e.ticks=function(r){var n=t();return IL(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return XX(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],l,u,c=10;for(s0;){if(u=EL(o,s,r),u===l)return n[i]=o,n[a]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function sw(){var e=AD();return e.copy=function(){return D0(e,sw())},Da.apply(e,arguments),$u(e)}function qX(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,iw),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return qX(e).unknown(t)},e=arguments.length?Array.from(e,iw):[0,1],$u(r)}function KX(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function DTe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function $4(e){return(t,r)=>-e(-t,r)}function kD(e){const t=e(B4,z4),r=t.domain;let n=10,i,a;function o(){return i=DTe(n),a=NTe(n),r()[0]<0?(i=$4(i),a=$4(a),e(OTe,ITe)):e(B4,z4),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],c=l[l.length-1];const f=c0){for(;h<=d;++h)for(v=1;vc)break;x.push(m)}}else for(;h<=d;++h)for(v=n-1;v>=1;--v)if(m=h>0?v/a(-h):v*a(h),!(mc)break;x.push(m)}x.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=_y(l)).precision==null&&(l.trim=!0),l=PD(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return c=>{let f=c/a(Math.round(i(c)));return f*nr(KX(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function JX(){const e=kD(UT()).domain([1,10]);return e.copy=()=>D0(e,JX()).base(e.base()),Da.apply(e,arguments),e}function F4(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function V4(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function LD(e){var t=1,r=e(F4(t),V4(t));return r.constant=function(n){return arguments.length?e(F4(t=+n),V4(t)):t},$u(r)}function QX(){var e=LD(UT());return e.copy=function(){return D0(e,QX()).constant(e.constant())},Da.apply(e,arguments)}function G4(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function jTe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function RTe(e){return e<0?-e*e:e*e}function OD(e){var t=e(ii,ii),r=1;function n(){return r===1?e(ii,ii):r===.5?e(jTe,RTe):e(G4(r),G4(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},$u(t)}function ID(){var e=OD(UT());return e.copy=function(){return D0(e,ID()).exponent(e.exponent())},Da.apply(e,arguments),e}function BTe(){return ID.apply(null,arguments).exponent(.5)}function W4(e){return Math.sign(e)*e*e}function zTe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function eq(){var e=AD(),t=[0,1],r=!1,n;function i(a){var o=zTe(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(W4(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,iw)).map(W4)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return eq(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Da.apply(i,arguments),$u(i)}function tq(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return rq().domain([e,t]).range(i).unknown(a)},Da.apply($u(o),arguments)}function nq(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[E0(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return nq().domain(e).range(t).unknown(r)},Da.apply(i,arguments)}const p2=new Date,g2=new Date;function ln(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),t(a,s),e(a);while(uln(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(p2.setTime(+a),g2.setTime(+o),e(p2),e(g2),Math.floor(r(p2,g2))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const lw=ln(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);lw.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ln(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):lw);lw.range;const Rs=1e3,_a=Rs*60,Bs=_a*60,al=Bs*24,ED=al*7,H4=al*30,m2=al*365,Qc=ln(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Rs)},(e,t)=>(t-e)/Rs,e=>e.getUTCSeconds());Qc.range;const ND=ln(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rs)},(e,t)=>{e.setTime(+e+t*_a)},(e,t)=>(t-e)/_a,e=>e.getMinutes());ND.range;const DD=ln(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*_a)},(e,t)=>(t-e)/_a,e=>e.getUTCMinutes());DD.range;const jD=ln(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rs-e.getMinutes()*_a)},(e,t)=>{e.setTime(+e+t*Bs)},(e,t)=>(t-e)/Bs,e=>e.getHours());jD.range;const RD=ln(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Bs)},(e,t)=>(t-e)/Bs,e=>e.getUTCHours());RD.range;const j0=ln(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*_a)/al,e=>e.getDate()-1);j0.range;const ZT=ln(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/al,e=>e.getUTCDate()-1);ZT.range;const iq=ln(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/al,e=>Math.floor(e/al));iq.range;function qf(e){return ln(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*_a)/ED)}const YT=qf(0),uw=qf(1),$Te=qf(2),FTe=qf(3),ev=qf(4),VTe=qf(5),GTe=qf(6);YT.range;uw.range;$Te.range;FTe.range;ev.range;VTe.range;GTe.range;function Kf(e){return ln(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/ED)}const XT=Kf(0),cw=Kf(1),WTe=Kf(2),HTe=Kf(3),tv=Kf(4),UTe=Kf(5),ZTe=Kf(6);XT.range;cw.range;WTe.range;HTe.range;tv.range;UTe.range;ZTe.range;const BD=ln(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());BD.range;const zD=ln(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());zD.range;const ol=ln(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());ol.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ln(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});ol.range;const sl=ln(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());sl.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ln(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});sl.range;function aq(e,t,r,n,i,a){const o=[[Qc,1,Rs],[Qc,5,5*Rs],[Qc,15,15*Rs],[Qc,30,30*Rs],[a,1,_a],[a,5,5*_a],[a,15,15*_a],[a,30,30*_a],[i,1,Bs],[i,3,3*Bs],[i,6,6*Bs],[i,12,12*Bs],[n,1,al],[n,2,2*al],[r,1,ED],[t,1,H4],[t,3,3*H4],[e,1,m2]];function s(u,c,f){const h=cy).right(o,h);if(d===o.length)return e.every(NL(u/m2,c/m2,f));if(d===0)return lw.every(Math.max(NL(u,c,f),1));const[v,m]=o[h/o[d-1][2]53)return null;"w"in ee||(ee.w=1),"Z"in ee?(be=x2(ag(ee.y,0,1)),Ve=be.getUTCDay(),be=Ve>4||Ve===0?cw.ceil(be):cw(be),be=ZT.offset(be,(ee.V-1)*7),ee.y=be.getUTCFullYear(),ee.m=be.getUTCMonth(),ee.d=be.getUTCDate()+(ee.w+6)%7):(be=y2(ag(ee.y,0,1)),Ve=be.getDay(),be=Ve>4||Ve===0?uw.ceil(be):uw(be),be=j0.offset(be,(ee.V-1)*7),ee.y=be.getFullYear(),ee.m=be.getMonth(),ee.d=be.getDate()+(ee.w+6)%7)}else("W"in ee||"U"in ee)&&("w"in ee||(ee.w="u"in ee?ee.u%7:"W"in ee?1:0),Ve="Z"in ee?x2(ag(ee.y,0,1)).getUTCDay():y2(ag(ee.y,0,1)).getDay(),ee.m=0,ee.d="W"in ee?(ee.w+6)%7+ee.W*7-(Ve+5)%7:ee.w+ee.U*7-(Ve+6)%7);return"Z"in ee?(ee.H+=ee.Z/100|0,ee.M+=ee.Z%100,x2(ee)):y2(ee)}}function P(ne,ve,ue,ee){for(var We=0,be=ve.length,Ve=ue.length,Ze,ht;We=Ve)return-1;if(Ze=ve.charCodeAt(We++),Ze===37){if(Ze=ve.charAt(We++),ht=T[Ze in U4?ve.charAt(We++):Ze],!ht||(ee=ht(ne,ue,ee))<0)return-1}else if(Ze!=ue.charCodeAt(ee++))return-1}return ee}function O(ne,ve,ue){var ee=u.exec(ve.slice(ue));return ee?(ne.p=c.get(ee[0].toLowerCase()),ue+ee[0].length):-1}function k(ne,ve,ue){var ee=d.exec(ve.slice(ue));return ee?(ne.w=v.get(ee[0].toLowerCase()),ue+ee[0].length):-1}function E(ne,ve,ue){var ee=f.exec(ve.slice(ue));return ee?(ne.w=h.get(ee[0].toLowerCase()),ue+ee[0].length):-1}function N(ne,ve,ue){var ee=x.exec(ve.slice(ue));return ee?(ne.m=_.get(ee[0].toLowerCase()),ue+ee[0].length):-1}function D(ne,ve,ue){var ee=m.exec(ve.slice(ue));return ee?(ne.m=y.get(ee[0].toLowerCase()),ue+ee[0].length):-1}function z(ne,ve,ue){return P(ne,t,ve,ue)}function V(ne,ve,ue){return P(ne,r,ve,ue)}function F(ne,ve,ue){return P(ne,n,ve,ue)}function $(ne){return o[ne.getDay()]}function B(ne){return a[ne.getDay()]}function H(ne){return l[ne.getMonth()]}function U(ne){return s[ne.getMonth()]}function Z(ne){return i[+(ne.getHours()>=12)]}function Y(ne){return 1+~~(ne.getMonth()/3)}function K(ne){return o[ne.getUTCDay()]}function te(ne){return a[ne.getUTCDay()]}function ce(ne){return l[ne.getUTCMonth()]}function de(ne){return s[ne.getUTCMonth()]}function Oe(ne){return i[+(ne.getUTCHours()>=12)]}function ye(ne){return 1+~~(ne.getUTCMonth()/3)}return{format:function(ne){var ve=C(ne+="",b);return ve.toString=function(){return ne},ve},parse:function(ne){var ve=A(ne+="",!1);return ve.toString=function(){return ne},ve},utcFormat:function(ne){var ve=C(ne+="",S);return ve.toString=function(){return ne},ve},utcParse:function(ne){var ve=A(ne+="",!0);return ve.toString=function(){return ne},ve}}}var U4={"-":"",_:" ",0:"0"},bn=/^\s*\d+/,QTe=/^%/,eCe=/[\\^$*+?|[\]().{}]/g;function Nt(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function rCe(e,t,r){var n=bn.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function nCe(e,t,r){var n=bn.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function iCe(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function aCe(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function oCe(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Z4(e,t,r){var n=bn.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Y4(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function sCe(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function lCe(e,t,r){var n=bn.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function uCe(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function X4(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function cCe(e,t,r){var n=bn.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function q4(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function fCe(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function hCe(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function dCe(e,t,r){var n=bn.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function vCe(e,t,r){var n=bn.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function pCe(e,t,r){var n=QTe.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function gCe(e,t,r){var n=bn.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function mCe(e,t,r){var n=bn.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function K4(e,t){return Nt(e.getDate(),t,2)}function yCe(e,t){return Nt(e.getHours(),t,2)}function xCe(e,t){return Nt(e.getHours()%12||12,t,2)}function _Ce(e,t){return Nt(1+j0.count(ol(e),e),t,3)}function oq(e,t){return Nt(e.getMilliseconds(),t,3)}function bCe(e,t){return oq(e,t)+"000"}function wCe(e,t){return Nt(e.getMonth()+1,t,2)}function SCe(e,t){return Nt(e.getMinutes(),t,2)}function TCe(e,t){return Nt(e.getSeconds(),t,2)}function CCe(e){var t=e.getDay();return t===0?7:t}function ACe(e,t){return Nt(YT.count(ol(e)-1,e),t,2)}function sq(e){var t=e.getDay();return t>=4||t===0?ev(e):ev.ceil(e)}function MCe(e,t){return e=sq(e),Nt(ev.count(ol(e),e)+(ol(e).getDay()===4),t,2)}function PCe(e){return e.getDay()}function kCe(e,t){return Nt(uw.count(ol(e)-1,e),t,2)}function LCe(e,t){return Nt(e.getFullYear()%100,t,2)}function OCe(e,t){return e=sq(e),Nt(e.getFullYear()%100,t,2)}function ICe(e,t){return Nt(e.getFullYear()%1e4,t,4)}function ECe(e,t){var r=e.getDay();return e=r>=4||r===0?ev(e):ev.ceil(e),Nt(e.getFullYear()%1e4,t,4)}function NCe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Nt(t/60|0,"0",2)+Nt(t%60,"0",2)}function J4(e,t){return Nt(e.getUTCDate(),t,2)}function DCe(e,t){return Nt(e.getUTCHours(),t,2)}function jCe(e,t){return Nt(e.getUTCHours()%12||12,t,2)}function RCe(e,t){return Nt(1+ZT.count(sl(e),e),t,3)}function lq(e,t){return Nt(e.getUTCMilliseconds(),t,3)}function BCe(e,t){return lq(e,t)+"000"}function zCe(e,t){return Nt(e.getUTCMonth()+1,t,2)}function $Ce(e,t){return Nt(e.getUTCMinutes(),t,2)}function FCe(e,t){return Nt(e.getUTCSeconds(),t,2)}function VCe(e){var t=e.getUTCDay();return t===0?7:t}function GCe(e,t){return Nt(XT.count(sl(e)-1,e),t,2)}function uq(e){var t=e.getUTCDay();return t>=4||t===0?tv(e):tv.ceil(e)}function WCe(e,t){return e=uq(e),Nt(tv.count(sl(e),e)+(sl(e).getUTCDay()===4),t,2)}function HCe(e){return e.getUTCDay()}function UCe(e,t){return Nt(cw.count(sl(e)-1,e),t,2)}function ZCe(e,t){return Nt(e.getUTCFullYear()%100,t,2)}function YCe(e,t){return e=uq(e),Nt(e.getUTCFullYear()%100,t,2)}function XCe(e,t){return Nt(e.getUTCFullYear()%1e4,t,4)}function qCe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?tv(e):tv.ceil(e),Nt(e.getUTCFullYear()%1e4,t,4)}function KCe(){return"+0000"}function Q4(){return"%"}function e$(e){return+e}function t$(e){return Math.floor(+e/1e3)}var bh,cq,fq;JCe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function JCe(e){return bh=JTe(e),cq=bh.format,bh.parse,fq=bh.utcFormat,bh.utcParse,bh}function QCe(e){return new Date(e)}function eAe(e){return e instanceof Date?+e:+new Date(+e)}function $D(e,t,r,n,i,a,o,s,l,u){var c=AD(),f=c.invert,h=c.domain,d=u(".%L"),v=u(":%S"),m=u("%I:%M"),y=u("%I %p"),x=u("%a %d"),_=u("%b %d"),b=u("%B"),S=u("%Y");function T(C){return(l(C)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>GSe(e,a/n))},r.copy=function(){return pq(t).domain(e)},xl.apply(r,arguments)}function KT(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,u=ii,c,f=!1,h;function d(m){return isNaN(m=+m)?h:(m=.5+((m=+c(m))-a)*(n*mt}var lAe=sAe,uAe=xq,cAe=lAe,fAe=Jv;function hAe(e){return e&&e.length?uAe(e,fAe,cAe):void 0}var dAe=hAe;const ql=Yt(dAe);function vAe(e,t){return ee.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};$e.decimalPlaces=$e.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*lr;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};$e.dividedBy=$e.div=function(e){return Us(this,new this.constructor(e))};$e.dividedToIntegerBy=$e.idiv=function(e){var t=this,r=t.constructor;return Xt(Us(t,new r(e),0,1),r.precision)};$e.equals=$e.eq=function(e){return!this.cmp(e)};$e.exponent=function(){return Zr(this)};$e.greaterThan=$e.gt=function(e){return this.cmp(e)>0};$e.greaterThanOrEqualTo=$e.gte=function(e){return this.cmp(e)>=0};$e.isInteger=$e.isint=function(){return this.e>this.d.length-2};$e.isNegative=$e.isneg=function(){return this.s<0};$e.isPositive=$e.ispos=function(){return this.s>0};$e.isZero=function(){return this.s===0};$e.lessThan=$e.lt=function(e){return this.cmp(e)<0};$e.lessThanOrEqualTo=$e.lte=function(e){return this.cmp(e)<1};$e.logarithm=$e.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Ri))throw Error(ka+"NaN");if(r.s<1)throw Error(ka+(r.s?"NaN":"-Infinity"));return r.eq(Ri)?new n(0):(hr=!1,t=Us(by(r,a),by(e,a),a),hr=!0,Xt(t,i))};$e.minus=$e.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Sq(t,e):bq(t,(e.s=-e.s,e))};$e.modulo=$e.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(ka+"NaN");return r.s?(hr=!1,t=Us(r,e,0,1).times(e),hr=!0,r.minus(t)):Xt(new n(r),i)};$e.naturalExponential=$e.exp=function(){return wq(this)};$e.naturalLogarithm=$e.ln=function(){return by(this)};$e.negated=$e.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};$e.plus=$e.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?bq(t,e):Sq(t,(e.s=-e.s,e))};$e.precision=$e.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(vf+e);if(t=Zr(i)+1,n=i.d.length-1,r=n*lr+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};$e.squareRoot=$e.sqrt=function(){var e,t,r,n,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(ka+"NaN")}for(e=Zr(s),hr=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=$o(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=rp((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(Us(s,a,o+2)).times(.5),$o(a.d).slice(0,o)===(t=$o(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Xt(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return hr=!0,Xt(n,r)};$e.times=$e.mul=function(e){var t,r,n,i,a,o,s,l,u,c=this,f=c.constructor,h=c.d,d=(e=new f(e)).d;if(!c.s||!e.s)return new f(0);for(e.s*=c.s,r=c.e+e.e,l=h.length,u=d.length,l=0;){for(t=0,i=l+n;i>n;)s=a[i]+d[n]*h[i-n-1]+t,a[i--]=s%vn|0,t=s/vn|0;a[i]=(a[i]+t)%vn|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,hr?Xt(e,f.precision):e};$e.toDecimalPlaces=$e.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(rs(e,0,tp),t===void 0?t=n.rounding:rs(t,0,8),Xt(r,e+Zr(r)+1,t))};$e.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Of(n,!0):(rs(e,0,tp),t===void 0?t=i.rounding:rs(t,0,8),n=Xt(new i(n),e+1,t),r=Of(n,!0,e+1)),r};$e.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?Of(i):(rs(e,0,tp),t===void 0?t=a.rounding:rs(t,0,8),n=Xt(new a(i),e+Zr(i)+1,t),r=Of(n.abs(),!1,e+Zr(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};$e.toInteger=$e.toint=function(){var e=this,t=e.constructor;return Xt(new t(e),Zr(e)+1,t.rounding)};$e.toNumber=function(){return+this};$e.toPower=$e.pow=function(e){var t,r,n,i,a,o,s=this,l=s.constructor,u=12,c=+(e=new l(e));if(!e.s)return new l(Ri);if(s=new l(s),!s.s){if(e.s<1)throw Error(ka+"Infinity");return s}if(s.eq(Ri))return s;if(n=l.precision,e.eq(Ri))return Xt(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=c<0?-c:c)<=_q){for(i=new l(Ri),t=Math.ceil(n/lr+4),hr=!1;r%2&&(i=i.times(s),i$(i.d,t)),r=rp(r/2),r!==0;)s=s.times(s),i$(s.d,t);return hr=!0,e.s<0?new l(Ri).div(i):Xt(i,n)}}else if(a<0)throw Error(ka+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,hr=!1,i=e.times(by(s,n+u)),hr=!0,i=wq(i),i.s=a,i};$e.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=Zr(i),n=Of(i,r<=a.toExpNeg||r>=a.toExpPos)):(rs(e,1,tp),t===void 0?t=a.rounding:rs(t,0,8),i=Xt(new a(i),e,t),r=Zr(i),n=Of(i,e<=r||r<=a.toExpNeg,e)),n};$e.toSignificantDigits=$e.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(rs(e,1,tp),t===void 0?t=n.rounding:rs(t,0,8)),Xt(new n(r),e,t)};$e.toString=$e.valueOf=$e.val=$e.toJSON=$e[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Zr(e),r=e.constructor;return Of(e,t<=r.toExpNeg||t>=r.toExpPos)};function bq(e,t){var r,n,i,a,o,s,l,u,c=e.constructor,f=c.precision;if(!e.s||!t.s)return t.s||(t=new c(e)),hr?Xt(t,f):t;if(l=e.d,u=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,s=u.length):(n=u,i=o,s=l.length),o=Math.ceil(f/lr),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=u.length,s-a<0&&(a=s,n=u,u=l,l=n),r=0;a;)r=(l[--a]=l[a]+u[a]+r)/vn|0,l[a]%=vn;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,hr?Xt(t,f):t}function rs(e,t,r){if(e!==~~e||er)throw Error(vf+e)}function $o(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var s,l,u,c,f,h,d,v,m,y,x,_,b,S,T,C,A,P,O=n.constructor,k=n.s==i.s?1:-1,E=n.d,N=i.d;if(!n.s)return new O(n);if(!i.s)throw Error(ka+"Division by zero");for(l=n.e-i.e,A=N.length,T=E.length,d=new O(k),v=d.d=[],u=0;N[u]==(E[u]||0);)++u;if(N[u]>(E[u]||0)&&--l,a==null?_=a=O.precision:o?_=a+(Zr(n)-Zr(i))+1:_=a,_<0)return new O(0);if(_=_/lr+2|0,u=0,A==1)for(c=0,N=N[0],_++;(u1&&(N=e(N,c),E=e(E,c),A=N.length,T=E.length),S=A,m=E.slice(0,A),y=m.length;y=vn/2&&++C;do c=0,s=t(N,m,A,y),s<0?(x=m[0],A!=y&&(x=x*vn+(m[1]||0)),c=x/C|0,c>1?(c>=vn&&(c=vn-1),f=e(N,c),h=f.length,y=m.length,s=t(f,m,h,y),s==1&&(c--,r(f,A16)throw Error(GD+Zr(e));if(!e.s)return new c(Ri);for(hr=!1,s=f,o=new c(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(jc(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new c(Ri),c.precision=s;;){if(i=Xt(i.times(e),s),r=r.times(++l),o=a.plus(Us(i,r,s)),$o(o.d).slice(0,s)===$o(a.d).slice(0,s)){for(;u--;)a=Xt(a.times(a),s);return c.precision=f,t==null?(hr=!0,Xt(a,f)):a}a=o}}function Zr(e){for(var t=e.e*lr,r=e.d[0];r>=10;r/=10)t++;return t}function _2(e,t,r){if(t>e.LN10.sd())throw hr=!0,r&&(e.precision=r),Error(ka+"LN10 precision limit exceeded");return Xt(new e(e.LN10),t)}function Fl(e){for(var t="";e--;)t+="0";return t}function by(e,t){var r,n,i,a,o,s,l,u,c,f=1,h=10,d=e,v=d.d,m=d.constructor,y=m.precision;if(d.s<1)throw Error(ka+(d.s?"NaN":"-Infinity"));if(d.eq(Ri))return new m(0);if(t==null?(hr=!1,u=y):u=t,d.eq(10))return t==null&&(hr=!0),_2(m,u);if(u+=h,m.precision=u,r=$o(v),n=r.charAt(0),a=Zr(d),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)d=d.times(e),r=$o(d.d),n=r.charAt(0),f++;a=Zr(d),n>1?(d=new m("0."+r),a++):d=new m(n+"."+r.slice(1))}else return l=_2(m,u+2,y).times(a+""),d=by(new m(n+"."+r.slice(1)),u-h).plus(l),m.precision=y,t==null?(hr=!0,Xt(d,y)):d;for(s=o=d=Us(d.minus(Ri),d.plus(Ri),u),c=Xt(d.times(d),u),i=3;;){if(o=Xt(o.times(c),u),l=s.plus(Us(o,new m(i),u)),$o(l.d).slice(0,u)===$o(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(_2(m,u+2,y).times(a+""))),s=Us(s,new m(f),u),m.precision=y,t==null?(hr=!0,Xt(s,y)):s;s=l,i+=2}}function n$(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=rp(r/lr),e.d=[],n=(r+1)%lr,r<0&&(n+=lr),nfw||e.e<-fw))throw Error(GD+r)}else e.s=0,e.e=0,e.d=[0];return e}function Xt(e,t,r){var n,i,a,o,s,l,u,c,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=lr,i=t,u=f[c=0];else{if(c=Math.ceil((n+1)/lr),a=f.length,c>=a)return e;for(u=a=f[c],o=1;a>=10;a/=10)o++;n%=lr,i=n-lr+o}if(r!==void 0&&(a=jc(10,o-i-1),s=u/a%10|0,l=t<0||f[c+1]!==void 0||u%a,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?u/jc(10,o-i):0:f[c-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return l?(a=Zr(e),f.length=1,t=t-a-1,f[0]=jc(10,(lr-t%lr)%lr),e.e=rp(-t/lr)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=c,a=1,c--):(f.length=c+1,a=jc(10,lr-n),f[c]=i>0?(u/jc(10,o-i)%jc(10,i)|0)*a:0),l)for(;;)if(c==0){(f[0]+=a)==vn&&(f[0]=1,++e.e);break}else{if(f[c]+=a,f[c]!=vn)break;f[c--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(hr&&(e.e>fw||e.e<-fw))throw Error(GD+Zr(e));return e}function Sq(e,t){var r,n,i,a,o,s,l,u,c,f,h=e.constructor,d=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),hr?Xt(t,d):t;if(l=e.d,f=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(c=o<0,c?(r=l,o=-o,s=f.length):(r=f,n=u,s=l.length),i=Math.max(Math.ceil(d/lr),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=f.length,c=i0;--i)l[s++]=0;for(i=f.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+Fl(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Fl(-i-1)+a,r&&(n=r-o)>0&&(a+=Fl(n))):i>=o?(a+=Fl(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Fl(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Fl(n))),e.s<0?"-"+a:a}function i$(e,t){if(e.length>t)return e.length=t,!0}function Tq(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(vf+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return n$(o,a.toString())}else if(typeof a!="string")throw Error(vf+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,jAe.test(a))n$(o,a);else throw Error(vf+a)}if(i.prototype=$e,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=Tq,i.config=i.set=RAe,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(vf+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(vf+r+": "+n);return this}var WD=Tq(DAe);Ri=new WD(1);const Ut=WD;function BAe(e){return VAe(e)||FAe(e)||$Ae(e)||zAe()}function zAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $Ae(e,t){if(e){if(typeof e=="string")return zL(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zL(e,t)}}function FAe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function VAe(e){if(Array.isArray(e))return zL(e)}function zL(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,a$(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function n2e(e){if(Array.isArray(e))return e}function kq(e){var t=wy(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function Lq(e,t,r){if(e.lte(0))return new Ut(0);var n=eC.getDigitCount(e.toNumber()),i=new Ut(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new Ut(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return t?l:new Ut(Math.ceil(l))}function i2e(e,t,r){var n=1,i=new Ut(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new Ut(10).pow(eC.getDigitCount(e)-1),i=new Ut(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new Ut(Math.floor(e)))}else e===0?i=new Ut(Math.floor((t-1)/2)):r||(i=new Ut(Math.floor(e)));var o=Math.floor((t-1)/2),s=UAe(HAe(function(l){return i.add(new Ut(l-o).mul(n)).toNumber()}),$L);return s(0,t)}function Oq(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Ut(0),tickMin:new Ut(0),tickMax:new Ut(0)};var a=Lq(new Ut(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new Ut(0):(o=new Ut(e).add(t).div(2),o=o.sub(new Ut(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),l=Math.ceil(new Ut(t).sub(o).div(a).toNumber()),u=s+l+1;return u>r?Oq(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:a,tickMin:o.sub(new Ut(s).mul(a)),tickMax:o.add(new Ut(l).mul(a))})}function a2e(e){var t=wy(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=kq([r,n]),l=wy(s,2),u=l[0],c=l[1];if(u===-1/0||c===1/0){var f=c===1/0?[u].concat(VL($L(0,i-1).map(function(){return 1/0}))):[].concat(VL($L(0,i-1).map(function(){return-1/0})),[c]);return r>n?FL(f):f}if(u===c)return i2e(u,i,a);var h=Oq(u,c,o,a),d=h.step,v=h.tickMin,m=h.tickMax,y=eC.rangeStep(v,m.add(new Ut(.1).mul(d)),d);return r>n?FL(y):y}function o2e(e,t){var r=wy(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=kq([n,i]),s=wy(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var c=Math.max(t,2),f=Lq(new Ut(u).sub(l).div(c-1),a,0),h=[].concat(VL(eC.rangeStep(new Ut(l),new Ut(u).sub(new Ut(.99).mul(f)),f)),[u]);return n>i?FL(h):h}var s2e=Mq(a2e),l2e=Mq(o2e),u2e="Invariant failed";function If(e,t){throw new Error(u2e)}var c2e=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function nv(e){"@babel/helpers - typeof";return nv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nv(e)}function hw(){return hw=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function m2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function y2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x2e(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,u=0;u0?i[u-1].coordinate:i[s-1].coordinate,f=i[u].coordinate,h=u>=s-1?i[0].coordinate:i[u+1].coordinate,d=void 0;if(ro(f-c)!==ro(h-f)){var v=[];if(ro(h-f)===ro(l[1]-l[0])){d=h;var m=f+l[1]-l[0];v[0]=Math.min(m,(m+c)/2),v[1]=Math.max(m,(m+c)/2)}else{d=c;var y=h+l[1]-l[0];v[0]=Math.min(f,(y+f)/2),v[1]=Math.max(f,(y+f)/2)}var x=[Math.min(f,(d+f)/2),Math.max(f,(d+f)/2)];if(t>x[0]&&t<=x[1]||t>=v[0]&&t<=v[1]){o=i[u].index;break}}else{var _=Math.min(c,h),b=Math.max(c,h);if(t>(_+f)/2&&t<=(b+f)/2){o=i[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},HD=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Cr(Cr({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},j2e=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),l=0,u=s.length;l=0});if(x&&x.length){var _=x[0].type.defaultProps,b=_!==void 0?Cr(Cr({},_),x[0].props):x[0].props,S=b.barSize,T=b[y];o[T]||(o[T]=[]);var C=mt(S)?r:S;o[T].push({item:x[0],stackList:x.slice(1),barSize:mt(C)?void 0:Lf(C,n,0)})}}return o},R2e=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=Lf(r,i,0,!0),c,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,d=i/l,v=o.reduce(function(S,T){return S+T.barSize||0},0);v+=(l-1)*u,v>=i&&(v-=(l-1)*u,u=0),v>=i&&d>0&&(h=!0,d*=.9,v=l*d);var m=(i-v)/2>>0,y={offset:m-u,size:0};c=o.reduce(function(S,T){var C={item:T.item,position:{offset:y.offset+y.size+u,size:h?d:T.barSize}},A=[].concat(l$(S),[C]);return y=A[A.length-1].position,T.stackList&&T.stackList.length&&T.stackList.forEach(function(P){A.push({item:P,position:y})}),A},f)}else{var x=Lf(n,i,0,!0);i-2*x-(l-1)*u<=0&&(u=0);var _=(i-2*x-(l-1)*u)/l;_>1&&(_>>=0);var b=s===+s?Math.min(_,s):_;c=o.reduce(function(S,T,C){var A=[].concat(l$(S),[{item:T.item,position:{offset:x+(_+u)*C+(_-b)/2,size:b}}]);return T.stackList&&T.stackList.length&&T.stackList.forEach(function(P){A.push({item:P,position:A[A.length-1].position})}),A},f)}return c},B2e=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=Dq({children:a,legendWidth:l});if(u){var c=i||{},f=c.width,h=c.height,d=u.align,v=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&v==="middle")&&d!=="center"&&Me(t[d]))return Cr(Cr({},t),{},Id({},d,t[d]+(f||0)));if((m==="horizontal"||m==="vertical"&&d==="center")&&v!=="middle"&&Me(t[v]))return Cr(Cr({},t),{},Id({},v,t[v]+(h||0)))}return t},z2e=function(t,r,n){return mt(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},jq=function(t,r,n,i,a){var o=r.props.children,s=Ta(o,R0).filter(function(u){return z2e(i,a,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,c){var f=si(c,n);if(mt(f))return u;var h=Array.isArray(f)?[JT(f),ql(f)]:[f,f],d=l.reduce(function(v,m){var y=si(c,m,0),x=h[0]-Math.abs(Array.isArray(y)?y[0]:y),_=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(x,v[0]),Math.max(_,v[1])]},[1/0,-1/0]);return[Math.min(d[0],u[0]),Math.max(d[1],u[1])]},[1/0,-1/0])}return null},$2e=function(t,r,n,i,a){var o=r.map(function(s){return jq(t,s,n,a,i)}).filter(function(s){return!mt(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},Rq=function(t,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&jq(t,l,u,i)||_m(t,u,n,a)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var c=0,f=u.length;c=2?ro(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var c=(t.ticks||t.niceTicks).map(function(f){var h=a?a.indexOf(f):f;return{coordinate:i(h)+u,value:f,offset:u}});return c.filter(function(f){return!Yv(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:i(f)+u,value:f,index:h,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,h){return{coordinate:i(f)+u,value:a?a[f]:f,index:h,offset:u}})},b2=new WeakMap,o_=function(t,r){if(typeof r!="function")return t;b2.has(t)||b2.set(t,new WeakMap);var n=b2.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},F2e=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:gy(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:sw(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:xm(),realScaleType:"point"}:a==="category"?{scale:gy(),realScaleType:"band"}:{scale:sw(),realScaleType:"linear"};if(kf(i)){var l="scale".concat(zT(i));return{scale:(r$[l]||xm)(),realScaleType:r$[l]?l:"point"}}return pt(i)?{scale:i}:{scale:xm(),realScaleType:"point"}},c$=1e-4,V2e=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-c$,o=Math.max(i[0],i[1])+c$,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},G2e=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},U2e=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+s,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},Z2e={sign:H2e,expand:sge,none:Yd,silhouette:lge,wiggle:uge,positive:U2e},Y2e=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=Z2e[n],o=oge().keys(i).value(function(s,l){return+si(s,l,0)}).order(gL).offset(a);return o(t)},X2e=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(f,h){var d,v=(d=h.type)!==null&&d!==void 0&&d.defaultProps?Cr(Cr({},h.type.defaultProps),h.props):h.props,m=v.stackId,y=v.hide;if(y)return f;var x=v[n],_=f[x]||{hasStack:!1,stackGroups:{}};if(rn(m)){var b=_.stackGroups[m]||{numericAxisId:n,cateAxisId:i,items:[]};b.items.push(h),_.hasStack=!0,_.stackGroups[m]=b}else _.stackGroups[Xv("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return Cr(Cr({},f),{},Id({},x,_))},l),c={};return Object.keys(u).reduce(function(f,h){var d=u[h];if(d.hasStack){var v={};d.stackGroups=Object.keys(d.stackGroups).reduce(function(m,y){var x=d.stackGroups[y];return Cr(Cr({},m),{},Id({},y,{numericAxisId:n,cateAxisId:i,items:x.items,stackedData:Y2e(t,x.items,a)}))},v)}return Cr(Cr({},f),{},Id({},h,d))},c)},q2e=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var c=s2e(u,a,s);return t.domain([JT(c),ql(c)]),{niceTicks:c}}if(a&&i==="number"){var f=t.domain(),h=l2e(f,a,s);return{niceTicks:h}}return null};function vw(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!mt(i[t.dataKey])){var s=R1(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var l=si(i,mt(o)?t.dataKey:o);return mt(l)?null:t.scale(l)}var f$=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var l=si(o,r.dataKey,r.domain[s]);return mt(l)?null:r.scale(l)-a/2+i},K2e=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},J2e=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Cr(Cr({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(rn(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},Q2e=function(t){return t.reduce(function(r,n){return[JT(n.concat([r[0]]).filter(Me)),ql(n.concat([r[1]]).filter(Me))]},[1/0,-1/0])},zq=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,l=s.reduce(function(u,c){var f=Q2e(c.slice(r,n+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},h$=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,d$=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,UL=function(t,r,n){if(pt(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(Me(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(h$.test(t[0])){var a=+h$.exec(t[0])[1];i[0]=r[0]-a}else pt(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(Me(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(d$.test(t[1])){var o=+d$.exec(t[1])[1];i[1]=r[1]+o}else pt(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},pw=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=xD(r,function(f){return f.coordinate}),o=1/0,s=1,l=a.length;so&&(u=2*Math.PI-u),{radius:s,angle:nMe(u),angleInRadian:u}},oMe=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},sMe=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},m$=function(t,r){var n=t.x,i=t.y,a=aMe({x:n,y:i},r),o=a.radius,s=a.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var c=oMe(r),f=c.startAngle,h=c.endAngle,d=s,v;if(f<=h){for(;d>h;)d-=360;for(;d=f&&d<=h}else{for(;d>f;)d-=360;for(;d=h&&d<=f}return v?g$(g$({},r),{},{radius:o,angle:sMe(d,r)}):null};function Ay(e){"@babel/helpers - typeof";return Ay=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ay(e)}var lMe=["offset"];function uMe(e){return dMe(e)||hMe(e)||fMe(e)||cMe()}function cMe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fMe(e,t){if(e){if(typeof e=="string")return ZL(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ZL(e,t)}}function hMe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dMe(e){if(Array.isArray(e))return ZL(e)}function ZL(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function pMe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function y$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Jr(e){for(var t=1;t=0?1:-1,b,S;i==="insideStart"?(b=d+_*o,S=m):i==="insideEnd"?(b=v-_*o,S=!m):i==="end"&&(b=v+_*o,S=m),S=x<=0?S:!S;var T=kn(u,c,y,b),C=kn(u,c,y,b+(S?1:-1)*359),A="M".concat(T.x,",").concat(T.y,` + A`).concat(y,",").concat(y,",0,1,").concat(S?0:1,`, + `).concat(C.x,",").concat(C.y),P=mt(t.id)?Xv("recharts-radial-line-"):t.id;return Q.createElement("text",My({},n,{dominantBaseline:"central",className:Ct("recharts-radial-bar-label",s)}),Q.createElement("defs",null,Q.createElement("path",{id:P,d:A})),Q.createElement("textPath",{xlinkHref:"#".concat(P)},r))},wMe=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,s=a.cy,l=a.innerRadius,u=a.outerRadius,c=a.startAngle,f=a.endAngle,h=(c+f)/2;if(i==="outside"){var d=kn(o,s,u+n,h),v=d.x,m=d.y;return{x:v,y:m,textAnchor:v>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var y=(l+u)/2,x=kn(o,s,y,h),_=x.x,b=x.y;return{x:_,y:b,textAnchor:"middle",verticalAnchor:"middle"}},SMe=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,l=o.y,u=o.width,c=o.height,f=c>=0?1:-1,h=f*i,d=f>0?"end":"start",v=f>0?"start":"end",m=u>=0?1:-1,y=m*i,x=m>0?"end":"start",_=m>0?"start":"end";if(a==="top"){var b={x:s+u/2,y:l-f*i,textAnchor:"middle",verticalAnchor:d};return Jr(Jr({},b),n?{height:Math.max(l-n.y,0),width:u}:{})}if(a==="bottom"){var S={x:s+u/2,y:l+c+h,textAnchor:"middle",verticalAnchor:v};return Jr(Jr({},S),n?{height:Math.max(n.y+n.height-(l+c),0),width:u}:{})}if(a==="left"){var T={x:s-y,y:l+c/2,textAnchor:x,verticalAnchor:"middle"};return Jr(Jr({},T),n?{width:Math.max(T.x-n.x,0),height:c}:{})}if(a==="right"){var C={x:s+u+y,y:l+c/2,textAnchor:_,verticalAnchor:"middle"};return Jr(Jr({},C),n?{width:Math.max(n.x+n.width-C.x,0),height:c}:{})}var A=n?{width:u,height:c}:{};return a==="insideLeft"?Jr({x:s+y,y:l+c/2,textAnchor:_,verticalAnchor:"middle"},A):a==="insideRight"?Jr({x:s+u-y,y:l+c/2,textAnchor:x,verticalAnchor:"middle"},A):a==="insideTop"?Jr({x:s+u/2,y:l+h,textAnchor:"middle",verticalAnchor:v},A):a==="insideBottom"?Jr({x:s+u/2,y:l+c-h,textAnchor:"middle",verticalAnchor:d},A):a==="insideTopLeft"?Jr({x:s+y,y:l+h,textAnchor:_,verticalAnchor:v},A):a==="insideTopRight"?Jr({x:s+u-y,y:l+h,textAnchor:x,verticalAnchor:v},A):a==="insideBottomLeft"?Jr({x:s+y,y:l+c-h,textAnchor:_,verticalAnchor:d},A):a==="insideBottomRight"?Jr({x:s+u-y,y:l+c-h,textAnchor:x,verticalAnchor:d},A):Wv(a)&&(Me(a.x)||Kc(a.x))&&(Me(a.y)||Kc(a.y))?Jr({x:s+Lf(a.x,u),y:l+Lf(a.y,c),textAnchor:"end",verticalAnchor:"end"},A):Jr({x:s+u/2,y:l+c/2,textAnchor:"middle",verticalAnchor:"middle"},A)},TMe=function(t){return"cx"in t&&Me(t.cx)};function Zn(e){var t=e.offset,r=t===void 0?5:t,n=vMe(e,lMe),i=Jr({offset:r},n),a=i.viewBox,o=i.position,s=i.value,l=i.children,u=i.content,c=i.className,f=c===void 0?"":c,h=i.textBreakAll;if(!a||mt(s)&&mt(l)&&!G.isValidElement(u)&&!pt(u))return null;if(G.isValidElement(u))return G.cloneElement(u,i);var d;if(pt(u)){if(d=G.createElement(u,i),G.isValidElement(d))return d}else d=xMe(i);var v=TMe(a),m=vt(i,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return bMe(i,d,m);var y=v?wMe(i):SMe(i);return Q.createElement(Q1,My({className:Ct("recharts-label",f)},m,y,{breakAll:h}),d)}Zn.displayName="Label";var Fq=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,c=t.outerRadius,f=t.x,h=t.y,d=t.top,v=t.left,m=t.width,y=t.height,x=t.clockWise,_=t.labelViewBox;if(_)return _;if(Me(m)&&Me(y)){if(Me(f)&&Me(h))return{x:f,y:h,width:m,height:y};if(Me(d)&&Me(v))return{x:d,y:v,width:m,height:y}}return Me(f)&&Me(h)?{x:f,y:h,width:0,height:0}:Me(r)&&Me(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:c||l||s||0,clockWise:x}:t.viewBox?t.viewBox:{}},CMe=function(t,r){return t?t===!0?Q.createElement(Zn,{key:"label-implicit",viewBox:r}):rn(t)?Q.createElement(Zn,{key:"label-implicit",viewBox:r,value:t}):G.isValidElement(t)?t.type===Zn?G.cloneElement(t,{key:"label-implicit",viewBox:r}):Q.createElement(Zn,{key:"label-implicit",content:t,viewBox:r}):pt(t)?Q.createElement(Zn,{key:"label-implicit",content:t,viewBox:r}):Wv(t)?Q.createElement(Zn,My({viewBox:r},t,{key:"label-implicit"})):null:null},AMe=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=Fq(t),o=Ta(i,Zn).map(function(l,u){return G.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=CMe(t.label,r||a);return[s].concat(uMe(o))};Zn.parseViewBox=Fq;Zn.renderCallByParent=AMe;function MMe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var PMe=MMe;const kMe=Yt(PMe);function Py(e){"@babel/helpers - typeof";return Py=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Py(e)}var LMe=["valueAccessor"],OMe=["data","dataKey","clockWise","id","textBreakAll"];function IMe(e){return jMe(e)||DMe(e)||NMe(e)||EMe()}function EMe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NMe(e,t){if(e){if(typeof e=="string")return YL(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return YL(e,t)}}function DMe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jMe(e){if(Array.isArray(e))return YL(e)}function YL(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $Me(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var FMe=function(t){return Array.isArray(t.value)?kMe(t.value):t.value};function Zs(e){var t=e.valueAccessor,r=t===void 0?FMe:t,n=b$(e,LMe),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=b$(n,OMe);return!i||!i.length?null:Q.createElement(nr,{className:"recharts-label-list"},i.map(function(c,f){var h=mt(a)?r(c,f):si(c&&c.payload,a),d=mt(s)?{}:{id:"".concat(s,"-").concat(f)};return Q.createElement(Zn,mw({},vt(c,!0),u,d,{parentViewBox:c.parentViewBox,value:h,textBreakAll:l,viewBox:Zn.parseViewBox(mt(o)?c:_$(_$({},c),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Zs.displayName="LabelList";function VMe(e,t){return e?e===!0?Q.createElement(Zs,{key:"labelList-implicit",data:t}):Q.isValidElement(e)||pt(e)?Q.createElement(Zs,{key:"labelList-implicit",data:t,content:e}):Wv(e)?Q.createElement(Zs,mw({data:t},e,{key:"labelList-implicit"})):null:null}function GMe(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Ta(n,Zs).map(function(o,s){return G.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=VMe(e.label,t);return[a].concat(IMe(i))}Zs.renderCallByParent=GMe;function ky(e){"@babel/helpers - typeof";return ky=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ky(e)}function XL(){return XL=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, + `).concat(f.x,",").concat(f.y,` + `);if(i>0){var d=kn(r,n,i,o),v=kn(r,n,i,u);h+="L ".concat(v.x,",").concat(v.y,` + A `).concat(i,",").concat(i,`,0, + `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, + `).concat(d.x,",").concat(d.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},YMe=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,c=t.endAngle,f=ro(c-u),h=s_({cx:r,cy:n,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:l}),d=h.circleTangency,v=h.lineTangency,m=h.theta,y=s_({cx:r,cy:n,radius:a,angle:c,sign:-f,cornerRadius:o,cornerIsExternal:l}),x=y.circleTangency,_=y.lineTangency,b=y.theta,S=l?Math.abs(u-c):Math.abs(u-c)-m-b;if(S<0)return s?"M ".concat(v.x,",").concat(v.y,` + a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 + a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 + `):Vq({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:c});var T="M ".concat(v.x,",").concat(v.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(d.x,",").concat(d.y,` + A`).concat(a,",").concat(a,",0,").concat(+(S>180),",").concat(+(f<0),",").concat(x.x,",").concat(x.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(_.x,",").concat(_.y,` + `);if(i>0){var C=s_({cx:r,cy:n,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),A=C.circleTangency,P=C.lineTangency,O=C.theta,k=s_({cx:r,cy:n,radius:i,angle:c,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),E=k.circleTangency,N=k.lineTangency,D=k.theta,z=l?Math.abs(u-c):Math.abs(u-c)-O-D;if(z<0&&o===0)return"".concat(T,"L").concat(r,",").concat(n,"Z");T+="L".concat(N.x,",").concat(N.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(E.x,",").concat(E.y,` + A`).concat(i,",").concat(i,",0,").concat(+(z>180),",").concat(+(f>0),",").concat(A.x,",").concat(A.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,"Z")}else T+="L".concat(r,",").concat(n,"Z");return T},XMe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Gq=function(t){var r=S$(S$({},XMe),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,c=r.startAngle,f=r.endAngle,h=r.className;if(o0&&Math.abs(c-f)<360?y=YMe({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(m,v/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:c,endAngle:f}):y=Vq({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:c,endAngle:f}),Q.createElement("path",XL({},vt(r,!0),{className:d,d:y,role:"img"}))};function Ly(e){"@babel/helpers - typeof";return Ly=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ly(e)}function qL(){return qL=Object.assign?Object.assign.bind():function(e){for(var t=1;tlPe.call(e,t));function Jf(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const fPe="__v",hPe="__o",dPe="_owner",{getOwnPropertyDescriptor:P$,keys:k$}=Object;function vPe(e,t){return e.byteLength===t.byteLength&&yw(new Uint8Array(e),new Uint8Array(t))}function pPe(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function gPe(e,t){return e.byteLength===t.byteLength&&yw(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function mPe(e,t){return Jf(e.getTime(),t.getTime())}function yPe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function xPe(e,t){return e===t}function L$(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.entries();let o,s,l=0;for(;(o=a.next())&&!o.done;){const u=t.entries();let c=!1,f=0;for(;(s=u.next())&&!s.done;){if(i[f]){f++;continue}const h=o.value,d=s.value;if(r.equals(h[0],d[0],l,f,e,t,r)&&r.equals(h[1],d[1],h[0],d[0],e,t,r)){c=i[f]=!0;break}f++}if(!c)return!1;l++}return!0}const _Pe=Jf;function bPe(e,t,r){const n=k$(e);let i=n.length;if(k$(t).length!==i)return!1;for(;i-- >0;)if(!Zq(e,t,r,n[i]))return!1;return!0}function cg(e,t,r){const n=M$(e);let i=n.length;if(M$(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=n[i],!Zq(e,t,r,a)||(o=P$(e,a),s=P$(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function wPe(e,t){return Jf(e.valueOf(),t.valueOf())}function SPe(e,t){return e.source===t.source&&e.flags===t.flags}function O$(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.values();let o,s;for(;(o=a.next())&&!o.done;){const l=t.values();let u=!1,c=0;for(;(s=l.next())&&!s.done;){if(!i[c]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=i[c]=!0;break}c++}if(!u)return!1}return!0}function yw(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function TPe(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Zq(e,t,r,n){return(n===dPe||n===hPe||n===fPe)&&(e.$$typeof||t.$$typeof)?!0:cPe(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const CPe="[object ArrayBuffer]",APe="[object Arguments]",MPe="[object Boolean]",PPe="[object DataView]",kPe="[object Date]",LPe="[object Error]",OPe="[object Map]",IPe="[object Number]",EPe="[object Object]",NPe="[object RegExp]",DPe="[object Set]",jPe="[object String]",RPe={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},BPe="[object URL]",zPe=Object.prototype.toString;function $Pe({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:c,areSetsEqual:f,areTypedArraysEqual:h,areUrlsEqual:d,unknownTagComparators:v}){return function(y,x,_){if(y===x)return!0;if(y==null||x==null)return!1;const b=typeof y;if(b!==typeof x)return!1;if(b!=="object")return b==="number"?s(y,x,_):b==="function"?a(y,x,_):!1;const S=y.constructor;if(S!==x.constructor)return!1;if(S===Object)return l(y,x,_);if(Array.isArray(y))return t(y,x,_);if(S===Date)return n(y,x,_);if(S===RegExp)return c(y,x,_);if(S===Map)return o(y,x,_);if(S===Set)return f(y,x,_);const T=zPe.call(y);if(T===kPe)return n(y,x,_);if(T===NPe)return c(y,x,_);if(T===OPe)return o(y,x,_);if(T===DPe)return f(y,x,_);if(T===EPe)return typeof y.then!="function"&&typeof x.then!="function"&&l(y,x,_);if(T===BPe)return d(y,x,_);if(T===LPe)return i(y,x,_);if(T===APe)return l(y,x,_);if(RPe[T])return h(y,x,_);if(T===CPe)return e(y,x,_);if(T===PPe)return r(y,x,_);if(T===MPe||T===IPe||T===jPe)return u(y,x,_);if(v){let C=v[T];if(!C){const A=uPe(y);A&&(C=v[A])}if(C)return C(y,x,_)}return!1}}function FPe({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:vPe,areArraysEqual:r?cg:pPe,areDataViewsEqual:gPe,areDatesEqual:mPe,areErrorsEqual:yPe,areFunctionsEqual:xPe,areMapsEqual:r?w2(L$,cg):L$,areNumbersEqual:_Pe,areObjectsEqual:r?cg:bPe,arePrimitiveWrappersEqual:wPe,areRegExpsEqual:SPe,areSetsEqual:r?w2(O$,cg):O$,areTypedArraysEqual:r?w2(yw,cg):yw,areUrlsEqual:TPe,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=u_(n.areArraysEqual),a=u_(n.areMapsEqual),o=u_(n.areObjectsEqual),s=u_(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:s})}return n}function VPe(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function GPe({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:c}=r();return t(s,l,{cache:u,equals:n,meta:c,strict:i})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(s,l){return t(s,l,a)}}const WPe=Vu();Vu({strict:!0});Vu({circular:!0});Vu({circular:!0,strict:!0});Vu({createInternalComparator:()=>Jf});Vu({strict:!0,createInternalComparator:()=>Jf});Vu({circular:!0,createInternalComparator:()=>Jf});Vu({circular:!0,createInternalComparator:()=>Jf,strict:!0});function Vu(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=FPe(e),o=$Pe(a),s=r?r(o):VPe(o);return GPe({circular:t,comparator:o,createState:n,equals:s,strict:i})}function HPe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function I$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):HPe(i)};requestAnimationFrame(n)}function KL(e){"@babel/helpers - typeof";return KL=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},KL(e)}function UPe(e){return qPe(e)||XPe(e)||YPe(e)||ZPe()}function ZPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YPe(e,t){if(e){if(typeof e=="string")return E$(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return E$(e,t)}}function E$(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:x<0?0:x},m=function(x){for(var _=x>1?1:x,b=_,S=0;S<8;++S){var T=f(b)-_,C=d(b);if(Math.abs(T-_)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,l=function(c,f,h){var d=-(c-f)*n,v=h*a,m=h+(d-v)*s/1e3,y=h*s/1e3+c;return Math.abs(y-f)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Mke(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function S2(e){return Oke(e)||Lke(e)||kke(e)||Pke()}function Pke(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kke(e,t){if(e){if(typeof e=="string")return rO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rO(e,t)}}function Lke(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Oke(e){if(Array.isArray(e))return rO(e)}function rO(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function bw(e){return bw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},bw(e)}var ns=function(e){jke(r,e);var t=Rke(r);function r(n,i){var a;Ike(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,l=o.attributeName,u=o.from,c=o.to,f=o.steps,h=o.children,d=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(aO(a)),a.changeStyle=a.changeStyle.bind(aO(a)),!s||d<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:c}),iO(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},iO(a);a.state={style:l?Xg({},l,u):u}}else a.state={style:{}};return a}return Nke(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,u=a.shouldReAnimate,c=a.to,f=a.from,h=this.state.style;if(s){if(!o){var d={style:l?Xg({},l,c):c};this.state&&h&&(l&&h[l]!==c||!l&&h!==c)&&this.setState(d);return}if(!(WPe(i.to,c)&&i.canBegin&&i.isActive)){var v=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=v||u?f:i.to;if(this.state&&h){var y={style:l?Xg({},l,m):m};(l&&h[l]!==m||!l&&h!==m)&&this.setState(y)}this.runAnimation(Ga(Ga({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,u=i.easing,c=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,d=Tke(o,s,dke(u),l,this.changeStyle),v=function(){a.stopJSAnimation=d()};this.manager.start([h,c,v,l,f])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,u=o[0],c=u.style,f=u.duration,h=f===void 0?0:f,d=function(m,y,x){if(x===0)return m;var _=y.duration,b=y.easing,S=b===void 0?"ease":b,T=y.style,C=y.properties,A=y.onAnimationEnd,P=x>0?o[x-1]:y,O=C||Object.keys(T);if(typeof S=="function"||S==="spring")return[].concat(S2(m),[a.runJSAnimation.bind(a,{from:P.style,to:T,duration:_,easing:S}),_]);var k=j$(O,_,S),E=Ga(Ga(Ga({},P.style),T),{},{transition:k});return[].concat(S2(m),[E,_,A]).filter(tke)};return this.manager.start([l].concat(S2(o.reduce(d,[c,Math.max(h,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=KPe());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,u=i.easing,c=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,d=i.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof d=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var m=s?Xg({},s,l):l,y=j$(Object.keys(m),o,u);v.start([c,a,Ga(Ga({},m),{},{transition:y}),o,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=Ake(i,Cke),u=G.Children.count(a),c=this.state.style;if(typeof a=="function")return a(c);if(!s||u===0||o<=0)return a;var f=function(d){var v=d.props,m=v.style,y=m===void 0?{}:m,x=v.className,_=G.cloneElement(d,Ga(Ga({},l),{},{style:Ga(Ga({},y),c),className:x}));return _};return u===1?f(G.Children.only(a)):Q.createElement("div",null,G.Children.map(a,function(h){return f(h)}))}}]),r}(G.PureComponent);ns.displayName="Animate";ns.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ns.propTypes={from:zt.oneOfType([zt.object,zt.string]),to:zt.oneOfType([zt.object,zt.string]),attributeName:zt.string,duration:zt.number,begin:zt.number,easing:zt.oneOfType([zt.string,zt.func]),steps:zt.arrayOf(zt.shape({duration:zt.number.isRequired,style:zt.object.isRequired,easing:zt.oneOfType([zt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),zt.func]),properties:zt.arrayOf("string"),onAnimationEnd:zt.func})),children:zt.oneOfType([zt.node,zt.func]),isActive:zt.bool,canBegin:zt.bool,onAnimationEnd:zt.func,shouldReAnimate:zt.bool,onAnimationStart:zt.func,onAnimationReStart:zt.func};function Ey(e){"@babel/helpers - typeof";return Ey=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ey(e)}function ww(){return ww=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,c;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],h=0,d=4;ho?o:a[h];c="M".concat(t,",").concat(r+s*f[0]),f[0]>0&&(c+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+l*f[0],",").concat(r)),c+="L ".concat(t+n-l*f[1],",").concat(r),f[1]>0&&(c+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`, + `).concat(t+n,",").concat(r+s*f[1])),c+="L ".concat(t+n,",").concat(r+i-s*f[2]),f[2]>0&&(c+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`, + `).concat(t+n-l*f[2],",").concat(r+i)),c+="L ".concat(t+l*f[3],",").concat(r+i),f[3]>0&&(c+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`, + `).concat(t,",").concat(r+i-s*f[3])),c+="Z"}else if(o>0&&a===+a&&a>0){var v=Math.min(o,a);c="M ".concat(t,",").concat(r+s*v,` + A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+l*v,",").concat(r,` + L `).concat(t+n-l*v,",").concat(r,` + A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+n,",").concat(r+s*v,` + L `).concat(t+n,",").concat(r+i-s*v,` + A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+n-l*v,",").concat(r+i,` + L `).concat(t+l*v,",").concat(r+i,` + A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t,",").concat(r+i-s*v," Z")}else c="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return c},Zke=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(a,a+s),c=Math.max(a,a+s),f=Math.min(o,o+l),h=Math.max(o,o+l);return n>=u&&n<=c&&i>=f&&i<=h}return!1},Yke={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},UD=function(t){var r=W$(W$({},Yke),t),n=G.useRef(),i=G.useState(-1),a=zke(i,2),o=a[0],s=a[1];G.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,u=r.y,c=r.width,f=r.height,h=r.radius,d=r.className,v=r.animationEasing,m=r.animationDuration,y=r.animationBegin,x=r.isAnimationActive,_=r.isUpdateAnimationActive;if(l!==+l||u!==+u||c!==+c||f!==+f||c===0||f===0)return null;var b=Ct("recharts-rectangle",d);return _?Q.createElement(ns,{canBegin:o>0,from:{width:c,height:f,x:l,y:u},to:{width:c,height:f,x:l,y:u},duration:m,animationEasing:v,isActive:_},function(S){var T=S.width,C=S.height,A=S.x,P=S.y;return Q.createElement(ns,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,isActive:x,easing:v},Q.createElement("path",ww({},vt(r,!0),{className:b,d:H$(A,P,T,C,h),ref:n})))}):Q.createElement("path",ww({},vt(r,!0),{className:b,d:H$(l,u,c,f,h)}))};function oO(){return oO=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tLe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var rLe=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},nLe=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,c=t.width,f=c===void 0?0:c,h=t.height,d=h===void 0?0:h,v=t.className,m=eLe(t,Xke),y=qke({x:n,y:a,top:s,left:u,width:f,height:d},m);return!Me(n)||!Me(a)||!Me(f)||!Me(d)||!Me(s)||!Me(u)?null:Q.createElement("path",sO({},vt(y,!0),{className:Ct("recharts-cross",v),d:rLe(n,a,f,d,s,u)}))},iLe=pX,aLe=iLe(Object.getPrototypeOf,Object),oLe=aLe,sLe=ml,lLe=oLe,uLe=yl,cLe="[object Object]",fLe=Function.prototype,hLe=Object.prototype,eK=fLe.toString,dLe=hLe.hasOwnProperty,vLe=eK.call(Object);function pLe(e){if(!uLe(e)||sLe(e)!=cLe)return!1;var t=lLe(e);if(t===null)return!0;var r=dLe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&eK.call(r)==vLe}var gLe=pLe;const mLe=Yt(gLe);var yLe=ml,xLe=yl,_Le="[object Boolean]";function bLe(e){return e===!0||e===!1||xLe(e)&&yLe(e)==_Le}var wLe=bLe;const SLe=Yt(wLe);function Dy(e){"@babel/helpers - typeof";return Dy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dy(e)}function Sw(){return Sw=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:u},to:{upperWidth:c,lowerWidth:f,height:h,x:l,y:u},duration:m,animationEasing:v,isActive:x},function(b){var S=b.upperWidth,T=b.lowerWidth,C=b.height,A=b.x,P=b.y;return Q.createElement(ns,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,easing:v},Q.createElement("path",Sw({},vt(r,!0),{className:_,d:q$(A,P,S,T,C),ref:n})))}):Q.createElement("g",null,Q.createElement("path",Sw({},vt(r,!0),{className:_,d:q$(l,u,c,f,h)})))},NLe=["option","shapeType","propTransformer","activeClassName","isActive"];function jy(e){"@babel/helpers - typeof";return jy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jy(e)}function DLe(e,t){if(e==null)return{};var r=jLe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jLe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function K$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tw(e){for(var t=1;t0&&n.handleDrag(i.changedTouches[0])}),Ii(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),Ii(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Ii(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Ii(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Ii(n,"handleSlideDragStart",function(i){var a=iF(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return bOe(t,e),mOe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,c=u.length-1,f=Math.min(i,a),h=Math.max(i,a),d=t.getIndexInRange(o,f),v=t.getIndexInRange(o,h);return{startIndex:d-d%l,endIndex:v===c?c:v-v%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=si(a[n],s,n);return pt(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,u=l.x,c=l.width,f=l.travellerWidth,h=l.startIndex,d=l.endIndex,v=l.onChange,m=n.pageX-a;m>0?m=Math.min(m,u+c-f-s,u+c-f-o):m<0&&(m=Math.max(m,u-o,u-s));var y=this.getIndex({startX:o+m,endX:s+m});(y.startIndex!==h||y.endIndex!==d)&&v&&v(y),this.setState({startX:o+m,endX:s+m,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=iF(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,u=this.state[o],c=this.props,f=c.x,h=c.width,d=c.travellerWidth,v=c.onChange,m=c.gap,y=c.data,x={startX:this.state.startX,endX:this.state.endX},_=n.pageX-a;_>0?_=Math.min(_,f+h-d-u):_<0&&(_=Math.max(_,f-u)),x[o]=u+_;var b=this.getIndex(x),S=b.startIndex,T=b.endIndex,C=function(){var P=y.length-1;return o==="startX"&&(s>l?S%m===0:T%m===0)||sl?T%m===0:S%m===0)||s>l&&T===P};this.setState(Ii(Ii({},o,u+_),"brushMoveStartX",n.pageX),function(){v&&C()&&v(b)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,c=this.state[i],f=s.indexOf(c);if(f!==-1){var h=f+n;if(!(h===-1||h>=s.length)){var d=s[h];i==="startX"&&d>=u||i==="endX"&&d<=l||this.setState(Ii({},i,d),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return Q.createElement("rect",{stroke:u,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.data,u=n.children,c=n.padding,f=G.Children.only(u);return f?Q.cloneElement(f,{x:i,y:a,width:o,height:s,margin:c,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,l=this.props,u=l.y,c=l.travellerWidth,f=l.height,h=l.traveller,d=l.ariaLabel,v=l.data,m=l.startIndex,y=l.endIndex,x=Math.max(n,this.props.x),_=C2(C2({},vt(this.props,!1)),{},{x,y:u,width:c,height:f}),b=d||"Min value: ".concat((a=v[m])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=v[y])===null||o===void 0?void 0:o.name);return Q.createElement(nr,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(T){["ArrowLeft","ArrowRight"].includes(T.key)&&(T.preventDefault(),T.stopPropagation(),s.handleTravellerMoveKeyboard(T.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,_))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,u=a.travellerWidth,c=Math.min(n,i)+u,f=Math.max(Math.abs(i-n)-u,0);return Q.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:c,y:o,width:f,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,c=this.state,f=c.startX,h=c.endX,d=5,v={pointerEvents:"none",fill:u};return Q.createElement(nr,{className:"recharts-brush-texts"},Q.createElement(Q1,Aw({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-d,y:o+s/2},v),this.getTextOfTick(i)),Q.createElement(Q1,Aw({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+l+d,y:o+s/2},v),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,l=n.y,u=n.width,c=n.height,f=n.alwaysShowText,h=this.state,d=h.startX,v=h.endX,m=h.isTextActive,y=h.isSlideMoving,x=h.isTravellerMoving,_=h.isTravellerFocused;if(!i||!i.length||!Me(s)||!Me(l)||!Me(u)||!Me(c)||u<=0||c<=0)return null;var b=Ct("recharts-brush",a),S=Q.Children.count(o)===1,T=pOe("userSelect","none");return Q.createElement(nr,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:T},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(d,v),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(v,"endX"),(m||y||x||_||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(a+s/2)-1;return Q.createElement(Q.Fragment,null,Q.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),Q.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),Q.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return Q.isValidElement(n)?a=Q.cloneElement(n,i):pt(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,c=n.startIndex,f=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return C2({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?SOe({data:a,width:o,x:s,travellerWidth:l,startIndex:c,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var h=i.scale.domain().map(function(d){return i.scale(d)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>i?s=l:o=l}return i>=n[s]?s:o}}])}(G.PureComponent);Ii(ov,"displayName","Brush");Ii(ov,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var TOe=yD;function COe(e,t){var r;return TOe(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var AOe=COe,MOe=sX,POe=Qv,kOe=AOe,LOe=Ai,OOe=HT;function IOe(e,t,r){var n=LOe(e)?MOe:kOe;return r&&OOe(e,t,r)&&(t=void 0),n(e,POe(t))}var EOe=IOe;const NOe=Yt(EOe);var qo=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},aF=PX;function DOe(e,t,r){t=="__proto__"&&aF?aF(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var jOe=DOe,ROe=jOe,BOe=AX,zOe=Qv;function $Oe(e,t){var r={};return t=zOe(t),BOe(e,function(n,i,a){ROe(r,i,t(n,i,a))}),r}var FOe=$Oe;const VOe=Yt(FOe);function GOe(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sIe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function lIe(e,t){var r=e.x,n=e.y,i=oIe(e,rIe),a="".concat(r),o=parseInt(a,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||i.height),c=parseInt(u,10),f="".concat(t.width||i.width),h=parseInt(f,10);return fg(fg(fg(fg(fg({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:c,width:h,name:t.name,radius:t.radius})}function sF(e){return Q.createElement(GLe,uO({shapeType:"rectangle",propTransformer:lIe,activeClassName:"recharts-active-bar"},e))}var uIe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=Me(n)||_ve(n);return a?t(n,i):(a||If(),r)}},cIe=["value","background"],iK;function sv(e){"@babel/helpers - typeof";return sv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sv(e)}function fIe(e,t){if(e==null)return{};var r=hIe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hIe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Pw(){return Pw=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(V)0&&Math.abs(z)0&&(D=Math.min((te||0)-(z[ce-1]||0),D))}),Number.isFinite(D)){var V=D/N,F=m.layout==="vertical"?n.height:n.width;if(m.padding==="gap"&&(A=V*F/2),m.padding==="no-gap"){var $=Lf(t.barCategoryGap,V*F),B=V*F/2;A=B-$-(B-$)/F*$}}}i==="xAxis"?P=[n.left+(b.left||0)+(A||0),n.left+n.width-(b.right||0)-(A||0)]:i==="yAxis"?P=l==="horizontal"?[n.top+n.height-(b.bottom||0),n.top+(b.top||0)]:[n.top+(b.top||0)+(A||0),n.top+n.height-(b.bottom||0)-(A||0)]:P=m.range,T&&(P=[P[1],P[0]]);var H=F2e(m,a,h),U=H.scale,Z=H.realScaleType;U.domain(x).range(P),V2e(U);var Y=q2e(U,Ja(Ja({},m),{},{realScaleType:Z}));i==="xAxis"?(E=y==="top"&&!S||y==="bottom"&&S,O=n.left,k=f[C]-E*m.height):i==="yAxis"&&(E=y==="left"&&!S||y==="right"&&S,O=f[C]-E*m.width,k=n.top);var K=Ja(Ja(Ja({},m),Y),{},{realScaleType:Z,x:O,y:k,scale:U,width:i==="xAxis"?n.width:m.width,height:i==="yAxis"?n.height:m.height});return K.bandSize=pw(K,Y),!m.hide&&i==="xAxis"?f[C]+=(E?-1:1)*K.height:m.hide||(f[C]+=(E?-1:1)*K.width),Ja(Ja({},d),{},iC({},v,K))},{})},uK=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},SIe=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return uK({x:r,y:n},{x:i,y:a})},cK=function(){function e(t){_Ie(this,e),this.scale=t}return bIe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();iC(cK,"EPS",1e-4);var ZD=function(t){var r=Object.keys(t).reduce(function(n,i){return Ja(Ja({},n),{},iC({},i,cK.create(t[i])))},{});return Ja(Ja({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return VOe(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return tIe(i,function(a,o){return r[o].isInRange(a)})}})};function TIe(e){return(e%180+180)%180}var CIe=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=TIe(i),o=a*Math.PI/180,s=Math.atan(n/r),l=o>s&&oe.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function hEe(e,t){return MK(e,t+1)}function dEe(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,c=o,f=function(){var v=n==null?void 0:n[l];if(v===void 0)return{v:MK(n,u)};var m=l,y,x=function(){return y===void 0&&(y=r(v,m)),y},_=v.coordinate,b=l===0||Ew(e,_,x,c,s);b||(l=0,c=o,u+=1),b&&(c=_+e*(x()/2+i),l+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function Vy(e){"@babel/helpers - typeof";return Vy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vy(e)}function _F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Gn(e){for(var t=1;t0?d.coordinate-y*e:d.coordinate})}else a[h]=d=Gn(Gn({},d),{},{tickCoord:d.coordinate});var x=Ew(e,d.tickCoord,m,s,l);x&&(l=d.tickCoord-e*(m()/2+i),a[h]=Gn(Gn({},d),{},{isShow:!0}))},c=o-1;c>=0;c--)u(c);return a}function yEe(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(a){var c=n[s-1],f=r(c,s-1),h=e*(c.coordinate+e*f/2-u);o[s-1]=c=Gn(Gn({},c),{},{tickCoord:h>0?c.coordinate-h*e:c.coordinate});var d=Ew(e,c.tickCoord,function(){return f},l,u);d&&(u=c.tickCoord-e*(f/2+i),o[s-1]=Gn(Gn({},c),{},{isShow:!0}))}for(var v=a?s-1:s,m=function(_){var b=o[_],S,T=function(){return S===void 0&&(S=r(b,_)),S};if(_===0){var C=e*(b.coordinate-e*T()/2-l);o[_]=b=Gn(Gn({},b),{},{tickCoord:C<0?b.coordinate-C*e:b.coordinate})}else o[_]=b=Gn(Gn({},b),{},{tickCoord:b.coordinate});var A=Ew(e,b.tickCoord,T,l,u);A&&(l=b.tickCoord+e*(T()/2+i),o[_]=Gn(Gn({},b),{},{isShow:!0}))},y=0;y=2?ro(i[1].coordinate-i[0].coordinate):1,x=fEe(a,y,d);return l==="equidistantPreserveStart"?dEe(y,x,m,i,o):(l==="preserveStart"||l==="preserveStartEnd"?h=yEe(y,x,m,i,o,l==="preserveStartEnd"):h=mEe(y,x,m,i,o),h.filter(function(_){return _.isShow}))}var _Ee=["viewBox"],bEe=["viewBox"],wEe=["ticks"];function fv(e){"@babel/helpers - typeof";return fv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fv(e)}function vd(){return vd=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function SEe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function TEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wF(e,t){for(var r=0;r0?l(this.props):l(d)),o<=0||s<=0||!v||!v.length?null:Q.createElement(nr,{className:Ct("recharts-cartesian-axis",u),ref:function(y){n.layerReference=y}},a&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),Zn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=Ct(i.className,"recharts-cartesian-axis-tick-value");return Q.isValidElement(n)?o=Q.cloneElement(n,Kr(Kr({},i),{},{className:s})):pt(n)?o=n(Kr(Kr({},i),{},{className:s})):o=Q.createElement(Q1,vd({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(G.Component);XD(uC,"displayName","CartesianAxis");XD(uC,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var OEe=["type","layout","connectNulls","ref"],IEe=["key"];function hv(e){"@babel/helpers - typeof";return hv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hv(e)}function SF(e,t){if(e==null)return{};var r=EEe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function EEe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wm(){return wm=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rf){d=[].concat(wh(l.slice(0,v)),[f-m]);break}var y=d.length%2===0?[0,h]:[h];return[].concat(wh(t.repeat(l,c)),wh(d),y).map(function(x){return"".concat(x,"px")}).join(", ")}),Qa(r,"id",Xv("recharts-line-")),Qa(r,"pathRef",function(o){r.mainCurve=o}),Qa(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Qa(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return GEe(t,e),zEe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,s=a.xAxis,l=a.yAxis,u=a.layout,c=a.children,f=Ta(c,R0);if(!f)return null;var h=function(m,y){return{x:m.x,y:m.y,value:m.value,errorVal:si(m.payload,y)}},d={clipPath:n?"url(#clipPath-".concat(i,")"):null};return Q.createElement(nr,d,f.map(function(v){return Q.cloneElement(v,{key:"bar-".concat(v.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,c=s.dataKey,f=vt(this.props,!1),h=vt(l,!0),d=u.map(function(m,y){var x=Oi(Oi(Oi({key:"dot-".concat(y),r:3},f),h),{},{index:y,cx:m.x,cy:m.y,value:m.value,dataKey:c,payload:m.payload,points:u});return t.renderDotItem(l,x)}),v={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return Q.createElement(nr,wm({className:"recharts-line-dots",key:"dots"},v),d)}},{key:"renderCurveStatically",value:function(n,i,a,o){var s=this.props,l=s.type,u=s.layout,c=s.connectNulls;s.ref;var f=SF(s,OEe),h=Oi(Oi(Oi({},vt(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:l,layout:u,connectNulls:c});return Q.createElement(Ed,wm({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,l=o.strokeDasharray,u=o.isAnimationActive,c=o.animationBegin,f=o.animationDuration,h=o.animationEasing,d=o.animationId,v=o.animateNewValues,m=o.width,y=o.height,x=this.state,_=x.prevPoints,b=x.totalLength;return Q.createElement(ns,{begin:c,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var T=S.t;if(_){var C=_.length/s.length,A=s.map(function(N,D){var z=Math.floor(D*C);if(_[z]){var V=_[z],F=Pn(V.x,N.x),$=Pn(V.y,N.y);return Oi(Oi({},N),{},{x:F(T),y:$(T)})}if(v){var B=Pn(m*2,N.x),H=Pn(y/2,N.y);return Oi(Oi({},N),{},{x:B(T),y:H(T)})}return Oi(Oi({},N),{},{x:N.x,y:N.y})});return a.renderCurveStatically(A,n,i)}var P=Pn(0,b),O=P(T),k;if(l){var E="".concat(l).split(/[,\s]+/gim).map(function(N){return parseFloat(N)});k=a.getStrokeDasharray(O,b,E)}else k=a.generateSimpleStrokeDasharray(b,O);return a.renderCurveStatically(s,n,i,{strokeDasharray:k})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,s=a.isAnimationActive,l=this.state,u=l.prevPoints,c=l.totalLength;return s&&o&&o.length&&(!u&&c>0||!rv(u,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.xAxis,c=i.yAxis,f=i.top,h=i.left,d=i.width,v=i.height,m=i.isAnimationActive,y=i.id;if(a||!s||!s.length)return null;var x=this.state.isAnimationFinished,_=s.length===1,b=Ct("recharts-line",l),S=u&&u.allowDataOverflow,T=c&&c.allowDataOverflow,C=S||T,A=mt(y)?this.id:y,P=(n=vt(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},O=P.r,k=O===void 0?3:O,E=P.strokeWidth,N=E===void 0?2:E,D=IY(o)?o:{},z=D.clipDot,V=z===void 0?!0:z,F=k*2+N;return Q.createElement(nr,{className:b},S||T?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(A)},Q.createElement("rect",{x:S?h:h-d/2,y:T?f:f-v/2,width:S?d:d*2,height:T?v:v*2})),!V&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(A)},Q.createElement("rect",{x:h-F/2,y:f-F/2,width:d+F,height:v+F}))):null,!_&&this.renderCurve(C,A),this.renderErrorBar(C,A),(_||o)&&this.renderDots(C,V,A),(!m||x)&&Zs.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(wh(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ZEe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function tf(){return tf=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!rv(c,o)||!rv(f,s))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.top,c=i.left,f=i.xAxis,h=i.yAxis,d=i.width,v=i.height,m=i.isAnimationActive,y=i.id;if(a||!s||!s.length)return null;var x=this.state.isAnimationFinished,_=s.length===1,b=Ct("recharts-area",l),S=f&&f.allowDataOverflow,T=h&&h.allowDataOverflow,C=S||T,A=mt(y)?this.id:y,P=(n=vt(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},O=P.r,k=O===void 0?3:O,E=P.strokeWidth,N=E===void 0?2:E,D=IY(o)?o:{},z=D.clipDot,V=z===void 0?!0:z,F=k*2+N;return Q.createElement(nr,{className:b},S||T?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(A)},Q.createElement("rect",{x:S?c:c-d/2,y:T?u:u-v/2,width:S?d:d*2,height:T?v:v*2})),!V&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(A)},Q.createElement("rect",{x:c-F/2,y:u-F/2,width:d+F,height:v+F}))):null,_?null:this.renderArea(C,A),(o||_)&&this.renderDots(C,V,A),(!m||x)&&Zs.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(G.PureComponent);IK=Gu;Fo(Gu,"displayName","Area");Fo(Gu,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Xf.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Fo(Gu,"getBaseValue",function(e,t,r,n){var i=e.layout,a=e.baseValue,o=t.props.baseValue,s=o??a;if(Me(s)&&typeof s=="number")return s;var l=i==="horizontal"?n:r,u=l.scale.domain();if(l.type==="number"){var c=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return s==="dataMin"?f:s==="dataMax"||c<0?c:Math.max(Math.min(u[0],u[1]),0)}return s==="dataMin"?u[0]:s==="dataMax"?u[1]:u[0]});Fo(Gu,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,l=e.dataKey,u=e.stackedData,c=e.dataStartIndex,f=e.displayedData,h=e.offset,d=t.layout,v=u&&u.length,m=IK.getBaseValue(t,r,n,i),y=d==="horizontal",x=!1,_=f.map(function(S,T){var C;v?C=u[c+T]:(C=si(S,l),Array.isArray(C)?x=!0:C=[m,C]);var A=C[1]==null||v&&si(S,l)==null;return y?{x:vw({axis:n,ticks:a,bandSize:s,entry:S,index:T}),y:A?null:i.scale(C[1]),value:C,payload:S}:{x:A?null:n.scale(C[1]),y:vw({axis:i,ticks:o,bandSize:s,entry:S,index:T}),value:C,payload:S}}),b;return v||x?b=_.map(function(S){var T=Array.isArray(S.value)?S.value[0]:null;return y?{x:S.x,y:T!=null&&S.y!=null?i.scale(T):null}:{x:T!=null?n.scale(T):null,y:S.y}}):b=y?i.scale(m):n.scale(m),jl({points:_,baseLine:b,layout:d,isRange:x},h)});Fo(Gu,"renderDotItem",function(e,t){var r;if(Q.isValidElement(e))r=Q.cloneElement(e,t);else if(pt(e))r=e(t);else{var n=Ct("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=EK(t,UEe);r=Q.createElement(tC,tf({},a,{key:i,className:n}))}return r});function vv(e){"@babel/helpers - typeof";return vv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vv(e)}function tNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rNe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function VNe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function GNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WNe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&Me(i)&&Me(a)?t.slice(i,a+1):[]};function XK(e){return e==="number"?[0,"auto"]:void 0}var kO=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=cC(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(l,u){var c,f=(c=u.props.data)!==null&&c!==void 0?c:r;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var d=f===void 0?s:f;h=R1(d,o.dataKey,i)}else h=f&&f[n]||s[n];return h?[].concat(mv(l),[$q(u,h)]):l},[])},EF=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=rDe(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,c=D2e(o,s,u,l);if(c>=0&&u){var f=u[c]&&u[c].value,h=kO(t,r,c,f),d=nDe(n,s,c,a);return{activeTooltipIndex:c,activeLabel:f,activePayload:h,activeCoordinate:d}}return null},iDe=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=t.layout,f=t.children,h=t.stackOffset,d=Bq(c,a);return n.reduce(function(v,m){var y,x=m.type.defaultProps!==void 0?he(he({},m.type.defaultProps),m.props):m.props,_=x.type,b=x.dataKey,S=x.allowDataOverflow,T=x.allowDuplicatedCategory,C=x.scale,A=x.ticks,P=x.includeHidden,O=x[o];if(v[O])return v;var k=cC(t.data,{graphicalItems:i.filter(function(Y){var K,te=o in Y.props?Y.props[o]:(K=Y.type.defaultProps)===null||K===void 0?void 0:K[o];return te===O}),dataStartIndex:l,dataEndIndex:u}),E=k.length,N,D,z;LNe(x.domain,S,_)&&(N=UL(x.domain,null,S),d&&(_==="number"||C!=="auto")&&(z=_m(k,b,"category")));var V=XK(_);if(!N||N.length===0){var F,$=(F=x.domain)!==null&&F!==void 0?F:V;if(b){if(N=_m(k,b,_),_==="category"&&d){var B=wve(N);T&&B?(D=N,N=Cw(0,E)):T||(N=v$($,N,m).reduce(function(Y,K){return Y.indexOf(K)>=0?Y:[].concat(mv(Y),[K])},[]))}else if(_==="category")T?N=N.filter(function(Y){return Y!==""&&!mt(Y)}):N=v$($,N,m).reduce(function(Y,K){return Y.indexOf(K)>=0||K===""||mt(K)?Y:[].concat(mv(Y),[K])},[]);else if(_==="number"){var H=$2e(k,i.filter(function(Y){var K,te,ce=o in Y.props?Y.props[o]:(K=Y.type.defaultProps)===null||K===void 0?void 0:K[o],de="hide"in Y.props?Y.props.hide:(te=Y.type.defaultProps)===null||te===void 0?void 0:te.hide;return ce===O&&(P||!de)}),b,a,c);H&&(N=H)}d&&(_==="number"||C!=="auto")&&(z=_m(k,b,"category"))}else d?N=Cw(0,E):s&&s[O]&&s[O].hasStack&&_==="number"?N=h==="expand"?[0,1]:zq(s[O].stackGroups,l,u):N=Rq(k,i.filter(function(Y){var K=o in Y.props?Y.props[o]:Y.type.defaultProps[o],te="hide"in Y.props?Y.props.hide:Y.type.defaultProps.hide;return K===O&&(P||!te)}),_,c,!0);if(_==="number")N=AO(f,N,O,a,A),$&&(N=UL($,N,S));else if(_==="category"&&$){var U=$,Z=N.every(function(Y){return U.indexOf(Y)>=0});Z&&(N=U)}}return he(he({},v),{},et({},O,he(he({},x),{},{axisType:a,domain:N,categoricalDomain:z,duplicateDomain:D,originalDomain:(y=x.domain)!==null&&y!==void 0?y:V,isCategorical:d,layout:c})))},{})},aDe=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=t.layout,f=t.children,h=cC(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),d=h.length,v=Bq(c,a),m=-1;return n.reduce(function(y,x){var _=x.type.defaultProps!==void 0?he(he({},x.type.defaultProps),x.props):x.props,b=_[o],S=XK("number");if(!y[b]){m++;var T;return v?T=Cw(0,d):s&&s[b]&&s[b].hasStack?(T=zq(s[b].stackGroups,l,u),T=AO(f,T,b,a)):(T=UL(S,Rq(h,n.filter(function(C){var A,P,O=o in C.props?C.props[o]:(A=C.type.defaultProps)===null||A===void 0?void 0:A[o],k="hide"in C.props?C.props.hide:(P=C.type.defaultProps)===null||P===void 0?void 0:P.hide;return O===b&&!k}),"number",c),i.defaultProps.allowDataOverflow),T=AO(f,T,b,a)),he(he({},y),{},et({},b,he(he({axisType:a},i.defaultProps),{},{hide:!0,orientation:Sa(eDe,"".concat(a,".").concat(m%2),null),domain:T,originalDomain:S,isCategorical:v,layout:c})))}return y},{})},oDe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=t.children,f="".concat(i,"Id"),h=Ta(c,a),d={};return h&&h.length?d=iDe(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(d=aDe(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),d},sDe=function(t){var r=qh(t),n=ef(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:xD(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:pw(r,n)}},NF=function(t){var r=t.children,n=t.defaultShowTooltip,i=Ni(r,ov),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},lDe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Hs(r&&r.type);return n&&n.indexOf("Bar")>=0})},DF=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},uDe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,c=n.height,f=n.children,h=n.margin||{},d=Ni(f,ov),v=Ni(f,Ld),m=Object.keys(l).reduce(function(T,C){var A=l[C],P=A.orientation;return!A.mirror&&!A.hide?he(he({},T),{},et({},P,T[P]+A.width)):T},{left:h.left||0,right:h.right||0}),y=Object.keys(o).reduce(function(T,C){var A=o[C],P=A.orientation;return!A.mirror&&!A.hide?he(he({},T),{},et({},P,Sa(T,"".concat(P))+A.height)):T},{top:h.top||0,bottom:h.bottom||0}),x=he(he({},y),m),_=x.bottom;d&&(x.bottom+=d.props.height||ov.defaultProps.height),v&&r&&(x=B2e(x,i,n,r));var b=u-x.left-x.right,S=c-x.top-x.bottom;return he(he({brushBottom:_},x),{},{width:Math.max(b,0),height:Math.max(S,0)})},cDe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},qK=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,c=t.formatAxisMap,f=t.defaultProps,h=function(x,_){var b=_.graphicalItems,S=_.stackGroups,T=_.offset,C=_.updateId,A=_.dataStartIndex,P=_.dataEndIndex,O=x.barSize,k=x.layout,E=x.barGap,N=x.barCategoryGap,D=x.maxBarSize,z=DF(k),V=z.numericAxisName,F=z.cateAxisName,$=lDe(b),B=[];return b.forEach(function(H,U){var Z=cC(x.data,{graphicalItems:[H],dataStartIndex:A,dataEndIndex:P}),Y=H.type.defaultProps!==void 0?he(he({},H.type.defaultProps),H.props):H.props,K=Y.dataKey,te=Y.maxBarSize,ce=Y["".concat(V,"Id")],de=Y["".concat(F,"Id")],Oe={},ye=l.reduce(function(Or,wn){var ps=_["".concat(wn.axisType,"Map")],qu=Y["".concat(wn.axisType,"Id")];ps&&ps[qu]||wn.axisType==="zAxis"||If();var Ku=ps[qu];return he(he({},Or),{},et(et({},wn.axisType,Ku),"".concat(wn.axisType,"Ticks"),ef(Ku)))},Oe),ne=ye[F],ve=ye["".concat(F,"Ticks")],ue=S&&S[ce]&&S[ce].hasStack&&J2e(H,S[ce].stackGroups),ee=Hs(H.type).indexOf("Bar")>=0,We=pw(ne,ve),be=[],Ve=$&&j2e({barSize:O,stackGroups:S,totalSize:cDe(ye,F)});if(ee){var Ze,ht,Bt=mt(te)?D:te,Kt=(Ze=(ht=pw(ne,ve,!0))!==null&&ht!==void 0?ht:Bt)!==null&&Ze!==void 0?Ze:0;be=R2e({barGap:E,barCategoryGap:N,bandSize:Kt!==We?Kt:We,sizeList:Ve[de],maxBarSize:Bt}),Kt!==We&&(be=be.map(function(Or){return he(he({},Or),{},{position:he(he({},Or.position),{},{offset:Or.position.offset-Kt/2})})}))}var cn=H&&H.type&&H.type.getComposedData;cn&&B.push({props:he(he({},cn(he(he({},ye),{},{displayedData:Z,props:x,dataKey:K,item:H,bandSize:We,barPosition:be,offset:T,stackedData:ue,layout:k,dataStartIndex:A,dataEndIndex:P}))),{},et(et(et({key:H.key||"item-".concat(U)},V,ye[V]),F,ye[F]),"animationId",C)),childIndex:Nve(H,x.children),item:H})}),B},d=function(x,_){var b=x.props,S=x.dataStartIndex,T=x.dataEndIndex,C=x.updateId;if(!lz({props:b}))return null;var A=b.children,P=b.layout,O=b.stackOffset,k=b.data,E=b.reverseStackOrder,N=DF(P),D=N.numericAxisName,z=N.cateAxisName,V=Ta(A,n),F=X2e(k,V,"".concat(D,"Id"),"".concat(z,"Id"),O,E),$=l.reduce(function(Y,K){var te="".concat(K.axisType,"Map");return he(he({},Y),{},et({},te,oDe(b,he(he({},K),{},{graphicalItems:V,stackGroups:K.axisType===D&&F,dataStartIndex:S,dataEndIndex:T}))))},{}),B=uDe(he(he({},$),{},{props:b,graphicalItems:V}),_==null?void 0:_.legendBBox);Object.keys($).forEach(function(Y){$[Y]=c(b,$[Y],B,Y.replace("Map",""),r)});var H=$["".concat(z,"Map")],U=sDe(H),Z=h(b,he(he({},$),{},{dataStartIndex:S,dataEndIndex:T,updateId:C,graphicalItems:V,stackGroups:F,offset:B}));return he(he({formattedGraphicalItems:Z,graphicalItems:V,offset:B,stackGroups:F},U),$)},v=function(y){function x(_){var b,S,T;return GNe(this,x),T=UNe(this,x,[_]),et(T,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),et(T,"accessibilityManager",new kNe),et(T,"handleLegendBBoxUpdate",function(C){if(C){var A=T.state,P=A.dataStartIndex,O=A.dataEndIndex,k=A.updateId;T.setState(he({legendBBox:C},d({props:T.props,dataStartIndex:P,dataEndIndex:O,updateId:k},he(he({},T.state),{},{legendBBox:C}))))}}),et(T,"handleReceiveSyncEvent",function(C,A,P){if(T.props.syncId===C){if(P===T.eventEmitterSymbol&&typeof T.props.syncMethod!="function")return;T.applySyncEvent(A)}}),et(T,"handleBrushChange",function(C){var A=C.startIndex,P=C.endIndex;if(A!==T.state.dataStartIndex||P!==T.state.dataEndIndex){var O=T.state.updateId;T.setState(function(){return he({dataStartIndex:A,dataEndIndex:P},d({props:T.props,dataStartIndex:A,dataEndIndex:P,updateId:O},T.state))}),T.triggerSyncEvent({dataStartIndex:A,dataEndIndex:P})}}),et(T,"handleMouseEnter",function(C){var A=T.getMouseInfo(C);if(A){var P=he(he({},A),{},{isTooltipActive:!0});T.setState(P),T.triggerSyncEvent(P);var O=T.props.onMouseEnter;pt(O)&&O(P,C)}}),et(T,"triggeredAfterMouseMove",function(C){var A=T.getMouseInfo(C),P=A?he(he({},A),{},{isTooltipActive:!0}):{isTooltipActive:!1};T.setState(P),T.triggerSyncEvent(P);var O=T.props.onMouseMove;pt(O)&&O(P,C)}),et(T,"handleItemMouseEnter",function(C){T.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),et(T,"handleItemMouseLeave",function(){T.setState(function(){return{isTooltipActive:!1}})}),et(T,"handleMouseMove",function(C){C.persist(),T.throttleTriggeredAfterMouseMove(C)}),et(T,"handleMouseLeave",function(C){T.throttleTriggeredAfterMouseMove.cancel();var A={isTooltipActive:!1};T.setState(A),T.triggerSyncEvent(A);var P=T.props.onMouseLeave;pt(P)&&P(A,C)}),et(T,"handleOuterEvent",function(C){var A=Eve(C),P=Sa(T.props,"".concat(A));if(A&&pt(P)){var O,k;/.*touch.*/i.test(A)?k=T.getMouseInfo(C.changedTouches[0]):k=T.getMouseInfo(C),P((O=k)!==null&&O!==void 0?O:{},C)}}),et(T,"handleClick",function(C){var A=T.getMouseInfo(C);if(A){var P=he(he({},A),{},{isTooltipActive:!0});T.setState(P),T.triggerSyncEvent(P);var O=T.props.onClick;pt(O)&&O(P,C)}}),et(T,"handleMouseDown",function(C){var A=T.props.onMouseDown;if(pt(A)){var P=T.getMouseInfo(C);A(P,C)}}),et(T,"handleMouseUp",function(C){var A=T.props.onMouseUp;if(pt(A)){var P=T.getMouseInfo(C);A(P,C)}}),et(T,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),et(T,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.handleMouseDown(C.changedTouches[0])}),et(T,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.handleMouseUp(C.changedTouches[0])}),et(T,"handleDoubleClick",function(C){var A=T.props.onDoubleClick;if(pt(A)){var P=T.getMouseInfo(C);A(P,C)}}),et(T,"handleContextMenu",function(C){var A=T.props.onContextMenu;if(pt(A)){var P=T.getMouseInfo(C);A(P,C)}}),et(T,"triggerSyncEvent",function(C){T.props.syncId!==void 0&&M2.emit(P2,T.props.syncId,C,T.eventEmitterSymbol)}),et(T,"applySyncEvent",function(C){var A=T.props,P=A.layout,O=A.syncMethod,k=T.state.updateId,E=C.dataStartIndex,N=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)T.setState(he({dataStartIndex:E,dataEndIndex:N},d({props:T.props,dataStartIndex:E,dataEndIndex:N,updateId:k},T.state)));else if(C.activeTooltipIndex!==void 0){var D=C.chartX,z=C.chartY,V=C.activeTooltipIndex,F=T.state,$=F.offset,B=F.tooltipTicks;if(!$)return;if(typeof O=="function")V=O(B,C);else if(O==="value"){V=-1;for(var H=0;H=0){var ue,ee;if(D.dataKey&&!D.allowDuplicatedCategory){var We=typeof D.dataKey=="function"?ve:"payload.".concat(D.dataKey.toString());ue=R1(H,We,V),ee=U&&Z&&R1(Z,We,V)}else ue=H==null?void 0:H[z],ee=U&&Z&&Z[z];if(de||ce){var be=C.props.activeIndex!==void 0?C.props.activeIndex:z;return[G.cloneElement(C,he(he(he({},O.props),ye),{},{activeIndex:be})),null,null]}if(!mt(ue))return[ne].concat(mv(T.renderActivePoints({item:O,activePoint:ue,basePoint:ee,childIndex:z,isRange:U})))}else{var Ve,Ze=(Ve=T.getItemByXY(T.state.activeCoordinate))!==null&&Ve!==void 0?Ve:{graphicalItem:ne},ht=Ze.graphicalItem,Bt=ht.item,Kt=Bt===void 0?C:Bt,cn=ht.childIndex,Or=he(he(he({},O.props),ye),{},{activeIndex:cn});return[G.cloneElement(Kt,Or),null,null]}return U?[ne,null,null]:[ne,null]}),et(T,"renderCustomized",function(C,A,P){return G.cloneElement(C,he(he({key:"recharts-customized-".concat(P)},T.props),T.state))}),et(T,"renderMap",{CartesianGrid:{handler:f_,once:!0},ReferenceArea:{handler:T.renderReferenceElement},ReferenceLine:{handler:f_},ReferenceDot:{handler:T.renderReferenceElement},XAxis:{handler:f_},YAxis:{handler:f_},Brush:{handler:T.renderBrush,once:!0},Bar:{handler:T.renderGraphicChild},Line:{handler:T.renderGraphicChild},Area:{handler:T.renderGraphicChild},Radar:{handler:T.renderGraphicChild},RadialBar:{handler:T.renderGraphicChild},Scatter:{handler:T.renderGraphicChild},Pie:{handler:T.renderGraphicChild},Funnel:{handler:T.renderGraphicChild},Tooltip:{handler:T.renderCursor,once:!0},PolarGrid:{handler:T.renderPolarGrid,once:!0},PolarAngleAxis:{handler:T.renderPolarAxis},PolarRadiusAxis:{handler:T.renderPolarAxis},Customized:{handler:T.renderCustomized}}),T.clipPathId="".concat((b=_.id)!==null&&b!==void 0?b:Xv("recharts"),"-clip"),T.throttleTriggeredAfterMouseMove=NX(T.triggeredAfterMouseMove,(S=_.throttleDelay)!==null&&S!==void 0?S:1e3/60),T.state={},T}return XNe(x,y),HNe(x,[{key:"componentDidMount",value:function(){var b,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,S=b.children,T=b.data,C=b.height,A=b.layout,P=Ni(S,Ls);if(P){var O=P.props.defaultIndex;if(!(typeof O!="number"||O<0||O>this.state.tooltipTicks.length-1)){var k=this.state.tooltipTicks[O]&&this.state.tooltipTicks[O].value,E=kO(this.state,T,O,k),N=this.state.tooltipTicks[O].coordinate,D=(this.state.offset.top+C)/2,z=A==="horizontal",V=z?{x:N,y:D}:{y:N,x:D},F=this.state.formattedGraphicalItems.find(function(B){var H=B.item;return H.type.name==="Scatter"});F&&(V=he(he({},V),F.props.points[O].tooltipPosition),E=F.props.points[O].tooltipPayload);var $={activeTooltipIndex:O,isTooltipActive:!0,activeLabel:k,activePayload:E,activeCoordinate:V};this.setState($),this.renderCursor(P),this.accessibilityManager.setIndex(O)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var T,C;this.accessibilityManager.setDetails({offset:{left:(T=this.props.margin.left)!==null&&T!==void 0?T:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(b){sL([Ni(b.children,Ls)],[Ni(this.props.children,Ls)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=Ni(this.props.children,Ls);if(b&&typeof b.props.shared=="boolean"){var S=b.props.shared?"axis":"item";return s.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var S=this.container,T=S.getBoundingClientRect(),C=sSe(T),A={chartX:Math.round(b.pageX-C.left),chartY:Math.round(b.pageY-C.top)},P=T.width/S.offsetWidth||1,O=this.inRange(A.chartX,A.chartY,P);if(!O)return null;var k=this.state,E=k.xAxisMap,N=k.yAxisMap,D=this.getTooltipEventType(),z=EF(this.state,this.props.data,this.props.layout,O);if(D!=="axis"&&E&&N){var V=qh(E).scale,F=qh(N).scale,$=V&&V.invert?V.invert(A.chartX):null,B=F&&F.invert?F.invert(A.chartY):null;return he(he({},A),{},{xValue:$,yValue:B},z)}return z?he(he({},A),z):null}},{key:"inRange",value:function(b,S){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,A=b/T,P=S/T;if(C==="horizontal"||C==="vertical"){var O=this.state.offset,k=A>=O.left&&A<=O.left+O.width&&P>=O.top&&P<=O.top+O.height;return k?{x:A,y:P}:null}var E=this.state,N=E.angleAxisMap,D=E.radiusAxisMap;if(N&&D){var z=qh(N);return m$({x:A,y:P},z)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,S=this.getTooltipEventType(),T=Ni(b,Ls),C={};T&&S==="axis"&&(T.props.trigger==="click"?C={onClick:this.handleClick}:C={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var A=B1(this.props,this.handleOuterEvent);return he(he({},A),C)}},{key:"addListener",value:function(){M2.on(P2,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){M2.removeListener(P2,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,S,T){for(var C=this.state.formattedGraphicalItems,A=0,P=C.length;As>=80?"#22c55e":s>=60?"#f59e0b":"#ef4444")(t),a=2*Math.PI*45,o=t/100*a;return p.jsx("div",{className:"flex flex-col items-center",children:p.jsxs("svg",{width:"140",height:"140",viewBox:"0 0 100 100",children:[p.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"#1e2a3a",strokeWidth:"8"}),p.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:i,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:a,strokeDashoffset:a-o,transform:"rotate(-90 50 50)",className:"transition-all duration-500"}),p.jsx("text",{x:"50",y:"46",textAnchor:"middle",className:"fill-slate-100 font-mono text-2xl font-bold",style:{fontSize:"24px"},children:t.toFixed(1)}),p.jsx("text",{x:"50",y:"62",textAnchor:"middle",className:"fill-slate-400 text-xs",style:{fontSize:"10px"},children:r})]})})}function h_({label:e,value:t}){const r=n=>n>=80?"bg-green-500":n>=60?"bg-amber-500":"bg-red-500";return p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"w-24 text-xs text-slate-400 truncate",children:e}),p.jsx("div",{className:"flex-1 h-2 bg-border rounded-full overflow-hidden",children:p.jsx("div",{className:`h-full ${r(t)} transition-all duration-300`,style:{width:`${t}%`}})}),p.jsx("div",{className:"w-12 text-right text-xs font-mono text-slate-300",children:t.toFixed(1)})]})}function vDe({alert:e}){const r=(i=>{switch(i.toLowerCase()){case"critical":case"emergency":case"immediate":return{bg:"bg-red-500/10",border:"border-red-500",icon:Mu,iconColor:"text-red-500"};case"warning":case"priority":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:il,iconColor:"text-amber-500"};case"routine":default:return{bg:"bg-blue-500/10",border:"border-blue-500",icon:mT,iconColor:"text-blue-500"}}})(e.severity),n=r.icon;return p.jsxs("div",{className:`p-3 rounded-lg ${r.bg} border-l-2 ${r.border} flex items-start gap-3`,children:[p.jsx(n,{size:16,className:r.iconColor}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm text-slate-200",children:e.message}),p.jsx("div",{className:"text-xs text-slate-500 mt-1",children:e.timestamp||"Just now"})]})]})}function pDe({source:e}){const t=()=>e.is_loaded?e.last_error?"bg-amber-500":"bg-green-500":"bg-red-500";return p.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-bg-hover",children:[p.jsx("div",{className:`w-2 h-2 rounded-full ${t()}`}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm text-slate-200 truncate",children:e.name}),p.jsxs("div",{className:"text-xs text-slate-500",children:[e.node_count," nodes · ",e.type]})]})]})}function d_({icon:e,label:t,value:r,subvalue:n}){return p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4",children:[p.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[p.jsx(e,{size:14}),p.jsx("span",{className:"text-xs",children:t})]}),p.jsx("div",{className:"font-mono text-xl text-slate-100",children:r}),n&&p.jsx("div",{className:"text-xs text-slate-500 mt-1",children:n})]})}function L2({label:e,value:t}){const r=()=>t===0?"bg-green-500/20 text-green-400 border-green-500/50":t<=2?"bg-amber-500/20 text-amber-400 border-amber-500/50":"bg-red-500/20 text-red-400 border-red-500/50";return p.jsxs("span",{className:`px-2 py-1 rounded text-xs font-mono font-medium border ${r()}`,children:[e,t]})}function jF({label:e,value:t,unit:r,getColor:n}){const i=t!==void 0?n(t):"text-slate-400";return p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:"text-xs text-slate-500 mb-1",children:e}),p.jsx("div",{className:`font-mono text-3xl font-bold ${i}`,children:(t==null?void 0:t.toFixed(0))??"—"}),r&&p.jsx("div",{className:"text-xs text-slate-500",children:r})]})}function gDe({history:e}){var a;const t=G.useMemo(()=>!e||e.length===0?[]:e.slice(-16).map((o,s)=>({idx:s,value:o.value,time:o.time})),[e]);if(t.length===0)return null;const r=Math.max(...t.map(o=>o.value),5),n=((a=t[t.length-1])==null?void 0:a.value)??0,i=()=>r>5?"kpGradientRed":r>3?"kpGradientAmber":"kpGradientGreen";return p.jsxs("div",{className:"h-20 w-full",children:[p.jsx(DX,{width:"100%",height:"100%",children:p.jsxs(hDe,{data:t,margin:{top:5,right:5,bottom:5,left:5},children:[p.jsxs("defs",{children:[p.jsxs("linearGradient",{id:"kpGradientGreen",x1:"0",y1:"0",x2:"0",y2:"1",children:[p.jsx("stop",{offset:"0%",stopColor:"#22c55e",stopOpacity:.4}),p.jsx("stop",{offset:"100%",stopColor:"#22c55e",stopOpacity:.05})]}),p.jsxs("linearGradient",{id:"kpGradientAmber",x1:"0",y1:"0",x2:"0",y2:"1",children:[p.jsx("stop",{offset:"0%",stopColor:"#f59e0b",stopOpacity:.4}),p.jsx("stop",{offset:"100%",stopColor:"#f59e0b",stopOpacity:.05})]}),p.jsxs("linearGradient",{id:"kpGradientRed",x1:"0",y1:"0",x2:"0",y2:"1",children:[p.jsx("stop",{offset:"0%",stopColor:"#ef4444",stopOpacity:.4}),p.jsx("stop",{offset:"100%",stopColor:"#ef4444",stopOpacity:.05})]})]}),p.jsx(ip,{domain:[0,Math.ceil(r)],hide:!0}),p.jsx(np,{dataKey:"idx",hide:!0}),p.jsx(Fy,{y:3,stroke:"#f59e0b",strokeDasharray:"3 3",strokeOpacity:.5}),p.jsx(Fy,{y:5,stroke:"#ef4444",strokeDasharray:"3 3",strokeOpacity:.5}),p.jsx(Gu,{type:"monotone",dataKey:"value",stroke:n>5?"#ef4444":n>3?"#f59e0b":"#22c55e",fill:`url(#${i()})`,strokeWidth:2})]})}),p.jsxs("div",{className:"flex justify-between text-xs text-slate-600 px-1",children:[p.jsx("span",{children:"48h ago"}),p.jsx("span",{children:"now"})]})]})}function mDe({profile:e}){const t=G.useMemo(()=>!e||e.length===0?[]:[...e].sort((r,n)=>r.height_m-n.height_m).map(r=>({height:r.height_m,M:r.M})),[e]);return t.length===0?null:p.jsxs("div",{className:"h-24 w-full",children:[p.jsx(DX,{width:"100%",height:"100%",children:p.jsxs(fDe,{data:t,margin:{top:5,right:10,bottom:5,left:5},children:[p.jsx(np,{dataKey:"M",type:"number",domain:["dataMin - 20","dataMax + 20"],tick:{fontSize:10,fill:"#64748b"},tickLine:!1,axisLine:{stroke:"#334155"}}),p.jsx(ip,{dataKey:"height",type:"number",domain:[0,"dataMax"],tick:{fontSize:10,fill:"#64748b"},tickLine:!1,axisLine:{stroke:"#334155"},tickFormatter:r=>`${(r/1e3).toFixed(1)}k`}),p.jsx(z0,{type:"monotone",dataKey:"M",stroke:"#3b82f6",strokeWidth:2,dot:{r:3,fill:"#3b82f6"}})]})}),p.jsx("div",{className:"text-center text-xs text-slate-600",children:"M-units vs Height (km)"})]})}function yDe({swpc:e,ducting:t}){const r=a=>a>=120?"text-green-400":a>=80?"text-amber-400":"text-red-400",n=a=>a<=3?"text-green-400":a<=5?"text-amber-400":"text-red-400",i=a=>{if(!a)return null;const o={normal:"bg-green-500/20 text-green-400 border-green-500/50",super_refraction:"bg-amber-500/20 text-amber-400 border-amber-500/50",surface_duct:"bg-blue-500/20 text-blue-400 border-blue-500/50",elevated_duct:"bg-blue-500/20 text-blue-400 border-blue-500/50"},s={normal:"Normal",super_refraction:"Super Refraction",surface_duct:"Surface Duct",elevated_duct:"Elevated Duct"};return p.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium border ${o[a]||o.normal}`,children:s[a]||a})};return p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[p.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[p.jsx(ly,{size:14}),p.jsx("span",{title:"R (Radio Blackouts), S (Solar Radiation Storms), G (Geomagnetic Storms) — NOAA SWPC scales. Kp 3 = quiet baseline, Kp >= 5 = aurora visible at mid-latitudes and HF degraded. See Reference → Solar & Geomagnetic.",children:"RF Propagation"})]}),p.jsxs("div",{className:"flex justify-around mb-4",children:[p.jsx(jF,{label:"SFI",value:e==null?void 0:e.sfi,getColor:r}),p.jsx("div",{className:"w-px bg-border"}),p.jsx(jF,{label:"Kp",value:e==null?void 0:e.kp_current,getColor:n})]}),p.jsxs("div",{className:"flex justify-center gap-2 mb-4",children:[p.jsx(L2,{label:"R",value:(e==null?void 0:e.r_scale)??0}),p.jsx(L2,{label:"S",value:(e==null?void 0:e.s_scale)??0}),p.jsx(L2,{label:"G",value:(e==null?void 0:e.g_scale)??0})]}),(e==null?void 0:e.kp_history)&&e.kp_history.length>0&&p.jsxs("div",{className:"mb-4",children:[p.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Kp Trend (48h)"}),p.jsx(gDe,{history:e.kp_history})]}),p.jsx("div",{className:"border-t border-border my-3"}),p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx(Pu,{size:14,className:"text-slate-400"}),p.jsx("span",{className:"text-xs text-slate-500",children:"Tropospheric"}),i(t==null?void 0:t.condition)]}),(t==null?void 0:t.min_gradient)!==void 0&&p.jsxs("div",{className:"text-xs text-slate-400 font-mono mb-2",children:["dM/dz: ",t.min_gradient.toFixed(1)," M-units/km"]}),(t==null?void 0:t.profile)&&t.profile.length>0&&p.jsx(mDe,{profile:t.profile}),(e==null?void 0:e.active_warnings)&&e.active_warnings.length>0&&p.jsxs("div",{className:"mt-auto pt-3 border-t border-border",children:[p.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"SWPC Alerts"}),p.jsx("div",{className:"flex flex-wrap gap-1",children:e.active_warnings.slice(0,3).map((a,o)=>p.jsx("span",{className:"px-2 py-0.5 rounded text-xs bg-amber-500/20 text-amber-400 border border-amber-500/30 truncate max-w-full",children:a.replace("Space Weather Message Code: ","")},o))})]})]})}const xDe={nws:{icon:Pu,color:"text-blue-400",label:"NWS"},swpc:{icon:fY,color:"text-yellow-400",label:"SWPC"},ducting:{icon:ho,color:"text-cyan-400",label:"Tropo"},nifc:{icon:gT,color:"text-orange-400",label:"NIFC"},firms:{icon:_T,color:"text-red-400",label:"FIRMS"},avalanche:{icon:yT,color:"text-slate-300",label:"Avy"},usgs:{icon:pT,color:"text-blue-300",label:"USGS"},traffic:{icon:vT,color:"text-purple-400",label:"Traffic"},roads:{icon:nY,color:"text-amber-400",label:"511"}},RF={routine:"bg-blue-500/20 text-blue-400 border-blue-500/30",priority:"bg-amber-500/20 text-amber-400 border-amber-500/30",immediate:"bg-red-600/20 text-red-300 border-red-600/30",info:"bg-blue-500/20 text-blue-400 border-blue-500/30",advisory:"bg-blue-500/20 text-blue-400 border-blue-500/30",moderate:"bg-amber-500/20 text-amber-400 border-amber-500/30",watch:"bg-amber-500/20 text-amber-400 border-amber-500/30",warning:"bg-amber-500/20 text-amber-400 border-amber-500/30",severe:"bg-red-500/20 text-red-400 border-red-500/30",extreme:"bg-red-600/20 text-red-300 border-red-600/30",critical:"bg-red-600/20 text-red-300 border-red-600/30",emergency:"bg-red-700/20 text-red-200 border-red-700/30"};function _De({event:e,isLocal:t}){var f;const r=xDe[e.source]||{icon:mT,color:"text-slate-400",label:e.source},n=r.icon,i=RF[(f=e.severity)==null?void 0:f.toLowerCase()]||RF.info,a=h=>{const d=new Date(h*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 h=s.replace(/ County/g,"").split(";")[0];u=`${o} — ${h}`}else o&&(u=o);const c=l?l.split(". ")[0]:null;return p.jsxs("div",{className:`flex items-start gap-2 py-2 border-b border-border/50 last:border-0 ${t?"border-l-2 border-l-blue-500 pl-2 -ml-2":""}`,children:[p.jsx(n,{size:14,className:`mt-0.5 flex-shrink-0 ${r.color}`}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[p.jsx("span",{className:`px-1.5 py-0.5 rounded text-xs border ${i}`,children:e.severity||"info"}),t&&p.jsx("span",{className:"px-1.5 py-0.5 rounded text-xs bg-blue-500/20 text-blue-400 border border-blue-500/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"}),p.jsx("span",{className:"text-xs text-slate-500",children:r.label}),p.jsx("span",{className:"text-xs text-slate-600 ml-auto",children:a(e.fetched_at)})]}),p.jsx("div",{className:`text-sm truncate ${t?"text-slate-100":"text-slate-300"}`,children:u}),c&&p.jsx("div",{className:"text-xs text-slate-500 truncate mt-0.5",children:c})]})]})}function bDe({events:e,envStatus:t}){const r={immediate:0,priority:1,routine:2},n=G.useMemo(()=>{const a=new Set;return e.filter(s=>s.event_id?a.has(s.event_id)?!1:(a.add(s.event_id),!0):!0).sort((s,l)=>{var d,v;const u=s.is_local?1:0,c=l.is_local?1:0;if(u!==c)return c-u;const f=r[((d=s.severity)==null?void 0:d.toLowerCase())||"routine"]??2,h=r[((v=l.severity)==null?void 0:v.toLowerCase())||"routine"]??2;return f!==h?f-h:(l.fetched_at||0)-(s.fetched_at||0)})},[e]),i=G.useMemo(()=>{if(!(t!=null&&t.feeds))return null;const a=t.feeds.length,o=t.feeds.filter(c=>c.is_loaded&&!c.last_error).length,s=t.feeds.filter(c=>c.last_error).map(c=>c.source),l=Math.max(...t.feeds.map(c=>c.last_fetch||0)),u=l?Math.floor(Date.now()/1e3-l):null;return{total:a,active:o,errors:s,secAgo:u}},[t]);return p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[p.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-3 flex items-center gap-2",children:[p.jsx($v,{size:14}),"Live Event Feed"]}),n.length>0?p.jsx("div",{className:"flex-1 overflow-y-auto max-h-80 pr-1 -mr-1",children:n.map((a,o)=>p.jsx(_De,{event:a,isLocal:a.is_local},a.event_id||o))}):p.jsx("div",{className:"flex-1 flex items-center justify-center",children:p.jsxs("div",{className:"text-center py-8",children:[p.jsx(VN,{size:24,className:"text-green-500 mx-auto mb-2"}),p.jsx("div",{className:"text-slate-400",children:"No active events"}),p.jsx("div",{className:"text-xs text-slate-500",children:"All clear"})]})}),i&&p.jsxs("div",{className:`text-xs mt-3 pt-3 border-t border-border ${i.errors.length>0?"text-amber-400":"text-slate-500"}`,children:[i.active," of ",i.total," feeds active",i.secAgo!==null&&` · Last update ${i.secAgo}s ago`,i.errors.length>0&&p.jsxs("span",{className:"text-amber-400",children:[" · ",i.errors.join(", "),": error"]})]})]})}function wDe(){var S,T,C,A,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,f]=G.useState(null),[h,d]=G.useState(null),[v,m]=G.useState(!0),[y,x]=G.useState(null),{lastHealth:_,lastMessage:b}=YN();return G.useEffect(()=>{Promise.all([Mce(),Lce(),vY(),pY(),gY().catch(()=>[]),Ice().catch(()=>null),Ece().catch(()=>null)]).then(([O,k,E,N,D,z,V])=>{t(O),n(k),a(E),s(N),u(D),f(z),d(V),m(!1),document.title="Dashboard — MeshAI"}).catch(O=>{x(O.message),m(!1),document.title="Dashboard — MeshAI"})},[]),G.useEffect(()=>{_&&t(_)},[_]),G.useEffect(()=>{(b==null?void 0:b.type)==="env_update"&&b.event&&u(O=>{const k=b.event,E=O.filter(N=>N.event_id!==k.event_id);return[k,...E].slice(0,100)})},[b]),v?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-slate-400",children:"Loading..."})}):y?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsxs("div",{className:"text-red-400",children:["Error: ",y]})}):p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[p.jsx("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:"Mesh Health"}),e&&p.jsxs(p.Fragment,{children:[p.jsx(dDe,{health:e}),p.jsxs("div",{className:"mt-6 space-y-3",children:[p.jsx(h_,{label:"Infrastructure",value:((S=e.pillars)==null?void 0:S.infrastructure)??0}),p.jsx(h_,{label:"Utilization",value:((T=e.pillars)==null?void 0:T.utilization)??0}),p.jsx(h_,{label:"Behavior",value:((C=e.pillars)==null?void 0:C.behavior)??0}),p.jsx(h_,{label:"Power",value:((A=e.pillars)==null?void 0:A.power)??0})]})]})]}),p.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[p.jsx("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:"Active Alerts"}),i.length>0?p.jsx("div",{className:"space-y-3 max-h-48 overflow-y-auto",children:i.map((O,k)=>p.jsx(vDe,{alert:O},k))}):p.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-4",children:[p.jsx(VN,{size:16,className:"text-green-500"}),p.jsx("span",{children:"No active alerts"})]})]}),p.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[p.jsx(d_,{icon:ho,label:"Nodes Online",value:(e==null?void 0:e.total_nodes)||0,subvalue:`${(e==null?void 0:e.unlocated_count)||0} unlocated`}),p.jsx(d_,{icon:iY,label:"Infrastructure",value:`${(e==null?void 0:e.infra_online)||0}/${(e==null?void 0:e.infra_total)||0}`,subvalue:(e==null?void 0:e.infra_online)===(e==null?void 0:e.infra_total)?"All online":"Some offline"}),p.jsx(d_,{icon:$v,label:"Utilization",value:`${((P=e==null?void 0:e.util_percent)==null?void 0:P.toFixed(1))||0}%`,subvalue:`${(e==null?void 0:e.flagged_nodes)||0} flagged`}),p.jsx(d_,{icon:Fv,label:"Regions",value:(e==null?void 0:e.total_regions)||0,subvalue:`${(e==null?void 0:e.battery_warnings)||0} battery warnings`})]})]})]}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[p.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:["Mesh Sources (",r.length,")"]}),r.length>0?p.jsx("div",{className:"space-y-2",children:r.map((O,k)=>p.jsx(pDe,{source:O},k))}):p.jsx("div",{className:"text-slate-500 py-4",children:"No sources configured"})]}),p.jsx(yDe,{swpc:c,ducting:h}),p.jsx(bDe,{events:l,envStatus:o})]})]})}/*! ***************************************************************************** +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 LO=function(e,t){return LO=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])},LO(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");LO(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Sm=function(){return Sm=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"?ot.worker=!0:!ot.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(ot.node=!0,ot.svgSupported=!0):ADe(navigator.userAgent,ot);function ADe(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 qD=12,KK="sans-serif",ll=qD+"px "+KK,MDe=20,PDe=100,kDe="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function LDe(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(){R(r,function(c){c.parentNode&&c.parentNode.removeChild(c)})},r}function eje(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(),f=2*u,h=c.left,d=c.top;o.push(h,d),l=l&&a&&h===a[f]&&d===a[f+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&i?i:(t.srcCoords=o,t[n]=r?FF(s,o):FF(o,s))}function sJ(e){return e.nodeName.toUpperCase()==="CANVAS"}var tje=/([&<>"'])/g,rje={"&":"&","<":"<",">":">",'"':""","'":"'"};function Yn(e){return e==null?"":(e+"").replace(tje,function(t,r){return rje[r]})}var nje=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,I2=[],ije=ot.browser.firefox&&+ot.browser.version.split(".")[0]<39;function DO(e,t,r,n){return r=r||{},n?VF(e,t,r):ije&&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):VF(e,t,r),r}function VF(e,t,r){if(ot.domSupported&&e.getBoundingClientRect){var n=t.clientX,i=t.clientY;if(sJ(e)){var a=e.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(NO(I2,e,n,i)){r.zrX=I2[0],r.zrY=I2[1];return}}r.zrX=r.zrY=0}function nj(e){return e||window.event}function ca(e,t,r){if(t=nj(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&&DO(e,o,t,r)}else{DO(e,t,t,r);var a=aje(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&nje.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function aje(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 jO(e,t,r,n){e.addEventListener(t,r,n)}function oje(e,t,r,n){e.removeEventListener(t,r,n)}var ul=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function GF(e){return e.which===2||e.which===3}var sje=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=WF(n)/WF(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=lje(n);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}};function an(){return[1,0,0,1,0,0]}function G0(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function W0(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 so(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 po(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 _l(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),f=Math.cos(r);return e[0]=i*f+s*c,e[1]=-i*c+s*f,e[2]=a*f+l*c,e[3]=-a*c+f*l,e[4]=f*(o-n[0])+c*(u-n[1])+n[0],e[5]=f*(u-n[1])-c*(o-n[0])+n[1],e}function gC(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 Oa(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 lJ(e){var t=an();return W0(t,e),t}const uje=Object.freeze(Object.defineProperty({__proto__:null,clone:lJ,copy:W0,create:an,identity:G0,invert:Oa,mul:so,rotate:_l,scale:gC,translate:po},Symbol.toStringTag,{value:"Module"}));var De=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}(),rf=Math.min,gd=Math.max,RO=Math.abs,HF=["x","y"],cje=["width","height"],oc=new De,sc=new De,lc=new De,uc=new De,ji=uJ(),qg=ji.minTv,BO=ji.maxTv,Mm=[0,0],je=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=rf(t.x,this.x),n=rf(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=gd(t.x+t.width,this.x+this.width)-r:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=gd(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=an();return po(a,a,[-r.x,-r.y]),gC(a,a,[n,i]),po(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&&De.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(fje,t.x,t.y,t.width,t.height)),r instanceof e||(r=e.set(hje,r.x,r.y,r.width,r.height));var s=!!n;ji.reset(i,s);var l=ji.touchThreshold,u=t.x+l,c=t.x+t.width-l,f=t.y+l,h=t.y+t.height-l,d=r.x+l,v=r.x+r.width-l,m=r.y+l,y=r.y+r.height-l;if(u>c||f>h||d>v||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}oc.x=lc.x=r.x,oc.y=uc.y=r.y,sc.x=uc.x=r.x+r.width,sc.y=lc.y=r.y+r.height,oc.transform(n),uc.transform(n),sc.transform(n),lc.transform(n),t.x=rf(oc.x,sc.x,lc.x,uc.x),t.y=rf(oc.y,sc.y,lc.y,uc.y);var l=gd(oc.x,sc.x,lc.x,uc.x),u=gd(oc.y,sc.y,lc.y,uc.y);t.width=l-t.x,t.height=u-t.y},e}(),fje=new je(0,0,0,0),hje=new je(0,0,0,0);function UF(e,t,r,n,i,a,o,s){var l=RO(t-r),u=RO(n-e),c=rf(l,u),f=HF[i],h=HF[1-i],d=cje[i];t=u||!ji.bidirectional)&&(qg[f]=-u,qg[h]=0,ji.useDir&&ji.calcDirMTV())))}function uJ(){var e=0,t=new De,r=new De,n={minTv:new De,maxTv:new De,useDir:!1,dirMinTv:new De,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,o){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=gd(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;f--){var h=a[f];h!==i&&!h.ignore&&!h.ignoreCoarsePointer&&(!h.parent||!h.parent.ignoreCoarsePointer)&&(N2.copy(h.getBoundingRect()),h.transform&&N2.applyTransform(h.transform),N2.intersect(c)&&s.push(h))}if(s.length)for(var d=4,v=Math.PI/12,m=Math.PI*2,y=0;y4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function mje(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?cJ:!0}return!1}function ZF(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=mje(o,r,n))&&(!t.topTarget&&(t.topTarget=o),s!==cJ)){t.target=o;break}}}function hJ(e,t,r){var n=e.painter;return t<0||t>n.getWidth()||r<0||r>n.getHeight()}var dJ=32,dg=7;function yje(e){for(var t=0;e>=dJ;)t|=e&1,e>>=1;return e+t}function YF(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 xje(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 D2(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 j2(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 _je(e,t){var r=dg,n,i,a=0,o=[];n=[],i=[];function s(d,v){n[a]=d,i[a]=v,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]=dg||A>=dg);if(P)break;T<0&&(T=0),T+=2}if(r=T,r<1&&(r=1),v===1){for(x=0;x=0;x--)e[C+x]=e[T+x];e[S]=o[b];return}for(var A=r;;){var P=0,O=0,k=!1;do if(t(o[b],e[_])<0){if(e[S--]=e[_--],P++,O=0,--v===0){k=!0;break}}else if(e[S--]=o[b--],O++,P=0,--y===1){k=!0;break}while((P|O)=0;x--)e[C+x]=e[T+x];if(v===0){k=!0;break}}if(e[S--]=o[b--],--y===1){k=!0;break}if(O=y-D2(e[_],o,0,y,y-1,t),O!==0){for(S-=O,b-=O,y-=O,C=S+1,T=b+1,x=0;x=dg||O>=dg);if(k)break;A<0&&(A=0),A+=2}if(r=A,r<1&&(r=1),y===1){for(S-=v,_-=v,C=S+1,T=_+1,x=v-1;x>=0;x--)e[C+x]=e[T+x];e[S]=o[b]}else{if(y===0)throw new Error;for(T=S-(y-1),x=0;xs&&(l=s),XF(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 Bi=1,Kg=2,Kh=4,qF=!1;function R2(){qF||(qF=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function KF(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var bje=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=KF}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}(),Ww;Ww=ot.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var Pm={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-Pm.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?Pm.bounceIn(e*2)*.5:Pm.bounceOut(e*2-1)*.5+.5}},p_=Math.pow,gu=Math.sqrt,Hw=1e-8,vJ=1e-4,JF=gu(3),g_=1/3,Ro=Hu(),ga=Hu(),Dd=Hu();function Ql(e){return e>-Hw&&eHw||e<-Hw}function en(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 QF(e,t,r,n,i){var a=1-i;return 3*(((t-e)*a+2*(r-t)*i)*a+(n-r)*i*i)}function Uw(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,f=s*l-9*o*u,h=l*l-3*s*u,d=0;if(Ql(c)&&Ql(f))if(Ql(s))a[0]=0;else{var v=-l/s;v>=0&&v<=1&&(a[d++]=v)}else{var m=f*f-4*c*h;if(Ql(m)){var y=f/c,v=-s/o+y,x=-y/2;v>=0&&v<=1&&(a[d++]=v),x>=0&&x<=1&&(a[d++]=x)}else if(m>0){var _=gu(m),b=c*s+1.5*o*(-f+_),S=c*s+1.5*o*(-f-_);b<0?b=-p_(-b,g_):b=p_(b,g_),S<0?S=-p_(-S,g_):S=p_(S,g_);var v=(-s-(b+S))/(3*o);v>=0&&v<=1&&(a[d++]=v)}else{var T=(2*c*s-3*o*f)/(2*gu(c*c*c)),C=Math.acos(T)/3,A=gu(c),P=Math.cos(C),v=(-s-2*A*P)/(3*o),x=(-s+A*(P+JF*Math.sin(C)))/(3*o),O=(-s+A*(P-JF*Math.sin(C)))/(3*o);v>=0&&v<=1&&(a[d++]=v),x>=0&&x<=1&&(a[d++]=x),O>=0&&O<=1&&(a[d++]=O)}}return d}function gJ(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(Ql(o)){if(pJ(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*o*s;if(Ql(c))i[0]=-a/(2*o);else if(c>0){var f=gu(c),u=(-a+f)/(2*o),h=(-a-f)/(2*o);u>=0&&u<=1&&(i[l++]=u),h>=0&&h<=1&&(i[l++]=h)}}return l}function ku(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,f=(c-u)*i+u;a[0]=e,a[1]=o,a[2]=u,a[3]=f,a[4]=f,a[5]=c,a[6]=l,a[7]=n}function mJ(e,t,r,n,i,a,o,s,l,u,c){var f,h=.005,d=1/0,v,m,y,x;Ro[0]=l,Ro[1]=u;for(var _=0;_<1;_+=.05)ga[0]=en(e,r,i,o,_),ga[1]=en(t,n,a,s,_),y=pu(Ro,ga),y=0&&y=0&&u<=1&&(i[l++]=u)}}else{var c=o*o-4*a*s;if(Ql(c)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(c>0){var f=gu(c),u=(-o+f)/(2*a),h=(-o-f)/(2*a);u>=0&&u<=1&&(i[l++]=u),h>=0&&h<=1&&(i[l++]=h)}}return l}function yJ(e,t,r){var n=e+r-2*t;return n===0?.5:(e-t)/n}function Zy(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 xJ(e,t,r,n,i,a,o,s,l){var u,c=.005,f=1/0;Ro[0]=o,Ro[1]=s;for(var h=0;h<1;h+=.05){ga[0]=gn(e,r,i,h),ga[1]=gn(t,n,a,h);var d=pu(Ro,ga);d=0&&d=1?1:Uw(0,n,a,1,l,s)&&en(0,i,o,1,s[0])}}}var Aje=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||yr,this.ondestroy=t.ondestroy||yr,this.onrestart=t.onrestart||yr,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=Pe(t)?t:Pm[t]||ij(t)},e}(),_J=function(){function e(t){this.value=t}return e}(),Mje=function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new _J(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}(),xv=function(){function e(t){this._list=new Mje,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 _J(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}(),eV={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 lo(e){return e=Math.round(e),e<0?0:e>255?255:e}function Pje(e){return e=Math.round(e),e<0?0:e>360?360:e}function Yy(e){return e<0?0:e>1?1:e}function Gb(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?lo(parseFloat(t)/100*255):lo(parseInt(t,10))}function Ys(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?Yy(parseFloat(t)/100):Yy(parseFloat(t))}function B2(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 eu(e,t,r){return e+(t-e)*r}function ua(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}function $O(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var bJ=new xv(20),m_=null;function Th(e,t){m_&&$O(m_,t),m_=bJ.put(e,m_||t.slice())}function Xn(e,t){if(e){t=t||[];var r=bJ.get(e);if(r)return $O(t,r);e=e+"";var n=e.replace(/ /g,"").toLowerCase();if(n in eV)return $O(t,eV[n]),Th(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)){ua(t,0,0,0,1);return}return ua(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),Th(e,t),t}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){ua(t,0,0,0,1);return}return ua(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),Th(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?ua(t,+u[0],+u[1],+u[2],1):ua(t,0,0,0,1);c=Ys(u.pop());case"rgb":if(u.length>=3)return ua(t,Gb(u[0]),Gb(u[1]),Gb(u[2]),u.length===3?c:Ys(u[3])),Th(e,t),t;ua(t,0,0,0,1);return;case"hsla":if(u.length!==4){ua(t,0,0,0,1);return}return u[3]=Ys(u[3]),FO(u,t),Th(e,t),t;case"hsl":if(u.length!==3){ua(t,0,0,0,1);return}return FO(u,t),Th(e,t),t;default:return}}ua(t,0,0,0,1)}}function FO(e,t){var r=(parseFloat(e[0])%360+360)%360/360,n=Ys(e[1]),i=Ys(e[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return t=t||[],ua(t,lo(B2(o,a,r+1/3)*255),lo(B2(o,a,r)*255),lo(B2(o,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function kje(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,f=((a-r)/6+o/2)/o,h=((a-n)/6+o/2)/o;t===a?l=h-f:r===a?l=1/3+c-h:n===a&&(l=2/3+f-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 Zw(e,t){var r=Xn(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 Ca(r,r.length===4?"rgba":"rgb")}}function Lje(e){var t=Xn(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function km(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]=lo(eu(o[0],s[0],l)),r[1]=lo(eu(o[1],s[1],l)),r[2]=lo(eu(o[2],s[2],l)),r[3]=Yy(eu(o[3],s[3],l)),r}}var Oje=km;function aj(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=Xn(t[i]),s=Xn(t[a]),l=n-i,u=Ca([lo(eu(o[0],s[0],l)),lo(eu(o[1],s[1],l)),lo(eu(o[2],s[2],l)),Yy(eu(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}var Ije=aj;function Xs(e,t,r,n){var i=Xn(e);if(e)return i=kje(i),t!=null&&(i[0]=Pje(Pe(t)?t(i[0]):t)),r!=null&&(i[1]=Ys(Pe(r)?r(i[1]):r)),n!=null&&(i[2]=Ys(Pe(n)?n(i[2]):n)),Ca(FO(i),"rgba")}function Xy(e,t){var r=Xn(e);if(r&&t!=null)return r[3]=Yy(t),Ca(r,"rgba")}function Ca(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 qy(e,t){var r=Xn(e);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*t:0}function Eje(){return Ca([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var tV=new xv(100);function Yw(e){if(me(e)){var t=tV.get(e);return t||(t=Zw(e,-.1),tV.put(e,t)),t}else if($0(e)){var r=ie({},e);return r.colorStops=le(e.colorStops,function(n){return{offset:n.offset,color:Zw(n.color,-.1)}}),r}return e}const Nje=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:km,fastMapToColor:Oje,lerp:aj,lift:Zw,liftColor:Yw,lum:qy,mapToColor:Ije,modifyAlpha:Xy,modifyHSL:Xs,parse:Xn,parseCssFloat:Ys,parseCssInt:Gb,random:Eje,stringify:Ca,toHex:Lje},Symbol.toStringTag,{value:"Module"}));var Xw=Math.round;function Ky(e){var t;if(!e||e==="transparent")e="none";else if(typeof e=="string"&&e.indexOf("rgba")>-1){var r=Xn(e);r&&(e="rgb("+r[0]+","+r[1]+","+r[2]+")",t=r[3])}return{color:e,opacity:t??1}}var rV=1e-4;function tu(e){return e-rV}function y_(e){return Xw(e*1e3)/1e3}function VO(e){return Xw(e*1e4)/1e4}function Dje(e){return"matrix("+y_(e[0])+","+y_(e[1])+","+y_(e[2])+","+y_(e[3])+","+VO(e[4])+","+VO(e[5])+")"}var jje={left:"start",right:"end",center:"middle",middle:"middle"};function Rje(e,t,r){return r==="top"?e+=t/2:r==="bottom"&&(e-=t/2),e}function Bje(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function zje(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 wJ(e){return e&&!!e.image}function $je(e){return e&&!!e.svgElement}function oj(e){return wJ(e)||$je(e)}function SJ(e){return e.type==="linear"}function TJ(e){return e.type==="radial"}function CJ(e){return e&&(e.type==="linear"||e.type==="radial")}function mC(e){return"url(#"+e+")"}function AJ(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 MJ(e){var t=e.x||0,r=e.y||0,n=(e.rotation||0)*Tm,i=Ae(e.scaleX,1),a=Ae(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("+Xw(o*Tm)+"deg, "+Xw(s*Tm)+"deg)"),l.join(" ")}var Fje=function(){return ot.hasGlobalWindow&&Pe(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}}(),GO=Array.prototype.slice;function Os(e,t,r){return(t-e)*r+e}function z2(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=iV,l=r;if(En(r)){var u=Hje(r);s=u,(u===1&&!ut(r[0])||u===2&&!ut(r[0][0]))&&(o=!0)}else if(ut(r)&&!On(r))s=__;else if(me(r))if(!isNaN(+r))s=__;else{var c=Xn(r);c&&(l=c,s=Jg)}else if($0(r)){var f=ie({},l);f.colorStops=le(r.colorStops,function(d){return{offset:d.offset,color:Xn(d.color)}}),SJ(r)?s=WO:TJ(r)&&(s=HO),l=f}a===0?this.valType=s:(s!==this.valType||s===iV)&&(o=!0),this.discrete=this.discrete||o;var h={time:t,value:l,rawValue:r,percent:0};return n&&(h.easing=n,h.easingFunc=Pe(n)?n:Pm[n]||ij(n)),i.push(h),h},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=b_(i),u=aV(i),c=0;c=0&&!(o[c].percent<=r);c--);c=h(c,s-2)}else{for(c=f;cr);c++);c=h(c-1,s-2)}v=o[c+1],d=o[c]}if(d&&v){this._lastFr=c,this._lastFrP=r;var y=v.percent-d.percent,x=y===0?1:h((r-d.percent)/y,1);v.easingFunc&&(x=v.easingFunc(x));var _=n?this._additiveValue:u?vg:t[l];if((b_(a)||u)&&!_&&(_=this._additiveValue=[]),this.discrete)t[l]=x<1?d.rawValue:v.rawValue;else if(b_(a))a===Hb?z2(_,d[i],v[i],x):Vje(_,d[i],v[i],x);else if(aV(a)){var b=d[i],S=v[i],T=a===WO;t[l]={type:T?"linear":"radial",x:Os(b.x,S.x,x),y:Os(b.y,S.y,x),colorStops:le(b.colorStops,function(A,P){var O=S.colorStops[P];return{offset:Os(A.offset,O.offset,x),color:Wb(z2([],A.color,O.color,x))}}),global:S.global},T?(t[l].x2=Os(b.x2,S.x2,x),t[l].y2=Os(b.y2,S.y2,x)):t[l].r=Os(b.r,S.r,x)}else if(u)z2(_,d[i],v[i],x),n||(t[l]=Wb(_));else{var C=Os(d[i],v[i],x);n?this._additiveValue=C:t[l]=C}n&&this._addToTarget(t)}}},e.prototype._addToTarget=function(t){var r=this.valType,n=this.propName,i=this._additiveValue;r===__?t[n]=t[n]+i:r===Jg?(Xn(t[n],vg),x_(vg,vg,i,1),t[n]=Wb(vg)):r===Hb?x_(t[n],t[n],i,1):r===PJ&&nV(t[n],t[n],i,1)},e}(),sj=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){hC("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,st(r),n)},e.prototype.whenWithKeys=function(t,r,n,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,Lm(u),i),this._trackKeys.push(s)}l.addKeyframe(t,Lm(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 md(){return new Date().getTime()}var Zje=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=md()-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&&(Ww(n),!r._paused&&r.update())}Ww(n)},t.prototype.start=function(){this._running||(this._time=md(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=md(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=md()-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 sj(r,n.loop);return this.addAnimator(i),i},t}(ja),Yje=300,$2=ot.domSupported,F2=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=le(e,function(i){var a=i.replace("mouse","pointer");return r.hasOwnProperty(a)?a:i});return{mouse:e,touch:t,pointer:n}}(),oV={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},sV=!1;function UO(e){var t=e.pointerType;return t==="pen"||t==="touch"}function Xje(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 V2(e){e&&(e.zrByTouch=!0)}function qje(e,t){return ca(e.dom,new Kje(e,t),!0)}function kJ(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 Kje=function(){function e(t,r){this.stopPropagation=yr,this.stopImmediatePropagation=yr,this.preventDefault=yr,this.type=r.type,this.target=this.currentTarget=t.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return e}(),Za={mousedown:function(e){e=ca(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=ca(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=ca(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){e=ca(this.dom,e);var t=e.toElement||e.relatedTarget;kJ(this,t)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){sV=!0,e=ca(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){sV||(e=ca(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){e=ca(this.dom,e),V2(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),Za.mousemove.call(this,e),Za.mousedown.call(this,e)},touchmove:function(e){e=ca(this.dom,e),V2(e),this.handler.processGesture(e,"change"),Za.mousemove.call(this,e)},touchend:function(e){e=ca(this.dom,e),V2(e),this.handler.processGesture(e,"end"),Za.mouseup.call(this,e),+new Date-+this.__lastTouchMomentcV||e<-cV}var fc=[],Ch=[],W2=an(),H2=Math.abs,Vs=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 cc(this.rotation)||cc(this.x)||cc(this.y)||cc(this.scaleX-1)||cc(this.scaleY-1)||cc(this.skewX)||cc(this.skewY)},e.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||t)){n&&(uV(n),this.invTransform=null);return}n=n||an(),r?this.getLocalTransform(n):uV(n),t&&(r?so(n,t,n):W0(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)},e.prototype._resolveGlobalScaleRatio=function(t){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(fc);var n=fc[0]<0?-1:1,i=fc[1]<0?-1:1,a=((fc[0]-n)*r+n)/fc[0]||0,o=((fc[1]-i)*r+i)/fc[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||an(),Oa(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||an(),so(Ch,t.invTransform,r),r=Ch);var n=this.originX,i=this.originY;(n||i)&&(W2[4]=n,W2[5]=i,so(Ch,r,W2),Ch[4]-=n,Ch[5]-=i,r=Ch),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&&xr(n,n,i),n},e.prototype.transformCoordToGlobal=function(t,r){var n=[t,r],i=this.transform;return i&&xr(n,n,i),n},e.prototype.getLineScale=function(){var t=this.transform;return t&&H2(t[0]-1)>1e-10&&H2(t[3]-1)>1e-10?Math.sqrt(H2(t[0]*t[3]-t[2]*t[1])):1},e.prototype.copyTransform=function(t){Kw(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,f=t.y,h=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||s||l){var v=n+s,m=i+l;r[4]=-v*a-h*m*o,r[5]=-m*o-d*v*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=d*a,r[2]=h*o,u&&_l(r,r,u),r[4]+=n+c,r[5]+=i+f,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}(),is=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Kw(e,t){for(var r=0;r=fV)){e=e||ll;for(var t=[],r=+new Date,n=0;n<=127;n++)t[n]=Ci.measureText(String.fromCharCode(n),e).width;var i=+new Date-r;return i>16?U2=fV:i>2&&U2++,t}}var U2=0,fV=5;function OJ(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=rRe(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap!=null?e.asciiWidthMap[t]:e.asciiCharWidth:e.stWideCharWidth}function Qo(e,t){var r=e.strWidthCache,n=r.get(t);return n==null&&(n=Ci.measureText(t,e.font).width,r.put(t,n)),n}function hV(e,t,r,n){var i=Qo(Jo(t),e),a=H0(t),o=_v(0,i,r),s=pf(0,a,n),l=new je(o,s,i,a);return l}function yC(e,t,r,n){var i=((e||"")+"").split(` +`),a=i.length;if(a===1)return hV(i[0],t,r,n);for(var o=new je(0,0,0,0),s=0;s=0?parseFloat(e)/100*t:parseFloat(e):e}function Jw(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",f="top";if(n instanceof Array)l+=go(n[0],r.width),u+=go(n[1],r.height),c=null,f=null;else switch(n){case"left":l-=i,u+=s,c="right",f="middle";break;case"right":l+=i+o,u+=s,f="middle";break;case"top":l+=o/2,u-=i,c="center",f="bottom";break;case"bottom":l+=o/2,u+=a+i,c="center";break;case"inside":l+=o/2,u+=s,c="center",f="middle";break;case"insideLeft":l+=i,u+=s,f="middle";break;case"insideRight":l+=o-i,u+=s,c="right",f="middle";break;case"insideTop":l+=o/2,u+=i,c="center";break;case"insideBottom":l+=o/2,u+=a-i,c="center",f="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,f="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,c="right",f="bottom";break}return e=e||{},e.x=l,e.y=u,e.align=c,e.verticalAlign=f,e}var Z2="__zr_normal__",Y2=is.concat(["ignore"]),nRe=La(is,function(e,t){return e[t]=!0,e},{ignore:!1}),Ah={},iRe=new je(0,0,0,0),S_=[],xC=function(){function e(t){this.id=QD(),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,f=n.autoOverflowArea,h=void 0;if((f||c)&&(h=iRe,n.layoutRect?h.copy(n.layoutRect):h.copy(this.getBoundingRect()),i||h.applyTransform(this.transform)),c){this.calculateTextPosition?this.calculateTextPosition(Ah,n,h):Jw(Ah,n,h),a.x=Ah.x,a.y=Ah.y,o=Ah.align,s=Ah.verticalAlign;var d=n.origin;if(d&&n.rotation!=null){var v=void 0,m=void 0;d==="center"?(v=h.width*.5,m=h.height*.5):(v=go(d[0],h.width),m=go(d[1],h.height)),u=!0,a.originX=-a.x+v+(i?0:h.x),a.originY=-a.y+m+(i?0:h.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(f){var _=x.overflowRect=x.overflowRect||new je(0,0,0,0);a.getLocalTransform(S_),Oa(S_,S_),je.copy(_,h),_.applyTransform(S_)}else x.overflowRect=null;var b=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,S=void 0,T=void 0,C=void 0;b&&this.canBeInsideText()?(S=n.insideFill,T=n.insideStroke,(S==null||S==="auto")&&(S=this.getInsideTextFill()),(T==null||T==="auto")&&(T=this.getInsideTextStroke(S),C=!0)):(S=n.outsideFill,T=n.outsideStroke,(S==null||S==="auto")&&(S=this.getOutsideFill()),(T==null||T==="auto")&&(T=this.getOutsideStroke(S),C=!0)),S=S||"#000",(S!==x.fill||T!==x.stroke||C!==x.autoStroke||o!==x.align||s!==x.verticalAlign)&&(l=!0,x.fill=S,x.stroke=T,x.autoStroke=C,x.align=o,x.verticalAlign=s,r.setDefaultTextStyle(x)),r.__dirty|=Bi,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()?qO:XO},e.prototype.getOutsideStroke=function(t){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&Xn(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,Ca(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||{},ie(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(Ee(t))for(var n=t,i=st(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(Z2,!1,t)},e.prototype.useState=function(t,r,n,i){var a=t===Z2,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(Ye(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){hC("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 f=this._textContent,h=this._textGuide;return f&&f.useState(t,r,n,c),h&&h.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&=~Bi),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,v);var m=this._textContent,y=this._textGuide;m&&m.useStates(t,r,h),y&&y.useStates(t,r,h),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Bi)}},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=Ye(i,t),o=Ye(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(v,m){r.during(m)});for(var h=0;h0||i.force&&!o.length){var P=void 0,O=void 0,k=void 0;if(s){O={},h&&(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=Ye(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=Ye(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 ge=yRe;function yRe(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 Qw(e,t,r)}function Qw(e,t,r){return me(e)?mRe(e).match(/%$/)?parseFloat(e)/100*t+(r||0):parseFloat(e):e==null?NaN:+e}function Mr(e,t,r){return t==null&&(t=10),t=Math.min(Math.max(0,t),jJ),e=(+e).toFixed(t),r?e:+e}function Vi(e){return e.sort(function(t,r){return t-r}),e}function no(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 RJ(e)}function RJ(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 lj(e,t){var r=Math.log,n=Math.LN10,i=Math.floor(r(e[1]-e[0])/n),a=Math.round(r(Vo(t[1]-t[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function xRe(e,t,r){if(!e[t])return 0;var n=BJ(e,r);return n[t]||0}function BJ(e,t){var r=La(e,function(d,v){return d+(isNaN(v)?0:v)},0);if(r===0)return[];for(var n=Math.pow(10,t),i=le(e,function(d){return(isNaN(d)?0:d)/r*n*100}),a=n*100,o=le(i,function(d){return Math.floor(d)}),s=La(o,function(d,v){return d+v},0),l=le(i,function(d,v){return d-o[v]});su&&(u=l[f],c=f);++o[c],l[c]=0,++s}return le(o,function(d){return d/n})}function _Re(e,t){var r=Math.max(no(e),no(t)),n=e+t;return r>jJ?n:Mr(n,r)}var QO=9007199254740991;function uj(e){var t=Math.PI*2;return(e%t+t)%t}function bv(e){return e>-dV&&e=10&&t++,t}function cj(e,t){var r=_C(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 Yb(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 eI(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 K2(e){e.option=e.parentModel=e.ecModel=null}var $Re=".",hc="___EC__COMPONENT__CONTAINER___",XJ="___EC__EXTENDED_CLASS___";function Go(e){var t={main:"",sub:""};if(e){var r=e.split($Re);t.main=r[0]||"",t.sub=r[1]||""}return t}function FRe(e){Nn(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}function VRe(e){return!!(e&&e[XJ])}function vj(e,t){e.$constructor=e,e.extend=function(r){var n=this,i;return GRe(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)},ej(i,this)),ie(i.prototype,r),i[XJ]=!0,i.extend=this.extend,i.superCall=URe,i.superApply=ZRe,i.superClass=n,i}}function GRe(e){return Pe(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function qJ(e,t){e.extend=t.extend}var WRe=Math.round(Math.random()*10);function HRe(e){var t=["__\0is_clz",WRe++].join("_");e.prototype[t]=!0,e.isInstance=function(r){return!!(r&&r[t])}}function URe(e,t){for(var r=[],n=2;n=0||a&&Ye(a,l)<0)){var u=n.getShallow(l,t);u!=null&&(o[e[s][0]]=u)}}return o}}var YRe=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],XRe=jf(YRe),qRe=function(){function e(){}return e.prototype.getAreaStyle=function(t,r){return XRe(this,t,r)},e}(),rI=new xv(50);function KRe(e){if(typeof e=="string"){var t=rI.get(e);return t&&t.image}else return e}function pj(e,t,r,n,i){if(e)if(typeof e=="string"){if(t&&t.__zrImageSrc===e||!r)return t;var a=rI.get(e),o={hostEl:r,cb:n,cbPayload:i};return a?(t=a.image,!wC(t)&&a.pending.push(o)):(t=Ci.loadImage(e,mV,mV),t.__zrImageSrc=e,rI.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e;else return t}function mV(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=s;u++)l-=s;var c=Qo(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 QJ(e,t,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){e.textLine="",e.isTruncated=!1;return}var o=Qo(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?QRe(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,l),o=Qo(a,t)}t===""&&(t=r.placeholder),e.textLine=t,e.isTruncated=!0}function QRe(e,t,r){for(var n=0,i=0,a=e.length;iy&&d){var b=Math.floor(y/h);v=v||x.length>b,x=x.slice(0,b),_=x.length*h}if(i&&c&&m!=null)for(var S=JJ(m,u,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),T={},C=0;Cv&&Q2(a,o.substring(v,y),t,d),Q2(a,m[2],t,d,m[1]),v=J2.lastIndex}vf){var H=a.lines.length;N>0?(O.tokens=O.tokens.slice(0,N),A(O,E,k),a.lines=a.lines.slice(0,P+1)):a.lines=a.lines.slice(0,P),a.isTruncated=a.isTruncated||a.lines.length0&&v+n.accumWidth>n.width&&(c=t.split(` +`),u=!0),n.accumWidth=v}else{var m=eQ(t,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=m.accumWidth+d,f=m.linesWidths,c=m.lines}}c||(c=t.split(` +`));for(var y=Jo(l),x=0;x=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var a3e=La(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function o3e(e){return i3e(e)?!!a3e[e]:!0}function eQ(e,t,r,n,i){for(var a=[],o=[],s="",l="",u=0,c=0,f=Jo(t),h=0;hr:i+c+v>r){c?(s||l)&&(m?(s||(s=l,l="",u=0,c=u),a.push(s),o.push(c-u),l+=d,u+=v,s="",c=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(c),s=d,c=v)):m?(a.push(l),o.push(u),l=d,u=v):(a.push(d),o.push(v));continue}c+=v,m?(l+=d,u+=v):(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 xV(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;je.set(_V,_v(r,o,i),pf(n,s,a),o,s),je.intersect(t,_V,null,bV);var l=bV.outIntersectRect;e.outerWidth=l.width,e.outerHeight=l.height,e.baseX=_v(l.x,l.width,i,!0),e.baseY=pf(l.y,l.height,a,!0)}}var _V=new je(0,0,0,0),bV={outIntersectRect:{},clamp:!0};function gj(e){return e!=null?e+="":e=""}function s3e(e){var t=gj(e.text),r=e.font,n=Qo(Jo(r),t),i=H0(r);return nI(e,n,i,null)}function nI(e,t,r,n){var i=new je(_v(e.x||0,t,e.textAlign),pf(e.y||0,r,e.textBaseline),t,r),a=n??(tQ(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function tQ(e){var t=e.stroke;return t!=null&&t!=="none"&&e.lineWidth>0}var iI="__zr_style_"+Math.round(Math.random()*10),gf={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},SC={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};gf[iI]=!0;var wV=["z","z2","invisible"],l3e=["invisible"],Ia=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype._init=function(r){for(var n=st(r),i=0;i1e-4){s[0]=e-r,s[1]=t-n,l[0]=e+r,l[1]=t+n;return}if(T_[0]=nM(i)*r+e,T_[1]=rM(i)*n+t,C_[0]=nM(a)*r+e,C_[1]=rM(a)*n+t,u(s,T_,C_),c(l,T_,C_),i=i%dc,i<0&&(i=i+dc),a=a%dc,a<0&&(a=a+dc),i>a&&!o?a+=dc:ii&&(A_[0]=nM(d)*r+e,A_[1]=rM(d)*n+t,u(s,A_,s),c(l,A_,l))}var $t={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},vc=[],pc=[],Co=[],Al=[],Ao=[],Mo=[],iM=Math.min,aM=Math.max,gc=Math.cos,mc=Math.sin,Ts=Math.abs,aI=Math.PI,Rl=aI*2,oM=typeof Float32Array<"u",pg=[];function sM(e){var t=Math.round(e/aI*1e8)/1e8;return t%2*aI}function CC(e,t){var r=sM(e[0]);r<0&&(r+=Rl);var n=r-e[0],i=e[1];i+=n,!t&&i-r>=Rl?i=r+Rl:t&&r-i>=Rl?i=r-Rl:!t&&r>i?i=r+(Rl-sM(r-i)):t&&r0&&(this._ux=Ts(n/qw/t)||0,this._uy=Ts(n/qw/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($t.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=Ts(t-this._xi),i=Ts(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData($t.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($t.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($t.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(),pg[0]=i,pg[1]=a,CC(pg,o),i=pg[0],a=pg[1];var s=a-i;return this.addData($t.A,t,r,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(t,r,n,i,a,o),this._xi=gc(a)*n+t,this._yi=mc(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($t.R,t,r,n,i),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData($t.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)&&oM&&(this.data=new Float32Array(r));for(var n=0;n0&&o))for(var s=0;sc.length&&(this._expandData(),c=this.data);for(var f=0;f0&&(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(){Co[0]=Co[1]=Ao[0]=Ao[1]=Number.MAX_VALUE,Al[0]=Al[1]=Mo[0]=Mo[1]=-Number.MAX_VALUE;var t=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||Ts(b)>i||h===r-1)&&(m=Math.sqrt(_*_+b*b),a=y,o=x);break}case $t.C:{var S=t[h++],T=t[h++],y=t[h++],x=t[h++],C=t[h++],A=t[h++];m=wje(a,o,S,T,y,x,C,A,10),a=C,o=A;break}case $t.Q:{var S=t[h++],T=t[h++],y=t[h++],x=t[h++];m=Tje(a,o,S,T,y,x,10),a=y,o=x;break}case $t.A:var P=t[h++],O=t[h++],k=t[h++],E=t[h++],N=t[h++],D=t[h++],z=D+N;h+=1,v&&(s=gc(N)*k+P,l=mc(N)*E+O),m=aM(k,E)*iM(Rl,Math.abs(D)),a=gc(z)*k+P,o=mc(z)*E+O;break;case $t.R:{s=a=t[h++],l=o=t[h++];var V=t[h++],F=t[h++];m=V*2+F*2;break}case $t.Z:{var _=s-a,b=l-o;m=Math.sqrt(_*_+b*b),a=s,o=l;break}}m>=0&&(u[f++]=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,f,h,d=r<1,v,m,y=0,x=0,_,b=0,S,T;if(!(d&&(this._pathSegLen||this._calculateLength(),v=this._pathSegLen,m=this._pathLen,_=r*m,!_)))e:for(var C=0;C0&&(t.lineTo(S,T),b=0),A){case $t.M:s=u=n[C++],l=c=n[C++],t.moveTo(u,c);break;case $t.L:{f=n[C++],h=n[C++];var O=Ts(f-u),k=Ts(h-c);if(O>i||k>a){if(d){var E=v[x++];if(y+E>_){var N=(_-y)/E;t.lineTo(u*(1-N)+f*N,c*(1-N)+h*N);break e}y+=E}t.lineTo(f,h),u=f,c=h,b=0}else{var D=O*O+k*k;D>b&&(S=f,T=h,b=D)}break}case $t.C:{var z=n[C++],V=n[C++],F=n[C++],$=n[C++],B=n[C++],H=n[C++];if(d){var E=v[x++];if(y+E>_){var N=(_-y)/E;ku(u,z,F,B,N,vc),ku(c,V,$,H,N,pc),t.bezierCurveTo(vc[1],pc[1],vc[2],pc[2],vc[3],pc[3]);break e}y+=E}t.bezierCurveTo(z,V,F,$,B,H),u=B,c=H;break}case $t.Q:{var z=n[C++],V=n[C++],F=n[C++],$=n[C++];if(d){var E=v[x++];if(y+E>_){var N=(_-y)/E;Zy(u,z,F,N,vc),Zy(c,V,$,N,pc),t.quadraticCurveTo(vc[1],pc[1],vc[2],pc[2]);break e}y+=E}t.quadraticCurveTo(z,V,F,$),u=F,c=$;break}case $t.A:var U=n[C++],Z=n[C++],Y=n[C++],K=n[C++],te=n[C++],ce=n[C++],de=n[C++],Oe=!n[C++],ye=Y>K?Y:K,ne=Ts(Y-K)>.001,ve=te+ce,ue=!1;if(d){var E=v[x++];y+E>_&&(ve=te+ce*(_-y)/E,ue=!0),y+=E}if(ne&&t.ellipse?t.ellipse(U,Z,Y,K,de,te,ve,Oe):t.arc(U,Z,ye,te,ve,Oe),ue)break e;P&&(s=gc(te)*Y+U,l=mc(te)*K+Z),u=gc(ve)*Y+U,c=mc(ve)*K+Z;break;case $t.R:s=u=n[C],l=c=n[C+1],f=n[C++],h=n[C++];var ee=n[C++],We=n[C++];if(d){var E=v[x++];if(y+E>_){var be=_-y;t.moveTo(f,h),t.lineTo(f+iM(be,ee),h),be-=ee,be>0&&t.lineTo(f+ee,h+iM(be,We)),be-=We,be>0&&t.lineTo(f+aM(ee-be,0),h+We),be-=ee,be>0&&t.lineTo(f,h+aM(We-be,0));break e}y+=E}t.rect(f,h,ee,We);break;case $t.Z:if(d){var E=v[x++];if(y+E>_){var N=(_-y)/E;t.lineTo(u*(1-N)+s*N,c*(1-N)+l*N);break e}y+=E}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=$t,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),e}();function Vl(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+f&&c>n+f&&c>a+f&&c>s+f||ce+f&&u>r+f&&u>i+f&&u>o+f||ut+u&&l>n+u&&l>a+u||le+u&&s>r+u&&s>i+u||sr||c+ui&&(i+=gg);var h=Math.atan2(l,s);return h<0&&(h+=gg),h>=n&&h<=i||h+gg>=n&&h+gg<=i}function Is(e,t,r,n,i,a){if(a>t&&a>n||ai?s:0}var Ml=os.CMD,yc=Math.PI*2,p3e=1e-4;function g3e(e,t){return Math.abs(e-t)t&&u>n&&u>a&&u>s||u1&&m3e(),d=en(t,n,a,s,ha[0]),h>1&&(v=en(t,n,a,s,ha[1]))),h===2?yt&&s>n&&s>a||s=0&&u<=1){for(var c=0,f=gn(t,n,a,u),h=0;hr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);ti[0]=-l,ti[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=yc-1e-4){n=0,i=yc;var c=a?1:-1;return o>=ti[0]+e&&o<=ti[1]+e?c:0}if(n>i){var f=n;n=i,i=f}n<0&&(n+=yc,i+=yc);for(var h=0,d=0;d<2;d++){var v=ti[d];if(v+e>o){var m=Math.atan2(s,v),c=a?1:-1;m<0&&(m=yc+m),(m>=n&&m<=i||m+yc>=n&&m+yc<=i)&&(m>Math.PI/2&&m1&&(r||(s+=Is(l,u,c,f,n,i))),y&&(l=a[v],u=a[v+1],c=l,f=u),m){case Ml.M:c=a[v++],f=a[v++],l=c,u=f;break;case Ml.L:if(r){if(Vl(l,u,a[v],a[v+1],t,n,i))return!0}else s+=Is(l,u,a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case Ml.C:if(r){if(d3e(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],t,n,i))return!0}else s+=y3e(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case Ml.Q:if(r){if(rQ(l,u,a[v++],a[v++],a[v],a[v+1],t,n,i))return!0}else s+=x3e(l,u,a[v++],a[v++],a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case Ml.A:var x=a[v++],_=a[v++],b=a[v++],S=a[v++],T=a[v++],C=a[v++];v+=1;var A=!!(1-a[v++]);h=Math.cos(T)*b+x,d=Math.sin(T)*S+_,y?(c=h,f=d):s+=Is(l,u,h,d,n,i);var P=(n-x)*S/b+x;if(r){if(v3e(x,_,S,T,T+C,A,t,P,i))return!0}else s+=_3e(x,_,S,T,T+C,A,P,i);l=Math.cos(T+C)*b+x,u=Math.sin(T+C)*S+_;break;case Ml.R:c=l=a[v++],f=u=a[v++];var O=a[v++],k=a[v++];if(h=c+O,d=f+k,r){if(Vl(c,f,h,f,t,n,i)||Vl(h,f,h,d,t,n,i)||Vl(h,d,c,d,t,n,i)||Vl(c,d,c,f,t,n,i))return!0}else s+=Is(h,f,h,d,n,i),s+=Is(c,d,c,f,n,i);break;case Ml.Z:if(r){if(Vl(l,u,c,f,t,n,i))return!0}else s+=Is(l,u,c,f,n,i);l=c,u=f;break}}return!r&&!g3e(u,f)&&(s+=Is(l,u,c,f,n,i)||0),s!==0}function b3e(e,t,r){return nQ(e,0,!1,t,r)}function w3e(e,t,r,n){return nQ(e,t,!0,r,n)}var eS=Ie({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},gf),S3e={style:Ie({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},SC.style)},lM=is.concat(["invisible","culling","z","z2","zlevel","parent"]),at=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?XO:n>.2?tRe:qO}else if(r)return qO}return XO},t.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(me(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=qy(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&Kh)&&(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)),w3e(s,l/u,r,n)))return!0}if(this.hasFill())return b3e(s,r,n)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=Kh,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:ie(i,r),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&Kh)},t.prototype.createStyle=function(r){return V0(eS,r)},t.prototype._innerSaveToNormal=function(r){e.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=ie({},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=ie({},i.shape),ie(u,n.shape)):(u=ie({},a?this.shape:i.shape),ie(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=ie({},this.shape);for(var c={},f=st(u),h=0;hi&&(f=s+l,s*=i/f,l*=i/f),u+c>i&&(f=u+c,u*=i/f,c*=i/f),l+u>a&&(f=l+u,l*=a/f,u*=a/f),s+c>a&&(f=s+c,s*=a/f,c*=a/f),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 yd=Math.round;function AC(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&&(yd(n*2)===yd(i*2)&&(e.x1=e.x2=Wi(n,s,!0)),yd(a*2)===yd(o*2)&&(e.y1=e.y2=Wi(a,s,!0))),e}}function iQ(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=Wi(n,s,!0),e.y=Wi(i,s,!0),e.width=Math.max(Wi(n+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(Wi(i+o,s,!1)-e.y,o===0?0:1)),e}}function Wi(e,t,r){if(!t)return e;var n=yd(e*2);return(n+yd(t))%2===0?n/2:(n+(r?1:-1))/2}var k3e=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),L3e={},Qe=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new k3e},t.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=iQ(L3e,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?P3e(r,n):r.rect(i,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(at);Qe.prototype.type="rect";var MV={fill:"#000"},PV=2,Po={},O3e={style:Ie({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},SC.style)},lt=function(e){q(t,e);function t(r){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=MV,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,N=0;N=0&&(z=C[D],z.align==="right");)this._placeToken(z,r,P,x,N,"right",b),O-=z.width,N-=z.width,D--;for(E+=(c-(E-y)-(_-N)-O)/2;k<=D;)z=C[k],this._placeToken(z,r,P,x,E+z.width/2,"center",b),E+=z.width,k++;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,f=a+i/2;c==="top"?f=a+r.height/2:c==="bottom"&&(f=a+i-r.height/2);var h=!r.isLineHolder&&uM(u);h&&this._renderBackground(u,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,f-r.height/2,r.width,r.height);var d=!!u.backgroundColor,v=r.textPadding;v&&(o=NV(o,s,v),f-=r.height/2-v[0]-r.innerHeight/2);var m=this._getOrCreateChild(wv),y=m.createStyle();m.useStyle(y);var x=this._defaultStyle,_=!1,b=0,S=!1,T=EV("fill"in u?u.fill:"fill"in n?n.fill:(_=!0,x.fill)),C=IV("stroke"in u?u.stroke:"stroke"in n?n.stroke:!d&&!l&&(!x.autoStroke||_)?(b=PV,S=!0,x.stroke):null),A=u.textShadowBlur>0||n.textShadowBlur>0;y.text=r.text,y.x=o,y.y=f,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||ll,y.opacity=Ti(u.opacity,n.opacity,1),LV(y,u),C&&(y.lineWidth=Ti(u.lineWidth,n.lineWidth,b),y.lineDash=Ae(u.lineDash,n.lineDash),y.lineDashOffset=n.lineDashOffset||0,y.stroke=C),T&&(y.fill=T),m.setBoundingRect(nI(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,f=l&&l.image,h=l&&!f,d=r.borderRadius,v=this,m,y;if(h||r.lineHeight||u&&c){m=this._getOrCreateChild(Qe),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(h){var _=m.style;_.fill=l||null,_.fillOpacity=Ae(r.fillOpacity,1)}else if(f){y=this._getOrCreateChild(un),y.onload=function(){v.dirtyStyle()};var b=y.style;b.image=l.image,b.x=i,b.y=a,b.width=o,b.height=s}if(u&&c){var _=m.style;_.lineWidth=u,_.stroke=c,_.strokeOpacity=Ae(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=Ti(r.opacity,n.opacity,1)},t.makeFont=function(r){var n="";return oQ(r)&&(n=[r.fontStyle,r.fontWeight,aQ(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Fi(n)||r.textFont||r.font},t}(Ia),I3e={left:!0,right:1,center:1},E3e={top:1,bottom:1,middle:1},kV=["fontStyle","fontWeight","fontSize","fontFamily"];function aQ(e){return typeof e=="string"&&(e.indexOf("px")!==-1||e.indexOf("rem")!==-1||e.indexOf("em")!==-1)?e:isNaN(+e)?qD+"px":e+"px"}function LV(e,t){for(var r=0;r=0,a=!1;if(e instanceof at){var o=sQ(e),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(Mh(s)||Mh(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=ie({},n),u=ie({},u),u.fill=s):!Mh(u.fill)&&Mh(s)?(a=!0,n=ie({},n),u=ie({},u),u.fill=Yw(s)):!Mh(u.stroke)&&Mh(l)&&(a||(n=ie({},n),u=ie({},u)),u.stroke=Yw(l)),n.style=u}}if(n&&n.z2==null){a||(n=ie({},n));var c=e.z2EmphasisLift;n.z2=e.z2+(c??lp)}return n}function $3e(e,t,r){if(r&&r.z2==null){r=ie({},r);var n=e.z2SelectLift;r.z2=e.z2+(n??D3e)}return r}function F3e(e,t,r){var n=Ye(e.currentStates,t)>=0,i=e.style.opacity,a=n?null:B3e(e,["opacity"],t,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=ie({},r),o=ie({opacity:n?i:a.opacity*.1},o),r.style=o),r}function cM(e,t){var r=this.states[e];if(this.style){if(e==="emphasis")return z3e(this,e,t,r);if(e==="blur")return F3e(this,e,r);if(e==="select")return $3e(this,e,r)}return r}function Rf(e){e.stateProxy=cM;var t=e.getTextContent(),r=e.getTextGuideLine();t&&(t.stateProxy=cM),r&&(r.stateProxy=cM)}function zV(e,t){!vQ(e,t)&&!e.__highByOuter&&bl(e,lQ)}function $V(e,t){!vQ(e,t)&&!e.__highByOuter&&bl(e,uQ)}function cl(e,t){e.__highByOuter|=1<<(t||0),bl(e,lQ)}function fl(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&bl(e,uQ)}function fQ(e){bl(e,_j)}function bj(e){bl(e,cQ)}function hQ(e){bl(e,j3e)}function dQ(e){bl(e,R3e)}function vQ(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function pQ(e){var t=e.getModel(),r=[],n=[];t.eachComponent(function(i,a){var o=mj(a),s=i==="series",l=s?e.getViewOfSeriesModel(a):e.getViewOfComponentModel(a);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(u){cQ(u)}),s&&r.push(a)),o.isBlured=!1}),R(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,t)})}function lI(e,t,r,n){var i=n.getModel();r=r||"coordinateSystem";function a(u,c){for(var f=0;f0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),t.push(s)}})}),t}function yu(e,t,r){af(e,!0),bl(e,Rf),cI(e,t,r)}function Z3e(e){af(e,!1)}function qt(e,t,r,n){n?Z3e(e):yu(e,t,r)}function cI(e,t,r){var n=Be(e);t!=null?(n.focus=t,n.blurScope=r):n.focus&&(n.focus=null)}var VV=["emphasis","blur","select"],Y3e={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Yr(e,t,r,n){r=r||"itemStyle";for(var i=0;i1&&(o*=fM(v),s*=fM(v));var m=(i===a?-1:1)*fM((o*o*(s*s)-o*o*(d*d)-s*s*(h*h))/(o*o*(d*d)+s*s*(h*h)))||0,y=m*o*d/s,x=m*-s*h/o,_=(e+r)/2+P_(f)*y-M_(f)*x,b=(t+n)/2+M_(f)*y+P_(f)*x,S=UV([1,0],[(h-y)/o,(d-x)/s]),T=[(h-y)/o,(d-x)/s],C=[(-1*h-y)/o,(-1*d-x)/s],A=UV(T,C);if(hI(T,C)<=-1&&(A=mg),hI(T,C)>=1&&(A=0),A<0){var P=Math.round(A/mg*1e6)/1e6;A=mg*2+P%2*mg}c.addData(u,_,b,o,s,S,A,f,a)}var e5e=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,t5e=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function r5e(e){var t=new os;if(!e)return t;var r=0,n=0,i=r,a=n,o,s=os.CMD,l=e.match(e5e);if(!l)return t;for(var u=0;uz*z+V*V&&(P=k,O=E),{cx:P,cy:O,x0:-c,y0:-f,x1:P*(i/T-1),y1:O*(i/T-1)}}function u5e(e){var t;if(oe(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 c5e(e,t){var r,n=Qg(t.r,0),i=Qg(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,f=t.cy,h=!!t.clockwise,d=YV(u-l),v=d>hM&&d%hM;if(v>Ua&&(d=v),!(n>Ua))e.moveTo(c,f);else if(d>hM-Ua)e.moveTo(c+n*kh(l),f+n*xc(l)),e.arc(c,f,n,l,u,!h),i>Ua&&(e.moveTo(c+i*kh(u),f+i*xc(u)),e.arc(c,f,i,u,l,h));else{var m=void 0,y=void 0,x=void 0,_=void 0,b=void 0,S=void 0,T=void 0,C=void 0,A=void 0,P=void 0,O=void 0,k=void 0,E=void 0,N=void 0,D=void 0,z=void 0,V=n*kh(l),F=n*xc(l),$=i*kh(u),B=i*xc(u),H=d>Ua;if(H){var U=t.cornerRadius;U&&(r=u5e(U),m=r[0],y=r[1],x=r[2],_=r[3]);var Z=YV(n-i)/2;if(b=ko(Z,x),S=ko(Z,_),T=ko(Z,m),C=ko(Z,y),O=A=Qg(b,S),k=P=Qg(T,C),(A>Ua||P>Ua)&&(E=n*kh(u),N=n*xc(u),D=i*kh(l),z=i*xc(l),dUa){var ne=ko(x,O),ve=ko(_,O),ue=k_(D,z,V,F,n,ne,h),ee=k_(E,N,$,B,n,ve,h);e.moveTo(c+ue.cx+ue.x0,f+ue.cy+ue.y0),O0&&e.arc(c+ue.cx,f+ue.cy,ne,Fn(ue.y0,ue.x0),Fn(ue.y1,ue.x1),!h),e.arc(c,f,n,Fn(ue.cy+ue.y1,ue.cx+ue.x1),Fn(ee.cy+ee.y1,ee.cx+ee.x1),!h),ve>0&&e.arc(c+ee.cx,f+ee.cy,ve,Fn(ee.y1,ee.x1),Fn(ee.y0,ee.x0),!h))}else e.moveTo(c+V,f+F),e.arc(c,f,n,l,u,!h);if(!(i>Ua)||!H)e.lineTo(c+$,f+B);else if(k>Ua){var ne=ko(m,k),ve=ko(y,k),ue=k_($,B,E,N,i,-ve,h),ee=k_(V,F,D,z,i,-ne,h);e.lineTo(c+ue.cx+ue.x0,f+ue.cy+ue.y0),k0&&e.arc(c+ue.cx,f+ue.cy,ve,Fn(ue.y0,ue.x0),Fn(ue.y1,ue.x1),!h),e.arc(c,f,i,Fn(ue.cy+ue.y1,ue.cx+ue.x1),Fn(ee.cy+ee.y1,ee.cx+ee.x1),h),ne>0&&e.arc(c+ee.cx,f+ee.cy,ne,Fn(ee.y1,ee.x1),Fn(ee.y0,ee.x0),!h))}else e.lineTo(c+$,f+B),e.arc(c,f,i,u,l,h)}e.closePath()}}}var f5e=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}(),Dn=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new f5e},t.prototype.buildPath=function(r,n){c5e(r,n)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(at);Dn.prototype.type="sector";var h5e=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),up=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new h5e},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}(at);up.prototype.type="ring";function d5e(e,t,r,n){var i=[],a=[],o=[],s=[],l,u,c,f;if(n){c=[1/0,1/0],f=[-1/0,-1/0];for(var h=0,d=e.length;h=2){if(n){var a=d5e(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,f=i.length;sbc[1]){if(a=!1,dn.negativeSize||n)return a;var l=L_(bc[0]-_c[1]),u=L_(_c[0]-bc[1]);dM(l,u)>I_.len()&&(l=u||!dn.bidirectional)&&(De.scale(O_,s,-u*i),dn.useDir&&dn.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 f=c.duration,h=c.delay,d=c.easing,v={duration:f,delay:h||0,easing:d,done:a,force:!!a||!!o,setToFinal:!u,scope:e,during:o};s?t.animateFrom(r,v):t.animateTo(r,v)}else t.stopAnimation(),!s&&t.attr(r),o&&o(1),a&&a()}function ft(e,t,r,n,i,a){Cj("update",e,t,r,n,i,a)}function Gt(e,t,r,n,i,a){Cj("enter",e,t,r,n,i,a)}function Rd(e){if(!e.__zr)return!0;for(var t=0;tVo(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function KV(e){return!e.isGroup}function C5e(e){return e.shape!=null}function q0(e,t,r){if(!e||!t)return;function n(o){var s={};return o.traverse(function(l){KV(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return C5e(o)&&(s.shape=ke(o.shape)),s}var a=n(e);t.traverse(function(o){if(KV(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),ft(o,l,r,Be(o).dataIndex)}}})}function Pj(e,t){return le(e,function(r){var n=r[0];n=Ar(n,t.x),n=Ui(n,t.x+t.width);var i=r[1];return i=Ar(i,t.y),i=Ui(i,t.y+t.height),[n,i]})}function LQ(e,t){var r=Ar(e.x,t.x),n=Ui(e.x+e.width,t.x+t.width),i=Ar(e.y,t.y),a=Ui(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 hp(e,t,r){var n=ie({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),Ie(i,r),new un(n)):Sv(e.replace("path://",""),n,r,"center")}function em(e,t,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var y=vM(d,v,c,f)/h;return!(y<0||y>1)}function vM(e,t,r,n){return e*n-r*t}function A5e(e){return e<=1e-6&&e>=-1e-6}function Bf(e,t,r,n,i){return t==null||(ut(t)?er[0]=er[1]=er[2]=er[3]=t:(er[0]=t[0],er[1]=t[1],er[2]=t[2],er[3]=t[3]),n&&(er[0]=Ar(0,er[0]),er[1]=Ar(0,er[1]),er[2]=Ar(0,er[2]),er[3]=Ar(0,er[3])),r&&(er[0]=-er[0],er[1]=-er[1],er[2]=-er[2],er[3]=-er[3]),JV(e,er,"x","width",3,1,i&&i[0]||0),JV(e,er,"y","height",0,2,i&&i[1]||0)),e}var er=[0,0,0,0];function JV(e,t,r,n,i,a,o){var s=t[a]+t[i],l=e[n];e[n]+=s,o=Ar(0,Ui(o,l)),e[n]=0?-t[i]:t[a]>=0?l+t[a]:Vo(s)>1e-8?(l-o)*t[i]/s:0):e[r]-=t[i]}function wl(e){var t=e.itemTooltipOption,r=e.componentModel,n=e.itemName,i=me(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&&R(st(l),function(c){Se(s,c)||(s[c]=l[c],s.$vars.push(c))});var u=Be(e.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:n,option:Ie({content:n,encodeHTMLContent:!0,formatterParams:s},i)}}function vI(e,t){var r;e.isGroup&&(r=t(e)),r||e.traverse(t)}function Uu(e,t){if(e)if(oe(e))for(var r=0;rt&&(t=o),ot&&(r=t=0),{min:r,max:t}}function LC(e,t,r){EQ(e,t,r,-1/0)}function EQ(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 Zu(e,t){return Xe(Xe({},e,!0),t,!0)}const B5e={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:". "}}}},z5e={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 aS="ZH",Ij="EN",Bd=Ij,Kb={},Ej={},zQ=ot.domSupported?function(){var e=(document.documentElement.lang||navigator.language||navigator.browserLanguage||Bd).toUpperCase();return e.indexOf(aS)>-1?aS:Bd}():Bd;function Nj(e,t){e=e.toUpperCase(),Ej[e]=new it(t),Kb[e]=t}function $5e(e){if(me(e)){var t=Kb[e.toUpperCase()]||{};return e===aS||e===Ij?ke(t):Xe(ke(t),ke(Kb[Bd]),!1)}else return Xe(ke(e),ke(Kb[Bd]),!1)}function gI(e){return Ej[e]}function F5e(){return Ej[Bd]}Nj(Ij,B5e);Nj(aS,z5e);var mI=null;function V5e(e){mI||(mI=e)}function Rr(){return mI}var Dj=1e3,jj=Dj*60,Em=jj*60,ya=Em*24,n6=ya*365,G5e={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})/},Jb={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},W5e="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",N_="{yyyy}-{MM}-{dd}",i6={year:"{yyyy}",month:"{yyyy}-{MM}",day:N_,hour:N_+" "+Jb.hour,minute:N_+" "+Jb.minute,second:N_+" "+Jb.second,millisecond:W5e},Di=["year","month","day","hour","minute","second","millisecond"],H5e=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function U5e(e){return!me(e)&&!Pe(e)?Z5e(e):e}function Z5e(e){e=e||{};var t={},r=!0;return R(Di,function(n){r&&(r=e[n]==null)}),R(Di,function(n,i){var a=e[n];t[n]={};for(var o=null,s=i;s>=0;s--){var l=Di[s],u=Ee(a)&&!oe(a)?a[l]:a,c=void 0;oe(u)?(c=u.slice(),o=c[0]||""):me(u)?(o=u,c=[o]):(o==null?o=Jb[n]:G5e[l].test(o)||(o=t[l][l][0]+" "+o),c=[o],r&&(c[1]="{primary|"+o+"}")),t[n][l]=c}}),t}function ri(e,t){return e+="","0000".substr(0,t-e.length)+e}function Nm(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 Y5e(e){return e===Nm(e)}function X5e(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function K0(e,t,r,n){var i=hs(e),a=i[$Q(r)](),o=i[Rj(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[Bj(r)](),u=i["get"+(r?"UTC":"")+"Day"](),c=i[zj(r)](),f=(c-1)%12+1,h=i[$j(r)](),d=i[Fj(r)](),v=i[Vj(r)](),m=c>=12?"pm":"am",y=m.toUpperCase(),x=n instanceof it?n:gI(n||zQ)||F5e(),_=x.getModel("time"),b=_.get("month"),S=_.get("monthAbbr"),T=_.get("dayOfWeek"),C=_.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,m+"").replace(/{A}/g,y+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,ri(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,b[o-1]).replace(/{MMM}/g,S[o-1]).replace(/{MM}/g,ri(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,ri(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,T[u]).replace(/{ee}/g,C[u]).replace(/{e}/g,u+"").replace(/{HH}/g,ri(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,ri(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,ri(h,2)).replace(/{m}/g,h+"").replace(/{ss}/g,ri(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,ri(v,3)).replace(/{S}/g,v+"")}function q5e(e,t,r,n,i){var a=null;if(me(r))a=r;else if(Pe(r)){var o={time:e.time,level:e.time.level},s=Rr();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=_d(e.value,i);a=r[c][c][0]}}return K0(new Date(e.value),a,i,n)}function _d(e,t){var r=hs(e),n=r[Rj(t)]()+1,i=r[Bj(t)](),a=r[zj(t)](),o=r[$j(t)](),s=r[Fj(t)](),l=r[Vj(t)](),u=l===0,c=u&&s===0,f=c&&o===0,h=f&&a===0,d=h&&i===1,v=d&&n===1;return v?"year":d?"month":h?"day":f?"hour":c?"minute":u?"second":"millisecond"}function oS(e,t,r){switch(t){case"year":e[FQ(r)](0);case"month":e[VQ(r)](1);case"day":e[GQ(r)](0);case"hour":e[WQ(r)](0);case"minute":e[HQ(r)](0);case"second":e[UQ(r)](0)}return e}function $Q(e){return e?"getUTCFullYear":"getFullYear"}function Rj(e){return e?"getUTCMonth":"getMonth"}function Bj(e){return e?"getUTCDate":"getDate"}function zj(e){return e?"getUTCHours":"getHours"}function $j(e){return e?"getUTCMinutes":"getMinutes"}function Fj(e){return e?"getUTCSeconds":"getSeconds"}function Vj(e){return e?"getUTCMilliseconds":"getMilliseconds"}function K5e(e){return e?"setUTCFullYear":"setFullYear"}function FQ(e){return e?"setUTCMonth":"setMonth"}function VQ(e){return e?"setUTCDate":"setDate"}function GQ(e){return e?"setUTCHours":"setHours"}function WQ(e){return e?"setUTCMinutes":"setMinutes"}function HQ(e){return e?"setUTCSeconds":"setSeconds"}function UQ(e){return e?"setUTCMilliseconds":"setMilliseconds"}function J5e(e,t,r,n,i,a,o,s){var l=new lt({style:{text:e,font:t,align:r,verticalAlign:n,padding:i,rich:a,overflow:o?"truncate":null,lineHeight:s}});return l.getBoundingRect()}function Gj(e){if(!fj(e))return me(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function Wj(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 pp=F0;function yI(e,t,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(c){return c&&Fi(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?hs(e):e;if(isNaN(+l)){if(s)return"-"}else return K0(l,n,r)}if(t==="ordinal")return $w(e)?i(e):ut(e)&&a(e)?e+"":"-";var u=as(e);return a(u)?Gj(u):$w(e)?i(e):typeof e=="boolean"?e+"":"-"}var a6=["a","b","c","d","e","f","g"],mM=function(e,t){return"{"+e+(t??"")+"}"};function Hj(e,t,r){oe(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 eBe(e,t,r){(e==="week"||e==="month"||e==="quarter"||e==="half-year"||e==="year")&&(e=`MM-dd +yyyy`);var n=hs(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"](),f=n[i+"Milliseconds"]();return e=e.replace("MM",ri(o,2)).replace("M",o).replace("yyyy",a).replace("yy",ri(a%100+"",2)).replace("dd",ri(s,2)).replace("d",s).replace("hh",ri(l,2)).replace("h",l).replace("mm",ri(u,2)).replace("m",u).replace("ss",ri(c,2)).replace("s",c).replace("SSS",ri(f,3)),e}function tBe(e){return e&&e.charAt(0).toUpperCase()+e.substr(1)}function $f(e,t){return t=t||"transparent",me(e)?e:Ee(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function sS(e,t){if(t==="_blank"||t==="blank"){var r=window.open();r.opener=null,r.location.href=e}else window.open(e,t)}var Qb={},yM={},gp=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(t,r){this._nonSeriesBoxMasterList=n(Qb),this._normalMasterList=n(yM);function n(i,a){var o=[];return R(i,function(s,l){var u=s.create(t,r);o=o.concat(u||[])}),o}},e.prototype.update=function(t,r){R(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"){Qb[t]=r;return}yM[t]=r},e.get=function(t){return yM[t]||Qb[t]},e}();function rBe(e){return!!Qb[e]}var xI={coord:1,coord2:2};function nBe(e){YQ.set(e.fullType,{getCoord2:void 0}).getCoord2=e.getCoord2}var YQ=Ce();function iBe(e){var t=e.getShallow("coord",!0),r=xI.coord;if(t==null){var n=YQ.get(e.type);n&&n.getCoord2&&(r=xI.coord2,t=n.getCoord2(e))}return{coord:t,from:r}}var Bo={none:0,dataCoordSys:1,boxCoordSys:2};function XQ(e,t){var r=e.getShallow("coordinateSystem"),n=e.getShallow("coordinateSystemUsage",!0),i=Bo.none;if(r){var a=e.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=Bo.dataCoordSys,a||(i=Bo.none)):n==="box"&&(i=Bo.boxCoordSys,!a&&!rBe(r)&&(i=Bo.none))}return{coordSysType:r,kind:i}}function J0(e){var t=e.targetModel,r=e.coordSysType,n=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=XQ(t),o=a.kind,s=a.coordSysType;if(i&&o!==Bo.dataCoordSys&&(o=Bo.dataCoordSys,s=r),o===Bo.none||s!==r)return!1;var l=n(r,t);return l?(o===Bo.dataCoordSys?t.coordinateSystem=l:t.boxCoordinateSystem=l,!0):!1}var qQ=function(e,t){var r=t.getReferringComponents(e,fr).models[0];return r&&r.coordinateSystem},e1=R,KQ=["left","right","top","bottom","width","height"],of=[["width","left","right"],["height","top","bottom"]];function Uj(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(),f=t.childAt(u+1),h=f&&f.getBoundingRect(),d,v;if(e==="horizontal"){var m=c.width+(h?-h.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+(h?-h.y+c.y:0);v=o+y,v>i||l.newline?(a+=s+r,o=0,v=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=v+r)})}var yf=Uj;Ue(Uj,"vertical");Ue(Uj,"horizontal");function JQ(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 aBe(e,t){var r=qr(e,t,{enableLayoutOnlyByCenter:!0}),n=e.getBoxLayoutParams(),i,a;if(r.type===tm.point)a=r.refPoint,i=Zt(n,{width:t.getWidth(),height:t.getHeight()});else{var o=e.get("center"),s=oe(o)?o:[o,o];i=Zt(n,r.refContainer),a=r.boxCoordFrom===xI.coord2?r.refPoint:[ge(s[0],i.width)+i.x,ge(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function QQ(e,t){var r=aBe(e,t),n=r.viewRect,i=r.center,a=e.get("radius");oe(a)||(a=[0,a]);var o=ge(n.width,t.getWidth()),s=ge(n.height,t.getHeight()),l=Math.min(o,s),u=ge(a[0],l/2),c=ge(a[1],l/2);return{cx:i[0],cy:i[1],r0:u,r:c,viewRect:n}}function Zt(e,t,r){r=pp(r||0);var n=t.width,i=t.height,a=ge(e.left,n),o=ge(e.top,i),s=ge(e.right,n),l=ge(e.bottom,i),u=ge(e.width,n),c=ge(e.height,i),f=r[2]+r[0],h=r[1]+r[3],d=e.aspect;switch(isNaN(u)&&(u=n-s-h-a),isNaN(c)&&(c=i-l-f-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-h),isNaN(o)&&(o=i-l-c-f),e.left||e.right){case"center":a=n/2-u/2-r[3];break;case"right":a=n-u-h;break}switch(e.top||e.bottom){case"middle":case"center":o=i/2-c/2-r[0];break;case"bottom":o=i-c-f;break}a=a||0,o=o||0,isNaN(u)&&(u=n-h-a-(s||0)),isNaN(c)&&(c=i-f-o-(l||0));var v=new je((t.x||0)+a+r[3],(t.y||0)+o+r[0],u,c);return v.margin=r,v}function eee(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 f;for(var y=0;y=0;l--)s=Xe(s,i[l],!0);n.defaultOption=s}return n.defaultOption},t.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return sp(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},t.prototype.getBoxLayoutParams=function(){return JQ(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}(it);qJ(tt,it);bC(tt);j5e(tt);R5e(tt,lBe);function lBe(e){var t=[];return R(tt.getClassesByMainType(e),function(r){t=t.concat(r.dependencies||r.prototype.dependencies||[])}),t=le(t,function(r){return Go(r).main}),e!=="dataset"&&Ye(t,"dataset")<=0&&t.unshift("dataset"),t}var J={color:{},darkColor:{},size:{}},wr=J.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)"};ie(wr,{primary:wr.neutral80,secondary:wr.neutral70,tertiary:wr.neutral60,quaternary:wr.neutral50,disabled:wr.neutral20,border:wr.neutral30,borderTint:wr.neutral20,borderShade:wr.neutral40,background:wr.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:wr.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:wr.neutral70,axisLineTint:wr.neutral40,axisTick:wr.neutral70,axisTickMinor:wr.neutral60,axisLabel:wr.neutral70,axisSplitLine:wr.neutral15,axisMinorSplitLine:wr.neutral05});for(var wc in wr)if(wr.hasOwnProperty(wc)){var o6=wr[wc];wc==="theme"?J.darkColor.theme=wr.theme.slice():wc==="highlight"?J.darkColor.highlight="rgba(255,231,130,0.4)":wc.indexOf("accent")===0?J.darkColor[wc]=Xs(o6,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):J.darkColor[wc]=Xs(o6,null,function(e){return e*.9},function(e){return 1-Math.pow(e,1.5)})}J.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var ree="";typeof navigator<"u"&&(ree=navigator.platform||"");var Lh="rgba(0, 0, 0, 0.2)",nee=J.color.theme[0],uBe=Xs(nee,null,null,.9);const cBe={darkMode:"auto",colorBy:"series",color:J.color.theme,gradientColor:[uBe,nee],aria:{decal:{decals:[{color:Lh,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Lh,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Lh,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Lh,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Lh,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Lh,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:ree.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 iee=Ce(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Ki="original",_n="arrayRows",Ji="objectRows",xo="keyedColumns",_u="typedArray",aee="unknown",co="column",nh="row",An={Must:1,Might:2,Not:3},oee=rt();function fBe(e){oee(e).datasetMap=Ce()}function see(e,t,r){var n={},i=Yj(t);if(!i||!e)return n;var a=[],o=[],s=t.ecModel,l=oee(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,c,f;e=e.slice(),R(e,function(m,y){var x=Ee(m)?m:e[y]={name:m};x.type==="ordinal"&&c==null&&(c=y,f=v(x)),n[x.name]=[]});var h=l.get(u)||l.set(u,{categoryWayDim:f,valueWayDim:0});R(e,function(m,y){var x=m.name,_=v(m);if(c==null){var b=h.valueWayDim;d(n[x],b,_),d(o,b,_),h.valueWayDim+=_}else if(c===y)d(n[x],0,_),d(a,0,_);else{var b=h.categoryWayDim;d(n[x],b,_),d(o,b,_),h.categoryWayDim+=_}});function d(m,y,x){for(var _=0;_t)return e[n];return e[r-1]}function cee(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:gBe(n,o);if(c=c||r,!(!c||!c.length)){var f=c[l];return i&&(u[i]=f),s.paletteIdx=(l+1)%c.length,f}}function mBe(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var D_,yg,l6,u6="\0_ec_inner",yBe=1,qj=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 it(a),this._locale=new it(o),this._optionManager=s},t.prototype.setOption=function(r,n,i){var a=h6(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},t.prototype.resetOption=function(r,n){return this._resetOption(r,h6(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"?l6(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&&R(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=Ce(),u=n&&n.replaceMergeMainTypeMap;fBe(this),R(r,function(f,h){f!=null&&(tt.hasClass(h)?h&&(s.push(h),l.set(h,!0)):i[h]=i[h]==null?ke(f):Xe(i[h],f,!0))}),u&&u.each(function(f,h){tt.hasClass(h)&&!l.get(h)&&(s.push(h),l.set(h,!0))}),tt.topologicalTravel(s,tt.getAllClassMainTypes(),c,this);function c(f){var h=vBe(this,f,jt(r[f])),d=a.get(f),v=d?u&&u.get(f)?"replaceMerge":"normalMerge":"replaceAll",m=HJ(d,h,v);ERe(m,f,tt),i[f]=null,a.set(f,null),o.set(f,0);var y=[],x=[],_=0,b;R(m,function(S,T){var C=S.existing,A=S.newOption;if(!A)C&&(C.mergeOption({},this),C.optionUpdated({},!1));else{var P=f==="series",O=tt.getClass(f,S.keyInfo.subType,!P);if(!O)return;if(f==="tooltip"){if(b)return;b=!0}if(C&&C.constructor===O)C.name=S.keyInfo.name,C.mergeOption(A,this),C.optionUpdated(A,!1);else{var k=ie({componentIndex:T},S.keyInfo);C=new O(A,this,this,k),ie(C,k),S.brandNew&&(C.__requireNewView=!0),C.init(A,this,this),C.optionUpdated(null,!0)}}C?(y.push(C.option),x.push(C),_++):(y.push(void 0),x.push(void 0))},this),i[f]=y,a.set(f,x),o.set(f,_),f==="series"&&D_(this)}this._seriesIndices||D_(this)},t.prototype.getOption=function(){var r=ke(this.option);return R(r,function(n,i){if(tt.hasClass(i)){for(var a=jt(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!Jy(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[u6],r},t.prototype.setTheme=function(r){this._theme=new it(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 MBe(e,t){return e.join(",")===t.join(",")}var Wa=R,i0=Ee,d6=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function xM(e){var t=e&&e.itemStyle;if(t)for(var r=0,n=d6.length;r0?r[o-1].seriesModel:null)}),jBe(r)}})}function jBe(e){R(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,f){var h=o.get(t.stackedDimension,f);if(isNaN(h))return i;var d,v;s?v=o.getRawIndex(f):d=o.get(t.stackedByDimension,f);for(var m=NaN,y=r-1;y>=0;y--){var x=e[y];if(s||(v=x.data.rawIndexOf(x.stackedByDimension,d)),v>=0){var _=x.data.getByRawIndex(x.stackResultDimension,v);if(l==="all"||l==="positive"&&_>0||l==="negative"&&_<0||l==="samesign"&&h>=0&&_>0||l==="samesign"&&h<=0&&_<0){h=_Re(h,_),m=_;break}}}return n[0]=h,n[1]=m,n})})}var EC=function(){function e(t){this.data=t.data||(t.sourceFormat===xo?{}:[]),this.sourceFormat=t.sourceFormat||aee,this.seriesLayoutBy=t.seriesLayoutBy||co,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=b)}d[0]=v,d[1]=m}},i=function(){return this._data?this._data.length/this._dimSize:0};_6=(t={},t[_n+"_"+co]={pure:!0,appendData:a},t[_n+"_"+nh]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[Ji]={pure:!0,appendData:a},t[xo]={pure:!0,appendData:function(o){var s=this._data;R(o,function(l,u){for(var c=s[u]||(s[u]=[]),f=0;f<(l||[]).length;f++)c.push(l[f])})}},t[Ki]={appendData:a},t[_u]={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 Cv(this.getData(r),t)},e.prototype.formatTooltip=function(t,r,n){},e}();function T6(e){var t,r;return Ee(e)?e.type&&(r=e):t=e,{text:t,frag:r}}function Dm(e){return new WBe(e)}var WBe=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 f;(this._dirty||a==="reset")&&(this._dirty=!1,f=this._doReset(n)),this._modBy=l,this._modDataCount=u;var h=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,v=Math.min(h!=null?this._dueIndex+h:1/0,this._dueEnd);if(!n&&(f||d1&&n>0?s:o}};return a;function o(){return t=e?null:lt},gte:function(e,t){return e>=t}},UBe=function(){function e(t,r){if(!ut(r)){var n="";bt(n)}this._opFn=bee[t],this._rvalFloat=as(r)}return e.prototype.evaluate=function(t){return ut(t)?this._opFn(t,this._rvalFloat):this._opFn(as(t),this._rvalFloat)},e}(),wee=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=ut(t)?t:as(t),i=ut(r)?r:as(r),a=isNaN(n),o=isNaN(i);if(a&&(n=this._incomparable),o&&(i=this._incomparable),a&&o){var s=me(t),l=me(r);s&&(n=l?t:0),l&&(i=s?r:0)}return ni?-this._resultLT:0},e}(),ZBe=function(){function e(t,r){this._rval=r,this._isEQ=t,this._rvalTypeof=typeof r,this._rvalFloat=as(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=as(t)===this._rvalFloat)}return this._isEQ?r:!r},e}();function YBe(e,t){return e==="eq"||e==="ne"?new ZBe(e==="eq",t):Se(bee,e)?new UBe(e,t):null}var XBe=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 bu(t,r)},e}();function qBe(e,t){var r=new XBe,n=e.data,i=r.sourceFormat=e.sourceFormat,a=e.startIndex,o="";e.seriesLayoutBy!==co&&bt(o);var s=[],l={},u=e.dimensionsDefine;if(u)R(u,function(m,y){var x=m.name,_={index:y,name:x,displayName:m.displayName};if(s.push(_),x!=null){var b="";Se(l,x)&&bt(b),l[x]=_}});else for(var c=0;c65535?ize:aze}function Ih(){return[1/0,-1/0]}function oze(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function M6(e,t,r,n,i){var a=Cee[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=le(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=f&&_<=h||isNaN(_))&&(l[u++]=m),m++}v=!0}else if(a===2){for(var y=d[i[0]],b=d[i[1]],S=t[i[1]][0],T=t[i[1]][1],x=0;x=f&&_<=h||isNaN(_))&&(C>=S&&C<=T||isNaN(C))&&(l[u++]=m),m++}v=!0}}if(!v)if(a===1)for(var x=0;x=f&&_<=h||isNaN(_))&&(l[u++]=A)}else for(var x=0;xt[k][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,f,h,d=new(Oh(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=u;for(var v=1;vc&&(c=f,h=S)}E>0&&Es&&(m=s-c);for(var y=0;yv&&(v=_,d=c+y)}var b=this.getRawIndex(f),S=this.getRawIndex(d);fc-v&&(l=c-v,s.length=l);for(var m=0;mf[1]&&(f[1]=x),h[d++]=_}return a._count=d,a._indices=h,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=f)}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 bu(r[a],this._dimensions[a])}wM={arrayRows:t,objectRows:function(r,n,i,a){return bu(r[n],this._dimensions[a])},keyedColumns:t,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return bu(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),e}(),Aee=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(R_(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=li(s)?_u:Ki,a=[];var f=this._getSourceMetaRawOption()||{},h=u&&u.metaRawOption||{},d=Ae(f.seriesLayoutBy,h.seriesLayoutBy)||null,v=Ae(f.sourceHeader,h.sourceHeader),m=Ae(f.dimensions,h.dimensions),y=d!==h.seriesLayoutBy||!!v!=!!h.sourceHeader||m;i=y?[wI(s,{seriesLayoutBy:d,sourceHeader:v,dimensions:m},l)]:[]}else{var x=t;if(n){var _=this._applyTransform(r);i=_.sourceList,a=_.upstreamSignList}else{var b=x.get("source",!0);i=[wI(b,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&&k6(a)}var o,s=[],l=[];return R(t,function(u){u.prepareSource();var c=u.getSource(i||0),f="";i!=null&&!c&&k6(f),s.push(c),l.push(u._getVersionSign())}),n?o=rze(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[RBe(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 R(e.blocks,function(i){var a=Lee(i);a>=t&&(t=a+ +(n&&(!a||TI(i)&&!i.noHeader)))}),t}return 0}function cze(e,t,r,n){var i=t.noHeader,a=hze(Lee(t)),o=[],s=t.blocks||[];Nn(!s||oe(s)),s=s||[];var l=e.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(Se(u,l)){var c=new wee(u[l],null);s.sort(function(m,y){return c.evaluate(m.sortParam,y.sortParam)})}else l==="seriesDesc"&&s.reverse()}R(s,function(m,y){var x=t.valueFormatter,_=kee(m)(x?ie(ie({},e),{valueFormatter:x}):e,m,y>0?a.html:0,n);_!=null&&o.push(_)});var f=e.renderMode==="richText"?o.join(a.richText):CI(n,o.join(""),i?r:a.html);if(i)return f;var h=yI(t.header,"ordinal",e.useUTC),d=Pee(n,e.renderMode).nameStyle,v=Mee(n);return e.renderMode==="richText"?Oee(e,h,d)+a.richText+f:CI(n,'
'+Yn(h)+"
"+f,r)}function fze(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=oe(S)?S:[S],le(S,function(T,C){return yI(T,oe(d)?d[C]:d,u)})};if(!(a&&o)){var f=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||J.color.secondary,i),h=a?"":yI(l,"ordinal",u),d=t.valueType,v=o?[]:c(t.value,t.dataIndex),m=!s||!a,y=!s&&a,x=Pee(n,i),_=x.nameStyle,b=x.valueStyle;return i==="richText"?(s?"":f)+(a?"":Oee(e,h,_))+(o?"":pze(e,v,m,y,b)):CI(n,(s?"":f)+(a?"":dze(h,!s,_))+(o?"":vze(v,m,y,b)),r)}}function L6(e,t,r,n,i,a){if(e){var o=kee(e),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:t,valueFormatter:e.valueFormatter};return o(s,e,0,a)}}function hze(e){return{html:lze[e],richText:uze[e]}}function CI(e,t,r){var n='
',i="margin: "+r+"px 0 0",a=Mee(e);return'
'+t+n+"
"}function dze(e,t,r){var n=t?"margin-left:2px":"";return''+Yn(e)+""}function vze(e,t,r,n){var i=r?"10px":"20px",a=t?"float:right;margin-left:"+i:"";return e=oe(e)?e:[e],''+le(e,function(o){return Yn(o)}).join("  ")+""}function Oee(e,t,r){return e.markupStyleCreator.wrapRichTextStyle(t,r)}function pze(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(oe(t)?t.join(" "):t,a)}function Iee(e,t){var r=e.getData().getItemVisual(t,"style"),n=r[e.visualDrawType];return $f(n)}function Eee(e,t){var r=e.get("padding");return r??(t==="richText"?[8,10]:10)}var SM=function(){function e(){this.richTextStyles={},this._nextStyleNameId=$J()}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=ZQ({color:r,type:t,renderMode:n,markerId:i});return me(a)?a:(this.richTextStyles[i]=a.style,a.content)},e.prototype.wrapRichTextStyle=function(t,r){var n={};oe(r)?R(r,function(a){return ie(n,a)}):ie(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},e}();function Nee(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=oe(s),u=Iee(t,r),c,f,h,d;if(o>1||l&&!o){var v=gze(s,t,r,a,u);c=v.inlineValues,f=v.inlineValueTypes,h=v.blocks,d=v.inlineValues[0]}else if(o){var m=i.getDimensionInfo(a[0]);d=c=Cv(i,r,a[0]),f=m.type}else d=c=l?s[0]:s;var y=hj(t),x=y&&t.name||"",_=i.getName(r),b=n?x:_;return zr("section",{header:x,noHeader:n||!y,sortParam:d,blocks:[zr("nameValue",{markerType:"item",markerColor:u,name:b,noName:!Fi(b),value:c,valueType:f,dataIndex:r})].concat(h||[])})}function gze(e,t,r,n,i){var a=t.getData(),o=La(e,function(f,h,d){var v=a.getDimensionInfo(d);return f=f||v&&v.tooltip!==!1&&v.displayName!=null},!1),s=[],l=[],u=[];n.length?R(n,function(f){c(Cv(a,r,f),f)}):R(e,c);function c(f,h){var d=a.getDimensionInfo(h);!d||d.otherDims.tooltip===!1||(o?u.push(zr("nameValue",{markerType:"subItem",markerColor:i,name:d.displayName,value:f,valueType:d.type})):(s.push(f),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var Pl=rt();function B_(e,t){return e.getName(t)||e.getId(t)}var t1="__universalTransitionEnabled",Ot=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=Dm({count:yze,reset:xze}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=Pl(this).sourceManager=new Aee(this);a.prepareSource();var o=this.getInitialData(r,i);I6(o,this),this.dataTask.context.data=o,Pl(this).dataBeforeProcessed=o,O6(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(r,n){var i=n0(this),a=i?rh(r):{},o=this.subType;tt.hasClass(o)&&(o+="Series"),Xe(r,n.getTheme().get(this.subType)),Xe(r,this.getDefaultOption()),Nf(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&ss(r,a,i)},t.prototype.mergeOption=function(r,n){r=Xe(this.option,r,!0),this.fillDataTextStyle(r.data);var i=n0(this);i&&ss(this.option,r,i);var a=Pl(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);I6(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Pl(this).dataBeforeProcessed=o,O6(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(r){if(r&&!li(r))for(var n=["show"],i=0;i=0&&h<0)&&(f=_,h=x,d=0),x===h&&(c[d++]=m))}),c.length=d,c},t.prototype.formatTooltip=function(r,n,i){return Nee({series:this,dataIndex:r,multipleSeries:n})},t.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(ot.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=Xj.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[B_(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[t1])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"){Ee(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,c=0;c0&&this._innerSelect(r,n)}},t.registerClass=function(r){return tt.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}(tt);br(Ot,NC);br(Ot,Xj);qJ(Ot,tt);function O6(e){var t=e.name;hj(e)||(e.name=mze(e)||t)}function mze(e){var t=e.getRawData(),r=t.mapDimensionsAll("seriesName"),n=[];return R(r,function(i){var a=t.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function yze(e){return e.model.getRawData().count()}function xze(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),_ze}function _ze(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function I6(e,t){R(yv(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(r){e.wrapMethod(r,Ue(bze,t))})}function bze(e,t){var r=AI(e);return r&&r.setOutputEnd((t||this).count()),t}function AI(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 Rt=function(){function e(){this.group=new Le,this.uid=vp("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}();vj(Rt);bC(Rt);function mp(){var e=rt();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 Dee=rt(),wze=mp(),At=function(){function e(){this.group=new Le,this.uid=vp("viewChart"),this.renderTask=Dm({plan:Sze,reset:Tze}),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&&N6(a,i,"emphasis")},e.prototype.downplay=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&N6(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){Uu(this.group,t)},e.markUpdateMethod=function(t,r){Dee(t).updateMethod=r},e.protoInitialize=function(){var t=e.prototype;t.type="chart"}(),e}();function E6(e,t,r){e&&e0(e)&&(t==="emphasis"?cl:fl)(e,r)}function N6(e,t,r){var n=Df(e,t),i=t&&t.highlightKey!=null?q3e(t.highlightKey):null;n!=null?R(jt(n),function(a){E6(e.getItemGraphicEl(a),r,i)}):e.eachItemGraphicEl(function(a){E6(a,r,i)})}vj(At);bC(At);function Sze(e){return wze(e.model)}function Tze(e){var t=e.model,r=e.ecModel,n=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&Dee(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,r,n,i),Cze[l]}var Cze={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)}}},lS="\0__throttleOriginMethod",D6="\0__throttleRate",j6="\0__throttleType";function jC(e,t,r){var n,i=0,a=0,o=null,s,l,u,c;t=t||0;function f(){a=new Date().getTime(),o=null,e.apply(l,u||[])}var h=function(){for(var d=[],v=0;v=0?f():o=setTimeout(f,-s),i=n};return h.clear=function(){o&&(clearTimeout(o),o=null)},h.debounceNextCall=function(d){c=d},h}function yp(e,t,r,n){var i=e[t];if(i){var a=i[lS]||i,o=i[j6],s=i[D6];if(s!==r||o!==n){if(r==null||!n)return e[t]=a;i=e[t]=jC(a,r,n==="debounce"),i[lS]=a,i[j6]=n,i[D6]=r}return i}}function a0(e,t){var r=e[t];r&&r[lS]&&(r.clear&&r.clear(),e[t]=r[lS])}var R6=rt(),B6={itemStyle:jf(BQ,!0),lineStyle:jf(RQ,!0)},Aze={lineStyle:"stroke",itemStyle:"fill"};function jee(e,t){var r=e.visualStyleMapper||B6[t];return r||(console.warn("Unknown style type '"+t+"'."),B6.itemStyle)}function Ree(e,t){var r=e.visualDrawType||Aze[t];return r||(console.warn("Unknown style type '"+t+"'."),"fill")}var Mze={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=e.getModel(n),a=jee(e,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=Ree(e,n),u=o[l],c=Pe(u)?u:null,f=o.fill==="auto"||o.stroke==="auto";if(!o[l]||c||f){var h=e.getColorFromPalette(e.name,null,t.getSeriesCount());o[l]||(o[l]=h,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||Pe(o.fill)?h:o.fill,o.stroke=o.stroke==="auto"||Pe(o.stroke)?h:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!t.isSeriesFiltered(e)&&c)return r.setVisual("colorFromPalette",!1),{dataEach:function(d,v){var m=e.getDataParams(v),y=ie({},o);y[l]=c(m),d.setItemVisual(v,"style",y)}}}},_g=new it,Pze={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=jee(e,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){_g.option=l[n];var u=i(_g),c=o.ensureUniqueItemVisual(s,"style");ie(c,u),_g.option.decal&&(o.setItemVisual(s,"decal",_g.option.decal),_g.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},kze={performRawSeries:!0,overallReset:function(e){var t=Ce();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)),R6(r).scope=a}}),e.eachSeries(function(r){if(!(r.isColorBySeries()||e.isSeriesFiltered(r))){var n=r.getRawData(),i={},a=r.getData(),o=R6(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=Ree(r,s);a.each(function(u){var c=a.getRawIndex(u);i[c]=u}),n.each(function(u){var c=i[u],f=a.getItemVisual(c,"colorFromPalette");if(f){var h=a.ensureUniqueItemVisual(c,"style"),d=n.getName(u)||u+"",v=n.count();h[l]=r.getColorFromPalette(d,o,v)}})}})}},z_=Math.PI;function Lze(e,t){t=t||{},Ie(t,{text:"loading",textColor:J.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:J.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var r=new Le,n=new Qe({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});r.add(n);var i=new lt({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 Qe({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 Y0({shape:{startAngle:-z_/2,endAngle:-z_/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:z_*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:z_*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 Bee=function(){function e(t,r,n,i){this._stageTaskMap=Ce(),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=Ce();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;R(this._allHandlers,function(i){var a=t.get(i.uid)||t.set(i.uid,{}),o="";Nn(!(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;R(t,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var c=o._stageTaskMap.get(l.uid),f=c.seriesTaskMap,h=c.overallTask;if(h){var d,v=h.agentStubMap;v.each(function(y){s(i,y)&&(y.dirty(),d=!0)}),d&&h.dirty(),o.updatePayload(h,n);var m=o.getPerformArgs(h,i.block);v.each(function(y){y.perform(m)}),h.perform(m)&&(a=!0)}else f&&f.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=Ce(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(c):l?n.eachRawSeriesByType(l,c):u&&u(n,i).each(c);function c(f){var h=f.uid,d=s.set(h,o&&o.get(h)||Dm({plan:Dze,reset:jze,count:Bze}));d.context={model:f,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:a},a._pipe(f,d)}},e.prototype._createOverallStageTask=function(t,r,n,i){var a=this,o=r.overallTask=r.overallTask||Dm({reset:Oze});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=Ce(),u=t.seriesType,c=t.getTargetSeries,f=!0,h=!1,d="";Nn(!t.createOnAllSeries,d),u?n.eachRawSeriesByType(u,v):c?c(n,i).each(v):(f=!1,R(n.getSeries(),v));function v(m){var y=m.uid,x=l.set(y,s&&s.get(y)||(h=!0,Dm({reset:Ize,onDirty:Nze})));x.context={model:m,overallProgress:f},x.agent=o,x.__block=f,a._pipe(m,x)}h&&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 Pe(t)&&(t={overallReset:t,seriesType:zze(t)}),t.uid=vp("stageHandler"),r&&(t.visualType=r),t},e}();function Oze(e){e.overallReset(e.ecModel,e.api,e.payload)}function Ize(e){return e.overallProgress&&Eze}function Eze(){this.agent.dirty(),this.getDownstream().dirty()}function Nze(){this.agent&&this.agent.dirty()}function Dze(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function jze(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=jt(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?le(t,function(r,n){return zee(n)}):Rze}var Rze=zee(0);function zee(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-h.length){var v=u.slice(0,d);v!=="data"&&(r.mainType=v,r[h.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(f,h,d,v){return f[d]==null||h[v||d]===f[d]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),MI=["symbol","symbolSize","symbolRotate","symbolOffset"],$6=MI.concat(["symbolKeepAspect"]),Vze={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&&lf(l)?l:.5;var u=e.createRadialGradient(o,s,0,o,s,l);return u}function PI(e,t,r){for(var n=t.type==="radial"?n4e(e,t,r):r4e(e,t,r),i=t.colorStops,a=0;a0)?null:e==="dashed"?[4*t,2*t]:e==="dotted"?[t]:ut(e)?[e]:oe(e)?e:null}function rR(e){var t=e.style,r=t.lineDash&&t.lineWidth>0&&a4e(t.lineDash,t.lineWidth),n=t.lineDashOffset;if(r){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(r=le(r,function(a){return a/i}),n/=i)}return[r,n]}var o4e=new os(!0);function fS(e){var t=e.stroke;return!(t==null||t==="none"||!(e.lineWidth>0))}function F6(e){return typeof e=="string"&&e!=="none"}function hS(e){var t=e.fill;return t!=null&&t!=="none"}function V6(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 G6(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 kI(e,t,r){var n=pj(t.image,t.__image,r);if(wC(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)*Tm),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function s4e(e,t,r,n){var i,a=fS(r),o=hS(r),s=r.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var c=t.path||o4e,f=t.__dirty;if(!n){var h=r.fill,d=r.stroke,v=o&&!!h.colorStops,m=a&&!!d.colorStops,y=o&&!!h.image,x=a&&!!d.image,_=void 0,b=void 0,S=void 0,T=void 0,C=void 0;(v||m)&&(C=t.getBoundingRect()),v&&(_=f?PI(e,h,C):t.__canvasFillGradient,t.__canvasFillGradient=_),m&&(b=f?PI(e,d,C):t.__canvasStrokeGradient,t.__canvasStrokeGradient=b),y&&(S=f||!t.__canvasFillPattern?kI(e,h,t):t.__canvasFillPattern,t.__canvasFillPattern=S),x&&(T=f||!t.__canvasStrokePattern?kI(e,d,t):t.__canvasStrokePattern,t.__canvasStrokePattern=T),v?e.fillStyle=_:y&&(S?e.fillStyle=S:o=!1),m?e.strokeStyle=b:x&&(T?e.strokeStyle=T:a=!1)}var A=t.getGlobalScale();c.setScale(A[0],A[1],t.segmentIgnoreThreshold);var P,O;e.setLineDash&&r.lineDash&&(i=rR(t),P=i[0],O=i[1]);var k=!0;(u||f&Kh)&&(c.setDPR(e.dpr),l?c.setContext(null):(c.setContext(e),k=!1),c.reset(),t.buildPath(c,t.shape,n),c.toStatic(),t.pathUpdated()),k&&c.rebuildPath(e,l?s:1),P&&(e.setLineDash(P),e.lineDashOffset=O),n||(r.strokeFirst?(a&&G6(e,r),o&&V6(e,r)):(o&&V6(e,r),a&&G6(e,r))),P&&e.setLineDash([])}function l4e(e,t,r){var n=t.__image=pj(r.image,t.__image,t,t.onload);if(!(!n||!wC(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,f=o-u,h=s-c;e.drawImage(n,u,c,f,h,i,a,o,s)}else e.drawImage(n,i,a,o,s)}}function u4e(e,t,r){var n,i=r.text;if(i!=null&&(i+=""),i){e.font=r.font||ll,e.textAlign=r.textAlign,e.textBaseline=r.textBaseline;var a=void 0,o=void 0;e.setLineDash&&r.lineDash&&(n=rR(t),a=n[0],o=n[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),r.strokeFirst?(fS(r)&&e.strokeText(i,r.x,r.y),hS(r)&&e.fillText(i,r.x,r.y)):(hS(r)&&e.fillText(i,r.x,r.y),fS(r)&&e.strokeText(i,r.x,r.y)),a&&e.setLineDash([])}}var W6=["shadowBlur","shadowOffsetX","shadowOffsetY"],H6=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function Hee(e,t,r,n,i){var a=!1;if(!n&&(r=r||{},t===r))return!1;if(n||t.opacity!==r.opacity){yi(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?gf.opacity:o}(n||t.blend!==r.blend)&&(a||(yi(e,i),a=!0),e.globalCompositeOperation=t.blend||gf.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[Vr]){if(this._disposed){this.id;return}var a,o,s;if(Ee(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[Vr]=!0,jh(this),!this._model||n){var l=new SBe(this._api),u=this._theme,c=this._model=new qj;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},EI);var f={seriesTransition:s,optionChanged:!0};if(i)this[hn]={silent:a,updateParams:f},this[Vr]=!1,this.getZr().wakeUp();else{try{Mc(this),As.update.call(this,null,f)}catch(h){throw this[hn]=null,this[Vr]=!1,h}this._ssr||this._zr.flush(),this[hn]=null,this[Vr]=!1,Nh.call(this,a),Dh.call(this,a)}}},t.prototype.setTheme=function(r,n){if(!this[Vr]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,o=null;this[hn]&&(a==null&&(a=this[hn].silent),o=this[hn].updateParams,this[hn]=null),this[Vr]=!0,jh(this);try{this._updateTheme(r),i.setTheme(this._theme),Mc(this),As.update.call(this,{type:"setTheme"},o)}catch(s){throw this[Vr]=!1,s}this[Vr]=!1,Nh.call(this,a),Dh.call(this,a)}}},t.prototype._updateTheme=function(r){me(r)&&(r=cte[r]),r&&(r=ke(r),r&&dee(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||ot.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 R(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;R(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 R(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(gS[i]){var l=s,u=s,c=-s,f=-s,h=[],d=r&&r.pixelRatio||this.getDevicePixelRatio();R(xf,function(b,S){if(b.group===i){var T=n?b.getZr().painter.getSvgDom().innerHTML:b.renderToCanvas(ke(r)),C=b.getDom().getBoundingClientRect();l=a(C.left,l),u=a(C.top,u),c=o(C.right,c),f=o(C.bottom,f),h.push({dom:T,left:C.left,top:C.top})}}),l*=d,u*=d,c*=d,f*=d;var v=c-l,m=f-u,y=Ci.createCanvas(),x=KO(y,{renderer:n?"svg":"canvas"});if(x.resize({width:v,height:m}),n){var _="";return R(h,function(b){var S=b.left-l,T=b.top-u;_+=''+b.dom+""}),x.painter.getSvgRoot().innerHTML=_,r.connectedBackgroundColor&&x.painter.setBackgroundColor(r.connectedBackgroundColor),x.refreshImmediately(),x.painter.toDataURL()}else return r.connectedBackgroundColor&&x.add(new Qe({shape:{x:0,y:0,width:v,height:m},style:{fill:r.connectedBackgroundColor}})),R(h,function(b){var S=new un({style:{x:b.left*d-l,y:b.top*d-u,image:b.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 G_(this,"convertToPixel",r,n,i)},t.prototype.convertToLayout=function(r,n,i){return G_(this,"convertToLayout",r,n,i)},t.prototype.convertFromPixel=function(r,n,i){return G_(this,"convertFromPixel",r,n,i)},t.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=jd(i,r);return R(o,function(s,l){l.indexOf("Models")>=0&&R(s,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)a=a||!!c.containPoint(n);else if(l==="seriesModels"){var f=this._chartsMap[u.__viewId];f&&f.containPoint&&(a=a||f.containPoint(n,u))}},this)},this),!!a},t.prototype.getVisual=function(r,n){var i=this._model,a=jd(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?tR(s,l,n):Q0(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;R(D4e,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,c=i==="globalout";if(c?u={}:l&&sf(l,function(m){var y=Be(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=ie({},y.eventData),!0},!0),u){var f=u.componentType,h=u.componentIndex;(f==="markLine"||f==="markPoint"||f==="markArea")&&(f="series",h=u.seriesIndex);var d=f&&h!=null&&s.getComponent(f,h),v=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:v},r.trigger(i,u)}};a.zrEventfulCallAtLast=!0,r._zr.on(i,a,r)});var n=this._messageCenter;R(OI,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),Wze(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&&ZJ(this.getDom(),oR,"");var n=this,i=n._api,a=n._model;R(n._componentsViews,function(o){o.dispose(a,i)}),R(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 xf[n.id]},t.prototype.resize=function(r){if(!this[Vr]){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[hn]&&(a==null&&(a=this[hn].silent),i=!0,this[hn]=null),this[Vr]=!0,jh(this);try{i&&Mc(this),As.update.call(this,{type:"resize",animation:ie({duration:0},r&&r.animation)})}catch(o){throw this[Vr]=!1,o}this[Vr]=!1,Nh.call(this,a),Dh.call(this,a)}}},t.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(Ee(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!NI[r]){var i=NI[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=ie({},r);return n.type=LI[r.type],n},t.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(Ee(n)||(n={silent:!!n}),!!vS[r.type]&&this._model){if(this[Vr]){this._pendingActions.push(r);return}var i=n.silent;kM.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&ot.browser.weChat&&this._throttledZrFlush(),Nh.call(this,i),Dh.call(this,i)}},t.prototype.updateLabelLayout=function(){Ya.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(){Mc=function(f){var h=f._scheduler;h.restorePipelines(f._model),h.prepareStageTasks(),MM(f,!0),MM(f,!1),h.plan()},MM=function(f,h){for(var d=f._model,v=f._scheduler,m=h?f._componentsViews:f._chartsViews,y=h?f._componentsMap:f._chartsMap,x=f._zr,_=f._api,b=0;bh.get("hoverLayerThreshold")&&!ot.node&&!ot.worker&&h.eachSeries(function(y){if(!y.preventUsingHoverLayer){var x=f._chartsMap[y.__viewId];x.__alive&&x.eachRendered(function(_){_.states.emphasis&&(_.states.emphasis.hoverLayer=!0)})}})}function s(f,h){var d=f.get("blendMode")||null;h.eachRendered(function(v){v.isGroup||(v.style.blend=d)})}function l(f,h){if(!f.preventAutoZ){var d=zf(f);h.eachRendered(function(v){return LC(v,d.z,d.zlevel),!0})}}function u(f,h){h.eachRendered(function(d){if(!Rd(d)){var v=d.getTextContent(),m=d.getTextGuideLine();d.stateTransition&&(d.stateTransition=null),v&&v.stateTransition&&(v.stateTransition=null),m&&m.stateTransition&&(m.stateTransition=null),d.hasState()?(d.prevStates=d.currentStates,d.clearStates()):d.prevStates&&(d.prevStates=null)}})}function c(f,h){var d=f.getModel("stateAnimation"),v=f.isAnimationEnabled(),m=d.get("duration"),y=m>0?{duration:m,delay:d.get("delay"),easing:d.get("easing")}:null;h.eachRendered(function(x){if(x.states&&x.states.emphasis){if(Rd(x))return;if(x instanceof at&&K3e(x),x.__dirty){var _=x.prevStates;_&&x.useStates(_)}if(v){x.stateTransition=y;var b=x.getTextContent(),S=x.getTextGuideLine();b&&(b.stateTransition=y),S&&(S.stateTransition=y)}x.__dirty&&a(x)}})}iG=function(f){return new(function(h){q(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return f._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(v){for(;v;){var m=v.__ecComponentInfo;if(m!=null)return f._model.getComponent(m.mainType,m.index);v=v.parent}},d.prototype.enterEmphasis=function(v,m){cl(v,m),oa(f)},d.prototype.leaveEmphasis=function(v,m){fl(v,m),oa(f)},d.prototype.enterBlur=function(v){fQ(v),oa(f)},d.prototype.leaveBlur=function(v){bj(v),oa(f)},d.prototype.enterSelect=function(v){hQ(v),oa(f)},d.prototype.leaveSelect=function(v){dQ(v),oa(f)},d.prototype.getModel=function(){return f.getModel()},d.prototype.getViewOfComponentModel=function(v){return f.getViewOfComponentModel(v)},d.prototype.getViewOfSeriesModel=function(v){return f.getViewOfSeriesModel(v)},d.prototype.getMainProcessVersion=function(){return f[F_]},d}(fee))(f)},ute=function(f){function h(d,v){for(var m=0;m=0)){oG.push(r);var a=Bee.wrapStageHandler(r,i);a.__prio=t,a.__raw=r,e.push(a)}}function hR(e,t){NI[e]=t}function H4e(e){JK({createCanvas:e})}function gte(e,t,r){var n=Kee("registerMap");n&&n(e,t,r)}function U4e(e){var t=Kee("getMap");return t&&t(e)}var mte=tze;Yu(iR,Mze);Yu(RC,Pze);Yu(RC,kze);Yu(iR,Vze);Yu(RC,Gze);Yu(rte,m4e);uR(dee);cR(T4e,DBe);hR("default",Lze);_o({type:mf,event:mf,update:mf},yr);_o({type:Xb,event:Xb,update:Xb},yr);_o({type:tS,event:xj,update:tS,action:yr,refineEvent:dR,publishNonRefinedEvent:!0});_o({type:sI,event:xj,update:sI,action:yr,refineEvent:dR,publishNonRefinedEvent:!0});_o({type:rS,event:xj,update:rS,action:yr,refineEvent:dR,publishNonRefinedEvent:!0});function dR(e,t,r,n){return{eventContent:{selected:U3e(r),isFromClick:t.isFromClick||!1}}}lR("default",{});lR("dark",Vee);var Z4e={},sG=[],Y4e={registerPreprocessor:uR,registerProcessor:cR,registerPostInit:hte,registerPostUpdate:dte,registerUpdateLifecycle:BC,registerAction:_o,registerCoordinateSystem:vte,registerLayout:pte,registerVisual:Yu,registerTransform:mte,registerLoading:hR,registerMap:gte,registerImpl:y4e,PRIORITY:nte,ComponentModel:tt,ComponentView:Rt,SeriesModel:Ot,ChartView:At,registerComponentModel:function(e){tt.registerClass(e)},registerComponentView:function(e){Rt.registerClass(e)},registerSeriesModel:function(e){Ot.registerClass(e)},registerChartView:function(e){At.registerClass(e)},registerCustomSeries:function(e,t){Qee(e,t)},registerSubTypeDefaulter:function(e,t){tt.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){EJ(e,t)}};function Ke(e){if(oe(e)){R(e,function(t){Ke(t)});return}Ye(sG,e)>=0||(sG.push(e),Pe(e)&&(e={install:e}),e.install(Y4e))}function wg(e){return e==null?0:e.length||1}function lG(e){return e}var hl=function(){function e(t,r,n,i,a,o){this._old=t,this._new=r,this._oldKeyGetter=n||lG,this._newKeyGetter=i||lG,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&&h===1)this._updateManyToOne&&this._updateManyToOne(c,u),i[l]=null;else if(f===1&&h>1)this._updateOneToMany&&this._updateOneToMany(c,u),i[l]=null;else if(f===1&&h===1)this._update&&this._update(c,u),i[l]=null;else if(f>1&&h>1)this._updateManyToMany&&this._updateManyToMany(c,u),i[l]=null;else if(f>1)for(var d=0;d1)for(var s=0;s30}var Sg=Ee,kl=le,e$e=typeof Int32Array>"u"?Array:Int32Array,t$e="e\0\0",uG=-1,r$e=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],n$e=["_approximateExtent"],cG,H_,Tg,Cg,IM,Ag,EM,qn=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;xte(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===Ki;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),oe(a)?a=a.slice():Sg(a)&&(a=ie({},a)),i[r]=a),a},e.prototype.setItemVisual=function(t,r,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,Sg(r)?ie(i,r):i[r]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(t,r){Sg(t)?ie(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?ie(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;oI(n,this.dataType,t,r),this._graphicEls[t]=r},e.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},e.prototype.eachItemGraphicEl=function(t,r){R(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:kl(this.dimensions,this._getDimInfo,this),this.hostModel)),IM(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(t,r){var n=this[t];Pe(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var i=n.apply(this,arguments);return r.apply(this,[i].concat(vC(arguments)))})},e.internalField=function(){cG=function(t){var r=t._invertedIndicesMap;R(r,function(n,i){var a=t._dimInfos[i],o=a.ordinalMeta,s=t._store;if(o){n=r[i]=new e$e(o.categories.length);for(var l=0;l1&&(l+="__ec__"+c),i[r]=l}}}(),e}();function i$e(e,t){return _p(e,t).dimensions}function _p(e,t){Kj(e)||(e=Jj(e)),t=t||{};var r=t.coordDimensions||[],n=t.dimensionsDefine||e.dimensionsDefine||[],i=Ce(),a=[],o=o$e(e,r,n,t.dimensionsCount),s=t.canOmitUnusedDimensions&&wte(o),l=n===e.dimensionsDefine,u=l?bte(e):_te(n),c=t.encodeDefine;!c&&t.encodeDefaulter&&(c=t.encodeDefaulter(e,o));for(var f=Ce(c),h=new Tee(o),d=0;d0&&(n.name=i+(a-1)),a++,t.set(i,a)}}function o$e(e,t,r,n){var i=Math.max(e.dimensionsDetectedCount||1,t.length,r.length,n||0);return R(t,function(a){var o;Ee(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function s$e(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 l$e=function(){function e(t){this.coordSysDims=[],this.axisMap=Ce(),this.categoryAxisMap=Ce(),this.coordSysName=t}return e}();function u$e(e){var t=e.get("coordinateSystem"),r=new l$e(t),n=c$e[t];if(n)return n(e,r,r.axisMap,r.categoryAxisMap),r}var c$e={cartesian2d:function(e,t,r,n){var i=e.getReferringComponents("xAxis",fr).models[0],a=e.getReferringComponents("yAxis",fr).models[0];t.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),Rh(i)&&(n.set("x",i),t.firstCategoryDimIndex=0),Rh(a)&&(n.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,r,n){var i=e.getReferringComponents("singleAxis",fr).models[0];t.coordSysDims=["single"],r.set("single",i),Rh(i)&&(n.set("single",i),t.firstCategoryDimIndex=0)},polar:function(e,t,r,n){var i=e.getReferringComponents("polar",fr).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),Rh(a)&&(n.set("radius",a),t.firstCategoryDimIndex=0),Rh(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();R(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),c=o[l];r.set(c,u),Rh(u)&&(n.set(c,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})},matrix:function(e,t,r,n){var i=e.getReferringComponents("matrix",fr).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 Rh(e){return e.get("type")==="category"}function Ste(e,t,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;f$e(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(e&&e.get("stack")),u,c,f,h;if(R(a,function(_,b){me(_)&&(a[b]=_={name:_}),l&&!_.isExtraCoord&&(!n&&!u&&_.ordinalMeta&&(u=_),!c&&_.type!=="ordinal"&&_.type!=="time"&&(!i||i===_.coordDim)&&(c=_))}),c&&!n&&!u&&(n=!0),c){f="__\0ecstackresult_"+e.id,h="__\0ecstackedover_"+e.id,u&&(u.createInvertedIndices=!0);var d=c.coordDim,v=c.type,m=0;R(a,function(_){_.coordDim===d&&m++});var y={name:f,coordDim:d,coordDimIndex:m,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},x={name:h,coordDim:h,coordDimIndex:m+1,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(y.storeDimIndex=s.ensureCalculationDimension(h,v),x.storeDimIndex=s.ensureCalculationDimension(f,v)),o.appendCalculationDimension(y),o.appendCalculationDimension(x)):(a.push(y),a.push(x))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:h,stackResultDimension:f}}function f$e(e){return!xte(e.schema)}function dl(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function vR(e,t){return dl(e,t)?e.getCalculationInfo("stackResultDimension"):t}function h$e(e,t){var r=e.get("coordinateSystem"),n=gp.get(r),i;return t&&t.coordSysDims&&(i=le(t.coordSysDims,function(a){var o={name:a},s=t.axisMap.get(a);if(s){var l=s.get("type");o.type=mS(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function d$e(e,t,r){var n,i;return r&&R(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 vs(e,t,r){r=r||{};var n=t.getSourceManager(),i,a=!1;e?(a=!0,i=Jj(e)):(i=n.getSource(),a=i.sourceFormat===Ki);var o=u$e(t),s=h$e(t,o),l=r.useEncodeDefaulter,u=Pe(l)?l:l?Ue(see,s,t):null,c={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},f=_p(i,c),h=d$e(f.dimensions,r.createInvertedIndices,o),d=a?null:n.getSharedDataStore(f),v=Ste(t,{schema:f,store:d}),m=new qn(f,t);m.setCalculationInfo(v);var y=h!=null&&v$e(i)?function(x,_,b,S){return S===h?b:this.defaultDimValueGetter(x,_,b,S)}:null;return m.hasItemOption=!1,m.initData(a?i:d,null,y),m}function v$e(e){if(e.sourceFormat===Ki){var t=p$e(e.data||[]);return!oe(op(t))}}function p$e(e){for(var t=0;ti&&(o=a.interval=i);var s=a.intervalPrecision=l0(o),l=a.niceTickExtent=[Mr(Math.ceil(e[0]/o)*o,s),Mr(Math.floor(e[1]/o)*o,s)];return m$e(l,e),a}function NM(e){var t=Math.pow(10,_C(e)),r=e/t;return r?r===2?r=3:r===3?r=5:r*=2:r=1,Mr(r*t)}function l0(e){return no(e)+2}function fG(e,t,r){e[t]=Math.max(Math.min(e[t],r[1]),r[0])}function m$e(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),fG(e,0,t),fG(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function pR(e,t){return e>=t[0]&&e<=t[1]}var y$e=function(){function e(){this.normalize=hG,this.scale=dG}return e.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=xe(t.normalize,t),this.scale=xe(t.scale,t)):(this.normalize=hG,this.scale=dG)},e}();function hG(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function dG(e,t){return e*(t[1]-t[0])+t[0]}function jI(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 Xu=function(){function e(t){this._calculator=new y$e,this._setting=t||{},this._extent=[1/0,-1/0];var r=Rr();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=Rr();r&&this._innerSetBreak(r.parseAxisBreakOption(t,xe(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}();bC(Xu);var x$e=0,u0=function(){function e(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++x$e,this._onCollect=t.onCollect}return e.createByAxisModel=function(t){var r=t.option,n=r.data,i=n&&le(n,_$e);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(!me(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=Ce(this.categories))},e}();function _$e(e){return Ee(e)&&e.value!=null?e.value:e+""}var Mv=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 u0({})),oe(i)&&(i=new u0({categories:le(i,function(a){return Ee(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:me(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},t.prototype.contain=function(r){return pR(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}(Xu);Xu.registerClass(Mv);var Ll=Mr,vl=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 pR(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=l0(r)},t.prototype.getTicks=function(r){r=r||{};var n=this._interval,i=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=Rr(),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&&(f=Ll(f+h*n,o))}if(l.length>0&&f===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:Ll(d+n,o)}):l.push({value:i[1]})),s&&s.pruneTicksByBreak(r.pruneByBreak,l,this._brkCtx.breaks,function(v){return v.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]&&v0&&(a=a===null?s:Math.min(a,s))}r[n]=a}}return r}function Mte(e){var t=S$e(e),r=[];return R(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]),f=a.scale.getExtent(),h=Math.abs(f[1]-f[0]);s=u?c/h*u:c}else{var d=n.getData();s=Math.abs(o[1]-o[0])/d.count()}var v=ge(n.get("barWidth"),s),m=ge(n.get("barMaxWidth"),s),y=ge(n.get("barMinWidth")||(Ite(n)?.5:1),s),x=n.get("barGap"),_=n.get("barCategoryGap"),b=n.get("defaultBarGap");r.push({bandWidth:s,barWidth:v,barMaxWidth:m,barMinWidth:y,barGap:x,barCategoryGap:_,defaultBarGap:b,axisKey:gR(a),stackId:Cte(n)})}),Pte(r)}function Pte(e){var t={};R(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 f=n.barMaxWidth;f&&(l[u].maxWidth=f);var h=n.barMinWidth;h&&(l[u].minWidth=h);var d=n.barGap;d!=null&&(s.gap=d);var v=n.barCategoryGap;v!=null&&(s.categoryGap=v)});var r={};return R(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=st(a).length;s=Math.max(35-l*4,15)+"%"}var u=ge(s,o),c=ge(n.gap,1),f=n.remainedWidth,h=n.autoWidthCount,d=(f-u)/(h+(h-1)*c);d=Math.max(d,0),R(a,function(x){var _=x.maxWidth,b=x.minWidth;if(x.width){var S=x.width;_&&(S=Math.min(S,_)),b&&(S=Math.max(S,b)),x.width=S,f-=S+c*S,h--}else{var S=d;_&&_S&&(S=b),S!==d&&(x.width=S,f-=S+c*S,h--)}}),d=(f-u)/(h+(h-1)*c),d=Math.max(d,0);var v=0,m;R(a,function(x,_){x.width||(x.width=d),m=x,v+=x.width*(1+c)}),m&&(v-=m.width*c);var y=-v/2;R(a,function(x,_){r[i][_]=r[i][_]||{bandWidth:o,offset:y,width:x.width},y+=x.width*(1+c)})}),r}function T$e(e,t,r){if(e&&t){var n=e[gR(t)];return n}}function kte(e,t){var r=Ate(e,t),n=Mte(r);R(r,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=Cte(i),u=n[gR(s)][l],c=u.offset,f=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:f})})}function Lte(e){return{seriesType:e,plan:mp(),reset:function(t){if(Ote(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"),f=dl(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),h=a.isHorizontal(),d=C$e(i,a),v=Ite(t),m=t.get("barMinHeight")||0,y=c&&r.getDimensionIndex(c),x=r.getLayout("size"),_=r.getLayout("offset");return{progress:function(b,S){for(var T=b.count,C=v&&Wo(T*3),A=v&&l&&Wo(T*3),P=v&&Wo(T),O=n.master.getRect(),k=h?O.width:O.height,E,N=S.getStore(),D=0;(E=b.next())!=null;){var z=N.get(f?y:o,E),V=N.get(s,E),F=d,$=void 0;f&&($=+z-N.get(o,E));var B=void 0,H=void 0,U=void 0,Z=void 0;if(h){var Y=n.dataToPoint([z,V]);if(f){var K=n.dataToPoint([$,V]);F=K[0]}B=F,H=Y[1]+_,U=Y[0]-F,Z=x,Math.abs(U)0?r:1:r))}var A$e=function(e,t,r,n){for(;r>>1;e[i][1]i&&(this._approxInterval=i);var o=U_.length,s=Math.min(A$e(U_,this._approxInterval,0,o),o-1);this._interval=U_[s][1],this._intervalPrecision=l0(this._interval),this._minLevelUnit=U_[Math.max(s-1,0)][0]},t.prototype.parse=function(r){return ut(r)?r:+hs(r)},t.prototype.contain=function(r){return pR(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}(vl),U_=[["second",Dj],["minute",jj],["hour",Em],["quarter-day",Em*6],["half-day",Em*12],["day",ya*1.2],["half-week",ya*3.5],["week",ya*7],["month",ya*31],["quarter",ya*95],["half-year",n6/2],["year",n6]];function Ete(e,t,r,n){return oS(new Date(t),e,n).getTime()===oS(new Date(r),e,n).getTime()}function M$e(e,t){return e/=ya,e>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function P$e(e){var t=30*ya;return e/=t,e>6?6:e>3?3:e>2?2:1}function k$e(e){return e/=Em,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function vG(e,t){return e/=t?jj:Dj,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function L$e(e){return cj(e,!0)}function O$e(e,t,r){var n=Math.max(0,Ye(Di,t)-1);return oS(new Date(e),Di[n],r).getTime()}function I$e(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 E$e(e,t,r,n,i,a){var o=1e4,s=H5e,l=0;function u(D,z,V,F,$,B,H){for(var U=I$e($,D),Z=z,Y=new Date(Z);Zo));)if(Y[$](Y[F]()+D),Z=Y.getTime(),a){var K=a.calcNiceTickMultiple(Z,U);K>0&&(Y[$](Y[F]()+K*D),Z=Y.getTime())}H.push({value:Z,notAdd:!0})}function c(D,z,V){var F=[],$=!z.length;if(!Ete(Nm(D),n[0],n[1],r)){$&&(z=[{value:O$e(n[0],D,r)},{value:n[1]}]);for(var B=0;B=n[0]&&H<=n[1]&&u(Z,H,U,Y,K,te,F),D==="year"&&V.length>1&&B===0&&V.unshift({value:V[0].value-Z})}}for(var B=0;B=n[0]&&S<=n[1]&&d++)}var T=i/t;if(d>T*1.5&&v>T/1.5||(f.push(_),d>T||e===s[m]))break}h=[]}}}for(var C=gt(le(f,function(D){return gt(D,function(z){return z.value>=n[0]&&z.value<=n[1]&&!z.notAdd})}),function(D){return D.length>0}),A=[],P=C.length-1,m=0;m0;)a*=10;var s=[BI(D$e(n[0]/a)*a),BI(N$e(n[1]/a)*a)];this._interval=a,this._intervalPrecision=l0(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=Y_(r)/Y_(this.base),e.prototype.contain.call(this,r)},t.prototype.normalize=function(r){return r=Y_(r)/Y_(this.base),e.prototype.normalize.call(this,r)},t.prototype.scale=function(r){return r=e.prototype.scale.call(this,r),Z_(this.base,r)},t.prototype.setBreaksFromOption=function(r){var n=Rr();if(n){var i=n.logarithmicParseBreaksFromOption(r,this.base,xe(this.parse,this)),a=i.parsedOriginal,o=i.parsedLogged;this._originalScale._innerSetBreak(a),this._innerSetBreak(o)}},t.type="log",t}(vl);function X_(e,t){return BI(e,no(t))}Xu.registerClass(Nte);var j$e=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 h=this._determinedMin,d=this._determinedMax;return h!=null&&(s=h,u=!0),d!=null&&(l=d,c=!0),{min:s,max:l,minFixed:u,maxFixed:c,isBlank:f}},e.prototype.modifyDataMinMax=function(t,r){this[B$e[t]]=r},e.prototype.setDeterminedMinMax=function(t,r){var n=R$e[t];this[n]=r},e.prototype.freeze=function(){this.frozen=!0},e}(),R$e={min:"_determinedMin",max:"_determinedMax"},B$e={min:"_dataMin",max:"_dataMax"};function Dte(e,t,r){var n=e.rawExtentInfo;return n||(n=new j$e(e,t,r),e.rawExtentInfo=n,n)}function q_(e,t){return t==null?null:On(t)?NaN:e.parse(t)}function jte(e,t){var r=e.type,n=Dte(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=Ate("bar",o),l=!1;if(R(s,function(f){l=l||f.getBaseAxis()===t.axis}),l){var u=Mte(s),c=z$e(i,a,t,u);i=c.min,a=c.max}}return{extent:[i,a],fixMin:n.minFixed,fixMax:n.maxFixed}}function z$e(e,t,r,n){var i=r.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=T$e(n,r.axis);if(o===void 0)return{min:e,max:t};var s=1/0;R(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;R(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,f=1-(s+l)/a,h=c/f-c;return t+=h*(l/u),e-=h*(s/u),{min:e,max:t}}function Ff(e,t){var r=t,n=jte(e,r),i=n.extent,a=r.get("splitNumber");e instanceof Nte&&(e.base=r.get("logBase"));var o=e.type,s=r.get("interval"),l=o==="interval"||o==="time";e.setBreaksFromOption(Bte(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 ex(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new Mv({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new mR({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(Xu.getClass(t)||vl)}}function $$e(e){var t=e.scale.getExtent(),r=t[0],n=t[1];return!(r>0&&n>0||r<0&&n<0)}function bp(e){var t=e.getLabelModel().get("formatter");if(e.type==="time"){var r=U5e(t);return function(i,a){return e.scale.getFormattedLabel(i,a,r)}}else{if(me(t))return function(i){var a=e.scale.getLabel(i),o=t.replace("{value}",a??"");return o};if(Pe(t)){if(e.type==="category")return function(i,a){return t(yS(e,i),i.value-e.scale.getExtent()[0],null)};var n=Rr();return function(i,a){var o=null;return n&&(o=n.makeAxisLabelFormatterParamBreak(o,i.break)),t(yS(e,i),a,o)}}else return function(i){return e.scale.getLabel(i)}}}function yS(e,t){return e.type==="category"?e.scale.getLabel(t):t.value}function yR(e){var t=e.get("interval");return t??"auto"}function Rte(e){return e.type==="category"&&yR(e.getLabelModel())===0}function xS(e,t){var r={};return R(e.mapDimensionsAll(t),function(n){r[vR(e,n)]=!0}),st(r)}function F$e(e,t,r){t&&R(xS(t,r),function(n){var i=t.getApproximateExtent(n);i[0]e[1]&&(e[1]=i[1])})}function Pv(e){return e==="middle"||e==="center"}function c0(e){return e.getShallow("show")}function Bte(e){var t=e.get("breaks",!0);if(t!=null)return!Rr()||!V$e(e.axis)?void 0:t}function V$e(e){return(e.dim==="x"||e.dim==="y"||e.dim==="z"||e.dim==="single")&&e.type!=="category"}var wp=function(){function e(){}return e.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},e.prototype.getCoordSysModel=function(){},e}();function G$e(e){return vs(null,e)}var W$e={isDimensionStacked:dl,enableDataStack:Ste,getStackedDimension:vR};function H$e(e,t){var r=t;t instanceof it||(r=new it(t));var n=ex(r);return n.setExtent(e[0],e[1]),Ff(n,r),n}function U$e(e){br(e,wp)}function Z$e(e,t){return t=t||{},Dt(e,null,null,t.state!=="normal")}const Y$e=Object.freeze(Object.defineProperty({__proto__:null,createDimensions:i$e,createList:G$e,createScale:H$e,createSymbol:Lr,createTextStyle:Z$e,dataStack:W$e,enableHoverEmphasis:yu,getECData:Be,getLayoutRect:Zt,mixinAxisModelCommonMethods:U$e},Symbol.toStringTag,{value:"Module"}));var X$e=1e-8;function pG(e,t){return Math.abs(e-t)i&&(n=o,i=l)}if(n)return K$e(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 R(o,function(s){s.type==="polygon"?gG(s.exterior,i,a,r):R(s.points,function(l){gG(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 je(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 zI(e,t){return e=Q$e(e),le(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 mG(o[0],o.slice(1)));break;case"MultiPolygon":R(i.coordinates,function(l){l[0]&&a.push(new mG(l[0],l.slice(1)))});break;case"LineString":a.push(new yG([i.coordinates]));break;case"MultiLineString":a.push(new yG(i.coordinates))}var s=new $te(n[t||"name"],a,n.cp);return s.properties=n,s})}const eFe=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:QO,asc:Vi,getPercentWithPrecision:xRe,getPixelPrecision:lj,getPrecision:no,getPrecisionSafe:RJ,isNumeric:fj,isRadianAroundZero:bv,linearMap:_t,nice:cj,numericToNumber:as,parseDate:hs,parsePercent:ge,quantile:Yb,quantity:zJ,quantityExponent:_C,reformIntervals:eI,remRadian:uj,round:Mr},Symbol.toStringTag,{value:"Module"})),tFe=Object.freeze(Object.defineProperty({__proto__:null,format:K0,parse:hs,roundTime:oS},Symbol.toStringTag,{value:"Module"})),rFe=Object.freeze(Object.defineProperty({__proto__:null,Arc:Y0,BezierCurve:cp,BoundingRect:je,Circle:ds,CompoundPath:X0,Ellipse:Z0,Group:Le,Image:un,IncrementalDisplayable:CQ,Line:Pr,LinearGradient:eh,Polygon:jn,Polyline:xn,RadialGradient:Tj,Rect:Qe,Ring:up,Sector:Dn,Text:lt,clipPointsByRect:Pj,clipRectByRect:LQ,createIcon:hp,extendPath:PQ,extendShape:MQ,getShapeClass:t0,getTransform:xu,initProps:Gt,makeImage:Aj,makePath:Sv,mergePath:zi,registerShape:Ra,resizePath:Mj,updateProps:ft},Symbol.toStringTag,{value:"Module"})),nFe=Object.freeze(Object.defineProperty({__proto__:null,addCommas:Gj,capitalFirst:tBe,encodeHTML:Yn,formatTime:eBe,formatTpl:Hj,getTextRect:J5e,getTooltipMarker:ZQ,normalizeCssArray:pp,toCamelCase:Wj,truncateText:JRe},Symbol.toStringTag,{value:"Module"})),iFe=Object.freeze(Object.defineProperty({__proto__:null,bind:xe,clone:ke,curry:Ue,defaults:Ie,each:R,extend:ie,filter:gt,indexOf:Ye,inherits:ej,isArray:oe,isFunction:Pe,isObject:Ee,isString:me,map:le,merge:Xe,reduce:La},Symbol.toStringTag,{value:"Module"}));var aFe=rt(),jm=rt(),mo={estimate:1,determine:2};function _S(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function Vte(e,t){var r=le(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 oFe(e,t){var r=e.getLabelModel().get("customValues");if(r){var n=bp(e),i=e.scale.getExtent(),a=Vte(e,r),o=gt(a,function(s){return s>=i[0]&&s<=i[1]});return{labels:le(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"?lFe(e,t):cFe(e)}function sFe(e,t,r){var n=e.getTickModel().get("customValues");if(n){var i=e.scale.getExtent(),a=Vte(e,n);return{ticks:gt(a,function(o){return o>=i[0]&&o<=i[1]})}}return e.type==="category"?uFe(e,t):{ticks:le(e.scale.getTicks(r),function(o){return o.value})}}function lFe(e,t){var r=e.getLabelModel(),n=Gte(e,r,t);return!r.get("show")||e.scale.isBlank()?{labels:[]}:n}function Gte(e,t,r){var n=hFe(e),i=yR(t),a=r.kind===mo.estimate;if(!a){var o=Hte(n,i);if(o)return o}var s,l;Pe(i)?s=Yte(e,i):(l=i==="auto"?dFe(e,r):i,s=Zte(e,l));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return $I(n,i,u),!0}):$I(n,i,u),u}function uFe(e,t){var r=fFe(e),n=yR(t),i=Hte(r,n);if(i)return i;var a,o;if((!t.get("show")||e.scale.isBlank())&&(a=[]),Pe(n))a=Yte(e,n,!0);else if(n==="auto"){var s=Gte(e,e.getLabelModel(),_S(mo.determine));o=s.labelCategoryInterval,a=le(s.labels,function(l){return l.tickValue})}else o=n,a=Zte(e,o,!0);return $I(r,n,{ticks:a,tickCategoryInterval:o})}function cFe(e){var t=e.scale.getTicks(),r=bp(e);return{labels:le(t,function(n,i){return{formattedLabel:r(n,i),rawLabel:e.scale.getLabel(n),tickValue:n.value,time:n.time,break:n.break}})}}var fFe=Wte("axisTick"),hFe=Wte("axisLabel");function Wte(e){return function(r){return jm(r)[e]||(jm(r)[e]={list:[]})}}function Hte(e,t){for(var r=0;rc&&(u=Math.max(1,Math.floor(l/c)));for(var f=s[0],h=e.dataToCoord(f+1)-e.dataToCoord(f),d=Math.abs(h*Math.cos(a)),v=Math.abs(h*Math.sin(a)),m=0,y=0;f<=s[1];f+=u){var x=0,_=0,b=yC(i({value:f}),n.font,"center","top");x=b.width*1.3,_=b.height*1.3,m=Math.max(m,x,7),y=Math.max(y,_,7)}var S=m/d,T=y/v;isNaN(S)&&(S=1/0),isNaN(T)&&(T=1/0);var C=Math.max(0,Math.floor(Math.min(S,T)));if(r===mo.estimate)return t.out.noPxChangeTryDetermine.push(xe(pFe,null,e,C,l)),C;var A=Ute(e,C,l);return A??C}function pFe(e,t,r){return Ute(e,t,r)==null}function Ute(e,t,r){var n=aFe(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 gFe(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 Zte(e,t,r){var n=bp(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 f=Rte(e),h=o.get("showMinLabel")||f,d=o.get("showMaxLabel")||f;h&&u!==a[0]&&m(a[0]);for(var v=u;v<=a[1];v+=l)m(v);d&&v-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 Yte(e,t,r){var n=e.scale,i=bp(e),a=[];return R(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 xG=[0,1],Ba=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 lj(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(),_G(n,i.count())),_t(t,xG,n,r)},e.prototype.coordToData=function(t,r){var n=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(n=n.slice(),_G(n,i.count()));var a=_t(t,n,xG,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=sFe(this,r,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}),i=n.ticks,a=le(i,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return mFe(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=le(n,function(a){return le(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},e.prototype.getViewLabels=function(t){return t=t||_S(mo.determine),oFe(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||_S(mo.determine),vFe(this,t)},e}();function _G(e,t){var r=e[1]-e[0],n=t,i=r/n/2;e[0]+=i,e[1]-=i}function mFe(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;R(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 f=a[0]>a[1];h(t[0].coord,a[0])&&(n?t[0].coord=a[0]:t.shift()),n&&h(a[0],t[0].coord)&&t.unshift({coord:a[0],onBand:!0}),h(a[1],o.coord)&&(n?o.coord=a[1]:t.pop()),n&&h(o.coord,a[1])&&t.push({coord:a[1],onBand:!0});function h(d,v){return d=Mr(d),v=Mr(v),f?d>v:di&&(i+=Mg);var d=Math.atan2(s,o);if(d<0&&(d+=Mg),d>=n&&d<=i||d+Mg>=n&&d+Mg<=i)return l[0]=c,l[1]=f,u-r;var v=r*Math.cos(n)+e,m=r*Math.sin(n)+t,y=r*Math.cos(i)+e,x=r*Math.sin(i)+t,_=(v-o)*(v-o)+(m-s)*(m-s),b=(y-o)*(y-o)+(x-s)*(x-s);return _0){t=t/180*Math.PI,io.fromArray(e[0]),Ft.fromArray(e[1]),Tr.fromArray(e[2]),De.sub(Ho,io,Ft),De.sub(zo,Tr,Ft);var r=Ho.len(),n=zo.len();if(!(r<.001||n<.001)){Ho.scale(1/r),zo.scale(1/n);var i=Ho.dot(zo),a=Math.cos(t);if(a1&&De.copy(ni,Tr),ni.toArray(e[1])}}}}function MFe(e,t,r){if(r<=180&&r>0){r=r/180*Math.PI,io.fromArray(e[0]),Ft.fromArray(e[1]),Tr.fromArray(e[2]),De.sub(Ho,Ft,io),De.sub(zo,Tr,Ft);var n=Ho.len(),i=zo.len();if(!(n<.001||i<.001)){Ho.scale(1/n),zo.scale(1/i);var a=Ho.dot(t),o=Math.cos(r);if(a=l)De.copy(ni,Tr);else{ni.scaleAndAdd(zo,s/Math.tan(Math.PI/2-c));var f=Tr.x!==Ft.x?(ni.x-Ft.x)/(Tr.x-Ft.x):(ni.y-Ft.y)/(Tr.y-Ft.y);if(isNaN(f))return;f<0?De.copy(ni,Ft):f>1&&De.copy(ni,Tr)}ni.toArray(e[1])}}}}function RM(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 PFe(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=zs(n[0],n[1]),a=zs(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=Am([],n[1],n[0],o/i),l=Am([],n[1],n[2],o/a),u=Am([],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(k*O,0,a);var E=k+A;E<0&&T(-E*O,1)}else T(-A*O,1)}}function S(A,P,O){A!==0&&(c=!0);for(var k=P;k0)for(var E=0;E0;E--){var V=O[E-1]*z;S(-V,E,a)}}}function C(A){var P=A<0?-1:1;A=Math.abs(A);for(var O=Math.ceil(A/(a-1)),k=0;k0?S(O,0,k+1):S(-O,a-k-1,a),A-=O,A<=0)return}return c}function OFe(e){for(var t=0;t=0&&n.attr(a.oldLayoutSelect),Ye(h,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),ft(n,u,r,l)}else if(n.attr(u),!dp(n).valueAnimation){var f=Ae(n.style.opacity,1);n.style.opacity=0,Gt(n,{style:{opacity:f}},r,l)}if(a.oldLayout=u,n.states.select){var d=a.oldLayoutSelect={};K_(d,u,J_),K_(d,n.states.select,J_)}if(n.states.emphasis){var v=a.oldLayoutEmphasis={};K_(v,u,J_),K_(v,n.states.emphasis,J_)}jQ(n,l,c,r,r)}if(i&&!i.ignore&&!i.invisible){var a=NFe(i),o=a.oldLayout,m={points:i.shape.points};o?(i.attr({shape:o}),ft(i,{shape:m},r)):(i.setShape(m),i.style.strokePercent=0,Gt(i,{style:{strokePercent:1}},r)),a.oldLayout=m}},e}(),$M=rt();function jFe(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){var i=$M(r).labelManager;i||(i=$M(r).labelManager=new DFe),i.clearLabels()}),e.registerUpdateLifecycle("series:layoutlabels",function(t,r,n){var i=$M(r).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var FM=Math.sin,VM=Math.cos,tre=Math.PI,kc=Math.PI*2,RFe=180/tre,rre=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,f=Math.abs(u),h=tu(f-kc)||(c?u>=kc:-u>=kc),d=u>0?u%kc:u%kc+kc,v=!1;h?v=!0:tu(f)?v=!1:v=d>=tre==!!c;var m=t+n*VM(o),y=r+i*FM(o);this._start&&this._add("M",m,y);var x=Math.round(a*RFe);if(h){var _=1/this._p,b=(c?1:-1)*(kc-_);this._add("A",n,i,x,1,+c,t+n*VM(o+b),r+i*FM(o+b)),_>.01&&this._add("A",n,i,x,0,+c,m,y)}else{var S=t+n*VM(s),T=r+i*FM(s);this._add("A",n,i,x,+v,+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=[],f=this._p,h=1;h"}function UFe(e){return""}function wR(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 HFe(o,s)+(o!=="style"?Yn(l):l||"")+(a?""+r+le(a,function(u){return n(u)}).join(r)+r:"")+UFe(o)}return n(e)}function ZFe(e,t,r){r=r||{};var n=r.newline?` +`:"",i=" {"+n,a=n+"}",o=le(st(e),function(l){return l+i+le(st(e[l]),function(u){return u+":"+e[l][u]+";"}).join(n)+a}).join(n),s=le(st(t),function(l){return"@keyframes "+l+i+le(st(t[l]),function(u){return u+i+le(st(t[l][u]),function(c){var f=t[l][u][c];return c==="d"&&(f='path("'+f+'")'),c+":"+f+";"}).join(n)+a}).join(n)+a}).join(n);return!o&&!s?"":[""].join(n)}function HI(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function AG(e,t,r,n){return nn("svg","root",{width:e,height:t,xmlns:nre,"xmlns:xlink":ire,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+e+" "+t:!1},r)}var YFe=0;function ore(){return YFe++}var MG={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"},Rc="transform-origin";function XFe(e,t,r){var n=ie({},e.shape);ie(n,t),e.buildPath(r,n);var i=new rre;return i.reset(AJ(e)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function qFe(e,t){var r=t.originX,n=t.originY;(r||n)&&(e[Rc]=r+"px "+n+"px")}var KFe={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function sre(e,t){var r=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[r]=e,r}function JFe(e,t,r){var n=e.shape.paths,i={},a,o;if(R(n,function(l){var u=HI(r.zrId);u.animation=!0,$C(l,{},u,!0);var c=u.cssAnims,f=u.cssNodes,h=st(c),d=h.length;if(d){o=h[d-1];var v=c[o];for(var m in v){var y=v[m];i[m]=i[m]||{d:""},i[m].d+=y.d||""}for(var x in f){var _=f[x].animation;_.indexOf(o)>=0&&(a=_)}}}),!!a){t.d=!1;var s=sre(i,r);return a.replace(o,s)}}function PG(e){return me(e)?MG[e]?"cubic-bezier("+MG[e]+")":ij(e)?e:"":""}function $C(e,t,r,n){var i=e.animators,a=i.length,o=[];if(e instanceof X0){var s=JFe(e,t,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Oe=sre(A,r);return Oe+" "+_[0]+" both"}}for(var y in l){var s=m(l[y]);s&&o.push(s)}if(o.length){var x=r.zrId+"-cls-"+ore();r.cssNodes["."+x]={animation:o.join(",")},t.class=x}}function QFe(e,t,r){if(!e.ignore)if(e.isSilent()){var n={"pointer-events":"none"};kG(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=Yw(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),kG(n,t,r)}}function kG(e,t,r,n){var i=JSON.stringify(e),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+ore(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=e),t.class=t.class?t.class+" "+a:a}var f0=Math.round;function lre(e){return e&&me(e.src)}function ure(e){return e&&Pe(e.toDataURL)}function SR(e,t,r,n){VFe(function(i,a){var o=i==="fill"||i==="stroke";o&&CJ(a)?fre(t,e,i,n):o&&oj(a)?hre(r,e,i,n):e[i]=a,o&&n.ssr&&a==="none"&&(e["pointer-events"]="visible")},t,r,!1),oVe(r,e,n)}function TR(e,t){var r=NJ(t);r&&(r.each(function(n,i){n!=null&&(e[(CG+i).toLowerCase()]=n+"")}),t.isSilent()&&(e[CG+"silent"]="true"))}function LG(e){return tu(e[0]-1)&&tu(e[1])&&tu(e[2])&&tu(e[3]-1)}function eVe(e){return tu(e[4])&&tu(e[5])}function CR(e,t,r){if(t&&!(eVe(t)&&LG(t))){var n=1e4;e.transform=LG(t)?"translate("+f0(t[4]*n)/n+" "+f0(t[5]*n)/n+")":Dje(t)}}function OG(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.";Nn(h,y),Nn(d,y)}else if(h==null||d==null){var x=function(k,E){if(k){var N=k.elm,D=h||E.width,z=d||E.height;k.tag==="pattern"&&(u?(z=1,D/=a.width):c&&(D=1,z/=a.height)),k.attrs.width=D,k.attrs.height=z,N&&(N.setAttribute("width",D),N.setAttribute("height",z))}},_=pj(v,null,e,function(k){l||x(C,k),x(f,k)});_&&_.width&&_.height&&(h=h||_.width,d=d||_.height)}f=nn("image","img",{href:v,width:h,height:d}),o.width=h,o.height=d}else i.svgElement&&(f=ke(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(f){var b,S;l?b=S=1:u?(S=1,b=o.width/a.width):c?(b=1,S=o.height/a.height):o.patternUnits="userSpaceOnUse",b!=null&&!isNaN(b)&&(o.width=b),S!=null&&!isNaN(S)&&(o.height=S);var T=MJ(i);T&&(o.patternTransform=T);var C=nn("pattern","",o,[f]),A=wR(C),P=n.patternCache,O=P[A];O||(O=n.zrId+"-p"+n.patternIdx++,P[A]=O,o.id=O,C=n.defs[O]=nn("pattern",O,o,[f])),t[r]=mC(O)}}function sVe(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]=nn("clipPath",a,o,[cre(e,r)])}t["clip-path"]=mC(a)}function NG(e){return document.createTextNode(e)}function Wc(e,t,r){e.insertBefore(t,r)}function DG(e,t){e.removeChild(t)}function jG(e,t){e.appendChild(t)}function dre(e){return e.parentNode}function vre(e){return e.nextSibling}function GM(e,t){e.textContent=t}var RG=58,lVe=120,uVe=nn("","");function UI(e){return e===void 0}function Do(e){return e!==void 0}function cVe(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 nm(e,t){var r=e.key===t.key,n=e.tag===t.tag;return n&&r}function h0(e){var t,r=e.children,n=e.tag;if(Do(n)){var i=e.elm=are(n);if(AR(uVe,e),oe(r))for(t=0;ta?(v=r[l+1]==null?null:r[l+1].elm,pre(e,v,r,i,l)):CS(e,t,n,a))}function Jh(e,t){var r=t.elm=e.elm,n=e.children,i=t.children;e!==t&&(AR(e,t),UI(t.text)?Do(n)&&Do(i)?n!==i&&fVe(r,n,i):Do(i)?(Do(e.text)&&GM(r,""),pre(r,null,i,0,i.length-1)):Do(n)?CS(r,n,0,n.length-1):Do(e.text)&&GM(r,""):e.text!==t.text&&(Do(n)&&CS(r,n,0,n.length-1),GM(r,t.text)))}function hVe(e,t){if(nm(e,t))Jh(e,t);else{var r=e.elm,n=dre(r);h0(t),n!==null&&(Wc(n,t.elm,vre(r)),CS(n,[e],0,0))}return t}var dVe=0,vVe=function(){function e(t,r,n){if(this.type="svg",this.refreshHover=BG(),this.configLayer=BG(),this.storage=r,this._opts=n=ie({},n),this.root=t,this._id="zr"+dVe++,this._oldVNode=AG(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=are("svg");AR(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",hVe(this._oldVNode,t),this._oldVNode=t}},e.prototype.renderOneToVNode=function(t){return EG(t,HI(this._id))},e.prototype.renderToVNode=function(t){t=t||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=HI(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=pVe(n,i,this._backgroundColor,a);s&&o.push(s);var l=t.compress?null:this._mainVNode=nn("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=le(st(a.defs),function(h){return a.defs[h]});if(u.length&&o.push(nn("defs","defs",{},u)),t.animation){var c=ZFe(a.cssNodes,a.cssAnims,{newline:!0});if(c){var f=nn("style","stl",{},[],c);o.push(f)}}return AG(n,i,o,t.useViewBox)},e.prototype.renderToString=function(t){return t=t||{},wR(this.renderToVNode({animation:Ae(t.cssAnimation,!0),emphasis:Ae(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Ae(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&&!(h&&l&&h[m]===l[m]);m--);for(var y=v-1;y>m;y--)o--,s=a[o-1];for(var x=m+1;x=s)}}for(var f=this.__startIndex;f15)break}}z.prevElClipPaths&&x.restore()};if(_)if(_.length===0)P=y.__endIndex;else for(var k=d.dpr,E=0;E<_.length;++E){var N=_[E];x.save(),x.beginPath(),x.rect(N.x*k,N.y*k,N.width*k,N.height*k),x.clip(),O(N),x.restore()}else x.save(),O(),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?Q_:0),this._needsManuallyCompositing),c.__builtin__||hC("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&Bi&&!i.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(f,h){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__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,R(this._layers,function(r){r.setUnpainted()})},e.prototype.configLayer=function(t,r){if(r){var n=this._layerConfig;n[t]?Xe(n[t],r,!0):n[t]=r;for(var i=0;i-1&&(u.style.stroke=u.style.fill,u.style.fill=J.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}(Ot);function kv(e,t){var r=e.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=Cv(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 tx=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=Lr(r,-1,-1,2,2,null,s);l.attr({z2:Ae(o,100),culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),l.drift=SVe,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(){cl(this.childAt(0))},t.prototype.downplay=function(){fl(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,f=a&&a.disableAnimation;if(c){var h=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,r,n,l,u,h)}else{var d=this.childAt(0);d.silent=!1;var v={scaleX:l[0]/2,scaleY:l[1]/2};f?d.attr(v):ft(d,v,s,n),Ea(d)}if(this._updateCommon(r,n,l,i,a),c){var d=this.childAt(0);if(!f){var v={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,Gt(d,v,s,n)}}f&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(r,n,i,a,o){var s=this.childAt(0),l=r.hostModel,u,c,f,h,d,v,m,y,x;if(a&&(u=a.emphasisItemStyle,c=a.blurItemStyle,f=a.selectItemStyle,h=a.focus,d=a.blurScope,m=a.labelStatesModels,y=a.hoverScale,x=a.cursorStyle,v=a.emphasisDisabled),!a||r.hasItemOption){var _=a&&a.itemModel?a.itemModel:r.getItemModel(n),b=_.getModel("emphasis");u=b.getModel("itemStyle").getItemStyle(),f=_.getModel(["select","itemStyle"]).getItemStyle(),c=_.getModel(["blur","itemStyle"]).getItemStyle(),h=b.get("focus"),d=b.get("blurScope"),v=b.get("disabled"),m=Xr(_),y=b.getShallow("scale"),x=_.getShallow("cursor")}var S=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(S||0)*Math.PI/180||0);var T=ih(r.getItemVisual(n,"symbolOffset"),i);T&&(s.x=T[0],s.y=T[1]),x&&s.attr("cursor",x);var C=r.getItemVisual(n,"style"),A=C.fill;if(s instanceof un){var P=s.style;s.useStyle(ie({image:P.image,x:P.x,y:P.y,width:P.width,height:P.height},C))}else s.__isEmptyBrush?s.useStyle(ie({},C)):s.useStyle(C),s.style.decal=null,s.setColor(A,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var O=r.getItemVisual(n,"liftZ"),k=this._z2;O!=null?k==null&&(this._z2=s.z2,s.z2+=O):k!=null&&(s.z2=k,this._z2=null);var E=o&&o.useNameLabel;sn(s,m,{labelFetcher:l,labelDataIndex:n,defaultText:N,inheritColor:A,defaultOpacity:C.opacity});function N(V){return E?r.getName(V):kv(r,V)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var D=s.ensureState("emphasis");D.style=u,s.ensureState("select").style=f,s.ensureState("blur").style=c;var z=y==null||y===!0?Math.max(1.1,3/this._sizeY):isFinite(y)&&y>0?+y:1;D.scaleX=this._sizeX*z,D.scaleY=this._sizeY*z,this.setSymbolScale(1),qt(this,h,d,v)},t.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},t.prototype.fadeOut=function(r,n,i){var a=this.childAt(0),o=Be(this).dataIndex,s=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&Lu(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();Lu(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},t.getSymbolSize=function(r,n){return xp(r.getItemVisual(n,"symbolSize"))},t.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},t}(Le);function SVe(e,t){this.parent.drift(e,t)}function HM(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 FG(e){return e!=null&&!Ee(e)&&(e={isIgnore:e}),e||{}}function VG(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:Xr(t),cursorStyle:t.get("cursor")}}var rx=function(){function e(t){this.group=new Le,this._SymbolCtor=t||tx}return e.prototype.updateData=function(t,r){this._progressiveEls=null,r=FG(r);var n=this.group,i=t.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=VG(t),u={disableAnimation:s},c=r.getSymbolPoint||function(f){return t.getItemLayout(f)};a||n.removeAll(),t.diff(a).add(function(f){var h=c(f);if(HM(t,h,f,r)){var d=new o(t,f,l,u);d.setPosition(h),t.setItemGraphicEl(f,d),n.add(d)}}).update(function(f,h){var d=a.getItemGraphicEl(h),v=c(f);if(!HM(t,v,f,r)){n.remove(d);return}var m=t.getItemVisual(f,"symbol")||"circle",y=d&&d.getSymbolType&&d.getSymbolType();if(!d||y&&y!==m)n.remove(d),d=new o(t,f,l,u),d.setPosition(v);else{d.updateData(t,f,l,u);var x={x:v[0],y:v[1]};s?d.attr(x):ft(d,x,i)}n.add(d),t.setItemGraphicEl(f,d)}).remove(function(f){var h=a.getItemGraphicEl(f);h&&h.fadeOut(function(){n.remove(h)},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=VG(t),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r,n){this._progressiveEls=[],n=FG(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 yre(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 CVe(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 AVe(e,t,r,n,i,a,o,s){for(var l=CVe(e,t),u=[],c=[],f=[],h=[],d=[],v=[],m=[],y=mre(i,t,o),x=e.getLayout("points")||[],_=t.getLayout("points")||[],b=0;b=i||m<0)break;if(_f(x,_)){if(l){m+=a;continue}break}if(m===r)e[a>0?"moveTo":"lineTo"](x,_),f=x,h=_;else{var b=x-u,S=_-c;if(b*b+S*S<.5){m+=a;continue}if(o>0){for(var T=m+a,C=t[T*2],A=t[T*2+1];C===x&&A===_&&y=n||_f(C,A))d=x,v=_;else{k=C-u,E=A-c;var z=x-u,V=C-x,F=_-c,$=A-_,B=void 0,H=void 0;if(s==="x"){B=Math.abs(z),H=Math.abs(V);var U=k>0?1:-1;d=x-U*B*o,v=_,N=x+U*H*o,D=_}else if(s==="y"){B=Math.abs(F),H=Math.abs($);var Z=E>0?1:-1;d=x,v=_-Z*B*o,N=x,D=_+Z*H*o}else B=Math.sqrt(z*z+F*F),H=Math.sqrt(V*V+$*$),O=H/(H+B),d=x-k*o*(1-O),v=_-E*o*(1-O),N=x+k*o*O,D=_+E*o*O,N=Ol(N,Il(C,x)),D=Ol(D,Il(A,_)),N=Il(N,Ol(C,x)),D=Il(D,Ol(A,_)),k=N-x,E=D-_,d=x-k*B/H,v=_-E*B/H,d=Ol(d,Il(u,x)),v=Ol(v,Il(c,_)),d=Il(d,Ol(u,x)),v=Il(v,Ol(c,_)),k=x-d,E=_-v,N=x+k*H/B,D=_+E*H/B}e.bezierCurveTo(f,h,d,v,x,_),f=N,h=D}else e.lineTo(x,_)}u=x,c=_,m+=a}return y}var xre=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),MVe=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:J.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new xre},t.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&_f(i[o*2-2],i[o*2-1]);o--);for(;a=0){var S=u?(v-l)*b+l:(d-s)*b+s;return u?[r,S]:[S,r]}s=d,l=v;break;case o.C:d=a[f++],v=a[f++],m=a[f++],y=a[f++],x=a[f++],_=a[f++];var T=u?Uw(s,d,m,x,r,c):Uw(l,v,y,_,r,c);if(T>0)for(var C=0;C=0){var S=u?en(l,v,y,_,A):en(s,d,m,x,A);return u?[r,S]:[S,r]}}s=x,l=_;break}}},t}(at),PVe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(xre),_re=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 PVe},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&&_f(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 OVe(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=le(a.stops,function(b){return{coord:l.toGlobalCoord(l.dataToCoord(b.value)),color:b.color}}),c=u.length,f=a.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),f.reverse());var h=LVe(u,i==="x"?r.getWidth():r.getHeight()),d=h.length;if(!d&&c)return u[0].coord<0?f[1]?f[1]:u[c-1].color:f[0]?f[0]:u[0].color;var v=10,m=h[0].coord-v,y=h[d-1].coord+v,x=y-m;if(x<.001)return"transparent";R(h,function(b){b.offset=(b.coord-m)/x}),h.push({offset:d?h[d-1].offset:.5,color:f[1]||"transparent"}),h.unshift({offset:d?h[0].offset:.5,color:f[0]||"transparent"});var _=new eh(0,0,0,0,h,!0);return _[i]=m,_[i+"2"]=y,_}}}function IVe(e,t,r){var n=e.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&EVe(a,t))){var o=t.mapDimension(a.dim),s={};return R(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function EVe(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 NVe(e,t){return isNaN(e)||isNaN(t)}function DVe(e){for(var t=e.length/2;t>0&&NVe(e[t*2-2],e[t*2-1]);t--);return t-1}function ZG(e,t){return[e[t*2],e[t*2+1]]}function jVe(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 Sre(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var H=v.getState("emphasis").style;H.lineWidth=+v.style.lineWidth+1}Be(v).seriesIndex=r.seriesIndex,qt(v,F,$,B);var U=UG(r.get("smooth")),Z=r.get("smoothMonotone");if(v.setShape({smooth:U,smoothMonotone:Z,connectNulls:A}),m){var Y=s.getCalculationInfo("stackedOnSeries"),K=0;m.useStyle(Ie(u.getAreaStyle(),{fill:N,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),Y&&(K=UG(Y.get("smooth"))),m.setShape({smooth:U,stackedOnSmooth:K,smoothMonotone:Z,connectNulls:A}),Yr(m,r,"areaStyle"),Be(m).seriesIndex=r.seriesIndex,qt(m,F,$,B)}var te=this._changePolyState;s.eachItemGraphicEl(function(ce){ce&&(ce.onHoverStateChange=te)}),this._polyline.onHoverStateChange=te,this._data=s,this._coordSys=a,this._stackedOnPoints=T,this._points=c,this._step=k,this._valueOrigin=b,r.get("triggerLineEvent")&&(this.packEventData(r,v),m&&this.packEventData(r,m))},t.prototype.packEventData=function(r,n){Be(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=Df(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],f=l[s*2+1];if(isNaN(c)||isNaN(f)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,f))return;var h=r.get("zlevel")||0,d=r.get("z")||0;u=new tx(o,s),u.x=c,u.y=f,u.setZ(h,d);var v=u.getSymbolPath().getTextContent();v&&(v.zlevel=h,v.z=d,v.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else At.prototype.highlight.call(this,r,n,i,a)},t.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=Df(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 At.prototype.downplay.call(this,r,n,i,a)},t.prototype._changePolyState=function(r){var n=this._polygon;nS(this._polyline,r),n&&nS(n,r)},t.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new MVe({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 _re({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");Pe(c)&&(c=c(null));var f=u.get("animationDelay")||0,h=Pe(f)?f(null):f;r.eachItemGraphicEl(function(d,v){var m=d;if(m){var y=[d.x,d.y],x=void 0,_=void 0,b=void 0;if(i)if(o){var S=i,T=n.pointToCoord(y);a?(x=S.startAngle,_=S.endAngle,b=-T[1]/180*Math.PI):(x=S.r0,_=S.r,b=T[0])}else{var C=i;a?(x=C.x,_=C.x+C.width,b=d.x):(x=C.y+C.height,_=C.y,b=d.y)}var A=_===x?0:(b-x)/(_-x);l&&(A=1-A);var P=Pe(f)?f(v):c*A+h,O=m.getSymbolPath(),k=O.getTextContent();m.attr({scaleX:0,scaleY:0}),m.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:P}),k&&k.animateFrom({style:{opacity:0}},{duration:300,delay:P}),O.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(Sre(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 lt({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var c=DVe(l);c>=0&&(sn(s,Xr(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:c,defaultText:function(f,h,d){return d!=null?gre(o,d):kv(o,f)},enableTextSetter:!0},RVe(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 f=i.getLayout("points"),h=i.hostModel,d=h.get("connectNulls"),v=s.get("precision"),m=s.get("distance")||0,y=l.getBaseAxis(),x=y.isHorizontal(),_=y.inverse,b=n.shape,S=_?x?b.x:b.y+b.height:x?b.x+b.width:b.y,T=(x?m:0)*(_?-1:1),C=(x?0:-m)*(_?-1:1),A=x?"x":"y",P=jVe(f,S,A),O=P.range,k=O[1]-O[0],E=void 0;if(k>=1){if(k>1&&!d){var N=ZG(f,O[0]);u.attr({x:N[0]+T,y:N[1]+C}),o&&(E=h.getRawValue(O[0]))}else{var N=c.getPointOn(S,A);N&&u.attr({x:N[0]+T,y:N[1]+C});var D=h.getRawValue(O[0]),z=h.getRawValue(O[1]);o&&(E=YJ(i,v,D,z,P.t))}a.lastFrameIndex=O[0]}else{var V=r===1||a.lastFrameIndex>0?O[0]:0,N=ZG(f,V);o&&(E=h.getRawValue(V)),u.attr({x:N[0]+T,y:N[1]+C})}if(o){var F=dp(u);typeof F.setLabelText=="function"&&F.setLabelText(E)}}},t.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,c=this._polygon,f=r.hostModel,h=AVe(this._data,r,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),d=h.current,v=h.stackedOnCurrent,m=h.next,y=h.stackedOnNext;if(o&&(v=El(h.stackedOnCurrent,h.current,i,o,l),d=El(h.current,null,i,o,l),y=El(h.stackedOnNext,h.next,i,o,l),m=El(h.next,null,i,o,l)),HG(d,m)>3e3||c&&HG(v,y)>3e3){u.stopAnimation(),u.setShape({points:m}),c&&(c.stopAnimation(),c.setShape({points:m,stackedOnPoints:y}));return}u.shape.__points=h.current,u.shape.points=d;var x={shape:{points:m}};h.current!==d&&(x.shape.__points=h.next),u.stopAnimation(),ft(u,x,f),c&&(c.setShape({points:d,stackedOnPoints:v}),c.stopAnimation(),ft(c,{shape:{stackedOnPoints:y}},f),u.shape.points!==c.shape.points&&(c.shape.points=u.shape.points));for(var _=[],b=h.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(),f=n.getDevicePixelRatio(),h=Math.abs(c[1]-c[0])*(f||1),d=Math.round(s/h);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 v=void 0;me(a)?v=zVe[a]:Pe(a)&&(v=a),v&&t.setData(i.downSample(i.mapDimension(u.dim),1/d,v,$Ve))}}}}}function FVe(e){e.registerChartView(BVe),e.registerSeriesModel(wVe),e.registerLayout(ix("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,Tre("line"))}var d0=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 vs(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)R(a.getAxes(),function(h,d){if(h.type==="category"&&n!=null){var v=h.getTicksCoords(),m=h.getTickModel().get("alignWithLabel"),y=o[d],x=n[d]==="x1"||n[d]==="y1";if(x&&!m&&(y+=1),v.length<2)return;if(v.length===2){s[d]=h.toGlobalCoord(h.getExtent()[x?1:0]);return}for(var _=void 0,b=void 0,S=1,T=0;Ty){b=(C+_)/2;break}T===1&&(S=A-v[0].tickValue)}b==null&&(_?_&&(b=v[v.length-1].coord):b=v[0].coord),s[d]=h.toGlobalCoord(b)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),f=a.getBaseAxis().isHorizontal()?0:1;s[f]+=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}(Ot);Ot.registerClass(d0);var VVe=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 vs(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=Zu(d0.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:J.color.primary,borderWidth:2}},realtimeSort:!1}),t}(d0),GVe=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}(),AS=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 GVe},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,f=n.endAngle,h=n.clockwise,d=Math.PI*2,v=h?f-cMath.PI/2&&cs)return!0;s=f}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){qs(a,r,Be(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}(At),YG={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=ZM(t.x,e.x),s=YM(t.x+t.width,i),l=ZM(t.y,e.y),u=YM(t.y+t.height,a),c=si?s:o,t.y=f&&l>a?u:l,t.width=c?0:s-o,t.height=f?0:u-l,r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height),c||f},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=YM(t.r,e.r),a=ZM(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}},XG={cartesian2d:function(e,t,r,n,i,a,o,s,l){var u=new Qe({shape:ie({},n),z2:1});if(u.__dataIndex=r,u.name="item",a){var c=u.shape,f=i?"height":"width";c[f]=0}return u},polar:function(e,t,r,n,i,a,o,s,l){var u=!i&&l?AS:Dn,c=new u({shape:n,z2:1});c.name="item";var f=Cre(i);if(c.calculateTextPosition=WVe(f,{isRoundCap:u===AS}),a){var h=c.shape,d=i?"r":"endAngle",v={};h[d]=i?n.r0:n.startAngle,v[d]=n[d],(s?ft:Gt)(c,{shape:v},a)}return c}};function YVe(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 qG(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?ft:Gt)(r,{shape:l},t,i,null);var c=t?e.baseAxis.model:null;(o?ft:Gt)(r,{shape:u},c,i)}function KG(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 KVe(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function Cre(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 QG(e,t,r,n,i,a,o,s){var l=t.getItemVisual(r,"style");if(s){if(!a.get("roundCap")){var c=e.shape,f=Uo(n.getModel("itemStyle"),c,!0);ie(c,f),e.setShape(c)}}else{var u=n.get(["itemStyle","borderRadius"])||0;e.setShape("r",u)}e.useStyle(l);var h=n.getShallow("cursor");h&&e.attr("cursor",h);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",v=Xr(n);sn(e,v,{labelFetcher:a,labelDataIndex:r,defaultText:kv(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,HVe(e,y==="outside"?d:y,Cre(o),n.get(["label","rotate"]))}DQ(m,v,a.getRawValue(r),function(_){return gre(t,_)});var x=n.getModel(["emphasis"]);qt(e,x.get("focus"),x.get("blurScope"),x.get("disabled")),Yr(e,n),KVe(i)&&(e.style.fill="none",e.style.stroke="none",R(e.states,function(_){_.style&&(_.style.fill=_.style.stroke="none")}))}function JVe(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 QVe=function(){function e(){}return e}(),eW=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 QVe},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 e6e(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,f=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 Are(e,t,r){if(Ou(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 t6e(e,t,r){var n=e.type==="polar"?Dn:Qe;return new n({shape:Are(t,r,e),silent:!0,z2:0})}function r6e(e){e.registerChartView(ZVe),e.registerSeriesModel(VVe),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Ue(kte,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Lte("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,Tre("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 nW=Math.PI*2,nb=Math.PI/180;function n6e(e,t,r){t.eachSeriesByType(e,function(n){var i=n.getData(),a=i.mapDimension("value"),o=QQ(n,r),s=o.cx,l=o.cy,u=o.r,c=o.r0,f=o.viewRect,h=-n.get("startAngle")*nb,d=n.get("endAngle"),v=n.get("padAngle")*nb;d=d==="auto"?h-nW:-d*nb;var m=n.get("minAngle")*nb,y=m+v,x=0;i.each(a,function($){!isNaN($)&&x++});var _=i.getSum(a),b=Math.PI/(_||x)*2,S=n.get("clockwise"),T=n.get("roseType"),C=n.get("stillShowZeroSum"),A=i.getDataExtent(a);A[0]=0;var P=S?1:-1,O=[h,d],k=P*v/2;CC(O,!S),h=O[0],d=O[1];var E=Mre(n);E.startAngle=h,E.endAngle=d,E.clockwise=S,E.cx=s,E.cy=l,E.r=u,E.r0=c;var N=Math.abs(d-h),D=N,z=0,V=h;if(i.setLayout({viewRect:f,r:u}),i.each(a,function($,B){var H;if(isNaN($)){i.setItemLayout(B,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:S,cx:s,cy:l,r0:c,r:T?NaN:u});return}T!=="area"?H=_===0&&C?b:$*b:H=N/x,HH?(Z=V+P*H/2,Y=Z):(Z=V+k,Y=U-k),i.setItemLayout(B,{angle:H,startAngle:Z,endAngle:Y,clockwise:S,cx:s,cy:l,r0:c,r:T?_t($,A,[c,u]):u}),V=U}),Dr?x:y,T=Math.abs(b.label.y-r);if(T>=S.maxY){var C=b.label.x-t-b.len2*i,A=n+b.len,P=Math.abs(C)e.unconstrainedWidth?null:h:null;n.setStyle("width",d)}kre(a,n)}}}function kre(e,t){aW.rect=e,Qte(aW,t,o6e)}var o6e={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},aW={};function XM(e){return e.position==="center"}function s6e(e){var t=e.getData(),r=[],n,i,a=!1,o=(e.get("minShowLabelAngle")||0)*i6e,s=t.getLayout("viewRect"),l=t.getLayout("r"),u=s.width,c=s.x,f=s.y,h=s.height;function d(C){C.ignore=!0}function v(C){if(!C.ignore)return!0;for(var A in C.states)if(C.states[A].ignore===!1)return!0;return!1}t.each(function(C){var A=t.getItemGraphicEl(C),P=A.shape,O=A.getTextContent(),k=A.getTextGuideLine(),E=t.getItemModel(C),N=E.getModel("label"),D=N.get("position")||E.get(["emphasis","label","position"]),z=N.get("distanceToLabelLine"),V=N.get("alignTo"),F=ge(N.get("edgeDistance"),u),$=N.get("bleedMargin");$==null&&($=Math.min(u,h)>200?10:2);var B=E.getModel("labelLine"),H=B.get("length");H=ge(H,u);var U=B.get("length2");if(U=ge(U,u),Math.abs(P.endAngle-P.startAngle)0?"right":"left":Y>0?"left":"right"}var Ve=Math.PI,Ze=0,ht=N.get("rotate");if(ut(ht))Ze=ht*(Ve/180);else if(D==="center")Ze=0;else if(ht==="radial"||ht===!0){var Bt=Y<0?-Z+Ve:-Z;Ze=Bt}else if(ht==="tangential"&&D!=="outside"&&D!=="outer"){var Kt=Math.atan2(Y,K);Kt<0&&(Kt=Ve*2+Kt);var cn=K>0;cn&&(Kt=Ve+Kt),Ze=Kt-Ve}if(a=!!Ze,O.x=te,O.y=ce,O.rotation=Ze,O.setStyle({verticalAlign:"middle"}),ye){O.setStyle({align:Oe});var wn=O.states.select;wn&&(wn.x+=O.x,wn.y+=O.y)}else{var Or=new je(0,0,0,0);kre(Or,O),r.push({label:O,labelLine:k,position:D,len:H,len2:U,minTurnAngle:B.get("minTurnAngle"),maxSurfaceAngle:B.get("maxSurfaceAngle"),surfaceNormal:new De(Y,K),linePoints:de,textAlign:Oe,labelDistance:z,labelAlignTo:V,edgeDistance:F,bleedMargin:$,rect:Or,unconstrainedWidth:Or.width,labelStyleWidth:O.style.width})}A.setTextConfig({inside:ye})}}),!a&&e.get("avoidLabelOverlap")&&a6e(r,n,i,l,u,h,c,f);for(var m=0;m0){for(var c=o.getItemLayout(0),f=1;isNaN(c&&c.startAngle)&&f=a.r0}},t.type="pie",t}(At);function Tp(e,t,r){t=oe(t)&&{coordDimensions:t}||ie({encodeDefine:e.getEncode()},t);var n=e.getSource(),i=_p(n,t).dimensions,a=new qn(i,e);return a.initData(n,r),a}var Cp=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}(),c6e=rt(),Lre=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 Cp(xe(this.getData,this),xe(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return Tp(this,{coordDimensions:["value"],encodeDefaulter:Ue(Zj,this)})},t.prototype.getDataParams=function(r){var n=this.getData(),i=c6e(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=BJ(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){Nf(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}(Ot);nBe({fullType:Lre.type,getCoord2:function(e){return e.getShallow("center")}});function f6e(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!(ut(o)&&!isNaN(o)&&o<0)})}}}function h6e(e){e.registerChartView(u6e),e.registerSeriesModel(Lre),Wee("pie",e.registerAction),e.registerLayout(Ue(n6e,"pie")),e.registerProcessor(Sp("pie")),e.registerProcessor(f6e("pie"))}var d6e=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 vs(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:J.color.primary}},universalTransition:{divideShape:"clone"}},t}(Ot),Ore=4,v6e=function(){function e(){}return e}(),p6e=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 v6e},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,f=a[c]-s/2,h=a[c+1]-l/2;if(r>=f&&n>=h&&r<=f+s&&n<=h+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,f=-1/0,h=0;h=0&&(u.dataIndex=f+(t.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),m6e=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=ix("").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 g6e:new rx,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}(At),Ire={left:0,right:0,top:0,bottom:0},MS=["25%","25%"],y6e=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(r,n){var i=rh(r.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&ss(r.outerBounds,i)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&ss(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:Ire,outerBoundsContain:"all",outerBoundsClampWidth:MS[0],outerBoundsClampHeight:MS[1],backgroundColor:J.color.transparent,borderWidth:1,borderColor:J.color.neutral30},t}(tt),YI=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",fr).models[0]},t.type="cartesian2dAxis",t}(tt);br(YI,wp);var Ere={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:J.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:J.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:J.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[J.color.backgroundTint,J.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:J.color.neutral00,borderColor:J.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},x6e=Xe({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},Ere),MR=Xe({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:J.color.axisMinorSplitLine,width:1}}},Ere),_6e=Xe({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},MR),b6e=Ie({logBase:10},MR);const Nre={category:x6e,value:MR,time:_6e,log:b6e};var w6e={value:1,category:1,time:1,log:1},XI=null;function S6e(e){XI||(XI=e)}function ax(){return XI}function Lv(e,t,r,n){R(w6e,function(i,a){var o=Xe(Xe({},Nre[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,f){var h=n0(this),d=h?rh(c):{},v=f.getTheme();Xe(c,v.get(a+"Axis")),Xe(c,this.getDefaultOption()),c.type=oW(c),h&&ss(c,d,h)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=u0.createByAxisModel(this))},u.prototype.getCategories=function(c){var f=this.option;if(f.type==="category")return c?f.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(c){var f=ax();return f?f.updateModelAxisBreak(this,c):{breaks:[]}},u.type=t+"Axis."+a,u.defaultOption=o,u}(r);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+"Axis",oW)}function oW(e){return e.type||(e.data?"category":"value")}var T6e=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 le(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}(),qI=["x","y"];function sW(e){return(e.type==="interval"||e.type==="time")&&!e.hasBreaks()}var C6e=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=qI,r}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!sW(r)||!sW(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,f=(s[1]-o[1])/u,h=o[0]-i[0]*c,d=o[1]-a[0]*f,v=this._transform=[c,0,0,f,h,d];this._invTransform=Oa([],v)}}},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 je(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 xr(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 xr(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 je(a,o,s,l)},t}(T6e),Dre=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}(Ba),FC="expandAxisBreak",jre="collapseAxisBreak",Rre="toggleAxisBreak",PR="axisbreakchanged",A6e={type:FC,event:PR,update:"update",refineEvent:kR},M6e={type:jre,event:PR,update:"update",refineEvent:kR},P6e={type:Rre,event:PR,update:"update",refineEvent:kR};function kR(e,t,r,n){var i=[];return R(e,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function k6e(e){e.registerAction(A6e,t),e.registerAction(M6e,t),e.registerAction(P6e,t);function t(r,n){var i=[],a=jd(n,r);function o(s,l){R(a[s],function(u){var c=u.updateAxisBreaks(r);R(c.breaks,function(f){var h;i.push(Ie((h={},h[l]=u.componentIndex,h),f))})})}return o("xAxisModels","xAxisIndex"),o("yAxisModels","yAxisIndex"),o("singleAxisModels","singleAxisIndex"),{eventBreaks:i}}}var ru=Math.PI,L6e=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],O6e=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],Ov=rt(),Bre=rt(),zre=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 I6e(e,t,r,n){var i=r.axis,a=t.ensureRecord(r),o=[],s,l=LR(e.axisName)&&Pv(e.nameLocation);R(n,function(v){var m=ls(v);if(!(!m||m.label.ignore)){o.push(m);var y=a.transGroup;l&&(y.transform?Oa(Pg,y.transform):G0(Pg),m.transform&&so(Pg,Pg,m.transform),je.copy(ib,m.localRect),ib.applyTransform(Pg),s?s.union(ib):je.copy(s=new je(0,0,0,0),ib))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",c=a.transGroup[u];if(o.sort(function(v,m){return Math.abs(v.label[u]-c)-Math.abs(m.label[u]-c)}),l&&s){var f=i.getExtent(),h=Math.min(f[0],f[1]),d=Math.max(f[0],f[1])-h;s.union(new je(h,0,d,1))}a.stOccupiedRect=s,a.labelInfoList=o}var Pg=an(),ib=new je(0,0,0,0),$re=function(e,t,r,n,i,a){if(Pv(e.nameLocation)){var o=a.stOccupiedRect;o&&Fre(LFe({},o,a.transGroup.transform),n,i)}else Vre(a.labelInfoList,a.dirVec,n,i)};function Fre(e,t,r){var n=new De;zC(e,t,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&FI(t,n)}function Vre(e,t,r,n){for(var i=De.dot(n,t)>=0,a=0,o=e.length;a0?"top":"bottom",a="center"):bv(i-ru)?(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}(),E6e=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],N6e={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],f=[l[1],0],h=c[0]>f[0];u&&(xr(c,c,u),xr(f,f,u));var d=ie({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),v={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:d};if(n.get(["axisLine","breakLine"])&&n.axis.scale.hasBreaks())ax().buildAxisBreakLine(n,i,a,v);else{var m=new Pr(ie({shape:{x1:c[0],y1:c[1],x2:f[0],y2:f[1]}},v));Tv(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"]);me(y)&&(y=[y,y]),(me(x)||ut(x))&&(x=[x,x]);var _=ih(n.get(["axisLine","symbolOffset"])||0,x),b=x[0],S=x[1];R([{rotate:e.rotation+Math.PI/2,offset:_[0],r:0},{rotate:e.rotation-Math.PI/2,offset:_[1],r:Math.sqrt((c[0]-f[0])*(c[0]-f[0])+(c[1]-f[1])*(c[1]-f[1]))}],function(T,C){if(y[C]!=="none"&&y[C]!=null){var A=Lr(y[C],-b/2,-S/2,b,S,d.stroke,!0),P=T.r+T.offset,O=h?f:c;A.attr({rotation:T.rotate,x:O[0]+P*Math.cos(e.rotation),y:O[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=uW(t,i,s);l&&lW(e,t,r,n,i,a,o,mo.estimate)},axisTickLabelDetermine:function(e,t,r,n,i,a,o,s){var l=uW(t,i,s);l&&lW(e,t,r,n,i,a,o,mo.determine);var u=B6e(e,i,a,n);R6e(e,t.labelLayoutList,u),z6e(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(LR(u)){var c=e.nameLocation,f=e.nameDirection,h=n.getModel("nameTextStyle"),d=n.get("nameGap")||0,v=n.axis.getExtent(),m=n.axis.inverse?-1:1,y=new De(0,0),x=new De(0,0);c==="start"?(y.x=v[0]-m*d,x.x=-m):c==="end"?(y.x=v[1]+m*d,x.x=m):(y.x=(v[0]+v[1])/2,y.y=e.labelOffset+f*d,x.y=f);var _=an();x.transform(_l(_,_,e.rotation));var b=n.get("nameRotate");b!=null&&(b=b*ru/180);var S,T;Pv(c)?S=oi.innerTextLayout(e.rotation,b??e.rotation,f):(S=D6e(e.rotation,c,b||0,v),T=e.raw.axisNameAvailableWidth,T!=null&&(T=Math.abs(T/Math.sin(S.rotation)),!isFinite(T)&&(T=null)));var C=h.getFont(),A=n.get("nameTruncate",!0)||{},P=A.ellipsis,O=mn(e.raw.nameTruncateMaxWidth,A.maxWidth,T),k=s.nameMarginLevel||0,E=new lt({x:y.x,y:y.y,rotation:S.rotation,silent:oi.isLabelSilent(n),style:Dt(h,{text:u,font:C,overflow:"truncate",width:O,ellipsis:P,fill:h.getTextColor()||n.get(["axisLine","lineStyle","color"]),align:h.get("align")||S.textAlign,verticalAlign:h.get("verticalAlign")||S.textVerticalAlign}),z2:1});if(wl({el:E,componentModel:n,itemName:u}),E.__fullText=u,E.anid="name",n.get("triggerEvent")){var N=oi.makeAxisEventDataBase(n);N.targetType="axisName",N.name=u,Be(E).eventData=N}a.add(E),E.updateTransform(),t.nameEl=E;var D=l.nameLayout=ls({label:E,priority:E.z2,defaultAttr:{ignore:E.ignore},marginDefault:Pv(c)?L6e[k]:O6e[k]});if(l.nameLocation=c,i.add(E),E.decomposeTransform(),e.shouldNameMoveOverlap&&D){var z=r.ensureRecord(n);r.resolveAxisNameOverlap(e,r,n,D,x,z)}}}};function lW(e,t,r,n,i,a,o,s){Wre(t)||$6e(e,t,i,s,n,o);var l=t.labelLayoutList;F6e(e,n,l,a),W6e(n,e.rotation,l);var u=e.optionHideOverlap;j6e(n,l,u),u&&ere(gt(l,function(c){return c&&!c.label.ignore})),I6e(e,r,n,l)}function D6e(e,t,r,n){var i=uj(r-e),a,o,s=n[0]>n[1],l=t==="start"&&!s||t!=="start"&&s;return bv(i-ru/2)?(o=l?"bottom":"top",a="center"):bv(i-ru*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iru/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function j6e(e,t,r){if(Rte(e.axis))return;function n(s,l,u){var c=ls(t[l]),f=ls(t[u]);if(!(!c||!f)){if(s===!1||c.suggestIgnore){im(c.label);return}if(f.suggestIgnore){im(f.label);return}var h=.1;if(!r){var d=[0,0,0,0];c=VI({marginForce:d},c),f=VI({marginForce:d},f)}zC(c,f,null,{touchThreshold:h})&&im(s?f.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 R6e(e,t,r){e.showMinorTicks||R(t,function(n){if(n&&n.label.ignore)for(var i=0;iu[0]&&isFinite(v)&&isFinite(u[0]);)d=NM(d),v=u[1]-d*o;else{var y=e.getTicks().length-1;y>o&&(d=NM(d));var x=d*o;m=Math.ceil(u[1]/d)*d,v=Mr(m-x),v<0&&u[0]>=0?(v=0,m=Mr(x)):m>0&&u[1]<=0&&(m=0,v=-Mr(x))}var _=(i[0].value-a[0].value)/s,b=(i[o].value-a[o].value)/s;n.setExtent.call(e,v+d*_,m+d*b),n.setInterval.call(e,d),(_||b)&&n.setNiceExtent.call(e,v+d,m-d)}var fW=[[3,1],[0,2]],Y6e=function(){function e(t,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=qI,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=st(o),u=l.length;if(u){for(var c=[],f=u-1;f>=0;f--){var h=+l[f],d=o[h],v=d.model,m=d.scale;DI(m)&&v.get("alignTicks")&&v.get("interval")==null?c.push(d):(Ff(m,v),DI(m)&&(s=d))}c.length&&(s||(s=c.pop(),Ff(s.scale,s.model)),R(c,function(y){Hre(y.scale,y.model,s.scale)}))}}i(n.x),i(n.y);var a={};R(n.x,function(o){hW(n,"y",o,a)}),R(n.y,function(o){hW(n,"x",o,a)}),this.resize(this.model,r)},e.prototype.resize=function(t,r,n){var i=qr(t,r),a=this._rect=Zt(t.getBoxLayoutParams(),i.refContainer),o=this._axesMap,s=this._coordsList,l=t.get("containLabel");if(JI(o,a),!n){var u=K6e(a,s,o,l,r),c=void 0;if(l)QI?(QI(this._axesList,a),JI(o,a)):c=pW(a.clone(),"axisLabel",null,a,o,u,i);else{var f=J6e(t,a,i),h=f.outerBoundsRect,d=f.parsedOuterBoundsContain,v=f.outerBoundsClamp;h&&(c=pW(h,d,v,a,o,u,i))}Ure(a,o,mo.determine,null,c,i)}R(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]}Ee(t)&&(r=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,a=this._coordsList;i0})==null;return Bf(n,s,!0,!0,r),JI(i,n),l;function u(h){R(i[Ge[h]],function(d){if(c0(d.model)){var v=a.ensureRecord(d.model),m=v.labelInfoList;if(m)for(var y=0;y0&&!On(d)&&d>1e-4&&(h/=d),h}}function K6e(e,t,r,n,i){var a=new zre(Q6e);return R(r,function(o){return R(o,function(s){if(c0(s.model)){var l=!n;s.axisBuilder=U6e(e,t,s.model,i,a,l)}})}),a}function Ure(e,t,r,n,i,a){var o=r===mo.determine;R(t,function(u){return R(u,function(c){c0(c.model)&&(Z6e(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[Ge[1-u]]=e[Br[u]]<=a.refContainer[Br[u]]*.5?0:1-u===1?2:1}R(t,function(u,c){return R(u,function(f){c0(f.model)&&((n==="all"||o)&&f.axisBuilder.build({axisName:!0},{nameMarginLevel:s[c]}),o&&f.axisBuilder.build({axisLine:!0}))})})}function J6e(e,t,r){var n,i=e.get("outerBoundsMode",!0);i==="same"?n=t.clone():(i==null||i==="auto")&&(n=Zt(e.get("outerBounds",!0)||Ire,r.refContainer));var a=e.get("outerBoundsContain",!0),o;a==null||a==="auto"||Ye(["all","axisLabel"],a)<0?o="all":o=a;var s=[Qw(Ae(e.get("outerBoundsClampWidth",!0),MS[0]),t.width),Qw(Ae(e.get("outerBoundsClampHeight",!0),MS[1]),t.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var Q6e=function(e,t,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";$re(e,t,r,n,i,a),Pv(e.nameLocation)||R(t.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&Vre(s.labelInfoList,s.dirVec,n,i)})};function eGe(e,t){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return tGe(r,e,t),r.seriesInvolved&&nGe(r,e),r}function tGe(e,t,r){var n=t.getComponent("tooltip"),i=t.getComponent("axisPointer"),a=i.get("link",!0)||[],o=[];R(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=v0(s.model),u=e.coordSysAxesInfo[l]={};e.coordSysMap[l]=s;var c=s.model,f=c.getModel("tooltip",n);if(R(s.getAxes(),Ue(m,!1,null)),s.getTooltipAxes&&n&&f.get("show")){var h=f.get("trigger")==="axis",d=f.get(["axisPointer","type"])==="cross",v=s.getTooltipAxes(f.get(["axisPointer","axis"]));(h||d)&&R(v.baseAxes,Ue(m,d?"cross":!0,h)),d&&R(v.otherAxes,Ue(m,"cross",!1))}function m(y,x,_){var b=_.model.getModel("axisPointer",i),S=b.get("show");if(!(!S||S==="auto"&&!y&&!eE(b))){x==null&&(x=b.get("triggerTooltip")),b=y?rGe(_,f,i,t,y,x):b;var T=b.get("snap"),C=b.get("triggerEmphasis"),A=v0(_.model),P=x||T||_.type==="category",O=e.axesInfo[A]={key:A,axis:_,coordSys:s,axisPointerModel:b,triggerTooltip:x,triggerEmphasis:C,involveSeries:P,snap:T,useHandle:eE(b),seriesModels:[],linkGroup:null};u[A]=O,e.seriesInvolved=e.seriesInvolved||P;var k=iGe(a,_);if(k!=null){var E=o[k]||(o[k]={axesInfo:{}});E.axesInfo[A]=O,E.mapper=a[k].mapper,O.linkGroup=E}}}})}function rGe(e,t,r,n,i,a){var o=t.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};R(s,function(h){l[h]=ke(o.get(h))}),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 f=l.lineStyle=o.get("crossStyle");f&&Ie(u,f.textStyle)}}return e.model.getModel("axisPointer",new it(l,r,n))}function nGe(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||R(e.coordSysAxesInfo[v0(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 iGe(e,t){for(var r=t.model,n=t.dim,i=0;i=0||e===t}function aGe(e){var t=OR(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=eE(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 hGe=rt();function yW(e,t,r,n){if(e instanceof Dre){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?Jre(r,o,u,n):dGe(e,t,r,n,o,l):r}function Jre(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 dGe(e,t,r,n,i,a){var o=hGe(e);o.items||(o.items=[]);var s=o.items,l=xW(s,t,r,n,i,a,1),u=xW(s,t,r,n,i,a,-1),c=Math.abs(l-r)i/2||f&&h>f/2-n?Jre(r,i,f,n):(s.push({fixedCoord:t,floatCoord:c,r:n}),c)}function xW(e,t,r,n,i,a,o){for(var s=r,l=0;li/2)return Number.MAX_VALUE;if(o===1&&v>s||o===-1&&v0&&!v.min?v.min=0:v.min!=null&&v.min<0&&!v.max&&(v.max=0);var m=l;v.color!=null&&(m=Ie({color:v.color},l));var y=Xe(ke(v),{boundaryGap:r,splitNumber:n,scale:i,axisLine:a,axisTick:o,axisLabel:s,name:v.text,showName:u,nameLocation:"end",nameGap:f,nameTextStyle:m,triggerEvent:h},!1);if(me(c)){var x=y.name;y.name=c.replace("{value}",x??"")}else Pe(c)&&(y.name=c(y.name,y));var _=new it(y,null,this.ecModel);return br(_,wp.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:J.color.axisLabel},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Xe({lineStyle:{color:J.color.neutral20}},kg.axisLine),axisLabel:ab(kg.axisLabel,!1),axisTick:ab(kg.axisTick,!1),splitLine:ab(kg.splitLine,!0),splitArea:ab(kg.splitArea,!0),indicator:[]},t}(tt),wGe=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=le(a,function(s){var l=s.model.get("showName")?s.name:"",u=new oi(s.model,n,{axisName:l,position:[i.cx,i.cy],rotation:s.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return u});R(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"),f=s.get("show"),h=l.get("color"),d=u.get("color"),v=oe(h)?h:[h],m=oe(d)?d:[d],y=[],x=[];function _(V,F,$){var B=$%F.length;return V[B]=V[B]||[],B}if(a==="circle")for(var b=i[0].getTicksCoords(),S=n.cx,T=n.cy,C=0;C3?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 f=Math.abs(a),h=(a>0?1:-1)*(f>3?.4:f>1?.15:.05);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:h,originX:s,originY:l,isAvailableBehavior:null})}}}},t.prototype._pinchHandler=function(r){if(!(wW(this._zr,"globalPan")||Lg(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)&&(ul(a.event),a.__ecRoamConsumed=!0,SW(r,n,i,a,o))},t}(ja);function Lg(e){return e.__ecRoamConsumed}var LGe=rt();function VC(e){var t=LGe(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function Og(e,t,r,n){for(var i=VC(e),a=i.roam,o=a[t]=a[t]||[],s=0;s=4&&(c={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(c&&s!=null&&l!=null&&(f=ine(c,{x:0,y:0,width:s,height:l}),!r.ignoreViewBox)){var d=i;i=new Le,i.add(d),d.scaleX=d.scaleY=f.scale,d.x=f.x,d.y=f.y}return!r.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new Qe({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:c,viewBoxTransform:f,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=JM[s];if(c&&Se(JM,s)){l=c.call(this,t,r);var f=t.getAttribute("name");if(f){var h={name:f,namedFrom:null,svgNodeTagLower:s,el:l};n.push(h),s==="g"&&(u=h)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});r.add(l)}}var d=MW[s];if(d&&Se(MW,s)){var v=d.call(this,t),m=t.getAttribute("id");m&&(this._defs[m]=v)}}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 wv({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});sa(r,n),Li(t,n,this._defsUsePending,!1,!1),NGe(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(){JM={g:function(t,r){var n=new Le;return sa(r,n),Li(t,n,this._defsUsePending,!1,!1),n},rect:function(t,r){var n=new Qe;return sa(r,n),Li(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 ds;return sa(r,n),Li(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 Pr;return sa(r,n),Li(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 Z0;return sa(r,n),Li(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=LW(n));var a=new jn({shape:{points:i||[]},silent:!0});return sa(r,a),Li(t,a,this._defsUsePending,!1,!1),a},polyline:function(t,r){var n=t.getAttribute("points"),i;n&&(i=LW(n));var a=new xn({shape:{points:i||[]},silent:!0});return sa(r,a),Li(t,a,this._defsUsePending,!1,!1),a},image:function(t,r){var n=new un;return sa(r,n),Li(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 Le;return sa(r,s),Li(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 Le;return sa(r,s),Li(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=_Q(n);return sa(r,i),Li(t,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),e}(),MW={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 eh(t,r,n,i);return PW(e,a),kW(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 Tj(t,r,n);return PW(e,i),kW(e,i),i}};function PW(e,t){var r=e.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(t.global=!0)}function kW(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={};nne(r,a,a);var o=a.stopColor||r.getAttribute("stop-color")||"#000000",s=a.stopOpacity||r.getAttribute("stop-opacity");if(s){var l=Xn(o),u=l&&l[3];u&&(l[3]*=Ys(s),o=Ca(l,"rgba"))}t.colorStops.push({offset:i,color:o})}r=r.nextSibling}}function sa(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),Ie(t.__inheritedStyle,e.__inheritedStyle))}function LW(e){for(var t=WC(e),r=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=WC(o);switch(i=i||an(),s){case"translate":po(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":gC(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":_l(i,i,-parseFloat(l[0])*QM,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*QM);so(i,[1,0,u,1,0,0],i);break;case"skewY":var c=Math.tan(parseFloat(l[0])*QM);so(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 IW=/([^\s:;]+)\s*:\s*([^:;]+)/g;function nne(e,t,r){var n=e.getAttribute("style");if(n){IW.lastIndex=0;for(var i;(i=IW.exec(n))!=null;){var a=i[1],o=Se(kS,a)?kS[a]:null;o&&(t[o]=i[2]);var s=Se(LS,a)?LS[a]:null;s&&(r[s]=i[2])}}}function $Ge(e,t,r){for(var n=0;n0,_={api:n,geo:l,mapOrGeoModel:t,data:s,isVisualEncodedByVisualMap:x,isGeo:o,transformInfoRaw:h};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=Ce(),n=Ce(),i=this._regionsGroup,a=t.transformInfoRaw,o=t.mapOrGeoModel,s=t.data,l=t.geo.projection,u=l&&l.stream;function c(d,v){return v&&(d=v(d)),d&&[d[0]*a.scaleX+a.x,d[1]*a.scaleY+a.y]}function f(d){for(var v=[],m=!u&&l&&l.project,y=0;y=0)&&(h=i);var d=o?{normal:{align:"center",verticalAlign:"middle"}}:null;sn(t,Xr(n),{labelFetcher:h,labelDataIndex:f,defaultText:r},d);var v=t.getTextContent();if(v&&(ane(v).ignore=v.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 RW(e,t,r,n,i,a){e.data?e.data.setItemGraphicEl(a,t):Be(t).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:r,region:n&&n.option||{}}}function BW(e,t,r,n,i){e.data||wl({el:t,componentModel:i,itemName:r,itemTooltipOption:n.get("tooltip")})}function zW(e,t,r,n,i){t.highDownSilentOnTouch=!!i.get("selectedMode");var a=n.getModel("emphasis"),o=a.get("focus");return qt(t,o,a.get("blurScope"),a.get("disabled")),e.isGeo&&X3e(t,i,r),o}function $W(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(),R(e,function(l){s.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill=J.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:J.color.tertiary},itemStyle:{borderWidth:.5,borderColor:J.color.border,areaColor:J.color.background},emphasis:{label:{show:!0,color:J.color.primary},itemStyle:{areaColor:J.color.highlight}},select:{label:{show:!0,color:J.color.primary},itemStyle:{color:J.color.highlight}},nameProperty:"name"},t}(Ot);function oWe(e,t){var r={};return R(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?(b.width=_,b.height=_/m):(b.height=_,b.width=_*m),b.y=x[1]-b.height/2,b.x=x[0]-b.width/2;else{var S=e.getBoxLayoutParams();S.aspect=m,b=Zt(S,v),b=eee(e,b,m)}this.setViewRect(b.x,b.y,b.width,b.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function cWe(e,t){R(t.get("geoCoord"),function(r,n){e.addGeoCoord(n,r)})}var fWe=function(){function e(){this.dimensions=sne}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 nE(l+s,l,ie({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=WW,u.resize(o,r)}),t.eachSeries(function(o){J0({targetModel:o,coordSysType:"geo",coordSysProvider:function(){var s=o.subType==="map"?o.getHostGeoModel():o.getReferringComponents("geo",fr).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)}}),R(a,function(o,s){var l=le(o,function(c){return c.get("nameMap")}),u=new nE(s,s,ie({nameMap:dC(l),api:r,ecModel:t},i(o[0])));u.zoomLimit=mn.apply(null,le(o,function(c){return c.get("scaleLimit")})),n.push(u),u.resize=WW,u.resize(o[0],r),R(o,function(c){c.coordinateSystem=u,cWe(u,c)})}),n},e.prototype.getFilledRegions=function(t,r,n,i){for(var a=(t||[]).slice(),o=Ce(),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 mWe(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){xWe(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=_We(e,i,e.parentNode.hierNode.defaultAncestor||n[0],t)}function yWe(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function HW(e){return arguments.length?e:SWe}function am(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function xWe(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 _We(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,f=s.hierNode.modifier;s=eP(s),a=tP(a),s&&a;){i=eP(i),o=tP(o),i.hierNode.ancestor=e;var h=s.hierNode.prelim+f-a.hierNode.prelim-u+n(s,a);h>0&&(wWe(bWe(s,e,r),e,h),u+=h,l+=h),f+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,c+=o.hierNode.modifier}s&&!eP(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=f-l),a&&!tP(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,r=e)}return r}function eP(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function tP(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function bWe(e,t,r){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:r}function wWe(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 SWe(e,t){return e.parentNode===t.parentNode?1:2}var TWe=function(){function e(){this.parentPoint=[],this.childPoints=[]}return e}(),CWe=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultStyle=function(){return{stroke:J.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new TWe},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,f=1-c,h=ge(n.forkPosition,1),d=[];d[c]=o[c],d[f]=o[f]+(l[f]-o[f])*h,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 v=1;v_.x,T||(S=S-Math.PI));var A=T?"left":"right",P=s.getModel("label"),O=P.get("rotate"),k=O*(Math.PI/180),E=y.getTextContent();E&&(y.setTextConfig({position:P.get("position")||A,rotation:O==null?-S:k,origin:"center"}),E.setStyle("verticalAlign","middle"))}var N=s.get(["emphasis","focus"]),D=N==="relative"?yv(o.getAncestorsIndices(),o.getDescendantIndices()):N==="ancestor"?o.getAncestorsIndices():N==="descendant"?o.getDescendantIndices():null;D&&(Be(r).focus=D),MWe(i,o,c,r,v,d,m,n),r.__edge&&(r.onHoverStateChange=function(z){if(z!=="blur"){var V=o.parentNode&&e.getItemGraphicEl(o.parentNode.dataIndex);V&&V.hoverState===U0||nS(r.__edge,z)}})}function MWe(e,t,r,n,i,a,o,s){var l=t.getModel(),u=e.get("edgeShape"),c=e.get("layout"),f=e.getOrient(),h=e.get(["lineStyle","curveness"]),d=e.get("edgeForkPosition"),v=l.getModel("lineStyle").getLineStyle(),m=n.__edge;if(u==="curve")t.parentNode&&t.parentNode!==r&&(m||(m=n.__edge=new cp({shape:iE(c,f,h,i,i)})),ft(m,{shape:iE(c,f,h,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(me(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 dne(e){for(var t=[];e;)e=e.parentNode,e&&t.push(e);return t.reverse()}function zR(e,t){var r=dne(e);return Ye(r,t)>=0}function HC(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 jWe=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 it(i,this,this.ecModel),o=BR.createTree(n,this,s);function s(f){f.wrapMethod("getItemModel",function(h,d){var v=o.getNodeByDataIndex(d);return v&&v.children.length&&v.isExpand||(h.parentModel=a),h})}var l=0;o.eachNode("preorder",function(f){f.depth>l&&(l=f.depth)});var u=r.expandAndCollapse,c=u&&r.initialTreeDepth>=0?r.initialTreeDepth:l;return o.root.eachNode("preorder",function(f){var h=f.hostTree.data.getRawDataItem(f.dataIndex);f.isExpand=h&&h.collapsed!=null?!h.collapsed:f.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 zr("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=HC(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:J.color.borderTint,width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t}(Ot);function RWe(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 BWe(e,t){e.eachSeriesByType("tree",function(r){zWe(r,t)})}function zWe(e,t){var r=qr(e,t).refContainer,n=Zt(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=HW(function(S,T){return(S.parentNode===T.parentNode?1:2)/S.depth})):(a=n.width,o=n.height,s=HW());var l=e.getData().tree.root,u=l.children[0];if(u){gWe(l),RWe(u,mWe,s),l.hierNode.modifier=-u.hierNode.prelim,Ng(u,yWe);var c=u,f=u,h=u;Ng(u,function(S){var T=S.getLayout().x;Tf.getLayout().x&&(f=S),S.depth>h.depth&&(h=S)});var d=c===f?1:s(c,f)/2,v=d-c.getLayout().x,m=0,y=0,x=0,_=0;if(i==="radial")m=a/(f.getLayout().x+d+v),y=o/(h.depth-1||1),Ng(u,function(S){x=(S.getLayout().x+v)*m,_=(S.depth-1)*y;var T=am(x,_);S.setLayout({x:T.x,y:T.y,rawX:x,rawY:_},!0)});else{var b=e.getOrient();b==="RL"||b==="LR"?(y=o/(f.getLayout().x+d+v),m=a/(h.depth-1||1),Ng(u,function(S){_=(S.getLayout().x+v)*y,x=b==="LR"?(S.depth-1)*m:a-(S.depth-1)*m,S.setLayout({x,y:_},!0)})):(b==="TB"||b==="BT")&&(m=a/(f.getLayout().x+d+v),y=o/(h.depth-1||1),Ng(u,function(S){x=(S.getLayout().x+v)*m,_=b==="TB"?(S.depth-1)*y:o-(S.depth-1)*y,S.setLayout({x,y:_},!0)}))}}}function $We(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");ie(s,o)})})}function FWe(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=GC(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}function VWe(e){e.registerChartView(AWe),e.registerSeriesModel(jWe),e.registerLayout(BWe),e.registerVisual($We),FWe(e)}var qW=["treemapZoomToNode","treemapRender","treemapMove"];function GWe(e){for(var t=0;t1;)a=a.parentNode;var o=bI(e.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var WWe=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};pne(i);var a=r.levels||[],o=this.designatedVisualItemStyle={},s=new it({itemStyle:o},this,n);a=r.levels=HWe(a,n);var l=le(a||[],function(f){return new it(f,s,n)},this),u=BR.createTree(i,this,c);function c(f){f.wrapMethod("getItemModel",function(h,d){var v=u.getNodeByDataIndex(d),m=v?l[v.depth]:null;return h.parentModel=m||s,h})}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 zr("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=HC(i,this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(r){this.layoutInfo=this.layoutInfo||{},ie(this.layoutInfo,r)},t.prototype.mapIdToIndex=function(r){var n=this._idIndexMap;n||(n=this._idIndexMap=Ce(),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(){vne(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,coordinateSystemUsage:"box",left:J.size.l,top:J.size.xxxl,right:J.size.l,bottom:J.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:J.size.m,emptyItemWidth:25,itemStyle:{color:J.color.backgroundShade,textStyle:{color:J.color.secondary}},emphasis:{itemStyle:{color:J.color.background}}},label:{show:!0,distance:0,padding:5,position:"inside",color:J.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:J.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}(Ot);function pne(e){var t=0;R(e.children,function(n){pne(n);var i=n.value;oe(i)&&(i=i[0]),t+=i});var r=e.value;oe(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),oe(e.value)?e.value[0]=r:e.value=r}function HWe(e,t){var r=jt(t.get("color")),n=jt(t.get(["aria","decal","decals"]));if(r){e=e||[];var i,a;R(e,function(s){var l=new it(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 UWe=8,KW=8,rP=5,ZWe=function(){function e(t){this.group=new Le,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"]),f=qr(t,r).refContainer,h={left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},d={emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]},v=Zt(h,f);this._prepare(n,d,u),this._renderContent(t,d,v,s,l,u,c,i),IC(o,h,f)}},e.prototype._prepare=function(t,r,n){for(var i=t;i;i=i.parentNode){var a=Hr(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+UWe*2,r.emptyItemWidth);r.totalWidth+=s+KW,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,f=t.get(["breadcrumb","height"]),h=r.totalWidth,d=r.renderList,v=a.getModel("itemStyle").getItemStyle(),m=d.length-1;m>=0;m--){var y=d[m],x=y.node,_=y.width,b=y.text;h>n.width&&(h-=_-c,_=c,b=null);var S=new jn({shape:{points:YWe(u,0,_,f,m===d.length-1,m===0)},style:Ie(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new lt({style:Dt(o,{text:b})}),textConfig:{position:"inside"},z2:lp*1e4,onclick:Ue(l,x)});S.disableLabelAnimation=!0,S.getTextContent().ensureState("emphasis").style=Dt(s,{text:b}),S.ensureState("emphasis").style=v,qt(S,a.get("focus"),a.get("blurScope"),a.get("disabled")),this.group.add(S),XWe(S,t,x),u+=_+KW}},e.prototype.remove=function(){this.group.removeAll()},e}();function YWe(e,t,r,n,i,a){var o=[[i?e:e-rP,t],[e+r,t],[e+r,t+n],[i?e:e-rP,t+n]];return!a&&o.splice(2,0,[e+r+rP,t+n/2]),!i&&o.push([e,t+n/2]),o}function XWe(e,t,r){Be(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&&HC(r,t)}}var qWe=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;iQW||Math.abs(r.dy)>QW)){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 je(s.x,s.y,s.width,s.height),u=null,c=this._controllerHost;u=c.zoomLimit;var f=c.zoom=c.zoom||1;if(f*=a,u){var h=u.min||0,d=u.max||1/0;f=Math.max(Math.min(d,f),h)}var v=f/c.zoom;c.zoom=f;var m=this.seriesModel.layoutInfo;n-=m.x,i-=m.y;var y=an();po(y,y,[-n,-i]),gC(y,y,[v,v]),po(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&&sS(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 ZWe(this.group))).render(r,n,i.node,function(o){a._state!=="animating"&&(zR(r.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=Dg(),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}(At);function Dg(){return{nodeGroup:[],background:[],content:[]}}function r8e(e,t,r,n,i,a,o,s,l,u){if(!o)return;var c=o.getLayout(),f=e.getData(),h=o.getModel();if(f.setItemGraphicEl(o.dataIndex,null),!c||!c.isInView)return;var d=c.width,v=c.height,m=c.borderWidth,y=c.invisible,x=o.getRawIndex(),_=s&&s.getRawIndex(),b=o.viewChildren,S=c.upperHeight,T=b&&b.length,C=h.getModel("itemStyle"),A=h.getModel(["emphasis","itemStyle"]),P=h.getModel(["blur","itemStyle"]),O=h.getModel(["select","itemStyle"]),k=C.get("borderRadius")||0,E=ce("nodeGroup",aE);if(!E)return;if(l.add(E),E.x=c.x||0,E.y=c.y||0,E.markRedraw(),OS(E).nodeWidth=d,OS(E).nodeHeight=v,c.isAboveViewRoot)return E;var N=ce("background",JW,u,QWe);N&&U(E,N,T&&c.upperLabelHeight);var D=h.getModel("emphasis"),z=D.get("focus"),V=D.get("blurScope"),F=D.get("disabled"),$=z==="ancestor"?o.getAncestorsIndices():z==="descendant"?o.getDescendantIndices():z;if(T)e0(E)&&af(E,!1),N&&(af(N,!F),f.setItemGraphicEl(o.dataIndex,N),cI(N,$,V));else{var B=ce("content",JW,u,e8e);B&&Z(E,B),N.disableMorphing=!0,N&&e0(N)&&af(N,!1),af(E,!F),f.setItemGraphicEl(o.dataIndex,E);var H=h.getShallow("cursor");H&&B.attr("cursor",H),cI(E,$,V)}return E;function U(ye,ne,ve){var ue=Be(ne);if(ue.dataIndex=o.dataIndex,ue.seriesIndex=e.seriesIndex,ne.setShape({x:0,y:0,width:d,height:v,r:k}),y)Y(ne);else{ne.invisible=!1;var ee=o.getVisual("style"),We=ee.stroke,be=r8(C);be.fill=We;var Ve=zc(A);Ve.fill=A.get("borderColor");var Ze=zc(P);Ze.fill=P.get("borderColor");var ht=zc(O);if(ht.fill=O.get("borderColor"),ve){var Bt=d-2*m;K(ne,We,ee.opacity,{x:m,y:0,width:Bt,height:S})}else ne.removeTextContent();ne.setStyle(be),ne.ensureState("emphasis").style=Ve,ne.ensureState("blur").style=Ze,ne.ensureState("select").style=ht,Rf(ne)}ye.add(ne)}function Z(ye,ne){var ve=Be(ne);ve.dataIndex=o.dataIndex,ve.seriesIndex=e.seriesIndex;var ue=Math.max(d-2*m,0),ee=Math.max(v-2*m,0);if(ne.culling=!0,ne.setShape({x:m,y:m,width:ue,height:ee,r:k}),y)Y(ne);else{ne.invisible=!1;var We=o.getVisual("style"),be=We.fill,Ve=r8(C);Ve.fill=be,Ve.decal=We.decal;var Ze=zc(A),ht=zc(P),Bt=zc(O);K(ne,be,We.opacity,null),ne.setStyle(Ve),ne.ensureState("emphasis").style=Ze,ne.ensureState("blur").style=ht,ne.ensureState("select").style=Bt,Rf(ne)}ye.add(ne)}function Y(ye){!ye.invisible&&a.push(ye)}function K(ye,ne,ve,ue){var ee=h.getModel(ue?t8:e8),We=Hr(h.get("name"),null),be=ee.getShallow("show");sn(ye,Xr(h,ue?t8:e8),{defaultText:be?We:null,inheritColor:ne,defaultOpacity:ve,labelFetcher:e,labelDataIndex:o.dataIndex});var Ve=ye.getTextContent();if(Ve){var Ze=Ve.style,ht=F0(Ze.padding||0);ue&&(ye.setTextConfig({layoutRect:ue}),Ve.disableLabelLayout=!0),Ve.beforeUpdate=function(){var Kt=Math.max((ue?ue.width:ye.shape.width)-ht[1]-ht[3],0),cn=Math.max((ue?ue.height:ye.shape.height)-ht[0]-ht[2],0);(Ze.width!==Kt||Ze.height!==cn)&&Ve.setStyle({width:Kt,height:cn})},Ze.truncateMinChar=2,Ze.lineOverflow="truncate",te(Ze,ue,c);var Bt=Ve.getState("emphasis");te(Bt?Bt.style:null,ue,c)}}function te(ye,ne,ve){var ue=ye?ye.text:null;if(!ne&&ve.isLeafRoot&&ue!=null){var ee=e.get("drillDownIcon",!0);ye.text=ee?ee+" "+ue:ue}}function ce(ye,ne,ve,ue){var ee=_!=null&&r[ye][_],We=i[ye];return ee?(r[ye][_]=null,de(We,ee)):y||(ee=new ne,ee instanceof Ia&&(ee.z2=n8e(ve,ue)),Oe(We,ee)),t[ye][x]=ee}function de(ye,ne){var ve=ye[x]={};ne instanceof aE?(ve.oldX=ne.x,ve.oldY=ne.y):ve.oldShape=ie({},ne.shape)}function Oe(ye,ne){var ve=ye[x]={},ue=o.parentNode,ee=ne instanceof Le;if(ue&&(!n||n.direction==="drillDown")){var We=0,be=0,Ve=i.background[ue.getRawIndex()];!n&&Ve&&Ve.oldShape&&(We=Ve.oldShape.width,be=Ve.oldShape.height),ee?(ve.oldX=0,ve.oldY=be):ve.oldShape={x:We,y:be,width:0,height:0}}ve.fadein=!ee}}function n8e(e,t){return e*JWe+t}var g0=R,i8e=Ee,IS=-1,on=function(){function e(t){var r=t.mappingMethod,n=t.type,i=this.option=ke(t);this.type=n,this.mappingMethod=r,this._normalizeData=s8e[r];var a=e.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(nP(i),a8e(i)):r==="category"?i.categories?o8e(i):nP(i,!0):(Nn(r!=="linear"||i.dataExtent),nP(i))}return e.prototype.mapValueToVisual=function(t){var r=this._normalizeData(t);return this._normalizedToVisual(r,t)},e.prototype.getNormalizer=function(){return xe(this._normalizeData,this)},e.listVisualTypes=function(){return st(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(t,r,n){Ee(t)?R(t,r,n):r.call(n,t)},e.mapVisual=function(t,r,n){var i,a=oe(t)?[]:Ee(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&&g0(e.visualHandlers,function(i,a){t.hasOwnProperty(a)&&(r[a]=t[a],n=!0)}),n?r:null},e.prepareVisualTypes=function(t){if(oe(t))t=t.slice();else if(i8e(t)){var r=[];g0(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 nP(e,t){var r=e.visual,n=[];Ee(r)?g0(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]),gne(e,n)}function sb(e){return{applyVisual:function(t,r,n){var i=this.mapValueToVisual(t);n("color",e(r("color"),i))},_normalizedToVisual:oE([0,1])}}function n8(e){var t=this.option.visual;return t[Math.round(_t(e,[0,1],[0,t.length-1],!0))]||{}}function jg(e){return function(t,r,n){n(e,this.mapValueToVisual(t))}}function om(e){var t=this.option.visual;return t[this.option.loop&&e!==IS?e%t.length:e]}function $c(){return this.option.visual[0]}function oE(e){return{linear:function(t){return _t(t,e,this.option.visual,!0)},category:om,piecewise:function(t,r){var n=sE.call(this,r);return n==null&&(n=_t(t,e,this.option.visual,!0)),n},fixed:$c}}function sE(e){var t=this.option,r=t.pieceList;if(t.hasSpecialVisual){var n=on.findPieceIndex(e,r),i=r[n];if(i&&i.visual)return i.visual[this.type]}}function gne(e,t){return e.visual=t,e.type==="color"&&(e.parsedVisual=le(t,function(r){var n=Xn(r);return n||[0,0,0,1]})),t}var s8e={linear:function(e){return _t(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,r=on.findPieceIndex(e,t,!0);if(r!=null)return _t(r,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return t??IS},fixed:yr};function lb(e,t,r){return e?t<=r:t=r.length||m===r[m.depth]){var x=d8e(i,l,m,y,v,n);yne(m,x,r,n)}})}}}function c8e(e,t,r){var n=ie({},t),i=r.designatedVisualItemStyle;return R(["color","colorAlpha","colorSaturation"],function(a){i[a]=t[a];var o=e.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function i8(e){var t=iP(e,"color");if(t){var r=iP(e,"colorAlpha"),n=iP(e,"colorSaturation");return n&&(t=Xs(t,null,null,n)),r&&(t=Xy(t,r)),t}}function f8e(e,t){return t!=null?Xs(t,null,null,e):null}function iP(e,t){var r=e[t];if(r!=null&&r!=="none")return r}function h8e(e,t,r,n,i,a){if(!(!a||!a.length)){var o=aP(t,"color")||i.color!=null&&i.color!=="none"&&(aP(t,"colorAlpha")||aP(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"),f={type:o.name,dataExtent:u,visual:o.range};f.type==="color"&&(c==="index"||c==="id")?(f.mappingMethod="category",f.loop=!0):f.mappingMethod="linear";var h=new on(f);return mne(h).drColorMappingBy=c,h}}}function aP(e,t){var r=e.get(t);return oe(r)&&r.length?{name:t,range:r}:null}function d8e(e,t,r,n,i,a){var o=ie({},t);if(i){var s=i.type,l=s==="color"&&mne(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 m0=Math.max,ES=Math.min,a8=mn,$R=R,xne=["itemStyle","borderWidth"],v8e=["itemStyle","gapWidth"],p8e=["upperLabel","show"],g8e=["upperLabel","height"];const m8e={seriesType:"treemap",reset:function(e,t,r,n){var i=e.option,a=qr(e,r).refContainer,o=Zt(e.getBoxLayoutParams(),a),s=i.size||[],l=ge(a8(o.width,s[0]),a.width),u=ge(a8(o.height,s[1]),a.height),c=n&&n.type,f=["treemapZoomToNode","treemapRootToNode"],h=p0(n,f,e),d=c==="treemapRender"||c==="treemapMove"?n.rootRect:null,v=e.getViewRoot(),m=dne(v);if(c!=="treemapMove"){var y=c==="treemapZoomToNode"?S8e(e,h,v,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};v.hostTree.clearLayouts();var b={x:0,y:0,width:y[0],height:y[1],area:y[0]*y[1]};v.setLayout(b),_ne(v,_,!1,0),b=v.getLayout(),$R(m,function(T,C){var A=(m[C+1]||v).getValue();T.setLayout(ie({dataExtent:[A,A],borderWidth:0,upperHeight:0},b))})}var S=e.getData().tree.root;S.setLayout(T8e(o,d,h),!0),e.setLayoutInfo(o),bne(S,new je(-o.x,-o.y,r.getWidth(),r.getHeight()),m,v,0)}};function _ne(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(xne),u=s.get(v8e)/2,c=wne(s),f=Math.max(l,c),h=l-u,d=f-u;e.setLayout({borderWidth:l,upperHeight:f,upperLabelHeight:c},!0),i=m0(i-2*h,0),a=m0(a-h-d,0);var v=i*a,m=y8e(e,s,v,t,r,n);if(m.length){var y={x:h,y:d,width:i,height:a},x=ES(i,a),_=1/0,b=[];b.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 w8e(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?m0(u*n/l,l/(u*i)):1/0}function o8(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 f=0,h=e.length;fQO&&(u=QO),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]);f[0].8?"left":h[0]<-.8?"right":"center",m=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":a.x=-h[0]*x+c[0],a.y=-h[1]*_+c[1],v=h[0]>.8?"right":h[0]<-.8?"left":"center",m=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=x*A+c[0],a.y=c[1]+O,v=S[0]<0?"right":"left",a.originX=-x*A,a.originY=-O;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=C[0],a.y=C[1]+O,v="center",a.originY=-O;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-x*A+f[0],a.y=f[1]+O,v=S[0]>=0?"right":"left",a.originX=x*A,a.originY=-O;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||m,align:a.__align||v})}},t}(Le),HR=function(){function e(t){this.group=new Le,this._LineCtor=t||WR}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=h8(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=h8(t),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r){this._progressiveEls=[];function n(s){!s.isGroup&&!F8e(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var i=t.start;i0}function h8(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:Xr(t)}}function d8(e){return isNaN(e[0])||isNaN(e[1])}function cP(e){return e&&!d8(e[0])&&!d8(e[1])}var fP=[],hP=[],dP=[],$h=gn,vP=pu,v8=Math.abs;function p8(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){fP[0]=$h(n[0],i[0],a[0],c),fP[1]=$h(n[1],i[1],a[1],c);var f=v8(vP(fP,t)-l);f=0?s=s+u:s=s-u:v>=0?s=s-u:s=s+u}return s}function pP(e,t){var r=[],n=Zy,i=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge(function(s,l){var u=s.getLayout(),c=s.getVisual("fromSymbol"),f=s.getVisual("toSymbol");u.__original||(u.__original=[Ko(u[0]),Ko(u[1])],u[2]&&u.__original.push(Ko(u[2])));var h=u.__original;if(u[2]!=null){if(Wn(i[0],h[0]),Wn(i[1],h[2]),Wn(i[2],h[1]),c&&c!=="none"){var d=lm(s.node1),v=p8(i,h[0],d*t);n(i[0][0],i[1][0],i[2][0],v,r),i[0][0]=r[3],i[1][0]=r[4],n(i[0][1],i[1][1],i[2][1],v,r),i[0][1]=r[3],i[1][1]=r[4]}if(f&&f!=="none"){var d=lm(s.node2),v=p8(i,h[1],d*t);n(i[0][0],i[1][0],i[2][0],v,r),i[1][0]=r[1],i[2][0]=r[2],n(i[0][1],i[1][1],i[2][1],v,r),i[1][1]=r[1],i[2][1]=r[2]}Wn(u[0],i[0]),Wn(u[1],i[2]),Wn(u[2],i[1])}else{if(Wn(a[0],h[0]),Wn(a[1],h[1]),Jl(o,a[1],a[0]),Qf(o,o),c&&c!=="none"){var d=lm(s.node1);Fw(a[0],a[0],o,d*t)}if(f&&f!=="none"){var d=lm(s.node2);Fw(a[1],a[1],o,-d*t)}Wn(u[0],a[0]),Wn(u[1],a[1])}})}var kne=rt();function V8e(e){if(e)return kne(e).bridge}function g8(e,t){e&&(kne(e).bridge=t)}function m8(e){return e.type==="view"}var G8e=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 rx,a=new HR,o=this.group,s=new Le;this._controller=new oh(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(m8(o)){var f={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?this._mainGroup.attr(f):ft(this._mainGroup,f,r)}pP(r.getGraph(),sm(r));var h=r.getData();u.updateData(h);var d=r.getEdgeData();c.updateData(d),this._updateNodeAndLinkScale(),this._updateController(null,r,i),clearTimeout(this._layoutTimeout);var v=r.forceLayout,m=r.get(["force","layoutAnimation"]);v&&(s=!0,this._startForceLayoutIteration(v,i,m));var y=r.get("layout");h.graph.eachNode(function(S){var T=S.dataIndex,C=S.getGraphicEl(),A=S.getModel();if(C){C.off("drag").off("dragend");var P=A.get("draggable");P&&C.on("drag",function(k){switch(y){case"force":v.warmUp(),!a._layouting&&a._startForceLayoutIteration(v,i,m),v.setFixed(T),h.setItemLayout(T,[C.x,C.y]);break;case"circular":h.setItemLayout(T,[C.x,C.y]),S.setLayout({fixed:!0},!0),GR(r,"symbolSize",S,[k.offsetX,k.offsetY]),a.updateLayout(r);break;case"none":default:h.setItemLayout(T,[C.x,C.y]),VR(r.getGraph(),r),a.updateLayout(r);break}}).on("dragend",function(){v&&v.setUnfixed(T)}),C.setDraggable(P,!!A.get("cursor"));var O=A.get(["emphasis","focus"]);O==="adjacency"&&(Be(C).focus=S.getAdjacentDataIndices())}}),h.graph.eachEdge(function(S){var T=S.getGraphicEl(),C=S.getModel().get(["emphasis","focus"]);T&&C==="adjacency"&&(Be(T).focus={edge:[S.dataIndex],node:[S.node1.dataIndex,S.node2.dataIndex]})});var x=r.get("layout")==="circular"&&r.get(["circular","rotateLabel"]),_=h.getLayout("cx"),b=h.getLayout("cy");h.graph.eachNode(function(S){Ane(S,x,_,b)}),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(!m8(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&&(ER(this._controllerHost,i.dx,i.dy),this._updateThumbnailWindow())},t.prototype.updateViewOnZoom=function(r,n,i){this._active&&(NR(this._controllerHost,i.zoom,i.originX,i.originY),this._updateNodeAndLinkScale(),pP(r.getGraph(),sm(r)),this._lineDraw.updateLayout(),n.updateLabelLayout(),this._updateThumbnailWindow())},t.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=sm(r);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},t.prototype.updateLayout=function(r){this._active&&(pP(r.getGraph(),sm(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=V8e(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 Le,l=i.group.children(),u=a.group.children(),c=new Le,f=new Le;s.add(f),s.add(c);for(var h=0;h=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 Fc||(r=this._nodesMap[Fh(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(v)&&(t.set(v,!0),o.push(d.node1))}for(l=0;l=0&&!t.hasKey(b)&&(t.set(b,!0),s.push(_.node2))}}}return{edge:t.keys(),node:r.keys()}},e}(),Lne=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=Ce(),r=Ce();t.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],a=0;a=0&&!t.hasKey(f)&&(t.set(f,!0),n.push(c.node1))}for(a=0;a=0&&!t.hasKey(m)&&(t.set(m,!0),i.push(v.node2))}return{edge:t.keys(),node:r.keys()}},e}();function One(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)}}}br(Fc,One("hostGraph","data"));br(Lne,One("hostGraph","edgeData"));function UR(e,t,r,n,i){for(var a=new W8e(n),o=0;o "+h)),u++)}var d=r.get("coordinateSystem"),v;if(d==="cartesian2d"||d==="polar"||d==="matrix")v=vs(e,r);else{var m=gp.get(d),y=m?m.dimensions||[]:[];Ye(y,"value")<0&&y.concat(["value"]);var x=_p(e,{coordDimensions:y,encodeDefine:r.getEncode()}).dimensions;v=new qn(x,r),v.initData(e)}var _=new qn(["value"],r);return _.initData(l,s),i&&i(v,_),fne({mainData:v,struct:a,structAttr:"graph",datas:{node:v,edge:_},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var H8e=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 Cp(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),Nf(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){O8e(this);var s=UR(a,i,this,!0,l);return R(s.edges,function(u){I8e(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,c){u.wrapMethod("getItemModel",function(v){var m=o._categoriesModels,y=v.getShallow("category"),x=m[y];return x&&(x.parentModel=v.parentModel,v.parentModel=x),v});var f=it.prototype.getModel;function h(v,m){var y=f.call(this,v,m);return y.resolveParentPath=d,y}c.wrapMethod("getItemModel",function(v){return v.resolveParentPath=d,v.getModel=h,v});function d(v){if(v&&(v[0]==="label"||v[1]==="label")){var m=v.slice();return v[0]==="label"?m[0]="edgeLabel":v[1]==="label"&&(m[1]="edgeLabel"),m}return v}}},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),zr("nameValue",{name:c.join(" > "),value:o.value,noValue:o.value==null})}var f=Nee({series:this,dataIndex:r,multipleSeries:n});return f},t.prototype._updateCategoriesData=function(){var r=le(this.option.categories||[],function(i){return i.value!=null?i:ie({value:0},i)}),n=new qn(["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:J.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:J.color.primary}}},t}(Ot);function U8e(e){e.registerChartView(G8e),e.registerSeriesModel(H8e),e.registerProcessor(A8e),e.registerVisual(M8e),e.registerVisual(P8e),e.registerLayout(E8e),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,D8e),e.registerLayout(R8e),e.registerCoordinateSystem("graphView",{dimensions:sh.dimensions,create:z8e}),e.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},yr),e.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},yr),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=GC(o,t,i.get("scaleLimit"));i.setCenter&&i.setCenter(s.center),i.setZoom&&i.setZoom(s.zoom)})})}var y8=function(e){q(t,e);function t(r,n,i){var a=e.call(this)||this;Be(a).dataType="node",a.z2=2;var o=new lt;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"),f=r.getItemLayout(n),h=ie(Uo(u.getModel("itemStyle"),f,!0),f),d=this;if(isNaN(h.startAngle)){d.setShape(h);return}a?d.setShape(h):ft(d,{shape:h},l,n);var v=ie(Uo(u.getModel("itemStyle"),f,!0),f);o.setShape(v),o.useStyle(r.getItemVisual(n,"style")),Yr(o,u),this._updateLabel(l,u,s),r.setItemGraphicEl(n,d),Yr(d,u,"itemStyle");var m=c.get("focus");qt(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 f=Xr(n),h=i.getVisual("style");sn(a,f,{labelFetcher:{getFormattedLabel:function(_,b,S,T,C,A){return r.getFormattedLabel(_,b,"node",T,Ti(C,f.normal&&f.normal.get("formatter"),n.get("name")),A)}},labelDataIndex:i.dataIndex,defaultText:i.dataIndex+"",inheritColor:h.fill,defaultOpacity:h.opacity,defaultOutsidePosition:"startArc"});var d=c.get("position")||"outside",v=c.get("distance")||0,m;d==="outside"?m=o.r+v: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}(Dn),Z8e=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;return Be(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(),f=n.getItemModel(l.dataIndex),h=f.getModel("lineStyle"),d=f.getModel("emphasis"),v=d.get("focus"),m=ie(Uo(c.getModel("itemStyle"),u,!0),u),y=this;if(isNaN(m.sStartAngle)||isNaN(m.tStartAngle)){y.setShape(m);return}o?(y.setShape(m),x8(y,l,r,h)):(Ea(y),x8(y,l,r,h),ft(y,{shape:m},s,i)),qt(this,v==="adjacency"?l.getAdjacentDataIndices():v,d.get("blurScope"),d.get("disabled")),Yr(y,f,"lineStyle"),n.setItemGraphicEl(l.dataIndex,y)},t}(at);function x8(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(me(l)&&me(u)){var c=e.shape,f=(c.s1[0]+c.s2[0])/2,h=(c.s1[1]+c.s2[1])/2,d=(c.t1[0]+c.t2[0])/2,v=(c.t1[1]+c.t2[1])/2;o.fill=new eh(f,h,d,v,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var Y8e=Math.PI/180,X8e=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")*Y8e;if(a.diff(o).add(function(c){var f=a.getItemLayout(c);if(f){var h=new y8(a,c,l);Be(h).dataIndex=c,s.add(h)}}).update(function(c,f){var h=o.getItemGraphicEl(f),d=a.getItemLayout(c);if(!d){h&&qs(h,r,f);return}h?h.updateData(a,c,l):h=new y8(a,c,l),s.add(h)}).remove(function(c){var f=o.getItemGraphicEl(c);f&&qs(f,r,c)}).execute(),!o){var u=r.get("center");this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=ge(u[0],i.getWidth()),this.group.originY=ge(u[1],i.getHeight()),Gt(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 Z8e(i,a,l,n);Be(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&&qs(u,r,l)}).execute(),this._edgeData=a},t.prototype.dispose=function(){},t.type="chord",t}(At),q8e=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 Cp(xe(this.getData,this),xe(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=UR(a,i,this,!0,s);return o.data}function s(l,u){var c=it.prototype.getModel;function f(d,v){var m=c.call(this,d,v);return m.resolveParentPath=h,m}u.wrapMethod("getItemModel",function(d){return d.resolveParentPath=h,d.getModel=f,d});function h(d){if(d&&(d[0]==="label"||d[1]==="label")){var v=d.slice();return d[0]==="label"?v[0]="edgeLabel":d[1]==="label"&&(v[1]="edgeLabel"),v}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),zr("nameValue",{name:c.join(" > "),value:a.value,noValue:a.value==null})}return zr("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}(Ot),gP=Math.PI/180;function K8e(e,t){e.eachSeriesByType("chord",function(r){J8e(r,t)})}function J8e(e,t){var r=e.getData(),n=r.graph,i=e.getEdgeData(),a=i.count();if(a){var o=QQ(e,t),s=o.cx,l=o.cy,u=o.r,c=o.r0,f=Math.max((e.get("padAngle")||0)*gP,0),h=Math.max((e.get("minAngle")||0)*gP,0),d=-e.get("startAngle")*gP,v=d+Math.PI*2,m=e.get("clockwise"),y=m?1:-1,x=[d,v];CC(x,!m);var _=x[0],b=x[1],S=b-_,T=r.getSum("value")===0&&i.getSum("value")===0,C=[],A=0;n.eachEdge(function(B){var H=T?1:B.getValue("value");T&&(H>0||h)&&(A+=2);var U=B.node1.dataIndex,Z=B.node2.dataIndex;C[U]=(C[U]||0)+H,C[Z]=(C[Z]||0)+H});var P=0;if(n.eachNode(function(B){var H=B.getValue("value");isNaN(H)||(C[B.dataIndex]=Math.max(H,C[B.dataIndex]||0)),!T&&(C[B.dataIndex]>0||h)&&A++,P+=C[B.dataIndex]||0}),!(A===0||P===0)){f*A>=Math.abs(S)&&(f=Math.max(0,(Math.abs(S)-h*A)/A)),(f+h)*A>=Math.abs(S)&&(h=(Math.abs(S)-f*A)/A);var O=(S-f*A*y)/P,k=0,E=0,N=0;n.eachNode(function(B){var H=C[B.dataIndex]||0,U=O*(P?H:1)*y;Math.abs(U)E){var z=k/E;n.eachNode(function(B){var H=B.getLayout().angle;Math.abs(H)>=h?B.setLayout({angle:H*z,ratio:z},!0):B.setLayout({angle:h,ratio:h===0?1:H/h},!0)})}else n.eachNode(function(B){if(!D){var H=B.getLayout().angle,U=Math.min(H/N,1),Z=U*k;H-Zh&&h>0){var U=D?1:Math.min(H/N,1),Z=H-h,Y=Math.min(Z,Math.min(V,k*U));V-=Y,B.setLayout({angle:H-Y,ratio:(H-Y)/H},!0)}else h>0&&B.setLayout({angle:h,ratio:H===0?1:h/H},!0)}});var F=_,$=[];n.eachNode(function(B){var H=Math.max(B.getLayout().angle,h);B.setLayout({cx:s,cy:l,r0:c,r:u,startAngle:F,endAngle:F+H*y,clockwise:m},!0),$[B.dataIndex]=F,F+=(H+f)*y}),n.eachEdge(function(B){var H=T?1:B.getValue("value"),U=O*(P?H:1)*y,Z=B.node1.dataIndex,Y=$[Z]||0,K=Math.abs((B.node1.getLayout().ratio||1)*U),te=Y+K*y,ce=[s+c*Math.cos(Y),l+c*Math.sin(Y)],de=[s+c*Math.cos(te),l+c*Math.sin(te)],Oe=B.node2.dataIndex,ye=$[Oe]||0,ne=Math.abs((B.node2.getLayout().ratio||1)*U),ve=ye+ne*y,ue=[s+c*Math.cos(ye),l+c*Math.sin(ye)],ee=[s+c*Math.cos(ve),l+c*Math.sin(ve)];B.setLayout({s1:ce,s2:de,sStartAngle:Y,sEndAngle:te,t1:ue,t2:ee,tStartAngle:ye,tEndAngle:ve,cx:s,cy:l,r:c,value:H,clockwise:m}),$[Z]=te,$[Oe]=ve})}}}function Q8e(e){e.registerChartView(X8e),e.registerSeriesModel(q8e),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,K8e),e.registerProcessor(Sp("chord"))}var eHe=function(){function e(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return e}(),tHe=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 eHe},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}(at);function rHe(e,t){var r=e.get("center"),n=t.getWidth(),i=t.getHeight(),a=Math.min(n,i),o=ge(r[0],t.getWidth()),s=ge(r[1],t.getHeight()),l=ge(e.get("radius"),a/2);return{cx:o,cy:s,r:l}}function cb(e,t){var r=e==null?"":e+"";return t&&(me(t)?r=t.replace("{value}",r):Pe(t)&&(r=t(e))),r}var nHe=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=rHe(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,f=r.getModel("axisLine"),h=f.get("roundCap"),d=h?AS:Dn,v=f.get("show"),m=f.getModel("lineStyle"),y=m.get("width"),x=[u,c];CC(x,!l),u=x[0],c=x[1];for(var _=c-u,b=u,S=[],T=0;v&&T=O&&(k===0?0:a[k-1][0])Math.PI/2&&(te+=Math.PI)):K==="tangential"?te=-P-Math.PI/2:ut(K)&&(te=K*Math.PI/180),te===0?f.add(new lt({style:Dt(b,{text:H,x:Z,y:Y,verticalAlign:V<-.8?"top":V>.8?"bottom":"middle",align:z<-.4?"left":z>.4?"right":"center"},{inheritColor:U}),silent:!0})):f.add(new lt({style:Dt(b,{text:H,x:Z,y:Y,verticalAlign:"middle",align:"center"},{inheritColor:U}),silent:!0,originX:Z,originY:Y,rotation:te}))}if(_.get("show")&&F!==S){var $=_.get("distance");$=$?$+c:c;for(var ce=0;ce<=T;ce++){z=Math.cos(P),V=Math.sin(P);var de=new Pr({shape:{x1:z*(v-$)+h,y1:V*(v-$)+d,x2:z*(v-A-$)+h,y2:V*(v-A-$)+d},silent:!0,style:N});N.stroke==="auto"&&de.setStyle({stroke:a((F+ce/T)/S)}),f.add(de),P+=k}P-=k}else P+=O}},t.prototype._renderPointer=function(r,n,i,a,o,s,l,u,c){var f=this.group,h=this._data,d=this._progressEls,v=[],m=r.get(["pointer","show"]),y=r.getModel("progress"),x=y.get("show"),_=r.getData(),b=_.mapDimension("value"),S=+r.get("min"),T=+r.get("max"),C=[S,T],A=[s,l];function P(k,E){var N=_.getItemModel(k),D=N.getModel("pointer"),z=ge(D.get("width"),o.r),V=ge(D.get("length"),o.r),F=r.get(["pointer","icon"]),$=D.get("offsetCenter"),B=ge($[0],o.r),H=ge($[1],o.r),U=D.get("keepAspect"),Z;return F?Z=Lr(F,B-z/2,H-V,z,V,null,U):Z=new tHe({shape:{angle:-Math.PI/2,width:z,r:V,x:B,y:H}}),Z.rotation=-(E+Math.PI/2),Z.x=o.cx,Z.y=o.cy,Z}function O(k,E){var N=y.get("roundCap"),D=N?AS:Dn,z=y.get("overlap"),V=z?y.get("width"):c/_.count(),F=z?o.r-V:o.r-(k+1)*V,$=z?o.r:o.r-k*V,B=new D({shape:{startAngle:s,endAngle:E,cx:o.cx,cy:o.cy,clockwise:u,r0:F,r:$}});return z&&(B.z2=_t(_.get(b,k),[S,T],[100,0],!0)),B}(x||m)&&(_.diff(h).add(function(k){var E=_.get(b,k);if(m){var N=P(k,s);Gt(N,{rotation:-((isNaN(+E)?A[0]:_t(E,C,A,!0))+Math.PI/2)},r),f.add(N),_.setItemGraphicEl(k,N)}if(x){var D=O(k,s),z=y.get("clip");Gt(D,{shape:{endAngle:_t(E,C,A,z)}},r),f.add(D),oI(r.seriesIndex,_.dataType,k,D),v[k]=D}}).update(function(k,E){var N=_.get(b,k);if(m){var D=h.getItemGraphicEl(E),z=D?D.rotation:s,V=P(k,z);V.rotation=z,ft(V,{rotation:-((isNaN(+N)?A[0]:_t(N,C,A,!0))+Math.PI/2)},r),f.add(V),_.setItemGraphicEl(k,V)}if(x){var F=d[E],$=F?F.shape.endAngle:s,B=O(k,$),H=y.get("clip");ft(B,{shape:{endAngle:_t(N,C,A,H)}},r),f.add(B),oI(r.seriesIndex,_.dataType,k,B),v[k]=B}}).execute(),_.each(function(k){var E=_.getItemModel(k),N=E.getModel("emphasis"),D=N.get("focus"),z=N.get("blurScope"),V=N.get("disabled");if(m){var F=_.getItemGraphicEl(k),$=_.getItemVisual(k,"style"),B=$.fill;if(F instanceof un){var H=F.style;F.useStyle(ie({image:H.image,x:H.x,y:H.y,width:H.width,height:H.height},$))}else F.useStyle($),F.type!=="pointer"&&F.setColor(B);F.setStyle(E.getModel(["pointer","itemStyle"]).getItemStyle()),F.style.fill==="auto"&&F.setStyle("fill",a(_t(_.get(b,k),C,[0,1],!0))),F.z2EmphasisLift=0,Yr(F,E),qt(F,D,z,V)}if(x){var U=v[k];U.useStyle(_.getItemVisual(k,"style")),U.setStyle(E.getModel(["progress","itemStyle"]).getItemStyle()),U.z2EmphasisLift=0,Yr(U,E),qt(U,D,z,V)}}),this._progressEls=v)},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=Lr(s,n.cx-o/2+ge(l[0],n.r),n.cy-o/2+ge(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"),f=+r.get("max"),h=new Le,d=[],v=[],m=r.isAnimationEnabled(),y=r.get(["pointer","showAbove"]);l.diff(this._data).add(function(x){d[x]=new lt({silent:!0}),v[x]=new lt({silent:!0})}).update(function(x,_){d[x]=s._titleEls[_],v[x]=s._detailEls[_]}).execute(),l.each(function(x){var _=l.getItemModel(x),b=l.get(u,x),S=new Le,T=a(_t(b,[c,f],[0,1],!0)),C=_.getModel("title");if(C.get("show")){var A=C.get("offsetCenter"),P=o.cx+ge(A[0],o.r),O=o.cy+ge(A[1],o.r),k=d[x];k.attr({z2:y?0:2,style:Dt(C,{x:P,y:O,text:l.getName(x),align:"center",verticalAlign:"middle"},{inheritColor:T})}),S.add(k)}var E=_.getModel("detail");if(E.get("show")){var N=E.get("offsetCenter"),D=o.cx+ge(N[0],o.r),z=o.cy+ge(N[1],o.r),V=ge(E.get("width"),o.r),F=ge(E.get("height"),o.r),$=r.get(["progress","show"])?l.getItemVisual(x,"style").fill:T,k=v[x],B=E.get("formatter");k.attr({z2:y?0:2,style:Dt(E,{x:D,y:z,text:cb(b,B),width:isNaN(V)?null:V,height:isNaN(F)?null:F,align:"center",verticalAlign:"middle"},{inheritColor:$})}),DQ(k,{normal:E},b,function(U){return cb(U,B)}),m&&jQ(k,x,l,r,{getFormattedLabel:function(U,Z,Y,K,te,ce){return cb(ce?ce.interpolatedValue:b,B)}}),S.add(k)}h.add(S)}),this.group.add(h),this._titleEls=d,this._detailEls=v},t.type="gauge",t}(At),iHe=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 Tp(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,J.color.neutral10]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:J.color.axisTick,width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:J.color.axisTickMinor,width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:J.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:J.color.neutral00,borderWidth:0,borderColor:J.color.theme[0]}},title:{show:!0,offsetCenter:[0,"20%"],color:J.color.secondary,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:J.color.transparent,borderWidth:0,borderColor:J.color.neutral40,width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:J.color.primary,fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(Ot);function aHe(e){e.registerChartView(nHe),e.registerSeriesModel(iHe)}var oHe=["itemStyle","opacity"],sHe=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=i,o=new xn,s=new lt;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(oHe);c=c??1,i||Ea(a),a.useStyle(r.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,Gt(a,{style:{opacity:c}},o,n)):ft(a,{style:{opacity:c},shape:{points:l.points}},o,n),Yr(a,s),this._updateLabel(r,n),qt(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,f=r.getItemVisual(n,"style"),h=f.fill;sn(o,Xr(l),{labelFetcher:r.hostModel,labelDataIndex:n,defaultOpacity:f.opacity,defaultText:r.getName(n)},{normal:{align:c.textAlign,verticalAlign:c.verticalAlign}});var d=l.getModel("label"),v=d.get("color"),m=v==="inherit"?h: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 De(y[0][0],y[0][1]):null},ft(o,{style:{x:c.x,y:c.y}},s,n),o.attr({rotation:c.rotation,originX:c.x,originY:c.y,z2:10}),xR(i,_R(l),{stroke:h})},t}(jn),lHe=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 sHe(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);qs(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}(At),uHe=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 Cp(xe(this.getData,this),xe(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.getInitialData=function(r,n){return Tp(this,{coordDimensions:["value"],encodeDefaulter:Ue(Zj,this)})},t.prototype._defaultLabelLine=function(r){Nf(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:J.color.neutral00,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:J.color.primary}}},t}(Ot);function cHe(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();oAHe)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||!yP(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 yP(e,t){var r=e._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===t}var 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.init=function(){e.prototype.init.apply(this,arguments),this.mergeOption({})},t.prototype.mergeOption=function(r){var n=this.option;r&&Xe(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){R(["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);R(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}(tt),LHe=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}(Ba);function Iu(e,t,r,n,i,a){e=e||0;var o=r[1]-r[0];if(i!=null&&(i=Vh(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(t[1]-t[0]);s=Vh(s,[0,o]),i=a=Vh(s,[i,a]),n=0}t[0]=Vh(t[0],r),t[1]=Vh(t[1],r);var l=xP(t,n);t[n]+=e;var u=i||0,c=r.slice();l.sign<0?c[0]+=u:c[1]-=u,t[n]=Vh(t[n],c);var f;return f=xP(t,n),i!=null&&(f.sign!==l.sign||f.spana&&(t[1-n]=t[n]+f.sign*a),t}function xP(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 Vh(e,t){return Math.min(t[1]!=null?t[1]:1/0,Math.max(t[0]!=null?t[0]:-1/0,e))}var _P=R,Ene=Math.min,Nne=Math.max,w8=Math.floor,OHe=Math.ceil,S8=Mr,IHe=Math.PI,EHe=function(){function e(t,r,n){this.type="parallel",this._axesMap=Ce(),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;_P(i,function(o,s){var l=a[s],u=r.getComponent("parallelAxis",l),c=this._axesMap.set(o,new LHe(o,ex(u),[0,0],u.get("type"),l)),f=c.type==="category";c.onBand=f&&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();_P(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(i,i.mapDimension(a)),Ff(o.scale,o.model)},this)}},this)},e.prototype.resize=function(t,r){var n=qr(t,r).refContainer;this._rect=Zt(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=fb(t.get("axisExpandWidth"),l),f=fb(t.get("axisExpandCount")||0,[0,u]),h=t.get("axisExpandable")&&u>3&&u>f&&f>1&&c>0&&s>0,d=t.get("axisExpandWindow"),v;if(d)v=fb(d[1]-d[0],l),d[1]=d[0]+v;else{v=fb(c*(f-1),l);var m=t.get("axisExpandCenter")||w8(u/2);d=[c*m-v/2],d[1]=d[0]+v}var y=(s-v)/(u-f);y<3&&(y=0);var x=[w8(S8(d[0]/c,1))+1,OHe(S8(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:h,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])}),_P(n,function(o,s){var l=(i.axisExpandable?DHe:NHe)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},c={horizontal:IHe/2,vertical:0},f=[u[a].x+t.x,u[a].y+t.y],h=c[a],d=an();_l(d,d,h),po(d,d,f),this._axesLayout[o]={position:f,rotation:h,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=[];R(o,function(y){s.push(t.mapDimension(y)),l.push(a.get(y).model)});for(var u=this.hasAxisBrushed(),c=n;ca*(1-f[0])?(u="jump",l=s-a*(1-f[2])):(l=s-a*f[1])>=0&&(l=s-a*(1-f[1]))<=0&&(l=0),l*=r.axisExpandWidth/c,l?Iu(l,i,o,"all"):u="none";else{var d=i[1]-i[0],v=o[1]*s/d;i=[Nne(0,v-d/2)],i[1]=Ene(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},e}();function fb(e,t){return Ene(Nne(e,t[0]),t[1])}function NHe(e,t){var r=t.layoutLength/(t.axisCount-1);return{position:r*e,axisNameAvailableWidth:r,axisLabelShow:!0}}function DHe(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--)Vi(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;a$He}function $ne(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function Fne(e,t,r,n){var i=new Le;return i.add(new Qe({name:"main",style:KR(r),silent:!0,draggable:!0,cursor:"move",drift:Ue(A8,e,t,i,["n","s","w","e"]),ondragend:Ue(Gf,t,{isEnd:!0})})),R(n,function(a){i.add(new Qe({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Ue(A8,e,t,i,a),ondragend:Ue(Gf,t,{isEnd:!0})}))}),i}function Vne(e,t,r,n){var i=n.brushStyle.lineWidth||0,a=Iv(i,FHe),o=r[0][0],s=r[1][0],l=o-i/2,u=s-i/2,c=r[0][1],f=r[1][1],h=c-a+i/2,d=f-a+i/2,v=c-o,m=f-s,y=v+i,x=m+i;Ps(e,t,"main",o,s,v,m),n.transformable&&(Ps(e,t,"w",l,u,a,x),Ps(e,t,"e",h,u,a,x),Ps(e,t,"n",l,u,y,a),Ps(e,t,"s",l,d,y,a),Ps(e,t,"nw",l,u,a,a),Ps(e,t,"ne",h,u,a,a),Ps(e,t,"sw",l,d,a,a),Ps(e,t,"se",h,d,a,a))}function dE(e,t){var r=t.__brushOption,n=r.transformable,i=t.childAt(0);i.useStyle(KR(r)),i.attr({silent:!n,cursor:n?"move":"default"}),R([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=t.childOfName(a.join("")),s=a.length===1?vE(e,a[0]):ZHe(e,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?GHe[s]+"-resize":null})})}function Ps(e,t,r,n,i,a,o){var s=t.childOfName(r);s&&s.setShape(XHe(JR(e,t,[[n,i],[n+a,i+o]])))}function KR(e){return Ie({strokeNoScale:!0},e.brushStyle)}function Gne(e,t,r,n){var i=[x0(e,r),x0(t,n)],a=[Iv(e,r),Iv(t,n)];return[[i[0],a[0]],[i[1],a[1]]]}function UHe(e){return xu(e.group)}function vE(e,t){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=kC(r[t],UHe(e));return n[i]}function ZHe(e,t){var r=[vE(e,t[0]),vE(e,t[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function A8(e,t,r,n,i,a){var o=r.__brushOption,s=e.toRectRange(o.range),l=Wne(t,i,a);R(n,function(u){var c=VHe[u];s[c[0]][c[1]]+=l[c[0]]}),o.range=e.fromRectRange(Gne(s[0][0],s[1][0],s[0][1],s[1][1])),YR(t,r),Gf(t,{isEnd:!1})}function YHe(e,t,r,n){var i=t.__brushOption.range,a=Wne(e,r,n);R(i,function(o){o[0]+=a[0],o[1]+=a[1]}),YR(e,t),Gf(e,{isEnd:!1})}function Wne(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 JR(e,t,r){var n=zne(e,t);return n&&n!==Vf?n.clipPath(r,e._transform):ke(r)}function XHe(e){var t=x0(e[0][0],e[1][0]),r=x0(e[0][1],e[1][1]),n=Iv(e[0][0],e[1][0]),i=Iv(e[0][1],e[1][1]);return{x:t,y:r,width:n-t,height:i-r}}function qHe(e,t,r){if(!(!e._brushType||JHe(e,t.offsetX,t.offsetY))){var n=e._zr,i=e._covers,a=qR(e,t,r);if(!e._dragging)for(var o=0;on.getWidth()||r<0||r>n.getHeight()}var ZC={lineX:k8(0),lineY:k8(1),rect:{createCover:function(e,t){function r(n){return n}return Fne({toRectRange:r,fromRectRange:r},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=$ne(e);return Gne(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,r,n){Vne(e,t,r,n)},updateCommon:dE,contain:gE},polygon:{createCover:function(e,t){var r=new Le;return r.add(new xn({name:"main",style:KR(t),silent:!0})),r},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new jn({name:"main",draggable:!0,drift:Ue(YHe,e,t),ondragend:Ue(Gf,e,{isEnd:!0})}))},updateCoverShape:function(e,t,r,n){t.childAt(0).setShape({points:JR(e,t,r)})},updateCommon:dE,contain:gE}};function k8(e){return{createCover:function(t,r){return Fne({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=$ne(t),n=x0(r[0][e],r[1][e]),i=Iv(r[0][e],r[1][e]);return[n,i]},updateCoverShape:function(t,r,n,i){var a,o=zne(t,r);if(o!==Vf&&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(),Vne(t,r,l,i)},updateCommon:dE,contain:gE}}function Une(e){return e=QR(e),function(t){return Pj(t,e)}}function Zne(e,t){return e=QR(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 Yne(e,t,r){var n=QR(e);return function(i,a){return n.contain(a[0],a[1])&&!Qre(i,t,r)}}function QR(e){return je.create(e)}var QHe=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 ZR(n.getZr())).on("brush",xe(this._onBrush,this))},t.prototype.render=function(r,n,i,a){if(!eUe(r,n,a)){this.axisModel=r,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Le,this.group.add(this._axisGroup),!!r.get("show")){var s=rUe(r,n),l=s.coordinateSystem,u=r.getAreaSelectStyle(),c=u.width,f=r.axis.dim,h=l.getAxisLayout(f),d=ie({strokeContainThreshold:c},h),v=new oi(r,i,d);v.build(),this._axisGroup.add(v.group),this._refreshBrushController(d,u,r,s,c,i),q0(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),f=je.create({x:l[0],y:-o/2,width:u,height:o});f.x-=c,f.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:r.rotation,x:r.position[0],y:r.position[1]}).setPanels([{panelId:"pl",clipPath:Une(f),isTargetByCursor:Yne(f,s,a),getLinearBrushOtherExtent:Zne(f,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(tUe(i))},t.prototype._onBrush=function(r){var n=r.areas,i=this.axisModel,a=i.axis,o=le(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}(Rt);function eUe(e,t,r){return r&&r.type==="axisAreaSelect"&&t.findComponents({mainType:"parallelAxis",query:r})[0]===e}function tUe(e){var t=e.axis;return le(e.activeIntervals,function(r){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(r[0],!0),t.dataToCoord(r[1],!0)]}})}function rUe(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}var nUe={type:"axisAreaSelect",event:"axisAreaSelected"};function iUe(e){e.registerAction(nUe,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 aUe={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function Xne(e){e.registerComponentView(MHe),e.registerComponentModel(kHe),e.registerCoordinateSystem("parallel",RHe),e.registerPreprocessor(SHe),e.registerComponentModel(fE),e.registerComponentView(QHe),Lv(e,"parallel",fE,aUe),iUe(e)}function oUe(e){Ke(Xne),e.registerChartView(pHe),e.registerSeriesModel(yHe),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,wHe)}var sUe=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}(),lUe=function(e){q(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new sUe},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(){cl(this)},t.prototype.downplay=function(){fl(this)},t}(at),uUe=function(e){q(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._mainGroup=new Le,r._focusAdjacencyDisabled=!1,r}return t.prototype.init=function(r,n){this._controller=new oh(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,f=r.getData(),h=r.getData("edge"),d=r.get("orient");this._model=r,s.removeAll(),s.x=l.x,s.y=l.y,this._updateViewCoordSys(r,i),ene(r,i,s,this._controller,this._controllerHost,null),o.eachEdge(function(v){var m=new lUe,y=Be(m);y.dataIndex=v.dataIndex,y.seriesIndex=r.seriesIndex,y.dataType="edge";var x=v.getModel(),_=x.getModel("lineStyle"),b=_.get("curveness"),S=v.node1.getLayout(),T=v.node1.getModel(),C=T.get("localX"),A=T.get("localY"),P=v.node2.getLayout(),O=v.node2.getModel(),k=O.get("localX"),E=O.get("localY"),N=v.getLayout(),D,z,V,F,$,B,H,U;m.shape.extent=Math.max(1,N.dy),m.shape.orient=d,d==="vertical"?(D=(C!=null?C*u:S.x)+N.sy,z=(A!=null?A*c:S.y)+S.dy,V=(k!=null?k*u:P.x)+N.ty,F=E!=null?E*c:P.y,$=D,B=z*(1-b)+F*b,H=V,U=z*b+F*(1-b)):(D=(C!=null?C*u:S.x)+S.dx,z=(A!=null?A*c:S.y)+N.sy,V=k!=null?k*u:P.x,F=(E!=null?E*c:P.y)+N.ty,$=D*(1-b)+V*b,B=z,H=D*b+V*(1-b),U=F),m.setShape({x1:D,y1:z,x2:V,y2:F,cpx1:$,cpy1:B,cpx2:H,cpy2:U}),m.useStyle(_.getItemStyle()),L8(m.style,d,v);var Z=""+x.get("value"),Y=Xr(x,"edgeLabel");sn(m,Y,{labelFetcher:{getFormattedLabel:function(ce,de,Oe,ye,ne,ve){return r.getFormattedLabel(ce,de,"edge",ye,Ti(ne,Y.normal&&Y.normal.get("formatter"),Z),ve)}},labelDataIndex:v.dataIndex,defaultText:Z}),m.setTextConfig({position:"inside"});var K=x.getModel("emphasis");Yr(m,x,"lineStyle",function(ce){var de=ce.getItemStyle();return L8(de,d,v),de}),s.add(m),h.setItemGraphicEl(v.dataIndex,m);var te=K.get("focus");qt(m,te==="adjacency"?v.getAdjacentDataIndices():te==="trajectory"?v.getTrajectoryDataIndices():te,K.get("blurScope"),K.get("disabled"))}),o.eachNode(function(v){var m=v.getLayout(),y=v.getModel(),x=y.get("localX"),_=y.get("localY"),b=y.getModel("emphasis"),S=y.get(["itemStyle","borderRadius"])||0,T=new Qe({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});sn(T,Xr(y),{labelFetcher:{getFormattedLabel:function(A,P){return r.getFormattedLabel(A,P,"node")}},labelDataIndex:v.dataIndex,defaultText:v.id}),T.disableLabelAnimation=!0,T.setStyle("fill",v.getVisual("color")),T.setStyle("decal",v.getVisual("style").decal),Yr(T,y),s.add(T),f.setItemGraphicEl(v.dataIndex,T),Be(T).dataType="node";var C=b.get("focus");qt(T,C==="adjacency"?v.getAdjacentDataIndices():C==="trajectory"?v.getTrajectoryDataIndices():C,b.get("blurScope"),b.get("disabled"))}),f.eachItemGraphicEl(function(v,m){var y=f.getItemModel(m);y.get("draggable")&&(v.drift=function(x,_){a._focusAdjacencyDisabled=!0,this.shape.x+=x,this.shape.y+=_,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:r.id,dataIndex:f.getRawIndex(m),localX:this.shape.x/u,localY:this.shape.y/c})},v.ondragend=function(){a._focusAdjacencyDisabled=!1},v.draggable=!0,v.cursor="move")}),!this._data&&r.isAnimationEnabled()&&s.setClipPath(cUe(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 sh(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}(At);function L8(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");me(n)&&me(i)&&(e.fill=new eh(0,0,+(t==="horizontal"),+(t==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function cUe(e,t,r){var n=new Qe({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Gt(n,{shape:{width:e.width+20}},t,r),n}var fUe=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 it(o[l],this,n));var u=UR(a,i,this,!0,c);return u.data;function c(f,h){f.wrapMethod("getItemModel",function(d,v){var m=d.parentModel,y=m.getData().getItemLayout(v);if(y){var x=y.depth,_=m.levelModels[x];_&&(d.parentModel=_)}return d}),h.wrapMethod("getItemModel",function(d,v){var m=d.parentModel,y=m.getGraph().getEdgeByIndex(v),x=y.node1.getLayout();if(x){var _=x.depth,b=m.levelModels[_];b&&(d.parentModel=b)}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 zr("nameValue",{name:u,value:l,noValue:a(l)})}else{var c=this.getGraph().getNodeByIndex(r),f=c.getLayout().value,h=this.getDataParams(r,i).data.name;return zr("nameValue",{name:h!=null?h+"":null,value:f,noValue:a(f)})}},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:J.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:J.color.primary}},animationEasing:"linear",animationDuration:1e3},t}(Ot);function hUe(e,t){e.eachSeriesByType("sankey",function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=qr(r,t).refContainer,o=Zt(r.getBoxLayoutParams(),a);r.layoutInfo=o;var s=o.width,l=o.height,u=r.getGraph(),c=u.nodes,f=u.edges;vUe(c);var h=gt(c,function(y){return y.getLayout().value===0}),d=h.length!==0?0:r.get("layoutIterations"),v=r.get("orient"),m=r.get("nodeAlign");dUe(c,f,n,i,s,l,d,v,m)})}function dUe(e,t,r,n,i,a,o,s,l){pUe(e,t,r,i,a,s,l),xUe(e,t,a,i,n,o,s),PUe(e,s)}function vUe(e){R(e,function(t){var r=wu(t.outEdges,NS),n=wu(t.inEdges,NS),i=t.getValue()||0,a=Math.max(r,n,i);t.setLayout({value:a},!0)})}function pUe(e,t,r,n,i,a,o){for(var s=[],l=[],u=[],c=[],f=0,h=0;h=0;x&&y.depth>d&&(d=y.depth),m.setLayout({depth:x?y.depth:f},!0),a==="vertical"?m.setLayout({dy:r},!0):m.setLayout({dx:r},!0);for(var _=0;_f-1?d:f-1;o&&o!=="left"&&gUe(e,o,a,A);var P=a==="vertical"?(i-r)/A:(n-r)/A;yUe(e,P,a)}function qne(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return t.depth!=null&&t.depth>=0}function gUe(e,t,r,n){if(t==="right"){for(var i=[],a=e,o=0;a.length;){for(var s=0;s0;a--)l*=.99,wUe(s,l,o),bP(s,i,r,n,o),MUe(s,l,o),bP(s,i,r,n,o)}function _Ue(e,t){var r=[],n=t==="vertical"?"y":"x",i=tI(e,function(a){return a.getLayout()[n]});return i.keys.sort(function(a,o){return a-o}),R(i.keys,function(a){r.push(i.buckets.get(a))}),r}function bUe(e,t,r,n,i,a){var o=1/0;R(e,function(s){var l=s.length,u=0;R(s,function(f){u+=f.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()[h]+t;var v=i==="vertical"?n:r;if(u=c-t-v,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),c=s;for(var d=f-2;d>=0;--d)l=o[d],u=l.getLayout()[a]+l.getLayout()[h]+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 wUe(e,t,r){R(e.slice().reverse(),function(n){R(n,function(i){if(i.outEdges.length){var a=wu(i.outEdges,SUe,r)/wu(i.outEdges,NS);if(isNaN(a)){var o=i.outEdges.length;a=o?wu(i.outEdges,TUe,r)/o:0}if(r==="vertical"){var s=i.getLayout().x+(a-Eu(i,r))*t;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-Eu(i,r))*t;i.setLayout({y:l},!0)}}})})}function SUe(e,t){return Eu(e.node2,t)*e.getValue()}function TUe(e,t){return Eu(e.node2,t)}function CUe(e,t){return Eu(e.node1,t)*e.getValue()}function AUe(e,t){return Eu(e.node1,t)}function Eu(e,t){return t==="vertical"?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function NS(e){return e.getValue()}function wu(e,t,r){for(var n=0,i=e.length,a=-1;++ao&&(o=l)}),R(n,function(s){var l=new on({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&&R(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function LUe(e){e.registerChartView(uUe),e.registerSeriesModel(fUe),e.registerLayout(hUe),e.registerVisual(kUe),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=GC(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}var Kne=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,f=this._baseAxisDim=u[c],h=u[1-c],d=[i,a],v=d[c].get("type"),m=d[1-c].get("type"),y=t.data;if(y&&l){var x=[];R(y,function(S,T){var C;oe(S)?(C=S.slice(),S.unshift(T)):oe(S.value)?(C=ie({},S),C.value=C.value.slice(),S.value.unshift(T)):C=S,x.push(C)}),t.data=x}var _=this.defaultValueDimensions,b=[{name:f,type:mS(v),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:mS(m),dimsDef:_.slice()}];return Tp(this,{coordDimensions:b,dimensionsCount:_.length+1,encodeDefaulter:Ue(see,b,this)})},e.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},e}(),Jne=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:J.color.neutral00,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:J.color.shadow}},animationDuration:800},t}(Ot);br(Jne,Kne,!0);var OUe=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),f=O8(c,a,u,l,!0);a.setItemGraphicEl(u,f),o.add(f)}}).update(function(u,c){var f=s.getItemGraphicEl(c);if(!a.hasValue(u)){o.remove(f);return}var h=a.getItemLayout(u);f?(Ea(f),Qne(h,f,a,u)):f=O8(h,a,u,l),o.add(f),a.setItemGraphicEl(u,f)}).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}(At),IUe=function(){function e(){}return e}(),EUe=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 IUe},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,b];n.push(S)}}}return{boxData:r,outliers:n}}var $Ue={type:"echarts:boxplot",transform:function(t){var r=t.upstream;if(r.sourceFormat!==_n){var n="";bt(n)}var i=zUe(r.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function FUe(e){e.registerSeriesModel(Jne),e.registerChartView(OUe),e.registerLayout(DUe),e.registerTransform($Ue)}var VUe=["itemStyle","borderColor"],GUe=["itemStyle","borderColor0"],WUe=["itemStyle","borderColorDoji"],HUe=["itemStyle","color"],UUe=["itemStyle","color0"];function e3(e,t){return t.get(e>0?HUe:UUe)}function t3(e,t){return t.get(e===0?WUe:e>0?VUe:GUe)}var ZUe={seriesType:"candlestick",plan:mp(),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=e3(s,o),l.stroke=t3(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");ie(u,l)}}}}}},YUe=["color","borderColor"],XUe=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){Uu(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 f=n.getItemLayout(c);if(s&&I8(u,f))return;var h=wP(f,c,!0);Gt(h,{shape:{points:f.ends}},r,c),SP(h,n,c,o),a.add(h),n.setItemGraphicEl(c,h)}}).update(function(c,f){var h=i.getItemGraphicEl(f);if(!n.hasValue(c)){a.remove(h);return}var d=n.getItemLayout(c);if(s&&I8(u,d)){a.remove(h);return}h?(ft(h,{shape:{points:d.ends}},r,c),Ea(h)):h=wP(d),SP(h,n,c,o),a.add(h),n.setItemGraphicEl(c,h)}).remove(function(c){var f=i.getItemGraphicEl(c);f&&a.remove(f)}).execute(),this._data=n},t.prototype._renderLarge=function(r){this._clear(),E8(r,this.group);var n=r.get("clip",!0)?nx(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=wP(s);SP(l,i,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},t.prototype._incrementalRenderLarge=function(r,n){E8(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}(At),qUe=function(){function e(){}return e}(),KUe=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 qUe},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}(at);function wP(e,t,r){var n=e.ends;return new KUe({shape:{points:r?JUe(n,e):n},z2:100})}function I8(e,t){for(var r=!0,n=0;nT?E[a]:k[a],ends:z,brushRect:H(C,A,b)})}function $(Z,Y){var K=[];return K[i]=Y,K[a]=Z,isNaN(Y)||isNaN(Z)?[NaN,NaN]:t.dataToPoint(K)}function B(Z,Y,K){var te=Y.slice(),ce=Y.slice();te[i]=qb(te[i]+n/2,1,!1),ce[i]=qb(ce[i]-n/2,1,!0),K?Z.push(te,ce):Z.push(ce,te)}function H(Z,Y,K){var te=$(Z,K),ce=$(Y,K);return te[i]-=n/2,ce[i]-=n/2,{x:te[0],y:te[1],width:n,height:ce[1]-te[1]}}function U(Z){return Z[i]=qb(Z[i],1),Z}}function v(m,y){for(var x=Wo(m.count*4),_=0,b,S=[],T=[],C,A=y.getStore(),P=!!e.get(["itemStyle","borderColorDoji"]);(C=m.next())!=null;){var O=A.get(s,C),k=A.get(u,C),E=A.get(c,C),N=A.get(f,C),D=A.get(h,C);if(isNaN(O)||isNaN(N)||isNaN(D)){x[_++]=NaN,_+=3;continue}x[_++]=N8(A,C,k,E,c,P),S[i]=O,S[a]=N,b=t.dataToPoint(S,null,T),x[_++]=b?b[0]:NaN,x[_++]=b?b[1]:NaN,S[a]=D,b=t.dataToPoint(S,null,T),x[_++]=b?b[1]:NaN}y.setLayout("largePoints",x)}}};function N8(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 r7e(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=ge(Ae(e.get("barMaxWidth"),i),i),o=ge(Ae(e.get("barMinWidth"),1),i),s=e.get("barWidth");return s!=null?ge(s,i):Math.max(Math.min(i/2,a),o)}function n7e(e){e.registerChartView(XUe),e.registerSeriesModel(eie),e.registerPreprocessor(e7e),e.registerVisual(ZUe),e.registerLayout(t7e)}function D8(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 i7e=function(e){q(t,e);function t(r,n){var i=e.call(this)||this,a=new tx(r,n),o=new Le;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 h=void 0;Pe(f)?h=f(i):h=f,a.__t>0&&(h=-s*a.__t),this._animateSymbol(a,s,h,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 zs(r.__p1,r.__cp1)+zs(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=gn,c=zO;s[0]=u(n[0],a[0],i[0],o),s[1]=u(n[1],a[1],i[1],o);var f=r.__t<1?c(n[0],a[0],i[0],o):c(i[0],a[0],n[0],1-o),h=r.__t<1?c(n[1],a[1],i[1],o):c(i[1],a[1],n[1],1-o);r.rotation=-Math.atan2(h,f)-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]),f=i[l],h=i[l+1];r.x=f[0]*(1-c)+c*h[0],r.y=f[1]*(1-c)+c*h[1];var d=r.__t<1?h[0]-f[0]:f[0]-h[0],v=r.__t<1?h[1]-f[1]:f[1]-h[1];r.rotation=-Math.atan2(v,d)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,r.ignore=!1}},t}(tie),u7e=function(){function e(){this.polyline=!1,this.curveness=0,this.segs=[]}return e}(),c7e=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:J.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new u7e},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+f)/2-(c-h)*a,v=(c+h)/2-(f-u)*a;r.quadraticCurveTo(d,v,f,h)}else r.lineTo(f,h)}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 f=a[u++],h=a[u++],d=1;d0){var y=(f+v)/2-(h-m)*o,x=(h+m)/2-(v-f)*o;if(rQ(f,h,y,x,v,m,s,r,n))return l}else if(Vl(f,h,v,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}(),nie={seriesType:"lines",plan:mp(),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 f=r.get("clip",!0)&&nx(r.coordinateSystem,!1,r);f?this.group.setClipPath(f):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=nie.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 f7e:new HR(o?a?l7e:rie:a?tie:WR),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}(At),d7e=typeof Uint32Array>"u"?Array:Uint32Array,v7e=typeof Float64Array>"u"?Array:Float64Array;function j8(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=le(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),dC([i,r[0],r[1]])}))}var p7e=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||[],j8(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(j8(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=yv(this._flatCoords,n.flatCoords),this._flatCoordsOffset=yv(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}(Ot);function hb(e){return e instanceof Array||(e=[e,e]),e}var g7e={seriesType:"lines",reset:function(e){var t=hb(e.get("symbol")),r=hb(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=hb(s.getShallow("symbol",!0)),u=hb(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 m7e(e){e.registerChartView(h7e),e.registerSeriesModel(p7e),e.registerLayout(nie),e.registerVisual(g7e)}var y7e=256,x7e=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=Ci.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,f=this.canvas,h=f.getContext("2d"),d=t.length;f.width=r,f.height=n;for(var v=0;v0){var N=o(b)?l:u;b>0&&(b=b*k+P),T[C++]=N[E],T[C++]=N[E+1],T[C++]=N[E+2],T[C++]=N[E+3]*b*256}else C+=4}return h.putImageData(S,0,0),f},e.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=Ci.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=J.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 _7e(e,t,r){var n=e[1]-e[0];t=le(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 R8(e){var t=e.dimensions;return t[0]==="lng"&&t[1]==="lat"}var w7e=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()):R8(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&&(R8(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},t.prototype.eachRendered=function(r){Uu(this._progressiveEls||this.group,r)},t.prototype._renderOnGridLike=function(r,n,i,a,o){var s=r.coordinateSystem,l=Ou(s,"cartesian2d"),u=Ou(s,"matrix"),c,f,h,d;if(l){var v=s.getAxis("x"),m=s.getAxis("y");c=v.getBandWidth()+.5,f=m.getBandWidth()+.5,h=v.scale.getExtent(),d=m.scale.getExtent()}for(var y=this.group,x=r.getData(),_=r.getModel(["emphasis","itemStyle"]).getItemStyle(),b=r.getModel(["blur","itemStyle"]).getItemStyle(),S=r.getModel(["select","itemStyle"]).getItemStyle(),T=r.get(["itemStyle","borderRadius"]),C=Xr(r),A=r.getModel("emphasis"),P=A.get("focus"),O=A.get("blurScope"),k=A.get("disabled"),E=l||u?[x.mapDimension("x"),x.mapDimension("y"),x.mapDimension("value")]:[x.mapDimension("time"),x.mapDimension("value")],N=i;Nh[1]||Fd[1])continue;var $=s.dataToPoint([V,F]);D=new Qe({shape:{x:$[0]-c/2,y:$[1]-f/2,width:c,height:f},style:z})}else if(u){var B=s.dataToLayout([x.get(E[0],N),x.get(E[1],N)]).rect;if(On(B.x))continue;D=new Qe({z2:1,shape:B,style:z})}else{if(isNaN(x.get(E[1],N)))continue;var H=s.dataToLayout([x.get(E[0],N)]),B=H.contentRect||H.rect;if(On(B.x)||On(B.y))continue;D=new Qe({z2:1,shape:B,style:z})}if(x.hasItemOption){var U=x.getItemModel(N),Z=U.getModel("emphasis");_=Z.getModel("itemStyle").getItemStyle(),b=U.getModel(["blur","itemStyle"]).getItemStyle(),S=U.getModel(["select","itemStyle"]).getItemStyle(),T=U.get(["itemStyle","borderRadius"]),P=Z.get("focus"),O=Z.get("blurScope"),k=Z.get("disabled"),C=Xr(U)}D.shape.r=T;var Y=r.getRawValue(N),K="-";Y&&Y[2]!=null&&(K=Y[2]+""),sn(D,C,{labelFetcher:r,labelDataIndex:N,defaultOpacity:z.opacity,defaultText:K}),D.ensureState("emphasis").style=_,D.ensureState("blur").style=b,D.ensureState("select").style=S,qt(D,P,O,k),D.incremental=o,o&&(D.states.emphasis.hoverLayer=!0),y.add(D),x.setItemGraphicEl(N,D),this._progressiveEls&&this._progressiveEls.push(D)}},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 x7e;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(),f=r.getRoamTransform();c.applyTransform(f);var h=Math.max(c.x,0),d=Math.max(c.y,0),v=Math.min(c.width+c.x,a.getWidth()),m=Math.min(c.height+c.y,a.getHeight()),y=v-h,x=m-d,_=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],b=l.mapArray(_,function(A,P,O){var k=r.dataToPoint([A,P]);return k[0]-=h,k[1]-=d,k.push(O),k}),S=i.getExtent(),T=i.type==="visualMap.continuous"?b7e(S,i.option.range):_7e(S,i.getPieceList(),i.option.selected);u.update(b,y,x,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},T);var C=new un({style:{width:y,height:x,x:h,y:d,image:u.canvas},silent:!0});this.group.add(C)},t.type="heatmap",t}(At),S7e=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 vs(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var r=gp.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:J.color.primary}}},t}(Ot);function T7e(e){e.registerChartView(w7e),e.registerSeriesModel(S7e)}var C7e=["itemStyle","borderWidth"],B8=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],AP=new ds,A7e=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(),f=l.master.getRect(),h={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:r,coordSys:l,coordSysExtent:[[f.x,f.x+f.width],[f.y,f.y+f.height]],isHorizontal:c,valueDim:B8[+c],categoryDim:B8[1-+c]};o.diff(s).add(function(v){if(o.hasValue(v)){var m=$8(o,v),y=z8(o,v,m,h),x=F8(o,h,y);o.setItemGraphicEl(v,x),a.add(x),G8(x,h,y)}}).update(function(v,m){var y=s.getItemGraphicEl(m);if(!o.hasValue(v)){a.remove(y);return}var x=$8(o,v),_=z8(o,v,x,h),b=uie(o,_);y&&b!==y.__pictorialShapeStr&&(a.remove(y),o.setItemGraphicEl(v,null),y=null),y?E7e(y,h,_):y=F8(o,h,_,!0),o.setItemGraphicEl(v,y),y.__pictorialSymbolMeta=_,a.add(y),G8(y,h,_)}).remove(function(v){var m=s.getItemGraphicEl(v);m&&V8(s,v,m.__pictorialSymbolMeta.animationModel,m)}).execute();var d=r.get("clip",!0)?nx(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){V8(a,Be(o).dataIndex,r,o)}):i.removeAll()},t.type="pictorialBar",t}(At);function z8(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,f=r.isAnimationEnabled(),h={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:f?r:null,hoverScale:f&&r.get(["emphasis","scale"]),z2:r.getShallow("z",!0)||0};M7e(r,a,i,n,h),P7e(e,t,i,a,o,h.boundingLength,h.pxSign,c,n,h),k7e(r,h.symbolScale,u,n,h);var d=h.symbolSize,v=ih(r.get("symbolOffset"),d);return L7e(r,d,i,a,o,v,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,n,h),h}function M7e(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(oe(o)){var f=[MP(s,o[0])-l,MP(s,o[1])-l];f[1]=0?1:-1:c>0?1:-1}function MP(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function P7e(e,t,r,n,i,a,o,s,l,u){var c=l.valueDim,f=l.categoryDim,h=Math.abs(r[f.wh]),d=e.getItemVisual(t,"symbolSize"),v;oe(d)?v=d.slice():d==null?v=["100%","100%"]:v=[d,d],v[f.index]=ge(v[f.index],h),v[c.index]=ge(v[c.index],n?h:Math.abs(a)),u.symbolSize=v;var m=u.symbolScale=[v[0]/s,v[1]/s];m[c.index]*=(l.isHorizontal?-1:1)*o}function k7e(e,t,r,n,i){var a=e.get(C7e)||0;a&&(AP.attr({scaleX:t[0],scaleY:t[1],rotation:r}),AP.updateTransform(),a/=AP.getLineScale(),a*=t[n.valueDim.index]),i.valueLineWidth=a||0}function L7e(e,t,r,n,i,a,o,s,l,u,c,f){var h=c.categoryDim,d=c.valueDim,v=f.pxSign,m=Math.max(t[d.index]+s,0),y=m;if(n){var x=Math.abs(l),_=mn(e.get("symbolMargin"),"15%")+"",b=!1;_.lastIndexOf("!")===_.length-1&&(b=!0,_=_.slice(0,_.length-1));var S=ge(_,t[d.index]),T=Math.max(m+S*2,0),C=b?0:S*2,A=fj(n),P=A?n:W8((x+C)/T),O=x-P*m;S=O/2/(b?P:Math.max(P-1,1)),T=m+S*2,C=b?0:S*2,!A&&n!=="fixed"&&(P=u?W8((Math.abs(u)+C)/T):0),y=P*T-C,f.repeatTimes=P,f.symbolMargin=S}var k=v*(y/2),E=f.pathPosition=[];E[h.index]=r[h.wh]/2,E[d.index]=o==="start"?k:o==="end"?l-k:l/2,a&&(E[0]+=a[0],E[1]+=a[1]);var N=f.bundlePosition=[];N[h.index]=r[h.xy],N[d.index]=r[d.xy];var D=f.barRectShape=ie({},r);D[d.wh]=v*Math.max(Math.abs(r[d.wh]),Math.abs(E[d.index]+k)),D[h.wh]=r[h.wh];var z=f.clipShape={};z[h.xy]=-r[h.xy],z[h.wh]=c.ecSize[h.wh],z[d.xy]=0,z[d.wh]=r[d.wh]}function iie(e){var t=e.symbolPatternSize,r=Lr(e.symbolType,-t/2,-t/2,t,t);return r.attr({culling:!0}),r.type!=="image"&&r.setStyle({strokeNoScale:!0}),r}function aie(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,f=a[t.valueDim.index]+o+r.symbolMargin*2;for(r3(e,function(m){m.__pictorialAnimationIndex=c,m.__pictorialRepeatTimes=u,c0:x<0)&&(_=u-1-m),y[l.index]=f*(_-u/2+.5)+s[l.index],{x:y[0],y:y[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation}}}function oie(e,t,r,n){var i=e.__pictorialBundle,a=e.__pictorialMainPath;a?zd(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=iie(r),i.add(a),zd(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 sie(e,t,r){var n=ie({},t.barRectShape),i=e.__pictorialBarRect;i?zd(i,null,{shape:n},t,r):(i=e.__pictorialBarRect=new Qe({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,e.add(i))}function lie(e,t,r,n){if(r.symbolClip){var i=e.__pictorialClipPath,a=ie({},r.clipShape),o=t.valueDim,s=r.animationModel,l=r.dataIndex;if(i)ft(i,{shape:a},s,l);else{a[o.wh]=0,i=new Qe({shape:a}),e.__pictorialBundle.setClipPath(i),e.__pictorialClipPath=i;var u={};u[o.wh]=r.clipShape[o.wh],th[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function $8(e,t){var r=e.getItemModel(t);return r.getAnimationDelayParams=O7e,r.isAnimationEnabled=I7e,r}function O7e(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function I7e(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function F8(e,t,r,n){var i=new Le,a=new Le;return i.add(a),i.__pictorialBundle=a,a.x=r.bundlePosition[0],a.y=r.bundlePosition[1],r.symbolRepeat?aie(i,t,r):oie(i,t,r),sie(i,r,n),lie(i,t,r,n),i.__pictorialShapeStr=uie(e,r),i.__pictorialSymbolMeta=r,i}function E7e(e,t,r){var n=r.animationModel,i=r.dataIndex,a=e.__pictorialBundle;ft(a,{x:r.bundlePosition[0],y:r.bundlePosition[1]},n,i),r.symbolRepeat?aie(e,t,r,!0):oie(e,t,r,!0),sie(e,r,!0),lie(e,t,r,!0)}function V8(e,t,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];r3(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),R(a,function(o){Lu(o,{scaleX:0,scaleY:0},r,t,function(){n.parent&&n.parent.remove(n)})}),e.setItemGraphicEl(t,null)}function uie(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function r3(e,t,r){R(e.__pictorialBundle.children(),function(n){n!==e.__pictorialBarRect&&t.call(r,n)})}function zd(e,t,r,n,i,a){t&&e.attr(t),n.symbolClip&&!i?r&&e.attr(r):r&&th[i?"updateProps":"initProps"](e,r,n.animationModel,n.dataIndex,a)}function G8(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"),f=a.get("blurScope"),h=a.get("scale");r3(e,function(m){if(m instanceof un){var y=m.style;m.useStyle(ie({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,h&&(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)],v=e.__pictorialBarRect;v.ignoreClip=!0,sn(v,Xr(i),{labelFetcher:t.seriesModel,labelDataIndex:n,defaultText:kv(t.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:d}),qt(e,c,f,a.get("disabled"))}function W8(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}var N7e=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=Zu(d0.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:J.color.primary}}}),t}(d0);function D7e(e){e.registerChartView(A7e),e.registerSeriesModel(N7e),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Ue(kte,"pictorialBar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Lte("pictorialBar"))}var j7e=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,f=u.boundaryGap;s.x=0,s.y=c.y+f[0];function h(y){return y.name}var d=new hl(this._layersSeries||[],l,h,h),v=[];d.add(xe(m,this,"add")).update(xe(m,this,"update")).remove(xe(m,this,"remove")).execute();function m(y,x,_){var b=o._layers;if(y==="remove"){s.remove(b[x]);return}for(var S=[],T=[],C,A=l[x].indices,P=0;Pa&&(a=s),n.push(s)}for(var u=0;ua&&(a=f)}return{y0:i,max:a}}function F7e(e){e.registerChartView(j7e),e.registerSeriesModel(B7e),e.registerLayout(z7e),e.registerProcessor(Sp("themeRiver"))}var V7e=2,G7e=4,U8=function(e){q(t,e);function t(r,n,i,a){var o=e.call(this)||this;o.z2=V7e,o.textConfig={inside:!0},Be(o).seriesIndex=n.seriesIndex;var s=new lt({z2:G7e,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;Be(s).dataIndex=n.dataIndex;var l=n.getModel(),u=l.getModel("emphasis"),c=n.getLayout(),f=ie({},c);f.label=null;var h=n.getVisual("style");h.lineJoin="bevel";var d=n.getVisual("decal");d&&(h.decal=Av(d,o));var v=Uo(l.getModel("itemStyle"),f,!0);ie(f,v),R(ui,function(_){var b=s.ensureState(_),S=l.getModel([_,"itemStyle"]);b.style=S.getItemStyle();var T=Uo(S,f);T&&(b.shape=T)}),r?(s.setShape(f),s.shape.r=c.r0,Gt(s,{shape:{r:c.r}},i,n.dataIndex)):(ft(s,{shape:f},i),Ea(s)),s.useStyle(h),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"?yv(n.getAncestorsIndices(),n.getDescendantIndices()):y==="ancestor"?n.getAncestorsIndices():y==="descendant"?n.getDescendantIndices():y;qt(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),f=this,h=f.getTextContent(),d=this.node.dataIndex,v=a.get("minAngle")/180*Math.PI,m=a.get("show")&&!(v!=null&&Math.abs(s)z&&!bv(F-z)&&F0?(o.virtualPiece?o.virtualPiece.updateData(!1,_,r,n,i):(o.virtualPiece=new U8(_,r,n,i),c.add(o.virtualPiece)),b.piece.off("click"),o.virtualPiece.on("click",function(S){o._rootToNode(b.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";sS(u,c)}}i=!0}})})},t.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:mE,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}(At),Z7e=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};cie(i);var a=this._levelModels=le(r.levels||[],function(l){return new it(l,this,n)},this),o=BR.createTree(i,this,s);function s(l){l.wrapMethod("getItemModel",function(u,c){var f=o.getNodeByDataIndex(c),h=a[f.depth];return h&&(u.parentModel=h),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=HC(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(){vne(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}(Ot);function cie(e){var t=0;R(e.children,function(n){cie(n);var i=n.value;oe(i)&&(i=i[0]),t+=i});var r=e.value;oe(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),oe(e.value)?e.value[0]=r:e.value=r}var Y8=Math.PI/180;function Y7e(e,t,r){t.eachSeriesByType(e,function(n){var i=n.get("center"),a=n.get("radius");oe(a)||(a=[0,a]),oe(i)||(i=[i,i]);var o=r.getWidth(),s=r.getHeight(),l=Math.min(o,s),u=ge(i[0],o),c=ge(i[1],s),f=ge(a[0],l/2),h=ge(a[1],l/2),d=-n.get("startAngle")*Y8,v=n.get("minAngle")*Y8,m=n.getData().tree.root,y=n.getViewRoot(),x=y.depth,_=n.get("sort");_!=null&&fie(y,_);var b=0;R(y.children,function(F){!isNaN(F.getValue())&&b++});var S=y.getValue(),T=Math.PI/(S||b)*2,C=y.depth>0,A=y.height-(C?-1:1),P=(h-f)/(A||1),O=n.get("clockwise"),k=n.get("stillShowZeroSum"),E=O?1:-1,N=function(F,$){if(F){var B=$;if(F!==m){var H=F.getValue(),U=S===0&&k?T:H*T;U1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",t);return n.depth>1&&me(s)&&(s=Zw(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");ie(u,l)})})}function K7e(e){e.registerChartView(U7e),e.registerSeriesModel(Z7e),e.registerLayout(Ue(Y7e,"sunburst")),e.registerProcessor(Ue(Sp,"sunburst")),e.registerVisual(q7e),H7e(e)}var X8={color:"fill",borderColor:"stroke"},J7e={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Ks=rt(),Q7e=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 vs(null,this)},t.prototype.getDataParams=function(r,n,i){var a=e.prototype.getDataParams.call(this,r,n);return i&&(a.info=Ks(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}(Ot);function e9e(e,t){return t=t||[0,0],le(["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 t9e(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:xe(e9e,e)}}}function r9e(e,t){return t=t||[0,0],le([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 n9e(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:xe(r9e,e)}}}function i9e(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 a9e(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:xe(i9e,e)}}}function o9e(e,t){return t=t||[0,0],le(["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 s9e(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:xe(o9e,e)}}}function l9e(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 u9e(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 hie(e,t,r,n){return e&&(e.legacy||e.legacy!==!1&&!r&&!n&&t!=="tspan"&&(t==="text"||Se(e,"text")))}function die(e,t,r){var n=e,i,a,o;if(t==="text")o=n;else{o={},Se(n,"text")&&(o.text=n.text),Se(n,"rich")&&(o.rich=n.rich),Se(n,"textFill")&&(o.fill=n.textFill),Se(n,"textStroke")&&(o.stroke=n.textStroke),Se(n,"fontFamily")&&(o.fontFamily=n.fontFamily),Se(n,"fontSize")&&(o.fontSize=n.fontSize),Se(n,"fontStyle")&&(o.fontStyle=n.fontStyle),Se(n,"fontWeight")&&(o.fontWeight=n.fontWeight),a={type:"text",style:o,silent:!0},i={};var s=Se(n,"textPosition");r?i.position=s?n.textPosition:"inside":s&&(i.position=n.textPosition),Se(n,"textPosition")&&(i.position=n.textPosition),Se(n,"textOffset")&&(i.offset=n.textOffset),Se(n,"textRotation")&&(i.rotation=n.textRotation),Se(n,"textDistance")&&(i.distance=n.textDistance)}return q8(o,e),R(o.rich,function(l){q8(l,l)}),{textConfig:i,textContent:a}}function q8(e,t){t&&(t.font=t.textFont||t.font,Se(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),Se(t,"textAlign")&&(e.align=t.textAlign),Se(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),Se(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),Se(t,"textWidth")&&(e.width=t.textWidth),Se(t,"textHeight")&&(e.height=t.textHeight),Se(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),Se(t,"textPadding")&&(e.padding=t.textPadding),Se(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),Se(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),Se(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),Se(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),Se(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),Se(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),Se(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function K8(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||J.color.neutral99;J8(n,t);var o=n.textFill==null;return i?o&&(n.textFill=r.insideFill||J.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||J.color.neutral00),!n.textStroke&&r.outsideStroke&&(n.textStroke=r.outsideStroke)),n.text=t.text,n.rich=t.rich,R(t.rich,function(s){J8(s,s)}),n}function J8(e,t){t&&(Se(t,"fill")&&(e.textFill=t.fill),Se(t,"stroke")&&(e.textStroke=t.fill),Se(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),Se(t,"font")&&(e.font=t.font),Se(t,"fontStyle")&&(e.fontStyle=t.fontStyle),Se(t,"fontWeight")&&(e.fontWeight=t.fontWeight),Se(t,"fontSize")&&(e.fontSize=t.fontSize),Se(t,"fontFamily")&&(e.fontFamily=t.fontFamily),Se(t,"align")&&(e.textAlign=t.align),Se(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),Se(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),Se(t,"width")&&(e.textWidth=t.width),Se(t,"height")&&(e.textHeight=t.height),Se(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),Se(t,"padding")&&(e.textPadding=t.padding),Se(t,"borderColor")&&(e.textBorderColor=t.borderColor),Se(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),Se(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),Se(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),Se(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),Se(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),Se(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),Se(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),Se(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),Se(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),Se(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var vie={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},Q8=st(vie);La(is,function(e,t){return e[t]=1,e},{});is.join(", ");var DS=["","style","shape","extra"],Ev=rt();function n3(e,t,r,n,i){var a=e+"Animation",o=fp(e,n,i)||{},s=Ev(t).userDuring;return o.duration>0&&(o.during=s?xe(v9e,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),ie(o,r[a]),o}function i1(e,t,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=r.isAnimationEnabled(),l=Ev(e),u=t.style;l.userDuring=t.during;var c={},f={};if(g9e(e,t,f),e.type==="compound")for(var h=e.shape.paths,d=t.shape.paths,v=0;v0&&e.animateFrom(y,x)}else f9e(e,t,i||0,r,c);pie(e,t),u?e.dirty():e.markRedraw()}function pie(e,t){for(var r=Ev(e).leaveToProps,n=0;n0&&e.animateFrom(i,a)}}function h9e(e,t){Se(t,"silent")&&(e.silent=t.silent),Se(t,"ignore")&&(e.ignore=t.ignore),e instanceof Ia&&Se(t,"invisible")&&(e.invisible=t.invisible),e instanceof at&&Se(t,"autoBatch")&&(e.autoBatch=t.autoBatch)}var Io={},d9e={setTransform:function(e,t){return Io.el[e]=t,this},getTransform:function(e){return Io.el[e]},setShape:function(e,t){var r=Io.el,n=r.shape||(r.shape={});return n[e]=t,r.dirtyShape&&r.dirtyShape(),this},getShape:function(e){var t=Io.el.shape;if(t)return t[e]},setStyle:function(e,t){var r=Io.el,n=r.style;return n&&(n[e]=t,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(e){var t=Io.el.style;if(t)return t[e]},setExtra:function(e,t){var r=Io.el.extra||(Io.el.extra={});return r[e]=t,this},getExtra:function(e){var t=Io.el.extra;if(t)return t[e]}};function v9e(){var e=this,t=e.el;if(t){var r=Ev(t).userDuring,n=e.userDuring;if(r!==n){e.el=e.userDuring=null;return}Io.el=t,n(d9e)}}function eH(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]={}),bf(l))ie(o,a);else for(var u=jt(l),c=0;c=0){!o&&(o=n[e]={});for(var d=st(a),c=0;c=0)){var h=e.getAnimationStyleProps(),d=h?h.style:null;if(d){!a&&(a=n.style={});for(var v=st(r),u=0;u=0?t.getStore().get(B,F):void 0}var H=t.get($.name,F),U=$&&$.ordinalMeta;return U?U.categories[H]:H}function A(V,F){F==null&&(F=c);var $=t.getItemVisual(F,"style"),B=$&&$.fill,H=$&&$.opacity,U=b(F,nu).getItemStyle();B!=null&&(U.fill=B),H!=null&&(U.opacity=H);var Z={inheritColor:me(B)?B:J.color.neutral99},Y=S(F,nu),K=Dt(Y,null,Z,!1,!0);K.text=Y.getShallow("show")?Ae(e.getFormattedLabel(F,nu),kv(t,F)):null;var te=iS(Y,Z,!1);return k(V,U),U=K8(U,K,te),V&&O(U,V),U.legacy=!0,U}function P(V,F){F==null&&(F=c);var $=b(F,Js).getItemStyle(),B=S(F,Js),H=Dt(B,null,null,!0,!0);H.text=B.getShallow("show")?Ti(e.getFormattedLabel(F,Js),e.getFormattedLabel(F,nu),kv(t,F)):null;var U=iS(B,null,!0);return k(V,$),$=K8($,H,U),V&&O($,V),$.legacy=!0,$}function O(V,F){for(var $ in F)Se(F,$)&&(V[$]=F[$])}function k(V,F){V&&(V.textFill&&(F.textFill=V.textFill),V.textPosition&&(F.textPosition=V.textPosition))}function E(V,F){if(F==null&&(F=c),Se(X8,V)){var $=t.getItemVisual(F,"style");return $?$[X8[V]]:null}if(Se(J7e,V))return t.getItemVisual(F,V)}function N(V){if(o.type==="cartesian2d"){var F=o.getBaseAxis();return w$e(Ie({axis:F},V))}}function D(){return r.getCurrentSeriesIndices()}function z(V){return Oj(V,r)}}function M9e(e){var t={};return R(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 IP(e,t,r,n,i,a,o){if(!n){a.remove(t);return}var s=l3(e,t,r,n,i,a);return s&&o.setItemGraphicEl(r,s),s&&qt(s,n.focus,n.blurScope,n.emphasisDisabled),s}function l3(e,t,r,n,i,a){var o=-1,s=t;t&&xie(t,n,i)&&(o=Ye(a.childrenRef(),t),t=null);var l=!t,u=t;u?u.clearStates():(u=o3(n),s&&S9e(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),n.tooltipDisabled&&(u.tooltipDisabled=!0),la.normal.cfg=la.normal.conOpt=la.emphasis.cfg=la.emphasis.conOpt=la.blur.cfg=la.blur.conOpt=la.select.cfg=la.select.conOpt=null,la.isLegacy=!1,k9e(u,r,n,i,l,la),P9e(u,r,n,i,l),s3(e,u,r,n,la,i,l),Se(n,"info")&&(Ks(u).info=n.info);for(var c=0;c=0?a.replaceAt(u,o):a.add(u),u}function xie(e,t,r){var n=Ks(e),i=t.type,a=t.shape,o=t.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&N9e(a)&&_ie(a)!==n.customPathData||i==="image"&&Se(o,"image")&&o.image!==n.customImagePath}function P9e(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&&xie(o,a,n)&&(o=null),o||(o=o3(a),e.setClipPath(o)),s3(null,o,t,a,null,n,i)}}function k9e(e,t,r,n,i,a){if(!(e.isGroup||e.type==="compoundPath")){rH(r,null,a),rH(r,Js,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=o3(o),e.setTextContent(c)),s3(null,c,t,o,null,n,i);for(var f=o&&o.style,h=0;h=c;d--){var v=t.childAt(d);O9e(t,v,i)}}}function O9e(e,t,r){t&&YC(t,Ks(e).option,r)}function I9e(e){new hl(e.oldChildren,e.newChildren,nH,nH,e).add(iH).update(iH).remove(E9e).execute()}function nH(e,t){var r=e&&e.name;return r??b9e+t}function iH(e,t){var r=this.context,n=e!=null?r.newChildren[e]:null,i=t!=null?r.oldChildren[t]:null;l3(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function E9e(e){var t=this.context,r=t.oldChildren[e];r&&YC(r,Ks(r).option,t.seriesModel)}function _ie(e){return e&&(e.pathData||e.d)}function N9e(e){return e&&(Se(e,"pathData")||Se(e,"d"))}function D9e(e){e.registerChartView(T9e),e.registerSeriesModel(Q7e)}var Hc=rt(),aH=ke,EP=xe,c3=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 f=this._moveAnimation=this.determineAnimation(t,r);if(!s)s=this._group=new Le,this.createPointerEl(s,u,t,r),this.createLabelEl(s,u,t,r),n.getZr().add(s);else{var h=Ue(oH,r,f);this.updatePointerEl(s,u,h),this.updateLabelEl(s,u,h,r)}lH(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=OR(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=Hc(t).pointerEl=new th[a.type](aH(r.pointer));t.add(o)}},e.prototype.createLabelEl=function(t,r,n,i){if(r.label){var a=Hc(t).labelEl=new lt(aH(r.label));t.add(a),sH(a,i)}},e.prototype.updatePointerEl=function(t,r,n){var i=Hc(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=Hc(t).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),sH(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=hp(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){ul(u.event)},onmousedown:EP(this._onHandleDragMove,this,0,0),drift:EP(this._onHandleDragMove,this),ondragend:EP(this._onHandleDragEnd,this)}),n.add(i)),lH(i,r,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");oe(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,yp(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},e.prototype._moveHandleToValue=function(t,r){oH(this._axisPointerModel,!r&&this._moveAnimation,this._handle,NP(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(NP(n),[t,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(NP(i)),Hc(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),a0(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 oH(e,t,r,n){bie(Hc(r).lastProp,n)||(Hc(r).lastProp=n,t?ft(r,n,e):(r.stopAnimation(),r.attr(n)))}function bie(e,t){if(Ee(e)&&Ee(t)){var r=!0;return R(t,function(n,i){r=r&&bie(e[i],n)}),!!r}else return e===t}function sH(e,t){e[t.get(["label","show"])?"show":"hide"]()}function NP(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function lH(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 f3(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 wie(e,t,r,n,i){var a=r.get("value"),o=Sie(a,t.axis,t.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=pp(s.get("padding")||0),u=s.getFont(),c=yC(o,u),f=i.position,h=c.width+l[1]+l[3],d=c.height+l[0]+l[2],v=i.align;v==="right"&&(f[0]-=h),v==="center"&&(f[0]-=h/2);var m=i.verticalAlign;m==="bottom"&&(f[1]-=d),m==="middle"&&(f[1]-=d/2),j9e(f,h,d,n);var y=s.get("backgroundColor");(!y||y==="auto")&&(y=t.get(["axisLine","lineStyle","color"])),e.label={x:f[0],y:f[1],style:Dt(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:y}),z2:10}}function j9e(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 Sie(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:yS(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};R(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,f=u&&u.getDataParams(c);f&&s.seriesData.push(f)}),me(o)?a=o.replace("{value}",a):Pe(o)&&(a=o(s))}return a}function h3(e,t,r){var n=an();return _l(n,n,r.rotation),po(n,n,r.position),uo([e.dataToCoord(t),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function Tie(e,t,r,n,i,a){var o=oi.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),wie(t,n,i,a,{position:h3(n.axis,e,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function d3(e,t,r){return r=r||0,{x1:e[r],y1:e[1-r],x2:t[r],y2:t[1-r]}}function Cie(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}}function uH(e,t,r,n,i,a){return{cx:e,cy:t,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}var R9e=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=cH(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var h=f3(a),d=B9e[u](s,f,c);d.style=h,r.graphicKey=d.type,r.pointer=d}var v=PS(l.getRect(),i);Tie(n,r,v,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=PS(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=h3(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=cH(s,o).getOtherAxis(o).getGlobalExtent(),c=o.dim==="x"?0:1,f=[r.x,r.y];f[c]+=n[c],f[c]=Math.min(l[1],f[c]),f[c]=Math.max(l[0],f[c]);var h=(u[1]+u[0])/2,d=[h,h];d[c]=f[c];var v=[{verticalAlign:"middle"},{align:"center"}];return{x:f[0],y:f[1],rotation:r.rotation,cursorPoint:d,tooltipOption:v[c]}},t}(c3);function cH(e,t){var r={};return r[t.dim+"AxisIndex"]=t.index,e.getCartesian(r)}var B9e={line:function(e,t,r){var n=d3([t,r[0]],[t,r[1]],fH(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:Cie([t-n/2,r[0]],[n,i],fH(e))}}};function fH(e){return e.dim==="x"?0:1}var z9e=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:J.color.border,width:1,type:"dashed"},shadowStyle:{color:J.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:J.color.neutral00,padding:[5,7,5,7],backgroundColor:J.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:J.color.accent40,throttle:40}},t}(tt),Gs=rt(),$9e=R;function Aie(e,t,r){if(!ot.node){var n=t.getZr();Gs(n).records||(Gs(n).records={}),F9e(n,t);var i=Gs(n).records[e]||(Gs(n).records[e]={});i.handler=r}}function F9e(e,t){if(Gs(e).initialized)return;Gs(e).initialized=!0,r("click",Ue(hH,"click")),r("mousemove",Ue(hH,"mousemove")),r("globalout",G9e);function r(n,i){e.on(n,function(a){var o=W9e(t);$9e(Gs(e).records,function(s){s&&i(s,a,o.dispatchAction)}),V9e(o.pendings,t)})}}function V9e(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 G9e(e,t,r){e.handler("leave",null,r)}function hH(e,t,r,n){t.handler(e,r,n)}function W9e(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 _E(e,t){if(!ot.node){var r=t.getZr(),n=(Gs(r).records||{})[e];n&&(Gs(r).records[e]=null)}}var H9e=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";Aie("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){_E("axisPointer",n)},t.prototype.dispose=function(r,n){_E("axisPointer",n)},t.type="axisPointer",t}(Rt);function Mie(e,t){var r=[],n=e.seriesIndex,i;if(n==null||!(i=t.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=Df(a,e);if(o==null||o<0||oe(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),f=c.dim,h=u.dim,d=f==="x"||f==="radius"?1:0,v=a.mapDimension(h),m=[];m[d]=a.get(v,o),m[1-d]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(m)||[]}else r=l.dataToPoint(a.getValues(le(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 dH=rt();function U9e(e,t,r){var n=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||xe(r.dispatchAction,r),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){a1(i)&&(i=Mie({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=a1(i),u=a.axesInfo,c=s.axesInfo,f=n==="leave"||a1(i),h={},d={},v={list:[],map:{}},m={showPointer:Ue(Y9e,d),showTooltip:Ue(X9e,v)};R(s.coordSysMap,function(x,_){var b=l||x.containPoint(i);R(s.coordSysAxesInfo[_],function(S,T){var C=S.axis,A=Q9e(u,S);if(!f&&b&&(!u||A)){var P=A&&A.value;P==null&&!l&&(P=C.pointToData(i)),P!=null&&vH(S,P,m,!1,h)}})});var y={};return R(c,function(x,_){var b=x.linkGroup;b&&!d[_]&&R(b.axesInfo,function(S,T){var C=d[T];if(S!==x&&C){var A=C.value;b.mapper&&(A=x.axis.scale.parse(b.mapper(A,pH(S),pH(x)))),y[x.key]=A}})}),R(y,function(x,_){vH(c[_],x,m,!0,h)}),q9e(d,c,h),K9e(v,i,e,o),J9e(c,o,r),h}}function vH(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=Z9e(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&ie(i,s[0]),!n&&e.snap&&a.containData(l)&&l!=null&&(t=l),r.showPointer(e,t,s),r.showTooltip(e,o,l)}}function Z9e(e,t){var r=t.axis,n=r.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return R(t.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(n),f,h;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(c,e,r);h=d.dataIndices,f=d.nestestValue}else{if(h=l.indicesOfNearest(n,c[0],e,r.type==="category"?.5:null),!h.length)return;f=l.getData().get(c[0],h[0])}if(!(f==null||!isFinite(f))){var v=e-f,m=Math.abs(v);m<=o&&((m=0&&s<0)&&(o=m,s=v,i=f,a.length=0),R(h,function(y){a.push({seriesIndex:l.seriesIndex,dataIndexInside:y,dataIndex:l.getData().getRawIndex(y)})}))}}),{payloadBatch:a,snapToValue:i}}function Y9e(e,t,r,n){e[t.key]={value:r,payloadBatch:n}}function X9e(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=v0(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 q9e(e,t,r){var n=r.axesInfo=[];R(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 K9e(e,t,r,n){if(a1(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 J9e(e,t,r){var n=r.getZr(),i="axisPointerLastHighlights",a=dH(n)[i]||{},o=dH(n)[i]={};R(e,function(u,c){var f=u.axisPointerModel.option;f.status==="show"&&u.triggerEmphasis&&R(f.seriesDataIndices,function(h){var d=h.seriesIndex+" | "+h.dataIndex;o[d]=h})});var s=[],l=[];R(a,function(u,c){!o[c]&&l.push(u)}),R(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 Q9e(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 pH(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 a1(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function ox(e){ah.registerAxisPointerClass("CartesianAxisPointer",R9e),e.registerComponentModel(z9e),e.registerComponentView(H9e),e.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var r=t.axisPointer.link;r&&!oe(r)&&(t.axisPointer.link=[r])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(t,r){t.getComponent("axisPointer").coordSysAxesInfo=eGe(t,r)}),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},U9e)}function eZe(e){Ke(Kre),Ke(ox)}var tZe=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(),f=s.dataToCoord(n),h=a.get("type");if(h&&h!=="none"){var d=f3(a),v=nZe[h](s,l,f,c);v.style=d,r.graphicKey=v.type,r.pointer=v}var m=a.get(["label","margin"]),y=rZe(n,i,a,l,m);wie(r,i,a,o,y)},t}(c3);function rZe(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,f;if(a.dim==="radius"){var h=an();_l(h,h,s),po(h,h,[n.cx,n.cy]),u=uo([o,-i],h);var d=t.getModel("axisLabel").get("rotate")||0,v=oi.innerTextLayout(s,d*Math.PI/180,-1);c=v.textAlign,f=v.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",f=Math.abs(u[1]-x)/m<.3?"middle":u[1]>x?"top":"bottom"}return{position:u,align:c,verticalAlign:f}}var nZe={line:function(e,t,r,n){return e.dim==="angle"?{type:"Line",shape:d3(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:uH(t.cx,t.cy,n[0],n[1],(-r-i/2)*a,(-r+i/2)*a)}:{type:"Sector",shape:uH(t.cx,t.cy,r-i/2,r+i/2,0,Math.PI*2)}}},iZe=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}(tt),v3=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",fr).models[0]},t.type="polarAxis",t}(tt);br(v3,wp);var aZe=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}(v3),oZe=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}(v3),p3=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}(Ba);p3.prototype.dataToRadius=Ba.prototype.dataToCoord;p3.prototype.radiusToData=Ba.prototype.coordToData;var sZe=rt(),g3=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=yC(s==null?"":s+"",n.getFont(),"center","top"),f=Math.max(c.height,7),h=f/u;isNaN(h)&&(h=1/0);var d=Math.max(0,Math.floor(h)),v=sZe(r.model),m=v.lastAutoInterval,y=v.lastTickCount;return m!=null&&y!=null&&Math.abs(m-d)<=1&&Math.abs(y-o)<=1&&m>d?d=m:(v.lastTickCount=o,v.lastAutoInterval=d),d},t}(Ba);g3.prototype.dataToAngle=Ba.prototype.dataToCoord;g3.prototype.angleToData=Ba.prototype.coordToData;var Pie=["radius","angle"],lZe=function(){function e(t){this.dimensions=Pie,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new p3,this._angleAxis=new g3,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,f=u*u+c*c,h=this.r,d=this.r0;return h!==d&&f-o<=h*h&&f+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=gH(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=gH(r);return i===this?this.pointToData(n):null},e}();function gH(e){var t=e.seriesModel,r=e.polarModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function uZe(e,t,r){var n=t.get("center"),i=qr(t,r).refContainer;e.cx=ge(n[0],i.width)+i.x,e.cy=ge(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%"]:oe(s)||(s=[0,s]);var l=[ge(s[0],o),ge(s[1],o)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function cZe(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();R(xS(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),R(xS(l,"angle"),function(u){n.scale.unionExtentFromData(l,u)})}}),Ff(n.scale,n.model),Ff(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 fZe(e){return e.mainType==="angleAxis"}function mH(e,t){var r;if(e.type=t.get("type"),e.scale=ex(t),e.onBand=t.get("boundaryGap")&&e.type==="category",e.inverse=t.get("inverse"),fZe(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 hZe={dimensions:Pie,create:function(e,t){var r=[];return e.eachComponent("polar",function(n,i){var a=new lZe(i+"");a.update=cZe;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");mH(o,l),mH(s,u),uZe(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",fr).models[0];n.coordinateSystem=i.coordinateSystem}}),r}},dZe=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function db(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 vb(e){var t=e.getRadiusAxis();return t.inverse?0:1}function yH(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 vZe=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=le(i.getViewLabels(),function(c){c=ke(c);var f=i.scale,h=f.type==="ordinal"?f.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=i.dataToCoord(h),c});yH(u),yH(s),R(dZe,function(c){r.get([c,"show"])&&(!i.scale.isBlank()||c==="axisLine")&&pZe[c](this.group,r,a,s,l,o,u)},this)}},t.type="angleAxis",t}(ah),pZe={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=vb(r),f=c?0:1,h,d=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[f]===0?h=new th[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}):h=new up({shape:{cx:r.cx,cy:r.cy,r:a[c],r0:a[f]},style:o.getLineStyle(),z2:1,silent:!0}),h.style.fill=null,e.add(h)},axisTick:function(e,t,r,n,i,a){var o=t.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[vb(r)],u=le(n,function(c){return new Pr({shape:db(r,[l,l+s],c.coord)})});e.add(zi(u,{style:Ie(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[vb(r)],c=[],f=0;fx?"left":"right",S=Math.abs(y[1]-_)/m<.3?"middle":y[1]>_?"top":"bottom";if(s&&s[v]){var T=s[v];Ee(T)&&T.textStyle&&(d=new it(T.textStyle,l,l.ecModel))}var C=new lt({silent:oi.isLabelSilent(t),style:Dt(d,{x:y[0],y:y[1],fill:d.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:f.formattedLabel,align:b,verticalAlign:S})});if(e.add(C),wl({el:C,componentModel:t,itemName:f.formattedLabel,formatterParamsExtra:{isTruncated:function(){return C.isTruncated},value:f.rawLabel,tickIndex:h}}),c){var A=oi.makeAxisEventDataBase(t);A.targetType="axisLabel",A.value=f.rawLabel,Be(C).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=[],f=0;f=0?"p":"n",V=O;T&&(n[c][D]||(n[c][D]={p:O,n:O}),V=n[c][D][z]);var F=void 0,$=void 0,B=void 0,H=void 0;if(v.dim==="radius"){var U=v.dataToCoord(N)-O,Z=l.dataToCoord(D);Math.abs(U)=H})}}})}function bZe(e){var t={};R(e,function(n,i){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=Lie(o,s),u=s.getExtent(),c=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),f=t[l]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},h=f.stacks;t[l]=f;var d=kie(n);h[d]||f.autoWidthCount++,h[d]=h[d]||{width:0,maxWidth:0};var v=ge(n.get("barWidth"),c),m=ge(n.get("barMaxWidth"),c),y=n.get("barGap"),x=n.get("barCategoryGap");v&&!h[d].width&&(v=Math.min(f.remainedWidth,v),h[d].width=v,f.remainedWidth-=v),m&&(h[d].maxWidth=m),y!=null&&(f.gap=y),x!=null&&(f.categoryGap=x)});var r={};return R(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=ge(n.categoryGap,o),l=ge(n.gap,1),u=n.remainedWidth,c=n.autoWidthCount,f=(u-s)/(c+(c-1)*l);f=Math.max(f,0),R(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=xH(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=xH(r);return i===this?this.pointToData(n):null},e}();function xH(e){var t=e.seriesModel,r=e.singleAxisModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function OZe(e,t){var r=[];return e.eachComponent("singleAxis",function(n,i){var a=new LZe(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",fr).models[0];n.coordinateSystem=i&&i.coordinateSystem}}),r}var IZe={create:OZe,dimensions:Oie},_H=["x","y"],EZe=["width","height"],NZe=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=DP(l,1-BS(s)),c=l.dataToPoint(n)[0],f=a.get("type");if(f&&f!=="none"){var h=f3(a),d=DZe[f](s,c,u);d.style=h,r.graphicKey=d.type,r.pointer=d}var v=bE(i);Tie(n,r,v,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=bE(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=h3(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=BS(o),u=DP(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 f=DP(s,1-l),h=(f[1]+f[0])/2,d=[h,h];return d[l]=c[l],{x:c[0],y:c[1],rotation:r.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}},t}(c3),DZe={line:function(e,t,r){var n=d3([t,r[0]],[t,r[1]],BS(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:Cie([t-n/2,r[0]],[n,i],BS(e))}}};function BS(e){return e.isHorizontal()?0:1}function DP(e,t){var r=e.getRect();return[r[_H[t]],r[_H[t]]+r[EZe[t]]]}var jZe=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}(Rt);function RZe(e){Ke(ox),ah.registerAxisPointerClass("SingleAxisPointer",NZe),e.registerComponentView(jZe),e.registerComponentView(MZe),e.registerComponentModel(o1),Lv(e,"single",o1,o1.defaultOption),e.registerCoordinateSystem("single",IZe)}var BZe=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=rh(r);e.prototype.init.apply(this,arguments),bH(r,a)},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),bH(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:J.color.axisLine,width:1,type:"solid"}},itemStyle:{color:J.color.neutral00,borderWidth:1,borderColor:J.color.neutral10},dayLabel:{show:!0,firstDay:0,position:"start",margin:J.size.s,color:J.color.secondary},monthLabel:{show:!0,position:"start",margin:J.size.s,align:"center",formatter:null,color:J.color.secondary},yearLabel:{show:!0,position:null,margin:J.size.xl,formatter:null,color:J.color.quaternary,fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},t}(tt);function bH(e,t){var r=e.cellSize,n;oe(r)?n=r:n=e.cellSize=[r,r],n.length===1&&(n[1]=n[0]);var i=le([0,1],function(a){return oBe(t,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});ss(e,t,{type:"box",ignoreSize:i})}var zZe=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,f=new Qe({shape:{x:c[0],y:c[1],width:s,height:l},cursor:"default",style:o});i.add(f)}},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 f=n.start,h=0;f.time<=n.end.time;h++){v(f.formatedDate),h===0&&(f=s.getDateInfo(n.start.y+"-"+n.start.m));var d=f.date;d.setMonth(d.getMonth()+1),f=s.getDateInfo(d)}v(s.getNextNDay(n.end.time,1).formatedDate);function v(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 xn({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 me(r)&&r?Q5e(r,n):Pe(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,f=(u[0][1]+u[1][1])/2,h=i==="horizontal"?0:1,d={top:[c,u[h][1]],bottom:[c,u[1-h][1]],left:[u[1-h][0],f],right:[u[h][0],f]},v=n.start.y;+n.end.y>+n.start.y&&(v=v+"-"+n.end.y);var m=o.get("formatter"),y={start:n.start.y,end:n.end.y,nameMap:v},x=this._formatterLabel(m,y),_=new lt({z2:30,style:Dt(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"),f=[this._tlpoints,this._blpoints];(!s||me(s))&&(s&&(n=gI(s)||n),s=n.get(["time","monthAbbr"])||[]);var h=u==="start"?0:1,d=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var v=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/jP)-Math.floor(r[0].time/jP)+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),f=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:f,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){J0({targetModel:a,coordSysType:"calendar",coordSysProvider:qQ})}),n},e.dimensions=["time","value"],e}();function RP(e){var t=e.calendarModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}function FZe(e){e.registerComponentModel(BZe),e.registerComponentView(zZe),e.registerCoordinateSystem("calendar",$Ze)}var Ns={level:1,leaf:2,nonLeaf:3},Qs={none:0,all:1,body:2,corner:3};function wE(e,t,r){var n=t[Ge[r]].getCell(e);return!n&&ut(e)&&e<0&&(n=t[Ge[1-r]].getUnitLayoutInfo(r,Math.round(e))),n}function Iie(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 Eie(e,t,r,n,i){wH(e[0],t,i,r,n,0),wH(e[1],t,i,r,n,1)}function wH(e,t,r,n,i,a){e[0]=1/0,e[1]=-1/0;var o=n[a],s=oe(o)?o:[o],l=s.length,u=!!r;if(l>=1?(SH(e,t,s,u,i,a,0),l>1&&SH(e,t,s,u,i,a,l-1)):e[0]=e[1]=NaN,u){var c=-i[Ge[1-a]].getLocatorCount(a),f=i[Ge[a]].getLocatorCount(a)-1;r===Qs.body?c=Ar(0,c):r===Qs.corner&&(f=Ui(-1,f)),f=t[0]&&e[0]<=t[1]}function AH(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 WZe(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 MH(e,t,r,n){var i=wE(t[n][0],r,n),a=wE(t[n][1],r,n);e[Ge[n]]=e[Br[n]]=NaN,i&&a&&(e[Ge[n]]=i.xy,e[Br[n]]=a.xy+a.wh-i.xy)}function Rg(e,t,r,n){return e[Ge[t]]=r,e[Ge[1-t]]=n,e}function HZe(e){return e&&(e.type===Ns.leaf||e.type===Ns.nonLeaf)?e:null}function zS(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var PH=function(){function e(t,r){this._cells=[],this._levels=[],this.dim=t,this.dimIdx=t==="x"?0:1,this._model=r,this._uniqueValueGen=UZe(t);var n=r.get("data",!0);n!=null&&!oe(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,f){var h=0;return u&&R(u,function(d,v){var m;me(d)?m={value:d}:Ee(d)?(m=d,d.value!=null&&!me(d.value)&&(m={value:null})):m={value:null};var y={type:Ns.nonLeaf,ordinal:NaN,level:f,firstLeafLocator:c,id:new De,span:Rg(new De,r.dimIdx,1,1),option:m,xy:NaN,wh:NaN,dim:r,rect:zS()};o++,(a[c]||(a[c]=[])).push(y),i[f]||(i[f]={type:Ns.level,xy:NaN,wh:NaN,option:null,id:new De,dim:r});var x=s(m.children,c,f+1),_=Math.max(1,x);y.span[Ge[r.dimIdx]]=_,h+=_,c+=_}),h}function l(){for(var u=[];n.length=1,b=r[Ge[n]],S=a.getLocatorCount(n)-1,T=new mu;for(o.resetLayoutIterator(T,n);T.next();)C(T.item);for(a.resetLayoutIterator(T,n);T.next();)C(T.item);function C(A){On(A.wh)&&(A.wh=x),A.xy=b,A.id[Ge[n]]===S&&!_&&(A.wh=r[Ge[n]]+r[Br[n]]-A.xy),b+=A.wh}}function DH(e,t){for(var r=t[Ge[e]].resetCellIterator();r.next();){var n=r.item;$S(n.rect,e,n.id,n.span,t),$S(n.rect,1-e,n.id,n.span,t),n.type===Ns.nonLeaf&&(n.xy=n.rect[Ge[e]],n.wh=n.rect[Br[e]])}}function jH(e,t){e.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;$S(i,0,a,n,t),$S(i,1,a,n,t)}})}function $S(e,t,r,n,i){e[Br[t]]=0;var a=r[Ge[t]],o=a<0?i[Ge[1-t]]:i[Ge[t]],s=o.getUnitLayoutInfo(t,r[Ge[t]]);if(e[Ge[t]]=s.xy,e[Br[t]]=s.wh,n[Ge[t]]>1){var l=o.getUnitLayoutInfo(t,r[Ge[t]]+n[Ge[t]]-1);e[Br[t]]=l.xy+l.wh-s.xy}}function aYe(e,t,r){var n=Qw(e,r[Br[t]]);return TE(n,r[Br[t]])}function TE(e,t){return Math.max(Math.min(e,Ae(t,1/0)),0)}function $P(e){var t=e.matrixModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}var Mn={inBody:1,inCorner:2,outside:3},Lo={x:null,y:null,point:[]};function RH(e,t,r,n,i){var a=r[Ge[t]],o=r[Ge[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,f=e.point[t]=n[t];if(!l&&!c){e[Ge[t]]=Mn.outside;return}if(i===Qs.body){l?(e[Ge[t]]=Mn.inBody,f=Ui(s.xy+s.wh,Ar(l.xy,f)),e.point[t]=f):e[Ge[t]]=Mn.outside;return}else if(i===Qs.corner){c?(e[Ge[t]]=Mn.inCorner,f=Ui(c.xy+c.wh,Ar(u.xy,f)),e.point[t]=f):e[Ge[t]]=Mn.outside;return}var h=l?l.xy:c?c.xy+c.wh:NaN,d=u?u.xy:h,v=s?s.xy+s.wh:h;if(fv){if(!i){e[Ge[t]]=Mn.outside;return}f=v}e.point[t]=f,e[Ge[t]]=h<=f&&f<=v?Mn.inBody:d<=f&&f<=h?Mn.inCorner:Mn.outside}function BH(e,t,r,n){var i=1-r;if(e[Ge[r]]!==Mn.outside)for(n[Ge[r]].resetCellIterator(zP);zP.next();){var a=zP.item;if($H(e.point[r],a.rect,r)&&$H(e.point[i],a.rect,i)){t[r]=a.ordinal,t[i]=a.id[Ge[i]];return}}}function zH(e,t,r,n){if(e[Ge[r]]!==Mn.outside){var i=e[Ge[r]]===Mn.inCorner?n[Ge[1-r]]:n[Ge[r]];for(i.resetLayoutIterator(xb,r);xb.next();)if(oYe(e.point[r],xb.item)){t[r]=xb.item.id[Ge[r]];return}}}function oYe(e,t){return t.xy<=e&&e<=t.xy+t.wh}function $H(e,t,r){return t[Ge[r]]<=e&&e<=t[Ge[r]]+t[Br[r]]}function sYe(e){e.registerComponentModel(qZe),e.registerComponentView(tYe),e.registerCoordinateSystem("matrix",iYe)}function lYe(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 FH(e,t){var r;return R(t,function(n){e[n]!=null&&e[n]!=="auto"&&(r=!0)}),r}function uYe(e,t,r){var n=ie({},r),i=e[t],a=r.$action||"merge";a==="merge"?i?(Xe(i,n,!0),ss(i,n,{ignoreSize:!0}),tee(r,i),_b(r,i),_b(r,i,"shape"),_b(r,i,"style"),_b(r,i,"extra"),r.clipPath=i.clipPath):e[t]=n:a==="replace"?e[t]=n:a==="remove"&&i&&(e[t]=null)}var Die=["transition","enterFrom","leaveTo"],cYe=Die.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function _b(e,t,r){if(r&&(!e[r]&&t[r]&&(e[r]={}),e=e[r],t=t[r]),!(!e||!t))for(var n=r?Die:cYe,i=0;i=0;c--){var f=i[c],h=Hr(f.id,null),d=h!=null?o.get(h):null;if(d){var v=d.parent,x=da(v),_=v===a?{width:s,height:l}:{width:x.width,height:x.height},b={},S=IC(d,f,_,null,{hv:f.hv,boundingMode:f.bounding},b);if(!da(d).isNew&&S){for(var T=f.transition,C={},A=0;A=0)?C[P]=O:d[P]=O}ft(d,C,r,0)}else d.attr(b)}}},t.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){s1(i,da(i).option,n,r._lastGraphicModel)}),this._elMap=Ce()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(Rt);function CE(e){var t=Se(VH,e)?VH[e]:t0(e),r=new t({});return da(r).type=e,r}function GH(e,t,r,n){var i=CE(r);return t.add(i),n.set(e,i),da(i).id=e,da(i).isNew=!0,i}function s1(e,t,r,n){var i=e&&e.parent;i&&(e.type==="group"&&e.traverse(function(a){s1(a,t,r,n)}),YC(e,t,n),r.removeKey(da(e).id))}function WH(e,t,r,n){e.isGroup||R([["cursor",Ia.prototype.cursor],["zlevel",n||0],["z",r||0],["z2",0]],function(i){var a=i[0];Se(t,a)?e[a]=Ae(t[a],i[1]):e[a]==null&&(e[a]=i[1])}),R(st(t),function(i){if(i.indexOf("on")===0){var a=t[i];e[i]=Pe(a)?a:null}}),Se(t,"draggable")&&(e.draggable=t.draggable),t.name!=null&&(e.name=t.name),t.id!=null&&(e.id=t.id)}function vYe(e){return e=ie({},e),R(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(KQ),function(t){delete e[t]}),e}function pYe(e,t,r){var n=Be(e).eventData;!e.silent&&!e.ignore&&!n&&(n=Be(e).eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name}),n&&(n.info=r.info)}function gYe(e){e.registerComponentModel(hYe),e.registerComponentView(dYe),e.registerPreprocessor(function(t){var r=t.graphic;oe(r)?!r[0]||!r[0].elements?t.graphic=[{elements:r}]:t.graphic=[t.graphic[0]]:r&&!r.elements&&(t.graphic=[{elements:[r]}])})}var HH=["x","y","radius","angle","single"],mYe=["cartesian2d","polar","singleAxis"];function yYe(e){var t=e.get("coordinateSystem");return Ye(mYe,t)>=0}function iu(e){return e+"Axis"}function xYe(e,t){var r=Ce(),n=[],i=Ce();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 f=!1;return c.eachTargetAxis(function(h,d){var v=r.get(h);v&&v[d]&&(f=!0)}),f}function u(c){c.eachTargetAxis(function(f,h){(r.get(f)||r.set(f,[]))[h]=!0})}return n}function jie(e){var t=e.ecModel,r={infoList:[],infoMap:Ce()};return e.eachTargetAxis(function(n,i){var a=t.getComponent(iu(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 FP=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}(),_0=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=UH(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},t.prototype.mergeOption=function(r){var n=UH(r);Xe(this.option,r,!0),Xe(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;R([["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=Ce(),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 R(HH,function(i){var a=this.getReferringComponents(iu(i),RRe);if(a.specified){n=!0;var o=new FP;R(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 f=u[0];if(f){var h=new FP;if(h.add(f.componentIndex),r.set(c,h),a=!1,c==="x"||c==="y"){var d=f.getReferringComponents("grid",fr).models[0];d&&R(u,function(v){f.componentIndex!==v.componentIndex&&d===v.getReferringComponents("grid",fr).models[0]&&h.add(v.componentIndex)})}}}a&&R(HH,function(u){if(a){var c=i.findComponents({mainType:iu(u),filter:function(h){return h.get("type",!0)==="category"}});if(c[0]){var f=new FP;f.add(c[0].componentIndex),r.set(u,f),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");R([["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(iu(n),i))},this),r},t.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(i,a){R(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(iu(r),n)},t.prototype.setRawRange=function(r){var n=this.option,i=this.settledOption;R([["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;R(["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(b&&!S&&!T)return!0;b&&(y=!0),S&&(v=!0),T&&(m=!0)}return y&&v&&m})}else Qh(c,function(d){if(a==="empty")l.setData(u=u.map(d,function(m){return s(m)?m:NaN}));else{var v={};v[d]=o,u.selectRange(v)}});Qh(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;Qh(["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=_t(n[0]+o,n,[0,100],!0):a!=null&&(o=_t(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=lj(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 SYe(e,t,r){var n=[1/0,-1/0];Qh(r,function(o){F$e(n,o.getData(),t)});var i=e.getAxisModel(),a=Dte(i.axis.scale,i,n).calculate();return[a.min,a.max]}var TYe={getTargetSeries:function(e){function t(i){e.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=e.getComponent(iu(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 wYe(i,a,s,e),r.push(o.__dzAxisProxy))});var n=Ce();return R(r,function(i){R(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 CYe(e){e.registerAction("dataZoom",function(t,r){var n=xYe(r,t);R(n,function(i){i.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}var YH=!1;function _3(e){YH||(YH=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,TYe),CYe(e),e.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function AYe(e){e.registerComponentModel(_Ye),e.registerComponentView(bYe),_3(e)}var ma=function(){function e(){}return e}(),Rie={};function ed(e,t){Rie[e]=t}function Bie(e){return Rie[e]}var MYe=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;R(this.option.feature,function(n,i){var a=Bie(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(r)),Xe(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:J.color.border,borderRadius:0,borderWidth:0,padding:J.size.m,itemSize:15,itemGap:J.size.s,showTitle:!0,iconStyle:{borderColor:J.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:J.color.accent50}},tooltip:{show:!1,position:"bottom"}},t}(tt);function zie(e,t){var r=pp(t.get("padding")),n=t.getItemStyle(["color","opacity"]);n.fill=t.get("backgroundColor");var i=new Qe({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 PYe=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={}),f=[];R(u,function(_,b){f.push(b)}),new hl(this._featureNames||[],f).add(h).update(h).remove(Ue(h,null)).execute(),this._featureNames=f;function h(_,b){var S=f[_],T=f[b],C=u[S],A=new it(C,r,r.ecModel),P;if(a&&a.newTitle!=null&&a.featureName===S&&(C.title=a.newTitle),S&&!T){if(kYe(S))P={onclick:A.option.onclick,featureName:S};else{var O=Bie(S);if(!O)return;P=new O}c[S]=P}else if(P=c[T],!P)return;P.uid=vp("toolbox-feature"),P.model=A,P.ecModel=n,P.api=i;var k=P instanceof ma;if(!S&&T){k&&P.dispose&&P.dispose(n,i);return}if(!A.get("show")||k&&P.unusable){k&&P.remove&&P.remove(n,i);return}d(A,P,S),A.setIconStatus=function(E,N){var D=this.option,z=this.iconPaths;D.iconStatus=D.iconStatus||{},D.iconStatus[E]=N,z[E]&&(N==="emphasis"?cl:fl)(z[E])},P instanceof ma&&P.render&&P.render(A,n,i,a)}function d(_,b,S){var T=_.getModel("iconStyle"),C=_.getModel(["emphasis","iconStyle"]),A=b instanceof ma&&b.getIcons?b.getIcons():_.get("icon"),P=_.get("title")||{},O,k;me(A)?(O={},O[S]=A):O=A,me(P)?(k={},k[S]=P):k=P;var E=_.iconPaths={};R(O,function(N,D){var z=hp(N,{},{x:-s/2,y:-s/2,width:s,height:s});z.setStyle(T.getItemStyle());var V=z.ensureState("emphasis");V.style=C.getItemStyle();var F=new lt({style:{text:k[D],align:C.get("textAlign"),borderRadius:C.get("textBorderRadius"),padding:C.get("textPadding"),fill:null,font:Oj({fontStyle:C.get("textFontStyle"),fontFamily:C.get("textFontFamily"),fontSize:C.get("textFontSize"),fontWeight:C.get("textFontWeight")},n)},ignore:!0});z.setTextContent(F),wl({el:z,componentModel:r,itemName:D,formatterParamsExtra:{title:k[D]}}),z.__title=k[D],z.on("mouseover",function(){var $=C.getItemStyle(),B=l?r.get("right")==null&&r.get("left")!=="right"?"right":"left":r.get("bottom")==null&&r.get("top")!=="bottom"?"bottom":"top";F.setStyle({fill:C.get("textFill")||$.fill||$.stroke||J.color.neutral99,backgroundColor:C.get("textBackgroundColor")}),z.setTextConfig({position:C.get("textPosition")||B}),F.ignore=!r.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){_.get(["iconStatus",D])!=="emphasis"&&i.leaveEmphasis(this),F.hide()}),(_.get(["iconStatus",D])==="emphasis"?cl:fl)(z),o.add(z),z.on("click",xe(b.onclick,b,n,i,D)),E[D]=z})}var v=qr(r,i).refContainer,m=r.getBoxLayoutParams(),y=r.get("padding"),x=Zt(m,v,y);yf(r.get("orient"),o,r.get("itemGap"),x.width,x.height),IC(o,m,v,y),o.add(zie(o.getBoundingRect(),r)),l||o.eachChild(function(_){var b=_.__title,S=_.ensureState("emphasis"),T=S.textConfig||(S.textConfig={}),C=_.getTextContent(),A=C&&C.ensureState("emphasis");if(A&&!Pe(A)&&b){var P=A.style||(A.style={}),O=yC(b,lt.makeFont(P)),k=_.x+o.x,E=_.y+o.y+s,N=!1;E+O.height>i.getHeight()&&(T.position="top",N=!0);var D=N?-5-O.height:s+10;k+O.width/2>i.getWidth()?(T.position=["100%",D],P.align="right"):k-O.width/2<0&&(T.position=[0,D],P.align="left")}})},t.prototype.updateView=function(r,n,i,a){R(this._features,function(o){o instanceof ma&&o.updateView&&o.updateView(o.model,n,i,a)})},t.prototype.remove=function(r,n){R(this._features,function(i){i instanceof ma&&i.remove&&i.remove(r,n)}),this.group.removeAll()},t.prototype.dispose=function(r,n){R(this._features,function(i){i instanceof ma&&i.dispose&&i.dispose(r,n)})},t.type="toolbox",t}(Rt);function kYe(e){return e.indexOf("my")===0}var LYe=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")||J.color.neutral00,connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=ot.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 f=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(f)}else if(window.navigator.msSaveOrOpenBlob||o){var h=l.split(","),d=h[0].indexOf("base64")>-1,v=o?decodeURIComponent(h[1]):h[1];d&&(v=window.atob(v));var m=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var y=v.length,x=new Uint8Array(y);y--;)x[y]=v.charCodeAt(y);var _=new Blob([x]);window.navigator.msSaveOrOpenBlob(_,m)}else{var b=document.createElement("iframe");document.body.appendChild(b);var S=b.contentWindow,T=S.document;T.open("image/svg+xml","replace"),T.write(v),T.close(),S.focus(),T.execCommand("SaveAs",!0,m),document.body.removeChild(b)}}else{var C=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:J.color.neutral00,name:"",excludeComponents:["toolbox"],lang:r.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},t}(ma),XH="__ec_magicType_stack__",OYe=[["line","bar"],["stack"]],IYe=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 R(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(qH[i]){var s={series:[]},l=function(f){var h=f.subType,d=f.id,v=qH[i](h,d,f,a);v&&(Ie(v,f.option),s.series.push(v));var m=f.coordinateSystem;if(m&&m.type==="cartesian2d"&&(i==="line"||i==="bar")){var y=m.getAxesByScale("ordinal")[0];if(y){var x=y.dim,_=x+"Axis",b=f.getReferringComponents(_,fr).models[0],S=b.componentIndex;s[_]=s[_]||[];for(var T=0;T<=S;T++)s[_][S]=s[_][S]||{};s[_][S].boundaryGap=i==="bar"}}};R(OYe,function(f){Ye(f,i)>=0&&R(f,function(h){a.setIconStatus(h,"normal")})}),a.setIconStatus(i,"emphasis"),r.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,c=i;i==="stack"&&(u=Xe({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}(ma),qH={line:function(e,t,r,n){if(e==="bar")return Xe({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 Xe({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")===XH;if(e==="line"||e==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),Xe({id:t,stack:i?"":XH},n.get(["option","stack"])||{},!0)}};_o({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var XC=new Array(60).join("-"),Nv=" ";function EYe(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 NYe(e){var t=[];return R(e,function(r,n){var i=r.categoryAxis,a=r.valueAxis,o=a.dim,s=[" "].concat(le(r.series,function(d){return d.name})),l=[i.model.getCategories()];R(r.series,function(d){var v=d.getRawData();l.push(d.getRawData().mapArray(v.mapDimension(o),function(m){return m}))});for(var u=[s.join(Nv)],c=0;c=0)return!0}var AE=new RegExp("["+Nv+"]+","g");function BYe(e){for(var t=e.split(/\n+/g),r=FS(t.shift()).split(AE),n=[],i=le(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 WYe(e){var t=b3(e),r=t[t.length-1];t.length>1&&t.pop();var n={};return $ie(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 HYe(e){Fie(e).snapshots=null}function UYe(e){return b3(e).length}function b3(e){var t=Fie(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var ZYe=function(e){q(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(r,n){HYe(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}(ma);_o({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var YYe=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],w3=function(){function e(t,r,n){var i=this;this._targetInfoList=[];var a=KH(r,t);R(XYe,function(o,s){(!n||!n.include||Ye(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=VP[n.brushType](0,a,i);n.__rangeOffset={offset:tU[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),t},e.prototype.matchOutputRanges=function(t,r,n){R(t,function(i){var a=this.findTargetInfo(i,r);a&&a!==!0&&R(a.coordSyses,function(o){var s=VP[i.brushType](1,o,i.range,!0);n(i,s.values,o,r)})},this)},e.prototype.setInputRanges=function(t,r){R(t,function(n){var i=this.findTargetInfo(n,r);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=VP[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?tU[n.brushType](a.values,o.offset,qYe(a.xyMinMax,o.xyMinMax)):a.values}},this)},e.prototype.makePanelOpts=function(t,r){return le(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:r?r(n):null,clipPath:Une(i),isTargetByCursor:Yne(i,t,n.coordSysModel),getLinearBrushOtherExtent:Zne(i)}})},e.prototype.controlSeries=function(t,r,n){var i=this.findTargetInfo(t,n);return i===!0||i&&Ye(i.coordSyses,r.coordinateSystem)>=0},e.prototype.findTargetInfo=function(t,r){for(var n=this._targetInfoList,i=KH(r,t),a=0;ae[1]&&e.reverse(),e}function KH(e,t){return jd(e,t,{includeMainTypes:YYe})}var XYe={grid:function(e,t){var r=e.xAxisModels,n=e.yAxisModels,i=e.gridModels,a=Ce(),o={},s={};!r&&!n&&!i||(R(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),R(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),R(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=[];R(u.getCartesians(),function(f,h){(Ye(r,f.getAxis("x").model)>=0||Ye(n,f.getAxis("y").model)>=0)&&c.push(f)}),t.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:QH.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(e,t){R(e.geoModels,function(r){var n=r.coordinateSystem;t.push({panelId:"geo--"+r.id,geoModel:r,coordSysModel:r,coordSys:n,coordSyses:[n],getPanelRect:QH.geo})})}},JH=[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}],QH={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(xu(e)),t}},VP={lineX:Ue(eU,0),lineY:Ue(eU,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=[ME([i[0],a[0]]),ME([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=le(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 eU(e,t,r,n){var i=r.getAxis(["x","y"][e]),a=ME(le([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 tU={lineX:Ue(rU,0),lineY:Ue(rU,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 le(e,function(n,i){return[n[0]-r[0]*t[i][0],n[1]-r[1]*t[i][1]]})}};function rU(e,t,r,n){return[t[0]-n[e]*r[0],t[1]-n[e]*r[1]]}function qYe(e,t){var r=nU(e),n=nU(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 nU(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var PE=R,KYe=IRe("toolbox-dataZoom_"),JYe=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 ZR(i.getZr()),this._brushController.on("brush",xe(this._onBrush,this)).mount()),tXe(r,n,this,a,i),eXe(r,n)},t.prototype.onclick=function(r,n,i){QYe[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 w3(S3(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(u,c,f){if(f.type==="cartesian2d"){var h=u.brushType;h==="rect"?(s("x",f,c[0]),s("y",f,c[1])):s({lineX:"x",lineY:"y"}[h],f,c)}}),GYe(a,i),this._dispatchZoomAction(i);function s(u,c,f){var h=c.getAxis(u),d=h.model,v=l(u,d,a),m=v.findRepresentativeAxisProxy(d).getMinMaxSpan();(m.minValueSpan!=null||m.maxValueSpan!=null)&&(f=Iu(0,f.slice(),h.scale.getExtent(),0,m.minValueSpan,m.maxValueSpan)),v&&(i[v.id]={dataZoomId:v.id,startValue:f[0],endValue:f[1]})}function l(u,c,f){var h;return f.eachComponent({mainType:"dataZoom",subType:"select"},function(d){var v=d.getAxisModel(u,c.componentIndex);v&&(h=d)}),h}},t.prototype._dispatchZoomAction=function(r){var n=[];PE(r,function(i,a){n.push(ke(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:J.color.backgroundTint}};return n},t}(ma),QYe={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(WYe(this.ecModel))}};function S3(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 eXe(e,t){e.setIconStatus("back",UYe(t)>1?"emphasis":"normal")}function tXe(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 w3(S3(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)}dBe("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=S3(n),o=jd(e,a);PE(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),PE(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,c){var f=l.componentIndex,h={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:KYe+u+f};h[c]=f,i.push(h)}return i});function rXe(e){e.registerComponentModel(MYe),e.registerComponentView(PYe),ed("saveAsImage",LYe),ed("magicType",IYe),ed("dataView",FYe),ed("dataZoom",JYe),ed("restore",ZYe),Ke(AYe)}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.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:J.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:J.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:J.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:J.color.tertiary,fontSize:14}},t}(tt);function Vie(e){var t=e.get("confine");return t!=null?!!t:e.get("renderMode")==="richText"}function Gie(e){if(ot.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,f=o+i,h=f*Math.abs(Math.cos(c))+f*Math.abs(Math.sin(c)),d=Math.round(((h-Math.SQRT2*i)/2+Math.SQRT2*i-(h-f)/2)*100)/100;s+=";"+a+":-"+d+"px";var v=t+" solid "+i+"px;",m=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+v,"border-right:"+v,"background-color:"+n+";"];return'
'}function cXe(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?",":"")+(ot.transformSupported?""+T3+i:",left"+i+",top"+i)),oXe+":"+a}function iU(e,t,r){var n=e.toFixed(0)+"px",i=t.toFixed(0)+"px";if(!ot.transformSupported)return r?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=ot.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return r?"top:0;left:0;"+T3+":"+o+";":[["top",0],["left",0],[Wie,o]]}function fXe(e){var t=[],r=e.get("fontSize"),n=e.getTextColor();n&&t.push("color:"+n),t.push("font:"+e.getFont());var i=Ae(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),R(["decoration","align"],function(u){var c=e.get(u);c&&t.push("text-"+u+":"+c)}),t.join(";")}function hXe(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"),f=e.getModel("textStyle"),h=Eee(e,"html"),d=u+"px "+c+"px "+s+"px "+l;return i.push("box-shadow:"+d),t&&a>0&&i.push(cXe(a,r,n)),o&&i.push("background-color:"+o),R(["width","color","radius"],function(v){var m="border-"+v,y=Wj(m),x=e.get(y);x!=null&&i.push(m+":"+x+(v==="color"?"":"px"))}),i.push(fXe(f)),h!=null&&i.push("padding:"+pp(h).join("px ")+"px"),i.join(";")+";"}function aU(e,t,r,n,i){var a=t&&t.painter;if(r){var o=a&&a.getViewportRoot();o&&KDe(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 dXe=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,ot.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&&(me(a)?document.querySelector(a):Ef(a)?a:Pe(a)&&a(t.getDom()));aU(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();ca(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=aXe(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=sXe+hXe(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+iU(a[0],a[1],!0)+("border-color:"+$f(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(me(a)&&n.get("trigger")==="item"&&!Vie(n)&&(s=uXe(n,i,a)),me(t))o.innerHTML=t+s;else if(t){o.innerHTML="",oe(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||ot.node||!i.getDom())){var o=lU(a,i);this._ticket="";var s=a.dataByCoordSys,l=_Xe(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=pXe;c.x=a.x,c.y=a.y,c.update(),Be(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 f=Mie(a,n),h=f.point[0],d=f.point[1];h!=null&&d!=null&&this._tryShow({offsetX:h,offsetY:d,target:f.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(lU(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(),f=zg([c.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(f.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=Be(i);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;sf(i,function(c){if(c.tooltipDisabled)return l=u=null,!0;l||u||(Be(c).dataIndex!=null?l=c:Be(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=xe(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=zg([n.tooltipOption],a),l=this._renderMode,u=[],c=zr("section",{blocks:[],noHeader:!0}),f=[],h=new SM;R(r,function(_){R(_.dataByAxis,function(b){var S=i.getComponent(b.axisDim+"Axis",b.axisIndex),T=b.value;if(!(!S||T==null)){var C=Sie(T,S.axis,i,b.seriesDataIndices,b.valueLabelOpt),A=zr("section",{header:C,noHeader:!Fi(C),sortBlocks:!0,blocks:[]});c.blocks.push(A),R(b.seriesDataIndices,function(P){var O=i.getSeriesByIndex(P.seriesIndex),k=P.dataIndexInside,E=O.getDataParams(k);if(!(E.dataIndex<0)){E.axisDim=b.axisDim,E.axisIndex=b.axisIndex,E.axisType=b.axisType,E.axisId=b.axisId,E.axisValue=yS(S.axis,{value:T}),E.axisValueLabel=C,E.marker=h.makeTooltipMarker("item",$f(E.color),l);var N=T6(O.formatTooltip(k,!0,null)),D=N.frag;if(D){var z=zg([O],a).get("valueFormatter");A.blocks.push(z?ie({valueFormatter:z},D):D)}N.text&&f.push(N.text),u.push(E)}})}})}),c.blocks.reverse(),f.reverse();var d=n.position,v=s.get("order"),m=L6(c,h,l,v,i.get("useUTC"),s.get("textStyle"));m&&f.unshift(m);var y=l==="richText"?` + +`:"
",x=f.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,h)})},t.prototype._showSeriesItemTooltip=function(r,n,i){var a=this._ecModel,o=Be(n),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,c=o.dataIndex,f=o.dataType,h=u.getData(f),d=this._renderMode,v=r.positionDefault,m=zg([h.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,v?{position:v}:null),y=m.get("trigger");if(!(y!=null&&y!=="item")){var x=u.getDataParams(c,f),_=new SM;x.marker=_.makeTooltipMarker("item",$f(x.color),d);var b=T6(u.formatTooltip(c,!1,f)),S=m.get("order"),T=m.get("valueFormatter"),C=b.frag,A=C?L6(T?ie({valueFormatter:T},C):C,_,d,S,a.get("useUTC"),m.get("textStyle")):b.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:h.getRawIndex(c),seriesIndex:s,from:this.uid})}},t.prototype._showComponentItemTooltip=function(r,n,i){var a=this._renderMode==="html",o=Be(n),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(me(l)){var c=l;l={content:c,formatter:c},u=!0}u&&a&&l.content&&(l=ke(l),l.content=Yn(l.content));var f=[l],h=this._ecModel.getComponent(o.componentMainType,o.componentIndex);h&&f.push(h),f.push({formatter:l.content});var d=r.positionDefault,v=zg(f,this._tooltipModel,d?{position:d}:null),m=v.get("content"),y=Math.random()+"",x=new SM;this._showOrMove(v,function(){var _=ke(v.get("formatterParams")||{});this._showTooltipContent(v,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 f=this._tooltipContent;f.setEnterable(r.get("enterable"));var h=r.get("formatter");l=l||r.get("position");var d=n,v=this._getNearestPoint([o,s],i,r.get("trigger"),r.get("borderColor"),r.get("defaultBorderColor",!0)),m=v.color;if(h)if(me(h)){var y=r.ecModel.get("useUTC"),x=oe(i)?i[0]:i,_=x&&x.axisType&&x.axisType.indexOf("time")>=0;d=h,_&&(d=K0(x.axisValue,d,y)),d=Hj(d,i,!0)}else if(Pe(h)){var b=xe(function(S,T){S===this._ticket&&(f.setContent(T,c,r,m,l),this._updatePosition(r,l,o,s,f,i,u))},this);this._ticket=a,d=h(i,a,b)}else d=h;f.setContent(d,c,r,m,l),f.show(r,m),this._updatePosition(r,l,o,s,f,i,u)}},t.prototype._getNearestPoint=function(r,n,i,a,o){if(i==="axis"||oe(n))return{color:a||o};if(!oe(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 f=o.getSize(),h=r.get("align"),d=r.get("verticalAlign"),v=l&&l.getBoundingRect().clone();if(l&&v.applyTransform(l.transform),Pe(n)&&(n=n([i,a],s,o.el,v,{viewSize:[u,c],contentSize:f.slice()})),oe(n))i=ge(n[0],u),a=ge(n[1],c);else if(Ee(n)){var m=n;m.width=f[0],m.height=f[1];var y=Zt(m,{width:u,height:c});i=y.x,a=y.y,h=null,d=null}else if(me(n)&&l){var x=xXe(n,v,f,r.get("borderWidth"));i=x[0],a=x[1]}else{var x=mXe(i,a,o,u,c,h?null:20,d?null:20);i=x[0],a=x[1]}if(h&&(i-=uU(h)?f[0]/2:h==="right"?f[0]:0),d&&(a-=uU(d)?f[1]/2:d==="bottom"?f[1]:0),Vie(r)){var x=yXe(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&&R(i,function(s,l){var u=s.dataByAxis||[],c=r[l]||{},f=c.dataByAxis||[];o=o&&u.length===f.length,o&&R(u,function(h,d){var v=f[d]||{},m=h.seriesDataIndices||[],y=v.seriesDataIndices||[];o=o&&h.value===v.value&&h.axisType===v.axisType&&h.axisId===v.axisId&&m.length===y.length,o&&R(m,function(x,_){var b=y[_];o=o&&x.seriesIndex===b.seriesIndex&&x.dataIndex===b.dataIndex}),a&&R(h.seriesDataIndices,function(x){var _=x.seriesIndex,b=n[_],S=a[_];b&&S&&S.data!==b.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){ot.node||!n.getDom()||(a0(this,"_updatePosition"),this._tooltipContent.dispose(),_E("itemTooltip",n))},t.type="tooltip",t}(Rt);function zg(e,t,r){var n=t.ecModel,i;r?(i=new it(r,n,n),i=new it(t.option,i,n)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof it&&(o=o.get("tooltip",!0)),me(o)&&(o={formatter:o}),o&&(i=new it(o,i,n)))}return i}function lU(e,t){return e.dispatchAction||xe(t.dispatchAction,t)}function mXe(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 yXe(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 xXe(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 uU(e){return e==="center"||e==="middle"}function _Xe(e,t,r){var n=dj(e).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=sp(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=Be(u).tooltipConfig;if(c&&c.name===e.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}function bXe(e){Ke(ox),e.registerComponentModel(nXe),e.registerComponentView(gXe),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},yr),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},yr)}var wXe=["rect","polygon","keep","clear"];function SXe(e,t){var r=jt(e?e.brush:[]);if(r.length){var n=[];R(r,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(n=n.concat(u))});var i=e&&e.toolbox;oe(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),TXe(s),t&&!s.length&&s.push.apply(s,wXe)}}function TXe(e){var t={};R(e,function(r){t[r]=1}),e.length=0,R(t,function(r,n){e.push(n)})}var cU=R;function fU(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function kE(e,t,r){var n={};return cU(t,function(a){var o=n[a]=i();cU(e[a],function(s,l){if(on.isValidType(l)){var u={type:l,visual:s};r&&r(u,a),o[l]=new on(u),l==="opacity"&&(u=ke(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new on(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function Uie(e,t,r){var n;R(r,function(i){t.hasOwnProperty(i)&&fU(t[i])&&(n=!0)}),n&&R(r,function(i){t.hasOwnProperty(i)&&fU(t[i])?e[i]=ke(t[i]):delete e[i]})}function CXe(e,t,r,n,i,a){var o={};R(e,function(f){var h=on.prepareVisualTypes(t[f]);o[f]=h});var s;function l(f){return tR(r,s,f)}function u(f,h){Gee(r,s,f,h)}r.each(c);function c(f,h){s=f;var d=r.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var v=n.call(i,f),m=t[v],y=o[v],x=0,_=y.length;x<_;x++){var b=y[x];m[b]&&m[b].applyVisual(f,l,u)}}}function AXe(e,t,r,n){var i={};return R(e,function(a){var o=on.prepareVisualTypes(t[a]);i[a]=o}),{progress:function(o,s){var l;n!=null&&(l=s.getDimensionIndex(n));function u(T){return tR(s,f,T)}function c(T,C){Gee(s,f,T,C)}for(var f,h=s.getStore();(f=o.next())!=null;){var d=s.getRawDataItem(f);if(!(d&&d.visualMap===!1))for(var v=n!=null?h.get(l,f):f,m=r(v),y=t[m],x=i[m],_=0,b=x.length;_t[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&gU(t)}};function gU(e){return new je(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}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.init=function(r,n){this.ecModel=r,this.api=n,this.model,(this._brushController=new ZR(n.getZr())).on("brush",xe(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){Zie(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:ke(i),$from:n}),r.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:ke(i),$from:n})},t.type="brush",t}(Rt),NXe=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&&Uie(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=le(r,function(n){return mU(this.option,n)},this))},t.prototype.setBrushOption=function(r){this.brushOption=mU(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:J.color.backgroundTint,borderColor:J.color.borderTint},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:J.color.disabled},t}(tt);function mU(e,t){return Xe({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new it(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var DXe=["rect","polygon","lineX","lineY","keep","clear"],jXe=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,R(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 R(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:DXe.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}(ma);function RXe(e){e.registerComponentView(EXe),e.registerComponentModel(NXe),e.registerPreprocessor(SXe),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,PXe),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"},yr),e.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},yr),ed("brush",jXe)}var BXe=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:J.size.m,backgroundColor:J.color.transparent,borderColor:J.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:J.color.primary},subtextStyle:{fontSize:12,color:J.color.quaternary}},t}(tt),zXe=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=Ae(r.get("textBaseline"),r.get("textVerticalAlign")),c=new lt({style:Dt(o,{text:r.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),f=c.getBoundingRect(),h=r.get("subtext"),d=new lt({style:Dt(s,{text:h,fill:s.getTextColor(),y:f.height+r.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),v=r.get("link"),m=r.get("sublink"),y=r.get("triggerEvent",!0);c.silent=!v&&!y,d.silent=!m&&!y,v&&c.on("click",function(){sS(v,"_"+r.get("target"))}),m&&d.on("click",function(){sS(m,"_"+r.get("subtarget"))}),Be(c).eventData=Be(d).eventData=y?{componentType:"title",componentIndex:r.componentIndex}:null,a.add(c),h&&a.add(d);var x=a.getBoundingRect(),_=r.getBoxLayoutParams();_.width=x.width,_.height=x.height;var b=qr(r,i),S=Zt(_,b.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 C=S.margin,A=r.getItemStyle(["color","opacity"]);A.fill=r.get("backgroundColor");var P=new Qe({shape:{x:x.x-C[3],y:x.y-C[0],width:x.width+C[1]+C[3],height:x.height+C[0]+C[2],r:r.get("borderRadius")},style:A,subPixelOptimize:!0,silent:!0});a.add(P)}},t.type="title",t}(Rt);function $Xe(e){e.registerComponentModel(BXe),e.registerComponentView(zXe)}var yU=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=[],R(n,function(u,c){var f=Hr(op(u),""),h;Ee(u)?(h=ke(u),h.value=c):h=c,o.push(h),a.push(f)})):o=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new qn([{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:J.size.m,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:J.color.secondary},data:[]},t}(tt),Yie=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=Zu(yU.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:J.color.border,borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:J.color.accent10},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:J.color.tertiary},itemStyle:{color:J.color.accent20,borderWidth:0},checkpointStyle:{symbol:"circle",symbolSize:15,color:J.color.accent50,borderColor:J.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:J.color.accent50,borderColor:J.color.accent50,borderWidth:0},emphasis:{label:{show:!0,color:J.color.accent60},itemStyle:{color:J.color.accent60,borderColor:J.color.accent60},controlStyle:{color:J.color.accent70,borderColor:J.color.accent70}},progress:{lineStyle:{color:J.color.accent30},itemStyle:{color:J.color.accent40}},data:[]}),t}(yU);br(Yie,NC.prototype);var FXe=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}(Rt),VXe=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}(Ba),WP=Math.PI,xU=rt(),GXe=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 zr("nameValue",{noName:!0,value:c})},R(["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=HXe(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:WP/2},f=a==="vertical"?o.height:o.width,h=r.getModel("controlStyle"),d=h.get("show",!0),v=d?h.get("itemSize"):0,m=d?h.get("itemGap"):0,y=v+m,x=r.get(["label","rotate"])||0;x=x*WP/180;var _,b,S,T=h.get("position",!0),C=d&&h.get("showPlayBtn",!0),A=d&&h.get("showPrevBtn",!0),P=d&&h.get("showNextBtn",!0),O=0,k=f;T==="left"||T==="bottom"?(C&&(_=[0,0],O+=y),A&&(b=[O,0],O+=y),P&&(S=[k-v,0],k-=y)):(C&&(_=[k-v,0],k-=y),A&&(b=[0,0],O+=y),P&&(S=[k-v,0],k-=y));var E=[O,k];return r.get("inverse")&&E.reverse(),{viewRect:o,mainLength:f,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:b,nextBtnPosition:S,axisExtent:E,controlSize:v,controlGap:m}},t.prototype._position=function(r,n){var i=this._mainGroup,a=this._labelGroup,o=r.viewRect;if(r.orient==="vertical"){var s=an(),l=o.x,u=o.y+o.height;po(s,s,[-l,-u]),_l(s,s,-WP/2),po(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var c=_(o),f=_(i.getBoundingRect()),h=_(a.getBoundingRect()),d=[i.x,i.y],v=[a.x,a.y];v[0]=d[0]=c[0][0];var m=r.labelPosOpt;if(m==null||me(m)){var y=m==="+"?0:1;b(d,f,c,1,y),b(v,h,c,1,1-y)}else{var y=m>=0?0:1;b(d,f,c,1,y),v[1]=d[1]+m}i.setPosition(d),a.setPosition(v),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 b(S,T,C,A,P){S[A]+=C[A][P]-T[A][P]}},t.prototype._createAxis=function(r,n){var i=n.getData(),a=n.get("axisType"),o=WXe(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 VXe("value",o,r.axisExtent,a);return l.model=n,l},t.prototype._createGroup=function(r){var n=this[r]=new Le;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 Pr({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:ie({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new Pr({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:Ie({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=[],R(l,function(u){var c=i.dataToCoord(u.value),f=s.getItemModel(u.value),h=f.getModel("itemStyle"),d=f.getModel(["emphasis","itemStyle"]),v=f.getModel(["progress","itemStyle"]),m={x:c,y:0,onclick:xe(o._changeTimeline,o,u.value)},y=_U(f,h,n,m);y.ensureState("emphasis").style=d.getItemStyle(),y.ensureState("progress").style=v.getItemStyle(),yu(y);var x=Be(y);f.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=[],R(u,function(c){var f=c.tickValue,h=l.getItemModel(f),d=h.getModel("label"),v=h.getModel(["emphasis","label"]),m=h.getModel(["progress","label"]),y=i.dataToCoord(c.tickValue),x=new lt({x:y,y:0,rotation:r.labelRotation-r.rotation,onclick:xe(o._changeTimeline,o,f),silent:!1,style:Dt(d,{text:c.formattedLabel,align:r.labelAlign,verticalAlign:r.labelBaseline})});x.ensureState("emphasis").style=Dt(v),x.ensureState("progress").style=Dt(m),n.add(x),yu(x),xU(x).dataIndex=f,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(),f=a.get("inverse",!0);h(r.nextBtnPosition,"next",xe(this._changeTimeline,this,f?"-":"+")),h(r.prevBtnPosition,"prev",xe(this._changeTimeline,this,f?"+":"-")),h(r.playPosition,c?"stop":"play",xe(this._handlePlayClick,this,!c),!0);function h(d,v,m,y){if(d){var x=go(Ae(a.get(["controlStyle",v+"BtnSize"]),o),o),_=[0,-x/2,x,x],b=UXe(a,v+"Icon",_,{x:d[0],y:d[1],originX:o/2,originY:0,rotation:y?-s:0,rectHover:!0,style:l,onclick:m});b.ensureState("emphasis").style=u,n.add(b),yu(b)}}},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(f){f.draggable=!0,f.drift=xe(u._handlePointerDrag,u),f.ondragend=xe(u._handlePointerDragend,u),bU(f,u._progressLine,s,i,a,!0)},onUpdate:function(f){bU(f,u._progressLine,s,i,a)}};this._currentPointer=_U(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=Vi(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(s[o]=+s[o].toFixed(v)),[s,d]}var Tb={min:Ue(Sb,"min"),max:Ue(Sb,"max"),average:Ue(Sb,"average"),median:Ue(Sb,"median")};function b0(e,t){if(t){var r=e.getData(),n=e.coordinateSystem,i=n&&n.dimensions;if(!JXe(t)&&!oe(t.coord)&&oe(i)){var a=Xie(t,r,n,e);if(t=ke(t),t.type&&Tb[t.type]&&a.baseAxis&&a.valueAxis){var o=Ye(i,a.baseAxis.dim),s=Ye(i,a.valueAxis.dim),l=Tb[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||!oe(i)){t.coord=[];var u=e.getBaseAxis();if(u&&t.type&&Tb[t.type]){var c=n.getOtherAxis(u);c&&(t.value=VS(r,r.mapDimension(c.dim),t.type))}}else for(var f=t.coord,h=0;h<2;h++)Tb[f[h]]&&(f[h]=VS(r,r.mapDimension(i[h]),f[h]));return t}}function Xie(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(QXe(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 QXe(e,t){var r=e.getData().getDimensionInfo(t);return r&&r.coordDim}function w0(e,t){return e&&e.containData&&t.coord&&!OE(t)?e.containData(t.coord):!0}function eqe(e,t,r){return e&&e.containZone&&t.coord&&r.coord&&!OE(t)&&!OE(r)?e.containZone(t.coord,r.coord):!0}function qie(e,t){return e?function(r,n,i,a){var o=a<2?r.coord&&r.coord[a]:r.value;return bu(o,t[a])}:function(r,n,i,a){return bu(r.value,t[a])}}function VS(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 HP=rt(),A3=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=Ce()},t.prototype.render=function(r,n,i){var a=this,o=this.markerGroupMap;o.each(function(s){HP(s).keep=!1}),n.eachSeries(function(s){var l=us.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!HP(s).keep&&a.group.remove(s.group)}),tqe(n,o,this.type)},t.prototype.markKeep=function(r){HP(r).keep=!0},t.prototype.toggleBlurSeries=function(r,n){var i=this;R(r,function(a){var o=us.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?fQ(l):bj(l))})}})},t.type="marker",t}(Rt);function tqe(e,t,r){e.eachSeries(function(n){var i=us.getMarkerModelFromSeries(n,r),a=t.get(n.id);if(i&&a&&a.group){var o=zf(i),s=o.z,l=o.zlevel;LC(a.group,s,l)}})}function SU(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,f=u?o?o.height:0:a,h=u&&o?o.x:0,d=u&&o?o.y:0,v,m=ge(l.get("x"),c)+h,y=ge(l.get("y"),f)+d;if(!isNaN(m)&&!isNaN(y))v=[m,y];else if(t.getMarkerPosition)v=t.getMarkerPosition(e.getValues(e.dimensions,s));else if(n){var x=e.get(n.dimensions[0],s),_=e.get(n.dimensions[1],s);v=n.dataToPoint([x,_])}isNaN(m)||(v[0]=m),isNaN(y)||(v[1]=y),e.setItemLayout(s,v)})}var rqe=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=us.getMarkerModelFromSeries(a,"markPoint");o&&(SU(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 rx),f=nqe(o,r,n);n.setData(f),SU(n.getData(),r,a),f.each(function(h){var d=f.getItemModel(h),v=d.getShallow("symbol"),m=d.getShallow("symbolSize"),y=d.getShallow("symbolRotate"),x=d.getShallow("symbolOffset"),_=d.getShallow("symbolKeepAspect");if(Pe(v)||Pe(m)||Pe(y)||Pe(x)){var b=n.getRawValue(h),S=n.getDataParams(h);Pe(v)&&(v=v(b,S)),Pe(m)&&(m=m(b,S)),Pe(y)&&(y=y(b,S)),Pe(x)&&(x=x(b,S))}var T=d.getModel("itemStyle").getItemStyle(),C=d.get("z2"),A=Q0(l,"color");T.fill||(T.fill=A),f.setItemVisual(h,{z2:Ae(C,0),symbol:v,symbolSize:m,symbolRotate:y,symbolOffset:x,symbolKeepAspect:_,style:T})}),c.updateData(f),this.group.add(c.group),f.eachItemGraphicEl(function(h){h.traverse(function(d){Be(d).dataModel=n})}),this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markPoint",t}(A3);function nqe(e,t,r){var n;e?n=le(e&&e.dimensions,function(s){var l=t.getData().getDimensionInfo(t.getData().mapDimension(s))||{};return ie(ie({},l),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new qn(n,r),a=le(r.get("data"),Ue(b0,t));e&&(a=gt(a,Ue(w0,e)));var o=qie(!!e,n);return i.initData(a,null,o),i}function iqe(e){e.registerComponentModel(KXe),e.registerComponentView(rqe),e.registerPreprocessor(function(t){C3(t.series,"markPoint")&&(t.markPoint=t.markPoint||{})})}var aqe=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}(us),Cb=rt(),oqe=function(e,t,r,n){var i=e.getData(),a;if(oe(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=Xie(n,i,t,e);s=u.valueAxis;var c=vR(i,u.valueDataDim);l=VS(i,c,o)}var f=s.dim==="x"?0:1,h=1-f,d=ke(n),v={coord:[]};d.type=null,d.coord=[],d.coord[h]=-1/0,v.coord[h]=1/0;var m=r.get("precision");m>=0&&ut(l)&&(l=+l.toFixed(Math.min(m,20))),d.coord[f]=v.coord[f]=l,a=[d,v,{type:o,valueIndex:n.valueIndex,value:l}]}else a=[]}var y=[b0(e,a[0]),b0(e,a[1]),ie({},a[2])];return y[2].type=y[2].type||null,Xe(y[2],y[0]),Xe(y[2],y[1]),y};function GS(e){return!isNaN(e)&&!isFinite(e)}function TU(e,t,r,n){var i=1-e,a=n.dimensions[e];return GS(t[i])&&GS(r[i])&&t[e]===r[e]&&n.getAxis(a).containData(t[e])}function sqe(e,t){if(e.type==="cartesian2d"){var r=t[0].coord,n=t[1].coord;if(r&&n&&(TU(1,r,n,e)||TU(0,r,n,e)))return!0}return w0(e,t[0])&&w0(e,t[1])}function UP(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=ge(o.get("x"),i.getWidth()),u=ge(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,f=e.get(c[0],t),h=e.get(c[1],t);s=a.dataToPoint([f,h])}if(Ou(a,"cartesian2d")){var d=a.getAxis("x"),v=a.getAxis("y"),c=a.dimensions;GS(e.get(c[0],t))?s[0]=d.toGlobalCoord(d.getExtent()[r?0:1]):GS(e.get(c[1],t))&&(s[1]=v.toGlobalCoord(v.getExtent()[r?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}e.setItemLayout(t,s)}var lqe=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=us.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=Cb(o).from,u=Cb(o).to;l.each(function(c){UP(l,c,!0,a,i),UP(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 HR);this.group.add(c.group);var f=uqe(o,r,n),h=f.from,d=f.to,v=f.line;Cb(n).from=h,Cb(n).to=d,n.setData(v);var m=n.get("symbol"),y=n.get("symbolSize"),x=n.get("symbolRotate"),_=n.get("symbolOffset");oe(m)||(m=[m,m]),oe(y)||(y=[y,y]),oe(x)||(x=[x,x]),oe(_)||(_=[_,_]),f.from.each(function(S){b(h,S,!0),b(d,S,!1)}),v.each(function(S){var T=v.getItemModel(S),C=T.getModel("lineStyle").getLineStyle();v.setItemLayout(S,[h.getItemLayout(S),d.getItemLayout(S)]);var A=T.get("z2");C.stroke==null&&(C.stroke=h.getItemVisual(S,"style").fill),v.setItemVisual(S,{z2:Ae(A,0),fromSymbolKeepAspect:h.getItemVisual(S,"symbolKeepAspect"),fromSymbolOffset:h.getItemVisual(S,"symbolOffset"),fromSymbolRotate:h.getItemVisual(S,"symbolRotate"),fromSymbolSize:h.getItemVisual(S,"symbolSize"),fromSymbol:h.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:C})}),c.updateData(v),f.line.eachItemGraphicEl(function(S){Be(S).dataModel=n,S.traverse(function(T){Be(T).dataModel=n})});function b(S,T,C){var A=S.getItemModel(T);UP(S,T,C,r,a);var P=A.getModel("itemStyle").getItemStyle();P.fill==null&&(P.fill=Q0(l,"color")),S.setItemVisual(T,{symbolKeepAspect:A.get("symbolKeepAspect"),symbolOffset:Ae(A.get("symbolOffset",!0),_[C?0:1]),symbolRotate:Ae(A.get("symbolRotate",!0),x[C?0:1]),symbolSize:Ae(A.get("symbolSize"),y[C?0:1]),symbol:Ae(A.get("symbol",!0),m[C?0:1]),style:P})}this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markLine",t}(A3);function uqe(e,t,r){var n;e?n=le(e&&e.dimensions,function(u){var c=t.getData().getDimensionInfo(t.getData().mapDimension(u))||{};return ie(ie({},c),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new qn(n,r),a=new qn(n,r),o=new qn([],r),s=le(r.get("data"),Ue(oqe,t,e,r));e&&(s=gt(s,Ue(sqe,e)));var l=qie(!!e,n);return i.initData(le(s,function(u){return u[0]}),null,l),a.initData(le(s,function(u){return u[1]}),null,l),o.initData(le(s,function(u){return u[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function cqe(e){e.registerComponentModel(aqe),e.registerComponentView(lqe),e.registerPreprocessor(function(t){C3(t.series,"markLine")&&(t.markLine=t.markLine||{})})}var fqe=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}(us),Ab=rt(),hqe=function(e,t,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=b0(e,i),s=b0(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=dC([{},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 WS(e){return!isNaN(e)&&!isFinite(e)}function CU(e,t,r,n){var i=1-e;return WS(t[i])&&WS(r[i])}function dqe(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 Ou(e,"cartesian2d")?r&&n&&(CU(1,r,n)||CU(0,r,n))?!0:eqe(e,i,a):w0(e,i)||w0(e,a)}function AU(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=ge(o.get(r[0]),i.getWidth()),u=ge(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),f=e.getValues(["x1","y1"],t),h=a.clampData(c),d=a.clampData(f),v=[];r[0]==="x0"?v[0]=h[0]>d[0]?f[0]:c[0]:v[0]=h[0]>d[0]?c[0]:f[0],r[1]==="y0"?v[1]=h[1]>d[1]?f[1]:c[1]:v[1]=h[1]>d[1]?c[1]:f[1],s=n.getMarkerPosition(v,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(Ou(a,"cartesian2d")){var _=a.getAxis("x"),b=a.getAxis("y"),m=e.get(r[0],t),y=e.get(r[1],t);WS(m)?s[0]=_.toGlobalCoord(_.getExtent()[r[0]==="x0"?0:1]):WS(y)&&(s[1]=b.toGlobalCoord(b.getExtent()[r[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var MU=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],vqe=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=us.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=le(MU,function(f){return AU(s,l,f,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 Le});this.group.add(c.group),this.markKeep(c);var f=pqe(o,r,n);n.setData(f),f.each(function(h){var d=le(MU,function(k){return AU(f,h,k,r,a)}),v=o.getAxis("x").scale,m=o.getAxis("y").scale,y=v.getExtent(),x=m.getExtent(),_=[v.parse(f.get("x0",h)),v.parse(f.get("x1",h))],b=[m.parse(f.get("y0",h)),m.parse(f.get("y1",h))];Vi(_),Vi(b);var S=!(y[0]>_[1]||y[1]<_[0]||x[0]>b[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:J.size.m,align:"auto",backgroundColor:J.color.transparent,borderColor:J.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:J.color.disabled,inactiveBorderColor:J.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:J.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:J.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:J.color.tertiary,borderWidth:1,borderColor:J.color.border},emphasis:{selectorLabel:{show:!0,color:J.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}(tt),Hh=Ue,EE=R,Mb=Le,Kie=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 Mb),this.group.add(this._selectorGroup=new Mb),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=qr(r,i).refContainer,f=r.getBoxLayoutParams(),h=r.get("padding"),d=Zt(f,c,h),v=this.layoutInner(r,o,d,a,l,u),m=Zt(Ie({width:v.width,height:v.height},f),c,h);this.group.x=m.x-v.x,this.group.y=m.y-v.y,this.group.markRedraw(),this.group.add(this._backgroundEl=zie(v,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=Ce(),f=n.get("selectedMode"),h=n.get("triggerEvent"),d=[];i.eachRawSeries(function(v){!v.get("legendHoverLink")&&d.push(v.id)}),EE(n.getData(),function(v,m){var y=this,x=v.get("name");if(!this.newlineDisabled&&(x===""||x===` +`)){var _=new Mb;_.newline=!0,u.add(_);return}var b=i.getSeriesByName(x)[0];if(!c.get(x))if(b){var S=b.getData(),T=S.getVisual("legendLineStyle")||{},C=S.getVisual("legendIcon"),A=S.getVisual("style"),P=this._createItem(b,x,m,v,n,r,T,A,C,f,a);P.on("click",Hh(PU,x,null,a,d)).on("mouseover",Hh(NE,b.name,null,a,d)).on("mouseout",Hh(DE,b.name,null,a,d)),i.ssr&&P.eachChild(function(O){var k=Be(O);k.seriesIndex=b.seriesIndex,k.dataIndex=m,k.ssrType="legend"}),h&&P.eachChild(function(O){y.packEventData(O,n,b,m,x)}),c.set(x,!0)}else i.eachRawSeries(function(O){var k=this;if(!c.get(x)&&O.legendVisualProvider){var E=O.legendVisualProvider;if(!E.containName(x))return;var N=E.indexOfName(x),D=E.getItemVisual(N,"style"),z=E.getItemVisual(N,"legendIcon"),V=Xn(D.fill);V&&V[3]===0&&(V[3]=.2,D=ie(ie({},D),{fill:Ca(V,"rgba")}));var F=this._createItem(O,x,m,v,n,r,{},D,z,f,a);F.on("click",Hh(PU,null,x,a,d)).on("mouseover",Hh(NE,null,x,a,d)).on("mouseout",Hh(DE,null,x,a,d)),i.ssr&&F.eachChild(function($){var B=Be($);B.seriesIndex=O.seriesIndex,B.dataIndex=m,B.ssrType="legend"}),h&&F.eachChild(function($){k.packEventData($,n,O,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};Be(r).eventData=s},t.prototype._createSelector=function(r,n,i,a,o){var s=this.getSelectorGroup();EE(r,function(u){var c=u.type,f=new lt({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(f);var h=n.getModel("selectorLabel"),d=n.getModel(["emphasis","selectorLabel"]);sn(f,{normal:h,emphasis:d},{defaultText:u.title}),yu(f)})},t.prototype._createItem=function(r,n,i,a,o,s,l,u,c,f,h){var d=r.visualDrawType,v=o.get("itemWidth"),m=o.get("itemHeight"),y=o.isSelected(n),x=a.get("symbolRotate"),_=a.get("symbolKeepAspect"),b=a.get("icon");c=b||c||"roundRect";var S=yqe(c,a,l,u,d,y,h),T=new Mb,C=a.getModel("textStyle");if(Pe(r.getLegendIcon)&&(!b||b==="inherit"))T.add(r.getLegendIcon({itemWidth:v,itemHeight:m,icon:c,iconRotate:x,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:_}));else{var A=b==="inherit"&&r.getData().getVisual("symbol")?x==="inherit"?r.getData().getVisual("symbolRotate"):x:0;T.add(xqe({itemWidth:v,itemHeight:m,icon:c,iconRotate:A,itemStyle:S.itemStyle,symbolKeepAspect:_}))}var P=s==="left"?v+5:-5,O=s,k=o.get("formatter"),E=n;me(k)&&k?E=k.replace("{name}",n??""):Pe(k)&&(E=k(n));var N=y?C.getTextColor():a.get("inactiveColor");T.add(new lt({style:Dt(C,{text:E,x:P,y:m/2,fill:N,align:O,verticalAlign:"middle"},{inheritColor:N})}));var D=new Qe({shape:T.getBoundingRect(),style:{fill:"transparent"}}),z=a.getModel("tooltip");return z.get("show")&&wl({el:D,componentModel:o,itemName:n,itemTooltipOption:z.option}),T.add(D),T.eachChild(function(V){V.silent=!0}),D.silent=!f,this.getContentGroup().add(T),yu(T),T.__legendDataIndex=i,T},t.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();yf(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var c=l.getBoundingRect(),f=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),o){yf("horizontal",u,r.get("selectorItemGap",!0));var h=u.getBoundingRect(),d=[-h.x,-h.y],v=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]+v:f[m]+=h[y]+v,d[1-m]+=c[x]/2-h[x]/2,u.x=d[0],u.y=d[1],l.x=f[0],l.y=f[1];var b={x:0,y:0};return b[y]=c[y]+v+h[y],b[x]=Math.max(c[x],h[x]),b[_]=Math.min(0,h[_]+d[1-m]),b}else return l.x=f[0],l.y=f[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(Rt);function yqe(e,t,r,n,i,a,o){function s(y,x){y.lineWidth==="auto"&&(y.lineWidth=x.lineWidth>0?2:0),EE(y,function(_,b){y[b]==="inherit"&&(y[b]=x[b])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=e.lastIndexOf("empty",0)===0?"fill":"stroke",f=l.getShallow("decal");u.decal=!f||f==="inherit"?n.decal:Av(f,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 h=t.getModel("lineStyle"),d=h.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 v=t.get("inactiveBorderWidth"),m=u[c];u.lineWidth=v==="auto"?n.lineWidth>0&&m?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),d.stroke=h.get("inactiveColor"),d.lineWidth=h.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}function xqe(e){var t=e.icon||"roundRect",r=Lr(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=J.color.neutral00,r.style.lineWidth=2),r}function PU(e,t,r,n){DE(e,t,r,n),r.dispatchAction({type:"legendToggleSelect",name:e??t}),NE(e,t,r,n)}function Jie(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],_=[-v.x,-v.y],b=Ae(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(m){var S=r.get("pageButtonPosition",!0);S==="end"?_[a]+=i[o]-v[o]:x[a]+=v[o]+b}_[1-a]+=d[s]/2-v[s]/2,c.setPosition(y),f.setPosition(x),h.setPosition(_);var T={x:0,y:0};if(T[o]=m?i[o]:d[o],T[s]=Math.max(d[s],v[s]),T[l]=Math.min(0,v[l]+_[1-a]),f.__rectSize=i[o],m){var C={x:0,y:0};C[o]=Math.max(i[o]-v[o]-b,0),C[s]=T[s],f.setClipPath(new Qe({shape:C})),f.__rectSize=C[o]}else h.eachChild(function(P){P.attr({invisible:!0,silent:!0})});var A=this._getPageInfo(r);return A.pageIndex!=null&&ft(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;R(["pagePrev","pageNext"],function(c){var f=c+"DataIndex",h=n[f]!=null,d=i.childOfName(c);d&&(d.setStyle("fill",h?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),d.cursor=h?"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",me(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=ZP[o],l=YP[o],u=this._findTargetItemIndex(n),c=i.children(),f=c[u],h=c.length,d=h?1:0,v={contentPosition:[i.x,i.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return v;var m=S(f);v.contentPosition[o]=-m.s;for(var y=u+1,x=m,_=m,b=null;y<=h;++y)b=S(c[y]),(!b&&_.e>x.s+a||b&&!T(b,x.s))&&(_.i>x.i?x=_:x=b,x&&(v.pageNextDataIndex==null&&(v.pageNextDataIndex=x.i),++v.pageCount)),_=b;for(var y=u-1,x=m,_=m,b=null;y>=-1;--y)b=S(c[y]),(!b||!T(_,b.s))&&x.i<_.i&&(_=x,v.pagePrevDataIndex==null&&(v.pagePrevDataIndex=x.i),++v.pageCount,++v.pageIndex),x=b;return v;function S(C){if(C){var A=C.getBoundingRect(),P=A[l]+C[l];return{s:P,e:P+A[s],i:C.__legendDataIndex}}}function T(C,A){return C.e>=A&&C.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}(Kie);function Tqe(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 Cqe(e){Ke(Qie),e.registerComponentModel(wqe),e.registerComponentView(Sqe),Tqe(e)}function Aqe(e){Ke(Qie),Ke(Cqe)}var Mqe=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=Zu(_0.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(_0),M3=rt();function Pqe(e,t,r){M3(e).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(t.uid);i&&(i.getRange=r)})}function kqe(e,t){for(var r=M3(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 Nqe(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(t,r){var n=M3(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=Ce());i.each(function(a){a.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=jie(a);R(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,Lqe(r,s.model)),c=u.dataZoomInfoMap||(u.dataZoomInfoMap=Ce());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){eae(i,a);return}var c=Eqe(l,a,r);o.enable(c.controlType,c.opt),yp(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var Dqe=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(),Pqe(i,r,{pan:xe(XP.pan,this),zoom:xe(XP.zoom,this),scrollMove:xe(XP.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){kqe(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(x3),XP={zoom:function(e,t,r,n){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=qP[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(Iu(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:IU(function(e,t,r,n,i,a){var o=qP[n]([a.oldX,a.oldY],[a.newX,a.newY],t,i,r);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:IU(function(e,t,r,n,i,a){var o=qP[n]([0,0],[a.scrollDelta,a.scrollDelta],t,i,r);return o.signal*(e[1]-e[0])*a.scrollDelta})};function IU(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(Iu(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var qP={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 tae(e){_3(e),e.registerComponentModel(Mqe),e.registerComponentView(Dqe),Nqe(e)}var jqe=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=Zu(_0.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:J.color.accent10,borderRadius:0,backgroundColor:J.color.transparent,dataBackground:{lineStyle:{color:J.color.accent30,width:.5},areaStyle:{color:J.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:J.color.accent40,width:.5},areaStyle:{color:J.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:J.color.neutral00,borderColor:J.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:J.color.accent40,opacity:.5},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:J.color.tertiary},brushSelect:!0,brushStyle:{color:J.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:J.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(_0),Vg=Qe,Rqe=1,KP=30,Bqe=7,Gg="horizontal",EU="vertical",zqe=5,$qe=["line","bar","candlestick","scatter"],Fqe={easing:"cubicOut",duration:100,delay:0},Vqe=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=xe(this._onBrush,this),this._onBrushEnd=xe(this._onBrushEnd,this)},t.prototype.render=function(r,n,i,a){if(e.prototype.render.apply(this,arguments),yp(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(){a0(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 Le;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?Bqe:0,o=qr(r,n).refContainer,s=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===Gg?{right:o.width-s.x-s.width,top:o.height-KP-l-a,width:s.width,height:KP}:{right:l,top:s.y,width:KP,height:s.height},c=rh(r.option);R(["right","top","width","height"],function(h){c[h]==="ph"&&(c[h]=u[h])});var f=Zt(c,o);this._location={x:f.x,y:f.y},this._size=[f.width,f.height],this._orient===EU&&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===Gg&&!o?{scaleY:l?1:-1,scaleX:1}:i===Gg&&o?{scaleY:l?1:-1,scaleX:-1}:i===EU&&!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 Vg({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new Vg({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:xe(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 f=o.getDataExtent(r.thisDim),h=o.getDataExtent(l),d=(h[1]-h[0])*.3;h=[h[0]-d,h[1]+d];var v=[0,n[1]],m=[0,n[0]],y=[[n[0],0],[0,0]],x=[],_=m[1]/Math.max(1,o.count()-1),b=n[0]/(f[1]-f[0]),S=r.thisAxis.type==="time",T=-_,C=Math.round(o.count()/n[0]),A;o.each([r.thisDim,l],function(N,D,z){if(C>0&&z%C){S||(T+=_);return}T=S?(+N-f[0])*b:T+_;var V=D==null||isNaN(D)||D==="",F=V?0:_t(D,h,v,!0);V&&!A&&z?(y.push([y[y.length-1][0],0]),x.push([x[x.length-1][0],0])):!V&&A&&(y.push([T,0]),x.push([T,0])),V||(y.push([T,F]),x.push([T,F])),A=V}),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 O(N){var D=P.getModel(N?"selectedDataBackground":"dataBackground"),z=new Le,V=new jn({shape:{points:u},segmentIgnoreThreshold:1,style:D.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),F=new xn({shape:{points:c},segmentIgnoreThreshold:1,style:D.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return z.add(V),z.add(F),z}for(var k=0;k<3;k++){var E=O(k===1);this._displayables.sliderGroup.add(E),this._displayables.dataShadowSegs.push(E)}},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();R(l,function(u){if(!i&&!(n!==!0&&Ye($qe,u.get("type"))<0)){var c=a.getComponent(iu(o),s).axis,f=Gqe(o),h,d=u.coordinateSystem;f!=null&&d.getOtherAxis&&(h=d.getOtherAxis(c).inverse),f=u.getData().mapDimension(f);var v=u.getData().mapDimension(o);i={thisAxis:c,series:u,thisDim:v,otherDim:f,otherAxisInverse:h}}},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,f=l.get("brushSelect"),h=n.filler=new Vg({silent:f,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(h),o.add(new Vg({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:Rqe,fill:J.color.transparent}})),R([0,1],function(b){var S=l.get("handleIcon");!cS[S]&&S.indexOf("path://")<0&&S.indexOf("image://")<0&&(S="path://"+S);var T=Lr(S,-1,0,2,2,null,!0);T.attr({cursor:Wqe(this._orient),draggable:!0,drift:xe(this._onDragMove,this,b),ondragend:xe(this._onDragEnd,this),onmouseover:xe(this._showDataInfo,this,!0),onmouseout:xe(this._showDataInfo,this,!1),z2:5});var C=T.getBoundingRect(),A=l.get("handleSize");this._handleHeight=ge(A,this._size[1]),this._handleWidth=C.width/C.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(),yu(T);var P=l.get("handleColor");P!=null&&(T.style.fill=P),o.add(i[b]=T);var O=l.getModel("textStyle"),k=l.get("handleLabel")||{},E=k.show||!1;r.add(a[b]=new lt({silent:!0,invisible:!E,style:Dt(O,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:O.getTextColor(),font:O.getFont()}),z2:10}))},this);var d=h;if(f){var v=ge(l.get("moveHandleSize"),s[1]),m=n.moveHandle=new Qe({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:v}}),y=v*.8,x=n.moveHandleIcon=Lr(l.get("moveHandleIcon"),-y/2,-y/2,y,y,J.color.neutral00,!0);x.silent=!0,x.y=s[1]+v/2-.5,m.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var _=Math.min(s[1]/2,Math.max(v,10));d=n.moveZone=new Qe({invisible:!0,shape:{y:s[1]-_,height:v+_}}),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:xe(this._onDragMove,this,"all"),ondragstart:xe(this._showDataInfo,this,!0),ondragend:xe(this._onDragEnd,this),onmouseover:xe(this._showDataInfo,this,!0),onmouseout:xe(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[_t(r[0],[0,100],n,!0),_t(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];Iu(n,a,o,i.get("zoomLock")?"all":r,s.minSpan!=null?_t(s.minSpan,l,o,!0):null,s.maxSpan!=null?_t(s.maxSpan,l,o,!0):null);var u=this._range,c=this._range=Vi([_t(a[0],o,l,!0),_t(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=Vi(i.slice()),o=this._size;R([0,1],function(d){var v=n.handles[d],m=this._handleHeight;v.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 De(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();Iu(0,l,o,0,u.minSpan!=null?_t(u.minSpan,s,o,!0):null,u.maxSpan!=null?_t(u.maxSpan,s,o,!0):null),this._range=Vi([_t(l[0],o,s,!0),_t(l[1],o,s,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(r){this._brushing&&(ul(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 Vg({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),f=this._size;u[0]=Math.max(Math.min(f[0],u[0]),0),o.setShape({x:c[0],y:0,width:u[0]-c[0],height:f[1]})},t.prototype._dispatchZoomAction=function(r){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?Fqe:null,start:n[0],end:n[1]})},t.prototype._findCoordRect=function(){var r,n=jie(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}(x3);function Gqe(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}function Wqe(e){return e==="vertical"?"ns-resize":"ew-resize"}function rae(e){e.registerComponentModel(jqe),e.registerComponentView(Vqe),_3(e)}function Hqe(e){Ke(tae),Ke(rae)}var nae={get:function(e,t,r){var n=ke((Uqe[e]||{})[t]);return r&&oe(n)?n[n.length-1]:n}},Uqe={color:{active:["#006edd","#e0ffff"],inactive:[J.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]}},NU=on.mapVisual,Zqe=on.eachVisual,Yqe=oe,DU=R,Xqe=Vi,qqe=_t,HS=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&&Uie(i,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(r){var n=this.stateList;r=xe(r,this),this.controllerVisuals=kE(this.option.controller,n,r),this.targetVisuals=kE(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=sp(this.ecModel,"series",{index:n,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return le(i,function(a){return a.componentIndex})},t.prototype.eachTargetSeries=function(r,n){R(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||["<",">"],oe(r)&&(r=r.slice(),u=!0);var c=n?r:u?[f(r[0]),f(r[1])]:f(r);if(me(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(Pe(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 f(h){return h===s[0]?"min":h===s[1]?"max":(+h).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var r=this.option,n=Xqe([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={});Xe(a,i),Xe(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(f){Yqe(n.color)&&!f.inRange&&(f.inRange={color:n.color.slice().reverse()}),f.inRange=f.inRange||{color:r.get("gradientColor")}}function u(f,h,d){var v=f[h],m=f[d];v&&!m&&(m=f[d]={},DU(v,function(y,x){if(on.isValidType(x)){var _=nae.get(x,"inactive",s);_!=null&&(m[x]=_,x==="color"&&!m.hasOwnProperty("opacity")&&!m.hasOwnProperty("colorAlpha")&&(m.opacity=[0,0]))}}))}function c(f){var h=(f.inRange||{}).symbol||(f.outOfRange||{}).symbol,d=(f.inRange||{}).symbolSize||(f.outOfRange||{}).symbolSize,v=this.get("inactiveColor"),m=this.getItemSymbol(),y=m||"roundRect";DU(this.stateList,function(x){var _=this.itemSize,b=f[x];b||(b=f[x]={color:s?v:[v]}),b.symbol==null&&(b.symbol=h&&ke(h)||(s?y:[y])),b.symbolSize==null&&(b.symbolSize=d&&ke(d)||(s?_[0]:[_[0],_[0]])),b.symbol=NU(b.symbol,function(C){return C==="none"?y:C});var S=b.symbolSize;if(S!=null){var T=-1/0;Zqe(S,function(C){C>T&&(T=C)}),b.symbolSize=NU(S,function(C){return qqe(C,[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:J.color.transparent,borderColor:J.color.borderTint,contentColor:J.color.theme[0],inactiveColor:J.color.disabled,borderWidth:0,padding:J.size.m,textGap:10,precision:0,textStyle:{color:J.color.secondary}},t}(tt),jU=[20,140],Kqe=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]=jU[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=jU[1])},t.prototype._resetRange=function(){var r=this.getExtent(),n=this.option.range;!n||n.auto?(r.auto=1,this.option.range=r):oe(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),R(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=Vi((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=RU(this,"outOfRange",this.getExtent()),i=RU(this,"inRange",this.option.range.slice()),a=[];function o(d,v){a.push({value:d,color:r(d,v)})}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 Le(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);Jqe([0,1],function(f){var h=o[f];h.setStyle("fill",n.handlesColor[f]),h.y=r[f];var d=Eo(r[f],[0,l[1]],u,!0),v=this.getControllerVisual(d,"symbolSize");h.scaleX=h.scaleY=v/l[0],h.x=l[0]-v/2;var m=uo(i.handleLabelPoints[f],xu(h,this.group));if(this._orient==="horizontal"){var y=c==="left"||c==="top"?(l[0]-v)/2:(l[0]-v)/-2;m[1]+=y}s[f].setStyle({x:m[0],y:m[1],text:a.formatValueText(this._dataInterval[f]),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,f=c.indicator;if(f){f.attr("invisible",!1);var h={convertOpacityToAlpha:!0},d=this.getControllerVisual(r,"color",h),v=this.getControllerVisual(r,"symbolSize"),m=Eo(r,s,u,!0),y=l[0]-v/2,x={x:f.x,y:f.y};f.y=m,f.x=y;var _=uo(c.indicatorLabelPoint,xu(f,this.group)),b=c.indicatorLabel;b.attr("invisible",!1);var S=this._applyTransform("left",c.mainGroup),T=this._orient,C=T==="horizontal";b.setStyle({text:(i||"")+o.formatValueText(n),verticalAlign:C?S:"middle",align:C?"center":S});var A={x:y,y:m,style:{fill:d}},P={style:{x:_[0],y:_[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var O={duration:100,easing:"cubicInOut",additive:!0};f.x=x.x,f.y=x.y,f.animateTo(A,O),b.animateTo(P,O)}else f.attr(A),b.attr(P);this._firstShowIndicator=!1;var k=this._shapes.handleLabels;if(k)for(var E=0;Eo[1]&&(f[1]=1/0),n&&(f[0]===-1/0?this._showIndicator(c,f[1],"< ",l):f[1]===1/0?this._showIndicator(c,f[0],"> ",l):this._showIndicator(c,c,"≈ ",l));var h=this._hoverLinkDataIndices,d=[];(n||FU(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(f));var v=DRe(h,d);this._dispatchHighDown("downplay",l1(v[0],i)),this._dispatchHighDown("highlight",l1(v[1],i))}},t.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(sf(r.target,function(l){var u=Be(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 oKe(e,t,r,n){for(var i=t.targetVisuals[n],a=on.prepareVisualTypes(i),o={color:Q0(e.getData(),"color")},s=0,l=a.length;s0:t.splitNumber>0)||t.calculable)?"continuous":"piecewise"}),e.registerAction(nKe,iKe),R(aKe,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(sKe))}function sae(e){e.registerComponentModel(Kqe),e.registerComponentView(tKe),oae(e)}var lKe=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=[],uKe[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=ke(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=le(this._pieceList,function(l){return l=ke(l),s!=="inRange"&&(l.visual=null),l}))})},t.prototype.completeVisualOption=function(){var r=this.option,n={},i=on.listVisualTypes(),a=this.isCategory();R(r.pieces,function(s){R(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),R(n,function(s,l){var u=!1;R(this.stateList,function(c){u=u||o(r,c,l)||o(r.target,c,l)},this),!u&&R(this.stateList,function(c){(r[c]||(r[c]={}))[l]=nae.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,R(a,function(l,u){var c=this.getSelectedMapKey(l);o.hasOwnProperty(c)||(o[c]=!0)},this),i.selectedMode==="single"){var s=!1;R(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=ke(r)},t.prototype.getValueState=function(r){var n=on.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=on.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,f){var h=a.getRepresentValue({interval:c});f||(f=a.getValueState(h));var d=r(h,f);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 R(s,function(c){var f=c.interval;f&&(f[0]>u&&o([u,f[0]],"outOfRange"),o(f.slice()),u=f[1])},this),{stops:n,outerColors:i}},t.type="visualMap.piecewise",t.defaultOption=Zu(HS.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}(HS),uKe={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 HU(e,t){var r=e.inverse;(e.orient==="vertical"?!r:r)&&t.reverse()}var cKe=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),f=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],s,c,o),R(l.viewPieceList,function(h){var d=h.piece,v=new Le;v.onclick=xe(this._onItemClick,this,d),this._enableHoverLink(v,h.indexInModelPieceList);var m=n.getRepresentValue(d);if(this._createItemSymbol(v,m,[0,0,s[0],s[1]],f),c){var y=this.visualMapModel.getValueState(m),x=a.get("align")||o;v.add(new lt({style:Dt(a,{x:x==="right"?-i:s[0]+i,y:s[1]/2,text:d.text,verticalAlign:a.get("verticalAlign")||"middle",align:x,opacity:Ae(a.get("opacity"),y==="outOfRange"?.5:1)}),silent:f}))}r.add(v)},this),u&&this._renderEndsText(r,u[1],s,c,o),yf(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:l1(s.findTargetDataIndices(n),s)})}},t.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return aae(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 Le,l=this.visualMapModel.textStyleModel;s.add(new lt({style:Dt(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=le(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=Lr(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=ke(i.selected),s=n.getSelectedMapKey(r);a==="single"||a===!0?(o[s]=!0,R(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}(iae);function lae(e){e.registerComponentModel(lKe),e.registerComponentView(cKe),oae(e)}function fKe(e){Ke(sae),Ke(lae)}var hKe=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:IQ(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}(),dKe=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 hKe(this);if(this._target=null,this.ecModel.eachSeries(function(i){g8(i,null)}),this.shouldShow()){var n=this.getTarget();g8(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:J.color.border,borderWidth:2},windowStyle:{borderWidth:1,color:J.color.neutral30,borderColor:J.color.neutral40,opacity:.3},z:10},t}(tt),vKe=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 sh),!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")||J.color.neutral00);var l=qr(r,i).refContainer,u=Zt(JQ(r,!0),l),c=s.lineWidth||0,f=this._contentRect=Bf(u.clone(),c/2,!0,!0),h=new Le;a.add(h),h.setClipPath(new Qe({shape:f.plain()}));var d=this._targetGroup=new Le;h.add(d);var v=u.plain();v.r=o.getShallow("borderRadius",!0),a.add(this._bgRect=new Qe({style:s,shape:v,silent:!1,cursor:"grab"}));var m=r.getModel("windowStyle"),y=m.getShallow("borderRadius",!0);h.add(this._windowRect=new Qe({shape:{x:0,y:0,width:0,height:0,r:y},style:m.getItemStyle(),silent:!1,cursor:"grab"})),this._dealRenderContent(),this._dealUpdateWindow(),ZU(r,this)},t.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),ZU(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=Zt({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=Oa([],r.targetTrans),i=so([],this._coordSys.transform,n);this._transThisToTarget=Oa([],i);var a=r.viewportRect;a?a=a.clone():a=new je(0,0,this._api.getWidth(),this._api.getHeight()),a.applyTransform(i);var o=this._windowRect,s=o.shape.r;o.setShape(Ie({r:s},a))}},t.prototype._resetRoamController=function(r){var n=this,i=this._api,a=this._roamController;if(a||(a=this._roamController=new oh(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",xe(this._onPan,this)).on("zoom",xe(this._onZoom,this))},t.prototype._onPan=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=xr([],[r.oldX,r.oldY],n),a=xr([],[r.oldX-r.dx,r.oldY-r.dy],n);this._api.dispatchAction(UU(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=xr([],[r.originX,r.originY],n);this._api.dispatchAction(UU(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}(Rt);function UU(e,t){var r=e.mainType==="series"?e.subType+"Roam":e.mainType+"Roam",n={type:r};return n[e.mainType+"Id"]=e.id,ie(n,t),n}function ZU(e,t){var r=zf(e);LC(t.group,r.z,r.zlevel)}function pKe(e){e.registerComponentModel(dKe),e.registerComponentView(vKe)}var gKe={label:{enabled:!0},decal:{show:!1}},YU=rt(),mKe={};function yKe(e,t){var r=e.getModel("aria");if(!r.get("enabled"))return;var n=ke(gKe);Xe(n.label,e.getLocaleModel().get("aria"),!1),Xe(r.option,n,!1),i(),a();function i(){var u=r.getModel("decal"),c=u.get("show");if(c){var f=Ce();e.eachSeries(function(h){if(!h.isColorBySeries()){var d=f.get(h.type);d||(d={},f.set(h.type,d)),YU(h).scope=d}}),e.eachRawSeries(function(h){if(e.isSeriesFiltered(h))return;if(Pe(h.enableAriaDecal)){h.enableAriaDecal();return}var d=h.getData();if(h.isColorBySeries()){var _=bI(h.ecModel,h.name,mKe,e.getSeriesCount()),b=d.getVisual("decal");d.setVisual("decal",S(b,_))}else{var v=h.getRawData(),m={},y=YU(h).scope;d.each(function(T){var C=d.getRawIndex(T);m[C]=T});var x=v.count();v.each(function(T){var C=m[T],A=v.getName(T)||T+"",P=bI(h.ecModel,A,y,x),O=d.getItemVisual(C,"decal");d.setItemVisual(C,"decal",S(O,P))})}function S(T,C){var A=T?ie(ie({},C),T):C;return A.dirty=!0,A}})}}function a(){var u=t.getZr().dom;if(u){var c=e.getLocaleModel().get("aria"),f=r.getModel("label");if(f.option=Ie(f.option,c),!!f.get("enabled")){if(u.setAttribute("role","img"),f.get("description")){u.setAttribute("aria-label",f.get("description"));return}var h=e.getSeriesCount(),d=f.get(["data","maxCount"])||10,v=f.get(["series","maxCount"])||10,m=Math.min(h,v),y;if(!(h<1)){var x=s();if(x){var _=f.get(["general","withTitle"]);y=o(_,{title:x})}else y=f.get(["general","withoutTitle"]);var b=[],S=h>1?f.get(["series","multiple","prefix"]):f.get(["series","single","prefix"]);y+=o(S,{seriesCount:h}),e.eachSeries(function(P,O){if(O1?f.get(["series","multiple",N]):f.get(["series","single",N]),k=o(k,{seriesId:P.seriesIndex,seriesName:P.get("name"),seriesType:l(P.subType)});var D=P.getData();if(D.count()>d){var z=f.get(["data","partialData"]);k+=o(z,{displayCnt:d})}else k+=f.get(["data","allData"]);for(var V=f.get(["data","separator","middle"]),F=f.get(["data","separator","end"]),$=f.get(["data","excludeDimensionId"]),B=[],H=0;H":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},bKe=function(){function e(t){var r=this._condVal=me(t)?new RegExp(t):rJ(t)?t:null;if(r==null){var n="";bt(n)}}return e.prototype.evaluate=function(t){var r=typeof t;return me(r)?this._condVal.test(t):ut(r)?this._condVal.test(t+""):!1},e}(),wKe=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),SKe=function(){function e(){}return e.prototype.evaluate=function(){for(var t=this.children,r=0;r2&&n.push(i),i=[D,z]}function c(D,z,V,F){wd(D,V)&&wd(z,F)||i.push(D,z,V,F,V,F)}function f(D,z,V,F,$,B){var H=Math.abs(z-D),U=Math.tan(H/4)*4/3,Z=zP:E2&&n.push(i),n}function RE(e,t,r,n,i,a,o,s,l,u){if(wd(e,r)&&wd(t,n)&&wd(i,o)&&wd(a,s)){l.push(o,s);return}var c=2/u,f=c*c,h=o-e,d=s-t,v=Math.sqrt(h*h+d*d);h/=v,d/=v;var m=r-e,y=n-t,x=i-o,_=a-s,b=m*m+y*y,S=x*x+_*_;if(b=0&&P=0){l.push(o,s);return}var O=[],k=[];ku(e,r,i,o,.5,O),ku(t,n,a,s,.5,k),RE(O[0],k[0],O[1],k[1],O[2],k[2],O[3],k[3],l,u),RE(O[4],k[4],O[5],k[5],O[6],k[6],O[7],k[7],l,u)}function RKe(e,t){var r=jE(e),n=[];t=t||1;for(var i=0;i0)for(var u=0;uMath.abs(u),f=cae([l,u],c?0:1,t),h=(c?s:u)/f.length,d=0;di,o=cae([n,i],a?0:1,t),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",f=e[s]/o.length,h=0;h1?null:new De(m*l+e,m*u+t)}function $Ke(e,t,r){var n=new De;De.sub(n,r,t),n.normalize();var i=new De;De.sub(i,e,t);var a=i.dot(n);return a}function Zh(e,t){var r=e[e.length-1];r&&r[0]===t[0]&&r[1]===t[1]||e.push(t)}function FKe(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),FKe(t,u,c)}function US(e,t,r,n){if(r===1)n.push(t);else{var i=Math.floor(r/2),a=e(t);US(e,a[0],i,n),US(e,a[1],r-i,n)}return n}function VKe(e,t){for(var r=[],n=0;n0;u/=2){var c=0,f=0;(e&u)>0&&(c=1),(t&u)>0&&(f=1),s+=u*u*(3*c^f),f===0&&(c===1&&(e=u-1-e,t=u-1-t),l=e,e=t,t=l)}return s}function XS(e){var t=1/0,r=1/0,n=-1/0,i=-1/0,a=le(e,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),f=l.y+l.height/2+(u?u[5]:0);return t=Math.min(c,t),r=Math.min(f,r),n=Math.max(c,n),i=Math.max(f,i),[c,f]}),o=le(a,function(s,l){return{cp:s,z:KKe(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 dae(e){return HKe(e.path,e.count)}function BE(){return{fromIndividuals:[],toIndividuals:[],count:0}}function JKe(e,t,r){var n=[];function i(T){for(var C=0;C=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 eJe={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;n7(e)&&(u=e,c=t),n7(t)&&(u=t,c=e);function f(x,_,b,S,T){var C=x.many,A=x.one;if(C.length===1&&!T){var P=_?C[0]:A,O=_?A:C[0];if(ZS(P))f({many:[P],one:O},!0,b,S,!0);else{var k=s?Ie({delay:s(b,S)},l):l;k3(P,O,k),a(P,O,P,O,k)}}else for(var E=Ie({dividePath:eJe[r],individualDelay:s&&function($,B,H,U){return s($+b,S)}},l),N=_?JKe(C,A,E):QKe(A,C,E),D=N.fromIndividuals,z=N.toIndividuals,V=D.length,F=0;Ft.length,d=u?i7(c,u):i7(h?t:e,[h?e:t]),v=0,m=0;mvae))for(var a=n.getIndices(),o=0;o0&&C.group.traverse(function(P){P instanceof at&&!P.animators.length&&P.animateFrom({style:{opacity:0}},A)})})}function u7(e){var t=e.getModel("universalTransition").get("seriesKey");return t||e.id}function c7(e){return oe(e)?e.sort().join(","):e}function Gl(e){if(e.hostModel)return e.hostModel.getModel("universalTransition").get("divideShape")}function sJe(e,t){var r=Ce(),n=Ce(),i=Ce();return R(e.oldSeries,function(a,o){var s=e.oldDataGroupIds[o],l=e.oldData[o],u=u7(a),c=c7(u);n.set(c,{dataGroupId:s,data:l}),oe(u)&&R(u,function(f){i.set(f,{key:c,dataGroupId:s,data:l})})}),R(t.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=u7(a),u=c7(l),c=n.get(u);if(c)r.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:Gl(c.data),data:c.data}],newSeries:[{dataGroupId:o,divide:Gl(s),data:s}]});else if(oe(l)){var f=[];R(l,function(v){var m=n.get(v);m.data&&f.push({dataGroupId:m.dataGroupId,divide:Gl(m.data),data:m.data})}),f.length&&r.set(u,{oldSeries:f,newSeries:[{dataGroupId:o,data:s,divide:Gl(s)}]})}else{var h=i.get(l);if(h){var d=r.get(h.key);d||(d={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:Gl(h.data)}],newSeries:[]},r.set(h.key,d)),d.newSeries.push({dataGroupId:o,data:s,divide:Gl(s)})}}}}),r}function f7(e,t){for(var r=0;r=0&&i.push({dataGroupId:t.oldDataGroupIds[s],data:t.oldData[s],divide:Gl(t.oldData[s]),groupIdDim:o.dimension})}),R(jt(e.to),function(o){var s=f7(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:t.oldDataGroupIds[s],data:l,divide:Gl(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&pae(i,a,n)}function uJe(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){R(jt(n.seriesTransition),function(i){R(jt(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=h7,n=d7,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 fJe(){return new cJe}var h7=0,d7=0;function hJe(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()}};R(e.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=L3(s,t);if(u){var c=u.vmin!==s.vmin,f=u.vmax!==s.vmax,h=u.vmax-u.vmin;if(!(c&&f))if(c||f){var d=c?"S":"E";a[d][l.type].has=!0,a[d][l.type].span=h,a[d][l.type].inExtFrac=h/(s.vmax-s.vmin),a[d][l.type].val=l.val}else n[l.type].span+=h,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));R(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 dJe(e,t,r,n,i,a){e!=="no"&&R(r,function(o){var s=L3(o,a);if(s)for(var l=t.length-1;l>=0;l--){var u=t[l],c=n(u),f=i*3/4;c>s.vmin-f&&ct[0]&&r=0&&o<1-1e-5}R(e,function(o){if(!(!o||o.start==null||o.end==null)&&!o.isExpanded){var s={breakOption:ke(o),vmin:t(o.start),vmax:t(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if(me(o.gap)){var u=Fi(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 f=t(o.gap);(!isFinite(f)||f<0)&&(f=0),s.gapParsed.type="tpAbs",s.gapParsed.val=f}}if(s.vmin===s.vmax&&(s.gapParsed.type="tpAbs",s.gapParsed.val=0),r&&r.noNegative&&R(["vmin","vmax"],function(d){s[d]<0&&(s[d]=0)}),s.vmin>s.vmax){var h=s.vmax;s.vmax=s.vmin,s.vmin=h}n.push(s)}}),n.sort(function(o,s){return o.vmin-s.vmin});var a=-1/0;return R(n,function(o,s){a>o.vmin&&(n[s]=null),a=o.vmax}),{breaks:n.filter(function(o){return!!o})}}function O3(e,t){return $E(t)===$E(e)}function $E(e){return e.start+"_\0_"+e.end}function pJe(e,t,r){var n=[];R(e,function(a,o){var s=t(a);s&&s.type==="vmin"&&n.push([o])}),R(e,function(a,o){var s=t(a);if(s&&s.type==="vmax"){var l=Wu(n,function(u){return O3(t(e[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return R(n,function(a){a.length===2&&i.push(r?a:[e[a[0]],e[a[1]]])}),i}function gJe(e,t,r,n){var i,a;if(e.break){var o=e.break.parsedBreak,s=Wu(r,function(f){return O3(f.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"?Mr(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 mJe(e,t,r){var n={noNegative:!0},i=zE(e,r,n),a=zE(e,r,n),o=Math.log(t);return a.breaks=le(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 yJe={vmin:"start",vmax:"end"};function xJe(e,t){return t&&(e=e||{},e.break={type:yJe[t.type],start:t.parsedBreak.vmin,end:t.parsedBreak.vmax}),e}function _Je(){V5e({createScaleBreakContext:fJe,pruneTicksByBreak:dJe,addBreaksToTicks:vJe,parseAxisBreakOption:zE,identifyAxisBreak:O3,serializeAxisBreakIdentifier:$E,retrieveAxisBreakPairs:pJe,getTicksLogTransformBreak:gJe,logarithmicParseBreaksFromOption:mJe,makeAxisLabelFormatterParamBreak:xJe})}var v7=rt();function bJe(e,t){var r=Wu(e,function(n){return Rr().identifyAxisBreak(n.parsedBreak.breakOption,t.breakOption)});return r||e.push(r={zigzagRandomList:[],parsedBreak:t,shouldRemove:!1}),r}function wJe(e){R(e,function(t){return t.shouldRemove=!0})}function SJe(e){for(var t=e.length-1;t>=0;t--)e[t].shouldRemove&&e.splice(t,1)}function TJe(e,t,r,n,i){var a=r.axis;if(a.scale.isBlank()||!Rr())return;var o=Rr().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(O){return O.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 f=s.get("expandOnClick"),h=s.get("zigzagZ"),d=s.getModel("itemStyle"),v=d.getItemStyle(),m=v.stroke,y=v.lineWidth,x=v.lineDash,_=v.fill,b=new Le({ignoreModelZ:!0}),S=a.isHorizontal(),T=v7(t).visualList||(v7(t).visualList=[]);wJe(T);for(var C=function(O){var k=o[O][0].break.parsedBreak,E=[];E[0]=a.toGlobalCoord(a.dataToCoord(k.vmin,!0)),E[1]=a.toGlobalCoord(a.dataToCoord(k.vmax,!0)),E[1]=B;de&&(K=B);var Oe=[],ye=[];Oe[F]=E,ye[F]=N,!ce&&!de&&(Oe[F]+=Y?-l:l,ye[F]-=Y?l:-l),Oe[$]=K,ye[$]=K,U.push(Oe),Z.push(ye);var ne=void 0;if(te_[1]&&_.reverse(),{coordPair:_,brkId:Rr().serializeAxisBreakIdentifier(x.breakOption)}});l.sort(function(y,x){return y.coordPair[0]-x.coordPair[0]});for(var u=o[0],c=null,f=0;f=0?l[0].width:l[1].width),h=(f+c.x)/2-u.x,d=Math.min(h,h-c.x),v=Math.max(h,h-c.x),m=v<0?v:d>0?d:0;s=(h-m)/c.x}var y=new De,x=new De;De.scale(y,n,-s),De.scale(x,n,1-s),FI(r[0],y),FI(r[1],x)}function MJe(e,t){var r={breaks:[]};return R(t.breaks,function(n){if(n){var i=Wu(e.get("breaks",!0),function(s){return Rr().identifyAxisBreak(s,n)});if(i){var a=t.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===FC?!0:a===jre?!1:a===Rre?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),r}function PJe(){S6e({adjustBreakLabelPair:AJe,buildAxisBreakLine:CJe,rectCoordBuildBreakAxis:TJe,updateModelAxisBreak:MJe})}function kJe(e){k6e(e),_Je(),PJe()}function LJe(){q6e(OJe)}function OJe(e,t){R(e,function(r){if(!r.model.get(["axisLabel","inside"])){var n=IJe(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 IJe(e){var t=e.model,r=e.scale;if(!t.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof Mv?i=r.count():(n=r.getTicks(),i=n.length);var o=e.getLabelModel(),s=bp(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 XJe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function qJe(e){return e==="ROUTER"||e==="ROUTER_LATE"?30:e==="REPEATER"||e==="TRACKER"?25:e==="CLIENT_MUTE"?7:e==="CLIENT_BASE"?12:15}function KJe({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=>m7.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]),f=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]),h=G.useMemo(()=>{const y=l.map(_=>{const b=XJe(_.latitude),S=g7[b%g7.length],T=m7.includes(_.role),C=_.node_num===r,A=f.has(_.node_num),P=r===null||C||A;return{id:String(_.node_num),name:_.short_name,value:_.node_num,symbolSize:qJe(_.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 b=r===null||_.from_node===r||_.to_node===r;return{source:String(_.from_node),target:String(_.to_node),value:_.snr,lineStyle:{color:YJe(_.snr),width:b&&r!==null?2:1,opacity:r===null?.4:b?.6:.04}}});return{nodes:y,links:x}},[l,c,r,f]),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:h.nodes,links:h.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"]}]}),[h]),v=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:v}),[v]);return G.useEffect(()=>{var x;const y=(x=i.current)==null?void 0:x.getEchartsInstance();y&&y.setOption(d,{notMerge:!1,lazyUpdate:!0})},[d]),p.jsxs("div",{className:"relative bg-bg-card rounded-lg border border-border overflow-hidden",children:[p.jsx(ZJe,{ref:i,option:d,style:{height:"540px",width:"100%"},onEvents:m,opts:{renderer:"canvas"}}),p.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:[p.jsx(WN,{size:14,className:"text-slate-500"}),p.jsx("div",{className:"flex gap-1",children:[{key:"connected",label:"Connected"},{key:"infra",label:"Infra"},{key:"all",label:"All"}].map(({key:y,label:x})=>p.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))}),p.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[l.length," nodes • ",c.length," edges"]})]}),p.jsxs("div",{className:"absolute bottom-4 left-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[p.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Edge Quality (SNR)"}),p.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=>p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-4 h-0.5",style:{backgroundColor:y.color}}),p.jsx("span",{className:"text-xs text-slate-500",children:y.label})]},y.label))})]}),p.jsxs("div",{className:"absolute bottom-4 right-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[p.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Node Type"}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-500"}),p.jsx("span",{className:"text-xs text-slate-500",children:"Infrastructure"})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-900 border-2 border-blue-500"}),p.jsx("span",{className:"text-xs text-slate-500",children:"Client"})]})]})]})]})}function yae(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 JJe(e,t,r){t.center!==r.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==r.radius&&e.setRadius(t.radius)}const QJe=1;function eQe(e){return Object.freeze({__version:QJe,map:e})}function xae(e,t){return Object.freeze({...e,...t})}const _ae=G.createContext(null),bae=_ae.Provider;function QC(){const e=G.useContext(_ae);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function tQe(e){function t(r,n){const{instance:i,context:a}=e(r).current;return G.useImperativeHandle(n,()=>i),r.children==null?null:Q.createElement(bae,{value:a},r.children)}return G.forwardRef(t)}function rQe(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?VZ.createPortal(r.children,s):null}return G.forwardRef(t)}function nQe(e){function t(r,n){const{instance:i}=e(r).current;return G.useImperativeHandle(n,()=>i),null}return G.forwardRef(t)}function D3(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 eA(e,t){const r=e.pane??t.pane;return r?{...e,pane:r}:e}function iQe(e,t){return function(n,i){const a=QC(),o=e(eA(n,a),a);return yae(a.map,n.attribution),D3(o.current,n.eventHandlers),t(o.current,a,n,i),o}}var GE={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)})(Wg,function(r){var n="1.9.4";function i(g){var w,M,I,j;for(M=1,I=arguments.length;M"u"||!L||!L.Mixin)){g=b(g)?g:[g];for(var w=0;w0?Math.floor(g):Math.ceil(g)};B.prototype={clone:function(){return new B(this.x,this.y)},add:function(g){return this.clone()._add(U(g))},_add:function(g){return this.x+=g.x,this.y+=g.y,this},subtract:function(g){return this.clone()._subtract(U(g))},_subtract:function(g){return this.x-=g.x,this.y-=g.y,this},divideBy:function(g){return this.clone()._divideBy(g)},_divideBy:function(g){return this.x/=g,this.y/=g,this},multiplyBy:function(g){return this.clone()._multiplyBy(g)},_multiplyBy:function(g){return this.x*=g,this.y*=g,this},scaleBy:function(g){return new B(this.x*g.x,this.y*g.y)},unscaleBy:function(g){return new B(this.x/g.x,this.y/g.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=H(this.x),this.y=H(this.y),this},distanceTo:function(g){g=U(g);var w=g.x-this.x,M=g.y-this.y;return Math.sqrt(w*w+M*M)},equals:function(g){return g=U(g),g.x===this.x&&g.y===this.y},contains:function(g){return g=U(g),Math.abs(g.x)<=Math.abs(this.x)&&Math.abs(g.y)<=Math.abs(this.y)},toString:function(){return"Point("+h(this.x)+", "+h(this.y)+")"}};function U(g,w,M){return g instanceof B?g:b(g)?new B(g[0],g[1]):g==null?g:typeof g=="object"&&"x"in g&&"y"in g?new B(g.x,g.y):new B(g,w,M)}function Z(g,w){if(g)for(var M=w?[g,w]:g,I=0,j=M.length;I=this.min.x&&M.x<=this.max.x&&w.y>=this.min.y&&M.y<=this.max.y},intersects:function(g){g=Y(g);var w=this.min,M=this.max,I=g.min,j=g.max,W=j.x>=w.x&&I.x<=M.x,X=j.y>=w.y&&I.y<=M.y;return W&&X},overlaps:function(g){g=Y(g);var w=this.min,M=this.max,I=g.min,j=g.max,W=j.x>w.x&&I.xw.y&&I.y=w.lat&&j.lat<=M.lat&&I.lng>=w.lng&&j.lng<=M.lng},intersects:function(g){g=te(g);var w=this._southWest,M=this._northEast,I=g.getSouthWest(),j=g.getNorthEast(),W=j.lat>=w.lat&&I.lat<=M.lat,X=j.lng>=w.lng&&I.lng<=M.lng;return W&&X},overlaps:function(g){g=te(g);var w=this._southWest,M=this._northEast,I=g.getSouthWest(),j=g.getNorthEast(),W=j.lat>w.lat&&I.latw.lng&&I.lng1,Qu=function(){var g=!1;try{var w=Object.defineProperty({},"passive",{get:function(){g=!0}});window.addEventListener("testPassiveEventSupport",f,w),window.removeEventListener("testPassiveEventSupport",f,w)}catch{}return g}(),ae=function(){return!!document.createElement("canvas").getContext}(),kt=!!(document.createElementNS&&Ve("svg").createSVGRect),Tt=!!kt&&function(){var g=document.createElement("div");return g.innerHTML="",(g.firstChild&&g.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),wt=!kt&&function(){try{var g=document.createElement("div");g.innerHTML='';var w=g.firstChild;return w.style.behavior="url(#default#VML)",w&&typeof w.adj=="object"}catch{return!1}}(),Ir=navigator.platform.indexOf("Mac")===0,ms=navigator.platform.indexOf("Linux")===0;function Bn(g){return navigator.userAgent.toLowerCase().indexOf(g)>=0}var He={ie:Bt,ielt9:Kt,edge:cn,webkit:Or,android:wn,android23:ps,androidStock:Ku,opera:uh,chrome:lx,gecko:Jt,safari:tA,phantom:ux,opera12:cx,win:Je,ie3d:fx,webkit3d:Ap,gecko3d:gs,any3d:Rn,mobile:Ju,mobileWebkit:hx,mobileWebkit3d:dx,msPointer:Mp,pointer:Pp,touch:dr,touchNative:Te,mobileOpera:ki,mobileGecko:Qi,retina:za,passiveEvents:Qu,canvas:ae,svg:kt,vml:wt,inlineSvg:Tt,mac:Ir,linux:ms},kp=He.msPointer?"MSPointerDown":"pointerdown",Lp=He.msPointer?"MSPointerMove":"pointermove",Op=He.msPointer?"MSPointerUp":"pointerup",Ip=He.msPointer?"MSPointerCancel":"pointercancel",ch={touchstart:kp,touchmove:Lp,touchend:Op,touchcancel:Ip},Ep={touchstart:Lae,touchmove:gx,touchend:gx,touchcancel:gx},ys={},Np=!1;function vx(g,w,M){return w==="touchstart"&&ar(),Ep[w]?(M=Ep[w].bind(this,M),g.addEventListener(ch[w],M,!1),M):(console.warn("wrong event specified:",w),f)}function Dp(g,w,M){if(!ch[w]){console.warn("wrong event specified:",w);return}g.removeEventListener(ch[w],M,!1)}function px(g){ys[g.pointerId]=g}function ir(g){ys[g.pointerId]&&(ys[g.pointerId]=g)}function It(g){delete ys[g.pointerId]}function ar(){Np||(document.addEventListener(kp,px,!0),document.addEventListener(Lp,ir,!0),document.addEventListener(Op,It,!0),document.addEventListener(Ip,It,!0),Np=!0)}function gx(g,w){if(w.pointerType!==(w.MSPOINTER_TYPE_MOUSE||"mouse")){w.touches=[];for(var M in ys)w.touches.push(ys[M]);w.changedTouches=[w],g(w)}}function Lae(g,w){w.MSPOINTER_TYPE_TOUCH&&w.pointerType===w.MSPOINTER_TYPE_TOUCH&&Sn(w),gx(g,w)}function Oae(g){var w={},M,I;for(I in g)M=g[I],w[I]=M&&M.bind?M.bind(g):M;return g=w,w.type="dblclick",w.detail=2,w.isTrusted=!1,w._simulated=!0,w}var Iae=200;function Eae(g,w){g.addEventListener("dblclick",w);var M=0,I;function j(W){if(W.detail!==1){I=W.detail;return}if(!(W.pointerType==="mouse"||W.sourceCapabilities&&!W.sourceCapabilities.firesTouchEvents)){var X=G3(W);if(!(X.some(function(se){return se instanceof HTMLLabelElement&&se.attributes.for})&&!X.some(function(se){return se instanceof HTMLInputElement||se instanceof HTMLSelectElement}))){var re=Date.now();re-M<=Iae?(I++,I===2&&w(Oae(W))):I=1,M=re}}}return g.addEventListener("click",j),{dblclick:w,simDblclick:j}}function Nae(g,w){g.removeEventListener("dblclick",w.dblclick),g.removeEventListener("click",w.simDblclick)}var rA=xx(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),jp=xx(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),z3=jp==="webkitTransition"||jp==="OTransition"?jp+"End":"transitionend";function $3(g){return typeof g=="string"?document.getElementById(g):g}function Rp(g,w){var M=g.style[w]||g.currentStyle&&g.currentStyle[w];if((!M||M==="auto")&&document.defaultView){var I=document.defaultView.getComputedStyle(g,null);M=I?I[w]:null}return M==="auto"?null:M}function Et(g,w,M){var I=document.createElement(g);return I.className=w||"",M&&M.appendChild(I),I}function vr(g){var w=g.parentNode;w&&w.removeChild(g)}function mx(g){for(;g.firstChild;)g.removeChild(g.firstChild)}function fh(g){var w=g.parentNode;w&&w.lastChild!==g&&w.appendChild(g)}function hh(g){var w=g.parentNode;w&&w.firstChild!==g&&w.insertBefore(g,w.firstChild)}function nA(g,w){if(g.classList!==void 0)return g.classList.contains(w);var M=yx(g);return M.length>0&&new RegExp("(^|\\s)"+w+"(\\s|$)").test(M)}function dt(g,w){if(g.classList!==void 0)for(var M=v(w),I=0,j=M.length;I0?2*window.devicePixelRatio:1;function H3(g){return He.edge?g.wheelDeltaY/2:g.deltaY&&g.deltaMode===0?-g.deltaY/Rae:g.deltaY&&g.deltaMode===1?-g.deltaY*20:g.deltaY&&g.deltaMode===2?-g.deltaY*60:g.deltaX||g.deltaZ?0:g.wheelDelta?(g.wheelDeltaY||g.wheelDelta)/2:g.detail&&Math.abs(g.detail)<32765?-g.detail*20:g.detail?g.detail/-32765*60:0}function pA(g,w){var M=w.relatedTarget;if(!M)return!0;try{for(;M&&M!==g;)M=M.parentNode}catch{return!1}return M!==g}var Bae={__proto__:null,on:ct,off:Qt,stopPropagation:rc,disableScrollPropagation:vA,disableClickPropagation:Fp,preventDefault:Sn,stop:nc,getPropagationPath:G3,getMousePosition:W3,getWheelDelta:H3,isExternalTarget:pA,addListener:ct,removeListener:Qt},U3=$.extend({run:function(g,w,M,I){this.stop(),this._el=g,this._inProgress=!0,this._duration=M||.25,this._easeOutPower=1/Math.max(I||.5,.2),this._startPos=tc(g),this._offset=w.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=E(this._animate,this),this._step()},_step:function(g){var w=+new Date-this._startTime,M=this._duration*1e3;wthis.options.maxZoom)?this.setZoom(g):this},panInsideBounds:function(g,w){this._enforcingBounds=!0;var M=this.getCenter(),I=this._limitCenter(M,this._zoom,te(g));return M.equals(I)||this.panTo(I,w),this._enforcingBounds=!1,this},panInside:function(g,w){w=w||{};var M=U(w.paddingTopLeft||w.padding||[0,0]),I=U(w.paddingBottomRight||w.padding||[0,0]),j=this.project(this.getCenter()),W=this.project(g),X=this.getPixelBounds(),re=Y([X.min.add(M),X.max.subtract(I)]),se=re.getSize();if(!re.contains(W)){this._enforcingBounds=!0;var pe=W.subtract(re.getCenter()),Re=re.extend(W).getSize().subtract(se);j.x+=pe.x<0?-Re.x:Re.x,j.y+=pe.y<0?-Re.y:Re.y,this.panTo(this.unproject(j),w),this._enforcingBounds=!1}return this},invalidateSize:function(g){if(!this._loaded)return this;g=i({animate:!1,pan:!0},g===!0?{animate:!0}:g);var w=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var M=this.getSize(),I=w.divideBy(2).round(),j=M.divideBy(2).round(),W=I.subtract(j);return!W.x&&!W.y?this:(g.animate&&g.pan?this.panBy(W):(g.pan&&this._rawPanBy(W),this.fire("move"),g.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:w,newSize:M}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(g){if(g=this._locateOptions=i({timeout:1e4,watch:!1},g),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var w=o(this._handleGeolocationResponse,this),M=o(this._handleGeolocationError,this);return g.watch?this._locationWatchId=navigator.geolocation.watchPosition(w,M,g):navigator.geolocation.getCurrentPosition(w,M,g),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(g){if(this._container._leaflet_id){var w=g.code,M=g.message||(w===1?"permission denied":w===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:w,message:"Geolocation error: "+M+"."})}},_handleGeolocationResponse:function(g){if(this._container._leaflet_id){var w=g.coords.latitude,M=g.coords.longitude,I=new ce(w,M),j=I.toBounds(g.coords.accuracy*2),W=this._locateOptions;if(W.setView){var X=this.getBoundsZoom(j);this.setView(I,W.maxZoom?Math.min(X,W.maxZoom):X)}var re={latlng:I,bounds:j,timestamp:g.timestamp};for(var se in g.coords)typeof g.coords[se]=="number"&&(re[se]=g.coords[se]);this.fire("locationfound",re)}},addHandler:function(g,w){if(!w)return this;var M=this[g]=new w(this);return this._handlers.push(M),this.options[g]&&M.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(),vr(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(N(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var g;for(g in this._layers)this._layers[g].remove();for(g in this._panes)vr(this._panes[g]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(g,w){var M="leaflet-pane"+(g?" leaflet-"+g.replace("Pane","")+"-pane":""),I=Et("div",M,w||this._mapPane);return g&&(this._panes[g]=I),I},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var g=this.getPixelBounds(),w=this.unproject(g.getBottomLeft()),M=this.unproject(g.getTopRight());return new K(w,M)},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(g,w,M){g=te(g),M=U(M||[0,0]);var I=this.getZoom()||0,j=this.getMinZoom(),W=this.getMaxZoom(),X=g.getNorthWest(),re=g.getSouthEast(),se=this.getSize().subtract(M),pe=Y(this.project(re,I),this.project(X,I)).getSize(),Re=He.any3d?this.options.zoomSnap:1,nt=se.x/pe.x,yt=se.y/pe.y,Jn=w?Math.max(nt,yt):Math.min(nt,yt);return I=this.getScaleZoom(Jn,I),Re&&(I=Math.round(I/(Re/100))*(Re/100),I=w?Math.ceil(I/Re)*Re:Math.floor(I/Re)*Re),Math.max(j,Math.min(W,I))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new B(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(g,w){var M=this._getTopLeftPoint(g,w);return new Z(M,M.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(g){return this.options.crs.getProjectedBounds(g===void 0?this.getZoom():g)},getPane:function(g){return typeof g=="string"?this._panes[g]:g},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(g,w){var M=this.options.crs;return w=w===void 0?this._zoom:w,M.scale(g)/M.scale(w)},getScaleZoom:function(g,w){var M=this.options.crs;w=w===void 0?this._zoom:w;var I=M.zoom(g*M.scale(w));return isNaN(I)?1/0:I},project:function(g,w){return w=w===void 0?this._zoom:w,this.options.crs.latLngToPoint(de(g),w)},unproject:function(g,w){return w=w===void 0?this._zoom:w,this.options.crs.pointToLatLng(U(g),w)},layerPointToLatLng:function(g){var w=U(g).add(this.getPixelOrigin());return this.unproject(w)},latLngToLayerPoint:function(g){var w=this.project(de(g))._round();return w._subtract(this.getPixelOrigin())},wrapLatLng:function(g){return this.options.crs.wrapLatLng(de(g))},wrapLatLngBounds:function(g){return this.options.crs.wrapLatLngBounds(te(g))},distance:function(g,w){return this.options.crs.distance(de(g),de(w))},containerPointToLayerPoint:function(g){return U(g).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(g){return U(g).add(this._getMapPanePos())},containerPointToLatLng:function(g){var w=this.containerPointToLayerPoint(U(g));return this.layerPointToLatLng(w)},latLngToContainerPoint:function(g){return this.layerPointToContainerPoint(this.latLngToLayerPoint(de(g)))},mouseEventToContainerPoint:function(g){return W3(g,this._container)},mouseEventToLayerPoint:function(g){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(g))},mouseEventToLatLng:function(g){return this.layerPointToLatLng(this.mouseEventToLayerPoint(g))},_initContainer:function(g){var w=this._container=$3(g);if(w){if(w._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");ct(w,"scroll",this._onScroll,this),this._containerId=l(w)},_initLayout:function(){var g=this._container;this._fadeAnimated=this.options.fadeAnimation&&He.any3d,dt(g,"leaflet-container"+(He.touch?" leaflet-touch":"")+(He.retina?" leaflet-retina":"")+(He.ielt9?" leaflet-oldie":"")+(He.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var w=Rp(g,"position");w!=="absolute"&&w!=="relative"&&w!=="fixed"&&w!=="sticky"&&(g.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var g=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),$r(this._mapPane,new B(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(dt(g.markerPane,"leaflet-zoom-hide"),dt(g.shadowPane,"leaflet-zoom-hide"))},_resetView:function(g,w,M){$r(this._mapPane,new B(0,0));var I=!this._loaded;this._loaded=!0,w=this._limitZoom(w),this.fire("viewprereset");var j=this._zoom!==w;this._moveStart(j,M)._move(g,w)._moveEnd(j),this.fire("viewreset"),I&&this.fire("load")},_moveStart:function(g,w){return g&&this.fire("zoomstart"),w||this.fire("movestart"),this},_move:function(g,w,M,I){w===void 0&&(w=this._zoom);var j=this._zoom!==w;return this._zoom=w,this._lastCenter=g,this._pixelOrigin=this._getNewPixelOrigin(g),I?M&&M.pinch&&this.fire("zoom",M):((j||M&&M.pinch)&&this.fire("zoom",M),this.fire("move",M)),this},_moveEnd:function(g){return g&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return N(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(g){$r(this._mapPane,this._getMapPanePos().subtract(g))},_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(g){this._targets={},this._targets[l(this._container)]=this;var w=g?Qt:ct;w(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&w(window,"resize",this._onResize,this),He.any3d&&this.options.transform3DLimit&&(g?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){N(this._resizeRequest),this._resizeRequest=E(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var g=this._getMapPanePos();Math.max(Math.abs(g.x),Math.abs(g.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(g,w){for(var M=[],I,j=w==="mouseout"||w==="mouseover",W=g.target||g.srcElement,X=!1;W;){if(I=this._targets[l(W)],I&&(w==="click"||w==="preclick")&&this._draggableMoved(I)){X=!0;break}if(I&&I.listens(w,!0)&&(j&&!pA(W,g)||(M.push(I),j))||W===this._container)break;W=W.parentNode}return!M.length&&!X&&!j&&this.listens(w,!0)&&(M=[this]),M},_isClickDisabled:function(g){for(;g&&g!==this._container;){if(g._leaflet_disable_click)return!0;g=g.parentNode}},_handleDOMEvent:function(g){var w=g.target||g.srcElement;if(!(!this._loaded||w._leaflet_disable_events||g.type==="click"&&this._isClickDisabled(w))){var M=g.type;M==="mousedown"&&uA(w),this._fireDOMEvent(g,M)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(g,w,M){if(g.type==="click"){var I=i({},g);I.type="preclick",this._fireDOMEvent(I,I.type,M)}var j=this._findEventTargets(g,w);if(M){for(var W=[],X=0;X0?Math.round(g-w)/2:Math.max(0,Math.ceil(g))-Math.max(0,Math.floor(w))},_limitZoom:function(g){var w=this.getMinZoom(),M=this.getMaxZoom(),I=He.any3d?this.options.zoomSnap:1;return I&&(g=Math.round(g/I)*I),Math.max(w,Math.min(M,g))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Er(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(g,w){var M=this._getCenterOffset(g)._trunc();return(w&&w.animate)!==!0&&!this.getSize().contains(M)?!1:(this.panBy(M,w),!0)},_createAnimProxy:function(){var g=this._proxy=Et("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(g),this.on("zoomanim",function(w){var M=rA,I=this._proxy.style[M];ec(this._proxy,this.project(w.center,w.zoom),this.getZoomScale(w.zoom,1)),I===this._proxy.style[M]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){vr(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var g=this.getCenter(),w=this.getZoom();ec(this._proxy,this.project(g,w),this.getZoomScale(w,1))},_catchTransitionEnd:function(g){this._animatingZoom&&g.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(g,w,M){if(this._animatingZoom)return!0;if(M=M||{},!this._zoomAnimated||M.animate===!1||this._nothingToAnimate()||Math.abs(w-this._zoom)>this.options.zoomAnimationThreshold)return!1;var I=this.getZoomScale(w),j=this._getCenterOffset(g)._divideBy(1-1/I);return M.animate!==!0&&!this.getSize().contains(j)?!1:(E(function(){this._moveStart(!0,M.noMoveStart||!1)._animateZoom(g,w,!0)},this),!0)},_animateZoom:function(g,w,M,I){this._mapPane&&(M&&(this._animatingZoom=!0,this._animateToCenter=g,this._animateToZoom=w,dt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:g,zoom:w,noUpdate:I}),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&&Er(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 zae(g,w){return new Mt(g,w)}var $a=z.extend({options:{position:"topright"},initialize:function(g){m(this,g)},getPosition:function(){return this.options.position},setPosition:function(g){var w=this._map;return w&&w.removeControl(this),this.options.position=g,w&&w.addControl(this),this},getContainer:function(){return this._container},addTo:function(g){this.remove(),this._map=g;var w=this._container=this.onAdd(g),M=this.getPosition(),I=g._controlCorners[M];return dt(w,"leaflet-control"),M.indexOf("bottom")!==-1?I.insertBefore(w,I.firstChild):I.appendChild(w),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(vr(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(g){this._map&&g&&g.screenX>0&&g.screenY>0&&this._map.getContainer().focus()}}),Vp=function(g){return new $a(g)};Mt.include({addControl:function(g){return g.addTo(this),this},removeControl:function(g){return g.remove(),this},_initControlPos:function(){var g=this._controlCorners={},w="leaflet-",M=this._controlContainer=Et("div",w+"control-container",this._container);function I(j,W){var X=w+j+" "+w+W;g[j+W]=Et("div",X,M)}I("top","left"),I("top","right"),I("bottom","left"),I("bottom","right")},_clearControlPos:function(){for(var g in this._controlCorners)vr(this._controlCorners[g]);vr(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Z3=$a.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(g,w,M,I){return M1,this._baseLayersList.style.display=g?"":"none"),this._separator.style.display=w&&g?"":"none",this},_onLayerChange:function(g){this._handlingClick||this._update();var w=this._getLayer(l(g.target)),M=w.overlay?g.type==="add"?"overlayadd":"overlayremove":g.type==="add"?"baselayerchange":null;M&&this._map.fire(M,w)},_createRadioElement:function(g,w){var M='",I=document.createElement("div");return I.innerHTML=M,I.firstChild},_addItem:function(g){var w=document.createElement("label"),M=this._map.hasLayer(g.layer),I;g.overlay?(I=document.createElement("input"),I.type="checkbox",I.className="leaflet-control-layers-selector",I.defaultChecked=M):I=this._createRadioElement("leaflet-base-layers_"+l(this),M),this._layerControlInputs.push(I),I.layerId=l(g.layer),ct(I,"click",this._onInputClick,this);var j=document.createElement("span");j.innerHTML=" "+g.name;var W=document.createElement("span");w.appendChild(W),W.appendChild(I),W.appendChild(j);var X=g.overlay?this._overlaysList:this._baseLayersList;return X.appendChild(w),this._checkDisabledLayers(),w},_onInputClick:function(){if(!this._preventClick){var g=this._layerControlInputs,w,M,I=[],j=[];this._handlingClick=!0;for(var W=g.length-1;W>=0;W--)w=g[W],M=this._getLayer(w.layerId).layer,w.checked?I.push(M):w.checked||j.push(M);for(W=0;W=0;j--)w=g[j],M=this._getLayer(w.layerId).layer,w.disabled=M.options.minZoom!==void 0&&IM.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var g=this._section;this._preventClick=!0,ct(g,"click",Sn),this.expand();var w=this;setTimeout(function(){Qt(g,"click",Sn),w._preventClick=!1})}}),$ae=function(g,w,M){return new Z3(g,w,M)},gA=$a.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(g){var w="leaflet-control-zoom",M=Et("div",w+" leaflet-bar"),I=this.options;return this._zoomInButton=this._createButton(I.zoomInText,I.zoomInTitle,w+"-in",M,this._zoomIn),this._zoomOutButton=this._createButton(I.zoomOutText,I.zoomOutTitle,w+"-out",M,this._zoomOut),this._updateDisabled(),g.on("zoomend zoomlevelschange",this._updateDisabled,this),M},onRemove:function(g){g.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(g){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(g.shiftKey?3:1))},_createButton:function(g,w,M,I,j){var W=Et("a",M,I);return W.innerHTML=g,W.href="#",W.title=w,W.setAttribute("role","button"),W.setAttribute("aria-label",w),Fp(W),ct(W,"click",nc),ct(W,"click",j,this),ct(W,"click",this._refocusOnMap,this),W},_updateDisabled:function(){var g=this._map,w="leaflet-disabled";Er(this._zoomInButton,w),Er(this._zoomOutButton,w),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||g._zoom===g.getMinZoom())&&(dt(this._zoomOutButton,w),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||g._zoom===g.getMaxZoom())&&(dt(this._zoomInButton,w),this._zoomInButton.setAttribute("aria-disabled","true"))}});Mt.mergeOptions({zoomControl:!0}),Mt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new gA,this.addControl(this.zoomControl))});var Fae=function(g){return new gA(g)},Y3=$a.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(g){var w="leaflet-control-scale",M=Et("div",w),I=this.options;return this._addScales(I,w+"-line",M),g.on(I.updateWhenIdle?"moveend":"move",this._update,this),g.whenReady(this._update,this),M},onRemove:function(g){g.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(g,w,M){g.metric&&(this._mScale=Et("div",w,M)),g.imperial&&(this._iScale=Et("div",w,M))},_update:function(){var g=this._map,w=g.getSize().y/2,M=g.distance(g.containerPointToLatLng([0,w]),g.containerPointToLatLng([this.options.maxWidth,w]));this._updateScales(M)},_updateScales:function(g){this.options.metric&&g&&this._updateMetric(g),this.options.imperial&&g&&this._updateImperial(g)},_updateMetric:function(g){var w=this._getRoundNum(g),M=w<1e3?w+" m":w/1e3+" km";this._updateScale(this._mScale,M,w/g)},_updateImperial:function(g){var w=g*3.2808399,M,I,j;w>5280?(M=w/5280,I=this._getRoundNum(M),this._updateScale(this._iScale,I+" mi",I/M)):(j=this._getRoundNum(w),this._updateScale(this._iScale,j+" ft",j/w))},_updateScale:function(g,w,M){g.style.width=Math.round(this.options.maxWidth*M)+"px",g.innerHTML=w},_getRoundNum:function(g){var w=Math.pow(10,(Math.floor(g)+"").length-1),M=g/w;return M=M>=10?10:M>=5?5:M>=3?3:M>=2?2:1,w*M}}),Vae=function(g){return new Y3(g)},Gae='',mA=$a.extend({options:{position:"bottomright",prefix:''+(He.inlineSvg?Gae+" ":"")+"Leaflet"},initialize:function(g){m(this,g),this._attributions={}},onAdd:function(g){g.attributionControl=this,this._container=Et("div","leaflet-control-attribution"),Fp(this._container);for(var w in g._layers)g._layers[w].getAttribution&&this.addAttribution(g._layers[w].getAttribution());return this._update(),g.on("layeradd",this._addAttribution,this),this._container},onRemove:function(g){g.off("layeradd",this._addAttribution,this)},_addAttribution:function(g){g.layer.getAttribution&&(this.addAttribution(g.layer.getAttribution()),g.layer.once("remove",function(){this.removeAttribution(g.layer.getAttribution())},this))},setPrefix:function(g){return this.options.prefix=g,this._update(),this},addAttribution:function(g){return g?(this._attributions[g]||(this._attributions[g]=0),this._attributions[g]++,this._update(),this):this},removeAttribution:function(g){return g?(this._attributions[g]&&(this._attributions[g]--,this._update()),this):this},_update:function(){if(this._map){var g=[];for(var w in this._attributions)this._attributions[w]&&g.push(w);var M=[];this.options.prefix&&M.push(this.options.prefix),g.length&&M.push(g.join(", ")),this._container.innerHTML=M.join(' ')}}});Mt.mergeOptions({attributionControl:!0}),Mt.addInitHook(function(){this.options.attributionControl&&new mA().addTo(this)});var Wae=function(g){return new mA(g)};$a.Layers=Z3,$a.Zoom=gA,$a.Scale=Y3,$a.Attribution=mA,Vp.layers=$ae,Vp.zoom=Fae,Vp.scale=Vae,Vp.attribution=Wae;var wo=z.extend({initialize:function(g){this._map=g},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}});wo.addTo=function(g,w){return g.addHandler(w,this),this};var Hae={Events:F},X3=He.touch?"touchstart mousedown":"mousedown",Sl=$.extend({options:{clickTolerance:3},initialize:function(g,w,M,I){m(this,I),this._element=g,this._dragStartTarget=w||g,this._preventOutline=M},enable:function(){this._enabled||(ct(this._dragStartTarget,X3,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Sl._dragging===this&&this.finishDrag(!0),Qt(this._dragStartTarget,X3,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(g){if(this._enabled&&(this._moved=!1,!nA(this._element,"leaflet-zoom-anim"))){if(g.touches&&g.touches.length!==1){Sl._dragging===this&&this.finishDrag();return}if(!(Sl._dragging||g.shiftKey||g.which!==1&&g.button!==1&&!g.touches)&&(Sl._dragging=this,this._preventOutline&&uA(this._element),oA(),Bp(),!this._moving)){this.fire("down");var w=g.touches?g.touches[0]:g,M=F3(this._element);this._startPoint=new B(w.clientX,w.clientY),this._startPos=tc(this._element),this._parentScale=cA(M);var I=g.type==="mousedown";ct(document,I?"mousemove":"touchmove",this._onMove,this),ct(document,I?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(g){if(this._enabled){if(g.touches&&g.touches.length>1){this._moved=!0;return}var w=g.touches&&g.touches.length===1?g.touches[0]:g,M=new B(w.clientX,w.clientY)._subtract(this._startPoint);!M.x&&!M.y||Math.abs(M.x)+Math.abs(M.y)W&&(X=re,W=se);W>M&&(w[X]=1,xA(g,w,M,I,X),xA(g,w,M,X,j))}function Xae(g,w){for(var M=[g[0]],I=1,j=0,W=g.length;Iw&&(M.push(g[I]),j=I);return jw.max.x&&(M|=2),g.yw.max.y&&(M|=8),M}function qae(g,w){var M=w.x-g.x,I=w.y-g.y;return M*M+I*I}function Gp(g,w,M,I){var j=w.x,W=w.y,X=M.x-j,re=M.y-W,se=X*X+re*re,pe;return se>0&&(pe=((g.x-j)*X+(g.y-W)*re)/se,pe>1?(j=M.x,W=M.y):pe>0&&(j+=X*pe,W+=re*pe)),X=g.x-j,re=g.y-W,I?X*X+re*re:new B(j,W)}function ta(g){return!b(g[0])||typeof g[0][0]!="object"&&typeof g[0][0]<"u"}function r5(g){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),ta(g)}function n5(g,w){var M,I,j,W,X,re,se,pe;if(!g||g.length===0)throw new Error("latlngs not passed");ta(g)||(console.warn("latlngs are not flat! Only the first ring will be used"),g=g[0]);var Re=de([0,0]),nt=te(g),yt=nt.getNorthWest().distanceTo(nt.getSouthWest())*nt.getNorthEast().distanceTo(nt.getNorthWest());yt<1700&&(Re=yA(g));var Jn=g.length,fn=[];for(M=0;MI){se=(W-I)/j,pe=[re.x-se*(re.x-X.x),re.y-se*(re.y-X.y)];break}var hi=w.unproject(U(pe));return de([hi.lat+Re.lat,hi.lng+Re.lng])}var Kae={__proto__:null,simplify:J3,pointToSegmentDistance:Q3,closestPointOnSegment:Zae,clipSegment:t5,_getEdgeIntersection:Sx,_getBitCode:ic,_sqClosestPointOnSegment:Gp,isFlat:ta,_flat:r5,polylineCenter:n5},_A={project:function(g){return new B(g.lng,g.lat)},unproject:function(g){return new ce(g.y,g.x)},bounds:new Z([-180,-90],[180,90])},bA={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Z([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(g){var w=Math.PI/180,M=this.R,I=g.lat*w,j=this.R_MINOR/M,W=Math.sqrt(1-j*j),X=W*Math.sin(I),re=Math.tan(Math.PI/4-I/2)/Math.pow((1-X)/(1+X),W/2);return I=-M*Math.log(Math.max(re,1e-10)),new B(g.lng*w*M,I)},unproject:function(g){for(var w=180/Math.PI,M=this.R,I=this.R_MINOR/M,j=Math.sqrt(1-I*I),W=Math.exp(-g.y/M),X=Math.PI/2-2*Math.atan(W),re=0,se=.1,pe;re<15&&Math.abs(se)>1e-7;re++)pe=j*Math.sin(X),pe=Math.pow((1-pe)/(1+pe),j/2),se=Math.PI/2-2*Math.atan(W*pe)-X,X+=se;return new ce(X*w,g.x*w/M)}},Jae={__proto__:null,LonLat:_A,Mercator:bA,SphericalMercator:ve},Qae=i({},ye,{code:"EPSG:3395",projection:bA,transformation:function(){var g=.5/(Math.PI*bA.R);return ee(g,.5,-g,.5)}()}),i5=i({},ye,{code:"EPSG:4326",projection:_A,transformation:ee(1/180,1,-1/180,.5)}),eoe=i({},Oe,{projection:_A,transformation:ee(1,0,-1,0),scale:function(g){return Math.pow(2,g)},zoom:function(g){return Math.log(g)/Math.LN2},distance:function(g,w){var M=w.lng-g.lng,I=w.lat-g.lat;return Math.sqrt(M*M+I*I)},infinite:!0});Oe.Earth=ye,Oe.EPSG3395=Qae,Oe.EPSG3857=We,Oe.EPSG900913=be,Oe.EPSG4326=i5,Oe.Simple=eoe;var Fa=$.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(g){return g.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(g){return g&&g.removeLayer(this),this},getPane:function(g){return this._map.getPane(g?this.options[g]||g:this.options.pane)},addInteractiveTarget:function(g){return this._map._targets[l(g)]=this,this},removeInteractiveTarget:function(g){return delete this._map._targets[l(g)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(g){var w=g.target;if(w.hasLayer(this)){if(this._map=w,this._zoomAnimated=w._zoomAnimated,this.getEvents){var M=this.getEvents();w.on(M,this),this.once("remove",function(){w.off(M,this)},this)}this.onAdd(w),this.fire("add"),w.fire("layeradd",{layer:this})}}});Mt.include({addLayer:function(g){if(!g._layerAdd)throw new Error("The provided object is not a Layer.");var w=l(g);return this._layers[w]?this:(this._layers[w]=g,g._mapToAdd=this,g.beforeAdd&&g.beforeAdd(this),this.whenReady(g._layerAdd,g),this)},removeLayer:function(g){var w=l(g);return this._layers[w]?(this._loaded&&g.onRemove(this),delete this._layers[w],this._loaded&&(this.fire("layerremove",{layer:g}),g.fire("remove")),g._map=g._mapToAdd=null,this):this},hasLayer:function(g){return l(g)in this._layers},eachLayer:function(g,w){for(var M in this._layers)g.call(w,this._layers[M]);return this},_addLayers:function(g){g=g?b(g)?g:[g]:[];for(var w=0,M=g.length;wthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&w[0]instanceof ce&&w[0].equals(w[M-1])&&w.pop(),w},_setLatLngs:function(g){_s.prototype._setLatLngs.call(this,g),ta(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return ta(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var g=this._renderer._bounds,w=this.options.weight,M=new B(w,w);if(g=new Z(g.min.subtract(M),g.max.add(M)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(g))){if(this.options.noClip){this._parts=this._rings;return}for(var I=0,j=this._rings.length,W;Ig.y!=j.y>g.y&&g.x<(j.x-I.x)*(g.y-I.y)/(j.y-I.y)+I.x&&(w=!w);return w||_s.prototype._containsPoint.call(this,g,!0)}});function loe(g,w){return new ph(g,w)}var bs=xs.extend({initialize:function(g,w){m(this,w),this._layers={},g&&this.addData(g)},addData:function(g){var w=b(g)?g:g.features,M,I,j;if(w){for(M=0,I=w.length;M0&&j.push(j[0].slice()),j}function gh(g,w){return g.feature?i({},g.feature,{geometry:w}):kx(w)}function kx(g){return g.type==="Feature"||g.type==="FeatureCollection"?g:{type:"Feature",properties:{},geometry:g}}var CA={toGeoJSON:function(g){return gh(this,{type:"Point",coordinates:TA(this.getLatLng(),g)})}};Tx.include(CA),wA.include(CA),Cx.include(CA),_s.include({toGeoJSON:function(g){var w=!ta(this._latlngs),M=Px(this._latlngs,w?1:0,!1,g);return gh(this,{type:(w?"Multi":"")+"LineString",coordinates:M})}}),ph.include({toGeoJSON:function(g){var w=!ta(this._latlngs),M=w&&!ta(this._latlngs[0]),I=Px(this._latlngs,M?2:w?1:0,!0,g);return w||(I=[I]),gh(this,{type:(M?"Multi":"")+"Polygon",coordinates:I})}}),dh.include({toMultiPoint:function(g){var w=[];return this.eachLayer(function(M){w.push(M.toGeoJSON(g).geometry.coordinates)}),gh(this,{type:"MultiPoint",coordinates:w})},toGeoJSON:function(g){var w=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(w==="MultiPoint")return this.toMultiPoint(g);var M=w==="GeometryCollection",I=[];return this.eachLayer(function(j){if(j.toGeoJSON){var W=j.toGeoJSON(g);if(M)I.push(W.geometry);else{var X=kx(W);X.type==="FeatureCollection"?I.push.apply(I,X.features):I.push(X)}}}),M?gh(this,{geometries:I,type:"GeometryCollection"}):{type:"FeatureCollection",features:I}}});function s5(g,w){return new bs(g,w)}var uoe=s5,Lx=Fa.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(g,w,M){this._url=g,this._bounds=te(w),m(this,M)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(dt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){vr(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(g){return this.options.opacity=g,this._image&&this._updateOpacity(),this},setStyle:function(g){return g.opacity&&this.setOpacity(g.opacity),this},bringToFront:function(){return this._map&&fh(this._image),this},bringToBack:function(){return this._map&&hh(this._image),this},setUrl:function(g){return this._url=g,this._image&&(this._image.src=g),this},setBounds:function(g){return this._bounds=te(g),this._map&&this._reset(),this},getEvents:function(){var g={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(g.zoomanim=this._animateZoom),g},setZIndex:function(g){return this.options.zIndex=g,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var g=this._url.tagName==="IMG",w=this._image=g?this._url:Et("img");if(dt(w,"leaflet-image-layer"),this._zoomAnimated&&dt(w,"leaflet-zoom-animated"),this.options.className&&dt(w,this.options.className),w.onselectstart=f,w.onmousemove=f,w.onload=o(this.fire,this,"load"),w.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(w.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),g){this._url=w.src;return}w.src=this._url,w.alt=this.options.alt},_animateZoom:function(g){var w=this._map.getZoomScale(g.zoom),M=this._map._latLngBoundsToNewLayerBounds(this._bounds,g.zoom,g.center).min;ec(this._image,M,w)},_reset:function(){var g=this._image,w=new Z(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),M=w.getSize();$r(g,w.min),g.style.width=M.x+"px",g.style.height=M.y+"px"},_updateOpacity:function(){ea(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 g=this.options.errorOverlayUrl;g&&this._url!==g&&(this._url=g,this._image.src=g)},getCenter:function(){return this._bounds.getCenter()}}),coe=function(g,w,M){return new Lx(g,w,M)},l5=Lx.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var g=this._url.tagName==="VIDEO",w=this._image=g?this._url:Et("video");if(dt(w,"leaflet-image-layer"),this._zoomAnimated&&dt(w,"leaflet-zoom-animated"),this.options.className&&dt(w,this.options.className),w.onselectstart=f,w.onmousemove=f,w.onloadeddata=o(this.fire,this,"load"),g){for(var M=w.getElementsByTagName("source"),I=[],j=0;j0?I:[w.src];return}b(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(w.style,"objectFit")&&(w.style.objectFit="fill"),w.autoplay=!!this.options.autoplay,w.loop=!!this.options.loop,w.muted=!!this.options.muted,w.playsInline=!!this.options.playsInline;for(var W=0;Wj?(w.height=j+"px",dt(g,W)):Er(g,W),this._containerWidth=this._container.offsetWidth},_animateZoom:function(g){var w=this._map._latLngToNewLayerPoint(this._latlng,g.zoom,g.center),M=this._getAnchor();$r(this._container,w.add(M))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var g=this._map,w=parseInt(Rp(this._container,"marginBottom"),10)||0,M=this._container.offsetHeight+w,I=this._containerWidth,j=new B(this._containerLeft,-M-this._containerBottom);j._add(tc(this._container));var W=g.layerPointToContainerPoint(j),X=U(this.options.autoPanPadding),re=U(this.options.autoPanPaddingTopLeft||X),se=U(this.options.autoPanPaddingBottomRight||X),pe=g.getSize(),Re=0,nt=0;W.x+I+se.x>pe.x&&(Re=W.x+I-pe.x+se.x),W.x-Re-re.x<0&&(Re=W.x-re.x),W.y+M+se.y>pe.y&&(nt=W.y+M-pe.y+se.y),W.y-nt-re.y<0&&(nt=W.y-re.y),(Re||nt)&&(this.options.keepInView&&(this._autopanning=!0),g.fire("autopanstart").panBy([Re,nt]))}},_getAnchor:function(){return U(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),doe=function(g,w){return new Ox(g,w)};Mt.mergeOptions({closePopupOnClick:!0}),Mt.include({openPopup:function(g,w,M){return this._initOverlay(Ox,g,w,M).openOn(this),this},closePopup:function(g){return g=arguments.length?g:this._popup,g&&g.close(),this}}),Fa.include({bindPopup:function(g,w){return this._popup=this._initOverlay(Ox,this._popup,g,w),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(g){return this._popup&&(this instanceof xs||(this._popup._source=this),this._popup._prepareOpen(g||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(g){return this._popup&&this._popup.setContent(g),this},getPopup:function(){return this._popup},_openPopup:function(g){if(!(!this._popup||!this._map)){nc(g);var w=g.layer||g.target;if(this._popup._source===w&&!(w instanceof Tl)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(g.latlng);return}this._popup._source=w,this.openPopup(g.latlng)}},_movePopup:function(g){this._popup.setLatLng(g.latlng)},_onKeyPress:function(g){g.originalEvent.keyCode===13&&this._openPopup(g)}});var Ix=So.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(g){So.prototype.onAdd.call(this,g),this.setOpacity(this.options.opacity),g.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(g){So.prototype.onRemove.call(this,g),g.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var g=So.prototype.getEvents.call(this);return this.options.permanent||(g.preclick=this.close),g},_initLayout:function(){var g="leaflet-tooltip",w=g+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Et("div",w),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(g){var w,M,I=this._map,j=this._container,W=I.latLngToContainerPoint(I.getCenter()),X=I.layerPointToContainerPoint(g),re=this.options.direction,se=j.offsetWidth,pe=j.offsetHeight,Re=U(this.options.offset),nt=this._getAnchor();re==="top"?(w=se/2,M=pe):re==="bottom"?(w=se/2,M=0):re==="center"?(w=se/2,M=pe/2):re==="right"?(w=0,M=pe/2):re==="left"?(w=se,M=pe/2):X.xthis.options.maxZoom||MI?this._retainParent(j,W,X,I):!1)},_retainChildren:function(g,w,M,I){for(var j=2*g;j<2*g+2;j++)for(var W=2*w;W<2*w+2;W++){var X=new B(j,W);X.z=M+1;var re=this._tileCoordsToKey(X),se=this._tiles[re];if(se&&se.active){se.retain=!0;continue}else se&&se.loaded&&(se.retain=!0);M+1this.options.maxZoom||this.options.minZoom!==void 0&&j1){this._setView(g,M);return}for(var nt=j.min.y;nt<=j.max.y;nt++)for(var yt=j.min.x;yt<=j.max.x;yt++){var Jn=new B(yt,nt);if(Jn.z=this._tileZoom,!!this._isValidTile(Jn)){var fn=this._tiles[this._tileCoordsToKey(Jn)];fn?fn.current=!0:X.push(Jn)}}if(X.sort(function(hi,yh){return hi.distanceTo(W)-yh.distanceTo(W)}),X.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var ra=document.createDocumentFragment();for(yt=0;ytM.max.x)||!w.wrapLat&&(g.yM.max.y))return!1}if(!this.options.bounds)return!0;var I=this._tileCoordsToBounds(g);return te(this.options.bounds).overlaps(I)},_keyToBounds:function(g){return this._tileCoordsToBounds(this._keyToTileCoords(g))},_tileCoordsToNwSe:function(g){var w=this._map,M=this.getTileSize(),I=g.scaleBy(M),j=I.add(M),W=w.unproject(I,g.z),X=w.unproject(j,g.z);return[W,X]},_tileCoordsToBounds:function(g){var w=this._tileCoordsToNwSe(g),M=new K(w[0],w[1]);return this.options.noWrap||(M=this._map.wrapLatLngBounds(M)),M},_tileCoordsToKey:function(g){return g.x+":"+g.y+":"+g.z},_keyToTileCoords:function(g){var w=g.split(":"),M=new B(+w[0],+w[1]);return M.z=+w[2],M},_removeTile:function(g){var w=this._tiles[g];w&&(vr(w.el),delete this._tiles[g],this.fire("tileunload",{tile:w.el,coords:this._keyToTileCoords(g)}))},_initTile:function(g){dt(g,"leaflet-tile");var w=this.getTileSize();g.style.width=w.x+"px",g.style.height=w.y+"px",g.onselectstart=f,g.onmousemove=f,He.ielt9&&this.options.opacity<1&&ea(g,this.options.opacity)},_addTile:function(g,w){var M=this._getTilePos(g),I=this._tileCoordsToKey(g),j=this.createTile(this._wrapCoords(g),o(this._tileReady,this,g));this._initTile(j),this.createTile.length<2&&E(o(this._tileReady,this,g,null,j)),$r(j,M),this._tiles[I]={el:j,coords:g,current:!0},w.appendChild(j),this.fire("tileloadstart",{tile:j,coords:g})},_tileReady:function(g,w,M){w&&this.fire("tileerror",{error:w,tile:M,coords:g});var I=this._tileCoordsToKey(g);M=this._tiles[I],M&&(M.loaded=+new Date,this._map._fadeAnimated?(ea(M.el,0),N(this._fadeFrame),this._fadeFrame=E(this._updateOpacity,this)):(M.active=!0,this._pruneTiles()),w||(dt(M.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:M.el,coords:g})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),He.ielt9||!this._map._fadeAnimated?E(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(g){return g.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(g){var w=new B(this._wrapX?c(g.x,this._wrapX):g.x,this._wrapY?c(g.y,this._wrapY):g.y);return w.z=g.z,w},_pxBoundsToTileRange:function(g){var w=this.getTileSize();return new Z(g.min.unscaleBy(w).floor(),g.max.unscaleBy(w).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var g in this._tiles)if(!this._tiles[g].loaded)return!1;return!0}});function goe(g){return new Hp(g)}var mh=Hp.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(g,w){this._url=g,w=m(this,w),w.detectRetina&&He.retina&&w.maxZoom>0?(w.tileSize=Math.floor(w.tileSize/2),w.zoomReverse?(w.zoomOffset--,w.minZoom=Math.min(w.maxZoom,w.minZoom+1)):(w.zoomOffset++,w.maxZoom=Math.max(w.minZoom,w.maxZoom-1)),w.minZoom=Math.max(0,w.minZoom)):w.zoomReverse?w.minZoom=Math.min(w.maxZoom,w.minZoom):w.maxZoom=Math.max(w.minZoom,w.maxZoom),typeof w.subdomains=="string"&&(w.subdomains=w.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(g,w){return this._url===g&&w===void 0&&(w=!0),this._url=g,w||this.redraw(),this},createTile:function(g,w){var M=document.createElement("img");return ct(M,"load",o(this._tileOnLoad,this,w,M)),ct(M,"error",o(this._tileOnError,this,w,M)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(M.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(M.referrerPolicy=this.options.referrerPolicy),M.alt="",M.src=this.getTileUrl(g),M},getTileUrl:function(g){var w={r:He.retina?"@2x":"",s:this._getSubdomain(g),x:g.x,y:g.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var M=this._globalTileRange.max.y-g.y;this.options.tms&&(w.y=M),w["-y"]=M}return _(this._url,i(w,this.options))},_tileOnLoad:function(g,w){He.ielt9?setTimeout(o(g,this,null,w),0):g(null,w)},_tileOnError:function(g,w,M){var I=this.options.errorTileUrl;I&&w.getAttribute("src")!==I&&(w.src=I),g(M,w)},_onTileRemove:function(g){g.tile.onload=null},_getZoomForUrl:function(){var g=this._tileZoom,w=this.options.maxZoom,M=this.options.zoomReverse,I=this.options.zoomOffset;return M&&(g=w-g),g+I},_getSubdomain:function(g){var w=Math.abs(g.x+g.y)%this.options.subdomains.length;return this.options.subdomains[w]},_abortLoading:function(){var g,w;for(g in this._tiles)if(this._tiles[g].coords.z!==this._tileZoom&&(w=this._tiles[g].el,w.onload=f,w.onerror=f,!w.complete)){w.src=T;var M=this._tiles[g].coords;vr(w),delete this._tiles[g],this.fire("tileabort",{tile:w,coords:M})}},_removeTile:function(g){var w=this._tiles[g];if(w)return w.el.setAttribute("src",T),Hp.prototype._removeTile.call(this,g)},_tileReady:function(g,w,M){if(!(!this._map||M&&M.getAttribute("src")===T))return Hp.prototype._tileReady.call(this,g,w,M)}});function f5(g,w){return new mh(g,w)}var h5=mh.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(g,w){this._url=g;var M=i({},this.defaultWmsParams);for(var I in w)I in this.options||(M[I]=w[I]);w=m(this,w);var j=w.detectRetina&&He.retina?2:1,W=this.getTileSize();M.width=W.x*j,M.height=W.y*j,this.wmsParams=M},onAdd:function(g){this._crs=this.options.crs||g.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var w=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[w]=this._crs.code,mh.prototype.onAdd.call(this,g)},getTileUrl:function(g){var w=this._tileCoordsToNwSe(g),M=this._crs,I=Y(M.project(w[0]),M.project(w[1])),j=I.min,W=I.max,X=(this._wmsVersion>=1.3&&this._crs===i5?[j.y,j.x,W.y,W.x]:[j.x,j.y,W.x,W.y]).join(","),re=mh.prototype.getTileUrl.call(this,g);return re+y(this.wmsParams,re,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+X},setParams:function(g,w){return i(this.wmsParams,g),w||this.redraw(),this}});function moe(g,w){return new h5(g,w)}mh.WMS=h5,f5.wms=moe;var ws=Fa.extend({options:{padding:.1},initialize:function(g){m(this,g),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),dt(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 g={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(g.zoomanim=this._onAnimZoom),g},_onAnimZoom:function(g){this._updateTransform(g.center,g.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(g,w){var M=this._map.getZoomScale(w,this._zoom),I=this._map.getSize().multiplyBy(.5+this.options.padding),j=this._map.project(this._center,w),W=I.multiplyBy(-M).add(j).subtract(this._map._getNewPixelOrigin(g,w));He.any3d?ec(this._container,W,M):$r(this._container,W)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var g in this._layers)this._layers[g]._reset()},_onZoomEnd:function(){for(var g in this._layers)this._layers[g]._project()},_updatePaths:function(){for(var g in this._layers)this._layers[g]._update()},_update:function(){var g=this.options.padding,w=this._map.getSize(),M=this._map.containerPointToLayerPoint(w.multiplyBy(-g)).round();this._bounds=new Z(M,M.add(w.multiplyBy(1+g*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),d5=ws.extend({options:{tolerance:0},getEvents:function(){var g=ws.prototype.getEvents.call(this);return g.viewprereset=this._onViewPreReset,g},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ws.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var g=this._container=document.createElement("canvas");ct(g,"mousemove",this._onMouseMove,this),ct(g,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ct(g,"mouseout",this._handleMouseOut,this),g._leaflet_disable_events=!0,this._ctx=g.getContext("2d")},_destroyContainer:function(){N(this._redrawRequest),delete this._ctx,vr(this._container),Qt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var g;this._redrawBounds=null;for(var w in this._layers)g=this._layers[w],g._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ws.prototype._update.call(this);var g=this._bounds,w=this._container,M=g.getSize(),I=He.retina?2:1;$r(w,g.min),w.width=I*M.x,w.height=I*M.y,w.style.width=M.x+"px",w.style.height=M.y+"px",He.retina&&this._ctx.scale(2,2),this._ctx.translate(-g.min.x,-g.min.y),this.fire("update")}},_reset:function(){ws.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(g){this._updateDashArray(g),this._layers[l(g)]=g;var w=g._order={layer:g,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=w),this._drawLast=w,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(g){this._requestRedraw(g)},_removePath:function(g){var w=g._order,M=w.next,I=w.prev;M?M.prev=I:this._drawLast=I,I?I.next=M:this._drawFirst=M,delete g._order,delete this._layers[l(g)],this._requestRedraw(g)},_updatePath:function(g){this._extendRedrawBounds(g),g._project(),g._update(),this._requestRedraw(g)},_updateStyle:function(g){this._updateDashArray(g),this._requestRedraw(g)},_updateDashArray:function(g){if(typeof g.options.dashArray=="string"){var w=g.options.dashArray.split(/[, ]+/),M=[],I,j;for(j=0;j')}}catch{}return function(g){return document.createElement("<"+g+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),yoe={_initContainer:function(){this._container=Et("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ws.prototype._update.call(this),this.fire("update"))},_initPath:function(g){var w=g._container=Up("shape");dt(w,"leaflet-vml-shape "+(this.options.className||"")),w.coordsize="1 1",g._path=Up("path"),w.appendChild(g._path),this._updateStyle(g),this._layers[l(g)]=g},_addPath:function(g){var w=g._container;this._container.appendChild(w),g.options.interactive&&g.addInteractiveTarget(w)},_removePath:function(g){var w=g._container;vr(w),g.removeInteractiveTarget(w),delete this._layers[l(g)]},_updateStyle:function(g){var w=g._stroke,M=g._fill,I=g.options,j=g._container;j.stroked=!!I.stroke,j.filled=!!I.fill,I.stroke?(w||(w=g._stroke=Up("stroke")),j.appendChild(w),w.weight=I.weight+"px",w.color=I.color,w.opacity=I.opacity,I.dashArray?w.dashStyle=b(I.dashArray)?I.dashArray.join(" "):I.dashArray.replace(/( *, *)/g," "):w.dashStyle="",w.endcap=I.lineCap.replace("butt","flat"),w.joinstyle=I.lineJoin):w&&(j.removeChild(w),g._stroke=null),I.fill?(M||(M=g._fill=Up("fill")),j.appendChild(M),M.color=I.fillColor||I.color,M.opacity=I.fillOpacity):M&&(j.removeChild(M),g._fill=null)},_updateCircle:function(g){var w=g._point.round(),M=Math.round(g._radius),I=Math.round(g._radiusY||M);this._setPath(g,g._empty()?"M0 0":"AL "+w.x+","+w.y+" "+M+","+I+" 0,"+65535*360)},_setPath:function(g,w){g._path.v=w},_bringToFront:function(g){fh(g._container)},_bringToBack:function(g){hh(g._container)}},Ex=He.vml?Up:Ve,Zp=ws.extend({_initContainer:function(){this._container=Ex("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ex("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){vr(this._container),Qt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ws.prototype._update.call(this);var g=this._bounds,w=g.getSize(),M=this._container;(!this._svgSize||!this._svgSize.equals(w))&&(this._svgSize=w,M.setAttribute("width",w.x),M.setAttribute("height",w.y)),$r(M,g.min),M.setAttribute("viewBox",[g.min.x,g.min.y,w.x,w.y].join(" ")),this.fire("update")}},_initPath:function(g){var w=g._path=Ex("path");g.options.className&&dt(w,g.options.className),g.options.interactive&&dt(w,"leaflet-interactive"),this._updateStyle(g),this._layers[l(g)]=g},_addPath:function(g){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(g._path),g.addInteractiveTarget(g._path)},_removePath:function(g){vr(g._path),g.removeInteractiveTarget(g._path),delete this._layers[l(g)]},_updatePath:function(g){g._project(),g._update()},_updateStyle:function(g){var w=g._path,M=g.options;w&&(M.stroke?(w.setAttribute("stroke",M.color),w.setAttribute("stroke-opacity",M.opacity),w.setAttribute("stroke-width",M.weight),w.setAttribute("stroke-linecap",M.lineCap),w.setAttribute("stroke-linejoin",M.lineJoin),M.dashArray?w.setAttribute("stroke-dasharray",M.dashArray):w.removeAttribute("stroke-dasharray"),M.dashOffset?w.setAttribute("stroke-dashoffset",M.dashOffset):w.removeAttribute("stroke-dashoffset")):w.setAttribute("stroke","none"),M.fill?(w.setAttribute("fill",M.fillColor||M.color),w.setAttribute("fill-opacity",M.fillOpacity),w.setAttribute("fill-rule",M.fillRule||"evenodd")):w.setAttribute("fill","none"))},_updatePoly:function(g,w){this._setPath(g,Ze(g._parts,w))},_updateCircle:function(g){var w=g._point,M=Math.max(Math.round(g._radius),1),I=Math.max(Math.round(g._radiusY),1)||M,j="a"+M+","+I+" 0 1,0 ",W=g._empty()?"M0 0":"M"+(w.x-M)+","+w.y+j+M*2+",0 "+j+-M*2+",0 ";this._setPath(g,W)},_setPath:function(g,w){g._path.setAttribute("d",w)},_bringToFront:function(g){fh(g._path)},_bringToBack:function(g){hh(g._path)}});He.vml&&Zp.include(yoe);function p5(g){return He.svg||He.vml?new Zp(g):null}Mt.include({getRenderer:function(g){var w=g.options.renderer||this._getPaneRenderer(g.options.pane)||this.options.renderer||this._renderer;return w||(w=this._renderer=this._createRenderer()),this.hasLayer(w)||this.addLayer(w),w},_getPaneRenderer:function(g){if(g==="overlayPane"||g===void 0)return!1;var w=this._paneRenderers[g];return w===void 0&&(w=this._createRenderer({pane:g}),this._paneRenderers[g]=w),w},_createRenderer:function(g){return this.options.preferCanvas&&v5(g)||p5(g)}});var g5=ph.extend({initialize:function(g,w){ph.prototype.initialize.call(this,this._boundsToLatLngs(g),w)},setBounds:function(g){return this.setLatLngs(this._boundsToLatLngs(g))},_boundsToLatLngs:function(g){return g=te(g),[g.getSouthWest(),g.getNorthWest(),g.getNorthEast(),g.getSouthEast()]}});function xoe(g,w){return new g5(g,w)}Zp.create=Ex,Zp.pointsToPath=Ze,bs.geometryToLayer=Ax,bs.coordsToLatLng=SA,bs.coordsToLatLngs=Mx,bs.latLngToCoords=TA,bs.latLngsToCoords=Px,bs.getFeature=gh,bs.asFeature=kx,Mt.mergeOptions({boxZoom:!0});var m5=wo.extend({initialize:function(g){this._map=g,this._container=g._container,this._pane=g._panes.overlayPane,this._resetStateTimeout=0,g.on("unload",this._destroy,this)},addHooks:function(){ct(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Qt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){vr(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(g){if(!g.shiftKey||g.which!==1&&g.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Bp(),oA(),this._startPoint=this._map.mouseEventToContainerPoint(g),ct(document,{contextmenu:nc,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(g){this._moved||(this._moved=!0,this._box=Et("div","leaflet-zoom-box",this._container),dt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(g);var w=new Z(this._point,this._startPoint),M=w.getSize();$r(this._box,w.min),this._box.style.width=M.x+"px",this._box.style.height=M.y+"px"},_finish:function(){this._moved&&(vr(this._box),Er(this._container,"leaflet-crosshair")),zp(),sA(),Qt(document,{contextmenu:nc,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(g){if(!(g.which!==1&&g.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var w=new K(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(w).fire("boxzoomend",{boxZoomBounds:w})}},_onKeyDown:function(g){g.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Mt.addInitHook("addHandler","boxZoom",m5),Mt.mergeOptions({doubleClickZoom:!0});var y5=wo.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(g){var w=this._map,M=w.getZoom(),I=w.options.zoomDelta,j=g.originalEvent.shiftKey?M-I:M+I;w.options.doubleClickZoom==="center"?w.setZoom(j):w.setZoomAround(g.containerPoint,j)}});Mt.addInitHook("addHandler","doubleClickZoom",y5),Mt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var x5=wo.extend({addHooks:function(){if(!this._draggable){var g=this._map;this._draggable=new Sl(g._mapPane,g._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),g.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),g.on("zoomend",this._onZoomEnd,this),g.whenReady(this._onZoomEnd,this))}dt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Er(this._map._container,"leaflet-grab"),Er(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 g=this._map;if(g._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var w=te(this._map.options.maxBounds);this._offsetLimit=Y(this._map.latLngToContainerPoint(w.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(w.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;g.fire("movestart").fire("dragstart"),g.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(g){if(this._map.options.inertia){var w=this._lastTime=+new Date,M=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(M),this._times.push(w),this._prunePositions(w)}this._map.fire("move",g).fire("drag",g)},_prunePositions:function(g){for(;this._positions.length>1&&g-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var g=this._map.getSize().divideBy(2),w=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=w.subtract(g).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(g,w){return g-(g-w)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var g=this._draggable._newPos.subtract(this._draggable._startPos),w=this._offsetLimit;g.xw.max.x&&(g.x=this._viscousLimit(g.x,w.max.x)),g.y>w.max.y&&(g.y=this._viscousLimit(g.y,w.max.y)),this._draggable._newPos=this._draggable._startPos.add(g)}},_onPreDragWrap:function(){var g=this._worldWidth,w=Math.round(g/2),M=this._initialWorldOffset,I=this._draggable._newPos.x,j=(I-w+M)%g+w-M,W=(I+w+M)%g-w-M,X=Math.abs(j+M)0?W:-W))-w;this._delta=0,this._startTime=null,X&&(g.options.scrollWheelZoom==="center"?g.setZoom(w+X):g.setZoomAround(this._lastMousePos,w+X))}});Mt.addInitHook("addHandler","scrollWheelZoom",b5);var _oe=600;Mt.mergeOptions({tapHold:He.touchNative&&He.safari&&He.mobile,tapTolerance:15});var w5=wo.extend({addHooks:function(){ct(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Qt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(g){if(clearTimeout(this._holdTimeout),g.touches.length===1){var w=g.touches[0];this._startPos=this._newPos=new B(w.clientX,w.clientY),this._holdTimeout=setTimeout(o(function(){this._cancel(),this._isTapValid()&&(ct(document,"touchend",Sn),ct(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",w))},this),_oe),ct(document,"touchend touchcancel contextmenu",this._cancel,this),ct(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function g(){Qt(document,"touchend",Sn),Qt(document,"touchend touchcancel",g)},_cancel:function(){clearTimeout(this._holdTimeout),Qt(document,"touchend touchcancel contextmenu",this._cancel,this),Qt(document,"touchmove",this._onMove,this)},_onMove:function(g){var w=g.touches[0];this._newPos=new B(w.clientX,w.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(g,w){var M=new MouseEvent(g,{bubbles:!0,cancelable:!0,view:window,screenX:w.screenX,screenY:w.screenY,clientX:w.clientX,clientY:w.clientY});M._simulated=!0,w.target.dispatchEvent(M)}});Mt.addInitHook("addHandler","tapHold",w5),Mt.mergeOptions({touchZoom:He.touch,bounceAtZoomLimits:!0});var S5=wo.extend({addHooks:function(){dt(this._map._container,"leaflet-touch-zoom"),ct(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Er(this._map._container,"leaflet-touch-zoom"),Qt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(g){var w=this._map;if(!(!g.touches||g.touches.length!==2||w._animatingZoom||this._zooming)){var M=w.mouseEventToContainerPoint(g.touches[0]),I=w.mouseEventToContainerPoint(g.touches[1]);this._centerPoint=w.getSize()._divideBy(2),this._startLatLng=w.containerPointToLatLng(this._centerPoint),w.options.touchZoom!=="center"&&(this._pinchStartLatLng=w.containerPointToLatLng(M.add(I)._divideBy(2))),this._startDist=M.distanceTo(I),this._startZoom=w.getZoom(),this._moved=!1,this._zooming=!0,w._stop(),ct(document,"touchmove",this._onTouchMove,this),ct(document,"touchend touchcancel",this._onTouchEnd,this),Sn(g)}},_onTouchMove:function(g){if(!(!g.touches||g.touches.length!==2||!this._zooming)){var w=this._map,M=w.mouseEventToContainerPoint(g.touches[0]),I=w.mouseEventToContainerPoint(g.touches[1]),j=M.distanceTo(I)/this._startDist;if(this._zoom=w.getScaleZoom(j,this._startZoom),!w.options.bounceAtZoomLimits&&(this._zoomw.getMaxZoom()&&j>1)&&(this._zoom=w._limitZoom(this._zoom)),w.options.touchZoom==="center"){if(this._center=this._startLatLng,j===1)return}else{var W=M._add(I)._divideBy(2)._subtract(this._centerPoint);if(j===1&&W.x===0&&W.y===0)return;this._center=w.unproject(w.project(this._pinchStartLatLng,this._zoom).subtract(W),this._zoom)}this._moved||(w._moveStart(!0,!1),this._moved=!0),N(this._animRequest);var X=o(w._move,w,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=E(X,this,!0),Sn(g)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,N(this._animRequest),Qt(document,"touchmove",this._onTouchMove,this),Qt(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",S5),Mt.BoxZoom=m5,Mt.DoubleClickZoom=y5,Mt.Drag=x5,Mt.Keyboard=_5,Mt.ScrollWheelZoom=b5,Mt.TapHold=w5,Mt.TouchZoom=S5,r.Bounds=Z,r.Browser=He,r.CRS=Oe,r.Canvas=d5,r.Circle=wA,r.CircleMarker=Cx,r.Class=z,r.Control=$a,r.DivIcon=c5,r.DivOverlay=So,r.DomEvent=Bae,r.DomUtil=jae,r.Draggable=Sl,r.Evented=$,r.FeatureGroup=xs,r.GeoJSON=bs,r.GridLayer=Hp,r.Handler=wo,r.Icon=vh,r.ImageOverlay=Lx,r.LatLng=ce,r.LatLngBounds=K,r.Layer=Fa,r.LayerGroup=dh,r.LineUtil=Kae,r.Map=Mt,r.Marker=Tx,r.Mixin=Hae,r.Path=Tl,r.Point=B,r.PolyUtil=Uae,r.Polygon=ph,r.Polyline=_s,r.Popup=Ox,r.PosAnimation=U3,r.Projection=Jae,r.Rectangle=g5,r.Renderer=ws,r.SVG=Zp,r.SVGOverlay=u5,r.TileLayer=mh,r.Tooltip=Ix,r.Transformation=ue,r.Util=D,r.VideoOverlay=l5,r.bind=o,r.bounds=Y,r.canvas=v5,r.circle=ooe,r.circleMarker=aoe,r.control=Vp,r.divIcon=poe,r.extend=i,r.featureGroup=roe,r.geoJSON=s5,r.geoJson=uoe,r.gridLayer=goe,r.icon=noe,r.imageOverlay=coe,r.latLng=de,r.latLngBounds=te,r.layerGroup=toe,r.map=zae,r.marker=ioe,r.point=U,r.polygon=loe,r.polyline=soe,r.popup=doe,r.rectangle=xoe,r.setOptions=m,r.stamp=l,r.svg=p5,r.svgOverlay=hoe,r.tileLayer=f5,r.tooltip=voe,r.transformation=ee,r.version=n,r.videoOverlay=foe;var boe=window.L;r.noConflict=function(){return window.L=boe,this},window.L=r})})(GE,GE.exports);var lh=GE.exports;const wae=Yt(lh);function sx(e,t,r){return Object.freeze({instance:e,context:t,container:r})}function j3(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 Sae(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 aQe(e){return function(r){const n=QC(),i=e(eA(r,n),n);return yae(n.map,r.attribution),D3(i.current,r.eventHandlers),Sae(i.current,n),i}}function oQe(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 sQe(e){return function(r){const n=QC(),i=e(eA(r,n),n);return D3(i.current,r.eventHandlers),Sae(i.current,n),oQe(i.current,r),i}}function Tae(e,t){const r=j3(e),n=iQe(r,t);return rQe(n)}function Cae(e,t){const r=j3(e,t),n=sQe(r);return tQe(n)}function lQe(e,t){const r=j3(e,t),n=aQe(r);return nQe(n)}function uQe(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 cQe(){return QC().map}const fQe=Cae(function({center:t,children:r,...n},i){const a=new lh.CircleMarker(t,n);return sx(a,xae(i,{overlayContainer:a}))},JJe);function WE(){return WE=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 lh.Map(x,c);r!=null&&u!=null?_.setView(r,u):e!=null&&_.fitBounds(e,t),l!=null&&_.whenReady(l),v(eQe(_))}},[]);G.useEffect(()=>()=>{d==null||d.map.remove()},[d]);const y=d?Q.createElement(bae,{value:d},n):o??null;return Q.createElement("div",WE({},h,{ref:m}),y)}const dQe=G.forwardRef(hQe),vQe=Cae(function({positions:t,...r},n){const i=new lh.Polyline(t,r);return sx(i,xae(n,{overlayContainer:i}))},function(t,r,n){r.positions!==n.positions&&t.setLatLngs(r.positions)}),pQe=Tae(function(t,r){const n=new lh.Popup(t,r.overlayContainer);return sx(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])}),gQe=lQe(function({url:t,...r},n){const i=new lh.TileLayer(t,eA(r,n));return sx(i,n)},function(t,r,n){uQe(t,r,n);const{url:i}=r;i!=null&&i!==n.url&&t.setUrl(i)}),mQe=Tae(function(t,r){const n=new lh.Tooltip(t,r.overlayContainer);return sx(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])}),yQe="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=",xQe="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==",_Qe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC";delete wae.Icon.Default.prototype._getIconUrl;wae.Icon.Default.mergeOptions({iconUrl:yQe,iconRetinaUrl:xQe,shadowUrl:_Qe});const y7=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],bQe=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function wQe(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function SQe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function TQe(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 CQe({bounds:e}){const t=cQe();return G.useEffect(()=>{e&&t.fitBounds(e,{padding:[50,50]})},[t,e]),null}function AQe({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 p.jsxs("div",{className:"min-w-[200px]",children:[p.jsx("div",{className:"font-semibold text-slate-800",children:e.short_name}),p.jsx("div",{className:"text-xs text-slate-600 mb-2",children:e.long_name}),p.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[p.jsx("div",{className:"text-slate-500",children:"Role"}),p.jsx("div",{className:"text-slate-700 font-medium",children:e.role}),p.jsx("div",{className:"text-slate-500",children:"Hardware"}),p.jsx("div",{className:"text-slate-700",children:e.hardware||"Unknown"}),p.jsx("div",{className:"text-slate-500",children:"Battery"}),p.jsx("div",{className:"text-slate-700",children:r}),p.jsx("div",{className:"text-slate-500",children:"Last Heard"}),p.jsx("div",{className:"text-slate-700",children:TQe(e.last_heard)})]}),t&&p.jsxs("div",{className:"mt-3 pt-2 border-t border-slate-200 flex gap-2",children:[p.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:[p.jsx(Zd,{size:10}),"Google Maps"]}),p.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:[p.jsx(Zd,{size:10}),"OSM"]})]})]})}function MQe({nodes:e,edges:t,selectedNodeId:r,onSelectNode:n}){const i=G.useMemo(()=>e.filter(f=>f.latitude!==null&&f.longitude!==null),[e]),a=e.length-i.length,o=G.useMemo(()=>new Map(i.map(f=>[f.node_num,f])),[i]),s=G.useMemo(()=>t.filter(f=>o.has(f.from_node)&&o.has(f.to_node)),[t,o]),l=G.useMemo(()=>{if(i.length===0)return null;const f=i.map(d=>d.latitude),h=i.map(d=>d.longitude);return[[Math.min(...f),Math.min(...h)],[Math.max(...f),Math.max(...h)]]},[i]),u=[43.6,-114.4],c=G.useMemo(()=>{const f=new Set;return r!==null&&t.forEach(h=>{h.from_node===r&&f.add(h.to_node),h.to_node===r&&f.add(h.from_node)}),f},[r,t]);return p.jsxs("div",{className:"relative bg-bg-card rounded-lg border border-border overflow-hidden",children:[p.jsxs(dQe,{center:u,zoom:7,style:{width:"100%",height:"540px"},className:"z-0",children:[p.jsx(gQe,{url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:'© OpenStreetMap, © CARTO'}),p.jsx(CQe,{bounds:l}),s.map((f,h)=>{const d=o.get(f.from_node),v=o.get(f.to_node),m=r===null||f.from_node===r||f.to_node===r;return p.jsx(vQe,{positions:[[d.latitude,d.longitude],[v.latitude,v.longitude]],color:wQe(f.snr),weight:m&&r!==null?2.5:1.5,opacity:r===null?.3:m?.6:.08},h)}),i.map(f=>{const h=f.node_num===r,d=c.has(f.node_num),v=r===null||h||d,m=bQe.includes(f.role),y=SQe(f.latitude),x=y7[y%y7.length];return p.jsxs(fQe,{center:[f.latitude,f.longitude],radius:m?8:5,fillColor:m?x:"#111827",fillOpacity:v?.9:.2,stroke:!0,color:h?"#ffffff":x,weight:h?3:m?0:2,opacity:v?1:.3,eventHandlers:{click:()=>n(h?null:f.node_num)},children:[p.jsx(mQe,{direction:"top",offset:[0,-8],children:p.jsx("span",{className:"font-mono text-xs",children:f.short_name})}),p.jsx(pQe,{children:p.jsx(AQe,{node:f})})]},f.node_num)})]}),p.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:[p.jsx(Fv,{size:12}),p.jsxs("span",{children:["Showing ",i.length," of ",e.length," nodes",a>0&&p.jsxs("span",{className:"text-slate-500",children:[" (",a," without coordinates)"]})]})]})]})}const x7=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],PQe=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function _7(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function kQe(e){return e>12?"excellent":e>8?"good":e>5?"fair":e>3?"marginal":"poor"}function LQe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function OQe(e){return["Northern ID","Central ID","SW Idaho","SC Idaho"][e]||"Unknown"}function IQe(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 EQe(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 NQe({node:e,edges:t,nodes:r,onSelectNode:n}){const i=G.useMemo(()=>{if(!e)return[];const f=new Map(r.map(d=>[d.node_num,d])),h=[];return t.forEach(d=>{if(d.from_node===e.node_num){const v=f.get(d.to_node);v&&h.push({node:v,snr:d.snr,quality:d.quality})}else if(d.to_node===e.node_num){const v=f.get(d.from_node);v&&h.push({node:v,snr:d.snr,quality:d.quality})}}),h.sort((d,v)=>v.snr-d.snr)},[e,t,r]);if(!e)return p.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:[p.jsx("div",{className:"w-12 h-12 rounded-full bg-bg-hover border border-border flex items-center justify-center mb-3",children:p.jsx(ho,{size:24,className:"text-slate-500"})}),p.jsx("p",{className:"text-sm text-slate-500 text-center",children:"Click a node to inspect"})]});const a=PQe.includes(e.role),o=LQe(e.latitude),s=x7[o%x7.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 p.jsxs("div",{className:"w-[250px] flex-shrink-0 bg-bg-card border-l border-border flex flex-col h-[540px] overflow-hidden",children:[p.jsxs("div",{className:"p-4 border-b border-border",children:[p.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}),p.jsx("div",{className:"font-mono text-lg text-slate-100",children:e.short_name}),p.jsx("div",{className:"text-xs text-slate-500 truncate",children:e.long_name})]}),p.jsxs("div",{className:"p-4 border-b border-border grid grid-cols-2 gap-3",children:[p.jsxs("div",{children:[p.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Role"}),p.jsx("div",{className:`text-sm font-medium ${a?"text-cyan-400":"text-slate-300"}`,children:e.role})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Region"}),p.jsx("div",{className:"text-sm text-slate-300",children:OQe(o)})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Battery"}),p.jsxs("div",{className:"text-sm text-slate-300 flex items-center gap-1",children:[c&&p.jsx(ly,{size:12,className:"text-amber-400"}),u]})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Status"}),p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("div",{className:`w-2 h-2 rounded-full ${EQe(e.last_heard)}`}),p.jsx("span",{className:"text-sm text-slate-300",children:IQe(e.last_heard)})]})]}),p.jsxs("div",{className:"col-span-2",children:[p.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Hardware"}),p.jsx("div",{className:"text-sm text-slate-300 font-mono truncate",children:e.hardware||"Unknown"})]})]}),l&&p.jsxs("div",{className:"px-4 py-3 border-b border-border flex gap-3",children:[p.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-400 hover:text-blue-300",children:[p.jsx(Zd,{size:10}),"Google Maps"]}),p.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-400 hover:text-blue-300",children:[p.jsx(Zd,{size:10}),"OSM"]})]}),p.jsxs("div",{className:"flex-1 overflow-y-auto",children:[p.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?p.jsx("div",{className:"divide-y divide-border",children:i.map(f=>p.jsxs("button",{onClick:()=>n(f.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:_7(f.snr)},children:[p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm text-slate-200 font-mono truncate",children:f.node.short_name}),p.jsx("div",{className:"text-xs text-slate-500 truncate",children:f.node.long_name})]}),p.jsxs("div",{className:"text-right flex-shrink-0",children:[p.jsxs("div",{className:"text-xs font-mono",style:{color:_7(f.snr)},children:[f.snr.toFixed(1)," dB"]}),p.jsx("div",{className:"text-xs text-slate-500",children:kQe(f.snr)})]})]},f.node.node_num))}):p.jsx("div",{className:"px-4 py-6 text-center text-sm text-slate-500",children:"No known neighbors"})]})]})}const b7=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function DQe(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 jQe(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 RQe(e){return e.battery_level===null?"—":e.battery_level>100||e.voltage&&e.voltage>4.1?"USB ⚡":`${e.battery_level.toFixed(0)}%`}function w7(e){return e===null?"—":e>46?"Northern":e>44.5?"Central":e>43?"SW Idaho":"SC Idaho"}function BQe({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"),f=G.useMemo(()=>{let v=[...e];if(u==="infra"?v=v.filter(m=>b7.includes(m.role)):u==="online"&&(v=v.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();v=v.filter(y=>y.short_name.toLowerCase().includes(m)||y.long_name.toLowerCase().includes(m)||y.role.toLowerCase().includes(m)||w7(y.latitude).toLowerCase().includes(m))}return v.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}),v},[e,n,a,s,u]),h=v=>{a===v?l(s==="asc"?"desc":"asc"):(o(v),l("asc"))},d=({field:v})=>a!==v?null:s==="asc"?p.jsx(vce,{size:14,className:"inline ml-1"}):p.jsx(Bu,{size:14,className:"inline ml-1"});return p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg overflow-hidden",children:[p.jsxs("div",{className:"p-3 border-b border-border flex items-center gap-3",children:[p.jsxs("div",{className:"relative flex-1 max-w-xs",children:[p.jsx(bT,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),p.jsx("input",{type:"text",placeholder:"Search nodes...",value:n,onChange:v=>i(v.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"})]}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx(WN,{size:14,className:"text-slate-500 mr-1"}),["all","infra","online"].map(v=>p.jsx("button",{onClick:()=>c(v),className:`px-2 py-1 text-xs rounded transition-colors ${u===v?"bg-accent text-white":"bg-bg-hover text-slate-400 hover:text-slate-200"}`,children:v==="all"?"All":v==="infra"?"Infra":"Online"},v))]}),p.jsxs("div",{className:"text-xs text-slate-500 ml-auto",children:[f.length," of ",e.length," nodes"]})]}),p.jsxs("div",{className:"overflow-x-auto",children:[p.jsxs("table",{className:"w-full text-sm",children:[p.jsx("thead",{children:p.jsxs("tr",{className:"bg-bg-hover text-slate-400 text-xs",children:[p.jsx("th",{className:"w-8 px-3 py-2"}),p.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("short_name"),children:["Name ",p.jsx(d,{field:"short_name"})]}),p.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("role"),children:["Role ",p.jsx(d,{field:"role"})]}),p.jsx("th",{className:"px-3 py-2 text-left",children:"Region"}),p.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("battery_level"),children:[p.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"})," ",p.jsx(d,{field:"battery_level"})]}),p.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("last_heard"),children:[p.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"})," ",p.jsx(d,{field:"last_heard"})]}),p.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("hardware"),children:["Hardware ",p.jsx(d,{field:"hardware"})]})]})}),p.jsx("tbody",{className:"divide-y divide-border",children:f.slice(0,100).map(v=>{const m=b7.includes(v.role),y=v.node_num===t;return p.jsxs("tr",{onClick:()=>r(v.node_num),className:`cursor-pointer transition-colors ${y?"bg-accent/10":"hover:bg-bg-hover"}`,children:[p.jsx("td",{className:"px-3 py-2",children:p.jsx("div",{className:`w-2 h-2 rounded-full ${DQe(v.last_heard)}`})}),p.jsxs("td",{className:"px-3 py-2",children:[p.jsx("div",{className:"font-mono text-slate-200",children:v.short_name}),p.jsx("div",{className:"text-xs text-slate-500 truncate max-w-[200px]",children:v.long_name})]}),p.jsx("td",{className:"px-3 py-2",children:p.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-xs font-medium ${m?"bg-cyan-500/20 text-cyan-400":"bg-slate-500/20 text-slate-400"}`,children:v.role})}),p.jsx("td",{className:"px-3 py-2 text-slate-400",children:w7(v.latitude)}),p.jsx("td",{className:"px-3 py-2 font-mono text-slate-300",children:RQe(v)}),p.jsx("td",{className:"px-3 py-2 text-slate-400",children:jQe(v.last_heard)}),p.jsx("td",{className:"px-3 py-2 font-mono text-xs text-slate-400 truncate max-w-[150px]",children:v.hardware||"—"})]},v.node_num)})})]}),f.length>100&&p.jsxs("div",{className:"px-3 py-2 text-xs text-slate-500 text-center border-t border-border",children:["Showing first 100 of ",f.length," nodes"]}),f.length===0&&p.jsx("div",{className:"px-3 py-8 text-sm text-slate-500 text-center",children:"No nodes match your filters"})]})]})}function zQe(){const[e,t]=G.useState([]),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState(null),[l,u]=G.useState("topo"),[c,f]=G.useState(!0),[h,d]=G.useState(null);G.useEffect(()=>{document.title="Mesh — MeshAI",Promise.all([Pce(),kce(),Nce()]).then(([y,x,_])=>{t(y),n(x),a(_),f(!1)}).catch(y=>{d(y.message),f(!1)})},[]);const v=G.useMemo(()=>e.find(y=>y.node_num===o)||null,[e,o]),m=G.useCallback(y=>{s(y)},[]);return c?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-slate-400",children:"Loading mesh data..."})}):h?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsxs("div",{className:"text-red-400",children:["Error: ",h]})}):p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"text-sm text-slate-400",children:[e.length," nodes • ",r.length," edges"]}),p.jsxs("div",{className:"flex items-center bg-bg-card border border-border rounded-lg p-1",children:[p.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:[p.jsx(uY,{size:14}),p.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"})]}),p.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:[p.jsx(wce,{size:14}),p.jsx("span",{title:"Nodes plotted by lat/lon on a basemap. Nodes without a reported position are clustered at the top edge.",children:"Geographic"})]})]})]}),p.jsxs("div",{className:"flex gap-0",children:[p.jsx("div",{className:"flex-1 min-w-0",children:l==="topo"?p.jsx(KJe,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:m}):p.jsx(MQe,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:m})}),p.jsx(NQe,{node:v,edges:r,nodes:e,onSelectNode:m})]}),p.jsx(BQe,{nodes:e,selectedNodeId:o,onSelectNode:m})]})}function R3({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),[f,h]=G.useState(""),[d,v]=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)),f.trim()){const T=f.toLowerCase();S=S.filter(C=>{var A,P,O,k;return((A=C.short_name)==null?void 0:A.toLowerCase().includes(T))||((P=C.long_name)==null?void 0:P.toLowerCase().includes(T))||((O=C.role)==null?void 0:O.toLowerCase().includes(T))||((k=C.node_id_hex)==null?void 0:k.toLowerCase().includes(T))})}return S.sort((T,C)=>(T.short_name||"").localeCompare(C.short_name||""))},[s,f,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(C=>C!==T)):r([...t,T])},b=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?p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),p.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&&p.jsx("p",{className:"text-xs text-slate-600",children:n})]}):p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),t.length>0&&p.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.map(S=>{const T=s.find(C=>y(C)===S);return p.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,p.jsx("button",{type:"button",onClick:()=>r(t.filter(C=>C!==S)),className:"hover:text-white",children:p.jsx(vo,{size:14})})]},S)})}),p.jsxs("div",{className:"relative",children:[p.jsxs("div",{className:"relative",children:[p.jsx(bT,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),p.jsx("input",{type:"text",value:f,onChange:S=>h(S.target.value),onFocus:()=>v(!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&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>v(!1)}),p.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] rounded-lg shadow-xl",children:m.length===0?p.jsx("div",{className:"p-3 text-sm text-slate-500 text-center",children:"No nodes found"}):m.map(S=>p.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:[p.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)&&p.jsx(ts,{size:12,className:"text-white"})}),p.jsx("span",{className:"text-slate-200",children:b(S)})]},S.node_num))})]})]}),n&&p.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function B3(e){const[t,r]=G.useState([]),[n,i]=G.useState(!0);G.useEffect(()=>{fetch("/api/channels").then(h=>h.json()).then(h=>{r(h),i(!1)}).catch(()=>{r([]),i(!1)})},[]);const a=h=>{const d=h.role==="PRIMARY"?"Primary":h.role==="SECONDARY"?"Secondary":"";return`${h.index}: ${h.name}${d?` (${d})`:""}`};if(!n&&t.length===0)return e.mode==="single"?p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),p.jsx("input",{type:"number",value:e.value,onChange:h=>e.onChange(Number(h.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&&p.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]}):p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),p.jsx("input",{type:"text",value:e.value.join(", "),onChange:h=>{const d=h.target.value.split(",").map(v=>parseInt(v.trim())).filter(v=>!isNaN(v));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&&p.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]});if(e.mode==="single"){const{value:h,onChange:d,label:v,helper:m,includeDisabled:y}=e,x=t.filter(_=>_.enabled);return p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:v}),p.jsxs("select",{value:h,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&&p.jsx("option",{value:-1,children:"Disabled"}),x.map(_=>p.jsx("option",{value:_.index,children:a(_)},_.index))]}),m&&p.jsx("p",{className:"text-xs text-slate-600",children:m})]})}const{value:o,onChange:s,label:l,helper:u}=e,c=t.filter(h=>h.enabled),f=h=>{o.includes(h)?s(o.filter(d=>d!==h)):s([...o,h].sort((d,v)=>d-v))};return p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:l}),p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-2 space-y-1",children:[c.map(h=>p.jsxs("label",{onClick:()=>f(h.index),className:"flex items-center gap-2 p-2 rounded hover:bg-[#0a0e17] cursor-pointer",children:[p.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center ${o.includes(h.index)?"bg-accent border-accent":"border-slate-600"}`,children:o.includes(h.index)&&p.jsx(ts,{size:12,className:"text-white"})}),p.jsx("span",{className:"text-sm text-slate-200",children:a(h)})]},h.index)),c.length===0&&p.jsx("div",{className:"text-sm text-slate-500 p-2",children:"No channels available"})]}),u&&p.jsx("p",{className:"text-xs text-slate-600",children:u})]})}const S7=[{key:"bot",label:"Bot",icon:cce},{key:"connection",label:"Connection",icon:wT},{key:"response",label:"Response",icon:HN},{key:"history",label:"History",icon:aY},{key:"memory",label:"Memory",icon:fce},{key:"context",label:"Context",icon:GN},{key:"commands",label:"Commands",icon:hY},{key:"llm",label:"LLM",icon:iY},{key:"weather",label:"Weather",icon:Pu},{key:"meshmonitor",label:"MeshMonitor",icon:ho},{key:"knowledge",label:"Knowledge",icon:rY},{key:"mesh_sources",label:"Mesh Sources",icon:sY},{key:"mesh_intelligence",label:"Intelligence",icon:$v},{key:"dashboard",label:"Dashboard",icon:lY}],Mi={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."},$Qe=[{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"}],FQe=[{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 cs({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]),p.jsxs("div",{className:"relative inline-block",ref:a,children:[p.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&&p.jsxs("div",{className:"absolute left-0 top-6 z-50 w-72 p-3 bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl text-xs text-slate-300 leading-relaxed",children:[p.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:p.jsx(vo,{size:12})}),p.jsx("div",{className:"pr-4",children:e}),t&&p.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," ",p.jsx(Zd,{size:10})]})]})]})}function Pi({text:e}){return p.jsx("p",{className:"text-sm text-slate-500 mb-6 pb-4 border-b border-[#1e2a3a]",children:e})}function xt({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 p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&p.jsx(cs,{info:o,link:s})]}),p.jsxs("div",{className:"relative",children:[p.jsx("input",{type:c&&!l?"password":"text",value:t,onChange:f=>r(f.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&&p.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?p.jsx(oY,{size:16}):p.jsx(GN,{size:16})})]}),a&&p.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function qe({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s="",infoLink:l=""}){return p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&p.jsx(cs,{info:s,link:l})]}),p.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&&p.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function kr({label:e,checked:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){return p.jsxs("div",{className:"flex items-center justify-between py-2",children:[p.jsxs("div",{children:[p.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&p.jsx(cs,{info:i,link:a})]}),n&&p.jsx("p",{className:"text-xs text-slate-600",children:n})]}),p.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:p.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function vi({label:e,value:t,onChange:r,options:n,helper:i="",info:a="",infoLink:o=""}){return p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&p.jsx(cs,{info:a,link:o})]}),p.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=>p.jsx("option",{value:s.value,children:s.label},s.value))}),i&&p.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function VQe({label:e,value:t,onChange:r,rows:n=4,helper:i="",info:a="",infoLink:o=""}){return p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&p.jsx(cs,{info:a,link:o})]}),p.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&&p.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function Zc({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 p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&p.jsx(cs,{info:i,link:a})]}),p.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&&p.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function GQe({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 p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&p.jsx(cs,{info:i,link:a})]}),p.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&&p.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function Vn({label:e,description:t,checked:r,onChange:n,threshold:i,onThresholdChange:a,thresholdLabel:o,thresholdMin:s,thresholdMax:l,thresholdStep:u=1,thresholdSuffix:c=""}){return p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-3 space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex-1",children:[p.jsx("span",{className:"text-sm text-slate-300",children:e}),p.jsx("p",{className:"text-xs text-slate-600",children:t})]}),p.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:p.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&&p.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-[#1e2a3a]",children:[p.jsxs("span",{className:"text-xs text-slate-500",children:[o||"Threshold",":"]}),p.jsx("input",{type:"number",value:i,onChange:f=>a(Number(f.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&&p.jsx("span",{className:"text-xs text-slate-500",children:c})]})]})}function WQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Pi,{text:Mi.bot}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{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."}),p.jsx(xt,{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."})]}),p.jsx(kr,{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."}),p.jsx(kr,{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 HQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Pi,{text:Mi.connection}),p.jsx(vi,{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"?p.jsx(xt,{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."}):p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{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"}),p.jsx(qe,{label:"TCP Port",value:e.tcp_port,onChange:r=>t({...e,tcp_port:r}),min:1,max:65535,helper:"Default 4403 for meshtasticd"})]})]})}function UQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Pi,{text:Mi.response}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{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."}),p.jsx(qe,{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."})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{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."}),p.jsx(qe,{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 ZQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Pi,{text:Mi.history}),p.jsx(xt,{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."}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{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."}),p.jsx(qe,{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."})]}),p.jsx(kr,{label:"Auto Cleanup",checked:e.auto_cleanup,onChange:r=>t({...e,auto_cleanup:r}),helper:"Automatically prune old conversations"}),e.auto_cleanup&&p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{label:"Cleanup Interval (hours)",value:e.cleanup_interval_hours,onChange:r=>t({...e,cleanup_interval_hours:r}),min:1,helper:"Hours between cleanup runs"}),p.jsx(qe,{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 YQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Pi,{text:Mi.memory}),p.jsx(kr,{label:"Enable Memory",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Keep conversation context between messages"}),e.enabled&&p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{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."}),p.jsx(qe,{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 XQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Pi,{text:Mi.context}),p.jsx(kr,{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&&p.jsxs(p.Fragment,{children:[p.jsx(B3,{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"}),p.jsx(R3,{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."}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{label:"Max Age (sec)",value:e.max_age,onChange:r=>t({...e,max_age:r}),min:0,helper:"Ignore messages older than this"}),p.jsx(qe,{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 qQe({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 p.jsxs("div",{className:"space-y-4",children:[p.jsx(Pi,{text:Mi.commands}),p.jsx(kr,{label:"Enable Commands",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Allow !commands on the mesh"}),e.enabled&&p.jsxs(p.Fragment,{children:[p.jsx(xt,{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."}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Available Commands",p.jsx(cs,{info:"Toggle commands on or off. Disabled commands won't respond when users invoke them."})]}),p.jsx("div",{className:"grid gap-1",children:$Qe.map(i=>{const a=!r.has(i.name.toLowerCase());return p.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#0a0e17] border border-[#1e2a3a] rounded hover:border-[#2a3a4a] transition-colors",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("code",{className:"text-accent text-sm",children:["!",i.name]}),p.jsx("span",{className:"text-xs text-slate-500",children:i.description})]}),p.jsx("button",{type:"button",onClick:()=>n(i.name),className:`relative w-9 h-5 rounded-full transition-colors ${a?"bg-accent":"bg-[#1e2a3a]"}`,children:p.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 KQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Pi,{text:Mi.llm}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(vi,{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."}),p.jsx(xt,{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)."})]}),p.jsx(xt,{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."}),p.jsx(xt,{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."}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{label:"Timeout (sec)",value:e.timeout,onChange:r=>t({...e,timeout:r}),min:5,max:120,helper:"Maximum seconds to wait for response"}),p.jsx(qe,{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"})]}),p.jsx(kr,{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&&p.jsx(VQe,{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."}),p.jsx(kr,{label:"Web Search",checked:e.web_search,onChange:r=>t({...e,web_search:r}),helper:"Enable web search tool (Open WebUI feature)"}),p.jsx(kr,{label:"Google Grounding",checked:e.google_grounding,onChange:r=>t({...e,google_grounding:r}),helper:"Ground responses in web search (Gemini only)"})]})}function JQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Pi,{text:Mi.weather}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(vi,{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"}),p.jsx(vi,{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"})]}),p.jsx(xt,{label:"Default Location",value:e.default_location,onChange:r=>t({...e,default_location:r}),placeholder:"Your city, state",helper:"Location when none specified"})]})}function QQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Pi,{text:Mi.meshmonitor}),p.jsx(kr,{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&&p.jsxs(p.Fragment,{children:[p.jsx(xt,{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."}),p.jsx(kr,{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."}),p.jsx(qe,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:r=>t({...e,refresh_interval:r}),min:10,helper:"How often to fetch patterns"}),p.jsx(kr,{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 eet({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Pi,{text:Mi.knowledge}),p.jsx(kr,{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&&p.jsxs(p.Fragment,{children:[p.jsx(vi,{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")&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{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."}),p.jsx(qe,{label:"Qdrant Port",value:e.qdrant_port,onChange:r=>t({...e,qdrant_port:r}),helper:"Default 6333"})]}),p.jsx(xt,{label:"Collection",value:e.qdrant_collection,onChange:r=>t({...e,qdrant_collection:r}),helper:"Qdrant collection name"}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{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."}),p.jsx(qe,{label:"TEI Port",value:e.tei_port,onChange:r=>t({...e,tei_port:r}),helper:"Default 8090"})]}),p.jsx(kr,{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."})]}),p.jsx(xt,{label:"SQLite DB Path",value:e.db_path,onChange:r=>t({...e,db_path:r}),helper:"Local knowledge database file"}),p.jsx(qe,{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 tet({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 p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>i(!n),children:[p.jsxs("div",{className:"flex items-center gap-3",children:[n?p.jsx(Bu,{size:16}):p.jsx(Au,{size:16}),p.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`}),p.jsx("span",{className:"font-mono text-sm text-slate-200",children:e.name||"Unnamed Source"}),p.jsx("span",{className:"text-xs text-slate-500 bg-[#1e2a3a] px-2 py-0.5 rounded",children:e.type})]}),p.jsx("button",{onClick:o=>{o.stopPropagation(),r()},className:"p-1 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",children:p.jsx(O0,{size:14})})]}),n&&p.jsxs("div",{className:"p-4 space-y-4 border-t border-[#1e2a3a]",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{label:"Name",value:e.name,onChange:o=>t({...e,name:o}),helper:"Friendly name for this source"}),p.jsx(vi,{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"&&p.jsx(xt,{label:"URL",value:e.url,onChange:o=>t({...e,url:o}),helper:"Full URL including protocol"}),e.type==="meshmonitor"&&p.jsx(xt,{label:"API Token",value:e.api_token,onChange:o=>t({...e,api_token:o}),type:"password",helper:"Bearer token for authentication"}),e.type==="mqtt"&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{label:"Host",value:e.host||"",onChange:o=>t({...e,host:o}),helper:"MQTT broker hostname"}),p.jsx(qe,{label:"Port",value:e.port||1883,onChange:o=>t({...e,port:o}),min:1,max:65535,helper:"1883 plain, 8883 TLS"})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{label:"Username",value:e.username||"",onChange:o=>t({...e,username:o})}),p.jsx(xt,{label:"Password",value:e.password||"",onChange:o=>t({...e,password:o}),type:"password"})]}),p.jsx(xt,{label:"Topic Root",value:e.topic_root||"msh/US",onChange:o=>t({...e,topic_root:o}),helper:"Base topic to subscribe to"}),p.jsx(kr,{label:"Use TLS",checked:e.use_tls||!1,onChange:o=>t({...e,use_tls:o}),helper:"Encrypt MQTT connection"})]}),p.jsx(qe,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:o=>t({...e,refresh_interval:o}),min:10,helper:"Polling frequency"}),p.jsx(kr,{label:"Enabled",checked:e.enabled,onChange:o=>t({...e,enabled:o})}),p.jsx(kr,{label:"Polite Mode",checked:e.polite_mode,onChange:o=>t({...e,polite_mode:o}),helper:"Reduce polling for shared instances"})]})]})}function ret({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 p.jsxs("div",{className:"space-y-4",children:[p.jsx(Pi,{text:Mi.mesh_sources}),e.map((n,i)=>p.jsx(tet,{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)),p.jsxs("button",{onClick:r,className:"w-full py-2 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[p.jsx(Vv,{size:16})," Add Source"]})]})}function net({data:e,onChange:t}){const[r,n]=G.useState(null);return p.jsxs("div",{className:"space-y-6",children:[p.jsx(Pi,{text:Mi.mesh_intelligence}),p.jsx(kr,{label:"Enable Mesh Intelligence",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Activate health scoring and alerting"}),e.enabled&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{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."}),p.jsx(qe,{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."})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{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."}),p.jsx(qe,{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"})]}),p.jsx(R3,{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"}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(B3,{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}),p.jsx(qe,{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)."})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Regions",p.jsx(cs,{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)=>p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>n(r===a?null:a),children:[p.jsxs("div",{className:"flex items-center gap-3",children:[r===a?p.jsx(Bu,{size:16}):p.jsx(Au,{size:16}),p.jsx("span",{className:"font-medium text-slate-200",children:i.name||"Unnamed Region"}),p.jsx("span",{className:"text-xs text-slate-500",children:i.local_name})]}),p.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:p.jsx(O0,{size:14})})]}),r===a&&p.jsxs("div",{className:"p-4 space-y-3 border-t border-[#1e2a3a]",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{label:"Name",value:i.name,onChange:o=>{const s=[...e.regions];s[a]={...i,name:o},t({...e,regions:s})}}),p.jsx(xt,{label:"Local Name",value:i.local_name,onChange:o=>{const s=[...e.regions];s[a]={...i,local_name:o},t({...e,regions:s})}})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{label:"Latitude",value:i.lat,onChange:o=>{const s=[...e.regions];s[a]={...i,lat:o},t({...e,regions:s})},step:1e-4}),p.jsx(qe,{label:"Longitude",value:i.lon,onChange:o=>{const s=[...e.regions];s[a]={...i,lon:o},t({...e,regions:s})},step:1e-4})]}),p.jsx(xt,{label:"Description",value:i.description,onChange:o=>{const s=[...e.regions];s[a]={...i,description:o},t({...e,regions:s})}}),p.jsx(Zc,{label:"Aliases",value:i.aliases,onChange:o=>{const s=[...e.regions];s[a]={...i,aliases:o},t({...e,regions:s})}}),p.jsx(Zc,{label:"Cities",value:i.cities,onChange:o=>{const s=[...e.regions];s[a]={...i,cities:o},t({...e,regions:s})}})]})]},a)),p.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] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[p.jsx(Vv,{size:16})," Add Region"]})]}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Rules",p.jsx(cs,{info:"Configure which conditions trigger alerts. Each rule can have an optional threshold value."})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Infrastructure"}),p.jsx(Vn,{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}})}),p.jsx(Vn,{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}})}),p.jsx(Vn,{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}})}),p.jsx(Vn,{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}})}),p.jsx(Vn,{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}})}),p.jsx(Vn,{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}})})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Power"}),p.jsx(Vn,{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:"%"}),p.jsx(Vn,{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:"%"}),p.jsx(Vn,{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:"%"}),p.jsx(Vn,{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}})}),p.jsx(Vn,{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}})}),p.jsx(Vn,{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}})})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Utilization"}),p.jsx(Vn,{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`}),p.jsx(Vn,{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"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Health Scores"}),p.jsx(Vn,{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"}),p.jsx(Vn,{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 iet({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Pi,{text:Mi.dashboard}),p.jsx(kr,{label:"Enable Dashboard",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Run the web dashboard"}),e.enabled&&p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{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."}),p.jsx(qe,{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 aet(){var O;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,f]=G.useState(null),[h,d]=G.useState(null),[v,m]=G.useState(!1),[y,x]=G.useState(!1),_=G.useCallback(async()=>{try{const k=await fetch("/api/config");if(!k.ok)throw new Error("Failed to fetch config");const E=await k.json();t(E),n(JSON.parse(JSON.stringify(E))),x(!1),f(null)}catch(k){f(k instanceof Error?k.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 b=async()=>{if(e){u(!0),f(null),d(null);try{const k=e[i],E=await fetch(`/api/config/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)}),N=await E.json();if(!E.ok)throw new Error(N.detail||"Save failed");d(`${i} saved successfully`),n(JSON.parse(JSON.stringify(e))),x(!1),N.restart_required&&(m(!0),zce(Array.isArray(N.changed_keys)?N.changed_keys:[])),setTimeout(()=>d(null),3e3)}catch(k){f(k instanceof Error?k.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{f("Restart failed")}},C=(k,E)=>{e&&t({...e,[k]:E})};if(o)return p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-slate-400",children:"Loading configuration..."})});if(!e)return p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-red-400",children:"Failed to load configuration"})});const A=()=>{switch(i){case"bot":return p.jsx(WQe,{data:e.bot,onChange:k=>C("bot",k)});case"connection":return p.jsx(HQe,{data:e.connection,onChange:k=>C("connection",k)});case"response":return p.jsx(UQe,{data:e.response,onChange:k=>C("response",k)});case"history":return p.jsx(ZQe,{data:e.history,onChange:k=>C("history",k)});case"memory":return p.jsx(YQe,{data:e.memory,onChange:k=>C("memory",k)});case"context":return p.jsx(XQe,{data:e.context,onChange:k=>C("context",k)});case"commands":return p.jsx(qQe,{data:e.commands,onChange:k=>C("commands",k)});case"llm":return p.jsx(KQe,{data:e.llm,onChange:k=>C("llm",k)});case"weather":return p.jsx(JQe,{data:e.weather,onChange:k=>C("weather",k)});case"meshmonitor":return p.jsx(QQe,{data:e.meshmonitor,onChange:k=>C("meshmonitor",k)});case"knowledge":return p.jsx(eet,{data:e.knowledge,onChange:k=>C("knowledge",k)});case"mesh_sources":return p.jsx(ret,{data:e.mesh_sources,onChange:k=>C("mesh_sources",k)});case"mesh_intelligence":return p.jsx(net,{data:e.mesh_intelligence,onChange:k=>C("mesh_intelligence",k)});case"dashboard":return p.jsx(iet,{data:e.dashboard,onChange:k=>C("dashboard",k)});default:return null}},P=((O=S7.find(k=>k.key===i))==null?void 0:O.label)||i;return p.jsxs("div",{className:"flex gap-6 h-[calc(100vh-8rem)]",children:[p.jsx("div",{className:"w-48 flex-shrink-0 space-y-1",children:S7.map(({key:k,label:E,icon:N})=>p.jsxs("button",{onClick:()=>a(k),className:`w-full flex items-center gap-2 px-3 py-2 rounded text-sm transition-colors ${i===k?"bg-accent text-white":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover"}`,children:[p.jsx(N,{size:16}),p.jsx("span",{children:E}),y&&i===k&&p.jsx("span",{className:"ml-auto w-2 h-2 bg-amber-500 rounded-full"})]},k))}),p.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[p.jsxs("div",{className:"flex items-center justify-between mb-6",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(cY,{size:20,className:"text-slate-500"}),p.jsx("h2",{className:"text-lg font-semibold text-slate-200",children:P})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[y&&p.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:[p.jsx(xT,{size:14}),"Discard"]}),p.jsxs("button",{onClick:b,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?p.jsx(sy,{size:14,className:"animate-spin"}):p.jsx(UN,{size:14}),"Save"]})]})]}),v&&p.jsxs("div",{className:"flex items-center justify-between p-3 mb-4 bg-amber-500/10 border border-amber-500/30 rounded-lg",children:[p.jsxs("div",{className:"flex items-center gap-2 text-amber-400",children:[p.jsx(il,{size:16}),p.jsx("span",{className:"text-sm",children:"Restart required for changes to take effect"})]}),p.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&&p.jsxs("div",{className:"flex items-center gap-2 p-3 mb-4 bg-red-500/10 border border-red-500/30 rounded-lg text-red-400",children:[p.jsx(vo,{size:16}),p.jsx("span",{className:"text-sm",children:c})]}),h&&p.jsxs("div",{className:"flex items-center gap-2 p-3 mb-4 bg-green-500/10 border border-green-500/30 rounded-lg text-green-400",children:[p.jsx(ts,{size:16}),p.jsx("span",{className:"text-sm",children:h})]}),p.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:p.jsx("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:A()})})]})]})}function oet({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 p.jsxs("div",{className:"bg-bg-hover rounded-lg p-4",children:[p.jsxs("div",{className:"flex items-center justify-between mb-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:`w-2 h-2 rounded-full ${t}`}),p.jsx("span",{className:"text-sm font-medium text-slate-200 uppercase",children:e.source})]}),p.jsx("span",{className:"text-xs text-slate-400",children:r})]}),p.jsxs("div",{className:"text-xs text-slate-500 space-y-1",children:[p.jsxs("div",{children:["Events: ",e.event_count]}),p.jsxs("div",{children:["Last fetch: ",n]}),e.last_error&&p.jsx("div",{className:"text-amber-500 truncate",children:e.last_error})]})]})}function set({event:e}){const t=e.severity.toLowerCase(),r=t==="extreme"||t==="severe"||t==="immediate"?{bg:"bg-red-500/10",border:"border-red-500",Icon:Mu,color:"text-red-500"}:t==="moderate"||t==="warning"||t==="priority"?{bg:"bg-amber-500/10",border:"border-amber-500",Icon:il,color:"text-amber-500"}:{bg:"bg-blue-500/10",border:"border-blue-500",Icon:mT,color:"text-blue-500"},n=r.Icon;return p.jsx("div",{className:`p-3 rounded-lg ${r.bg} border-l-2 ${r.border}`,children:p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsx(n,{size:16,className:r.color}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[p.jsx("span",{className:"text-sm font-medium text-slate-200",children:e.event_type}),p.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${r.bg} ${r.color}`,children:e.severity})]}),p.jsx("div",{className:"text-sm text-slate-300",children:e.headline})]})]})})}function Aae({value:e,onChange:t,disabled:r,centralDisabled:n}){const i="px-2 py-1 text-xs transition-colors";return p.jsxs("div",{className:`flex rounded border border-[#1e2a3a] overflow-hidden ${r?"opacity-40":""}`,children:[p.jsx("button",{type:"button",disabled:r,onClick:()=>t("native"),className:`${i} ${e==="native"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:"native"}),p.jsx("button",{type:"button",disabled:r||n,title:n?"Central not available for this adapter":"",onClick:()=>{n||t("central")},className:`${i} ${n?"text-slate-600 cursor-not-allowed":e==="central"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:"central"})]})}function uet({title:e,subtitle:t,enabled:r,onEnabled:n,feedSource:i,onFeedSource:a,hasCentral:o,nativeOnly:s,hasKey:l,health:u,events:c,children:f}){const h=s||!o;return p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("span",{className:"text-sm font-medium text-slate-300",children:e}),t&&p.jsx("p",{className:"text-xs text-slate-600",children:t})]}),p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("span",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"source"}),p.jsx(Aae,{value:i,onChange:a,disabled:!r,centralDisabled:h})]}),p.jsx(kr,{label:"",checked:r,onChange:n})]})]}),!l&&p.jsx("div",{className:"text-xs text-amber-400 bg-amber-500/10 rounded p-2",children:"API key not configured — contact admin"}),s&&p.jsx("div",{className:"text-[11px] text-slate-600",children:"Central not available for this adapter — native only"}),p.jsx("div",{className:r?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:f}),(u||c&&c.length>0)&&p.jsxs("div",{className:"pt-2 border-t border-[#1e2a3a] space-y-3",children:[p.jsx("div",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"Live status"}),u?p.jsx(oet,{feed:u}):p.jsx("div",{className:"text-xs text-slate-600",children:"No status reported."}),c&&c.length>0&&p.jsx("div",{className:"space-y-2",children:c.slice(0,5).map((d,v)=>p.jsx(set,{event:d},v))})]})]})}const Nl={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}},ik=[{key:"central",label:"Central",icon:Tce,adapters:[]},{key:"weather",label:"Weather",icon:Pu,adapters:["nws"]},{key:"fire",label:"Fire",icon:gT,adapters:["fires","firms"]},{key:"rf",label:"RF Propagation",icon:ho,adapters:["swpc","ducting"]},{key:"roads",label:"Roads",icon:vT,adapters:["traffic","roads511","wzdx"]},{key:"geohazards",label:"Geohazards",icon:yT,adapters:["usgs_quake","usgs","avalanche"]},{key:"tracking",label:"Tracking",icon:_T,adapters:[]},{key:"mesh",label:"Mesh Health",icon:$v,adapters:[]}];function cet(){var Mp,Pp;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,f]=G.useState(!1),[h,d]=G.useState(null),[v,m]=G.useState(null),[y,x]=G.useState(!1),[_,b]=G.useState("weather"),[S,T]=G.useState("nws"),[C,A]=G.useState({allowed_incident_types:["WF"],freshness_seconds:0,cooldown_seconds:28800,broadcast_on_acres:!0,broadcast_on_contained:!0}),[P,O]=G.useState(""),[k,E]=G.useState({digest_enabled:!0,digest_schedule:["06:00","18:00"],digest_timezone:"America/Boise"}),[N,D]=G.useState(""),[z,V]=G.useState({min_magnitude:4,drop_non_present:!0,drop_zero_magnitude:!0}),[F,$]=G.useState(""),[B,H]=G.useState({min_severity:"None",enabled_categories:["incident","closure"],enabled_sub_types:["accident","road_closed","closure","lane_closed","vehicle_on_fire","flooding","debris"]}),[U,Z]=G.useState(""),[Y,K]=G.useState({broadcast:!1,min_severity:"Minor",sub_types:["road_works","lane_closed","road_closed"]}),[te,ce]=G.useState(""),[de,Oe]=G.useState({broadcast_severities:["Extreme","Severe"],duplicate_allowed_after_seconds:3600}),[ye,ne]=G.useState(""),[ve,ue]=G.useState({min_danger_level:3}),[ee,We]=G.useState(""),[be,Ve]=G.useState({geomag_kp_floor:7,flare_class_floor:"X1",proton_pfu_floor:10}),[Ze,ht]=G.useState("");G.useEffect(()=>{document.title="Environment — MeshAI",(async()=>{var Te,dr,ki,Qi,za,Qu,ae,kt,Tt,wt,Ir,ms,Bn,He,kp,Lp,Op,Ip,ch,Ep,ys,Np,vx;try{const px=await(await fetch("/api/config/environmental")).json();t(px),n(JSON.stringify(px));try{const ir=await fetch("/api/adapter-config/wfigs");if(ir.ok){const It=await ir.json(),ar={allowed_incident_types:((Te=It.allowed_incident_types)==null?void 0:Te.value)??["WF"],freshness_seconds:((dr=It.freshness_seconds)==null?void 0:dr.value)??0,cooldown_seconds:((ki=It.cooldown_seconds)==null?void 0:ki.value)??28800,broadcast_on_acres:((Qi=It.broadcast_on_acres)==null?void 0:Qi.value)??!0,broadcast_on_contained:((za=It.broadcast_on_contained)==null?void 0:za.value)??!0};A(ar),O(JSON.stringify(ar))}}catch{}try{const ir=await fetch("/api/adapter-config/fires");if(ir.ok){const It=await ir.json(),ar={digest_enabled:((Qu=It.digest_enabled)==null?void 0:Qu.value)??!0,digest_schedule:((ae=It.digest_schedule)==null?void 0:ae.value)??["06:00","18:00"],digest_timezone:((kt=It.digest_timezone)==null?void 0:kt.value)??"America/Boise"};E(ar),D(JSON.stringify(ar))}}catch{}try{const ir=await fetch("/api/adapter-config/tomtom_incidents");if(ir.ok){const It=await ir.json(),ar={min_magnitude:((Tt=It.min_magnitude)==null?void 0:Tt.value)??4,drop_non_present:((wt=It.drop_non_present)==null?void 0:wt.value)??!0,drop_zero_magnitude:((Ir=It.drop_zero_magnitude)==null?void 0:Ir.value)??!0};V(ar),$(JSON.stringify(ar))}}catch{}try{const ir=await fetch("/api/adapter-config/itd_511");if(ir.ok){const It=await ir.json(),ar={min_severity:((ms=It.min_severity)==null?void 0:ms.value)??"None",enabled_categories:((Bn=It.enabled_categories)==null?void 0:Bn.value)??["incident","closure"],enabled_sub_types:((He=It.enabled_sub_types)==null?void 0:He.value)??["accident","road_closed","closure","lane_closed","vehicle_on_fire","flooding","debris"]};H(ar),Z(JSON.stringify(ar))}}catch{}try{const ir=await fetch("/api/adapter-config/wzdx");if(ir.ok){const It=await ir.json(),ar={broadcast:((kp=It.broadcast)==null?void 0:kp.value)??!1,min_severity:((Lp=It.min_severity)==null?void 0:Lp.value)??"Minor",sub_types:((Op=It.sub_types)==null?void 0:Op.value)??["road_works","lane_closed","road_closed"]};K(ar),ce(JSON.stringify(ar))}}catch{}try{const ir=await fetch("/api/adapter-config/nws");if(ir.ok){const It=await ir.json(),ar={broadcast_severities:((Ip=It.broadcast_severities)==null?void 0:Ip.value)??["Extreme","Severe"],duplicate_allowed_after_seconds:((ch=It.duplicate_allowed_after_seconds)==null?void 0:ch.value)??3600};Oe(ar),ne(JSON.stringify(ar))}}catch{}try{const ir=await fetch("/api/adapter-config/avalanche");if(ir.ok){const ar={min_danger_level:((Ep=(await ir.json()).min_danger_level)==null?void 0:Ep.value)??3};ue(ar),We(JSON.stringify(ar))}}catch{}try{const ir=await fetch("/api/adapter-config/swpc");if(ir.ok){const It=await ir.json(),ar={geomag_kp_floor:((ys=It.geomag_kp_floor)==null?void 0:ys.value)??7,flare_class_floor:((Np=It.flare_class_floor)==null?void 0:Np.value)??"X1",proton_pfu_floor:((vx=It.proton_pfu_floor)==null?void 0:vx.value)??10};Ve(ar),ht(JSON.stringify(ar))}}catch{}}catch(Dp){d(Dp instanceof Error?Dp.message:"Failed to load config")}finally{u(!1)}})()},[]),G.useEffect(()=>{const Te=async()=>{try{a(await pY()),s(await gY())}catch{}};Te();const dr=setInterval(Te,3e4);return()=>clearInterval(dr)},[]);const Bt=e!==null&&JSON.stringify(e)!==r,Kt=JSON.stringify(C)!==P,cn=JSON.stringify(k)!==N,Or=JSON.stringify(z)!==F,wn=JSON.stringify(B)!==U,ps=JSON.stringify(Y)!==te,qu=JSON.stringify(de)!==ye,Ku=JSON.stringify(ve)!==ee,uh=JSON.stringify(be)!==Ze,lx=Bt||Kt||cn||Or||wn||ps||qu||Ku||uh,Jt=async(Te,dr,ki)=>{const Qi=await fetch(`/api/adapter-config/${Te}/${dr}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:ki})});if(!Qi.ok){const za=await Qi.json().catch(()=>({}));throw new Error(za.detail||`Failed to save ${Te}.${dr}`)}},tA=async()=>{if(e){f(!0),d(null),m(null);try{if(Bt){const Te=await fetch("/api/config/environmental",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),dr=await Te.json();if(!Te.ok)throw new Error(dr.detail||"Save failed");n(JSON.stringify(e)),dr.restart_required&&x(!0)}if(Kt){const Te=JSON.parse(P);C.freshness_seconds!==Te.freshness_seconds&&await Jt("wfigs","freshness_seconds",C.freshness_seconds),JSON.stringify(C.allowed_incident_types)!==JSON.stringify(Te.allowed_incident_types)&&await Jt("wfigs","allowed_incident_types",C.allowed_incident_types),C.cooldown_seconds!==Te.cooldown_seconds&&await Jt("wfigs","cooldown_seconds",C.cooldown_seconds),C.broadcast_on_acres!==Te.broadcast_on_acres&&await Jt("wfigs","broadcast_on_acres",C.broadcast_on_acres),C.broadcast_on_contained!==Te.broadcast_on_contained&&await Jt("wfigs","broadcast_on_contained",C.broadcast_on_contained),O(JSON.stringify(C))}if(cn){const Te=JSON.parse(N);k.digest_enabled!==Te.digest_enabled&&await Jt("fires","digest_enabled",k.digest_enabled),JSON.stringify(k.digest_schedule)!==JSON.stringify(Te.digest_schedule)&&await Jt("fires","digest_schedule",k.digest_schedule),k.digest_timezone!==Te.digest_timezone&&await Jt("fires","digest_timezone",k.digest_timezone),D(JSON.stringify(k))}if(Or){const Te=JSON.parse(F);z.min_magnitude!==Te.min_magnitude&&await Jt("tomtom_incidents","min_magnitude",z.min_magnitude),z.drop_non_present!==Te.drop_non_present&&await Jt("tomtom_incidents","drop_non_present",z.drop_non_present),z.drop_zero_magnitude!==Te.drop_zero_magnitude&&await Jt("tomtom_incidents","drop_zero_magnitude",z.drop_zero_magnitude),$(JSON.stringify(z))}if(wn){const Te=JSON.parse(U);B.min_severity!==Te.min_severity&&await Jt("itd_511","min_severity",B.min_severity),JSON.stringify(B.enabled_categories)!==JSON.stringify(Te.enabled_categories)&&await Jt("itd_511","enabled_categories",B.enabled_categories),JSON.stringify(B.enabled_sub_types)!==JSON.stringify(Te.enabled_sub_types)&&await Jt("itd_511","enabled_sub_types",B.enabled_sub_types),Z(JSON.stringify(B))}if(ps){const Te=JSON.parse(te);Y.broadcast!==Te.broadcast&&await Jt("wzdx","broadcast",Y.broadcast),Y.min_severity!==Te.min_severity&&await Jt("wzdx","min_severity",Y.min_severity),JSON.stringify(Y.sub_types)!==JSON.stringify(Te.sub_types)&&await Jt("wzdx","sub_types",Y.sub_types),ce(JSON.stringify(Y))}if(qu){const Te=JSON.parse(ye);JSON.stringify(de.broadcast_severities)!==JSON.stringify(Te.broadcast_severities)&&await Jt("nws","broadcast_severities",de.broadcast_severities),de.duplicate_allowed_after_seconds!==Te.duplicate_allowed_after_seconds&&await Jt("nws","duplicate_allowed_after_seconds",de.duplicate_allowed_after_seconds),ne(JSON.stringify(de))}if(Ku){const Te=JSON.parse(ee);ve.min_danger_level!==Te.min_danger_level&&await Jt("avalanche","min_danger_level",ve.min_danger_level),We(JSON.stringify(ve))}if(uh){const Te=JSON.parse(Ze);be.geomag_kp_floor!==Te.geomag_kp_floor&&await Jt("swpc","geomag_kp_floor",be.geomag_kp_floor),be.flare_class_floor!==Te.flare_class_floor&&await Jt("swpc","flare_class_floor",be.flare_class_floor),be.proton_pfu_floor!==Te.proton_pfu_floor&&await Jt("swpc","proton_pfu_floor",be.proton_pfu_floor),ht(JSON.stringify(be))}m("Config saved"),setTimeout(()=>m(null),3e3)}catch(Te){d(Te instanceof Error?Te.message:"Save failed")}finally{f(!1)}}},ux=()=>{e&&t(JSON.parse(r)),A(JSON.parse(P||JSON.stringify(C))),E(JSON.parse(N||JSON.stringify(k))),V(JSON.parse(F||JSON.stringify(z))),H(JSON.parse(U||JSON.stringify(B))),K(JSON.parse(te||JSON.stringify(Y))),Oe(JSON.parse(ye||JSON.stringify(de))),ue(JSON.parse(ee||JSON.stringify(ve))),Ve(JSON.parse(Ze||JSON.stringify(be)))},cx=async()=>{try{await fetch("/api/restart",{method:"POST"}),x(!1),m("Restart initiated")}catch{d("Restart failed")}},Je=Te=>e&&t({...e,...Te});if(l)return p.jsx("div",{className:"flex items-center justify-center h-64 text-slate-400",children:"Loading environmental config…"});if(!e)return p.jsx("div",{className:"flex items-center justify-center h-64 text-red-400",children:h||"No config"});const fx=Te=>i==null?void 0:i.feeds.find(dr=>dr.source===Nl[Te].health),Ap=Te=>o.filter(dr=>dr.source===Nl[Te].health),gs=ik.find(Te=>Te.key===_),Rn=gs.adapters.length===0?null:S&&gs.adapters.includes(S)?S:gs.adapters[0],Ju=Te=>{var dr,ki,Qi,za,Qu;switch(Te){case"nws":return p.jsxs(p.Fragment,{children:[p.jsx(Zc,{label:"NWS Zones",value:e.nws_zones,onChange:ae=>Je({nws_zones:ae}),helper:"Zone IDs like IDZ016, IDZ030",infoLink:"https://www.weather.gov/pimar/PubZone"}),e.nws.feed_source!=="central"&&p.jsxs(p.Fragment,{children:[p.jsx(xt,{label:"User Agent",value:e.nws.user_agent,onChange:ae=>Je({nws:{...e.nws,user_agent:ae}}),placeholder:"(MeshAI, you@email.com)",helper:"Format: (app_name, contact_email)"}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{label:"Tick Seconds",value:e.nws.tick_seconds,onChange:ae=>Je({nws:{...e.nws,tick_seconds:ae}}),min:30}),p.jsx(vi,{label:"Min Severity",value:e.nws.severity_min,onChange:ae=>Je({nws:{...e.nws,severity_min:ae}}),options:[{value:"minor",label:"Minor"},{value:"moderate",label:"Moderate"},{value:"severe",label:"Severe"},{value:"extreme",label:"Extreme"}]})]})]}),e.nws.feed_source==="central"&&p.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Filters"}),p.jsxs("div",{className:"mb-3",children:[p.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Severities to broadcast"}),p.jsx("div",{className:"flex gap-6",children:["Extreme","Severe","Moderate","Minor"].map(ae=>p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:de.broadcast_severities.includes(ae),onChange:kt=>{const Tt=de.broadcast_severities;Oe({...de,broadcast_severities:kt.target.checked?[...Tt,ae]:Tt.filter(wt=>wt!==ae)})},className:"w-4 h-4 rounded accent-blue-500"}),p.jsx("span",{className:"text-sm text-slate-300",children:ae})]},ae))})]}),p.jsx(qe,{label:"Re-broadcast Cooldown (seconds)",value:de.duplicate_allowed_after_seconds,onChange:ae=>Oe({...de,duplicate_allowed_after_seconds:ae}),min:0,helper:"Minimum seconds before the same alert ID can be re-broadcast"})]})]});case"swpc":return p.jsx("div",{className:"space-y-6",children:p.jsxs("div",{children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Thresholds"}),p.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[p.jsx(vi,{label:"Geomag Kp Floor",value:String(be.geomag_kp_floor),onChange:ae=>Ve({...be,geomag_kp_floor:Number(ae)}),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"}),p.jsx(vi,{label:"Flare Class Floor",value:be.flare_class_floor,onChange:ae=>Ve({...be,flare_class_floor:ae}),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"}),p.jsx(vi,{label:"Proton pfu Floor",value:String(be.proton_pfu_floor),onChange:ae=>Ve({...be,proton_pfu_floor:Number(ae)}),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 p.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[p.jsx(qe,{label:"Tick Seconds",value:e.ducting.tick_seconds,onChange:ae=>Je({ducting:{...e.ducting,tick_seconds:ae}}),min:60}),p.jsx(qe,{label:"Latitude",value:e.ducting.latitude,onChange:ae=>Je({ducting:{...e.ducting,latitude:ae}}),step:.01}),p.jsx(qe,{label:"Longitude",value:e.ducting.longitude,onChange:ae=>Je({ducting:{...e.ducting,longitude:ae}}),step:.01})]});case"fires":return p.jsxs("div",{className:"space-y-6",children:[e.fires.feed_source!=="central"&&p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{label:"Tick Seconds",value:e.fires.tick_seconds,onChange:ae=>Je({fires:{...e.fires,tick_seconds:ae}}),min:60}),p.jsx(vi,{label:"State",value:e.fires.state,onChange:ae=>Je({fires:{...e.fires,state:ae}}),options:FQe})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Incident Types"}),p.jsx("div",{className:"flex gap-6",children:[["WF","Wildfire"],["RX","Prescribed Burn"],["OTHER","Other"]].map(([ae,kt])=>{var Tt;return p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:((Tt=C.allowed_incident_types)==null?void 0:Tt.includes(ae))??ae==="WF",onChange:wt=>{const Ir=C.allowed_incident_types??["WF"];A({...C,allowed_incident_types:wt.target.checked?[...Ir,ae]:Ir.filter(ms=>ms!==ae)})},className:"w-4 h-4 rounded accent-blue-500"}),p.jsx("span",{className:"text-sm text-slate-300",children:kt})]},ae)})})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Triggers"}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("label",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-sm text-slate-300",children:"Broadcast on acres increase"}),p.jsx("input",{type:"checkbox",checked:C.broadcast_on_acres,onChange:ae=>A({...C,broadcast_on_acres:ae.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]}),p.jsxs("label",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-sm text-slate-300",children:"Broadcast on containment increase"}),p.jsx("input",{type:"checkbox",checked:C.broadcast_on_contained,onChange:ae=>A({...C,broadcast_on_contained:ae.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]})]})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{label:"Update Cooldown (hours)",value:Math.round(C.cooldown_seconds/3600),onChange:ae=>A({...C,cooldown_seconds:ae*3600}),min:0,helper:"Minimum hours between updates for the same fire"}),p.jsx(qe,{label:"Freshness Window (hours)",value:Math.round(C.freshness_seconds/3600),onChange:ae=>A({...C,freshness_seconds:ae*3600}),min:0,helper:"0 = always broadcast regardless of event age"})]})]});case"avalanche":return p.jsxs("div",{className:"space-y-6",children:[e.avalanche.feed_source!=="central"&&p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{label:"Tick Seconds",value:e.avalanche.tick_seconds,onChange:ae=>Je({avalanche:{...e.avalanche,tick_seconds:ae}}),min:60}),p.jsx(GQe,{label:"Season Months",value:e.avalanche.season_months,onChange:ae=>Je({avalanche:{...e.avalanche,season_months:ae}}),helper:"e.g., 12, 1, 2, 3, 4"})]}),p.jsx(Zc,{label:"Center IDs",value:e.avalanche.center_ids,onChange:ae=>Je({avalanche:{...e.avalanche,center_ids:ae}}),helper:"e.g., SNFAC",infoLink:"https://avalanche.org/avalanche-centers/"}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Settings"}),p.jsx("div",{className:"grid grid-cols-2 gap-4",children:p.jsx(vi,{label:"Min Danger Level",value:String(ve.min_danger_level),onChange:ae=>ue({...ve,min_danger_level:Number(ae)}),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 p.jsxs(p.Fragment,{children:[p.jsx(qe,{label:"Tick Seconds",value:e.usgs.tick_seconds,onChange:ae=>Je({usgs:{...e.usgs,tick_seconds:ae}}),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."}),p.jsx(Zc,{label:"Site IDs",value:e.usgs.sites,onChange:ae=>Je({usgs:{...e.usgs,sites:ae}}),helper:"USGS gauge site numbers",infoLink:"https://waterdata.usgs.gov/nwis"})]});case"usgs_quake":return p.jsxs("div",{className:"space-y-6",children:[e.usgs_quake.feed_source!=="central"&&p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{label:"Tick Seconds",value:e.usgs_quake.tick_seconds,onChange:ae=>Je({usgs_quake:{...e.usgs_quake,tick_seconds:ae}}),min:60}),p.jsx(xt,{label:"Region Tag",value:e.usgs_quake.region,onChange:ae=>Je({usgs_quake:{...e.usgs_quake,region:ae}})})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Magnitude Thresholds"}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(qe,{label:"Global Floor",value:e.usgs_quake.global_mag_floor,onChange:ae=>Je({usgs_quake:{...e.usgs_quake,global_mag_floor:ae}}),step:.1,min:0,helper:"Broadcast anywhere at or above this magnitude"}),p.jsx(qe,{label:"Regional Floor",value:e.usgs_quake.regional_mag_floor,onChange:ae=>Je({usgs_quake:{...e.usgs_quake,regional_mag_floor:ae}}),step:.1,min:0,helper:"Reduced floor within regional radius"}),p.jsx(qe,{label:"Regional Radius (mi)",value:e.usgs_quake.regional_radius_mi,onChange:ae=>Je({usgs_quake:{...e.usgs_quake,regional_radius_mi:ae}}),min:50,helper:"Radius around region centroid for reduced floor"}),p.jsx(qe,{label:"Escalation Floor",value:e.usgs_quake.escalate_mag_floor,onChange:ae=>Je({usgs_quake:{...e.usgs_quake,escalate_mag_floor:ae}}),step:.1,min:0,helper:"Magnitude at which broadcast uses warning emoji"})]})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"PAGER Alert Levels"}),p.jsx("div",{className:"text-xs text-slate-500 mb-2",children:"Broadcast at any magnitude when USGS PAGER alert reaches these levels"}),p.jsx("div",{className:"flex gap-6",children:["green","yellow","orange","red"].map(ae=>p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:(e.usgs_quake.broadcast_pager_alerts??[]).includes(ae),onChange:kt=>{const Tt=e.usgs_quake.broadcast_pager_alerts??[];Je({usgs_quake:{...e.usgs_quake,broadcast_pager_alerts:kt.target.checked?[...Tt,ae]:Tt.filter(wt=>wt!==ae)}})},className:"w-4 h-4 rounded accent-blue-500"}),p.jsx("span",{className:"text-sm text-slate-300 capitalize",children:ae})]},ae))})]})]});case"traffic":return p.jsxs(p.Fragment,{children:[p.jsx(xt,{label:"API Key",value:e.traffic.api_key,onChange:ae=>Je({traffic:{...e.traffic,api_key:ae}}),type:"password",helper:"developer.tomtom.com"}),p.jsx(qe,{label:"Tick Seconds",value:e.traffic.tick_seconds,onChange:ae=>Je({traffic:{...e.traffic,tick_seconds:ae}}),min:60}),p.jsx("div",{className:"text-xs text-slate-500 mt-2",children:"Corridors:"}),(e.traffic.corridors||[]).map((ae,kt)=>p.jsxs("div",{className:"grid grid-cols-4 gap-2 items-end",children:[p.jsx(xt,{label:"Name",value:ae.name,onChange:Tt=>{const wt=[...e.traffic.corridors];wt[kt]={...ae,name:Tt},Je({traffic:{...e.traffic,corridors:wt}})}}),p.jsx(qe,{label:"Lat",value:ae.lat,onChange:Tt=>{const wt=[...e.traffic.corridors];wt[kt]={...ae,lat:Tt},Je({traffic:{...e.traffic,corridors:wt}})},step:.01}),p.jsx(qe,{label:"Lon",value:ae.lon,onChange:Tt=>{const wt=[...e.traffic.corridors];wt[kt]={...ae,lon:Tt},Je({traffic:{...e.traffic,corridors:wt}})},step:.01}),p.jsx("button",{onClick:()=>Je({traffic:{...e.traffic,corridors:e.traffic.corridors.filter((Tt,wt)=>wt!==kt)}}),className:"px-2 py-2 text-xs text-red-400 hover:text-red-300 border border-red-400/30 rounded",children:"Remove"})]},kt)),p.jsx("button",{onClick:()=>Je({traffic:{...e.traffic,corridors:[...e.traffic.corridors||[],{name:"",lat:0,lon:0}]}}),className:"text-xs text-accent hover:underline",children:"+ Add Corridor"}),p.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Filters"}),p.jsx("div",{className:"grid grid-cols-2 gap-4",children:p.jsxs("div",{children:[p.jsx("label",{className:"text-xs text-slate-400 mb-1 block",children:"Minimum Magnitude"}),p.jsxs("select",{value:z.min_magnitude,onChange:ae=>V({...z,min_magnitude:parseInt(ae.target.value)}),className:"w-full bg-slate-900 border border-slate-700 rounded px-3 py-2 text-sm",children:[p.jsx("option",{value:1,children:"1 — Minor (all)"}),p.jsx("option",{value:2,children:"2 — Moderate (yellow+)"}),p.jsx("option",{value:3,children:"3 — Major (orange+)"}),p.jsx("option",{value:4,children:"4 — Severe (red only)"})]}),p.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Drop TomTom incidents below this severity level"})]})}),p.jsxs("div",{className:"mt-3 space-y-2",children:[p.jsxs("label",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-sm text-slate-300",children:"Drop non-present time validity"}),p.jsx("input",{type:"checkbox",checked:z.drop_non_present,onChange:ae=>V({...z,drop_non_present:ae.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]}),p.jsxs("label",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-sm text-slate-300",children:"Drop zero-magnitude events"}),p.jsx("input",{type:"checkbox",checked:z.drop_zero_magnitude,onChange:ae=>V({...z,drop_zero_magnitude:ae.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]})]})]})]});case"roads511":return p.jsxs(p.Fragment,{children:[p.jsx(xt,{label:"Base URL",value:e.roads511.base_url,onChange:ae=>Je({roads511:{...e.roads511,base_url:ae}}),placeholder:"https://511.yourstate.gov/api/v2"}),p.jsx(xt,{label:"API Key",value:e.roads511.api_key,onChange:ae=>Je({roads511:{...e.roads511,api_key:ae}}),type:"password",helper:"Leave empty if not required"}),p.jsx(qe,{label:"Tick Seconds",value:e.roads511.tick_seconds,onChange:ae=>Je({roads511:{...e.roads511,tick_seconds:ae}}),min:60}),p.jsx(Zc,{label:"Endpoints",value:e.roads511.endpoints,onChange:ae=>Je({roads511:{...e.roads511,endpoints:ae}}),helper:"e.g., /get/event"}),p.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((ae,kt)=>{var Tt;return p.jsx(qe,{label:ae,value:((Tt=e.roads511.bbox)==null?void 0:Tt[kt])??0,onChange:wt=>{const Ir=[...e.roads511.bbox||[0,0,0,0]];Ir[kt]=wt,Je({roads511:{...e.roads511,bbox:Ir}})},step:.01},ae)})}),p.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Filters"}),p.jsx("div",{className:"grid grid-cols-2 gap-4",children:p.jsxs("div",{children:[p.jsx("label",{className:"text-xs text-slate-400 mb-1 block",children:"Minimum Severity"}),p.jsxs("select",{value:B.min_severity,onChange:ae=>H({...B,min_severity:ae.target.value}),className:"w-full bg-slate-900 border border-slate-700 rounded px-3 py-2 text-sm",children:[p.jsx("option",{value:"None",children:"None (all)"}),p.jsx("option",{value:"Minor",children:"Minor+"}),p.jsx("option",{value:"Major",children:"Major only"})]}),p.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Drop ITD 511 events below this severity"})]})}),p.jsxs("div",{className:"mt-4",children:[p.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Categories"}),p.jsx("div",{className:"flex gap-6",children:[["incident","Incident"],["closure","Closure"],["special_event","Special Event"]].map(([ae,kt])=>p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:B.enabled_categories.includes(ae),onChange:Tt=>{const wt=B.enabled_categories;H({...B,enabled_categories:Tt.target.checked?[...wt,ae]:wt.filter(Ir=>Ir!==ae)})},className:"w-4 h-4 rounded accent-blue-500"}),p.jsx("span",{className:"text-sm text-slate-300",children:kt})]},ae))})]}),p.jsxs("div",{className:"mt-4",children:[p.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Sub-types"}),p.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(([ae,kt])=>p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:B.enabled_sub_types.includes(ae),onChange:Tt=>{const wt=B.enabled_sub_types;H({...B,enabled_sub_types:Tt.target.checked?[...wt,ae]:wt.filter(Ir=>Ir!==ae)})},className:"w-4 h-4 rounded accent-blue-500"}),p.jsx("span",{className:"text-sm text-slate-300",children:kt})]},ae))})]})]})]});case"wzdx":return p.jsxs(p.Fragment,{children:[((dr=e.wzdx)==null?void 0:dr.feed_source)!=="central"&&p.jsxs(p.Fragment,{children:[p.jsx(xt,{label:"Base URL",value:((ki=e.wzdx)==null?void 0:ki.base_url)??"",onChange:ae=>Je({wzdx:{...e.wzdx,base_url:ae}}),placeholder:"https://511.yourstate.gov/api/v2"}),p.jsx(xt,{label:"API Key",value:((Qi=e.wzdx)==null?void 0:Qi.api_key)??"",onChange:ae=>Je({wzdx:{...e.wzdx,api_key:ae}}),type:"password",helper:"Leave empty if not required"}),p.jsx(qe,{label:"Tick Seconds",value:((za=e.wzdx)==null?void 0:za.tick_seconds)??300,onChange:ae=>Je({wzdx:{...e.wzdx,tick_seconds:ae}}),min:60}),p.jsx(Zc,{label:"Endpoints",value:((Qu=e.wzdx)==null?void 0:Qu.endpoints)??["/get/event"],onChange:ae=>Je({wzdx:{...e.wzdx,endpoints:ae}}),helper:"e.g., /get/event"}),p.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((ae,kt)=>{var Tt,wt;return p.jsx(qe,{label:ae,value:((wt=(Tt=e.wzdx)==null?void 0:Tt.bbox)==null?void 0:wt[kt])??0,onChange:Ir=>{var Bn;const ms=[...((Bn=e.wzdx)==null?void 0:Bn.bbox)||[0,0,0,0]];ms[kt]=Ir,Je({wzdx:{...e.wzdx,bbox:ms}})},step:.01},ae)})}),p.jsx("div",{className:"text-xs text-slate-500",children:"Bounding box [W,S,E,N] geographic filter"})]}),p.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Settings"}),p.jsxs("label",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-sm text-slate-300",children:"Broadcast work zone events"}),p.jsx("input",{type:"checkbox",checked:Y.broadcast,onChange:ae=>K({...Y,broadcast:ae.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]}),Y.broadcast?p.jsxs("div",{className:"space-y-3 mt-3",children:[p.jsxs("div",{children:[p.jsx("label",{className:"text-xs text-slate-400 mb-1 block",children:"Min Severity"}),p.jsxs("select",{value:Y.min_severity,onChange:ae=>K({...Y,min_severity:ae.target.value}),className:"w-full bg-slate-900 border border-slate-700 rounded px-3 py-2 text-sm",children:[p.jsx("option",{value:"None",children:"None (all)"}),p.jsx("option",{value:"Minor",children:"Minor+"}),p.jsx("option",{value:"Major",children:"Major only"})]})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Sub-types"}),p.jsx("div",{className:"flex gap-6",children:[["road_works","Road Works"],["lane_closed","Lane Closure"],["road_closed","Road Closed"]].map(([ae,kt])=>p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:Y.sub_types.includes(ae),onChange:Tt=>{const wt=Y.sub_types;K({...Y,sub_types:Tt.target.checked?[...wt,ae]:wt.filter(Ir=>Ir!==ae)})},className:"w-4 h-4 rounded accent-blue-500"}),p.jsx("span",{className:"text-sm text-slate-300",children:kt})]},ae))})]})]}):p.jsxs("p",{className:"text-xs text-slate-500 mt-2",children:["Work zone events stored for LLM context only ","—"," no mesh broadcasts."]})]})]});case"firms":return p.jsxs(p.Fragment,{children:[p.jsx(xt,{label:"MAP Key",value:e.firms.map_key,onChange:ae=>Je({firms:{...e.firms,map_key:ae}}),type:"password",helper:"firms.modaps.eosdis.nasa.gov/api/area/",infoLink:"https://firms.modaps.eosdis.nasa.gov/api/area/"}),p.jsx(qe,{label:"Tick Seconds",value:e.firms.tick_seconds,onChange:ae=>Je({firms:{...e.firms,tick_seconds:ae}}),min:300}),p.jsx(vi,{label:"Satellite Source",value:e.firms.source,onChange:ae=>Je({firms:{...e.firms,source:ae}}),options:[{value:"VIIRS_SNPP_NRT",label:"VIIRS SNPP (NRT)"},{value:"VIIRS_NOAA20_NRT",label:"VIIRS NOAA-20 (NRT)"},{value:"MODIS_NRT",label:"MODIS (NRT)"}]}),p.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[p.jsx(qe,{label:"Day Range",value:e.firms.day_range,onChange:ae=>Je({firms:{...e.firms,day_range:ae}}),min:1,max:10}),p.jsx(vi,{label:"Min Confidence",value:e.firms.confidence_min,onChange:ae=>Je({firms:{...e.firms,confidence_min:ae}}),options:[{value:"low",label:"Low"},{value:"nominal",label:"Nominal"},{value:"high",label:"High"}]}),p.jsx(qe,{label:"Proximity (km)",value:e.firms.proximity_km,onChange:ae=>Je({firms:{...e.firms,proximity_km:ae}}),step:.5})]}),p.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((ae,kt)=>{var Tt;return p.jsx(qe,{label:ae,value:((Tt=e.firms.bbox)==null?void 0:Tt[kt])??0,onChange:wt=>{const Ir=[...e.firms.bbox||[0,0,0,0]];Ir[kt]=wt,Je({firms:{...e.firms,bbox:Ir}})},step:.01},ae)})})]})}},hx=e,dx=(Te,dr)=>{const ki=e[Te]||{};Je({[Te]:{...ki,...dr}})};return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h1",{className:"text-xl font-semibold text-slate-200",children:"Environment"}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(kr,{label:"Feeds Enabled",checked:e.enabled,onChange:Te=>Je({enabled:Te})}),lx&&p.jsxs(p.Fragment,{children:[p.jsxs("button",{onClick:ux,className:"flex items-center gap-1 px-3 py-1.5 text-sm text-slate-400 hover:text-slate-200 border border-border rounded",children:[p.jsx(xT,{size:14})," Discard"]}),p.jsxs("button",{onClick:tA,disabled:c,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-accent text-white rounded disabled:opacity-50",children:[p.jsx(UN,{size:14})," ",c?"Saving…":"Save"]})]})]})]}),h&&p.jsx("div",{className:"text-sm text-red-400 bg-red-500/10 rounded p-3",children:h}),v&&p.jsx("div",{className:"text-sm text-green-400 bg-green-500/10 rounded p-3",children:v}),y&&p.jsxs("div",{className:"flex items-center justify-between text-sm text-amber-400 bg-amber-500/10 border border-amber-500/30 rounded p-3",children:[p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(sy,{size:14})," A restart is required for some changes to take effect."]}),p.jsx("button",{onClick:cx,className:"px-3 py-1 bg-amber-500/20 hover:bg-amber-500/30 rounded",children:"Restart now"})]}),p.jsx("div",{className:"flex gap-1 border-b border-border overflow-x-auto",children:ik.map(({key:Te,label:dr,icon:ki})=>p.jsxs("button",{onClick:()=>{b(Te);const Qi=ik.find(za=>za.key===Te);T(Qi.adapters[0]??null)},className:`flex items-center gap-2 px-4 py-2 text-sm whitespace-nowrap border-b-2 -mb-px transition-colors ${_===Te?"border-accent text-accent":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[p.jsx(ki,{size:15})," ",dr]},Te))}),_==="central"&&e.central&&p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Central Connection"}),p.jsx("p",{className:"text-xs text-slate-600",children:'NATS JetStream source for any adapter set to "central"'})]}),p.jsx(kr,{label:"",checked:!!e.central.enabled,onChange:Te=>Je({central:{...e.central,enabled:Te}})})]}),p.jsxs("div",{className:e.central.enabled?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:[p.jsx(xt,{label:"URL",value:e.central.url||"",onChange:Te=>Je({central:{...e.central,url:Te}}),placeholder:"nats://central.echo6.mesh:4222"}),p.jsx(xt,{label:"Durable",value:e.central.durable||"",onChange:Te=>Je({central:{...e.central,durable:Te}}),placeholder:"meshai-v04"}),p.jsx(xt,{label:"Region",value:e.central.region||"",onChange:Te=>Je({central:{...e.central,region:Te}}),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"&&p.jsxs("div",{className:"flex flex-col items-center justify-center h-[40vh] text-center",children:[p.jsx(_T,{size:32,className:"text-slate-600 mb-4"}),p.jsx("p",{className:"text-slate-500 max-w-md",children:"No adapters yet. ADS-B / AIS / satellite passes are planned for v0.5."})]}),_==="mesh"&&p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Mesh Health"}),p.jsx("p",{className:"text-xs text-slate-600",children:"Node/infra telemetry — sourced from the mesh, not an environmental feed."})]}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("span",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"source"}),p.jsx(Aae,{value:"native",onChange:()=>{},disabled:!1,centralDisabled:!0})]})]}),p.jsx("div",{className:"text-[11px] text-slate-600",children:"Central not available — reserved for a future migration."})]}),gs.adapters.length>0&&Rn&&p.jsxs(p.Fragment,{children:[gs.adapters.length>1&&p.jsx("div",{className:"flex gap-1",children:gs.adapters.map(Te=>p.jsx("button",{onClick:()=>T(Te),className:`px-3 py-1.5 text-sm rounded ${Rn===Te?"bg-bg-hover text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:Nl[Te].label},Te))}),p.jsx(uet,{title:Nl[Rn].label,subtitle:Nl[Rn].subtitle,enabled:((Mp=hx[Rn])==null?void 0:Mp.enabled)??!1,onEnabled:Te=>dx(Rn,{enabled:Te}),feedSource:((Pp=hx[Rn])==null?void 0:Pp.feed_source)??"native",onFeedSource:Te=>dx(Rn,{feed_source:Te}),hasCentral:Nl[Rn].hasCentral,nativeOnly:Nl[Rn].nativeOnly,hasKey:Nl[Rn].hasKey,health:fx(Rn),events:Ap(Rn),children:Ju(Rn)})]})]})}const T7={infra_offline:dY,infra_recovery:wT,battery_warning:e2,battery_critical:e2,battery_emergency:e2,hf_blackout:ly,uhf_ducting:ho,weather_warning:Pu,weather_watch:Pu,new_router:ho,packet_flood:il,sustained_high_util:il,region_blackout:Mu,default:oy};function fet(e){return T7[e]||T7.default}function Mae(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-blue-500/10",border:"border-blue-500",badge:"bg-blue-500/20 text-blue-400",iconColor:"text-blue-500"}}}function het(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 det(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 vet(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 pet({alert:e,onAcknowledge:t}){var i;const r=Mae(e.severity),n=fet(e.type);return p.jsx("div",{className:`p-4 rounded-lg ${r.bg} border-l-4 ${r.border}`,children:p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsx(n,{size:20,className:r.iconColor}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[p.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${r.badge}`,children:(i=e.severity)==null?void 0:i.toUpperCase()}),p.jsx("span",{className:"text-xs text-slate-500",children:e.type})]}),p.jsx("div",{className:"text-sm text-slate-200",children:e.message}),p.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-slate-500",children:[p.jsxs("span",{className:"flex items-center gap-1",children:[p.jsx(Pf,{size:12}),e.timestamp?het(e.timestamp):"Just now"]}),e.scope_value&&p.jsxs("span",{children:[e.scope_type,": ",e.scope_value]})]})]}),p.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 get({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 p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg",children:[p.jsxs("div",{className:"p-4 border-b border-border flex items-center gap-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(WN,{size:14,className:"text-slate-400"}),p.jsx("span",{className:"text-sm text-slate-400",children:"Filter:"})]}),p.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-blue-500",children:l.map(c=>p.jsx("option",{value:c,children:c==="all"?"All Types":c.replace(/_/g," ")},c))}),p.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-blue-500",children:u.map(c=>p.jsx("option",{value:c,children:c==="all"?"All Severities":c.charAt(0).toUpperCase()+c.slice(1)},c))})]}),p.jsx("div",{className:"overflow-x-auto",children:p.jsxs("table",{className:"w-full",children:[p.jsx("thead",{children:p.jsxs("tr",{className:"border-b border-border",children:[p.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Time"}),p.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Type"}),p.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Severity"}),p.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Message"}),p.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Duration"})]})}),p.jsx("tbody",{children:e.length>0?e.map((c,f)=>{const h=Mae(c.severity);return p.jsxs("tr",{className:"border-b border-border hover:bg-bg-hover",children:[p.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono whitespace-nowrap",children:det(c.timestamp)}),p.jsx("td",{className:"p-4 text-sm text-slate-300",children:c.type.replace(/_/g," ")}),p.jsx("td",{className:"p-4",children:p.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${h.badge}`,children:c.severity})}),p.jsx("td",{className:"p-4 text-sm text-slate-200 max-w-md truncate",children:c.message}),p.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono",children:c.duration?vet(c.duration):"-"})]},c.id||f)}):p.jsx("tr",{children:p.jsx("td",{colSpan:5,className:"p-8 text-center text-slate-500",children:"No alert history available"})})})]})}),o>1&&p.jsxs("div",{className:"p-4 border-t border-border flex items-center justify-between",children:[p.jsxs("span",{className:"text-sm text-slate-400",children:["Page ",a," of ",o]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.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:p.jsx(dce,{size:16})}),p.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:p.jsx(Au,{size:16})})]})]})]})}function met({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 f=`${s%12||12}:${l} ${u}`;return e.sub_type==="weekly"&&e.schedule_day&&(f+=` ${e.schedule_day.charAt(0).toUpperCase()}${e.schedule_day.slice(1)}`),f},a=(()=>{switch(e.sub_type){case"alerts":return oy;case"daily":return Pf;case"weekly":return Pf;default:return oy}})();return p.jsx("div",{className:"p-4 rounded-lg bg-bg-hover border border-border",children:p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-500/10 flex items-center justify-center",children:p.jsx(a,{size:18,className:"text-blue-400"})}),p.jsxs("div",{className:"flex-1",children:[p.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&&p.jsxs("span",{className:"text-slate-400 font-normal ml-2",children:["(",e.scope_type,": ",e.scope_value,")"]})]}),p.jsxs("div",{className:"text-xs text-slate-500 mt-0.5",children:[n()," • ",r(e.user_id)]})]}),p.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`})]})})}function yet(){const[e,t]=G.useState([]),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState([]),[l,u]=G.useState(!0),[c,f]=G.useState(null),[h,d]=G.useState("all"),[v,m]=G.useState("all"),[y,x]=G.useState(1),[_,b]=G.useState(1),S=20,[T,C]=G.useState(new Set),{lastAlert:A}=YN();G.useEffect(()=>{document.title="Alerts — MeshAI"},[]),G.useEffect(()=>{Promise.all([vY().catch(()=>[]),UB(S,0).catch(()=>({items:[],total:0})),Oce().catch(()=>[]),fetch("/api/nodes").then(k=>k.json()).catch(()=>[])]).then(([k,E,N,D])=>{t(k),Array.isArray(E)?(n(E),b(1)):(n(E.items||[]),b(Math.ceil((E.total||0)/S))),a(N),s(D),u(!1)}).catch(k=>{f(k.message),u(!1)})},[]),G.useEffect(()=>{A&&t(k=>k.some(N=>N.type===A.type&&N.message===A.message)?k:[A,...k])},[A]),G.useEffect(()=>{const k=(y-1)*S;UB(S,k,h,v).then(E=>{Array.isArray(E)?(n(E),b(1)):(n(E.items||[]),b(Math.ceil((E.total||0)/S)))}).catch(()=>{})},[y,h,v]);const P=G.useCallback(k=>{const E=`${k.type}-${k.message}-${k.timestamp}`;C(N=>new Set([...N,E]))},[]),O=e.filter(k=>{const E=`${k.type}-${k.message}-${k.timestamp}`;return!T.has(E)});return l?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-slate-400",children:"Loading alerts..."})}):c?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsxs("div",{className:"text-red-400",children:["Error: ",c]})}):p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[p.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[p.jsx(il,{size:14}),"Active Alerts (",O.length,")"]}),O.length>0?p.jsx("div",{className:"space-y-3",children:O.map((k,E)=>p.jsx(pet,{alert:k,onAcknowledge:P},`${k.type}-${k.timestamp}-${E}`))}):p.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-8",children:[p.jsx(VN,{size:20,className:"text-green-500"}),p.jsx("span",{children:"No active alerts — all systems nominal"})]})]}),p.jsxs("div",{children:[p.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[p.jsx(Pf,{size:14}),"Alert History"]}),p.jsx(get,{history:r,typeFilter:h,severityFilter:v,onTypeFilterChange:k=>{d(k),x(1)},onSeverityFilterChange:k=>{m(k),x(1)},page:y,totalPages:_,onPageChange:x})]}),p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[p.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[p.jsx(Ace,{size:14}),"Mesh Subscriptions (",i.length,")"]}),i.length>0?p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:i.map(k=>p.jsx(met,{subscription:k,nodes:o},k.id))}):p.jsxs("div",{className:"text-slate-500 py-4",children:[p.jsx("p",{children:"No active subscriptions."}),p.jsxs("p",{className:"text-xs mt-2",children:["Manage subscriptions via ",p.jsx("code",{className:"text-blue-400",children:"!subscribe"})," on mesh. Broadcasts arrive with one of three prefixes — ",p.jsx("strong",{children:"New:"})," (first sight), ",p.jsx("strong",{children:"Update:"})," (material change), or ",p.jsx("strong",{children:"Active:"})," (clock-driven reminder while the event is still live). See ",p.jsx("a",{href:"/reference#broadcast-types",className:"text-blue-400 hover:underline",children:"Broadcast Types"})," and ",p.jsx("a",{href:"/reference#reminders",className:"text-blue-400 hover:underline",children:"Reminder System"})," in Reference."]})]})]})]})}const u1=[{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)"}],C7=[{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 Pb(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 ba({info:e}){const[t,r]=G.useState(!1);return p.jsxs("div",{className:"relative inline-block",children:[p.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&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>r(!1)}),p.jsx("div",{className:"absolute left-0 top-6 z-50 w-72 p-3 bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl text-xs text-slate-300 leading-relaxed",children:e})]})]})}function Wl({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 p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&p.jsx(ba,{info:o})]}),p.jsxs("div",{className:"relative",children:[p.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&&p.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?p.jsx(oY,{size:16}):p.jsx(GN,{size:16})})]}),a&&p.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function S0({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s=""}){return p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&p.jsx(ba,{info:s})]}),p.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&&p.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function qS({label:e,checked:t,onChange:r,helper:n="",info:i=""}){return p.jsxs("div",{className:"flex items-center justify-between py-2",children:[p.jsxs("div",{children:[p.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&p.jsx(ba,{info:i})]}),n&&p.jsx("p",{className:"text-xs text-slate-600",children:n})]}),p.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:p.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function $m({label:e,value:t,onChange:r,helper:n="",info:i=""}){return p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&p.jsx(ba,{info:i})]}),p.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&&p.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function c1({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((f,h)=>h!==c))};return p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&p.jsx(ba,{info:a})]}),p.jsxs("div",{className:"flex gap-2",children:[p.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}),p.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:p.jsx(Vv,{size:16})})]}),t.length>0&&p.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:t.map((c,f)=>p.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-[#1e2a3a] rounded text-sm text-slate-300",children:[c,p.jsx("button",{type:"button",onClick:()=>u(f),className:"text-slate-500 hover:text-red-400",children:p.jsx(vo,{size:14})})]},f))}),i&&p.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function Pae({value:e,onChange:t}){const[r,n]=G.useState(!1),i=u1.find(a=>a.value===e)||u1[0];return p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Severity Threshold",p.jsx(ba,{info:"Only alerts at or above this severity trigger this rule. ROUTINE = informational, PRIORITY = needs attention, IMMEDIATE = act now."})]}),p.jsxs("div",{className:"relative",children:[p.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:[p.jsxs("div",{children:[p.jsx("span",{className:"text-slate-200",children:i.label}),p.jsxs("span",{className:"text-slate-500 ml-2",children:["- ",i.description]})]}),p.jsx(Bu,{size:16,className:`text-slate-500 transition-transform ${r?"rotate-180":""}`})]}),r&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>n(!1)}),p.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-50 bg-[#0a0e17] border border-[#1e2a3a] rounded-lg shadow-xl overflow-hidden",children:u1.map(a=>p.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:[p.jsx("div",{className:"font-medium text-slate-200",children:a.label}),p.jsx("div",{className:"text-xs text-slate-500",children:a.description})]},a.value))})]})]}),p.jsx("p",{className:"text-xs text-slate-600",children:'Lower = more notifications. "Warning" recommended for most rules.'})]})}function kb({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:p.jsx(ho,{size:14}),mesh_dm:p.jsx(HN,{size:14}),email:p.jsx(bce,{size:14}),webhook:p.jsx(xce,{size:14})}[e.delivery_type]||p.jsx(wT,{size:14});return p.jsxs("div",{className:"space-y-2",children:[p.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?p.jsxs(p.Fragment,{children:[p.jsx(sy,{size:14,className:"animate-spin"}),"Testing..."]}):p.jsxs(p.Fragment,{children:[o,"Test Channel"]})}),n&&p.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:p.jsxs("div",{className:"flex items-start gap-2",children:[n.success?p.jsx(ts,{size:14,className:"mt-0.5 flex-shrink-0"}):p.jsx(vo,{size:14,className:"mt-0.5 flex-shrink-0"}),p.jsxs("div",{children:[p.jsx("div",{className:"font-medium",children:n.message}),n.error&&p.jsx("div",{className:"mt-1 text-red-300",children:n.error})]})]})})]})}function xet({rule:e,ruleIndex:t,categories:r,regions:n,onChange:i,onDelete:a,onDuplicate:o,onTest:s}){var N,D,z,V,F;const[l,u]=G.useState(!e.name),[c,f]=G.useState(!1),[h,d]=G.useState(null),[v,m]=G.useState(null);G.useEffect(()=>{var $;e.name&&t>=0&&(fetch(`/api/notifications/rules/${t}/stats`).then(B=>B.json()).then(B=>d(B)).catch(()=>{}),($=e.categories)!=null&&$.length&&fetch("/api/notifications/rules/sources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({categories:e.categories})}).then(B=>B.json()).then(B=>m(B)).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"}],b=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],S=$=>{const B=e.categories||[];B.includes($)?i({...e,categories:B.filter(H=>H!==$)}):i({...e,categories:[...B,$]})},T=($,B)=>{const H=e.categories||[];if(B==="add"){const U=Array.from(new Set([...H,...$]));i({...e,categories:U})}else{const U=new Set($);i({...e,categories:H.filter(Z=>!U.has(Z))})}},C=$=>{const B=e.region_scope||[];B.includes($)?i({...e,region_scope:B.filter(H=>H!==$)}):i({...e,region_scope:[...B,$]})},A=$=>{const B=e.schedule_days||[];B.includes($)?i({...e,schedule_days:B.filter(H=>H!==$)}):i({...e,schedule_days:[...B,$]})},P=async()=>{f(!0),await s(),f(!1)},O=()=>{if(e.trigger_type==="schedule")return"[Scheduled report preview would appear here]";const $=e.categories||[];if($.length===0&&r.length>0)return r[0].example_message||"Alert notification";const B=r.find(H=>$.includes(H.id));return(B==null?void 0:B.example_message)||"Alert notification"},k=()=>{var B,H,U,Z,Y,K,te,ce;const $=[];if(e.trigger_type==="schedule"){const de=((B=x.find(ye=>ye.value===e.schedule_frequency))==null?void 0:B.label)||e.schedule_frequency,Oe=((H=_.find(ye=>ye.value===e.message_type))==null?void 0:H.label)||e.message_type;$.push(`${de} at ${e.schedule_time||"??:??"}`),$.push(Oe)}else{const de=((U=e.categories)==null?void 0:U.length)||0,Oe=de===0?"All":r.filter(ne=>{var ve;return(ve=e.categories)==null?void 0:ve.includes(ne.id)}).map(ne=>ne.name).slice(0,2).join(", ")+(de>2?` +${de-2}`:""),ye=((Z=u1.find(ne=>ne.value===e.min_severity))==null?void 0:Z.label)||e.min_severity;$.push(`${Oe} at ${ye}+`)}if(!e.delivery_type)$.push("No delivery");else{const de=((Y=y.find(ye=>ye.value===e.delivery_type))==null?void 0:Y.label)||e.delivery_type;let Oe="";if(e.delivery_type==="mesh_broadcast")Oe=`Ch ${e.broadcast_channel}`;else if(e.delivery_type==="mesh_dm")Oe=`${((K=e.node_ids)==null?void 0:K.length)||0} nodes`;else if(e.delivery_type==="email")Oe=(te=e.recipients)!=null&&te.length?e.recipients[0]+(e.recipients.length>1?` +${e.recipients.length-1}`:""):"no recipients";else if(e.delivery_type==="webhook")try{Oe=new URL(e.webhook_url).hostname}catch{Oe=((ce=e.webhook_url)==null?void 0:ce.slice(0,20))||"no URL"}$.push(`${de}${Oe?` (${Oe})`:""}`)}return $.join(" -> ")},E=()=>{var B;if(!v||!((B=e.categories)!=null&&B.length))return null;const $=new Map;for(const[,H]of Object.entries(v)){const U=$.get(H.source);U?(U.events+=H.active_events,U.enabled=U.enabled&&H.enabled):$.set(H.source,{enabled:H.enabled,events:H.active_events})}return Array.from($.entries()).map(([H,{enabled:U,events:Z}])=>p.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?`${Z} active`:"Not enabled",children:[U?p.jsx(wT,{size:10}):p.jsx(dY,{size:10}),H.toUpperCase(),U&&Z>0&&` (${Z})`]},H))};return p.jsxs("div",{className:`border rounded-lg overflow-hidden ${e.enabled?"border-[#1e2a3a]":"border-slate-700 opacity-60"}`,children:[p.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>u(!l),children:[p.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[l?p.jsx(Bu,{size:16,className:"text-slate-500 flex-shrink-0"}):p.jsx(Au,{size:16,className:"text-slate-500 flex-shrink-0"}),p.jsx("button",{onClick:$=>{$.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"?p.jsx(Pf,{size:14,className:"text-blue-400 flex-shrink-0"}):p.jsx(ly,{size:14,className:"text-yellow-400 flex-shrink-0"}),p.jsx("span",{className:"font-medium text-slate-200 truncate",title:e.name||void 0,children:e.name||"New Rule"}),!l&&p.jsx("span",{className:`text-xs truncate hidden sm:block ${e.delivery_type?"text-slate-500":"text-amber-400"}`,children:k()})]}),p.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[!l&&(()=>{const $="hidden sm:inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs mr-2";if(!e.enabled)return p.jsx("span",{className:`${$} bg-slate-800 text-slate-500`,children:"Disabled"});if(!h)return null;const B=h.fire_count||0,H=h.last_fired,U=Date.now()/1e3-7*86400;return B>0&&H&&H>=U?p.jsx("span",{className:`${$} bg-green-500/10 text-green-400`,title:`Last fired ${Pb(H)}`,children:"Active"}):B>0&&H?p.jsx("span",{className:`${$} bg-yellow-500/10 text-yellow-400`,title:`Last fired ${Pb(H)}`,children:"Idle (no recent activity)"}):p.jsx("span",{className:`${$} bg-slate-800 text-slate-400`,children:"No activity yet"})})(),!l&&p.jsx("div",{className:"hidden md:flex items-center gap-1 mr-2",children:E()}),p.jsx("button",{onClick:$=>{$.stopPropagation(),P()},disabled:c||!e.name,className:"p-1.5 text-blue-400 hover:text-blue-300 hover:bg-blue-500/10 rounded disabled:opacity-50",title:"Test rule",children:p.jsx(iL,{size:14})}),p.jsx("button",{onClick:$=>{$.stopPropagation(),o()},className:"p-1.5 text-slate-400 hover:text-slate-200 hover:bg-slate-500/10 rounded",title:"Duplicate",children:p.jsx(mce,{size:14})}),p.jsx("button",{onClick:$=>{$.stopPropagation(),a()},className:"p-1.5 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",title:"Delete",children:p.jsx(O0,{size:14})})]})]}),!l&&e.name&&p.jsxs("div",{className:"px-3 pb-2 pt-0 bg-[#0a0e17] flex items-center gap-2 flex-wrap text-xs",children:[!e.delivery_type&&p.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 bg-amber-500/10 text-amber-400 rounded",children:[p.jsx(Mu,{size:10}),"No delivery method"]}),(h==null?void 0:h.fire_count)!==void 0&&h.fire_count>0&&p.jsxs("span",{className:"text-slate-500",children:["Fired ",h.fire_count,"x"]})]}),l&&p.jsxs("div",{className:"p-4 space-y-6 border-t border-[#1e2a3a]",children:[p.jsx(Wl,{label:"Rule Name",value:e.name,onChange:$=>i({...e,name:$}),placeholder:"e.g., Emergency Broadcast, Daily Health Report",helper:"A descriptive name for this rule"}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Trigger Type"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs("button",{type:"button",onClick:()=>i({...e,trigger_type:"condition"}),className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-lg 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:[p.jsx(ly,{size:16}),p.jsx("span",{children:"Condition"})]}),p.jsxs("button",{type:"button",onClick:()=>i({...e,trigger_type:"schedule"}),className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-lg 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:[p.jsx(Pf,{size:16}),p.jsx("span",{children:"Schedule"})]})]}),p.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"&&p.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[p.jsx(il,{size:14}),"WHEN (Condition)"]}),p.jsx(Pae,{value:e.min_severity,onChange:$=>i({...e,min_severity:$})}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Categories",p.jsx(ba,{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."})]}),p.jsx("div",{className:"text-xs text-slate-500 mb-2",children:(((N=e.categories)==null?void 0:N.length)||0)===0?"All categories (none selected)":`${(D=e.categories)==null?void 0:D.length} selected`}),p.jsx(_et,{categories:r,selected:e.categories||[],onToggle:S,onSelectMany:T})]}),v&&Object.keys(v).length>0&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Data Sources"}),p.jsx("div",{className:"flex flex-wrap gap-2",children:E()})]})]}),e.trigger_type==="schedule"&&p.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[p.jsx(hce,{size:14}),"WHEN (Schedule)"]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Frequency"}),p.jsx("select",{value:e.schedule_frequency||"daily",onChange:$=>i({...e,schedule_frequency:$.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($=>p.jsx("option",{value:$.value,children:$.label},$.value))})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx($m,{label:"Time",value:e.schedule_time||"07:00",onChange:$=>i({...e,schedule_time:$})}),e.schedule_frequency==="twice_daily"&&p.jsx($m,{label:"Second Time",value:e.schedule_time_2||"19:00",onChange:$=>i({...e,schedule_time_2:$})})]}),e.schedule_frequency==="weekly"&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Days"}),p.jsx("div",{className:"flex flex-wrap gap-2",children:b.map($=>{var B;return p.jsx("button",{type:"button",onClick:()=>A($),className:`px-3 py-1.5 rounded text-sm capitalize transition-colors ${(B=e.schedule_days)!=null&&B.includes($)?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:$.slice(0,3)},$)})})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Report Type"}),p.jsx("select",{value:e.message_type||"mesh_health_summary",onChange:$=>i({...e,message_type:$.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($=>p.jsx("option",{value:$.value,children:$.label},$.value))}),p.jsx("p",{className:"text-xs text-slate-600",children:(z=_.find($=>$.value===e.message_type))==null?void 0:z.description})]}),e.message_type==="custom"&&p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Custom Message",p.jsx(ba,{info:"Available tokens: {MESH_SCORE}, {NODE_COUNT}, {NODES_ONLINE}, {ACTIVE_ALERTS}, {KP}, {SFI}, {DATE}, {TIME}"})]}),p.jsx("textarea",{value:e.custom_message||"",onChange:$=>i({...e,custom_message:$.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"})]})]}),p.jsxs("div",{className:"space-y-2 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[p.jsx(Fv,{size:14}),"REGIONS",p.jsx(ba,{info:"Limit this rule to alerts from specific regions. Empty selection = all regions (backward compatible). Region names come from /api/regions."})]}),p.jsx("div",{className:"text-xs text-slate-500",children:(((V=e.region_scope)==null?void 0:V.length)||0)===0?"All regions (none selected)":`${e.region_scope.length} of ${n.length} selected`}),n.length===0?p.jsx("div",{className:"text-xs text-slate-600 italic",children:"No regions configured."}):p.jsx("div",{className:"flex flex-wrap gap-2",children:n.map($=>{const B=(e.region_scope||[]).includes($.name);return p.jsx("button",{type:"button",onClick:()=>C($.name),className:`px-3 py-1.5 rounded text-sm transition-colors ${B?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,title:$.local_name||$.name,children:$.local_name||$.name},$.name)})})]}),p.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[p.jsx(iL,{size:14}),"SEND VIA"]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Delivery Method",p.jsx(ba,{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."})]}),p.jsx("select",{value:e.delivery_type||"",onChange:$=>i({...e,delivery_type:$.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($=>p.jsx("option",{value:$.value,children:$.label},$.value))}),p.jsx("p",{className:"text-xs text-slate-600",children:(F=y.find($=>$.value===(e.delivery_type||"")))==null?void 0:F.description})]}),!e.delivery_type&&p.jsxs("div",{className:"flex items-start gap-2 p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[p.jsx(Mu,{size:16,className:"text-amber-400 mt-0.5 flex-shrink-0"}),p.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"&&p.jsxs(p.Fragment,{children:[p.jsx(B3,{label:"Broadcast Channel",value:e.broadcast_channel??0,onChange:$=>i({...e,broadcast_channel:$}),helper:"Select the mesh radio channel",mode:"single"}),p.jsx(kb,{rule:e})]}),e.delivery_type==="mesh_dm"&&p.jsxs(p.Fragment,{children:[p.jsx(R3,{label:"Recipient Nodes",value:e.node_ids||[],onChange:$=>i({...e,node_ids:$}),helper:"Nodes that receive direct messages",valueType:"node_id_hex"}),p.jsx(kb,{rule:e})]}),e.delivery_type==="email"&&p.jsxs("div",{className:"space-y-4",children:[p.jsx(c1,{label:"Recipients",value:e.recipients||[],onChange:$=>i({...e,recipients:$}),placeholder:"email@example.com",helper:"Email addresses to receive alerts"}),p.jsxs("details",{className:"group",children:[p.jsxs("summary",{className:"flex items-center gap-2 cursor-pointer text-sm text-slate-400 hover:text-slate-200",children:[p.jsx(Au,{size:14,className:"group-open:rotate-90 transition-transform"}),"SMTP Configuration"]}),p.jsxs("div",{className:"mt-4 space-y-4 pl-6 border-l border-[#1e2a3a]",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Wl,{label:"SMTP Host",value:e.smtp_host||"",onChange:$=>i({...e,smtp_host:$}),placeholder:"smtp.gmail.com"}),p.jsx(S0,{label:"SMTP Port",value:e.smtp_port??587,onChange:$=>i({...e,smtp_port:$}),min:1,max:65535})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Wl,{label:"Username",value:e.smtp_user||"",onChange:$=>i({...e,smtp_user:$})}),p.jsx(Wl,{label:"Password",value:e.smtp_password||"",onChange:$=>i({...e,smtp_password:$}),type:"password",info:"Gmail users: use an App Password from myaccount.google.com/apppasswords"})]}),p.jsx(qS,{label:"Use TLS",checked:e.smtp_tls??!0,onChange:$=>i({...e,smtp_tls:$})}),p.jsx(Wl,{label:"From Address",value:e.from_address||"",onChange:$=>i({...e,from_address:$}),placeholder:"alerts@yourdomain.com"})]})]}),p.jsx(kb,{rule:e})]}),e.delivery_type==="webhook"&&p.jsxs(p.Fragment,{children:[p.jsx(Wl,{label:"Webhook URL",value:e.webhook_url||"",onChange:$=>i({...e,webhook_url:$}),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."}),p.jsx(kb,{rule:e})]})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(S0,{label:"Cooldown (minutes)",value:e.cooldown_minutes??10,onChange:$=>i({...e,cooldown_minutes:$}),min:0,helper:"Min time between repeat sends",info:"Prevents alert spam. Same condition won't re-trigger this rule within this window."})," "]}),h&&p.jsxs("div",{className:"flex items-center gap-4 text-xs text-slate-500",children:[p.jsxs("span",{children:["Last fired: ",Pb(h.last_fired)]}),p.jsxs("span",{children:["Last tested: ",Pb(h.last_test)]}),p.jsxs("span",{children:["Total fires: ",h.fire_count]})]}),e.trigger_type!=="schedule"&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Example Message"}),p.jsx("div",{className:"p-3 bg-[#1e2a3a]/50 rounded-lg border border-[#1e2a3a]",children:p.jsx("p",{className:"text-sm text-slate-300 font-mono",children:O()})}),p.jsx("p",{className:"text-xs text-slate-600",children:"This is an example of what this rule would send."})]})]})]})}const f1=[{key:"mesh_health",label:"Mesh Health",Icon:$v},{key:"weather",label:"Weather",Icon:Pu},{key:"fire",label:"Fire",Icon:gT},{key:"rf_propagation",label:"RF Propagation",Icon:ho},{key:"roads",label:"Roads",Icon:vT},{key:"avalanche",label:"Avalanche",Icon:Cce},{key:"seismic",label:"Seismic",Icon:yT},{key:"tracking",label:"Tracking",Icon:Fv}];function _et({categories:e,selected:t,onToggle:r,onSelectMany:n}){const i=new Set(f1.map(h=>h.key)),a=new Map;f1.forEach(h=>a.set(h.key,[]));const o=[];for(const h of e){const d=h.toggle;d&&i.has(d)?a.get(d).push(h):o.push(h)}const s=new Set;for(const[h,d]of a)d.some(v=>t.includes(v.id))&&s.add(h);o.some(h=>t.includes(h.id))&&s.add("other");const[l,u]=G.useState(s),c=h=>{u(d=>{const v=new Set(d);return v.has(h)?v.delete(h):v.add(h),v})},f=(h,d,v,m)=>{if(!m.length)return null;const y=l.has(h),x=m.map(b=>b.id),_=x.filter(b=>t.includes(b)).length;return p.jsxs("div",{className:"border border-[#1e2a3a] rounded",children:[p.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 bg-[#0d1420]",children:[p.jsxs("button",{type:"button",onClick:()=>c(h),className:"flex items-center gap-2 text-sm text-slate-200 flex-1 min-w-0",children:[y?p.jsx(Bu,{size:14,className:"text-slate-500 flex-shrink-0"}):p.jsx(Au,{size:14,className:"text-slate-500 flex-shrink-0"}),v&&p.jsx(v,{size:14,className:"text-slate-400 flex-shrink-0"}),p.jsxs("span",{className:"truncate",children:[d," (",m.length,")"]}),_>0&&p.jsxs("span",{className:"ml-1 text-xs text-accent",children:[_," selected"]})]}),p.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[p.jsx("button",{type:"button",onClick:b=>{b.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"}),p.jsx("button",{type:"button",onClick:b=>{b.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&&p.jsx("div",{className:"p-1 space-y-1",children:m.map(b=>p.jsxs("label",{onClick:()=>r(b.id),className:"flex items-start gap-2 p-2 rounded hover:bg-[#1e2a3a]/50 cursor-pointer",children:[p.jsx("div",{className:`w-4 h-4 mt-0.5 rounded border flex items-center justify-center flex-shrink-0 ${t.includes(b.id)?"bg-accent border-accent":"border-slate-600"}`,children:t.includes(b.id)&&p.jsx(ts,{size:12,className:"text-white"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm text-slate-200",children:b.name}),p.jsx("div",{className:"text-xs text-slate-500",children:b.description})]})]},b.id))})]},h)};return p.jsxs("div",{className:"max-h-96 overflow-y-auto border border-[#1e2a3a] rounded-lg p-2 space-y-2",children:[f1.map(h=>f(h.key,h.label,h.Icon,a.get(h.key)||[])),f("other","Other",null,o)]})}const A7=["digest","mesh_broadcast","mesh_dm","email","webhook"],bet=["routine","priority","immediate"];function wet({toggles:e,onChange:t}){const[r,n]=G.useState(null),i=(a,o)=>t({...e,[a]:{...e[a]||{},name:a,...o}});return p.jsxs("div",{className:"space-y-3 mb-8",children:[p.jsxs("div",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Master Toggles",p.jsx(ba,{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)."})]}),p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:f1.map(({key:a,label:o,Icon:s})=>{const l=e[a]||{},u=r===a,c=Object.values(l.severity_channels||{}).reduce((h,d)=>h+((d==null?void 0:d.length)||0),0),f=(l.regions||[]).length;return p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("button",{type:"button",onClick:()=>n(u?null:a),className:"flex items-center gap-2 text-sm text-slate-200",children:[p.jsx(s,{size:15})," ",o,u?p.jsx(Bu,{size:14}):p.jsx(Au,{size:14})]}),p.jsx(qS,{label:"",checked:!!l.enabled,onChange:h=>i(a,{enabled:h})})]}),!u&&p.jsx("div",{className:"text-xs text-slate-600 mt-1",children:l.enabled?`${f||"all"} region${f===1?"":"s"}, ${c} channel${c===1?"":"s"} at ${l.min_severity||"priority"}+`:"OFF"}),u&&p.jsxs("div",{className:`mt-3 space-y-3 ${l.enabled?"":"opacity-40 pointer-events-none select-none"}`,children:[p.jsx(Pae,{value:l.min_severity||"priority",onChange:h=>i(a,{min_severity:h})}),p.jsx("div",{className:"text-xs text-slate-500",children:"Severity → channels"}),p.jsxs("table",{className:"text-xs w-full",children:[p.jsx("thead",{children:p.jsxs("tr",{children:[p.jsx("th",{}),A7.map(h=>p.jsx("th",{className:"text-slate-500 font-normal px-1",children:h.replace("_"," ")},h))]})}),p.jsx("tbody",{children:bet.map(h=>p.jsxs("tr",{children:[p.jsx("td",{className:"text-slate-400 pr-2",children:h}),A7.map(d=>{var m;const v=(((m=l.severity_channels)==null?void 0:m[h])||[]).includes(d);return p.jsx("td",{className:"text-center",children:p.jsx("input",{type:"checkbox",checked:v,onChange:y=>{const x={...l.severity_channels||{}},_=new Set(x[h]||[]);y.target.checked?_.add(d):_.delete(d),x[h]=Array.from(_),i(a,{severity_channels:x})}})},d)})]},h))})]}),p.jsx(c1,{label:"Regions (empty = all)",value:l.regions||[],onChange:h=>i(a,{regions:h}),placeholder:"Add region..."})," ",p.jsx("div",{className:"text-xs text-slate-500 pt-1",children:"Channel config"}),p.jsx(S0,{label:"Broadcast channel",value:l.broadcast_channel??0,onChange:h=>i(a,{broadcast_channel:h})}),p.jsx(c1,{label:"DM node IDs",value:l.node_ids||[],onChange:h=>i(a,{node_ids:h}),placeholder:"!nodeid"}),p.jsx(c1,{label:"Email recipients",value:l.recipients||[],onChange:h=>i(a,{recipients:h}),placeholder:"ops@example.com"}),p.jsx(Wl,{label:"SMTP host",value:l.smtp_host||"",onChange:h=>i(a,{smtp_host:h}),placeholder:"smtp.example.com"}),p.jsx(S0,{label:"SMTP port",value:l.smtp_port??587,onChange:h=>i(a,{smtp_port:h})}),p.jsx(Wl,{label:"Webhook URL",value:l.webhook_url||"",onChange:h=>i(a,{webhook_url:h}),placeholder:"https://..."})]})]},a)})})]})}function Tet(){var B,H,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,f]=G.useState(!1),[h,d]=G.useState(null),[v,m]=G.useState(null),[y,x]=G.useState(null),[_,b]=G.useState({open:!1,ruleIndex:-1,loading:!1,action:""}),[S,T]=G.useState(!1),[C,A]=G.useState(!1),P=G.useCallback(async()=>{try{const[Z,Y,K]=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 te=await Z.json(),ce=await Y.json(),de=K.ok?await K.json():[];t(te),n(JSON.parse(JSON.stringify(te))),a(ce),s(Array.isArray(de)?de:[]),A(!1),d(null)}catch(Z){d(Z instanceof Error?Z.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 O=async()=>{if(e){f(!0),d(null),m(null);try{const Z=await fetch("/api/config/notifications",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Y=await Z.json();if(!Z.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(Z){d(Z instanceof Error?Z.message:"Save failed")}finally{f(!1)}}},k=()=>{r&&(t(JSON.parse(JSON.stringify(r))),A(!1))},E=()=>({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:[]}),N=()=>{e&&t({...e,rules:[...e.rules||[],E()]})},D=Z=>{if(!e)return;const Y=C7.find(K=>K.id===Z);Y&&(t({...e,rules:[...e.rules||[],{...E(),...Y.rule}]}),T(!1))},z=Z=>{if(!e)return;const Y=e.rules[Z],K={...JSON.parse(JSON.stringify(Y)),name:`${Y.name} (copy)`},te=[...e.rules];te.splice(Z+1,0,K),t({...e,rules:te})},V=async Z=>{b({open:!0,ruleIndex:Z,loading:!0,action:""});try{const K=await(await fetch(`/api/notifications/rules/${Z}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"preview"})})).json();x(K),b(te=>({...te,loading:!1}))}catch{x({success:!1,message:"Failed to get preview"}),b(Y=>({...Y,loading:!1}))}},F=async Z=>{const Y=_.ruleIndex;b(K=>({...K,loading:!0,action:Z}));try{const te=await(await fetch(`/api/notifications/rules/${Y}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:Z})})).json();x(te),b(ce=>({...ce,loading:!1}))}catch{x({success:!1,message:`Failed to ${Z}`}),b(K=>({...K,loading:!1}))}},$=()=>{b({open:!1,ruleIndex:-1,loading:!1,action:""}),x(null)};return l?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-slate-400",children:"Loading notifications config..."})}):e?p.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[_.open&&p.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:p.jsxs("div",{className:"bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[85vh] overflow-auto",children:[p.jsxs("div",{className:"p-4 border-b border-[#2a3a4a] flex items-center justify-between sticky top-0 bg-[#1a2332]",children:[p.jsx("h3",{className:"text-lg font-semibold",children:"Test Notification Rule"}),p.jsx("button",{onClick:$,className:"text-slate-500 hover:text-slate-300",children:p.jsx(vo,{size:20})})]}),p.jsx("div",{className:"p-4 space-y-4",children:_.loading?p.jsxs("div",{className:"flex items-center justify-center py-8",children:[p.jsx(sy,{size:20,className:"animate-spin text-slate-400 mr-2"}),p.jsx("div",{className:"text-slate-400",children:_.action?`${_.action.replace("_"," ").replace("send ","Sending ")}...`:"Loading current data..."})]}):y?p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"space-y-2",children:[p.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?p.jsx("div",{className:"p-3 bg-slate-800/50 rounded space-y-1",children:y.live_data_summary.map((Z,Y)=>p.jsx("div",{className:`text-sm font-mono ${Z.startsWith("[!]")?"text-amber-400":""}`,children:Z},Y))}):p.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"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:"Rule Matching"}),p.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[y.conditions_matched&&y.conditions_matched>0?p.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"]}):p.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&&p.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&&p.jsxs("div",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-sm space-y-2",children:[p.jsx("div",{className:"text-yellow-300",children:y.below_threshold_summary}),y.below_threshold_events&&y.below_threshold_events.length>0&&p.jsx("div",{className:"space-y-1 text-yellow-200/80",children:y.below_threshold_events.slice(0,3).map((Z,Y)=>p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-yellow-500/20 rounded",children:Z.severity}),p.jsx("span",{children:Z.headline})]},Y))}),y.suggestion&&p.jsxs("div",{className:"text-yellow-400 text-xs mt-2",children:["Tip: ",y.suggestion]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:y.is_example?"Example Messages":"Messages That Would Fire"}),(B=y.preview_messages)==null?void 0:B.map((Z,Y)=>p.jsx("div",{className:"p-3 bg-slate-800 rounded text-sm font-mono break-words",children:Z},Y))]}),y.delivered!==void 0&&y.delivery_result&&p.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:p.jsxs("div",{className:"flex items-start gap-2",children:[y.delivered?p.jsx(ts,{size:16,className:"mt-0.5"}):p.jsx(vo,{size:16,className:"mt-0.5"}),p.jsxs("div",{children:[p.jsx("div",{children:y.delivery_result}),y.delivery_error&&p.jsx("div",{className:"mt-1 text-red-300",children:y.delivery_error})]})]})}),y.message&&!y.preview_messages&&p.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}),p.jsxs("div",{className:"p-4 border-t border-[#2a3a4a] flex justify-between sticky bottom-0 bg-[#1a2332]",children:[p.jsx("button",{onClick:$,className:"px-4 py-2 text-slate-400 hover:text-slate-200",children:"Close"}),y&&!y.delivered&&p.jsx("div",{className:"flex gap-2",children:y.delivery_method?p.jsxs(p.Fragment,{children:[y.live_data_summary&&y.live_data_summary.length>0&&p.jsx("button",{onClick:()=>F("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"}),p.jsx("button",{onClick:()=>F("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&&p.jsx("button",{onClick:()=>F("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"})]}):p.jsx("span",{className:"px-3 py-2 text-amber-400 text-sm",children:"Configure a delivery method to send test messages"})})]})]})}),p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("div",{children:p.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."})}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("button",{onClick:P,className:"p-2 text-slate-400 hover:text-slate-200 hover:bg-bg-hover rounded transition-colors",title:"Refresh",children:p.jsx(sy,{size:18})}),p.jsxs("button",{onClick:k,disabled:!C,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:[p.jsx(xT,{size:16}),"Discard"]}),p.jsxs("button",{onClick:O,disabled:c||!C,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:[p.jsx(UN,{size:16}),c?"Saving...":"Save"]})]})]}),h&&p.jsx("div",{className:"p-3 rounded-lg text-sm bg-red-500/10 text-red-400 border border-red-500/20",children:h}),v&&p.jsxs("div",{className:"p-3 rounded-lg text-sm bg-green-500/10 text-green-400 border border-green-500/20",children:[p.jsx(ts,{size:14,className:"inline mr-2"}),v]}),p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6 space-y-6",children:[p.jsx(qS,{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&&p.jsxs(p.Fragment,{children:[" ",p.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[p.jsx("div",{className:"flex items-center gap-2",children:p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Cold-start grace"})}),p.jsx(S0,{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."})]}),p.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[p.jsx("div",{className:"flex items-center gap-2",children:p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Band Conditions (HF propagation)"})}),p.jsx(qS,{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)&&p.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[p.jsx($m,{label:"Slot 1",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[0]||"06:00",onChange:Z=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[0]=Z,t({...e,band_conditions_schedule:Y})},helper:"Morning (default 06:00 MT)"}),p.jsx($m,{label:"Slot 2",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[1]||"14:00",onChange:Z=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[1]=Z,t({...e,band_conditions_schedule:Y})},helper:"Afternoon (default 14:00 MT)"}),p.jsx($m,{label:"Slot 3",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[2]||"22:00",onChange:Z=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[2]=Z,t({...e,band_conditions_schedule:Y})},helper:"Night (default 22:00 MT)"})]}),p.jsx("p",{className:"text-xs text-slate-600",children:"All times are Mountain Time (America/Boise). DST handled automatically."})]}),e.toggles&&p.jsx(wet,{toggles:e.toggles,onChange:Z=>t({...e,toggles:Z})}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Notification Rules",p.jsx(ba,{info:"Each rule is self-contained: define what triggers it (condition or schedule), where to send it (mesh, email, webhook), and behavior settings."})]}),p.jsxs("span",{className:"text-xs text-slate-500",children:[((H=e.rules)==null?void 0:H.length)||0," rule",(((U=e.rules)==null?void 0:U.length)||0)!==1?"s":""]})]}),(e.rules||[]).map((Z,Y)=>p.jsx(xet,{rule:Z,ruleIndex:Y,categories:i,regions:o,onChange:K=>{const te=[...e.rules||[]];te[Y]=K,t({...e,rules:te})},onDelete:()=>{confirm(`Delete rule "${Z.name||"New Rule"}"?`)&&t({...e,rules:(e.rules||[]).filter((K,te)=>te!==Y)})},onDuplicate:()=>z(Y),onTest:()=>V(Y)},Y)),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs("button",{onClick:N,className:"flex-1 py-3 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[p.jsx(Vv,{size:16})," Add Rule"]}),p.jsxs("div",{className:"relative",children:[p.jsxs("button",{onClick:()=>T(!S),className:"py-3 px-4 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center gap-2 transition-colors",children:[p.jsx(sY,{size:16})," Add from Template"]}),S&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>T(!1)}),p.jsxs("div",{className:"absolute right-0 top-full mt-2 z-50 w-80 bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl overflow-hidden",children:[p.jsx("div",{className:"p-2 border-b border-[#2a3a4a] text-xs text-slate-500 uppercase",children:"Rule Templates"}),C7.map(Z=>p.jsxs("button",{onClick:()=>D(Z.id),className:"w-full p-3 text-left hover:bg-[#2a3a4a] transition-colors",children:[p.jsx("div",{className:"font-medium text-slate-200",children:Z.name}),p.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:Z.description})]},Z.id))]})]})]})]})]})]})]})]}):p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-red-400",children:"Failed to load notifications config"})})}const M7=[{id:"stream-gauges",label:"Stream Gauges",icon:pT},{id:"wildfire",label:"Wildfire",icon:gT},{id:"firms",label:"Satellite Fire Detection (FIRMS)",icon:_T},{id:"fire-tracker",label:"Fire Tracker (Fusion)",icon:yce},{id:"weather-alerts",label:"Weather Alerts",icon:pce},{id:"solar",label:"Solar & Geomagnetic",icon:fY},{id:"ducting",label:"Tropospheric Ducting",icon:ho},{id:"avalanche",label:"Avalanche Danger",icon:yT},{id:"traffic",label:"Traffic Flow",icon:vT},{id:"roads-511",label:"Road Conditions (511)",icon:nY},{id:"mesh-health",label:"Mesh Health",icon:$v},{id:"broadcast-types",label:"Broadcast Types",icon:iL},{id:"reminders",label:"Reminder System",icon:Pf},{id:"notifications",label:"Notifications",icon:oy},{id:"commands",label:"Commands",icon:hY},{id:"llm-dm",label:"LLM DM Queries",icon:HN},{id:"or-not-and",label:"OR-not-AND Architecture",icon:uY},{id:"adapter-config",label:"Adapter Config & CODE Rule",icon:ZN},{id:"curation",label:"Curation: Gauges & Towns",icon:aY},{id:"schema",label:"Schema Migrations",icon:_ce},{id:"api",label:"API Reference",icon:gce}];function pr({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 p.jsx("span",{className:`inline-block w-3 h-3 rounded-full ${t[e]}`})}function Pt({headers:e,rows:t}){return p.jsx("div",{className:"overflow-x-auto my-4",children:p.jsxs("table",{className:"w-full text-sm",children:[p.jsx("thead",{children:p.jsx("tr",{className:"bg-[#1a2332] border-b border-[#2a3a4a]",children:e.map((r,n)=>p.jsx("th",{className:"px-4 py-2 text-left text-slate-400 font-medium",children:r},n))})}),p.jsx("tbody",{children:t.map((r,n)=>p.jsx("tr",{className:`border-b border-[#1e2a3a] ${n%2===0?"bg-[#0d1219]":"bg-[#0a0e17]"}`,children:r.map((i,a)=>p.jsx("td",{className:"px-4 py-2 text-slate-300",children:i},a))},n))})]})})}function Ht({href:e,children:t}){return p.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-1",children:[t," ",p.jsx(Zd,{size:12})]})}function _e({children:e}){return p.jsx("h3",{className:"text-lg font-semibold text-slate-200 mt-6 mb-3",children:e})}function Dl({children:e}){return p.jsx("h4",{className:"text-base font-medium text-slate-300 mt-4 mb-2",children:e})}function fe({children:e}){return p.jsx("code",{className:"font-mono text-accent bg-[#1a2332] px-1 rounded",children:e})}function Nr({id:e,title:t,children:r}){return p.jsxs("section",{id:e,className:"mb-12 scroll-mt-6",children:[p.jsx("h2",{className:"text-2xl font-bold text-slate-100 mb-4 pb-2 border-b border-[#2a3a4a]",children:t}),p.jsx("div",{className:"text-slate-300 leading-relaxed space-y-4",children:r})]})}function Cet(){const e=zv(),[t,r]=G.useState(""),[n,i]=G.useState("stream-gauges"),a=G.useRef(null);G.useEffect(()=>{const l=e.hash.replace("#","");if(l&&M7.find(u=>u.id===l)){i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth"})}},[e.hash]);const o=M7.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 p.jsxs("div",{className:"flex h-full -m-6",children:[p.jsxs("aside",{className:"w-64 flex-shrink-0 bg-bg-card border-r border-border overflow-y-auto",children:[p.jsx("div",{className:"p-4 border-b border-border",children:p.jsxs("div",{className:"relative",children:[p.jsx(bT,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),p.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"})]})}),p.jsx("nav",{className:"py-2",children:o.map(l=>{const u=l.icon,c=n===l.id;return p.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:[p.jsx(u,{size:16}),l.label]},l.id)})})]}),p.jsx("div",{ref:a,className:"flex-1 overflow-y-auto p-6",children:p.jsxs("div",{className:"max-w-4xl",children:[p.jsx("p",{className:"text-slate-400 mb-8",children:"Everything you need to understand and configure MeshAI's monitoring and alerting systems."}),p.jsxs(Nr,{id:"stream-gauges",title:"Stream Gauges",children:[p.jsx(_e,{children:"What You're Looking At"}),p.jsx("p",{children:"MeshAI watches river and stream levels at gauges you configure. Each gauge reports two things:"}),p.jsxs("p",{children:[p.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.`]}),p.jsxs("p",{children:[p.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:`]}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsx("li",{children:"A small creek: 50-200 CFS"}),p.jsx("li",{children:"A mid-size river: 1,000-5,000 CFS"}),p.jsx("li",{children:"A big river in spring runoff: 10,000+ CFS"})]}),p.jsx(_e,{children:"When Does It Flood?"}),p.jsxs("p",{children:["Flood levels are set by the ",p.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.']}),p.jsxs("p",{children:[p.jsx("strong",{children:"Action Stage"})," — water is rising, time to start paying attention. Usually still inside the riverbanks."]}),p.jsxs("p",{children:[p.jsx("strong",{children:"Minor Flood"})," — low-lying roads start getting water on them. NWS issues a Flood Advisory."]}),p.jsxs("p",{children:[p.jsx("strong",{children:"Moderate Flood"})," — water in buildings near the river. Some people need to evacuate. NWS issues a Flood Warning."]}),p.jsxs("p",{children:[p.jsx("strong",{children:"Major Flood"})," — widespread flooding. Many people evacuating. Serious property damage."]}),p.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."}),p.jsx(_e,{children:"Low Water / Drought"}),p.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.`}),p.jsx(_e,{children:"Setting It Up"}),p.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:["Find your gauge at ",p.jsx(Ht,{href:"https://waterdata.usgs.gov/nwis",children:"waterdata.usgs.gov/nwis"})]}),p.jsxs("li",{children:["Copy the site number (like ",p.jsx(fe,{children:"13090500"}),")"]}),p.jsx("li",{children:"Add it in Config → Environmental → USGS"}),p.jsx("li",{children:"MeshAI auto-fills the gauge name and flood levels from NWS"})]}),p.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."}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://waterdata.usgs.gov/nwis",children:"USGS Water Data"})," — find gauges near you"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://water.noaa.gov",children:"NWS Water Prediction Service"})," — flood forecasts and thresholds"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.usgs.gov/special-topics/water-science-school/science/how-streamflow-measured",children:"Understanding Streamflow"})," — USGS explainer"]})]})]}),p.jsxs(Nr,{id:"wildfire",title:"Wildfire",children:[p.jsx(_e,{children:"What You're Looking At"}),p.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."}),p.jsx(_e,{children:"Fire Size — How Big Is It?"}),p.jsx(Pt,{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."]]}),p.jsx("p",{children:"For reference, 1,000 acres is about 1.5 square miles."}),p.jsx(_e,{children:"Containment — Is It Under Control?"}),p.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."}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx("strong",{children:"0-30%"})," — Essentially uncontrolled. The fire goes where it wants."]}),p.jsxs("li",{children:[p.jsx("strong",{children:"50%"})," — Good progress, but half the edge can still grow."]}),p.jsxs("li",{children:[p.jsx("strong",{children:"80%+"})," — Well controlled. Major growth unlikely."]}),p.jsxs("li",{children:[p.jsx("strong",{children:"100%"}),' — The edge is fully controlled. But the fire may STILL be actively burning inside. "100% contained" does NOT mean "out."']})]}),p.jsx(_e,{children:"How Far Away Should I Worry?"}),p.jsx(Pt,{headers:["Distance","What To Do"],rows:[[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"red"})," Under 5 km (3 miles)"]}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Immediate threat."})," This is evacuation-order range. Embers can fly this far in wind."]})],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"orange"})," 5-15 km (3-10 miles)"]}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Prepare."})," The fire could reach you in hours under bad conditions. Have a plan."]})],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"yellow"})," 15-30 km (10-20 miles)"]}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Watch."})," Smoke is likely. Wind shifts could change things fast."]})],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"green"})," Over 30 km (20 miles)"]}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Awareness."})," Keep an eye on it, but no immediate threat."]})]]}),p.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."}),p.jsx(_e,{children:"Which Matters More — Size or Distance?"}),p.jsxs("p",{children:[p.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."]}),p.jsx(_e,{children:"Setting It Up"}),p.jsxs("p",{children:["Just configure your state code (like ",p.jsx(fe,{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."]}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://inciweb.nwcg.gov",children:"InciWeb"})," — detailed incident information"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://data-nifc.opendata.arcgis.com",children:"NIFC Fire Map"})," — raw perimeter data"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.ready.gov/wildfires",children:"Ready.gov Wildfires"})," — preparedness guide"]})]})]}),p.jsxs(Nr,{id:"firms",title:"Satellite Fire Detection (FIRMS)",children:[p.jsx(_e,{children:"What You're Looking At"}),p.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.`}),p.jsxs("p",{children:[p.jsx("strong",{children:"Why this matters"}),": satellite hotspots show up ",p.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."]}),p.jsx(_e,{children:"Confidence — Is It Really a Fire?"}),p.jsx("p",{children:"Each detection gets a confidence rating:"}),p.jsx(Pt,{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."]]}),p.jsxs("p",{children:[p.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.`]}),p.jsx(_e,{children:"FRP — How Intense Is It?"}),p.jsx("p",{children:'FRP (Fire Radiative Power) measures the heat output in megawatts. Think of it as "how hot is this thing":'}),p.jsx(Pt,{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"]]}),p.jsx("p",{children:"Setting the minimum FRP to 5 MW filters out most industrial and agricultural false alarms."}),p.jsx(_e,{children:"New Ignition Detection"}),p.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 ",p.jsx("strong",{children:"potential new ignition"})," — maybe a new fire just started. These get elevated priority regardless of confidence level."]}),p.jsx(_e,{children:"Timing"}),p.jsxs("p",{children:["Satellite data arrives ",p.jsx("strong",{children:"1-3 hours"})," after the satellite passes overhead. Each location gets observed about ",p.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."`]}),p.jsx(_e,{children:"Getting an API Key"}),p.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:["Go to ",p.jsx(Ht,{href:"https://firms.modaps.eosdis.nasa.gov/api/area/",children:"FIRMS API page"})]}),p.jsx("li",{children:'Click "Get MAP_KEY"'}),p.jsx("li",{children:"Register for a free Earthdata account"}),p.jsx("li",{children:"Your key arrives by email"}),p.jsx("li",{children:"Enter it in Config → Environmental → FIRMS"})]}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://firms.modaps.eosdis.nasa.gov",children:"FIRMS Fire Map"})," — see hotspots on a map"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://earthdata.nasa.gov/data/tools/firms/faq",children:"FIRMS FAQ"})," — how it works"]})]})]}),p.jsxs(Nr,{id:"fire-tracker",title:"Fire Tracker (Fusion)",children:[p.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."}),p.jsx(_e,{children:"What you'll see on the mesh"}),p.jsx("p",{children:"Six fire-family alert categories, in order of when they fire during an incident's lifecycle:"}),p.jsx(Pt,{headers:["Category","Severity","Trigger","Example broadcast"],rows:[[p.jsx(fe,{children:"unattributed_hotspot_cluster"}),"Priority","3+ FIRMS pixels within 1 mi over 60 min, no WFIGS match — possible new ignition before NIFC declares it",p.jsx("span",{className:"text-amber-300",children:"🔥 Possible new fire: 3 hotspots within 1 mi @ 42.93,-114.45 (combined 78 MW)"})],[p.jsx(fe,{children:"wildfire_declared"}),"Priority","WFIGS first-sight of a new IRWIN incident — the official 'this is a fire and here is its name' record",p.jsx("span",{className:"text-amber-300",children:"🔥 New: Cache Peak Fire (WF), 3 mi N of Almo: 250 ac, 0% contained"})],[p.jsx(fe,{children:"wildfire_growth"}),"Priority","Per-pass centroid drift >= 0.5 mi (configurable) between consecutive satellite passes — the fire's footprint moved",p.jsx("span",{className:"text-amber-300",children:"🔥 Cache Peak Fire moving NE 1.2 mi/h, ~3 mi from Almo"})],[p.jsx(fe,{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",p.jsx("span",{className:"text-amber-300",children:"🔥 Possible spotting 2.1 mi NE of Cache Peak Fire perimeter"})],[p.jsx(fe,{children:"wildfire_incident"}),"Priority","WFIGS acreage or containment increased on a fire already broadcast once (the Update path; the New path uses wildfire_declared)",p.jsx("span",{className:"text-amber-300",children:"🔥 Update: Cache Peak Fire: 1,847 ac, 23% contained"})],[p.jsx(fe,{children:"wildfire_halted"}),"Routine","No FIRMS pixels attributed for 12+ hours (configurable) — fire stalled or out",p.jsx("span",{className:"text-amber-300",children:"🔥 Cache Peak Fire no growth in 14h"})]]}),p.jsx(_e,{children:"Daily LLM digest"}),p.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:"," ",p.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 ",p.jsx(fe,{children:"fires.digest_*"})," ","keys on the Adapter Config page."]}),p.jsx(_e,{children:"How attribution works"}),p.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 ",p.jsx(fe,{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."]}),p.jsxs("p",{children:["Pixels that match no fire feed the cluster detector instead: if at least"," ",p.jsx(fe,{children:"cluster_min_pixels"})," (default 3) lie within"," ",p.jsx(fe,{children:"cluster_max_radius_mi"})," (default 1.0) over"," ",p.jsx(fe,{children:"cluster_time_window_minutes"})," (default 60), the bot fires a single ",p.jsx(fe,{children:"unattributed_hotspot_cluster"})," broadcast and marks the member pixels so a fourth arrival doesn't re-fire the same cluster."]}),p.jsx(_e,{children:"How movement is computed"}),p.jsxs("p",{children:["Each VIIRS pass groups pixels into a ",p.jsx(fe,{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 ≥ ",p.jsx(fe,{children:"growth_drift_threshold_mi"})," the"," ",p.jsx(fe,{children:"wildfire_growth"})," broadcast fires."]}),p.jsx(_e,{children:"How spotting is detected"}),p.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 ≥"," ",p.jsx(fe,{children:"spotting_distance_threshold_mi"})," (default 1.5) fire the"," ",p.jsx(fe,{children:"wildfire_spotting"})," broadcast at ",p.jsx("em",{children:"immediate"})," severity — spread beyond the existing perimeter is the most actionable fire signal we emit. A per-fire cooldown (",p.jsx(fe,{children:"spotting_cooldown_seconds"}),", default 1 h) prevents an ember burst in the same area from spamming the mesh."]}),p.jsx(_e,{children:"Tunable knobs (Adapter Config → fires)"}),p.jsx(Pt,{headers:["Key","Default","What it does"],rows:[[p.jsx(fe,{children:"spread_radius_mi_default"}),"5.0 mi","Attribution radius for FIRMS → fire matching. Per-fire override in the fires.spread_radius_mi column."],[p.jsx(fe,{children:"growth_drift_threshold_mi"}),"0.5 mi","Per-pass centroid drift at or above this fires wildfire_growth."],[p.jsx(fe,{children:"halt_passes_threshold"}),"2","Consecutive empty satellite passes before wildfire_halted (documented; the time gate below is the operational rule)."],[p.jsx(fe,{children:"halt_minimum_seconds"}),"43,200 (12 h)","Minimum elapsed seconds since the most recent attributed pixel before wildfire_halted can fire."],[p.jsx(fe,{children:"spotting_distance_threshold_mi"}),"1.5 mi","Distance from prior-pass perimeter that fires wildfire_spotting."],[p.jsx(fe,{children:"spotting_cooldown_seconds"}),"3,600 (1 h)","Minimum seconds between consecutive spotting broadcasts per fire."],[p.jsx(fe,{children:"digest_enabled"}),"true","Master toggle for the twice-daily digest."],[p.jsx(fe,{children:"digest_schedule"}),'["06:00","18:00"]',"Local-time slots for the digest."],[p.jsx(fe,{children:"digest_timezone"}),"America/Boise","IANA tz for digest_schedule."],[p.jsx(fe,{children:"digest_max_chars"}),"200","Hard cap on the digest wire (the LLM is told to fit; the chunker enforces)."]]})]}),p.jsxs(Nr,{id:"weather-alerts",title:"Weather Alerts",children:[p.jsx(_e,{children:"What You're Looking At"}),p.jsx("p",{children:"MeshAI watches for NWS (National Weather Service) alerts affecting your area — warnings, watches, and advisories."}),p.jsx(_e,{children:"Alert Severity — How Serious Is It?"}),p.jsx(Pt,{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"]]}),p.jsx(_e,{children:"When Should I Act? (Urgency)"}),p.jsx(Pt,{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"]]}),p.jsx(_e,{children:"How Sure Are They? (Certainty)"}),p.jsx(Pt,{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"]]}),p.jsx(_e,{children:"These Are Separate Scales"}),p.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."'}),p.jsx(_e,{children:"What Minimum Severity Should I Set?"}),p.jsx(Pt,{headers:["Setting","What You Get","What You Miss"],rows:[["Minor","Everything — high volume","Nothing"],[p.jsxs(p.Fragment,{children:[p.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"]]}),p.jsxs("p",{children:[p.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."]}),p.jsx(_e,{children:"Finding Your NWS Zone"}),p.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:["Go to ",p.jsx(Ht,{href:"https://www.weather.gov",children:"weather.gov"})]}),p.jsx("li",{children:"Enter your location"}),p.jsxs("li",{children:["Find your zone code at ",p.jsx(Ht,{href:"https://www.weather.gov/pimar/PubZone",children:"NWS Zone Map"})]}),p.jsxs("li",{children:["Zone codes look like: ",p.jsx(fe,{children:"IDZ016"}),", ",p.jsx(fe,{children:"UTZ040"}),", etc."]})]}),p.jsx(_e,{children:"The User-Agent Field"}),p.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:"}),p.jsx("p",{children:p.jsx(fe,{children:"(meshai, you@email.com)"})}),p.jsx("p",{children:"No registration. No waiting. Just type it in."}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://alerts.weather.gov",children:"NWS Active Alerts"})," — see current alerts"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.weather.gov/documentation/services-web-api",children:"NWS API Docs"})," — technical details"]})]})]}),p.jsxs(Nr,{id:"solar",title:"Solar & Geomagnetic Conditions",children:[p.jsx(_e,{children:"What You're Looking At"}),p.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."}),p.jsx(_e,{children:"Solar Flux Index (SFI)"}),p.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.'}),p.jsx(Pt,{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."]]}),p.jsxs("p",{children:[p.jsx("strong",{children:"Quick rule"}),": SFI above 90 and Kp below 4 = good day for HF radio."]}),p.jsx(_e,{children:"Kp Index"}),p.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."}),p.jsx(Pt,{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."],[p.jsx("strong",{children:"5"}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Minor storm (G1)."})," HF noticeably degraded. Aurora visible at high latitudes (~60°N)."]})],[p.jsx("strong",{children:"6"}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Moderate storm (G2)."})," HF getting rough. Aurora moving south (~55°N)."]})],[p.jsx("strong",{children:"7"}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Strong storm (G3)."})," HF unreliable for 1-2 days. Aurora at mid-latitudes."]})],[p.jsx("strong",{children:"8-9"}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Severe/Extreme storm."})," HF may black out completely. Aurora visible at very low latitudes. Power grid stress possible."]})]]}),p.jsx(_e,{children:"R / S / G Scales"}),p.jsx("p",{children:"NOAA's shorthand for three types of space weather events:"}),p.jsx(Dl,{children:"R (Radio Blackouts) — from solar flares:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsx("li",{children:"R1-R2: Brief HF disruption. You might not notice."}),p.jsx("li",{children:"R3: HF goes out for about an hour on the sunlit side of Earth."}),p.jsx("li",{children:"R4-R5: HF dead for hours. Serious."})]}),p.jsx(Dl,{children:"S (Solar Radiation Storms) — from energetic particles:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsx("li",{children:"Mostly affects polar regions and satellites"}),p.jsx("li",{children:"S3+: Polar HF goes out entirely"})]}),p.jsx(Dl,{children:"G (Geomagnetic Storms) — from solar wind disturbances:"}),p.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:p.jsx("li",{children:"Same as the Kp scale: G1 = Kp 5, up to G5 = Kp 9"})}),p.jsx(_e,{children:"Bz — The Storm Predictor"}),p.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."}),p.jsx(Pt,{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."]]}),p.jsx("p",{children:"Bz can change fast — minute to minute. What matters is whether it stays negative for hours, not brief dips."}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.swpc.noaa.gov",children:"SWPC Space Weather Dashboard"})," — live data"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.swpc.noaa.gov/noaa-scales-explanation",children:"NOAA Space Weather Scales"})," — what R/S/G mean"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.hamqsl.com/solar.html",children:"HamQSL Solar Page"})," — ham-friendly display"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.swpc.noaa.gov/products/planetary-k-index",children:"Planetary K-Index"})," — live Kp"]})]})]}),p.jsxs(Nr,{id:"ducting",title:"Tropospheric Ducting",children:[p.jsx(_e,{children:"What You're Looking At"}),p.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.'}),p.jsx("p",{children:"MeshAI watches for these conditions by analyzing weather data (temperature and humidity at different altitudes) over your mesh area."}),p.jsx(_e,{children:"How Do I Know If Ducting Is Happening?"}),p.jsx("p",{children:'MeshAI reports a "condition" based on the atmospheric profile:'}),p.jsx(Pt,{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.']]}),p.jsx(_e,{children:"What You'll Actually Notice"}),p.jsx("p",{children:"When ducting happens on your mesh:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsx("li",{children:"Distant repeaters you've never heard suddenly come in"}),p.jsx("li",{children:"Nodes appear from far outside your normal range"}),p.jsx("li",{children:"You hear FM radio stations from other cities"}),p.jsx("li",{children:"ADS-B flight tracking range gets much longer"}),p.jsx("li",{children:"There might be interference from distant stations on your frequency"})]}),p.jsx(_e,{children:"The dM/dz Number"}),p.jsx("p",{children:`The dashboard shows a "dM/dz" value in "M-units/km." You don't need to understand the math — just know:`}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx("strong",{children:"Around 118"})," = normal atmosphere"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Below 79"})," = enhanced propagation starting"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Below 0 (negative)"})," = ducting is happening"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Below -50"})," = strong ducting — classic VHF/UHF DX event"]})]}),p.jsx(_e,{children:"When Does Ducting Happen?"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsx("li",{children:"Under high-pressure weather systems (clear, stable air)"}),p.jsx("li",{children:"When warm air sits on top of cool air (temperature inversion)"}),p.jsx("li",{children:"Most common in late summer and early fall"}),p.jsx("li",{children:"Strongest along coastlines and over water"}),p.jsx("li",{children:"In mountain valleys: cold air pooling in fall/winter can create surface ducts"})]}),p.jsx(_e,{children:"Setting It Up"}),p.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."}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://dxinfocentre.com/tropo.html",children:"Tropo Forecast Maps (Hepburn)"})," — 6-day tropo prediction"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://dxmaps.com",children:"DX Maps"})," — real-time VHF/UHF propagation reports"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://en.wikipedia.org/wiki/Tropospheric_propagation",children:"Wikipedia: Tropospheric Propagation"})," — background"]})]})]}),p.jsxs(Nr,{id:"avalanche",title:"Avalanche Danger",children:[p.jsx(_e,{children:"What You're Looking At"}),p.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."}),p.jsx(_e,{children:"The Danger Scale"}),p.jsx(Pt,{headers:["Level","Name","Color","What To Do"],rows:[["1","Low",p.jsx(pr,{color:"green"}),"Generally safe. Normal caution in steep terrain."],["2","Moderate",p.jsx(pr,{color:"yellow"}),"Be careful on specific terrain features. Evaluate conditions."],["3","Considerable",p.jsx(pr,{color:"orange"}),p.jsxs(p.Fragment,{children:[p.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",p.jsx(pr,{color:"red"}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Very dangerous."})," Stay off anything steep."]})],["5","Extreme",p.jsx(pr,{color:"black"}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Don't go out."})," Avalanches are happening on their own."]})]]}),p.jsx(_e,{children:"The Most Important Thing to Know"}),p.jsxs("p",{children:[p.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.']}),p.jsx(_e,{children:"Seasonal"}),p.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.'}),p.jsx(_e,{children:"Finding Your Avalanche Center"}),p.jsxs("p",{children:["Go to ",p.jsx(Ht,{href:"https://avalanche.org/avalanche-centers/",children:"avalanche.org/avalanche-centers/"})," for a map. Common center codes:"]}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(fe,{children:"SNFAC"})," — Sawtooth (central Idaho)"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"UAC"})," — Utah"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"NWAC"})," — Cascades/Olympics (WA/OR)"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"CAIC"})," — Colorado"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"SAC"})," — Sierra Nevada (CA)"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GNFAC"})," — Gallatin (SW Montana)"]})]}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://avalanche.org",children:"Avalanche.org"})," — US forecasts"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://avalanche.org/avalanche-encyclopedia/human/resources/north-american-public-avalanche-danger-scale/",children:"Avalanche Danger Scale"})," — full scale explanation"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://kbyg.org",children:"Know Before You Go"})," — avalanche awareness"]})]})]}),p.jsxs(Nr,{id:"traffic",title:"Traffic Flow",children:[p.jsx(_e,{children:"What You're Looking At"}),p.jsx("p",{children:"MeshAI monitors traffic speed on road segments you configure, using data from TomTom (real vehicles with navigation apps reporting their speed)."}),p.jsx(_e,{children:"Speed Ratio — The Key Number"}),p.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:'}),p.jsx(Pt,{headers:["Ratio","What It Means"],rows:[[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"green"})," Above 85%"]}),"Normal. Traffic flowing fine."],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"yellow"})," 65-85%"]}),"Slow. Heavier than usual but moving."],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"orange"})," 40-65%"]}),"Congested. Significant delays."],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"red"})," Below 40%"]}),"Gridlock. Barely moving."]]}),p.jsxs("p",{children:[p.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.`]}),p.jsx(_e,{children:"Confidence — Can You Trust the Data?"}),p.jsx("p",{children:"TomTom's confidence score tells you how much of the reading comes from real vehicles right now vs historical averages:"}),p.jsx(Pt,{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",p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Unreliable"})," — mostly guessing from historical patterns. Don't alert on this."]})]]}),p.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."}),p.jsx(_e,{children:"Setting Up Corridors"}),p.jsx("p",{children:'Each "corridor" is a point on a road you want to monitor. To add one:'}),p.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[p.jsx("li",{children:"Go to Google Maps, find the road"}),p.jsx("li",{children:`Right-click the road → "What's here?" → copy the coordinates`}),p.jsx("li",{children:"Add the corridor in Config with a name and those coordinates"}),p.jsx("li",{children:"TomTom finds the nearest road segment automatically"})]}),p.jsx(_e,{children:"Getting an API Key"}),p.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:["Sign up at ",p.jsx(Ht,{href:"https://developer.tomtom.com",children:"developer.tomtom.com"})," (free)"]}),p.jsx("li",{children:"Create an app → get your API key"}),p.jsx("li",{children:"Free tier: 2,500 requests/day (plenty for 5-10 corridors)"})]}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://developer.tomtom.com",children:"TomTom Developer Portal"})," — API docs and key signup"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.tomtom.com/traffic-index/",children:"TomTom Traffic Index"})," — city congestion rankings"]})]})]}),p.jsxs(Nr,{id:"roads-511",title:"Road Conditions (511)",children:[p.jsx(_e,{children:"What You're Looking At"}),p.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."}),p.jsx(_e,{children:"Setting It Up"}),p.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."}),p.jsx("p",{children:"Configure in Config → Environmental → 511:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx("strong",{children:"Base URL"})," — your state's API endpoint"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"API Key"})," — if required by your state"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Endpoints"})," — which data feeds to poll (varies by state)"]})]}),p.jsx(_e,{children:"Learn More"}),p.jsx("p",{children:"Check your state's 511 or DOT website for developer information."})]}),p.jsxs(Nr,{id:"mesh-health",title:"Mesh Health",children:[p.jsx(_e,{children:"Health Score"}),p.jsx("p",{children:"MeshAI computes a 0-100 health score for your mesh network by looking at five areas, each weighted differently:"}),p.jsx(Pt,{headers:["Pillar","Weight","What It Measures"],rows:[[p.jsx("strong",{children:"Infrastructure"}),"30%","Are your routers online?"],[p.jsx("strong",{children:"Utilization"}),"25%","Is the radio channel congested?"],[p.jsx("strong",{children:"Coverage"}),"20%","Do nodes have redundant paths to gateways?"],[p.jsx("strong",{children:"Behavior"}),"15%","Are any nodes flooding the channel?"],[p.jsx("strong",{children:"Power"}),"10%","Are battery-powered nodes running low?"]]}),p.jsx("p",{children:"The overall score is the weighted sum:"}),p.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%)"}),p.jsx(_e,{children:"How Each Pillar Is Calculated"}),p.jsx(Dl,{children:"Infrastructure (30%)"}),p.jsx("p",{children:"This is the simplest pillar — what percentage of your infrastructure nodes are currently online?"}),p.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"(routers online ÷ total routers) × 100"}),p.jsxs("p",{children:["Only nodes with the ",p.jsx(fe,{children:"ROUTER"}),", ",p.jsx(fe,{children:"ROUTER_LATE"}),", or ",p.jsx(fe,{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."]}),p.jsxs("p",{children:[p.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."]}),p.jsx(Dl,{children:"Utilization (25%)"}),p.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 ",p.jsx("strong",{children:"highest"})," value from any infrastructure node because the busiest router is the bottleneck for the whole mesh."]}),p.jsx("p",{children:p.jsx("strong",{children:"How it works:"})}),p.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-4",children:[p.jsxs("li",{children:["Collect ",p.jsx(fe,{children:"channel_utilization"})," from all infrastructure nodes that report it"]}),p.jsx("li",{children:"If no infra nodes have telemetry, try all nodes"}),p.jsxs("li",{children:["Use the ",p.jsx("strong",{children:"maximum"})," value for scoring (busiest node = bottleneck)"]}),p.jsx("li",{children:"If no nodes report utilization (older firmware), fall back to packet count estimate"})]}),p.jsxs("p",{className:"mt-4",children:[p.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."]}),p.jsx(Pt,{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"]]}),p.jsxs("p",{children:[p.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."]}),p.jsx(Dl,{children:"Coverage (20%)"}),p.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.'}),p.jsxs("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:["coverage_ratio = average_gateways_per_node ÷ total_sources",p.jsx("br",{}),"single_gw_penalty = (single_gateway_nodes ÷ total_nodes) × 40"]}),p.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."}),p.jsx(Pt,{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"]]}),p.jsxs("p",{children:[p.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.)."]}),p.jsx(Dl,{children:"Behavior (15%)"}),p.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."}),p.jsxs("p",{children:[p.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."]}),p.jsx(Pt,{headers:["Flagged Nodes","Score"],rows:[["0","100"],["1","80"],["2-3","60"],["4-5","40"],["6+","20"]]}),p.jsx("p",{children:"A single misbehaving node only drops the score to 80. It takes multiple problem nodes to seriously hurt the behavior pillar."}),p.jsx(Dl,{children:"Power (10%)"}),p.jsx("p",{children:"Measures what fraction of battery-powered nodes are below the warning threshold (default 20%)."}),p.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"100 × (1 − low_battery_nodes ÷ total_battery_nodes)"}),p.jsx("p",{children:"If 2 out of 10 battery nodes are below 20%, power scores 80."}),p.jsxs("p",{children:[p.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."]}),p.jsx(_e,{children:"Health Tiers"}),p.jsx(Pt,{headers:["Score","Tier","What It Means"],rows:[["90-100",p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"green"})," Healthy"]}),"Everything's working well."],["75-89",p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"yellow"})," Slight degradation"]}),"Some issues but the mesh is functional."],["50-74",p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"orange"})," Unhealthy"]}),"Multiple problems. Reliability is affected."],["25-49",p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"red"})," Warning"]}),"Significant issues. The mesh is struggling."],["0-24",p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"black"})," Critical"]}),"Major failures. Barely functional."]]}),p.jsx(_e,{children:"Channel Utilization — Is the Radio Channel Full?"}),p.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."}),p.jsx(Pt,{headers:["Utilization","What's Happening"],rows:[[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"green"})," Under 25%"]}),"Healthy. The firmware itself starts throttling above 25% to protect the channel — so under 25% is the target."],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"yellow"})," 25-40%"]}),"Getting busy. Common on larger meshes. Worth watching."],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"orange"})," 40-50%"]}),"Congested. The firmware throttles GPS updates above 40%. Messages are colliding and retrying."],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"red"})," Over 50%"]}),"Serious problem. More time is spent retrying than communicating. Mesh reliability drops fast."],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"black"})," Over 65%"]}),"Documented failure point on busy LONG_FAST meshes. The mesh becomes unusable."]]}),p.jsx(_e,{children:"Packet Flooding"}),p.jsx("p",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-yellow-200",children:p.jsx("strong",{children:'⚠️ "Packet flooding" means a node sending too many RADIO PACKETS. This has nothing to do with water flooding.'})}),p.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."}),p.jsx(Pt,{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."]]}),p.jsx(_e,{children:"Battery Levels"}),p.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:"}),p.jsx(Pt,{headers:["Voltage","Charge","What To Do"],rows:[["4.20V","100%","Full"],["3.80V","~60%","Fine"],[p.jsx("strong",{children:"3.60V"}),p.jsx("strong",{children:"~30%"}),p.jsx(p.Fragment,{children:p.jsx("strong",{children:"⚠️ Warning — charge it soon"})})],[p.jsx("strong",{children:"3.50V"}),p.jsx("strong",{children:"~15%"}),p.jsx(p.Fragment,{children:p.jsx("strong",{children:"🔴 Low — charge it now"})})],[p.jsx("strong",{children:"3.40V"}),p.jsx("strong",{children:"~7%"}),p.jsx(p.Fragment,{children:p.jsx("strong",{children:"⚫ About to die"})})],["3.30V","~3%","Device shutting down"]]}),p.jsxs("p",{children:[p.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."]}),p.jsx(_e,{children:"Node Offline Detection"}),p.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:`}),p.jsx(Pt,{headers:["Node Type","Recommended Threshold","Why"],rows:[["Fixed infrastructure (wall power)",p.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."]]}),p.jsxs("p",{children:[p.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.`]})]}),p.jsxs(Nr,{id:"broadcast-types",title:"Broadcast Types",children:[p.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:"}),p.jsx(Pt,{headers:["Prefix","What it means","When you see it"],rows:[[p.jsx(fe,{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"],[p.jsx(fe,{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"],[p.jsx(fe,{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"]]}),p.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."})]}),p.jsxs(Nr,{id:"reminders",title:"Reminder System",children:[p.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"," ",p.jsx(fe,{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."]}),p.jsx(_e,{children:"Cadences"}),p.jsx(Pt,{headers:["Adapter","Reminder cadence","Termination"],rows:[[p.jsxs(p.Fragment,{children:[p.jsx(fe,{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"],[p.jsxs(p.Fragment,{children:[p.jsx(fe,{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"],[p.jsx(fe,{children:"itd_511_work_zone"}),"Per-zone, configurable in the rule UI","WZDx publishes the zone with end_date in the past"]]}),p.jsx(_e,{children:"The tombstone"}),p.jsxs("p",{children:["When a WFIGS update declares an incident closed, the bot stamps"," ",p.jsx(fe,{children:"fires.tombstoned_at"})," with the close time. The reminder scheduler treats ",p.jsx(fe,{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.`]}),p.jsx(_e,{children:"Turning reminders off"}),p.jsxs("p",{children:["Per-adapter on/off lives in ",p.jsx(fe,{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."]})]}),p.jsxs(Nr,{id:"notifications",title:"Notifications",children:[p.jsx(_e,{children:"How It Works"}),p.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx("strong",{children:"Something happens"})," — a fire is detected, weather warning issued, node goes offline, etc."]}),p.jsxs("li",{children:[p.jsx("strong",{children:"MeshAI checks your rules"})," — does this event match any of your notification rules? Is it severe enough?"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"If a rule matches"})," — MeshAI sends the notification through whatever delivery method that rule is configured for."]})]}),p.jsx(_e,{children:"Building Rules"}),p.jsx("p",{children:"Each rule answers three questions:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx("strong",{children:"WHEN"})," does it trigger? (which categories, what severity)"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"WHERE"})," does it send? (mesh broadcast, email, webhook, etc.)"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"HOW OFTEN"})," at most? (cooldown period)"]})]}),p.jsx("p",{children:'Use "Add from Template" to start with a pre-built rule and customize it, or build from scratch with "Add Rule."'}),p.jsx(_e,{children:"Severity Levels — What Should I Set?"}),p.jsx(Pt,{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"],[p.jsxs(p.Fragment,{children:[p.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"]]}),p.jsxs("p",{children:[p.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."]}),p.jsx(_e,{children:"Webhook — The Swiss Army Knife"}),p.jsx("p",{children:"A webhook sends your alert as an HTTP POST to any URL. This one delivery method works with:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx("strong",{children:"Discord"})," — use a Discord webhook URL"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Slack"})," — use a Slack incoming webhook URL"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"ntfy.sh"})," — POST to ",p.jsx(fe,{children:"https://ntfy.sh/your-topic"})]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Pushover"})," — POST to the Pushover API"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Home Assistant"})," — POST to an automation webhook URL"]}),p.jsx("li",{children:"Anything else that accepts HTTP POST"})]}),p.jsx("p",{children:"MeshAI doesn't need to know what's on the other end. Give it the URL and it works."})]}),p.jsxs(Nr,{id:"commands",title:"Commands",children:[p.jsxs("p",{children:["All commands use the ",p.jsx(fe,{children:"!"})," prefix (configurable). Send these as a direct message to MeshAI on your mesh."]}),p.jsx(_e,{children:"Basic Commands"}),p.jsx(Pt,{headers:["Command","What It Does"],rows:[[p.jsx(fe,{children:"!help"}),"Shows all available commands"],[p.jsx(fe,{children:"!ping"}),"Tests if the bot is alive"],[p.jsx(fe,{children:"!status"}),"Quick mesh summary (nodes online, health score)"],[p.jsx(fe,{children:"!health"}),"Detailed health report with pillar scores"],[p.jsx(fe,{children:"!weather"}),"Current weather for your area"]]}),p.jsx(_e,{children:"Environmental Commands"}),p.jsx(Pt,{headers:["Command","What It Does"],rows:[[p.jsx(fe,{children:"!alerts"}),"Active NWS weather alerts for your area"],[p.jsxs(p.Fragment,{children:[p.jsx(fe,{children:"!solar"})," (or ",p.jsx(fe,{children:"!hf"}),")"]}),"Current solar indices and RF conditions"],[p.jsx(fe,{children:"!fire"}),"Active wildfires near your mesh"],[p.jsx(fe,{children:"!avy"}),'Avalanche advisory (seasonal — shows "off season" in summer)'],[p.jsxs(p.Fragment,{children:[p.jsx(fe,{children:"!streams"})," (or ",p.jsx(fe,{children:"!gauges"}),")"]}),"Stream gauge readings"],[p.jsxs(p.Fragment,{children:[p.jsx(fe,{children:"!roads"})," (or ",p.jsx(fe,{children:"!traffic"}),")"]}),"Road conditions and traffic flow"],[p.jsx(fe,{children:"!hotspots"}),"Satellite fire detections"]]}),p.jsx(_e,{children:"Subscription Commands"}),p.jsx(Pt,{headers:["Command","What It Does"],rows:[[p.jsx(fe,{children:"!subscribe"}),"Lists all alert categories you can subscribe to"],[p.jsx(fe,{children:"!subscribe fire_proximity"}),"Subscribe to a specific category"],[p.jsx(fe,{children:"!subscribe all"}),"Subscribe to everything"],[p.jsx(fe,{children:"!unsubscribe fire_proximity"}),"Unsubscribe from a category"],[p.jsx(fe,{children:"!subscriptions"}),"Shows what you're currently subscribed to"]]}),p.jsx(_e,{children:"Conversational"}),p.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`," ",p.jsx("a",{href:"#llm-dm",className:"text-accent hover:underline",children:"LLM DM Queries"}),"."]})]}),p.jsxs(Nr,{id:"llm-dm",title:"LLM DM (Natural-Language Queries)",children:[p.jsxs("p",{children:["Bang commands like ",p.jsx(fe,{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."]}),p.jsx(_e,{children:"What it can answer"}),p.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:"}),p.jsx(Pt,{headers:["Adapter block","Example question that hits it","What you get back"],rows:[[p.jsx(fe,{children:"build_fires_detail"}),'"are there any fires near me?"',"Active WFIGS-declared fires, acreage, containment, declared_at, county/state"],[p.jsx(fe,{children:"build_alerts_detail"}),'"any weather alerts?"',"Active NWS CAP alerts: type, severity, area, expiry"],[p.jsx(fe,{children:"build_quakes_detail"}),'"any earthquakes nearby?"',"USGS quakes in the last 24h: magnitude, depth, place"],[p.jsx(fe,{children:"build_traffic_detail"}),'"how is traffic on I-84?" / "any road closures?"',"TomTom + ITD 511 active incidents"],[p.jsx(fe,{children:"build_gauges_detail"}),'"what is the snake river level?"',"USGS NWIS latest readings + flood stages"],[p.jsx(fe,{children:"build_swpc_detail"}),'"what are the band conditions?" / "any space weather?"',"Recent SWPC events + band-conditions ratings"],[p.jsx(fe,{children:"build_drop_audit"}),`"why didn't I hear about anything today?"`,"Event log: what envelopes the dispatcher filtered, by adapter + category"]]}),p.jsx(_e,{children:"The grounding rule"}),p.jsxs("p",{children:["The bot is told to answer ",p.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.']}),p.jsx(_e,{children:"Excluding an adapter from LLM context"}),p.jsxs("p",{children:["The ",p.jsx(fe,{children:"include_in_llm_context"})," toggle on each adapter's row in Adapter Config decides whether that adapter's ",p.jsx(fe,{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."]}),p.jsx(_e,{children:"What it can't answer"}),p.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.`})]}),p.jsxs(Nr,{id:"or-not-and",title:"OR-not-AND Architecture",children:[p.jsx("p",{children:"Every environmental adapter pulls its data from one of two places:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.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."]}),p.jsxs("li",{children:[p.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."]})]}),p.jsx(_e,{children:"Why mutually exclusive"}),p.jsxs("p",{children:["An adapter is set to ",p.jsx("strong",{children:"either"})," Central ",p.jsx("strong",{children:"or"})," ","native, never both. Running both at the same time is what the codebase calls the ",p.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."]}),p.jsx(_e,{children:"The per-adapter source toggle"}),p.jsxs("p",{children:["Set ",p.jsx(fe,{children:"feed_source"})," on each adapter's row in Environment:"]}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(fe,{children:"central"})," — disable the native poll loop, subscribe to the matching Central subject pattern."]}),p.jsxs("li",{children:[p.jsx(fe,{children:"native"})," — disable the Central subscription for this adapter, run the native poller."]})]}),p.jsxs("p",{children:["On the GUI, adapters with ",p.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.`]}),p.jsx(_e,{children:"Where this surfaces in tooltips"}),p.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`," ",p.jsxs(fe,{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."]})]}),p.jsxs(Nr,{id:"adapter-config",title:"Adapter Config & the CODE Rule",children:[p.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."}),p.jsx(_e,{children:"The CONFIG-vs-CODE rule"}),p.jsx("p",{children:"Not everything tunable becomes a GUI row. The codebase splits along one rule:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.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)."]}),p.jsxs("li",{children:[p.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)."]})]}),p.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."}),p.jsx(_e,{children:"Restart-required vs live"}),p.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:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:["Anything under the ",p.jsx(fe,{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."]}),p.jsx("li",{children:"The LLM backend swap (Google → Anthropic → OpenAI)."}),p.jsx("li",{children:"The dispatcher cold-start grace window."})]}),p.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.`}),p.jsxs(_e,{children:["The ",p.jsx(fe,{children:"include_in_llm_context"})," toggle"]}),p.jsxs("p",{children:[`Each adapter's card on Adapter Config carries a per-adapter "LLM context" switch. When off, that adapter's `,p.jsx(fe,{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."]})]}),p.jsxs(Nr,{id:"curation",title:"Curation: Gauge Sites & Town Anchors",children:[p.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."}),p.jsx(_e,{children:"Gauge Sites"}),p.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."}),p.jsxs("p",{children:[p.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."]}),p.jsxs("p",{children:[p.jsx("strong",{children:"Disabled rows"})," are ignored at dispatch time. The corresponding gauge still ingests into ",p.jsx(fe,{children:"gauge_readings"})," ","(so historical queries still work), it just doesn't broadcast."]}),p.jsx(_e,{children:"Town Anchors"}),p.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:']}),p.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[p.jsx("li",{children:'Photon nearest-town lookup (the WFIGS path uses this — produces "near Long Creek Summit Home" style anchors)'}),p.jsx("li",{children:"Town Anchors table (your curated list)"}),p.jsx("li",{children:"Landclass label (county / federal-land identifier)"}),p.jsx("li",{children:"County + state fallback"}),p.jsx("li",{children:"Bare lat/lon coords"})]}),p.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.'}),p.jsxs("p",{children:["Example broadcast text rendered from a Town Anchors row:"," ",p.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"'})]})]}),p.jsxs(Nr,{id:"schema",title:"Schema Migrations",children:[p.jsxs("p",{children:["MeshAI persists state in a single SQLite database (",p.jsx(fe,{children:"/data/meshai.sqlite"}),") with WAL journaling. Schema migrations live in ",p.jsx(fe,{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 ",p.jsx(fe,{children:"schema_meta.version"})," in order. Idempotent re-runs are no-ops."]}),p.jsx(_e,{children:"v0.6 + v0.7 additions"}),p.jsx(Pt,{headers:["Migration","What it added"],rows:[[p.jsx(fe,{children:"v11"}),"first_broadcast_at + last_broadcast_at split + reminder_enabled per adapter (the schema basis for New / Update / Active)"],[p.jsx(fe,{children:"v12"}),"fires.tombstoned_at (WFIGS closure stamp; terminates the reminder loop)"],[p.jsx(fe,{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"],[p.jsx(fe,{children:"v14"}),"Fire Tracker Phase 2 — fire_passes table (per-satellite-pass centroid + drift) + last_pass_id + halt_broadcast_at on fires"],[p.jsx(fe,{children:"v15"}),"Fire Tracker Phase 3 — fire_passes.perimeter_geojson (convex hull) + fires.last_spotting_broadcast_at"],[p.jsx(fe,{children:"v16"}),"Fire Tracker Phase 4 — fire_digest_broadcasts table (idempotent twice-daily LLM digest)"]]}),p.jsx(_e,{children:"When migrations fail"}),p.jsxs("p",{children:["A migration failure leaves the database at the prior version and raises in the runner. Container logs surface the SQL error;"," ",p.jsx(fe,{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."]})]}),p.jsxs(Nr,{id:"api",title:"API Reference",children:[p.jsxs("p",{children:["MeshAI's REST API is available at ",p.jsx(fe,{children:"http://your-host:8080"}),". All endpoints return JSON."]}),p.jsx(_e,{children:"System"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/status"})," — version, uptime, node count"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/channels"})," — radio channel list"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"POST /api/restart"})," — restart the bot"]})]}),p.jsx(_e,{children:"Mesh Data"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/health"})," — health score and pillars"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/nodes"})," — all nodes with positions and telemetry"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/edges"})," — neighbor links with signal quality"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/regions"})," — region summaries"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/sources"})," — data source health"]})]}),p.jsx(_e,{children:"Configuration"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/config"})," — full config"]}),p.jsxs("li",{children:[p.jsxs(fe,{children:["GET /api/config/","{section}"]})," — one section"]}),p.jsxs("li",{children:[p.jsxs(fe,{children:["PUT /api/config/","{section}"]})," — update a section"]})]}),p.jsx(_e,{children:"Environmental"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/env/status"})," — per-feed health"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/env/active"})," — all active events"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/env/swpc"})," — solar/geomagnetic data"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/env/ducting"})," — atmospheric profile"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/env/fires"})," — wildfire perimeters"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/env/hotspots"})," — satellite fire detections"]})]}),p.jsx(_e,{children:"Alerts"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/alerts/active"})," — current alerts"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/alerts/history"})," — past alerts"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/notifications/categories"})," — available alert categories"]})]}),p.jsx(_e,{children:"Real-time"}),p.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:p.jsxs("li",{children:[p.jsx(fe,{children:"ws://your-host:8080/ws/live"})," — WebSocket for live updates"]})})]})]})})]})}const Aet=1500;function Met(){const[e,t]=G.useState({}),[r,n]=G.useState({}),[i,a]=G.useState(!0),[o,s]=G.useState(null),[l,u]=G.useState({}),[c,f]=G.useState({}),[h,d]=G.useState({}),v=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(()=>{v()},[v]);const m=G.useCallback((S,T,C)=>{f(A=>({...A,[S]:T})),C&&d(A=>({...A,[S]:C})),T==="saved"&&setTimeout(()=>{f(A=>A[S]==="saved"?{...A,[S]:"idle"}:A)},Aet)},[]),y=G.useCallback(async(S,T,C)=>{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:C})});if(!P.ok){const E=(await P.json().catch(()=>({}))).detail||P.statusText;m(A,"error",String(E));return}const O=await P.json();t(k=>({...k,[S]:(k[S]||[]).map(E=>E.key===T?O:E)})),m(A,"saved")}catch(P){m(A,"error",String(P))}},[m]),x=G.useCallback(async(S,T)=>{const C=`${S}.${T}`;m(C,"saving");try{const A=await fetch(`/api/adapter-config/${S}/${T}/reset`,{method:"POST"});if(!A.ok){m(C,"error",`reset failed (${A.status})`);return}const P=await A.json();t(O=>({...O,[S]:(O[S]||[]).map(k=>k.key===T?P:k)})),m(C,"saved")}catch(A){m(C,"error",String(A))}},[m]),_=G.useCallback(async(S,T)=>{const C=`meta:${S}`;m(C,"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 O=await A.json().catch(()=>({}));m(C,"error",String(O.detail||A.statusText));return}const P=await A.json();n(O=>({...O,[S]:P})),m(C,"saved")}catch(A){m(C,"error",String(A))}},[m]);if(i)return p.jsxs("div",{className:"p-6 flex items-center gap-2 text-slate-400",children:[p.jsx(L0,{className:"w-5 h-5 animate-spin"})," Loading adapter config…"]});if(o)return p.jsxs("div",{className:"p-6 text-red-400",children:[p.jsx(Mu,{className:"w-5 h-5 inline mr-2"}),"Failed to load: ",o]});const b=Array.from(new Set([...Object.keys(r),...Object.keys(e)])).sort();return p.jsxs("div",{className:"p-6 space-y-4",children:[p.jsxs("div",{className:"flex items-center gap-2 text-slate-200",children:[p.jsx(ZN,{className:"w-5 h-5"}),p.jsx("h1",{className:"text-xl font-semibold",children:"Adapter Config"}),p.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[Object.values(e).reduce((S,T)=>S+T.length,0)," settings across ",b.length," adapters"]})]}),p.jsxs("p",{className:"text-xs text-slate-400 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 ",p.jsx("a",{href:"/reference#adapter-config",className:"text-accent hover:underline",children:"Adapter Config & the CODE Rule"})," in Reference. The ",p.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."]}),b.map(S=>{const T=r[S]||{display_name:S,include_in_llm_context:!0,description:""},C=e[S]||[],A=l[S]??!1,P=`meta:${S}`,O=c[P]||"idle";return p.jsxs("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg",children:[p.jsxs("div",{className:"p-4 flex items-start gap-4",children:[p.jsx("button",{onClick:()=>u(k=>({...k,[S]:!k[S]})),className:"text-slate-400 hover:text-white","aria-label":"toggle expand",children:A?p.jsx(Bu,{className:"w-5 h-5"}):p.jsx(Au,{className:"w-5 h-5"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("h2",{className:"text-base font-semibold text-slate-100",children:T.display_name}),p.jsx("code",{className:"text-xs text-slate-500",children:S}),C.length>0&&p.jsxs("span",{className:"text-xs text-slate-400 ml-1",children:["(",C.length," settings)"]}),C.length===0&&p.jsx("span",{className:"text-xs text-slate-500 ml-1 italic",children:"(meta only)"})]}),T.description&&p.jsx("p",{className:"text-xs text-slate-400 mt-1",children:T.description})]}),p.jsxs("label",{className:"flex items-center gap-2 text-xs text-slate-300 select-none",children:[p.jsx("input",{type:"checkbox",checked:T.include_in_llm_context,onChange:k=>_(S,{include_in_llm_context:k.target.checked}),className:"w-4 h-4 accent-cyan-500"}),"LLM context",p.jsx(kae,{status:O,error:h[P]})]})]}),A&&C.length>0&&p.jsx("div",{className:"border-t border-slate-700 divide-y divide-slate-700/60",children:C.map(k=>p.jsx(Pet,{row:k,status:c[`${S}.${k.key}`]||"idle",error:h[`${S}.${k.key}`],onCommit:E=>y(S,k.key,E),onReset:()=>x(S,k.key)},k.key))})]},S)})]})}function Pet({row:e,status:t,error:r,onCommit:n,onReset:i}){const[a,o]=G.useState(ak(e));G.useEffect(()=>{o(ak(e))},[e.value,e.type]);const s=a!==ak(e),l=JSON.stringify(e.value)===JSON.stringify(e.default),u=()=>{const c=ket(a,e.type);c.error||c.changed(e.value)&&n(c.value)};return p.jsxs("div",{className:"px-6 py-3 flex items-start gap-4",children:[p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("code",{className:"text-sm font-mono text-cyan-300",children:e.key}),p.jsxs("span",{className:"text-xs text-slate-500",children:["[",e.type,"]"]}),!l&&p.jsx("span",{className:"text-xs text-amber-400",children:"edited"})]}),e.description&&p.jsx("p",{className:"text-xs text-slate-400 mt-1",children:e.description})]}),p.jsxs("div",{className:"flex items-center gap-2 min-w-[280px] justify-end",children:[e.type==="bool"?p.jsx("input",{type:"checkbox",checked:e.value===!0,onChange:c=>n(c.target.checked),className:"w-5 h-5 accent-cyan-500"}):e.type==="json"?p.jsx("textarea",{className:"w-72 h-20 bg-slate-900 border border-slate-700 rounded px-2 py-1 text-xs font-mono text-slate-100",value:a,onChange:c=>o(c.target.value),onBlur:u}):p.jsx("input",{type:e.type==="int"||e.type==="float"?"number":"text",step:e.type==="float"?"any":"1",className:"w-48 bg-slate-900 border border-slate-700 rounded px-2 py-1 text-sm text-slate-100",value:a,onChange:c=>o(c.target.value),onBlur:u,onKeyDown:c=>{c.key==="Enter"&&c.target.blur()}}),p.jsx(kae,{status:t,error:r,dirty:s}),p.jsx("button",{onClick:i,disabled:l,className:"text-slate-400 hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",title:"Reset to default",children:p.jsx(xT,{className:"w-4 h-4"})})]})]})}function kae({status:e,error:t,dirty:r}){return e==="saving"?p.jsx(L0,{className:"w-4 h-4 text-cyan-400 animate-spin"}):e==="saved"?p.jsx(ts,{className:"w-4 h-4 text-emerald-400"}):e==="error"?p.jsx("span",{title:t,className:"text-red-400 cursor-help",children:p.jsx(Mu,{className:"w-4 h-4"})}):r?p.jsx("span",{className:"w-2 h-2 bg-amber-400 rounded-full",title:"unsaved"}):p.jsx("span",{className:"w-4 h-4"})}function ak(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 ket(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 ok={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 Let(){const[e,t]=G.useState([]),[r,n]=G.useState(!0),[i,a]=G.useState(null),[o,s]=G.useState(null),[l,u]=G.useState(ok),[c,f]=G.useState(!1),[h,d]=G.useState("unknown"),v=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(()=>{v()},[v]),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}),f(!1)},y=()=>{f(!0),s(null),u({...ok})},x=()=>{s(null),f(!1),u(ok)},_=async()=>{try{const S=c?"/api/gauge-sites":`/api/gauge-sites/${o}`,C=await fetch(S,{method:c?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!C.ok){const A=await C.json().catch(()=>({}));alert(`save failed: ${A.detail||C.statusText}`);return}x(),v()}catch(S){alert(String(S))}},b=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}v()};return r?p.jsxs("div",{className:"p-6 text-slate-400",children:[p.jsx(L0,{className:"w-5 h-5 animate-spin inline mr-2"}),"Loading…"]}):i?p.jsxs("div",{className:"p-6 text-red-400",children:["Load failed: ",i]}):p.jsxs("div",{className:"p-6 space-y-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(pT,{className:"w-5 h-5 text-cyan-400"}),p.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:"Gauge Sites"}),p.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[e.length," sites"]}),p.jsxs("button",{onClick:y,className:"ml-auto flex items-center gap-1 px-3 py-1 bg-cyan-700 hover:bg-cyan-600 rounded text-white text-sm",children:[p.jsx(Vv,{className:"w-4 h-4"})," Add site"]})]}),p.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&&p.jsx(P7,{draft:l,setDraft:u,onSave:_,onCancel:x,adding:!0,feedSource:h}),p.jsx("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg overflow-x-auto",children:p.jsxs("table",{className:"w-full text-sm text-slate-200",children:[p.jsx("thead",{className:"bg-slate-900 text-xs text-slate-400 uppercase",children:p.jsxs("tr",{children:[p.jsx("th",{className:"px-3 py-2 text-left",children:"Site ID"}),p.jsx("th",{className:"px-3 py-2 text-left",children:"Name"}),p.jsx("th",{className:"px-3 py-2 text-right",children:"Lat,Lon"}),p.jsx("th",{className:"px-3 py-2 text-right",children:"Action"}),p.jsx("th",{className:"px-3 py-2 text-right",children:"Minor"}),p.jsx("th",{className:"px-3 py-2 text-right",children:"Moderate"}),p.jsx("th",{className:"px-3 py-2 text-right",children:"Major"}),p.jsx("th",{className:"px-3 py-2 text-center",children:"On"}),p.jsx("th",{className:"px-3 py-2"})]})}),p.jsx("tbody",{className:"divide-y divide-slate-700/60",children:e.map(S=>o===S.site_id?p.jsx("tr",{className:"bg-slate-900/40",children:p.jsx("td",{colSpan:9,className:"px-3 py-2",children:p.jsx(P7,{draft:l,setDraft:u,onSave:_,onCancel:x,feedSource:h})})},S.site_id):p.jsxs("tr",{className:"hover:bg-slate-800/50",children:[p.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:S.site_id}),p.jsx("td",{className:"px-3 py-2",children:S.gauge_name}),p.jsxs("td",{className:"px-3 py-2 text-right text-xs",children:[S.lat.toFixed(3),",",S.lon.toFixed(3)]}),p.jsx("td",{className:"px-3 py-2 text-right",children:S.action_ft??"-"}),p.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_minor_ft??"-"}),p.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_moderate_ft??"-"}),p.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_major_ft??"-"}),p.jsx("td",{className:"px-3 py-2 text-center",children:S.enabled?p.jsx(ts,{className:"w-4 h-4 text-emerald-400 inline"}):p.jsx(vo,{className:"w-4 h-4 text-slate-500 inline"})}),p.jsxs("td",{className:"px-3 py-2 text-right",children:[p.jsx("button",{onClick:()=>m(S),className:"text-cyan-400 hover:text-cyan-300 text-xs mr-3",children:"Edit"}),p.jsx("button",{onClick:()=>b(S.site_id),className:"text-red-400 hover:text-red-300",children:p.jsx(O0,{className:"w-4 h-4 inline"})})]})]},S.site_id))})]})})]})}function P7({draft:e,setDraft:t,onSave:r,onCancel:n,adding:i,feedSource:a}){const o=(v,m)=>t({...e,[v]:m}),[s,l]=G.useState(!1),[u,c]=G.useState(null),f=a!=="native"||!e.site_id.trim(),h=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(!f){l(!0),c(null);try{const v=e.site_id.replace(/^USGS-/i,""),m=await fetch(`/api/env/usgs/lookup/${encodeURIComponent(v)}`);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(v){c(String(v))}finally{l(!1)}}};return p.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 p-3 bg-slate-900/50 rounded",children:[p.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Site ID",p.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[p.jsx("input",{className:"flex-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100 font-mono text-xs",value:e.site_id,onChange:v=>o("site_id",v.target.value),disabled:!i}),p.jsxs("button",{type:"button",onClick:d,disabled:f||s,title:h,className:"px-2 py-1 bg-slate-700 hover:bg-slate-600 disabled:opacity-30 disabled:cursor-not-allowed rounded text-xs text-slate-100 flex items-center gap-1",children:[s?p.jsx(L0,{className:"w-3 h-3 animate-spin"}):p.jsx(bT,{className:"w-3 h-3"}),"USGS lookup"]})]}),u&&p.jsx("span",{className:"text-amber-400 text-xs mt-1 block",children:u})]}),p.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Gauge name",p.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.gauge_name,onChange:v=>o("gauge_name",v.target.value)})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Lat",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lat,onChange:v=>o("lat",parseFloat(v.target.value))})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Lon",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lon,onChange:v=>o("lon",parseFloat(v.target.value))})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Action ft",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.action_ft??"",onChange:v=>o("action_ft",v.target.value===""?null:parseFloat(v.target.value))})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Minor flood ft",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.flood_minor_ft??"",onChange:v=>o("flood_minor_ft",v.target.value===""?null:parseFloat(v.target.value))})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Moderate flood ft",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.flood_moderate_ft??"",onChange:v=>o("flood_moderate_ft",v.target.value===""?null:parseFloat(v.target.value))})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Major flood ft",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.flood_major_ft??"",onChange:v=>o("flood_major_ft",v.target.value===""?null:parseFloat(v.target.value))})]}),p.jsxs("label",{className:"text-xs text-slate-300 col-span-2 flex items-center gap-2 mt-2",children:[p.jsx("input",{type:"checkbox",checked:e.enabled,onChange:v=>o("enabled",v.target.checked),className:"accent-cyan-500"}),"Enabled"]}),p.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-2 mt-2",children:[p.jsx("button",{onClick:n,className:"px-3 py-1 text-slate-300 hover:bg-slate-700 rounded text-sm",children:"Cancel"}),p.jsx("button",{onClick:r,className:"px-3 py-1 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm",children:"Save"})]})]})}const sk={anchor_id:0,name:"",lat:0,lon:0,state:"ID",enabled:!0,updated_at:0};function Oet(){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,f]=G.useState(sk),h=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(()=>{h()},[h]);const d=_=>{s(_.anchor_id),f({..._}),u(!1)},v=()=>{u(!0),s(null),f({...sk})},m=()=>{s(null),u(!1),f(sk)},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(),h()},x=async _=>{if(!confirm(`Delete anchor ${_}?`))return;const b=await fetch(`/api/town-anchors/${_}`,{method:"DELETE"});if(!b.ok){alert(`delete failed: ${b.status}`);return}h()};return r?p.jsxs("div",{className:"p-6 text-slate-400",children:[p.jsx(L0,{className:"w-5 h-5 animate-spin inline mr-2"}),"Loading…"]}):i?p.jsxs("div",{className:"p-6 text-red-400",children:["Load failed: ",i]}):p.jsxs("div",{className:"p-6 space-y-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Fv,{className:"w-5 h-5 text-cyan-400"}),p.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:"Town Anchors"}),p.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[e.length," towns"]}),p.jsxs("button",{onClick:v,className:"ml-auto flex items-center gap-1 px-3 py-1 bg-cyan-700 hover:bg-cyan-600 rounded text-white text-sm",children:[p.jsx(Vv,{className:"w-4 h-4"})," Add town"]})]}),p.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&&p.jsx(k7,{draft:c,setDraft:f,onSave:y,onCancel:m,adding:!0}),p.jsx("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg overflow-x-auto",children:p.jsxs("table",{className:"w-full text-sm text-slate-200",children:[p.jsx("thead",{className:"bg-slate-900 text-xs text-slate-400 uppercase",children:p.jsxs("tr",{children:[p.jsx("th",{className:"px-3 py-2 text-left",children:"Name"}),p.jsx("th",{className:"px-3 py-2 text-right",children:"Lat"}),p.jsx("th",{className:"px-3 py-2 text-right",children:"Lon"}),p.jsx("th",{className:"px-3 py-2 text-center",children:"State"}),p.jsx("th",{className:"px-3 py-2 text-center",children:"On"}),p.jsx("th",{className:"px-3 py-2"})]})}),p.jsx("tbody",{className:"divide-y divide-slate-700/60",children:e.map(_=>o===_.anchor_id?p.jsx("tr",{className:"bg-slate-900/40",children:p.jsx("td",{colSpan:6,className:"px-3 py-2",children:p.jsx(k7,{draft:c,setDraft:f,onSave:y,onCancel:m})})},_.anchor_id):p.jsxs("tr",{className:"hover:bg-slate-800/50",children:[p.jsx("td",{className:"px-3 py-2 capitalize",children:_.name}),p.jsx("td",{className:"px-3 py-2 text-right text-xs",children:_.lat.toFixed(4)}),p.jsx("td",{className:"px-3 py-2 text-right text-xs",children:_.lon.toFixed(4)}),p.jsx("td",{className:"px-3 py-2 text-center text-xs",children:_.state||"-"}),p.jsx("td",{className:"px-3 py-2 text-center",children:_.enabled?p.jsx(ts,{className:"w-4 h-4 text-emerald-400 inline"}):p.jsx(vo,{className:"w-4 h-4 text-slate-500 inline"})}),p.jsxs("td",{className:"px-3 py-2 text-right",children:[p.jsx("button",{onClick:()=>d(_),className:"text-cyan-400 hover:text-cyan-300 text-xs mr-3",children:"Edit"}),p.jsx("button",{onClick:()=>x(_.anchor_id),className:"text-red-400 hover:text-red-300",children:p.jsx(O0,{className:"w-4 h-4 inline"})})]})]},_.anchor_id))})]})})]})}function k7({draft:e,setDraft:t,onSave:r,onCancel:n,adding:i}){const a=(o,s)=>t({...e,[o]:s});return p.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 p-3 bg-slate-900/50 rounded",children:[p.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Name (lowercased on save)",p.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.name,onChange:o=>a("name",o.target.value),disabled:!i})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["State",p.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.state??"",onChange:o=>a("state",o.target.value)})]}),p.jsxs("label",{className:"text-xs text-slate-400 flex items-center gap-2",children:[p.jsx("input",{type:"checkbox",checked:e.enabled,onChange:o=>a("enabled",o.target.checked),className:"accent-cyan-500 mt-4"}),"Enabled"]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Lat",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lat,onChange:o=>a("lat",parseFloat(o.target.value))})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Lon",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lon,onChange:o=>a("lon",parseFloat(o.target.value))})]}),p.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-2 mt-2",children:[p.jsx("button",{onClick:n,className:"px-3 py-1 text-slate-300 hover:bg-slate-700 rounded text-sm",children:"Cancel"}),p.jsx("button",{onClick:r,className:"px-3 py-1 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm",children:"Save"})]})]})}function Iet(){return p.jsx(Bce,{children:p.jsx(Gce,{children:p.jsxs(Yue,{children:[p.jsx(Ha,{path:"/",element:p.jsx(wDe,{})}),p.jsx(Ha,{path:"/mesh",element:p.jsx(zQe,{})}),p.jsx(Ha,{path:"/environment",element:p.jsx(cet,{})}),p.jsx(Ha,{path:"/config",element:p.jsx(aet,{})}),p.jsx(Ha,{path:"/alerts",element:p.jsx(yet,{})}),p.jsx(Ha,{path:"/notifications",element:p.jsx(Tet,{})}),p.jsx(Ha,{path:"/reference",element:p.jsx(Cet,{})}),p.jsx(Ha,{path:"/adapter-config",element:p.jsx(Met,{})}),p.jsx(Ha,{path:"/gauge-sites",element:p.jsx(Let,{})}),p.jsx(Ha,{path:"/town-anchors",element:p.jsx(Oet,{})})]})})})}lk.createRoot(document.getElementById("root")).render(p.jsx(Q.StrictMode,{children:p.jsx(tce,{children:p.jsx(Iet,{})})})); diff --git a/meshai/dashboard/static/assets/index-DzHEJ_0f.js b/meshai/dashboard/static/assets/index-DzHEJ_0f.js deleted file mode 100644 index d2637b2..0000000 --- a/meshai/dashboard/static/assets/index-DzHEJ_0f.js +++ /dev/null @@ -1,543 +0,0 @@ -function Loe(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 Bg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C7={exports:{}},GS={},A7={exports:{}},St={};/** - * @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 y0=Symbol.for("react.element"),Ioe=Symbol.for("react.portal"),Ooe=Symbol.for("react.fragment"),Eoe=Symbol.for("react.strict_mode"),Noe=Symbol.for("react.profiler"),Doe=Symbol.for("react.provider"),joe=Symbol.for("react.context"),Roe=Symbol.for("react.forward_ref"),Boe=Symbol.for("react.suspense"),zoe=Symbol.for("react.memo"),$oe=Symbol.for("react.lazy"),w5=Symbol.iterator;function Foe(e){return e===null||typeof e!="object"?null:(e=w5&&e[w5]||e["@@iterator"],typeof e=="function"?e:null)}var M7={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},P7=Object.assign,k7={};function Nv(e,t,r){this.props=e,this.context=t,this.refs=k7,this.updater=r||M7}Nv.prototype.isReactComponent={};Nv.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")};Nv.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function L7(){}L7.prototype=Nv.prototype;function BE(e,t,r){this.props=e,this.context=t,this.refs=k7,this.updater=r||M7}var zE=BE.prototype=new L7;zE.constructor=BE;P7(zE,Nv.prototype);zE.isPureReactComponent=!0;var S5=Array.isArray,I7=Object.prototype.hasOwnProperty,$E={current:null},O7={key:!0,ref:!0,__self:!0,__source:!0};function E7(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)I7.call(t,n)&&!O7.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1>>1,Y=B[Z];if(0>>1;Zi(ce,U))dei(Ie,ce)?(B[Z]=Ie,B[de]=U,Z=de):(B[Z]=ce,B[te]=U,Z=te);else if(dei(Ie,U))B[Z]=Ie,B[de]=U,Z=de;else break e}}return H}function i(B,H){var U=B.sortIndex-H.sortIndex;return U!==0?U:B.id-H.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,f=null,h=3,d=!1,v=!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 b(B){for(var H=r(u);H!==null;){if(H.callback===null)n(u);else if(H.startTime<=B)n(u),H.sortIndex=H.expirationTime,t(l,H);else break;H=r(u)}}function S(B){if(m=!1,b(B),!v)if(r(l)!==null)v=!0,F(T);else{var H=r(u);H!==null&&$(S,H.startTime-B)}}function T(B,H){v=!1,m&&(m=!1,x(P),P=-1),d=!0;var U=h;try{for(b(H),f=r(l);f!==null&&(!(f.expirationTime>H)||B&&!E());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,h=f.priorityLevel;var Y=Z(f.expirationTime<=H);H=e.unstable_now(),typeof Y=="function"?f.callback=Y:f===r(l)&&n(l),b(H)}else n(l);f=r(l)}if(f!==null)var K=!0;else{var te=r(u);te!==null&&$(S,te.startTime-H),K=!1}return K}finally{f=null,h=U,d=!1}}var C=!1,A=null,P=-1,I=5,k=-1;function E(){return!(e.unstable_now()-kB||125Z?(B.sortIndex=U,t(u,B),r(l)===null&&B===r(u)&&(m?(x(P),P=-1):m=!0,$(S,U-Z))):(B.sortIndex=Y,t(l,B),v||d||(v=!0,F(T))),B},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(B){var H=h;return function(){var U=h;h=H;try{return B.apply(this,arguments)}finally{h=U}}}})(B7);R7.exports=B7;var Qoe=R7.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 ese=G,Zi=Qoe;function be(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"),rk=Object.prototype.hasOwnProperty,tse=/^[: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]*$/,C5={},A5={};function rse(e){return rk.call(A5,e)?!0:rk.call(C5,e)?!1:tse.test(e)?A5[e]=!0:(C5[e]=!0,!1)}function nse(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 ise(e,t,r,n){if(t===null||typeof t>"u"||nse(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 ci(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 On={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){On[e]=new ci(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];On[t]=new ci(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){On[e]=new ci(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){On[e]=new ci(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){On[e]=new ci(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){On[e]=new ci(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){On[e]=new ci(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){On[e]=new ci(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){On[e]=new ci(e,5,!1,e.toLowerCase(),null,!1,!1)});var VE=/[\-:]([a-z])/g;function GE(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(VE,GE);On[t]=new ci(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(VE,GE);On[t]=new ci(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(VE,GE);On[t]=new ci(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){On[e]=new ci(e,1,!1,e.toLowerCase(),null,!1,!1)});On.xlinkHref=new ci("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){On[e]=new ci(e,1,!1,e.toLowerCase(),null,!0,!0)});function WE(e,t,r,n){var i=On.hasOwnProperty(t)?On[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{wA=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?zg(e):""}function ase(e){switch(e.tag){case 5:return zg(e.type);case 16:return zg("Lazy");case 13:return zg("Suspense");case 19:return zg("SuspenseList");case 0:case 2:case 15:return e=SA(e.type,!1),e;case 11:return e=SA(e.type.render,!1),e;case 1:return e=SA(e.type,!0),e;default:return""}}function ok(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 td:return"Fragment";case ed:return"Portal";case nk:return"Profiler";case HE:return"StrictMode";case ik:return"Suspense";case ak:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case F7:return(e.displayName||"Context")+".Consumer";case $7:return(e._context.displayName||"Context")+".Provider";case UE:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ZE:return t=e.displayName||null,t!==null?t:ok(e.type)||"Memo";case zl:t=e._payload,e=e._init;try{return ok(e(t))}catch{}}return null}function ose(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 ok(t);case 8:return t===HE?"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 Tu(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function G7(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sse(e){var t=G7(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 kx(e){e._valueTracker||(e._valueTracker=sse(e))}function W7(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=G7(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function i1(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 sk(e,t){var r=t.checked;return _r({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function P5(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Tu(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 H7(e,t){t=t.checked,t!=null&&WE(e,"checked",t,!1)}function lk(e,t){H7(e,t);var r=Tu(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")?uk(e,t.type,r):t.hasOwnProperty("defaultValue")&&uk(e,t.type,Tu(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function k5(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 uk(e,t,r){(t!=="number"||i1(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var $g=Array.isArray;function wd(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Lx.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function jm(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var nm={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},lse=["Webkit","ms","Moz","O"];Object.keys(nm).forEach(function(e){lse.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),nm[t]=nm[e]})});function q7(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||nm.hasOwnProperty(e)&&nm[e]?(""+t).trim():t+"px"}function X7(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=q7(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var use=_r({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 hk(e,t){if(t){if(use[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(be(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(be(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(be(61))}if(t.style!=null&&typeof t.style!="object")throw Error(be(62))}}function dk(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 vk=null;function YE(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pk=null,Sd=null,Td=null;function O5(e){if(e=b0(e)){if(typeof pk!="function")throw Error(be(280));var t=e.stateNode;t&&(t=YS(t),pk(e.stateNode,e.type,t))}}function K7(e){Sd?Td?Td.push(e):Td=[e]:Sd=e}function J7(){if(Sd){var e=Sd,t=Td;if(Td=Sd=null,O5(e),t)for(e=0;e>>=0,e===0?32:31-(_se(e)/bse|0)|0}var Ix=64,Ox=4194304;function Fg(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 l1(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=Fg(s):(a&=o,a!==0&&(n=Fg(a)))}else o=r&~i,o!==0?n=Fg(o):a!==0&&(n=Fg(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 x0(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ao(t),e[t]=r}function Cse(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=am),F5=" ",V5=!1;function y9(e,t){switch(e){case"keyup":return Qse.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function x9(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rd=!1;function tle(e,t){switch(e){case"compositionend":return x9(t);case"keypress":return t.which!==32?null:(V5=!0,F5);case"textInput":return e=t.data,e===F5&&V5?null:e;default:return null}}function rle(e,t){if(rd)return e==="compositionend"||!rN&&y9(e,t)?(e=g9(),Cb=QE=Zl=null,rd=!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=U5(r)}}function S9(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?S9(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function T9(){for(var e=window,t=i1();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=i1(e.document)}return t}function nN(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 fle(e){var t=T9(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&S9(r.ownerDocument.documentElement,r)){if(n!==null&&nN(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=Z5(r,a);var o=Z5(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,nd=null,bk=null,sm=null,wk=!1;function Y5(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;wk||nd==null||nd!==i1(n)||(n=nd,"selectionStart"in n&&nN(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}),sm&&Vm(sm,n)||(sm=n,n=f1(bk,"onSelect"),0od||(e.current=Pk[od],Pk[od]=null,od--)}function rr(e,t){od++,Pk[od]=e.current,e.current=t}var Cu={},Xn=ju(Cu),xi=ju(!1),xf=Cu;function $d(e,t){var r=e.type.contextTypes;if(!r)return Cu;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 _i(e){return e=e.childContextTypes,e!=null}function d1(){sr(xi),sr(Xn)}function tB(e,t,r){if(Xn.current!==Cu)throw Error(be(168));rr(Xn,t),rr(xi,r)}function E9(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(be(108,ose(e)||"Unknown",i));return _r({},r,n)}function v1(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Cu,xf=Xn.current,rr(Xn,e),rr(xi,xi.current),!0}function rB(e,t,r){var n=e.stateNode;if(!n)throw Error(be(169));r?(e=E9(e,t,xf),n.__reactInternalMemoizedMergedChildContext=e,sr(xi),sr(Xn),rr(Xn,e)):sr(xi),rr(xi,r)}var Os=null,qS=!1,RA=!1;function N9(e){Os===null?Os=[e]:Os.push(e)}function Sle(e){qS=!0,N9(e)}function Ru(){if(!RA&&Os!==null){RA=!0;var e=0,t=Vt;try{var r=Os;for(Vt=1;e>=o,i-=o,Ns=1<<32-ao(t)+i|r<P?(I=A,A=null):I=A.sibling;var k=h(x,A,b[P],S);if(k===null){A===null&&(A=I);break}e&&A&&k.alternate===null&&t(x,A),_=a(k,_,P),C===null?T=k:C.sibling=k,C=k,A=I}if(P===b.length)return r(x,A),lr&&Pc(x,P),T;if(A===null){for(;PP?(I=A,A=null):I=A.sibling;var E=h(x,A,k.value,S);if(E===null){A===null&&(A=I);break}e&&A&&E.alternate===null&&t(x,A),_=a(E,_,P),C===null?T=E:C.sibling=E,C=E,A=I}if(k.done)return r(x,A),lr&&Pc(x,P),T;if(A===null){for(;!k.done;P++,k=b.next())k=f(x,k.value,S),k!==null&&(_=a(k,_,P),C===null?T=k:C.sibling=k,C=k);return lr&&Pc(x,P),T}for(A=n(x,A);!k.done;P++,k=b.next())k=d(A,x,P,k.value,S),k!==null&&(e&&k.alternate!==null&&A.delete(k.key===null?P:k.key),_=a(k,_,P),C===null?T=k:C.sibling=k,C=k);return e&&A.forEach(function(N){return t(x,N)}),lr&&Pc(x,P),T}function y(x,_,b,S){if(typeof b=="object"&&b!==null&&b.type===td&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Px:e:{for(var T=b.key,C=_;C!==null;){if(C.key===T){if(T=b.type,T===td){if(C.tag===7){r(x,C.sibling),_=i(C,b.props.children),_.return=x,x=_;break e}}else if(C.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===zl&&aB(T)===C.type){r(x,C.sibling),_=i(C,b.props),_.ref=Zp(x,C,b),_.return=x,x=_;break e}r(x,C);break}else t(x,C);C=C.sibling}b.type===td?(_=sf(b.props.children,x.mode,S,b.key),_.return=x,x=_):(S=Eb(b.type,b.key,b.props,null,x.mode,S),S.ref=Zp(x,_,b),S.return=x,x=S)}return o(x);case ed:e:{for(C=b.key;_!==null;){if(_.key===C)if(_.tag===4&&_.stateNode.containerInfo===b.containerInfo&&_.stateNode.implementation===b.implementation){r(x,_.sibling),_=i(_,b.children||[]),_.return=x,x=_;break e}else{r(x,_);break}else t(x,_);_=_.sibling}_=HA(b,x.mode,S),_.return=x,x=_}return o(x);case zl:return C=b._init,y(x,_,C(b._payload),S)}if($g(b))return v(x,_,b,S);if(Vp(b))return m(x,_,b,S);zx(x,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,_!==null&&_.tag===6?(r(x,_.sibling),_=i(_,b),_.return=x,x=_):(r(x,_),_=WA(b,x.mode,S),_.return=x,x=_),o(x)):r(x,_)}return y}var Vd=B9(!0),z9=B9(!1),m1=ju(null),y1=null,ud=null,sN=null;function lN(){sN=ud=y1=null}function uN(e){var t=m1.current;sr(m1),e._currentValue=t}function Ik(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 Ad(e,t){y1=e,sN=ud=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(mi=!0),e.firstContext=null)}function Ma(e){var t=e._currentValue;if(sN!==e)if(e={context:e,memoizedValue:t,next:null},ud===null){if(y1===null)throw Error(be(308));ud=e,y1.dependencies={lanes:0,firstContext:e}}else ud=ud.next=e;return t}var Hc=null;function cN(e){Hc===null?Hc=[e]:Hc.push(e)}function $9(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,cN(t)):(r.next=i.next,i.next=r),t.interleaved=r,tl(e,n)}function tl(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 $l=!1;function fN(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function F9(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 Gs(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function uu(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,kt&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,tl(e,r)}return i=n.interleaved,i===null?(t.next=t,cN(n)):(t.next=i.next,i.next=t),n.interleaved=t,tl(e,r)}function Mb(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,XE(e,r)}}function oB(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 x1(e,t,r,n){var i=e.updateQueue;$l=!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 f=i.baseState;o=0,c=u=l=null,s=a;do{var h=s.lane,d=s.eventTime;if((n&h)===h){c!==null&&(c=c.next={eventTime:d,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var v=e,m=s;switch(h=t,d=r,m.tag){case 1:if(v=m.payload,typeof v=="function"){f=v.call(d,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=m.payload,h=typeof v=="function"?v.call(d,f,h):v,h==null)break e;f=_r({},f,h);break e;case 2:$l=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[s]:h.push(s))}else d={eventTime:d,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=d,l=f):c=c.next=d,o|=h;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;h=s,s=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(c===null&&(l=f),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);wf|=o,e.lanes=o,e.memoizedState=f}}function sB(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=zA.transition;zA.transition={};try{e(!1),t()}finally{Vt=r,zA.transition=n}}function iZ(){return Pa().memoizedState}function Mle(e,t,r){var n=fu(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},aZ(e))oZ(t,r);else if(r=$9(e,t,r,n),r!==null){var i=ii();oo(r,e,n,i),sZ(r,t,n)}}function Ple(e,t,r){var n=fu(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(aZ(e))oZ(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,fo(s,o)){var l=t.interleaved;l===null?(i.next=i,cN(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=$9(e,t,i,n),r!==null&&(i=ii(),oo(r,e,n,i),sZ(r,t,n))}}function aZ(e){var t=e.alternate;return e===mr||t!==null&&t===mr}function oZ(e,t){lm=b1=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function sZ(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,XE(e,r)}}var w1={readContext:Ma,useCallback:Bn,useContext:Bn,useEffect:Bn,useImperativeHandle:Bn,useInsertionEffect:Bn,useLayoutEffect:Bn,useMemo:Bn,useReducer:Bn,useRef:Bn,useState:Bn,useDebugValue:Bn,useDeferredValue:Bn,useTransition:Bn,useMutableSource:Bn,useSyncExternalStore:Bn,useId:Bn,unstable_isNewReconciler:!1},kle={readContext:Ma,useCallback:function(e,t){return No().memoizedState=[e,t===void 0?null:t],e},useContext:Ma,useEffect:uB,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,kb(4194308,4,Q9.bind(null,t,e),r)},useLayoutEffect:function(e,t){return kb(4194308,4,e,t)},useInsertionEffect:function(e,t){return kb(4,2,e,t)},useMemo:function(e,t){var r=No();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=No();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=Mle.bind(null,mr,e),[n.memoizedState,e]},useRef:function(e){var t=No();return e={current:e},t.memoizedState=e},useState:lB,useDebugValue:xN,useDeferredValue:function(e){return No().memoizedState=e},useTransition:function(){var e=lB(!1),t=e[0];return e=Ale.bind(null,e[1]),No().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=mr,i=No();if(lr){if(r===void 0)throw Error(be(407));r=r()}else{if(r=t(),yn===null)throw Error(be(349));bf&30||H9(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,uB(Z9.bind(null,n,a,e),[e]),n.flags|=2048,Xm(9,U9.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=No(),t=yn.identifierPrefix;if(lr){var r=Ds,n=Ns;r=(n&~(1<<32-ao(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ym++,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[jo]=t,e[Hm]=n,mZ(e,t,!1,!1),t.stateNode=e;e:{switch(o=dk(r,n),r){case"dialog":ir("cancel",e),ir("close",e),i=n;break;case"iframe":case"object":case"embed":ir("load",e),i=n;break;case"video":case"audio":for(i=0;iHd&&(t.flags|=128,n=!0,Yp(a,!1),t.lanes=4194304)}else{if(!n)if(e=_1(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Yp(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!lr)return zn(t),null}else 2*jr()-a.renderingStartTime>Hd&&r!==1073741824&&(t.flags|=128,n=!0,Yp(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=jr(),t.sibling=null,r=gr.current,rr(gr,n?r&1|2:r&1),t):(zn(t),null);case 22:case 23:return CN(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Ei&1073741824&&(zn(t),t.subtreeFlags&6&&(t.flags|=8192)):zn(t),null;case 24:return null;case 25:return null}throw Error(be(156,t.tag))}function Rle(e,t){switch(aN(t),t.tag){case 1:return _i(t.type)&&d1(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gd(),sr(xi),sr(Xn),vN(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return dN(t),null;case 13:if(sr(gr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(be(340));Fd()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return sr(gr),null;case 4:return Gd(),null;case 10:return uN(t.type._context),null;case 22:case 23:return CN(),null;case 24:return null;default:return null}}var Fx=!1,Hn=!1,Ble=typeof WeakSet=="function"?WeakSet:Set,ze=null;function cd(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Sr(e,t,n)}else r.current=null}function $k(e,t,r){try{r()}catch(n){Sr(e,t,n)}}var _B=!1;function zle(e,t){if(Sk=u1,e=T9(),nN(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,f=e,h=null;t:for(;;){for(var d;f!==r||i!==0&&f.nodeType!==3||(s=o+i),f!==a||n!==0&&f.nodeType!==3||(l=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===e)break t;if(h===r&&++u===i&&(s=o),h===a&&++c===n&&(l=o),(d=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=d}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Tk={focusedElem:e,selectionRange:r},u1=!1,ze=t;ze!==null;)if(t=ze,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ze=e;else for(;ze!==null;){t=ze;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var m=v.memoizedProps,y=v.memoizedState,x=t.stateNode,_=x.getSnapshotBeforeUpdate(t.elementType===t.type?m:Ya(t.type,m),y);x.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(be(163))}}catch(S){Sr(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,ze=e;break}ze=t.return}return v=_B,_B=!1,v}function um(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&&$k(t,r,a)}i=i.next}while(i!==n)}}function JS(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 Fk(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 _Z(e){var t=e.alternate;t!==null&&(e.alternate=null,_Z(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jo],delete t[Hm],delete t[Mk],delete t[ble],delete t[wle])),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 bZ(e){return e.tag===5||e.tag===3||e.tag===4}function bB(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bZ(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 Vk(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=h1));else if(n!==4&&(e=e.child,e!==null))for(Vk(e,t,r),e=e.sibling;e!==null;)Vk(e,t,r),e=e.sibling}function Gk(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(Gk(e,t,r),e=e.sibling;e!==null;)Gk(e,t,r),e=e.sibling}var Cn=null,Xa=!1;function Cl(e,t,r){for(r=r.child;r!==null;)wZ(e,t,r),r=r.sibling}function wZ(e,t,r){if(Zo&&typeof Zo.onCommitFiberUnmount=="function")try{Zo.onCommitFiberUnmount(WS,r)}catch{}switch(r.tag){case 5:Hn||cd(r,t);case 6:var n=Cn,i=Xa;Cn=null,Cl(e,t,r),Cn=n,Xa=i,Cn!==null&&(Xa?(e=Cn,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Cn.removeChild(r.stateNode));break;case 18:Cn!==null&&(Xa?(e=Cn,r=r.stateNode,e.nodeType===8?jA(e.parentNode,r):e.nodeType===1&&jA(e,r),$m(e)):jA(Cn,r.stateNode));break;case 4:n=Cn,i=Xa,Cn=r.stateNode.containerInfo,Xa=!0,Cl(e,t,r),Cn=n,Xa=i;break;case 0:case 11:case 14:case 15:if(!Hn&&(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)&&$k(r,t,o),i=i.next}while(i!==n)}Cl(e,t,r);break;case 1:if(!Hn&&(cd(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Sr(r,t,s)}Cl(e,t,r);break;case 21:Cl(e,t,r);break;case 22:r.mode&1?(Hn=(n=Hn)||r.memoizedState!==null,Cl(e,t,r),Hn=n):Cl(e,t,r);break;default:Cl(e,t,r)}}function wB(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Ble),t.forEach(function(n){var i=Yle.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Fa(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=jr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Fle(n/1960))-n,10e?16:e,Yl===null)var n=!1;else{if(e=Yl,Yl=null,C1=0,kt&6)throw Error(be(331));var i=kt;for(kt|=4,ze=e.current;ze!==null;){var a=ze,o=a.child;if(ze.flags&16){var s=a.deletions;if(s!==null){for(var l=0;ljr()-SN?of(e,0):wN|=r),bi(e,t)}function LZ(e,t){t===0&&(e.mode&1?(t=Ox,Ox<<=1,!(Ox&130023424)&&(Ox=4194304)):t=1);var r=ii();e=tl(e,t),e!==null&&(x0(e,t,r),bi(e,r))}function Zle(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),LZ(e,r)}function Yle(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(be(314))}n!==null&&n.delete(t),LZ(e,r)}var IZ;IZ=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||xi.current)mi=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return mi=!1,Dle(e,t,r);mi=!!(e.flags&131072)}else mi=!1,lr&&t.flags&1048576&&D9(t,g1,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Lb(e,t),e=t.pendingProps;var i=$d(t,Xn.current);Ad(t,r),i=gN(null,t,n,e,i,r);var a=mN();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,_i(n)?(a=!0,v1(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,fN(t),i.updater=KS,t.stateNode=i,i._reactInternals=t,Ek(t,n,e,r),t=jk(null,t,n,!0,a,r)):(t.tag=0,lr&&a&&iN(t),Qn(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Lb(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Xle(n),e=Ya(n,e),i){case 0:t=Dk(null,t,n,e,r);break e;case 1:t=mB(null,t,n,e,r);break e;case 11:t=pB(null,t,n,e,r);break e;case 14:t=gB(null,t,n,Ya(n.type,e),r);break e}throw Error(be(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ya(n,i),Dk(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ya(n,i),mB(e,t,n,i,r);case 3:e:{if(vZ(t),e===null)throw Error(be(387));n=t.pendingProps,a=t.memoizedState,i=a.element,F9(e,t),x1(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=Wd(Error(be(423)),t),t=yB(e,t,n,r,i);break e}else if(n!==i){i=Wd(Error(be(424)),t),t=yB(e,t,n,r,i);break e}else for($i=lu(t.stateNode.containerInfo.firstChild),Hi=t,lr=!0,Qa=null,r=z9(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Fd(),n===i){t=rl(e,t,r);break e}Qn(e,t,n,r)}t=t.child}return t;case 5:return V9(t),e===null&&Lk(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Ck(n,i)?o=null:a!==null&&Ck(n,a)&&(t.flags|=32),dZ(e,t),Qn(e,t,o,r),t.child;case 6:return e===null&&Lk(t),null;case 13:return pZ(e,t,r);case 4:return hN(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Vd(t,null,n,r):Qn(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ya(n,i),pB(e,t,n,i,r);case 7:return Qn(e,t,t.pendingProps,r),t.child;case 8:return Qn(e,t,t.pendingProps.children,r),t.child;case 12:return Qn(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,rr(m1,n._currentValue),n._currentValue=o,a!==null)if(fo(a.value,o)){if(a.children===i.children&&!xi.current){t=rl(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=Gs(-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),Ik(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(be(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),Ik(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}Qn(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Ad(t,r),i=Ma(i),n=n(i),t.flags|=1,Qn(e,t,n,r),t.child;case 14:return n=t.type,i=Ya(n,t.pendingProps),i=Ya(n.type,i),gB(e,t,n,i,r);case 15:return fZ(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Ya(n,i),Lb(e,t),t.tag=1,_i(n)?(e=!0,v1(t)):e=!1,Ad(t,r),lZ(t,n,i),Ek(t,n,i,r),jk(null,t,n,!0,e,r);case 19:return gZ(e,t,r);case 22:return hZ(e,t,r)}throw Error(be(156,t.tag))};function OZ(e,t){return a9(e,t)}function qle(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 xa(e,t,r,n){return new qle(e,t,r,n)}function MN(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xle(e){if(typeof e=="function")return MN(e)?1:0;if(e!=null){if(e=e.$$typeof,e===UE)return 11;if(e===ZE)return 14}return 2}function hu(e,t){var r=e.alternate;return r===null?(r=xa(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 Eb(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")MN(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case td:return sf(r.children,i,a,t);case HE:o=8,i|=8;break;case nk:return e=xa(12,r,t,i|2),e.elementType=nk,e.lanes=a,e;case ik:return e=xa(13,r,t,i),e.elementType=ik,e.lanes=a,e;case ak:return e=xa(19,r,t,i),e.elementType=ak,e.lanes=a,e;case V7:return eT(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $7:o=10;break e;case F7:o=9;break e;case UE:o=11;break e;case ZE:o=14;break e;case zl:o=16,n=null;break e}throw Error(be(130,e==null?e:typeof e,""))}return t=xa(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function sf(e,t,r,n){return e=xa(7,e,n,t),e.lanes=r,e}function eT(e,t,r,n){return e=xa(22,e,n,t),e.elementType=V7,e.lanes=r,e.stateNode={isHidden:!1},e}function WA(e,t,r){return e=xa(6,e,null,t),e.lanes=r,e}function HA(e,t,r){return t=xa(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Kle(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=CA(0),this.expirationTimes=CA(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=CA(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function PN(e,t,r,n,i,a,o,s,l){return e=new Kle(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=xa(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},fN(a),e}function Jle(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(jZ)}catch(e){console.error(e)}}jZ(),j7.exports=Yi;var RZ=j7.exports,LB=RZ;tk.createRoot=LB.createRoot,tk.hydrateRoot=LB.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 Jm(){return Jm=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ON(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function iue(){return Math.random().toString(36).substr(2,8)}function OB(e,t){return{usr:e.state,key:e.key,idx:t}}function Yk(e,t,r,n){return r===void 0&&(r=null),Jm({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Rv(t):t,{state:r,key:t&&t.key||n||iue()})}function P1(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 Rv(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 aue(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=ql.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(Jm({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function f(){s=ql.Pop;let y=c(),x=y==null?null:y-u;u=y,l&&l({action:s,location:m.location,delta:x})}function h(y,x){s=ql.Push;let _=Yk(m.location,y,x);u=c()+1;let b=OB(_,u),S=m.createHref(_);try{o.pushState(b,"",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=ql.Replace;let _=Yk(m.location,y,x);u=c();let b=OB(_,u),S=m.createHref(_);o.replaceState(b,"",S),a&&l&&l({action:s,location:m.location,delta:0})}function v(y){let x=i.location.origin!=="null"?i.location.origin:i.location.href,_=typeof y=="string"?y:P1(y);return _=_.replace(/ $/,"%20"),Ur(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(IB,f),l=y,()=>{i.removeEventListener(IB,f),l=null}},createHref(y){return t(i,y)},createURL:v,encodeLocation(y){let x=v(y);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:d,go(y){return o.go(y)}};return m}var EB;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(EB||(EB={}));function oue(e,t,r){return r===void 0&&(r="/"),sue(e,t,r)}function sue(e,t,r,n){let i=typeof t=="string"?Rv(t):t,a=EN(i.pathname||"/",r);if(a==null)return null;let o=BZ(e);lue(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("/")&&(Ur(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=du([n,l.relativePath]),c=r.concat(l);a.children&&a.children.length>0&&(Ur(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),BZ(a.children,t,c,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:pue(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 zZ(a.path))i(a,o,l)}),t}function zZ(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=zZ(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 lue(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:gue(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const uue=/^:[\w-]+$/,cue=3,fue=2,hue=1,due=10,vue=-2,NB=e=>e==="*";function pue(e,t){let r=e.split("/"),n=r.length;return r.some(NB)&&(n+=vue),t&&(n+=fue),r.filter(i=>!NB(i)).reduce((i,a)=>i+(uue.test(a)?cue:a===""?hue:due),n)}function gue(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 mue(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:h,isOptional:d}=c;if(h==="*"){let m=s[f]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const v=s[f];return d&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function xue(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),ON(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 _ue(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ON(!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 EN(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 bue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wue=e=>bue.test(e);function Sue(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?Rv(e):e,a;if(r)if(wue(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),ON(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=DB(r.substring(1),"/"):a=DB(r,t)}else a=t;return{pathname:a,search:Aue(n),hash:Mue(i)}}function DB(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 UA(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 Tue(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function $Z(e,t){let r=Tue(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function FZ(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=Rv(e):(i=Jm({},e),Ur(!i.pathname||!i.pathname.includes("?"),UA("?","pathname","search",i)),Ur(!i.pathname||!i.pathname.includes("#"),UA("#","pathname","hash",i)),Ur(!i.search||!i.search.includes("#"),UA("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}s=f>=0?t[f]:"/"}let l=Sue(i,s),u=o&&o!=="/"&&o.endsWith("/"),c=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const du=e=>e.join("/").replace(/\/\/+/g,"/"),Cue=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Aue=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Mue=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Pue(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const VZ=["post","put","patch","delete"];new Set(VZ);const kue=["get",...VZ];new Set(kue);/** - * 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 Qm(){return Qm=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 f=FZ(u,JSON.parse(o),a,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:du([t,f.pathname])),(c.replace?n.replace:n.push)(f,c.state,c)},[t,n,o,a,e])}function UZ(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=G.useContext(Vf),{matches:i}=G.useContext(Gf),{pathname:a}=Bv(),o=JSON.stringify($Z(i,n.v7_relativeSplatPath));return G.useMemo(()=>FZ(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function Eue(e,t){return Nue(e,t)}function Nue(e,t,r,n){S0()||Ur(!1);let{navigator:i}=G.useContext(Vf),{matches:a}=G.useContext(Gf),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Bv(),c;if(t){var f;let y=typeof t=="string"?Rv(t):t;l==="/"||(f=y.pathname)!=null&&f.startsWith(l)||Ur(!1),c=y}else c=u;let h=c.pathname||"/",d=h;if(l!=="/"){let y=l.replace(/^\//,"").split("/");d="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let v=oue(e,{pathname:d}),m=zue(v&&v.map(y=>Object.assign({},y,{params:Object.assign({},s,y.params),pathname:du([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:du([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,r,n);return t&&m?G.createElement(aT.Provider,{value:{location:Qm({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:ql.Pop}},m):m}function Due(){let e=Gue(),t=Pue(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 jue=G.createElement(Due,null);class Rue 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(Gf.Provider,{value:this.props.routeContext},G.createElement(GZ.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Bue(e){let{routeContext:t,match:r,children:n}=e,i=G.useContext(NN);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),G.createElement(Gf.Provider,{value:t},n)}function zue(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(f=>f.route.id&&(s==null?void 0:s[f.route.id])!==void 0);c>=0||Ur(!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,f,h)=>{let d,v=!1,m=null,y=null;r&&(d=s&&f.route.id?s[f.route.id]:void 0,m=f.route.errorElement||jue,l&&(u<0&&h===0?(Hue("route-fallback"),v=!0,y=null):u===h&&(v=!0,y=f.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,h+1)),_=()=>{let b;return d?b=m:v?b=y:f.route.Component?b=G.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=c,G.createElement(Bue,{match:f,routeContext:{outlet:c,matches:x,isDataRoute:r!=null},children:b})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?G.createElement(Rue,{location:r.location,revalidation:r.revalidation,component:m,error:d,children:_(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):_()},null)}var ZZ=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ZZ||{}),YZ=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}(YZ||{});function $ue(e){let t=G.useContext(NN);return t||Ur(!1),t}function Fue(e){let t=G.useContext(Lue);return t||Ur(!1),t}function Vue(e){let t=G.useContext(Gf);return t||Ur(!1),t}function qZ(e){let t=Vue(),r=t.matches[t.matches.length-1];return r.route.id||Ur(!1),r.route.id}function Gue(){var e;let t=G.useContext(GZ),r=Fue(),n=qZ();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function Wue(){let{router:e}=$ue(ZZ.UseNavigateStable),t=qZ(YZ.UseNavigateStable),r=G.useRef(!1);return WZ(()=>{r.current=!0}),G.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Qm({fromRouteId:t},a)))},[e,t])}const jB={};function Hue(e,t,r){jB[e]||(jB[e]=!0)}function Uue(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Wa(e){Ur(!1)}function Zue(e){let{basename:t="/",children:r=null,location:n,navigationType:i=ql.Pop,navigator:a,static:o=!1,future:s}=e;S0()&&Ur(!1);let l=t.replace(/^\/*/,"/"),u=G.useMemo(()=>({basename:l,navigator:a,static:o,future:Qm({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=Rv(n));let{pathname:c="/",search:f="",hash:h="",state:d=null,key:v="default"}=n,m=G.useMemo(()=>{let y=EN(c,l);return y==null?null:{location:{pathname:y,search:f,hash:h,state:d,key:v},navigationType:i}},[l,c,f,h,d,v,i]);return m==null?null:G.createElement(Vf.Provider,{value:u},G.createElement(aT.Provider,{children:r,value:m}))}function Yue(e){let{children:t,location:r}=e;return Eue(qk(t),r)}new Promise(()=>{});function qk(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,qk(n.props.children,a));return}n.type!==Wa&&Ur(!1),!n.props.index||!n.props.children||Ur(!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=qk(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 Xk(){return Xk=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function Xue(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kue(e,t){return e.button===0&&(!t||t==="_self")&&!Xue(e)}const Jue=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Que="6";try{window.__reactRouterVersion=Que}catch{}const ece="startTransition",RB=Uoe[ece];function tce(e){let{basename:t,children:r,future:n,window:i}=e,a=G.useRef();a.current==null&&(a.current=nue({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(f=>{u&&RB?RB(()=>l(f)):l(f)},[l,u]);return G.useLayoutEffect(()=>o.listen(c),[o,c]),G.useEffect(()=>Uue(n),[n]),G.createElement(Zue,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const rce=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nce=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ice=G.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:c,viewTransition:f}=t,h=que(t,Jue),{basename:d}=G.useContext(Vf),v,m=!1;if(typeof u=="string"&&nce.test(u)&&(v=u,rce))try{let b=new URL(window.location.href),S=u.startsWith("//")?new URL(b.protocol+u):new URL(u),T=EN(S.pathname,d);S.origin===b.origin&&T!=null?u=T+S.search+S.hash:m=!0}catch{}let y=Iue(u,{relative:i}),x=ace(u,{replace:o,state:s,target:l,preventScrollReset:c,relative:i,viewTransition:f});function _(b){n&&n(b),b.defaultPrevented||x(b)}return G.createElement("a",Xk({},h,{href:v||y,onClick:m||a?n:_,ref:r,target:l}))});var BB;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(BB||(BB={}));var zB;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(zB||(zB={}));function ace(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=HZ(),u=Bv(),c=UZ(e,{relative:o});return G.useCallback(f=>{if(Kue(f,r)){f.preventDefault();let h=n!==void 0?n:P1(u)===P1(c);l(e,{replace:h,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 oce=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),XZ=(...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 sce={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 lce=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,...sce,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:XZ("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 Fe=(e,t)=>{const r=G.forwardRef(({className:n,...i},a)=>G.createElement(lce,{ref:a,iconNode:t,className:XZ(`lucide-${oce(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 zv=Fe("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 ZA=Fe("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 uce=Fe("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 ey=Fe("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 KZ=Fe("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 cce=Fe("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 fce=Fe("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 hce=Fe("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 oT=Fe("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 ts=Fe("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 Bu=Fe("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 dce=Fe("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 Au=Fe("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 vce=Fe("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 Mu=Fe("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 DN=Fe("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 Tf=Fe("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 pce=Fe("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 Pu=Fe("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 gce=Fe("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 JZ=Fe("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 mce=Fe("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 QZ=Fe("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 yce=Fe("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 eY=Fe("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 sT=Fe("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 Ud=Fe("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 tY=Fe("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 jN=Fe("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 RN=Fe("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 lT=Fe("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 xce=Fe("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 _ce=Fe("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 uT=Fe("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 rY=Fe("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 nY=Fe("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 T0=Fe("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 bce=Fe("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 $v=Fe("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 wce=Fe("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 BN=Fe("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 cT=Fe("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 iY=Fe("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 Fv=Fe("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 ho=Fe("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 ty=Fe("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 fT=Fe("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 Sce=Fe("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 hT=Fe("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 zN=Fe("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 dT=Fe("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 Kk=Fe("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 Tce=Fe("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 aY=Fe("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 $N=Fe("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 Cce=Fe("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 oY=Fe("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 sY=Fe("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 C0=Fe("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 nl=Fe("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 Ace=Fe("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 lY=Fe("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 vT=Fe("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 vo=Fe("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 ry=Fe("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 Xi(e){const t=await fetch(e);if(!t.ok)throw new Error(`API error: ${t.status} ${t.statusText}`);return t.json()}async function $B(){return Xi("/api/status")}async function Mce(){return Xi("/api/health")}async function Pce(){return Xi("/api/nodes")}async function kce(){return Xi("/api/edges")}async function Lce(){return Xi("/api/sources")}async function uY(){return Xi("/api/alerts/active")}async function FB(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),Xi(`/api/alerts/history?${i.toString()}`)}async function Ice(){return Xi("/api/subscriptions")}async function cY(){return Xi("/api/env/status")}async function fY(){return Xi("/api/env/active")}async function Oce(){return Xi("/api/env/swpc")}async function Ece(){return Xi("/api/env/ducting")}async function Nce(){return Xi("/api/regions")}function FN(){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),f=G.useCallback(()=>{var v;if(((v=l.current)==null?void 0:v.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),f()},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(()=>(f(),()=>{u.current&&clearTimeout(u.current),l.current&&l.current.close()}),[f]),{connected:e,lastHealth:r,lastAlert:i,lastMessage:o}}const hY=G.createContext(null);function Dce(){const e=G.useContext(hY);if(!e)throw new Error("useToast must be used within a ToastProvider");return e}function jce(e){switch(e==null?void 0:e.toLowerCase()){case"critical":case"emergency":return{bg:"bg-red-500/10",border:"border-red-500",icon:Mu,iconColor:"text-red-500"};case"warning":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:nl,iconColor:"text-amber-500"};default:return{bg:"bg-blue-500/10",border:"border-blue-500",icon:uT,iconColor:"text-blue-500"}}}function Rce({toast:e,onDismiss:t,onNavigate:r}){const n=jce(e.alert.severity),i=n.icon;return G.useEffect(()=>{const a=setTimeout(t,8e3);return()=>clearTimeout(a)},[t]),p.jsx("div",{className:`${n.bg} border ${n.border} rounded-lg shadow-lg overflow-hidden animate-slide-in cursor-pointer`,onClick:r,role:"alert",children:p.jsxs("div",{className:"flex items-start gap-3 p-4",children:[p.jsx("div",{className:`w-1 self-stretch -ml-4 -my-4 ${n.border.replace("border","bg")}`}),p.jsx(i,{size:18,className:n.iconColor}),p.jsxs("div",{className:"flex-1 min-w-0 pr-2",children:[p.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())}),p.jsx("div",{className:"text-sm text-slate-300 line-clamp-2",children:e.alert.message})]}),p.jsx("button",{onClick:a=>{a.stopPropagation(),t()},className:"text-slate-400 hover:text-slate-200 transition-colors",children:p.jsx(vo,{size:16})})]})})}function Bce({children:e}){const[t,r]=G.useState([]),n=HZ(),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 p.jsxs(hY.Provider,{value:{addToast:i},children:[e,p.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=>p.jsx("div",{className:"pointer-events-auto",children:p.jsx(Rce,{toast:s,onDismiss:()=>a(s.id),onNavigate:o})},s.id))})]})}const pT="meshai.restartRequired.v1";function VB(){try{const e=localStorage.getItem(pT);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 zce(e){const t={required:!0,changedKeys:[...new Set(e)],ts:Date.now()};localStorage.setItem(pT,JSON.stringify(t)),window.dispatchEvent(new CustomEvent("meshai:restart-required",{detail:t}))}function GB(){localStorage.removeItem(pT),window.dispatchEvent(new CustomEvent("meshai:restart-required",{detail:{required:!1,changedKeys:[],ts:0}}))}function $ce(){const[e,t]=G.useState(()=>VB()),[r,n]=G.useState(!1),[i,a]=G.useState(null);G.useEffect(()=>{const l=c=>{const f=c.detail;t(f)},u=c=>{c.key===pT&&t(VB())};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}`)}GB()}catch(l){a(String(l)),n(!1)}},[]),s=G.useCallback(()=>{GB()},[]);return e.required?p.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:[p.jsx(nl,{className:"w-4 h-4 flex-shrink-0 text-yellow-300"}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("strong",{children:"Container restart required"}),e.changedKeys.length>0&&p.jsxs("span",{className:"text-yellow-300 ml-2",children:["(",e.changedKeys.length," key",e.changedKeys.length===1?"":"s",":"," ",p.jsxs("span",{className:"font-mono text-xs",children:[e.changedKeys.slice(0,3).join(", "),e.changedKeys.length>3?", …":""]}),")"]}),p.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&&p.jsx("div",{className:"text-red-400 text-xs mt-1",children:i})]}),p.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:[p.jsx(Sce,{className:`w-3 h-3 ${r?"animate-spin":""}`}),r?"Restarting…":"Restart now"]}),p.jsx("button",{onClick:s,className:"text-yellow-300 hover:text-white px-1",title:"Dismiss (you can still restart later)",children:p.jsx(vo,{className:"w-4 h-4"})})]}):null}const dY=[{path:"/",label:"Dashboard",icon:nY},{path:"/mesh",label:"Mesh",icon:ho},{path:"/environment",label:"Environment",icon:Pu},{path:"/config",label:"Config",icon:aY},{path:"/alerts",label:"Alerts",icon:ey},{path:"/notifications",label:"Notifications",icon:uce},{path:"/reference",label:"Reference",icon:KZ},{path:"/adapter-config",label:"Adapter Config",icon:$N},{path:"/gauge-sites",label:"Gauge Sites",icon:sT},{path:"/town-anchors",label:"Town Anchors",icon:$v}];function Fce(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 Vce(e){const t=dY.find(r=>r.path===e);return(t==null?void 0:t.label)||"Dashboard"}function Gce({children:e}){var h;const t=Bv(),{connected:r,lastAlert:n}=FN(),{addToast:i}=Dce(),[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(()=>{$B().then(o).catch(console.error);const d=setInterval(()=>{$B().then(o).catch(console.error)},3e4);return()=>clearInterval(d)},[]),G.useEffect(()=>{const d=setInterval(()=>c(new Date),1e3);return()=>clearInterval(d)},[]);const f=u.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return p.jsxs("div",{className:"flex h-screen overflow-hidden bg-bg text-slate-200",children:[p.jsxs("aside",{className:"w-[220px] flex-shrink-0 bg-bg-card border-r border-border flex flex-col overflow-y-auto",children:[p.jsx("div",{className:"p-5 border-b border-border",children:p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-blue-500 to-blue-700 flex items-center justify-center text-white font-bold text-xl",children:"M"}),p.jsxs("div",{children:[p.jsx("div",{className:"font-semibold text-lg",children:"MeshAI"}),p.jsxs("div",{className:"text-xs text-slate-500 font-mono",children:["v",(a==null?void 0:a.version)||"..."]})]})]})}),p.jsx("nav",{className:"flex-1 py-4",children:dY.map(d=>{const v=t.pathname===d.path,m=d.icon;return p.jsxs(ice,{to:d.path,className:`flex items-center gap-3 px-5 py-3 text-sm transition-colors relative ${v?"text-blue-400 bg-blue-500/10":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover"}`,children:[v&&p.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-blue-500"}),p.jsx(m,{size:18}),d.label]},d.path)})}),p.jsxs("div",{className:"p-5 border-t border-border",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx("div",{className:`w-2 h-2 rounded-full ${a!=null&&a.connected?"bg-green-500":"bg-red-500"}`}),p.jsx("span",{className:"text-xs text-slate-400",children:a!=null&&a.connected?"Connected":"Disconnected"})]}),p.jsxs("div",{className:"text-xs text-slate-500 font-mono truncate",children:[(h=a==null?void 0:a.connection_type)==null?void 0:h.toUpperCase(),": ",a==null?void 0:a.connection_target]}),p.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:["Uptime: ",a?Fce(a.uptime_seconds):"..."]})]})]}),p.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[p.jsxs("header",{className:"h-14 flex-shrink-0 border-b border-border bg-bg-card flex items-center justify-between px-6",children:[p.jsx("h1",{className:"text-lg font-semibold",children:Vce(t.pathname)}),p.jsxs("div",{className:"flex items-center gap-6",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:`w-2 h-2 rounded-full ${r?"bg-green-500 animate-pulse-slow":"bg-slate-500"}`}),p.jsx("span",{className:"text-xs text-slate-400",children:r?"Live":"Offline"})]}),p.jsxs("div",{className:"text-sm font-mono text-slate-400",children:[f," MT"]})]})]}),p.jsxs("main",{className:"flex-1 overflow-y-auto p-6",children:[p.jsx($ce,{}),e]})]})]})}function vY(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}var Vhe=Fhe,Ghe=mT;function Whe(e,t){var r=this.__data__,n=Ghe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Hhe=Whe,Uhe=Phe,Zhe=jhe,Yhe=zhe,qhe=Vhe,Xhe=Hhe;function Hv(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},Zc=function(t){return Cf(t)&&t.indexOf("%")===t.length-1},Me=function(t){return gve(t)&&!Zv(t)},_ve=function(t){return mt(t)},rn=function(t){return Me(t)||Cf(t)},bve=0,Yv=function(t){var r=++bve;return"".concat(t||"").concat(r)},Af=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Me(t)&&!Cf(t))return n;var a;if(Zc(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return Zv(a)&&(a=n),i&&a>r&&(a=r),a},qh=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},wve=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kve(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Qk(e){"@babel/helpers - typeof";return Qk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qk(e)}var tz={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Ws=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},rz=null,XA=null,QN=function e(t){if(t===rz&&Array.isArray(XA))return XA;var r=[];return G.Children.forEach(t,function(n){mt(n)||(fve.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),XA=r,rz=t,r};function Ta(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Ws(i)}):n=[Ws(t)],QN(e).forEach(function(i){var a=Sa(i,"type.displayName")||Sa(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function Ni(e,t){var r=Ta(e,t);return r&&r[0]}var nz=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!Me(n)||n<=0||!Me(i)||i<=0)},Lve=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Ive=function(t){return t&&t.type&&Cf(t.type)&&Lve.indexOf(t.type)>=0},MY=function(t){return t&&Qk(t)==="object"&&"clipDot"in t},Ove=function(t,r,n,i){var a,o=(a=qA==null?void 0:qA[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!pt(t)&&(i&&o.includes(r)||Cve.includes(r))||n&&JN.includes(r)},vt=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(G.isValidElement(t)&&(i=t.props),!Gv(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;Ove((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},eL=function e(t,r){if(t===r)return!0;var n=G.Children.count(t);if(n!==G.Children.count(r))return!1;if(n===0)return!0;if(n===1)return iz(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Rve(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function rL(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,l=e.desc,u=jve(e,Dve),c=i||{width:r,height:n,x:0,y:0},f=Ct("recharts-surface",a);return Q.createElement("svg",tL({},vt(u,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(c.x," ").concat(c.y," ").concat(c.width," ").concat(c.height)}),Q.createElement("title",null,s),Q.createElement("desc",null,l),t)}var Bve=["children","className"];function nL(){return nL=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $ve(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var nr=Q.forwardRef(function(e,t){var r=e.children,n=e.className,i=zve(e,Bve),a=Ct("recharts-layer",n);return Q.createElement("g",nL({className:a},vt(i,!0),{ref:t}),r)}),lf=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:Gve(e,t,r)}var Hve=Wve,Uve="\\ud800-\\udfff",Zve="\\u0300-\\u036f",Yve="\\ufe20-\\ufe2f",qve="\\u20d0-\\u20ff",Xve=Zve+Yve+qve,Kve="\\ufe0e\\ufe0f",Jve="\\u200d",Qve=RegExp("["+Jve+Uve+Xve+Kve+"]");function epe(e){return Qve.test(e)}var PY=epe;function tpe(e){return e.split("")}var rpe=tpe,kY="\\ud800-\\udfff",npe="\\u0300-\\u036f",ipe="\\ufe20-\\ufe2f",ape="\\u20d0-\\u20ff",ope=npe+ipe+ape,spe="\\ufe0e\\ufe0f",lpe="["+kY+"]",iL="["+ope+"]",aL="\\ud83c[\\udffb-\\udfff]",upe="(?:"+iL+"|"+aL+")",LY="[^"+kY+"]",IY="(?:\\ud83c[\\udde6-\\uddff]){2}",OY="[\\ud800-\\udbff][\\udc00-\\udfff]",cpe="\\u200d",EY=upe+"?",NY="["+spe+"]?",fpe="(?:"+cpe+"(?:"+[LY,IY,OY].join("|")+")"+NY+EY+")*",hpe=NY+EY+fpe,dpe="(?:"+[LY+iL+"?",iL,IY,OY,lpe].join("|")+")",vpe=RegExp(aL+"(?="+aL+")|"+dpe+hpe,"g");function ppe(e){return e.match(vpe)||[]}var gpe=ppe,mpe=rpe,ype=PY,xpe=gpe;function _pe(e){return ype(e)?xpe(e):mpe(e)}var bpe=_pe,wpe=Hve,Spe=PY,Tpe=bpe,Cpe=bY;function Ape(e){return function(t){t=Cpe(t);var r=Spe(t)?Tpe(t):void 0,n=r?r[0]:t.charAt(0),i=r?wpe(r,1).join(""):t.slice(1);return n[e]()+i}}var Mpe=Ape,Ppe=Mpe,kpe=Ppe("toUpperCase"),Lpe=kpe;const IT=Yt(Lpe);function tr(e){return function(){return e}}const DY=Math.cos,O1=Math.sin,yo=Math.sqrt,E1=Math.PI,OT=2*E1,oL=Math.PI,sL=2*oL,Lc=1e-6,Ipe=sL-Lc;function jY(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return jY;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;iLc)if(!(Math.abs(f*l-u*c)>Lc)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let d=n-o,v=i-s,m=l*l+u*u,y=d*d+v*v,x=Math.sqrt(m),_=Math.sqrt(h),b=a*Math.tan((oL-Math.acos((m+h-y)/(2*x*_)))/2),S=b/_,T=b/x;Math.abs(S-1)>Lc&&this._append`L${t+S*c},${r+S*f}`,this._append`A${a},${a},0,0,${+(f*d>c*v)},${this._x1=t+T*l},${this._y1=r+T*u}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=t+s,c=r+l,f=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>Lc||Math.abs(this._y1-c)>Lc)&&this._append`L${u},${c}`,n&&(h<0&&(h=h%sL+sL),h>Ipe?this._append`A${n},${n},0,1,${f},${t-s},${r-l}A${n},${n},0,1,${f},${this._x1=u},${this._y1=c}`:h>Lc&&this._append`A${n},${n},0,${+(h>=oL)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}};function eD(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Epe(t)}function tD(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function RY(e){this._context=e}RY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function ET(e){return new RY(e)}function BY(e){return e[0]}function zY(e){return e[1]}function $Y(e,t){var r=tr(!0),n=null,i=ET,a=null,o=eD(s);e=typeof e=="function"?e:e===void 0?BY:tr(e),t=typeof t=="function"?t:t===void 0?zY:tr(t);function s(l){var u,c=(l=tD(l)).length,f,h=!1,d;for(n==null&&(a=i(d=o())),u=0;u<=c;++u)!(u=d;--v)s.point(b[v],S[v]);s.lineEnd(),s.areaEnd()}x&&(b[h]=+e(y,h,f),S[h]=+t(y,h,f),s.point(n?+n(y,h,f):b[h],r?+r(y,h,f):S[h]))}if(_)return s=null,_+""||null}function c(){return $Y().defined(i).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:tr(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:tr(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:tr(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:tr(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:tr(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:tr(+f),u):r},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(r)},u.lineX1=function(){return c().x(n).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:tr(!!f),u):i},u.curve=function(f){return arguments.length?(o=f,a!=null&&(s=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=s=null:s=o(a=f),u):a},u}class FY{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Npe(e){return new FY(e,!0)}function Dpe(e){return new FY(e,!1)}const rD={draw(e,t){const r=yo(t/E1);e.moveTo(r,0),e.arc(0,0,r,0,OT)}},jpe={draw(e,t){const r=yo(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},VY=yo(1/3),Rpe=VY*2,Bpe={draw(e,t){const r=yo(t/Rpe),n=r*VY;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},zpe={draw(e,t){const r=yo(t),n=-r/2;e.rect(n,n,r,r)}},$pe=.8908130915292852,GY=O1(E1/10)/O1(7*E1/10),Fpe=O1(OT/10)*GY,Vpe=-DY(OT/10)*GY,Gpe={draw(e,t){const r=yo(t*$pe),n=Fpe*r,i=Vpe*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=OT*a/5,s=DY(o),l=O1(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},KA=yo(3),Wpe={draw(e,t){const r=-yo(t/(KA*3));e.moveTo(0,r*2),e.lineTo(-KA*r,-r),e.lineTo(KA*r,-r),e.closePath()}},na=-.5,ia=yo(3)/2,lL=1/yo(12),Hpe=(lL/2+1)*3,Upe={draw(e,t){const r=yo(t/Hpe),n=r/2,i=r*lL,a=n,o=r*lL+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(na*n-ia*i,ia*n+na*i),e.lineTo(na*a-ia*o,ia*a+na*o),e.lineTo(na*s-ia*l,ia*s+na*l),e.lineTo(na*n+ia*i,na*i-ia*n),e.lineTo(na*a+ia*o,na*o-ia*a),e.lineTo(na*s+ia*l,na*l-ia*s),e.closePath()}};function Zpe(e,t){let r=null,n=eD(i);e=typeof e=="function"?e:tr(e||rD),t=typeof t=="function"?t:tr(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:tr(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:tr(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function N1(){}function D1(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function WY(e){this._context=e}WY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:D1(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:D1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ype(e){return new WY(e)}function HY(e){this._context=e}HY.prototype={areaStart:N1,areaEnd:N1,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:D1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qpe(e){return new HY(e)}function UY(e){this._context=e}UY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:D1(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Xpe(e){return new UY(e)}function ZY(e){this._context=e}ZY.prototype={areaStart:N1,areaEnd:N1,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Kpe(e){return new ZY(e)}function oz(e){return e<0?-1:1}function sz(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(oz(a)+oz(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function lz(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function JA(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function j1(e){this._context=e}j1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:JA(this,this._t0,lz(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,JA(this,lz(this,r=sz(this,e,t)),r);break;default:JA(this,this._t0,r=sz(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function YY(e){this._context=new qY(e)}(YY.prototype=Object.create(j1.prototype)).point=function(e,t){j1.prototype.point.call(this,t,e)};function qY(e){this._context=e}qY.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function Jpe(e){return new j1(e)}function Qpe(e){return new YY(e)}function XY(e){this._context=e}XY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=uz(e),i=uz(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function tge(e){return new NT(e,.5)}function rge(e){return new NT(e,0)}function nge(e){return new NT(e,1)}function Zd(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r=0;)r[t]=t;return r}function ige(e,t){return e[t]}function age(e){const t=[];return t.key=e,t}function oge(){var e=tr([]),t=uL,r=Zd,n=ige;function i(a){var o=Array.from(e.apply(this,arguments),age),s,l=o.length,u=-1,c;for(const f of a)for(s=0,++u;s0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function pge(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var KY={symbolCircle:rD,symbolCross:jpe,symbolDiamond:Bpe,symbolSquare:zpe,symbolStar:Gpe,symbolTriangle:Wpe,symbolWye:Upe},gge=Math.PI/180,mge=function(t){var r="symbol".concat(IT(t));return KY[r]||rD},yge=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*gge;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},xge=function(t,r){KY["symbol".concat(IT(t))]=r},nD=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,l=vge(t,cge),u=fz(fz({},l),{},{type:n,size:a,sizeType:s}),c=function(){var y=mge(n),x=Zpe().type(y).size(yge(a,s,n));return x()},f=u.className,h=u.cx,d=u.cy,v=vt(u,!0);return h===+h&&d===+d&&a===+a?Q.createElement("path",cL({},v,{className:Ct("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(d,")"),d:c()})):null};nD.registerSymbol=xge;function Yd(e){"@babel/helpers - typeof";return Yd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yd(e)}function fL(){return fL=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var _=d.inactive?u:d.color;return Q.createElement("li",fL({className:y,style:f,key:"legend-item-".concat(v)},I1(n.props,d,v)),Q.createElement(rL,{width:o,height:o,viewBox:c,style:h},n.renderIcon(d)),Q.createElement("span",{className:"recharts-legend-item-text",style:{color:_}},m?m(x,d,v):x))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return Q.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(G.PureComponent);iy(iD,"displayName","Legend");iy(iD,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var kge=yT;function Lge(){this.__data__=new kge,this.size=0}var Ige=Lge;function Oge(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Ege=Oge;function Nge(e){return this.__data__.get(e)}var Dge=Nge;function jge(e){return this.__data__.has(e)}var Rge=jge,Bge=yT,zge=HN,$ge=UN,Fge=200;function Vge(e,t){var r=this.__data__;if(r instanceof Bge){var n=r.__data__;if(!zge||n.lengths))return!1;var u=a.get(e),c=a.get(t);if(u&&c)return u==t&&c==e;var f=-1,h=!0,d=r&cme?new ome:void 0;for(a.set(e,t),a.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=vye}var lD=pye,gye=gl,mye=lD,yye=ml,xye="[object Arguments]",_ye="[object Array]",bye="[object Boolean]",wye="[object Date]",Sye="[object Error]",Tye="[object Function]",Cye="[object Map]",Aye="[object Number]",Mye="[object Object]",Pye="[object RegExp]",kye="[object Set]",Lye="[object String]",Iye="[object WeakMap]",Oye="[object ArrayBuffer]",Eye="[object DataView]",Nye="[object Float32Array]",Dye="[object Float64Array]",jye="[object Int8Array]",Rye="[object Int16Array]",Bye="[object Int32Array]",zye="[object Uint8Array]",$ye="[object Uint8ClampedArray]",Fye="[object Uint16Array]",Vye="[object Uint32Array]",ar={};ar[Nye]=ar[Dye]=ar[jye]=ar[Rye]=ar[Bye]=ar[zye]=ar[$ye]=ar[Fye]=ar[Vye]=!0;ar[xye]=ar[_ye]=ar[Oye]=ar[bye]=ar[Eye]=ar[wye]=ar[Sye]=ar[Tye]=ar[Cye]=ar[Aye]=ar[Mye]=ar[Pye]=ar[kye]=ar[Lye]=ar[Iye]=!1;function Gye(e){return yye(e)&&mye(e.length)&&!!ar[gye(e)]}var Wye=Gye;function Hye(e){return function(t){return e(t)}}var lq=Hye,$1={exports:{}};$1.exports;(function(e,t){var r=pY,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})($1,$1.exports);var Uye=$1.exports,Zye=Wye,Yye=lq,yz=Uye,xz=yz&&yz.isTypedArray,qye=xz?Yye(xz):Zye,uq=qye,Xye=Qme,Kye=oD,Jye=Ti,Qye=sq,e0e=sD,t0e=uq,r0e=Object.prototype,n0e=r0e.hasOwnProperty;function i0e(e,t){var r=Jye(e),n=!r&&Kye(e),i=!r&&!n&&Qye(e),a=!r&&!n&&!i&&t0e(e),o=r||n||i||a,s=o?Xye(e.length,String):[],l=s.length;for(var u in e)(t||n0e.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||e0e(u,l)))&&s.push(u);return s}var a0e=i0e,o0e=Object.prototype;function s0e(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||o0e;return e===r}var l0e=s0e;function u0e(e,t){return function(r){return e(t(r))}}var cq=u0e,c0e=cq,f0e=c0e(Object.keys,Object),h0e=f0e,d0e=l0e,v0e=h0e,p0e=Object.prototype,g0e=p0e.hasOwnProperty;function m0e(e){if(!d0e(e))return v0e(e);var t=[];for(var r in Object(e))g0e.call(e,r)&&r!="constructor"&&t.push(r);return t}var y0e=m0e,x0e=GN,_0e=lD;function b0e(e){return e!=null&&_0e(e.length)&&!x0e(e)}var DT=b0e,w0e=a0e,S0e=y0e,T0e=DT;function C0e(e){return T0e(e)?w0e(e):S0e(e)}var uD=C0e,A0e=Fme,M0e=Kme,P0e=uD;function k0e(e){return A0e(e,P0e,M0e)}var L0e=k0e,_z=L0e,I0e=1,O0e=Object.prototype,E0e=O0e.hasOwnProperty;function N0e(e,t,r,n,i,a){var o=r&I0e,s=_z(e),l=s.length,u=_z(t),c=u.length;if(l!=c&&!o)return!1;for(var f=l;f--;){var h=s[f];if(!(o?h in t:E0e.call(t,h)))return!1}var d=a.get(e),v=a.get(t);if(d&&v)return d==t&&v==e;var m=!0;a.set(e,t),a.set(t,e);for(var y=o;++f-1}var E_e=O_e;function N_e(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=q_e){var u=t?null:Z_e(e);if(u)return Y_e(u);o=!1,i=U_e,l=new G_e}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function fbe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function hbe(e){return e.value}function dbe(e,t){if(Q.isValidElement(e))return Q.cloneElement(e,t);if(typeof e=="function")return Q.createElement(e,t);t.ref;var r=cbe(t,rbe);return Q.createElement(iD,r)}var jz=1,kd=function(e){function t(){var r;nbe(this,t);for(var n=arguments.length,i=new Array(n),a=0;ajz||Math.abs(i.height-this.lastBoundingBox.height)>jz)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ws({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,u=i.chartWidth,c=i.chartHeight,f,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var d=this.getBBoxSnapshot();f={left:((u||0)-d.width)/2}}else f=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var v=this.getBBoxSnapshot();h={top:((c||0)-v.height)/2}}else h=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return ws(ws({},f),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,c=i.payload,f=ws(ws({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return Q.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(d){n.wrapperNode=d}},dbe(a,ws(ws({},this.props),{},{payload:gq(c,u,hbe)})))}}],[{key:"getWithHeight",value:function(n,i){var a=ws(ws({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&Me(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(G.PureComponent);jT(kd,"displayName","Legend");jT(kd,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Rz=A0,vbe=oD,pbe=Ti,Bz=Rz?Rz.isConcatSpreadable:void 0;function gbe(e){return pbe(e)||vbe(e)||!!(Bz&&e&&e[Bz])}var mbe=gbe,ybe=aq,xbe=mbe;function xq(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=xbe),i||(i=[]);++a0&&r(s)?t>1?xq(s,t-1,r,n,i):ybe(i,s):n||(i[i.length]=s)}return i}var _q=xq;function _be(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var bbe=_be,wbe=bbe,Sbe=wbe(),Tbe=Sbe,Cbe=Tbe,Abe=uD;function Mbe(e,t){return e&&Cbe(e,t,Abe)}var bq=Mbe,Pbe=DT;function kbe(e,t){return function(r,n){if(r==null)return r;if(!Pbe(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++at||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var Gbe=Vbe,r2=YN,Wbe=qN,Hbe=Jv,Ube=wq,Zbe=Bbe,Ybe=lq,qbe=Gbe,Xbe=Kv,Kbe=Ti;function Jbe(e,t,r){t.length?t=r2(t,function(a){return Kbe(a)?function(o){return Wbe(o,a.length===1?a[0]:a)}:a}):t=[Xbe];var n=-1;t=r2(t,Ybe(Hbe));var i=Ube(e,function(a,o,s){var l=r2(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return Zbe(i,function(a,o){return qbe(a,o,r)})}var Qbe=Jbe;function e1e(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var t1e=e1e,r1e=t1e,$z=Math.max;function n1e(e,t,r){return t=$z(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=$z(n.length-t,0),o=Array(a);++i0){if(++t>=d1e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var m1e=g1e,y1e=h1e,x1e=m1e,_1e=x1e(y1e),b1e=_1e,w1e=Kv,S1e=i1e,T1e=b1e;function C1e(e,t){return T1e(S1e(e,t,w1e),e+"")}var A1e=C1e,M1e=WN,P1e=DT,k1e=sD,L1e=zu;function I1e(e,t,r){if(!L1e(r))return!1;var n=typeof t;return(n=="number"?P1e(r)&&k1e(t,r.length):n=="string"&&t in r)?M1e(r[t],e):!1}var RT=I1e,O1e=_q,E1e=Qbe,N1e=A1e,Vz=RT,D1e=N1e(function(e,t){if(e==null)return[];var r=t.length;return r>1&&Vz(e,t[0],t[1])?t=[]:r>2&&Vz(t[0],t[1],t[2])&&(t=[t[0]]),E1e(e,O1e(t,1),[])}),j1e=D1e;const hD=Yt(j1e);function ay(e){"@babel/helpers - typeof";return ay=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ay(e)}function xL(){return xL=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(Kp,"-left"),Me(r)&&t&&Me(t.x)&&r=t.y),"".concat(Kp,"-top"),Me(n)&&t&&Me(t.y)&&nm?Math.max(c,l[n]):Math.max(f,l[n])}function K1e(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function J1e(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,c,f;return o.height>0&&o.width>0&&r?(c=Hz({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=Hz({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=K1e({translateX:c,translateY:f,useTranslate3d:s})):u=q1e,{cssProperties:u,cssClasses:X1e({translateX:c,translateY:f,coordinate:r})}}function Xd(e){"@babel/helpers - typeof";return Xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xd(e)}function Uz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Zz(e){for(var t=1;tYz||Math.abs(n.height-this.state.lastBoundingBox.height)>Yz)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,u=i.children,c=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,d=i.offset,v=i.position,m=i.reverseDirection,y=i.useTranslate3d,x=i.viewBox,_=i.wrapperStyle,b=J1e({allowEscapeViewBox:o,coordinate:c,offsetTopLeft:d,position:v,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:x}),S=b.cssClasses,T=b.cssProperties,C=Zz(Zz({transition:h&&a?"transform ".concat(s,"ms ").concat(l):void 0},T),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},_);return Q.createElement("div",{tabIndex:-1,className:S,style:C,ref:function(P){n.wrapperNode=P}},u)}}])}(G.PureComponent),lwe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Hf={isSsr:lwe()};function Kd(e){"@babel/helpers - typeof";return Kd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kd(e)}function qz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Xz(e){for(var t=1;t0;return Q.createElement(swe,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:h,active:a,coordinate:c,hasPayload:C,offset:d,position:y,reverseDirection:x,useTranslate3d:_,viewBox:b,wrapperStyle:S},ywe(u,Xz(Xz({},this.props),{},{payload:T})))}}])}(G.PureComponent);dD(ks,"displayName","Tooltip");dD(ks,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Hf.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var xwe=fs,_we=function(){return xwe.Date.now()},bwe=_we,wwe=/\s/;function Swe(e){for(var t=e.length;t--&&wwe.test(e.charAt(t)););return t}var Twe=Swe,Cwe=Twe,Awe=/^\s+/;function Mwe(e){return e&&e.slice(0,Cwe(e)+1).replace(Awe,"")}var Pwe=Mwe,kwe=Pwe,Kz=zu,Lwe=Vv,Jz=NaN,Iwe=/^[-+]0x[0-9a-f]+$/i,Owe=/^0b[01]+$/i,Ewe=/^0o[0-7]+$/i,Nwe=parseInt;function Dwe(e){if(typeof e=="number")return e;if(Lwe(e))return Jz;if(Kz(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Kz(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=kwe(e);var r=Owe.test(e);return r||Ewe.test(e)?Nwe(e.slice(2),r?2:8):Iwe.test(e)?Jz:+e}var Pq=Dwe,jwe=zu,i2=bwe,Qz=Pq,Rwe="Expected a function",Bwe=Math.max,zwe=Math.min;function $we(e,t,r){var n,i,a,o,s,l,u=0,c=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(Rwe);t=Qz(t)||0,jwe(r)&&(c=!!r.leading,f="maxWait"in r,a=f?Bwe(Qz(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h);function d(C){var A=n,P=i;return n=i=void 0,u=C,o=e.apply(P,A),o}function v(C){return u=C,s=setTimeout(x,t),c?d(C):o}function m(C){var A=C-l,P=C-u,I=t-A;return f?zwe(I,a-P):I}function y(C){var A=C-l,P=C-u;return l===void 0||A>=t||A<0||f&&P>=a}function x(){var C=i2();if(y(C))return _(C);s=setTimeout(x,m(C))}function _(C){return s=void 0,h&&n?d(C):(n=i=void 0,o)}function b(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function S(){return s===void 0?o:_(i2())}function T(){var C=i2(),A=y(C);if(n=arguments,i=this,l=C,A){if(s===void 0)return v(l);if(f)return clearTimeout(s),s=setTimeout(x,t),d(l)}return s===void 0&&(s=setTimeout(x,t)),o}return T.cancel=b,T.flush=S,T}var Fwe=$we,Vwe=Fwe,Gwe=zu,Wwe="Expected a function";function Hwe(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(Wwe);return Gwe(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Vwe(e,t,{leading:n,maxWait:t,trailing:i})}var Uwe=Hwe;const kq=Yt(Uwe);function sy(e){"@babel/helpers - typeof";return sy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sy(e)}function e4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Zx(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(D=kq(D,m,{trailing:!0,leading:!1}));var z=new ResizeObserver(D),V=T.current.getBoundingClientRect(),F=V.width,$=V.height;return E(F,$),z.observe(T.current),function(){z.disconnect()}},[E,m]);var N=G.useMemo(function(){var D=I.containerWidth,z=I.containerHeight;if(D<0||z<0)return null;lf(Zc(o)||Zc(l),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,o,l),lf(!r||r>0,"The aspect(%s) must be greater than zero.",r);var V=Zc(o)?D:o,F=Zc(l)?z:l;r&&r>0&&(V?F=V/r:F&&(V=F*r),h&&F>h&&(F=h)),lf(V>0||F>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,V,F,o,l,c,f,r);var $=!Array.isArray(d)&&Ws(d.type).endsWith("Chart");return Q.Children.map(d,function(B){return Q.isValidElement(B)?G.cloneElement(B,Zx({width:V,height:F},$?{style:Zx({height:"100%",width:"100%",maxHeight:F,maxWidth:V},B.props.style)}:{})):B})},[r,d,l,h,f,c,I,o]);return Q.createElement("div",{id:y?"".concat(y):void 0,className:Ct("recharts-responsive-container",x),style:Zx(Zx({},S),{},{width:o,height:l,minWidth:c,minHeight:f,maxHeight:h}),ref:T},N)}),Iq=function(t){return null};Iq.displayName="Cell";function ly(e){"@babel/helpers - typeof";return ly=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ly(e)}function r4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function SL(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Hf.isSsr)return{width:0,height:0};var n=oSe(r),i=JSON.stringify({text:t,copyStyle:n});if(xh.widthCache[i])return xh.widthCache[i];try{var a=document.getElementById(n4);a||(a=document.createElement("span"),a.setAttribute("id",n4),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=SL(SL({},aSe),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return xh.widthCache[i]=l,++xh.cacheCount>iSe&&(xh.cacheCount=0,xh.widthCache={}),l}catch{return{width:0,height:0}}},sSe=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function uy(e){"@babel/helpers - typeof";return uy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uy(e)}function W1(e,t){return fSe(e)||cSe(e,t)||uSe(e,t)||lSe()}function lSe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uSe(e,t){if(e){if(typeof e=="string")return i4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i4(e,t)}}function i4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function CSe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function c4(e,t){return kSe(e)||PSe(e,t)||MSe(e,t)||ASe()}function ASe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MSe(e,t){if(e){if(typeof e=="string")return f4(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f4(e,t)}}function f4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return V.reduce(function(F,$){var B=$.word,H=$.width,U=F[F.length-1];if(U&&(i==null||a||U.width+H+n$.width?F:$})};if(!c)return d;for(var m="…",y=function(V){var F=f.slice(0,V),$=Dq({breakAll:u,style:l,children:F+m}).wordsWithComputedWidth,B=h($),H=B.length>o||v(B).width>Number(i);return[H,B]},x=0,_=f.length-1,b=0,S;x<=_&&b<=f.length-1;){var T=Math.floor((x+_)/2),C=T-1,A=y(C),P=c4(A,2),I=P[0],k=P[1],E=y(T),N=c4(E,1),D=N[0];if(!I&&!D&&(x=T+1),I&&D&&(_=T-1),!I&&D){S=k;break}b++}return S||d},h4=function(t){var r=mt(t)?[]:t.toString().split(Nq);return[{words:r}]},ISe=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!Hf.isSsr){var l,u,c=Dq({breakAll:o,children:i,style:a});if(c){var f=c.wordsWithComputedWidth,h=c.spaceWidth;l=f,u=h}else return h4(i);return LSe({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return h4(i)},d4="#808080",H1=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,c=t.scaleToFit,f=c===void 0?!1:c,h=t.textAnchor,d=h===void 0?"start":h,v=t.verticalAnchor,m=v===void 0?"end":v,y=t.fill,x=y===void 0?d4:y,_=u4(t,SSe),b=G.useMemo(function(){return ISe({breakAll:_.breakAll,children:_.children,maxLines:_.maxLines,scaleToFit:f,style:_.style,width:_.width})},[_.breakAll,_.children,_.maxLines,f,_.style,_.width]),S=_.dx,T=_.dy,C=_.angle,A=_.className,P=_.breakAll,I=u4(_,TSe);if(!rn(n)||!rn(a))return null;var k=n+(Me(S)?S:0),E=a+(Me(T)?T:0),N;switch(m){case"start":N=a2("calc(".concat(u,")"));break;case"middle":N=a2("calc(".concat((b.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:N=a2("calc(".concat(b.length-1," * -").concat(s,")"));break}var D=[];if(f){var z=b[0].width,V=_.width;D.push("scale(".concat((Me(V)?V/z:1)/z,")"))}return C&&D.push("rotate(".concat(C,", ").concat(k,", ").concat(E,")")),D.length&&(I.transform=D.join(" ")),Q.createElement("text",TL({},vt(I,!0),{x:k,y:E,className:Ct("recharts-text",A),textAnchor:d,fill:x.includes("url")?d4:x}),b.map(function(F,$){var B=F.words.join(P?"":" ");return Q.createElement("tspan",{x:k,dy:$===0?N:s,key:"".concat(B,"-").concat($)},B)}))};function vu(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function OSe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function vD(e){let t,r,n;e.length!==2?(t=vu,r=(s,l)=>vu(e(s),l),n=(s,l)=>e(s)-l):(t=e===vu||e===OSe?e:ESe,r=e,n=e);function i(s,l,u=0,c=s.length){if(u>>1;r(s[f],l)<0?u=f+1:c=f}while(u>>1;r(s[f],l)<=0?u=f+1:c=f}while(uu&&n(s[f-1],l)>-n(s[f],l)?f-1:f}return{left:i,center:o,right:a}}function ESe(){return 0}function jq(e){return e===null?NaN:+e}function*NSe(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const DSe=vD(vu),M0=DSe.right;vD(jq).center;class v4 extends Map{constructor(t,r=BSe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(p4(this,t))}has(t){return super.has(p4(this,t))}set(t,r){return super.set(jSe(this,t),r)}delete(t){return super.delete(RSe(this,t))}}function p4({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function jSe({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function RSe({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function BSe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function zSe(e=vu){if(e===vu)return Rq;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function Rq(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const $Se=Math.sqrt(50),FSe=Math.sqrt(10),VSe=Math.sqrt(2);function U1(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=$Se?10:a>=FSe?5:a>=VSe?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function m4(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function Bq(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?Rq:zSe(i);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,c=Math.log(l),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),d=Math.max(r,Math.floor(t-u*f/l+h)),v=Math.min(n,Math.floor(t+(l-u)*f/l+h));Bq(e,t,d,v,i)}const a=e[t];let o=r,s=n;for(Jp(e,r,t),i(e[n],a)>0&&Jp(e,r,n);o0;)--s}i(e[r],a)===0?Jp(e,r,s):(++s,Jp(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function Jp(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function GSe(e,t,r){if(e=Float64Array.from(NSe(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return m4(e);if(t>=1)return g4(e);var n,i=(n-1)*t,a=Math.floor(i),o=g4(Bq(e,a).subarray(0,a+1)),s=m4(e.subarray(a+1));return o+(s-o)*(i-a)}}function WSe(e,t,r=jq){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function HSe(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?qx(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?qx(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ZSe.exec(e))?new yi(t[1],t[2],t[3],1):(t=YSe.exec(e))?new yi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=qSe.exec(e))?qx(t[1],t[2],t[3],t[4]):(t=XSe.exec(e))?qx(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=KSe.exec(e))?T4(t[1],t[2]/100,t[3]/100,1):(t=JSe.exec(e))?T4(t[1],t[2]/100,t[3]/100,t[4]):y4.hasOwnProperty(e)?b4(y4[e]):e==="transparent"?new yi(NaN,NaN,NaN,0):null}function b4(e){return new yi(e>>16&255,e>>8&255,e&255,1)}function qx(e,t,r,n){return n<=0&&(e=t=r=NaN),new yi(e,t,r,n)}function tTe(e){return e instanceof P0||(e=dy(e)),e?(e=e.rgb(),new yi(e.r,e.g,e.b,e.opacity)):new yi}function kL(e,t,r,n){return arguments.length===1?tTe(e):new yi(e,t,r,n??1)}function yi(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}gD(yi,kL,$q(P0,{brighter(e){return e=e==null?Z1:Math.pow(Z1,e),new yi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?fy:Math.pow(fy,e),new yi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new yi(uf(this.r),uf(this.g),uf(this.b),Y1(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:w4,formatHex:w4,formatHex8:rTe,formatRgb:S4,toString:S4}));function w4(){return`#${Yc(this.r)}${Yc(this.g)}${Yc(this.b)}`}function rTe(){return`#${Yc(this.r)}${Yc(this.g)}${Yc(this.b)}${Yc((isNaN(this.opacity)?1:this.opacity)*255)}`}function S4(){const e=Y1(this.opacity);return`${e===1?"rgb(":"rgba("}${uf(this.r)}, ${uf(this.g)}, ${uf(this.b)}${e===1?")":`, ${e})`}`}function Y1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function uf(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yc(e){return e=uf(e),(e<16?"0":"")+e.toString(16)}function T4(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new eo(e,t,r,n)}function Fq(e){if(e instanceof eo)return new eo(e.h,e.s,e.l,e.opacity);if(e instanceof P0||(e=dy(e)),!e)return new eo;if(e instanceof eo)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new eo(o,s,l,e.opacity)}function nTe(e,t,r,n){return arguments.length===1?Fq(e):new eo(e,t,r,n??1)}function eo(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}gD(eo,nTe,$q(P0,{brighter(e){return e=e==null?Z1:Math.pow(Z1,e),new eo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?fy:Math.pow(fy,e),new eo(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new yi(o2(e>=240?e-240:e+120,i,n),o2(e,i,n),o2(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new eo(C4(this.h),Xx(this.s),Xx(this.l),Y1(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Y1(this.opacity);return`${e===1?"hsl(":"hsla("}${C4(this.h)}, ${Xx(this.s)*100}%, ${Xx(this.l)*100}%${e===1?")":`, ${e})`}`}}));function C4(e){return e=(e||0)%360,e<0?e+360:e}function Xx(e){return Math.max(0,Math.min(1,e||0))}function o2(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const mD=e=>()=>e;function iTe(e,t){return function(r){return e+r*t}}function aTe(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function oTe(e){return(e=+e)==1?Vq:function(t,r){return r-t?aTe(t,r,e):mD(isNaN(t)?r:t)}}function Vq(e,t){var r=t-e;return r?iTe(e,r):mD(isNaN(e)?t:e)}const A4=function e(t){var r=oTe(t);function n(i,a){var o=r((i=kL(i)).r,(a=kL(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=Vq(i.opacity,a.opacity);return function(c){return i.r=o(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return n.gamma=e,n}(1);function sTe(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:q1(n,i)})),r=s2.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function yTe(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?xTe:yTe,l=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(l||(l=s(e.map(n),t,r)))(n(o(h)))}return f.invert=function(h){return o(i((u||(u=s(t,e.map(n),q1)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,X1),c()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),c()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=yD,c()},f.clamp=function(h){return arguments.length?(o=h?!0:ni,c()):o!==ni},f.interpolate=function(h){return arguments.length?(r=h,c()):r},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,d){return n=h,i=d,c()}}function xD(){return BT()(ni,ni)}function _Te(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function K1(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Jd(e){return e=K1(Math.abs(e)),e?e[1]:NaN}function bTe(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function wTe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var STe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function vy(e){if(!(t=STe.exec(e)))throw new Error("invalid format: "+e);var t;return new _D({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}vy.prototype=_D.prototype;function _D(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}_D.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function TTe(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var J1;function CTe(e,t){var r=K1(e,t);if(!r)return J1=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(J1=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+K1(e,Math.max(0,t+a-1))[0]}function P4(e,t){var r=K1(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const k4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:_Te,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>P4(e*100,t),r:P4,s:CTe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function L4(e){return e}var I4=Array.prototype.map,O4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ATe(e){var t=e.grouping===void 0||e.thousands===void 0?L4:bTe(I4.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?L4:wTe(I4.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=vy(f);var d=f.fill,v=f.align,m=f.sign,y=f.symbol,x=f.zero,_=f.width,b=f.comma,S=f.precision,T=f.trim,C=f.type;C==="n"?(b=!0,C="g"):k4[C]||(S===void 0&&(S=12),T=!0,C="g"),(x||d==="0"&&v==="=")&&(x=!0,d="0",v="=");var A=(h&&h.prefix!==void 0?h.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():""),P=(y==="$"?n:/[%p]/.test(C)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),I=k4[C],k=/[defgprs%]/.test(C);S=S===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function E(N){var D=A,z=P,V,F,$;if(C==="c")z=I(N)+z,N="";else{N=+N;var B=N<0||1/N<0;if(N=isNaN(N)?l:I(Math.abs(N),S),T&&(N=TTe(N)),B&&+N==0&&m!=="+"&&(B=!1),D=(B?m==="("?m:s:m==="-"||m==="("?"":m)+D,z=(C==="s"&&!isNaN(N)&&J1!==void 0?O4[8+J1/3]:"")+z+(B&&m==="("?")":""),k){for(V=-1,F=N.length;++V$||$>57){z=($===46?i+N.slice(V+1):N.slice(V))+z,N=N.slice(0,V);break}}}b&&!x&&(N=t(N,1/0));var H=D.length+N.length+z.length,U=H<_?new Array(_-H+1).join(d):"";switch(b&&x&&(N=t(U+N,U.length?_-z.length:1/0),U=""),v){case"<":N=D+N+z+U;break;case"=":N=D+U+N+z;break;case"^":N=U.slice(0,H=U.length>>1)+D+N+z+U.slice(H);break;default:N=U+D+N+z;break}return a(N)}return E.toString=function(){return f+""},E}function c(f,h){var d=Math.max(-8,Math.min(8,Math.floor(Jd(h)/3)))*3,v=Math.pow(10,-d),m=u((f=vy(f),f.type="f",f),{suffix:O4[8+d/3]});return function(y){return m(v*y)}}return{format:u,formatPrefix:c}}var Kx,bD,Gq;MTe({thousands:",",grouping:[3],currency:["$",""]});function MTe(e){return Kx=ATe(e),bD=Kx.format,Gq=Kx.formatPrefix,Kx}function PTe(e){return Math.max(0,-Jd(Math.abs(e)))}function kTe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Jd(t)/3)))*3-Jd(Math.abs(e)))}function LTe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Jd(t)-Jd(e))+1}function Wq(e,t,r,n){var i=ML(e,t,r),a;switch(n=vy(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=kTe(i,o))&&(n.precision=a),Gq(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=LTe(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=PTe(i))&&(n.precision=a-(n.type==="%")*2);break}}return bD(n)}function $u(e){var t=e.domain;return e.ticks=function(r){var n=t();return CL(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return Wq(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],l,u,c=10;for(s0;){if(u=AL(o,s,r),u===l)return n[i]=o,n[a]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function Q1(){var e=xD();return e.copy=function(){return k0(e,Q1())},Da.apply(e,arguments),$u(e)}function Hq(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,X1),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Hq(e).unknown(t)},e=arguments.length?Array.from(e,X1):[0,1],$u(r)}function Uq(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function DTe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function D4(e){return(t,r)=>-e(-t,r)}function wD(e){const t=e(E4,N4),r=t.domain;let n=10,i,a;function o(){return i=DTe(n),a=NTe(n),r()[0]<0?(i=D4(i),a=D4(a),e(ITe,OTe)):e(E4,N4),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],c=l[l.length-1];const f=c0){for(;h<=d;++h)for(v=1;vc)break;x.push(m)}}else for(;h<=d;++h)for(v=n-1;v>=1;--v)if(m=h>0?v/a(-h):v*a(h),!(mc)break;x.push(m)}x.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=vy(l)).precision==null&&(l.trim=!0),l=bD(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return c=>{let f=c/a(Math.round(i(c)));return f*nr(Uq(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function Zq(){const e=wD(BT()).domain([1,10]);return e.copy=()=>k0(e,Zq()).base(e.base()),Da.apply(e,arguments),e}function j4(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function R4(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function SD(e){var t=1,r=e(j4(t),R4(t));return r.constant=function(n){return arguments.length?e(j4(t=+n),R4(t)):t},$u(r)}function Yq(){var e=SD(BT());return e.copy=function(){return k0(e,Yq()).constant(e.constant())},Da.apply(e,arguments)}function B4(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function jTe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function RTe(e){return e<0?-e*e:e*e}function TD(e){var t=e(ni,ni),r=1;function n(){return r===1?e(ni,ni):r===.5?e(jTe,RTe):e(B4(r),B4(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},$u(t)}function CD(){var e=TD(BT());return e.copy=function(){return k0(e,CD()).exponent(e.exponent())},Da.apply(e,arguments),e}function BTe(){return CD.apply(null,arguments).exponent(.5)}function z4(e){return Math.sign(e)*e*e}function zTe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function qq(){var e=xD(),t=[0,1],r=!1,n;function i(a){var o=zTe(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(z4(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,X1)).map(z4)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return qq(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Da.apply(i,arguments),$u(i)}function Xq(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return Kq().domain([e,t]).range(i).unknown(a)},Da.apply($u(o),arguments)}function Jq(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[M0(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Jq().domain(e).range(t).unknown(r)},Da.apply(i,arguments)}const l2=new Date,u2=new Date;function ln(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),t(a,s),e(a);while(uln(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(l2.setTime(+a),u2.setTime(+o),e(l2),e(u2),Math.floor(r(l2,u2))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const ew=ln(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ew.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ln(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):ew);ew.range;const js=1e3,_a=js*60,Rs=_a*60,il=Rs*24,AD=il*7,$4=il*30,c2=il*365,qc=ln(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*js)},(e,t)=>(t-e)/js,e=>e.getUTCSeconds());qc.range;const MD=ln(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*js)},(e,t)=>{e.setTime(+e+t*_a)},(e,t)=>(t-e)/_a,e=>e.getMinutes());MD.range;const PD=ln(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*_a)},(e,t)=>(t-e)/_a,e=>e.getUTCMinutes());PD.range;const kD=ln(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*js-e.getMinutes()*_a)},(e,t)=>{e.setTime(+e+t*Rs)},(e,t)=>(t-e)/Rs,e=>e.getHours());kD.range;const LD=ln(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Rs)},(e,t)=>(t-e)/Rs,e=>e.getUTCHours());LD.range;const L0=ln(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*_a)/il,e=>e.getDate()-1);L0.range;const zT=ln(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/il,e=>e.getUTCDate()-1);zT.range;const Qq=ln(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/il,e=>Math.floor(e/il));Qq.range;function Uf(e){return ln(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*_a)/AD)}const $T=Uf(0),tw=Uf(1),$Te=Uf(2),FTe=Uf(3),Qd=Uf(4),VTe=Uf(5),GTe=Uf(6);$T.range;tw.range;$Te.range;FTe.range;Qd.range;VTe.range;GTe.range;function Zf(e){return ln(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/AD)}const FT=Zf(0),rw=Zf(1),WTe=Zf(2),HTe=Zf(3),ev=Zf(4),UTe=Zf(5),ZTe=Zf(6);FT.range;rw.range;WTe.range;HTe.range;ev.range;UTe.range;ZTe.range;const ID=ln(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());ID.range;const OD=ln(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());OD.range;const al=ln(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());al.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ln(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});al.range;const ol=ln(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ol.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ln(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});ol.range;function eX(e,t,r,n,i,a){const o=[[qc,1,js],[qc,5,5*js],[qc,15,15*js],[qc,30,30*js],[a,1,_a],[a,5,5*_a],[a,15,15*_a],[a,30,30*_a],[i,1,Rs],[i,3,3*Rs],[i,6,6*Rs],[i,12,12*Rs],[n,1,il],[n,2,2*il],[r,1,AD],[t,1,$4],[t,3,3*$4],[e,1,c2]];function s(u,c,f){const h=cy).right(o,h);if(d===o.length)return e.every(ML(u/c2,c/c2,f));if(d===0)return ew.every(Math.max(ML(u,c,f),1));const[v,m]=o[h/o[d-1][2]53)return null;"w"in ee||(ee.w=1),"Z"in ee?(Ae=h2(Qp(ee.y,0,1)),We=Ae.getUTCDay(),Ae=We>4||We===0?rw.ceil(Ae):rw(Ae),Ae=zT.offset(Ae,(ee.V-1)*7),ee.y=Ae.getUTCFullYear(),ee.m=Ae.getUTCMonth(),ee.d=Ae.getUTCDate()+(ee.w+6)%7):(Ae=f2(Qp(ee.y,0,1)),We=Ae.getDay(),Ae=We>4||We===0?tw.ceil(Ae):tw(Ae),Ae=L0.offset(Ae,(ee.V-1)*7),ee.y=Ae.getFullYear(),ee.m=Ae.getMonth(),ee.d=Ae.getDate()+(ee.w+6)%7)}else("W"in ee||"U"in ee)&&("w"in ee||(ee.w="u"in ee?ee.u%7:"W"in ee?1:0),We="Z"in ee?h2(Qp(ee.y,0,1)).getUTCDay():f2(Qp(ee.y,0,1)).getDay(),ee.m=0,ee.d="W"in ee?(ee.w+6)%7+ee.W*7-(We+5)%7:ee.w+ee.U*7-(We+6)%7);return"Z"in ee?(ee.H+=ee.Z/100|0,ee.M+=ee.Z%100,h2(ee)):f2(ee)}}function P(ne,ve,ue,ee){for(var Ge=0,Ae=ve.length,We=ue.length,Ye,ht;Ge=We)return-1;if(Ye=ve.charCodeAt(Ge++),Ye===37){if(Ye=ve.charAt(Ge++),ht=T[Ye in F4?ve.charAt(Ge++):Ye],!ht||(ee=ht(ne,ue,ee))<0)return-1}else if(Ye!=ue.charCodeAt(ee++))return-1}return ee}function I(ne,ve,ue){var ee=u.exec(ve.slice(ue));return ee?(ne.p=c.get(ee[0].toLowerCase()),ue+ee[0].length):-1}function k(ne,ve,ue){var ee=d.exec(ve.slice(ue));return ee?(ne.w=v.get(ee[0].toLowerCase()),ue+ee[0].length):-1}function E(ne,ve,ue){var ee=f.exec(ve.slice(ue));return ee?(ne.w=h.get(ee[0].toLowerCase()),ue+ee[0].length):-1}function N(ne,ve,ue){var ee=x.exec(ve.slice(ue));return ee?(ne.m=_.get(ee[0].toLowerCase()),ue+ee[0].length):-1}function D(ne,ve,ue){var ee=m.exec(ve.slice(ue));return ee?(ne.m=y.get(ee[0].toLowerCase()),ue+ee[0].length):-1}function z(ne,ve,ue){return P(ne,t,ve,ue)}function V(ne,ve,ue){return P(ne,r,ve,ue)}function F(ne,ve,ue){return P(ne,n,ve,ue)}function $(ne){return o[ne.getDay()]}function B(ne){return a[ne.getDay()]}function H(ne){return l[ne.getMonth()]}function U(ne){return s[ne.getMonth()]}function Z(ne){return i[+(ne.getHours()>=12)]}function Y(ne){return 1+~~(ne.getMonth()/3)}function K(ne){return o[ne.getUTCDay()]}function te(ne){return a[ne.getUTCDay()]}function ce(ne){return l[ne.getUTCMonth()]}function de(ne){return s[ne.getUTCMonth()]}function Ie(ne){return i[+(ne.getUTCHours()>=12)]}function ye(ne){return 1+~~(ne.getUTCMonth()/3)}return{format:function(ne){var ve=C(ne+="",b);return ve.toString=function(){return ne},ve},parse:function(ne){var ve=A(ne+="",!1);return ve.toString=function(){return ne},ve},utcFormat:function(ne){var ve=C(ne+="",S);return ve.toString=function(){return ne},ve},utcParse:function(ne){var ve=A(ne+="",!0);return ve.toString=function(){return ne},ve}}}var F4={"-":"",_:" ",0:"0"},bn=/^\s*\d+/,QTe=/^%/,eCe=/[\\^$*+?|[\]().{}]/g;function Ot(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function rCe(e,t,r){var n=bn.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function nCe(e,t,r){var n=bn.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function iCe(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function aCe(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function oCe(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function V4(e,t,r){var n=bn.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function G4(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function sCe(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function lCe(e,t,r){var n=bn.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function uCe(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function W4(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function cCe(e,t,r){var n=bn.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function H4(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function fCe(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function hCe(e,t,r){var n=bn.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function dCe(e,t,r){var n=bn.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function vCe(e,t,r){var n=bn.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function pCe(e,t,r){var n=QTe.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function gCe(e,t,r){var n=bn.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function mCe(e,t,r){var n=bn.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function U4(e,t){return Ot(e.getDate(),t,2)}function yCe(e,t){return Ot(e.getHours(),t,2)}function xCe(e,t){return Ot(e.getHours()%12||12,t,2)}function _Ce(e,t){return Ot(1+L0.count(al(e),e),t,3)}function tX(e,t){return Ot(e.getMilliseconds(),t,3)}function bCe(e,t){return tX(e,t)+"000"}function wCe(e,t){return Ot(e.getMonth()+1,t,2)}function SCe(e,t){return Ot(e.getMinutes(),t,2)}function TCe(e,t){return Ot(e.getSeconds(),t,2)}function CCe(e){var t=e.getDay();return t===0?7:t}function ACe(e,t){return Ot($T.count(al(e)-1,e),t,2)}function rX(e){var t=e.getDay();return t>=4||t===0?Qd(e):Qd.ceil(e)}function MCe(e,t){return e=rX(e),Ot(Qd.count(al(e),e)+(al(e).getDay()===4),t,2)}function PCe(e){return e.getDay()}function kCe(e,t){return Ot(tw.count(al(e)-1,e),t,2)}function LCe(e,t){return Ot(e.getFullYear()%100,t,2)}function ICe(e,t){return e=rX(e),Ot(e.getFullYear()%100,t,2)}function OCe(e,t){return Ot(e.getFullYear()%1e4,t,4)}function ECe(e,t){var r=e.getDay();return e=r>=4||r===0?Qd(e):Qd.ceil(e),Ot(e.getFullYear()%1e4,t,4)}function NCe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ot(t/60|0,"0",2)+Ot(t%60,"0",2)}function Z4(e,t){return Ot(e.getUTCDate(),t,2)}function DCe(e,t){return Ot(e.getUTCHours(),t,2)}function jCe(e,t){return Ot(e.getUTCHours()%12||12,t,2)}function RCe(e,t){return Ot(1+zT.count(ol(e),e),t,3)}function nX(e,t){return Ot(e.getUTCMilliseconds(),t,3)}function BCe(e,t){return nX(e,t)+"000"}function zCe(e,t){return Ot(e.getUTCMonth()+1,t,2)}function $Ce(e,t){return Ot(e.getUTCMinutes(),t,2)}function FCe(e,t){return Ot(e.getUTCSeconds(),t,2)}function VCe(e){var t=e.getUTCDay();return t===0?7:t}function GCe(e,t){return Ot(FT.count(ol(e)-1,e),t,2)}function iX(e){var t=e.getUTCDay();return t>=4||t===0?ev(e):ev.ceil(e)}function WCe(e,t){return e=iX(e),Ot(ev.count(ol(e),e)+(ol(e).getUTCDay()===4),t,2)}function HCe(e){return e.getUTCDay()}function UCe(e,t){return Ot(rw.count(ol(e)-1,e),t,2)}function ZCe(e,t){return Ot(e.getUTCFullYear()%100,t,2)}function YCe(e,t){return e=iX(e),Ot(e.getUTCFullYear()%100,t,2)}function qCe(e,t){return Ot(e.getUTCFullYear()%1e4,t,4)}function XCe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?ev(e):ev.ceil(e),Ot(e.getUTCFullYear()%1e4,t,4)}function KCe(){return"+0000"}function Y4(){return"%"}function q4(e){return+e}function X4(e){return Math.floor(+e/1e3)}var _h,aX,oX;JCe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function JCe(e){return _h=JTe(e),aX=_h.format,_h.parse,oX=_h.utcFormat,_h.utcParse,_h}function QCe(e){return new Date(e)}function eAe(e){return e instanceof Date?+e:+new Date(+e)}function ED(e,t,r,n,i,a,o,s,l,u){var c=xD(),f=c.invert,h=c.domain,d=u(".%L"),v=u(":%S"),m=u("%I:%M"),y=u("%I %p"),x=u("%a %d"),_=u("%b %d"),b=u("%B"),S=u("%Y");function T(C){return(l(C)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>GSe(e,a/n))},r.copy=function(){return cX(t).domain(e)},yl.apply(r,arguments)}function GT(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,u=ni,c,f=!1,h;function d(m){return isNaN(m=+m)?h:(m=.5+((m=+c(m))-a)*(n*mt}var lAe=sAe,uAe=vX,cAe=lAe,fAe=Kv;function hAe(e){return e&&e.length?uAe(e,fAe,cAe):void 0}var dAe=hAe;const Xl=Yt(dAe);function vAe(e,t){return ee.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};$e.decimalPlaces=$e.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*or;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};$e.dividedBy=$e.div=function(e){return Hs(this,new this.constructor(e))};$e.dividedToIntegerBy=$e.idiv=function(e){var t=this,r=t.constructor;return Xt(Hs(t,new r(e),0,1),r.precision)};$e.equals=$e.eq=function(e){return!this.cmp(e)};$e.exponent=function(){return Zr(this)};$e.greaterThan=$e.gt=function(e){return this.cmp(e)>0};$e.greaterThanOrEqualTo=$e.gte=function(e){return this.cmp(e)>=0};$e.isInteger=$e.isint=function(){return this.e>this.d.length-2};$e.isNegative=$e.isneg=function(){return this.s<0};$e.isPositive=$e.ispos=function(){return this.s>0};$e.isZero=function(){return this.s===0};$e.lessThan=$e.lt=function(e){return this.cmp(e)<0};$e.lessThanOrEqualTo=$e.lte=function(e){return this.cmp(e)<1};$e.logarithm=$e.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Ri))throw Error(ka+"NaN");if(r.s<1)throw Error(ka+(r.s?"NaN":"-Infinity"));return r.eq(Ri)?new n(0):(cr=!1,t=Hs(py(r,a),py(e,a),a),cr=!0,Xt(t,i))};$e.minus=$e.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?yX(t,e):gX(t,(e.s=-e.s,e))};$e.modulo=$e.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(ka+"NaN");return r.s?(cr=!1,t=Hs(r,e,0,1).times(e),cr=!0,r.minus(t)):Xt(new n(r),i)};$e.naturalExponential=$e.exp=function(){return mX(this)};$e.naturalLogarithm=$e.ln=function(){return py(this)};$e.negated=$e.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};$e.plus=$e.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?gX(t,e):yX(t,(e.s=-e.s,e))};$e.precision=$e.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(cf+e);if(t=Zr(i)+1,n=i.d.length-1,r=n*or+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};$e.squareRoot=$e.sqrt=function(){var e,t,r,n,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(ka+"NaN")}for(e=Zr(s),cr=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=$o(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=tp((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(Hs(s,a,o+2)).times(.5),$o(a.d).slice(0,o)===(t=$o(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Xt(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return cr=!0,Xt(n,r)};$e.times=$e.mul=function(e){var t,r,n,i,a,o,s,l,u,c=this,f=c.constructor,h=c.d,d=(e=new f(e)).d;if(!c.s||!e.s)return new f(0);for(e.s*=c.s,r=c.e+e.e,l=h.length,u=d.length,l=0;){for(t=0,i=l+n;i>n;)s=a[i]+d[n]*h[i-n-1]+t,a[i--]=s%vn|0,t=s/vn|0;a[i]=(a[i]+t)%vn|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,cr?Xt(e,f.precision):e};$e.toDecimalPlaces=$e.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(rs(e,0,ep),t===void 0?t=n.rounding:rs(t,0,8),Xt(r,e+Zr(r)+1,t))};$e.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Mf(n,!0):(rs(e,0,ep),t===void 0?t=i.rounding:rs(t,0,8),n=Xt(new i(n),e+1,t),r=Mf(n,!0,e+1)),r};$e.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?Mf(i):(rs(e,0,ep),t===void 0?t=a.rounding:rs(t,0,8),n=Xt(new a(i),e+Zr(i)+1,t),r=Mf(n.abs(),!1,e+Zr(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};$e.toInteger=$e.toint=function(){var e=this,t=e.constructor;return Xt(new t(e),Zr(e)+1,t.rounding)};$e.toNumber=function(){return+this};$e.toPower=$e.pow=function(e){var t,r,n,i,a,o,s=this,l=s.constructor,u=12,c=+(e=new l(e));if(!e.s)return new l(Ri);if(s=new l(s),!s.s){if(e.s<1)throw Error(ka+"Infinity");return s}if(s.eq(Ri))return s;if(n=l.precision,e.eq(Ri))return Xt(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=c<0?-c:c)<=pX){for(i=new l(Ri),t=Math.ceil(n/or+4),cr=!1;r%2&&(i=i.times(s),Q4(i.d,t)),r=tp(r/2),r!==0;)s=s.times(s),Q4(s.d,t);return cr=!0,e.s<0?new l(Ri).div(i):Xt(i,n)}}else if(a<0)throw Error(ka+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,cr=!1,i=e.times(py(s,n+u)),cr=!0,i=mX(i),i.s=a,i};$e.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=Zr(i),n=Mf(i,r<=a.toExpNeg||r>=a.toExpPos)):(rs(e,1,ep),t===void 0?t=a.rounding:rs(t,0,8),i=Xt(new a(i),e,t),r=Zr(i),n=Mf(i,e<=r||r<=a.toExpNeg,e)),n};$e.toSignificantDigits=$e.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(rs(e,1,ep),t===void 0?t=n.rounding:rs(t,0,8)),Xt(new n(r),e,t)};$e.toString=$e.valueOf=$e.val=$e.toJSON=$e[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Zr(e),r=e.constructor;return Mf(e,t<=r.toExpNeg||t>=r.toExpPos)};function gX(e,t){var r,n,i,a,o,s,l,u,c=e.constructor,f=c.precision;if(!e.s||!t.s)return t.s||(t=new c(e)),cr?Xt(t,f):t;if(l=e.d,u=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,s=u.length):(n=u,i=o,s=l.length),o=Math.ceil(f/or),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=u.length,s-a<0&&(a=s,n=u,u=l,l=n),r=0;a;)r=(l[--a]=l[a]+u[a]+r)/vn|0,l[a]%=vn;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,cr?Xt(t,f):t}function rs(e,t,r){if(e!==~~e||er)throw Error(cf+e)}function $o(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var s,l,u,c,f,h,d,v,m,y,x,_,b,S,T,C,A,P,I=n.constructor,k=n.s==i.s?1:-1,E=n.d,N=i.d;if(!n.s)return new I(n);if(!i.s)throw Error(ka+"Division by zero");for(l=n.e-i.e,A=N.length,T=E.length,d=new I(k),v=d.d=[],u=0;N[u]==(E[u]||0);)++u;if(N[u]>(E[u]||0)&&--l,a==null?_=a=I.precision:o?_=a+(Zr(n)-Zr(i))+1:_=a,_<0)return new I(0);if(_=_/or+2|0,u=0,A==1)for(c=0,N=N[0],_++;(u1&&(N=e(N,c),E=e(E,c),A=N.length,T=E.length),S=A,m=E.slice(0,A),y=m.length;y=vn/2&&++C;do c=0,s=t(N,m,A,y),s<0?(x=m[0],A!=y&&(x=x*vn+(m[1]||0)),c=x/C|0,c>1?(c>=vn&&(c=vn-1),f=e(N,c),h=f.length,y=m.length,s=t(f,m,h,y),s==1&&(c--,r(f,A16)throw Error(jD+Zr(e));if(!e.s)return new c(Ri);for(cr=!1,s=f,o=new c(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(Oc(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new c(Ri),c.precision=s;;){if(i=Xt(i.times(e),s),r=r.times(++l),o=a.plus(Hs(i,r,s)),$o(o.d).slice(0,s)===$o(a.d).slice(0,s)){for(;u--;)a=Xt(a.times(a),s);return c.precision=f,t==null?(cr=!0,Xt(a,f)):a}a=o}}function Zr(e){for(var t=e.e*or,r=e.d[0];r>=10;r/=10)t++;return t}function d2(e,t,r){if(t>e.LN10.sd())throw cr=!0,r&&(e.precision=r),Error(ka+"LN10 precision limit exceeded");return Xt(new e(e.LN10),t)}function Fl(e){for(var t="";e--;)t+="0";return t}function py(e,t){var r,n,i,a,o,s,l,u,c,f=1,h=10,d=e,v=d.d,m=d.constructor,y=m.precision;if(d.s<1)throw Error(ka+(d.s?"NaN":"-Infinity"));if(d.eq(Ri))return new m(0);if(t==null?(cr=!1,u=y):u=t,d.eq(10))return t==null&&(cr=!0),d2(m,u);if(u+=h,m.precision=u,r=$o(v),n=r.charAt(0),a=Zr(d),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)d=d.times(e),r=$o(d.d),n=r.charAt(0),f++;a=Zr(d),n>1?(d=new m("0."+r),a++):d=new m(n+"."+r.slice(1))}else return l=d2(m,u+2,y).times(a+""),d=py(new m(n+"."+r.slice(1)),u-h).plus(l),m.precision=y,t==null?(cr=!0,Xt(d,y)):d;for(s=o=d=Hs(d.minus(Ri),d.plus(Ri),u),c=Xt(d.times(d),u),i=3;;){if(o=Xt(o.times(c),u),l=s.plus(Hs(o,new m(i),u)),$o(l.d).slice(0,u)===$o(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(d2(m,u+2,y).times(a+""))),s=Hs(s,new m(f),u),m.precision=y,t==null?(cr=!0,Xt(s,y)):s;s=l,i+=2}}function J4(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=tp(r/or),e.d=[],n=(r+1)%or,r<0&&(n+=or),nnw||e.e<-nw))throw Error(jD+r)}else e.s=0,e.e=0,e.d=[0];return e}function Xt(e,t,r){var n,i,a,o,s,l,u,c,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=or,i=t,u=f[c=0];else{if(c=Math.ceil((n+1)/or),a=f.length,c>=a)return e;for(u=a=f[c],o=1;a>=10;a/=10)o++;n%=or,i=n-or+o}if(r!==void 0&&(a=Oc(10,o-i-1),s=u/a%10|0,l=t<0||f[c+1]!==void 0||u%a,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?u/Oc(10,o-i):0:f[c-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return l?(a=Zr(e),f.length=1,t=t-a-1,f[0]=Oc(10,(or-t%or)%or),e.e=tp(-t/or)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=c,a=1,c--):(f.length=c+1,a=Oc(10,or-n),f[c]=i>0?(u/Oc(10,o-i)%Oc(10,i)|0)*a:0),l)for(;;)if(c==0){(f[0]+=a)==vn&&(f[0]=1,++e.e);break}else{if(f[c]+=a,f[c]!=vn)break;f[c--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(cr&&(e.e>nw||e.e<-nw))throw Error(jD+Zr(e));return e}function yX(e,t){var r,n,i,a,o,s,l,u,c,f,h=e.constructor,d=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),cr?Xt(t,d):t;if(l=e.d,f=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(c=o<0,c?(r=l,o=-o,s=f.length):(r=f,n=u,s=l.length),i=Math.max(Math.ceil(d/or),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=f.length,c=i0;--i)l[s++]=0;for(i=f.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+Fl(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Fl(-i-1)+a,r&&(n=r-o)>0&&(a+=Fl(n))):i>=o?(a+=Fl(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Fl(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Fl(n))),e.s<0?"-"+a:a}function Q4(e,t){if(e.length>t)return e.length=t,!0}function xX(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(cf+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return J4(o,a.toString())}else if(typeof a!="string")throw Error(cf+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,jAe.test(a))J4(o,a);else throw Error(cf+a)}if(i.prototype=$e,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=xX,i.config=i.set=RAe,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(cf+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(cf+r+": "+n);return this}var RD=xX(DAe);Ri=new RD(1);const Ut=RD;function BAe(e){return VAe(e)||FAe(e)||$Ae(e)||zAe()}function zAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $Ae(e,t){if(e){if(typeof e=="string")return OL(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return OL(e,t)}}function FAe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function VAe(e){if(Array.isArray(e))return OL(e)}function OL(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,e$(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function n2e(e){if(Array.isArray(e))return e}function TX(e){var t=gy(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function CX(e,t,r){if(e.lte(0))return new Ut(0);var n=UT.getDigitCount(e.toNumber()),i=new Ut(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new Ut(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return t?l:new Ut(Math.ceil(l))}function i2e(e,t,r){var n=1,i=new Ut(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new Ut(10).pow(UT.getDigitCount(e)-1),i=new Ut(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new Ut(Math.floor(e)))}else e===0?i=new Ut(Math.floor((t-1)/2)):r||(i=new Ut(Math.floor(e)));var o=Math.floor((t-1)/2),s=UAe(HAe(function(l){return i.add(new Ut(l-o).mul(n)).toNumber()}),EL);return s(0,t)}function AX(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Ut(0),tickMin:new Ut(0),tickMax:new Ut(0)};var a=CX(new Ut(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new Ut(0):(o=new Ut(e).add(t).div(2),o=o.sub(new Ut(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),l=Math.ceil(new Ut(t).sub(o).div(a).toNumber()),u=s+l+1;return u>r?AX(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:a,tickMin:o.sub(new Ut(s).mul(a)),tickMax:o.add(new Ut(l).mul(a))})}function a2e(e){var t=gy(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=TX([r,n]),l=gy(s,2),u=l[0],c=l[1];if(u===-1/0||c===1/0){var f=c===1/0?[u].concat(DL(EL(0,i-1).map(function(){return 1/0}))):[].concat(DL(EL(0,i-1).map(function(){return-1/0})),[c]);return r>n?NL(f):f}if(u===c)return i2e(u,i,a);var h=AX(u,c,o,a),d=h.step,v=h.tickMin,m=h.tickMax,y=UT.rangeStep(v,m.add(new Ut(.1).mul(d)),d);return r>n?NL(y):y}function o2e(e,t){var r=gy(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=TX([n,i]),s=gy(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var c=Math.max(t,2),f=CX(new Ut(u).sub(l).div(c-1),a,0),h=[].concat(DL(UT.rangeStep(new Ut(l),new Ut(u).sub(new Ut(.99).mul(f)),f)),[u]);return n>i?NL(h):h}var s2e=wX(a2e),l2e=wX(o2e),u2e="Invariant failed";function Pf(e,t){throw new Error(u2e)}var c2e=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function rv(e){"@babel/helpers - typeof";return rv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rv(e)}function iw(){return iw=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function m2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function y2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x2e(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,u=0;u0?i[u-1].coordinate:i[s-1].coordinate,f=i[u].coordinate,h=u>=s-1?i[0].coordinate:i[u+1].coordinate,d=void 0;if(ro(f-c)!==ro(h-f)){var v=[];if(ro(h-f)===ro(l[1]-l[0])){d=h;var m=f+l[1]-l[0];v[0]=Math.min(m,(m+c)/2),v[1]=Math.max(m,(m+c)/2)}else{d=c;var y=h+l[1]-l[0];v[0]=Math.min(f,(y+f)/2),v[1]=Math.max(f,(y+f)/2)}var x=[Math.min(f,(d+f)/2),Math.max(f,(d+f)/2)];if(t>x[0]&&t<=x[1]||t>=v[0]&&t<=v[1]){o=i[u].index;break}}else{var _=Math.min(c,h),b=Math.max(c,h);if(t>(_+f)/2&&t<=(b+f)/2){o=i[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},BD=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Cr(Cr({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},j2e=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),l=0,u=s.length;l=0});if(x&&x.length){var _=x[0].type.defaultProps,b=_!==void 0?Cr(Cr({},_),x[0].props):x[0].props,S=b.barSize,T=b[y];o[T]||(o[T]=[]);var C=mt(S)?r:S;o[T].push({item:x[0],stackList:x.slice(1),barSize:mt(C)?void 0:Af(C,n,0)})}}return o},R2e=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=Af(r,i,0,!0),c,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,d=i/l,v=o.reduce(function(S,T){return S+T.barSize||0},0);v+=(l-1)*u,v>=i&&(v-=(l-1)*u,u=0),v>=i&&d>0&&(h=!0,d*=.9,v=l*d);var m=(i-v)/2>>0,y={offset:m-u,size:0};c=o.reduce(function(S,T){var C={item:T.item,position:{offset:y.offset+y.size+u,size:h?d:T.barSize}},A=[].concat(n$(S),[C]);return y=A[A.length-1].position,T.stackList&&T.stackList.length&&T.stackList.forEach(function(P){A.push({item:P,position:y})}),A},f)}else{var x=Af(n,i,0,!0);i-2*x-(l-1)*u<=0&&(u=0);var _=(i-2*x-(l-1)*u)/l;_>1&&(_>>=0);var b=s===+s?Math.min(_,s):_;c=o.reduce(function(S,T,C){var A=[].concat(n$(S),[{item:T.item,position:{offset:x+(_+u)*C+(_-b)/2,size:b}}]);return T.stackList&&T.stackList.length&&T.stackList.forEach(function(P){A.push({item:P,position:A[A.length-1].position})}),A},f)}return c},B2e=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=LX({children:a,legendWidth:l});if(u){var c=i||{},f=c.width,h=c.height,d=u.align,v=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&v==="middle")&&d!=="center"&&Me(t[d]))return Cr(Cr({},t),{},Id({},d,t[d]+(f||0)));if((m==="horizontal"||m==="vertical"&&d==="center")&&v!=="middle"&&Me(t[v]))return Cr(Cr({},t),{},Id({},v,t[v]+(h||0)))}return t},z2e=function(t,r,n){return mt(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},IX=function(t,r,n,i,a){var o=r.props.children,s=Ta(o,I0).filter(function(u){return z2e(i,a,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,c){var f=oi(c,n);if(mt(f))return u;var h=Array.isArray(f)?[WT(f),Xl(f)]:[f,f],d=l.reduce(function(v,m){var y=oi(c,m,0),x=h[0]-Math.abs(Array.isArray(y)?y[0]:y),_=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(x,v[0]),Math.max(_,v[1])]},[1/0,-1/0]);return[Math.min(d[0],u[0]),Math.max(d[1],u[1])]},[1/0,-1/0])}return null},$2e=function(t,r,n,i,a){var o=r.map(function(s){return IX(t,s,n,a,i)}).filter(function(s){return!mt(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},OX=function(t,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&IX(t,l,u,i)||vm(t,u,n,a)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var c=0,f=u.length;c=2?ro(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var c=(t.ticks||t.niceTicks).map(function(f){var h=a?a.indexOf(f):f;return{coordinate:i(h)+u,value:f,offset:u}});return c.filter(function(f){return!Zv(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:i(f)+u,value:f,index:h,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,h){return{coordinate:i(f)+u,value:a?a[f]:f,index:h,offset:u}})},v2=new WeakMap,Jx=function(t,r){if(typeof r!="function")return t;v2.has(t)||v2.set(t,new WeakMap);var n=v2.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},F2e=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:cy(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:Q1(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:dm(),realScaleType:"point"}:a==="category"?{scale:cy(),realScaleType:"band"}:{scale:Q1(),realScaleType:"linear"};if(Cf(i)){var l="scale".concat(IT(i));return{scale:(K4[l]||dm)(),realScaleType:K4[l]?l:"point"}}return pt(i)?{scale:i}:{scale:dm(),realScaleType:"point"}},a$=1e-4,V2e=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-a$,o=Math.max(i[0],i[1])+a$,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},G2e=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},U2e=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+s,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},Z2e={sign:H2e,expand:sge,none:Zd,silhouette:lge,wiggle:uge,positive:U2e},Y2e=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=Z2e[n],o=oge().keys(i).value(function(s,l){return+oi(s,l,0)}).order(uL).offset(a);return o(t)},q2e=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(f,h){var d,v=(d=h.type)!==null&&d!==void 0&&d.defaultProps?Cr(Cr({},h.type.defaultProps),h.props):h.props,m=v.stackId,y=v.hide;if(y)return f;var x=v[n],_=f[x]||{hasStack:!1,stackGroups:{}};if(rn(m)){var b=_.stackGroups[m]||{numericAxisId:n,cateAxisId:i,items:[]};b.items.push(h),_.hasStack=!0,_.stackGroups[m]=b}else _.stackGroups[Yv("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return Cr(Cr({},f),{},Id({},x,_))},l),c={};return Object.keys(u).reduce(function(f,h){var d=u[h];if(d.hasStack){var v={};d.stackGroups=Object.keys(d.stackGroups).reduce(function(m,y){var x=d.stackGroups[y];return Cr(Cr({},m),{},Id({},y,{numericAxisId:n,cateAxisId:i,items:x.items,stackedData:Y2e(t,x.items,a)}))},v)}return Cr(Cr({},f),{},Id({},h,d))},c)},X2e=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var c=s2e(u,a,s);return t.domain([WT(c),Xl(c)]),{niceTicks:c}}if(a&&i==="number"){var f=t.domain(),h=l2e(f,a,s);return{niceTicks:h}}return null};function ow(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!mt(i[t.dataKey])){var s=k1(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var l=oi(i,mt(o)?t.dataKey:o);return mt(l)?null:t.scale(l)}var o$=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var l=oi(o,r.dataKey,r.domain[s]);return mt(l)?null:r.scale(l)-a/2+i},K2e=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},J2e=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Cr(Cr({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(rn(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},Q2e=function(t){return t.reduce(function(r,n){return[WT(n.concat([r[0]]).filter(Me)),Xl(n.concat([r[1]]).filter(Me))]},[1/0,-1/0])},NX=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,l=s.reduce(function(u,c){var f=Q2e(c.slice(r,n+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},s$=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,l$=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,zL=function(t,r,n){if(pt(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(Me(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(s$.test(t[0])){var a=+s$.exec(t[0])[1];i[0]=r[0]-a}else pt(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(Me(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(l$.test(t[1])){var o=+l$.exec(t[1])[1];i[1]=r[1]+o}else pt(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},sw=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=hD(r,function(f){return f.coordinate}),o=1/0,s=1,l=a.length;so&&(u=2*Math.PI-u),{radius:s,angle:nMe(u),angleInRadian:u}},oMe=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},sMe=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},h$=function(t,r){var n=t.x,i=t.y,a=aMe({x:n,y:i},r),o=a.radius,s=a.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var c=oMe(r),f=c.startAngle,h=c.endAngle,d=s,v;if(f<=h){for(;d>h;)d-=360;for(;d=f&&d<=h}else{for(;d>f;)d-=360;for(;d=h&&d<=f}return v?f$(f$({},r),{},{radius:o,angle:sMe(d,r)}):null};function _y(e){"@babel/helpers - typeof";return _y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_y(e)}var lMe=["offset"];function uMe(e){return dMe(e)||hMe(e)||fMe(e)||cMe()}function cMe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fMe(e,t){if(e){if(typeof e=="string")return $L(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $L(e,t)}}function hMe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dMe(e){if(Array.isArray(e))return $L(e)}function $L(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function pMe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function d$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Jr(e){for(var t=1;t=0?1:-1,b,S;i==="insideStart"?(b=d+_*o,S=m):i==="insideEnd"?(b=v-_*o,S=!m):i==="end"&&(b=v+_*o,S=m),S=x<=0?S:!S;var T=kn(u,c,y,b),C=kn(u,c,y,b+(S?1:-1)*359),A="M".concat(T.x,",").concat(T.y,` - A`).concat(y,",").concat(y,",0,1,").concat(S?0:1,`, - `).concat(C.x,",").concat(C.y),P=mt(t.id)?Yv("recharts-radial-line-"):t.id;return Q.createElement("text",by({},n,{dominantBaseline:"central",className:Ct("recharts-radial-bar-label",s)}),Q.createElement("defs",null,Q.createElement("path",{id:P,d:A})),Q.createElement("textPath",{xlinkHref:"#".concat(P)},r))},wMe=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,s=a.cy,l=a.innerRadius,u=a.outerRadius,c=a.startAngle,f=a.endAngle,h=(c+f)/2;if(i==="outside"){var d=kn(o,s,u+n,h),v=d.x,m=d.y;return{x:v,y:m,textAnchor:v>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var y=(l+u)/2,x=kn(o,s,y,h),_=x.x,b=x.y;return{x:_,y:b,textAnchor:"middle",verticalAnchor:"middle"}},SMe=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,l=o.y,u=o.width,c=o.height,f=c>=0?1:-1,h=f*i,d=f>0?"end":"start",v=f>0?"start":"end",m=u>=0?1:-1,y=m*i,x=m>0?"end":"start",_=m>0?"start":"end";if(a==="top"){var b={x:s+u/2,y:l-f*i,textAnchor:"middle",verticalAnchor:d};return Jr(Jr({},b),n?{height:Math.max(l-n.y,0),width:u}:{})}if(a==="bottom"){var S={x:s+u/2,y:l+c+h,textAnchor:"middle",verticalAnchor:v};return Jr(Jr({},S),n?{height:Math.max(n.y+n.height-(l+c),0),width:u}:{})}if(a==="left"){var T={x:s-y,y:l+c/2,textAnchor:x,verticalAnchor:"middle"};return Jr(Jr({},T),n?{width:Math.max(T.x-n.x,0),height:c}:{})}if(a==="right"){var C={x:s+u+y,y:l+c/2,textAnchor:_,verticalAnchor:"middle"};return Jr(Jr({},C),n?{width:Math.max(n.x+n.width-C.x,0),height:c}:{})}var A=n?{width:u,height:c}:{};return a==="insideLeft"?Jr({x:s+y,y:l+c/2,textAnchor:_,verticalAnchor:"middle"},A):a==="insideRight"?Jr({x:s+u-y,y:l+c/2,textAnchor:x,verticalAnchor:"middle"},A):a==="insideTop"?Jr({x:s+u/2,y:l+h,textAnchor:"middle",verticalAnchor:v},A):a==="insideBottom"?Jr({x:s+u/2,y:l+c-h,textAnchor:"middle",verticalAnchor:d},A):a==="insideTopLeft"?Jr({x:s+y,y:l+h,textAnchor:_,verticalAnchor:v},A):a==="insideTopRight"?Jr({x:s+u-y,y:l+h,textAnchor:x,verticalAnchor:v},A):a==="insideBottomLeft"?Jr({x:s+y,y:l+c-h,textAnchor:_,verticalAnchor:d},A):a==="insideBottomRight"?Jr({x:s+u-y,y:l+c-h,textAnchor:x,verticalAnchor:d},A):Gv(a)&&(Me(a.x)||Zc(a.x))&&(Me(a.y)||Zc(a.y))?Jr({x:s+Af(a.x,u),y:l+Af(a.y,c),textAnchor:"end",verticalAnchor:"end"},A):Jr({x:s+u/2,y:l+c/2,textAnchor:"middle",verticalAnchor:"middle"},A)},TMe=function(t){return"cx"in t&&Me(t.cx)};function Un(e){var t=e.offset,r=t===void 0?5:t,n=vMe(e,lMe),i=Jr({offset:r},n),a=i.viewBox,o=i.position,s=i.value,l=i.children,u=i.content,c=i.className,f=c===void 0?"":c,h=i.textBreakAll;if(!a||mt(s)&&mt(l)&&!G.isValidElement(u)&&!pt(u))return null;if(G.isValidElement(u))return G.cloneElement(u,i);var d;if(pt(u)){if(d=G.createElement(u,i),G.isValidElement(d))return d}else d=xMe(i);var v=TMe(a),m=vt(i,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return bMe(i,d,m);var y=v?wMe(i):SMe(i);return Q.createElement(H1,by({className:Ct("recharts-label",f)},m,y,{breakAll:h}),d)}Un.displayName="Label";var jX=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,c=t.outerRadius,f=t.x,h=t.y,d=t.top,v=t.left,m=t.width,y=t.height,x=t.clockWise,_=t.labelViewBox;if(_)return _;if(Me(m)&&Me(y)){if(Me(f)&&Me(h))return{x:f,y:h,width:m,height:y};if(Me(d)&&Me(v))return{x:d,y:v,width:m,height:y}}return Me(f)&&Me(h)?{x:f,y:h,width:0,height:0}:Me(r)&&Me(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:c||l||s||0,clockWise:x}:t.viewBox?t.viewBox:{}},CMe=function(t,r){return t?t===!0?Q.createElement(Un,{key:"label-implicit",viewBox:r}):rn(t)?Q.createElement(Un,{key:"label-implicit",viewBox:r,value:t}):G.isValidElement(t)?t.type===Un?G.cloneElement(t,{key:"label-implicit",viewBox:r}):Q.createElement(Un,{key:"label-implicit",content:t,viewBox:r}):pt(t)?Q.createElement(Un,{key:"label-implicit",content:t,viewBox:r}):Gv(t)?Q.createElement(Un,by({viewBox:r},t,{key:"label-implicit"})):null:null},AMe=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=jX(t),o=Ta(i,Un).map(function(l,u){return G.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=CMe(t.label,r||a);return[s].concat(uMe(o))};Un.parseViewBox=jX;Un.renderCallByParent=AMe;function MMe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var PMe=MMe;const kMe=Yt(PMe);function wy(e){"@babel/helpers - typeof";return wy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wy(e)}var LMe=["valueAccessor"],IMe=["data","dataKey","clockWise","id","textBreakAll"];function OMe(e){return jMe(e)||DMe(e)||NMe(e)||EMe()}function EMe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NMe(e,t){if(e){if(typeof e=="string")return FL(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return FL(e,t)}}function DMe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jMe(e){if(Array.isArray(e))return FL(e)}function FL(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $Me(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var FMe=function(t){return Array.isArray(t.value)?kMe(t.value):t.value};function Us(e){var t=e.valueAccessor,r=t===void 0?FMe:t,n=g$(e,LMe),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=g$(n,IMe);return!i||!i.length?null:Q.createElement(nr,{className:"recharts-label-list"},i.map(function(c,f){var h=mt(a)?r(c,f):oi(c&&c.payload,a),d=mt(s)?{}:{id:"".concat(s,"-").concat(f)};return Q.createElement(Un,uw({},vt(c,!0),u,d,{parentViewBox:c.parentViewBox,value:h,textBreakAll:l,viewBox:Un.parseViewBox(mt(o)?c:p$(p$({},c),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Us.displayName="LabelList";function VMe(e,t){return e?e===!0?Q.createElement(Us,{key:"labelList-implicit",data:t}):Q.isValidElement(e)||pt(e)?Q.createElement(Us,{key:"labelList-implicit",data:t,content:e}):Gv(e)?Q.createElement(Us,uw({data:t},e,{key:"labelList-implicit"})):null:null}function GMe(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Ta(n,Us).map(function(o,s){return G.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=VMe(e.label,t);return[a].concat(OMe(i))}Us.renderCallByParent=GMe;function Sy(e){"@babel/helpers - typeof";return Sy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sy(e)}function VL(){return VL=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, - `).concat(f.x,",").concat(f.y,` - `);if(i>0){var d=kn(r,n,i,o),v=kn(r,n,i,u);h+="L ".concat(v.x,",").concat(v.y,` - A `).concat(i,",").concat(i,`,0, - `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, - `).concat(d.x,",").concat(d.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},YMe=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,c=t.endAngle,f=ro(c-u),h=Qx({cx:r,cy:n,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:l}),d=h.circleTangency,v=h.lineTangency,m=h.theta,y=Qx({cx:r,cy:n,radius:a,angle:c,sign:-f,cornerRadius:o,cornerIsExternal:l}),x=y.circleTangency,_=y.lineTangency,b=y.theta,S=l?Math.abs(u-c):Math.abs(u-c)-m-b;if(S<0)return s?"M ".concat(v.x,",").concat(v.y,` - a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 - a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 - `):RX({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:c});var T="M ".concat(v.x,",").concat(v.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(d.x,",").concat(d.y,` - A`).concat(a,",").concat(a,",0,").concat(+(S>180),",").concat(+(f<0),",").concat(x.x,",").concat(x.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(_.x,",").concat(_.y,` - `);if(i>0){var C=Qx({cx:r,cy:n,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),A=C.circleTangency,P=C.lineTangency,I=C.theta,k=Qx({cx:r,cy:n,radius:i,angle:c,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),E=k.circleTangency,N=k.lineTangency,D=k.theta,z=l?Math.abs(u-c):Math.abs(u-c)-I-D;if(z<0&&o===0)return"".concat(T,"L").concat(r,",").concat(n,"Z");T+="L".concat(N.x,",").concat(N.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(E.x,",").concat(E.y,` - A`).concat(i,",").concat(i,",0,").concat(+(z>180),",").concat(+(f>0),",").concat(A.x,",").concat(A.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,"Z")}else T+="L".concat(r,",").concat(n,"Z");return T},qMe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},BX=function(t){var r=y$(y$({},qMe),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,c=r.startAngle,f=r.endAngle,h=r.className;if(o0&&Math.abs(c-f)<360?y=YMe({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(m,v/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:c,endAngle:f}):y=RX({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:c,endAngle:f}),Q.createElement("path",VL({},vt(r,!0),{className:d,d:y,role:"img"}))};function Ty(e){"@babel/helpers - typeof";return Ty=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ty(e)}function GL(){return GL=Object.assign?Object.assign.bind():function(e){for(var t=1;tlPe.call(e,t));function Yf(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const fPe="__v",hPe="__o",dPe="_owner",{getOwnPropertyDescriptor:S$,keys:T$}=Object;function vPe(e,t){return e.byteLength===t.byteLength&&cw(new Uint8Array(e),new Uint8Array(t))}function pPe(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function gPe(e,t){return e.byteLength===t.byteLength&&cw(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function mPe(e,t){return Yf(e.getTime(),t.getTime())}function yPe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function xPe(e,t){return e===t}function C$(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.entries();let o,s,l=0;for(;(o=a.next())&&!o.done;){const u=t.entries();let c=!1,f=0;for(;(s=u.next())&&!s.done;){if(i[f]){f++;continue}const h=o.value,d=s.value;if(r.equals(h[0],d[0],l,f,e,t,r)&&r.equals(h[1],d[1],h[0],d[0],e,t,r)){c=i[f]=!0;break}f++}if(!c)return!1;l++}return!0}const _Pe=Yf;function bPe(e,t,r){const n=T$(e);let i=n.length;if(T$(t).length!==i)return!1;for(;i-- >0;)if(!VX(e,t,r,n[i]))return!1;return!0}function ig(e,t,r){const n=w$(e);let i=n.length;if(w$(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=n[i],!VX(e,t,r,a)||(o=S$(e,a),s=S$(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function wPe(e,t){return Yf(e.valueOf(),t.valueOf())}function SPe(e,t){return e.source===t.source&&e.flags===t.flags}function A$(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.values();let o,s;for(;(o=a.next())&&!o.done;){const l=t.values();let u=!1,c=0;for(;(s=l.next())&&!s.done;){if(!i[c]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=i[c]=!0;break}c++}if(!u)return!1}return!0}function cw(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function TPe(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function VX(e,t,r,n){return(n===dPe||n===hPe||n===fPe)&&(e.$$typeof||t.$$typeof)?!0:cPe(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const CPe="[object ArrayBuffer]",APe="[object Arguments]",MPe="[object Boolean]",PPe="[object DataView]",kPe="[object Date]",LPe="[object Error]",IPe="[object Map]",OPe="[object Number]",EPe="[object Object]",NPe="[object RegExp]",DPe="[object Set]",jPe="[object String]",RPe={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},BPe="[object URL]",zPe=Object.prototype.toString;function $Pe({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:c,areSetsEqual:f,areTypedArraysEqual:h,areUrlsEqual:d,unknownTagComparators:v}){return function(y,x,_){if(y===x)return!0;if(y==null||x==null)return!1;const b=typeof y;if(b!==typeof x)return!1;if(b!=="object")return b==="number"?s(y,x,_):b==="function"?a(y,x,_):!1;const S=y.constructor;if(S!==x.constructor)return!1;if(S===Object)return l(y,x,_);if(Array.isArray(y))return t(y,x,_);if(S===Date)return n(y,x,_);if(S===RegExp)return c(y,x,_);if(S===Map)return o(y,x,_);if(S===Set)return f(y,x,_);const T=zPe.call(y);if(T===kPe)return n(y,x,_);if(T===NPe)return c(y,x,_);if(T===IPe)return o(y,x,_);if(T===DPe)return f(y,x,_);if(T===EPe)return typeof y.then!="function"&&typeof x.then!="function"&&l(y,x,_);if(T===BPe)return d(y,x,_);if(T===LPe)return i(y,x,_);if(T===APe)return l(y,x,_);if(RPe[T])return h(y,x,_);if(T===CPe)return e(y,x,_);if(T===PPe)return r(y,x,_);if(T===MPe||T===OPe||T===jPe)return u(y,x,_);if(v){let C=v[T];if(!C){const A=uPe(y);A&&(C=v[A])}if(C)return C(y,x,_)}return!1}}function FPe({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:vPe,areArraysEqual:r?ig:pPe,areDataViewsEqual:gPe,areDatesEqual:mPe,areErrorsEqual:yPe,areFunctionsEqual:xPe,areMapsEqual:r?p2(C$,ig):C$,areNumbersEqual:_Pe,areObjectsEqual:r?ig:bPe,arePrimitiveWrappersEqual:wPe,areRegExpsEqual:SPe,areSetsEqual:r?p2(A$,ig):A$,areTypedArraysEqual:r?p2(cw,ig):cw,areUrlsEqual:TPe,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=t_(n.areArraysEqual),a=t_(n.areMapsEqual),o=t_(n.areObjectsEqual),s=t_(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:s})}return n}function VPe(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function GPe({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:c}=r();return t(s,l,{cache:u,equals:n,meta:c,strict:i})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(s,l){return t(s,l,a)}}const WPe=Vu();Vu({strict:!0});Vu({circular:!0});Vu({circular:!0,strict:!0});Vu({createInternalComparator:()=>Yf});Vu({strict:!0,createInternalComparator:()=>Yf});Vu({circular:!0,createInternalComparator:()=>Yf});Vu({circular:!0,createInternalComparator:()=>Yf,strict:!0});function Vu(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=FPe(e),o=$Pe(a),s=r?r(o):VPe(o);return GPe({circular:t,comparator:o,createState:n,equals:s,strict:i})}function HPe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function M$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):HPe(i)};requestAnimationFrame(n)}function WL(e){"@babel/helpers - typeof";return WL=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},WL(e)}function UPe(e){return XPe(e)||qPe(e)||YPe(e)||ZPe()}function ZPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YPe(e,t){if(e){if(typeof e=="string")return P$(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P$(e,t)}}function P$(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:x<0?0:x},m=function(x){for(var _=x>1?1:x,b=_,S=0;S<8;++S){var T=f(b)-_,C=d(b);if(Math.abs(T-_)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,l=function(c,f,h){var d=-(c-f)*n,v=h*a,m=h+(d-v)*s/1e3,y=h*s/1e3+c;return Math.abs(y-f)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Mke(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function g2(e){return Ike(e)||Lke(e)||kke(e)||Pke()}function Pke(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kke(e,t){if(e){if(typeof e=="string")return qL(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qL(e,t)}}function Lke(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ike(e){if(Array.isArray(e))return qL(e)}function qL(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function dw(e){return dw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},dw(e)}var ns=function(e){jke(r,e);var t=Rke(r);function r(n,i){var a;Oke(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,l=o.attributeName,u=o.from,c=o.to,f=o.steps,h=o.children,d=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(JL(a)),a.changeStyle=a.changeStyle.bind(JL(a)),!s||d<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:c}),KL(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},KL(a);a.state={style:l?Gg({},l,u):u}}else a.state={style:{}};return a}return Nke(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,u=a.shouldReAnimate,c=a.to,f=a.from,h=this.state.style;if(s){if(!o){var d={style:l?Gg({},l,c):c};this.state&&h&&(l&&h[l]!==c||!l&&h!==c)&&this.setState(d);return}if(!(WPe(i.to,c)&&i.canBegin&&i.isActive)){var v=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=v||u?f:i.to;if(this.state&&h){var y={style:l?Gg({},l,m):m};(l&&h[l]!==m||!l&&h!==m)&&this.setState(y)}this.runAnimation(Va(Va({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,u=i.easing,c=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,d=Tke(o,s,dke(u),l,this.changeStyle),v=function(){a.stopJSAnimation=d()};this.manager.start([h,c,v,l,f])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,u=o[0],c=u.style,f=u.duration,h=f===void 0?0:f,d=function(m,y,x){if(x===0)return m;var _=y.duration,b=y.easing,S=b===void 0?"ease":b,T=y.style,C=y.properties,A=y.onAnimationEnd,P=x>0?o[x-1]:y,I=C||Object.keys(T);if(typeof S=="function"||S==="spring")return[].concat(g2(m),[a.runJSAnimation.bind(a,{from:P.style,to:T,duration:_,easing:S}),_]);var k=I$(I,_,S),E=Va(Va(Va({},P.style),T),{},{transition:k});return[].concat(g2(m),[E,_,A]).filter(tke)};return this.manager.start([l].concat(g2(o.reduce(d,[c,Math.max(h,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=KPe());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,u=i.easing,c=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,d=i.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof d=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var m=s?Gg({},s,l):l,y=I$(Object.keys(m),o,u);v.start([c,a,Va(Va({},m),{},{transition:y}),o,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=Ake(i,Cke),u=G.Children.count(a),c=this.state.style;if(typeof a=="function")return a(c);if(!s||u===0||o<=0)return a;var f=function(d){var v=d.props,m=v.style,y=m===void 0?{}:m,x=v.className,_=G.cloneElement(d,Va(Va({},l),{},{style:Va(Va({},y),c),className:x}));return _};return u===1?f(G.Children.only(a)):Q.createElement("div",null,G.Children.map(a,function(h){return f(h)}))}}]),r}(G.PureComponent);ns.displayName="Animate";ns.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ns.propTypes={from:Bt.oneOfType([Bt.object,Bt.string]),to:Bt.oneOfType([Bt.object,Bt.string]),attributeName:Bt.string,duration:Bt.number,begin:Bt.number,easing:Bt.oneOfType([Bt.string,Bt.func]),steps:Bt.arrayOf(Bt.shape({duration:Bt.number.isRequired,style:Bt.object.isRequired,easing:Bt.oneOfType([Bt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Bt.func]),properties:Bt.arrayOf("string"),onAnimationEnd:Bt.func})),children:Bt.oneOfType([Bt.node,Bt.func]),isActive:Bt.bool,canBegin:Bt.bool,onAnimationEnd:Bt.func,shouldReAnimate:Bt.bool,onAnimationStart:Bt.func,onAnimationReStart:Bt.func};function My(e){"@babel/helpers - typeof";return My=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},My(e)}function vw(){return vw=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,c;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],h=0,d=4;ho?o:a[h];c="M".concat(t,",").concat(r+s*f[0]),f[0]>0&&(c+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+l*f[0],",").concat(r)),c+="L ".concat(t+n-l*f[1],",").concat(r),f[1]>0&&(c+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`, - `).concat(t+n,",").concat(r+s*f[1])),c+="L ".concat(t+n,",").concat(r+i-s*f[2]),f[2]>0&&(c+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`, - `).concat(t+n-l*f[2],",").concat(r+i)),c+="L ".concat(t+l*f[3],",").concat(r+i),f[3]>0&&(c+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`, - `).concat(t,",").concat(r+i-s*f[3])),c+="Z"}else if(o>0&&a===+a&&a>0){var v=Math.min(o,a);c="M ".concat(t,",").concat(r+s*v,` - A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+l*v,",").concat(r,` - L `).concat(t+n-l*v,",").concat(r,` - A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+n,",").concat(r+s*v,` - L `).concat(t+n,",").concat(r+i-s*v,` - A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+n-l*v,",").concat(r+i,` - L `).concat(t+l*v,",").concat(r+i,` - A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t,",").concat(r+i-s*v," Z")}else c="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return c},Zke=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(a,a+s),c=Math.max(a,a+s),f=Math.min(o,o+l),h=Math.max(o,o+l);return n>=u&&n<=c&&i>=f&&i<=h}return!1},Yke={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},zD=function(t){var r=z$(z$({},Yke),t),n=G.useRef(),i=G.useState(-1),a=zke(i,2),o=a[0],s=a[1];G.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,u=r.y,c=r.width,f=r.height,h=r.radius,d=r.className,v=r.animationEasing,m=r.animationDuration,y=r.animationBegin,x=r.isAnimationActive,_=r.isUpdateAnimationActive;if(l!==+l||u!==+u||c!==+c||f!==+f||c===0||f===0)return null;var b=Ct("recharts-rectangle",d);return _?Q.createElement(ns,{canBegin:o>0,from:{width:c,height:f,x:l,y:u},to:{width:c,height:f,x:l,y:u},duration:m,animationEasing:v,isActive:_},function(S){var T=S.width,C=S.height,A=S.x,P=S.y;return Q.createElement(ns,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,isActive:x,easing:v},Q.createElement("path",vw({},vt(r,!0),{className:b,d:$$(A,P,T,C,h),ref:n})))}):Q.createElement("path",vw({},vt(r,!0),{className:b,d:$$(l,u,c,f,h)}))};function QL(){return QL=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tLe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var rLe=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},nLe=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,c=t.width,f=c===void 0?0:c,h=t.height,d=h===void 0?0:h,v=t.className,m=eLe(t,qke),y=Xke({x:n,y:a,top:s,left:u,width:f,height:d},m);return!Me(n)||!Me(a)||!Me(f)||!Me(d)||!Me(s)||!Me(u)?null:Q.createElement("path",eI({},vt(y,!0),{className:Ct("recharts-cross",v),d:rLe(n,a,f,d,s,u)}))},iLe=cq,aLe=iLe(Object.getPrototypeOf,Object),oLe=aLe,sLe=gl,lLe=oLe,uLe=ml,cLe="[object Object]",fLe=Function.prototype,hLe=Object.prototype,qX=fLe.toString,dLe=hLe.hasOwnProperty,vLe=qX.call(Object);function pLe(e){if(!uLe(e)||sLe(e)!=cLe)return!1;var t=lLe(e);if(t===null)return!0;var r=dLe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&qX.call(r)==vLe}var gLe=pLe;const mLe=Yt(gLe);var yLe=gl,xLe=ml,_Le="[object Boolean]";function bLe(e){return e===!0||e===!1||xLe(e)&&yLe(e)==_Le}var wLe=bLe;const SLe=Yt(wLe);function ky(e){"@babel/helpers - typeof";return ky=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ky(e)}function pw(){return pw=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:u},to:{upperWidth:c,lowerWidth:f,height:h,x:l,y:u},duration:m,animationEasing:v,isActive:x},function(b){var S=b.upperWidth,T=b.lowerWidth,C=b.height,A=b.x,P=b.y;return Q.createElement(ns,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,easing:v},Q.createElement("path",pw({},vt(r,!0),{className:_,d:H$(A,P,S,T,C),ref:n})))}):Q.createElement("g",null,Q.createElement("path",pw({},vt(r,!0),{className:_,d:H$(l,u,c,f,h)})))},NLe=["option","shapeType","propTransformer","activeClassName","isActive"];function Ly(e){"@babel/helpers - typeof";return Ly=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ly(e)}function DLe(e,t){if(e==null)return{};var r=jLe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jLe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function U$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gw(e){for(var t=1;t0&&n.handleDrag(i.changedTouches[0])}),Oi(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),Oi(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Oi(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Oi(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Oi(n,"handleSlideDragStart",function(i){var a=Q$(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return bIe(t,e),mIe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,c=u.length-1,f=Math.min(i,a),h=Math.max(i,a),d=t.getIndexInRange(o,f),v=t.getIndexInRange(o,h);return{startIndex:d-d%l,endIndex:v===c?c:v-v%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=oi(a[n],s,n);return pt(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,u=l.x,c=l.width,f=l.travellerWidth,h=l.startIndex,d=l.endIndex,v=l.onChange,m=n.pageX-a;m>0?m=Math.min(m,u+c-f-s,u+c-f-o):m<0&&(m=Math.max(m,u-o,u-s));var y=this.getIndex({startX:o+m,endX:s+m});(y.startIndex!==h||y.endIndex!==d)&&v&&v(y),this.setState({startX:o+m,endX:s+m,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=Q$(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,u=this.state[o],c=this.props,f=c.x,h=c.width,d=c.travellerWidth,v=c.onChange,m=c.gap,y=c.data,x={startX:this.state.startX,endX:this.state.endX},_=n.pageX-a;_>0?_=Math.min(_,f+h-d-u):_<0&&(_=Math.max(_,f-u)),x[o]=u+_;var b=this.getIndex(x),S=b.startIndex,T=b.endIndex,C=function(){var P=y.length-1;return o==="startX"&&(s>l?S%m===0:T%m===0)||sl?T%m===0:S%m===0)||s>l&&T===P};this.setState(Oi(Oi({},o,u+_),"brushMoveStartX",n.pageX),function(){v&&C()&&v(b)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,c=this.state[i],f=s.indexOf(c);if(f!==-1){var h=f+n;if(!(h===-1||h>=s.length)){var d=s[h];i==="startX"&&d>=u||i==="endX"&&d<=l||this.setState(Oi({},i,d),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return Q.createElement("rect",{stroke:u,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.data,u=n.children,c=n.padding,f=G.Children.only(u);return f?Q.cloneElement(f,{x:i,y:a,width:o,height:s,margin:c,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,l=this.props,u=l.y,c=l.travellerWidth,f=l.height,h=l.traveller,d=l.ariaLabel,v=l.data,m=l.startIndex,y=l.endIndex,x=Math.max(n,this.props.x),_=y2(y2({},vt(this.props,!1)),{},{x,y:u,width:c,height:f}),b=d||"Min value: ".concat((a=v[m])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=v[y])===null||o===void 0?void 0:o.name);return Q.createElement(nr,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(T){["ArrowLeft","ArrowRight"].includes(T.key)&&(T.preventDefault(),T.stopPropagation(),s.handleTravellerMoveKeyboard(T.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,_))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,u=a.travellerWidth,c=Math.min(n,i)+u,f=Math.max(Math.abs(i-n)-u,0);return Q.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:c,y:o,width:f,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,c=this.state,f=c.startX,h=c.endX,d=5,v={pointerEvents:"none",fill:u};return Q.createElement(nr,{className:"recharts-brush-texts"},Q.createElement(H1,yw({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-d,y:o+s/2},v),this.getTextOfTick(i)),Q.createElement(H1,yw({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+l+d,y:o+s/2},v),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,l=n.y,u=n.width,c=n.height,f=n.alwaysShowText,h=this.state,d=h.startX,v=h.endX,m=h.isTextActive,y=h.isSlideMoving,x=h.isTravellerMoving,_=h.isTravellerFocused;if(!i||!i.length||!Me(s)||!Me(l)||!Me(u)||!Me(c)||u<=0||c<=0)return null;var b=Ct("recharts-brush",a),S=Q.Children.count(o)===1,T=pIe("userSelect","none");return Q.createElement(nr,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:T},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(d,v),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(v,"endX"),(m||y||x||_||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(a+s/2)-1;return Q.createElement(Q.Fragment,null,Q.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),Q.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),Q.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return Q.isValidElement(n)?a=Q.cloneElement(n,i):pt(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,c=n.startIndex,f=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return y2({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?SIe({data:a,width:o,x:s,travellerWidth:l,startIndex:c,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var h=i.scale.domain().map(function(d){return i.scale(d)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>i?s=l:o=l}return i>=n[s]?s:o}}])}(G.PureComponent);Oi(av,"displayName","Brush");Oi(av,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var TIe=fD;function CIe(e,t){var r;return TIe(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var AIe=CIe,MIe=rq,PIe=Jv,kIe=AIe,LIe=Ti,IIe=RT;function OIe(e,t,r){var n=LIe(e)?MIe:kIe;return r&&IIe(e,t,r)&&(t=void 0),n(e,PIe(t))}var EIe=OIe;const NIe=Yt(EIe);var Xo=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},eF=Sq;function DIe(e,t,r){t=="__proto__"&&eF?eF(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var jIe=DIe,RIe=jIe,BIe=bq,zIe=Jv;function $Ie(e,t){var r={};return t=zIe(t),BIe(e,function(n,i,a){RIe(r,i,t(n,i,a))}),r}var FIe=$Ie;const VIe=Yt(FIe);function GIe(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sOe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function lOe(e,t){var r=e.x,n=e.y,i=oOe(e,rOe),a="".concat(r),o=parseInt(a,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||i.height),c=parseInt(u,10),f="".concat(t.width||i.width),h=parseInt(f,10);return ag(ag(ag(ag(ag({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:c,width:h,name:t.name,radius:t.radius})}function rF(e){return Q.createElement(GLe,rI({shapeType:"rectangle",propTransformer:lOe,activeClassName:"recharts-active-bar"},e))}var uOe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=Me(n)||_ve(n);return a?t(n,i):(a||Pf(),r)}},cOe=["value","background"],QX;function ov(e){"@babel/helpers - typeof";return ov=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ov(e)}function fOe(e,t){if(e==null)return{};var r=hOe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hOe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _w(){return _w=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(V)0&&Math.abs(z)0&&(D=Math.min((te||0)-(z[ce-1]||0),D))}),Number.isFinite(D)){var V=D/N,F=m.layout==="vertical"?n.height:n.width;if(m.padding==="gap"&&(A=V*F/2),m.padding==="no-gap"){var $=Af(t.barCategoryGap,V*F),B=V*F/2;A=B-$-(B-$)/F*$}}}i==="xAxis"?P=[n.left+(b.left||0)+(A||0),n.left+n.width-(b.right||0)-(A||0)]:i==="yAxis"?P=l==="horizontal"?[n.top+n.height-(b.bottom||0),n.top+(b.top||0)]:[n.top+(b.top||0)+(A||0),n.top+n.height-(b.bottom||0)-(A||0)]:P=m.range,T&&(P=[P[1],P[0]]);var H=F2e(m,a,h),U=H.scale,Z=H.realScaleType;U.domain(x).range(P),V2e(U);var Y=X2e(U,Ka(Ka({},m),{},{realScaleType:Z}));i==="xAxis"?(E=y==="top"&&!S||y==="bottom"&&S,I=n.left,k=f[C]-E*m.height):i==="yAxis"&&(E=y==="left"&&!S||y==="right"&&S,I=f[C]-E*m.width,k=n.top);var K=Ka(Ka(Ka({},m),Y),{},{realScaleType:Z,x:I,y:k,scale:U,width:i==="xAxis"?n.width:m.width,height:i==="yAxis"?n.height:m.height});return K.bandSize=sw(K,Y),!m.hide&&i==="xAxis"?f[C]+=(E?-1:1)*K.height:m.hide||(f[C]+=(E?-1:1)*K.width),Ka(Ka({},d),{},XT({},v,K))},{})},iK=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},SOe=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return iK({x:r,y:n},{x:i,y:a})},aK=function(){function e(t){_Oe(this,e),this.scale=t}return bOe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();XT(aK,"EPS",1e-4);var $D=function(t){var r=Object.keys(t).reduce(function(n,i){return Ka(Ka({},n),{},XT({},i,aK.create(t[i])))},{});return Ka(Ka({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return VIe(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return tOe(i,function(a,o){return r[o].isInRange(a)})}})};function TOe(e){return(e%180+180)%180}var COe=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=TOe(i),o=a*Math.PI/180,s=Math.atan(n/r),l=o>s&&oe.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function hEe(e,t){return wK(e,t+1)}function dEe(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,c=o,f=function(){var v=n==null?void 0:n[l];if(v===void 0)return{v:wK(n,u)};var m=l,y,x=function(){return y===void 0&&(y=r(v,m)),y},_=v.coordinate,b=l===0||Cw(e,_,x,c,s);b||(l=0,c=o,u+=1),b&&(c=_+e*(x()/2+i),l+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function jy(e){"@babel/helpers - typeof";return jy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jy(e)}function pF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Vn(e){for(var t=1;t0?d.coordinate-y*e:d.coordinate})}else a[h]=d=Vn(Vn({},d),{},{tickCoord:d.coordinate});var x=Cw(e,d.tickCoord,m,s,l);x&&(l=d.tickCoord-e*(m()/2+i),a[h]=Vn(Vn({},d),{},{isShow:!0}))},c=o-1;c>=0;c--)u(c);return a}function yEe(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(a){var c=n[s-1],f=r(c,s-1),h=e*(c.coordinate+e*f/2-u);o[s-1]=c=Vn(Vn({},c),{},{tickCoord:h>0?c.coordinate-h*e:c.coordinate});var d=Cw(e,c.tickCoord,function(){return f},l,u);d&&(u=c.tickCoord-e*(f/2+i),o[s-1]=Vn(Vn({},c),{},{isShow:!0}))}for(var v=a?s-1:s,m=function(_){var b=o[_],S,T=function(){return S===void 0&&(S=r(b,_)),S};if(_===0){var C=e*(b.coordinate-e*T()/2-l);o[_]=b=Vn(Vn({},b),{},{tickCoord:C<0?b.coordinate-C*e:b.coordinate})}else o[_]=b=Vn(Vn({},b),{},{tickCoord:b.coordinate});var A=Cw(e,b.tickCoord,T,l,u);A&&(l=b.tickCoord+e*(T()/2+i),o[_]=Vn(Vn({},b),{},{isShow:!0}))},y=0;y=2?ro(i[1].coordinate-i[0].coordinate):1,x=fEe(a,y,d);return l==="equidistantPreserveStart"?dEe(y,x,m,i,o):(l==="preserveStart"||l==="preserveStartEnd"?h=yEe(y,x,m,i,o,l==="preserveStartEnd"):h=mEe(y,x,m,i,o),h.filter(function(_){return _.isShow}))}var _Ee=["viewBox"],bEe=["viewBox"],wEe=["ticks"];function cv(e){"@babel/helpers - typeof";return cv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cv(e)}function dd(){return dd=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function SEe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function TEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mF(e,t){for(var r=0;r0?l(this.props):l(d)),o<=0||s<=0||!v||!v.length?null:Q.createElement(nr,{className:Ct("recharts-cartesian-axis",u),ref:function(y){n.layerReference=y}},a&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),Un.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=Ct(i.className,"recharts-cartesian-axis-tick-value");return Q.isValidElement(n)?o=Q.cloneElement(n,Kr(Kr({},i),{},{className:s})):pt(n)?o=n(Kr(Kr({},i),{},{className:s})):o=Q.createElement(H1,dd({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(G.Component);VD(tC,"displayName","CartesianAxis");VD(tC,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var IEe=["type","layout","connectNulls","ref"],OEe=["key"];function fv(e){"@babel/helpers - typeof";return fv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fv(e)}function yF(e,t){if(e==null)return{};var r=EEe(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function EEe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function gm(){return gm=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rf){d=[].concat(bh(l.slice(0,v)),[f-m]);break}var y=d.length%2===0?[0,h]:[h];return[].concat(bh(t.repeat(l,c)),bh(d),y).map(function(x){return"".concat(x,"px")}).join(", ")}),Ja(r,"id",Yv("recharts-line-")),Ja(r,"pathRef",function(o){r.mainCurve=o}),Ja(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Ja(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return GEe(t,e),zEe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,s=a.xAxis,l=a.yAxis,u=a.layout,c=a.children,f=Ta(c,I0);if(!f)return null;var h=function(m,y){return{x:m.x,y:m.y,value:m.value,errorVal:oi(m.payload,y)}},d={clipPath:n?"url(#clipPath-".concat(i,")"):null};return Q.createElement(nr,d,f.map(function(v){return Q.cloneElement(v,{key:"bar-".concat(v.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,c=s.dataKey,f=vt(this.props,!1),h=vt(l,!0),d=u.map(function(m,y){var x=Ii(Ii(Ii({key:"dot-".concat(y),r:3},f),h),{},{index:y,cx:m.x,cy:m.y,value:m.value,dataKey:c,payload:m.payload,points:u});return t.renderDotItem(l,x)}),v={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return Q.createElement(nr,gm({className:"recharts-line-dots",key:"dots"},v),d)}},{key:"renderCurveStatically",value:function(n,i,a,o){var s=this.props,l=s.type,u=s.layout,c=s.connectNulls;s.ref;var f=yF(s,IEe),h=Ii(Ii(Ii({},vt(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:l,layout:u,connectNulls:c});return Q.createElement(Od,gm({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,l=o.strokeDasharray,u=o.isAnimationActive,c=o.animationBegin,f=o.animationDuration,h=o.animationEasing,d=o.animationId,v=o.animateNewValues,m=o.width,y=o.height,x=this.state,_=x.prevPoints,b=x.totalLength;return Q.createElement(ns,{begin:c,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var T=S.t;if(_){var C=_.length/s.length,A=s.map(function(N,D){var z=Math.floor(D*C);if(_[z]){var V=_[z],F=Pn(V.x,N.x),$=Pn(V.y,N.y);return Ii(Ii({},N),{},{x:F(T),y:$(T)})}if(v){var B=Pn(m*2,N.x),H=Pn(y/2,N.y);return Ii(Ii({},N),{},{x:B(T),y:H(T)})}return Ii(Ii({},N),{},{x:N.x,y:N.y})});return a.renderCurveStatically(A,n,i)}var P=Pn(0,b),I=P(T),k;if(l){var E="".concat(l).split(/[,\s]+/gim).map(function(N){return parseFloat(N)});k=a.getStrokeDasharray(I,b,E)}else k=a.generateSimpleStrokeDasharray(b,I);return a.renderCurveStatically(s,n,i,{strokeDasharray:k})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,s=a.isAnimationActive,l=this.state,u=l.prevPoints,c=l.totalLength;return s&&o&&o.length&&(!u&&c>0||!tv(u,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.xAxis,c=i.yAxis,f=i.top,h=i.left,d=i.width,v=i.height,m=i.isAnimationActive,y=i.id;if(a||!s||!s.length)return null;var x=this.state.isAnimationFinished,_=s.length===1,b=Ct("recharts-line",l),S=u&&u.allowDataOverflow,T=c&&c.allowDataOverflow,C=S||T,A=mt(y)?this.id:y,P=(n=vt(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=P.r,k=I===void 0?3:I,E=P.strokeWidth,N=E===void 0?2:E,D=MY(o)?o:{},z=D.clipDot,V=z===void 0?!0:z,F=k*2+N;return Q.createElement(nr,{className:b},S||T?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(A)},Q.createElement("rect",{x:S?h:h-d/2,y:T?f:f-v/2,width:S?d:d*2,height:T?v:v*2})),!V&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(A)},Q.createElement("rect",{x:h-F/2,y:f-F/2,width:d+F,height:v+F}))):null,!_&&this.renderCurve(C,A),this.renderErrorBar(C,A),(_||o)&&this.renderDots(C,V,A),(!m||x)&&Us.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(bh(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ZEe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Kc(){return Kc=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!tv(c,o)||!tv(f,s))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.top,c=i.left,f=i.xAxis,h=i.yAxis,d=i.width,v=i.height,m=i.isAnimationActive,y=i.id;if(a||!s||!s.length)return null;var x=this.state.isAnimationFinished,_=s.length===1,b=Ct("recharts-area",l),S=f&&f.allowDataOverflow,T=h&&h.allowDataOverflow,C=S||T,A=mt(y)?this.id:y,P=(n=vt(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=P.r,k=I===void 0?3:I,E=P.strokeWidth,N=E===void 0?2:E,D=MY(o)?o:{},z=D.clipDot,V=z===void 0?!0:z,F=k*2+N;return Q.createElement(nr,{className:b},S||T?Q.createElement("defs",null,Q.createElement("clipPath",{id:"clipPath-".concat(A)},Q.createElement("rect",{x:S?c:c-d/2,y:T?u:u-v/2,width:S?d:d*2,height:T?v:v*2})),!V&&Q.createElement("clipPath",{id:"clipPath-dots-".concat(A)},Q.createElement("rect",{x:c-F/2,y:u-F/2,width:d+F,height:v+F}))):null,_?null:this.renderArea(C,A),(o||_)&&this.renderDots(C,V,A),(!m||x)&&Us.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(G.PureComponent);MK=Gu;Fo(Gu,"displayName","Area");Fo(Gu,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Hf.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Fo(Gu,"getBaseValue",function(e,t,r,n){var i=e.layout,a=e.baseValue,o=t.props.baseValue,s=o??a;if(Me(s)&&typeof s=="number")return s;var l=i==="horizontal"?n:r,u=l.scale.domain();if(l.type==="number"){var c=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return s==="dataMin"?f:s==="dataMax"||c<0?c:Math.max(Math.min(u[0],u[1]),0)}return s==="dataMin"?u[0]:s==="dataMax"?u[1]:u[0]});Fo(Gu,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,l=e.dataKey,u=e.stackedData,c=e.dataStartIndex,f=e.displayedData,h=e.offset,d=t.layout,v=u&&u.length,m=MK.getBaseValue(t,r,n,i),y=d==="horizontal",x=!1,_=f.map(function(S,T){var C;v?C=u[c+T]:(C=oi(S,l),Array.isArray(C)?x=!0:C=[m,C]);var A=C[1]==null||v&&oi(S,l)==null;return y?{x:ow({axis:n,ticks:a,bandSize:s,entry:S,index:T}),y:A?null:i.scale(C[1]),value:C,payload:S}:{x:A?null:n.scale(C[1]),y:ow({axis:i,ticks:o,bandSize:s,entry:S,index:T}),value:C,payload:S}}),b;return v||x?b=_.map(function(S){var T=Array.isArray(S.value)?S.value[0]:null;return y?{x:S.x,y:T!=null&&S.y!=null?i.scale(T):null}:{x:T!=null?n.scale(T):null,y:S.y}}):b=y?i.scale(m):n.scale(m),jl({points:_,baseLine:b,layout:d,isRange:x},h)});Fo(Gu,"renderDotItem",function(e,t){var r;if(Q.isValidElement(e))r=Q.cloneElement(e,t);else if(pt(e))r=e(t);else{var n=Ct("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=PK(t,UEe);r=Q.createElement(ZT,Kc({},a,{key:i,className:n}))}return r});function dv(e){"@babel/helpers - typeof";return dv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dv(e)}function tNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rNe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function VNe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function GNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WNe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&Me(i)&&Me(a)?t.slice(i,a+1):[]};function WK(e){return e==="number"?[0,"auto"]:void 0}var wI=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=rC(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(l,u){var c,f=(c=u.props.data)!==null&&c!==void 0?c:r;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var d=f===void 0?s:f;h=k1(d,o.dataKey,i)}else h=f&&f[n]||s[n];return h?[].concat(gv(l),[DX(u,h)]):l},[])},PF=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=rDe(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,c=D2e(o,s,u,l);if(c>=0&&u){var f=u[c]&&u[c].value,h=wI(t,r,c,f),d=nDe(n,s,c,a);return{activeTooltipIndex:c,activeLabel:f,activePayload:h,activeCoordinate:d}}return null},iDe=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=t.layout,f=t.children,h=t.stackOffset,d=EX(c,a);return n.reduce(function(v,m){var y,x=m.type.defaultProps!==void 0?he(he({},m.type.defaultProps),m.props):m.props,_=x.type,b=x.dataKey,S=x.allowDataOverflow,T=x.allowDuplicatedCategory,C=x.scale,A=x.ticks,P=x.includeHidden,I=x[o];if(v[I])return v;var k=rC(t.data,{graphicalItems:i.filter(function(Y){var K,te=o in Y.props?Y.props[o]:(K=Y.type.defaultProps)===null||K===void 0?void 0:K[o];return te===I}),dataStartIndex:l,dataEndIndex:u}),E=k.length,N,D,z;LNe(x.domain,S,_)&&(N=zL(x.domain,null,S),d&&(_==="number"||C!=="auto")&&(z=vm(k,b,"category")));var V=WK(_);if(!N||N.length===0){var F,$=(F=x.domain)!==null&&F!==void 0?F:V;if(b){if(N=vm(k,b,_),_==="category"&&d){var B=wve(N);T&&B?(D=N,N=mw(0,E)):T||(N=u$($,N,m).reduce(function(Y,K){return Y.indexOf(K)>=0?Y:[].concat(gv(Y),[K])},[]))}else if(_==="category")T?N=N.filter(function(Y){return Y!==""&&!mt(Y)}):N=u$($,N,m).reduce(function(Y,K){return Y.indexOf(K)>=0||K===""||mt(K)?Y:[].concat(gv(Y),[K])},[]);else if(_==="number"){var H=$2e(k,i.filter(function(Y){var K,te,ce=o in Y.props?Y.props[o]:(K=Y.type.defaultProps)===null||K===void 0?void 0:K[o],de="hide"in Y.props?Y.props.hide:(te=Y.type.defaultProps)===null||te===void 0?void 0:te.hide;return ce===I&&(P||!de)}),b,a,c);H&&(N=H)}d&&(_==="number"||C!=="auto")&&(z=vm(k,b,"category"))}else d?N=mw(0,E):s&&s[I]&&s[I].hasStack&&_==="number"?N=h==="expand"?[0,1]:NX(s[I].stackGroups,l,u):N=OX(k,i.filter(function(Y){var K=o in Y.props?Y.props[o]:Y.type.defaultProps[o],te="hide"in Y.props?Y.props.hide:Y.type.defaultProps.hide;return K===I&&(P||!te)}),_,c,!0);if(_==="number")N=xI(f,N,I,a,A),$&&(N=zL($,N,S));else if(_==="category"&&$){var U=$,Z=N.every(function(Y){return U.indexOf(Y)>=0});Z&&(N=U)}}return he(he({},v),{},et({},I,he(he({},x),{},{axisType:a,domain:N,categoricalDomain:z,duplicateDomain:D,originalDomain:(y=x.domain)!==null&&y!==void 0?y:V,isCategorical:d,layout:c})))},{})},aDe=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=t.layout,f=t.children,h=rC(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),d=h.length,v=EX(c,a),m=-1;return n.reduce(function(y,x){var _=x.type.defaultProps!==void 0?he(he({},x.type.defaultProps),x.props):x.props,b=_[o],S=WK("number");if(!y[b]){m++;var T;return v?T=mw(0,d):s&&s[b]&&s[b].hasStack?(T=NX(s[b].stackGroups,l,u),T=xI(f,T,b,a)):(T=zL(S,OX(h,n.filter(function(C){var A,P,I=o in C.props?C.props[o]:(A=C.type.defaultProps)===null||A===void 0?void 0:A[o],k="hide"in C.props?C.props.hide:(P=C.type.defaultProps)===null||P===void 0?void 0:P.hide;return I===b&&!k}),"number",c),i.defaultProps.allowDataOverflow),T=xI(f,T,b,a)),he(he({},y),{},et({},b,he(he({axisType:a},i.defaultProps),{},{hide:!0,orientation:Sa(eDe,"".concat(a,".").concat(m%2),null),domain:T,originalDomain:S,isCategorical:v,layout:c})))}return y},{})},oDe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=t.children,f="".concat(i,"Id"),h=Ta(c,a),d={};return h&&h.length?d=iDe(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(d=aDe(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),d},sDe=function(t){var r=qh(t),n=Xc(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:hD(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:sw(r,n)}},kF=function(t){var r=t.children,n=t.defaultShowTooltip,i=Ni(r,av),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},lDe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Ws(r&&r.type);return n&&n.indexOf("Bar")>=0})},LF=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},uDe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,c=n.height,f=n.children,h=n.margin||{},d=Ni(f,av),v=Ni(f,kd),m=Object.keys(l).reduce(function(T,C){var A=l[C],P=A.orientation;return!A.mirror&&!A.hide?he(he({},T),{},et({},P,T[P]+A.width)):T},{left:h.left||0,right:h.right||0}),y=Object.keys(o).reduce(function(T,C){var A=o[C],P=A.orientation;return!A.mirror&&!A.hide?he(he({},T),{},et({},P,Sa(T,"".concat(P))+A.height)):T},{top:h.top||0,bottom:h.bottom||0}),x=he(he({},y),m),_=x.bottom;d&&(x.bottom+=d.props.height||av.defaultProps.height),v&&r&&(x=B2e(x,i,n,r));var b=u-x.left-x.right,S=c-x.top-x.bottom;return he(he({brushBottom:_},x),{},{width:Math.max(b,0),height:Math.max(S,0)})},cDe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},HK=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,c=t.formatAxisMap,f=t.defaultProps,h=function(x,_){var b=_.graphicalItems,S=_.stackGroups,T=_.offset,C=_.updateId,A=_.dataStartIndex,P=_.dataEndIndex,I=x.barSize,k=x.layout,E=x.barGap,N=x.barCategoryGap,D=x.maxBarSize,z=LF(k),V=z.numericAxisName,F=z.cateAxisName,$=lDe(b),B=[];return b.forEach(function(H,U){var Z=rC(x.data,{graphicalItems:[H],dataStartIndex:A,dataEndIndex:P}),Y=H.type.defaultProps!==void 0?he(he({},H.type.defaultProps),H.props):H.props,K=Y.dataKey,te=Y.maxBarSize,ce=Y["".concat(V,"Id")],de=Y["".concat(F,"Id")],Ie={},ye=l.reduce(function(Ir,Rn){var qt=_["".concat(Rn.axisType,"Map")],ah=Y["".concat(Rn.axisType,"Id")];qt&&qt[ah]||Rn.axisType==="zAxis"||Pf();var oh=qt[ah];return he(he({},Ir),{},et(et({},Rn.axisType,oh),"".concat(Rn.axisType,"Ticks"),Xc(oh)))},Ie),ne=ye[F],ve=ye["".concat(F,"Ticks")],ue=S&&S[ce]&&S[ce].hasStack&&J2e(H,S[ce].stackGroups),ee=Ws(H.type).indexOf("Bar")>=0,Ge=sw(ne,ve),Ae=[],We=$&&j2e({barSize:I,stackGroups:S,totalSize:cDe(ye,F)});if(ee){var Ye,ht,Rt=mt(te)?D:te,Jt=(Ye=(ht=sw(ne,ve,!0))!==null&&ht!==void 0?ht:Rt)!==null&&Ye!==void 0?Ye:0;Ae=R2e({barGap:E,barCategoryGap:N,bandSize:Jt!==Ge?Jt:Ge,sizeList:We[de],maxBarSize:Rt}),Jt!==Ge&&(Ae=Ae.map(function(Ir){return he(he({},Ir),{},{position:he(he({},Ir.position),{},{offset:Ir.position.offset-Jt/2})})}))}var cn=H&&H.type&&H.type.getComposedData;cn&&B.push({props:he(he({},cn(he(he({},ye),{},{displayedData:Z,props:x,dataKey:K,item:H,bandSize:Ge,barPosition:Ae,offset:T,stackedData:ue,layout:k,dataStartIndex:A,dataEndIndex:P}))),{},et(et(et({key:H.key||"item-".concat(U)},V,ye[V]),F,ye[F]),"animationId",C)),childIndex:Nve(H,x.children),item:H})}),B},d=function(x,_){var b=x.props,S=x.dataStartIndex,T=x.dataEndIndex,C=x.updateId;if(!nz({props:b}))return null;var A=b.children,P=b.layout,I=b.stackOffset,k=b.data,E=b.reverseStackOrder,N=LF(P),D=N.numericAxisName,z=N.cateAxisName,V=Ta(A,n),F=q2e(k,V,"".concat(D,"Id"),"".concat(z,"Id"),I,E),$=l.reduce(function(Y,K){var te="".concat(K.axisType,"Map");return he(he({},Y),{},et({},te,oDe(b,he(he({},K),{},{graphicalItems:V,stackGroups:K.axisType===D&&F,dataStartIndex:S,dataEndIndex:T}))))},{}),B=uDe(he(he({},$),{},{props:b,graphicalItems:V}),_==null?void 0:_.legendBBox);Object.keys($).forEach(function(Y){$[Y]=c(b,$[Y],B,Y.replace("Map",""),r)});var H=$["".concat(z,"Map")],U=sDe(H),Z=h(b,he(he({},$),{},{dataStartIndex:S,dataEndIndex:T,updateId:C,graphicalItems:V,stackGroups:F,offset:B}));return he(he({formattedGraphicalItems:Z,graphicalItems:V,offset:B,stackGroups:F},U),$)},v=function(y){function x(_){var b,S,T;return GNe(this,x),T=UNe(this,x,[_]),et(T,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),et(T,"accessibilityManager",new kNe),et(T,"handleLegendBBoxUpdate",function(C){if(C){var A=T.state,P=A.dataStartIndex,I=A.dataEndIndex,k=A.updateId;T.setState(he({legendBBox:C},d({props:T.props,dataStartIndex:P,dataEndIndex:I,updateId:k},he(he({},T.state),{},{legendBBox:C}))))}}),et(T,"handleReceiveSyncEvent",function(C,A,P){if(T.props.syncId===C){if(P===T.eventEmitterSymbol&&typeof T.props.syncMethod!="function")return;T.applySyncEvent(A)}}),et(T,"handleBrushChange",function(C){var A=C.startIndex,P=C.endIndex;if(A!==T.state.dataStartIndex||P!==T.state.dataEndIndex){var I=T.state.updateId;T.setState(function(){return he({dataStartIndex:A,dataEndIndex:P},d({props:T.props,dataStartIndex:A,dataEndIndex:P,updateId:I},T.state))}),T.triggerSyncEvent({dataStartIndex:A,dataEndIndex:P})}}),et(T,"handleMouseEnter",function(C){var A=T.getMouseInfo(C);if(A){var P=he(he({},A),{},{isTooltipActive:!0});T.setState(P),T.triggerSyncEvent(P);var I=T.props.onMouseEnter;pt(I)&&I(P,C)}}),et(T,"triggeredAfterMouseMove",function(C){var A=T.getMouseInfo(C),P=A?he(he({},A),{},{isTooltipActive:!0}):{isTooltipActive:!1};T.setState(P),T.triggerSyncEvent(P);var I=T.props.onMouseMove;pt(I)&&I(P,C)}),et(T,"handleItemMouseEnter",function(C){T.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),et(T,"handleItemMouseLeave",function(){T.setState(function(){return{isTooltipActive:!1}})}),et(T,"handleMouseMove",function(C){C.persist(),T.throttleTriggeredAfterMouseMove(C)}),et(T,"handleMouseLeave",function(C){T.throttleTriggeredAfterMouseMove.cancel();var A={isTooltipActive:!1};T.setState(A),T.triggerSyncEvent(A);var P=T.props.onMouseLeave;pt(P)&&P(A,C)}),et(T,"handleOuterEvent",function(C){var A=Eve(C),P=Sa(T.props,"".concat(A));if(A&&pt(P)){var I,k;/.*touch.*/i.test(A)?k=T.getMouseInfo(C.changedTouches[0]):k=T.getMouseInfo(C),P((I=k)!==null&&I!==void 0?I:{},C)}}),et(T,"handleClick",function(C){var A=T.getMouseInfo(C);if(A){var P=he(he({},A),{},{isTooltipActive:!0});T.setState(P),T.triggerSyncEvent(P);var I=T.props.onClick;pt(I)&&I(P,C)}}),et(T,"handleMouseDown",function(C){var A=T.props.onMouseDown;if(pt(A)){var P=T.getMouseInfo(C);A(P,C)}}),et(T,"handleMouseUp",function(C){var A=T.props.onMouseUp;if(pt(A)){var P=T.getMouseInfo(C);A(P,C)}}),et(T,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),et(T,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.handleMouseDown(C.changedTouches[0])}),et(T,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&T.handleMouseUp(C.changedTouches[0])}),et(T,"handleDoubleClick",function(C){var A=T.props.onDoubleClick;if(pt(A)){var P=T.getMouseInfo(C);A(P,C)}}),et(T,"handleContextMenu",function(C){var A=T.props.onContextMenu;if(pt(A)){var P=T.getMouseInfo(C);A(P,C)}}),et(T,"triggerSyncEvent",function(C){T.props.syncId!==void 0&&_2.emit(b2,T.props.syncId,C,T.eventEmitterSymbol)}),et(T,"applySyncEvent",function(C){var A=T.props,P=A.layout,I=A.syncMethod,k=T.state.updateId,E=C.dataStartIndex,N=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)T.setState(he({dataStartIndex:E,dataEndIndex:N},d({props:T.props,dataStartIndex:E,dataEndIndex:N,updateId:k},T.state)));else if(C.activeTooltipIndex!==void 0){var D=C.chartX,z=C.chartY,V=C.activeTooltipIndex,F=T.state,$=F.offset,B=F.tooltipTicks;if(!$)return;if(typeof I=="function")V=I(B,C);else if(I==="value"){V=-1;for(var H=0;H=0){var ue,ee;if(D.dataKey&&!D.allowDuplicatedCategory){var Ge=typeof D.dataKey=="function"?ve:"payload.".concat(D.dataKey.toString());ue=k1(H,Ge,V),ee=U&&Z&&k1(Z,Ge,V)}else ue=H==null?void 0:H[z],ee=U&&Z&&Z[z];if(de||ce){var Ae=C.props.activeIndex!==void 0?C.props.activeIndex:z;return[G.cloneElement(C,he(he(he({},I.props),ye),{},{activeIndex:Ae})),null,null]}if(!mt(ue))return[ne].concat(gv(T.renderActivePoints({item:I,activePoint:ue,basePoint:ee,childIndex:z,isRange:U})))}else{var We,Ye=(We=T.getItemByXY(T.state.activeCoordinate))!==null&&We!==void 0?We:{graphicalItem:ne},ht=Ye.graphicalItem,Rt=ht.item,Jt=Rt===void 0?C:Rt,cn=ht.childIndex,Ir=he(he(he({},I.props),ye),{},{activeIndex:cn});return[G.cloneElement(Jt,Ir),null,null]}return U?[ne,null,null]:[ne,null]}),et(T,"renderCustomized",function(C,A,P){return G.cloneElement(C,he(he({key:"recharts-customized-".concat(P)},T.props),T.state))}),et(T,"renderMap",{CartesianGrid:{handler:n_,once:!0},ReferenceArea:{handler:T.renderReferenceElement},ReferenceLine:{handler:n_},ReferenceDot:{handler:T.renderReferenceElement},XAxis:{handler:n_},YAxis:{handler:n_},Brush:{handler:T.renderBrush,once:!0},Bar:{handler:T.renderGraphicChild},Line:{handler:T.renderGraphicChild},Area:{handler:T.renderGraphicChild},Radar:{handler:T.renderGraphicChild},RadialBar:{handler:T.renderGraphicChild},Scatter:{handler:T.renderGraphicChild},Pie:{handler:T.renderGraphicChild},Funnel:{handler:T.renderGraphicChild},Tooltip:{handler:T.renderCursor,once:!0},PolarGrid:{handler:T.renderPolarGrid,once:!0},PolarAngleAxis:{handler:T.renderPolarAxis},PolarRadiusAxis:{handler:T.renderPolarAxis},Customized:{handler:T.renderCustomized}}),T.clipPathId="".concat((b=_.id)!==null&&b!==void 0?b:Yv("recharts"),"-clip"),T.throttleTriggeredAfterMouseMove=kq(T.triggeredAfterMouseMove,(S=_.throttleDelay)!==null&&S!==void 0?S:1e3/60),T.state={},T}return qNe(x,y),HNe(x,[{key:"componentDidMount",value:function(){var b,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,S=b.children,T=b.data,C=b.height,A=b.layout,P=Ni(S,ks);if(P){var I=P.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var k=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,E=wI(this.state,T,I,k),N=this.state.tooltipTicks[I].coordinate,D=(this.state.offset.top+C)/2,z=A==="horizontal",V=z?{x:N,y:D}:{y:N,x:D},F=this.state.formattedGraphicalItems.find(function(B){var H=B.item;return H.type.name==="Scatter"});F&&(V=he(he({},V),F.props.points[I].tooltipPosition),E=F.props.points[I].tooltipPayload);var $={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:k,activePayload:E,activeCoordinate:V};this.setState($),this.renderCursor(P),this.accessibilityManager.setIndex(I)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var T,C;this.accessibilityManager.setDetails({offset:{left:(T=this.props.margin.left)!==null&&T!==void 0?T:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(b){eL([Ni(b.children,ks)],[Ni(this.props.children,ks)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=Ni(this.props.children,ks);if(b&&typeof b.props.shared=="boolean"){var S=b.props.shared?"axis":"item";return s.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var S=this.container,T=S.getBoundingClientRect(),C=sSe(T),A={chartX:Math.round(b.pageX-C.left),chartY:Math.round(b.pageY-C.top)},P=T.width/S.offsetWidth||1,I=this.inRange(A.chartX,A.chartY,P);if(!I)return null;var k=this.state,E=k.xAxisMap,N=k.yAxisMap,D=this.getTooltipEventType(),z=PF(this.state,this.props.data,this.props.layout,I);if(D!=="axis"&&E&&N){var V=qh(E).scale,F=qh(N).scale,$=V&&V.invert?V.invert(A.chartX):null,B=F&&F.invert?F.invert(A.chartY):null;return he(he({},A),{},{xValue:$,yValue:B},z)}return z?he(he({},A),z):null}},{key:"inRange",value:function(b,S){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,A=b/T,P=S/T;if(C==="horizontal"||C==="vertical"){var I=this.state.offset,k=A>=I.left&&A<=I.left+I.width&&P>=I.top&&P<=I.top+I.height;return k?{x:A,y:P}:null}var E=this.state,N=E.angleAxisMap,D=E.radiusAxisMap;if(N&&D){var z=qh(N);return h$({x:A,y:P},z)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,S=this.getTooltipEventType(),T=Ni(b,ks),C={};T&&S==="axis"&&(T.props.trigger==="click"?C={onClick:this.handleClick}:C={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var A=L1(this.props,this.handleOuterEvent);return he(he({},A),C)}},{key:"addListener",value:function(){_2.on(b2,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){_2.removeListener(b2,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,S,T){for(var C=this.state.formattedGraphicalItems,A=0,P=C.length;As>=80?"#22c55e":s>=60?"#f59e0b":"#ef4444")(t),a=2*Math.PI*45,o=t/100*a;return p.jsx("div",{className:"flex flex-col items-center",children:p.jsxs("svg",{width:"140",height:"140",viewBox:"0 0 100 100",children:[p.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"#1e2a3a",strokeWidth:"8"}),p.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:i,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:a,strokeDashoffset:a-o,transform:"rotate(-90 50 50)",className:"transition-all duration-500"}),p.jsx("text",{x:"50",y:"46",textAnchor:"middle",className:"fill-slate-100 font-mono text-2xl font-bold",style:{fontSize:"24px"},children:t.toFixed(1)}),p.jsx("text",{x:"50",y:"62",textAnchor:"middle",className:"fill-slate-400 text-xs",style:{fontSize:"10px"},children:r})]})})}function i_({label:e,value:t}){const r=n=>n>=80?"bg-green-500":n>=60?"bg-amber-500":"bg-red-500";return p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"w-24 text-xs text-slate-400 truncate",children:e}),p.jsx("div",{className:"flex-1 h-2 bg-border rounded-full overflow-hidden",children:p.jsx("div",{className:`h-full ${r(t)} transition-all duration-300`,style:{width:`${t}%`}})}),p.jsx("div",{className:"w-12 text-right text-xs font-mono text-slate-300",children:t.toFixed(1)})]})}function vDe({alert:e}){const r=(i=>{switch(i.toLowerCase()){case"critical":case"emergency":case"immediate":return{bg:"bg-red-500/10",border:"border-red-500",icon:Mu,iconColor:"text-red-500"};case"warning":case"priority":return{bg:"bg-amber-500/10",border:"border-amber-500",icon:nl,iconColor:"text-amber-500"};case"routine":default:return{bg:"bg-blue-500/10",border:"border-blue-500",icon:uT,iconColor:"text-blue-500"}}})(e.severity),n=r.icon;return p.jsxs("div",{className:`p-3 rounded-lg ${r.bg} border-l-2 ${r.border} flex items-start gap-3`,children:[p.jsx(n,{size:16,className:r.iconColor}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm text-slate-200",children:e.message}),p.jsx("div",{className:"text-xs text-slate-500 mt-1",children:e.timestamp||"Just now"})]})]})}function pDe({source:e}){const t=()=>e.is_loaded?e.last_error?"bg-amber-500":"bg-green-500":"bg-red-500";return p.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-bg-hover",children:[p.jsx("div",{className:`w-2 h-2 rounded-full ${t()}`}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm text-slate-200 truncate",children:e.name}),p.jsxs("div",{className:"text-xs text-slate-500",children:[e.node_count," nodes · ",e.type]})]})]})}function a_({icon:e,label:t,value:r,subvalue:n}){return p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4",children:[p.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[p.jsx(e,{size:14}),p.jsx("span",{className:"text-xs",children:t})]}),p.jsx("div",{className:"font-mono text-xl text-slate-100",children:r}),n&&p.jsx("div",{className:"text-xs text-slate-500 mt-1",children:n})]})}function S2({label:e,value:t}){const r=()=>t===0?"bg-green-500/20 text-green-400 border-green-500/50":t<=2?"bg-amber-500/20 text-amber-400 border-amber-500/50":"bg-red-500/20 text-red-400 border-red-500/50";return p.jsxs("span",{className:`px-2 py-1 rounded text-xs font-mono font-medium border ${r()}`,children:[e,t]})}function IF({label:e,value:t,unit:r,getColor:n}){const i=t!==void 0?n(t):"text-slate-400";return p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:"text-xs text-slate-500 mb-1",children:e}),p.jsx("div",{className:`font-mono text-3xl font-bold ${i}`,children:(t==null?void 0:t.toFixed(0))??"—"}),r&&p.jsx("div",{className:"text-xs text-slate-500",children:r})]})}function gDe({history:e}){var a;const t=G.useMemo(()=>!e||e.length===0?[]:e.slice(-16).map((o,s)=>({idx:s,value:o.value,time:o.time})),[e]);if(t.length===0)return null;const r=Math.max(...t.map(o=>o.value),5),n=((a=t[t.length-1])==null?void 0:a.value)??0,i=()=>r>5?"kpGradientRed":r>3?"kpGradientAmber":"kpGradientGreen";return p.jsxs("div",{className:"h-20 w-full",children:[p.jsx(Lq,{width:"100%",height:"100%",children:p.jsxs(hDe,{data:t,margin:{top:5,right:5,bottom:5,left:5},children:[p.jsxs("defs",{children:[p.jsxs("linearGradient",{id:"kpGradientGreen",x1:"0",y1:"0",x2:"0",y2:"1",children:[p.jsx("stop",{offset:"0%",stopColor:"#22c55e",stopOpacity:.4}),p.jsx("stop",{offset:"100%",stopColor:"#22c55e",stopOpacity:.05})]}),p.jsxs("linearGradient",{id:"kpGradientAmber",x1:"0",y1:"0",x2:"0",y2:"1",children:[p.jsx("stop",{offset:"0%",stopColor:"#f59e0b",stopOpacity:.4}),p.jsx("stop",{offset:"100%",stopColor:"#f59e0b",stopOpacity:.05})]}),p.jsxs("linearGradient",{id:"kpGradientRed",x1:"0",y1:"0",x2:"0",y2:"1",children:[p.jsx("stop",{offset:"0%",stopColor:"#ef4444",stopOpacity:.4}),p.jsx("stop",{offset:"100%",stopColor:"#ef4444",stopOpacity:.05})]})]}),p.jsx(np,{domain:[0,Math.ceil(r)],hide:!0}),p.jsx(rp,{dataKey:"idx",hide:!0}),p.jsx(Dy,{y:3,stroke:"#f59e0b",strokeDasharray:"3 3",strokeOpacity:.5}),p.jsx(Dy,{y:5,stroke:"#ef4444",strokeDasharray:"3 3",strokeOpacity:.5}),p.jsx(Gu,{type:"monotone",dataKey:"value",stroke:n>5?"#ef4444":n>3?"#f59e0b":"#22c55e",fill:`url(#${i()})`,strokeWidth:2})]})}),p.jsxs("div",{className:"flex justify-between text-xs text-slate-600 px-1",children:[p.jsx("span",{children:"48h ago"}),p.jsx("span",{children:"now"})]})]})}function mDe({profile:e}){const t=G.useMemo(()=>!e||e.length===0?[]:[...e].sort((r,n)=>r.height_m-n.height_m).map(r=>({height:r.height_m,M:r.M})),[e]);return t.length===0?null:p.jsxs("div",{className:"h-24 w-full",children:[p.jsx(Lq,{width:"100%",height:"100%",children:p.jsxs(fDe,{data:t,margin:{top:5,right:10,bottom:5,left:5},children:[p.jsx(rp,{dataKey:"M",type:"number",domain:["dataMin - 20","dataMax + 20"],tick:{fontSize:10,fill:"#64748b"},tickLine:!1,axisLine:{stroke:"#334155"}}),p.jsx(np,{dataKey:"height",type:"number",domain:[0,"dataMax"],tick:{fontSize:10,fill:"#64748b"},tickLine:!1,axisLine:{stroke:"#334155"},tickFormatter:r=>`${(r/1e3).toFixed(1)}k`}),p.jsx(E0,{type:"monotone",dataKey:"M",stroke:"#3b82f6",strokeWidth:2,dot:{r:3,fill:"#3b82f6"}})]})}),p.jsx("div",{className:"text-center text-xs text-slate-600",children:"M-units vs Height (km)"})]})}function yDe({swpc:e,ducting:t}){const r=a=>a>=120?"text-green-400":a>=80?"text-amber-400":"text-red-400",n=a=>a<=3?"text-green-400":a<=5?"text-amber-400":"text-red-400",i=a=>{if(!a)return null;const o={normal:"bg-green-500/20 text-green-400 border-green-500/50",super_refraction:"bg-amber-500/20 text-amber-400 border-amber-500/50",surface_duct:"bg-blue-500/20 text-blue-400 border-blue-500/50",elevated_duct:"bg-blue-500/20 text-blue-400 border-blue-500/50"},s={normal:"Normal",super_refraction:"Super Refraction",surface_duct:"Surface Duct",elevated_duct:"Elevated Duct"};return p.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium border ${o[a]||o.normal}`,children:s[a]||a})};return p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[p.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[p.jsx(ry,{size:14}),p.jsx("span",{title:"R (Radio Blackouts), S (Solar Radiation Storms), G (Geomagnetic Storms) — NOAA SWPC scales. Kp 3 = quiet baseline, Kp >= 5 = aurora visible at mid-latitudes and HF degraded. See Reference → Solar & Geomagnetic.",children:"RF Propagation"})]}),p.jsxs("div",{className:"flex justify-around mb-4",children:[p.jsx(IF,{label:"SFI",value:e==null?void 0:e.sfi,getColor:r}),p.jsx("div",{className:"w-px bg-border"}),p.jsx(IF,{label:"Kp",value:e==null?void 0:e.kp_current,getColor:n})]}),p.jsxs("div",{className:"flex justify-center gap-2 mb-4",children:[p.jsx(S2,{label:"R",value:(e==null?void 0:e.r_scale)??0}),p.jsx(S2,{label:"S",value:(e==null?void 0:e.s_scale)??0}),p.jsx(S2,{label:"G",value:(e==null?void 0:e.g_scale)??0})]}),(e==null?void 0:e.kp_history)&&e.kp_history.length>0&&p.jsxs("div",{className:"mb-4",children:[p.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Kp Trend (48h)"}),p.jsx(gDe,{history:e.kp_history})]}),p.jsx("div",{className:"border-t border-border my-3"}),p.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[p.jsx(Pu,{size:14,className:"text-slate-400"}),p.jsx("span",{className:"text-xs text-slate-500",children:"Tropospheric"}),i(t==null?void 0:t.condition)]}),(t==null?void 0:t.min_gradient)!==void 0&&p.jsxs("div",{className:"text-xs text-slate-400 font-mono mb-2",children:["dM/dz: ",t.min_gradient.toFixed(1)," M-units/km"]}),(t==null?void 0:t.profile)&&t.profile.length>0&&p.jsx(mDe,{profile:t.profile}),(e==null?void 0:e.active_warnings)&&e.active_warnings.length>0&&p.jsxs("div",{className:"mt-auto pt-3 border-t border-border",children:[p.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"SWPC Alerts"}),p.jsx("div",{className:"flex flex-wrap gap-1",children:e.active_warnings.slice(0,3).map((a,o)=>p.jsx("span",{className:"px-2 py-0.5 rounded text-xs bg-amber-500/20 text-amber-400 border border-amber-500/30 truncate max-w-full",children:a.replace("Space Weather Message Code: ","")},o))})]})]})}const xDe={nws:{icon:Pu,color:"text-blue-400",label:"NWS"},swpc:{icon:oY,color:"text-yellow-400",label:"SWPC"},ducting:{icon:ho,color:"text-cyan-400",label:"Tropo"},nifc:{icon:lT,color:"text-orange-400",label:"NIFC"},firms:{icon:hT,color:"text-red-400",label:"FIRMS"},avalanche:{icon:cT,color:"text-slate-300",label:"Avy"},usgs:{icon:sT,color:"text-blue-300",label:"USGS"},traffic:{icon:oT,color:"text-purple-400",label:"Traffic"},roads:{icon:JZ,color:"text-amber-400",label:"511"}},OF={routine:"bg-blue-500/20 text-blue-400 border-blue-500/30",priority:"bg-amber-500/20 text-amber-400 border-amber-500/30",immediate:"bg-red-600/20 text-red-300 border-red-600/30",info:"bg-blue-500/20 text-blue-400 border-blue-500/30",advisory:"bg-blue-500/20 text-blue-400 border-blue-500/30",moderate:"bg-amber-500/20 text-amber-400 border-amber-500/30",watch:"bg-amber-500/20 text-amber-400 border-amber-500/30",warning:"bg-amber-500/20 text-amber-400 border-amber-500/30",severe:"bg-red-500/20 text-red-400 border-red-500/30",extreme:"bg-red-600/20 text-red-300 border-red-600/30",critical:"bg-red-600/20 text-red-300 border-red-600/30",emergency:"bg-red-700/20 text-red-200 border-red-700/30"};function _De({event:e,isLocal:t}){var f;const r=xDe[e.source]||{icon:uT,color:"text-slate-400",label:e.source},n=r.icon,i=OF[(f=e.severity)==null?void 0:f.toLowerCase()]||OF.info,a=h=>{const d=new Date(h*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 h=s.replace(/ County/g,"").split(";")[0];u=`${o} — ${h}`}else o&&(u=o);const c=l?l.split(". ")[0]:null;return p.jsxs("div",{className:`flex items-start gap-2 py-2 border-b border-border/50 last:border-0 ${t?"border-l-2 border-l-blue-500 pl-2 -ml-2":""}`,children:[p.jsx(n,{size:14,className:`mt-0.5 flex-shrink-0 ${r.color}`}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[p.jsx("span",{className:`px-1.5 py-0.5 rounded text-xs border ${i}`,children:e.severity||"info"}),t&&p.jsx("span",{className:"px-1.5 py-0.5 rounded text-xs bg-blue-500/20 text-blue-400 border border-blue-500/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"}),p.jsx("span",{className:"text-xs text-slate-500",children:r.label}),p.jsx("span",{className:"text-xs text-slate-600 ml-auto",children:a(e.fetched_at)})]}),p.jsx("div",{className:`text-sm truncate ${t?"text-slate-100":"text-slate-300"}`,children:u}),c&&p.jsx("div",{className:"text-xs text-slate-500 truncate mt-0.5",children:c})]})]})}function bDe({events:e,envStatus:t}){const r={immediate:0,priority:1,routine:2},n=G.useMemo(()=>{const a=new Set;return e.filter(s=>s.event_id?a.has(s.event_id)?!1:(a.add(s.event_id),!0):!0).sort((s,l)=>{var d,v;const u=s.is_local?1:0,c=l.is_local?1:0;if(u!==c)return c-u;const f=r[((d=s.severity)==null?void 0:d.toLowerCase())||"routine"]??2,h=r[((v=l.severity)==null?void 0:v.toLowerCase())||"routine"]??2;return f!==h?f-h:(l.fetched_at||0)-(s.fetched_at||0)})},[e]),i=G.useMemo(()=>{if(!(t!=null&&t.feeds))return null;const a=t.feeds.length,o=t.feeds.filter(c=>c.is_loaded&&!c.last_error).length,s=t.feeds.filter(c=>c.last_error).map(c=>c.source),l=Math.max(...t.feeds.map(c=>c.last_fetch||0)),u=l?Math.floor(Date.now()/1e3-l):null;return{total:a,active:o,errors:s,secAgo:u}},[t]);return p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-4 flex flex-col h-full",children:[p.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-3 flex items-center gap-2",children:[p.jsx(zv,{size:14}),"Live Event Feed"]}),n.length>0?p.jsx("div",{className:"flex-1 overflow-y-auto max-h-80 pr-1 -mr-1",children:n.map((a,o)=>p.jsx(_De,{event:a,isLocal:a.is_local},a.event_id||o))}):p.jsx("div",{className:"flex-1 flex items-center justify-center",children:p.jsxs("div",{className:"text-center py-8",children:[p.jsx(DN,{size:24,className:"text-green-500 mx-auto mb-2"}),p.jsx("div",{className:"text-slate-400",children:"No active events"}),p.jsx("div",{className:"text-xs text-slate-500",children:"All clear"})]})}),i&&p.jsxs("div",{className:`text-xs mt-3 pt-3 border-t border-border ${i.errors.length>0?"text-amber-400":"text-slate-500"}`,children:[i.active," of ",i.total," feeds active",i.secAgo!==null&&` · Last update ${i.secAgo}s ago`,i.errors.length>0&&p.jsxs("span",{className:"text-amber-400",children:[" · ",i.errors.join(", "),": error"]})]})]})}function wDe(){var S,T,C,A,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,f]=G.useState(null),[h,d]=G.useState(null),[v,m]=G.useState(!0),[y,x]=G.useState(null),{lastHealth:_,lastMessage:b}=FN();return G.useEffect(()=>{Promise.all([Mce(),Lce(),uY(),cY(),fY().catch(()=>[]),Oce().catch(()=>null),Ece().catch(()=>null)]).then(([I,k,E,N,D,z,V])=>{t(I),n(k),a(E),s(N),u(D),f(z),d(V),m(!1),document.title="Dashboard — MeshAI"}).catch(I=>{x(I.message),m(!1),document.title="Dashboard — MeshAI"})},[]),G.useEffect(()=>{_&&t(_)},[_]),G.useEffect(()=>{(b==null?void 0:b.type)==="env_update"&&b.event&&u(I=>{const k=b.event,E=I.filter(N=>N.event_id!==k.event_id);return[k,...E].slice(0,100)})},[b]),v?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-slate-400",children:"Loading..."})}):y?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsxs("div",{className:"text-red-400",children:["Error: ",y]})}):p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[p.jsx("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:"Mesh Health"}),e&&p.jsxs(p.Fragment,{children:[p.jsx(dDe,{health:e}),p.jsxs("div",{className:"mt-6 space-y-3",children:[p.jsx(i_,{label:"Infrastructure",value:((S=e.pillars)==null?void 0:S.infrastructure)??0}),p.jsx(i_,{label:"Utilization",value:((T=e.pillars)==null?void 0:T.utilization)??0}),p.jsx(i_,{label:"Behavior",value:((C=e.pillars)==null?void 0:C.behavior)??0}),p.jsx(i_,{label:"Power",value:((A=e.pillars)==null?void 0:A.power)??0})]})]})]}),p.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[p.jsx("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:"Active Alerts"}),i.length>0?p.jsx("div",{className:"space-y-3 max-h-48 overflow-y-auto",children:i.map((I,k)=>p.jsx(vDe,{alert:I},k))}):p.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-4",children:[p.jsx(DN,{size:16,className:"text-green-500"}),p.jsx("span",{children:"No active alerts"})]})]}),p.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[p.jsx(a_,{icon:ho,label:"Nodes Online",value:(e==null?void 0:e.total_nodes)||0,subvalue:`${(e==null?void 0:e.unlocated_count)||0} unlocated`}),p.jsx(a_,{icon:QZ,label:"Infrastructure",value:`${(e==null?void 0:e.infra_online)||0}/${(e==null?void 0:e.infra_total)||0}`,subvalue:(e==null?void 0:e.infra_online)===(e==null?void 0:e.infra_total)?"All online":"Some offline"}),p.jsx(a_,{icon:zv,label:"Utilization",value:`${((P=e==null?void 0:e.util_percent)==null?void 0:P.toFixed(1))||0}%`,subvalue:`${(e==null?void 0:e.flagged_nodes)||0} flagged`}),p.jsx(a_,{icon:$v,label:"Regions",value:(e==null?void 0:e.total_regions)||0,subvalue:`${(e==null?void 0:e.battery_warnings)||0} battery warnings`})]})]})]}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[p.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4",children:["Mesh Sources (",r.length,")"]}),r.length>0?p.jsx("div",{className:"space-y-2",children:r.map((I,k)=>p.jsx(pDe,{source:I},k))}):p.jsx("div",{className:"text-slate-500 py-4",children:"No sources configured"})]}),p.jsx(yDe,{swpc:c,ducting:h}),p.jsx(bDe,{events:l,envStatus:o})]})]})}/*! ***************************************************************************** -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 SI=function(e,t){return SI=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])},SI(e,t)};function X(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");SI(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var mm=function(){return mm=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"?ot.worker=!0:!ot.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(ot.node=!0,ot.svgSupported=!0):ADe(navigator.userAgent,ot);function ADe(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 GD=12,UK="sans-serif",sl=GD+"px "+UK,MDe=20,PDe=100,kDe="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function LDe(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(){R(r,function(c){c.parentNode&&c.parentNode.removeChild(c)})},r}function eje(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(),f=2*u,h=c.left,d=c.top;o.push(h,d),l=l&&a&&h===a[f]&&d===a[f+1],s.push(e[u].offsetLeft,e[u].offsetTop)}return l&&i?i:(t.srcCoords=o,t[n]=r?jF(s,o):jF(o,s))}function rJ(e){return e.nodeName.toUpperCase()==="CANVAS"}var tje=/([&<>"'])/g,rje={"&":"&","<":"<",">":">",'"':""","'":"'"};function Zn(e){return e==null?"":(e+"").replace(tje,function(t,r){return rje[r]})}var nje=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,C2=[],ije=ot.browser.firefox&&+ot.browser.version.split(".")[0]<39;function PI(e,t,r,n){return r=r||{},n?RF(e,t,r):ije&&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):RF(e,t,r),r}function RF(e,t,r){if(ot.domSupported&&e.getBoundingClientRect){var n=t.clientX,i=t.clientY;if(rJ(e)){var a=e.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(MI(C2,e,n,i)){r.zrX=C2[0],r.zrY=C2[1];return}}r.zrX=r.zrY=0}function XD(e){return e||window.event}function ca(e,t,r){if(t=XD(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&&PI(e,o,t,r)}else{PI(e,t,t,r);var a=aje(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&nje.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function aje(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 kI(e,t,r,n){e.addEventListener(t,r,n)}function oje(e,t,r,n){e.removeEventListener(t,r,n)}var ll=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function BF(e){return e.which===2||e.which===3}var sje=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=zF(n)/zF(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=lje(n);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}};function an(){return[1,0,0,1,0,0]}function R0(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function B0(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 so(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 po(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 xl(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),f=Math.cos(r);return e[0]=i*f+s*c,e[1]=-i*c+s*f,e[2]=a*f+l*c,e[3]=-a*c+f*l,e[4]=f*(o-n[0])+c*(u-n[1])+n[0],e[5]=f*(u-n[1])-c*(o-n[0])+n[1],e}function lC(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 Ia(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 nJ(e){var t=an();return B0(t,e),t}const uje=Object.freeze(Object.defineProperty({__proto__:null,clone:nJ,copy:B0,create:an,identity:R0,invert:Ia,mul:so,rotate:xl,scale:lC,translate:po},Symbol.toStringTag,{value:"Module"}));var De=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}(),Jc=Math.min,pd=Math.max,LI=Math.abs,$F=["x","y"],cje=["width","height"],rc=new De,nc=new De,ic=new De,ac=new De,ji=iJ(),Wg=ji.minTv,II=ji.maxTv,bm=[0,0],je=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=Jc(t.x,this.x),n=Jc(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=pd(t.x+t.width,this.x+this.width)-r:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=pd(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=an();return po(a,a,[-r.x,-r.y]),lC(a,a,[n,i]),po(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&&De.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(fje,t.x,t.y,t.width,t.height)),r instanceof e||(r=e.set(hje,r.x,r.y,r.width,r.height));var s=!!n;ji.reset(i,s);var l=ji.touchThreshold,u=t.x+l,c=t.x+t.width-l,f=t.y+l,h=t.y+t.height-l,d=r.x+l,v=r.x+r.width-l,m=r.y+l,y=r.y+r.height-l;if(u>c||f>h||d>v||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}rc.x=ic.x=r.x,rc.y=ac.y=r.y,nc.x=ac.x=r.x+r.width,nc.y=ic.y=r.y+r.height,rc.transform(n),ac.transform(n),nc.transform(n),ic.transform(n),t.x=Jc(rc.x,nc.x,ic.x,ac.x),t.y=Jc(rc.y,nc.y,ic.y,ac.y);var l=pd(rc.x,nc.x,ic.x,ac.x),u=pd(rc.y,nc.y,ic.y,ac.y);t.width=l-t.x,t.height=u-t.y},e}(),fje=new je(0,0,0,0),hje=new je(0,0,0,0);function FF(e,t,r,n,i,a,o,s){var l=LI(t-r),u=LI(n-e),c=Jc(l,u),f=$F[i],h=$F[1-i],d=cje[i];t=u||!ji.bidirectional)&&(Wg[f]=-u,Wg[h]=0,ji.useDir&&ji.calcDirMTV())))}function iJ(){var e=0,t=new De,r=new De,n={minTv:new De,maxTv:new De,useDir:!1,dirMinTv:new De,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,o){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=pd(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;f--){var h=a[f];h!==i&&!h.ignore&&!h.ignoreCoarsePointer&&(!h.parent||!h.parent.ignoreCoarsePointer)&&(M2.copy(h.getBoundingRect()),h.transform&&M2.applyTransform(h.transform),M2.intersect(c)&&s.push(h))}if(s.length)for(var d=4,v=Math.PI/12,m=Math.PI*2,y=0;y4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function mje(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?aJ:!0}return!1}function VF(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=mje(o,r,n))&&(!t.topTarget&&(t.topTarget=o),s!==aJ)){t.target=o;break}}}function sJ(e,t,r){var n=e.painter;return t<0||t>n.getWidth()||r<0||r>n.getHeight()}var lJ=32,sg=7;function yje(e){for(var t=0;e>=lJ;)t|=e&1,e>>=1;return e+t}function GF(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 xje(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 P2(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 k2(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 _je(e,t){var r=sg,n,i,a=0,o=[];n=[],i=[];function s(d,v){n[a]=d,i[a]=v,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]=sg||A>=sg);if(P)break;T<0&&(T=0),T+=2}if(r=T,r<1&&(r=1),v===1){for(x=0;x=0;x--)e[C+x]=e[T+x];e[S]=o[b];return}for(var A=r;;){var P=0,I=0,k=!1;do if(t(o[b],e[_])<0){if(e[S--]=e[_--],P++,I=0,--v===0){k=!0;break}}else if(e[S--]=o[b--],I++,P=0,--y===1){k=!0;break}while((P|I)=0;x--)e[C+x]=e[T+x];if(v===0){k=!0;break}}if(e[S--]=o[b--],--y===1){k=!0;break}if(I=y-P2(e[_],o,0,y,y-1,t),I!==0){for(S-=I,b-=I,y-=I,C=S+1,T=b+1,x=0;x=sg||I>=sg);if(k)break;A<0&&(A=0),A+=2}if(r=A,r<1&&(r=1),y===1){for(S-=v,_-=v,C=S+1,T=_+1,x=v-1;x>=0;x--)e[C+x]=e[T+x];e[S]=o[b]}else{if(y===0)throw new Error;for(T=S-(y-1),x=0;xs&&(l=s),WF(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 Bi=1,Hg=2,Xh=4,HF=!1;function L2(){HF||(HF=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function UF(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var bje=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=UF}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}(),jw;jw=ot.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var wm={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-wm.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?wm.bounceIn(e*2)*.5:wm.bounceOut(e*2-1)*.5+.5}},s_=Math.pow,gu=Math.sqrt,Rw=1e-8,uJ=1e-4,ZF=gu(3),l_=1/3,Ro=Hu(),ga=Hu(),Nd=Hu();function Ql(e){return e>-Rw&&eRw||e<-Rw}function en(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 YF(e,t,r,n,i){var a=1-i;return 3*(((t-e)*a+2*(r-t)*i)*a+(n-r)*i*i)}function Bw(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,f=s*l-9*o*u,h=l*l-3*s*u,d=0;if(Ql(c)&&Ql(f))if(Ql(s))a[0]=0;else{var v=-l/s;v>=0&&v<=1&&(a[d++]=v)}else{var m=f*f-4*c*h;if(Ql(m)){var y=f/c,v=-s/o+y,x=-y/2;v>=0&&v<=1&&(a[d++]=v),x>=0&&x<=1&&(a[d++]=x)}else if(m>0){var _=gu(m),b=c*s+1.5*o*(-f+_),S=c*s+1.5*o*(-f-_);b<0?b=-s_(-b,l_):b=s_(b,l_),S<0?S=-s_(-S,l_):S=s_(S,l_);var v=(-s-(b+S))/(3*o);v>=0&&v<=1&&(a[d++]=v)}else{var T=(2*c*s-3*o*f)/(2*gu(c*c*c)),C=Math.acos(T)/3,A=gu(c),P=Math.cos(C),v=(-s-2*A*P)/(3*o),x=(-s+A*(P+ZF*Math.sin(C)))/(3*o),I=(-s+A*(P-ZF*Math.sin(C)))/(3*o);v>=0&&v<=1&&(a[d++]=v),x>=0&&x<=1&&(a[d++]=x),I>=0&&I<=1&&(a[d++]=I)}}return d}function fJ(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(Ql(o)){if(cJ(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*o*s;if(Ql(c))i[0]=-a/(2*o);else if(c>0){var f=gu(c),u=(-a+f)/(2*o),h=(-a-f)/(2*o);u>=0&&u<=1&&(i[l++]=u),h>=0&&h<=1&&(i[l++]=h)}}return l}function ku(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,f=(c-u)*i+u;a[0]=e,a[1]=o,a[2]=u,a[3]=f,a[4]=f,a[5]=c,a[6]=l,a[7]=n}function hJ(e,t,r,n,i,a,o,s,l,u,c){var f,h=.005,d=1/0,v,m,y,x;Ro[0]=l,Ro[1]=u;for(var _=0;_<1;_+=.05)ga[0]=en(e,r,i,o,_),ga[1]=en(t,n,a,s,_),y=pu(Ro,ga),y=0&&y=0&&u<=1&&(i[l++]=u)}}else{var c=o*o-4*a*s;if(Ql(c)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(c>0){var f=gu(c),u=(-o+f)/(2*a),h=(-o-f)/(2*a);u>=0&&u<=1&&(i[l++]=u),h>=0&&h<=1&&(i[l++]=h)}}return l}function dJ(e,t,r){var n=e+r-2*t;return n===0?.5:(e-t)/n}function Fy(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 vJ(e,t,r,n,i,a,o,s,l){var u,c=.005,f=1/0;Ro[0]=o,Ro[1]=s;for(var h=0;h<1;h+=.05){ga[0]=gn(e,r,i,h),ga[1]=gn(t,n,a,h);var d=pu(Ro,ga);d=0&&d=1?1:Bw(0,n,a,1,l,s)&&en(0,i,o,1,s[0])}}}var Aje=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||yr,this.ondestroy=t.ondestroy||yr,this.onrestart=t.onrestart||yr,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=Pe(t)?t:wm[t]||KD(t)},e}(),pJ=function(){function e(t){this.value=t}return e}(),Mje=function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new pJ(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}(),yv=function(){function e(t){this._list=new Mje,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 pJ(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}(),qF={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 lo(e){return e=Math.round(e),e<0?0:e>255?255:e}function Pje(e){return e=Math.round(e),e<0?0:e>360?360:e}function Vy(e){return e<0?0:e>1?1:e}function Db(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?lo(parseFloat(t)/100*255):lo(parseInt(t,10))}function Zs(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?Vy(parseFloat(t)/100):Vy(parseFloat(t))}function I2(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 eu(e,t,r){return e+(t-e)*r}function ua(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}function EI(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var gJ=new yv(20),u_=null;function Sh(e,t){u_&&EI(u_,t),u_=gJ.put(e,u_||t.slice())}function Yn(e,t){if(e){t=t||[];var r=gJ.get(e);if(r)return EI(t,r);e=e+"";var n=e.replace(/ /g,"").toLowerCase();if(n in qF)return EI(t,qF[n]),Sh(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)){ua(t,0,0,0,1);return}return ua(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),Sh(e,t),t}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){ua(t,0,0,0,1);return}return ua(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),Sh(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?ua(t,+u[0],+u[1],+u[2],1):ua(t,0,0,0,1);c=Zs(u.pop());case"rgb":if(u.length>=3)return ua(t,Db(u[0]),Db(u[1]),Db(u[2]),u.length===3?c:Zs(u[3])),Sh(e,t),t;ua(t,0,0,0,1);return;case"hsla":if(u.length!==4){ua(t,0,0,0,1);return}return u[3]=Zs(u[3]),NI(u,t),Sh(e,t),t;case"hsl":if(u.length!==3){ua(t,0,0,0,1);return}return NI(u,t),Sh(e,t),t;default:return}}ua(t,0,0,0,1)}}function NI(e,t){var r=(parseFloat(e[0])%360+360)%360/360,n=Zs(e[1]),i=Zs(e[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return t=t||[],ua(t,lo(I2(o,a,r+1/3)*255),lo(I2(o,a,r)*255),lo(I2(o,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function kje(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,f=((a-r)/6+o/2)/o,h=((a-n)/6+o/2)/o;t===a?l=h-f:r===a?l=1/3+c-h:n===a&&(l=2/3+f-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 zw(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 Ca(r,r.length===4?"rgba":"rgb")}}function Lje(e){var t=Yn(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function Sm(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]=lo(eu(o[0],s[0],l)),r[1]=lo(eu(o[1],s[1],l)),r[2]=lo(eu(o[2],s[2],l)),r[3]=Vy(eu(o[3],s[3],l)),r}}var Ije=Sm;function JD(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=Ca([lo(eu(o[0],s[0],l)),lo(eu(o[1],s[1],l)),lo(eu(o[2],s[2],l)),Vy(eu(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}var Oje=JD;function Ys(e,t,r,n){var i=Yn(e);if(e)return i=kje(i),t!=null&&(i[0]=Pje(Pe(t)?t(i[0]):t)),r!=null&&(i[1]=Zs(Pe(r)?r(i[1]):r)),n!=null&&(i[2]=Zs(Pe(n)?n(i[2]):n)),Ca(NI(i),"rgba")}function Gy(e,t){var r=Yn(e);if(r&&t!=null)return r[3]=Vy(t),Ca(r,"rgba")}function Ca(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 Wy(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 Eje(){return Ca([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var XF=new yv(100);function $w(e){if(me(e)){var t=XF.get(e);return t||(t=zw(e,-.1),XF.put(e,t)),t}else if(N0(e)){var r=ie({},e);return r.colorStops=le(e.colorStops,function(n){return{offset:n.offset,color:zw(n.color,-.1)}}),r}return e}const Nje=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:Sm,fastMapToColor:Ije,lerp:JD,lift:zw,liftColor:$w,lum:Wy,mapToColor:Oje,modifyAlpha:Gy,modifyHSL:Ys,parse:Yn,parseCssFloat:Zs,parseCssInt:Db,random:Eje,stringify:Ca,toHex:Lje},Symbol.toStringTag,{value:"Module"}));var Fw=Math.round;function Hy(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 KF=1e-4;function tu(e){return e-KF}function c_(e){return Fw(e*1e3)/1e3}function DI(e){return Fw(e*1e4)/1e4}function Dje(e){return"matrix("+c_(e[0])+","+c_(e[1])+","+c_(e[2])+","+c_(e[3])+","+DI(e[4])+","+DI(e[5])+")"}var jje={left:"start",right:"end",center:"middle",middle:"middle"};function Rje(e,t,r){return r==="top"?e+=t/2:r==="bottom"&&(e-=t/2),e}function Bje(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function zje(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 mJ(e){return e&&!!e.image}function $je(e){return e&&!!e.svgElement}function QD(e){return mJ(e)||$je(e)}function yJ(e){return e.type==="linear"}function xJ(e){return e.type==="radial"}function _J(e){return e&&(e.type==="linear"||e.type==="radial")}function uC(e){return"url(#"+e+")"}function bJ(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 wJ(e){var t=e.x||0,r=e.y||0,n=(e.rotation||0)*ym,i=Ce(e.scaleX,1),a=Ce(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("+Fw(o*ym)+"deg, "+Fw(s*ym)+"deg)"),l.join(" ")}var Fje=function(){return ot.hasGlobalWindow&&Pe(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}}(),jI=Array.prototype.slice;function Ls(e,t,r){return(t-e)*r+e}function O2(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=QF,l=r;if(En(r)){var u=Hje(r);s=u,(u===1&&!ut(r[0])||u===2&&!ut(r[0][0]))&&(o=!0)}else if(ut(r)&&!In(r))s=h_;else if(me(r))if(!isNaN(+r))s=h_;else{var c=Yn(r);c&&(l=c,s=Ug)}else if(N0(r)){var f=ie({},l);f.colorStops=le(r.colorStops,function(d){return{offset:d.offset,color:Yn(d.color)}}),yJ(r)?s=RI:xJ(r)&&(s=BI),l=f}a===0?this.valType=s:(s!==this.valType||s===QF)&&(o=!0),this.discrete=this.discrete||o;var h={time:t,value:l,rawValue:r,percent:0};return n&&(h.easing=n,h.easingFunc=Pe(n)?n:wm[n]||KD(n)),i.push(h),h},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=d_(i),u=eV(i),c=0;c=0&&!(o[c].percent<=r);c--);c=h(c,s-2)}else{for(c=f;cr);c++);c=h(c-1,s-2)}v=o[c+1],d=o[c]}if(d&&v){this._lastFr=c,this._lastFrP=r;var y=v.percent-d.percent,x=y===0?1:h((r-d.percent)/y,1);v.easingFunc&&(x=v.easingFunc(x));var _=n?this._additiveValue:u?lg:t[l];if((d_(a)||u)&&!_&&(_=this._additiveValue=[]),this.discrete)t[l]=x<1?d.rawValue:v.rawValue;else if(d_(a))a===Rb?O2(_,d[i],v[i],x):Vje(_,d[i],v[i],x);else if(eV(a)){var b=d[i],S=v[i],T=a===RI;t[l]={type:T?"linear":"radial",x:Ls(b.x,S.x,x),y:Ls(b.y,S.y,x),colorStops:le(b.colorStops,function(A,P){var I=S.colorStops[P];return{offset:Ls(A.offset,I.offset,x),color:jb(O2([],A.color,I.color,x))}}),global:S.global},T?(t[l].x2=Ls(b.x2,S.x2,x),t[l].y2=Ls(b.y2,S.y2,x)):t[l].r=Ls(b.r,S.r,x)}else if(u)O2(_,d[i],v[i],x),n||(t[l]=jb(_));else{var C=Ls(d[i],v[i],x);n?this._additiveValue=C:t[l]=C}n&&this._addToTarget(t)}}},e.prototype._addToTarget=function(t){var r=this.valType,n=this.propName,i=this._additiveValue;r===h_?t[n]=t[n]+i:r===Ug?(Yn(t[n],lg),f_(lg,lg,i,1),t[n]=jb(lg)):r===Rb?f_(t[n],t[n],i,1):r===SJ&&JF(t[n],t[n],i,1)},e}(),ej=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){iC("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,st(r),n)},e.prototype.whenWithKeys=function(t,r,n,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,Tm(u),i),this._trackKeys.push(s)}l.addKeyframe(t,Tm(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 gd(){return new Date().getTime()}var Zje=function(e){X(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=gd()-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&&(jw(n),!r._paused&&r.update())}jw(n)},t.prototype.start=function(){this._running||(this._time=gd(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=gd(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=gd()-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 ej(r,n.loop);return this.addAnimator(i),i},t}(ja),Yje=300,E2=ot.domSupported,N2=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=le(e,function(i){var a=i.replace("mouse","pointer");return r.hasOwnProperty(a)?a:i});return{mouse:e,touch:t,pointer:n}}(),tV={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},rV=!1;function zI(e){var t=e.pointerType;return t==="pen"||t==="touch"}function qje(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 D2(e){e&&(e.zrByTouch=!0)}function Xje(e,t){return ca(e.dom,new Kje(e,t),!0)}function TJ(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 Kje=function(){function e(t,r){this.stopPropagation=yr,this.stopImmediatePropagation=yr,this.preventDefault=yr,this.type=r.type,this.target=this.currentTarget=t.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return e}(),Ua={mousedown:function(e){e=ca(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=ca(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=ca(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){e=ca(this.dom,e);var t=e.toElement||e.relatedTarget;TJ(this,t)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){rV=!0,e=ca(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){rV||(e=ca(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){e=ca(this.dom,e),D2(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),Ua.mousemove.call(this,e),Ua.mousedown.call(this,e)},touchmove:function(e){e=ca(this.dom,e),D2(e),this.handler.processGesture(e,"change"),Ua.mousemove.call(this,e)},touchend:function(e){e=ca(this.dom,e),D2(e),this.handler.processGesture(e,"end"),Ua.mouseup.call(this,e),+new Date-+this.__lastTouchMomentaV||e<-aV}var sc=[],Th=[],R2=an(),B2=Math.abs,Fs=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 oc(this.rotation)||oc(this.x)||oc(this.y)||oc(this.scaleX-1)||oc(this.scaleY-1)||oc(this.skewX)||oc(this.skewY)},e.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||t)){n&&(iV(n),this.invTransform=null);return}n=n||an(),r?this.getLocalTransform(n):iV(n),t&&(r?so(n,t,n):B0(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)},e.prototype._resolveGlobalScaleRatio=function(t){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(sc);var n=sc[0]<0?-1:1,i=sc[1]<0?-1:1,a=((sc[0]-n)*r+n)/sc[0]||0,o=((sc[1]-i)*r+i)/sc[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||an(),Ia(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||an(),so(Th,t.invTransform,r),r=Th);var n=this.originX,i=this.originY;(n||i)&&(R2[4]=n,R2[5]=i,so(Th,r,R2),Th[4]-=n,Th[5]-=i,r=Th),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&&xr(n,n,i),n},e.prototype.transformCoordToGlobal=function(t,r){var n=[t,r],i=this.transform;return i&&xr(n,n,i),n},e.prototype.getLineScale=function(){var t=this.transform;return t&&B2(t[0]-1)>1e-10&&B2(t[3]-1)>1e-10?Math.sqrt(B2(t[0]*t[3]-t[2]*t[1])):1},e.prototype.copyTransform=function(t){Gw(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,f=t.y,h=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||s||l){var v=n+s,m=i+l;r[4]=-v*a-h*m*o,r[5]=-m*o-d*v*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=d*a,r[2]=h*o,u&&xl(r,r,u),r[4]+=n+c,r[5]+=i+f,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}(),is=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Gw(e,t){for(var r=0;r=oV)){e=e||sl;for(var t=[],r=+new Date,n=0;n<=127;n++)t[n]=Si.measureText(String.fromCharCode(n),e).width;var i=+new Date-r;return i>16?z2=oV:i>2&&z2++,t}}var z2=0,oV=5;function AJ(e,t){return e.asciiWidthMapTried||(e.asciiWidthMap=rRe(e.font),e.asciiWidthMapTried=!0),0<=t&&t<=127?e.asciiWidthMap!=null?e.asciiWidthMap[t]:e.asciiCharWidth:e.stWideCharWidth}function Qo(e,t){var r=e.strWidthCache,n=r.get(t);return n==null&&(n=Si.measureText(t,e.font).width,r.put(t,n)),n}function sV(e,t,r,n){var i=Qo(Jo(t),e),a=z0(t),o=xv(0,i,r),s=ff(0,a,n),l=new je(o,s,i,a);return l}function cC(e,t,r,n){var i=((e||"")+"").split(` -`),a=i.length;if(a===1)return sV(i[0],t,r,n);for(var o=new je(0,0,0,0),s=0;s=0?parseFloat(e)/100*t:parseFloat(e):e}function Ww(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",f="top";if(n instanceof Array)l+=go(n[0],r.width),u+=go(n[1],r.height),c=null,f=null;else switch(n){case"left":l-=i,u+=s,c="right",f="middle";break;case"right":l+=i+o,u+=s,f="middle";break;case"top":l+=o/2,u-=i,c="center",f="bottom";break;case"bottom":l+=o/2,u+=a+i,c="center";break;case"inside":l+=o/2,u+=s,c="center",f="middle";break;case"insideLeft":l+=i,u+=s,f="middle";break;case"insideRight":l+=o-i,u+=s,c="right",f="middle";break;case"insideTop":l+=o/2,u+=i,c="center";break;case"insideBottom":l+=o/2,u+=a-i,c="center",f="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,f="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,c="right",f="bottom";break}return e=e||{},e.x=l,e.y=u,e.align=c,e.verticalAlign=f,e}var $2="__zr_normal__",F2=is.concat(["ignore"]),nRe=La(is,function(e,t){return e[t]=!0,e},{ignore:!1}),Ch={},iRe=new je(0,0,0,0),p_=[],fC=function(){function e(t){this.id=UD(),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,f=n.autoOverflowArea,h=void 0;if((f||c)&&(h=iRe,n.layoutRect?h.copy(n.layoutRect):h.copy(this.getBoundingRect()),i||h.applyTransform(this.transform)),c){this.calculateTextPosition?this.calculateTextPosition(Ch,n,h):Ww(Ch,n,h),a.x=Ch.x,a.y=Ch.y,o=Ch.align,s=Ch.verticalAlign;var d=n.origin;if(d&&n.rotation!=null){var v=void 0,m=void 0;d==="center"?(v=h.width*.5,m=h.height*.5):(v=go(d[0],h.width),m=go(d[1],h.height)),u=!0,a.originX=-a.x+v+(i?0:h.x),a.originY=-a.y+m+(i?0:h.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(f){var _=x.overflowRect=x.overflowRect||new je(0,0,0,0);a.getLocalTransform(p_),Ia(p_,p_),je.copy(_,h),_.applyTransform(p_)}else x.overflowRect=null;var b=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,S=void 0,T=void 0,C=void 0;b&&this.canBeInsideText()?(S=n.insideFill,T=n.insideStroke,(S==null||S==="auto")&&(S=this.getInsideTextFill()),(T==null||T==="auto")&&(T=this.getInsideTextStroke(S),C=!0)):(S=n.outsideFill,T=n.outsideStroke,(S==null||S==="auto")&&(S=this.getOutsideFill()),(T==null||T==="auto")&&(T=this.getOutsideStroke(S),C=!0)),S=S||"#000",(S!==x.fill||T!==x.stroke||C!==x.autoStroke||o!==x.align||s!==x.verticalAlign)&&(l=!0,x.fill=S,x.stroke=T,x.autoStroke=C,x.align=o,x.verticalAlign=s,r.setDefaultTextStyle(x)),r.__dirty|=Bi,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()?GI:VI},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,Ca(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||{},ie(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(Ee(t))for(var n=t,i=st(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($2,!1,t)},e.prototype.useState=function(t,r,n,i){var a=t===$2,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(Ze(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){iC("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 f=this._textContent,h=this._textGuide;return f&&f.useState(t,r,n,c),h&&h.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&=~Bi),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,v);var m=this._textContent,y=this._textGuide;m&&m.useStates(t,r,h),y&&y.useStates(t,r,h),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Bi)}},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=Ze(i,t),o=Ze(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(v,m){r.during(m)});for(var h=0;h0||i.force&&!o.length){var P=void 0,I=void 0,k=void 0;if(s){I={},h&&(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=Ze(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=Ze(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 ge=yRe;function yRe(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 Hw(e,t,r)}function Hw(e,t,r){return me(e)?mRe(e).match(/%$/)?parseFloat(e)/100*t+(r||0):parseFloat(e):e==null?NaN:+e}function Mr(e,t,r){return t==null&&(t=10),t=Math.min(Math.max(0,t),IJ),e=(+e).toFixed(t),r?e:+e}function Vi(e){return e.sort(function(t,r){return t-r}),e}function no(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 OJ(e)}function OJ(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 tj(e,t){var r=Math.log,n=Math.LN10,i=Math.floor(r(e[1]-e[0])/n),a=Math.round(r(Vo(t[1]-t[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function xRe(e,t,r){if(!e[t])return 0;var n=EJ(e,r);return n[t]||0}function EJ(e,t){var r=La(e,function(d,v){return d+(isNaN(v)?0:v)},0);if(r===0)return[];for(var n=Math.pow(10,t),i=le(e,function(d){return(isNaN(d)?0:d)/r*n*100}),a=n*100,o=le(i,function(d){return Math.floor(d)}),s=La(o,function(d,v){return d+v},0),l=le(i,function(d,v){return d-o[v]});su&&(u=l[f],c=f);++o[c],l[c]=0,++s}return le(o,function(d){return d/n})}function _Re(e,t){var r=Math.max(no(e),no(t)),n=e+t;return r>IJ?n:Mr(n,r)}var UI=9007199254740991;function rj(e){var t=Math.PI*2;return(e%t+t)%t}function _v(e){return e>-lV&&e=10&&t++,t}function nj(e,t){var r=hC(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 $b(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 ZI(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 W2(e){e.option=e.parentModel=e.ecModel=null}var $Re=".",lc="___EC__COMPONENT__CONTAINER___",WJ="___EC__EXTENDED_CLASS___";function Go(e){var t={main:"",sub:""};if(e){var r=e.split($Re);t.main=r[0]||"",t.sub=r[1]||""}return t}function FRe(e){Nn(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}function VRe(e){return!!(e&&e[WJ])}function sj(e,t){e.$constructor=e,e.extend=function(r){var n=this,i;return GRe(n)?i=function(a){X(o,a);function o(){return a.apply(this,arguments)||this}return o}(n):(i=function(){(r.$constructor||n).apply(this,arguments)},ZD(i,this)),ie(i.prototype,r),i[WJ]=!0,i.extend=this.extend,i.superCall=URe,i.superApply=ZRe,i.superClass=n,i}}function GRe(e){return Pe(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function HJ(e,t){e.extend=t.extend}var WRe=Math.round(Math.random()*10);function HRe(e){var t=["__\0is_clz",WRe++].join("_");e.prototype[t]=!0,e.isInstance=function(r){return!!(r&&r[t])}}function URe(e,t){for(var r=[],n=2;n=0||a&&Ze(a,l)<0)){var u=n.getShallow(l,t);u!=null&&(o[e[s][0]]=u)}}return o}}var YRe=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],qRe=Of(YRe),XRe=function(){function e(){}return e.prototype.getAreaStyle=function(t,r){return qRe(this,t,r)},e}(),qI=new yv(50);function KRe(e){if(typeof e=="string"){var t=qI.get(e);return t&&t.image}else return e}function lj(e,t,r,n,i){if(e)if(typeof e=="string"){if(t&&t.__zrImageSrc===e||!r)return t;var a=qI.get(e),o={hostEl:r,cb:n,cbPayload:i};return a?(t=a.image,!vC(t)&&a.pending.push(o)):(t=Si.loadImage(e,hV,hV),t.__zrImageSrc=e,qI.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}else return e;else return t}function hV(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=s;u++)l-=s;var c=Qo(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 YJ(e,t,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){e.textLine="",e.isTruncated=!1;return}var o=Qo(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?QRe(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,l),o=Qo(a,t)}t===""&&(t=r.placeholder),e.textLine=t,e.isTruncated=!0}function QRe(e,t,r){for(var n=0,i=0,a=e.length;iy&&d){var b=Math.floor(y/h);v=v||x.length>b,x=x.slice(0,b),_=x.length*h}if(i&&c&&m!=null)for(var S=ZJ(m,u,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),T={},C=0;Cv&&U2(a,o.substring(v,y),t,d),U2(a,m[2],t,d,m[1]),v=H2.lastIndex}vf){var H=a.lines.length;N>0?(I.tokens=I.tokens.slice(0,N),A(I,E,k),a.lines=a.lines.slice(0,P+1)):a.lines=a.lines.slice(0,P),a.isTruncated=a.isTruncated||a.lines.length0&&v+n.accumWidth>n.width&&(c=t.split(` -`),u=!0),n.accumWidth=v}else{var m=qJ(t,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=m.accumWidth+d,f=m.linesWidths,c=m.lines}}c||(c=t.split(` -`));for(var y=Jo(l),x=0;x=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var a3e=La(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function o3e(e){return i3e(e)?!!a3e[e]:!0}function qJ(e,t,r,n,i){for(var a=[],o=[],s="",l="",u=0,c=0,f=Jo(t),h=0;hr:i+c+v>r){c?(s||l)&&(m?(s||(s=l,l="",u=0,c=u),a.push(s),o.push(c-u),l+=d,u+=v,s="",c=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(c),s=d,c=v)):m?(a.push(l),o.push(u),l=d,u=v):(a.push(d),o.push(v));continue}c+=v,m?(l+=d,u+=v):(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 vV(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;je.set(pV,xv(r,o,i),ff(n,s,a),o,s),je.intersect(t,pV,null,gV);var l=gV.outIntersectRect;e.outerWidth=l.width,e.outerHeight=l.height,e.baseX=xv(l.x,l.width,i,!0),e.baseY=ff(l.y,l.height,a,!0)}}var pV=new je(0,0,0,0),gV={outIntersectRect:{},clamp:!0};function uj(e){return e!=null?e+="":e=""}function s3e(e){var t=uj(e.text),r=e.font,n=Qo(Jo(r),t),i=z0(r);return XI(e,n,i,null)}function XI(e,t,r,n){var i=new je(xv(e.x||0,t,e.textAlign),ff(e.y||0,r,e.textBaseline),t,r),a=n??(XJ(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function XJ(e){var t=e.stroke;return t!=null&&t!=="none"&&e.lineWidth>0}var KI="__zr_style_"+Math.round(Math.random()*10),hf={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},pC={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};hf[KI]=!0;var mV=["z","z2","invisible"],l3e=["invisible"],Oa=function(e){X(t,e);function t(r){return e.call(this,r)||this}return t.prototype._init=function(r){for(var n=st(r),i=0;i1e-4){s[0]=e-r,s[1]=t-n,l[0]=e+r,l[1]=t+n;return}if(g_[0]=X2(i)*r+e,g_[1]=q2(i)*n+t,m_[0]=X2(a)*r+e,m_[1]=q2(a)*n+t,u(s,g_,m_),c(l,g_,m_),i=i%uc,i<0&&(i=i+uc),a=a%uc,a<0&&(a=a+uc),i>a&&!o?a+=uc:ii&&(y_[0]=X2(d)*r+e,y_[1]=q2(d)*n+t,u(s,y_,s),c(l,y_,l))}var zt={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},cc=[],fc=[],Co=[],Al=[],Ao=[],Mo=[],K2=Math.min,J2=Math.max,hc=Math.cos,dc=Math.sin,Ss=Math.abs,JI=Math.PI,Rl=JI*2,Q2=typeof Float32Array<"u",ug=[];function eM(e){var t=Math.round(e/JI*1e8)/1e8;return t%2*JI}function mC(e,t){var r=eM(e[0]);r<0&&(r+=Rl);var n=r-e[0],i=e[1];i+=n,!t&&i-r>=Rl?i=r+Rl:t&&r-i>=Rl?i=r-Rl:!t&&r>i?i=r+(Rl-eM(r-i)):t&&r0&&(this._ux=Ss(n/Vw/t)||0,this._uy=Ss(n/Vw/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(zt.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=Ss(t-this._xi),i=Ss(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(zt.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(zt.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(zt.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(),ug[0]=i,ug[1]=a,mC(ug,o),i=ug[0],a=ug[1];var s=a-i;return this.addData(zt.A,t,r,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(t,r,n,i,a,o),this._xi=hc(a)*n+t,this._yi=dc(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(zt.R,t,r,n,i),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(zt.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)&&Q2&&(this.data=new Float32Array(r));for(var n=0;n0&&o))for(var s=0;sc.length&&(this._expandData(),c=this.data);for(var f=0;f0&&(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(){Co[0]=Co[1]=Ao[0]=Ao[1]=Number.MAX_VALUE,Al[0]=Al[1]=Mo[0]=Mo[1]=-Number.MAX_VALUE;var t=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||Ss(b)>i||h===r-1)&&(m=Math.sqrt(_*_+b*b),a=y,o=x);break}case zt.C:{var S=t[h++],T=t[h++],y=t[h++],x=t[h++],C=t[h++],A=t[h++];m=wje(a,o,S,T,y,x,C,A,10),a=C,o=A;break}case zt.Q:{var S=t[h++],T=t[h++],y=t[h++],x=t[h++];m=Tje(a,o,S,T,y,x,10),a=y,o=x;break}case zt.A:var P=t[h++],I=t[h++],k=t[h++],E=t[h++],N=t[h++],D=t[h++],z=D+N;h+=1,v&&(s=hc(N)*k+P,l=dc(N)*E+I),m=J2(k,E)*K2(Rl,Math.abs(D)),a=hc(z)*k+P,o=dc(z)*E+I;break;case zt.R:{s=a=t[h++],l=o=t[h++];var V=t[h++],F=t[h++];m=V*2+F*2;break}case zt.Z:{var _=s-a,b=l-o;m=Math.sqrt(_*_+b*b),a=s,o=l;break}}m>=0&&(u[f++]=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,f,h,d=r<1,v,m,y=0,x=0,_,b=0,S,T;if(!(d&&(this._pathSegLen||this._calculateLength(),v=this._pathSegLen,m=this._pathLen,_=r*m,!_)))e:for(var C=0;C0&&(t.lineTo(S,T),b=0),A){case zt.M:s=u=n[C++],l=c=n[C++],t.moveTo(u,c);break;case zt.L:{f=n[C++],h=n[C++];var I=Ss(f-u),k=Ss(h-c);if(I>i||k>a){if(d){var E=v[x++];if(y+E>_){var N=(_-y)/E;t.lineTo(u*(1-N)+f*N,c*(1-N)+h*N);break e}y+=E}t.lineTo(f,h),u=f,c=h,b=0}else{var D=I*I+k*k;D>b&&(S=f,T=h,b=D)}break}case zt.C:{var z=n[C++],V=n[C++],F=n[C++],$=n[C++],B=n[C++],H=n[C++];if(d){var E=v[x++];if(y+E>_){var N=(_-y)/E;ku(u,z,F,B,N,cc),ku(c,V,$,H,N,fc),t.bezierCurveTo(cc[1],fc[1],cc[2],fc[2],cc[3],fc[3]);break e}y+=E}t.bezierCurveTo(z,V,F,$,B,H),u=B,c=H;break}case zt.Q:{var z=n[C++],V=n[C++],F=n[C++],$=n[C++];if(d){var E=v[x++];if(y+E>_){var N=(_-y)/E;Fy(u,z,F,N,cc),Fy(c,V,$,N,fc),t.quadraticCurveTo(cc[1],fc[1],cc[2],fc[2]);break e}y+=E}t.quadraticCurveTo(z,V,F,$),u=F,c=$;break}case zt.A:var U=n[C++],Z=n[C++],Y=n[C++],K=n[C++],te=n[C++],ce=n[C++],de=n[C++],Ie=!n[C++],ye=Y>K?Y:K,ne=Ss(Y-K)>.001,ve=te+ce,ue=!1;if(d){var E=v[x++];y+E>_&&(ve=te+ce*(_-y)/E,ue=!0),y+=E}if(ne&&t.ellipse?t.ellipse(U,Z,Y,K,de,te,ve,Ie):t.arc(U,Z,ye,te,ve,Ie),ue)break e;P&&(s=hc(te)*Y+U,l=dc(te)*K+Z),u=hc(ve)*Y+U,c=dc(ve)*K+Z;break;case zt.R:s=u=n[C],l=c=n[C+1],f=n[C++],h=n[C++];var ee=n[C++],Ge=n[C++];if(d){var E=v[x++];if(y+E>_){var Ae=_-y;t.moveTo(f,h),t.lineTo(f+K2(Ae,ee),h),Ae-=ee,Ae>0&&t.lineTo(f+ee,h+K2(Ae,Ge)),Ae-=Ge,Ae>0&&t.lineTo(f+J2(ee-Ae,0),h+Ge),Ae-=ee,Ae>0&&t.lineTo(f,h+J2(Ge-Ae,0));break e}y+=E}t.rect(f,h,ee,Ge);break;case zt.Z:if(d){var E=v[x++];if(y+E>_){var N=(_-y)/E;t.lineTo(u*(1-N)+s*N,c*(1-N)+l*N);break e}y+=E}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=zt,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),e}();function Vl(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+f&&c>n+f&&c>a+f&&c>s+f||ce+f&&u>r+f&&u>i+f&&u>o+f||ut+u&&l>n+u&&l>a+u||le+u&&s>r+u&&s>i+u||sr||c+ui&&(i+=cg);var h=Math.atan2(l,s);return h<0&&(h+=cg),h>=n&&h<=i||h+cg>=n&&h+cg<=i}function Is(e,t,r,n,i,a){if(a>t&&a>n||ai?s:0}var Ml=os.CMD,vc=Math.PI*2,p3e=1e-4;function g3e(e,t){return Math.abs(e-t)t&&u>n&&u>a&&u>s||u1&&m3e(),d=en(t,n,a,s,ha[0]),h>1&&(v=en(t,n,a,s,ha[1]))),h===2?yt&&s>n&&s>a||s=0&&u<=1){for(var c=0,f=gn(t,n,a,u),h=0;hr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);ei[0]=-l,ei[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=vc-1e-4){n=0,i=vc;var c=a?1:-1;return o>=ei[0]+e&&o<=ei[1]+e?c:0}if(n>i){var f=n;n=i,i=f}n<0&&(n+=vc,i+=vc);for(var h=0,d=0;d<2;d++){var v=ei[d];if(v+e>o){var m=Math.atan2(s,v),c=a?1:-1;m<0&&(m=vc+m),(m>=n&&m<=i||m+vc>=n&&m+vc<=i)&&(m>Math.PI/2&&m1&&(r||(s+=Is(l,u,c,f,n,i))),y&&(l=a[v],u=a[v+1],c=l,f=u),m){case Ml.M:c=a[v++],f=a[v++],l=c,u=f;break;case Ml.L:if(r){if(Vl(l,u,a[v],a[v+1],t,n,i))return!0}else s+=Is(l,u,a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case Ml.C:if(r){if(d3e(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],t,n,i))return!0}else s+=y3e(l,u,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case Ml.Q:if(r){if(KJ(l,u,a[v++],a[v++],a[v],a[v+1],t,n,i))return!0}else s+=x3e(l,u,a[v++],a[v++],a[v],a[v+1],n,i)||0;l=a[v++],u=a[v++];break;case Ml.A:var x=a[v++],_=a[v++],b=a[v++],S=a[v++],T=a[v++],C=a[v++];v+=1;var A=!!(1-a[v++]);h=Math.cos(T)*b+x,d=Math.sin(T)*S+_,y?(c=h,f=d):s+=Is(l,u,h,d,n,i);var P=(n-x)*S/b+x;if(r){if(v3e(x,_,S,T,T+C,A,t,P,i))return!0}else s+=_3e(x,_,S,T,T+C,A,P,i);l=Math.cos(T+C)*b+x,u=Math.sin(T+C)*S+_;break;case Ml.R:c=l=a[v++],f=u=a[v++];var I=a[v++],k=a[v++];if(h=c+I,d=f+k,r){if(Vl(c,f,h,f,t,n,i)||Vl(h,f,h,d,t,n,i)||Vl(h,d,c,d,t,n,i)||Vl(c,d,c,f,t,n,i))return!0}else s+=Is(h,f,h,d,n,i),s+=Is(c,d,c,f,n,i);break;case Ml.Z:if(r){if(Vl(l,u,c,f,t,n,i))return!0}else s+=Is(l,u,c,f,n,i);l=c,u=f;break}}return!r&&!g3e(u,f)&&(s+=Is(l,u,c,f,n,i)||0),s!==0}function b3e(e,t,r){return JJ(e,0,!1,t,r)}function w3e(e,t,r,n){return JJ(e,t,!0,r,n)}var Uw=Oe({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},hf),S3e={style:Oe({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},pC.style)},tM=is.concat(["invisible","culling","z","z2","zlevel","parent"]),at=function(e){X(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?VI:n>.2?tRe:GI}else if(r)return GI}return VI},t.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(me(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=Wy(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&Xh)&&(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)),w3e(s,l/u,r,n)))return!0}if(this.hasFill())return b3e(s,r,n)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=Xh,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:ie(i,r),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&Xh)},t.prototype.createStyle=function(r){return j0(Uw,r)},t.prototype._innerSaveToNormal=function(r){e.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=ie({},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=ie({},i.shape),ie(u,n.shape)):(u=ie({},a?this.shape:i.shape),ie(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=ie({},this.shape);for(var c={},f=st(u),h=0;hi&&(f=s+l,s*=i/f,l*=i/f),u+c>i&&(f=u+c,u*=i/f,c*=i/f),l+u>a&&(f=l+u,l*=a/f,u*=a/f),s+c>a&&(f=s+c,s*=a/f,c*=a/f),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 md=Math.round;function yC(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&&(md(n*2)===md(i*2)&&(e.x1=e.x2=Wi(n,s,!0)),md(a*2)===md(o*2)&&(e.y1=e.y2=Wi(a,s,!0))),e}}function QJ(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=Wi(n,s,!0),e.y=Wi(i,s,!0),e.width=Math.max(Wi(n+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(Wi(i+o,s,!1)-e.y,o===0?0:1)),e}}function Wi(e,t,r){if(!t)return e;var n=md(e*2);return(n+md(t))%2===0?n/2:(n+(r?1:-1))/2}var k3e=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),L3e={},Qe=function(e){X(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new k3e},t.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=QJ(L3e,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?P3e(r,n):r.rect(i,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(at);Qe.prototype.type="rect";var wV={fill:"#000"},SV=2,Po={},I3e={style:Oe({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},pC.style)},lt=function(e){X(t,e);function t(r){var n=e.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=wV,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,N=0;N=0&&(z=C[D],z.align==="right");)this._placeToken(z,r,P,x,N,"right",b),I-=z.width,N-=z.width,D--;for(E+=(c-(E-y)-(_-N)-I)/2;k<=D;)z=C[k],this._placeToken(z,r,P,x,E+z.width/2,"center",b),E+=z.width,k++;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,f=a+i/2;c==="top"?f=a+r.height/2:c==="bottom"&&(f=a+i-r.height/2);var h=!r.isLineHolder&&rM(u);h&&this._renderBackground(u,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,f-r.height/2,r.width,r.height);var d=!!u.backgroundColor,v=r.textPadding;v&&(o=kV(o,s,v),f-=r.height/2-v[0]-r.innerHeight/2);var m=this._getOrCreateChild(bv),y=m.createStyle();m.useStyle(y);var x=this._defaultStyle,_=!1,b=0,S=!1,T=PV("fill"in u?u.fill:"fill"in n?n.fill:(_=!0,x.fill)),C=MV("stroke"in u?u.stroke:"stroke"in n?n.stroke:!d&&!l&&(!x.autoStroke||_)?(b=SV,S=!0,x.stroke):null),A=u.textShadowBlur>0||n.textShadowBlur>0;y.text=r.text,y.x=o,y.y=f,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||sl,y.opacity=wi(u.opacity,n.opacity,1),CV(y,u),C&&(y.lineWidth=wi(u.lineWidth,n.lineWidth,b),y.lineDash=Ce(u.lineDash,n.lineDash),y.lineDashOffset=n.lineDashOffset||0,y.stroke=C),T&&(y.fill=T),m.setBoundingRect(XI(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,f=l&&l.image,h=l&&!f,d=r.borderRadius,v=this,m,y;if(h||r.lineHeight||u&&c){m=this._getOrCreateChild(Qe),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(h){var _=m.style;_.fill=l||null,_.fillOpacity=Ce(r.fillOpacity,1)}else if(f){y=this._getOrCreateChild(un),y.onload=function(){v.dirtyStyle()};var b=y.style;b.image=l.image,b.x=i,b.y=a,b.width=o,b.height=s}if(u&&c){var _=m.style;_.lineWidth=u,_.stroke=c,_.strokeOpacity=Ce(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=wi(r.opacity,n.opacity,1)},t.makeFont=function(r){var n="";return tQ(r)&&(n=[r.fontStyle,r.fontWeight,eQ(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Fi(n)||r.textFont||r.font},t}(Oa),O3e={left:!0,right:1,center:1},E3e={top:1,bottom:1,middle:1},TV=["fontStyle","fontWeight","fontSize","fontFamily"];function eQ(e){return typeof e=="string"&&(e.indexOf("px")!==-1||e.indexOf("rem")!==-1||e.indexOf("em")!==-1)?e:isNaN(+e)?GD+"px":e+"px"}function CV(e,t){for(var r=0;r=0,a=!1;if(e instanceof at){var o=rQ(e),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(Ah(s)||Ah(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=ie({},n),u=ie({},u),u.fill=s):!Ah(u.fill)&&Ah(s)?(a=!0,n=ie({},n),u=ie({},u),u.fill=$w(s)):!Ah(u.stroke)&&Ah(l)&&(a||(n=ie({},n),u=ie({},u)),u.stroke=$w(l)),n.style=u}}if(n&&n.z2==null){a||(n=ie({},n));var c=e.z2EmphasisLift;n.z2=e.z2+(c??sp)}return n}function $3e(e,t,r){if(r&&r.z2==null){r=ie({},r);var n=e.z2SelectLift;r.z2=e.z2+(n??D3e)}return r}function F3e(e,t,r){var n=Ze(e.currentStates,t)>=0,i=e.style.opacity,a=n?null:B3e(e,["opacity"],t,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=ie({},r),o=ie({opacity:n?i:a.opacity*.1},o),r.style=o),r}function nM(e,t){var r=this.states[e];if(this.style){if(e==="emphasis")return z3e(this,e,t,r);if(e==="blur")return F3e(this,e,r);if(e==="select")return $3e(this,e,r)}return r}function Ef(e){e.stateProxy=nM;var t=e.getTextContent(),r=e.getTextGuideLine();t&&(t.stateProxy=nM),r&&(r.stateProxy=nM)}function NV(e,t){!uQ(e,t)&&!e.__highByOuter&&_l(e,nQ)}function DV(e,t){!uQ(e,t)&&!e.__highByOuter&&_l(e,iQ)}function ul(e,t){e.__highByOuter|=1<<(t||0),_l(e,nQ)}function cl(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&_l(e,iQ)}function oQ(e){_l(e,dj)}function vj(e){_l(e,aQ)}function sQ(e){_l(e,j3e)}function lQ(e){_l(e,R3e)}function uQ(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function cQ(e){var t=e.getModel(),r=[],n=[];t.eachComponent(function(i,a){var o=cj(a),s=i==="series",l=s?e.getViewOfSeriesModel(a):e.getViewOfComponentModel(a);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(u){aQ(u)}),s&&r.push(a)),o.isBlured=!1}),R(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,t)})}function tO(e,t,r,n){var i=n.getModel();r=r||"coordinateSystem";function a(u,c){for(var f=0;f0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),t.push(s)}})}),t}function yu(e,t,r){ef(e,!0),_l(e,Ef),nO(e,t,r)}function Z3e(e){ef(e,!1)}function Kt(e,t,r,n){n?Z3e(e):yu(e,t,r)}function nO(e,t,r){var n=Be(e);t!=null?(n.focus=t,n.blurScope=r):n.focus&&(n.focus=null)}var RV=["emphasis","blur","select"],Y3e={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Yr(e,t,r,n){r=r||"itemStyle";for(var i=0;i1&&(o*=iM(v),s*=iM(v));var m=(i===a?-1:1)*iM((o*o*(s*s)-o*o*(d*d)-s*s*(h*h))/(o*o*(d*d)+s*s*(h*h)))||0,y=m*o*d/s,x=m*-s*h/o,_=(e+r)/2+__(f)*y-x_(f)*x,b=(t+n)/2+x_(f)*y+__(f)*x,S=FV([1,0],[(h-y)/o,(d-x)/s]),T=[(h-y)/o,(d-x)/s],C=[(-1*h-y)/o,(-1*d-x)/s],A=FV(T,C);if(aO(T,C)<=-1&&(A=fg),aO(T,C)>=1&&(A=0),A<0){var P=Math.round(A/fg*1e6)/1e6;A=fg*2+P%2*fg}c.addData(u,_,b,o,s,S,A,f,a)}var e5e=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,t5e=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function r5e(e){var t=new os;if(!e)return t;var r=0,n=0,i=r,a=n,o,s=os.CMD,l=e.match(e5e);if(!l)return t;for(var u=0;uz*z+V*V&&(P=k,I=E),{cx:P,cy:I,x0:-c,y0:-f,x1:P*(i/T-1),y1:I*(i/T-1)}}function u5e(e){var t;if(oe(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 c5e(e,t){var r,n=Zg(t.r,0),i=Zg(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,f=t.cy,h=!!t.clockwise,d=GV(u-l),v=d>aM&&d%aM;if(v>Ha&&(d=v),!(n>Ha))e.moveTo(c,f);else if(d>aM-Ha)e.moveTo(c+n*Ph(l),f+n*pc(l)),e.arc(c,f,n,l,u,!h),i>Ha&&(e.moveTo(c+i*Ph(u),f+i*pc(u)),e.arc(c,f,i,u,l,h));else{var m=void 0,y=void 0,x=void 0,_=void 0,b=void 0,S=void 0,T=void 0,C=void 0,A=void 0,P=void 0,I=void 0,k=void 0,E=void 0,N=void 0,D=void 0,z=void 0,V=n*Ph(l),F=n*pc(l),$=i*Ph(u),B=i*pc(u),H=d>Ha;if(H){var U=t.cornerRadius;U&&(r=u5e(U),m=r[0],y=r[1],x=r[2],_=r[3]);var Z=GV(n-i)/2;if(b=ko(Z,x),S=ko(Z,_),T=ko(Z,m),C=ko(Z,y),I=A=Zg(b,S),k=P=Zg(T,C),(A>Ha||P>Ha)&&(E=n*Ph(u),N=n*pc(u),D=i*Ph(l),z=i*pc(l),dHa){var ne=ko(x,I),ve=ko(_,I),ue=b_(D,z,V,F,n,ne,h),ee=b_(E,N,$,B,n,ve,h);e.moveTo(c+ue.cx+ue.x0,f+ue.cy+ue.y0),I0&&e.arc(c+ue.cx,f+ue.cy,ne,$n(ue.y0,ue.x0),$n(ue.y1,ue.x1),!h),e.arc(c,f,n,$n(ue.cy+ue.y1,ue.cx+ue.x1),$n(ee.cy+ee.y1,ee.cx+ee.x1),!h),ve>0&&e.arc(c+ee.cx,f+ee.cy,ve,$n(ee.y1,ee.x1),$n(ee.y0,ee.x0),!h))}else e.moveTo(c+V,f+F),e.arc(c,f,n,l,u,!h);if(!(i>Ha)||!H)e.lineTo(c+$,f+B);else if(k>Ha){var ne=ko(m,k),ve=ko(y,k),ue=b_($,B,E,N,i,-ve,h),ee=b_(V,F,D,z,i,-ne,h);e.lineTo(c+ue.cx+ue.x0,f+ue.cy+ue.y0),k0&&e.arc(c+ue.cx,f+ue.cy,ve,$n(ue.y0,ue.x0),$n(ue.y1,ue.x1),!h),e.arc(c,f,i,$n(ue.cy+ue.y1,ue.cx+ue.x1),$n(ee.cy+ee.y1,ee.cx+ee.x1),h),ne>0&&e.arc(c+ee.cx,f+ee.cy,ne,$n(ee.y1,ee.x1),$n(ee.y0,ee.x0),!h))}else e.lineTo(c+$,f+B),e.arc(c,f,i,u,l,h)}e.closePath()}}}var f5e=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}(),Dn=function(e){X(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new f5e},t.prototype.buildPath=function(r,n){c5e(r,n)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(at);Dn.prototype.type="sector";var h5e=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),lp=function(e){X(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new h5e},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}(at);lp.prototype.type="ring";function d5e(e,t,r,n){var i=[],a=[],o=[],s=[],l,u,c,f;if(n){c=[1/0,1/0],f=[-1/0,-1/0];for(var h=0,d=e.length;h=2){if(n){var a=d5e(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,f=i.length;smc[1]){if(a=!1,dn.negativeSize||n)return a;var l=w_(mc[0]-gc[1]),u=w_(gc[0]-mc[1]);oM(l,u)>T_.len()&&(l=u||!dn.bidirectional)&&(De.scale(S_,s,-u*i),dn.useDir&&dn.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 f=c.duration,h=c.delay,d=c.easing,v={duration:f,delay:h||0,easing:d,done:a,force:!!a||!!o,setToFinal:!u,scope:e,during:o};s?t.animateFrom(r,v):t.animateTo(r,v)}else t.stopAnimation(),!s&&t.attr(r),o&&o(1),a&&a()}function ft(e,t,r,n,i,a){yj("update",e,t,r,n,i,a)}function Gt(e,t,r,n,i,a){yj("enter",e,t,r,n,i,a)}function jd(e){if(!e.__zr)return!0;for(var t=0;tVo(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function UV(e){return!e.isGroup}function C5e(e){return e.shape!=null}function W0(e,t,r){if(!e||!t)return;function n(o){var s={};return o.traverse(function(l){UV(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return C5e(o)&&(s.shape=ke(o.shape)),s}var a=n(e);t.traverse(function(o){if(UV(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),ft(o,l,r,Be(o).dataIndex)}}})}function bj(e,t){return le(e,function(r){var n=r[0];n=Ar(n,t.x),n=Ui(n,t.x+t.width);var i=r[1];return i=Ar(i,t.y),i=Ui(i,t.y+t.height),[n,i]})}function CQ(e,t){var r=Ar(e.x,t.x),n=Ui(e.x+e.width,t.x+t.width),i=Ar(e.y,t.y),a=Ui(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 fp(e,t,r){var n=ie({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),Oe(i,r),new un(n)):wv(e.replace("path://",""),n,r,"center")}function Yg(e,t,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var y=sM(d,v,c,f)/h;return!(y<0||y>1)}function sM(e,t,r,n){return e*n-r*t}function A5e(e){return e<=1e-6&&e>=-1e-6}function Nf(e,t,r,n,i){return t==null||(ut(t)?er[0]=er[1]=er[2]=er[3]=t:(er[0]=t[0],er[1]=t[1],er[2]=t[2],er[3]=t[3]),n&&(er[0]=Ar(0,er[0]),er[1]=Ar(0,er[1]),er[2]=Ar(0,er[2]),er[3]=Ar(0,er[3])),r&&(er[0]=-er[0],er[1]=-er[1],er[2]=-er[2],er[3]=-er[3]),ZV(e,er,"x","width",3,1,i&&i[0]||0),ZV(e,er,"y","height",0,2,i&&i[1]||0)),e}var er=[0,0,0,0];function ZV(e,t,r,n,i,a,o){var s=t[a]+t[i],l=e[n];e[n]+=s,o=Ar(0,Ui(o,l)),e[n]=0?-t[i]:t[a]>=0?l+t[a]:Vo(s)>1e-8?(l-o)*t[i]/s:0):e[r]-=t[i]}function bl(e){var t=e.itemTooltipOption,r=e.componentModel,n=e.itemName,i=me(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&&R(st(l),function(c){we(s,c)||(s[c]=l[c],s.$vars.push(c))});var u=Be(e.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:n,option:Oe({content:n,encodeHTMLContent:!0,formatterParams:s},i)}}function sO(e,t){var r;e.isGroup&&(r=t(e)),r||e.traverse(t)}function Uu(e,t){if(e)if(oe(e))for(var r=0;rt&&(t=o),ot&&(r=t=0),{min:r,max:t}}function wC(e,t,r){PQ(e,t,r,-1/0)}function PQ(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 Zu(e,t){return qe(qe({},e,!0),t,!0)}const B5e={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:". "}}}},z5e={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 Kw="ZH",Cj="EN",Rd=Cj,Gb={},Aj={},NQ=ot.domSupported?function(){var e=(document.documentElement.lang||navigator.language||navigator.browserLanguage||Rd).toUpperCase();return e.indexOf(Kw)>-1?Kw:Rd}():Rd;function Mj(e,t){e=e.toUpperCase(),Aj[e]=new it(t),Gb[e]=t}function $5e(e){if(me(e)){var t=Gb[e.toUpperCase()]||{};return e===Kw||e===Cj?ke(t):qe(ke(t),ke(Gb[Rd]),!1)}else return qe(ke(e),ke(Gb[Rd]),!1)}function uO(e){return Aj[e]}function F5e(){return Aj[Rd]}Mj(Cj,B5e);Mj(Kw,z5e);var cO=null;function V5e(e){cO||(cO=e)}function Rr(){return cO}var Pj=1e3,kj=Pj*60,Mm=kj*60,ya=Mm*24,JV=ya*365,G5e={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})/},Wb={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},W5e="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",A_="{yyyy}-{MM}-{dd}",QV={year:"{yyyy}",month:"{yyyy}-{MM}",day:A_,hour:A_+" "+Wb.hour,minute:A_+" "+Wb.minute,second:A_+" "+Wb.second,millisecond:W5e},Di=["year","month","day","hour","minute","second","millisecond"],H5e=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function U5e(e){return!me(e)&&!Pe(e)?Z5e(e):e}function Z5e(e){e=e||{};var t={},r=!0;return R(Di,function(n){r&&(r=e[n]==null)}),R(Di,function(n,i){var a=e[n];t[n]={};for(var o=null,s=i;s>=0;s--){var l=Di[s],u=Ee(a)&&!oe(a)?a[l]:a,c=void 0;oe(u)?(c=u.slice(),o=c[0]||""):me(u)?(o=u,c=[o]):(o==null?o=Wb[n]:G5e[l].test(o)||(o=t[l][l][0]+" "+o),c=[o],r&&(c[1]="{primary|"+o+"}")),t[n][l]=c}}),t}function ti(e,t){return e+="","0000".substr(0,t-e.length)+e}function Pm(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 Y5e(e){return e===Pm(e)}function q5e(e){switch(e){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function H0(e,t,r,n){var i=hs(e),a=i[DQ(r)](),o=i[Lj(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[Ij(r)](),u=i["get"+(r?"UTC":"")+"Day"](),c=i[Oj(r)](),f=(c-1)%12+1,h=i[Ej(r)](),d=i[Nj(r)](),v=i[Dj(r)](),m=c>=12?"pm":"am",y=m.toUpperCase(),x=n instanceof it?n:uO(n||NQ)||F5e(),_=x.getModel("time"),b=_.get("month"),S=_.get("monthAbbr"),T=_.get("dayOfWeek"),C=_.get("dayOfWeekAbbr");return(t||"").replace(/{a}/g,m+"").replace(/{A}/g,y+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,ti(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,b[o-1]).replace(/{MMM}/g,S[o-1]).replace(/{MM}/g,ti(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,ti(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,T[u]).replace(/{ee}/g,C[u]).replace(/{e}/g,u+"").replace(/{HH}/g,ti(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,ti(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,ti(h,2)).replace(/{m}/g,h+"").replace(/{ss}/g,ti(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,ti(v,3)).replace(/{S}/g,v+"")}function X5e(e,t,r,n,i){var a=null;if(me(r))a=r;else if(Pe(r)){var o={time:e.time,level:e.time.level},s=Rr();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=xd(e.value,i);a=r[c][c][0]}}return H0(new Date(e.value),a,i,n)}function xd(e,t){var r=hs(e),n=r[Lj(t)]()+1,i=r[Ij(t)](),a=r[Oj(t)](),o=r[Ej(t)](),s=r[Nj(t)](),l=r[Dj(t)](),u=l===0,c=u&&s===0,f=c&&o===0,h=f&&a===0,d=h&&i===1,v=d&&n===1;return v?"year":d?"month":h?"day":f?"hour":c?"minute":u?"second":"millisecond"}function Jw(e,t,r){switch(t){case"year":e[jQ(r)](0);case"month":e[RQ(r)](1);case"day":e[BQ(r)](0);case"hour":e[zQ(r)](0);case"minute":e[$Q(r)](0);case"second":e[FQ(r)](0)}return e}function DQ(e){return e?"getUTCFullYear":"getFullYear"}function Lj(e){return e?"getUTCMonth":"getMonth"}function Ij(e){return e?"getUTCDate":"getDate"}function Oj(e){return e?"getUTCHours":"getHours"}function Ej(e){return e?"getUTCMinutes":"getMinutes"}function Nj(e){return e?"getUTCSeconds":"getSeconds"}function Dj(e){return e?"getUTCMilliseconds":"getMilliseconds"}function K5e(e){return e?"setUTCFullYear":"setFullYear"}function jQ(e){return e?"setUTCMonth":"setMonth"}function RQ(e){return e?"setUTCDate":"setDate"}function BQ(e){return e?"setUTCHours":"setHours"}function zQ(e){return e?"setUTCMinutes":"setMinutes"}function $Q(e){return e?"setUTCSeconds":"setSeconds"}function FQ(e){return e?"setUTCMilliseconds":"setMilliseconds"}function J5e(e,t,r,n,i,a,o,s){var l=new lt({style:{text:e,font:t,align:r,verticalAlign:n,padding:i,rich:a,overflow:o?"truncate":null,lineHeight:s}});return l.getBoundingRect()}function jj(e){if(!ij(e))return me(e)?e:"-";var t=(e+"").split(".");return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function Rj(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 vp=D0;function fO(e,t,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(c){return c&&Fi(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?hs(e):e;if(isNaN(+l)){if(s)return"-"}else return H0(l,n,r)}if(t==="ordinal")return Ow(e)?i(e):ut(e)&&a(e)?e+"":"-";var u=as(e);return a(u)?jj(u):Ow(e)?i(e):typeof e=="boolean"?e+"":"-"}var e6=["a","b","c","d","e","f","g"],cM=function(e,t){return"{"+e+(t??"")+"}"};function Bj(e,t,r){oe(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 eBe(e,t,r){(e==="week"||e==="month"||e==="quarter"||e==="half-year"||e==="year")&&(e=`MM-dd -yyyy`);var n=hs(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"](),f=n[i+"Milliseconds"]();return e=e.replace("MM",ti(o,2)).replace("M",o).replace("yyyy",a).replace("yy",ti(a%100+"",2)).replace("dd",ti(s,2)).replace("d",s).replace("hh",ti(l,2)).replace("h",l).replace("mm",ti(u,2)).replace("m",u).replace("ss",ti(c,2)).replace("s",c).replace("SSS",ti(f,3)),e}function tBe(e){return e&&e.charAt(0).toUpperCase()+e.substr(1)}function jf(e,t){return t=t||"transparent",me(e)?e:Ee(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function Qw(e,t){if(t==="_blank"||t==="blank"){var r=window.open();r.opener=null,r.location.href=e}else window.open(e,t)}var Hb={},fM={},pp=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(t,r){this._nonSeriesBoxMasterList=n(Hb),this._normalMasterList=n(fM);function n(i,a){var o=[];return R(i,function(s,l){var u=s.create(t,r);o=o.concat(u||[])}),o}},e.prototype.update=function(t,r){R(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"){Hb[t]=r;return}fM[t]=r},e.get=function(t){return fM[t]||Hb[t]},e}();function rBe(e){return!!Hb[e]}var hO={coord:1,coord2:2};function nBe(e){GQ.set(e.fullType,{getCoord2:void 0}).getCoord2=e.getCoord2}var GQ=Se();function iBe(e){var t=e.getShallow("coord",!0),r=hO.coord;if(t==null){var n=GQ.get(e.type);n&&n.getCoord2&&(r=hO.coord2,t=n.getCoord2(e))}return{coord:t,from:r}}var Bo={none:0,dataCoordSys:1,boxCoordSys:2};function WQ(e,t){var r=e.getShallow("coordinateSystem"),n=e.getShallow("coordinateSystemUsage",!0),i=Bo.none;if(r){var a=e.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=Bo.dataCoordSys,a||(i=Bo.none)):n==="box"&&(i=Bo.boxCoordSys,!a&&!rBe(r)&&(i=Bo.none))}return{coordSysType:r,kind:i}}function U0(e){var t=e.targetModel,r=e.coordSysType,n=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=WQ(t),o=a.kind,s=a.coordSysType;if(i&&o!==Bo.dataCoordSys&&(o=Bo.dataCoordSys,s=r),o===Bo.none||s!==r)return!1;var l=n(r,t);return l?(o===Bo.dataCoordSys?t.coordinateSystem=l:t.boxCoordinateSystem=l,!0):!1}var HQ=function(e,t){var r=t.getReferringComponents(e,ur).models[0];return r&&r.coordinateSystem},Ub=R,UQ=["left","right","top","bottom","width","height"],tf=[["width","left","right"],["height","top","bottom"]];function zj(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(),f=t.childAt(u+1),h=f&&f.getBoundingRect(),d,v;if(e==="horizontal"){var m=c.width+(h?-h.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+(h?-h.y+c.y:0);v=o+y,v>i||l.newline?(a+=s+r,o=0,v=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=v+r)})}var vf=zj;Ue(zj,"vertical");Ue(zj,"horizontal");function ZQ(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 aBe(e,t){var r=Xr(e,t,{enableLayoutOnlyByCenter:!0}),n=e.getBoxLayoutParams(),i,a;if(r.type===qg.point)a=r.refPoint,i=Zt(n,{width:t.getWidth(),height:t.getHeight()});else{var o=e.get("center"),s=oe(o)?o:[o,o];i=Zt(n,r.refContainer),a=r.boxCoordFrom===hO.coord2?r.refPoint:[ge(s[0],i.width)+i.x,ge(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function YQ(e,t){var r=aBe(e,t),n=r.viewRect,i=r.center,a=e.get("radius");oe(a)||(a=[0,a]);var o=ge(n.width,t.getWidth()),s=ge(n.height,t.getHeight()),l=Math.min(o,s),u=ge(a[0],l/2),c=ge(a[1],l/2);return{cx:i[0],cy:i[1],r0:u,r:c,viewRect:n}}function Zt(e,t,r){r=vp(r||0);var n=t.width,i=t.height,a=ge(e.left,n),o=ge(e.top,i),s=ge(e.right,n),l=ge(e.bottom,i),u=ge(e.width,n),c=ge(e.height,i),f=r[2]+r[0],h=r[1]+r[3],d=e.aspect;switch(isNaN(u)&&(u=n-s-h-a),isNaN(c)&&(c=i-l-f-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-h),isNaN(o)&&(o=i-l-c-f),e.left||e.right){case"center":a=n/2-u/2-r[3];break;case"right":a=n-u-h;break}switch(e.top||e.bottom){case"middle":case"center":o=i/2-c/2-r[0];break;case"bottom":o=i-c-f;break}a=a||0,o=o||0,isNaN(u)&&(u=n-h-a-(s||0)),isNaN(c)&&(c=i-f-o-(l||0));var v=new je((t.x||0)+a+r[3],(t.y||0)+o+r[0],u,c);return v.margin=r,v}function qQ(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 f;for(var y=0;y=0;l--)s=qe(s,i[l],!0);n.defaultOption=s}return n.defaultOption},t.prototype.getReferringComponents=function(r,n){var i=r+"Index",a=r+"Id";return op(this.ecModel,r,{index:this.get(i,!0),id:this.get(a,!0)},n)},t.prototype.getBoxLayoutParams=function(){return ZQ(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}(it);HJ(tt,it);dC(tt);j5e(tt);R5e(tt,lBe);function lBe(e){var t=[];return R(tt.getClassesByMainType(e),function(r){t=t.concat(r.dependencies||r.prototype.dependencies||[])}),t=le(t,function(r){return Go(r).main}),e!=="dataset"&&Ze(t,"dataset")<=0&&t.unshift("dataset"),t}var J={color:{},darkColor:{},size:{}},wr=J.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)"};ie(wr,{primary:wr.neutral80,secondary:wr.neutral70,tertiary:wr.neutral60,quaternary:wr.neutral50,disabled:wr.neutral20,border:wr.neutral30,borderTint:wr.neutral20,borderShade:wr.neutral40,background:wr.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:wr.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:wr.neutral70,axisLineTint:wr.neutral40,axisTick:wr.neutral70,axisTickMinor:wr.neutral60,axisLabel:wr.neutral70,axisSplitLine:wr.neutral15,axisMinorSplitLine:wr.neutral05});for(var yc in wr)if(wr.hasOwnProperty(yc)){var t6=wr[yc];yc==="theme"?J.darkColor.theme=wr.theme.slice():yc==="highlight"?J.darkColor.highlight="rgba(255,231,130,0.4)":yc.indexOf("accent")===0?J.darkColor[yc]=Ys(t6,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):J.darkColor[yc]=Ys(t6,null,function(e){return e*.9},function(e){return 1-Math.pow(e,1.5)})}J.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var KQ="";typeof navigator<"u"&&(KQ=navigator.platform||"");var kh="rgba(0, 0, 0, 0.2)",JQ=J.color.theme[0],uBe=Ys(JQ,null,null,.9);const cBe={darkMode:"auto",colorBy:"series",color:J.color.theme,gradientColor:[uBe,JQ],aria:{decal:{decals:[{color:kh,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:kh,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:kh,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:kh,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:kh,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:kh,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:KQ.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 QQ=Se(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Ki="original",_n="arrayRows",Ji="objectRows",xo="keyedColumns",_u="typedArray",eee="unknown",co="column",Qf="row",An={Must:1,Might:2,Not:3},tee=rt();function fBe(e){tee(e).datasetMap=Se()}function ree(e,t,r){var n={},i=Fj(t);if(!i||!e)return n;var a=[],o=[],s=t.ecModel,l=tee(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,c,f;e=e.slice(),R(e,function(m,y){var x=Ee(m)?m:e[y]={name:m};x.type==="ordinal"&&c==null&&(c=y,f=v(x)),n[x.name]=[]});var h=l.get(u)||l.set(u,{categoryWayDim:f,valueWayDim:0});R(e,function(m,y){var x=m.name,_=v(m);if(c==null){var b=h.valueWayDim;d(n[x],b,_),d(o,b,_),h.valueWayDim+=_}else if(c===y)d(n[x],0,_),d(a,0,_);else{var b=h.categoryWayDim;d(n[x],b,_),d(o,b,_),h.categoryWayDim+=_}});function d(m,y,x){for(var _=0;_t)return e[n];return e[r-1]}function aee(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:gBe(n,o);if(c=c||r,!(!c||!c.length)){var f=c[l];return i&&(u[i]=f),s.paletteIdx=(l+1)%c.length,f}}function mBe(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var M_,hg,n6,i6="\0_ec_inner",yBe=1,Gj=function(e){X(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 it(a),this._locale=new it(o),this._optionManager=s},t.prototype.setOption=function(r,n,i){var a=s6(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},t.prototype.resetOption=function(r,n){return this._resetOption(r,s6(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"?n6(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&&R(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=Se(),u=n&&n.replaceMergeMainTypeMap;fBe(this),R(r,function(f,h){f!=null&&(tt.hasClass(h)?h&&(s.push(h),l.set(h,!0)):i[h]=i[h]==null?ke(f):qe(i[h],f,!0))}),u&&u.each(function(f,h){tt.hasClass(h)&&!l.get(h)&&(s.push(h),l.set(h,!0))}),tt.topologicalTravel(s,tt.getAllClassMainTypes(),c,this);function c(f){var h=vBe(this,f,Dt(r[f])),d=a.get(f),v=d?u&&u.get(f)?"replaceMerge":"normalMerge":"replaceAll",m=$J(d,h,v);ERe(m,f,tt),i[f]=null,a.set(f,null),o.set(f,0);var y=[],x=[],_=0,b;R(m,function(S,T){var C=S.existing,A=S.newOption;if(!A)C&&(C.mergeOption({},this),C.optionUpdated({},!1));else{var P=f==="series",I=tt.getClass(f,S.keyInfo.subType,!P);if(!I)return;if(f==="tooltip"){if(b)return;b=!0}if(C&&C.constructor===I)C.name=S.keyInfo.name,C.mergeOption(A,this),C.optionUpdated(A,!1);else{var k=ie({componentIndex:T},S.keyInfo);C=new I(A,this,this,k),ie(C,k),S.brandNew&&(C.__requireNewView=!0),C.init(A,this,this),C.optionUpdated(null,!0)}}C?(y.push(C.option),x.push(C),_++):(y.push(void 0),x.push(void 0))},this),i[f]=y,a.set(f,x),o.set(f,_),f==="series"&&M_(this)}this._seriesIndices||M_(this)},t.prototype.getOption=function(){var r=ke(this.option);return R(r,function(n,i){if(tt.hasClass(i)){for(var a=Dt(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!Uy(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[i6],r},t.prototype.setTheme=function(r){this._theme=new it(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 MBe(e,t){return e.join(",")===t.join(",")}var Ga=R,Jy=Ee,l6=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function hM(e){var t=e&&e.itemStyle;if(t)for(var r=0,n=l6.length;r0?r[o-1].seriesModel:null)}),jBe(r)}})}function jBe(e){R(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,f){var h=o.get(t.stackedDimension,f);if(isNaN(h))return i;var d,v;s?v=o.getRawIndex(f):d=o.get(t.stackedByDimension,f);for(var m=NaN,y=r-1;y>=0;y--){var x=e[y];if(s||(v=x.data.rawIndexOf(x.stackedByDimension,d)),v>=0){var _=x.data.getByRawIndex(x.stackResultDimension,v);if(l==="all"||l==="positive"&&_>0||l==="negative"&&_<0||l==="samesign"&&h>=0&&_>0||l==="samesign"&&h<=0&&_<0){h=_Re(h,_),m=_;break}}}return n[0]=h,n[1]=m,n})})}var CC=function(){function e(t){this.data=t.data||(t.sourceFormat===xo?{}:[]),this.sourceFormat=t.sourceFormat||eee,this.seriesLayoutBy=t.seriesLayoutBy||co,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=b)}d[0]=v,d[1]=m}},i=function(){return this._data?this._data.length/this._dimSize:0};p6=(t={},t[_n+"_"+co]={pure:!0,appendData:a},t[_n+"_"+Qf]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[Ji]={pure:!0,appendData:a},t[xo]={pure:!0,appendData:function(o){var s=this._data;R(o,function(l,u){for(var c=s[u]||(s[u]=[]),f=0;f<(l||[]).length;f++)c.push(l[f])})}},t[Ki]={appendData:a},t[_u]={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 Tv(this.getData(r),t)},e.prototype.formatTooltip=function(t,r,n){},e}();function x6(e){var t,r;return Ee(e)?e.type&&(r=e):t=e,{text:t,frag:r}}function km(e){return new WBe(e)}var WBe=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 f;(this._dirty||a==="reset")&&(this._dirty=!1,f=this._doReset(n)),this._modBy=l,this._modDataCount=u;var h=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,v=Math.min(h!=null?this._dueIndex+h:1/0,this._dueEnd);if(!n&&(f||d1&&n>0?s:o}};return a;function o(){return t=e?null:lt},gte:function(e,t){return e>=t}},UBe=function(){function e(t,r){if(!ut(r)){var n="";bt(n)}this._opFn=gee[t],this._rvalFloat=as(r)}return e.prototype.evaluate=function(t){return ut(t)?this._opFn(t,this._rvalFloat):this._opFn(as(t),this._rvalFloat)},e}(),mee=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=ut(t)?t:as(t),i=ut(r)?r:as(r),a=isNaN(n),o=isNaN(i);if(a&&(n=this._incomparable),o&&(i=this._incomparable),a&&o){var s=me(t),l=me(r);s&&(n=l?t:0),l&&(i=s?r:0)}return ni?-this._resultLT:0},e}(),ZBe=function(){function e(t,r){this._rval=r,this._isEQ=t,this._rvalTypeof=typeof r,this._rvalFloat=as(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=as(t)===this._rvalFloat)}return this._isEQ?r:!r},e}();function YBe(e,t){return e==="eq"||e==="ne"?new ZBe(e==="eq",t):we(gee,e)?new UBe(e,t):null}var qBe=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 bu(t,r)},e}();function XBe(e,t){var r=new qBe,n=e.data,i=r.sourceFormat=e.sourceFormat,a=e.startIndex,o="";e.seriesLayoutBy!==co&&bt(o);var s=[],l={},u=e.dimensionsDefine;if(u)R(u,function(m,y){var x=m.name,_={index:y,name:x,displayName:m.displayName};if(s.push(_),x!=null){var b="";we(l,x)&&bt(b),l[x]=_}});else for(var c=0;c65535?ize:aze}function Ih(){return[1/0,-1/0]}function oze(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function w6(e,t,r,n,i){var a=_ee[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=le(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=f&&_<=h||isNaN(_))&&(l[u++]=m),m++}v=!0}else if(a===2){for(var y=d[i[0]],b=d[i[1]],S=t[i[1]][0],T=t[i[1]][1],x=0;x=f&&_<=h||isNaN(_))&&(C>=S&&C<=T||isNaN(C))&&(l[u++]=m),m++}v=!0}}if(!v)if(a===1)for(var x=0;x=f&&_<=h||isNaN(_))&&(l[u++]=A)}else for(var x=0;xt[k][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,f,h,d=new(Lh(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=u;for(var v=1;vc&&(c=f,h=S)}E>0&&Es&&(m=s-c);for(var y=0;yv&&(v=_,d=c+y)}var b=this.getRawIndex(f),S=this.getRawIndex(d);fc-v&&(l=c-v,s.length=l);for(var m=0;mf[1]&&(f[1]=x),h[d++]=_}return a._count=d,a._indices=h,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=f)}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 bu(r[a],this._dimensions[a])}pM={arrayRows:t,objectRows:function(r,n,i,a){return bu(r[n],this._dimensions[a])},keyedColumns:t,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return bu(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),e}(),bee=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(k_(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=si(s)?_u:Ki,a=[];var f=this._getSourceMetaRawOption()||{},h=u&&u.metaRawOption||{},d=Ce(f.seriesLayoutBy,h.seriesLayoutBy)||null,v=Ce(f.sourceHeader,h.sourceHeader),m=Ce(f.dimensions,h.dimensions),y=d!==h.seriesLayoutBy||!!v!=!!h.sourceHeader||m;i=y?[pO(s,{seriesLayoutBy:d,sourceHeader:v,dimensions:m},l)]:[]}else{var x=t;if(n){var _=this._applyTransform(r);i=_.sourceList,a=_.upstreamSignList}else{var b=x.get("source",!0);i=[pO(b,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&&T6(a)}var o,s=[],l=[];return R(t,function(u){u.prepareSource();var c=u.getSource(i||0),f="";i!=null&&!c&&T6(f),s.push(c),l.push(u._getVersionSign())}),n?o=rze(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[RBe(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 R(e.blocks,function(i){var a=Cee(i);a>=t&&(t=a+ +(n&&(!a||mO(i)&&!i.noHeader)))}),t}return 0}function cze(e,t,r,n){var i=t.noHeader,a=hze(Cee(t)),o=[],s=t.blocks||[];Nn(!s||oe(s)),s=s||[];var l=e.orderMode;if(t.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(we(u,l)){var c=new mee(u[l],null);s.sort(function(m,y){return c.evaluate(m.sortParam,y.sortParam)})}else l==="seriesDesc"&&s.reverse()}R(s,function(m,y){var x=t.valueFormatter,_=Tee(m)(x?ie(ie({},e),{valueFormatter:x}):e,m,y>0?a.html:0,n);_!=null&&o.push(_)});var f=e.renderMode==="richText"?o.join(a.richText):yO(n,o.join(""),i?r:a.html);if(i)return f;var h=fO(t.header,"ordinal",e.useUTC),d=See(n,e.renderMode).nameStyle,v=wee(n);return e.renderMode==="richText"?Aee(e,h,d)+a.richText+f:yO(n,'
'+Zn(h)+"
"+f,r)}function fze(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=oe(S)?S:[S],le(S,function(T,C){return fO(T,oe(d)?d[C]:d,u)})};if(!(a&&o)){var f=s?"":e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||J.color.secondary,i),h=a?"":fO(l,"ordinal",u),d=t.valueType,v=o?[]:c(t.value,t.dataIndex),m=!s||!a,y=!s&&a,x=See(n,i),_=x.nameStyle,b=x.valueStyle;return i==="richText"?(s?"":f)+(a?"":Aee(e,h,_))+(o?"":pze(e,v,m,y,b)):yO(n,(s?"":f)+(a?"":dze(h,!s,_))+(o?"":vze(v,m,y,b)),r)}}function C6(e,t,r,n,i,a){if(e){var o=Tee(e),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:t,valueFormatter:e.valueFormatter};return o(s,e,0,a)}}function hze(e){return{html:lze[e],richText:uze[e]}}function yO(e,t,r){var n='
',i="margin: "+r+"px 0 0",a=wee(e);return'
'+t+n+"
"}function dze(e,t,r){var n=t?"margin-left:2px":"";return''+Zn(e)+""}function vze(e,t,r,n){var i=r?"10px":"20px",a=t?"float:right;margin-left:"+i:"";return e=oe(e)?e:[e],''+le(e,function(o){return Zn(o)}).join("  ")+""}function Aee(e,t,r){return e.markupStyleCreator.wrapRichTextStyle(t,r)}function pze(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(oe(t)?t.join(" "):t,a)}function Mee(e,t){var r=e.getData().getItemVisual(t,"style"),n=r[e.visualDrawType];return jf(n)}function Pee(e,t){var r=e.get("padding");return r??(t==="richText"?[8,10]:10)}var gM=function(){function e(){this.richTextStyles={},this._nextStyleNameId=DJ()}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=VQ({color:r,type:t,renderMode:n,markerId:i});return me(a)?a:(this.richTextStyles[i]=a.style,a.content)},e.prototype.wrapRichTextStyle=function(t,r){var n={};oe(r)?R(r,function(a){return ie(n,a)}):ie(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},e}();function kee(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=oe(s),u=Mee(t,r),c,f,h,d;if(o>1||l&&!o){var v=gze(s,t,r,a,u);c=v.inlineValues,f=v.inlineValueTypes,h=v.blocks,d=v.inlineValues[0]}else if(o){var m=i.getDimensionInfo(a[0]);d=c=Tv(i,r,a[0]),f=m.type}else d=c=l?s[0]:s;var y=aj(t),x=y&&t.name||"",_=i.getName(r),b=n?x:_;return zr("section",{header:x,noHeader:n||!y,sortParam:d,blocks:[zr("nameValue",{markerType:"item",markerColor:u,name:b,noName:!Fi(b),value:c,valueType:f,dataIndex:r})].concat(h||[])})}function gze(e,t,r,n,i){var a=t.getData(),o=La(e,function(f,h,d){var v=a.getDimensionInfo(d);return f=f||v&&v.tooltip!==!1&&v.displayName!=null},!1),s=[],l=[],u=[];n.length?R(n,function(f){c(Tv(a,r,f),f)}):R(e,c);function c(f,h){var d=a.getDimensionInfo(h);!d||d.otherDims.tooltip===!1||(o?u.push(zr("nameValue",{markerType:"subItem",markerColor:i,name:d.displayName,value:f,valueType:d.type})):(s.push(f),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var Pl=rt();function L_(e,t){return e.getName(t)||e.getId(t)}var Zb="__universalTransitionEnabled",Lt=function(e){X(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=km({count:yze,reset:xze}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=Pl(this).sourceManager=new bee(this);a.prepareSource();var o=this.getInitialData(r,i);M6(o,this),this.dataTask.context.data=o,Pl(this).dataBeforeProcessed=o,A6(this),this._initSelectedMapFromData(o)},t.prototype.mergeDefaultAndTheme=function(r,n){var i=Ky(this),a=i?Jf(r):{},o=this.subType;tt.hasClass(o)&&(o+="Series"),qe(r,n.getTheme().get(this.subType)),qe(r,this.getDefaultOption()),Lf(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&ss(r,a,i)},t.prototype.mergeOption=function(r,n){r=qe(this.option,r,!0),this.fillDataTextStyle(r.data);var i=Ky(this);i&&ss(this.option,r,i);var a=Pl(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);M6(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Pl(this).dataBeforeProcessed=o,A6(this),this._initSelectedMapFromData(o)},t.prototype.fillDataTextStyle=function(r){if(r&&!si(r))for(var n=["show"],i=0;i=0&&h<0)&&(f=_,h=x,d=0),x===h&&(c[d++]=m))}),c.length=d,c},t.prototype.formatTooltip=function(r,n,i){return kee({series:this,dataIndex:r,multipleSeries:n})},t.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(ot.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=Vj.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[L_(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},t.prototype.isUniversalTransitionEnabled=function(){if(this[Zb])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"){Ee(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,c=0;c0&&this._innerSelect(r,n)}},t.registerClass=function(r){return tt.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}(tt);br(Lt,AC);br(Lt,Vj);HJ(Lt,tt);function A6(e){var t=e.name;aj(e)||(e.name=mze(e)||t)}function mze(e){var t=e.getRawData(),r=t.mapDimensionsAll("seriesName"),n=[];return R(r,function(i){var a=t.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function yze(e){return e.model.getRawData().count()}function xze(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),_ze}function _ze(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function M6(e,t){R(mv(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(r){e.wrapMethod(r,Ue(bze,t))})}function bze(e,t){var r=xO(e);return r&&r.setOutputEnd((t||this).count()),t}function xO(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 jt=function(){function e(){this.group=new Le,this.uid=dp("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}();sj(jt);dC(jt);function gp(){var e=rt();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 Lee=rt(),wze=gp(),At=function(){function e(){this.group=new Le,this.uid=dp("viewChart"),this.renderTask=km({plan:Sze,reset:Tze}),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&&k6(a,i,"emphasis")},e.prototype.downplay=function(t,r,n,i){var a=t.getData(i&&i.dataType);a&&k6(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){Uu(this.group,t)},e.markUpdateMethod=function(t,r){Lee(t).updateMethod=r},e.protoInitialize=function(){var t=e.prototype;t.type="chart"}(),e}();function P6(e,t,r){e&&Yy(e)&&(t==="emphasis"?ul:cl)(e,r)}function k6(e,t,r){var n=If(e,t),i=t&&t.highlightKey!=null?X3e(t.highlightKey):null;n!=null?R(Dt(n),function(a){P6(e.getItemGraphicEl(a),r,i)}):e.eachItemGraphicEl(function(a){P6(a,r,i)})}sj(At);dC(At);function Sze(e){return wze(e.model)}function Tze(e){var t=e.model,r=e.ecModel,n=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&Lee(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](t,r,n,i),Cze[l]}var Cze={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)}}},eS="\0__throttleOriginMethod",L6="\0__throttleRate",I6="\0__throttleType";function PC(e,t,r){var n,i=0,a=0,o=null,s,l,u,c;t=t||0;function f(){a=new Date().getTime(),o=null,e.apply(l,u||[])}var h=function(){for(var d=[],v=0;v=0?f():o=setTimeout(f,-s),i=n};return h.clear=function(){o&&(clearTimeout(o),o=null)},h.debounceNextCall=function(d){c=d},h}function mp(e,t,r,n){var i=e[t];if(i){var a=i[eS]||i,o=i[I6],s=i[L6];if(s!==r||o!==n){if(r==null||!n)return e[t]=a;i=e[t]=PC(a,r,n==="debounce"),i[eS]=a,i[I6]=n,i[L6]=r}return i}}function Qy(e,t){var r=e[t];r&&r[eS]&&(r.clear&&r.clear(),e[t]=r[eS])}var O6=rt(),E6={itemStyle:Of(EQ,!0),lineStyle:Of(OQ,!0)},Aze={lineStyle:"stroke",itemStyle:"fill"};function Iee(e,t){var r=e.visualStyleMapper||E6[t];return r||(console.warn("Unknown style type '"+t+"'."),E6.itemStyle)}function Oee(e,t){var r=e.visualDrawType||Aze[t];return r||(console.warn("Unknown style type '"+t+"'."),"fill")}var Mze={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=e.getModel(n),a=Iee(e,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=Oee(e,n),u=o[l],c=Pe(u)?u:null,f=o.fill==="auto"||o.stroke==="auto";if(!o[l]||c||f){var h=e.getColorFromPalette(e.name,null,t.getSeriesCount());o[l]||(o[l]=h,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||Pe(o.fill)?h:o.fill,o.stroke=o.stroke==="auto"||Pe(o.stroke)?h:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!t.isSeriesFiltered(e)&&c)return r.setVisual("colorFromPalette",!1),{dataEach:function(d,v){var m=e.getDataParams(v),y=ie({},o);y[l]=c(m),d.setItemVisual(v,"style",y)}}}},vg=new it,Pze={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var r=e.getData(),n=e.visualStyleAccessPath||"itemStyle",i=Iee(e,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){vg.option=l[n];var u=i(vg),c=o.ensureUniqueItemVisual(s,"style");ie(c,u),vg.option.decal&&(o.setItemVisual(s,"decal",vg.option.decal),vg.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},kze={performRawSeries:!0,overallReset:function(e){var t=Se();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)),O6(r).scope=a}}),e.eachSeries(function(r){if(!(r.isColorBySeries()||e.isSeriesFiltered(r))){var n=r.getRawData(),i={},a=r.getData(),o=O6(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=Oee(r,s);a.each(function(u){var c=a.getRawIndex(u);i[c]=u}),n.each(function(u){var c=i[u],f=a.getItemVisual(c,"colorFromPalette");if(f){var h=a.ensureUniqueItemVisual(c,"style"),d=n.getName(u)||u+"",v=n.count();h[l]=r.getColorFromPalette(d,o,v)}})}})}},I_=Math.PI;function Lze(e,t){t=t||{},Oe(t,{text:"loading",textColor:J.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:J.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var r=new Le,n=new Qe({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});r.add(n);var i=new lt({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 Qe({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 V0({shape:{startAngle:-I_/2,endAngle:-I_/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:I_*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:I_*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 Eee=function(){function e(t,r,n,i){this._stageTaskMap=Se(),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=Se();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;R(this._allHandlers,function(i){var a=t.get(i.uid)||t.set(i.uid,{}),o="";Nn(!(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;R(t,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var c=o._stageTaskMap.get(l.uid),f=c.seriesTaskMap,h=c.overallTask;if(h){var d,v=h.agentStubMap;v.each(function(y){s(i,y)&&(y.dirty(),d=!0)}),d&&h.dirty(),o.updatePayload(h,n);var m=o.getPerformArgs(h,i.block);v.each(function(y){y.perform(m)}),h.perform(m)&&(a=!0)}else f&&f.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=Se(),l=t.seriesType,u=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(c):l?n.eachRawSeriesByType(l,c):u&&u(n,i).each(c);function c(f){var h=f.uid,d=s.set(h,o&&o.get(h)||km({plan:Dze,reset:jze,count:Bze}));d.context={model:f,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:a},a._pipe(f,d)}},e.prototype._createOverallStageTask=function(t,r,n,i){var a=this,o=r.overallTask=r.overallTask||km({reset:Ize});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=Se(),u=t.seriesType,c=t.getTargetSeries,f=!0,h=!1,d="";Nn(!t.createOnAllSeries,d),u?n.eachRawSeriesByType(u,v):c?c(n,i).each(v):(f=!1,R(n.getSeries(),v));function v(m){var y=m.uid,x=l.set(y,s&&s.get(y)||(h=!0,km({reset:Oze,onDirty:Nze})));x.context={model:m,overallProgress:f},x.agent=o,x.__block=f,a._pipe(m,x)}h&&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 Pe(t)&&(t={overallReset:t,seriesType:zze(t)}),t.uid=dp("stageHandler"),r&&(t.visualType=r),t},e}();function Ize(e){e.overallReset(e.ecModel,e.api,e.payload)}function Oze(e){return e.overallProgress&&Eze}function Eze(){this.agent.dirty(),this.getDownstream().dirty()}function Nze(){this.agent&&this.agent.dirty()}function Dze(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function jze(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=Dt(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?le(t,function(r,n){return Nee(n)}):Rze}var Rze=Nee(0);function Nee(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-h.length){var v=u.slice(0,d);v!=="data"&&(r.mainType=v,r[h.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(f,h,d,v){return f[d]==null||h[v||d]===f[d]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),_O=["symbol","symbolSize","symbolRotate","symbolOffset"],D6=_O.concat(["symbolKeepAspect"]),Vze={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<_O.length;o++){var s=_O[o],l=e.get(s);Pe(l)?(a=!0,i[s]=l):n[s]=l}if(n.symbol=n.symbol||e.defaultSymbol,r.setVisual(ie({legendIcon:e.legendIcon||n.symbol,symbolKeepAspect:e.get("symbolKeepAspect")},n)),t.isSeriesFiltered(e))return;var u=st(i);function c(f,h){for(var d=e.getRawValue(h),v=e.getDataParams(h),m=0;m=0&&nf(l)?l:.5;var u=e.createRadialGradient(o,s,0,o,s,l);return u}function bO(e,t,r){for(var n=t.type==="radial"?n4e(e,t,r):r4e(e,t,r),i=t.colorStops,a=0;a0)?null:e==="dashed"?[4*t,2*t]:e==="dotted"?[t]:ut(e)?[e]:oe(e)?e:null}function qj(e){var t=e.style,r=t.lineDash&&t.lineWidth>0&&a4e(t.lineDash,t.lineWidth),n=t.lineDashOffset;if(r){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(r=le(r,function(a){return a/i}),n/=i)}return[r,n]}var o4e=new os(!0);function nS(e){var t=e.stroke;return!(t==null||t==="none"||!(e.lineWidth>0))}function j6(e){return typeof e=="string"&&e!=="none"}function iS(e){var t=e.fill;return t!=null&&t!=="none"}function R6(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 B6(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 wO(e,t,r){var n=lj(t.image,t.__image,r);if(vC(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)*ym),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function s4e(e,t,r,n){var i,a=nS(r),o=iS(r),s=r.strokePercent,l=s<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var c=t.path||o4e,f=t.__dirty;if(!n){var h=r.fill,d=r.stroke,v=o&&!!h.colorStops,m=a&&!!d.colorStops,y=o&&!!h.image,x=a&&!!d.image,_=void 0,b=void 0,S=void 0,T=void 0,C=void 0;(v||m)&&(C=t.getBoundingRect()),v&&(_=f?bO(e,h,C):t.__canvasFillGradient,t.__canvasFillGradient=_),m&&(b=f?bO(e,d,C):t.__canvasStrokeGradient,t.__canvasStrokeGradient=b),y&&(S=f||!t.__canvasFillPattern?wO(e,h,t):t.__canvasFillPattern,t.__canvasFillPattern=S),x&&(T=f||!t.__canvasStrokePattern?wO(e,d,t):t.__canvasStrokePattern,t.__canvasStrokePattern=T),v?e.fillStyle=_:y&&(S?e.fillStyle=S:o=!1),m?e.strokeStyle=b: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=qj(t),P=i[0],I=i[1]);var k=!0;(u||f&Xh)&&(c.setDPR(e.dpr),l?c.setContext(null):(c.setContext(e),k=!1),c.reset(),t.buildPath(c,t.shape,n),c.toStatic(),t.pathUpdated()),k&&c.rebuildPath(e,l?s:1),P&&(e.setLineDash(P),e.lineDashOffset=I),n||(r.strokeFirst?(a&&B6(e,r),o&&R6(e,r)):(o&&R6(e,r),a&&B6(e,r))),P&&e.setLineDash([])}function l4e(e,t,r){var n=t.__image=lj(r.image,t.__image,t,t.onload);if(!(!n||!vC(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,f=o-u,h=s-c;e.drawImage(n,u,c,f,h,i,a,o,s)}else e.drawImage(n,i,a,o,s)}}function u4e(e,t,r){var n,i=r.text;if(i!=null&&(i+=""),i){e.font=r.font||sl,e.textAlign=r.textAlign,e.textBaseline=r.textBaseline;var a=void 0,o=void 0;e.setLineDash&&r.lineDash&&(n=qj(t),a=n[0],o=n[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),r.strokeFirst?(nS(r)&&e.strokeText(i,r.x,r.y),iS(r)&&e.fillText(i,r.x,r.y)):(iS(r)&&e.fillText(i,r.x,r.y),nS(r)&&e.strokeText(i,r.x,r.y)),a&&e.setLineDash([])}}var z6=["shadowBlur","shadowOffsetX","shadowOffsetY"],$6=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function $ee(e,t,r,n,i){var a=!1;if(!n&&(r=r||{},t===r))return!1;if(n||t.opacity!==r.opacity){gi(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?hf.opacity:o}(n||t.blend!==r.blend)&&(a||(gi(e,i),a=!0),e.globalCompositeOperation=t.blend||hf.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[Vr]){if(this._disposed){this.id;return}var a,o,s;if(Ee(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[Vr]=!0,Dh(this),!this._model||n){var l=new SBe(this._api),u=this._theme,c=this._model=new Gj;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},AO);var f={seriesTransition:s,optionChanged:!0};if(i)this[hn]={silent:a,updateParams:f},this[Vr]=!1,this.getZr().wakeUp();else{try{Sc(this),Cs.update.call(this,null,f)}catch(h){throw this[hn]=null,this[Vr]=!1,h}this._ssr||this._zr.flush(),this[hn]=null,this[Vr]=!1,Eh.call(this,a),Nh.call(this,a)}}},t.prototype.setTheme=function(r,n){if(!this[Vr]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,o=null;this[hn]&&(a==null&&(a=this[hn].silent),o=this[hn].updateParams,this[hn]=null),this[Vr]=!0,Dh(this);try{this._updateTheme(r),i.setTheme(this._theme),Sc(this),Cs.update.call(this,{type:"setTheme"},o)}catch(s){throw this[Vr]=!1,s}this[Vr]=!1,Eh.call(this,a),Nh.call(this,a)}}},t.prototype._updateTheme=function(r){me(r)&&(r=ate[r]),r&&(r=ke(r),r&&lee(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||ot.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 R(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;R(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 R(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(lS[i]){var l=s,u=s,c=-s,f=-s,h=[],d=r&&r.pixelRatio||this.getDevicePixelRatio();R(pf,function(b,S){if(b.group===i){var T=n?b.getZr().painter.getSvgDom().innerHTML:b.renderToCanvas(ke(r)),C=b.getDom().getBoundingClientRect();l=a(C.left,l),u=a(C.top,u),c=o(C.right,c),f=o(C.bottom,f),h.push({dom:T,left:C.left,top:C.top})}}),l*=d,u*=d,c*=d,f*=d;var v=c-l,m=f-u,y=Si.createCanvas(),x=WI(y,{renderer:n?"svg":"canvas"});if(x.resize({width:v,height:m}),n){var _="";return R(h,function(b){var S=b.left-l,T=b.top-u;_+=''+b.dom+""}),x.painter.getSvgRoot().innerHTML=_,r.connectedBackgroundColor&&x.painter.setBackgroundColor(r.connectedBackgroundColor),x.refreshImmediately(),x.painter.toDataURL()}else return r.connectedBackgroundColor&&x.add(new Qe({shape:{x:0,y:0,width:v,height:m},style:{fill:r.connectedBackgroundColor}})),R(h,function(b){var S=new un({style:{x:b.left*d-l,y:b.top*d-u,image:b.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 D_(this,"convertToPixel",r,n,i)},t.prototype.convertToLayout=function(r,n,i){return D_(this,"convertToLayout",r,n,i)},t.prototype.convertFromPixel=function(r,n,i){return D_(this,"convertFromPixel",r,n,i)},t.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=Dd(i,r);return R(o,function(s,l){l.indexOf("Models")>=0&&R(s,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)a=a||!!c.containPoint(n);else if(l==="seriesModels"){var f=this._chartsMap[u.__viewId];f&&f.containPoint&&(a=a||f.containPoint(n,u))}},this)},this),!!a},t.prototype.getVisual=function(r,n){var i=this._model,a=Dd(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?Yj(s,l,n):Z0(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;R(D4e,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,c=i==="globalout";if(c?u={}:l&&rf(l,function(m){var y=Be(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=ie({},y.eventData),!0},!0),u){var f=u.componentType,h=u.componentIndex;(f==="markLine"||f==="markPoint"||f==="markArea")&&(f="series",h=u.seriesIndex);var d=f&&h!=null&&s.getComponent(f,h),v=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:v},r.trigger(i,u)}};a.zrEventfulCallAtLast=!0,r._zr.on(i,a,r)});var n=this._messageCenter;R(TO,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),Wze(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&&VJ(this.getDom(),Qj,"");var n=this,i=n._api,a=n._model;R(n._componentsViews,function(o){o.dispose(a,i)}),R(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 pf[n.id]},t.prototype.resize=function(r){if(!this[Vr]){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[hn]&&(a==null&&(a=this[hn].silent),i=!0,this[hn]=null),this[Vr]=!0,Dh(this);try{i&&Sc(this),Cs.update.call(this,{type:"resize",animation:ie({duration:0},r&&r.animation)})}catch(o){throw this[Vr]=!1,o}this[Vr]=!1,Eh.call(this,a),Nh.call(this,a)}}},t.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(Ee(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!MO[r]){var i=MO[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=ie({},r);return n.type=SO[r.type],n},t.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(Ee(n)||(n={silent:!!n}),!!oS[r.type]&&this._model){if(this[Vr]){this._pendingActions.push(r);return}var i=n.silent;wM.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&ot.browser.weChat&&this._throttledZrFlush(),Eh.call(this,i),Nh.call(this,i)}},t.prototype.updateLabelLayout=function(){Za.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(){Sc=function(f){var h=f._scheduler;h.restorePipelines(f._model),h.prepareStageTasks(),_M(f,!0),_M(f,!1),h.plan()},_M=function(f,h){for(var d=f._model,v=f._scheduler,m=h?f._componentsViews:f._chartsViews,y=h?f._componentsMap:f._chartsMap,x=f._zr,_=f._api,b=0;bh.get("hoverLayerThreshold")&&!ot.node&&!ot.worker&&h.eachSeries(function(y){if(!y.preventUsingHoverLayer){var x=f._chartsMap[y.__viewId];x.__alive&&x.eachRendered(function(_){_.states.emphasis&&(_.states.emphasis.hoverLayer=!0)})}})}function s(f,h){var d=f.get("blendMode")||null;h.eachRendered(function(v){v.isGroup||(v.style.blend=d)})}function l(f,h){if(!f.preventAutoZ){var d=Df(f);h.eachRendered(function(v){return wC(v,d.z,d.zlevel),!0})}}function u(f,h){h.eachRendered(function(d){if(!jd(d)){var v=d.getTextContent(),m=d.getTextGuideLine();d.stateTransition&&(d.stateTransition=null),v&&v.stateTransition&&(v.stateTransition=null),m&&m.stateTransition&&(m.stateTransition=null),d.hasState()?(d.prevStates=d.currentStates,d.clearStates()):d.prevStates&&(d.prevStates=null)}})}function c(f,h){var d=f.getModel("stateAnimation"),v=f.isAnimationEnabled(),m=d.get("duration"),y=m>0?{duration:m,delay:d.get("delay"),easing:d.get("easing")}:null;h.eachRendered(function(x){if(x.states&&x.states.emphasis){if(jd(x))return;if(x instanceof at&&K3e(x),x.__dirty){var _=x.prevStates;_&&x.useStates(_)}if(v){x.stateTransition=y;var b=x.getTextContent(),S=x.getTextGuideLine();b&&(b.stateTransition=y),S&&(S.stateTransition=y)}x.__dirty&&a(x)}})}Q6=function(f){return new(function(h){X(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return f._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(v){for(;v;){var m=v.__ecComponentInfo;if(m!=null)return f._model.getComponent(m.mainType,m.index);v=v.parent}},d.prototype.enterEmphasis=function(v,m){ul(v,m),oa(f)},d.prototype.leaveEmphasis=function(v,m){cl(v,m),oa(f)},d.prototype.enterBlur=function(v){oQ(v),oa(f)},d.prototype.leaveBlur=function(v){vj(v),oa(f)},d.prototype.enterSelect=function(v){sQ(v),oa(f)},d.prototype.leaveSelect=function(v){lQ(v),oa(f)},d.prototype.getModel=function(){return f.getModel()},d.prototype.getViewOfComponentModel=function(v){return f.getViewOfComponentModel(v)},d.prototype.getViewOfSeriesModel=function(v){return f.getViewOfSeriesModel(v)},d.prototype.getMainProcessVersion=function(){return f[E_]},d}(oee))(f)},ite=function(f){function h(d,v){for(var m=0;m=0)){tG.push(r);var a=Eee.wrapStageHandler(r,i);a.__prio=t,a.__raw=r,e.push(a)}}function aR(e,t){MO[e]=t}function H4e(e){ZK({createCanvas:e})}function fte(e,t,r){var n=Uee("registerMap");n&&n(e,t,r)}function U4e(e){var t=Uee("getMap");return t&&t(e)}var hte=tze;Yu(Kj,Mze);Yu(kC,Pze);Yu(kC,kze);Yu(Kj,Vze);Yu(kC,Gze);Yu(Kee,m4e);rR(lee);nR(T4e,DBe);aR("default",Lze);_o({type:df,event:df,update:df},yr);_o({type:Fb,event:Fb,update:Fb},yr);_o({type:Zw,event:hj,update:Zw,action:yr,refineEvent:oR,publishNonRefinedEvent:!0});_o({type:eO,event:hj,update:eO,action:yr,refineEvent:oR,publishNonRefinedEvent:!0});_o({type:Yw,event:hj,update:Yw,action:yr,refineEvent:oR,publishNonRefinedEvent:!0});function oR(e,t,r,n){return{eventContent:{selected:U3e(r),isFromClick:t.isFromClick||!1}}}tR("default",{});tR("dark",Ree);var Z4e={},rG=[],Y4e={registerPreprocessor:rR,registerProcessor:nR,registerPostInit:ste,registerPostUpdate:lte,registerUpdateLifecycle:LC,registerAction:_o,registerCoordinateSystem:ute,registerLayout:cte,registerVisual:Yu,registerTransform:hte,registerLoading:aR,registerMap:fte,registerImpl:y4e,PRIORITY:Jee,ComponentModel:tt,ComponentView:jt,SeriesModel:Lt,ChartView:At,registerComponentModel:function(e){tt.registerClass(e)},registerComponentView:function(e){jt.registerClass(e)},registerSeriesModel:function(e){Lt.registerClass(e)},registerChartView:function(e){At.registerClass(e)},registerCustomSeries:function(e,t){Yee(e,t)},registerSubTypeDefaulter:function(e,t){tt.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){PJ(e,t)}};function Ke(e){if(oe(e)){R(e,function(t){Ke(t)});return}Ze(rG,e)>=0||(rG.push(e),Pe(e)&&(e={install:e}),e.install(Y4e))}function gg(e){return e==null?0:e.length||1}function nG(e){return e}var fl=function(){function e(t,r,n,i,a,o){this._old=t,this._new=r,this._oldKeyGetter=n||nG,this._newKeyGetter=i||nG,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&&h===1)this._updateManyToOne&&this._updateManyToOne(c,u),i[l]=null;else if(f===1&&h>1)this._updateOneToMany&&this._updateOneToMany(c,u),i[l]=null;else if(f===1&&h===1)this._update&&this._update(c,u),i[l]=null;else if(f>1&&h>1)this._updateManyToMany&&this._updateManyToMany(c,u),i[l]=null;else if(f>1)for(var d=0;d1)for(var s=0;s30}var mg=Ee,kl=le,e$e=typeof Int32Array>"u"?Array:Int32Array,t$e="e\0\0",iG=-1,r$e=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],n$e=["_approximateExtent"],aG,R_,yg,xg,CM,_g,AM,qn=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;vte(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===Ki;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),oe(a)?a=a.slice():mg(a)&&(a=ie({},a)),i[r]=a),a},e.prototype.setItemVisual=function(t,r,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,mg(r)?ie(i,r):i[r]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(t,r){mg(t)?ie(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?ie(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;QI(n,this.dataType,t,r),this._graphicEls[t]=r},e.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},e.prototype.eachItemGraphicEl=function(t,r){R(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:kl(this.dimensions,this._getDimInfo,this),this.hostModel)),CM(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(t,r){var n=this[t];Pe(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var i=n.apply(this,arguments);return r.apply(this,[i].concat(oC(arguments)))})},e.internalField=function(){aG=function(t){var r=t._invertedIndicesMap;R(r,function(n,i){var a=t._dimInfos[i],o=a.ordinalMeta,s=t._store;if(o){n=r[i]=new e$e(o.categories.length);for(var l=0;l1&&(l+="__ec__"+c),i[r]=l}}}(),e}();function i$e(e,t){return xp(e,t).dimensions}function xp(e,t){Wj(e)||(e=Hj(e)),t=t||{};var r=t.coordDimensions||[],n=t.dimensionsDefine||e.dimensionsDefine||[],i=Se(),a=[],o=o$e(e,r,n,t.dimensionsCount),s=t.canOmitUnusedDimensions&&mte(o),l=n===e.dimensionsDefine,u=l?gte(e):pte(n),c=t.encodeDefine;!c&&t.encodeDefaulter&&(c=t.encodeDefaulter(e,o));for(var f=Se(c),h=new xee(o),d=0;d0&&(n.name=i+(a-1)),a++,t.set(i,a)}}function o$e(e,t,r,n){var i=Math.max(e.dimensionsDetectedCount||1,t.length,r.length,n||0);return R(t,function(a){var o;Ee(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function s$e(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 l$e=function(){function e(t){this.coordSysDims=[],this.axisMap=Se(),this.categoryAxisMap=Se(),this.coordSysName=t}return e}();function u$e(e){var t=e.get("coordinateSystem"),r=new l$e(t),n=c$e[t];if(n)return n(e,r,r.axisMap,r.categoryAxisMap),r}var c$e={cartesian2d:function(e,t,r,n){var i=e.getReferringComponents("xAxis",ur).models[0],a=e.getReferringComponents("yAxis",ur).models[0];t.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),jh(i)&&(n.set("x",i),t.firstCategoryDimIndex=0),jh(a)&&(n.set("y",a),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=1))},singleAxis:function(e,t,r,n){var i=e.getReferringComponents("singleAxis",ur).models[0];t.coordSysDims=["single"],r.set("single",i),jh(i)&&(n.set("single",i),t.firstCategoryDimIndex=0)},polar:function(e,t,r,n){var i=e.getReferringComponents("polar",ur).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),jh(a)&&(n.set("radius",a),t.firstCategoryDimIndex=0),jh(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();R(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),c=o[l];r.set(c,u),jh(u)&&(n.set(c,u),t.firstCategoryDimIndex==null&&(t.firstCategoryDimIndex=l))})},matrix:function(e,t,r,n){var i=e.getReferringComponents("matrix",ur).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 jh(e){return e.get("type")==="category"}function yte(e,t,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;f$e(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var l=!!(e&&e.get("stack")),u,c,f,h;if(R(a,function(_,b){me(_)&&(a[b]=_={name:_}),l&&!_.isExtraCoord&&(!n&&!u&&_.ordinalMeta&&(u=_),!c&&_.type!=="ordinal"&&_.type!=="time"&&(!i||i===_.coordDim)&&(c=_))}),c&&!n&&!u&&(n=!0),c){f="__\0ecstackresult_"+e.id,h="__\0ecstackedover_"+e.id,u&&(u.createInvertedIndices=!0);var d=c.coordDim,v=c.type,m=0;R(a,function(_){_.coordDim===d&&m++});var y={name:f,coordDim:d,coordDimIndex:m,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},x={name:h,coordDim:h,coordDimIndex:m+1,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(y.storeDimIndex=s.ensureCalculationDimension(h,v),x.storeDimIndex=s.ensureCalculationDimension(f,v)),o.appendCalculationDimension(y),o.appendCalculationDimension(x)):(a.push(y),a.push(x))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:h,stackResultDimension:f}}function f$e(e){return!vte(e.schema)}function hl(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}function sR(e,t){return hl(e,t)?e.getCalculationInfo("stackResultDimension"):t}function h$e(e,t){var r=e.get("coordinateSystem"),n=pp.get(r),i;return t&&t.coordSysDims&&(i=le(t.coordSysDims,function(a){var o={name:a},s=t.axisMap.get(a);if(s){var l=s.get("type");o.type=uS(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function d$e(e,t,r){var n,i;return r&&R(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 vs(e,t,r){r=r||{};var n=t.getSourceManager(),i,a=!1;e?(a=!0,i=Hj(e)):(i=n.getSource(),a=i.sourceFormat===Ki);var o=u$e(t),s=h$e(t,o),l=r.useEncodeDefaulter,u=Pe(l)?l:l?Ue(ree,s,t):null,c={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},f=xp(i,c),h=d$e(f.dimensions,r.createInvertedIndices,o),d=a?null:n.getSharedDataStore(f),v=yte(t,{schema:f,store:d}),m=new qn(f,t);m.setCalculationInfo(v);var y=h!=null&&v$e(i)?function(x,_,b,S){return S===h?b:this.defaultDimValueGetter(x,_,b,S)}:null;return m.hasItemOption=!1,m.initData(a?i:d,null,y),m}function v$e(e){if(e.sourceFormat===Ki){var t=p$e(e.data||[]);return!oe(ap(t))}}function p$e(e){for(var t=0;ti&&(o=a.interval=i);var s=a.intervalPrecision=r0(o),l=a.niceTickExtent=[Mr(Math.ceil(e[0]/o)*o,s),Mr(Math.floor(e[1]/o)*o,s)];return m$e(l,e),a}function MM(e){var t=Math.pow(10,hC(e)),r=e/t;return r?r===2?r=3:r===3?r=5:r*=2:r=1,Mr(r*t)}function r0(e){return no(e)+2}function oG(e,t,r){e[t]=Math.max(Math.min(e[t],r[1]),r[0])}function m$e(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),oG(e,0,t),oG(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function lR(e,t){return e>=t[0]&&e<=t[1]}var y$e=function(){function e(){this.normalize=sG,this.scale=lG}return e.prototype.updateMethods=function(t){t.hasBreaks()?(this.normalize=xe(t.normalize,t),this.scale=xe(t.scale,t)):(this.normalize=sG,this.scale=lG)},e}();function sG(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function lG(e,t){return e*(t[1]-t[0])+t[0]}function kO(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 qu=function(){function e(t){this._calculator=new y$e,this._setting=t||{},this._extent=[1/0,-1/0];var r=Rr();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=Rr();r&&this._innerSetBreak(r.parseAxisBreakOption(t,xe(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}();dC(qu);var x$e=0,n0=function(){function e(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++x$e,this._onCollect=t.onCollect}return e.createByAxisModel=function(t){var r=t.option,n=r.data,i=n&&le(n,_$e);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(!me(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=Se(this.categories))},e}();function _$e(e){return Ee(e)&&e.value!=null?e.value:e+""}var Av=function(e){X(t,e);function t(r){var n=e.call(this,r)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new n0({})),oe(i)&&(i=new n0({categories:le(i,function(a){return Ee(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:me(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},t.prototype.contain=function(r){return lR(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}(qu);qu.registerClass(Av);var Ll=Mr,dl=function(e){X(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 lR(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=r0(r)},t.prototype.getTicks=function(r){r=r||{};var n=this._interval,i=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=Rr(),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&&(f=Ll(f+h*n,o))}if(l.length>0&&f===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:Ll(d+n,o)}):l.push({value:i[1]})),s&&s.pruneTicksByBreak(r.pruneByBreak,l,this._brkCtx.breaks,function(v){return v.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]&&v0&&(a=a===null?s:Math.min(a,s))}r[n]=a}}return r}function wte(e){var t=S$e(e),r=[];return R(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]),f=a.scale.getExtent(),h=Math.abs(f[1]-f[0]);s=u?c/h*u:c}else{var d=n.getData();s=Math.abs(o[1]-o[0])/d.count()}var v=ge(n.get("barWidth"),s),m=ge(n.get("barMaxWidth"),s),y=ge(n.get("barMinWidth")||(Mte(n)?.5:1),s),x=n.get("barGap"),_=n.get("barCategoryGap"),b=n.get("defaultBarGap");r.push({bandWidth:s,barWidth:v,barMaxWidth:m,barMinWidth:y,barGap:x,barCategoryGap:_,defaultBarGap:b,axisKey:uR(a),stackId:_te(n)})}),Ste(r)}function Ste(e){var t={};R(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 f=n.barMaxWidth;f&&(l[u].maxWidth=f);var h=n.barMinWidth;h&&(l[u].minWidth=h);var d=n.barGap;d!=null&&(s.gap=d);var v=n.barCategoryGap;v!=null&&(s.categoryGap=v)});var r={};return R(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=st(a).length;s=Math.max(35-l*4,15)+"%"}var u=ge(s,o),c=ge(n.gap,1),f=n.remainedWidth,h=n.autoWidthCount,d=(f-u)/(h+(h-1)*c);d=Math.max(d,0),R(a,function(x){var _=x.maxWidth,b=x.minWidth;if(x.width){var S=x.width;_&&(S=Math.min(S,_)),b&&(S=Math.max(S,b)),x.width=S,f-=S+c*S,h--}else{var S=d;_&&_S&&(S=b),S!==d&&(x.width=S,f-=S+c*S,h--)}}),d=(f-u)/(h+(h-1)*c),d=Math.max(d,0);var v=0,m;R(a,function(x,_){x.width||(x.width=d),m=x,v+=x.width*(1+c)}),m&&(v-=m.width*c);var y=-v/2;R(a,function(x,_){r[i][_]=r[i][_]||{bandWidth:o,offset:y,width:x.width},y+=x.width*(1+c)})}),r}function T$e(e,t,r){if(e&&t){var n=e[uR(t)];return n}}function Tte(e,t){var r=bte(e,t),n=wte(r);R(r,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=_te(i),u=n[uR(s)][l],c=u.offset,f=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:f})})}function Cte(e){return{seriesType:e,plan:gp(),reset:function(t){if(Ate(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"),f=hl(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),h=a.isHorizontal(),d=C$e(i,a),v=Mte(t),m=t.get("barMinHeight")||0,y=c&&r.getDimensionIndex(c),x=r.getLayout("size"),_=r.getLayout("offset");return{progress:function(b,S){for(var T=b.count,C=v&&Wo(T*3),A=v&&l&&Wo(T*3),P=v&&Wo(T),I=n.master.getRect(),k=h?I.width:I.height,E,N=S.getStore(),D=0;(E=b.next())!=null;){var z=N.get(f?y:o,E),V=N.get(s,E),F=d,$=void 0;f&&($=+z-N.get(o,E));var B=void 0,H=void 0,U=void 0,Z=void 0;if(h){var Y=n.dataToPoint([z,V]);if(f){var K=n.dataToPoint([$,V]);F=K[0]}B=F,H=Y[1]+_,U=Y[0]-F,Z=x,Math.abs(U)0?r:1:r))}var A$e=function(e,t,r,n){for(;r>>1;e[i][1]i&&(this._approxInterval=i);var o=B_.length,s=Math.min(A$e(B_,this._approxInterval,0,o),o-1);this._interval=B_[s][1],this._intervalPrecision=r0(this._interval),this._minLevelUnit=B_[Math.max(s-1,0)][0]},t.prototype.parse=function(r){return ut(r)?r:+hs(r)},t.prototype.contain=function(r){return lR(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}(dl),B_=[["second",Pj],["minute",kj],["hour",Mm],["quarter-day",Mm*6],["half-day",Mm*12],["day",ya*1.2],["half-week",ya*3.5],["week",ya*7],["month",ya*31],["quarter",ya*95],["half-year",JV/2],["year",JV]];function Pte(e,t,r,n){return Jw(new Date(t),e,n).getTime()===Jw(new Date(r),e,n).getTime()}function M$e(e,t){return e/=ya,e>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function P$e(e){var t=30*ya;return e/=t,e>6?6:e>3?3:e>2?2:1}function k$e(e){return e/=Mm,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function uG(e,t){return e/=t?kj:Pj,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function L$e(e){return nj(e,!0)}function I$e(e,t,r){var n=Math.max(0,Ze(Di,t)-1);return Jw(new Date(e),Di[n],r).getTime()}function O$e(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 E$e(e,t,r,n,i,a){var o=1e4,s=H5e,l=0;function u(D,z,V,F,$,B,H){for(var U=O$e($,D),Z=z,Y=new Date(Z);Zo));)if(Y[$](Y[F]()+D),Z=Y.getTime(),a){var K=a.calcNiceTickMultiple(Z,U);K>0&&(Y[$](Y[F]()+K*D),Z=Y.getTime())}H.push({value:Z,notAdd:!0})}function c(D,z,V){var F=[],$=!z.length;if(!Pte(Pm(D),n[0],n[1],r)){$&&(z=[{value:I$e(n[0],D,r)},{value:n[1]}]);for(var B=0;B=n[0]&&H<=n[1]&&u(Z,H,U,Y,K,te,F),D==="year"&&V.length>1&&B===0&&V.unshift({value:V[0].value-Z})}}for(var B=0;B=n[0]&&S<=n[1]&&d++)}var T=i/t;if(d>T*1.5&&v>T/1.5||(f.push(_),d>T||e===s[m]))break}h=[]}}}for(var C=gt(le(f,function(D){return gt(D,function(z){return z.value>=n[0]&&z.value<=n[1]&&!z.notAdd})}),function(D){return D.length>0}),A=[],P=C.length-1,m=0;m0;)a*=10;var s=[IO(D$e(n[0]/a)*a),IO(N$e(n[1]/a)*a)];this._interval=a,this._intervalPrecision=r0(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=$_(r)/$_(this.base),e.prototype.contain.call(this,r)},t.prototype.normalize=function(r){return r=$_(r)/$_(this.base),e.prototype.normalize.call(this,r)},t.prototype.scale=function(r){return r=e.prototype.scale.call(this,r),z_(this.base,r)},t.prototype.setBreaksFromOption=function(r){var n=Rr();if(n){var i=n.logarithmicParseBreaksFromOption(r,this.base,xe(this.parse,this)),a=i.parsedOriginal,o=i.parsedLogged;this._originalScale._innerSetBreak(a),this._innerSetBreak(o)}},t.type="log",t}(dl);function F_(e,t){return IO(e,no(t))}qu.registerClass(kte);var j$e=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 h=this._determinedMin,d=this._determinedMax;return h!=null&&(s=h,u=!0),d!=null&&(l=d,c=!0),{min:s,max:l,minFixed:u,maxFixed:c,isBlank:f}},e.prototype.modifyDataMinMax=function(t,r){this[B$e[t]]=r},e.prototype.setDeterminedMinMax=function(t,r){var n=R$e[t];this[n]=r},e.prototype.freeze=function(){this.frozen=!0},e}(),R$e={min:"_determinedMin",max:"_determinedMax"},B$e={min:"_dataMin",max:"_dataMax"};function Lte(e,t,r){var n=e.rawExtentInfo;return n||(n=new j$e(e,t,r),e.rawExtentInfo=n,n)}function V_(e,t){return t==null?null:In(t)?NaN:e.parse(t)}function Ite(e,t){var r=e.type,n=Lte(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=bte("bar",o),l=!1;if(R(s,function(f){l=l||f.getBaseAxis()===t.axis}),l){var u=wte(s),c=z$e(i,a,t,u);i=c.min,a=c.max}}return{extent:[i,a],fixMin:n.minFixed,fixMax:n.maxFixed}}function z$e(e,t,r,n){var i=r.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=T$e(n,r.axis);if(o===void 0)return{min:e,max:t};var s=1/0;R(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;R(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,f=1-(s+l)/a,h=c/f-c;return t+=h*(l/u),e-=h*(s/u),{min:e,max:t}}function Rf(e,t){var r=t,n=Ite(e,r),i=n.extent,a=r.get("splitNumber");e instanceof kte&&(e.base=r.get("logBase"));var o=e.type,s=r.get("interval"),l=o==="interval"||o==="time";e.setBreaksFromOption(Ete(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 Y0(e,t){if(t=t||e.get("type"),t)switch(t){case"category":return new Av({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case"time":return new cR({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get("useUTC")});default:return new(qu.getClass(t)||dl)}}function $$e(e){var t=e.scale.getExtent(),r=t[0],n=t[1];return!(r>0&&n>0||r<0&&n<0)}function _p(e){var t=e.getLabelModel().get("formatter");if(e.type==="time"){var r=U5e(t);return function(i,a){return e.scale.getFormattedLabel(i,a,r)}}else{if(me(t))return function(i){var a=e.scale.getLabel(i),o=t.replace("{value}",a??"");return o};if(Pe(t)){if(e.type==="category")return function(i,a){return t(cS(e,i),i.value-e.scale.getExtent()[0],null)};var n=Rr();return function(i,a){var o=null;return n&&(o=n.makeAxisLabelFormatterParamBreak(o,i.break)),t(cS(e,i),a,o)}}else return function(i){return e.scale.getLabel(i)}}}function cS(e,t){return e.type==="category"?e.scale.getLabel(t):t.value}function fR(e){var t=e.get("interval");return t??"auto"}function Ote(e){return e.type==="category"&&fR(e.getLabelModel())===0}function fS(e,t){var r={};return R(e.mapDimensionsAll(t),function(n){r[sR(e,n)]=!0}),st(r)}function F$e(e,t,r){t&&R(fS(t,r),function(n){var i=t.getApproximateExtent(n);i[0]e[1]&&(e[1]=i[1])})}function Mv(e){return e==="middle"||e==="center"}function i0(e){return e.getShallow("show")}function Ete(e){var t=e.get("breaks",!0);if(t!=null)return!Rr()||!V$e(e.axis)?void 0:t}function V$e(e){return(e.dim==="x"||e.dim==="y"||e.dim==="z"||e.dim==="single")&&e.type!=="category"}var bp=function(){function e(){}return e.prototype.getNeedCrossZero=function(){var t=this.option;return!t.scale},e.prototype.getCoordSysModel=function(){},e}();function G$e(e){return vs(null,e)}var W$e={isDimensionStacked:hl,enableDataStack:yte,getStackedDimension:sR};function H$e(e,t){var r=t;t instanceof it||(r=new it(t));var n=Y0(r);return n.setExtent(e[0],e[1]),Rf(n,r),n}function U$e(e){br(e,bp)}function Z$e(e,t){return t=t||{},Nt(e,null,null,t.state!=="normal")}const Y$e=Object.freeze(Object.defineProperty({__proto__:null,createDimensions:i$e,createList:G$e,createScale:H$e,createSymbol:Lr,createTextStyle:Z$e,dataStack:W$e,enableHoverEmphasis:yu,getECData:Be,getLayoutRect:Zt,mixinAxisModelCommonMethods:U$e},Symbol.toStringTag,{value:"Module"}));var q$e=1e-8;function cG(e,t){return Math.abs(e-t)i&&(n=o,i=l)}if(n)return K$e(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 R(o,function(s){s.type==="polygon"?fG(s.exterior,i,a,r):R(s.points,function(l){fG(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 je(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 OO(e,t){return e=Q$e(e),le(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 hG(o[0],o.slice(1)));break;case"MultiPolygon":R(i.coordinates,function(l){l[0]&&a.push(new hG(l[0],l.slice(1)))});break;case"LineString":a.push(new dG([i.coordinates]));break;case"MultiLineString":a.push(new dG(i.coordinates))}var s=new Dte(n[t||"name"],a,n.cp);return s.properties=n,s})}const eFe=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:UI,asc:Vi,getPercentWithPrecision:xRe,getPixelPrecision:tj,getPrecision:no,getPrecisionSafe:OJ,isNumeric:ij,isRadianAroundZero:_v,linearMap:_t,nice:nj,numericToNumber:as,parseDate:hs,parsePercent:ge,quantile:$b,quantity:NJ,quantityExponent:hC,reformIntervals:ZI,remRadian:rj,round:Mr},Symbol.toStringTag,{value:"Module"})),tFe=Object.freeze(Object.defineProperty({__proto__:null,format:H0,parse:hs,roundTime:Jw},Symbol.toStringTag,{value:"Module"})),rFe=Object.freeze(Object.defineProperty({__proto__:null,Arc:V0,BezierCurve:up,BoundingRect:je,Circle:ds,CompoundPath:G0,Ellipse:F0,Group:Le,Image:un,IncrementalDisplayable:_Q,Line:Pr,LinearGradient:Xf,Polygon:jn,Polyline:xn,RadialGradient:mj,Rect:Qe,Ring:lp,Sector:Dn,Text:lt,clipPointsByRect:bj,clipRectByRect:CQ,createIcon:fp,extendPath:SQ,extendShape:wQ,getShapeClass:qy,getTransform:xu,initProps:Gt,makeImage:xj,makePath:wv,mergePath:zi,registerShape:Ra,resizePath:_j,updateProps:ft},Symbol.toStringTag,{value:"Module"})),nFe=Object.freeze(Object.defineProperty({__proto__:null,addCommas:jj,capitalFirst:tBe,encodeHTML:Zn,formatTime:eBe,formatTpl:Bj,getTextRect:J5e,getTooltipMarker:VQ,normalizeCssArray:vp,toCamelCase:Rj,truncateText:JRe},Symbol.toStringTag,{value:"Module"})),iFe=Object.freeze(Object.defineProperty({__proto__:null,bind:xe,clone:ke,curry:Ue,defaults:Oe,each:R,extend:ie,filter:gt,indexOf:Ze,inherits:ZD,isArray:oe,isFunction:Pe,isObject:Ee,isString:me,map:le,merge:qe,reduce:La},Symbol.toStringTag,{value:"Module"}));var aFe=rt(),Lm=rt(),mo={estimate:1,determine:2};function hS(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function Rte(e,t){var r=le(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 oFe(e,t){var r=e.getLabelModel().get("customValues");if(r){var n=_p(e),i=e.scale.getExtent(),a=Rte(e,r),o=gt(a,function(s){return s>=i[0]&&s<=i[1]});return{labels:le(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"?lFe(e,t):cFe(e)}function sFe(e,t,r){var n=e.getTickModel().get("customValues");if(n){var i=e.scale.getExtent(),a=Rte(e,n);return{ticks:gt(a,function(o){return o>=i[0]&&o<=i[1]})}}return e.type==="category"?uFe(e,t):{ticks:le(e.scale.getTicks(r),function(o){return o.value})}}function lFe(e,t){var r=e.getLabelModel(),n=Bte(e,r,t);return!r.get("show")||e.scale.isBlank()?{labels:[]}:n}function Bte(e,t,r){var n=hFe(e),i=fR(t),a=r.kind===mo.estimate;if(!a){var o=$te(n,i);if(o)return o}var s,l;Pe(i)?s=Gte(e,i):(l=i==="auto"?dFe(e,r):i,s=Vte(e,l));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return EO(n,i,u),!0}):EO(n,i,u),u}function uFe(e,t){var r=fFe(e),n=fR(t),i=$te(r,n);if(i)return i;var a,o;if((!t.get("show")||e.scale.isBlank())&&(a=[]),Pe(n))a=Gte(e,n,!0);else if(n==="auto"){var s=Bte(e,e.getLabelModel(),hS(mo.determine));o=s.labelCategoryInterval,a=le(s.labels,function(l){return l.tickValue})}else o=n,a=Vte(e,o,!0);return EO(r,n,{ticks:a,tickCategoryInterval:o})}function cFe(e){var t=e.scale.getTicks(),r=_p(e);return{labels:le(t,function(n,i){return{formattedLabel:r(n,i),rawLabel:e.scale.getLabel(n),tickValue:n.value,time:n.time,break:n.break}})}}var fFe=zte("axisTick"),hFe=zte("axisLabel");function zte(e){return function(r){return Lm(r)[e]||(Lm(r)[e]={list:[]})}}function $te(e,t){for(var r=0;rc&&(u=Math.max(1,Math.floor(l/c)));for(var f=s[0],h=e.dataToCoord(f+1)-e.dataToCoord(f),d=Math.abs(h*Math.cos(a)),v=Math.abs(h*Math.sin(a)),m=0,y=0;f<=s[1];f+=u){var x=0,_=0,b=cC(i({value:f}),n.font,"center","top");x=b.width*1.3,_=b.height*1.3,m=Math.max(m,x,7),y=Math.max(y,_,7)}var S=m/d,T=y/v;isNaN(S)&&(S=1/0),isNaN(T)&&(T=1/0);var C=Math.max(0,Math.floor(Math.min(S,T)));if(r===mo.estimate)return t.out.noPxChangeTryDetermine.push(xe(pFe,null,e,C,l)),C;var A=Fte(e,C,l);return A??C}function pFe(e,t,r){return Fte(e,t,r)==null}function Fte(e,t,r){var n=aFe(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 gFe(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 Vte(e,t,r){var n=_p(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 f=Ote(e),h=o.get("showMinLabel")||f,d=o.get("showMaxLabel")||f;h&&u!==a[0]&&m(a[0]);for(var v=u;v<=a[1];v+=l)m(v);d&&v-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 Gte(e,t,r){var n=e.scale,i=_p(e),a=[];return R(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 vG=[0,1],Ba=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 tj(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(),pG(n,i.count())),_t(t,vG,n,r)},e.prototype.coordToData=function(t,r){var n=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(n=n.slice(),pG(n,i.count()));var a=_t(t,n,vG,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=sFe(this,r,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}),i=n.ticks,a=le(i,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return mFe(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=le(n,function(a){return le(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},e.prototype.getViewLabels=function(t){return t=t||hS(mo.determine),oFe(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||hS(mo.determine),vFe(this,t)},e}();function pG(e,t){var r=e[1]-e[0],n=t,i=r/n/2;e[0]+=i,e[1]-=i}function mFe(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;R(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 f=a[0]>a[1];h(t[0].coord,a[0])&&(n?t[0].coord=a[0]:t.shift()),n&&h(a[0],t[0].coord)&&t.unshift({coord:a[0],onBand:!0}),h(a[1],o.coord)&&(n?o.coord=a[1]:t.pop()),n&&h(o.coord,a[1])&&t.push({coord:a[1],onBand:!0});function h(d,v){return d=Mr(d),v=Mr(v),f?d>v:di&&(i+=bg);var d=Math.atan2(s,o);if(d<0&&(d+=bg),d>=n&&d<=i||d+bg>=n&&d+bg<=i)return l[0]=c,l[1]=f,u-r;var v=r*Math.cos(n)+e,m=r*Math.sin(n)+t,y=r*Math.cos(i)+e,x=r*Math.sin(i)+t,_=(v-o)*(v-o)+(m-s)*(m-s),b=(y-o)*(y-o)+(x-s)*(x-s);return _0){t=t/180*Math.PI,io.fromArray(e[0]),Ft.fromArray(e[1]),Tr.fromArray(e[2]),De.sub(Ho,io,Ft),De.sub(zo,Tr,Ft);var r=Ho.len(),n=zo.len();if(!(r<.001||n<.001)){Ho.scale(1/r),zo.scale(1/n);var i=Ho.dot(zo),a=Math.cos(t);if(a1&&De.copy(ri,Tr),ri.toArray(e[1])}}}}function MFe(e,t,r){if(r<=180&&r>0){r=r/180*Math.PI,io.fromArray(e[0]),Ft.fromArray(e[1]),Tr.fromArray(e[2]),De.sub(Ho,Ft,io),De.sub(zo,Tr,Ft);var n=Ho.len(),i=zo.len();if(!(n<.001||i<.001)){Ho.scale(1/n),zo.scale(1/i);var a=Ho.dot(t),o=Math.cos(r);if(a=l)De.copy(ri,Tr);else{ri.scaleAndAdd(zo,s/Math.tan(Math.PI/2-c));var f=Tr.x!==Ft.x?(ri.x-Ft.x)/(Tr.x-Ft.x):(ri.y-Ft.y)/(Tr.y-Ft.y);if(isNaN(f))return;f<0?De.copy(ri,Ft):f>1&&De.copy(ri,Tr)}ri.toArray(e[1])}}}}function LM(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 PFe(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=Bs(n[0],n[1]),a=Bs(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=_m([],n[1],n[0],o/i),l=_m([],n[1],n[2],o/a),u=_m([],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(k*I,0,a);var E=k+A;E<0&&T(-E*I,1)}else T(-A*I,1)}}function S(A,P,I){A!==0&&(c=!0);for(var k=P;k0)for(var E=0;E0;E--){var V=I[E-1]*z;S(-V,E,a)}}}function C(A){var P=A<0?-1:1;A=Math.abs(A);for(var I=Math.ceil(A/(a-1)),k=0;k0?S(I,0,k+1):S(-I,a-k-1,a),A-=I,A<=0)return}return c}function IFe(e){for(var t=0;t=0&&n.attr(a.oldLayoutSelect),Ze(h,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),ft(n,u,r,l)}else if(n.attr(u),!hp(n).valueAnimation){var f=Ce(n.style.opacity,1);n.style.opacity=0,Gt(n,{style:{opacity:f}},r,l)}if(a.oldLayout=u,n.states.select){var d=a.oldLayoutSelect={};G_(d,u,W_),G_(d,n.states.select,W_)}if(n.states.emphasis){var v=a.oldLayoutEmphasis={};G_(v,u,W_),G_(v,n.states.emphasis,W_)}IQ(n,l,c,r,r)}if(i&&!i.ignore&&!i.invisible){var a=NFe(i),o=a.oldLayout,m={points:i.shape.points};o?(i.attr({shape:o}),ft(i,{shape:m},r)):(i.setShape(m),i.style.strokePercent=0,Gt(i,{style:{strokePercent:1}},r)),a.oldLayout=m}},e}(),EM=rt();function jFe(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){var i=EM(r).labelManager;i||(i=EM(r).labelManager=new DFe),i.clearLabels()}),e.registerUpdateLifecycle("series:layoutlabels",function(t,r,n){var i=EM(r).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var NM=Math.sin,DM=Math.cos,Xte=Math.PI,Cc=Math.PI*2,RFe=180/Xte,Kte=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,f=Math.abs(u),h=tu(f-Cc)||(c?u>=Cc:-u>=Cc),d=u>0?u%Cc:u%Cc+Cc,v=!1;h?v=!0:tu(f)?v=!1:v=d>=Xte==!!c;var m=t+n*DM(o),y=r+i*NM(o);this._start&&this._add("M",m,y);var x=Math.round(a*RFe);if(h){var _=1/this._p,b=(c?1:-1)*(Cc-_);this._add("A",n,i,x,1,+c,t+n*DM(o+b),r+i*NM(o+b)),_>.01&&this._add("A",n,i,x,0,+c,m,y)}else{var S=t+n*DM(s),T=r+i*NM(s);this._add("A",n,i,x,+v,+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=[],f=this._p,h=1;h"}function UFe(e){return""}function pR(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 HFe(o,s)+(o!=="style"?Zn(l):l||"")+(a?""+r+le(a,function(u){return n(u)}).join(r)+r:"")+UFe(o)}return n(e)}function ZFe(e,t,r){r=r||{};var n=r.newline?` -`:"",i=" {"+n,a=n+"}",o=le(st(e),function(l){return l+i+le(st(e[l]),function(u){return u+":"+e[l][u]+";"}).join(n)+a}).join(n),s=le(st(t),function(l){return"@keyframes "+l+i+le(st(t[l]),function(u){return u+i+le(st(t[l][u]),function(c){var f=t[l][u][c];return c==="d"&&(f='path("'+f+'")'),c+":"+f+";"}).join(n)+a}).join(n)+a}).join(n);return!o&&!s?"":[""].join(n)}function BO(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function bG(e,t,r,n){return nn("svg","root",{width:e,height:t,xmlns:Jte,"xmlns:xlink":Qte,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+e+" "+t:!1},r)}var YFe=0;function tre(){return YFe++}var wG={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"},Ec="transform-origin";function qFe(e,t,r){var n=ie({},e.shape);ie(n,t),e.buildPath(r,n);var i=new Kte;return i.reset(bJ(e)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function XFe(e,t){var r=t.originX,n=t.originY;(r||n)&&(e[Ec]=r+"px "+n+"px")}var KFe={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function rre(e,t){var r=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[r]=e,r}function JFe(e,t,r){var n=e.shape.paths,i={},a,o;if(R(n,function(l){var u=BO(r.zrId);u.animation=!0,OC(l,{},u,!0);var c=u.cssAnims,f=u.cssNodes,h=st(c),d=h.length;if(d){o=h[d-1];var v=c[o];for(var m in v){var y=v[m];i[m]=i[m]||{d:""},i[m].d+=y.d||""}for(var x in f){var _=f[x].animation;_.indexOf(o)>=0&&(a=_)}}}),!!a){t.d=!1;var s=rre(i,r);return a.replace(o,s)}}function SG(e){return me(e)?wG[e]?"cubic-bezier("+wG[e]+")":KD(e)?e:"":""}function OC(e,t,r,n){var i=e.animators,a=i.length,o=[];if(e instanceof G0){var s=JFe(e,t,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Ie=rre(A,r);return Ie+" "+_[0]+" both"}}for(var y in l){var s=m(l[y]);s&&o.push(s)}if(o.length){var x=r.zrId+"-cls-"+tre();r.cssNodes["."+x]={animation:o.join(",")},t.class=x}}function QFe(e,t,r){if(!e.ignore)if(e.isSilent()){var n={"pointer-events":"none"};TG(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=$w(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),TG(n,t,r)}}function TG(e,t,r,n){var i=JSON.stringify(e),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+tre(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=e),t.class=t.class?t.class+" "+a:a}var a0=Math.round;function nre(e){return e&&me(e.src)}function ire(e){return e&&Pe(e.toDataURL)}function gR(e,t,r,n){VFe(function(i,a){var o=i==="fill"||i==="stroke";o&&_J(a)?ore(t,e,i,n):o&&QD(a)?sre(r,e,i,n):e[i]=a,o&&n.ssr&&a==="none"&&(e["pointer-events"]="visible")},t,r,!1),oVe(r,e,n)}function mR(e,t){var r=kJ(t);r&&(r.each(function(n,i){n!=null&&(e[(_G+i).toLowerCase()]=n+"")}),t.isSilent()&&(e[_G+"silent"]="true"))}function CG(e){return tu(e[0]-1)&&tu(e[1])&&tu(e[2])&&tu(e[3]-1)}function eVe(e){return tu(e[4])&&tu(e[5])}function yR(e,t,r){if(t&&!(eVe(t)&&CG(t))){var n=1e4;e.transform=CG(t)?"translate("+a0(t[4]*n)/n+" "+a0(t[5]*n)/n+")":Dje(t)}}function AG(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.";Nn(h,y),Nn(d,y)}else if(h==null||d==null){var x=function(k,E){if(k){var N=k.elm,D=h||E.width,z=d||E.height;k.tag==="pattern"&&(u?(z=1,D/=a.width):c&&(D=1,z/=a.height)),k.attrs.width=D,k.attrs.height=z,N&&(N.setAttribute("width",D),N.setAttribute("height",z))}},_=lj(v,null,e,function(k){l||x(C,k),x(f,k)});_&&_.width&&_.height&&(h=h||_.width,d=d||_.height)}f=nn("image","img",{href:v,width:h,height:d}),o.width=h,o.height=d}else i.svgElement&&(f=ke(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(f){var b,S;l?b=S=1:u?(S=1,b=o.width/a.width):c?(b=1,S=o.height/a.height):o.patternUnits="userSpaceOnUse",b!=null&&!isNaN(b)&&(o.width=b),S!=null&&!isNaN(S)&&(o.height=S);var T=wJ(i);T&&(o.patternTransform=T);var C=nn("pattern","",o,[f]),A=pR(C),P=n.patternCache,I=P[A];I||(I=n.zrId+"-p"+n.patternIdx++,P[A]=I,o.id=I,C=n.defs[I]=nn("pattern",I,o,[f])),t[r]=uC(I)}}function sVe(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]=nn("clipPath",a,o,[are(e,r)])}t["clip-path"]=uC(a)}function kG(e){return document.createTextNode(e)}function $c(e,t,r){e.insertBefore(t,r)}function LG(e,t){e.removeChild(t)}function IG(e,t){e.appendChild(t)}function lre(e){return e.parentNode}function ure(e){return e.nextSibling}function jM(e,t){e.textContent=t}var OG=58,lVe=120,uVe=nn("","");function zO(e){return e===void 0}function Do(e){return e!==void 0}function cVe(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 Kg(e,t){var r=e.key===t.key,n=e.tag===t.tag;return n&&r}function o0(e){var t,r=e.children,n=e.tag;if(Do(n)){var i=e.elm=ere(n);if(xR(uVe,e),oe(r))for(t=0;ta?(v=r[l+1]==null?null:r[l+1].elm,cre(e,v,r,i,l)):mS(e,t,n,a))}function Kh(e,t){var r=t.elm=e.elm,n=e.children,i=t.children;e!==t&&(xR(e,t),zO(t.text)?Do(n)&&Do(i)?n!==i&&fVe(r,n,i):Do(i)?(Do(e.text)&&jM(r,""),cre(r,null,i,0,i.length-1)):Do(n)?mS(r,n,0,n.length-1):Do(e.text)&&jM(r,""):e.text!==t.text&&(Do(n)&&mS(r,n,0,n.length-1),jM(r,t.text)))}function hVe(e,t){if(Kg(e,t))Kh(e,t);else{var r=e.elm,n=lre(r);o0(t),n!==null&&($c(n,t.elm,ure(r)),mS(n,[e],0,0))}return t}var dVe=0,vVe=function(){function e(t,r,n){if(this.type="svg",this.refreshHover=EG(),this.configLayer=EG(),this.storage=r,this._opts=n=ie({},n),this.root=t,this._id="zr"+dVe++,this._oldVNode=bG(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=ere("svg");xR(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",hVe(this._oldVNode,t),this._oldVNode=t}},e.prototype.renderOneToVNode=function(t){return PG(t,BO(this._id))},e.prototype.renderToVNode=function(t){t=t||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=BO(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=pVe(n,i,this._backgroundColor,a);s&&o.push(s);var l=t.compress?null:this._mainVNode=nn("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=le(st(a.defs),function(h){return a.defs[h]});if(u.length&&o.push(nn("defs","defs",{},u)),t.animation){var c=ZFe(a.cssNodes,a.cssAnims,{newline:!0});if(c){var f=nn("style","stl",{},[],c);o.push(f)}}return bG(n,i,o,t.useViewBox)},e.prototype.renderToString=function(t){return t=t||{},pR(this.renderToVNode({animation:Ce(t.cssAnimation,!0),emphasis:Ce(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Ce(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&&!(h&&l&&h[m]===l[m]);m--);for(var y=v-1;y>m;y--)o--,s=a[o-1];for(var x=m+1;x=s)}}for(var f=this.__startIndex;f15)break}}z.prevElClipPaths&&x.restore()};if(_)if(_.length===0)P=y.__endIndex;else for(var k=d.dpr,E=0;E<_.length;++E){var N=_[E];x.save(),x.beginPath(),x.rect(N.x*k,N.y*k,N.width*k,N.height*k),x.clip(),I(N),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?H_:0),this._needsManuallyCompositing),c.__builtin__||iC("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&Bi&&!i.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(f,h){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__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,R(this._layers,function(r){r.setUnpainted()})},e.prototype.configLayer=function(t,r){if(r){var n=this._layerConfig;n[t]?qe(n[t],r,!0):n[t]=r;for(var i=0;i-1&&(u.style.stroke=u.style.fill,u.style.fill=J.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}(Lt);function Pv(e,t){var r=e.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=Tv(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 q0=function(e){X(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=Lr(r,-1,-1,2,2,null,s);l.attr({z2:Ce(o,100),culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),l.drift=SVe,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(){ul(this.childAt(0))},t.prototype.downplay=function(){cl(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,f=a&&a.disableAnimation;if(c){var h=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,r,n,l,u,h)}else{var d=this.childAt(0);d.silent=!1;var v={scaleX:l[0]/2,scaleY:l[1]/2};f?d.attr(v):ft(d,v,s,n),Ea(d)}if(this._updateCommon(r,n,l,i,a),c){var d=this.childAt(0);if(!f){var v={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,Gt(d,v,s,n)}}f&&this.childAt(0).stopAnimation("leave")},t.prototype._updateCommon=function(r,n,i,a,o){var s=this.childAt(0),l=r.hostModel,u,c,f,h,d,v,m,y,x;if(a&&(u=a.emphasisItemStyle,c=a.blurItemStyle,f=a.selectItemStyle,h=a.focus,d=a.blurScope,m=a.labelStatesModels,y=a.hoverScale,x=a.cursorStyle,v=a.emphasisDisabled),!a||r.hasItemOption){var _=a&&a.itemModel?a.itemModel:r.getItemModel(n),b=_.getModel("emphasis");u=b.getModel("itemStyle").getItemStyle(),f=_.getModel(["select","itemStyle"]).getItemStyle(),c=_.getModel(["blur","itemStyle"]).getItemStyle(),h=b.get("focus"),d=b.get("blurScope"),v=b.get("disabled"),m=qr(_),y=b.getShallow("scale"),x=_.getShallow("cursor")}var S=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(S||0)*Math.PI/180||0);var T=eh(r.getItemVisual(n,"symbolOffset"),i);T&&(s.x=T[0],s.y=T[1]),x&&s.attr("cursor",x);var C=r.getItemVisual(n,"style"),A=C.fill;if(s instanceof un){var P=s.style;s.useStyle(ie({image:P.image,x:P.x,y:P.y,width:P.width,height:P.height},C))}else s.__isEmptyBrush?s.useStyle(ie({},C)):s.useStyle(C),s.style.decal=null,s.setColor(A,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var I=r.getItemVisual(n,"liftZ"),k=this._z2;I!=null?k==null&&(this._z2=s.z2,s.z2+=I):k!=null&&(s.z2=k,this._z2=null);var E=o&&o.useNameLabel;sn(s,m,{labelFetcher:l,labelDataIndex:n,defaultText:N,inheritColor:A,defaultOpacity:C.opacity});function N(V){return E?r.getName(V):Pv(r,V)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var D=s.ensureState("emphasis");D.style=u,s.ensureState("select").style=f,s.ensureState("blur").style=c;var z=y==null||y===!0?Math.max(1.1,3/this._sizeY):isFinite(y)&&y>0?+y:1;D.scaleX=this._sizeX*z,D.scaleY=this._sizeY*z,this.setSymbolScale(1),Kt(this,h,d,v)},t.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},t.prototype.fadeOut=function(r,n,i){var a=this.childAt(0),o=Be(this).dataIndex,s=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&Lu(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();Lu(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},t.getSymbolSize=function(r,n){return yp(r.getItemVisual(n,"symbolSize"))},t.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},t}(Le);function SVe(e,t){this.parent.drift(e,t)}function BM(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 jG(e){return e!=null&&!Ee(e)&&(e={isIgnore:e}),e||{}}function RG(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:qr(t),cursorStyle:t.get("cursor")}}var X0=function(){function e(t){this.group=new Le,this._SymbolCtor=t||q0}return e.prototype.updateData=function(t,r){this._progressiveEls=null,r=jG(r);var n=this.group,i=t.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=RG(t),u={disableAnimation:s},c=r.getSymbolPoint||function(f){return t.getItemLayout(f)};a||n.removeAll(),t.diff(a).add(function(f){var h=c(f);if(BM(t,h,f,r)){var d=new o(t,f,l,u);d.setPosition(h),t.setItemGraphicEl(f,d),n.add(d)}}).update(function(f,h){var d=a.getItemGraphicEl(h),v=c(f);if(!BM(t,v,f,r)){n.remove(d);return}var m=t.getItemVisual(f,"symbol")||"circle",y=d&&d.getSymbolType&&d.getSymbolType();if(!d||y&&y!==m)n.remove(d),d=new o(t,f,l,u),d.setPosition(v);else{d.updateData(t,f,l,u);var x={x:v[0],y:v[1]};s?d.attr(x):ft(d,x,i)}n.add(d),t.setItemGraphicEl(f,d)}).remove(function(f){var h=a.getItemGraphicEl(f);h&&h.fadeOut(function(){n.remove(h)},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=RG(t),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r,n){this._progressiveEls=[],n=jG(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 dre(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 CVe(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 AVe(e,t,r,n,i,a,o,s){for(var l=CVe(e,t),u=[],c=[],f=[],h=[],d=[],v=[],m=[],y=hre(i,t,o),x=e.getLayout("points")||[],_=t.getLayout("points")||[],b=0;b=i||m<0)break;if(gf(x,_)){if(l){m+=a;continue}break}if(m===r)e[a>0?"moveTo":"lineTo"](x,_),f=x,h=_;else{var b=x-u,S=_-c;if(b*b+S*S<.5){m+=a;continue}if(o>0){for(var T=m+a,C=t[T*2],A=t[T*2+1];C===x&&A===_&&y=n||gf(C,A))d=x,v=_;else{k=C-u,E=A-c;var z=x-u,V=C-x,F=_-c,$=A-_,B=void 0,H=void 0;if(s==="x"){B=Math.abs(z),H=Math.abs(V);var U=k>0?1:-1;d=x-U*B*o,v=_,N=x+U*H*o,D=_}else if(s==="y"){B=Math.abs(F),H=Math.abs($);var Z=E>0?1:-1;d=x,v=_-Z*B*o,N=x,D=_+Z*H*o}else B=Math.sqrt(z*z+F*F),H=Math.sqrt(V*V+$*$),I=H/(H+B),d=x-k*o*(1-I),v=_-E*o*(1-I),N=x+k*o*I,D=_+E*o*I,N=Il(N,Ol(C,x)),D=Il(D,Ol(A,_)),N=Ol(N,Il(C,x)),D=Ol(D,Il(A,_)),k=N-x,E=D-_,d=x-k*B/H,v=_-E*B/H,d=Il(d,Ol(u,x)),v=Il(v,Ol(c,_)),d=Ol(d,Il(u,x)),v=Ol(v,Il(c,_)),k=x-d,E=_-v,N=x+k*H/B,D=_+E*H/B}e.bezierCurveTo(f,h,d,v,x,_),f=N,h=D}else e.lineTo(x,_)}u=x,c=_,m+=a}return y}var vre=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),MVe=function(e){X(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:J.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new vre},t.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&gf(i[o*2-2],i[o*2-1]);o--);for(;a=0){var S=u?(v-l)*b+l:(d-s)*b+s;return u?[r,S]:[S,r]}s=d,l=v;break;case o.C:d=a[f++],v=a[f++],m=a[f++],y=a[f++],x=a[f++],_=a[f++];var T=u?Bw(s,d,m,x,r,c):Bw(l,v,y,_,r,c);if(T>0)for(var C=0;C=0){var S=u?en(l,v,y,_,A):en(s,d,m,x,A);return u?[r,S]:[S,r]}}s=x,l=_;break}}},t}(at),PVe=function(e){X(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(vre),pre=function(e){X(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 PVe},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&&gf(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 IVe(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=le(a.stops,function(b){return{coord:l.toGlobalCoord(l.dataToCoord(b.value)),color:b.color}}),c=u.length,f=a.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),f.reverse());var h=LVe(u,i==="x"?r.getWidth():r.getHeight()),d=h.length;if(!d&&c)return u[0].coord<0?f[1]?f[1]:u[c-1].color:f[0]?f[0]:u[0].color;var v=10,m=h[0].coord-v,y=h[d-1].coord+v,x=y-m;if(x<.001)return"transparent";R(h,function(b){b.offset=(b.coord-m)/x}),h.push({offset:d?h[d-1].offset:.5,color:f[1]||"transparent"}),h.unshift({offset:d?h[0].offset:.5,color:f[0]||"transparent"});var _=new Xf(0,0,0,0,h,!0);return _[i]=m,_[i+"2"]=y,_}}}function OVe(e,t,r){var n=e.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&EVe(a,t))){var o=t.mapDimension(a.dim),s={};return R(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(t.get(o,l))}}}}function EVe(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 NVe(e,t){return isNaN(e)||isNaN(t)}function DVe(e){for(var t=e.length/2;t>0&&NVe(e[t*2-2],e[t*2-1]);t--);return t-1}function VG(e,t){return[e[t*2],e[t*2+1]]}function jVe(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 yre(e){if(e.get(["endLabel","show"]))return!0;for(var t=0;t0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var H=v.getState("emphasis").style;H.lineWidth=+v.style.lineWidth+1}Be(v).seriesIndex=r.seriesIndex,Kt(v,F,$,B);var U=FG(r.get("smooth")),Z=r.get("smoothMonotone");if(v.setShape({smooth:U,smoothMonotone:Z,connectNulls:A}),m){var Y=s.getCalculationInfo("stackedOnSeries"),K=0;m.useStyle(Oe(u.getAreaStyle(),{fill:N,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),Y&&(K=FG(Y.get("smooth"))),m.setShape({smooth:U,stackedOnSmooth:K,smoothMonotone:Z,connectNulls:A}),Yr(m,r,"areaStyle"),Be(m).seriesIndex=r.seriesIndex,Kt(m,F,$,B)}var te=this._changePolyState;s.eachItemGraphicEl(function(ce){ce&&(ce.onHoverStateChange=te)}),this._polyline.onHoverStateChange=te,this._data=s,this._coordSys=a,this._stackedOnPoints=T,this._points=c,this._step=k,this._valueOrigin=b,r.get("triggerLineEvent")&&(this.packEventData(r,v),m&&this.packEventData(r,m))},t.prototype.packEventData=function(r,n){Be(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=If(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],f=l[s*2+1];if(isNaN(c)||isNaN(f)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,f))return;var h=r.get("zlevel")||0,d=r.get("z")||0;u=new q0(o,s),u.x=c,u.y=f,u.setZ(h,d);var v=u.getSymbolPath().getTextContent();v&&(v.zlevel=h,v.z=d,v.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else At.prototype.highlight.call(this,r,n,i,a)},t.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=If(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 At.prototype.downplay.call(this,r,n,i,a)},t.prototype._changePolyState=function(r){var n=this._polygon;qw(this._polyline,r),n&&qw(n,r)},t.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new MVe({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 pre({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");Pe(c)&&(c=c(null));var f=u.get("animationDelay")||0,h=Pe(f)?f(null):f;r.eachItemGraphicEl(function(d,v){var m=d;if(m){var y=[d.x,d.y],x=void 0,_=void 0,b=void 0;if(i)if(o){var S=i,T=n.pointToCoord(y);a?(x=S.startAngle,_=S.endAngle,b=-T[1]/180*Math.PI):(x=S.r0,_=S.r,b=T[0])}else{var C=i;a?(x=C.x,_=C.x+C.width,b=d.x):(x=C.y+C.height,_=C.y,b=d.y)}var A=_===x?0:(b-x)/(_-x);l&&(A=1-A);var P=Pe(f)?f(v):c*A+h,I=m.getSymbolPath(),k=I.getTextContent();m.attr({scaleX:0,scaleY:0}),m.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:P}),k&&k.animateFrom({style:{opacity:0}},{duration:300,delay:P}),I.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(yre(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 lt({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var c=DVe(l);c>=0&&(sn(s,qr(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:c,defaultText:function(f,h,d){return d!=null?fre(o,d):Pv(o,f)},enableTextSetter:!0},RVe(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 f=i.getLayout("points"),h=i.hostModel,d=h.get("connectNulls"),v=s.get("precision"),m=s.get("distance")||0,y=l.getBaseAxis(),x=y.isHorizontal(),_=y.inverse,b=n.shape,S=_?x?b.x:b.y+b.height:x?b.x+b.width:b.y,T=(x?m:0)*(_?-1:1),C=(x?0:-m)*(_?-1:1),A=x?"x":"y",P=jVe(f,S,A),I=P.range,k=I[1]-I[0],E=void 0;if(k>=1){if(k>1&&!d){var N=VG(f,I[0]);u.attr({x:N[0]+T,y:N[1]+C}),o&&(E=h.getRawValue(I[0]))}else{var N=c.getPointOn(S,A);N&&u.attr({x:N[0]+T,y:N[1]+C});var D=h.getRawValue(I[0]),z=h.getRawValue(I[1]);o&&(E=GJ(i,v,D,z,P.t))}a.lastFrameIndex=I[0]}else{var V=r===1||a.lastFrameIndex>0?I[0]:0,N=VG(f,V);o&&(E=h.getRawValue(V)),u.attr({x:N[0]+T,y:N[1]+C})}if(o){var F=hp(u);typeof F.setLabelText=="function"&&F.setLabelText(E)}}},t.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,c=this._polygon,f=r.hostModel,h=AVe(this._data,r,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),d=h.current,v=h.stackedOnCurrent,m=h.next,y=h.stackedOnNext;if(o&&(v=El(h.stackedOnCurrent,h.current,i,o,l),d=El(h.current,null,i,o,l),y=El(h.stackedOnNext,h.next,i,o,l),m=El(h.next,null,i,o,l)),$G(d,m)>3e3||c&&$G(v,y)>3e3){u.stopAnimation(),u.setShape({points:m}),c&&(c.stopAnimation(),c.setShape({points:m,stackedOnPoints:y}));return}u.shape.__points=h.current,u.shape.points=d;var x={shape:{points:m}};h.current!==d&&(x.shape.__points=h.next),u.stopAnimation(),ft(u,x,f),c&&(c.setShape({points:d,stackedOnPoints:v}),c.stopAnimation(),ft(c,{shape:{stackedOnPoints:y}},f),u.shape.points!==c.shape.points&&(c.shape.points=u.shape.points));for(var _=[],b=h.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(),f=n.getDevicePixelRatio(),h=Math.abs(c[1]-c[0])*(f||1),d=Math.round(s/h);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 v=void 0;me(a)?v=zVe[a]:Pe(a)&&(v=a),v&&t.setData(i.downSample(i.mapDimension(u.dim),1/d,v,$Ve))}}}}}function FVe(e){e.registerChartView(BVe),e.registerSeriesModel(wVe),e.registerLayout(J0("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,xre("line"))}var s0=function(e){X(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 vs(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)R(a.getAxes(),function(h,d){if(h.type==="category"&&n!=null){var v=h.getTicksCoords(),m=h.getTickModel().get("alignWithLabel"),y=o[d],x=n[d]==="x1"||n[d]==="y1";if(x&&!m&&(y+=1),v.length<2)return;if(v.length===2){s[d]=h.toGlobalCoord(h.getExtent()[x?1:0]);return}for(var _=void 0,b=void 0,S=1,T=0;Ty){b=(C+_)/2;break}T===1&&(S=A-v[0].tickValue)}b==null&&(_?_&&(b=v[v.length-1].coord):b=v[0].coord),s[d]=h.toGlobalCoord(b)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),f=a.getBaseAxis().isHorizontal()?0:1;s[f]+=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}(Lt);Lt.registerClass(s0);var VVe=function(e){X(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 vs(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=Zu(s0.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:J.color.primary,borderWidth:2}},realtimeSort:!1}),t}(s0),GVe=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}(),yS=function(e){X(t,e);function t(r){var n=e.call(this,r)||this;return n.type="sausage",n}return t.prototype.getDefaultShape=function(){return new GVe},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,f=n.endAngle,h=n.clockwise,d=Math.PI*2,v=h?f-cMath.PI/2&&cs)return!0;s=f}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){qs(a,r,Be(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}(At),GG={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=$M(t.x,e.x),s=FM(t.x+t.width,i),l=$M(t.y,e.y),u=FM(t.y+t.height,a),c=si?s:o,t.y=f&&l>a?u:l,t.width=c?0:s-o,t.height=f?0:u-l,r<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height),c||f},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=FM(t.r,e.r),a=$M(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}},WG={cartesian2d:function(e,t,r,n,i,a,o,s,l){var u=new Qe({shape:ie({},n),z2:1});if(u.__dataIndex=r,u.name="item",a){var c=u.shape,f=i?"height":"width";c[f]=0}return u},polar:function(e,t,r,n,i,a,o,s,l){var u=!i&&l?yS:Dn,c=new u({shape:n,z2:1});c.name="item";var f=_re(i);if(c.calculateTextPosition=WVe(f,{isRoundCap:u===yS}),a){var h=c.shape,d=i?"r":"endAngle",v={};h[d]=i?n.r0:n.startAngle,v[d]=n[d],(s?ft:Gt)(c,{shape:v},a)}return c}};function YVe(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 HG(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?ft:Gt)(r,{shape:l},t,i,null);var c=t?e.baseAxis.model:null;(o?ft:Gt)(r,{shape:u},c,i)}function UG(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 KVe(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function _re(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 YG(e,t,r,n,i,a,o,s){var l=t.getItemVisual(r,"style");if(s){if(!a.get("roundCap")){var c=e.shape,f=Uo(n.getModel("itemStyle"),c,!0);ie(c,f),e.setShape(c)}}else{var u=n.get(["itemStyle","borderRadius"])||0;e.setShape("r",u)}e.useStyle(l);var h=n.getShallow("cursor");h&&e.attr("cursor",h);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",v=qr(n);sn(e,v,{labelFetcher:a,labelDataIndex:r,defaultText:Pv(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,HVe(e,y==="outside"?d:y,_re(o),n.get(["label","rotate"]))}LQ(m,v,a.getRawValue(r),function(_){return fre(t,_)});var x=n.getModel(["emphasis"]);Kt(e,x.get("focus"),x.get("blurScope"),x.get("disabled")),Yr(e,n),KVe(i)&&(e.style.fill="none",e.style.stroke="none",R(e.states,function(_){_.style&&(_.style.fill=_.style.stroke="none")}))}function JVe(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 QVe=function(){function e(){}return e}(),qG=function(e){X(t,e);function t(r){var n=e.call(this,r)||this;return n.type="largeBar",n}return t.prototype.getDefaultShape=function(){return new QVe},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 e6e(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,f=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 bre(e,t,r){if(Iu(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 t6e(e,t,r){var n=e.type==="polar"?Dn:Qe;return new n({shape:bre(t,r,e),silent:!0,z2:0})}function r6e(e){e.registerChartView(ZVe),e.registerSeriesModel(VVe),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Ue(Tte,"bar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Cte("bar")),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,xre("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 JG=Math.PI*2,q_=Math.PI/180;function n6e(e,t,r){t.eachSeriesByType(e,function(n){var i=n.getData(),a=i.mapDimension("value"),o=YQ(n,r),s=o.cx,l=o.cy,u=o.r,c=o.r0,f=o.viewRect,h=-n.get("startAngle")*q_,d=n.get("endAngle"),v=n.get("padAngle")*q_;d=d==="auto"?h-JG:-d*q_;var m=n.get("minAngle")*q_,y=m+v,x=0;i.each(a,function($){!isNaN($)&&x++});var _=i.getSum(a),b=Math.PI/(_||x)*2,S=n.get("clockwise"),T=n.get("roseType"),C=n.get("stillShowZeroSum"),A=i.getDataExtent(a);A[0]=0;var P=S?1:-1,I=[h,d],k=P*v/2;mC(I,!S),h=I[0],d=I[1];var E=wre(n);E.startAngle=h,E.endAngle=d,E.clockwise=S,E.cx=s,E.cy=l,E.r=u,E.r0=c;var N=Math.abs(d-h),D=N,z=0,V=h;if(i.setLayout({viewRect:f,r:u}),i.each(a,function($,B){var H;if(isNaN($)){i.setItemLayout(B,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:S,cx:s,cy:l,r0:c,r:T?NaN:u});return}T!=="area"?H=_===0&&C?b:$*b:H=N/x,HH?(Z=V+P*H/2,Y=Z):(Z=V+k,Y=U-k),i.setItemLayout(B,{angle:H,startAngle:Z,endAngle:Y,clockwise:S,cx:s,cy:l,r0:c,r:T?_t($,A,[c,u]):u}),V=U}),Dr?x:y,T=Math.abs(b.label.y-r);if(T>=S.maxY){var C=b.label.x-t-b.len2*i,A=n+b.len,P=Math.abs(C)e.unconstrainedWidth?null:h:null;n.setStyle("width",d)}Tre(a,n)}}}function Tre(e,t){eW.rect=e,Yte(eW,t,o6e)}var o6e={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},eW={};function VM(e){return e.position==="center"}function s6e(e){var t=e.getData(),r=[],n,i,a=!1,o=(e.get("minShowLabelAngle")||0)*i6e,s=t.getLayout("viewRect"),l=t.getLayout("r"),u=s.width,c=s.x,f=s.y,h=s.height;function d(C){C.ignore=!0}function v(C){if(!C.ignore)return!0;for(var A in C.states)if(C.states[A].ignore===!1)return!0;return!1}t.each(function(C){var A=t.getItemGraphicEl(C),P=A.shape,I=A.getTextContent(),k=A.getTextGuideLine(),E=t.getItemModel(C),N=E.getModel("label"),D=N.get("position")||E.get(["emphasis","label","position"]),z=N.get("distanceToLabelLine"),V=N.get("alignTo"),F=ge(N.get("edgeDistance"),u),$=N.get("bleedMargin");$==null&&($=Math.min(u,h)>200?10:2);var B=E.getModel("labelLine"),H=B.get("length");H=ge(H,u);var U=B.get("length2");if(U=ge(U,u),Math.abs(P.endAngle-P.startAngle)0?"right":"left":Y>0?"left":"right"}var We=Math.PI,Ye=0,ht=N.get("rotate");if(ut(ht))Ye=ht*(We/180);else if(D==="center")Ye=0;else if(ht==="radial"||ht===!0){var Rt=Y<0?-Z+We:-Z;Ye=Rt}else if(ht==="tangential"&&D!=="outside"&&D!=="outer"){var Jt=Math.atan2(Y,K);Jt<0&&(Jt=We*2+Jt);var cn=K>0;cn&&(Jt=We+Jt),Ye=Jt-We}if(a=!!Ye,I.x=te,I.y=ce,I.rotation=Ye,I.setStyle({verticalAlign:"middle"}),ye){I.setStyle({align:Ie});var Rn=I.states.select;Rn&&(Rn.x+=I.x,Rn.y+=I.y)}else{var Ir=new je(0,0,0,0);Tre(Ir,I),r.push({label:I,labelLine:k,position:D,len:H,len2:U,minTurnAngle:B.get("minTurnAngle"),maxSurfaceAngle:B.get("maxSurfaceAngle"),surfaceNormal:new De(Y,K),linePoints:de,textAlign:Ie,labelDistance:z,labelAlignTo:V,edgeDistance:F,bleedMargin:$,rect:Ir,unconstrainedWidth:Ir.width,labelStyleWidth:I.style.width})}A.setTextConfig({inside:ye})}}),!a&&e.get("avoidLabelOverlap")&&a6e(r,n,i,l,u,h,c,f);for(var m=0;m0){for(var c=o.getItemLayout(0),f=1;isNaN(c&&c.startAngle)&&f=a.r0}},t.type="pie",t}(At);function Sp(e,t,r){t=oe(t)&&{coordDimensions:t}||ie({encodeDefine:e.getEncode()},t);var n=e.getSource(),i=xp(n,t).dimensions,a=new qn(i,e);return a.initData(n,r),a}var Tp=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}(),c6e=rt(),Cre=function(e){X(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 Tp(xe(this.getData,this),xe(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return Sp(this,{coordDimensions:["value"],encodeDefaulter:Ue($j,this)})},t.prototype.getDataParams=function(r){var n=this.getData(),i=c6e(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=EJ(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){Lf(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}(Lt);nBe({fullType:Cre.type,getCoord2:function(e){return e.getShallow("center")}});function f6e(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!(ut(o)&&!isNaN(o)&&o<0)})}}}function h6e(e){e.registerChartView(u6e),e.registerSeriesModel(Cre),zee("pie",e.registerAction),e.registerLayout(Ue(n6e,"pie")),e.registerProcessor(wp("pie")),e.registerProcessor(f6e("pie"))}var d6e=function(e){X(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 vs(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:J.color.primary}},universalTransition:{divideShape:"clone"}},t}(Lt),Are=4,v6e=function(){function e(){}return e}(),p6e=function(e){X(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 v6e},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,f=a[c]-s/2,h=a[c+1]-l/2;if(r>=f&&n>=h&&r<=f+s&&n<=h+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,f=-1/0,h=0;h=0&&(u.dataIndex=f+(t.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),m6e=function(e){X(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=J0("").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 g6e:new X0,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}(At),Mre={left:0,right:0,top:0,bottom:0},xS=["25%","25%"],y6e=function(e){X(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(r,n){var i=Jf(r.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&ss(r.outerBounds,i)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&ss(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:Mre,outerBoundsContain:"all",outerBoundsClampWidth:xS[0],outerBoundsClampHeight:xS[1],backgroundColor:J.color.transparent,borderWidth:1,borderColor:J.color.neutral30},t}(tt),FO=function(e){X(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",ur).models[0]},t.type="cartesian2dAxis",t}(tt);br(FO,bp);var Pre={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:J.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:J.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:J.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[J.color.backgroundTint,J.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:J.color.neutral00,borderColor:J.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},x6e=qe({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},Pre),_R=qe({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:J.color.axisMinorSplitLine,width:1}}},Pre),_6e=qe({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},_R),b6e=Oe({logBase:10},_R);const kre={category:x6e,value:_R,time:_6e,log:b6e};var w6e={value:1,category:1,time:1,log:1},VO=null;function S6e(e){VO||(VO=e)}function Q0(){return VO}function kv(e,t,r,n){R(w6e,function(i,a){var o=qe(qe({},kre[a],!0),n,!0),s=function(l){X(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,f){var h=Ky(this),d=h?Jf(c):{},v=f.getTheme();qe(c,v.get(a+"Axis")),qe(c,this.getDefaultOption()),c.type=tW(c),h&&ss(c,d,h)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=n0.createByAxisModel(this))},u.prototype.getCategories=function(c){var f=this.option;if(f.type==="category")return c?f.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.prototype.updateAxisBreaks=function(c){var f=Q0();return f?f.updateModelAxisBreak(this,c):{breaks:[]}},u.type=t+"Axis."+a,u.defaultOption=o,u}(r);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+"Axis",tW)}function tW(e){return e.type||(e.data?"category":"value")}var T6e=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 le(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}(),GO=["x","y"];function rW(e){return(e.type==="interval"||e.type==="time")&&!e.hasBreaks()}var C6e=function(e){X(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=GO,r}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!rW(r)||!rW(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,f=(s[1]-o[1])/u,h=o[0]-i[0]*c,d=o[1]-a[0]*f,v=this._transform=[c,0,0,f,h,d];this._invTransform=Ia([],v)}}},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 je(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 xr(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 xr(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 je(a,o,s,l)},t}(T6e),Lre=function(e){X(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}(Ba),EC="expandAxisBreak",Ire="collapseAxisBreak",Ore="toggleAxisBreak",bR="axisbreakchanged",A6e={type:EC,event:bR,update:"update",refineEvent:wR},M6e={type:Ire,event:bR,update:"update",refineEvent:wR},P6e={type:Ore,event:bR,update:"update",refineEvent:wR};function wR(e,t,r,n){var i=[];return R(e,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function k6e(e){e.registerAction(A6e,t),e.registerAction(M6e,t),e.registerAction(P6e,t);function t(r,n){var i=[],a=Dd(n,r);function o(s,l){R(a[s],function(u){var c=u.updateAxisBreaks(r);R(c.breaks,function(f){var h;i.push(Oe((h={},h[l]=u.componentIndex,h),f))})})}return o("xAxisModels","xAxisIndex"),o("yAxisModels","yAxisIndex"),o("singleAxisModels","singleAxisIndex"),{eventBreaks:i}}}var ru=Math.PI,L6e=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],I6e=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],Lv=rt(),Ere=rt(),Nre=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 O6e(e,t,r,n){var i=r.axis,a=t.ensureRecord(r),o=[],s,l=SR(e.axisName)&&Mv(e.nameLocation);R(n,function(v){var m=ls(v);if(!(!m||m.label.ignore)){o.push(m);var y=a.transGroup;l&&(y.transform?Ia(wg,y.transform):R0(wg),m.transform&&so(wg,wg,m.transform),je.copy(X_,m.localRect),X_.applyTransform(wg),s?s.union(X_):je.copy(s=new je(0,0,0,0),X_))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",c=a.transGroup[u];if(o.sort(function(v,m){return Math.abs(v.label[u]-c)-Math.abs(m.label[u]-c)}),l&&s){var f=i.getExtent(),h=Math.min(f[0],f[1]),d=Math.max(f[0],f[1])-h;s.union(new je(h,0,d,1))}a.stOccupiedRect=s,a.labelInfoList=o}var wg=an(),X_=new je(0,0,0,0),Dre=function(e,t,r,n,i,a){if(Mv(e.nameLocation)){var o=a.stOccupiedRect;o&&jre(LFe({},o,a.transGroup.transform),n,i)}else Rre(a.labelInfoList,a.dirVec,n,i)};function jre(e,t,r){var n=new De;IC(e,t,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&NO(t,n)}function Rre(e,t,r,n){for(var i=De.dot(n,t)>=0,a=0,o=e.length;a0?"top":"bottom",a="center"):_v(i-ru)?(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}(),E6e=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],N6e={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],f=[l[1],0],h=c[0]>f[0];u&&(xr(c,c,u),xr(f,f,u));var d=ie({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),v={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:d};if(n.get(["axisLine","breakLine"])&&n.axis.scale.hasBreaks())Q0().buildAxisBreakLine(n,i,a,v);else{var m=new Pr(ie({shape:{x1:c[0],y1:c[1],x2:f[0],y2:f[1]}},v));Sv(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"]);me(y)&&(y=[y,y]),(me(x)||ut(x))&&(x=[x,x]);var _=eh(n.get(["axisLine","symbolOffset"])||0,x),b=x[0],S=x[1];R([{rotate:e.rotation+Math.PI/2,offset:_[0],r:0},{rotate:e.rotation-Math.PI/2,offset:_[1],r:Math.sqrt((c[0]-f[0])*(c[0]-f[0])+(c[1]-f[1])*(c[1]-f[1]))}],function(T,C){if(y[C]!=="none"&&y[C]!=null){var A=Lr(y[C],-b/2,-S/2,b,S,d.stroke,!0),P=T.r+T.offset,I=h?f: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=iW(t,i,s);l&&nW(e,t,r,n,i,a,o,mo.estimate)},axisTickLabelDetermine:function(e,t,r,n,i,a,o,s){var l=iW(t,i,s);l&&nW(e,t,r,n,i,a,o,mo.determine);var u=B6e(e,i,a,n);R6e(e,t.labelLayoutList,u),z6e(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(SR(u)){var c=e.nameLocation,f=e.nameDirection,h=n.getModel("nameTextStyle"),d=n.get("nameGap")||0,v=n.axis.getExtent(),m=n.axis.inverse?-1:1,y=new De(0,0),x=new De(0,0);c==="start"?(y.x=v[0]-m*d,x.x=-m):c==="end"?(y.x=v[1]+m*d,x.x=m):(y.x=(v[0]+v[1])/2,y.y=e.labelOffset+f*d,x.y=f);var _=an();x.transform(xl(_,_,e.rotation));var b=n.get("nameRotate");b!=null&&(b=b*ru/180);var S,T;Mv(c)?S=ai.innerTextLayout(e.rotation,b??e.rotation,f):(S=D6e(e.rotation,c,b||0,v),T=e.raw.axisNameAvailableWidth,T!=null&&(T=Math.abs(T/Math.sin(S.rotation)),!isFinite(T)&&(T=null)));var C=h.getFont(),A=n.get("nameTruncate",!0)||{},P=A.ellipsis,I=mn(e.raw.nameTruncateMaxWidth,A.maxWidth,T),k=s.nameMarginLevel||0,E=new lt({x:y.x,y:y.y,rotation:S.rotation,silent:ai.isLabelSilent(n),style:Nt(h,{text:u,font:C,overflow:"truncate",width:I,ellipsis:P,fill:h.getTextColor()||n.get(["axisLine","lineStyle","color"]),align:h.get("align")||S.textAlign,verticalAlign:h.get("verticalAlign")||S.textVerticalAlign}),z2:1});if(bl({el:E,componentModel:n,itemName:u}),E.__fullText=u,E.anid="name",n.get("triggerEvent")){var N=ai.makeAxisEventDataBase(n);N.targetType="axisName",N.name=u,Be(E).eventData=N}a.add(E),E.updateTransform(),t.nameEl=E;var D=l.nameLayout=ls({label:E,priority:E.z2,defaultAttr:{ignore:E.ignore},marginDefault:Mv(c)?L6e[k]:I6e[k]});if(l.nameLocation=c,i.add(E),E.decomposeTransform(),e.shouldNameMoveOverlap&&D){var z=r.ensureRecord(n);r.resolveAxisNameOverlap(e,r,n,D,x,z)}}}};function nW(e,t,r,n,i,a,o,s){zre(t)||$6e(e,t,i,s,n,o);var l=t.labelLayoutList;F6e(e,n,l,a),W6e(n,e.rotation,l);var u=e.optionHideOverlap;j6e(n,l,u),u&&qte(gt(l,function(c){return c&&!c.label.ignore})),O6e(e,r,n,l)}function D6e(e,t,r,n){var i=rj(r-e),a,o,s=n[0]>n[1],l=t==="start"&&!s||t!=="start"&&s;return _v(i-ru/2)?(o=l?"bottom":"top",a="center"):_v(i-ru*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iru/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function j6e(e,t,r){if(Ote(e.axis))return;function n(s,l,u){var c=ls(t[l]),f=ls(t[u]);if(!(!c||!f)){if(s===!1||c.suggestIgnore){Jg(c.label);return}if(f.suggestIgnore){Jg(f.label);return}var h=.1;if(!r){var d=[0,0,0,0];c=DO({marginForce:d},c),f=DO({marginForce:d},f)}IC(c,f,null,{touchThreshold:h})&&Jg(s?f.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 R6e(e,t,r){e.showMinorTicks||R(t,function(n){if(n&&n.label.ignore)for(var i=0;iu[0]&&isFinite(v)&&isFinite(u[0]);)d=MM(d),v=u[1]-d*o;else{var y=e.getTicks().length-1;y>o&&(d=MM(d));var x=d*o;m=Math.ceil(u[1]/d)*d,v=Mr(m-x),v<0&&u[0]>=0?(v=0,m=Mr(x)):m>0&&u[1]<=0&&(m=0,v=-Mr(x))}var _=(i[0].value-a[0].value)/s,b=(i[o].value-a[o].value)/s;n.setExtent.call(e,v+d*_,m+d*b),n.setInterval.call(e,d),(_||b)&&n.setNiceExtent.call(e,v+d,m-d)}var oW=[[3,1],[0,2]],Y6e=function(){function e(t,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=GO,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=st(o),u=l.length;if(u){for(var c=[],f=u-1;f>=0;f--){var h=+l[f],d=o[h],v=d.model,m=d.scale;PO(m)&&v.get("alignTicks")&&v.get("interval")==null?c.push(d):(Rf(m,v),PO(m)&&(s=d))}c.length&&(s||(s=c.pop(),Rf(s.scale,s.model)),R(c,function(y){$re(y.scale,y.model,s.scale)}))}}i(n.x),i(n.y);var a={};R(n.x,function(o){sW(n,"y",o,a)}),R(n.y,function(o){sW(n,"x",o,a)}),this.resize(this.model,r)},e.prototype.resize=function(t,r,n){var i=Xr(t,r),a=this._rect=Zt(t.getBoxLayoutParams(),i.refContainer),o=this._axesMap,s=this._coordsList,l=t.get("containLabel");if(HO(o,a),!n){var u=K6e(a,s,o,l,r),c=void 0;if(l)UO?(UO(this._axesList,a),HO(o,a)):c=cW(a.clone(),"axisLabel",null,a,o,u,i);else{var f=J6e(t,a,i),h=f.outerBoundsRect,d=f.parsedOuterBoundsContain,v=f.outerBoundsClamp;h&&(c=cW(h,d,v,a,o,u,i))}Fre(a,o,mo.determine,null,c,i)}R(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]}Ee(t)&&(r=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,a=this._coordsList;i0})==null;return Nf(n,s,!0,!0,r),HO(i,n),l;function u(h){R(i[Ve[h]],function(d){if(i0(d.model)){var v=a.ensureRecord(d.model),m=v.labelInfoList;if(m)for(var y=0;y0&&!In(d)&&d>1e-4&&(h/=d),h}}function K6e(e,t,r,n,i){var a=new Nre(Q6e);return R(r,function(o){return R(o,function(s){if(i0(s.model)){var l=!n;s.axisBuilder=U6e(e,t,s.model,i,a,l)}})}),a}function Fre(e,t,r,n,i,a){var o=r===mo.determine;R(t,function(u){return R(u,function(c){i0(c.model)&&(Z6e(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[Ve[1-u]]=e[Br[u]]<=a.refContainer[Br[u]]*.5?0:1-u===1?2:1}R(t,function(u,c){return R(u,function(f){i0(f.model)&&((n==="all"||o)&&f.axisBuilder.build({axisName:!0},{nameMarginLevel:s[c]}),o&&f.axisBuilder.build({axisLine:!0}))})})}function J6e(e,t,r){var n,i=e.get("outerBoundsMode",!0);i==="same"?n=t.clone():(i==null||i==="auto")&&(n=Zt(e.get("outerBounds",!0)||Mre,r.refContainer));var a=e.get("outerBoundsContain",!0),o;a==null||a==="auto"||Ze(["all","axisLabel"],a)<0?o="all":o=a;var s=[Hw(Ce(e.get("outerBoundsClampWidth",!0),xS[0]),t.width),Hw(Ce(e.get("outerBoundsClampHeight",!0),xS[1]),t.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var Q6e=function(e,t,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";Dre(e,t,r,n,i,a),Mv(e.nameLocation)||R(t.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&Rre(s.labelInfoList,s.dirVec,n,i)})};function eGe(e,t){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return tGe(r,e,t),r.seriesInvolved&&nGe(r,e),r}function tGe(e,t,r){var n=t.getComponent("tooltip"),i=t.getComponent("axisPointer"),a=i.get("link",!0)||[],o=[];R(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=l0(s.model),u=e.coordSysAxesInfo[l]={};e.coordSysMap[l]=s;var c=s.model,f=c.getModel("tooltip",n);if(R(s.getAxes(),Ue(m,!1,null)),s.getTooltipAxes&&n&&f.get("show")){var h=f.get("trigger")==="axis",d=f.get(["axisPointer","type"])==="cross",v=s.getTooltipAxes(f.get(["axisPointer","axis"]));(h||d)&&R(v.baseAxes,Ue(m,d?"cross":!0,h)),d&&R(v.otherAxes,Ue(m,"cross",!1))}function m(y,x,_){var b=_.model.getModel("axisPointer",i),S=b.get("show");if(!(!S||S==="auto"&&!y&&!ZO(b))){x==null&&(x=b.get("triggerTooltip")),b=y?rGe(_,f,i,t,y,x):b;var T=b.get("snap"),C=b.get("triggerEmphasis"),A=l0(_.model),P=x||T||_.type==="category",I=e.axesInfo[A]={key:A,axis:_,coordSys:s,axisPointerModel:b,triggerTooltip:x,triggerEmphasis:C,involveSeries:P,snap:T,useHandle:ZO(b),seriesModels:[],linkGroup:null};u[A]=I,e.seriesInvolved=e.seriesInvolved||P;var k=iGe(a,_);if(k!=null){var E=o[k]||(o[k]={axesInfo:{}});E.axesInfo[A]=I,E.mapper=a[k].mapper,I.linkGroup=E}}}})}function rGe(e,t,r,n,i,a){var o=t.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};R(s,function(h){l[h]=ke(o.get(h))}),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 f=l.lineStyle=o.get("crossStyle");f&&Oe(u,f.textStyle)}}return e.model.getModel("axisPointer",new it(l,r,n))}function nGe(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||R(e.coordSysAxesInfo[l0(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 iGe(e,t){for(var r=t.model,n=t.dim,i=0;i=0||e===t}function aGe(e){var t=TR(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=ZO(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 hGe=rt();function dW(e,t,r,n){if(e instanceof Lre){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?Zre(r,o,u,n):dGe(e,t,r,n,o,l):r}function Zre(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 dGe(e,t,r,n,i,a){var o=hGe(e);o.items||(o.items=[]);var s=o.items,l=vW(s,t,r,n,i,a,1),u=vW(s,t,r,n,i,a,-1),c=Math.abs(l-r)i/2||f&&h>f/2-n?Zre(r,i,f,n):(s.push({fixedCoord:t,floatCoord:c,r:n}),c)}function vW(e,t,r,n,i,a,o){for(var s=r,l=0;li/2)return Number.MAX_VALUE;if(o===1&&v>s||o===-1&&v0&&!v.min?v.min=0:v.min!=null&&v.min<0&&!v.max&&(v.max=0);var m=l;v.color!=null&&(m=Oe({color:v.color},l));var y=qe(ke(v),{boundaryGap:r,splitNumber:n,scale:i,axisLine:a,axisTick:o,axisLabel:s,name:v.text,showName:u,nameLocation:"end",nameGap:f,nameTextStyle:m,triggerEvent:h},!1);if(me(c)){var x=y.name;y.name=c.replace("{value}",x??"")}else Pe(c)&&(y.name=c(y.name,y));var _=new it(y,null,this.ecModel);return br(_,bp.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:J.color.axisLabel},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:qe({lineStyle:{color:J.color.neutral20}},Sg.axisLine),axisLabel:K_(Sg.axisLabel,!1),axisTick:K_(Sg.axisTick,!1),splitLine:K_(Sg.splitLine,!0),splitArea:K_(Sg.splitArea,!0),indicator:[]},t}(tt),wGe=function(e){X(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=le(a,function(s){var l=s.model.get("showName")?s.name:"",u=new ai(s.model,n,{axisName:l,position:[i.cx,i.cy],rotation:s.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return u});R(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"),f=s.get("show"),h=l.get("color"),d=u.get("color"),v=oe(h)?h:[h],m=oe(d)?d:[d],y=[],x=[];function _(V,F,$){var B=$%F.length;return V[B]=V[B]||[],B}if(a==="circle")for(var b=i[0].getTicksCoords(),S=n.cx,T=n.cy,C=0;C3?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 f=Math.abs(a),h=(a>0?1:-1)*(f>3?.4:f>1?.15:.05);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:h,originX:s,originY:l,isAvailableBehavior:null})}}}},t.prototype._pinchHandler=function(r){if(!(mW(this._zr,"globalPan")||Tg(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)&&(ll(a.event),a.__ecRoamConsumed=!0,yW(r,n,i,a,o))},t}(ja);function Tg(e){return e.__ecRoamConsumed}var LGe=rt();function NC(e){var t=LGe(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function Cg(e,t,r,n){for(var i=NC(e),a=i.roam,o=a[t]=a[t]||[],s=0;s=4&&(c={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(c&&s!=null&&l!=null&&(f=Qre(c,{x:0,y:0,width:s,height:l}),!r.ignoreViewBox)){var d=i;i=new Le,i.add(d),d.scaleX=d.scaleY=f.scale,d.x=f.x,d.y=f.y}return!r.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new Qe({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:c,viewBoxTransform:f,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=HM[s];if(c&&we(HM,s)){l=c.call(this,t,r);var f=t.getAttribute("name");if(f){var h={name:f,namedFrom:null,svgNodeTagLower:s,el:l};n.push(h),s==="g"&&(u=h)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});r.add(l)}}var d=wW[s];if(d&&we(wW,s)){var v=d.call(this,t),m=t.getAttribute("id");m&&(this._defs[m]=v)}}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 bv({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});sa(r,n),Li(t,n,this._defsUsePending,!1,!1),NGe(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(){HM={g:function(t,r){var n=new Le;return sa(r,n),Li(t,n,this._defsUsePending,!1,!1),n},rect:function(t,r){var n=new Qe;return sa(r,n),Li(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 ds;return sa(r,n),Li(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 Pr;return sa(r,n),Li(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 F0;return sa(r,n),Li(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=CW(n));var a=new jn({shape:{points:i||[]},silent:!0});return sa(r,a),Li(t,a,this._defsUsePending,!1,!1),a},polyline:function(t,r){var n=t.getAttribute("points"),i;n&&(i=CW(n));var a=new xn({shape:{points:i||[]},silent:!0});return sa(r,a),Li(t,a,this._defsUsePending,!1,!1),a},image:function(t,r){var n=new un;return sa(r,n),Li(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 Le;return sa(r,s),Li(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 Le;return sa(r,s),Li(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=pQ(n);return sa(r,i),Li(t,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),e}(),wW={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 Xf(t,r,n,i);return SW(e,a),TW(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 mj(t,r,n);return SW(e,i),TW(e,i),i}};function SW(e,t){var r=e.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(t.global=!0)}function TW(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={};Jre(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]*=Zs(s),o=Ca(l,"rgba"))}t.colorStops.push({offset:i,color:o})}r=r.nextSibling}}function sa(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),Oe(t.__inheritedStyle,e.__inheritedStyle))}function CW(e){for(var t=jC(e),r=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=jC(o);switch(i=i||an(),s){case"translate":po(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":lC(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":xl(i,i,-parseFloat(l[0])*UM,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*UM);so(i,[1,0,u,1,0,0],i);break;case"skewY":var c=Math.tan(parseFloat(l[0])*UM);so(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 MW=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Jre(e,t,r){var n=e.getAttribute("style");if(n){MW.lastIndex=0;for(var i;(i=MW.exec(n))!=null;){var a=i[1],o=we(bS,a)?bS[a]:null;o&&(t[o]=i[2]);var s=we(wS,a)?wS[a]:null;s&&(r[s]=i[2])}}}function $Ge(e,t,r){for(var n=0;n<_W.length;n++){var i=_W[n],a=e.getAttribute(i);a!=null&&(t[bS[i]]=a)}for(var n=0;n0,_={api:n,geo:l,mapOrGeoModel:t,data:s,isVisualEncodedByVisualMap:x,isGeo:o,transformInfoRaw:h};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=Se(),n=Se(),i=this._regionsGroup,a=t.transformInfoRaw,o=t.mapOrGeoModel,s=t.data,l=t.geo.projection,u=l&&l.stream;function c(d,v){return v&&(d=v(d)),d&&[d[0]*a.scaleX+a.x,d[1]*a.scaleY+a.y]}function f(d){for(var v=[],m=!u&&l&&l.project,y=0;y=0)&&(h=i);var d=o?{normal:{align:"center",verticalAlign:"middle"}}:null;sn(t,qr(n),{labelFetcher:h,labelDataIndex:f,defaultText:r},d);var v=t.getTextContent();if(v&&(ene(v).ignore=v.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 OW(e,t,r,n,i,a){e.data?e.data.setItemGraphicEl(a,t):Be(t).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:r,region:n&&n.option||{}}}function EW(e,t,r,n,i){e.data||bl({el:t,componentModel:i,itemName:r,itemTooltipOption:n.get("tooltip")})}function NW(e,t,r,n,i){t.highDownSilentOnTouch=!!i.get("selectedMode");var a=n.getModel("emphasis"),o=a.get("focus");return Kt(t,o,a.get("blurScope"),a.get("disabled")),e.isGeo&&q3e(t,i,r),o}function DW(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(),R(e,function(l){s.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill=J.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:J.color.tertiary},itemStyle:{borderWidth:.5,borderColor:J.color.border,areaColor:J.color.background},emphasis:{label:{show:!0,color:J.color.primary},itemStyle:{areaColor:J.color.highlight}},select:{label:{show:!0,color:J.color.primary},itemStyle:{color:J.color.highlight}},nameProperty:"name"},t}(Lt);function oWe(e,t){var r={};return R(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?(b.width=_,b.height=_/m):(b.height=_,b.width=_*m),b.y=x[1]-b.height/2,b.x=x[0]-b.width/2;else{var S=e.getBoxLayoutParams();S.aspect=m,b=Zt(S,v),b=qQ(e,b,m)}this.setViewRect(b.x,b.y,b.width,b.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function cWe(e,t){R(t.get("geoCoord"),function(r,n){e.addGeoCoord(n,r)})}var fWe=function(){function e(){this.dimensions=rne}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 XO(l+s,l,ie({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=zW,u.resize(o,r)}),t.eachSeries(function(o){U0({targetModel:o,coordSysType:"geo",coordSysProvider:function(){var s=o.subType==="map"?o.getHostGeoModel():o.getReferringComponents("geo",ur).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)}}),R(a,function(o,s){var l=le(o,function(c){return c.get("nameMap")}),u=new XO(s,s,ie({nameMap:aC(l),api:r,ecModel:t},i(o[0])));u.zoomLimit=mn.apply(null,le(o,function(c){return c.get("scaleLimit")})),n.push(u),u.resize=zW,u.resize(o[0],r),R(o,function(c){c.coordinateSystem=u,cWe(u,c)})}),n},e.prototype.getFilledRegions=function(t,r,n,i){for(var a=(t||[]).slice(),o=Se(),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 mWe(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){xWe(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=_We(e,i,e.parentNode.hierNode.defaultAncestor||n[0],t)}function yWe(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function $W(e){return arguments.length?e:SWe}function Qg(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function xWe(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 _We(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,f=s.hierNode.modifier;s=ZM(s),a=YM(a),s&&a;){i=ZM(i),o=YM(o),i.hierNode.ancestor=e;var h=s.hierNode.prelim+f-a.hierNode.prelim-u+n(s,a);h>0&&(wWe(bWe(s,e,r),e,h),u+=h,l+=h),f+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,c+=o.hierNode.modifier}s&&!ZM(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=f-l),a&&!YM(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,r=e)}return r}function ZM(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function YM(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function bWe(e,t,r){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:r}function wWe(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 SWe(e,t){return e.parentNode===t.parentNode?1:2}var TWe=function(){function e(){this.parentPoint=[],this.childPoints=[]}return e}(),CWe=function(e){X(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultStyle=function(){return{stroke:J.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new TWe},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,f=1-c,h=ge(n.forkPosition,1),d=[];d[c]=o[c],d[f]=o[f]+(l[f]-o[f])*h,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 v=1;v_.x,T||(S=S-Math.PI));var A=T?"left":"right",P=s.getModel("label"),I=P.get("rotate"),k=I*(Math.PI/180),E=y.getTextContent();E&&(y.setTextConfig({position:P.get("position")||A,rotation:I==null?-S:k,origin:"center"}),E.setStyle("verticalAlign","middle"))}var N=s.get(["emphasis","focus"]),D=N==="relative"?mv(o.getAncestorsIndices(),o.getDescendantIndices()):N==="ancestor"?o.getAncestorsIndices():N==="descendant"?o.getDescendantIndices():null;D&&(Be(r).focus=D),MWe(i,o,c,r,v,d,m,n),r.__edge&&(r.onHoverStateChange=function(z){if(z!=="blur"){var V=o.parentNode&&e.getItemGraphicEl(o.parentNode.dataIndex);V&&V.hoverState===$0||qw(r.__edge,z)}})}function MWe(e,t,r,n,i,a,o,s){var l=t.getModel(),u=e.get("edgeShape"),c=e.get("layout"),f=e.getOrient(),h=e.get(["lineStyle","curveness"]),d=e.get("edgeForkPosition"),v=l.getModel("lineStyle").getLineStyle(),m=n.__edge;if(u==="curve")t.parentNode&&t.parentNode!==r&&(m||(m=n.__edge=new up({shape:KO(c,f,h,i,i)})),ft(m,{shape:KO(c,f,h,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(me(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 lne(e){for(var t=[];e;)e=e.parentNode,e&&t.push(e);return t.reverse()}function OR(e,t){var r=lne(e);return Ze(r,t)>=0}function RC(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 jWe=function(e){X(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 it(i,this,this.ecModel),o=IR.createTree(n,this,s);function s(f){f.wrapMethod("getItemModel",function(h,d){var v=o.getNodeByDataIndex(d);return v&&v.children.length&&v.isExpand||(h.parentModel=a),h})}var l=0;o.eachNode("preorder",function(f){f.depth>l&&(l=f.depth)});var u=r.expandAndCollapse,c=u&&r.initialTreeDepth>=0?r.initialTreeDepth:l;return o.root.eachNode("preorder",function(f){var h=f.hostTree.data.getRawDataItem(f.dataIndex);f.isExpand=h&&h.collapsed!=null?!h.collapsed:f.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 zr("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=RC(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:J.color.borderTint,width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},t}(Lt);function RWe(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 BWe(e,t){e.eachSeriesByType("tree",function(r){zWe(r,t)})}function zWe(e,t){var r=Xr(e,t).refContainer,n=Zt(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=$W(function(S,T){return(S.parentNode===T.parentNode?1:2)/S.depth})):(a=n.width,o=n.height,s=$W());var l=e.getData().tree.root,u=l.children[0];if(u){gWe(l),RWe(u,mWe,s),l.hierNode.modifier=-u.hierNode.prelim,Pg(u,yWe);var c=u,f=u,h=u;Pg(u,function(S){var T=S.getLayout().x;Tf.getLayout().x&&(f=S),S.depth>h.depth&&(h=S)});var d=c===f?1:s(c,f)/2,v=d-c.getLayout().x,m=0,y=0,x=0,_=0;if(i==="radial")m=a/(f.getLayout().x+d+v),y=o/(h.depth-1||1),Pg(u,function(S){x=(S.getLayout().x+v)*m,_=(S.depth-1)*y;var T=Qg(x,_);S.setLayout({x:T.x,y:T.y,rawX:x,rawY:_},!0)});else{var b=e.getOrient();b==="RL"||b==="LR"?(y=o/(f.getLayout().x+d+v),m=a/(h.depth-1||1),Pg(u,function(S){_=(S.getLayout().x+v)*y,x=b==="LR"?(S.depth-1)*m:a-(S.depth-1)*m,S.setLayout({x,y:_},!0)})):(b==="TB"||b==="BT")&&(m=a/(f.getLayout().x+d+v),y=o/(h.depth-1||1),Pg(u,function(S){x=(S.getLayout().x+v)*m,_=b==="TB"?(S.depth-1)*y:o-(S.depth-1)*y,S.setLayout({x,y:_},!0)}))}}}function $We(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");ie(s,o)})})}function FWe(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=DC(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}function VWe(e){e.registerChartView(AWe),e.registerSeriesModel(jWe),e.registerLayout(BWe),e.registerVisual($We),FWe(e)}var HW=["treemapZoomToNode","treemapRender","treemapMove"];function GWe(e){for(var t=0;t1;)a=a.parentNode;var o=vO(e.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var WWe=function(e){X(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};cne(i);var a=r.levels||[],o=this.designatedVisualItemStyle={},s=new it({itemStyle:o},this,n);a=r.levels=HWe(a,n);var l=le(a||[],function(f){return new it(f,s,n)},this),u=IR.createTree(i,this,c);function c(f){f.wrapMethod("getItemModel",function(h,d){var v=u.getNodeByDataIndex(d),m=v?l[v.depth]:null;return h.parentModel=m||s,h})}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 zr("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=RC(i,this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(r){this.layoutInfo=this.layoutInfo||{},ie(this.layoutInfo,r)},t.prototype.mapIdToIndex=function(r){var n=this._idIndexMap;n||(n=this._idIndexMap=Se(),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(){une(this)},t.type="series.treemap",t.layoutMode="box",t.defaultOption={progressive:0,coordinateSystemUsage:"box",left:J.size.l,top:J.size.xxxl,right:J.size.l,bottom:J.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:J.size.m,emptyItemWidth:25,itemStyle:{color:J.color.backgroundShade,textStyle:{color:J.color.secondary}},emphasis:{itemStyle:{color:J.color.background}}},label:{show:!0,distance:0,padding:5,position:"inside",color:J.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:J.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}(Lt);function cne(e){var t=0;R(e.children,function(n){cne(n);var i=n.value;oe(i)&&(i=i[0]),t+=i});var r=e.value;oe(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),oe(e.value)?e.value[0]=r:e.value=r}function HWe(e,t){var r=Dt(t.get("color")),n=Dt(t.get(["aria","decal","decals"]));if(r){e=e||[];var i,a;R(e,function(s){var l=new it(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 UWe=8,UW=8,qM=5,ZWe=function(){function e(t){this.group=new Le,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"]),f=Xr(t,r).refContainer,h={left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},d={emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]},v=Zt(h,f);this._prepare(n,d,u),this._renderContent(t,d,v,s,l,u,c,i),TC(o,h,f)}},e.prototype._prepare=function(t,r,n){for(var i=t;i;i=i.parentNode){var a=Hr(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+UWe*2,r.emptyItemWidth);r.totalWidth+=s+UW,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,f=t.get(["breadcrumb","height"]),h=r.totalWidth,d=r.renderList,v=a.getModel("itemStyle").getItemStyle(),m=d.length-1;m>=0;m--){var y=d[m],x=y.node,_=y.width,b=y.text;h>n.width&&(h-=_-c,_=c,b=null);var S=new jn({shape:{points:YWe(u,0,_,f,m===d.length-1,m===0)},style:Oe(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new lt({style:Nt(o,{text:b})}),textConfig:{position:"inside"},z2:sp*1e4,onclick:Ue(l,x)});S.disableLabelAnimation=!0,S.getTextContent().ensureState("emphasis").style=Nt(s,{text:b}),S.ensureState("emphasis").style=v,Kt(S,a.get("focus"),a.get("blurScope"),a.get("disabled")),this.group.add(S),qWe(S,t,x),u+=_+UW}},e.prototype.remove=function(){this.group.removeAll()},e}();function YWe(e,t,r,n,i,a){var o=[[i?e:e-qM,t],[e+r,t],[e+r,t+n],[i?e:e-qM,t+n]];return!a&&o.splice(2,0,[e+r+qM,t+n/2]),!i&&o.push([e,t+n/2]),o}function qWe(e,t,r){Be(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&&RC(r,t)}}var XWe=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;iYW||Math.abs(r.dy)>YW)){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 je(s.x,s.y,s.width,s.height),u=null,c=this._controllerHost;u=c.zoomLimit;var f=c.zoom=c.zoom||1;if(f*=a,u){var h=u.min||0,d=u.max||1/0;f=Math.max(Math.min(d,f),h)}var v=f/c.zoom;c.zoom=f;var m=this.seriesModel.layoutInfo;n-=m.x,i-=m.y;var y=an();po(y,y,[-n,-i]),lC(y,y,[v,v]),po(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&&Qw(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 ZWe(this.group))).render(r,n,i.node,function(o){a._state!=="animating"&&(OR(r.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=kg(),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}(At);function kg(){return{nodeGroup:[],background:[],content:[]}}function r8e(e,t,r,n,i,a,o,s,l,u){if(!o)return;var c=o.getLayout(),f=e.getData(),h=o.getModel();if(f.setItemGraphicEl(o.dataIndex,null),!c||!c.isInView)return;var d=c.width,v=c.height,m=c.borderWidth,y=c.invisible,x=o.getRawIndex(),_=s&&s.getRawIndex(),b=o.viewChildren,S=c.upperHeight,T=b&&b.length,C=h.getModel("itemStyle"),A=h.getModel(["emphasis","itemStyle"]),P=h.getModel(["blur","itemStyle"]),I=h.getModel(["select","itemStyle"]),k=C.get("borderRadius")||0,E=ce("nodeGroup",JO);if(!E)return;if(l.add(E),E.x=c.x||0,E.y=c.y||0,E.markRedraw(),SS(E).nodeWidth=d,SS(E).nodeHeight=v,c.isAboveViewRoot)return E;var N=ce("background",ZW,u,QWe);N&&U(E,N,T&&c.upperLabelHeight);var D=h.getModel("emphasis"),z=D.get("focus"),V=D.get("blurScope"),F=D.get("disabled"),$=z==="ancestor"?o.getAncestorsIndices():z==="descendant"?o.getDescendantIndices():z;if(T)Yy(E)&&ef(E,!1),N&&(ef(N,!F),f.setItemGraphicEl(o.dataIndex,N),nO(N,$,V));else{var B=ce("content",ZW,u,e8e);B&&Z(E,B),N.disableMorphing=!0,N&&Yy(N)&&ef(N,!1),ef(E,!F),f.setItemGraphicEl(o.dataIndex,E);var H=h.getShallow("cursor");H&&B.attr("cursor",H),nO(E,$,V)}return E;function U(ye,ne,ve){var ue=Be(ne);if(ue.dataIndex=o.dataIndex,ue.seriesIndex=e.seriesIndex,ne.setShape({x:0,y:0,width:d,height:v,r:k}),y)Y(ne);else{ne.invisible=!1;var ee=o.getVisual("style"),Ge=ee.stroke,Ae=KW(C);Ae.fill=Ge;var We=Dc(A);We.fill=A.get("borderColor");var Ye=Dc(P);Ye.fill=P.get("borderColor");var ht=Dc(I);if(ht.fill=I.get("borderColor"),ve){var Rt=d-2*m;K(ne,Ge,ee.opacity,{x:m,y:0,width:Rt,height:S})}else ne.removeTextContent();ne.setStyle(Ae),ne.ensureState("emphasis").style=We,ne.ensureState("blur").style=Ye,ne.ensureState("select").style=ht,Ef(ne)}ye.add(ne)}function Z(ye,ne){var ve=Be(ne);ve.dataIndex=o.dataIndex,ve.seriesIndex=e.seriesIndex;var ue=Math.max(d-2*m,0),ee=Math.max(v-2*m,0);if(ne.culling=!0,ne.setShape({x:m,y:m,width:ue,height:ee,r:k}),y)Y(ne);else{ne.invisible=!1;var Ge=o.getVisual("style"),Ae=Ge.fill,We=KW(C);We.fill=Ae,We.decal=Ge.decal;var Ye=Dc(A),ht=Dc(P),Rt=Dc(I);K(ne,Ae,Ge.opacity,null),ne.setStyle(We),ne.ensureState("emphasis").style=Ye,ne.ensureState("blur").style=ht,ne.ensureState("select").style=Rt,Ef(ne)}ye.add(ne)}function Y(ye){!ye.invisible&&a.push(ye)}function K(ye,ne,ve,ue){var ee=h.getModel(ue?XW:qW),Ge=Hr(h.get("name"),null),Ae=ee.getShallow("show");sn(ye,qr(h,ue?XW:qW),{defaultText:Ae?Ge:null,inheritColor:ne,defaultOpacity:ve,labelFetcher:e,labelDataIndex:o.dataIndex});var We=ye.getTextContent();if(We){var Ye=We.style,ht=D0(Ye.padding||0);ue&&(ye.setTextConfig({layoutRect:ue}),We.disableLabelLayout=!0),We.beforeUpdate=function(){var Jt=Math.max((ue?ue.width:ye.shape.width)-ht[1]-ht[3],0),cn=Math.max((ue?ue.height:ye.shape.height)-ht[0]-ht[2],0);(Ye.width!==Jt||Ye.height!==cn)&&We.setStyle({width:Jt,height:cn})},Ye.truncateMinChar=2,Ye.lineOverflow="truncate",te(Ye,ue,c);var Rt=We.getState("emphasis");te(Rt?Rt.style:null,ue,c)}}function te(ye,ne,ve){var ue=ye?ye.text:null;if(!ne&&ve.isLeafRoot&&ue!=null){var ee=e.get("drillDownIcon",!0);ye.text=ee?ee+" "+ue:ue}}function ce(ye,ne,ve,ue){var ee=_!=null&&r[ye][_],Ge=i[ye];return ee?(r[ye][_]=null,de(Ge,ee)):y||(ee=new ne,ee instanceof Oa&&(ee.z2=n8e(ve,ue)),Ie(Ge,ee)),t[ye][x]=ee}function de(ye,ne){var ve=ye[x]={};ne instanceof JO?(ve.oldX=ne.x,ve.oldY=ne.y):ve.oldShape=ie({},ne.shape)}function Ie(ye,ne){var ve=ye[x]={},ue=o.parentNode,ee=ne instanceof Le;if(ue&&(!n||n.direction==="drillDown")){var Ge=0,Ae=0,We=i.background[ue.getRawIndex()];!n&&We&&We.oldShape&&(Ge=We.oldShape.width,Ae=We.oldShape.height),ee?(ve.oldX=0,ve.oldY=Ae):ve.oldShape={x:Ge,y:Ae,width:0,height:0}}ve.fadein=!ee}}function n8e(e,t){return e*JWe+t}var c0=R,i8e=Ee,TS=-1,on=function(){function e(t){var r=t.mappingMethod,n=t.type,i=this.option=ke(t);this.type=n,this.mappingMethod=r,this._normalizeData=s8e[r];var a=e.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(XM(i),a8e(i)):r==="category"?i.categories?o8e(i):XM(i,!0):(Nn(r!=="linear"||i.dataExtent),XM(i))}return e.prototype.mapValueToVisual=function(t){var r=this._normalizeData(t);return this._normalizedToVisual(r,t)},e.prototype.getNormalizer=function(){return xe(this._normalizeData,this)},e.listVisualTypes=function(){return st(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(t,r,n){Ee(t)?R(t,r,n):r.call(n,t)},e.mapVisual=function(t,r,n){var i,a=oe(t)?[]:Ee(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&&c0(e.visualHandlers,function(i,a){t.hasOwnProperty(a)&&(r[a]=t[a],n=!0)}),n?r:null},e.prepareVisualTypes=function(t){if(oe(t))t=t.slice();else if(i8e(t)){var r=[];c0(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 XM(e,t){var r=e.visual,n=[];Ee(r)?c0(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]),fne(e,n)}function Q_(e){return{applyVisual:function(t,r,n){var i=this.mapValueToVisual(t);n("color",e(r("color"),i))},_normalizedToVisual:QO([0,1])}}function JW(e){var t=this.option.visual;return t[Math.round(_t(e,[0,1],[0,t.length-1],!0))]||{}}function Lg(e){return function(t,r,n){n(e,this.mapValueToVisual(t))}}function em(e){var t=this.option.visual;return t[this.option.loop&&e!==TS?e%t.length:e]}function jc(){return this.option.visual[0]}function QO(e){return{linear:function(t){return _t(t,e,this.option.visual,!0)},category:em,piecewise:function(t,r){var n=eE.call(this,r);return n==null&&(n=_t(t,e,this.option.visual,!0)),n},fixed:jc}}function eE(e){var t=this.option,r=t.pieceList;if(t.hasSpecialVisual){var n=on.findPieceIndex(e,r),i=r[n];if(i&&i.visual)return i.visual[this.type]}}function fne(e,t){return e.visual=t,e.type==="color"&&(e.parsedVisual=le(t,function(r){var n=Yn(r);return n||[0,0,0,1]})),t}var s8e={linear:function(e){return _t(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,r=on.findPieceIndex(e,t,!0);if(r!=null)return _t(r,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return t??TS},fixed:yr};function eb(e,t,r){return e?t<=r:t=r.length||m===r[m.depth]){var x=d8e(i,l,m,y,v,n);dne(m,x,r,n)}})}}}function c8e(e,t,r){var n=ie({},t),i=r.designatedVisualItemStyle;return R(["color","colorAlpha","colorSaturation"],function(a){i[a]=t[a];var o=e.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function QW(e){var t=KM(e,"color");if(t){var r=KM(e,"colorAlpha"),n=KM(e,"colorSaturation");return n&&(t=Ys(t,null,null,n)),r&&(t=Gy(t,r)),t}}function f8e(e,t){return t!=null?Ys(t,null,null,e):null}function KM(e,t){var r=e[t];if(r!=null&&r!=="none")return r}function h8e(e,t,r,n,i,a){if(!(!a||!a.length)){var o=JM(t,"color")||i.color!=null&&i.color!=="none"&&(JM(t,"colorAlpha")||JM(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"),f={type:o.name,dataExtent:u,visual:o.range};f.type==="color"&&(c==="index"||c==="id")?(f.mappingMethod="category",f.loop=!0):f.mappingMethod="linear";var h=new on(f);return hne(h).drColorMappingBy=c,h}}}function JM(e,t){var r=e.get(t);return oe(r)&&r.length?{name:t,range:r}:null}function d8e(e,t,r,n,i,a){var o=ie({},t);if(i){var s=i.type,l=s==="color"&&hne(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 f0=Math.max,CS=Math.min,e8=mn,ER=R,vne=["itemStyle","borderWidth"],v8e=["itemStyle","gapWidth"],p8e=["upperLabel","show"],g8e=["upperLabel","height"];const m8e={seriesType:"treemap",reset:function(e,t,r,n){var i=e.option,a=Xr(e,r).refContainer,o=Zt(e.getBoxLayoutParams(),a),s=i.size||[],l=ge(e8(o.width,s[0]),a.width),u=ge(e8(o.height,s[1]),a.height),c=n&&n.type,f=["treemapZoomToNode","treemapRootToNode"],h=u0(n,f,e),d=c==="treemapRender"||c==="treemapMove"?n.rootRect:null,v=e.getViewRoot(),m=lne(v);if(c!=="treemapMove"){var y=c==="treemapZoomToNode"?S8e(e,h,v,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};v.hostTree.clearLayouts();var b={x:0,y:0,width:y[0],height:y[1],area:y[0]*y[1]};v.setLayout(b),pne(v,_,!1,0),b=v.getLayout(),ER(m,function(T,C){var A=(m[C+1]||v).getValue();T.setLayout(ie({dataExtent:[A,A],borderWidth:0,upperHeight:0},b))})}var S=e.getData().tree.root;S.setLayout(T8e(o,d,h),!0),e.setLayoutInfo(o),gne(S,new je(-o.x,-o.y,r.getWidth(),r.getHeight()),m,v,0)}};function pne(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(vne),u=s.get(v8e)/2,c=mne(s),f=Math.max(l,c),h=l-u,d=f-u;e.setLayout({borderWidth:l,upperHeight:f,upperLabelHeight:c},!0),i=f0(i-2*h,0),a=f0(a-h-d,0);var v=i*a,m=y8e(e,s,v,t,r,n);if(m.length){var y={x:h,y:d,width:i,height:a},x=CS(i,a),_=1/0,b=[];b.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 w8e(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?f0(u*n/l,l/(u*i)):1/0}function t8(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 f=0,h=e.length;fUI&&(u=UI),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]);f[0].8?"left":h[0]<-.8?"right":"center",m=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":a.x=-h[0]*x+c[0],a.y=-h[1]*_+c[1],v=h[0]>.8?"right":h[0]<-.8?"left":"center",m=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=x*A+c[0],a.y=c[1]+I,v=S[0]<0?"right":"left",a.originX=-x*A,a.originY=-I;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=C[0],a.y=C[1]+I,v="center",a.originY=-I;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-x*A+f[0],a.y=f[1]+I,v=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||v})}},t}(Le),BR=function(){function e(t){this.group=new Le,this._LineCtor=t||RR}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=s8(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=s8(t),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(t,r){this._progressiveEls=[];function n(s){!s.isGroup&&!F8e(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var i=t.start;i0}function s8(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:qr(t)}}function l8(e){return isNaN(e[0])||isNaN(e[1])}function nP(e){return e&&!l8(e[0])&&!l8(e[1])}var iP=[],aP=[],oP=[],zh=gn,sP=pu,u8=Math.abs;function c8(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){iP[0]=zh(n[0],i[0],a[0],c),iP[1]=zh(n[1],i[1],a[1],c);var f=u8(sP(iP,t)-l);f=0?s=s+u:s=s-u:v>=0?s=s-u:s=s+u}return s}function lP(e,t){var r=[],n=Fy,i=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge(function(s,l){var u=s.getLayout(),c=s.getVisual("fromSymbol"),f=s.getVisual("toSymbol");u.__original||(u.__original=[Ko(u[0]),Ko(u[1])],u[2]&&u.__original.push(Ko(u[2])));var h=u.__original;if(u[2]!=null){if(Gn(i[0],h[0]),Gn(i[1],h[2]),Gn(i[2],h[1]),c&&c!=="none"){var d=rm(s.node1),v=c8(i,h[0],d*t);n(i[0][0],i[1][0],i[2][0],v,r),i[0][0]=r[3],i[1][0]=r[4],n(i[0][1],i[1][1],i[2][1],v,r),i[0][1]=r[3],i[1][1]=r[4]}if(f&&f!=="none"){var d=rm(s.node2),v=c8(i,h[1],d*t);n(i[0][0],i[1][0],i[2][0],v,r),i[1][0]=r[1],i[2][0]=r[2],n(i[0][1],i[1][1],i[2][1],v,r),i[1][1]=r[1],i[2][1]=r[2]}Gn(u[0],i[0]),Gn(u[1],i[2]),Gn(u[2],i[1])}else{if(Gn(a[0],h[0]),Gn(a[1],h[1]),Jl(o,a[1],a[0]),qf(o,o),c&&c!=="none"){var d=rm(s.node1);Ew(a[0],a[0],o,d*t)}if(f&&f!=="none"){var d=rm(s.node2);Ew(a[1],a[1],o,-d*t)}Gn(u[0],a[0]),Gn(u[1],a[1])}})}var Tne=rt();function V8e(e){if(e)return Tne(e).bridge}function f8(e,t){e&&(Tne(e).bridge=t)}function h8(e){return e.type==="view"}var G8e=function(e){X(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 X0,a=new BR,o=this.group,s=new Le;this._controller=new rh(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(h8(o)){var f={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?this._mainGroup.attr(f):ft(this._mainGroup,f,r)}lP(r.getGraph(),tm(r));var h=r.getData();u.updateData(h);var d=r.getEdgeData();c.updateData(d),this._updateNodeAndLinkScale(),this._updateController(null,r,i),clearTimeout(this._layoutTimeout);var v=r.forceLayout,m=r.get(["force","layoutAnimation"]);v&&(s=!0,this._startForceLayoutIteration(v,i,m));var y=r.get("layout");h.graph.eachNode(function(S){var T=S.dataIndex,C=S.getGraphicEl(),A=S.getModel();if(C){C.off("drag").off("dragend");var P=A.get("draggable");P&&C.on("drag",function(k){switch(y){case"force":v.warmUp(),!a._layouting&&a._startForceLayoutIteration(v,i,m),v.setFixed(T),h.setItemLayout(T,[C.x,C.y]);break;case"circular":h.setItemLayout(T,[C.x,C.y]),S.setLayout({fixed:!0},!0),jR(r,"symbolSize",S,[k.offsetX,k.offsetY]),a.updateLayout(r);break;case"none":default:h.setItemLayout(T,[C.x,C.y]),DR(r.getGraph(),r),a.updateLayout(r);break}}).on("dragend",function(){v&&v.setUnfixed(T)}),C.setDraggable(P,!!A.get("cursor"));var I=A.get(["emphasis","focus"]);I==="adjacency"&&(Be(C).focus=S.getAdjacentDataIndices())}}),h.graph.eachEdge(function(S){var T=S.getGraphicEl(),C=S.getModel().get(["emphasis","focus"]);T&&C==="adjacency"&&(Be(T).focus={edge:[S.dataIndex],node:[S.node1.dataIndex,S.node2.dataIndex]})});var x=r.get("layout")==="circular"&&r.get(["circular","rotateLabel"]),_=h.getLayout("cx"),b=h.getLayout("cy");h.graph.eachNode(function(S){bne(S,x,_,b)}),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(!h8(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&&(AR(this._controllerHost,i.dx,i.dy),this._updateThumbnailWindow())},t.prototype.updateViewOnZoom=function(r,n,i){this._active&&(MR(this._controllerHost,i.zoom,i.originX,i.originY),this._updateNodeAndLinkScale(),lP(r.getGraph(),tm(r)),this._lineDraw.updateLayout(),n.updateLabelLayout(),this._updateThumbnailWindow())},t.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=tm(r);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},t.prototype.updateLayout=function(r){this._active&&(lP(r.getGraph(),tm(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=V8e(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 Le,l=i.group.children(),u=a.group.children(),c=new Le,f=new Le;s.add(f),s.add(c);for(var h=0;h=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 Rc||(r=this._nodesMap[$h(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(v)&&(t.set(v,!0),o.push(d.node1))}for(l=0;l=0&&!t.hasKey(b)&&(t.set(b,!0),s.push(_.node2))}}}return{edge:t.keys(),node:r.keys()}},e}(),Cne=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=Se(),r=Se();t.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],a=0;a=0&&!t.hasKey(f)&&(t.set(f,!0),n.push(c.node1))}for(a=0;a=0&&!t.hasKey(m)&&(t.set(m,!0),i.push(v.node2))}return{edge:t.keys(),node:r.keys()}},e}();function Ane(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)}}}br(Rc,Ane("hostGraph","data"));br(Cne,Ane("hostGraph","edgeData"));function zR(e,t,r,n,i){for(var a=new W8e(n),o=0;o "+h)),u++)}var d=r.get("coordinateSystem"),v;if(d==="cartesian2d"||d==="polar"||d==="matrix")v=vs(e,r);else{var m=pp.get(d),y=m?m.dimensions||[]:[];Ze(y,"value")<0&&y.concat(["value"]);var x=xp(e,{coordDimensions:y,encodeDefine:r.getEncode()}).dimensions;v=new qn(x,r),v.initData(e)}var _=new qn(["value"],r);return _.initData(l,s),i&&i(v,_),one({mainData:v,struct:a,structAttr:"graph",datas:{node:v,edge:_},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var H8e=function(e){X(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 Tp(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),Lf(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){I8e(this);var s=zR(a,i,this,!0,l);return R(s.edges,function(u){O8e(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,c){u.wrapMethod("getItemModel",function(v){var m=o._categoriesModels,y=v.getShallow("category"),x=m[y];return x&&(x.parentModel=v.parentModel,v.parentModel=x),v});var f=it.prototype.getModel;function h(v,m){var y=f.call(this,v,m);return y.resolveParentPath=d,y}c.wrapMethod("getItemModel",function(v){return v.resolveParentPath=d,v.getModel=h,v});function d(v){if(v&&(v[0]==="label"||v[1]==="label")){var m=v.slice();return v[0]==="label"?m[0]="edgeLabel":v[1]==="label"&&(m[1]="edgeLabel"),m}return v}}},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),zr("nameValue",{name:c.join(" > "),value:o.value,noValue:o.value==null})}var f=kee({series:this,dataIndex:r,multipleSeries:n});return f},t.prototype._updateCategoriesData=function(){var r=le(this.option.categories||[],function(i){return i.value!=null?i:ie({value:0},i)}),n=new qn(["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:J.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:J.color.primary}}},t}(Lt);function U8e(e){e.registerChartView(G8e),e.registerSeriesModel(H8e),e.registerProcessor(A8e),e.registerVisual(M8e),e.registerVisual(P8e),e.registerLayout(E8e),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,D8e),e.registerLayout(R8e),e.registerCoordinateSystem("graphView",{dimensions:nh.dimensions,create:z8e}),e.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},yr),e.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},yr),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=DC(o,t,i.get("scaleLimit"));i.setCenter&&i.setCenter(s.center),i.setZoom&&i.setZoom(s.zoom)})})}var d8=function(e){X(t,e);function t(r,n,i){var a=e.call(this)||this;Be(a).dataType="node",a.z2=2;var o=new lt;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"),f=r.getItemLayout(n),h=ie(Uo(u.getModel("itemStyle"),f,!0),f),d=this;if(isNaN(h.startAngle)){d.setShape(h);return}a?d.setShape(h):ft(d,{shape:h},l,n);var v=ie(Uo(u.getModel("itemStyle"),f,!0),f);o.setShape(v),o.useStyle(r.getItemVisual(n,"style")),Yr(o,u),this._updateLabel(l,u,s),r.setItemGraphicEl(n,d),Yr(d,u,"itemStyle");var m=c.get("focus");Kt(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 f=qr(n),h=i.getVisual("style");sn(a,f,{labelFetcher:{getFormattedLabel:function(_,b,S,T,C,A){return r.getFormattedLabel(_,b,"node",T,wi(C,f.normal&&f.normal.get("formatter"),n.get("name")),A)}},labelDataIndex:i.dataIndex,defaultText:i.dataIndex+"",inheritColor:h.fill,defaultOpacity:h.opacity,defaultOutsidePosition:"startArc"});var d=c.get("position")||"outside",v=c.get("distance")||0,m;d==="outside"?m=o.r+v: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}(Dn),Z8e=function(e){X(t,e);function t(r,n,i,a){var o=e.call(this)||this;return Be(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(),f=n.getItemModel(l.dataIndex),h=f.getModel("lineStyle"),d=f.getModel("emphasis"),v=d.get("focus"),m=ie(Uo(c.getModel("itemStyle"),u,!0),u),y=this;if(isNaN(m.sStartAngle)||isNaN(m.tStartAngle)){y.setShape(m);return}o?(y.setShape(m),v8(y,l,r,h)):(Ea(y),v8(y,l,r,h),ft(y,{shape:m},s,i)),Kt(this,v==="adjacency"?l.getAdjacentDataIndices():v,d.get("blurScope"),d.get("disabled")),Yr(y,f,"lineStyle"),n.setItemGraphicEl(l.dataIndex,y)},t}(at);function v8(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(me(l)&&me(u)){var c=e.shape,f=(c.s1[0]+c.s2[0])/2,h=(c.s1[1]+c.s2[1])/2,d=(c.t1[0]+c.t2[0])/2,v=(c.t1[1]+c.t2[1])/2;o.fill=new Xf(f,h,d,v,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var Y8e=Math.PI/180,q8e=function(e){X(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")*Y8e;if(a.diff(o).add(function(c){var f=a.getItemLayout(c);if(f){var h=new d8(a,c,l);Be(h).dataIndex=c,s.add(h)}}).update(function(c,f){var h=o.getItemGraphicEl(f),d=a.getItemLayout(c);if(!d){h&&qs(h,r,f);return}h?h.updateData(a,c,l):h=new d8(a,c,l),s.add(h)}).remove(function(c){var f=o.getItemGraphicEl(c);f&&qs(f,r,c)}).execute(),!o){var u=r.get("center");this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=ge(u[0],i.getWidth()),this.group.originY=ge(u[1],i.getHeight()),Gt(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 Z8e(i,a,l,n);Be(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&&qs(u,r,l)}).execute(),this._edgeData=a},t.prototype.dispose=function(){},t.type="chord",t}(At),X8e=function(e){X(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 Tp(xe(this.getData,this),xe(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=zR(a,i,this,!0,s);return o.data}function s(l,u){var c=it.prototype.getModel;function f(d,v){var m=c.call(this,d,v);return m.resolveParentPath=h,m}u.wrapMethod("getItemModel",function(d){return d.resolveParentPath=h,d.getModel=f,d});function h(d){if(d&&(d[0]==="label"||d[1]==="label")){var v=d.slice();return d[0]==="label"?v[0]="edgeLabel":d[1]==="label"&&(v[1]="edgeLabel"),v}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),zr("nameValue",{name:c.join(" > "),value:a.value,noValue:a.value==null})}return zr("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}(Lt),uP=Math.PI/180;function K8e(e,t){e.eachSeriesByType("chord",function(r){J8e(r,t)})}function J8e(e,t){var r=e.getData(),n=r.graph,i=e.getEdgeData(),a=i.count();if(a){var o=YQ(e,t),s=o.cx,l=o.cy,u=o.r,c=o.r0,f=Math.max((e.get("padAngle")||0)*uP,0),h=Math.max((e.get("minAngle")||0)*uP,0),d=-e.get("startAngle")*uP,v=d+Math.PI*2,m=e.get("clockwise"),y=m?1:-1,x=[d,v];mC(x,!m);var _=x[0],b=x[1],S=b-_,T=r.getSum("value")===0&&i.getSum("value")===0,C=[],A=0;n.eachEdge(function(B){var H=T?1:B.getValue("value");T&&(H>0||h)&&(A+=2);var U=B.node1.dataIndex,Z=B.node2.dataIndex;C[U]=(C[U]||0)+H,C[Z]=(C[Z]||0)+H});var P=0;if(n.eachNode(function(B){var H=B.getValue("value");isNaN(H)||(C[B.dataIndex]=Math.max(H,C[B.dataIndex]||0)),!T&&(C[B.dataIndex]>0||h)&&A++,P+=C[B.dataIndex]||0}),!(A===0||P===0)){f*A>=Math.abs(S)&&(f=Math.max(0,(Math.abs(S)-h*A)/A)),(f+h)*A>=Math.abs(S)&&(h=(Math.abs(S)-f*A)/A);var I=(S-f*A*y)/P,k=0,E=0,N=0;n.eachNode(function(B){var H=C[B.dataIndex]||0,U=I*(P?H:1)*y;Math.abs(U)E){var z=k/E;n.eachNode(function(B){var H=B.getLayout().angle;Math.abs(H)>=h?B.setLayout({angle:H*z,ratio:z},!0):B.setLayout({angle:h,ratio:h===0?1:H/h},!0)})}else n.eachNode(function(B){if(!D){var H=B.getLayout().angle,U=Math.min(H/N,1),Z=U*k;H-Zh&&h>0){var U=D?1:Math.min(H/N,1),Z=H-h,Y=Math.min(Z,Math.min(V,k*U));V-=Y,B.setLayout({angle:H-Y,ratio:(H-Y)/H},!0)}else h>0&&B.setLayout({angle:h,ratio:H===0?1:h/H},!0)}});var F=_,$=[];n.eachNode(function(B){var H=Math.max(B.getLayout().angle,h);B.setLayout({cx:s,cy:l,r0:c,r:u,startAngle:F,endAngle:F+H*y,clockwise:m},!0),$[B.dataIndex]=F,F+=(H+f)*y}),n.eachEdge(function(B){var H=T?1:B.getValue("value"),U=I*(P?H:1)*y,Z=B.node1.dataIndex,Y=$[Z]||0,K=Math.abs((B.node1.getLayout().ratio||1)*U),te=Y+K*y,ce=[s+c*Math.cos(Y),l+c*Math.sin(Y)],de=[s+c*Math.cos(te),l+c*Math.sin(te)],Ie=B.node2.dataIndex,ye=$[Ie]||0,ne=Math.abs((B.node2.getLayout().ratio||1)*U),ve=ye+ne*y,ue=[s+c*Math.cos(ye),l+c*Math.sin(ye)],ee=[s+c*Math.cos(ve),l+c*Math.sin(ve)];B.setLayout({s1:ce,s2:de,sStartAngle:Y,sEndAngle:te,t1:ue,t2:ee,tStartAngle:ye,tEndAngle:ve,cx:s,cy:l,r:c,value:H,clockwise:m}),$[Z]=te,$[Ie]=ve})}}}function Q8e(e){e.registerChartView(q8e),e.registerSeriesModel(X8e),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,K8e),e.registerProcessor(wp("chord"))}var eHe=function(){function e(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return e}(),tHe=function(e){X(t,e);function t(r){var n=e.call(this,r)||this;return n.type="pointer",n}return t.prototype.getDefaultShape=function(){return new eHe},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}(at);function rHe(e,t){var r=e.get("center"),n=t.getWidth(),i=t.getHeight(),a=Math.min(n,i),o=ge(r[0],t.getWidth()),s=ge(r[1],t.getHeight()),l=ge(e.get("radius"),a/2);return{cx:o,cy:s,r:l}}function rb(e,t){var r=e==null?"":e+"";return t&&(me(t)?r=t.replace("{value}",r):Pe(t)&&(r=t(e))),r}var nHe=function(e){X(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=rHe(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,f=r.getModel("axisLine"),h=f.get("roundCap"),d=h?yS:Dn,v=f.get("show"),m=f.getModel("lineStyle"),y=m.get("width"),x=[u,c];mC(x,!l),u=x[0],c=x[1];for(var _=c-u,b=u,S=[],T=0;v&&T=I&&(k===0?0:a[k-1][0])Math.PI/2&&(te+=Math.PI)):K==="tangential"?te=-P-Math.PI/2:ut(K)&&(te=K*Math.PI/180),te===0?f.add(new lt({style:Nt(b,{text:H,x:Z,y:Y,verticalAlign:V<-.8?"top":V>.8?"bottom":"middle",align:z<-.4?"left":z>.4?"right":"center"},{inheritColor:U}),silent:!0})):f.add(new lt({style:Nt(b,{text:H,x:Z,y:Y,verticalAlign:"middle",align:"center"},{inheritColor:U}),silent:!0,originX:Z,originY:Y,rotation:te}))}if(_.get("show")&&F!==S){var $=_.get("distance");$=$?$+c:c;for(var ce=0;ce<=T;ce++){z=Math.cos(P),V=Math.sin(P);var de=new Pr({shape:{x1:z*(v-$)+h,y1:V*(v-$)+d,x2:z*(v-A-$)+h,y2:V*(v-A-$)+d},silent:!0,style:N});N.stroke==="auto"&&de.setStyle({stroke:a((F+ce/T)/S)}),f.add(de),P+=k}P-=k}else P+=I}},t.prototype._renderPointer=function(r,n,i,a,o,s,l,u,c){var f=this.group,h=this._data,d=this._progressEls,v=[],m=r.get(["pointer","show"]),y=r.getModel("progress"),x=y.get("show"),_=r.getData(),b=_.mapDimension("value"),S=+r.get("min"),T=+r.get("max"),C=[S,T],A=[s,l];function P(k,E){var N=_.getItemModel(k),D=N.getModel("pointer"),z=ge(D.get("width"),o.r),V=ge(D.get("length"),o.r),F=r.get(["pointer","icon"]),$=D.get("offsetCenter"),B=ge($[0],o.r),H=ge($[1],o.r),U=D.get("keepAspect"),Z;return F?Z=Lr(F,B-z/2,H-V,z,V,null,U):Z=new tHe({shape:{angle:-Math.PI/2,width:z,r:V,x:B,y:H}}),Z.rotation=-(E+Math.PI/2),Z.x=o.cx,Z.y=o.cy,Z}function I(k,E){var N=y.get("roundCap"),D=N?yS:Dn,z=y.get("overlap"),V=z?y.get("width"):c/_.count(),F=z?o.r-V:o.r-(k+1)*V,$=z?o.r:o.r-k*V,B=new D({shape:{startAngle:s,endAngle:E,cx:o.cx,cy:o.cy,clockwise:u,r0:F,r:$}});return z&&(B.z2=_t(_.get(b,k),[S,T],[100,0],!0)),B}(x||m)&&(_.diff(h).add(function(k){var E=_.get(b,k);if(m){var N=P(k,s);Gt(N,{rotation:-((isNaN(+E)?A[0]:_t(E,C,A,!0))+Math.PI/2)},r),f.add(N),_.setItemGraphicEl(k,N)}if(x){var D=I(k,s),z=y.get("clip");Gt(D,{shape:{endAngle:_t(E,C,A,z)}},r),f.add(D),QI(r.seriesIndex,_.dataType,k,D),v[k]=D}}).update(function(k,E){var N=_.get(b,k);if(m){var D=h.getItemGraphicEl(E),z=D?D.rotation:s,V=P(k,z);V.rotation=z,ft(V,{rotation:-((isNaN(+N)?A[0]:_t(N,C,A,!0))+Math.PI/2)},r),f.add(V),_.setItemGraphicEl(k,V)}if(x){var F=d[E],$=F?F.shape.endAngle:s,B=I(k,$),H=y.get("clip");ft(B,{shape:{endAngle:_t(N,C,A,H)}},r),f.add(B),QI(r.seriesIndex,_.dataType,k,B),v[k]=B}}).execute(),_.each(function(k){var E=_.getItemModel(k),N=E.getModel("emphasis"),D=N.get("focus"),z=N.get("blurScope"),V=N.get("disabled");if(m){var F=_.getItemGraphicEl(k),$=_.getItemVisual(k,"style"),B=$.fill;if(F instanceof un){var H=F.style;F.useStyle(ie({image:H.image,x:H.x,y:H.y,width:H.width,height:H.height},$))}else F.useStyle($),F.type!=="pointer"&&F.setColor(B);F.setStyle(E.getModel(["pointer","itemStyle"]).getItemStyle()),F.style.fill==="auto"&&F.setStyle("fill",a(_t(_.get(b,k),C,[0,1],!0))),F.z2EmphasisLift=0,Yr(F,E),Kt(F,D,z,V)}if(x){var U=v[k];U.useStyle(_.getItemVisual(k,"style")),U.setStyle(E.getModel(["progress","itemStyle"]).getItemStyle()),U.z2EmphasisLift=0,Yr(U,E),Kt(U,D,z,V)}}),this._progressEls=v)},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=Lr(s,n.cx-o/2+ge(l[0],n.r),n.cy-o/2+ge(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"),f=+r.get("max"),h=new Le,d=[],v=[],m=r.isAnimationEnabled(),y=r.get(["pointer","showAbove"]);l.diff(this._data).add(function(x){d[x]=new lt({silent:!0}),v[x]=new lt({silent:!0})}).update(function(x,_){d[x]=s._titleEls[_],v[x]=s._detailEls[_]}).execute(),l.each(function(x){var _=l.getItemModel(x),b=l.get(u,x),S=new Le,T=a(_t(b,[c,f],[0,1],!0)),C=_.getModel("title");if(C.get("show")){var A=C.get("offsetCenter"),P=o.cx+ge(A[0],o.r),I=o.cy+ge(A[1],o.r),k=d[x];k.attr({z2:y?0:2,style:Nt(C,{x:P,y:I,text:l.getName(x),align:"center",verticalAlign:"middle"},{inheritColor:T})}),S.add(k)}var E=_.getModel("detail");if(E.get("show")){var N=E.get("offsetCenter"),D=o.cx+ge(N[0],o.r),z=o.cy+ge(N[1],o.r),V=ge(E.get("width"),o.r),F=ge(E.get("height"),o.r),$=r.get(["progress","show"])?l.getItemVisual(x,"style").fill:T,k=v[x],B=E.get("formatter");k.attr({z2:y?0:2,style:Nt(E,{x:D,y:z,text:rb(b,B),width:isNaN(V)?null:V,height:isNaN(F)?null:F,align:"center",verticalAlign:"middle"},{inheritColor:$})}),LQ(k,{normal:E},b,function(U){return rb(U,B)}),m&&IQ(k,x,l,r,{getFormattedLabel:function(U,Z,Y,K,te,ce){return rb(ce?ce.interpolatedValue:b,B)}}),S.add(k)}h.add(S)}),this.group.add(h),this._titleEls=d,this._detailEls=v},t.type="gauge",t}(At),iHe=function(e){X(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 Sp(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,J.color.neutral10]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:J.color.axisTick,width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:J.color.axisTickMinor,width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:J.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:J.color.neutral00,borderWidth:0,borderColor:J.color.theme[0]}},title:{show:!0,offsetCenter:[0,"20%"],color:J.color.secondary,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:J.color.transparent,borderWidth:0,borderColor:J.color.neutral40,width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:J.color.primary,fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},t}(Lt);function aHe(e){e.registerChartView(nHe),e.registerSeriesModel(iHe)}var oHe=["itemStyle","opacity"],sHe=function(e){X(t,e);function t(r,n){var i=e.call(this)||this,a=i,o=new xn,s=new lt;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(oHe);c=c??1,i||Ea(a),a.useStyle(r.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,Gt(a,{style:{opacity:c}},o,n)):ft(a,{style:{opacity:c},shape:{points:l.points}},o,n),Yr(a,s),this._updateLabel(r,n),Kt(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,f=r.getItemVisual(n,"style"),h=f.fill;sn(o,qr(l),{labelFetcher:r.hostModel,labelDataIndex:n,defaultOpacity:f.opacity,defaultText:r.getName(n)},{normal:{align:c.textAlign,verticalAlign:c.verticalAlign}});var d=l.getModel("label"),v=d.get("color"),m=v==="inherit"?h: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 De(y[0][0],y[0][1]):null},ft(o,{style:{x:c.x,y:c.y}},s,n),o.attr({rotation:c.rotation,originX:c.x,originY:c.y,z2:10}),hR(i,dR(l),{stroke:h})},t}(jn),lHe=function(e){X(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 sHe(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);qs(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}(At),uHe=function(e){X(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 Tp(xe(this.getData,this),xe(this.getRawData,this)),this._defaultLabelLine(r)},t.prototype.getInitialData=function(r,n){return Sp(this,{coordDimensions:["value"],encodeDefaulter:Ue($j,this)})},t.prototype._defaultLabelLine=function(r){Lf(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:J.color.neutral00,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:J.color.primary}}},t}(Lt);function cHe(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();oAHe)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||!fP(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 fP(e,t){var r=e._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===t}var kHe=function(e){X(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&&qe(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){R(["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);R(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}(tt),LHe=function(e){X(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}(Ba);function Ou(e,t,r,n,i,a){e=e||0;var o=r[1]-r[0];if(i!=null&&(i=Fh(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(t[1]-t[0]);s=Fh(s,[0,o]),i=a=Fh(s,[i,a]),n=0}t[0]=Fh(t[0],r),t[1]=Fh(t[1],r);var l=hP(t,n);t[n]+=e;var u=i||0,c=r.slice();l.sign<0?c[0]+=u:c[1]-=u,t[n]=Fh(t[n],c);var f;return f=hP(t,n),i!=null&&(f.sign!==l.sign||f.spana&&(t[1-n]=t[n]+f.sign*a),t}function hP(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 Fh(e,t){return Math.min(t[1]!=null?t[1]:1/0,Math.max(t[0]!=null?t[0]:-1/0,e))}var dP=R,Pne=Math.min,kne=Math.max,m8=Math.floor,IHe=Math.ceil,y8=Mr,OHe=Math.PI,EHe=function(){function e(t,r,n){this.type="parallel",this._axesMap=Se(),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;dP(i,function(o,s){var l=a[s],u=r.getComponent("parallelAxis",l),c=this._axesMap.set(o,new LHe(o,Y0(u),[0,0],u.get("type"),l)),f=c.type==="category";c.onBand=f&&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();dP(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(i,i.mapDimension(a)),Rf(o.scale,o.model)},this)}},this)},e.prototype.resize=function(t,r){var n=Xr(t,r).refContainer;this._rect=Zt(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=nb(t.get("axisExpandWidth"),l),f=nb(t.get("axisExpandCount")||0,[0,u]),h=t.get("axisExpandable")&&u>3&&u>f&&f>1&&c>0&&s>0,d=t.get("axisExpandWindow"),v;if(d)v=nb(d[1]-d[0],l),d[1]=d[0]+v;else{v=nb(c*(f-1),l);var m=t.get("axisExpandCenter")||m8(u/2);d=[c*m-v/2],d[1]=d[0]+v}var y=(s-v)/(u-f);y<3&&(y=0);var x=[m8(y8(d[0]/c,1))+1,IHe(y8(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:h,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])}),dP(n,function(o,s){var l=(i.axisExpandable?DHe:NHe)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},c={horizontal:OHe/2,vertical:0},f=[u[a].x+t.x,u[a].y+t.y],h=c[a],d=an();xl(d,d,h),po(d,d,f),this._axesLayout[o]={position:f,rotation:h,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=[];R(o,function(y){s.push(t.mapDimension(y)),l.push(a.get(y).model)});for(var u=this.hasAxisBrushed(),c=n;ca*(1-f[0])?(u="jump",l=s-a*(1-f[2])):(l=s-a*f[1])>=0&&(l=s-a*(1-f[1]))<=0&&(l=0),l*=r.axisExpandWidth/c,l?Ou(l,i,o,"all"):u="none";else{var d=i[1]-i[0],v=o[1]*s/d;i=[kne(0,v-d/2)],i[1]=Pne(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},e}();function nb(e,t){return Pne(kne(e,t[0]),t[1])}function NHe(e,t){var r=t.layoutLength/(t.axisCount-1);return{position:r*e,axisNameAvailableWidth:r,axisLabelShow:!0}}function DHe(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--)Vi(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;a$He}function Dne(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function jne(e,t,r,n){var i=new Le;return i.add(new Qe({name:"main",style:WR(r),silent:!0,draggable:!0,cursor:"move",drift:Ue(b8,e,t,i,["n","s","w","e"]),ondragend:Ue(zf,t,{isEnd:!0})})),R(n,function(a){i.add(new Qe({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Ue(b8,e,t,i,a),ondragend:Ue(zf,t,{isEnd:!0})}))}),i}function Rne(e,t,r,n){var i=n.brushStyle.lineWidth||0,a=Iv(i,FHe),o=r[0][0],s=r[1][0],l=o-i/2,u=s-i/2,c=r[0][1],f=r[1][1],h=c-a+i/2,d=f-a+i/2,v=c-o,m=f-s,y=v+i,x=m+i;Ms(e,t,"main",o,s,v,m),n.transformable&&(Ms(e,t,"w",l,u,a,x),Ms(e,t,"e",h,u,a,x),Ms(e,t,"n",l,u,y,a),Ms(e,t,"s",l,d,y,a),Ms(e,t,"nw",l,u,a,a),Ms(e,t,"ne",h,u,a,a),Ms(e,t,"sw",l,d,a,a),Ms(e,t,"se",h,d,a,a))}function oE(e,t){var r=t.__brushOption,n=r.transformable,i=t.childAt(0);i.useStyle(WR(r)),i.attr({silent:!n,cursor:n?"move":"default"}),R([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=t.childOfName(a.join("")),s=a.length===1?sE(e,a[0]):ZHe(e,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?GHe[s]+"-resize":null})})}function Ms(e,t,r,n,i,a,o){var s=t.childOfName(r);s&&s.setShape(qHe(HR(e,t,[[n,i],[n+a,i+o]])))}function WR(e){return Oe({strokeNoScale:!0},e.brushStyle)}function Bne(e,t,r,n){var i=[d0(e,r),d0(t,n)],a=[Iv(e,r),Iv(t,n)];return[[i[0],a[0]],[i[1],a[1]]]}function UHe(e){return xu(e.group)}function sE(e,t){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=bC(r[t],UHe(e));return n[i]}function ZHe(e,t){var r=[sE(e,t[0]),sE(e,t[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function b8(e,t,r,n,i,a){var o=r.__brushOption,s=e.toRectRange(o.range),l=zne(t,i,a);R(n,function(u){var c=VHe[u];s[c[0]][c[1]]+=l[c[0]]}),o.range=e.fromRectRange(Bne(s[0][0],s[1][0],s[0][1],s[1][1])),FR(t,r),zf(t,{isEnd:!1})}function YHe(e,t,r,n){var i=t.__brushOption.range,a=zne(e,r,n);R(i,function(o){o[0]+=a[0],o[1]+=a[1]}),FR(e,t),zf(e,{isEnd:!1})}function zne(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 HR(e,t,r){var n=Nne(e,t);return n&&n!==Bf?n.clipPath(r,e._transform):ke(r)}function qHe(e){var t=d0(e[0][0],e[1][0]),r=d0(e[0][1],e[1][1]),n=Iv(e[0][0],e[1][0]),i=Iv(e[0][1],e[1][1]);return{x:t,y:r,width:n-t,height:i-r}}function XHe(e,t,r){if(!(!e._brushType||JHe(e,t.offsetX,t.offsetY))){var n=e._zr,i=e._covers,a=GR(e,t,r);if(!e._dragging)for(var o=0;on.getWidth()||r<0||r>n.getHeight()}var zC={lineX:T8(0),lineY:T8(1),rect:{createCover:function(e,t){function r(n){return n}return jne({toRectRange:r,fromRectRange:r},e,t,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(e){var t=Dne(e);return Bne(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,r,n){Rne(e,t,r,n)},updateCommon:oE,contain:uE},polygon:{createCover:function(e,t){var r=new Le;return r.add(new xn({name:"main",style:WR(t),silent:!0})),r},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new jn({name:"main",draggable:!0,drift:Ue(YHe,e,t),ondragend:Ue(zf,e,{isEnd:!0})}))},updateCoverShape:function(e,t,r,n){t.childAt(0).setShape({points:HR(e,t,r)})},updateCommon:oE,contain:uE}};function T8(e){return{createCover:function(t,r){return jne({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=Dne(t),n=d0(r[0][e],r[1][e]),i=Iv(r[0][e],r[1][e]);return[n,i]},updateCoverShape:function(t,r,n,i){var a,o=Nne(t,r);if(o!==Bf&&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(),Rne(t,r,l,i)},updateCommon:oE,contain:uE}}function Fne(e){return e=UR(e),function(t){return bj(t,e)}}function Vne(e,t){return e=UR(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 Gne(e,t,r){var n=UR(e);return function(i,a){return n.contain(a[0],a[1])&&!Yre(i,t,r)}}function UR(e){return je.create(e)}var QHe=function(e){X(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 $R(n.getZr())).on("brush",xe(this._onBrush,this))},t.prototype.render=function(r,n,i,a){if(!eUe(r,n,a)){this.axisModel=r,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Le,this.group.add(this._axisGroup),!!r.get("show")){var s=rUe(r,n),l=s.coordinateSystem,u=r.getAreaSelectStyle(),c=u.width,f=r.axis.dim,h=l.getAxisLayout(f),d=ie({strokeContainThreshold:c},h),v=new ai(r,i,d);v.build(),this._axisGroup.add(v.group),this._refreshBrushController(d,u,r,s,c,i),W0(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),f=je.create({x:l[0],y:-o/2,width:u,height:o});f.x-=c,f.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:r.rotation,x:r.position[0],y:r.position[1]}).setPanels([{panelId:"pl",clipPath:Fne(f),isTargetByCursor:Gne(f,s,a),getLinearBrushOtherExtent:Vne(f,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(tUe(i))},t.prototype._onBrush=function(r){var n=r.areas,i=this.axisModel,a=i.axis,o=le(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}(jt);function eUe(e,t,r){return r&&r.type==="axisAreaSelect"&&t.findComponents({mainType:"parallelAxis",query:r})[0]===e}function tUe(e){var t=e.axis;return le(e.activeIntervals,function(r){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(r[0],!0),t.dataToCoord(r[1],!0)]}})}function rUe(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}var nUe={type:"axisAreaSelect",event:"axisAreaSelected"};function iUe(e){e.registerAction(nUe,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 aUe={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function Wne(e){e.registerComponentView(MHe),e.registerComponentModel(kHe),e.registerCoordinateSystem("parallel",RHe),e.registerPreprocessor(SHe),e.registerComponentModel(iE),e.registerComponentView(QHe),kv(e,"parallel",iE,aUe),iUe(e)}function oUe(e){Ke(Wne),e.registerChartView(pHe),e.registerSeriesModel(yHe),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,wHe)}var sUe=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}(),lUe=function(e){X(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new sUe},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(){ul(this)},t.prototype.downplay=function(){cl(this)},t}(at),uUe=function(e){X(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r._mainGroup=new Le,r._focusAdjacencyDisabled=!1,r}return t.prototype.init=function(r,n){this._controller=new rh(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,f=r.getData(),h=r.getData("edge"),d=r.get("orient");this._model=r,s.removeAll(),s.x=l.x,s.y=l.y,this._updateViewCoordSys(r,i),qre(r,i,s,this._controller,this._controllerHost,null),o.eachEdge(function(v){var m=new lUe,y=Be(m);y.dataIndex=v.dataIndex,y.seriesIndex=r.seriesIndex,y.dataType="edge";var x=v.getModel(),_=x.getModel("lineStyle"),b=_.get("curveness"),S=v.node1.getLayout(),T=v.node1.getModel(),C=T.get("localX"),A=T.get("localY"),P=v.node2.getLayout(),I=v.node2.getModel(),k=I.get("localX"),E=I.get("localY"),N=v.getLayout(),D,z,V,F,$,B,H,U;m.shape.extent=Math.max(1,N.dy),m.shape.orient=d,d==="vertical"?(D=(C!=null?C*u:S.x)+N.sy,z=(A!=null?A*c:S.y)+S.dy,V=(k!=null?k*u:P.x)+N.ty,F=E!=null?E*c:P.y,$=D,B=z*(1-b)+F*b,H=V,U=z*b+F*(1-b)):(D=(C!=null?C*u:S.x)+S.dx,z=(A!=null?A*c:S.y)+N.sy,V=k!=null?k*u:P.x,F=(E!=null?E*c:P.y)+N.ty,$=D*(1-b)+V*b,B=z,H=D*b+V*(1-b),U=F),m.setShape({x1:D,y1:z,x2:V,y2:F,cpx1:$,cpy1:B,cpx2:H,cpy2:U}),m.useStyle(_.getItemStyle()),C8(m.style,d,v);var Z=""+x.get("value"),Y=qr(x,"edgeLabel");sn(m,Y,{labelFetcher:{getFormattedLabel:function(ce,de,Ie,ye,ne,ve){return r.getFormattedLabel(ce,de,"edge",ye,wi(ne,Y.normal&&Y.normal.get("formatter"),Z),ve)}},labelDataIndex:v.dataIndex,defaultText:Z}),m.setTextConfig({position:"inside"});var K=x.getModel("emphasis");Yr(m,x,"lineStyle",function(ce){var de=ce.getItemStyle();return C8(de,d,v),de}),s.add(m),h.setItemGraphicEl(v.dataIndex,m);var te=K.get("focus");Kt(m,te==="adjacency"?v.getAdjacentDataIndices():te==="trajectory"?v.getTrajectoryDataIndices():te,K.get("blurScope"),K.get("disabled"))}),o.eachNode(function(v){var m=v.getLayout(),y=v.getModel(),x=y.get("localX"),_=y.get("localY"),b=y.getModel("emphasis"),S=y.get(["itemStyle","borderRadius"])||0,T=new Qe({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});sn(T,qr(y),{labelFetcher:{getFormattedLabel:function(A,P){return r.getFormattedLabel(A,P,"node")}},labelDataIndex:v.dataIndex,defaultText:v.id}),T.disableLabelAnimation=!0,T.setStyle("fill",v.getVisual("color")),T.setStyle("decal",v.getVisual("style").decal),Yr(T,y),s.add(T),f.setItemGraphicEl(v.dataIndex,T),Be(T).dataType="node";var C=b.get("focus");Kt(T,C==="adjacency"?v.getAdjacentDataIndices():C==="trajectory"?v.getTrajectoryDataIndices():C,b.get("blurScope"),b.get("disabled"))}),f.eachItemGraphicEl(function(v,m){var y=f.getItemModel(m);y.get("draggable")&&(v.drift=function(x,_){a._focusAdjacencyDisabled=!0,this.shape.x+=x,this.shape.y+=_,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:r.id,dataIndex:f.getRawIndex(m),localX:this.shape.x/u,localY:this.shape.y/c})},v.ondragend=function(){a._focusAdjacencyDisabled=!1},v.draggable=!0,v.cursor="move")}),!this._data&&r.isAnimationEnabled()&&s.setClipPath(cUe(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 nh(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}(At);function C8(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");me(n)&&me(i)&&(e.fill=new Xf(0,0,+(t==="horizontal"),+(t==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function cUe(e,t,r){var n=new Qe({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Gt(n,{shape:{width:e.width+20}},t,r),n}var fUe=function(e){X(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 it(o[l],this,n));var u=zR(a,i,this,!0,c);return u.data;function c(f,h){f.wrapMethod("getItemModel",function(d,v){var m=d.parentModel,y=m.getData().getItemLayout(v);if(y){var x=y.depth,_=m.levelModels[x];_&&(d.parentModel=_)}return d}),h.wrapMethod("getItemModel",function(d,v){var m=d.parentModel,y=m.getGraph().getEdgeByIndex(v),x=y.node1.getLayout();if(x){var _=x.depth,b=m.levelModels[_];b&&(d.parentModel=b)}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 zr("nameValue",{name:u,value:l,noValue:a(l)})}else{var c=this.getGraph().getNodeByIndex(r),f=c.getLayout().value,h=this.getDataParams(r,i).data.name;return zr("nameValue",{name:h!=null?h+"":null,value:f,noValue:a(f)})}},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:J.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:J.color.primary}},animationEasing:"linear",animationDuration:1e3},t}(Lt);function hUe(e,t){e.eachSeriesByType("sankey",function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=Xr(r,t).refContainer,o=Zt(r.getBoxLayoutParams(),a);r.layoutInfo=o;var s=o.width,l=o.height,u=r.getGraph(),c=u.nodes,f=u.edges;vUe(c);var h=gt(c,function(y){return y.getLayout().value===0}),d=h.length!==0?0:r.get("layoutIterations"),v=r.get("orient"),m=r.get("nodeAlign");dUe(c,f,n,i,s,l,d,v,m)})}function dUe(e,t,r,n,i,a,o,s,l){pUe(e,t,r,i,a,s,l),xUe(e,t,a,i,n,o,s),PUe(e,s)}function vUe(e){R(e,function(t){var r=wu(t.outEdges,AS),n=wu(t.inEdges,AS),i=t.getValue()||0,a=Math.max(r,n,i);t.setLayout({value:a},!0)})}function pUe(e,t,r,n,i,a,o){for(var s=[],l=[],u=[],c=[],f=0,h=0;h=0;x&&y.depth>d&&(d=y.depth),m.setLayout({depth:x?y.depth:f},!0),a==="vertical"?m.setLayout({dy:r},!0):m.setLayout({dx:r},!0);for(var _=0;_f-1?d:f-1;o&&o!=="left"&&gUe(e,o,a,A);var P=a==="vertical"?(i-r)/A:(n-r)/A;yUe(e,P,a)}function Hne(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return t.depth!=null&&t.depth>=0}function gUe(e,t,r,n){if(t==="right"){for(var i=[],a=e,o=0;a.length;){for(var s=0;s0;a--)l*=.99,wUe(s,l,o),vP(s,i,r,n,o),MUe(s,l,o),vP(s,i,r,n,o)}function _Ue(e,t){var r=[],n=t==="vertical"?"y":"x",i=YI(e,function(a){return a.getLayout()[n]});return i.keys.sort(function(a,o){return a-o}),R(i.keys,function(a){r.push(i.buckets.get(a))}),r}function bUe(e,t,r,n,i,a){var o=1/0;R(e,function(s){var l=s.length,u=0;R(s,function(f){u+=f.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()[h]+t;var v=i==="vertical"?n:r;if(u=c-t-v,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),c=s;for(var d=f-2;d>=0;--d)l=o[d],u=l.getLayout()[a]+l.getLayout()[h]+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 wUe(e,t,r){R(e.slice().reverse(),function(n){R(n,function(i){if(i.outEdges.length){var a=wu(i.outEdges,SUe,r)/wu(i.outEdges,AS);if(isNaN(a)){var o=i.outEdges.length;a=o?wu(i.outEdges,TUe,r)/o:0}if(r==="vertical"){var s=i.getLayout().x+(a-Eu(i,r))*t;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-Eu(i,r))*t;i.setLayout({y:l},!0)}}})})}function SUe(e,t){return Eu(e.node2,t)*e.getValue()}function TUe(e,t){return Eu(e.node2,t)}function CUe(e,t){return Eu(e.node1,t)*e.getValue()}function AUe(e,t){return Eu(e.node1,t)}function Eu(e,t){return t==="vertical"?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function AS(e){return e.getValue()}function wu(e,t,r){for(var n=0,i=e.length,a=-1;++ao&&(o=l)}),R(n,function(s){var l=new on({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&&R(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function LUe(e){e.registerChartView(uUe),e.registerSeriesModel(fUe),e.registerLayout(hUe),e.registerVisual(kUe),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=DC(a,t,i.get("scaleLimit"));i.setCenter(o.center),i.setZoom(o.zoom)})})}var Une=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,f=this._baseAxisDim=u[c],h=u[1-c],d=[i,a],v=d[c].get("type"),m=d[1-c].get("type"),y=t.data;if(y&&l){var x=[];R(y,function(S,T){var C;oe(S)?(C=S.slice(),S.unshift(T)):oe(S.value)?(C=ie({},S),C.value=C.value.slice(),S.value.unshift(T)):C=S,x.push(C)}),t.data=x}var _=this.defaultValueDimensions,b=[{name:f,type:uS(v),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:uS(m),dimsDef:_.slice()}];return Sp(this,{coordDimensions:b,dimensionsCount:_.length+1,encodeDefaulter:Ue(ree,b,this)})},e.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},e}(),Zne=function(e){X(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:J.color.neutral00,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:J.color.shadow}},animationDuration:800},t}(Lt);br(Zne,Une,!0);var IUe=function(e){X(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),f=A8(c,a,u,l,!0);a.setItemGraphicEl(u,f),o.add(f)}}).update(function(u,c){var f=s.getItemGraphicEl(c);if(!a.hasValue(u)){o.remove(f);return}var h=a.getItemLayout(u);f?(Ea(f),Yne(h,f,a,u)):f=A8(h,a,u,l),o.add(f),a.setItemGraphicEl(u,f)}).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}(At),OUe=function(){function e(){}return e}(),EUe=function(e){X(t,e);function t(r){var n=e.call(this,r)||this;return n.type="boxplotBoxPath",n}return t.prototype.getDefaultShape=function(){return new OUe},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,b];n.push(S)}}}return{boxData:r,outliers:n}}var $Ue={type:"echarts:boxplot",transform:function(t){var r=t.upstream;if(r.sourceFormat!==_n){var n="";bt(n)}var i=zUe(r.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function FUe(e){e.registerSeriesModel(Zne),e.registerChartView(IUe),e.registerLayout(DUe),e.registerTransform($Ue)}var VUe=["itemStyle","borderColor"],GUe=["itemStyle","borderColor0"],WUe=["itemStyle","borderColorDoji"],HUe=["itemStyle","color"],UUe=["itemStyle","color0"];function ZR(e,t){return t.get(e>0?HUe:UUe)}function YR(e,t){return t.get(e===0?WUe:e>0?VUe:GUe)}var ZUe={seriesType:"candlestick",plan:gp(),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=ZR(s,o),l.stroke=YR(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");ie(u,l)}}}}}},YUe=["color","borderColor"],qUe=function(e){X(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){Uu(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 f=n.getItemLayout(c);if(s&&M8(u,f))return;var h=pP(f,c,!0);Gt(h,{shape:{points:f.ends}},r,c),gP(h,n,c,o),a.add(h),n.setItemGraphicEl(c,h)}}).update(function(c,f){var h=i.getItemGraphicEl(f);if(!n.hasValue(c)){a.remove(h);return}var d=n.getItemLayout(c);if(s&&M8(u,d)){a.remove(h);return}h?(ft(h,{shape:{points:d.ends}},r,c),Ea(h)):h=pP(d),gP(h,n,c,o),a.add(h),n.setItemGraphicEl(c,h)}).remove(function(c){var f=i.getItemGraphicEl(c);f&&a.remove(f)}).execute(),this._data=n},t.prototype._renderLarge=function(r){this._clear(),P8(r,this.group);var n=r.get("clip",!0)?K0(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=pP(s);gP(l,i,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},t.prototype._incrementalRenderLarge=function(r,n){P8(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}(At),XUe=function(){function e(){}return e}(),KUe=function(e){X(t,e);function t(r){var n=e.call(this,r)||this;return n.type="normalCandlestickBox",n}return t.prototype.getDefaultShape=function(){return new XUe},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}(at);function pP(e,t,r){var n=e.ends;return new KUe({shape:{points:r?JUe(n,e):n},z2:100})}function M8(e,t){for(var r=!0,n=0;nT?E[a]:k[a],ends:z,brushRect:H(C,A,b)})}function $(Z,Y){var K=[];return K[i]=Y,K[a]=Z,isNaN(Y)||isNaN(Z)?[NaN,NaN]:t.dataToPoint(K)}function B(Z,Y,K){var te=Y.slice(),ce=Y.slice();te[i]=Vb(te[i]+n/2,1,!1),ce[i]=Vb(ce[i]-n/2,1,!0),K?Z.push(te,ce):Z.push(ce,te)}function H(Z,Y,K){var te=$(Z,K),ce=$(Y,K);return te[i]-=n/2,ce[i]-=n/2,{x:te[0],y:te[1],width:n,height:ce[1]-te[1]}}function U(Z){return Z[i]=Vb(Z[i],1),Z}}function v(m,y){for(var x=Wo(m.count*4),_=0,b,S=[],T=[],C,A=y.getStore(),P=!!e.get(["itemStyle","borderColorDoji"]);(C=m.next())!=null;){var I=A.get(s,C),k=A.get(u,C),E=A.get(c,C),N=A.get(f,C),D=A.get(h,C);if(isNaN(I)||isNaN(N)||isNaN(D)){x[_++]=NaN,_+=3;continue}x[_++]=k8(A,C,k,E,c,P),S[i]=I,S[a]=N,b=t.dataToPoint(S,null,T),x[_++]=b?b[0]:NaN,x[_++]=b?b[1]:NaN,S[a]=D,b=t.dataToPoint(S,null,T),x[_++]=b?b[1]:NaN}y.setLayout("largePoints",x)}}};function k8(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 r7e(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=ge(Ce(e.get("barMaxWidth"),i),i),o=ge(Ce(e.get("barMinWidth"),1),i),s=e.get("barWidth");return s!=null?ge(s,i):Math.max(Math.min(i/2,a),o)}function n7e(e){e.registerChartView(qUe),e.registerSeriesModel(qne),e.registerPreprocessor(e7e),e.registerVisual(ZUe),e.registerLayout(t7e)}function L8(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 i7e=function(e){X(t,e);function t(r,n){var i=e.call(this)||this,a=new q0(r,n),o=new Le;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 h=void 0;Pe(f)?h=f(i):h=f,a.__t>0&&(h=-s*a.__t),this._animateSymbol(a,s,h,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 Bs(r.__p1,r.__cp1)+Bs(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=gn,c=OI;s[0]=u(n[0],a[0],i[0],o),s[1]=u(n[1],a[1],i[1],o);var f=r.__t<1?c(n[0],a[0],i[0],o):c(i[0],a[0],n[0],1-o),h=r.__t<1?c(n[1],a[1],i[1],o):c(i[1],a[1],n[1],1-o);r.rotation=-Math.atan2(h,f)-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]),f=i[l],h=i[l+1];r.x=f[0]*(1-c)+c*h[0],r.y=f[1]*(1-c)+c*h[1];var d=r.__t<1?h[0]-f[0]:f[0]-h[0],v=r.__t<1?h[1]-f[1]:f[1]-h[1];r.rotation=-Math.atan2(v,d)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,r.ignore=!1}},t}(Xne),u7e=function(){function e(){this.polyline=!1,this.curveness=0,this.segs=[]}return e}(),c7e=function(e){X(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:J.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new u7e},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+f)/2-(c-h)*a,v=(c+h)/2-(f-u)*a;r.quadraticCurveTo(d,v,f,h)}else r.lineTo(f,h)}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 f=a[u++],h=a[u++],d=1;d0){var y=(f+v)/2-(h-m)*o,x=(h+m)/2-(v-f)*o;if(KJ(f,h,y,x,v,m,s,r,n))return l}else if(Vl(f,h,v,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}(),Jne={seriesType:"lines",plan:gp(),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 f=r.get("clip",!0)&&K0(r.coordinateSystem,!1,r);f?this.group.setClipPath(f):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=Jne.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 f7e:new BR(o?a?l7e:Kne:a?Xne:RR),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}(At),d7e=typeof Uint32Array>"u"?Array:Uint32Array,v7e=typeof Float64Array>"u"?Array:Float64Array;function I8(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=le(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),aC([i,r[0],r[1]])}))}var p7e=function(e){X(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||[],I8(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(I8(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=mv(this._flatCoords,n.flatCoords),this._flatCoordsOffset=mv(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}(Lt);function ib(e){return e instanceof Array||(e=[e,e]),e}var g7e={seriesType:"lines",reset:function(e){var t=ib(e.get("symbol")),r=ib(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=ib(s.getShallow("symbol",!0)),u=ib(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 m7e(e){e.registerChartView(h7e),e.registerSeriesModel(p7e),e.registerLayout(Jne),e.registerVisual(g7e)}var y7e=256,x7e=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=Si.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,f=this.canvas,h=f.getContext("2d"),d=t.length;f.width=r,f.height=n;for(var v=0;v0){var N=o(b)?l:u;b>0&&(b=b*k+P),T[C++]=N[E],T[C++]=N[E+1],T[C++]=N[E+2],T[C++]=N[E+3]*b*256}else C+=4}return h.putImageData(S,0,0),f},e.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=Si.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=J.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 _7e(e,t,r){var n=e[1]-e[0];t=le(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 O8(e){var t=e.dimensions;return t[0]==="lng"&&t[1]==="lat"}var w7e=function(e){X(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()):O8(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&&(O8(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},t.prototype.eachRendered=function(r){Uu(this._progressiveEls||this.group,r)},t.prototype._renderOnGridLike=function(r,n,i,a,o){var s=r.coordinateSystem,l=Iu(s,"cartesian2d"),u=Iu(s,"matrix"),c,f,h,d;if(l){var v=s.getAxis("x"),m=s.getAxis("y");c=v.getBandWidth()+.5,f=m.getBandWidth()+.5,h=v.scale.getExtent(),d=m.scale.getExtent()}for(var y=this.group,x=r.getData(),_=r.getModel(["emphasis","itemStyle"]).getItemStyle(),b=r.getModel(["blur","itemStyle"]).getItemStyle(),S=r.getModel(["select","itemStyle"]).getItemStyle(),T=r.get(["itemStyle","borderRadius"]),C=qr(r),A=r.getModel("emphasis"),P=A.get("focus"),I=A.get("blurScope"),k=A.get("disabled"),E=l||u?[x.mapDimension("x"),x.mapDimension("y"),x.mapDimension("value")]:[x.mapDimension("time"),x.mapDimension("value")],N=i;Nh[1]||Fd[1])continue;var $=s.dataToPoint([V,F]);D=new Qe({shape:{x:$[0]-c/2,y:$[1]-f/2,width:c,height:f},style:z})}else if(u){var B=s.dataToLayout([x.get(E[0],N),x.get(E[1],N)]).rect;if(In(B.x))continue;D=new Qe({z2:1,shape:B,style:z})}else{if(isNaN(x.get(E[1],N)))continue;var H=s.dataToLayout([x.get(E[0],N)]),B=H.contentRect||H.rect;if(In(B.x)||In(B.y))continue;D=new Qe({z2:1,shape:B,style:z})}if(x.hasItemOption){var U=x.getItemModel(N),Z=U.getModel("emphasis");_=Z.getModel("itemStyle").getItemStyle(),b=U.getModel(["blur","itemStyle"]).getItemStyle(),S=U.getModel(["select","itemStyle"]).getItemStyle(),T=U.get(["itemStyle","borderRadius"]),P=Z.get("focus"),I=Z.get("blurScope"),k=Z.get("disabled"),C=qr(U)}D.shape.r=T;var Y=r.getRawValue(N),K="-";Y&&Y[2]!=null&&(K=Y[2]+""),sn(D,C,{labelFetcher:r,labelDataIndex:N,defaultOpacity:z.opacity,defaultText:K}),D.ensureState("emphasis").style=_,D.ensureState("blur").style=b,D.ensureState("select").style=S,Kt(D,P,I,k),D.incremental=o,o&&(D.states.emphasis.hoverLayer=!0),y.add(D),x.setItemGraphicEl(N,D),this._progressiveEls&&this._progressiveEls.push(D)}},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 x7e;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(),f=r.getRoamTransform();c.applyTransform(f);var h=Math.max(c.x,0),d=Math.max(c.y,0),v=Math.min(c.width+c.x,a.getWidth()),m=Math.min(c.height+c.y,a.getHeight()),y=v-h,x=m-d,_=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],b=l.mapArray(_,function(A,P,I){var k=r.dataToPoint([A,P]);return k[0]-=h,k[1]-=d,k.push(I),k}),S=i.getExtent(),T=i.type==="visualMap.continuous"?b7e(S,i.option.range):_7e(S,i.getPieceList(),i.option.selected);u.update(b,y,x,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},T);var C=new un({style:{width:y,height:x,x:h,y:d,image:u.canvas},silent:!0});this.group.add(C)},t.type="heatmap",t}(At),S7e=function(e){X(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 vs(null,this,{generateCoord:"value"})},t.prototype.preventIncremental=function(){var r=pp.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:J.color.primary}}},t}(Lt);function T7e(e){e.registerChartView(w7e),e.registerSeriesModel(S7e)}var C7e=["itemStyle","borderWidth"],E8=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],xP=new ds,A7e=function(e){X(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(),f=l.master.getRect(),h={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:r,coordSys:l,coordSysExtent:[[f.x,f.x+f.width],[f.y,f.y+f.height]],isHorizontal:c,valueDim:E8[+c],categoryDim:E8[1-+c]};o.diff(s).add(function(v){if(o.hasValue(v)){var m=D8(o,v),y=N8(o,v,m,h),x=j8(o,h,y);o.setItemGraphicEl(v,x),a.add(x),B8(x,h,y)}}).update(function(v,m){var y=s.getItemGraphicEl(m);if(!o.hasValue(v)){a.remove(y);return}var x=D8(o,v),_=N8(o,v,x,h),b=iie(o,_);y&&b!==y.__pictorialShapeStr&&(a.remove(y),o.setItemGraphicEl(v,null),y=null),y?E7e(y,h,_):y=j8(o,h,_,!0),o.setItemGraphicEl(v,y),y.__pictorialSymbolMeta=_,a.add(y),B8(y,h,_)}).remove(function(v){var m=s.getItemGraphicEl(v);m&&R8(s,v,m.__pictorialSymbolMeta.animationModel,m)}).execute();var d=r.get("clip",!0)?K0(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){R8(a,Be(o).dataIndex,r,o)}):i.removeAll()},t.type="pictorialBar",t}(At);function N8(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,f=r.isAnimationEnabled(),h={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:f?r:null,hoverScale:f&&r.get(["emphasis","scale"]),z2:r.getShallow("z",!0)||0};M7e(r,a,i,n,h),P7e(e,t,i,a,o,h.boundingLength,h.pxSign,c,n,h),k7e(r,h.symbolScale,u,n,h);var d=h.symbolSize,v=eh(r.get("symbolOffset"),d);return L7e(r,d,i,a,o,v,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,n,h),h}function M7e(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(oe(o)){var f=[_P(s,o[0])-l,_P(s,o[1])-l];f[1]=0?1:-1:c>0?1:-1}function _P(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function P7e(e,t,r,n,i,a,o,s,l,u){var c=l.valueDim,f=l.categoryDim,h=Math.abs(r[f.wh]),d=e.getItemVisual(t,"symbolSize"),v;oe(d)?v=d.slice():d==null?v=["100%","100%"]:v=[d,d],v[f.index]=ge(v[f.index],h),v[c.index]=ge(v[c.index],n?h:Math.abs(a)),u.symbolSize=v;var m=u.symbolScale=[v[0]/s,v[1]/s];m[c.index]*=(l.isHorizontal?-1:1)*o}function k7e(e,t,r,n,i){var a=e.get(C7e)||0;a&&(xP.attr({scaleX:t[0],scaleY:t[1],rotation:r}),xP.updateTransform(),a/=xP.getLineScale(),a*=t[n.valueDim.index]),i.valueLineWidth=a||0}function L7e(e,t,r,n,i,a,o,s,l,u,c,f){var h=c.categoryDim,d=c.valueDim,v=f.pxSign,m=Math.max(t[d.index]+s,0),y=m;if(n){var x=Math.abs(l),_=mn(e.get("symbolMargin"),"15%")+"",b=!1;_.lastIndexOf("!")===_.length-1&&(b=!0,_=_.slice(0,_.length-1));var S=ge(_,t[d.index]),T=Math.max(m+S*2,0),C=b?0:S*2,A=ij(n),P=A?n:z8((x+C)/T),I=x-P*m;S=I/2/(b?P:Math.max(P-1,1)),T=m+S*2,C=b?0:S*2,!A&&n!=="fixed"&&(P=u?z8((Math.abs(u)+C)/T):0),y=P*T-C,f.repeatTimes=P,f.symbolMargin=S}var k=v*(y/2),E=f.pathPosition=[];E[h.index]=r[h.wh]/2,E[d.index]=o==="start"?k:o==="end"?l-k:l/2,a&&(E[0]+=a[0],E[1]+=a[1]);var N=f.bundlePosition=[];N[h.index]=r[h.xy],N[d.index]=r[d.xy];var D=f.barRectShape=ie({},r);D[d.wh]=v*Math.max(Math.abs(r[d.wh]),Math.abs(E[d.index]+k)),D[h.wh]=r[h.wh];var z=f.clipShape={};z[h.xy]=-r[h.xy],z[h.wh]=c.ecSize[h.wh],z[d.xy]=0,z[d.wh]=r[d.wh]}function Qne(e){var t=e.symbolPatternSize,r=Lr(e.symbolType,-t/2,-t/2,t,t);return r.attr({culling:!0}),r.type!=="image"&&r.setStyle({strokeNoScale:!0}),r}function eie(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,f=a[t.valueDim.index]+o+r.symbolMargin*2;for(qR(e,function(m){m.__pictorialAnimationIndex=c,m.__pictorialRepeatTimes=u,c0:x<0)&&(_=u-1-m),y[l.index]=f*(_-u/2+.5)+s[l.index],{x:y[0],y:y[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation}}}function tie(e,t,r,n){var i=e.__pictorialBundle,a=e.__pictorialMainPath;a?Bd(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=Qne(r),i.add(a),Bd(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 rie(e,t,r){var n=ie({},t.barRectShape),i=e.__pictorialBarRect;i?Bd(i,null,{shape:n},t,r):(i=e.__pictorialBarRect=new Qe({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,e.add(i))}function nie(e,t,r,n){if(r.symbolClip){var i=e.__pictorialClipPath,a=ie({},r.clipShape),o=t.valueDim,s=r.animationModel,l=r.dataIndex;if(i)ft(i,{shape:a},s,l);else{a[o.wh]=0,i=new Qe({shape:a}),e.__pictorialBundle.setClipPath(i),e.__pictorialClipPath=i;var u={};u[o.wh]=r.clipShape[o.wh],Kf[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function D8(e,t){var r=e.getItemModel(t);return r.getAnimationDelayParams=I7e,r.isAnimationEnabled=O7e,r}function I7e(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function O7e(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function j8(e,t,r,n){var i=new Le,a=new Le;return i.add(a),i.__pictorialBundle=a,a.x=r.bundlePosition[0],a.y=r.bundlePosition[1],r.symbolRepeat?eie(i,t,r):tie(i,t,r),rie(i,r,n),nie(i,t,r,n),i.__pictorialShapeStr=iie(e,r),i.__pictorialSymbolMeta=r,i}function E7e(e,t,r){var n=r.animationModel,i=r.dataIndex,a=e.__pictorialBundle;ft(a,{x:r.bundlePosition[0],y:r.bundlePosition[1]},n,i),r.symbolRepeat?eie(e,t,r,!0):tie(e,t,r,!0),rie(e,r,!0),nie(e,t,r,!0)}function R8(e,t,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];qR(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),R(a,function(o){Lu(o,{scaleX:0,scaleY:0},r,t,function(){n.parent&&n.parent.remove(n)})}),e.setItemGraphicEl(t,null)}function iie(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function qR(e,t,r){R(e.__pictorialBundle.children(),function(n){n!==e.__pictorialBarRect&&t.call(r,n)})}function Bd(e,t,r,n,i,a){t&&e.attr(t),n.symbolClip&&!i?r&&e.attr(r):r&&Kf[i?"updateProps":"initProps"](e,r,n.animationModel,n.dataIndex,a)}function B8(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"),f=a.get("blurScope"),h=a.get("scale");qR(e,function(m){if(m instanceof un){var y=m.style;m.useStyle(ie({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,h&&(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)],v=e.__pictorialBarRect;v.ignoreClip=!0,sn(v,qr(i),{labelFetcher:t.seriesModel,labelDataIndex:n,defaultText:Pv(t.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:d}),Kt(e,c,f,a.get("disabled"))}function z8(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}var N7e=function(e){X(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=Zu(s0.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:J.color.primary}}}),t}(s0);function D7e(e){e.registerChartView(A7e),e.registerSeriesModel(N7e),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,Ue(Tte,"pictorialBar")),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Cte("pictorialBar"))}var j7e=function(e){X(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,f=u.boundaryGap;s.x=0,s.y=c.y+f[0];function h(y){return y.name}var d=new fl(this._layersSeries||[],l,h,h),v=[];d.add(xe(m,this,"add")).update(xe(m,this,"update")).remove(xe(m,this,"remove")).execute();function m(y,x,_){var b=o._layers;if(y==="remove"){s.remove(b[x]);return}for(var S=[],T=[],C,A=l[x].indices,P=0;Pa&&(a=s),n.push(s)}for(var u=0;ua&&(a=f)}return{y0:i,max:a}}function F7e(e){e.registerChartView(j7e),e.registerSeriesModel(B7e),e.registerLayout(z7e),e.registerProcessor(wp("themeRiver"))}var V7e=2,G7e=4,F8=function(e){X(t,e);function t(r,n,i,a){var o=e.call(this)||this;o.z2=V7e,o.textConfig={inside:!0},Be(o).seriesIndex=n.seriesIndex;var s=new lt({z2:G7e,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;Be(s).dataIndex=n.dataIndex;var l=n.getModel(),u=l.getModel("emphasis"),c=n.getLayout(),f=ie({},c);f.label=null;var h=n.getVisual("style");h.lineJoin="bevel";var d=n.getVisual("decal");d&&(h.decal=Cv(d,o));var v=Uo(l.getModel("itemStyle"),f,!0);ie(f,v),R(li,function(_){var b=s.ensureState(_),S=l.getModel([_,"itemStyle"]);b.style=S.getItemStyle();var T=Uo(S,f);T&&(b.shape=T)}),r?(s.setShape(f),s.shape.r=c.r0,Gt(s,{shape:{r:c.r}},i,n.dataIndex)):(ft(s,{shape:f},i),Ea(s)),s.useStyle(h),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"?mv(n.getAncestorsIndices(),n.getDescendantIndices()):y==="ancestor"?n.getAncestorsIndices():y==="descendant"?n.getDescendantIndices():y;Kt(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),f=this,h=f.getTextContent(),d=this.node.dataIndex,v=a.get("minAngle")/180*Math.PI,m=a.get("show")&&!(v!=null&&Math.abs(s)z&&!_v(F-z)&&F0?(o.virtualPiece?o.virtualPiece.updateData(!1,_,r,n,i):(o.virtualPiece=new F8(_,r,n,i),c.add(o.virtualPiece)),b.piece.off("click"),o.virtualPiece.on("click",function(S){o._rootToNode(b.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";Qw(u,c)}}i=!0}})})},t.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:cE,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}(At),Z7e=function(e){X(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};aie(i);var a=this._levelModels=le(r.levels||[],function(l){return new it(l,this,n)},this),o=IR.createTree(i,this,s);function s(l){l.wrapMethod("getItemModel",function(u,c){var f=o.getNodeByDataIndex(c),h=a[f.depth];return h&&(u.parentModel=h),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=RC(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(){une(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}(Lt);function aie(e){var t=0;R(e.children,function(n){aie(n);var i=n.value;oe(i)&&(i=i[0]),t+=i});var r=e.value;oe(r)&&(r=r[0]),(r==null||isNaN(r))&&(r=t),r<0&&(r=0),oe(e.value)?e.value[0]=r:e.value=r}var G8=Math.PI/180;function Y7e(e,t,r){t.eachSeriesByType(e,function(n){var i=n.get("center"),a=n.get("radius");oe(a)||(a=[0,a]),oe(i)||(i=[i,i]);var o=r.getWidth(),s=r.getHeight(),l=Math.min(o,s),u=ge(i[0],o),c=ge(i[1],s),f=ge(a[0],l/2),h=ge(a[1],l/2),d=-n.get("startAngle")*G8,v=n.get("minAngle")*G8,m=n.getData().tree.root,y=n.getViewRoot(),x=y.depth,_=n.get("sort");_!=null&&oie(y,_);var b=0;R(y.children,function(F){!isNaN(F.getValue())&&b++});var S=y.getValue(),T=Math.PI/(S||b)*2,C=y.depth>0,A=y.height-(C?-1:1),P=(h-f)/(A||1),I=n.get("clockwise"),k=n.get("stillShowZeroSum"),E=I?1:-1,N=function(F,$){if(F){var B=$;if(F!==m){var H=F.getValue(),U=S===0&&k?T:H*T;U1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",t);return n.depth>1&&me(s)&&(s=zw(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");ie(u,l)})})}function K7e(e){e.registerChartView(U7e),e.registerSeriesModel(Z7e),e.registerLayout(Ue(Y7e,"sunburst")),e.registerProcessor(Ue(wp,"sunburst")),e.registerVisual(X7e),H7e(e)}var W8={color:"fill",borderColor:"stroke"},J7e={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},Xs=rt(),Q7e=function(e){X(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 vs(null,this)},t.prototype.getDataParams=function(r,n,i){var a=e.prototype.getDataParams.call(this,r,n);return i&&(a.info=Xs(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}(Lt);function e9e(e,t){return t=t||[0,0],le(["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 t9e(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:xe(e9e,e)}}}function r9e(e,t){return t=t||[0,0],le([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 n9e(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:xe(r9e,e)}}}function i9e(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 a9e(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:xe(i9e,e)}}}function o9e(e,t){return t=t||[0,0],le(["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 s9e(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:xe(o9e,e)}}}function l9e(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 u9e(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 sie(e,t,r,n){return e&&(e.legacy||e.legacy!==!1&&!r&&!n&&t!=="tspan"&&(t==="text"||we(e,"text")))}function lie(e,t,r){var n=e,i,a,o;if(t==="text")o=n;else{o={},we(n,"text")&&(o.text=n.text),we(n,"rich")&&(o.rich=n.rich),we(n,"textFill")&&(o.fill=n.textFill),we(n,"textStroke")&&(o.stroke=n.textStroke),we(n,"fontFamily")&&(o.fontFamily=n.fontFamily),we(n,"fontSize")&&(o.fontSize=n.fontSize),we(n,"fontStyle")&&(o.fontStyle=n.fontStyle),we(n,"fontWeight")&&(o.fontWeight=n.fontWeight),a={type:"text",style:o,silent:!0},i={};var s=we(n,"textPosition");r?i.position=s?n.textPosition:"inside":s&&(i.position=n.textPosition),we(n,"textPosition")&&(i.position=n.textPosition),we(n,"textOffset")&&(i.offset=n.textOffset),we(n,"textRotation")&&(i.rotation=n.textRotation),we(n,"textDistance")&&(i.distance=n.textDistance)}return H8(o,e),R(o.rich,function(l){H8(l,l)}),{textConfig:i,textContent:a}}function H8(e,t){t&&(t.font=t.textFont||t.font,we(t,"textStrokeWidth")&&(e.lineWidth=t.textStrokeWidth),we(t,"textAlign")&&(e.align=t.textAlign),we(t,"textVerticalAlign")&&(e.verticalAlign=t.textVerticalAlign),we(t,"textLineHeight")&&(e.lineHeight=t.textLineHeight),we(t,"textWidth")&&(e.width=t.textWidth),we(t,"textHeight")&&(e.height=t.textHeight),we(t,"textBackgroundColor")&&(e.backgroundColor=t.textBackgroundColor),we(t,"textPadding")&&(e.padding=t.textPadding),we(t,"textBorderColor")&&(e.borderColor=t.textBorderColor),we(t,"textBorderWidth")&&(e.borderWidth=t.textBorderWidth),we(t,"textBorderRadius")&&(e.borderRadius=t.textBorderRadius),we(t,"textBoxShadowColor")&&(e.shadowColor=t.textBoxShadowColor),we(t,"textBoxShadowBlur")&&(e.shadowBlur=t.textBoxShadowBlur),we(t,"textBoxShadowOffsetX")&&(e.shadowOffsetX=t.textBoxShadowOffsetX),we(t,"textBoxShadowOffsetY")&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function U8(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||J.color.neutral99;Z8(n,t);var o=n.textFill==null;return i?o&&(n.textFill=r.insideFill||J.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||J.color.neutral00),!n.textStroke&&r.outsideStroke&&(n.textStroke=r.outsideStroke)),n.text=t.text,n.rich=t.rich,R(t.rich,function(s){Z8(s,s)}),n}function Z8(e,t){t&&(we(t,"fill")&&(e.textFill=t.fill),we(t,"stroke")&&(e.textStroke=t.fill),we(t,"lineWidth")&&(e.textStrokeWidth=t.lineWidth),we(t,"font")&&(e.font=t.font),we(t,"fontStyle")&&(e.fontStyle=t.fontStyle),we(t,"fontWeight")&&(e.fontWeight=t.fontWeight),we(t,"fontSize")&&(e.fontSize=t.fontSize),we(t,"fontFamily")&&(e.fontFamily=t.fontFamily),we(t,"align")&&(e.textAlign=t.align),we(t,"verticalAlign")&&(e.textVerticalAlign=t.verticalAlign),we(t,"lineHeight")&&(e.textLineHeight=t.lineHeight),we(t,"width")&&(e.textWidth=t.width),we(t,"height")&&(e.textHeight=t.height),we(t,"backgroundColor")&&(e.textBackgroundColor=t.backgroundColor),we(t,"padding")&&(e.textPadding=t.padding),we(t,"borderColor")&&(e.textBorderColor=t.borderColor),we(t,"borderWidth")&&(e.textBorderWidth=t.borderWidth),we(t,"borderRadius")&&(e.textBorderRadius=t.borderRadius),we(t,"shadowColor")&&(e.textBoxShadowColor=t.shadowColor),we(t,"shadowBlur")&&(e.textBoxShadowBlur=t.shadowBlur),we(t,"shadowOffsetX")&&(e.textBoxShadowOffsetX=t.shadowOffsetX),we(t,"shadowOffsetY")&&(e.textBoxShadowOffsetY=t.shadowOffsetY),we(t,"textShadowColor")&&(e.textShadowColor=t.textShadowColor),we(t,"textShadowBlur")&&(e.textShadowBlur=t.textShadowBlur),we(t,"textShadowOffsetX")&&(e.textShadowOffsetX=t.textShadowOffsetX),we(t,"textShadowOffsetY")&&(e.textShadowOffsetY=t.textShadowOffsetY))}var uie={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},Y8=st(uie);La(is,function(e,t){return e[t]=1,e},{});is.join(", ");var MS=["","style","shape","extra"],Ov=rt();function XR(e,t,r,n,i){var a=e+"Animation",o=cp(e,n,i)||{},s=Ov(t).userDuring;return o.duration>0&&(o.during=s?xe(v9e,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),ie(o,r[a]),o}function Xb(e,t,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=r.isAnimationEnabled(),l=Ov(e),u=t.style;l.userDuring=t.during;var c={},f={};if(g9e(e,t,f),e.type==="compound")for(var h=e.shape.paths,d=t.shape.paths,v=0;v0&&e.animateFrom(y,x)}else f9e(e,t,i||0,r,c);cie(e,t),u?e.dirty():e.markRedraw()}function cie(e,t){for(var r=Ov(e).leaveToProps,n=0;n0&&e.animateFrom(i,a)}}function h9e(e,t){we(t,"silent")&&(e.silent=t.silent),we(t,"ignore")&&(e.ignore=t.ignore),e instanceof Oa&&we(t,"invisible")&&(e.invisible=t.invisible),e instanceof at&&we(t,"autoBatch")&&(e.autoBatch=t.autoBatch)}var Oo={},d9e={setTransform:function(e,t){return Oo.el[e]=t,this},getTransform:function(e){return Oo.el[e]},setShape:function(e,t){var r=Oo.el,n=r.shape||(r.shape={});return n[e]=t,r.dirtyShape&&r.dirtyShape(),this},getShape:function(e){var t=Oo.el.shape;if(t)return t[e]},setStyle:function(e,t){var r=Oo.el,n=r.style;return n&&(n[e]=t,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(e){var t=Oo.el.style;if(t)return t[e]},setExtra:function(e,t){var r=Oo.el.extra||(Oo.el.extra={});return r[e]=t,this},getExtra:function(e){var t=Oo.el.extra;if(t)return t[e]}};function v9e(){var e=this,t=e.el;if(t){var r=Ov(t).userDuring,n=e.userDuring;if(r!==n){e.el=e.userDuring=null;return}Oo.el=t,n(d9e)}}function q8(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]={}),mf(l))ie(o,a);else for(var u=Dt(l),c=0;c=0){!o&&(o=n[e]={});for(var d=st(a),c=0;c=0)){var h=e.getAnimationStyleProps(),d=h?h.style:null;if(d){!a&&(a=n.style={});for(var v=st(r),u=0;u=0?t.getStore().get(B,F):void 0}var H=t.get($.name,F),U=$&&$.ordinalMeta;return U?U.categories[H]:H}function A(V,F){F==null&&(F=c);var $=t.getItemVisual(F,"style"),B=$&&$.fill,H=$&&$.opacity,U=b(F,nu).getItemStyle();B!=null&&(U.fill=B),H!=null&&(U.opacity=H);var Z={inheritColor:me(B)?B:J.color.neutral99},Y=S(F,nu),K=Nt(Y,null,Z,!1,!0);K.text=Y.getShallow("show")?Ce(e.getFormattedLabel(F,nu),Pv(t,F)):null;var te=Xw(Y,Z,!1);return k(V,U),U=U8(U,K,te),V&&I(U,V),U.legacy=!0,U}function P(V,F){F==null&&(F=c);var $=b(F,Ks).getItemStyle(),B=S(F,Ks),H=Nt(B,null,null,!0,!0);H.text=B.getShallow("show")?wi(e.getFormattedLabel(F,Ks),e.getFormattedLabel(F,nu),Pv(t,F)):null;var U=Xw(B,null,!0);return k(V,$),$=U8($,H,U),V&&I($,V),$.legacy=!0,$}function I(V,F){for(var $ in F)we(F,$)&&(V[$]=F[$])}function k(V,F){V&&(V.textFill&&(F.textFill=V.textFill),V.textPosition&&(F.textPosition=V.textPosition))}function E(V,F){if(F==null&&(F=c),we(W8,V)){var $=t.getItemVisual(F,"style");return $?$[W8[V]]:null}if(we(J7e,V))return t.getItemVisual(F,V)}function N(V){if(o.type==="cartesian2d"){var F=o.getBaseAxis();return w$e(Oe({axis:F},V))}}function D(){return r.getCurrentSeriesIndices()}function z(V){return Tj(V,r)}}function M9e(e){var t={};return R(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 CP(e,t,r,n,i,a,o){if(!n){a.remove(t);return}var s=t3(e,t,r,n,i,a);return s&&o.setItemGraphicEl(r,s),s&&Kt(s,n.focus,n.blurScope,n.emphasisDisabled),s}function t3(e,t,r,n,i,a){var o=-1,s=t;t&&vie(t,n,i)&&(o=Ze(a.childrenRef(),t),t=null);var l=!t,u=t;u?u.clearStates():(u=QR(n),s&&S9e(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),n.tooltipDisabled&&(u.tooltipDisabled=!0),la.normal.cfg=la.normal.conOpt=la.emphasis.cfg=la.emphasis.conOpt=la.blur.cfg=la.blur.conOpt=la.select.cfg=la.select.conOpt=null,la.isLegacy=!1,k9e(u,r,n,i,l,la),P9e(u,r,n,i,l),e3(e,u,r,n,la,i,l),we(n,"info")&&(Xs(u).info=n.info);for(var c=0;c=0?a.replaceAt(u,o):a.add(u),u}function vie(e,t,r){var n=Xs(e),i=t.type,a=t.shape,o=t.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&N9e(a)&&pie(a)!==n.customPathData||i==="image"&&we(o,"image")&&o.image!==n.customImagePath}function P9e(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&&vie(o,a,n)&&(o=null),o||(o=QR(a),e.setClipPath(o)),e3(null,o,t,a,null,n,i)}}function k9e(e,t,r,n,i,a){if(!(e.isGroup||e.type==="compoundPath")){K8(r,null,a),K8(r,Ks,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=QR(o),e.setTextContent(c)),e3(null,c,t,o,null,n,i);for(var f=o&&o.style,h=0;h=c;d--){var v=t.childAt(d);I9e(t,v,i)}}}function I9e(e,t,r){t&&$C(t,Xs(e).option,r)}function O9e(e){new fl(e.oldChildren,e.newChildren,J8,J8,e).add(Q8).update(Q8).remove(E9e).execute()}function J8(e,t){var r=e&&e.name;return r??b9e+t}function Q8(e,t){var r=this.context,n=e!=null?r.newChildren[e]:null,i=t!=null?r.oldChildren[t]:null;t3(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function E9e(e){var t=this.context,r=t.oldChildren[e];r&&$C(r,Xs(r).option,t.seriesModel)}function pie(e){return e&&(e.pathData||e.d)}function N9e(e){return e&&(we(e,"pathData")||we(e,"d"))}function D9e(e){e.registerChartView(T9e),e.registerSeriesModel(Q7e)}var Fc=rt(),eH=ke,AP=xe,n3=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 f=this._moveAnimation=this.determineAnimation(t,r);if(!s)s=this._group=new Le,this.createPointerEl(s,u,t,r),this.createLabelEl(s,u,t,r),n.getZr().add(s);else{var h=Ue(tH,r,f);this.updatePointerEl(s,u,h),this.updateLabelEl(s,u,h,r)}nH(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=TR(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=Fc(t).pointerEl=new Kf[a.type](eH(r.pointer));t.add(o)}},e.prototype.createLabelEl=function(t,r,n,i){if(r.label){var a=Fc(t).labelEl=new lt(eH(r.label));t.add(a),rH(a,i)}},e.prototype.updatePointerEl=function(t,r,n){var i=Fc(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=Fc(t).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),rH(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=fp(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){ll(u.event)},onmousedown:AP(this._onHandleDragMove,this,0,0),drift:AP(this._onHandleDragMove,this),ondragend:AP(this._onHandleDragEnd,this)}),n.add(i)),nH(i,r,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");oe(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,mp(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,s)}},e.prototype._moveHandleToValue=function(t,r){tH(this._axisPointerModel,!r&&this._moveAnimation,this._handle,MP(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(MP(n),[t,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(MP(i)),Fc(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),Qy(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 tH(e,t,r,n){gie(Fc(r).lastProp,n)||(Fc(r).lastProp=n,t?ft(r,n,e):(r.stopAnimation(),r.attr(n)))}function gie(e,t){if(Ee(e)&&Ee(t)){var r=!0;return R(t,function(n,i){r=r&&gie(e[i],n)}),!!r}else return e===t}function rH(e,t){e[t.get(["label","show"])?"show":"hide"]()}function MP(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function nH(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 i3(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 mie(e,t,r,n,i){var a=r.get("value"),o=yie(a,t.axis,t.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=vp(s.get("padding")||0),u=s.getFont(),c=cC(o,u),f=i.position,h=c.width+l[1]+l[3],d=c.height+l[0]+l[2],v=i.align;v==="right"&&(f[0]-=h),v==="center"&&(f[0]-=h/2);var m=i.verticalAlign;m==="bottom"&&(f[1]-=d),m==="middle"&&(f[1]-=d/2),j9e(f,h,d,n);var y=s.get("backgroundColor");(!y||y==="auto")&&(y=t.get(["axisLine","lineStyle","color"])),e.label={x:f[0],y:f[1],style:Nt(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:y}),z2:10}}function j9e(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 yie(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:cS(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};R(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,f=u&&u.getDataParams(c);f&&s.seriesData.push(f)}),me(o)?a=o.replace("{value}",a):Pe(o)&&(a=o(s))}return a}function a3(e,t,r){var n=an();return xl(n,n,r.rotation),po(n,n,r.position),uo([e.dataToCoord(t),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function xie(e,t,r,n,i,a){var o=ai.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),mie(t,n,i,a,{position:a3(n.axis,e,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function o3(e,t,r){return r=r||0,{x1:e[r],y1:e[1-r],x2:t[r],y2:t[1-r]}}function _ie(e,t,r){return r=r||0,{x:e[r],y:e[1-r],width:t[r],height:t[1-r]}}function iH(e,t,r,n,i,a){return{cx:e,cy:t,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}var R9e=function(e){X(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=aH(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var h=i3(a),d=B9e[u](s,f,c);d.style=h,r.graphicKey=d.type,r.pointer=d}var v=_S(l.getRect(),i);xie(n,r,v,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=_S(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=a3(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=aH(s,o).getOtherAxis(o).getGlobalExtent(),c=o.dim==="x"?0:1,f=[r.x,r.y];f[c]+=n[c],f[c]=Math.min(l[1],f[c]),f[c]=Math.max(l[0],f[c]);var h=(u[1]+u[0])/2,d=[h,h];d[c]=f[c];var v=[{verticalAlign:"middle"},{align:"center"}];return{x:f[0],y:f[1],rotation:r.rotation,cursorPoint:d,tooltipOption:v[c]}},t}(n3);function aH(e,t){var r={};return r[t.dim+"AxisIndex"]=t.index,e.getCartesian(r)}var B9e={line:function(e,t,r){var n=o3([t,r[0]],[t,r[1]],oH(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:_ie([t-n/2,r[0]],[n,i],oH(e))}}};function oH(e){return e.dim==="x"?0:1}var z9e=function(e){X(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:J.color.border,width:1,type:"dashed"},shadowStyle:{color:J.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:J.color.neutral00,padding:[5,7,5,7],backgroundColor:J.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:J.color.accent40,throttle:40}},t}(tt),Vs=rt(),$9e=R;function bie(e,t,r){if(!ot.node){var n=t.getZr();Vs(n).records||(Vs(n).records={}),F9e(n,t);var i=Vs(n).records[e]||(Vs(n).records[e]={});i.handler=r}}function F9e(e,t){if(Vs(e).initialized)return;Vs(e).initialized=!0,r("click",Ue(sH,"click")),r("mousemove",Ue(sH,"mousemove")),r("globalout",G9e);function r(n,i){e.on(n,function(a){var o=W9e(t);$9e(Vs(e).records,function(s){s&&i(s,a,o.dispatchAction)}),V9e(o.pendings,t)})}}function V9e(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 G9e(e,t,r){e.handler("leave",null,r)}function sH(e,t,r,n){t.handler(e,r,n)}function W9e(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 dE(e,t){if(!ot.node){var r=t.getZr(),n=(Vs(r).records||{})[e];n&&(Vs(r).records[e]=null)}}var H9e=function(e){X(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";bie("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){dE("axisPointer",n)},t.prototype.dispose=function(r,n){dE("axisPointer",n)},t.type="axisPointer",t}(jt);function wie(e,t){var r=[],n=e.seriesIndex,i;if(n==null||!(i=t.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=If(a,e);if(o==null||o<0||oe(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),f=c.dim,h=u.dim,d=f==="x"||f==="radius"?1:0,v=a.mapDimension(h),m=[];m[d]=a.get(v,o),m[1-d]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(m)||[]}else r=l.dataToPoint(a.getValues(le(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 lH=rt();function U9e(e,t,r){var n=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||xe(r.dispatchAction,r),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){Kb(i)&&(i=wie({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var l=Kb(i),u=a.axesInfo,c=s.axesInfo,f=n==="leave"||Kb(i),h={},d={},v={list:[],map:{}},m={showPointer:Ue(Y9e,d),showTooltip:Ue(q9e,v)};R(s.coordSysMap,function(x,_){var b=l||x.containPoint(i);R(s.coordSysAxesInfo[_],function(S,T){var C=S.axis,A=Q9e(u,S);if(!f&&b&&(!u||A)){var P=A&&A.value;P==null&&!l&&(P=C.pointToData(i)),P!=null&&uH(S,P,m,!1,h)}})});var y={};return R(c,function(x,_){var b=x.linkGroup;b&&!d[_]&&R(b.axesInfo,function(S,T){var C=d[T];if(S!==x&&C){var A=C.value;b.mapper&&(A=x.axis.scale.parse(b.mapper(A,cH(S),cH(x)))),y[x.key]=A}})}),R(y,function(x,_){uH(c[_],x,m,!0,h)}),X9e(d,c,h),K9e(v,i,e,o),J9e(c,o,r),h}}function uH(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=Z9e(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&ie(i,s[0]),!n&&e.snap&&a.containData(l)&&l!=null&&(t=l),r.showPointer(e,t,s),r.showTooltip(e,o,l)}}function Z9e(e,t){var r=t.axis,n=r.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return R(t.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(n),f,h;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(c,e,r);h=d.dataIndices,f=d.nestestValue}else{if(h=l.indicesOfNearest(n,c[0],e,r.type==="category"?.5:null),!h.length)return;f=l.getData().get(c[0],h[0])}if(!(f==null||!isFinite(f))){var v=e-f,m=Math.abs(v);m<=o&&((m=0&&s<0)&&(o=m,s=v,i=f,a.length=0),R(h,function(y){a.push({seriesIndex:l.seriesIndex,dataIndexInside:y,dataIndex:l.getData().getRawIndex(y)})}))}}),{payloadBatch:a,snapToValue:i}}function Y9e(e,t,r,n){e[t.key]={value:r,payloadBatch:n}}function q9e(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=l0(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 X9e(e,t,r){var n=r.axesInfo=[];R(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 K9e(e,t,r,n){if(Kb(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 J9e(e,t,r){var n=r.getZr(),i="axisPointerLastHighlights",a=lH(n)[i]||{},o=lH(n)[i]={};R(e,function(u,c){var f=u.axisPointerModel.option;f.status==="show"&&u.triggerEmphasis&&R(f.seriesDataIndices,function(h){var d=h.seriesIndex+" | "+h.dataIndex;o[d]=h})});var s=[],l=[];R(a,function(u,c){!o[c]&&l.push(u)}),R(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 Q9e(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 cH(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 Kb(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function ex(e){th.registerAxisPointerClass("CartesianAxisPointer",R9e),e.registerComponentModel(z9e),e.registerComponentView(H9e),e.registerPreprocessor(function(t){if(t){(!t.axisPointer||t.axisPointer.length===0)&&(t.axisPointer={});var r=t.axisPointer.link;r&&!oe(r)&&(t.axisPointer.link=[r])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(t,r){t.getComponent("axisPointer").coordSysAxesInfo=eGe(t,r)}),e.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},U9e)}function eZe(e){Ke(Ure),Ke(ex)}var tZe=function(e){X(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(),f=s.dataToCoord(n),h=a.get("type");if(h&&h!=="none"){var d=i3(a),v=nZe[h](s,l,f,c);v.style=d,r.graphicKey=v.type,r.pointer=v}var m=a.get(["label","margin"]),y=rZe(n,i,a,l,m);mie(r,i,a,o,y)},t}(n3);function rZe(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,f;if(a.dim==="radius"){var h=an();xl(h,h,s),po(h,h,[n.cx,n.cy]),u=uo([o,-i],h);var d=t.getModel("axisLabel").get("rotate")||0,v=ai.innerTextLayout(s,d*Math.PI/180,-1);c=v.textAlign,f=v.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",f=Math.abs(u[1]-x)/m<.3?"middle":u[1]>x?"top":"bottom"}return{position:u,align:c,verticalAlign:f}}var nZe={line:function(e,t,r,n){return e.dim==="angle"?{type:"Line",shape:o3(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:iH(t.cx,t.cy,n[0],n[1],(-r-i/2)*a,(-r+i/2)*a)}:{type:"Sector",shape:iH(t.cx,t.cy,r-i/2,r+i/2,0,Math.PI*2)}}},iZe=function(e){X(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}(tt),s3=function(e){X(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",ur).models[0]},t.type="polarAxis",t}(tt);br(s3,bp);var aZe=function(e){X(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="angleAxis",t}(s3),oZe=function(e){X(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="radiusAxis",t}(s3),l3=function(e){X(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}(Ba);l3.prototype.dataToRadius=Ba.prototype.dataToCoord;l3.prototype.radiusToData=Ba.prototype.coordToData;var sZe=rt(),u3=function(e){X(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=cC(s==null?"":s+"",n.getFont(),"center","top"),f=Math.max(c.height,7),h=f/u;isNaN(h)&&(h=1/0);var d=Math.max(0,Math.floor(h)),v=sZe(r.model),m=v.lastAutoInterval,y=v.lastTickCount;return m!=null&&y!=null&&Math.abs(m-d)<=1&&Math.abs(y-o)<=1&&m>d?d=m:(v.lastTickCount=o,v.lastAutoInterval=d),d},t}(Ba);u3.prototype.dataToAngle=Ba.prototype.dataToCoord;u3.prototype.angleToData=Ba.prototype.coordToData;var Sie=["radius","angle"],lZe=function(){function e(t){this.dimensions=Sie,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new l3,this._angleAxis=new u3,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,f=u*u+c*c,h=this.r,d=this.r0;return h!==d&&f-o<=h*h&&f+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=fH(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=fH(r);return i===this?this.pointToData(n):null},e}();function fH(e){var t=e.seriesModel,r=e.polarModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function uZe(e,t,r){var n=t.get("center"),i=Xr(t,r).refContainer;e.cx=ge(n[0],i.width)+i.x,e.cy=ge(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%"]:oe(s)||(s=[0,s]);var l=[ge(s[0],o),ge(s[1],o)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function cZe(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();R(fS(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),R(fS(l,"angle"),function(u){n.scale.unionExtentFromData(l,u)})}}),Rf(n.scale,n.model),Rf(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 fZe(e){return e.mainType==="angleAxis"}function hH(e,t){var r;if(e.type=t.get("type"),e.scale=Y0(t),e.onBand=t.get("boundaryGap")&&e.type==="category",e.inverse=t.get("inverse"),fZe(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 hZe={dimensions:Sie,create:function(e,t){var r=[];return e.eachComponent("polar",function(n,i){var a=new lZe(i+"");a.update=cZe;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");hH(o,l),hH(s,u),uZe(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",ur).models[0];n.coordinateSystem=i.coordinateSystem}}),r}},dZe=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function ab(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 ob(e){var t=e.getRadiusAxis();return t.inverse?0:1}function dH(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 vZe=function(e){X(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=le(i.getViewLabels(),function(c){c=ke(c);var f=i.scale,h=f.type==="ordinal"?f.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=i.dataToCoord(h),c});dH(u),dH(s),R(dZe,function(c){r.get([c,"show"])&&(!i.scale.isBlank()||c==="axisLine")&&pZe[c](this.group,r,a,s,l,o,u)},this)}},t.type="angleAxis",t}(th),pZe={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=ob(r),f=c?0:1,h,d=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[f]===0?h=new Kf[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}):h=new lp({shape:{cx:r.cx,cy:r.cy,r:a[c],r0:a[f]},style:o.getLineStyle(),z2:1,silent:!0}),h.style.fill=null,e.add(h)},axisTick:function(e,t,r,n,i,a){var o=t.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[ob(r)],u=le(n,function(c){return new Pr({shape:ab(r,[l,l+s],c.coord)})});e.add(zi(u,{style:Oe(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[ob(r)],c=[],f=0;fx?"left":"right",S=Math.abs(y[1]-_)/m<.3?"middle":y[1]>_?"top":"bottom";if(s&&s[v]){var T=s[v];Ee(T)&&T.textStyle&&(d=new it(T.textStyle,l,l.ecModel))}var C=new lt({silent:ai.isLabelSilent(t),style:Nt(d,{x:y[0],y:y[1],fill:d.getTextColor()||t.get(["axisLine","lineStyle","color"]),text:f.formattedLabel,align:b,verticalAlign:S})});if(e.add(C),bl({el:C,componentModel:t,itemName:f.formattedLabel,formatterParamsExtra:{isTruncated:function(){return C.isTruncated},value:f.rawLabel,tickIndex:h}}),c){var A=ai.makeAxisEventDataBase(t);A.targetType="axisLabel",A.value=f.rawLabel,Be(C).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=[],f=0;f=0?"p":"n",V=I;T&&(n[c][D]||(n[c][D]={p:I,n:I}),V=n[c][D][z]);var F=void 0,$=void 0,B=void 0,H=void 0;if(v.dim==="radius"){var U=v.dataToCoord(N)-I,Z=l.dataToCoord(D);Math.abs(U)=H})}}})}function bZe(e){var t={};R(e,function(n,i){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=Cie(o,s),u=s.getExtent(),c=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),f=t[l]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},h=f.stacks;t[l]=f;var d=Tie(n);h[d]||f.autoWidthCount++,h[d]=h[d]||{width:0,maxWidth:0};var v=ge(n.get("barWidth"),c),m=ge(n.get("barMaxWidth"),c),y=n.get("barGap"),x=n.get("barCategoryGap");v&&!h[d].width&&(v=Math.min(f.remainedWidth,v),h[d].width=v,f.remainedWidth-=v),m&&(h[d].maxWidth=m),y!=null&&(f.gap=y),x!=null&&(f.categoryGap=x)});var r={};return R(t,function(n,i){r[i]={};var a=n.stacks,o=n.bandWidth,s=ge(n.categoryGap,o),l=ge(n.gap,1),u=n.remainedWidth,c=n.autoWidthCount,f=(u-s)/(c+(c-1)*l);f=Math.max(f,0),R(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=vH(r);return i===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,r,n){var i=vH(r);return i===this?this.pointToData(n):null},e}();function vH(e){var t=e.seriesModel,r=e.singleAxisModel;return r&&r.coordinateSystem||t&&t.coordinateSystem}function IZe(e,t){var r=[];return e.eachComponent("singleAxis",function(n,i){var a=new LZe(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",ur).models[0];n.coordinateSystem=i&&i.coordinateSystem}}),r}var OZe={create:IZe,dimensions:Aie},pH=["x","y"],EZe=["width","height"],NZe=function(e){X(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=PP(l,1-LS(s)),c=l.dataToPoint(n)[0],f=a.get("type");if(f&&f!=="none"){var h=i3(a),d=DZe[f](s,c,u);d.style=h,r.graphicKey=d.type,r.pointer=d}var v=vE(i);xie(n,r,v,i,a,o)},t.prototype.getHandleTransform=function(r,n,i){var a=vE(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=a3(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=LS(o),u=PP(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 f=PP(s,1-l),h=(f[1]+f[0])/2,d=[h,h];return d[l]=c[l],{x:c[0],y:c[1],rotation:r.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}},t}(n3),DZe={line:function(e,t,r){var n=o3([t,r[0]],[t,r[1]],LS(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:_ie([t-n/2,r[0]],[n,i],LS(e))}}};function LS(e){return e.isHorizontal()?0:1}function PP(e,t){var r=e.getRect();return[r[pH[t]],r[pH[t]]+r[EZe[t]]]}var jZe=function(e){X(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="single",t}(jt);function RZe(e){Ke(ex),th.registerAxisPointerClass("SingleAxisPointer",NZe),e.registerComponentView(jZe),e.registerComponentView(MZe),e.registerComponentModel(Jb),kv(e,"single",Jb,Jb.defaultOption),e.registerCoordinateSystem("single",OZe)}var BZe=function(e){X(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=Jf(r);e.prototype.init.apply(this,arguments),gH(r,a)},t.prototype.mergeOption=function(r){e.prototype.mergeOption.apply(this,arguments),gH(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:J.color.axisLine,width:1,type:"solid"}},itemStyle:{color:J.color.neutral00,borderWidth:1,borderColor:J.color.neutral10},dayLabel:{show:!0,firstDay:0,position:"start",margin:J.size.s,color:J.color.secondary},monthLabel:{show:!0,position:"start",margin:J.size.s,align:"center",formatter:null,color:J.color.secondary},yearLabel:{show:!0,position:null,margin:J.size.xl,formatter:null,color:J.color.quaternary,fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},t}(tt);function gH(e,t){var r=e.cellSize,n;oe(r)?n=r:n=e.cellSize=[r,r],n.length===1&&(n[1]=n[0]);var i=le([0,1],function(a){return oBe(t,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});ss(e,t,{type:"box",ignoreSize:i})}var zZe=function(e){X(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,f=new Qe({shape:{x:c[0],y:c[1],width:s,height:l},cursor:"default",style:o});i.add(f)}},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 f=n.start,h=0;f.time<=n.end.time;h++){v(f.formatedDate),h===0&&(f=s.getDateInfo(n.start.y+"-"+n.start.m));var d=f.date;d.setMonth(d.getMonth()+1),f=s.getDateInfo(d)}v(s.getNextNDay(n.end.time,1).formatedDate);function v(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 xn({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 me(r)&&r?Q5e(r,n):Pe(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,f=(u[0][1]+u[1][1])/2,h=i==="horizontal"?0:1,d={top:[c,u[h][1]],bottom:[c,u[1-h][1]],left:[u[1-h][0],f],right:[u[h][0],f]},v=n.start.y;+n.end.y>+n.start.y&&(v=v+"-"+n.end.y);var m=o.get("formatter"),y={start:n.start.y,end:n.end.y,nameMap:v},x=this._formatterLabel(m,y),_=new lt({z2:30,style:Nt(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"),f=[this._tlpoints,this._blpoints];(!s||me(s))&&(s&&(n=uO(s)||n),s=n.get(["time","monthAbbr"])||[]);var h=u==="start"?0:1,d=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var v=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/kP)-Math.floor(r[0].time/kP)+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),f=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:f,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){U0({targetModel:a,coordSysType:"calendar",coordSysProvider:HQ})}),n},e.dimensions=["time","value"],e}();function LP(e){var t=e.calendarModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}function FZe(e){e.registerComponentModel(BZe),e.registerComponentView(zZe),e.registerCoordinateSystem("calendar",$Ze)}var Es={level:1,leaf:2,nonLeaf:3},Js={none:0,all:1,body:2,corner:3};function pE(e,t,r){var n=t[Ve[r]].getCell(e);return!n&&ut(e)&&e<0&&(n=t[Ve[1-r]].getUnitLayoutInfo(r,Math.round(e))),n}function Mie(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 Pie(e,t,r,n,i){mH(e[0],t,i,r,n,0),mH(e[1],t,i,r,n,1)}function mH(e,t,r,n,i,a){e[0]=1/0,e[1]=-1/0;var o=n[a],s=oe(o)?o:[o],l=s.length,u=!!r;if(l>=1?(yH(e,t,s,u,i,a,0),l>1&&yH(e,t,s,u,i,a,l-1)):e[0]=e[1]=NaN,u){var c=-i[Ve[1-a]].getLocatorCount(a),f=i[Ve[a]].getLocatorCount(a)-1;r===Js.body?c=Ar(0,c):r===Js.corner&&(f=Ui(-1,f)),f=t[0]&&e[0]<=t[1]}function bH(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 WZe(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 wH(e,t,r,n){var i=pE(t[n][0],r,n),a=pE(t[n][1],r,n);e[Ve[n]]=e[Br[n]]=NaN,i&&a&&(e[Ve[n]]=i.xy,e[Br[n]]=a.xy+a.wh-i.xy)}function Ig(e,t,r,n){return e[Ve[t]]=r,e[Ve[1-t]]=n,e}function HZe(e){return e&&(e.type===Es.leaf||e.type===Es.nonLeaf)?e:null}function IS(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var SH=function(){function e(t,r){this._cells=[],this._levels=[],this.dim=t,this.dimIdx=t==="x"?0:1,this._model=r,this._uniqueValueGen=UZe(t);var n=r.get("data",!0);n!=null&&!oe(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,f){var h=0;return u&&R(u,function(d,v){var m;me(d)?m={value:d}:Ee(d)?(m=d,d.value!=null&&!me(d.value)&&(m={value:null})):m={value:null};var y={type:Es.nonLeaf,ordinal:NaN,level:f,firstLeafLocator:c,id:new De,span:Ig(new De,r.dimIdx,1,1),option:m,xy:NaN,wh:NaN,dim:r,rect:IS()};o++,(a[c]||(a[c]=[])).push(y),i[f]||(i[f]={type:Es.level,xy:NaN,wh:NaN,option:null,id:new De,dim:r});var x=s(m.children,c,f+1),_=Math.max(1,x);y.span[Ve[r.dimIdx]]=_,h+=_,c+=_}),h}function l(){for(var u=[];n.length=1,b=r[Ve[n]],S=a.getLocatorCount(n)-1,T=new mu;for(o.resetLayoutIterator(T,n);T.next();)C(T.item);for(a.resetLayoutIterator(T,n);T.next();)C(T.item);function C(A){In(A.wh)&&(A.wh=x),A.xy=b,A.id[Ve[n]]===S&&!_&&(A.wh=r[Ve[n]]+r[Br[n]]-A.xy),b+=A.wh}}function LH(e,t){for(var r=t[Ve[e]].resetCellIterator();r.next();){var n=r.item;OS(n.rect,e,n.id,n.span,t),OS(n.rect,1-e,n.id,n.span,t),n.type===Es.nonLeaf&&(n.xy=n.rect[Ve[e]],n.wh=n.rect[Br[e]])}}function IH(e,t){e.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;OS(i,0,a,n,t),OS(i,1,a,n,t)}})}function OS(e,t,r,n,i){e[Br[t]]=0;var a=r[Ve[t]],o=a<0?i[Ve[1-t]]:i[Ve[t]],s=o.getUnitLayoutInfo(t,r[Ve[t]]);if(e[Ve[t]]=s.xy,e[Br[t]]=s.wh,n[Ve[t]]>1){var l=o.getUnitLayoutInfo(t,r[Ve[t]]+n[Ve[t]]-1);e[Br[t]]=l.xy+l.wh-s.xy}}function aYe(e,t,r){var n=Hw(e,r[Br[t]]);return mE(n,r[Br[t]])}function mE(e,t){return Math.max(Math.min(e,Ce(t,1/0)),0)}function EP(e){var t=e.matrixModel,r=e.seriesModel,n=t?t.coordinateSystem:r?r.coordinateSystem:null;return n}var Mn={inBody:1,inCorner:2,outside:3},Lo={x:null,y:null,point:[]};function OH(e,t,r,n,i){var a=r[Ve[t]],o=r[Ve[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,f=e.point[t]=n[t];if(!l&&!c){e[Ve[t]]=Mn.outside;return}if(i===Js.body){l?(e[Ve[t]]=Mn.inBody,f=Ui(s.xy+s.wh,Ar(l.xy,f)),e.point[t]=f):e[Ve[t]]=Mn.outside;return}else if(i===Js.corner){c?(e[Ve[t]]=Mn.inCorner,f=Ui(c.xy+c.wh,Ar(u.xy,f)),e.point[t]=f):e[Ve[t]]=Mn.outside;return}var h=l?l.xy:c?c.xy+c.wh:NaN,d=u?u.xy:h,v=s?s.xy+s.wh:h;if(fv){if(!i){e[Ve[t]]=Mn.outside;return}f=v}e.point[t]=f,e[Ve[t]]=h<=f&&f<=v?Mn.inBody:d<=f&&f<=h?Mn.inCorner:Mn.outside}function EH(e,t,r,n){var i=1-r;if(e[Ve[r]]!==Mn.outside)for(n[Ve[r]].resetCellIterator(OP);OP.next();){var a=OP.item;if(DH(e.point[r],a.rect,r)&&DH(e.point[i],a.rect,i)){t[r]=a.ordinal,t[i]=a.id[Ve[i]];return}}}function NH(e,t,r,n){if(e[Ve[r]]!==Mn.outside){var i=e[Ve[r]]===Mn.inCorner?n[Ve[1-r]]:n[Ve[r]];for(i.resetLayoutIterator(fb,r);fb.next();)if(oYe(e.point[r],fb.item)){t[r]=fb.item.id[Ve[r]];return}}}function oYe(e,t){return t.xy<=e&&e<=t.xy+t.wh}function DH(e,t,r){return t[Ve[r]]<=e&&e<=t[Ve[r]]+t[Br[r]]}function sYe(e){e.registerComponentModel(XZe),e.registerComponentView(tYe),e.registerCoordinateSystem("matrix",iYe)}function lYe(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 jH(e,t){var r;return R(t,function(n){e[n]!=null&&e[n]!=="auto"&&(r=!0)}),r}function uYe(e,t,r){var n=ie({},r),i=e[t],a=r.$action||"merge";a==="merge"?i?(qe(i,n,!0),ss(i,n,{ignoreSize:!0}),XQ(r,i),hb(r,i),hb(r,i,"shape"),hb(r,i,"style"),hb(r,i,"extra"),r.clipPath=i.clipPath):e[t]=n:a==="replace"?e[t]=n:a==="remove"&&i&&(e[t]=null)}var Lie=["transition","enterFrom","leaveTo"],cYe=Lie.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function hb(e,t,r){if(r&&(!e[r]&&t[r]&&(e[r]={}),e=e[r],t=t[r]),!(!e||!t))for(var n=r?Lie:cYe,i=0;i=0;c--){var f=i[c],h=Hr(f.id,null),d=h!=null?o.get(h):null;if(d){var v=d.parent,x=da(v),_=v===a?{width:s,height:l}:{width:x.width,height:x.height},b={},S=TC(d,f,_,null,{hv:f.hv,boundingMode:f.bounding},b);if(!da(d).isNew&&S){for(var T=f.transition,C={},A=0;A=0)?C[P]=I:d[P]=I}ft(d,C,r,0)}else d.attr(b)}}},t.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){Qb(i,da(i).option,n,r._lastGraphicModel)}),this._elMap=Se()},t.prototype.dispose=function(){this._clear()},t.type="graphic",t}(jt);function yE(e){var t=we(RH,e)?RH[e]:qy(e),r=new t({});return da(r).type=e,r}function BH(e,t,r,n){var i=yE(r);return t.add(i),n.set(e,i),da(i).id=e,da(i).isNew=!0,i}function Qb(e,t,r,n){var i=e&&e.parent;i&&(e.type==="group"&&e.traverse(function(a){Qb(a,t,r,n)}),$C(e,t,n),r.removeKey(da(e).id))}function zH(e,t,r,n){e.isGroup||R([["cursor",Oa.prototype.cursor],["zlevel",n||0],["z",r||0],["z2",0]],function(i){var a=i[0];we(t,a)?e[a]=Ce(t[a],i[1]):e[a]==null&&(e[a]=i[1])}),R(st(t),function(i){if(i.indexOf("on")===0){var a=t[i];e[i]=Pe(a)?a:null}}),we(t,"draggable")&&(e.draggable=t.draggable),t.name!=null&&(e.name=t.name),t.id!=null&&(e.id=t.id)}function vYe(e){return e=ie({},e),R(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(UQ),function(t){delete e[t]}),e}function pYe(e,t,r){var n=Be(e).eventData;!e.silent&&!e.ignore&&!n&&(n=Be(e).eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name}),n&&(n.info=r.info)}function gYe(e){e.registerComponentModel(hYe),e.registerComponentView(dYe),e.registerPreprocessor(function(t){var r=t.graphic;oe(r)?!r[0]||!r[0].elements?t.graphic=[{elements:r}]:t.graphic=[t.graphic[0]]:r&&!r.elements&&(t.graphic=[{elements:[r]}])})}var $H=["x","y","radius","angle","single"],mYe=["cartesian2d","polar","singleAxis"];function yYe(e){var t=e.get("coordinateSystem");return Ze(mYe,t)>=0}function iu(e){return e+"Axis"}function xYe(e,t){var r=Se(),n=[],i=Se();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 f=!1;return c.eachTargetAxis(function(h,d){var v=r.get(h);v&&v[d]&&(f=!0)}),f}function u(c){c.eachTargetAxis(function(f,h){(r.get(f)||r.set(f,[]))[h]=!0})}return n}function Iie(e){var t=e.ecModel,r={infoList:[],infoMap:Se()};return e.eachTargetAxis(function(n,i){var a=t.getComponent(iu(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 NP=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}(),v0=function(e){X(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=FH(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},t.prototype.mergeOption=function(r){var n=FH(r);qe(this.option,r,!0),qe(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;R([["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=Se(),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 R($H,function(i){var a=this.getReferringComponents(iu(i),RRe);if(a.specified){n=!0;var o=new NP;R(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 f=u[0];if(f){var h=new NP;if(h.add(f.componentIndex),r.set(c,h),a=!1,c==="x"||c==="y"){var d=f.getReferringComponents("grid",ur).models[0];d&&R(u,function(v){f.componentIndex!==v.componentIndex&&d===v.getReferringComponents("grid",ur).models[0]&&h.add(v.componentIndex)})}}}a&&R($H,function(u){if(a){var c=i.findComponents({mainType:iu(u),filter:function(h){return h.get("type",!0)==="category"}});if(c[0]){var f=new NP;f.add(c[0].componentIndex),r.set(u,f),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");R([["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(iu(n),i))},this),r},t.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(i,a){R(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(iu(r),n)},t.prototype.setRawRange=function(r){var n=this.option,i=this.settledOption;R([["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;R(["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(b&&!S&&!T)return!0;b&&(y=!0),S&&(v=!0),T&&(m=!0)}return y&&v&&m})}else Jh(c,function(d){if(a==="empty")l.setData(u=u.map(d,function(m){return s(m)?m:NaN}));else{var v={};v[d]=o,u.selectRange(v)}});Jh(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;Jh(["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=_t(n[0]+o,n,[0,100],!0):a!=null&&(o=_t(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=tj(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 SYe(e,t,r){var n=[1/0,-1/0];Jh(r,function(o){F$e(n,o.getData(),t)});var i=e.getAxisModel(),a=Lte(i.axis.scale,i,n).calculate();return[a.min,a.max]}var TYe={getTargetSeries:function(e){function t(i){e.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=e.getComponent(iu(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 wYe(i,a,s,e),r.push(o.__dzAxisProxy))});var n=Se();return R(r,function(i){R(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 CYe(e){e.registerAction("dataZoom",function(t,r){var n=xYe(r,t);R(n,function(i){i.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}var GH=!1;function d3(e){GH||(GH=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,TYe),CYe(e),e.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function AYe(e){e.registerComponentModel(_Ye),e.registerComponentView(bYe),d3(e)}var ma=function(){function e(){}return e}(),Oie={};function Qh(e,t){Oie[e]=t}function Eie(e){return Oie[e]}var MYe=function(e){X(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;R(this.option.feature,function(n,i){var a=Eie(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(r)),qe(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:J.color.border,borderRadius:0,borderWidth:0,padding:J.size.m,itemSize:15,itemGap:J.size.s,showTitle:!0,iconStyle:{borderColor:J.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:J.color.accent50}},tooltip:{show:!1,position:"bottom"}},t}(tt);function Nie(e,t){var r=vp(t.get("padding")),n=t.getItemStyle(["color","opacity"]);n.fill=t.get("backgroundColor");var i=new Qe({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 PYe=function(e){X(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={}),f=[];R(u,function(_,b){f.push(b)}),new fl(this._featureNames||[],f).add(h).update(h).remove(Ue(h,null)).execute(),this._featureNames=f;function h(_,b){var S=f[_],T=f[b],C=u[S],A=new it(C,r,r.ecModel),P;if(a&&a.newTitle!=null&&a.featureName===S&&(C.title=a.newTitle),S&&!T){if(kYe(S))P={onclick:A.option.onclick,featureName:S};else{var I=Eie(S);if(!I)return;P=new I}c[S]=P}else if(P=c[T],!P)return;P.uid=dp("toolbox-feature"),P.model=A,P.ecModel=n,P.api=i;var k=P instanceof ma;if(!S&&T){k&&P.dispose&&P.dispose(n,i);return}if(!A.get("show")||k&&P.unusable){k&&P.remove&&P.remove(n,i);return}d(A,P,S),A.setIconStatus=function(E,N){var D=this.option,z=this.iconPaths;D.iconStatus=D.iconStatus||{},D.iconStatus[E]=N,z[E]&&(N==="emphasis"?ul:cl)(z[E])},P instanceof ma&&P.render&&P.render(A,n,i,a)}function d(_,b,S){var T=_.getModel("iconStyle"),C=_.getModel(["emphasis","iconStyle"]),A=b instanceof ma&&b.getIcons?b.getIcons():_.get("icon"),P=_.get("title")||{},I,k;me(A)?(I={},I[S]=A):I=A,me(P)?(k={},k[S]=P):k=P;var E=_.iconPaths={};R(I,function(N,D){var z=fp(N,{},{x:-s/2,y:-s/2,width:s,height:s});z.setStyle(T.getItemStyle());var V=z.ensureState("emphasis");V.style=C.getItemStyle();var F=new lt({style:{text:k[D],align:C.get("textAlign"),borderRadius:C.get("textBorderRadius"),padding:C.get("textPadding"),fill:null,font:Tj({fontStyle:C.get("textFontStyle"),fontFamily:C.get("textFontFamily"),fontSize:C.get("textFontSize"),fontWeight:C.get("textFontWeight")},n)},ignore:!0});z.setTextContent(F),bl({el:z,componentModel:r,itemName:D,formatterParamsExtra:{title:k[D]}}),z.__title=k[D],z.on("mouseover",function(){var $=C.getItemStyle(),B=l?r.get("right")==null&&r.get("left")!=="right"?"right":"left":r.get("bottom")==null&&r.get("top")!=="bottom"?"bottom":"top";F.setStyle({fill:C.get("textFill")||$.fill||$.stroke||J.color.neutral99,backgroundColor:C.get("textBackgroundColor")}),z.setTextConfig({position:C.get("textPosition")||B}),F.ignore=!r.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){_.get(["iconStatus",D])!=="emphasis"&&i.leaveEmphasis(this),F.hide()}),(_.get(["iconStatus",D])==="emphasis"?ul:cl)(z),o.add(z),z.on("click",xe(b.onclick,b,n,i,D)),E[D]=z})}var v=Xr(r,i).refContainer,m=r.getBoxLayoutParams(),y=r.get("padding"),x=Zt(m,v,y);vf(r.get("orient"),o,r.get("itemGap"),x.width,x.height),TC(o,m,v,y),o.add(Nie(o.getBoundingRect(),r)),l||o.eachChild(function(_){var b=_.__title,S=_.ensureState("emphasis"),T=S.textConfig||(S.textConfig={}),C=_.getTextContent(),A=C&&C.ensureState("emphasis");if(A&&!Pe(A)&&b){var P=A.style||(A.style={}),I=cC(b,lt.makeFont(P)),k=_.x+o.x,E=_.y+o.y+s,N=!1;E+I.height>i.getHeight()&&(T.position="top",N=!0);var D=N?-5-I.height:s+10;k+I.width/2>i.getWidth()?(T.position=["100%",D],P.align="right"):k-I.width/2<0&&(T.position=[0,D],P.align="left")}})},t.prototype.updateView=function(r,n,i,a){R(this._features,function(o){o instanceof ma&&o.updateView&&o.updateView(o.model,n,i,a)})},t.prototype.remove=function(r,n){R(this._features,function(i){i instanceof ma&&i.remove&&i.remove(r,n)}),this.group.removeAll()},t.prototype.dispose=function(r,n){R(this._features,function(i){i instanceof ma&&i.dispose&&i.dispose(r,n)})},t.type="toolbox",t}(jt);function kYe(e){return e.indexOf("my")===0}var LYe=function(e){X(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")||J.color.neutral00,connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=ot.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 f=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(f)}else if(window.navigator.msSaveOrOpenBlob||o){var h=l.split(","),d=h[0].indexOf("base64")>-1,v=o?decodeURIComponent(h[1]):h[1];d&&(v=window.atob(v));var m=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var y=v.length,x=new Uint8Array(y);y--;)x[y]=v.charCodeAt(y);var _=new Blob([x]);window.navigator.msSaveOrOpenBlob(_,m)}else{var b=document.createElement("iframe");document.body.appendChild(b);var S=b.contentWindow,T=S.document;T.open("image/svg+xml","replace"),T.write(v),T.close(),S.focus(),T.execCommand("SaveAs",!0,m),document.body.removeChild(b)}}else{var C=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:J.color.neutral00,name:"",excludeComponents:["toolbox"],lang:r.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},t}(ma),WH="__ec_magicType_stack__",IYe=[["line","bar"],["stack"]],OYe=function(e){X(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 R(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(HH[i]){var s={series:[]},l=function(f){var h=f.subType,d=f.id,v=HH[i](h,d,f,a);v&&(Oe(v,f.option),s.series.push(v));var m=f.coordinateSystem;if(m&&m.type==="cartesian2d"&&(i==="line"||i==="bar")){var y=m.getAxesByScale("ordinal")[0];if(y){var x=y.dim,_=x+"Axis",b=f.getReferringComponents(_,ur).models[0],S=b.componentIndex;s[_]=s[_]||[];for(var T=0;T<=S;T++)s[_][S]=s[_][S]||{};s[_][S].boundaryGap=i==="bar"}}};R(IYe,function(f){Ze(f,i)>=0&&R(f,function(h){a.setIconStatus(h,"normal")})}),a.setIconStatus(i,"emphasis"),r.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,c=i;i==="stack"&&(u=qe({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}(ma),HH={line:function(e,t,r,n){if(e==="bar")return qe({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 qe({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")===WH;if(e==="line"||e==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),qe({id:t,stack:i?"":WH},n.get(["option","stack"])||{},!0)}};_o({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)});var FC=new Array(60).join("-"),Ev=" ";function EYe(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 NYe(e){var t=[];return R(e,function(r,n){var i=r.categoryAxis,a=r.valueAxis,o=a.dim,s=[" "].concat(le(r.series,function(d){return d.name})),l=[i.model.getCategories()];R(r.series,function(d){var v=d.getRawData();l.push(d.getRawData().mapArray(v.mapDimension(o),function(m){return m}))});for(var u=[s.join(Ev)],c=0;c=0)return!0}var xE=new RegExp("["+Ev+"]+","g");function BYe(e){for(var t=e.split(/\n+/g),r=ES(t.shift()).split(xE),n=[],i=le(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 WYe(e){var t=v3(e),r=t[t.length-1];t.length>1&&t.pop();var n={};return Die(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 HYe(e){jie(e).snapshots=null}function UYe(e){return v3(e).length}function v3(e){var t=jie(e);return t.snapshots||(t.snapshots=[{}]),t.snapshots}var ZYe=function(e){X(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(r,n){HYe(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}(ma);_o({type:"restore",event:"restore",update:"prepareAndUpdate"},function(e,t){t.resetOption("recreate")});var YYe=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],p3=function(){function e(t,r,n){var i=this;this._targetInfoList=[];var a=UH(r,t);R(qYe,function(o,s){(!n||!n.include||Ze(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=DP[n.brushType](0,a,i);n.__rangeOffset={offset:XH[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),t},e.prototype.matchOutputRanges=function(t,r,n){R(t,function(i){var a=this.findTargetInfo(i,r);a&&a!==!0&&R(a.coordSyses,function(o){var s=DP[i.brushType](1,o,i.range,!0);n(i,s.values,o,r)})},this)},e.prototype.setInputRanges=function(t,r){R(t,function(n){var i=this.findTargetInfo(n,r);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=DP[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?XH[n.brushType](a.values,o.offset,XYe(a.xyMinMax,o.xyMinMax)):a.values}},this)},e.prototype.makePanelOpts=function(t,r){return le(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:r?r(n):null,clipPath:Fne(i),isTargetByCursor:Gne(i,t,n.coordSysModel),getLinearBrushOtherExtent:Vne(i)}})},e.prototype.controlSeries=function(t,r,n){var i=this.findTargetInfo(t,n);return i===!0||i&&Ze(i.coordSyses,r.coordinateSystem)>=0},e.prototype.findTargetInfo=function(t,r){for(var n=this._targetInfoList,i=UH(r,t),a=0;ae[1]&&e.reverse(),e}function UH(e,t){return Dd(e,t,{includeMainTypes:YYe})}var qYe={grid:function(e,t){var r=e.xAxisModels,n=e.yAxisModels,i=e.gridModels,a=Se(),o={},s={};!r&&!n&&!i||(R(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),R(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),R(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=[];R(u.getCartesians(),function(f,h){(Ze(r,f.getAxis("x").model)>=0||Ze(n,f.getAxis("y").model)>=0)&&c.push(f)}),t.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:YH.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(e,t){R(e.geoModels,function(r){var n=r.coordinateSystem;t.push({panelId:"geo--"+r.id,geoModel:r,coordSysModel:r,coordSys:n,coordSyses:[n],getPanelRect:YH.geo})})}},ZH=[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}],YH={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(xu(e)),t}},DP={lineX:Ue(qH,0),lineY:Ue(qH,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=[_E([i[0],a[0]]),_E([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=le(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 qH(e,t,r,n){var i=r.getAxis(["x","y"][e]),a=_E(le([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 XH={lineX:Ue(KH,0),lineY:Ue(KH,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 le(e,function(n,i){return[n[0]-r[0]*t[i][0],n[1]-r[1]*t[i][1]]})}};function KH(e,t,r,n){return[t[0]-n[e]*r[0],t[1]-n[e]*r[1]]}function XYe(e,t){var r=JH(e),n=JH(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 JH(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var bE=R,KYe=ORe("toolbox-dataZoom_"),JYe=function(e){X(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 $R(i.getZr()),this._brushController.on("brush",xe(this._onBrush,this)).mount()),tqe(r,n,this,a,i),eqe(r,n)},t.prototype.onclick=function(r,n,i){QYe[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 p3(g3(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(u,c,f){if(f.type==="cartesian2d"){var h=u.brushType;h==="rect"?(s("x",f,c[0]),s("y",f,c[1])):s({lineX:"x",lineY:"y"}[h],f,c)}}),GYe(a,i),this._dispatchZoomAction(i);function s(u,c,f){var h=c.getAxis(u),d=h.model,v=l(u,d,a),m=v.findRepresentativeAxisProxy(d).getMinMaxSpan();(m.minValueSpan!=null||m.maxValueSpan!=null)&&(f=Ou(0,f.slice(),h.scale.getExtent(),0,m.minValueSpan,m.maxValueSpan)),v&&(i[v.id]={dataZoomId:v.id,startValue:f[0],endValue:f[1]})}function l(u,c,f){var h;return f.eachComponent({mainType:"dataZoom",subType:"select"},function(d){var v=d.getAxisModel(u,c.componentIndex);v&&(h=d)}),h}},t.prototype._dispatchZoomAction=function(r){var n=[];bE(r,function(i,a){n.push(ke(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:J.color.backgroundTint}};return n},t}(ma),QYe={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(WYe(this.ecModel))}};function g3(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 eqe(e,t){e.setIconStatus("back",UYe(t)>1?"emphasis":"normal")}function tqe(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 p3(g3(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)}dBe("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=g3(n),o=Dd(e,a);bE(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),bE(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,c){var f=l.componentIndex,h={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:KYe+u+f};h[c]=f,i.push(h)}return i});function rqe(e){e.registerComponentModel(MYe),e.registerComponentView(PYe),Qh("saveAsImage",LYe),Qh("magicType",OYe),Qh("dataView",FYe),Qh("dataZoom",JYe),Qh("restore",ZYe),Ke(AYe)}var nqe=function(e){X(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:J.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:J.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:J.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:J.color.tertiary,fontSize:14}},t}(tt);function Rie(e){var t=e.get("confine");return t!=null?!!t:e.get("renderMode")==="richText"}function Bie(e){if(ot.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,f=o+i,h=f*Math.abs(Math.cos(c))+f*Math.abs(Math.sin(c)),d=Math.round(((h-Math.SQRT2*i)/2+Math.SQRT2*i-(h-f)/2)*100)/100;s+=";"+a+":-"+d+"px";var v=t+" solid "+i+"px;",m=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+v,"border-right:"+v,"background-color:"+n+";"];return'
'}function cqe(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?",":"")+(ot.transformSupported?""+m3+i:",left"+i+",top"+i)),oqe+":"+a}function QH(e,t,r){var n=e.toFixed(0)+"px",i=t.toFixed(0)+"px";if(!ot.transformSupported)return r?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=ot.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return r?"top:0;left:0;"+m3+":"+o+";":[["top",0],["left",0],[zie,o]]}function fqe(e){var t=[],r=e.get("fontSize"),n=e.getTextColor();n&&t.push("color:"+n),t.push("font:"+e.getFont());var i=Ce(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),R(["decoration","align"],function(u){var c=e.get(u);c&&t.push("text-"+u+":"+c)}),t.join(";")}function hqe(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"),f=e.getModel("textStyle"),h=Pee(e,"html"),d=u+"px "+c+"px "+s+"px "+l;return i.push("box-shadow:"+d),t&&a>0&&i.push(cqe(a,r,n)),o&&i.push("background-color:"+o),R(["width","color","radius"],function(v){var m="border-"+v,y=Rj(m),x=e.get(y);x!=null&&i.push(m+":"+x+(v==="color"?"":"px"))}),i.push(fqe(f)),h!=null&&i.push("padding:"+vp(h).join("px ")+"px"),i.join(";")+";"}function eU(e,t,r,n,i){var a=t&&t.painter;if(r){var o=a&&a.getViewportRoot();o&&KDe(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 dqe=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,ot.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&&(me(a)?document.querySelector(a):kf(a)?a:Pe(a)&&a(t.getDom()));eU(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();ca(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=aqe(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=sqe+hqe(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+QH(a[0],a[1],!0)+("border-color:"+jf(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(me(a)&&n.get("trigger")==="item"&&!Rie(n)&&(s=uqe(n,i,a)),me(t))o.innerHTML=t+s;else if(t){o.innerHTML="",oe(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||ot.node||!i.getDom())){var o=nU(a,i);this._ticket="";var s=a.dataByCoordSys,l=_qe(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=pqe;c.x=a.x,c.y=a.y,c.update(),Be(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 f=wie(a,n),h=f.point[0],d=f.point[1];h!=null&&d!=null&&this._tryShow({offsetX:h,offsetY:d,target:f.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(nU(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(),f=Eg([c.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(f.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=Be(i);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;rf(i,function(c){if(c.tooltipDisabled)return l=u=null,!0;l||u||(Be(c).dataIndex!=null?l=c:Be(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=xe(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=Eg([n.tooltipOption],a),l=this._renderMode,u=[],c=zr("section",{blocks:[],noHeader:!0}),f=[],h=new gM;R(r,function(_){R(_.dataByAxis,function(b){var S=i.getComponent(b.axisDim+"Axis",b.axisIndex),T=b.value;if(!(!S||T==null)){var C=yie(T,S.axis,i,b.seriesDataIndices,b.valueLabelOpt),A=zr("section",{header:C,noHeader:!Fi(C),sortBlocks:!0,blocks:[]});c.blocks.push(A),R(b.seriesDataIndices,function(P){var I=i.getSeriesByIndex(P.seriesIndex),k=P.dataIndexInside,E=I.getDataParams(k);if(!(E.dataIndex<0)){E.axisDim=b.axisDim,E.axisIndex=b.axisIndex,E.axisType=b.axisType,E.axisId=b.axisId,E.axisValue=cS(S.axis,{value:T}),E.axisValueLabel=C,E.marker=h.makeTooltipMarker("item",jf(E.color),l);var N=x6(I.formatTooltip(k,!0,null)),D=N.frag;if(D){var z=Eg([I],a).get("valueFormatter");A.blocks.push(z?ie({valueFormatter:z},D):D)}N.text&&f.push(N.text),u.push(E)}})}})}),c.blocks.reverse(),f.reverse();var d=n.position,v=s.get("order"),m=C6(c,h,l,v,i.get("useUTC"),s.get("textStyle"));m&&f.unshift(m);var y=l==="richText"?` - -`:"
",x=f.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,h)})},t.prototype._showSeriesItemTooltip=function(r,n,i){var a=this._ecModel,o=Be(n),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,c=o.dataIndex,f=o.dataType,h=u.getData(f),d=this._renderMode,v=r.positionDefault,m=Eg([h.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,v?{position:v}:null),y=m.get("trigger");if(!(y!=null&&y!=="item")){var x=u.getDataParams(c,f),_=new gM;x.marker=_.makeTooltipMarker("item",jf(x.color),d);var b=x6(u.formatTooltip(c,!1,f)),S=m.get("order"),T=m.get("valueFormatter"),C=b.frag,A=C?C6(T?ie({valueFormatter:T},C):C,_,d,S,a.get("useUTC"),m.get("textStyle")):b.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:h.getRawIndex(c),seriesIndex:s,from:this.uid})}},t.prototype._showComponentItemTooltip=function(r,n,i){var a=this._renderMode==="html",o=Be(n),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(me(l)){var c=l;l={content:c,formatter:c},u=!0}u&&a&&l.content&&(l=ke(l),l.content=Zn(l.content));var f=[l],h=this._ecModel.getComponent(o.componentMainType,o.componentIndex);h&&f.push(h),f.push({formatter:l.content});var d=r.positionDefault,v=Eg(f,this._tooltipModel,d?{position:d}:null),m=v.get("content"),y=Math.random()+"",x=new gM;this._showOrMove(v,function(){var _=ke(v.get("formatterParams")||{});this._showTooltipContent(v,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 f=this._tooltipContent;f.setEnterable(r.get("enterable"));var h=r.get("formatter");l=l||r.get("position");var d=n,v=this._getNearestPoint([o,s],i,r.get("trigger"),r.get("borderColor"),r.get("defaultBorderColor",!0)),m=v.color;if(h)if(me(h)){var y=r.ecModel.get("useUTC"),x=oe(i)?i[0]:i,_=x&&x.axisType&&x.axisType.indexOf("time")>=0;d=h,_&&(d=H0(x.axisValue,d,y)),d=Bj(d,i,!0)}else if(Pe(h)){var b=xe(function(S,T){S===this._ticket&&(f.setContent(T,c,r,m,l),this._updatePosition(r,l,o,s,f,i,u))},this);this._ticket=a,d=h(i,a,b)}else d=h;f.setContent(d,c,r,m,l),f.show(r,m),this._updatePosition(r,l,o,s,f,i,u)}},t.prototype._getNearestPoint=function(r,n,i,a,o){if(i==="axis"||oe(n))return{color:a||o};if(!oe(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 f=o.getSize(),h=r.get("align"),d=r.get("verticalAlign"),v=l&&l.getBoundingRect().clone();if(l&&v.applyTransform(l.transform),Pe(n)&&(n=n([i,a],s,o.el,v,{viewSize:[u,c],contentSize:f.slice()})),oe(n))i=ge(n[0],u),a=ge(n[1],c);else if(Ee(n)){var m=n;m.width=f[0],m.height=f[1];var y=Zt(m,{width:u,height:c});i=y.x,a=y.y,h=null,d=null}else if(me(n)&&l){var x=xqe(n,v,f,r.get("borderWidth"));i=x[0],a=x[1]}else{var x=mqe(i,a,o,u,c,h?null:20,d?null:20);i=x[0],a=x[1]}if(h&&(i-=iU(h)?f[0]/2:h==="right"?f[0]:0),d&&(a-=iU(d)?f[1]/2:d==="bottom"?f[1]:0),Rie(r)){var x=yqe(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&&R(i,function(s,l){var u=s.dataByAxis||[],c=r[l]||{},f=c.dataByAxis||[];o=o&&u.length===f.length,o&&R(u,function(h,d){var v=f[d]||{},m=h.seriesDataIndices||[],y=v.seriesDataIndices||[];o=o&&h.value===v.value&&h.axisType===v.axisType&&h.axisId===v.axisId&&m.length===y.length,o&&R(m,function(x,_){var b=y[_];o=o&&x.seriesIndex===b.seriesIndex&&x.dataIndex===b.dataIndex}),a&&R(h.seriesDataIndices,function(x){var _=x.seriesIndex,b=n[_],S=a[_];b&&S&&S.data!==b.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){ot.node||!n.getDom()||(Qy(this,"_updatePosition"),this._tooltipContent.dispose(),dE("itemTooltip",n))},t.type="tooltip",t}(jt);function Eg(e,t,r){var n=t.ecModel,i;r?(i=new it(r,n,n),i=new it(t.option,i,n)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof it&&(o=o.get("tooltip",!0)),me(o)&&(o={formatter:o}),o&&(i=new it(o,i,n)))}return i}function nU(e,t){return e.dispatchAction||xe(t.dispatchAction,t)}function mqe(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 yqe(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 xqe(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 iU(e){return e==="center"||e==="middle"}function _qe(e,t,r){var n=oj(e).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=op(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=Be(u).tooltipConfig;if(c&&c.name===e.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}function bqe(e){Ke(ex),e.registerComponentModel(nqe),e.registerComponentView(gqe),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},yr),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},yr)}var wqe=["rect","polygon","keep","clear"];function Sqe(e,t){var r=Dt(e?e.brush:[]);if(r.length){var n=[];R(r,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(n=n.concat(u))});var i=e&&e.toolbox;oe(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),Tqe(s),t&&!s.length&&s.push.apply(s,wqe)}}function Tqe(e){var t={};R(e,function(r){t[r]=1}),e.length=0,R(t,function(r,n){e.push(n)})}var aU=R;function oU(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function wE(e,t,r){var n={};return aU(t,function(a){var o=n[a]=i();aU(e[a],function(s,l){if(on.isValidType(l)){var u={type:l,visual:s};r&&r(u,a),o[l]=new on(u),l==="opacity"&&(u=ke(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new on(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function Fie(e,t,r){var n;R(r,function(i){t.hasOwnProperty(i)&&oU(t[i])&&(n=!0)}),n&&R(r,function(i){t.hasOwnProperty(i)&&oU(t[i])?e[i]=ke(t[i]):delete e[i]})}function Cqe(e,t,r,n,i,a){var o={};R(e,function(f){var h=on.prepareVisualTypes(t[f]);o[f]=h});var s;function l(f){return Yj(r,s,f)}function u(f,h){Bee(r,s,f,h)}r.each(c);function c(f,h){s=f;var d=r.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var v=n.call(i,f),m=t[v],y=o[v],x=0,_=y.length;x<_;x++){var b=y[x];m[b]&&m[b].applyVisual(f,l,u)}}}function Aqe(e,t,r,n){var i={};return R(e,function(a){var o=on.prepareVisualTypes(t[a]);i[a]=o}),{progress:function(o,s){var l;n!=null&&(l=s.getDimensionIndex(n));function u(T){return Yj(s,f,T)}function c(T,C){Bee(s,f,T,C)}for(var f,h=s.getStore();(f=o.next())!=null;){var d=s.getRawDataItem(f);if(!(d&&d.visualMap===!1))for(var v=n!=null?h.get(l,f):f,m=r(v),y=t[m],x=i[m],_=0,b=x.length;_t[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&fU(t)}};function fU(e){return new je(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var Eqe=function(e){X(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 $R(n.getZr())).on("brush",xe(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){Vie(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:ke(i),$from:n}),r.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:ke(i),$from:n})},t.type="brush",t}(jt),Nqe=function(e){X(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&&Fie(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=le(r,function(n){return hU(this.option,n)},this))},t.prototype.setBrushOption=function(r){this.brushOption=hU(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:J.color.backgroundTint,borderColor:J.color.borderTint},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:J.color.disabled},t}(tt);function hU(e,t){return qe({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new it(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var Dqe=["rect","polygon","lineX","lineY","keep","clear"],jqe=function(e){X(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,R(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 R(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:Dqe.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}(ma);function Rqe(e){e.registerComponentView(Eqe),e.registerComponentModel(Nqe),e.registerPreprocessor(Sqe),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,Pqe),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"},yr),e.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},yr),Qh("brush",jqe)}var Bqe=function(e){X(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:J.size.m,backgroundColor:J.color.transparent,borderColor:J.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:J.color.primary},subtextStyle:{fontSize:12,color:J.color.quaternary}},t}(tt),zqe=function(e){X(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=Ce(r.get("textBaseline"),r.get("textVerticalAlign")),c=new lt({style:Nt(o,{text:r.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),f=c.getBoundingRect(),h=r.get("subtext"),d=new lt({style:Nt(s,{text:h,fill:s.getTextColor(),y:f.height+r.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),v=r.get("link"),m=r.get("sublink"),y=r.get("triggerEvent",!0);c.silent=!v&&!y,d.silent=!m&&!y,v&&c.on("click",function(){Qw(v,"_"+r.get("target"))}),m&&d.on("click",function(){Qw(m,"_"+r.get("subtarget"))}),Be(c).eventData=Be(d).eventData=y?{componentType:"title",componentIndex:r.componentIndex}:null,a.add(c),h&&a.add(d);var x=a.getBoundingRect(),_=r.getBoxLayoutParams();_.width=x.width,_.height=x.height;var b=Xr(r,i),S=Zt(_,b.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 C=S.margin,A=r.getItemStyle(["color","opacity"]);A.fill=r.get("backgroundColor");var P=new Qe({shape:{x:x.x-C[3],y:x.y-C[0],width:x.width+C[1]+C[3],height:x.height+C[0]+C[2],r:r.get("borderRadius")},style:A,subPixelOptimize:!0,silent:!0});a.add(P)}},t.type="title",t}(jt);function $qe(e){e.registerComponentModel(Bqe),e.registerComponentView(zqe)}var dU=function(e){X(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=[],R(n,function(u,c){var f=Hr(ap(u),""),h;Ee(u)?(h=ke(u),h.value=c):h=c,o.push(h),a.push(f)})):o=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new qn([{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:J.size.m,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:J.color.secondary},data:[]},t}(tt),Gie=function(e){X(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=Zu(dU.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:J.color.border,borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:J.color.accent10},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:J.color.tertiary},itemStyle:{color:J.color.accent20,borderWidth:0},checkpointStyle:{symbol:"circle",symbolSize:15,color:J.color.accent50,borderColor:J.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:J.color.accent50,borderColor:J.color.accent50,borderWidth:0},emphasis:{label:{show:!0,color:J.color.accent60},itemStyle:{color:J.color.accent60,borderColor:J.color.accent60},controlStyle:{color:J.color.accent70,borderColor:J.color.accent70}},progress:{lineStyle:{color:J.color.accent30},itemStyle:{color:J.color.accent40}},data:[]}),t}(dU);br(Gie,AC.prototype);var Fqe=function(e){X(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.type="timeline",t}(jt),Vqe=function(e){X(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}(Ba),RP=Math.PI,vU=rt(),Gqe=function(e){X(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 zr("nameValue",{noName:!0,value:c})},R(["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=Hqe(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:RP/2},f=a==="vertical"?o.height:o.width,h=r.getModel("controlStyle"),d=h.get("show",!0),v=d?h.get("itemSize"):0,m=d?h.get("itemGap"):0,y=v+m,x=r.get(["label","rotate"])||0;x=x*RP/180;var _,b,S,T=h.get("position",!0),C=d&&h.get("showPlayBtn",!0),A=d&&h.get("showPrevBtn",!0),P=d&&h.get("showNextBtn",!0),I=0,k=f;T==="left"||T==="bottom"?(C&&(_=[0,0],I+=y),A&&(b=[I,0],I+=y),P&&(S=[k-v,0],k-=y)):(C&&(_=[k-v,0],k-=y),A&&(b=[0,0],I+=y),P&&(S=[k-v,0],k-=y));var E=[I,k];return r.get("inverse")&&E.reverse(),{viewRect:o,mainLength:f,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:b,nextBtnPosition:S,axisExtent:E,controlSize:v,controlGap:m}},t.prototype._position=function(r,n){var i=this._mainGroup,a=this._labelGroup,o=r.viewRect;if(r.orient==="vertical"){var s=an(),l=o.x,u=o.y+o.height;po(s,s,[-l,-u]),xl(s,s,-RP/2),po(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var c=_(o),f=_(i.getBoundingRect()),h=_(a.getBoundingRect()),d=[i.x,i.y],v=[a.x,a.y];v[0]=d[0]=c[0][0];var m=r.labelPosOpt;if(m==null||me(m)){var y=m==="+"?0:1;b(d,f,c,1,y),b(v,h,c,1,1-y)}else{var y=m>=0?0:1;b(d,f,c,1,y),v[1]=d[1]+m}i.setPosition(d),a.setPosition(v),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 b(S,T,C,A,P){S[A]+=C[A][P]-T[A][P]}},t.prototype._createAxis=function(r,n){var i=n.getData(),a=n.get("axisType"),o=Wqe(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 Vqe("value",o,r.axisExtent,a);return l.model=n,l},t.prototype._createGroup=function(r){var n=this[r]=new Le;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 Pr({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:ie({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new Pr({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:Oe({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=[],R(l,function(u){var c=i.dataToCoord(u.value),f=s.getItemModel(u.value),h=f.getModel("itemStyle"),d=f.getModel(["emphasis","itemStyle"]),v=f.getModel(["progress","itemStyle"]),m={x:c,y:0,onclick:xe(o._changeTimeline,o,u.value)},y=pU(f,h,n,m);y.ensureState("emphasis").style=d.getItemStyle(),y.ensureState("progress").style=v.getItemStyle(),yu(y);var x=Be(y);f.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=[],R(u,function(c){var f=c.tickValue,h=l.getItemModel(f),d=h.getModel("label"),v=h.getModel(["emphasis","label"]),m=h.getModel(["progress","label"]),y=i.dataToCoord(c.tickValue),x=new lt({x:y,y:0,rotation:r.labelRotation-r.rotation,onclick:xe(o._changeTimeline,o,f),silent:!1,style:Nt(d,{text:c.formattedLabel,align:r.labelAlign,verticalAlign:r.labelBaseline})});x.ensureState("emphasis").style=Nt(v),x.ensureState("progress").style=Nt(m),n.add(x),yu(x),vU(x).dataIndex=f,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(),f=a.get("inverse",!0);h(r.nextBtnPosition,"next",xe(this._changeTimeline,this,f?"-":"+")),h(r.prevBtnPosition,"prev",xe(this._changeTimeline,this,f?"+":"-")),h(r.playPosition,c?"stop":"play",xe(this._handlePlayClick,this,!c),!0);function h(d,v,m,y){if(d){var x=go(Ce(a.get(["controlStyle",v+"BtnSize"]),o),o),_=[0,-x/2,x,x],b=Uqe(a,v+"Icon",_,{x:d[0],y:d[1],originX:o/2,originY:0,rotation:y?-s:0,rectHover:!0,style:l,onclick:m});b.ensureState("emphasis").style=u,n.add(b),yu(b)}}},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(f){f.draggable=!0,f.drift=xe(u._handlePointerDrag,u),f.ondragend=xe(u._handlePointerDragend,u),gU(f,u._progressLine,s,i,a,!0)},onUpdate:function(f){gU(f,u._progressLine,s,i,a)}};this._currentPointer=pU(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=Vi(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(s[o]=+s[o].toFixed(v)),[s,d]}var gb={min:Ue(pb,"min"),max:Ue(pb,"max"),average:Ue(pb,"average"),median:Ue(pb,"median")};function p0(e,t){if(t){var r=e.getData(),n=e.coordinateSystem,i=n&&n.dimensions;if(!Jqe(t)&&!oe(t.coord)&&oe(i)){var a=Wie(t,r,n,e);if(t=ke(t),t.type&&gb[t.type]&&a.baseAxis&&a.valueAxis){var o=Ze(i,a.baseAxis.dim),s=Ze(i,a.valueAxis.dim),l=gb[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||!oe(i)){t.coord=[];var u=e.getBaseAxis();if(u&&t.type&&gb[t.type]){var c=n.getOtherAxis(u);c&&(t.value=NS(r,r.mapDimension(c.dim),t.type))}}else for(var f=t.coord,h=0;h<2;h++)gb[f[h]]&&(f[h]=NS(r,r.mapDimension(i[h]),f[h]));return t}}function Wie(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(Qqe(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 Qqe(e,t){var r=e.getData().getDimensionInfo(t);return r&&r.coordDim}function g0(e,t){return e&&e.containData&&t.coord&&!TE(t)?e.containData(t.coord):!0}function eXe(e,t,r){return e&&e.containZone&&t.coord&&r.coord&&!TE(t)&&!TE(r)?e.containZone(t.coord,r.coord):!0}function Hie(e,t){return e?function(r,n,i,a){var o=a<2?r.coord&&r.coord[a]:r.value;return bu(o,t[a])}:function(r,n,i,a){return bu(r.value,t[a])}}function NS(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 BP=rt(),x3=function(e){X(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=Se()},t.prototype.render=function(r,n,i){var a=this,o=this.markerGroupMap;o.each(function(s){BP(s).keep=!1}),n.eachSeries(function(s){var l=us.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!BP(s).keep&&a.group.remove(s.group)}),tXe(n,o,this.type)},t.prototype.markKeep=function(r){BP(r).keep=!0},t.prototype.toggleBlurSeries=function(r,n){var i=this;R(r,function(a){var o=us.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?oQ(l):vj(l))})}})},t.type="marker",t}(jt);function tXe(e,t,r){e.eachSeries(function(n){var i=us.getMarkerModelFromSeries(n,r),a=t.get(n.id);if(i&&a&&a.group){var o=Df(i),s=o.z,l=o.zlevel;wC(a.group,s,l)}})}function yU(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,f=u?o?o.height:0:a,h=u&&o?o.x:0,d=u&&o?o.y:0,v,m=ge(l.get("x"),c)+h,y=ge(l.get("y"),f)+d;if(!isNaN(m)&&!isNaN(y))v=[m,y];else if(t.getMarkerPosition)v=t.getMarkerPosition(e.getValues(e.dimensions,s));else if(n){var x=e.get(n.dimensions[0],s),_=e.get(n.dimensions[1],s);v=n.dataToPoint([x,_])}isNaN(m)||(v[0]=m),isNaN(y)||(v[1]=y),e.setItemLayout(s,v)})}var rXe=function(e){X(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=us.getMarkerModelFromSeries(a,"markPoint");o&&(yU(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 X0),f=nXe(o,r,n);n.setData(f),yU(n.getData(),r,a),f.each(function(h){var d=f.getItemModel(h),v=d.getShallow("symbol"),m=d.getShallow("symbolSize"),y=d.getShallow("symbolRotate"),x=d.getShallow("symbolOffset"),_=d.getShallow("symbolKeepAspect");if(Pe(v)||Pe(m)||Pe(y)||Pe(x)){var b=n.getRawValue(h),S=n.getDataParams(h);Pe(v)&&(v=v(b,S)),Pe(m)&&(m=m(b,S)),Pe(y)&&(y=y(b,S)),Pe(x)&&(x=x(b,S))}var T=d.getModel("itemStyle").getItemStyle(),C=d.get("z2"),A=Z0(l,"color");T.fill||(T.fill=A),f.setItemVisual(h,{z2:Ce(C,0),symbol:v,symbolSize:m,symbolRotate:y,symbolOffset:x,symbolKeepAspect:_,style:T})}),c.updateData(f),this.group.add(c.group),f.eachItemGraphicEl(function(h){h.traverse(function(d){Be(d).dataModel=n})}),this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markPoint",t}(x3);function nXe(e,t,r){var n;e?n=le(e&&e.dimensions,function(s){var l=t.getData().getDimensionInfo(t.getData().mapDimension(s))||{};return ie(ie({},l),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new qn(n,r),a=le(r.get("data"),Ue(p0,t));e&&(a=gt(a,Ue(g0,e)));var o=Hie(!!e,n);return i.initData(a,null,o),i}function iXe(e){e.registerComponentModel(Kqe),e.registerComponentView(rXe),e.registerPreprocessor(function(t){y3(t.series,"markPoint")&&(t.markPoint=t.markPoint||{})})}var aXe=function(e){X(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}(us),mb=rt(),oXe=function(e,t,r,n){var i=e.getData(),a;if(oe(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=Wie(n,i,t,e);s=u.valueAxis;var c=sR(i,u.valueDataDim);l=NS(i,c,o)}var f=s.dim==="x"?0:1,h=1-f,d=ke(n),v={coord:[]};d.type=null,d.coord=[],d.coord[h]=-1/0,v.coord[h]=1/0;var m=r.get("precision");m>=0&&ut(l)&&(l=+l.toFixed(Math.min(m,20))),d.coord[f]=v.coord[f]=l,a=[d,v,{type:o,valueIndex:n.valueIndex,value:l}]}else a=[]}var y=[p0(e,a[0]),p0(e,a[1]),ie({},a[2])];return y[2].type=y[2].type||null,qe(y[2],y[0]),qe(y[2],y[1]),y};function DS(e){return!isNaN(e)&&!isFinite(e)}function xU(e,t,r,n){var i=1-e,a=n.dimensions[e];return DS(t[i])&&DS(r[i])&&t[e]===r[e]&&n.getAxis(a).containData(t[e])}function sXe(e,t){if(e.type==="cartesian2d"){var r=t[0].coord,n=t[1].coord;if(r&&n&&(xU(1,r,n,e)||xU(0,r,n,e)))return!0}return g0(e,t[0])&&g0(e,t[1])}function zP(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=ge(o.get("x"),i.getWidth()),u=ge(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,f=e.get(c[0],t),h=e.get(c[1],t);s=a.dataToPoint([f,h])}if(Iu(a,"cartesian2d")){var d=a.getAxis("x"),v=a.getAxis("y"),c=a.dimensions;DS(e.get(c[0],t))?s[0]=d.toGlobalCoord(d.getExtent()[r?0:1]):DS(e.get(c[1],t))&&(s[1]=v.toGlobalCoord(v.getExtent()[r?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}e.setItemLayout(t,s)}var lXe=function(e){X(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=us.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=mb(o).from,u=mb(o).to;l.each(function(c){zP(l,c,!0,a,i),zP(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 BR);this.group.add(c.group);var f=uXe(o,r,n),h=f.from,d=f.to,v=f.line;mb(n).from=h,mb(n).to=d,n.setData(v);var m=n.get("symbol"),y=n.get("symbolSize"),x=n.get("symbolRotate"),_=n.get("symbolOffset");oe(m)||(m=[m,m]),oe(y)||(y=[y,y]),oe(x)||(x=[x,x]),oe(_)||(_=[_,_]),f.from.each(function(S){b(h,S,!0),b(d,S,!1)}),v.each(function(S){var T=v.getItemModel(S),C=T.getModel("lineStyle").getLineStyle();v.setItemLayout(S,[h.getItemLayout(S),d.getItemLayout(S)]);var A=T.get("z2");C.stroke==null&&(C.stroke=h.getItemVisual(S,"style").fill),v.setItemVisual(S,{z2:Ce(A,0),fromSymbolKeepAspect:h.getItemVisual(S,"symbolKeepAspect"),fromSymbolOffset:h.getItemVisual(S,"symbolOffset"),fromSymbolRotate:h.getItemVisual(S,"symbolRotate"),fromSymbolSize:h.getItemVisual(S,"symbolSize"),fromSymbol:h.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:C})}),c.updateData(v),f.line.eachItemGraphicEl(function(S){Be(S).dataModel=n,S.traverse(function(T){Be(T).dataModel=n})});function b(S,T,C){var A=S.getItemModel(T);zP(S,T,C,r,a);var P=A.getModel("itemStyle").getItemStyle();P.fill==null&&(P.fill=Z0(l,"color")),S.setItemVisual(T,{symbolKeepAspect:A.get("symbolKeepAspect"),symbolOffset:Ce(A.get("symbolOffset",!0),_[C?0:1]),symbolRotate:Ce(A.get("symbolRotate",!0),x[C?0:1]),symbolSize:Ce(A.get("symbolSize"),y[C?0:1]),symbol:Ce(A.get("symbol",!0),m[C?0:1]),style:P})}this.markKeep(c),c.group.silent=n.get("silent")||r.get("silent")},t.type="markLine",t}(x3);function uXe(e,t,r){var n;e?n=le(e&&e.dimensions,function(u){var c=t.getData().getDimensionInfo(t.getData().mapDimension(u))||{};return ie(ie({},c),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new qn(n,r),a=new qn(n,r),o=new qn([],r),s=le(r.get("data"),Ue(oXe,t,e,r));e&&(s=gt(s,Ue(sXe,e)));var l=Hie(!!e,n);return i.initData(le(s,function(u){return u[0]}),null,l),a.initData(le(s,function(u){return u[1]}),null,l),o.initData(le(s,function(u){return u[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function cXe(e){e.registerComponentModel(aXe),e.registerComponentView(lXe),e.registerPreprocessor(function(t){y3(t.series,"markLine")&&(t.markLine=t.markLine||{})})}var fXe=function(e){X(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}(us),yb=rt(),hXe=function(e,t,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=p0(e,i),s=p0(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=aC([{},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 jS(e){return!isNaN(e)&&!isFinite(e)}function _U(e,t,r,n){var i=1-e;return jS(t[i])&&jS(r[i])}function dXe(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 Iu(e,"cartesian2d")?r&&n&&(_U(1,r,n)||_U(0,r,n))?!0:eXe(e,i,a):g0(e,i)||g0(e,a)}function bU(e,t,r,n,i){var a=n.coordinateSystem,o=e.getItemModel(t),s,l=ge(o.get(r[0]),i.getWidth()),u=ge(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),f=e.getValues(["x1","y1"],t),h=a.clampData(c),d=a.clampData(f),v=[];r[0]==="x0"?v[0]=h[0]>d[0]?f[0]:c[0]:v[0]=h[0]>d[0]?c[0]:f[0],r[1]==="y0"?v[1]=h[1]>d[1]?f[1]:c[1]:v[1]=h[1]>d[1]?c[1]:f[1],s=n.getMarkerPosition(v,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(Iu(a,"cartesian2d")){var _=a.getAxis("x"),b=a.getAxis("y"),m=e.get(r[0],t),y=e.get(r[1],t);jS(m)?s[0]=_.toGlobalCoord(_.getExtent()[r[0]==="x0"?0:1]):jS(y)&&(s[1]=b.toGlobalCoord(b.getExtent()[r[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var wU=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],vXe=function(e){X(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=us.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=le(wU,function(f){return bU(s,l,f,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 Le});this.group.add(c.group),this.markKeep(c);var f=pXe(o,r,n);n.setData(f),f.each(function(h){var d=le(wU,function(k){return bU(f,h,k,r,a)}),v=o.getAxis("x").scale,m=o.getAxis("y").scale,y=v.getExtent(),x=m.getExtent(),_=[v.parse(f.get("x0",h)),v.parse(f.get("x1",h))],b=[m.parse(f.get("y0",h)),m.parse(f.get("y1",h))];Vi(_),Vi(b);var S=!(y[0]>_[1]||y[1]<_[0]||x[0]>b[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:J.size.m,align:"auto",backgroundColor:J.color.transparent,borderColor:J.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:J.color.disabled,inactiveBorderColor:J.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:J.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:J.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:J.color.tertiary,borderWidth:1,borderColor:J.color.border},emphasis:{selectorLabel:{show:!0,color:J.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}(tt),Wh=Ue,AE=R,xb=Le,Uie=function(e){X(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 xb),this.group.add(this._selectorGroup=new xb),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=Xr(r,i).refContainer,f=r.getBoxLayoutParams(),h=r.get("padding"),d=Zt(f,c,h),v=this.layoutInner(r,o,d,a,l,u),m=Zt(Oe({width:v.width,height:v.height},f),c,h);this.group.x=m.x-v.x,this.group.y=m.y-v.y,this.group.markRedraw(),this.group.add(this._backgroundEl=Nie(v,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=Se(),f=n.get("selectedMode"),h=n.get("triggerEvent"),d=[];i.eachRawSeries(function(v){!v.get("legendHoverLink")&&d.push(v.id)}),AE(n.getData(),function(v,m){var y=this,x=v.get("name");if(!this.newlineDisabled&&(x===""||x===` -`)){var _=new xb;_.newline=!0,u.add(_);return}var b=i.getSeriesByName(x)[0];if(!c.get(x))if(b){var S=b.getData(),T=S.getVisual("legendLineStyle")||{},C=S.getVisual("legendIcon"),A=S.getVisual("style"),P=this._createItem(b,x,m,v,n,r,T,A,C,f,a);P.on("click",Wh(SU,x,null,a,d)).on("mouseover",Wh(ME,b.name,null,a,d)).on("mouseout",Wh(PE,b.name,null,a,d)),i.ssr&&P.eachChild(function(I){var k=Be(I);k.seriesIndex=b.seriesIndex,k.dataIndex=m,k.ssrType="legend"}),h&&P.eachChild(function(I){y.packEventData(I,n,b,m,x)}),c.set(x,!0)}else i.eachRawSeries(function(I){var k=this;if(!c.get(x)&&I.legendVisualProvider){var E=I.legendVisualProvider;if(!E.containName(x))return;var N=E.indexOfName(x),D=E.getItemVisual(N,"style"),z=E.getItemVisual(N,"legendIcon"),V=Yn(D.fill);V&&V[3]===0&&(V[3]=.2,D=ie(ie({},D),{fill:Ca(V,"rgba")}));var F=this._createItem(I,x,m,v,n,r,{},D,z,f,a);F.on("click",Wh(SU,null,x,a,d)).on("mouseover",Wh(ME,null,x,a,d)).on("mouseout",Wh(PE,null,x,a,d)),i.ssr&&F.eachChild(function($){var B=Be($);B.seriesIndex=I.seriesIndex,B.dataIndex=m,B.ssrType="legend"}),h&&F.eachChild(function($){k.packEventData($,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};Be(r).eventData=s},t.prototype._createSelector=function(r,n,i,a,o){var s=this.getSelectorGroup();AE(r,function(u){var c=u.type,f=new lt({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(f);var h=n.getModel("selectorLabel"),d=n.getModel(["emphasis","selectorLabel"]);sn(f,{normal:h,emphasis:d},{defaultText:u.title}),yu(f)})},t.prototype._createItem=function(r,n,i,a,o,s,l,u,c,f,h){var d=r.visualDrawType,v=o.get("itemWidth"),m=o.get("itemHeight"),y=o.isSelected(n),x=a.get("symbolRotate"),_=a.get("symbolKeepAspect"),b=a.get("icon");c=b||c||"roundRect";var S=yXe(c,a,l,u,d,y,h),T=new xb,C=a.getModel("textStyle");if(Pe(r.getLegendIcon)&&(!b||b==="inherit"))T.add(r.getLegendIcon({itemWidth:v,itemHeight:m,icon:c,iconRotate:x,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:_}));else{var A=b==="inherit"&&r.getData().getVisual("symbol")?x==="inherit"?r.getData().getVisual("symbolRotate"):x:0;T.add(xXe({itemWidth:v,itemHeight:m,icon:c,iconRotate:A,itemStyle:S.itemStyle,symbolKeepAspect:_}))}var P=s==="left"?v+5:-5,I=s,k=o.get("formatter"),E=n;me(k)&&k?E=k.replace("{name}",n??""):Pe(k)&&(E=k(n));var N=y?C.getTextColor():a.get("inactiveColor");T.add(new lt({style:Nt(C,{text:E,x:P,y:m/2,fill:N,align:I,verticalAlign:"middle"},{inheritColor:N})}));var D=new Qe({shape:T.getBoundingRect(),style:{fill:"transparent"}}),z=a.getModel("tooltip");return z.get("show")&&bl({el:D,componentModel:o,itemName:n,itemTooltipOption:z.option}),T.add(D),T.eachChild(function(V){V.silent=!0}),D.silent=!f,this.getContentGroup().add(T),yu(T),T.__legendDataIndex=i,T},t.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();vf(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var c=l.getBoundingRect(),f=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),o){vf("horizontal",u,r.get("selectorItemGap",!0));var h=u.getBoundingRect(),d=[-h.x,-h.y],v=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]+v:f[m]+=h[y]+v,d[1-m]+=c[x]/2-h[x]/2,u.x=d[0],u.y=d[1],l.x=f[0],l.y=f[1];var b={x:0,y:0};return b[y]=c[y]+v+h[y],b[x]=Math.max(c[x],h[x]),b[_]=Math.min(0,h[_]+d[1-m]),b}else return l.x=f[0],l.y=f[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(jt);function yXe(e,t,r,n,i,a,o){function s(y,x){y.lineWidth==="auto"&&(y.lineWidth=x.lineWidth>0?2:0),AE(y,function(_,b){y[b]==="inherit"&&(y[b]=x[b])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=e.lastIndexOf("empty",0)===0?"fill":"stroke",f=l.getShallow("decal");u.decal=!f||f==="inherit"?n.decal:Cv(f,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 h=t.getModel("lineStyle"),d=h.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 v=t.get("inactiveBorderWidth"),m=u[c];u.lineWidth=v==="auto"?n.lineWidth>0&&m?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),d.stroke=h.get("inactiveColor"),d.lineWidth=h.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}function xXe(e){var t=e.icon||"roundRect",r=Lr(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=J.color.neutral00,r.style.lineWidth=2),r}function SU(e,t,r,n){PE(e,t,r,n),r.dispatchAction({type:"legendToggleSelect",name:e??t}),ME(e,t,r,n)}function Zie(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],_=[-v.x,-v.y],b=Ce(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(m){var S=r.get("pageButtonPosition",!0);S==="end"?_[a]+=i[o]-v[o]:x[a]+=v[o]+b}_[1-a]+=d[s]/2-v[s]/2,c.setPosition(y),f.setPosition(x),h.setPosition(_);var T={x:0,y:0};if(T[o]=m?i[o]:d[o],T[s]=Math.max(d[s],v[s]),T[l]=Math.min(0,v[l]+_[1-a]),f.__rectSize=i[o],m){var C={x:0,y:0};C[o]=Math.max(i[o]-v[o]-b,0),C[s]=T[s],f.setClipPath(new Qe({shape:C})),f.__rectSize=C[o]}else h.eachChild(function(P){P.attr({invisible:!0,silent:!0})});var A=this._getPageInfo(r);return A.pageIndex!=null&&ft(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;R(["pagePrev","pageNext"],function(c){var f=c+"DataIndex",h=n[f]!=null,d=i.childOfName(c);d&&(d.setStyle("fill",h?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),d.cursor=h?"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",me(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=$P[o],l=FP[o],u=this._findTargetItemIndex(n),c=i.children(),f=c[u],h=c.length,d=h?1:0,v={contentPosition:[i.x,i.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return v;var m=S(f);v.contentPosition[o]=-m.s;for(var y=u+1,x=m,_=m,b=null;y<=h;++y)b=S(c[y]),(!b&&_.e>x.s+a||b&&!T(b,x.s))&&(_.i>x.i?x=_:x=b,x&&(v.pageNextDataIndex==null&&(v.pageNextDataIndex=x.i),++v.pageCount)),_=b;for(var y=u-1,x=m,_=m,b=null;y>=-1;--y)b=S(c[y]),(!b||!T(_,b.s))&&x.i<_.i&&(_=x,v.pagePrevDataIndex==null&&(v.pagePrevDataIndex=x.i),++v.pageCount,++v.pageIndex),x=b;return v;function S(C){if(C){var A=C.getBoundingRect(),P=A[l]+C[l];return{s:P,e:P+A[s],i:C.__legendDataIndex}}}function T(C,A){return C.e>=A&&C.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}(Uie);function TXe(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 CXe(e){Ke(Yie),e.registerComponentModel(wXe),e.registerComponentView(SXe),TXe(e)}function AXe(e){Ke(Yie),Ke(CXe)}var MXe=function(e){X(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=Zu(v0.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(v0),_3=rt();function PXe(e,t,r){_3(e).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(t.uid);i&&(i.getRange=r)})}function kXe(e,t){for(var r=_3(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 NXe(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(t,r){var n=_3(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=Se());i.each(function(a){a.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=Iie(a);R(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,LXe(r,s.model)),c=u.dataZoomInfoMap||(u.dataZoomInfoMap=Se());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){qie(i,a);return}var c=EXe(l,a,r);o.enable(c.controlType,c.opt),mp(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var DXe=function(e){X(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(),PXe(i,r,{pan:xe(VP.pan,this),zoom:xe(VP.zoom,this),scrollMove:xe(VP.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){kXe(this.api,this.dataZoomModel),this.range=null},t.type="dataZoom.inside",t}(h3),VP={zoom:function(e,t,r,n){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=GP[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(Ou(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:MU(function(e,t,r,n,i,a){var o=GP[n]([a.oldX,a.oldY],[a.newX,a.newY],t,i,r);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:MU(function(e,t,r,n,i,a){var o=GP[n]([0,0],[a.scrollDelta,a.scrollDelta],t,i,r);return o.signal*(e[1]-e[0])*a.scrollDelta})};function MU(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(Ou(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var GP={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 Xie(e){d3(e),e.registerComponentModel(MXe),e.registerComponentView(DXe),NXe(e)}var jXe=function(e){X(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=Zu(v0.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:J.color.accent10,borderRadius:0,backgroundColor:J.color.transparent,dataBackground:{lineStyle:{color:J.color.accent30,width:.5},areaStyle:{color:J.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:J.color.accent40,width:.5},areaStyle:{color:J.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:J.color.neutral00,borderColor:J.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:J.color.accent40,opacity:.5},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:J.color.tertiary},brushSelect:!0,brushStyle:{color:J.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:J.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(v0),jg=Qe,RXe=1,WP=30,BXe=7,Rg="horizontal",PU="vertical",zXe=5,$Xe=["line","bar","candlestick","scatter"],FXe={easing:"cubicOut",duration:100,delay:0},VXe=function(e){X(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=xe(this._onBrush,this),this._onBrushEnd=xe(this._onBrushEnd,this)},t.prototype.render=function(r,n,i,a){if(e.prototype.render.apply(this,arguments),mp(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(){Qy(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 Le;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?BXe:0,o=Xr(r,n).refContainer,s=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===Rg?{right:o.width-s.x-s.width,top:o.height-WP-l-a,width:s.width,height:WP}:{right:l,top:s.y,width:WP,height:s.height},c=Jf(r.option);R(["right","top","width","height"],function(h){c[h]==="ph"&&(c[h]=u[h])});var f=Zt(c,o);this._location={x:f.x,y:f.y},this._size=[f.width,f.height],this._orient===PU&&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===Rg&&!o?{scaleY:l?1:-1,scaleX:1}:i===Rg&&o?{scaleY:l?1:-1,scaleX:-1}:i===PU&&!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 jg({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new jg({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:xe(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 f=o.getDataExtent(r.thisDim),h=o.getDataExtent(l),d=(h[1]-h[0])*.3;h=[h[0]-d,h[1]+d];var v=[0,n[1]],m=[0,n[0]],y=[[n[0],0],[0,0]],x=[],_=m[1]/Math.max(1,o.count()-1),b=n[0]/(f[1]-f[0]),S=r.thisAxis.type==="time",T=-_,C=Math.round(o.count()/n[0]),A;o.each([r.thisDim,l],function(N,D,z){if(C>0&&z%C){S||(T+=_);return}T=S?(+N-f[0])*b:T+_;var V=D==null||isNaN(D)||D==="",F=V?0:_t(D,h,v,!0);V&&!A&&z?(y.push([y[y.length-1][0],0]),x.push([x[x.length-1][0],0])):!V&&A&&(y.push([T,0]),x.push([T,0])),V||(y.push([T,F]),x.push([T,F])),A=V}),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(N){var D=P.getModel(N?"selectedDataBackground":"dataBackground"),z=new Le,V=new jn({shape:{points:u},segmentIgnoreThreshold:1,style:D.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),F=new xn({shape:{points:c},segmentIgnoreThreshold:1,style:D.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return z.add(V),z.add(F),z}for(var k=0;k<3;k++){var E=I(k===1);this._displayables.sliderGroup.add(E),this._displayables.dataShadowSegs.push(E)}},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();R(l,function(u){if(!i&&!(n!==!0&&Ze($Xe,u.get("type"))<0)){var c=a.getComponent(iu(o),s).axis,f=GXe(o),h,d=u.coordinateSystem;f!=null&&d.getOtherAxis&&(h=d.getOtherAxis(c).inverse),f=u.getData().mapDimension(f);var v=u.getData().mapDimension(o);i={thisAxis:c,series:u,thisDim:v,otherDim:f,otherAxisInverse:h}}},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,f=l.get("brushSelect"),h=n.filler=new jg({silent:f,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(h),o.add(new jg({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:RXe,fill:J.color.transparent}})),R([0,1],function(b){var S=l.get("handleIcon");!rS[S]&&S.indexOf("path://")<0&&S.indexOf("image://")<0&&(S="path://"+S);var T=Lr(S,-1,0,2,2,null,!0);T.attr({cursor:WXe(this._orient),draggable:!0,drift:xe(this._onDragMove,this,b),ondragend:xe(this._onDragEnd,this),onmouseover:xe(this._showDataInfo,this,!0),onmouseout:xe(this._showDataInfo,this,!1),z2:5});var C=T.getBoundingRect(),A=l.get("handleSize");this._handleHeight=ge(A,this._size[1]),this._handleWidth=C.width/C.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(),yu(T);var P=l.get("handleColor");P!=null&&(T.style.fill=P),o.add(i[b]=T);var I=l.getModel("textStyle"),k=l.get("handleLabel")||{},E=k.show||!1;r.add(a[b]=new lt({silent:!0,invisible:!E,style:Nt(I,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:I.getTextColor(),font:I.getFont()}),z2:10}))},this);var d=h;if(f){var v=ge(l.get("moveHandleSize"),s[1]),m=n.moveHandle=new Qe({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:v}}),y=v*.8,x=n.moveHandleIcon=Lr(l.get("moveHandleIcon"),-y/2,-y/2,y,y,J.color.neutral00,!0);x.silent=!0,x.y=s[1]+v/2-.5,m.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var _=Math.min(s[1]/2,Math.max(v,10));d=n.moveZone=new Qe({invisible:!0,shape:{y:s[1]-_,height:v+_}}),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:xe(this._onDragMove,this,"all"),ondragstart:xe(this._showDataInfo,this,!0),ondragend:xe(this._onDragEnd,this),onmouseover:xe(this._showDataInfo,this,!0),onmouseout:xe(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[_t(r[0],[0,100],n,!0),_t(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];Ou(n,a,o,i.get("zoomLock")?"all":r,s.minSpan!=null?_t(s.minSpan,l,o,!0):null,s.maxSpan!=null?_t(s.maxSpan,l,o,!0):null);var u=this._range,c=this._range=Vi([_t(a[0],o,l,!0),_t(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=Vi(i.slice()),o=this._size;R([0,1],function(d){var v=n.handles[d],m=this._handleHeight;v.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 De(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();Ou(0,l,o,0,u.minSpan!=null?_t(u.minSpan,s,o,!0):null,u.maxSpan!=null?_t(u.maxSpan,s,o,!0):null),this._range=Vi([_t(l[0],o,s,!0),_t(l[1],o,s,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(r){this._brushing&&(ll(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 jg({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),f=this._size;u[0]=Math.max(Math.min(f[0],u[0]),0),o.setShape({x:c[0],y:0,width:u[0]-c[0],height:f[1]})},t.prototype._dispatchZoomAction=function(r){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?FXe:null,start:n[0],end:n[1]})},t.prototype._findCoordRect=function(){var r,n=Iie(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}(h3);function GXe(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}function WXe(e){return e==="vertical"?"ns-resize":"ew-resize"}function Kie(e){e.registerComponentModel(jXe),e.registerComponentView(VXe),d3(e)}function HXe(e){Ke(Xie),Ke(Kie)}var Jie={get:function(e,t,r){var n=ke((UXe[e]||{})[t]);return r&&oe(n)?n[n.length-1]:n}},UXe={color:{active:["#006edd","#e0ffff"],inactive:[J.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]}},kU=on.mapVisual,ZXe=on.eachVisual,YXe=oe,LU=R,qXe=Vi,XXe=_t,RS=function(e){X(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&&Fie(i,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(r){var n=this.stateList;r=xe(r,this),this.controllerVisuals=wE(this.option.controller,n,r),this.targetVisuals=wE(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=op(this.ecModel,"series",{index:n,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return le(i,function(a){return a.componentIndex})},t.prototype.eachTargetSeries=function(r,n){R(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||["<",">"],oe(r)&&(r=r.slice(),u=!0);var c=n?r:u?[f(r[0]),f(r[1])]:f(r);if(me(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(Pe(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 f(h){return h===s[0]?"min":h===s[1]?"max":(+h).toFixed(Math.min(o,20))}},t.prototype.resetExtent=function(){var r=this.option,n=qXe([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={});qe(a,i),qe(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(f){YXe(n.color)&&!f.inRange&&(f.inRange={color:n.color.slice().reverse()}),f.inRange=f.inRange||{color:r.get("gradientColor")}}function u(f,h,d){var v=f[h],m=f[d];v&&!m&&(m=f[d]={},LU(v,function(y,x){if(on.isValidType(x)){var _=Jie.get(x,"inactive",s);_!=null&&(m[x]=_,x==="color"&&!m.hasOwnProperty("opacity")&&!m.hasOwnProperty("colorAlpha")&&(m.opacity=[0,0]))}}))}function c(f){var h=(f.inRange||{}).symbol||(f.outOfRange||{}).symbol,d=(f.inRange||{}).symbolSize||(f.outOfRange||{}).symbolSize,v=this.get("inactiveColor"),m=this.getItemSymbol(),y=m||"roundRect";LU(this.stateList,function(x){var _=this.itemSize,b=f[x];b||(b=f[x]={color:s?v:[v]}),b.symbol==null&&(b.symbol=h&&ke(h)||(s?y:[y])),b.symbolSize==null&&(b.symbolSize=d&&ke(d)||(s?_[0]:[_[0],_[0]])),b.symbol=kU(b.symbol,function(C){return C==="none"?y:C});var S=b.symbolSize;if(S!=null){var T=-1/0;ZXe(S,function(C){C>T&&(T=C)}),b.symbolSize=kU(S,function(C){return XXe(C,[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:J.color.transparent,borderColor:J.color.borderTint,contentColor:J.color.theme[0],inactiveColor:J.color.disabled,borderWidth:0,padding:J.size.m,textGap:10,precision:0,textStyle:{color:J.color.secondary}},t}(tt),IU=[20,140],KXe=function(e){X(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]=IU[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=IU[1])},t.prototype._resetRange=function(){var r=this.getExtent(),n=this.option.range;!n||n.auto?(r.auto=1,this.option.range=r):oe(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),R(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=Vi((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=OU(this,"outOfRange",this.getExtent()),i=OU(this,"inRange",this.option.range.slice()),a=[];function o(d,v){a.push({value:d,color:r(d,v)})}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 Le(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);JXe([0,1],function(f){var h=o[f];h.setStyle("fill",n.handlesColor[f]),h.y=r[f];var d=Eo(r[f],[0,l[1]],u,!0),v=this.getControllerVisual(d,"symbolSize");h.scaleX=h.scaleY=v/l[0],h.x=l[0]-v/2;var m=uo(i.handleLabelPoints[f],xu(h,this.group));if(this._orient==="horizontal"){var y=c==="left"||c==="top"?(l[0]-v)/2:(l[0]-v)/-2;m[1]+=y}s[f].setStyle({x:m[0],y:m[1],text:a.formatValueText(this._dataInterval[f]),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,f=c.indicator;if(f){f.attr("invisible",!1);var h={convertOpacityToAlpha:!0},d=this.getControllerVisual(r,"color",h),v=this.getControllerVisual(r,"symbolSize"),m=Eo(r,s,u,!0),y=l[0]-v/2,x={x:f.x,y:f.y};f.y=m,f.x=y;var _=uo(c.indicatorLabelPoint,xu(f,this.group)),b=c.indicatorLabel;b.attr("invisible",!1);var S=this._applyTransform("left",c.mainGroup),T=this._orient,C=T==="horizontal";b.setStyle({text:(i||"")+o.formatValueText(n),verticalAlign:C?S:"middle",align:C?"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};f.x=x.x,f.y=x.y,f.animateTo(A,I),b.animateTo(P,I)}else f.attr(A),b.attr(P);this._firstShowIndicator=!1;var k=this._shapes.handleLabels;if(k)for(var E=0;Eo[1]&&(f[1]=1/0),n&&(f[0]===-1/0?this._showIndicator(c,f[1],"< ",l):f[1]===1/0?this._showIndicator(c,f[0],"> ",l):this._showIndicator(c,c,"≈ ",l));var h=this._hoverLinkDataIndices,d=[];(n||jU(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(f));var v=DRe(h,d);this._dispatchHighDown("downplay",e1(v[0],i)),this._dispatchHighDown("highlight",e1(v[1],i))}},t.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(rf(r.target,function(l){var u=Be(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 oKe(e,t,r,n){for(var i=t.targetVisuals[n],a=on.prepareVisualTypes(i),o={color:Z0(e.getData(),"color")},s=0,l=a.length;s0:t.splitNumber>0)||t.calculable)?"continuous":"piecewise"}),e.registerAction(nKe,iKe),R(aKe,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(sKe))}function rae(e){e.registerComponentModel(KXe),e.registerComponentView(tKe),tae(e)}var lKe=function(e){X(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=[],uKe[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=ke(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=le(this._pieceList,function(l){return l=ke(l),s!=="inRange"&&(l.visual=null),l}))})},t.prototype.completeVisualOption=function(){var r=this.option,n={},i=on.listVisualTypes(),a=this.isCategory();R(r.pieces,function(s){R(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),R(n,function(s,l){var u=!1;R(this.stateList,function(c){u=u||o(r,c,l)||o(r.target,c,l)},this),!u&&R(this.stateList,function(c){(r[c]||(r[c]={}))[l]=Jie.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,R(a,function(l,u){var c=this.getSelectedMapKey(l);o.hasOwnProperty(c)||(o[c]=!0)},this),i.selectedMode==="single"){var s=!1;R(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=ke(r)},t.prototype.getValueState=function(r){var n=on.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=on.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,f){var h=a.getRepresentValue({interval:c});f||(f=a.getValueState(h));var d=r(h,f);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 R(s,function(c){var f=c.interval;f&&(f[0]>u&&o([u,f[0]],"outOfRange"),o(f.slice()),u=f[1])},this),{stops:n,outerColors:i}},t.type="visualMap.piecewise",t.defaultOption=Zu(RS.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}(RS),uKe={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 $U(e,t){var r=e.inverse;(e.orient==="vertical"?!r:r)&&t.reverse()}var cKe=function(e){X(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),f=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],s,c,o),R(l.viewPieceList,function(h){var d=h.piece,v=new Le;v.onclick=xe(this._onItemClick,this,d),this._enableHoverLink(v,h.indexInModelPieceList);var m=n.getRepresentValue(d);if(this._createItemSymbol(v,m,[0,0,s[0],s[1]],f),c){var y=this.visualMapModel.getValueState(m),x=a.get("align")||o;v.add(new lt({style:Nt(a,{x:x==="right"?-i:s[0]+i,y:s[1]/2,text:d.text,verticalAlign:a.get("verticalAlign")||"middle",align:x,opacity:Ce(a.get("opacity"),y==="outOfRange"?.5:1)}),silent:f}))}r.add(v)},this),u&&this._renderEndsText(r,u[1],s,c,o),vf(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:e1(s.findTargetDataIndices(n),s)})}},t.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return eae(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 Le,l=this.visualMapModel.textStyleModel;s.add(new lt({style:Nt(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=le(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=Lr(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=ke(i.selected),s=n.getSelectedMapKey(r);a==="single"||a===!0?(o[s]=!0,R(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}(Qie);function nae(e){e.registerComponentModel(lKe),e.registerComponentView(cKe),tae(e)}function fKe(e){Ke(rae),Ke(nae)}var hKe=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:MQ(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}(),dKe=function(e){X(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 hKe(this);if(this._target=null,this.ecModel.eachSeries(function(i){f8(i,null)}),this.shouldShow()){var n=this.getTarget();f8(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:J.color.border,borderWidth:2},windowStyle:{borderWidth:1,color:J.color.neutral30,borderColor:J.color.neutral40,opacity:.3},z:10},t}(tt),vKe=function(e){X(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 nh),!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")||J.color.neutral00);var l=Xr(r,i).refContainer,u=Zt(ZQ(r,!0),l),c=s.lineWidth||0,f=this._contentRect=Nf(u.clone(),c/2,!0,!0),h=new Le;a.add(h),h.setClipPath(new Qe({shape:f.plain()}));var d=this._targetGroup=new Le;h.add(d);var v=u.plain();v.r=o.getShallow("borderRadius",!0),a.add(this._bgRect=new Qe({style:s,shape:v,silent:!1,cursor:"grab"}));var m=r.getModel("windowStyle"),y=m.getShallow("borderRadius",!0);h.add(this._windowRect=new Qe({shape:{x:0,y:0,width:0,height:0,r:y},style:m.getItemStyle(),silent:!1,cursor:"grab"})),this._dealRenderContent(),this._dealUpdateWindow(),VU(r,this)},t.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),VU(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=Zt({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=Ia([],r.targetTrans),i=so([],this._coordSys.transform,n);this._transThisToTarget=Ia([],i);var a=r.viewportRect;a?a=a.clone():a=new je(0,0,this._api.getWidth(),this._api.getHeight()),a.applyTransform(i);var o=this._windowRect,s=o.shape.r;o.setShape(Oe({r:s},a))}},t.prototype._resetRoamController=function(r){var n=this,i=this._api,a=this._roamController;if(a||(a=this._roamController=new rh(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",xe(this._onPan,this)).on("zoom",xe(this._onZoom,this))},t.prototype._onPan=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=xr([],[r.oldX,r.oldY],n),a=xr([],[r.oldX-r.dx,r.oldY-r.dy],n);this._api.dispatchAction(FU(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=xr([],[r.originX,r.originY],n);this._api.dispatchAction(FU(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}(jt);function FU(e,t){var r=e.mainType==="series"?e.subType+"Roam":e.mainType+"Roam",n={type:r};return n[e.mainType+"Id"]=e.id,ie(n,t),n}function VU(e,t){var r=Df(e);wC(t.group,r.z,r.zlevel)}function pKe(e){e.registerComponentModel(dKe),e.registerComponentView(vKe)}var gKe={label:{enabled:!0},decal:{show:!1}},GU=rt(),mKe={};function yKe(e,t){var r=e.getModel("aria");if(!r.get("enabled"))return;var n=ke(gKe);qe(n.label,e.getLocaleModel().get("aria"),!1),qe(r.option,n,!1),i(),a();function i(){var u=r.getModel("decal"),c=u.get("show");if(c){var f=Se();e.eachSeries(function(h){if(!h.isColorBySeries()){var d=f.get(h.type);d||(d={},f.set(h.type,d)),GU(h).scope=d}}),e.eachRawSeries(function(h){if(e.isSeriesFiltered(h))return;if(Pe(h.enableAriaDecal)){h.enableAriaDecal();return}var d=h.getData();if(h.isColorBySeries()){var _=vO(h.ecModel,h.name,mKe,e.getSeriesCount()),b=d.getVisual("decal");d.setVisual("decal",S(b,_))}else{var v=h.getRawData(),m={},y=GU(h).scope;d.each(function(T){var C=d.getRawIndex(T);m[C]=T});var x=v.count();v.each(function(T){var C=m[T],A=v.getName(T)||T+"",P=vO(h.ecModel,A,y,x),I=d.getItemVisual(C,"decal");d.setItemVisual(C,"decal",S(I,P))})}function S(T,C){var A=T?ie(ie({},C),T):C;return A.dirty=!0,A}})}}function a(){var u=t.getZr().dom;if(u){var c=e.getLocaleModel().get("aria"),f=r.getModel("label");if(f.option=Oe(f.option,c),!!f.get("enabled")){if(u.setAttribute("role","img"),f.get("description")){u.setAttribute("aria-label",f.get("description"));return}var h=e.getSeriesCount(),d=f.get(["data","maxCount"])||10,v=f.get(["series","maxCount"])||10,m=Math.min(h,v),y;if(!(h<1)){var x=s();if(x){var _=f.get(["general","withTitle"]);y=o(_,{title:x})}else y=f.get(["general","withoutTitle"]);var b=[],S=h>1?f.get(["series","multiple","prefix"]):f.get(["series","single","prefix"]);y+=o(S,{seriesCount:h}),e.eachSeries(function(P,I){if(I1?f.get(["series","multiple",N]):f.get(["series","single",N]),k=o(k,{seriesId:P.seriesIndex,seriesName:P.get("name"),seriesType:l(P.subType)});var D=P.getData();if(D.count()>d){var z=f.get(["data","partialData"]);k+=o(z,{displayCnt:d})}else k+=f.get(["data","allData"]);for(var V=f.get(["data","separator","middle"]),F=f.get(["data","separator","end"]),$=f.get(["data","excludeDimensionId"]),B=[],H=0;H":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},bKe=function(){function e(t){var r=this._condVal=me(t)?new RegExp(t):KK(t)?t:null;if(r==null){var n="";bt(n)}}return e.prototype.evaluate=function(t){var r=typeof t;return me(r)?this._condVal.test(t):ut(r)?this._condVal.test(t+""):!1},e}(),wKe=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),SKe=function(){function e(){}return e.prototype.evaluate=function(){for(var t=this.children,r=0;r2&&n.push(i),i=[D,z]}function c(D,z,V,F){bd(D,V)&&bd(z,F)||i.push(D,z,V,F,V,F)}function f(D,z,V,F,$,B){var H=Math.abs(z-D),U=Math.tan(H/4)*4/3,Z=zP:E2&&n.push(i),n}function LE(e,t,r,n,i,a,o,s,l,u){if(bd(e,r)&&bd(t,n)&&bd(i,o)&&bd(a,s)){l.push(o,s);return}var c=2/u,f=c*c,h=o-e,d=s-t,v=Math.sqrt(h*h+d*d);h/=v,d/=v;var m=r-e,y=n-t,x=i-o,_=a-s,b=m*m+y*y,S=x*x+_*_;if(b=0&&P=0){l.push(o,s);return}var I=[],k=[];ku(e,r,i,o,.5,I),ku(t,n,a,s,.5,k),LE(I[0],k[0],I[1],k[1],I[2],k[2],I[3],k[3],l,u),LE(I[4],k[4],I[5],k[5],I[6],k[6],I[7],k[7],l,u)}function RKe(e,t){var r=kE(e),n=[];t=t||1;for(var i=0;i0)for(var u=0;uMath.abs(u),f=aae([l,u],c?0:1,t),h=(c?s:u)/f.length,d=0;di,o=aae([n,i],a?0:1,t),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",f=e[s]/o.length,h=0;h1?null:new De(m*l+e,m*u+t)}function $Ke(e,t,r){var n=new De;De.sub(n,r,t),n.normalize();var i=new De;De.sub(i,e,t);var a=i.dot(n);return a}function Uh(e,t){var r=e[e.length-1];r&&r[0]===t[0]&&r[1]===t[1]||e.push(t)}function FKe(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),FKe(t,u,c)}function BS(e,t,r,n){if(r===1)n.push(t);else{var i=Math.floor(r/2),a=e(t);BS(e,a[0],i,n),BS(e,a[1],r-i,n)}return n}function VKe(e,t){for(var r=[],n=0;n0;u/=2){var c=0,f=0;(e&u)>0&&(c=1),(t&u)>0&&(f=1),s+=u*u*(3*c^f),f===0&&(c===1&&(e=u-1-e,t=u-1-t),l=e,e=t,t=l)}return s}function FS(e){var t=1/0,r=1/0,n=-1/0,i=-1/0,a=le(e,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),f=l.y+l.height/2+(u?u[5]:0);return t=Math.min(c,t),r=Math.min(f,r),n=Math.max(c,n),i=Math.max(f,i),[c,f]}),o=le(a,function(s,l){return{cp:s,z:KKe(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 lae(e){return HKe(e.path,e.count)}function IE(){return{fromIndividuals:[],toIndividuals:[],count:0}}function JKe(e,t,r){var n=[];function i(T){for(var C=0;C=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 eJe={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;JU(e)&&(u=e,c=t),JU(t)&&(u=t,c=e);function f(x,_,b,S,T){var C=x.many,A=x.one;if(C.length===1&&!T){var P=_?C[0]:A,I=_?A:C[0];if(zS(P))f({many:[P],one:I},!0,b,S,!0);else{var k=s?Oe({delay:s(b,S)},l):l;w3(P,I,k),a(P,I,P,I,k)}}else for(var E=Oe({dividePath:eJe[r],individualDelay:s&&function($,B,H,U){return s($+b,S)}},l),N=_?JKe(C,A,E):QKe(A,C,E),D=N.fromIndividuals,z=N.toIndividuals,V=D.length,F=0;Ft.length,d=u?QU(c,u):QU(h?t:e,[h?e:t]),v=0,m=0;muae))for(var a=n.getIndices(),o=0;o0&&C.group.traverse(function(P){P instanceof at&&!P.animators.length&&P.animateFrom({style:{opacity:0}},A)})})}function i7(e){var t=e.getModel("universalTransition").get("seriesKey");return t||e.id}function a7(e){return oe(e)?e.sort().join(","):e}function Gl(e){if(e.hostModel)return e.hostModel.getModel("universalTransition").get("divideShape")}function sJe(e,t){var r=Se(),n=Se(),i=Se();return R(e.oldSeries,function(a,o){var s=e.oldDataGroupIds[o],l=e.oldData[o],u=i7(a),c=a7(u);n.set(c,{dataGroupId:s,data:l}),oe(u)&&R(u,function(f){i.set(f,{key:c,dataGroupId:s,data:l})})}),R(t.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=i7(a),u=a7(l),c=n.get(u);if(c)r.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:Gl(c.data),data:c.data}],newSeries:[{dataGroupId:o,divide:Gl(s),data:s}]});else if(oe(l)){var f=[];R(l,function(v){var m=n.get(v);m.data&&f.push({dataGroupId:m.dataGroupId,divide:Gl(m.data),data:m.data})}),f.length&&r.set(u,{oldSeries:f,newSeries:[{dataGroupId:o,data:s,divide:Gl(s)}]})}else{var h=i.get(l);if(h){var d=r.get(h.key);d||(d={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:Gl(h.data)}],newSeries:[]},r.set(h.key,d)),d.newSeries.push({dataGroupId:o,data:s,divide:Gl(s)})}}}}),r}function o7(e,t){for(var r=0;r=0&&i.push({dataGroupId:t.oldDataGroupIds[s],data:t.oldData[s],divide:Gl(t.oldData[s]),groupIdDim:o.dimension})}),R(Dt(e.to),function(o){var s=o7(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:t.oldDataGroupIds[s],data:l,divide:Gl(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&cae(i,a,n)}function uJe(e){e.registerUpdateLifecycle("series:beforeupdate",function(t,r,n){R(Dt(n.seriesTransition),function(i){R(Dt(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=s7,n=l7,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 fJe(){return new cJe}var s7=0,l7=0;function hJe(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()}};R(e.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=S3(s,t);if(u){var c=u.vmin!==s.vmin,f=u.vmax!==s.vmax,h=u.vmax-u.vmin;if(!(c&&f))if(c||f){var d=c?"S":"E";a[d][l.type].has=!0,a[d][l.type].span=h,a[d][l.type].inExtFrac=h/(s.vmax-s.vmin),a[d][l.type].val=l.val}else n[l.type].span+=h,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));R(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 dJe(e,t,r,n,i,a){e!=="no"&&R(r,function(o){var s=S3(o,a);if(s)for(var l=t.length-1;l>=0;l--){var u=t[l],c=n(u),f=i*3/4;c>s.vmin-f&&ct[0]&&r=0&&o<1-1e-5}R(e,function(o){if(!(!o||o.start==null||o.end==null)&&!o.isExpanded){var s={breakOption:ke(o),vmin:t(o.start),vmax:t(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if(me(o.gap)){var u=Fi(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 f=t(o.gap);(!isFinite(f)||f<0)&&(f=0),s.gapParsed.type="tpAbs",s.gapParsed.val=f}}if(s.vmin===s.vmax&&(s.gapParsed.type="tpAbs",s.gapParsed.val=0),r&&r.noNegative&&R(["vmin","vmax"],function(d){s[d]<0&&(s[d]=0)}),s.vmin>s.vmax){var h=s.vmax;s.vmax=s.vmin,s.vmin=h}n.push(s)}}),n.sort(function(o,s){return o.vmin-s.vmin});var a=-1/0;return R(n,function(o,s){a>o.vmin&&(n[s]=null),a=o.vmax}),{breaks:n.filter(function(o){return!!o})}}function T3(e,t){return EE(t)===EE(e)}function EE(e){return e.start+"_\0_"+e.end}function pJe(e,t,r){var n=[];R(e,function(a,o){var s=t(a);s&&s.type==="vmin"&&n.push([o])}),R(e,function(a,o){var s=t(a);if(s&&s.type==="vmax"){var l=Wu(n,function(u){return T3(t(e[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return R(n,function(a){a.length===2&&i.push(r?a:[e[a[0]],e[a[1]]])}),i}function gJe(e,t,r,n){var i,a;if(e.break){var o=e.break.parsedBreak,s=Wu(r,function(f){return T3(f.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"?Mr(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 mJe(e,t,r){var n={noNegative:!0},i=OE(e,r,n),a=OE(e,r,n),o=Math.log(t);return a.breaks=le(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 yJe={vmin:"start",vmax:"end"};function xJe(e,t){return t&&(e=e||{},e.break={type:yJe[t.type],start:t.parsedBreak.vmin,end:t.parsedBreak.vmax}),e}function _Je(){V5e({createScaleBreakContext:fJe,pruneTicksByBreak:dJe,addBreaksToTicks:vJe,parseAxisBreakOption:OE,identifyAxisBreak:T3,serializeAxisBreakIdentifier:EE,retrieveAxisBreakPairs:pJe,getTicksLogTransformBreak:gJe,logarithmicParseBreaksFromOption:mJe,makeAxisLabelFormatterParamBreak:xJe})}var u7=rt();function bJe(e,t){var r=Wu(e,function(n){return Rr().identifyAxisBreak(n.parsedBreak.breakOption,t.breakOption)});return r||e.push(r={zigzagRandomList:[],parsedBreak:t,shouldRemove:!1}),r}function wJe(e){R(e,function(t){return t.shouldRemove=!0})}function SJe(e){for(var t=e.length-1;t>=0;t--)e[t].shouldRemove&&e.splice(t,1)}function TJe(e,t,r,n,i){var a=r.axis;if(a.scale.isBlank()||!Rr())return;var o=Rr().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 f=s.get("expandOnClick"),h=s.get("zigzagZ"),d=s.getModel("itemStyle"),v=d.getItemStyle(),m=v.stroke,y=v.lineWidth,x=v.lineDash,_=v.fill,b=new Le({ignoreModelZ:!0}),S=a.isHorizontal(),T=u7(t).visualList||(u7(t).visualList=[]);wJe(T);for(var C=function(I){var k=o[I][0].break.parsedBreak,E=[];E[0]=a.toGlobalCoord(a.dataToCoord(k.vmin,!0)),E[1]=a.toGlobalCoord(a.dataToCoord(k.vmax,!0)),E[1]=B;de&&(K=B);var Ie=[],ye=[];Ie[F]=E,ye[F]=N,!ce&&!de&&(Ie[F]+=Y?-l:l,ye[F]-=Y?l:-l),Ie[$]=K,ye[$]=K,U.push(Ie),Z.push(ye);var ne=void 0;if(te_[1]&&_.reverse(),{coordPair:_,brkId:Rr().serializeAxisBreakIdentifier(x.breakOption)}});l.sort(function(y,x){return y.coordPair[0]-x.coordPair[0]});for(var u=o[0],c=null,f=0;f=0?l[0].width:l[1].width),h=(f+c.x)/2-u.x,d=Math.min(h,h-c.x),v=Math.max(h,h-c.x),m=v<0?v:d>0?d:0;s=(h-m)/c.x}var y=new De,x=new De;De.scale(y,n,-s),De.scale(x,n,1-s),NO(r[0],y),NO(r[1],x)}function MJe(e,t){var r={breaks:[]};return R(t.breaks,function(n){if(n){var i=Wu(e.get("breaks",!0),function(s){return Rr().identifyAxisBreak(s,n)});if(i){var a=t.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===EC?!0:a===Ire?!1:a===Ore?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),r}function PJe(){S6e({adjustBreakLabelPair:AJe,buildAxisBreakLine:CJe,rectCoordBuildBreakAxis:TJe,updateModelAxisBreak:MJe})}function kJe(e){k6e(e),_Je(),PJe()}function LJe(){X6e(IJe)}function IJe(e,t){R(e,function(r){if(!r.model.get(["axisLabel","inside"])){var n=OJe(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 OJe(e){var t=e.model,r=e.scale;if(!t.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof Av?i=r.count():(n=r.getTicks(),i=n.length);var o=e.getLabelModel(),s=_p(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 qJe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function XJe(e){return e==="ROUTER"||e==="ROUTER_LATE"?30:e==="REPEATER"||e==="TRACKER"?25:e==="CLIENT_MUTE"?7:e==="CLIENT_BASE"?12:15}function KJe({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=>h7.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]),f=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]),h=G.useMemo(()=>{const y=l.map(_=>{const b=qJe(_.latitude),S=f7[b%f7.length],T=h7.includes(_.role),C=_.node_num===r,A=f.has(_.node_num),P=r===null||C||A;return{id:String(_.node_num),name:_.short_name,value:_.node_num,symbolSize:XJe(_.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 b=r===null||_.from_node===r||_.to_node===r;return{source:String(_.from_node),target:String(_.to_node),value:_.snr,lineStyle:{color:YJe(_.snr),width:b&&r!==null?2:1,opacity:r===null?.4:b?.6:.04}}});return{nodes:y,links:x}},[l,c,r,f]),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:h.nodes,links:h.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"]}]}),[h]),v=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:v}),[v]);return G.useEffect(()=>{var x;const y=(x=i.current)==null?void 0:x.getEchartsInstance();y&&y.setOption(d,{notMerge:!1,lazyUpdate:!0})},[d]),p.jsxs("div",{className:"relative bg-bg-card rounded-lg border border-border overflow-hidden",children:[p.jsx(ZJe,{ref:i,option:d,style:{height:"540px",width:"100%"},onEvents:m,opts:{renderer:"canvas"}}),p.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:[p.jsx(RN,{size:14,className:"text-slate-500"}),p.jsx("div",{className:"flex gap-1",children:[{key:"connected",label:"Connected"},{key:"infra",label:"Infra"},{key:"all",label:"All"}].map(({key:y,label:x})=>p.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))}),p.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[l.length," nodes • ",c.length," edges"]})]}),p.jsxs("div",{className:"absolute bottom-4 left-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[p.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Edge Quality (SNR)"}),p.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=>p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-4 h-0.5",style:{backgroundColor:y.color}}),p.jsx("span",{className:"text-xs text-slate-500",children:y.label})]},y.label))})]}),p.jsxs("div",{className:"absolute bottom-4 right-4 bg-bg-card/90 backdrop-blur-sm border border-border rounded p-3",children:[p.jsx("div",{className:"text-xs text-slate-400 font-medium mb-2",children:"Node Type"}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-500"}),p.jsx("span",{className:"text-xs text-slate-500",children:"Infrastructure"})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-900 border-2 border-blue-500"}),p.jsx("span",{className:"text-xs text-slate-500",children:"Client"})]})]})]})]})}function dae(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 JJe(e,t,r){t.center!==r.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==r.radius&&e.setRadius(t.radius)}const QJe=1;function eQe(e){return Object.freeze({__version:QJe,map:e})}function vae(e,t){return Object.freeze({...e,...t})}const pae=G.createContext(null),gae=pae.Provider;function HC(){const e=G.useContext(pae);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function tQe(e){function t(r,n){const{instance:i,context:a}=e(r).current;return G.useImperativeHandle(n,()=>i),r.children==null?null:Q.createElement(gae,{value:a},r.children)}return G.forwardRef(t)}function rQe(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?RZ.createPortal(r.children,s):null}return G.forwardRef(t)}function nQe(e){function t(r,n){const{instance:i}=e(r).current;return G.useImperativeHandle(n,()=>i),null}return G.forwardRef(t)}function P3(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 UC(e,t){const r=e.pane??t.pane;return r?{...e,pane:r}:e}function iQe(e,t){return function(n,i){const a=HC(),o=e(UC(n,a),a);return dae(a.map,n.attribution),P3(o.current,n.eventHandlers),t(o.current,a,n,i),o}}var jE={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)})(Bg,function(r){var n="1.9.4";function i(g){var w,M,O,j;for(M=1,O=arguments.length;M"u"||!L||!L.Mixin)){g=b(g)?g:[g];for(var w=0;w0?Math.floor(g):Math.ceil(g)};B.prototype={clone:function(){return new B(this.x,this.y)},add:function(g){return this.clone()._add(U(g))},_add:function(g){return this.x+=g.x,this.y+=g.y,this},subtract:function(g){return this.clone()._subtract(U(g))},_subtract:function(g){return this.x-=g.x,this.y-=g.y,this},divideBy:function(g){return this.clone()._divideBy(g)},_divideBy:function(g){return this.x/=g,this.y/=g,this},multiplyBy:function(g){return this.clone()._multiplyBy(g)},_multiplyBy:function(g){return this.x*=g,this.y*=g,this},scaleBy:function(g){return new B(this.x*g.x,this.y*g.y)},unscaleBy:function(g){return new B(this.x/g.x,this.y/g.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=H(this.x),this.y=H(this.y),this},distanceTo:function(g){g=U(g);var w=g.x-this.x,M=g.y-this.y;return Math.sqrt(w*w+M*M)},equals:function(g){return g=U(g),g.x===this.x&&g.y===this.y},contains:function(g){return g=U(g),Math.abs(g.x)<=Math.abs(this.x)&&Math.abs(g.y)<=Math.abs(this.y)},toString:function(){return"Point("+h(this.x)+", "+h(this.y)+")"}};function U(g,w,M){return g instanceof B?g:b(g)?new B(g[0],g[1]):g==null?g:typeof g=="object"&&"x"in g&&"y"in g?new B(g.x,g.y):new B(g,w,M)}function Z(g,w){if(g)for(var M=w?[g,w]:g,O=0,j=M.length;O=this.min.x&&M.x<=this.max.x&&w.y>=this.min.y&&M.y<=this.max.y},intersects:function(g){g=Y(g);var w=this.min,M=this.max,O=g.min,j=g.max,W=j.x>=w.x&&O.x<=M.x,q=j.y>=w.y&&O.y<=M.y;return W&&q},overlaps:function(g){g=Y(g);var w=this.min,M=this.max,O=g.min,j=g.max,W=j.x>w.x&&O.xw.y&&O.y=w.lat&&j.lat<=M.lat&&O.lng>=w.lng&&j.lng<=M.lng},intersects:function(g){g=te(g);var w=this._southWest,M=this._northEast,O=g.getSouthWest(),j=g.getNorthEast(),W=j.lat>=w.lat&&O.lat<=M.lat,q=j.lng>=w.lng&&O.lng<=M.lng;return W&&q},overlaps:function(g){g=te(g);var w=this._southWest,M=this._northEast,O=g.getSouthWest(),j=g.getNorthEast(),W=j.lat>w.lat&&O.latw.lng&&O.lng1,Or=function(){var g=!1;try{var w=Object.defineProperty({},"passive",{get:function(){g=!0}});window.addEventListener("testPassiveEventSupport",f,w),window.removeEventListener("testPassiveEventSupport",f,w)}catch{}return g}(),gs=function(){return!!document.createElement("canvas").getContext}(),ms=!!(document.createElementNS&&We("svg").createSVGRect),ix=!!ms&&function(){var g=document.createElement("div");return g.innerHTML="",(g.firstChild&&g.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),ax=!ms&&function(){try{var g=document.createElement("div");g.innerHTML='';var w=g.firstChild;return w.style.behavior="url(#default#VML)",w&&typeof w.adj=="object"}catch{return!1}}(),ox=navigator.platform.indexOf("Mac")===0,sx=navigator.platform.indexOf("Linux")===0;function ki(g){return navigator.userAgent.toLowerCase().indexOf(g)>=0}var He={ie:Rt,ielt9:Jt,edge:cn,webkit:Ir,android:Rn,android23:qt,androidStock:oh,opera:Cp,chrome:Je,gecko:rx,safari:ZC,phantom:ps,opera12:wn,win:YC,ie3d:Ap,webkit3d:sh,gecko3d:Mp,any3d:nx,mobile:Te,mobileWebkit:fr,mobileWebkit3d:Mi,msPointer:Pi,pointer:Qi,touch:ae,touchNative:wl,mobileOpera:Et,mobileGecko:Tt,retina:wt,passiveEvents:Or,canvas:gs,svg:ms,vml:ax,inlineSvg:ix,mac:ox,linux:sx},Pp=He.msPointer?"MSPointerDown":"pointerdown",lh=He.msPointer?"MSPointerMove":"pointermove",kp=He.msPointer?"MSPointerUp":"pointerup",hr=He.msPointer?"MSPointerCancel":"pointercancel",$t={touchstart:Pp,touchmove:lh,touchend:kp,touchcancel:hr},dr={touchstart:Lae,touchmove:lx,touchend:lx,touchcancel:lx},uh={},O3=!1;function Cae(g,w,M){return w==="touchstart"&&kae(),dr[w]?(M=dr[w].bind(this,M),g.addEventListener($t[w],M,!1),M):(console.warn("wrong event specified:",w),f)}function Aae(g,w,M){if(!$t[w]){console.warn("wrong event specified:",w);return}g.removeEventListener($t[w],M,!1)}function Mae(g){uh[g.pointerId]=g}function Pae(g){uh[g.pointerId]&&(uh[g.pointerId]=g)}function E3(g){delete uh[g.pointerId]}function kae(){O3||(document.addEventListener(Pp,Mae,!0),document.addEventListener(lh,Pae,!0),document.addEventListener(kp,E3,!0),document.addEventListener(hr,E3,!0),O3=!0)}function lx(g,w){if(w.pointerType!==(w.MSPOINTER_TYPE_MOUSE||"mouse")){w.touches=[];for(var M in uh)w.touches.push(uh[M]);w.changedTouches=[w],g(w)}}function Lae(g,w){w.MSPOINTER_TYPE_TOUCH&&w.pointerType===w.MSPOINTER_TYPE_TOUCH&&Sn(w),lx(g,w)}function Iae(g){var w={},M,O;for(O in g)M=g[O],w[O]=M&&M.bind?M.bind(g):M;return g=w,w.type="dblclick",w.detail=2,w.isTrusted=!1,w._simulated=!0,w}var Oae=200;function Eae(g,w){g.addEventListener("dblclick",w);var M=0,O;function j(W){if(W.detail!==1){O=W.detail;return}if(!(W.pointerType==="mouse"||W.sourceCapabilities&&!W.sourceCapabilities.firesTouchEvents)){var q=B3(W);if(!(q.some(function(se){return se instanceof HTMLLabelElement&&se.attributes.for})&&!q.some(function(se){return se instanceof HTMLInputElement||se instanceof HTMLSelectElement}))){var re=Date.now();re-M<=Oae?(O++,O===2&&w(Iae(W))):O=1,M=re}}}return g.addEventListener("click",j),{dblclick:w,simDblclick:j}}function Nae(g,w){g.removeEventListener("dblclick",w.dblclick),g.removeEventListener("click",w.simDblclick)}var qC=fx(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Lp=fx(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),N3=Lp==="webkitTransition"||Lp==="OTransition"?Lp+"End":"transitionend";function D3(g){return typeof g=="string"?document.getElementById(g):g}function Ip(g,w){var M=g.style[w]||g.currentStyle&&g.currentStyle[w];if((!M||M==="auto")&&document.defaultView){var O=document.defaultView.getComputedStyle(g,null);M=O?O[w]:null}return M==="auto"?null:M}function It(g,w,M){var O=document.createElement(g);return O.className=w||"",M&&M.appendChild(O),O}function vr(g){var w=g.parentNode;w&&w.removeChild(g)}function ux(g){for(;g.firstChild;)g.removeChild(g.firstChild)}function ch(g){var w=g.parentNode;w&&w.lastChild!==g&&w.appendChild(g)}function fh(g){var w=g.parentNode;w&&w.firstChild!==g&&w.insertBefore(g,w.firstChild)}function XC(g,w){if(g.classList!==void 0)return g.classList.contains(w);var M=cx(g);return M.length>0&&new RegExp("(^|\\s)"+w+"(\\s|$)").test(M)}function dt(g,w){if(g.classList!==void 0)for(var M=v(w),O=0,j=M.length;O0?2*window.devicePixelRatio:1;function $3(g){return He.edge?g.wheelDeltaY/2:g.deltaY&&g.deltaMode===0?-g.deltaY/Rae:g.deltaY&&g.deltaMode===1?-g.deltaY*20:g.deltaY&&g.deltaMode===2?-g.deltaY*60:g.deltaX||g.deltaZ?0:g.wheelDelta?(g.wheelDeltaY||g.wheelDelta)/2:g.detail&&Math.abs(g.detail)<32765?-g.detail*20:g.detail?g.detail/-32765*60:0}function lA(g,w){var M=w.relatedTarget;if(!M)return!0;try{for(;M&&M!==g;)M=M.parentNode}catch{return!1}return M!==g}var Bae={__proto__:null,on:ct,off:Qt,stopPropagation:Ju,disableScrollPropagation:sA,disableClickPropagation:Dp,preventDefault:Sn,stop:Qu,getPropagationPath:B3,getMousePosition:z3,getWheelDelta:$3,isExternalTarget:lA,addListener:ct,removeListener:Qt},F3=$.extend({run:function(g,w,M,O){this.stop(),this._el=g,this._inProgress=!0,this._duration=M||.25,this._easeOutPower=1/Math.max(O||.5,.2),this._startPos=Ku(g),this._offset=w.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=E(this._animate,this),this._step()},_step:function(g){var w=+new Date-this._startTime,M=this._duration*1e3;wthis.options.maxZoom)?this.setZoom(g):this},panInsideBounds:function(g,w){this._enforcingBounds=!0;var M=this.getCenter(),O=this._limitCenter(M,this._zoom,te(g));return M.equals(O)||this.panTo(O,w),this._enforcingBounds=!1,this},panInside:function(g,w){w=w||{};var M=U(w.paddingTopLeft||w.padding||[0,0]),O=U(w.paddingBottomRight||w.padding||[0,0]),j=this.project(this.getCenter()),W=this.project(g),q=this.getPixelBounds(),re=Y([q.min.add(M),q.max.subtract(O)]),se=re.getSize();if(!re.contains(W)){this._enforcingBounds=!0;var pe=W.subtract(re.getCenter()),Re=re.extend(W).getSize().subtract(se);j.x+=pe.x<0?-Re.x:Re.x,j.y+=pe.y<0?-Re.y:Re.y,this.panTo(this.unproject(j),w),this._enforcingBounds=!1}return this},invalidateSize:function(g){if(!this._loaded)return this;g=i({animate:!1,pan:!0},g===!0?{animate:!0}:g);var w=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var M=this.getSize(),O=w.divideBy(2).round(),j=M.divideBy(2).round(),W=O.subtract(j);return!W.x&&!W.y?this:(g.animate&&g.pan?this.panBy(W):(g.pan&&this._rawPanBy(W),this.fire("move"),g.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:w,newSize:M}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(g){if(g=this._locateOptions=i({timeout:1e4,watch:!1},g),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var w=o(this._handleGeolocationResponse,this),M=o(this._handleGeolocationError,this);return g.watch?this._locationWatchId=navigator.geolocation.watchPosition(w,M,g):navigator.geolocation.getCurrentPosition(w,M,g),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(g){if(this._container._leaflet_id){var w=g.code,M=g.message||(w===1?"permission denied":w===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:w,message:"Geolocation error: "+M+"."})}},_handleGeolocationResponse:function(g){if(this._container._leaflet_id){var w=g.coords.latitude,M=g.coords.longitude,O=new ce(w,M),j=O.toBounds(g.coords.accuracy*2),W=this._locateOptions;if(W.setView){var q=this.getBoundsZoom(j);this.setView(O,W.maxZoom?Math.min(q,W.maxZoom):q)}var re={latlng:O,bounds:j,timestamp:g.timestamp};for(var se in g.coords)typeof g.coords[se]=="number"&&(re[se]=g.coords[se]);this.fire("locationfound",re)}},addHandler:function(g,w){if(!w)return this;var M=this[g]=new w(this);return this._handlers.push(M),this.options[g]&&M.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(),vr(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(N(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var g;for(g in this._layers)this._layers[g].remove();for(g in this._panes)vr(this._panes[g]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(g,w){var M="leaflet-pane"+(g?" leaflet-"+g.replace("Pane","")+"-pane":""),O=It("div",M,w||this._mapPane);return g&&(this._panes[g]=O),O},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var g=this.getPixelBounds(),w=this.unproject(g.getBottomLeft()),M=this.unproject(g.getTopRight());return new K(w,M)},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(g,w,M){g=te(g),M=U(M||[0,0]);var O=this.getZoom()||0,j=this.getMinZoom(),W=this.getMaxZoom(),q=g.getNorthWest(),re=g.getSouthEast(),se=this.getSize().subtract(M),pe=Y(this.project(re,O),this.project(q,O)).getSize(),Re=He.any3d?this.options.zoomSnap:1,nt=se.x/pe.x,yt=se.y/pe.y,Kn=w?Math.max(nt,yt):Math.min(nt,yt);return O=this.getScaleZoom(Kn,O),Re&&(O=Math.round(O/(Re/100))*(Re/100),O=w?Math.ceil(O/Re)*Re:Math.floor(O/Re)*Re),Math.max(j,Math.min(W,O))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new B(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(g,w){var M=this._getTopLeftPoint(g,w);return new Z(M,M.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(g){return this.options.crs.getProjectedBounds(g===void 0?this.getZoom():g)},getPane:function(g){return typeof g=="string"?this._panes[g]:g},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(g,w){var M=this.options.crs;return w=w===void 0?this._zoom:w,M.scale(g)/M.scale(w)},getScaleZoom:function(g,w){var M=this.options.crs;w=w===void 0?this._zoom:w;var O=M.zoom(g*M.scale(w));return isNaN(O)?1/0:O},project:function(g,w){return w=w===void 0?this._zoom:w,this.options.crs.latLngToPoint(de(g),w)},unproject:function(g,w){return w=w===void 0?this._zoom:w,this.options.crs.pointToLatLng(U(g),w)},layerPointToLatLng:function(g){var w=U(g).add(this.getPixelOrigin());return this.unproject(w)},latLngToLayerPoint:function(g){var w=this.project(de(g))._round();return w._subtract(this.getPixelOrigin())},wrapLatLng:function(g){return this.options.crs.wrapLatLng(de(g))},wrapLatLngBounds:function(g){return this.options.crs.wrapLatLngBounds(te(g))},distance:function(g,w){return this.options.crs.distance(de(g),de(w))},containerPointToLayerPoint:function(g){return U(g).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(g){return U(g).add(this._getMapPanePos())},containerPointToLatLng:function(g){var w=this.containerPointToLayerPoint(U(g));return this.layerPointToLatLng(w)},latLngToContainerPoint:function(g){return this.layerPointToContainerPoint(this.latLngToLayerPoint(de(g)))},mouseEventToContainerPoint:function(g){return z3(g,this._container)},mouseEventToLayerPoint:function(g){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(g))},mouseEventToLatLng:function(g){return this.layerPointToLatLng(this.mouseEventToLayerPoint(g))},_initContainer:function(g){var w=this._container=D3(g);if(w){if(w._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");ct(w,"scroll",this._onScroll,this),this._containerId=l(w)},_initLayout:function(){var g=this._container;this._fadeAnimated=this.options.fadeAnimation&&He.any3d,dt(g,"leaflet-container"+(He.touch?" leaflet-touch":"")+(He.retina?" leaflet-retina":"")+(He.ielt9?" leaflet-oldie":"")+(He.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var w=Ip(g,"position");w!=="absolute"&&w!=="relative"&&w!=="fixed"&&w!=="sticky"&&(g.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var g=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),$r(this._mapPane,new B(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(dt(g.markerPane,"leaflet-zoom-hide"),dt(g.shadowPane,"leaflet-zoom-hide"))},_resetView:function(g,w,M){$r(this._mapPane,new B(0,0));var O=!this._loaded;this._loaded=!0,w=this._limitZoom(w),this.fire("viewprereset");var j=this._zoom!==w;this._moveStart(j,M)._move(g,w)._moveEnd(j),this.fire("viewreset"),O&&this.fire("load")},_moveStart:function(g,w){return g&&this.fire("zoomstart"),w||this.fire("movestart"),this},_move:function(g,w,M,O){w===void 0&&(w=this._zoom);var j=this._zoom!==w;return this._zoom=w,this._lastCenter=g,this._pixelOrigin=this._getNewPixelOrigin(g),O?M&&M.pinch&&this.fire("zoom",M):((j||M&&M.pinch)&&this.fire("zoom",M),this.fire("move",M)),this},_moveEnd:function(g){return g&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return N(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(g){$r(this._mapPane,this._getMapPanePos().subtract(g))},_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(g){this._targets={},this._targets[l(this._container)]=this;var w=g?Qt:ct;w(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&w(window,"resize",this._onResize,this),He.any3d&&this.options.transform3DLimit&&(g?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){N(this._resizeRequest),this._resizeRequest=E(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var g=this._getMapPanePos();Math.max(Math.abs(g.x),Math.abs(g.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(g,w){for(var M=[],O,j=w==="mouseout"||w==="mouseover",W=g.target||g.srcElement,q=!1;W;){if(O=this._targets[l(W)],O&&(w==="click"||w==="preclick")&&this._draggableMoved(O)){q=!0;break}if(O&&O.listens(w,!0)&&(j&&!lA(W,g)||(M.push(O),j))||W===this._container)break;W=W.parentNode}return!M.length&&!q&&!j&&this.listens(w,!0)&&(M=[this]),M},_isClickDisabled:function(g){for(;g&&g!==this._container;){if(g._leaflet_disable_click)return!0;g=g.parentNode}},_handleDOMEvent:function(g){var w=g.target||g.srcElement;if(!(!this._loaded||w._leaflet_disable_events||g.type==="click"&&this._isClickDisabled(w))){var M=g.type;M==="mousedown"&&rA(w),this._fireDOMEvent(g,M)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(g,w,M){if(g.type==="click"){var O=i({},g);O.type="preclick",this._fireDOMEvent(O,O.type,M)}var j=this._findEventTargets(g,w);if(M){for(var W=[],q=0;q0?Math.round(g-w)/2:Math.max(0,Math.ceil(g))-Math.max(0,Math.floor(w))},_limitZoom:function(g){var w=this.getMinZoom(),M=this.getMaxZoom(),O=He.any3d?this.options.zoomSnap:1;return O&&(g=Math.round(g/O)*O),Math.max(w,Math.min(M,g))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Er(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(g,w){var M=this._getCenterOffset(g)._trunc();return(w&&w.animate)!==!0&&!this.getSize().contains(M)?!1:(this.panBy(M,w),!0)},_createAnimProxy:function(){var g=this._proxy=It("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(g),this.on("zoomanim",function(w){var M=qC,O=this._proxy.style[M];Xu(this._proxy,this.project(w.center,w.zoom),this.getZoomScale(w.zoom,1)),O===this._proxy.style[M]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){vr(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var g=this.getCenter(),w=this.getZoom();Xu(this._proxy,this.project(g,w),this.getZoomScale(w,1))},_catchTransitionEnd:function(g){this._animatingZoom&&g.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(g,w,M){if(this._animatingZoom)return!0;if(M=M||{},!this._zoomAnimated||M.animate===!1||this._nothingToAnimate()||Math.abs(w-this._zoom)>this.options.zoomAnimationThreshold)return!1;var O=this.getZoomScale(w),j=this._getCenterOffset(g)._divideBy(1-1/O);return M.animate!==!0&&!this.getSize().contains(j)?!1:(E(function(){this._moveStart(!0,M.noMoveStart||!1)._animateZoom(g,w,!0)},this),!0)},_animateZoom:function(g,w,M,O){this._mapPane&&(M&&(this._animatingZoom=!0,this._animateToCenter=g,this._animateToZoom=w,dt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:g,zoom:w,noUpdate:O}),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&&Er(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 zae(g,w){return new Mt(g,w)}var za=z.extend({options:{position:"topright"},initialize:function(g){m(this,g)},getPosition:function(){return this.options.position},setPosition:function(g){var w=this._map;return w&&w.removeControl(this),this.options.position=g,w&&w.addControl(this),this},getContainer:function(){return this._container},addTo:function(g){this.remove(),this._map=g;var w=this._container=this.onAdd(g),M=this.getPosition(),O=g._controlCorners[M];return dt(w,"leaflet-control"),M.indexOf("bottom")!==-1?O.insertBefore(w,O.firstChild):O.appendChild(w),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(vr(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(g){this._map&&g&&g.screenX>0&&g.screenY>0&&this._map.getContainer().focus()}}),jp=function(g){return new za(g)};Mt.include({addControl:function(g){return g.addTo(this),this},removeControl:function(g){return g.remove(),this},_initControlPos:function(){var g=this._controlCorners={},w="leaflet-",M=this._controlContainer=It("div",w+"control-container",this._container);function O(j,W){var q=w+j+" "+w+W;g[j+W]=It("div",q,M)}O("top","left"),O("top","right"),O("bottom","left"),O("bottom","right")},_clearControlPos:function(){for(var g in this._controlCorners)vr(this._controlCorners[g]);vr(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var V3=za.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(g,w,M,O){return M1,this._baseLayersList.style.display=g?"":"none"),this._separator.style.display=w&&g?"":"none",this},_onLayerChange:function(g){this._handlingClick||this._update();var w=this._getLayer(l(g.target)),M=w.overlay?g.type==="add"?"overlayadd":"overlayremove":g.type==="add"?"baselayerchange":null;M&&this._map.fire(M,w)},_createRadioElement:function(g,w){var M='",O=document.createElement("div");return O.innerHTML=M,O.firstChild},_addItem:function(g){var w=document.createElement("label"),M=this._map.hasLayer(g.layer),O;g.overlay?(O=document.createElement("input"),O.type="checkbox",O.className="leaflet-control-layers-selector",O.defaultChecked=M):O=this._createRadioElement("leaflet-base-layers_"+l(this),M),this._layerControlInputs.push(O),O.layerId=l(g.layer),ct(O,"click",this._onInputClick,this);var j=document.createElement("span");j.innerHTML=" "+g.name;var W=document.createElement("span");w.appendChild(W),W.appendChild(O),W.appendChild(j);var q=g.overlay?this._overlaysList:this._baseLayersList;return q.appendChild(w),this._checkDisabledLayers(),w},_onInputClick:function(){if(!this._preventClick){var g=this._layerControlInputs,w,M,O=[],j=[];this._handlingClick=!0;for(var W=g.length-1;W>=0;W--)w=g[W],M=this._getLayer(w.layerId).layer,w.checked?O.push(M):w.checked||j.push(M);for(W=0;W=0;j--)w=g[j],M=this._getLayer(w.layerId).layer,w.disabled=M.options.minZoom!==void 0&&OM.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var g=this._section;this._preventClick=!0,ct(g,"click",Sn),this.expand();var w=this;setTimeout(function(){Qt(g,"click",Sn),w._preventClick=!1})}}),$ae=function(g,w,M){return new V3(g,w,M)},uA=za.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(g){var w="leaflet-control-zoom",M=It("div",w+" leaflet-bar"),O=this.options;return this._zoomInButton=this._createButton(O.zoomInText,O.zoomInTitle,w+"-in",M,this._zoomIn),this._zoomOutButton=this._createButton(O.zoomOutText,O.zoomOutTitle,w+"-out",M,this._zoomOut),this._updateDisabled(),g.on("zoomend zoomlevelschange",this._updateDisabled,this),M},onRemove:function(g){g.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(g){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(g.shiftKey?3:1))},_createButton:function(g,w,M,O,j){var W=It("a",M,O);return W.innerHTML=g,W.href="#",W.title=w,W.setAttribute("role","button"),W.setAttribute("aria-label",w),Dp(W),ct(W,"click",Qu),ct(W,"click",j,this),ct(W,"click",this._refocusOnMap,this),W},_updateDisabled:function(){var g=this._map,w="leaflet-disabled";Er(this._zoomInButton,w),Er(this._zoomOutButton,w),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||g._zoom===g.getMinZoom())&&(dt(this._zoomOutButton,w),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||g._zoom===g.getMaxZoom())&&(dt(this._zoomInButton,w),this._zoomInButton.setAttribute("aria-disabled","true"))}});Mt.mergeOptions({zoomControl:!0}),Mt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new uA,this.addControl(this.zoomControl))});var Fae=function(g){return new uA(g)},G3=za.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(g){var w="leaflet-control-scale",M=It("div",w),O=this.options;return this._addScales(O,w+"-line",M),g.on(O.updateWhenIdle?"moveend":"move",this._update,this),g.whenReady(this._update,this),M},onRemove:function(g){g.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(g,w,M){g.metric&&(this._mScale=It("div",w,M)),g.imperial&&(this._iScale=It("div",w,M))},_update:function(){var g=this._map,w=g.getSize().y/2,M=g.distance(g.containerPointToLatLng([0,w]),g.containerPointToLatLng([this.options.maxWidth,w]));this._updateScales(M)},_updateScales:function(g){this.options.metric&&g&&this._updateMetric(g),this.options.imperial&&g&&this._updateImperial(g)},_updateMetric:function(g){var w=this._getRoundNum(g),M=w<1e3?w+" m":w/1e3+" km";this._updateScale(this._mScale,M,w/g)},_updateImperial:function(g){var w=g*3.2808399,M,O,j;w>5280?(M=w/5280,O=this._getRoundNum(M),this._updateScale(this._iScale,O+" mi",O/M)):(j=this._getRoundNum(w),this._updateScale(this._iScale,j+" ft",j/w))},_updateScale:function(g,w,M){g.style.width=Math.round(this.options.maxWidth*M)+"px",g.innerHTML=w},_getRoundNum:function(g){var w=Math.pow(10,(Math.floor(g)+"").length-1),M=g/w;return M=M>=10?10:M>=5?5:M>=3?3:M>=2?2:1,w*M}}),Vae=function(g){return new G3(g)},Gae='',cA=za.extend({options:{position:"bottomright",prefix:''+(He.inlineSvg?Gae+" ":"")+"Leaflet"},initialize:function(g){m(this,g),this._attributions={}},onAdd:function(g){g.attributionControl=this,this._container=It("div","leaflet-control-attribution"),Dp(this._container);for(var w in g._layers)g._layers[w].getAttribution&&this.addAttribution(g._layers[w].getAttribution());return this._update(),g.on("layeradd",this._addAttribution,this),this._container},onRemove:function(g){g.off("layeradd",this._addAttribution,this)},_addAttribution:function(g){g.layer.getAttribution&&(this.addAttribution(g.layer.getAttribution()),g.layer.once("remove",function(){this.removeAttribution(g.layer.getAttribution())},this))},setPrefix:function(g){return this.options.prefix=g,this._update(),this},addAttribution:function(g){return g?(this._attributions[g]||(this._attributions[g]=0),this._attributions[g]++,this._update(),this):this},removeAttribution:function(g){return g?(this._attributions[g]&&(this._attributions[g]--,this._update()),this):this},_update:function(){if(this._map){var g=[];for(var w in this._attributions)this._attributions[w]&&g.push(w);var M=[];this.options.prefix&&M.push(this.options.prefix),g.length&&M.push(g.join(", ")),this._container.innerHTML=M.join(' ')}}});Mt.mergeOptions({attributionControl:!0}),Mt.addInitHook(function(){this.options.attributionControl&&new cA().addTo(this)});var Wae=function(g){return new cA(g)};za.Layers=V3,za.Zoom=uA,za.Scale=G3,za.Attribution=cA,jp.layers=$ae,jp.zoom=Fae,jp.scale=Vae,jp.attribution=Wae;var wo=z.extend({initialize:function(g){this._map=g},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}});wo.addTo=function(g,w){return g.addHandler(w,this),this};var Hae={Events:F},W3=He.touch?"touchstart mousedown":"mousedown",Sl=$.extend({options:{clickTolerance:3},initialize:function(g,w,M,O){m(this,O),this._element=g,this._dragStartTarget=w||g,this._preventOutline=M},enable:function(){this._enabled||(ct(this._dragStartTarget,W3,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Sl._dragging===this&&this.finishDrag(!0),Qt(this._dragStartTarget,W3,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(g){if(this._enabled&&(this._moved=!1,!XC(this._element,"leaflet-zoom-anim"))){if(g.touches&&g.touches.length!==1){Sl._dragging===this&&this.finishDrag();return}if(!(Sl._dragging||g.shiftKey||g.which!==1&&g.button!==1&&!g.touches)&&(Sl._dragging=this,this._preventOutline&&rA(this._element),QC(),Op(),!this._moving)){this.fire("down");var w=g.touches?g.touches[0]:g,M=j3(this._element);this._startPoint=new B(w.clientX,w.clientY),this._startPos=Ku(this._element),this._parentScale=nA(M);var O=g.type==="mousedown";ct(document,O?"mousemove":"touchmove",this._onMove,this),ct(document,O?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(g){if(this._enabled){if(g.touches&&g.touches.length>1){this._moved=!0;return}var w=g.touches&&g.touches.length===1?g.touches[0]:g,M=new B(w.clientX,w.clientY)._subtract(this._startPoint);!M.x&&!M.y||Math.abs(M.x)+Math.abs(M.y)W&&(q=re,W=se);W>M&&(w[q]=1,hA(g,w,M,O,q),hA(g,w,M,q,j))}function qae(g,w){for(var M=[g[0]],O=1,j=0,W=g.length;Ow&&(M.push(g[O]),j=O);return jw.max.x&&(M|=2),g.yw.max.y&&(M|=8),M}function Xae(g,w){var M=w.x-g.x,O=w.y-g.y;return M*M+O*O}function Rp(g,w,M,O){var j=w.x,W=w.y,q=M.x-j,re=M.y-W,se=q*q+re*re,pe;return se>0&&(pe=((g.x-j)*q+(g.y-W)*re)/se,pe>1?(j=M.x,W=M.y):pe>0&&(j+=q*pe,W+=re*pe)),q=g.x-j,re=g.y-W,O?q*q+re*re:new B(j,W)}function ta(g){return!b(g[0])||typeof g[0][0]!="object"&&typeof g[0][0]<"u"}function K3(g){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),ta(g)}function J3(g,w){var M,O,j,W,q,re,se,pe;if(!g||g.length===0)throw new Error("latlngs not passed");ta(g)||(console.warn("latlngs are not flat! Only the first ring will be used"),g=g[0]);var Re=de([0,0]),nt=te(g),yt=nt.getNorthWest().distanceTo(nt.getSouthWest())*nt.getNorthEast().distanceTo(nt.getNorthWest());yt<1700&&(Re=fA(g));var Kn=g.length,fn=[];for(M=0;MO){se=(W-O)/j,pe=[re.x-se*(re.x-q.x),re.y-se*(re.y-q.y)];break}var fi=w.unproject(U(pe));return de([fi.lat+Re.lat,fi.lng+Re.lng])}var Kae={__proto__:null,simplify:Z3,pointToSegmentDistance:Y3,closestPointOnSegment:Zae,clipSegment:X3,_getEdgeIntersection:vx,_getBitCode:ec,_sqClosestPointOnSegment:Rp,isFlat:ta,_flat:K3,polylineCenter:J3},dA={project:function(g){return new B(g.lng,g.lat)},unproject:function(g){return new ce(g.y,g.x)},bounds:new Z([-180,-90],[180,90])},vA={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Z([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(g){var w=Math.PI/180,M=this.R,O=g.lat*w,j=this.R_MINOR/M,W=Math.sqrt(1-j*j),q=W*Math.sin(O),re=Math.tan(Math.PI/4-O/2)/Math.pow((1-q)/(1+q),W/2);return O=-M*Math.log(Math.max(re,1e-10)),new B(g.lng*w*M,O)},unproject:function(g){for(var w=180/Math.PI,M=this.R,O=this.R_MINOR/M,j=Math.sqrt(1-O*O),W=Math.exp(-g.y/M),q=Math.PI/2-2*Math.atan(W),re=0,se=.1,pe;re<15&&Math.abs(se)>1e-7;re++)pe=j*Math.sin(q),pe=Math.pow((1-pe)/(1+pe),j/2),se=Math.PI/2-2*Math.atan(W*pe)-q,q+=se;return new ce(q*w,g.x*w/M)}},Jae={__proto__:null,LonLat:dA,Mercator:vA,SphericalMercator:ve},Qae=i({},ye,{code:"EPSG:3395",projection:vA,transformation:function(){var g=.5/(Math.PI*vA.R);return ee(g,.5,-g,.5)}()}),Q3=i({},ye,{code:"EPSG:4326",projection:dA,transformation:ee(1/180,1,-1/180,.5)}),eoe=i({},Ie,{projection:dA,transformation:ee(1,0,-1,0),scale:function(g){return Math.pow(2,g)},zoom:function(g){return Math.log(g)/Math.LN2},distance:function(g,w){var M=w.lng-g.lng,O=w.lat-g.lat;return Math.sqrt(M*M+O*O)},infinite:!0});Ie.Earth=ye,Ie.EPSG3395=Qae,Ie.EPSG3857=Ge,Ie.EPSG900913=Ae,Ie.EPSG4326=Q3,Ie.Simple=eoe;var $a=$.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(g){return g.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(g){return g&&g.removeLayer(this),this},getPane:function(g){return this._map.getPane(g?this.options[g]||g:this.options.pane)},addInteractiveTarget:function(g){return this._map._targets[l(g)]=this,this},removeInteractiveTarget:function(g){return delete this._map._targets[l(g)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(g){var w=g.target;if(w.hasLayer(this)){if(this._map=w,this._zoomAnimated=w._zoomAnimated,this.getEvents){var M=this.getEvents();w.on(M,this),this.once("remove",function(){w.off(M,this)},this)}this.onAdd(w),this.fire("add"),w.fire("layeradd",{layer:this})}}});Mt.include({addLayer:function(g){if(!g._layerAdd)throw new Error("The provided object is not a Layer.");var w=l(g);return this._layers[w]?this:(this._layers[w]=g,g._mapToAdd=this,g.beforeAdd&&g.beforeAdd(this),this.whenReady(g._layerAdd,g),this)},removeLayer:function(g){var w=l(g);return this._layers[w]?(this._loaded&&g.onRemove(this),delete this._layers[w],this._loaded&&(this.fire("layerremove",{layer:g}),g.fire("remove")),g._map=g._mapToAdd=null,this):this},hasLayer:function(g){return l(g)in this._layers},eachLayer:function(g,w){for(var M in this._layers)g.call(w,this._layers[M]);return this},_addLayers:function(g){g=g?b(g)?g:[g]:[];for(var w=0,M=g.length;wthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&w[0]instanceof ce&&w[0].equals(w[M-1])&&w.pop(),w},_setLatLngs:function(g){xs.prototype._setLatLngs.call(this,g),ta(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return ta(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var g=this._renderer._bounds,w=this.options.weight,M=new B(w,w);if(g=new Z(g.min.subtract(M),g.max.add(M)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(g))){if(this.options.noClip){this._parts=this._rings;return}for(var O=0,j=this._rings.length,W;Og.y!=j.y>g.y&&g.x<(j.x-O.x)*(g.y-O.y)/(j.y-O.y)+O.x&&(w=!w);return w||xs.prototype._containsPoint.call(this,g,!0)}});function loe(g,w){return new vh(g,w)}var _s=ys.extend({initialize:function(g,w){m(this,w),this._layers={},g&&this.addData(g)},addData:function(g){var w=b(g)?g:g.features,M,O,j;if(w){for(M=0,O=w.length;M0&&j.push(j[0].slice()),j}function ph(g,w){return g.feature?i({},g.feature,{geometry:w}):_x(w)}function _x(g){return g.type==="Feature"||g.type==="FeatureCollection"?g:{type:"Feature",properties:{},geometry:g}}var yA={toGeoJSON:function(g){return ph(this,{type:"Point",coordinates:mA(this.getLatLng(),g)})}};px.include(yA),pA.include(yA),gx.include(yA),xs.include({toGeoJSON:function(g){var w=!ta(this._latlngs),M=xx(this._latlngs,w?1:0,!1,g);return ph(this,{type:(w?"Multi":"")+"LineString",coordinates:M})}}),vh.include({toGeoJSON:function(g){var w=!ta(this._latlngs),M=w&&!ta(this._latlngs[0]),O=xx(this._latlngs,M?2:w?1:0,!0,g);return w||(O=[O]),ph(this,{type:(M?"Multi":"")+"Polygon",coordinates:O})}}),hh.include({toMultiPoint:function(g){var w=[];return this.eachLayer(function(M){w.push(M.toGeoJSON(g).geometry.coordinates)}),ph(this,{type:"MultiPoint",coordinates:w})},toGeoJSON:function(g){var w=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(w==="MultiPoint")return this.toMultiPoint(g);var M=w==="GeometryCollection",O=[];return this.eachLayer(function(j){if(j.toGeoJSON){var W=j.toGeoJSON(g);if(M)O.push(W.geometry);else{var q=_x(W);q.type==="FeatureCollection"?O.push.apply(O,q.features):O.push(q)}}}),M?ph(this,{geometries:O,type:"GeometryCollection"}):{type:"FeatureCollection",features:O}}});function r5(g,w){return new _s(g,w)}var uoe=r5,bx=$a.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(g,w,M){this._url=g,this._bounds=te(w),m(this,M)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(dt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){vr(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(g){return this.options.opacity=g,this._image&&this._updateOpacity(),this},setStyle:function(g){return g.opacity&&this.setOpacity(g.opacity),this},bringToFront:function(){return this._map&&ch(this._image),this},bringToBack:function(){return this._map&&fh(this._image),this},setUrl:function(g){return this._url=g,this._image&&(this._image.src=g),this},setBounds:function(g){return this._bounds=te(g),this._map&&this._reset(),this},getEvents:function(){var g={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(g.zoomanim=this._animateZoom),g},setZIndex:function(g){return this.options.zIndex=g,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var g=this._url.tagName==="IMG",w=this._image=g?this._url:It("img");if(dt(w,"leaflet-image-layer"),this._zoomAnimated&&dt(w,"leaflet-zoom-animated"),this.options.className&&dt(w,this.options.className),w.onselectstart=f,w.onmousemove=f,w.onload=o(this.fire,this,"load"),w.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(w.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),g){this._url=w.src;return}w.src=this._url,w.alt=this.options.alt},_animateZoom:function(g){var w=this._map.getZoomScale(g.zoom),M=this._map._latLngBoundsToNewLayerBounds(this._bounds,g.zoom,g.center).min;Xu(this._image,M,w)},_reset:function(){var g=this._image,w=new Z(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),M=w.getSize();$r(g,w.min),g.style.width=M.x+"px",g.style.height=M.y+"px"},_updateOpacity:function(){ea(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 g=this.options.errorOverlayUrl;g&&this._url!==g&&(this._url=g,this._image.src=g)},getCenter:function(){return this._bounds.getCenter()}}),coe=function(g,w,M){return new bx(g,w,M)},n5=bx.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var g=this._url.tagName==="VIDEO",w=this._image=g?this._url:It("video");if(dt(w,"leaflet-image-layer"),this._zoomAnimated&&dt(w,"leaflet-zoom-animated"),this.options.className&&dt(w,this.options.className),w.onselectstart=f,w.onmousemove=f,w.onloadeddata=o(this.fire,this,"load"),g){for(var M=w.getElementsByTagName("source"),O=[],j=0;j0?O:[w.src];return}b(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(w.style,"objectFit")&&(w.style.objectFit="fill"),w.autoplay=!!this.options.autoplay,w.loop=!!this.options.loop,w.muted=!!this.options.muted,w.playsInline=!!this.options.playsInline;for(var W=0;Wj?(w.height=j+"px",dt(g,W)):Er(g,W),this._containerWidth=this._container.offsetWidth},_animateZoom:function(g){var w=this._map._latLngToNewLayerPoint(this._latlng,g.zoom,g.center),M=this._getAnchor();$r(this._container,w.add(M))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var g=this._map,w=parseInt(Ip(this._container,"marginBottom"),10)||0,M=this._container.offsetHeight+w,O=this._containerWidth,j=new B(this._containerLeft,-M-this._containerBottom);j._add(Ku(this._container));var W=g.layerPointToContainerPoint(j),q=U(this.options.autoPanPadding),re=U(this.options.autoPanPaddingTopLeft||q),se=U(this.options.autoPanPaddingBottomRight||q),pe=g.getSize(),Re=0,nt=0;W.x+O+se.x>pe.x&&(Re=W.x+O-pe.x+se.x),W.x-Re-re.x<0&&(Re=W.x-re.x),W.y+M+se.y>pe.y&&(nt=W.y+M-pe.y+se.y),W.y-nt-re.y<0&&(nt=W.y-re.y),(Re||nt)&&(this.options.keepInView&&(this._autopanning=!0),g.fire("autopanstart").panBy([Re,nt]))}},_getAnchor:function(){return U(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),doe=function(g,w){return new Sx(g,w)};Mt.mergeOptions({closePopupOnClick:!0}),Mt.include({openPopup:function(g,w,M){return this._initOverlay(Sx,g,w,M).openOn(this),this},closePopup:function(g){return g=arguments.length?g:this._popup,g&&g.close(),this}}),$a.include({bindPopup:function(g,w){return this._popup=this._initOverlay(Sx,this._popup,g,w),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(g){return this._popup&&(this instanceof ys||(this._popup._source=this),this._popup._prepareOpen(g||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(g){return this._popup&&this._popup.setContent(g),this},getPopup:function(){return this._popup},_openPopup:function(g){if(!(!this._popup||!this._map)){Qu(g);var w=g.layer||g.target;if(this._popup._source===w&&!(w instanceof Tl)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(g.latlng);return}this._popup._source=w,this.openPopup(g.latlng)}},_movePopup:function(g){this._popup.setLatLng(g.latlng)},_onKeyPress:function(g){g.originalEvent.keyCode===13&&this._openPopup(g)}});var Tx=So.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(g){So.prototype.onAdd.call(this,g),this.setOpacity(this.options.opacity),g.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(g){So.prototype.onRemove.call(this,g),g.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var g=So.prototype.getEvents.call(this);return this.options.permanent||(g.preclick=this.close),g},_initLayout:function(){var g="leaflet-tooltip",w=g+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=It("div",w),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(g){var w,M,O=this._map,j=this._container,W=O.latLngToContainerPoint(O.getCenter()),q=O.layerPointToContainerPoint(g),re=this.options.direction,se=j.offsetWidth,pe=j.offsetHeight,Re=U(this.options.offset),nt=this._getAnchor();re==="top"?(w=se/2,M=pe):re==="bottom"?(w=se/2,M=0):re==="center"?(w=se/2,M=pe/2):re==="right"?(w=0,M=pe/2):re==="left"?(w=se,M=pe/2):q.xthis.options.maxZoom||MO?this._retainParent(j,W,q,O):!1)},_retainChildren:function(g,w,M,O){for(var j=2*g;j<2*g+2;j++)for(var W=2*w;W<2*w+2;W++){var q=new B(j,W);q.z=M+1;var re=this._tileCoordsToKey(q),se=this._tiles[re];if(se&&se.active){se.retain=!0;continue}else se&&se.loaded&&(se.retain=!0);M+1this.options.maxZoom||this.options.minZoom!==void 0&&j1){this._setView(g,M);return}for(var nt=j.min.y;nt<=j.max.y;nt++)for(var yt=j.min.x;yt<=j.max.x;yt++){var Kn=new B(yt,nt);if(Kn.z=this._tileZoom,!!this._isValidTile(Kn)){var fn=this._tiles[this._tileCoordsToKey(Kn)];fn?fn.current=!0:q.push(Kn)}}if(q.sort(function(fi,mh){return fi.distanceTo(W)-mh.distanceTo(W)}),q.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var ra=document.createDocumentFragment();for(yt=0;ytM.max.x)||!w.wrapLat&&(g.yM.max.y))return!1}if(!this.options.bounds)return!0;var O=this._tileCoordsToBounds(g);return te(this.options.bounds).overlaps(O)},_keyToBounds:function(g){return this._tileCoordsToBounds(this._keyToTileCoords(g))},_tileCoordsToNwSe:function(g){var w=this._map,M=this.getTileSize(),O=g.scaleBy(M),j=O.add(M),W=w.unproject(O,g.z),q=w.unproject(j,g.z);return[W,q]},_tileCoordsToBounds:function(g){var w=this._tileCoordsToNwSe(g),M=new K(w[0],w[1]);return this.options.noWrap||(M=this._map.wrapLatLngBounds(M)),M},_tileCoordsToKey:function(g){return g.x+":"+g.y+":"+g.z},_keyToTileCoords:function(g){var w=g.split(":"),M=new B(+w[0],+w[1]);return M.z=+w[2],M},_removeTile:function(g){var w=this._tiles[g];w&&(vr(w.el),delete this._tiles[g],this.fire("tileunload",{tile:w.el,coords:this._keyToTileCoords(g)}))},_initTile:function(g){dt(g,"leaflet-tile");var w=this.getTileSize();g.style.width=w.x+"px",g.style.height=w.y+"px",g.onselectstart=f,g.onmousemove=f,He.ielt9&&this.options.opacity<1&&ea(g,this.options.opacity)},_addTile:function(g,w){var M=this._getTilePos(g),O=this._tileCoordsToKey(g),j=this.createTile(this._wrapCoords(g),o(this._tileReady,this,g));this._initTile(j),this.createTile.length<2&&E(o(this._tileReady,this,g,null,j)),$r(j,M),this._tiles[O]={el:j,coords:g,current:!0},w.appendChild(j),this.fire("tileloadstart",{tile:j,coords:g})},_tileReady:function(g,w,M){w&&this.fire("tileerror",{error:w,tile:M,coords:g});var O=this._tileCoordsToKey(g);M=this._tiles[O],M&&(M.loaded=+new Date,this._map._fadeAnimated?(ea(M.el,0),N(this._fadeFrame),this._fadeFrame=E(this._updateOpacity,this)):(M.active=!0,this._pruneTiles()),w||(dt(M.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:M.el,coords:g})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),He.ielt9||!this._map._fadeAnimated?E(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(g){return g.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(g){var w=new B(this._wrapX?c(g.x,this._wrapX):g.x,this._wrapY?c(g.y,this._wrapY):g.y);return w.z=g.z,w},_pxBoundsToTileRange:function(g){var w=this.getTileSize();return new Z(g.min.unscaleBy(w).floor(),g.max.unscaleBy(w).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var g in this._tiles)if(!this._tiles[g].loaded)return!1;return!0}});function goe(g){return new zp(g)}var gh=zp.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(g,w){this._url=g,w=m(this,w),w.detectRetina&&He.retina&&w.maxZoom>0?(w.tileSize=Math.floor(w.tileSize/2),w.zoomReverse?(w.zoomOffset--,w.minZoom=Math.min(w.maxZoom,w.minZoom+1)):(w.zoomOffset++,w.maxZoom=Math.max(w.minZoom,w.maxZoom-1)),w.minZoom=Math.max(0,w.minZoom)):w.zoomReverse?w.minZoom=Math.min(w.maxZoom,w.minZoom):w.maxZoom=Math.max(w.minZoom,w.maxZoom),typeof w.subdomains=="string"&&(w.subdomains=w.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(g,w){return this._url===g&&w===void 0&&(w=!0),this._url=g,w||this.redraw(),this},createTile:function(g,w){var M=document.createElement("img");return ct(M,"load",o(this._tileOnLoad,this,w,M)),ct(M,"error",o(this._tileOnError,this,w,M)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(M.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(M.referrerPolicy=this.options.referrerPolicy),M.alt="",M.src=this.getTileUrl(g),M},getTileUrl:function(g){var w={r:He.retina?"@2x":"",s:this._getSubdomain(g),x:g.x,y:g.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var M=this._globalTileRange.max.y-g.y;this.options.tms&&(w.y=M),w["-y"]=M}return _(this._url,i(w,this.options))},_tileOnLoad:function(g,w){He.ielt9?setTimeout(o(g,this,null,w),0):g(null,w)},_tileOnError:function(g,w,M){var O=this.options.errorTileUrl;O&&w.getAttribute("src")!==O&&(w.src=O),g(M,w)},_onTileRemove:function(g){g.tile.onload=null},_getZoomForUrl:function(){var g=this._tileZoom,w=this.options.maxZoom,M=this.options.zoomReverse,O=this.options.zoomOffset;return M&&(g=w-g),g+O},_getSubdomain:function(g){var w=Math.abs(g.x+g.y)%this.options.subdomains.length;return this.options.subdomains[w]},_abortLoading:function(){var g,w;for(g in this._tiles)if(this._tiles[g].coords.z!==this._tileZoom&&(w=this._tiles[g].el,w.onload=f,w.onerror=f,!w.complete)){w.src=T;var M=this._tiles[g].coords;vr(w),delete this._tiles[g],this.fire("tileabort",{tile:w,coords:M})}},_removeTile:function(g){var w=this._tiles[g];if(w)return w.el.setAttribute("src",T),zp.prototype._removeTile.call(this,g)},_tileReady:function(g,w,M){if(!(!this._map||M&&M.getAttribute("src")===T))return zp.prototype._tileReady.call(this,g,w,M)}});function o5(g,w){return new gh(g,w)}var s5=gh.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(g,w){this._url=g;var M=i({},this.defaultWmsParams);for(var O in w)O in this.options||(M[O]=w[O]);w=m(this,w);var j=w.detectRetina&&He.retina?2:1,W=this.getTileSize();M.width=W.x*j,M.height=W.y*j,this.wmsParams=M},onAdd:function(g){this._crs=this.options.crs||g.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var w=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[w]=this._crs.code,gh.prototype.onAdd.call(this,g)},getTileUrl:function(g){var w=this._tileCoordsToNwSe(g),M=this._crs,O=Y(M.project(w[0]),M.project(w[1])),j=O.min,W=O.max,q=(this._wmsVersion>=1.3&&this._crs===Q3?[j.y,j.x,W.y,W.x]:[j.x,j.y,W.x,W.y]).join(","),re=gh.prototype.getTileUrl.call(this,g);return re+y(this.wmsParams,re,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+q},setParams:function(g,w){return i(this.wmsParams,g),w||this.redraw(),this}});function moe(g,w){return new s5(g,w)}gh.WMS=s5,o5.wms=moe;var bs=$a.extend({options:{padding:.1},initialize:function(g){m(this,g),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),dt(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 g={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(g.zoomanim=this._onAnimZoom),g},_onAnimZoom:function(g){this._updateTransform(g.center,g.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(g,w){var M=this._map.getZoomScale(w,this._zoom),O=this._map.getSize().multiplyBy(.5+this.options.padding),j=this._map.project(this._center,w),W=O.multiplyBy(-M).add(j).subtract(this._map._getNewPixelOrigin(g,w));He.any3d?Xu(this._container,W,M):$r(this._container,W)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var g in this._layers)this._layers[g]._reset()},_onZoomEnd:function(){for(var g in this._layers)this._layers[g]._project()},_updatePaths:function(){for(var g in this._layers)this._layers[g]._update()},_update:function(){var g=this.options.padding,w=this._map.getSize(),M=this._map.containerPointToLayerPoint(w.multiplyBy(-g)).round();this._bounds=new Z(M,M.add(w.multiplyBy(1+g*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),l5=bs.extend({options:{tolerance:0},getEvents:function(){var g=bs.prototype.getEvents.call(this);return g.viewprereset=this._onViewPreReset,g},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){bs.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var g=this._container=document.createElement("canvas");ct(g,"mousemove",this._onMouseMove,this),ct(g,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ct(g,"mouseout",this._handleMouseOut,this),g._leaflet_disable_events=!0,this._ctx=g.getContext("2d")},_destroyContainer:function(){N(this._redrawRequest),delete this._ctx,vr(this._container),Qt(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var g;this._redrawBounds=null;for(var w in this._layers)g=this._layers[w],g._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){bs.prototype._update.call(this);var g=this._bounds,w=this._container,M=g.getSize(),O=He.retina?2:1;$r(w,g.min),w.width=O*M.x,w.height=O*M.y,w.style.width=M.x+"px",w.style.height=M.y+"px",He.retina&&this._ctx.scale(2,2),this._ctx.translate(-g.min.x,-g.min.y),this.fire("update")}},_reset:function(){bs.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(g){this._updateDashArray(g),this._layers[l(g)]=g;var w=g._order={layer:g,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=w),this._drawLast=w,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(g){this._requestRedraw(g)},_removePath:function(g){var w=g._order,M=w.next,O=w.prev;M?M.prev=O:this._drawLast=O,O?O.next=M:this._drawFirst=M,delete g._order,delete this._layers[l(g)],this._requestRedraw(g)},_updatePath:function(g){this._extendRedrawBounds(g),g._project(),g._update(),this._requestRedraw(g)},_updateStyle:function(g){this._updateDashArray(g),this._requestRedraw(g)},_updateDashArray:function(g){if(typeof g.options.dashArray=="string"){var w=g.options.dashArray.split(/[, ]+/),M=[],O,j;for(j=0;j')}}catch{}return function(g){return document.createElement("<"+g+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),yoe={_initContainer:function(){this._container=It("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(bs.prototype._update.call(this),this.fire("update"))},_initPath:function(g){var w=g._container=$p("shape");dt(w,"leaflet-vml-shape "+(this.options.className||"")),w.coordsize="1 1",g._path=$p("path"),w.appendChild(g._path),this._updateStyle(g),this._layers[l(g)]=g},_addPath:function(g){var w=g._container;this._container.appendChild(w),g.options.interactive&&g.addInteractiveTarget(w)},_removePath:function(g){var w=g._container;vr(w),g.removeInteractiveTarget(w),delete this._layers[l(g)]},_updateStyle:function(g){var w=g._stroke,M=g._fill,O=g.options,j=g._container;j.stroked=!!O.stroke,j.filled=!!O.fill,O.stroke?(w||(w=g._stroke=$p("stroke")),j.appendChild(w),w.weight=O.weight+"px",w.color=O.color,w.opacity=O.opacity,O.dashArray?w.dashStyle=b(O.dashArray)?O.dashArray.join(" "):O.dashArray.replace(/( *, *)/g," "):w.dashStyle="",w.endcap=O.lineCap.replace("butt","flat"),w.joinstyle=O.lineJoin):w&&(j.removeChild(w),g._stroke=null),O.fill?(M||(M=g._fill=$p("fill")),j.appendChild(M),M.color=O.fillColor||O.color,M.opacity=O.fillOpacity):M&&(j.removeChild(M),g._fill=null)},_updateCircle:function(g){var w=g._point.round(),M=Math.round(g._radius),O=Math.round(g._radiusY||M);this._setPath(g,g._empty()?"M0 0":"AL "+w.x+","+w.y+" "+M+","+O+" 0,"+65535*360)},_setPath:function(g,w){g._path.v=w},_bringToFront:function(g){ch(g._container)},_bringToBack:function(g){fh(g._container)}},Cx=He.vml?$p:We,Fp=bs.extend({_initContainer:function(){this._container=Cx("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Cx("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){vr(this._container),Qt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){bs.prototype._update.call(this);var g=this._bounds,w=g.getSize(),M=this._container;(!this._svgSize||!this._svgSize.equals(w))&&(this._svgSize=w,M.setAttribute("width",w.x),M.setAttribute("height",w.y)),$r(M,g.min),M.setAttribute("viewBox",[g.min.x,g.min.y,w.x,w.y].join(" ")),this.fire("update")}},_initPath:function(g){var w=g._path=Cx("path");g.options.className&&dt(w,g.options.className),g.options.interactive&&dt(w,"leaflet-interactive"),this._updateStyle(g),this._layers[l(g)]=g},_addPath:function(g){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(g._path),g.addInteractiveTarget(g._path)},_removePath:function(g){vr(g._path),g.removeInteractiveTarget(g._path),delete this._layers[l(g)]},_updatePath:function(g){g._project(),g._update()},_updateStyle:function(g){var w=g._path,M=g.options;w&&(M.stroke?(w.setAttribute("stroke",M.color),w.setAttribute("stroke-opacity",M.opacity),w.setAttribute("stroke-width",M.weight),w.setAttribute("stroke-linecap",M.lineCap),w.setAttribute("stroke-linejoin",M.lineJoin),M.dashArray?w.setAttribute("stroke-dasharray",M.dashArray):w.removeAttribute("stroke-dasharray"),M.dashOffset?w.setAttribute("stroke-dashoffset",M.dashOffset):w.removeAttribute("stroke-dashoffset")):w.setAttribute("stroke","none"),M.fill?(w.setAttribute("fill",M.fillColor||M.color),w.setAttribute("fill-opacity",M.fillOpacity),w.setAttribute("fill-rule",M.fillRule||"evenodd")):w.setAttribute("fill","none"))},_updatePoly:function(g,w){this._setPath(g,Ye(g._parts,w))},_updateCircle:function(g){var w=g._point,M=Math.max(Math.round(g._radius),1),O=Math.max(Math.round(g._radiusY),1)||M,j="a"+M+","+O+" 0 1,0 ",W=g._empty()?"M0 0":"M"+(w.x-M)+","+w.y+j+M*2+",0 "+j+-M*2+",0 ";this._setPath(g,W)},_setPath:function(g,w){g._path.setAttribute("d",w)},_bringToFront:function(g){ch(g._path)},_bringToBack:function(g){fh(g._path)}});He.vml&&Fp.include(yoe);function c5(g){return He.svg||He.vml?new Fp(g):null}Mt.include({getRenderer:function(g){var w=g.options.renderer||this._getPaneRenderer(g.options.pane)||this.options.renderer||this._renderer;return w||(w=this._renderer=this._createRenderer()),this.hasLayer(w)||this.addLayer(w),w},_getPaneRenderer:function(g){if(g==="overlayPane"||g===void 0)return!1;var w=this._paneRenderers[g];return w===void 0&&(w=this._createRenderer({pane:g}),this._paneRenderers[g]=w),w},_createRenderer:function(g){return this.options.preferCanvas&&u5(g)||c5(g)}});var f5=vh.extend({initialize:function(g,w){vh.prototype.initialize.call(this,this._boundsToLatLngs(g),w)},setBounds:function(g){return this.setLatLngs(this._boundsToLatLngs(g))},_boundsToLatLngs:function(g){return g=te(g),[g.getSouthWest(),g.getNorthWest(),g.getNorthEast(),g.getSouthEast()]}});function xoe(g,w){return new f5(g,w)}Fp.create=Cx,Fp.pointsToPath=Ye,_s.geometryToLayer=mx,_s.coordsToLatLng=gA,_s.coordsToLatLngs=yx,_s.latLngToCoords=mA,_s.latLngsToCoords=xx,_s.getFeature=ph,_s.asFeature=_x,Mt.mergeOptions({boxZoom:!0});var h5=wo.extend({initialize:function(g){this._map=g,this._container=g._container,this._pane=g._panes.overlayPane,this._resetStateTimeout=0,g.on("unload",this._destroy,this)},addHooks:function(){ct(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Qt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){vr(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(g){if(!g.shiftKey||g.which!==1&&g.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Op(),QC(),this._startPoint=this._map.mouseEventToContainerPoint(g),ct(document,{contextmenu:Qu,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(g){this._moved||(this._moved=!0,this._box=It("div","leaflet-zoom-box",this._container),dt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(g);var w=new Z(this._point,this._startPoint),M=w.getSize();$r(this._box,w.min),this._box.style.width=M.x+"px",this._box.style.height=M.y+"px"},_finish:function(){this._moved&&(vr(this._box),Er(this._container,"leaflet-crosshair")),Ep(),eA(),Qt(document,{contextmenu:Qu,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(g){if(!(g.which!==1&&g.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var w=new K(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(w).fire("boxzoomend",{boxZoomBounds:w})}},_onKeyDown:function(g){g.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Mt.addInitHook("addHandler","boxZoom",h5),Mt.mergeOptions({doubleClickZoom:!0});var d5=wo.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(g){var w=this._map,M=w.getZoom(),O=w.options.zoomDelta,j=g.originalEvent.shiftKey?M-O:M+O;w.options.doubleClickZoom==="center"?w.setZoom(j):w.setZoomAround(g.containerPoint,j)}});Mt.addInitHook("addHandler","doubleClickZoom",d5),Mt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var v5=wo.extend({addHooks:function(){if(!this._draggable){var g=this._map;this._draggable=new Sl(g._mapPane,g._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),g.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),g.on("zoomend",this._onZoomEnd,this),g.whenReady(this._onZoomEnd,this))}dt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Er(this._map._container,"leaflet-grab"),Er(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 g=this._map;if(g._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var w=te(this._map.options.maxBounds);this._offsetLimit=Y(this._map.latLngToContainerPoint(w.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(w.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;g.fire("movestart").fire("dragstart"),g.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(g){if(this._map.options.inertia){var w=this._lastTime=+new Date,M=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(M),this._times.push(w),this._prunePositions(w)}this._map.fire("move",g).fire("drag",g)},_prunePositions:function(g){for(;this._positions.length>1&&g-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var g=this._map.getSize().divideBy(2),w=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=w.subtract(g).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(g,w){return g-(g-w)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var g=this._draggable._newPos.subtract(this._draggable._startPos),w=this._offsetLimit;g.xw.max.x&&(g.x=this._viscousLimit(g.x,w.max.x)),g.y>w.max.y&&(g.y=this._viscousLimit(g.y,w.max.y)),this._draggable._newPos=this._draggable._startPos.add(g)}},_onPreDragWrap:function(){var g=this._worldWidth,w=Math.round(g/2),M=this._initialWorldOffset,O=this._draggable._newPos.x,j=(O-w+M)%g+w-M,W=(O+w+M)%g-w-M,q=Math.abs(j+M)0?W:-W))-w;this._delta=0,this._startTime=null,q&&(g.options.scrollWheelZoom==="center"?g.setZoom(w+q):g.setZoomAround(this._lastMousePos,w+q))}});Mt.addInitHook("addHandler","scrollWheelZoom",g5);var _oe=600;Mt.mergeOptions({tapHold:He.touchNative&&He.safari&&He.mobile,tapTolerance:15});var m5=wo.extend({addHooks:function(){ct(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Qt(this._map._container,"touchstart",this._onDown,this)},_onDown:function(g){if(clearTimeout(this._holdTimeout),g.touches.length===1){var w=g.touches[0];this._startPos=this._newPos=new B(w.clientX,w.clientY),this._holdTimeout=setTimeout(o(function(){this._cancel(),this._isTapValid()&&(ct(document,"touchend",Sn),ct(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",w))},this),_oe),ct(document,"touchend touchcancel contextmenu",this._cancel,this),ct(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function g(){Qt(document,"touchend",Sn),Qt(document,"touchend touchcancel",g)},_cancel:function(){clearTimeout(this._holdTimeout),Qt(document,"touchend touchcancel contextmenu",this._cancel,this),Qt(document,"touchmove",this._onMove,this)},_onMove:function(g){var w=g.touches[0];this._newPos=new B(w.clientX,w.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(g,w){var M=new MouseEvent(g,{bubbles:!0,cancelable:!0,view:window,screenX:w.screenX,screenY:w.screenY,clientX:w.clientX,clientY:w.clientY});M._simulated=!0,w.target.dispatchEvent(M)}});Mt.addInitHook("addHandler","tapHold",m5),Mt.mergeOptions({touchZoom:He.touch,bounceAtZoomLimits:!0});var y5=wo.extend({addHooks:function(){dt(this._map._container,"leaflet-touch-zoom"),ct(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Er(this._map._container,"leaflet-touch-zoom"),Qt(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(g){var w=this._map;if(!(!g.touches||g.touches.length!==2||w._animatingZoom||this._zooming)){var M=w.mouseEventToContainerPoint(g.touches[0]),O=w.mouseEventToContainerPoint(g.touches[1]);this._centerPoint=w.getSize()._divideBy(2),this._startLatLng=w.containerPointToLatLng(this._centerPoint),w.options.touchZoom!=="center"&&(this._pinchStartLatLng=w.containerPointToLatLng(M.add(O)._divideBy(2))),this._startDist=M.distanceTo(O),this._startZoom=w.getZoom(),this._moved=!1,this._zooming=!0,w._stop(),ct(document,"touchmove",this._onTouchMove,this),ct(document,"touchend touchcancel",this._onTouchEnd,this),Sn(g)}},_onTouchMove:function(g){if(!(!g.touches||g.touches.length!==2||!this._zooming)){var w=this._map,M=w.mouseEventToContainerPoint(g.touches[0]),O=w.mouseEventToContainerPoint(g.touches[1]),j=M.distanceTo(O)/this._startDist;if(this._zoom=w.getScaleZoom(j,this._startZoom),!w.options.bounceAtZoomLimits&&(this._zoomw.getMaxZoom()&&j>1)&&(this._zoom=w._limitZoom(this._zoom)),w.options.touchZoom==="center"){if(this._center=this._startLatLng,j===1)return}else{var W=M._add(O)._divideBy(2)._subtract(this._centerPoint);if(j===1&&W.x===0&&W.y===0)return;this._center=w.unproject(w.project(this._pinchStartLatLng,this._zoom).subtract(W),this._zoom)}this._moved||(w._moveStart(!0,!1),this._moved=!0),N(this._animRequest);var q=o(w._move,w,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=E(q,this,!0),Sn(g)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,N(this._animRequest),Qt(document,"touchmove",this._onTouchMove,this),Qt(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",y5),Mt.BoxZoom=h5,Mt.DoubleClickZoom=d5,Mt.Drag=v5,Mt.Keyboard=p5,Mt.ScrollWheelZoom=g5,Mt.TapHold=m5,Mt.TouchZoom=y5,r.Bounds=Z,r.Browser=He,r.CRS=Ie,r.Canvas=l5,r.Circle=pA,r.CircleMarker=gx,r.Class=z,r.Control=za,r.DivIcon=a5,r.DivOverlay=So,r.DomEvent=Bae,r.DomUtil=jae,r.Draggable=Sl,r.Evented=$,r.FeatureGroup=ys,r.GeoJSON=_s,r.GridLayer=zp,r.Handler=wo,r.Icon=dh,r.ImageOverlay=bx,r.LatLng=ce,r.LatLngBounds=K,r.Layer=$a,r.LayerGroup=hh,r.LineUtil=Kae,r.Map=Mt,r.Marker=px,r.Mixin=Hae,r.Path=Tl,r.Point=B,r.PolyUtil=Uae,r.Polygon=vh,r.Polyline=xs,r.Popup=Sx,r.PosAnimation=F3,r.Projection=Jae,r.Rectangle=f5,r.Renderer=bs,r.SVG=Fp,r.SVGOverlay=i5,r.TileLayer=gh,r.Tooltip=Tx,r.Transformation=ue,r.Util=D,r.VideoOverlay=n5,r.bind=o,r.bounds=Y,r.canvas=u5,r.circle=ooe,r.circleMarker=aoe,r.control=jp,r.divIcon=poe,r.extend=i,r.featureGroup=roe,r.geoJSON=r5,r.geoJson=uoe,r.gridLayer=goe,r.icon=noe,r.imageOverlay=coe,r.latLng=de,r.latLngBounds=te,r.layerGroup=toe,r.map=zae,r.marker=ioe,r.point=U,r.polygon=loe,r.polyline=soe,r.popup=doe,r.rectangle=xoe,r.setOptions=m,r.stamp=l,r.svg=c5,r.svgOverlay=hoe,r.tileLayer=o5,r.tooltip=voe,r.transformation=ee,r.version=n,r.videoOverlay=foe;var boe=window.L;r.noConflict=function(){return window.L=boe,this},window.L=r})})(jE,jE.exports);var ih=jE.exports;const mae=Yt(ih);function tx(e,t,r){return Object.freeze({instance:e,context:t,container:r})}function k3(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 yae(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 aQe(e){return function(r){const n=HC(),i=e(UC(r,n),n);return dae(n.map,r.attribution),P3(i.current,r.eventHandlers),yae(i.current,n),i}}function oQe(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 sQe(e){return function(r){const n=HC(),i=e(UC(r,n),n);return P3(i.current,r.eventHandlers),yae(i.current,n),oQe(i.current,r),i}}function xae(e,t){const r=k3(e),n=iQe(r,t);return rQe(n)}function _ae(e,t){const r=k3(e,t),n=sQe(r);return tQe(n)}function lQe(e,t){const r=k3(e,t),n=aQe(r);return nQe(n)}function uQe(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 cQe(){return HC().map}const fQe=_ae(function({center:t,children:r,...n},i){const a=new ih.CircleMarker(t,n);return tx(a,vae(i,{overlayContainer:a}))},JJe);function RE(){return RE=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 ih.Map(x,c);r!=null&&u!=null?_.setView(r,u):e!=null&&_.fitBounds(e,t),l!=null&&_.whenReady(l),v(eQe(_))}},[]);G.useEffect(()=>()=>{d==null||d.map.remove()},[d]);const y=d?Q.createElement(gae,{value:d},n):o??null;return Q.createElement("div",RE({},h,{ref:m}),y)}const dQe=G.forwardRef(hQe),vQe=_ae(function({positions:t,...r},n){const i=new ih.Polyline(t,r);return tx(i,vae(n,{overlayContainer:i}))},function(t,r,n){r.positions!==n.positions&&t.setLatLngs(r.positions)}),pQe=xae(function(t,r){const n=new ih.Popup(t,r.overlayContainer);return tx(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])}),gQe=lQe(function({url:t,...r},n){const i=new ih.TileLayer(t,UC(r,n));return tx(i,n)},function(t,r,n){uQe(t,r,n);const{url:i}=r;i!=null&&i!==n.url&&t.setUrl(i)}),mQe=xae(function(t,r){const n=new ih.Tooltip(t,r.overlayContainer);return tx(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])}),yQe="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=",xQe="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==",_Qe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC";delete mae.Icon.Default.prototype._getIconUrl;mae.Icon.Default.mergeOptions({iconUrl:yQe,iconRetinaUrl:xQe,shadowUrl:_Qe});const d7=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],bQe=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function wQe(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function SQe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function TQe(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 CQe({bounds:e}){const t=cQe();return G.useEffect(()=>{e&&t.fitBounds(e,{padding:[50,50]})},[t,e]),null}function AQe({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 p.jsxs("div",{className:"min-w-[200px]",children:[p.jsx("div",{className:"font-semibold text-slate-800",children:e.short_name}),p.jsx("div",{className:"text-xs text-slate-600 mb-2",children:e.long_name}),p.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[p.jsx("div",{className:"text-slate-500",children:"Role"}),p.jsx("div",{className:"text-slate-700 font-medium",children:e.role}),p.jsx("div",{className:"text-slate-500",children:"Hardware"}),p.jsx("div",{className:"text-slate-700",children:e.hardware||"Unknown"}),p.jsx("div",{className:"text-slate-500",children:"Battery"}),p.jsx("div",{className:"text-slate-700",children:r}),p.jsx("div",{className:"text-slate-500",children:"Last Heard"}),p.jsx("div",{className:"text-slate-700",children:TQe(e.last_heard)})]}),t&&p.jsxs("div",{className:"mt-3 pt-2 border-t border-slate-200 flex gap-2",children:[p.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:[p.jsx(Ud,{size:10}),"Google Maps"]}),p.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:[p.jsx(Ud,{size:10}),"OSM"]})]})]})}function MQe({nodes:e,edges:t,selectedNodeId:r,onSelectNode:n}){const i=G.useMemo(()=>e.filter(f=>f.latitude!==null&&f.longitude!==null),[e]),a=e.length-i.length,o=G.useMemo(()=>new Map(i.map(f=>[f.node_num,f])),[i]),s=G.useMemo(()=>t.filter(f=>o.has(f.from_node)&&o.has(f.to_node)),[t,o]),l=G.useMemo(()=>{if(i.length===0)return null;const f=i.map(d=>d.latitude),h=i.map(d=>d.longitude);return[[Math.min(...f),Math.min(...h)],[Math.max(...f),Math.max(...h)]]},[i]),u=[43.6,-114.4],c=G.useMemo(()=>{const f=new Set;return r!==null&&t.forEach(h=>{h.from_node===r&&f.add(h.to_node),h.to_node===r&&f.add(h.from_node)}),f},[r,t]);return p.jsxs("div",{className:"relative bg-bg-card rounded-lg border border-border overflow-hidden",children:[p.jsxs(dQe,{center:u,zoom:7,style:{width:"100%",height:"540px"},className:"z-0",children:[p.jsx(gQe,{url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",attribution:'© OpenStreetMap, © CARTO'}),p.jsx(CQe,{bounds:l}),s.map((f,h)=>{const d=o.get(f.from_node),v=o.get(f.to_node),m=r===null||f.from_node===r||f.to_node===r;return p.jsx(vQe,{positions:[[d.latitude,d.longitude],[v.latitude,v.longitude]],color:wQe(f.snr),weight:m&&r!==null?2.5:1.5,opacity:r===null?.3:m?.6:.08},h)}),i.map(f=>{const h=f.node_num===r,d=c.has(f.node_num),v=r===null||h||d,m=bQe.includes(f.role),y=SQe(f.latitude),x=d7[y%d7.length];return p.jsxs(fQe,{center:[f.latitude,f.longitude],radius:m?8:5,fillColor:m?x:"#111827",fillOpacity:v?.9:.2,stroke:!0,color:h?"#ffffff":x,weight:h?3:m?0:2,opacity:v?1:.3,eventHandlers:{click:()=>n(h?null:f.node_num)},children:[p.jsx(mQe,{direction:"top",offset:[0,-8],children:p.jsx("span",{className:"font-mono text-xs",children:f.short_name})}),p.jsx(pQe,{children:p.jsx(AQe,{node:f})})]},f.node_num)})]}),p.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:[p.jsx($v,{size:12}),p.jsxs("span",{children:["Showing ",i.length," of ",e.length," nodes",a>0&&p.jsxs("span",{className:"text-slate-500",children:[" (",a," without coordinates)"]})]})]})]})}const v7=["#3b82f6","#a78bfa","#06b6d4","#f59e0b","#22c55e","#ec4899","#8b5cf6","#14b8a6"],PQe=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function p7(e){return e>12?"#22c55e":e>8?"#4ade80":e>5?"#f59e0b":e>3?"#f97316":"#ef4444"}function kQe(e){return e>12?"excellent":e>8?"good":e>5?"fair":e>3?"marginal":"poor"}function LQe(e){return e===null||e>46?0:e>44.5?1:e>43?2:3}function IQe(e){return["Northern ID","Central ID","SW Idaho","SC Idaho"][e]||"Unknown"}function OQe(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 EQe(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 NQe({node:e,edges:t,nodes:r,onSelectNode:n}){const i=G.useMemo(()=>{if(!e)return[];const f=new Map(r.map(d=>[d.node_num,d])),h=[];return t.forEach(d=>{if(d.from_node===e.node_num){const v=f.get(d.to_node);v&&h.push({node:v,snr:d.snr,quality:d.quality})}else if(d.to_node===e.node_num){const v=f.get(d.from_node);v&&h.push({node:v,snr:d.snr,quality:d.quality})}}),h.sort((d,v)=>v.snr-d.snr)},[e,t,r]);if(!e)return p.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:[p.jsx("div",{className:"w-12 h-12 rounded-full bg-bg-hover border border-border flex items-center justify-center mb-3",children:p.jsx(ho,{size:24,className:"text-slate-500"})}),p.jsx("p",{className:"text-sm text-slate-500 text-center",children:"Click a node to inspect"})]});const a=PQe.includes(e.role),o=LQe(e.latitude),s=v7[o%v7.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 p.jsxs("div",{className:"w-[250px] flex-shrink-0 bg-bg-card border-l border-border flex flex-col h-[540px] overflow-hidden",children:[p.jsxs("div",{className:"p-4 border-b border-border",children:[p.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}),p.jsx("div",{className:"font-mono text-lg text-slate-100",children:e.short_name}),p.jsx("div",{className:"text-xs text-slate-500 truncate",children:e.long_name})]}),p.jsxs("div",{className:"p-4 border-b border-border grid grid-cols-2 gap-3",children:[p.jsxs("div",{children:[p.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Role"}),p.jsx("div",{className:`text-sm font-medium ${a?"text-cyan-400":"text-slate-300"}`,children:e.role})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Region"}),p.jsx("div",{className:"text-sm text-slate-300",children:IQe(o)})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Battery"}),p.jsxs("div",{className:"text-sm text-slate-300 flex items-center gap-1",children:[c&&p.jsx(ry,{size:12,className:"text-amber-400"}),u]})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Status"}),p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("div",{className:`w-2 h-2 rounded-full ${EQe(e.last_heard)}`}),p.jsx("span",{className:"text-sm text-slate-300",children:OQe(e.last_heard)})]})]}),p.jsxs("div",{className:"col-span-2",children:[p.jsx("div",{className:"text-xs text-slate-500 mb-0.5",children:"Hardware"}),p.jsx("div",{className:"text-sm text-slate-300 font-mono truncate",children:e.hardware||"Unknown"})]})]}),l&&p.jsxs("div",{className:"px-4 py-3 border-b border-border flex gap-3",children:[p.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-400 hover:text-blue-300",children:[p.jsx(Ud,{size:10}),"Google Maps"]}),p.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-400 hover:text-blue-300",children:[p.jsx(Ud,{size:10}),"OSM"]})]}),p.jsxs("div",{className:"flex-1 overflow-y-auto",children:[p.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?p.jsx("div",{className:"divide-y divide-border",children:i.map(f=>p.jsxs("button",{onClick:()=>n(f.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:p7(f.snr)},children:[p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm text-slate-200 font-mono truncate",children:f.node.short_name}),p.jsx("div",{className:"text-xs text-slate-500 truncate",children:f.node.long_name})]}),p.jsxs("div",{className:"text-right flex-shrink-0",children:[p.jsxs("div",{className:"text-xs font-mono",style:{color:p7(f.snr)},children:[f.snr.toFixed(1)," dB"]}),p.jsx("div",{className:"text-xs text-slate-500",children:kQe(f.snr)})]})]},f.node.node_num))}):p.jsx("div",{className:"px-4 py-6 text-center text-sm text-slate-500",children:"No known neighbors"})]})]})}const g7=["ROUTER","ROUTER_LATE","REPEATER","TRACKER"];function DQe(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 jQe(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 RQe(e){return e.battery_level===null?"—":e.battery_level>100||e.voltage&&e.voltage>4.1?"USB ⚡":`${e.battery_level.toFixed(0)}%`}function m7(e){return e===null?"—":e>46?"Northern":e>44.5?"Central":e>43?"SW Idaho":"SC Idaho"}function BQe({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"),f=G.useMemo(()=>{let v=[...e];if(u==="infra"?v=v.filter(m=>g7.includes(m.role)):u==="online"&&(v=v.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();v=v.filter(y=>y.short_name.toLowerCase().includes(m)||y.long_name.toLowerCase().includes(m)||y.role.toLowerCase().includes(m)||m7(y.latitude).toLowerCase().includes(m))}return v.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}),v},[e,n,a,s,u]),h=v=>{a===v?l(s==="asc"?"desc":"asc"):(o(v),l("asc"))},d=({field:v})=>a!==v?null:s==="asc"?p.jsx(vce,{size:14,className:"inline ml-1"}):p.jsx(Bu,{size:14,className:"inline ml-1"});return p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg overflow-hidden",children:[p.jsxs("div",{className:"p-3 border-b border-border flex items-center gap-3",children:[p.jsxs("div",{className:"relative flex-1 max-w-xs",children:[p.jsx(dT,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),p.jsx("input",{type:"text",placeholder:"Search nodes...",value:n,onChange:v=>i(v.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"})]}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx(RN,{size:14,className:"text-slate-500 mr-1"}),["all","infra","online"].map(v=>p.jsx("button",{onClick:()=>c(v),className:`px-2 py-1 text-xs rounded transition-colors ${u===v?"bg-accent text-white":"bg-bg-hover text-slate-400 hover:text-slate-200"}`,children:v==="all"?"All":v==="infra"?"Infra":"Online"},v))]}),p.jsxs("div",{className:"text-xs text-slate-500 ml-auto",children:[f.length," of ",e.length," nodes"]})]}),p.jsxs("div",{className:"overflow-x-auto",children:[p.jsxs("table",{className:"w-full text-sm",children:[p.jsx("thead",{children:p.jsxs("tr",{className:"bg-bg-hover text-slate-400 text-xs",children:[p.jsx("th",{className:"w-8 px-3 py-2"}),p.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("short_name"),children:["Name ",p.jsx(d,{field:"short_name"})]}),p.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("role"),children:["Role ",p.jsx(d,{field:"role"})]}),p.jsx("th",{className:"px-3 py-2 text-left",children:"Region"}),p.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("battery_level"),children:[p.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"})," ",p.jsx(d,{field:"battery_level"})]}),p.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("last_heard"),children:[p.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"})," ",p.jsx(d,{field:"last_heard"})]}),p.jsxs("th",{className:"px-3 py-2 text-left cursor-pointer hover:text-slate-200",onClick:()=>h("hardware"),children:["Hardware ",p.jsx(d,{field:"hardware"})]})]})}),p.jsx("tbody",{className:"divide-y divide-border",children:f.slice(0,100).map(v=>{const m=g7.includes(v.role),y=v.node_num===t;return p.jsxs("tr",{onClick:()=>r(v.node_num),className:`cursor-pointer transition-colors ${y?"bg-accent/10":"hover:bg-bg-hover"}`,children:[p.jsx("td",{className:"px-3 py-2",children:p.jsx("div",{className:`w-2 h-2 rounded-full ${DQe(v.last_heard)}`})}),p.jsxs("td",{className:"px-3 py-2",children:[p.jsx("div",{className:"font-mono text-slate-200",children:v.short_name}),p.jsx("div",{className:"text-xs text-slate-500 truncate max-w-[200px]",children:v.long_name})]}),p.jsx("td",{className:"px-3 py-2",children:p.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-xs font-medium ${m?"bg-cyan-500/20 text-cyan-400":"bg-slate-500/20 text-slate-400"}`,children:v.role})}),p.jsx("td",{className:"px-3 py-2 text-slate-400",children:m7(v.latitude)}),p.jsx("td",{className:"px-3 py-2 font-mono text-slate-300",children:RQe(v)}),p.jsx("td",{className:"px-3 py-2 text-slate-400",children:jQe(v.last_heard)}),p.jsx("td",{className:"px-3 py-2 font-mono text-xs text-slate-400 truncate max-w-[150px]",children:v.hardware||"—"})]},v.node_num)})})]}),f.length>100&&p.jsxs("div",{className:"px-3 py-2 text-xs text-slate-500 text-center border-t border-border",children:["Showing first 100 of ",f.length," nodes"]}),f.length===0&&p.jsx("div",{className:"px-3 py-8 text-sm text-slate-500 text-center",children:"No nodes match your filters"})]})]})}function zQe(){const[e,t]=G.useState([]),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState(null),[l,u]=G.useState("topo"),[c,f]=G.useState(!0),[h,d]=G.useState(null);G.useEffect(()=>{document.title="Mesh — MeshAI",Promise.all([Pce(),kce(),Nce()]).then(([y,x,_])=>{t(y),n(x),a(_),f(!1)}).catch(y=>{d(y.message),f(!1)})},[]);const v=G.useMemo(()=>e.find(y=>y.node_num===o)||null,[e,o]),m=G.useCallback(y=>{s(y)},[]);return c?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-slate-400",children:"Loading mesh data..."})}):h?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsxs("div",{className:"text-red-400",children:["Error: ",h]})}):p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"text-sm text-slate-400",children:[e.length," nodes • ",r.length," edges"]}),p.jsxs("div",{className:"flex items-center bg-bg-card border border-border rounded-lg p-1",children:[p.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:[p.jsx(iY,{size:14}),p.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"})]}),p.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:[p.jsx(wce,{size:14}),p.jsx("span",{title:"Nodes plotted by lat/lon on a basemap. Nodes without a reported position are clustered at the top edge.",children:"Geographic"})]})]})]}),p.jsxs("div",{className:"flex gap-0",children:[p.jsx("div",{className:"flex-1 min-w-0",children:l==="topo"?p.jsx(KJe,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:m}):p.jsx(MQe,{nodes:e,edges:r,selectedNodeId:o,onSelectNode:m})}),p.jsx(NQe,{node:v,edges:r,nodes:e,onSelectNode:m})]}),p.jsx(BQe,{nodes:e,selectedNodeId:o,onSelectNode:m})]})}function L3({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),[f,h]=G.useState(""),[d,v]=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)),f.trim()){const T=f.toLowerCase();S=S.filter(C=>{var A,P,I,k;return((A=C.short_name)==null?void 0:A.toLowerCase().includes(T))||((P=C.long_name)==null?void 0:P.toLowerCase().includes(T))||((I=C.role)==null?void 0:I.toLowerCase().includes(T))||((k=C.node_id_hex)==null?void 0:k.toLowerCase().includes(T))})}return S.sort((T,C)=>(T.short_name||"").localeCompare(C.short_name||""))},[s,f,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(C=>C!==T)):r([...t,T])},b=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?p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),p.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&&p.jsx("p",{className:"text-xs text-slate-600",children:n})]}):p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e}),t.length>0&&p.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.map(S=>{const T=s.find(C=>y(C)===S);return p.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,p.jsx("button",{type:"button",onClick:()=>r(t.filter(C=>C!==S)),className:"hover:text-white",children:p.jsx(vo,{size:14})})]},S)})}),p.jsxs("div",{className:"relative",children:[p.jsxs("div",{className:"relative",children:[p.jsx(dT,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),p.jsx("input",{type:"text",value:f,onChange:S=>h(S.target.value),onFocus:()=>v(!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&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>v(!1)}),p.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] rounded-lg shadow-xl",children:m.length===0?p.jsx("div",{className:"p-3 text-sm text-slate-500 text-center",children:"No nodes found"}):m.map(S=>p.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:[p.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)&&p.jsx(ts,{size:12,className:"text-white"})}),p.jsx("span",{className:"text-slate-200",children:b(S)})]},S.node_num))})]})]}),n&&p.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function I3(e){const[t,r]=G.useState([]),[n,i]=G.useState(!0);G.useEffect(()=>{fetch("/api/channels").then(h=>h.json()).then(h=>{r(h),i(!1)}).catch(()=>{r([]),i(!1)})},[]);const a=h=>{const d=h.role==="PRIMARY"?"Primary":h.role==="SECONDARY"?"Secondary":"";return`${h.index}: ${h.name}${d?` (${d})`:""}`};if(!n&&t.length===0)return e.mode==="single"?p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),p.jsx("input",{type:"number",value:e.value,onChange:h=>e.onChange(Number(h.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&&p.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]}):p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:e.label}),p.jsx("input",{type:"text",value:e.value.join(", "),onChange:h=>{const d=h.target.value.split(",").map(v=>parseInt(v.trim())).filter(v=>!isNaN(v));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&&p.jsx("p",{className:"text-xs text-slate-600",children:e.helper})]});if(e.mode==="single"){const{value:h,onChange:d,label:v,helper:m,includeDisabled:y}=e,x=t.filter(_=>_.enabled);return p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:v}),p.jsxs("select",{value:h,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&&p.jsx("option",{value:-1,children:"Disabled"}),x.map(_=>p.jsx("option",{value:_.index,children:a(_)},_.index))]}),m&&p.jsx("p",{className:"text-xs text-slate-600",children:m})]})}const{value:o,onChange:s,label:l,helper:u}=e,c=t.filter(h=>h.enabled),f=h=>{o.includes(h)?s(o.filter(d=>d!==h)):s([...o,h].sort((d,v)=>d-v))};return p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"block text-xs text-slate-500 uppercase tracking-wide",children:l}),p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-2 space-y-1",children:[c.map(h=>p.jsxs("label",{onClick:()=>f(h.index),className:"flex items-center gap-2 p-2 rounded hover:bg-[#0a0e17] cursor-pointer",children:[p.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center ${o.includes(h.index)?"bg-accent border-accent":"border-slate-600"}`,children:o.includes(h.index)&&p.jsx(ts,{size:12,className:"text-white"})}),p.jsx("span",{className:"text-sm text-slate-200",children:a(h)})]},h.index)),c.length===0&&p.jsx("div",{className:"text-sm text-slate-500 p-2",children:"No channels available"})]}),u&&p.jsx("p",{className:"text-xs text-slate-600",children:u})]})}const y7=[{key:"bot",label:"Bot",icon:cce},{key:"connection",label:"Connection",icon:vT},{key:"response",label:"Response",icon:BN},{key:"history",label:"History",icon:eY},{key:"memory",label:"Memory",icon:fce},{key:"context",label:"Context",icon:jN},{key:"commands",label:"Commands",icon:sY},{key:"llm",label:"LLM",icon:QZ},{key:"weather",label:"Weather",icon:Pu},{key:"meshmonitor",label:"MeshMonitor",icon:ho},{key:"knowledge",label:"Knowledge",icon:KZ},{key:"mesh_sources",label:"Mesh Sources",icon:rY},{key:"mesh_intelligence",label:"Intelligence",icon:zv},{key:"dashboard",label:"Dashboard",icon:nY}],Ci={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."},$Qe=[{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"}],FQe=[{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 cs({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]),p.jsxs("div",{className:"relative inline-block",ref:a,children:[p.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&&p.jsxs("div",{className:"absolute left-0 top-6 z-50 w-72 p-3 bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl text-xs text-slate-300 leading-relaxed",children:[p.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:p.jsx(vo,{size:12})}),p.jsx("div",{className:"pr-4",children:e}),t&&p.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," ",p.jsx(Ud,{size:10})]})]})]})}function Ai({text:e}){return p.jsx("p",{className:"text-sm text-slate-500 mb-6 pb-4 border-b border-[#1e2a3a]",children:e})}function xt({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 p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&p.jsx(cs,{info:o,link:s})]}),p.jsxs("div",{className:"relative",children:[p.jsx("input",{type:c&&!l?"password":"text",value:t,onChange:f=>r(f.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&&p.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?p.jsx(tY,{size:16}):p.jsx(jN,{size:16})})]}),a&&p.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function Xe({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s="",infoLink:l=""}){return p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&p.jsx(cs,{info:s,link:l})]}),p.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&&p.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function kr({label:e,checked:t,onChange:r,helper:n="",info:i="",infoLink:a=""}){return p.jsxs("div",{className:"flex items-center justify-between py-2",children:[p.jsxs("div",{children:[p.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&p.jsx(cs,{info:i,link:a})]}),n&&p.jsx("p",{className:"text-xs text-slate-600",children:n})]}),p.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:p.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function to({label:e,value:t,onChange:r,options:n,helper:i="",info:a="",infoLink:o=""}){return p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&p.jsx(cs,{info:a,link:o})]}),p.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=>p.jsx("option",{value:s.value,children:s.label},s.value))}),i&&p.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function VQe({label:e,value:t,onChange:r,rows:n=4,helper:i="",info:a="",infoLink:o=""}){return p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&p.jsx(cs,{info:a,link:o})]}),p.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&&p.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function Gc({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 p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&p.jsx(cs,{info:i,link:a})]}),p.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&&p.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function GQe({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 p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&p.jsx(cs,{info:i,link:a})]}),p.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&&p.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function Fn({label:e,description:t,checked:r,onChange:n,threshold:i,onThresholdChange:a,thresholdLabel:o,thresholdMin:s,thresholdMax:l,thresholdStep:u=1,thresholdSuffix:c=""}){return p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-3 space-y-2",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex-1",children:[p.jsx("span",{className:"text-sm text-slate-300",children:e}),p.jsx("p",{className:"text-xs text-slate-600",children:t})]}),p.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:p.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&&p.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-[#1e2a3a]",children:[p.jsxs("span",{className:"text-xs text-slate-500",children:[o||"Threshold",":"]}),p.jsx("input",{type:"number",value:i,onChange:f=>a(Number(f.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&&p.jsx("span",{className:"text-xs text-slate-500",children:c})]})]})}function WQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Ai,{text:Ci.bot}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{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."}),p.jsx(xt,{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."})]}),p.jsx(kr,{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."}),p.jsx(kr,{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 HQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Ai,{text:Ci.connection}),p.jsx(to,{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"?p.jsx(xt,{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."}):p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{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"}),p.jsx(Xe,{label:"TCP Port",value:e.tcp_port,onChange:r=>t({...e,tcp_port:r}),min:1,max:65535,helper:"Default 4403 for meshtasticd"})]})]})}function UQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Ai,{text:Ci.response}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{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."}),p.jsx(Xe,{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."})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{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."}),p.jsx(Xe,{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 ZQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Ai,{text:Ci.history}),p.jsx(xt,{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."}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{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."}),p.jsx(Xe,{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."})]}),p.jsx(kr,{label:"Auto Cleanup",checked:e.auto_cleanup,onChange:r=>t({...e,auto_cleanup:r}),helper:"Automatically prune old conversations"}),e.auto_cleanup&&p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{label:"Cleanup Interval (hours)",value:e.cleanup_interval_hours,onChange:r=>t({...e,cleanup_interval_hours:r}),min:1,helper:"Hours between cleanup runs"}),p.jsx(Xe,{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 YQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Ai,{text:Ci.memory}),p.jsx(kr,{label:"Enable Memory",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Keep conversation context between messages"}),e.enabled&&p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{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."}),p.jsx(Xe,{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 qQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Ai,{text:Ci.context}),p.jsx(kr,{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&&p.jsxs(p.Fragment,{children:[p.jsx(I3,{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"}),p.jsx(L3,{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."}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{label:"Max Age (sec)",value:e.max_age,onChange:r=>t({...e,max_age:r}),min:0,helper:"Ignore messages older than this"}),p.jsx(Xe,{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 XQe({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 p.jsxs("div",{className:"space-y-4",children:[p.jsx(Ai,{text:Ci.commands}),p.jsx(kr,{label:"Enable Commands",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Allow !commands on the mesh"}),e.enabled&&p.jsxs(p.Fragment,{children:[p.jsx(xt,{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."}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Available Commands",p.jsx(cs,{info:"Toggle commands on or off. Disabled commands won't respond when users invoke them."})]}),p.jsx("div",{className:"grid gap-1",children:$Qe.map(i=>{const a=!r.has(i.name.toLowerCase());return p.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#0a0e17] border border-[#1e2a3a] rounded hover:border-[#2a3a4a] transition-colors",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("code",{className:"text-accent text-sm",children:["!",i.name]}),p.jsx("span",{className:"text-xs text-slate-500",children:i.description})]}),p.jsx("button",{type:"button",onClick:()=>n(i.name),className:`relative w-9 h-5 rounded-full transition-colors ${a?"bg-accent":"bg-[#1e2a3a]"}`,children:p.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 KQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Ai,{text:Ci.llm}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(to,{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."}),p.jsx(xt,{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)."})]}),p.jsx(xt,{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."}),p.jsx(xt,{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."}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{label:"Timeout (sec)",value:e.timeout,onChange:r=>t({...e,timeout:r}),min:5,max:120,helper:"Maximum seconds to wait for response"}),p.jsx(Xe,{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"})]}),p.jsx(kr,{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&&p.jsx(VQe,{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."}),p.jsx(kr,{label:"Web Search",checked:e.web_search,onChange:r=>t({...e,web_search:r}),helper:"Enable web search tool (Open WebUI feature)"}),p.jsx(kr,{label:"Google Grounding",checked:e.google_grounding,onChange:r=>t({...e,google_grounding:r}),helper:"Ground responses in web search (Gemini only)"})]})}function JQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Ai,{text:Ci.weather}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(to,{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"}),p.jsx(to,{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"})]}),p.jsx(xt,{label:"Default Location",value:e.default_location,onChange:r=>t({...e,default_location:r}),placeholder:"Your city, state",helper:"Location when none specified"})]})}function QQe({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Ai,{text:Ci.meshmonitor}),p.jsx(kr,{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&&p.jsxs(p.Fragment,{children:[p.jsx(xt,{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."}),p.jsx(kr,{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."}),p.jsx(Xe,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:r=>t({...e,refresh_interval:r}),min:10,helper:"How often to fetch patterns"}),p.jsx(kr,{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 eet({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Ai,{text:Ci.knowledge}),p.jsx(kr,{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&&p.jsxs(p.Fragment,{children:[p.jsx(to,{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")&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{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."}),p.jsx(Xe,{label:"Qdrant Port",value:e.qdrant_port,onChange:r=>t({...e,qdrant_port:r}),helper:"Default 6333"})]}),p.jsx(xt,{label:"Collection",value:e.qdrant_collection,onChange:r=>t({...e,qdrant_collection:r}),helper:"Qdrant collection name"}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{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."}),p.jsx(Xe,{label:"TEI Port",value:e.tei_port,onChange:r=>t({...e,tei_port:r}),helper:"Default 8090"})]}),p.jsx(kr,{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."})]}),p.jsx(xt,{label:"SQLite DB Path",value:e.db_path,onChange:r=>t({...e,db_path:r}),helper:"Local knowledge database file"}),p.jsx(Xe,{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 tet({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 p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>i(!n),children:[p.jsxs("div",{className:"flex items-center gap-3",children:[n?p.jsx(Bu,{size:16}):p.jsx(Au,{size:16}),p.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`}),p.jsx("span",{className:"font-mono text-sm text-slate-200",children:e.name||"Unnamed Source"}),p.jsx("span",{className:"text-xs text-slate-500 bg-[#1e2a3a] px-2 py-0.5 rounded",children:e.type})]}),p.jsx("button",{onClick:o=>{o.stopPropagation(),r()},className:"p-1 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",children:p.jsx(C0,{size:14})})]}),n&&p.jsxs("div",{className:"p-4 space-y-4 border-t border-[#1e2a3a]",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{label:"Name",value:e.name,onChange:o=>t({...e,name:o}),helper:"Friendly name for this source"}),p.jsx(to,{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"&&p.jsx(xt,{label:"URL",value:e.url,onChange:o=>t({...e,url:o}),helper:"Full URL including protocol"}),e.type==="meshmonitor"&&p.jsx(xt,{label:"API Token",value:e.api_token,onChange:o=>t({...e,api_token:o}),type:"password",helper:"Bearer token for authentication"}),e.type==="mqtt"&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{label:"Host",value:e.host||"",onChange:o=>t({...e,host:o}),helper:"MQTT broker hostname"}),p.jsx(Xe,{label:"Port",value:e.port||1883,onChange:o=>t({...e,port:o}),min:1,max:65535,helper:"1883 plain, 8883 TLS"})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{label:"Username",value:e.username||"",onChange:o=>t({...e,username:o})}),p.jsx(xt,{label:"Password",value:e.password||"",onChange:o=>t({...e,password:o}),type:"password"})]}),p.jsx(xt,{label:"Topic Root",value:e.topic_root||"msh/US",onChange:o=>t({...e,topic_root:o}),helper:"Base topic to subscribe to"}),p.jsx(kr,{label:"Use TLS",checked:e.use_tls||!1,onChange:o=>t({...e,use_tls:o}),helper:"Encrypt MQTT connection"})]}),p.jsx(Xe,{label:"Refresh Interval (sec)",value:e.refresh_interval,onChange:o=>t({...e,refresh_interval:o}),min:10,helper:"Polling frequency"}),p.jsx(kr,{label:"Enabled",checked:e.enabled,onChange:o=>t({...e,enabled:o})}),p.jsx(kr,{label:"Polite Mode",checked:e.polite_mode,onChange:o=>t({...e,polite_mode:o}),helper:"Reduce polling for shared instances"})]})]})}function ret({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 p.jsxs("div",{className:"space-y-4",children:[p.jsx(Ai,{text:Ci.mesh_sources}),e.map((n,i)=>p.jsx(tet,{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)),p.jsxs("button",{onClick:r,className:"w-full py-2 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[p.jsx(Fv,{size:16})," Add Source"]})]})}function net({data:e,onChange:t}){const[r,n]=G.useState(null);return p.jsxs("div",{className:"space-y-6",children:[p.jsx(Ai,{text:Ci.mesh_intelligence}),p.jsx(kr,{label:"Enable Mesh Intelligence",checked:e.enabled,onChange:i=>t({...e,enabled:i}),helper:"Activate health scoring and alerting"}),e.enabled&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{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."}),p.jsx(Xe,{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."})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{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."}),p.jsx(Xe,{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"})]}),p.jsx(L3,{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"}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(I3,{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}),p.jsx(Xe,{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)."})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Regions",p.jsx(cs,{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)=>p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg overflow-hidden",children:[p.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>n(r===a?null:a),children:[p.jsxs("div",{className:"flex items-center gap-3",children:[r===a?p.jsx(Bu,{size:16}):p.jsx(Au,{size:16}),p.jsx("span",{className:"font-medium text-slate-200",children:i.name||"Unnamed Region"}),p.jsx("span",{className:"text-xs text-slate-500",children:i.local_name})]}),p.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:p.jsx(C0,{size:14})})]}),r===a&&p.jsxs("div",{className:"p-4 space-y-3 border-t border-[#1e2a3a]",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{label:"Name",value:i.name,onChange:o=>{const s=[...e.regions];s[a]={...i,name:o},t({...e,regions:s})}}),p.jsx(xt,{label:"Local Name",value:i.local_name,onChange:o=>{const s=[...e.regions];s[a]={...i,local_name:o},t({...e,regions:s})}})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{label:"Latitude",value:i.lat,onChange:o=>{const s=[...e.regions];s[a]={...i,lat:o},t({...e,regions:s})},step:1e-4}),p.jsx(Xe,{label:"Longitude",value:i.lon,onChange:o=>{const s=[...e.regions];s[a]={...i,lon:o},t({...e,regions:s})},step:1e-4})]}),p.jsx(xt,{label:"Description",value:i.description,onChange:o=>{const s=[...e.regions];s[a]={...i,description:o},t({...e,regions:s})}}),p.jsx(Gc,{label:"Aliases",value:i.aliases,onChange:o=>{const s=[...e.regions];s[a]={...i,aliases:o},t({...e,regions:s})}}),p.jsx(Gc,{label:"Cities",value:i.cities,onChange:o=>{const s=[...e.regions];s[a]={...i,cities:o},t({...e,regions:s})}})]})]},a)),p.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] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[p.jsx(Fv,{size:16})," Add Region"]})]}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Rules",p.jsx(cs,{info:"Configure which conditions trigger alerts. Each rule can have an optional threshold value."})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Infrastructure"}),p.jsx(Fn,{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}})}),p.jsx(Fn,{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}})}),p.jsx(Fn,{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}})}),p.jsx(Fn,{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}})}),p.jsx(Fn,{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}})}),p.jsx(Fn,{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}})})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Power"}),p.jsx(Fn,{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:"%"}),p.jsx(Fn,{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:"%"}),p.jsx(Fn,{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:"%"}),p.jsx(Fn,{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}})}),p.jsx(Fn,{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}})}),p.jsx(Fn,{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}})})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Utilization"}),p.jsx(Fn,{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`}),p.jsx(Fn,{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"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("h4",{className:"text-xs text-slate-400 font-medium",children:"Health Scores"}),p.jsx(Fn,{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"}),p.jsx(Fn,{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 iet({data:e,onChange:t}){return p.jsxs("div",{className:"space-y-4",children:[p.jsx(Ai,{text:Ci.dashboard}),p.jsx(kr,{label:"Enable Dashboard",checked:e.enabled,onChange:r=>t({...e,enabled:r}),helper:"Run the web dashboard"}),e.enabled&&p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(xt,{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."}),p.jsx(Xe,{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 aet(){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,f]=G.useState(null),[h,d]=G.useState(null),[v,m]=G.useState(!1),[y,x]=G.useState(!1),_=G.useCallback(async()=>{try{const k=await fetch("/api/config");if(!k.ok)throw new Error("Failed to fetch config");const E=await k.json();t(E),n(JSON.parse(JSON.stringify(E))),x(!1),f(null)}catch(k){f(k instanceof Error?k.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 b=async()=>{if(e){u(!0),f(null),d(null);try{const k=e[i],E=await fetch(`/api/config/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)}),N=await E.json();if(!E.ok)throw new Error(N.detail||"Save failed");d(`${i} saved successfully`),n(JSON.parse(JSON.stringify(e))),x(!1),N.restart_required&&(m(!0),zce(Array.isArray(N.changed_keys)?N.changed_keys:[])),setTimeout(()=>d(null),3e3)}catch(k){f(k instanceof Error?k.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{f("Restart failed")}},C=(k,E)=>{e&&t({...e,[k]:E})};if(o)return p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-slate-400",children:"Loading configuration..."})});if(!e)return p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-red-400",children:"Failed to load configuration"})});const A=()=>{switch(i){case"bot":return p.jsx(WQe,{data:e.bot,onChange:k=>C("bot",k)});case"connection":return p.jsx(HQe,{data:e.connection,onChange:k=>C("connection",k)});case"response":return p.jsx(UQe,{data:e.response,onChange:k=>C("response",k)});case"history":return p.jsx(ZQe,{data:e.history,onChange:k=>C("history",k)});case"memory":return p.jsx(YQe,{data:e.memory,onChange:k=>C("memory",k)});case"context":return p.jsx(qQe,{data:e.context,onChange:k=>C("context",k)});case"commands":return p.jsx(XQe,{data:e.commands,onChange:k=>C("commands",k)});case"llm":return p.jsx(KQe,{data:e.llm,onChange:k=>C("llm",k)});case"weather":return p.jsx(JQe,{data:e.weather,onChange:k=>C("weather",k)});case"meshmonitor":return p.jsx(QQe,{data:e.meshmonitor,onChange:k=>C("meshmonitor",k)});case"knowledge":return p.jsx(eet,{data:e.knowledge,onChange:k=>C("knowledge",k)});case"mesh_sources":return p.jsx(ret,{data:e.mesh_sources,onChange:k=>C("mesh_sources",k)});case"mesh_intelligence":return p.jsx(net,{data:e.mesh_intelligence,onChange:k=>C("mesh_intelligence",k)});case"dashboard":return p.jsx(iet,{data:e.dashboard,onChange:k=>C("dashboard",k)});default:return null}},P=((I=y7.find(k=>k.key===i))==null?void 0:I.label)||i;return p.jsxs("div",{className:"flex gap-6 h-[calc(100vh-8rem)]",children:[p.jsx("div",{className:"w-48 flex-shrink-0 space-y-1",children:y7.map(({key:k,label:E,icon:N})=>p.jsxs("button",{onClick:()=>a(k),className:`w-full flex items-center gap-2 px-3 py-2 rounded text-sm transition-colors ${i===k?"bg-accent text-white":"text-slate-400 hover:text-slate-200 hover:bg-bg-hover"}`,children:[p.jsx(N,{size:16}),p.jsx("span",{children:E}),y&&i===k&&p.jsx("span",{className:"ml-auto w-2 h-2 bg-amber-500 rounded-full"})]},k))}),p.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[p.jsxs("div",{className:"flex items-center justify-between mb-6",children:[p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(aY,{size:20,className:"text-slate-500"}),p.jsx("h2",{className:"text-lg font-semibold text-slate-200",children:P})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[y&&p.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:[p.jsx(fT,{size:14}),"Discard"]}),p.jsxs("button",{onClick:b,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?p.jsx(ty,{size:14,className:"animate-spin"}):p.jsx(zN,{size:14}),"Save"]})]})]}),v&&p.jsxs("div",{className:"flex items-center justify-between p-3 mb-4 bg-amber-500/10 border border-amber-500/30 rounded-lg",children:[p.jsxs("div",{className:"flex items-center gap-2 text-amber-400",children:[p.jsx(nl,{size:16}),p.jsx("span",{className:"text-sm",children:"Restart required for changes to take effect"})]}),p.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&&p.jsxs("div",{className:"flex items-center gap-2 p-3 mb-4 bg-red-500/10 border border-red-500/30 rounded-lg text-red-400",children:[p.jsx(vo,{size:16}),p.jsx("span",{className:"text-sm",children:c})]}),h&&p.jsxs("div",{className:"flex items-center gap-2 p-3 mb-4 bg-green-500/10 border border-green-500/30 rounded-lg text-green-400",children:[p.jsx(ts,{size:16}),p.jsx("span",{className:"text-sm",children:h})]}),p.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:p.jsx("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:A()})})]})]})}function oet({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 p.jsxs("div",{className:"bg-bg-hover rounded-lg p-4",children:[p.jsxs("div",{className:"flex items-center justify-between mb-2",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:`w-2 h-2 rounded-full ${t}`}),p.jsx("span",{className:"text-sm font-medium text-slate-200 uppercase",children:e.source})]}),p.jsx("span",{className:"text-xs text-slate-400",children:r})]}),p.jsxs("div",{className:"text-xs text-slate-500 space-y-1",children:[p.jsxs("div",{children:["Events: ",e.event_count]}),p.jsxs("div",{children:["Last fetch: ",n]}),e.last_error&&p.jsx("div",{className:"text-amber-500 truncate",children:e.last_error})]})]})}function set({event:e}){const t=e.severity.toLowerCase(),r=t==="extreme"||t==="severe"||t==="immediate"?{bg:"bg-red-500/10",border:"border-red-500",Icon:Mu,color:"text-red-500"}:t==="moderate"||t==="warning"||t==="priority"?{bg:"bg-amber-500/10",border:"border-amber-500",Icon:nl,color:"text-amber-500"}:{bg:"bg-blue-500/10",border:"border-blue-500",Icon:uT,color:"text-blue-500"},n=r.Icon;return p.jsx("div",{className:`p-3 rounded-lg ${r.bg} border-l-2 ${r.border}`,children:p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsx(n,{size:16,className:r.color}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[p.jsx("span",{className:"text-sm font-medium text-slate-200",children:e.event_type}),p.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${r.bg} ${r.color}`,children:e.severity})]}),p.jsx("div",{className:"text-sm text-slate-300",children:e.headline})]})]})})}function bae({value:e,onChange:t,disabled:r,centralDisabled:n}){const i="px-2 py-1 text-xs transition-colors";return p.jsxs("div",{className:`flex rounded border border-[#1e2a3a] overflow-hidden ${r?"opacity-40":""}`,children:[p.jsx("button",{type:"button",disabled:r,onClick:()=>t("native"),className:`${i} ${e==="native"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:"native"}),p.jsx("button",{type:"button",disabled:r||n,title:n?"Central not available for this adapter":"",onClick:()=>{n||t("central")},className:`${i} ${n?"text-slate-600 cursor-not-allowed":e==="central"?"bg-accent text-white":"text-slate-400 hover:text-slate-200"}`,children:"central"})]})}function uet({title:e,subtitle:t,enabled:r,onEnabled:n,feedSource:i,onFeedSource:a,hasCentral:o,nativeOnly:s,hasKey:l,health:u,events:c,children:f}){const h=s||!o;return p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("span",{className:"text-sm font-medium text-slate-300",children:e}),t&&p.jsx("p",{className:"text-xs text-slate-600",children:t})]}),p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("span",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"source"}),p.jsx(bae,{value:i,onChange:a,disabled:!r,centralDisabled:h})]}),p.jsx(kr,{label:"",checked:r,onChange:n})]})]}),!l&&p.jsx("div",{className:"text-xs text-amber-400 bg-amber-500/10 rounded p-2",children:"API key not configured — contact admin"}),s&&p.jsx("div",{className:"text-[11px] text-slate-600",children:"Central not available for this adapter — native only"}),p.jsx("div",{className:r?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:f}),(u||c&&c.length>0)&&p.jsxs("div",{className:"pt-2 border-t border-[#1e2a3a] space-y-3",children:[p.jsx("div",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"Live status"}),u?p.jsx(oet,{feed:u}):p.jsx("div",{className:"text-xs text-slate-600",children:"No status reported."}),c&&c.length>0&&p.jsx("div",{className:"space-y-2",children:c.slice(0,5).map((d,v)=>p.jsx(set,{event:d},v))})]})]})}const Nl={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}},KP=[{key:"central",label:"Central",icon:Tce,adapters:[]},{key:"weather",label:"Weather",icon:Pu,adapters:["nws"]},{key:"fire",label:"Fire",icon:lT,adapters:["fires","firms"]},{key:"rf",label:"RF Propagation",icon:ho,adapters:["swpc","ducting"]},{key:"roads",label:"Roads",icon:oT,adapters:["traffic","roads511","wzdx"]},{key:"geohazards",label:"Geohazards",icon:cT,adapters:["usgs_quake","usgs","avalanche"]},{key:"tracking",label:"Tracking",icon:hT,adapters:[]},{key:"mesh",label:"Mesh Health",icon:zv,adapters:[]}];function cet(){var Mp,nx;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,f]=G.useState(!1),[h,d]=G.useState(null),[v,m]=G.useState(null),[y,x]=G.useState(!1),[_,b]=G.useState("weather"),[S,T]=G.useState("nws"),[C,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(""),[k,E]=G.useState({digest_enabled:!0,digest_schedule:["06:00","18:00"],digest_timezone:"America/Boise"}),[N,D]=G.useState(""),[z,V]=G.useState({min_magnitude:4,drop_non_present:!0,drop_zero_magnitude:!0}),[F,$]=G.useState(""),[B,H]=G.useState({min_severity:"None",enabled_categories:["incident","closure"],enabled_sub_types:["accident","road_closed","closure","lane_closed","vehicle_on_fire","flooding","debris"]}),[U,Z]=G.useState(""),[Y,K]=G.useState({broadcast:!1,min_severity:"Minor",sub_types:["road_works","lane_closed","road_closed"]}),[te,ce]=G.useState(""),[de,Ie]=G.useState({broadcast_severities:["Extreme","Severe"],duplicate_allowed_after_seconds:3600}),[ye,ne]=G.useState(""),[ve,ue]=G.useState({min_danger_level:3}),[ee,Ge]=G.useState("");G.useEffect(()=>{document.title="Environment — MeshAI",(async()=>{var Te,fr,Mi,Pi,Qi,wl,ae,Et,Tt,wt,Or,gs,ms,ix,ax,ox,sx,ki,He,Pp;try{const kp=await(await fetch("/api/config/environmental")).json();t(kp),n(JSON.stringify(kp));try{const hr=await fetch("/api/adapter-config/wfigs");if(hr.ok){const $t=await hr.json(),dr={allowed_incident_types:((Te=$t.allowed_incident_types)==null?void 0:Te.value)??["WF"],freshness_seconds:((fr=$t.freshness_seconds)==null?void 0:fr.value)??0,cooldown_seconds:((Mi=$t.cooldown_seconds)==null?void 0:Mi.value)??28800,broadcast_on_acres:((Pi=$t.broadcast_on_acres)==null?void 0:Pi.value)??!0,broadcast_on_contained:((Qi=$t.broadcast_on_contained)==null?void 0:Qi.value)??!0};A(dr),I(JSON.stringify(dr))}}catch{}try{const hr=await fetch("/api/adapter-config/fires");if(hr.ok){const $t=await hr.json(),dr={digest_enabled:((wl=$t.digest_enabled)==null?void 0:wl.value)??!0,digest_schedule:((ae=$t.digest_schedule)==null?void 0:ae.value)??["06:00","18:00"],digest_timezone:((Et=$t.digest_timezone)==null?void 0:Et.value)??"America/Boise"};E(dr),D(JSON.stringify(dr))}}catch{}try{const hr=await fetch("/api/adapter-config/tomtom_incidents");if(hr.ok){const $t=await hr.json(),dr={min_magnitude:((Tt=$t.min_magnitude)==null?void 0:Tt.value)??4,drop_non_present:((wt=$t.drop_non_present)==null?void 0:wt.value)??!0,drop_zero_magnitude:((Or=$t.drop_zero_magnitude)==null?void 0:Or.value)??!0};V(dr),$(JSON.stringify(dr))}}catch{}try{const hr=await fetch("/api/adapter-config/itd_511");if(hr.ok){const $t=await hr.json(),dr={min_severity:((gs=$t.min_severity)==null?void 0:gs.value)??"None",enabled_categories:((ms=$t.enabled_categories)==null?void 0:ms.value)??["incident","closure"],enabled_sub_types:((ix=$t.enabled_sub_types)==null?void 0:ix.value)??["accident","road_closed","closure","lane_closed","vehicle_on_fire","flooding","debris"]};H(dr),Z(JSON.stringify(dr))}}catch{}try{const hr=await fetch("/api/adapter-config/wzdx");if(hr.ok){const $t=await hr.json(),dr={broadcast:((ax=$t.broadcast)==null?void 0:ax.value)??!1,min_severity:((ox=$t.min_severity)==null?void 0:ox.value)??"Minor",sub_types:((sx=$t.sub_types)==null?void 0:sx.value)??["road_works","lane_closed","road_closed"]};K(dr),ce(JSON.stringify(dr))}}catch{}try{const hr=await fetch("/api/adapter-config/nws");if(hr.ok){const $t=await hr.json(),dr={broadcast_severities:((ki=$t.broadcast_severities)==null?void 0:ki.value)??["Extreme","Severe"],duplicate_allowed_after_seconds:((He=$t.duplicate_allowed_after_seconds)==null?void 0:He.value)??3600};Ie(dr),ne(JSON.stringify(dr))}}catch{}try{const hr=await fetch("/api/adapter-config/avalanche");if(hr.ok){const dr={min_danger_level:((Pp=(await hr.json()).min_danger_level)==null?void 0:Pp.value)??3};ue(dr),Ge(JSON.stringify(dr))}}catch{}}catch(lh){d(lh instanceof Error?lh.message:"Failed to load config")}finally{u(!1)}})()},[]),G.useEffect(()=>{const Te=async()=>{try{a(await cY()),s(await fY())}catch{}};Te();const fr=setInterval(Te,3e4);return()=>clearInterval(fr)},[]);const Ae=e!==null&&JSON.stringify(e)!==r,We=JSON.stringify(C)!==P,Ye=JSON.stringify(k)!==N,ht=JSON.stringify(z)!==F,Rt=JSON.stringify(B)!==U,Jt=JSON.stringify(Y)!==te,cn=JSON.stringify(de)!==ye,Ir=JSON.stringify(ve)!==ee,Rn=Ae||We||Ye||ht||Rt||Jt||cn||Ir,qt=async(Te,fr,Mi)=>{const Pi=await fetch(`/api/adapter-config/${Te}/${fr}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:Mi})});if(!Pi.ok){const Qi=await Pi.json().catch(()=>({}));throw new Error(Qi.detail||`Failed to save ${Te}.${fr}`)}},ah=async()=>{if(e){f(!0),d(null),m(null);try{if(Ae){const Te=await fetch("/api/config/environmental",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),fr=await Te.json();if(!Te.ok)throw new Error(fr.detail||"Save failed");n(JSON.stringify(e)),fr.restart_required&&x(!0)}if(We){const Te=JSON.parse(P);C.freshness_seconds!==Te.freshness_seconds&&await qt("wfigs","freshness_seconds",C.freshness_seconds),JSON.stringify(C.allowed_incident_types)!==JSON.stringify(Te.allowed_incident_types)&&await qt("wfigs","allowed_incident_types",C.allowed_incident_types),C.cooldown_seconds!==Te.cooldown_seconds&&await qt("wfigs","cooldown_seconds",C.cooldown_seconds),C.broadcast_on_acres!==Te.broadcast_on_acres&&await qt("wfigs","broadcast_on_acres",C.broadcast_on_acres),C.broadcast_on_contained!==Te.broadcast_on_contained&&await qt("wfigs","broadcast_on_contained",C.broadcast_on_contained),I(JSON.stringify(C))}if(Ye){const Te=JSON.parse(N);k.digest_enabled!==Te.digest_enabled&&await qt("fires","digest_enabled",k.digest_enabled),JSON.stringify(k.digest_schedule)!==JSON.stringify(Te.digest_schedule)&&await qt("fires","digest_schedule",k.digest_schedule),k.digest_timezone!==Te.digest_timezone&&await qt("fires","digest_timezone",k.digest_timezone),D(JSON.stringify(k))}if(ht){const Te=JSON.parse(F);z.min_magnitude!==Te.min_magnitude&&await qt("tomtom_incidents","min_magnitude",z.min_magnitude),z.drop_non_present!==Te.drop_non_present&&await qt("tomtom_incidents","drop_non_present",z.drop_non_present),z.drop_zero_magnitude!==Te.drop_zero_magnitude&&await qt("tomtom_incidents","drop_zero_magnitude",z.drop_zero_magnitude),$(JSON.stringify(z))}if(Rt){const Te=JSON.parse(U);B.min_severity!==Te.min_severity&&await qt("itd_511","min_severity",B.min_severity),JSON.stringify(B.enabled_categories)!==JSON.stringify(Te.enabled_categories)&&await qt("itd_511","enabled_categories",B.enabled_categories),JSON.stringify(B.enabled_sub_types)!==JSON.stringify(Te.enabled_sub_types)&&await qt("itd_511","enabled_sub_types",B.enabled_sub_types),Z(JSON.stringify(B))}if(Jt){const Te=JSON.parse(te);Y.broadcast!==Te.broadcast&&await qt("wzdx","broadcast",Y.broadcast),Y.min_severity!==Te.min_severity&&await qt("wzdx","min_severity",Y.min_severity),JSON.stringify(Y.sub_types)!==JSON.stringify(Te.sub_types)&&await qt("wzdx","sub_types",Y.sub_types),ce(JSON.stringify(Y))}if(cn){const Te=JSON.parse(ye);JSON.stringify(de.broadcast_severities)!==JSON.stringify(Te.broadcast_severities)&&await qt("nws","broadcast_severities",de.broadcast_severities),de.duplicate_allowed_after_seconds!==Te.duplicate_allowed_after_seconds&&await qt("nws","duplicate_allowed_after_seconds",de.duplicate_allowed_after_seconds),ne(JSON.stringify(de))}if(Ir){const Te=JSON.parse(ee);ve.min_danger_level!==Te.min_danger_level&&await qt("avalanche","min_danger_level",ve.min_danger_level),Ge(JSON.stringify(ve))}m("Config saved"),setTimeout(()=>m(null),3e3)}catch(Te){d(Te instanceof Error?Te.message:"Save failed")}finally{f(!1)}}},oh=()=>{e&&t(JSON.parse(r)),A(JSON.parse(P||JSON.stringify(C))),E(JSON.parse(N||JSON.stringify(k))),V(JSON.parse(F||JSON.stringify(z))),H(JSON.parse(U||JSON.stringify(B))),K(JSON.parse(te||JSON.stringify(Y))),Ie(JSON.parse(ye||JSON.stringify(de))),ue(JSON.parse(ee||JSON.stringify(ve)))},Cp=async()=>{try{await fetch("/api/restart",{method:"POST"}),x(!1),m("Restart initiated")}catch{d("Restart failed")}},Je=Te=>e&&t({...e,...Te});if(l)return p.jsx("div",{className:"flex items-center justify-center h-64 text-slate-400",children:"Loading environmental config…"});if(!e)return p.jsx("div",{className:"flex items-center justify-center h-64 text-red-400",children:h||"No config"});const rx=Te=>i==null?void 0:i.feeds.find(fr=>fr.source===Nl[Te].health),ZC=Te=>o.filter(fr=>fr.source===Nl[Te].health),ps=KP.find(Te=>Te.key===_),wn=ps.adapters.length===0?null:S&&ps.adapters.includes(S)?S:ps.adapters[0],YC=Te=>{var fr,Mi,Pi,Qi,wl;switch(Te){case"nws":return p.jsxs(p.Fragment,{children:[p.jsx(Gc,{label:"NWS Zones",value:e.nws_zones,onChange:ae=>Je({nws_zones:ae}),helper:"Zone IDs like IDZ016, IDZ030",infoLink:"https://www.weather.gov/pimar/PubZone"}),e.nws.feed_source!=="central"&&p.jsxs(p.Fragment,{children:[p.jsx(xt,{label:"User Agent",value:e.nws.user_agent,onChange:ae=>Je({nws:{...e.nws,user_agent:ae}}),placeholder:"(MeshAI, you@email.com)",helper:"Format: (app_name, contact_email)"}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{label:"Tick Seconds",value:e.nws.tick_seconds,onChange:ae=>Je({nws:{...e.nws,tick_seconds:ae}}),min:30}),p.jsx(to,{label:"Min Severity",value:e.nws.severity_min,onChange:ae=>Je({nws:{...e.nws,severity_min:ae}}),options:[{value:"minor",label:"Minor"},{value:"moderate",label:"Moderate"},{value:"severe",label:"Severe"},{value:"extreme",label:"Extreme"}]})]})]}),e.nws.feed_source==="central"&&p.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Filters"}),p.jsxs("div",{className:"mb-3",children:[p.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Severities to broadcast"}),p.jsx("div",{className:"flex gap-6",children:["Extreme","Severe","Moderate","Minor"].map(ae=>p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:de.broadcast_severities.includes(ae),onChange:Et=>{const Tt=de.broadcast_severities;Ie({...de,broadcast_severities:Et.target.checked?[...Tt,ae]:Tt.filter(wt=>wt!==ae)})},className:"w-4 h-4 rounded accent-blue-500"}),p.jsx("span",{className:"text-sm text-slate-300",children:ae})]},ae))})]}),p.jsx(Xe,{label:"Re-broadcast Cooldown (seconds)",value:de.duplicate_allowed_after_seconds,onChange:ae=>Ie({...de,duplicate_allowed_after_seconds:ae}),min:0,helper:"Minimum seconds before the same alert ID can be re-broadcast"})]})]});case"swpc":return p.jsx("div",{className:"text-xs text-slate-500",children:"No additional settings."});case"ducting":return p.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[p.jsx(Xe,{label:"Tick Seconds",value:e.ducting.tick_seconds,onChange:ae=>Je({ducting:{...e.ducting,tick_seconds:ae}}),min:60}),p.jsx(Xe,{label:"Latitude",value:e.ducting.latitude,onChange:ae=>Je({ducting:{...e.ducting,latitude:ae}}),step:.01}),p.jsx(Xe,{label:"Longitude",value:e.ducting.longitude,onChange:ae=>Je({ducting:{...e.ducting,longitude:ae}}),step:.01})]});case"fires":return p.jsxs("div",{className:"space-y-6",children:[e.fires.feed_source!=="central"&&p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{label:"Tick Seconds",value:e.fires.tick_seconds,onChange:ae=>Je({fires:{...e.fires,tick_seconds:ae}}),min:60}),p.jsx(to,{label:"State",value:e.fires.state,onChange:ae=>Je({fires:{...e.fires,state:ae}}),options:FQe})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Incident Types"}),p.jsx("div",{className:"flex gap-6",children:[["WF","Wildfire"],["RX","Prescribed Burn"],["OTHER","Other"]].map(([ae,Et])=>{var Tt;return p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:((Tt=C.allowed_incident_types)==null?void 0:Tt.includes(ae))??ae==="WF",onChange:wt=>{const Or=C.allowed_incident_types??["WF"];A({...C,allowed_incident_types:wt.target.checked?[...Or,ae]:Or.filter(gs=>gs!==ae)})},className:"w-4 h-4 rounded accent-blue-500"}),p.jsx("span",{className:"text-sm text-slate-300",children:Et})]},ae)})})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Triggers"}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("label",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-sm text-slate-300",children:"Broadcast on acres increase"}),p.jsx("input",{type:"checkbox",checked:C.broadcast_on_acres,onChange:ae=>A({...C,broadcast_on_acres:ae.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]}),p.jsxs("label",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-sm text-slate-300",children:"Broadcast on containment increase"}),p.jsx("input",{type:"checkbox",checked:C.broadcast_on_contained,onChange:ae=>A({...C,broadcast_on_contained:ae.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]})]})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{label:"Update Cooldown (hours)",value:Math.round(C.cooldown_seconds/3600),onChange:ae=>A({...C,cooldown_seconds:ae*3600}),min:0,helper:"Minimum hours between updates for the same fire"}),p.jsx(Xe,{label:"Freshness Window (hours)",value:Math.round(C.freshness_seconds/3600),onChange:ae=>A({...C,freshness_seconds:ae*3600}),min:0,helper:"0 = always broadcast regardless of event age"})]})]});case"avalanche":return p.jsxs("div",{className:"space-y-6",children:[e.avalanche.feed_source!=="central"&&p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{label:"Tick Seconds",value:e.avalanche.tick_seconds,onChange:ae=>Je({avalanche:{...e.avalanche,tick_seconds:ae}}),min:60}),p.jsx(GQe,{label:"Season Months",value:e.avalanche.season_months,onChange:ae=>Je({avalanche:{...e.avalanche,season_months:ae}}),helper:"e.g., 12, 1, 2, 3, 4"})]}),p.jsx(Gc,{label:"Center IDs",value:e.avalanche.center_ids,onChange:ae=>Je({avalanche:{...e.avalanche,center_ids:ae}}),helper:"e.g., SNFAC",infoLink:"https://avalanche.org/avalanche-centers/"}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Settings"}),p.jsx("div",{className:"grid grid-cols-2 gap-4",children:p.jsx(to,{label:"Min Danger Level",value:String(ve.min_danger_level),onChange:ae=>ue({...ve,min_danger_level:Number(ae)}),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 p.jsxs(p.Fragment,{children:[p.jsx(Xe,{label:"Tick Seconds",value:e.usgs.tick_seconds,onChange:ae=>Je({usgs:{...e.usgs,tick_seconds:ae}}),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."}),p.jsx(Gc,{label:"Site IDs",value:e.usgs.sites,onChange:ae=>Je({usgs:{...e.usgs,sites:ae}}),helper:"USGS gauge site numbers",infoLink:"https://waterdata.usgs.gov/nwis"})]});case"usgs_quake":return p.jsxs("div",{className:"space-y-6",children:[e.usgs_quake.feed_source!=="central"&&p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{label:"Tick Seconds",value:e.usgs_quake.tick_seconds,onChange:ae=>Je({usgs_quake:{...e.usgs_quake,tick_seconds:ae}}),min:60}),p.jsx(xt,{label:"Region Tag",value:e.usgs_quake.region,onChange:ae=>Je({usgs_quake:{...e.usgs_quake,region:ae}})})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Magnitude Thresholds"}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Xe,{label:"Global Floor",value:e.usgs_quake.global_mag_floor,onChange:ae=>Je({usgs_quake:{...e.usgs_quake,global_mag_floor:ae}}),step:.1,min:0,helper:"Broadcast anywhere at or above this magnitude"}),p.jsx(Xe,{label:"Regional Floor",value:e.usgs_quake.regional_mag_floor,onChange:ae=>Je({usgs_quake:{...e.usgs_quake,regional_mag_floor:ae}}),step:.1,min:0,helper:"Reduced floor within regional radius"}),p.jsx(Xe,{label:"Regional Radius (mi)",value:e.usgs_quake.regional_radius_mi,onChange:ae=>Je({usgs_quake:{...e.usgs_quake,regional_radius_mi:ae}}),min:50,helper:"Radius around region centroid for reduced floor"}),p.jsx(Xe,{label:"Escalation Floor",value:e.usgs_quake.escalate_mag_floor,onChange:ae=>Je({usgs_quake:{...e.usgs_quake,escalate_mag_floor:ae}}),step:.1,min:0,helper:"Magnitude at which broadcast uses warning emoji"})]})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"PAGER Alert Levels"}),p.jsx("div",{className:"text-xs text-slate-500 mb-2",children:"Broadcast at any magnitude when USGS PAGER alert reaches these levels"}),p.jsx("div",{className:"flex gap-6",children:["green","yellow","orange","red"].map(ae=>p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:(e.usgs_quake.broadcast_pager_alerts??[]).includes(ae),onChange:Et=>{const Tt=e.usgs_quake.broadcast_pager_alerts??[];Je({usgs_quake:{...e.usgs_quake,broadcast_pager_alerts:Et.target.checked?[...Tt,ae]:Tt.filter(wt=>wt!==ae)}})},className:"w-4 h-4 rounded accent-blue-500"}),p.jsx("span",{className:"text-sm text-slate-300 capitalize",children:ae})]},ae))})]})]});case"traffic":return p.jsxs(p.Fragment,{children:[p.jsx(xt,{label:"API Key",value:e.traffic.api_key,onChange:ae=>Je({traffic:{...e.traffic,api_key:ae}}),type:"password",helper:"developer.tomtom.com"}),p.jsx(Xe,{label:"Tick Seconds",value:e.traffic.tick_seconds,onChange:ae=>Je({traffic:{...e.traffic,tick_seconds:ae}}),min:60}),p.jsx("div",{className:"text-xs text-slate-500 mt-2",children:"Corridors:"}),(e.traffic.corridors||[]).map((ae,Et)=>p.jsxs("div",{className:"grid grid-cols-4 gap-2 items-end",children:[p.jsx(xt,{label:"Name",value:ae.name,onChange:Tt=>{const wt=[...e.traffic.corridors];wt[Et]={...ae,name:Tt},Je({traffic:{...e.traffic,corridors:wt}})}}),p.jsx(Xe,{label:"Lat",value:ae.lat,onChange:Tt=>{const wt=[...e.traffic.corridors];wt[Et]={...ae,lat:Tt},Je({traffic:{...e.traffic,corridors:wt}})},step:.01}),p.jsx(Xe,{label:"Lon",value:ae.lon,onChange:Tt=>{const wt=[...e.traffic.corridors];wt[Et]={...ae,lon:Tt},Je({traffic:{...e.traffic,corridors:wt}})},step:.01}),p.jsx("button",{onClick:()=>Je({traffic:{...e.traffic,corridors:e.traffic.corridors.filter((Tt,wt)=>wt!==Et)}}),className:"px-2 py-2 text-xs text-red-400 hover:text-red-300 border border-red-400/30 rounded",children:"Remove"})]},Et)),p.jsx("button",{onClick:()=>Je({traffic:{...e.traffic,corridors:[...e.traffic.corridors||[],{name:"",lat:0,lon:0}]}}),className:"text-xs text-accent hover:underline",children:"+ Add Corridor"}),p.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Filters"}),p.jsx("div",{className:"grid grid-cols-2 gap-4",children:p.jsxs("div",{children:[p.jsx("label",{className:"text-xs text-slate-400 mb-1 block",children:"Minimum Magnitude"}),p.jsxs("select",{value:z.min_magnitude,onChange:ae=>V({...z,min_magnitude:parseInt(ae.target.value)}),className:"w-full bg-slate-900 border border-slate-700 rounded px-3 py-2 text-sm",children:[p.jsx("option",{value:1,children:"1 — Minor (all)"}),p.jsx("option",{value:2,children:"2 — Moderate (yellow+)"}),p.jsx("option",{value:3,children:"3 — Major (orange+)"}),p.jsx("option",{value:4,children:"4 — Severe (red only)"})]}),p.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Drop TomTom incidents below this severity level"})]})}),p.jsxs("div",{className:"mt-3 space-y-2",children:[p.jsxs("label",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-sm text-slate-300",children:"Drop non-present time validity"}),p.jsx("input",{type:"checkbox",checked:z.drop_non_present,onChange:ae=>V({...z,drop_non_present:ae.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]}),p.jsxs("label",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-sm text-slate-300",children:"Drop zero-magnitude events"}),p.jsx("input",{type:"checkbox",checked:z.drop_zero_magnitude,onChange:ae=>V({...z,drop_zero_magnitude:ae.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]})]})]})]});case"roads511":return p.jsxs(p.Fragment,{children:[p.jsx(xt,{label:"Base URL",value:e.roads511.base_url,onChange:ae=>Je({roads511:{...e.roads511,base_url:ae}}),placeholder:"https://511.yourstate.gov/api/v2"}),p.jsx(xt,{label:"API Key",value:e.roads511.api_key,onChange:ae=>Je({roads511:{...e.roads511,api_key:ae}}),type:"password",helper:"Leave empty if not required"}),p.jsx(Xe,{label:"Tick Seconds",value:e.roads511.tick_seconds,onChange:ae=>Je({roads511:{...e.roads511,tick_seconds:ae}}),min:60}),p.jsx(Gc,{label:"Endpoints",value:e.roads511.endpoints,onChange:ae=>Je({roads511:{...e.roads511,endpoints:ae}}),helper:"e.g., /get/event"}),p.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((ae,Et)=>{var Tt;return p.jsx(Xe,{label:ae,value:((Tt=e.roads511.bbox)==null?void 0:Tt[Et])??0,onChange:wt=>{const Or=[...e.roads511.bbox||[0,0,0,0]];Or[Et]=wt,Je({roads511:{...e.roads511,bbox:Or}})},step:.01},ae)})}),p.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Filters"}),p.jsx("div",{className:"grid grid-cols-2 gap-4",children:p.jsxs("div",{children:[p.jsx("label",{className:"text-xs text-slate-400 mb-1 block",children:"Minimum Severity"}),p.jsxs("select",{value:B.min_severity,onChange:ae=>H({...B,min_severity:ae.target.value}),className:"w-full bg-slate-900 border border-slate-700 rounded px-3 py-2 text-sm",children:[p.jsx("option",{value:"None",children:"None (all)"}),p.jsx("option",{value:"Minor",children:"Minor+"}),p.jsx("option",{value:"Major",children:"Major only"})]}),p.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Drop ITD 511 events below this severity"})]})}),p.jsxs("div",{className:"mt-4",children:[p.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Categories"}),p.jsx("div",{className:"flex gap-6",children:[["incident","Incident"],["closure","Closure"],["special_event","Special Event"]].map(([ae,Et])=>p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:B.enabled_categories.includes(ae),onChange:Tt=>{const wt=B.enabled_categories;H({...B,enabled_categories:Tt.target.checked?[...wt,ae]:wt.filter(Or=>Or!==ae)})},className:"w-4 h-4 rounded accent-blue-500"}),p.jsx("span",{className:"text-sm text-slate-300",children:Et})]},ae))})]}),p.jsxs("div",{className:"mt-4",children:[p.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Sub-types"}),p.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(([ae,Et])=>p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:B.enabled_sub_types.includes(ae),onChange:Tt=>{const wt=B.enabled_sub_types;H({...B,enabled_sub_types:Tt.target.checked?[...wt,ae]:wt.filter(Or=>Or!==ae)})},className:"w-4 h-4 rounded accent-blue-500"}),p.jsx("span",{className:"text-sm text-slate-300",children:Et})]},ae))})]})]})]});case"wzdx":return p.jsxs(p.Fragment,{children:[((fr=e.wzdx)==null?void 0:fr.feed_source)!=="central"&&p.jsxs(p.Fragment,{children:[p.jsx(xt,{label:"Base URL",value:((Mi=e.wzdx)==null?void 0:Mi.base_url)??"",onChange:ae=>Je({wzdx:{...e.wzdx,base_url:ae}}),placeholder:"https://511.yourstate.gov/api/v2"}),p.jsx(xt,{label:"API Key",value:((Pi=e.wzdx)==null?void 0:Pi.api_key)??"",onChange:ae=>Je({wzdx:{...e.wzdx,api_key:ae}}),type:"password",helper:"Leave empty if not required"}),p.jsx(Xe,{label:"Tick Seconds",value:((Qi=e.wzdx)==null?void 0:Qi.tick_seconds)??300,onChange:ae=>Je({wzdx:{...e.wzdx,tick_seconds:ae}}),min:60}),p.jsx(Gc,{label:"Endpoints",value:((wl=e.wzdx)==null?void 0:wl.endpoints)??["/get/event"],onChange:ae=>Je({wzdx:{...e.wzdx,endpoints:ae}}),helper:"e.g., /get/event"}),p.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((ae,Et)=>{var Tt,wt;return p.jsx(Xe,{label:ae,value:((wt=(Tt=e.wzdx)==null?void 0:Tt.bbox)==null?void 0:wt[Et])??0,onChange:Or=>{var ms;const gs=[...((ms=e.wzdx)==null?void 0:ms.bbox)||[0,0,0,0]];gs[Et]=Or,Je({wzdx:{...e.wzdx,bbox:gs}})},step:.01},ae)})}),p.jsx("div",{className:"text-xs text-slate-500",children:"Bounding box [W,S,E,N] geographic filter"})]}),p.jsxs("div",{className:"border-t border-slate-700/50 pt-4 mt-4",children:[p.jsx("div",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Broadcast Settings"}),p.jsxs("label",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-sm text-slate-300",children:"Broadcast work zone events"}),p.jsx("input",{type:"checkbox",checked:Y.broadcast,onChange:ae=>K({...Y,broadcast:ae.target.checked}),className:"w-4 h-4 rounded accent-blue-500"})]}),Y.broadcast?p.jsxs("div",{className:"space-y-3 mt-3",children:[p.jsxs("div",{children:[p.jsx("label",{className:"text-xs text-slate-400 mb-1 block",children:"Min Severity"}),p.jsxs("select",{value:Y.min_severity,onChange:ae=>K({...Y,min_severity:ae.target.value}),className:"w-full bg-slate-900 border border-slate-700 rounded px-3 py-2 text-sm",children:[p.jsx("option",{value:"None",children:"None (all)"}),p.jsx("option",{value:"Minor",children:"Minor+"}),p.jsx("option",{value:"Major",children:"Major only"})]})]}),p.jsxs("div",{children:[p.jsx("div",{className:"text-xs text-slate-400 mb-2",children:"Sub-types"}),p.jsx("div",{className:"flex gap-6",children:[["road_works","Road Works"],["lane_closed","Lane Closure"],["road_closed","Road Closed"]].map(([ae,Et])=>p.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[p.jsx("input",{type:"checkbox",checked:Y.sub_types.includes(ae),onChange:Tt=>{const wt=Y.sub_types;K({...Y,sub_types:Tt.target.checked?[...wt,ae]:wt.filter(Or=>Or!==ae)})},className:"w-4 h-4 rounded accent-blue-500"}),p.jsx("span",{className:"text-sm text-slate-300",children:Et})]},ae))})]})]}):p.jsxs("p",{className:"text-xs text-slate-500 mt-2",children:["Work zone events stored for LLM context only ","—"," no mesh broadcasts."]})]})]});case"firms":return p.jsxs(p.Fragment,{children:[p.jsx(xt,{label:"MAP Key",value:e.firms.map_key,onChange:ae=>Je({firms:{...e.firms,map_key:ae}}),type:"password",helper:"firms.modaps.eosdis.nasa.gov/api/area/",infoLink:"https://firms.modaps.eosdis.nasa.gov/api/area/"}),p.jsx(Xe,{label:"Tick Seconds",value:e.firms.tick_seconds,onChange:ae=>Je({firms:{...e.firms,tick_seconds:ae}}),min:300}),p.jsx(to,{label:"Satellite Source",value:e.firms.source,onChange:ae=>Je({firms:{...e.firms,source:ae}}),options:[{value:"VIIRS_SNPP_NRT",label:"VIIRS SNPP (NRT)"},{value:"VIIRS_NOAA20_NRT",label:"VIIRS NOAA-20 (NRT)"},{value:"MODIS_NRT",label:"MODIS (NRT)"}]}),p.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[p.jsx(Xe,{label:"Day Range",value:e.firms.day_range,onChange:ae=>Je({firms:{...e.firms,day_range:ae}}),min:1,max:10}),p.jsx(to,{label:"Min Confidence",value:e.firms.confidence_min,onChange:ae=>Je({firms:{...e.firms,confidence_min:ae}}),options:[{value:"low",label:"Low"},{value:"nominal",label:"Nominal"},{value:"high",label:"High"}]}),p.jsx(Xe,{label:"Proximity (km)",value:e.firms.proximity_km,onChange:ae=>Je({firms:{...e.firms,proximity_km:ae}}),step:.5})]}),p.jsx("div",{className:"grid grid-cols-4 gap-2",children:["West","South","East","North"].map((ae,Et)=>{var Tt;return p.jsx(Xe,{label:ae,value:((Tt=e.firms.bbox)==null?void 0:Tt[Et])??0,onChange:wt=>{const Or=[...e.firms.bbox||[0,0,0,0]];Or[Et]=wt,Je({firms:{...e.firms,bbox:Or}})},step:.01},ae)})})]})}},Ap=e,sh=(Te,fr)=>{const Mi=e[Te]||{};Je({[Te]:{...Mi,...fr}})};return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h1",{className:"text-xl font-semibold text-slate-200",children:"Environment"}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx(kr,{label:"Feeds Enabled",checked:e.enabled,onChange:Te=>Je({enabled:Te})}),Rn&&p.jsxs(p.Fragment,{children:[p.jsxs("button",{onClick:oh,className:"flex items-center gap-1 px-3 py-1.5 text-sm text-slate-400 hover:text-slate-200 border border-border rounded",children:[p.jsx(fT,{size:14})," Discard"]}),p.jsxs("button",{onClick:ah,disabled:c,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-accent text-white rounded disabled:opacity-50",children:[p.jsx(zN,{size:14})," ",c?"Saving…":"Save"]})]})]})]}),h&&p.jsx("div",{className:"text-sm text-red-400 bg-red-500/10 rounded p-3",children:h}),v&&p.jsx("div",{className:"text-sm text-green-400 bg-green-500/10 rounded p-3",children:v}),y&&p.jsxs("div",{className:"flex items-center justify-between text-sm text-amber-400 bg-amber-500/10 border border-amber-500/30 rounded p-3",children:[p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(ty,{size:14})," A restart is required for some changes to take effect."]}),p.jsx("button",{onClick:Cp,className:"px-3 py-1 bg-amber-500/20 hover:bg-amber-500/30 rounded",children:"Restart now"})]}),p.jsx("div",{className:"flex gap-1 border-b border-border overflow-x-auto",children:KP.map(({key:Te,label:fr,icon:Mi})=>p.jsxs("button",{onClick:()=>{b(Te);const Pi=KP.find(Qi=>Qi.key===Te);T(Pi.adapters[0]??null)},className:`flex items-center gap-2 px-4 py-2 text-sm whitespace-nowrap border-b-2 -mb-px transition-colors ${_===Te?"border-accent text-accent":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[p.jsx(Mi,{size:15})," ",fr]},Te))}),_==="central"&&e.central&&p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Central Connection"}),p.jsx("p",{className:"text-xs text-slate-600",children:'NATS JetStream source for any adapter set to "central"'})]}),p.jsx(kr,{label:"",checked:!!e.central.enabled,onChange:Te=>Je({central:{...e.central,enabled:Te}})})]}),p.jsxs("div",{className:e.central.enabled?"space-y-3":"space-y-3 opacity-40 pointer-events-none select-none",children:[p.jsx(xt,{label:"URL",value:e.central.url||"",onChange:Te=>Je({central:{...e.central,url:Te}}),placeholder:"nats://central.echo6.mesh:4222"}),p.jsx(xt,{label:"Durable",value:e.central.durable||"",onChange:Te=>Je({central:{...e.central,durable:Te}}),placeholder:"meshai-v04"}),p.jsx(xt,{label:"Region",value:e.central.region||"",onChange:Te=>Je({central:{...e.central,region:Te}}),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"&&p.jsxs("div",{className:"flex flex-col items-center justify-center h-[40vh] text-center",children:[p.jsx(hT,{size:32,className:"text-slate-600 mb-4"}),p.jsx("p",{className:"text-slate-500 max-w-md",children:"No adapters yet. ADS-B / AIS / satellite passes are planned for v0.5."})]}),_==="mesh"&&p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-4 space-y-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{children:[p.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Mesh Health"}),p.jsx("p",{className:"text-xs text-slate-600",children:"Node/infra telemetry — sourced from the mesh, not an environmental feed."})]}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("span",{className:"text-[10px] uppercase tracking-wide text-slate-600",children:"source"}),p.jsx(bae,{value:"native",onChange:()=>{},disabled:!1,centralDisabled:!0})]})]}),p.jsx("div",{className:"text-[11px] text-slate-600",children:"Central not available — reserved for a future migration."})]}),ps.adapters.length>0&&wn&&p.jsxs(p.Fragment,{children:[ps.adapters.length>1&&p.jsx("div",{className:"flex gap-1",children:ps.adapters.map(Te=>p.jsx("button",{onClick:()=>T(Te),className:`px-3 py-1.5 text-sm rounded ${wn===Te?"bg-bg-hover text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:Nl[Te].label},Te))}),p.jsx(uet,{title:Nl[wn].label,subtitle:Nl[wn].subtitle,enabled:((Mp=Ap[wn])==null?void 0:Mp.enabled)??!1,onEnabled:Te=>sh(wn,{enabled:Te}),feedSource:((nx=Ap[wn])==null?void 0:nx.feed_source)??"native",onFeedSource:Te=>sh(wn,{feed_source:Te}),hasCentral:Nl[wn].hasCentral,nativeOnly:Nl[wn].nativeOnly,hasKey:Nl[wn].hasKey,health:rx(wn),events:ZC(wn),children:YC(wn)})]})]})}const x7={infra_offline:lY,infra_recovery:vT,battery_warning:ZA,battery_critical:ZA,battery_emergency:ZA,hf_blackout:ry,uhf_ducting:ho,weather_warning:Pu,weather_watch:Pu,new_router:ho,packet_flood:nl,sustained_high_util:nl,region_blackout:Mu,default:ey};function fet(e){return x7[e]||x7.default}function wae(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-blue-500/10",border:"border-blue-500",badge:"bg-blue-500/20 text-blue-400",iconColor:"text-blue-500"}}}function het(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 det(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 vet(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 pet({alert:e,onAcknowledge:t}){var i;const r=wae(e.severity),n=fet(e.type);return p.jsx("div",{className:`p-4 rounded-lg ${r.bg} border-l-4 ${r.border}`,children:p.jsxs("div",{className:"flex items-start gap-3",children:[p.jsx(n,{size:20,className:r.iconColor}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[p.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${r.badge}`,children:(i=e.severity)==null?void 0:i.toUpperCase()}),p.jsx("span",{className:"text-xs text-slate-500",children:e.type})]}),p.jsx("div",{className:"text-sm text-slate-200",children:e.message}),p.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs text-slate-500",children:[p.jsxs("span",{className:"flex items-center gap-1",children:[p.jsx(Tf,{size:12}),e.timestamp?het(e.timestamp):"Just now"]}),e.scope_value&&p.jsxs("span",{children:[e.scope_type,": ",e.scope_value]})]})]}),p.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 get({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 p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg",children:[p.jsxs("div",{className:"p-4 border-b border-border flex items-center gap-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(RN,{size:14,className:"text-slate-400"}),p.jsx("span",{className:"text-sm text-slate-400",children:"Filter:"})]}),p.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-blue-500",children:l.map(c=>p.jsx("option",{value:c,children:c==="all"?"All Types":c.replace(/_/g," ")},c))}),p.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-blue-500",children:u.map(c=>p.jsx("option",{value:c,children:c==="all"?"All Severities":c.charAt(0).toUpperCase()+c.slice(1)},c))})]}),p.jsx("div",{className:"overflow-x-auto",children:p.jsxs("table",{className:"w-full",children:[p.jsx("thead",{children:p.jsxs("tr",{className:"border-b border-border",children:[p.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Time"}),p.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Type"}),p.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Severity"}),p.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Message"}),p.jsx("th",{className:"text-left text-xs font-medium text-slate-400 p-4",children:"Duration"})]})}),p.jsx("tbody",{children:e.length>0?e.map((c,f)=>{const h=wae(c.severity);return p.jsxs("tr",{className:"border-b border-border hover:bg-bg-hover",children:[p.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono whitespace-nowrap",children:det(c.timestamp)}),p.jsx("td",{className:"p-4 text-sm text-slate-300",children:c.type.replace(/_/g," ")}),p.jsx("td",{className:"p-4",children:p.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${h.badge}`,children:c.severity})}),p.jsx("td",{className:"p-4 text-sm text-slate-200 max-w-md truncate",children:c.message}),p.jsx("td",{className:"p-4 text-sm text-slate-400 font-mono",children:c.duration?vet(c.duration):"-"})]},c.id||f)}):p.jsx("tr",{children:p.jsx("td",{colSpan:5,className:"p-8 text-center text-slate-500",children:"No alert history available"})})})]})}),o>1&&p.jsxs("div",{className:"p-4 border-t border-border flex items-center justify-between",children:[p.jsxs("span",{className:"text-sm text-slate-400",children:["Page ",a," of ",o]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.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:p.jsx(dce,{size:16})}),p.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:p.jsx(Au,{size:16})})]})]})]})}function met({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 f=`${s%12||12}:${l} ${u}`;return e.sub_type==="weekly"&&e.schedule_day&&(f+=` ${e.schedule_day.charAt(0).toUpperCase()}${e.schedule_day.slice(1)}`),f},a=(()=>{switch(e.sub_type){case"alerts":return ey;case"daily":return Tf;case"weekly":return Tf;default:return ey}})();return p.jsx("div",{className:"p-4 rounded-lg bg-bg-hover border border-border",children:p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-500/10 flex items-center justify-center",children:p.jsx(a,{size:18,className:"text-blue-400"})}),p.jsxs("div",{className:"flex-1",children:[p.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&&p.jsxs("span",{className:"text-slate-400 font-normal ml-2",children:["(",e.scope_type,": ",e.scope_value,")"]})]}),p.jsxs("div",{className:"text-xs text-slate-500 mt-0.5",children:[n()," • ",r(e.user_id)]})]}),p.jsx("div",{className:`w-2 h-2 rounded-full ${e.enabled?"bg-green-500":"bg-slate-500"}`})]})})}function yet(){const[e,t]=G.useState([]),[r,n]=G.useState([]),[i,a]=G.useState([]),[o,s]=G.useState([]),[l,u]=G.useState(!0),[c,f]=G.useState(null),[h,d]=G.useState("all"),[v,m]=G.useState("all"),[y,x]=G.useState(1),[_,b]=G.useState(1),S=20,[T,C]=G.useState(new Set),{lastAlert:A}=FN();G.useEffect(()=>{document.title="Alerts — MeshAI"},[]),G.useEffect(()=>{Promise.all([uY().catch(()=>[]),FB(S,0).catch(()=>({items:[],total:0})),Ice().catch(()=>[]),fetch("/api/nodes").then(k=>k.json()).catch(()=>[])]).then(([k,E,N,D])=>{t(k),Array.isArray(E)?(n(E),b(1)):(n(E.items||[]),b(Math.ceil((E.total||0)/S))),a(N),s(D),u(!1)}).catch(k=>{f(k.message),u(!1)})},[]),G.useEffect(()=>{A&&t(k=>k.some(N=>N.type===A.type&&N.message===A.message)?k:[A,...k])},[A]),G.useEffect(()=>{const k=(y-1)*S;FB(S,k,h,v).then(E=>{Array.isArray(E)?(n(E),b(1)):(n(E.items||[]),b(Math.ceil((E.total||0)/S)))}).catch(()=>{})},[y,h,v]);const P=G.useCallback(k=>{const E=`${k.type}-${k.message}-${k.timestamp}`;C(N=>new Set([...N,E]))},[]),I=e.filter(k=>{const E=`${k.type}-${k.message}-${k.timestamp}`;return!T.has(E)});return l?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-slate-400",children:"Loading alerts..."})}):c?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsxs("div",{className:"text-red-400",children:["Error: ",c]})}):p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[p.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[p.jsx(nl,{size:14}),"Active Alerts (",I.length,")"]}),I.length>0?p.jsx("div",{className:"space-y-3",children:I.map((k,E)=>p.jsx(pet,{alert:k,onAcknowledge:P},`${k.type}-${k.timestamp}-${E}`))}):p.jsxs("div",{className:"flex items-center gap-2 text-slate-500 py-8",children:[p.jsx(DN,{size:20,className:"text-green-500"}),p.jsx("span",{children:"No active alerts — all systems nominal"})]})]}),p.jsxs("div",{children:[p.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[p.jsx(Tf,{size:14}),"Alert History"]}),p.jsx(get,{history:r,typeFilter:h,severityFilter:v,onTypeFilterChange:k=>{d(k),x(1)},onSeverityFilterChange:k=>{m(k),x(1)},page:y,totalPages:_,onPageChange:x})]}),p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6",children:[p.jsxs("h2",{className:"text-sm font-medium text-slate-400 mb-4 flex items-center gap-2",children:[p.jsx(Ace,{size:14}),"Mesh Subscriptions (",i.length,")"]}),i.length>0?p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:i.map(k=>p.jsx(met,{subscription:k,nodes:o},k.id))}):p.jsxs("div",{className:"text-slate-500 py-4",children:[p.jsx("p",{children:"No active subscriptions."}),p.jsxs("p",{className:"text-xs mt-2",children:["Manage subscriptions via ",p.jsx("code",{className:"text-blue-400",children:"!subscribe"})," on mesh. Broadcasts arrive with one of three prefixes — ",p.jsx("strong",{children:"New:"})," (first sight), ",p.jsx("strong",{children:"Update:"})," (material change), or ",p.jsx("strong",{children:"Active:"})," (clock-driven reminder while the event is still live). See ",p.jsx("a",{href:"/reference#broadcast-types",className:"text-blue-400 hover:underline",children:"Broadcast Types"})," and ",p.jsx("a",{href:"/reference#reminders",className:"text-blue-400 hover:underline",children:"Reminder System"})," in Reference."]})]})]})]})}const t1=[{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)"}],_7=[{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 _b(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 ba({info:e}){const[t,r]=G.useState(!1);return p.jsxs("div",{className:"relative inline-block",children:[p.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&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>r(!1)}),p.jsx("div",{className:"absolute left-0 top-6 z-50 w-72 p-3 bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl text-xs text-slate-300 leading-relaxed",children:e})]})]})}function Wl({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 p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,o&&p.jsx(ba,{info:o})]}),p.jsxs("div",{className:"relative",children:[p.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&&p.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?p.jsx(tY,{size:16}):p.jsx(jN,{size:16})})]}),a&&p.jsx("p",{className:"text-xs text-slate-600",children:a})]})}function m0({label:e,value:t,onChange:r,min:n,max:i,step:a=1,helper:o="",info:s=""}){return p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,s&&p.jsx(ba,{info:s})]}),p.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&&p.jsx("p",{className:"text-xs text-slate-600",children:o})]})}function VS({label:e,checked:t,onChange:r,helper:n="",info:i=""}){return p.jsxs("div",{className:"flex items-center justify-between py-2",children:[p.jsxs("div",{children:[p.jsxs("span",{className:"flex items-center text-sm text-slate-300",children:[e,i&&p.jsx(ba,{info:i})]}),n&&p.jsx("p",{className:"text-xs text-slate-600",children:n})]}),p.jsx("button",{type:"button",onClick:()=>r(!t),className:`relative w-11 h-6 rounded-full transition-colors ${t?"bg-accent":"bg-[#1e2a3a]"}`,children:p.jsx("span",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${t?"translate-x-5":""}`})})]})}function Nm({label:e,value:t,onChange:r,helper:n="",info:i=""}){return p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,i&&p.jsx(ba,{info:i})]}),p.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&&p.jsx("p",{className:"text-xs text-slate-600",children:n})]})}function r1({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((f,h)=>h!==c))};return p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:[e,a&&p.jsx(ba,{info:a})]}),p.jsxs("div",{className:"flex gap-2",children:[p.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}),p.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:p.jsx(Fv,{size:16})})]}),t.length>0&&p.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:t.map((c,f)=>p.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-[#1e2a3a] rounded text-sm text-slate-300",children:[c,p.jsx("button",{type:"button",onClick:()=>u(f),className:"text-slate-500 hover:text-red-400",children:p.jsx(vo,{size:14})})]},f))}),i&&p.jsx("p",{className:"text-xs text-slate-600",children:i})]})}function Sae({value:e,onChange:t}){const[r,n]=G.useState(!1),i=t1.find(a=>a.value===e)||t1[0];return p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Severity Threshold",p.jsx(ba,{info:"Only alerts at or above this severity trigger this rule. ROUTINE = informational, PRIORITY = needs attention, IMMEDIATE = act now."})]}),p.jsxs("div",{className:"relative",children:[p.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:[p.jsxs("div",{children:[p.jsx("span",{className:"text-slate-200",children:i.label}),p.jsxs("span",{className:"text-slate-500 ml-2",children:["- ",i.description]})]}),p.jsx(Bu,{size:16,className:`text-slate-500 transition-transform ${r?"rotate-180":""}`})]}),r&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>n(!1)}),p.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-50 bg-[#0a0e17] border border-[#1e2a3a] rounded-lg shadow-xl overflow-hidden",children:t1.map(a=>p.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:[p.jsx("div",{className:"font-medium text-slate-200",children:a.label}),p.jsx("div",{className:"text-xs text-slate-500",children:a.description})]},a.value))})]})]}),p.jsx("p",{className:"text-xs text-slate-600",children:'Lower = more notifications. "Warning" recommended for most rules.'})]})}function bb({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:p.jsx(ho,{size:14}),mesh_dm:p.jsx(BN,{size:14}),email:p.jsx(bce,{size:14}),webhook:p.jsx(xce,{size:14})}[e.delivery_type]||p.jsx(vT,{size:14});return p.jsxs("div",{className:"space-y-2",children:[p.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?p.jsxs(p.Fragment,{children:[p.jsx(ty,{size:14,className:"animate-spin"}),"Testing..."]}):p.jsxs(p.Fragment,{children:[o,"Test Channel"]})}),n&&p.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:p.jsxs("div",{className:"flex items-start gap-2",children:[n.success?p.jsx(ts,{size:14,className:"mt-0.5 flex-shrink-0"}):p.jsx(vo,{size:14,className:"mt-0.5 flex-shrink-0"}),p.jsxs("div",{children:[p.jsx("div",{className:"font-medium",children:n.message}),n.error&&p.jsx("div",{className:"mt-1 text-red-300",children:n.error})]})]})})]})}function xet({rule:e,ruleIndex:t,categories:r,regions:n,onChange:i,onDelete:a,onDuplicate:o,onTest:s}){var N,D,z,V,F;const[l,u]=G.useState(!e.name),[c,f]=G.useState(!1),[h,d]=G.useState(null),[v,m]=G.useState(null);G.useEffect(()=>{var $;e.name&&t>=0&&(fetch(`/api/notifications/rules/${t}/stats`).then(B=>B.json()).then(B=>d(B)).catch(()=>{}),($=e.categories)!=null&&$.length&&fetch("/api/notifications/rules/sources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({categories:e.categories})}).then(B=>B.json()).then(B=>m(B)).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"}],b=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],S=$=>{const B=e.categories||[];B.includes($)?i({...e,categories:B.filter(H=>H!==$)}):i({...e,categories:[...B,$]})},T=($,B)=>{const H=e.categories||[];if(B==="add"){const U=Array.from(new Set([...H,...$]));i({...e,categories:U})}else{const U=new Set($);i({...e,categories:H.filter(Z=>!U.has(Z))})}},C=$=>{const B=e.region_scope||[];B.includes($)?i({...e,region_scope:B.filter(H=>H!==$)}):i({...e,region_scope:[...B,$]})},A=$=>{const B=e.schedule_days||[];B.includes($)?i({...e,schedule_days:B.filter(H=>H!==$)}):i({...e,schedule_days:[...B,$]})},P=async()=>{f(!0),await s(),f(!1)},I=()=>{if(e.trigger_type==="schedule")return"[Scheduled report preview would appear here]";const $=e.categories||[];if($.length===0&&r.length>0)return r[0].example_message||"Alert notification";const B=r.find(H=>$.includes(H.id));return(B==null?void 0:B.example_message)||"Alert notification"},k=()=>{var B,H,U,Z,Y,K,te,ce;const $=[];if(e.trigger_type==="schedule"){const de=((B=x.find(ye=>ye.value===e.schedule_frequency))==null?void 0:B.label)||e.schedule_frequency,Ie=((H=_.find(ye=>ye.value===e.message_type))==null?void 0:H.label)||e.message_type;$.push(`${de} at ${e.schedule_time||"??:??"}`),$.push(Ie)}else{const de=((U=e.categories)==null?void 0:U.length)||0,Ie=de===0?"All":r.filter(ne=>{var ve;return(ve=e.categories)==null?void 0:ve.includes(ne.id)}).map(ne=>ne.name).slice(0,2).join(", ")+(de>2?` +${de-2}`:""),ye=((Z=t1.find(ne=>ne.value===e.min_severity))==null?void 0:Z.label)||e.min_severity;$.push(`${Ie} at ${ye}+`)}if(!e.delivery_type)$.push("No delivery");else{const de=((Y=y.find(ye=>ye.value===e.delivery_type))==null?void 0:Y.label)||e.delivery_type;let Ie="";if(e.delivery_type==="mesh_broadcast")Ie=`Ch ${e.broadcast_channel}`;else if(e.delivery_type==="mesh_dm")Ie=`${((K=e.node_ids)==null?void 0:K.length)||0} nodes`;else if(e.delivery_type==="email")Ie=(te=e.recipients)!=null&&te.length?e.recipients[0]+(e.recipients.length>1?` +${e.recipients.length-1}`:""):"no recipients";else if(e.delivery_type==="webhook")try{Ie=new URL(e.webhook_url).hostname}catch{Ie=((ce=e.webhook_url)==null?void 0:ce.slice(0,20))||"no URL"}$.push(`${de}${Ie?` (${Ie})`:""}`)}return $.join(" -> ")},E=()=>{var B;if(!v||!((B=e.categories)!=null&&B.length))return null;const $=new Map;for(const[,H]of Object.entries(v)){const U=$.get(H.source);U?(U.events+=H.active_events,U.enabled=U.enabled&&H.enabled):$.set(H.source,{enabled:H.enabled,events:H.active_events})}return Array.from($.entries()).map(([H,{enabled:U,events:Z}])=>p.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?`${Z} active`:"Not enabled",children:[U?p.jsx(vT,{size:10}):p.jsx(lY,{size:10}),H.toUpperCase(),U&&Z>0&&` (${Z})`]},H))};return p.jsxs("div",{className:`border rounded-lg overflow-hidden ${e.enabled?"border-[#1e2a3a]":"border-slate-700 opacity-60"}`,children:[p.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a0e17] cursor-pointer",onClick:()=>u(!l),children:[p.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[l?p.jsx(Bu,{size:16,className:"text-slate-500 flex-shrink-0"}):p.jsx(Au,{size:16,className:"text-slate-500 flex-shrink-0"}),p.jsx("button",{onClick:$=>{$.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"?p.jsx(Tf,{size:14,className:"text-blue-400 flex-shrink-0"}):p.jsx(ry,{size:14,className:"text-yellow-400 flex-shrink-0"}),p.jsx("span",{className:"font-medium text-slate-200 truncate",title:e.name||void 0,children:e.name||"New Rule"}),!l&&p.jsx("span",{className:`text-xs truncate hidden sm:block ${e.delivery_type?"text-slate-500":"text-amber-400"}`,children:k()})]}),p.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[!l&&(()=>{const $="hidden sm:inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs mr-2";if(!e.enabled)return p.jsx("span",{className:`${$} bg-slate-800 text-slate-500`,children:"Disabled"});if(!h)return null;const B=h.fire_count||0,H=h.last_fired,U=Date.now()/1e3-7*86400;return B>0&&H&&H>=U?p.jsx("span",{className:`${$} bg-green-500/10 text-green-400`,title:`Last fired ${_b(H)}`,children:"Active"}):B>0&&H?p.jsx("span",{className:`${$} bg-yellow-500/10 text-yellow-400`,title:`Last fired ${_b(H)}`,children:"Idle (no recent activity)"}):p.jsx("span",{className:`${$} bg-slate-800 text-slate-400`,children:"No activity yet"})})(),!l&&p.jsx("div",{className:"hidden md:flex items-center gap-1 mr-2",children:E()}),p.jsx("button",{onClick:$=>{$.stopPropagation(),P()},disabled:c||!e.name,className:"p-1.5 text-blue-400 hover:text-blue-300 hover:bg-blue-500/10 rounded disabled:opacity-50",title:"Test rule",children:p.jsx(Kk,{size:14})}),p.jsx("button",{onClick:$=>{$.stopPropagation(),o()},className:"p-1.5 text-slate-400 hover:text-slate-200 hover:bg-slate-500/10 rounded",title:"Duplicate",children:p.jsx(mce,{size:14})}),p.jsx("button",{onClick:$=>{$.stopPropagation(),a()},className:"p-1.5 text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded",title:"Delete",children:p.jsx(C0,{size:14})})]})]}),!l&&e.name&&p.jsxs("div",{className:"px-3 pb-2 pt-0 bg-[#0a0e17] flex items-center gap-2 flex-wrap text-xs",children:[!e.delivery_type&&p.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 bg-amber-500/10 text-amber-400 rounded",children:[p.jsx(Mu,{size:10}),"No delivery method"]}),(h==null?void 0:h.fire_count)!==void 0&&h.fire_count>0&&p.jsxs("span",{className:"text-slate-500",children:["Fired ",h.fire_count,"x"]})]}),l&&p.jsxs("div",{className:"p-4 space-y-6 border-t border-[#1e2a3a]",children:[p.jsx(Wl,{label:"Rule Name",value:e.name,onChange:$=>i({...e,name:$}),placeholder:"e.g., Emergency Broadcast, Daily Health Report",helper:"A descriptive name for this rule"}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Trigger Type"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs("button",{type:"button",onClick:()=>i({...e,trigger_type:"condition"}),className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-lg 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:[p.jsx(ry,{size:16}),p.jsx("span",{children:"Condition"})]}),p.jsxs("button",{type:"button",onClick:()=>i({...e,trigger_type:"schedule"}),className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-lg 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:[p.jsx(Tf,{size:16}),p.jsx("span",{children:"Schedule"})]})]}),p.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"&&p.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[p.jsx(nl,{size:14}),"WHEN (Condition)"]}),p.jsx(Sae,{value:e.min_severity,onChange:$=>i({...e,min_severity:$})}),p.jsxs("div",{className:"space-y-2",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Alert Categories",p.jsx(ba,{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."})]}),p.jsx("div",{className:"text-xs text-slate-500 mb-2",children:(((N=e.categories)==null?void 0:N.length)||0)===0?"All categories (none selected)":`${(D=e.categories)==null?void 0:D.length} selected`}),p.jsx(_et,{categories:r,selected:e.categories||[],onToggle:S,onSelectMany:T})]}),v&&Object.keys(v).length>0&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Data Sources"}),p.jsx("div",{className:"flex flex-wrap gap-2",children:E()})]})]}),e.trigger_type==="schedule"&&p.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[p.jsx(hce,{size:14}),"WHEN (Schedule)"]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Frequency"}),p.jsx("select",{value:e.schedule_frequency||"daily",onChange:$=>i({...e,schedule_frequency:$.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($=>p.jsx("option",{value:$.value,children:$.label},$.value))})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Nm,{label:"Time",value:e.schedule_time||"07:00",onChange:$=>i({...e,schedule_time:$})}),e.schedule_frequency==="twice_daily"&&p.jsx(Nm,{label:"Second Time",value:e.schedule_time_2||"19:00",onChange:$=>i({...e,schedule_time_2:$})})]}),e.schedule_frequency==="weekly"&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Days"}),p.jsx("div",{className:"flex flex-wrap gap-2",children:b.map($=>{var B;return p.jsx("button",{type:"button",onClick:()=>A($),className:`px-3 py-1.5 rounded text-sm capitalize transition-colors ${(B=e.schedule_days)!=null&&B.includes($)?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,children:$.slice(0,3)},$)})})]}),p.jsxs("div",{className:"space-y-1",children:[p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Report Type"}),p.jsx("select",{value:e.message_type||"mesh_health_summary",onChange:$=>i({...e,message_type:$.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($=>p.jsx("option",{value:$.value,children:$.label},$.value))}),p.jsx("p",{className:"text-xs text-slate-600",children:(z=_.find($=>$.value===e.message_type))==null?void 0:z.description})]}),e.message_type==="custom"&&p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Custom Message",p.jsx(ba,{info:"Available tokens: {MESH_SCORE}, {NODE_COUNT}, {NODES_ONLINE}, {ACTIVE_ALERTS}, {KP}, {SFI}, {DATE}, {TIME}"})]}),p.jsx("textarea",{value:e.custom_message||"",onChange:$=>i({...e,custom_message:$.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"})]})]}),p.jsxs("div",{className:"space-y-2 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[p.jsx($v,{size:14}),"REGIONS",p.jsx(ba,{info:"Limit this rule to alerts from specific regions. Empty selection = all regions (backward compatible). Region names come from /api/regions."})]}),p.jsx("div",{className:"text-xs text-slate-500",children:(((V=e.region_scope)==null?void 0:V.length)||0)===0?"All regions (none selected)":`${e.region_scope.length} of ${n.length} selected`}),n.length===0?p.jsx("div",{className:"text-xs text-slate-600 italic",children:"No regions configured."}):p.jsx("div",{className:"flex flex-wrap gap-2",children:n.map($=>{const B=(e.region_scope||[]).includes($.name);return p.jsx("button",{type:"button",onClick:()=>C($.name),className:`px-3 py-1.5 rounded text-sm transition-colors ${B?"bg-accent text-white":"bg-[#1e2a3a] text-slate-400 hover:text-slate-200"}`,title:$.local_name||$.name,children:$.local_name||$.name},$.name)})})]}),p.jsxs("div",{className:"space-y-4 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-slate-300",children:[p.jsx(Kk,{size:14}),"SEND VIA"]}),p.jsxs("div",{className:"space-y-1",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Delivery Method",p.jsx(ba,{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."})]}),p.jsx("select",{value:e.delivery_type||"",onChange:$=>i({...e,delivery_type:$.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($=>p.jsx("option",{value:$.value,children:$.label},$.value))}),p.jsx("p",{className:"text-xs text-slate-600",children:(F=y.find($=>$.value===(e.delivery_type||"")))==null?void 0:F.description})]}),!e.delivery_type&&p.jsxs("div",{className:"flex items-start gap-2 p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[p.jsx(Mu,{size:16,className:"text-amber-400 mt-0.5 flex-shrink-0"}),p.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"&&p.jsxs(p.Fragment,{children:[p.jsx(I3,{label:"Broadcast Channel",value:e.broadcast_channel??0,onChange:$=>i({...e,broadcast_channel:$}),helper:"Select the mesh radio channel",mode:"single"}),p.jsx(bb,{rule:e})]}),e.delivery_type==="mesh_dm"&&p.jsxs(p.Fragment,{children:[p.jsx(L3,{label:"Recipient Nodes",value:e.node_ids||[],onChange:$=>i({...e,node_ids:$}),helper:"Nodes that receive direct messages",valueType:"node_id_hex"}),p.jsx(bb,{rule:e})]}),e.delivery_type==="email"&&p.jsxs("div",{className:"space-y-4",children:[p.jsx(r1,{label:"Recipients",value:e.recipients||[],onChange:$=>i({...e,recipients:$}),placeholder:"email@example.com",helper:"Email addresses to receive alerts"}),p.jsxs("details",{className:"group",children:[p.jsxs("summary",{className:"flex items-center gap-2 cursor-pointer text-sm text-slate-400 hover:text-slate-200",children:[p.jsx(Au,{size:14,className:"group-open:rotate-90 transition-transform"}),"SMTP Configuration"]}),p.jsxs("div",{className:"mt-4 space-y-4 pl-6 border-l border-[#1e2a3a]",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Wl,{label:"SMTP Host",value:e.smtp_host||"",onChange:$=>i({...e,smtp_host:$}),placeholder:"smtp.gmail.com"}),p.jsx(m0,{label:"SMTP Port",value:e.smtp_port??587,onChange:$=>i({...e,smtp_port:$}),min:1,max:65535})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(Wl,{label:"Username",value:e.smtp_user||"",onChange:$=>i({...e,smtp_user:$})}),p.jsx(Wl,{label:"Password",value:e.smtp_password||"",onChange:$=>i({...e,smtp_password:$}),type:"password",info:"Gmail users: use an App Password from myaccount.google.com/apppasswords"})]}),p.jsx(VS,{label:"Use TLS",checked:e.smtp_tls??!0,onChange:$=>i({...e,smtp_tls:$})}),p.jsx(Wl,{label:"From Address",value:e.from_address||"",onChange:$=>i({...e,from_address:$}),placeholder:"alerts@yourdomain.com"})]})]}),p.jsx(bb,{rule:e})]}),e.delivery_type==="webhook"&&p.jsxs(p.Fragment,{children:[p.jsx(Wl,{label:"Webhook URL",value:e.webhook_url||"",onChange:$=>i({...e,webhook_url:$}),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."}),p.jsx(bb,{rule:e})]})]}),p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsx(m0,{label:"Cooldown (minutes)",value:e.cooldown_minutes??10,onChange:$=>i({...e,cooldown_minutes:$}),min:0,helper:"Min time between repeat sends",info:"Prevents alert spam. Same condition won't re-trigger this rule within this window."})," "]}),h&&p.jsxs("div",{className:"flex items-center gap-4 text-xs text-slate-500",children:[p.jsxs("span",{children:["Last fired: ",_b(h.last_fired)]}),p.jsxs("span",{children:["Last tested: ",_b(h.last_test)]}),p.jsxs("span",{children:["Total fires: ",h.fire_count]})]}),e.trigger_type!=="schedule"&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Example Message"}),p.jsx("div",{className:"p-3 bg-[#1e2a3a]/50 rounded-lg border border-[#1e2a3a]",children:p.jsx("p",{className:"text-sm text-slate-300 font-mono",children:I()})}),p.jsx("p",{className:"text-xs text-slate-600",children:"This is an example of what this rule would send."})]})]})]})}const n1=[{key:"mesh_health",label:"Mesh Health",Icon:zv},{key:"weather",label:"Weather",Icon:Pu},{key:"fire",label:"Fire",Icon:lT},{key:"rf_propagation",label:"RF Propagation",Icon:ho},{key:"roads",label:"Roads",Icon:oT},{key:"avalanche",label:"Avalanche",Icon:Cce},{key:"seismic",label:"Seismic",Icon:cT},{key:"tracking",label:"Tracking",Icon:$v}];function _et({categories:e,selected:t,onToggle:r,onSelectMany:n}){const i=new Set(n1.map(h=>h.key)),a=new Map;n1.forEach(h=>a.set(h.key,[]));const o=[];for(const h of e){const d=h.toggle;d&&i.has(d)?a.get(d).push(h):o.push(h)}const s=new Set;for(const[h,d]of a)d.some(v=>t.includes(v.id))&&s.add(h);o.some(h=>t.includes(h.id))&&s.add("other");const[l,u]=G.useState(s),c=h=>{u(d=>{const v=new Set(d);return v.has(h)?v.delete(h):v.add(h),v})},f=(h,d,v,m)=>{if(!m.length)return null;const y=l.has(h),x=m.map(b=>b.id),_=x.filter(b=>t.includes(b)).length;return p.jsxs("div",{className:"border border-[#1e2a3a] rounded",children:[p.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 bg-[#0d1420]",children:[p.jsxs("button",{type:"button",onClick:()=>c(h),className:"flex items-center gap-2 text-sm text-slate-200 flex-1 min-w-0",children:[y?p.jsx(Bu,{size:14,className:"text-slate-500 flex-shrink-0"}):p.jsx(Au,{size:14,className:"text-slate-500 flex-shrink-0"}),v&&p.jsx(v,{size:14,className:"text-slate-400 flex-shrink-0"}),p.jsxs("span",{className:"truncate",children:[d," (",m.length,")"]}),_>0&&p.jsxs("span",{className:"ml-1 text-xs text-accent",children:[_," selected"]})]}),p.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[p.jsx("button",{type:"button",onClick:b=>{b.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"}),p.jsx("button",{type:"button",onClick:b=>{b.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&&p.jsx("div",{className:"p-1 space-y-1",children:m.map(b=>p.jsxs("label",{onClick:()=>r(b.id),className:"flex items-start gap-2 p-2 rounded hover:bg-[#1e2a3a]/50 cursor-pointer",children:[p.jsx("div",{className:`w-4 h-4 mt-0.5 rounded border flex items-center justify-center flex-shrink-0 ${t.includes(b.id)?"bg-accent border-accent":"border-slate-600"}`,children:t.includes(b.id)&&p.jsx(ts,{size:12,className:"text-white"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm text-slate-200",children:b.name}),p.jsx("div",{className:"text-xs text-slate-500",children:b.description})]})]},b.id))})]},h)};return p.jsxs("div",{className:"max-h-96 overflow-y-auto border border-[#1e2a3a] rounded-lg p-2 space-y-2",children:[n1.map(h=>f(h.key,h.label,h.Icon,a.get(h.key)||[])),f("other","Other",null,o)]})}const b7=["digest","mesh_broadcast","mesh_dm","email","webhook"],bet=["routine","priority","immediate"];function wet({toggles:e,onChange:t}){const[r,n]=G.useState(null),i=(a,o)=>t({...e,[a]:{...e[a]||{},name:a,...o}});return p.jsxs("div",{className:"space-y-3 mb-8",children:[p.jsxs("div",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Master Toggles",p.jsx(ba,{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)."})]}),p.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:n1.map(({key:a,label:o,Icon:s})=>{const l=e[a]||{},u=r===a,c=Object.values(l.severity_channels||{}).reduce((h,d)=>h+((d==null?void 0:d.length)||0),0),f=(l.regions||[]).length;return p.jsxs("div",{className:"border border-[#1e2a3a] rounded-lg p-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("button",{type:"button",onClick:()=>n(u?null:a),className:"flex items-center gap-2 text-sm text-slate-200",children:[p.jsx(s,{size:15})," ",o,u?p.jsx(Bu,{size:14}):p.jsx(Au,{size:14})]}),p.jsx(VS,{label:"",checked:!!l.enabled,onChange:h=>i(a,{enabled:h})})]}),!u&&p.jsx("div",{className:"text-xs text-slate-600 mt-1",children:l.enabled?`${f||"all"} region${f===1?"":"s"}, ${c} channel${c===1?"":"s"} at ${l.min_severity||"priority"}+`:"OFF"}),u&&p.jsxs("div",{className:`mt-3 space-y-3 ${l.enabled?"":"opacity-40 pointer-events-none select-none"}`,children:[p.jsx(Sae,{value:l.min_severity||"priority",onChange:h=>i(a,{min_severity:h})}),p.jsx("div",{className:"text-xs text-slate-500",children:"Severity → channels"}),p.jsxs("table",{className:"text-xs w-full",children:[p.jsx("thead",{children:p.jsxs("tr",{children:[p.jsx("th",{}),b7.map(h=>p.jsx("th",{className:"text-slate-500 font-normal px-1",children:h.replace("_"," ")},h))]})}),p.jsx("tbody",{children:bet.map(h=>p.jsxs("tr",{children:[p.jsx("td",{className:"text-slate-400 pr-2",children:h}),b7.map(d=>{var m;const v=(((m=l.severity_channels)==null?void 0:m[h])||[]).includes(d);return p.jsx("td",{className:"text-center",children:p.jsx("input",{type:"checkbox",checked:v,onChange:y=>{const x={...l.severity_channels||{}},_=new Set(x[h]||[]);y.target.checked?_.add(d):_.delete(d),x[h]=Array.from(_),i(a,{severity_channels:x})}})},d)})]},h))})]}),p.jsx(r1,{label:"Regions (empty = all)",value:l.regions||[],onChange:h=>i(a,{regions:h}),placeholder:"Add region..."})," ",p.jsx("div",{className:"text-xs text-slate-500 pt-1",children:"Channel config"}),p.jsx(m0,{label:"Broadcast channel",value:l.broadcast_channel??0,onChange:h=>i(a,{broadcast_channel:h})}),p.jsx(r1,{label:"DM node IDs",value:l.node_ids||[],onChange:h=>i(a,{node_ids:h}),placeholder:"!nodeid"}),p.jsx(r1,{label:"Email recipients",value:l.recipients||[],onChange:h=>i(a,{recipients:h}),placeholder:"ops@example.com"}),p.jsx(Wl,{label:"SMTP host",value:l.smtp_host||"",onChange:h=>i(a,{smtp_host:h}),placeholder:"smtp.example.com"}),p.jsx(m0,{label:"SMTP port",value:l.smtp_port??587,onChange:h=>i(a,{smtp_port:h})}),p.jsx(Wl,{label:"Webhook URL",value:l.webhook_url||"",onChange:h=>i(a,{webhook_url:h}),placeholder:"https://..."})]})]},a)})})]})}function Tet(){var B,H,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,f]=G.useState(!1),[h,d]=G.useState(null),[v,m]=G.useState(null),[y,x]=G.useState(null),[_,b]=G.useState({open:!1,ruleIndex:-1,loading:!1,action:""}),[S,T]=G.useState(!1),[C,A]=G.useState(!1),P=G.useCallback(async()=>{try{const[Z,Y,K]=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 te=await Z.json(),ce=await Y.json(),de=K.ok?await K.json():[];t(te),n(JSON.parse(JSON.stringify(te))),a(ce),s(Array.isArray(de)?de:[]),A(!1),d(null)}catch(Z){d(Z instanceof Error?Z.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){f(!0),d(null),m(null);try{const Z=await fetch("/api/config/notifications",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),Y=await Z.json();if(!Z.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(Z){d(Z instanceof Error?Z.message:"Save failed")}finally{f(!1)}}},k=()=>{r&&(t(JSON.parse(JSON.stringify(r))),A(!1))},E=()=>({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:[]}),N=()=>{e&&t({...e,rules:[...e.rules||[],E()]})},D=Z=>{if(!e)return;const Y=_7.find(K=>K.id===Z);Y&&(t({...e,rules:[...e.rules||[],{...E(),...Y.rule}]}),T(!1))},z=Z=>{if(!e)return;const Y=e.rules[Z],K={...JSON.parse(JSON.stringify(Y)),name:`${Y.name} (copy)`},te=[...e.rules];te.splice(Z+1,0,K),t({...e,rules:te})},V=async Z=>{b({open:!0,ruleIndex:Z,loading:!0,action:""});try{const K=await(await fetch(`/api/notifications/rules/${Z}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"preview"})})).json();x(K),b(te=>({...te,loading:!1}))}catch{x({success:!1,message:"Failed to get preview"}),b(Y=>({...Y,loading:!1}))}},F=async Z=>{const Y=_.ruleIndex;b(K=>({...K,loading:!0,action:Z}));try{const te=await(await fetch(`/api/notifications/rules/${Y}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:Z})})).json();x(te),b(ce=>({...ce,loading:!1}))}catch{x({success:!1,message:`Failed to ${Z}`}),b(K=>({...K,loading:!1}))}},$=()=>{b({open:!1,ruleIndex:-1,loading:!1,action:""}),x(null)};return l?p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-slate-400",children:"Loading notifications config..."})}):e?p.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[_.open&&p.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:p.jsxs("div",{className:"bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[85vh] overflow-auto",children:[p.jsxs("div",{className:"p-4 border-b border-[#2a3a4a] flex items-center justify-between sticky top-0 bg-[#1a2332]",children:[p.jsx("h3",{className:"text-lg font-semibold",children:"Test Notification Rule"}),p.jsx("button",{onClick:$,className:"text-slate-500 hover:text-slate-300",children:p.jsx(vo,{size:20})})]}),p.jsx("div",{className:"p-4 space-y-4",children:_.loading?p.jsxs("div",{className:"flex items-center justify-center py-8",children:[p.jsx(ty,{size:20,className:"animate-spin text-slate-400 mr-2"}),p.jsx("div",{className:"text-slate-400",children:_.action?`${_.action.replace("_"," ").replace("send ","Sending ")}...`:"Loading current data..."})]}):y?p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"space-y-2",children:[p.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?p.jsx("div",{className:"p-3 bg-slate-800/50 rounded space-y-1",children:y.live_data_summary.map((Z,Y)=>p.jsx("div",{className:`text-sm font-mono ${Z.startsWith("[!]")?"text-amber-400":""}`,children:Z},Y))}):p.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"})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:"Rule Matching"}),p.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[y.conditions_matched&&y.conditions_matched>0?p.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"]}):p.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&&p.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&&p.jsxs("div",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-sm space-y-2",children:[p.jsx("div",{className:"text-yellow-300",children:y.below_threshold_summary}),y.below_threshold_events&&y.below_threshold_events.length>0&&p.jsx("div",{className:"space-y-1 text-yellow-200/80",children:y.below_threshold_events.slice(0,3).map((Z,Y)=>p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-yellow-500/20 rounded",children:Z.severity}),p.jsx("span",{children:Z.headline})]},Y))}),y.suggestion&&p.jsxs("div",{className:"text-yellow-400 text-xs mt-2",children:["Tip: ",y.suggestion]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx("div",{className:"text-sm font-medium text-slate-400 uppercase tracking-wide",children:y.is_example?"Example Messages":"Messages That Would Fire"}),(B=y.preview_messages)==null?void 0:B.map((Z,Y)=>p.jsx("div",{className:"p-3 bg-slate-800 rounded text-sm font-mono break-words",children:Z},Y))]}),y.delivered!==void 0&&y.delivery_result&&p.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:p.jsxs("div",{className:"flex items-start gap-2",children:[y.delivered?p.jsx(ts,{size:16,className:"mt-0.5"}):p.jsx(vo,{size:16,className:"mt-0.5"}),p.jsxs("div",{children:[p.jsx("div",{children:y.delivery_result}),y.delivery_error&&p.jsx("div",{className:"mt-1 text-red-300",children:y.delivery_error})]})]})}),y.message&&!y.preview_messages&&p.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}),p.jsxs("div",{className:"p-4 border-t border-[#2a3a4a] flex justify-between sticky bottom-0 bg-[#1a2332]",children:[p.jsx("button",{onClick:$,className:"px-4 py-2 text-slate-400 hover:text-slate-200",children:"Close"}),y&&!y.delivered&&p.jsx("div",{className:"flex gap-2",children:y.delivery_method?p.jsxs(p.Fragment,{children:[y.live_data_summary&&y.live_data_summary.length>0&&p.jsx("button",{onClick:()=>F("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"}),p.jsx("button",{onClick:()=>F("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&&p.jsx("button",{onClick:()=>F("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"})]}):p.jsx("span",{className:"px-3 py-2 text-amber-400 text-sm",children:"Configure a delivery method to send test messages"})})]})]})}),p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("div",{children:p.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."})}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("button",{onClick:P,className:"p-2 text-slate-400 hover:text-slate-200 hover:bg-bg-hover rounded transition-colors",title:"Refresh",children:p.jsx(ty,{size:18})}),p.jsxs("button",{onClick:k,disabled:!C,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:[p.jsx(fT,{size:16}),"Discard"]}),p.jsxs("button",{onClick:I,disabled:c||!C,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:[p.jsx(zN,{size:16}),c?"Saving...":"Save"]})]})]}),h&&p.jsx("div",{className:"p-3 rounded-lg text-sm bg-red-500/10 text-red-400 border border-red-500/20",children:h}),v&&p.jsxs("div",{className:"p-3 rounded-lg text-sm bg-green-500/10 text-green-400 border border-green-500/20",children:[p.jsx(ts,{size:14,className:"inline mr-2"}),v]}),p.jsxs("div",{className:"bg-bg-card border border-border rounded-lg p-6 space-y-6",children:[p.jsx(VS,{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&&p.jsxs(p.Fragment,{children:[" ",p.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[p.jsx("div",{className:"flex items-center gap-2",children:p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Cold-start grace"})}),p.jsx(m0,{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."})]}),p.jsxs("div",{className:"space-y-3 p-4 bg-[#0a0e17] rounded-lg border border-[#1e2a3a]",children:[p.jsx("div",{className:"flex items-center gap-2",children:p.jsx("label",{className:"text-xs text-slate-500 uppercase tracking-wide",children:"Band Conditions (HF propagation)"})}),p.jsx(VS,{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)&&p.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[p.jsx(Nm,{label:"Slot 1",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[0]||"06:00",onChange:Z=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[0]=Z,t({...e,band_conditions_schedule:Y})},helper:"Morning (default 06:00 MT)"}),p.jsx(Nm,{label:"Slot 2",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[1]||"14:00",onChange:Z=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[1]=Z,t({...e,band_conditions_schedule:Y})},helper:"Afternoon (default 14:00 MT)"}),p.jsx(Nm,{label:"Slot 3",value:(e.band_conditions_schedule??["06:00","14:00","22:00"])[2]||"22:00",onChange:Z=>{const Y=[...e.band_conditions_schedule??["06:00","14:00","22:00"]];Y[2]=Z,t({...e,band_conditions_schedule:Y})},helper:"Night (default 22:00 MT)"})]}),p.jsx("p",{className:"text-xs text-slate-600",children:"All times are Mountain Time (America/Boise). DST handled automatically."})]}),e.toggles&&p.jsx(wet,{toggles:e.toggles,onChange:Z=>t({...e,toggles:Z})}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("label",{className:"flex items-center text-xs text-slate-500 uppercase tracking-wide",children:["Notification Rules",p.jsx(ba,{info:"Each rule is self-contained: define what triggers it (condition or schedule), where to send it (mesh, email, webhook), and behavior settings."})]}),p.jsxs("span",{className:"text-xs text-slate-500",children:[((H=e.rules)==null?void 0:H.length)||0," rule",(((U=e.rules)==null?void 0:U.length)||0)!==1?"s":""]})]}),(e.rules||[]).map((Z,Y)=>p.jsx(xet,{rule:Z,ruleIndex:Y,categories:i,regions:o,onChange:K=>{const te=[...e.rules||[]];te[Y]=K,t({...e,rules:te})},onDelete:()=>{confirm(`Delete rule "${Z.name||"New Rule"}"?`)&&t({...e,rules:(e.rules||[]).filter((K,te)=>te!==Y)})},onDuplicate:()=>z(Y),onTest:()=>V(Y)},Y)),p.jsxs("div",{className:"flex gap-2",children:[p.jsxs("button",{onClick:N,className:"flex-1 py-3 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center justify-center gap-2 transition-colors",children:[p.jsx(Fv,{size:16})," Add Rule"]}),p.jsxs("div",{className:"relative",children:[p.jsxs("button",{onClick:()=>T(!S),className:"py-3 px-4 border border-dashed border-[#1e2a3a] rounded-lg text-slate-500 hover:text-slate-300 hover:border-accent flex items-center gap-2 transition-colors",children:[p.jsx(rY,{size:16})," Add from Template"]}),S&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>T(!1)}),p.jsxs("div",{className:"absolute right-0 top-full mt-2 z-50 w-80 bg-[#1a2332] border border-[#2a3a4a] rounded-lg shadow-xl overflow-hidden",children:[p.jsx("div",{className:"p-2 border-b border-[#2a3a4a] text-xs text-slate-500 uppercase",children:"Rule Templates"}),_7.map(Z=>p.jsxs("button",{onClick:()=>D(Z.id),className:"w-full p-3 text-left hover:bg-[#2a3a4a] transition-colors",children:[p.jsx("div",{className:"font-medium text-slate-200",children:Z.name}),p.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:Z.description})]},Z.id))]})]})]})]})]})]})]})]}):p.jsx("div",{className:"flex items-center justify-center h-64",children:p.jsx("div",{className:"text-red-400",children:"Failed to load notifications config"})})}const w7=[{id:"stream-gauges",label:"Stream Gauges",icon:sT},{id:"wildfire",label:"Wildfire",icon:lT},{id:"firms",label:"Satellite Fire Detection (FIRMS)",icon:hT},{id:"fire-tracker",label:"Fire Tracker (Fusion)",icon:yce},{id:"weather-alerts",label:"Weather Alerts",icon:pce},{id:"solar",label:"Solar & Geomagnetic",icon:oY},{id:"ducting",label:"Tropospheric Ducting",icon:ho},{id:"avalanche",label:"Avalanche Danger",icon:cT},{id:"traffic",label:"Traffic Flow",icon:oT},{id:"roads-511",label:"Road Conditions (511)",icon:JZ},{id:"mesh-health",label:"Mesh Health",icon:zv},{id:"broadcast-types",label:"Broadcast Types",icon:Kk},{id:"reminders",label:"Reminder System",icon:Tf},{id:"notifications",label:"Notifications",icon:ey},{id:"commands",label:"Commands",icon:sY},{id:"llm-dm",label:"LLM DM Queries",icon:BN},{id:"or-not-and",label:"OR-not-AND Architecture",icon:iY},{id:"adapter-config",label:"Adapter Config & CODE Rule",icon:$N},{id:"curation",label:"Curation: Gauges & Towns",icon:eY},{id:"schema",label:"Schema Migrations",icon:_ce},{id:"api",label:"API Reference",icon:gce}];function pr({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 p.jsx("span",{className:`inline-block w-3 h-3 rounded-full ${t[e]}`})}function Pt({headers:e,rows:t}){return p.jsx("div",{className:"overflow-x-auto my-4",children:p.jsxs("table",{className:"w-full text-sm",children:[p.jsx("thead",{children:p.jsx("tr",{className:"bg-[#1a2332] border-b border-[#2a3a4a]",children:e.map((r,n)=>p.jsx("th",{className:"px-4 py-2 text-left text-slate-400 font-medium",children:r},n))})}),p.jsx("tbody",{children:t.map((r,n)=>p.jsx("tr",{className:`border-b border-[#1e2a3a] ${n%2===0?"bg-[#0d1219]":"bg-[#0a0e17]"}`,children:r.map((i,a)=>p.jsx("td",{className:"px-4 py-2 text-slate-300",children:i},a))},n))})]})})}function Ht({href:e,children:t}){return p.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-1",children:[t," ",p.jsx(Ud,{size:12})]})}function _e({children:e}){return p.jsx("h3",{className:"text-lg font-semibold text-slate-200 mt-6 mb-3",children:e})}function Dl({children:e}){return p.jsx("h4",{className:"text-base font-medium text-slate-300 mt-4 mb-2",children:e})}function fe({children:e}){return p.jsx("code",{className:"font-mono text-accent bg-[#1a2332] px-1 rounded",children:e})}function Nr({id:e,title:t,children:r}){return p.jsxs("section",{id:e,className:"mb-12 scroll-mt-6",children:[p.jsx("h2",{className:"text-2xl font-bold text-slate-100 mb-4 pb-2 border-b border-[#2a3a4a]",children:t}),p.jsx("div",{className:"text-slate-300 leading-relaxed space-y-4",children:r})]})}function Cet(){const e=Bv(),[t,r]=G.useState(""),[n,i]=G.useState("stream-gauges"),a=G.useRef(null);G.useEffect(()=>{const l=e.hash.replace("#","");if(l&&w7.find(u=>u.id===l)){i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth"})}},[e.hash]);const o=w7.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 p.jsxs("div",{className:"flex h-full -m-6",children:[p.jsxs("aside",{className:"w-64 flex-shrink-0 bg-bg-card border-r border-border overflow-y-auto",children:[p.jsx("div",{className:"p-4 border-b border-border",children:p.jsxs("div",{className:"relative",children:[p.jsx(dT,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),p.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"})]})}),p.jsx("nav",{className:"py-2",children:o.map(l=>{const u=l.icon,c=n===l.id;return p.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:[p.jsx(u,{size:16}),l.label]},l.id)})})]}),p.jsx("div",{ref:a,className:"flex-1 overflow-y-auto p-6",children:p.jsxs("div",{className:"max-w-4xl",children:[p.jsx("p",{className:"text-slate-400 mb-8",children:"Everything you need to understand and configure MeshAI's monitoring and alerting systems."}),p.jsxs(Nr,{id:"stream-gauges",title:"Stream Gauges",children:[p.jsx(_e,{children:"What You're Looking At"}),p.jsx("p",{children:"MeshAI watches river and stream levels at gauges you configure. Each gauge reports two things:"}),p.jsxs("p",{children:[p.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.`]}),p.jsxs("p",{children:[p.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:`]}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsx("li",{children:"A small creek: 50-200 CFS"}),p.jsx("li",{children:"A mid-size river: 1,000-5,000 CFS"}),p.jsx("li",{children:"A big river in spring runoff: 10,000+ CFS"})]}),p.jsx(_e,{children:"When Does It Flood?"}),p.jsxs("p",{children:["Flood levels are set by the ",p.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.']}),p.jsxs("p",{children:[p.jsx("strong",{children:"Action Stage"})," — water is rising, time to start paying attention. Usually still inside the riverbanks."]}),p.jsxs("p",{children:[p.jsx("strong",{children:"Minor Flood"})," — low-lying roads start getting water on them. NWS issues a Flood Advisory."]}),p.jsxs("p",{children:[p.jsx("strong",{children:"Moderate Flood"})," — water in buildings near the river. Some people need to evacuate. NWS issues a Flood Warning."]}),p.jsxs("p",{children:[p.jsx("strong",{children:"Major Flood"})," — widespread flooding. Many people evacuating. Serious property damage."]}),p.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."}),p.jsx(_e,{children:"Low Water / Drought"}),p.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.`}),p.jsx(_e,{children:"Setting It Up"}),p.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:["Find your gauge at ",p.jsx(Ht,{href:"https://waterdata.usgs.gov/nwis",children:"waterdata.usgs.gov/nwis"})]}),p.jsxs("li",{children:["Copy the site number (like ",p.jsx(fe,{children:"13090500"}),")"]}),p.jsx("li",{children:"Add it in Config → Environmental → USGS"}),p.jsx("li",{children:"MeshAI auto-fills the gauge name and flood levels from NWS"})]}),p.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."}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://waterdata.usgs.gov/nwis",children:"USGS Water Data"})," — find gauges near you"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://water.noaa.gov",children:"NWS Water Prediction Service"})," — flood forecasts and thresholds"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.usgs.gov/special-topics/water-science-school/science/how-streamflow-measured",children:"Understanding Streamflow"})," — USGS explainer"]})]})]}),p.jsxs(Nr,{id:"wildfire",title:"Wildfire",children:[p.jsx(_e,{children:"What You're Looking At"}),p.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."}),p.jsx(_e,{children:"Fire Size — How Big Is It?"}),p.jsx(Pt,{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."]]}),p.jsx("p",{children:"For reference, 1,000 acres is about 1.5 square miles."}),p.jsx(_e,{children:"Containment — Is It Under Control?"}),p.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."}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx("strong",{children:"0-30%"})," — Essentially uncontrolled. The fire goes where it wants."]}),p.jsxs("li",{children:[p.jsx("strong",{children:"50%"})," — Good progress, but half the edge can still grow."]}),p.jsxs("li",{children:[p.jsx("strong",{children:"80%+"})," — Well controlled. Major growth unlikely."]}),p.jsxs("li",{children:[p.jsx("strong",{children:"100%"}),' — The edge is fully controlled. But the fire may STILL be actively burning inside. "100% contained" does NOT mean "out."']})]}),p.jsx(_e,{children:"How Far Away Should I Worry?"}),p.jsx(Pt,{headers:["Distance","What To Do"],rows:[[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"red"})," Under 5 km (3 miles)"]}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Immediate threat."})," This is evacuation-order range. Embers can fly this far in wind."]})],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"orange"})," 5-15 km (3-10 miles)"]}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Prepare."})," The fire could reach you in hours under bad conditions. Have a plan."]})],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"yellow"})," 15-30 km (10-20 miles)"]}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Watch."})," Smoke is likely. Wind shifts could change things fast."]})],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"green"})," Over 30 km (20 miles)"]}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Awareness."})," Keep an eye on it, but no immediate threat."]})]]}),p.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."}),p.jsx(_e,{children:"Which Matters More — Size or Distance?"}),p.jsxs("p",{children:[p.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."]}),p.jsx(_e,{children:"Setting It Up"}),p.jsxs("p",{children:["Just configure your state code (like ",p.jsx(fe,{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."]}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://inciweb.nwcg.gov",children:"InciWeb"})," — detailed incident information"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://data-nifc.opendata.arcgis.com",children:"NIFC Fire Map"})," — raw perimeter data"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.ready.gov/wildfires",children:"Ready.gov Wildfires"})," — preparedness guide"]})]})]}),p.jsxs(Nr,{id:"firms",title:"Satellite Fire Detection (FIRMS)",children:[p.jsx(_e,{children:"What You're Looking At"}),p.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.`}),p.jsxs("p",{children:[p.jsx("strong",{children:"Why this matters"}),": satellite hotspots show up ",p.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."]}),p.jsx(_e,{children:"Confidence — Is It Really a Fire?"}),p.jsx("p",{children:"Each detection gets a confidence rating:"}),p.jsx(Pt,{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."]]}),p.jsxs("p",{children:[p.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.`]}),p.jsx(_e,{children:"FRP — How Intense Is It?"}),p.jsx("p",{children:'FRP (Fire Radiative Power) measures the heat output in megawatts. Think of it as "how hot is this thing":'}),p.jsx(Pt,{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"]]}),p.jsx("p",{children:"Setting the minimum FRP to 5 MW filters out most industrial and agricultural false alarms."}),p.jsx(_e,{children:"New Ignition Detection"}),p.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 ",p.jsx("strong",{children:"potential new ignition"})," — maybe a new fire just started. These get elevated priority regardless of confidence level."]}),p.jsx(_e,{children:"Timing"}),p.jsxs("p",{children:["Satellite data arrives ",p.jsx("strong",{children:"1-3 hours"})," after the satellite passes overhead. Each location gets observed about ",p.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."`]}),p.jsx(_e,{children:"Getting an API Key"}),p.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:["Go to ",p.jsx(Ht,{href:"https://firms.modaps.eosdis.nasa.gov/api/area/",children:"FIRMS API page"})]}),p.jsx("li",{children:'Click "Get MAP_KEY"'}),p.jsx("li",{children:"Register for a free Earthdata account"}),p.jsx("li",{children:"Your key arrives by email"}),p.jsx("li",{children:"Enter it in Config → Environmental → FIRMS"})]}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://firms.modaps.eosdis.nasa.gov",children:"FIRMS Fire Map"})," — see hotspots on a map"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://earthdata.nasa.gov/data/tools/firms/faq",children:"FIRMS FAQ"})," — how it works"]})]})]}),p.jsxs(Nr,{id:"fire-tracker",title:"Fire Tracker (Fusion)",children:[p.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."}),p.jsx(_e,{children:"What you'll see on the mesh"}),p.jsx("p",{children:"Six fire-family alert categories, in order of when they fire during an incident's lifecycle:"}),p.jsx(Pt,{headers:["Category","Severity","Trigger","Example broadcast"],rows:[[p.jsx(fe,{children:"unattributed_hotspot_cluster"}),"Priority","3+ FIRMS pixels within 1 mi over 60 min, no WFIGS match — possible new ignition before NIFC declares it",p.jsx("span",{className:"text-amber-300",children:"🔥 Possible new fire: 3 hotspots within 1 mi @ 42.93,-114.45 (combined 78 MW)"})],[p.jsx(fe,{children:"wildfire_declared"}),"Priority","WFIGS first-sight of a new IRWIN incident — the official 'this is a fire and here is its name' record",p.jsx("span",{className:"text-amber-300",children:"🔥 New: Cache Peak Fire (WF), 3 mi N of Almo: 250 ac, 0% contained"})],[p.jsx(fe,{children:"wildfire_growth"}),"Priority","Per-pass centroid drift >= 0.5 mi (configurable) between consecutive satellite passes — the fire's footprint moved",p.jsx("span",{className:"text-amber-300",children:"🔥 Cache Peak Fire moving NE 1.2 mi/h, ~3 mi from Almo"})],[p.jsx(fe,{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",p.jsx("span",{className:"text-amber-300",children:"🔥 Possible spotting 2.1 mi NE of Cache Peak Fire perimeter"})],[p.jsx(fe,{children:"wildfire_incident"}),"Priority","WFIGS acreage or containment increased on a fire already broadcast once (the Update path; the New path uses wildfire_declared)",p.jsx("span",{className:"text-amber-300",children:"🔥 Update: Cache Peak Fire: 1,847 ac, 23% contained"})],[p.jsx(fe,{children:"wildfire_halted"}),"Routine","No FIRMS pixels attributed for 12+ hours (configurable) — fire stalled or out",p.jsx("span",{className:"text-amber-300",children:"🔥 Cache Peak Fire no growth in 14h"})]]}),p.jsx(_e,{children:"Daily LLM digest"}),p.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:"," ",p.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 ",p.jsx(fe,{children:"fires.digest_*"})," ","keys on the Adapter Config page."]}),p.jsx(_e,{children:"How attribution works"}),p.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 ",p.jsx(fe,{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."]}),p.jsxs("p",{children:["Pixels that match no fire feed the cluster detector instead: if at least"," ",p.jsx(fe,{children:"cluster_min_pixels"})," (default 3) lie within"," ",p.jsx(fe,{children:"cluster_max_radius_mi"})," (default 1.0) over"," ",p.jsx(fe,{children:"cluster_time_window_minutes"})," (default 60), the bot fires a single ",p.jsx(fe,{children:"unattributed_hotspot_cluster"})," broadcast and marks the member pixels so a fourth arrival doesn't re-fire the same cluster."]}),p.jsx(_e,{children:"How movement is computed"}),p.jsxs("p",{children:["Each VIIRS pass groups pixels into a ",p.jsx(fe,{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 ≥ ",p.jsx(fe,{children:"growth_drift_threshold_mi"})," the"," ",p.jsx(fe,{children:"wildfire_growth"})," broadcast fires."]}),p.jsx(_e,{children:"How spotting is detected"}),p.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 ≥"," ",p.jsx(fe,{children:"spotting_distance_threshold_mi"})," (default 1.5) fire the"," ",p.jsx(fe,{children:"wildfire_spotting"})," broadcast at ",p.jsx("em",{children:"immediate"})," severity — spread beyond the existing perimeter is the most actionable fire signal we emit. A per-fire cooldown (",p.jsx(fe,{children:"spotting_cooldown_seconds"}),", default 1 h) prevents an ember burst in the same area from spamming the mesh."]}),p.jsx(_e,{children:"Tunable knobs (Adapter Config → fires)"}),p.jsx(Pt,{headers:["Key","Default","What it does"],rows:[[p.jsx(fe,{children:"spread_radius_mi_default"}),"5.0 mi","Attribution radius for FIRMS → fire matching. Per-fire override in the fires.spread_radius_mi column."],[p.jsx(fe,{children:"growth_drift_threshold_mi"}),"0.5 mi","Per-pass centroid drift at or above this fires wildfire_growth."],[p.jsx(fe,{children:"halt_passes_threshold"}),"2","Consecutive empty satellite passes before wildfire_halted (documented; the time gate below is the operational rule)."],[p.jsx(fe,{children:"halt_minimum_seconds"}),"43,200 (12 h)","Minimum elapsed seconds since the most recent attributed pixel before wildfire_halted can fire."],[p.jsx(fe,{children:"spotting_distance_threshold_mi"}),"1.5 mi","Distance from prior-pass perimeter that fires wildfire_spotting."],[p.jsx(fe,{children:"spotting_cooldown_seconds"}),"3,600 (1 h)","Minimum seconds between consecutive spotting broadcasts per fire."],[p.jsx(fe,{children:"digest_enabled"}),"true","Master toggle for the twice-daily digest."],[p.jsx(fe,{children:"digest_schedule"}),'["06:00","18:00"]',"Local-time slots for the digest."],[p.jsx(fe,{children:"digest_timezone"}),"America/Boise","IANA tz for digest_schedule."],[p.jsx(fe,{children:"digest_max_chars"}),"200","Hard cap on the digest wire (the LLM is told to fit; the chunker enforces)."]]})]}),p.jsxs(Nr,{id:"weather-alerts",title:"Weather Alerts",children:[p.jsx(_e,{children:"What You're Looking At"}),p.jsx("p",{children:"MeshAI watches for NWS (National Weather Service) alerts affecting your area — warnings, watches, and advisories."}),p.jsx(_e,{children:"Alert Severity — How Serious Is It?"}),p.jsx(Pt,{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"]]}),p.jsx(_e,{children:"When Should I Act? (Urgency)"}),p.jsx(Pt,{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"]]}),p.jsx(_e,{children:"How Sure Are They? (Certainty)"}),p.jsx(Pt,{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"]]}),p.jsx(_e,{children:"These Are Separate Scales"}),p.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."'}),p.jsx(_e,{children:"What Minimum Severity Should I Set?"}),p.jsx(Pt,{headers:["Setting","What You Get","What You Miss"],rows:[["Minor","Everything — high volume","Nothing"],[p.jsxs(p.Fragment,{children:[p.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"]]}),p.jsxs("p",{children:[p.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."]}),p.jsx(_e,{children:"Finding Your NWS Zone"}),p.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:["Go to ",p.jsx(Ht,{href:"https://www.weather.gov",children:"weather.gov"})]}),p.jsx("li",{children:"Enter your location"}),p.jsxs("li",{children:["Find your zone code at ",p.jsx(Ht,{href:"https://www.weather.gov/pimar/PubZone",children:"NWS Zone Map"})]}),p.jsxs("li",{children:["Zone codes look like: ",p.jsx(fe,{children:"IDZ016"}),", ",p.jsx(fe,{children:"UTZ040"}),", etc."]})]}),p.jsx(_e,{children:"The User-Agent Field"}),p.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:"}),p.jsx("p",{children:p.jsx(fe,{children:"(meshai, you@email.com)"})}),p.jsx("p",{children:"No registration. No waiting. Just type it in."}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://alerts.weather.gov",children:"NWS Active Alerts"})," — see current alerts"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.weather.gov/documentation/services-web-api",children:"NWS API Docs"})," — technical details"]})]})]}),p.jsxs(Nr,{id:"solar",title:"Solar & Geomagnetic Conditions",children:[p.jsx(_e,{children:"What You're Looking At"}),p.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."}),p.jsx(_e,{children:"Solar Flux Index (SFI)"}),p.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.'}),p.jsx(Pt,{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."]]}),p.jsxs("p",{children:[p.jsx("strong",{children:"Quick rule"}),": SFI above 90 and Kp below 4 = good day for HF radio."]}),p.jsx(_e,{children:"Kp Index"}),p.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."}),p.jsx(Pt,{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."],[p.jsx("strong",{children:"5"}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Minor storm (G1)."})," HF noticeably degraded. Aurora visible at high latitudes (~60°N)."]})],[p.jsx("strong",{children:"6"}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Moderate storm (G2)."})," HF getting rough. Aurora moving south (~55°N)."]})],[p.jsx("strong",{children:"7"}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Strong storm (G3)."})," HF unreliable for 1-2 days. Aurora at mid-latitudes."]})],[p.jsx("strong",{children:"8-9"}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Severe/Extreme storm."})," HF may black out completely. Aurora visible at very low latitudes. Power grid stress possible."]})]]}),p.jsx(_e,{children:"R / S / G Scales"}),p.jsx("p",{children:"NOAA's shorthand for three types of space weather events:"}),p.jsx(Dl,{children:"R (Radio Blackouts) — from solar flares:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsx("li",{children:"R1-R2: Brief HF disruption. You might not notice."}),p.jsx("li",{children:"R3: HF goes out for about an hour on the sunlit side of Earth."}),p.jsx("li",{children:"R4-R5: HF dead for hours. Serious."})]}),p.jsx(Dl,{children:"S (Solar Radiation Storms) — from energetic particles:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsx("li",{children:"Mostly affects polar regions and satellites"}),p.jsx("li",{children:"S3+: Polar HF goes out entirely"})]}),p.jsx(Dl,{children:"G (Geomagnetic Storms) — from solar wind disturbances:"}),p.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:p.jsx("li",{children:"Same as the Kp scale: G1 = Kp 5, up to G5 = Kp 9"})}),p.jsx(_e,{children:"Bz — The Storm Predictor"}),p.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."}),p.jsx(Pt,{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."]]}),p.jsx("p",{children:"Bz can change fast — minute to minute. What matters is whether it stays negative for hours, not brief dips."}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.swpc.noaa.gov",children:"SWPC Space Weather Dashboard"})," — live data"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.swpc.noaa.gov/noaa-scales-explanation",children:"NOAA Space Weather Scales"})," — what R/S/G mean"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.hamqsl.com/solar.html",children:"HamQSL Solar Page"})," — ham-friendly display"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.swpc.noaa.gov/products/planetary-k-index",children:"Planetary K-Index"})," — live Kp"]})]})]}),p.jsxs(Nr,{id:"ducting",title:"Tropospheric Ducting",children:[p.jsx(_e,{children:"What You're Looking At"}),p.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.'}),p.jsx("p",{children:"MeshAI watches for these conditions by analyzing weather data (temperature and humidity at different altitudes) over your mesh area."}),p.jsx(_e,{children:"How Do I Know If Ducting Is Happening?"}),p.jsx("p",{children:'MeshAI reports a "condition" based on the atmospheric profile:'}),p.jsx(Pt,{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.']]}),p.jsx(_e,{children:"What You'll Actually Notice"}),p.jsx("p",{children:"When ducting happens on your mesh:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsx("li",{children:"Distant repeaters you've never heard suddenly come in"}),p.jsx("li",{children:"Nodes appear from far outside your normal range"}),p.jsx("li",{children:"You hear FM radio stations from other cities"}),p.jsx("li",{children:"ADS-B flight tracking range gets much longer"}),p.jsx("li",{children:"There might be interference from distant stations on your frequency"})]}),p.jsx(_e,{children:"The dM/dz Number"}),p.jsx("p",{children:`The dashboard shows a "dM/dz" value in "M-units/km." You don't need to understand the math — just know:`}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx("strong",{children:"Around 118"})," = normal atmosphere"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Below 79"})," = enhanced propagation starting"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Below 0 (negative)"})," = ducting is happening"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Below -50"})," = strong ducting — classic VHF/UHF DX event"]})]}),p.jsx(_e,{children:"When Does Ducting Happen?"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsx("li",{children:"Under high-pressure weather systems (clear, stable air)"}),p.jsx("li",{children:"When warm air sits on top of cool air (temperature inversion)"}),p.jsx("li",{children:"Most common in late summer and early fall"}),p.jsx("li",{children:"Strongest along coastlines and over water"}),p.jsx("li",{children:"In mountain valleys: cold air pooling in fall/winter can create surface ducts"})]}),p.jsx(_e,{children:"Setting It Up"}),p.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."}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://dxinfocentre.com/tropo.html",children:"Tropo Forecast Maps (Hepburn)"})," — 6-day tropo prediction"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://dxmaps.com",children:"DX Maps"})," — real-time VHF/UHF propagation reports"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://en.wikipedia.org/wiki/Tropospheric_propagation",children:"Wikipedia: Tropospheric Propagation"})," — background"]})]})]}),p.jsxs(Nr,{id:"avalanche",title:"Avalanche Danger",children:[p.jsx(_e,{children:"What You're Looking At"}),p.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."}),p.jsx(_e,{children:"The Danger Scale"}),p.jsx(Pt,{headers:["Level","Name","Color","What To Do"],rows:[["1","Low",p.jsx(pr,{color:"green"}),"Generally safe. Normal caution in steep terrain."],["2","Moderate",p.jsx(pr,{color:"yellow"}),"Be careful on specific terrain features. Evaluate conditions."],["3","Considerable",p.jsx(pr,{color:"orange"}),p.jsxs(p.Fragment,{children:[p.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",p.jsx(pr,{color:"red"}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Very dangerous."})," Stay off anything steep."]})],["5","Extreme",p.jsx(pr,{color:"black"}),p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Don't go out."})," Avalanches are happening on their own."]})]]}),p.jsx(_e,{children:"The Most Important Thing to Know"}),p.jsxs("p",{children:[p.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.']}),p.jsx(_e,{children:"Seasonal"}),p.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.'}),p.jsx(_e,{children:"Finding Your Avalanche Center"}),p.jsxs("p",{children:["Go to ",p.jsx(Ht,{href:"https://avalanche.org/avalanche-centers/",children:"avalanche.org/avalanche-centers/"})," for a map. Common center codes:"]}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(fe,{children:"SNFAC"})," — Sawtooth (central Idaho)"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"UAC"})," — Utah"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"NWAC"})," — Cascades/Olympics (WA/OR)"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"CAIC"})," — Colorado"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"SAC"})," — Sierra Nevada (CA)"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GNFAC"})," — Gallatin (SW Montana)"]})]}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://avalanche.org",children:"Avalanche.org"})," — US forecasts"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://avalanche.org/avalanche-encyclopedia/human/resources/north-american-public-avalanche-danger-scale/",children:"Avalanche Danger Scale"})," — full scale explanation"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://kbyg.org",children:"Know Before You Go"})," — avalanche awareness"]})]})]}),p.jsxs(Nr,{id:"traffic",title:"Traffic Flow",children:[p.jsx(_e,{children:"What You're Looking At"}),p.jsx("p",{children:"MeshAI monitors traffic speed on road segments you configure, using data from TomTom (real vehicles with navigation apps reporting their speed)."}),p.jsx(_e,{children:"Speed Ratio — The Key Number"}),p.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:'}),p.jsx(Pt,{headers:["Ratio","What It Means"],rows:[[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"green"})," Above 85%"]}),"Normal. Traffic flowing fine."],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"yellow"})," 65-85%"]}),"Slow. Heavier than usual but moving."],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"orange"})," 40-65%"]}),"Congested. Significant delays."],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"red"})," Below 40%"]}),"Gridlock. Barely moving."]]}),p.jsxs("p",{children:[p.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.`]}),p.jsx(_e,{children:"Confidence — Can You Trust the Data?"}),p.jsx("p",{children:"TomTom's confidence score tells you how much of the reading comes from real vehicles right now vs historical averages:"}),p.jsx(Pt,{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",p.jsxs(p.Fragment,{children:[p.jsx("strong",{children:"Unreliable"})," — mostly guessing from historical patterns. Don't alert on this."]})]]}),p.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."}),p.jsx(_e,{children:"Setting Up Corridors"}),p.jsx("p",{children:'Each "corridor" is a point on a road you want to monitor. To add one:'}),p.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[p.jsx("li",{children:"Go to Google Maps, find the road"}),p.jsx("li",{children:`Right-click the road → "What's here?" → copy the coordinates`}),p.jsx("li",{children:"Add the corridor in Config with a name and those coordinates"}),p.jsx("li",{children:"TomTom finds the nearest road segment automatically"})]}),p.jsx(_e,{children:"Getting an API Key"}),p.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:["Sign up at ",p.jsx(Ht,{href:"https://developer.tomtom.com",children:"developer.tomtom.com"})," (free)"]}),p.jsx("li",{children:"Create an app → get your API key"}),p.jsx("li",{children:"Free tier: 2,500 requests/day (plenty for 5-10 corridors)"})]}),p.jsx(_e,{children:"Learn More"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(Ht,{href:"https://developer.tomtom.com",children:"TomTom Developer Portal"})," — API docs and key signup"]}),p.jsxs("li",{children:[p.jsx(Ht,{href:"https://www.tomtom.com/traffic-index/",children:"TomTom Traffic Index"})," — city congestion rankings"]})]})]}),p.jsxs(Nr,{id:"roads-511",title:"Road Conditions (511)",children:[p.jsx(_e,{children:"What You're Looking At"}),p.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."}),p.jsx(_e,{children:"Setting It Up"}),p.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."}),p.jsx("p",{children:"Configure in Config → Environmental → 511:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx("strong",{children:"Base URL"})," — your state's API endpoint"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"API Key"})," — if required by your state"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Endpoints"})," — which data feeds to poll (varies by state)"]})]}),p.jsx(_e,{children:"Learn More"}),p.jsx("p",{children:"Check your state's 511 or DOT website for developer information."})]}),p.jsxs(Nr,{id:"mesh-health",title:"Mesh Health",children:[p.jsx(_e,{children:"Health Score"}),p.jsx("p",{children:"MeshAI computes a 0-100 health score for your mesh network by looking at five areas, each weighted differently:"}),p.jsx(Pt,{headers:["Pillar","Weight","What It Measures"],rows:[[p.jsx("strong",{children:"Infrastructure"}),"30%","Are your routers online?"],[p.jsx("strong",{children:"Utilization"}),"25%","Is the radio channel congested?"],[p.jsx("strong",{children:"Coverage"}),"20%","Do nodes have redundant paths to gateways?"],[p.jsx("strong",{children:"Behavior"}),"15%","Are any nodes flooding the channel?"],[p.jsx("strong",{children:"Power"}),"10%","Are battery-powered nodes running low?"]]}),p.jsx("p",{children:"The overall score is the weighted sum:"}),p.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%)"}),p.jsx(_e,{children:"How Each Pillar Is Calculated"}),p.jsx(Dl,{children:"Infrastructure (30%)"}),p.jsx("p",{children:"This is the simplest pillar — what percentage of your infrastructure nodes are currently online?"}),p.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"(routers online ÷ total routers) × 100"}),p.jsxs("p",{children:["Only nodes with the ",p.jsx(fe,{children:"ROUTER"}),", ",p.jsx(fe,{children:"ROUTER_LATE"}),", or ",p.jsx(fe,{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."]}),p.jsxs("p",{children:[p.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."]}),p.jsx(Dl,{children:"Utilization (25%)"}),p.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 ",p.jsx("strong",{children:"highest"})," value from any infrastructure node because the busiest router is the bottleneck for the whole mesh."]}),p.jsx("p",{children:p.jsx("strong",{children:"How it works:"})}),p.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-4",children:[p.jsxs("li",{children:["Collect ",p.jsx(fe,{children:"channel_utilization"})," from all infrastructure nodes that report it"]}),p.jsx("li",{children:"If no infra nodes have telemetry, try all nodes"}),p.jsxs("li",{children:["Use the ",p.jsx("strong",{children:"maximum"})," value for scoring (busiest node = bottleneck)"]}),p.jsx("li",{children:"If no nodes report utilization (older firmware), fall back to packet count estimate"})]}),p.jsxs("p",{className:"mt-4",children:[p.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."]}),p.jsx(Pt,{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"]]}),p.jsxs("p",{children:[p.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."]}),p.jsx(Dl,{children:"Coverage (20%)"}),p.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.'}),p.jsxs("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:["coverage_ratio = average_gateways_per_node ÷ total_sources",p.jsx("br",{}),"single_gw_penalty = (single_gateway_nodes ÷ total_nodes) × 40"]}),p.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."}),p.jsx(Pt,{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"]]}),p.jsxs("p",{children:[p.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.)."]}),p.jsx(Dl,{children:"Behavior (15%)"}),p.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."}),p.jsxs("p",{children:[p.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."]}),p.jsx(Pt,{headers:["Flagged Nodes","Score"],rows:[["0","100"],["1","80"],["2-3","60"],["4-5","40"],["6+","20"]]}),p.jsx("p",{children:"A single misbehaving node only drops the score to 80. It takes multiple problem nodes to seriously hurt the behavior pillar."}),p.jsx(Dl,{children:"Power (10%)"}),p.jsx("p",{children:"Measures what fraction of battery-powered nodes are below the warning threshold (default 20%)."}),p.jsx("p",{className:"p-3 bg-slate-800 rounded font-mono text-sm",children:"100 × (1 − low_battery_nodes ÷ total_battery_nodes)"}),p.jsx("p",{children:"If 2 out of 10 battery nodes are below 20%, power scores 80."}),p.jsxs("p",{children:[p.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."]}),p.jsx(_e,{children:"Health Tiers"}),p.jsx(Pt,{headers:["Score","Tier","What It Means"],rows:[["90-100",p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"green"})," Healthy"]}),"Everything's working well."],["75-89",p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"yellow"})," Slight degradation"]}),"Some issues but the mesh is functional."],["50-74",p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"orange"})," Unhealthy"]}),"Multiple problems. Reliability is affected."],["25-49",p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"red"})," Warning"]}),"Significant issues. The mesh is struggling."],["0-24",p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"black"})," Critical"]}),"Major failures. Barely functional."]]}),p.jsx(_e,{children:"Channel Utilization — Is the Radio Channel Full?"}),p.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."}),p.jsx(Pt,{headers:["Utilization","What's Happening"],rows:[[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"green"})," Under 25%"]}),"Healthy. The firmware itself starts throttling above 25% to protect the channel — so under 25% is the target."],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"yellow"})," 25-40%"]}),"Getting busy. Common on larger meshes. Worth watching."],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"orange"})," 40-50%"]}),"Congested. The firmware throttles GPS updates above 40%. Messages are colliding and retrying."],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"red"})," Over 50%"]}),"Serious problem. More time is spent retrying than communicating. Mesh reliability drops fast."],[p.jsxs(p.Fragment,{children:[p.jsx(pr,{color:"black"})," Over 65%"]}),"Documented failure point on busy LONG_FAST meshes. The mesh becomes unusable."]]}),p.jsx(_e,{children:"Packet Flooding"}),p.jsx("p",{className:"p-3 bg-yellow-500/10 border border-yellow-500/30 rounded text-yellow-200",children:p.jsx("strong",{children:'⚠️ "Packet flooding" means a node sending too many RADIO PACKETS. This has nothing to do with water flooding.'})}),p.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."}),p.jsx(Pt,{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."]]}),p.jsx(_e,{children:"Battery Levels"}),p.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:"}),p.jsx(Pt,{headers:["Voltage","Charge","What To Do"],rows:[["4.20V","100%","Full"],["3.80V","~60%","Fine"],[p.jsx("strong",{children:"3.60V"}),p.jsx("strong",{children:"~30%"}),p.jsx(p.Fragment,{children:p.jsx("strong",{children:"⚠️ Warning — charge it soon"})})],[p.jsx("strong",{children:"3.50V"}),p.jsx("strong",{children:"~15%"}),p.jsx(p.Fragment,{children:p.jsx("strong",{children:"🔴 Low — charge it now"})})],[p.jsx("strong",{children:"3.40V"}),p.jsx("strong",{children:"~7%"}),p.jsx(p.Fragment,{children:p.jsx("strong",{children:"⚫ About to die"})})],["3.30V","~3%","Device shutting down"]]}),p.jsxs("p",{children:[p.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."]}),p.jsx(_e,{children:"Node Offline Detection"}),p.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:`}),p.jsx(Pt,{headers:["Node Type","Recommended Threshold","Why"],rows:[["Fixed infrastructure (wall power)",p.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."]]}),p.jsxs("p",{children:[p.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.`]})]}),p.jsxs(Nr,{id:"broadcast-types",title:"Broadcast Types",children:[p.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:"}),p.jsx(Pt,{headers:["Prefix","What it means","When you see it"],rows:[[p.jsx(fe,{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"],[p.jsx(fe,{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"],[p.jsx(fe,{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"]]}),p.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."})]}),p.jsxs(Nr,{id:"reminders",title:"Reminder System",children:[p.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"," ",p.jsx(fe,{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."]}),p.jsx(_e,{children:"Cadences"}),p.jsx(Pt,{headers:["Adapter","Reminder cadence","Termination"],rows:[[p.jsxs(p.Fragment,{children:[p.jsx(fe,{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"],[p.jsxs(p.Fragment,{children:[p.jsx(fe,{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"],[p.jsx(fe,{children:"itd_511_work_zone"}),"Per-zone, configurable in the rule UI","WZDx publishes the zone with end_date in the past"]]}),p.jsx(_e,{children:"The tombstone"}),p.jsxs("p",{children:["When a WFIGS update declares an incident closed, the bot stamps"," ",p.jsx(fe,{children:"fires.tombstoned_at"})," with the close time. The reminder scheduler treats ",p.jsx(fe,{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.`]}),p.jsx(_e,{children:"Turning reminders off"}),p.jsxs("p",{children:["Per-adapter on/off lives in ",p.jsx(fe,{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."]})]}),p.jsxs(Nr,{id:"notifications",title:"Notifications",children:[p.jsx(_e,{children:"How It Works"}),p.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx("strong",{children:"Something happens"})," — a fire is detected, weather warning issued, node goes offline, etc."]}),p.jsxs("li",{children:[p.jsx("strong",{children:"MeshAI checks your rules"})," — does this event match any of your notification rules? Is it severe enough?"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"If a rule matches"})," — MeshAI sends the notification through whatever delivery method that rule is configured for."]})]}),p.jsx(_e,{children:"Building Rules"}),p.jsx("p",{children:"Each rule answers three questions:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx("strong",{children:"WHEN"})," does it trigger? (which categories, what severity)"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"WHERE"})," does it send? (mesh broadcast, email, webhook, etc.)"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"HOW OFTEN"})," at most? (cooldown period)"]})]}),p.jsx("p",{children:'Use "Add from Template" to start with a pre-built rule and customize it, or build from scratch with "Add Rule."'}),p.jsx(_e,{children:"Severity Levels — What Should I Set?"}),p.jsx(Pt,{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"],[p.jsxs(p.Fragment,{children:[p.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"]]}),p.jsxs("p",{children:[p.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."]}),p.jsx(_e,{children:"Webhook — The Swiss Army Knife"}),p.jsx("p",{children:"A webhook sends your alert as an HTTP POST to any URL. This one delivery method works with:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx("strong",{children:"Discord"})," — use a Discord webhook URL"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Slack"})," — use a Slack incoming webhook URL"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"ntfy.sh"})," — POST to ",p.jsx(fe,{children:"https://ntfy.sh/your-topic"})]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Pushover"})," — POST to the Pushover API"]}),p.jsxs("li",{children:[p.jsx("strong",{children:"Home Assistant"})," — POST to an automation webhook URL"]}),p.jsx("li",{children:"Anything else that accepts HTTP POST"})]}),p.jsx("p",{children:"MeshAI doesn't need to know what's on the other end. Give it the URL and it works."})]}),p.jsxs(Nr,{id:"commands",title:"Commands",children:[p.jsxs("p",{children:["All commands use the ",p.jsx(fe,{children:"!"})," prefix (configurable). Send these as a direct message to MeshAI on your mesh."]}),p.jsx(_e,{children:"Basic Commands"}),p.jsx(Pt,{headers:["Command","What It Does"],rows:[[p.jsx(fe,{children:"!help"}),"Shows all available commands"],[p.jsx(fe,{children:"!ping"}),"Tests if the bot is alive"],[p.jsx(fe,{children:"!status"}),"Quick mesh summary (nodes online, health score)"],[p.jsx(fe,{children:"!health"}),"Detailed health report with pillar scores"],[p.jsx(fe,{children:"!weather"}),"Current weather for your area"]]}),p.jsx(_e,{children:"Environmental Commands"}),p.jsx(Pt,{headers:["Command","What It Does"],rows:[[p.jsx(fe,{children:"!alerts"}),"Active NWS weather alerts for your area"],[p.jsxs(p.Fragment,{children:[p.jsx(fe,{children:"!solar"})," (or ",p.jsx(fe,{children:"!hf"}),")"]}),"Current solar indices and RF conditions"],[p.jsx(fe,{children:"!fire"}),"Active wildfires near your mesh"],[p.jsx(fe,{children:"!avy"}),'Avalanche advisory (seasonal — shows "off season" in summer)'],[p.jsxs(p.Fragment,{children:[p.jsx(fe,{children:"!streams"})," (or ",p.jsx(fe,{children:"!gauges"}),")"]}),"Stream gauge readings"],[p.jsxs(p.Fragment,{children:[p.jsx(fe,{children:"!roads"})," (or ",p.jsx(fe,{children:"!traffic"}),")"]}),"Road conditions and traffic flow"],[p.jsx(fe,{children:"!hotspots"}),"Satellite fire detections"]]}),p.jsx(_e,{children:"Subscription Commands"}),p.jsx(Pt,{headers:["Command","What It Does"],rows:[[p.jsx(fe,{children:"!subscribe"}),"Lists all alert categories you can subscribe to"],[p.jsx(fe,{children:"!subscribe fire_proximity"}),"Subscribe to a specific category"],[p.jsx(fe,{children:"!subscribe all"}),"Subscribe to everything"],[p.jsx(fe,{children:"!unsubscribe fire_proximity"}),"Unsubscribe from a category"],[p.jsx(fe,{children:"!subscriptions"}),"Shows what you're currently subscribed to"]]}),p.jsx(_e,{children:"Conversational"}),p.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`," ",p.jsx("a",{href:"#llm-dm",className:"text-accent hover:underline",children:"LLM DM Queries"}),"."]})]}),p.jsxs(Nr,{id:"llm-dm",title:"LLM DM (Natural-Language Queries)",children:[p.jsxs("p",{children:["Bang commands like ",p.jsx(fe,{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."]}),p.jsx(_e,{children:"What it can answer"}),p.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:"}),p.jsx(Pt,{headers:["Adapter block","Example question that hits it","What you get back"],rows:[[p.jsx(fe,{children:"build_fires_detail"}),'"are there any fires near me?"',"Active WFIGS-declared fires, acreage, containment, declared_at, county/state"],[p.jsx(fe,{children:"build_alerts_detail"}),'"any weather alerts?"',"Active NWS CAP alerts: type, severity, area, expiry"],[p.jsx(fe,{children:"build_quakes_detail"}),'"any earthquakes nearby?"',"USGS quakes in the last 24h: magnitude, depth, place"],[p.jsx(fe,{children:"build_traffic_detail"}),'"how is traffic on I-84?" / "any road closures?"',"TomTom + ITD 511 active incidents"],[p.jsx(fe,{children:"build_gauges_detail"}),'"what is the snake river level?"',"USGS NWIS latest readings + flood stages"],[p.jsx(fe,{children:"build_swpc_detail"}),'"what are the band conditions?" / "any space weather?"',"Recent SWPC events + band-conditions ratings"],[p.jsx(fe,{children:"build_drop_audit"}),`"why didn't I hear about anything today?"`,"Event log: what envelopes the dispatcher filtered, by adapter + category"]]}),p.jsx(_e,{children:"The grounding rule"}),p.jsxs("p",{children:["The bot is told to answer ",p.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.']}),p.jsx(_e,{children:"Excluding an adapter from LLM context"}),p.jsxs("p",{children:["The ",p.jsx(fe,{children:"include_in_llm_context"})," toggle on each adapter's row in Adapter Config decides whether that adapter's ",p.jsx(fe,{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."]}),p.jsx(_e,{children:"What it can't answer"}),p.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.`})]}),p.jsxs(Nr,{id:"or-not-and",title:"OR-not-AND Architecture",children:[p.jsx("p",{children:"Every environmental adapter pulls its data from one of two places:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.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."]}),p.jsxs("li",{children:[p.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."]})]}),p.jsx(_e,{children:"Why mutually exclusive"}),p.jsxs("p",{children:["An adapter is set to ",p.jsx("strong",{children:"either"})," Central ",p.jsx("strong",{children:"or"})," ","native, never both. Running both at the same time is what the codebase calls the ",p.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."]}),p.jsx(_e,{children:"The per-adapter source toggle"}),p.jsxs("p",{children:["Set ",p.jsx(fe,{children:"feed_source"})," on each adapter's row in Environment:"]}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(fe,{children:"central"})," — disable the native poll loop, subscribe to the matching Central subject pattern."]}),p.jsxs("li",{children:[p.jsx(fe,{children:"native"})," — disable the Central subscription for this adapter, run the native poller."]})]}),p.jsxs("p",{children:["On the GUI, adapters with ",p.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.`]}),p.jsx(_e,{children:"Where this surfaces in tooltips"}),p.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`," ",p.jsxs(fe,{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."]})]}),p.jsxs(Nr,{id:"adapter-config",title:"Adapter Config & the CODE Rule",children:[p.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."}),p.jsx(_e,{children:"The CONFIG-vs-CODE rule"}),p.jsx("p",{children:"Not everything tunable becomes a GUI row. The codebase splits along one rule:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.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)."]}),p.jsxs("li",{children:[p.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)."]})]}),p.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."}),p.jsx(_e,{children:"Restart-required vs live"}),p.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:"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:["Anything under the ",p.jsx(fe,{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."]}),p.jsx("li",{children:"The LLM backend swap (Google → Anthropic → OpenAI)."}),p.jsx("li",{children:"The dispatcher cold-start grace window."})]}),p.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.`}),p.jsxs(_e,{children:["The ",p.jsx(fe,{children:"include_in_llm_context"})," toggle"]}),p.jsxs("p",{children:[`Each adapter's card on Adapter Config carries a per-adapter "LLM context" switch. When off, that adapter's `,p.jsx(fe,{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."]})]}),p.jsxs(Nr,{id:"curation",title:"Curation: Gauge Sites & Town Anchors",children:[p.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."}),p.jsx(_e,{children:"Gauge Sites"}),p.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."}),p.jsxs("p",{children:[p.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."]}),p.jsxs("p",{children:[p.jsx("strong",{children:"Disabled rows"})," are ignored at dispatch time. The corresponding gauge still ingests into ",p.jsx(fe,{children:"gauge_readings"})," ","(so historical queries still work), it just doesn't broadcast."]}),p.jsx(_e,{children:"Town Anchors"}),p.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:']}),p.jsxs("ol",{className:"list-decimal list-inside ml-4 space-y-1",children:[p.jsx("li",{children:'Photon nearest-town lookup (the WFIGS path uses this — produces "near Long Creek Summit Home" style anchors)'}),p.jsx("li",{children:"Town Anchors table (your curated list)"}),p.jsx("li",{children:"Landclass label (county / federal-land identifier)"}),p.jsx("li",{children:"County + state fallback"}),p.jsx("li",{children:"Bare lat/lon coords"})]}),p.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.'}),p.jsxs("p",{children:["Example broadcast text rendered from a Town Anchors row:"," ",p.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"'})]})]}),p.jsxs(Nr,{id:"schema",title:"Schema Migrations",children:[p.jsxs("p",{children:["MeshAI persists state in a single SQLite database (",p.jsx(fe,{children:"/data/meshai.sqlite"}),") with WAL journaling. Schema migrations live in ",p.jsx(fe,{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 ",p.jsx(fe,{children:"schema_meta.version"})," in order. Idempotent re-runs are no-ops."]}),p.jsx(_e,{children:"v0.6 + v0.7 additions"}),p.jsx(Pt,{headers:["Migration","What it added"],rows:[[p.jsx(fe,{children:"v11"}),"first_broadcast_at + last_broadcast_at split + reminder_enabled per adapter (the schema basis for New / Update / Active)"],[p.jsx(fe,{children:"v12"}),"fires.tombstoned_at (WFIGS closure stamp; terminates the reminder loop)"],[p.jsx(fe,{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"],[p.jsx(fe,{children:"v14"}),"Fire Tracker Phase 2 — fire_passes table (per-satellite-pass centroid + drift) + last_pass_id + halt_broadcast_at on fires"],[p.jsx(fe,{children:"v15"}),"Fire Tracker Phase 3 — fire_passes.perimeter_geojson (convex hull) + fires.last_spotting_broadcast_at"],[p.jsx(fe,{children:"v16"}),"Fire Tracker Phase 4 — fire_digest_broadcasts table (idempotent twice-daily LLM digest)"]]}),p.jsx(_e,{children:"When migrations fail"}),p.jsxs("p",{children:["A migration failure leaves the database at the prior version and raises in the runner. Container logs surface the SQL error;"," ",p.jsx(fe,{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."]})]}),p.jsxs(Nr,{id:"api",title:"API Reference",children:[p.jsxs("p",{children:["MeshAI's REST API is available at ",p.jsx(fe,{children:"http://your-host:8080"}),". All endpoints return JSON."]}),p.jsx(_e,{children:"System"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/status"})," — version, uptime, node count"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/channels"})," — radio channel list"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"POST /api/restart"})," — restart the bot"]})]}),p.jsx(_e,{children:"Mesh Data"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/health"})," — health score and pillars"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/nodes"})," — all nodes with positions and telemetry"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/edges"})," — neighbor links with signal quality"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/regions"})," — region summaries"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/sources"})," — data source health"]})]}),p.jsx(_e,{children:"Configuration"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/config"})," — full config"]}),p.jsxs("li",{children:[p.jsxs(fe,{children:["GET /api/config/","{section}"]})," — one section"]}),p.jsxs("li",{children:[p.jsxs(fe,{children:["PUT /api/config/","{section}"]})," — update a section"]})]}),p.jsx(_e,{children:"Environmental"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/env/status"})," — per-feed health"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/env/active"})," — all active events"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/env/swpc"})," — solar/geomagnetic data"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/env/ducting"})," — atmospheric profile"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/env/fires"})," — wildfire perimeters"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/env/hotspots"})," — satellite fire detections"]})]}),p.jsx(_e,{children:"Alerts"}),p.jsxs("ul",{className:"list-disc list-inside ml-4 space-y-1",children:[p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/alerts/active"})," — current alerts"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/alerts/history"})," — past alerts"]}),p.jsxs("li",{children:[p.jsx(fe,{children:"GET /api/notifications/categories"})," — available alert categories"]})]}),p.jsx(_e,{children:"Real-time"}),p.jsx("ul",{className:"list-disc list-inside ml-4 space-y-1",children:p.jsxs("li",{children:[p.jsx(fe,{children:"ws://your-host:8080/ws/live"})," — WebSocket for live updates"]})})]})]})})]})}const Aet=1500;function Met(){const[e,t]=G.useState({}),[r,n]=G.useState({}),[i,a]=G.useState(!0),[o,s]=G.useState(null),[l,u]=G.useState({}),[c,f]=G.useState({}),[h,d]=G.useState({}),v=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(()=>{v()},[v]);const m=G.useCallback((S,T,C)=>{f(A=>({...A,[S]:T})),C&&d(A=>({...A,[S]:C})),T==="saved"&&setTimeout(()=>{f(A=>A[S]==="saved"?{...A,[S]:"idle"}:A)},Aet)},[]),y=G.useCallback(async(S,T,C)=>{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:C})});if(!P.ok){const E=(await P.json().catch(()=>({}))).detail||P.statusText;m(A,"error",String(E));return}const I=await P.json();t(k=>({...k,[S]:(k[S]||[]).map(E=>E.key===T?I:E)})),m(A,"saved")}catch(P){m(A,"error",String(P))}},[m]),x=G.useCallback(async(S,T)=>{const C=`${S}.${T}`;m(C,"saving");try{const A=await fetch(`/api/adapter-config/${S}/${T}/reset`,{method:"POST"});if(!A.ok){m(C,"error",`reset failed (${A.status})`);return}const P=await A.json();t(I=>({...I,[S]:(I[S]||[]).map(k=>k.key===T?P:k)})),m(C,"saved")}catch(A){m(C,"error",String(A))}},[m]),_=G.useCallback(async(S,T)=>{const C=`meta:${S}`;m(C,"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(C,"error",String(I.detail||A.statusText));return}const P=await A.json();n(I=>({...I,[S]:P})),m(C,"saved")}catch(A){m(C,"error",String(A))}},[m]);if(i)return p.jsxs("div",{className:"p-6 flex items-center gap-2 text-slate-400",children:[p.jsx(T0,{className:"w-5 h-5 animate-spin"})," Loading adapter config…"]});if(o)return p.jsxs("div",{className:"p-6 text-red-400",children:[p.jsx(Mu,{className:"w-5 h-5 inline mr-2"}),"Failed to load: ",o]});const b=Array.from(new Set([...Object.keys(r),...Object.keys(e)])).sort();return p.jsxs("div",{className:"p-6 space-y-4",children:[p.jsxs("div",{className:"flex items-center gap-2 text-slate-200",children:[p.jsx($N,{className:"w-5 h-5"}),p.jsx("h1",{className:"text-xl font-semibold",children:"Adapter Config"}),p.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[Object.values(e).reduce((S,T)=>S+T.length,0)," settings across ",b.length," adapters"]})]}),p.jsxs("p",{className:"text-xs text-slate-400 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 ",p.jsx("a",{href:"/reference#adapter-config",className:"text-accent hover:underline",children:"Adapter Config & the CODE Rule"})," in Reference. The ",p.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."]}),b.map(S=>{const T=r[S]||{display_name:S,include_in_llm_context:!0,description:""},C=e[S]||[],A=l[S]??!1,P=`meta:${S}`,I=c[P]||"idle";return p.jsxs("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg",children:[p.jsxs("div",{className:"p-4 flex items-start gap-4",children:[p.jsx("button",{onClick:()=>u(k=>({...k,[S]:!k[S]})),className:"text-slate-400 hover:text-white","aria-label":"toggle expand",children:A?p.jsx(Bu,{className:"w-5 h-5"}):p.jsx(Au,{className:"w-5 h-5"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("h2",{className:"text-base font-semibold text-slate-100",children:T.display_name}),p.jsx("code",{className:"text-xs text-slate-500",children:S}),C.length>0&&p.jsxs("span",{className:"text-xs text-slate-400 ml-1",children:["(",C.length," settings)"]}),C.length===0&&p.jsx("span",{className:"text-xs text-slate-500 ml-1 italic",children:"(meta only)"})]}),T.description&&p.jsx("p",{className:"text-xs text-slate-400 mt-1",children:T.description})]}),p.jsxs("label",{className:"flex items-center gap-2 text-xs text-slate-300 select-none",children:[p.jsx("input",{type:"checkbox",checked:T.include_in_llm_context,onChange:k=>_(S,{include_in_llm_context:k.target.checked}),className:"w-4 h-4 accent-cyan-500"}),"LLM context",p.jsx(Tae,{status:I,error:h[P]})]})]}),A&&C.length>0&&p.jsx("div",{className:"border-t border-slate-700 divide-y divide-slate-700/60",children:C.map(k=>p.jsx(Pet,{row:k,status:c[`${S}.${k.key}`]||"idle",error:h[`${S}.${k.key}`],onCommit:E=>y(S,k.key,E),onReset:()=>x(S,k.key)},k.key))})]},S)})]})}function Pet({row:e,status:t,error:r,onCommit:n,onReset:i}){const[a,o]=G.useState(JP(e));G.useEffect(()=>{o(JP(e))},[e.value,e.type]);const s=a!==JP(e),l=JSON.stringify(e.value)===JSON.stringify(e.default),u=()=>{const c=ket(a,e.type);c.error||c.changed(e.value)&&n(c.value)};return p.jsxs("div",{className:"px-6 py-3 flex items-start gap-4",children:[p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("code",{className:"text-sm font-mono text-cyan-300",children:e.key}),p.jsxs("span",{className:"text-xs text-slate-500",children:["[",e.type,"]"]}),!l&&p.jsx("span",{className:"text-xs text-amber-400",children:"edited"})]}),e.description&&p.jsx("p",{className:"text-xs text-slate-400 mt-1",children:e.description})]}),p.jsxs("div",{className:"flex items-center gap-2 min-w-[280px] justify-end",children:[e.type==="bool"?p.jsx("input",{type:"checkbox",checked:e.value===!0,onChange:c=>n(c.target.checked),className:"w-5 h-5 accent-cyan-500"}):e.type==="json"?p.jsx("textarea",{className:"w-72 h-20 bg-slate-900 border border-slate-700 rounded px-2 py-1 text-xs font-mono text-slate-100",value:a,onChange:c=>o(c.target.value),onBlur:u}):p.jsx("input",{type:e.type==="int"||e.type==="float"?"number":"text",step:e.type==="float"?"any":"1",className:"w-48 bg-slate-900 border border-slate-700 rounded px-2 py-1 text-sm text-slate-100",value:a,onChange:c=>o(c.target.value),onBlur:u,onKeyDown:c=>{c.key==="Enter"&&c.target.blur()}}),p.jsx(Tae,{status:t,error:r,dirty:s}),p.jsx("button",{onClick:i,disabled:l,className:"text-slate-400 hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",title:"Reset to default",children:p.jsx(fT,{className:"w-4 h-4"})})]})]})}function Tae({status:e,error:t,dirty:r}){return e==="saving"?p.jsx(T0,{className:"w-4 h-4 text-cyan-400 animate-spin"}):e==="saved"?p.jsx(ts,{className:"w-4 h-4 text-emerald-400"}):e==="error"?p.jsx("span",{title:t,className:"text-red-400 cursor-help",children:p.jsx(Mu,{className:"w-4 h-4"})}):r?p.jsx("span",{className:"w-2 h-2 bg-amber-400 rounded-full",title:"unsaved"}):p.jsx("span",{className:"w-4 h-4"})}function JP(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 ket(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 QP={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 Let(){const[e,t]=G.useState([]),[r,n]=G.useState(!0),[i,a]=G.useState(null),[o,s]=G.useState(null),[l,u]=G.useState(QP),[c,f]=G.useState(!1),[h,d]=G.useState("unknown"),v=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(()=>{v()},[v]),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}),f(!1)},y=()=>{f(!0),s(null),u({...QP})},x=()=>{s(null),f(!1),u(QP)},_=async()=>{try{const S=c?"/api/gauge-sites":`/api/gauge-sites/${o}`,C=await fetch(S,{method:c?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!C.ok){const A=await C.json().catch(()=>({}));alert(`save failed: ${A.detail||C.statusText}`);return}x(),v()}catch(S){alert(String(S))}},b=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}v()};return r?p.jsxs("div",{className:"p-6 text-slate-400",children:[p.jsx(T0,{className:"w-5 h-5 animate-spin inline mr-2"}),"Loading…"]}):i?p.jsxs("div",{className:"p-6 text-red-400",children:["Load failed: ",i]}):p.jsxs("div",{className:"p-6 space-y-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(sT,{className:"w-5 h-5 text-cyan-400"}),p.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:"Gauge Sites"}),p.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[e.length," sites"]}),p.jsxs("button",{onClick:y,className:"ml-auto flex items-center gap-1 px-3 py-1 bg-cyan-700 hover:bg-cyan-600 rounded text-white text-sm",children:[p.jsx(Fv,{className:"w-4 h-4"})," Add site"]})]}),p.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&&p.jsx(S7,{draft:l,setDraft:u,onSave:_,onCancel:x,adding:!0,feedSource:h}),p.jsx("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg overflow-x-auto",children:p.jsxs("table",{className:"w-full text-sm text-slate-200",children:[p.jsx("thead",{className:"bg-slate-900 text-xs text-slate-400 uppercase",children:p.jsxs("tr",{children:[p.jsx("th",{className:"px-3 py-2 text-left",children:"Site ID"}),p.jsx("th",{className:"px-3 py-2 text-left",children:"Name"}),p.jsx("th",{className:"px-3 py-2 text-right",children:"Lat,Lon"}),p.jsx("th",{className:"px-3 py-2 text-right",children:"Action"}),p.jsx("th",{className:"px-3 py-2 text-right",children:"Minor"}),p.jsx("th",{className:"px-3 py-2 text-right",children:"Moderate"}),p.jsx("th",{className:"px-3 py-2 text-right",children:"Major"}),p.jsx("th",{className:"px-3 py-2 text-center",children:"On"}),p.jsx("th",{className:"px-3 py-2"})]})}),p.jsx("tbody",{className:"divide-y divide-slate-700/60",children:e.map(S=>o===S.site_id?p.jsx("tr",{className:"bg-slate-900/40",children:p.jsx("td",{colSpan:9,className:"px-3 py-2",children:p.jsx(S7,{draft:l,setDraft:u,onSave:_,onCancel:x,feedSource:h})})},S.site_id):p.jsxs("tr",{className:"hover:bg-slate-800/50",children:[p.jsx("td",{className:"px-3 py-2 font-mono text-xs",children:S.site_id}),p.jsx("td",{className:"px-3 py-2",children:S.gauge_name}),p.jsxs("td",{className:"px-3 py-2 text-right text-xs",children:[S.lat.toFixed(3),",",S.lon.toFixed(3)]}),p.jsx("td",{className:"px-3 py-2 text-right",children:S.action_ft??"-"}),p.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_minor_ft??"-"}),p.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_moderate_ft??"-"}),p.jsx("td",{className:"px-3 py-2 text-right",children:S.flood_major_ft??"-"}),p.jsx("td",{className:"px-3 py-2 text-center",children:S.enabled?p.jsx(ts,{className:"w-4 h-4 text-emerald-400 inline"}):p.jsx(vo,{className:"w-4 h-4 text-slate-500 inline"})}),p.jsxs("td",{className:"px-3 py-2 text-right",children:[p.jsx("button",{onClick:()=>m(S),className:"text-cyan-400 hover:text-cyan-300 text-xs mr-3",children:"Edit"}),p.jsx("button",{onClick:()=>b(S.site_id),className:"text-red-400 hover:text-red-300",children:p.jsx(C0,{className:"w-4 h-4 inline"})})]})]},S.site_id))})]})})]})}function S7({draft:e,setDraft:t,onSave:r,onCancel:n,adding:i,feedSource:a}){const o=(v,m)=>t({...e,[v]:m}),[s,l]=G.useState(!1),[u,c]=G.useState(null),f=a!=="native"||!e.site_id.trim(),h=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(!f){l(!0),c(null);try{const v=e.site_id.replace(/^USGS-/i,""),m=await fetch(`/api/env/usgs/lookup/${encodeURIComponent(v)}`);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(v){c(String(v))}finally{l(!1)}}};return p.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 p-3 bg-slate-900/50 rounded",children:[p.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Site ID",p.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[p.jsx("input",{className:"flex-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100 font-mono text-xs",value:e.site_id,onChange:v=>o("site_id",v.target.value),disabled:!i}),p.jsxs("button",{type:"button",onClick:d,disabled:f||s,title:h,className:"px-2 py-1 bg-slate-700 hover:bg-slate-600 disabled:opacity-30 disabled:cursor-not-allowed rounded text-xs text-slate-100 flex items-center gap-1",children:[s?p.jsx(T0,{className:"w-3 h-3 animate-spin"}):p.jsx(dT,{className:"w-3 h-3"}),"USGS lookup"]})]}),u&&p.jsx("span",{className:"text-amber-400 text-xs mt-1 block",children:u})]}),p.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Gauge name",p.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.gauge_name,onChange:v=>o("gauge_name",v.target.value)})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Lat",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lat,onChange:v=>o("lat",parseFloat(v.target.value))})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Lon",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lon,onChange:v=>o("lon",parseFloat(v.target.value))})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Action ft",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.action_ft??"",onChange:v=>o("action_ft",v.target.value===""?null:parseFloat(v.target.value))})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Minor flood ft",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.flood_minor_ft??"",onChange:v=>o("flood_minor_ft",v.target.value===""?null:parseFloat(v.target.value))})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Moderate flood ft",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.flood_moderate_ft??"",onChange:v=>o("flood_moderate_ft",v.target.value===""?null:parseFloat(v.target.value))})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Major flood ft",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.flood_major_ft??"",onChange:v=>o("flood_major_ft",v.target.value===""?null:parseFloat(v.target.value))})]}),p.jsxs("label",{className:"text-xs text-slate-300 col-span-2 flex items-center gap-2 mt-2",children:[p.jsx("input",{type:"checkbox",checked:e.enabled,onChange:v=>o("enabled",v.target.checked),className:"accent-cyan-500"}),"Enabled"]}),p.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-2 mt-2",children:[p.jsx("button",{onClick:n,className:"px-3 py-1 text-slate-300 hover:bg-slate-700 rounded text-sm",children:"Cancel"}),p.jsx("button",{onClick:r,className:"px-3 py-1 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm",children:"Save"})]})]})}const ek={anchor_id:0,name:"",lat:0,lon:0,state:"ID",enabled:!0,updated_at:0};function Iet(){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,f]=G.useState(ek),h=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(()=>{h()},[h]);const d=_=>{s(_.anchor_id),f({..._}),u(!1)},v=()=>{u(!0),s(null),f({...ek})},m=()=>{s(null),u(!1),f(ek)},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(),h()},x=async _=>{if(!confirm(`Delete anchor ${_}?`))return;const b=await fetch(`/api/town-anchors/${_}`,{method:"DELETE"});if(!b.ok){alert(`delete failed: ${b.status}`);return}h()};return r?p.jsxs("div",{className:"p-6 text-slate-400",children:[p.jsx(T0,{className:"w-5 h-5 animate-spin inline mr-2"}),"Loading…"]}):i?p.jsxs("div",{className:"p-6 text-red-400",children:["Load failed: ",i]}):p.jsxs("div",{className:"p-6 space-y-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx($v,{className:"w-5 h-5 text-cyan-400"}),p.jsx("h1",{className:"text-xl font-semibold text-slate-100",children:"Town Anchors"}),p.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[e.length," towns"]}),p.jsxs("button",{onClick:v,className:"ml-auto flex items-center gap-1 px-3 py-1 bg-cyan-700 hover:bg-cyan-600 rounded text-white text-sm",children:[p.jsx(Fv,{className:"w-4 h-4"})," Add town"]})]}),p.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&&p.jsx(T7,{draft:c,setDraft:f,onSave:y,onCancel:m,adding:!0}),p.jsx("div",{className:"bg-slate-800/60 border border-slate-700 rounded-lg overflow-x-auto",children:p.jsxs("table",{className:"w-full text-sm text-slate-200",children:[p.jsx("thead",{className:"bg-slate-900 text-xs text-slate-400 uppercase",children:p.jsxs("tr",{children:[p.jsx("th",{className:"px-3 py-2 text-left",children:"Name"}),p.jsx("th",{className:"px-3 py-2 text-right",children:"Lat"}),p.jsx("th",{className:"px-3 py-2 text-right",children:"Lon"}),p.jsx("th",{className:"px-3 py-2 text-center",children:"State"}),p.jsx("th",{className:"px-3 py-2 text-center",children:"On"}),p.jsx("th",{className:"px-3 py-2"})]})}),p.jsx("tbody",{className:"divide-y divide-slate-700/60",children:e.map(_=>o===_.anchor_id?p.jsx("tr",{className:"bg-slate-900/40",children:p.jsx("td",{colSpan:6,className:"px-3 py-2",children:p.jsx(T7,{draft:c,setDraft:f,onSave:y,onCancel:m})})},_.anchor_id):p.jsxs("tr",{className:"hover:bg-slate-800/50",children:[p.jsx("td",{className:"px-3 py-2 capitalize",children:_.name}),p.jsx("td",{className:"px-3 py-2 text-right text-xs",children:_.lat.toFixed(4)}),p.jsx("td",{className:"px-3 py-2 text-right text-xs",children:_.lon.toFixed(4)}),p.jsx("td",{className:"px-3 py-2 text-center text-xs",children:_.state||"-"}),p.jsx("td",{className:"px-3 py-2 text-center",children:_.enabled?p.jsx(ts,{className:"w-4 h-4 text-emerald-400 inline"}):p.jsx(vo,{className:"w-4 h-4 text-slate-500 inline"})}),p.jsxs("td",{className:"px-3 py-2 text-right",children:[p.jsx("button",{onClick:()=>d(_),className:"text-cyan-400 hover:text-cyan-300 text-xs mr-3",children:"Edit"}),p.jsx("button",{onClick:()=>x(_.anchor_id),className:"text-red-400 hover:text-red-300",children:p.jsx(C0,{className:"w-4 h-4 inline"})})]})]},_.anchor_id))})]})})]})}function T7({draft:e,setDraft:t,onSave:r,onCancel:n,adding:i}){const a=(o,s)=>t({...e,[o]:s});return p.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 p-3 bg-slate-900/50 rounded",children:[p.jsxs("label",{className:"text-xs text-slate-400 col-span-2",children:["Name (lowercased on save)",p.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.name,onChange:o=>a("name",o.target.value),disabled:!i})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["State",p.jsx("input",{className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.state??"",onChange:o=>a("state",o.target.value)})]}),p.jsxs("label",{className:"text-xs text-slate-400 flex items-center gap-2",children:[p.jsx("input",{type:"checkbox",checked:e.enabled,onChange:o=>a("enabled",o.target.checked),className:"accent-cyan-500 mt-4"}),"Enabled"]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Lat",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lat,onChange:o=>a("lat",parseFloat(o.target.value))})]}),p.jsxs("label",{className:"text-xs text-slate-400",children:["Lon",p.jsx("input",{type:"number",step:"any",className:"block w-full mt-1 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100",value:e.lon,onChange:o=>a("lon",parseFloat(o.target.value))})]}),p.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-2 mt-2",children:[p.jsx("button",{onClick:n,className:"px-3 py-1 text-slate-300 hover:bg-slate-700 rounded text-sm",children:"Cancel"}),p.jsx("button",{onClick:r,className:"px-3 py-1 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm",children:"Save"})]})]})}function Oet(){return p.jsx(Bce,{children:p.jsx(Gce,{children:p.jsxs(Yue,{children:[p.jsx(Wa,{path:"/",element:p.jsx(wDe,{})}),p.jsx(Wa,{path:"/mesh",element:p.jsx(zQe,{})}),p.jsx(Wa,{path:"/environment",element:p.jsx(cet,{})}),p.jsx(Wa,{path:"/config",element:p.jsx(aet,{})}),p.jsx(Wa,{path:"/alerts",element:p.jsx(yet,{})}),p.jsx(Wa,{path:"/notifications",element:p.jsx(Tet,{})}),p.jsx(Wa,{path:"/reference",element:p.jsx(Cet,{})}),p.jsx(Wa,{path:"/adapter-config",element:p.jsx(Met,{})}),p.jsx(Wa,{path:"/gauge-sites",element:p.jsx(Let,{})}),p.jsx(Wa,{path:"/town-anchors",element:p.jsx(Iet,{})})]})})})}tk.createRoot(document.getElementById("root")).render(p.jsx(Q.StrictMode,{children:p.jsx(tce,{children:p.jsx(Oet,{})})})); diff --git a/meshai/dashboard/static/index.html b/meshai/dashboard/static/index.html index 19e9ace..654b35e 100644 --- a/meshai/dashboard/static/index.html +++ b/meshai/dashboard/static/index.html @@ -8,7 +8,7 @@ - +