')
+
+
+def _sec_tps(rows: list[dict]) -> str:
+ cells = [c for c in (_tps_cell(r) for r in rows) if c]
+ if not cells:
+ return _card("Per-request TPS", _QUIET.format("no flight samples or receipt sliding windows"))
+ note = _QUIET.format(
+ "solid blue line — flight recorder per-second samples · dashed line with markers — sketch "
+ "from receipt sliding windows (approximation; no flight data recorded for these requests) · "
+ "thin orange overlay (only when flight samples carry cumulative accept/draft counters) — "
+ "per-second MTP acceptance rate on a 0–100% band of the cell height · per-turn acceptance "
+ "and verify-time detail lives in the MTP section below")
+ return _card("Per-request TPS", note + f'
{"".join(cells)}
')
+
+
+def _pct_grid(x0: float, x1: float, h: float) -> str:
+ """Hairline grid + axis for a 0..100% horizontal scale (ticks every 25%)."""
+ parts = []
+ for f in (0.0, 0.25, 0.5, 0.75, 1.0):
+ tx = x0 + f * (x1 - x0)
+ parts.append(f''
+ f'{f * 100:.0f}%')
+ parts.append(f'')
+ return "".join(parts)
+
+
+def _mtp_accept_panel(rows: list[dict]) -> str:
+ """One row per turn: grouped bars, acceptance rate per draft depth, with the
+ percentage always visible. Turns without MTP counters get a quiet dash row."""
+ x0, bx0, x1 = 44.0, 76.0, 688.0
+ with_mtp = [r for r in rows if r["drafted_by_depth"]]
+ if not with_mtp:
+ return "
Acceptance rate by draft depth
" + _QUIET.format(
+ "no MTP acceptance counters in any receipt for this session")
+ depth_n = max(len(r["drafted_by_depth"]) for r in with_mtp)
+ ramp = _DEPTH_RAMP.get(depth_n, _DEPTH_RAMP[4])
+ body, y = [], 8.0
+ for r in rows:
+ drafted, accepted = r["drafted_by_depth"], r["accepted_by_depth"]
+ if not drafted:
+ reason = "no server receipt" if r["receipt_missing"] else "no MTP data"
+ if r["status"] != "ok":
+ reason += " · cancelled"
+ body.append(f't{r["turn"]}'
+ f'— {_esc(reason)}')
+ y += 20.0
+ continue
+ n = len(drafted)
+ gh = n * 9 + (n - 1) * 5 # 9px bars on a 14px pitch — label boxes never touch
+ body.append(f't{r["turn"]}')
+ tip_lines = [f"t{r['turn']} · MTP acceptance by draft depth"]
+ for i, d in enumerate(drafted):
+ acc = accepted[i] if i < len(accepted) else 0
+ by = y + i * 14
+ body.append(f'd{i + 1}')
+ if d:
+ rate = min(acc / d, 1.0)
+ body.append(_rbar(bx0, by, rate * (x1 - bx0), 9, ramp[min(i, len(ramp) - 1)]))
+ body.append(f'{rate * 100:.0f}%')
+ mp = r["mean_accept_p"][i] if i < len(r["mean_accept_p"]) else None
+ tip_lines.append(f"d{i + 1}: {_fmt_tok(acc)}/{_fmt_tok(d)} accepted ({rate * 100:.1f}%)"
+ + (f" · mean p {mp:.2f}" if isinstance(mp, (int, float)) else ""))
+ else:
+ body.append(f'0 drafts')
+ tip_lines.append(f"d{i + 1}: 0 drafts")
+ tot_d, tot_a = sum(drafted), sum(accepted[: len(drafted)])
+ if tot_d:
+ tip_lines.append(f"overall {_fmt_tok(tot_a)}/{_fmt_tok(tot_d)} ({tot_a / tot_d * 100:.1f}%)")
+ if r["verify_calls"] is not None:
+ tip_lines.append(f"verify calls {_fmt_tok(r['verify_calls'])}")
+ rh = gh + 11.0
+ tip = "\n".join(tip_lines)
+ body.append(f'')
+ y += rh
+ h = y + 34
+ legend = _chips([(ramp[min(i, len(ramp) - 1)], f"d{i + 1}") for i in range(depth_n)])
+ note = _QUIET.format("share of drafted tokens accepted at each MTP depth "
+ "(accepted_by_depth ÷ drafted_by_depth from the serve receipt)")
+ return ("
Acceptance rate by draft depth
" + note + legend
+ + f'")
+
+
+def _mtp_time_panel(rows: list[dict]) -> str:
+ """100%-normalized stacked bar per turn splitting decode_elapsed_s into
+ draft / verify / accept / other, absolute seconds always visible."""
+ x0, x1, rh = 44.0, 640.0, 26.0
+ have, skipped = [], []
+ for r in rows:
+ comps = (r["draft_time_s"], r["verify_time_s"], r["accept_time_s"])
+ if r["decode_elapsed_s"] and any(c is not None for c in comps):
+ have.append(r)
+ else:
+ skipped.append(f"t{r['turn']}" + (" (cancelled)" if r["status"] != "ok" else ""))
+ if not have:
+ return "
Decode time split
" + _QUIET.format(
+ "no draft/verify/accept timing in any receipt for this session")
+ h = len(have) * rh + 42
+ body = []
+ for i, r in enumerate(have):
+ y = i * rh + 8
+ total = float(r["decode_elapsed_s"])
+ d = float(r["draft_time_s"] or 0.0)
+ v = float(r["verify_time_s"] or 0.0)
+ a = float(r["accept_time_s"] or 0.0)
+ other = max(total - (d + v + a), 0.0)
+ denom = max(total, d + v + a) or 1.0
+ segs = [("draft", d, _BLUE), ("verify", v, _ORANGE), ("accept", a, _AQUA), ("other", other, _YELLOW)]
+ body.append(f't{r["turn"]}')
+ vis = [(nm, sec, col, sec / denom * (x1 - x0)) for nm, sec, col in segs if sec > 0]
+ cx = x0
+ for j, (_nm, _sec, col, wseg) in enumerate(vis):
+ if j == len(vis) - 1: # rounded data end on the last segment only
+ body.append(_rbar(cx, y, wseg, 12, col))
+ else: # 2px surface gap between touching segments (when it fits)
+ gap = 2.0 if wseg > 6 else 0.0
+ body.append(f'')
+ cx += wseg
+ ann = (f"draft {_fmt_dur(r['draft_time_s'])} · verify {_fmt_dur(r['verify_time_s'])}"
+ f" · accept {_fmt_dur(r['accept_time_s'])} · other {_fmt_dur(other)} of {_fmt_dur(total)}")
+ body.append(f'{_esc(ann)}')
+ tip_lines = [f"t{r['turn']} · decode {total:.2f}s"]
+ tip_lines.extend(f"{nm} {sec:.2f}s ({sec / denom * 100:.1f}%)" for nm, sec, _c in segs)
+ if r["verify_calls"] is not None:
+ tip_lines.append(f"verify calls {_fmt_tok(r['verify_calls'])}")
+ tip = "\n".join(tip_lines)
+ body.append(f'')
+ legend = _chips([(_BLUE, "draft"), (_ORANGE, "verify"), (_AQUA, "accept"), (_YELLOW, "other (unattributed decode)")])
+ note = _QUIET.format("each bar = that turn's decode_elapsed_s normalized to 100% · absolute seconds annotated per row")
+ tail = _QUIET.format("omitted (receipt carries no draft/verify/accept timing): "
+ + ", ".join(skipped)) if skipped else ""
+ return ("
Decode time split (draft / verify / accept / other)
" + note + legend
+ + f'" + tail)
+
+
+def _sec_mtp(rows: list[dict]) -> str:
+ if not rows:
+ return _card("MTP acceptance & verify time", _QUIET.format("no assistant turns"))
+ return _card("MTP acceptance & verify time", _mtp_accept_panel(rows) + _mtp_time_panel(rows))
+
+
+def _sec_scatter(receipts: list[dict], session_ids: set[int], port: int) -> str:
+ pts: list[tuple[float, float, bool, dict]] = []
+ for rec in receipts:
+ y = rec.get("decode_tok_s")
+ x = rec.get("context_len")
+ if x is None:
+ x = ((rec.get("prompt_tokens") or 0) + (rec.get("completion_tokens") or 0)) or None
+ if x and y:
+ pts.append((float(x), float(y), id(rec) in session_ids, rec))
+ if not pts:
+ return _card("Context vs decode speed", _QUIET.format("no receipts with decode speed"))
+ pts.sort(key=lambda p: p[2]) # history first, session points painted on top
+ h, x0, x1, y0, y1 = 336, 56.0, 1092.0, 14.0, 284.0
+ xticks, yticks = _num_ticks(max(p[0] for p in pts)), _num_ticks(max(p[1] for p in pts), 4)
+ xmax, ymax = xticks[-1] or 1.0, yticks[-1] or 1.0
+ out = [f'")
+
+
+def _sec_digest(digest: list[dict]) -> str:
+ if not digest:
+ return _card("Turn digest", _QUIET.format("no assistant turns"))
+ head = ('
t
start
wall
status
comp tok
'
+ '
think tok
ttft s
tok/s
'
+ '
reasoning chars
output chars
')
+ body = []
+ for d in digest:
+ if d["prompt"]:
+ body.append(f'
“{_esc(d["prompt"])}”
')
+ r = d["row"]
+ status = "ok" if r["status"] == "ok" else 'cancel/err'
+ ttft = f"{r['ttft_s']:.2f}" if r["ttft_s"] is not None else "-"
+ toks = f"{r['decode_tok_s']:.1f}" if r["decode_tok_s"] else "-"
+ body.append(f'
t{r["turn"]}
{_hms(r["start"])}
{_fmt_dur(r["wall_s"])}
'
+ f'
{status}
{_fmt_tok(r["completion_tokens"])}
'
+ f'
{_fmt_tok(r["client_reasoning_tokens"])}
{ttft}
'
+ f'
{toks}
{_fmt_tok(d["reasoning_chars"])}
'
+ f'
{_fmt_tok(d["output_chars"])}
')
+ return _card("Turn digest", f'
{head}{"".join(body)}
')
+
+
+# ---------------------------------------------------------------------------
+# message-text helpers (defensive: schema may vary across OpenCode versions)
+
+
+def _user_snippet(conn: Any, message: dict) -> str | None:
+ texts: list[str] = []
+ try:
+ for part in _opencode_parts(conn, message.get("_id") or ""):
+ if part.get("type") == "text" and part.get("text"):
+ texts.append(str(part["text"]))
+ if not texts:
+ content = message.get("content")
+ if isinstance(content, str):
+ texts.append(content)
+ elif isinstance(content, list):
+ texts.extend(str(p.get("text") or "") for p in content if isinstance(p, dict))
+ except Exception: # noqa: BLE001 — digest text is best-effort, never fatal
+ return None
+ text = " ".join(" ".join(texts).split())
+ return (text[:200] + ("…" if len(text) > 200 else "")) or None
+
+
+def _part_chars(conn: Any, message: dict) -> tuple[int | None, int | None]:
+ try:
+ parts = _opencode_parts(conn, message.get("_id") or "")
+ return (sum(len(p.get("text") or "") for p in parts if p.get("type") == "reasoning"),
+ sum(len(p.get("text") or "") for p in parts if p.get("type") == "text"))
+ except Exception: # noqa: BLE001
+ return None, None
+
+
+# ---------------------------------------------------------------------------
+# page chrome (kept dense — every rule is chart chrome, not content)
+
+_CSS = (
+ "body{margin:0;background:#f9f9f7;color:#0b0b0b;font:14px/1.45 system-ui,-apple-system,'Segoe UI',sans-serif}"
+ "main{max-width:1160px;margin:0 auto;padding:24px 20px 60px}h1{font-size:21px;margin:0 0 4px}"
+ "h2{font-size:15px;font-weight:600;margin:0 0 8px}.meta b{font-weight:600}"
+ "h3{font-size:13px;font-weight:600;margin:14px 0 6px}section h3:first-child{margin-top:2px}"
+ ".meta{color:#52514e;font-size:12.5px;margin:0 0 14px;line-height:1.6}"
+ "section{background:#fcfcfb;border:1px solid rgba(11,11,11,.1);border-radius:10px;padding:14px 16px;margin:14px 0}"
+ ".tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:14px 0 2px}"
+ ".tile{background:#fcfcfb;border:1px solid rgba(11,11,11,.1);border-radius:10px;padding:10px 12px}"
+ ".tl{font-size:11.5px;color:#52514e}.tv{font-size:22px;font-weight:600;margin-top:2px}"
+ ".legend{display:flex;gap:14px;flex-wrap:wrap;margin:2px 0 10px;font-size:12px;color:#52514e}"
+ ".sw{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:5px;vertical-align:-1px}"
+ ".flags{list-style:none;margin:0;padding:0}.bang{color:#d03b3b;font-weight:700;margin-right:6px}"
+ ".flags li{border-left:3px solid #ec835a;background:rgba(236,131,90,.07);padding:7px 10px;margin:6px 0;border-radius:0 7px 7px 0;font-size:13px}"
+ ".quiet{color:#898781;font-size:12.5px;margin:0 0 10px}.crit{color:#d03b3b;font-weight:600}"
+ ".badge{font-size:10px;color:#898781;border:1px solid #e1e0d9;border-radius:4px;padding:1px 5px;height:fit-content}"
+ ".cells{display:grid;grid-template-columns:repeat(auto-fill,minmax(252px,1fr));gap:12px}"
+ ".cell{border:1px solid #efeee9;border-radius:8px;padding:8px 8px 4px}.scroll{overflow-x:auto}"
+ ".ct{font-size:12px;color:#52514e;margin:0 0 4px;display:flex;justify-content:space-between;gap:6px}"
+ ".dg{border-collapse:collapse;width:100%;font-size:12.5px}.dg td{border-bottom:1px solid #efeee9;padding:5px 8px;vertical-align:top}"
+ ".dg th{text-align:left;color:#52514e;font-weight:600;border-bottom:1px solid #e1e0d9;padding:5px 8px;white-space:nowrap}"
+ ".dg .n{text-align:right;font-variant-numeric:tabular-nums}.up td{color:#52514e;background:#f6f5f1;font-style:italic}"
+ "svg{display:block;max-width:100%;height:auto}svg text{font:11px system-ui,-apple-system,sans-serif;fill:#52514e}"
+ "text.ax{fill:#898781;font-variant-numeric:tabular-nums}text.mid{text-anchor:middle}text.end{text-anchor:end}text.lab{fill:#52514e}"
+ "text.ann{font-size:10.5px;fill:#898781;paint-order:stroke;stroke:#fcfcfb;stroke-width:3px}"
+ "text.wallnote{font-size:10.5px;fill:#0b0b0b;font-weight:600;paint-order:stroke;stroke:#fcfcfb;stroke-width:3px}"
+ "text.vlab{font-size:10.5px;fill:#0b0b0b;font-variant-numeric:tabular-nums;paint-order:stroke;stroke:#fcfcfb;stroke-width:3px}"
+ "text.dlab{font-size:10px;fill:#898781}"
+ "line.grid{stroke:#e1e0d9;stroke-width:1}line.axis{stroke:#c3c2b7;stroke-width:1}"
+ "#tip{position:fixed;display:none;background:#0b0b0b;color:#fcfcfb;font-size:12px;line-height:1.5;"
+ "padding:7px 9px;border-radius:7px;white-space:pre-line;pointer-events:none;z-index:9;max-width:360px}"
+)
+
+# tooltip layer: delegated hover/focus on [data-tip]; nearest-point search inside #scat
+_JS = (
+ "const tip=document.getElementById('tip');const scat=document.getElementById('scat');"
+ "const spts=scat?[...scat.querySelectorAll('circle[data-tip]')]:[];"
+ "function show(t,x,y){tip.textContent=t;tip.style.display='block';const r=tip.getBoundingClientRect();"
+ "tip.style.left=Math.min(x+14,innerWidth-r.width-8)+'px';tip.style.top=Math.min(y+14,innerHeight-r.height-8)+'px';}"
+ "function hide(){tip.style.display='none';}"
+ "function near(e){if(!scat)return false;const b=scat.getBoundingClientRect();"
+ "if(e.clientXb.right||e.clientYb.bottom)return false;"
+ "let best=null,bd=26*26;for(const c of spts){const r=c.getBoundingClientRect();"
+ "const dx=e.clientX-(r.left+r.width/2),dy=e.clientY-(r.top+r.height/2),d=dx*dx+dy*dy;if(d{const el=e.target.closest?e.target.closest('[data-tip]'):null;"
+ "if(el&&!(scat&&scat.contains(el))){show(el.getAttribute('data-tip'),e.clientX,e.clientY);}else if(!near(e)){hide();}});"
+ "document.addEventListener('focusin',e=>{const el=e.target.closest?e.target.closest('[data-tip]'):null;"
+ "if(el){const r=el.getBoundingClientRect();show(el.getAttribute('data-tip'),r.left,r.bottom+6);}});"
+ "document.addEventListener('focusout',hide);"
+)
+
+
+# ---------------------------------------------------------------------------
+# entry point
+
+
+def cmd_trace_report(args: argparse.Namespace) -> int:
+ conn = _opencode_connect(Path(args.db))
+ if conn is None:
+ print(f"opencode db not found: {args.db}", file=sys.stderr)
+ return 1
+ session_id = _resolve_session_arg(conn, getattr(args, "session", None))
+ if not session_id:
+ print("no opencode sessions found", file=sys.stderr)
+ return 1
+ port = _detect_port(args.port)
+ if port is None:
+ print("no request logs found under ~/.mtplx/logs", file=sys.stderr)
+ return 1
+ receipts = _load_receipts(port)
+ flight = _load_flight(port)
+ joined = _join_session(conn, session_id, receipts, flight)
+ a_turns = [t for t in joined["turns"] if t["kind"] == "assistant"]
+ rows = [_enrich(t) for t in a_turns]
+ flags = _detect_pathologies(joined["turns"])
+ session_ids = {id(t["receipt"]) for t in a_turns if t.get("receipt")}
+
+ warm = [r for r in rows[1:] if r["prompt_tokens"] and r["cached_tokens"] is not None]
+ reuse = (sum(r["cached_tokens"] or 0 for r in warm)
+ / max(1, sum(r["prompt_tokens"] or 0 for r in warm))) if warm else None
+ dec = [(r["completion_tokens"], r["decode_elapsed_s"]) for r in rows
+ if r["completion_tokens"] and r["decode_elapsed_s"]]
+ mean_dec = sum(c for c, _ in dec) / sum(s for _, s in dec) if dec else None
+ starts = [r["start"] for r in rows if r["start"]]
+ span = "-"
+ if starts:
+ lo = min(starts)
+ hi = max(r["start"] + _row_dur(r) for r in rows if r["start"])
+ day = _dt.datetime.fromtimestamp(lo, tz=_dt.UTC).astimezone()
+ span = f"{day:%Y-%m-%d} {_hms(lo)} → {_hms(hi)}"
+ cards = [
+ ("Turns", str(len(rows))),
+ ("Warm cache reuse", f"{reuse * 100:.1f}%" if reuse is not None else "-"),
+ ("Completion tokens", _fmt_tok(sum(r["completion_tokens"] or 0 for r in rows))),
+ ("Client think tokens", _fmt_tok(sum(r["client_reasoning_tokens"] or 0 for r in rows))),
+ ("Wall time (turns)", _fmt_dur(sum(r["wall_s"] or 0 for r in rows))),
+ ("Mean decode", f"{mean_dec:.1f} tok/s" if mean_dec else "-"),
+ ]
+ join_mode = "exact session_id" if joined["receipt_pool_scoped"] else "time+token fallback"
+ session = joined["session"]
+ header = (f'
mtplx trace report
{_esc(session_id)}'
+ f' · {_esc(session.get("title") or "untitled")} {_esc(session.get("directory") or "-")}'
+ f' · {_esc(span)} · port {port} · join: {join_mode}
'
+ + "".join(f'
{_esc(k)}
{_esc(v)}
'
+ for k, v in cards) + "
")
+ pathology = _card("Pathology flags", '
' + "".join(
+ f'
!!{_esc(f)}
' for f in flags) + "
"
+ if flags else _QUIET.format("none detected"))
+
+ digest, pending, by_turn = [], None, {r["turn"]: r for r in rows}
+ for turn in joined["turns"]:
+ if turn["kind"] == "user":
+ pending = _user_snippet(conn, turn["message"]) or pending
+ continue
+ reasoning_chars, output_chars = _part_chars(conn, turn["message"])
+ digest.append({"row": by_turn[turn["turn"]], "prompt": pending,
+ "reasoning_chars": reasoning_chars, "output_chars": output_chars})
+ pending = None
+
+ page = (''
+ ''
+ f"mtplx trace — {_esc(session_id)}"
+ + header + pathology + _sec_timeline(rows) + _sec_cache(rows) + _sec_tps(rows)
+ + _sec_mtp(rows) + _sec_scatter(receipts, session_ids, port) + _sec_digest(digest)
+ + '")
+
+ out_path = Path(args.out).expanduser() if args.out else METRICS_DIR / "reports" / f"{session_id}.html"
+ out_path.parent.mkdir(parents=True, exist_ok=True)
+ out_path.write_text(page, encoding="utf-8")
+ print(f"wrote {out_path} ({out_path.stat().st_size:,} bytes)")
+ if getattr(args, "open", False):
+ subprocess.run(["open", str(out_path)], check=False)
+ return 0
diff --git a/mtplx/compile_state.py b/mtplx/compile_state.py
new file mode 100644
index 000000000..4a42b0796
--- /dev/null
+++ b/mtplx/compile_state.py
@@ -0,0 +1,39 @@
+"""Shared 'inside a compiled forward trace' flag (issue #51, 70 tps goal).
+
+A dependency-free home for one bit of state so `compiled_forward` (which sets it)
+and the model forwards (which read it) can agree without an import cycle.
+
+The model decode loop keeps the GPU fed during Python graph-build by calling
+`mx.async_eval` every N layers (the submit cadence). Inside an `mx.compile`
+trace that call is (a) illegal — "[async_eval] Not allowed inside a graph
+transformation" — and (b) pointless, because the whole reason to compile is to
+replace the per-layer Python walk with a single traced submission. So while a
+compiled forward is tracing/replaying, the forward checks `compile_trace_active()`
+and suppresses those scheduling-only host-syncs. Kernel math and ordering are
+unchanged; this only removes an eval whose sole job was to paper over the
+graph-build stall that compilation eliminates outright.
+"""
+
+from __future__ import annotations
+
+import contextlib
+from typing import Iterator
+
+_COMPILE_TRACE_ACTIVE = False
+
+
+def compile_trace_active() -> bool:
+ """True while a compiled AR forward is executing (and while it traces)."""
+ return _COMPILE_TRACE_ACTIVE
+
+
+@contextlib.contextmanager
+def compile_trace() -> Iterator[None]:
+ """Mark the enclosed block as running inside a compiled forward."""
+ global _COMPILE_TRACE_ACTIVE
+ previous = _COMPILE_TRACE_ACTIVE
+ _COMPILE_TRACE_ACTIVE = True
+ try:
+ yield
+ finally:
+ _COMPILE_TRACE_ACTIVE = previous
diff --git a/mtplx/compiled_forward.py b/mtplx/compiled_forward.py
new file mode 100644
index 000000000..58a4261e8
--- /dev/null
+++ b/mtplx/compiled_forward.py
@@ -0,0 +1,144 @@
+"""Compiled AR decode forward for fully-resident models.
+
+Without compilation the decode loop rebuilds the model's whole MLX graph in
+Python every step; on deep MoE trunks that host-side rebuild is a double-digit
+ms/token tax against a memory floor roughly its size. This compiles the single
+target call `model(input_ids, cache=cache)` so the graph traces ONCE and
+replays.
+
+Mechanism: mx.compile cannot trace a Python object whose arrays grow each
+step, so each layer's KV cache is converted to a fixed-buffer
+`TensorOffsetKVCache` (stable graph shape via a reserved buffer + offset), and
+its 3 state leaves (keys, values, offset) are threaded as explicit compile
+inputs and outputs. N layers -> 3N threaded leaves.
+
+Correctness note: mx.compile is exact for fp32 matmul; a quantized gather_qmm
+may select a different fused kernel (sub-percent divergence from
+non-associative FP). Whether that flips tokens end-to-end is the A/B gate to
+run per model before promotion.
+
+Flag-gated (MTPLX_COMPILE_AR_FORWARD), fully-resident models only (a
+host-sync inside the forward breaks the traced region and raises on first
+call). Emits an engagement counter so a null A/B is never credited as
+control-vs-control.
+"""
+
+from __future__ import annotations
+
+import atexit
+import os
+from typing import Any, Callable
+
+import mlx.core as mx
+
+from mtplx.compile_state import compile_trace
+from mtplx.graphbank import TensorOffsetKVCache
+
+# Engagement proof: incremented every time the compiled forward actually runs, so
+# an A/B can assert the compiled path fired rather than inferring it from a null.
+_COMPILED_FORWARD_CALLS = 0
+
+
+def compiled_forward_calls() -> int:
+ return _COMPILED_FORWARD_CALLS
+
+
+def _write_engagement_count_file() -> None:
+ """Persist the final call count to a file so an out-of-process A/B driver can
+ verify engagement (arm-off must read 0, arm-on > 0). The in-memory counter and
+ the runtime's diagnostic_counters never cross the subprocess boundary; the
+ benchmark does not serialize either into its JSON, so a file is the only
+ channel the driver can read. Registered at import; fires on normal exit."""
+ path = os.environ.get("MTPLX_COMPILE_AR_FORWARD_COUNT_FILE")
+ if not path:
+ return
+ try:
+ with open(path, "w", encoding="utf-8") as handle:
+ handle.write(str(_COMPILED_FORWARD_CALLS))
+ except OSError:
+ pass
+
+
+atexit.register(_write_engagement_count_file)
+
+
+def compile_forward_enabled() -> bool:
+ return os.environ.get("MTPLX_COMPILE_AR_FORWARD") == "1"
+
+
+class CompiledARForward:
+ """Compiles `model(input_ids, cache)` with per-layer cache state threaded.
+
+ Stateful across steps: the fixed-buffer `TensorOffsetKVCache` entries are
+ built once from the live cache and advanced in place, exactly like the live
+ KV cache would be. The compiled function reads and returns the 3N leaves so
+ mx.compile sees a pure array->array graph.
+ """
+
+ def __init__(self, model: Any, *, reserve_tokens: int) -> None:
+ self._model = model
+ self._reserve = int(reserve_tokens)
+ self._compiled: Callable[..., tuple] | None = None
+ self._n: int = 0
+ # The PERSISTENT decode state (3N leaves), owned by the wrapper — NOT
+ # by the scratch caches. The compiled fn's scratch caches are overwritten
+ # by these leaves every call, so state ownership stays unambiguous (the
+ # tangle that flipped tokens when the caches held state and were also
+ # mutated in-graph). Same discipline as the draft core's `_trace_depth`.
+ self._state: list[mx.array] | None = None
+
+ def _ensure_compiled(self, live_cache: list[Any]) -> None:
+ if self._compiled is not None:
+ return
+ self._n = len(live_cache)
+ # Scratch fixed-buffer caches, seeded from the live (primed) cache.
+ caches = [
+ TensorOffsetKVCache.from_kv_cache(entry, reserve_tokens=self._reserve)
+ for entry in live_cache
+ ]
+ # Seed the persistent state from the primed caches' current contents.
+ self._state = []
+ for cache in caches:
+ self._state.extend([cache.cache[0], cache.cache[1], cache.cache[2]])
+ model = self._model
+ n = self._n
+
+ def forward(input_ids: mx.array, *state: mx.array) -> tuple:
+ if len(state) != 3 * n:
+ raise ValueError(f"expected {3 * n} state leaves, got {len(state)}")
+ for i in range(n):
+ caches[i].cache[0] = state[3 * i]
+ caches[i].cache[1] = state[3 * i + 1]
+ caches[i].cache[2] = state[3 * i + 2]
+ logits = model(input_ids, cache=caches)
+ out: list[mx.array] = []
+ for i in range(n):
+ out.append(caches[i].cache[0])
+ out.append(caches[i].cache[1])
+ out.append(caches[i].cache[2])
+ return (logits, *out)
+
+ self._compiled = mx.compile(forward)
+
+ def __call__(self, input_ids: mx.array, cache: list[Any]) -> mx.array:
+ global _COMPILED_FORWARD_CALLS
+ self._ensure_compiled(cache)
+ try:
+ # Mark the trace so the model forward suppresses its per-layer
+ # async_eval submit cadence (illegal inside a graph transformation,
+ # and obsolete once the whole forward is one traced submission).
+ with compile_trace():
+ result = self._compiled(input_ids, *self._state) # type: ignore[misc]
+ except Exception:
+ # The trace fires on the first call; a host-sync buried in the model
+ # forward (async_eval/eval) only surfaces here. Dump the full stack
+ # so the offending line is visible in the driver log, then re-raise.
+ if os.environ.get("MTPLX_COMPILE_AR_FORWARD_DEBUG") == "1":
+ import sys
+ import traceback
+
+ traceback.print_exc(file=sys.stderr)
+ raise
+ self._state = list(result[1:])
+ _COMPILED_FORWARD_CALLS += 1
+ return result[0]
diff --git a/mtplx/compressed_tensors.py b/mtplx/compressed_tensors.py
index b85af0322..d37054623 100644
--- a/mtplx/compressed_tensors.py
+++ b/mtplx/compressed_tensors.py
@@ -4,6 +4,7 @@
import contextlib
import json
+import logging
import math
import shutil
import struct
@@ -44,17 +45,27 @@
"k_norm.weight",
"model.norm.weight",
)
-MTP_RMSNORM_SHIFT_IF_LOW_SUFFIXES = (
+# MTP RMSNorm gains arrive in one of two conventions: HF-native Qwen3.5/3.8
+# exports are zero-centered ("delta", gain-1.0) on every norm, while shipped
+# sidecars and MLX-converted checkpoints are absolute. Measured fleet means
+# (2026-08-24, #301): the low set separates at 0.30-0.39 delta vs 0.87+
+# absolute, q/k at 0.73-0.75 delta vs 1.73+ absolute. The final norm overlaps
+# across conventions (raw-delta 4B mean 2.58 vs absolute 3.8 mean 2.25), so
+# the convention is decided per sidecar from the two separable families and
+# then applied to all seven norms — never per tensor, and never "always".
+MTP_RMSNORM_LOW_SET_SUFFIXES = (
"input_layernorm.weight",
"post_attention_layernorm.weight",
"pre_fc_norm_hidden.weight",
"pre_fc_norm_embedding.weight",
)
-MTP_RMSNORM_ALWAYS_SHIFT_SUFFIXES = (
+MTP_RMSNORM_QK_SUFFIXES = (
"self_attn.q_norm.weight",
"self_attn.k_norm.weight",
- "mtp.norm.weight",
)
+MTP_RMSNORM_FINAL_NORM_KEYS = ("norm.weight", "mtp.norm.weight")
+MTP_RMSNORM_QK_DELTA_MEAN_MAX = 1.25
+MTP_RMSNORM_LOW_DELTA_MEAN_MAX = 0.5
def convert_compressed_tensors_awq_to_mlx(
@@ -269,6 +280,7 @@ def convert_compressed_tensors_awq_to_mlx(
mtp_size = 0
if mtp_weights:
+ mtp_weights = shift_delta_mtp_norms(mtp_weights)
if num_experts > 0:
mtp_weights = stack_numbered_experts(
mtp_weights,
@@ -736,21 +748,103 @@ def _quantized_module_prefixes(weights: dict[str, mx.array]) -> set[str]:
return modules
-def sanitize_plain_weight(key: str, value: mx.array) -> mx.array:
+def mtp_norms_are_delta_encoded(weights: dict[str, Any]) -> bool:
+ """Whole-set delta detection for MTP norm gains (#301).
+
+ Public name for the same two-signal decision the runtime heal has
+ shipped since #176 — forge, the AWQ convert lane, and the heal path all
+ delegate here so there is exactly one threshold source.
+ """
+ return mtp_sidecar_norms_are_delta(dict(weights))
+
+
+def sanitize_plain_weight(
+ key: str, value: mx.array, *, mtp_norm_shift: bool | None = None
+) -> mx.array:
+ """Per-tensor sanitize for layout (conv1d axis order, trunk norms).
+
+ MTP norm gains are shifted only on an explicit set-level decision:
+ ``mtp_norm_shift=True`` applies the +1.0 restoration to every MTP norm
+ suffix; ``False`` and the default never shift. The +1.0 convention
+ cannot be judged one tensor at a time (#301) — whole-sidecar callers
+ decide once via shift_delta_mtp_norms()/mtp_norms_are_delta_encoded,
+ and the historical per-tensor always-shift tier is retired (it was the
+ corruption this issue reported).
+ """
if key.endswith("conv1d.weight") and value.ndim >= 3 and value.shape[-1] != 1:
value = value.moveaxis(2, 1)
if value.ndim == 1:
if key.startswith("mtp."):
- if any(key.endswith(suffix) for suffix in MTP_RMSNORM_ALWAYS_SHIFT_SUFFIXES):
+ if mtp_norm_shift and (
+ any(
+ key.endswith(suffix)
+ for suffix in MTP_RMSNORM_QK_SUFFIXES
+ + MTP_RMSNORM_LOW_SET_SUFFIXES
+ )
+ or _is_mtp_final_norm_key(key)
+ ):
value = value + 1.0
- elif any(key.endswith(suffix) for suffix in MTP_RMSNORM_SHIFT_IF_LOW_SUFFIXES):
- if float(value.mean().item()) < 0.5:
- value = value + 1.0
elif any(key.endswith(suffix) for suffix in MAIN_RMSNORM_SHIFT_SUFFIXES):
value = value + 1.0
return value
+def _is_mtp_final_norm_key(key: str) -> bool:
+ return key in MTP_RMSNORM_FINAL_NORM_KEYS or key.endswith(".mtp.norm.weight")
+
+
+def _mtp_norm_means(weights: dict[str, Any], suffixes: tuple[str, ...]) -> list[float]:
+ means: list[float] = []
+ for key, value in weights.items():
+ if getattr(value, "ndim", None) != 1:
+ continue
+ if any(key.endswith(suffix) for suffix in suffixes):
+ try:
+ means.append(float(value.mean().item()))
+ except Exception:
+ continue
+ return means
+
+
+def mtp_sidecar_norms_are_delta(weights: dict[str, Any]) -> bool:
+ """True when a sidecar's RMSNorm gains are zero-centered (delta).
+
+ Both separable norm families must agree (the same two-signal gate the
+ runtime heal has shipped since #176); a sidecar missing either family is
+ treated as absolute so nothing is ever blind-shifted.
+ """
+ qk_means = _mtp_norm_means(weights, MTP_RMSNORM_QK_SUFFIXES)
+ low_means = _mtp_norm_means(weights, MTP_RMSNORM_LOW_SET_SUFFIXES)
+ if not qk_means or not low_means:
+ return False
+ return (
+ max(qk_means) < MTP_RMSNORM_QK_DELTA_MEAN_MAX
+ and min(low_means) < MTP_RMSNORM_LOW_DELTA_MEAN_MAX
+ )
+
+
+def shift_delta_mtp_norms(weights: dict[str, Any]) -> dict[str, Any]:
+ """Restore the +1.0 absolute convention on a delta-encoded MTP sidecar.
+
+ Absolute-convention sidecars pass through byte-identical (#301). Keys may
+ be namespaced ("mtp.layers.0...") or stripped ("layers.0..."); both spell
+ the final norm as one of MTP_RMSNORM_FINAL_NORM_KEYS.
+ """
+ if not mtp_sidecar_norms_are_delta(weights):
+ return weights
+ logging.getLogger(__name__).warning(
+ "[mtp norms] sidecar gains are delta-encoded; restoring the +1.0 convention"
+ )
+ norm_suffixes = MTP_RMSNORM_QK_SUFFIXES + MTP_RMSNORM_LOW_SET_SUFFIXES
+ shifted = dict(weights)
+ for key, value in shifted.items():
+ if getattr(value, "ndim", None) != 1:
+ continue
+ if any(key.endswith(suffix) for suffix in norm_suffixes) or _is_mtp_final_norm_key(key):
+ shifted[key] = value + 1.0
+ return shifted
+
+
def _sanitize_plain_weight(key: str, value: mx.array) -> mx.array:
return sanitize_plain_weight(key, value)
diff --git a/mtplx/config.py b/mtplx/config.py
index 62d196dff..e0d17b1c7 100644
--- a/mtplx/config.py
+++ b/mtplx/config.py
@@ -30,6 +30,7 @@
"paged_kv_quantization",
"scheduler_mode",
"batching_preset",
+ "mtp_batch_numerics",
"max_active_requests",
"decode_batch_max",
"batch_wait_ms",
@@ -51,6 +52,10 @@
"top_p",
"top_k",
"api_key_file",
+ "embedding_models",
+ "reranker_models",
+ "retrieval_max_resident",
+ "retrieval_trust_remote_code",
)
@@ -65,6 +70,7 @@ class UserConfig:
paged_kv_quantization: str | None = None
scheduler_mode: str | None = None
batching_preset: str | None = None
+ mtp_batch_numerics: str | None = None
max_active_requests: int | None = None
decode_batch_max: int | None = None
batch_wait_ms: float | None = None
@@ -86,6 +92,10 @@ class UserConfig:
top_p: float | None = None
top_k: int | None = None
api_key_file: str | None = None
+ embedding_models: tuple[str, ...] = ()
+ reranker_models: tuple[str, ...] = ()
+ retrieval_max_resident: int | None = None
+ retrieval_trust_remote_code: bool | None = None
def to_dict(self) -> dict[str, Any]:
payload = {
@@ -137,6 +147,7 @@ def load_user_config(path: str | Path | None = None) -> UserConfig:
paged_kv_quantization=str(paged_kv_quantization) if paged_kv_quantization else None,
scheduler_mode=_str_or_none(data.get("scheduler_mode")),
batching_preset=_str_or_none(data.get("batching_preset")),
+ mtp_batch_numerics=_str_or_none(data.get("mtp_batch_numerics")),
max_active_requests=_int_or_none(data.get("max_active_requests")),
decode_batch_max=_int_or_none(data.get("decode_batch_max")),
batch_wait_ms=_float_or_none(data.get("batch_wait_ms")),
@@ -158,6 +169,10 @@ def load_user_config(path: str | Path | None = None) -> UserConfig:
top_p=_float_or_none(data.get("top_p")),
top_k=_int_or_none(data.get("top_k")),
api_key_file=_str_or_none(data.get("api_key_file")),
+ embedding_models=_str_tuple(data.get("embedding_models")),
+ reranker_models=_str_tuple(data.get("reranker_models")),
+ retrieval_max_resident=_int_or_none(data.get("retrieval_max_resident")),
+ retrieval_trust_remote_code=_bool_or_none(data.get("retrieval_trust_remote_code")),
)
@@ -220,22 +235,36 @@ def _apply_profile_default(args: Any, config: UserConfig) -> None:
if command in {"start", "serve", "quickstart", "quick-start"} and "max" in cli_flags:
return
current = getattr(args, "profile", None)
- if config.profile and current == DEFAULT_PROFILE_NAME:
+ if config.profile and current in (None, DEFAULT_PROFILE_NAME):
try:
args.profile = resolve_profile_name(config.profile)
except ValueError:
return
+ # A config-file profile is the user's standing pin: per-model
+ # default-profile promotion must honor it (config "sustained" was
+ # silently promoted to turbo), and a pin that sticks must be
+ # visible (config "stable" silently defeated turbo). The marker is
+ # deliberately not ``_cli_flags`` — that set records typed argv
+ # only, and the onboarding gates depend on the distinction.
+ args._profile_from_config = str(config.path)
+ if not getattr(args, "json", False):
+ print(f"profile: {args.profile} (from {config.path.name})", flush=True)
_RUNTIME_DEFAULTS: dict[str, tuple[str, tuple[str, ...]]] = {
"paged_kv_quantization": ("paged_kv_quantization", ("paged-kv-quantization", "paged-kv-quant", "kv-quant")),
"scheduler_mode": ("scheduler_mode", ("scheduler-mode",)),
"batching_preset": ("batching_preset", ("batching-preset",)),
+ "mtp_batch_numerics": ("mtp_batch_numerics", ("mtp-batch-numerics",)),
"max_active_requests": ("max_active_requests", ("max-active-requests",)),
"decode_batch_max": ("decode_batch_max", ("decode-batch-max",)),
"batch_wait_ms": ("batch_wait_ms", ("batch-wait-ms",)),
"prefill_chunk_tokens": ("prefill_chunk_tokens", ("prefill-chunk-tokens",)),
"experimental_mtp_cohorts": ("experimental_mtp_cohorts", ("experimental-mtp-cohorts",)),
+ "embedding_models": ("embedding_model", ("embedding-model",)),
+ "reranker_models": ("reranker_model", ("reranker-model",)),
+ "retrieval_max_resident": ("retrieval_max_resident", ("retrieval-max-resident",)),
+ "retrieval_trust_remote_code": ("retrieval_trust_remote_code", ("retrieval-trust-remote-code",)),
"ssd_session_cache": ("ssd_session_cache", ("ssd-session-cache",)),
"ssd_session_cache_dir": ("ssd_session_cache_dir", ("ssd-session-cache-dir",)),
"ssd_session_cache_max_size": ("ssd_session_cache_max_size", ("ssd-session-cache-max-size",)),
@@ -267,6 +296,15 @@ def _apply_runtime_defaults(args: Any, config: UserConfig) -> None:
setattr(args, attr, value)
+def _str_tuple(value: Any) -> tuple[str, ...]:
+ """Read a config list of model references, tolerating a bare string."""
+ if value in (None, ""):
+ return ()
+ if isinstance(value, str):
+ return (value,)
+ return tuple(str(item) for item in value if str(item).strip())
+
+
def _str_or_none(value: Any) -> str | None:
return str(value) if value not in (None, "") else None
diff --git a/mtplx/constants.py b/mtplx/constants.py
index 30fbaf20b..19535a3b6 100644
--- a/mtplx/constants.py
+++ b/mtplx/constants.py
@@ -184,6 +184,29 @@
EXPECTED_QWEN_MOE_PREQUANTIZED_MTP_KEYS
)
+_MTP_LAYER_KEY_MARKER = "mtp.layers.0."
+
+
+def expand_mtp_layer_keys(keys: tuple[str, ...] | set[str], n_layers: int) -> set[str]:
+ """Expand a depth-1 MTP key template across ``n_layers`` draft layers.
+
+ Every expected-key set in this module describes the canonical
+ single-layer (``mtp.layers.0.*``) head. Upstream checkpoints may declare
+ ``mtp_num_hidden_layers > 1`` (the config key is N-generic in the vLLM
+ reference contract); their weight layout replicates the per-layer
+ template at each index. Identity for ``n_layers <= 1``.
+ """
+ n = max(int(n_layers), 1)
+ expanded: set[str] = set()
+ for key in keys:
+ if _MTP_LAYER_KEY_MARKER in key:
+ for index in range(n):
+ expanded.add(key.replace(_MTP_LAYER_KEY_MARKER, f"mtp.layers.{index}.", 1))
+ else:
+ expanded.add(key)
+ return expanded
+
+
MULTIMODAL_SIDECARS = (
"preprocessor_config.json",
"processor_config.json",
diff --git a/mtplx/constrained.py b/mtplx/constrained.py
new file mode 100644
index 000000000..1a591b12c
--- /dev/null
+++ b/mtplx/constrained.py
@@ -0,0 +1,544 @@
+"""Grammar-constrained decoding (structured output) for the serial AR path.
+
+Phase 1 of the plan in upstream issue #186: ``response_format`` of type
+``json_object`` / ``json_schema`` is enforced with llguidance token bitmasks
+applied to target logits before sampling, on the serial AR lane only.
+Constrained requests never ride the batched AR pump or the MTP lanes; the
+server pins them to ``generation_mode="ar"`` and bypasses the batch scheduler.
+
+llguidance is an optional dependency: requests that do not use
+``response_format`` never touch it, and requests that do get a clear 400 when
+it is missing instead of silent non-enforcement (which is what shipped before
+this module existed).
+
+The mask must hit the logits row before any shaping (temperature, top-p/k,
+penalties) so that both the greedy argmax branch and the sampled branch of
+``_sample_from_logits`` operate on the constrained distribution. Illegal
+tokens are set to -inf, which survives every downstream shaping step.
+"""
+
+from __future__ import annotations
+
+import json
+import os
+import threading
+import time
+from collections import OrderedDict
+from dataclasses import dataclass
+from typing import Any
+
+try: # pragma: no cover - exercised via LLGUIDANCE_AVAILABLE branches
+ import llguidance as _llg
+ import llguidance.hf as _llg_hf
+ import llguidance.mlx as _llg_mlx
+
+ LLGUIDANCE_AVAILABLE = True
+ LLGUIDANCE_VERSION = str(_llg.get_version())
+except Exception: # pragma: no cover
+ _llg = None
+ _llg_hf = None
+ _llg_mlx = None
+ LLGUIDANCE_AVAILABLE = False
+ LLGUIDANCE_VERSION = None
+
+SUPPORTED_RESPONSE_FORMAT_TYPES = ("text", "json_object", "json_schema")
+
+# ``json_object`` promises a JSON object (OpenAI semantics), not merely any
+# JSON value, so the generic grammar pins the top-level type.
+_JSON_OBJECT_SCHEMA = '{"type": "object"}'
+
+# Strict tool-call constraint markers. These are the Qwen/Hermes-family
+# native tool-call and thinking tokens; strict mode only activates when the
+# runtime tokenizer encodes each marker as a single (special) token, so the
+# grammar can reference it as a hard boundary rather than bytes.
+TOOL_CALL_START = ""
+TOOL_CALL_END = ""
+THINK_START = ""
+THINK_END = ""
+
+
+def tool_call_strict_enabled() -> bool:
+ """Opt-in via MTPLX_TOOL_CALL_STRICT=1/true/on. Default off."""
+ return (os.environ.get("MTPLX_TOOL_CALL_STRICT") or "").strip().lower() in {
+ "1",
+ "true",
+ "on",
+ }
+
+
+class ResponseFormatError(ValueError):
+ """Invalid or unsupported ``response_format``; message is client-safe."""
+
+
+@dataclass(frozen=True)
+class ConstraintSpec:
+ """A validated, tokenizer-independent grammar for one request.
+
+ Built once at request-validation time (so bad schemas 400 before any
+ model work) and bound to the runtime tokenizer lazily via ``build`` —
+ once per generation attempt, because matcher state is consumed by a
+ generation and blank-retry attempts must start fresh.
+
+ ``grammar_with_prelude`` exists for response_format grammars on
+ thinking templates: it accepts a leading ``TEXT `` so the model
+ can close reasoning the chat template opened inside the prompt. It is
+ selected only when the prompt actually ends inside an open think block —
+ otherwise the prelude's free-text rule would let the model write prose
+ forever without ever starting the document.
+ """
+
+ grammar: str
+ source_type: str
+ grammar_with_prelude: str | None = None
+ think_start_id: int | None = None
+ think_end_id: int | None = None
+
+ def build(
+ self, tokenizer: Any, prompt_ids: list[int] | None = None
+ ) -> "GrammarConstraint":
+ grammar = self.grammar
+ if self.grammar_with_prelude is not None and _prompt_ends_inside_think(
+ prompt_ids, self.think_start_id, self.think_end_id
+ ):
+ grammar = self.grammar_with_prelude
+ return GrammarConstraint(grammar, tokenizer)
+
+
+def _prompt_ends_inside_think(
+ prompt_ids: list[int] | None,
+ think_start_id: int | None,
+ think_end_id: int | None,
+) -> bool:
+ if not prompt_ids or think_start_id is None:
+ return False
+ for token in reversed(prompt_ids):
+ if token == think_start_id:
+ return True
+ if think_end_id is not None and token == think_end_id:
+ return False
+ return False
+
+
+def constraint_spec_from_response_format(
+ response_format: Any,
+ tokenizer: Any | None = None,
+) -> ConstraintSpec | None:
+ """Parse/validate a request's ``response_format`` into a ConstraintSpec.
+
+ Returns None when no constraint applies (absent or ``type: text``).
+ Raises ResponseFormatError for anything the server cannot honestly
+ enforce — the caller turns that into a 400.
+
+ When a tokenizer is provided and its template family uses native
+ thinking markers, the grammar accepts an optional leading thinking
+ close (chat templates open ```` inside the generation prompt, so
+ the model's reasoning must be allowed to finish before the document).
+ """
+ if response_format is None:
+ return None
+ if not isinstance(response_format, dict):
+ raise ResponseFormatError(
+ "response_format must be an object with a 'type' field"
+ )
+ format_type = response_format.get("type")
+ if format_type not in SUPPORTED_RESPONSE_FORMAT_TYPES:
+ raise ResponseFormatError(
+ "unsupported response_format type "
+ f"{format_type!r}; supported: {', '.join(SUPPORTED_RESPONSE_FORMAT_TYPES)}"
+ )
+ if format_type == "text":
+ return None
+ if not LLGUIDANCE_AVAILABLE:
+ raise ResponseFormatError(
+ f"response_format type {format_type!r} requires the optional "
+ "llguidance dependency (pip install llguidance); refusing to "
+ "silently return unconstrained output"
+ )
+ if format_type == "json_object":
+ schema_json = _JSON_OBJECT_SCHEMA
+ else:
+ wrapper = response_format.get("json_schema")
+ if wrapper is None and isinstance(response_format.get("schema"), dict):
+ # Lenient shape some clients send: {"type": "json_schema",
+ # "schema": {...}} without the OpenAI wrapper object.
+ schema = response_format["schema"]
+ elif isinstance(wrapper, dict):
+ schema = wrapper.get("schema")
+ else:
+ schema = None
+ if not isinstance(schema, dict):
+ raise ResponseFormatError(
+ "response_format type 'json_schema' requires json_schema.schema "
+ "to be a JSON Schema object"
+ )
+ schema_json = _canonical_schema_json(schema)
+ grammar = _cached_grammar_for_schema(schema_json, think_prelude=False)
+ think_start_id = (
+ _single_token_id(tokenizer, THINK_START) if tokenizer is not None else None
+ )
+ think_end_id = (
+ _single_token_id(tokenizer, THINK_END) if tokenizer is not None else None
+ )
+ grammar_with_prelude = (
+ _cached_grammar_for_schema(schema_json, think_prelude=True)
+ if think_start_id is not None and think_end_id is not None
+ else None
+ )
+ return ConstraintSpec(
+ grammar=grammar,
+ source_type=str(format_type),
+ grammar_with_prelude=grammar_with_prelude,
+ think_start_id=think_start_id,
+ think_end_id=think_end_id,
+ )
+
+
+def tool_call_constraint_spec(
+ tools: Any,
+ tool_choice: Any,
+ tokenizer: Any,
+) -> ConstraintSpec | None:
+ """Build a strict tool-call ConstraintSpec from a request's tools.
+
+ The grammar allows free text (and native thinking blocks) but forces any
+ tool-call envelope the model opens to carry a declared tool name and
+ schema-valid arguments. Returns None when no constraint applies
+ (tool_choice "none", or no function tools declared). Raises
+ ResponseFormatError for shapes strict mode cannot honestly enforce.
+ """
+ if isinstance(tool_choice, str) and tool_choice == "none":
+ return None
+ functions = _function_tools(tools)
+ if not functions:
+ return None
+ if tool_choice is not None and tool_choice != "auto":
+ raise ResponseFormatError(
+ "strict tool calls support tool_choice 'auto' or 'none' only; "
+ f"got {tool_choice!r}"
+ )
+ if not LLGUIDANCE_AVAILABLE:
+ raise ResponseFormatError(
+ "strict tool calls require the optional llguidance dependency "
+ "(pip install llguidance)"
+ )
+ if (
+ _single_token_id(tokenizer, TOOL_CALL_START) is None
+ or _single_token_id(tokenizer, TOOL_CALL_END) is None
+ ):
+ raise ResponseFormatError(
+ "strict tool calls require the chat template's tool-call markers "
+ f"({TOOL_CALL_START} / {TOOL_CALL_END}) to be single special "
+ "tokens; this model's template is not supported yet"
+ )
+ include_think = (
+ _single_token_id(tokenizer, THINK_START) is not None
+ and _single_token_id(tokenizer, THINK_END) is not None
+ )
+ cache_key = "structtool:" + json.dumps(
+ {
+ "functions": [[name, schema] for name, schema in functions],
+ "think": include_think,
+ "llg": LLGUIDANCE_VERSION,
+ },
+ sort_keys=True,
+ separators=(",", ":"),
+ )
+ with _CACHE_LOCK:
+ cached = _GRAMMAR_CACHE.get(cache_key)
+ if cached is not None:
+ _GRAMMAR_CACHE.move_to_end(cache_key)
+ return ConstraintSpec(grammar=cached, source_type="tool_call_strict")
+ grammar = _tool_call_lark_grammar(functions, include_think=include_think)
+ err = _llg.LLMatcher.validate_grammar(grammar)
+ if err:
+ raise ResponseFormatError(f"unsupported tool schema: {err}")
+ with _CACHE_LOCK:
+ _GRAMMAR_CACHE[cache_key] = grammar
+ while len(_GRAMMAR_CACHE) > _GRAMMAR_CACHE_MAX:
+ _GRAMMAR_CACHE.popitem(last=False)
+ return ConstraintSpec(grammar=grammar, source_type="tool_call_strict")
+
+
+def _function_tools(tools: Any) -> list[tuple[str, dict[str, Any]]]:
+ if not isinstance(tools, list):
+ return []
+ functions: list[tuple[str, dict[str, Any]]] = []
+ for tool in tools:
+ if not isinstance(tool, dict):
+ raise ResponseFormatError("each tool must be an object")
+ function = tool.get("function") if tool.get("type") == "function" else None
+ if function is None and "name" in tool:
+ function = tool
+ if not isinstance(function, dict):
+ continue
+ name = function.get("name")
+ if not isinstance(name, str) or not name:
+ raise ResponseFormatError("each function tool must declare a name")
+ parameters = function.get("parameters")
+ if parameters is None:
+ parameters = {"type": "object"}
+ if not isinstance(parameters, dict):
+ raise ResponseFormatError(
+ f"tool {name!r} parameters must be a JSON Schema object"
+ )
+ functions.append((name, parameters))
+ return functions
+
+
+def _lark_string(text: str) -> str:
+ """A lark string literal; JSON escaping is a valid subset."""
+ return json.dumps(text)
+
+
+_THINK_PRELUDE_DEFAULT_MAX_CHARS = 4000
+
+def _think_prelude_max_chars() -> int:
+ """Character cap on the reasoning segment that precedes constrained output.
+
+ The think prelude exists because Qwen-style templates open ```` inside
+ the generation prompt, so generation starts mid-reasoning and the grammar must
+ allow the model back out (see #186). That prelude was unbounded free text, which
+ makes one failure mode *legal*: a model that never emits ```` stays inside
+ the prelude and fills ``max_tokens`` with prose, returning no document at all.
+ Reported symptom on the tool-call side in #196 ("the content channel fills with
+ the model's reasoning narration ... until finish: length, no tool call emitted").
+
+ Bounding the prelude regex makes the grammar itself force the close. Because the
+ bound is carried by the sampling-time token mask rather than by scheduler state,
+ it cannot go stale under speculative decoding -- the failure mode that silently
+ disabled vLLM's thinking budget whenever MTP was on, fixed only in vLLM 0.21.0.
+
+ ``MTPLX_THINK_PRELUDE_MAX_CHARS=0`` restores the previous unbounded behaviour.
+ """
+ raw = os.environ.get("MTPLX_THINK_PRELUDE_MAX_CHARS")
+ if raw is None or raw.strip() == "":
+ return _THINK_PRELUDE_DEFAULT_MAX_CHARS
+ try:
+ value = int(raw)
+ except ValueError:
+ return _THINK_PRELUDE_DEFAULT_MAX_CHARS
+ return value if value > 0 else 0
+
+
+def _prelude_terminal(max_chars: int) -> str:
+ """The prelude's own terminal, so bounding it never touches tail/free text."""
+ if max_chars <= 0:
+ return "PRELUDE_TEXT: /(.|\\n)*/\n"
+ return f"PRELUDE_TEXT: /(.|\\n){{0,{max_chars}}}/\n"
+
+
+def _tool_call_lark_grammar(
+ functions: list[tuple[str, dict[str, Any]]],
+ *,
+ include_think: bool,
+) -> str:
+ """Free text + forced tool-call envelopes as a lark grammar.
+
+ Special tokens must appear at the rule level (llguidance rejects them
+ inside terminals), and the closing marker must be a bare special-token
+ reference — inside a quoted string it would match bytes the special
+ token never produces.
+ """
+ alternatives = []
+ for name, schema in functions:
+ name_inner = json.dumps(name)[1:-1]
+ head = f'\n{{"name": "{name_inner}", "arguments": '
+ alternatives.append(
+ f"TAG_TEXT {_lark_string(head)} %json "
+ f"{json.dumps(schema)} {_lark_string('}')} {_lark_string(chr(10))} "
+ ""
+ )
+ if include_think:
+ alternatives.append("TAG_TEXT TAG_TEXT ")
+ seg = "seg: " + "\n | ".join(alternatives)
+ # The optional prelude closes a thinking block the chat template opened
+ # inside the generation prompt (Qwen renders `<|im_start|>assistant\n
+ # \n`, so generation begins mid-think and must be allowed out).
+ prelude = "prelude: PRELUDE_TEXT \n" if include_think else ""
+ prelude_terminal = (
+ _prelude_terminal(_think_prelude_max_chars()) if include_think else ""
+ )
+ start = "start: prelude? (seg)* tail\n" if include_think else "start: (seg)* tail\n"
+ return (
+ "%llguidance {}\n"
+ f"{start}"
+ f"{prelude}"
+ "tail: TAG_TEXT\n"
+ "TAG_TEXT: /(.|\\n)*/\n"
+ f"{prelude_terminal}"
+ f"{seg}\n"
+ )
+
+
+def _single_token_id(tokenizer: Any, text: str) -> int | None:
+ unwrapped = _unwrap_hf_tokenizer(tokenizer)
+ try:
+ ids = unwrapped.encode(text, add_special_tokens=False)
+ except Exception:
+ return None
+ return int(ids[0]) if len(ids) == 1 else None
+
+
+class GrammarConstraint:
+ """Per-generation matcher state: mask logits rows, advance per token.
+
+ The llguidance tokenizer wrap needs the model's logits width (which can
+ exceed the tokenizer vocab on padded lm_heads), so binding is deferred to
+ the first ``mask_logits_row`` call, where the row's shape provides it.
+ Tokens beyond the tokenizer vocab are always masked out.
+ """
+
+ def __init__(self, grammar: str, tokenizer: Any):
+ self._grammar = grammar
+ self._tokenizer = tokenizer
+ self._matcher: Any | None = None
+ self._bitmask: Any | None = None
+ self.masked_steps = 0
+ self.mask_time_s = 0.0
+
+ def _bind(self, n_vocab: int) -> None:
+ ll_tokenizer = _cached_ll_tokenizer(self._tokenizer, n_vocab)
+ matcher = _llg.LLMatcher(ll_tokenizer, self._grammar)
+ err = matcher.get_error()
+ if err:
+ raise ResponseFormatError(f"response_format grammar rejected: {err}")
+ self._matcher = matcher
+ self._bitmask = _llg_mlx.allocate_token_bitmask(1, n_vocab)
+
+ def mask_logits_row(self, row: Any) -> Any:
+ """Apply the current-step token mask to a 1-D logits row (mx.array)."""
+ if self._matcher is None:
+ self._bind(int(row.shape[-1]))
+ if self._matcher.is_stopped():
+ return row
+ started = time.perf_counter()
+ _llg_mlx.fill_next_token_bitmask(self._matcher, self._bitmask)
+ masked = _llg_mlx.apply_token_bitmask(row.reshape(1, -1), self._bitmask)
+ self.mask_time_s += time.perf_counter() - started
+ self.masked_steps += 1
+ return masked.reshape(row.shape)
+
+ def advance(self, token_id: int) -> None:
+ if self._matcher is None or self._matcher.is_stopped():
+ return
+ self._matcher.consume_token(int(token_id))
+ err = self._matcher.get_error()
+ if err:
+ # A committed token the grammar rejects means the decode loop
+ # desynced from the matcher — fail loudly rather than stream
+ # unconstrained output labeled as completed.
+ raise RuntimeError(
+ f"constrained decoding desync on token {int(token_id)}: {err}"
+ )
+
+ def advance_many(self, token_ids: list[int]) -> None:
+ for token_id in token_ids:
+ self.advance(token_id)
+
+ def validate_prefix(self, token_ids: list[int]) -> int:
+ """How many of token_ids extend the current state legally (no mutation).
+
+ Speculative windows get clamped to this prefix; the matcher itself
+ only ever advances through tokens that were actually committed.
+ """
+ if not token_ids:
+ return 0
+ if self._matcher is None or self._matcher.is_stopped():
+ return 0
+ return int(self._matcher.validate_tokens([int(t) for t in token_ids]))
+
+ @property
+ def stopped(self) -> bool:
+ return self._matcher is not None and bool(self._matcher.is_stopped())
+
+ @property
+ def completed(self) -> bool:
+ """True when the emitted text is a complete document per the grammar."""
+ if self._matcher is None or self._matcher.get_error():
+ return False
+ return bool(self._matcher.is_accepting() or self._matcher.is_stopped())
+
+
+# --- caches ---------------------------------------------------------------
+#
+# A compiled grammar is schema- and engine-version-specific; the LLTokenizer
+# wrap is tokenizer-object- and vocab-width-specific. Both caches hold strong
+# references (the server keeps one tokenizer for its lifetime) and are
+# bounded, so id() reuse after GC cannot alias a live entry.
+
+_GRAMMAR_CACHE: OrderedDict[str, str] = OrderedDict()
+_GRAMMAR_CACHE_MAX = 64
+_TOKENIZER_CACHE: OrderedDict[tuple[int, int], tuple[Any, Any]] = OrderedDict()
+_TOKENIZER_CACHE_MAX = 4
+_CACHE_LOCK = threading.Lock()
+
+
+def _canonical_schema_json(schema: dict[str, Any]) -> str:
+ return json.dumps(schema, sort_keys=True, separators=(",", ":"))
+
+
+def _cached_grammar_for_schema(schema_json: str, *, think_prelude: bool = False) -> str:
+ prelude_max = _think_prelude_max_chars() if think_prelude else 0
+ key = (
+ f"{LLGUIDANCE_VERSION}:think={int(think_prelude)}"
+ f":pmax={prelude_max}:{schema_json}"
+ )
+ with _CACHE_LOCK:
+ cached = _GRAMMAR_CACHE.get(key)
+ if cached is not None:
+ _GRAMMAR_CACHE.move_to_end(key)
+ return cached
+ try:
+ if think_prelude:
+ grammar = (
+ "%llguidance {}\n"
+ "start: prelude? doc\n"
+ "prelude: PRELUDE_TEXT \n"
+ f"{_prelude_terminal(prelude_max)}"
+ f"doc: %json {schema_json}\n"
+ )
+ else:
+ grammar = _llg.LLMatcher.grammar_from_json_schema(schema_json)
+ except Exception as exc:
+ raise ResponseFormatError(f"unsupported JSON Schema: {exc}") from exc
+ err = _llg.LLMatcher.validate_grammar(grammar)
+ if err:
+ raise ResponseFormatError(f"unsupported JSON Schema: {err}")
+ with _CACHE_LOCK:
+ _GRAMMAR_CACHE[key] = grammar
+ while len(_GRAMMAR_CACHE) > _GRAMMAR_CACHE_MAX:
+ _GRAMMAR_CACHE.popitem(last=False)
+ return grammar
+
+
+def _unwrap_hf_tokenizer(tokenizer: Any) -> Any:
+ """Return the underlying fast tokenizer llguidance requires.
+
+ The runtime hands us mlx_lm's TokenizerWrapper, which delegates
+ attribute access to the fast tokenizer it holds but fails llguidance's
+ strict isinstance check; unwrap it when present.
+ """
+ import transformers
+
+ if isinstance(tokenizer, transformers.PreTrainedTokenizerFast):
+ return tokenizer
+ inner = getattr(tokenizer, "_tokenizer", None)
+ if inner is not None and isinstance(inner, transformers.PreTrainedTokenizerFast):
+ return inner
+ return tokenizer
+
+
+def _cached_ll_tokenizer(tokenizer: Any, n_vocab: int) -> Any:
+ tokenizer = _unwrap_hf_tokenizer(tokenizer)
+ key = (id(tokenizer), int(n_vocab))
+ with _CACHE_LOCK:
+ entry = _TOKENIZER_CACHE.get(key)
+ if entry is not None and entry[0] is tokenizer:
+ _TOKENIZER_CACHE.move_to_end(key)
+ return entry[1]
+ ll_tokenizer = _llg_hf.from_tokenizer(tokenizer, n_vocab=int(n_vocab))
+ with _CACHE_LOCK:
+ _TOKENIZER_CACHE[key] = (tokenizer, ll_tokenizer)
+ while len(_TOKENIZER_CACHE) > _TOKENIZER_CACHE_MAX:
+ _TOKENIZER_CACHE.popitem(last=False)
+ return ll_tokenizer
diff --git a/mtplx/context_copy.py b/mtplx/context_copy.py
new file mode 100644
index 000000000..c87e65172
--- /dev/null
+++ b/mtplx/context_copy.py
@@ -0,0 +1,151 @@
+"""Context-copy (prompt-lookup) speculative drafting for the MTP decode loop.
+
+Enabled by default; MTPLX_CONTEXT_COPY set to 0, false, or off disables it. When the
+tail of the generated stream matches an n-gram that occurs in the PROMPT, the prompt
+continuation is proposed verbatim as a block (up to MTPLX_CONTEXT_COPY_K tokens, with
+shorter blocks for weaker matches) and verified in one forward pass through the
+existing capture-commit verify path, so the MTP head is skipped for that cycle. When
+there is no match, the normal MTP round runs unchanged. Active at any temperature:
+greedy verifies by argmax match, and sampled decoding uses the same probability-ratio
+acceptance as the MTP path (the copy block is a point-mass proposal, so a copied
+token is accepted with the target's shaped probability and a rejection emits a
+residual sample), which keeps the output law exactly the target sampling
+distribution. Requests with repetition penalties fall back to the normal MTP round.
+
+Rationale: MTP heads draft novel tokens well but commit at most mtp_depth tokens per
+step, and they cannot open a long verbatim window. On grounded workloads (code edits,
+file re-emission, RAG) most of the output already exists in the prompt, where a copy
+block can commit far more per verify call (see the benchmarks in the pull request).
+The two mechanisms compose: copy when a prompt match exists, MTP otherwise.
+"""
+import os
+
+
+def context_copy_enabled() -> bool:
+ """Enabled by default. MTPLX_CONTEXT_COPY set to 0, false, or off disables it."""
+ return (os.environ.get("MTPLX_CONTEXT_COPY") or "").strip() not in {"0", "false", "off"}
+
+
+def context_copy_target_prefix_enabled() -> bool:
+ """Opt-in: run context-copy on the target_prefix lane (default OFF, so the
+ shipped/PR behaviour is byte-unchanged).
+
+ On this lane context-copy is a DRAFT SOURCE, not a block-round engine: a
+ prompt n-gram match starts a streak that feeds the copy continuation as
+ the depth-1 draft, so every forward keeps the lane's 2-row verify
+ geometry and the emitted stream is bit-exact to pure AR for any draft
+ source at any temperature (the accepted token is always the pre-sampled
+ target id). Block rounds -- whose T+1-row forwards leave M>2 kernel-path
+ ulps in retained cache rows and break AR-exactness -- remain
+ capture_commit-only.
+
+ The COMPILED K1 route keeps its device-draft (R1) contract, so when this
+ flag takes over, the compiled route STEPS ASIDE (like the
+ grammar-constraint case) and the request runs the non-compiled
+ target_prefix lane. The flag drives the lane switch REGARDLESS of
+ whether streaks fire, so flag-on + MTPLX_CONTEXT_COPY=0 is a clean
+ same-lane baseline.
+
+ Precedence: whole-MoE fusion needs the compiled route, and repetition
+ penalties disable context-copy; in both cases the compiled route is KEPT
+ and this flag is inert -- mirrored in the exact_a3b_target_prefix_factory
+ gate and the ccopy_active gate.
+ """
+ return (os.environ.get("MTPLX_CONTEXT_COPY_TARGET_PREFIX") or "").strip() in {
+ "1",
+ "true",
+ "on",
+ }
+
+
+def context_copy_block_k() -> int:
+ try:
+ return max(4, int(os.environ.get("MTPLX_CONTEXT_COPY_K") or 24))
+ except ValueError:
+ return 24
+
+
+def context_copy_ng_min() -> int:
+ try:
+ return max(2, int(os.environ.get("MTPLX_CONTEXT_COPY_NGMIN") or 6))
+ except ValueError:
+ return 6
+
+
+def context_copy_ng_max() -> int:
+ try:
+ return max(context_copy_ng_min(), int(os.environ.get("MTPLX_CONTEXT_COPY_NGMAX") or 10))
+ except ValueError:
+ return 10
+
+
+def context_copy_min_ext() -> int:
+ """Minimum backward match extension (beyond ng_min) required to fire a copy round.
+ Default 0: weak matches are allowed but propose only a SHORT block (see
+ block_for_ext), so a wrong incidental match wastes little."""
+ try:
+ return max(0, int(os.environ.get("MTPLX_CONTEXT_COPY_MINEXT") or 0))
+ except ValueError:
+ return 0
+
+
+# Confidence ladder: block length by backward match extension (0..ng_max-ng_min).
+# A longer suffix match earns a longer copy block, so a weak match only ever
+# risks a short, cheap verify while a strong match copies a full window.
+_BLOCK_LADDER = (8, 12, 16, 24, 32)
+
+
+def block_for_ext(ext: int, k_cap: int) -> int:
+ idx = max(0, min(int(ext), len(_BLOCK_LADDER) - 1))
+ return min(_BLOCK_LADDER[idx], max(4, k_cap))
+
+
+class NgramIndex:
+ """ng_min-gram index, built once over the prompt at setup: gram -> continuation
+ positions. find() is O(candidates) instead of an O(L) backward scan, which
+ keeps the proposer off the CPU-bound path at 16-32K contexts."""
+
+ def __init__(self, ng_min: int, ng_max: int, max_candidates: int = 32):
+ self.ng_min = ng_min
+ self.ng_max = ng_max
+ self.max_candidates = max_candidates
+ self.grams: dict[tuple, list[int]] = {}
+ self.indexed = 0
+
+ def sync(self, history: list[int]) -> None:
+ """Index grams ending at positions (self.indexed, len(history)]."""
+ for e in range(max(self.indexed + 1, self.ng_min), len(history) + 1):
+ self.grams.setdefault(tuple(history[e - self.ng_min:e]), []).append(e)
+ self.indexed = len(history)
+
+ def find(self, history: list[int], *, max_pos: int | None = None):
+ """Best match: (continuation_pos, extension) or (None, -1). Extension =
+ how many tokens beyond ng_min the match runs backwards (0..ng_max-ng_min),
+ a free confidence signal (longer suffix match -> longer safe block).
+ max_pos (exclusive) drops candidates with no continuation left in the
+ indexed region, so the best VALID match wins rather than a boundary
+ match being selected and then discarded by the caller."""
+ L = len(history)
+ if L < self.ng_min + 1:
+ return None, -1
+ cands = self.grams.get(tuple(history[-self.ng_min:]))
+ if not cands:
+ return None, -1
+ best_pos, best_ext = None, -1
+ max_ext = self.ng_max - self.ng_min
+ for pos in reversed(cands[-self.max_candidates:]):
+ if pos >= L: # the trailing gram itself
+ continue
+ if max_pos is not None and pos >= max_pos:
+ continue # no prompt continuation to copy
+ ext = 0 # longest backward extension wins,
+ while (ext < max_ext # most recent wins ties
+ and pos - self.ng_min - 1 - ext >= 0
+ and history[pos - self.ng_min - 1 - ext]
+ == history[L - self.ng_min - 1 - ext]):
+ ext += 1
+ if ext > best_ext:
+ best_ext, best_pos = ext, pos
+ if ext == max_ext:
+ break
+ return best_pos, best_ext
diff --git a/mtplx/dashboard/_static/assets/index-DaD2PKmU.js b/mtplx/dashboard/_static/assets/index-CMiJLDy7.js
similarity index 90%
rename from mtplx/dashboard/_static/assets/index-DaD2PKmU.js
rename to mtplx/dashboard/_static/assets/index-CMiJLDy7.js
index 07148c083..0c37769c5 100644
--- a/mtplx/dashboard/_static/assets/index-DaD2PKmU.js
+++ b/mtplx/dashboard/_static/assets/index-CMiJLDy7.js
@@ -1,4 +1,4 @@
-var Zj=e=>{throw TypeError(e)};var tx=(e,t,n)=>t.has(e)||Zj("Cannot "+n);var W=(e,t,n)=>(tx(e,t,"read from private field"),n?n.call(e):t.get(e)),qe=(e,t,n)=>t.has(e)?Zj("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ce=(e,t,n,r)=>(tx(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),at=(e,t,n)=>(tx(e,t,"access private method"),n);var vv=(e,t,n,r)=>({set _(i){Ce(e,t,i,n)},get _(){return W(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var yv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ft(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nx={exports:{}},th={};/**
+var Zj=e=>{throw TypeError(e)};var tx=(e,t,n)=>t.has(e)||Zj("Cannot "+n);var W=(e,t,n)=>(tx(e,t,"read from private field"),n?n.call(e):t.get(e)),qe=(e,t,n)=>t.has(e)?Zj("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ce=(e,t,n,r)=>(tx(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),at=(e,t,n)=>(tx(e,t,"access private method"),n);var vv=(e,t,n,r)=>({set _(i){Ce(e,t,i,n)},get _(){return W(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var yv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ft(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nx={exports:{}},nh={};/**
* @license React
* react-jsx-runtime.production.js
*
@@ -6,7 +6,7 @@ var Zj=e=>{throw TypeError(e)};var tx=(e,t,n)=>t.has(e)||Zj("Cannot "+n);var W=(
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var Jj;function rU(){if(Jj)return th;Jj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var l=null;if(s!==void 0&&(l=""+s),i.key!==void 0&&(l=""+i.key),"key"in i){s={};for(var c in i)c!=="key"&&(s[c]=i[c])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:s}}return th.Fragment=t,th.jsx=n,th.jsxs=n,th}var eP;function iU(){return eP||(eP=1,nx.exports=rU()),nx.exports}var T=iU(),rx={exports:{}},Ze={};/**
+ */var Jj;function rU(){if(Jj)return nh;Jj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var l=null;if(s!==void 0&&(l=""+s),i.key!==void 0&&(l=""+i.key),"key"in i){s={};for(var c in i)c!=="key"&&(s[c]=i[c])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:s}}return nh.Fragment=t,nh.jsx=n,nh.jsxs=n,nh}var eP;function iU(){return eP||(eP=1,nx.exports=rU()),nx.exports}var T=iU(),rx={exports:{}},Ze={};/**
* @license React
* react.production.js
*
@@ -14,7 +14,7 @@ var Zj=e=>{throw TypeError(e)};var tx=(e,t,n)=>t.has(e)||Zj("Cannot "+n);var W=(
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var tP;function aU(){if(tP)return Ze;tP=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),v=Symbol.iterator;function b(D){return D===null||typeof D!="object"?null:(D=v&&D[v]||D["@@iterator"],typeof D=="function"?D:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,x={};function _(D,U,Y){this.props=D,this.context=U,this.refs=x,this.updater=Y||S}_.prototype.isReactComponent={},_.prototype.setState=function(D,U){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,U,"setState")},_.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function O(){}O.prototype=_.prototype;function j(D,U,Y){this.props=D,this.context=U,this.refs=x,this.updater=Y||S}var E=j.prototype=new O;E.constructor=j,w(E,_.prototype),E.isPureReactComponent=!0;var A=Array.isArray;function M(){}var R={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function z(D,U,Y){var ue=Y.ref;return{$$typeof:e,type:D,key:U,ref:ue!==void 0?ue:null,props:Y}}function G(D,U){return z(D.type,U,D.props)}function $(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function B(D){var U={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(Y){return U[Y]})}var X=/\/+/g;function ee(D,U){return typeof D=="object"&&D!==null&&D.key!=null?B(""+D.key):U.toString(36)}function J(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(M,M):(D.status="pending",D.then(function(U){D.status==="pending"&&(D.status="fulfilled",D.value=U)},function(U){D.status==="pending"&&(D.status="rejected",D.reason=U)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function I(D,U,Y,ue,be){var Se=typeof D;(Se==="undefined"||Se==="boolean")&&(D=null);var ye=!1;if(D===null)ye=!0;else switch(Se){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(D.$$typeof){case e:case t:ye=!0;break;case m:return ye=D._init,I(ye(D._payload),U,Y,ue,be)}}if(ye)return be=be(D),ye=ue===""?"."+ee(D,0):ue,A(be)?(Y="",ye!=null&&(Y=ye.replace(X,"$&/")+"/"),I(be,U,Y,"",function(_e){return _e})):be!=null&&($(be)&&(be=G(be,Y+(be.key==null||D&&D.key===be.key?"":(""+be.key).replace(X,"$&/")+"/")+ye)),U.push(be)),1;ye=0;var Me=ue===""?".":ue+":";if(A(D))for(var de=0;de{throw TypeError(e)};var tx=(e,t,n)=>t.has(e)||Zj("Cannot "+n);var W=(
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var sP;function cU(){if(sP)return nh;sP=1;var e=sU(),t=HO(),n=uU();function r(a){var o="https://react.dev/errors/"+a;if(1V||(a.current=fe[V],fe[V]=null,V--)}function Y(a,o){V++,fe[V]=a.current,a.current=o}var ue=D(null),be=D(null),Se=D(null),ye=D(null);function Me(a,o){switch(Y(Se,o),Y(be,a),Y(ue,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?Sj(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=Sj(o),a=wj(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}U(ue),Y(ue,a)}function de(){U(ue),U(be),U(Se)}function _e(a){a.memoizedState!==null&&Y(ye,a);var o=ue.current,u=wj(o,a.type);o!==u&&(Y(be,a),Y(ue,u))}function Ee(a){be.current===a&&(U(ue),U(be)),ye.current===a&&(U(ye),Qd._currentValue=ae)}var he,Ie;function Te(a){if(he===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);he=o&&o[1]||"",Ie=-1V||(a.current=fe[V],fe[V]=null,V--)}function Y(a,o){V++,fe[V]=a.current,a.current=o}var ue=D(null),be=D(null),Se=D(null),ye=D(null);function Me(a,o){switch(Y(Se,o),Y(be,a),Y(ue,null),o.nodeType){case 9:case 11:a=(a=o.documentElement)&&(a=a.namespaceURI)?Sj(a):0;break;default:if(a=o.tagName,o=o.namespaceURI)o=Sj(o),a=wj(o,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}U(ue),Y(ue,a)}function de(){U(ue),U(be),U(Se)}function _e(a){a.memoizedState!==null&&Y(ye,a);var o=ue.current,u=wj(o,a.type);o!==u&&(Y(be,a),Y(ue,u))}function Ee(a){be.current===a&&(U(ue),U(be)),ye.current===a&&(U(ye),Zd._currentValue=ae)}var he,Ie;function Te(a){if(he===void 0)try{throw Error()}catch(u){var o=u.stack.trim().match(/\n( *(at )?)/);he=o&&o[1]||"",Ie=-1)":-1y||K[h]!==se[y]){var pe=`
`+K[h].replace(" at new "," at ");return a.displayName&&pe.includes("")&&(pe=pe.replace("",a.displayName)),pe}while(1<=h&&0<=y);break}}}finally{Xe=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?Te(u):""}function yt(a,o){switch(a.tag){case 26:case 27:case 5:return Te(a.type);case 16:return Te("Lazy");case 13:return a.child!==o&&o!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return nt(a.type,!1);case 11:return nt(a.type.render,!1);case 1:return nt(a.type,!0);case 31:return Te("Activity");default:return""}}function Qt(a){try{var o="",u=null;do o+=yt(a,u),u=a,a=a.return;while(a);return o}catch(h){return`
Error generating stack: `+h.message+`
-`+h.stack}}var Zt=Object.prototype.hasOwnProperty,pt=e.unstable_scheduleCallback,Nn=e.unstable_cancelCallback,On=e.unstable_shouldYield,Br=e.unstable_requestPaint,ze=e.unstable_now,je=e.unstable_getCurrentPriorityLevel,bt=e.unstable_ImmediatePriority,cn=e.unstable_UserBlockingPriority,pi=e.unstable_NormalPriority,Li=e.unstable_LowPriority,Tr=e.unstable_IdlePriority,mi=e.log,pr=e.unstable_setDisableYieldValue,kn=null,Bt=null;function Ln(a){if(typeof mi=="function"&&pr(a),Bt&&typeof Bt.setStrictMode=="function")try{Bt.setStrictMode(kn,a)}catch{}}var mr=Math.clz32?Math.clz32:ro,Lu=Math.log,rs=Math.LN2;function ro(a){return a>>>=0,a===0?32:31-(Lu(a)/rs|0)|0}var io=256,vr=262144,is=4194304;function Ma(a){var o=a&42;if(o!==0)return o;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function zu(a,o,u){var h=a.pendingLanes;if(h===0)return 0;var y=0,g=a.suspendedLanes,P=a.pingedLanes;a=a.warmLanes;var L=h&134217727;return L!==0?(h=L&~g,h!==0?y=Ma(h):(P&=L,P!==0?y=Ma(P):u||(u=L&~a,u!==0&&(y=Ma(u))))):(L=h&~g,L!==0?y=Ma(L):P!==0?y=Ma(P):u||(u=h&~a,u!==0&&(y=Ma(u)))),y===0?0:o!==0&&o!==y&&(o&g)===0&&(g=y&-y,u=o&-o,g>=u||g===32&&(u&4194048)!==0)?o:y}function vl(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function o0(a,o){switch(a){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Wp(){var a=is;return is<<=1,(is&62914560)===0&&(is=4194304),a}function rd(a){for(var o=[],u=0;31>u;u++)o.push(a);return o}function vi(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function ir(a,o,u,h,y,g){var P=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var L=a.entanglements,K=a.expirationTimes,se=a.hiddenUpdates;for(u=P&~u;0"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var s0=/[\n"\\]/g;function Ir(a){return a.replace(s0,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Vu(a,o,u,h,y,g,P,L){a.name="",P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?a.type=P:a.removeAttribute("type"),o!=null?P==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+qr(o)):a.value!==""+qr(o)&&(a.value=""+qr(o)):P!=="submit"&&P!=="reset"||a.removeAttribute("value"),o!=null?Hu(a,P,qr(o)):u!=null?Hu(a,P,qr(u)):h!=null&&a.removeAttribute("value"),y==null&&g!=null&&(a.defaultChecked=!!g),y!=null&&(a.checked=y&&typeof y!="function"&&typeof y!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?a.name=""+qr(L):a.removeAttribute("name")}function Jp(a,o,u,h,y,g,P,L){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(a.type=g),o!=null||u!=null){if(!(g!=="submit"&&g!=="reset"||o!=null)){Iu(a);return}u=u!=null?""+qr(u):"",o=o!=null?""+qr(o):u,L||o===a.value||(a.value=o),a.defaultValue=o}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=L?a.checked:!!h,a.defaultChecked=!!h,P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"&&(a.name=P),Iu(a)}function Hu(a,o,u){o==="number"&&Uu(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function Ca(a,o,u,h){if(a=a.options,o){o={};for(var y=0;y"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yu=!1;if(jr)try{var fs={};Object.defineProperty(fs,"passive",{get:function(){Yu=!0}}),window.addEventListener("test",fs,fs),window.removeEventListener("test",fs,fs)}catch{Yu=!1}var Vr=null,Ra=null,wl=null;function hd(){if(wl)return wl;var a,o=Ra,u=o.length,h,y="value"in Vr?Vr.value:Vr.textContent,g=y.length;for(a=0;a=ms),Sd=" ",fo=!1;function Tl(a,o){switch(a){case"keyup":return cm.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function En(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var ho=!1;function gn(a,o){switch(a){case"compositionend":return En(o);case"keypress":return o.which!==32?null:(fo=!0,Sd);case"textInput":return a=o.data,a===Sd&&fo?null:a;default:return null}}function fm(a,o){if(ho)return a==="compositionend"||!Xu&&Tl(a,o)?(a=hd(),wl=Ra=Vr=null,ho=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:u,offset:o-a};a=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Ve(u)}}function qt(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?qt(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function nn(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Uu(a.document);o instanceof a.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)a=o.contentWindow;else break;o=Uu(a.document)}return o}function bn(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var Pt=jr&&"documentMode"in document&&11>=document.documentMode,Lt=null,gr=null,Mn=null,Pr=!1;function Jr(a,o,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Pr||Lt==null||Lt!==Uu(h)||(h=Lt,"selectionStart"in h&&bn(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Mn&&et(Mn,h)||(Mn=h,h=tv(gr,"onSelect"),0>=P,y-=P,La=1<<32-mr(o)+y|u<it?(dt=$e,$e=null):dt=$e.sibling;var wt=le(re,$e,oe[it],ge);if(wt===null){$e===null&&($e=dt);break}a&&$e&&wt.alternate===null&&o(re,$e),ne=g(wt,ne,it),St===null?Ue=wt:St.sibling=wt,St=wt,$e=dt}if(it===oe.length)return u(re,$e),mt&&vo(re,it),Ue;if($e===null){for(;itit?(dt=$e,$e=null):dt=$e.sibling;var $s=le(re,$e,wt.value,ge);if($s===null){$e===null&&($e=dt);break}a&&$e&&$s.alternate===null&&o(re,$e),ne=g($s,ne,it),St===null?Ue=$s:St.sibling=$s,St=$s,$e=dt}if(wt.done)return u(re,$e),mt&&vo(re,it),Ue;if($e===null){for(;!wt.done;it++,wt=oe.next())wt=xe(re,wt.value,ge),wt!==null&&(ne=g(wt,ne,it),St===null?Ue=wt:St.sibling=wt,St=wt);return mt&&vo(re,it),Ue}for($e=h($e);!wt.done;it++,wt=oe.next())wt=ce($e,re,it,wt.value,ge),wt!==null&&(a&&wt.alternate!==null&&$e.delete(wt.key===null?it:wt.key),ne=g(wt,ne,it),St===null?Ue=wt:St.sibling=wt,St=wt);return a&&$e.forEach(function(nU){return o(re,nU)}),mt&&vo(re,it),Ue}function Vt(re,ne,oe,ge){if(typeof oe=="object"&&oe!==null&&oe.type===w&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:e:{for(var Ue=oe.key;ne!==null;){if(ne.key===Ue){if(Ue=oe.type,Ue===w){if(ne.tag===7){u(re,ne.sibling),ge=y(ne,oe.props.children),ge.return=re,re=ge;break e}}else if(ne.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===k&&Nl(Ue)===ne.type){u(re,ne.sibling),ge=y(ne,oe.props),Md(ge,oe),ge.return=re,re=ge;break e}u(re,ne);break}else o(re,ne);ne=ne.sibling}oe.type===w?(ge=jl(oe.props.children,re.mode,ge,oe.key),ge.return=re,re=ge):(ge=gm(oe.type,oe.key,oe.props,null,re.mode,ge),Md(ge,oe),ge.return=re,re=ge)}return P(re);case S:e:{for(Ue=oe.key;ne!==null;){if(ne.key===Ue)if(ne.tag===4&&ne.stateNode.containerInfo===oe.containerInfo&&ne.stateNode.implementation===oe.implementation){u(re,ne.sibling),ge=y(ne,oe.children||[]),ge.return=re,re=ge;break e}else{u(re,ne);break}else o(re,ne);ne=ne.sibling}ge=b0(oe,re.mode,ge),ge.return=re,re=ge}return P(re);case k:return oe=Nl(oe),Vt(re,ne,oe,ge)}if(J(oe))return Le(re,ne,oe,ge);if(B(oe)){if(Ue=B(oe),typeof Ue!="function")throw Error(r(150));return oe=Ue.call(oe),He(re,ne,oe,ge)}if(typeof oe.then=="function")return Vt(re,ne,Om(oe),ge);if(oe.$$typeof===j)return Vt(re,ne,Sm(re,oe),ge);Tm(re,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,ne!==null&&ne.tag===6?(u(re,ne.sibling),ge=y(ne,oe),ge.return=re,re=ge):(u(re,ne),ge=g0(oe,re.mode,ge),ge.return=re,re=ge),P(re)):u(re,ne)}return function(re,ne,oe,ge){try{Ed=0;var Ue=Vt(re,ne,oe,ge);return ac=null,Ue}catch($e){if($e===ic||$e===_m)throw $e;var St=bi(29,$e,null,re.mode);return St.lanes=ge,St.return=re,St}finally{}}}var Ll=dE(!0),hE=dE(!1),Ss=!1;function C0(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function D0(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ws(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function _s(a,o,u){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,(Tt&2)!==0){var y=h.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),h.pending=o,o=ym(a),W2(a,null,u),o}return vm(a,h,o,u),ym(a)}function jd(a,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194048)!==0)){var h=o.lanes;h&=a.pendingLanes,u|=h,o.lanes=u,ao(a,u)}}function R0(a,o){var u=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var y=null,g=null;if(u=u.firstBaseUpdate,u!==null){do{var P={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};g===null?y=g=P:g=g.next=P,u=u.next}while(u!==null);g===null?y=g=o:g=g.next=o}else y=g=o;u={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:g,shared:h.shared,callbacks:h.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=o:a.next=o,u.lastBaseUpdate=o}var N0=!1;function Pd(){if(N0){var a=rc;if(a!==null)throw a}}function Cd(a,o,u,h){N0=!1;var y=a.updateQueue;Ss=!1;var g=y.firstBaseUpdate,P=y.lastBaseUpdate,L=y.shared.pending;if(L!==null){y.shared.pending=null;var K=L,se=K.next;K.next=null,P===null?g=se:P.next=se,P=K;var pe=a.alternate;pe!==null&&(pe=pe.updateQueue,L=pe.lastBaseUpdate,L!==P&&(L===null?pe.firstBaseUpdate=se:L.next=se,pe.lastBaseUpdate=K))}if(g!==null){var xe=y.baseState;P=0,pe=se=K=null,L=g;do{var le=L.lane&-536870913,ce=le!==L.lane;if(ce?(ft&le)===le:(h&le)===le){le!==0&&le===nc&&(N0=!0),pe!==null&&(pe=pe.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Le=a,He=L;le=o;var Vt=u;switch(He.tag){case 1:if(Le=He.payload,typeof Le=="function"){xe=Le.call(Vt,xe,le);break e}xe=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=He.payload,le=typeof Le=="function"?Le.call(Vt,xe,le):Le,le==null)break e;xe=p({},xe,le);break e;case 2:Ss=!0}}le=L.callback,le!==null&&(a.flags|=64,ce&&(a.flags|=8192),ce=y.callbacks,ce===null?y.callbacks=[le]:ce.push(le))}else ce={lane:le,tag:L.tag,payload:L.payload,callback:L.callback,next:null},pe===null?(se=pe=ce,K=xe):pe=pe.next=ce,P|=le;if(L=L.next,L===null){if(L=y.shared.pending,L===null)break;ce=L,L=ce.next,ce.next=null,y.lastBaseUpdate=ce,y.shared.pending=null}}while(!0);pe===null&&(K=xe),y.baseState=K,y.firstBaseUpdate=se,y.lastBaseUpdate=pe,g===null&&(y.shared.lanes=0),Ms|=P,a.lanes=P,a.memoizedState=xe}}function pE(a,o){if(typeof a!="function")throw Error(r(191,a));a.call(o)}function mE(a,o){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;ag?g:8;var P=I.T,L={};I.T=L,J0(a,!1,o,u);try{var K=y(),se=I.S;if(se!==null&&se(L,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var pe=F8(K,h);Nd(a,o,pe,Ai(a))}else Nd(a,o,h,Ai(a))}catch(xe){Nd(a,o,{then:function(){},status:"rejected",reason:xe},Ai())}finally{F.p=g,P!==null&&L.types!==null&&(P.types=L.types),I.T=P}}function Q8(){}function Q0(a,o,u,h){if(a.tag!==5)throw Error(r(476));var y=KE(a).queue;GE(a,y,o,ae,u===null?Q8:function(){return YE(a),u(h)})}function KE(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xo,lastRenderedState:ae},next:null};var u={};return o.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xo,lastRenderedState:u},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function YE(a){var o=KE(a);o.next===null&&(o=a.alternate.memoizedState),Nd(a,o.next.queue,{},Ai())}function Z0(){return Sr(Qd)}function XE(){return Pn().memoizedState}function WE(){return Pn().memoizedState}function Z8(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var u=Ai();a=ws(u);var h=_s(o,a,u);h!==null&&(ai(h,o,u),jd(h,o,u)),o={cache:E0()},a.payload=o;return}o=o.return}}function J8(a,o,u){var h=Ai();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Lm(a)?ZE(o,u):(u=v0(a,o,u,h),u!==null&&(ai(u,a,h),JE(u,o,h)))}function QE(a,o,u){var h=Ai();Nd(a,o,u,h)}function Nd(a,o,u,h){var y={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Lm(a))ZE(o,y);else{var g=a.alternate;if(a.lanes===0&&(g===null||g.lanes===0)&&(g=o.lastRenderedReducer,g!==null))try{var P=o.lastRenderedState,L=g(P,u);if(y.hasEagerState=!0,y.eagerState=L,Ye(L,P))return vm(a,o,y,0),Gt===null&&mm(),!1}catch{}finally{}if(u=v0(a,o,y,h),u!==null)return ai(u,a,h),JE(u,o,h),!0}return!1}function J0(a,o,u,h){if(h={lane:2,revertLane:Cb(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Lm(a)){if(o)throw Error(r(479))}else o=v0(a,u,h,2),o!==null&&ai(o,a,2)}function Lm(a){var o=a.alternate;return a===rt||o!==null&&o===rt}function ZE(a,o){sc=jm=!0;var u=a.pending;u===null?o.next=o:(o.next=u.next,u.next=o),a.pending=o}function JE(a,o,u){if((u&4194048)!==0){var h=o.lanes;h&=a.pendingLanes,u|=h,o.lanes=u,ao(a,u)}}var kd={readContext:Sr,use:Dm,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useLayoutEffect:xn,useInsertionEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useSyncExternalStore:xn,useId:xn,useHostTransitionStatus:xn,useFormState:xn,useActionState:xn,useOptimistic:xn,useMemoCache:xn,useCacheRefresh:xn};kd.useEffectEvent=xn;var eM={readContext:Sr,use:Dm,useCallback:function(a,o){return Fr().memoizedState=[a,o===void 0?null:o],a},useContext:Sr,useEffect:zE,useImperativeHandle:function(a,o,u){u=u!=null?u.concat([a]):null,Nm(4194308,4,IE.bind(null,o,a),u)},useLayoutEffect:function(a,o){return Nm(4194308,4,a,o)},useInsertionEffect:function(a,o){Nm(4,2,a,o)},useMemo:function(a,o){var u=Fr();o=o===void 0?null:o;var h=a();if(zl){Ln(!0);try{a()}finally{Ln(!1)}}return u.memoizedState=[h,o],h},useReducer:function(a,o,u){var h=Fr();if(u!==void 0){var y=u(o);if(zl){Ln(!0);try{u(o)}finally{Ln(!1)}}}else y=o;return h.memoizedState=h.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},h.queue=a,a=a.dispatch=J8.bind(null,rt,a),[h.memoizedState,a]},useRef:function(a){var o=Fr();return a={current:a},o.memoizedState=a},useState:function(a){a=G0(a);var o=a.queue,u=QE.bind(null,rt,o);return o.dispatch=u,[a.memoizedState,u]},useDebugValue:X0,useDeferredValue:function(a,o){var u=Fr();return W0(u,a,o)},useTransition:function(){var a=G0(!1);return a=GE.bind(null,rt,a.queue,!0,!1),Fr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,u){var h=rt,y=Fr();if(mt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=o(),Gt===null)throw Error(r(349));(ft&127)!==0||SE(h,o,u)}y.memoizedState=u;var g={value:u,getSnapshot:o};return y.queue=g,zE(_E.bind(null,h,g,a),[a]),h.flags|=2048,uc(9,{destroy:void 0},wE.bind(null,h,g,u,o),null),u},useId:function(){var a=Fr(),o=Gt.identifierPrefix;if(mt){var u=za,h=La;u=(h&~(1<<32-mr(h)-1)).toString(32)+u,o="_"+o+"R_"+u,u=Pm++,0<\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof h.is=="string"?P.createElement("select",{is:h.is}):P.createElement("select"),h.multiple?g.multiple=!0:h.size&&(g.size=h.size);break;default:g=typeof h.is=="string"?P.createElement(y,{is:h.is}):P.createElement(y)}}g[Fn]=o,g[Mr]=h;e:for(P=o.child;P!==null;){if(P.tag===5||P.tag===6)g.appendChild(P.stateNode);else if(P.tag!==4&&P.tag!==27&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===o)break e;for(;P.sibling===null;){if(P.return===null||P.return===o)break e;P=P.return}P.sibling.return=P.return,P=P.sibling}o.stateNode=g;e:switch(_r(g,y,h),y){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&wo(o)}}return an(o),hb(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,u),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==h&&wo(o);else{if(typeof h!="string"&&o.stateNode===null)throw Error(r(166));if(a=Se.current,ec(o)){if(a=o.stateNode,u=o.memoizedProps,h=null,y=xr,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}a[Fn]=o,a=!!(a.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||bj(a.nodeValue,u)),a||bs(o,!0)}else a=nv(a).createTextNode(h),a[Fn]=o,o.stateNode=a}return an(o),null;case 31:if(u=o.memoizedState,a===null||a.memoizedState!==null){if(h=ec(o),u!==null){if(a===null){if(!h)throw Error(r(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[Fn]=o}else Pl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;an(o),a=!1}else u=_0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return o.flags&256?(Si(o),o):(Si(o),null);if((o.flags&128)!==0)throw Error(r(558))}return an(o),null;case 13:if(h=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=ec(o),h!==null&&h.dehydrated!==null){if(a===null){if(!y)throw Error(r(318));if(y=o.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[Fn]=o}else Pl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;an(o),y=!1}else y=_0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=y),y=!0;if(!y)return o.flags&256?(Si(o),o):(Si(o),null)}return Si(o),(o.flags&128)!==0?(o.lanes=u,o):(u=h!==null,a=a!==null&&a.memoizedState!==null,u&&(h=o.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool),g=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(g=h.memoizedState.cachePool.pool),g!==y&&(h.flags|=2048)),u!==a&&u&&(o.child.flags|=8192),Im(o,o.updateQueue),an(o),null);case 4:return de(),a===null&&kb(o.stateNode.containerInfo),an(o),null;case 10:return go(o.type),an(o),null;case 19:if(U(jn),h=o.memoizedState,h===null)return an(o),null;if(y=(o.flags&128)!==0,g=h.rendering,g===null)if(y)zd(h,!1);else{if(Sn!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(g=Mm(a),g!==null){for(o.flags|=128,zd(h,!1),a=g.updateQueue,o.updateQueue=a,Im(o,a),o.subtreeFlags=0,a=u,u=o.child;u!==null;)Q2(u,a),u=u.sibling;return Y(jn,jn.current&1|2),mt&&vo(o,h.treeForkCount),o.child}a=a.sibling}h.tail!==null&&ze()>Gm&&(o.flags|=128,y=!0,zd(h,!1),o.lanes=4194304)}else{if(!y)if(a=Mm(g),a!==null){if(o.flags|=128,y=!0,a=a.updateQueue,o.updateQueue=a,Im(o,a),zd(h,!0),h.tail===null&&h.tailMode==="hidden"&&!g.alternate&&!mt)return an(o),null}else 2*ze()-h.renderingStartTime>Gm&&u!==536870912&&(o.flags|=128,y=!0,zd(h,!1),o.lanes=4194304);h.isBackwards?(g.sibling=o.child,o.child=g):(a=h.last,a!==null?a.sibling=g:o.child=g,h.last=g)}return h.tail!==null?(a=h.tail,h.rendering=a,h.tail=a.sibling,h.renderingStartTime=ze(),a.sibling=null,u=jn.current,Y(jn,y?u&1|2:u&1),mt&&vo(o,h.treeForkCount),a):(an(o),null);case 22:case 23:return Si(o),L0(),h=o.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(o.flags|=8192):h&&(o.flags|=8192),h?(u&536870912)!==0&&(o.flags&128)===0&&(an(o),o.subtreeFlags&6&&(o.flags|=8192)):an(o),u=o.updateQueue,u!==null&&Im(o,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048),a!==null&&U(Rl),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),go($n),an(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function iI(a,o){switch(S0(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return go($n),de(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return Ee(o),null;case 31:if(o.memoizedState!==null){if(Si(o),o.alternate===null)throw Error(r(340));Pl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(Si(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Pl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return U(jn),null;case 4:return de(),null;case 10:return go(o.type),null;case 22:case 23:return Si(o),L0(),a!==null&&U(Rl),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return go($n),null;case 25:return null;default:return null}}function AM(a,o){switch(S0(o),o.tag){case 3:go($n),de();break;case 26:case 27:case 5:Ee(o);break;case 4:de();break;case 31:o.memoizedState!==null&&Si(o);break;case 13:Si(o);break;case 19:U(jn);break;case 10:go(o.type);break;case 22:case 23:Si(o),L0(),a!==null&&U(Rl);break;case 24:go($n)}}function $d(a,o){try{var u=o.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&a)===a){h=void 0;var g=u.create,P=u.inst;h=g(),P.destroy=h}u=u.next}while(u!==y)}}catch(L){$t(o,o.return,L)}}function Ts(a,o,u){try{var h=o.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var g=y.next;h=g;do{if((h.tag&a)===a){var P=h.inst,L=P.destroy;if(L!==void 0){P.destroy=void 0,y=o;var K=u,se=L;try{se()}catch(pe){$t(y,K,pe)}}}h=h.next}while(h!==g)}}catch(pe){$t(o,o.return,pe)}}function OM(a){var o=a.updateQueue;if(o!==null){var u=a.stateNode;try{mE(o,u)}catch(h){$t(a,a.return,h)}}}function TM(a,o,u){u.props=$l(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(h){$t(a,o,h)}}function Bd(a,o){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var h=a.stateNode;break;case 30:h=a.stateNode;break;default:h=a.stateNode}typeof u=="function"?a.refCleanup=u(h):u.current=h}}catch(y){$t(a,o,y)}}function $a(a,o){var u=a.ref,h=a.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(y){$t(a,o,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){$t(a,o,y)}else u.current=null}function EM(a){var o=a.type,u=a.memoizedProps,h=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(y){$t(a,a.return,y)}}function pb(a,o,u){try{var h=a.stateNode;TI(h,a.type,u,o),h[Mr]=o}catch(y){$t(a,a.return,y)}}function MM(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Rs(a.type)||a.tag===4}function mb(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||MM(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Rs(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function vb(a,o,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,o?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,o):(o=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,o.appendChild(a),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=Ur));else if(h!==4&&(h===27&&Rs(a.type)&&(u=a.stateNode,o=null),a=a.child,a!==null))for(vb(a,o,u),a=a.sibling;a!==null;)vb(a,o,u),a=a.sibling}function Um(a,o,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,o?u.insertBefore(a,o):u.appendChild(a);else if(h!==4&&(h===27&&Rs(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(Um(a,o,u),a=a.sibling;a!==null;)Um(a,o,u),a=a.sibling}function jM(a){var o=a.stateNode,u=a.memoizedProps;try{for(var h=a.type,y=o.attributes;y.length;)o.removeAttributeNode(y[0]);_r(o,h,u),o[Fn]=a,o[Mr]=u}catch(g){$t(a,a.return,g)}}var _o=!1,In=!1,yb=!1,PM=typeof WeakSet=="function"?WeakSet:Set,lr=null;function aI(a,o){if(a=a.containerInfo,$b=uv,a=nn(a),bn(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var y=h.anchorOffset,g=h.focusNode;h=h.focusOffset;try{u.nodeType,g.nodeType}catch{u=null;break e}var P=0,L=-1,K=-1,se=0,pe=0,xe=a,le=null;t:for(;;){for(var ce;xe!==u||y!==0&&xe.nodeType!==3||(L=P+y),xe!==g||h!==0&&xe.nodeType!==3||(K=P+h),xe.nodeType===3&&(P+=xe.nodeValue.length),(ce=xe.firstChild)!==null;)le=xe,xe=ce;for(;;){if(xe===a)break t;if(le===u&&++se===y&&(L=P),le===g&&++pe===h&&(K=P),(ce=xe.nextSibling)!==null)break;xe=le,le=xe.parentNode}xe=ce}u=L===-1||K===-1?null:{start:L,end:K}}else u=null}u=u||{start:0,end:0}}else u=null;for(Bb={focusedElem:a,selectionRange:u},uv=!1,lr=o;lr!==null;)if(o=lr,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,lr=a;else for(;lr!==null;){switch(o=lr,g=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u title"))),_r(g,h,u),g[Fn]=a,Tn(g),h=g;break e;case"link":var P=Lj("link","href",y).get(h+(u.href||""));if(P){for(var L=0;LVt&&(P=Vt,Vt=He,He=P);var re=Be(L,He),ne=Be(L,Vt);if(re&&ne&&(ce.rangeCount!==1||ce.anchorNode!==re.node||ce.anchorOffset!==re.offset||ce.focusNode!==ne.node||ce.focusOffset!==ne.offset)){var oe=xe.createRange();oe.setStart(re.node,re.offset),ce.removeAllRanges(),He>Vt?(ce.addRange(oe),ce.extend(ne.node,ne.offset)):(oe.setEnd(ne.node,ne.offset),ce.addRange(oe))}}}}for(xe=[],ce=L;ce=ce.parentNode;)ce.nodeType===1&&xe.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;Lu?32:u,I.T=null,u=Ab,Ab=null;var g=Ps,P=Mo;if(Gn=0,pc=Ps=null,Mo=0,(Tt&6)!==0)throw Error(r(331));var L=Tt;if(Tt|=4,IM(g.current),$M(g,g.current,P,u),Tt=L,Fd(0,!1),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(kn,g)}catch{}return!0}finally{F.p=y,I.T=h,aj(a,o)}}function sj(a,o,u){o=Ii(u,o),o=rb(a.stateNode,o,2),a=_s(a,o,2),a!==null&&(vi(a,2),Ba(a))}function $t(a,o,u){if(a.tag===3)sj(a,a,u);else for(;o!==null;){if(o.tag===3){sj(o,a,u);break}else if(o.tag===1){var h=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(js===null||!js.has(h))){a=Ii(u,a),u=lM(2),h=_s(o,u,2),h!==null&&(uM(u,h,o,a),vi(h,2),Ba(h));break}}o=o.return}}function Mb(a,o,u){var h=a.pingCache;if(h===null){h=a.pingCache=new lI;var y=new Set;h.set(o,y)}else y=h.get(o),y===void 0&&(y=new Set,h.set(o,y));y.has(u)||(xb=!0,y.add(u),a=hI.bind(null,a,o,u),o.then(a,a))}function hI(a,o,u){var h=a.pingCache;h!==null&&h.delete(o),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,Gt===a&&(ft&u)===u&&(Sn===4||Sn===3&&(ft&62914560)===ft&&300>ze()-Fm?(Tt&2)===0&&mc(a,0):Sb|=u,hc===ft&&(hc=0)),Ba(a)}function lj(a,o){o===0&&(o=Wp()),a=Ml(a,o),a!==null&&(vi(a,o),Ba(a))}function pI(a){var o=a.memoizedState,u=0;o!==null&&(u=o.retryLane),lj(a,u)}function mI(a,o){var u=0;switch(a.tag){case 31:case 13:var h=a.stateNode,y=a.memoizedState;y!==null&&(u=y.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(o),lj(a,u)}function vI(a,o){return pt(a,o)}var Zm=null,yc=null,jb=!1,Jm=!1,Pb=!1,Ds=0;function Ba(a){a!==yc&&a.next===null&&(yc===null?Zm=yc=a:yc=yc.next=a),Jm=!0,jb||(jb=!0,gI())}function Fd(a,o){if(!Pb&&Jm){Pb=!0;do for(var u=!1,h=Zm;h!==null;){if(a!==0){var y=h.pendingLanes;if(y===0)var g=0;else{var P=h.suspendedLanes,L=h.pingedLanes;g=(1<<31-mr(42|a)+1)-1,g&=y&~(P&~L),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(u=!0,dj(h,g))}else g=ft,g=zu(h,h===Gt?g:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(g&3)===0||vl(h,g)||(u=!0,dj(h,g));h=h.next}while(u);Pb=!1}}function yI(){uj()}function uj(){Jm=jb=!1;var a=0;Ds!==0&&MI()&&(a=Ds);for(var o=ze(),u=null,h=Zm;h!==null;){var y=h.next,g=cj(h,o);g===0?(h.next=null,u===null?Zm=y:u.next=y,y===null&&(yc=u)):(u=h,(a!==0||(g&3)!==0)&&(Jm=!0)),h=y}Gn!==0&&Gn!==5||Fd(a),Ds!==0&&(Ds=0)}function cj(a,o){for(var u=a.suspendedLanes,h=a.pingedLanes,y=a.expirationTimes,g=a.pendingLanes&-62914561;0L)break;var pe=K.transferSize,xe=K.initiatorType;pe&&xj(xe)&&(K=K.responseEnd,P+=pe*(K"u"?null:document;function Dj(a,o,u){var h=gc;if(h&&typeof o=="string"&&o){var y=Ir(o);y='link[rel="'+a+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),Cj.has(y)||(Cj.add(y),a={rel:a,crossOrigin:u,href:o},h.querySelector(y)===null&&(o=h.createElement("link"),_r(o,"link",a),Tn(o),h.head.appendChild(o)))}}function zI(a){jo.D(a),Dj("dns-prefetch",a,null)}function $I(a,o){jo.C(a,o),Dj("preconnect",a,o)}function BI(a,o,u){jo.L(a,o,u);var h=gc;if(h&&a&&o){var y='link[rel="preload"][as="'+Ir(o)+'"]';o==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Ir(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Ir(u.imageSizes)+'"]')):y+='[href="'+Ir(a)+'"]';var g=y;switch(o){case"style":g=bc(a);break;case"script":g=xc(a)}Ki.has(g)||(a=p({rel:"preload",href:o==="image"&&u&&u.imageSrcSet?void 0:a,as:o},u),Ki.set(g,a),h.querySelector(y)!==null||o==="style"&&h.querySelector(Xd(g))||o==="script"&&h.querySelector(Wd(g))||(o=h.createElement("link"),_r(o,"link",a),Tn(o),h.head.appendChild(o)))}}function qI(a,o){jo.m(a,o);var u=gc;if(u&&a){var h=o&&typeof o.as=="string"?o.as:"script",y='link[rel="modulepreload"][as="'+Ir(h)+'"][href="'+Ir(a)+'"]',g=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=xc(a)}if(!Ki.has(g)&&(a=p({rel:"modulepreload",href:a},o),Ki.set(g,a),u.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Wd(g)))return}h=u.createElement("link"),_r(h,"link",a),Tn(h),u.head.appendChild(h)}}}function II(a,o,u){jo.S(a,o,u);var h=gc;if(h&&a){var y=zi(h).hoistableStyles,g=bc(a);o=o||"default";var P=y.get(g);if(!P){var L={loading:0,preload:null};if(P=h.querySelector(Xd(g)))L.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":o},u),(u=Ki.get(g))&&Gb(a,u);var K=P=h.createElement("link");Tn(K),_r(K,"link",a),K._p=new Promise(function(se,pe){K.onload=se,K.onerror=pe}),K.addEventListener("load",function(){L.loading|=1}),K.addEventListener("error",function(){L.loading|=2}),L.loading|=4,iv(P,o,h)}P={type:"stylesheet",instance:P,count:1,state:L},y.set(g,P)}}}function UI(a,o){jo.X(a,o);var u=gc;if(u&&a){var h=zi(u).hoistableScripts,y=xc(a),g=h.get(y);g||(g=u.querySelector(Wd(y)),g||(a=p({src:a,async:!0},o),(o=Ki.get(y))&&Kb(a,o),g=u.createElement("script"),Tn(g),_r(g,"link",a),u.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},h.set(y,g))}}function VI(a,o){jo.M(a,o);var u=gc;if(u&&a){var h=zi(u).hoistableScripts,y=xc(a),g=h.get(y);g||(g=u.querySelector(Wd(y)),g||(a=p({src:a,async:!0,type:"module"},o),(o=Ki.get(y))&&Kb(a,o),g=u.createElement("script"),Tn(g),_r(g,"link",a),u.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},h.set(y,g))}}function Rj(a,o,u,h){var y=(y=Se.current)?rv(y):null;if(!y)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(o=bc(u.href),u=zi(y).hoistableStyles,h=u.get(o),h||(h={type:"style",instance:null,count:0,state:null},u.set(o,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=bc(u.href);var g=zi(y).hoistableStyles,P=g.get(a);if(P||(y=y.ownerDocument||y,P={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(a,P),(g=y.querySelector(Xd(a)))&&!g._p&&(P.instance=g,P.state.loading=5),Ki.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Ki.set(a,u),g||HI(y,a,u,P.state))),o&&h===null)throw Error(r(528,""));return P}if(o&&h!==null)throw Error(r(529,""));return null;case"script":return o=u.async,u=u.src,typeof u=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=xc(u),u=zi(y).hoistableScripts,h=u.get(o),h||(h={type:"script",instance:null,count:0,state:null},u.set(o,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function bc(a){return'href="'+Ir(a)+'"'}function Xd(a){return'link[rel="stylesheet"]['+a+"]"}function Nj(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function HI(a,o,u,h){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?h.loading=1:(o=a.createElement("link"),h.preload=o,o.addEventListener("load",function(){return h.loading|=1}),o.addEventListener("error",function(){return h.loading|=2}),_r(o,"link",u),Tn(o),a.head.appendChild(o))}function xc(a){return'[src="'+Ir(a)+'"]'}function Wd(a){return"script[async]"+a}function kj(a,o,u){if(o.count++,o.instance===null)switch(o.type){case"style":var h=a.querySelector('style[data-href~="'+Ir(u.href)+'"]');if(h)return o.instance=h,Tn(h),h;var y=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),Tn(h),_r(h,"style",y),iv(h,u.precedence,a),o.instance=h;case"stylesheet":y=bc(u.href);var g=a.querySelector(Xd(y));if(g)return o.state.loading|=4,o.instance=g,Tn(g),g;h=Nj(u),(y=Ki.get(y))&&Gb(h,y),g=(a.ownerDocument||a).createElement("link"),Tn(g);var P=g;return P._p=new Promise(function(L,K){P.onload=L,P.onerror=K}),_r(g,"link",h),o.state.loading|=4,iv(g,u.precedence,a),o.instance=g;case"script":return g=xc(u.src),(y=a.querySelector(Wd(g)))?(o.instance=y,Tn(y),y):(h=u,(y=Ki.get(g))&&(h=p({},u),Kb(h,y)),a=a.ownerDocument||a,y=a.createElement("script"),Tn(y),_r(y,"link",h),a.head.appendChild(y),o.instance=y);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(h=o.instance,o.state.loading|=4,iv(h,u.precedence,a));return o.instance}function iv(a,o,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,g=y,P=0;P title"):null)}function FI(a,o,u){if(u===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return a=o.disabled,typeof o.precedence=="string"&&a==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function $j(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function GI(a,o,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=bc(h.href),g=o.querySelector(Xd(y));if(g){o=g._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=ov.bind(a),o.then(a,a)),u.state.loading|=4,u.instance=g,Tn(g);return}g=o.ownerDocument||o,h=Nj(h),(y=Ki.get(y))&&Gb(h,y),g=g.createElement("link"),Tn(g);var P=g;P._p=new Promise(function(L,K){P.onload=L,P.onerror=K}),_r(g,"link",h),u.instance=g}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,o),(o=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=ov.bind(a),o.addEventListener("load",u),o.addEventListener("error",u))}}var Yb=0;function KI(a,o){return a.stylesheets&&a.count===0&&lv(a,a.stylesheets),0Yb?50:800)+o);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(h),clearTimeout(y)}}:null}function ov(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lv(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var sv=null;function lv(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,sv=new Map,o.forEach(YI,a),sv=null,ov.call(a))}function YI(a,o){if(!(o.state.loading&4)){var u=sv.get(a);if(u)var h=u.get(null);else{u=new Map,sv.set(a,u);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ix.exports=cU(),ix.exports}var dU=fU();const hU=Ft(dU);var $f=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},iu,Ks,Uc,wz,pU=(wz=class extends $f{constructor(){super();qe(this,iu);qe(this,Ks);qe(this,Uc);Ce(this,Uc,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Ks)||this.setEventListener(W(this,Uc))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Ks))==null||t.call(this),Ce(this,Ks,void 0))}setEventListener(t){var n;Ce(this,Uc,t),(n=W(this,Ks))==null||n.call(this),Ce(this,Ks,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,iu)!==t&&(Ce(this,iu,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,iu)=="boolean"?W(this,iu):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},iu=new WeakMap,Ks=new WeakMap,Uc=new WeakMap,wz),FO=new pU,mU={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ys,VO,_z,vU=(_z=class{constructor(){qe(this,Ys,mU);qe(this,VO,!1)}setTimeoutProvider(e){Ce(this,Ys,e)}setTimeout(e,t){return W(this,Ys).setTimeout(e,t)}clearTimeout(e){W(this,Ys).clearTimeout(e)}setInterval(e,t){return W(this,Ys).setInterval(e,t)}clearInterval(e){W(this,Ys).clearInterval(e)}},Ys=new WeakMap,VO=new WeakMap,_z),Ql=new vU;function yU(e){setTimeout(e,0)}var gU=typeof window>"u"||"Deno"in globalThis;function Kr(){}function bU(e,t){return typeof e=="function"?e(t):e}function N_(e){return typeof e=="number"&&e>=0&&e!==1/0}function Rz(e,t){return Math.max(e+(t||0)-Date.now(),0)}function al(e,t){return typeof e=="function"?e(t):e}function Pi(e,t){return typeof e=="function"?e(t):e}function uP(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==GO(l,t.options))return!1}else if(!Uh(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||s&&!s(t))}function cP(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(bu(t.options.mutationKey)!==bu(s))return!1}else if(!Uh(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function GO(e,t){return((t==null?void 0:t.queryKeyHashFn)||bu)(e)}function bu(e){return JSON.stringify(e,(t,n)=>k_(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Uh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Uh(e[n],t[n])):!1}var xU=Object.prototype.hasOwnProperty;function Nz(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=fP(e)&&fP(t);if(!r&&!(k_(e)&&k_(t)))return t;const s=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,f=r?new Array(c):{};let d=0;for(let m=0;m{Ql.setTimeout(t,e)})}function L_(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Nz(e,t):t}function wU(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function _U(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var KO=Symbol();function kz(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===KO?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function YO(e,t){return typeof e=="function"?e(...t):!!e}function AU(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var Vh=(()=>{let e=()=>gU;return{isServer(){return e()},setIsServer(t){e=t}}})();function z_(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var OU=yU;function TU(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=OU;const s=c=>{t?e.push(c):i(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},batchCalls:c=>(...f)=>{s(()=>{c(...f)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var Qn=TU(),Vc,Xs,Hc,Az,EU=(Az=class extends $f{constructor(){super();qe(this,Vc,!0);qe(this,Xs);qe(this,Hc);Ce(this,Hc,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){W(this,Xs)||this.setEventListener(W(this,Hc))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Xs))==null||t.call(this),Ce(this,Xs,void 0))}setEventListener(t){var n;Ce(this,Hc,t),(n=W(this,Xs))==null||n.call(this),Ce(this,Xs,t(this.setOnline.bind(this)))}setOnline(t){W(this,Vc)!==t&&(Ce(this,Vc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Vc)}},Vc=new WeakMap,Xs=new WeakMap,Hc=new WeakMap,Az),Qv=new EU;function MU(e){return Math.min(1e3*2**e,3e4)}function Lz(e){return(e??"online")==="online"?Qv.isOnline():!0}var $_=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function zz(e){let t=!1,n=0,r;const i=z_(),s=()=>i.status!=="pending",l=w=>{var x;if(!s()){const _=new $_(w);v(_),(x=e.onCancel)==null||x.call(e,_)}},c=()=>{t=!0},f=()=>{t=!1},d=()=>FO.isFocused()&&(e.networkMode==="always"||Qv.isOnline())&&e.canRun(),m=()=>Lz(e.networkMode)&&e.canRun(),p=w=>{s()||(r==null||r(),i.resolve(w))},v=w=>{s()||(r==null||r(),i.reject(w))},b=()=>new Promise(w=>{var x;r=_=>{(s()||d())&&w(_)},(x=e.onPause)==null||x.call(e)}).then(()=>{var w;r=void 0,s()||(w=e.onContinue)==null||w.call(e)}),S=()=>{if(s())return;let w;const x=n===0?e.initialPromise:void 0;try{w=x??e.fn()}catch(_){w=Promise.reject(_)}Promise.resolve(w).then(p).catch(_=>{var M;if(s())return;const O=e.retry??(Vh.isServer()?0:3),j=e.retryDelay??MU,E=typeof j=="function"?j(n,_):j,A=O===!0||typeof O=="number"&&nd()?void 0:b()).then(()=>{t?v(_):S()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r==null||r(),i),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?S():b().then(S),i)}}var au,Oz,$z=(Oz=class{constructor(){qe(this,au)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),N_(this.gcTime)&&Ce(this,au,Ql.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Vh.isServer()?1/0:300*1e3))}clearGcTimeout(){W(this,au)!==void 0&&(Ql.clearTimeout(W(this,au)),Ce(this,au,void 0))}},au=new WeakMap,Oz);function jU(e){return{onFetch:(t,n)=>{var m,p,v,b,S;const r=t.options,i=(v=(p=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,s=((b=t.state.data)==null?void 0:b.pages)||[],l=((S=t.state.data)==null?void 0:S.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const d=async()=>{let w=!1;const x=j=>{AU(j,()=>t.signal,()=>w=!0)},_=kz(t.options,t.fetchOptions),O=async(j,E,A)=>{if(w)return Promise.reject(t.signal.reason);if(E==null&&j.pages.length)return Promise.resolve(j);const R=(()=>{const $={client:t.client,queryKey:t.queryKey,pageParam:E,direction:A?"backward":"forward",meta:t.options.meta};return x($),$})(),k=await _(R),{maxPages:z}=t.options,G=A?_U:wU;return{pages:G(j.pages,k,z),pageParams:G(j.pageParams,E,z)}};if(i&&s.length){const j=i==="backward",E=j?PU:hP,A={pages:s,pageParams:l},M=E(r,A);c=await O(A,M,j)}else{const j=e??s.length;do{const E=f===0?l[0]??r.initialPageParam:hP(r,c);if(f>0&&E==null)break;c=await O(c,E),f++}while(f{var w,x;return(x=(w=t.options).persister)==null?void 0:x.call(w,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function hP(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function PU(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Fc,ou,Gc,na,su,ur,Cp,lu,ji,Bz,Do,Tz,CU=(Tz=class extends $z{constructor(t){super();qe(this,ji);qe(this,Fc);qe(this,ou);qe(this,Gc);qe(this,na);qe(this,su);qe(this,ur);qe(this,Cp);qe(this,lu);Ce(this,lu,!1),Ce(this,Cp,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ce(this,su,t.client),Ce(this,na,W(this,su).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ce(this,ou,mP(this.options)),this.state=t.state??W(this,ou),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return W(this,Fc)}get promise(){var t;return(t=W(this,ur))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,Cp),...t},t!=null&&t._type&&Ce(this,Fc,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=mP(this.options);n.data!==void 0&&(this.setState(pP(n.data,n.dataUpdatedAt)),Ce(this,ou,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,na).remove(this)}setData(t,n){const r=L_(this.state.data,t,this.options);return at(this,ji,Do).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){at(this,ji,Do).call(this,{type:"setState",state:t})}cancel(t){var r,i;const n=(r=W(this,ur))==null?void 0:r.promise;return(i=W(this,ur))==null||i.cancel(t),n?n.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return W(this,ou)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Pi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===KO||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>al(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Rz(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,ur))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,ur))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,na).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(W(this,ur)&&(W(this,lu)||at(this,ji,Bz).call(this)?W(this,ur).cancel({revert:!0}):W(this,ur).cancelRetry()),this.scheduleGc()),W(this,na).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||at(this,ji,Do).call(this,{type:"invalidate"})}async fetch(t,n){var d,m,p,v,b,S,w,x,_,O,j;if(this.state.fetchStatus!=="idle"&&((d=W(this,ur))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,ur))return W(this,ur).continueRetry(),W(this,ur).promise}if(t&&this.setOptions(t),!this.options.queryFn){const E=this.observers.find(A=>A.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,i=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Ce(this,lu,!0),r.signal)})},s=()=>{const E=kz(this.options,n),M=(()=>{const R={client:W(this,su),queryKey:this.queryKey,meta:this.meta};return i(R),R})();return Ce(this,lu,!1),this.options.persister?this.options.persister(E,M,this):E(M)},c=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,su),state:this.state,fetchFn:s};return i(E),E})(),f=W(this,Fc)==="infinite"?jU(this.options.pages):this.options.behavior;f==null||f.onFetch(c,this),Ce(this,Gc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&at(this,ji,Do).call(this,{type:"fetch",meta:(p=c.fetchOptions)==null?void 0:p.meta}),Ce(this,ur,zz({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:E=>{E instanceof $_&&E.revert&&this.setState({...W(this,Gc),fetchStatus:"idle"}),r.abort()},onFail:(E,A)=>{at(this,ji,Do).call(this,{type:"failed",failureCount:E,error:A})},onPause:()=>{at(this,ji,Do).call(this,{type:"pause"})},onContinue:()=>{at(this,ji,Do).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const E=await W(this,ur).start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(b=(v=W(this,na).config).onSuccess)==null||b.call(v,E,this),(w=(S=W(this,na).config).onSettled)==null||w.call(S,E,this.state.error,this),E}catch(E){if(E instanceof $_){if(E.silent)return W(this,ur).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw at(this,ji,Do).call(this,{type:"error",error:E}),(_=(x=W(this,na).config).onError)==null||_.call(x,E,this),(j=(O=W(this,na).config).onSettled)==null||j.call(O,this.state.data,E,this),E}finally{this.scheduleGc()}}},Fc=new WeakMap,ou=new WeakMap,Gc=new WeakMap,na=new WeakMap,su=new WeakMap,ur=new WeakMap,Cp=new WeakMap,lu=new WeakMap,ji=new WeakSet,Bz=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Do=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...qz(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...pP(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ce(this,Gc,t.manual?i:void 0),i;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Qn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,na).notify({query:this,type:"updated",action:t})})},Tz);function qz(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Lz(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function pP(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function mP(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var oi,vt,Dp,Gr,uu,Kc,Ro,Ws,Rp,Yc,Xc,cu,fu,Qs,Wc,Nt,gh,B_,q_,I_,U_,V_,H_,F_,Iz,Ez,DU=(Ez=class extends $f{constructor(t,n){super();qe(this,Nt);qe(this,oi);qe(this,vt);qe(this,Dp);qe(this,Gr);qe(this,uu);qe(this,Kc);qe(this,Ro);qe(this,Ws);qe(this,Rp);qe(this,Yc);qe(this,Xc);qe(this,cu);qe(this,fu);qe(this,Qs);qe(this,Wc,new Set);this.options=n,Ce(this,oi,t),Ce(this,Ws,null),Ce(this,Ro,z_()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,vt).addObserver(this),vP(W(this,vt),this.options)?at(this,Nt,gh).call(this):this.updateResult(),at(this,Nt,U_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return G_(W(this,vt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return G_(W(this,vt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,at(this,Nt,V_).call(this),at(this,Nt,H_).call(this),W(this,vt).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,vt);if(this.options=W(this,oi).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Pi(this.options.enabled,W(this,vt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");at(this,Nt,F_).call(this),W(this,vt).setOptions(this.options),n._defaulted&&!Wv(this.options,n)&&W(this,oi).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,vt),observer:this});const i=this.hasListeners();i&&yP(W(this,vt),r,this.options,n)&&at(this,Nt,gh).call(this),this.updateResult(),i&&(W(this,vt)!==r||Pi(this.options.enabled,W(this,vt))!==Pi(n.enabled,W(this,vt))||al(this.options.staleTime,W(this,vt))!==al(n.staleTime,W(this,vt)))&&at(this,Nt,B_).call(this);const s=at(this,Nt,q_).call(this);i&&(W(this,vt)!==r||Pi(this.options.enabled,W(this,vt))!==Pi(n.enabled,W(this,vt))||s!==W(this,Qs))&&at(this,Nt,I_).call(this,s)}getOptimisticResult(t){const n=W(this,oi).getQueryCache().build(W(this,oi),t),r=this.createResult(n,t);return NU(this,r)&&(Ce(this,Gr,r),Ce(this,Kc,this.options),Ce(this,uu,W(this,vt).state)),r}getCurrentResult(){return W(this,Gr)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&W(this,Ro).status==="pending"&&W(this,Ro).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){W(this,Wc).add(t)}getCurrentQuery(){return W(this,vt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,oi).defaultQueryOptions(t),r=W(this,oi).getQueryCache().build(W(this,oi),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return at(this,Nt,gh).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Gr)))}createResult(t,n){var z;const r=W(this,vt),i=this.options,s=W(this,Gr),l=W(this,uu),c=W(this,Kc),d=t!==r?t.state:W(this,Dp),{state:m}=t;let p={...m},v=!1,b;if(n._optimisticResults){const G=this.hasListeners(),$=!G&&vP(t,n),B=G&&yP(t,r,n,i);($||B)&&(p={...p,...qz(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:S,errorUpdatedAt:w,status:x}=p;b=p.data;let _=!1;if(n.placeholderData!==void 0&&b===void 0&&x==="pending"){let G;s!=null&&s.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(G=s.data,_=!0):G=typeof n.placeholderData=="function"?n.placeholderData((z=W(this,Xc))==null?void 0:z.state.data,W(this,Xc)):n.placeholderData,G!==void 0&&(x="success",b=L_(s==null?void 0:s.data,G,n),v=!0)}if(n.select&&b!==void 0&&!_)if(s&&b===(l==null?void 0:l.data)&&n.select===W(this,Rp))b=W(this,Yc);else try{Ce(this,Rp,n.select),b=n.select(b),b=L_(s==null?void 0:s.data,b,n),Ce(this,Yc,b),Ce(this,Ws,null)}catch(G){Ce(this,Ws,G)}W(this,Ws)&&(S=W(this,Ws),b=W(this,Yc),w=Date.now(),x="error");const O=p.fetchStatus==="fetching",j=x==="pending",E=x==="error",A=j&&O,M=b!==void 0,k={status:x,fetchStatus:p.fetchStatus,isPending:j,isSuccess:x==="success",isError:E,isInitialLoading:A,isLoading:A,data:b,dataUpdatedAt:p.dataUpdatedAt,error:S,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:O,isRefetching:O&&!j,isLoadingError:E&&!M,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:E&&M,isStale:XO(t,n),refetch:this.refetch,promise:W(this,Ro),isEnabled:Pi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const G=k.data!==void 0,$=k.status==="error"&&!G,B=J=>{$?J.reject(k.error):G&&J.resolve(k.data)},X=()=>{const J=Ce(this,Ro,k.promise=z_());B(J)},ee=W(this,Ro);switch(ee.status){case"pending":t.queryHash===r.queryHash&&B(ee);break;case"fulfilled":($||k.data!==ee.value)&&X();break;case"rejected":(!$||k.error!==ee.reason)&&X();break}}return k}updateResult(){const t=W(this,Gr),n=this.createResult(W(this,vt),this.options);if(Ce(this,uu,W(this,vt).state),Ce(this,Kc,this.options),W(this,uu).data!==void 0&&Ce(this,Xc,W(this,vt)),Wv(n,t))return;Ce(this,Gr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!W(this,Wc).size)return!0;const l=new Set(s??W(this,Wc));return this.options.throwOnError&&l.add("error"),Object.keys(W(this,Gr)).some(c=>{const f=c;return W(this,Gr)[f]!==t[f]&&l.has(f)})};at(this,Nt,Iz).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&at(this,Nt,U_).call(this)}},oi=new WeakMap,vt=new WeakMap,Dp=new WeakMap,Gr=new WeakMap,uu=new WeakMap,Kc=new WeakMap,Ro=new WeakMap,Ws=new WeakMap,Rp=new WeakMap,Yc=new WeakMap,Xc=new WeakMap,cu=new WeakMap,fu=new WeakMap,Qs=new WeakMap,Wc=new WeakMap,Nt=new WeakSet,gh=function(t){at(this,Nt,F_).call(this);let n=W(this,vt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Kr)),n},B_=function(){at(this,Nt,V_).call(this);const t=al(this.options.staleTime,W(this,vt));if(Vh.isServer()||W(this,Gr).isStale||!N_(t))return;const r=Rz(W(this,Gr).dataUpdatedAt,t)+1;Ce(this,cu,Ql.setTimeout(()=>{W(this,Gr).isStale||this.updateResult()},r))},q_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,vt)):this.options.refetchInterval)??!1},I_=function(t){at(this,Nt,H_).call(this),Ce(this,Qs,t),!(Vh.isServer()||Pi(this.options.enabled,W(this,vt))===!1||!N_(W(this,Qs))||W(this,Qs)===0)&&Ce(this,fu,Ql.setInterval(()=>{(this.options.refetchIntervalInBackground||FO.isFocused())&&at(this,Nt,gh).call(this)},W(this,Qs)))},U_=function(){at(this,Nt,B_).call(this),at(this,Nt,I_).call(this,at(this,Nt,q_).call(this))},V_=function(){W(this,cu)!==void 0&&(Ql.clearTimeout(W(this,cu)),Ce(this,cu,void 0))},H_=function(){W(this,fu)!==void 0&&(Ql.clearInterval(W(this,fu)),Ce(this,fu,void 0))},F_=function(){const t=W(this,oi).getQueryCache().build(W(this,oi),this.options);if(t===W(this,vt))return;const n=W(this,vt);Ce(this,vt,t),Ce(this,Dp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Iz=function(t){Qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,Gr))}),W(this,oi).getQueryCache().notify({query:W(this,vt),type:"observerResultsUpdated"})})},Ez);function RU(e,t){return Pi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Pi(t.retryOnMount,e)===!1)}function vP(e,t){return RU(e,t)||e.state.data!==void 0&&G_(e,t,t.refetchOnMount)}function G_(e,t,n){if(Pi(t.enabled,e)!==!1&&al(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&XO(e,t)}return!1}function yP(e,t,n,r){return(e!==t||Pi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&XO(e,n)}function XO(e,t){return Pi(t.enabled,e)!==!1&&e.isStaleByTime(al(t.staleTime,e))}function NU(e,t){return!Wv(e.getCurrentResult(),t)}var Np,Va,Nr,du,Ha,Is,Mz,kU=(Mz=class extends $z{constructor(t){super();qe(this,Ha);qe(this,Np);qe(this,Va);qe(this,Nr);qe(this,du);Ce(this,Np,t.client),this.mutationId=t.mutationId,Ce(this,Nr,t.mutationCache),Ce(this,Va,[]),this.state=t.state||Uz(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){W(this,Va).includes(t)||(W(this,Va).push(t),this.clearGcTimeout(),W(this,Nr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ce(this,Va,W(this,Va).filter(n=>n!==t)),this.scheduleGc(),W(this,Nr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,Va).length||(this.state.status==="pending"?this.scheduleGc():W(this,Nr).remove(this))}continue(){var t;return((t=W(this,du))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,c,f,d,m,p,v,b,S,w,x,_,O,j,E,A,M,R;const n=()=>{at(this,Ha,Is).call(this,{type:"continue"})},r={client:W(this,Np),meta:this.options.meta,mutationKey:this.options.mutationKey};Ce(this,du,zz({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(k,z)=>{at(this,Ha,Is).call(this,{type:"failed",failureCount:k,error:z})},onPause:()=>{at(this,Ha,Is).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,Nr).canRun(this)}));const i=this.state.status==="pending",s=!W(this,du).canStart();try{if(i)n();else{at(this,Ha,Is).call(this,{type:"pending",variables:t,isPaused:s}),W(this,Nr).config.onMutate&&await W(this,Nr).config.onMutate(t,this,r);const z=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));z!==this.state.context&&at(this,Ha,Is).call(this,{type:"pending",context:z,variables:t,isPaused:s})}const k=await W(this,du).start();return await((d=(f=W(this,Nr).config).onSuccess)==null?void 0:d.call(f,k,t,this.state.context,this,r)),await((p=(m=this.options).onSuccess)==null?void 0:p.call(m,k,t,this.state.context,r)),await((b=(v=W(this,Nr).config).onSettled)==null?void 0:b.call(v,k,null,this.state.variables,this.state.context,this,r)),await((w=(S=this.options).onSettled)==null?void 0:w.call(S,k,null,t,this.state.context,r)),at(this,Ha,Is).call(this,{type:"success",data:k}),k}catch(k){try{await((_=(x=W(this,Nr).config).onError)==null?void 0:_.call(x,k,t,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((j=(O=this.options).onError)==null?void 0:j.call(O,k,t,this.state.context,r))}catch(z){Promise.reject(z)}try{await((A=(E=W(this,Nr).config).onSettled)==null?void 0:A.call(E,void 0,k,this.state.variables,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((R=(M=this.options).onSettled)==null?void 0:R.call(M,void 0,k,t,this.state.context,r))}catch(z){Promise.reject(z)}throw at(this,Ha,Is).call(this,{type:"error",error:k}),k}finally{W(this,Nr).runNext(this)}}},Np=new WeakMap,Va=new WeakMap,Nr=new WeakMap,du=new WeakMap,Ha=new WeakSet,Is=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Qn.batch(()=>{W(this,Va).forEach(r=>{r.onMutationUpdate(t)}),W(this,Nr).notify({mutation:this,type:"updated",action:t})})},Mz);function Uz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var No,ba,kp,jz,LU=(jz=class extends $f{constructor(t={}){super();qe(this,No);qe(this,ba);qe(this,kp);this.config=t,Ce(this,No,new Set),Ce(this,ba,new Map),Ce(this,kp,0)}build(t,n,r){const i=new kU({client:t,mutationCache:this,mutationId:++vv(this,kp)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){W(this,No).add(t);const n=gv(t);if(typeof n=="string"){const r=W(this,ba).get(n);r?r.push(t):W(this,ba).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,No).delete(t)){const n=gv(t);if(typeof n=="string"){const r=W(this,ba).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&W(this,ba).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=gv(t);if(typeof n=="string"){const r=W(this,ba).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=gv(t);if(typeof n=="string"){const i=(r=W(this,ba).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Qn.batch(()=>{W(this,No).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,No).clear(),W(this,ba).clear()})}getAll(){return Array.from(W(this,No))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>cP(n,r))}findAll(t={}){return this.getAll().filter(n=>cP(t,n))}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Qn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Kr))))}},No=new WeakMap,ba=new WeakMap,kp=new WeakMap,jz);function gv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ko,Zs,si,Lo,Ko,Fv,K_,Pz,zU=(Pz=class extends $f{constructor(n,r){super();qe(this,Ko);qe(this,ko);qe(this,Zs);qe(this,si);qe(this,Lo);Ce(this,ko,n),this.setOptions(r),this.bindMethods(),at(this,Ko,Fv).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=W(this,ko).defaultMutationOptions(n),Wv(this.options,r)||W(this,ko).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,si),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&bu(r.mutationKey)!==bu(this.options.mutationKey)?this.reset():((i=W(this,si))==null?void 0:i.state.status)==="pending"&&W(this,si).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,si))==null||n.removeObserver(this)}onMutationUpdate(n){at(this,Ko,Fv).call(this),at(this,Ko,K_).call(this,n)}getCurrentResult(){return W(this,Zs)}reset(){var n;(n=W(this,si))==null||n.removeObserver(this),Ce(this,si,void 0),at(this,Ko,Fv).call(this),at(this,Ko,K_).call(this)}mutate(n,r){var i;return Ce(this,Lo,r),(i=W(this,si))==null||i.removeObserver(this),Ce(this,si,W(this,ko).getMutationCache().build(W(this,ko),this.options)),W(this,si).addObserver(this),W(this,si).execute(n)}},ko=new WeakMap,Zs=new WeakMap,si=new WeakMap,Lo=new WeakMap,Ko=new WeakSet,Fv=function(){var r;const n=((r=W(this,si))==null?void 0:r.state)??Uz();Ce(this,Zs,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},K_=function(n){Qn.batch(()=>{var r,i,s,l,c,f,d,m;if(W(this,Lo)&&this.hasListeners()){const p=W(this,Zs).variables,v=W(this,Zs).context,b={client:W(this,ko),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=W(this,Lo)).onSuccess)==null||i.call(r,n.data,p,v,b)}catch(S){Promise.reject(S)}try{(l=(s=W(this,Lo)).onSettled)==null||l.call(s,n.data,null,p,v,b)}catch(S){Promise.reject(S)}}else if((n==null?void 0:n.type)==="error"){try{(f=(c=W(this,Lo)).onError)==null||f.call(c,n.error,p,v,b)}catch(S){Promise.reject(S)}try{(m=(d=W(this,Lo)).onSettled)==null||m.call(d,void 0,n.error,p,v,b)}catch(S){Promise.reject(S)}}}this.listeners.forEach(p=>{p(W(this,Zs))})})},Pz),Fa,Cz,$U=(Cz=class extends $f{constructor(t={}){super();qe(this,Fa);this.config=t,Ce(this,Fa,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??GO(i,n);let l=this.get(s);return l||(l=new CU({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(l)),l}add(t){W(this,Fa).has(t.queryHash)||(W(this,Fa).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,Fa).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,Fa).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Qn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,Fa).get(t)}getAll(){return[...W(this,Fa).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>uP(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>uP(t,r)):n}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Fa=new WeakMap,Cz),wn,Js,el,Qc,Zc,tl,Jc,ef,Dz,BU=(Dz=class{constructor(e={}){qe(this,wn);qe(this,Js);qe(this,el);qe(this,Qc);qe(this,Zc);qe(this,tl);qe(this,Jc);qe(this,ef);Ce(this,wn,e.queryCache||new $U),Ce(this,Js,e.mutationCache||new LU),Ce(this,el,e.defaultOptions||{}),Ce(this,Qc,new Map),Ce(this,Zc,new Map),Ce(this,tl,0)}mount(){vv(this,tl)._++,W(this,tl)===1&&(Ce(this,Jc,FO.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,wn).onFocus())})),Ce(this,ef,Qv.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,wn).onOnline())})))}unmount(){var e,t;vv(this,tl)._--,W(this,tl)===0&&((e=W(this,Jc))==null||e.call(this),Ce(this,Jc,void 0),(t=W(this,ef))==null||t.call(this),Ce(this,ef,void 0))}isFetching(e){return W(this,wn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,Js).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,wn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,wn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(al(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(this,wn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=W(this,wn).get(r.queryHash),s=i==null?void 0:i.state.data,l=bU(t,s);if(l!==void 0)return W(this,wn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Qn.batch(()=>W(this,wn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,wn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,wn);Qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,wn);return Qn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Qn.batch(()=>W(this,wn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(e,t={}){return Qn.batch(()=>(W(this,wn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Qn.batch(()=>W(this,wn).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Kr)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=W(this,wn).build(this,t);return n.isStaleByTime(al(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kr).catch(Kr)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kr).catch(Kr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Qv.isOnline()?W(this,Js).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,wn)}getMutationCache(){return W(this,Js)}getDefaultOptions(){return W(this,el)}setDefaultOptions(e){Ce(this,el,e)}setQueryDefaults(e,t){W(this,Qc).set(bu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,Qc).values()],n={};return t.forEach(r=>{Uh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,Zc).set(bu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,Zc).values()],n={};return t.forEach(r=>{Uh(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,el).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=GO(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===KO&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,el).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,wn).clear(),W(this,Js).clear()}},wn=new WeakMap,Js=new WeakMap,el=new WeakMap,Qc=new WeakMap,Zc=new WeakMap,tl=new WeakMap,Jc=new WeakMap,ef=new WeakMap,Dz),Vz=Z.createContext(void 0),Bf=e=>{const t=Z.useContext(Vz);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},qU=({client:e,children:t})=>(Z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),T.jsx(Vz.Provider,{value:e,children:t})),Hz=Z.createContext(!1),IU=()=>Z.useContext(Hz);Hz.Provider;function UU(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var VU=Z.createContext(UU()),HU=()=>Z.useContext(VU),FU=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?YO(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},GU=e=>{Z.useEffect(()=>{e.clearReset()},[e])},KU=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||YO(n,[e.error,r])),YU=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},XU=(e,t)=>e.isLoading&&e.isFetching&&!t,WU=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,gP=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function QU(e,t,n){var v,b,S,w;const r=IU(),i=HU(),s=Bf(),l=s.defaultQueryOptions(e);(b=(v=s.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||b.call(v,l);const c=s.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",YU(l),FU(l,i,c),GU(i);const f=!s.getQueryCache().get(l.queryHash),[d]=Z.useState(()=>new t(s,l)),m=d.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(Z.useSyncExternalStore(Z.useCallback(x=>{const _=p?d.subscribe(Qn.batchCalls(x)):Kr;return d.updateResult(),_},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),Z.useEffect(()=>{d.setOptions(l)},[l,d]),WU(l,m))throw gP(l,d,i);if(KU({result:m,errorResetBoundary:i,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw m.error;if((w=(S=s.getDefaultOptions().queries)==null?void 0:S._experimental_afterQuery)==null||w.call(S,l,m),l.experimental_prefetchInRender&&!Vh.isServer()&&XU(m,r)){const x=f?gP(l,d,i):c==null?void 0:c.promise;x==null||x.catch(Kr).finally(()=>{d.updateResult()})}return l.notifyOnChangeProps?m:d.trackResult(m)}function Fz(e,t){return QU(e,DU)}function lg(e,t){const n=Bf(),[r]=Z.useState(()=>new zU(n,e));Z.useEffect(()=>{r.setOptions(e)},[r,e]);const i=Z.useSyncExternalStore(Z.useCallback(l=>r.subscribe(Qn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=Z.useCallback((l,c)=>{r.mutate(l,c).catch(Kr)},[r]);if(i.error&&YO(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}function Gz(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=eV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const c=l.split(WO);return c[0]===""&&c.length!==1&&c.shift(),Kz(c,t)||JU(l)},getConflictingClassGroupIds:(l,c)=>{const f=n[l]||[];return c&&r[l]?[...f,...r[l]]:f}}},Kz=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Kz(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(WO);return(l=t.validators.find(({validator:c})=>c(s)))==null?void 0:l.classGroupId},bP=/^\[(.+)\]$/,JU=e=>{if(bP.test(e)){const t=bP.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},eV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return nV(Object.entries(e.classGroups),n).forEach(([s,l])=>{Y_(l,r,s,t)}),r},Y_=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:xP(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(tV(i)){Y_(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,l])=>{Y_(l,xP(t,s),n,r)})})},xP=(e,t)=>{let n=e;return t.split(WO).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},tV=e=>e.isThemeGetter,nV=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([l,c])=>[t+l,c])):s);return[n,i]}):e,rV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,l)=>{n.set(s,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let l=n.get(s);if(l!==void 0)return l;if((l=r.get(s))!==void 0)return i(s,l),l},set(s,l){n.has(s)?n.set(s,l):i(s,l)}}},Yz="!",iV=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,l=c=>{const f=[];let d=0,m=0,p;for(let x=0;xm?p-m:void 0;return{modifiers:f,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:w}};return n?c=>n({className:c,parseClassName:l}):l},aV=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},oV=e=>({cache:rV(e.cacheSize),parseClassName:iV(e),...ZU(e)}),sV=/\s+/,lV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],l=e.trim().split(sV);let c="";for(let f=l.length-1;f>=0;f-=1){const d=l[f],{modifiers:m,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:b}=n(d);let S=!!b,w=r(S?v.substring(0,b):v);if(!w){if(!S){c=d+(c.length>0?" "+c:c);continue}if(w=r(v),!w){c=d+(c.length>0?" "+c:c);continue}S=!1}const x=aV(m).join(":"),_=p?x+Yz:x,O=_+w;if(s.includes(O))continue;s.push(O);const j=i(w,S);for(let E=0;E0?" "+c:c)}return c};function uV(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rp(m),e());return n=oV(d),r=n.cache.get,i=n.cache.set,s=c,c(f)}function c(f){const d=r(f);if(d)return d;const m=lV(f,n);return i(f,m),m}return function(){return s(uV.apply(null,arguments))}}const on=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Wz=/^\[(?:([a-z-]+):)?(.+)\]$/i,fV=/^\d+\/\d+$/,dV=new Set(["px","full","screen"]),hV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pV=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,vV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Po=e=>zc(e)||dV.has(e)||fV.test(e),Bs=e=>qf(e,"length",OV),zc=e=>!!e&&!Number.isNaN(Number(e)),lx=e=>qf(e,"number",zc),rh=e=>!!e&&Number.isInteger(Number(e)),gV=e=>e.endsWith("%")&&zc(e.slice(0,-1)),ot=e=>Wz.test(e),qs=e=>hV.test(e),bV=new Set(["length","size","percentage"]),xV=e=>qf(e,bV,Qz),SV=e=>qf(e,"position",Qz),wV=new Set(["image","url"]),_V=e=>qf(e,wV,EV),AV=e=>qf(e,"",TV),ih=()=>!0,qf=(e,t,n)=>{const r=Wz.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},OV=e=>pV.test(e)&&!mV.test(e),Qz=()=>!1,TV=e=>vV.test(e),EV=e=>yV.test(e),MV=()=>{const e=on("colors"),t=on("spacing"),n=on("blur"),r=on("brightness"),i=on("borderColor"),s=on("borderRadius"),l=on("borderSpacing"),c=on("borderWidth"),f=on("contrast"),d=on("grayscale"),m=on("hueRotate"),p=on("invert"),v=on("gap"),b=on("gradientColorStops"),S=on("gradientColorStopPositions"),w=on("inset"),x=on("margin"),_=on("opacity"),O=on("padding"),j=on("saturate"),E=on("scale"),A=on("sepia"),M=on("skew"),R=on("space"),k=on("translate"),z=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",ot,t],B=()=>[ot,t],X=()=>["",Po,Bs],ee=()=>["auto",zc,ot],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>["start","end","center","between","around","evenly","stretch"],fe=()=>["","0",ot],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[zc,ot];return{cacheSize:500,separator:":",theme:{colors:[ih],spacing:[Po,Bs],blur:["none","",qs,ot],brightness:D(),borderColor:[e],borderRadius:["none","","full",qs,ot],borderSpacing:B(),borderWidth:X(),contrast:D(),grayscale:fe(),hueRotate:D(),invert:fe(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[gV,Bs],inset:$(),margin:$(),opacity:D(),padding:B(),saturate:D(),scale:D(),sepia:fe(),skew:D(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",ot]}],container:["container"],columns:[{columns:[qs]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...J(),ot]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",rh,ot]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ot]}],grow:[{grow:fe()}],shrink:[{shrink:fe()}],order:[{order:["first","last","none",rh,ot]}],"grid-cols":[{"grid-cols":[ih]}],"col-start-end":[{col:["auto",{span:["full",rh,ot]},ot]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[ih]}],"row-start-end":[{row:["auto",{span:[rh,ot]},ot]}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ot]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ot]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...ae()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ae(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ae(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[O]}],px:[{px:[O]}],py:[{py:[O]}],ps:[{ps:[O]}],pe:[{pe:[O]}],pt:[{pt:[O]}],pr:[{pr:[O]}],pb:[{pb:[O]}],pl:[{pl:[O]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ot,t]}],"min-w":[{"min-w":[ot,t,"min","max","fit"]}],"max-w":[{"max-w":[ot,t,"none","full","min","max","fit","prose",{screen:[qs]},qs]}],h:[{h:[ot,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ot,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ot,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ot,t,"auto","min","max","fit"]}],"font-size":[{text:["base",qs,Bs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",lx]}],"font-family":[{font:[ih]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ot]}],"line-clamp":[{"line-clamp":["none",zc,lx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Po,ot]}],"list-image":[{"list-image":["none",ot]}],"list-style-type":[{list:["none","disc","decimal",ot]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Po,Bs]}],"underline-offset":[{"underline-offset":["auto",Po,ot]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ot]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ot]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...J(),SV]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",xV]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_V]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...I(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:I()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...I()]}],"outline-offset":[{"outline-offset":[Po,ot]}],"outline-w":[{outline:[Po,Bs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[Po,Bs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",qs,AV]}],"shadow-color":[{shadow:[ih]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",qs,ot]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[j]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[j]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ot]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",ot]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",ot]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[rh,ot]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ot]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ot]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ot]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Po,Bs,lx]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},jV=cV(MV);function tf(...e){return jV(ct(e))}function li(e){if(e==null||Number.isNaN(e))return"—";const t=["B","KB","MB","GB","TB"];let n=Number(e),r=0;for(;n>=1024&&r{let t;const n=new Set,r=(d,m)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const v=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(b=>b(t,v))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(r,i,c);return c},PV=(e=>e?SP(e):SP),CV=e=>e;function DV(e,t=CV){const n=Q.useSyncExternalStore(e.subscribe,Q.useCallback(()=>t(e.getState()),[e,t]),Q.useCallback(()=>t(e.getInitialState()),[e,t]));return Q.useDebugValue(n),n}const wP=e=>{const t=PV(e),n=r=>DV(t,r);return Object.assign(n,t),n},RV=(e=>e?wP(e):wP),_P=e=>Symbol.iterator in e,AP=e=>"entries"in e,OP=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[i,s]of n)if(!r.has(i)||!Object.is(s,r.get(i)))return!1;return!0},NV=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let i=n.next(),s=r.next();for(;!i.done&&!s.done;){if(!Object.is(i.value,s.value))return!1;i=n.next(),s=r.next()}return!!i.done&&!!s.done};function kV(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:_P(e)&&_P(t)?AP(e)&&AP(t)?OP(e,t):NV(e,t):OP({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function ug(e){const t=Q.useRef(void 0);return n=>{const r=e(n);return kV(t.current,r)?t.current:t.current=r}}const Jz="mtplx.dashboard.theme";function e$(){if(typeof window>"u")return"hippo";const e=window.localStorage.getItem(Jz);return e==="hippo"||e==="river"||e==="light"||e==="mono"?e:"hippo"}function TP(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Jz,e),window.document.documentElement.setAttribute("data-theme",e)}catch{}}const ux=["hippo","river","light","mono"],De=RV((e,t)=>({snapshot:null,latest:null,recent:[],rolling:null,lifetime:null,inFlight:[],sessionBank:null,sessions:null,mem:null,thermal:null,thermalWhenS:0,settings:null,modelId:null,profileName:null,contextWindow:null,machine:null,uptimeS:0,liveTokS:null,liveProgressByRequest:{},activePrefillByRequest:{},lastCompletedPrefill:null,newMaxTPSEvent:null,connection:"idle",reconnectAttempts:0,lastSnapshotAtMs:null,sessionFilter:null,theme:e$(),pauseStream:!1,soundEnabled:!1,applySnapshot:n=>{var i,s;if(t().pauseStream)return;const r={};(n.in_flight??[]).forEach(l=>{l.prefill_state&&(r[l.request_id]={...l.prefill_state,request_id:l.request_id,session_id:l.session_id})}),e({snapshot:n,latest:n.latest,recent:n.recent??[],rolling:n.rolling,lifetime:n.lifetime,inFlight:n.in_flight??[],sessionBank:n.session_bank??null,sessions:n.sessions??null,mem:n.mem,thermal:n.thermal,thermalWhenS:n.thermal_when_s,settings:n.settings,modelId:n.model_id,profileName:((i=n.profile)==null?void 0:i.name)??null,contextWindow:n.context_window,machine:n.machine,uptimeS:n.uptime_s,activePrefillByRequest:r,liveTokS:typeof((s=n.latest)==null?void 0:s.decode_tok_s)=="number"?n.latest.decode_tok_s:null,lastSnapshotAtMs:Date.now()})},applyEvent:n=>{var r,i;if(!t().pauseStream)switch(n.kind){case"progress":{const s=(r=n.progress)==null?void 0:r.decode_tok_s;e(l=>({liveTokS:typeof s=="number"&&s>0?s:l.liveTokS,liveProgressByRequest:{...l.liveProgressByRequest,[n.request_id]:n}}));break}case"completed":{const s=(i=n.envelope)==null?void 0:i.decode_tok_s;e(l=>({latest:n.envelope??l.latest,liveTokS:typeof s=="number"&&s>0?s:l.liveTokS}));break}case"new_max_tps":{e({newMaxTPSEvent:{tok_s:n.tok_s,when_s:n.when_s,session_id:n.session_id}});break}case"thermal":{e({thermal:n.thermal,thermalWhenS:n.when_s});break}case"prefill":{const s=n.request_id,l={phase:n.phase,tokens_done:n.tokens_done,tokens_total:n.tokens_total,cached_tokens:n.cached_tokens,new_prefill_tokens:n.new_prefill_tokens,elapsed_s:n.elapsed_s,prefill_tok_s:n.prefill_tok_s,chunk_size:n.chunk_size,cache_hit:n.cache_hit,started_s:n.started_s,request_id:s,session_id:n.session_id};n.phase==="completed"?e(c=>{const f={...c.activePrefillByRequest};return delete f[s],{activePrefillByRequest:f,lastCompletedPrefill:{...l,when_s:n.when_s}}}):e(c=>({activePrefillByRequest:{...c.activePrefillByRequest,[s]:l}}));break}case"snapshot":{t().applySnapshot(n);break}}},setConnection:n=>{e(r=>({connection:n,reconnectAttempts:n==="reconnecting"?r.reconnectAttempts+1:0}))},setSessionFilter:n=>e({sessionFilter:n}),setTheme:n=>{TP(n),e({theme:n})},cycleTheme:()=>{const n=t().theme,r=ux[(ux.indexOf(n)+1)%ux.length];TP(r),e({theme:r})},togglePauseStream:()=>e(n=>({pauseStream:!n.pauseStream})),toggleSound:()=>e(n=>({soundEnabled:!n.soundEnabled})),consumeNewMaxTPS:()=>e({newMaxTPSEvent:null})}));typeof window<"u"&&window.document.documentElement.setAttribute("data-theme",e$());function LV(){return De(ug(e=>{var n;const t=new Set;return(n=e.rolling)==null||n.history.forEach(r=>{r.session_id&&t.add(r.session_id)}),e.inFlight.forEach(r=>{r.session_id&&t.add(r.session_id)}),Array.from(t).sort()}))}function zV(){return De(ug(e=>{if(!e.rolling)return[];const t=e.sessionFilter;return t?e.rolling.history.filter(n=>n.session_id===t):e.rolling.history}))}function $V(){return De(ug(e=>e.sessionFilter?e.recent.filter(t=>t.session_id===e.sessionFilter):e.recent))}function t$(){return De(ug(e=>{const t=Object.values(e.activePrefillByRequest);if(t.length===0)return{active:!1};const n=t.reduce((m,p)=>(p.elapsed_s??0)>(m.elapsed_s??0)?p:m),r=Number(n.tokens_total??0),i=Number(n.tokens_done??0),s=Number(n.elapsed_s??0),l=r>0?Math.min(100,i/r*100):0,c=typeof n.prefill_tok_s=="number"&&n.prefill_tok_s>0?n.prefill_tok_s:i>0&&s>0?i/s:null,f=Math.max(0,r-i),d=c&&c>0&&f>0?f/c:null;return{active:!0,request_id:n.request_id,session_id:n.session_id,tokens_done:i,tokens_total:r,cached_tokens:Number(n.cached_tokens??0),elapsed_s:s,prefill_tok_s:c,pct:l,eta_s:d}}))}function BV(){const e=De(m=>m.latest),t=De(m=>m.lifetime),n=De(m=>m.liveTokS),r=(e==null?void 0:e.completion_tokens)??null,i=(e==null?void 0:e.ttft_s)??null,s=n??(e==null?void 0:e.decode_tok_s)??null,l=(e==null?void 0:e.request_tok_s)??null,c=(e==null?void 0:e.prompt_eval_time_s)??null,f=(e==null?void 0:e.decode_elapsed_s)??null,d=(t==null?void 0:t.requests_total)??0;return T.jsxs("div",{className:"px-4 lg:px-6 py-2 flex items-center justify-between gap-4 text-xs",children:[T.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[var(--text-muted)] min-w-0",children:[T.jsx(Il,{label:"tok",value:We(r)}),T.jsx(Il,{label:"ttft",value:Zn(i)}),T.jsx(Il,{label:"prompt eval",value:Zn(c)}),T.jsx(Il,{label:"decode",value:Zn(f)}),T.jsx(Il,{label:"tok/s",value:Rn(s),highlight:typeof s=="number"&&s>=40}),T.jsx(Il,{label:"req tok/s",value:Rn(l)}),T.jsx(Il,{label:"lifetime req",value:We(d)})]}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)] hidden sm:block",children:"MTPLX live"})]})}function Il({label:e,value:t,highlight:n=!1}){return T.jsxs("span",{className:"flex items-baseline gap-1.5 whitespace-nowrap",children:[T.jsx("span",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:e}),T.jsx("span",{className:"tabular-nums font-medium "+(n?"text-[var(--accent)]":"text-[var(--text-primary)]"),children:t})]})}function st({title:e,subtitle:t,action:n,className:r,bodyClassName:i,children:s}){return T.jsxs("section",{className:tf("rounded-2xl border border-[var(--border-soft)] bg-[var(--bg-card)] shadow-[inset_0_1px_0_0_rgba(255,255,255,0.02)] overflow-hidden",r),children:[(e||n)&&T.jsxs("header",{className:"px-5 pt-4 pb-2 flex items-start justify-between gap-4",children:[T.jsxs("div",{className:"min-w-0",children:[e?T.jsx("h3",{className:"text-sm font-semibold text-[var(--text-primary)] tracking-tight",children:e}):null,t?T.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-0.5",children:t}):null]}),n?T.jsx("div",{className:"shrink-0",children:n}):null]}),T.jsx("div",{className:tf("px-5 pb-5 pt-2",i),children:s})]})}function Ya({value:e,unit:t,caption:n,tone:r="default"}){const i=r==="accent"?"text-[var(--accent)]":r==="warm"?"text-[var(--accent-warm)]":r==="hot"?"text-[var(--accent-hot)]":r==="cool"?"text-[var(--accent-cool)]":"text-[var(--text-primary)]";return T.jsxs("div",{children:[T.jsxs("div",{className:tf("flex items-baseline gap-2",i),children:[T.jsx("span",{className:"text-4xl font-semibold tabular-nums leading-none",children:e}),t?T.jsx("span",{className:"text-sm text-[var(--text-muted)]",children:t}):null]}),n?T.jsx("div",{className:"text-xs text-[var(--text-muted)] mt-2",children:n}):null]})}function qV(){const e=De(i=>i.lifetime),t=(e==null?void 0:e.cached_tokens_total)??0,n=(e==null?void 0:e.prompt_tokens_total)??0,r=n>0?t/n*100:0;return T.jsx(st,{title:"Cached tokens · lifetime",subtitle:"cached / prompt across all requests",children:T.jsx(Ya,{value:We(t),unit:"tokens",tone:"accent",caption:`${r.toFixed(1)}% of ${We(n)} prompt tokens`})})}function IV(){const t=De(s=>s.recent).slice(-32),n=t.filter(s=>s.session_cache_hit).length,r=t.length>0?n/t.length*100:0,i=r>=70?"accent":r>=40?"warm":"hot";return T.jsx(st,{title:"Session cache hit rate",subtitle:`last ${t.length} requests`,children:T.jsx(Ya,{value:`${r.toFixed(0)}%`,unit:"hit",tone:i,caption:`${n} hits / ${t.length} requests`})})}function UV(){const e=De(l=>l.latest),t=De(l=>l.contextWindow),n=(e==null?void 0:e.context_len)??0,r=t?Math.min(100,n/t*100):0,i=r>=95?"hot":r>=75?"warm":r>=50?"cool":"accent",s=i==="hot"?"var(--accent-hot)":i==="warm"?"var(--accent-warm)":i==="cool"?"var(--accent-cool)":"var(--accent)";return T.jsxs(st,{title:"Context window utilization",subtitle:`${We(n)} / ${We(t??0)} tokens`,children:[T.jsx("div",{className:"h-4 w-full rounded-full bg-[var(--bg-elevated)] overflow-hidden border border-[var(--border-soft)]",children:T.jsx("div",{className:"h-full transition-[width] duration-500",style:{width:`${r}%`,background:s}})}),T.jsxs("div",{className:"flex justify-between mt-2 text-xs text-[var(--text-muted)] tabular-nums",children:[T.jsx("span",{children:"0"}),T.jsxs("span",{className:"text-[var(--text-primary)] font-semibold",children:[r.toFixed(0),"%"]}),T.jsx("span",{children:We(t??0)})]})]})}var cx,EP;function hi(){if(EP)return cx;EP=1;var e=Array.isArray;return cx=e,cx}var fx,MP;function n$(){if(MP)return fx;MP=1;var e=typeof yv=="object"&&yv&&yv.Object===Object&&yv;return fx=e,fx}var dx,jP;function no(){if(jP)return dx;jP=1;var e=n$(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return dx=n,dx}var hx,PP;function Lp(){if(PP)return hx;PP=1;var e=no(),t=e.Symbol;return hx=t,hx}var px,CP;function VV(){if(CP)return px;CP=1;var e=Lp(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function s(l){var c=n.call(l,i),f=l[i];try{l[i]=void 0;var d=!0}catch{}var m=r.call(l);return d&&(c?l[i]=f:delete l[i]),m}return px=s,px}var mx,DP;function HV(){if(DP)return mx;DP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return mx=n,mx}var vx,RP;function Jo(){if(RP)return vx;RP=1;var e=Lp(),t=VV(),n=HV(),r="[object Null]",i="[object Undefined]",s=e?e.toStringTag:void 0;function l(c){return c==null?c===void 0?i:r:s&&s in Object(c)?t(c):n(c)}return vx=l,vx}var yx,NP;function es(){if(NP)return yx;NP=1;function e(t){return t!=null&&typeof t=="object"}return yx=e,yx}var gx,kP;function If(){if(kP)return gx;kP=1;var e=Jo(),t=es(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return gx=r,gx}var bx,LP;function QO(){if(LP)return bx;LP=1;var e=hi(),t=If(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(s,l){if(e(s))return!1;var c=typeof s;return c=="number"||c=="symbol"||c=="boolean"||s==null||t(s)?!0:r.test(s)||!n.test(s)||l!=null&&s in Object(l)}return bx=i,bx}var xx,zP;function ul(){if(zP)return xx;zP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return xx=e,xx}var Sx,$P;function ZO(){if($P)return Sx;$P=1;var e=Jo(),t=ul(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",s="[object Proxy]";function l(c){if(!t(c))return!1;var f=e(c);return f==r||f==i||f==n||f==s}return Sx=l,Sx}var wx,BP;function FV(){if(BP)return wx;BP=1;var e=no(),t=e["__core-js_shared__"];return wx=t,wx}var _x,qP;function GV(){if(qP)return _x;qP=1;var e=FV(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return _x=n,_x}var Ax,IP;function r$(){if(IP)return Ax;IP=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Ax=n,Ax}var Ox,UP;function KV(){if(UP)return Ox;UP=1;var e=ZO(),t=GV(),n=ul(),r=r$(),i=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,f=l.toString,d=c.hasOwnProperty,m=RegExp("^"+f.call(d).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(v){if(!n(v)||t(v))return!1;var b=e(v)?m:s;return b.test(r(v))}return Ox=p,Ox}var Tx,VP;function YV(){if(VP)return Tx;VP=1;function e(t,n){return t==null?void 0:t[n]}return Tx=e,Tx}var Ex,HP;function Mu(){if(HP)return Ex;HP=1;var e=KV(),t=YV();function n(r,i){var s=t(r,i);return e(s)?s:void 0}return Ex=n,Ex}var Mx,FP;function cg(){if(FP)return Mx;FP=1;var e=Mu(),t=e(Object,"create");return Mx=t,Mx}var jx,GP;function XV(){if(GP)return jx;GP=1;var e=cg();function t(){this.__data__=e?e(null):{},this.size=0}return jx=t,jx}var Px,KP;function WV(){if(KP)return Px;KP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Px=e,Px}var Cx,YP;function QV(){if(YP)return Cx;YP=1;var e=cg(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(s){var l=this.__data__;if(e){var c=l[s];return c===t?void 0:c}return r.call(l,s)?l[s]:void 0}return Cx=i,Cx}var Dx,XP;function ZV(){if(XP)return Dx;XP=1;var e=cg(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var s=this.__data__;return e?s[i]!==void 0:n.call(s,i)}return Dx=r,Dx}var Rx,WP;function JV(){if(WP)return Rx;WP=1;var e=cg(),t="__lodash_hash_undefined__";function n(r,i){var s=this.__data__;return this.size+=this.has(r)?0:1,s[r]=e&&i===void 0?t:i,this}return Rx=n,Rx}var Nx,QP;function eH(){if(QP)return Nx;QP=1;var e=XV(),t=WV(),n=QV(),r=ZV(),i=JV();function s(l){var c=-1,f=l==null?0:l.length;for(this.clear();++c-1}return qx=t,qx}var Ix,iC;function aH(){if(iC)return Ix;iC=1;var e=fg();function t(n,r){var i=this.__data__,s=e(i,n);return s<0?(++this.size,i.push([n,r])):i[s][1]=r,this}return Ix=t,Ix}var Ux,aC;function dg(){if(aC)return Ux;aC=1;var e=tH(),t=nH(),n=rH(),r=iH(),i=aH();function s(l){var c=-1,f=l==null?0:l.length;for(this.clear();++c>>=0,a===0?32:31-(Lu(a)/rs|0)|0}var io=256,vr=262144,is=4194304;function Ma(a){var o=a&42;if(o!==0)return o;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function zu(a,o,u){var h=a.pendingLanes;if(h===0)return 0;var y=0,g=a.suspendedLanes,P=a.pingedLanes;a=a.warmLanes;var L=h&134217727;return L!==0?(h=L&~g,h!==0?y=Ma(h):(P&=L,P!==0?y=Ma(P):u||(u=L&~a,u!==0&&(y=Ma(u))))):(L=h&~g,L!==0?y=Ma(L):P!==0?y=Ma(P):u||(u=h&~a,u!==0&&(y=Ma(u)))),y===0?0:o!==0&&o!==y&&(o&g)===0&&(g=y&-y,u=o&-o,g>=u||g===32&&(u&4194048)!==0)?o:y}function vl(a,o){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&o)===0}function o0(a,o){switch(a){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Wp(){var a=is;return is<<=1,(is&62914560)===0&&(is=4194304),a}function id(a){for(var o=[],u=0;31>u;u++)o.push(a);return o}function vi(a,o){a.pendingLanes|=o,o!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function ir(a,o,u,h,y,g){var P=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var L=a.entanglements,K=a.expirationTimes,se=a.hiddenUpdates;for(u=P&~u;0"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var s0=/[\n"\\]/g;function Ir(a){return a.replace(s0,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Vu(a,o,u,h,y,g,P,L){a.name="",P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?a.type=P:a.removeAttribute("type"),o!=null?P==="number"?(o===0&&a.value===""||a.value!=o)&&(a.value=""+qr(o)):a.value!==""+qr(o)&&(a.value=""+qr(o)):P!=="submit"&&P!=="reset"||a.removeAttribute("value"),o!=null?Hu(a,P,qr(o)):u!=null?Hu(a,P,qr(u)):h!=null&&a.removeAttribute("value"),y==null&&g!=null&&(a.defaultChecked=!!g),y!=null&&(a.checked=y&&typeof y!="function"&&typeof y!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?a.name=""+qr(L):a.removeAttribute("name")}function Jp(a,o,u,h,y,g,P,L){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(a.type=g),o!=null||u!=null){if(!(g!=="submit"&&g!=="reset"||o!=null)){Iu(a);return}u=u!=null?""+qr(u):"",o=o!=null?""+qr(o):u,L||o===a.value||(a.value=o),a.defaultValue=o}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=L?a.checked:!!h,a.defaultChecked=!!h,P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"&&(a.name=P),Iu(a)}function Hu(a,o,u){o==="number"&&Uu(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function Ca(a,o,u,h){if(a=a.options,o){o={};for(var y=0;y"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yu=!1;if(jr)try{var fs={};Object.defineProperty(fs,"passive",{get:function(){Yu=!0}}),window.addEventListener("test",fs,fs),window.removeEventListener("test",fs,fs)}catch{Yu=!1}var Vr=null,Ra=null,wl=null;function pd(){if(wl)return wl;var a,o=Ra,u=o.length,h,y="value"in Vr?Vr.value:Vr.textContent,g=y.length;for(a=0;a=ms),wd=" ",fo=!1;function Tl(a,o){switch(a){case"keyup":return cm.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function En(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var ho=!1;function gn(a,o){switch(a){case"compositionend":return En(o);case"keypress":return o.which!==32?null:(fo=!0,wd);case"textInput":return a=o.data,a===wd&&fo?null:a;default:return null}}function fm(a,o){if(ho)return a==="compositionend"||!Xu&&Tl(a,o)?(a=pd(),wl=Ra=Vr=null,ho=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:u,offset:o-a};a=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Ve(u)}}function qt(a,o){return a&&o?a===o?!0:a&&a.nodeType===3?!1:o&&o.nodeType===3?qt(a,o.parentNode):"contains"in a?a.contains(o):a.compareDocumentPosition?!!(a.compareDocumentPosition(o)&16):!1:!1}function nn(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var o=Uu(a.document);o instanceof a.HTMLIFrameElement;){try{var u=typeof o.contentWindow.location.href=="string"}catch{u=!1}if(u)a=o.contentWindow;else break;o=Uu(a.document)}return o}function bn(a){var o=a&&a.nodeName&&a.nodeName.toLowerCase();return o&&(o==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||o==="textarea"||a.contentEditable==="true")}var Pt=jr&&"documentMode"in document&&11>=document.documentMode,Lt=null,gr=null,Mn=null,Pr=!1;function Jr(a,o,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Pr||Lt==null||Lt!==Uu(h)||(h=Lt,"selectionStart"in h&&bn(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Mn&&et(Mn,h)||(Mn=h,h=tv(gr,"onSelect"),0>=P,y-=P,La=1<<32-mr(o)+y|u<it?(dt=$e,$e=null):dt=$e.sibling;var wt=le(re,$e,oe[it],ge);if(wt===null){$e===null&&($e=dt);break}a&&$e&&wt.alternate===null&&o(re,$e),ne=g(wt,ne,it),St===null?Ue=wt:St.sibling=wt,St=wt,$e=dt}if(it===oe.length)return u(re,$e),mt&&vo(re,it),Ue;if($e===null){for(;itit?(dt=$e,$e=null):dt=$e.sibling;var $s=le(re,$e,wt.value,ge);if($s===null){$e===null&&($e=dt);break}a&&$e&&$s.alternate===null&&o(re,$e),ne=g($s,ne,it),St===null?Ue=$s:St.sibling=$s,St=$s,$e=dt}if(wt.done)return u(re,$e),mt&&vo(re,it),Ue;if($e===null){for(;!wt.done;it++,wt=oe.next())wt=xe(re,wt.value,ge),wt!==null&&(ne=g(wt,ne,it),St===null?Ue=wt:St.sibling=wt,St=wt);return mt&&vo(re,it),Ue}for($e=h($e);!wt.done;it++,wt=oe.next())wt=ce($e,re,it,wt.value,ge),wt!==null&&(a&&wt.alternate!==null&&$e.delete(wt.key===null?it:wt.key),ne=g(wt,ne,it),St===null?Ue=wt:St.sibling=wt,St=wt);return a&&$e.forEach(function(nU){return o(re,nU)}),mt&&vo(re,it),Ue}function Vt(re,ne,oe,ge){if(typeof oe=="object"&&oe!==null&&oe.type===w&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:e:{for(var Ue=oe.key;ne!==null;){if(ne.key===Ue){if(Ue=oe.type,Ue===w){if(ne.tag===7){u(re,ne.sibling),ge=y(ne,oe.props.children),ge.return=re,re=ge;break e}}else if(ne.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===k&&Nl(Ue)===ne.type){u(re,ne.sibling),ge=y(ne,oe.props),jd(ge,oe),ge.return=re,re=ge;break e}u(re,ne);break}else o(re,ne);ne=ne.sibling}oe.type===w?(ge=jl(oe.props.children,re.mode,ge,oe.key),ge.return=re,re=ge):(ge=gm(oe.type,oe.key,oe.props,null,re.mode,ge),jd(ge,oe),ge.return=re,re=ge)}return P(re);case S:e:{for(Ue=oe.key;ne!==null;){if(ne.key===Ue)if(ne.tag===4&&ne.stateNode.containerInfo===oe.containerInfo&&ne.stateNode.implementation===oe.implementation){u(re,ne.sibling),ge=y(ne,oe.children||[]),ge.return=re,re=ge;break e}else{u(re,ne);break}else o(re,ne);ne=ne.sibling}ge=b0(oe,re.mode,ge),ge.return=re,re=ge}return P(re);case k:return oe=Nl(oe),Vt(re,ne,oe,ge)}if(J(oe))return Le(re,ne,oe,ge);if(B(oe)){if(Ue=B(oe),typeof Ue!="function")throw Error(r(150));return oe=Ue.call(oe),He(re,ne,oe,ge)}if(typeof oe.then=="function")return Vt(re,ne,Om(oe),ge);if(oe.$$typeof===j)return Vt(re,ne,Sm(re,oe),ge);Tm(re,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,ne!==null&&ne.tag===6?(u(re,ne.sibling),ge=y(ne,oe),ge.return=re,re=ge):(u(re,ne),ge=g0(oe,re.mode,ge),ge.return=re,re=ge),P(re)):u(re,ne)}return function(re,ne,oe,ge){try{Md=0;var Ue=Vt(re,ne,oe,ge);return ac=null,Ue}catch($e){if($e===ic||$e===_m)throw $e;var St=bi(29,$e,null,re.mode);return St.lanes=ge,St.return=re,St}finally{}}}var Ll=dE(!0),hE=dE(!1),Ss=!1;function C0(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function D0(a,o){a=a.updateQueue,o.updateQueue===a&&(o.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ws(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function _s(a,o,u){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,(Tt&2)!==0){var y=h.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),h.pending=o,o=ym(a),W2(a,null,u),o}return vm(a,h,o,u),ym(a)}function Pd(a,o,u){if(o=o.updateQueue,o!==null&&(o=o.shared,(u&4194048)!==0)){var h=o.lanes;h&=a.pendingLanes,u|=h,o.lanes=u,ao(a,u)}}function R0(a,o){var u=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var y=null,g=null;if(u=u.firstBaseUpdate,u!==null){do{var P={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};g===null?y=g=P:g=g.next=P,u=u.next}while(u!==null);g===null?y=g=o:g=g.next=o}else y=g=o;u={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:g,shared:h.shared,callbacks:h.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=o:a.next=o,u.lastBaseUpdate=o}var N0=!1;function Cd(){if(N0){var a=rc;if(a!==null)throw a}}function Dd(a,o,u,h){N0=!1;var y=a.updateQueue;Ss=!1;var g=y.firstBaseUpdate,P=y.lastBaseUpdate,L=y.shared.pending;if(L!==null){y.shared.pending=null;var K=L,se=K.next;K.next=null,P===null?g=se:P.next=se,P=K;var pe=a.alternate;pe!==null&&(pe=pe.updateQueue,L=pe.lastBaseUpdate,L!==P&&(L===null?pe.firstBaseUpdate=se:L.next=se,pe.lastBaseUpdate=K))}if(g!==null){var xe=y.baseState;P=0,pe=se=K=null,L=g;do{var le=L.lane&-536870913,ce=le!==L.lane;if(ce?(ft&le)===le:(h&le)===le){le!==0&&le===nc&&(N0=!0),pe!==null&&(pe=pe.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Le=a,He=L;le=o;var Vt=u;switch(He.tag){case 1:if(Le=He.payload,typeof Le=="function"){xe=Le.call(Vt,xe,le);break e}xe=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=He.payload,le=typeof Le=="function"?Le.call(Vt,xe,le):Le,le==null)break e;xe=p({},xe,le);break e;case 2:Ss=!0}}le=L.callback,le!==null&&(a.flags|=64,ce&&(a.flags|=8192),ce=y.callbacks,ce===null?y.callbacks=[le]:ce.push(le))}else ce={lane:le,tag:L.tag,payload:L.payload,callback:L.callback,next:null},pe===null?(se=pe=ce,K=xe):pe=pe.next=ce,P|=le;if(L=L.next,L===null){if(L=y.shared.pending,L===null)break;ce=L,L=ce.next,ce.next=null,y.lastBaseUpdate=ce,y.shared.pending=null}}while(!0);pe===null&&(K=xe),y.baseState=K,y.firstBaseUpdate=se,y.lastBaseUpdate=pe,g===null&&(y.shared.lanes=0),Ms|=P,a.lanes=P,a.memoizedState=xe}}function pE(a,o){if(typeof a!="function")throw Error(r(191,a));a.call(o)}function mE(a,o){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;ag?g:8;var P=I.T,L={};I.T=L,J0(a,!1,o,u);try{var K=y(),se=I.S;if(se!==null&&se(L,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var pe=F8(K,h);kd(a,o,pe,Ai(a))}else kd(a,o,h,Ai(a))}catch(xe){kd(a,o,{then:function(){},status:"rejected",reason:xe},Ai())}finally{F.p=g,P!==null&&L.types!==null&&(P.types=L.types),I.T=P}}function Q8(){}function Q0(a,o,u,h){if(a.tag!==5)throw Error(r(476));var y=KE(a).queue;GE(a,y,o,ae,u===null?Q8:function(){return YE(a),u(h)})}function KE(a){var o=a.memoizedState;if(o!==null)return o;o={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xo,lastRenderedState:ae},next:null};var u={};return o.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xo,lastRenderedState:u},next:null},a.memoizedState=o,a=a.alternate,a!==null&&(a.memoizedState=o),o}function YE(a){var o=KE(a);o.next===null&&(o=a.alternate.memoizedState),kd(a,o.next.queue,{},Ai())}function Z0(){return Sr(Zd)}function XE(){return Pn().memoizedState}function WE(){return Pn().memoizedState}function Z8(a){for(var o=a.return;o!==null;){switch(o.tag){case 24:case 3:var u=Ai();a=ws(u);var h=_s(o,a,u);h!==null&&(ai(h,o,u),Pd(h,o,u)),o={cache:E0()},a.payload=o;return}o=o.return}}function J8(a,o,u){var h=Ai();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Lm(a)?ZE(o,u):(u=v0(a,o,u,h),u!==null&&(ai(u,a,h),JE(u,o,h)))}function QE(a,o,u){var h=Ai();kd(a,o,u,h)}function kd(a,o,u,h){var y={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Lm(a))ZE(o,y);else{var g=a.alternate;if(a.lanes===0&&(g===null||g.lanes===0)&&(g=o.lastRenderedReducer,g!==null))try{var P=o.lastRenderedState,L=g(P,u);if(y.hasEagerState=!0,y.eagerState=L,Ye(L,P))return vm(a,o,y,0),Gt===null&&mm(),!1}catch{}finally{}if(u=v0(a,o,y,h),u!==null)return ai(u,a,h),JE(u,o,h),!0}return!1}function J0(a,o,u,h){if(h={lane:2,revertLane:Cb(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Lm(a)){if(o)throw Error(r(479))}else o=v0(a,u,h,2),o!==null&&ai(o,a,2)}function Lm(a){var o=a.alternate;return a===rt||o!==null&&o===rt}function ZE(a,o){sc=jm=!0;var u=a.pending;u===null?o.next=o:(o.next=u.next,u.next=o),a.pending=o}function JE(a,o,u){if((u&4194048)!==0){var h=o.lanes;h&=a.pendingLanes,u|=h,o.lanes=u,ao(a,u)}}var Ld={readContext:Sr,use:Dm,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useLayoutEffect:xn,useInsertionEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useSyncExternalStore:xn,useId:xn,useHostTransitionStatus:xn,useFormState:xn,useActionState:xn,useOptimistic:xn,useMemoCache:xn,useCacheRefresh:xn};Ld.useEffectEvent=xn;var eM={readContext:Sr,use:Dm,useCallback:function(a,o){return Fr().memoizedState=[a,o===void 0?null:o],a},useContext:Sr,useEffect:zE,useImperativeHandle:function(a,o,u){u=u!=null?u.concat([a]):null,Nm(4194308,4,IE.bind(null,o,a),u)},useLayoutEffect:function(a,o){return Nm(4194308,4,a,o)},useInsertionEffect:function(a,o){Nm(4,2,a,o)},useMemo:function(a,o){var u=Fr();o=o===void 0?null:o;var h=a();if(zl){Ln(!0);try{a()}finally{Ln(!1)}}return u.memoizedState=[h,o],h},useReducer:function(a,o,u){var h=Fr();if(u!==void 0){var y=u(o);if(zl){Ln(!0);try{u(o)}finally{Ln(!1)}}}else y=o;return h.memoizedState=h.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},h.queue=a,a=a.dispatch=J8.bind(null,rt,a),[h.memoizedState,a]},useRef:function(a){var o=Fr();return a={current:a},o.memoizedState=a},useState:function(a){a=G0(a);var o=a.queue,u=QE.bind(null,rt,o);return o.dispatch=u,[a.memoizedState,u]},useDebugValue:X0,useDeferredValue:function(a,o){var u=Fr();return W0(u,a,o)},useTransition:function(){var a=G0(!1);return a=GE.bind(null,rt,a.queue,!0,!1),Fr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,o,u){var h=rt,y=Fr();if(mt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=o(),Gt===null)throw Error(r(349));(ft&127)!==0||SE(h,o,u)}y.memoizedState=u;var g={value:u,getSnapshot:o};return y.queue=g,zE(_E.bind(null,h,g,a),[a]),h.flags|=2048,uc(9,{destroy:void 0},wE.bind(null,h,g,u,o),null),u},useId:function(){var a=Fr(),o=Gt.identifierPrefix;if(mt){var u=za,h=La;u=(h&~(1<<32-mr(h)-1)).toString(32)+u,o="_"+o+"R_"+u,u=Pm++,0<\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof h.is=="string"?P.createElement("select",{is:h.is}):P.createElement("select"),h.multiple?g.multiple=!0:h.size&&(g.size=h.size);break;default:g=typeof h.is=="string"?P.createElement(y,{is:h.is}):P.createElement(y)}}g[Fn]=o,g[Mr]=h;e:for(P=o.child;P!==null;){if(P.tag===5||P.tag===6)g.appendChild(P.stateNode);else if(P.tag!==4&&P.tag!==27&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===o)break e;for(;P.sibling===null;){if(P.return===null||P.return===o)break e;P=P.return}P.sibling.return=P.return,P=P.sibling}o.stateNode=g;e:switch(_r(g,y,h),y){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&wo(o)}}return an(o),hb(o,o.type,a===null?null:a.memoizedProps,o.pendingProps,u),null;case 6:if(a&&o.stateNode!=null)a.memoizedProps!==h&&wo(o);else{if(typeof h!="string"&&o.stateNode===null)throw Error(r(166));if(a=Se.current,ec(o)){if(a=o.stateNode,u=o.memoizedProps,h=null,y=xr,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}a[Fn]=o,a=!!(a.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||bj(a.nodeValue,u)),a||bs(o,!0)}else a=nv(a).createTextNode(h),a[Fn]=o,o.stateNode=a}return an(o),null;case 31:if(u=o.memoizedState,a===null||a.memoizedState!==null){if(h=ec(o),u!==null){if(a===null){if(!h)throw Error(r(318));if(a=o.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[Fn]=o}else Pl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;an(o),a=!1}else u=_0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return o.flags&256?(Si(o),o):(Si(o),null);if((o.flags&128)!==0)throw Error(r(558))}return an(o),null;case 13:if(h=o.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=ec(o),h!==null&&h.dehydrated!==null){if(a===null){if(!y)throw Error(r(318));if(y=o.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[Fn]=o}else Pl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;an(o),y=!1}else y=_0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=y),y=!0;if(!y)return o.flags&256?(Si(o),o):(Si(o),null)}return Si(o),(o.flags&128)!==0?(o.lanes=u,o):(u=h!==null,a=a!==null&&a.memoizedState!==null,u&&(h=o.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool),g=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(g=h.memoizedState.cachePool.pool),g!==y&&(h.flags|=2048)),u!==a&&u&&(o.child.flags|=8192),Im(o,o.updateQueue),an(o),null);case 4:return de(),a===null&&kb(o.stateNode.containerInfo),an(o),null;case 10:return go(o.type),an(o),null;case 19:if(U(jn),h=o.memoizedState,h===null)return an(o),null;if(y=(o.flags&128)!==0,g=h.rendering,g===null)if(y)$d(h,!1);else{if(Sn!==0||a!==null&&(a.flags&128)!==0)for(a=o.child;a!==null;){if(g=Mm(a),g!==null){for(o.flags|=128,$d(h,!1),a=g.updateQueue,o.updateQueue=a,Im(o,a),o.subtreeFlags=0,a=u,u=o.child;u!==null;)Q2(u,a),u=u.sibling;return Y(jn,jn.current&1|2),mt&&vo(o,h.treeForkCount),o.child}a=a.sibling}h.tail!==null&&ze()>Gm&&(o.flags|=128,y=!0,$d(h,!1),o.lanes=4194304)}else{if(!y)if(a=Mm(g),a!==null){if(o.flags|=128,y=!0,a=a.updateQueue,o.updateQueue=a,Im(o,a),$d(h,!0),h.tail===null&&h.tailMode==="hidden"&&!g.alternate&&!mt)return an(o),null}else 2*ze()-h.renderingStartTime>Gm&&u!==536870912&&(o.flags|=128,y=!0,$d(h,!1),o.lanes=4194304);h.isBackwards?(g.sibling=o.child,o.child=g):(a=h.last,a!==null?a.sibling=g:o.child=g,h.last=g)}return h.tail!==null?(a=h.tail,h.rendering=a,h.tail=a.sibling,h.renderingStartTime=ze(),a.sibling=null,u=jn.current,Y(jn,y?u&1|2:u&1),mt&&vo(o,h.treeForkCount),a):(an(o),null);case 22:case 23:return Si(o),L0(),h=o.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(o.flags|=8192):h&&(o.flags|=8192),h?(u&536870912)!==0&&(o.flags&128)===0&&(an(o),o.subtreeFlags&6&&(o.flags|=8192)):an(o),u=o.updateQueue,u!==null&&Im(o,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048),a!==null&&U(Rl),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),go($n),an(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function iI(a,o){switch(S0(o),o.tag){case 1:return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 3:return go($n),de(),a=o.flags,(a&65536)!==0&&(a&128)===0?(o.flags=a&-65537|128,o):null;case 26:case 27:case 5:return Ee(o),null;case 31:if(o.memoizedState!==null){if(Si(o),o.alternate===null)throw Error(r(340));Pl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 13:if(Si(o),a=o.memoizedState,a!==null&&a.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Pl()}return a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 19:return U(jn),null;case 4:return de(),null;case 10:return go(o.type),null;case 22:case 23:return Si(o),L0(),a!==null&&U(Rl),a=o.flags,a&65536?(o.flags=a&-65537|128,o):null;case 24:return go($n),null;case 25:return null;default:return null}}function AM(a,o){switch(S0(o),o.tag){case 3:go($n),de();break;case 26:case 27:case 5:Ee(o);break;case 4:de();break;case 31:o.memoizedState!==null&&Si(o);break;case 13:Si(o);break;case 19:U(jn);break;case 10:go(o.type);break;case 22:case 23:Si(o),L0(),a!==null&&U(Rl);break;case 24:go($n)}}function Bd(a,o){try{var u=o.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&a)===a){h=void 0;var g=u.create,P=u.inst;h=g(),P.destroy=h}u=u.next}while(u!==y)}}catch(L){$t(o,o.return,L)}}function Ts(a,o,u){try{var h=o.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var g=y.next;h=g;do{if((h.tag&a)===a){var P=h.inst,L=P.destroy;if(L!==void 0){P.destroy=void 0,y=o;var K=u,se=L;try{se()}catch(pe){$t(y,K,pe)}}}h=h.next}while(h!==g)}}catch(pe){$t(o,o.return,pe)}}function OM(a){var o=a.updateQueue;if(o!==null){var u=a.stateNode;try{mE(o,u)}catch(h){$t(a,a.return,h)}}}function TM(a,o,u){u.props=$l(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(h){$t(a,o,h)}}function qd(a,o){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var h=a.stateNode;break;case 30:h=a.stateNode;break;default:h=a.stateNode}typeof u=="function"?a.refCleanup=u(h):u.current=h}}catch(y){$t(a,o,y)}}function $a(a,o){var u=a.ref,h=a.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(y){$t(a,o,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){$t(a,o,y)}else u.current=null}function EM(a){var o=a.type,u=a.memoizedProps,h=a.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(y){$t(a,a.return,y)}}function pb(a,o,u){try{var h=a.stateNode;TI(h,a.type,u,o),h[Mr]=o}catch(y){$t(a,a.return,y)}}function MM(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Rs(a.type)||a.tag===4}function mb(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||MM(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Rs(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function vb(a,o,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,o?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,o):(o=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,o.appendChild(a),u=u._reactRootContainer,u!=null||o.onclick!==null||(o.onclick=Ur));else if(h!==4&&(h===27&&Rs(a.type)&&(u=a.stateNode,o=null),a=a.child,a!==null))for(vb(a,o,u),a=a.sibling;a!==null;)vb(a,o,u),a=a.sibling}function Um(a,o,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,o?u.insertBefore(a,o):u.appendChild(a);else if(h!==4&&(h===27&&Rs(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(Um(a,o,u),a=a.sibling;a!==null;)Um(a,o,u),a=a.sibling}function jM(a){var o=a.stateNode,u=a.memoizedProps;try{for(var h=a.type,y=o.attributes;y.length;)o.removeAttributeNode(y[0]);_r(o,h,u),o[Fn]=a,o[Mr]=u}catch(g){$t(a,a.return,g)}}var _o=!1,In=!1,yb=!1,PM=typeof WeakSet=="function"?WeakSet:Set,lr=null;function aI(a,o){if(a=a.containerInfo,$b=uv,a=nn(a),bn(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var y=h.anchorOffset,g=h.focusNode;h=h.focusOffset;try{u.nodeType,g.nodeType}catch{u=null;break e}var P=0,L=-1,K=-1,se=0,pe=0,xe=a,le=null;t:for(;;){for(var ce;xe!==u||y!==0&&xe.nodeType!==3||(L=P+y),xe!==g||h!==0&&xe.nodeType!==3||(K=P+h),xe.nodeType===3&&(P+=xe.nodeValue.length),(ce=xe.firstChild)!==null;)le=xe,xe=ce;for(;;){if(xe===a)break t;if(le===u&&++se===y&&(L=P),le===g&&++pe===h&&(K=P),(ce=xe.nextSibling)!==null)break;xe=le,le=xe.parentNode}xe=ce}u=L===-1||K===-1?null:{start:L,end:K}}else u=null}u=u||{start:0,end:0}}else u=null;for(Bb={focusedElem:a,selectionRange:u},uv=!1,lr=o;lr!==null;)if(o=lr,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,lr=a;else for(;lr!==null;){switch(o=lr,g=o.alternate,a=o.flags,o.tag){case 0:if((a&4)!==0&&(a=o.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u title"))),_r(g,h,u),g[Fn]=a,Tn(g),h=g;break e;case"link":var P=Lj("link","href",y).get(h+(u.href||""));if(P){for(var L=0;LVt&&(P=Vt,Vt=He,He=P);var re=Be(L,He),ne=Be(L,Vt);if(re&&ne&&(ce.rangeCount!==1||ce.anchorNode!==re.node||ce.anchorOffset!==re.offset||ce.focusNode!==ne.node||ce.focusOffset!==ne.offset)){var oe=xe.createRange();oe.setStart(re.node,re.offset),ce.removeAllRanges(),He>Vt?(ce.addRange(oe),ce.extend(ne.node,ne.offset)):(oe.setEnd(ne.node,ne.offset),ce.addRange(oe))}}}}for(xe=[],ce=L;ce=ce.parentNode;)ce.nodeType===1&&xe.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;Lu?32:u,I.T=null,u=Ab,Ab=null;var g=Ps,P=Mo;if(Gn=0,pc=Ps=null,Mo=0,(Tt&6)!==0)throw Error(r(331));var L=Tt;if(Tt|=4,IM(g.current),$M(g,g.current,P,u),Tt=L,Gd(0,!1),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(kn,g)}catch{}return!0}finally{F.p=y,I.T=h,aj(a,o)}}function sj(a,o,u){o=Ii(u,o),o=rb(a.stateNode,o,2),a=_s(a,o,2),a!==null&&(vi(a,2),Ba(a))}function $t(a,o,u){if(a.tag===3)sj(a,a,u);else for(;o!==null;){if(o.tag===3){sj(o,a,u);break}else if(o.tag===1){var h=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(js===null||!js.has(h))){a=Ii(u,a),u=lM(2),h=_s(o,u,2),h!==null&&(uM(u,h,o,a),vi(h,2),Ba(h));break}}o=o.return}}function Mb(a,o,u){var h=a.pingCache;if(h===null){h=a.pingCache=new lI;var y=new Set;h.set(o,y)}else y=h.get(o),y===void 0&&(y=new Set,h.set(o,y));y.has(u)||(xb=!0,y.add(u),a=hI.bind(null,a,o,u),o.then(a,a))}function hI(a,o,u){var h=a.pingCache;h!==null&&h.delete(o),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,Gt===a&&(ft&u)===u&&(Sn===4||Sn===3&&(ft&62914560)===ft&&300>ze()-Fm?(Tt&2)===0&&mc(a,0):Sb|=u,hc===ft&&(hc=0)),Ba(a)}function lj(a,o){o===0&&(o=Wp()),a=Ml(a,o),a!==null&&(vi(a,o),Ba(a))}function pI(a){var o=a.memoizedState,u=0;o!==null&&(u=o.retryLane),lj(a,u)}function mI(a,o){var u=0;switch(a.tag){case 31:case 13:var h=a.stateNode,y=a.memoizedState;y!==null&&(u=y.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(o),lj(a,u)}function vI(a,o){return pt(a,o)}var Zm=null,yc=null,jb=!1,Jm=!1,Pb=!1,Ds=0;function Ba(a){a!==yc&&a.next===null&&(yc===null?Zm=yc=a:yc=yc.next=a),Jm=!0,jb||(jb=!0,gI())}function Gd(a,o){if(!Pb&&Jm){Pb=!0;do for(var u=!1,h=Zm;h!==null;){if(a!==0){var y=h.pendingLanes;if(y===0)var g=0;else{var P=h.suspendedLanes,L=h.pingedLanes;g=(1<<31-mr(42|a)+1)-1,g&=y&~(P&~L),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(u=!0,dj(h,g))}else g=ft,g=zu(h,h===Gt?g:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(g&3)===0||vl(h,g)||(u=!0,dj(h,g));h=h.next}while(u);Pb=!1}}function yI(){uj()}function uj(){Jm=jb=!1;var a=0;Ds!==0&&MI()&&(a=Ds);for(var o=ze(),u=null,h=Zm;h!==null;){var y=h.next,g=cj(h,o);g===0?(h.next=null,u===null?Zm=y:u.next=y,y===null&&(yc=u)):(u=h,(a!==0||(g&3)!==0)&&(Jm=!0)),h=y}Gn!==0&&Gn!==5||Gd(a),Ds!==0&&(Ds=0)}function cj(a,o){for(var u=a.suspendedLanes,h=a.pingedLanes,y=a.expirationTimes,g=a.pendingLanes&-62914561;0L)break;var pe=K.transferSize,xe=K.initiatorType;pe&&xj(xe)&&(K=K.responseEnd,P+=pe*(K"u"?null:document;function Dj(a,o,u){var h=gc;if(h&&typeof o=="string"&&o){var y=Ir(o);y='link[rel="'+a+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),Cj.has(y)||(Cj.add(y),a={rel:a,crossOrigin:u,href:o},h.querySelector(y)===null&&(o=h.createElement("link"),_r(o,"link",a),Tn(o),h.head.appendChild(o)))}}function zI(a){jo.D(a),Dj("dns-prefetch",a,null)}function $I(a,o){jo.C(a,o),Dj("preconnect",a,o)}function BI(a,o,u){jo.L(a,o,u);var h=gc;if(h&&a&&o){var y='link[rel="preload"][as="'+Ir(o)+'"]';o==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Ir(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Ir(u.imageSizes)+'"]')):y+='[href="'+Ir(a)+'"]';var g=y;switch(o){case"style":g=bc(a);break;case"script":g=xc(a)}Ki.has(g)||(a=p({rel:"preload",href:o==="image"&&u&&u.imageSrcSet?void 0:a,as:o},u),Ki.set(g,a),h.querySelector(y)!==null||o==="style"&&h.querySelector(Wd(g))||o==="script"&&h.querySelector(Qd(g))||(o=h.createElement("link"),_r(o,"link",a),Tn(o),h.head.appendChild(o)))}}function qI(a,o){jo.m(a,o);var u=gc;if(u&&a){var h=o&&typeof o.as=="string"?o.as:"script",y='link[rel="modulepreload"][as="'+Ir(h)+'"][href="'+Ir(a)+'"]',g=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=xc(a)}if(!Ki.has(g)&&(a=p({rel:"modulepreload",href:a},o),Ki.set(g,a),u.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Qd(g)))return}h=u.createElement("link"),_r(h,"link",a),Tn(h),u.head.appendChild(h)}}}function II(a,o,u){jo.S(a,o,u);var h=gc;if(h&&a){var y=zi(h).hoistableStyles,g=bc(a);o=o||"default";var P=y.get(g);if(!P){var L={loading:0,preload:null};if(P=h.querySelector(Wd(g)))L.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":o},u),(u=Ki.get(g))&&Gb(a,u);var K=P=h.createElement("link");Tn(K),_r(K,"link",a),K._p=new Promise(function(se,pe){K.onload=se,K.onerror=pe}),K.addEventListener("load",function(){L.loading|=1}),K.addEventListener("error",function(){L.loading|=2}),L.loading|=4,iv(P,o,h)}P={type:"stylesheet",instance:P,count:1,state:L},y.set(g,P)}}}function UI(a,o){jo.X(a,o);var u=gc;if(u&&a){var h=zi(u).hoistableScripts,y=xc(a),g=h.get(y);g||(g=u.querySelector(Qd(y)),g||(a=p({src:a,async:!0},o),(o=Ki.get(y))&&Kb(a,o),g=u.createElement("script"),Tn(g),_r(g,"link",a),u.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},h.set(y,g))}}function VI(a,o){jo.M(a,o);var u=gc;if(u&&a){var h=zi(u).hoistableScripts,y=xc(a),g=h.get(y);g||(g=u.querySelector(Qd(y)),g||(a=p({src:a,async:!0,type:"module"},o),(o=Ki.get(y))&&Kb(a,o),g=u.createElement("script"),Tn(g),_r(g,"link",a),u.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},h.set(y,g))}}function Rj(a,o,u,h){var y=(y=Se.current)?rv(y):null;if(!y)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(o=bc(u.href),u=zi(y).hoistableStyles,h=u.get(o),h||(h={type:"style",instance:null,count:0,state:null},u.set(o,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=bc(u.href);var g=zi(y).hoistableStyles,P=g.get(a);if(P||(y=y.ownerDocument||y,P={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(a,P),(g=y.querySelector(Wd(a)))&&!g._p&&(P.instance=g,P.state.loading=5),Ki.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Ki.set(a,u),g||HI(y,a,u,P.state))),o&&h===null)throw Error(r(528,""));return P}if(o&&h!==null)throw Error(r(529,""));return null;case"script":return o=u.async,u=u.src,typeof u=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=xc(u),u=zi(y).hoistableScripts,h=u.get(o),h||(h={type:"script",instance:null,count:0,state:null},u.set(o,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function bc(a){return'href="'+Ir(a)+'"'}function Wd(a){return'link[rel="stylesheet"]['+a+"]"}function Nj(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function HI(a,o,u,h){a.querySelector('link[rel="preload"][as="style"]['+o+"]")?h.loading=1:(o=a.createElement("link"),h.preload=o,o.addEventListener("load",function(){return h.loading|=1}),o.addEventListener("error",function(){return h.loading|=2}),_r(o,"link",u),Tn(o),a.head.appendChild(o))}function xc(a){return'[src="'+Ir(a)+'"]'}function Qd(a){return"script[async]"+a}function kj(a,o,u){if(o.count++,o.instance===null)switch(o.type){case"style":var h=a.querySelector('style[data-href~="'+Ir(u.href)+'"]');if(h)return o.instance=h,Tn(h),h;var y=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),Tn(h),_r(h,"style",y),iv(h,u.precedence,a),o.instance=h;case"stylesheet":y=bc(u.href);var g=a.querySelector(Wd(y));if(g)return o.state.loading|=4,o.instance=g,Tn(g),g;h=Nj(u),(y=Ki.get(y))&&Gb(h,y),g=(a.ownerDocument||a).createElement("link"),Tn(g);var P=g;return P._p=new Promise(function(L,K){P.onload=L,P.onerror=K}),_r(g,"link",h),o.state.loading|=4,iv(g,u.precedence,a),o.instance=g;case"script":return g=xc(u.src),(y=a.querySelector(Qd(g)))?(o.instance=y,Tn(y),y):(h=u,(y=Ki.get(g))&&(h=p({},u),Kb(h,y)),a=a.ownerDocument||a,y=a.createElement("script"),Tn(y),_r(y,"link",h),a.head.appendChild(y),o.instance=y);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(h=o.instance,o.state.loading|=4,iv(h,u.precedence,a));return o.instance}function iv(a,o,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,g=y,P=0;P title"):null)}function FI(a,o,u){if(u===1||o.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return a=o.disabled,typeof o.precedence=="string"&&a==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function $j(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function GI(a,o,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=bc(h.href),g=o.querySelector(Wd(y));if(g){o=g._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(a.count++,a=ov.bind(a),o.then(a,a)),u.state.loading|=4,u.instance=g,Tn(g);return}g=o.ownerDocument||o,h=Nj(h),(y=Ki.get(y))&&Gb(h,y),g=g.createElement("link"),Tn(g);var P=g;P._p=new Promise(function(L,K){P.onload=L,P.onerror=K}),_r(g,"link",h),u.instance=g}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,o),(o=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=ov.bind(a),o.addEventListener("load",u),o.addEventListener("error",u))}}var Yb=0;function KI(a,o){return a.stylesheets&&a.count===0&&lv(a,a.stylesheets),0Yb?50:800)+o);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(h),clearTimeout(y)}}:null}function ov(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lv(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var sv=null;function lv(a,o){a.stylesheets=null,a.unsuspend!==null&&(a.count++,sv=new Map,o.forEach(YI,a),sv=null,ov.call(a))}function YI(a,o){if(!(o.state.loading&4)){var u=sv.get(a);if(u)var h=u.get(null);else{u=new Map,sv.set(a,u);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ix.exports=cU(),ix.exports}var dU=fU();const hU=Ft(dU);var Bf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},iu,Ks,Vc,wz,pU=(wz=class extends Bf{constructor(){super();qe(this,iu);qe(this,Ks);qe(this,Vc);Ce(this,Vc,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Ks)||this.setEventListener(W(this,Vc))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Ks))==null||t.call(this),Ce(this,Ks,void 0))}setEventListener(t){var n;Ce(this,Vc,t),(n=W(this,Ks))==null||n.call(this),Ce(this,Ks,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,iu)!==t&&(Ce(this,iu,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof W(this,iu)=="boolean"?W(this,iu):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},iu=new WeakMap,Ks=new WeakMap,Vc=new WeakMap,wz),FO=new pU,mU={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ys,VO,_z,vU=(_z=class{constructor(){qe(this,Ys,mU);qe(this,VO,!1)}setTimeoutProvider(e){Ce(this,Ys,e)}setTimeout(e,t){return W(this,Ys).setTimeout(e,t)}clearTimeout(e){W(this,Ys).clearTimeout(e)}setInterval(e,t){return W(this,Ys).setInterval(e,t)}clearInterval(e){W(this,Ys).clearInterval(e)}},Ys=new WeakMap,VO=new WeakMap,_z),Ql=new vU;function yU(e){setTimeout(e,0)}var gU=typeof window>"u"||"Deno"in globalThis;function Kr(){}function bU(e,t){return typeof e=="function"?e(t):e}function N_(e){return typeof e=="number"&&e>=0&&e!==1/0}function Rz(e,t){return Math.max(e+(t||0)-Date.now(),0)}function al(e,t){return typeof e=="function"?e(t):e}function Pi(e,t){return typeof e=="function"?e(t):e}function uP(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==GO(l,t.options))return!1}else if(!Uh(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||s&&!s(t))}function cP(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(bu(t.options.mutationKey)!==bu(s))return!1}else if(!Uh(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function GO(e,t){return((t==null?void 0:t.queryKeyHashFn)||bu)(e)}function bu(e){return JSON.stringify(e,(t,n)=>k_(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Uh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Uh(e[n],t[n])):!1}var xU=Object.prototype.hasOwnProperty;function Nz(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=fP(e)&&fP(t);if(!r&&!(k_(e)&&k_(t)))return t;const s=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,f=r?new Array(c):{};let d=0;for(let m=0;m{Ql.setTimeout(t,e)})}function L_(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Nz(e,t):t}function wU(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function _U(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var KO=Symbol();function kz(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===KO?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function YO(e,t){return typeof e=="function"?e(...t):!!e}function AU(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var Vh=(()=>{let e=()=>gU;return{isServer(){return e()},setIsServer(t){e=t}}})();function z_(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var OU=yU;function TU(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=OU;const s=c=>{t?e.push(c):i(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},batchCalls:c=>(...f)=>{s(()=>{c(...f)})},schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var Qn=TU(),Hc,Xs,Fc,Az,EU=(Az=class extends Bf{constructor(){super();qe(this,Hc,!0);qe(this,Xs);qe(this,Fc);Ce(this,Fc,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){W(this,Xs)||this.setEventListener(W(this,Fc))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Xs))==null||t.call(this),Ce(this,Xs,void 0))}setEventListener(t){var n;Ce(this,Fc,t),(n=W(this,Xs))==null||n.call(this),Ce(this,Xs,t(this.setOnline.bind(this)))}setOnline(t){W(this,Hc)!==t&&(Ce(this,Hc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Hc)}},Hc=new WeakMap,Xs=new WeakMap,Fc=new WeakMap,Az),Qv=new EU;function MU(e){return Math.min(1e3*2**e,3e4)}function Lz(e){return(e??"online")==="online"?Qv.isOnline():!0}var $_=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function zz(e){let t=!1,n=0,r;const i=z_(),s=()=>i.status!=="pending",l=w=>{var x;if(!s()){const _=new $_(w);v(_),(x=e.onCancel)==null||x.call(e,_)}},c=()=>{t=!0},f=()=>{t=!1},d=()=>FO.isFocused()&&(e.networkMode==="always"||Qv.isOnline())&&e.canRun(),m=()=>Lz(e.networkMode)&&e.canRun(),p=w=>{s()||(r==null||r(),i.resolve(w))},v=w=>{s()||(r==null||r(),i.reject(w))},b=()=>new Promise(w=>{var x;r=_=>{(s()||d())&&w(_)},(x=e.onPause)==null||x.call(e)}).then(()=>{var w;r=void 0,s()||(w=e.onContinue)==null||w.call(e)}),S=()=>{if(s())return;let w;const x=n===0?e.initialPromise:void 0;try{w=x??e.fn()}catch(_){w=Promise.reject(_)}Promise.resolve(w).then(p).catch(_=>{var M;if(s())return;const O=e.retry??(Vh.isServer()?0:3),j=e.retryDelay??MU,E=typeof j=="function"?j(n,_):j,A=O===!0||typeof O=="number"&&nd()?void 0:b()).then(()=>{t?v(_):S()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r==null||r(),i),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?S():b().then(S),i)}}var au,Oz,$z=(Oz=class{constructor(){qe(this,au)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),N_(this.gcTime)&&Ce(this,au,Ql.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Vh.isServer()?1/0:300*1e3))}clearGcTimeout(){W(this,au)!==void 0&&(Ql.clearTimeout(W(this,au)),Ce(this,au,void 0))}},au=new WeakMap,Oz);function jU(e){return{onFetch:(t,n)=>{var m,p,v,b,S;const r=t.options,i=(v=(p=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,s=((b=t.state.data)==null?void 0:b.pages)||[],l=((S=t.state.data)==null?void 0:S.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const d=async()=>{let w=!1;const x=j=>{AU(j,()=>t.signal,()=>w=!0)},_=kz(t.options,t.fetchOptions),O=async(j,E,A)=>{if(w)return Promise.reject(t.signal.reason);if(E==null&&j.pages.length)return Promise.resolve(j);const R=(()=>{const $={client:t.client,queryKey:t.queryKey,pageParam:E,direction:A?"backward":"forward",meta:t.options.meta};return x($),$})(),k=await _(R),{maxPages:z}=t.options,G=A?_U:wU;return{pages:G(j.pages,k,z),pageParams:G(j.pageParams,E,z)}};if(i&&s.length){const j=i==="backward",E=j?PU:hP,A={pages:s,pageParams:l},M=E(r,A);c=await O(A,M,j)}else{const j=e??s.length;do{const E=f===0?l[0]??r.initialPageParam:hP(r,c);if(f>0&&E==null)break;c=await O(c,E),f++}while(f{var w,x;return(x=(w=t.options).persister)==null?void 0:x.call(w,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function hP(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function PU(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Gc,ou,Kc,na,su,ur,Cp,lu,ji,Bz,Do,Tz,CU=(Tz=class extends $z{constructor(t){super();qe(this,ji);qe(this,Gc);qe(this,ou);qe(this,Kc);qe(this,na);qe(this,su);qe(this,ur);qe(this,Cp);qe(this,lu);Ce(this,lu,!1),Ce(this,Cp,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ce(this,su,t.client),Ce(this,na,W(this,su).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ce(this,ou,mP(this.options)),this.state=t.state??W(this,ou),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return W(this,Gc)}get promise(){var t;return(t=W(this,ur))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,Cp),...t},t!=null&&t._type&&Ce(this,Gc,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=mP(this.options);n.data!==void 0&&(this.setState(pP(n.data,n.dataUpdatedAt)),Ce(this,ou,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,na).remove(this)}setData(t,n){const r=L_(this.state.data,t,this.options);return at(this,ji,Do).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){at(this,ji,Do).call(this,{type:"setState",state:t})}cancel(t){var r,i;const n=(r=W(this,ur))==null?void 0:r.promise;return(i=W(this,ur))==null||i.cancel(t),n?n.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return W(this,ou)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Pi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===KO||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>al(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Rz(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,ur))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,ur))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,na).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(W(this,ur)&&(W(this,lu)||at(this,ji,Bz).call(this)?W(this,ur).cancel({revert:!0}):W(this,ur).cancelRetry()),this.scheduleGc()),W(this,na).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||at(this,ji,Do).call(this,{type:"invalidate"})}async fetch(t,n){var d,m,p,v,b,S,w,x,_,O,j;if(this.state.fetchStatus!=="idle"&&((d=W(this,ur))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,ur))return W(this,ur).continueRetry(),W(this,ur).promise}if(t&&this.setOptions(t),!this.options.queryFn){const E=this.observers.find(A=>A.options.queryFn);E&&this.setOptions(E.options)}const r=new AbortController,i=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(Ce(this,lu,!0),r.signal)})},s=()=>{const E=kz(this.options,n),M=(()=>{const R={client:W(this,su),queryKey:this.queryKey,meta:this.meta};return i(R),R})();return Ce(this,lu,!1),this.options.persister?this.options.persister(E,M,this):E(M)},c=(()=>{const E={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,su),state:this.state,fetchFn:s};return i(E),E})(),f=W(this,Gc)==="infinite"?jU(this.options.pages):this.options.behavior;f==null||f.onFetch(c,this),Ce(this,Kc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&at(this,ji,Do).call(this,{type:"fetch",meta:(p=c.fetchOptions)==null?void 0:p.meta}),Ce(this,ur,zz({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:E=>{E instanceof $_&&E.revert&&this.setState({...W(this,Kc),fetchStatus:"idle"}),r.abort()},onFail:(E,A)=>{at(this,ji,Do).call(this,{type:"failed",failureCount:E,error:A})},onPause:()=>{at(this,ji,Do).call(this,{type:"pause"})},onContinue:()=>{at(this,ji,Do).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const E=await W(this,ur).start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(b=(v=W(this,na).config).onSuccess)==null||b.call(v,E,this),(w=(S=W(this,na).config).onSettled)==null||w.call(S,E,this.state.error,this),E}catch(E){if(E instanceof $_){if(E.silent)return W(this,ur).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw at(this,ji,Do).call(this,{type:"error",error:E}),(_=(x=W(this,na).config).onError)==null||_.call(x,E,this),(j=(O=W(this,na).config).onSettled)==null||j.call(O,this.state.data,E,this),E}finally{this.scheduleGc()}}},Gc=new WeakMap,ou=new WeakMap,Kc=new WeakMap,na=new WeakMap,su=new WeakMap,ur=new WeakMap,Cp=new WeakMap,lu=new WeakMap,ji=new WeakSet,Bz=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Do=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...qz(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...pP(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ce(this,Kc,t.manual?i:void 0),i;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Qn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,na).notify({query:this,type:"updated",action:t})})},Tz);function qz(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Lz(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function pP(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function mP(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var oi,vt,Dp,Gr,uu,Yc,Ro,Ws,Rp,Xc,Wc,cu,fu,Qs,Qc,Nt,gh,B_,q_,I_,U_,V_,H_,F_,Iz,Ez,DU=(Ez=class extends Bf{constructor(t,n){super();qe(this,Nt);qe(this,oi);qe(this,vt);qe(this,Dp);qe(this,Gr);qe(this,uu);qe(this,Yc);qe(this,Ro);qe(this,Ws);qe(this,Rp);qe(this,Xc);qe(this,Wc);qe(this,cu);qe(this,fu);qe(this,Qs);qe(this,Qc,new Set);this.options=n,Ce(this,oi,t),Ce(this,Ws,null),Ce(this,Ro,z_()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,vt).addObserver(this),vP(W(this,vt),this.options)?at(this,Nt,gh).call(this):this.updateResult(),at(this,Nt,U_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return G_(W(this,vt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return G_(W(this,vt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,at(this,Nt,V_).call(this),at(this,Nt,H_).call(this),W(this,vt).removeObserver(this)}setOptions(t){const n=this.options,r=W(this,vt);if(this.options=W(this,oi).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Pi(this.options.enabled,W(this,vt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");at(this,Nt,F_).call(this),W(this,vt).setOptions(this.options),n._defaulted&&!Wv(this.options,n)&&W(this,oi).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,vt),observer:this});const i=this.hasListeners();i&&yP(W(this,vt),r,this.options,n)&&at(this,Nt,gh).call(this),this.updateResult(),i&&(W(this,vt)!==r||Pi(this.options.enabled,W(this,vt))!==Pi(n.enabled,W(this,vt))||al(this.options.staleTime,W(this,vt))!==al(n.staleTime,W(this,vt)))&&at(this,Nt,B_).call(this);const s=at(this,Nt,q_).call(this);i&&(W(this,vt)!==r||Pi(this.options.enabled,W(this,vt))!==Pi(n.enabled,W(this,vt))||s!==W(this,Qs))&&at(this,Nt,I_).call(this,s)}getOptimisticResult(t){const n=W(this,oi).getQueryCache().build(W(this,oi),t),r=this.createResult(n,t);return NU(this,r)&&(Ce(this,Gr,r),Ce(this,Yc,this.options),Ce(this,uu,W(this,vt).state)),r}getCurrentResult(){return W(this,Gr)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&W(this,Ro).status==="pending"&&W(this,Ro).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){W(this,Qc).add(t)}getCurrentQuery(){return W(this,vt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,oi).defaultQueryOptions(t),r=W(this,oi).getQueryCache().build(W(this,oi),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return at(this,Nt,gh).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Gr)))}createResult(t,n){var z;const r=W(this,vt),i=this.options,s=W(this,Gr),l=W(this,uu),c=W(this,Yc),d=t!==r?t.state:W(this,Dp),{state:m}=t;let p={...m},v=!1,b;if(n._optimisticResults){const G=this.hasListeners(),$=!G&&vP(t,n),B=G&&yP(t,r,n,i);($||B)&&(p={...p,...qz(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:S,errorUpdatedAt:w,status:x}=p;b=p.data;let _=!1;if(n.placeholderData!==void 0&&b===void 0&&x==="pending"){let G;s!=null&&s.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(G=s.data,_=!0):G=typeof n.placeholderData=="function"?n.placeholderData((z=W(this,Wc))==null?void 0:z.state.data,W(this,Wc)):n.placeholderData,G!==void 0&&(x="success",b=L_(s==null?void 0:s.data,G,n),v=!0)}if(n.select&&b!==void 0&&!_)if(s&&b===(l==null?void 0:l.data)&&n.select===W(this,Rp))b=W(this,Xc);else try{Ce(this,Rp,n.select),b=n.select(b),b=L_(s==null?void 0:s.data,b,n),Ce(this,Xc,b),Ce(this,Ws,null)}catch(G){Ce(this,Ws,G)}W(this,Ws)&&(S=W(this,Ws),b=W(this,Xc),w=Date.now(),x="error");const O=p.fetchStatus==="fetching",j=x==="pending",E=x==="error",A=j&&O,M=b!==void 0,k={status:x,fetchStatus:p.fetchStatus,isPending:j,isSuccess:x==="success",isError:E,isInitialLoading:A,isLoading:A,data:b,dataUpdatedAt:p.dataUpdatedAt,error:S,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:O,isRefetching:O&&!j,isLoadingError:E&&!M,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:E&&M,isStale:XO(t,n),refetch:this.refetch,promise:W(this,Ro),isEnabled:Pi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const G=k.data!==void 0,$=k.status==="error"&&!G,B=J=>{$?J.reject(k.error):G&&J.resolve(k.data)},X=()=>{const J=Ce(this,Ro,k.promise=z_());B(J)},ee=W(this,Ro);switch(ee.status){case"pending":t.queryHash===r.queryHash&&B(ee);break;case"fulfilled":($||k.data!==ee.value)&&X();break;case"rejected":(!$||k.error!==ee.reason)&&X();break}}return k}updateResult(){const t=W(this,Gr),n=this.createResult(W(this,vt),this.options);if(Ce(this,uu,W(this,vt).state),Ce(this,Yc,this.options),W(this,uu).data!==void 0&&Ce(this,Wc,W(this,vt)),Wv(n,t))return;Ce(this,Gr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!W(this,Qc).size)return!0;const l=new Set(s??W(this,Qc));return this.options.throwOnError&&l.add("error"),Object.keys(W(this,Gr)).some(c=>{const f=c;return W(this,Gr)[f]!==t[f]&&l.has(f)})};at(this,Nt,Iz).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&at(this,Nt,U_).call(this)}},oi=new WeakMap,vt=new WeakMap,Dp=new WeakMap,Gr=new WeakMap,uu=new WeakMap,Yc=new WeakMap,Ro=new WeakMap,Ws=new WeakMap,Rp=new WeakMap,Xc=new WeakMap,Wc=new WeakMap,cu=new WeakMap,fu=new WeakMap,Qs=new WeakMap,Qc=new WeakMap,Nt=new WeakSet,gh=function(t){at(this,Nt,F_).call(this);let n=W(this,vt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Kr)),n},B_=function(){at(this,Nt,V_).call(this);const t=al(this.options.staleTime,W(this,vt));if(Vh.isServer()||W(this,Gr).isStale||!N_(t))return;const r=Rz(W(this,Gr).dataUpdatedAt,t)+1;Ce(this,cu,Ql.setTimeout(()=>{W(this,Gr).isStale||this.updateResult()},r))},q_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,vt)):this.options.refetchInterval)??!1},I_=function(t){at(this,Nt,H_).call(this),Ce(this,Qs,t),!(Vh.isServer()||Pi(this.options.enabled,W(this,vt))===!1||!N_(W(this,Qs))||W(this,Qs)===0)&&Ce(this,fu,Ql.setInterval(()=>{(this.options.refetchIntervalInBackground||FO.isFocused())&&at(this,Nt,gh).call(this)},W(this,Qs)))},U_=function(){at(this,Nt,B_).call(this),at(this,Nt,I_).call(this,at(this,Nt,q_).call(this))},V_=function(){W(this,cu)!==void 0&&(Ql.clearTimeout(W(this,cu)),Ce(this,cu,void 0))},H_=function(){W(this,fu)!==void 0&&(Ql.clearInterval(W(this,fu)),Ce(this,fu,void 0))},F_=function(){const t=W(this,oi).getQueryCache().build(W(this,oi),this.options);if(t===W(this,vt))return;const n=W(this,vt);Ce(this,vt,t),Ce(this,Dp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Iz=function(t){Qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,Gr))}),W(this,oi).getQueryCache().notify({query:W(this,vt),type:"observerResultsUpdated"})})},Ez);function RU(e,t){return Pi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Pi(t.retryOnMount,e)===!1)}function vP(e,t){return RU(e,t)||e.state.data!==void 0&&G_(e,t,t.refetchOnMount)}function G_(e,t,n){if(Pi(t.enabled,e)!==!1&&al(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&XO(e,t)}return!1}function yP(e,t,n,r){return(e!==t||Pi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&XO(e,n)}function XO(e,t){return Pi(t.enabled,e)!==!1&&e.isStaleByTime(al(t.staleTime,e))}function NU(e,t){return!Wv(e.getCurrentResult(),t)}var Np,Va,Nr,du,Ha,Is,Mz,kU=(Mz=class extends $z{constructor(t){super();qe(this,Ha);qe(this,Np);qe(this,Va);qe(this,Nr);qe(this,du);Ce(this,Np,t.client),this.mutationId=t.mutationId,Ce(this,Nr,t.mutationCache),Ce(this,Va,[]),this.state=t.state||Uz(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){W(this,Va).includes(t)||(W(this,Va).push(t),this.clearGcTimeout(),W(this,Nr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ce(this,Va,W(this,Va).filter(n=>n!==t)),this.scheduleGc(),W(this,Nr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,Va).length||(this.state.status==="pending"?this.scheduleGc():W(this,Nr).remove(this))}continue(){var t;return((t=W(this,du))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,c,f,d,m,p,v,b,S,w,x,_,O,j,E,A,M,R;const n=()=>{at(this,Ha,Is).call(this,{type:"continue"})},r={client:W(this,Np),meta:this.options.meta,mutationKey:this.options.mutationKey};Ce(this,du,zz({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(k,z)=>{at(this,Ha,Is).call(this,{type:"failed",failureCount:k,error:z})},onPause:()=>{at(this,Ha,Is).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,Nr).canRun(this)}));const i=this.state.status==="pending",s=!W(this,du).canStart();try{if(i)n();else{at(this,Ha,Is).call(this,{type:"pending",variables:t,isPaused:s}),W(this,Nr).config.onMutate&&await W(this,Nr).config.onMutate(t,this,r);const z=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));z!==this.state.context&&at(this,Ha,Is).call(this,{type:"pending",context:z,variables:t,isPaused:s})}const k=await W(this,du).start();return await((d=(f=W(this,Nr).config).onSuccess)==null?void 0:d.call(f,k,t,this.state.context,this,r)),await((p=(m=this.options).onSuccess)==null?void 0:p.call(m,k,t,this.state.context,r)),await((b=(v=W(this,Nr).config).onSettled)==null?void 0:b.call(v,k,null,this.state.variables,this.state.context,this,r)),await((w=(S=this.options).onSettled)==null?void 0:w.call(S,k,null,t,this.state.context,r)),at(this,Ha,Is).call(this,{type:"success",data:k}),k}catch(k){try{await((_=(x=W(this,Nr).config).onError)==null?void 0:_.call(x,k,t,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((j=(O=this.options).onError)==null?void 0:j.call(O,k,t,this.state.context,r))}catch(z){Promise.reject(z)}try{await((A=(E=W(this,Nr).config).onSettled)==null?void 0:A.call(E,void 0,k,this.state.variables,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((R=(M=this.options).onSettled)==null?void 0:R.call(M,void 0,k,t,this.state.context,r))}catch(z){Promise.reject(z)}throw at(this,Ha,Is).call(this,{type:"error",error:k}),k}finally{W(this,Nr).runNext(this)}}},Np=new WeakMap,Va=new WeakMap,Nr=new WeakMap,du=new WeakMap,Ha=new WeakSet,Is=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Qn.batch(()=>{W(this,Va).forEach(r=>{r.onMutationUpdate(t)}),W(this,Nr).notify({mutation:this,type:"updated",action:t})})},Mz);function Uz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var No,ba,kp,jz,LU=(jz=class extends Bf{constructor(t={}){super();qe(this,No);qe(this,ba);qe(this,kp);this.config=t,Ce(this,No,new Set),Ce(this,ba,new Map),Ce(this,kp,0)}build(t,n,r){const i=new kU({client:t,mutationCache:this,mutationId:++vv(this,kp)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){W(this,No).add(t);const n=gv(t);if(typeof n=="string"){const r=W(this,ba).get(n);r?r.push(t):W(this,ba).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,No).delete(t)){const n=gv(t);if(typeof n=="string"){const r=W(this,ba).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&W(this,ba).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=gv(t);if(typeof n=="string"){const r=W(this,ba).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=gv(t);if(typeof n=="string"){const i=(r=W(this,ba).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Qn.batch(()=>{W(this,No).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,No).clear(),W(this,ba).clear()})}getAll(){return Array.from(W(this,No))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>cP(n,r))}findAll(t={}){return this.getAll().filter(n=>cP(t,n))}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Qn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Kr))))}},No=new WeakMap,ba=new WeakMap,kp=new WeakMap,jz);function gv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ko,Zs,si,Lo,Ko,Fv,K_,Pz,zU=(Pz=class extends Bf{constructor(n,r){super();qe(this,Ko);qe(this,ko);qe(this,Zs);qe(this,si);qe(this,Lo);Ce(this,ko,n),this.setOptions(r),this.bindMethods(),at(this,Ko,Fv).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=W(this,ko).defaultMutationOptions(n),Wv(this.options,r)||W(this,ko).getMutationCache().notify({type:"observerOptionsUpdated",mutation:W(this,si),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&bu(r.mutationKey)!==bu(this.options.mutationKey)?this.reset():((i=W(this,si))==null?void 0:i.state.status)==="pending"&&W(this,si).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=W(this,si))==null||n.removeObserver(this)}onMutationUpdate(n){at(this,Ko,Fv).call(this),at(this,Ko,K_).call(this,n)}getCurrentResult(){return W(this,Zs)}reset(){var n;(n=W(this,si))==null||n.removeObserver(this),Ce(this,si,void 0),at(this,Ko,Fv).call(this),at(this,Ko,K_).call(this)}mutate(n,r){var i;return Ce(this,Lo,r),(i=W(this,si))==null||i.removeObserver(this),Ce(this,si,W(this,ko).getMutationCache().build(W(this,ko),this.options)),W(this,si).addObserver(this),W(this,si).execute(n)}},ko=new WeakMap,Zs=new WeakMap,si=new WeakMap,Lo=new WeakMap,Ko=new WeakSet,Fv=function(){var r;const n=((r=W(this,si))==null?void 0:r.state)??Uz();Ce(this,Zs,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},K_=function(n){Qn.batch(()=>{var r,i,s,l,c,f,d,m;if(W(this,Lo)&&this.hasListeners()){const p=W(this,Zs).variables,v=W(this,Zs).context,b={client:W(this,ko),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=W(this,Lo)).onSuccess)==null||i.call(r,n.data,p,v,b)}catch(S){Promise.reject(S)}try{(l=(s=W(this,Lo)).onSettled)==null||l.call(s,n.data,null,p,v,b)}catch(S){Promise.reject(S)}}else if((n==null?void 0:n.type)==="error"){try{(f=(c=W(this,Lo)).onError)==null||f.call(c,n.error,p,v,b)}catch(S){Promise.reject(S)}try{(m=(d=W(this,Lo)).onSettled)==null||m.call(d,void 0,n.error,p,v,b)}catch(S){Promise.reject(S)}}}this.listeners.forEach(p=>{p(W(this,Zs))})})},Pz),Fa,Cz,$U=(Cz=class extends Bf{constructor(t={}){super();qe(this,Fa);this.config=t,Ce(this,Fa,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??GO(i,n);let l=this.get(s);return l||(l=new CU({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(l)),l}add(t){W(this,Fa).has(t.queryHash)||(W(this,Fa).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,Fa).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,Fa).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Qn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,Fa).get(t)}getAll(){return[...W(this,Fa).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>uP(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>uP(t,r)):n}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Fa=new WeakMap,Cz),wn,Js,el,Zc,Jc,tl,ef,tf,Dz,BU=(Dz=class{constructor(e={}){qe(this,wn);qe(this,Js);qe(this,el);qe(this,Zc);qe(this,Jc);qe(this,tl);qe(this,ef);qe(this,tf);Ce(this,wn,e.queryCache||new $U),Ce(this,Js,e.mutationCache||new LU),Ce(this,el,e.defaultOptions||{}),Ce(this,Zc,new Map),Ce(this,Jc,new Map),Ce(this,tl,0)}mount(){vv(this,tl)._++,W(this,tl)===1&&(Ce(this,ef,FO.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,wn).onFocus())})),Ce(this,tf,Qv.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,wn).onOnline())})))}unmount(){var e,t;vv(this,tl)._--,W(this,tl)===0&&((e=W(this,ef))==null||e.call(this),Ce(this,ef,void 0),(t=W(this,tf))==null||t.call(this),Ce(this,tf,void 0))}isFetching(e){return W(this,wn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,Js).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,wn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=W(this,wn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(al(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return W(this,wn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=W(this,wn).get(r.queryHash),s=i==null?void 0:i.state.data,l=bU(t,s);if(l!==void 0)return W(this,wn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Qn.batch(()=>W(this,wn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=W(this,wn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=W(this,wn);Qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,wn);return Qn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Qn.batch(()=>W(this,wn).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(e,t={}){return Qn.batch(()=>(W(this,wn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Qn.batch(()=>W(this,wn).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Kr)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=W(this,wn).build(this,t);return n.isStaleByTime(al(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kr).catch(Kr)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kr).catch(Kr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Qv.isOnline()?W(this,Js).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,wn)}getMutationCache(){return W(this,Js)}getDefaultOptions(){return W(this,el)}setDefaultOptions(e){Ce(this,el,e)}setQueryDefaults(e,t){W(this,Zc).set(bu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,Zc).values()],n={};return t.forEach(r=>{Uh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){W(this,Jc).set(bu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,Jc).values()],n={};return t.forEach(r=>{Uh(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,el).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=GO(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===KO&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,el).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,wn).clear(),W(this,Js).clear()}},wn=new WeakMap,Js=new WeakMap,el=new WeakMap,Zc=new WeakMap,Jc=new WeakMap,tl=new WeakMap,ef=new WeakMap,tf=new WeakMap,Dz),Vz=Z.createContext(void 0),qf=e=>{const t=Z.useContext(Vz);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},qU=({client:e,children:t})=>(Z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),T.jsx(Vz.Provider,{value:e,children:t})),Hz=Z.createContext(!1),IU=()=>Z.useContext(Hz);Hz.Provider;function UU(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var VU=Z.createContext(UU()),HU=()=>Z.useContext(VU),FU=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?YO(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},GU=e=>{Z.useEffect(()=>{e.clearReset()},[e])},KU=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||YO(n,[e.error,r])),YU=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},XU=(e,t)=>e.isLoading&&e.isFetching&&!t,WU=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,gP=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function QU(e,t,n){var v,b,S,w;const r=IU(),i=HU(),s=qf(),l=s.defaultQueryOptions(e);(b=(v=s.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||b.call(v,l);const c=s.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",YU(l),FU(l,i,c),GU(i);const f=!s.getQueryCache().get(l.queryHash),[d]=Z.useState(()=>new t(s,l)),m=d.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(Z.useSyncExternalStore(Z.useCallback(x=>{const _=p?d.subscribe(Qn.batchCalls(x)):Kr;return d.updateResult(),_},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),Z.useEffect(()=>{d.setOptions(l)},[l,d]),WU(l,m))throw gP(l,d,i);if(KU({result:m,errorResetBoundary:i,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw m.error;if((w=(S=s.getDefaultOptions().queries)==null?void 0:S._experimental_afterQuery)==null||w.call(S,l,m),l.experimental_prefetchInRender&&!Vh.isServer()&&XU(m,r)){const x=f?gP(l,d,i):c==null?void 0:c.promise;x==null||x.catch(Kr).finally(()=>{d.updateResult()})}return l.notifyOnChangeProps?m:d.trackResult(m)}function Fz(e,t){return QU(e,DU)}function lg(e,t){const n=qf(),[r]=Z.useState(()=>new zU(n,e));Z.useEffect(()=>{r.setOptions(e)},[r,e]);const i=Z.useSyncExternalStore(Z.useCallback(l=>r.subscribe(Qn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=Z.useCallback((l,c)=>{r.mutate(l,c).catch(Kr)},[r]);if(i.error&&YO(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}function Gz(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=eV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const c=l.split(WO);return c[0]===""&&c.length!==1&&c.shift(),Kz(c,t)||JU(l)},getConflictingClassGroupIds:(l,c)=>{const f=n[l]||[];return c&&r[l]?[...f,...r[l]]:f}}},Kz=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?Kz(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(WO);return(l=t.validators.find(({validator:c})=>c(s)))==null?void 0:l.classGroupId},bP=/^\[(.+)\]$/,JU=e=>{if(bP.test(e)){const t=bP.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},eV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return nV(Object.entries(e.classGroups),n).forEach(([s,l])=>{Y_(l,r,s,t)}),r},Y_=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:xP(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(tV(i)){Y_(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,l])=>{Y_(l,xP(t,s),n,r)})})},xP=(e,t)=>{let n=e;return t.split(WO).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},tV=e=>e.isThemeGetter,nV=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([l,c])=>[t+l,c])):s);return[n,i]}):e,rV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,l)=>{n.set(s,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let l=n.get(s);if(l!==void 0)return l;if((l=r.get(s))!==void 0)return i(s,l),l},set(s,l){n.has(s)?n.set(s,l):i(s,l)}}},Yz="!",iV=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,l=c=>{const f=[];let d=0,m=0,p;for(let x=0;xm?p-m:void 0;return{modifiers:f,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:w}};return n?c=>n({className:c,parseClassName:l}):l},aV=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},oV=e=>({cache:rV(e.cacheSize),parseClassName:iV(e),...ZU(e)}),sV=/\s+/,lV=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],l=e.trim().split(sV);let c="";for(let f=l.length-1;f>=0;f-=1){const d=l[f],{modifiers:m,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:b}=n(d);let S=!!b,w=r(S?v.substring(0,b):v);if(!w){if(!S){c=d+(c.length>0?" "+c:c);continue}if(w=r(v),!w){c=d+(c.length>0?" "+c:c);continue}S=!1}const x=aV(m).join(":"),_=p?x+Yz:x,O=_+w;if(s.includes(O))continue;s.push(O);const j=i(w,S);for(let E=0;E0?" "+c:c)}return c};function uV(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rp(m),e());return n=oV(d),r=n.cache.get,i=n.cache.set,s=c,c(f)}function c(f){const d=r(f);if(d)return d;const m=lV(f,n);return i(f,m),m}return function(){return s(uV.apply(null,arguments))}}const on=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Wz=/^\[(?:([a-z-]+):)?(.+)\]$/i,fV=/^\d+\/\d+$/,dV=new Set(["px","full","screen"]),hV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pV=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,vV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Po=e=>$c(e)||dV.has(e)||fV.test(e),Bs=e=>If(e,"length",OV),$c=e=>!!e&&!Number.isNaN(Number(e)),lx=e=>If(e,"number",$c),ih=e=>!!e&&Number.isInteger(Number(e)),gV=e=>e.endsWith("%")&&$c(e.slice(0,-1)),ot=e=>Wz.test(e),qs=e=>hV.test(e),bV=new Set(["length","size","percentage"]),xV=e=>If(e,bV,Qz),SV=e=>If(e,"position",Qz),wV=new Set(["image","url"]),_V=e=>If(e,wV,EV),AV=e=>If(e,"",TV),ah=()=>!0,If=(e,t,n)=>{const r=Wz.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},OV=e=>pV.test(e)&&!mV.test(e),Qz=()=>!1,TV=e=>vV.test(e),EV=e=>yV.test(e),MV=()=>{const e=on("colors"),t=on("spacing"),n=on("blur"),r=on("brightness"),i=on("borderColor"),s=on("borderRadius"),l=on("borderSpacing"),c=on("borderWidth"),f=on("contrast"),d=on("grayscale"),m=on("hueRotate"),p=on("invert"),v=on("gap"),b=on("gradientColorStops"),S=on("gradientColorStopPositions"),w=on("inset"),x=on("margin"),_=on("opacity"),O=on("padding"),j=on("saturate"),E=on("scale"),A=on("sepia"),M=on("skew"),R=on("space"),k=on("translate"),z=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",ot,t],B=()=>[ot,t],X=()=>["",Po,Bs],ee=()=>["auto",$c,ot],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>["start","end","center","between","around","evenly","stretch"],fe=()=>["","0",ot],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[$c,ot];return{cacheSize:500,separator:":",theme:{colors:[ah],spacing:[Po,Bs],blur:["none","",qs,ot],brightness:D(),borderColor:[e],borderRadius:["none","","full",qs,ot],borderSpacing:B(),borderWidth:X(),contrast:D(),grayscale:fe(),hueRotate:D(),invert:fe(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[gV,Bs],inset:$(),margin:$(),opacity:D(),padding:B(),saturate:D(),scale:D(),sepia:fe(),skew:D(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",ot]}],container:["container"],columns:[{columns:[qs]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...J(),ot]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ih,ot]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ot]}],grow:[{grow:fe()}],shrink:[{shrink:fe()}],order:[{order:["first","last","none",ih,ot]}],"grid-cols":[{"grid-cols":[ah]}],"col-start-end":[{col:["auto",{span:["full",ih,ot]},ot]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[ah]}],"row-start-end":[{row:["auto",{span:[ih,ot]},ot]}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ot]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ot]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...ae()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ae(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ae(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[O]}],px:[{px:[O]}],py:[{py:[O]}],ps:[{ps:[O]}],pe:[{pe:[O]}],pt:[{pt:[O]}],pr:[{pr:[O]}],pb:[{pb:[O]}],pl:[{pl:[O]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ot,t]}],"min-w":[{"min-w":[ot,t,"min","max","fit"]}],"max-w":[{"max-w":[ot,t,"none","full","min","max","fit","prose",{screen:[qs]},qs]}],h:[{h:[ot,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ot,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ot,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ot,t,"auto","min","max","fit"]}],"font-size":[{text:["base",qs,Bs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",lx]}],"font-family":[{font:[ah]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ot]}],"line-clamp":[{"line-clamp":["none",$c,lx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Po,ot]}],"list-image":[{"list-image":["none",ot]}],"list-style-type":[{list:["none","disc","decimal",ot]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Po,Bs]}],"underline-offset":[{"underline-offset":["auto",Po,ot]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ot]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ot]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...J(),SV]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",xV]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},_V]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...I(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:I()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...I()]}],"outline-offset":[{"outline-offset":[Po,ot]}],"outline-w":[{outline:[Po,Bs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[Po,Bs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",qs,AV]}],"shadow-color":[{shadow:[ah]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",qs,ot]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[j]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[j]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ot]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",ot]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",ot]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[ih,ot]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ot]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ot]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ot]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Po,Bs,lx]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},jV=cV(MV);function nf(...e){return jV(ct(e))}function li(e){if(e==null||Number.isNaN(e))return"—";const t=["B","KB","MB","GB","TB"];let n=Number(e),r=0;for(;n>=1024&&r{let t;const n=new Set,r=(d,m)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const v=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(b=>b(t,v))}},i=()=>t,c={setState:r,getState:i,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(r,i,c);return c},PV=(e=>e?SP(e):SP),CV=e=>e;function DV(e,t=CV){const n=Q.useSyncExternalStore(e.subscribe,Q.useCallback(()=>t(e.getState()),[e,t]),Q.useCallback(()=>t(e.getInitialState()),[e,t]));return Q.useDebugValue(n),n}const wP=e=>{const t=PV(e),n=r=>DV(t,r);return Object.assign(n,t),n},RV=(e=>e?wP(e):wP),_P=e=>Symbol.iterator in e,AP=e=>"entries"in e,OP=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[i,s]of n)if(!r.has(i)||!Object.is(s,r.get(i)))return!1;return!0},NV=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let i=n.next(),s=r.next();for(;!i.done&&!s.done;){if(!Object.is(i.value,s.value))return!1;i=n.next(),s=r.next()}return!!i.done&&!!s.done};function kV(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:_P(e)&&_P(t)?AP(e)&&AP(t)?OP(e,t):NV(e,t):OP({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function ug(e){const t=Q.useRef(void 0);return n=>{const r=e(n);return kV(t.current,r)?t.current:t.current=r}}const Jz="mtplx.dashboard.theme";function e$(){if(typeof window>"u")return"hippo";const e=window.localStorage.getItem(Jz);return e==="hippo"||e==="river"||e==="light"||e==="mono"?e:"hippo"}function TP(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Jz,e),window.document.documentElement.setAttribute("data-theme",e)}catch{}}const ux=["hippo","river","light","mono"],De=RV((e,t)=>({snapshot:null,latest:null,recent:[],rolling:null,lifetime:null,inFlight:[],sessionBank:null,sessions:null,mem:null,thermal:null,thermalWhenS:0,settings:null,modelId:null,profileName:null,contextWindow:null,machine:null,uptimeS:0,liveTokS:null,liveProgressByRequest:{},activePrefillByRequest:{},lastCompletedPrefill:null,newMaxTPSEvent:null,connection:"idle",reconnectAttempts:0,lastSnapshotAtMs:null,sessionFilter:null,theme:e$(),pauseStream:!1,soundEnabled:!1,applySnapshot:n=>{var i,s;if(t().pauseStream)return;const r={};(n.in_flight??[]).forEach(l=>{l.prefill_state&&(r[l.request_id]={...l.prefill_state,request_id:l.request_id,session_id:l.session_id})}),e({snapshot:n,latest:n.latest,recent:n.recent??[],rolling:n.rolling,lifetime:n.lifetime,inFlight:n.in_flight??[],sessionBank:n.session_bank??null,sessions:n.sessions??null,mem:n.mem,thermal:n.thermal,thermalWhenS:n.thermal_when_s,settings:n.settings,modelId:n.model_id,profileName:((i=n.profile)==null?void 0:i.name)??null,contextWindow:n.context_window,machine:n.machine,uptimeS:n.uptime_s,activePrefillByRequest:r,liveTokS:typeof((s=n.latest)==null?void 0:s.decode_tok_s)=="number"?n.latest.decode_tok_s:null,lastSnapshotAtMs:Date.now()})},applyEvent:n=>{var r,i;if(!t().pauseStream)switch(n.kind){case"progress":{const s=(r=n.progress)==null?void 0:r.decode_tok_s;e(l=>({liveTokS:typeof s=="number"&&s>0?s:l.liveTokS,liveProgressByRequest:{...l.liveProgressByRequest,[n.request_id]:n}}));break}case"completed":{const s=(i=n.envelope)==null?void 0:i.decode_tok_s;e(l=>({latest:n.envelope??l.latest,liveTokS:typeof s=="number"&&s>0?s:l.liveTokS}));break}case"new_max_tps":{e({newMaxTPSEvent:{tok_s:n.tok_s,when_s:n.when_s,session_id:n.session_id}});break}case"thermal":{e({thermal:n.thermal,thermalWhenS:n.when_s});break}case"prefill":{const s=n.request_id,l={phase:n.phase,tokens_done:n.tokens_done,tokens_total:n.tokens_total,cached_tokens:n.cached_tokens,new_prefill_tokens:n.new_prefill_tokens,elapsed_s:n.elapsed_s,prefill_tok_s:n.prefill_tok_s,chunk_size:n.chunk_size,cache_hit:n.cache_hit,started_s:n.started_s,request_id:s,session_id:n.session_id};n.phase==="completed"?e(c=>{const f={...c.activePrefillByRequest};return delete f[s],{activePrefillByRequest:f,lastCompletedPrefill:{...l,when_s:n.when_s}}}):e(c=>({activePrefillByRequest:{...c.activePrefillByRequest,[s]:l}}));break}case"snapshot":{t().applySnapshot(n);break}}},setConnection:n=>{e(r=>({connection:n,reconnectAttempts:n==="reconnecting"?r.reconnectAttempts+1:0}))},setSessionFilter:n=>e({sessionFilter:n}),setTheme:n=>{TP(n),e({theme:n})},cycleTheme:()=>{const n=t().theme,r=ux[(ux.indexOf(n)+1)%ux.length];TP(r),e({theme:r})},togglePauseStream:()=>e(n=>({pauseStream:!n.pauseStream})),toggleSound:()=>e(n=>({soundEnabled:!n.soundEnabled})),consumeNewMaxTPS:()=>e({newMaxTPSEvent:null})}));typeof window<"u"&&window.document.documentElement.setAttribute("data-theme",e$());function LV(){return De(ug(e=>{var n;const t=new Set;return(n=e.rolling)==null||n.history.forEach(r=>{r.session_id&&t.add(r.session_id)}),e.inFlight.forEach(r=>{r.session_id&&t.add(r.session_id)}),Array.from(t).sort()}))}function zV(){return De(ug(e=>{if(!e.rolling)return[];const t=e.sessionFilter;return t?e.rolling.history.filter(n=>n.session_id===t):e.rolling.history}))}function $V(){return De(ug(e=>e.sessionFilter?e.recent.filter(t=>t.session_id===e.sessionFilter):e.recent))}function t$(){return De(ug(e=>{const t=Object.values(e.activePrefillByRequest);if(t.length===0)return{active:!1};const n=t.reduce((m,p)=>(p.elapsed_s??0)>(m.elapsed_s??0)?p:m),r=Number(n.tokens_total??0),i=Number(n.tokens_done??0),s=Number(n.elapsed_s??0),l=r>0?Math.min(100,i/r*100):0,c=typeof n.prefill_tok_s=="number"&&n.prefill_tok_s>0?n.prefill_tok_s:i>0&&s>0?i/s:null,f=Math.max(0,r-i),d=c&&c>0&&f>0?f/c:null;return{active:!0,request_id:n.request_id,session_id:n.session_id,tokens_done:i,tokens_total:r,cached_tokens:Number(n.cached_tokens??0),elapsed_s:s,prefill_tok_s:c,pct:l,eta_s:d}}))}function BV(){const e=De(m=>m.latest),t=De(m=>m.lifetime),n=De(m=>m.liveTokS),r=(e==null?void 0:e.completion_tokens)??null,i=(e==null?void 0:e.ttft_s)??null,s=n??(e==null?void 0:e.decode_tok_s)??null,l=(e==null?void 0:e.request_tok_s)??null,c=(e==null?void 0:e.prompt_eval_time_s)??null,f=(e==null?void 0:e.decode_elapsed_s)??null,d=(t==null?void 0:t.requests_total)??0;return T.jsxs("div",{className:"px-4 lg:px-6 py-2 flex items-center justify-between gap-4 text-xs",children:[T.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[var(--text-muted)] min-w-0",children:[T.jsx(Il,{label:"tok",value:We(r)}),T.jsx(Il,{label:"ttft",value:Zn(i)}),T.jsx(Il,{label:"prompt eval",value:Zn(c)}),T.jsx(Il,{label:"decode",value:Zn(f)}),T.jsx(Il,{label:"tok/s",value:Rn(s),highlight:typeof s=="number"&&s>=40}),T.jsx(Il,{label:"req tok/s",value:Rn(l)}),T.jsx(Il,{label:"lifetime req",value:We(d)})]}),T.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)] hidden sm:block",children:"MTPLX live"})]})}function Il({label:e,value:t,highlight:n=!1}){return T.jsxs("span",{className:"flex items-baseline gap-1.5 whitespace-nowrap",children:[T.jsx("span",{className:"text-[10px] uppercase tracking-widest text-[var(--text-muted)]",children:e}),T.jsx("span",{className:"tabular-nums font-medium "+(n?"text-[var(--accent)]":"text-[var(--text-primary)]"),children:t})]})}function st({title:e,subtitle:t,action:n,className:r,bodyClassName:i,children:s}){return T.jsxs("section",{className:nf("rounded-2xl border border-[var(--border-soft)] bg-[var(--bg-card)] shadow-[inset_0_1px_0_0_rgba(255,255,255,0.02)] overflow-hidden",r),children:[(e||n)&&T.jsxs("header",{className:"px-5 pt-4 pb-2 flex items-start justify-between gap-4",children:[T.jsxs("div",{className:"min-w-0",children:[e?T.jsx("h3",{className:"text-sm font-semibold text-[var(--text-primary)] tracking-tight",children:e}):null,t?T.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-0.5",children:t}):null]}),n?T.jsx("div",{className:"shrink-0",children:n}):null]}),T.jsx("div",{className:nf("px-5 pb-5 pt-2",i),children:s})]})}function Ya({value:e,unit:t,caption:n,tone:r="default"}){const i=r==="accent"?"text-[var(--accent)]":r==="warm"?"text-[var(--accent-warm)]":r==="hot"?"text-[var(--accent-hot)]":r==="cool"?"text-[var(--accent-cool)]":"text-[var(--text-primary)]";return T.jsxs("div",{children:[T.jsxs("div",{className:nf("flex items-baseline gap-2",i),children:[T.jsx("span",{className:"text-4xl font-semibold tabular-nums leading-none",children:e}),t?T.jsx("span",{className:"text-sm text-[var(--text-muted)]",children:t}):null]}),n?T.jsx("div",{className:"text-xs text-[var(--text-muted)] mt-2",children:n}):null]})}function qV(){const e=De(i=>i.lifetime),t=(e==null?void 0:e.cached_tokens_total)??0,n=(e==null?void 0:e.prompt_tokens_total)??0,r=n>0?t/n*100:0;return T.jsx(st,{title:"Cached tokens · lifetime",subtitle:"cached / prompt across all requests",children:T.jsx(Ya,{value:We(t),unit:"tokens",tone:"accent",caption:`${r.toFixed(1)}% of ${We(n)} prompt tokens`})})}function IV(){const t=De(s=>s.recent).slice(-32),n=t.filter(s=>s.session_cache_hit).length,r=t.length>0?n/t.length*100:0,i=r>=70?"accent":r>=40?"warm":"hot";return T.jsx(st,{title:"Session cache hit rate",subtitle:`last ${t.length} requests`,children:T.jsx(Ya,{value:`${r.toFixed(0)}%`,unit:"hit",tone:i,caption:`${n} hits / ${t.length} requests`})})}function UV(){const e=De(l=>l.latest),t=De(l=>l.contextWindow),n=(e==null?void 0:e.context_len)??0,r=t?Math.min(100,n/t*100):0,i=r>=95?"hot":r>=75?"warm":r>=50?"cool":"accent",s=i==="hot"?"var(--accent-hot)":i==="warm"?"var(--accent-warm)":i==="cool"?"var(--accent-cool)":"var(--accent)";return T.jsxs(st,{title:"Context window utilization",subtitle:`${We(n)} / ${We(t??0)} tokens`,children:[T.jsx("div",{className:"h-4 w-full rounded-full bg-[var(--bg-elevated)] overflow-hidden border border-[var(--border-soft)]",children:T.jsx("div",{className:"h-full transition-[width] duration-500",style:{width:`${r}%`,background:s}})}),T.jsxs("div",{className:"flex justify-between mt-2 text-xs text-[var(--text-muted)] tabular-nums",children:[T.jsx("span",{children:"0"}),T.jsxs("span",{className:"text-[var(--text-primary)] font-semibold",children:[r.toFixed(0),"%"]}),T.jsx("span",{children:We(t??0)})]})]})}var cx,EP;function hi(){if(EP)return cx;EP=1;var e=Array.isArray;return cx=e,cx}var fx,MP;function n$(){if(MP)return fx;MP=1;var e=typeof yv=="object"&&yv&&yv.Object===Object&&yv;return fx=e,fx}var dx,jP;function no(){if(jP)return dx;jP=1;var e=n$(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return dx=n,dx}var hx,PP;function Lp(){if(PP)return hx;PP=1;var e=no(),t=e.Symbol;return hx=t,hx}var px,CP;function VV(){if(CP)return px;CP=1;var e=Lp(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function s(l){var c=n.call(l,i),f=l[i];try{l[i]=void 0;var d=!0}catch{}var m=r.call(l);return d&&(c?l[i]=f:delete l[i]),m}return px=s,px}var mx,DP;function HV(){if(DP)return mx;DP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return mx=n,mx}var vx,RP;function Jo(){if(RP)return vx;RP=1;var e=Lp(),t=VV(),n=HV(),r="[object Null]",i="[object Undefined]",s=e?e.toStringTag:void 0;function l(c){return c==null?c===void 0?i:r:s&&s in Object(c)?t(c):n(c)}return vx=l,vx}var yx,NP;function es(){if(NP)return yx;NP=1;function e(t){return t!=null&&typeof t=="object"}return yx=e,yx}var gx,kP;function Uf(){if(kP)return gx;kP=1;var e=Jo(),t=es(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return gx=r,gx}var bx,LP;function QO(){if(LP)return bx;LP=1;var e=hi(),t=Uf(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(s,l){if(e(s))return!1;var c=typeof s;return c=="number"||c=="symbol"||c=="boolean"||s==null||t(s)?!0:r.test(s)||!n.test(s)||l!=null&&s in Object(l)}return bx=i,bx}var xx,zP;function ul(){if(zP)return xx;zP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return xx=e,xx}var Sx,$P;function ZO(){if($P)return Sx;$P=1;var e=Jo(),t=ul(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",s="[object Proxy]";function l(c){if(!t(c))return!1;var f=e(c);return f==r||f==i||f==n||f==s}return Sx=l,Sx}var wx,BP;function FV(){if(BP)return wx;BP=1;var e=no(),t=e["__core-js_shared__"];return wx=t,wx}var _x,qP;function GV(){if(qP)return _x;qP=1;var e=FV(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return _x=n,_x}var Ax,IP;function r$(){if(IP)return Ax;IP=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Ax=n,Ax}var Ox,UP;function KV(){if(UP)return Ox;UP=1;var e=ZO(),t=GV(),n=ul(),r=r$(),i=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,f=l.toString,d=c.hasOwnProperty,m=RegExp("^"+f.call(d).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(v){if(!n(v)||t(v))return!1;var b=e(v)?m:s;return b.test(r(v))}return Ox=p,Ox}var Tx,VP;function YV(){if(VP)return Tx;VP=1;function e(t,n){return t==null?void 0:t[n]}return Tx=e,Tx}var Ex,HP;function Mu(){if(HP)return Ex;HP=1;var e=KV(),t=YV();function n(r,i){var s=t(r,i);return e(s)?s:void 0}return Ex=n,Ex}var Mx,FP;function cg(){if(FP)return Mx;FP=1;var e=Mu(),t=e(Object,"create");return Mx=t,Mx}var jx,GP;function XV(){if(GP)return jx;GP=1;var e=cg();function t(){this.__data__=e?e(null):{},this.size=0}return jx=t,jx}var Px,KP;function WV(){if(KP)return Px;KP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Px=e,Px}var Cx,YP;function QV(){if(YP)return Cx;YP=1;var e=cg(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(s){var l=this.__data__;if(e){var c=l[s];return c===t?void 0:c}return r.call(l,s)?l[s]:void 0}return Cx=i,Cx}var Dx,XP;function ZV(){if(XP)return Dx;XP=1;var e=cg(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var s=this.__data__;return e?s[i]!==void 0:n.call(s,i)}return Dx=r,Dx}var Rx,WP;function JV(){if(WP)return Rx;WP=1;var e=cg(),t="__lodash_hash_undefined__";function n(r,i){var s=this.__data__;return this.size+=this.has(r)?0:1,s[r]=e&&i===void 0?t:i,this}return Rx=n,Rx}var Nx,QP;function eH(){if(QP)return Nx;QP=1;var e=XV(),t=WV(),n=QV(),r=ZV(),i=JV();function s(l){var c=-1,f=l==null?0:l.length;for(this.clear();++c-1}return qx=t,qx}var Ix,iC;function aH(){if(iC)return Ix;iC=1;var e=fg();function t(n,r){var i=this.__data__,s=e(i,n);return s<0?(++this.size,i.push([n,r])):i[s][1]=r,this}return Ix=t,Ix}var Ux,aC;function dg(){if(aC)return Ux;aC=1;var e=tH(),t=nH(),n=rH(),r=iH(),i=aH();function s(l){var c=-1,f=l==null?0:l.length;for(this.clear();++c0?1:-1},Zl=function(t){return Su(t)&&t.indexOf("%")===t.length-1},Oe=function(t){return MH(t)&&!Vf(t)},jH=function(t){return Qe(t)},Jn=function(t){return Oe(t)||Su(t)},PH=0,ju=function(t){var n=++PH;return"".concat(t||"").concat(n)},wu=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Oe(t)&&!Su(t))return r;var s;if(Zl(t)){var l=t.indexOf("%");s=n*parseFloat(t.slice(0,l))/100}else s=+t;return Vf(s)&&(s=r),i&&s>n&&(s=n),s},Gs=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},CH=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function BH(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function W_(e){"@babel/helpers - typeof";return W_=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},W_(e)}var RC={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"},qo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},NC=null,p1=null,aT=function e(t){if(t===NC&&Array.isArray(p1))return p1;var n=[];return Z.Children.forEach(t,function(r){Qe(r)||(AH.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),p1=n,NC=t,n};function fi(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return qo(i)}):r=[qo(t)],aT(e).forEach(function(i){var s=aa(i,"type.displayName")||aa(i,"type.name");r.indexOf(s)!==-1&&n.push(i)}),n}function Mi(e,t){var n=fi(e,t);return n&&n[0]}var kC=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!Oe(r)||r<=0||!Oe(i)||i<=0)},qH=["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"],IH=function(t){return t&&t.type&&Su(t.type)&&qH.indexOf(t.type)>=0},u$=function(t){return t&&W_(t)==="object"&&"clipDot"in t},UH=function(t,n,r,i){var s,l=(s=h1==null?void 0:h1[i])!==null&&s!==void 0?s:[];return n.startsWith("data-")||!tt(t)&&(i&&l.includes(n)||kH.includes(n))||r&&iT.includes(n)},Je=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(Z.isValidElement(t)&&(i=t.props),!Uf(i))return null;var s={};return Object.keys(i).forEach(function(l){var c;UH((c=i)===null||c===void 0?void 0:c[l],l,n,r)&&(s[l]=i[l])}),s},Q_=function e(t,n){if(t===n)return!0;var r=Z.Children.count(t);if(r!==Z.Children.count(n))return!1;if(r===0)return!0;if(r===1)return LC(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KH(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function J_(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,s=e.className,l=e.style,c=e.title,f=e.desc,d=GH(e,FH),m=i||{width:n,height:r,x:0,y:0},p=ct("recharts-surface",s);return Q.createElement("svg",Z_({},Je(d,!0,"svg"),{className:p,width:n,height:r,style:l,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height)}),Q.createElement("title",null,c),Q.createElement("desc",null,f),t)}var YH=["children","className"];function eA(){return eA=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WH(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Mt=Q.forwardRef(function(e,t){var n=e.children,r=e.className,i=XH(e,YH),s=ct("recharts-layer",r);return Q.createElement("g",eA({className:s},Je(i,!0),{ref:t}),n)}),Io=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;ss?0:s+n),r=r>s?s:r,r<0&&(r+=s),s=n>r?0:r-n>>>0,n>>>=0;for(var l=Array(s);++i=s?n:e(n,r,i)}return v1=t,v1}var y1,qC;function c$(){if(qC)return y1;qC=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,s="\\ufe0e\\ufe0f",l="\\u200d",c=RegExp("["+l+e+i+s+"]");function f(d){return c.test(d)}return y1=f,y1}var g1,IC;function JH(){if(IC)return g1;IC=1;function e(t){return t.split("")}return g1=e,g1}var b1,UC;function eF(){if(UC)return b1;UC=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,s="\\ufe0e\\ufe0f",l="["+e+"]",c="["+i+"]",f="\\ud83c[\\udffb-\\udfff]",d="(?:"+c+"|"+f+")",m="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",v="[\\ud800-\\udbff][\\udc00-\\udfff]",b="\\u200d",S=d+"?",w="["+s+"]?",x="(?:"+b+"(?:"+[m,p,v].join("|")+")"+w+S+")*",_=w+S+x,O="(?:"+[m+c+"?",c,p,v,l].join("|")+")",j=RegExp(f+"(?="+f+")|"+O+_,"g");function E(A){return A.match(j)||[]}return b1=E,b1}var x1,VC;function tF(){if(VC)return x1;VC=1;var e=JH(),t=c$(),n=eF();function r(i){return t(i)?n(i):e(i)}return x1=r,x1}var S1,HC;function nF(){if(HC)return S1;HC=1;var e=ZH(),t=c$(),n=tF(),r=a$();function i(s){return function(l){l=r(l);var c=t(l)?n(l):void 0,f=c?c[0]:l.charAt(0),d=c?e(c,1).join(""):l.slice(1);return f[s]()+d}}return S1=i,S1}var w1,FC;function rF(){if(FC)return w1;FC=1;var e=nF(),t=e("toUpperCase");return w1=t,w1}var iF=rF();const mg=Ft(iF);function en(e){return function(){return e}}const f$=Math.cos,ey=Math.sin,Ea=Math.sqrt,ty=Math.PI,vg=2*ty,tA=Math.PI,nA=2*tA,Hl=1e-6,aF=nA-Hl;function d$(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return d$;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;iHl)if(!(Math.abs(p*f-d*m)>Hl)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let b=r-l,S=i-c,w=f*f+d*d,x=b*b+S*S,_=Math.sqrt(w),O=Math.sqrt(v),j=s*Math.tan((tA-Math.acos((w+v-x)/(2*_*O)))/2),E=j/O,A=j/_;Math.abs(E-1)>Hl&&this._append`L${t+E*m},${n+E*p}`,this._append`A${s},${s},0,0,${+(p*b>m*S)},${this._x1=t+A*f},${this._y1=n+A*d}`}}arc(t,n,r,i,s,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),f=r*Math.sin(i),d=t+c,m=n+f,p=1^l,v=l?i-s:s-i;this._x1===null?this._append`M${d},${m}`:(Math.abs(this._x1-d)>Hl||Math.abs(this._y1-m)>Hl)&&this._append`L${d},${m}`,r&&(v<0&&(v=v%nA+nA),v>aF?this._append`A${r},${r},0,1,${p},${t-c},${n-f}A${r},${r},0,1,${p},${this._x1=d},${this._y1=m}`:v>Hl&&this._append`A${r},${r},0,${+(v>=tA)},${p},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function oT(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new sF(t)}function sT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function h$(e){this._context=e}h$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function yg(e){return new h$(e)}function p$(e){return e[0]}function m$(e){return e[1]}function v$(e,t){var n=en(!0),r=null,i=yg,s=null,l=oT(c);e=typeof e=="function"?e:e===void 0?p$:en(e),t=typeof t=="function"?t:t===void 0?m$:en(t);function c(f){var d,m=(f=sT(f)).length,p,v=!1,b;for(r==null&&(s=i(b=l())),d=0;d<=m;++d)!(d=b;--S)c.point(j[S],E[S]);c.lineEnd(),c.areaEnd()}_&&(j[v]=+e(x,v,p),E[v]=+t(x,v,p),c.point(r?+r(x,v,p):j[v],n?+n(x,v,p):E[v]))}if(O)return c=null,O+""||null}function m(){return v$().defined(i).curve(l).context(s)}return d.x=function(p){return arguments.length?(e=typeof p=="function"?p:en(+p),r=null,d):e},d.x0=function(p){return arguments.length?(e=typeof p=="function"?p:en(+p),d):e},d.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:en(+p),d):r},d.y=function(p){return arguments.length?(t=typeof p=="function"?p:en(+p),n=null,d):t},d.y0=function(p){return arguments.length?(t=typeof p=="function"?p:en(+p),d):t},d.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:en(+p),d):n},d.lineX0=d.lineY0=function(){return m().x(e).y(t)},d.lineY1=function(){return m().x(e).y(n)},d.lineX1=function(){return m().x(r).y(t)},d.defined=function(p){return arguments.length?(i=typeof p=="function"?p:en(!!p),d):i},d.curve=function(p){return arguments.length?(l=p,s!=null&&(c=l(s)),d):l},d.context=function(p){return arguments.length?(p==null?s=c=null:c=l(s=p),d):s},d}class y${constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function lF(e){return new y$(e,!0)}function uF(e){return new y$(e,!1)}const lT={draw(e,t){const n=Ea(t/ty);e.moveTo(n,0),e.arc(0,0,n,0,vg)}},cF={draw(e,t){const n=Ea(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},g$=Ea(1/3),fF=g$*2,dF={draw(e,t){const n=Ea(t/fF),r=n*g$;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},hF={draw(e,t){const n=Ea(t),r=-n/2;e.rect(r,r,n,n)}},pF=.8908130915292852,b$=ey(ty/10)/ey(7*ty/10),mF=ey(vg/10)*b$,vF=-f$(vg/10)*b$,yF={draw(e,t){const n=Ea(t*pF),r=mF*n,i=vF*n;e.moveTo(0,-n),e.lineTo(r,i);for(let s=1;s<5;++s){const l=vg*s/5,c=f$(l),f=ey(l);e.lineTo(f*n,-c*n),e.lineTo(c*r-f*i,f*r+c*i)}e.closePath()}},_1=Ea(3),gF={draw(e,t){const n=-Ea(t/(_1*3));e.moveTo(0,n*2),e.lineTo(-_1*n,-n),e.lineTo(_1*n,-n),e.closePath()}},Yi=-.5,Xi=Ea(3)/2,rA=1/Ea(12),bF=(rA/2+1)*3,xF={draw(e,t){const n=Ea(t/bF),r=n/2,i=n*rA,s=r,l=n*rA+n,c=-s,f=l;e.moveTo(r,i),e.lineTo(s,l),e.lineTo(c,f),e.lineTo(Yi*r-Xi*i,Xi*r+Yi*i),e.lineTo(Yi*s-Xi*l,Xi*s+Yi*l),e.lineTo(Yi*c-Xi*f,Xi*c+Yi*f),e.lineTo(Yi*r+Xi*i,Yi*i-Xi*r),e.lineTo(Yi*s+Xi*l,Yi*l-Xi*s),e.lineTo(Yi*c+Xi*f,Yi*f-Xi*c),e.closePath()}};function SF(e,t){let n=null,r=oT(i);e=typeof e=="function"?e:en(e||lT),t=typeof t=="function"?t:en(t===void 0?64:+t);function i(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:en(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:en(+s),i):t},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function ny(){}function ry(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function x$(e){this._context=e}x$.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:ry(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:ry(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function wF(e){return new x$(e)}function S$(e){this._context=e}S$.prototype={areaStart:ny,areaEnd:ny,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:ry(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _F(e){return new S$(e)}function w$(e){this._context=e}w$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ry(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function AF(e){return new w$(e)}function _$(e){this._context=e}_$.prototype={areaStart:ny,areaEnd:ny,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 OF(e){return new _$(e)}function GC(e){return e<0?-1:1}function KC(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),c=(s*i+l*r)/(r+i);return(GC(s)+GC(l))*Math.min(Math.abs(s),Math.abs(l),.5*Math.abs(c))||0}function YC(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function A1(e,t,n){var r=e._x0,i=e._y0,s=e._x1,l=e._y1,c=(s-r)/3;e._context.bezierCurveTo(r+c,i+c*t,s-c,l-c*n,s,l)}function iy(e){this._context=e}iy.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:A1(this,this._t0,YC(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,A1(this,YC(this,n=KC(this,e,t)),n);break;default:A1(this,this._t0,n=KC(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function A$(e){this._context=new O$(e)}(A$.prototype=Object.create(iy.prototype)).point=function(e,t){iy.prototype.point.call(this,t,e)};function O$(e){this._context=e}O$.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function TF(e){return new iy(e)}function EF(e){return new A$(e)}function T$(e){this._context=e}T$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=XC(e),i=XC(t),s=0,l=1;l=0;--t)i[t]=(l[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function jF(e){return new gg(e,.5)}function PF(e){return new gg(e,0)}function CF(e){return new gg(e,1)}function nf(e,t){if((l=e.length)>1)for(var n=1,r,i,s=e[t[0]],l,c=s.length;n=0;)n[t]=t;return n}function DF(e,t){return e[t]}function RF(e){const t=[];return t.key=e,t}function NF(){var e=en([]),t=iA,n=nf,r=DF;function i(s){var l=Array.from(e.apply(this,arguments),RF),c,f=l.length,d=-1,m;for(const p of s)for(c=0,++d;c0){for(var n,r,i=0,s=e[0].length,l;i0){for(var n=0,r=e[t[0]],i,s=r.length;n0)||!((s=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,s,l;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VF(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var E$={symbolCircle:lT,symbolCross:cF,symbolDiamond:dF,symbolSquare:hF,symbolStar:yF,symbolTriangle:gF,symbolWye:xF},HF=Math.PI/180,FF=function(t){var n="symbol".concat(mg(t));return E$[n]||lT},GF=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*HF;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}},KF=function(t,n){E$["symbol".concat(mg(t))]=n},bg=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,s=i===void 0?64:i,l=t.sizeType,c=l===void 0?"area":l,f=UF(t,$F),d=QC(QC({},f),{},{type:r,size:s,sizeType:c}),m=function(){var x=FF(r),_=SF().type(x).size(GF(s,c,r));return _()},p=d.className,v=d.cx,b=d.cy,S=Je(d,!0);return v===+v&&b===+b&&s===+s?Q.createElement("path",aA({},S,{className:ct("recharts-symbols",p),transform:"translate(".concat(v,", ").concat(b,")"),d:m()})):null};bg.registerSymbol=KF;function rf(e){"@babel/helpers - typeof";return rf=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},rf(e)}function oA(){return oA=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?1:-1},Zl=function(t){return Su(t)&&t.indexOf("%")===t.length-1},Oe=function(t){return MH(t)&&!Hf(t)},jH=function(t){return Qe(t)},Jn=function(t){return Oe(t)||Su(t)},PH=0,ju=function(t){var n=++PH;return"".concat(t||"").concat(n)},wu=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Oe(t)&&!Su(t))return r;var s;if(Zl(t)){var l=t.indexOf("%");s=n*parseFloat(t.slice(0,l))/100}else s=+t;return Hf(s)&&(s=r),i&&s>n&&(s=n),s},Gs=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},CH=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function BH(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function W_(e){"@babel/helpers - typeof";return W_=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},W_(e)}var RC={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"},qo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},NC=null,p1=null,aT=function e(t){if(t===NC&&Array.isArray(p1))return p1;var n=[];return Z.Children.forEach(t,function(r){Qe(r)||(AH.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),p1=n,NC=t,n};function fi(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return qo(i)}):r=[qo(t)],aT(e).forEach(function(i){var s=aa(i,"type.displayName")||aa(i,"type.name");r.indexOf(s)!==-1&&n.push(i)}),n}function Mi(e,t){var n=fi(e,t);return n&&n[0]}var kC=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!Oe(r)||r<=0||!Oe(i)||i<=0)},qH=["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"],IH=function(t){return t&&t.type&&Su(t.type)&&qH.indexOf(t.type)>=0},u$=function(t){return t&&W_(t)==="object"&&"clipDot"in t},UH=function(t,n,r,i){var s,l=(s=h1==null?void 0:h1[i])!==null&&s!==void 0?s:[];return n.startsWith("data-")||!tt(t)&&(i&&l.includes(n)||kH.includes(n))||r&&iT.includes(n)},Je=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(Z.isValidElement(t)&&(i=t.props),!Vf(i))return null;var s={};return Object.keys(i).forEach(function(l){var c;UH((c=i)===null||c===void 0?void 0:c[l],l,n,r)&&(s[l]=i[l])}),s},Q_=function e(t,n){if(t===n)return!0;var r=Z.Children.count(t);if(r!==Z.Children.count(n))return!1;if(r===0)return!0;if(r===1)return LC(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KH(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function J_(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,s=e.className,l=e.style,c=e.title,f=e.desc,d=GH(e,FH),m=i||{width:n,height:r,x:0,y:0},p=ct("recharts-surface",s);return Q.createElement("svg",Z_({},Je(d,!0,"svg"),{className:p,width:n,height:r,style:l,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height)}),Q.createElement("title",null,c),Q.createElement("desc",null,f),t)}var YH=["children","className"];function eA(){return eA=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WH(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Mt=Q.forwardRef(function(e,t){var n=e.children,r=e.className,i=XH(e,YH),s=ct("recharts-layer",r);return Q.createElement("g",eA({className:s},Je(i,!0),{ref:t}),n)}),Io=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;ss?0:s+n),r=r>s?s:r,r<0&&(r+=s),s=n>r?0:r-n>>>0,n>>>=0;for(var l=Array(s);++i=s?n:e(n,r,i)}return v1=t,v1}var y1,qC;function c$(){if(qC)return y1;qC=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,s="\\ufe0e\\ufe0f",l="\\u200d",c=RegExp("["+l+e+i+s+"]");function f(d){return c.test(d)}return y1=f,y1}var g1,IC;function JH(){if(IC)return g1;IC=1;function e(t){return t.split("")}return g1=e,g1}var b1,UC;function eF(){if(UC)return b1;UC=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,s="\\ufe0e\\ufe0f",l="["+e+"]",c="["+i+"]",f="\\ud83c[\\udffb-\\udfff]",d="(?:"+c+"|"+f+")",m="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",v="[\\ud800-\\udbff][\\udc00-\\udfff]",b="\\u200d",S=d+"?",w="["+s+"]?",x="(?:"+b+"(?:"+[m,p,v].join("|")+")"+w+S+")*",_=w+S+x,O="(?:"+[m+c+"?",c,p,v,l].join("|")+")",j=RegExp(f+"(?="+f+")|"+O+_,"g");function E(A){return A.match(j)||[]}return b1=E,b1}var x1,VC;function tF(){if(VC)return x1;VC=1;var e=JH(),t=c$(),n=eF();function r(i){return t(i)?n(i):e(i)}return x1=r,x1}var S1,HC;function nF(){if(HC)return S1;HC=1;var e=ZH(),t=c$(),n=tF(),r=a$();function i(s){return function(l){l=r(l);var c=t(l)?n(l):void 0,f=c?c[0]:l.charAt(0),d=c?e(c,1).join(""):l.slice(1);return f[s]()+d}}return S1=i,S1}var w1,FC;function rF(){if(FC)return w1;FC=1;var e=nF(),t=e("toUpperCase");return w1=t,w1}var iF=rF();const mg=Ft(iF);function en(e){return function(){return e}}const f$=Math.cos,ey=Math.sin,Ea=Math.sqrt,ty=Math.PI,vg=2*ty,tA=Math.PI,nA=2*tA,Hl=1e-6,aF=nA-Hl;function d$(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return d$;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;iHl)if(!(Math.abs(p*f-d*m)>Hl)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let b=r-l,S=i-c,w=f*f+d*d,x=b*b+S*S,_=Math.sqrt(w),O=Math.sqrt(v),j=s*Math.tan((tA-Math.acos((w+v-x)/(2*_*O)))/2),E=j/O,A=j/_;Math.abs(E-1)>Hl&&this._append`L${t+E*m},${n+E*p}`,this._append`A${s},${s},0,0,${+(p*b>m*S)},${this._x1=t+A*f},${this._y1=n+A*d}`}}arc(t,n,r,i,s,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),f=r*Math.sin(i),d=t+c,m=n+f,p=1^l,v=l?i-s:s-i;this._x1===null?this._append`M${d},${m}`:(Math.abs(this._x1-d)>Hl||Math.abs(this._y1-m)>Hl)&&this._append`L${d},${m}`,r&&(v<0&&(v=v%nA+nA),v>aF?this._append`A${r},${r},0,1,${p},${t-c},${n-f}A${r},${r},0,1,${p},${this._x1=d},${this._y1=m}`:v>Hl&&this._append`A${r},${r},0,${+(v>=tA)},${p},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function oT(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new sF(t)}function sT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function h$(e){this._context=e}h$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function yg(e){return new h$(e)}function p$(e){return e[0]}function m$(e){return e[1]}function v$(e,t){var n=en(!0),r=null,i=yg,s=null,l=oT(c);e=typeof e=="function"?e:e===void 0?p$:en(e),t=typeof t=="function"?t:t===void 0?m$:en(t);function c(f){var d,m=(f=sT(f)).length,p,v=!1,b;for(r==null&&(s=i(b=l())),d=0;d<=m;++d)!(d=b;--S)c.point(j[S],E[S]);c.lineEnd(),c.areaEnd()}_&&(j[v]=+e(x,v,p),E[v]=+t(x,v,p),c.point(r?+r(x,v,p):j[v],n?+n(x,v,p):E[v]))}if(O)return c=null,O+""||null}function m(){return v$().defined(i).curve(l).context(s)}return d.x=function(p){return arguments.length?(e=typeof p=="function"?p:en(+p),r=null,d):e},d.x0=function(p){return arguments.length?(e=typeof p=="function"?p:en(+p),d):e},d.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:en(+p),d):r},d.y=function(p){return arguments.length?(t=typeof p=="function"?p:en(+p),n=null,d):t},d.y0=function(p){return arguments.length?(t=typeof p=="function"?p:en(+p),d):t},d.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:en(+p),d):n},d.lineX0=d.lineY0=function(){return m().x(e).y(t)},d.lineY1=function(){return m().x(e).y(n)},d.lineX1=function(){return m().x(r).y(t)},d.defined=function(p){return arguments.length?(i=typeof p=="function"?p:en(!!p),d):i},d.curve=function(p){return arguments.length?(l=p,s!=null&&(c=l(s)),d):l},d.context=function(p){return arguments.length?(p==null?s=c=null:c=l(s=p),d):s},d}class y${constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function lF(e){return new y$(e,!0)}function uF(e){return new y$(e,!1)}const lT={draw(e,t){const n=Ea(t/ty);e.moveTo(n,0),e.arc(0,0,n,0,vg)}},cF={draw(e,t){const n=Ea(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},g$=Ea(1/3),fF=g$*2,dF={draw(e,t){const n=Ea(t/fF),r=n*g$;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},hF={draw(e,t){const n=Ea(t),r=-n/2;e.rect(r,r,n,n)}},pF=.8908130915292852,b$=ey(ty/10)/ey(7*ty/10),mF=ey(vg/10)*b$,vF=-f$(vg/10)*b$,yF={draw(e,t){const n=Ea(t*pF),r=mF*n,i=vF*n;e.moveTo(0,-n),e.lineTo(r,i);for(let s=1;s<5;++s){const l=vg*s/5,c=f$(l),f=ey(l);e.lineTo(f*n,-c*n),e.lineTo(c*r-f*i,f*r+c*i)}e.closePath()}},_1=Ea(3),gF={draw(e,t){const n=-Ea(t/(_1*3));e.moveTo(0,n*2),e.lineTo(-_1*n,-n),e.lineTo(_1*n,-n),e.closePath()}},Yi=-.5,Xi=Ea(3)/2,rA=1/Ea(12),bF=(rA/2+1)*3,xF={draw(e,t){const n=Ea(t/bF),r=n/2,i=n*rA,s=r,l=n*rA+n,c=-s,f=l;e.moveTo(r,i),e.lineTo(s,l),e.lineTo(c,f),e.lineTo(Yi*r-Xi*i,Xi*r+Yi*i),e.lineTo(Yi*s-Xi*l,Xi*s+Yi*l),e.lineTo(Yi*c-Xi*f,Xi*c+Yi*f),e.lineTo(Yi*r+Xi*i,Yi*i-Xi*r),e.lineTo(Yi*s+Xi*l,Yi*l-Xi*s),e.lineTo(Yi*c+Xi*f,Yi*f-Xi*c),e.closePath()}};function SF(e,t){let n=null,r=oT(i);e=typeof e=="function"?e:en(e||lT),t=typeof t=="function"?t:en(t===void 0?64:+t);function i(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:en(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:en(+s),i):t},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function ny(){}function ry(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function x$(e){this._context=e}x$.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:ry(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:ry(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function wF(e){return new x$(e)}function S$(e){this._context=e}S$.prototype={areaStart:ny,areaEnd:ny,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:ry(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _F(e){return new S$(e)}function w$(e){this._context=e}w$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ry(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function AF(e){return new w$(e)}function _$(e){this._context=e}_$.prototype={areaStart:ny,areaEnd:ny,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 OF(e){return new _$(e)}function GC(e){return e<0?-1:1}function KC(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),c=(s*i+l*r)/(r+i);return(GC(s)+GC(l))*Math.min(Math.abs(s),Math.abs(l),.5*Math.abs(c))||0}function YC(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function A1(e,t,n){var r=e._x0,i=e._y0,s=e._x1,l=e._y1,c=(s-r)/3;e._context.bezierCurveTo(r+c,i+c*t,s-c,l-c*n,s,l)}function iy(e){this._context=e}iy.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:A1(this,this._t0,YC(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,A1(this,YC(this,n=KC(this,e,t)),n);break;default:A1(this,this._t0,n=KC(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function A$(e){this._context=new O$(e)}(A$.prototype=Object.create(iy.prototype)).point=function(e,t){iy.prototype.point.call(this,t,e)};function O$(e){this._context=e}O$.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function TF(e){return new iy(e)}function EF(e){return new A$(e)}function T$(e){this._context=e}T$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=XC(e),i=XC(t),s=0,l=1;l=0;--t)i[t]=(l[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function jF(e){return new gg(e,.5)}function PF(e){return new gg(e,0)}function CF(e){return new gg(e,1)}function rf(e,t){if((l=e.length)>1)for(var n=1,r,i,s=e[t[0]],l,c=s.length;n=0;)n[t]=t;return n}function DF(e,t){return e[t]}function RF(e){const t=[];return t.key=e,t}function NF(){var e=en([]),t=iA,n=rf,r=DF;function i(s){var l=Array.from(e.apply(this,arguments),RF),c,f=l.length,d=-1,m;for(const p of s)for(c=0,++d;c0){for(var n,r,i=0,s=e[0].length,l;i0){for(var n=0,r=e[t[0]],i,s=r.length;n0)||!((s=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,s,l;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VF(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var E$={symbolCircle:lT,symbolCross:cF,symbolDiamond:dF,symbolSquare:hF,symbolStar:yF,symbolTriangle:gF,symbolWye:xF},HF=Math.PI/180,FF=function(t){var n="symbol".concat(mg(t));return E$[n]||lT},GF=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*HF;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}},KF=function(t,n){E$["symbol".concat(mg(t))]=n},bg=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,s=i===void 0?64:i,l=t.sizeType,c=l===void 0?"area":l,f=UF(t,$F),d=QC(QC({},f),{},{type:r,size:s,sizeType:c}),m=function(){var x=FF(r),_=SF().type(x).size(GF(s,c,r));return _()},p=d.className,v=d.cx,b=d.cy,S=Je(d,!0);return v===+v&&b===+b&&s===+s?Q.createElement("path",aA({},S,{className:ct("recharts-symbols",p),transform:"translate(".concat(v,", ").concat(b,")"),d:m()})):null};bg.registerSymbol=KF;function af(e){"@babel/helpers - typeof";return af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},af(e)}function oA(){return oA=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var O=b.inactive?d:b.color;return Q.createElement("li",oA({className:x,style:p,key:"legend-item-".concat(S)},Hh(r.props,b,S)),Q.createElement(J_,{width:l,height:l,viewBox:m,style:v},r.renderIcon(b)),Q.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},w?w(_,b,S):_))})}},{key:"render",value:function(){var r=this.props,i=r.payload,s=r.layout,l=r.align;if(!i||!i.length)return null;var c={padding:0,margin:0,textAlign:s==="horizontal"?l:"left"};return Q.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(Z.PureComponent);Gh(uT,"displayName","Legend");Gh(uT,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var O1,JC;function r9(){if(JC)return O1;JC=1;var e=dg();function t(){this.__data__=new e,this.size=0}return O1=t,O1}var T1,eD;function i9(){if(eD)return T1;eD=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return T1=e,T1}var E1,tD;function a9(){if(tD)return E1;tD=1;function e(t){return this.__data__.get(t)}return E1=e,E1}var M1,nD;function o9(){if(nD)return M1;nD=1;function e(t){return this.__data__.has(t)}return M1=e,M1}var j1,rD;function s9(){if(rD)return j1;rD=1;var e=dg(),t=eT(),n=tT(),r=200;function i(s,l){var c=this.__data__;if(c instanceof e){var f=c.__data__;if(!t||f.lengthb))return!1;var w=p.get(l),x=p.get(c);if(w&&x)return w==c&&x==l;var _=-1,O=!0,j=f&i?new e:void 0;for(p.set(l,c),p.set(c,l);++_-1&&r%1==0&&r-1&&n%1==0&&n<=e}return Q1=t,Q1}var Z1,ED;function x9(){if(ED)return Z1;ED=1;var e=Jo(),t=hT(),n=es(),r="[object Arguments]",i="[object Array]",s="[object Boolean]",l="[object Date]",c="[object Error]",f="[object Function]",d="[object Map]",m="[object Number]",p="[object Object]",v="[object RegExp]",b="[object Set]",S="[object String]",w="[object WeakMap]",x="[object ArrayBuffer]",_="[object DataView]",O="[object Float32Array]",j="[object Float64Array]",E="[object Int8Array]",A="[object Int16Array]",M="[object Int32Array]",R="[object Uint8Array]",k="[object Uint8ClampedArray]",z="[object Uint16Array]",G="[object Uint32Array]",$={};$[O]=$[j]=$[E]=$[A]=$[M]=$[R]=$[k]=$[z]=$[G]=!0,$[r]=$[i]=$[x]=$[s]=$[_]=$[l]=$[c]=$[f]=$[d]=$[m]=$[p]=$[v]=$[b]=$[S]=$[w]=!1;function B(X){return n(X)&&t(X.length)&&!!$[e(X)]}return Z1=B,Z1}var J1,MD;function z$(){if(MD)return J1;MD=1;function e(t){return function(n){return t(n)}}return J1=e,J1}var xh={exports:{}};xh.exports;var jD;function S9(){return jD||(jD=1,(function(e,t){var n=n$(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,l=s&&n.process,c=(function(){try{var f=i&&i.require&&i.require("util").types;return f||l&&l.binding&&l.binding("util")}catch{}})();e.exports=c})(xh,xh.exports)),xh.exports}var eS,PD;function $$(){if(PD)return eS;PD=1;var e=x9(),t=z$(),n=S9(),r=n&&n.isTypedArray,i=r?t(r):e;return eS=i,eS}var tS,CD;function w9(){if(CD)return tS;CD=1;var e=y9(),t=fT(),n=hi(),r=L$(),i=dT(),s=$$(),l=Object.prototype,c=l.hasOwnProperty;function f(d,m){var p=n(d),v=!p&&t(d),b=!p&&!v&&r(d),S=!p&&!v&&!b&&s(d),w=p||v||b||S,x=w?e(d.length,String):[],_=x.length;for(var O in d)(m||c.call(d,O))&&!(w&&(O=="length"||b&&(O=="offset"||O=="parent")||S&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||i(O,_)))&&x.push(O);return x}return tS=f,tS}var nS,DD;function _9(){if(DD)return nS;DD=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return nS=t,nS}var rS,RD;function B$(){if(RD)return rS;RD=1;function e(t,n){return function(r){return t(n(r))}}return rS=e,rS}var iS,ND;function A9(){if(ND)return iS;ND=1;var e=B$(),t=e(Object.keys,Object);return iS=t,iS}var aS,kD;function O9(){if(kD)return aS;kD=1;var e=_9(),t=A9(),n=Object.prototype,r=n.hasOwnProperty;function i(s){if(!e(s))return t(s);var l=[];for(var c in Object(s))r.call(s,c)&&c!="constructor"&&l.push(c);return l}return aS=i,aS}var oS,LD;function zp(){if(LD)return oS;LD=1;var e=ZO(),t=hT();function n(r){return r!=null&&t(r.length)&&!e(r)}return oS=n,oS}var sS,zD;function xg(){if(zD)return sS;zD=1;var e=w9(),t=O9(),n=zp();function r(i){return n(i)?e(i):t(i)}return sS=r,sS}var lS,$D;function T9(){if($D)return lS;$D=1;var e=h9(),t=v9(),n=xg();function r(i){return e(i,n,t)}return lS=r,lS}var uS,BD;function E9(){if(BD)return uS;BD=1;var e=T9(),t=1,n=Object.prototype,r=n.hasOwnProperty;function i(s,l,c,f,d,m){var p=c&t,v=e(s),b=v.length,S=e(l),w=S.length;if(b!=w&&!p)return!1;for(var x=b;x--;){var _=v[x];if(!(p?_ in l:r.call(l,_)))return!1}var O=m.get(s),j=m.get(l);if(O&&j)return O==l&&j==s;var E=!0;m.set(s,l),m.set(l,s);for(var A=p;++x-1}return kS=t,kS}var LS,dR;function K9(){if(dR)return LS;dR=1;function e(t,n,r){for(var i=-1,s=t==null?0:t.length;++i=l){var _=d?null:i(f);if(_)return s(_);S=!1,v=r,x=new e}else x=d?[]:w;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function l7(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function u7(e){return e.value}function c7(e,t){if(Q.isValidElement(e))return Q.cloneElement(e,t);if(typeof e=="function")return Q.createElement(e,t);t.ref;var n=s7(t,J9);return Q.createElement(uT,n)}var xR=1,hu=(function(e){function t(){var n;e7(this,t);for(var r=arguments.length,i=new Array(r),s=0;sxR||Math.abs(i.height-this.lastBoundingBox.height)>xR)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Co({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,s=i.layout,l=i.align,c=i.verticalAlign,f=i.margin,d=i.chartWidth,m=i.chartHeight,p,v;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(l==="center"&&s==="vertical"){var b=this.getBBoxSnapshot();p={left:((d||0)-b.width)/2}}else p=l==="right"?{right:f&&f.right||0}:{left:f&&f.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(c==="middle"){var S=this.getBBoxSnapshot();v={top:((m||0)-S.height)/2}}else v=c==="bottom"?{bottom:f&&f.bottom||0}:{top:f&&f.top||0};return Co(Co({},p),v)}},{key:"render",value:function(){var r=this,i=this.props,s=i.content,l=i.width,c=i.height,f=i.wrapperStyle,d=i.payloadUniqBy,m=i.payload,p=Co(Co({position:"absolute",width:l||"auto",height:c||"auto"},this.getDefaultPosition(f)),f);return Q.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(b){r.wrapperNode=b}},c7(s,Co(Co({},this.props),{},{payload:H$(m,d,u7)})))}}],[{key:"getWithHeight",value:function(r,i){var s=Co(Co({},this.defaultProps),r.props),l=s.layout;return l==="vertical"&&Oe(r.props.height)?{height:r.props.height}:l==="horizontal"?{width:r.props.width||i}:null}}])})(Z.PureComponent);Sg(hu,"displayName","Legend");Sg(hu,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var IS,SR;function f7(){if(SR)return IS;SR=1;var e=Lp(),t=fT(),n=hi(),r=e?e.isConcatSpreadable:void 0;function i(s){return n(s)||t(s)||!!(r&&s&&s[r])}return IS=i,IS}var US,wR;function K$(){if(wR)return US;wR=1;var e=k$(),t=f7();function n(r,i,s,l,c){var f=-1,d=r.length;for(s||(s=t),c||(c=[]);++f0&&s(m)?i>1?n(m,i-1,s,l,c):e(c,m):l||(c[c.length]=m)}return c}return US=n,US}var VS,_R;function d7(){if(_R)return VS;_R=1;function e(t){return function(n,r,i){for(var s=-1,l=Object(n),c=i(n),f=c.length;f--;){var d=c[t?f:++s];if(r(l[d],d,l)===!1)break}return n}}return VS=e,VS}var HS,AR;function h7(){if(AR)return HS;AR=1;var e=d7(),t=e();return HS=t,HS}var FS,OR;function Y$(){if(OR)return FS;OR=1;var e=h7(),t=xg();function n(r,i){return r&&e(r,i,t)}return FS=n,FS}var GS,TR;function p7(){if(TR)return GS;TR=1;var e=zp();function t(n,r){return function(i,s){if(i==null)return i;if(!e(i))return n(i,s);for(var l=i.length,c=r?l:-1,f=Object(i);(r?c--:++cr||c&&f&&m&&!d&&!p||s&&f&&m||!i&&m||!l)return 1;if(!s&&!c&&!p&&n=d)return m;var p=i[s];return m*(p=="desc"?-1:1)}}return n.index-r.index}return QS=t,QS}var ZS,DR;function g7(){if(DR)return ZS;DR=1;var e=nT(),t=rT(),n=cl(),r=X$(),i=m7(),s=z$(),l=y7(),c=Hf(),f=hi();function d(m,p,v){p.length?p=e(p,function(w){return f(w)?function(x){return t(x,w.length===1?w[0]:w)}:w}):p=[c];var b=-1;p=e(p,s(n));var S=r(m,function(w,x,_){var O=e(p,function(j){return j(w)});return{criteria:O,index:++b,value:w}});return i(S,function(w,x){return l(w,x,v)})}return ZS=d,ZS}var JS,RR;function b7(){if(RR)return JS;RR=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return JS=e,JS}var ew,NR;function x7(){if(NR)return ew;NR=1;var e=b7(),t=Math.max;function n(r,i,s){return i=t(i===void 0?r.length-1:i,0),function(){for(var l=arguments,c=-1,f=t(l.length-i,0),d=Array(f);++c0){if(++s>=e)return arguments[0]}else s=0;return i.apply(void 0,arguments)}}return iw=r,iw}var aw,BR;function A7(){if(BR)return aw;BR=1;var e=w7(),t=_7(),n=t(e);return aw=n,aw}var ow,qR;function O7(){if(qR)return ow;qR=1;var e=Hf(),t=x7(),n=A7();function r(i,s){return n(t(i,s,e),i+"")}return ow=r,ow}var sw,IR;function wg(){if(IR)return sw;IR=1;var e=JO(),t=zp(),n=dT(),r=ul();function i(s,l,c){if(!r(c))return!1;var f=typeof l;return(f=="number"?t(c)&&n(l,c.length):f=="string"&&l in c)?e(c[l],s):!1}return sw=i,sw}var lw,UR;function T7(){if(UR)return lw;UR=1;var e=K$(),t=g7(),n=O7(),r=wg(),i=n(function(s,l){if(s==null)return[];var c=l.length;return c>1&&r(s,l[0],l[1])?l=[]:c>2&&r(l[0],l[1],l[2])&&(l=[l[0]]),t(s,e(l,1),[])});return lw=i,lw}var E7=T7();const vT=Ft(E7);function Kh(e){"@babel/helpers - typeof";return Kh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kh(e)}function uA(){return uA=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat(ah,"-left"),Oe(n)&&t&&Oe(t.x)&&n=t.y),"".concat(ah,"-top"),Oe(r)&&t&&Oe(t.y)&&rw?Math.max(m,f[r]):Math.max(p,f[r])}function U7(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function V7(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,s=e.reverseDirection,l=e.tooltipBox,c=e.useTranslate3d,f=e.viewBox,d,m,p;return l.height>0&&l.width>0&&n?(m=FR({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:l.width,viewBox:f,viewBoxDimension:f.width}),p=FR({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:l.height,viewBox:f,viewBoxDimension:f.height}),d=U7({translateX:m,translateY:p,useTranslate3d:c})):d=q7,{cssProperties:d,cssClasses:I7({translateX:m,translateY:p,coordinate:n})}}function of(e){"@babel/helpers - typeof";return of=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},of(e)}function GR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function KR(e){for(var t=1;tYR||Math.abs(r.height-this.state.lastBoundingBox.height)>YR)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.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 r=this,i=this.props,s=i.active,l=i.allowEscapeViewBox,c=i.animationDuration,f=i.animationEasing,d=i.children,m=i.coordinate,p=i.hasPayload,v=i.isAnimationActive,b=i.offset,S=i.position,w=i.reverseDirection,x=i.useTranslate3d,_=i.viewBox,O=i.wrapperStyle,j=V7({allowEscapeViewBox:l,coordinate:m,offsetTopLeft:b,position:S,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:_}),E=j.cssClasses,A=j.cssProperties,M=KR(KR({transition:v&&s?"transform ".concat(c,"ms ").concat(f):void 0},A),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&p?"visible":"hidden",position:"absolute",top:0,left:0},O);return Q.createElement("div",{tabIndex:-1,className:E,style:M,ref:function(k){r.wrapperNode=k}},d)}}])})(Z.PureComponent),J7=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},fl={isSsr:J7()};function sf(e){"@babel/helpers - typeof";return sf=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},sf(e)}function XR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function WR(e){for(var t=1;t0;return Q.createElement(Z7,{allowEscapeViewBox:l,animationDuration:c,animationEasing:f,isAnimationActive:v,active:s,coordinate:m,hasPayload:M,offset:b,position:x,reverseDirection:_,useTranslate3d:O,viewBox:j,wrapperStyle:E},uG(d,WR(WR({},this.props),{},{payload:A})))}}])})(Z.PureComponent);yT(ui,"displayName","Tooltip");yT(ui,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!fl.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 cw,QR;function cG(){if(QR)return cw;QR=1;var e=no(),t=function(){return e.Date.now()};return cw=t,cw}var fw,ZR;function fG(){if(ZR)return fw;ZR=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return fw=t,fw}var dw,JR;function dG(){if(JR)return dw;JR=1;var e=fG(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return dw=n,dw}var hw,eN;function tB(){if(eN)return hw;eN=1;var e=dG(),t=ul(),n=If(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;function f(d){if(typeof d=="number")return d;if(n(d))return r;if(t(d)){var m=typeof d.valueOf=="function"?d.valueOf():d;d=t(m)?m+"":m}if(typeof d!="string")return d===0?d:+d;d=e(d);var p=s.test(d);return p||l.test(d)?c(d.slice(2),p?2:8):i.test(d)?r:+d}return hw=f,hw}var pw,tN;function hG(){if(tN)return pw;tN=1;var e=ul(),t=cG(),n=tB(),r="Expected a function",i=Math.max,s=Math.min;function l(c,f,d){var m,p,v,b,S,w,x=0,_=!1,O=!1,j=!0;if(typeof c!="function")throw new TypeError(r);f=n(f)||0,e(d)&&(_=!!d.leading,O="maxWait"in d,v=O?i(n(d.maxWait)||0,f):v,j="trailing"in d?!!d.trailing:j);function E(X){var ee=m,J=p;return m=p=void 0,x=X,b=c.apply(J,ee),b}function A(X){return x=X,S=setTimeout(k,f),_?E(X):b}function M(X){var ee=X-w,J=X-x,I=f-ee;return O?s(I,v-J):I}function R(X){var ee=X-w,J=X-x;return w===void 0||ee>=f||ee<0||O&&J>=v}function k(){var X=t();if(R(X))return z(X);S=setTimeout(k,M(X))}function z(X){return S=void 0,j&&m?E(X):(m=p=void 0,b)}function G(){S!==void 0&&clearTimeout(S),x=0,m=w=p=S=void 0}function $(){return S===void 0?b:z(t())}function B(){var X=t(),ee=R(X);if(m=arguments,p=this,w=X,ee){if(S===void 0)return A(w);if(O)return clearTimeout(S),S=setTimeout(k,f),E(w)}return S===void 0&&(S=setTimeout(k,f)),b}return B.cancel=G,B.flush=$,B}return pw=l,pw}var mw,nN;function pG(){if(nN)return mw;nN=1;var e=hG(),t=ul(),n="Expected a function";function r(i,s,l){var c=!0,f=!0;if(typeof i!="function")throw new TypeError(n);return t(l)&&(c="leading"in l?!!l.leading:c,f="trailing"in l?!!l.trailing:f),e(i,s,{leading:c,maxWait:s,trailing:f})}return mw=r,mw}var mG=pG();const nB=Ft(mG);function Xh(e){"@babel/helpers - typeof";return Xh=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},Xh(e)}function rN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sv(e){for(var t=1;t`);var O=b.inactive?d:b.color;return Q.createElement("li",oA({className:x,style:p,key:"legend-item-".concat(S)},Hh(r.props,b,S)),Q.createElement(J_,{width:l,height:l,viewBox:m,style:v},r.renderIcon(b)),Q.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},w?w(_,b,S):_))})}},{key:"render",value:function(){var r=this.props,i=r.payload,s=r.layout,l=r.align;if(!i||!i.length)return null;var c={padding:0,margin:0,textAlign:s==="horizontal"?l:"left"};return Q.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(Z.PureComponent);Gh(uT,"displayName","Legend");Gh(uT,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var O1,JC;function r9(){if(JC)return O1;JC=1;var e=dg();function t(){this.__data__=new e,this.size=0}return O1=t,O1}var T1,eD;function i9(){if(eD)return T1;eD=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return T1=e,T1}var E1,tD;function a9(){if(tD)return E1;tD=1;function e(t){return this.__data__.get(t)}return E1=e,E1}var M1,nD;function o9(){if(nD)return M1;nD=1;function e(t){return this.__data__.has(t)}return M1=e,M1}var j1,rD;function s9(){if(rD)return j1;rD=1;var e=dg(),t=eT(),n=tT(),r=200;function i(s,l){var c=this.__data__;if(c instanceof e){var f=c.__data__;if(!t||f.lengthb))return!1;var w=p.get(l),x=p.get(c);if(w&&x)return w==c&&x==l;var _=-1,O=!0,j=f&i?new e:void 0;for(p.set(l,c),p.set(c,l);++_-1&&r%1==0&&r-1&&n%1==0&&n<=e}return Q1=t,Q1}var Z1,ED;function x9(){if(ED)return Z1;ED=1;var e=Jo(),t=hT(),n=es(),r="[object Arguments]",i="[object Array]",s="[object Boolean]",l="[object Date]",c="[object Error]",f="[object Function]",d="[object Map]",m="[object Number]",p="[object Object]",v="[object RegExp]",b="[object Set]",S="[object String]",w="[object WeakMap]",x="[object ArrayBuffer]",_="[object DataView]",O="[object Float32Array]",j="[object Float64Array]",E="[object Int8Array]",A="[object Int16Array]",M="[object Int32Array]",R="[object Uint8Array]",k="[object Uint8ClampedArray]",z="[object Uint16Array]",G="[object Uint32Array]",$={};$[O]=$[j]=$[E]=$[A]=$[M]=$[R]=$[k]=$[z]=$[G]=!0,$[r]=$[i]=$[x]=$[s]=$[_]=$[l]=$[c]=$[f]=$[d]=$[m]=$[p]=$[v]=$[b]=$[S]=$[w]=!1;function B(X){return n(X)&&t(X.length)&&!!$[e(X)]}return Z1=B,Z1}var J1,MD;function z$(){if(MD)return J1;MD=1;function e(t){return function(n){return t(n)}}return J1=e,J1}var xh={exports:{}};xh.exports;var jD;function S9(){return jD||(jD=1,(function(e,t){var n=n$(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,l=s&&n.process,c=(function(){try{var f=i&&i.require&&i.require("util").types;return f||l&&l.binding&&l.binding("util")}catch{}})();e.exports=c})(xh,xh.exports)),xh.exports}var eS,PD;function $$(){if(PD)return eS;PD=1;var e=x9(),t=z$(),n=S9(),r=n&&n.isTypedArray,i=r?t(r):e;return eS=i,eS}var tS,CD;function w9(){if(CD)return tS;CD=1;var e=y9(),t=fT(),n=hi(),r=L$(),i=dT(),s=$$(),l=Object.prototype,c=l.hasOwnProperty;function f(d,m){var p=n(d),v=!p&&t(d),b=!p&&!v&&r(d),S=!p&&!v&&!b&&s(d),w=p||v||b||S,x=w?e(d.length,String):[],_=x.length;for(var O in d)(m||c.call(d,O))&&!(w&&(O=="length"||b&&(O=="offset"||O=="parent")||S&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||i(O,_)))&&x.push(O);return x}return tS=f,tS}var nS,DD;function _9(){if(DD)return nS;DD=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return nS=t,nS}var rS,RD;function B$(){if(RD)return rS;RD=1;function e(t,n){return function(r){return t(n(r))}}return rS=e,rS}var iS,ND;function A9(){if(ND)return iS;ND=1;var e=B$(),t=e(Object.keys,Object);return iS=t,iS}var aS,kD;function O9(){if(kD)return aS;kD=1;var e=_9(),t=A9(),n=Object.prototype,r=n.hasOwnProperty;function i(s){if(!e(s))return t(s);var l=[];for(var c in Object(s))r.call(s,c)&&c!="constructor"&&l.push(c);return l}return aS=i,aS}var oS,LD;function zp(){if(LD)return oS;LD=1;var e=ZO(),t=hT();function n(r){return r!=null&&t(r.length)&&!e(r)}return oS=n,oS}var sS,zD;function xg(){if(zD)return sS;zD=1;var e=w9(),t=O9(),n=zp();function r(i){return n(i)?e(i):t(i)}return sS=r,sS}var lS,$D;function T9(){if($D)return lS;$D=1;var e=h9(),t=v9(),n=xg();function r(i){return e(i,n,t)}return lS=r,lS}var uS,BD;function E9(){if(BD)return uS;BD=1;var e=T9(),t=1,n=Object.prototype,r=n.hasOwnProperty;function i(s,l,c,f,d,m){var p=c&t,v=e(s),b=v.length,S=e(l),w=S.length;if(b!=w&&!p)return!1;for(var x=b;x--;){var _=v[x];if(!(p?_ in l:r.call(l,_)))return!1}var O=m.get(s),j=m.get(l);if(O&&j)return O==l&&j==s;var E=!0;m.set(s,l),m.set(l,s);for(var A=p;++x-1}return kS=t,kS}var LS,dR;function K9(){if(dR)return LS;dR=1;function e(t,n,r){for(var i=-1,s=t==null?0:t.length;++i=l){var _=d?null:i(f);if(_)return s(_);S=!1,v=r,x=new e}else x=d?[]:w;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function l7(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function u7(e){return e.value}function c7(e,t){if(Q.isValidElement(e))return Q.cloneElement(e,t);if(typeof e=="function")return Q.createElement(e,t);t.ref;var n=s7(t,J9);return Q.createElement(uT,n)}var xR=1,hu=(function(e){function t(){var n;e7(this,t);for(var r=arguments.length,i=new Array(r),s=0;sxR||Math.abs(i.height-this.lastBoundingBox.height)>xR)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Co({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,s=i.layout,l=i.align,c=i.verticalAlign,f=i.margin,d=i.chartWidth,m=i.chartHeight,p,v;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(l==="center"&&s==="vertical"){var b=this.getBBoxSnapshot();p={left:((d||0)-b.width)/2}}else p=l==="right"?{right:f&&f.right||0}:{left:f&&f.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(c==="middle"){var S=this.getBBoxSnapshot();v={top:((m||0)-S.height)/2}}else v=c==="bottom"?{bottom:f&&f.bottom||0}:{top:f&&f.top||0};return Co(Co({},p),v)}},{key:"render",value:function(){var r=this,i=this.props,s=i.content,l=i.width,c=i.height,f=i.wrapperStyle,d=i.payloadUniqBy,m=i.payload,p=Co(Co({position:"absolute",width:l||"auto",height:c||"auto"},this.getDefaultPosition(f)),f);return Q.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(b){r.wrapperNode=b}},c7(s,Co(Co({},this.props),{},{payload:H$(m,d,u7)})))}}],[{key:"getWithHeight",value:function(r,i){var s=Co(Co({},this.defaultProps),r.props),l=s.layout;return l==="vertical"&&Oe(r.props.height)?{height:r.props.height}:l==="horizontal"?{width:r.props.width||i}:null}}])})(Z.PureComponent);Sg(hu,"displayName","Legend");Sg(hu,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var IS,SR;function f7(){if(SR)return IS;SR=1;var e=Lp(),t=fT(),n=hi(),r=e?e.isConcatSpreadable:void 0;function i(s){return n(s)||t(s)||!!(r&&s&&s[r])}return IS=i,IS}var US,wR;function K$(){if(wR)return US;wR=1;var e=k$(),t=f7();function n(r,i,s,l,c){var f=-1,d=r.length;for(s||(s=t),c||(c=[]);++f0&&s(m)?i>1?n(m,i-1,s,l,c):e(c,m):l||(c[c.length]=m)}return c}return US=n,US}var VS,_R;function d7(){if(_R)return VS;_R=1;function e(t){return function(n,r,i){for(var s=-1,l=Object(n),c=i(n),f=c.length;f--;){var d=c[t?f:++s];if(r(l[d],d,l)===!1)break}return n}}return VS=e,VS}var HS,AR;function h7(){if(AR)return HS;AR=1;var e=d7(),t=e();return HS=t,HS}var FS,OR;function Y$(){if(OR)return FS;OR=1;var e=h7(),t=xg();function n(r,i){return r&&e(r,i,t)}return FS=n,FS}var GS,TR;function p7(){if(TR)return GS;TR=1;var e=zp();function t(n,r){return function(i,s){if(i==null)return i;if(!e(i))return n(i,s);for(var l=i.length,c=r?l:-1,f=Object(i);(r?c--:++cr||c&&f&&m&&!d&&!p||s&&f&&m||!i&&m||!l)return 1;if(!s&&!c&&!p&&n=d)return m;var p=i[s];return m*(p=="desc"?-1:1)}}return n.index-r.index}return QS=t,QS}var ZS,DR;function g7(){if(DR)return ZS;DR=1;var e=nT(),t=rT(),n=cl(),r=X$(),i=m7(),s=z$(),l=y7(),c=Ff(),f=hi();function d(m,p,v){p.length?p=e(p,function(w){return f(w)?function(x){return t(x,w.length===1?w[0]:w)}:w}):p=[c];var b=-1;p=e(p,s(n));var S=r(m,function(w,x,_){var O=e(p,function(j){return j(w)});return{criteria:O,index:++b,value:w}});return i(S,function(w,x){return l(w,x,v)})}return ZS=d,ZS}var JS,RR;function b7(){if(RR)return JS;RR=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return JS=e,JS}var ew,NR;function x7(){if(NR)return ew;NR=1;var e=b7(),t=Math.max;function n(r,i,s){return i=t(i===void 0?r.length-1:i,0),function(){for(var l=arguments,c=-1,f=t(l.length-i,0),d=Array(f);++c0){if(++s>=e)return arguments[0]}else s=0;return i.apply(void 0,arguments)}}return iw=r,iw}var aw,BR;function A7(){if(BR)return aw;BR=1;var e=w7(),t=_7(),n=t(e);return aw=n,aw}var ow,qR;function O7(){if(qR)return ow;qR=1;var e=Ff(),t=x7(),n=A7();function r(i,s){return n(t(i,s,e),i+"")}return ow=r,ow}var sw,IR;function wg(){if(IR)return sw;IR=1;var e=JO(),t=zp(),n=dT(),r=ul();function i(s,l,c){if(!r(c))return!1;var f=typeof l;return(f=="number"?t(c)&&n(l,c.length):f=="string"&&l in c)?e(c[l],s):!1}return sw=i,sw}var lw,UR;function T7(){if(UR)return lw;UR=1;var e=K$(),t=g7(),n=O7(),r=wg(),i=n(function(s,l){if(s==null)return[];var c=l.length;return c>1&&r(s,l[0],l[1])?l=[]:c>2&&r(l[0],l[1],l[2])&&(l=[l[0]]),t(s,e(l,1),[])});return lw=i,lw}var E7=T7();const vT=Ft(E7);function Kh(e){"@babel/helpers - typeof";return Kh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kh(e)}function uA(){return uA=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat(oh,"-left"),Oe(n)&&t&&Oe(t.x)&&n=t.y),"".concat(oh,"-top"),Oe(r)&&t&&Oe(t.y)&&rw?Math.max(m,f[r]):Math.max(p,f[r])}function U7(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function V7(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,s=e.reverseDirection,l=e.tooltipBox,c=e.useTranslate3d,f=e.viewBox,d,m,p;return l.height>0&&l.width>0&&n?(m=FR({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:l.width,viewBox:f,viewBoxDimension:f.width}),p=FR({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:l.height,viewBox:f,viewBoxDimension:f.height}),d=U7({translateX:m,translateY:p,useTranslate3d:c})):d=q7,{cssProperties:d,cssClasses:I7({translateX:m,translateY:p,coordinate:n})}}function sf(e){"@babel/helpers - typeof";return sf=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},sf(e)}function GR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function KR(e){for(var t=1;tYR||Math.abs(r.height-this.state.lastBoundingBox.height)>YR)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.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 r=this,i=this.props,s=i.active,l=i.allowEscapeViewBox,c=i.animationDuration,f=i.animationEasing,d=i.children,m=i.coordinate,p=i.hasPayload,v=i.isAnimationActive,b=i.offset,S=i.position,w=i.reverseDirection,x=i.useTranslate3d,_=i.viewBox,O=i.wrapperStyle,j=V7({allowEscapeViewBox:l,coordinate:m,offsetTopLeft:b,position:S,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:_}),E=j.cssClasses,A=j.cssProperties,M=KR(KR({transition:v&&s?"transform ".concat(c,"ms ").concat(f):void 0},A),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&p?"visible":"hidden",position:"absolute",top:0,left:0},O);return Q.createElement("div",{tabIndex:-1,className:E,style:M,ref:function(k){r.wrapperNode=k}},d)}}])})(Z.PureComponent),J7=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},fl={isSsr:J7()};function lf(e){"@babel/helpers - typeof";return lf=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},lf(e)}function XR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function WR(e){for(var t=1;t0;return Q.createElement(Z7,{allowEscapeViewBox:l,animationDuration:c,animationEasing:f,isAnimationActive:v,active:s,coordinate:m,hasPayload:M,offset:b,position:x,reverseDirection:_,useTranslate3d:O,viewBox:j,wrapperStyle:E},uG(d,WR(WR({},this.props),{},{payload:A})))}}])})(Z.PureComponent);yT(ui,"displayName","Tooltip");yT(ui,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!fl.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 cw,QR;function cG(){if(QR)return cw;QR=1;var e=no(),t=function(){return e.Date.now()};return cw=t,cw}var fw,ZR;function fG(){if(ZR)return fw;ZR=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return fw=t,fw}var dw,JR;function dG(){if(JR)return dw;JR=1;var e=fG(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return dw=n,dw}var hw,eN;function tB(){if(eN)return hw;eN=1;var e=dG(),t=ul(),n=Uf(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;function f(d){if(typeof d=="number")return d;if(n(d))return r;if(t(d)){var m=typeof d.valueOf=="function"?d.valueOf():d;d=t(m)?m+"":m}if(typeof d!="string")return d===0?d:+d;d=e(d);var p=s.test(d);return p||l.test(d)?c(d.slice(2),p?2:8):i.test(d)?r:+d}return hw=f,hw}var pw,tN;function hG(){if(tN)return pw;tN=1;var e=ul(),t=cG(),n=tB(),r="Expected a function",i=Math.max,s=Math.min;function l(c,f,d){var m,p,v,b,S,w,x=0,_=!1,O=!1,j=!0;if(typeof c!="function")throw new TypeError(r);f=n(f)||0,e(d)&&(_=!!d.leading,O="maxWait"in d,v=O?i(n(d.maxWait)||0,f):v,j="trailing"in d?!!d.trailing:j);function E(X){var ee=m,J=p;return m=p=void 0,x=X,b=c.apply(J,ee),b}function A(X){return x=X,S=setTimeout(k,f),_?E(X):b}function M(X){var ee=X-w,J=X-x,I=f-ee;return O?s(I,v-J):I}function R(X){var ee=X-w,J=X-x;return w===void 0||ee>=f||ee<0||O&&J>=v}function k(){var X=t();if(R(X))return z(X);S=setTimeout(k,M(X))}function z(X){return S=void 0,j&&m?E(X):(m=p=void 0,b)}function G(){S!==void 0&&clearTimeout(S),x=0,m=w=p=S=void 0}function $(){return S===void 0?b:z(t())}function B(){var X=t(),ee=R(X);if(m=arguments,p=this,w=X,ee){if(S===void 0)return A(w);if(O)return clearTimeout(S),S=setTimeout(k,f),E(w)}return S===void 0&&(S=setTimeout(k,f)),b}return B.cancel=G,B.flush=$,B}return pw=l,pw}var mw,nN;function pG(){if(nN)return mw;nN=1;var e=hG(),t=ul(),n="Expected a function";function r(i,s,l){var c=!0,f=!0;if(typeof i!="function")throw new TypeError(n);return t(l)&&(c="leading"in l?!!l.leading:c,f="trailing"in l?!!l.trailing:f),e(i,s,{leading:c,maxWait:s,trailing:f})}return mw=r,mw}var mG=pG();const nB=Ft(mG);function Xh(e){"@babel/helpers - typeof";return Xh=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},Xh(e)}function rN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sv(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(X=nB(X,w,{trailing:!0,leading:!1}));var ee=new ResizeObserver(X),J=A.current.getBoundingClientRect(),I=J.width,F=J.height;return $(I,F),ee.observe(A.current),function(){ee.disconnect()}},[$,w]);var B=Z.useMemo(function(){var X=z.containerWidth,ee=z.containerHeight;if(X<0||ee<0)return null;Io(Zl(l)||Zl(f),`The width(%s) and height(%s) are both fixed numbers,
maybe you don't need to use a ResponsiveContainer.`,l,f),Io(!n||n>0,"The aspect(%s) must be greater than zero.",n);var J=Zl(l)?X:l,I=Zl(f)?ee:f;n&&n>0&&(J?I=J/n:I&&(J=I*n),v&&I>v&&(I=v)),Io(J>0||I>0,`The width(%s) and height(%s) of chart should be greater than 0,
please check the style of container, or the props width(%s) and height(%s),
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
height and width.`,J,I,l,f,m,p,n);var F=!Array.isArray(b)&&qo(b.type).endsWith("Chart");return Q.Children.map(b,function(ae){return Q.isValidElement(ae)?Z.cloneElement(ae,Sv({width:J,height:I},F?{style:Sv({height:"100%",width:"100%",maxHeight:I,maxWidth:J},ae.props.style)}:{})):ae})},[n,b,f,v,p,m,z,l]);return Q.createElement("div",{id:x?"".concat(x):void 0,className:ct("recharts-responsive-container",_),style:Sv(Sv({},E),{},{width:l,height:f,minWidth:m,minHeight:p,maxHeight:v}),ref:A},B)}),gT=function(t){return null};gT.displayName="Cell";function Wh(e){"@babel/helpers - typeof";return Wh=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},Wh(e)}function aN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hA(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||fl.isSsr)return{width:0,height:0};var r=jG(n),i=JSON.stringify({text:t,copyStyle:r});if(wc.widthCache[i])return wc.widthCache[i];try{var s=document.getElementById(oN);s||(s=document.createElement("span"),s.setAttribute("id",oN),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var l=hA(hA({},MG),r);Object.assign(s.style,l),s.textContent="".concat(t);var c=s.getBoundingClientRect(),f={width:c.width,height:c.height};return wc.widthCache[i]=f,++wc.cacheCount>EG&&(wc.cacheCount=0,wc.widthCache={}),f}catch{return{width:0,height:0}}},PG=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Qh(e){"@babel/helpers - typeof";return Qh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qh(e)}function uy(e,t){return NG(e)||RG(e,t)||DG(e,t)||CG()}function CG(){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 DG(e,t){if(e){if(typeof e=="string")return sN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sN(e,t)}}function sN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function YG(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function hN(e,t){return ZG(e)||QG(e,t)||WG(e,t)||XG()}function XG(){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 WG(e,t){if(e){if(typeof e=="string")return pN(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pN(e,t)}}function pN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return J.reduce(function(I,F){var ae=F.word,fe=F.width,V=I[I.length-1];if(V&&(i==null||s||V.width+fe+rF.width?I:F})};if(!m)return b;for(var w="…",x=function(J){var I=p.slice(0,J),F=oB({breakAll:d,style:f,children:I+w}).wordsWithComputedWidth,ae=v(F),fe=ae.length>l||S(ae).width>Number(i);return[fe,ae]},_=0,O=p.length-1,j=0,E;_<=O&&j<=p.length-1;){var A=Math.floor((_+O)/2),M=A-1,R=x(M),k=hN(R,2),z=k[0],G=k[1],$=x(A),B=hN($,1),X=B[0];if(!z&&!X&&(_=A+1),z&&X&&(O=A-1),!z&&X){E=G;break}j++}return E||b},mN=function(t){var n=Qe(t)?[]:t.toString().split(aB);return[{words:n}]},eK=function(t){var n=t.width,r=t.scaleToFit,i=t.children,s=t.style,l=t.breakAll,c=t.maxLines;if((n||r)&&!fl.isSsr){var f,d,m=oB({breakAll:l,children:i,style:s});if(m){var p=m.wordsWithComputedWidth,v=m.spaceWidth;f=p,d=v}else return mN(i);return JG({breakAll:l,children:i,maxLines:c,style:s},f,d,n,r)}return mN(i)},vN="#808080",cy=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,s=i===void 0?0:i,l=t.lineHeight,c=l===void 0?"1em":l,f=t.capHeight,d=f===void 0?"0.71em":f,m=t.scaleToFit,p=m===void 0?!1:m,v=t.textAnchor,b=v===void 0?"start":v,S=t.verticalAnchor,w=S===void 0?"end":S,x=t.fill,_=x===void 0?vN:x,O=dN(t,GG),j=Z.useMemo(function(){return eK({breakAll:O.breakAll,children:O.children,maxLines:O.maxLines,scaleToFit:p,style:O.style,width:O.width})},[O.breakAll,O.children,O.maxLines,p,O.style,O.width]),E=O.dx,A=O.dy,M=O.angle,R=O.className,k=O.breakAll,z=dN(O,KG);if(!Jn(r)||!Jn(s))return null;var G=r+(Oe(E)?E:0),$=s+(Oe(A)?A:0),B;switch(w){case"start":B=vw("calc(".concat(d,")"));break;case"middle":B=vw("calc(".concat((j.length-1)/2," * -").concat(c," + (").concat(d," / 2))"));break;default:B=vw("calc(".concat(j.length-1," * -").concat(c,")"));break}var X=[];if(p){var ee=j[0].width,J=O.width;X.push("scale(".concat((Oe(J)?J/ee:1)/ee,")"))}return M&&X.push("rotate(".concat(M,", ").concat(G,", ").concat($,")")),X.length&&(z.transform=X.join(" ")),Q.createElement("text",pA({},Je(z,!0),{x:G,y:$,className:ct("recharts-text",R),textAnchor:b,fill:_.includes("url")?vN:_}),j.map(function(I,F){var ae=I.words.join(k?"":" ");return Q.createElement("tspan",{x:G,dy:F===0?B:c,key:"".concat(ae,"-").concat(F)},ae)}))};function ol(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function tK(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function bT(e){let t,n,r;e.length!==2?(t=ol,n=(c,f)=>ol(e(c),f),r=(c,f)=>e(c)-f):(t=e===ol||e===tK?e:nK,n=e,r=e);function i(c,f,d=0,m=c.length){if(d>>1;n(c[p],f)<0?d=p+1:m=p}while(d>>1;n(c[p],f)<=0?d=p+1:m=p}while(dd&&r(c[p-1],f)>-r(c[p],f)?p-1:p}return{left:i,center:l,right:s}}function nK(){return 0}function sB(e){return e===null?NaN:+e}function*rK(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const iK=bT(ol),Bp=iK.right;bT(sB).center;class yN extends Map{constructor(t,n=sK){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(gN(this,t))}has(t){return super.has(gN(this,t))}set(t,n){return super.set(aK(this,t),n)}delete(t){return super.delete(oK(this,t))}}function gN({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function aK({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function oK({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function sK(e){return e!==null&&typeof e=="object"?e.valueOf():e}function lK(e=ol){if(e===ol)return lB;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function lB(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const uK=Math.sqrt(50),cK=Math.sqrt(10),fK=Math.sqrt(2);function fy(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),l=s>=uK?10:s>=cK?5:s>=fK?2:1;let c,f,d;return i<0?(d=Math.pow(10,-i)/l,c=Math.round(e*d),f=Math.round(t*d),c/dt&&--f,d=-d):(d=Math.pow(10,i)*l,c=Math.round(e/d),f=Math.round(t/d),c*dt&&--f),f0))return[];if(e===t)return[e];const r=t=i))return[];const c=s-i+1,f=new Array(c);if(r)if(l<0)for(let d=0;d=r)&&(n=r);return n}function xN(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function uB(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?lB:lK(i);r>n;){if(r-n>600){const f=r-n+1,d=t-n+1,m=Math.log(f),p=.5*Math.exp(2*m/3),v=.5*Math.sqrt(m*p*(f-p)/f)*(d-f/2<0?-1:1),b=Math.max(n,Math.floor(t-d*p/f+v)),S=Math.min(r,Math.floor(t+(f-d)*p/f+v));uB(e,t,b,S,i)}const s=e[t];let l=n,c=r;for(oh(e,n,t),i(e[r],s)>0&&oh(e,n,r);l0;)--c}i(e[n],s)===0?oh(e,n,c):(++c,oh(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function oh(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function dK(e,t,n){if(e=Float64Array.from(rK(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return xN(e);if(t>=1)return bN(e);var r,i=(r-1)*t,s=Math.floor(i),l=bN(uB(e,s).subarray(0,s+1)),c=xN(e.subarray(s+1));return l+(c-l)*(i-s)}}function hK(e,t,n=sB){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,s=Math.floor(i),l=+n(e[s],s,e),c=+n(e[s+1],s+1,e);return l+(c-l)*(i-s)}}function pK(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?_v(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?_v(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=vK.exec(e))?new ci(t[1],t[2],t[3],1):(t=yK.exec(e))?new ci(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gK.exec(e))?_v(t[1],t[2],t[3],t[4]):(t=bK.exec(e))?_v(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xK.exec(e))?EN(t[1],t[2]/100,t[3]/100,1):(t=SK.exec(e))?EN(t[1],t[2]/100,t[3]/100,t[4]):SN.hasOwnProperty(e)?AN(SN[e]):e==="transparent"?new ci(NaN,NaN,NaN,0):null}function AN(e){return new ci(e>>16&255,e>>8&255,e&255,1)}function _v(e,t,n,r){return r<=0&&(e=t=n=NaN),new ci(e,t,n,r)}function AK(e){return e instanceof qp||(e=tp(e)),e?(e=e.rgb(),new ci(e.r,e.g,e.b,e.opacity)):new ci}function bA(e,t,n,r){return arguments.length===1?AK(e):new ci(e,t,n,r??1)}function ci(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ST(ci,bA,fB(qp,{brighter(e){return e=e==null?dy:Math.pow(dy,e),new ci(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Jh:Math.pow(Jh,e),new ci(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ci(pu(this.r),pu(this.g),pu(this.b),hy(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:ON,formatHex:ON,formatHex8:OK,formatRgb:TN,toString:TN}));function ON(){return`#${Jl(this.r)}${Jl(this.g)}${Jl(this.b)}`}function OK(){return`#${Jl(this.r)}${Jl(this.g)}${Jl(this.b)}${Jl((isNaN(this.opacity)?1:this.opacity)*255)}`}function TN(){const e=hy(this.opacity);return`${e===1?"rgb(":"rgba("}${pu(this.r)}, ${pu(this.g)}, ${pu(this.b)}${e===1?")":`, ${e})`}`}function hy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function pu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Jl(e){return e=pu(e),(e<16?"0":"")+e.toString(16)}function EN(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new _a(e,t,n,r)}function dB(e){if(e instanceof _a)return new _a(e.h,e.s,e.l,e.opacity);if(e instanceof qp||(e=tp(e)),!e)return new _a;if(e instanceof _a)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),l=NaN,c=s-i,f=(s+i)/2;return c?(t===s?l=(n-r)/c+(n0&&f<1?0:l,new _a(l,c,f,e.opacity)}function TK(e,t,n,r){return arguments.length===1?dB(e):new _a(e,t,n,r??1)}function _a(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ST(_a,TK,fB(qp,{brighter(e){return e=e==null?dy:Math.pow(dy,e),new _a(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Jh:Math.pow(Jh,e),new _a(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ci(yw(e>=240?e-240:e+120,i,r),yw(e,i,r),yw(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new _a(MN(this.h),Av(this.s),Av(this.l),hy(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=hy(this.opacity);return`${e===1?"hsl(":"hsla("}${MN(this.h)}, ${Av(this.s)*100}%, ${Av(this.l)*100}%${e===1?")":`, ${e})`}`}}));function MN(e){return e=(e||0)%360,e<0?e+360:e}function Av(e){return Math.max(0,Math.min(1,e||0))}function yw(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const wT=e=>()=>e;function EK(e,t){return function(n){return e+n*t}}function MK(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function jK(e){return(e=+e)==1?hB:function(t,n){return n-t?MK(t,n,e):wT(isNaN(t)?n:t)}}function hB(e,t){var n=t-e;return n?EK(e,n):wT(isNaN(e)?t:e)}const jN=(function e(t){var n=jK(t);function r(i,s){var l=n((i=bA(i)).r,(s=bA(s)).r),c=n(i.g,s.g),f=n(i.b,s.b),d=hB(i.opacity,s.opacity);return function(m){return i.r=l(m),i.g=c(m),i.b=f(m),i.opacity=d(m),i+""}}return r.gamma=e,r})(1);function PK(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;in&&(s=t.slice(n,s),c[l]?c[l]+=s:c[++l]=s),(r=r[0])===(i=i[0])?c[l]?c[l]+=i:c[++l]=i:(c[++l]=null,f.push({i:l,x:py(r,i)})),n=gw.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function IK(e,t,n){var r=e[0],i=e[1],s=t[0],l=t[1];return i2?UK:IK,f=d=null,p}function p(v){return v==null||isNaN(v=+v)?s:(f||(f=c(e.map(r),t,n)))(r(l(v)))}return p.invert=function(v){return l(i((d||(d=c(t,e.map(r),py)))(v)))},p.domain=function(v){return arguments.length?(e=Array.from(v,my),m()):e.slice()},p.range=function(v){return arguments.length?(t=Array.from(v),m()):t.slice()},p.rangeRound=function(v){return t=Array.from(v),n=_T,m()},p.clamp=function(v){return arguments.length?(l=v?!0:Yr,m()):l!==Yr},p.interpolate=function(v){return arguments.length?(n=v,m()):n},p.unknown=function(v){return arguments.length?(s=v,p):s},function(v,b){return r=v,i=b,m()}}function AT(){return _g()(Yr,Yr)}function VK(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function vy(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function lf(e){return e=vy(Math.abs(e)),e?e[1]:NaN}function HK(e,t){return function(n,r){for(var i=n.length,s=[],l=0,c=e[0],f=0;i>0&&c>0&&(f+c+1>r&&(c=Math.max(1,r-f)),s.push(n.substring(i-=c,i+c)),!((f+=c+1)>r));)c=e[l=(l+1)%e.length];return s.reverse().join(t)}}function FK(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var GK=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function np(e){if(!(t=GK.exec(e)))throw new Error("invalid format: "+e);var t;return new OT({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]})}np.prototype=OT.prototype;function OT(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+""}OT.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 KK(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var yy;function YK(e,t){var n=vy(e,t);if(!n)return yy=void 0,e.toPrecision(t);var r=n[0],i=n[1],s=i-(yy=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return s===l?r:s>l?r+new Array(s-l+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+vy(e,Math.max(0,t+s-1))[0]}function CN(e,t){var n=vy(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const DN={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:VK,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)=>CN(e*100,t),r:CN,s:YK,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function RN(e){return e}var NN=Array.prototype.map,kN=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function XK(e){var t=e.grouping===void 0||e.thousands===void 0?RN:HK(NN.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?RN:FK(NN.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function d(p,v){p=np(p);var b=p.fill,S=p.align,w=p.sign,x=p.symbol,_=p.zero,O=p.width,j=p.comma,E=p.precision,A=p.trim,M=p.type;M==="n"?(j=!0,M="g"):DN[M]||(E===void 0&&(E=12),A=!0,M="g"),(_||b==="0"&&S==="=")&&(_=!0,b="0",S="=");var R=(v&&v.prefix!==void 0?v.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(M)?"0"+M.toLowerCase():""),k=(x==="$"?r:/[%p]/.test(M)?l:"")+(v&&v.suffix!==void 0?v.suffix:""),z=DN[M],G=/[defgprs%]/.test(M);E=E===void 0?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function $(B){var X=R,ee=k,J,I,F;if(M==="c")ee=z(B)+ee,B="";else{B=+B;var ae=B<0||1/B<0;if(B=isNaN(B)?f:z(Math.abs(B),E),A&&(B=KK(B)),ae&&+B==0&&w!=="+"&&(ae=!1),X=(ae?w==="("?w:c:w==="-"||w==="("?"":w)+X,ee=(M==="s"&&!isNaN(B)&&yy!==void 0?kN[8+yy/3]:"")+ee+(ae&&w==="("?")":""),G){for(J=-1,I=B.length;++JF||F>57){ee=(F===46?i+B.slice(J+1):B.slice(J))+ee,B=B.slice(0,J);break}}}j&&!_&&(B=t(B,1/0));var fe=X.length+B.length+ee.length,V=fe>1)+X+B+ee+V.slice(fe);break;default:B=V+X+B+ee;break}return s(B)}return $.toString=function(){return p+""},$}function m(p,v){var b=Math.max(-8,Math.min(8,Math.floor(lf(v)/3)))*3,S=Math.pow(10,-b),w=d((p=np(p),p.type="f",p),{suffix:kN[8+b/3]});return function(x){return w(S*x)}}return{format:d,formatPrefix:m}}var Ov,TT,pB;WK({thousands:",",grouping:[3],currency:["$",""]});function WK(e){return Ov=XK(e),TT=Ov.format,pB=Ov.formatPrefix,Ov}function QK(e){return Math.max(0,-lf(Math.abs(e)))}function ZK(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(lf(t)/3)))*3-lf(Math.abs(e)))}function JK(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,lf(t)-lf(e))+1}function mB(e,t,n,r){var i=yA(e,t,n),s;switch(r=np(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=ZK(i,l))&&(r.precision=s),pB(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=JK(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=QK(i))&&(r.precision=s-(r.type==="%")*2);break}}return TT(r)}function dl(e){var t=e.domain;return e.ticks=function(n){var r=t();return mA(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return mB(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,l=r[i],c=r[s],f,d,m=10;for(c0;){if(d=vA(l,c,n),d===f)return r[i]=l,r[s]=c,t(r);if(d>0)l=Math.floor(l/d)*d,c=Math.ceil(c/d)*d;else if(d<0)l=Math.ceil(l*d)/d,c=Math.floor(c*d)/d;else break;f=d}return e},e}function gy(){var e=AT();return e.copy=function(){return Ip(e,gy())},sa.apply(e,arguments),dl(e)}function vB(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,my),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return vB(e).unknown(t)},e=arguments.length?Array.from(e,my):[0,1],dl(n)}function yB(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],l;return sMath.pow(e,t)}function iY(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 $N(e){return(t,n)=>-e(-t,n)}function ET(e){const t=e(LN,zN),n=t.domain;let r=10,i,s;function l(){return i=iY(r),s=rY(r),n()[0]<0?(i=$N(i),s=$N(s),e(eY,tY)):e(LN,zN),t}return t.base=function(c){return arguments.length?(r=+c,l()):r},t.domain=function(c){return arguments.length?(n(c),l()):n()},t.ticks=c=>{const f=n();let d=f[0],m=f[f.length-1];const p=m0){for(;v<=b;++v)for(S=1;Sm)break;_.push(w)}}else for(;v<=b;++v)for(S=r-1;S>=1;--S)if(w=v>0?S/s(-v):S*s(v),!(wm)break;_.push(w)}_.length*2{if(c==null&&(c=10),f==null&&(f=r===10?"s":","),typeof f!="function"&&(!(r%1)&&(f=np(f)).precision==null&&(f.trim=!0),f=TT(f)),c===1/0)return f;const d=Math.max(1,r*c/t.ticks().length);return m=>{let p=m/s(Math.round(i(m)));return p*rn(yB(n(),{floor:c=>s(Math.floor(i(c))),ceil:c=>s(Math.ceil(i(c)))})),t}function gB(){const e=ET(_g()).domain([1,10]);return e.copy=()=>Ip(e,gB()).base(e.base()),sa.apply(e,arguments),e}function BN(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function qN(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function MT(e){var t=1,n=e(BN(t),qN(t));return n.constant=function(r){return arguments.length?e(BN(t=+r),qN(t)):t},dl(n)}function bB(){var e=MT(_g());return e.copy=function(){return Ip(e,bB()).constant(e.constant())},sa.apply(e,arguments)}function IN(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function aY(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function oY(e){return e<0?-e*e:e*e}function jT(e){var t=e(Yr,Yr),n=1;function r(){return n===1?e(Yr,Yr):n===.5?e(aY,oY):e(IN(n),IN(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},dl(t)}function PT(){var e=jT(_g());return e.copy=function(){return Ip(e,PT()).exponent(e.exponent())},sa.apply(e,arguments),e}function sY(){return PT.apply(null,arguments).exponent(.5)}function UN(e){return Math.sign(e)*e*e}function lY(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function xB(){var e=AT(),t=[0,1],n=!1,r;function i(s){var l=lY(e(s));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(s){return e.invert(UN(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,my)).map(UN)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(n=!!s,i):n},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return xB(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},sa.apply(i,arguments),dl(i)}function SB(){var e=[],t=[],n=[],r;function i(){var l=0,c=Math.max(1,t.length);for(n=new Array(c-1);++l0?n[c-1]:e[0],c=n?[r[n-1],t]:[r[d-1],r[d]]},l.unknown=function(f){return arguments.length&&(s=f),l},l.thresholds=function(){return r.slice()},l.copy=function(){return wB().domain([e,t]).range(i).unknown(s)},sa.apply(dl(l),arguments)}function _B(){var e=[.5],t=[0,1],n,r=1;function i(s){return s!=null&&s<=s?t[Bp(e,s,0,r)]:n}return i.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var l=t.indexOf(s);return[e[l-1],e[l]]},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return _B().domain(e).range(t).unknown(n)},sa.apply(i,arguments)}const bw=new Date,xw=new Date;function nr(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const l=i(s),c=i.ceil(s);return s-l(t(s=new Date(+s),l==null?1:Math.floor(l)),s),i.range=(s,l,c)=>{const f=[];if(s=i.ceil(s),c=c==null?1:Math.floor(c),!(s0))return f;let d;do f.push(d=new Date(+s)),t(s,c),e(s);while(dnr(l=>{if(l>=l)for(;e(l),!s(l);)l.setTime(l-1)},(l,c)=>{if(l>=l)if(c<0)for(;++c<=0;)for(;t(l,-1),!s(l););else for(;--c>=0;)for(;t(l,1),!s(l););}),n&&(i.count=(s,l)=>(bw.setTime(+s),xw.setTime(+l),e(bw),e(xw),Math.floor(n(bw,xw))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?l=>r(l)%s===0:l=>i.count(0,l)%s===0):i)),i}const by=nr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);by.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?nr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):by);by.range;const zo=1e3,ia=zo*60,$o=ia*60,Yo=$o*24,CT=Yo*7,VN=Yo*30,Sw=Yo*365,eu=nr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*zo)},(e,t)=>(t-e)/zo,e=>e.getUTCSeconds());eu.range;const DT=nr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*zo)},(e,t)=>{e.setTime(+e+t*ia)},(e,t)=>(t-e)/ia,e=>e.getMinutes());DT.range;const RT=nr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ia)},(e,t)=>(t-e)/ia,e=>e.getUTCMinutes());RT.range;const NT=nr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*zo-e.getMinutes()*ia)},(e,t)=>{e.setTime(+e+t*$o)},(e,t)=>(t-e)/$o,e=>e.getHours());NT.range;const kT=nr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*$o)},(e,t)=>(t-e)/$o,e=>e.getUTCHours());kT.range;const Up=nr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ia)/Yo,e=>e.getDate()-1);Up.range;const Ag=nr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Yo,e=>e.getUTCDate()-1);Ag.range;const AB=nr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Yo,e=>Math.floor(e/Yo));AB.range;function Pu(e){return nr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ia)/CT)}const Og=Pu(0),xy=Pu(1),uY=Pu(2),cY=Pu(3),uf=Pu(4),fY=Pu(5),dY=Pu(6);Og.range;xy.range;uY.range;cY.range;uf.range;fY.range;dY.range;function Cu(e){return nr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/CT)}const Tg=Cu(0),Sy=Cu(1),hY=Cu(2),pY=Cu(3),cf=Cu(4),mY=Cu(5),vY=Cu(6);Tg.range;Sy.range;hY.range;pY.range;cf.range;mY.range;vY.range;const LT=nr(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());LT.range;const zT=nr(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());zT.range;const Xo=nr(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());Xo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:nr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Xo.range;const Wo=nr(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());Wo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:nr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Wo.range;function OB(e,t,n,r,i,s){const l=[[eu,1,zo],[eu,5,5*zo],[eu,15,15*zo],[eu,30,30*zo],[s,1,ia],[s,5,5*ia],[s,15,15*ia],[s,30,30*ia],[i,1,$o],[i,3,3*$o],[i,6,6*$o],[i,12,12*$o],[r,1,Yo],[r,2,2*Yo],[n,1,CT],[t,1,VN],[t,3,3*VN],[e,1,Sw]];function c(d,m,p){const v=mx).right(l,v);if(b===l.length)return e.every(yA(d/Sw,m/Sw,p));if(b===0)return by.every(Math.max(yA(d,m,p),1));const[S,w]=l[v/l[b-1][2]53)return null;"w"in he||(he.w=1),"Z"in he?(Te=_w(sh(he.y,0,1)),Xe=Te.getUTCDay(),Te=Xe>4||Xe===0?Sy.ceil(Te):Sy(Te),Te=Ag.offset(Te,(he.V-1)*7),he.y=Te.getUTCFullYear(),he.m=Te.getUTCMonth(),he.d=Te.getUTCDate()+(he.w+6)%7):(Te=ww(sh(he.y,0,1)),Xe=Te.getDay(),Te=Xe>4||Xe===0?xy.ceil(Te):xy(Te),Te=Up.offset(Te,(he.V-1)*7),he.y=Te.getFullYear(),he.m=Te.getMonth(),he.d=Te.getDate()+(he.w+6)%7)}else("W"in he||"U"in he)&&("w"in he||(he.w="u"in he?he.u%7:"W"in he?1:0),Xe="Z"in he?_w(sh(he.y,0,1)).getUTCDay():ww(sh(he.y,0,1)).getDay(),he.m=0,he.d="W"in he?(he.w+6)%7+he.W*7-(Xe+5)%7:he.w+he.U*7-(Xe+6)%7);return"Z"in he?(he.H+=he.Z/100|0,he.M+=he.Z%100,_w(he)):ww(he)}}function k(de,_e,Ee,he){for(var Ie=0,Te=_e.length,Xe=Ee.length,nt,yt;Ie=Xe)return-1;if(nt=_e.charCodeAt(Ie++),nt===37){if(nt=_e.charAt(Ie++),yt=A[nt in HN?_e.charAt(Ie++):nt],!yt||(he=yt(de,Ee,he))<0)return-1}else if(nt!=Ee.charCodeAt(he++))return-1}return he}function z(de,_e,Ee){var he=d.exec(_e.slice(Ee));return he?(de.p=m.get(he[0].toLowerCase()),Ee+he[0].length):-1}function G(de,_e,Ee){var he=b.exec(_e.slice(Ee));return he?(de.w=S.get(he[0].toLowerCase()),Ee+he[0].length):-1}function $(de,_e,Ee){var he=p.exec(_e.slice(Ee));return he?(de.w=v.get(he[0].toLowerCase()),Ee+he[0].length):-1}function B(de,_e,Ee){var he=_.exec(_e.slice(Ee));return he?(de.m=O.get(he[0].toLowerCase()),Ee+he[0].length):-1}function X(de,_e,Ee){var he=w.exec(_e.slice(Ee));return he?(de.m=x.get(he[0].toLowerCase()),Ee+he[0].length):-1}function ee(de,_e,Ee){return k(de,t,_e,Ee)}function J(de,_e,Ee){return k(de,n,_e,Ee)}function I(de,_e,Ee){return k(de,r,_e,Ee)}function F(de){return l[de.getDay()]}function ae(de){return s[de.getDay()]}function fe(de){return f[de.getMonth()]}function V(de){return c[de.getMonth()]}function D(de){return i[+(de.getHours()>=12)]}function U(de){return 1+~~(de.getMonth()/3)}function Y(de){return l[de.getUTCDay()]}function ue(de){return s[de.getUTCDay()]}function be(de){return f[de.getUTCMonth()]}function Se(de){return c[de.getUTCMonth()]}function ye(de){return i[+(de.getUTCHours()>=12)]}function Me(de){return 1+~~(de.getUTCMonth()/3)}return{format:function(de){var _e=M(de+="",j);return _e.toString=function(){return de},_e},parse:function(de){var _e=R(de+="",!1);return _e.toString=function(){return de},_e},utcFormat:function(de){var _e=M(de+="",E);return _e.toString=function(){return de},_e},utcParse:function(de){var _e=R(de+="",!0);return _e.toString=function(){return de},_e}}}var HN={"-":"",_:" ",0:"0"},hr=/^\s*\d+/,wY=/^%/,_Y=/[\\^$*+?|[\]().{}]/g;function At(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s[t.toLowerCase(),n]))}function OY(e,t,n){var r=hr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function TY(e,t,n){var r=hr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function EY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function MY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function jY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function FN(e,t,n){var r=hr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function GN(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function PY(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function CY(e,t,n){var r=hr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function DY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function KN(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function RY(e,t,n){var r=hr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function YN(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function NY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function kY(e,t,n){var r=hr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function LY(e,t,n){var r=hr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function zY(e,t,n){var r=hr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function $Y(e,t,n){var r=wY.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function BY(e,t,n){var r=hr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function qY(e,t,n){var r=hr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function XN(e,t){return At(e.getDate(),t,2)}function IY(e,t){return At(e.getHours(),t,2)}function UY(e,t){return At(e.getHours()%12||12,t,2)}function VY(e,t){return At(1+Up.count(Xo(e),e),t,3)}function TB(e,t){return At(e.getMilliseconds(),t,3)}function HY(e,t){return TB(e,t)+"000"}function FY(e,t){return At(e.getMonth()+1,t,2)}function GY(e,t){return At(e.getMinutes(),t,2)}function KY(e,t){return At(e.getSeconds(),t,2)}function YY(e){var t=e.getDay();return t===0?7:t}function XY(e,t){return At(Og.count(Xo(e)-1,e),t,2)}function EB(e){var t=e.getDay();return t>=4||t===0?uf(e):uf.ceil(e)}function WY(e,t){return e=EB(e),At(uf.count(Xo(e),e)+(Xo(e).getDay()===4),t,2)}function QY(e){return e.getDay()}function ZY(e,t){return At(xy.count(Xo(e)-1,e),t,2)}function JY(e,t){return At(e.getFullYear()%100,t,2)}function eX(e,t){return e=EB(e),At(e.getFullYear()%100,t,2)}function tX(e,t){return At(e.getFullYear()%1e4,t,4)}function nX(e,t){var n=e.getDay();return e=n>=4||n===0?uf(e):uf.ceil(e),At(e.getFullYear()%1e4,t,4)}function rX(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+At(t/60|0,"0",2)+At(t%60,"0",2)}function WN(e,t){return At(e.getUTCDate(),t,2)}function iX(e,t){return At(e.getUTCHours(),t,2)}function aX(e,t){return At(e.getUTCHours()%12||12,t,2)}function oX(e,t){return At(1+Ag.count(Wo(e),e),t,3)}function MB(e,t){return At(e.getUTCMilliseconds(),t,3)}function sX(e,t){return MB(e,t)+"000"}function lX(e,t){return At(e.getUTCMonth()+1,t,2)}function uX(e,t){return At(e.getUTCMinutes(),t,2)}function cX(e,t){return At(e.getUTCSeconds(),t,2)}function fX(e){var t=e.getUTCDay();return t===0?7:t}function dX(e,t){return At(Tg.count(Wo(e)-1,e),t,2)}function jB(e){var t=e.getUTCDay();return t>=4||t===0?cf(e):cf.ceil(e)}function hX(e,t){return e=jB(e),At(cf.count(Wo(e),e)+(Wo(e).getUTCDay()===4),t,2)}function pX(e){return e.getUTCDay()}function mX(e,t){return At(Sy.count(Wo(e)-1,e),t,2)}function vX(e,t){return At(e.getUTCFullYear()%100,t,2)}function yX(e,t){return e=jB(e),At(e.getUTCFullYear()%100,t,2)}function gX(e,t){return At(e.getUTCFullYear()%1e4,t,4)}function bX(e,t){var n=e.getUTCDay();return e=n>=4||n===0?cf(e):cf.ceil(e),At(e.getUTCFullYear()%1e4,t,4)}function xX(){return"+0000"}function QN(){return"%"}function ZN(e){return+e}function JN(e){return Math.floor(+e/1e3)}var _c,PB,CB;SX({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 SX(e){return _c=SY(e),PB=_c.format,_c.parse,CB=_c.utcFormat,_c.utcParse,_c}function wX(e){return new Date(e)}function _X(e){return e instanceof Date?+e:+new Date(+e)}function $T(e,t,n,r,i,s,l,c,f,d){var m=AT(),p=m.invert,v=m.domain,b=d(".%L"),S=d(":%S"),w=d("%I:%M"),x=d("%I %p"),_=d("%a %d"),O=d("%b %d"),j=d("%B"),E=d("%Y");function A(M){return(f(M)t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,s)=>dK(e,s/r))},n.copy=function(){return kB(t).domain(e)},ts.apply(n,arguments)}function Mg(){var e=0,t=.5,n=1,r=1,i,s,l,c,f,d=Yr,m,p=!1,v;function b(w){return isNaN(w=+w)?v:(w=.5+((w=+m(w))-s)*(r*wn}return Ow=e,Ow}var Tw,rk;function jX(){if(rk)return Tw;rk=1;var e=BB(),t=MX(),n=Hf();function r(i){return i&&i.length?e(i,n,t):void 0}return Tw=r,Tw}var PX=jX();const nl=Ft(PX);var Ew,ik;function CX(){if(ik)return Ew;ik=1;function e(t,n){return te.e^s.s<0?1:-1;for(r=s.d.length,i=e.d.length,t=0,n=re.d[t]^s.s<0?1:-1;return r===i?0:r>i^s.s<0?1:-1};ke.decimalPlaces=ke.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*ln;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ke.dividedBy=ke.div=function(e){return Uo(this,new this.constructor(e))};ke.dividedToIntegerBy=ke.idiv=function(e){var t=this,n=t.constructor;return Xt(Uo(t,new n(e),0,1),n.precision)};ke.equals=ke.eq=function(e){return!this.cmp(e)};ke.exponent=function(){return Hn(this)};ke.greaterThan=ke.gt=function(e){return this.cmp(e)>0};ke.greaterThanOrEqualTo=ke.gte=function(e){return this.cmp(e)>=0};ke.isInteger=ke.isint=function(){return this.e>this.d.length-2};ke.isNegative=ke.isneg=function(){return this.s<0};ke.isPositive=ke.ispos=function(){return this.s>0};ke.isZero=function(){return this.s===0};ke.lessThan=ke.lt=function(e){return this.cmp(e)<0};ke.lessThanOrEqualTo=ke.lte=function(e){return this.cmp(e)<1};ke.logarithm=ke.log=function(e){var t,n=this,r=n.constructor,i=r.precision,s=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Ci))throw Error(oa+"NaN");if(n.s<1)throw Error(oa+(n.s?"NaN":"-Infinity"));return n.eq(Ci)?new r(0):(hn=!1,t=Uo(rp(n,s),rp(e,s),s),hn=!0,Xt(t,i))};ke.minus=ke.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?VB(t,e):IB(t,(e.s=-e.s,e))};ke.modulo=ke.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(oa+"NaN");return n.s?(hn=!1,t=Uo(n,e,0,1).times(e),hn=!0,n.minus(t)):Xt(new r(n),i)};ke.naturalExponential=ke.exp=function(){return UB(this)};ke.naturalLogarithm=ke.ln=function(){return rp(this)};ke.negated=ke.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ke.plus=ke.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?IB(t,e):VB(t,(e.s=-e.s,e))};ke.precision=ke.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(mu+e);if(t=Hn(i)+1,r=i.d.length-1,n=r*ln+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};ke.squareRoot=ke.sqrt=function(){var e,t,n,r,i,s,l,c=this,f=c.constructor;if(c.s<1){if(!c.s)return new f(0);throw Error(oa+"NaN")}for(e=Hn(c),hn=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=Ga(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Kf((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),r=new f(t)):r=new f(i.toString()),n=f.precision,i=l=n+3;;)if(s=r,r=s.plus(Uo(c,s,l+2)).times(.5),Ga(s.d).slice(0,l)===(t=Ga(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(Xt(s,n+1,0),s.times(s).eq(c)){r=s;break}}else if(t!="9999")break;l+=4}return hn=!0,Xt(r,n)};ke.times=ke.mul=function(e){var t,n,r,i,s,l,c,f,d,m=this,p=m.constructor,v=m.d,b=(e=new p(e)).d;if(!m.s||!e.s)return new p(0);for(e.s*=m.s,n=m.e+e.e,f=v.length,d=b.length,f=0;){for(t=0,i=f+r;i>r;)c=s[i]+b[r]*v[i-r-1]+t,s[i--]=c%fr|0,t=c/fr|0;s[i]=(s[i]+t)%fr|0}for(;!s[--l];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,hn?Xt(e,p.precision):e};ke.toDecimalPlaces=ke.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(eo(e,0,Gf),t===void 0?t=r.rounding:eo(t,0,8),Xt(n,e+Hn(n)+1,t))};ke.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Au(r,!0):(eo(e,0,Gf),t===void 0?t=i.rounding:eo(t,0,8),r=Xt(new i(r),e+1,t),n=Au(r,!0,e+1)),n};ke.toFixed=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?Au(i):(eo(e,0,Gf),t===void 0?t=s.rounding:eo(t,0,8),r=Xt(new s(i),e+Hn(i)+1,t),n=Au(r.abs(),!1,e+Hn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ke.toInteger=ke.toint=function(){var e=this,t=e.constructor;return Xt(new t(e),Hn(e)+1,t.rounding)};ke.toNumber=function(){return+this};ke.toPower=ke.pow=function(e){var t,n,r,i,s,l,c=this,f=c.constructor,d=12,m=+(e=new f(e));if(!e.s)return new f(Ci);if(c=new f(c),!c.s){if(e.s<1)throw Error(oa+"Infinity");return c}if(c.eq(Ci))return c;if(r=f.precision,e.eq(Ci))return Xt(c,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=c.s,l){if((n=m<0?-m:m)<=qB){for(i=new f(Ci),t=Math.ceil(r/ln+4),hn=!1;n%2&&(i=i.times(c),ck(i.d,t)),n=Kf(n/2),n!==0;)c=c.times(c),ck(c.d,t);return hn=!0,e.s<0?new f(Ci).div(i):Xt(i,r)}}else if(s<0)throw Error(oa+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,hn=!1,i=e.times(rp(c,r+d)),hn=!0,i=UB(i),i.s=s,i};ke.toPrecision=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?(n=Hn(i),r=Au(i,n<=s.toExpNeg||n>=s.toExpPos)):(eo(e,1,Gf),t===void 0?t=s.rounding:eo(t,0,8),i=Xt(new s(i),e,t),n=Hn(i),r=Au(i,e<=n||n<=s.toExpNeg,e)),r};ke.toSignificantDigits=ke.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(eo(e,1,Gf),t===void 0?t=r.rounding:eo(t,0,8)),Xt(new r(n),e,t)};ke.toString=ke.valueOf=ke.val=ke.toJSON=ke[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Hn(e),n=e.constructor;return Au(e,t<=n.toExpNeg||t>=n.toExpPos)};function IB(e,t){var n,r,i,s,l,c,f,d,m=e.constructor,p=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),hn?Xt(t,p):t;if(f=e.d,d=t.d,l=e.e,i=t.e,f=f.slice(),s=l-i,s){for(s<0?(r=f,s=-s,c=d.length):(r=d,i=l,c=f.length),l=Math.ceil(p/ln),c=l>c?l+1:c+1,s>c&&(s=c,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(c=f.length,s=d.length,c-s<0&&(s=c,r=d,d=f,f=r),n=0;s;)n=(f[--s]=f[s]+d[s]+n)/fr|0,f[s]%=fr;for(n&&(f.unshift(n),++i),c=f.length;f[--c]==0;)f.pop();return t.d=f,t.e=i,hn?Xt(t,p):t}function eo(e,t,n){if(e!==~~e||en)throw Error(mu+e)}function Ga(e){var t,n,r,i=e.length-1,s="",l=e[0];if(i>0){for(s+=l,t=1;tl?1:-1;else for(c=f=0;ci[c]?1:-1;break}return f}function n(r,i,s){for(var l=0;s--;)r[s]-=l,l=r[s]1;)r.shift()}return function(r,i,s,l){var c,f,d,m,p,v,b,S,w,x,_,O,j,E,A,M,R,k,z=r.constructor,G=r.s==i.s?1:-1,$=r.d,B=i.d;if(!r.s)return new z(r);if(!i.s)throw Error(oa+"Division by zero");for(f=r.e-i.e,R=B.length,A=$.length,b=new z(G),S=b.d=[],d=0;B[d]==($[d]||0);)++d;if(B[d]>($[d]||0)&&--f,s==null?O=s=z.precision:l?O=s+(Hn(r)-Hn(i))+1:O=s,O<0)return new z(0);if(O=O/ln+2|0,d=0,R==1)for(m=0,B=B[0],O++;(d1&&(B=e(B,m),$=e($,m),R=B.length,A=$.length),E=R,w=$.slice(0,R),x=w.length;x=fr/2&&++M;do m=0,c=t(B,w,R,x),c<0?(_=w[0],R!=x&&(_=_*fr+(w[1]||0)),m=_/M|0,m>1?(m>=fr&&(m=fr-1),p=e(B,m),v=p.length,x=w.length,c=t(p,w,v,x),c==1&&(m--,n(p,R16)throw Error(IT+Hn(e));if(!e.s)return new m(Ci);for(hn=!1,c=p,l=new m(.03125);e.abs().gte(.1);)e=e.times(l),d+=5;for(r=Math.log(Fl(2,d))/Math.LN10*2+5|0,c+=r,n=i=s=new m(Ci),m.precision=c;;){if(i=Xt(i.times(e),c),n=n.times(++f),l=s.plus(Uo(i,n,c)),Ga(l.d).slice(0,c)===Ga(s.d).slice(0,c)){for(;d--;)s=Xt(s.times(s),c);return m.precision=p,t==null?(hn=!0,Xt(s,p)):s}s=l}}function Hn(e){for(var t=e.e*ln,n=e.d[0];n>=10;n/=10)t++;return t}function Dw(e,t,n){if(t>e.LN10.sd())throw hn=!0,n&&(e.precision=n),Error(oa+"LN10 precision limit exceeded");return Xt(new e(e.LN10),t)}function Hs(e){for(var t="";e--;)t+="0";return t}function rp(e,t){var n,r,i,s,l,c,f,d,m,p=1,v=10,b=e,S=b.d,w=b.constructor,x=w.precision;if(b.s<1)throw Error(oa+(b.s?"NaN":"-Infinity"));if(b.eq(Ci))return new w(0);if(t==null?(hn=!1,d=x):d=t,b.eq(10))return t==null&&(hn=!0),Dw(w,d);if(d+=v,w.precision=d,n=Ga(S),r=n.charAt(0),s=Hn(b),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)b=b.times(e),n=Ga(b.d),r=n.charAt(0),p++;s=Hn(b),r>1?(b=new w("0."+n),s++):b=new w(r+"."+n.slice(1))}else return f=Dw(w,d+2,x).times(s+""),b=rp(new w(r+"."+n.slice(1)),d-v).plus(f),w.precision=x,t==null?(hn=!0,Xt(b,x)):b;for(c=l=b=Uo(b.minus(Ci),b.plus(Ci),d),m=Xt(b.times(b),d),i=3;;){if(l=Xt(l.times(m),d),f=c.plus(Uo(l,new w(i),d)),Ga(f.d).slice(0,d)===Ga(c.d).slice(0,d))return c=c.times(2),s!==0&&(c=c.plus(Dw(w,d+2,x).times(s+""))),c=Uo(c,new w(p),d),w.precision=x,t==null?(hn=!0,Xt(c,x)):c;c=f,i+=2}}function uk(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Kf(n/ln),e.d=[],r=(n+1)%ln,n<0&&(r+=ln),rwy||e.e<-wy))throw Error(IT+n)}else e.s=0,e.e=0,e.d=[0];return e}function Xt(e,t,n){var r,i,s,l,c,f,d,m,p=e.d;for(l=1,s=p[0];s>=10;s/=10)l++;if(r=t-l,r<0)r+=ln,i=t,d=p[m=0];else{if(m=Math.ceil((r+1)/ln),s=p.length,m>=s)return e;for(d=s=p[m],l=1;s>=10;s/=10)l++;r%=ln,i=r-ln+l}if(n!==void 0&&(s=Fl(10,l-i-1),c=d/s%10|0,f=t<0||p[m+1]!==void 0||d%s,f=n<4?(c||f)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||f||n==6&&(r>0?i>0?d/Fl(10,l-i):0:p[m-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return f?(s=Hn(e),p.length=1,t=t-s-1,p[0]=Fl(10,(ln-t%ln)%ln),e.e=Kf(-t/ln)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=m,s=1,m--):(p.length=m+1,s=Fl(10,ln-r),p[m]=i>0?(d/Fl(10,l-i)%Fl(10,i)|0)*s:0),f)for(;;)if(m==0){(p[0]+=s)==fr&&(p[0]=1,++e.e);break}else{if(p[m]+=s,p[m]!=fr)break;p[m--]=0,s=1}for(r=p.length;p[--r]===0;)p.pop();if(hn&&(e.e>wy||e.e<-wy))throw Error(IT+Hn(e));return e}function VB(e,t){var n,r,i,s,l,c,f,d,m,p,v=e.constructor,b=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),hn?Xt(t,b):t;if(f=e.d,p=t.d,r=t.e,d=e.e,f=f.slice(),l=d-r,l){for(m=l<0,m?(n=f,l=-l,c=p.length):(n=p,r=d,c=f.length),i=Math.max(Math.ceil(b/ln),c)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=f.length,c=p.length,m=i0;--i)f[c++]=0;for(i=p.length;i>l;){if(f[--i]