@jinn-network/client 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -1
- package/dist/adapters/mech/adapter.d.ts +19 -1
- package/dist/adapters/mech/adapter.js +130 -14
- package/dist/adapters/mech/adapter.js.map +1 -1
- package/dist/adapters/mech/contracts.d.ts +22 -1
- package/dist/adapters/mech/contracts.js +34 -24
- package/dist/adapters/mech/contracts.js.map +1 -1
- package/dist/adapters/mech/safe.d.ts +1 -1
- package/dist/adapters/mech/safe.js +5 -3
- package/dist/adapters/mech/safe.js.map +1 -1
- package/dist/adapters/mech/types.d.ts +6 -1
- package/dist/adapters/mech/types.js.map +1 -1
- package/dist/agent/operator-claude.js +8 -0
- package/dist/agent/operator-claude.js.map +1 -1
- package/dist/api/activity-events-endpoint.d.ts +14 -0
- package/dist/api/activity-events-endpoint.js +59 -0
- package/dist/api/activity-events-endpoint.js.map +1 -0
- package/dist/api/bootstrap-endpoint.d.ts +1 -2
- package/dist/api/bootstrap-endpoint.js +42 -24
- package/dist/api/bootstrap-endpoint.js.map +1 -1
- package/dist/api/codex-doctor-endpoint.d.ts +22 -5
- package/dist/api/codex-doctor-endpoint.js +136 -17
- package/dist/api/codex-doctor-endpoint.js.map +1 -1
- package/dist/api/debug-report-endpoint.d.ts +27 -0
- package/dist/api/debug-report-endpoint.js +157 -0
- package/dist/api/debug-report-endpoint.js.map +1 -0
- package/dist/api/gather-status.d.ts +33 -0
- package/dist/api/gather-status.js +211 -26
- package/dist/api/gather-status.js.map +1 -1
- package/dist/api/hermes-doctor-endpoint.d.ts +15 -7
- package/dist/api/hermes-doctor-endpoint.js +56 -19
- package/dist/api/hermes-doctor-endpoint.js.map +1 -1
- package/dist/api/launcher-status.d.ts +4 -2
- package/dist/api/launcher-status.js +11 -10
- package/dist/api/launcher-status.js.map +1 -1
- package/dist/api/launcher-tasks.d.ts +1 -1
- package/dist/api/launcher-tasks.js +12 -8
- package/dist/api/launcher-tasks.js.map +1 -1
- package/dist/api/operator-artifacts-endpoint.js +73 -6
- package/dist/api/operator-artifacts-endpoint.js.map +1 -1
- package/dist/api/portfolio-v0-build.d.ts +7 -1
- package/dist/api/portfolio-v0-build.js +6 -2
- package/dist/api/portfolio-v0-build.js.map +1 -1
- package/dist/api/prediction-v1-build.d.ts +6 -0
- package/dist/api/prediction-v1-build.js +3 -1
- package/dist/api/prediction-v1-build.js.map +1 -1
- package/dist/api/server.d.ts +17 -0
- package/dist/api/server.js +40 -1
- package/dist/api/server.js.map +1 -1
- package/dist/api/setup-endpoints.d.ts +0 -9
- package/dist/api/setup-endpoints.js +11 -153
- package/dist/api/setup-endpoints.js.map +1 -1
- package/dist/api/solvernets-endpoints.js +30 -63
- package/dist/api/solvernets-endpoints.js.map +1 -1
- package/dist/api/status-build.d.ts +115 -2
- package/dist/api/status-build.js +47 -11
- package/dist/api/status-build.js.map +1 -1
- package/dist/api/status-harness-rollup.d.ts +35 -0
- package/dist/api/status-harness-rollup.js +45 -0
- package/dist/api/status-harness-rollup.js.map +1 -0
- package/dist/api/task-runs-build.d.ts +8 -0
- package/dist/api/task-runs-build.js +5 -1
- package/dist/api/task-runs-build.js.map +1 -1
- package/dist/build-info.json +4 -4
- package/dist/build-meta.json +1 -1
- package/dist/captures/live-publisher.js +24 -4
- package/dist/captures/live-publisher.js.map +1 -1
- package/dist/captures/publish.d.ts +1 -1
- package/dist/chain-read-errors.d.ts +12 -0
- package/dist/chain-read-errors.js +26 -1
- package/dist/chain-read-errors.js.map +1 -1
- package/dist/cli/commands/codedigest-revert-check.d.ts +33 -0
- package/dist/cli/commands/codedigest-revert-check.js +249 -0
- package/dist/cli/commands/codedigest-revert-check.js.map +1 -0
- package/dist/cli/commands/solver-nets.d.ts +1 -0
- package/dist/cli/commands/solver-nets.js +177 -22
- package/dist/cli/commands/solver-nets.js.map +1 -1
- package/dist/cli/commands/solver-plugins-block.d.ts +33 -0
- package/dist/cli/commands/solver-plugins-block.js +118 -0
- package/dist/cli/commands/solver-plugins-block.js.map +1 -0
- package/dist/cli/commands/solver-plugins-feedback.d.ts +72 -0
- package/dist/cli/commands/solver-plugins-feedback.js +262 -0
- package/dist/cli/commands/solver-plugins-feedback.js.map +1 -0
- package/dist/cli/commands/solver-plugins-read.d.ts +54 -0
- package/dist/cli/commands/solver-plugins-read.js +259 -0
- package/dist/cli/commands/solver-plugins-read.js.map +1 -0
- package/dist/cli/commands/solver-plugins.d.ts +35 -0
- package/dist/cli/commands/solver-plugins.js +399 -2
- package/dist/cli/commands/solver-plugins.js.map +1 -1
- package/dist/cli/commands/tasks.js +15 -2
- package/dist/cli/commands/tasks.js.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/task-native-readiness.d.ts +7 -0
- package/dist/cli/task-native-readiness.js +7 -5
- package/dist/cli/task-native-readiness.js.map +1 -1
- package/dist/config.d.ts +183 -232
- package/dist/config.js +232 -107
- package/dist/config.js.map +1 -1
- package/dist/daemon/ai-units-gate.d.ts +54 -0
- package/dist/daemon/ai-units-gate.js +82 -0
- package/dist/daemon/ai-units-gate.js.map +1 -0
- package/dist/daemon/creator.js +13 -0
- package/dist/daemon/creator.js.map +1 -1
- package/dist/daemon/daemon.d.ts +10 -0
- package/dist/daemon/daemon.js +203 -30
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/gate-logger.d.ts +9 -0
- package/dist/daemon/gate-logger.js +2 -0
- package/dist/daemon/gate-logger.js.map +1 -0
- package/dist/daemon/jinn-claim-loop.js +22 -4
- package/dist/daemon/jinn-claim-loop.js.map +1 -1
- package/dist/daemon/readiness-gate.d.ts +1 -4
- package/dist/daemon/readiness-gate.js.map +1 -1
- package/dist/daemon/spend-cap-gate.d.ts +40 -0
- package/dist/daemon/spend-cap-gate.js +46 -0
- package/dist/daemon/spend-cap-gate.js.map +1 -0
- package/dist/dashboard/assets/index-CzKxvMcU.css +32 -0
- package/dist/dashboard/assets/index-yVemxHot.js +351 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/discovery/http.js +328 -1
- package/dist/discovery/http.js.map +1 -1
- package/dist/discovery/onchain.js +42 -4
- package/dist/discovery/onchain.js.map +1 -1
- package/dist/discovery/types.d.ts +129 -0
- package/dist/discovery/types.js.map +1 -1
- package/dist/discovery/with-fallback.js +27 -0
- package/dist/discovery/with-fallback.js.map +1 -1
- package/dist/earning/bootstrap.d.ts +8 -3
- package/dist/earning/bootstrap.js +36 -13
- package/dist/earning/bootstrap.js.map +1 -1
- package/dist/earning/safe-adapter.js +23 -11
- package/dist/earning/safe-adapter.js.map +1 -1
- package/dist/earning/types.d.ts +6 -6
- package/dist/earning/viem-clients.d.ts +11 -4
- package/dist/earning/viem-clients.js +14 -5
- package/dist/earning/viem-clients.js.map +1 -1
- package/dist/erc8004/identity.d.ts +19 -3
- package/dist/erc8004/identity.js +38 -11
- package/dist/erc8004/identity.js.map +1 -1
- package/dist/erc8004/index.d.ts +1 -1
- package/dist/erc8004/index.js.map +1 -1
- package/dist/events/types.d.ts +2 -2
- package/dist/harnesses/cost-estimates.d.ts +10 -31
- package/dist/harnesses/cost-estimates.js +11 -43
- package/dist/harnesses/cost-estimates.js.map +1 -1
- package/dist/harnesses/engine/engine.d.ts +28 -4
- package/dist/harnesses/engine/engine.js +103 -17
- package/dist/harnesses/engine/engine.js.map +1 -1
- package/dist/harnesses/engine/persistence.d.ts +21 -4
- package/dist/harnesses/engine/persistence.js +43 -6
- package/dist/harnesses/engine/persistence.js.map +1 -1
- package/dist/harnesses/engine/state.d.ts +9 -0
- package/dist/harnesses/engine/state.js +23 -10
- package/dist/harnesses/engine/state.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/bootstrap.js +4 -2
- package/dist/harnesses/impls/hermes-agent/bootstrap.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/config-builder.d.ts +1 -1
- package/dist/harnesses/impls/hermes-agent/config-builder.js +4 -2
- package/dist/harnesses/impls/hermes-agent/config-builder.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/harness.d.ts +14 -0
- package/dist/harnesses/impls/hermes-agent/harness.js +16 -2
- package/dist/harnesses/impls/hermes-agent/harness.js.map +1 -1
- package/dist/harnesses/impls/hermes-agent/prompt.d.ts +6 -6
- package/dist/harnesses/impls/hermes-agent/prompt.js +6 -6
- package/dist/harnesses/impls/learner/adapters/claude-code.d.ts +17 -0
- package/dist/harnesses/impls/learner/adapters/claude-code.js +113 -14
- package/dist/harnesses/impls/learner/adapters/claude-code.js.map +1 -1
- package/dist/harnesses/impls/learner/adapters/codex-code.d.ts +9 -0
- package/dist/harnesses/impls/learner/adapters/codex-code.js +30 -8
- package/dist/harnesses/impls/learner/adapters/codex-code.js.map +1 -1
- package/dist/harnesses/impls/learner/harness.d.ts +24 -0
- package/dist/harnesses/impls/learner/harness.js +27 -3
- package/dist/harnesses/impls/learner/harness.js.map +1 -1
- package/dist/harnesses/impls/learner/harvest.d.ts +1 -1
- package/dist/harnesses/impls/learner/harvest.js +23 -5
- package/dist/harnesses/impls/learner/harvest.js.map +1 -1
- package/dist/harnesses/impls/learner/restoration-patch.d.ts +2 -2
- package/dist/harnesses/impls/learner/restoration-patch.js +25 -6
- package/dist/harnesses/impls/learner/restoration-patch.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js +21 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/eval-runner.js.map +1 -1
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.d.ts +74 -5
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js +103 -32
- package/dist/harnesses/impls/swe-rebench-v2-evaluator/hf-fetcher.js.map +1 -1
- package/dist/harnesses/readiness-registry.d.ts +7 -0
- package/dist/harnesses/readiness-registry.js +9 -0
- package/dist/harnesses/readiness-registry.js.map +1 -1
- package/dist/learner/revert-decision.d.ts +59 -0
- package/dist/learner/revert-decision.js +53 -0
- package/dist/learner/revert-decision.js.map +1 -0
- package/dist/learner/revert-stats.d.ts +24 -0
- package/dist/learner/revert-stats.js +44 -0
- package/dist/learner/revert-stats.js.map +1 -0
- package/dist/main.js +177 -104
- package/dist/main.js.map +1 -1
- package/dist/mcp/get-codedigest-reward.d.ts +13 -0
- package/dist/mcp/get-codedigest-reward.js +23 -0
- package/dist/mcp/get-codedigest-reward.js.map +1 -0
- package/dist/mcp/server.js +23 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/observability/debug-report-assemble.d.ts +43 -0
- package/dist/observability/debug-report-assemble.js +80 -0
- package/dist/observability/debug-report-assemble.js.map +1 -0
- package/dist/observability/emit-event.d.ts +9 -2
- package/dist/observability/emit-event.js +36 -2
- package/dist/observability/emit-event.js.map +1 -1
- package/dist/observability/file-logger.d.ts +69 -0
- package/dist/observability/file-logger.js +177 -0
- package/dist/observability/file-logger.js.map +1 -0
- package/dist/observability/redact-secrets.d.ts +65 -0
- package/dist/observability/redact-secrets.js +300 -0
- package/dist/observability/redact-secrets.js.map +1 -0
- package/dist/observability/tar.d.ts +30 -0
- package/dist/observability/tar.js +102 -0
- package/dist/observability/tar.js.map +1 -0
- package/dist/plugins/learner/skills/learn/consolidator-prompt.md +18 -1
- package/dist/plugins/learner/skills/learn/promoter-prompt.md +72 -1
- package/dist/preflight/pidfile-liveness.d.ts +44 -0
- package/dist/preflight/pidfile-liveness.js +103 -0
- package/dist/preflight/pidfile-liveness.js.map +1 -0
- package/dist/preflight/rpc-network.d.ts +40 -0
- package/dist/preflight/rpc-network.js +67 -1
- package/dist/preflight/rpc-network.js.map +1 -1
- package/dist/rpc/transport.d.ts +109 -0
- package/dist/rpc/transport.js +220 -0
- package/dist/rpc/transport.js.map +1 -0
- package/dist/scripts/donation-consumption-acceptance.js +7 -28
- package/dist/scripts/donation-consumption-acceptance.js.map +1 -1
- package/dist/scripts/swe-rebench-v2-pytest-missing.json +16 -0
- package/dist/solver-nets/prediction-operator-ux.d.ts +1 -2
- package/dist/solver-nets/prediction-operator-ux.js +56 -53
- package/dist/solver-nets/prediction-operator-ux.js.map +1 -1
- package/dist/solver-nets/registry.d.ts +19 -1
- package/dist/solver-nets/registry.js +37 -24
- package/dist/solver-nets/registry.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-pool.d.ts +9 -2
- package/dist/solver-types/_swe-rebench-v2-pool.js +15 -20
- package/dist/solver-types/_swe-rebench-v2-pool.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-state.d.ts +15 -0
- package/dist/solver-types/_swe-rebench-v2-state.js +19 -0
- package/dist/solver-types/_swe-rebench-v2-state.js.map +1 -1
- package/dist/solver-types/_swe-rebench-v2-validated-pool.d.ts +116 -2
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js +296 -21
- package/dist/solver-types/_swe-rebench-v2-validated-pool.js.map +1 -1
- package/dist/solver-types/swe-rebench-v2-auto.d.ts +20 -11
- package/dist/solver-types/swe-rebench-v2-auto.js +64 -19
- package/dist/solver-types/swe-rebench-v2-auto.js.map +1 -1
- package/dist/solver-types/swe-rebench-v2.d.ts +8 -2
- package/dist/solver-types/swe-rebench-v2.js +127 -11
- package/dist/solver-types/swe-rebench-v2.js.map +1 -1
- package/dist/solvernets/daemon-init.d.ts +1 -1
- package/dist/solvernets/daemon-init.js +19 -4
- package/dist/solvernets/daemon-init.js.map +1 -1
- package/dist/solvernets/launched-record-dispatcher.d.ts +4 -0
- package/dist/solvernets/launched-record-dispatcher.js +10 -4
- package/dist/solvernets/launched-record-dispatcher.js.map +1 -1
- package/dist/solvernets/registry-client-erc8004.js +11 -0
- package/dist/solvernets/registry-client-erc8004.js.map +1 -1
- package/dist/solvernets/store.d.ts +2 -2
- package/dist/spend/ai-units-config.d.ts +39 -0
- package/dist/spend/ai-units-config.js +28 -0
- package/dist/spend/ai-units-config.js.map +1 -0
- package/dist/spend/ai-units.d.ts +89 -0
- package/dist/spend/ai-units.js +156 -0
- package/dist/spend/ai-units.js.map +1 -0
- package/dist/spend/cost-surface-status.d.ts +12 -0
- package/dist/spend/cost-surface-status.js +24 -0
- package/dist/spend/cost-surface-status.js.map +1 -0
- package/dist/spend/credential.d.ts +39 -0
- package/dist/spend/credential.js +71 -0
- package/dist/spend/credential.js.map +1 -0
- package/dist/spend/daemon-config.d.ts +13 -0
- package/dist/spend/daemon-config.js +24 -0
- package/dist/spend/daemon-config.js.map +1 -0
- package/dist/spend/pricing.d.ts +16 -0
- package/dist/spend/pricing.js +26 -0
- package/dist/spend/pricing.js.map +1 -0
- package/dist/spend/record.d.ts +13 -0
- package/dist/spend/record.js +36 -0
- package/dist/spend/record.js.map +1 -0
- package/dist/spend/usage.d.ts +27 -0
- package/dist/spend/usage.js +113 -0
- package/dist/spend/usage.js.map +1 -0
- package/dist/store/store.d.ts +101 -0
- package/dist/store/store.js +304 -4
- package/dist/store/store.js.map +1 -1
- package/dist/trajectory/transcript-parsers/codex-session.d.ts +12 -6
- package/dist/trajectory/transcript-parsers/codex-session.js +114 -13
- package/dist/trajectory/transcript-parsers/codex-session.js.map +1 -1
- package/dist/trajectory/transcript-parsers/types.d.ts +8 -8
- package/dist/trajectory/transcript-session-dirs.d.ts +18 -0
- package/dist/trajectory/transcript-session-dirs.js +85 -0
- package/dist/trajectory/transcript-session-dirs.js.map +1 -0
- package/dist/trajectory/transcript-watcher.d.ts +20 -1
- package/dist/trajectory/transcript-watcher.js +108 -32
- package/dist/trajectory/transcript-watcher.js.map +1 -1
- package/dist/tx-retry.d.ts +25 -0
- package/dist/tx-retry.js +95 -7
- package/dist/tx-retry.js.map +1 -1
- package/dist/types/payloads/portfolio-v0.d.ts +3 -3
- package/dist/types/payloads/prediction-apy-v0.d.ts +3 -3
- package/dist/types/payloads/prediction-v0.d.ts +12 -12
- package/package.json +11 -3
- package/plugins/learner/skills/learn/consolidator-prompt.md +18 -1
- package/plugins/learner/skills/learn/promoter-prompt.md +72 -1
- package/plugins/swe-rebench-v2-diffmin/README.md +10 -9
- package/plugins/swe-rebench-v2-diffmin/jinn.plugin.json +1 -1
- package/plugins/swe-rebench-v2-diffmin/skills/diffmin/SKILL.md +15 -10
- package/plugins/swe-rebench-v2-diffmin/skills/test-map/SKILL.md +10 -12
- package/plugins/swe-rebench-v2-runtime/.claude-plugin/plugin.json +1 -1
- package/plugins/swe-rebench-v2-runtime/.codex-plugin/plugin.json +3 -3
- package/plugins/swe-rebench-v2-runtime/README.md +6 -6
- package/plugins/swe-rebench-v2-runtime/jinn.plugin.json +2 -3
- package/plugins/swe-rebench-v2-runtime/skills/task/SKILL.md +81 -0
- package/dist/dashboard/assets/index-BUlE8F3Y.js +0 -330
- package/dist/dashboard/assets/index-blqc7eqq.css +0 -32
- package/plugins/swe-rebench-v2-runtime/skills/orient/SKILL.md +0 -29
- package/plugins/swe-rebench-v2-runtime/skills/plan/SKILL.md +0 -53
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
var rv=e=>{throw TypeError(e)};var Ud=(e,t,r)=>t.has(e)||rv("Cannot "+r);var F=(e,t,r)=>(Ud(e,t,"read from private field"),r?r.call(e):t.get(e)),_e=(e,t,r)=>t.has(e)?rv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ue=(e,t,r,n)=>(Ud(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Ne=(e,t,r)=>(Ud(e,t,"access private method"),r);var lc=(e,t,r,n)=>({set _(s){ue(e,t,s,r)},get _(){return F(e,t,n)}});function gE(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();function Y_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Z_={exports:{}},Zu={},X_={exports:{}},Le={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var zl=Symbol.for("react.element"),vE=Symbol.for("react.portal"),xE=Symbol.for("react.fragment"),yE=Symbol.for("react.strict_mode"),_E=Symbol.for("react.profiler"),bE=Symbol.for("react.provider"),wE=Symbol.for("react.context"),SE=Symbol.for("react.forward_ref"),CE=Symbol.for("react.suspense"),kE=Symbol.for("react.memo"),EE=Symbol.for("react.lazy"),nv=Symbol.iterator;function jE(e){return e===null||typeof e!="object"?null:(e=nv&&e[nv]||e["@@iterator"],typeof e=="function"?e:null)}var J_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},e0=Object.assign,t0={};function ma(e,t,r){this.props=e,this.context=t,this.refs=t0,this.updater=r||J_}ma.prototype.isReactComponent={};ma.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ma.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function r0(){}r0.prototype=ma.prototype;function $p(e,t,r){this.props=e,this.context=t,this.refs=t0,this.updater=r||J_}var Hp=$p.prototype=new r0;Hp.constructor=$p;e0(Hp,ma.prototype);Hp.isPureReactComponent=!0;var sv=Array.isArray,n0=Object.prototype.hasOwnProperty,Up={current:null},s0={key:!0,ref:!0,__self:!0,__source:!0};function i0(e,t,r){var n,s={},i=null,l=null;if(t!=null)for(n in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)n0.call(t,n)&&!s0.hasOwnProperty(n)&&(s[n]=t[n]);var a=arguments.length-2;if(a===1)s.children=r;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(n in a=e.defaultProps,a)s[n]===void 0&&(s[n]=a[n]);return{$$typeof:zl,type:e,key:i,ref:l,props:s,_owner:Up.current}}function RE(e,t){return{$$typeof:zl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function zp(e){return typeof e=="object"&&e!==null&&e.$$typeof===zl}function NE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var iv=/\/+/g;function zd(e,t){return typeof e=="object"&&e!==null&&e.key!=null?NE(""+e.key):t.toString(36)}function $c(e,t,r,n,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case zl:case vE:l=!0}}if(l)return l=e,s=s(l),e=n===""?"."+zd(l,0):n,sv(s)?(r="",e!=null&&(r=e.replace(iv,"$&/")+"/"),$c(s,t,r,"",function(u){return u})):s!=null&&(zp(s)&&(s=RE(s,r+(!s.key||l&&l.key===s.key?"":(""+s.key).replace(iv,"$&/")+"/")+e)),t.push(s)),1;if(l=0,n=n===""?".":n+":",sv(e))for(var a=0;a<e.length;a++){i=e[a];var c=n+zd(i,a);l+=$c(i,t,r,c,s)}else if(c=jE(e),typeof c=="function")for(e=c.call(e),a=0;!(i=e.next()).done;)i=i.value,c=n+zd(i,a++),l+=$c(i,t,r,c,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function cc(e,t,r){if(e==null)return e;var n=[],s=0;return $c(e,n,"","",function(i){return t.call(r,i,s++)}),n}function PE(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Zt={current:null},Hc={transition:null},TE={ReactCurrentDispatcher:Zt,ReactCurrentBatchConfig:Hc,ReactCurrentOwner:Up};function o0(){throw Error("act(...) is not supported in production builds of React.")}Le.Children={map:cc,forEach:function(e,t,r){cc(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return cc(e,function(){t++}),t},toArray:function(e){return cc(e,function(t){return t})||[]},only:function(e){if(!zp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Le.Component=ma;Le.Fragment=xE;Le.Profiler=_E;Le.PureComponent=$p;Le.StrictMode=yE;Le.Suspense=CE;Le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=TE;Le.act=o0;Le.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=e0({},e.props),s=e.key,i=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,l=Up.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)n0.call(t,c)&&!s0.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];n.children=a}return{$$typeof:zl,type:e.type,key:s,ref:i,props:n,_owner:l}};Le.createContext=function(e){return e={$$typeof:wE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:bE,_context:e},e.Consumer=e};Le.createElement=i0;Le.createFactory=function(e){var t=i0.bind(null,e);return t.type=e,t};Le.createRef=function(){return{current:null}};Le.forwardRef=function(e){return{$$typeof:SE,render:e}};Le.isValidElement=zp;Le.lazy=function(e){return{$$typeof:EE,_payload:{_status:-1,_result:e},_init:PE}};Le.memo=function(e,t){return{$$typeof:kE,type:e,compare:t===void 0?null:t}};Le.startTransition=function(e){var t=Hc.transition;Hc.transition={};try{e()}finally{Hc.transition=t}};Le.unstable_act=o0;Le.useCallback=function(e,t){return Zt.current.useCallback(e,t)};Le.useContext=function(e){return Zt.current.useContext(e)};Le.useDebugValue=function(){};Le.useDeferredValue=function(e){return Zt.current.useDeferredValue(e)};Le.useEffect=function(e,t){return Zt.current.useEffect(e,t)};Le.useId=function(){return Zt.current.useId()};Le.useImperativeHandle=function(e,t,r){return Zt.current.useImperativeHandle(e,t,r)};Le.useInsertionEffect=function(e,t){return Zt.current.useInsertionEffect(e,t)};Le.useLayoutEffect=function(e,t){return Zt.current.useLayoutEffect(e,t)};Le.useMemo=function(e,t){return Zt.current.useMemo(e,t)};Le.useReducer=function(e,t,r){return Zt.current.useReducer(e,t,r)};Le.useRef=function(e){return Zt.current.useRef(e)};Le.useState=function(e){return Zt.current.useState(e)};Le.useSyncExternalStore=function(e,t,r){return Zt.current.useSyncExternalStore(e,t,r)};Le.useTransition=function(){return Zt.current.useTransition()};Le.version="18.3.1";X_.exports=Le;var C=X_.exports;const Z=Y_(C),Xu=gE({__proto__:null,default:Z},[C]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var AE=C,DE=Symbol.for("react.element"),LE=Symbol.for("react.fragment"),OE=Object.prototype.hasOwnProperty,ME=AE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,IE={key:!0,ref:!0,__self:!0,__source:!0};function a0(e,t,r){var n,s={},i=null,l=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(l=t.ref);for(n in t)OE.call(t,n)&&!IE.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:DE,type:e,key:i,ref:l,props:s,_owner:ME.current}}Zu.Fragment=LE;Zu.jsx=a0;Zu.jsxs=a0;Z_.exports=Zu;var o=Z_.exports,Wh={},l0={exports:{}},Rr={},c0={exports:{}},u0={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(R,P){var D=R.length;R.push(P);e:for(;0<D;){var M=D-1>>>1,V=R[M];if(0<s(V,P))R[M]=P,R[D]=V,D=M;else break e}}function r(R){return R.length===0?null:R[0]}function n(R){if(R.length===0)return null;var P=R[0],D=R.pop();if(D!==P){R[0]=D;e:for(var M=0,V=R.length,W=V>>>1;M<W;){var J=2*(M+1)-1,X=R[J],fe=J+1,A=R[fe];if(0>s(X,D))fe<V&&0>s(A,X)?(R[M]=A,R[fe]=D,M=fe):(R[M]=X,R[J]=D,M=J);else if(fe<V&&0>s(A,D))R[M]=A,R[fe]=D,M=fe;else break e}}return P}function s(R,P){var D=R.sortIndex-P.sortIndex;return D!==0?D:R.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var c=[],u=[],m=1,d=null,x=3,v=!1,_=!1,y=!1,h=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(R){for(var P=r(u);P!==null;){if(P.callback===null)n(u);else if(P.startTime<=R)n(u),P.sortIndex=P.expirationTime,t(c,P);else break;P=r(u)}}function b(R){if(y=!1,g(R),!_)if(r(c)!==null)_=!0,z(w);else{var P=r(u);P!==null&&K(b,P.startTime-R)}}function w(R,P){_=!1,y&&(y=!1,p(S),S=-1),v=!0;var D=x;try{for(g(P),d=r(c);d!==null&&(!(d.expirationTime>P)||R&&!O());){var M=d.callback;if(typeof M=="function"){d.callback=null,x=d.priorityLevel;var V=M(d.expirationTime<=P);P=e.unstable_now(),typeof V=="function"?d.callback=V:d===r(c)&&n(c),g(P)}else n(c);d=r(c)}if(d!==null)var W=!0;else{var J=r(u);J!==null&&K(b,J.startTime-P),W=!1}return W}finally{d=null,x=D,v=!1}}var k=!1,j=null,S=-1,E=5,N=-1;function O(){return!(e.unstable_now()-N<E)}function T(){if(j!==null){var R=e.unstable_now();N=R;var P=!0;try{P=j(!0,R)}finally{P?L():(k=!1,j=null)}}else k=!1}var L;if(typeof f=="function")L=function(){f(T)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,U=$.port2;$.port1.onmessage=T,L=function(){U.postMessage(null)}}else L=function(){h(T,0)};function z(R){j=R,k||(k=!0,L())}function K(R,P){S=h(function(){R(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){_||v||(_=!0,z(w))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(R){switch(x){case 1:case 2:case 3:var P=3;break;default:P=x}var D=x;x=P;try{return R()}finally{x=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,P){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var D=x;x=R;try{return P()}finally{x=D}},e.unstable_scheduleCallback=function(R,P,D){var M=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?M+D:M):D=M,R){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=D+V,R={id:m++,callback:P,priorityLevel:R,startTime:D,expirationTime:V,sortIndex:-1},D>M?(R.sortIndex=D,t(u,R),r(c)===null&&R===r(u)&&(y?(p(S),S=-1):y=!0,K(b,D-M))):(R.sortIndex=V,t(c,R),_||v||(_=!0,z(w))),R},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(R){var P=x;return function(){var D=x;x=P;try{return R.apply(this,arguments)}finally{x=D}}}})(u0);c0.exports=u0;var FE=c0.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var BE=C,Cr=FE;function ne(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var d0=new Set,dl={};function Hi(e,t){Xo(e,t),Xo(e+"Capture",t)}function Xo(e,t){for(dl[e]=t,e=0;e<t.length;e++)d0.add(t[e])}var Zn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vh=Object.prototype.hasOwnProperty,$E=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ov={},av={};function HE(e){return Vh.call(av,e)?!0:Vh.call(ov,e)?!1:$E.test(e)?av[e]=!0:(ov[e]=!0,!1)}function UE(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function zE(e,t,r,n){if(t===null||typeof t>"u"||UE(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Xt(e,t,r,n,s,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Lt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Lt[e]=new Xt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Lt[t]=new Xt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Lt[e]=new Xt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Lt[e]=new Xt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Lt[e]=new Xt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Lt[e]=new Xt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Lt[e]=new Xt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Lt[e]=new Xt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Lt[e]=new Xt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Wp=/[\-:]([a-z])/g;function Vp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Wp,Vp);Lt[t]=new Xt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Wp,Vp);Lt[t]=new Xt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Wp,Vp);Lt[t]=new Xt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Lt[e]=new Xt(e,1,!1,e.toLowerCase(),null,!1,!1)});Lt.xlinkHref=new Xt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Lt[e]=new Xt(e,1,!1,e.toLowerCase(),null,!0,!0)});function qp(e,t,r,n){var s=Lt.hasOwnProperty(t)?Lt[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(zE(t,r,s,n)&&(r=null),n||s===null?HE(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var is=BE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,uc=Symbol.for("react.element"),fo=Symbol.for("react.portal"),po=Symbol.for("react.fragment"),Kp=Symbol.for("react.strict_mode"),qh=Symbol.for("react.profiler"),h0=Symbol.for("react.provider"),f0=Symbol.for("react.context"),Gp=Symbol.for("react.forward_ref"),Kh=Symbol.for("react.suspense"),Gh=Symbol.for("react.suspense_list"),Qp=Symbol.for("react.memo"),gs=Symbol.for("react.lazy"),p0=Symbol.for("react.offscreen"),lv=Symbol.iterator;function Ra(e){return e===null||typeof e!="object"?null:(e=lv&&e[lv]||e["@@iterator"],typeof e=="function"?e:null)}var ut=Object.assign,Wd;function Va(e){if(Wd===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Wd=t&&t[1]||""}return`
|
|
34
|
+
`+Wd+e}var Vd=!1;function qd(e,t){if(!e||Vd)return"";Vd=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var s=u.stack.split(`
|
|
35
|
+
`),i=n.stack.split(`
|
|
36
|
+
`),l=s.length-1,a=i.length-1;1<=l&&0<=a&&s[l]!==i[a];)a--;for(;1<=l&&0<=a;l--,a--)if(s[l]!==i[a]){if(l!==1||a!==1)do if(l--,a--,0>a||s[l]!==i[a]){var c=`
|
|
37
|
+
`+s[l].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=l&&0<=a);break}}}finally{Vd=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Va(e):""}function WE(e){switch(e.tag){case 5:return Va(e.type);case 16:return Va("Lazy");case 13:return Va("Suspense");case 19:return Va("SuspenseList");case 0:case 2:case 15:return e=qd(e.type,!1),e;case 11:return e=qd(e.type.render,!1),e;case 1:return e=qd(e.type,!0),e;default:return""}}function Qh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case po:return"Fragment";case fo:return"Portal";case qh:return"Profiler";case Kp:return"StrictMode";case Kh:return"Suspense";case Gh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case f0:return(e.displayName||"Context")+".Consumer";case h0:return(e._context.displayName||"Context")+".Provider";case Gp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Qp:return t=e.displayName||null,t!==null?t:Qh(e.type)||"Memo";case gs:t=e._payload,e=e._init;try{return Qh(e(t))}catch{}}return null}function VE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qh(t);case 8:return t===Kp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Qs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function m0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qE(e){var t=m0(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(l){n=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(l){n=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function dc(e){e._valueTracker||(e._valueTracker=qE(e))}function g0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=m0(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function ru(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Yh(e,t){var r=t.checked;return ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function cv(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Qs(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function v0(e,t){t=t.checked,t!=null&&qp(e,"checked",t,!1)}function Zh(e,t){v0(e,t);var r=Qs(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Xh(e,t.type,r):t.hasOwnProperty("defaultValue")&&Xh(e,t.type,Qs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function uv(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Xh(e,t,r){(t!=="number"||ru(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var qa=Array.isArray;function Eo(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Qs(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Jh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ne(91));return ut({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function dv(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(ne(92));if(qa(r)){if(1<r.length)throw Error(ne(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Qs(r)}}function x0(e,t){var r=Qs(t.value),n=Qs(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function hv(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function y0(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ef(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?y0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var hc,_0=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(hc=hc||document.createElement("div"),hc.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=hc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function hl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ja={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},KE=["Webkit","ms","Moz","O"];Object.keys(Ja).forEach(function(e){KE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ja[t]=Ja[e]})});function b0(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ja.hasOwnProperty(e)&&Ja[e]?(""+t).trim():t+"px"}function w0(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=b0(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var GE=ut({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function tf(e,t){if(t){if(GE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ne(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ne(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ne(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ne(62))}}function rf(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var nf=null;function Yp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var sf=null,jo=null,Ro=null;function fv(e){if(e=ql(e)){if(typeof sf!="function")throw Error(ne(280));var t=e.stateNode;t&&(t=nd(t),sf(e.stateNode,e.type,t))}}function S0(e){jo?Ro?Ro.push(e):Ro=[e]:jo=e}function C0(){if(jo){var e=jo,t=Ro;if(Ro=jo=null,fv(e),t)for(e=0;e<t.length;e++)fv(t[e])}}function k0(e,t){return e(t)}function E0(){}var Kd=!1;function j0(e,t,r){if(Kd)return e(t,r);Kd=!0;try{return k0(e,t,r)}finally{Kd=!1,(jo!==null||Ro!==null)&&(E0(),C0())}}function fl(e,t){var r=e.stateNode;if(r===null)return null;var n=nd(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(ne(231,t,typeof r));return r}var of=!1;if(Zn)try{var Na={};Object.defineProperty(Na,"passive",{get:function(){of=!0}}),window.addEventListener("test",Na,Na),window.removeEventListener("test",Na,Na)}catch{of=!1}function QE(e,t,r,n,s,i,l,a,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(m){this.onError(m)}}var el=!1,nu=null,su=!1,af=null,YE={onError:function(e){el=!0,nu=e}};function ZE(e,t,r,n,s,i,l,a,c){el=!1,nu=null,QE.apply(YE,arguments)}function XE(e,t,r,n,s,i,l,a,c){if(ZE.apply(this,arguments),el){if(el){var u=nu;el=!1,nu=null}else throw Error(ne(198));su||(su=!0,af=u)}}function Ui(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function R0(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function pv(e){if(Ui(e)!==e)throw Error(ne(188))}function JE(e){var t=e.alternate;if(!t){if(t=Ui(e),t===null)throw Error(ne(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===r)return pv(s),e;if(i===n)return pv(s),t;i=i.sibling}throw Error(ne(188))}if(r.return!==n.return)r=s,n=i;else{for(var l=!1,a=s.child;a;){if(a===r){l=!0,r=s,n=i;break}if(a===n){l=!0,n=s,r=i;break}a=a.sibling}if(!l){for(a=i.child;a;){if(a===r){l=!0,r=i,n=s;break}if(a===n){l=!0,n=i,r=s;break}a=a.sibling}if(!l)throw Error(ne(189))}}if(r.alternate!==n)throw Error(ne(190))}if(r.tag!==3)throw Error(ne(188));return r.stateNode.current===r?e:t}function N0(e){return e=JE(e),e!==null?P0(e):null}function P0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=P0(e);if(t!==null)return t;e=e.sibling}return null}var T0=Cr.unstable_scheduleCallback,mv=Cr.unstable_cancelCallback,ej=Cr.unstable_shouldYield,tj=Cr.unstable_requestPaint,mt=Cr.unstable_now,rj=Cr.unstable_getCurrentPriorityLevel,Zp=Cr.unstable_ImmediatePriority,A0=Cr.unstable_UserBlockingPriority,iu=Cr.unstable_NormalPriority,nj=Cr.unstable_LowPriority,D0=Cr.unstable_IdlePriority,Ju=null,Rn=null;function sj(e){if(Rn&&typeof Rn.onCommitFiberRoot=="function")try{Rn.onCommitFiberRoot(Ju,e,void 0,(e.current.flags&128)===128)}catch{}}var ln=Math.clz32?Math.clz32:aj,ij=Math.log,oj=Math.LN2;function aj(e){return e>>>=0,e===0?32:31-(ij(e)/oj|0)|0}var fc=64,pc=4194304;function Ka(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ou(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,i=e.pingedLanes,l=r&268435455;if(l!==0){var a=l&~s;a!==0?n=Ka(a):(i&=l,i!==0&&(n=Ka(i)))}else l=r&~s,l!==0?n=Ka(l):i!==0&&(n=Ka(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-ln(t),s=1<<r,n|=e[r],t&=~s;return n}function lj(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function cj(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var l=31-ln(i),a=1<<l,c=s[l];c===-1?(!(a&r)||a&n)&&(s[l]=lj(a,t)):c<=t&&(e.expiredLanes|=a),i&=~a}}function lf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function L0(){var e=fc;return fc<<=1,!(fc&4194240)&&(fc=64),e}function Gd(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Wl(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ln(t),e[t]=r}function uj(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-ln(r),i=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~i}}function Xp(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-ln(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var qe=0;function O0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var M0,Jp,I0,F0,B0,cf=!1,mc=[],Ms=null,Is=null,Fs=null,pl=new Map,ml=new Map,bs=[],dj="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function gv(e,t){switch(e){case"focusin":case"focusout":Ms=null;break;case"dragenter":case"dragleave":Is=null;break;case"mouseover":case"mouseout":Fs=null;break;case"pointerover":case"pointerout":pl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ml.delete(t.pointerId)}}function Pa(e,t,r,n,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},t!==null&&(t=ql(t),t!==null&&Jp(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function hj(e,t,r,n,s){switch(t){case"focusin":return Ms=Pa(Ms,e,t,r,n,s),!0;case"dragenter":return Is=Pa(Is,e,t,r,n,s),!0;case"mouseover":return Fs=Pa(Fs,e,t,r,n,s),!0;case"pointerover":var i=s.pointerId;return pl.set(i,Pa(pl.get(i)||null,e,t,r,n,s)),!0;case"gotpointercapture":return i=s.pointerId,ml.set(i,Pa(ml.get(i)||null,e,t,r,n,s)),!0}return!1}function $0(e){var t=mi(e.target);if(t!==null){var r=Ui(t);if(r!==null){if(t=r.tag,t===13){if(t=R0(r),t!==null){e.blockedOn=t,B0(e.priority,function(){I0(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Uc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=uf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);nf=n,r.target.dispatchEvent(n),nf=null}else return t=ql(r),t!==null&&Jp(t),e.blockedOn=r,!1;t.shift()}return!0}function vv(e,t,r){Uc(e)&&r.delete(t)}function fj(){cf=!1,Ms!==null&&Uc(Ms)&&(Ms=null),Is!==null&&Uc(Is)&&(Is=null),Fs!==null&&Uc(Fs)&&(Fs=null),pl.forEach(vv),ml.forEach(vv)}function Ta(e,t){e.blockedOn===t&&(e.blockedOn=null,cf||(cf=!0,Cr.unstable_scheduleCallback(Cr.unstable_NormalPriority,fj)))}function gl(e){function t(s){return Ta(s,e)}if(0<mc.length){Ta(mc[0],e);for(var r=1;r<mc.length;r++){var n=mc[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Ms!==null&&Ta(Ms,e),Is!==null&&Ta(Is,e),Fs!==null&&Ta(Fs,e),pl.forEach(t),ml.forEach(t),r=0;r<bs.length;r++)n=bs[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<bs.length&&(r=bs[0],r.blockedOn===null);)$0(r),r.blockedOn===null&&bs.shift()}var No=is.ReactCurrentBatchConfig,au=!0;function pj(e,t,r,n){var s=qe,i=No.transition;No.transition=null;try{qe=1,em(e,t,r,n)}finally{qe=s,No.transition=i}}function mj(e,t,r,n){var s=qe,i=No.transition;No.transition=null;try{qe=4,em(e,t,r,n)}finally{qe=s,No.transition=i}}function em(e,t,r,n){if(au){var s=uf(e,t,r,n);if(s===null)sh(e,t,n,lu,r),gv(e,n);else if(hj(s,e,t,r,n))n.stopPropagation();else if(gv(e,n),t&4&&-1<dj.indexOf(e)){for(;s!==null;){var i=ql(s);if(i!==null&&M0(i),i=uf(e,t,r,n),i===null&&sh(e,t,n,lu,r),i===s)break;s=i}s!==null&&n.stopPropagation()}else sh(e,t,n,null,r)}}var lu=null;function uf(e,t,r,n){if(lu=null,e=Yp(n),e=mi(e),e!==null)if(t=Ui(e),t===null)e=null;else if(r=t.tag,r===13){if(e=R0(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return lu=e,null}function H0(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(rj()){case Zp:return 1;case A0:return 4;case iu:case nj:return 16;case D0:return 536870912;default:return 16}default:return 16}}var As=null,tm=null,zc=null;function U0(){if(zc)return zc;var e,t=tm,r=t.length,n,s="value"in As?As.value:As.textContent,i=s.length;for(e=0;e<r&&t[e]===s[e];e++);var l=r-e;for(n=1;n<=l&&t[r-n]===s[i-n];n++);return zc=s.slice(e,1<n?1-n:void 0)}function Wc(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function gc(){return!0}function xv(){return!1}function Nr(e){function t(r,n,s,i,l){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=l,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(r=e[a],this[a]=r?r(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?gc:xv,this.isPropagationStopped=xv,this}return ut(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=gc)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=gc)},persist:function(){},isPersistent:gc}),t}var ga={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rm=Nr(ga),Vl=ut({},ga,{view:0,detail:0}),gj=Nr(Vl),Qd,Yd,Aa,ed=ut({},Vl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nm,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Aa&&(Aa&&e.type==="mousemove"?(Qd=e.screenX-Aa.screenX,Yd=e.screenY-Aa.screenY):Yd=Qd=0,Aa=e),Qd)},movementY:function(e){return"movementY"in e?e.movementY:Yd}}),yv=Nr(ed),vj=ut({},ed,{dataTransfer:0}),xj=Nr(vj),yj=ut({},Vl,{relatedTarget:0}),Zd=Nr(yj),_j=ut({},ga,{animationName:0,elapsedTime:0,pseudoElement:0}),bj=Nr(_j),wj=ut({},ga,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Sj=Nr(wj),Cj=ut({},ga,{data:0}),_v=Nr(Cj),kj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ej={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},jj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Rj(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jj[e])?!!t[e]:!1}function nm(){return Rj}var Nj=ut({},Vl,{key:function(e){if(e.key){var t=kj[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ej[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nm,charCode:function(e){return e.type==="keypress"?Wc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Pj=Nr(Nj),Tj=ut({},ed,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bv=Nr(Tj),Aj=ut({},Vl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nm}),Dj=Nr(Aj),Lj=ut({},ga,{propertyName:0,elapsedTime:0,pseudoElement:0}),Oj=Nr(Lj),Mj=ut({},ed,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ij=Nr(Mj),Fj=[9,13,27,32],sm=Zn&&"CompositionEvent"in window,tl=null;Zn&&"documentMode"in document&&(tl=document.documentMode);var Bj=Zn&&"TextEvent"in window&&!tl,z0=Zn&&(!sm||tl&&8<tl&&11>=tl),wv=" ",Sv=!1;function W0(e,t){switch(e){case"keyup":return Fj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function V0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var mo=!1;function $j(e,t){switch(e){case"compositionend":return V0(t);case"keypress":return t.which!==32?null:(Sv=!0,wv);case"textInput":return e=t.data,e===wv&&Sv?null:e;default:return null}}function Hj(e,t){if(mo)return e==="compositionend"||!sm&&W0(e,t)?(e=U0(),zc=tm=As=null,mo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return z0&&t.locale!=="ko"?null:t.data;default:return null}}var Uj={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Cv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Uj[e.type]:t==="textarea"}function q0(e,t,r,n){S0(n),t=cu(t,"onChange"),0<t.length&&(r=new rm("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var rl=null,vl=null;function zj(e){nb(e,0)}function td(e){var t=xo(e);if(g0(t))return e}function Wj(e,t){if(e==="change")return t}var K0=!1;if(Zn){var Xd;if(Zn){var Jd="oninput"in document;if(!Jd){var kv=document.createElement("div");kv.setAttribute("oninput","return;"),Jd=typeof kv.oninput=="function"}Xd=Jd}else Xd=!1;K0=Xd&&(!document.documentMode||9<document.documentMode)}function Ev(){rl&&(rl.detachEvent("onpropertychange",G0),vl=rl=null)}function G0(e){if(e.propertyName==="value"&&td(vl)){var t=[];q0(t,vl,e,Yp(e)),j0(zj,t)}}function Vj(e,t,r){e==="focusin"?(Ev(),rl=t,vl=r,rl.attachEvent("onpropertychange",G0)):e==="focusout"&&Ev()}function qj(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return td(vl)}function Kj(e,t){if(e==="click")return td(t)}function Gj(e,t){if(e==="input"||e==="change")return td(t)}function Qj(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hn=typeof Object.is=="function"?Object.is:Qj;function xl(e,t){if(hn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!Vh.call(t,s)||!hn(e[s],t[s]))return!1}return!0}function jv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rv(e,t){var r=jv(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=jv(r)}}function Q0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Q0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Y0(){for(var e=window,t=ru();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ru(e.document)}return t}function im(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Yj(e){var t=Y0(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Q0(r.ownerDocument.documentElement,r)){if(n!==null&&im(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,i=Math.min(n.start,s);n=n.end===void 0?i:Math.min(n.end,s),!e.extend&&i>n&&(s=n,n=i,i=s),s=Rv(r,i);var l=Rv(r,n);s&&l&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Zj=Zn&&"documentMode"in document&&11>=document.documentMode,go=null,df=null,nl=null,hf=!1;function Nv(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;hf||go==null||go!==ru(n)||(n=go,"selectionStart"in n&&im(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),nl&&xl(nl,n)||(nl=n,n=cu(df,"onSelect"),0<n.length&&(t=new rm("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=go)))}function vc(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var vo={animationend:vc("Animation","AnimationEnd"),animationiteration:vc("Animation","AnimationIteration"),animationstart:vc("Animation","AnimationStart"),transitionend:vc("Transition","TransitionEnd")},eh={},Z0={};Zn&&(Z0=document.createElement("div").style,"AnimationEvent"in window||(delete vo.animationend.animation,delete vo.animationiteration.animation,delete vo.animationstart.animation),"TransitionEvent"in window||delete vo.transitionend.transition);function rd(e){if(eh[e])return eh[e];if(!vo[e])return e;var t=vo[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Z0)return eh[e]=t[r];return e}var X0=rd("animationend"),J0=rd("animationiteration"),eb=rd("animationstart"),tb=rd("transitionend"),rb=new Map,Pv="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ri(e,t){rb.set(e,t),Hi(t,[e])}for(var th=0;th<Pv.length;th++){var rh=Pv[th],Xj=rh.toLowerCase(),Jj=rh[0].toUpperCase()+rh.slice(1);ri(Xj,"on"+Jj)}ri(X0,"onAnimationEnd");ri(J0,"onAnimationIteration");ri(eb,"onAnimationStart");ri("dblclick","onDoubleClick");ri("focusin","onFocus");ri("focusout","onBlur");ri(tb,"onTransitionEnd");Xo("onMouseEnter",["mouseout","mouseover"]);Xo("onMouseLeave",["mouseout","mouseover"]);Xo("onPointerEnter",["pointerout","pointerover"]);Xo("onPointerLeave",["pointerout","pointerover"]);Hi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Hi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Hi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Hi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Hi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Hi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ga="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),eR=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ga));function Tv(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,XE(n,t,void 0,e),e.currentTarget=null}function nb(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var l=n.length-1;0<=l;l--){var a=n[l],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==i&&s.isPropagationStopped())break e;Tv(s,a,u),i=c}else for(l=0;l<n.length;l++){if(a=n[l],c=a.instance,u=a.currentTarget,a=a.listener,c!==i&&s.isPropagationStopped())break e;Tv(s,a,u),i=c}}}if(su)throw e=af,su=!1,af=null,e}function tt(e,t){var r=t[vf];r===void 0&&(r=t[vf]=new Set);var n=e+"__bubble";r.has(n)||(sb(t,e,2,!1),r.add(n))}function nh(e,t,r){var n=0;t&&(n|=4),sb(r,e,n,t)}var xc="_reactListening"+Math.random().toString(36).slice(2);function yl(e){if(!e[xc]){e[xc]=!0,d0.forEach(function(r){r!=="selectionchange"&&(eR.has(r)||nh(r,!1,e),nh(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xc]||(t[xc]=!0,nh("selectionchange",!1,t))}}function sb(e,t,r,n){switch(H0(t)){case 1:var s=pj;break;case 4:s=mj;break;default:s=em}r=s.bind(null,t,r,e),s=void 0,!of||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function sh(e,t,r,n,s){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var l=n.tag;if(l===3||l===4){var a=n.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(l===4)for(l=n.return;l!==null;){var c=l.tag;if((c===3||c===4)&&(c=l.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;l=l.return}for(;a!==null;){if(l=mi(a),l===null)return;if(c=l.tag,c===5||c===6){n=i=l;continue e}a=a.parentNode}}n=n.return}j0(function(){var u=i,m=Yp(r),d=[];e:{var x=rb.get(e);if(x!==void 0){var v=rm,_=e;switch(e){case"keypress":if(Wc(r)===0)break e;case"keydown":case"keyup":v=Pj;break;case"focusin":_="focus",v=Zd;break;case"focusout":_="blur",v=Zd;break;case"beforeblur":case"afterblur":v=Zd;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":v=yv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=xj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=Dj;break;case X0:case J0:case eb:v=bj;break;case tb:v=Oj;break;case"scroll":v=gj;break;case"wheel":v=Ij;break;case"copy":case"cut":case"paste":v=Sj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=bv}var y=(t&4)!==0,h=!y&&e==="scroll",p=y?x!==null?x+"Capture":null:x;y=[];for(var f=u,g;f!==null;){g=f;var b=g.stateNode;if(g.tag===5&&b!==null&&(g=b,p!==null&&(b=fl(f,p),b!=null&&y.push(_l(f,b,g)))),h)break;f=f.return}0<y.length&&(x=new v(x,_,null,r,m),d.push({event:x,listeners:y}))}}if(!(t&7)){e:{if(x=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",x&&r!==nf&&(_=r.relatedTarget||r.fromElement)&&(mi(_)||_[Xn]))break e;if((v||x)&&(x=m.window===m?m:(x=m.ownerDocument)?x.defaultView||x.parentWindow:window,v?(_=r.relatedTarget||r.toElement,v=u,_=_?mi(_):null,_!==null&&(h=Ui(_),_!==h||_.tag!==5&&_.tag!==6)&&(_=null)):(v=null,_=u),v!==_)){if(y=yv,b="onMouseLeave",p="onMouseEnter",f="mouse",(e==="pointerout"||e==="pointerover")&&(y=bv,b="onPointerLeave",p="onPointerEnter",f="pointer"),h=v==null?x:xo(v),g=_==null?x:xo(_),x=new y(b,f+"leave",v,r,m),x.target=h,x.relatedTarget=g,b=null,mi(m)===u&&(y=new y(p,f+"enter",_,r,m),y.target=g,y.relatedTarget=h,b=y),h=b,v&&_)t:{for(y=v,p=_,f=0,g=y;g;g=Xi(g))f++;for(g=0,b=p;b;b=Xi(b))g++;for(;0<f-g;)y=Xi(y),f--;for(;0<g-f;)p=Xi(p),g--;for(;f--;){if(y===p||p!==null&&y===p.alternate)break t;y=Xi(y),p=Xi(p)}y=null}else y=null;v!==null&&Av(d,x,v,y,!1),_!==null&&h!==null&&Av(d,h,_,y,!0)}}e:{if(x=u?xo(u):window,v=x.nodeName&&x.nodeName.toLowerCase(),v==="select"||v==="input"&&x.type==="file")var w=Wj;else if(Cv(x))if(K0)w=Gj;else{w=qj;var k=Vj}else(v=x.nodeName)&&v.toLowerCase()==="input"&&(x.type==="checkbox"||x.type==="radio")&&(w=Kj);if(w&&(w=w(e,u))){q0(d,w,r,m);break e}k&&k(e,x,u),e==="focusout"&&(k=x._wrapperState)&&k.controlled&&x.type==="number"&&Xh(x,"number",x.value)}switch(k=u?xo(u):window,e){case"focusin":(Cv(k)||k.contentEditable==="true")&&(go=k,df=u,nl=null);break;case"focusout":nl=df=go=null;break;case"mousedown":hf=!0;break;case"contextmenu":case"mouseup":case"dragend":hf=!1,Nv(d,r,m);break;case"selectionchange":if(Zj)break;case"keydown":case"keyup":Nv(d,r,m)}var j;if(sm)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else mo?W0(e,r)&&(S="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(z0&&r.locale!=="ko"&&(mo||S!=="onCompositionStart"?S==="onCompositionEnd"&&mo&&(j=U0()):(As=m,tm="value"in As?As.value:As.textContent,mo=!0)),k=cu(u,S),0<k.length&&(S=new _v(S,e,null,r,m),d.push({event:S,listeners:k}),j?S.data=j:(j=V0(r),j!==null&&(S.data=j)))),(j=Bj?$j(e,r):Hj(e,r))&&(u=cu(u,"onBeforeInput"),0<u.length&&(m=new _v("onBeforeInput","beforeinput",null,r,m),d.push({event:m,listeners:u}),m.data=j))}nb(d,t)})}function _l(e,t,r){return{instance:e,listener:t,currentTarget:r}}function cu(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=fl(e,r),i!=null&&n.unshift(_l(e,i,s)),i=fl(e,t),i!=null&&n.push(_l(e,i,s))),e=e.return}return n}function Xi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Av(e,t,r,n,s){for(var i=t._reactName,l=[];r!==null&&r!==n;){var a=r,c=a.alternate,u=a.stateNode;if(c!==null&&c===n)break;a.tag===5&&u!==null&&(a=u,s?(c=fl(r,i),c!=null&&l.unshift(_l(r,c,a))):s||(c=fl(r,i),c!=null&&l.push(_l(r,c,a)))),r=r.return}l.length!==0&&e.push({event:t,listeners:l})}var tR=/\r\n?/g,rR=/\u0000|\uFFFD/g;function Dv(e){return(typeof e=="string"?e:""+e).replace(tR,`
|
|
38
|
+
`).replace(rR,"")}function yc(e,t,r){if(t=Dv(t),Dv(e)!==t&&r)throw Error(ne(425))}function uu(){}var ff=null,pf=null;function mf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var gf=typeof setTimeout=="function"?setTimeout:void 0,nR=typeof clearTimeout=="function"?clearTimeout:void 0,Lv=typeof Promise=="function"?Promise:void 0,sR=typeof queueMicrotask=="function"?queueMicrotask:typeof Lv<"u"?function(e){return Lv.resolve(null).then(e).catch(iR)}:gf;function iR(e){setTimeout(function(){throw e})}function ih(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),gl(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);gl(t)}function Bs(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Ov(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var va=Math.random().toString(36).slice(2),Cn="__reactFiber$"+va,bl="__reactProps$"+va,Xn="__reactContainer$"+va,vf="__reactEvents$"+va,oR="__reactListeners$"+va,aR="__reactHandles$"+va;function mi(e){var t=e[Cn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Xn]||r[Cn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Ov(e);e!==null;){if(r=e[Cn])return r;e=Ov(e)}return t}e=r,r=e.parentNode}return null}function ql(e){return e=e[Cn]||e[Xn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function xo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ne(33))}function nd(e){return e[bl]||null}var xf=[],yo=-1;function ni(e){return{current:e}}function nt(e){0>yo||(e.current=xf[yo],xf[yo]=null,yo--)}function Ze(e,t){yo++,xf[yo]=e.current,e.current=t}var Ys={},zt=ni(Ys),or=ni(!1),Ai=Ys;function Jo(e,t){var r=e.type.contextTypes;if(!r)return Ys;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in r)s[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function ar(e){return e=e.childContextTypes,e!=null}function du(){nt(or),nt(zt)}function Mv(e,t,r){if(zt.current!==Ys)throw Error(ne(168));Ze(zt,t),Ze(or,r)}function ib(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(ne(108,VE(e)||"Unknown",s));return ut({},r,n)}function hu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ys,Ai=zt.current,Ze(zt,e),Ze(or,or.current),!0}function Iv(e,t,r){var n=e.stateNode;if(!n)throw Error(ne(169));r?(e=ib(e,t,Ai),n.__reactInternalMemoizedMergedChildContext=e,nt(or),nt(zt),Ze(zt,e)):nt(or),Ze(or,r)}var Hn=null,sd=!1,oh=!1;function ob(e){Hn===null?Hn=[e]:Hn.push(e)}function lR(e){sd=!0,ob(e)}function si(){if(!oh&&Hn!==null){oh=!0;var e=0,t=qe;try{var r=Hn;for(qe=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Hn=null,sd=!1}catch(s){throw Hn!==null&&(Hn=Hn.slice(e+1)),T0(Zp,si),s}finally{qe=t,oh=!1}}return null}var _o=[],bo=0,fu=null,pu=0,Tr=[],Ar=0,Di=null,qn=1,Kn="";function fi(e,t){_o[bo++]=pu,_o[bo++]=fu,fu=e,pu=t}function ab(e,t,r){Tr[Ar++]=qn,Tr[Ar++]=Kn,Tr[Ar++]=Di,Di=e;var n=qn;e=Kn;var s=32-ln(n)-1;n&=~(1<<s),r+=1;var i=32-ln(t)+s;if(30<i){var l=s-s%5;i=(n&(1<<l)-1).toString(32),n>>=l,s-=l,qn=1<<32-ln(t)+s|r<<s|n,Kn=i+e}else qn=1<<i|r<<s|n,Kn=e}function om(e){e.return!==null&&(fi(e,1),ab(e,1,0))}function am(e){for(;e===fu;)fu=_o[--bo],_o[bo]=null,pu=_o[--bo],_o[bo]=null;for(;e===Di;)Di=Tr[--Ar],Tr[Ar]=null,Kn=Tr[--Ar],Tr[Ar]=null,qn=Tr[--Ar],Tr[Ar]=null}var br=null,_r=null,it=!1,tn=null;function lb(e,t){var r=Dr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Fv(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,br=e,_r=Bs(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,br=e,_r=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Di!==null?{id:qn,overflow:Kn}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Dr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,br=e,_r=null,!0):!1;default:return!1}}function yf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _f(e){if(it){var t=_r;if(t){var r=t;if(!Fv(e,t)){if(yf(e))throw Error(ne(418));t=Bs(r.nextSibling);var n=br;t&&Fv(e,t)?lb(n,r):(e.flags=e.flags&-4097|2,it=!1,br=e)}}else{if(yf(e))throw Error(ne(418));e.flags=e.flags&-4097|2,it=!1,br=e}}}function Bv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;br=e}function _c(e){if(e!==br)return!1;if(!it)return Bv(e),it=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!mf(e.type,e.memoizedProps)),t&&(t=_r)){if(yf(e))throw cb(),Error(ne(418));for(;t;)lb(e,t),t=Bs(t.nextSibling)}if(Bv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ne(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){_r=Bs(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}_r=null}}else _r=br?Bs(e.stateNode.nextSibling):null;return!0}function cb(){for(var e=_r;e;)e=Bs(e.nextSibling)}function ea(){_r=br=null,it=!1}function lm(e){tn===null?tn=[e]:tn.push(e)}var cR=is.ReactCurrentBatchConfig;function Da(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(ne(309));var n=r.stateNode}if(!n)throw Error(ne(147,e));var s=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(l){var a=s.refs;l===null?delete a[i]:a[i]=l},t._stringRef=i,t)}if(typeof e!="string")throw Error(ne(284));if(!r._owner)throw Error(ne(290,e))}return e}function bc(e,t){throw e=Object.prototype.toString.call(t),Error(ne(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function $v(e){var t=e._init;return t(e._payload)}function ub(e){function t(p,f){if(e){var g=p.deletions;g===null?(p.deletions=[f],p.flags|=16):g.push(f)}}function r(p,f){if(!e)return null;for(;f!==null;)t(p,f),f=f.sibling;return null}function n(p,f){for(p=new Map;f!==null;)f.key!==null?p.set(f.key,f):p.set(f.index,f),f=f.sibling;return p}function s(p,f){return p=zs(p,f),p.index=0,p.sibling=null,p}function i(p,f,g){return p.index=g,e?(g=p.alternate,g!==null?(g=g.index,g<f?(p.flags|=2,f):g):(p.flags|=2,f)):(p.flags|=1048576,f)}function l(p){return e&&p.alternate===null&&(p.flags|=2),p}function a(p,f,g,b){return f===null||f.tag!==6?(f=fh(g,p.mode,b),f.return=p,f):(f=s(f,g),f.return=p,f)}function c(p,f,g,b){var w=g.type;return w===po?m(p,f,g.props.children,b,g.key):f!==null&&(f.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===gs&&$v(w)===f.type)?(b=s(f,g.props),b.ref=Da(p,f,g),b.return=p,b):(b=Zc(g.type,g.key,g.props,null,p.mode,b),b.ref=Da(p,f,g),b.return=p,b)}function u(p,f,g,b){return f===null||f.tag!==4||f.stateNode.containerInfo!==g.containerInfo||f.stateNode.implementation!==g.implementation?(f=ph(g,p.mode,b),f.return=p,f):(f=s(f,g.children||[]),f.return=p,f)}function m(p,f,g,b,w){return f===null||f.tag!==7?(f=Ti(g,p.mode,b,w),f.return=p,f):(f=s(f,g),f.return=p,f)}function d(p,f,g){if(typeof f=="string"&&f!==""||typeof f=="number")return f=fh(""+f,p.mode,g),f.return=p,f;if(typeof f=="object"&&f!==null){switch(f.$$typeof){case uc:return g=Zc(f.type,f.key,f.props,null,p.mode,g),g.ref=Da(p,null,f),g.return=p,g;case fo:return f=ph(f,p.mode,g),f.return=p,f;case gs:var b=f._init;return d(p,b(f._payload),g)}if(qa(f)||Ra(f))return f=Ti(f,p.mode,g,null),f.return=p,f;bc(p,f)}return null}function x(p,f,g,b){var w=f!==null?f.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return w!==null?null:a(p,f,""+g,b);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case uc:return g.key===w?c(p,f,g,b):null;case fo:return g.key===w?u(p,f,g,b):null;case gs:return w=g._init,x(p,f,w(g._payload),b)}if(qa(g)||Ra(g))return w!==null?null:m(p,f,g,b,null);bc(p,g)}return null}function v(p,f,g,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return p=p.get(g)||null,a(f,p,""+b,w);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case uc:return p=p.get(b.key===null?g:b.key)||null,c(f,p,b,w);case fo:return p=p.get(b.key===null?g:b.key)||null,u(f,p,b,w);case gs:var k=b._init;return v(p,f,g,k(b._payload),w)}if(qa(b)||Ra(b))return p=p.get(g)||null,m(f,p,b,w,null);bc(f,b)}return null}function _(p,f,g,b){for(var w=null,k=null,j=f,S=f=0,E=null;j!==null&&S<g.length;S++){j.index>S?(E=j,j=null):E=j.sibling;var N=x(p,j,g[S],b);if(N===null){j===null&&(j=E);break}e&&j&&N.alternate===null&&t(p,j),f=i(N,f,S),k===null?w=N:k.sibling=N,k=N,j=E}if(S===g.length)return r(p,j),it&&fi(p,S),w;if(j===null){for(;S<g.length;S++)j=d(p,g[S],b),j!==null&&(f=i(j,f,S),k===null?w=j:k.sibling=j,k=j);return it&&fi(p,S),w}for(j=n(p,j);S<g.length;S++)E=v(j,p,S,g[S],b),E!==null&&(e&&E.alternate!==null&&j.delete(E.key===null?S:E.key),f=i(E,f,S),k===null?w=E:k.sibling=E,k=E);return e&&j.forEach(function(O){return t(p,O)}),it&&fi(p,S),w}function y(p,f,g,b){var w=Ra(g);if(typeof w!="function")throw Error(ne(150));if(g=w.call(g),g==null)throw Error(ne(151));for(var k=w=null,j=f,S=f=0,E=null,N=g.next();j!==null&&!N.done;S++,N=g.next()){j.index>S?(E=j,j=null):E=j.sibling;var O=x(p,j,N.value,b);if(O===null){j===null&&(j=E);break}e&&j&&O.alternate===null&&t(p,j),f=i(O,f,S),k===null?w=O:k.sibling=O,k=O,j=E}if(N.done)return r(p,j),it&&fi(p,S),w;if(j===null){for(;!N.done;S++,N=g.next())N=d(p,N.value,b),N!==null&&(f=i(N,f,S),k===null?w=N:k.sibling=N,k=N);return it&&fi(p,S),w}for(j=n(p,j);!N.done;S++,N=g.next())N=v(j,p,S,N.value,b),N!==null&&(e&&N.alternate!==null&&j.delete(N.key===null?S:N.key),f=i(N,f,S),k===null?w=N:k.sibling=N,k=N);return e&&j.forEach(function(T){return t(p,T)}),it&&fi(p,S),w}function h(p,f,g,b){if(typeof g=="object"&&g!==null&&g.type===po&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case uc:e:{for(var w=g.key,k=f;k!==null;){if(k.key===w){if(w=g.type,w===po){if(k.tag===7){r(p,k.sibling),f=s(k,g.props.children),f.return=p,p=f;break e}}else if(k.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===gs&&$v(w)===k.type){r(p,k.sibling),f=s(k,g.props),f.ref=Da(p,k,g),f.return=p,p=f;break e}r(p,k);break}else t(p,k);k=k.sibling}g.type===po?(f=Ti(g.props.children,p.mode,b,g.key),f.return=p,p=f):(b=Zc(g.type,g.key,g.props,null,p.mode,b),b.ref=Da(p,f,g),b.return=p,p=b)}return l(p);case fo:e:{for(k=g.key;f!==null;){if(f.key===k)if(f.tag===4&&f.stateNode.containerInfo===g.containerInfo&&f.stateNode.implementation===g.implementation){r(p,f.sibling),f=s(f,g.children||[]),f.return=p,p=f;break e}else{r(p,f);break}else t(p,f);f=f.sibling}f=ph(g,p.mode,b),f.return=p,p=f}return l(p);case gs:return k=g._init,h(p,f,k(g._payload),b)}if(qa(g))return _(p,f,g,b);if(Ra(g))return y(p,f,g,b);bc(p,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,f!==null&&f.tag===6?(r(p,f.sibling),f=s(f,g),f.return=p,p=f):(r(p,f),f=fh(g,p.mode,b),f.return=p,p=f),l(p)):r(p,f)}return h}var ta=ub(!0),db=ub(!1),mu=ni(null),gu=null,wo=null,cm=null;function um(){cm=wo=gu=null}function dm(e){var t=mu.current;nt(mu),e._currentValue=t}function bf(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Po(e,t){gu=e,cm=wo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ir=!0),e.firstContext=null)}function Br(e){var t=e._currentValue;if(cm!==e)if(e={context:e,memoizedValue:t,next:null},wo===null){if(gu===null)throw Error(ne(308));wo=e,gu.dependencies={lanes:0,firstContext:e}}else wo=wo.next=e;return t}var gi=null;function hm(e){gi===null?gi=[e]:gi.push(e)}function hb(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,hm(t)):(r.next=s.next,s.next=r),t.interleaved=r,Jn(e,n)}function Jn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var vs=!1;function fm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fb(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Gn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function $s(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Me&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,Jn(e,r)}return s=n.interleaved,s===null?(t.next=t,hm(n)):(t.next=s.next,s.next=t),n.interleaved=t,Jn(e,r)}function Vc(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Xp(e,r)}}function Hv(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var l={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?s=i=l:i=i.next=l,r=r.next}while(r!==null);i===null?s=i=t:i=i.next=t}else s=i=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function vu(e,t,r,n){var s=e.updateQueue;vs=!1;var i=s.firstBaseUpdate,l=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var c=a,u=c.next;c.next=null,l===null?i=u:l.next=u,l=c;var m=e.alternate;m!==null&&(m=m.updateQueue,a=m.lastBaseUpdate,a!==l&&(a===null?m.firstBaseUpdate=u:a.next=u,m.lastBaseUpdate=c))}if(i!==null){var d=s.baseState;l=0,m=u=c=null,a=i;do{var x=a.lane,v=a.eventTime;if((n&x)===x){m!==null&&(m=m.next={eventTime:v,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var _=e,y=a;switch(x=t,v=r,y.tag){case 1:if(_=y.payload,typeof _=="function"){d=_.call(v,d,x);break e}d=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=y.payload,x=typeof _=="function"?_.call(v,d,x):_,x==null)break e;d=ut({},d,x);break e;case 2:vs=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,x=s.effects,x===null?s.effects=[a]:x.push(a))}else v={eventTime:v,lane:x,tag:a.tag,payload:a.payload,callback:a.callback,next:null},m===null?(u=m=v,c=d):m=m.next=v,l|=x;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;x=a,a=x.next,x.next=null,s.lastBaseUpdate=x,s.shared.pending=null}}while(!0);if(m===null&&(c=d),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=m,t=s.shared.interleaved,t!==null){s=t;do l|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Oi|=l,e.lanes=l,e.memoizedState=d}}function Uv(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(ne(191,s));s.call(n)}}}var Kl={},Nn=ni(Kl),wl=ni(Kl),Sl=ni(Kl);function vi(e){if(e===Kl)throw Error(ne(174));return e}function pm(e,t){switch(Ze(Sl,t),Ze(wl,e),Ze(Nn,Kl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ef(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ef(t,e)}nt(Nn),Ze(Nn,t)}function ra(){nt(Nn),nt(wl),nt(Sl)}function pb(e){vi(Sl.current);var t=vi(Nn.current),r=ef(t,e.type);t!==r&&(Ze(wl,e),Ze(Nn,r))}function mm(e){wl.current===e&&(nt(Nn),nt(wl))}var at=ni(0);function xu(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ah=[];function gm(){for(var e=0;e<ah.length;e++)ah[e]._workInProgressVersionPrimary=null;ah.length=0}var qc=is.ReactCurrentDispatcher,lh=is.ReactCurrentBatchConfig,Li=0,ct=null,_t=null,jt=null,yu=!1,sl=!1,Cl=0,uR=0;function Ot(){throw Error(ne(321))}function vm(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!hn(e[r],t[r]))return!1;return!0}function xm(e,t,r,n,s,i){if(Li=i,ct=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,qc.current=e===null||e.memoizedState===null?pR:mR,e=r(n,s),sl){i=0;do{if(sl=!1,Cl=0,25<=i)throw Error(ne(301));i+=1,jt=_t=null,t.updateQueue=null,qc.current=gR,e=r(n,s)}while(sl)}if(qc.current=_u,t=_t!==null&&_t.next!==null,Li=0,jt=_t=ct=null,yu=!1,t)throw Error(ne(300));return e}function ym(){var e=Cl!==0;return Cl=0,e}function _n(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?ct.memoizedState=jt=e:jt=jt.next=e,jt}function $r(){if(_t===null){var e=ct.alternate;e=e!==null?e.memoizedState:null}else e=_t.next;var t=jt===null?ct.memoizedState:jt.next;if(t!==null)jt=t,_t=e;else{if(e===null)throw Error(ne(310));_t=e,e={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},jt===null?ct.memoizedState=jt=e:jt=jt.next=e}return jt}function kl(e,t){return typeof t=="function"?t(e):t}function ch(e){var t=$r(),r=t.queue;if(r===null)throw Error(ne(311));r.lastRenderedReducer=e;var n=_t,s=n.baseQueue,i=r.pending;if(i!==null){if(s!==null){var l=s.next;s.next=i.next,i.next=l}n.baseQueue=s=i,r.pending=null}if(s!==null){i=s.next,n=n.baseState;var a=l=null,c=null,u=i;do{var m=u.lane;if((Li&m)===m)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var d={lane:m,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(a=c=d,l=n):c=c.next=d,ct.lanes|=m,Oi|=m}u=u.next}while(u!==null&&u!==i);c===null?l=n:c.next=a,hn(n,t.memoizedState)||(ir=!0),t.memoizedState=n,t.baseState=l,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do i=s.lane,ct.lanes|=i,Oi|=i,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function uh(e){var t=$r(),r=t.queue;if(r===null)throw Error(ne(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,i=t.memoizedState;if(s!==null){r.pending=null;var l=s=s.next;do i=e(i,l.action),l=l.next;while(l!==s);hn(i,t.memoizedState)||(ir=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function mb(){}function gb(e,t){var r=ct,n=$r(),s=t(),i=!hn(n.memoizedState,s);if(i&&(n.memoizedState=s,ir=!0),n=n.queue,_m(yb.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||jt!==null&&jt.memoizedState.tag&1){if(r.flags|=2048,El(9,xb.bind(null,r,n,s,t),void 0,null),Rt===null)throw Error(ne(349));Li&30||vb(r,t,s)}return s}function vb(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ct.updateQueue,t===null?(t={lastEffect:null,stores:null},ct.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function xb(e,t,r,n){t.value=r,t.getSnapshot=n,_b(t)&&bb(e)}function yb(e,t,r){return r(function(){_b(t)&&bb(e)})}function _b(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!hn(e,r)}catch{return!0}}function bb(e){var t=Jn(e,1);t!==null&&cn(t,e,1,-1)}function zv(e){var t=_n();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:kl,lastRenderedState:e},t.queue=e,e=e.dispatch=fR.bind(null,ct,e),[t.memoizedState,e]}function El(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=ct.updateQueue,t===null?(t={lastEffect:null,stores:null},ct.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function wb(){return $r().memoizedState}function Kc(e,t,r,n){var s=_n();ct.flags|=e,s.memoizedState=El(1|t,r,void 0,n===void 0?null:n)}function id(e,t,r,n){var s=$r();n=n===void 0?null:n;var i=void 0;if(_t!==null){var l=_t.memoizedState;if(i=l.destroy,n!==null&&vm(n,l.deps)){s.memoizedState=El(t,r,i,n);return}}ct.flags|=e,s.memoizedState=El(1|t,r,i,n)}function Wv(e,t){return Kc(8390656,8,e,t)}function _m(e,t){return id(2048,8,e,t)}function Sb(e,t){return id(4,2,e,t)}function Cb(e,t){return id(4,4,e,t)}function kb(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Eb(e,t,r){return r=r!=null?r.concat([e]):null,id(4,4,kb.bind(null,t,e),r)}function bm(){}function jb(e,t){var r=$r();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&vm(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Rb(e,t){var r=$r();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&vm(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Nb(e,t,r){return Li&21?(hn(r,t)||(r=L0(),ct.lanes|=r,Oi|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ir=!0),e.memoizedState=r)}function dR(e,t){var r=qe;qe=r!==0&&4>r?r:4,e(!0);var n=lh.transition;lh.transition={};try{e(!1),t()}finally{qe=r,lh.transition=n}}function Pb(){return $r().memoizedState}function hR(e,t,r){var n=Us(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Tb(e))Ab(t,r);else if(r=hb(e,t,r,n),r!==null){var s=Qt();cn(r,e,n,s),Db(r,t,n)}}function fR(e,t,r){var n=Us(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Tb(e))Ab(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,a=i(l,r);if(s.hasEagerState=!0,s.eagerState=a,hn(a,l)){var c=t.interleaved;c===null?(s.next=s,hm(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=hb(e,t,s,n),r!==null&&(s=Qt(),cn(r,e,n,s),Db(r,t,n))}}function Tb(e){var t=e.alternate;return e===ct||t!==null&&t===ct}function Ab(e,t){sl=yu=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Db(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Xp(e,r)}}var _u={readContext:Br,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useInsertionEffect:Ot,useLayoutEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useMutableSource:Ot,useSyncExternalStore:Ot,useId:Ot,unstable_isNewReconciler:!1},pR={readContext:Br,useCallback:function(e,t){return _n().memoizedState=[e,t===void 0?null:t],e},useContext:Br,useEffect:Wv,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Kc(4194308,4,kb.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Kc(4194308,4,e,t)},useInsertionEffect:function(e,t){return Kc(4,2,e,t)},useMemo:function(e,t){var r=_n();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=_n();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=hR.bind(null,ct,e),[n.memoizedState,e]},useRef:function(e){var t=_n();return e={current:e},t.memoizedState=e},useState:zv,useDebugValue:bm,useDeferredValue:function(e){return _n().memoizedState=e},useTransition:function(){var e=zv(!1),t=e[0];return e=dR.bind(null,e[1]),_n().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ct,s=_n();if(it){if(r===void 0)throw Error(ne(407));r=r()}else{if(r=t(),Rt===null)throw Error(ne(349));Li&30||vb(n,t,r)}s.memoizedState=r;var i={value:r,getSnapshot:t};return s.queue=i,Wv(yb.bind(null,n,i,e),[e]),n.flags|=2048,El(9,xb.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=_n(),t=Rt.identifierPrefix;if(it){var r=Kn,n=qn;r=(n&~(1<<32-ln(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Cl++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=uR++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},mR={readContext:Br,useCallback:jb,useContext:Br,useEffect:_m,useImperativeHandle:Eb,useInsertionEffect:Sb,useLayoutEffect:Cb,useMemo:Rb,useReducer:ch,useRef:wb,useState:function(){return ch(kl)},useDebugValue:bm,useDeferredValue:function(e){var t=$r();return Nb(t,_t.memoizedState,e)},useTransition:function(){var e=ch(kl)[0],t=$r().memoizedState;return[e,t]},useMutableSource:mb,useSyncExternalStore:gb,useId:Pb,unstable_isNewReconciler:!1},gR={readContext:Br,useCallback:jb,useContext:Br,useEffect:_m,useImperativeHandle:Eb,useInsertionEffect:Sb,useLayoutEffect:Cb,useMemo:Rb,useReducer:uh,useRef:wb,useState:function(){return uh(kl)},useDebugValue:bm,useDeferredValue:function(e){var t=$r();return _t===null?t.memoizedState=e:Nb(t,_t.memoizedState,e)},useTransition:function(){var e=uh(kl)[0],t=$r().memoizedState;return[e,t]},useMutableSource:mb,useSyncExternalStore:gb,useId:Pb,unstable_isNewReconciler:!1};function Xr(e,t){if(e&&e.defaultProps){t=ut({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function wf(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:ut({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var od={isMounted:function(e){return(e=e._reactInternals)?Ui(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Qt(),s=Us(e),i=Gn(n,s);i.payload=t,r!=null&&(i.callback=r),t=$s(e,i,s),t!==null&&(cn(t,e,s,n),Vc(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Qt(),s=Us(e),i=Gn(n,s);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=$s(e,i,s),t!==null&&(cn(t,e,s,n),Vc(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Qt(),n=Us(e),s=Gn(r,n);s.tag=2,t!=null&&(s.callback=t),t=$s(e,s,n),t!==null&&(cn(t,e,n,r),Vc(t,e,n))}};function Vv(e,t,r,n,s,i,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,l):t.prototype&&t.prototype.isPureReactComponent?!xl(r,n)||!xl(s,i):!0}function Lb(e,t,r){var n=!1,s=Ys,i=t.contextType;return typeof i=="object"&&i!==null?i=Br(i):(s=ar(t)?Ai:zt.current,n=t.contextTypes,i=(n=n!=null)?Jo(e,s):Ys),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=od,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function qv(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&od.enqueueReplaceState(t,t.state,null)}function Sf(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},fm(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Br(i):(i=ar(t)?Ai:zt.current,s.context=Jo(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(wf(e,t,i,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&od.enqueueReplaceState(s,s.state,null),vu(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function na(e,t){try{var r="",n=t;do r+=WE(n),n=n.return;while(n);var s=r}catch(i){s=`
|
|
39
|
+
Error generating stack: `+i.message+`
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:s,digest:null}}function dh(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Cf(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var vR=typeof WeakMap=="function"?WeakMap:Map;function Ob(e,t,r){r=Gn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){wu||(wu=!0,Lf=n),Cf(e,t)},r}function Mb(e,t,r){r=Gn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){Cf(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Cf(e,t),typeof n!="function"&&(Hs===null?Hs=new Set([this]):Hs.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),r}function Kv(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new vR;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=TR.bind(null,e,t,r),t.then(e,e))}function Gv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Qv(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Gn(-1,1),t.tag=2,$s(r,t,1))),r.lanes|=1),e)}var xR=is.ReactCurrentOwner,ir=!1;function Kt(e,t,r,n){t.child=e===null?db(t,null,r,n):ta(t,e.child,r,n)}function Yv(e,t,r,n,s){r=r.render;var i=t.ref;return Po(t,s),n=xm(e,t,r,n,i,s),r=ym(),e!==null&&!ir?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,es(e,t,s)):(it&&r&&om(t),t.flags|=1,Kt(e,t,n,s),t.child)}function Zv(e,t,r,n,s){if(e===null){var i=r.type;return typeof i=="function"&&!Nm(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,Ib(e,t,i,n,s)):(e=Zc(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var l=i.memoizedProps;if(r=r.compare,r=r!==null?r:xl,r(l,n)&&e.ref===t.ref)return es(e,t,s)}return t.flags|=1,e=zs(i,n),e.ref=t.ref,e.return=t,t.child=e}function Ib(e,t,r,n,s){if(e!==null){var i=e.memoizedProps;if(xl(i,n)&&e.ref===t.ref)if(ir=!1,t.pendingProps=n=i,(e.lanes&s)!==0)e.flags&131072&&(ir=!0);else return t.lanes=e.lanes,es(e,t,s)}return kf(e,t,r,n,s)}function Fb(e,t,r){var n=t.pendingProps,s=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ze(Co,pr),pr|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ze(Co,pr),pr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,Ze(Co,pr),pr|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,Ze(Co,pr),pr|=n;return Kt(e,t,s,r),t.child}function Bb(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function kf(e,t,r,n,s){var i=ar(r)?Ai:zt.current;return i=Jo(t,i),Po(t,s),r=xm(e,t,r,n,i,s),n=ym(),e!==null&&!ir?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,es(e,t,s)):(it&&n&&om(t),t.flags|=1,Kt(e,t,r,s),t.child)}function Xv(e,t,r,n,s){if(ar(r)){var i=!0;hu(t)}else i=!1;if(Po(t,s),t.stateNode===null)Gc(e,t),Lb(t,r,n),Sf(t,r,n,s),n=!0;else if(e===null){var l=t.stateNode,a=t.memoizedProps;l.props=a;var c=l.context,u=r.contextType;typeof u=="object"&&u!==null?u=Br(u):(u=ar(r)?Ai:zt.current,u=Jo(t,u));var m=r.getDerivedStateFromProps,d=typeof m=="function"||typeof l.getSnapshotBeforeUpdate=="function";d||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==n||c!==u)&&qv(t,l,n,u),vs=!1;var x=t.memoizedState;l.state=x,vu(t,n,l,s),c=t.memoizedState,a!==n||x!==c||or.current||vs?(typeof m=="function"&&(wf(t,r,m,n),c=t.memoizedState),(a=vs||Vv(t,r,a,n,x,c,u))?(d||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),l.props=n,l.state=c,l.context=u,n=a):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{l=t.stateNode,fb(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Xr(t.type,a),l.props=u,d=t.pendingProps,x=l.context,c=r.contextType,typeof c=="object"&&c!==null?c=Br(c):(c=ar(r)?Ai:zt.current,c=Jo(t,c));var v=r.getDerivedStateFromProps;(m=typeof v=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==d||x!==c)&&qv(t,l,n,c),vs=!1,x=t.memoizedState,l.state=x,vu(t,n,l,s);var _=t.memoizedState;a!==d||x!==_||or.current||vs?(typeof v=="function"&&(wf(t,r,v,n),_=t.memoizedState),(u=vs||Vv(t,r,u,n,x,_,c)||!1)?(m||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(n,_,c),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(n,_,c)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=_),l.props=n,l.state=_,l.context=c,n=u):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),n=!1)}return Ef(e,t,r,n,i,s)}function Ef(e,t,r,n,s,i){Bb(e,t);var l=(t.flags&128)!==0;if(!n&&!l)return s&&Iv(t,r,!1),es(e,t,i);n=t.stateNode,xR.current=t;var a=l&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&l?(t.child=ta(t,e.child,null,i),t.child=ta(t,null,a,i)):Kt(e,t,a,i),t.memoizedState=n.state,s&&Iv(t,r,!0),t.child}function $b(e){var t=e.stateNode;t.pendingContext?Mv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Mv(e,t.context,!1),pm(e,t.containerInfo)}function Jv(e,t,r,n,s){return ea(),lm(s),t.flags|=256,Kt(e,t,r,n),t.child}var jf={dehydrated:null,treeContext:null,retryLane:0};function Rf(e){return{baseLanes:e,cachePool:null,transitions:null}}function Hb(e,t,r){var n=t.pendingProps,s=at.current,i=!1,l=(t.flags&128)!==0,a;if((a=l)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Ze(at,s&1),e===null)return _f(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=n.children,e=n.fallback,i?(n=t.mode,i=t.child,l={mode:"hidden",children:l},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=l):i=cd(l,n,0,null),e=Ti(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Rf(r),t.memoizedState=jf,e):wm(t,l));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return yR(e,t,l,n,a,s,r);if(i){i=n.fallback,l=t.mode,s=e.child,a=s.sibling;var c={mode:"hidden",children:n.children};return!(l&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=zs(s,c),n.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=zs(a,i):(i=Ti(i,l,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,l=e.child.memoizedState,l=l===null?Rf(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},i.memoizedState=l,i.childLanes=e.childLanes&~r,t.memoizedState=jf,n}return i=e.child,e=i.sibling,n=zs(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function wm(e,t){return t=cd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function wc(e,t,r,n){return n!==null&&lm(n),ta(t,e.child,null,r),e=wm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yR(e,t,r,n,s,i,l){if(r)return t.flags&256?(t.flags&=-257,n=dh(Error(ne(422))),wc(e,t,l,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,s=t.mode,n=cd({mode:"visible",children:n.children},s,0,null),i=Ti(i,s,l,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&ta(t,e.child,null,l),t.child.memoizedState=Rf(l),t.memoizedState=jf,i);if(!(t.mode&1))return wc(e,t,l,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var a=n.dgst;return n=a,i=Error(ne(419)),n=dh(i,n,void 0),wc(e,t,l,n)}if(a=(l&e.childLanes)!==0,ir||a){if(n=Rt,n!==null){switch(l&-l){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|l)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Jn(e,s),cn(n,e,s,-1))}return Rm(),n=dh(Error(ne(421))),wc(e,t,l,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=AR.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,_r=Bs(s.nextSibling),br=t,it=!0,tn=null,e!==null&&(Tr[Ar++]=qn,Tr[Ar++]=Kn,Tr[Ar++]=Di,qn=e.id,Kn=e.overflow,Di=t),t=wm(t,n.children),t.flags|=4096,t)}function ex(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),bf(e.return,t,r)}function hh(e,t,r,n,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=s)}function Ub(e,t,r){var n=t.pendingProps,s=n.revealOrder,i=n.tail;if(Kt(e,t,n.children,r),n=at.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ex(e,r,t);else if(e.tag===19)ex(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ze(at,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&xu(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),hh(t,!1,s,r,i);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&xu(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}hh(t,!0,r,null,i);break;case"together":hh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Gc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function es(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Oi|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ne(153));if(t.child!==null){for(e=t.child,r=zs(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=zs(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function _R(e,t,r){switch(t.tag){case 3:$b(t),ea();break;case 5:pb(t);break;case 1:ar(t.type)&&hu(t);break;case 4:pm(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;Ze(mu,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ze(at,at.current&1),t.flags|=128,null):r&t.child.childLanes?Hb(e,t,r):(Ze(at,at.current&1),e=es(e,t,r),e!==null?e.sibling:null);Ze(at,at.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Ub(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Ze(at,at.current),n)break;return null;case 22:case 23:return t.lanes=0,Fb(e,t,r)}return es(e,t,r)}var zb,Nf,Wb,Vb;zb=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Nf=function(){};Wb=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,vi(Nn.current);var i=null;switch(r){case"input":s=Yh(e,s),n=Yh(e,n),i=[];break;case"select":s=ut({},s,{value:void 0}),n=ut({},n,{value:void 0}),i=[];break;case"textarea":s=Jh(e,s),n=Jh(e,n),i=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=uu)}tf(r,n);var l;r=null;for(u in s)if(!n.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var a=s[u];for(l in a)a.hasOwnProperty(l)&&(r||(r={}),r[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(dl.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(a=s!=null?s[u]:void 0,n.hasOwnProperty(u)&&c!==a&&(c!=null||a!=null))if(u==="style")if(a){for(l in a)!a.hasOwnProperty(l)||c&&c.hasOwnProperty(l)||(r||(r={}),r[l]="");for(l in c)c.hasOwnProperty(l)&&a[l]!==c[l]&&(r||(r={}),r[l]=c[l])}else r||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(dl.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&tt("scroll",e),i||a===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Vb=function(e,t,r,n){r!==n&&(t.flags|=4)};function La(e,t){if(!it)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function bR(e,t,r){var n=t.pendingProps;switch(am(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(t),null;case 1:return ar(t.type)&&du(),Mt(t),null;case 3:return n=t.stateNode,ra(),nt(or),nt(zt),gm(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(_c(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,tn!==null&&(If(tn),tn=null))),Nf(e,t),Mt(t),null;case 5:mm(t);var s=vi(Sl.current);if(r=t.type,e!==null&&t.stateNode!=null)Wb(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(ne(166));return Mt(t),null}if(e=vi(Nn.current),_c(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[Cn]=t,n[bl]=i,e=(t.mode&1)!==0,r){case"dialog":tt("cancel",n),tt("close",n);break;case"iframe":case"object":case"embed":tt("load",n);break;case"video":case"audio":for(s=0;s<Ga.length;s++)tt(Ga[s],n);break;case"source":tt("error",n);break;case"img":case"image":case"link":tt("error",n),tt("load",n);break;case"details":tt("toggle",n);break;case"input":cv(n,i),tt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},tt("invalid",n);break;case"textarea":dv(n,i),tt("invalid",n)}tf(r,i),s=null;for(var l in i)if(i.hasOwnProperty(l)){var a=i[l];l==="children"?typeof a=="string"?n.textContent!==a&&(i.suppressHydrationWarning!==!0&&yc(n.textContent,a,e),s=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&yc(n.textContent,a,e),s=["children",""+a]):dl.hasOwnProperty(l)&&a!=null&&l==="onScroll"&&tt("scroll",n)}switch(r){case"input":dc(n),uv(n,i,!0);break;case"textarea":dc(n),hv(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=uu)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{l=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=y0(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=l.createElement(r,{is:n.is}):(e=l.createElement(r),r==="select"&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,r),e[Cn]=t,e[bl]=n,zb(e,t,!1,!1),t.stateNode=e;e:{switch(l=rf(r,n),r){case"dialog":tt("cancel",e),tt("close",e),s=n;break;case"iframe":case"object":case"embed":tt("load",e),s=n;break;case"video":case"audio":for(s=0;s<Ga.length;s++)tt(Ga[s],e);s=n;break;case"source":tt("error",e),s=n;break;case"img":case"image":case"link":tt("error",e),tt("load",e),s=n;break;case"details":tt("toggle",e),s=n;break;case"input":cv(e,n),s=Yh(e,n),tt("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=ut({},n,{value:void 0}),tt("invalid",e);break;case"textarea":dv(e,n),s=Jh(e,n),tt("invalid",e);break;default:s=n}tf(r,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?w0(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&_0(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&hl(e,c):typeof c=="number"&&hl(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(dl.hasOwnProperty(i)?c!=null&&i==="onScroll"&&tt("scroll",e):c!=null&&qp(e,i,c,l))}switch(r){case"input":dc(e),uv(e,n,!1);break;case"textarea":dc(e),hv(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Qs(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?Eo(e,!!n.multiple,i,!1):n.defaultValue!=null&&Eo(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=uu)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Mt(t),null;case 6:if(e&&t.stateNode!=null)Vb(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(ne(166));if(r=vi(Sl.current),vi(Nn.current),_c(t)){if(n=t.stateNode,r=t.memoizedProps,n[Cn]=t,(i=n.nodeValue!==r)&&(e=br,e!==null))switch(e.tag){case 3:yc(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&yc(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Cn]=t,t.stateNode=n}return Mt(t),null;case 13:if(nt(at),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(it&&_r!==null&&t.mode&1&&!(t.flags&128))cb(),ea(),t.flags|=98560,i=!1;else if(i=_c(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(ne(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ne(317));i[Cn]=t}else ea(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mt(t),i=!1}else tn!==null&&(If(tn),tn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||at.current&1?St===0&&(St=3):Rm())),t.updateQueue!==null&&(t.flags|=4),Mt(t),null);case 4:return ra(),Nf(e,t),e===null&&yl(t.stateNode.containerInfo),Mt(t),null;case 10:return dm(t.type._context),Mt(t),null;case 17:return ar(t.type)&&du(),Mt(t),null;case 19:if(nt(at),i=t.memoizedState,i===null)return Mt(t),null;if(n=(t.flags&128)!==0,l=i.rendering,l===null)if(n)La(i,!1);else{if(St!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=xu(e),l!==null){for(t.flags|=128,La(i,!1),n=l.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,l=i.alternate,l===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,e=l.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ze(at,at.current&1|2),t.child}e=e.sibling}i.tail!==null&&mt()>sa&&(t.flags|=128,n=!0,La(i,!1),t.lanes=4194304)}else{if(!n)if(e=xu(l),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),La(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!it)return Mt(t),null}else 2*mt()-i.renderingStartTime>sa&&r!==1073741824&&(t.flags|=128,n=!0,La(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(r=i.last,r!==null?r.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=mt(),t.sibling=null,r=at.current,Ze(at,n?r&1|2:r&1),t):(Mt(t),null);case 22:case 23:return jm(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?pr&1073741824&&(Mt(t),t.subtreeFlags&6&&(t.flags|=8192)):Mt(t),null;case 24:return null;case 25:return null}throw Error(ne(156,t.tag))}function wR(e,t){switch(am(t),t.tag){case 1:return ar(t.type)&&du(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ra(),nt(or),nt(zt),gm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return mm(t),null;case 13:if(nt(at),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ne(340));ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return nt(at),null;case 4:return ra(),null;case 10:return dm(t.type._context),null;case 22:case 23:return jm(),null;case 24:return null;default:return null}}var Sc=!1,Bt=!1,SR=typeof WeakSet=="function"?WeakSet:Set,pe=null;function So(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ht(e,t,n)}else r.current=null}function Pf(e,t,r){try{r()}catch(n){ht(e,t,n)}}var tx=!1;function CR(e,t){if(ff=au,e=Y0(),im(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var l=0,a=-1,c=-1,u=0,m=0,d=e,x=null;t:for(;;){for(var v;d!==r||s!==0&&d.nodeType!==3||(a=l+s),d!==i||n!==0&&d.nodeType!==3||(c=l+n),d.nodeType===3&&(l+=d.nodeValue.length),(v=d.firstChild)!==null;)x=d,d=v;for(;;){if(d===e)break t;if(x===r&&++u===s&&(a=l),x===i&&++m===n&&(c=l),(v=d.nextSibling)!==null)break;d=x,x=d.parentNode}d=v}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(pf={focusedElem:e,selectionRange:r},au=!1,pe=t;pe!==null;)if(t=pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pe=e;else for(;pe!==null;){t=pe;try{var _=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var y=_.memoizedProps,h=_.memoizedState,p=t.stateNode,f=p.getSnapshotBeforeUpdate(t.elementType===t.type?y:Xr(t.type,y),h);p.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ne(163))}}catch(b){ht(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,pe=e;break}pe=t.return}return _=tx,tx=!1,_}function il(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Pf(t,r,i)}s=s.next}while(s!==n)}}function ad(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Tf(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function qb(e){var t=e.alternate;t!==null&&(e.alternate=null,qb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Cn],delete t[bl],delete t[vf],delete t[oR],delete t[aR])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Kb(e){return e.tag===5||e.tag===3||e.tag===4}function rx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Kb(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Af(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=uu));else if(n!==4&&(e=e.child,e!==null))for(Af(e,t,r),e=e.sibling;e!==null;)Af(e,t,r),e=e.sibling}function Df(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Df(e,t,r),e=e.sibling;e!==null;)Df(e,t,r),e=e.sibling}var Tt=null,en=!1;function ds(e,t,r){for(r=r.child;r!==null;)Gb(e,t,r),r=r.sibling}function Gb(e,t,r){if(Rn&&typeof Rn.onCommitFiberUnmount=="function")try{Rn.onCommitFiberUnmount(Ju,r)}catch{}switch(r.tag){case 5:Bt||So(r,t);case 6:var n=Tt,s=en;Tt=null,ds(e,t,r),Tt=n,en=s,Tt!==null&&(en?(e=Tt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Tt.removeChild(r.stateNode));break;case 18:Tt!==null&&(en?(e=Tt,r=r.stateNode,e.nodeType===8?ih(e.parentNode,r):e.nodeType===1&&ih(e,r),gl(e)):ih(Tt,r.stateNode));break;case 4:n=Tt,s=en,Tt=r.stateNode.containerInfo,en=!0,ds(e,t,r),Tt=n,en=s;break;case 0:case 11:case 14:case 15:if(!Bt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var i=s,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&Pf(r,t,l),s=s.next}while(s!==n)}ds(e,t,r);break;case 1:if(!Bt&&(So(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){ht(r,t,a)}ds(e,t,r);break;case 21:ds(e,t,r);break;case 22:r.mode&1?(Bt=(n=Bt)||r.memoizedState!==null,ds(e,t,r),Bt=n):ds(e,t,r);break;default:ds(e,t,r)}}function nx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new SR),t.forEach(function(n){var s=DR.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function Qr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var i=e,l=t,a=l;e:for(;a!==null;){switch(a.tag){case 5:Tt=a.stateNode,en=!1;break e;case 3:Tt=a.stateNode.containerInfo,en=!0;break e;case 4:Tt=a.stateNode.containerInfo,en=!0;break e}a=a.return}if(Tt===null)throw Error(ne(160));Gb(i,l,s),Tt=null,en=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){ht(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Qb(t,e),t=t.sibling}function Qb(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Qr(t,e),yn(e),n&4){try{il(3,e,e.return),ad(3,e)}catch(y){ht(e,e.return,y)}try{il(5,e,e.return)}catch(y){ht(e,e.return,y)}}break;case 1:Qr(t,e),yn(e),n&512&&r!==null&&So(r,r.return);break;case 5:if(Qr(t,e),yn(e),n&512&&r!==null&&So(r,r.return),e.flags&32){var s=e.stateNode;try{hl(s,"")}catch(y){ht(e,e.return,y)}}if(n&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,l=r!==null?r.memoizedProps:i,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&v0(s,i),rf(a,l);var u=rf(a,i);for(l=0;l<c.length;l+=2){var m=c[l],d=c[l+1];m==="style"?w0(s,d):m==="dangerouslySetInnerHTML"?_0(s,d):m==="children"?hl(s,d):qp(s,m,d,u)}switch(a){case"input":Zh(s,i);break;case"textarea":x0(s,i);break;case"select":var x=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var v=i.value;v!=null?Eo(s,!!i.multiple,v,!1):x!==!!i.multiple&&(i.defaultValue!=null?Eo(s,!!i.multiple,i.defaultValue,!0):Eo(s,!!i.multiple,i.multiple?[]:"",!1))}s[bl]=i}catch(y){ht(e,e.return,y)}}break;case 6:if(Qr(t,e),yn(e),n&4){if(e.stateNode===null)throw Error(ne(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(y){ht(e,e.return,y)}}break;case 3:if(Qr(t,e),yn(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{gl(t.containerInfo)}catch(y){ht(e,e.return,y)}break;case 4:Qr(t,e),yn(e);break;case 13:Qr(t,e),yn(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(km=mt())),n&4&&nx(e);break;case 22:if(m=r!==null&&r.memoizedState!==null,e.mode&1?(Bt=(u=Bt)||m,Qr(t,e),Bt=u):Qr(t,e),yn(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!m&&e.mode&1)for(pe=e,m=e.child;m!==null;){for(d=pe=m;pe!==null;){switch(x=pe,v=x.child,x.tag){case 0:case 11:case 14:case 15:il(4,x,x.return);break;case 1:So(x,x.return);var _=x.stateNode;if(typeof _.componentWillUnmount=="function"){n=x,r=x.return;try{t=n,_.props=t.memoizedProps,_.state=t.memoizedState,_.componentWillUnmount()}catch(y){ht(n,r,y)}}break;case 5:So(x,x.return);break;case 22:if(x.memoizedState!==null){ix(d);continue}}v!==null?(v.return=x,pe=v):ix(d)}m=m.sibling}e:for(m=null,d=e;;){if(d.tag===5){if(m===null){m=d;try{s=d.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,c=d.memoizedProps.style,l=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=b0("display",l))}catch(y){ht(e,e.return,y)}}}else if(d.tag===6){if(m===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){ht(e,e.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;m===d&&(m=null),d=d.return}m===d&&(m=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Qr(t,e),yn(e),n&4&&nx(e);break;case 21:break;default:Qr(t,e),yn(e)}}function yn(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Kb(r)){var n=r;break e}r=r.return}throw Error(ne(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(hl(s,""),n.flags&=-33);var i=rx(e);Df(e,i,s);break;case 3:case 4:var l=n.stateNode.containerInfo,a=rx(e);Af(e,a,l);break;default:throw Error(ne(161))}}catch(c){ht(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function kR(e,t,r){pe=e,Yb(e)}function Yb(e,t,r){for(var n=(e.mode&1)!==0;pe!==null;){var s=pe,i=s.child;if(s.tag===22&&n){var l=s.memoizedState!==null||Sc;if(!l){var a=s.alternate,c=a!==null&&a.memoizedState!==null||Bt;a=Sc;var u=Bt;if(Sc=l,(Bt=c)&&!u)for(pe=s;pe!==null;)l=pe,c=l.child,l.tag===22&&l.memoizedState!==null?ox(s):c!==null?(c.return=l,pe=c):ox(s);for(;i!==null;)pe=i,Yb(i),i=i.sibling;pe=s,Sc=a,Bt=u}sx(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,pe=i):sx(e)}}function sx(e){for(;pe!==null;){var t=pe;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Bt||ad(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Bt)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:Xr(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Uv(t,i,n);break;case 3:var l=t.updateQueue;if(l!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Uv(t,l,r)}break;case 5:var a=t.stateNode;if(r===null&&t.flags&4){r=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var m=u.memoizedState;if(m!==null){var d=m.dehydrated;d!==null&&gl(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ne(163))}Bt||t.flags&512&&Tf(t)}catch(x){ht(t,t.return,x)}}if(t===e){pe=null;break}if(r=t.sibling,r!==null){r.return=t.return,pe=r;break}pe=t.return}}function ix(e){for(;pe!==null;){var t=pe;if(t===e){pe=null;break}var r=t.sibling;if(r!==null){r.return=t.return,pe=r;break}pe=t.return}}function ox(e){for(;pe!==null;){var t=pe;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{ad(4,t)}catch(c){ht(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(c){ht(t,s,c)}}var i=t.return;try{Tf(t)}catch(c){ht(t,i,c)}break;case 5:var l=t.return;try{Tf(t)}catch(c){ht(t,l,c)}}}catch(c){ht(t,t.return,c)}if(t===e){pe=null;break}var a=t.sibling;if(a!==null){a.return=t.return,pe=a;break}pe=t.return}}var ER=Math.ceil,bu=is.ReactCurrentDispatcher,Sm=is.ReactCurrentOwner,Or=is.ReactCurrentBatchConfig,Me=0,Rt=null,yt=null,Dt=0,pr=0,Co=ni(0),St=0,jl=null,Oi=0,ld=0,Cm=0,ol=null,sr=null,km=0,sa=1/0,$n=null,wu=!1,Lf=null,Hs=null,Cc=!1,Ds=null,Su=0,al=0,Of=null,Qc=-1,Yc=0;function Qt(){return Me&6?mt():Qc!==-1?Qc:Qc=mt()}function Us(e){return e.mode&1?Me&2&&Dt!==0?Dt&-Dt:cR.transition!==null?(Yc===0&&(Yc=L0()),Yc):(e=qe,e!==0||(e=window.event,e=e===void 0?16:H0(e.type)),e):1}function cn(e,t,r,n){if(50<al)throw al=0,Of=null,Error(ne(185));Wl(e,r,n),(!(Me&2)||e!==Rt)&&(e===Rt&&(!(Me&2)&&(ld|=r),St===4&&ws(e,Dt)),lr(e,n),r===1&&Me===0&&!(t.mode&1)&&(sa=mt()+500,sd&&si()))}function lr(e,t){var r=e.callbackNode;cj(e,t);var n=ou(e,e===Rt?Dt:0);if(n===0)r!==null&&mv(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&mv(r),t===1)e.tag===0?lR(ax.bind(null,e)):ob(ax.bind(null,e)),sR(function(){!(Me&6)&&si()}),r=null;else{switch(O0(n)){case 1:r=Zp;break;case 4:r=A0;break;case 16:r=iu;break;case 536870912:r=D0;break;default:r=iu}r=sw(r,Zb.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Zb(e,t){if(Qc=-1,Yc=0,Me&6)throw Error(ne(327));var r=e.callbackNode;if(To()&&e.callbackNode!==r)return null;var n=ou(e,e===Rt?Dt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Cu(e,n);else{t=n;var s=Me;Me|=2;var i=Jb();(Rt!==e||Dt!==t)&&($n=null,sa=mt()+500,Pi(e,t));do try{NR();break}catch(a){Xb(e,a)}while(!0);um(),bu.current=i,Me=s,yt!==null?t=0:(Rt=null,Dt=0,t=St)}if(t!==0){if(t===2&&(s=lf(e),s!==0&&(n=s,t=Mf(e,s))),t===1)throw r=jl,Pi(e,0),ws(e,n),lr(e,mt()),r;if(t===6)ws(e,n);else{if(s=e.current.alternate,!(n&30)&&!jR(s)&&(t=Cu(e,n),t===2&&(i=lf(e),i!==0&&(n=i,t=Mf(e,i))),t===1))throw r=jl,Pi(e,0),ws(e,n),lr(e,mt()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(ne(345));case 2:pi(e,sr,$n);break;case 3:if(ws(e,n),(n&130023424)===n&&(t=km+500-mt(),10<t)){if(ou(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){Qt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=gf(pi.bind(null,e,sr,$n),t);break}pi(e,sr,$n);break;case 4:if(ws(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var l=31-ln(n);i=1<<l,l=t[l],l>s&&(s=l),n&=~i}if(n=s,n=mt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*ER(n/1960))-n,10<n){e.timeoutHandle=gf(pi.bind(null,e,sr,$n),n);break}pi(e,sr,$n);break;case 5:pi(e,sr,$n);break;default:throw Error(ne(329))}}}return lr(e,mt()),e.callbackNode===r?Zb.bind(null,e):null}function Mf(e,t){var r=ol;return e.current.memoizedState.isDehydrated&&(Pi(e,t).flags|=256),e=Cu(e,t),e!==2&&(t=sr,sr=r,t!==null&&If(t)),e}function If(e){sr===null?sr=e:sr.push.apply(sr,e)}function jR(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],i=s.getSnapshot;s=s.value;try{if(!hn(i(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ws(e,t){for(t&=~Cm,t&=~ld,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-ln(t),n=1<<r;e[r]=-1,t&=~n}}function ax(e){if(Me&6)throw Error(ne(327));To();var t=ou(e,0);if(!(t&1))return lr(e,mt()),null;var r=Cu(e,t);if(e.tag!==0&&r===2){var n=lf(e);n!==0&&(t=n,r=Mf(e,n))}if(r===1)throw r=jl,Pi(e,0),ws(e,t),lr(e,mt()),r;if(r===6)throw Error(ne(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,pi(e,sr,$n),lr(e,mt()),null}function Em(e,t){var r=Me;Me|=1;try{return e(t)}finally{Me=r,Me===0&&(sa=mt()+500,sd&&si())}}function Mi(e){Ds!==null&&Ds.tag===0&&!(Me&6)&&To();var t=Me;Me|=1;var r=Or.transition,n=qe;try{if(Or.transition=null,qe=1,e)return e()}finally{qe=n,Or.transition=r,Me=t,!(Me&6)&&si()}}function jm(){pr=Co.current,nt(Co)}function Pi(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,nR(r)),yt!==null)for(r=yt.return;r!==null;){var n=r;switch(am(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&du();break;case 3:ra(),nt(or),nt(zt),gm();break;case 5:mm(n);break;case 4:ra();break;case 13:nt(at);break;case 19:nt(at);break;case 10:dm(n.type._context);break;case 22:case 23:jm()}r=r.return}if(Rt=e,yt=e=zs(e.current,null),Dt=pr=t,St=0,jl=null,Cm=ld=Oi=0,sr=ol=null,gi!==null){for(t=0;t<gi.length;t++)if(r=gi[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,i=r.pending;if(i!==null){var l=i.next;i.next=s,n.next=l}r.pending=n}gi=null}return e}function Xb(e,t){do{var r=yt;try{if(um(),qc.current=_u,yu){for(var n=ct.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}yu=!1}if(Li=0,jt=_t=ct=null,sl=!1,Cl=0,Sm.current=null,r===null||r.return===null){St=1,jl=t,yt=null;break}e:{var i=e,l=r.return,a=r,c=t;if(t=Dt,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,m=a,d=m.tag;if(!(m.mode&1)&&(d===0||d===11||d===15)){var x=m.alternate;x?(m.updateQueue=x.updateQueue,m.memoizedState=x.memoizedState,m.lanes=x.lanes):(m.updateQueue=null,m.memoizedState=null)}var v=Gv(l);if(v!==null){v.flags&=-257,Qv(v,l,a,i,t),v.mode&1&&Kv(i,u,t),t=v,c=u;var _=t.updateQueue;if(_===null){var y=new Set;y.add(c),t.updateQueue=y}else _.add(c);break e}else{if(!(t&1)){Kv(i,u,t),Rm();break e}c=Error(ne(426))}}else if(it&&a.mode&1){var h=Gv(l);if(h!==null){!(h.flags&65536)&&(h.flags|=256),Qv(h,l,a,i,t),lm(na(c,a));break e}}i=c=na(c,a),St!==4&&(St=2),ol===null?ol=[i]:ol.push(i),i=l;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var p=Ob(i,c,t);Hv(i,p);break e;case 1:a=c;var f=i.type,g=i.stateNode;if(!(i.flags&128)&&(typeof f.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Hs===null||!Hs.has(g)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=Mb(i,a,t);Hv(i,b);break e}}i=i.return}while(i!==null)}tw(r)}catch(w){t=w,yt===r&&r!==null&&(yt=r=r.return);continue}break}while(!0)}function Jb(){var e=bu.current;return bu.current=_u,e===null?_u:e}function Rm(){(St===0||St===3||St===2)&&(St=4),Rt===null||!(Oi&268435455)&&!(ld&268435455)||ws(Rt,Dt)}function Cu(e,t){var r=Me;Me|=2;var n=Jb();(Rt!==e||Dt!==t)&&($n=null,Pi(e,t));do try{RR();break}catch(s){Xb(e,s)}while(!0);if(um(),Me=r,bu.current=n,yt!==null)throw Error(ne(261));return Rt=null,Dt=0,St}function RR(){for(;yt!==null;)ew(yt)}function NR(){for(;yt!==null&&!ej();)ew(yt)}function ew(e){var t=nw(e.alternate,e,pr);e.memoizedProps=e.pendingProps,t===null?tw(e):yt=t,Sm.current=null}function tw(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=wR(r,t),r!==null){r.flags&=32767,yt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{St=6,yt=null;return}}else if(r=bR(r,t,pr),r!==null){yt=r;return}if(t=t.sibling,t!==null){yt=t;return}yt=t=e}while(t!==null);St===0&&(St=5)}function pi(e,t,r){var n=qe,s=Or.transition;try{Or.transition=null,qe=1,PR(e,t,r,n)}finally{Or.transition=s,qe=n}return null}function PR(e,t,r,n){do To();while(Ds!==null);if(Me&6)throw Error(ne(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(ne(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(uj(e,i),e===Rt&&(yt=Rt=null,Dt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Cc||(Cc=!0,sw(iu,function(){return To(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Or.transition,Or.transition=null;var l=qe;qe=1;var a=Me;Me|=4,Sm.current=null,CR(e,r),Qb(r,e),Yj(pf),au=!!ff,pf=ff=null,e.current=r,kR(r),tj(),Me=a,qe=l,Or.transition=i}else e.current=r;if(Cc&&(Cc=!1,Ds=e,Su=s),i=e.pendingLanes,i===0&&(Hs=null),sj(r.stateNode),lr(e,mt()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(wu)throw wu=!1,e=Lf,Lf=null,e;return Su&1&&e.tag!==0&&To(),i=e.pendingLanes,i&1?e===Of?al++:(al=0,Of=e):al=0,si(),null}function To(){if(Ds!==null){var e=O0(Su),t=Or.transition,r=qe;try{if(Or.transition=null,qe=16>e?16:e,Ds===null)var n=!1;else{if(e=Ds,Ds=null,Su=0,Me&6)throw Error(ne(331));var s=Me;for(Me|=4,pe=e.current;pe!==null;){var i=pe,l=i.child;if(pe.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var u=a[c];for(pe=u;pe!==null;){var m=pe;switch(m.tag){case 0:case 11:case 15:il(8,m,i)}var d=m.child;if(d!==null)d.return=m,pe=d;else for(;pe!==null;){m=pe;var x=m.sibling,v=m.return;if(qb(m),m===u){pe=null;break}if(x!==null){x.return=v,pe=x;break}pe=v}}}var _=i.alternate;if(_!==null){var y=_.child;if(y!==null){_.child=null;do{var h=y.sibling;y.sibling=null,y=h}while(y!==null)}}pe=i}}if(i.subtreeFlags&2064&&l!==null)l.return=i,pe=l;else e:for(;pe!==null;){if(i=pe,i.flags&2048)switch(i.tag){case 0:case 11:case 15:il(9,i,i.return)}var p=i.sibling;if(p!==null){p.return=i.return,pe=p;break e}pe=i.return}}var f=e.current;for(pe=f;pe!==null;){l=pe;var g=l.child;if(l.subtreeFlags&2064&&g!==null)g.return=l,pe=g;else e:for(l=f;pe!==null;){if(a=pe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ad(9,a)}}catch(w){ht(a,a.return,w)}if(a===l){pe=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,pe=b;break e}pe=a.return}}if(Me=s,si(),Rn&&typeof Rn.onPostCommitFiberRoot=="function")try{Rn.onPostCommitFiberRoot(Ju,e)}catch{}n=!0}return n}finally{qe=r,Or.transition=t}}return!1}function lx(e,t,r){t=na(r,t),t=Ob(e,t,1),e=$s(e,t,1),t=Qt(),e!==null&&(Wl(e,1,t),lr(e,t))}function ht(e,t,r){if(e.tag===3)lx(e,e,r);else for(;t!==null;){if(t.tag===3){lx(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Hs===null||!Hs.has(n))){e=na(r,e),e=Mb(t,e,1),t=$s(t,e,1),e=Qt(),t!==null&&(Wl(t,1,e),lr(t,e));break}}t=t.return}}function TR(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=Qt(),e.pingedLanes|=e.suspendedLanes&r,Rt===e&&(Dt&r)===r&&(St===4||St===3&&(Dt&130023424)===Dt&&500>mt()-km?Pi(e,0):Cm|=r),lr(e,t)}function rw(e,t){t===0&&(e.mode&1?(t=pc,pc<<=1,!(pc&130023424)&&(pc=4194304)):t=1);var r=Qt();e=Jn(e,t),e!==null&&(Wl(e,t,r),lr(e,r))}function AR(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),rw(e,r)}function DR(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ne(314))}n!==null&&n.delete(t),rw(e,r)}var nw;nw=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||or.current)ir=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return ir=!1,_R(e,t,r);ir=!!(e.flags&131072)}else ir=!1,it&&t.flags&1048576&&ab(t,pu,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Gc(e,t),e=t.pendingProps;var s=Jo(t,zt.current);Po(t,r),s=xm(null,t,n,e,s,r);var i=ym();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ar(n)?(i=!0,hu(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,fm(t),s.updater=od,t.stateNode=s,s._reactInternals=t,Sf(t,n,e,r),t=Ef(null,t,n,!0,i,r)):(t.tag=0,it&&i&&om(t),Kt(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Gc(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=OR(n),e=Xr(n,e),s){case 0:t=kf(null,t,n,e,r);break e;case 1:t=Xv(null,t,n,e,r);break e;case 11:t=Yv(null,t,n,e,r);break e;case 14:t=Zv(null,t,n,Xr(n.type,e),r);break e}throw Error(ne(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Xr(n,s),kf(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Xr(n,s),Xv(e,t,n,s,r);case 3:e:{if($b(t),e===null)throw Error(ne(387));n=t.pendingProps,i=t.memoizedState,s=i.element,fb(e,t),vu(t,n,null,r);var l=t.memoizedState;if(n=l.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=na(Error(ne(423)),t),t=Jv(e,t,n,r,s);break e}else if(n!==s){s=na(Error(ne(424)),t),t=Jv(e,t,n,r,s);break e}else for(_r=Bs(t.stateNode.containerInfo.firstChild),br=t,it=!0,tn=null,r=db(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ea(),n===s){t=es(e,t,r);break e}Kt(e,t,n,r)}t=t.child}return t;case 5:return pb(t),e===null&&_f(t),n=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,l=s.children,mf(n,s)?l=null:i!==null&&mf(n,i)&&(t.flags|=32),Bb(e,t),Kt(e,t,l,r),t.child;case 6:return e===null&&_f(t),null;case 13:return Hb(e,t,r);case 4:return pm(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ta(t,null,n,r):Kt(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Xr(n,s),Yv(e,t,n,s,r);case 7:return Kt(e,t,t.pendingProps,r),t.child;case 8:return Kt(e,t,t.pendingProps.children,r),t.child;case 12:return Kt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,i=t.memoizedProps,l=s.value,Ze(mu,n._currentValue),n._currentValue=l,i!==null)if(hn(i.value,l)){if(i.children===s.children&&!or.current){t=es(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){l=i.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=Gn(-1,r&-r),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var m=u.pending;m===null?c.next=c:(c.next=m.next,m.next=c),u.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),bf(i.return,r,t),a.lanes|=r;break}c=c.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(ne(341));l.lanes|=r,a=l.alternate,a!==null&&(a.lanes|=r),bf(l,r,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}Kt(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Po(t,r),s=Br(s),n=n(s),t.flags|=1,Kt(e,t,n,r),t.child;case 14:return n=t.type,s=Xr(n,t.pendingProps),s=Xr(n.type,s),Zv(e,t,n,s,r);case 15:return Ib(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:Xr(n,s),Gc(e,t),t.tag=1,ar(n)?(e=!0,hu(t)):e=!1,Po(t,r),Lb(t,n,s),Sf(t,n,s,r),Ef(null,t,n,!0,e,r);case 19:return Ub(e,t,r);case 22:return Fb(e,t,r)}throw Error(ne(156,t.tag))};function sw(e,t){return T0(e,t)}function LR(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Dr(e,t,r,n){return new LR(e,t,r,n)}function Nm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function OR(e){if(typeof e=="function")return Nm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Gp)return 11;if(e===Qp)return 14}return 2}function zs(e,t){var r=e.alternate;return r===null?(r=Dr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Zc(e,t,r,n,s,i){var l=2;if(n=e,typeof e=="function")Nm(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case po:return Ti(r.children,s,i,t);case Kp:l=8,s|=8;break;case qh:return e=Dr(12,r,t,s|2),e.elementType=qh,e.lanes=i,e;case Kh:return e=Dr(13,r,t,s),e.elementType=Kh,e.lanes=i,e;case Gh:return e=Dr(19,r,t,s),e.elementType=Gh,e.lanes=i,e;case p0:return cd(r,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case h0:l=10;break e;case f0:l=9;break e;case Gp:l=11;break e;case Qp:l=14;break e;case gs:l=16,n=null;break e}throw Error(ne(130,e==null?e:typeof e,""))}return t=Dr(l,r,t,s),t.elementType=e,t.type=n,t.lanes=i,t}function Ti(e,t,r,n){return e=Dr(7,e,n,t),e.lanes=r,e}function cd(e,t,r,n){return e=Dr(22,e,n,t),e.elementType=p0,e.lanes=r,e.stateNode={isHidden:!1},e}function fh(e,t,r){return e=Dr(6,e,null,t),e.lanes=r,e}function ph(e,t,r){return t=Dr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function MR(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gd(0),this.expirationTimes=Gd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gd(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Pm(e,t,r,n,s,i,l,a,c){return e=new MR(e,t,r,a,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Dr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},fm(i),e}function IR(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:fo,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function iw(e){if(!e)return Ys;e=e._reactInternals;e:{if(Ui(e)!==e||e.tag!==1)throw Error(ne(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ar(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ne(171))}if(e.tag===1){var r=e.type;if(ar(r))return ib(e,r,t)}return t}function ow(e,t,r,n,s,i,l,a,c){return e=Pm(r,n,!0,e,s,i,l,a,c),e.context=iw(null),r=e.current,n=Qt(),s=Us(r),i=Gn(n,s),i.callback=t??null,$s(r,i,s),e.current.lanes=s,Wl(e,s,n),lr(e,n),e}function ud(e,t,r,n){var s=t.current,i=Qt(),l=Us(s);return r=iw(r),t.context===null?t.context=r:t.pendingContext=r,t=Gn(i,l),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=$s(s,t,l),e!==null&&(cn(e,s,l,i),Vc(e,s,l)),l}function ku(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function cx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Tm(e,t){cx(e,t),(e=e.alternate)&&cx(e,t)}function FR(){return null}var aw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Am(e){this._internalRoot=e}dd.prototype.render=Am.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ne(409));ud(e,t,null,null)};dd.prototype.unmount=Am.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Mi(function(){ud(null,e,null,null)}),t[Xn]=null}};function dd(e){this._internalRoot=e}dd.prototype.unstable_scheduleHydration=function(e){if(e){var t=F0();e={blockedOn:null,target:e,priority:t};for(var r=0;r<bs.length&&t!==0&&t<bs[r].priority;r++);bs.splice(r,0,e),r===0&&$0(e)}};function Dm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function hd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ux(){}function BR(e,t,r,n,s){if(s){if(typeof n=="function"){var i=n;n=function(){var u=ku(l);i.call(u)}}var l=ow(t,n,e,0,null,!1,!1,"",ux);return e._reactRootContainer=l,e[Xn]=l.current,yl(e.nodeType===8?e.parentNode:e),Mi(),l}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var a=n;n=function(){var u=ku(c);a.call(u)}}var c=Pm(e,0,!1,null,null,!1,!1,"",ux);return e._reactRootContainer=c,e[Xn]=c.current,yl(e.nodeType===8?e.parentNode:e),Mi(function(){ud(t,c,r,n)}),c}function fd(e,t,r,n,s){var i=r._reactRootContainer;if(i){var l=i;if(typeof s=="function"){var a=s;s=function(){var c=ku(l);a.call(c)}}ud(t,l,e,s)}else l=BR(r,t,e,s,n);return ku(l)}M0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Ka(t.pendingLanes);r!==0&&(Xp(t,r|1),lr(t,mt()),!(Me&6)&&(sa=mt()+500,si()))}break;case 13:Mi(function(){var n=Jn(e,1);if(n!==null){var s=Qt();cn(n,e,1,s)}}),Tm(e,1)}};Jp=function(e){if(e.tag===13){var t=Jn(e,134217728);if(t!==null){var r=Qt();cn(t,e,134217728,r)}Tm(e,134217728)}};I0=function(e){if(e.tag===13){var t=Us(e),r=Jn(e,t);if(r!==null){var n=Qt();cn(r,e,t,n)}Tm(e,t)}};F0=function(){return qe};B0=function(e,t){var r=qe;try{return qe=e,t()}finally{qe=r}};sf=function(e,t,r){switch(t){case"input":if(Zh(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=nd(n);if(!s)throw Error(ne(90));g0(n),Zh(n,s)}}}break;case"textarea":x0(e,r);break;case"select":t=r.value,t!=null&&Eo(e,!!r.multiple,t,!1)}};k0=Em;E0=Mi;var $R={usingClientEntryPoint:!1,Events:[ql,xo,nd,S0,C0,Em]},Oa={findFiberByHostInstance:mi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},HR={bundleType:Oa.bundleType,version:Oa.version,rendererPackageName:Oa.rendererPackageName,rendererConfig:Oa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:is.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=N0(e),e===null?null:e.stateNode},findFiberByHostInstance:Oa.findFiberByHostInstance||FR,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var kc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kc.isDisabled&&kc.supportsFiber)try{Ju=kc.inject(HR),Rn=kc}catch{}}Rr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$R;Rr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Dm(t))throw Error(ne(200));return IR(e,t,null,r)};Rr.createRoot=function(e,t){if(!Dm(e))throw Error(ne(299));var r=!1,n="",s=aw;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Pm(e,1,!1,null,null,r,!1,n,s),e[Xn]=t.current,yl(e.nodeType===8?e.parentNode:e),new Am(t)};Rr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ne(188)):(e=Object.keys(e).join(","),Error(ne(268,e)));return e=N0(t),e=e===null?null:e.stateNode,e};Rr.flushSync=function(e){return Mi(e)};Rr.hydrate=function(e,t,r){if(!hd(t))throw Error(ne(200));return fd(null,e,t,!0,r)};Rr.hydrateRoot=function(e,t,r){if(!Dm(e))throw Error(ne(405));var n=r!=null&&r.hydratedSources||null,s=!1,i="",l=aw;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(l=r.onRecoverableError)),t=ow(t,null,e,1,r??null,s,!1,i,l),e[Xn]=t.current,yl(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new dd(t)};Rr.render=function(e,t,r){if(!hd(t))throw Error(ne(200));return fd(null,e,t,!1,r)};Rr.unmountComponentAtNode=function(e){if(!hd(e))throw Error(ne(40));return e._reactRootContainer?(Mi(function(){fd(null,null,e,!1,function(){e._reactRootContainer=null,e[Xn]=null})}),!0):!1};Rr.unstable_batchedUpdates=Em;Rr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!hd(r))throw Error(ne(200));if(e==null||e._reactInternals===void 0)throw Error(ne(38));return fd(e,t,r,!1,n)};Rr.version="18.3.1-next-f1338f8080-20240426";function lw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(lw)}catch(e){console.error(e)}}lw(),l0.exports=Rr;var pd=l0.exports;const cw=Y_(pd);var dx=pd;Wh.createRoot=dx.createRoot,Wh.hydrateRoot=dx.hydrateRoot;var xa=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(){}},bi,Ss,Bo,B_,UR=(B_=class extends xa{constructor(){super();_e(this,bi);_e(this,Ss);_e(this,Bo);ue(this,Bo,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){F(this,Ss)||this.setEventListener(F(this,Bo))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,Ss))==null||t.call(this),ue(this,Ss,void 0))}setEventListener(t){var r;ue(this,Bo,t),(r=F(this,Ss))==null||r.call(this),ue(this,Ss,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){F(this,bi)!==t&&(ue(this,bi,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof F(this,bi)=="boolean"?F(this,bi):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},bi=new WeakMap,Ss=new WeakMap,Bo=new WeakMap,B_),Lm=new UR,zR={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Cs,Bp,$_,WR=($_=class{constructor(){_e(this,Cs,zR);_e(this,Bp,!1)}setTimeoutProvider(e){ue(this,Cs,e)}setTimeout(e,t){return F(this,Cs).setTimeout(e,t)}clearTimeout(e){F(this,Cs).clearTimeout(e)}setInterval(e,t){return F(this,Cs).setInterval(e,t)}clearInterval(e){F(this,Cs).clearInterval(e)}},Cs=new WeakMap,Bp=new WeakMap,$_),xi=new WR;function VR(e){setTimeout(e,0)}var qR=typeof window>"u"||"Deno"in globalThis;function Gt(){}function KR(e,t){return typeof e=="function"?e(t):e}function Ff(e){return typeof e=="number"&&e>=0&&e!==1/0}function uw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ws(e,t){return typeof e=="function"?e(t):e}function gr(e,t){return typeof e=="function"?e(t):e}function hx(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:l,stale:a}=e;if(l){if(n){if(t.queryHash!==Om(l,t.options))return!1}else if(!Rl(t.queryKey,l))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function fx(e,t){const{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(Ii(t.options.mutationKey)!==Ii(i))return!1}else if(!Rl(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Om(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ii)(e)}function Ii(e){return JSON.stringify(e,(t,r)=>Bf(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Rl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Rl(e[r],t[r])):!1}var GR=Object.prototype.hasOwnProperty;function dw(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=px(e)&&px(t);if(!n&&!(Bf(e)&&Bf(t)))return t;const i=(n?e:Object.keys(e)).length,l=n?t:Object.keys(t),a=l.length,c=n?new Array(a):{};let u=0;for(let m=0;m<a;m++){const d=n?m:l[m],x=e[d],v=t[d];if(x===v){c[d]=x,(n?m<i:GR.call(e,d))&&u++;continue}if(x===null||v===null||typeof x!="object"||typeof v!="object"){c[d]=v;continue}const _=dw(x,v,r+1);c[d]=_,_===x&&u++}return i===a&&u===i?e:c}function Eu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function px(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Bf(e){if(!mx(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!mx(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function mx(e){return Object.prototype.toString.call(e)==="[object Object]"}function QR(e){return new Promise(t=>{xi.setTimeout(t,e)})}function $f(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?dw(e,t):t}function YR(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function ZR(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Mm=Symbol();function hw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Mm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Im(e,t){return typeof e=="function"?e(...t):!!e}function XR(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Nl=(()=>{let e=()=>qR;return{isServer(){return e()},setIsServer(t){e=t}}})();function Hf(){let e,t;const r=new Promise((s,i)=>{e=s,t=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var JR=VR;function eN(){let e=[],t=0,r=a=>{a()},n=a=>{a()},s=JR;const i=a=>{t?e.push(a):s(()=>{r(a)})},l=()=>{const a=e;e=[],a.length&&s(()=>{n(()=>{a.forEach(c=>{r(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||l()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var wt=eN(),$o,ks,Ho,H_,tN=(H_=class extends xa{constructor(){super();_e(this,$o,!0);_e(this,ks);_e(this,Ho);ue(this,Ho,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){F(this,ks)||this.setEventListener(F(this,Ho))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,ks))==null||t.call(this),ue(this,ks,void 0))}setEventListener(t){var r;ue(this,Ho,t),(r=F(this,ks))==null||r.call(this),ue(this,ks,t(this.setOnline.bind(this)))}setOnline(t){F(this,$o)!==t&&(ue(this,$o,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return F(this,$o)}},$o=new WeakMap,ks=new WeakMap,Ho=new WeakMap,H_),ju=new tN;function rN(e){return Math.min(1e3*2**e,3e4)}function fw(e){return(e??"online")==="online"?ju.isOnline():!0}var Uf=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function pw(e){let t=!1,r=0,n;const s=Hf(),i=()=>s.status!=="pending",l=y=>{var h;if(!i()){const p=new Uf(y);x(p),(h=e.onCancel)==null||h.call(e,p)}},a=()=>{t=!0},c=()=>{t=!1},u=()=>Lm.isFocused()&&(e.networkMode==="always"||ju.isOnline())&&e.canRun(),m=()=>fw(e.networkMode)&&e.canRun(),d=y=>{i()||(n==null||n(),s.resolve(y))},x=y=>{i()||(n==null||n(),s.reject(y))},v=()=>new Promise(y=>{var h;n=p=>{(i()||u())&&y(p)},(h=e.onPause)==null||h.call(e)}).then(()=>{var y;n=void 0,i()||(y=e.onContinue)==null||y.call(e)}),_=()=>{if(i())return;let y;const h=r===0?e.initialPromise:void 0;try{y=h??e.fn()}catch(p){y=Promise.reject(p)}Promise.resolve(y).then(d).catch(p=>{var k;if(i())return;const f=e.retry??(Nl.isServer()?0:3),g=e.retryDelay??rN,b=typeof g=="function"?g(r,p):g,w=f===!0||typeof f=="number"&&r<f||typeof f=="function"&&f(r,p);if(t||!w){x(p);return}r++,(k=e.onFail)==null||k.call(e,r,p),QR(b).then(()=>u()?void 0:v()).then(()=>{t?x(p):_()})})};return{promise:s,status:()=>s.status,cancel:l,continue:()=>(n==null||n(),s),cancelRetry:a,continueRetry:c,canStart:m,start:()=>(m()?_():v().then(_),s)}}var wi,U_,mw=(U_=class{constructor(){_e(this,wi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ff(this.gcTime)&&ue(this,wi,xi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Nl.isServer()?1/0:5*60*1e3))}clearGcTimeout(){F(this,wi)!==void 0&&(xi.clearTimeout(F(this,wi)),ue(this,wi,void 0))}},wi=new WeakMap,U_);function nN(e){return{onFetch:(t,r)=>{var m,d,x,v,_;const n=t.options,s=(x=(d=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:d.fetchMore)==null?void 0:x.direction,i=((v=t.state.data)==null?void 0:v.pages)||[],l=((_=t.state.data)==null?void 0:_.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let y=!1;const h=g=>{XR(g,()=>t.signal,()=>y=!0)},p=hw(t.options,t.fetchOptions),f=async(g,b,w)=>{if(y)return Promise.reject(t.signal.reason);if(b==null&&g.pages.length)return Promise.resolve(g);const j=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:b,direction:w?"backward":"forward",meta:t.options.meta};return h(O),O})(),S=await p(j),{maxPages:E}=t.options,N=w?ZR:YR;return{pages:N(g.pages,S,E),pageParams:N(g.pageParams,b,E)}};if(s&&i.length){const g=s==="backward",b=g?gw:zf,w={pages:i,pageParams:l},k=b(n,w);a=await f(w,k,g)}else{const g=e??i.length;do{const b=c===0?l[0]??n.initialPageParam:zf(n,a);if(c>0&&b==null)break;a=await f(a,b),c++}while(c<g)}return a};t.options.persister?t.fetchFn=()=>{var y,h;return(h=(y=t.options).persister)==null?void 0:h.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function zf(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function gw(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}function sN(e,t){return t?zf(e,t)!=null:!1}function iN(e,t){return!t||!e.getPreviousPageParam?!1:gw(e,t)!=null}var Uo,Si,zo,Pr,Ci,Et,Fl,ki,mr,vw,Bn,z_,oN=(z_=class extends mw{constructor(t){super();_e(this,mr);_e(this,Uo);_e(this,Si);_e(this,zo);_e(this,Pr);_e(this,Ci);_e(this,Et);_e(this,Fl);_e(this,ki);ue(this,ki,!1),ue(this,Fl,t.defaultOptions),this.setOptions(t.options),this.observers=[],ue(this,Ci,t.client),ue(this,Pr,F(this,Ci).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ue(this,Si,vx(this.options)),this.state=t.state??F(this,Si),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return F(this,Uo)}get promise(){var t;return(t=F(this,Et))==null?void 0:t.promise}setOptions(t){if(this.options={...F(this,Fl),...t},t!=null&&t._type&&ue(this,Uo,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=vx(this.options);r.data!==void 0&&(this.setState(gx(r.data,r.dataUpdatedAt)),ue(this,Si,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,Pr).remove(this)}setData(t,r){const n=$f(this.state.data,t,this.options);return Ne(this,mr,Bn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Ne(this,mr,Bn).call(this,{type:"setState",state:t})}cancel(t){var n,s;const r=(n=F(this,Et))==null?void 0:n.promise;return(s=F(this,Et))==null||s.cancel(t),r?r.then(Gt).catch(Gt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return F(this,Si)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>gr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Mm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ws(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:!uw(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=F(this,Et))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=F(this,Et))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),F(this,Pr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(F(this,Et)&&(F(this,ki)||Ne(this,mr,vw).call(this)?F(this,Et).cancel({revert:!0}):F(this,Et).cancelRetry()),this.scheduleGc()),F(this,Pr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ne(this,mr,Bn).call(this,{type:"invalidate"})}async fetch(t,r){var u,m,d,x,v,_,y,h,p,f,g;if(this.state.fetchStatus!=="idle"&&((u=F(this,Et))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(F(this,Et))return F(this,Et).continueRetry(),F(this,Et).promise}if(t&&this.setOptions(t),!this.options.queryFn){const b=this.observers.find(w=>w.options.queryFn);b&&this.setOptions(b.options)}const n=new AbortController,s=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(ue(this,ki,!0),n.signal)})},i=()=>{const b=hw(this.options,r),k=(()=>{const j={client:F(this,Ci),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return ue(this,ki,!1),this.options.persister?this.options.persister(b,k,this):b(k)},a=(()=>{const b={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:F(this,Ci),state:this.state,fetchFn:i};return s(b),b})(),c=F(this,Uo)==="infinite"?nN(this.options.pages):this.options.behavior;c==null||c.onFetch(a,this),ue(this,zo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=a.fetchOptions)==null?void 0:m.meta))&&Ne(this,mr,Bn).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta}),ue(this,Et,pw({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,onCancel:b=>{b instanceof Uf&&b.revert&&this.setState({...F(this,zo),fetchStatus:"idle"}),n.abort()},onFail:(b,w)=>{Ne(this,mr,Bn).call(this,{type:"failed",failureCount:b,error:w})},onPause:()=>{Ne(this,mr,Bn).call(this,{type:"pause"})},onContinue:()=>{Ne(this,mr,Bn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const b=await F(this,Et).start();if(b===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(b),(v=(x=F(this,Pr).config).onSuccess)==null||v.call(x,b,this),(y=(_=F(this,Pr).config).onSettled)==null||y.call(_,b,this.state.error,this),b}catch(b){if(b instanceof Uf){if(b.silent)return F(this,Et).promise;if(b.revert){if(this.state.data===void 0)throw b;return this.state.data}}throw Ne(this,mr,Bn).call(this,{type:"error",error:b}),(p=(h=F(this,Pr).config).onError)==null||p.call(h,b,this),(g=(f=F(this,Pr).config).onSettled)==null||g.call(f,this.state.data,b,this),b}finally{this.scheduleGc()}}},Uo=new WeakMap,Si=new WeakMap,zo=new WeakMap,Pr=new WeakMap,Ci=new WeakMap,Et=new WeakMap,Fl=new WeakMap,ki=new WeakMap,mr=new WeakSet,vw=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Bn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...xw(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...gx(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ue(this,zo,t.manual?s:void 0),s;case"error":const i=t.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),wt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),F(this,Pr).notify({query:this,type:"updated",action:t})})},z_);function xw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:fw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function gx(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function vx(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var tr,Oe,Bl,qt,Ei,Wo,Un,Es,$l,Vo,qo,ji,Ri,js,Ko,He,Qa,Wf,Vf,qf,Kf,Gf,Qf,Yf,_w,W_,yw=(W_=class extends xa{constructor(t,r){super();_e(this,He);_e(this,tr);_e(this,Oe);_e(this,Bl);_e(this,qt);_e(this,Ei);_e(this,Wo);_e(this,Un);_e(this,Es);_e(this,$l);_e(this,Vo);_e(this,qo);_e(this,ji);_e(this,Ri);_e(this,js);_e(this,Ko,new Set);this.options=r,ue(this,tr,t),ue(this,Es,null),ue(this,Un,Hf()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,Oe).addObserver(this),xx(F(this,Oe),this.options)?Ne(this,He,Qa).call(this):this.updateResult(),Ne(this,He,Kf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Zf(F(this,Oe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Zf(F(this,Oe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ne(this,He,Gf).call(this),Ne(this,He,Qf).call(this),F(this,Oe).removeObserver(this)}setOptions(t){const r=this.options,n=F(this,Oe);if(this.options=F(this,tr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof gr(this.options.enabled,F(this,Oe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ne(this,He,Yf).call(this),F(this,Oe).setOptions(this.options),r._defaulted&&!Eu(this.options,r)&&F(this,tr).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,Oe),observer:this});const s=this.hasListeners();s&&yx(F(this,Oe),n,this.options,r)&&Ne(this,He,Qa).call(this),this.updateResult(),s&&(F(this,Oe)!==n||gr(this.options.enabled,F(this,Oe))!==gr(r.enabled,F(this,Oe))||Ws(this.options.staleTime,F(this,Oe))!==Ws(r.staleTime,F(this,Oe)))&&Ne(this,He,Wf).call(this);const i=Ne(this,He,Vf).call(this);s&&(F(this,Oe)!==n||gr(this.options.enabled,F(this,Oe))!==gr(r.enabled,F(this,Oe))||i!==F(this,js))&&Ne(this,He,qf).call(this,i)}getOptimisticResult(t){const r=F(this,tr).getQueryCache().build(F(this,tr),t),n=this.createResult(r,t);return lN(this,n)&&(ue(this,qt,n),ue(this,Wo,this.options),ue(this,Ei,F(this,Oe).state)),n}getCurrentResult(){return F(this,qt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&F(this,Un).status==="pending"&&F(this,Un).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){F(this,Ko).add(t)}getCurrentQuery(){return F(this,Oe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=F(this,tr).defaultQueryOptions(t),n=F(this,tr).getQueryCache().build(F(this,tr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Ne(this,He,Qa).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,qt)))}createResult(t,r){var E;const n=F(this,Oe),s=this.options,i=F(this,qt),l=F(this,Ei),a=F(this,Wo),u=t!==n?t.state:F(this,Bl),{state:m}=t;let d={...m},x=!1,v;if(r._optimisticResults){const N=this.hasListeners(),O=!N&&xx(t,r),T=N&&yx(t,n,r,s);(O||T)&&(d={...d,...xw(m.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:_,errorUpdatedAt:y,status:h}=d;v=d.data;let p=!1;if(r.placeholderData!==void 0&&v===void 0&&h==="pending"){let N;i!=null&&i.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData)?(N=i.data,p=!0):N=typeof r.placeholderData=="function"?r.placeholderData((E=F(this,qo))==null?void 0:E.state.data,F(this,qo)):r.placeholderData,N!==void 0&&(h="success",v=$f(i==null?void 0:i.data,N,r),x=!0)}if(r.select&&v!==void 0&&!p)if(i&&v===(l==null?void 0:l.data)&&r.select===F(this,$l))v=F(this,Vo);else try{ue(this,$l,r.select),v=r.select(v),v=$f(i==null?void 0:i.data,v,r),ue(this,Vo,v),ue(this,Es,null)}catch(N){ue(this,Es,N)}F(this,Es)&&(_=F(this,Es),v=F(this,Vo),y=Date.now(),h="error");const f=d.fetchStatus==="fetching",g=h==="pending",b=h==="error",w=g&&f,k=v!==void 0,S={status:h,fetchStatus:d.fetchStatus,isPending:g,isSuccess:h==="success",isError:b,isInitialLoading:w,isLoading:w,data:v,dataUpdatedAt:d.dataUpdatedAt,error:_,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:f,isRefetching:f&&!g,isLoadingError:b&&!k,isPaused:d.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:b&&k,isStale:Fm(t,r),refetch:this.refetch,promise:F(this,Un),isEnabled:gr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const N=S.data!==void 0,O=S.status==="error"&&!N,T=U=>{O?U.reject(S.error):N&&U.resolve(S.data)},L=()=>{const U=ue(this,Un,S.promise=Hf());T(U)},$=F(this,Un);switch($.status){case"pending":t.queryHash===n.queryHash&&T($);break;case"fulfilled":(O||S.data!==$.value)&&L();break;case"rejected":(!O||S.error!==$.reason)&&L();break}}return S}updateResult(){const t=F(this,qt),r=this.createResult(F(this,Oe),this.options);if(ue(this,Ei,F(this,Oe).state),ue(this,Wo,this.options),F(this,Ei).data!==void 0&&ue(this,qo,F(this,Oe)),Eu(r,t))return;ue(this,qt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!F(this,Ko).size)return!0;const l=new Set(i??F(this,Ko));return this.options.throwOnError&&l.add("error"),Object.keys(F(this,qt)).some(a=>{const c=a;return F(this,qt)[c]!==t[c]&&l.has(c)})};Ne(this,He,_w).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ne(this,He,Kf).call(this)}},tr=new WeakMap,Oe=new WeakMap,Bl=new WeakMap,qt=new WeakMap,Ei=new WeakMap,Wo=new WeakMap,Un=new WeakMap,Es=new WeakMap,$l=new WeakMap,Vo=new WeakMap,qo=new WeakMap,ji=new WeakMap,Ri=new WeakMap,js=new WeakMap,Ko=new WeakMap,He=new WeakSet,Qa=function(t){Ne(this,He,Yf).call(this);let r=F(this,Oe).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Gt)),r},Wf=function(){Ne(this,He,Gf).call(this);const t=Ws(this.options.staleTime,F(this,Oe));if(Nl.isServer()||F(this,qt).isStale||!Ff(t))return;const n=uw(F(this,qt).dataUpdatedAt,t)+1;ue(this,ji,xi.setTimeout(()=>{F(this,qt).isStale||this.updateResult()},n))},Vf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(F(this,Oe)):this.options.refetchInterval)??!1},qf=function(t){Ne(this,He,Qf).call(this),ue(this,js,t),!(Nl.isServer()||gr(this.options.enabled,F(this,Oe))===!1||!Ff(F(this,js))||F(this,js)===0)&&ue(this,Ri,xi.setInterval(()=>{(this.options.refetchIntervalInBackground||Lm.isFocused())&&Ne(this,He,Qa).call(this)},F(this,js)))},Kf=function(){Ne(this,He,Wf).call(this),Ne(this,He,qf).call(this,Ne(this,He,Vf).call(this))},Gf=function(){F(this,ji)!==void 0&&(xi.clearTimeout(F(this,ji)),ue(this,ji,void 0))},Qf=function(){F(this,Ri)!==void 0&&(xi.clearInterval(F(this,Ri)),ue(this,Ri,void 0))},Yf=function(){const t=F(this,tr).getQueryCache().build(F(this,tr),this.options);if(t===F(this,Oe))return;const r=F(this,Oe);ue(this,Oe,t),ue(this,Bl,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},_w=function(t){wt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(F(this,qt))}),F(this,tr).getQueryCache().notify({query:F(this,Oe),type:"observerResultsUpdated"})})},W_);function aN(e,t){return gr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&gr(t.retryOnMount,e)===!1)}function xx(e,t){return aN(e,t)||e.state.data!==void 0&&Zf(e,t,t.refetchOnMount)}function Zf(e,t,r){if(gr(t.enabled,e)!==!1&&Ws(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Fm(e,t)}return!1}function yx(e,t,r,n){return(e!==t||gr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Fm(e,r)}function Fm(e,t){return gr(t.enabled,e)!==!1&&e.isStaleByTime(Ws(t.staleTime,e))}function lN(e,t){return!Eu(e.getCurrentResult(),t)}var cN=class extends yw{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var _,y;const{state:r}=e,n=super.createResult(e,t),{isFetching:s,isRefetching:i,isError:l,isRefetchError:a}=n,c=(y=(_=r.fetchMeta)==null?void 0:_.fetchMore)==null?void 0:y.direction,u=l&&c==="forward",m=s&&c==="forward",d=l&&c==="backward",x=s&&c==="backward";return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:sN(t,r.data),hasPreviousPage:iN(t,r.data),isFetchNextPageError:u,isFetchingNextPage:m,isFetchPreviousPageError:d,isFetchingPreviousPage:x,isRefetchError:a&&!u&&!d,isRefetching:i&&!m&&!x}}},Hl,bn,It,Ni,wn,ps,V_,uN=(V_=class extends mw{constructor(t){super();_e(this,wn);_e(this,Hl);_e(this,bn);_e(this,It);_e(this,Ni);ue(this,Hl,t.client),this.mutationId=t.mutationId,ue(this,It,t.mutationCache),ue(this,bn,[]),this.state=t.state||bw(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){F(this,bn).includes(t)||(F(this,bn).push(t),this.clearGcTimeout(),F(this,It).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ue(this,bn,F(this,bn).filter(r=>r!==t)),this.scheduleGc(),F(this,It).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){F(this,bn).length||(this.state.status==="pending"?this.scheduleGc():F(this,It).remove(this))}continue(){var t;return((t=F(this,Ni))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,a,c,u,m,d,x,v,_,y,h,p,f,g,b,w,k,j;const r=()=>{Ne(this,wn,ps).call(this,{type:"continue"})},n={client:F(this,Hl),meta:this.options.meta,mutationKey:this.options.mutationKey};ue(this,Ni,pw({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(S,E)=>{Ne(this,wn,ps).call(this,{type:"failed",failureCount:S,error:E})},onPause:()=>{Ne(this,wn,ps).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,It).canRun(this)}));const s=this.state.status==="pending",i=!F(this,Ni).canStart();try{if(s)r();else{Ne(this,wn,ps).call(this,{type:"pending",variables:t,isPaused:i}),F(this,It).config.onMutate&&await F(this,It).config.onMutate(t,this,n);const E=await((a=(l=this.options).onMutate)==null?void 0:a.call(l,t,n));E!==this.state.context&&Ne(this,wn,ps).call(this,{type:"pending",context:E,variables:t,isPaused:i})}const S=await F(this,Ni).start();return await((u=(c=F(this,It).config).onSuccess)==null?void 0:u.call(c,S,t,this.state.context,this,n)),await((d=(m=this.options).onSuccess)==null?void 0:d.call(m,S,t,this.state.context,n)),await((v=(x=F(this,It).config).onSettled)==null?void 0:v.call(x,S,null,this.state.variables,this.state.context,this,n)),await((y=(_=this.options).onSettled)==null?void 0:y.call(_,S,null,t,this.state.context,n)),Ne(this,wn,ps).call(this,{type:"success",data:S}),S}catch(S){try{await((p=(h=F(this,It).config).onError)==null?void 0:p.call(h,S,t,this.state.context,this,n))}catch(E){Promise.reject(E)}try{await((g=(f=this.options).onError)==null?void 0:g.call(f,S,t,this.state.context,n))}catch(E){Promise.reject(E)}try{await((w=(b=F(this,It).config).onSettled)==null?void 0:w.call(b,void 0,S,this.state.variables,this.state.context,this,n))}catch(E){Promise.reject(E)}try{await((j=(k=this.options).onSettled)==null?void 0:j.call(k,void 0,S,t,this.state.context,n))}catch(E){Promise.reject(E)}throw Ne(this,wn,ps).call(this,{type:"error",error:S}),S}finally{F(this,It).runNext(this)}}},Hl=new WeakMap,bn=new WeakMap,It=new WeakMap,Ni=new WeakMap,wn=new WeakSet,ps=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),wt.batch(()=>{F(this,bn).forEach(n=>{n.onMutationUpdate(t)}),F(this,It).notify({mutation:this,type:"updated",action:t})})},V_);function bw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var zn,Jr,Ul,q_,dN=(q_=class extends xa{constructor(t={}){super();_e(this,zn);_e(this,Jr);_e(this,Ul);this.config=t,ue(this,zn,new Set),ue(this,Jr,new Map),ue(this,Ul,0)}build(t,r,n){const s=new uN({client:t,mutationCache:this,mutationId:++lc(this,Ul)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){F(this,zn).add(t);const r=Ec(t);if(typeof r=="string"){const n=F(this,Jr).get(r);n?n.push(t):F(this,Jr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(F(this,zn).delete(t)){const r=Ec(t);if(typeof r=="string"){const n=F(this,Jr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&F(this,Jr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Ec(t);if(typeof r=="string"){const n=F(this,Jr).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Ec(t);if(typeof r=="string"){const s=(n=F(this,Jr).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){wt.batch(()=>{F(this,zn).forEach(t=>{this.notify({type:"removed",mutation:t})}),F(this,zn).clear(),F(this,Jr).clear()})}getAll(){return Array.from(F(this,zn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>fx(r,n))}findAll(t={}){return this.getAll().filter(r=>fx(t,r))}notify(t){wt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return wt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Gt))))}},zn=new WeakMap,Jr=new WeakMap,Ul=new WeakMap,q_);function Ec(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Wn,Rs,rr,Vn,Yn,Xc,Xf,K_,hN=(K_=class extends xa{constructor(r,n){super();_e(this,Yn);_e(this,Wn);_e(this,Rs);_e(this,rr);_e(this,Vn);ue(this,Wn,r),this.setOptions(n),this.bindMethods(),Ne(this,Yn,Xc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var s;const n=this.options;this.options=F(this,Wn).defaultMutationOptions(r),Eu(this.options,n)||F(this,Wn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:F(this,rr),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Ii(n.mutationKey)!==Ii(this.options.mutationKey)?this.reset():((s=F(this,rr))==null?void 0:s.state.status)==="pending"&&F(this,rr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=F(this,rr))==null||r.removeObserver(this)}onMutationUpdate(r){Ne(this,Yn,Xc).call(this),Ne(this,Yn,Xf).call(this,r)}getCurrentResult(){return F(this,Rs)}reset(){var r;(r=F(this,rr))==null||r.removeObserver(this),ue(this,rr,void 0),Ne(this,Yn,Xc).call(this),Ne(this,Yn,Xf).call(this)}mutate(r,n){var s;return ue(this,Vn,n),(s=F(this,rr))==null||s.removeObserver(this),ue(this,rr,F(this,Wn).getMutationCache().build(F(this,Wn),this.options)),F(this,rr).addObserver(this),F(this,rr).execute(r)}},Wn=new WeakMap,Rs=new WeakMap,rr=new WeakMap,Vn=new WeakMap,Yn=new WeakSet,Xc=function(){var n;const r=((n=F(this,rr))==null?void 0:n.state)??bw();ue(this,Rs,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Xf=function(r){wt.batch(()=>{var n,s,i,l,a,c,u,m;if(F(this,Vn)&&this.hasListeners()){const d=F(this,Rs).variables,x=F(this,Rs).context,v={client:F(this,Wn),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(s=(n=F(this,Vn)).onSuccess)==null||s.call(n,r.data,d,x,v)}catch(_){Promise.reject(_)}try{(l=(i=F(this,Vn)).onSettled)==null||l.call(i,r.data,null,d,x,v)}catch(_){Promise.reject(_)}}else if((r==null?void 0:r.type)==="error"){try{(c=(a=F(this,Vn)).onError)==null||c.call(a,r.error,d,x,v)}catch(_){Promise.reject(_)}try{(m=(u=F(this,Vn)).onSettled)==null||m.call(u,void 0,r.error,d,x,v)}catch(_){Promise.reject(_)}}}this.listeners.forEach(d=>{d(F(this,Rs))})})},K_),Sn,G_,fN=(G_=class extends xa{constructor(t={}){super();_e(this,Sn);this.config=t,ue(this,Sn,new Map)}build(t,r,n){const s=r.queryKey,i=r.queryHash??Om(s,r);let l=this.get(i);return l||(l=new oN({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){F(this,Sn).has(t.queryHash)||(F(this,Sn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=F(this,Sn).get(t.queryHash);r&&(t.destroy(),r===t&&F(this,Sn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){wt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return F(this,Sn).get(t)}getAll(){return[...F(this,Sn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>hx(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>hx(t,n)):r}notify(t){wt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){wt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){wt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Sn=new WeakMap,G_),dt,Ns,Ps,Go,Qo,Ts,Yo,Zo,Q_,pN=(Q_=class{constructor(e={}){_e(this,dt);_e(this,Ns);_e(this,Ps);_e(this,Go);_e(this,Qo);_e(this,Ts);_e(this,Yo);_e(this,Zo);ue(this,dt,e.queryCache||new fN),ue(this,Ns,e.mutationCache||new dN),ue(this,Ps,e.defaultOptions||{}),ue(this,Go,new Map),ue(this,Qo,new Map),ue(this,Ts,0)}mount(){lc(this,Ts)._++,F(this,Ts)===1&&(ue(this,Yo,Lm.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,dt).onFocus())})),ue(this,Zo,ju.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,dt).onOnline())})))}unmount(){var e,t;lc(this,Ts)._--,F(this,Ts)===0&&((e=F(this,Yo))==null||e.call(this),ue(this,Yo,void 0),(t=F(this,Zo))==null||t.call(this),ue(this,Zo,void 0))}isFetching(e){return F(this,dt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return F(this,Ns).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=F(this,dt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=F(this,dt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ws(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return F(this,dt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=F(this,dt).get(n.queryHash),i=s==null?void 0:s.state.data,l=KR(t,i);if(l!==void 0)return F(this,dt).build(this,n).setData(l,{...r,manual:!0})}setQueriesData(e,t,r){return wt.batch(()=>F(this,dt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=F(this,dt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=F(this,dt);wt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=F(this,dt);return wt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=wt.batch(()=>F(this,dt).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Gt).catch(Gt)}invalidateQueries(e,t={}){return wt.batch(()=>(F(this,dt).findAll(e).forEach(r=>{r.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 r={...t,cancelRefetch:t.cancelRefetch??!0},n=wt.batch(()=>F(this,dt).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(Gt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(Gt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=F(this,dt).build(this,t);return r.isStaleByTime(Ws(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Gt).catch(Gt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Gt).catch(Gt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return ju.isOnline()?F(this,Ns).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,dt)}getMutationCache(){return F(this,Ns)}getDefaultOptions(){return F(this,Ps)}setDefaultOptions(e){ue(this,Ps,e)}setQueryDefaults(e,t){F(this,Go).set(Ii(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...F(this,Go).values()],r={};return t.forEach(n=>{Rl(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){F(this,Qo).set(Ii(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...F(this,Qo).values()],r={};return t.forEach(n=>{Rl(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...F(this,Ps).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Om(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===Mm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...F(this,Ps).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){F(this,dt).clear(),F(this,Ns).clear()}},dt=new WeakMap,Ns=new WeakMap,Ps=new WeakMap,Go=new WeakMap,Qo=new WeakMap,Ts=new WeakMap,Yo=new WeakMap,Zo=new WeakMap,Q_),ww=C.createContext(void 0),ii=e=>{const t=C.useContext(ww);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},mN=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(ww.Provider,{value:e,children:t})),Sw=C.createContext(!1),gN=()=>C.useContext(Sw);Sw.Provider;function vN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xN=C.createContext(vN()),yN=()=>C.useContext(xN),_N=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Im(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},bN=e=>{C.useEffect(()=>{e.clearReset()},[e])},wN=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Im(r,[e.error,n])),SN=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},CN=(e,t)=>e.isLoading&&e.isFetching&&!t,kN=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,_x=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Cw(e,t,r){var x,v,_,y;const n=gN(),s=yN(),i=ii(),l=i.defaultQueryOptions(e);(v=(x=i.getDefaultOptions().queries)==null?void 0:x._experimental_beforeQuery)==null||v.call(x,l);const a=i.getQueryCache().get(l.queryHash);l._optimisticResults=n?"isRestoring":"optimistic",SN(l),_N(l,s,a),bN(s);const c=!i.getQueryCache().get(l.queryHash),[u]=C.useState(()=>new t(i,l)),m=u.getOptimisticResult(l),d=!n&&e.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(h=>{const p=d?u.subscribe(wt.batchCalls(h)):Gt;return u.updateResult(),p},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),C.useEffect(()=>{u.setOptions(l)},[l,u]),kN(l,m))throw _x(l,u,s);if(wN({result:m,errorResetBoundary:s,throwOnError:l.throwOnError,query:a,suspense:l.suspense}))throw m.error;if((y=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||y.call(_,l,m),l.experimental_prefetchInRender&&!Nl.isServer()&&CN(m,n)){const h=c?_x(l,u,s):a==null?void 0:a.promise;h==null||h.catch(Gt).finally(()=>{u.updateResult()})}return l.notifyOnChangeProps?m:u.trackResult(m)}function Te(e,t){return Cw(e,yw)}function Qn(e,t){const r=ii(),[n]=C.useState(()=>new hN(r,e));C.useEffect(()=>{n.setOptions(e)},[n,e]);const s=C.useSyncExternalStore(C.useCallback(l=>n.subscribe(wt.batchCalls(l)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=C.useCallback((l,a)=>{n.mutate(l,a).catch(Gt)},[n]);if(s.error&&Im(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}function EN(e,t){return Cw(e,cN)}function jN(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,n,s,i,l=[],a="",c=e.split("/");for(c[0]||c.shift();s=c.shift();)r=s[0],r==="*"?(l.push(r),a+=s[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(n=s.indexOf("?",1),i=s.indexOf(".",1),l.push(s.substring(1,~n?n:~i?i:s.length)),a+=~n&&!~i?"(?:/([^/]+?))?":"/([^/]+?)",~i&&(a+=(~n?"?":"")+"\\"+s.substring(i))):a+="/"+s;return{keys:l,pattern:new RegExp("^"+a+(t?"(?=$|/)":"/?$"),"i")}}var kw={exports:{}},Ew={};/**
|
|
41
|
+
* @license React
|
|
42
|
+
* use-sync-external-store-shim.production.js
|
|
43
|
+
*
|
|
44
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/var ia=C;function RN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var NN=typeof Object.is=="function"?Object.is:RN,PN=ia.useState,TN=ia.useEffect,AN=ia.useLayoutEffect,DN=ia.useDebugValue;function LN(e,t){var r=t(),n=PN({inst:{value:r,getSnapshot:t}}),s=n[0].inst,i=n[1];return AN(function(){s.value=r,s.getSnapshot=t,mh(s)&&i({inst:s})},[e,r,t]),TN(function(){return mh(s)&&i({inst:s}),e(function(){mh(s)&&i({inst:s})})},[e]),DN(r),r}function mh(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!NN(e,r)}catch{return!0}}function ON(e,t){return t()}var MN=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ON:LN;Ew.useSyncExternalStore=ia.useSyncExternalStore!==void 0?ia.useSyncExternalStore:MN;kw.exports=Ew;var IN=kw.exports;const FN=Xu.useInsertionEffect,BN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jw=BN?C.useLayoutEffect:C.useEffect,$N=FN||jw,Bm=e=>{const t=C.useRef([e,(...r)=>t[0](...r)]).current;return $N(()=>{t[0]=e}),t[1]},HN="popstate",$m="pushState",Hm="replaceState",UN="hashchange",bx=[HN,$m,Hm,UN],zN=e=>{for(const t of bx)addEventListener(t,e);return()=>{for(const t of bx)removeEventListener(t,e)}},Rw=(e,t)=>IN.useSyncExternalStore(zN,e,t),wx=()=>location.search,WN=({ssrSearch:e}={})=>Rw(wx,e!=null?()=>e:wx),Sx=()=>location.pathname,VN=({ssrPath:e}={})=>Rw(Sx,e!=null?()=>e:Sx),qN=(e,{replace:t=!1,state:r=null}={})=>history[t?Hm:$m](r,"",e),KN=(e={})=>[VN(e),qN],Cx=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[Cx]>"u"){for(const e of[$m,Hm]){const t=history[e];history[e]=function(){const r=t.apply(this,arguments),n=new Event(e);return n.arguments=arguments,dispatchEvent(n),r}}Object.defineProperty(window,Cx,{value:!0})}const GN=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",Nw=(e="")=>e==="/"?"":e,QN=(e,t)=>e[0]==="~"?e.slice(1):Nw(t)+e,YN=(e="",t)=>GN(kx(Nw(e)),kx(t)),kx=e=>{try{return decodeURI(e)}catch{return e}},Pw={hook:KN,searchHook:WN,parser:jN,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,r)=>e(t,r)},Tw=C.createContext(Pw),zi=()=>C.useContext(Tw),Aw={},Dw=C.createContext(Aw),md=()=>C.useContext(Dw),Gl=e=>{const[t,r]=e.hook(e);return[YN(e.base,t),Bm((n,s)=>e.aroundNav(r,QN(n,e.base),s))]},Hr=()=>Gl(zi()),Um=(e,t,r,n)=>{const{pattern:s,keys:i}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",n),l=s.exec(r)||[],[a,...c]=l;return a!==void 0?[!0,(()=>{const u=i!==!1?Object.fromEntries(i.map((d,x)=>[d,c[x]])):l.groups;let m={...c};return u&&Object.assign(m,u),m})(),...n?[a]:[]]:[!1,null]},ZN=e=>Um(zi().parser,e,Hr()[0]),Lw=({children:e,...t})=>{var m,d,x;const r=zi(),n=t.hook?Pw:r;let s=n;const[i,l=t.ssrSearch??""]=((m=t.ssrPath)==null?void 0:m.split("?"))??[];i&&(t.ssrSearch=l,t.ssrPath=i),t.hrefs=t.hrefs??((d=t.hook)==null?void 0:d.hrefs),t.searchHook=t.searchHook??((x=t.hook)==null?void 0:x.searchHook);let a=C.useRef({}),c=a.current,u=c;for(let v in n){const _=v==="base"?n[v]+(t[v]??""):t[v]??n[v];c===u&&_!==u[v]&&(a.current=u={...u}),u[v]=_,(_!==n[v]||_!==s[v])&&(s=u)}return C.createElement(Tw.Provider,{value:s,children:e})},Ex=({children:e,component:t},r)=>t?C.createElement(t,{params:r}):typeof e=="function"?e(r):e,XN=e=>{let t=C.useRef(Aw);const r=t.current;return t.current=Object.keys(e).length!==Object.keys(r).length||Object.entries(e).some(([n,s])=>s!==r[n])?e:r},Pt=({path:e,nest:t,match:r,...n})=>{const s=zi(),[i]=Gl(s),[l,a,c]=r??Um(s.parser,e,i,t),u=XN({...md(),...a});if(!l)return null;const m=c?C.createElement(Lw,{base:c},Ex(n,u)):Ex(n,u);return C.createElement(Dw.Provider,{value:u,children:m})},cr=C.forwardRef((e,t)=>{const r=zi(),[n,s]=Gl(r),{to:i="",href:l=i,onClick:a,asChild:c,children:u,className:m,replace:d,state:x,transition:v,..._}=e,y=Bm(p=>{p.ctrlKey||p.metaKey||p.altKey||p.shiftKey||p.button!==0||(a==null||a(p),p.defaultPrevented||(p.preventDefault(),s(l,e)))}),h=r.hrefs(l[0]==="~"?l.slice(1):r.base+l,r);return c&&C.isValidElement(u)?C.cloneElement(u,{onClick:y,href:h}):C.createElement("a",{..._,onClick:y,href:h,className:m!=null&&m.call?m(n===l):m,children:u,ref:t})}),Ow=e=>Array.isArray(e)?e.flatMap(t=>Ow(t&&t.type===C.Fragment?t.props.children:t)):[e],JN=({children:e,location:t})=>{const r=zi(),[n]=Gl(r);for(const s of Ow(e)){let i=0;if(C.isValidElement(s)&&(i=Um(r.parser,s.props.path,t||n,s.props.nest))[0])return C.cloneElement(s,{match:i})}return null},Ya=e=>{const{to:t,href:r=t}=e,n=zi(),[,s]=Gl(n),i=Bm(()=>s(t||r,e)),{ssrContext:l}=n;return jw(()=>{i()},[]),l&&(l.redirectTo=t),null};async function e2(e){if(!(e.headers.get("content-type")??"").includes("application/json"))return null;try{const r=await e.json();if(typeof r!="object"||r===null)return null;const n=r;return{error:typeof n.error=="string"?n.error:void 0,message:typeof n.message=="string"?n.message:void 0}}catch{return null}}async function be(e,t){const r=await fetch(e,{credentials:"same-origin",headers:{Accept:"application/json",...(t==null?void 0:t.headers)??{}},...t});if(!r.ok){const n=await e2(r),s=(n==null?void 0:n.message)??(n==null?void 0:n.error),i=new Error(s?`${r.status} ${r.statusText}: ${s} on ${e}`:`${r.status} ${r.statusText} on ${e}`);throw i.status=r.status,i.code=n==null?void 0:n.error,i}return r.json()}const me={getStatus:()=>be("/v1/status"),getBootstrap:()=>be("/v1/bootstrap"),getRecentEvents:(e,t=100)=>{const r=new URLSearchParams;return e&&e.length>0&&r.set("kinds",e.join(",")),r.set("limit",String(t)),be(`/v1/events/recent?${r.toString()}`)},getActivityEvents:e=>{const t=new URLSearchParams;e!=null&&e.kinds&&e.kinds.length>0&&t.set("kinds",e.kinds.join(",")),e!=null&&e.outcome&&t.set("outcome",e.outcome),e!=null&&e.requestId&&t.set("requestId",e.requestId),(e==null?void 0:e.beforeId)!==void 0&&t.set("beforeId",String(e.beforeId)),(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit));const r=t.toString();return be(`/v1/activity-events${r?`?${r}`:""}`)},getActivityEvent:e=>be(`/v1/activity-events/${encodeURIComponent(String(e))}`),getClaudeAuth:()=>be("/v1/auth/claude"),installClaudeCode:()=>be("/v1/setup/claude/install",{method:"POST"}),signInClaude:()=>be("/v1/auth/claude/spawn",{method:"POST"}),triggerDrip:e=>be(e!=null&&e.singleDrip?"/v1/setup/drip?singleDrip=true":"/v1/setup/drip",{method:"POST"}),changeKeystorePassword:(e,t)=>be("/v1/setup/change-password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({current:e,next:t})}),restartDaemon:e=>be("/api/admin/restart",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),stopDaemon:()=>be("/api/admin/stop",{method:"POST"}),getSolverNets:()=>be("/v1/solvernets"),updateSolverNet:(e,t)=>be(`/v1/setup/solvernets/${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),updateNetwork:e=>be("/v1/setup/network",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),retryAgentBinding:e=>be("/v1/setup/agent-binding/retry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),retryBootstrap:()=>be("/v1/setup/bootstrap/retry",{method:"POST"}),updateHarnessMode:e=>be("/v1/setup/harness",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:e})}),hermesDoctor:()=>be("/api/hermes/doctor"),codexDoctor:()=>be("/api/codex/doctor"),harnessReadiness:e=>be(`/v1/harnesses/${encodeURIComponent(e)}/readiness`),fetchLauncherStatus:()=>be("/v1/launcher/status"),fetchLauncherTasks:(e={})=>{const t=new URLSearchParams;e.cursor&&t.set("cursor",e.cursor),e.limit!==void 0&&t.set("limit",String(e.limit));const r=t.toString();return be(`/v1/launcher/tasks${r?`?${r}`:""}`)},patchLauncherSolverNet:(e,t)=>be(`/v1/launcher/solvernets/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),solvernets:{listDrafts:()=>be("/v1/solvernets/drafts"),getDraft:e=>be(`/v1/solvernets/drafts/${encodeURIComponent(e)}`),createDraft:e=>be("/v1/solvernets/drafts",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e??{})}),updateDraft:(e,t)=>be(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),deleteDraft:e=>be(`/v1/solvernets/drafts/${encodeURIComponent(e)}`,{method:"DELETE"}),launch:e=>be(`/v1/solvernets/drafts/${encodeURIComponent(e)}/launch`,{method:"POST"}),transitionLifecycle:(e,t)=>be(`/v1/solvernets/launched/${encodeURIComponent(e)}/lifecycle`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({target:t})}),updateGeneratorConfig:(e,t)=>be(`/v1/solvernets/launched/${encodeURIComponent(e)}/generator-config`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),get:e=>be(`/v1/solvernets/launched/${encodeURIComponent(e)}`),listLaunched:e=>{const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status);const r=t.toString();return be(`/v1/solvernets/launched${r?`?${r}`:""}`)},listRegistry:e=>{const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.refresh&&t.set("refresh","1");const r=t.toString();return be(`/v1/solvernets/registry${r?`?${r}`:""}`)},getManifest:e=>be(`/v1/solvernets/registry/${encodeURIComponent(e)}`)},operator:{listArtifacts:(e={})=>{const t=new URLSearchParams;e.source&&t.set("source",e.source),e.artifactType&&t.set("artifactType",e.artifactType),e.limit!==void 0&&t.set("limit",String(e.limit));const r=t.toString();return be(`/v1/operator/execution-data${r?`?${r}`:""}`)},updatePricing:e=>be("/v1/operator/pricing",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),join:(e,t)=>be(`/v1/operator/join/${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),leave:e=>be(`/v1/operator/join/${encodeURIComponent(e)}`,{method:"DELETE"}),listJoined:()=>be("/v1/operator/joined")},captures:{listPending:()=>be("/api/captures/pending"),get:e=>be(`/api/captures/${encodeURIComponent(e)}`),approve:e=>be(`/api/captures/${encodeURIComponent(e)}/approve`,{method:"POST"}),skip:e=>be(`/api/captures/${encodeURIComponent(e)}/skip`,{method:"POST"}),trustRepo:(e,t)=>be("/api/captures/trust-repos",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({repoRemoteUrl:e,trusted:t})})},debugReport:{manifest:()=>be("/v1/debug-report/manifest"),download:async e=>{const t=await fetch("/v1/debug-report",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(e?{screenshotPngBase64:e}:{})});if(!t.ok)throw new Error(`debug report failed: ${t.status} ${t.statusText}`);return t.blob()}},discovery:{listPluginPublications:e=>{const t=new URLSearchParams;e!=null&&e.solverType&&t.set("solverType",e.solverType),e!=null&&e.builderAgentId&&t.set("builderAgentId",e.builderAgentId),(e==null?void 0:e.includeRevoked)!==void 0&&t.set("includeRevoked",String(e.includeRevoked));const r=t.toString();return be(`/v1/discovery/plugin-publications${r?`?${r}`:""}`)},listBuilderArtifacts:(e,t)=>{const r=new URLSearchParams({builderAgentId:e});return t!==void 0&&r.set("limit",String(t)),be(`/v1/discovery/builder-artifacts?${r.toString()}`)},getPluginScores:(e,t)=>{const r=new URLSearchParams({cid:e});return t!==void 0&&r.set("limit",String(t)),be(`/v1/discovery/plugin-scores?${r.toString()}`)},getSolverNetOperatorCount:e=>{const t=new URLSearchParams({cid:e});return be(`/v1/discovery/solvernet-operator-count?${t.toString()}`)}}};async function t2(){const e=new URL(window.location.href),t=e.searchParams.get("k");if(t){try{await fetch(`/auth/handshake?k=${encodeURIComponent(t)}`,{credentials:"same-origin"})}catch{}e.searchParams.delete("k"),window.history.replaceState({},"",e.toString())}}async function r2(e,t){const r=new AbortController,n=setTimeout(()=>r.abort(),t);try{const s=await fetch(e,{credentials:"same-origin",headers:{Accept:"application/json"},cache:"no-store",signal:r.signal});return s.status===502||s.status===503||s.status===504?{ok:!1,error:`daemon unavailable (HTTP ${s.status})`}:{ok:!0,error:null}}catch(s){return{ok:!1,error:s instanceof Error?s.message:String(s)}}finally{clearTimeout(n)}}function Mw(e={}){const{pollIntervalMs:t=2e3,failureThreshold:r=2,maxBackoffMs:n=3e4,probeTimeoutMs:s=3500,probeUrl:i="/v1/status"}=e,[l,a]=C.useState({status:"connected",lastConnectedAt:Date.now()}),c=C.useRef(0),u=C.useRef(t),m=C.useRef(!1);return C.useEffect(()=>{m.current=!1;let d=null;const x=_=>{m.current||(d=setTimeout(v,_))},v=async()=>{const _=await r2(i,s);if(m.current)return;if(_.ok){c.current=0,u.current=t,a(h=>h.status==="connected"?h:{status:"connected",lastConnectedAt:Date.now()}),x(t);return}c.current+=1,c.current>=r?(a(h=>h.status==="disconnected"?{...h,attempts:h.attempts+1,lastError:_.error}:{status:"disconnected",since:Date.now(),lastError:_.error,attempts:1}),u.current=Math.min(Math.max(u.current*2,t*2),n),x(u.current)):x(t)};return v(),()=>{m.current=!0,d!==null&&clearTimeout(d)}},[t,r,n,s,i]),l}/**
|
|
49
|
+
* @license lucide-react v0.454.0 - ISC
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the ISC license.
|
|
52
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
+
*/const n2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Iw=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
|
|
54
|
+
* @license lucide-react v0.454.0 - ISC
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the ISC license.
|
|
57
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/var s2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
59
|
+
* @license lucide-react v0.454.0 - ISC
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the ISC license.
|
|
62
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
+
*/const i2=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:l,...a},c)=>C.createElement("svg",{ref:c,...s2,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Iw("lucide",s),...a},[...l.map(([u,m])=>C.createElement(u,m)),...Array.isArray(i)?i:[i]]));/**
|
|
64
|
+
* @license lucide-react v0.454.0 - ISC
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the ISC license.
|
|
67
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
+
*/const ot=(e,t)=>{const r=C.forwardRef(({className:n,...s},i)=>C.createElement(i2,{ref:i,iconNode:t,className:Iw(`lucide-${n2(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
|
|
69
|
+
* @license lucide-react v0.454.0 - ISC
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the ISC license.
|
|
72
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/const o2=ot("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
74
|
+
* @license lucide-react v0.454.0 - ISC
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the ISC license.
|
|
77
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/const a2=ot("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
79
|
+
* @license lucide-react v0.454.0 - ISC
|
|
80
|
+
*
|
|
81
|
+
* This source code is licensed under the ISC license.
|
|
82
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
+
*/const l2=ot("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
84
|
+
* @license lucide-react v0.454.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/const gd=ot("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
89
|
+
* @license lucide-react v0.454.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/const Fw=ot("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
94
|
+
* @license lucide-react v0.454.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/const zm=ot("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
99
|
+
* @license lucide-react v0.454.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/const c2=ot("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
104
|
+
* @license lucide-react v0.454.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const u2=ot("CirclePause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);/**
|
|
109
|
+
* @license lucide-react v0.454.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/const d2=ot("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
114
|
+
* @license lucide-react v0.454.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/const Bw=ot("Diamond",[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z",key:"1f1r0c"}]]);/**
|
|
119
|
+
* @license lucide-react v0.454.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/const Ao=ot("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
124
|
+
* @license lucide-react v0.454.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const h2=ot("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
129
|
+
* @license lucide-react v0.454.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const f2=ot("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
134
|
+
* @license lucide-react v0.454.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const p2=ot("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
|
|
139
|
+
* @license lucide-react v0.454.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const Jf=ot("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
144
|
+
* @license lucide-react v0.454.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const m2=ot("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
149
|
+
* @license lucide-react v0.454.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/const g2=ot("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
|
|
154
|
+
* @license lucide-react v0.454.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const v2=ot("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
159
|
+
* @license lucide-react v0.454.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const x2=ot("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
164
|
+
* @license lucide-react v0.454.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const y2=ot("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
169
|
+
* @license lucide-react v0.454.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const _2=ot("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
|
|
174
|
+
* @license lucide-react v0.454.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const b2=ot("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
179
|
+
* @license lucide-react v0.454.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const $w=ot("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
184
|
+
* @license lucide-react v0.454.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const Pl=ot("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Hw(e){const[t,r]=C.useState([]),[n,s]=C.useState(!1);return C.useEffect(()=>{const i=e&&e.length>0?`?kinds=${e.join(",")}`:"",l=new EventSource(`/v1/events${i}`,{withCredentials:!0});return l.onopen=()=>s(!0),l.onerror=()=>s(!1),l.onmessage=a=>{try{const c=JSON.parse(a.data);r(u=>[...u.slice(-499),c])}catch{}},()=>{l.close()}},[e==null?void 0:e.join(",")]),{events:t,connected:n}}function jx(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function os(...e){return t=>{let r=!1;const n=e.map(s=>{const i=jx(s,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let s=0;s<n.length;s++){const i=n[s];typeof i=="function"?i():jx(e[s],null)}}}}function Be(...e){return C.useCallback(os(...e),e)}var w2=Symbol.for("react.lazy"),Ru=Xu[" use ".trim().toString()];function S2(e){return typeof e=="object"&&e!==null&&"then"in e}function Uw(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===w2&&"_payload"in e&&S2(e._payload)}function Wm(e){const t=C2(e),r=C.forwardRef((n,s)=>{let{children:i,...l}=n;Uw(i)&&typeof Ru=="function"&&(i=Ru(i._payload));const a=C.Children.toArray(i),c=a.find(E2);if(c){const u=c.props.children,m=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,m):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}var zw=Wm("Slot");function C2(e){const t=C.forwardRef((r,n)=>{let{children:s,...i}=r;if(Uw(s)&&typeof Ru=="function"&&(s=Ru(s._payload)),C.isValidElement(s)){const l=R2(s),a=j2(i,s.props);return s.type!==C.Fragment&&(a.ref=n?os(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var k2=Symbol("radix.slottable");function E2(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===k2}function j2(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function R2(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Ww(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Ww(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Vw(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Ww(e))&&(n&&(n+=" "),n+=t);return n}const Rx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Nx=Vw,vd=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Nx(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=t,l=Object.keys(s).map(u=>{const m=r==null?void 0:r[u],d=i==null?void 0:i[u];if(m===null)return null;const x=Rx(m)||Rx(d);return s[u][x]}),a=r&&Object.entries(r).reduce((u,m)=>{let[d,x]=m;return x===void 0||(u[d]=x),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,m)=>{let{class:d,className:x,...v}=m;return Object.entries(v).every(_=>{let[y,h]=_;return Array.isArray(h)?h.includes({...i,...a}[y]):{...i,...a}[y]===h})?[...u,d,x]:u},[]);return Nx(e,l,c,r==null?void 0:r.class,r==null?void 0:r.className)},Vm="-",N2=e=>{const t=T2(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{const a=l.split(Vm);return a[0]===""&&a.length!==1&&a.shift(),qw(a,t)||P2(l)},getConflictingClassGroupIds:(l,a)=>{const c=r[l]||[];return a&&n[l]?[...c,...n[l]]:c}}},qw=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?qw(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Vm);return(l=t.validators.find(({validator:a})=>a(i)))==null?void 0:l.classGroupId},Px=/^\[(.+)\]$/,P2=e=>{if(Px.test(e)){const t=Px.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},T2=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return D2(Object.entries(e.classGroups),r).forEach(([i,l])=>{ep(l,n,i,t)}),n},ep=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Tx(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(A2(s)){ep(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,l])=>{ep(l,Tx(t,i),r,n)})})},Tx=(e,t)=>{let r=e;return t.split(Vm).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},A2=e=>e.isThemeGetter,D2=(e,t)=>t?e.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,a])=>[t+l,a])):i);return[r,s]}):e,L2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(i,l)=>{r.set(i,l),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let l=r.get(i);if(l!==void 0)return l;if((l=n.get(i))!==void 0)return s(i,l),l},set(i,l){r.has(i)?r.set(i,l):s(i,l)}}},Kw="!",O2=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],i=t.length,l=a=>{const c=[];let u=0,m=0,d;for(let h=0;h<a.length;h++){let p=a[h];if(u===0){if(p===s&&(n||a.slice(h,h+i)===t)){c.push(a.slice(m,h)),m=h+i;continue}if(p==="/"){d=h;continue}}p==="["?u++:p==="]"&&u--}const x=c.length===0?a:a.substring(m),v=x.startsWith(Kw),_=v?x.substring(1):x,y=d&&d>m?d-m:void 0;return{modifiers:c,hasImportantModifier:v,baseClassName:_,maybePostfixModifierPosition:y}};return r?a=>r({className:a,parseClassName:l}):l},M2=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},I2=e=>({cache:L2(e.cacheSize),parseClassName:O2(e),...N2(e)}),F2=/\s+/,B2=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,i=[],l=e.trim().split(F2);let a="";for(let c=l.length-1;c>=0;c-=1){const u=l[c],{modifiers:m,hasImportantModifier:d,baseClassName:x,maybePostfixModifierPosition:v}=r(u);let _=!!v,y=n(_?x.substring(0,v):x);if(!y){if(!_){a=u+(a.length>0?" "+a:a);continue}if(y=n(x),!y){a=u+(a.length>0?" "+a:a);continue}_=!1}const h=M2(m).join(":"),p=d?h+Kw:h,f=p+y;if(i.includes(f))continue;i.push(f);const g=s(y,_);for(let b=0;b<g.length;++b){const w=g[b];i.push(p+w)}a=u+(a.length>0?" "+a:a)}return a};function $2(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Gw(t))&&(n&&(n+=" "),n+=r);return n}const Gw=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Gw(e[n]))&&(r&&(r+=" "),r+=t);return r};function H2(e,...t){let r,n,s,i=l;function l(c){const u=t.reduce((m,d)=>d(m),e());return r=I2(u),n=r.cache.get,s=r.cache.set,i=a,a(c)}function a(c){const u=n(c);if(u)return u;const m=B2(c,r);return s(c,m),m}return function(){return i($2.apply(null,arguments))}}const et=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Qw=/^\[(?:([a-z-]+):)?(.+)\]$/i,U2=/^\d+\/\d+$/,z2=new Set(["px","full","screen"]),W2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,V2=/\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$/,q2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,K2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,G2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fn=e=>Do(e)||z2.has(e)||U2.test(e),hs=e=>ya(e,"length",rP),Do=e=>!!e&&!Number.isNaN(Number(e)),gh=e=>ya(e,"number",Do),Ma=e=>!!e&&Number.isInteger(Number(e)),Q2=e=>e.endsWith("%")&&Do(e.slice(0,-1)),Pe=e=>Qw.test(e),fs=e=>W2.test(e),Y2=new Set(["length","size","percentage"]),Z2=e=>ya(e,Y2,Yw),X2=e=>ya(e,"position",Yw),J2=new Set(["image","url"]),eP=e=>ya(e,J2,sP),tP=e=>ya(e,"",nP),Ia=()=>!0,ya=(e,t,r)=>{const n=Qw.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},rP=e=>V2.test(e)&&!q2.test(e),Yw=()=>!1,nP=e=>K2.test(e),sP=e=>G2.test(e),iP=()=>{const e=et("colors"),t=et("spacing"),r=et("blur"),n=et("brightness"),s=et("borderColor"),i=et("borderRadius"),l=et("borderSpacing"),a=et("borderWidth"),c=et("contrast"),u=et("grayscale"),m=et("hueRotate"),d=et("invert"),x=et("gap"),v=et("gradientColorStops"),_=et("gradientColorStopPositions"),y=et("inset"),h=et("margin"),p=et("opacity"),f=et("padding"),g=et("saturate"),b=et("scale"),w=et("sepia"),k=et("skew"),j=et("space"),S=et("translate"),E=()=>["auto","contain","none"],N=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",Pe,t],T=()=>[Pe,t],L=()=>["",Fn,hs],$=()=>["auto",Do,Pe],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",Pe],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[Do,Pe];return{cacheSize:500,separator:":",theme:{colors:[Ia],spacing:[Fn,hs],blur:["none","",fs,Pe],brightness:M(),borderColor:[e],borderRadius:["none","","full",fs,Pe],borderSpacing:T(),borderWidth:L(),contrast:M(),grayscale:P(),hueRotate:M(),invert:P(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[Q2,hs],inset:O(),margin:O(),opacity:M(),padding:T(),saturate:M(),scale:M(),sepia:P(),skew:M(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",Pe]}],container:["container"],columns:[{columns:[fs]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"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:[...U(),Pe]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ma,Pe]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Pe]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",Ma,Pe]}],"grid-cols":[{"grid-cols":[Ia]}],"col-start-end":[{col:["auto",{span:["full",Ma,Pe]},Pe]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[Ia]}],"row-start-end":[{row:["auto",{span:[Ma,Pe]},Pe]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Pe]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...R()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...R(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...R(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[f]}],px:[{px:[f]}],py:[{py:[f]}],ps:[{ps:[f]}],pe:[{pe:[f]}],pt:[{pt:[f]}],pr:[{pr:[f]}],pb:[{pb:[f]}],pl:[{pl:[f]}],m:[{m:[h]}],mx:[{mx:[h]}],my:[{my:[h]}],ms:[{ms:[h]}],me:[{me:[h]}],mt:[{mt:[h]}],mr:[{mr:[h]}],mb:[{mb:[h]}],ml:[{ml:[h]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Pe,t]}],"min-w":[{"min-w":[Pe,t,"min","max","fit"]}],"max-w":[{"max-w":[Pe,t,"none","full","min","max","fit","prose",{screen:[fs]},fs]}],h:[{h:[Pe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Pe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Pe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Pe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",fs,hs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",gh]}],"font-family":[{font:[Ia]}],"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",Pe]}],"line-clamp":[{"line-clamp":["none",Do,gh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fn,Pe]}],"list-image":[{"list-image":["none",Pe]}],"list-style-type":[{list:["none","disc","decimal",Pe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[p]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[p]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Fn,hs]}],"underline-offset":[{"underline-offset":["auto",Fn,Pe]}],"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:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe]}],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",Pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[p]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),X2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Z2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},eP]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[_]}],"gradient-via-pos":[{via:[_]}],"gradient-to-pos":[{to:[_]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[p]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[p]}],"divide-style":[{divide:z()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Fn,Pe]}],"outline-w":[{outline:[Fn,hs]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[p]}],"ring-offset-w":[{"ring-offset":[Fn,hs]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fs,tP]}],"shadow-color":[{shadow:[Ia]}],opacity:[{opacity:[p]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",fs,Pe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[d]}],saturate:[{saturate:[g]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[p]}],"backdrop-saturate":[{"backdrop-saturate":[g]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"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",Pe]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",Pe]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",Pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Ma,Pe]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Pe]}],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",Pe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",Pe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Fn,hs,gh]}],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"]}}},oP=H2(iP);function ee(...e){return oP(Vw(e))}const qm=vd("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-mono text-[11px] uppercase tracking-[0.14em] transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-[var(--accent-sky)] text-[var(--bg-sunken)] hover:bg-[var(--accent-sky-hover)]",destructive:"border border-[var(--break-red)] bg-transparent text-[var(--break-red)] hover:bg-[var(--severity-blocking-bg)]",outline:"border border-[var(--accent-sky)] bg-transparent text-[var(--accent-sky)] hover:bg-[var(--bg-sunken)]",secondary:"border border-[var(--border)] bg-transparent text-[var(--fg-muted)] hover:bg-[var(--bg-sunken)] hover:text-[var(--fg)]",ghost:"bg-transparent text-[var(--fg-muted)] hover:bg-[var(--bg-sunken)] hover:text-[var(--fg)]",link:"bg-transparent normal-case tracking-normal text-[var(--accent-sky)] hover:text-[var(--accent-sky-hover)] underline-offset-4 hover:underline"},size:{default:"h-8 px-3 py-1.5",sm:"h-7 px-2.5 text-[10px]",lg:"h-10 px-4 text-xs",icon:"h-8 w-8"}},defaultVariants:{variant:"default",size:"default"}}),ie=C.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},i)=>{const l=n?zw:"button";return o.jsx(l,{className:ee(qm({variant:t,size:r,className:e})),ref:i,...s})});ie.displayName="Button";const we=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:ee("rounded-lg border border-border bg-card text-card-foreground",e),...t}));we.displayName="Card";const Yt=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:ee("flex flex-col gap-1.5 p-6 pb-3",e),...t}));Yt.displayName="CardHeader";const fn=C.forwardRef(({className:e,...t},r)=>o.jsx("h3",{ref:r,className:ee("font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",e),...t}));fn.displayName="CardTitle";const Zs=C.forwardRef(({className:e,...t},r)=>o.jsx("p",{ref:r,className:ee("font-mono text-[12px] text-[var(--fg-muted)]",e),...t}));Zs.displayName="CardDescription";const Ge=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:ee("px-6 pb-6",e),...t}));Ge.displayName="CardContent";const aP=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:ee("flex items-center px-6 pb-6 pt-0",e),...t}));aP.displayName="CardFooter";function lP(e){const t=cP(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(dP);if(c){const u=c.props.children,m=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,m):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function cP(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=fP(s),a=hP(i,s.props);return s.type!==C.Fragment&&(a.ref=n?os(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uP=Symbol("radix.slottable");function dP(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uP}function hP(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function fP(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var pP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$e=pP.reduce((e,t)=>{const r=lP(`Primitive.${t}`),n=C.forwardRef((s,i)=>{const{asChild:l,...a}=s,c=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Zw(e,t){e&&pd.flushSync(()=>e.dispatchEvent(t))}var ts=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{};function mP(e,t){return C.useReducer((r,n)=>t[r][n]??r,e)}var Wt=e=>{const{present:t,children:r}=e,n=gP(t),s=typeof r=="function"?r({present:n.isPresent}):C.Children.only(r),i=Be(n.ref,vP(s));return typeof r=="function"||n.isPresent?C.cloneElement(s,{ref:i}):null};Wt.displayName="Presence";function gP(e){const[t,r]=C.useState(),n=C.useRef(null),s=C.useRef(e),i=C.useRef("none"),l=e?"mounted":"unmounted",[a,c]=mP(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=jc(n.current);i.current=a==="mounted"?u:"none"},[a]),ts(()=>{const u=n.current,m=s.current;if(m!==e){const x=i.current,v=jc(u);e?c("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(m&&x!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),ts(()=>{if(t){let u;const m=t.ownerDocument.defaultView??window,d=v=>{const y=jc(n.current).includes(CSS.escape(v.animationName));if(v.target===t&&y&&(c("ANIMATION_END"),!s.current)){const h=t.style.animationFillMode;t.style.animationFillMode="forwards",u=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=h)})}},x=v=>{v.target===t&&(i.current=jc(n.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{m.clearTimeout(u),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function jc(e){return(e==null?void 0:e.animationName)||"none"}function vP(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function xP(e,t){const r=C.createContext(t),n=i=>{const{children:l,...a}=i,c=C.useMemo(()=>a,Object.values(a));return o.jsx(r.Provider,{value:c,children:l})};n.displayName=e+"Provider";function s(i){const l=C.useContext(r);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,s]}function gn(e,t=[]){let r=[];function n(i,l){const a=C.createContext(l),c=r.length;r=[...r,l];const u=d=>{var p;const{scope:x,children:v,..._}=d,y=((p=x==null?void 0:x[e])==null?void 0:p[c])||a,h=C.useMemo(()=>_,Object.values(_));return o.jsx(y.Provider,{value:h,children:v})};u.displayName=i+"Provider";function m(d,x){var y;const v=((y=x==null?void 0:x[e])==null?void 0:y[c])||a,_=C.useContext(v);if(_)return _;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,m]}const s=()=>{const i=r.map(l=>C.createContext(l));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[n,yP(s,...t)]}function yP(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const l=n.reduce((a,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...a,...d}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function Ht(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}var _P=C.createContext(void 0);function Km(e){const t=C.useContext(_P);return e||t||"ltr"}function bP(e,[t,r]){return Math.min(r,Math.max(t,e))}function ye(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function wP(e,t){return C.useReducer((r,n)=>t[r][n]??r,e)}var Gm="ScrollArea",[Xw]=gn(Gm),[SP,Ur]=Xw(Gm),Jw=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:i=600,...l}=e,[a,c]=C.useState(null),[u,m]=C.useState(null),[d,x]=C.useState(null),[v,_]=C.useState(null),[y,h]=C.useState(null),[p,f]=C.useState(0),[g,b]=C.useState(0),[w,k]=C.useState(!1),[j,S]=C.useState(!1),E=Be(t,O=>c(O)),N=Km(s);return o.jsx(SP,{scope:r,type:n,dir:N,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:m,content:d,onContentChange:x,scrollbarX:v,onScrollbarXChange:_,scrollbarXEnabled:w,onScrollbarXEnabledChange:k,scrollbarY:y,onScrollbarYChange:h,scrollbarYEnabled:j,onScrollbarYEnabledChange:S,onCornerWidthChange:f,onCornerHeightChange:b,children:o.jsx($e.div,{dir:N,...l,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":p+"px","--radix-scroll-area-corner-height":g+"px",...e.style}})})});Jw.displayName=Gm;var eS="ScrollAreaViewport",tS=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...i}=e,l=Ur(eS,r),a=C.useRef(null),c=Be(t,a,l.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),o.jsx($e.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:o.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});tS.displayName=eS;var Dn="ScrollAreaScrollbar",Qm=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Ur(Dn,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=s,a=e.orientation==="horizontal";return C.useEffect(()=>(a?i(!0):l(!0),()=>{a?i(!1):l(!1)}),[a,i,l]),s.type==="hover"?o.jsx(CP,{...n,ref:t,forceMount:r}):s.type==="scroll"?o.jsx(kP,{...n,ref:t,forceMount:r}):s.type==="auto"?o.jsx(rS,{...n,ref:t,forceMount:r}):s.type==="always"?o.jsx(Ym,{...n,ref:t}):null});Qm.displayName=Dn;var CP=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Ur(Dn,e.__scopeScrollArea),[i,l]=C.useState(!1);return C.useEffect(()=>{const a=s.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),l(!0)},m=()=>{c=window.setTimeout(()=>l(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",m),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",m)}}},[s.scrollArea,s.scrollHideDelay]),o.jsx(Wt,{present:r||i,children:o.jsx(rS,{"data-state":i?"visible":"hidden",...n,ref:t})})}),kP=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Ur(Dn,e.__scopeScrollArea),i=e.orientation==="horizontal",l=yd(()=>c("SCROLL_END"),100),[a,c]=wP("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return C.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,s.scrollHideDelay,c]),C.useEffect(()=>{const u=s.viewport,m=i?"scrollLeft":"scrollTop";if(u){let d=u[m];const x=()=>{const v=u[m];d!==v&&(c("SCROLL"),l()),d=v};return u.addEventListener("scroll",x),()=>u.removeEventListener("scroll",x)}},[s.viewport,i,c,l]),o.jsx(Wt,{present:r||a!=="hidden",children:o.jsx(Ym,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ye(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ye(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),rS=C.forwardRef((e,t)=>{const r=Ur(Dn,e.__scopeScrollArea),{forceMount:n,...s}=e,[i,l]=C.useState(!1),a=e.orientation==="horizontal",c=yd(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,m=r.viewport.offsetHeight<r.viewport.scrollHeight;l(a?u:m)}},10);return oa(r.viewport,c),oa(r.content,c),o.jsx(Wt,{present:n||i,children:o.jsx(Ym,{"data-state":i?"visible":"hidden",...s,ref:t})})}),Ym=C.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,s=Ur(Dn,e.__scopeScrollArea),i=C.useRef(null),l=C.useRef(0),[a,c]=C.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=aS(a.viewport,a.content),m={...n,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:x=>i.current=x,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:x=>l.current=x};function d(x,v){return TP(x,l.current,a,v)}return r==="horizontal"?o.jsx(EP,{...m,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const x=s.viewport.scrollLeft,v=Ax(x,a,s.dir);i.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollLeft=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollLeft=d(x,s.dir))}}):r==="vertical"?o.jsx(jP,{...m,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const x=s.viewport.scrollTop,v=Ax(x,a);i.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollTop=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollTop=d(x))}}):null}),EP=C.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=Ur(Dn,e.__scopeScrollArea),[l,a]=C.useState(),c=C.useRef(null),u=Be(t,c,i.onScrollbarXChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),o.jsx(sS,{"data-orientation":"horizontal",...s,ref:u,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":xd(r)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,d)=>{if(i.viewport){const x=i.viewport.scrollLeft+m.deltaX;e.onWheelScroll(x),cS(x,d)&&m.preventDefault()}},onResize:()=>{c.current&&i.viewport&&l&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Pu(l.paddingLeft),paddingEnd:Pu(l.paddingRight)}})}})}),jP=C.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,i=Ur(Dn,e.__scopeScrollArea),[l,a]=C.useState(),c=C.useRef(null),u=Be(t,c,i.onScrollbarYChange);return C.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),o.jsx(sS,{"data-orientation":"vertical",...s,ref:u,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":xd(r)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,d)=>{if(i.viewport){const x=i.viewport.scrollTop+m.deltaY;e.onWheelScroll(x),cS(x,d)&&m.preventDefault()}},onResize:()=>{c.current&&i.viewport&&l&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Pu(l.paddingTop),paddingEnd:Pu(l.paddingBottom)}})}})}),[RP,nS]=Xw(Dn),sS=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:m,onResize:d,...x}=e,v=Ur(Dn,r),[_,y]=C.useState(null),h=Be(t,E=>y(E)),p=C.useRef(null),f=C.useRef(""),g=v.viewport,b=n.content-n.viewport,w=Ht(m),k=Ht(c),j=yd(d,10);function S(E){if(p.current){const N=E.clientX-p.current.left,O=E.clientY-p.current.top;u({x:N,y:O})}}return C.useEffect(()=>{const E=N=>{const O=N.target;(_==null?void 0:_.contains(O))&&w(N,b)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[g,_,b,w]),C.useEffect(k,[n,k]),oa(_,j),oa(v.content,j),o.jsx(RP,{scope:r,scrollbar:_,hasThumb:s,onThumbChange:Ht(i),onThumbPointerUp:Ht(l),onThumbPositionChange:k,onThumbPointerDown:Ht(a),children:o.jsx($e.div,{...x,ref:h,style:{position:"absolute",...x.style},onPointerDown:ye(e.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),p.current=_.getBoundingClientRect(),f.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),S(E))}),onPointerMove:ye(e.onPointerMove,S),onPointerUp:ye(e.onPointerUp,E=>{const N=E.target;N.hasPointerCapture(E.pointerId)&&N.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=f.current,v.viewport&&(v.viewport.style.scrollBehavior=""),p.current=null})})})}),Nu="ScrollAreaThumb",iS=C.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=nS(Nu,e.__scopeScrollArea);return o.jsx(Wt,{present:r||s.hasThumb,children:o.jsx(NP,{ref:t,...n})})}),NP=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,i=Ur(Nu,r),l=nS(Nu,r),{onThumbPositionChange:a}=l,c=Be(t,d=>l.onThumbChange(d)),u=C.useRef(void 0),m=yd(()=>{u.current&&(u.current(),u.current=void 0)},100);return C.useEffect(()=>{const d=i.viewport;if(d){const x=()=>{if(m(),!u.current){const v=AP(d,a);u.current=v,a()}};return a(),d.addEventListener("scroll",x),()=>d.removeEventListener("scroll",x)}},[i.viewport,m,a]),o.jsx($e.div,{"data-state":l.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ye(e.onPointerDownCapture,d=>{const v=d.target.getBoundingClientRect(),_=d.clientX-v.left,y=d.clientY-v.top;l.onThumbPointerDown({x:_,y})}),onPointerUp:ye(e.onPointerUp,l.onThumbPointerUp)})});iS.displayName=Nu;var Zm="ScrollAreaCorner",oS=C.forwardRef((e,t)=>{const r=Ur(Zm,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?o.jsx(PP,{...e,ref:t}):null});oS.displayName=Zm;var PP=C.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=Ur(Zm,r),[i,l]=C.useState(0),[a,c]=C.useState(0),u=!!(i&&a);return oa(s.scrollbarX,()=>{var d;const m=((d=s.scrollbarX)==null?void 0:d.offsetHeight)||0;s.onCornerHeightChange(m),c(m)}),oa(s.scrollbarY,()=>{var d;const m=((d=s.scrollbarY)==null?void 0:d.offsetWidth)||0;s.onCornerWidthChange(m),l(m)}),u?o.jsx($e.div,{...n,ref:t,style:{width:i,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Pu(e){return e?parseInt(e,10):0}function aS(e,t){const r=e/t;return isNaN(r)?0:r}function xd(e){const t=aS(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function TP(e,t,r,n="ltr"){const s=xd(r),i=s/2,l=t||i,a=s-l,c=r.scrollbar.paddingStart+l,u=r.scrollbar.size-r.scrollbar.paddingEnd-a,m=r.content-r.viewport,d=n==="ltr"?[0,m]:[m*-1,0];return lS([c,u],d)(e)}function Ax(e,t,r="ltr"){const n=xd(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,l=t.content-t.viewport,a=i-n,c=r==="ltr"?[0,l]:[l*-1,0],u=bP(e,c);return lS([0,l],[0,a])(u)}function lS(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function cS(e,t){return e>0&&e<t}var AP=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const i={left:e.scrollLeft,top:e.scrollTop},l=r.left!==i.left,a=r.top!==i.top;(l||a)&&t(),r=i,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function yd(e,t){const r=Ht(e),n=C.useRef(0);return C.useEffect(()=>()=>window.clearTimeout(n.current),[]),C.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function oa(e,t){const r=Ht(t);ts(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var uS=Jw,DP=tS,LP=oS;const Ql=C.forwardRef(({className:e,children:t,...r},n)=>o.jsxs(uS,{ref:n,className:ee("relative overflow-hidden",e),...r,children:[o.jsx(DP,{className:"h-full w-full rounded-[inherit]",children:t}),o.jsx(dS,{}),o.jsx(LP,{})]}));Ql.displayName=uS.displayName;const dS=C.forwardRef(({className:e,orientation:t="vertical",...r},n)=>o.jsx(Qm,{ref:n,orientation:t,className:ee("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2 border-l border-l-transparent p-px",t==="horizontal"&&"h-2 flex-col border-t border-t-transparent p-px",e),...r,children:o.jsx(iS,{className:"relative flex-1 rounded-full bg-[var(--border-strong)]"})}));dS.displayName=Qm.displayName;const OP="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]",MP="font-serif font-normal leading-[1.05] text-foreground text-[64px]";function IP({headline:e}){const[t,r]=C.useState(!1),{events:n}=Hw(),s=n.length>0?n[n.length-1]:null;return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-10 py-16 text-foreground",children:o.jsxs("div",{className:"flex w-full max-w-xl flex-col gap-6",children:[o.jsx("span",{className:OP,children:"Jinn · starting up"}),o.jsxs("h1",{className:MP,children:[e,"."]}),o.jsx("p",{className:"min-h-[1.5em] font-mono text-sm text-[var(--fg-muted)]",children:s?FP(s):"The daemon is booting. This usually takes a second."}),o.jsxs(ie,{type:"button",variant:"ghost",size:"sm",className:"self-start text-[var(--fg-dim)] hover:text-foreground",onClick:()=>r(i=>!i),"aria-expanded":t,children:[t?o.jsx(zm,{}):o.jsx(gd,{}),t?"Hide details":"Show details"]}),t&&o.jsx(we,{className:"bg-[var(--bg-elevated)]",children:o.jsx(Ge,{className:"p-0",children:o.jsx(Ql,{className:"h-64",children:o.jsxs("div",{className:"px-3 py-2 font-mono text-xs",children:[n.length===0&&o.jsx("div",{className:"text-[var(--fg-dim)]",children:"no events yet"}),n.slice().reverse().map(i=>o.jsxs("div",{className:"grid grid-cols-[68px_84px_1fr] gap-3 py-0.5",children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:i.ts.slice(11,19)}),o.jsx("span",{className:ee(i.kind==="error"?"text-[var(--break-red)]":i.kind==="system"?"text-[var(--accent-sky)]":"text-[var(--fg-dim)]"),children:i.kind}),o.jsx("span",{className:"text-foreground",children:i.message})]},i.id))]})})})})]})})}function FP(e){return e.kind==="error"?`Error: ${e.message}`:e.message}const BP=vd("relative w-full border-l-2 px-4 py-2 font-mono text-[12px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-3 [&>svg+div]:translate-y-[-3px]",{variants:{variant:{default:"border-[var(--severity-info-fg)] bg-transparent text-foreground",info:"border-[var(--severity-info-fg)] bg-transparent text-foreground",warning:"border-[var(--severity-warning-fg)] bg-[var(--severity-warning-bg)] text-foreground",blocking:"border-[var(--severity-blocking-fg)] bg-[var(--severity-blocking-bg)] text-foreground",success:"border-[var(--vow-green)] bg-transparent text-foreground"}},defaultVariants:{variant:"default"}}),Ye=C.forwardRef(({className:e,variant:t,...r},n)=>o.jsx("div",{ref:n,role:"alert",className:ee(BP({variant:t}),e),...r}));Ye.displayName="Alert";const Nt=C.forwardRef(({className:e,...t},r)=>o.jsx("h5",{ref:r,className:ee("mb-0.5 font-mono text-[11px] uppercase tracking-[0.14em]",e),...t}));Nt.displayName="AlertTitle";const Xe=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:ee("text-[12px] [&_p]:leading-relaxed",e),...t}));Xe.displayName="AlertDescription";function $P(e,t=[]){let r=[];function n(i,l){const a=C.createContext(l);a.displayName=i+"Context";const c=r.length;r=[...r,l];const u=d=>{var p;const{scope:x,children:v,..._}=d,y=((p=x==null?void 0:x[e])==null?void 0:p[c])||a,h=C.useMemo(()=>_,Object.values(_));return o.jsx(y.Provider,{value:h,children:v})};u.displayName=i+"Provider";function m(d,x){var y;const v=((y=x==null?void 0:x[e])==null?void 0:y[c])||a,_=C.useContext(v);if(_)return _;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,m]}const s=()=>{const i=r.map(l=>C.createContext(l));return function(a){const c=(a==null?void 0:a[e])||i;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return s.scopeName=e,[n,HP(s,...t)]}function HP(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const l=n.reduce((a,{useScope:c,scopeName:u})=>{const d=c(i)[`__scope${u}`];return{...a,...d}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}var UP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hS=UP.reduce((e,t)=>{const r=Wm(`Primitive.${t}`),n=C.forwardRef((s,i)=>{const{asChild:l,...a}=s,c=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Xm="Progress",Jm=100,[zP]=$P(Xm),[WP,VP]=zP(Xm),fS=C.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:s,getValueLabel:i=qP,...l}=e;(s||s===0)&&!Dx(s)&&console.error(KP(`${s}`,"Progress"));const a=Dx(s)?s:Jm;n!==null&&!Lx(n,a)&&console.error(GP(`${n}`,"Progress"));const c=Lx(n,a)?n:null,u=Tu(c)?i(c,a):void 0;return o.jsx(WP,{scope:r,value:c,max:a,children:o.jsx(hS.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Tu(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":gS(c,a),"data-value":c??void 0,"data-max":a,...l,ref:t})})});fS.displayName=Xm;var pS="ProgressIndicator",mS=C.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,s=VP(pS,r);return o.jsx(hS.div,{"data-state":gS(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...n,ref:t})});mS.displayName=pS;function qP(e,t){return`${Math.round(e/t*100)}%`}function gS(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Tu(e){return typeof e=="number"}function Dx(e){return Tu(e)&&!isNaN(e)&&e>0}function Lx(e,t){return Tu(e)&&!isNaN(e)&&e<=t&&e>=0}function KP(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Jm}\`.`}function GP(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
189
|
+
- a positive number
|
|
190
|
+
- less than the value passed to \`max\` (or ${Jm} if no \`max\` prop is set)
|
|
191
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
192
|
+
|
|
193
|
+
Defaulting to \`null\`.`}var vS=fS,QP=mS;const eg=C.forwardRef(({className:e,value:t,...r},n)=>o.jsx(vS,{ref:n,className:ee("relative h-1.5 w-full overflow-hidden rounded-full bg-[var(--bg-sunken)]",e),...r,children:o.jsx(QP,{className:"h-full w-full flex-1 bg-[var(--accent-sky)] transition-all",style:{transform:`translateX(-${100-(t??0)}%)`}})}));eg.displayName=vS.displayName;const YP={base:"Base","base-sepolia":"Base Sepolia"},ZP="font-mono text-[11px] font-medium uppercase tracking-[0.14em]";function XP({address:e,minimumWei:t,chainExplorerBase:r,chain:n,onSharedDefaultRpc:s=!1}){var j;const[i,l]=C.useState(!1),[a,c]=C.useState(null),[u,m]=C.useState(0),d=C.useRef(!1),[x,v]=C.useState({state:"idle"});C.useEffect(()=>{if(a===null)return;m(Math.max(0,Math.floor((Date.now()-a)/1e3)));const S=window.setInterval(()=>{m(Math.max(0,Math.floor((Date.now()-a)/1e3)))},1e3);return()=>window.clearInterval(S)},[a]);const _=async()=>{await navigator.clipboard.writeText(e),l(!0),setTimeout(()=>l(!1),1500)},y=async()=>{var S;d.current=!0,c(Date.now()),m(0),v({state:"requesting"});try{const E=await me.triggerDrip();c(null),E.ok?v({state:"sent",txHash:E.txHash??((S=E.txHashes)==null?void 0:S.at(-1)),txHashes:E.txHashes,attempts:E.attempts,balanceWei:E.balanceWei,targetWei:E.targetWei}):E.rateLimited||E.reason&&/rate|claimed|429/i.test(E.reason)?v({state:"rate_limited",reason:E.reason??"faucet rate-limited"}):v({state:"failed",reason:E.reason??"faucet funding failed"})}catch(E){c(null),v({state:"failed",reason:E instanceof Error?E.message:"drip failed"})}},h=C.useRef(t);C.useEffect(()=>{h.current!==t&&(h.current=t,v({state:"idle"}),d.current&&y())},[t]);const p=S=>{if(!S)return"unknown";try{const E=Number(BigInt(S))/1e18;return`${E.toFixed(E<.001?4:3)} ETH`}catch{return`${S} wei`}},f=p(t),g=C.useMemo(()=>x.state!=="requesting"?0:Math.min(92,Math.max(8,Math.round(u/60*92))),[x.state,u]),b=x.state==="sent"?((j=x.txHashes)==null?void 0:j.length)??x.attempts??(x.txHash?1:0):0,w=x.state==="sent"&&x.balanceWei!==void 0&&x.targetWei!==void 0&&(()=>{try{return BigInt(x.balanceWei)>=BigInt(x.targetWei)}catch{return!1}})(),k=x.state==="sent"&&!w;return o.jsxs(Ye,{variant:"warning",className:"flex flex-col gap-4 border-l-2 px-6 py-5",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsx(Nt,{className:ee(ZP,"text-[var(--accent-gold)]"),children:"Action needed · fund the master EOA"}),o.jsx("span",{className:"font-mono text-[10px] text-[var(--fg-dim)]",children:"auto-detected on chain"})]}),o.jsxs(Xe,{className:"flex flex-col gap-1",children:[o.jsx("span",{className:"break-all font-mono text-xs text-foreground",children:e}),o.jsxs("span",{className:"font-mono text-xs text-[var(--fg-muted)]",children:["send at least ",f," on ",YP[n??""]??"this chain"]})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(ie,{type:"button",onClick:y,disabled:x.state==="requesting"||w,className:"bg-[var(--accent-gold)] text-[var(--bg)] hover:bg-[var(--accent-gold-hover)]",children:x.state==="requesting"?"Funding...":w?"Faucet funded":k?"Fund more":"Fund from faucet"}),o.jsx(ie,{type:"button",variant:"secondary",onClick:_,children:i?"Copied":"Copy address"}),o.jsx(ie,{asChild:!0,variant:"ghost",children:o.jsxs("a",{href:`${r}/address/${e}`,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(Ao,{}),"View on explorer"]})})]}),x.state==="sent"&&o.jsxs("p",{className:ee("font-mono text-[11px]",w?"text-[var(--vow-green)]":"text-[var(--accent-gold)]"),children:[w?"Faucet funding complete":"Faucet funding partial",b>0?` (${b} drip${b===1?"":"s"})`:"",".",x.balanceWei&&x.targetWei?` Balance ${p(x.balanceWei)} / target ${p(x.targetWei)}.`:"",k?' Click "Fund more" to top up.':"",x.txHash&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:`${r}/tx/${x.txHash}`,target:"_blank",rel:"noopener noreferrer",className:"text-[var(--accent-sky)] hover:underline",children:"view latest tx"})]})]}),x.state==="requesting"&&o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx(eg,{value:g,className:"h-1.5 rounded-full [&>div]:bg-[var(--accent-gold)]"}),o.jsxs("p",{className:"font-mono text-[11px] text-[var(--fg-muted)]",children:["Requesting faucet drips for ",JP(e),". Elapsed ",u,"s; this can take about a minute on a fresh wallet."]})]}),x.state==="rate_limited"&&o.jsx("p",{className:"font-mono text-[11px] text-[var(--wane)]",children:"Faucet rate-limited. Send manually or wait before trying again."}),x.state==="failed"&&o.jsx("p",{className:"font-mono text-[11px] text-[var(--break-red)]",children:x.reason}),s&&o.jsx("p",{"data-testid":"onboarding-shared-rpc-nudge",className:"font-mono text-[11px] text-[var(--fg-dim)]",children:"Using a shared trial RPC — add your own key in the Network section for reliable operation."})]})}const JP=e=>`${e.slice(0,6)}…${e.slice(-4)}`;var xS={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={4567:function(l,a,c){var u=this&&this.__decorate||function(g,b,w,k){var j,S=arguments.length,E=S<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,w):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,b,w,k);else for(var N=g.length-1;N>=0;N--)(j=g[N])&&(E=(S<3?j(E):S>3?j(b,w,E):j(b,w))||E);return S>3&&E&&Object.defineProperty(b,w,E),E},m=this&&this.__param||function(g,b){return function(w,k){b(w,k,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const d=c(9042),x=c(6114),v=c(9924),_=c(844),y=c(5596),h=c(4725),p=c(3656);let f=a.AccessibilityManager=class extends _.Disposable{constructor(g,b){super(),this._terminal=g,this._renderService=b,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let w=0;w<this._terminal.rows;w++)this._rowElements[w]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[w]);if(this._topBoundaryFocusListener=w=>this._handleBoundaryFocus(w,0),this._bottomBoundaryFocusListener=w=>this._handleBoundaryFocus(w,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new v.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(w=>this._handleResize(w.rows))),this.register(this._terminal.onRender(w=>this._refreshRows(w.start,w.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(w=>this._handleChar(w))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
194
|
+
`))),this.register(this._terminal.onA11yTab(w=>this._handleTab(w))),this.register(this._terminal.onKey(w=>this._handleKey(w.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new y.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,p.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,_.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(g){for(let b=0;b<g;b++)this._handleChar(" ")}_handleChar(g){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==g&&(this._charsToAnnounce+=g):this._charsToAnnounce+=g,g===`
|
|
195
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)),x.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,x.isMac&&this._liveRegion.remove()}_handleKey(g){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(g)||this._charsToConsume.push(g)}_refreshRows(g,b){this._liveRegionDebouncer.refresh(g,b,this._terminal.rows)}_renderRows(g,b){const w=this._terminal.buffer,k=w.lines.length.toString();for(let j=g;j<=b;j++){const S=w.translateBufferLineToString(w.ydisp+j,!0),E=(w.ydisp+j+1).toString(),N=this._rowElements[j];N&&(S.length===0?N.innerText=" ":N.textContent=S,N.setAttribute("aria-posinset",E),N.setAttribute("aria-setsize",k))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(g,b){const w=g.target,k=this._rowElements[b===0?1:this._rowElements.length-2];if(w.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||g.relatedTarget!==k)return;let j,S;if(b===0?(j=w,S=this._rowElements.pop(),this._rowContainer.removeChild(S)):(j=this._rowElements.shift(),S=w,this._rowContainer.removeChild(j)),j.removeEventListener("focus",this._topBoundaryFocusListener),S.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),g.preventDefault(),g.stopImmediatePropagation()}_handleResize(g){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>g;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const g=document.createElement("div");return g.setAttribute("role","listitem"),g.tabIndex=-1,this._refreshRowDimensions(g),g}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let g=0;g<this._terminal.rows;g++)this._refreshRowDimensions(this._rowElements[g])}}_refreshRowDimensions(g){g.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=f=u([m(1,h.IRenderService)],f)},3614:(l,a)=>{function c(x){return x.replace(/\r?\n/g,"\r")}function u(x,v){return v?"\x1B[200~"+x+"\x1B[201~":x}function m(x,v,_,y){x=u(x=c(x),_.decPrivateModes.bracketedPasteMode&&y.rawOptions.ignoreBracketedPasteMode!==!0),_.triggerDataEvent(x,!0),v.value=""}function d(x,v,_){const y=_.getBoundingClientRect(),h=x.clientX-y.left-10,p=x.clientY-y.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${h}px`,v.style.top=`${p}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=c,a.bracketTextForPaste=u,a.copyHandler=function(x,v){x.clipboardData&&x.clipboardData.setData("text/plain",v.selectionText),x.preventDefault()},a.handlePasteEvent=function(x,v,_,y){x.stopPropagation(),x.clipboardData&&m(x.clipboardData.getData("text/plain"),v,_,y)},a.paste=m,a.moveTextAreaUnderMouseCursor=d,a.rightClickHandler=function(x,v,_,y,h){d(x,v,_),h&&y.rightClickSelect(x),v.value=y.selectionText,v.select()}},7239:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const u=c(1505);a.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(m,d,x){this._css.set(m,d,x)}getCss(m,d){return this._css.get(m,d)}setColor(m,d,x){this._color.set(m,d,x)}getColor(m,d){return this._color.get(m,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(c,u,m,d){c.addEventListener(u,m,d);let x=!1;return{dispose:()=>{x||(x=!0,c.removeEventListener(u,m,d))}}}},6465:function(l,a,c){var u=this&&this.__decorate||function(h,p,f,g){var b,w=arguments.length,k=w<3?p:g===null?g=Object.getOwnPropertyDescriptor(p,f):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,p,f,g);else for(var j=h.length-1;j>=0;j--)(b=h[j])&&(k=(w<3?b(k):w>3?b(p,f,k):b(p,f))||k);return w>3&&k&&Object.defineProperty(p,f,k),k},m=this&&this.__param||function(h,p){return function(f,g){p(f,g,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier2=void 0;const d=c(3656),x=c(8460),v=c(844),_=c(2585);let y=a.Linkifier2=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(h){super(),this._bufferService=h,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new x.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new x.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(h){return this._linkProviders.push(h),{dispose:()=>{const p=this._linkProviders.indexOf(h);p!==-1&&this._linkProviders.splice(p,1)}}}attachToDom(h,p,f){this._element=h,this._mouseService=p,this._renderService=f,this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){if(this._lastMouseEvent=h,!this._element||!this._mouseService)return;const p=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!p)return;this._isMouseOut=!1;const f=h.composedPath();for(let g=0;g<f.length;g++){const b=f[g];if(b.classList.contains("xterm"))break;if(b.classList.contains("xterm-hover"))return}this._lastBufferCell&&p.x===this._lastBufferCell.x&&p.y===this._lastBufferCell.y||(this._handleHover(p),this._lastBufferCell=p)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,p){var f,g;this._activeProviderReplies&&p||((f=this._activeProviderReplies)===null||f===void 0||f.forEach(w=>{w==null||w.forEach(k=>{k.link.dispose&&k.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=h.y);let b=!1;for(const[w,k]of this._linkProviders.entries())p?!((g=this._activeProviderReplies)===null||g===void 0)&&g.get(w)&&(b=this._checkLinkProviderResult(w,h,b)):k.provideLinks(h.y,j=>{var S,E;if(this._isMouseOut)return;const N=j==null?void 0:j.map(O=>({link:O}));(S=this._activeProviderReplies)===null||S===void 0||S.set(w,N),b=this._checkLinkProviderResult(w,h,b),((E=this._activeProviderReplies)===null||E===void 0?void 0:E.size)===this._linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)})}_removeIntersectingLinks(h,p){const f=new Set;for(let g=0;g<p.size;g++){const b=p.get(g);if(b)for(let w=0;w<b.length;w++){const k=b[w],j=k.link.range.start.y<h?0:k.link.range.start.x,S=k.link.range.end.y>h?this._bufferService.cols:k.link.range.end.x;for(let E=j;E<=S;E++){if(f.has(E)){b.splice(w--,1);break}f.add(E)}}}}_checkLinkProviderResult(h,p,f){var g;if(!this._activeProviderReplies)return f;const b=this._activeProviderReplies.get(h);let w=!1;for(let k=0;k<h;k++)this._activeProviderReplies.has(k)&&!this._activeProviderReplies.get(k)||(w=!0);if(!w&&b){const k=b.find(j=>this._linkAtPosition(j.link,p));k&&(f=!0,this._handleNewLink(k))}if(this._activeProviderReplies.size===this._linkProviders.length&&!f)for(let k=0;k<this._activeProviderReplies.size;k++){const j=(g=this._activeProviderReplies.get(k))===null||g===void 0?void 0:g.find(S=>this._linkAtPosition(S.link,p));if(j){f=!0,this._handleNewLink(j);break}}return f}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._element||!this._mouseService||!this._currentLink)return;const p=this._positionFromMouseEvent(h,this._element,this._mouseService);p&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,p)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,p){this._element&&this._currentLink&&this._lastMouseEvent&&(!h||!p||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=p)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(h.link,p)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>{var f,g;return(g=(f=this._currentLink)===null||f===void 0?void 0:f.state)===null||g===void 0?void 0:g.decorations.pointerCursor},set:f=>{var g,b;!((g=this._currentLink)===null||g===void 0)&&g.state&&this._currentLink.state.decorations.pointerCursor!==f&&(this._currentLink.state.decorations.pointerCursor=f,this._currentLink.state.isHovered&&((b=this._element)===null||b===void 0||b.classList.toggle("xterm-cursor-pointer",f)))}},underline:{get:()=>{var f,g;return(g=(f=this._currentLink)===null||f===void 0?void 0:f.state)===null||g===void 0?void 0:g.decorations.underline},set:f=>{var g,b,w;!((g=this._currentLink)===null||g===void 0)&&g.state&&((w=(b=this._currentLink)===null||b===void 0?void 0:b.state)===null||w===void 0?void 0:w.decorations.underline)!==f&&(this._currentLink.state.decorations.underline=f,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,f))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(f=>{if(!this._currentLink)return;const g=f.start===0?0:f.start+1+this._bufferService.buffer.ydisp,b=this._bufferService.buffer.ydisp+1+f.end;if(this._currentLink.link.range.start.y>=g&&this._currentLink.link.range.end.y<=b&&(this._clearCurrentLink(g,b),this._lastMouseEvent&&this._element)){const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._askForLink(w,!1)}})))}_linkHover(h,p,f){var g;!((g=this._currentLink)===null||g===void 0)&&g.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),p.hover&&p.hover(f,p.text)}_fireUnderlineEvent(h,p){const f=h.range,g=this._bufferService.buffer.ydisp,b=this._createLinkUnderlineEvent(f.start.x-1,f.start.y-g-1,f.end.x,f.end.y-g-1,void 0);(p?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(b)}_linkLeave(h,p,f){var g;!((g=this._currentLink)===null||g===void 0)&&g.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),p.leave&&p.leave(f,p.text)}_linkAtPosition(h,p){const f=h.range.start.y*this._bufferService.cols+h.range.start.x,g=h.range.end.y*this._bufferService.cols+h.range.end.x,b=p.y*this._bufferService.cols+p.x;return f<=b&&b<=g}_positionFromMouseEvent(h,p,f){const g=f.getCoords(h,p,this._bufferService.cols,this._bufferService.rows);if(g)return{x:g[0],y:g[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,p,f,g,b){return{x1:h,y1:p,x2:f,y2:g,cols:this._bufferService.cols,fg:b}}};a.Linkifier2=y=u([m(0,_.IBufferService)],y)},9042:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,a,c){var u=this&&this.__decorate||function(y,h,p,f){var g,b=arguments.length,w=b<3?h:f===null?f=Object.getOwnPropertyDescriptor(h,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(y,h,p,f);else for(var k=y.length-1;k>=0;k--)(g=y[k])&&(w=(b<3?g(w):b>3?g(h,p,w):g(h,p))||w);return b>3&&w&&Object.defineProperty(h,p,w),w},m=this&&this.__param||function(y,h){return function(p,f){h(p,f,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const d=c(511),x=c(2585);let v=a.OscLinkProvider=class{constructor(y,h,p){this._bufferService=y,this._optionsService=h,this._oscLinkService=p}provideLinks(y,h){var p;const f=this._bufferService.buffer.lines.get(y-1);if(!f)return void h(void 0);const g=[],b=this._optionsService.rawOptions.linkHandler,w=new d.CellData,k=f.getTrimmedLength();let j=-1,S=-1,E=!1;for(let N=0;N<k;N++)if(S!==-1||f.hasContent(N)){if(f.loadCell(N,w),w.hasExtendedAttrs()&&w.extended.urlId){if(S===-1){S=N,j=w.extended.urlId;continue}E=w.extended.urlId!==j}else S!==-1&&(E=!0);if(E||S!==-1&&N===k-1){const O=(p=this._oscLinkService.getLinkData(j))===null||p===void 0?void 0:p.uri;if(O){const T={start:{x:S+1,y},end:{x:N+(E||N!==k-1?0:1),y}};let L=!1;if(!(b!=null&&b.allowNonHttpProtocols))try{const $=new URL(O);["http:","https:"].includes($.protocol)||(L=!0)}catch{L=!0}L||g.push({text:O,range:T,activate:($,U)=>b?b.activate($,U,T):_(0,U),hover:($,U)=>{var z;return(z=b==null?void 0:b.hover)===null||z===void 0?void 0:z.call(b,$,U,T)},leave:($,U)=>{var z;return(z=b==null?void 0:b.leave)===null||z===void 0?void 0:z.call(b,$,U,T)}})}E=!1,w.hasExtendedAttrs()&&w.extended.urlId?(S=N,j=w.extended.urlId):(S=-1,j=-1)}}h(g)}};function _(y,h){if(confirm(`Do you want to navigate to ${h}?
|
|
196
|
+
|
|
197
|
+
WARNING: This link could potentially be dangerous`)){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=v=u([m(0,x.IBufferService),m(1,x.IOptionsService),m(2,x.IOscLinkService)],v)},6193:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,u){this._parentWindow=c,this._renderCallback=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(c,u,m){this._rowCount=m,c=c!==void 0?c:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},5596:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ScreenDprMonitor=void 0;const u=c(844);class m extends u.Disposable{constructor(x){super(),this._parentWindow=x,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,u.toDisposable)(()=>{this.clearListener()}))}setListener(x){this._listener&&this.clearListener(),this._listener=x,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var x;this._outerListener&&((x=this._resolutionMediaMatchList)===null||x===void 0||x.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}a.ScreenDprMonitor=m},3236:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const u=c(3614),m=c(3656),d=c(6465),x=c(9042),v=c(3730),_=c(1680),y=c(3107),h=c(5744),p=c(2950),f=c(1296),g=c(428),b=c(4269),w=c(5114),k=c(8934),j=c(3230),S=c(9312),E=c(4725),N=c(6731),O=c(8055),T=c(8969),L=c(8460),$=c(844),U=c(6114),z=c(8437),K=c(2584),R=c(7399),P=c(5941),D=c(9074),M=c(2585),V=c(5435),W=c(4567),J=typeof window<"u"?window.document:null;class X extends T.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(A={}){super(A),this.browser=U,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new $.MutableDisposable),this._onCursorMove=this.register(new L.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new L.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new L.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new L.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new L.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new L.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new L.EventEmitter),this._onBlur=this.register(new L.EventEmitter),this._onA11yCharEmitter=this.register(new L.EventEmitter),this._onA11yTabEmitter=this.register(new L.EventEmitter),this._onWillOpen=this.register(new L.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(d.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(v.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(M.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((B,G)=>this.refresh(B,G))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(B=>this._reportWindowsOptions(B))),this.register(this._inputHandler.onColor(B=>this._handleColorEvent(B))),this.register((0,L.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,L.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(B=>this._afterResize(B.cols,B.rows))),this.register((0,$.toDisposable)(()=>{var B,G;this._customKeyEventHandler=void 0,(G=(B=this.element)===null||B===void 0?void 0:B.parentNode)===null||G===void 0||G.removeChild(this.element)}))}_handleColorEvent(A){if(this._themeService)for(const B of A){let G,Y="";switch(B.index){case 256:G="foreground",Y="10";break;case 257:G="background",Y="11";break;case 258:G="cursor",Y="12";break;default:G="ansi",Y="4;"+B.index}switch(B.type){case 0:const ce=O.color.toColorRGB(G==="ansi"?this._themeService.colors.ansi[B.index]:this._themeService.colors[G]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${Y};${(0,P.toRgbString)(ce)}${K.C1_ESCAPED.ST}`);break;case 1:if(G==="ansi")this._themeService.modifyColors(Q=>Q.ansi[B.index]=O.rgba.toColor(...B.color));else{const Q=G;this._themeService.modifyColors(ge=>ge[Q]=O.rgba.toColor(...B.color))}break;case 2:this._themeService.restoreColor(B.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(A){A?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(A){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[I"),this.updateCursorStyle(A),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var A;return(A=this.textarea)===null||A===void 0?void 0:A.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const A=this.buffer.ybase+this.buffer.y,B=this.buffer.lines.get(A);if(!B)return;const G=Math.min(this.buffer.x,this.cols-1),Y=this._renderService.dimensions.css.cell.height,ce=B.getWidth(G),Q=this._renderService.dimensions.css.cell.width*ce,ge=this.buffer.y*this._renderService.dimensions.css.cell.height,De=G*this._renderService.dimensions.css.cell.width;this.textarea.style.left=De+"px",this.textarea.style.top=ge+"px",this.textarea.style.width=Q+"px",this.textarea.style.height=Y+"px",this.textarea.style.lineHeight=Y+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",B=>{this.hasSelection()&&(0,u.copyHandler)(B,this._selectionService)}));const A=B=>(0,u.handlePasteEvent)(B,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",A)),this.register((0,m.addDisposableDomListener)(this.element,"paste",A)),U.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",B=>{B.button===2&&(0,u.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",B=>{(0,u.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),U.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",B=>{B.button===1&&(0,u.moveTextAreaUnderMouseCursor)(B,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",A=>this._keyUp(A),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",A=>this._keyDown(A),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",A=>this._keyPress(A),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",A=>this._compositionHelper.compositionupdate(A))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,m.addDisposableDomListener)(this.textarea,"input",A=>this._inputEvent(A),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(A){var B;if(!A)throw new Error("Terminal requires a parent element.");A.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=A.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),A.appendChild(this.element);const G=J.createDocumentFragment();this._viewportElement=J.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),G.appendChild(this._viewportElement),this._viewportScrollArea=J.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=J.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=J.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),G.appendChild(this.screenElement),this.textarea=J.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",x.promptLabel),U.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this._instantiationService.createInstance(w.CoreBrowserService,this.textarea,(B=this._document.defaultView)!==null&&B!==void 0?B:window),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",Y=>this._handleTextAreaFocus(Y))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(g.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(N.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(b.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(j.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(Y=>this._onRender.fire(Y))),this.onResize(Y=>this._renderService.resize(Y.cols,Y.rows)),this._compositionView=J.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(G);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(k.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(_.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(Y=>this.scrollLines(Y.amount,Y.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(S.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(E.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(Y=>this.scrollLines(Y.amount,Y.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(Y=>this._renderService.handleSelectionChanged(Y.start,Y.end,Y.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(Y=>{this.textarea.value=Y,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(Y=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(y.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",Y=>this._selectionService.handleMouseDown(Y))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",Y=>this._handleScreenReaderModeOptionChange(Y))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",Y=>{!this._overviewRulerRenderer&&Y&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const A=this,B=this.element;function G(Q){const ge=A._mouseService.getMouseReportCoords(Q,A.screenElement);if(!ge)return!1;let De,Ue;switch(Q.overrideType||Q.type){case"mousemove":Ue=32,Q.buttons===void 0?(De=3,Q.button!==void 0&&(De=Q.button<3?Q.button:3)):De=1&Q.buttons?0:4&Q.buttons?1:2&Q.buttons?2:3;break;case"mouseup":Ue=0,De=Q.button<3?Q.button:3;break;case"mousedown":Ue=1,De=Q.button<3?Q.button:3;break;case"wheel":if(A.viewport.getLinesScrolled(Q)===0)return!1;Ue=Q.deltaY<0?0:1,De=4;break;default:return!1}return!(Ue===void 0||De===void 0||De>4)&&A.coreMouseService.triggerMouseEvent({col:ge.col,row:ge.row,x:ge.x,y:ge.y,button:De,action:Ue,ctrl:Q.ctrlKey,alt:Q.altKey,shift:Q.shiftKey})}const Y={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ce={mouseup:Q=>(G(Q),Q.buttons||(this._document.removeEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.removeEventListener("mousemove",Y.mousedrag)),this.cancel(Q)),wheel:Q=>(G(Q),this.cancel(Q,!0)),mousedrag:Q=>{Q.buttons&&G(Q)},mousemove:Q=>{Q.buttons||G(Q)}};this.register(this.coreMouseService.onProtocolChange(Q=>{Q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Q)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&Q?Y.mousemove||(B.addEventListener("mousemove",ce.mousemove),Y.mousemove=ce.mousemove):(B.removeEventListener("mousemove",Y.mousemove),Y.mousemove=null),16&Q?Y.wheel||(B.addEventListener("wheel",ce.wheel,{passive:!1}),Y.wheel=ce.wheel):(B.removeEventListener("wheel",Y.wheel),Y.wheel=null),2&Q?Y.mouseup||(B.addEventListener("mouseup",ce.mouseup),Y.mouseup=ce.mouseup):(this._document.removeEventListener("mouseup",Y.mouseup),B.removeEventListener("mouseup",Y.mouseup),Y.mouseup=null),4&Q?Y.mousedrag||(Y.mousedrag=ce.mousedrag):(this._document.removeEventListener("mousemove",Y.mousedrag),Y.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(B,"mousedown",Q=>{if(Q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Q))return G(Q),Y.mouseup&&this._document.addEventListener("mouseup",Y.mouseup),Y.mousedrag&&this._document.addEventListener("mousemove",Y.mousedrag),this.cancel(Q)})),this.register((0,m.addDisposableDomListener)(B,"wheel",Q=>{if(!Y.wheel){if(!this.buffer.hasScrollback){const ge=this.viewport.getLinesScrolled(Q);if(ge===0)return;const De=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Q.deltaY<0?"A":"B");let Ue="";for(let Ct=0;Ct<Math.abs(ge);Ct++)Ue+=De;return this.coreService.triggerDataEvent(Ue,!0),this.cancel(Q,!0)}return this.viewport.handleWheel(Q)?this.cancel(Q):void 0}},{passive:!1})),this.register((0,m.addDisposableDomListener)(B,"touchstart",Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Q),this.cancel(Q)},{passive:!0})),this.register((0,m.addDisposableDomListener)(B,"touchmove",Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Q)?void 0:this.cancel(Q)},{passive:!1}))}refresh(A,B){var G;(G=this._renderService)===null||G===void 0||G.refreshRows(A,B)}updateCursorStyle(A){var B;!((B=this._selectionService)===null||B===void 0)&&B.shouldColumnSelect(A)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(A,B,G=0){var Y;G===1?(super.scrollLines(A,B,G),this.refresh(0,this.rows-1)):(Y=this.viewport)===null||Y===void 0||Y.scrollLines(A)}paste(A){(0,u.paste)(A,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(A){this._customKeyEventHandler=A}registerLinkProvider(A){return this.linkifier2.registerLinkProvider(A)}registerCharacterJoiner(A){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const B=this._characterJoinerService.register(A);return this.refresh(0,this.rows-1),B}deregisterCharacterJoiner(A){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(A)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(A){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+A)}registerDecoration(A){return this._decorationService.registerDecoration(A)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(A,B,G){this._selectionService.setSelection(A,B,G)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var A;(A=this._selectionService)===null||A===void 0||A.clearSelection()}selectAll(){var A;(A=this._selectionService)===null||A===void 0||A.selectAll()}selectLines(A,B){var G;(G=this._selectionService)===null||G===void 0||G.selectLines(A,B)}_keyDown(A){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;const B=this.browser.isMac&&this.options.macOptionIsMeta&&A.altKey;if(!B&&!this._compositionHelper.keydown(A))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;B||A.key!=="Dead"&&A.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const G=(0,R.evaluateKeyboardEvent)(A,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(A),G.type===3||G.type===2){const Y=this.rows-1;return this.scrollLines(G.type===2?-Y:Y),this.cancel(A,!0)}return G.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,A)||(G.cancel&&this.cancel(A,!0),!G.key||!!(A.key&&!A.ctrlKey&&!A.altKey&&!A.metaKey&&A.key.length===1&&A.key.charCodeAt(0)>=65&&A.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(G.key!==K.C0.ETX&&G.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:G.key,domEvent:A}),this._showCursor(),this.coreService.triggerDataEvent(G.key,!0),!this.optionsService.rawOptions.screenReaderMode||A.altKey||A.ctrlKey?this.cancel(A,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(A,B){const G=A.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||A.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey||A.isWindows&&B.getModifierState("AltGraph");return B.type==="keypress"?G:G&&(!B.keyCode||B.keyCode>47)}_keyUp(A){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1||(function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18}(A)||this.focus(),this.updateCursorStyle(A),this._keyPressHandled=!1)}_keyPress(A){let B;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;if(this.cancel(A),A.charCode)B=A.charCode;else if(A.which===null||A.which===void 0)B=A.keyCode;else{if(A.which===0||A.charCode===0)return!1;B=A.which}return!(!B||(A.altKey||A.ctrlKey||A.metaKey)&&!this._isThirdLevelShift(this.browser,A)||(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:A}),this._showCursor(),this.coreService.triggerDataEvent(B,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(A){if(A.data&&A.inputType==="insertText"&&(!A.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const B=A.data;return this.coreService.triggerDataEvent(B,!0),this.cancel(A),!0}return!1}resize(A,B){A!==this.cols||B!==this.rows?super.resize(A,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(A,B){var G,Y;(G=this._charSizeService)===null||G===void 0||G.measure(),(Y=this.viewport)===null||Y===void 0||Y.syncScrollArea(!0)}clear(){var A;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let B=1;B<this.rows;B++)this.buffer.lines.push(this.buffer.getBlankLine(z.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(A=this.viewport)===null||A===void 0||A.reset(),this.refresh(0,this.rows-1)}}reset(){var A,B;this.options.rows=this.rows,this.options.cols=this.cols;const G=this._customKeyEventHandler;this._setup(),super.reset(),(A=this._selectionService)===null||A===void 0||A.reset(),this._decorationService.reset(),(B=this.viewport)===null||B===void 0||B.reset(),this._customKeyEventHandler=G,this.refresh(0,this.rows-1)}clearTextureAtlas(){var A;(A=this._renderService)===null||A===void 0||A.clearTextureAtlas()}_reportFocus(){var A;!((A=this.element)===null||A===void 0)&&A.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(A){if(this._renderService)switch(A){case V.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const B=this._renderService.dimensions.css.canvas.width.toFixed(0),G=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${G};${B}t`);break;case V.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const Y=this._renderService.dimensions.css.cell.width.toFixed(0),ce=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${ce};${Y}t`)}}cancel(A,B){if(this.options.cancelEvents||B)return A.preventDefault(),A.stopPropagation(),!1}}a.Terminal=X},9924:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(c,u=1e3){this._renderCallback=c,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,u,m){this._rowCount=m,c=c!==void 0?c:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const x=d-this._lastRefreshMs,v=this._debounceThresholdMS-x;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},v)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u)}}},1680:function(l,a,c){var u=this&&this.__decorate||function(p,f,g,b){var w,k=arguments.length,j=k<3?f:b===null?b=Object.getOwnPropertyDescriptor(f,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,f,g,b);else for(var S=p.length-1;S>=0;S--)(w=p[S])&&(j=(k<3?w(j):k>3?w(f,g,j):w(f,g))||j);return k>3&&j&&Object.defineProperty(f,g,j),j},m=this&&this.__param||function(p,f){return function(g,b){f(g,b,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const d=c(3656),x=c(4725),v=c(8460),_=c(844),y=c(2585);let h=a.Viewport=class extends _.Disposable{constructor(p,f,g,b,w,k,j,S){super(),this._viewportElement=p,this._scrollArea=f,this._bufferService=g,this._optionsService=b,this._charSizeService=w,this._renderService=k,this._coreBrowserService=j,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(E=>this._activeBuffer=E.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(E=>this._renderDimensions=E)),this._handleThemeChange(S.colors),this.register(S.onChangeColors(E=>this._handleThemeChange(E))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(p){this._viewportElement.style.backgroundColor=p.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(p){if(p)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const p=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==p&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=p),this._refreshAnimationFrame=null}syncScrollArea(p=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(p);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(p)}_handleScroll(p){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const p=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(p*(this._smoothScrollState.target-this._smoothScrollState.origin)),p<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(p,f){const g=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&g<this._lastRecordedBufferHeight)||(p.cancelable&&p.preventDefault(),!1)}handleWheel(p){const f=this._getPixelsScrolled(p);return f!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+f:this._smoothScrollState.target+=f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=f,this._bubbleScroll(p,f))}scrollLines(p){if(p!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=p*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!1})}_getPixelsScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let f=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(p,f){var g;let b,w="";const k=[],j=f??this._bufferService.buffer.lines.length,S=this._bufferService.buffer.lines;for(let E=p;E<j;E++){const N=S.get(E);if(!N)continue;const O=(g=S.get(E+1))===null||g===void 0?void 0:g.isWrapped;if(w+=N.translateToString(!O),!O||E===S.length-1){const T=document.createElement("div");T.textContent=w,k.push(T),w.length>0&&(b=T),w=""}}return{bufferElements:k,cursorElement:b}}getLinesScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let f=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(p,f){const g=this._optionsService.rawOptions.fastScrollModifier;return g==="alt"&&f.altKey||g==="ctrl"&&f.ctrlKey||g==="shift"&&f.shiftKey?p*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:p*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(p){this._lastTouchY=p.touches[0].pageY}handleTouchMove(p){const f=this._lastTouchY-p.touches[0].pageY;return this._lastTouchY=p.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(p,f))}};a.Viewport=h=u([m(2,y.IBufferService),m(3,y.IOptionsService),m(4,x.ICharSizeService),m(5,x.IRenderService),m(6,x.ICoreBrowserService),m(7,x.IThemeService)],h)},3107:function(l,a,c){var u=this&&this.__decorate||function(h,p,f,g){var b,w=arguments.length,k=w<3?p:g===null?g=Object.getOwnPropertyDescriptor(p,f):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,p,f,g);else for(var j=h.length-1;j>=0;j--)(b=h[j])&&(k=(w<3?b(k):w>3?b(p,f,k):b(p,f))||k);return w>3&&k&&Object.defineProperty(p,f,k),k},m=this&&this.__param||function(h,p){return function(f,g){p(f,g,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const d=c(3656),x=c(4725),v=c(844),_=c(2585);let y=a.BufferDecorationRenderer=class extends v.Disposable{constructor(h,p,f,g){super(),this._screenElement=h,this._bufferService=p,this._decorationService=f,this._renderService=g,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register((0,d.addDisposableDomListener)(window,"resize",()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(b=>this._removeDecoration(b))),this.register((0,v.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const h of this._decorationService.decorations)this._renderDecoration(h);this._dimensionsChanged=!1}_renderDecoration(h){this._refreshStyle(h),this._dimensionsChanged&&this._refreshXPosition(h)}_createElement(h){var p,f;const g=document.createElement("div");g.classList.add("xterm-decoration"),g.classList.toggle("xterm-decoration-top-layer",((p=h==null?void 0:h.options)===null||p===void 0?void 0:p.layer)==="top"),g.style.width=`${Math.round((h.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,g.style.height=(h.options.height||1)*this._renderService.dimensions.css.cell.height+"px",g.style.top=(h.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",g.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=(f=h.options.x)!==null&&f!==void 0?f:0;return b&&b>this._bufferService.cols&&(g.style.display="none"),this._refreshXPosition(h,g),g}_refreshStyle(h){const p=h.marker.line-this._bufferService.buffers.active.ydisp;if(p<0||p>=this._bufferService.rows)h.element&&(h.element.style.display="none",h.onRenderEmitter.fire(h.element));else{let f=this._decorationElements.get(h);f||(f=this._createElement(h),h.element=f,this._decorationElements.set(h,f),this._container.appendChild(f),h.onDispose(()=>{this._decorationElements.delete(h),f.remove()})),f.style.top=p*this._renderService.dimensions.css.cell.height+"px",f.style.display=this._altBufferIsActive?"none":"block",h.onRenderEmitter.fire(f)}}_refreshXPosition(h,p=h.element){var f;if(!p)return;const g=(f=h.options.x)!==null&&f!==void 0?f:0;(h.options.anchor||"left")==="right"?p.style.right=g?g*this._renderService.dimensions.css.cell.width+"px":"":p.style.left=g?g*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(h){var p;(p=this._decorationElements.get(h))===null||p===void 0||p.remove(),this._decorationElements.delete(h),h.dispose()}};a.BufferDecorationRenderer=y=u([m(1,_.IBufferService),m(2,_.IDecorationService),m(3,x.IRenderService)],y)},5871:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const u of this._zones)if(u.color===c.options.overviewRulerOptions.color&&u.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,c.marker.line))return;if(this._lineAdjacentToZone(u,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(u,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,u){return u>=c.startBufferLine&&u<=c.endBufferLine}_lineAdjacentToZone(c,u,m){return u>=c.startBufferLine-this._linePadding[m||"full"]&&u<=c.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(c,u){c.startBufferLine=Math.min(c.startBufferLine,u),c.endBufferLine=Math.max(c.endBufferLine,u)}}},5744:function(l,a,c){var u=this&&this.__decorate||function(b,w,k,j){var S,E=arguments.length,N=E<3?w:j===null?j=Object.getOwnPropertyDescriptor(w,k):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(b,w,k,j);else for(var O=b.length-1;O>=0;O--)(S=b[O])&&(N=(E<3?S(N):E>3?S(w,k,N):S(w,k))||N);return E>3&&N&&Object.defineProperty(w,k,N),N},m=this&&this.__param||function(b,w){return function(k,j){w(k,j,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const d=c(5871),x=c(3656),v=c(4725),_=c(844),y=c(2585),h={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0};let g=a.OverviewRulerRenderer=class extends _.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,w,k,j,S,E,N){var O;super(),this._viewportElement=b,this._screenElement=w,this._bufferService=k,this._decorationService=j,this._renderService=S,this._optionsService=E,this._coreBrowseService=N,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(O=this._viewportElement.parentElement)===null||O===void 0||O.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,_.toDisposable)(()=>{var L;(L=this._canvas)===null||L===void 0||L.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register((0,x.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const b=Math.floor(this._canvas.width/3),w=Math.ceil(this._canvas.width/3);p.full=this._canvas.width,p.left=b,p.center=w,p.right=b,this._refreshDrawHeightConstants(),f.full=0,f.left=0,f.center=p.left,f.right=p.left+p.center}_refreshDrawHeightConstants(){h.full=Math.round(2*this._coreBrowseService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,w=Math.round(Math.max(Math.min(b,12),6)*this._coreBrowseService.dpr);h.left=w,h.center=w,h.right=w}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const w of this._decorationService.decorations)this._colorZoneStore.addDecoration(w);this._ctx.lineWidth=1;const b=this._colorZoneStore.zones;for(const w of b)w.position!=="full"&&this._renderColorZone(w);for(const w of b)w.position==="full"&&this._renderColorZone(w);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(f[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-h[b.position||"full"]/2),p[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+h[b.position||"full"]))}_queueRefresh(b,w){this._shouldUpdateDimensions=b||this._shouldUpdateDimensions,this._shouldUpdateAnchor=w||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};a.OverviewRulerRenderer=g=u([m(2,y.IBufferService),m(3,y.IDecorationService),m(4,v.IRenderService),m(5,y.IOptionsService),m(6,v.ICoreBrowserService)],g)},2950:function(l,a,c){var u=this&&this.__decorate||function(y,h,p,f){var g,b=arguments.length,w=b<3?h:f===null?f=Object.getOwnPropertyDescriptor(h,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(y,h,p,f);else for(var k=y.length-1;k>=0;k--)(g=y[k])&&(w=(b<3?g(w):b>3?g(h,p,w):g(h,p))||w);return b>3&&w&&Object.defineProperty(h,p,w),w},m=this&&this.__param||function(y,h){return function(p,f){h(p,f,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const d=c(4725),x=c(2585),v=c(2584);let _=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(y,h,p,f,g,b){this._textarea=y,this._compositionView=h,this._bufferService=p,this._optionsService=f,this._coreService=g,this._renderService=b,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(y){this._compositionView.textContent=y.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(y){if(this._isComposing||this._isSendingComposition){if(y.keyCode===229||y.keyCode===16||y.keyCode===17||y.keyCode===18)return!1;this._finalizeComposition(!1)}return y.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(y){if(this._compositionView.classList.remove("active"),this._isComposing=!1,y){const h={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let p;this._isSendingComposition=!1,h.start+=this._dataAlreadySent.length,p=this._isComposing?this._textarea.value.substring(h.start,h.end):this._textarea.value.substring(h.start),p.length>0&&this._coreService.triggerDataEvent(p,!0)}},0)}else{this._isSendingComposition=!1;const h=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(h,!0)}}_handleAnyTextareaChanges(){const y=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const h=this._textarea.value,p=h.replace(y,"");this._dataAlreadySent=p,h.length>y.length?this._coreService.triggerDataEvent(p,!0):h.length<y.length?this._coreService.triggerDataEvent(`${v.C0.DEL}`,!0):h.length===y.length&&h!==y&&this._coreService.triggerDataEvent(h,!0)}},0)}updateCompositionElements(y){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const h=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),p=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,g=h*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=g+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=p+"px",this._compositionView.style.lineHeight=p+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const b=this._compositionView.getBoundingClientRect();this._textarea.style.left=g+"px",this._textarea.style.top=f+"px",this._textarea.style.width=Math.max(b.width,1)+"px",this._textarea.style.height=Math.max(b.height,1)+"px",this._textarea.style.lineHeight=b.height+"px"}y||setTimeout(()=>this.updateCompositionElements(!0),0)}}};a.CompositionHelper=_=u([m(2,x.IBufferService),m(3,x.IOptionsService),m(4,x.ICoreService),m(5,d.IRenderService)],_)},9806:(l,a)=>{function c(u,m,d){const x=d.getBoundingClientRect(),v=u.getComputedStyle(d),_=parseInt(v.getPropertyValue("padding-left")),y=parseInt(v.getPropertyValue("padding-top"));return[m.clientX-x.left-_,m.clientY-x.top-y]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=c,a.getCoords=function(u,m,d,x,v,_,y,h,p){if(!_)return;const f=c(u,m,d);return f?(f[0]=Math.ceil((f[0]+(p?y/2:0))/y),f[1]=Math.ceil(f[1]/h),f[0]=Math.min(Math.max(f[0],1),x+(p?1:0)),f[1]=Math.min(Math.max(f[1],1),v),f):void 0}},9504:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const u=c(2584);function m(h,p,f,g){const b=h-d(h,f),w=p-d(p,f),k=Math.abs(b-w)-function(j,S,E){let N=0;const O=j-d(j,E),T=S-d(S,E);for(let L=0;L<Math.abs(O-T);L++){const $=x(j,S)==="A"?-1:1,U=E.buffer.lines.get(O+$*L);U!=null&&U.isWrapped&&N++}return N}(h,p,f);return y(k,_(x(h,p),g))}function d(h,p){let f=0,g=p.buffer.lines.get(h),b=g==null?void 0:g.isWrapped;for(;b&&h>=0&&h<p.rows;)f++,g=p.buffer.lines.get(--h),b=g==null?void 0:g.isWrapped;return f}function x(h,p){return h>p?"A":"B"}function v(h,p,f,g,b,w){let k=h,j=p,S="";for(;k!==f||j!==g;)k+=b?1:-1,b&&k>w.cols-1?(S+=w.buffer.translateBufferLineToString(j,!1,h,k),k=0,h=0,j++):!b&&k<0&&(S+=w.buffer.translateBufferLineToString(j,!1,0,h+1),k=w.cols-1,h=k,j--);return S+w.buffer.translateBufferLineToString(j,!1,h,k)}function _(h,p){const f=p?"O":"[";return u.C0.ESC+f+h}function y(h,p){h=Math.floor(h);let f="";for(let g=0;g<h;g++)f+=p;return f}a.moveToCellSequence=function(h,p,f,g){const b=f.buffer.x,w=f.buffer.y;if(!f.buffer.hasScrollback)return function(S,E,N,O,T,L){return m(E,O,T,L).length===0?"":y(v(S,E,S,E-d(E,T),!1,T).length,_("D",L))}(b,w,0,p,f,g)+m(w,p,f,g)+function(S,E,N,O,T,L){let $;$=m(E,O,T,L).length>0?O-d(O,T):E;const U=O,z=function(K,R,P,D,M,V){let W;return W=m(P,D,M,V).length>0?D-d(D,M):R,K<P&&W<=D||K>=P&&W<D?"C":"D"}(S,E,N,O,T,L);return y(v(S,$,N,U,z==="C",T).length,_(z,L))}(b,w,h,p,f,g);let k;if(w===p)return k=b>h?"D":"C",y(Math.abs(b-h),_(k,g));k=w>p?"D":"C";const j=Math.abs(w-p);return y(function(S,E){return E.cols-S}(w>p?h:b,f)+(j-1)*f.cols+1+((w>p?b:h)-1),_(k,g))}},1296:function(l,a,c){var u=this&&this.__decorate||function(T,L,$,U){var z,K=arguments.length,R=K<3?L:U===null?U=Object.getOwnPropertyDescriptor(L,$):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(T,L,$,U);else for(var P=T.length-1;P>=0;P--)(z=T[P])&&(R=(K<3?z(R):K>3?z(L,$,R):z(L,$))||R);return K>3&&R&&Object.defineProperty(L,$,R),R},m=this&&this.__param||function(T,L){return function($,U){L($,U,T)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const d=c(3787),x=c(2550),v=c(2223),_=c(6171),y=c(4725),h=c(8055),p=c(8460),f=c(844),g=c(2585),b="xterm-dom-renderer-owner-",w="xterm-rows",k="xterm-fg-",j="xterm-bg-",S="xterm-focus",E="xterm-selection";let N=1,O=a.DomRenderer=class extends f.Disposable{constructor(T,L,$,U,z,K,R,P,D,M){super(),this._element=T,this._screenElement=L,this._viewportElement=$,this._linkifier2=U,this._charSizeService=K,this._optionsService=R,this._bufferService=P,this._coreBrowserService=D,this._themeService=M,this._terminalClass=N++,this._rowElements=[],this.onRequestRedraw=this.register(new p.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(w),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(E),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,_.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(V=>this._injectCss(V))),this._injectCss(this._themeService.colors),this._rowFactory=z.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(b+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(V=>this._handleLinkHover(V))),this.register(this._linkifier2.onHideLinkUnderline(V=>this._handleLinkLeave(V))),this.register((0,f.toDisposable)(()=>{this._element.classList.remove(b+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new x.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const T=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*T,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*T),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/T),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/T),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const $ of this._rowElements)$.style.width=`${this.dimensions.css.canvas.width}px`,$.style.height=`${this.dimensions.css.cell.height}px`,$.style.lineHeight=`${this.dimensions.css.cell.height}px`,$.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const L=`${this._terminalSelector} .${w} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=L,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(T){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let L=`${this._terminalSelector} .${w} { color: ${T.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;L+=`${this._terminalSelector} .${w} .xterm-dim { color: ${h.color.multiplyOpacity(T.foreground,.5).css};}`,L+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,L+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",L+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css}; } 50% { background-color: inherit; color: ${T.cursor.css}; }}`,L+=`${this._terminalSelector} .${w}.${S} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${w}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css};}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${T.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${T.cursor.css} inset;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${T.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,L+=`${this._terminalSelector} .${E} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${E} div { position: absolute; background-color: ${T.selectionBackgroundOpaque.css};}${this._terminalSelector} .${E} div { position: absolute; background-color: ${T.selectionInactiveBackgroundOpaque.css};}`;for(const[$,U]of T.ansi.entries())L+=`${this._terminalSelector} .${k}${$} { color: ${U.css}; }${this._terminalSelector} .${k}${$}.xterm-dim { color: ${h.color.multiplyOpacity(U,.5).css}; }${this._terminalSelector} .${j}${$} { background-color: ${U.css}; }`;L+=`${this._terminalSelector} .${k}${v.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(T.background).css}; }${this._terminalSelector} .${k}${v.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(T.background),.5).css}; }${this._terminalSelector} .${j}${v.INVERTED_DEFAULT_COLOR} { background-color: ${T.foreground.css}; }`,this._themeStyleElement.textContent=L}_setDefaultSpacing(){const T=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${T}px`,this._rowFactory.defaultSpacing=T}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(T,L){for(let $=this._rowElements.length;$<=L;$++){const U=document.createElement("div");this._rowContainer.appendChild(U),this._rowElements.push(U)}for(;this._rowElements.length>L;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(T,L){this._refreshRowElements(T,L),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(S)}handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(T,L,$){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(T,L,$),this.renderRows(0,this._bufferService.rows-1),!T||!L)return;const U=T[1]-this._bufferService.buffer.ydisp,z=L[1]-this._bufferService.buffer.ydisp,K=Math.max(U,0),R=Math.min(z,this._bufferService.rows-1);if(K>=this._bufferService.rows||R<0)return;const P=document.createDocumentFragment();if($){const D=T[0]>L[0];P.appendChild(this._createSelectionElement(K,D?L[0]:T[0],D?T[0]:L[0],R-K+1))}else{const D=U===K?T[0]:0,M=K===z?L[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(K,D,M));const V=R-K-1;if(P.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,V)),K!==R){const W=z===R?L[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(R,0,W))}}this._selectionContainer.appendChild(P)}_createSelectionElement(T,L,$,U=1){const z=document.createElement("div");return z.style.height=U*this.dimensions.css.cell.height+"px",z.style.top=T*this.dimensions.css.cell.height+"px",z.style.left=L*this.dimensions.css.cell.width+"px",z.style.width=this.dimensions.css.cell.width*($-L)+"px",z}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const T of this._rowElements)T.replaceChildren()}renderRows(T,L){const $=this._bufferService.buffer,U=$.ybase+$.y,z=Math.min($.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,P=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=T;D<=L;D++){const M=D+$.ydisp,V=this._rowElements[D],W=$.lines.get(M);if(!V||!W)break;V.replaceChildren(...this._rowFactory.createRow(W,M,M===U,R,P,z,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${b}${this._terminalClass}`}_handleLinkHover(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!0)}_handleLinkLeave(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!1)}_setCellUnderline(T,L,$,U,z,K){$<0&&(T=0),U<0&&(L=0);const R=this._bufferService.rows-1;$=Math.max(Math.min($,R),0),U=Math.max(Math.min(U,R),0),z=Math.min(z,this._bufferService.cols);const P=this._bufferService.buffer,D=P.ybase+P.y,M=Math.min(P.x,z-1),V=this._optionsService.rawOptions.cursorBlink,W=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let X=$;X<=U;++X){const fe=X+P.ydisp,A=this._rowElements[X],B=P.lines.get(fe);if(!A||!B)break;A.replaceChildren(...this._rowFactory.createRow(B,fe,fe===D,W,J,M,V,this.dimensions.css.cell.width,this._widthCache,K?X===$?T:0:-1,K?(X===U?L:z)-1:-1))}}};a.DomRenderer=O=u([m(4,g.IInstantiationService),m(5,y.ICharSizeService),m(6,g.IOptionsService),m(7,g.IBufferService),m(8,y.ICoreBrowserService),m(9,y.IThemeService)],O)},3787:function(l,a,c){var u=this&&this.__decorate||function(k,j,S,E){var N,O=arguments.length,T=O<3?j:E===null?E=Object.getOwnPropertyDescriptor(j,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(k,j,S,E);else for(var L=k.length-1;L>=0;L--)(N=k[L])&&(T=(O<3?N(T):O>3?N(j,S,T):N(j,S))||T);return O>3&&T&&Object.defineProperty(j,S,T),T},m=this&&this.__param||function(k,j){return function(S,E){j(S,E,k)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const d=c(2223),x=c(643),v=c(511),_=c(2585),y=c(8055),h=c(4725),p=c(4269),f=c(6171),g=c(3734);let b=a.DomRendererRowFactory=class{constructor(k,j,S,E,N,O,T){this._document=k,this._characterJoinerService=j,this._optionsService=S,this._coreBrowserService=E,this._coreService=N,this._decorationService=O,this._themeService=T,this._workCell=new v.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(k,j,S){this._selectionStart=k,this._selectionEnd=j,this._columnSelectMode=S}createRow(k,j,S,E,N,O,T,L,$,U,z){const K=[],R=this._characterJoinerService.getJoinedCharacters(j),P=this._themeService.colors;let D,M=k.getNoBgTrimmedLength();S&&M<O+1&&(M=O+1);let V=0,W="",J=0,X=0,fe=0,A=!1,B=0,G=!1,Y=0;const ce=[],Q=U!==-1&&z!==-1;for(let ge=0;ge<M;ge++){k.loadCell(ge,this._workCell);let De=this._workCell.getWidth();if(De===0)continue;let Ue=!1,Ct=ge,Ce=this._workCell;if(R.length>0&&ge===R[0][0]){Ue=!0;const he=R.shift();Ce=new p.JoinedCellData(this._workCell,k.translateToString(!0,he[0],he[1]),he[1]-he[0]),Ct=he[1]-1,De=Ce.getWidth()}const dr=this._isCellInSelection(ge,j),hr=S&&ge===O,On=Q&&ge>=U&&ge<=z;let Wr=!1;this._decorationService.forEachDecorationAtCell(ge,j,void 0,he=>{Wr=!0});let Mn=Ce.getChars()||x.WHITESPACE_CELL_CHAR;if(Mn===" "&&(Ce.isUnderline()||Ce.isOverline())&&(Mn=" "),Y=De*L-$.get(Mn,Ce.isBold(),Ce.isItalic()),D){if(V&&(dr&&G||!dr&&!G&&Ce.bg===J)&&(dr&&G&&P.selectionForeground||Ce.fg===X)&&Ce.extended.ext===fe&&On===A&&Y===B&&!hr&&!Ue&&!Wr){W+=Mn,V++;continue}V&&(D.textContent=W),D=this._document.createElement("span"),V=0,W=""}else D=this._document.createElement("span");if(J=Ce.bg,X=Ce.fg,fe=Ce.extended.ext,A=On,B=Y,G=dr,Ue&&O>=ge&&O<=Ct&&(O=ge),!this._coreService.isCursorHidden&&hr){if(ce.push("xterm-cursor"),this._coreBrowserService.isFocused)T&&ce.push("xterm-cursor-blink"),ce.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(N)switch(N){case"outline":ce.push("xterm-cursor-outline");break;case"block":ce.push("xterm-cursor-block");break;case"bar":ce.push("xterm-cursor-bar");break;case"underline":ce.push("xterm-cursor-underline")}}if(Ce.isBold()&&ce.push("xterm-bold"),Ce.isItalic()&&ce.push("xterm-italic"),Ce.isDim()&&ce.push("xterm-dim"),W=Ce.isInvisible()?x.WHITESPACE_CELL_CHAR:Ce.getChars()||x.WHITESPACE_CELL_CHAR,Ce.isUnderline()&&(ce.push(`xterm-underline-${Ce.extended.underlineStyle}`),W===" "&&(W=" "),!Ce.isUnderlineColorDefault()))if(Ce.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${g.AttributeData.toColorRGB(Ce.getUnderlineColor()).join(",")})`;else{let he=Ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ce.isBold()&&he<8&&(he+=8),D.style.textDecorationColor=P.ansi[he].css}Ce.isOverline()&&(ce.push("xterm-overline"),W===" "&&(W=" ")),Ce.isStrikethrough()&&ce.push("xterm-strikethrough"),On&&(D.style.textDecoration="underline");let ft=Ce.getFgColor(),xn=Ce.getFgColorMode(),I=Ce.getBgColor(),H=Ce.getBgColorMode();const q=!!Ce.isInverse();if(q){const he=ft;ft=I,I=he;const Re=xn;xn=H,H=Re}let re,se,te,le=!1;switch(this._decorationService.forEachDecorationAtCell(ge,j,void 0,he=>{he.options.layer!=="top"&&le||(he.backgroundColorRGB&&(H=50331648,I=he.backgroundColorRGB.rgba>>8&16777215,re=he.backgroundColorRGB),he.foregroundColorRGB&&(xn=50331648,ft=he.foregroundColorRGB.rgba>>8&16777215,se=he.foregroundColorRGB),le=he.options.layer==="top")}),!le&&dr&&(re=this._coreBrowserService.isFocused?P.selectionBackgroundOpaque:P.selectionInactiveBackgroundOpaque,I=re.rgba>>8&16777215,H=50331648,le=!0,P.selectionForeground&&(xn=50331648,ft=P.selectionForeground.rgba>>8&16777215,se=P.selectionForeground)),le&&ce.push("xterm-decoration-top"),H){case 16777216:case 33554432:te=P.ansi[I],ce.push(`xterm-bg-${I}`);break;case 50331648:te=y.rgba.toColor(I>>16,I>>8&255,255&I),this._addStyle(D,`background-color:#${w((I>>>0).toString(16),"0",6)}`);break;default:q?(te=P.foreground,ce.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):te=P.background}switch(re||Ce.isDim()&&(re=y.color.multiplyOpacity(te,.5)),xn){case 16777216:case 33554432:Ce.isBold()&&ft<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ft+=8),this._applyMinimumContrast(D,te,P.ansi[ft],Ce,re,void 0)||ce.push(`xterm-fg-${ft}`);break;case 50331648:const he=y.rgba.toColor(ft>>16&255,ft>>8&255,255&ft);this._applyMinimumContrast(D,te,he,Ce,re,se)||this._addStyle(D,`color:#${w(ft.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,te,P.foreground,Ce,re,void 0)||q&&ce.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}ce.length&&(D.className=ce.join(" "),ce.length=0),hr||Ue||Wr?D.textContent=W:V++,Y!==this.defaultSpacing&&(D.style.letterSpacing=`${Y}px`),K.push(D),ge=Ct}return D&&V&&(D.textContent=W),K}_applyMinimumContrast(k,j,S,E,N,O){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.excludeFromContrastRatioDemands)(E.getCode()))return!1;const T=this._getContrastCache(E);let L;if(N||O||(L=T.getColor(j.rgba,S.rgba)),L===void 0){const $=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);L=y.color.ensureContrastRatio(N||j,O||S,$),T.setColor((N||j).rgba,(O||S).rgba,L??null)}return!!L&&(this._addStyle(k,`color:${L.css}`),!0)}_getContrastCache(k){return k.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(k,j){k.setAttribute("style",`${k.getAttribute("style")||""}${j};`)}_isCellInSelection(k,j){const S=this._selectionStart,E=this._selectionEnd;return!(!S||!E)&&(this._columnSelectMode?S[0]<=E[0]?k>=S[0]&&j>=S[1]&&k<E[0]&&j<=E[1]:k<S[0]&&j>=S[1]&&k>=E[0]&&j<=E[1]:j>S[1]&&j<E[1]||S[1]===E[1]&&j===S[1]&&k>=S[0]&&k<E[0]||S[1]<E[1]&&j===E[1]&&k<E[0]||S[1]<E[1]&&j===S[1]&&k>=S[0])}};function w(k,j,S){for(;k.length<S;)k=j+k;return k}a.DomRendererRowFactory=b=u([m(1,h.ICharacterJoinerService),m(2,_.IOptionsService),m(3,h.ICoreBrowserService),m(4,_.ICoreService),m(5,_.IDecorationService),m(6,h.IThemeService)],b)},2550:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const u=c.createElement("span"),m=c.createElement("span");m.style.fontWeight="bold";const d=c.createElement("span");d.style.fontStyle="italic";const x=c.createElement("span");x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[u,m,d,x],this._container.appendChild(u),this._container.appendChild(m),this._container.appendChild(d),this._container.appendChild(x),c.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,u,m,d){c===this._font&&u===this._fontSize&&m===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=u,this._weight=m,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,u,m){let d=0;if(!u&&!m&&c.length===1&&(d=c.charCodeAt(0))<256)return this._flat[d]!==-9999?this._flat[d]:this._flat[d]=this._measure(c,0);let x=c;u&&(x+="B"),m&&(x+="I");let v=this._holey.get(x);if(v===void 0){let _=0;u&&(_|=1),m&&(_|=2),v=this._measure(c,_),this._holey.set(x,v)}return v}_measure(c,u){const m=this._measureElements[u];return m.textContent=c.repeat(32),m.offsetWidth/32}}},2223:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const u=c(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(l,a)=>{function c(u){return 57508<=u&&u<=57558}Object.defineProperty(a,"__esModule",{value:!0}),a.createRenderDimensions=a.excludeFromContrastRatioDemands=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(u){if(!u)throw new Error("value must not be falsy");return u},a.isPowerlineGlyph=c,a.isRestrictedPowerlineGlyph=function(u){return 57520<=u&&u<=57527},a.excludeFromContrastRatioDemands=function(u){return c(u)||function(m){return 9472<=m&&m<=9631}(u)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,u=this.selectionEnd;return!(!c||!u)&&(c[1]>u[1]||c[1]===u[1]&&c[0]>u[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,a,c){var u=this&&this.__decorate||function(h,p,f,g){var b,w=arguments.length,k=w<3?p:g===null?g=Object.getOwnPropertyDescriptor(p,f):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,p,f,g);else for(var j=h.length-1;j>=0;j--)(b=h[j])&&(k=(w<3?b(k):w>3?b(p,f,k):b(p,f))||k);return w>3&&k&&Object.defineProperty(p,f,k),k},m=this&&this.__param||function(h,p){return function(f,g){p(f,g,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const d=c(2585),x=c(8460),v=c(844);let _=a.CharSizeService=class extends v.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(h,p,f){super(),this._optionsService=f,this.width=0,this.height=0,this._onCharSizeChange=this.register(new x.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new y(h,p,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const h=this._measureStrategy.measure();h.width===this.width&&h.height===this.height||(this.width=h.width,this.height=h.height,this._onCharSizeChange.fire())}};a.CharSizeService=_=u([m(2,d.IOptionsService)],_);class y{constructor(p,f,g){this._document=p,this._parentElement=f,this._optionsService=g,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const p={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return p.width!==0&&p.height!==0&&(this._result.width=p.width/32,this._result.height=Math.ceil(p.height)),this._result}}},4269:function(l,a,c){var u=this&&this.__decorate||function(p,f,g,b){var w,k=arguments.length,j=k<3?f:b===null?b=Object.getOwnPropertyDescriptor(f,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(p,f,g,b);else for(var S=p.length-1;S>=0;S--)(w=p[S])&&(j=(k<3?w(j):k>3?w(f,g,j):w(f,g))||j);return k>3&&j&&Object.defineProperty(f,g,j),j},m=this&&this.__param||function(p,f){return function(g,b){f(g,b,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const d=c(3734),x=c(643),v=c(511),_=c(2585);class y extends d.AttributeData{constructor(f,g,b){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=g,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=y;let h=a.CharacterJoinerService=class yS{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new v.CellData}register(f){const g={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(g),g.id}deregister(f){for(let g=0;g<this._characterJoiners.length;g++)if(this._characterJoiners[g].id===f)return this._characterJoiners.splice(g,1),!0;return!1}getJoinedCharacters(f){if(this._characterJoiners.length===0)return[];const g=this._bufferService.buffer.lines.get(f);if(!g||g.length===0)return[];const b=[],w=g.translateToString(!0);let k=0,j=0,S=0,E=g.getFg(0),N=g.getBg(0);for(let O=0;O<g.getTrimmedLength();O++)if(g.loadCell(O,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==N){if(O-k>1){const T=this._getJoinedRanges(w,S,j,g,k);for(let L=0;L<T.length;L++)b.push(T[L])}k=O,S=j,E=this._workCell.fg,N=this._workCell.bg}j+=this._workCell.getChars().length||x.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-k>1){const O=this._getJoinedRanges(w,S,j,g,k);for(let T=0;T<O.length;T++)b.push(O[T])}return b}_getJoinedRanges(f,g,b,w,k){const j=f.substring(g,b);let S=[];try{S=this._characterJoiners[0].handler(j)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const N=this._characterJoiners[E].handler(j);for(let O=0;O<N.length;O++)yS._mergeRanges(S,N[O])}catch(N){console.error(N)}return this._stringRangesToCellRanges(S,w,k),S}_stringRangesToCellRanges(f,g,b){let w=0,k=!1,j=0,S=f[w];if(S){for(let E=b;E<this._bufferService.cols;E++){const N=g.getWidth(E),O=g.getString(E).length||x.WHITESPACE_CELL_CHAR.length;if(N!==0){if(!k&&S[0]<=j&&(S[0]=E,k=!0),S[1]<=j){if(S[1]=E,S=f[++w],!S)break;S[0]<=j?(S[0]=E,k=!0):k=!1}j+=O}}S&&(S[1]=this._bufferService.cols)}}static _mergeRanges(f,g){let b=!1;for(let w=0;w<f.length;w++){const k=f[w];if(b){if(g[1]<=k[0])return f[w-1][1]=g[1],f;if(g[1]<=k[1])return f[w-1][1]=Math.max(g[1],k[1]),f.splice(w,1),f;f.splice(w,1),w--}else{if(g[1]<=k[0])return f.splice(w,0,g),f;if(g[1]<=k[1])return k[0]=Math.min(g[0],k[0]),f;g[0]<k[1]&&(k[0]=Math.min(g[0],k[0]),b=!0)}}return b?f[f.length-1][1]=g[1]:f.push(g),f}};a.CharacterJoinerService=h=u([m(0,_.IBufferService)],h)},5114:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0,a.CoreBrowserService=class{constructor(c,u){this._textarea=c,this.window=u,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}},8934:function(l,a,c){var u=this&&this.__decorate||function(_,y,h,p){var f,g=arguments.length,b=g<3?y:p===null?p=Object.getOwnPropertyDescriptor(y,h):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(_,y,h,p);else for(var w=_.length-1;w>=0;w--)(f=_[w])&&(b=(g<3?f(b):g>3?f(y,h,b):f(y,h))||b);return g>3&&b&&Object.defineProperty(y,h,b),b},m=this&&this.__param||function(_,y){return function(h,p){y(h,p,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const d=c(4725),x=c(9806);let v=a.MouseService=class{constructor(_,y){this._renderService=_,this._charSizeService=y}getCoords(_,y,h,p,f){return(0,x.getCoords)(window,_,y,h,p,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(_,y){const h=(0,x.getCoordsRelativeToElement)(window,_,y);if(this._charSizeService.hasValidSize)return h[0]=Math.min(Math.max(h[0],0),this._renderService.dimensions.css.canvas.width-1),h[1]=Math.min(Math.max(h[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(h[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(h[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(h[0]),y:Math.floor(h[1])}}};a.MouseService=v=u([m(0,d.IRenderService),m(1,d.ICharSizeService)],v)},3230:function(l,a,c){var u=this&&this.__decorate||function(b,w,k,j){var S,E=arguments.length,N=E<3?w:j===null?j=Object.getOwnPropertyDescriptor(w,k):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(b,w,k,j);else for(var O=b.length-1;O>=0;O--)(S=b[O])&&(N=(E<3?S(N):E>3?S(w,k,N):S(w,k))||N);return E>3&&N&&Object.defineProperty(w,k,N),N},m=this&&this.__param||function(b,w){return function(k,j){w(k,j,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const d=c(3656),x=c(6193),v=c(5596),_=c(4725),y=c(8460),h=c(844),p=c(7226),f=c(2585);let g=a.RenderService=class extends h.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(b,w,k,j,S,E,N,O){if(super(),this._rowCount=b,this._charSizeService=j,this._renderer=this.register(new h.MutableDisposable),this._pausedResizeTask=new p.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new y.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new y.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new y.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new x.RenderDebouncer(N.window,(T,L)=>this._renderRows(T,L)),this.register(this._renderDebouncer),this._screenDprMonitor=new v.ScreenDprMonitor(N.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(E.onResize(()=>this._fullRefresh())),this.register(E.buffers.onBufferActivate(()=>{var T;return(T=this._renderer.value)===null||T===void 0?void 0:T.clear()})),this.register(k.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(S.onDecorationRegistered(()=>this._fullRefresh())),this.register(S.onDecorationRemoved(()=>this._fullRefresh())),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()})),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(E.buffer.y,E.buffer.y,!0))),this.register((0,d.addDisposableDomListener)(N.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(O.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in N.window){const T=new N.window.IntersectionObserver(L=>this._handleIntersectionChange(L[L.length-1]),{threshold:0});T.observe(w),this.register({dispose:()=>T.disconnect()})}}_handleIntersectionChange(b){this._isPaused=b.isIntersecting===void 0?b.intersectionRatio===0:!b.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(b,w,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(b,w,this._rowCount))}_renderRows(b,w){this._renderer.value&&(b=Math.min(b,this._rowCount-1),w=Math.min(w,this._rowCount-1),this._renderer.value.renderRows(b,w),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:b,end:w}),this._onRender.fire({start:b,end:w}),this._isNextRenderRedrawOnly=!0)}resize(b,w){this._rowCount=w,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(b){this._renderer.value=b,this._renderer.value.onRequestRedraw(w=>this.refreshRows(w.start,w.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(b){return this._renderDebouncer.addRefreshCallback(b)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var b,w;this._renderer.value&&((w=(b=this._renderer.value).clearTextureAtlas)===null||w===void 0||w.call(b),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(b,w){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(b,w)):this._renderer.value.handleResize(b,w),this._fullRefresh())}handleCharSizeChanged(){var b;(b=this._renderer.value)===null||b===void 0||b.handleCharSizeChanged()}handleBlur(){var b;(b=this._renderer.value)===null||b===void 0||b.handleBlur()}handleFocus(){var b;(b=this._renderer.value)===null||b===void 0||b.handleFocus()}handleSelectionChanged(b,w,k){var j;this._selectionState.start=b,this._selectionState.end=w,this._selectionState.columnSelectMode=k,(j=this._renderer.value)===null||j===void 0||j.handleSelectionChanged(b,w,k)}handleCursorMove(){var b;(b=this._renderer.value)===null||b===void 0||b.handleCursorMove()}clear(){var b;(b=this._renderer.value)===null||b===void 0||b.clear()}};a.RenderService=g=u([m(2,f.IOptionsService),m(3,_.ICharSizeService),m(4,f.IDecorationService),m(5,f.IBufferService),m(6,_.ICoreBrowserService),m(7,_.IThemeService)],g)},9312:function(l,a,c){var u=this&&this.__decorate||function(S,E,N,O){var T,L=arguments.length,$=L<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,N):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(S,E,N,O);else for(var U=S.length-1;U>=0;U--)(T=S[U])&&($=(L<3?T($):L>3?T(E,N,$):T(E,N))||$);return L>3&&$&&Object.defineProperty(E,N,$),$},m=this&&this.__param||function(S,E){return function(N,O){E(N,O,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const d=c(9806),x=c(9504),v=c(456),_=c(4725),y=c(8460),h=c(844),p=c(6114),f=c(4841),g=c(511),b=c(2585),w=" ",k=new RegExp(w,"g");let j=a.SelectionService=class extends h.Disposable{constructor(S,E,N,O,T,L,$,U,z){super(),this._element=S,this._screenElement=E,this._linkifier=N,this._bufferService=O,this._coreService=T,this._mouseService=L,this._optionsService=$,this._renderService=U,this._coreBrowserService=z,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new g.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new y.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new y.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new y.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=K=>this._handleMouseMove(K),this._mouseUpListener=K=>this._handleMouseUp(K),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(K=>this._handleTrim(K)),this.register(this._bufferService.buffers.onBufferActivate(K=>this._handleBufferActivate(K))),this.enable(),this._model=new v.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,h.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const S=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!S||!E||S[0]===E[0]&&S[1]===E[1])}get selectionText(){const S=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!S||!E)return"";const N=this._bufferService.buffer,O=[];if(this._activeSelectionMode===3){if(S[0]===E[0])return"";const T=S[0]<E[0]?S[0]:E[0],L=S[0]<E[0]?E[0]:S[0];for(let $=S[1];$<=E[1];$++){const U=N.translateBufferLineToString($,!0,T,L);O.push(U)}}else{const T=S[1]===E[1]?E[0]:void 0;O.push(N.translateBufferLineToString(S[1],!0,S[0],T));for(let L=S[1]+1;L<=E[1]-1;L++){const $=N.lines.get(L),U=N.translateBufferLineToString(L,!0);$!=null&&$.isWrapped?O[O.length-1]+=U:O.push(U)}if(S[1]!==E[1]){const L=N.lines.get(E[1]),$=N.translateBufferLineToString(E[1],!0,0,E[0]);L&&L.isWrapped?O[O.length-1]+=$:O.push($)}}return O.map(T=>T.replace(k," ")).join(p.isWindows?`\r
|
|
198
|
+
`:`
|
|
199
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(S){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),p.isLinux&&S&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(S){const E=this._getMouseBufferCoords(S),N=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!!(N&&O&&E)&&this._areCoordsInSelection(E,N,O)}isCellInSelection(S,E){const N=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!N||!O)&&this._areCoordsInSelection([S,E],N,O)}_areCoordsInSelection(S,E,N){return S[1]>E[1]&&S[1]<N[1]||E[1]===N[1]&&S[1]===E[1]&&S[0]>=E[0]&&S[0]<N[0]||E[1]<N[1]&&S[1]===N[1]&&S[0]<N[0]||E[1]<N[1]&&S[1]===E[1]&&S[0]>=E[0]}_selectWordAtCursor(S,E){var N,O;const T=(O=(N=this._linkifier.currentLink)===null||N===void 0?void 0:N.link)===null||O===void 0?void 0:O.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const L=this._getMouseBufferCoords(S);return!!L&&(this._selectWordAt(L,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(S,E){this._model.clearSelection(),S=Math.max(S,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,S],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(S){this._model.handleTrim(S)&&this.refresh()}_getMouseBufferCoords(S){const E=this._mouseService.getCoords(S,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(S){let E=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,S,this._screenElement)[1];const N=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=N?0:(E>N&&(E-=N),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(S){return p.isMac?S.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:S.shiftKey}handleMouseDown(S){if(this._mouseDownTimeStamp=S.timeStamp,(S.button!==2||!this.hasSelection)&&S.button===0){if(!this._enabled){if(!this.shouldForceSelection(S))return;S.stopPropagation()}S.preventDefault(),this._dragScrollAmount=0,this._enabled&&S.shiftKey?this._handleIncrementalClick(S):S.detail===1?this._handleSingleClick(S):S.detail===2?this._handleDoubleClick(S):S.detail===3&&this._handleTripleClick(S),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(S){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(S))}_handleSingleClick(S){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(S)?3:0,this._model.selectionStart=this._getMouseBufferCoords(S),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(S){this._selectWordAtCursor(S,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(S){const E=this._getMouseBufferCoords(S);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(S){return S.altKey&&!(p.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(S){if(S.stopImmediatePropagation(),!this._model.selectionStart)return;const E=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(S),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(S),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const N=this._bufferService.buffer;if(this._model.selectionEnd[1]<N.lines.length){const O=N.lines.get(this._model.selectionEnd[1]);O&&O.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}E&&E[0]===this._model.selectionEnd[0]&&E[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const S=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(S.ydisp+this._bufferService.rows,S.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=S.ydisp),this.refresh()}}_handleMouseUp(S){const E=S.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<500&&S.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const N=this._mouseService.getCoords(S,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(N&&N[0]!==void 0&&N[1]!==void 0){const O=(0,x.moveToCellSequence)(N[0]-1,N[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(O,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const S=this._model.finalSelectionStart,E=this._model.finalSelectionEnd,N=!(!S||!E||S[0]===E[0]&&S[1]===E[1]);N?S&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&S[0]===this._oldSelectionStart[0]&&S[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(S,E,N)):this._oldHasSelection&&this._fireOnSelectionChange(S,E,N)}_fireOnSelectionChange(S,E,N){this._oldSelectionStart=S,this._oldSelectionEnd=E,this._oldHasSelection=N,this._onSelectionChange.fire()}_handleBufferActivate(S){this.clearSelection(),this._trimListener.dispose(),this._trimListener=S.activeBuffer.lines.onTrim(E=>this._handleTrim(E))}_convertViewportColToCharacterIndex(S,E){let N=E;for(let O=0;E>=O;O++){const T=S.loadCell(O,this._workCell).getChars().length;this._workCell.getWidth()===0?N--:T>1&&E!==O&&(N+=T-1)}return N}setSelection(S,E,N){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[S,E],this._model.selectionStartLength=N,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(S){this._isClickInSelection(S)||(this._selectWordAtCursor(S,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(S,E,N=!0,O=!0){if(S[0]>=this._bufferService.cols)return;const T=this._bufferService.buffer,L=T.lines.get(S[1]);if(!L)return;const $=T.translateBufferLineToString(S[1],!1);let U=this._convertViewportColToCharacterIndex(L,S[0]),z=U;const K=S[0]-U;let R=0,P=0,D=0,M=0;if($.charAt(U)===" "){for(;U>0&&$.charAt(U-1)===" ";)U--;for(;z<$.length&&$.charAt(z+1)===" ";)z++}else{let J=S[0],X=S[0];L.getWidth(J)===0&&(R++,J--),L.getWidth(X)===2&&(P++,X++);const fe=L.getString(X).length;for(fe>1&&(M+=fe-1,z+=fe-1);J>0&&U>0&&!this._isCharWordSeparator(L.loadCell(J-1,this._workCell));){L.loadCell(J-1,this._workCell);const A=this._workCell.getChars().length;this._workCell.getWidth()===0?(R++,J--):A>1&&(D+=A-1,U-=A-1),U--,J--}for(;X<L.length&&z+1<$.length&&!this._isCharWordSeparator(L.loadCell(X+1,this._workCell));){L.loadCell(X+1,this._workCell);const A=this._workCell.getChars().length;this._workCell.getWidth()===2?(P++,X++):A>1&&(M+=A-1,z+=A-1),z++,X++}}z++;let V=U+K-R+D,W=Math.min(this._bufferService.cols,z-U+R+P-D-M);if(E||$.slice(U,z).trim()!==""){if(N&&V===0&&L.getCodePoint(0)!==32){const J=T.lines.get(S[1]-1);if(J&&L.isWrapped&&J.getCodePoint(this._bufferService.cols-1)!==32){const X=this._getWordAt([this._bufferService.cols-1,S[1]-1],!1,!0,!1);if(X){const fe=this._bufferService.cols-X.start;V-=fe,W+=fe}}}if(O&&V+W===this._bufferService.cols&&L.getCodePoint(this._bufferService.cols-1)!==32){const J=T.lines.get(S[1]+1);if(J!=null&&J.isWrapped&&J.getCodePoint(0)!==32){const X=this._getWordAt([0,S[1]+1],!1,!1,!0);X&&(W+=X.length)}}return{start:V,length:W}}}_selectWordAt(S,E){const N=this._getWordAt(S,E);if(N){for(;N.start<0;)N.start+=this._bufferService.cols,S[1]--;this._model.selectionStart=[N.start,S[1]],this._model.selectionStartLength=N.length}}_selectToWordAt(S){const E=this._getWordAt(S,!0);if(E){let N=S[1];for(;E.start<0;)E.start+=this._bufferService.cols,N--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,N++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,N]}}_isCharWordSeparator(S){return S.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(S.getChars())>=0}_selectLineAt(S){const E=this._bufferService.buffer.getWrappedRangeForLine(S),N={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(N,this._bufferService.cols)}};a.SelectionService=j=u([m(3,b.IBufferService),m(4,b.ICoreService),m(5,_.IMouseService),m(6,b.IOptionsService),m(7,_.IRenderService),m(8,_.ICoreBrowserService)],j)},4725:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const u=c(8343);a.ICharSizeService=(0,u.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),a.IMouseService=(0,u.createDecorator)("MouseService"),a.IRenderService=(0,u.createDecorator)("RenderService"),a.ISelectionService=(0,u.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,u.createDecorator)("ThemeService")},6731:function(l,a,c){var u=this&&this.__decorate||function(j,S,E,N){var O,T=arguments.length,L=T<3?S:N===null?N=Object.getOwnPropertyDescriptor(S,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(j,S,E,N);else for(var $=j.length-1;$>=0;$--)(O=j[$])&&(L=(T<3?O(L):T>3?O(S,E,L):O(S,E))||L);return T>3&&L&&Object.defineProperty(S,E,L),L},m=this&&this.__param||function(j,S){return function(E,N){S(E,N,j)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),x=c(8055),v=c(8460),_=c(844),y=c(2585),h=x.css.toColor("#ffffff"),p=x.css.toColor("#000000"),f=x.css.toColor("#ffffff"),g=x.css.toColor("#000000"),b={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const j=[x.css.toColor("#2e3436"),x.css.toColor("#cc0000"),x.css.toColor("#4e9a06"),x.css.toColor("#c4a000"),x.css.toColor("#3465a4"),x.css.toColor("#75507b"),x.css.toColor("#06989a"),x.css.toColor("#d3d7cf"),x.css.toColor("#555753"),x.css.toColor("#ef2929"),x.css.toColor("#8ae234"),x.css.toColor("#fce94f"),x.css.toColor("#729fcf"),x.css.toColor("#ad7fa8"),x.css.toColor("#34e2e2"),x.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let E=0;E<216;E++){const N=S[E/36%6|0],O=S[E/6%6|0],T=S[E%6];j.push({css:x.channels.toCss(N,O,T),rgba:x.channels.toRgba(N,O,T)})}for(let E=0;E<24;E++){const N=8+10*E;j.push({css:x.channels.toCss(N,N,N),rgba:x.channels.toRgba(N,N,N)})}return j})());let w=a.ThemeService=class extends _.Disposable{get colors(){return this._colors}constructor(j){super(),this._optionsService=j,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new v.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:h,background:p,cursor:f,cursorAccent:g,selectionForeground:void 0,selectionBackgroundTransparent:b,selectionBackgroundOpaque:x.color.blend(p,b),selectionInactiveBackgroundTransparent:b,selectionInactiveBackgroundOpaque:x.color.blend(p,b),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(j={}){const S=this._colors;if(S.foreground=k(j.foreground,h),S.background=k(j.background,p),S.cursor=k(j.cursor,f),S.cursorAccent=k(j.cursorAccent,g),S.selectionBackgroundTransparent=k(j.selectionBackground,b),S.selectionBackgroundOpaque=x.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=k(j.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=x.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=j.selectionForeground?k(j.selectionForeground,x.NULL_COLOR):void 0,S.selectionForeground===x.NULL_COLOR&&(S.selectionForeground=void 0),x.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=x.color.opacity(S.selectionBackgroundTransparent,.3)),x.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=x.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=a.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=k(j.black,a.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=k(j.red,a.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=k(j.green,a.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=k(j.yellow,a.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=k(j.blue,a.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=k(j.magenta,a.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=k(j.cyan,a.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=k(j.white,a.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=k(j.brightBlack,a.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=k(j.brightRed,a.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=k(j.brightGreen,a.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=k(j.brightYellow,a.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=k(j.brightBlue,a.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=k(j.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=k(j.brightCyan,a.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=k(j.brightWhite,a.DEFAULT_ANSI_COLORS[15]),j.extendedAnsi){const E=Math.min(S.ansi.length-16,j.extendedAnsi.length);for(let N=0;N<E;N++)S.ansi[N+16]=k(j.extendedAnsi[N],a.DEFAULT_ANSI_COLORS[N+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(j){this._restoreColor(j),this._onChangeColors.fire(this.colors)}_restoreColor(j){if(j!==void 0)switch(j){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[j]=this._restoreColors.ansi[j]}else for(let S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}modifyColors(j){j(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function k(j,S){if(j!==void 0)try{return x.css.toColor(j)}catch{}return S}a.ThemeService=w=u([m(0,y.IOptionsService)],w)},6349:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const u=c(8460),m=c(844);class d extends m.Disposable{constructor(v){super(),this._maxLength=v,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(v){if(this._maxLength===v)return;const _=new Array(v);for(let y=0;y<Math.min(v,this.length);y++)_[y]=this._array[this._getCyclicIndex(y)];this._array=_,this._maxLength=v,this._startIndex=0}get length(){return this._length}set length(v){if(v>this._length)for(let _=this._length;_<v;_++)this._array[_]=void 0;this._length=v}get(v){return this._array[this._getCyclicIndex(v)]}set(v,_){this._array[this._getCyclicIndex(v)]=_}push(v){this._array[this._getCyclicIndex(this._length)]=v,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(v,_,...y){if(_){for(let h=v;h<this._length-_;h++)this._array[this._getCyclicIndex(h)]=this._array[this._getCyclicIndex(h+_)];this._length-=_,this.onDeleteEmitter.fire({index:v,amount:_})}for(let h=this._length-1;h>=v;h--)this._array[this._getCyclicIndex(h+y.length)]=this._array[this._getCyclicIndex(h)];for(let h=0;h<y.length;h++)this._array[this._getCyclicIndex(v+h)]=y[h];if(y.length&&this.onInsertEmitter.fire({index:v,amount:y.length}),this._length+y.length>this._maxLength){const h=this._length+y.length-this._maxLength;this._startIndex+=h,this._length=this._maxLength,this.onTrimEmitter.fire(h)}else this._length+=y.length}trimStart(v){v>this._length&&(v=this._length),this._startIndex+=v,this._length-=v,this.onTrimEmitter.fire(v)}shiftElements(v,_,y){if(!(_<=0)){if(v<0||v>=this._length)throw new Error("start argument out of range");if(v+y<0)throw new Error("Cannot shift elements in list beyond index 0");if(y>0){for(let p=_-1;p>=0;p--)this.set(v+p+y,this.get(v+p));const h=v+_+y-this._length;if(h>0)for(this._length+=h;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let h=0;h<_;h++)this.set(v+h+y,this.get(v+h))}}_getCyclicIndex(v){return(this._startIndex+v)%this._maxLength}}a.CircularList=d},1439:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(u,m=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const x in u)d[x]=m<=1?u[x]:u[x]&&c(u[x],m-1);return d}},8055:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;const u=c(6114);let m=0,d=0,x=0,v=0;var _,y,h,p,f;function g(w){const k=w.toString(16);return k.length<2?"0"+k:k}function b(w,k){return w<k?(k+.05)/(w+.05):(w+.05)/(k+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},function(w){w.toCss=function(k,j,S,E){return E!==void 0?`#${g(k)}${g(j)}${g(S)}${g(E)}`:`#${g(k)}${g(j)}${g(S)}`},w.toRgba=function(k,j,S,E=255){return(k<<24|j<<16|S<<8|E)>>>0}}(_||(a.channels=_={})),function(w){function k(j,S){return v=Math.round(255*S),[m,d,x]=f.toChannels(j.rgba),{css:_.toCss(m,d,x,v),rgba:_.toRgba(m,d,x,v)}}w.blend=function(j,S){if(v=(255&S.rgba)/255,v===1)return{css:S.css,rgba:S.rgba};const E=S.rgba>>24&255,N=S.rgba>>16&255,O=S.rgba>>8&255,T=j.rgba>>24&255,L=j.rgba>>16&255,$=j.rgba>>8&255;return m=T+Math.round((E-T)*v),d=L+Math.round((N-L)*v),x=$+Math.round((O-$)*v),{css:_.toCss(m,d,x),rgba:_.toRgba(m,d,x)}},w.isOpaque=function(j){return(255&j.rgba)==255},w.ensureContrastRatio=function(j,S,E){const N=f.ensureContrastRatio(j.rgba,S.rgba,E);if(N)return f.toColor(N>>24&255,N>>16&255,N>>8&255)},w.opaque=function(j){const S=(255|j.rgba)>>>0;return[m,d,x]=f.toChannels(S),{css:_.toCss(m,d,x),rgba:S}},w.opacity=k,w.multiplyOpacity=function(j,S){return v=255&j.rgba,k(j,v*S/255)},w.toColorRGB=function(j){return[j.rgba>>24&255,j.rgba>>16&255,j.rgba>>8&255]}}(y||(a.color=y={})),function(w){let k,j;if(!u.isNode){const S=document.createElement("canvas");S.width=1,S.height=1;const E=S.getContext("2d",{willReadFrequently:!0});E&&(k=E,k.globalCompositeOperation="copy",j=k.createLinearGradient(0,0,1,1))}w.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return m=parseInt(S.slice(1,2).repeat(2),16),d=parseInt(S.slice(2,3).repeat(2),16),x=parseInt(S.slice(3,4).repeat(2),16),f.toColor(m,d,x);case 5:return m=parseInt(S.slice(1,2).repeat(2),16),d=parseInt(S.slice(2,3).repeat(2),16),x=parseInt(S.slice(3,4).repeat(2),16),v=parseInt(S.slice(4,5).repeat(2),16),f.toColor(m,d,x,v);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const E=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return m=parseInt(E[1]),d=parseInt(E[2]),x=parseInt(E[3]),v=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),f.toColor(m,d,x,v);if(!k||!j)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=j,k.fillStyle=S,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[m,d,x,v]=k.getImageData(0,0,1,1).data,v!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(m,d,x,v),css:S}}}(h||(a.css=h={})),function(w){function k(j,S,E){const N=j/255,O=S/255,T=E/255;return .2126*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.7152*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}w.relativeLuminance=function(j){return k(j>>16&255,j>>8&255,255&j)},w.relativeLuminance2=k}(p||(a.rgb=p={})),function(w){function k(S,E,N){const O=S>>24&255,T=S>>16&255,L=S>>8&255;let $=E>>24&255,U=E>>16&255,z=E>>8&255,K=b(p.relativeLuminance2($,U,z),p.relativeLuminance2(O,T,L));for(;K<N&&($>0||U>0||z>0);)$-=Math.max(0,Math.ceil(.1*$)),U-=Math.max(0,Math.ceil(.1*U)),z-=Math.max(0,Math.ceil(.1*z)),K=b(p.relativeLuminance2($,U,z),p.relativeLuminance2(O,T,L));return($<<24|U<<16|z<<8|255)>>>0}function j(S,E,N){const O=S>>24&255,T=S>>16&255,L=S>>8&255;let $=E>>24&255,U=E>>16&255,z=E>>8&255,K=b(p.relativeLuminance2($,U,z),p.relativeLuminance2(O,T,L));for(;K<N&&($<255||U<255||z<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),U=Math.min(255,U+Math.ceil(.1*(255-U))),z=Math.min(255,z+Math.ceil(.1*(255-z))),K=b(p.relativeLuminance2($,U,z),p.relativeLuminance2(O,T,L));return($<<24|U<<16|z<<8|255)>>>0}w.ensureContrastRatio=function(S,E,N){const O=p.relativeLuminance(S>>8),T=p.relativeLuminance(E>>8);if(b(O,T)<N){if(T<O){const U=k(S,E,N),z=b(O,p.relativeLuminance(U>>8));if(z<N){const K=j(S,E,N);return z>b(O,p.relativeLuminance(K>>8))?U:K}return U}const L=j(S,E,N),$=b(O,p.relativeLuminance(L>>8));if($<N){const U=k(S,E,N);return $>b(O,p.relativeLuminance(U>>8))?L:U}return L}},w.reduceLuminance=k,w.increaseLuminance=j,w.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]},w.toColor=function(S,E,N,O){return{css:_.toCss(S,E,N,O),rgba:_.toRgba(S,E,N,O)}}}(f||(a.rgba=f={})),a.toPaddedHex=g,a.contrastRatio=b},8969:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const u=c(844),m=c(2585),d=c(4348),x=c(7866),v=c(744),_=c(7302),y=c(6975),h=c(8460),p=c(1753),f=c(1480),g=c(7994),b=c(9282),w=c(5435),k=c(5981),j=c(2660);let S=!1;class E extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new h.EventEmitter),this._onScroll.event(O=>{var T;(T=this._onScrollApi)===null||T===void 0||T.fire(O.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(O){for(const T in O)this.optionsService.options[T]=O[T]}constructor(O){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new h.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new h.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new h.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new _.OptionsService(O)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(v.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(x.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(y.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(p.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(g.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(j.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new w.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,h.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,h.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,h.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,h.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(T=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(T=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new k.WriteBuffer((T,L)=>this._inputHandler.parse(T,L))),this.register((0,h.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(O,T){this._writeBuffer.write(O,T)}writeSync(O,T){this._logService.logLevel<=m.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(O,T)}resize(O,T){isNaN(O)||isNaN(T)||(O=Math.max(O,v.MINIMUM_COLS),T=Math.max(T,v.MINIMUM_ROWS),this._bufferService.resize(O,T))}scroll(O,T=!1){this._bufferService.scroll(O,T)}scrollLines(O,T,L){this._bufferService.scrollLines(O,T,L)}scrollPages(O){this.scrollLines(O*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(O){const T=O-this._bufferService.buffer.ydisp;T!==0&&this.scrollLines(T)}registerEscHandler(O,T){return this._inputHandler.registerEscHandler(O,T)}registerDcsHandler(O,T){return this._inputHandler.registerDcsHandler(O,T)}registerCsiHandler(O,T){return this._inputHandler.registerCsiHandler(O,T)}registerOscHandler(O,T){return this._inputHandler.registerOscHandler(O,T)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let O=!1;const T=this.optionsService.rawOptions.windowsPty;T&&T.buildNumber!==void 0&&T.buildNumber!==void 0?O=T.backend==="conpty"&&T.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(O=!0),O?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const O=[];O.push(this.onLineFeed(b.updateWindowsModeWrappedState.bind(null,this._bufferService))),O.push(this.registerCsiHandler({final:"H"},()=>((0,b.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)(()=>{for(const T of O)T.dispose()})}}}a.CoreTerminal=E},8460:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===c)return void this._listeners.splice(u,1)}}})),this._event}fire(c,u){const m=[];for(let d=0;d<this._listeners.length;d++)m.push(this._listeners[d]);for(let d=0;d<m.length;d++)m[d].call(void 0,c,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,u){return c(m=>u.fire(m))}},5435:function(l,a,c){var u=this&&this.__decorate||function(K,R,P,D){var M,V=arguments.length,W=V<3?R:D===null?D=Object.getOwnPropertyDescriptor(R,P):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(K,R,P,D);else for(var J=K.length-1;J>=0;J--)(M=K[J])&&(W=(V<3?M(W):V>3?M(R,P,W):M(R,P))||W);return V>3&&W&&Object.defineProperty(R,P,W),W},m=this&&this.__param||function(K,R){return function(P,D){R(P,D,K)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const d=c(2584),x=c(7116),v=c(2015),_=c(844),y=c(482),h=c(8437),p=c(8460),f=c(643),g=c(511),b=c(3734),w=c(2585),k=c(6242),j=c(6351),S=c(5941),E={"(":0,")":1,"*":2,"+":3,"-":1,".":2},N=131072;function O(K,R){if(K>24)return R.setWinLines||!1;switch(K){case 1:return!!R.restoreWin;case 2:return!!R.minimizeWin;case 3:return!!R.setWinPosition;case 4:return!!R.setWinSizePixels;case 5:return!!R.raiseWin;case 6:return!!R.lowerWin;case 7:return!!R.refreshWin;case 8:return!!R.setWinSizeChars;case 9:return!!R.maximizeWin;case 10:return!!R.fullscreenWin;case 11:return!!R.getWinState;case 13:return!!R.getWinPosition;case 14:return!!R.getWinSizePixels;case 15:return!!R.getScreenSizePixels;case 16:return!!R.getCellSizePixels;case 18:return!!R.getWinSizeChars;case 19:return!!R.getScreenSizeChars;case 20:return!!R.getIconTitle;case 21:return!!R.getWinTitle;case 22:return!!R.pushTitle;case 23:return!!R.popTitle;case 24:return!!R.setWinLines}return!1}var T;(function(K){K[K.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",K[K.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(a.WindowsOptionsReportType=T={}));let L=0;class $ extends _.Disposable{getAttrData(){return this._curAttrData}constructor(R,P,D,M,V,W,J,X,fe=new v.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=P,this._coreService=D,this._logService=M,this._optionsService=V,this._oscLinkService=W,this._coreMouseService=J,this._unicodeService=X,this._parser=fe,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new y.StringToUtf32,this._utf8Decoder=new y.Utf8ToUtf32,this._workCell=new g.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new p.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new p.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new p.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new p.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new p.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new p.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new p.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new p.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new p.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new p.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new p.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new U(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(A=>this._activeBuffer=A.activeBuffer)),this._parser.setCsiHandlerFallback((A,B)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(A),params:B.toArray()})}),this._parser.setEscHandlerFallback(A=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(A)})}),this._parser.setExecuteHandlerFallback(A=>{this._logService.debug("Unknown EXECUTE code: ",{code:A})}),this._parser.setOscHandlerFallback((A,B,G)=>{this._logService.debug("Unknown OSC code: ",{identifier:A,action:B,data:G})}),this._parser.setDcsHandlerFallback((A,B,G)=>{B==="HOOK"&&(G=G.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(A),action:B,payload:G})}),this._parser.setPrintHandler((A,B,G)=>this.print(A,B,G)),this._parser.registerCsiHandler({final:"@"},A=>this.insertChars(A)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},A=>this.scrollLeft(A)),this._parser.registerCsiHandler({final:"A"},A=>this.cursorUp(A)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},A=>this.scrollRight(A)),this._parser.registerCsiHandler({final:"B"},A=>this.cursorDown(A)),this._parser.registerCsiHandler({final:"C"},A=>this.cursorForward(A)),this._parser.registerCsiHandler({final:"D"},A=>this.cursorBackward(A)),this._parser.registerCsiHandler({final:"E"},A=>this.cursorNextLine(A)),this._parser.registerCsiHandler({final:"F"},A=>this.cursorPrecedingLine(A)),this._parser.registerCsiHandler({final:"G"},A=>this.cursorCharAbsolute(A)),this._parser.registerCsiHandler({final:"H"},A=>this.cursorPosition(A)),this._parser.registerCsiHandler({final:"I"},A=>this.cursorForwardTab(A)),this._parser.registerCsiHandler({final:"J"},A=>this.eraseInDisplay(A,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},A=>this.eraseInDisplay(A,!0)),this._parser.registerCsiHandler({final:"K"},A=>this.eraseInLine(A,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},A=>this.eraseInLine(A,!0)),this._parser.registerCsiHandler({final:"L"},A=>this.insertLines(A)),this._parser.registerCsiHandler({final:"M"},A=>this.deleteLines(A)),this._parser.registerCsiHandler({final:"P"},A=>this.deleteChars(A)),this._parser.registerCsiHandler({final:"S"},A=>this.scrollUp(A)),this._parser.registerCsiHandler({final:"T"},A=>this.scrollDown(A)),this._parser.registerCsiHandler({final:"X"},A=>this.eraseChars(A)),this._parser.registerCsiHandler({final:"Z"},A=>this.cursorBackwardTab(A)),this._parser.registerCsiHandler({final:"`"},A=>this.charPosAbsolute(A)),this._parser.registerCsiHandler({final:"a"},A=>this.hPositionRelative(A)),this._parser.registerCsiHandler({final:"b"},A=>this.repeatPrecedingCharacter(A)),this._parser.registerCsiHandler({final:"c"},A=>this.sendDeviceAttributesPrimary(A)),this._parser.registerCsiHandler({prefix:">",final:"c"},A=>this.sendDeviceAttributesSecondary(A)),this._parser.registerCsiHandler({final:"d"},A=>this.linePosAbsolute(A)),this._parser.registerCsiHandler({final:"e"},A=>this.vPositionRelative(A)),this._parser.registerCsiHandler({final:"f"},A=>this.hVPosition(A)),this._parser.registerCsiHandler({final:"g"},A=>this.tabClear(A)),this._parser.registerCsiHandler({final:"h"},A=>this.setMode(A)),this._parser.registerCsiHandler({prefix:"?",final:"h"},A=>this.setModePrivate(A)),this._parser.registerCsiHandler({final:"l"},A=>this.resetMode(A)),this._parser.registerCsiHandler({prefix:"?",final:"l"},A=>this.resetModePrivate(A)),this._parser.registerCsiHandler({final:"m"},A=>this.charAttributes(A)),this._parser.registerCsiHandler({final:"n"},A=>this.deviceStatus(A)),this._parser.registerCsiHandler({prefix:"?",final:"n"},A=>this.deviceStatusPrivate(A)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},A=>this.softReset(A)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},A=>this.setCursorStyle(A)),this._parser.registerCsiHandler({final:"r"},A=>this.setScrollRegion(A)),this._parser.registerCsiHandler({final:"s"},A=>this.saveCursor(A)),this._parser.registerCsiHandler({final:"t"},A=>this.windowOptions(A)),this._parser.registerCsiHandler({final:"u"},A=>this.restoreCursor(A)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},A=>this.insertColumns(A)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},A=>this.deleteColumns(A)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},A=>this.selectProtected(A)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},A=>this.requestMode(A,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},A=>this.requestMode(A,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new k.OscHandler(A=>(this.setTitle(A),this.setIconName(A),!0))),this._parser.registerOscHandler(1,new k.OscHandler(A=>this.setIconName(A))),this._parser.registerOscHandler(2,new k.OscHandler(A=>this.setTitle(A))),this._parser.registerOscHandler(4,new k.OscHandler(A=>this.setOrReportIndexedColor(A))),this._parser.registerOscHandler(8,new k.OscHandler(A=>this.setHyperlink(A))),this._parser.registerOscHandler(10,new k.OscHandler(A=>this.setOrReportFgColor(A))),this._parser.registerOscHandler(11,new k.OscHandler(A=>this.setOrReportBgColor(A))),this._parser.registerOscHandler(12,new k.OscHandler(A=>this.setOrReportCursorColor(A))),this._parser.registerOscHandler(104,new k.OscHandler(A=>this.restoreIndexedColor(A))),this._parser.registerOscHandler(110,new k.OscHandler(A=>this.restoreFgColor(A))),this._parser.registerOscHandler(111,new k.OscHandler(A=>this.restoreBgColor(A))),this._parser.registerOscHandler(112,new k.OscHandler(A=>this.restoreCursorColor(A))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const A in x.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:A},()=>this.selectCharset("("+A)),this._parser.registerEscHandler({intermediates:")",final:A},()=>this.selectCharset(")"+A)),this._parser.registerEscHandler({intermediates:"*",final:A},()=>this.selectCharset("*"+A)),this._parser.registerEscHandler({intermediates:"+",final:A},()=>this.selectCharset("+"+A)),this._parser.registerEscHandler({intermediates:"-",final:A},()=>this.selectCharset("-"+A)),this._parser.registerEscHandler({intermediates:".",final:A},()=>this.selectCharset("."+A)),this._parser.registerEscHandler({intermediates:"/",final:A},()=>this.selectCharset("/"+A));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(A=>(this._logService.error("Parsing error: ",A),A)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new j.DcsHandler((A,B)=>this.requestStatusString(A,B)))}_preserveStack(R,P,D,M){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=P,this._parseStack.decodedLength=D,this._parseStack.position=M}_logSlowResolvingAsync(R){this._logService.logLevel<=w.LogLevelEnum.WARN&&Promise.race([R,new Promise((P,D)=>setTimeout(()=>D("#SLOW_TIMEOUT"),5e3))]).catch(P=>{if(P!=="#SLOW_TIMEOUT")throw P;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(R,P){let D,M=this._activeBuffer.x,V=this._activeBuffer.y,W=0;const J=this._parseStack.paused;if(J){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,P))return this._logSlowResolvingAsync(D),D;M=this._parseStack.cursorStartX,V=this._parseStack.cursorStartY,this._parseStack.paused=!1,R.length>N&&(W=this._parseStack.position+N)}if(this._logService.logLevel<=w.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof R=="string"?` "${R}"`:` "${Array.prototype.map.call(R,X=>String.fromCharCode(X)).join("")}"`),typeof R=="string"?R.split("").map(X=>X.charCodeAt(0)):R),this._parseBuffer.length<R.length&&this._parseBuffer.length<N&&(this._parseBuffer=new Uint32Array(Math.min(R.length,N))),J||this._dirtyRowTracker.clearRange(),R.length>N)for(let X=W;X<R.length;X+=N){const fe=X+N<R.length?X+N:R.length,A=typeof R=="string"?this._stringDecoder.decode(R.substring(X,fe),this._parseBuffer):this._utf8Decoder.decode(R.subarray(X,fe),this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,A))return this._preserveStack(M,V,A,X),this._logSlowResolvingAsync(D),D}else if(!J){const X=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,X))return this._preserveStack(M,V,X,0),this._logSlowResolvingAsync(D),D}this._activeBuffer.x===M&&this._activeBuffer.y===V||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(R,P,D){let M,V;const W=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,X=this._bufferService.cols,fe=this._coreService.decPrivateModes.wraparound,A=this._coreService.modes.insertMode,B=this._curAttrData;let G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&D-P>0&&G.getWidth(this._activeBuffer.x-1)===2&&G.setCellFromCodePoint(this._activeBuffer.x-1,0,1,B.fg,B.bg,B.extended);for(let Y=P;Y<D;++Y){if(M=R[Y],V=this._unicodeService.wcwidth(M),M<127&&W){const ce=W[String.fromCharCode(M)];ce&&(M=ce.charCodeAt(0))}if(J&&this._onA11yChar.fire((0,y.stringFromCodePoint)(M)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),V||!this._activeBuffer.x){if(this._activeBuffer.x+V-1>=X){if(fe){for(;this._activeBuffer.x<X;)G.setCellFromCodePoint(this._activeBuffer.x++,0,1,B.fg,B.bg,B.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=X-1,V===2)continue}if(A&&(G.insertCells(this._activeBuffer.x,V,this._activeBuffer.getNullCell(B),B),G.getWidth(X-1)===2&&G.setCellFromCodePoint(X-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,B.fg,B.bg,B.extended)),G.setCellFromCodePoint(this._activeBuffer.x++,M,V,B.fg,B.bg,B.extended),V>0)for(;--V;)G.setCellFromCodePoint(this._activeBuffer.x++,0,0,B.fg,B.bg,B.extended)}else G.getWidth(this._activeBuffer.x-1)?G.addCodepointToCell(this._activeBuffer.x-1,M):G.addCodepointToCell(this._activeBuffer.x-2,M)}D-P>0&&(G.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<X&&D-P>0&&G.getWidth(this._activeBuffer.x)===0&&!G.hasContent(this._activeBuffer.x)&&G.setCellFromCodePoint(this._activeBuffer.x,0,1,B.fg,B.bg,B.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(R,P){return R.final!=="t"||R.prefix||R.intermediates?this._parser.registerCsiHandler(R,P):this._parser.registerCsiHandler(R,D=>!O(D.params[0],this._optionsService.rawOptions.windowOptions)||P(D))}registerDcsHandler(R,P){return this._parser.registerDcsHandler(R,new j.DcsHandler(P))}registerEscHandler(R,P){return this._parser.registerEscHandler(R,P)}registerOscHandler(R,P){return this._parser.registerOscHandler(R,new k.OscHandler(P))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var R;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(!((R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||R===void 0)&&R.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);P.hasWidth(this._activeBuffer.x)&&!P.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const R=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-R),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(R=this._bufferService.cols-1){this._activeBuffer.x=Math.min(R,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(R,P){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=R,this._activeBuffer.y=this._activeBuffer.scrollTop+P):(this._activeBuffer.x=R,this._activeBuffer.y=P),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(R,P){this._restrictCursor(),this._setCursor(this._activeBuffer.x+R,this._activeBuffer.y+P)}cursorUp(R){const P=this._activeBuffer.y-this._activeBuffer.scrollTop;return P>=0?this._moveCursor(0,-Math.min(P,R.params[0]||1)):this._moveCursor(0,-(R.params[0]||1)),!0}cursorDown(R){const P=this._activeBuffer.scrollBottom-this._activeBuffer.y;return P>=0?this._moveCursor(0,Math.min(P,R.params[0]||1)):this._moveCursor(0,R.params[0]||1),!0}cursorForward(R){return this._moveCursor(R.params[0]||1,0),!0}cursorBackward(R){return this._moveCursor(-(R.params[0]||1),0),!0}cursorNextLine(R){return this.cursorDown(R),this._activeBuffer.x=0,!0}cursorPrecedingLine(R){return this.cursorUp(R),this._activeBuffer.x=0,!0}cursorCharAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(R){return this._setCursor(R.length>=2?(R.params[1]||1)-1:0,(R.params[0]||1)-1),!0}charPosAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(R){return this._moveCursor(R.params[0]||1,0),!0}linePosAbsolute(R){return this._setCursor(this._activeBuffer.x,(R.params[0]||1)-1),!0}vPositionRelative(R){return this._moveCursor(0,R.params[0]||1),!0}hVPosition(R){return this.cursorPosition(R),!0}tabClear(R){const P=R.params[0];return P===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:P===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=R.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=R.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(R){const P=R.params[0];return P===1&&(this._curAttrData.bg|=536870912),P!==2&&P!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(R,P,D,M=!1,V=!1){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);W.replaceCells(P,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),V),M&&(W.isWrapped=!1)}_resetBufferLine(R,P=!1){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);D&&(D.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),P),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+R),D.isWrapped=!1)}eraseInDisplay(R,P=!1){let D;switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);D<this._bufferService.rows;D++)this._resetBufferLine(D,P);this._dirtyRowTracker.markDirty(D);break;case 1:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D,0,this._activeBuffer.x+1,!0,P),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(D+1).isWrapped=!1);D--;)this._resetBufferLine(D,P);this._dirtyRowTracker.markDirty(0);break;case 2:for(D=this._bufferService.rows,this._dirtyRowTracker.markDirty(D-1);D--;)this._resetBufferLine(D,P);this._dirtyRowTracker.markDirty(0);break;case 3:const M=this._activeBuffer.lines.length-this._bufferService.rows;M>0&&(this._activeBuffer.lines.trimStart(M),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-M,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-M,0),this._onScroll.fire(0))}return!0}eraseInLine(R,P=!1){switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,P);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,P)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(R){this._restrictCursor();let P=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y,M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,V=this._bufferService.rows-1+this._activeBuffer.ybase-M+1;for(;P--;)this._activeBuffer.lines.splice(V-1,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(R){this._restrictCursor();let P=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y;let M;for(M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,M=this._bufferService.rows-1+this._activeBuffer.ybase-M;P--;)this._activeBuffer.lines.splice(D,1),this._activeBuffer.lines.splice(M,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(R){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.insertCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(R){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.deleteCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(R){let P=R.params[0]||1;for(;P--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(R){let P=R.params[0]||1;for(;P--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(h.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.deleteCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.insertCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.insertCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M.deleteCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(R){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(R.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(R){if(!this._parser.precedingCodepoint)return!0;const P=R.params[0]||1,D=new Uint32Array(P);for(let M=0;M<P;++M)D[M]=this._parser.precedingCodepoint;return this.print(D,0,D.length),!0}sendDeviceAttributesPrimary(R){return R.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(R){return R.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(R.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(R){return(this._optionsService.rawOptions.termName+"").indexOf(R)===0}setMode(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,x.DEFAULT_CHARSET),this._charsetService.setgCharset(1,x.DEFAULT_CHARSET),this._charsetService.setgCharset(2,x.DEFAULT_CHARSET),this._charsetService.setgCharset(3,x.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),R.params[P]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(R,P){const D=this._coreService.decPrivateModes,{activeProtocol:M,activeEncoding:V}=this._coreMouseService,W=this._coreService,{buffers:J,cols:X}=this._bufferService,{active:fe,alt:A}=J,B=this._optionsService.rawOptions,G=ge=>ge?1:2,Y=R.params[0];return ce=Y,Q=P?Y===2?4:Y===4?G(W.modes.insertMode):Y===12?3:Y===20?G(B.convertEol):0:Y===1?G(D.applicationCursorKeys):Y===3?B.windowOptions.setWinLines?X===80?2:X===132?1:0:0:Y===6?G(D.origin):Y===7?G(D.wraparound):Y===8?3:Y===9?G(M==="X10"):Y===12?G(B.cursorBlink):Y===25?G(!W.isCursorHidden):Y===45?G(D.reverseWraparound):Y===66?G(D.applicationKeypad):Y===67?4:Y===1e3?G(M==="VT200"):Y===1002?G(M==="DRAG"):Y===1003?G(M==="ANY"):Y===1004?G(D.sendFocus):Y===1005?4:Y===1006?G(V==="SGR"):Y===1015?4:Y===1016?G(V==="SGR_PIXELS"):Y===1048?1:Y===47||Y===1047||Y===1049?G(fe===A):Y===2004?G(D.bracketedPasteMode):0,W.triggerDataEvent(`${d.C0.ESC}[${P?"":"?"}${ce};${Q}$y`),!0;var ce,Q}_updateAttrColor(R,P,D,M,V){return P===2?(R|=50331648,R&=-16777216,R|=b.AttributeData.fromColorRGB([D,M,V])):P===5&&(R&=-50331904,R|=33554432|255&D),R}_extractColor(R,P,D){const M=[0,0,-1,0,0,0];let V=0,W=0;do{if(M[W+V]=R.params[P+W],R.hasSubParams(P+W)){const J=R.getSubParams(P+W);let X=0;do M[1]===5&&(V=1),M[W+X+1+V]=J[X];while(++X<J.length&&X+W+1+V<M.length);break}if(M[1]===5&&W+V>=2||M[1]===2&&W+V>=5)break;M[1]&&(V=1)}while(++W+P<R.length&&W+V<M.length);for(let J=2;J<M.length;++J)M[J]===-1&&(M[J]=0);switch(M[0]){case 38:D.fg=this._updateAttrColor(D.fg,M[1],M[3],M[4],M[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,M[1],M[3],M[4],M[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,M[1],M[3],M[4],M[5])}return W}_processUnderline(R,P){P.extended=P.extended.clone(),(!~R||R>5)&&(R=1),P.extended.underlineStyle=R,P.fg|=268435456,R===0&&(P.fg&=-268435457),P.updateExtended()}_processSGR0(R){R.fg=h.DEFAULT_ATTR_DATA.fg,R.bg=h.DEFAULT_ATTR_DATA.bg,R.extended=R.extended.clone(),R.extended.underlineStyle=0,R.extended.underlineColor&=-67108864,R.updateExtended()}charAttributes(R){if(R.length===1&&R.params[0]===0)return this._processSGR0(this._curAttrData),!0;const P=R.length;let D;const M=this._curAttrData;for(let V=0;V<P;V++)D=R.params[V],D>=30&&D<=37?(M.fg&=-50331904,M.fg|=16777216|D-30):D>=40&&D<=47?(M.bg&=-50331904,M.bg|=16777216|D-40):D>=90&&D<=97?(M.fg&=-50331904,M.fg|=16777224|D-90):D>=100&&D<=107?(M.bg&=-50331904,M.bg|=16777224|D-100):D===0?this._processSGR0(M):D===1?M.fg|=134217728:D===3?M.bg|=67108864:D===4?(M.fg|=268435456,this._processUnderline(R.hasSubParams(V)?R.getSubParams(V)[0]:1,M)):D===5?M.fg|=536870912:D===7?M.fg|=67108864:D===8?M.fg|=1073741824:D===9?M.fg|=2147483648:D===2?M.bg|=134217728:D===21?this._processUnderline(2,M):D===22?(M.fg&=-134217729,M.bg&=-134217729):D===23?M.bg&=-67108865:D===24?(M.fg&=-268435457,this._processUnderline(0,M)):D===25?M.fg&=-536870913:D===27?M.fg&=-67108865:D===28?M.fg&=-1073741825:D===29?M.fg&=2147483647:D===39?(M.fg&=-67108864,M.fg|=16777215&h.DEFAULT_ATTR_DATA.fg):D===49?(M.bg&=-67108864,M.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?V+=this._extractColor(R,V,M):D===53?M.bg|=1073741824:D===55?M.bg&=-1073741825:D===59?(M.extended=M.extended.clone(),M.extended.underlineColor=-1,M.updateExtended()):D===100?(M.fg&=-67108864,M.fg|=16777215&h.DEFAULT_ATTR_DATA.fg,M.bg&=-67108864,M.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",D);return!0}deviceStatus(R){switch(R.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const P=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${P};${D}R`)}return!0}deviceStatusPrivate(R){if(R.params[0]===6){const P=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${P};${D}R`)}return!0}softReset(R){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(R){const P=R.params[0]||1;switch(P){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const D=P%2==1;return this._optionsService.options.cursorBlink=D,!0}setScrollRegion(R){const P=R.params[0]||1;let D;return(R.length<2||(D=R.params[1])>this._bufferService.rows||D===0)&&(D=this._bufferService.rows),D>P&&(this._activeBuffer.scrollTop=P-1,this._activeBuffer.scrollBottom=D-1,this._setCursor(0,0)),!0}windowOptions(R){if(!O(R.params[0],this._optionsService.rawOptions.windowOptions))return!0;const P=R.length>1?R.params[1]:0;switch(R.params[0]){case 14:P!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:P!==0&&P!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),P!==0&&P!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:P!==0&&P!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),P!==0&&P!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(R){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(R){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(R){return this._windowTitle=R,this._onTitleChange.fire(R),!0}setIconName(R){return this._iconName=R,!0}setOrReportIndexedColor(R){const P=[],D=R.split(";");for(;D.length>1;){const M=D.shift(),V=D.shift();if(/^\d+$/.exec(M)){const W=parseInt(M);if(z(W))if(V==="?")P.push({type:0,index:W});else{const J=(0,S.parseColor)(V);J&&P.push({type:1,index:W,color:J})}}}return P.length&&this._onColor.fire(P),!0}setHyperlink(R){const P=R.split(";");return!(P.length<2)&&(P[1]?this._createHyperlink(P[0],P[1]):!P[0]&&this._finishHyperlink())}_createHyperlink(R,P){this._getCurrentLinkId()&&this._finishHyperlink();const D=R.split(":");let M;const V=D.findIndex(W=>W.startsWith("id="));return V!==-1&&(M=D[V].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:M,uri:P}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(R,P){const D=R.split(";");for(let M=0;M<D.length&&!(P>=this._specialColors.length);++M,++P)if(D[M]==="?")this._onColor.fire([{type:0,index:this._specialColors[P]}]);else{const V=(0,S.parseColor)(D[M]);V&&this._onColor.fire([{type:1,index:this._specialColors[P],color:V}])}return!0}setOrReportFgColor(R){return this._setOrReportSpecialColor(R,0)}setOrReportBgColor(R){return this._setOrReportSpecialColor(R,1)}setOrReportCursorColor(R){return this._setOrReportSpecialColor(R,2)}restoreIndexedColor(R){if(!R)return this._onColor.fire([{type:2}]),!0;const P=[],D=R.split(";");for(let M=0;M<D.length;++M)if(/^\d+$/.exec(D[M])){const V=parseInt(D[M]);z(V)&&P.push({type:2,index:V})}return P.length&&this._onColor.fire(P),!0}restoreFgColor(R){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(R){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(R){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,x.DEFAULT_CHARSET),!0}selectCharset(R){return R.length!==2?(this.selectDefaultCharset(),!0):(R[0]==="/"||this._charsetService.setgCharset(E[R[0]],x.CHARSETS[R[1]]||x.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const R=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,R,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(R){return this._charsetService.setgLevel(R),!0}screenAlignmentPattern(){const R=new g.CellData;R.content=4194373,R.fg=this._curAttrData.fg,R.bg=this._curAttrData.bg,this._setCursor(0,0);for(let P=0;P<this._bufferService.rows;++P){const D=this._activeBuffer.ybase+this._activeBuffer.y+P,M=this._activeBuffer.lines.get(D);M&&(M.fill(R),M.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,P){const D=this._bufferService.buffer,M=this._optionsService.rawOptions;return(V=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${V}${d.C0.ESC}\\`),!0))(R==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:R==='"p'?'P1$r61;1"p':R==="r"?`P1$r${D.scrollTop+1};${D.scrollBottom+1}r`:R==="m"?"P1$r0m":R===" q"?`P1$r${{block:2,underline:4,bar:6}[M.cursorStyle]-(M.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,P){this._dirtyRowTracker.markRangeDirty(R,P)}}a.InputHandler=$;let U=class{constructor(K){this._bufferService=K,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(K){K<this.start?this.start=K:K>this.end&&(this.end=K)}markRangeDirty(K,R){K>R&&(L=K,K=R,R=L),K<this.start&&(this.start=K),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function z(K){return 0<=K&&K<256}U=u([m(0,w.IBufferService)],U)},844:(l,a)=>{function c(u){for(const m of u)m.dispose();u.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const m=this._disposables.indexOf(u);m!==-1&&this._disposables.splice(m,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var m;this._isDisposed||u===this._value||((m=this._value)===null||m===void 0||m.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)===null||u===void 0||u.dispose(),this._value=void 0}},a.toDisposable=function(u){return{dispose:u}},a.disposeArray=c,a.getDisposeArrayDisposable=function(u){return{dispose:()=>c(u)}}},1505:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(m,d,x){this._data[m]||(this._data[m]={}),this._data[m][d]=x}get(m,d){return this._data[m]?this._data[m][d]:void 0}clear(){this._data={}}}a.TwoKeyMap=c,a.FourKeyMap=class{constructor(){this._data=new c}set(u,m,d,x,v){this._data.get(u,m)||this._data.set(u,m,new c),this._data.get(u,m).set(d,x,v)}get(u,m,d,x){var v;return(v=this._data.get(u,m))===null||v===void 0?void 0:v.get(d,x)}clear(){this._data.clear()}}},6114:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof navigator>"u";const c=a.isNode?"node":navigator.userAgent,u=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const m=c.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),a.isIpad=u==="iPad",a.isIphone=u==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),a.isLinux=u.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(c)},6106:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(c=this._search(this._getKey(u)),this._array.splice(c,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const m=this._getKey(u);if(m===void 0||(c=this._search(m),c===-1)||this._getKey(this._array[c])!==m)return!1;do if(this._array[c]===u)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===m);return!1}*getKeyIterator(u){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===u)}forEachByKey(u,m){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do m(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===u)}values(){return[...this._array].values()}_search(u){let m=0,d=this._array.length-1;for(;d>=m;){let x=m+d>>1;const v=this._getKey(this._array[x]);if(v>u)d=x-1;else{if(!(v<u)){for(;x>0&&this._getKey(this._array[x-1])===u;)x--;return x}m=x+1}}return m}}},7226:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const u=c(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(v){this._tasks.push(v),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(v){this._idleCallback=void 0;let _=0,y=0,h=v.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(_=Date.now(),this._tasks[this._i]()||this._i++,_=Math.max(1,Date.now()-_),y=Math.max(_,y),p=v.timeRemaining(),1.5*y>p)return h-_<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-_))}ms`),void this._start();h=p}this.clear()}}class d extends m{_requestCallback(v){return setTimeout(()=>v(this._createDeadline(16)))}_cancelCallback(v){clearTimeout(v)}_createDeadline(v){const _=Date.now()+v;return{timeRemaining:()=>Math.max(0,_-Date.now())}}}a.PriorityTaskQueue=d,a.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(x){return requestIdleCallback(x)}_cancelCallback(x){cancelIdleCallback(x)}}:d,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(x){this._queue.clear(),this._queue.enqueue(x)}flush(){this._queue.flush()}}},9282:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const u=c(643);a.updateWindowsModeWrappedState=function(m){const d=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),x=d==null?void 0:d.get(m.cols-1),v=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);v&&x&&(v.isWrapped=x[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&x[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}a.AttributeData=c;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}constructor(d=0,x=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=x}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=u},9092:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const u=c(6349),m=c(7226),d=c(3734),x=c(8437),v=c(4634),_=c(511),y=c(643),h=c(4863),p=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(f,g,b){this._hasScrollback=f,this._optionsService=g,this._bufferService=b,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=x.DEFAULT_ATTR_DATA.clone(),this.savedCharset=p.DEFAULT_CHARSET,this.markers=[],this._nullCell=_.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),this._whitespaceCell=_.CellData.fromCharData([0,y.WHITESPACE_CELL_CHAR,y.WHITESPACE_CELL_WIDTH,y.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(f){return f?(this._whitespaceCell.fg=f.fg,this._whitespaceCell.bg=f.bg,this._whitespaceCell.extended=f.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,g){return new x.BufferLine(this._bufferService.cols,this.getNullCell(f),g)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const f=this.ybase+this.y-this.ydisp;return f>=0&&f<this._rows}_getCorrectBufferLength(f){if(!this._hasScrollback)return f;const g=f+this._optionsService.rawOptions.scrollback;return g>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:g}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=x.DEFAULT_ATTR_DATA);let g=this._rows;for(;g--;)this.lines.push(this.getBlankLine(f))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(f,g){const b=this.getNullCell(x.DEFAULT_ATTR_DATA);let w=0;const k=this._getCorrectBufferLength(g);if(k>this.lines.maxLength&&(this.lines.maxLength=k),this.lines.length>0){if(this._cols<f)for(let S=0;S<this.lines.length;S++)w+=+this.lines.get(S).resize(f,b);let j=0;if(this._rows<g)for(let S=this._rows;S<g;S++)this.lines.length<g+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new x.BufferLine(f,b)):this.ybase>0&&this.lines.length<=this.ybase+this.y+j+1?(this.ybase--,j++,this.ydisp>0&&this.ydisp--):this.lines.push(new x.BufferLine(f,b)));else for(let S=this._rows;S>g;S--)this.lines.length>g+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(k<this.lines.maxLength){const S=this.lines.length-k;S>0&&(this.lines.trimStart(S),this.ybase=Math.max(this.ybase-S,0),this.ydisp=Math.max(this.ydisp-S,0),this.savedY=Math.max(this.savedY-S,0)),this.lines.maxLength=k}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,g-1),j&&(this.y+=j),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=g-1,this._isReflowEnabled&&(this._reflow(f,g),this._cols>f))for(let j=0;j<this.lines.length;j++)w+=+this.lines.get(j).resize(f,b);this._cols=f,this._rows=g,this._memoryCleanupQueue.clear(),w>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let f=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,f=!1);let g=0;for(;this._memoryCleanupPosition<this.lines.length;)if(g+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),g>100)return!0;return f}get _isReflowEnabled(){const f=this._optionsService.rawOptions.windowsPty;return f&&f.buildNumber?this._hasScrollback&&f.backend==="conpty"&&f.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(f,g){this._cols!==f&&(f>this._cols?this._reflowLarger(f,g):this._reflowSmaller(f,g))}_reflowLarger(f,g){const b=(0,v.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(x.DEFAULT_ATTR_DATA));if(b.length>0){const w=(0,v.reflowLargerCreateNewLayout)(this.lines,b);(0,v.reflowLargerApplyNewLayout)(this.lines,w.layout),this._reflowLargerAdjustViewport(f,g,w.countRemoved)}}_reflowLargerAdjustViewport(f,g,b){const w=this.getNullCell(x.DEFAULT_ATTR_DATA);let k=b;for(;k-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<g&&this.lines.push(new x.BufferLine(f,w))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-b,0)}_reflowSmaller(f,g){const b=this.getNullCell(x.DEFAULT_ATTR_DATA),w=[];let k=0;for(let j=this.lines.length-1;j>=0;j--){let S=this.lines.get(j);if(!S||!S.isWrapped&&S.getTrimmedLength()<=f)continue;const E=[S];for(;S.isWrapped&&j>0;)S=this.lines.get(--j),E.unshift(S);const N=this.ybase+this.y;if(N>=j&&N<j+E.length)continue;const O=E[E.length-1].getTrimmedLength(),T=(0,v.reflowSmallerGetNewLineLengths)(E,this._cols,f),L=T.length-E.length;let $;$=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+L):Math.max(0,this.lines.length-this.lines.maxLength+L);const U=[];for(let M=0;M<L;M++){const V=this.getBlankLine(x.DEFAULT_ATTR_DATA,!0);U.push(V)}U.length>0&&(w.push({start:j+E.length+k,newLines:U}),k+=U.length),E.push(...U);let z=T.length-1,K=T[z];K===0&&(z--,K=T[z]);let R=E.length-L-1,P=O;for(;R>=0;){const M=Math.min(P,K);if(E[z]===void 0)break;if(E[z].copyCellsFrom(E[R],P-M,K-M,M,!0),K-=M,K===0&&(z--,K=T[z]),P-=M,P===0){R--;const V=Math.max(R,0);P=(0,v.getWrappedLineTrimmedLength)(E,V,this._cols)}}for(let M=0;M<E.length;M++)T[M]<f&&E[M].setCell(T[M],b);let D=L-$;for(;D-- >0;)this.ybase===0?this.y<g-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+k)-g&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+L,this.ybase+g-1)}if(w.length>0){const j=[],S=[];for(let z=0;z<this.lines.length;z++)S.push(this.lines.get(z));const E=this.lines.length;let N=E-1,O=0,T=w[O];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+k);let L=0;for(let z=Math.min(this.lines.maxLength-1,E+k-1);z>=0;z--)if(T&&T.start>N+L){for(let K=T.newLines.length-1;K>=0;K--)this.lines.set(z--,T.newLines[K]);z++,j.push({index:N+1,amount:T.newLines.length}),L+=T.newLines.length,T=w[++O]}else this.lines.set(z,S[N--]);let $=0;for(let z=j.length-1;z>=0;z--)j[z].index+=$,this.lines.onInsertEmitter.fire(j[z]),$+=j[z].amount;const U=Math.max(0,E+k-this.lines.maxLength);U>0&&this.lines.onTrimEmitter.fire(U)}}translateBufferLineToString(f,g,b=0,w){const k=this.lines.get(f);return k?k.translateToString(g,b,w):""}getWrappedRangeForLine(f){let g=f,b=f;for(;g>0&&this.lines.get(g).isWrapped;)g--;for(;b+1<this.lines.length&&this.lines.get(b+1).isWrapped;)b++;return{first:g,last:b}}setupTabStops(f){for(f!=null?this.tabs[f]||(f=this.prevStop(f)):(this.tabs={},f=0);f<this._cols;f+=this._optionsService.rawOptions.tabStopWidth)this.tabs[f]=!0}prevStop(f){for(f==null&&(f=this.x);!this.tabs[--f]&&f>0;);return f>=this._cols?this._cols-1:f<0?0:f}nextStop(f){for(f==null&&(f=this.x);!this.tabs[++f]&&f<this._cols;);return f>=this._cols?this._cols-1:f<0?0:f}clearMarkers(f){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].line===f&&(this.markers[g].dispose(),this.markers.splice(g--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].dispose(),this.markers.splice(f--,1);this._isClearing=!1}addMarker(f){const g=new h.Marker(f);return this.markers.push(g),g.register(this.lines.onTrim(b=>{g.line-=b,g.line<0&&g.dispose()})),g.register(this.lines.onInsert(b=>{g.line>=b.index&&(g.line+=b.amount)})),g.register(this.lines.onDelete(b=>{g.line>=b.index&&g.line<b.index+b.amount&&g.dispose(),g.line>b.index&&(g.line-=b.amount)})),g.register(g.onDispose(()=>this._removeMarker(g))),g}_removeMarker(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const u=c(3734),m=c(511),d=c(643),x=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let v=0;class _{constructor(h,p,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*h);const g=p||m.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let b=0;b<h;++b)this.setCell(b,g);this.length=h}get(h){const p=this._data[3*h+0],f=2097151&p;return[this._data[3*h+1],2097152&p?this._combined[h]:f?(0,x.stringFromCodePoint)(f):"",p>>22,2097152&p?this._combined[h].charCodeAt(this._combined[h].length-1):f]}set(h,p){this._data[3*h+1]=p[d.CHAR_DATA_ATTR_INDEX],p[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[h]=p[1],this._data[3*h+0]=2097152|h|p[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*h+0]=p[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(h){return this._data[3*h+0]>>22}hasWidth(h){return 12582912&this._data[3*h+0]}getFg(h){return this._data[3*h+1]}getBg(h){return this._data[3*h+2]}hasContent(h){return 4194303&this._data[3*h+0]}getCodePoint(h){const p=this._data[3*h+0];return 2097152&p?this._combined[h].charCodeAt(this._combined[h].length-1):2097151&p}isCombined(h){return 2097152&this._data[3*h+0]}getString(h){const p=this._data[3*h+0];return 2097152&p?this._combined[h]:2097151&p?(0,x.stringFromCodePoint)(2097151&p):""}isProtected(h){return 536870912&this._data[3*h+2]}loadCell(h,p){return v=3*h,p.content=this._data[v+0],p.fg=this._data[v+1],p.bg=this._data[v+2],2097152&p.content&&(p.combinedData=this._combined[h]),268435456&p.bg&&(p.extended=this._extendedAttrs[h]),p}setCell(h,p){2097152&p.content&&(this._combined[h]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[h]=p.extended),this._data[3*h+0]=p.content,this._data[3*h+1]=p.fg,this._data[3*h+2]=p.bg}setCellFromCodePoint(h,p,f,g,b,w){268435456&b&&(this._extendedAttrs[h]=w),this._data[3*h+0]=p|f<<22,this._data[3*h+1]=g,this._data[3*h+2]=b}addCodepointToCell(h,p){let f=this._data[3*h+0];2097152&f?this._combined[h]+=(0,x.stringFromCodePoint)(p):(2097151&f?(this._combined[h]=(0,x.stringFromCodePoint)(2097151&f)+(0,x.stringFromCodePoint)(p),f&=-2097152,f|=2097152):f=p|4194304,this._data[3*h+0]=f)}insertCells(h,p,f,g){if((h%=this.length)&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(g==null?void 0:g.fg)||0,(g==null?void 0:g.bg)||0,(g==null?void 0:g.extended)||new u.ExtendedAttrs),p<this.length-h){const b=new m.CellData;for(let w=this.length-h-p-1;w>=0;--w)this.setCell(h+p+w,this.loadCell(h+w,b));for(let w=0;w<p;++w)this.setCell(h+w,f)}else for(let b=h;b<this.length;++b)this.setCell(b,f);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(g==null?void 0:g.fg)||0,(g==null?void 0:g.bg)||0,(g==null?void 0:g.extended)||new u.ExtendedAttrs)}deleteCells(h,p,f,g){if(h%=this.length,p<this.length-h){const b=new m.CellData;for(let w=0;w<this.length-h-p;++w)this.setCell(h+w,this.loadCell(h+p+w,b));for(let w=this.length-p;w<this.length;++w)this.setCell(w,f)}else for(let b=h;b<this.length;++b)this.setCell(b,f);h&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(g==null?void 0:g.fg)||0,(g==null?void 0:g.bg)||0,(g==null?void 0:g.extended)||new u.ExtendedAttrs),this.getWidth(h)!==0||this.hasContent(h)||this.setCellFromCodePoint(h,0,1,(g==null?void 0:g.fg)||0,(g==null?void 0:g.bg)||0,(g==null?void 0:g.extended)||new u.ExtendedAttrs)}replaceCells(h,p,f,g,b=!1){if(b)for(h&&this.getWidth(h-1)===2&&!this.isProtected(h-1)&&this.setCellFromCodePoint(h-1,0,1,(g==null?void 0:g.fg)||0,(g==null?void 0:g.bg)||0,(g==null?void 0:g.extended)||new u.ExtendedAttrs),p<this.length&&this.getWidth(p-1)===2&&!this.isProtected(p)&&this.setCellFromCodePoint(p,0,1,(g==null?void 0:g.fg)||0,(g==null?void 0:g.bg)||0,(g==null?void 0:g.extended)||new u.ExtendedAttrs);h<p&&h<this.length;)this.isProtected(h)||this.setCell(h,f),h++;else for(h&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h-1,0,1,(g==null?void 0:g.fg)||0,(g==null?void 0:g.bg)||0,(g==null?void 0:g.extended)||new u.ExtendedAttrs),p<this.length&&this.getWidth(p-1)===2&&this.setCellFromCodePoint(p,0,1,(g==null?void 0:g.fg)||0,(g==null?void 0:g.bg)||0,(g==null?void 0:g.extended)||new u.ExtendedAttrs);h<p&&h<this.length;)this.setCell(h++,f)}resize(h,p){if(h===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*h;if(h>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const g=new Uint32Array(f);g.set(this._data),this._data=g}for(let g=this.length;g<h;++g)this.setCell(g,p)}else{this._data=this._data.subarray(0,f);const g=Object.keys(this._combined);for(let w=0;w<g.length;w++){const k=parseInt(g[w],10);k>=h&&delete this._combined[k]}const b=Object.keys(this._extendedAttrs);for(let w=0;w<b.length;w++){const k=parseInt(b[w],10);k>=h&&delete this._extendedAttrs[k]}}return this.length=h,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const h=new Uint32Array(this._data.length);return h.set(this._data),this._data=h,1}return 0}fill(h,p=!1){if(p)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,h);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,h)}}copyFrom(h){this.length!==h.length?this._data=new Uint32Array(h._data):this._data.set(h._data),this.length=h.length,this._combined={};for(const p in h._combined)this._combined[p]=h._combined[p];this._extendedAttrs={};for(const p in h._extendedAttrs)this._extendedAttrs[p]=h._extendedAttrs[p];this.isWrapped=h.isWrapped}clone(){const h=new _(0);h._data=new Uint32Array(this._data),h.length=this.length;for(const p in this._combined)h._combined[p]=this._combined[p];for(const p in this._extendedAttrs)h._extendedAttrs[p]=this._extendedAttrs[p];return h.isWrapped=this.isWrapped,h}getTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0])return h+(this._data[3*h+0]>>22);return 0}getNoBgTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0]||50331648&this._data[3*h+2])return h+(this._data[3*h+0]>>22);return 0}copyCellsFrom(h,p,f,g,b){const w=h._data;if(b)for(let j=g-1;j>=0;j--){for(let S=0;S<3;S++)this._data[3*(f+j)+S]=w[3*(p+j)+S];268435456&w[3*(p+j)+2]&&(this._extendedAttrs[f+j]=h._extendedAttrs[p+j])}else for(let j=0;j<g;j++){for(let S=0;S<3;S++)this._data[3*(f+j)+S]=w[3*(p+j)+S];268435456&w[3*(p+j)+2]&&(this._extendedAttrs[f+j]=h._extendedAttrs[p+j])}const k=Object.keys(h._combined);for(let j=0;j<k.length;j++){const S=parseInt(k[j],10);S>=p&&(this._combined[S-p+f]=h._combined[S])}}translateToString(h=!1,p=0,f=this.length){h&&(f=Math.min(f,this.getTrimmedLength()));let g="";for(;p<f;){const b=this._data[3*p+0],w=2097151&b;g+=2097152&b?this._combined[p]:w?(0,x.stringFromCodePoint)(w):d.WHITESPACE_CELL_CHAR,p+=b>>22||1}return g}}a.BufferLine=_},4841:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,u){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return u*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(l,a)=>{function c(u,m,d){if(m===u.length-1)return u[m].getTrimmedLength();const x=!u[m].hasContent(d-1)&&u[m].getWidth(d-1)===1,v=u[m+1].getWidth(0)===2;return x&&v?d-1:d}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(u,m,d,x,v){const _=[];for(let y=0;y<u.length-1;y++){let h=y,p=u.get(++h);if(!p.isWrapped)continue;const f=[u.get(y)];for(;h<u.length&&p.isWrapped;)f.push(p),p=u.get(++h);if(x>=y&&x<h){y+=f.length-1;continue}let g=0,b=c(f,g,m),w=1,k=0;for(;w<f.length;){const S=c(f,w,m),E=S-k,N=d-b,O=Math.min(E,N);f[g].copyCellsFrom(f[w],k,b,O,!1),b+=O,b===d&&(g++,b=0),k+=O,k===S&&(w++,k=0),b===0&&g!==0&&f[g-1].getWidth(d-1)===2&&(f[g].copyCellsFrom(f[g-1],d-1,b++,1,!1),f[g-1].setCell(d-1,v))}f[g].replaceCells(b,d,v);let j=0;for(let S=f.length-1;S>0&&(S>g||f[S].getTrimmedLength()===0);S--)j++;j>0&&(_.push(y+f.length-j),_.push(j)),y+=f.length-1}return _},a.reflowLargerCreateNewLayout=function(u,m){const d=[];let x=0,v=m[x],_=0;for(let y=0;y<u.length;y++)if(v===y){const h=m[++x];u.onDeleteEmitter.fire({index:y-_,amount:h}),y+=h-1,_+=h,v=m[++x]}else d.push(y);return{layout:d,countRemoved:_}},a.reflowLargerApplyNewLayout=function(u,m){const d=[];for(let x=0;x<m.length;x++)d.push(u.get(m[x]));for(let x=0;x<d.length;x++)u.set(x,d[x]);u.length=m.length},a.reflowSmallerGetNewLineLengths=function(u,m,d){const x=[],v=u.map((p,f)=>c(u,f,m)).reduce((p,f)=>p+f);let _=0,y=0,h=0;for(;h<v;){if(v-h<d){x.push(v-h);break}_+=d;const p=c(u,y,m);_>p&&(_-=p,y++);const f=u[y].getWidth(_-1)===2;f&&_--;const g=f?d-1:d;x.push(g),h+=g}return x},a.getWrappedLineTrimmedLength=c},5295:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const u=c(8460),m=c(844),d=c(9092);class x extends m.Disposable{constructor(_,y){super(),this._optionsService=_,this._bufferService=y,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(_){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(_),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(_,y){this._normal.resize(_,y),this._alt.resize(_,y),this.setupTabStops(_)}setupTabStops(_){this._normal.setupTabStops(_),this._alt.setupTabStops(_)}}a.BufferSet=x},511:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const u=c(482),m=c(643),d=c(3734);class x extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(_){const y=new x;return y.setFromCharData(_),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(_){this.fg=_[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(_[m.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(_[m.CHAR_DATA_CHAR_INDEX].length===2){const h=_[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const p=_[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(h-55296)+p-56320+65536|_[m.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=_[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[m.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=_[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|_[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=x},643:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const u=c(8460),m=c(844);class d{get id(){return this._id}constructor(v){this.line=v,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(v){return this._disposables.push(v),v}}a.Marker=d,d._nextId=1},7116:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,a)=>{var c,u,m;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
|
|
200
|
+
`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""}(c||(a.C0=c={})),function(d){d.PAD="",d.HOP="",d.BPH="",d.NBH="",d.IND="",d.NEL="
",d.SSA="",d.ESA="",d.HTS="",d.HTJ="",d.VTS="",d.PLD="",d.PLU="",d.RI="",d.SS2="",d.SS3="",d.DCS="",d.PU1="",d.PU2="",d.STS="",d.CCH="",d.MW="",d.SPA="",d.EPA="",d.SOS="",d.SGCI="",d.SCI="",d.CSI="",d.ST="",d.OSC="",d.PM="",d.APC=""}(u||(a.C1=u={})),function(d){d.ST=`${c.ESC}\\`}(m||(a.C1_ESCAPED=m={}))},7399:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const u=c(2584),m={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};a.evaluateKeyboardEvent=function(d,x,v,_){const y={type:0,cancel:!1,key:void 0},h=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?y.key=x?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?y.key=x?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?y.key=x?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(y.key=x?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:if(d.altKey){y.key=u.C0.ESC+u.C0.DEL;break}y.key=u.C0.DEL;break;case 9:if(d.shiftKey){y.key=u.C0.ESC+"[Z";break}y.key=u.C0.HT,y.cancel=!0;break;case 13:y.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,y.cancel=!0;break;case 27:y.key=u.C0.ESC,d.altKey&&(y.key=u.C0.ESC+u.C0.ESC),y.cancel=!0;break;case 37:if(d.metaKey)break;h?(y.key=u.C0.ESC+"[1;"+(h+1)+"D",y.key===u.C0.ESC+"[1;3D"&&(y.key=u.C0.ESC+(v?"b":"[1;5D"))):y.key=x?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;h?(y.key=u.C0.ESC+"[1;"+(h+1)+"C",y.key===u.C0.ESC+"[1;3C"&&(y.key=u.C0.ESC+(v?"f":"[1;5C"))):y.key=x?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;h?(y.key=u.C0.ESC+"[1;"+(h+1)+"A",v||y.key!==u.C0.ESC+"[1;3A"||(y.key=u.C0.ESC+"[1;5A")):y.key=x?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;h?(y.key=u.C0.ESC+"[1;"+(h+1)+"B",v||y.key!==u.C0.ESC+"[1;3B"||(y.key=u.C0.ESC+"[1;5B")):y.key=x?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(y.key=u.C0.ESC+"[2~");break;case 46:y.key=h?u.C0.ESC+"[3;"+(h+1)+"~":u.C0.ESC+"[3~";break;case 36:y.key=h?u.C0.ESC+"[1;"+(h+1)+"H":x?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:y.key=h?u.C0.ESC+"[1;"+(h+1)+"F":x?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?y.type=2:d.ctrlKey?y.key=u.C0.ESC+"[5;"+(h+1)+"~":y.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?y.type=3:d.ctrlKey?y.key=u.C0.ESC+"[6;"+(h+1)+"~":y.key=u.C0.ESC+"[6~";break;case 112:y.key=h?u.C0.ESC+"[1;"+(h+1)+"P":u.C0.ESC+"OP";break;case 113:y.key=h?u.C0.ESC+"[1;"+(h+1)+"Q":u.C0.ESC+"OQ";break;case 114:y.key=h?u.C0.ESC+"[1;"+(h+1)+"R":u.C0.ESC+"OR";break;case 115:y.key=h?u.C0.ESC+"[1;"+(h+1)+"S":u.C0.ESC+"OS";break;case 116:y.key=h?u.C0.ESC+"[15;"+(h+1)+"~":u.C0.ESC+"[15~";break;case 117:y.key=h?u.C0.ESC+"[17;"+(h+1)+"~":u.C0.ESC+"[17~";break;case 118:y.key=h?u.C0.ESC+"[18;"+(h+1)+"~":u.C0.ESC+"[18~";break;case 119:y.key=h?u.C0.ESC+"[19;"+(h+1)+"~":u.C0.ESC+"[19~";break;case 120:y.key=h?u.C0.ESC+"[20;"+(h+1)+"~":u.C0.ESC+"[20~";break;case 121:y.key=h?u.C0.ESC+"[21;"+(h+1)+"~":u.C0.ESC+"[21~";break;case 122:y.key=h?u.C0.ESC+"[23;"+(h+1)+"~":u.C0.ESC+"[23~";break;case 123:y.key=h?u.C0.ESC+"[24;"+(h+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(v&&!_||!d.altKey||d.metaKey)!v||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?y.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(y.key=u.C0.US),d.key==="@"&&(y.key=u.C0.NUL)):d.keyCode===65&&(y.type=1);else{const p=m[d.keyCode],f=p==null?void 0:p[d.shiftKey?1:0];if(f)y.key=u.C0.ESC+f;else if(d.keyCode>=65&&d.keyCode<=90){const g=d.ctrlKey?d.keyCode-64:d.keyCode+32;let b=String.fromCharCode(g);d.shiftKey&&(b=b.toUpperCase()),y.key=u.C0.ESC+b}else if(d.keyCode===32)y.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let g=d.code.slice(3,4);d.shiftKey||(g=g.toLowerCase()),y.key=u.C0.ESC+g,y.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?y.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?y.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?y.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?y.key=u.C0.DEL:d.keyCode===219?y.key=u.C0.ESC:d.keyCode===220?y.key=u.C0.FS:d.keyCode===221&&(y.key=u.C0.GS)}return y}},482:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},a.utf32ToString=function(c,u=0,m=c.length){let d="";for(let x=u;x<m;++x){let v=c[x];v>65535?(v-=65536,d+=String.fromCharCode(55296+(v>>10))+String.fromCharCode(v%1024+56320)):d+=String.fromCharCode(v)}return d},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,u){const m=c.length;if(!m)return 0;let d=0,x=0;if(this._interim){const v=c.charCodeAt(x++);56320<=v&&v<=57343?u[d++]=1024*(this._interim-55296)+v-56320+65536:(u[d++]=this._interim,u[d++]=v),this._interim=0}for(let v=x;v<m;++v){const _=c.charCodeAt(v);if(55296<=_&&_<=56319){if(++v>=m)return this._interim=_,d;const y=c.charCodeAt(v);56320<=y&&y<=57343?u[d++]=1024*(_-55296)+y-56320+65536:(u[d++]=_,u[d++]=y)}else _!==65279&&(u[d++]=_)}return d}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,u){const m=c.length;if(!m)return 0;let d,x,v,_,y=0,h=0,p=0;if(this.interim[0]){let b=!1,w=this.interim[0];w&=(224&w)==192?31:(240&w)==224?15:7;let k,j=0;for(;(k=63&this.interim[++j])&&j<4;)w<<=6,w|=k;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=S-j;for(;p<E;){if(p>=m)return 0;if(k=c[p++],(192&k)!=128){p--,b=!0;break}this.interim[j++]=k,w<<=6,w|=63&k}b||(S===2?w<128?p--:u[y++]=w:S===3?w<2048||w>=55296&&w<=57343||w===65279||(u[y++]=w):w<65536||w>1114111||(u[y++]=w)),this.interim.fill(0)}const f=m-4;let g=p;for(;g<m;){for(;!(!(g<f)||128&(d=c[g])||128&(x=c[g+1])||128&(v=c[g+2])||128&(_=c[g+3]));)u[y++]=d,u[y++]=x,u[y++]=v,u[y++]=_,g+=4;if(d=c[g++],d<128)u[y++]=d;else if((224&d)==192){if(g>=m)return this.interim[0]=d,y;if(x=c[g++],(192&x)!=128){g--;continue}if(h=(31&d)<<6|63&x,h<128){g--;continue}u[y++]=h}else if((240&d)==224){if(g>=m)return this.interim[0]=d,y;if(x=c[g++],(192&x)!=128){g--;continue}if(g>=m)return this.interim[0]=d,this.interim[1]=x,y;if(v=c[g++],(192&v)!=128){g--;continue}if(h=(15&d)<<12|(63&x)<<6|63&v,h<2048||h>=55296&&h<=57343||h===65279)continue;u[y++]=h}else if((248&d)==240){if(g>=m)return this.interim[0]=d,y;if(x=c[g++],(192&x)!=128){g--;continue}if(g>=m)return this.interim[0]=d,this.interim[1]=x,y;if(v=c[g++],(192&v)!=128){g--;continue}if(g>=m)return this.interim[0]=d,this.interim[1]=x,this.interim[2]=v,y;if(_=c[g++],(192&_)!=128){g--;continue}if(h=(7&d)<<18|(63&x)<<12|(63&v)<<6|63&_,h<65536||h>1114111)continue;u[y++]=h}}return y}}},225:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const c=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let m;a.UnicodeV6=class{constructor(){if(this.version="6",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160),m.fill(2,4352,4448),m[9001]=2,m[9002]=2,m.fill(2,11904,42192),m[12351]=1,m.fill(2,44032,55204),m.fill(2,63744,64256),m.fill(2,65040,65050),m.fill(2,65072,65136),m.fill(2,65280,65377),m.fill(2,65504,65511);for(let d=0;d<c.length;++d)m.fill(0,c[d][0],c[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?m[d]:function(x,v){let _,y=0,h=v.length-1;if(x<v[0][0]||x>v[h][1])return!1;for(;h>=y;)if(_=y+h>>1,x>v[_][1])y=_+1;else{if(!(x<v[_][0]))return!0;h=_-1}return!1}(d,u)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}}},5981:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const u=c(8460),m=c(844);class d extends m.Disposable{constructor(v){super(),this._action=v,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(v,_){if(_!==void 0&&this._syncCalls>_)return void(this._syncCalls=0);if(this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let y;for(this._isSyncWriting=!0;y=this._writeBuffer.shift();){this._action(y);const h=this._callbacks.shift();h&&h()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(v,_){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(_),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=v.length,this._writeBuffer.push(v),this._callbacks.push(_)}_innerWrite(v=0,_=!0){const y=v||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const h=this._writeBuffer[this._bufferOffset],p=this._action(h,_);if(p){const g=b=>Date.now()-y>=12?setTimeout(()=>this._innerWrite(0,b)):this._innerWrite(y,b);return void p.catch(b=>(queueMicrotask(()=>{throw b}),Promise.resolve(!1))).then(g)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=h.length,Date.now()-y>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}a.WriteBuffer=d},5941:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function m(d,x){const v=d.toString(16),_=v.length<2?"0"+v:v;switch(x){case 4:return v[0];case 8:return _;case 12:return(_+_).slice(0,3);default:return _+_}}a.parseColor=function(d){if(!d)return;let x=d.toLowerCase();if(x.indexOf("rgb:")===0){x=x.slice(4);const v=c.exec(x);if(v){const _=v[1]?15:v[4]?255:v[7]?4095:65535;return[Math.round(parseInt(v[1]||v[4]||v[7]||v[10],16)/_*255),Math.round(parseInt(v[2]||v[5]||v[8]||v[11],16)/_*255),Math.round(parseInt(v[3]||v[6]||v[9]||v[12],16)/_*255)]}}else if(x.indexOf("#")===0&&(x=x.slice(1),u.exec(x)&&[3,6,9,12].includes(x.length))){const v=x.length/3,_=[0,0,0];for(let y=0;y<3;++y){const h=parseInt(x.slice(v*y,v*y+v),16);_[y]=v===1?h<<4:v===2?h:v===3?h>>4:h>>8}return _}},a.toRgbString=function(d,x=16){const[v,_,y]=d;return`rgb:${m(v,x)}/${m(_,x)}/${m(y,x)}`}},5770:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const u=c(482),m=c(8742),d=c(5770),x=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=x,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=x}registerHandler(_,y){this._handlers[_]===void 0&&(this._handlers[_]=[]);const h=this._handlers[_];return h.push(y),{dispose:()=>{const p=h.indexOf(y);p!==-1&&h.splice(p,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}reset(){if(this._active.length)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].unhook(!1);this._stack.paused=!1,this._active=x,this._ident=0}hook(_,y){if(this.reset(),this._ident=_,this._active=this._handlers[_]||x,this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].hook(y);else this._handlerFb(this._ident,"HOOK",y)}put(_,y,h){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(_,y,h);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(_,y,h))}unhook(_,y=!0){if(this._active.length){let h=!1,p=this._active.length-1,f=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,h=y,f=this._stack.fallThrough,this._stack.paused=!1),!f&&h===!1){for(;p>=0&&(h=this._active[p].unhook(_),h!==!0);p--)if(h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,h;p--}for(;p>=0;p--)if(h=this._active[p].unhook(!1),h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,h}else this._handlerFb(this._ident,"UNHOOK",_);this._active=x,this._ident=0}};const v=new m.Params;v.addParam(0),a.DcsHandler=class{constructor(_){this._handler=_,this._data="",this._params=v,this._hitLimit=!1}hook(_){this._params=_.length>1||_.params[0]?_.clone():v,this._data="",this._hitLimit=!1}put(_,y,h){this._hitLimit||(this._data+=(0,u.utf32ToString)(_,y,h),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(_){let y=!1;if(this._hitLimit)y=!1;else if(_&&(y=this._handler(this._data,this._params),y instanceof Promise))return y.then(h=>(this._params=v,this._data="",this._hitLimit=!1,h));return this._params=v,this._data="",this._hitLimit=!1,y}}},2015:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const u=c(844),m=c(8742),d=c(6242),x=c(6351);class v{constructor(p){this.table=new Uint8Array(p)}setDefault(p,f){this.table.fill(p<<4|f)}add(p,f,g,b){this.table[f<<8|p]=g<<4|b}addMany(p,f,g,b){for(let w=0;w<p.length;w++)this.table[f<<8|p[w]]=g<<4|b}}a.TransitionTable=v;const _=160;a.VT500_TRANSITION_TABLE=function(){const h=new v(4095),p=Array.apply(null,Array(256)).map((j,S)=>S),f=(j,S)=>p.slice(j,S),g=f(32,127),b=f(0,24);b.push(25),b.push.apply(b,f(28,32));const w=f(0,14);let k;for(k in h.setDefault(1,0),h.addMany(g,0,2,0),w)h.addMany([24,26,153,154],k,3,0),h.addMany(f(128,144),k,3,0),h.addMany(f(144,152),k,3,0),h.add(156,k,0,0),h.add(27,k,11,1),h.add(157,k,4,8),h.addMany([152,158,159],k,0,7),h.add(155,k,11,3),h.add(144,k,11,9);return h.addMany(b,0,3,0),h.addMany(b,1,3,1),h.add(127,1,0,1),h.addMany(b,8,0,8),h.addMany(b,3,3,3),h.add(127,3,0,3),h.addMany(b,4,3,4),h.add(127,4,0,4),h.addMany(b,6,3,6),h.addMany(b,5,3,5),h.add(127,5,0,5),h.addMany(b,2,3,2),h.add(127,2,0,2),h.add(93,1,4,8),h.addMany(g,8,5,8),h.add(127,8,5,8),h.addMany([156,27,24,26,7],8,6,0),h.addMany(f(28,32),8,0,8),h.addMany([88,94,95],1,0,7),h.addMany(g,7,0,7),h.addMany(b,7,0,7),h.add(156,7,0,0),h.add(127,7,0,7),h.add(91,1,11,3),h.addMany(f(64,127),3,7,0),h.addMany(f(48,60),3,8,4),h.addMany([60,61,62,63],3,9,4),h.addMany(f(48,60),4,8,4),h.addMany(f(64,127),4,7,0),h.addMany([60,61,62,63],4,0,6),h.addMany(f(32,64),6,0,6),h.add(127,6,0,6),h.addMany(f(64,127),6,0,0),h.addMany(f(32,48),3,9,5),h.addMany(f(32,48),5,9,5),h.addMany(f(48,64),5,0,6),h.addMany(f(64,127),5,7,0),h.addMany(f(32,48),4,9,5),h.addMany(f(32,48),1,9,2),h.addMany(f(32,48),2,9,2),h.addMany(f(48,127),2,10,0),h.addMany(f(48,80),1,10,0),h.addMany(f(81,88),1,10,0),h.addMany([89,90,92],1,10,0),h.addMany(f(96,127),1,10,0),h.add(80,1,11,9),h.addMany(b,9,0,9),h.add(127,9,0,9),h.addMany(f(28,32),9,0,9),h.addMany(f(32,48),9,9,12),h.addMany(f(48,60),9,8,10),h.addMany([60,61,62,63],9,9,10),h.addMany(b,11,0,11),h.addMany(f(32,128),11,0,11),h.addMany(f(28,32),11,0,11),h.addMany(b,10,0,10),h.add(127,10,0,10),h.addMany(f(28,32),10,0,10),h.addMany(f(48,60),10,8,10),h.addMany([60,61,62,63],10,0,11),h.addMany(f(32,48),10,9,12),h.addMany(b,12,0,12),h.add(127,12,0,12),h.addMany(f(28,32),12,0,12),h.addMany(f(32,48),12,9,12),h.addMany(f(48,64),12,0,11),h.addMany(f(64,127),12,12,13),h.addMany(f(64,127),10,12,13),h.addMany(f(64,127),9,12,13),h.addMany(b,13,13,13),h.addMany(g,13,13,13),h.add(127,13,0,13),h.addMany([27,156,24,26],13,14,0),h.add(_,0,2,0),h.add(_,8,5,8),h.add(_,6,0,6),h.add(_,11,0,11),h.add(_,13,13,13),h}();class y extends u.Disposable{constructor(p=a.VT500_TRANSITION_TABLE){super(),this._transitions=p,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(f,g,b)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,g)=>{},this._escHandlerFb=f=>{},this._errorHandlerFb=f=>f,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new x.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(p,f=[64,126]){let g=0;if(p.prefix){if(p.prefix.length>1)throw new Error("only one byte as prefix supported");if(g=p.prefix.charCodeAt(0),g&&60>g||g>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(p.intermediates){if(p.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let w=0;w<p.intermediates.length;++w){const k=p.intermediates.charCodeAt(w);if(32>k||k>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");g<<=8,g|=k}}if(p.final.length!==1)throw new Error("final must be a single byte");const b=p.final.charCodeAt(0);if(f[0]>b||b>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return g<<=8,g|=b,g}identToString(p){const f=[];for(;p;)f.push(String.fromCharCode(255&p)),p>>=8;return f.reverse().join("")}setPrintHandler(p){this._printHandler=p}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(p,f){const g=this._identifier(p,[48,126]);this._escHandlers[g]===void 0&&(this._escHandlers[g]=[]);const b=this._escHandlers[g];return b.push(f),{dispose:()=>{const w=b.indexOf(f);w!==-1&&b.splice(w,1)}}}clearEscHandler(p){this._escHandlers[this._identifier(p,[48,126])]&&delete this._escHandlers[this._identifier(p,[48,126])]}setEscHandlerFallback(p){this._escHandlerFb=p}setExecuteHandler(p,f){this._executeHandlers[p.charCodeAt(0)]=f}clearExecuteHandler(p){this._executeHandlers[p.charCodeAt(0)]&&delete this._executeHandlers[p.charCodeAt(0)]}setExecuteHandlerFallback(p){this._executeHandlerFb=p}registerCsiHandler(p,f){const g=this._identifier(p);this._csiHandlers[g]===void 0&&(this._csiHandlers[g]=[]);const b=this._csiHandlers[g];return b.push(f),{dispose:()=>{const w=b.indexOf(f);w!==-1&&b.splice(w,1)}}}clearCsiHandler(p){this._csiHandlers[this._identifier(p)]&&delete this._csiHandlers[this._identifier(p)]}setCsiHandlerFallback(p){this._csiHandlerFb=p}registerDcsHandler(p,f){return this._dcsParser.registerHandler(this._identifier(p),f)}clearDcsHandler(p){this._dcsParser.clearHandler(this._identifier(p))}setDcsHandlerFallback(p){this._dcsParser.setHandlerFallback(p)}registerOscHandler(p,f){return this._oscParser.registerHandler(p,f)}clearOscHandler(p){this._oscParser.clearHandler(p)}setOscHandlerFallback(p){this._oscParser.setHandlerFallback(p)}setErrorHandler(p){this._errorHandler=p}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(p,f,g,b,w){this._parseStack.state=p,this._parseStack.handlers=f,this._parseStack.handlerPos=g,this._parseStack.transition=b,this._parseStack.chunkPos=w}parse(p,f,g){let b,w=0,k=0,j=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,j=this._parseStack.chunkPos+1;else{if(g===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const S=this._parseStack.handlers;let E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(g===!1&&E>-1){for(;E>=0&&(b=S[E](this._params),b!==!0);E--)if(b instanceof Promise)return this._parseStack.handlerPos=E,b}this._parseStack.handlers=[];break;case 4:if(g===!1&&E>-1){for(;E>=0&&(b=S[E](),b!==!0);E--)if(b instanceof Promise)return this._parseStack.handlerPos=E,b}this._parseStack.handlers=[];break;case 6:if(w=p[this._parseStack.chunkPos],b=this._dcsParser.unhook(w!==24&&w!==26,g),b)return b;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(w=p[this._parseStack.chunkPos],b=this._oscParser.end(w!==24&&w!==26,g),b)return b;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,j=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let S=j;S<f;++S){switch(w=p[S],k=this._transitions.table[this.currentState<<8|(w<160?w:_)],k>>4){case 2:for(let L=S+1;;++L){if(L>=f||(w=p[L])<32||w>126&&w<_){this._printHandler(p,S,L),S=L-1;break}if(++L>=f||(w=p[L])<32||w>126&&w<_){this._printHandler(p,S,L),S=L-1;break}if(++L>=f||(w=p[L])<32||w>126&&w<_){this._printHandler(p,S,L),S=L-1;break}if(++L>=f||(w=p[L])<32||w>126&&w<_){this._printHandler(p,S,L),S=L-1;break}}break;case 3:this._executeHandlers[w]?this._executeHandlers[w]():this._executeHandlerFb(w),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:S,code:w,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const E=this._csiHandlers[this._collect<<8|w];let N=E?E.length-1:-1;for(;N>=0&&(b=E[N](this._params),b!==!0);N--)if(b instanceof Promise)return this._preserveStack(3,E,N,k,S),b;N<0&&this._csiHandlerFb(this._collect<<8|w,this._params),this.precedingCodepoint=0;break;case 8:do switch(w){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(w-48)}while(++S<f&&(w=p[S])>47&&w<60);S--;break;case 9:this._collect<<=8,this._collect|=w;break;case 10:const O=this._escHandlers[this._collect<<8|w];let T=O?O.length-1:-1;for(;T>=0&&(b=O[T](),b!==!0);T--)if(b instanceof Promise)return this._preserveStack(4,O,T,k,S),b;T<0&&this._escHandlerFb(this._collect<<8|w),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|w,this._params);break;case 13:for(let L=S+1;;++L)if(L>=f||(w=p[L])===24||w===26||w===27||w>127&&w<_){this._dcsParser.put(p,S,L),S=L-1;break}break;case 14:if(b=this._dcsParser.unhook(w!==24&&w!==26),b)return this._preserveStack(6,[],0,k,S),b;w===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let L=S+1;;L++)if(L>=f||(w=p[L])<32||w>127&&w<_){this._oscParser.put(p,S,L),S=L-1;break}break;case 6:if(b=this._oscParser.end(w!==24&&w!==26),b)return this._preserveStack(5,[],0,k,S),b;w===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&k}}}a.EscapeSequenceParser=y},6242:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const u=c(5770),m=c(482),d=[];a.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(x,v){this._handlers[x]===void 0&&(this._handlers[x]=[]);const _=this._handlers[x];return _.push(v),{dispose:()=>{const y=_.indexOf(v);y!==-1&&_.splice(y,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].start();else this._handlerFb(this._id,"START")}_put(x,v,_){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(x,v,_);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(x,v,_))}start(){this.reset(),this._state=1}put(x,v,_){if(this._state!==3){if(this._state===1)for(;v<_;){const y=x[v++];if(y===59){this._state=2,this._start();break}if(y<48||57<y)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+y-48}this._state===2&&_-v>0&&this._put(x,v,_)}}end(x,v=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let _=!1,y=this._active.length-1,h=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,_=v,h=this._stack.fallThrough,this._stack.paused=!1),!h&&_===!1){for(;y>=0&&(_=this._active[y].end(x),_!==!0);y--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,_;y--}for(;y>=0;y--)if(_=this._active[y].end(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,_}else this._handlerFb(this._id,"END",x);this._active=d,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(x){this._handler=x,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(x,v,_){this._hitLimit||(this._data+=(0,m.utf32ToString)(x,v,_),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(x){let v=!1;if(this._hitLimit)v=!1;else if(x&&(v=this._handler(this._data),v instanceof Promise))return v.then(_=>(this._data="",this._hitLimit=!1,_));return this._data="",this._hitLimit=!1,v}}},8742:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const c=2147483647;class u{static fromArray(d){const x=new u;if(!d.length)return x;for(let v=Array.isArray(d[0])?1:0;v<d.length;++v){const _=d[v];if(Array.isArray(_))for(let y=0;y<_.length;++y)x.addSubParam(_[y]);else x.addParam(_)}return x}constructor(d=32,x=32){if(this.maxLength=d,this.maxSubParamsLength=x,x>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(x),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let x=0;x<this.length;++x){d.push(this.params[x]);const v=this._subParamsIdx[x]>>8,_=255&this._subParamsIdx[x];_-v>0&&d.push(Array.prototype.slice.call(this._subParams,v,_))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const x=this._subParamsIdx[d]>>8,v=255&this._subParamsIdx[d];return v-x>0?this._subParams.subarray(x,v):null}getSubParamsAll(){const d={};for(let x=0;x<this.length;++x){const v=this._subParamsIdx[x]>>8,_=255&this._subParamsIdx[x];_-v>0&&(d[x]=this._subParams.slice(v,_))}return d}addDigit(d){let x;if(this._rejectDigits||!(x=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const v=this._digitIsSub?this._subParams:this.params,_=v[x-1];v[x-1]=~_?Math.min(10*_+d,c):d}}a.Params=u},5741:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,u){const m={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(m),u.dispose=()=>this._wrappedAddonDispose(m),u.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let u=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===c){u=m;break}if(u===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(u,1)}}},8771:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const u=c(3785),m=c(511);a.BufferApiView=class{constructor(d,x){this._buffer=d,this.type=x}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const x=this._buffer.lines.get(d);if(x)return new u.BufferLineApiView(x)}getNullCell(){return new m.CellData}}},3785:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const u=c(511);a.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,d){if(!(m<0||m>=this._line.length))return d?(this._line.loadCell(m,d),d):this._line.loadCell(m,new u.CellData)}translateToString(m,d,x){return this._line.translateToString(m,d,x)}}},8285:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const u=c(8771),m=c(8460),d=c(844);class x extends d.Disposable{constructor(_){super(),this._core=_,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}a.BufferNamespaceApi=x},7975:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,u){return this._core.registerCsiHandler(c,m=>u(m.toArray()))}addCsiHandler(c,u){return this.registerCsiHandler(c,u)}registerDcsHandler(c,u){return this._core.registerDcsHandler(c,(m,d)=>u(m,d.toArray()))}addDcsHandler(c,u){return this.registerDcsHandler(c,u)}registerEscHandler(c,u){return this._core.registerEscHandler(c,u)}addEscHandler(c,u){return this.registerEscHandler(c,u)}registerOscHandler(c,u){return this._core.registerOscHandler(c,u)}addOscHandler(c,u){return this.registerOscHandler(c,u)}}},7090:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(l,a,c){var u=this&&this.__decorate||function(h,p,f,g){var b,w=arguments.length,k=w<3?p:g===null?g=Object.getOwnPropertyDescriptor(p,f):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,p,f,g);else for(var j=h.length-1;j>=0;j--)(b=h[j])&&(k=(w<3?b(k):w>3?b(p,f,k):b(p,f))||k);return w>3&&k&&Object.defineProperty(p,f,k),k},m=this&&this.__param||function(h,p){return function(f,g){p(f,g,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const d=c(8460),x=c(844),v=c(5295),_=c(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let y=a.BufferService=class extends x.Disposable{get buffer(){return this.buffers.active}constructor(h){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(h.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(h.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new v.BufferSet(h,this))}resize(h,p){this.cols=h,this.rows=p,this.buffers.resize(h,p),this._onResize.fire({cols:h,rows:p})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(h,p=!1){const f=this.buffer;let g;g=this._cachedBlankLine,g&&g.length===this.cols&&g.getFg(0)===h.fg&&g.getBg(0)===h.bg||(g=f.getBlankLine(h,p),this._cachedBlankLine=g),g.isWrapped=p;const b=f.ybase+f.scrollTop,w=f.ybase+f.scrollBottom;if(f.scrollTop===0){const k=f.lines.isFull;w===f.lines.length-1?k?f.lines.recycle().copyFrom(g):f.lines.push(g.clone()):f.lines.splice(w+1,0,g.clone()),k?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const k=w-b+1;f.lines.shiftElements(b+1,k-1,-1),f.lines.set(w,g.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(h,p,f){const g=this.buffer;if(h<0){if(g.ydisp===0)return;this.isUserScrolling=!0}else h+g.ydisp>=g.ybase&&(this.isUserScrolling=!1);const b=g.ydisp;g.ydisp=Math.max(Math.min(g.ydisp+h,g.ybase),0),b!==g.ydisp&&(p||this._onScroll.fire(g.ydisp))}};a.BufferService=y=u([m(0,_.IOptionsService)],y)},7994:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,u){this._charsets[c]=u,this.glevel===c&&(this.charset=u)}}},1753:function(l,a,c){var u=this&&this.__decorate||function(g,b,w,k){var j,S=arguments.length,E=S<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,w):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,b,w,k);else for(var N=g.length-1;N>=0;N--)(j=g[N])&&(E=(S<3?j(E):S>3?j(b,w,E):j(b,w))||E);return S>3&&E&&Object.defineProperty(b,w,E),E},m=this&&this.__param||function(g,b){return function(w,k){b(w,k,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const d=c(2585),x=c(8460),v=c(844),_={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:g=>g.button!==4&&g.action===1&&(g.ctrl=!1,g.alt=!1,g.shift=!1,!0)},VT200:{events:19,restrict:g=>g.action!==32},DRAG:{events:23,restrict:g=>g.action!==32||g.button!==3},ANY:{events:31,restrict:g=>!0}};function y(g,b){let w=(g.ctrl?16:0)|(g.shift?4:0)|(g.alt?8:0);return g.button===4?(w|=64,w|=g.action):(w|=3&g.button,4&g.button&&(w|=64),8&g.button&&(w|=128),g.action===32?w|=32:g.action!==0||b||(w|=3)),w}const h=String.fromCharCode,p={DEFAULT:g=>{const b=[y(g,!1)+32,g.col+32,g.row+32];return b[0]>255||b[1]>255||b[2]>255?"":`\x1B[M${h(b[0])}${h(b[1])}${h(b[2])}`},SGR:g=>{const b=g.action===0&&g.button!==4?"m":"M";return`\x1B[<${y(g,!0)};${g.col};${g.row}${b}`},SGR_PIXELS:g=>{const b=g.action===0&&g.button!==4?"m":"M";return`\x1B[<${y(g,!0)};${g.x};${g.y}${b}`}};let f=a.CoreMouseService=class extends v.Disposable{constructor(g,b){super(),this._bufferService=g,this._coreService=b,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new x.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const w of Object.keys(_))this.addProtocol(w,_[w]);for(const w of Object.keys(p))this.addEncoding(w,p[w]);this.reset()}addProtocol(g,b){this._protocols[g]=b}addEncoding(g,b){this._encodings[g]=b}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(g){if(!this._protocols[g])throw new Error(`unknown protocol "${g}"`);this._activeProtocol=g,this._onProtocolChange.fire(this._protocols[g].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(g){if(!this._encodings[g])throw new Error(`unknown encoding "${g}"`);this._activeEncoding=g}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(g){if(g.col<0||g.col>=this._bufferService.cols||g.row<0||g.row>=this._bufferService.rows||g.button===4&&g.action===32||g.button===3&&g.action!==32||g.button!==4&&(g.action===2||g.action===3)||(g.col++,g.row++,g.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,g,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(g))return!1;const b=this._encodings[this._activeEncoding](g);return b&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(b):this._coreService.triggerDataEvent(b,!0)),this._lastEvent=g,!0}explainEvents(g){return{down:!!(1&g),up:!!(2&g),drag:!!(4&g),move:!!(8&g),wheel:!!(16&g)}}_equalEvents(g,b,w){if(w){if(g.x!==b.x||g.y!==b.y)return!1}else if(g.col!==b.col||g.row!==b.row)return!1;return g.button===b.button&&g.action===b.action&&g.ctrl===b.ctrl&&g.alt===b.alt&&g.shift===b.shift}};a.CoreMouseService=f=u([m(0,d.IBufferService),m(1,d.ICoreService)],f)},6975:function(l,a,c){var u=this&&this.__decorate||function(f,g,b,w){var k,j=arguments.length,S=j<3?g:w===null?w=Object.getOwnPropertyDescriptor(g,b):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,g,b,w);else for(var E=f.length-1;E>=0;E--)(k=f[E])&&(S=(j<3?k(S):j>3?k(g,b,S):k(g,b))||S);return j>3&&S&&Object.defineProperty(g,b,S),S},m=this&&this.__param||function(f,g){return function(b,w){g(b,w,f)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const d=c(1439),x=c(8460),v=c(844),_=c(2585),y=Object.freeze({insertMode:!1}),h=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let p=a.CoreService=class extends v.Disposable{constructor(f,g,b){super(),this._bufferService=f,this._logService=g,this._optionsService=b,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new x.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new x.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new x.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new x.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(y),this.decPrivateModes=(0,d.clone)(h)}reset(){this.modes=(0,d.clone)(y),this.decPrivateModes=(0,d.clone)(h)}triggerDataEvent(f,g=!1){if(this._optionsService.rawOptions.disableStdin)return;const b=this._bufferService.buffer;g&&this._optionsService.rawOptions.scrollOnUserInput&&b.ybase!==b.ydisp&&this._onRequestScrollToBottom.fire(),g&&this._onUserInput.fire(),this._logService.debug(`sending data "${f}"`,()=>f.split("").map(w=>w.charCodeAt(0))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,()=>f.split("").map(g=>g.charCodeAt(0))),this._onBinary.fire(f))}};a.CoreService=p=u([m(0,_.IBufferService),m(1,_.ILogService),m(2,_.IOptionsService)],p)},9074:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const u=c(8055),m=c(8460),d=c(844),x=c(6106);let v=0,_=0;class y extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new x.SortedList(f=>f==null?void 0:f.marker.line),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>this.reset()))}registerDecoration(f){if(f.marker.isDisposed)return;const g=new h(f);if(g){const b=g.marker.onDispose(()=>g.dispose());g.onDispose(()=>{g&&(this._decorations.delete(g)&&this._onDecorationRemoved.fire(g),b.dispose())}),this._decorations.insert(g),this._onDecorationRegistered.fire(g)}return g}reset(){for(const f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,g,b){var w,k,j;let S=0,E=0;for(const N of this._decorations.getKeyIterator(g))S=(w=N.options.x)!==null&&w!==void 0?w:0,E=S+((k=N.options.width)!==null&&k!==void 0?k:1),f>=S&&f<E&&(!b||((j=N.options.layer)!==null&&j!==void 0?j:"bottom")===b)&&(yield N)}forEachDecorationAtCell(f,g,b,w){this._decorations.forEachByKey(g,k=>{var j,S,E;v=(j=k.options.x)!==null&&j!==void 0?j:0,_=v+((S=k.options.width)!==null&&S!==void 0?S:1),f>=v&&f<_&&(!b||((E=k.options.layer)!==null&&E!==void 0?E:"bottom")===b)&&w(k)})}}a.DecorationService=y;class h extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=u.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=u.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(f){super(),this.options=f,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=f.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const u=c(2585),m=c(8343);class d{constructor(...v){this._entries=new Map;for(const[_,y]of v)this.set(_,y)}set(v,_){const y=this._entries.get(v);return this._entries.set(v,_),y}forEach(v){for(const[_,y]of this._entries.entries())v(_,y)}has(v){return this._entries.has(v)}get(v){return this._entries.get(v)}}a.ServiceCollection=d,a.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(x,v){this._services.set(x,v)}getService(x){return this._services.get(x)}createInstance(x,...v){const _=(0,m.getServiceDependencies)(x).sort((p,f)=>p.index-f.index),y=[];for(const p of _){const f=this._services.get(p.id);if(!f)throw new Error(`[createInstance] ${x.name} depends on UNKNOWN service ${p.id}.`);y.push(f)}const h=_.length>0?_[0].index:v.length;if(v.length!==h)throw new Error(`[createInstance] First service dependency of ${x.name} at position ${h+1} conflicts with ${v.length} static arguments`);return new x(...v,...y)}}},7866:function(l,a,c){var u=this&&this.__decorate||function(h,p,f,g){var b,w=arguments.length,k=w<3?p:g===null?g=Object.getOwnPropertyDescriptor(p,f):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,p,f,g);else for(var j=h.length-1;j>=0;j--)(b=h[j])&&(k=(w<3?b(k):w>3?b(p,f,k):b(p,f))||k);return w>3&&k&&Object.defineProperty(p,f,k),k},m=this&&this.__param||function(h,p){return function(f,g){p(f,g,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const d=c(844),x=c(2585),v={trace:x.LogLevelEnum.TRACE,debug:x.LogLevelEnum.DEBUG,info:x.LogLevelEnum.INFO,warn:x.LogLevelEnum.WARN,error:x.LogLevelEnum.ERROR,off:x.LogLevelEnum.OFF};let _,y=a.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(h){super(),this._optionsService=h,this._logLevel=x.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),_=this}_updateLogLevel(){this._logLevel=v[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let p=0;p<h.length;p++)typeof h[p]=="function"&&(h[p]=h[p]())}_log(h,p,f){this._evalLazyOptionalParams(f),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...f)}trace(h,...p){var f,g;this._logLevel<=x.LogLevelEnum.TRACE&&this._log((g=(f=this._optionsService.options.logger)===null||f===void 0?void 0:f.trace.bind(this._optionsService.options.logger))!==null&&g!==void 0?g:console.log,h,p)}debug(h,...p){var f,g;this._logLevel<=x.LogLevelEnum.DEBUG&&this._log((g=(f=this._optionsService.options.logger)===null||f===void 0?void 0:f.debug.bind(this._optionsService.options.logger))!==null&&g!==void 0?g:console.log,h,p)}info(h,...p){var f,g;this._logLevel<=x.LogLevelEnum.INFO&&this._log((g=(f=this._optionsService.options.logger)===null||f===void 0?void 0:f.info.bind(this._optionsService.options.logger))!==null&&g!==void 0?g:console.info,h,p)}warn(h,...p){var f,g;this._logLevel<=x.LogLevelEnum.WARN&&this._log((g=(f=this._optionsService.options.logger)===null||f===void 0?void 0:f.warn.bind(this._optionsService.options.logger))!==null&&g!==void 0?g:console.warn,h,p)}error(h,...p){var f,g;this._logLevel<=x.LogLevelEnum.ERROR&&this._log((g=(f=this._optionsService.options.logger)===null||f===void 0?void 0:f.error.bind(this._optionsService.options.logger))!==null&&g!==void 0?g:console.error,h,p)}};a.LogService=y=u([m(0,x.IOptionsService)],y),a.setTraceLogger=function(h){_=h},a.traceCall=function(h,p,f){if(typeof f.value!="function")throw new Error("not supported");const g=f.value;f.value=function(...b){if(_.logLevel!==x.LogLevelEnum.TRACE)return g.apply(this,b);_.trace(`GlyphRenderer#${g.name}(${b.map(k=>JSON.stringify(k)).join(", ")})`);const w=g.apply(this,b);return _.trace(`GlyphRenderer#${g.name} return`,w),w}}},7302:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const u=c(8460),m=c(844),d=c(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const x=["normal","bold","100","200","300","400","500","600","700","800","900"];class v extends m.Disposable{constructor(y){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const h=Object.assign({},a.DEFAULT_OPTIONS);for(const p in y)if(p in h)try{const f=y[p];h[p]=this._sanitizeAndValidateOption(p,f)}catch(f){console.error(f)}this.rawOptions=h,this.options=Object.assign({},h),this._setupOptions()}onSpecificOptionChange(y,h){return this.onOptionChange(p=>{p===y&&h(this.rawOptions[y])})}onMultipleOptionChange(y,h){return this.onOptionChange(p=>{y.indexOf(p)!==-1&&h()})}_setupOptions(){const y=p=>{if(!(p in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);return this.rawOptions[p]},h=(p,f)=>{if(!(p in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);f=this._sanitizeAndValidateOption(p,f),this.rawOptions[p]!==f&&(this.rawOptions[p]=f,this._onOptionChange.fire(p))};for(const p in this.rawOptions){const f={get:y.bind(this,p),set:h.bind(this,p)};Object.defineProperty(this.options,p,f)}}_sanitizeAndValidateOption(y,h){switch(y){case"cursorStyle":if(h||(h=a.DEFAULT_OPTIONS[y]),!function(p){return p==="block"||p==="underline"||p==="bar"}(h))throw new Error(`"${h}" is not a valid value for ${y}`);break;case"wordSeparator":h||(h=a.DEFAULT_OPTIONS[y]);break;case"fontWeight":case"fontWeightBold":if(typeof h=="number"&&1<=h&&h<=1e3)break;h=x.includes(h)?h:a.DEFAULT_OPTIONS[y];break;case"cursorWidth":h=Math.floor(h);case"lineHeight":case"tabStopWidth":if(h<1)throw new Error(`${y} cannot be less than 1, value: ${h}`);break;case"minimumContrastRatio":h=Math.max(1,Math.min(21,Math.round(10*h)/10));break;case"scrollback":if((h=Math.min(h,4294967295))<0)throw new Error(`${y} cannot be less than 0, value: ${h}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(h<=0)throw new Error(`${y} cannot be less than or equal to 0, value: ${h}`);break;case"rows":case"cols":if(!h&&h!==0)throw new Error(`${y} must be numeric, value: ${h}`);break;case"windowsPty":h=h??{}}return h}}a.OptionsService=v},2660:function(l,a,c){var u=this&&this.__decorate||function(v,_,y,h){var p,f=arguments.length,g=f<3?_:h===null?h=Object.getOwnPropertyDescriptor(_,y):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(v,_,y,h);else for(var b=v.length-1;b>=0;b--)(p=v[b])&&(g=(f<3?p(g):f>3?p(_,y,g):p(_,y))||g);return f>3&&g&&Object.defineProperty(_,y,g),g},m=this&&this.__param||function(v,_){return function(y,h){_(y,h,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const d=c(2585);let x=a.OscLinkService=class{constructor(v){this._bufferService=v,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(v){const _=this._bufferService.buffer;if(v.id===void 0){const b=_.addMarker(_.ybase+_.y),w={data:v,id:this._nextId++,lines:[b]};return b.onDispose(()=>this._removeMarkerFromLink(w,b)),this._dataByLinkId.set(w.id,w),w.id}const y=v,h=this._getEntryIdKey(y),p=this._entriesWithId.get(h);if(p)return this.addLineToLink(p.id,_.ybase+_.y),p.id;const f=_.addMarker(_.ybase+_.y),g={id:this._nextId++,key:this._getEntryIdKey(y),data:y,lines:[f]};return f.onDispose(()=>this._removeMarkerFromLink(g,f)),this._entriesWithId.set(g.key,g),this._dataByLinkId.set(g.id,g),g.id}addLineToLink(v,_){const y=this._dataByLinkId.get(v);if(y&&y.lines.every(h=>h.line!==_)){const h=this._bufferService.buffer.addMarker(_);y.lines.push(h),h.onDispose(()=>this._removeMarkerFromLink(y,h))}}getLinkData(v){var _;return(_=this._dataByLinkId.get(v))===null||_===void 0?void 0:_.data}_getEntryIdKey(v){return`${v.id};;${v.uri}`}_removeMarkerFromLink(v,_){const y=v.lines.indexOf(_);y!==-1&&(v.lines.splice(y,1),v.lines.length===0&&(v.data.id!==void 0&&this._entriesWithId.delete(v.key),this._dataByLinkId.delete(v.id)))}};a.OscLinkService=x=u([m(0,d.IBufferService)],x)},8343:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const c="di$target",u="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(m){return m[u]||[]},a.createDecorator=function(m){if(a.serviceRegistry.has(m))return a.serviceRegistry.get(m);const d=function(x,v,_){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,h,p){h[c]===h?h[u].push({id:y,index:p}):(h[u]=[{id:y,index:p}],h[c]=h)})(d,x,_)};return d.toString=()=>m,a.serviceRegistry.set(m,d),d}},2585:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const u=c(8343);var m;a.IBufferService=(0,u.createDecorator)("BufferService"),a.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),a.ICoreService=(0,u.createDecorator)("CoreService"),a.ICharsetService=(0,u.createDecorator)("CharsetService"),a.IInstantiationService=(0,u.createDecorator)("InstantiationService"),function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(m||(a.LogLevelEnum=m={})),a.ILogService=(0,u.createDecorator)("LogService"),a.IOptionsService=(0,u.createDecorator)("OptionsService"),a.IOscLinkService=(0,u.createDecorator)("OscLinkService"),a.IUnicodeService=(0,u.createDecorator)("UnicodeService"),a.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(l,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const u=c(8460),m=c(225);a.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const d=new m.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let x=0;const v=d.length;for(let _=0;_<v;++_){let y=d.charCodeAt(_);if(55296<=y&&y<=56319){if(++_>=v)return x+this.wcwidth(y);const h=d.charCodeAt(_);56320<=h&&h<=57343?y=1024*(y-55296)+h-56320+65536:x+=this.wcwidth(h)}x+=this.wcwidth(y)}return x}}}},n={};function s(l){var a=n[l];if(a!==void 0)return a.exports;var c=n[l]={exports:{}};return r[l].call(c.exports,c,c.exports,s),c.exports}var i={};return(()=>{var l=i;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const a=s(9042),c=s(3236),u=s(844),m=s(5741),d=s(8285),x=s(7975),v=s(7090),_=["cols","rows"];class y extends u.Disposable{constructor(p){super(),this._core=this.register(new c.Terminal(p)),this._addonManager=this.register(new m.AddonManager),this._publicOptions=Object.assign({},this._core.options);const f=b=>this._core.options[b],g=(b,w)=>{this._checkReadonlyOptions(b),this._core.options[b]=w};for(const b in this._core.options){const w={get:f.bind(this,b),set:g.bind(this,b)};Object.defineProperty(this._publicOptions,b,w)}}_checkReadonlyOptions(p){if(_.includes(p))throw new Error(`Option "${p}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new x.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new v.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const p=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:p.applicationCursorKeys,applicationKeypadMode:p.applicationKeypad,bracketedPasteMode:p.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:p.origin,reverseWraparoundMode:p.reverseWraparound,sendFocusMode:p.sendFocus,wraparoundMode:p.wraparound}}get options(){return this._publicOptions}set options(p){for(const f in p)this._publicOptions[f]=p[f]}blur(){this._core.blur()}focus(){this._core.focus()}resize(p,f){this._verifyIntegers(p,f),this._core.resize(p,f)}open(p){this._core.open(p)}attachCustomKeyEventHandler(p){this._core.attachCustomKeyEventHandler(p)}registerLinkProvider(p){return this._core.registerLinkProvider(p)}registerCharacterJoiner(p){return this._checkProposedApi(),this._core.registerCharacterJoiner(p)}deregisterCharacterJoiner(p){this._checkProposedApi(),this._core.deregisterCharacterJoiner(p)}registerMarker(p=0){return this._verifyIntegers(p),this._core.registerMarker(p)}registerDecoration(p){var f,g,b;return this._checkProposedApi(),this._verifyPositiveIntegers((f=p.x)!==null&&f!==void 0?f:0,(g=p.width)!==null&&g!==void 0?g:0,(b=p.height)!==null&&b!==void 0?b:0),this._core.registerDecoration(p)}hasSelection(){return this._core.hasSelection()}select(p,f,g){this._verifyIntegers(p,f,g),this._core.select(p,f,g)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(p,f){this._verifyIntegers(p,f),this._core.selectLines(p,f)}dispose(){super.dispose()}scrollLines(p){this._verifyIntegers(p),this._core.scrollLines(p)}scrollPages(p){this._verifyIntegers(p),this._core.scrollPages(p)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(p){this._verifyIntegers(p),this._core.scrollToLine(p)}clear(){this._core.clear()}write(p,f){this._core.write(p,f)}writeln(p,f){this._core.write(p),this._core.write(`\r
|
|
201
|
+
`,f)}paste(p){this._core.paste(p)}refresh(p,f){this._verifyIntegers(p,f),this._core.refresh(p,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(p){this._addonManager.loadAddon(this,p)}static get strings(){return a}_verifyIntegers(...p){for(const f of p)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...p){for(const f of p)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}l.Terminal=y})(),i})())})(xS);var eT=xS.exports,_S={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={};return(()=>{var n=r;Object.defineProperty(n,"__esModule",{value:!0}),n.FitAddon=void 0,n.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const l=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(a.getPropertyValue("height")),u=Math.max(0,parseInt(a.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),d=c-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),x=u-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-l;return{cols:Math.max(2,Math.floor(x/i.css.cell.width)),rows:Math.max(1,Math.floor(d/i.css.cell.height))}}}})(),r})())})(_S);var tT=_S.exports,bS={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={6:(l,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(u,m,d,x={}){this._terminal=u,this._regex=m,this._handler=d,this._options=x}provideLinks(u,m){const d=c.computeLink(u,this._regex,this._terminal,this._handler);m(this._addCallbacks(d))}_addCallbacks(u){return u.map(m=>(m.leave=this._options.leave,m.hover=(d,x)=>{if(this._options.hover){const{range:v}=m;this._options.hover(d,x,v)}},m))}};class c{static computeLink(m,d,x,v){const _=new RegExp(d.source,(d.flags||"")+"g"),[y,h]=c._getWindowedLineStrings(m-1,x),p=y.join("");let f;const g=[];for(;f=_.exec(p);){const b=f[0];try{const N=new URL(b),O=decodeURI(N.toString());if(b!==O&&b+"/"!==O)continue}catch{continue}const[w,k]=c._mapStrIdx(x,h,0,f.index),[j,S]=c._mapStrIdx(x,w,k,b.length);if(w===-1||k===-1||j===-1||S===-1)continue;const E={start:{x:k+1,y:w+1},end:{x:S,y:j+1}};g.push({range:E,text:b,activate:v})}return g}static _getWindowedLineStrings(m,d){let x,v=m,_=m,y=0,h="";const p=[];if(x=d.buffer.active.getLine(m)){const f=x.translateToString(!0);if(x.isWrapped&&f[0]!==" "){for(y=0;(x=d.buffer.active.getLine(--v))&&y<2048&&(h=x.translateToString(!0),y+=h.length,p.push(h),x.isWrapped&&h.indexOf(" ")===-1););p.reverse()}for(p.push(f),y=0;(x=d.buffer.active.getLine(++_))&&x.isWrapped&&y<2048&&(h=x.translateToString(!0),y+=h.length,p.push(h),h.indexOf(" ")===-1););}return[p,v]}static _mapStrIdx(m,d,x,v){const _=m.buffer.active,y=_.getNullCell();let h=x;for(;v;){const p=_.getLine(d);if(!p)return[-1,-1];for(let f=h;f<p.length;++f){p.getCell(f,y);const g=y.getChars();if(y.getWidth()&&(v-=g.length||1,f===p.length-1&&g==="")){const b=_.getLine(d+1);b&&b.isWrapped&&(b.getCell(0,y),y.getWidth()===2&&(v+=1))}if(v<0)return[d,f]}d++,h=0}return[d,h]}}a.LinkComputer=c}},n={};function s(l){var a=n[l];if(a!==void 0)return a.exports;var c=n[l]={exports:{}};return r[l](c,c.exports,s),c.exports}var i={};return(()=>{var l=i;Object.defineProperty(l,"__esModule",{value:!0}),l.WebLinksAddon=void 0;const a=s(6),c=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(m,d){const x=window.open();if(x){try{x.opener=null}catch{}x.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}l.WebLinksAddon=class{constructor(m=u,d={}){this._handler=m,this._options=d}activate(m){this._terminal=m;const d=this._options,x=d.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,x,this._handler,d))}dispose(){var m;(m=this._linkProvider)===null||m===void 0||m.dispose()}}})(),i})())})(bS);var rT=bS.exports;const nT=vd("inline-flex items-center rounded-sm border px-1.5 py-0.5 font-mono text-[10px] font-medium uppercase tracking-[0.14em] transition-colors",{variants:{variant:{default:"border-transparent bg-[var(--accent-sky)] text-[var(--bg-sunken)]",secondary:"border-transparent bg-[var(--bg-sunken)] text-[var(--fg-muted)]",destructive:"border-[var(--severity-blocking-border)] bg-[var(--severity-blocking-bg)] text-[var(--severity-blocking-fg)]",warning:"border-[var(--severity-warning-border)] bg-[var(--severity-warning-bg)] text-[var(--severity-warning-fg)]",success:"border-[var(--severity-success-border)] bg-[var(--severity-success-bg)] text-[var(--severity-success-fg)]",outline:"border-[var(--border)] bg-transparent text-[var(--fg)]",pill:"rounded-full border-[var(--wane)] bg-transparent text-[var(--wane)] normal-case tracking-[0.12em] px-1.5"}},defaultVariants:{variant:"default"}});function Se({className:e,variant:t,...r}){return o.jsx("span",{className:ee(nT({variant:t}),e),...r})}function wS({agentGated:e=!1}={}){const t=C.useRef(null),[r,n]=C.useState(null),[s,i]=C.useState(!1),[l,a]=C.useState(!1),[c,u]=C.useState(null);C.useEffect(()=>{if(!t.current)return;let d=!1,x=null,v=null,_=null;const y=window.location.protocol==="https:"?"wss":"ws",h=new WebSocket(`${y}://${window.location.host}/api/agent/ws`),p=()=>{if(v||!t.current)return v;const f=new eT.Terminal({fontFamily:'"JetBrains Mono", ui-monospace, Menlo, monospace',fontSize:13,lineHeight:1.3,letterSpacing:0,theme:{background:"#070d18",foreground:"#f2f7fc",cursor:"#dcb866",selectionBackground:"#1f3a66",black:"#0c1628",red:"#a85a5a",green:"#6a9b8f",yellow:"#dcb866",blue:"#7aa7dc",magenta:"#7a6db0",cyan:"#a8c8ea",white:"#a4b0c2",brightBlack:"#33394a",brightRed:"#c87a7a",brightGreen:"#8abbaf",brightYellow:"#ead08e",brightBlue:"#a8c8ea",brightMagenta:"#9a8dd0",brightCyan:"#cbdef3",brightWhite:"#f2f7fc"},convertEol:!0,scrollback:5e3,allowProposedApi:!0}),g=new tT.FitAddon;f.loadAddon(g),f.loadAddon(new rT.WebLinksAddon),f.open(t.current);const b=()=>{if(!(d||!t.current)&&!(t.current.offsetWidth===0||t.current.offsetHeight===0))try{g.fit()}catch{}};return x=window.requestAnimationFrame(b),_=new ResizeObserver(()=>{b()}),_.observe(t.current),f.onData(w=>{h.readyState===WebSocket.OPEN&&h.send(JSON.stringify({kind:"input",data:w}))}),f.onResize(({cols:w,rows:k})=>{h.readyState===WebSocket.OPEN&&h.send(JSON.stringify({kind:"resize",cols:w,rows:k}))}),v=f,f};return h.onopen=()=>{i(!0),p()},h.onclose=()=>i(!1),h.onerror=()=>i(!1),h.onmessage=f=>{try{const g=JSON.parse(f.data);g.kind==="data"&&typeof g.data=="string"?v==null||v.write(g.data):g.kind==="meta"?(n({active:!!g.autoMode,reason:g.reason??""}),typeof g.agentReady=="boolean"&&a(g.agentReady)):g.kind==="auth_url"&&typeof g.url=="string"||(g.kind==="error"?g.recoverable&&g.remediation?u({message:g.message??"agent failed to start",remediation:g.remediation}):v==null||v.write(`\r
|
|
202
|
+
\x1B[31m[error] ${g.message??"unknown error"}\x1B[0m\r
|
|
203
|
+
`):g.kind==="exit"&&(v==null||v.write(`\r
|
|
204
|
+
\x1B[33m[claude session exited]\x1B[0m\r
|
|
205
|
+
`)))}catch{}},()=>{d=!0,x!==null&&window.cancelAnimationFrame(x),h.close(),_==null||_.disconnect(),v==null||v.dispose()}},[]);const m=e&&!l;return o.jsxs("div",{className:"flex h-full w-full flex-col bg-[var(--bg-sunken)]",children:[o.jsxs("div",{className:"flex items-center justify-between border-b border-border bg-[var(--bg-elevated)] px-4 py-2",children:[o.jsx("span",{className:ee("font-mono text-[11px] tracking-[0.05em]",s?"text-[var(--vow-green)]":"text-[var(--fg-dim)]"),children:s?"● connected":"○ disconnected"}),r&&o.jsx(Se,{variant:r.active?"warning":"secondary",title:r.active?"Claude Code Auto Mode is active":r.reason,children:r.active?"Auto Mode":"Default permissions"})]}),c&&o.jsxs(Ye,{variant:"blocking",className:"m-3 flex flex-col gap-2",children:[o.jsx(Nt,{className:"text-[var(--break-red)]",children:"Agent panel unavailable"}),o.jsx(Xe,{className:"font-mono text-xs text-[var(--fg-muted)]",children:c.message}),c.remediation&&o.jsxs("p",{className:"font-mono text-xs text-[var(--fg-dim)]",children:[o.jsx("span",{className:"text-[var(--fg-muted)]",children:"Fix · "}),c.remediation]})]}),o.jsx("div",{ref:t,className:ee("w-full flex-1 bg-[var(--bg-sunken)] p-3","min-h-[400px]",m&&"invisible hidden")}),m&&!c&&o.jsx(sT,{})]})}function sT(){return o.jsx("div",{className:"flex w-full flex-1 items-center justify-center bg-[var(--bg-sunken)] px-6",children:o.jsxs("div",{className:"flex max-w-[34ch] flex-col items-center gap-4 text-center",children:[o.jsx("span",{"aria-hidden":"true",className:"jinn-anim-pulse h-2 w-2 rounded-full bg-[var(--seer-violet)]"}),o.jsx("p",{className:"font-mono text-xs text-[var(--fg-muted)]",children:"The agent will come online once harness setup is complete."})]})})}const iT={pluginBuilderUi:!1,embeddedAgent:!1};function tg(){const e=typeof window>"u"?void 0:window.__JINN_FEATURES__;return!e||typeof e!="object"?iT:{pluginBuilderUi:e.pluginBuilderUi===!0,embeddedAgent:e.embeddedAgent===!0}}function oT({envelope:e,chainExplorerBase:t}){const r=aT(e),n=lT(e.generatedAt),[s,i]=C.useState("idle"),[l,a]=C.useState(null),c=e.details,m=(typeof(c==null?void 0:c.category)=="string"?c.category:void 0)==="insufficient_funds",d=typeof(c==null?void 0:c.address)=="string"?c.address:null,x=typeof(c==null?void 0:c.requiredWei)=="string"?c.requiredWei:typeof(c==null?void 0:c.needWei)=="string"?c.needWei:null,v=typeof(c==null?void 0:c.haveWei)=="string"?c.haveWei:null,y=(typeof(c==null?void 0:c.txHash)=="string"?c.txHash:null)??r,h=C.useCallback(async()=>{i("retrying"),a(null);try{await me.retryBootstrap(),i("success")}catch(p){i("error"),a(p instanceof Error?p.message:String(p))}},[]);return o.jsxs(Ye,{variant:"blocking",className:"flex flex-col gap-3 px-5 py-4",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsxs(Nt,{className:"text-[var(--break-red)]",children:["Bootstrap halted · ",e.code]}),n&&o.jsx("span",{className:"font-mono text-[10px] text-[var(--fg-dim)]",children:n})]}),o.jsx(Xe,{className:"break-words font-mono text-xs text-foreground",children:e.message}),m&&d&&o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Rc,{label:"Send ETH to",children:d}),x&&o.jsx(Rc,{label:"Required",children:vh(x)}),v&&o.jsx(Rc,{label:"Currently have",children:vh(v)}),x&&v&&o.jsx(Rc,{label:"Shortfall",children:vh((BigInt(x)-BigInt(v)).toString())})]}),!m&&e.hint&&o.jsxs("p",{className:"font-mono text-xs text-[var(--fg-muted)]",children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Fix · "}),e.hint]}),y&&o.jsx(ie,{asChild:!0,variant:"link",size:"sm",className:"self-start px-0",children:o.jsxs("a",{href:`${t}/tx/${y}`,target:"_blank",rel:"noopener noreferrer",children:["view failed tx",o.jsx(Ao,{})]})}),o.jsxs("div",{className:"mt-1 flex items-center gap-3",children:[o.jsx(ie,{variant:"destructive",size:"sm",type:"button",onClick:()=>{h()},disabled:s==="retrying",children:s==="retrying"?"Retrying…":s==="success"?"Resuming…":"Retry"}),s==="success"&&o.jsx("span",{className:"font-mono text-[11px] text-[var(--fg-muted)]",children:"Daemon resumed — waiting for bootstrap to complete"}),s==="error"&&l&&o.jsx("span",{className:"font-mono text-[11px] text-[var(--break-red)]",children:l})]}),s==="idle"&&o.jsxs("p",{className:"font-mono text-[11px] text-[var(--fg-dim)]",children:["Once you've addressed the cause above, click Retry or"," ",o.jsx("code",{className:"text-[var(--fg-muted)]",children:"jinn run"})," to resume from the persisted state."]})]})}function Rc({label:e,children:t}){return o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"min-w-[100px] shrink-0 font-mono text-[11px] text-[var(--fg-dim)]",children:e}),o.jsx("span",{className:"break-all font-mono text-[11px] text-foreground",children:t})]})}function vh(e){try{const t=BigInt(e),r=Number(t)/1e18;return r===0?"0 ETH":r<1e-6?`${t} wei`:`${r.toFixed(6).replace(/\.?0+$/,"")} ETH`}catch{return e}}function aT(e){var r,n;const t=[(r=e.details)==null?void 0:r.txHash,(n=e.details)==null?void 0:n.cause,e.message];for(const s of t){if(typeof s!="string")continue;const i=/(0x[a-fA-F0-9]{64})/.exec(s);if(i)return i[1]}return null}function lT(e){try{const t=Date.now()-Date.parse(e);if(!Number.isFinite(t)||t<0)return null;const r=Math.round(t/1e3);if(r<60)return`${r}s ago`;const n=Math.round(r/60);return n<60?`${n}m ago`:`${Math.round(n/60)}h ago`}catch{return null}}function cT(e,t=globalThis==null?void 0:globalThis.document){const r=Ht(e);C.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var uT="DismissableLayer",tp="dismissableLayer.update",dT="dismissableLayer.pointerDownOutside",hT="dismissableLayer.focusOutside",Ox,SS=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Yl=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:l,onDismiss:a,...c}=e,u=C.useContext(SS),[m,d]=C.useState(null),x=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=C.useState({}),_=Be(t,j=>d(j)),y=Array.from(u.layers),[h]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),p=y.indexOf(h),f=m?y.indexOf(m):-1,g=u.layersWithOutsidePointerEventsDisabled.size>0,b=f>=p,w=mT(j=>{const S=j.target,E=[...u.branches].some(N=>N.contains(S));!b||E||(s==null||s(j),l==null||l(j),j.defaultPrevented||a==null||a())},x),k=gT(j=>{const S=j.target;[...u.branches].some(N=>N.contains(S))||(i==null||i(j),l==null||l(j),j.defaultPrevented||a==null||a())},x);return cT(j=>{f===u.layers.size-1&&(n==null||n(j),!j.defaultPrevented&&a&&(j.preventDefault(),a()))},x),C.useEffect(()=>{if(m)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ox=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(m)),u.layers.add(m),Mx(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=Ox)}},[m,x,r,u]),C.useEffect(()=>()=>{m&&(u.layers.delete(m),u.layersWithOutsidePointerEventsDisabled.delete(m),Mx())},[m,u]),C.useEffect(()=>{const j=()=>v({});return document.addEventListener(tp,j),()=>document.removeEventListener(tp,j)},[]),o.jsx($e.div,{...c,ref:_,style:{pointerEvents:g?b?"auto":"none":void 0,...e.style},onFocusCapture:ye(e.onFocusCapture,k.onFocusCapture),onBlurCapture:ye(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:ye(e.onPointerDownCapture,w.onPointerDownCapture)})});Yl.displayName=uT;var fT="DismissableLayerBranch",pT=C.forwardRef((e,t)=>{const r=C.useContext(SS),n=C.useRef(null),s=Be(t,n);return C.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),o.jsx($e.div,{...e,ref:s})});pT.displayName=fT;function mT(e,t=globalThis==null?void 0:globalThis.document){const r=Ht(e),n=C.useRef(!1),s=C.useRef(()=>{});return C.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let c=function(){CS(dT,r,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);n.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function gT(e,t=globalThis==null?void 0:globalThis.document){const r=Ht(e),n=C.useRef(!1);return C.useEffect(()=>{const s=i=>{i.target&&!n.current&&CS(hT,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Mx(){const e=new CustomEvent(tp);document.dispatchEvent(e)}function CS(e,t,r,{discrete:n}){const s=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?Zw(s,i):s.dispatchEvent(i)}var vT=Xu[" useId ".trim().toString()]||(()=>{}),xT=0;function Vs(e){const[t,r]=C.useState(vT());return ts(()=>{r(n=>n??String(xT++))},[e]),t?`radix-${t}`:""}const yT=["top","right","bottom","left"],Xs=Math.min,yr=Math.max,Au=Math.round,Nc=Math.floor,Pn=e=>({x:e,y:e}),_T={left:"right",right:"left",bottom:"top",top:"bottom"};function rp(e,t,r){return yr(e,Xs(t,r))}function rs(e,t){return typeof e=="function"?e(t):e}function ns(e){return e.split("-")[0]}function _a(e){return e.split("-")[1]}function rg(e){return e==="x"?"y":"x"}function ng(e){return e==="y"?"height":"width"}function jn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function sg(e){return rg(jn(e))}function bT(e,t,r){r===void 0&&(r=!1);const n=_a(e),s=sg(e),i=ng(s);let l=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Du(l)),[l,Du(l)]}function wT(e){const t=Du(e);return[np(e),t,np(t)]}function np(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ix=["left","right"],Fx=["right","left"],ST=["top","bottom"],CT=["bottom","top"];function kT(e,t,r){switch(e){case"top":case"bottom":return r?t?Fx:Ix:t?Ix:Fx;case"left":case"right":return t?ST:CT;default:return[]}}function ET(e,t,r,n){const s=_a(e);let i=kT(ns(e),r==="start",n);return s&&(i=i.map(l=>l+"-"+s),t&&(i=i.concat(i.map(np)))),i}function Du(e){const t=ns(e);return _T[t]+e.slice(t.length)}function jT(e){return{top:0,right:0,bottom:0,left:0,...e}}function kS(e){return typeof e!="number"?jT(e):{top:e,right:e,bottom:e,left:e}}function Lu(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function Bx(e,t,r){let{reference:n,floating:s}=e;const i=jn(t),l=sg(t),a=ng(l),c=ns(t),u=i==="y",m=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,x=n[a]/2-s[a]/2;let v;switch(c){case"top":v={x:m,y:n.y-s.height};break;case"bottom":v={x:m,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:d};break;case"left":v={x:n.x-s.width,y:d};break;default:v={x:n.x,y:n.y}}switch(_a(t)){case"start":v[l]-=x*(r&&u?-1:1);break;case"end":v[l]+=x*(r&&u?-1:1);break}return v}async function RT(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:i,rects:l,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:m="viewport",elementContext:d="floating",altBoundary:x=!1,padding:v=0}=rs(t,e),_=kS(v),h=a[x?d==="floating"?"reference":"floating":d],p=Lu(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(h)))==null||r?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:m,strategy:c})),f=d==="floating"?{x:n,y:s,width:l.floating.width,height:l.floating.height}:l.reference,g=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(g))?await(i.getScale==null?void 0:i.getScale(g))||{x:1,y:1}:{x:1,y:1},w=Lu(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:f,offsetParent:g,strategy:c}):f);return{top:(p.top-w.top+_.top)/b.y,bottom:(w.bottom-p.bottom+_.bottom)/b.y,left:(p.left-w.left+_.left)/b.x,right:(w.right-p.right+_.right)/b.x}}const NT=50,PT=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:l}=r,a=l.detectOverflow?l:{...l,detectOverflow:RT},c=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:m,y:d}=Bx(u,n,c),x=n,v=0;const _={};for(let y=0;y<i.length;y++){const h=i[y];if(!h)continue;const{name:p,fn:f}=h,{x:g,y:b,data:w,reset:k}=await f({x:m,y:d,initialPlacement:n,placement:x,strategy:s,middlewareData:_,rects:u,platform:a,elements:{reference:e,floating:t}});m=g??m,d=b??d,_[p]={..._[p],...w},k&&v<NT&&(v++,typeof k=="object"&&(k.placement&&(x=k.placement),k.rects&&(u=k.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):k.rects),{x:m,y:d}=Bx(u,x,c)),y=-1)}return{x:m,y:d,placement:x,strategy:s,middlewareData:_}},TT=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:i,platform:l,elements:a,middlewareData:c}=t,{element:u,padding:m=0}=rs(e,t)||{};if(u==null)return{};const d=kS(m),x={x:r,y:n},v=sg(s),_=ng(v),y=await l.getDimensions(u),h=v==="y",p=h?"top":"left",f=h?"bottom":"right",g=h?"clientHeight":"clientWidth",b=i.reference[_]+i.reference[v]-x[v]-i.floating[_],w=x[v]-i.reference[v],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let j=k?k[g]:0;(!j||!await(l.isElement==null?void 0:l.isElement(k)))&&(j=a.floating[g]||i.floating[_]);const S=b/2-w/2,E=j/2-y[_]/2-1,N=Xs(d[p],E),O=Xs(d[f],E),T=N,L=j-y[_]-O,$=j/2-y[_]/2+S,U=rp(T,$,L),z=!c.arrow&&_a(s)!=null&&$!==U&&i.reference[_]/2-($<T?N:O)-y[_]/2<0,K=z?$<T?$-T:$-L:0;return{[v]:x[v]+K,data:{[v]:U,centerOffset:$-U-K,...z&&{alignmentOffset:K}},reset:z}}}),AT=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:i,rects:l,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:m=!0,crossAxis:d=!0,fallbackPlacements:x,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:y=!0,...h}=rs(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const p=ns(s),f=jn(a),g=ns(a)===a,b=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=x||(g||!y?[Du(a)]:wT(a)),k=_!=="none";!x&&k&&w.push(...ET(a,y,_,b));const j=[a,...w],S=await c.detectOverflow(t,h),E=[];let N=((n=i.flip)==null?void 0:n.overflows)||[];if(m&&E.push(S[p]),d){const $=bT(s,l,b);E.push(S[$[0]],S[$[1]])}if(N=[...N,{placement:s,overflows:E}],!E.every($=>$<=0)){var O,T;const $=(((O=i.flip)==null?void 0:O.index)||0)+1,U=j[$];if(U&&(!(d==="alignment"?f!==jn(U):!1)||N.every(R=>jn(R.placement)===f?R.overflows[0]>0:!0)))return{data:{index:$,overflows:N},reset:{placement:U}};let z=(T=N.filter(K=>K.overflows[0]<=0).sort((K,R)=>K.overflows[1]-R.overflows[1])[0])==null?void 0:T.placement;if(!z)switch(v){case"bestFit":{var L;const K=(L=N.filter(R=>{if(k){const P=jn(R.placement);return P===f||P==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(P=>P>0).reduce((P,D)=>P+D,0)]).sort((R,P)=>R[1]-P[1])[0])==null?void 0:L[0];K&&(z=K);break}case"initialPlacement":z=a;break}if(s!==z)return{reset:{placement:z}}}return{}}}};function $x(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Hx(e){return yT.some(t=>e[t]>=0)}const DT=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:s="referenceHidden",...i}=rs(e,t);switch(s){case"referenceHidden":{const l=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=$x(l,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Hx(a)}}}case"escaped":{const l=await n.detectOverflow(t,{...i,altBoundary:!0}),a=$x(l,r.floating);return{data:{escapedOffsets:a,escaped:Hx(a)}}}default:return{}}}}},ES=new Set(["left","top"]);async function LT(e,t){const{placement:r,platform:n,elements:s}=e,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),l=ns(r),a=_a(r),c=jn(r)==="y",u=ES.has(l)?-1:1,m=i&&c?-1:1,d=rs(t,e);let{mainAxis:x,crossAxis:v,alignmentAxis:_}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof _=="number"&&(v=a==="end"?_*-1:_),c?{x:v*m,y:x*u}:{x:x*u,y:v*m}}const OT=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:i,placement:l,middlewareData:a}=t,c=await LT(t,e);return l===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:l}}}}},MT=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s,platform:i}=t,{mainAxis:l=!0,crossAxis:a=!1,limiter:c={fn:p=>{let{x:f,y:g}=p;return{x:f,y:g}}},...u}=rs(e,t),m={x:r,y:n},d=await i.detectOverflow(t,u),x=jn(ns(s)),v=rg(x);let _=m[v],y=m[x];if(l){const p=v==="y"?"top":"left",f=v==="y"?"bottom":"right",g=_+d[p],b=_-d[f];_=rp(g,_,b)}if(a){const p=x==="y"?"top":"left",f=x==="y"?"bottom":"right",g=y+d[p],b=y-d[f];y=rp(g,y,b)}const h=c.fn({...t,[v]:_,[x]:y});return{...h,data:{x:h.x-r,y:h.y-n,enabled:{[v]:l,[x]:a}}}}}},IT=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:i,middlewareData:l}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=rs(e,t),m={x:r,y:n},d=jn(s),x=rg(d);let v=m[x],_=m[d];const y=rs(a,t),h=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const g=x==="y"?"height":"width",b=i.reference[x]-i.floating[g]+h.mainAxis,w=i.reference[x]+i.reference[g]-h.mainAxis;v<b?v=b:v>w&&(v=w)}if(u){var p,f;const g=x==="y"?"width":"height",b=ES.has(ns(s)),w=i.reference[d]-i.floating[g]+(b&&((p=l.offset)==null?void 0:p[d])||0)+(b?0:h.crossAxis),k=i.reference[d]+i.reference[g]+(b?0:((f=l.offset)==null?void 0:f[d])||0)-(b?h.crossAxis:0);_<w?_=w:_>k&&(_=k)}return{[x]:v,[d]:_}}}},FT=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:i,platform:l,elements:a}=t,{apply:c=()=>{},...u}=rs(e,t),m=await l.detectOverflow(t,u),d=ns(s),x=_a(s),v=jn(s)==="y",{width:_,height:y}=i.floating;let h,p;d==="top"||d==="bottom"?(h=d,p=x===(await(l.isRTL==null?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(p=d,h=x==="end"?"top":"bottom");const f=y-m.top-m.bottom,g=_-m.left-m.right,b=Xs(y-m[h],f),w=Xs(_-m[p],g),k=!t.middlewareData.shift;let j=b,S=w;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(S=g),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(j=f),k&&!x){const N=yr(m.left,0),O=yr(m.right,0),T=yr(m.top,0),L=yr(m.bottom,0);v?S=_-2*(N!==0||O!==0?N+O:yr(m.left,m.right)):j=y-2*(T!==0||L!==0?T+L:yr(m.top,m.bottom))}await c({...t,availableWidth:S,availableHeight:j});const E=await l.getDimensions(a.floating);return _!==E.width||y!==E.height?{reset:{rects:!0}}:{}}}};function _d(){return typeof window<"u"}function ba(e){return jS(e)?(e.nodeName||"").toLowerCase():"#document"}function wr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ln(e){var t;return(t=(jS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function jS(e){return _d()?e instanceof Node||e instanceof wr(e).Node:!1}function pn(e){return _d()?e instanceof Element||e instanceof wr(e).Element:!1}function as(e){return _d()?e instanceof HTMLElement||e instanceof wr(e).HTMLElement:!1}function Ux(e){return!_d()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wr(e).ShadowRoot}function Zl(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=mn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&s!=="inline"&&s!=="contents"}function BT(e){return/^(table|td|th)$/.test(ba(e))}function bd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const $T=/transform|translate|scale|rotate|perspective|filter/,HT=/paint|layout|strict|content/,li=e=>!!e&&e!=="none";let xh;function ig(e){const t=pn(e)?mn(e):e;return li(t.transform)||li(t.translate)||li(t.scale)||li(t.rotate)||li(t.perspective)||!og()&&(li(t.backdropFilter)||li(t.filter))||$T.test(t.willChange||"")||HT.test(t.contain||"")}function UT(e){let t=Js(e);for(;as(t)&&!aa(t);){if(ig(t))return t;if(bd(t))return null;t=Js(t)}return null}function og(){return xh==null&&(xh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xh}function aa(e){return/^(html|body|#document)$/.test(ba(e))}function mn(e){return wr(e).getComputedStyle(e)}function wd(e){return pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Js(e){if(ba(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ux(e)&&e.host||Ln(e);return Ux(t)?t.host:t}function RS(e){const t=Js(e);return aa(t)?e.ownerDocument?e.ownerDocument.body:e.body:as(t)&&Zl(t)?t:RS(t)}function Tl(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=RS(e),i=s===((n=e.ownerDocument)==null?void 0:n.body),l=wr(s);if(i){const a=sp(l);return t.concat(l,l.visualViewport||[],Zl(s)?s:[],a&&r?Tl(a):[])}else return t.concat(s,Tl(s,[],r))}function sp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function NS(e){const t=mn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=as(e),i=s?e.offsetWidth:r,l=s?e.offsetHeight:n,a=Au(r)!==i||Au(n)!==l;return a&&(r=i,n=l),{width:r,height:n,$:a}}function ag(e){return pn(e)?e:e.contextElement}function Lo(e){const t=ag(e);if(!as(t))return Pn(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:i}=NS(t);let l=(i?Au(r.width):r.width)/n,a=(i?Au(r.height):r.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const zT=Pn(0);function PS(e){const t=wr(e);return!og()||!t.visualViewport?zT:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function WT(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==wr(e)?!1:t}function Fi(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),i=ag(e);let l=Pn(1);t&&(n?pn(n)&&(l=Lo(n)):l=Lo(e));const a=WT(i,r,n)?PS(i):Pn(0);let c=(s.left+a.x)/l.x,u=(s.top+a.y)/l.y,m=s.width/l.x,d=s.height/l.y;if(i){const x=wr(i),v=n&&pn(n)?wr(n):n;let _=x,y=sp(_);for(;y&&n&&v!==_;){const h=Lo(y),p=y.getBoundingClientRect(),f=mn(y),g=p.left+(y.clientLeft+parseFloat(f.paddingLeft))*h.x,b=p.top+(y.clientTop+parseFloat(f.paddingTop))*h.y;c*=h.x,u*=h.y,m*=h.x,d*=h.y,c+=g,u+=b,_=wr(y),y=sp(_)}}return Lu({width:m,height:d,x:c,y:u})}function Sd(e,t){const r=wd(e).scrollLeft;return t?t.left+r:Fi(Ln(e)).left+r}function TS(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Sd(e,r),s=r.top+t.scrollTop;return{x:n,y:s}}function VT(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const i=s==="fixed",l=Ln(n),a=t?bd(t.floating):!1;if(n===l||a&&i)return r;let c={scrollLeft:0,scrollTop:0},u=Pn(1);const m=Pn(0),d=as(n);if((d||!d&&!i)&&((ba(n)!=="body"||Zl(l))&&(c=wd(n)),d)){const v=Fi(n);u=Lo(n),m.x=v.x+n.clientLeft,m.y=v.y+n.clientTop}const x=l&&!d&&!i?TS(l,c):Pn(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+m.x+x.x,y:r.y*u.y-c.scrollTop*u.y+m.y+x.y}}function qT(e){return Array.from(e.getClientRects())}function KT(e){const t=Ln(e),r=wd(e),n=e.ownerDocument.body,s=yr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=yr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let l=-r.scrollLeft+Sd(e);const a=-r.scrollTop;return mn(n).direction==="rtl"&&(l+=yr(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:l,y:a}}const zx=25;function GT(e,t){const r=wr(e),n=Ln(e),s=r.visualViewport;let i=n.clientWidth,l=n.clientHeight,a=0,c=0;if(s){i=s.width,l=s.height;const m=og();(!m||m&&t==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}const u=Sd(n);if(u<=0){const m=n.ownerDocument,d=m.body,x=getComputedStyle(d),v=m.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,_=Math.abs(n.clientWidth-d.clientWidth-v);_<=zx&&(i-=_)}else u<=zx&&(i+=u);return{width:i,height:l,x:a,y:c}}function QT(e,t){const r=Fi(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,i=as(e)?Lo(e):Pn(1),l=e.clientWidth*i.x,a=e.clientHeight*i.y,c=s*i.x,u=n*i.y;return{width:l,height:a,x:c,y:u}}function Wx(e,t,r){let n;if(t==="viewport")n=GT(e,r);else if(t==="document")n=KT(Ln(e));else if(pn(t))n=QT(t,r);else{const s=PS(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Lu(n)}function AS(e,t){const r=Js(e);return r===t||!pn(r)||aa(r)?!1:mn(r).position==="fixed"||AS(r,t)}function YT(e,t){const r=t.get(e);if(r)return r;let n=Tl(e,[],!1).filter(a=>pn(a)&&ba(a)!=="body"),s=null;const i=mn(e).position==="fixed";let l=i?Js(e):e;for(;pn(l)&&!aa(l);){const a=mn(l),c=ig(l);!c&&a.position==="fixed"&&(s=null),(i?!c&&!s:!c&&a.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||Zl(l)&&!c&&AS(e,l))?n=n.filter(m=>m!==l):s=a,l=Js(l)}return t.set(e,n),n}function ZT(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const l=[...r==="clippingAncestors"?bd(t)?[]:YT(t,this._c):[].concat(r),n],a=Wx(t,l[0],s);let c=a.top,u=a.right,m=a.bottom,d=a.left;for(let x=1;x<l.length;x++){const v=Wx(t,l[x],s);c=yr(v.top,c),u=Xs(v.right,u),m=Xs(v.bottom,m),d=yr(v.left,d)}return{width:u-d,height:m-c,x:d,y:c}}function XT(e){const{width:t,height:r}=NS(e);return{width:t,height:r}}function JT(e,t,r){const n=as(t),s=Ln(t),i=r==="fixed",l=Fi(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=Pn(0);function u(){c.x=Sd(s)}if(n||!n&&!i)if((ba(t)!=="body"||Zl(s))&&(a=wd(t)),n){const v=Fi(t,!0,i,t);c.x=v.x+t.clientLeft,c.y=v.y+t.clientTop}else s&&u();i&&!n&&s&&u();const m=s&&!n&&!i?TS(s,a):Pn(0),d=l.left+a.scrollLeft-c.x-m.x,x=l.top+a.scrollTop-c.y-m.y;return{x:d,y:x,width:l.width,height:l.height}}function yh(e){return mn(e).position==="static"}function Vx(e,t){if(!as(e)||mn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ln(e)===r&&(r=r.ownerDocument.body),r}function DS(e,t){const r=wr(e);if(bd(e))return r;if(!as(e)){let s=Js(e);for(;s&&!aa(s);){if(pn(s)&&!yh(s))return s;s=Js(s)}return r}let n=Vx(e,t);for(;n&&BT(n)&&yh(n);)n=Vx(n,t);return n&&aa(n)&&yh(n)&&!ig(n)?r:n||UT(e)||r}const eA=async function(e){const t=this.getOffsetParent||DS,r=this.getDimensions,n=await r(e.floating);return{reference:JT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function tA(e){return mn(e).direction==="rtl"}const rA={convertOffsetParentRelativeRectToViewportRelativeRect:VT,getDocumentElement:Ln,getClippingRect:ZT,getOffsetParent:DS,getElementRects:eA,getClientRects:qT,getDimensions:XT,getScale:Lo,isElement:pn,isRTL:tA};function LS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nA(e,t){let r=null,n;const s=Ln(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function l(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:m,top:d,width:x,height:v}=u;if(a||t(),!x||!v)return;const _=Nc(d),y=Nc(s.clientWidth-(m+x)),h=Nc(s.clientHeight-(d+v)),p=Nc(m),g={rootMargin:-_+"px "+-y+"px "+-h+"px "+-p+"px",threshold:yr(0,Xs(1,c))||1};let b=!0;function w(k){const j=k[0].intersectionRatio;if(j!==c){if(!b)return l();j?l(!1,j):n=setTimeout(()=>{l(!1,1e-7)},1e3)}j===1&&!LS(u,e.getBoundingClientRect())&&l(),b=!1}try{r=new IntersectionObserver(w,{...g,root:s.ownerDocument})}catch{r=new IntersectionObserver(w,g)}r.observe(e)}return l(!0),i}function sA(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=ag(e),m=s||i?[...u?Tl(u):[],...t?Tl(t):[]]:[];m.forEach(p=>{s&&p.addEventListener("scroll",r,{passive:!0}),i&&p.addEventListener("resize",r)});const d=u&&a?nA(u,r):null;let x=-1,v=null;l&&(v=new ResizeObserver(p=>{let[f]=p;f&&f.target===u&&v&&t&&(v.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var g;(g=v)==null||g.observe(t)})),r()}),u&&!c&&v.observe(u),t&&v.observe(t));let _,y=c?Fi(e):null;c&&h();function h(){const p=Fi(e);y&&!LS(y,p)&&r(),y=p,_=requestAnimationFrame(h)}return r(),()=>{var p;m.forEach(f=>{s&&f.removeEventListener("scroll",r),i&&f.removeEventListener("resize",r)}),d==null||d(),(p=v)==null||p.disconnect(),v=null,c&&cancelAnimationFrame(_)}}const iA=OT,oA=MT,aA=AT,lA=FT,cA=DT,qx=TT,uA=IT,dA=(e,t,r)=>{const n=new Map,s={platform:rA,...r},i={...s.platform,_c:n};return PT(e,t,{...s,platform:i})};var hA=typeof document<"u",fA=function(){},Jc=hA?C.useLayoutEffect:fA;function Ou(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Ou(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const i=s[n];if(!(i==="_owner"&&e.$$typeof)&&!Ou(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function OS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Kx(e,t){const r=OS(e);return Math.round(t*r)/r}function _h(e){const t=C.useRef(e);return Jc(()=>{t.current=e}),t}function pA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:l}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[m,d]=C.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[x,v]=C.useState(n);Ou(x,n)||v(n);const[_,y]=C.useState(null),[h,p]=C.useState(null),f=C.useCallback(R=>{R!==k.current&&(k.current=R,y(R))},[]),g=C.useCallback(R=>{R!==j.current&&(j.current=R,p(R))},[]),b=i||_,w=l||h,k=C.useRef(null),j=C.useRef(null),S=C.useRef(m),E=c!=null,N=_h(c),O=_h(s),T=_h(u),L=C.useCallback(()=>{if(!k.current||!j.current)return;const R={placement:t,strategy:r,middleware:x};O.current&&(R.platform=O.current),dA(k.current,j.current,R).then(P=>{const D={...P,isPositioned:T.current!==!1};$.current&&!Ou(S.current,D)&&(S.current=D,pd.flushSync(()=>{d(D)}))})},[x,t,r,O,T]);Jc(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[u]);const $=C.useRef(!1);Jc(()=>($.current=!0,()=>{$.current=!1}),[]),Jc(()=>{if(b&&(k.current=b),w&&(j.current=w),b&&w){if(N.current)return N.current(b,w,L);L()}},[b,w,L,N,E]);const U=C.useMemo(()=>({reference:k,floating:j,setReference:f,setFloating:g}),[f,g]),z=C.useMemo(()=>({reference:b,floating:w}),[b,w]),K=C.useMemo(()=>{const R={position:r,left:0,top:0};if(!z.floating)return R;const P=Kx(z.floating,m.x),D=Kx(z.floating,m.y);return a?{...R,transform:"translate("+P+"px, "+D+"px)",...OS(z.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:P,top:D}},[r,a,z.floating,m.x,m.y]);return C.useMemo(()=>({...m,update:L,refs:U,elements:z,floatingStyles:K}),[m,L,U,z,K])}const mA=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?qx({element:n.current,padding:s}).fn(r):{}:n?qx({element:n,padding:s}).fn(r):{}}}},gA=(e,t)=>{const r=iA(e);return{name:r.name,fn:r.fn,options:[e,t]}},vA=(e,t)=>{const r=oA(e);return{name:r.name,fn:r.fn,options:[e,t]}},xA=(e,t)=>({fn:uA(e).fn,options:[e,t]}),yA=(e,t)=>{const r=aA(e);return{name:r.name,fn:r.fn,options:[e,t]}},_A=(e,t)=>{const r=lA(e);return{name:r.name,fn:r.fn,options:[e,t]}},bA=(e,t)=>{const r=cA(e);return{name:r.name,fn:r.fn,options:[e,t]}},wA=(e,t)=>{const r=mA(e);return{name:r.name,fn:r.fn,options:[e,t]}};var SA="Arrow",MS=C.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...i}=e;return o.jsx($e.svg,{...i,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});MS.displayName=SA;var CA=MS;function IS(e){const[t,r]=C.useState(void 0);return ts(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let l,a;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;l=u.inlineSize,a=u.blockSize}else l=e.offsetWidth,a=e.offsetHeight;r({width:l,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var lg="Popper",[FS,wa]=gn(lg),[kA,BS]=FS(lg),$S=e=>{const{__scopePopper:t,children:r}=e,[n,s]=C.useState(null);return o.jsx(kA,{scope:t,anchor:n,onAnchorChange:s,children:r})};$S.displayName=lg;var HS="PopperAnchor",US=C.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,i=BS(HS,r),l=C.useRef(null),a=Be(t,l),c=C.useRef(null);return C.useEffect(()=>{const u=c.current;c.current=(n==null?void 0:n.current)||l.current,u!==c.current&&i.onAnchorChange(c.current)}),n?null:o.jsx($e.div,{...s,ref:a})});US.displayName=HS;var cg="PopperContent",[EA,jA]=FS(cg),zS=C.forwardRef((e,t)=>{var A,B,G,Y,ce,Q;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:i="center",alignOffset:l=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:m=0,sticky:d="partial",hideWhenDetached:x=!1,updatePositionStrategy:v="optimized",onPlaced:_,...y}=e,h=BS(cg,r),[p,f]=C.useState(null),g=Be(t,ge=>f(ge)),[b,w]=C.useState(null),k=IS(b),j=(k==null?void 0:k.width)??0,S=(k==null?void 0:k.height)??0,E=n+(i!=="center"?"-"+i:""),N=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},O=Array.isArray(u)?u:[u],T=O.length>0,L={padding:N,boundary:O.filter(NA),altBoundary:T},{refs:$,floatingStyles:U,placement:z,isPositioned:K,middlewareData:R}=pA({strategy:"fixed",placement:E,whileElementsMounted:(...ge)=>sA(...ge,{animationFrame:v==="always"}),elements:{reference:h.anchor},middleware:[gA({mainAxis:s+S,alignmentAxis:l}),c&&vA({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?xA():void 0,...L}),c&&yA({...L}),_A({...L,apply:({elements:ge,rects:De,availableWidth:Ue,availableHeight:Ct})=>{const{width:Ce,height:dr}=De.reference,hr=ge.floating.style;hr.setProperty("--radix-popper-available-width",`${Ue}px`),hr.setProperty("--radix-popper-available-height",`${Ct}px`),hr.setProperty("--radix-popper-anchor-width",`${Ce}px`),hr.setProperty("--radix-popper-anchor-height",`${dr}px`)}}),b&&wA({element:b,padding:a}),PA({arrowWidth:j,arrowHeight:S}),x&&bA({strategy:"referenceHidden",...L})]}),[P,D]=qS(z),M=Ht(_);ts(()=>{K&&(M==null||M())},[K,M]);const V=(A=R.arrow)==null?void 0:A.x,W=(B=R.arrow)==null?void 0:B.y,J=((G=R.arrow)==null?void 0:G.centerOffset)!==0,[X,fe]=C.useState();return ts(()=>{p&&fe(window.getComputedStyle(p).zIndex)},[p]),o.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:K?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(Y=R.transformOrigin)==null?void 0:Y.x,(ce=R.transformOrigin)==null?void 0:ce.y].join(" "),...((Q=R.hide)==null?void 0:Q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(EA,{scope:r,placedSide:P,onArrowChange:w,arrowX:V,arrowY:W,shouldHideArrow:J,children:o.jsx($e.div,{"data-side":P,"data-align":D,...y,ref:g,style:{...y.style,animation:K?void 0:"none"}})})})});zS.displayName=cg;var WS="PopperArrow",RA={top:"bottom",right:"left",bottom:"top",left:"right"},VS=C.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,i=jA(WS,n),l=RA[i.placedSide];return o.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o.jsx(CA,{...s,ref:r,style:{...s.style,display:"block"}})})});VS.displayName=WS;function NA(e){return e!==null}var PA=e=>({name:"transformOrigin",options:e,fn(t){var h,p,f;const{placement:r,rects:n,middlewareData:s}=t,l=((h=s.arrow)==null?void 0:h.centerOffset)!==0,a=l?0:e.arrowWidth,c=l?0:e.arrowHeight,[u,m]=qS(r),d={start:"0%",center:"50%",end:"100%"}[m],x=(((p=s.arrow)==null?void 0:p.x)??0)+a/2,v=(((f=s.arrow)==null?void 0:f.y)??0)+c/2;let _="",y="";return u==="bottom"?(_=l?d:`${x}px`,y=`${-c}px`):u==="top"?(_=l?d:`${x}px`,y=`${n.floating.height+c}px`):u==="right"?(_=`${-c}px`,y=l?d:`${v}px`):u==="left"&&(_=`${n.floating.width+c}px`,y=l?d:`${v}px`),{data:{x:_,y}}}});function qS(e){const[t,r="center"]=e.split("-");return[t,r]}var ug=$S,Cd=US,dg=zS,hg=VS,TA="Portal",Xl=C.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,i]=C.useState(!1);ts(()=>i(!0),[]);const l=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return l?cw.createPortal(o.jsx($e.div,{...n,ref:t}),l):null});Xl.displayName=TA;var AA=Symbol("radix.slottable");function DA(e){const t=({children:r})=>o.jsx(o.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=AA,t}var LA=Xu[" useInsertionEffect ".trim().toString()]||ts;function Sa({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,i,l]=OA({defaultProp:t,onChange:r}),a=e!==void 0,c=a?e:s;{const m=C.useRef(e!==void 0);C.useEffect(()=>{const d=m.current;d!==a&&console.warn(`${n} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=a},[a,n])}const u=C.useCallback(m=>{var d;if(a){const x=MA(m)?m(e):m;x!==e&&((d=l.current)==null||d.call(l,x))}else i(m)},[a,e,i,l]);return[c,u]}function OA({defaultProp:e,onChange:t}){const[r,n]=C.useState(e),s=C.useRef(r),i=C.useRef(t);return LA(()=>{i.current=t},[t]),C.useEffect(()=>{var l;s.current!==r&&((l=i.current)==null||l.call(i,r),s.current=r)},[r,s]),[r,n,i]}function MA(e){return typeof e=="function"}var IA=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),FA="VisuallyHidden",KS=C.forwardRef((e,t)=>o.jsx($e.span,{...e,ref:t,style:{...IA,...e.style}}));KS.displayName=FA;var BA=KS,[kd]=gn("Tooltip",[wa]),Ed=wa(),GS="TooltipProvider",$A=700,ip="tooltip.open",[HA,fg]=kd(GS),QS=e=>{const{__scopeTooltip:t,delayDuration:r=$A,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=e,l=C.useRef(!0),a=C.useRef(!1),c=C.useRef(0);return C.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),o.jsx(HA,{scope:t,isOpenDelayedRef:l,delayDuration:r,onOpen:C.useCallback(()=>{window.clearTimeout(c.current),l.current=!1},[]),onClose:C.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>l.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:C.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};QS.displayName=GS;var Al="Tooltip",[UA,Jl]=kd(Al),YS=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:s,onOpenChange:i,disableHoverableContent:l,delayDuration:a}=e,c=fg(Al,e.__scopeTooltip),u=Ed(t),[m,d]=C.useState(null),x=Vs(),v=C.useRef(0),_=l??c.disableHoverableContent,y=a??c.delayDuration,h=C.useRef(!1),[p,f]=Sa({prop:n,defaultProp:s??!1,onChange:j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(ip))):c.onClose(),i==null||i(j)},caller:Al}),g=C.useMemo(()=>p?h.current?"delayed-open":"instant-open":"closed",[p]),b=C.useCallback(()=>{window.clearTimeout(v.current),v.current=0,h.current=!1,f(!0)},[f]),w=C.useCallback(()=>{window.clearTimeout(v.current),v.current=0,f(!1)},[f]),k=C.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{h.current=!0,f(!0),v.current=0},y)},[y,f]);return C.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),o.jsx(ug,{...u,children:o.jsx(UA,{scope:t,contentId:x,open:p,stateAttribute:g,trigger:m,onTriggerChange:d,onTriggerEnter:C.useCallback(()=>{c.isOpenDelayedRef.current?k():b()},[c.isOpenDelayedRef,k,b]),onTriggerLeave:C.useCallback(()=>{_?w():(window.clearTimeout(v.current),v.current=0)},[w,_]),onOpen:b,onClose:w,disableHoverableContent:_,children:r})})};YS.displayName=Al;var op="TooltipTrigger",ZS=C.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Jl(op,r),i=fg(op,r),l=Ed(r),a=C.useRef(null),c=Be(t,a,s.onTriggerChange),u=C.useRef(!1),m=C.useRef(!1),d=C.useCallback(()=>u.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),o.jsx(Cd,{asChild:!0,...l,children:o.jsx($e.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:c,onPointerMove:ye(e.onPointerMove,x=>{x.pointerType!=="touch"&&!m.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),m.current=!0)}),onPointerLeave:ye(e.onPointerLeave,()=>{s.onTriggerLeave(),m.current=!1}),onPointerDown:ye(e.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:ye(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:ye(e.onBlur,s.onClose),onClick:ye(e.onClick,s.onClose)})})});ZS.displayName=op;var pg="TooltipPortal",[zA,WA]=kd(pg,{forceMount:void 0}),XS=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:s}=e,i=Jl(pg,t);return o.jsx(zA,{scope:t,forceMount:r,children:o.jsx(Wt,{present:r||i.open,children:o.jsx(Xl,{asChild:!0,container:s,children:n})})})};XS.displayName=pg;var la="TooltipContent",JS=C.forwardRef((e,t)=>{const r=WA(la,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...i}=e,l=Jl(la,e.__scopeTooltip);return o.jsx(Wt,{present:n||l.open,children:l.disableHoverableContent?o.jsx(e1,{side:s,...i,ref:t}):o.jsx(VA,{side:s,...i,ref:t})})}),VA=C.forwardRef((e,t)=>{const r=Jl(la,e.__scopeTooltip),n=fg(la,e.__scopeTooltip),s=C.useRef(null),i=Be(t,s),[l,a]=C.useState(null),{trigger:c,onClose:u}=r,m=s.current,{onPointerInTransitChange:d}=n,x=C.useCallback(()=>{a(null),d(!1)},[d]),v=C.useCallback((_,y)=>{const h=_.currentTarget,p={x:_.clientX,y:_.clientY},f=YA(p,h.getBoundingClientRect()),g=ZA(p,f),b=XA(y.getBoundingClientRect()),w=eD([...g,...b]);a(w),d(!0)},[d]);return C.useEffect(()=>()=>x(),[x]),C.useEffect(()=>{if(c&&m){const _=h=>v(h,m),y=h=>v(h,c);return c.addEventListener("pointerleave",_),m.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",_),m.removeEventListener("pointerleave",y)}}},[c,m,v,x]),C.useEffect(()=>{if(l){const _=y=>{const h=y.target,p={x:y.clientX,y:y.clientY},f=(c==null?void 0:c.contains(h))||(m==null?void 0:m.contains(h)),g=!JA(p,l);f?x():g&&(x(),u())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[c,m,l,u,x]),o.jsx(e1,{...e,ref:i})}),[qA,KA]=kd(Al,{isInside:!1}),GA=DA("TooltipContent"),e1=C.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:l,...a}=e,c=Jl(la,r),u=Ed(r),{onClose:m}=c;return C.useEffect(()=>(document.addEventListener(ip,m),()=>document.removeEventListener(ip,m)),[m]),C.useEffect(()=>{if(c.trigger){const d=x=>{const v=x.target;v!=null&&v.contains(c.trigger)&&m()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,m]),o.jsx(Yl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:d=>d.preventDefault(),onDismiss:m,children:o.jsxs(dg,{"data-state":c.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(GA,{children:n}),o.jsx(qA,{scope:r,isInside:!0,children:o.jsx(BA,{id:c.contentId,role:"tooltip",children:s||n})})]})})});JS.displayName=la;var t1="TooltipArrow",QA=C.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Ed(r);return KA(t1,r).isInside?null:o.jsx(hg,{...s,...n,ref:t})});QA.displayName=t1;function YA(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,s,i)){case i:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function ZA(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function XA(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function JA(e,t){const{x:r,y:n}=e;let s=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const a=t[i],c=t[l],u=a.x,m=a.y,d=c.x,x=c.y;m>n!=x>n&&r<(d-u)*(n-m)/(x-m)+u&&(s=!s)}return s}function eD(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),tD(t)}function tD(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const i=r[r.length-1],l=r[r.length-2];if((i.x-l.x)*(s.y-l.y)>=(i.y-l.y)*(s.x-l.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var rD=QS,nD=YS,sD=ZS,iD=XS,r1=JS;const Lr=rD,un=nD,dn=sD,Mr=C.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(iD,{children:o.jsx(r1,{ref:n,sideOffset:t,className:ee("z-50 overflow-hidden rounded-md border border-border bg-popover px-2.5 py-1.5 font-mono text-[11px] text-popover-foreground shadow-md","data-[state=delayed-open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Mr.displayName=r1.displayName;function oD({chain:e}){const t=e==="base";return o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Se,{variant:t?"secondary":"outline",children:"Testnet"}),o.jsx(Lr,{delayDuration:120,children:o.jsxs(un,{children:[o.jsx(dn,{asChild:!0,children:o.jsx("span",{children:o.jsx(Se,{variant:"secondary",className:"border-dashed border-border opacity-60",children:"Mainnet · soon"})})}),o.jsx(Mr,{children:"Mainnet support is coming. v1 supports testnet only."})]})})]})}function aD({status:e}){return e==="done"?o.jsxs(Se,{variant:"success",className:"gap-1.5",children:[o.jsx(c2,{className:"h-3 w-3"}),"Done"]}):e==="error"?o.jsxs(Se,{variant:"destructive",className:"gap-1.5",children:[o.jsx($w,{className:"h-3 w-3"}),"Failed"]}):e==="active"?o.jsxs(Se,{variant:"warning",className:"gap-2",children:[o.jsx("span",{"aria-hidden":"true",className:"jinn-anim-pulse h-1.5 w-1.5 rounded-full bg-[var(--accent-gold)]"}),"Active"]}):o.jsx(Se,{variant:"secondary",children:"Queued"})}const lD={1:"Provisioning your wallet",2:"Fund your wallet",3:"Joining Jinn"};function cD({phase:e,status:t,children:r}){const n=t==="active",s=t==="error",i=t==="done",l=n||s,a=s?"text-[var(--break-red)]":n?"text-[var(--accent-gold)]":i?"text-[var(--accent-sky)]":"text-[var(--fg-dim)]",c=s||n?"text-foreground":i?"text-[var(--fg-muted)]":"text-[var(--fg-dim)]",u=l?"font-serif text-[28px] leading-[1.2]":"font-mono text-[14px] leading-[1.2]";return o.jsxs("li",{className:"phase-row border-t border-border","data-status":t,"data-testid":`onboarding-phase-${e}`,children:[o.jsxs("div",{className:"grid grid-cols-[3rem_1fr_auto] items-baseline gap-4 py-4",children:[o.jsx("span",{className:ee("font-mono text-xs tabular-nums tracking-[0.05em] transition-colors duration-200",a),children:String(e).padStart(2,"0")}),o.jsx("span",{className:ee(u,c,"transition-colors duration-200"),children:lD[e]}),o.jsx(aD,{status:t})]}),l&&r&&o.jsx("div",{className:"jinn-anim-fade-slide ml-12 pb-5 pr-2",children:r})]})}function uD({label:e,step:t,serviceIndex:r,serviceId:n,safeAddress:s,explorer:i,contractRevertReason:l}){const a=!!l;return o.jsxs("div",{className:ee("flex flex-col gap-3 rounded-md border bg-[var(--bg-elevated)] px-4 py-3",a?"border-[var(--break-red)]":"border-border"),children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{"aria-hidden":"true",className:ee("jinn-anim-pulse h-1.5 w-1.5 rounded-full",a?"bg-[var(--break-red)]":"bg-[var(--accent-sky)]")}),o.jsx("span",{className:"font-mono text-sm text-foreground",children:e}),o.jsx("span",{className:ee("ml-auto font-mono text-[10px]",a?"text-[var(--break-red)]":"text-[var(--fg-dim)]"),children:a?"binding failed · will retry":"running · no action needed"})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-x-4 gap-y-1 font-mono text-[11px] text-[var(--fg-muted)] md:grid-cols-[120px_1fr]",children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Current step"}),o.jsx("span",{children:dD(t)}),r!==void 0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Service"}),o.jsxs("span",{children:["#",r,n!==void 0?` · id ${n}`:""]})]}),s&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Safe"}),o.jsx("a",{href:`${i}/address/${s}`,target:"_blank",rel:"noopener noreferrer",className:"break-all text-[var(--accent-sky)] hover:underline",children:s})]}),l&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-[var(--fg-dim)]",children:"Contract revert reason"}),o.jsx("code",{className:"break-words text-xs text-[var(--break-red)]",children:l})]})]})]})}function dD(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}const hD={wallet:{phase:1,subState:null},safe_predicted:{phase:1,subState:null},awaiting_funding:{phase:2,subState:null},safe_deployed:{phase:3,subState:"Deploying"},service_created:{phase:3,subState:"Deploying"},service_activated:{phase:3,subState:"Deploying"},agents_registered:{phase:3,subState:"Deploying"},service_deployed:{phase:3,subState:"Deploying"},service_staked:{phase:3,subState:"Deploying"},staked:{phase:3,subState:"Deploying"},mech_deployed:{phase:3,subState:"Joining the network"},agent_registered:{phase:3,subState:"Joining the network"},safe_binding_pending:{phase:3,subState:"Binding identity"}};function fD(e){return hD[e]??{phase:1,subState:null}}function pD(e,t,r){return e<t?e===2&&r===!1?"active":"done":e===t?"active":"queued"}const mD="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]";function gD(){var m;const{data:e,isLoading:t}=Te({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap(),refetchInterval:2e3});if(t||!e)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Connecting…"})});const r=e.chain==="base"?"https://basescan.org":"https://sepolia.basescan.org",n=e.master_address??"",{phase:s,subState:i}=fD(e.currentStep),l=e.error,a=e.services.find(d=>d.step===e.currentStep)??e.services[0],c=(m=e.funding)==null?void 0:m.targetMet,u=tg().embeddedAgent;return o.jsx("div",{className:"min-h-screen w-full bg-background text-foreground",children:o.jsxs("div",{className:"mx-auto grid max-w-[1280px] grid-cols-12 gap-10 px-10 py-10",children:[o.jsxs("section",{className:ee("col-span-12 flex flex-col gap-8",u&&"lg:col-span-7"),children:[o.jsxs("header",{className:"flex items-baseline justify-between",children:[o.jsx("span",{className:mD,children:"Jinn · Onboarding"}),o.jsx(oD,{chain:e.chain})]}),o.jsx("h1",{className:"font-serif text-[76px] leading-[1.05] text-foreground",children:"Welcome to Jinn."}),o.jsxs("div",{className:"flex flex-col gap-1.5","data-testid":"onboarding-progress","aria-label":"Onboarding progress",children:[o.jsx(eg,{value:Math.min(100,(s-1)/2*100+(s===3?33:0))}),o.jsxs("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:["Phase ",s," of 3"]})]}),o.jsx("ol",{className:"flex flex-col",children:[1,2,3].map(d=>{var _;const x=pD(d,s,c),v=l&&d===s;return o.jsxs(cD,{phase:d,status:v?"error":x,children:[v&&o.jsx(oT,{envelope:l,chainExplorerBase:r}),!v&&d===2&&x==="active"&&n&&o.jsx(XP,{address:n,minimumWei:((_=e.funding)==null?void 0:_.targetWei)??"10000000000000000",chainExplorerBase:r,chain:e.chain,onSharedDefaultRpc:e.rpcUrl===e.defaultRpcUrl}),!v&&d===3&&x==="active"&&o.jsx(uD,{label:i??"Working",step:e.currentStep,serviceIndex:a==null?void 0:a.index,serviceId:a==null?void 0:a.service_id,safeAddress:a==null?void 0:a.safe_address,explorer:r,contractRevertReason:(a==null?void 0:a.error_revert_reason)??null})]},d)})})]}),u&&o.jsxs("aside",{className:"col-span-12 flex flex-col gap-3 lg:col-span-5",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Ask Claude"}),o.jsx(we,{className:"h-[calc(100vh-220px)] min-h-[520px] overflow-hidden p-0",children:o.jsx(wS,{agentGated:!1})})]})]})})}const vD="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]",xD="font-serif font-normal leading-[1.05] text-foreground text-[64px]";function yD({connection:e}){const[t,r]=C.useState(!1);return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-10 py-16 text-foreground","data-testid":"daemon-offline-screen",children:o.jsxs("div",{className:"flex w-full max-w-xl flex-col gap-6",children:[o.jsx("span",{className:vD,children:"Jinn · offline"}),o.jsx("h1",{className:xD,children:"Daemon not running."}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("p",{className:"font-mono text-sm text-[var(--fg-muted)]",children:"Open a terminal and run:"}),o.jsx("code",{className:"self-start rounded bg-[var(--bg-elevated)] px-2 py-1 font-mono text-sm text-foreground",children:"jinn run"}),o.jsx("p",{className:"font-mono text-xs text-[var(--fg-dim)]",children:"(or the command you originally used to start it)"})]}),o.jsxs("p",{className:"font-mono text-sm text-[var(--fg-muted)]",children:["Reconnecting…",e.attempts>0&&o.jsxs("span",{className:"ml-1 text-[var(--fg-dim)]",children:["(attempt ",e.attempts,")"]})]}),o.jsxs(ie,{type:"button",variant:"ghost",size:"sm",className:"self-start text-[var(--fg-dim)] hover:text-foreground",onClick:()=>r(n=>!n),"aria-expanded":t,children:[t?o.jsx(zm,{}):o.jsx(gd,{}),t?"Hide details":"Show details"]}),t&&e.lastError&&o.jsx(we,{className:"bg-[var(--bg-elevated)]",children:o.jsx(Ge,{className:"px-3 py-2",children:o.jsx("p",{className:"font-mono text-xs text-[var(--fg-muted)]",children:e.lastError})})})]})})}const _D={blocking:"border-l-[var(--severity-blocking-fg)] bg-[var(--severity-blocking-bg)]",warning:"border-l-[var(--severity-warning-fg)] bg-[var(--severity-warning-bg)]",info:"border-l-[var(--severity-info-fg)]"},bD={blocking:"text-[var(--severity-blocking-fg)]",warning:"text-[var(--severity-warning-fg)]",info:"text-[var(--severity-info-fg)]"};function wD({notice:e}){return o.jsxs("li",{"data-kind":e.kind,"data-severity":e.severity,"aria-label":`${e.severity} notice: ${e.message}`,className:ee("flex items-baseline gap-3 border-l-2 px-4 py-2 font-mono text-[12px] text-foreground",_D[e.severity]),children:[o.jsx("span",{"aria-hidden":"true",className:ee("min-w-[64px] font-mono text-[11px] font-medium uppercase tracking-[0.14em]",bD[e.severity]),children:e.severity}),o.jsx("span",{className:"flex-1",children:e.message}),e.jumpTo?o.jsx(cr,{href:e.jumpTo,className:"font-mono text-[var(--accent-sky)] no-underline hover:text-[var(--accent-sky-hover)]",children:"resolve →"}):null]})}function SD({notices:e}){return e.length===0?null:o.jsx("section",{"aria-label":"Notifications",role:"region",children:o.jsx("ul",{className:"m-0 list-none p-0",children:e.map((t,r)=>o.jsx(wD,{notice:t},`${t.kind}-${r}`))})})}const n1=C.createContext({restartPending:!1,setRestartPending:()=>{}});function CD(){return C.useContext(n1)}const kD=3,ED=1e3*60*60*24*90;function jD(e){const t=[],r=e.status;if(e.bootstrap.mode!=="running"&&t.push({kind:"bootstrap_blocked",severity:"blocking",message:e.bootstrap.blockingReason??"Bootstrap incomplete",jumpTo:"/"}),r.funds.runwayDays<kD&&t.push({kind:"funding_low",severity:"warning",message:`Runway is ${r.funds.runwayDays} day(s). Top up gas to keep claiming work.`,jumpTo:"/overview"}),!r.harness.ready){const n=r.harness.name===null?"A harness":`Harness ${r.harness.name}`,s=r.harness.reason?`: ${r.harness.reason}`:"";t.push({kind:"harness_not_ready",severity:"blocking",message:`${n} is not ready${s}.`,jumpTo:"/operator/memberships"})}return r.rpc.reachable||t.push({kind:"rpc_unreachable",severity:"blocking",message:"RPC endpoint is unreachable.",jumpTo:"/operator/network"}),Object.keys(r.joinedSolverNets).length===0&&e.bootstrap.mode==="running"&&t.push({kind:"no_solvernets_joined",severity:"info",message:"No SolverNets joined. Browse the registry to start earning.",jumpTo:"/operator/registry"}),r.services.some(n=>!n.safeBound)&&t.push({kind:"safe_binding_pending",severity:"warning",message:"Safe wallet binding is pending.",jumpTo:"/overview"}),r.restartPending&&t.push({kind:"restart_required",severity:"warning",message:"A configuration change is pending — restart to apply.",jumpTo:"/overview"}),r.latestVersion&&r.latestVersion!==r.daemonVersion&&t.push({kind:"update_available",severity:"info",message:`Daemon ${r.latestVersion} available (running ${r.daemonVersion}).`}),r.passwordRotatedAt&&(e.now??Date.now())-new Date(r.passwordRotatedAt).getTime()>ED&&t.push({kind:"password_rotation_due",severity:"info",message:"Keystore password is over 90 days old.",jumpTo:"/operator/security"}),t}const Gx={blocking:0,warning:1,info:2},RD=30*60*1e3,ND=60*1e3,PD=["intent"];function TD(e,t,r){var m,d,x,v,_;const n=e??{},s=t??{},i=String(((m=n.masterGas)==null?void 0:m.balanceWei)??"0");let l="0",a=Number.POSITIVE_INFINITY;try{const y=BigInt(i);l=y.toString(),a=y>0n?Number.POSITIVE_INFINITY:0}catch{}const c=Array.isArray((d=n.fleet)==null?void 0:d.services)?n.fleet.services:[],u=s.joinedSolverNets&&typeof s.joinedSolverNets=="object"?s.joinedSolverNets:{};return{funds:{eth:l,runwayDays:a},harness:{ready:((x=n.harness)==null?void 0:x.ready)!==!1,name:typeof((v=n.harness)==null?void 0:v.name)=="string"?n.harness.name:null,reason:typeof((_=n.harness)==null?void 0:_.reason)=="string"?n.harness.reason:null},rpc:{reachable:!0},restartPending:r,daemonVersion:String(n.version??"0.0.0"),latestVersion:void 0,services:c.map(y=>({safeBound:(y==null?void 0:y.safeBoundToAgent)!==!1})),joinedSolverNets:u,passwordRotatedAt:void 0}}function AD(){const e=Mw(),{restartPending:t}=CD(),r=Te({queryKey:["status"],queryFn:()=>me.getStatus()}),n=Te({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap()}),{events:s}=Hw(PD),[i,l]=C.useState(()=>Date.now());C.useEffect(()=>{const c=setInterval(()=>l(Date.now()),ND);return()=>clearInterval(c)},[]);const a=C.useMemo(()=>{const c=i-RD,u=new Set,m=s.filter(x=>{if(x.kind!=="intent"||x.errorCode!=="claim_failed")return!1;const v=Date.parse(x.ts);return Number.isNaN(v)||v<c||u.has(x.id)?!1:(u.add(x.id),!0)});if(m.length===0)return null;const d=m.length;return{kind:"claim_failed",severity:"warning",message:`${d} claim attempt${d===1?"":"s"} failed in the last 30 minutes. Check Tasks for details.`,jumpTo:"/overview",details:{count:d,sinceMs:c}}},[s,i]);return C.useMemo(()=>{if(e.status==="disconnected")return[{kind:"rpc_unreachable",severity:"blocking",message:"Daemon offline. What you see may be stale. Reconnecting automatically…"}];if(!r.data||!n.data)return[];const c=jD({bootstrap:n.data,status:TD(r.data,n.data,t)});return(a?[...c,a]:[...c]).sort((m,d)=>Gx[m.severity]-Gx[d.severity])},[e.status,t,r.data,n.data,a])}function DD({header:e,tabs:t,rail:r,children:n}){const s=r!=null,i=AD(),l=i.length>0?"grid-rows-[auto_auto_auto_minmax(0,1fr)]":"grid-rows-[auto_auto_minmax(0,1fr)]";return o.jsxs("div",{className:ee("grid h-screen w-full overflow-hidden bg-background text-foreground",s?"grid-cols-[1fr_320px]":"grid-cols-1",l),children:[o.jsx("div",{className:"col-span-full border-b border-border",children:e}),o.jsx("div",{className:"col-span-full border-b border-border",children:t}),i.length>0&&o.jsx("div",{className:"col-span-full border-b border-border",children:o.jsx(SD,{notices:i})}),o.jsx("main",{className:"min-h-0 overflow-y-auto",children:n}),s&&o.jsx("aside",{className:"h-full min-h-0 overflow-y-auto border-l border-border",children:r})]})}function LD(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),n=r.createElement("base"),s=r.createElement("a");return r.head.appendChild(n),r.body.appendChild(s),t&&(n.href=t),s.href=e,s.href}const OD=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function qs(e){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r]);return t}let Ji=null;function s1(e={}){return Ji||(e.includeStyleProperties?(Ji=e.includeStyleProperties,Ji):(Ji=qs(window.getComputedStyle(document.documentElement)),Ji))}function Mu(e,t){const n=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return n?parseFloat(n.replace("px","")):0}function MD(e){const t=Mu(e,"border-left-width"),r=Mu(e,"border-right-width");return e.clientWidth+t+r}function ID(e){const t=Mu(e,"border-top-width"),r=Mu(e,"border-bottom-width");return e.clientHeight+t+r}function i1(e,t={}){const r=t.width||MD(e),n=t.height||ID(e);return{width:r,height:n}}function FD(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const fr=16384;function BD(e){(e.width>fr||e.height>fr)&&(e.width>fr&&e.height>fr?e.width>e.height?(e.height*=fr/e.width,e.width=fr):(e.width*=fr/e.height,e.height=fr):e.width>fr?(e.height*=fr/e.width,e.width=fr):(e.width*=fr/e.height,e.height=fr))}function Iu(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>{n.decode().then(()=>{requestAnimationFrame(()=>t(n))})},n.onerror=r,n.crossOrigin="anonymous",n.decoding="async",n.src=e})}async function $D(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function HD(e,t,r){const n="http://www.w3.org/2000/svg",s=document.createElementNS(n,"svg"),i=document.createElementNS(n,"foreignObject");return s.setAttribute("width",`${t}`),s.setAttribute("height",`${r}`),s.setAttribute("viewBox",`0 0 ${t} ${r}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),s.appendChild(i),i.appendChild(e),$D(s)}const ur=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||ur(r,t)};function UD(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function zD(e,t){return s1(t).map(r=>{const n=e.getPropertyValue(r),s=e.getPropertyPriority(r);return`${r}: ${n}${s?" !important":""};`}).join(" ")}function WD(e,t,r,n){const s=`.${e}:${t}`,i=r.cssText?UD(r):zD(r,n);return document.createTextNode(`${s}{${i}}`)}function Qx(e,t,r,n){const s=window.getComputedStyle(e,r),i=s.getPropertyValue("content");if(i===""||i==="none")return;const l=OD();try{t.className=`${t.className} ${l}`}catch{return}const a=document.createElement("style");a.appendChild(WD(l,r,s,n)),t.appendChild(a)}function VD(e,t,r){Qx(e,t,":before",r),Qx(e,t,":after",r)}const Yx="application/font-woff",Zx="image/jpeg",qD={woff:Yx,woff2:Yx,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Zx,jpeg:Zx,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function KD(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function mg(e){const t=KD(e).toLowerCase();return qD[t]||""}function GD(e){return e.split(/,/)[1]}function ap(e){return e.search(/^(data:)/)!==-1}function QD(e,t){return`data:${t};base64,${e}`}async function o1(e,t,r){const n=await fetch(e,t);if(n.status===404)throw new Error(`Resource "${n.url}" not found`);const s=await n.blob();return new Promise((i,l)=>{const a=new FileReader;a.onerror=l,a.onloadend=()=>{try{i(r({res:n,result:a.result}))}catch(c){l(c)}},a.readAsDataURL(s)})}const bh={};function YD(e,t,r){let n=e.replace(/\?.*/,"");return r&&(n=e),/ttf|otf|eot|woff2?/i.test(n)&&(n=n.replace(/.*\//,"")),t?`[${t}]${n}`:n}async function gg(e,t,r){const n=YD(e,t,r.includeQueryParams);if(bh[n]!=null)return bh[n];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let s;try{const i=await o1(e,r.fetchRequestInit,({res:l,result:a})=>(t||(t=l.headers.get("Content-Type")||""),GD(a)));s=QD(i,t)}catch(i){s=r.imagePlaceholder||"";let l=`Failed to fetch resource: ${e}`;i&&(l=typeof i=="string"?i:i.message),l&&console.warn(l)}return bh[n]=s,s}async function ZD(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Iu(t)}async function XD(e,t){if(e.currentSrc){const i=document.createElement("canvas"),l=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,l==null||l.drawImage(e,0,0,i.width,i.height);const a=i.toDataURL();return Iu(a)}const r=e.poster,n=mg(r),s=await gg(r,n,t);return Iu(s)}async function JD(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await jd(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function eL(e,t){return ur(e,HTMLCanvasElement)?ZD(e):ur(e,HTMLVideoElement)?XD(e,t):ur(e,HTMLIFrameElement)?JD(e,t):e.cloneNode(a1(e))}const tL=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",a1=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function rL(e,t,r){var n,s;if(a1(t))return t;let i=[];return tL(e)&&e.assignedNodes?i=qs(e.assignedNodes()):ur(e,HTMLIFrameElement)&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?i=qs(e.contentDocument.body.childNodes):i=qs(((s=e.shadowRoot)!==null&&s!==void 0?s:e).childNodes),i.length===0||ur(e,HTMLVideoElement)||await i.reduce((l,a)=>l.then(()=>jd(a,r)).then(c=>{c&&t.appendChild(c)}),Promise.resolve()),t}function nL(e,t,r){const n=t.style;if(!n)return;const s=window.getComputedStyle(e);s.cssText?(n.cssText=s.cssText,n.transformOrigin=s.transformOrigin):s1(r).forEach(i=>{let l=s.getPropertyValue(i);i==="font-size"&&l.endsWith("px")&&(l=`${Math.floor(parseFloat(l.substring(0,l.length-2)))-.1}px`),ur(e,HTMLIFrameElement)&&i==="display"&&l==="inline"&&(l="block"),i==="d"&&t.getAttribute("d")&&(l=`path(${t.getAttribute("d")})`),n.setProperty(i,l,s.getPropertyPriority(i))})}function sL(e,t){ur(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),ur(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function iL(e,t){if(ur(e,HTMLSelectElement)){const r=t,n=Array.from(r.children).find(s=>e.value===s.getAttribute("value"));n&&n.setAttribute("selected","")}}function oL(e,t,r){return ur(t,Element)&&(nL(e,t,r),VD(e,t,r),sL(e,t),iL(e,t)),t}async function aL(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const n={};for(let i=0;i<r.length;i++){const a=r[i].getAttribute("xlink:href");if(a){const c=e.querySelector(a),u=document.querySelector(a);!c&&u&&!n[a]&&(n[a]=await jd(u,t,!0))}}const s=Object.values(n);if(s.length){const i="http://www.w3.org/1999/xhtml",l=document.createElementNS(i,"svg");l.setAttribute("xmlns",i),l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.overflow="hidden",l.style.display="none";const a=document.createElementNS(i,"defs");l.appendChild(a);for(let c=0;c<s.length;c++)a.appendChild(s[c]);e.appendChild(l)}return e}async function jd(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(n=>eL(n,t)).then(n=>rL(e,n,t)).then(n=>oL(e,n,t)).then(n=>aL(n,t))}const l1=/url\((['"]?)([^'"]+?)\1\)/g,lL=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,cL=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function uL(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function dL(e){const t=[];return e.replace(l1,(r,n,s)=>(t.push(s),r)),t.filter(r=>!ap(r))}async function hL(e,t,r,n,s){try{const i=r?LD(t,r):t,l=mg(t);let a;return s||(a=await gg(i,l,n)),e.replace(uL(t),`$1${a}$3`)}catch{}return e}function fL(e,{preferredFontFormat:t}){return t?e.replace(cL,r=>{for(;;){const[n,,s]=lL.exec(r)||[];if(!s)return"";if(s===t)return`src: ${n};`}}):e}function c1(e){return e.search(l1)!==-1}async function u1(e,t,r){if(!c1(e))return e;const n=fL(e,r);return dL(n).reduce((i,l)=>i.then(a=>hL(a,l,t,r)),Promise.resolve(n))}async function eo(e,t,r){var n;const s=(n=t.style)===null||n===void 0?void 0:n.getPropertyValue(e);if(s){const i=await u1(s,null,r);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function pL(e,t){await eo("background",e,t)||await eo("background-image",e,t),await eo("mask",e,t)||await eo("-webkit-mask",e,t)||await eo("mask-image",e,t)||await eo("-webkit-mask-image",e,t)}async function mL(e,t){const r=ur(e,HTMLImageElement);if(!(r&&!ap(e.src))&&!(ur(e,SVGImageElement)&&!ap(e.href.baseVal)))return;const n=r?e.src:e.href.baseVal,s=await gg(n,mg(n),t);await new Promise((i,l)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...c)=>{try{i(t.onImageErrorHandler(...c))}catch(u){l(u)}}:l;const a=e;a.decode&&(a.decode=i),a.loading==="lazy"&&(a.loading="eager"),r?(e.srcset="",e.src=s):e.href.baseVal=s})}async function gL(e,t){const n=qs(e.childNodes).map(s=>d1(s,t));await Promise.all(n).then(()=>e)}async function d1(e,t){ur(e,Element)&&(await pL(e,t),await mL(e,t),await gL(e,t))}function vL(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const n=t.style;return n!=null&&Object.keys(n).forEach(s=>{r[s]=n[s]}),e}const Xx={};async function Jx(e){let t=Xx[e];if(t!=null)return t;const n=await(await fetch(e)).text();return t={url:e,cssText:n},Xx[e]=t,t}async function ey(e,t){let r=e.cssText;const n=/url\(["']?([^"')]+)["']?\)/g,i=(r.match(/url\([^)]+\)/g)||[]).map(async l=>{let a=l.replace(n,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),o1(a,t.fetchRequestInit,({result:c})=>(r=r.replace(l,`url(${c})`),[l,c]))});return Promise.all(i).then(()=>r)}function ty(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let n=e.replace(r,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const c=s.exec(n);if(c===null)break;t.push(c[0])}n=n.replace(s,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,l="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",a=new RegExp(l,"gi");for(;;){let c=i.exec(n);if(c===null){if(c=a.exec(n),c===null)break;i.lastIndex=a.lastIndex}else a.lastIndex=i.lastIndex;t.push(c[0])}return t}async function xL(e,t){const r=[],n=[];return e.forEach(s=>{if("cssRules"in s)try{qs(s.cssRules||[]).forEach((i,l)=>{if(i.type===CSSRule.IMPORT_RULE){let a=l+1;const c=i.href,u=Jx(c).then(m=>ey(m,t)).then(m=>ty(m).forEach(d=>{try{s.insertRule(d,d.startsWith("@import")?a+=1:s.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:d,error:x})}})).catch(m=>{console.error("Error loading remote css",m.toString())});n.push(u)}})}catch(i){const l=e.find(a=>a.href==null)||document.styleSheets[0];s.href!=null&&n.push(Jx(s.href).then(a=>ey(a,t)).then(a=>ty(a).forEach(c=>{l.insertRule(c,l.cssRules.length)})).catch(a=>{console.error("Error loading remote stylesheet",a)})),console.error("Error inlining remote css file",i)}}),Promise.all(n).then(()=>(e.forEach(s=>{if("cssRules"in s)try{qs(s.cssRules||[]).forEach(i=>{r.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${s.href}`,i)}}),r))}function yL(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>c1(t.style.getPropertyValue("src")))}async function _L(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=qs(e.ownerDocument.styleSheets),n=await xL(r,t);return yL(n)}function h1(e){return e.trim().replace(/["']/g,"")}function bL(e){const t=new Set;function r(n){(n.style.fontFamily||getComputedStyle(n).fontFamily).split(",").forEach(i=>{t.add(h1(i))}),Array.from(n.children).forEach(i=>{i instanceof HTMLElement&&r(i)})}return r(e),t}async function wL(e,t){const r=await _L(e,t),n=bL(e);return(await Promise.all(r.filter(i=>n.has(h1(i.style.fontFamily))).map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return u1(i.cssText,l,t)}))).join(`
|
|
206
|
+
`)}async function SL(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await wL(e,t);if(r){const n=document.createElement("style"),s=document.createTextNode(r);n.appendChild(s),e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}}async function CL(e,t={}){const{width:r,height:n}=i1(e,t),s=await jd(e,t,!0);return await SL(s,t),await d1(s,t),vL(s,t),await HD(s,r,n)}async function kL(e,t={}){const{width:r,height:n}=i1(e,t),s=await CL(e,t),i=await Iu(s),l=document.createElement("canvas"),a=l.getContext("2d"),c=t.pixelRatio||FD(),u=t.canvasWidth||r,m=t.canvasHeight||n;return l.width=u*c,l.height=m*c,t.skipAutoScale||BD(l),l.style.width=`${u}`,l.style.height=`${m}`,t.backgroundColor&&(a.fillStyle=t.backgroundColor,a.fillRect(0,0,l.width,l.height)),a.drawImage(i,0,0,l.width,l.height),l}async function EL(e,t={}){return(await kL(e,t)).toDataURL()}async function jL(){try{return(await EL(document.body,{canvasWidth:1600,cacheBust:!0})).replace(/^data:image\/png;base64,/,"")}catch{return}}function RL(e,t){const r=URL.createObjectURL(e),n=document.createElement("a");n.href=r,n.download=t,document.body.appendChild(n),n.click(),n.remove(),URL.revokeObjectURL(r)}const NL={background:"var(--bg-raised, var(--bg))",border:"1px solid var(--border)",borderRadius:"10px",padding:"20px",maxWidth:"420px",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",color:"var(--fg)"};function PL(){const[e,t]=C.useState("idle"),[r,n]=C.useState(null),[s,i]=C.useState(null);async function l(){t("loading-manifest"),i(null);try{const u=await me.debugReport.manifest();n(u),t("reviewing")}catch(u){i(u instanceof Error?u.message:String(u)),t("error")}}function a(){t("idle"),n(null),i(null)}async function c(){t("building"),i(null);try{const u=await jL(),m=await me.debugReport.download(u),d=new Date().toISOString().slice(0,10);RL(m,`jinn-debug-report-${d}.tar.gz`),a()}catch(u){i(u instanceof Error?u.message:String(u)),t("error")}}return o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:()=>void l(),disabled:e==="loading-manifest"||e==="building",style:{background:"transparent",border:"1px solid var(--border)",borderRadius:"6px",padding:"4px 10px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--fg-muted)",cursor:e==="building"?"wait":"pointer"},children:e==="building"?"building report…":"debug report"}),(e==="reviewing"||e==="building"||e==="error")&&o.jsx("div",{role:"dialog","aria-label":"Download debug report",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:a,children:o.jsxs("div",{style:NL,onClick:u=>u.stopPropagation(),children:[o.jsx("h2",{style:{fontFamily:"'Instrument Serif', 'Times New Roman', serif",fontSize:"22px",margin:"0 0 8px",color:"var(--fg)"},children:"Download debug report"}),o.jsx("p",{style:{color:"var(--fg-muted)",margin:"0 0 14px",lineHeight:1.5},children:"A support bundle for debugging this daemon. Secret values in the config, logs, and events are redacted — but the screenshot is not (see below). Review what it contains:"}),r&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{marginBottom:"12px"},children:[o.jsx("div",{style:{color:"var(--fg-dim)",marginBottom:"4px"},children:"Bundle contents"}),o.jsx("ul",{style:{margin:0,paddingLeft:"18px",color:"var(--fg)"},children:r.files.map(u=>o.jsx("li",{children:u},u))})]}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsx("div",{style:{color:"var(--fg-dim)",marginBottom:"4px"},children:"Redacted"}),o.jsx("ul",{style:{margin:0,paddingLeft:"18px",color:"var(--fg-muted)"},children:r.redaction.redacted.map(u=>o.jsx("li",{children:u},u))})]}),r.redaction.notRedacted&&r.redaction.notRedacted.length>0&&o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsx("div",{style:{color:"var(--break-red)",marginBottom:"4px"},children:"Not redacted — review before sharing"}),o.jsx("ul",{style:{margin:0,paddingLeft:"18px",color:"var(--fg-muted)"},children:r.redaction.notRedacted.map(u=>o.jsx("li",{children:u},u))})]})]}),s&&o.jsx("p",{style:{color:"var(--break-red)",margin:"0 0 12px"},children:s}),o.jsxs("div",{style:{display:"flex",gap:"10px",justifyContent:"flex-end"},children:[o.jsx("button",{type:"button",onClick:a,style:{background:"transparent",border:"1px solid var(--border)",borderRadius:"6px",padding:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--fg-muted)",cursor:"pointer"},children:"Cancel"}),o.jsx("button",{type:"button",onClick:()=>void c(),disabled:e==="building",style:{background:"var(--fg)",border:"1px solid var(--fg)",borderRadius:"6px",padding:"6px 12px",fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",color:"var(--bg)",cursor:e==="building"?"wait":"pointer"},children:e==="building"?"Building…":"Download"})]})]})})]})}function TL({network:e}){return o.jsxs("header",{className:"flex items-center justify-between px-6 py-3.5",children:[o.jsx(cr,{href:"/overview",className:"font-serif text-[26px] text-foreground no-underline",children:"jinn operator"}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Se,{variant:"outline",children:e}),o.jsx(PL,{})]})]})}const ry=[{path:"/overview",label:"Dashboard"},{path:"/events",label:"Events"},{path:"/operator",label:"Settings"}];function AL(){const[e]=Hr(),t=e.split(/[?#]/)[0]||"/",r=t==="/launcher"||t.startsWith("/launcher/"),{data:n}=Te({queryKey:["solvernets","launched","top-tabs"],queryFn:()=>me.solvernets.listLaunched(),refetchInterval:3e4,enabled:!r}),s=tg().pluginBuilderUi?[...ry,{path:"/build",label:"Build"}]:ry,l=r||((n==null?void 0:n.records.length)??0)>0?[...s,{path:"/launcher",label:"Launcher"}]:s;return o.jsx("nav",{className:"-mb-px flex px-6",children:l.map(a=>{const c=t===a.path||t.startsWith(`${a.path}/`);return o.jsx(cr,{href:a.path,"data-active":c?"true":"false",className:ee("border-b px-4 py-3.5 font-mono text-[11px] font-medium uppercase tracking-[0.14em] no-underline transition-colors",c?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:a.label},a.path)})})}function DL({agentGated:e}){return o.jsxs("div",{className:"agent-rail flex h-full min-w-0 flex-col gap-3 overflow-hidden p-4",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground [overflow-wrap:anywhere]",children:"Claude"}),o.jsx(wS,{agentGated:e})]})}var LL=e=>{switch(e){case"success":return IL;case"info":return BL;case"warning":return FL;case"error":return $L;default:return null}},OL=Array(12).fill(0),ML=({visible:e,className:t})=>Z.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Z.createElement("div",{className:"sonner-spinner"},OL.map((r,n)=>Z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),IL=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),FL=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),BL=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),$L=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),HL=Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),UL=()=>{let[e,t]=Z.useState(document.hidden);return Z.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},lp=1,zL=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:lp++,i=this.toasts.find(a=>a.id===s),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...e,id:s,title:r}),{...a,...e,id:s,dismissible:l,title:r}):a):this.addToast({title:r,...n,dismissible:l,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,i,l=n.then(async c=>{if(i=["resolve",c],Z.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(VL(c)&&!c.ok){s=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,m=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:u,description:m})}else if(t.success!==void 0){s=!1;let u=typeof t.success=="function"?await t.success(c):t.success,m=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:u,description:m})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){s=!1;let u=typeof t.error=="function"?await t.error(c):t.error,m=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:u,description:m})}}).finally(()=>{var c;s&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),a=()=>new Promise((c,u)=>l.then(()=>i[0]==="reject"?u(i[1]):c(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:a}:Object.assign(r,{unwrap:a})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||lp++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},nr=new zL,WL=(e,t)=>{let r=(t==null?void 0:t.id)||lp++;return nr.addToast({title:e,...t,id:r}),r},VL=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",qL=WL,KL=()=>nr.toasts,GL=()=>nr.getActiveToasts(),An=Object.assign(qL,{success:nr.success,info:nr.info,warning:nr.warning,error:nr.error,custom:nr.custom,message:nr.message,promise:nr.promise,dismiss:nr.dismiss,loading:nr.loading},{getHistory:KL,getToasts:GL});function QL(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}QL(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
207
|
+
`);function Pc(e){return e.label!==void 0}var YL=3,ZL="32px",XL="16px",ny=4e3,JL=356,eO=14,tO=20,rO=200;function Yr(...e){return e.filter(Boolean).join(" ")}function nO(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var sO=e=>{var t,r,n,s,i,l,a,c,u,m,d;let{invert:x,toast:v,unstyled:_,interacting:y,setHeights:h,visibleToasts:p,heights:f,index:g,toasts:b,expanded:w,removeToast:k,defaultRichColors:j,closeButton:S,style:E,cancelButtonStyle:N,actionButtonStyle:O,className:T="",descriptionClassName:L="",duration:$,position:U,gap:z,loadingIcon:K,expandByDefault:R,classNames:P,icons:D,closeButtonAriaLabel:M="Close toast",pauseWhenPageIsHidden:V}=e,[W,J]=Z.useState(null),[X,fe]=Z.useState(null),[A,B]=Z.useState(!1),[G,Y]=Z.useState(!1),[ce,Q]=Z.useState(!1),[ge,De]=Z.useState(!1),[Ue,Ct]=Z.useState(!1),[Ce,dr]=Z.useState(0),[hr,On]=Z.useState(0),Wr=Z.useRef(v.duration||$||ny),Mn=Z.useRef(null),ft=Z.useRef(null),xn=g===0,I=g+1<=p,H=v.type,q=v.dismissible!==!1,re=v.className||"",se=v.descriptionClassName||"",te=Z.useMemo(()=>f.findIndex(je=>je.toastId===v.id)||0,[f,v.id]),le=Z.useMemo(()=>{var je;return(je=v.closeButton)!=null?je:S},[v.closeButton,S]),he=Z.useMemo(()=>v.duration||$||ny,[v.duration,$]),Re=Z.useRef(0),Je=Z.useRef(0),Vt=Z.useRef(0),kt=Z.useRef(null),[In,Ea]=U.split("-"),Zi=Z.useMemo(()=>f.reduce((je,Ke,st)=>st>=te?je:je+Ke.height,0),[f,te]),oc=UL(),ac=v.invert||x,ja=H==="loading";Je.current=Z.useMemo(()=>te*z+Zi,[te,Zi]),Z.useEffect(()=>{Wr.current=he},[he]),Z.useEffect(()=>{B(!0)},[]),Z.useEffect(()=>{let je=ft.current;if(je){let Ke=je.getBoundingClientRect().height;return On(Ke),h(st=>[{toastId:v.id,height:Ke,position:v.position},...st]),()=>h(st=>st.filter(qr=>qr.toastId!==v.id))}},[h,v.id]),Z.useLayoutEffect(()=>{if(!A)return;let je=ft.current,Ke=je.style.height;je.style.height="auto";let st=je.getBoundingClientRect().height;je.style.height=Ke,On(st),h(qr=>qr.find(Kr=>Kr.toastId===v.id)?qr.map(Kr=>Kr.toastId===v.id?{...Kr,height:st}:Kr):[{toastId:v.id,height:st,position:v.position},...qr])},[A,v.title,v.description,h,v.id]);let Vr=Z.useCallback(()=>{Y(!0),dr(Je.current),h(je=>je.filter(Ke=>Ke.toastId!==v.id)),setTimeout(()=>{k(v)},rO)},[v,k,h,Je]);Z.useEffect(()=>{if(v.promise&&H==="loading"||v.duration===1/0||v.type==="loading")return;let je;return w||y||V&&oc?(()=>{if(Vt.current<Re.current){let Ke=new Date().getTime()-Re.current;Wr.current=Wr.current-Ke}Vt.current=new Date().getTime()})():Wr.current!==1/0&&(Re.current=new Date().getTime(),je=setTimeout(()=>{var Ke;(Ke=v.onAutoClose)==null||Ke.call(v,v),Vr()},Wr.current)),()=>clearTimeout(je)},[w,y,v,H,V,oc,Vr]),Z.useEffect(()=>{v.delete&&Vr()},[Vr,v.delete]);function mE(){var je,Ke,st;return D!=null&&D.loading?Z.createElement("div",{className:Yr(P==null?void 0:P.loader,(je=v==null?void 0:v.classNames)==null?void 0:je.loader,"sonner-loader"),"data-visible":H==="loading"},D.loading):K?Z.createElement("div",{className:Yr(P==null?void 0:P.loader,(Ke=v==null?void 0:v.classNames)==null?void 0:Ke.loader,"sonner-loader"),"data-visible":H==="loading"},K):Z.createElement(ML,{className:Yr(P==null?void 0:P.loader,(st=v==null?void 0:v.classNames)==null?void 0:st.loader),visible:H==="loading"})}return Z.createElement("li",{tabIndex:0,ref:ft,className:Yr(T,re,P==null?void 0:P.toast,(t=v==null?void 0:v.classNames)==null?void 0:t.toast,P==null?void 0:P.default,P==null?void 0:P[H],(r=v==null?void 0:v.classNames)==null?void 0:r[H]),"data-sonner-toast":"","data-rich-colors":(n=v.richColors)!=null?n:j,"data-styled":!(v.jsx||v.unstyled||_),"data-mounted":A,"data-promise":!!v.promise,"data-swiped":Ue,"data-removed":G,"data-visible":I,"data-y-position":In,"data-x-position":Ea,"data-index":g,"data-front":xn,"data-swiping":ce,"data-dismissible":q,"data-type":H,"data-invert":ac,"data-swipe-out":ge,"data-swipe-direction":X,"data-expanded":!!(w||R&&A),style:{"--index":g,"--toasts-before":g,"--z-index":b.length-g,"--offset":`${G?Ce:Je.current}px`,"--initial-height":R?"auto":`${hr}px`,...E,...v.style},onDragEnd:()=>{Q(!1),J(null),kt.current=null},onPointerDown:je=>{ja||!q||(Mn.current=new Date,dr(Je.current),je.target.setPointerCapture(je.pointerId),je.target.tagName!=="BUTTON"&&(Q(!0),kt.current={x:je.clientX,y:je.clientY}))},onPointerUp:()=>{var je,Ke,st,qr;if(ge||!q)return;kt.current=null;let Kr=Number(((je=ft.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),cs=Number(((Ke=ft.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ai=new Date().getTime()-((st=Mn.current)==null?void 0:st.getTime()),Gr=W==="x"?Kr:cs,us=Math.abs(Gr)/ai;if(Math.abs(Gr)>=tO||us>.11){dr(Je.current),(qr=v.onDismiss)==null||qr.call(v,v),fe(W==="x"?Kr>0?"right":"left":cs>0?"down":"up"),Vr(),De(!0),Ct(!1);return}Q(!1),J(null)},onPointerMove:je=>{var Ke,st,qr,Kr;if(!kt.current||!q||((Ke=window.getSelection())==null?void 0:Ke.toString().length)>0)return;let cs=je.clientY-kt.current.y,ai=je.clientX-kt.current.x,Gr=(st=e.swipeDirections)!=null?st:nO(U);!W&&(Math.abs(ai)>1||Math.abs(cs)>1)&&J(Math.abs(ai)>Math.abs(cs)?"x":"y");let us={x:0,y:0};W==="y"?(Gr.includes("top")||Gr.includes("bottom"))&&(Gr.includes("top")&&cs<0||Gr.includes("bottom")&&cs>0)&&(us.y=cs):W==="x"&&(Gr.includes("left")||Gr.includes("right"))&&(Gr.includes("left")&&ai<0||Gr.includes("right")&&ai>0)&&(us.x=ai),(Math.abs(us.x)>0||Math.abs(us.y)>0)&&Ct(!0),(qr=ft.current)==null||qr.style.setProperty("--swipe-amount-x",`${us.x}px`),(Kr=ft.current)==null||Kr.style.setProperty("--swipe-amount-y",`${us.y}px`)}},le&&!v.jsx?Z.createElement("button",{"aria-label":M,"data-disabled":ja,"data-close-button":!0,onClick:ja||!q?()=>{}:()=>{var je;Vr(),(je=v.onDismiss)==null||je.call(v,v)},className:Yr(P==null?void 0:P.closeButton,(s=v==null?void 0:v.classNames)==null?void 0:s.closeButton)},(i=D==null?void 0:D.close)!=null?i:HL):null,v.jsx||C.isValidElement(v.title)?v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title:Z.createElement(Z.Fragment,null,H||v.icon||v.promise?Z.createElement("div",{"data-icon":"",className:Yr(P==null?void 0:P.icon,(l=v==null?void 0:v.classNames)==null?void 0:l.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||mE():null,v.type!=="loading"?v.icon||(D==null?void 0:D[H])||LL(H):null):null,Z.createElement("div",{"data-content":"",className:Yr(P==null?void 0:P.content,(a=v==null?void 0:v.classNames)==null?void 0:a.content)},Z.createElement("div",{"data-title":"",className:Yr(P==null?void 0:P.title,(c=v==null?void 0:v.classNames)==null?void 0:c.title)},typeof v.title=="function"?v.title():v.title),v.description?Z.createElement("div",{"data-description":"",className:Yr(L,se,P==null?void 0:P.description,(u=v==null?void 0:v.classNames)==null?void 0:u.description)},typeof v.description=="function"?v.description():v.description):null),C.isValidElement(v.cancel)?v.cancel:v.cancel&&Pc(v.cancel)?Z.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||N,onClick:je=>{var Ke,st;Pc(v.cancel)&&q&&((st=(Ke=v.cancel).onClick)==null||st.call(Ke,je),Vr())},className:Yr(P==null?void 0:P.cancelButton,(m=v==null?void 0:v.classNames)==null?void 0:m.cancelButton)},v.cancel.label):null,C.isValidElement(v.action)?v.action:v.action&&Pc(v.action)?Z.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||O,onClick:je=>{var Ke,st;Pc(v.action)&&((st=(Ke=v.action).onClick)==null||st.call(Ke,je),!je.defaultPrevented&&Vr())},className:Yr(P==null?void 0:P.actionButton,(d=v==null?void 0:v.classNames)==null?void 0:d.actionButton)},v.action.label):null))};function sy(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function iO(e,t){let r={};return[e,t].forEach((n,s)=>{let i=s===1,l=i?"--mobile-offset":"--offset",a=i?XL:ZL;function c(u){["top","right","bottom","left"].forEach(m=>{r[`${l}-${m}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${l}-${u}`]=a:r[`${l}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(a)}),r}var oO=C.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:l,className:a,offset:c,mobileOffset:u,theme:m="light",richColors:d,duration:x,style:v,visibleToasts:_=YL,toastOptions:y,dir:h=sy(),gap:p=eO,loadingIcon:f,icons:g,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:w}=e,[k,j]=Z.useState([]),S=Z.useMemo(()=>Array.from(new Set([n].concat(k.filter(V=>V.position).map(V=>V.position)))),[k,n]),[E,N]=Z.useState([]),[O,T]=Z.useState(!1),[L,$]=Z.useState(!1),[U,z]=Z.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=Z.useRef(null),R=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=Z.useRef(null),D=Z.useRef(!1),M=Z.useCallback(V=>{j(W=>{var J;return(J=W.find(X=>X.id===V.id))!=null&&J.delete||nr.dismiss(V.id),W.filter(({id:X})=>X!==V.id)})},[]);return Z.useEffect(()=>nr.subscribe(V=>{if(V.dismiss){j(W=>W.map(J=>J.id===V.id?{...J,delete:!0}:J));return}setTimeout(()=>{cw.flushSync(()=>{j(W=>{let J=W.findIndex(X=>X.id===V.id);return J!==-1?[...W.slice(0,J),{...W[J],...V},...W.slice(J+1)]:[V,...W]})})})}),[]),Z.useEffect(()=>{if(m!=="system"){z(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:W})=>{z(W?"dark":"light")})}catch{V.addListener(({matches:J})=>{try{z(J?"dark":"light")}catch(X){console.error(X)}})}},[m]),Z.useEffect(()=>{k.length<=1&&T(!1)},[k]),Z.useEffect(()=>{let V=W=>{var J,X;s.every(fe=>W[fe]||W.code===fe)&&(T(!0),(J=K.current)==null||J.focus()),W.code==="Escape"&&(document.activeElement===K.current||(X=K.current)!=null&&X.contains(document.activeElement))&&T(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[s]),Z.useEffect(()=>{if(K.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,D.current=!1)}},[K.current]),Z.createElement("section",{ref:t,"aria-label":`${b} ${R}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map((V,W)=>{var J;let[X,fe]=V.split("-");return k.length?Z.createElement("ol",{key:V,dir:h==="auto"?sy():h,tabIndex:-1,ref:K,className:a,"data-sonner-toaster":!0,"data-theme":U,"data-y-position":X,"data-lifted":O&&k.length>1&&!i,"data-x-position":fe,style:{"--front-toast-height":`${((J=E[0])==null?void 0:J.height)||0}px`,"--width":`${JL}px`,"--gap":`${p}px`,...v,...iO(c,u)},onBlur:A=>{D.current&&!A.currentTarget.contains(A.relatedTarget)&&(D.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||D.current||(D.current=!0,P.current=A.relatedTarget)},onMouseEnter:()=>T(!0),onMouseMove:()=>T(!0),onMouseLeave:()=>{L||T(!1)},onDragEnd:()=>T(!1),onPointerDown:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},k.filter(A=>!A.position&&W===0||A.position===V).map((A,B)=>{var G,Y;return Z.createElement(sO,{key:A.id,icons:g,index:B,toast:A,defaultRichColors:d,duration:(G=y==null?void 0:y.duration)!=null?G:x,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:r,visibleToasts:_,closeButton:(Y=y==null?void 0:y.closeButton)!=null?Y:l,interacting:L,position:V,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:M,toasts:k.filter(ce=>ce.position==A.position),heights:E.filter(ce=>ce.position==A.position),setHeights:N,expandByDefault:i,gap:p,loadingIcon:f,expanded:O,pauseWhenPageIsHidden:w,swipeDirections:e.swipeDirections})})):null}))});const Qe=C.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>o.jsx("div",{ref:s,role:r?"none":"separator","aria-orientation":t,className:ee("shrink-0 bg-border",t==="horizontal"?"h-px w-full":"h-full w-px",e),...n}));Qe.displayName="Separator";const aO="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",wh="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",lO="font-mono text-[24px] font-medium tracking-[-0.01em] text-foreground",cO="font-mono text-[12px] font-medium text-[var(--fg-muted)]",iy="font-mono text-[12px] text-[var(--fg-dim)]";function uO(e,t,r){switch(e){case"ready":return{value:t,copy:null};case"error":return{value:"unavailable",copy:r??"Sepolia tJINN balance temporarily unavailable."};case"pending":return{value:"pending",copy:"Waiting for Sepolia balance."}}}function dO({totalEth:e,runwayDays:t,tjinnEarned:r,tjinnEarnedLast24h:n,tjinnState:s,tjinnError:i,lastPasswordRotationAt:l,onTopUp:a,actionsDisabled:c=!1}){const[,u]=Hr(),{value:m,copy:d}=uO(s,r,i);return o.jsx(Lr,{delayDuration:150,children:o.jsxs(we,{role:"region","aria-label":"Wallet","data-testid":"wallet-card",className:"flex flex-col gap-6 p-6",children:[o.jsx("span",{className:aO,children:"Wallet"}),o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-rewards",children:[o.jsx("span",{className:wh,children:"Rewards"}),o.jsxs("div",{className:"flex flex-col gap-1","data-testid":"tjinn-earned-24h-region","aria-live":"polite","aria-atomic":"true",children:[o.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"JINN earned last 24hrs"}),o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-2xl font-bold tracking-tight","data-testid":"tjinn-earned-24h-value",style:s==="error"?{color:"var(--break-red)"}:void 0,children:n??(s==="error"?"unavailable":"pending")}),n!==null&&o.jsx("span",{className:"text-xs text-muted-foreground",children:"tJINN"})]})]}),o.jsxs("div",{className:"flex flex-col gap-1","data-testid":"tjinn-earned-region","aria-live":"polite","aria-atomic":"true",children:[o.jsx("p",{className:"text-xs text-muted-foreground","data-testid":"tjinn-earned-state-prefix",children:"Lifetime"}),o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-base font-medium","data-testid":"tjinn-earned-value",style:s==="error"?{color:"var(--break-red)"}:void 0,children:m}),s==="ready"&&o.jsx("span",{className:"text-xs text-muted-foreground",children:"tJINN"})]}),d&&o.jsx("span",{className:"text-xs text-muted-foreground","data-testid":"tjinn-earned-state",children:d})]})]}),o.jsx(Qe,{}),o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-gas",children:[o.jsx("span",{className:wh,children:"Gas"}),o.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[o.jsx("span",{className:lO,children:e}),o.jsx("span",{className:cO,children:"ETH"}),o.jsx("span",{className:iy,children:"·"}),o.jsxs("span",{className:iy,children:[t,"d runway"]})]}),o.jsx(ie,{variant:"outline",size:"sm","aria-label":"Top up from faucet",onClick:a,disabled:c,"data-testid":"wallet-topup",className:"self-start",children:"Top up from faucet (free)"})]}),o.jsx(Qe,{}),o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"wallet-section-password",children:[o.jsx("span",{className:wh,children:"Password"}),o.jsxs("span",{className:"font-mono text-[12px] text-[var(--fg-dim)]",children:["last rotated:"," ",l?o.jsx("time",{dateTime:l,className:"text-[var(--fg-muted)]",children:l}):o.jsx("span",{className:"text-[var(--fg-muted)]",children:"never"})]}),o.jsx(ie,{variant:"secondary",size:"sm","aria-label":"Change password",onClick:()=>u("/operator/security"),"data-testid":"wallet-change-password",className:"self-start",children:"Change password"})]})]})})}const hO="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",fO="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",cp="font-mono text-[14px] text-foreground",pO="font-mono text-[14px] text-[var(--fg-muted)]";function mO(e){return e.length<10?e:`${e.slice(0,6)}…${e.slice(-4)}`}function up(){return o.jsx("span",{"data-testid":"identity-stat-empty",className:pO,children:"—"})}function dp({label:e,children:t}){return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("span",{className:fO,children:e}),t]})}function oy({label:e,address:t,testId:r}){return o.jsx(dp,{label:e,children:t?o.jsxs(un,{children:[o.jsx(dn,{asChild:!0,children:o.jsx("span",{"data-testid":r,tabIndex:0,className:`cursor-help ${cp}`,children:mO(t)})}),o.jsx(Mr,{children:t})]}):o.jsx(up,{})})}function gO({masterAddress:e,safeAddress:t,serviceId:r,agentId:n,services:s=[],bindingError:i}){const l=s.find(h=>h.agentId!==null&&!h.safeBoundToAgent),[a,c]=C.useState(!1),[u,m]=C.useState(!1),[d,x]=C.useState(null),[v,_]=C.useState(i??null),y=async()=>{if(l){m(!0),x(null),_(null);try{const p=(await me.retryAgentBinding({serviceIndex:l.index})).attempts[0];(p==null?void 0:p.status)==="success"?(x("success"),c(!1)):(x("reverted"),_((p==null?void 0:p.detail)??"Bind reverted on chain."))}catch(h){x("reverted"),_(h instanceof Error?h.message:String(h))}finally{m(!1)}}};return o.jsx(Lr,{delayDuration:150,children:o.jsxs(we,{role:"region","aria-label":"Identity","data-testid":"identity-card",className:"flex flex-col gap-6 p-6",children:[o.jsx("span",{className:hO,children:"Identity"}),o.jsxs("div",{className:"flex flex-wrap gap-8",children:[o.jsx(dp,{label:"Service",children:r!==null?o.jsxs("span",{"data-testid":"identity-service-id",className:cp,children:["#",r]}):o.jsx(up,{})}),o.jsx(dp,{label:"Agent",children:o.jsxs("span",{className:`flex items-center gap-2 ${cp}`,children:[n!==null?`#${n}`:o.jsx(up,{}),l&&o.jsx("button",{type:"button",onClick:()=>c(h=>!h),className:"cursor-pointer rounded-full border border-[var(--wane)] bg-transparent px-1.5 py-px font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--wane)]",children:"binding pending"}),d==="success"&&o.jsx(Se,{variant:"success",className:"rounded-full normal-case tracking-[0.12em]",children:"bound"})]})}),o.jsx(oy,{label:"Master",address:e,testId:"identity-master-address"}),o.jsx(oy,{label:"Safe",address:t,testId:"identity-safe-address"})]}),l&&o.jsxs(Ye,{variant:"warning","data-testid":"identity-state-message-safe-not-bound",className:"flex flex-col gap-2",children:[o.jsxs(Xe,{children:["Service #",l.index," Safe is not yet bound to agent #",l.agentId,". The bootstrap left it unbound; retry to attempt the ERC-1271 bind again."]}),a&&v&&o.jsx("span",{className:"font-mono text-[11px] text-[var(--break-red)]",children:v}),o.jsx(ie,{variant:"default",size:"sm",onClick:()=>{a||c(!0),y()},disabled:u,className:"self-start",children:u?"Retrying…":"Retry binding"})]}),n===null&&o.jsx(Ye,{variant:"warning","data-testid":"identity-state-message-agent-id-not-minted",children:o.jsx(Xe,{children:"Agent ID has not yet been minted. The daemon mints it during bootstrap; if this persists, check the bootstrap logs."})})]})})}const vg="claude-code",Rd="codex",ca="hermes-agent",vO={"claude-code-learner":vg,"codex-code-learner":Rd},xO={[vg]:"Claude Code",[Rd]:"Codex",[ca]:"Hermes Agent","swe-rebench-v2-evaluator":"SWE-rebench v2 Evaluator"};function kr(e){return e?vO[e]??e:""}function Ks(e){const t=kr(e);return xO[t]??t}function f1(e,t){const r=Ks(e);return t?`${r} ${t}`:r}function yO(e,t){return kr(e)===kr(t)}const _O="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",bO="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function wO({name:e}){var x;const t=ii(),{data:r,isError:n,error:s}=Te({queryKey:["harness-readiness",e],queryFn:()=>me.harnessReadiness(e),refetchInterval:3e4}),i=kr(e)===Rd,l=Te({queryKey:["codex-doctor"],queryFn:()=>me.codexDoctor(),refetchInterval:3e4,enabled:i});function a(){return n?"error":(r==null?void 0:r.ready)===!0?"ready":(r==null?void 0:r.ready)===!1?"not-ready":null}const c=a(),u=c==="not-ready",m=()=>{t.invalidateQueries({queryKey:["harness-readiness",e]})},d=()=>{const v=r==null?void 0:r.nextStep;if(v){if(v.url){window.open(v.url,"_blank","noopener,noreferrer");return}v.cli&&navigator.clipboard.writeText(v.cli).then(()=>An.success("Command copied",{description:v.cli,duration:5e3})).catch(()=>An.error("Could not copy",{description:v.cli,duration:1/0}))}};return o.jsxs("div",{"data-testid":`harness-row-${e}`,className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex flex-wrap items-baseline gap-3",children:[o.jsx("span",{className:bO,children:e}),c==="ready"&&o.jsx(Se,{variant:"success","data-testid":`harness-pill-ready-${e}`,children:"ready"}),c==="not-ready"&&o.jsx(Se,{variant:"destructive","data-testid":`harness-pill-not-ready-${e}`,children:"not ready"}),c==="error"&&o.jsx(Se,{variant:"outline","data-testid":`harness-pill-error-${e}`,children:"unavailable"})]}),c==="not-ready"&&(r==null?void 0:r.reason)&&o.jsx("span",{className:"font-mono text-[12px] text-[var(--break-red)]",children:r.reason}),c==="not-ready"&&(r==null?void 0:r.nextStep)&&o.jsxs("span",{"data-testid":`harness-next-step-${e}`,className:"font-mono text-[12px] text-[var(--fg-muted)]",children:[r.nextStep.description,r.nextStep.cli?` (${r.nextStep.cli})`:""]}),c==="error"&&o.jsx("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:s instanceof Error?s.message:"Readiness check failed."}),i&&((x=l.data)==null?void 0:x.versionStatus)==="untested"&&o.jsxs("span",{"data-testid":"codex-version-hint-untested",className:"font-mono text-[12px] text-[var(--severity-warning-fg)]",children:["Codex CLI ",l.data.cliVersion," is outside the tested range — harness may break."]}),u&&o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ie,{variant:"default",size:"sm","data-testid":`harness-reauth-${e}`,onClick:d,children:"Re-authenticate"}),o.jsx(ie,{variant:"outline",size:"sm","data-testid":`harness-recheck-${e}`,onClick:m,children:"Re-check"})]})]})}function SO(){const[,e]=Hr();return o.jsxs("div",{className:"flex flex-col gap-2","data-testid":"harness-empty-state",children:[o.jsx("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:"No SolverNets joined — Harness Readiness will populate after you join one."}),o.jsx(ie,{variant:"outline",size:"sm",onClick:()=>e("/operator/registry"),"data-testid":"harness-empty-state-browse",className:"self-start",children:"Browse SolverNets"})]})}function CO({harnessNames:e}){return o.jsxs(we,{role:"region","aria-label":"Harness Readiness","data-testid":"harness-status-panel",className:"flex flex-col gap-4 p-6",children:[o.jsx("span",{className:_O,children:"Harness Readiness"}),e.length===0?o.jsx(SO,{}):o.jsx("div",{className:"flex flex-col gap-4",children:e.map((t,r)=>o.jsxs(C.Fragment,{children:[r>0&&o.jsx(Qe,{}),o.jsx(wO,{name:t})]},t))})]})}const Sh="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",ay="flex items-center gap-2 font-mono text-[17px] font-medium text-foreground";function ly({tone:e}){const t=e==="good"?"bg-[var(--vow-green)]":e==="bad"?"bg-[var(--break-red)]":"bg-[var(--fg-muted)]";return o.jsx("span",{"aria-hidden":"true",className:ee("inline-block h-2 w-2 rounded-full",t)})}function kO({daemonStatus:e,daemonStateMessage:t,rpcStatus:r,onRestart:n}){const[,s]=Hr(),[i,l]=C.useState(null),a=e==="running",c=r==="healthy";function u(){i||!n||(l("restart"),Promise.resolve().then(n).catch(m=>console.error("[node-health] restart failed:",m)).finally(()=>l(null)))}return o.jsx(Lr,{delayDuration:150,children:o.jsxs(we,{"data-testid":"node-health-card","aria-labelledby":"node-health-heading",className:"flex flex-col gap-4 p-6",children:[o.jsx("h2",{id:"node-health-heading",className:ee(Sh,"m-0 text-[var(--fg-dim)]"),children:"Node health"}),o.jsxs("div",{"data-testid":"node-health-daemon-row","data-status":e,className:"flex flex-col gap-2",children:[o.jsx("span",{className:Sh,children:"Daemon"}),o.jsxs("span",{className:ay,children:[o.jsx(ly,{tone:a?"good":"bad"}),a?"Running":"Stopped"]}),t&&o.jsx("span",{"data-testid":"node-health-daemon-state",className:"font-mono text-[12px] leading-snug text-[var(--fg-muted)]",children:t}),o.jsx("div",{className:"mt-2 flex gap-2",children:o.jsxs(un,{children:[o.jsx(dn,{asChild:!0,children:o.jsx("span",{tabIndex:a?-1:0,children:o.jsx(ie,{variant:"outline",size:"sm",disabled:!a||i!==null,"data-testid":"node-health-restart",onClick:u,children:i==="restart"?"Restarting...":"Restart"})})}),o.jsx(Mr,{children:a?"Restart the daemon. The dashboard reconnects when it comes back.":"Daemon is stopped — re-run jinn from your terminal to start it."})]})})]}),o.jsxs("div",{"data-testid":"node-health-rpc-row","data-status":r,className:"flex flex-col gap-2",children:[o.jsx("span",{className:Sh,children:"RPC"}),o.jsxs("span",{className:ay,children:[o.jsx(ly,{tone:c?"good":"bad"}),c?"Healthy":"Unreachable"]}),o.jsx("div",{className:"mt-2 flex gap-2",children:o.jsx(ie,{variant:"outline",size:"sm","data-testid":"node-health-rpc-settings",onClick:()=>s("/operator/network"),children:"Manage RPC"})})]})]})})}const Wi=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:r,className:ee("w-full caption-bottom font-mono text-[12px]",e),...t})}));Wi.displayName="Table";const Vi=C.forwardRef(({className:e,...t},r)=>o.jsx("thead",{ref:r,className:ee("[&_tr]:border-b [&_tr]:border-border",e),...t}));Vi.displayName="TableHeader";const qi=C.forwardRef(({className:e,...t},r)=>o.jsx("tbody",{ref:r,className:ee("[&_tr:last-child]:border-0",e),...t}));qi.displayName="TableBody";const EO=C.forwardRef(({className:e,...t},r)=>o.jsx("tfoot",{ref:r,className:ee("border-t border-border bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));EO.displayName="TableFooter";const Er=C.forwardRef(({className:e,...t},r)=>o.jsx("tr",{ref:r,className:ee("border-b border-border transition-colors hover:bg-[var(--bg-sunken)]/50 data-[state=selected]:bg-[var(--bg-sunken)]",e),...t}));Er.displayName="TableRow";const We=C.forwardRef(({className:e,...t},r)=>o.jsx("th",{ref:r,className:ee("h-8 px-2 text-left align-middle font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",e),...t}));We.displayName="TableHead";const Ve=C.forwardRef(({className:e,...t},r)=>o.jsx("td",{ref:r,className:ee("px-2 py-2 align-middle",e),...t}));Ve.displayName="TableCell";const jO=C.forwardRef(({className:e,...t},r)=>o.jsx("caption",{ref:r,className:ee("mt-4 text-[12px] text-[var(--fg-muted)]",e),...t}));jO.displayName="TableCaption";const RO=new Set(["DISCOVERED","CLAIMED","WAITING","PRE_SNAPSHOT","RUNNING","POST_SNAPSHOT","PACKAGING","DELIVERING"]);function NO(e,t=6,r=4){return e.length<=t+r+1?e:`${e.slice(0,t)}…${e.slice(-r)}`}function PO(e){return e==="restoration"?"solve":e==="evaluation"?"evaluate":"—"}function TO(e){return e==="COMPLETE"?{label:"succeeded",detail:"COMPLETE",tone:"good"}:e==="FAILED"?{label:"failed",detail:"FAILED",tone:"bad"}:e==="RACE_LOST"?{label:"race-lost",detail:"RACE_LOST",tone:"neutral"}:RO.has(e)?{label:"active",detail:e.toLowerCase().replace(/_/g," "),tone:"active"}:{label:e.toLowerCase().replace(/_/g," "),detail:e,tone:"neutral"}}function AO(e){return e==="bad"?"destructive":e==="good"?"success":e==="active"?"default":"outline"}function DO(e){if(!e)return"—";const t=Math.floor((Date.now()-e)/1e3);return t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function LO(e){return e==="solving"||e==="solver"?"solver":e==="evaluating"||e==="evaluator"?"evaluator":e}const OO="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground m-0";function hp({children:e,className:t}){return o.jsx("h3",{className:ee(OO,t),children:e})}function Tc({label:e,children:t}){return o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx(hp,{children:e}),o.jsx("div",{className:"font-mono text-[12px] text-foreground",children:t})]})}function MO({joined:e,tasks:t}){var a,c;const[,r]=Hr(),[n,s]=C.useState(((a=e[0])==null?void 0:a.manifestCid)??((c=e[0])==null?void 0:c.name)??null),i=C.useMemo(()=>e.find(u=>(u.manifestCid??u.name)===n)??e[0]??null,[e,n]),l=C.useMemo(()=>i?t.filter(u=>{if(u.state==="FAILED"){if(u.runStartedAt===null)return!1;const m=(u.failureReason??"").toLowerCase();if(m.includes("not ready")||m.includes("not enabled"))return!1}return e.length<=1?!0:u.solverType&&i.solverType?u.solverType===i.solverType:u.manifestCid&&i.manifestCid?u.manifestCid===i.manifestCid:!0}):[],[t,i,e.length,n]);return o.jsx(Lr,{delayDuration:150,children:o.jsxs(we,{role:"region","aria-label":"Activity","data-testid":"activity-card",children:[o.jsxs(Yt,{className:"flex flex-row items-center justify-between gap-3 pb-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(o2,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}),o.jsx(fn,{children:"Activity"})]}),o.jsxs(ie,{variant:"secondary",size:"sm","data-testid":"activity-view-event-log",onClick:()=>r("/events"),children:[o.jsx(p2,{className:"h-3 w-3","aria-hidden":"true"}),"View event log"]})]}),o.jsx(Ge,{children:o.jsxs("div",{className:"grid items-start gap-6 [grid-template-columns:minmax(160px,200px)_minmax(0,1fr)_minmax(180px,220px)]",children:[o.jsxs("div",{"data-testid":"activity-joined",className:"flex min-w-0 flex-col gap-3",children:[o.jsx(hp,{children:"Joined"}),e.length===0?o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No SolverNets joined."}):o.jsx(Ql,{className:"max-h-[280px]",children:o.jsx("div",{className:"flex flex-col gap-1 pr-2",children:e.map(u=>{const m=u.manifestCid??u.name,d=m===((i==null?void 0:i.manifestCid)??(i==null?void 0:i.name));return o.jsx(ie,{variant:"ghost",size:"sm","data-testid":`activity-joined-row-${m}`,"data-state":d?"active":void 0,"aria-current":d?"true":void 0,onClick:()=>s(m),className:ee("h-auto w-full justify-start gap-0 rounded-sm border-l-2 px-2.5 py-1.5 font-mono text-[12px] normal-case tracking-normal",d?"border-l-primary bg-accent text-foreground":"border-l-transparent text-muted-foreground hover:bg-accent hover:text-foreground"),children:o.jsx("span",{className:"truncate",children:u.name})},m)})})}),o.jsxs(ie,{variant:"outline",size:"sm","data-testid":"activity-join-more",onClick:()=>r("/operator/registry"),className:"self-start",children:[o.jsx(x2,{className:"h-3 w-3","aria-hidden":"true"}),"Join more SolverNets"]})]}),o.jsxs("div",{"data-testid":"activity-tasks",className:"flex min-w-0 flex-col gap-3",children:[i&&o.jsx("h2",{className:"m-0 font-serif text-[20px] font-normal leading-tight text-foreground",children:i.name}),l.length===0?o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No task runs recorded yet."}):o.jsx("div",{"data-testid":"activity-tasks-table",children:o.jsxs(Wi,{children:[o.jsx(Vi,{children:o.jsxs(Er,{className:"hover:bg-transparent",children:[o.jsx(We,{children:"Run"}),o.jsx(We,{children:"Task"}),o.jsx(We,{children:"State"}),o.jsx(We,{children:"Started"})]})}),o.jsx(qi,{children:l.map(u=>{const m=TO(u.state),d=m.tone==="active";return o.jsxs(Er,{"data-active":d?"true":void 0,"data-testid":`activity-task-row-${u.requestId}`,className:ee("border-l-2",d?"border-l-primary bg-primary/[0.06]":"border-l-transparent"),children:[o.jsx(Ve,{className:"text-muted-foreground",children:PO(u.taskRole)}),o.jsx(Ve,{children:o.jsxs(un,{children:[o.jsx(dn,{asChild:!0,children:o.jsx("button",{type:"button",className:"bg-transparent p-0 font-mono text-[12px] text-[var(--accent-sky)] underline-offset-4 hover:underline",onClick:()=>r(`/events?requestId=${encodeURIComponent(u.requestId)}`),children:NO(u.requestId)})}),o.jsx(Mr,{children:u.requestId})]})}),o.jsx(Ve,{children:o.jsxs(un,{children:[o.jsx(dn,{asChild:!0,children:o.jsx("button",{type:"button",className:"cursor-help bg-transparent p-0",children:o.jsx(Se,{variant:AO(m.tone),children:m.label})})}),o.jsx(Mr,{children:m.detail})]})}),o.jsx(Ve,{className:"text-muted-foreground",children:DO(u.runStartedAt??u.stateUpdatedAt)})]},u.requestId)})})]})})]}),o.jsxs("div",{"data-testid":"activity-settings",className:"flex min-w-0 flex-col gap-3",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsx(hp,{children:"Settings"}),o.jsxs(ie,{variant:"link",size:"sm","data-testid":"activity-settings-edit",onClick:()=>r("/operator/memberships"),className:"h-auto gap-1 p-0 text-[11px] uppercase tracking-[0.14em]",children:[o.jsx(v2,{className:"h-3 w-3","aria-hidden":"true"}),"Edit"]})]}),i?o.jsxs("div",{className:"flex flex-col gap-3",children:[o.jsx(Tc,{label:"Roles",children:i.roles.length===0?o.jsx("span",{className:"text-muted-foreground",children:"None"}):o.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.roles.map(u=>o.jsx(Se,{variant:"outline",children:LO(u)},u))})}),o.jsx(Qe,{}),o.jsx(Tc,{label:"Harness",children:i.harness??"—"}),o.jsx(Qe,{}),o.jsx(Tc,{label:"Model",children:o.jsx("span",{className:ee(!i.model&&"text-muted-foreground"),children:i.model??"—"})}),o.jsx(Qe,{}),o.jsx(Tc,{label:"Plugins",children:!i.plugins||i.plugins.length===0?o.jsx("span",{className:"text-muted-foreground",children:"None"}):o.jsx("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:i.plugins.map(u=>o.jsxs("li",{"data-testid":`activity-plugin-${u.name}`,className:"flex items-center gap-2 overflow-hidden",children:[o.jsxs(un,{children:[o.jsx(dn,{asChild:!0,children:o.jsx("button",{type:"button",className:"cursor-help truncate bg-transparent p-0 text-left font-mono text-[12px] text-foreground",children:u.displayName})}),o.jsx(Mr,{children:u.name})]}),u.defaultIncluded&&o.jsx(Se,{variant:"secondary",className:"shrink-0",children:"default"})]},u.name))})})]}):o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No SolverNet selected."})]})]})})]})})}function IO(e){const t=new Date(e),r=String(t.getUTCHours()).padStart(2,"0"),n=String(t.getUTCMinutes()).padStart(2,"0");return`${r}:${n} UTC`}function FO({aiUnits:e}){if(!e)return null;const t=e.credentials.filter(r=>r.paused);return t.length===0?null:o.jsx("div",{className:"flex flex-col gap-2",children:t.map(r=>{const s=r.unitsThisBlock>=r.capPerBlock?"block":"week",i=s==="block"?r.blockResetsAt:r.weekResetsAt,l=s==="block"?"6h":"7d";return o.jsxs(Ye,{variant:"warning","data-testid":`ai-units-pause-alert-${r.credentialId}`,children:[o.jsx(u2,{className:"h-4 w-4","aria-hidden":"true"}),o.jsxs(Nt,{className:"font-mono text-[13px]",children:["Paused — ",l," AI-unit cap reached"]}),o.jsx(Xe,{className:"font-mono text-[12px] text-muted-foreground",children:o.jsxs("span",{children:["Credential ",o.jsx("span",{className:"text-foreground",children:r.credentialId})," used"," ",s==="block"?`${r.unitsThisBlock} / ${r.capPerBlock} units this block`:`${r.unitsThisWeek} / ${r.capPerWeek} units this 7-day window`,". Claims resume at ",o.jsx("span",{className:"text-foreground",children:IO(i)}),"."]})})]},r.credentialId)})})}const BO=[{name:"network-tools",version:"0.1.0",defaultIncluded:!0},{name:"claude-code-learner",version:"0.1.0",defaultIncluded:!0}],$O=new Set(["swe-rebench-v2-runtime"]),HO={"network-tools":"Network Tools","claude-code-learner":"Learner","swe-rebench-v2-runtime":"SWE-rebench v2 Runtime","jinn-prediction-plugin":"Prediction Runtime"},fp="bundled:";function pp(e){return HO[e]??e}function Ac(e){return e.startsWith(fp)?e.slice(fp.length):e}function UO(e){const t=kr(e)===ca;return BO.filter(r=>!(t&&r.name==="claude-code-learner")).map(r=>({name:r.name,displayName:pp(r.name),source:"bundled",version:r.version,defaultIncluded:!0}))}function zO({harness:e,explicit:t,disabledDefaults:r,catalogCompatible:n=[]}){const s=new Set(r.map(Ac)),i=new Set(t.map(Ac));new Map(t.map(c=>[Ac(c),c]));const l=[],a=new Set;for(const c of UO(e))a.has(c.name)||(a.add(c.name),!s.has(c.name)&&l.push(c));for(const c of n){if(a.has(c.name))continue;a.add(c.name);const u=$O.has(c.name),m=i.has(c.name);!u&&!m||u&&s.has(c.name)||l.push({name:c.name,displayName:pp(c.name),source:"catalog",version:c.version,defaultIncluded:u})}for(const c of t){const u=Ac(c);a.has(u)||(a.add(u),l.push({name:u,displayName:pp(u),source:c.startsWith(fp)?"bundled":"custom",version:"configured",defaultIncluded:!1}))}return l}function ci(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);return(Number(t)/1e18).toFixed(4)}catch{return"—"}}function WO(e){if(!e||!/^\d+$/.test(e))return null;try{return`${(Number(BigInt(e))/1e18).toFixed(6)} ETH`}catch{return null}}function VO(e){return!e||e.length<12?e??null:`${e.slice(0,6)}…${e.slice(-4)}`}function qO(){var E,N,O,T,L,$,U,z,K,R,P,D,M,V,W,J;const[e,t]=C.useState(null),{data:r,isError:n}=Te({queryKey:["status"],queryFn:()=>me.getStatus(),refetchInterval:5e3}),{data:s}=Te({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap(),refetchInterval:3e4}),{data:i}=Te({queryKey:["solvernets","catalog"],queryFn:()=>me.getSolverNets(),refetchInterval:5*6e4}),l=(((E=r==null?void 0:r.fleet)==null?void 0:E.services)??[]).map(X=>({index:X.index,serviceId:X.serviceId??null,safeAddress:X.safeAddress??"",agentId:X.agentId??null,safeBoundToAgent:X.safeBoundToAgent??!1})),a=((N=l.find(X=>X.serviceId!==null))==null?void 0:N.serviceId)??null,c=C.useMemo(()=>{const X=fe=>{const A=new Set;for(const B of Object.values(fe??{}))B!=null&&B.harness&&A.add(B.harness);return A};return Array.from(X(s==null?void 0:s.joinedSolverNets)).sort()},[s]),u=((O=r==null?void 0:r.tJinn)==null?void 0:O.state)??"pending",m=((T=r==null?void 0:r.tJinn)==null?void 0:T.state)==="ready"?ci(r.tJinn.safeBalanceWei??"0"):ci(((L=r==null?void 0:r.tJinn)==null?void 0:L.safeBalanceWei)??void 0),d=(($=r==null?void 0:r.tJinn)==null?void 0:$.operatorMintedLast24hWei)!=null?ci(r.tJinn.operatorMintedLast24hWei):null,x=((U=r==null?void 0:r.tJinn)==null?void 0:U.error)??null,v=ci((z=r==null?void 0:r.masterGas)==null?void 0:z.balanceWei),_=((K=r==null?void 0:r.masterGas)==null?void 0:K.runwayDaysExcess)??"—",y=(R=r==null?void 0:r.balances)==null?void 0:R.eth,h=ci(((P=y==null?void 0:y.master)==null?void 0:P.balanceWei)??void 0),p=ci(((D=y==null?void 0:y.agent)==null?void 0:D.balanceWei)??void 0),f=ci(((M=y==null?void 0:y.safe)==null?void 0:M.balanceWei)??void 0),g=C.useMemo(()=>{const X=[],fe=s==null?void 0:s.joinedSolverNets;if(!fe)return X;for(const[A,B]of Object.entries(fe)){if(!B)continue;const G=B.contract?i==null?void 0:i.nets.find(ce=>{var Q,ge;return ce.contract.id===((Q=B.contract)==null?void 0:Q.id)&&ce.contract.version===((ge=B.contract)==null?void 0:ge.version)}):void 0,Y=zO({harness:B.harness,explicit:Array.isArray(B.plugins)?B.plugins:[],disabledDefaults:Array.isArray(B.disabledDefaultPlugins)?B.disabledDefaultPlugins:[],catalogCompatible:G==null?void 0:G.compatiblePlugins});X.push({name:B.name??B.manifestCid??A,manifestCid:B.manifestCid??A,solverType:B.contract?`${B.contract.id}.${B.contract.version}`:void 0,roles:Array.isArray(B.roles)?B.roles:[],harness:B.harness,model:B.model,plugins:Y})}return X},[s,i]),b=C.useMemo(()=>{var A,B,G;const X=new Map,fe=Y=>{if(Y)for(const ce of Y)ce.requestId&&(X.has(ce.requestId)||X.set(ce.requestId,{requestId:ce.requestId,manifestCid:ce.manifestCid??null,solverType:ce.solverType??null,taskRole:ce.taskRole,state:ce.state,implName:ce.implName??null,windowStartTs:ce.windowStartTs??0,runStartedAt:ce.runStartedAt??null,stateUpdatedAt:ce.stateUpdatedAt,deliveryTxHash:ce.deliveryTxHash??null,failureReason:ce.failureReason??null}))};return fe((A=r==null?void 0:r.taskRuns)==null?void 0:A.recentTasks),fe((B=r==null?void 0:r.taskRuns)==null?void 0:B.inFlight),fe((G=r==null?void 0:r.predictionV1)==null?void 0:G.recentTasks),Array.from(X.values()).sort((Y,ce)=>ce.stateUpdatedAt-Y.stateUpdatedAt)},[r]),w=n&&r===void 0?"stopped":"running",k="healthy",j=void 0,S=(X,fe,A)=>{t(X),Promise.resolve().then(fe).then(B=>{An.success(X,{description:B==null?void 0:B.message,duration:A==null?void 0:A.autoClearMs})}).catch(B=>{An.error(`${X} failed`,{description:B instanceof Error?B.message:String(B),duration:1/0})}).finally(()=>t(null))};return o.jsxs("div",{"data-testid":"overview-page-grid",className:"grid items-start gap-6 p-6 [grid-template-columns:minmax(0,1fr)_minmax(0,380px)]",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-6",children:[o.jsx(FO,{aiUnits:r==null?void 0:r.aiUnits}),o.jsx(gO,{masterAddress:(s==null?void 0:s.master_address)??null,agentAddress:null,safeAddress:((V=l[0])==null?void 0:V.safeAddress)??null,serviceId:a,agentId:((W=l[0])==null?void 0:W.agentId)??null,services:l}),o.jsx(CO,{harnessNames:c}),o.jsx(MO,{joined:g,tasks:b})]}),o.jsxs("aside",{className:"flex flex-col gap-6",children:[o.jsx(kO,{daemonStatus:w,daemonStateMessage:j,rpcStatus:k,onStop:async()=>{if(!(await me.stopDaemon()).ok)throw new Error("Stop request failed.")},onRestart:async()=>{if(!(await me.restartDaemon({forceRespawn:!0})).ok)throw new Error("Restart request failed.")}}),o.jsx(dO,{totalEth:v,runwayDays:_,actionsDisabled:e!==null,perRole:{master:h,agent:p,safe:f},tjinnEarned:m,tjinnEarnedLast24h:d,tjinnState:u,tjinnError:x,lastPasswordRotationAt:((J=r==null?void 0:r.security)==null?void 0:J.lastPasswordRotationAt)??null,onTopUp:()=>S("Top up gas",async()=>{var G;const X=await me.triggerDrip({singleDrip:!0});if(!X.ok)throw new Error(X.reason??"Gas top-up failed.");const fe=X.txHash??((G=X.txHashes)==null?void 0:G.at(-1));if(!fe)return{message:"Gas top-up checked; the faucet sent no funds."};const A=WO(X.deltaWei),B=VO(fe);return{message:A?`Gas topped up: +${A} · tx ${B}`:`Gas top-up sent · tx ${B}`}},{autoClearMs:5e3})})]})]})}const KO=["task_posted","intent_registry_failed","request_claimed","delivery_submitted","evaluation_submitted","reward_claimed","balance_topup","jinn_claim_emitted","jinn_claim_ticket_recorded","jinn_claim_submitted","jinn_claim_canonical_skip","engine_transition","tick_error","race_lost","startup","shutdown"],GO={task_posted:{label:"Task posted",description:"A new task intent was published on-chain.",tone:"info"},intent_registry_failed:{label:"Intent registry failed",description:"Posting a task intent to the registry did not succeed.",tone:"error"},request_claimed:{label:"Request claimed",description:"The solver claimed a task request to work on.",tone:"info"},delivery_submitted:{label:"Delivery submitted",description:"A completed solution was delivered on-chain.",tone:"success"},evaluation_submitted:{label:"Evaluation submitted",description:"An evaluation verdict was submitted for a delivery.",tone:"success"},reward_claimed:{label:"Reward claimed",description:"Staking rewards were claimed to the operator's safe.",tone:"reward"},balance_topup:{label:"Balance top-up",description:"Gas balance was topped up from the faucet.",tone:"info"},jinn_claim_emitted:{label:"JINN claim emitted",description:"A JINN earnings claim was emitted locally.",tone:"info"},jinn_claim_ticket_recorded:{label:"JINN ticket recorded",description:"A JINN claim ticket was recorded for later submission.",tone:"info"},jinn_claim_submitted:{label:"JINN claim submitted",description:"A JINN earnings claim was submitted on-chain.",tone:"success"},jinn_claim_canonical_skip:{label:"JINN claim skipped",description:"A JINN claim was skipped as already canonical.",tone:"neutral"},engine_transition:{label:"Engine transition",description:"A task run moved to a new lifecycle state.",tone:"info"},tick_error:{label:"Tick error",description:"An error occurred during a daemon polling tick.",tone:"error"},race_lost:{label:"Race lost",description:"A claim or evaluation lost the on-chain race (task already filled or evaluation deadline passed); no action needed.",tone:"neutral"},startup:{label:"Daemon started",description:"The jinn daemon process started.",tone:"neutral"},shutdown:{label:"Daemon stopped",description:"The jinn daemon process shut down.",tone:"neutral"}};function QO(e){const t=e.replace(/_/g," ").trim();return t.length===0?"Event":t.charAt(0).toUpperCase()+t.slice(1)}function Fu(e){const t=GO[e];return t||{label:QO(e),description:"A daemon lifecycle event.",tone:"neutral"}}function mp(e,t){if(t==="failed")return"destructive";if(t==="warn")return"warning";const r=Fu(e).tone;return r==="error"?"destructive":r==="warning"?"warning":r==="success"||r==="reward"?"success":r==="neutral"?"secondary":"default"}const YO=50;function ZO(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,19)}function cy(e,t=8,r=4){return e.length<=t+r+1?e:`${e.slice(0,t)}...${e.slice(-r)}`}function XO(e){return e.requestId??e.solverType??"-"}function JO(){const[e]=Hr();return C.useMemo(()=>{var i;const t=e.includes("?")?e.split("?")[1]:"",r=typeof window>"u"?"":window.location.search.replace(/^\?/,""),n=t||r;return((i=new URLSearchParams(n).get("requestId"))==null?void 0:i.trim())||void 0},[e])}function eM({pageSize:e=YO}={}){var d,x;const t=JO(),[r,n]=C.useState([]),[s,i]=C.useState("all"),l=EN({queryKey:["activity-events",r,s,t,e],queryFn:({pageParam:v})=>me.getActivityEvents({kinds:r.length>0?r:void 0,outcome:s==="all"?void 0:s,requestId:t,beforeId:typeof v=="number"?v:void 0,limit:e}),initialPageParam:void 0,getNextPageParam:v=>v.nextCursor??void 0}),a=((d=l.data)==null?void 0:d.pages)??[],c=a.flatMap(v=>v.events),u=((x=a[0])==null?void 0:x.counts)??{};function m(v){n(_=>_.includes(v)?_.filter(y=>y!==v):[..._,v])}return o.jsxs("main",{"data-testid":"events-page",className:"mx-auto flex w-full max-w-6xl flex-col gap-5 p-6",children:[o.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal leading-tight text-foreground",children:"Events"}),o.jsx("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:"Persistent lifecycle activity from this operator."})]}),o.jsx(ie,{asChild:!0,variant:"secondary",size:"sm",children:o.jsx(cr,{href:"/overview","data-testid":"events-back",children:"Overview"})})]}),t&&o.jsxs(Ye,{variant:"info","data-testid":"events-request-scope",children:[o.jsx(Nt,{children:"Request scoped"}),o.jsxs(Xe,{className:"flex flex-wrap items-center gap-2",children:[o.jsxs("span",{className:"break-all",children:["Showing events for ",t]}),o.jsx(ie,{asChild:!0,variant:"link",size:"sm",className:"h-auto p-0",children:o.jsxs(cr,{href:"/events","data-testid":"events-clear-request",children:[o.jsx(Pl,{"aria-hidden":"true"}),"Clear"]})})]})]}),o.jsxs(we,{children:[o.jsxs(Yt,{children:[o.jsx(fn,{children:"Filters"}),o.jsx(Zs,{children:"Kind and outcome filters page through the same durable log."})]}),o.jsxs(Ge,{className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Kind"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:KO.map(v=>{const _=r.includes(v),y=Fu(v);return o.jsxs(ie,{type:"button",size:"sm",variant:_?"outline":"secondary","aria-pressed":_?"true":"false","data-testid":`events-kind-filter-${v}`,onClick:()=>m(v),className:"normal-case tracking-normal",children:[y.label,u[v]!==void 0&&o.jsx(Se,{variant:"secondary",children:u[v]})]},v)})})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Outcome"}),o.jsx("div",{className:"flex flex-wrap gap-2",children:["all","ok","failed","warn"].map(v=>o.jsx(ie,{type:"button",size:"sm",variant:s===v?"outline":"secondary","aria-pressed":s===v?"true":"false","data-testid":`events-outcome-${v}`,onClick:()=>i(v),children:v},v))})]})]})]}),o.jsxs(we,{"data-testid":"events-list-section",children:[o.jsxs(Yt,{children:[o.jsx(fn,{children:"Event Log"}),o.jsxs(Zs,{children:[c.length," loaded"]})]}),o.jsxs(Ge,{className:"flex flex-col gap-4",children:[l.isLoading&&o.jsxs("div",{"data-testid":"events-loading",className:"flex items-center gap-2 font-mono text-[12px] text-muted-foreground",children:[o.jsx(Jf,{className:"animate-spin","aria-hidden":"true"}),"Loading events"]}),l.isError&&o.jsxs(Ye,{variant:"blocking","data-testid":"events-error",children:[o.jsx(Nt,{children:"Events unavailable"}),o.jsxs(Xe,{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("span",{children:l.error instanceof Error?l.error.message:"Failed to load events."}),o.jsx(ie,{type:"button",size:"sm",variant:"secondary",onClick:()=>{l.refetch()},children:"Retry"})]})]}),!l.isLoading&&!l.isError&&c.length===0&&o.jsx("p",{"data-testid":"events-empty",className:"m-0 font-mono text-[12px] text-muted-foreground",children:"No events match the current filters."}),c.length>0&&o.jsx("div",{"data-testid":"events-list",className:"overflow-x-auto",children:o.jsxs(Wi,{children:[o.jsx(Vi,{children:o.jsxs(Er,{className:"hover:bg-transparent",children:[o.jsx(We,{children:"Time"}),o.jsx(We,{children:"Kind"}),o.jsx(We,{children:"Subject"}),o.jsx(We,{children:"Outcome"}),o.jsx(We,{children:"Tx"}),o.jsx(We,{className:"w-8"})]})}),o.jsx(qi,{children:c.map(v=>{const _=Fu(v.kind);return o.jsxs(Er,{"data-testid":"events-row",children:[o.jsx(Ve,{className:"whitespace-nowrap text-muted-foreground",children:ZO(v.ts)}),o.jsx(Ve,{children:o.jsx(Se,{variant:mp(v.kind,v.outcome),children:_.label})}),o.jsx(Ve,{className:"max-w-[280px] font-mono text-[12px]",children:o.jsxs(un,{children:[o.jsx(dn,{asChild:!0,children:o.jsx("span",{className:ee(v.requestId&&"cursor-help"),children:v.requestId?cy(v.requestId):XO(v)})}),v.requestId&&o.jsx(Mr,{children:v.requestId})]})}),o.jsx(Ve,{children:o.jsx(Se,{variant:mp(v.kind,v.outcome),children:v.outcome??"-"})}),o.jsx(Ve,{className:"font-mono text-[12px] text-muted-foreground",children:v.txHash?cy(v.txHash,6,4):"-"}),o.jsx(Ve,{className:"text-right",children:o.jsx(ie,{asChild:!0,variant:"ghost",size:"icon","aria-label":`Inspect event ${v.id}`,children:o.jsx(cr,{href:`/events/${v.id}`,"data-testid":"events-row-link",children:o.jsx(Fw,{"aria-hidden":"true"})})})})]},v.id)})})]})}),l.hasNextPage&&o.jsxs(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"events-load-more",disabled:l.isFetchingNextPage,onClick:()=>{l.fetchNextPage()},className:"self-start",children:[l.isFetchingNextPage&&o.jsx(Jf,{className:"animate-spin","aria-hidden":"true"}),l.isFetchingNextPage?"Loading":"Load more"]})]})]})]})}function tM(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:`${t.toISOString().replace("T"," ").slice(0,19)} UTC`}function rM(e){return e==="base"?"https://basescan.org":"https://sepolia.basescan.org"}function ui({label:e,children:t}){return o.jsxs("div",{className:"grid gap-1 py-2 sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-4",children:[o.jsx("dt",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:e}),o.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:t})]})}function nM(){const t=md().id??"",{data:r}=Te({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap()}),{data:n,isLoading:s,isError:i,error:l,refetch:a}=Te({queryKey:["activity-events","detail",t],queryFn:()=>me.getActivityEvent(t),enabled:t.length>0}),c=n?Fu(n.kind):null,u=rM(r==null?void 0:r.chain);return o.jsxs("main",{"data-testid":"event-detail",className:"mx-auto flex w-full max-w-4xl flex-col gap-5 p-6",children:[o.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal leading-tight text-foreground",children:c?c.label:"Event"}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-muted-foreground",children:["Event ",t]})]}),o.jsx(ie,{asChild:!0,variant:"secondary",size:"sm",children:o.jsxs(cr,{href:"/events","data-testid":"event-detail-back",children:[o.jsx(a2,{"aria-hidden":"true"}),"Events"]})})]}),s&&o.jsxs("div",{"data-testid":"event-detail-loading",className:"flex items-center gap-2 font-mono text-[12px] text-muted-foreground",children:[o.jsx(Jf,{className:"animate-spin","aria-hidden":"true"}),"Loading event"]}),i&&o.jsxs(Ye,{variant:"blocking","data-testid":"event-detail-error",children:[o.jsx(Nt,{children:"Event unavailable"}),o.jsxs(Xe,{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("span",{children:(l==null?void 0:l.status)===404?"This event could not be found.":l instanceof Error?l.message:"Failed to load this event."}),o.jsx(ie,{type:"button",size:"sm",variant:"secondary",onClick:()=>{a()},children:"Retry"})]})]}),n&&c&&o.jsxs(o.Fragment,{children:[o.jsxs(we,{"data-testid":"event-detail-summary",children:[o.jsxs(Yt,{children:[o.jsx(fn,{children:"Summary"}),o.jsx(Zs,{children:c.description})]}),o.jsxs(Ge,{className:"flex flex-wrap gap-2",children:[o.jsx(Se,{variant:mp(n.kind,n.outcome),children:n.outcome??"-"}),o.jsx(Se,{variant:"outline",children:tM(n.ts)})]})]}),o.jsxs(we,{"data-testid":"event-detail-payload",children:[o.jsxs(Yt,{children:[o.jsx(fn,{children:"Details"}),o.jsx(Zs,{children:"Raw event fields from the persistent activity log."})]}),o.jsx(Ge,{children:o.jsxs("dl",{className:"m-0",children:[o.jsx(ui,{label:"Event id",children:n.id}),o.jsx(Qe,{}),o.jsx(ui,{label:"Kind",children:n.kind}),o.jsx(Qe,{}),o.jsx(ui,{label:"Request id",children:n.requestId??"-"}),o.jsx(Qe,{}),o.jsx(ui,{label:"Service index",children:n.serviceIndex!==null?n.serviceIndex:"-"}),o.jsx(Qe,{}),o.jsx(ui,{label:"Solver type",children:n.solverType??"-"}),o.jsx(Qe,{}),o.jsx(ui,{label:"Transaction",children:n.txHash?o.jsx(ie,{asChild:!0,variant:"link",size:"sm",className:"h-auto justify-start p-0 font-mono text-[12px] normal-case tracking-normal",children:o.jsxs("a",{"data-testid":"event-detail-tx-link",href:`${u}/tx/${n.txHash}`,target:"_blank",rel:"noreferrer",children:[n.txHash,o.jsx(Ao,{"aria-hidden":"true"})]})}):"-"}),o.jsx(Qe,{}),o.jsx(ui,{label:"Detail",children:n.detail??"-"})]})})]})]})]})}function Ca(e,t){const r=e??[];return r.includes(t)?r:[...r,t]}function yi(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);if(t===0n)return"0 ETH";const r=1000000000000000000n,n=100000000000000n,s=1000000000n;return t>=n?`${uy(t,18,t>=r?4:6)} ETH`:t>=s?`${uy(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return"—"}}function uy(e,t,r){const n=10n**BigInt(t),s=e/n,i=e%n;if(i===0n||r===0)return s.toString();const a=i.toString().padStart(t,"0").slice(0,r).replace(/0+$/,"");return a?`${s}.${a}`:s.toString()}function dy(e){const t=e.trim();if(t.length===0)return null;if(!/^\d+$/.test(t))throw new Error("not a non-negative integer");return BigInt(t)}const hy={launching:{variant:"default",label:"Launching"},launched:{variant:"success",label:"Launched"},paused:{variant:"pill",label:"Paused"},retired:{variant:"outline",label:"Retired"},failed:{variant:"destructive",label:"Failed"}};function sM(e){return e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`}function iM(e){try{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,16)+" UTC"}catch{return e}}function oM({status:e}){const t=hy[e]??hy.launching;return o.jsx(Se,{variant:t.variant,className:"whitespace-nowrap",children:t.label})}function aM({label:e}){return o.jsx(Se,{"data-testid":"launcher-owned-row-role",variant:"outline",className:"normal-case tracking-[0.12em] text-[var(--fg-muted)]",children:e})}function lM({record:e}){const[,t]=Hr(),r=`/launcher/launched/${encodeURIComponent(e.solverNetId)}`,n=e.summary,s=(n==null?void 0:n.name)??e.solverNetId,i=n!==void 0?`${n.contractId}.${n.contractVersion}`:null;return o.jsx("a",{href:r,"data-testid":"launcher-owned-row","data-solvernet-id":e.solverNetId,"data-has-summary":n!==void 0?"true":"false",onClick:l=>{l.preventDefault(),t(r)},className:"block text-inherit no-underline",children:o.jsxs(we,{className:ee("grid grid-cols-[1fr_auto] items-center gap-4 p-4","transition-colors hover:bg-[var(--bg-sunken)]/40 cursor-pointer"),children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[o.jsx("div",{"data-testid":"launcher-owned-row-primary",className:ee("truncate text-foreground",n!==void 0?"font-serif text-[18px] font-normal tracking-[-0.01em]":"font-mono text-[14px] font-medium"),children:s}),i!==null&&o.jsx("div",{"data-testid":"launcher-owned-row-contract",className:"font-mono text-[12px] text-[var(--fg-muted)]",children:i}),n!==void 0&&o.jsxs("div",{"data-testid":"launcher-owned-row-prices",className:"flex flex-wrap gap-x-3.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[o.jsxs("span",{children:["solution ",yi(n.solutionPriceWei)]}),o.jsxs("span",{children:["verdict ",yi(n.verdictPriceWei)]})]}),n!==void 0&&n.openRoles.length>0&&o.jsx("div",{"data-testid":"launcher-owned-row-roles",className:"flex flex-wrap gap-1.5",children:n.openRoles.map(l=>o.jsx(aM,{label:l},l))}),o.jsxs("div",{className:"flex flex-wrap gap-x-3.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[o.jsxs("span",{children:["cid ",sM(e.manifestCid)]}),o.jsxs("span",{children:["launched ",iM(e.launchedAt)]})]})]}),o.jsx(oM,{status:e.status})]})})}function cM(){return o.jsxs(we,{"data-testid":"launcher-empty-state",className:"flex flex-col gap-3.5 p-8",children:[o.jsx("h2",{className:"m-0 font-mono text-[18px] font-medium tracking-[-0.01em] text-foreground",children:"No SolverNets created yet."}),o.jsx("p",{className:"m-0 text-[14px] leading-relaxed text-[var(--fg-muted)]",children:"Create a SolverNet to direct operators toward a specific kind of knowledge work."}),o.jsx("div",{children:o.jsx(ie,{asChild:!0,variant:"default",size:"lg",children:o.jsx(cr,{href:"/launcher/create",children:"Create SolverNet"})})})]})}function uM(){const{data:e,isLoading:t,isError:r,error:n,refetch:s}=Te({queryKey:["solvernets","launched","owned"],queryFn:()=>me.solvernets.listLaunched(),refetchInterval:3e4});return o.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[o.jsxs("div",{className:"flex items-end justify-between",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal text-foreground",children:"Your SolverNets"}),((e==null?void 0:e.records.length)??0)>0&&o.jsx(ie,{asChild:!0,variant:"default","data-testid":"launcher-create-cta",children:o.jsx(cr,{href:"/launcher/create",children:"Create SolverNet"})})]}),t&&o.jsx("p",{"data-testid":"launcher-loading",className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading…"}),r&&o.jsxs(Ye,{"data-testid":"launcher-error",variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Nt,{className:"font-mono text-[13px] font-medium text-destructive",children:"Failed to load your SolverNets."}),o.jsx(Xe,{className:"text-[12px] text-[var(--fg-muted)]",children:n instanceof Error?n.message:"Unknown error"})]}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm",onClick:()=>{s()},children:"Retry"})]}),!t&&!r&&e&&e.records.length===0&&o.jsx(cM,{}),!t&&!r&&e&&e.records.length>0&&o.jsx("div",{className:"flex flex-col gap-2",children:e.records.map(i=>o.jsx(lM,{record:i},i.solverNetId))})]})}const gt=C.forwardRef(({className:e,type:t,...r},n)=>o.jsx("input",{type:t,ref:n,className:ee("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 font-mono text-[13px] text-foreground transition-colors","placeholder:text-[var(--fg-dim)]","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...r}));gt.displayName="Input";var dM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hM=dM.reduce((e,t)=>{const r=Wm(`Primitive.${t}`),n=C.forwardRef((s,i)=>{const{asChild:l,...a}=s,c=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),fM="Label",p1=C.forwardRef((e,t)=>o.jsx(hM.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));p1.displayName=fM;var m1=p1;const Sr=C.forwardRef(({className:e,...t},r)=>o.jsx(m1,{ref:r,className:ee("font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)] peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));Sr.displayName=m1.displayName;function pM({current:e,total:t=5}){return o.jsxs("div",{"data-testid":"launcher-create-progress",className:"flex items-center gap-3 font-mono text-[11px] uppercase tracking-[0.14em] text-fg-muted",children:[o.jsxs("span",{"data-testid":"launcher-create-step-counter",children:["Step ",e," of ",t]}),o.jsx("div",{className:"flex max-w-[320px] flex-1 gap-1",children:Array.from({length:t}).map((r,n)=>{const s=n+1,i=s<=e;return o.jsx("span",{"data-testid":`launcher-create-progress-pip-${s}`,"data-filled":i?"true":"false",className:ee("h-[3px] flex-1 rounded-sm",i?"bg-accent-sky":"bg-border")},s)})})]})}function Ki({step:e,total:t=5,title:r,blurb:n,children:s,footer:i,error:l}){return o.jsxs("main",{"data-testid":`launcher-create-step-${e}`,className:"mx-auto flex max-w-[720px] flex-col gap-5 p-6",children:[o.jsx(pM,{current:e,total:t}),o.jsxs("header",{className:"flex flex-col gap-1.5",children:[o.jsx("h1",{className:"m-0 font-serif text-[32px] font-normal leading-tight tracking-[-0.01em] text-foreground",children:r}),n&&o.jsx("p",{className:"m-0 text-[14px] leading-relaxed text-fg-muted",children:n})]}),l&&o.jsx(Ye,{variant:"blocking","data-testid":"launcher-create-error",className:"font-mono text-[13px]",children:o.jsx(Xe,{children:l})}),o.jsx("div",{className:"flex flex-col gap-4",children:s}),o.jsx(Qe,{}),o.jsx("div",{className:"flex items-center justify-between gap-3",children:i})]})}function Gi({onBack:e,onNext:t,nextLabel:r="Next",nextDisabled:n=!1,busy:s=!1,right:i}){return o.jsxs(o.Fragment,{children:[o.jsx("div",{children:e&&o.jsx(ie,{type:"button",variant:"secondary",size:"lg","data-testid":"launcher-create-back",onClick:e,disabled:s,children:"Back"})}),o.jsxs("div",{className:"flex items-center gap-4",children:[i,t&&o.jsx(ie,{type:"button",size:"lg","data-testid":"launcher-create-next",onClick:t,disabled:n||s,children:r})]})]})}function bt({label:e,helperText:t,error:r,children:n,asLabel:s=!0}){const i=o.jsxs(o.Fragment,{children:[o.jsx(Sr,{children:e}),n,r?o.jsx("span",{className:"font-mono text-[12px] text-break-red",children:r}):t&&o.jsx("span",{className:"font-mono text-[11px] text-fg-dim",children:t})]});return s?o.jsx("label",{className:"flex flex-col gap-1.5",children:i}):o.jsx("div",{className:"flex flex-col gap-1.5",children:i})}const mM="flex w-full rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[13px] text-foreground placeholder:text-fg-dim focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";function fy({draft:e,onAdvance:t,busy:r,error:n}){const[s,i]=C.useState(e.name??""),[l,a]=C.useState(e.description??""),[c,u]=C.useState(!1),m=c&&s.trim().length===0?"Name is required.":null,d=c&&l.trim().length===0?"Description is required.":null,x=async v=>{v==null||v.preventDefault(),u(!0),!(s.trim().length===0||l.trim().length===0)&&await t({name:s.trim(),description:l.trim(),completedSteps:Ca(e.completedSteps,"define")})};return o.jsx(Ki,{step:1,title:"Name your SolverNet",blurb:"Pick a short, recognisable name and describe what kind of knowledge work this SolverNet directs operators toward.",error:n,footer:o.jsx(Gi,{onNext:()=>{x()},nextDisabled:s.trim().length===0||l.trim().length===0,busy:r}),children:o.jsxs("form",{onSubmit:v=>{x(v)},className:"flex flex-col gap-4",children:[o.jsx(bt,{label:"Name",error:m,helperText:"Shown in the registry catalog and the operator opt-in cards.",children:o.jsx(gt,{"data-testid":"launcher-create-name",type:"text",value:s,onChange:v=>i(v.target.value),placeholder:"e.g. Polymarket forecasts",className:ee(m&&"border-break-red"),disabled:r})}),o.jsx(bt,{label:"Description",error:d,helperText:"One or two sentences. Operators read this when deciding whether to opt in.",children:o.jsx("textarea",{"data-testid":"launcher-create-description",value:l,onChange:v=>a(v.target.value),rows:4,placeholder:"Forecast resolved Polymarket outcomes; rewarded by Brier score on verified resolutions.",className:ee(mM,"min-h-[96px] resize-y",d&&"border-break-red"),disabled:r})}),o.jsx(ie,{type:"submit",className:"hidden","aria-hidden":!0,tabIndex:-1})]})})}const ka={id:"prediction",version:"v1",name:"Prediction",description:"Forecast resolved outcomes. Solvers submit a probability for a binary market; evaluators score against the on-chain resolution using Brier loss.",schemas:{task:{name:"prediction.v1 Task",description:"A binary Polymarket market with resolution time, condition id, and orderbook snapshot."},solution:{name:"prediction.v1 Solution",description:"A scalar probability in [0, 1] that the market resolves YES."},verdict:{name:"prediction.v1 Verdict",description:"Brier-loss score derived from the solver probability and the resolved outcome."}},evaluationFunction:{id:"prediction.brier-loss.v1",deterministic:!0,inputs:["prediction.v1 Task","prediction.v1 Solution","Polymarket/UMA resolution"],output:"prediction.v1 Verdict"},aggregationFunction:{id:"prediction.trailing-mean-brier-spread.v1",deterministic:!0,inputs:["SCORED prediction.v1 Verdicts"],output:"trailing mean brierSpread",windowDays:84},claimPolicyDefaults:{mode:"parallel",maxClaims:25,maxClaimsPerOperator:1,claimLeaseTtlSeconds:30*60},credentialRequirements:{creator:[{id:"polymarket.public.market-data.read",kind:"public-api",required:!0,description:"Read public Polymarket market metadata and orderbook snapshots for Task creation."}],solver:[],evaluator:[{id:"polymarket.public.resolution.read",kind:"public-api",required:!0,description:"Read public Polymarket/UMA final market state for resolution mapping."}]},generatorDefaults:{cadenceMs:6*60*60*1e3,submissionWindowMs:6*60*60*1e3,maxNewRoundsPerPoll:25,maxNewRoundsPerDay:100,maxOpenRounds:250,minTimeToResolutionHours:24,maxTimeToResolutionHours:168,minLiquidityUsd:"10000",minVolume24hUsd:"2500",maxYesSpread:"0.10",maxOrderbookAgeSeconds:60}},g1={id:"swe-rebench-v2",version:"v1",name:"SWE-rebench v2",description:"Code-issue benchmark sourced from the nebius/SWE-rebench-leaderboard HuggingFace dataset. Solvers submit a patch; evaluators run the upstream eval.py harness inside the per-instance Docker image and emit a 0/1 Verdict against the FAIL_TO_PASS / PASS_TO_PASS tests.",schemas:{task:{name:"swe-rebench-v2.v1 Task",description:"A reference to a HuggingFace dataset row by (hf_dataset, hf_split, instance_id), plus repo + base_commit + language + problem statement."},solution:{name:"swe-rebench-v2.v1 Solution",description:"A unified diff patch (git-format), with optional self-reported cost. The trajectory blob is pinned daemon-side and referenced via the envelope, not the payload."},verdict:{name:"swe-rebench-v2.v1 Verdict",description:"Score 0 or 1 based on whether the patch passes the per-instance Docker test suite, plus passed_match flag and evaluator cost. The test log is pinned daemon-side and surfaced via the verdict-artifact metadata."}},evaluationFunction:{id:"swe-rebench-v2.docker-test-suite.v1",deterministic:!0,inputs:["swe-rebench-v2.v1 Task","swe-rebench-v2.v1 Solution","per-instance Docker image"],output:"swe-rebench-v2.v1 Verdict"},aggregationFunction:{id:"swe-rebench-v2.multi-winrate.v1",deterministic:!0,inputs:["SCORED swe-rebench-v2.v1 Verdicts"],output:"mean / complexityWeighted / byLanguage / frontierResolved / parityTripRate",windowDays:30},claimPolicyDefaults:{mode:"parallel",maxClaims:5,maxClaimsPerOperator:5,claimLeaseTtlSeconds:60*60},credentialRequirements:{creator:[{id:"huggingface.public.datasets-server.read",kind:"public-api",required:!0,description:"Read public HuggingFace dataset rows from the nebius/SWE-rebench-leaderboard splits."}],solver:[],evaluator:[{id:"docker.local.run",kind:"local-runtime",required:!0,description:"Run per-instance Docker images that ship with the upstream eval.py harness."},{id:"huggingface.public.datasets-server.read",kind:"public-api",required:!0,description:"Read the HF dataset row referenced by the Task to recover test_patch + FAIL_TO_PASS / PASS_TO_PASS."}]},generatorDefaults:{N_target_successes:5,posting_window_ms:24*60*60*1e3,post_batch_size:25,claimLeaseTtlSeconds:60*60}},gp={"prediction.v1":ka,"swe-rebench-v2.v1":g1},gM="prediction.v1",vM="font-mono text-[11px] uppercase tracking-[0.14em] text-fg-dim";function xM({draft:e,template:t=ka,onAdvance:r,onBack:n,busy:s,error:i}){const l=()=>{r({templateContractId:t.id,templateContractVersion:t.version,completedSteps:Ca(e.completedSteps,"reviewContract")})};return o.jsx(Ki,{step:2,title:"Review contract",blurb:"The contract defines the schemas, evaluation, and aggregation that this SolverNet will pin to its manifest.",error:i,footer:o.jsx(Gi,{onBack:n,onNext:l,busy:s}),children:o.jsx(we,{"data-testid":"launcher-create-template","data-template-id":`${t.id}.${t.version}`,children:o.jsxs(Ge,{className:"flex flex-col gap-4 p-6",children:[o.jsxs("header",{className:"flex flex-col gap-1",children:[o.jsxs("span",{className:vM,children:[t.id,".",t.version]}),o.jsx("h2",{className:"m-0 font-serif text-[24px] font-normal text-foreground",children:t.name}),o.jsx("p",{className:"m-0 text-[13px] leading-relaxed text-fg-muted",children:t.description})]}),o.jsxs(Fa,{title:"Schemas",children:[o.jsx(er,{label:"Task",value:t.schemas.task.name,hint:t.schemas.task.description}),o.jsx(er,{label:"Solution",value:t.schemas.solution.name,hint:t.schemas.solution.description}),o.jsx(er,{label:"Verdict",value:t.schemas.verdict.name,hint:t.schemas.verdict.description})]}),o.jsxs(Fa,{title:"Evaluation function",children:[o.jsx(er,{label:"Id",value:t.evaluationFunction.id,mono:!0}),o.jsx(er,{label:"Deterministic",value:t.evaluationFunction.deterministic?"yes":"no"}),o.jsx(er,{label:"Inputs",value:t.evaluationFunction.inputs.join(", ")}),o.jsx(er,{label:"Output",value:t.evaluationFunction.output})]}),o.jsxs(Fa,{title:"Aggregation function",children:[o.jsx(er,{label:"Id",value:t.aggregationFunction.id,mono:!0}),o.jsx(er,{label:"Window",value:t.aggregationFunction.windowDays!==void 0?`${t.aggregationFunction.windowDays} days`:"—"}),o.jsx(er,{label:"Output",value:t.aggregationFunction.output})]}),o.jsxs(Fa,{title:"Claim policy defaults",children:[o.jsx(er,{label:"Mode",value:t.claimPolicyDefaults.mode}),o.jsx(er,{label:"Max claims",value:String(t.claimPolicyDefaults.maxClaims)}),o.jsx(er,{label:"Per operator",value:String(t.claimPolicyDefaults.maxClaimsPerOperator)}),o.jsx(er,{label:"Lease TTL",value:`${t.claimPolicyDefaults.claimLeaseTtlSeconds}s`})]}),o.jsxs(Fa,{title:"Credential requirements",children:[o.jsx(Ch,{role:"creator",creds:t.credentialRequirements.creator}),o.jsx(Ch,{role:"solver",creds:t.credentialRequirements.solver}),o.jsx(Ch,{role:"evaluator",creds:t.credentialRequirements.evaluator})]})]})})})}function Fa({title:e,children:t}){return o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx(Qe,{}),o.jsx("h3",{className:ee("m-0 pt-2 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-fg-muted"),children:e}),o.jsx("div",{className:"flex flex-col gap-1.5",children:t})]})}function er({label:e,value:t,hint:r,mono:n}){return o.jsxs("div",{className:"grid grid-cols-[140px_1fr] items-baseline gap-3",children:[o.jsx("span",{className:"font-mono text-[11px] tracking-[0.06em] text-fg-dim",children:e}),o.jsxs("span",{className:"flex flex-col gap-0.5",children:[o.jsx("span",{className:ee("text-[13px] text-foreground",n?"font-mono":"font-sans"),children:t}),r&&o.jsx("span",{className:"font-mono text-[12px] leading-relaxed text-fg-muted",children:r})]})]})}function Ch({role:e,creds:t}){return o.jsxs("div",{"data-testid":`launcher-create-credentials-${e}`,className:"flex flex-col gap-1.5",children:[o.jsx("div",{className:"font-mono text-[11px] capitalize tracking-[0.06em] text-fg-dim",children:e}),t.length===0?o.jsx("div",{className:"text-[12px] text-fg-muted",children:"None."}):t.map(r=>o.jsxs("div",{className:"flex flex-col gap-0.5 font-mono text-[12px] leading-relaxed",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("span",{className:"text-accent-sky",children:r.id}),o.jsx(Se,{variant:"secondary",children:r.kind}),r.required&&o.jsx(Se,{variant:"warning",children:"required"})]}),o.jsx("div",{className:"text-fg-muted",children:r.description})]},r.id))]})}const py="flex w-full rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[13px] text-foreground placeholder:text-fg-dim focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 resize-y";function yM(e){const t=e.template??ka;switch(t.id){case"prediction":return o.jsx(bM,{...e,template:t});case"swe-rebench-v2":return o.jsx(SM,{...e,template:t});default:return o.jsx(Ki,{step:3,title:"Configure generator",blurb:"No generator form is registered for this template.",error:e.error??null,footer:o.jsx(Gi,{onBack:e.onBack,onNext:()=>{},nextDisabled:!0,busy:e.busy}),children:o.jsx("div",{"data-testid":"launcher-create-generator-unsupported"})})}}const my=6e4;function rn(e,t){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():String(t)}function gy(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function _M(e){const t=ka.generatorDefaults,r=60*60*1e3;return{cadenceMs:rn(e==null?void 0:e.cadenceMs,t.cadenceMs),windowMs:rn((e==null?void 0:e.windowMs)??(e==null?void 0:e.submissionWindowMs),t.submissionWindowMs),resolveGapMs:rn(e==null?void 0:e.resolveGapMs,r),maxNewRoundsPerPoll:rn(e==null?void 0:e.maxNewRoundsPerPoll,t.maxNewRoundsPerPoll),maxNewRoundsPerDay:rn(e==null?void 0:e.maxNewRoundsPerDay,t.maxNewRoundsPerDay),maxOpenRounds:rn(e==null?void 0:e.maxOpenRounds,t.maxOpenRounds),allowlistConditionIds:gy(e==null?void 0:e.allowlistConditionIds),blocklistConditionIds:gy(e==null?void 0:e.blocklistConditionIds)}}function vy(e){const t={},r=nn(e.cadenceMs);r===null?t.cadenceMs="Must be a positive integer (ms).":r<my&&(t.cadenceMs=`Cadence must be at least ${my/1e3}s.`);const n=nn(e.windowMs);n===null&&(t.windowMs="Must be a positive integer (ms).");const s=nn(e.resolveGapMs);s===null&&(t.resolveGapMs="Must be a positive integer (ms).");const i=nn(e.maxNewRoundsPerPoll);i===null&&(t.maxNewRoundsPerPoll="Must be a positive integer.");const l=nn(e.maxNewRoundsPerDay);l===null&&(t.maxNewRoundsPerDay="Must be a positive integer.");const a=nn(e.maxOpenRounds);return a===null&&(t.maxOpenRounds="Must be a positive integer."),Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0,errors:{},generatorConfig:{cadenceMs:r,windowMs:n,resolveGapMs:s,submissionWindowMs:n,maxNewRoundsPerPoll:i,maxNewRoundsPerDay:l,maxOpenRounds:a,allowlistConditionIds:xy(e.allowlistConditionIds),blocklistConditionIds:xy(e.blocklistConditionIds)}}}function nn(e){const t=e.trim();if(t.length===0||!/^\d+$/.test(t))return null;const r=Number(t);return!Number.isFinite(r)||r<=0?null:r}function xy(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function bM({draft:e,onAdvance:t,onBack:r,busy:n,error:s}){const i=C.useMemo(()=>_M(e.generatorConfig),[e.generatorConfig]),[l,a]=C.useState(i),[c,u]=C.useState(!1),m=c?vy(l):{ok:!0,errors:{}},d=c?m.errors:{},x=()=>{u(!0);const _=vy(l);!_.ok||!_.generatorConfig||t({generatorConfig:_.generatorConfig,completedSteps:Ca(e.completedSteps,"configureGenerator")})},v=(_,y)=>{a(h=>({...h,[_]:y}))};return o.jsxs(Ki,{step:3,title:"Configure generator",blurb:"The auto-generator polls Polymarket and posts Tasks while the SolverNet is launched. Defaults are tuned for a healthy idle SolverNet — adjust to match your appetite.",error:s,footer:o.jsx(Gi,{onBack:r,onNext:x,busy:n,nextDisabled:c&&!m.ok}),children:[o.jsxs("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2",children:[o.jsx(bt,{label:"Cadence (ms)",helperText:"How often the generator polls Polymarket. Minimum 60s.",error:d.cadenceMs??null,children:o.jsx(gt,{"data-testid":"launcher-create-cadenceMs",type:"text",inputMode:"numeric",value:l.cadenceMs,onChange:_=>v("cadenceMs",_.target.value),className:ee(d.cadenceMs&&"border-break-red"),disabled:n})}),o.jsx(bt,{label:"Submission window (ms)",helperText:"How long Tasks stay open for solving.",error:d.windowMs??null,children:o.jsx(gt,{"data-testid":"launcher-create-windowMs",type:"text",inputMode:"numeric",value:l.windowMs,onChange:_=>v("windowMs",_.target.value),className:ee(d.windowMs&&"border-break-red"),disabled:n})}),o.jsx(bt,{label:"Resolve gap (ms)",helperText:"Cushion between window-close and resolution.",error:d.resolveGapMs??null,children:o.jsx(gt,{"data-testid":"launcher-create-resolveGapMs",type:"text",inputMode:"numeric",value:l.resolveGapMs,onChange:_=>v("resolveGapMs",_.target.value),className:ee(d.resolveGapMs&&"border-break-red"),disabled:n})}),o.jsx(bt,{label:"Max rounds / poll",helperText:"Cap on new Tasks per generator tick.",error:d.maxNewRoundsPerPoll??null,children:o.jsx(gt,{"data-testid":"launcher-create-maxNewRoundsPerPoll",type:"text",inputMode:"numeric",value:l.maxNewRoundsPerPoll,onChange:_=>v("maxNewRoundsPerPoll",_.target.value),className:ee(d.maxNewRoundsPerPoll&&"border-break-red"),disabled:n})}),o.jsx(bt,{label:"Max rounds / day",helperText:"Daily ceiling across all polls.",error:d.maxNewRoundsPerDay??null,children:o.jsx(gt,{"data-testid":"launcher-create-maxNewRoundsPerDay",type:"text",inputMode:"numeric",value:l.maxNewRoundsPerDay,onChange:_=>v("maxNewRoundsPerDay",_.target.value),className:ee(d.maxNewRoundsPerDay&&"border-break-red"),disabled:n})}),o.jsx(bt,{label:"Max open rounds",helperText:"Concurrent open Tasks before back-off kicks in.",error:d.maxOpenRounds??null,children:o.jsx(gt,{"data-testid":"launcher-create-maxOpenRounds",type:"text",inputMode:"numeric",value:l.maxOpenRounds,onChange:_=>v("maxOpenRounds",_.target.value),className:ee(d.maxOpenRounds&&"border-break-red"),disabled:n})})]}),o.jsx(bt,{label:"Allowlist condition ids",helperText:"Comma-separated. If non-empty, only these markets are considered.",children:o.jsx("textarea",{"data-testid":"launcher-create-allowlistConditionIds",value:l.allowlistConditionIds,onChange:_=>v("allowlistConditionIds",_.target.value),rows:2,placeholder:"0xabc…, 0xdef…",className:py,disabled:n})}),o.jsx(bt,{label:"Blocklist condition ids",helperText:"Comma-separated. Markets here are skipped, even if they pass the eligibility filters.",children:o.jsx("textarea",{"data-testid":"launcher-create-blocklistConditionIds",value:l.blocklistConditionIds,onChange:_=>v("blocklistConditionIds",_.target.value),rows:2,placeholder:"0xabc…",className:py,disabled:n})})]})}function wM(e){const t=g1.generatorDefaults,r=typeof(e==null?void 0:e.claimPolicy)=="object"&&e.claimPolicy!==null?e.claimPolicy:{};return{N_target_successes:rn(e==null?void 0:e.N_target_successes,t.N_target_successes),posting_window_ms:rn(e==null?void 0:e.posting_window_ms,t.posting_window_ms),post_batch_size:rn(e==null?void 0:e.post_batch_size,t.post_batch_size),maxClaimsPerOperator:rn((e==null?void 0:e.maxClaimsPerOperator)??r.maxClaimsPerOperator,t.maxClaimsPerOperator??t.N_target_successes),claimLeaseTtlSeconds:rn((e==null?void 0:e.claimLeaseTtlSeconds)??r.claimLeaseTtlSeconds,t.claimLeaseTtlSeconds)}}function yy(e){const t={},r=nn(e.N_target_successes);r===null&&(t.N_target_successes="Must be a positive integer.");const n=nn(e.posting_window_ms);n===null&&(t.posting_window_ms="Must be a positive integer (ms).");const s=nn(e.post_batch_size);s===null&&(t.post_batch_size="Must be a positive integer.");const i=nn(e.maxClaimsPerOperator);i===null&&(t.maxClaimsPerOperator="Must be a positive integer.");const l=nn(e.claimLeaseTtlSeconds);return l===null&&(t.claimLeaseTtlSeconds="Must be a positive integer (seconds)."),Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0,errors:{},generatorConfig:{N_target_successes:r,posting_window_ms:n,post_batch_size:s,maxClaimsPerOperator:i,claimLeaseTtlSeconds:l}}}function SM({draft:e,onAdvance:t,onBack:r,busy:n,error:s}){const i=C.useMemo(()=>wM(e.generatorConfig),[e.generatorConfig]),[l,a]=C.useState(i),[c,u]=C.useState(!1),m=c?yy(l):{ok:!0,errors:{}},d=c?m.errors:{},x=()=>{u(!0);const _=yy(l);!_.ok||!_.generatorConfig||t({generatorConfig:_.generatorConfig,completedSteps:Ca(e.completedSteps,"configureGenerator")})},v=(_,y)=>{a(h=>({...h,[_]:y}))};return o.jsx(Ki,{step:3,title:"Configure generator",blurb:"The generator pulls SWE-rebench v2 instances from the HuggingFace pool and posts Tasks until enough successful Verdicts accumulate or the posting cap is hit.",error:s,footer:o.jsx(Gi,{onBack:r,onNext:x,busy:n,nextDisabled:c&&!m.ok}),children:o.jsxs("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2",children:[o.jsx(bt,{label:"Target successful Verdicts per instance",helperText:"How many score=1 Verdicts saturate a SWE instance and stop further Task posting.",error:d.N_target_successes??null,children:o.jsx(gt,{"data-testid":"launcher-create-N_target_successes",type:"text",inputMode:"numeric",value:l.N_target_successes,onChange:_=>v("N_target_successes",_.target.value),className:ee(d.N_target_successes&&"border-break-red"),disabled:n})}),o.jsx(bt,{label:"Posting window (ms)",helperText:"On-chain claim-window deadline for each posting. Reposts trigger on claim-budget exhaustion observed via the indexer, not this window.",error:d.posting_window_ms??null,children:o.jsx(gt,{"data-testid":"launcher-create-posting_window_ms",type:"text",inputMode:"numeric",value:l.posting_window_ms,onChange:_=>v("posting_window_ms",_.target.value),className:ee(d.posting_window_ms&&"border-break-red"),disabled:n})}),o.jsx(bt,{label:"Post batch size",helperText:"Maximum number of SWE instances to post in one creator tick.",error:d.post_batch_size??null,children:o.jsx(gt,{"data-testid":"launcher-create-post_batch_size",type:"text",inputMode:"numeric",value:l.post_batch_size,onChange:_=>v("post_batch_size",_.target.value),className:ee(d.post_batch_size&&"border-break-red"),disabled:n})}),o.jsx(bt,{label:"Max claims per operator",helperText:"Optional cap; each posting is still limited by remaining target successes.",error:d.maxClaimsPerOperator??null,children:o.jsx(gt,{"data-testid":"launcher-create-maxClaimsPerOperator",type:"text",inputMode:"numeric",value:l.maxClaimsPerOperator,onChange:_=>v("maxClaimsPerOperator",_.target.value),className:ee(d.maxClaimsPerOperator&&"border-break-red"),disabled:n})}),o.jsx(bt,{label:"Claim lease (seconds)",helperText:"How long a claimed SWE task slot stays leased.",error:d.claimLeaseTtlSeconds??null,children:o.jsx(gt,{"data-testid":"launcher-create-claimLeaseTtlSeconds",type:"text",inputMode:"numeric",value:l.claimLeaseTtlSeconds,onChange:_=>v("claimLeaseTtlSeconds",_.target.value),className:ee(d.claimLeaseTtlSeconds&&"border-break-red"),disabled:n})})]})})}function CM(e,t){const r={};let n,s;try{n=dy(e),n===null?r.solutionPriceWei="Required.":n<0n&&(r.solutionPriceWei="Must be non-negative.")}catch{r.solutionPriceWei="Must be a non-negative integer (wei).",n=null}try{s=dy(t),s===null?r.verdictPriceWei="Required.":s<0n&&(r.verdictPriceWei="Must be non-negative.")}catch{r.verdictPriceWei="Must be a non-negative integer (wei).",s=null}return n!==null&&s!==null&&!r.solutionPriceWei&&!r.verdictPriceWei&&n===0n&&s===0n&&(r.combined="At least one price must be positive."),{ok:Object.keys(r).length===0,errors:r,solutionWei:n??void 0,verdictWei:s??void 0}}function kM(e,t,r,n){if(!e||!/^\d+$/.test(e)||t===void 0||r===void 0)return null;let s;try{s=BigInt(e)}catch{return null}const i=t+r*BigInt(n);return i<=0n?null:{tasks:Number(s/i),perTaskWei:i}}function EM({draft:e,template:t=ka,onAdvance:r,onBack:n,fundingSafeAddress:s,fundingSafeBalanceWei:i,busy:l,error:a}){var g,b;const[c,u]=C.useState(e.solutionPriceWei??""),[m,d]=C.useState(e.verdictPriceWei??""),[x,v]=C.useState(!1),_=C.useMemo(()=>CM(c,m),[c,m]),y=t.claimPolicyDefaults.maxClaimsPerOperator,h=C.useMemo(()=>kM(i??null,_.solutionWei,_.verdictWei,y),[i,_.solutionWei,_.verdictWei,y]),p=()=>{v(!0),_.ok&&r({solutionPriceWei:c,verdictPriceWei:m,completedSteps:Ca(e.completedSteps,"configurePricing")})},f=x?_.errors:{};return o.jsxs(Ki,{step:4,title:"Configure pricing",blurb:"Set what each Task pays out. The funding Safe is your launcher's master Safe; pricing applies per claim and per verdict.",error:a,footer:o.jsx(Gi,{onBack:n,onNext:p,busy:l,nextDisabled:x&&!_.ok}),children:[o.jsx(bt,{label:"Funding Safe",helperText:"Tasks are funded from this Safe at launch. Defaults to your launcher master Safe.",asLabel:!1,children:o.jsx("div",{"data-testid":"launcher-create-fundingSafe",className:"rounded-md border border-border bg-surface-sunken px-3 py-2.5 font-mono text-[13px] text-fg-muted break-all",children:s??"— (master Safe will be picked at launch)"})}),o.jsxs("div",{className:"grid grid-cols-1 gap-3.5 sm:grid-cols-2",children:[o.jsx(bt,{label:"Solution price (wei)",helperText:`≈ ${yi((g=_.solutionWei)==null?void 0:g.toString())}`,error:f.solutionPriceWei??null,children:o.jsx(gt,{"data-testid":"launcher-create-solutionPriceWei",type:"text",inputMode:"numeric",value:c,onChange:w=>u(w.target.value),placeholder:"e.g. 100000000000000 (0.0001 ETH)",className:ee(f.solutionPriceWei&&"border-break-red"),disabled:l})}),o.jsx(bt,{label:"Verdict price (wei)",helperText:`≈ ${yi((b=_.verdictWei)==null?void 0:b.toString())}`,error:f.verdictPriceWei??null,children:o.jsx(gt,{"data-testid":"launcher-create-verdictPriceWei",type:"text",inputMode:"numeric",value:m,onChange:w=>d(w.target.value),placeholder:"e.g. 50000000000000 (0.00005 ETH)",className:ee(f.verdictPriceWei&&"border-break-red"),disabled:l})})]}),f.combined&&o.jsx("div",{"data-testid":"launcher-create-pricing-combined-error",className:"font-mono text-[12px] text-break-red",children:f.combined}),o.jsx(we,{"data-testid":"launcher-create-projection",children:o.jsxs(Ge,{className:"flex flex-col gap-2.5 p-5",children:[o.jsx("h3",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-fg-muted",children:"Runway projection"}),o.jsx(Qe,{}),o.jsx(kh,{label:"Safe balance",value:i?`${yi(i)} (${i} wei)`:"—"}),o.jsx(kh,{label:"Per-Task cost",value:h?`${yi(h.perTaskWei.toString())} (${h.perTaskWei} wei)`:"—",hint:`solution + verdict × maxClaimsPerOperator (${y})`}),o.jsx(kh,{label:"Projected Tasks",value:h?`~${h.tasks.toLocaleString("en-US")}`:"—",hint:"Approximate; ignores gas and any in-flight reservations.",testId:"launcher-create-projected-tasks"})]})})]})}function kh({label:e,value:t,hint:r,testId:n}){return o.jsxs("div",{"data-testid":n,className:"grid grid-cols-[160px_1fr] items-baseline gap-3",children:[o.jsx("span",{className:"font-mono text-[11px] tracking-[0.06em] text-fg-dim",children:e}),o.jsxs("span",{className:"flex flex-col gap-0.5",children:[o.jsx("span",{className:"font-mono text-[13px] text-foreground",children:t}),r&&o.jsx("span",{className:"text-[12px] text-fg-muted",children:r})]})]})}const jM=1500,_y=["pinning","recording","broadcasting","confirming","spawning"],RM={pinning:"Pinning manifest",recording:"Recording draft",broadcasting:"Broadcasting tx",confirming:"Confirming on-chain",spawning:"Spawning generator"};function NM({draft:e,template:t=ka,onUpdateDraft:r,onBack:n,onLaunchFailure:s,navigateTo:i,pollIntervalMs:l=jM}){const[,a]=Hr(),c=i??a,u=C.useMemo(()=>e.openRoles&&e.openRoles.length>0?e.openRoles:["solver","evaluator"],[e.openRoles]),[m,d]=C.useState(u),[x,v]=C.useState({kind:"idle"}),_=C.useRef(!1);C.useEffect(()=>()=>{_.current=!0},[]);const y=g=>{d(b=>b.includes(g)?b.filter(w=>w!==g):[...b,g])},h=async()=>{var g,b,w;if(m.length!==0){v(k=>k.kind==="failed"?{kind:"idle"}:k),_.current=!1;try{await r({openRoles:m,completedSteps:Ca(e.completedSteps,"configurePricing")});const k=await me.solvernets.launch(e.draftId);if(_.current)return;let j="pinning";for(v({kind:"launching",phase:j,solverNetId:k.solverNetId});;){if(_.current)return;let S;try{S=await me.solvernets.get(k.solverNetId)}catch{if(_.current)return;await Cy(l);continue}if((g=S.launchProgress)!=null&&g.phase&&(j=S.launchProgress.phase),S.status==="launched"){v({kind:"launching",phase:"spawning",solverNetId:k.solverNetId}),c(`/launcher/launched/${encodeURIComponent(k.solverNetId)}`);return}if(S.status==="failed"){const E=((w=(b=S.launchProgress)==null?void 0:b.txError)==null?void 0:w.message)??`Launch failed during ${j}.`;v({kind:"failed",message:E,solverNetId:k.solverNetId}),s==null||s();return}v({kind:"launching",phase:j,solverNetId:k.solverNetId}),await Cy(l)}}catch(k){if(_.current)return;v({kind:"failed",message:k instanceof Error?k.message:String(k)}),s==null||s()}}},p=x.kind==="launching",f=m.length===0||p;return o.jsxs(Ki,{step:5,title:"Review & launch",blurb:"One last check. The Launch button signs the manifest, pins it to IPFS, and broadcasts the registry transaction.",footer:o.jsx(Gi,{onBack:n,onNext:()=>{h()},nextLabel:p?"Launching…":"Launch",nextDisabled:f,busy:p,right:p&&o.jsx(PM,{current:x.kind==="launching"?x.phase:"pinning"})}),children:[o.jsx(TM,{draft:e,template:t}),o.jsxs(bt,{label:"Open roles",helperText:"Operators can opt in to any role you open here. Most launchers want both.",asLabel:!1,children:[o.jsxs("div",{"data-testid":"launcher-create-openRoles",className:"flex flex-col gap-2.5",children:[o.jsx(Sy,{role:"solver",checked:m.includes("solver"),onChange:()=>y("solver"),disabled:p}),o.jsx(Sy,{role:"evaluator",checked:m.includes("evaluator"),onChange:()=>y("evaluator"),disabled:p})]}),m.length===0&&o.jsx("span",{"data-testid":"launcher-create-openRoles-error",className:"font-mono text-[12px] text-break-red",children:"At least one role must be open."})]}),x.kind==="failed"&&o.jsxs(Ye,{variant:"blocking","data-testid":"launcher-create-launch-failure",children:[o.jsx(Nt,{className:"font-mono text-[13px] font-medium text-break-red",children:"Launch failed."}),o.jsx(Xe,{className:"font-mono text-[12px] text-fg-muted",children:x.message}),o.jsxs("div",{className:"mt-2.5 flex gap-2",children:[o.jsx(ie,{type:"button",size:"sm","data-testid":"launcher-create-launch-retry",onClick:()=>{h()},children:"Retry"}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-create-launch-abandon",onClick:()=>{c("/launcher")},children:"Abandon"})]})]})]})}function PM({current:e}){const t=_y.indexOf(e);return o.jsxs("div",{"data-testid":"launcher-create-launch-progress","data-phase":e,className:"flex items-center gap-1.5 font-mono text-[11px] tracking-[0.06em] text-fg-muted",children:[o.jsx("span",{"data-testid":"launcher-create-launch-phase",children:RM[e]}),o.jsx("div",{className:"flex gap-[3px]",children:_y.map((r,n)=>o.jsx("span",{"data-testid":`launcher-create-launch-phase-pip-${r}`,"data-active":n<=t?"true":"false",className:ee("h-[3px] w-2 rounded-sm",n<=t?"bg-accent-sky":"bg-border")},r))})]})}function TM({draft:e,template:t}){const r=e.generatorConfig??{},n=e.templateContractId??t.id,s=e.templateContractVersion??t.version;return o.jsx(we,{"data-testid":"launcher-create-manifest-summary",children:o.jsxs(Ge,{className:"flex flex-col gap-3 p-6",children:[o.jsxs("header",{className:"flex flex-col gap-1",children:[o.jsxs("span",{className:"font-mono text-[11px] uppercase tracking-[0.14em] text-fg-dim",children:[n,".",s]}),o.jsx("h2",{className:"m-0 font-serif text-[24px] font-normal text-foreground",children:e.name??"— unnamed"}),e.description&&o.jsx("p",{className:"m-0 text-[13px] leading-relaxed text-fg-muted",children:e.description})]}),o.jsx(Qe,{}),o.jsxs(LM,{children:[o.jsx(kn,{label:"Solution price",value:by(e.solutionPriceWei)}),o.jsx(kn,{label:"Verdict price",value:by(e.verdictPriceWei)}),t.id==="prediction"?o.jsx(AM,{generator:r}):o.jsx(DM,{generator:r})]})]})})}function AM({generator:e}){const t=Oo(e.cadenceMs),r=Oo(e.windowMs??e.submissionWindowMs),n=Oo(e.maxOpenRounds);return o.jsxs(o.Fragment,{children:[o.jsx(kn,{label:"Cadence",value:t?`${t} ms`:"—"}),o.jsx(kn,{label:"Window",value:r?`${r} ms`:"—"}),o.jsx(kn,{label:"Max open rounds",value:n??"—"}),o.jsx(kn,{label:"Allowlist",value:wy(e.allowlistConditionIds)}),o.jsx(kn,{label:"Blocklist",value:wy(e.blocklistConditionIds)})]})}function DM({generator:e}){const t=Oo(e.N_target_successes),r=Oo(e.posting_window_ms),n=Oo(e.post_batch_size);return o.jsxs(o.Fragment,{children:[o.jsx(kn,{label:"Target successes",value:t??"—"}),o.jsx(kn,{label:"Posting window",value:r?`${r} ms`:"—"}),o.jsx(kn,{label:"Batch size",value:n??"—"})]})}function by(e){return e?`${e} wei (${yi(e)})`:"—"}function Oo(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&/^\d+$/.test(e.trim())?e.trim():null}function wy(e){return Array.isArray(e)&&e.length>0?`${e.length} entries`:"none"}function LM({children:e}){return o.jsx("div",{className:"grid grid-cols-1 gap-x-4 gap-y-2 sm:grid-cols-2",children:e})}function kn({label:e,value:t}){return o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-fg-dim",children:e}),o.jsx("span",{className:"font-mono text-[13px] text-foreground",children:t})]})}function Sy({role:e,checked:t,onChange:r,disabled:n}){return o.jsxs("label",{className:ee("flex items-center gap-2.5",n?"cursor-not-allowed opacity-60":"cursor-pointer"),children:[o.jsx("input",{"data-testid":`launcher-create-openRoles-${e}`,type:"checkbox",checked:t,onChange:r,disabled:n,className:"h-4 w-4 cursor-pointer accent-accent-sky"}),o.jsx("span",{className:"font-mono text-[13px] text-foreground",children:e})]})}function Cy(e){return new Promise(t=>setTimeout(t,e))}const vp="jinn.launcher-create.draftId.v1";function OM(){if(typeof window>"u")return null;try{return window.localStorage.getItem(vp)}catch{return null}}function ky(e){if(!(typeof window>"u"))try{e===null?window.localStorage.removeItem(vp):window.localStorage.setItem(vp,e)}catch{}}function MM(){if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search).get("template");return t&&t.length>0?t:null}function IM({templateKey:e}={}){var k;const t=e??MM()??gM,r=C.useMemo(()=>gp[t]??null,[t]),[n,s]=C.useState(null),[i,l]=C.useState(null),[a,c]=C.useState(1),[u,m]=C.useState(!1),[d,x]=C.useState(null),v=C.useRef(!1),{data:_}=Te({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap(),refetchInterval:3e4}),{data:y}=Te({queryKey:["status"],queryFn:()=>me.getStatus(),refetchInterval:3e4}),h=(_==null?void 0:_.master_address)??(y==null?void 0:y.master_address)??null,p=((k=y==null?void 0:y.masterGas)==null?void 0:k.balanceWei)??null;C.useEffect(()=>{if(v.current)return;v.current=!0;let j=!1;return(async()=>{const E=OM();if(E)try{const N=await me.solvernets.getDraft(E);if(j)return;s(N);return}catch{ky(null)}try{const N=await me.solvernets.createDraft();if(j)return;ky(N.draftId),s(N)}catch(N){if(j)return;l(N instanceof Error?N.message:"Failed to create draft.")}})(),()=>{j=!0}},[]);const f=async j=>{if(n){m(!0),x(null);try{const S=await me.solvernets.updateDraft(n.draftId,j);s(S),c(E=>E<5?E+1:E)}catch(S){x(S instanceof Error?S.message:String(S))}finally{m(!1)}}},g=async j=>{if(n){m(!0),x(null);try{const S=await me.solvernets.updateDraft(n.draftId,j);s(S)}catch(S){x(S instanceof Error?S.message:String(S))}finally{m(!1)}}},b=()=>{x(null),c(j=>j>1?j-1:j)},w=()=>{x(null)};if(r===null)return o.jsxs("main",{"data-testid":"launcher-create-unknown-template","data-template-key":t,className:"mx-auto flex max-w-[720px] flex-col gap-4 p-6",children:[o.jsx("h1",{className:"m-0 font-serif text-[28px] font-normal text-foreground",children:"Unknown SolverNet template"}),o.jsx(Ye,{variant:"blocking",children:o.jsxs(Xe,{className:"font-mono text-[13px]",children:["No template registered for ",o.jsx("code",{children:t}),". Available keys:"," ",Object.keys(gp).map(j=>`?template=${j}`).join(", "),"."]})})]});if(i)return o.jsxs("main",{"data-testid":"launcher-create-bootstrap-error",className:"mx-auto flex max-w-[720px] flex-col gap-4 p-6",children:[o.jsx("h1",{className:"m-0 font-serif text-[28px] font-normal text-foreground",children:"Couldn't start a new draft"}),o.jsxs(Ye,{variant:"blocking",children:[o.jsx(Nt,{className:"font-mono text-[12px]",children:"Bootstrap error"}),o.jsx(Xe,{className:"font-mono text-[13px]",children:i})]})]});if(!n)return o.jsx("main",{"data-testid":"launcher-create-loading",className:"p-6 font-mono text-[13px] text-fg-muted",children:"Loading draft…"});switch(a){case 1:return o.jsx(fy,{draft:n,onAdvance:f,busy:u,error:d});case 2:return o.jsx(xM,{draft:n,template:r,onAdvance:f,onBack:b,busy:u,error:d});case 3:return o.jsx(yM,{draft:n,template:r,onAdvance:f,onBack:b,busy:u,error:d});case 4:return o.jsx(EM,{draft:n,template:r,onAdvance:f,onBack:b,fundingSafeAddress:h,fundingSafeBalanceWei:p??null,busy:u,error:d});case 5:return o.jsx(NM,{draft:n,template:r,onUpdateDraft:g,onBack:b,onLaunchFailure:w});default:return o.jsx(fy,{draft:n,onAdvance:f,busy:u,error:d})}}function v1(e){return e?e.length<=16?e:`${e.slice(0,8)}…${e.slice(-6)}`:""}function x1(e){return e?e.length<=12?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function Nd(e){if(!e)return"—";try{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,16)+" UTC"}catch{return e}}const FM={launched:["paused","retired"],paused:["launched","retired"]};function Ey(e,t,r){const n=10n**BigInt(t),s=e/n,i=e%n;if(i===0n||r===0)return s.toString();const a=i.toString().padStart(t,"0").slice(0,r).replace(/0+$/,"");return a?`${s}.${a}`:s.toString()}function Ls(e){if(!e||!/^\d+$/.test(e))return"—";try{const t=BigInt(e);if(t===0n)return"0 ETH";const r=1000000000000000000n,n=100000000000000n,s=1000000000n;return t>=n?`${Ey(t,18,t>=r?4:6)} ETH`:t>=s?`${Ey(t,9,4)} gwei`:`${t.toLocaleString()} wei`}catch{return"—"}}function BM(e,t,r){if(!e||!/^\d+$/.test(e)||!t||!/^\d+$/.test(t)||!r||!/^\d+$/.test(r))return null;let n;try{n=BigInt(e)}catch{return null}const s=BigInt(t)+BigInt(r);return s<=0n?null:{tasks:Number(n/s),perTaskWei:s}}const jy=6e4;function $M(e){const t=e??{};return{cadenceMs:sn(t.cadenceMs),windowMs:sn(t.windowMs??t.submissionWindowMs),resolveGapMs:sn(t.resolveGapMs),maxNewRoundsPerPoll:sn(t.maxNewRoundsPerPoll),maxNewRoundsPerDay:sn(t.maxNewRoundsPerDay),maxOpenRounds:sn(t.maxOpenRounds),allowlistConditionIds:Ry(t.allowlistConditionIds),blocklistConditionIds:Ry(t.blocklistConditionIds)}}function HM(e,t){const r=e??{},n=UM(r.claimPolicy),s=(t==null?void 0:t.contract.claimPolicyDefaults)??{maxClaimsPerOperator:5,claimLeaseTtlSeconds:60*60};return{N_target_successes:sn(r.N_target_successes),posting_window_ms:sn(r.posting_window_ms),post_batch_size:sn(r.post_batch_size),maxClaimsPerOperator:sn(r.maxClaimsPerOperator??n.maxClaimsPerOperator??s.maxClaimsPerOperator),claimLeaseTtlSeconds:sn(r.claimLeaseTtlSeconds??n.claimLeaseTtlSeconds??s.claimLeaseTtlSeconds)}}function UM(e){return typeof e=="object"&&e!==null?e:{}}function sn(e){return typeof e=="number"&&Number.isFinite(e)?String(e):typeof e=="string"&&e.trim().length>0?e.trim():""}function Ry(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").join(", "):""}function y1(e){const t=e.trim();if(!t||!/^\d+$/.test(t))return null;const r=Number(t);return!Number.isFinite(r)||r<=0?null:r}function zM(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function WM(e,t){const r={},n={};for(const s of["cadenceMs","windowMs","resolveGapMs","maxNewRoundsPerPoll","maxNewRoundsPerDay","maxOpenRounds"]){if(e[s]===t[s]||e[s].trim().length===0)continue;const i=y1(e[s]);if(i===null){r[s]="Must be a positive integer.";continue}if(s==="cadenceMs"&&i<jy){r[s]=`Cadence must be at least ${jy/1e3}s.`;continue}s==="windowMs"?n.submissionWindowMs=i:n[s]=i}for(const s of["allowlistConditionIds","blocklistConditionIds"])e[s]!==t[s]&&(n[s]=zM(e[s]));return{ok:Object.keys(r).length===0,patch:n,errors:r}}function VM(e,t){const r={},n={};for(const s of["N_target_successes","posting_window_ms","post_batch_size","maxClaimsPerOperator","claimLeaseTtlSeconds"]){if(e[s]===t[s]||e[s].trim().length===0)continue;const i=y1(e[s]);if(i===null){r[s]=s==="posting_window_ms"?"Must be a positive integer (ms).":s==="claimLeaseTtlSeconds"?"Must be a positive integer (seconds).":"Must be a positive integer.";continue}n[s]=i}return{ok:Object.keys(r).length===0,patch:n,errors:r}}function qM(e,t){var n;if(t)return t.id==="swe-rebench-v2"&&t.version==="v1";if(((n=e.summary)==null?void 0:n.contractId)==="swe-rebench-v2"&&e.summary.contractVersion==="v1")return!0;const r=e.generatorConfig??{};return Object.prototype.hasOwnProperty.call(r,"N_target_successes")||Object.prototype.hasOwnProperty.call(r,"N_max_postings_per_task")||Object.prototype.hasOwnProperty.call(r,"posting_window_ms")||Object.prototype.hasOwnProperty.call(r,"cooldown_ms")}function KM({record:e,manifest:t,template:r,onSave:n}){return qM(e,r)?o.jsx(QM,{record:e,manifest:t,onSave:n}):o.jsx(GM,{record:e,onSave:n})}function _1({record:e,configExpanded:t,setConfigExpanded:r,children:n}){var s,i;return o.jsxs(we,{"data-testid":"launcher-launched-generator-panel",role:"region","aria-label":"Generator",className:"flex flex-col gap-4 p-6",children:[o.jsxs("header",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[o.jsx("h2",{className:"m-0 font-serif text-[22px] font-normal text-foreground",children:"Generator"}),o.jsx(eI,{record:e})]}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-generator-toggle","aria-expanded":t,"aria-controls":"launcher-launched-generator-config",onClick:()=>r(l=>!l),children:t?"Hide config":"Edit config"})]}),o.jsxs("dl",{className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(180px,1fr))]",children:[o.jsx(xs,{label:"Last poll",value:Nd((s=e.generatorState)==null?void 0:s.lastPollAt),testid:"launcher-launched-generator-last-poll"}),o.jsx(xs,{label:"Generator enabled",value:e.generatorEnabled?"yes":"no",testid:"launcher-launched-generator-enabled"})]}),o.jsx(YM,{record:e}),o.jsx(JM,{record:e}),((i=e.generatorState)==null?void 0:i.lastError)&&o.jsx(XM,{record:e}),n]})}function GM({record:e,onSave:t}){const r=C.useMemo(()=>$M(e.generatorConfig),[e.generatorConfig]),[n,s]=C.useState(r),[i,l]=C.useState({kind:"idle"}),[a,c]=C.useState(!1);C.useEffect(()=>{s(y=>JSON.stringify(y)!==JSON.stringify(_())?y:r);function _(){return r}},[JSON.stringify(e.generatorConfig)]);const u=(_,y)=>{s(h=>({...h,[_]:y}))},m=C.useMemo(()=>WM(n,r),[n,r]),d=Object.keys(m.patch).length>0,x=i.kind==="saving",v=async()=>{if(!(!m.ok||!d||x)){l({kind:"saving"});try{await t(m.patch),l({kind:"saved",at:new Date})}catch(_){l({kind:"error",message:_ instanceof Error?_.message:String(_)})}}};return o.jsx(_1,{record:e,configExpanded:a,setConfigExpanded:c,children:a&&o.jsxs("div",{id:"launcher-launched-generator-config","data-testid":"launcher-launched-generator-config",className:"flex flex-col gap-3.5 pt-3.5",children:[o.jsx(Qe,{}),o.jsx("h3",{className:"m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Hot-apply config"}),o.jsxs("div",{className:"grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(on,{label:"Cadence (ms)",testid:"launcher-launched-generator-cadenceMs",value:n.cadenceMs,onChange:_=>u("cadenceMs",_),error:m.errors.cadenceMs,disabled:x}),o.jsx(on,{label:"Submission window (ms)",testid:"launcher-launched-generator-windowMs",value:n.windowMs,onChange:_=>u("windowMs",_),error:m.errors.windowMs,disabled:x}),o.jsx(on,{label:"Resolve gap (ms)",testid:"launcher-launched-generator-resolveGapMs",value:n.resolveGapMs,onChange:_=>u("resolveGapMs",_),error:m.errors.resolveGapMs,disabled:x}),o.jsx(on,{label:"Max rounds / poll",testid:"launcher-launched-generator-maxNewRoundsPerPoll",value:n.maxNewRoundsPerPoll,onChange:_=>u("maxNewRoundsPerPoll",_),error:m.errors.maxNewRoundsPerPoll,disabled:x}),o.jsx(on,{label:"Max rounds / day",testid:"launcher-launched-generator-maxNewRoundsPerDay",value:n.maxNewRoundsPerDay,onChange:_=>u("maxNewRoundsPerDay",_),error:m.errors.maxNewRoundsPerDay,disabled:x}),o.jsx(on,{label:"Max open rounds",testid:"launcher-launched-generator-maxOpenRounds",value:n.maxOpenRounds,onChange:_=>u("maxOpenRounds",_),error:m.errors.maxOpenRounds,disabled:x})]}),o.jsx(Ny,{label:"Allowlist condition ids",testid:"launcher-launched-generator-allowlistConditionIds",value:n.allowlistConditionIds,onChange:_=>u("allowlistConditionIds",_),disabled:x}),o.jsx(Ny,{label:"Blocklist condition ids",testid:"launcher-launched-generator-blocklistConditionIds",value:n.blocklistConditionIds,onChange:_=>u("blocklistConditionIds",_),disabled:x}),o.jsx(b1,{dirty:d,saving:x,validationOk:m.ok,saveStatus:i,onSubmit:v})]})})}function QM({record:e,manifest:t,onSave:r}){const n=C.useMemo(()=>HM(e.generatorConfig,t),[e.generatorConfig,t]),[s,i]=C.useState(n),[l,a]=C.useState({kind:"idle"}),[c,u]=C.useState(!1);C.useEffect(()=>{i(y=>JSON.stringify(y)!==JSON.stringify(n)?y:n)},[JSON.stringify(e.generatorConfig)]);const m=(y,h)=>{i(p=>({...p,[y]:h}))},d=C.useMemo(()=>VM(s,n),[s,n]),x=Object.keys(d.patch).length>0,v=l.kind==="saving",_=async()=>{if(!(!d.ok||!x||v)){a({kind:"saving"});try{await r(d.patch),a({kind:"saved",at:new Date})}catch(y){a({kind:"error",message:y instanceof Error?y.message:String(y)})}}};return o.jsx(_1,{record:e,configExpanded:c,setConfigExpanded:u,children:c&&o.jsxs("div",{id:"launcher-launched-generator-config","data-testid":"launcher-launched-generator-config",className:"flex flex-col gap-3.5 pt-3.5",children:[o.jsx(Qe,{}),o.jsx("h3",{className:"m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Hot-apply config"}),o.jsxs("div",{className:"grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(on,{label:"Target successful Verdicts per instance",testid:"launcher-launched-generator-N_target_successes",value:s.N_target_successes,onChange:y=>m("N_target_successes",y),error:d.errors.N_target_successes,disabled:v}),o.jsx(on,{label:"Posting window (ms)",testid:"launcher-launched-generator-posting_window_ms",value:s.posting_window_ms,onChange:y=>m("posting_window_ms",y),error:d.errors.posting_window_ms,disabled:v}),o.jsx(on,{label:"Post batch size",testid:"launcher-launched-generator-post_batch_size",value:s.post_batch_size,onChange:y=>m("post_batch_size",y),error:d.errors.post_batch_size,disabled:v})]}),o.jsx("h3",{className:"m-0 font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Claim policy"}),o.jsxs("div",{className:"grid gap-3.5 [grid-template-columns:repeat(auto-fit,minmax(180px,1fr))]",children:[o.jsx(on,{label:"Max claims per operator",testid:"launcher-launched-generator-maxClaimsPerOperator",value:s.maxClaimsPerOperator,onChange:y=>m("maxClaimsPerOperator",y),error:d.errors.maxClaimsPerOperator,disabled:v}),o.jsx(on,{label:"Claim lease (seconds)",testid:"launcher-launched-generator-claimLeaseTtlSeconds",value:s.claimLeaseTtlSeconds,onChange:y=>m("claimLeaseTtlSeconds",y),error:d.errors.claimLeaseTtlSeconds,disabled:v})]}),o.jsx(b1,{dirty:x,saving:v,validationOk:d.ok,saveStatus:l,onSubmit:_})]})})}function b1({dirty:e,saving:t,validationOk:r,saveStatus:n,onSubmit:s}){const i=e&&r&&!t;return o.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[o.jsx(Qe,{}),o.jsxs("div",{className:"flex items-center justify-between gap-3 pt-1",children:[o.jsx(tI,{status:n}),o.jsx(ie,{type:"button",variant:"default","data-testid":"launcher-launched-generator-save",onClick:()=>{s()},disabled:!i,children:t?"Saving…":"Save"})]})]})}function YM({record:e}){var r;const t=(r=e.generatorState)==null?void 0:r.lastPollSummary;return ZM(t)?o.jsxs("dl",{"data-testid":"launcher-launched-generator-pool-summary",className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(120px,1fr))]",children:[o.jsx(xs,{label:"Pool",value:String(t.poolSize),testid:"launcher-launched-generator-poolSize"}),o.jsx(xs,{label:"Posted",value:String(t.posted),testid:"launcher-launched-generator-posted"}),o.jsx(xs,{label:"Unposted",value:String(t.unposted),testid:"launcher-launched-generator-unposted"}),o.jsx(xs,{label:"Live",value:String(t.live),testid:"launcher-launched-generator-live"}),o.jsx(xs,{label:"Repostable",value:String(t.repostable),testid:"launcher-launched-generator-repostable"}),o.jsx(xs,{label:"Saturated",value:String(t.saturated),testid:"launcher-launched-generator-saturated"})]}):null}function ZM(e){if(typeof e!="object"||e===null)return!1;const t=e;return["poolSize","posted","unposted","live","repostable","saturated"].every(r=>typeof t[r]=="number")}function XM({record:e}){var t,r,n,s;return o.jsxs("div",{"data-testid":"launcher-launched-generator-error",className:"flex flex-col gap-1 rounded-md border border-destructive bg-card p-3",children:[o.jsxs("span",{className:"font-mono text-[12px] font-medium text-destructive",children:["Last error · ",Nd((r=(t=e.generatorState)==null?void 0:t.lastError)==null?void 0:r.at)]}),o.jsx("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:(s=(n=e.generatorState)==null?void 0:n.lastError)==null?void 0:s.message})]})}function JM({record:e}){var i,l,a;const t=(i=e.generatorState)==null?void 0:i.poolPublicationUpdatedAt;if(!t)return null;const r=(l=e.generatorState)==null?void 0:l.poolPublicationPriorSize,n=(a=e.generatorState)==null?void 0:a.poolPublicationCurrentSize,s=typeof r=="number"&&typeof n=="number"?`Pool grew from ${r} → ${n} scorable tasks`:"Pool re-published";return o.jsxs(Ye,{"data-testid":"launcher-launched-generator-pool-republished",variant:"default",children:[o.jsx(Nt,{children:"Vetted pool re-published"}),o.jsxs(Xe,{children:[s," · ",Nd(t)]})]})}function eI({record:e}){var s;const t=e.generatorEnabled,n=!!((s=e.generatorState)!=null&&s.lastError)?{variant:"destructive",label:"Errored"}:t?{variant:"success",label:"Enabled"}:{variant:"outline",label:"Disabled"};return o.jsx(Se,{"data-testid":"launcher-launched-generator-state-badge",variant:n.variant,children:n.label})}function tI({status:e}){if(e.kind==="saving")return o.jsx("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[12px] text-[var(--fg-muted)]",children:"Saving…"});if(e.kind==="saved"){const t=e.at.toISOString().slice(11,16);return o.jsxs("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[12px] text-[var(--vow-green)]",children:["Saved at ",t," UTC"]})}return e.kind==="error"?o.jsxs("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[12px] text-destructive",children:["Save failed: ",e.message]}):o.jsx("span",{"data-testid":"launcher-launched-generator-save-status",className:"font-mono text-[11px] text-[var(--fg-dim)]",children:"Edits hot-apply without restart."})}function on({label:e,testid:t,value:r,onChange:n,error:s,disabled:i}){return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Sr,{htmlFor:t,className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),o.jsx(gt,{id:t,"data-testid":t,type:"text",inputMode:"numeric",value:r,onChange:l=>n(l.target.value),disabled:i,className:ee(s&&"border-destructive")}),s&&o.jsx("span",{"data-testid":`${t}-error`,className:"font-mono text-[11px] text-destructive",children:s})]})}function Ny({label:e,testid:t,value:r,onChange:n,disabled:s}){return o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Sr,{htmlFor:t,className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),o.jsx("textarea",{id:t,"data-testid":t,value:r,onChange:i=>n(i.target.value),disabled:s,rows:2,placeholder:"0xabc…, 0xdef…",className:"flex w-full resize-y rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[13px] text-foreground transition-colors placeholder:text-[var(--fg-dim)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"})]})}function xs({label:e,value:t,testid:r}){return o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),o.jsx("dd",{"data-testid":r,className:"m-0 font-mono text-[13px] text-foreground",children:t})]})}var Eh="focusScope.autoFocusOnMount",jh="focusScope.autoFocusOnUnmount",Py={bubbles:!1,cancelable:!0},rI="FocusScope",Pd=C.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...l}=e,[a,c]=C.useState(null),u=Ht(s),m=Ht(i),d=C.useRef(null),x=Be(t,y=>c(y)),v=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(n){let y=function(g){if(v.paused||!a)return;const b=g.target;a.contains(b)?d.current=b:ms(d.current,{select:!0})},h=function(g){if(v.paused||!a)return;const b=g.relatedTarget;b!==null&&(a.contains(b)||ms(d.current,{select:!0}))},p=function(g){if(document.activeElement===document.body)for(const w of g)w.removedNodes.length>0&&ms(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",h);const f=new MutationObserver(p);return a&&f.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",h),f.disconnect()}}},[n,a,v.paused]),C.useEffect(()=>{if(a){Ay.add(v);const y=document.activeElement;if(!a.contains(y)){const p=new CustomEvent(Eh,Py);a.addEventListener(Eh,u),a.dispatchEvent(p),p.defaultPrevented||(nI(lI(w1(a)),{select:!0}),document.activeElement===y&&ms(a))}return()=>{a.removeEventListener(Eh,u),setTimeout(()=>{const p=new CustomEvent(jh,Py);a.addEventListener(jh,m),a.dispatchEvent(p),p.defaultPrevented||ms(y??document.body,{select:!0}),a.removeEventListener(jh,m),Ay.remove(v)},0)}}},[a,u,m,v]);const _=C.useCallback(y=>{if(!r&&!n||v.paused)return;const h=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,p=document.activeElement;if(h&&p){const f=y.currentTarget,[g,b]=sI(f);g&&b?!y.shiftKey&&p===b?(y.preventDefault(),r&&ms(g,{select:!0})):y.shiftKey&&p===g&&(y.preventDefault(),r&&ms(b,{select:!0})):p===f&&y.preventDefault()}},[r,n,v.paused]);return o.jsx($e.div,{tabIndex:-1,...l,ref:x,onKeyDown:_})});Pd.displayName=rI;function nI(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ms(n,{select:t}),document.activeElement!==r)return}function sI(e){const t=w1(e),r=Ty(t,e),n=Ty(t.reverse(),e);return[r,n]}function w1(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Ty(e,t){for(const r of e)if(!iI(r,{upTo:t}))return r}function iI(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function oI(e){return e instanceof HTMLInputElement&&"select"in e}function ms(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&oI(e)&&t&&e.select()}}var Ay=aI();function aI(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Dy(e,t),e.unshift(t)},remove(t){var r;e=Dy(e,t),(r=e[0])==null||r.resume()}}}function Dy(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function lI(e){return e.filter(t=>t.tagName!=="A")}var Rh=0;function xg(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ly()),document.body.insertAdjacentElement("beforeend",e[1]??Ly()),Rh++,()=>{Rh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Rh--}},[])}function Ly(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var En=function(){return En=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},En.apply(this,arguments)};function S1(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function cI(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,i;n<s;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var eu="right-scroll-bar-position",tu="width-before-scroll-bar",uI="with-scroll-bars-hidden",dI="--removed-body-scroll-bar-size";function Nh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function hI(e,t){var r=C.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var fI=typeof window<"u"?C.useLayoutEffect:C.useEffect,Oy=new WeakMap;function pI(e,t){var r=hI(null,function(n){return e.forEach(function(s){return Nh(s,n)})});return fI(function(){var n=Oy.get(r);if(n){var s=new Set(n),i=new Set(e),l=r.current;s.forEach(function(a){i.has(a)||Nh(a,null)}),i.forEach(function(a){s.has(a)||Nh(a,l)})}Oy.set(r,e)},[e]),r}function mI(e){return e}function gI(e,t){t===void 0&&(t=mI);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var l=t(i,n);return r.push(l),function(){r=r.filter(function(a){return a!==l})}},assignSyncMedium:function(i){for(n=!0;r.length;){var l=r;r=[],l.forEach(i)}r={push:function(a){return i(a)},filter:function(){return r}}},assignMedium:function(i){n=!0;var l=[];if(r.length){var a=r;r=[],a.forEach(i),l=r}var c=function(){var m=l;l=[],m.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(m){l.push(m),u()},filter:function(m){return l=l.filter(m),r}}}};return s}function vI(e){e===void 0&&(e={});var t=gI(null);return t.options=En({async:!0,ssr:!1},e),t}var C1=function(e){var t=e.sideCar,r=S1(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return C.createElement(n,En({},r))};C1.isSideCarExport=!0;function xI(e,t){return e.useMedium(t),C1}var k1=vI(),Ph=function(){},Td=C.forwardRef(function(e,t){var r=C.useRef(null),n=C.useState({onScrollCapture:Ph,onWheelCapture:Ph,onTouchMoveCapture:Ph}),s=n[0],i=n[1],l=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,m=e.enabled,d=e.shards,x=e.sideCar,v=e.noRelative,_=e.noIsolation,y=e.inert,h=e.allowPinchZoom,p=e.as,f=p===void 0?"div":p,g=e.gapMode,b=S1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=x,k=pI([r,t]),j=En(En({},b),s);return C.createElement(C.Fragment,null,m&&C.createElement(w,{sideCar:k1,removeScrollBar:u,shards:d,noRelative:v,noIsolation:_,inert:y,setCallbacks:i,allowPinchZoom:!!h,lockRef:r,gapMode:g}),l?C.cloneElement(C.Children.only(a),En(En({},j),{ref:k})):C.createElement(f,En({},j,{className:c,ref:k}),a))});Td.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Td.classNames={fullWidth:tu,zeroRight:eu};var yI=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _I(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=yI();return t&&e.setAttribute("nonce",t),e}function bI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function wI(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var SI=function(){var e=0,t=null;return{add:function(r){e==0&&(t=_I())&&(bI(t,r),wI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},CI=function(){var e=SI();return function(t,r){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},E1=function(){var e=CI(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},kI={left:0,top:0,right:0,gap:0},Th=function(e){return parseInt(e||"",10)||0},EI=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Th(r),Th(n),Th(s)]},jI=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return kI;var t=EI(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},RI=E1(),Mo="data-scroll-locked",NI=function(e,t,r,n){var s=e.left,i=e.top,l=e.right,a=e.gap;return r===void 0&&(r="margin"),`
|
|
208
|
+
.`.concat(uI,` {
|
|
209
|
+
overflow: hidden `).concat(n,`;
|
|
210
|
+
padding-right: `).concat(a,"px ").concat(n,`;
|
|
211
|
+
}
|
|
212
|
+
body[`).concat(Mo,`] {
|
|
213
|
+
overflow: hidden `).concat(n,`;
|
|
214
|
+
overscroll-behavior: contain;
|
|
215
|
+
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
|
|
216
|
+
padding-left: `.concat(s,`px;
|
|
217
|
+
padding-top: `).concat(i,`px;
|
|
218
|
+
padding-right: `).concat(l,`px;
|
|
219
|
+
margin-left:0;
|
|
220
|
+
margin-top:0;
|
|
221
|
+
margin-right: `).concat(a,"px ").concat(n,`;
|
|
222
|
+
`),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.`).concat(eu,` {
|
|
226
|
+
right: `).concat(a,"px ").concat(n,`;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.`).concat(tu,` {
|
|
230
|
+
margin-right: `).concat(a,"px ").concat(n,`;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.`).concat(eu," .").concat(eu,` {
|
|
234
|
+
right: 0 `).concat(n,`;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.`).concat(tu," .").concat(tu,` {
|
|
238
|
+
margin-right: 0 `).concat(n,`;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
body[`).concat(Mo,`] {
|
|
242
|
+
`).concat(dI,": ").concat(a,`px;
|
|
243
|
+
}
|
|
244
|
+
`)},My=function(){var e=parseInt(document.body.getAttribute(Mo)||"0",10);return isFinite(e)?e:0},PI=function(){C.useEffect(function(){return document.body.setAttribute(Mo,(My()+1).toString()),function(){var e=My()-1;e<=0?document.body.removeAttribute(Mo):document.body.setAttribute(Mo,e.toString())}},[])},TI=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;PI();var i=C.useMemo(function(){return jI(s)},[s]);return C.createElement(RI,{styles:NI(i,!t,s,r?"":"!important")})},xp=!1;if(typeof window<"u")try{var Dc=Object.defineProperty({},"passive",{get:function(){return xp=!0,!0}});window.addEventListener("test",Dc,Dc),window.removeEventListener("test",Dc,Dc)}catch{xp=!1}var to=xp?{passive:!1}:!1,AI=function(e){return e.tagName==="TEXTAREA"},j1=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!AI(e)&&r[t]==="visible")},DI=function(e){return j1(e,"overflowY")},LI=function(e){return j1(e,"overflowX")},Iy=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=R1(e,n);if(s){var i=N1(e,n),l=i[1],a=i[2];if(l>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},OI=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},MI=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},R1=function(e,t){return e==="v"?DI(t):LI(t)},N1=function(e,t){return e==="v"?OI(t):MI(t)},II=function(e,t){return e==="h"&&t==="rtl"?-1:1},FI=function(e,t,r,n,s){var i=II(e,window.getComputedStyle(t).direction),l=i*n,a=r.target,c=t.contains(a),u=!1,m=l>0,d=0,x=0;do{if(!a)break;var v=N1(e,a),_=v[0],y=v[1],h=v[2],p=y-h-i*_;(_||p)&&R1(e,a)&&(d+=p,x+=_);var f=a.parentNode;a=f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?f.host:f}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(m&&Math.abs(d)<1||!m&&Math.abs(x)<1)&&(u=!0),u},Lc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Fy=function(e){return[e.deltaX,e.deltaY]},By=function(e){return e&&"current"in e?e.current:e},BI=function(e,t){return e[0]===t[0]&&e[1]===t[1]},$I=function(e){return`
|
|
245
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
246
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
247
|
+
`)},HI=0,ro=[];function UI(e){var t=C.useRef([]),r=C.useRef([0,0]),n=C.useRef(),s=C.useState(HI++)[0],i=C.useState(E1)[0],l=C.useRef(e);C.useEffect(function(){l.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var y=cI([e.lockRef.current],(e.shards||[]).map(By),!0).filter(Boolean);return y.forEach(function(h){return h.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),y.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(y,h){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!l.current.allowPinchZoom;var p=Lc(y),f=r.current,g="deltaX"in y?y.deltaX:f[0]-p[0],b="deltaY"in y?y.deltaY:f[1]-p[1],w,k=y.target,j=Math.abs(g)>Math.abs(b)?"h":"v";if("touches"in y&&j==="h"&&k.type==="range")return!1;var S=window.getSelection(),E=S&&S.anchorNode,N=E?E===k||E.contains(k):!1;if(N)return!1;var O=Iy(j,k);if(!O)return!0;if(O?w=j:(w=j==="v"?"h":"v",O=Iy(j,k)),!O)return!1;if(!n.current&&"changedTouches"in y&&(g||b)&&(n.current=w),!w)return!0;var T=n.current||w;return FI(T,h,y,T==="h"?g:b)},[]),c=C.useCallback(function(y){var h=y;if(!(!ro.length||ro[ro.length-1]!==i)){var p="deltaY"in h?Fy(h):Lc(h),f=t.current.filter(function(w){return w.name===h.type&&(w.target===h.target||h.target===w.shadowParent)&&BI(w.delta,p)})[0];if(f&&f.should){h.cancelable&&h.preventDefault();return}if(!f){var g=(l.current.shards||[]).map(By).filter(Boolean).filter(function(w){return w.contains(h.target)}),b=g.length>0?a(h,g[0]):!l.current.noIsolation;b&&h.cancelable&&h.preventDefault()}}},[]),u=C.useCallback(function(y,h,p,f){var g={name:y,delta:h,target:p,should:f,shadowParent:zI(p)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(b){return b!==g})},1)},[]),m=C.useCallback(function(y){r.current=Lc(y),n.current=void 0},[]),d=C.useCallback(function(y){u(y.type,Fy(y),y.target,a(y,e.lockRef.current))},[]),x=C.useCallback(function(y){u(y.type,Lc(y),y.target,a(y,e.lockRef.current))},[]);C.useEffect(function(){return ro.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:x}),document.addEventListener("wheel",c,to),document.addEventListener("touchmove",c,to),document.addEventListener("touchstart",m,to),function(){ro=ro.filter(function(y){return y!==i}),document.removeEventListener("wheel",c,to),document.removeEventListener("touchmove",c,to),document.removeEventListener("touchstart",m,to)}},[]);var v=e.removeScrollBar,_=e.inert;return C.createElement(C.Fragment,null,_?C.createElement(i,{styles:$I(s)}):null,v?C.createElement(TI,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function zI(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const WI=xI(k1,UI);var Ad=C.forwardRef(function(e,t){return C.createElement(Td,En({},e,{ref:t,sideCar:WI}))});Ad.classNames=Td.classNames;var VI=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},no=new WeakMap,Oc=new WeakMap,Mc={},Ah=0,P1=function(e){return e&&(e.host||P1(e.parentNode))},qI=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=P1(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},KI=function(e,t,r,n){var s=qI(t,Array.isArray(e)?e:[e]);Mc[r]||(Mc[r]=new WeakMap);var i=Mc[r],l=[],a=new Set,c=new Set(s),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};s.forEach(u);var m=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(x){if(a.has(x))m(x);else try{var v=x.getAttribute(n),_=v!==null&&v!=="false",y=(no.get(x)||0)+1,h=(i.get(x)||0)+1;no.set(x,y),i.set(x,h),l.push(x),y===1&&_&&Oc.set(x,!0),h===1&&x.setAttribute(r,"true"),_||x.setAttribute(n,"true")}catch(p){console.error("aria-hidden: cannot operate on ",x,p)}})};return m(t),a.clear(),Ah++,function(){l.forEach(function(d){var x=no.get(d)-1,v=i.get(d)-1;no.set(d,x),i.set(d,v),x||(Oc.has(d)||d.removeAttribute(n),Oc.delete(d)),v||d.removeAttribute(r)}),Ah--,Ah||(no=new WeakMap,no=new WeakMap,Oc=new WeakMap,Mc={})}},yg=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=VI(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),KI(n,s,r,"aria-hidden")):function(){return null}};function GI(e){const t=QI(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(ZI);if(c){const u=c.props.children,m=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,m):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function QI(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=JI(s),a=XI(i,s.props);return s.type!==C.Fragment&&(a.ref=n?os(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var YI=Symbol("radix.slottable");function ZI(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YI}function XI(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function JI(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Dd="Dialog",[T1,A1]=gn(Dd),[e3,vn]=T1(Dd),D1=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:l=!0}=e,a=C.useRef(null),c=C.useRef(null),[u,m]=Sa({prop:n,defaultProp:s??!1,onChange:i,caller:Dd});return o.jsx(e3,{scope:t,triggerRef:a,contentRef:c,contentId:Vs(),titleId:Vs(),descriptionId:Vs(),open:u,onOpenChange:m,onOpenToggle:C.useCallback(()=>m(d=>!d),[m]),modal:l,children:r})};D1.displayName=Dd;var L1="DialogTrigger",O1=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=vn(L1,r),i=Be(t,s.triggerRef);return o.jsx($e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":wg(s.open),...n,ref:i,onClick:ye(e.onClick,s.onOpenToggle)})});O1.displayName=L1;var _g="DialogPortal",[t3,M1]=T1(_g,{forceMount:void 0}),I1=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,i=vn(_g,t);return o.jsx(t3,{scope:t,forceMount:r,children:C.Children.map(n,l=>o.jsx(Wt,{present:r||i.open,children:o.jsx(Xl,{asChild:!0,container:s,children:l})}))})};I1.displayName=_g;var Bu="DialogOverlay",F1=C.forwardRef((e,t)=>{const r=M1(Bu,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=vn(Bu,e.__scopeDialog);return i.modal?o.jsx(Wt,{present:n||i.open,children:o.jsx(n3,{...s,ref:t})}):null});F1.displayName=Bu;var r3=GI("DialogOverlay.RemoveScroll"),n3=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=vn(Bu,r);return o.jsx(Ad,{as:r3,allowPinchZoom:!0,shards:[s.contentRef],children:o.jsx($e.div,{"data-state":wg(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Bi="DialogContent",B1=C.forwardRef((e,t)=>{const r=M1(Bi,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,i=vn(Bi,e.__scopeDialog);return o.jsx(Wt,{present:n||i.open,children:i.modal?o.jsx(s3,{...s,ref:t}):o.jsx(i3,{...s,ref:t})})});B1.displayName=Bi;var s3=C.forwardRef((e,t)=>{const r=vn(Bi,e.__scopeDialog),n=C.useRef(null),s=Be(t,r.contentRef,n);return C.useEffect(()=>{const i=n.current;if(i)return yg(i)},[]),o.jsx($1,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ye(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,a=l.button===0&&l.ctrlKey===!0;(l.button===2||a)&&i.preventDefault()}),onFocusOutside:ye(e.onFocusOutside,i=>i.preventDefault())})}),i3=C.forwardRef((e,t)=>{const r=vn(Bi,e.__scopeDialog),n=C.useRef(!1),s=C.useRef(!1);return o.jsx($1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,a;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),$1=C.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,...l}=e,a=vn(Bi,r),c=C.useRef(null),u=Be(t,c);return xg(),o.jsxs(o.Fragment,{children:[o.jsx(Pd,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:o.jsx(Yl,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":wg(a.open),...l,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(a3,{titleId:a.titleId}),o.jsx(c3,{contentRef:c,descriptionId:a.descriptionId})]})]})}),bg="DialogTitle",H1=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=vn(bg,r);return o.jsx($e.h2,{id:s.titleId,...n,ref:t})});H1.displayName=bg;var U1="DialogDescription",z1=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=vn(U1,r);return o.jsx($e.p,{id:s.descriptionId,...n,ref:t})});z1.displayName=U1;var W1="DialogClose",V1=C.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=vn(W1,r);return o.jsx($e.button,{type:"button",...n,ref:t,onClick:ye(e.onClick,()=>s.onOpenChange(!1))})});V1.displayName=W1;function wg(e){return e?"open":"closed"}var q1="DialogTitleWarning",[o3,K1]=xP(q1,{contentName:Bi,titleName:bg,docsSlug:"dialog"}),a3=({titleId:e})=>{const t=K1(q1),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
248
|
+
|
|
249
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
250
|
+
|
|
251
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},l3="DialogDescriptionWarning",c3=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${K1(l3).contentName}}.`;return C.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},G1=D1,u3=O1,Q1=I1,Sg=F1,Cg=B1,kg=H1,Eg=z1,jg=V1,d3=Symbol("radix.slottable");function h3(e){const t=({children:r})=>o.jsx(o.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=d3,t}var Y1="AlertDialog",[f3]=gn(Y1,[A1]),ls=A1(),Z1=e=>{const{__scopeAlertDialog:t,...r}=e,n=ls(t);return o.jsx(G1,{...n,...r,modal:!0})};Z1.displayName=Y1;var p3="AlertDialogTrigger",m3=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=ls(r);return o.jsx(u3,{...s,...n,ref:t})});m3.displayName=p3;var g3="AlertDialogPortal",X1=e=>{const{__scopeAlertDialog:t,...r}=e,n=ls(t);return o.jsx(Q1,{...n,...r})};X1.displayName=g3;var v3="AlertDialogOverlay",J1=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=ls(r);return o.jsx(Sg,{...s,...n,ref:t})});J1.displayName=v3;var Io="AlertDialogContent",[x3,y3]=f3(Io),_3=h3("AlertDialogContent"),eC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,i=ls(r),l=C.useRef(null),a=Be(t,l),c=C.useRef(null);return o.jsx(o3,{contentName:Io,titleName:tC,docsSlug:"alert-dialog",children:o.jsx(x3,{scope:r,cancelRef:c,children:o.jsxs(Cg,{role:"alertdialog",...i,...s,ref:a,onOpenAutoFocus:ye(s.onOpenAutoFocus,u=>{var m;u.preventDefault(),(m=c.current)==null||m.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[o.jsx(_3,{children:n}),o.jsx(w3,{contentRef:l})]})})})});eC.displayName=Io;var tC="AlertDialogTitle",rC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=ls(r);return o.jsx(kg,{...s,...n,ref:t})});rC.displayName=tC;var nC="AlertDialogDescription",sC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=ls(r);return o.jsx(Eg,{...s,...n,ref:t})});sC.displayName=nC;var b3="AlertDialogAction",iC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=ls(r);return o.jsx(jg,{...s,...n,ref:t})});iC.displayName=b3;var oC="AlertDialogCancel",aC=C.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=y3(oC,r),i=ls(r),l=Be(t,s);return o.jsx(jg,{...i,...n,ref:l})});aC.displayName=oC;var w3=({contentRef:e})=>{const t=`\`${Io}\` requires a description for the component to be accessible for screen reader users.
|
|
252
|
+
|
|
253
|
+
You can add a description to the \`${Io}\` by passing a \`${nC}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
254
|
+
|
|
255
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Io}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
256
|
+
|
|
257
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return C.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},S3=Z1,C3=X1,lC=J1,cC=eC,uC=iC,dC=aC,hC=rC,fC=sC;const pC=S3,k3=C3,mC=C.forwardRef(({className:e,...t},r)=>o.jsx(lC,{className:ee("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));mC.displayName=lC.displayName;const Rg=C.forwardRef(({className:e,...t},r)=>o.jsxs(k3,{children:[o.jsx(mC,{}),o.jsx(cC,{ref:r,className:ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-card p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Rg.displayName=cC.displayName;const Ng=({className:e,...t})=>o.jsx("div",{className:ee("flex flex-col gap-2 text-left",e),...t});Ng.displayName="AlertDialogHeader";const Pg=({className:e,...t})=>o.jsx("div",{className:ee("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t});Pg.displayName="AlertDialogFooter";const Tg=C.forwardRef(({className:e,...t},r)=>o.jsx(hC,{ref:r,className:ee("font-serif text-[20px] leading-tight text-foreground",e),...t}));Tg.displayName=hC.displayName;const Ag=C.forwardRef(({className:e,...t},r)=>o.jsx(fC,{ref:r,className:ee("font-mono text-[12px] text-[var(--fg-muted)]",e),...t}));Ag.displayName=fC.displayName;const Dg=C.forwardRef(({className:e,...t},r)=>o.jsx(uC,{ref:r,className:ee(qm(),e),...t}));Dg.displayName=uC.displayName;const Lg=C.forwardRef(({className:e,...t},r)=>o.jsx(dC,{ref:r,className:ee(qm({variant:"secondary"}),"mt-2 sm:mt-0",e),...t}));Lg.displayName=dC.displayName;const E3={paused:{title:"Pause SolverNet",body:"The generator will stop posting new Tasks. Existing Tasks continue through their normal lifecycle. You can resume any time.",confirmLabel:"Pause"},launched:{title:"Resume SolverNet",body:"The generator will resume polling and posting new Tasks at the configured cadence.",confirmLabel:"Resume"},retired:{title:"Retire SolverNet",body:"Retirement is permanent. The SolverNet stops accepting new work and disappears from the operator catalog. Historical Tasks, solutions, and verdicts remain discoverable. Type the SolverNet name to confirm.",confirmLabel:"Retire permanently",danger:!0}};function j3({open:e,target:t,solverNetName:r,onConfirm:n,onCancel:s,pending:i=!1,errorMessage:l}){const[a,c]=C.useState("");C.useEffect(()=>{e||c("")},[e,t]);const u=E3[t],m=t==="retired",d=!m||a.trim().toLowerCase()===r.trim().toLowerCase(),x=i||!d;return o.jsx(pC,{open:e,onOpenChange:v=>{!v&&!i&&s()},children:o.jsxs(Rg,{"data-testid":"launcher-launched-dialog","data-target":t,className:ee("gap-4",u.danger&&"border-destructive"),children:[o.jsxs(Ng,{children:[o.jsx(Tg,{className:ee(u.danger&&"text-destructive"),children:u.title}),o.jsx(Ag,{children:u.body})]}),m&&o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(Sr,{htmlFor:"launcher-launched-dialog-typed",className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:["Type"," ",o.jsx("span",{className:"text-foreground",children:r})," to confirm"]}),o.jsx(gt,{id:"launcher-launched-dialog-typed","data-testid":"launcher-launched-dialog-typed",type:"text",autoFocus:!0,value:a,onChange:v=>c(v.target.value),disabled:i,className:ee(d&&"border-[var(--vow-green)]")})]}),l&&o.jsx("span",{"data-testid":"launcher-launched-dialog-error",className:"font-mono text-[12px] text-destructive",children:l}),o.jsxs(Pg,{children:[o.jsx(Lg,{"data-testid":"launcher-launched-dialog-cancel",onClick:v=>{v.preventDefault(),s()},disabled:i,children:"Cancel"}),o.jsx(Dg,{"data-testid":"launcher-launched-dialog-confirm",onClick:v=>{if(x){v.preventDefault();return}v.preventDefault(),n()},disabled:x,className:ee(u.danger&&"border border-destructive bg-transparent text-destructive hover:bg-[var(--severity-blocking-bg)]"),children:i?`${u.confirmLabel}…`:u.confirmLabel})]})]})})}function R3({record:e,manifest:t,fetchLauncherStatus:r}){var _,y;const n=r??(()=>me.fetchLauncherStatus()),{data:s,isLoading:i,isError:l}=Te({queryKey:["launcher-status",e.solverNetId],queryFn:()=>n(),refetchInterval:3e4}),a=t?`${t.contract.id}.${t.contract.version}`:e.summary?`${e.summary.contractId}.${e.summary.contractVersion}`:void 0,c=a?s==null?void 0:s.nets.find(h=>{var p;return h.solverType===a||h.name===((t==null?void 0:t.name)??((p=e.summary)==null?void 0:p.name))}):void 0,u=c==null?void 0:c.budget.safeBalanceWei,m=(c==null?void 0:c.budget.safeAddress)??e.launcherSafeAddress,d=(t==null?void 0:t.solutionPriceWei)??((_=e.summary)==null?void 0:_.solutionPriceWei),x=(t==null?void 0:t.verdictPriceWei)??((y=e.summary)==null?void 0:y.verdictPriceWei),v=BM(u,d,x);return o.jsx(Lr,{delayDuration:150,children:o.jsxs(we,{"data-testid":"launcher-launched-spend-panel",role:"region","aria-label":"Spend and runway",className:"flex flex-col gap-3 p-6",children:[o.jsx("header",{className:"flex items-center justify-between gap-3",children:o.jsx("h2",{className:"m-0 font-serif text-[22px] font-normal text-foreground",children:"Spend & runway"})}),o.jsxs("dl",{className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(so,{label:"Safe address",value:x1(m),tooltip:m,testid:"launcher-launched-spend-safe-address"}),o.jsx(so,{label:"Safe balance",value:i?"—":u?Ls(u):"unavailable",tooltip:u?`${u} wei`:void 0,testid:"launcher-launched-spend-safe-balance"}),o.jsx(so,{label:"Solution price",value:d?Ls(d):"—",tooltip:d?`${d} wei`:void 0,testid:"launcher-launched-spend-solution-price"}),o.jsx(so,{label:"Verdict price",value:x?Ls(x):"—",tooltip:x?`${x} wei`:void 0,testid:"launcher-launched-spend-verdict-price"}),o.jsx(so,{label:"Per-Task cost",value:v?Ls(v.perTaskWei.toString()):"—",tooltip:v?`${v.perTaskWei.toString()} wei`:void 0,testid:"launcher-launched-spend-per-task"}),o.jsx(so,{label:"Projected runway",value:v?`${v.tasks.toLocaleString()} Tasks at current prices`:"manifest or balance unavailable",testid:"launcher-launched-spend-runway"})]}),l&&o.jsx("span",{"data-testid":"launcher-launched-spend-error",className:"font-mono text-[12px] text-destructive",children:"Failed to load Safe balance."}),o.jsx("p",{className:"m-0 font-mono text-[11px] leading-relaxed text-[var(--fg-dim)]",children:"Runway projects how many Tasks the Safe can fund at the current manifest prices, before any operator participation cost adjustments."})]})})}function so({label:e,value:t,testid:r,tooltip:n}){const s=o.jsx("dd",{"data-testid":r,className:"m-0 truncate font-mono text-[13px] text-foreground",tabIndex:n?0:void 0,children:t});return o.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[o.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),n?o.jsxs(un,{children:[o.jsx(dn,{asChild:!0,children:s}),o.jsx(Mr,{children:n})]}):s]})}const N3={paused:"Pause",launched:"Resume",retired:"Retire"},$y={launching:{variant:"default",label:"Launching"},launched:{variant:"success",label:"Launched"},paused:{variant:"pill",label:"Paused"},retired:{variant:"outline",label:"Retired"},failed:{variant:"destructive",label:"Failed"}};function P3({record:e,manifest:t,operatorCount:r,onAction:n,pending:s}){var c;const i=$y[e.status]??$y.launching,l=FM[e.status]??[],a=(t==null?void 0:t.name)??((c=e.summary)==null?void 0:c.name)??e.solverNetId;return o.jsx(Lr,{delayDuration:150,children:o.jsxs(we,{"data-testid":"launcher-launched-status-header","data-status":e.status,role:"region","aria-label":"SolverNet status header",className:"flex flex-col gap-4 p-6",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsx("h1",{"data-testid":"launcher-launched-name",className:"m-0 font-serif text-[32px] font-normal tracking-[-0.01em] text-foreground",children:a}),o.jsx(Se,{"data-testid":"launcher-launched-status-badge",variant:i.variant,className:"whitespace-nowrap",children:i.label})]}),(t==null?void 0:t.description)&&o.jsx("p",{className:"m-0 max-w-[720px] text-[13px] leading-relaxed text-[var(--fg-muted)]",children:t.description})]}),o.jsx(T3,{allowed:l,onAction:n,pending:s??null,terminal:e.status==="retired",launching:e.status==="launching"})]}),o.jsx(Qe,{}),o.jsxs("dl",{className:"m-0 grid gap-y-2 gap-x-4 [grid-template-columns:repeat(auto-fit,minmax(220px,1fr))]",children:[o.jsx(Ba,{label:"SolverNet id",value:e.solverNetId,testid:"launcher-launched-solvernet-id"}),o.jsx(Ba,{label:"Manifest cid",value:v1(e.manifestCid),testid:"launcher-launched-manifest-cid",additionalTestIds:["manifest-cid"],tooltip:e.manifestCid}),o.jsx(Ba,{label:"Launcher Safe",value:x1(e.launcherSafeAddress),testid:"launcher-launched-safe",tooltip:e.launcherSafeAddress}),o.jsx(Ba,{label:"Launcher agent",value:e.launcherAgentId,testid:"launcher-launched-agent"}),r!==void 0&&o.jsx(Ba,{label:"Operators",value:String(r),testid:"launcher-launched-operator-count",additionalTestIds:["operator-count"],tooltip:"Distinct operators that have ever claimed a task on this SolverNet, including on finalized or refunded tasks"})]})]})})}function Ba({label:e,value:t,testid:r,additionalTestIds:n,tooltip:s}){const i=o.jsxs("dd",{"data-testid":r,className:"m-0 truncate font-mono text-[13px] text-foreground",tabIndex:s?0:void 0,children:[t,n==null?void 0:n.map(l=>o.jsx("span",{"data-testid":l,className:"hidden","aria-hidden":"true",children:t},l))]});return o.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[o.jsx("dt",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-[var(--fg-dim)]",children:e}),s?o.jsxs(un,{children:[o.jsx(dn,{asChild:!0,children:i}),o.jsx(Mr,{children:s})]}):i]})}function T3({allowed:e,onAction:t,pending:r,terminal:n,launching:s}){return n?o.jsx(Se,{"data-testid":"launcher-launched-terminal-pill",variant:"outline",className:"self-start whitespace-nowrap",children:"Retired — no further actions"}):s?o.jsx(Se,{"data-testid":"launcher-launched-launching-pill",variant:"outline",className:"self-start whitespace-nowrap border-primary text-primary",children:"Launching…"}):e.length===0?null:o.jsx("div",{"data-testid":"launcher-launched-actions",className:"flex flex-wrap gap-2 self-start",children:e.map(i=>{const l=N3[i],a=r===i,c=i==="retired";return o.jsx(ie,{type:"button",variant:c?"destructive":"default","data-testid":`launcher-launched-action-${i}`,onClick:()=>t(i),disabled:r!==null,className:r!==null&&!a?"opacity-60":void 0,children:a?`${l}…`:l},i)})})}const Hy=5,A3={open:{variant:"default",label:"Open"},"claims-in-flight":{variant:"default",label:"In flight"},"fully-claimed":{variant:"success",label:"Claimed"},settled:{variant:"success",label:"Settled"},failed:{variant:"destructive",label:"Failed"}};function D3({record:e,fetchTasks:t}){var v;const[r,n]=C.useState([void 0]),s=r[r.length-1],i=t??(_=>me.fetchLauncherTasks(_)),{data:l,isLoading:a,isError:c,error:u,refetch:m}=Te({queryKey:["launcher-tasks",e.solverNetId,s??null],queryFn:()=>i({cursor:s,limit:Hy}),refetchInterval:15e3}),d=()=>{var _;(_=l==null?void 0:l.cursor)!=null&&_.before&&n(y=>[...y,l.cursor.before])},x=()=>{n(_=>_.length>1?_.slice(0,-1):_)};return o.jsx(Lr,{delayDuration:150,children:o.jsxs(we,{"data-testid":"launcher-launched-tasks-panel",role:"region","aria-label":"Recent posted Tasks",className:"flex flex-col gap-3 p-6",children:[o.jsxs("header",{className:"flex items-center justify-between gap-3",children:[o.jsx("h2",{className:"m-0 font-serif text-[22px] font-normal text-foreground",children:"Recent posted Tasks"}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-tasks-refresh",onClick:()=>{m()},children:"Refresh"})]}),a&&o.jsx("p",{"data-testid":"launcher-launched-tasks-loading",className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:"Loading…"}),c&&o.jsxs("div",{"data-testid":"launcher-launched-tasks-error",className:"font-mono text-[12px] text-destructive",children:["Failed to load tasks: ",u instanceof Error?u.message:"unknown error"]}),!a&&!c&&l&&l.tasks.length===0&&o.jsx(O3,{}),!a&&!c&&l&&l.tasks.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{"data-testid":"launcher-launched-tasks-list",className:"overflow-hidden rounded-md border border-border",children:o.jsxs(Wi,{className:"table-fixed",children:[o.jsx(Vi,{children:o.jsxs(Er,{className:"bg-[var(--bg)] hover:bg-[var(--bg)]",children:[o.jsx(We,{className:"w-[34%]",children:"Task"}),o.jsx(We,{className:"w-[16%]",children:"SolverType"}),o.jsx(We,{className:"w-[22%]",children:"Posted"}),o.jsx(We,{className:"w-[14%]",children:"State"}),o.jsx(We,{className:"w-[14%] text-right",children:"Claims"})]})}),o.jsx(qi,{children:l.tasks.map(_=>o.jsx(L3,{task:_},_.taskId))})]})}),o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-tasks-prev",onClick:x,disabled:r.length<=1,children:"← Newer"}),o.jsxs("span",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["Page ",r.length,l.tasks.length<Hy&&l.cursor===void 0?" · end":""]}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-tasks-next",onClick:d,disabled:!((v=l.cursor)!=null&&v.before),children:"Older →"})]})]})]})})}function L3({task:e}){var s;const t=A3[e.state]??{variant:"secondary",label:e.state},r=((s=e.summary)==null?void 0:s.title)??v1(e.taskCid),n=e.solverType??e.solverNet;return o.jsxs(Er,{"data-testid":"launcher-launched-task-row","data-task-id":e.taskId,children:[o.jsx(Ve,{className:"font-mono text-[13px] text-foreground",children:o.jsxs(un,{children:[o.jsx(dn,{asChild:!0,children:o.jsx("span",{className:"block truncate",tabIndex:0,children:r})}),o.jsx(Mr,{children:e.taskCid})]})}),o.jsx(Ve,{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:o.jsxs(un,{children:[o.jsx(dn,{asChild:!0,children:o.jsx("span",{className:"block truncate",tabIndex:0,children:n})}),o.jsx(Mr,{children:n})]})}),o.jsx(Ve,{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:Nd(e.postedAt)}),o.jsx(Ve,{children:o.jsx(Se,{variant:t.variant,className:"normal-case tracking-[0.1em]",children:t.label})}),o.jsxs(Ve,{className:"text-right font-mono text-[12px] text-[var(--fg-muted)]",children:[e.claims.current," / ",e.claims.max]})]})}function O3(){return o.jsx("div",{"data-testid":"launcher-launched-tasks-empty",className:"rounded-md border border-dashed border-border p-6 text-center font-mono text-[13px] text-[var(--fg-muted)]",children:"Tasks will appear here after the first generator poll posts a Task."})}const M3=2500,I3=3e4,Ic="mx-auto flex max-w-[960px] flex-col gap-4 p-6";function F3({pollIntervalMs:e=M3,navigateTo:t,solverNetId:r}={}){var k,j,S,E;const n=md(),[,s]=Hr(),i=t??s,l=ii(),a=r??n.solverNetId,c=Te({queryKey:["solvernets","launched",a],queryFn:()=>me.solvernets.get(a),refetchInterval:e,enabled:!!a}),u=(k=c.data)==null?void 0:k.manifestCid,m=Te({queryKey:["solvernets","manifest",u],queryFn:()=>me.solvernets.getManifest(u),enabled:!!u,staleTime:1/0}),d=Te({queryKey:["solvernets","operator-count",u],queryFn:async()=>(await me.discovery.getSolverNetOperatorCount(u)).operatorCount,enabled:!!u,refetchInterval:I3}),[x,v]=C.useState(null),[_,y]=C.useState(null),h=Qn({mutationFn:({target:N})=>me.solvernets.transitionLifecycle(a,N),onSuccess:async N=>{await l.cancelQueries({queryKey:["solvernets","launched",a]}),l.setQueryData(["solvernets","launched",a],N),v(null),y(null)},onError:N=>{y(N instanceof Error?N.message:String(N))}}),p=Qn({mutationFn:N=>me.solvernets.updateGeneratorConfig(a,N),onSuccess:()=>{l.invalidateQueries({queryKey:["solvernets","launched",a]})}});if(!a)return o.jsx("main",{"data-testid":"launcher-launched-missing-id",className:Ic,children:o.jsx(Uy,{message:"No solverNetId supplied.",onBack:()=>i("/launcher")})});if(c.isLoading)return o.jsx("main",{"data-testid":"launcher-launched-loading",className:Ic,children:o.jsx("p",{className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading…"})});if(c.isError||!c.data){const N=c.error instanceof Error?c.error.message:"Unknown error";return o.jsx("main",{"data-testid":"launcher-launched-error",className:Ic,children:o.jsx(Uy,{message:`Failed to load SolverNet: ${N}`,onBack:()=>i("/launcher"),onRetry:()=>{c.refetch()}})})}const f=c.data,g=(j=m.data)==null?void 0:j.manifest,b=$3(f,g),w=(g==null?void 0:g.name)??((S=f.summary)==null?void 0:S.name)??f.solverNetId;return o.jsxs("main",{"data-testid":"launcher-launched","data-solvernet-id":a,className:Ic,children:[o.jsx(P3,{record:f,manifest:g,operatorCount:d.data,onAction:N=>{y(null),v(N)},pending:h.isPending?((E=h.variables)==null?void 0:E.target)??null:null}),o.jsx(KM,{record:f,manifest:g,template:b,onSave:async N=>{await p.mutateAsync(N)}}),o.jsx(R3,{record:f,manifest:g}),o.jsx(D3,{record:f}),m.isError&&o.jsxs("p",{"data-testid":"launcher-launched-manifest-error",className:"m-0 font-mono text-[12px] text-destructive",children:["Failed to load manifest:"," ",B3(m.error)]}),o.jsx(j3,{open:x!==null,target:x??"paused",solverNetName:w,pending:h.isPending,errorMessage:_??void 0,onCancel:()=>{h.isPending||(v(null),y(null))},onConfirm:()=>{x&&h.mutate({target:x})}})]})}function B3(e){const t=e instanceof Error?e.message:String(e??"unknown error");return/404|manifest_not_found|registry_unavailable/i.test(t)?`Manifest unavailable from local cache or registry (${t})`:t}function $3(e,t){const r=(t==null?void 0:t.contract)??(e.summary?{id:e.summary.contractId,version:e.summary.contractVersion}:void 0);if(r)return gp[`${r.id}.${r.version}`]}function Uy({message:e,onBack:t,onRetry:r}){return o.jsxs(Ye,{variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsx(Xe,{className:"font-mono text-[13px] text-destructive",children:e}),o.jsxs("div",{className:"flex gap-2",children:[r&&o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-error-retry",onClick:r,children:"Retry"}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"launcher-launched-error-back",onClick:t,children:"Back to launcher"})]})]})}const zy="curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash",Dh="m-0 overflow-x-auto whitespace-pre-wrap break-all rounded-sm border border-border bg-[var(--bg-sunken)] p-2.5 font-mono text-[12px] text-foreground";function H3({onSuccess:e,onCancel:t}){const[r,n]=C.useState("checking"),[s,i]=C.useState(""),[l,a]=C.useState(""),c=()=>{n("checking"),me.hermesDoctor().then(m=>{if(!m.installed){n("not-installed");return}if(m.exitCode!==0){n("config-issue"),i(m.stderr);return}n("ok"),e()}).catch(m=>{a(m instanceof Error?m.message:String(m)),n("network-error")})},u=()=>{typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(zy).catch(()=>{})};return C.useEffect(()=>{c()},[]),r==="checking"?o.jsxs(we,{"data-testid":"hermes-precheck-checking",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes install check"}),o.jsx("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:"Checking hermes install…"})]}):r==="not-installed"?o.jsxs(we,{"data-testid":"hermes-precheck-not-installed",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes Agent not installed"}),o.jsx("p",{className:"m-0 font-mono text-[13px] text-foreground",children:"Hermes Agent is not installed on this machine. Run this command in your terminal, then click Retry:"}),o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx("pre",{className:`${Dh} flex-1`,children:zy}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"hermes-precheck-copy-install","aria-label":"Copy install command",onClick:u,children:"Copy"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ie,{type:"button",variant:"outline","data-testid":"hermes-precheck-retry",onClick:c,children:"I've installed Hermes — retry precheck"}),o.jsx(ie,{type:"button",variant:"secondary","data-testid":"hermes-precheck-cancel",onClick:t,children:"Cancel"})]})]}):r==="network-error"?o.jsxs(Ye,{"data-testid":"hermes-precheck-network-error",variant:"blocking",className:"flex flex-col gap-3 border-l-0 border border-destructive p-4",children:[o.jsx(Nt,{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes precheck failed"}),o.jsxs(Xe,{className:"font-mono text-[13px] text-foreground",children:["Could not reach the daemon API to run ",o.jsx("code",{children:"hermes doctor"}),". Check that the daemon is running and the UI token is valid."]}),l?o.jsx("pre",{className:Dh,children:l}):null,o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ie,{type:"button",variant:"outline","data-testid":"hermes-precheck-retry",onClick:c,children:"Retry precheck"}),o.jsx(ie,{type:"button",variant:"secondary","data-testid":"hermes-precheck-cancel",onClick:t,children:"Cancel"})]})]}):r==="config-issue"?o.jsxs(Ye,{"data-testid":"hermes-precheck-config-issue",variant:"warning",className:"flex flex-col gap-3 border-l-0 border border-[var(--severity-warning-fg)] p-4",children:[o.jsx(Nt,{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:"Hermes Agent configuration issue"}),o.jsx(Xe,{className:"font-mono text-[13px] text-foreground",children:"Hermes is installed but reports configuration issues:"}),o.jsx("pre",{className:Dh,children:s||"(no diagnostic output)"}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["Run ",o.jsx("code",{children:"hermes model"})," or ",o.jsx("code",{children:"hermes setup"})," to configure a provider, then retry."]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ie,{type:"button",variant:"outline","data-testid":"hermes-precheck-retry",onClick:c,children:"Retry precheck"}),o.jsx(ie,{type:"button",variant:"secondary","data-testid":"hermes-precheck-cancel",onClick:t,children:"Cancel"})]})]}):o.jsx(o.Fragment,{})}const gC=[{label:"Haiku",id:"claude-haiku-4-5-20251001"},{label:"Sonnet",id:"claude-sonnet-4-6"},{label:"Opus",id:"claude-opus-4-7"}],vC=[{label:"GPT-5.4 Mini",id:"gpt-5.4-mini"},{label:"GPT-5.5",id:"gpt-5.5"},{label:"GPT-5.4",id:"gpt-5.4"},{label:"GPT-5.3 Codex",id:"gpt-5.3-codex"},{label:"GPT-5.3 Codex Spark",id:"gpt-5.3-codex-spark"}],xC=[{label:"Claude Opus 4.7 (OpenRouter)",id:"anthropic/claude-opus-4.7"},{label:"Claude Sonnet 4.6 (OpenRouter)",id:"anthropic/claude-sonnet-4.6"},{label:"Hy3 Preview",id:"tencent/hy3-preview"},{label:"DeepSeek V4 Pro",id:"deepseek/deepseek-v4-pro"},{label:"DeepSeek V4 Flash",id:"deepseek/deepseek-v4-flash"},{label:"Gemini 3.1 Flash Lite",id:"google/gemini-3.1-flash-lite"},{label:"Kimi K2.6",id:"moonshotai/kimi-k2.6"},{label:"Owl Alpha",id:"openrouter/owl-alpha"},{label:"MiniMax M2.7",id:"minimax/minimax-m2.7"}];function U3(e){return kr(e)===Rd}function z3(e){return kr(e)===ca}function Ld(e){return z3(e)?xC:U3(e)?vC:gC}function Fo(e){return Ld(e)[0].id}function Og(e,t){const n=Ld(t).find(s=>s.id===e)??null??gC.find(s=>s.id===e)??vC.find(s=>s.id===e)??xC.find(s=>s.id===e)??null;return n?{canonical:n,label:n.label,isCustom:!1}:{canonical:null,label:`Custom (${e})`,isCustom:!0}}function W3(e){const t=V3(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(K3);if(c){const u=c.props.children,m=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,m):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function V3(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=Q3(s),a=G3(i,s.props);return s.type!==C.Fragment&&(a.ref=n?os(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var q3=Symbol("radix.slottable");function K3(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===q3}function G3(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function Q3(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Od="Popover",[yC]=gn(Od,[wa]),ec=wa(),[Y3,oi]=yC(Od),_C=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:s,onOpenChange:i,modal:l=!1}=e,a=ec(t),c=C.useRef(null),[u,m]=C.useState(!1),[d,x]=Sa({prop:n,defaultProp:s??!1,onChange:i,caller:Od});return o.jsx(ug,{...a,children:o.jsx(Y3,{scope:t,contentId:Vs(),triggerRef:c,open:d,onOpenChange:x,onOpenToggle:C.useCallback(()=>x(v=>!v),[x]),hasCustomAnchor:u,onCustomAnchorAdd:C.useCallback(()=>m(!0),[]),onCustomAnchorRemove:C.useCallback(()=>m(!1),[]),modal:l,children:r})})};_C.displayName=Od;var bC="PopoverAnchor",Z3=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=oi(bC,r),i=ec(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:a}=s;return C.useEffect(()=>(l(),()=>a()),[l,a]),o.jsx(Cd,{...i,...n,ref:t})});Z3.displayName=bC;var wC="PopoverTrigger",SC=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=oi(wC,r),i=ec(r),l=Be(t,s.triggerRef),a=o.jsx($e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":RC(s.open),...n,ref:l,onClick:ye(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?a:o.jsx(Cd,{asChild:!0,...i,children:a})});SC.displayName=wC;var Mg="PopoverPortal",[X3,J3]=yC(Mg,{forceMount:void 0}),CC=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,i=oi(Mg,t);return o.jsx(X3,{scope:t,forceMount:r,children:o.jsx(Wt,{present:r||i.open,children:o.jsx(Xl,{asChild:!0,container:s,children:n})})})};CC.displayName=Mg;var ua="PopoverContent",kC=C.forwardRef((e,t)=>{const r=J3(ua,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,i=oi(ua,e.__scopePopover);return o.jsx(Wt,{present:n||i.open,children:i.modal?o.jsx(t5,{...s,ref:t}):o.jsx(r5,{...s,ref:t})})});kC.displayName=ua;var e5=W3("PopoverContent.RemoveScroll"),t5=C.forwardRef((e,t)=>{const r=oi(ua,e.__scopePopover),n=C.useRef(null),s=Be(t,n),i=C.useRef(!1);return C.useEffect(()=>{const l=n.current;if(l)return yg(l)},[]),o.jsx(Ad,{as:e5,allowPinchZoom:!0,children:o.jsx(EC,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(e.onCloseAutoFocus,l=>{var a;l.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ye(e.onPointerDownOutside,l=>{const a=l.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,u=a.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:ye(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),r5=C.forwardRef((e,t)=>{const r=oi(ua,e.__scopePopover),n=C.useRef(!1),s=C.useRef(!1);return o.jsx(EC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,a;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),EC=C.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:m,...d}=e,x=oi(ua,r),v=ec(r);return xg(),o.jsx(Pd,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:i,children:o.jsx(Yl,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:m,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>x.onOpenChange(!1),children:o.jsx(dg,{"data-state":RC(x.open),role:"dialog",id:x.contentId,...v,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),jC="PopoverClose",n5=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=oi(jC,r);return o.jsx($e.button,{type:"button",...n,ref:t,onClick:ye(e.onClick,()=>s.onOpenChange(!1))})});n5.displayName=jC;var s5="PopoverArrow",i5=C.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=ec(r);return o.jsx(hg,{...s,...n,ref:t})});i5.displayName=s5;function RC(e){return e?"open":"closed"}var o5=_C,a5=SC,l5=CC,NC=kC;const PC=o5,TC=a5,Ig=C.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},s)=>o.jsx(l5,{children:o.jsx(NC,{ref:s,align:t,sideOffset:r,className:ee("z-50 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...n})}));Ig.displayName=NC.displayName;const Wy=[{name:"network-tools",version:"0.1.0",source:"bundled",defaultIncluded:!0,description:"Jinn runtime tools"},{name:"claude-code-learner",version:"0.1.0",source:"bundled",defaultIncluded:!0,description:"Learner loop"}];function c5(e){return kr(e)===ca?Wy.filter(t=>t.name!=="claude-code-learner"):Wy}const u5=new Set(["swe-rebench-v2-runtime"]),d5={"network-tools":"Network Tools","claude-code-learner":"Learner","swe-rebench-v2-runtime":"SWE-rebench v2 Runtime","jinn-prediction-plugin":"Prediction Runtime"},$u="bundled:";function $a(e){return d5[e]??e}function ko(e){return e.startsWith($u)?e.slice($u.length):e}function h5(e){return e.source==="bundled"?`${$u}${e.name}`:e.name}function Vy(e){const t=new Set,r=[];for(const n of e){const s=ko(n);t.has(s)||(t.add(s),r.push(n))}return r}function f5(e,t,r){const n=new Set,s=[];for(const i of c5(r))n.add(i.name),s.push(i);for(const i of e){if(n.has(i.name))continue;n.add(i.name);const l=u5.has(i.name);s.push({...i,...l?{defaultIncluded:!0}:{recommended:!0},description:i.name==="swe-rebench-v2-runtime"?"SWE-rebench v2 runtime":"Recommended for this SolverNet"})}for(const i of t){const l=ko(i);n.has(l)||(n.add(l),s.push({name:l,version:"configured",source:i.startsWith($u)?"bundled":"custom",description:"Already configured"}))}return s}function p5(e){const t=[e.source,e.version];return e.description&&t.push(e.description),t.join(" · ")}function yp({available:e,selected:t,disabledDefaultPlugins:r=[],onChange:n,rowTestId:s,searchTestId:i,harness:l}){const[a,c]=C.useState(""),[u,m]=C.useState(!1),[d,x]=C.useState(null),v=C.useMemo(()=>f5(e,t,l),[e,t,l]),_=new Set(t.map(ko)),y=new Set(r.map(ko)),h=new Set(_);for(const N of v)N.defaultIncluded&&!y.has(N.name)&&h.add(N.name);const p=v.filter(N=>h.has(N.name)),f=p.filter(N=>N.defaultIncluded).length,g=p.length-f,b=v.filter(N=>!h.has(N.name)),w=a.trim().toLowerCase(),k=w?b.filter(N=>`${N.name} ${$a(N.name)} ${N.source} ${N.description??""}`.toLowerCase().includes(w)):b,j=N=>{const O=N.defaultIncluded?r.filter(L=>ko(L)!==N.name):r,T=N.defaultIncluded?t:Vy([...t,h5(N)]);n(T,O),m(!1),c("")},S=N=>{if(N.defaultIncluded){x(N),m(!1),c("");return}n(t.filter(O=>ko(O)!==N.name),r)},E=()=>{d&&(n(t,Vy([...r,d.name])),x(null))};return o.jsxs("div",{className:"relative flex flex-col gap-2",children:[o.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(N=>o.jsxs("span",{"data-testid":`${s}-chip`,"data-plugin":N.name,className:ee("inline-flex items-center gap-1.5 rounded-full border border-border px-2 py-[5px] pl-2.5 font-mono text-[11px] text-foreground",N.defaultIncluded?"bg-sunken":"bg-transparent"),children:[o.jsxs("span",{children:[$a(N.name),o.jsx("span",{className:"text-dim",children:N.defaultIncluded?" · default":" · selected"})]}),o.jsx(ie,{type:"button",variant:"ghost",size:"icon","aria-label":`Remove ${$a(N.name)}`,"data-testid":`${s}-remove`,"data-plugin":N.name,onClick:()=>S(N),className:"h-5 w-5 rounded-full p-0 text-muted-foreground hover:bg-transparent hover:text-foreground",children:o.jsx(Pl,{"aria-hidden":"true",className:"!size-3"})})]},N.name))}),d&&o.jsxs("div",{role:"alertdialog","data-testid":`${s}-default-warning`,className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-md border border-wane bg-card px-3 py-2.5 font-mono",children:[o.jsxs("span",{className:"text-[12px] text-foreground",children:[$a(d.name)," is part of the default operator baseline. Removing it may break standard SolverNet workflows."]}),o.jsxs("span",{className:"flex gap-2",children:[o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":`${s}-default-warning-cancel`,onClick:()=>x(null),children:"Keep"}),o.jsx(ie,{type:"button",variant:"destructive",size:"sm","data-testid":`${s}-default-warning-confirm`,onClick:E,children:"Remove"})]})]}),o.jsxs(PC,{open:u,onOpenChange:N=>{m(N),N||c("")},children:[o.jsx(TC,{asChild:!0,children:o.jsxs(ie,{type:"button",variant:"outline","data-testid":`${s}-trigger`,"aria-haspopup":"listbox",className:"grid h-auto grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-border bg-background px-3 py-2.5 text-left font-mono text-[12px] normal-case tracking-normal text-foreground hover:bg-sunken hover:text-foreground",children:[o.jsxs("span",{className:"min-w-0",children:["Add plugin",o.jsxs("span",{className:"text-dim",children:[" ","· ",f," default",g>0?` · ${g} selected`:""]})]}),u?o.jsx(zm,{"aria-hidden":"true",className:"!size-3.5 text-muted-foreground"}):o.jsx(gd,{"aria-hidden":"true",className:"!size-3.5 text-muted-foreground"})]})}),o.jsxs(Ig,{align:"start",sideOffset:6,className:"w-[min(28rem,90vw)] overflow-hidden p-0",children:[o.jsx(gt,{type:"search",autoFocus:!0,"aria-label":"Search plugins","data-testid":i,value:a,onChange:N=>c(N.target.value),onKeyDown:N=>{N.key==="Escape"&&(m(!1),c(""))},placeholder:"Search plugins",className:"h-auto rounded-none border-0 border-b border-border bg-background px-3 py-2.5 text-[12px] focus-visible:ring-0"}),o.jsx(Ql,{className:"max-h-60",children:o.jsx("div",{role:"listbox","aria-label":"Plugins",className:"flex flex-col",children:k.length===0?o.jsx("span",{className:"px-3.5 py-3 font-mono text-[12px] text-dim",children:b.length===0?"No plugins available to add.":"No matching plugins."}):k.map((N,O)=>{const T=h.has(N.name),L=N.defaultIncluded?"text-dim":N.recommended?"text-primary":"text-muted-foreground";return o.jsxs(ie,{type:"button",variant:"ghost",role:"option","aria-selected":T,"data-testid":s,"data-plugin":N.name,"data-plugin-active":T?"true":"false","data-plugin-default":N.defaultIncluded?"true":"false",onClick:()=>j(N),className:ee("grid h-auto w-full grid-cols-[minmax(0,1fr)_auto] gap-3 rounded-none px-3 py-2.5 text-left font-mono normal-case tracking-normal transition-colors",O===0?"":"border-t border-border",T?"bg-sunken text-foreground":"bg-transparent text-foreground","hover:bg-sunken focus-visible:bg-sunken"),children:[o.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[o.jsx("span",{className:"text-[13px] text-foreground",children:$a(N.name)}),o.jsx("span",{className:"text-[11px] text-dim",children:p5(N)})]}),o.jsx("span",{className:ee("self-center text-[11px] uppercase",L),children:N.defaultIncluded?"Default":N.recommended?"Recommended":"Add"})]},N.name)})})})]})]})]})}const m5={"claude-opus-4-7":{provider:"anthropic",inputPer1kTokens:.015,outputPer1kTokens:.075,typicalInputTokens:5e4,typicalOutputTokens:2e4},"claude-sonnet-4-6":{provider:"anthropic",inputPer1kTokens:.003,outputPer1kTokens:.015,typicalInputTokens:5e4,typicalOutputTokens:2e4},"claude-haiku-4-5-20251001":{provider:"anthropic",inputPer1kTokens:.001,outputPer1kTokens:.005,typicalInputTokens:5e4,typicalOutputTokens:2e4},"anthropic/claude-opus-4.7":{provider:"openrouter",inputPer1kTokens:.015,outputPer1kTokens:.075,typicalInputTokens:5e4,typicalOutputTokens:2e4},"anthropic/claude-sonnet-4.6":{provider:"openrouter",inputPer1kTokens:.003,outputPer1kTokens:.015,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.4":{provider:"openai",inputPer1kTokens:.00125,outputPer1kTokens:.01,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.4-mini":{provider:"openai",inputPer1kTokens:25e-5,outputPer1kTokens:.002,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.5":{provider:"openai",inputPer1kTokens:.015,outputPer1kTokens:.06,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.3-codex":{provider:"openai",inputPer1kTokens:.00125,outputPer1kTokens:.01,typicalInputTokens:5e4,typicalOutputTokens:2e4},"gpt-5.3-codex-spark":{provider:"openai",inputPer1kTokens:.00125,outputPer1kTokens:.01,typicalInputTokens:5e4,typicalOutputTokens:2e4},"tencent/hy3-preview":{provider:"openrouter",inputPer1kTokens:.003,outputPer1kTokens:.015,typicalInputTokens:5e4,typicalOutputTokens:2e4},"deepseek/deepseek-v4-pro":{provider:"openrouter",inputPer1kTokens:.0014,outputPer1kTokens:.0028,typicalInputTokens:5e4,typicalOutputTokens:2e4},"deepseek/deepseek-v4-flash":{provider:"openrouter",inputPer1kTokens:1e-4,outputPer1kTokens:4e-4,typicalInputTokens:5e4,typicalOutputTokens:2e4},"google/gemini-3.1-flash-lite":{provider:"openrouter",inputPer1kTokens:1e-4,outputPer1kTokens:4e-4,typicalInputTokens:5e4,typicalOutputTokens:2e4},"moonshotai/kimi-k2.6":{provider:"openrouter",inputPer1kTokens:6e-4,outputPer1kTokens:.0025,typicalInputTokens:5e4,typicalOutputTokens:2e4},"openrouter/owl-alpha":{provider:"openrouter",inputPer1kTokens:.002,outputPer1kTokens:.008,typicalInputTokens:5e4,typicalOutputTokens:2e4},"minimax/minimax-m2.7":{provider:"openrouter",inputPer1kTokens:8e-4,outputPer1kTokens:.0032,typicalInputTokens:5e4,typicalOutputTokens:2e4},"nousresearch/hermes-4-405b":{provider:"nous",inputPer1kTokens:9e-4,outputPer1kTokens:9e-4,typicalInputTokens:5e4,typicalOutputTokens:2e4}},AC=1;function DC(e){const t=m5[e];if(!t)return null;const r=t.typicalInputTokens/1e3*t.inputPer1kTokens,n=t.typicalOutputTokens/1e3*t.outputPer1kTokens;return{usd:r+n,inputUsd:r,outputUsd:n,typicalInputTokens:t.typicalInputTokens,typicalOutputTokens:t.typicalOutputTokens,entry:t}}function Fg(e,t,r=AC){if(!e)return{showEstimate:!1,estimate:null,requiresConfirmation:!1,suppressedReason:"Included in subscription, no per-task API cost."};const n=t?DC(t):null;return(n==null?void 0:n.entry.subscriptionPath)===!0?{showEstimate:!1,estimate:null,requiresConfirmation:!1,suppressedReason:"Included in subscription, no per-task API cost."}:{showEstimate:!0,estimate:n,requiresConfirmation:n!==null&&n.usd>r,suppressedReason:null}}function g5(e){return Number.isFinite(e)?e===0?"$0":e<.01?"<$0.01":e<1?`$${e.toFixed(2)}`:e<10?`$${e.toFixed(2)}`:`$${e.toFixed(2)}`:"—"}function LC({modelId:e,usesPaidApiKey:t,thresholdUsd:r=AC,variant:n="card",testIdPrefix:s="cost-estimate"}){const i=Fg(t,e,r);if(!i.showEstimate)return o.jsxs("div",{"data-testid":`${s}-subscription`,"data-cost-mode":"subscription",className:ee("flex items-center gap-2.5 font-mono",n==="card"?"rounded-md border border-border bg-card px-3.5 py-2.5":"py-1.5"),children:[o.jsx(Bw,{"aria-hidden":"true",className:"size-3 shrink-0 text-primary"}),o.jsx("span",{className:"text-[12px] text-muted-foreground",children:i.suppressedReason??"Included in subscription, no per-task API cost."})]});const l=i.estimate,a=(l==null?void 0:l.usd)??null,c=i.requiresConfirmation;return o.jsxs("div",{"data-testid":`${s}-panel`,"data-cost-mode":"paid-api","data-cost-usd":a!==null?a.toFixed(4):"unknown","data-cost-high-cost":c?"true":"false",className:ee("flex flex-col gap-2 rounded-md border bg-card",c?"border-destructive":"border-border",n==="card"?"px-4 py-3.5":"gap-1 px-2.5 py-2"),children:[o.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Estimated cost per task"}),o.jsx("span",{"data-testid":`${s}-amount`,className:ee("font-mono font-medium",n==="card"?"text-[18px]":"text-[14px]",c?"text-destructive":"text-foreground"),children:a!==null?`~${g5(a)}`:"unavailable"})]}),l&&o.jsx("span",{"data-testid":`${s}-heuristic`,className:"font-mono text-[11px] text-muted-foreground",children:"Rough estimate — actual cost varies."}),a===null&&o.jsx("span",{"data-testid":`${s}-unknown`,className:"font-mono text-[11px] text-muted-foreground",children:"No pricing entry for this model id — confirm rates with your provider before joining."}),c&&o.jsxs("span",{"data-testid":`${s}-warning`,className:"font-mono text-[11px] text-destructive",children:["This model is above $",r.toFixed(2),"/task. You will be asked to confirm before joining."]})]})}const OC="claude-code",MC="codex",v5="hermes-agent",x5={"claude-code-learner":OC,"codex-code-learner":MC};function IC(e){return x5[e]??e}const FC=.5,Lh={units_per_block:100,units_per_week:100*28};function y5(e,t,r){if(!e)return null;const n=IC(e);if(!(n===OC||n===MC||n===v5))return 0;if(!t)return null;const i=DC(t);return i?i.usd/FC*100:null}function qy(e){return e<1?e.toFixed(2):e<10?e.toFixed(1):Math.round(e).toString()}function BC({harness:e,modelId:t,variant:r="card",testIdPrefix:n="harness-footprint"}){const s=y5(e,t);if(s===0)return null;if(s===null)return o.jsxs("div",{"data-testid":`${n}-unknown`,className:ee("flex flex-col gap-1 rounded-md border border-border bg-card",r==="card"?"px-4 py-3":"gap-1 px-2.5 py-2"),children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"AI-units footprint"}),o.jsx("span",{className:"font-mono text-[12px] text-muted-foreground",children:"No pricing entry for this model id — footprint unavailable."})]});const i=s/100*FC,l=Lh.units_per_block/s,a=i*l*4,c=s*l*4*7;return o.jsxs("div",{"data-testid":`${n}-panel`,className:ee("flex flex-col gap-2 rounded-md border border-border bg-card",r==="card"?"px-4 py-3.5":"gap-1 px-2.5 py-2"),children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Bw,{"aria-hidden":"true",className:"size-3 shrink-0 text-primary"}),o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"AI-units footprint"})]}),o.jsxs("div",{className:"flex flex-col gap-1.5 font-mono text-[12px] text-foreground",children:[o.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[o.jsx("span",{className:"text-muted-foreground",children:"Per 6h block, at cap"}),o.jsxs("span",{"data-testid":`${n}-block`,className:"font-medium",children:[qy(s)," / ",Lh.units_per_block," units / task"]})]}),o.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[o.jsx("span",{className:"text-muted-foreground",children:"Per week, at cap"}),o.jsxs("span",{"data-testid":`${n}-week`,className:"font-medium",children:[qy(c)," / ",Lh.units_per_week," units"]})]}),o.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[o.jsx("span",{className:"text-muted-foreground",children:"~ Daily cost at cap"}),o.jsxs("span",{"data-testid":`${n}-daily-usd`,className:"font-medium",children:["~$",a<1?a.toFixed(2):a.toFixed(1),"/day"]})]})]}),o.jsx("span",{className:"font-mono text-[11px] text-muted-foreground",children:"Node pauses claims for this credential when the 6h or 7d cap is reached, then auto-resumes."})]})}function $C(e){const{data:t,isPending:r}=Te({queryKey:["status"],queryFn:()=>me.getStatus()});if(!e)return!1;if(r||!(t!=null&&t.costSurface))return!0;const n=t.costSurface.harnesses[IC(e)];return(n==null?void 0:n.usesPaidApiKey)??!0}function io({label:e,children:t,docHref:r,docLabel:n="Read more"}){const[s,i]=C.useState(!1);return o.jsxs(PC,{open:s,onOpenChange:i,children:[o.jsx(TC,{type:"button","data-testid":"inline-help-trigger","aria-label":e,className:"inline-flex h-4 w-4 cursor-pointer items-center justify-center rounded-md border border-muted-foreground bg-card p-0 text-muted-foreground transition-colors hover:border-foreground hover:text-foreground",children:o.jsx(h2,{className:"h-2.5 w-2.5","aria-hidden":"true"})}),o.jsxs(Ig,{"data-testid":"inline-help-panel",role:"note",align:"start",className:"max-w-[420px] whitespace-pre-line font-mono text-[11px] font-normal leading-relaxed normal-case tracking-normal text-muted-foreground",children:[t,r&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{"data-testid":"inline-help-doc-link",href:r,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:n})]})]})]})}const _5="Self-improving agent by Nous Research. Built-in learning loop.",oo="https://github.com/Jinn-Network/mono/blob/next/client/docs/operator/join-form-context.md",b5=vg,Ha="mx-auto flex max-w-[880px] flex-col gap-4 p-6",co="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-muted)]",Oh=co,ao="flex items-start gap-2",Ky="rounded-md border border-input bg-transparent px-3 py-2 font-mono text-[14px] text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";function w5(e,t){return e==null?void 0:e.nets.find(r=>r.contract.id===t.id&&r.contract.version===t.version)}function S5(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function C5(e){const t=e==null?void 0:e.contract.evaluationFunction.implementation;if(t){if(t.includes("swe-rebench-v2-evaluator"))return"swe-rebench-v2-evaluator";if(t.includes("prediction-v1-evaluator"))return"prediction-v1-evaluator"}}function k5(e){const t=[...new Set(e)].sort();return{readiness:Te({queryKey:["harness-readiness",t.join(",")],enabled:t.length>0,refetchInterval:5e3,queryFn:async()=>{const n=await Promise.all(t.map(async s=>{try{return[s,await me.harnessReadiness(s)]}catch(i){if(i.code==="harness_not_found")return[s,void 0];throw i}}));return new Map(n)}}).data??new Map}}function E5({manifestCid:e,navigateTo:t}={}){var G,Y,ce;const r=md(),[,n]=Hr(),s=t??n,i=ii(),l=e??r.cid,a=Te({queryKey:["solvernets","manifest",l],queryFn:()=>me.solvernets.getManifest(l),enabled:!!l,retry:!1}),c=Te({queryKey:["solvernets","catalog"],queryFn:()=>me.getSolverNets()}),u=(G=a.data)==null?void 0:G.manifest,m=u?w5(c.data,u.contract):void 0,d=((m==null?void 0:m.compatibleHarnesses)??[]).filter(Q=>Q.supportsRoles.includes("solving")).map(Q=>({...Q,name:kr(Q.name)})).filter((Q,ge,De)=>De.findIndex(Ue=>Ue.name===Q.name)===ge),x=((Y=d[0])==null?void 0:Y.name)??b5,v=Fo(x),[_,y]=C.useState({roles:[],harness:x,plugins:[],disabledDefaultPlugins:[],model:v}),[h,p]=C.useState(null),[f,g]=C.useState(null),[b,w]=C.useState(!1),k=C.useRef(!1),[j,S]=C.useState(!1),E=(ce=d[0])==null?void 0:ce.name;C.useEffect(()=>{k.current||E&&E!==_.harness&&y(Q=>({...Q,harness:E,model:Fo(E)}))},[E]);const N=Ld(_.harness),O=C5(u),T=[...d.map(Q=>Q.name),..._.roles.includes("evaluator")&&O?[O]:[]],{readiness:L}=k5(T),$=L.get(_.harness),U=O?L.get(O):void 0,z=_.roles.includes("solver"),K=$C(z?_.harness:void 0),R=Fg(K,z?_.model:void 0),P=z&&R.requiresConfirmation,D=P&&!j,M=Qn({mutationFn:()=>me.operator.join(l,{...(u==null?void 0:u.name)!==void 0?{name:u.name}:{},...(u==null?void 0:u.contract)!==void 0?{contract:{id:u.contract.id,version:u.contract.version}}:{},roles:_.roles,..._.roles.includes("solver")?{harness:_.harness,plugins:_.plugins,disabledDefaultPlugins:_.disabledDefaultPlugins,model:_.model}:{}}),onSuccess:Q=>{i.invalidateQueries({queryKey:["operator","joined"]}),i.invalidateQueries({queryKey:["bootstrap"]}),g({manifestCid:Q.manifestCid,name:Q.config.name??(u==null?void 0:u.name)??Q.manifestCid,roles:Q.config.roles,restartRequired:Q.restartRequired})},onError:Q=>{p(Q instanceof Error?Q.message:String(Q))}});if(!l)return o.jsx("main",{"data-testid":"join-flow-missing-cid",className:Ha,children:o.jsx(Gy,{message:"No manifest cid supplied.",onBack:()=>s("/operator#solvernets")})});if(a.isLoading)return o.jsx("main",{"data-testid":"join-flow-loading",className:Ha,children:o.jsx("p",{className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading manifest…"})});if(a.isError||!u){const Q=a.error instanceof Error?a.error.message:"Unknown error";return o.jsx("main",{"data-testid":"join-flow-error",className:Ha,children:o.jsx(Gy,{message:`Failed to load manifest: ${Q}`,onBack:()=>s("/operator#solvernets"),onRetry:()=>{a.refetch()}})})}if(f)return o.jsx("main",{"data-testid":"join-flow-success",className:Ha,children:o.jsx(j5,{success:f,navigate:s})});const{openRoles:V}=u,W=Q=>{V.includes(Q)&&y(ge=>{const Ue=ge.roles.includes(Q)?ge.roles.filter(Ct=>Ct!==Q):V.filter(Ct=>Ct===Q||ge.roles.includes(Ct));return{...ge,roles:Ue}})},J=_.roles.includes("evaluator"),X=z&&($==null?void 0:$.ready)===!1,fe=J&&(U==null?void 0:U.ready)===!1,A=_.roles.length>0&&!M.isPending&&!D&&!X&&!fe,B=fe&&O?o.jsxs("div",{"data-testid":"join-evaluator-not-ready","data-harness":O,role:"status",className:"flex flex-col gap-1 rounded-md border border-destructive bg-[var(--bg)] p-2.5 font-mono text-[11px] text-foreground",children:[o.jsxs("span",{className:"text-destructive",children:[Ks(O)," is not ready",U!=null&&U.reason?`: ${U.reason}`:""]}),(U==null?void 0:U.nextStep)&&o.jsxs("span",{"data-testid":"join-evaluator-not-ready-next-step",className:"text-[var(--fg-muted)]",children:[U.nextStep.description,U.nextStep.cli?` (${U.nextStep.cli})`:""]})]}):null;return o.jsxs("main",{"data-testid":"join-flow","data-manifest-cid":l,className:Ha,children:[o.jsxs("header",{className:"flex flex-col gap-1.5",children:[o.jsxs("span",{"data-testid":"join-flow-title",className:"font-mono text-[20px] font-medium text-foreground",children:["Join ",u.name]}),o.jsx("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:u.description})]}),o.jsxs(we,{"data-testid":"join-flow-summary",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:co,children:"Manifest"}),o.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[o.jsx("span",{children:"Contract"}),o.jsxs("span",{className:"text-foreground",children:[u.contract.id," · ",u.contract.version]}),o.jsx("span",{children:"Solution price"}),o.jsx("span",{className:"text-foreground",children:Ls(u.solutionPriceWei)}),o.jsx("span",{children:"Verdict price"}),o.jsx("span",{className:"text-foreground",children:Ls(u.verdictPriceWei)}),o.jsx("span",{children:"Open roles"}),o.jsx("span",{"data-testid":"join-flow-open-roles",className:"text-foreground",children:V.join(", ")||"none"}),o.jsx("span",{children:"Launcher"}),o.jsxs("span",{className:"text-foreground",children:[S5(u.launcher.safeAddress)," · agentId"," ",u.launcher.agentId]}),o.jsx("span",{children:"Manifest CID"}),o.jsx("span",{"data-testid":"join-flow-manifest-cid",className:"truncate text-[var(--fg-dim)]",children:l})]})]}),o.jsxs(we,{className:"flex flex-col gap-3 p-4",children:[o.jsxs("span",{className:ao,children:[o.jsx("span",{className:co,children:"Roles"}),o.jsxs(io,{label:"Roles help",docHref:`${oo}#solver-vs-evaluator`,children:["Solver attempts tasks and submits solutions. It is the spending role: you pay for model inference and gas. It also has the most upside per task.",`
|
|
258
|
+
|
|
259
|
+
`,"Evaluator checks other operators' solutions. Lower spend, steadier returns, less variance.",`
|
|
260
|
+
|
|
261
|
+
`,"You can take either role, or both. New here? Start as a solver on one SolverNet, using a model you already pay for."]})]}),o.jsx("div",{className:"flex overflow-hidden rounded-md border border-border",children:V.map((Q,ge)=>{const De=_.roles.includes(Q),Ue=`join-role-${Q}`;return o.jsxs("label",{htmlFor:Ue,"data-testid":"join-role-option","data-role":Q,"data-role-active":De?"true":"false",className:ee("flex flex-1 cursor-pointer flex-col gap-1.5 p-3 font-mono",De?"bg-[var(--bg)] text-foreground":"bg-transparent text-[var(--fg-muted)]",ge<V.length-1&&"border-r border-border"),children:[o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx("input",{id:Ue,type:"checkbox",checked:De,onChange:()=>W(Q),"aria-label":Q==="solver"?"Solver":"Evaluator",className:"size-3.5 accent-primary"}),o.jsx("span",{className:"text-[14px] font-medium",children:Q==="solver"?"Solver":"Evaluator"})]}),o.jsx("span",{className:ee("pl-[22px] text-[11px]",De?"text-[var(--fg-muted)]":"text-[var(--fg-dim)]"),children:Q==="solver"?"attempt tasks; submit solutions":"verify solutions submitted by other operators"})]},Q)})})]}),z&&o.jsxs(we,{"data-testid":"join-flow-solver-fields",className:"flex flex-col gap-3 p-4",children:[o.jsx("span",{className:co,children:"Solver configuration"}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs("span",{className:ao,children:[o.jsx(Sr,{htmlFor:"join-harness-select",className:Oh,children:"Harness"}),o.jsxs(io,{label:"Harness help",docHref:`${oo}#harness-and-model`,children:["The harness is the runtime that runs a task.",`
|
|
262
|
+
|
|
263
|
+
`,"You only need credentials for one harness — the harness, not the harness and the model separately.",`
|
|
264
|
+
|
|
265
|
+
`,"Claude Code uses whatever the `claude` CLI is signed in with: a Claude subscription or an Anthropic API key. Hermes Agent is a separate package; the join form checks it is installed.",`
|
|
266
|
+
|
|
267
|
+
`,"The default is the SolverNet's first compatible harness. Pick one. You do not need to pay for two."]})]}),o.jsxs("select",{id:"join-harness-select","aria-label":"Harness","data-testid":"join-harness-select",value:_.harness,onChange:Q=>{const ge=Q.target.value;k.current=!0,y({..._,harness:ge,model:Fo(ge)}),S(!1)},className:Ky,children:[d.map(Q=>{const ge=L.get(Q.name),De=(ge==null?void 0:ge.ready)===!1;return o.jsxs("option",{value:Q.name,disabled:De,"data-testid":"join-harness-option","data-harness":Q.name,"data-harness-ready":ge===void 0?"unknown":ge.ready?"true":"false",children:[f1(Q.name,Q.version),De?" — setup required":""]},Q.name)}),(!m||d.length===0)&&o.jsx("option",{value:_.harness,children:Ks(_.harness)})]}),_.harness===ca&&o.jsx("span",{"data-testid":"join-harness-hermes-description",className:"font-mono text-[11px] text-[var(--fg-muted)]",children:_5}),($==null?void 0:$.ready)===!1&&o.jsxs("div",{"data-testid":"join-harness-not-ready","data-harness":_.harness,role:"status",className:"flex flex-col gap-1 rounded-md border border-destructive bg-[var(--bg)] p-2.5 font-mono text-[11px] text-foreground",children:[o.jsxs("span",{className:"text-destructive",children:[Ks(_.harness)," is not ready",$.reason?`: ${$.reason}`:""]}),$.nextStep&&o.jsxs("span",{"data-testid":"join-harness-not-ready-next-step",className:"text-[var(--fg-muted)]",children:[$.nextStep.description,$.nextStep.cli?` (${$.nextStep.cli})`:""]})]})]}),o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs("span",{className:ao,children:[o.jsx(Sr,{htmlFor:"join-model-select",className:Oh,children:"Model"}),o.jsxs(io,{label:"Model help",docHref:`${oo}#harness-and-model`,children:["The model is the LLM the harness runs.",`
|
|
268
|
+
|
|
269
|
+
`,"This list only shows models the selected harness supports. Change the harness and the model resets to that harness's default.",`
|
|
270
|
+
|
|
271
|
+
`,"You pay for the model through the harness's credentials. There is no extra model subscription on top.",`
|
|
272
|
+
|
|
273
|
+
`,"Check the cost estimate below before you join."]})]}),o.jsxs("select",{id:"join-model-select","aria-label":"Model","data-testid":"join-model-select",value:_.model,onChange:Q=>{y({..._,model:Q.target.value}),S(!1)},className:Ky,children:[N.map(Q=>o.jsx("option",{value:Q.id,children:Q.label},Q.id)),(()=>{const Q=Og(_.model,_.harness);return Q.isCustom?o.jsx("option",{value:_.model,children:Q.label},_.model):null})()]})]})]}),o.jsx(LC,{modelId:_.model,usesPaidApiKey:K,testIdPrefix:"join-flow-cost"}),o.jsx(BC,{harness:_.harness,modelId:_.model,testIdPrefix:"join-flow-footprint"}),P&&o.jsxs("label",{"data-testid":"join-flow-cost-confirmation","data-cost-confirmation-checked":j?"true":"false",className:"flex cursor-pointer items-start gap-2.5 rounded-md border border-destructive bg-[var(--bg)] p-3 font-mono text-[12px] text-foreground",children:[o.jsx("input",{type:"checkbox","data-testid":"join-flow-cost-confirmation-checkbox",checked:j,onChange:Q=>S(Q.target.checked),className:"mt-0.5 size-3.5 accent-destructive","aria-label":"I understand the per-task cost and have a budget for this"}),o.jsx("span",{children:"I understand — I have a budget for this. The selected model is estimated at more than $1 per task; I am responsible for the API spend on my own provider key."})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("span",{className:ao,children:[o.jsx("span",{className:Oh,children:"Plugins"}),o.jsxs(io,{label:"Plugins help",docHref:`${oo}#plug-ins`,children:["Plug-ins are optional. On your first run you do not need to touch this section.",`
|
|
274
|
+
|
|
275
|
+
`,"A plug-in is reusable AI tooling — MCP servers, skills, extensions — that the harness can load while it solves.",`
|
|
276
|
+
|
|
277
|
+
`,"This SolverNet already enables the plug-ins its tasks need. Add your own only if you have built one.",`
|
|
278
|
+
|
|
279
|
+
`,"You can re-join later with more plug-ins."]})]}),o.jsx(yp,{available:(m==null?void 0:m.compatiblePlugins)??[],selected:_.plugins,disabledDefaultPlugins:_.disabledDefaultPlugins,onChange:(Q,ge)=>y({..._,plugins:Q,disabledDefaultPlugins:ge}),rowTestId:"join-plugin-option",searchTestId:"join-plugin-search",harness:_.harness})]})]}),J&&!z&&o.jsxs(we,{"data-testid":"join-flow-evaluator-info",className:"flex flex-col gap-3 p-4",children:[o.jsxs("span",{className:ao,children:[o.jsx("span",{className:co,children:"Evaluator configuration"}),o.jsxs(io,{label:"Evaluator configuration help",docHref:`${oo}#why-the-evaluator-role-has-no-model-selector`,children:["The evaluator role has no harness or model picker. That is by design.",`
|
|
280
|
+
|
|
281
|
+
`,"Every evaluator on a SolverNet must run the same evaluation function, so verdicts can be compared. The SolverNet's manifest sets it for you.",`
|
|
282
|
+
|
|
283
|
+
`,"For many SolverNets that function is deterministic and uses no model at all."]})]}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["The evaluator harness is bound to"," ",o.jsx("code",{className:"text-foreground",children:u.contract.evaluationFunction.implementation})," ","by the manifest's contract; no operator selection required."]}),B]}),J&&z&&o.jsxs(we,{"data-testid":"join-flow-evaluator-info",className:"flex flex-col gap-3 p-4",children:[o.jsxs("span",{className:ao,children:[o.jsx("span",{className:co,children:"Evaluator binding"}),o.jsxs(io,{label:"Evaluator binding help",docHref:`${oo}#why-the-evaluator-role-has-no-model-selector`,children:["The SolverNet's manifest sets the evaluator harness for you.",`
|
|
284
|
+
|
|
285
|
+
`,"Every evaluator runs the same evaluation function, so verdicts can be compared and trusted.",`
|
|
286
|
+
|
|
287
|
+
`,"The harness and model fields above apply only to the solver role."]})]}),o.jsxs("p",{className:"m-0 font-mono text-[12px] text-[var(--fg-muted)]",children:["Evaluator harness is bound to"," ",o.jsx("code",{className:"text-foreground",children:u.contract.evaluationFunction.implementation})," ","by the manifest. The fields above only configure the solver role."]}),B]}),b&&o.jsx(H3,{onSuccess:()=>{w(!1),M.mutate()},onCancel:()=>{w(!1)}}),h&&o.jsx("p",{"data-testid":"join-flow-submit-error",role:"alert",className:"m-0 font-mono text-[13px] text-destructive",children:h}),o.jsxs("footer",{className:"flex items-center justify-end gap-3",children:[o.jsx(ie,{type:"button",variant:"secondary","data-testid":"join-flow-cancel",onClick:()=>s("/operator#solvernets"),children:"Cancel"}),o.jsx(ie,{type:"button",variant:"default","data-testid":"join-flow-submit",disabled:!A,onClick:()=>{if(p(null),_.roles.includes("solver")&&_.harness===ca){w(!0);return}M.mutate()},children:M.isPending?"Joining…":"Join SolverNet"})]})]})}function Gy({message:e,onBack:t,onRetry:r}){return o.jsxs(Ye,{variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsx(Xe,{className:"font-mono text-[13px] text-destructive",children:e}),o.jsxs("div",{className:"flex gap-2",children:[r&&o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"join-flow-retry",onClick:r,children:"Retry"}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"join-flow-back",onClick:t,children:"Back"})]})]})}function j5({success:e,navigate:t}){const r=e.roles.map(c=>c==="solver"?"Solver":"Evaluator").join(" + "),[n,s]=C.useState(!1),[i,l]=C.useState(null),a=async()=>{s(!0),l(null);try{if(!(await me.restartDaemon()).ok)throw new Error("Restart request failed.");t("/overview")}catch(c){l(c instanceof Error?c.message:"Restart request failed."),s(!1)}};return o.jsxs(o.Fragment,{children:[o.jsxs(we,{"data-testid":"join-flow-success-card",role:"status",className:"flex flex-col gap-2.5 border-[var(--vow-green)] p-5",children:[o.jsx(Se,{variant:"success",className:"self-start",children:"Joined"}),o.jsxs("span",{"data-testid":"join-flow-success-name",className:"font-mono text-[18px] font-medium text-foreground",children:["You joined ",e.name]}),o.jsxs("span",{className:"font-mono text-[12px] leading-relaxed text-[var(--fg-muted)]",children:["You're in as ",r||"an operator",". This SolverNet now shows in your joined list."]}),e.restartRequired&&o.jsx("span",{"data-testid":"join-flow-success-restart",className:"font-mono text-[12px] leading-relaxed text-[var(--accent-gold)]",children:"Restart the node to start participating — the daemon picks up SolverNet config on restart."})]}),i&&o.jsx(Nt,{role:"alert","data-testid":"join-flow-success-restart-error",className:"font-mono text-[12px] leading-relaxed text-destructive",children:i}),o.jsxs("footer",{className:"flex items-center justify-end gap-3",children:[o.jsx(ie,{type:"button",variant:"secondary","data-testid":"join-flow-success-browse",onClick:()=>t("/operator#solvernets"),children:"Browse SolverNets"}),o.jsx(ie,{type:"button",variant:"secondary","data-testid":"join-flow-success-view",onClick:()=>t(`/operator#solvernets/${e.manifestCid}`),children:"View joined SolverNet"}),o.jsx(ie,{type:"button",variant:"default","data-testid":"join-flow-success-restart-button",onClick:()=>{a()},disabled:n,children:n?"Restarting…":"Restart node now"})]})]})}function R5({capture:e}){var t;return o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Executor"}),o.jsxs("dl",{className:"m-0 grid gap-x-3 gap-y-1.5 [grid-template-columns:120px_minmax(0,1fr)]",children:[o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Tool"}),o.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:e.originatingTool.name}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Version"}),o.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:e.originatingTool.version??"unknown"}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Repo"}),o.jsx("dd",{className:"m-0 break-words font-mono text-[12px] text-foreground",children:e.repoRemoteUrl??"none"}),o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:"Commit"}),o.jsx("dd",{className:"m-0 font-mono text-[12px] text-foreground",children:((t=e.repoCommitHash)==null?void 0:t.slice(0,12))??"none"})]})]})}function N5({spans:e}){const t=e.flatMap(r=>r.redactedKeys.map(n=>({span:r.name,key:n})));return o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Redactions"}),t.length===0?o.jsx("div",{className:"font-mono text-[12px] text-muted-foreground",children:"No redacted attributes."}):o.jsx("div",{className:"flex flex-col gap-1.5",children:t.map((r,n)=>o.jsxs("div",{className:"grid gap-3 font-mono text-[12px] text-foreground [grid-template-columns:minmax(120px,180px)_minmax(0,1fr)]",children:[o.jsx("span",{className:"text-muted-foreground",children:r.span}),o.jsx("span",{className:"break-words",children:r.key})]},`${r.span}-${r.key}-${n}`))})]})}function P5({detail:e,approving:t=!1,skipping:r=!1,onApprove:n,onSkip:s,onTrustRepo:i}){const{capture:l,spans:a}=e;return o.jsxs("div",{className:"flex flex-col gap-5",children:[o.jsxs("header",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("h1",{className:"m-0 break-all font-serif text-[22px] font-normal leading-tight text-foreground",children:l.sessionId}),o.jsxs("div",{className:"mt-1.5 font-mono text-[12px] text-muted-foreground",children:[new Date(l.capturedAt).toLocaleString()," · ",a.length," spans"]})]}),o.jsxs("div",{className:"flex shrink-0 items-start gap-2",children:[l.repoRemoteUrl?o.jsx(ie,{variant:"secondary",size:"sm",onClick:()=>i(!0),children:"Trust repo"}):null,o.jsx(ie,{variant:"secondary",size:"sm",disabled:r,onClick:s,children:r?"Skipping":"Skip"}),o.jsx(ie,{variant:"default",size:"sm",disabled:t,onClick:n,children:t?"Approving":"Approve"})]})]}),o.jsx(R5,{capture:l}),o.jsx(N5,{spans:a}),o.jsxs("section",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"m-0 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:"Trajectory"}),a.length===0?o.jsx("div",{className:"font-mono text-[12px] text-muted-foreground",children:"No spans recorded."}):o.jsx(we,{children:o.jsx(Ge,{className:"flex flex-col p-0",children:a.map((c,u)=>o.jsxs("div",{children:[u>0&&o.jsx(Qe,{}),o.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5",children:[o.jsx("strong",{className:"min-w-0 truncate font-mono text-[12px] font-medium text-foreground",children:c.name}),o.jsx("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:c.spanId})]})]},c.spanId))})})]})]})}function T5(e){const t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Md="Switch",[A5]=gn(Md),[D5,L5]=A5(Md),HC=C.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:i,required:l,disabled:a,value:c="on",onCheckedChange:u,form:m,...d}=e,[x,v]=C.useState(null),_=Be(t,g=>v(g)),y=C.useRef(!1),h=x?m||!!x.closest("form"):!0,[p,f]=Sa({prop:s,defaultProp:i??!1,onChange:u,caller:Md});return o.jsxs(D5,{scope:r,checked:p,disabled:a,children:[o.jsx($e.button,{type:"button",role:"switch","aria-checked":p,"aria-required":l,"data-state":VC(p),"data-disabled":a?"":void 0,disabled:a,value:c,...d,ref:_,onClick:ye(e.onClick,g=>{f(b=>!b),h&&(y.current=g.isPropagationStopped(),y.current||g.stopPropagation())})}),h&&o.jsx(WC,{control:x,bubbles:!y.current,name:n,value:c,checked:p,required:l,disabled:a,form:m,style:{transform:"translateX(-100%)"}})]})});HC.displayName=Md;var UC="SwitchThumb",zC=C.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=L5(UC,r);return o.jsx($e.span,{"data-state":VC(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});zC.displayName=UC;var O5="SwitchBubbleInput",WC=C.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},i)=>{const l=C.useRef(null),a=Be(l,i),c=T5(r),u=IS(t);return C.useEffect(()=>{const m=l.current;if(!m)return;const d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"checked").set;if(c!==r&&v){const _=new Event("click",{bubbles:n});v.call(m,r),m.dispatchEvent(_)}},[c,r,n]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:a,style:{...s.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});WC.displayName=O5;function VC(e){return e?"checked":"unchecked"}var qC=HC,M5=zC;const KC=C.forwardRef(({className:e,...t},r)=>o.jsx(qC,{className:ee("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-[var(--vow-green)] data-[state=unchecked]:bg-border",e),...t,ref:r,children:o.jsx(M5,{className:ee("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0.5")})}));KC.displayName=qC.displayName;const Ir=C.forwardRef(({className:e,...t},r)=>o.jsx("div",{ref:r,className:ee("animate-pulse rounded-md bg-muted",e),...t}));Ir.displayName="Skeleton";function _p(e){return Object.fromEntries(Object.entries(e).sort(([t],[r])=>t.localeCompare(r)))}function I5(e,t){return e.publicEndpoint===t.publicEndpoint&&e.defaultPriceUsdc===t.defaultPriceUsdc&&JSON.stringify(_p(e.perArtifactTypePrice))===JSON.stringify(_p(t.perArtifactTypePrice))&&e.donation.enabled===t.donation.enabled}function Qy({label:e,value:t,meta:r}){return o.jsxs("div",{"data-testid":"operator-donation-fact",className:"flex min-w-0 flex-col gap-1.5 rounded-lg border border-border px-3.5 py-3",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:e}),o.jsx("strong",{className:"font-mono text-[18px] font-medium text-foreground",children:t}),o.jsx("span",{className:"truncate font-mono text-[12px] text-[var(--fg-dim)]",children:r})]})}function F5({pricing:e,eligibleRuns:t,peerDatasetsUsed:r,saving:n,onSave:s,registerRevert:i}){const[l,a]=C.useState(e.donation.enabled),[c,u]=C.useState(!1),m=C.useMemo(()=>({publicEndpoint:e.publicEndpoint,defaultPriceUsdc:e.defaultPriceUsdc,perArtifactTypePrice:e.perArtifactTypePrice,donation:{enabled:l}}),[e.defaultPriceUsdc,e.perArtifactTypePrice,e.publicEndpoint,l]),d=!I5(e,m),x=_=>{if(_&&!l&&!e.donation.enabled){u(!0);return}a(_)},v=()=>{const _={...m,donation:{enabled:!0}};a(!0),u(!1),i(()=>a(!1)),s(_)};return o.jsxs("div",{"data-testid":"operator-donation-status",className:"flex flex-col gap-4",children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[o.jsxs("div",{className:"flex min-w-[260px] flex-[1_1_360px] flex-col gap-2",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Donate execution data"}),o.jsx("strong",{"data-testid":"operator-donation-mode",className:l?"font-mono text-[18px] font-medium text-[var(--vow-green)]":"font-mono text-[18px] font-medium text-foreground",children:l?"Donation is on":"Donation is off"}),o.jsx("p",{className:"m-0 max-w-[64ch] font-mono text-[12px] leading-relaxed text-[var(--fg-dim)]",children:"Share scrubbed and anonymized solver/evaluator data from future runs with other operators. This lets the network learn from real executions and improve itself. Public testnet donations are free and published to IPFS."})]}),o.jsxs("label",{"data-testid":"operator-donation-toggle",className:"inline-flex cursor-pointer items-center gap-3 rounded-full border border-border bg-[var(--bg-sunken)] px-3 py-2",children:[o.jsx("span",{className:l?"font-mono text-[11px] uppercase tracking-[0.12em] text-[var(--vow-green)]":"font-mono text-[11px] uppercase tracking-[0.12em] text-muted-foreground",children:l?"On":"Off"}),o.jsx(KC,{"aria-label":"Donate produced data",checked:l,onCheckedChange:x})]})]}),o.jsxs("div",{"data-testid":"operator-donation-facts",className:"grid gap-2.5 [grid-template-columns:repeat(auto-fit,minmax(150px,1fr))]",children:[o.jsx(Qy,{label:"Eligible runs",value:String(t),meta:"local history"}),o.jsx(Qy,{label:"Peer datasets used",value:String(r),meta:"from other operators"})]}),o.jsx(Ye,{variant:"info","data-testid":"operator-donation-caveat",children:o.jsx(Xe,{children:"Turning donation off stops future publishing. Data already published to IPFS may remain available."})}),o.jsx(Qe,{}),o.jsx("div",{className:"flex flex-wrap items-center justify-end gap-3",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{"data-testid":"operator-donation-settings-state",className:d?"font-mono text-[12px] text-primary":"font-mono text-[12px] text-[var(--fg-dim)]",children:d?"Donation changed":"Current"}),o.jsx(ie,{variant:"default",size:"sm",type:"button",disabled:!d||n,onClick:()=>{const _=e.donation.enabled;l!==_&&i(()=>a(_)),s(m)},children:n?"Saving…":"Save"})]})}),o.jsx(pC,{open:c,onOpenChange:u,children:o.jsxs(Rg,{"data-testid":"operator-donation-confirm",children:[o.jsxs(Ng,{children:[o.jsx(Tg,{children:"Share future execution data"}),o.jsx(Ag,{children:"Future solver/evaluator runs will be scrubbed, anonymized, and published to IPFS so other operators can use them. This helps the network learn from real executions and improve itself. Turning donation off later stops future publishing, but data already published to IPFS may remain available."})]}),o.jsxs(Pg,{children:[o.jsx(Lg,{children:"Cancel"}),o.jsx(Dg,{onClick:v,children:"Enable donation"})]})]})})]})}function B5({onRestartPending:e=()=>{}}){const t=ii(),{data:r,isLoading:n,isError:s,error:i,refetch:l}=Te({queryKey:["operator-artifacts","served"],queryFn:()=>me.operator.listArtifacts({source:"served",limit:100}),refetchInterval:1e4}),a=C.useRef(null),c=x=>{a.current=x},u=Qn({mutationFn:x=>me.operator.updatePricing(x),onSuccess:async()=>{a.current=null,An.success("Donation setting saved",{description:"Restart pending — applies on next daemon start."}),e(),await t.invalidateQueries({queryKey:["operator-artifacts"]})},onError:x=>{const v=a.current;a.current=null,v==null||v(),An.error("Failed to save donation setting",{description:x instanceof Error?x.message:String(x)})}}),m=r==null?void 0:r.summary,d=m?`${m.served.totalCount} eligible runs · donation ${r!=null&&r.pricing.donation.enabled?"on":"off"} · ${m.network.totalCount} peer datasets used`:"Donate scrubbed and anonymized run data to IPFS so other operators can use it.";return o.jsxs(we,{children:[o.jsxs(Yt,{className:"flex flex-row items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(fn,{className:"flex items-center gap-2",children:[o.jsx(_2,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Data donation"]}),o.jsx(Zs,{children:d})]}),o.jsx(Se,{variant:r!=null&&r.pricing.donation.enabled?"success":"outline",children:r!=null&&r.pricing.donation.enabled?"IPFS donation on":"Donation off"})]}),o.jsxs(Ge,{children:[n&&o.jsxs("div",{"data-testid":"operator-data-market-loading",className:"flex flex-col gap-3","aria-label":"Loading execution data",children:[o.jsx(Ir,{className:"h-6 w-40"}),o.jsx(Ir,{className:"h-4 w-72"}),o.jsx(Ir,{className:"h-20 w-full"})]}),s&&o.jsxs(Ye,{variant:"blocking",role:"alert","data-testid":"operator-data-market-error",className:"flex items-center justify-between gap-3",children:[o.jsx(Nt,{className:"text-[var(--break-red)]",children:i instanceof Error?i.message:"Failed to load execution data."}),o.jsxs(ie,{variant:"outline",size:"sm",type:"button",onClick:()=>{l()},children:[o.jsx(y2,{className:"h-3 w-3","aria-hidden":"true"}),"Retry"]})]}),r&&o.jsx(F5,{pricing:r.pricing,eligibleRuns:r.summary.served.totalCount,peerDatasetsUsed:r.summary.network.totalCount,saving:u.isPending,onSave:x=>u.mutate(x),registerRevert:c},`${r.pricing.publicEndpoint}|${r.pricing.defaultPriceUsdc}|${r.pricing.donation.enabled}|${JSON.stringify(_p(r.pricing.perArtifactTypePrice))}`)]})]})}const $5=G1,H5=Q1,GC=C.forwardRef(({className:e,...t},r)=>o.jsx(Sg,{className:ee("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));GC.displayName=Sg.displayName;const U5=vd("fixed z-50 gap-4 bg-card p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b border-border data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t border-border data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r border-border data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l border-border data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),QC=C.forwardRef(({side:e="right",className:t,children:r,...n},s)=>o.jsxs(H5,{children:[o.jsx(GC,{}),o.jsxs(Cg,{ref:s,className:ee(U5({side:e}),t),...n,children:[r,o.jsxs(jg,{className:"absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none",children:[o.jsx(Pl,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));QC.displayName=Cg.displayName;const YC=({className:e,...t})=>o.jsx("div",{className:ee("flex flex-col gap-2 text-left",e),...t});YC.displayName="SheetHeader";const ZC=C.forwardRef(({className:e,...t},r)=>o.jsx(kg,{ref:r,className:ee("font-serif text-[20px] text-foreground",e),...t}));ZC.displayName=kg.displayName;const XC=C.forwardRef(({className:e,...t},r)=>o.jsx(Eg,{ref:r,className:ee("font-mono text-[12px] text-[var(--fg-muted)]",e),...t}));XC.displayName=Eg.displayName;function JC(e){if(!Number.isFinite(e)||e<=0)return"0 B";const t=["B","KB","MB","GB"];let r=e,n=0;for(;r>=1024&&n<t.length-1;)r/=1024,n+=1;return`${r>=10||n===0?Math.round(r):r.toFixed(1)} ${t[n]}`}function Hu(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,19)+" UTC"}function z5(e){return e.length>14?`${e.slice(0,10)}…${e.slice(-6)}`:e}function W5(e,t){switch(e){case 8453:return`https://basescan.org/tx/${t}`;case 84532:return`https://sepolia.basescan.org/tx/${t}`;case 11155111:return`https://sepolia.etherscan.io/tx/${t}`;default:return null}}function Yy(e){return e==null||!Number.isFinite(e)?"—":Hu(new Date(e*1e3).toISOString())}function di({title:e,children:t}){return o.jsxs(we,{children:[o.jsx(Yt,{className:"pb-2",children:o.jsx(fn,{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:e})}),o.jsx(Ge,{className:"p-4 pt-0",children:t})]})}function hi({rows:e}){return o.jsx("dl",{className:"m-0 grid gap-x-3.5 gap-y-2.5 [grid-template-columns:140px_minmax(0,1fr)]",children:e.map(({label:t,value:r})=>o.jsxs(C.Fragment,{children:[o.jsx("dt",{className:"font-mono text-[12px] text-muted-foreground",children:t}),o.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-foreground",children:r??"—"})]},t))})}function ll(e){return e.source==="served"?e.createdAt:e.fetchedAt}function Bg(e){return e.source==="served"?"shared":e.paidAmountUsdc==="0"?"peer donated":"peer used"}function Zy(e,t){return!e||e.kind!==t.kind?!1:e.kind==="capture"&&t.kind==="capture"?e.id===t.id:e.kind==="artifact"&&t.kind==="artifact"?e.source===t.source&&e.sha256===t.sha256:!1}function bp(e){return e?e instanceof Error?e.message:String(e):"Unknown error"}function Mh(e){return/\b(401|403)\b|unauthorized|forbidden/i.test(bp(e))}function Xy({kind:e,message:t}){const r=e==="permission"?"Permission required to view execution data. Open the dashboard from the daemon handshake URL or refresh an authenticated session.":`Execution data could not be loaded${t?`: ${t}`:"."}`;return o.jsx(Ye,{variant:e==="permission"?"warning":"blocking","data-testid":e==="permission"?"execution-data-permission":"execution-data-error",children:o.jsx(Xe,{children:r})})}function V5(e){return{id:`capture:${e.sessionId}`,selection:{kind:"capture",id:e.sessionId},title:"execution-capture.v1",state:e.status,meta:`${e.originatingTool.name} · ${e.spanCount} spans · ${e.redactedSpanCount} redacted`,at:e.capturedAt}}function q5(e){const t=Bg(e);return{id:`artifact:${e.source}:${e.sha256}`,selection:{kind:"artifact",source:e.source,sha256:e.sha256},title:e.artifactType,state:t,meta:`${e.source==="served"?"produced":"peer"} · ${JC(e.contentSize)} · ${z5(e.sha256)}`,at:ll(e)}}function K5({artifact:e}){const t=ll(e),r=e.projection,n=e.anchors??[],s=[{label:"state",value:Bg(e)},{label:"sha256",value:e.sha256},{label:"recorded",value:Hu(t)}],i=[{label:"envelope",value:e.envelopeCid??"—"}];r&&i.push({label:"signature",value:r.signatureHash},{label:"generated",value:Yy(r.generatedAt)},{label:"role",value:r.role},{label:"solver",value:r.solverType},{label:"evidence tier",value:r.evidenceTier});const l=r?[{label:"safe",value:r.participantSafeAddress??"—"},{label:"agent EOA",value:r.participantAgentEoa??"—"},{label:"impl",value:r.executor.implName??"—"},{label:"impl version",value:r.executor.implVersion??"—"},{label:"runtime digest",value:r.executor.runtimeBundleDigest??"—"},{label:"plugins",value:r.executor.plugins&&r.executor.plugins.length>0?o.jsx("div",{className:"flex flex-wrap gap-1",children:r.executor.plugins.map(c=>o.jsx(Se,{variant:"outline",children:c},c))}):"—"}]:null,a=r?[{label:"task CID",value:r.taskCid??"—"},{label:"task ID",value:r.taskId??"—"},{label:"request",value:r.requestId??"—"},{label:"solution ref",value:r.solutionRef?`${r.solutionRef.envelopeCid}${r.solutionRef.ref?` (${r.solutionRef.ref})`:""}`:"—"}]:null;return o.jsxs("div",{className:"flex flex-col gap-5",children:[o.jsx(di,{title:"Identity",children:o.jsx(hi,{rows:s})}),o.jsx(di,{title:"Envelope",children:o.jsx(hi,{rows:i})}),l?o.jsx(di,{title:"Participant",children:o.jsx(hi,{rows:l})}):null,a?o.jsx(di,{title:"Task",children:o.jsx(hi,{rows:a})}):null,o.jsx(di,{title:"On-chain anchors",children:n.length===0?o.jsx("div",{className:"font-mono text-[12px] text-muted-foreground",children:"no on-chain anchor recorded yet"}):o.jsx("div",{className:"flex flex-col gap-3",children:n.map(c=>{const u=W5(c.chainId,c.txHash),m=[{label:"content kind",value:c.contentKind},{label:"agent ID",value:c.agentId},{label:"chain ID",value:String(c.chainId)},{label:"tx",value:u?o.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"break-all underline underline-offset-2 hover:text-foreground",children:c.txHash}):c.txHash},{label:"block",value:c.blockNumber!==null?String(c.blockNumber):"pending"},{label:"anchored",value:Yy(c.anchoredAt)},{label:"registry",value:c.identityRegistryAddress},{label:"metadata key",value:c.metadataKey}];return o.jsxs("div",{className:"rounded-md border border-border bg-card p-3",children:[o.jsx(hi,{rows:m}),o.jsxs("details",{className:"mt-2",children:[o.jsx("summary",{className:"cursor-pointer font-mono text-[11px] text-muted-foreground",children:"payload (ABI-encoded)"}),o.jsx("div",{className:"mt-1 break-all font-mono text-[11px] text-foreground",children:c.payloadHex})]})]},`${c.contentKind}:${c.txHash}`)})})}),e.source==="served"?o.jsx(di,{title:"Access",children:o.jsx(hi,{rows:[{label:"request",value:e.requestId??"—"},{label:"accesses",value:`${e.access.accessCount} total · ${e.access.failedPaymentCount} failed`},{label:"paid serves",value:String(e.access.paidServeCount)},{label:"free serves",value:String(e.access.freeServeCount)},{label:"revenue",value:`${e.access.revenueUsdc} USDC`}]})}):o.jsx(di,{title:"Source",children:o.jsx(hi,{rows:[{label:"operator",value:e.sourceOperator??"—"},{label:"endpoint",value:e.sourceEndpoint??"—"},{label:"origin",value:e.origin},{label:"paid",value:`${e.paidAmountUsdc} USDC`},{label:"peer catalog",value:e.peerCatalogId??"—"}]})})]})}function G5(){var S,E,N,O;const e=ii(),[t,r]=C.useState(),[n,s]=C.useState(!1),i=Te({queryKey:["captures","pending"],queryFn:()=>me.captures.listPending(),refetchInterval:2500}),l=Te({queryKey:["operator-artifacts","served","execution-data"],queryFn:()=>me.operator.listArtifacts({source:"served",limit:100}),refetchInterval:1e4}),a=Te({queryKey:["operator-artifacts","network","execution-data"],queryFn:()=>me.operator.listArtifacts({source:"network",limit:100}),refetchInterval:1e4}),c=((S=i.data)==null?void 0:S.captures)??[],u=[...((E=l.data)==null?void 0:E.artifacts)??[],...((N=a.data)==null?void 0:N.artifacts)??[]].sort((T,L)=>ll(L).localeCompare(ll(T))),m=[...c.map(V5),...u.map(q5)].sort((T,L)=>L.at.localeCompare(T.at)),d=(t==null?void 0:t.kind)==="capture"?t.id:void 0,x=(t==null?void 0:t.kind)==="artifact"?u.find(T=>T.source===t.source&&T.sha256===t.sha256):void 0,v=i.isLoading||l.isLoading||a.isLoading,_=[i.isError?i.error:i.failureReason,l.isError?l.error:l.failureReason,a.isError?a.error:a.failureReason].filter(Boolean),y=_.find(Mh),h=y??_[0];C.useEffect(()=>{if(m.length===0){t&&r(void 0),n&&s(!1);return}(!t||!m.some(T=>Zy(t,T.selection)))&&r(m[0].selection)},[m,t,n]);const p=Te({queryKey:["captures",d],queryFn:()=>me.captures.get(d),enabled:!!d}),f=Qn({mutationFn:T=>me.captures.approve(T),onSuccess:async()=>{await Promise.all([e.invalidateQueries({queryKey:["captures"]}),e.invalidateQueries({queryKey:["operator-artifacts"]})])}}),g=Qn({mutationFn:T=>me.captures.skip(T),onSuccess:async()=>{await e.invalidateQueries({queryKey:["captures"]})}}),b=Qn({mutationFn:T=>me.captures.trustRepo(T,!0)}),w=T=>{r(T),s(!0)},k=(t==null?void 0:t.kind)==="capture"?((O=p.data)==null?void 0:O.capture.sessionId)??"Capture":(x==null?void 0:x.artifactType)??"Artifact",j=(t==null?void 0:t.kind)==="capture"&&p.data?`${new Date(p.data.capture.capturedAt).toLocaleString()} · ${p.data.spans.length} spans`:(t==null?void 0:t.kind)==="artifact"&&x?`${Bg(x)} · ${JC(x.contentSize)} · ${Hu(ll(x))}`:"Execution data detail.";return o.jsxs("div",{className:"flex flex-col gap-6 p-6",children:[o.jsx(B5,{defaultExpanded:!0}),o.jsxs(we,{children:[o.jsx(Yt,{children:o.jsx(fn,{children:"Execution data"})}),o.jsxs(Ge,{children:[h?o.jsx("div",{className:"mb-3",children:o.jsx(Xy,{kind:y?"permission":"error",message:y?void 0:bp(h)})}):null,v&&m.length===0?o.jsx("div",{className:"p-6 font-mono text-[12px] text-muted-foreground",children:"Loading execution data."}):m.length===0?o.jsx("div",{className:"p-6 font-mono text-[12px] text-muted-foreground",children:"No execution data yet."}):o.jsx(Ql,{className:"max-h-[560px]",children:o.jsx("div",{className:"flex flex-col gap-2 pr-2",children:m.map(T=>{const L=Zy(t,T.selection);return o.jsxs(ie,{variant:"ghost","data-testid":"execution-data-row","data-state":L?"active":void 0,"aria-current":L?"true":void 0,onClick:()=>w(T.selection),className:ee("flex h-auto w-full flex-col items-stretch gap-1.5 rounded-md border border-border bg-card px-4 py-3 text-left font-mono text-[12px] normal-case tracking-normal hover:bg-accent",L&&"border-primary bg-primary/[0.06]"),children:[o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx("strong",{className:"min-w-0 truncate font-medium text-foreground",children:T.title}),o.jsx(Se,{variant:"outline",className:"shrink-0",children:T.state})]}),o.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[T.meta," · ",Hu(T.at)]})]},T.id)})})})]})]}),o.jsx($5,{open:n,onOpenChange:s,children:o.jsxs(QC,{side:"right",className:"w-full overflow-y-auto sm:max-w-xl","data-testid":"execution-data-sheet",children:[o.jsxs(YC,{children:[o.jsx(ZC,{className:"break-all",children:k}),o.jsx(XC,{children:j})]}),o.jsx("div",{className:"mt-4",children:p.error?o.jsx(Xy,{kind:Mh(p.error)?"permission":"error",message:Mh(p.error)?void 0:bp(p.error)}):(t==null?void 0:t.kind)==="capture"&&p.data?o.jsx(P5,{detail:p.data,approving:f.isPending,skipping:g.isPending,onApprove:()=>d&&f.mutate(d),onSkip:()=>d&&g.mutate(d),onTrustRepo:()=>{const T=p.data.capture.repoRemoteUrl;T&&b.mutate(T)}}):(t==null?void 0:t.kind)==="artifact"&&x?o.jsx(K5,{artifact:x}):o.jsx("div",{className:"p-6 font-mono text-[12px] text-muted-foreground",children:v?"Loading execution data.":"Select execution data."})})]})})]})}function Jy(e){const t=Q5(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(Z5);if(c){const u=c.props.children,m=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,m):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function Q5(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=J5(s),a=X5(i,s.props);return s.type!==C.Fragment&&(a.ref=n?os(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Y5=Symbol("radix.slottable");function Z5(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Y5}function X5(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function J5(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ek(e){const t=e+"CollectionProvider",[r,n]=gn(t),[s,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),l=y=>{const{scope:h,children:p}=y,f=Z.useRef(null),g=Z.useRef(new Map).current;return o.jsx(s,{scope:h,itemMap:g,collectionRef:f,children:p})};l.displayName=t;const a=e+"CollectionSlot",c=Jy(a),u=Z.forwardRef((y,h)=>{const{scope:p,children:f}=y,g=i(a,p),b=Be(h,g.collectionRef);return o.jsx(c,{ref:b,children:f})});u.displayName=a;const m=e+"CollectionItemSlot",d="data-radix-collection-item",x=Jy(m),v=Z.forwardRef((y,h)=>{const{scope:p,children:f,...g}=y,b=Z.useRef(null),w=Be(h,b),k=i(m,p);return Z.useEffect(()=>(k.itemMap.set(b,{ref:b,...g}),()=>void k.itemMap.delete(b))),o.jsx(x,{[d]:"",ref:w,children:f})});v.displayName=m;function _(y){const h=i(e+"CollectionConsumer",y);return Z.useCallback(()=>{const f=h.collectionRef.current;if(!f)return[];const g=Array.from(f.querySelectorAll(`[${d}]`));return Array.from(h.itemMap.values()).sort((k,j)=>g.indexOf(k.ref.current)-g.indexOf(j.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:l,Slot:u,ItemSlot:v},_,n]}var Ih="rovingFocusGroup.onEntryFocus",e4={bubbles:!1,cancelable:!0},tc="RovingFocusGroup",[wp,tk,t4]=ek(tc),[r4,rk]=gn(tc,[t4]),[n4,s4]=r4(tc),nk=C.forwardRef((e,t)=>o.jsx(wp.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(wp.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(i4,{...e,ref:t})})}));nk.displayName=tc;var i4=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:m=!1,...d}=e,x=C.useRef(null),v=Be(t,x),_=Km(i),[y,h]=Sa({prop:l,defaultProp:a??null,onChange:c,caller:tc}),[p,f]=C.useState(!1),g=Ht(u),b=tk(r),w=C.useRef(!1),[k,j]=C.useState(0);return C.useEffect(()=>{const S=x.current;if(S)return S.addEventListener(Ih,g),()=>S.removeEventListener(Ih,g)},[g]),o.jsx(n4,{scope:r,orientation:n,dir:_,loop:s,currentTabStopId:y,onItemFocus:C.useCallback(S=>h(S),[h]),onItemShiftTab:C.useCallback(()=>f(!0),[]),onFocusableItemAdd:C.useCallback(()=>j(S=>S+1),[]),onFocusableItemRemove:C.useCallback(()=>j(S=>S-1),[]),children:o.jsx($e.div,{tabIndex:p||k===0?-1:0,"data-orientation":n,...d,ref:v,style:{outline:"none",...e.style},onMouseDown:ye(e.onMouseDown,()=>{w.current=!0}),onFocus:ye(e.onFocus,S=>{const E=!w.current;if(S.target===S.currentTarget&&E&&!p){const N=new CustomEvent(Ih,e4);if(S.currentTarget.dispatchEvent(N),!N.defaultPrevented){const O=b().filter(z=>z.focusable),T=O.find(z=>z.active),L=O.find(z=>z.id===y),U=[T,L,...O].filter(Boolean).map(z=>z.ref.current);ok(U,m)}}w.current=!1}),onBlur:ye(e.onBlur,()=>f(!1))})})}),sk="RovingFocusGroupItem",ik=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:i,children:l,...a}=e,c=Vs(),u=i||c,m=s4(sk,r),d=m.currentTabStopId===u,x=tk(r),{onFocusableItemAdd:v,onFocusableItemRemove:_,currentTabStopId:y}=m;return C.useEffect(()=>{if(n)return v(),()=>_()},[n,v,_]),o.jsx(wp.ItemSlot,{scope:r,id:u,focusable:n,active:s,children:o.jsx($e.span,{tabIndex:d?0:-1,"data-orientation":m.orientation,...a,ref:t,onMouseDown:ye(e.onMouseDown,h=>{n?m.onItemFocus(u):h.preventDefault()}),onFocus:ye(e.onFocus,()=>m.onItemFocus(u)),onKeyDown:ye(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){m.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const p=l4(h,m.orientation,m.dir);if(p!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let g=x().filter(b=>b.focusable).map(b=>b.ref.current);if(p==="last")g.reverse();else if(p==="prev"||p==="next"){p==="prev"&&g.reverse();const b=g.indexOf(h.currentTarget);g=m.loop?c4(g,b+1):g.slice(b+1)}setTimeout(()=>ok(g))}}),children:typeof l=="function"?l({isCurrentTabStop:d,hasTabStop:y!=null}):l})})});ik.displayName=sk;var o4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function a4(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function l4(e,t,r){const n=a4(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return o4[n]}function ok(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function c4(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var u4=nk,d4=ik;function h4(e){const t=f4(e),r=C.forwardRef((n,s)=>{const{children:i,...l}=n,a=C.Children.toArray(i),c=a.find(m4);if(c){const u=c.props.children,m=a.map(d=>d===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:d);return o.jsx(t,{...l,ref:s,children:C.isValidElement(u)?C.cloneElement(u,void 0,m):null})}return o.jsx(t,{...l,ref:s,children:i})});return r.displayName=`${e}.Slot`,r}function f4(e){const t=C.forwardRef((r,n)=>{const{children:s,...i}=r;if(C.isValidElement(s)){const l=v4(s),a=g4(i,s.props);return s.type!==C.Fragment&&(a.ref=n?os(n,l):l),C.cloneElement(s,a)}return C.Children.count(s)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var p4=Symbol("radix.slottable");function m4(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===p4}function g4(e,t){const r={...t};for(const n in t){const s=e[n],i=t[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const c=i(...a);return s(...a),c}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...e,...r}}function v4(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Sp=["Enter"," "],x4=["ArrowDown","PageUp","Home"],ak=["ArrowUp","PageDown","End"],y4=[...x4,...ak],_4={ltr:[...Sp,"ArrowRight"],rtl:[...Sp,"ArrowLeft"]},b4={ltr:["ArrowLeft"],rtl:["ArrowRight"]},rc="Menu",[Dl,w4,S4]=ek(rc),[Qi,lk]=gn(rc,[S4,wa,rk]),Id=wa(),ck=rk(),[C4,Yi]=Qi(rc),[k4,nc]=Qi(rc),uk=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:s,onOpenChange:i,modal:l=!0}=e,a=Id(t),[c,u]=C.useState(null),m=C.useRef(!1),d=Ht(i),x=Km(s);return C.useEffect(()=>{const v=()=>{m.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},_=()=>m.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),o.jsx(ug,{...a,children:o.jsx(C4,{scope:t,open:r,onOpenChange:d,content:c,onContentChange:u,children:o.jsx(k4,{scope:t,onClose:C.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:m,dir:x,modal:l,children:n})})})};uk.displayName=rc;var E4="MenuAnchor",$g=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Id(r);return o.jsx(Cd,{...s,...n,ref:t})});$g.displayName=E4;var Hg="MenuPortal",[j4,dk]=Qi(Hg,{forceMount:void 0}),hk=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,i=Yi(Hg,t);return o.jsx(j4,{scope:t,forceMount:r,children:o.jsx(Wt,{present:r||i.open,children:o.jsx(Xl,{asChild:!0,container:s,children:n})})})};hk.displayName=Hg;var Fr="MenuContent",[R4,Ug]=Qi(Fr),fk=C.forwardRef((e,t)=>{const r=dk(Fr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,i=Yi(Fr,e.__scopeMenu),l=nc(Fr,e.__scopeMenu);return o.jsx(Dl.Provider,{scope:e.__scopeMenu,children:o.jsx(Wt,{present:n||i.open,children:o.jsx(Dl.Slot,{scope:e.__scopeMenu,children:l.modal?o.jsx(N4,{...s,ref:t}):o.jsx(P4,{...s,ref:t})})})})}),N4=C.forwardRef((e,t)=>{const r=Yi(Fr,e.__scopeMenu),n=C.useRef(null),s=Be(t,n);return C.useEffect(()=>{const i=n.current;if(i)return yg(i)},[]),o.jsx(zg,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ye(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),P4=C.forwardRef((e,t)=>{const r=Yi(Fr,e.__scopeMenu);return o.jsx(zg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),T4=h4("MenuContent.ScrollLock"),zg=C.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:m,onFocusOutside:d,onInteractOutside:x,onDismiss:v,disableOutsideScroll:_,...y}=e,h=Yi(Fr,r),p=nc(Fr,r),f=Id(r),g=ck(r),b=w4(r),[w,k]=C.useState(null),j=C.useRef(null),S=Be(t,j,h.onContentChange),E=C.useRef(0),N=C.useRef(""),O=C.useRef(0),T=C.useRef(null),L=C.useRef("right"),$=C.useRef(0),U=_?Ad:C.Fragment,z=_?{as:T4,allowPinchZoom:!0}:void 0,K=P=>{var A,B;const D=N.current+P,M=b().filter(G=>!G.disabled),V=document.activeElement,W=(A=M.find(G=>G.ref.current===V))==null?void 0:A.textValue,J=M.map(G=>G.textValue),X=z4(J,D,W),fe=(B=M.find(G=>G.textValue===X))==null?void 0:B.ref.current;(function G(Y){N.current=Y,window.clearTimeout(E.current),Y!==""&&(E.current=window.setTimeout(()=>G(""),1e3))})(D),fe&&setTimeout(()=>fe.focus())};C.useEffect(()=>()=>window.clearTimeout(E.current),[]),xg();const R=C.useCallback(P=>{var M,V;return L.current===((M=T.current)==null?void 0:M.side)&&V4(P,(V=T.current)==null?void 0:V.area)},[]);return o.jsx(R4,{scope:r,searchRef:N,onItemEnter:C.useCallback(P=>{R(P)&&P.preventDefault()},[R]),onItemLeave:C.useCallback(P=>{var D;R(P)||((D=j.current)==null||D.focus(),k(null))},[R]),onTriggerLeave:C.useCallback(P=>{R(P)&&P.preventDefault()},[R]),pointerGraceTimerRef:O,onPointerGraceIntentChange:C.useCallback(P=>{T.current=P},[]),children:o.jsx(U,{...z,children:o.jsx(Pd,{asChild:!0,trapped:s,onMountAutoFocus:ye(i,P=>{var D;P.preventDefault(),(D=j.current)==null||D.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:o.jsx(Yl,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:m,onFocusOutside:d,onInteractOutside:x,onDismiss:v,children:o.jsx(u4,{asChild:!0,...g,dir:p.dir,orientation:"vertical",loop:n,currentTabStopId:w,onCurrentTabStopIdChange:k,onEntryFocus:ye(c,P=>{p.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(dg,{role:"menu","aria-orientation":"vertical","data-state":Nk(h.open),"data-radix-menu-content":"",dir:p.dir,...f,...y,ref:S,style:{outline:"none",...y.style},onKeyDown:ye(y.onKeyDown,P=>{const M=P.target.closest("[data-radix-menu-content]")===P.currentTarget,V=P.ctrlKey||P.altKey||P.metaKey,W=P.key.length===1;M&&(P.key==="Tab"&&P.preventDefault(),!V&&W&&K(P.key));const J=j.current;if(P.target!==J||!y4.includes(P.key))return;P.preventDefault();const fe=b().filter(A=>!A.disabled).map(A=>A.ref.current);ak.includes(P.key)&&fe.reverse(),H4(fe)}),onBlur:ye(e.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(E.current),N.current="")}),onPointerMove:ye(e.onPointerMove,Ll(P=>{const D=P.target,M=$.current!==P.clientX;if(P.currentTarget.contains(D)&&M){const V=P.clientX>$.current?"right":"left";L.current=V,$.current=P.clientX}}))})})})})})})});fk.displayName=Fr;var A4="MenuGroup",Wg=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx($e.div,{role:"group",...n,ref:t})});Wg.displayName=A4;var D4="MenuLabel",pk=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx($e.div,{...n,ref:t})});pk.displayName=D4;var Uu="MenuItem",e_="menu.itemSelect",Fd=C.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,i=C.useRef(null),l=nc(Uu,e.__scopeMenu),a=Ug(Uu,e.__scopeMenu),c=Be(t,i),u=C.useRef(!1),m=()=>{const d=i.current;if(!r&&d){const x=new CustomEvent(e_,{bubbles:!0,cancelable:!0});d.addEventListener(e_,v=>n==null?void 0:n(v),{once:!0}),Zw(d,x),x.defaultPrevented?u.current=!1:l.onClose()}};return o.jsx(mk,{...s,ref:c,disabled:r,onClick:ye(e.onClick,m),onPointerDown:d=>{var x;(x=e.onPointerDown)==null||x.call(e,d),u.current=!0},onPointerUp:ye(e.onPointerUp,d=>{var x;u.current||(x=d.currentTarget)==null||x.click()}),onKeyDown:ye(e.onKeyDown,d=>{const x=a.searchRef.current!=="";r||x&&d.key===" "||Sp.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Fd.displayName=Uu;var mk=C.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...i}=e,l=Ug(Uu,r),a=ck(r),c=C.useRef(null),u=Be(t,c),[m,d]=C.useState(!1),[x,v]=C.useState("");return C.useEffect(()=>{const _=c.current;_&&v((_.textContent??"").trim())},[i.children]),o.jsx(Dl.ItemSlot,{scope:r,disabled:n,textValue:s??x,children:o.jsx(d4,{asChild:!0,...a,focusable:!n,children:o.jsx($e.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:u,onPointerMove:ye(e.onPointerMove,Ll(_=>{n?l.onItemLeave(_):(l.onItemEnter(_),_.defaultPrevented||_.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ye(e.onPointerLeave,Ll(_=>l.onItemLeave(_))),onFocus:ye(e.onFocus,()=>d(!0)),onBlur:ye(e.onBlur,()=>d(!1))})})})}),L4="MenuCheckboxItem",gk=C.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return o.jsx(bk,{scope:e.__scopeMenu,checked:r,children:o.jsx(Fd,{role:"menuitemcheckbox","aria-checked":zu(r)?"mixed":r,...s,ref:t,"data-state":qg(r),onSelect:ye(s.onSelect,()=>n==null?void 0:n(zu(r)?!0:!r),{checkForDefaultPrevented:!1})})})});gk.displayName=L4;var vk="MenuRadioGroup",[O4,M4]=Qi(vk,{value:void 0,onValueChange:()=>{}}),xk=C.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,i=Ht(n);return o.jsx(O4,{scope:e.__scopeMenu,value:r,onValueChange:i,children:o.jsx(Wg,{...s,ref:t})})});xk.displayName=vk;var yk="MenuRadioItem",_k=C.forwardRef((e,t)=>{const{value:r,...n}=e,s=M4(yk,e.__scopeMenu),i=r===s.value;return o.jsx(bk,{scope:e.__scopeMenu,checked:i,children:o.jsx(Fd,{role:"menuitemradio","aria-checked":i,...n,ref:t,"data-state":qg(i),onSelect:ye(n.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,r)},{checkForDefaultPrevented:!1})})})});_k.displayName=yk;var Vg="MenuItemIndicator",[bk,I4]=Qi(Vg,{checked:!1}),wk=C.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,i=I4(Vg,r);return o.jsx(Wt,{present:n||zu(i.checked)||i.checked===!0,children:o.jsx($e.span,{...s,ref:t,"data-state":qg(i.checked)})})});wk.displayName=Vg;var F4="MenuSeparator",Sk=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return o.jsx($e.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});Sk.displayName=F4;var B4="MenuArrow",Ck=C.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=Id(r);return o.jsx(hg,{...s,...n,ref:t})});Ck.displayName=B4;var $4="MenuSub",[_6,kk]=Qi($4),Za="MenuSubTrigger",Ek=C.forwardRef((e,t)=>{const r=Yi(Za,e.__scopeMenu),n=nc(Za,e.__scopeMenu),s=kk(Za,e.__scopeMenu),i=Ug(Za,e.__scopeMenu),l=C.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=i,u={__scopeMenu:e.__scopeMenu},m=C.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return C.useEffect(()=>m,[m]),C.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),o.jsx($g,{asChild:!0,...u,children:o.jsx(mk,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":Nk(r.open),...e,ref:os(t,s.onTriggerChange),onClick:d=>{var x;(x=e.onClick)==null||x.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ye(e.onPointerMove,Ll(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!r.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{r.onOpenChange(!0),m()},100))})),onPointerLeave:ye(e.onPointerLeave,Ll(d=>{var v,_;m();const x=(v=r.content)==null?void 0:v.getBoundingClientRect();if(x){const y=(_=r.content)==null?void 0:_.dataset.side,h=y==="right",p=h?-5:5,f=x[h?"left":"right"],g=x[h?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+p,y:d.clientY},{x:f,y:x.top},{x:g,y:x.top},{x:g,y:x.bottom},{x:f,y:x.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ye(e.onKeyDown,d=>{var v;const x=i.searchRef.current!=="";e.disabled||x&&d.key===" "||_4[n.dir].includes(d.key)&&(r.onOpenChange(!0),(v=r.content)==null||v.focus(),d.preventDefault())})})})});Ek.displayName=Za;var jk="MenuSubContent",Rk=C.forwardRef((e,t)=>{const r=dk(Fr,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,i=Yi(Fr,e.__scopeMenu),l=nc(Fr,e.__scopeMenu),a=kk(jk,e.__scopeMenu),c=C.useRef(null),u=Be(t,c);return o.jsx(Dl.Provider,{scope:e.__scopeMenu,children:o.jsx(Wt,{present:n||i.open,children:o.jsx(Dl.Slot,{scope:e.__scopeMenu,children:o.jsx(zg,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:u,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var d;l.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:ye(e.onFocusOutside,m=>{m.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ye(e.onEscapeKeyDown,m=>{l.onClose(),m.preventDefault()}),onKeyDown:ye(e.onKeyDown,m=>{var v;const d=m.currentTarget.contains(m.target),x=b4[l.dir].includes(m.key);d&&x&&(i.onOpenChange(!1),(v=a.trigger)==null||v.focus(),m.preventDefault())})})})})})});Rk.displayName=jk;function Nk(e){return e?"open":"closed"}function zu(e){return e==="indeterminate"}function qg(e){return zu(e)?"indeterminate":e?"checked":"unchecked"}function H4(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function U4(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function z4(e,t,r){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let l=U4(e,Math.max(i,0));s.length===1&&(l=l.filter(u=>u!==r));const c=l.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==r?c:void 0}function W4(e,t){const{x:r,y:n}=e;let s=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const a=t[i],c=t[l],u=a.x,m=a.y,d=c.x,x=c.y;m>n!=x>n&&r<(d-u)*(n-m)/(x-m)+u&&(s=!s)}return s}function V4(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return W4(r,t)}function Ll(e){return t=>t.pointerType==="mouse"?e(t):void 0}var q4=uk,K4=$g,G4=hk,Q4=fk,Y4=Wg,Z4=pk,X4=Fd,J4=gk,eF=xk,tF=_k,rF=wk,nF=Sk,sF=Ck,iF=Ek,oF=Rk,Bd="DropdownMenu",[aF]=gn(Bd,[lk]),Jt=lk(),[lF,Pk]=aF(Bd),Tk=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:s,defaultOpen:i,onOpenChange:l,modal:a=!0}=e,c=Jt(t),u=C.useRef(null),[m,d]=Sa({prop:s,defaultProp:i??!1,onChange:l,caller:Bd});return o.jsx(lF,{scope:t,triggerId:Vs(),triggerRef:u,contentId:Vs(),open:m,onOpenChange:d,onOpenToggle:C.useCallback(()=>d(x=>!x),[d]),modal:a,children:o.jsx(q4,{...c,open:m,onOpenChange:d,dir:n,modal:a,children:r})})};Tk.displayName=Bd;var Ak="DropdownMenuTrigger",Dk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,i=Pk(Ak,r),l=Jt(r);return o.jsx(K4,{asChild:!0,...l,children:o.jsx($e.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:os(t,i.triggerRef),onPointerDown:ye(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:ye(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Dk.displayName=Ak;var cF="DropdownMenuPortal",Lk=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Jt(t);return o.jsx(G4,{...n,...r})};Lk.displayName=cF;var Ok="DropdownMenuContent",Mk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Pk(Ok,r),i=Jt(r),l=C.useRef(!1);return o.jsx(Q4,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...n,ref:t,onCloseAutoFocus:ye(e.onCloseAutoFocus,a=>{var c;l.current||(c=s.triggerRef.current)==null||c.focus(),l.current=!1,a.preventDefault()}),onInteractOutside:ye(e.onInteractOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,m=c.button===2||u;(!s.modal||m)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Mk.displayName=Ok;var uF="DropdownMenuGroup",dF=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jt(r);return o.jsx(Y4,{...s,...n,ref:t})});dF.displayName=uF;var hF="DropdownMenuLabel",Ik=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jt(r);return o.jsx(Z4,{...s,...n,ref:t})});Ik.displayName=hF;var fF="DropdownMenuItem",Fk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jt(r);return o.jsx(X4,{...s,...n,ref:t})});Fk.displayName=fF;var pF="DropdownMenuCheckboxItem",Bk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jt(r);return o.jsx(J4,{...s,...n,ref:t})});Bk.displayName=pF;var mF="DropdownMenuRadioGroup",gF=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jt(r);return o.jsx(eF,{...s,...n,ref:t})});gF.displayName=mF;var vF="DropdownMenuRadioItem",xF=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jt(r);return o.jsx(tF,{...s,...n,ref:t})});xF.displayName=vF;var yF="DropdownMenuItemIndicator",$k=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jt(r);return o.jsx(rF,{...s,...n,ref:t})});$k.displayName=yF;var _F="DropdownMenuSeparator",Hk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jt(r);return o.jsx(nF,{...s,...n,ref:t})});Hk.displayName=_F;var bF="DropdownMenuArrow",wF=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jt(r);return o.jsx(sF,{...s,...n,ref:t})});wF.displayName=bF;var SF="DropdownMenuSubTrigger",CF=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jt(r);return o.jsx(iF,{...s,...n,ref:t})});CF.displayName=SF;var kF="DropdownMenuSubContent",EF=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Jt(r);return o.jsx(oF,{...s,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});EF.displayName=kF;var jF=Tk,RF=Dk,NF=Lk,Uk=Mk,zk=Ik,Wk=Fk,Vk=Bk,PF=$k,qk=Hk;const TF=jF,AF=RF,Kk=C.forwardRef(({className:e,sideOffset:t=4,...r},n)=>o.jsx(NF,{children:o.jsx(Uk,{ref:n,sideOffset:t,className:ee("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...r})}));Kk.displayName=Uk.displayName;const Gk=C.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(Wk,{ref:n,className:ee("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 font-mono text-[12px] outline-none transition-colors focus:bg-[var(--bg-sunken)] focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));Gk.displayName=Wk.displayName;const DF=C.forwardRef(({className:e,children:t,checked:r,...n},s)=>o.jsxs(Vk,{ref:s,className:ee("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 font-mono text-[12px] outline-none focus:bg-[var(--bg-sunken)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(PF,{children:o.jsx(l2,{className:"h-3 w-3"})})}),t]}));DF.displayName=Vk.displayName;const LF=C.forwardRef(({className:e,inset:t,...r},n)=>o.jsx(zk,{ref:n,className:ee("px-2 py-1.5 font-mono text-[10px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",t&&"pl-8",e),...r}));LF.displayName=zk.displayName;const OF=C.forwardRef(({className:e,...t},r)=>o.jsx(qk,{ref:r,className:ee("-mx-1 my-1 h-px bg-border",e),...t}));OF.displayName=qk.displayName;const t_=[{to:"/operator/memberships",label:"Memberships"},{to:"/operator/registry",label:"Registry"},{to:"/operator/execution-data",label:"Execution data"},{to:"/operator/network",label:"Network"},{to:"/operator/security",label:"Security"}];function MF({to:e,label:t}){const[r]=ZN(e);return o.jsx("li",{children:o.jsx(cr,{href:e,"aria-current":r?"page":void 0,className:ee("block rounded-sm px-3 py-2 font-mono text-[12px] tracking-[0.08em] no-underline transition-colors",r?"bg-[var(--bg-elevated)] font-medium text-foreground":"bg-transparent font-normal text-[var(--fg-muted)] hover:text-foreground"),children:t})})}function IF(){const[,e]=Hr();return o.jsxs("nav",{"aria-label":"Operator sections","data-testid":"operator-sub-nav",className:"flex min-w-[160px] flex-col pt-1",children:[o.jsx("div",{className:"mb-2 sm:hidden",children:o.jsxs(TF,{children:[o.jsx(AF,{asChild:!0,children:o.jsxs(ie,{variant:"outline",size:"sm","data-testid":"operator-sub-nav-trigger",children:[o.jsx(m2,{className:"h-3.5 w-3.5"})," Sections"]})}),o.jsx(Kk,{align:"start",children:t_.map(t=>o.jsx(Gk,{onSelect:()=>e(t.to),children:t.label},t.to))})]})}),o.jsx("ul",{className:"m-0 flex list-none flex-col gap-0.5 p-0",children:t_.map(t=>o.jsx(MF,{to:t.to,label:t.label},t.to))})]})}function Ua({children:e}){return o.jsxs("div",{"data-testid":"operator-shell",className:"flex items-start gap-6 p-6",children:[o.jsx(IF,{}),o.jsx("div",{className:"min-w-0 flex-1",children:e})]})}function Fh(e){const t=kr(e.harness);return{harness:t,plugins:e.plugins??[],disabledDefaultPlugins:e.disabledDefaultPlugins??[],model:e.model??Fo(t)}}function r_(e,t){const r=kr(t.harness);if(e.harness!==r||e.model!==(t.model??Fo(r)))return!0;const n=[...e.plugins].sort(),s=[...t.plugins??[]].sort();if(n.length!==s.length)return!0;for(let a=0;a<n.length;a+=1)if(n[a]!==s[a])return!0;const i=[...e.disabledDefaultPlugins].sort(),l=[...t.disabledDefaultPlugins??[]].sort();if(i.length!==l.length)return!0;for(let a=0;a<i.length;a+=1)if(i[a]!==l[a])return!0;return!1}const n_="flex h-9 w-full rounded-sm border border-border bg-sunken px-2.5 py-1 font-mono text-[13px] text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";function FF({joined:e,catalogEntry:t,defaultExpanded:r=!1,focusOn:n,onRestartPending:s}){const[i,l]=C.useState(r),[a,c]=C.useState(()=>Fh(e)),u=C.useRef(null),m=C.useRef(null),d=ii(),x=t!==void 0,v=Te({queryKey:["solvernets","manifest",e.manifestCid],queryFn:()=>me.solvernets.getManifest(e.manifestCid),enabled:!x&&!!e.manifestCid,staleTime:1/0,retry:!1}),_=Te({queryKey:["solvernets","catalog"],queryFn:()=>me.getSolverNets(),enabled:!x}),h=(()=>{var J;if(x)return t;const W=(J=v.data)==null?void 0:J.manifest;if(!(!W||!_.data))return _.data.nets.find(X=>X.contract.id===W.contract.id&&X.contract.version===W.contract.version)})(),p=e.contract??(h==null?void 0:h.contract),f=!x&&(v.isLoading||_.isLoading),g=!x&&v.isError&&!v.isLoading;C.useEffect(()=>{r_(a,e)||c(Fh(e))},[e.harness,e.model,JSON.stringify(e.plugins??[]),JSON.stringify(e.disabledDefaultPlugins??[])]),C.useEffect(()=>{r&&(l(!0),n==="harness"&&setTimeout(()=>{var W,J;(W=u.current)==null||W.scrollIntoView({block:"center",behavior:"smooth"}),(J=m.current)==null||J.focus()},50))},[r,n]);const b=((h==null?void 0:h.compatibleHarnesses)??[]).filter(W=>W.supportsRoles.includes("solving")).map(W=>({...W,name:kr(W.name)})).filter((W,J,X)=>X.findIndex(fe=>fe.name===W.name)===J),w=new Set(b.map(W=>W.name)),k=a.harness!==""&&b.length>0&&![...w].some(W=>yO(W,a.harness)),j=h?`${h.contract.id}@${h.contract.version}`:"",S=Ld(a.harness),E=Qn({mutationFn:()=>me.operator.join(e.manifestCid,{...e.name!==void 0?{name:e.name}:{},...p!==void 0?{contract:{id:p.id,version:p.version}}:{},roles:e.roles,...a.harness?{harness:a.harness}:{},plugins:a.plugins,disabledDefaultPlugins:a.disabledDefaultPlugins,...a.model?{model:a.model}:{}}),onSuccess:W=>{d.invalidateQueries({queryKey:["operator","joined"]}),W.restartRequired&&(s==null||s())}}),[N,O]=C.useState(!1),T=e.roles.includes("solver"),L=$C(T?a.harness:void 0),$=Fg(L,T?a.model:void 0),U=T&&$.requiresConfirmation,z=U&&!N,[K,R]=C.useState(!1),P=Qn({mutationFn:()=>me.operator.leave(e.manifestCid),onSuccess:W=>{d.invalidateQueries({queryKey:["operator","joined"]}),W.restartRequired&&(s==null||s()),R(!1)}}),D=r_(a,e),M=e.name??e.manifestCid,V=`${e.manifestCid.slice(0,8)}…${e.manifestCid.slice(-4)}`;return o.jsxs("article",{"data-testid":"joined-net-card","data-manifest-cid":e.manifestCid,"data-expanded":i?"true":"false",className:"flex flex-col gap-2.5 rounded-md border border-border bg-background px-4 py-3.5",children:[o.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-start gap-3",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[o.jsx("span",{"data-testid":"joined-net-card-name",className:"truncate font-serif text-[20px] leading-tight text-foreground tracking-[-0.01em]",children:M}),o.jsxs("div",{className:"flex flex-wrap gap-2 font-mono text-[11px] text-muted-foreground",children:[e.roles.map(W=>o.jsx(BF,{label:W},W)),o.jsxs("span",{className:"text-dim",children:["cid ",V]})]})]}),g?o.jsx("div",{className:"flex flex-col items-end gap-1.5",children:K?o.jsxs("div",{className:"flex gap-1.5",children:[o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-leave-cancel",disabled:P.isPending,onClick:()=>R(!1),children:"Cancel"}),o.jsx(ie,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave-confirm",disabled:P.isPending,onClick:()=>P.mutate(),children:P.isPending?"Leaving…":"Confirm leave"})]}):o.jsxs(ie,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave",onClick:()=>R(!0),children:[o.jsx(Pl,{"aria-hidden":"true",className:"!size-3"}),"Leave"]})}):o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-toggle",onClick:()=>l(W=>!W),children:i?o.jsxs(o.Fragment,{children:[o.jsx(gd,{"aria-hidden":"true",className:"!size-3.5"}),"Close"]}):o.jsxs(o.Fragment,{children:[o.jsx(Fw,{"aria-hidden":"true",className:"!size-3.5"}),"Edit"]})})]}),g&&o.jsxs("div",{"data-testid":"joined-net-card-orphaned",className:"rounded-sm border border-wane bg-transparent px-3.5 py-2.5 font-mono text-[12px] leading-relaxed text-muted-foreground",children:[o.jsx(Se,{variant:"pill",className:"mr-2 align-baseline",children:"Retired"}),"Manifest no longer in the registry. This SolverNet is not claiming on-chain anymore — leaving it removes the entry from your config. Restart the daemon afterwards so it stops looking for this manifest at startup.",P.isError&&o.jsx("div",{role:"alert",className:"mt-1.5 text-[11px] text-destructive",children:P.error instanceof Error?P.error.message:"Leave failed."})]}),!i&&!g&&o.jsx(s_,{harness:e.harness,plugins:e.plugins,model:e.model,harnessWarning:k?`does not support ${j}`:null,warningTestId:"joined-net-card-warn-collapsed"}),g&&o.jsx(s_,{harness:e.harness,plugins:e.plugins,model:e.model,harnessWarning:null}),i&&!g&&o.jsxs("div",{"data-testid":"joined-net-card-form",className:"flex flex-col gap-3.5 border-t border-border pt-3",children:[o.jsxs("div",{ref:u,className:"flex flex-col gap-1.5",children:[o.jsx(Sr,{htmlFor:"joined-net-card-harness-select",children:"Harness"}),o.jsxs("select",{ref:m,id:"joined-net-card-harness-select","aria-label":"Harness implementation","data-testid":"joined-net-card-harness-select",value:a.harness,onChange:W=>{const J=W.target.value;c(X=>({...X,harness:J,model:Fo(J)})),O(!1)},className:ee(n_,k&&"border-destructive"),children:[a.harness===""&&o.jsx("option",{value:"",children:"—"}),b.map(W=>o.jsx("option",{value:W.name,children:f1(W.name,W.version)},W.name)),a.harness&&b.length>0&&!w.has(a.harness)&&o.jsxs("option",{value:a.harness,children:[Ks(a.harness)," (incompatible)"]}),a.harness&&b.length===0&&o.jsx("option",{value:a.harness,children:Ks(a.harness)})]}),k&&o.jsxs("span",{"data-testid":"joined-net-card-warn-expanded",className:"font-mono text-[11px] leading-relaxed text-destructive",children:["⚠ This harness does not support ",o.jsx("span",{className:"text-foreground",children:j}),".",b.length>0&&o.jsxs(o.Fragment,{children:[" Compatible: ",b.map((W,J)=>o.jsxs("span",{className:"text-primary",children:[Ks(W.name),J<b.length-1?" · ":""]},W.name))]})]})]}),o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx(Sr,{children:"Plugins"}),f?o.jsx("span",{"data-testid":"joined-net-card-catalog-loading",className:"font-mono text-[12px] text-dim",children:"Loading registry catalog…"}):h?(h.compatiblePlugins??[]).length===0?o.jsx(yp,{available:[],selected:a.plugins,disabledDefaultPlugins:a.disabledDefaultPlugins,onChange:(W,J)=>c(X=>({...X,plugins:W,disabledDefaultPlugins:J})),rowTestId:"joined-net-card-plugin-row",searchTestId:"joined-net-card-plugin-search",harness:a.harness}):o.jsx(yp,{available:(h==null?void 0:h.compatiblePlugins)??[],selected:a.plugins,disabledDefaultPlugins:a.disabledDefaultPlugins,onChange:(W,J)=>c(X=>({...X,plugins:W,disabledDefaultPlugins:J})),rowTestId:"joined-net-card-plugin-row",searchTestId:"joined-net-card-plugin-search",harness:a.harness}):o.jsx("span",{"data-testid":"joined-net-card-catalog-missing",className:"font-mono text-[12px] italic text-dim",children:"Registry catalog has no template for this SolverNet's contract — plugins can't be verified."})]}),o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx(Sr,{htmlFor:"joined-net-card-model-select",children:"Model"}),o.jsxs("select",{id:"joined-net-card-model-select","aria-label":"Model","data-testid":"joined-net-card-model-select",value:a.model,onChange:W=>{c({...a,model:W.target.value}),O(!1)},className:n_,children:[S.map(W=>o.jsx("option",{value:W.id,children:W.label},W.id)),(()=>{const W=Og(a.model,a.harness);return W.isCustom?o.jsx("option",{value:a.model,children:W.label},a.model):null})()]})]}),T&&o.jsx(LC,{modelId:a.model,usesPaidApiKey:L,variant:"inline",testIdPrefix:"joined-net-card-cost"}),T&&o.jsx(BC,{harness:a.harness,modelId:a.model,variant:"inline",testIdPrefix:"joined-net-card-footprint"}),U&&o.jsxs("label",{"data-testid":"joined-net-card-cost-confirmation","data-cost-confirmation-checked":N?"true":"false",className:"flex cursor-pointer items-start gap-2 rounded-md border border-destructive bg-background px-3 py-2.5 font-mono text-[12px] text-foreground",children:[o.jsx("input",{type:"checkbox","data-testid":"joined-net-card-cost-confirmation-checkbox",checked:N,onChange:W=>O(W.target.checked),className:"mt-0.5 size-3.5 accent-destructive","aria-label":"I understand the per-task cost and have a budget for this"}),o.jsx("span",{children:"I understand — I have a budget for this. The selected model is estimated above $1/task on my own provider key."})]}),E.isError&&o.jsx("span",{role:"alert","data-testid":"joined-net-card-error",className:"font-mono text-[12px] text-destructive",children:E.error instanceof Error?E.error.message:"Save failed."}),o.jsx(Qe,{}),o.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] text-dim",children:[o.jsx("span",{children:D?"Restart required to apply.":"No unsaved changes."}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-cancel",disabled:!D||E.isPending,onClick:()=>c(Fh(e)),children:"Cancel"}),o.jsx(ie,{type:"button",size:"sm","data-testid":"joined-net-card-save",disabled:!D||E.isPending||z,onClick:()=>E.mutate(),children:E.isPending?"Saving…":"Save"})]})]}),o.jsxs("div",{"data-testid":"joined-net-card-leave-zone",className:"mt-1 flex flex-wrap items-start justify-between gap-3 border-t border-dashed border-border pt-3",children:[o.jsx("span",{"data-testid":"joined-net-card-leave-explainer",className:"max-w-[440px] font-mono text-[11px] leading-relaxed text-dim",children:"Leave removes this SolverNet from your config right away. The running daemon keeps its loaded copy in memory, so it will go on claiming and finishing tasks for this SolverNet until you restart it — restart to actually stop new claims. Tasks already in flight run to completion either way. You can re-join from the Discover catalog later."}),K?o.jsxs("div",{className:"flex gap-1.5",children:[o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"joined-net-card-leave-cancel",disabled:P.isPending,onClick:()=>R(!1),children:"Cancel"}),o.jsx(ie,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave-confirm",disabled:P.isPending,onClick:()=>P.mutate(),children:P.isPending?"Leaving…":"Confirm leave"})]}):o.jsxs(ie,{type:"button",variant:"destructive",size:"sm","data-testid":"joined-net-card-leave",onClick:()=>R(!0),children:[o.jsx(Pl,{"aria-hidden":"true",className:"!size-3"}),"Leave SolverNet"]})]})]})]})}function s_({harness:e,plugins:t,model:r,harnessWarning:n,warningTestId:s}){return o.jsxs("div",{className:"grid grid-cols-[90px_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-muted-foreground",children:[o.jsx("span",{children:"harness"}),o.jsxs("span",{className:"text-foreground",children:[e?Ks(e):o.jsx("span",{className:"text-dim",children:"—"}),n&&s&&o.jsxs("span",{"data-testid":s,className:"ml-2.5 text-destructive",children:["⚠ ",n]})]}),o.jsx("span",{children:"plugins"}),o.jsx("span",{className:"text-foreground",children:(t??[]).length===0?o.jsx("span",{className:"text-dim",children:"—"}):`${t.length} active`}),o.jsx("span",{children:"model"}),o.jsx("span",{className:"text-foreground",children:r?Og(r,kr(e)).label:o.jsx("span",{className:"text-dim",children:"—"})})]})}function BF({label:e}){return o.jsx(Se,{variant:"outline","data-testid":"joined-net-card-role",className:"px-1.5 py-px text-[10px]",children:e})}function $F({onRestartPending:e}={}){const t=Te({queryKey:["operator","joined"],queryFn:()=>me.operator.listJoined(),refetchInterval:3e4}),r=C.useMemo(()=>{var s;const n=((s=t.data)==null?void 0:s.joinedSolverNets)??{};return Object.values(n)},[t.data]);return o.jsxs("div",{"data-testid":"memberships-tab",className:"flex flex-col gap-3",children:[o.jsxs("div",{className:"flex items-baseline justify-between",children:[o.jsxs("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:["Joined · ",r.length]}),t.isError&&o.jsx("span",{role:"alert",className:"font-mono text-[11px] text-[var(--break-red)]",children:"Failed to load joined SolverNets."})]}),t.isLoading&&o.jsxs("div",{"data-testid":"memberships-tab-loading",className:"flex flex-col gap-3","aria-label":"Loading",children:[o.jsx(Ir,{className:"h-20 w-full"}),o.jsx(Ir,{className:"h-20 w-full"})]}),!t.isLoading&&r.length===0&&o.jsxs("p",{"data-testid":"memberships-tab-empty",className:"m-0 font-mono text-[12px] leading-relaxed text-muted-foreground",children:["You haven't joined any SolverNets yet. Browse the"," ",o.jsx(cr,{href:"/operator/registry",className:"text-primary no-underline hover:underline",children:"Registry"})," ","to participate."]}),r.map(n=>o.jsx(FF,{joined:n,onRestartPending:e},n.manifestCid))]})}const i_={launched:{variant:"success",label:"Launched"},paused:{variant:"pill",label:"Paused"},retired:{variant:"outline",label:"Retired"}};function HF(e){return e?e.length<=13?e:`${e.slice(0,6)}…${e.slice(-4)}`:""}function UF(e){if(!e)return null;try{const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toISOString().replace("T"," ").slice(0,16)+" UTC"}catch{return e}}function zF(e){if(e instanceof Error){const t=e.code;if(typeof t=="string")return t;if(e.message.includes("subsystem_not_ready"))return"subsystem_not_ready";if(e.message.includes("registry_unavailable"))return"registry_unavailable";if(e.message.includes("rpc_rate_limited"))return"rpc_rate_limited"}return null}const WF={title:"Your RPC endpoint is rate-limited.",detail:"Open the Network section and add your own free key.",actionHref:"/operator#network",actionLabel:"Open Network settings →"};function VF(e){switch(zF(e)){case"subsystem_not_ready":return{title:"SolverNet subsystem is still starting.",detail:"Wait a few seconds, then retry. If this persists, restart the daemon and check its startup logs."};case"registry_unavailable":return{title:"Registry cache is unavailable.",detail:"The daemon could not read the SolverNet registry cache. Retry after startup finishes; check daemon logs if it keeps failing."};case"rpc_rate_limited":return WF;default:return{title:"Failed to load registry catalog.",detail:e instanceof Error?e.message:"Unknown error"}}}function qF({code:e,message:t}){return e==="rpc_rate_limited"?o.jsxs("span",{"data-testid":"registry-catalog-warn","data-error-code":"rpc_rate_limited",className:"inline-flex gap-2 normal-case tracking-normal text-[var(--wane)]",children:[o.jsx("span",{children:"RPC rate-limited — add your own key"}),o.jsx(cr,{href:"/operator#network","data-testid":"registry-catalog-warn-action",className:"text-primary no-underline hover:underline",children:"Network settings →"})]}):o.jsxs("span",{"data-testid":"registry-catalog-warn",className:"normal-case tracking-normal text-[var(--wane)]",children:["stale (",t,")"]})}function KF({status:e}){const t=i_[e]??i_.launched;return o.jsx(Se,{"data-testid":"registry-status-badge","data-status":e,variant:t.variant,className:"whitespace-nowrap",children:t.label})}function GF({openRoles:e}){return e.length===0?o.jsx("span",{className:"text-[12px] text-[var(--fg-dim)]",children:"no open roles"}):o.jsx("span",{className:"flex flex-wrap gap-1.5",children:e.map(t=>o.jsx(Se,{"data-testid":"registry-open-role","data-role":t,variant:"outline",className:"rounded-full text-foreground",children:t},t))})}function QF({summary:e,joinedRoles:t}){const r=`/operator/join/${encodeURIComponent(e.manifestCid)}`,n=(t??[]).length>0,s=e.status==="launched";return o.jsx(we,{"data-testid":"registry-card","data-manifest-cid":e.manifestCid,className:"flex flex-col gap-3 p-4",children:o.jsxs("article",{className:"flex flex-col gap-3",children:[o.jsxs("header",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[o.jsx("span",{className:"truncate font-mono text-[15px] font-medium text-foreground",children:e.name}),o.jsxs("span",{className:"font-mono text-[12px] text-[var(--fg-muted)]",children:["Launcher: ",HF(e.launcherSafeAddress)," · agentId"," ",e.launcherAgentId]})]}),o.jsx(KF,{status:e.status})]}),o.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 font-mono text-[12px] text-[var(--fg-muted)]",children:[o.jsx("span",{children:"Open roles"}),o.jsx(GF,{openRoles:e.openRoles}),o.jsx("span",{children:"Solution price"}),o.jsx("span",{className:"text-foreground",children:Ls(e.solutionPriceWei)}),o.jsx("span",{children:"Verdict price"}),o.jsx("span",{className:"text-foreground",children:Ls(e.verdictPriceWei)})]}),o.jsxs("footer",{className:"flex items-center justify-end gap-3",children:[n&&o.jsxs(Se,{"data-testid":"registry-card-joined","data-manifest-cid":e.manifestCid,variant:"success",className:"rounded-full px-2.5 py-1",children:["JOINED · ",(t??[]).join(", ")]}),s?o.jsx(ie,{asChild:!0,variant:n?"secondary":"default","data-testid":"registry-join-cta","data-manifest-cid":e.manifestCid,children:o.jsx(cr,{href:r,children:n?"Edit":"Join"})}):o.jsx(ie,{type:"button",variant:"secondary","data-testid":"registry-join-cta","data-manifest-cid":e.manifestCid,disabled:!0,"aria-disabled":!0,className:"pointer-events-none",children:n?"Edit":"Join"})]})]})})}function YF({refetchIntervalMs:e=3e4}={}){var x;const{data:t,isLoading:r,isError:n,error:s,refetch:i}=Te({queryKey:["solvernets","registry"],queryFn:()=>me.solvernets.listRegistry(),refetchInterval:e}),l=Te({queryKey:["operator","joined"],queryFn:()=>me.operator.listJoined(),refetchInterval:e}),a=((x=l.data)==null?void 0:x.joinedSolverNets)??{};if(r||l.isLoading)return o.jsx("p",{"data-testid":"registry-catalog-loading",className:"m-0 font-mono text-[13px] text-[var(--fg-muted)]",children:"Loading catalog…"});if(n||l.isError){const v=n?s:l.error,_=VF(v);return o.jsxs(Ye,{"data-testid":"registry-catalog-error",variant:"blocking",className:"flex items-center justify-between gap-4 border-l-0 border border-destructive p-4",children:[o.jsxs("div",{className:"flex flex-col gap-1",children:[o.jsx(Nt,{className:"font-mono text-[13px] font-medium text-destructive",children:_.title}),o.jsx(Xe,{className:"text-[12px] text-[var(--fg-muted)]",children:_.detail}),_.actionHref&&_.actionLabel&&o.jsx(cr,{href:_.actionHref,"data-testid":"registry-catalog-error-action",className:"mt-0.5 font-mono text-[12px] text-primary no-underline hover:underline",children:_.actionLabel})]}),o.jsx(ie,{type:"button",variant:"secondary",size:"sm","data-testid":"registry-catalog-retry",onClick:()=>{i()},children:"Retry"})]})}const c=(t==null?void 0:t.summaries)??[],u=c.filter(v=>a[v.manifestCid]===void 0),m=UF((t==null?void 0:t.lastRefreshedAt)??null),d=(t==null?void 0:t.lastError)??null;return o.jsxs("div",{"data-testid":"registry-catalog",className:"flex flex-col gap-3",children:[o.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] uppercase tracking-[0.14em] text-[var(--fg-muted)]",children:[o.jsxs("span",{"data-testid":"registry-catalog-meta",children:[u.length," discoverable · last refreshed"," ",m??"never"]}),d&&o.jsx(qF,{code:d.code,message:d.message})]}),u.length===0?o.jsx(we,{"data-testid":"registry-catalog-empty",className:"p-6 font-mono text-[13px] text-[var(--fg-muted)]",children:c.length===0?"No launched SolverNets available.":"No unjoined SolverNets available."}):o.jsx("div",{className:"flex flex-col gap-2.5",children:u.map(v=>{var _;return o.jsx(QF,{summary:v,joinedRoles:(_=a[v.manifestCid])==null?void 0:_.roles},v.manifestCid)})})]})}function ZF(){return o.jsxs("div",{"data-testid":"registry-tab",className:"flex flex-col gap-3",children:[o.jsxs("span",{className:"flex items-center gap-2 font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-muted-foreground",children:[o.jsx(d2,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Discover"]}),o.jsx(YF,{})]})}function XF({onRestartPending:e=()=>{}}={}){const{data:t}=Te({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap(),refetchInterval:1500}),r=(t==null?void 0:t.chain)??"base-sepolia",n=(t==null?void 0:t.rpcUrl)??"",s=(t==null?void 0:t.defaultRpcUrl)??(r==="base"?"https://mainnet.base.org":"https://base-sepolia-rpc.publicnode.com");return o.jsx("div",{"data-testid":"network-tab",children:o.jsx(JF,{chain:r,rpcUrl:n,defaultRpcUrl:s,rpcHealthy:!0,onRestartPending:e})})}function JF({chain:e,rpcUrl:t,defaultRpcUrl:r,rpcHealthy:n,onRestartPending:s}){const[i,l]=C.useState(t),[a,c]=C.useState(!1),u=i!==t,m=t===r,d=e==="base"?"Base mainnet (chain id 8453)":"Base Sepolia (chain id 84532)",x=d.split(" (")[0],v=async()=>{c(!0);try{const _=i.length===0?null:i,y=await me.updateNetwork({rpcUrl:_});An.success("RPC URL saved",{description:y.restartRequired?"Restart pending — applies on next daemon start.":"Applied to the running daemon."}),y.restartRequired&&s()}catch(_){An.error("Failed to save RPC URL",{description:_ instanceof Error?_.message:String(_)})}finally{c(!1)}};return o.jsxs(we,{children:[o.jsxs(Yt,{className:"flex flex-row items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(fn,{className:"flex items-center gap-2",children:[o.jsx(g2,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Network"]}),o.jsxs(Zs,{children:[x," · ",t]})]}),o.jsx(Se,{variant:n?"success":"destructive",children:n?"Healthy":"Unreachable"})]}),o.jsxs(Ge,{children:[o.jsxs("div",{className:"grid gap-6 sm:grid-cols-2",children:[o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx(Sr,{children:"Chain"}),o.jsx("div",{className:"rounded-md border border-border bg-[var(--bg-sunken)] px-3 py-2 font-mono text-[13px] text-muted-foreground",children:d}),o.jsx(Se,{variant:"outline",className:"self-start",children:"locked"}),o.jsx("p",{className:"font-mono text-[11px] text-[var(--fg-dim)]",children:"Switching chains resets fleet state — that's a separate flow."})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Sr,{htmlFor:"rpc-url",children:"RPC URL"}),u&&o.jsx(Se,{variant:"warning",children:"Restart"})]}),o.jsx(gt,{id:"rpc-url",type:"text",value:i,onChange:_=>l(_.target.value),placeholder:r,className:u?"border-primary":void 0}),o.jsx(ie,{variant:"link",size:"sm",type:"button",onClick:()=>l(""),className:"h-auto self-start p-0 text-[11px]",children:"Use default"}),m&&o.jsxs(Ye,{variant:"warning",className:"mt-3","data-testid":"network-shared-rpc-warning",children:[o.jsx($w,{className:"h-4 w-4 text-[var(--wane)]"}),o.jsx(Nt,{className:"text-[var(--wane)]",children:"Shared RPC"}),o.jsxs(Xe,{children:["You're on the default RPC — a free public gateway shared with every operator on the default config. Fine for setup; not reliable under load. Get your own free key from"," ",o.jsxs("a",{href:"https://dashboard.tenderly.co/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-0.5 text-primary hover:underline",children:["Tenderly ",o.jsx(Ao,{className:"h-2.5 w-2.5"})]}),","," ",o.jsxs("a",{href:"https://www.alchemy.com/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-0.5 text-primary hover:underline",children:["Alchemy ",o.jsx(Ao,{className:"h-2.5 w-2.5"})]}),", or"," ",o.jsxs("a",{href:"https://www.quicknode.com/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-0.5 text-primary hover:underline",children:["QuickNode ",o.jsx(Ao,{className:"h-2.5 w-2.5"})]})," ","and paste it above."]})]}),o.jsxs("p",{className:"font-mono text-[11px] text-[var(--fg-dim)]",children:["Default: ",r]})]})]}),u&&o.jsxs("div",{className:"mt-6 flex items-center justify-end gap-2 border-t border-border pt-4",children:[o.jsx(ie,{variant:"secondary",size:"sm",type:"button",onClick:()=>l(t),children:"Cancel"}),o.jsx(ie,{variant:"default",size:"sm",type:"button",disabled:a,onClick:()=>{v()},children:a?"Saving…":"Save"})]})]})]})}var sc=e=>e.type==="checkbox",_i=e=>e instanceof Date,At=e=>e==null;const Qk=e=>typeof e=="object";var lt=e=>!At(e)&&!Array.isArray(e)&&Qk(e)&&!_i(e),Yk=e=>lt(e)&&e.target?sc(e.target)?e.target.checked:e.target.value:e,Cp=(e,t)=>{const r=t.split("."),n=[];let s=r[0];for(let i=1;i<r.length;s+="."+r[i++])!isNaN(+r[i])&&e.has(s)&&n.push(s);return n},eB=e=>{const t=e.constructor&&e.constructor.prototype;return lt(t)&&t.hasOwnProperty("isPrototypeOf")},Kg=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function pt(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Kg&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(lt(e)&&eB(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=pt(e[s]));return n}var ic=e=>/^\w*$/.test(e),rt=e=>e===void 0,Gg=e=>Array.isArray(e)?e.filter(Boolean):[],$d=e=>Gg(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ae=(e,t,r)=>{if(!t||!lt(e))return r;const s=(ic(t)?[t]:$d(t)).reduce((i,l)=>At(i)?void 0:i[l],e);return rt(s)||s===e?rt(e[t])?r:e[t]:s},vr=e=>typeof e=="boolean",$t=e=>typeof e=="function",ze=(e,t,r)=>{let n=-1;const s=ic(t)?[t]:$d(t),i=s.length,l=i-1;for(;++n<i;){const a=s[n];let c=r;if(n!==l){const u=e[a];c=lt(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const ys={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},an={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Zr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Bh="form",Zk="root",Qg=Z.createContext(null);Qg.displayName="HookFormControlContext";const Yg=()=>Z.useContext(Qg);var Xk=(e,t,r,n=!0)=>{const s={};for(const i in e)Object.defineProperty(s,i,{get:()=>{const l=i;return t._proxyFormState[l]!==an.all&&(t._proxyFormState[l]=!n||an.all),r&&(r[l]=!0),e[l]}});return s};const Zg=typeof window<"u"?Z.useLayoutEffect:Z.useEffect;function tB(e){const t=Yg(),{control:r=t,disabled:n,name:s,exact:i}=e||{},[l,a]=Z.useState(()=>({...r._formState,defaultValues:r._defaultValues})),c=Z.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Zg(()=>r._subscribe({name:s,formState:c.current,exact:i,callback:u=>{!n&&a({...r._formState,...u,defaultValues:r._defaultValues})}}),[s,n,i]),Z.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),Z.useMemo(()=>Xk(l,r,c.current,!1),[l,r])}var Ut=e=>typeof e=="string",kp=(e,t,r,n,s)=>Ut(e)?(n&&t.watch.add(e),ae(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),ae(r,i))):(n&&(t.watchAll=!0),r),Ep=e=>At(e)||!Qk(e);function xr(e,t,r=new WeakSet){if(e===t)return!0;if(Ep(e)||Ep(t))return Object.is(e,t);if(_i(e)&&_i(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const i of n){const l=e[i];if(!(i in t))return!1;if(i!=="ref"){const a=t[i];if(_i(l)&&_i(a)||(lt(l)||Array.isArray(l))&&(lt(a)||Array.isArray(a))?!xr(l,a,r):!Object.is(l,a))return!1}}return!0}function rB(e){const t=Yg(),{control:r=t,name:n,defaultValue:s,disabled:i,exact:l,compute:a}=e||{},c=Z.useRef(s),u=Z.useRef(a),m=Z.useRef(void 0),d=Z.useRef(r),x=Z.useRef(n);u.current=a;const[v,_]=Z.useState(()=>{const b=r._getWatch(n,c.current);return u.current?u.current(b):b}),y=Z.useCallback(b=>{const w=kp(n,r._names,b||r._formValues,!1,c.current);return u.current?u.current(w):w},[r._formValues,r._names,n]),h=Z.useCallback(b=>{if(!i){const w=kp(n,r._names,b||r._formValues,!1,c.current);if(u.current){const k=u.current(w);xr(k,m.current)||(_(k),m.current=k)}else _(w)}},[r._formValues,r._names,i,n]);Zg(()=>((d.current!==r||!xr(x.current,n))&&(d.current=r,x.current=n,h()),r._subscribe({name:n,formState:{values:!0},exact:l,callback:b=>{h(b.values)}})),[r,l,n,h]),Z.useEffect(()=>r._removeUnmounted());const p=d.current!==r,f=x.current,g=Z.useMemo(()=>{if(i)return null;const b=!p&&!xr(f,n);return p||b?y():null},[i,p,n,f,y]);return g!==null?g:v}function nB(e){const t=Yg(),{name:r,disabled:n,control:s=t,shouldUnregister:i,defaultValue:l,exact:a=!0}=e,c=!!Cp(s._names.array,r).length,u=Z.useMemo(()=>ae(s._formValues,r,ae(s._defaultValues,r,l)),[s,r,l]),m=rB({control:s,name:r,defaultValue:u,exact:a}),d=tB({control:s,name:r,exact:a}),x=Z.useRef(e),v=Z.useRef(s.register(r,{...e.rules,value:m,...vr(e.disabled)?{disabled:e.disabled}:{}}));x.current=e;const _=Z.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ae(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!ae(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!ae(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!ae(d.validatingFields,r)},error:{enumerable:!0,get:()=>ae(d.errors,r)}}),[d,r]),y=Z.useCallback(g=>v.current.onChange({target:{value:Yk(g),name:r},type:ys.CHANGE}),[r]),h=Z.useCallback(()=>v.current.onBlur({target:{value:ae(s._formValues,r),name:r},type:ys.BLUR}),[r,s._formValues]),p=Z.useCallback(g=>{const b=ae(s._fields,r);b&&b._f&&g&&(b._f.ref={focus:()=>$t(g.focus)&&g.focus(),select:()=>$t(g.select)&&g.select(),setCustomValidity:w=>$t(g.setCustomValidity)&&g.setCustomValidity(w),reportValidity:()=>$t(g.reportValidity)&&g.reportValidity()})},[s._fields,r]),f=Z.useMemo(()=>({name:r,value:m,...vr(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:y,onBlur:h,ref:p}),[r,n,d.disabled,y,h,p,m]);return Z.useEffect(()=>{const g=s._options.shouldUnregister||i;s.register(r,{...x.current.rules,...vr(x.current.disabled)?{disabled:x.current.disabled}:{}});const b=(w,k)=>{const j=ae(s._fields,w);j&&j._f&&(j._f.mount=k)};if(b(r,!0),g){const w=pt(ae(s._defaultValues,r,ae(s._options.defaultValues,r,x.current.defaultValue)));ze(s._defaultValues,r,w),rt(ae(s._formValues,r))&&ze(s._formValues,r,w)}return!c&&s.register(r),()=>{(c?g&&!s._state.action:g)?s.unregister(r):b(r,!1)}},[r,s,c,i]),Z.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),Z.useMemo(()=>({field:f,formState:d,fieldState:_}),[f,d,_])}const sB=e=>e.render(nB(e)),Xg=Z.createContext(null);Xg.displayName="HookFormContext";const iB=()=>Z.useContext(Xg),oB=e=>{const{children:t,watch:r,getValues:n,getFieldState:s,setError:i,clearErrors:l,setValue:a,setValues:c,trigger:u,formState:m,resetField:d,reset:x,handleSubmit:v,unregister:_,control:y,register:h,setFocus:p,subscribe:f}=e,g=Z.useMemo(()=>({watch:r,getValues:n,getFieldState:s,setError:i,clearErrors:l,setValue:a,setValues:c,trigger:u,formState:m,resetField:d,reset:x,handleSubmit:v,unregister:_,control:y,register:h,setFocus:p,subscribe:f}),[l,y,m,s,n,v,h,x,d,i,p,a,c,f,u,_,r]);return Z.createElement(Xg.Provider,{value:g},Z.createElement(Qg.Provider,{value:g.control},t))};var Jk=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},cl=e=>Array.isArray(e)?e:[e],o_=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}};function eE(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],i=t[n];if(s&<(s)&&i){const l=eE(s,i);lt(l)&&(r[n]=l)}else e[n]&&(r[n]=i)}return r}var Ft=e=>lt(e)&&!Object.keys(e).length,Jg=e=>e.type==="file",Wu=e=>{if(!Kg)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},tE=e=>e.type==="select-multiple",ev=e=>e.type==="radio",aB=e=>ev(e)||sc(e),$h=e=>Wu(e)&&e.isConnected;function lB(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(At(e)){e=void 0;break}e=e[t[n]],n++}return e}function cB(e){for(const t in e)if(e.hasOwnProperty(t)&&!rt(e[t]))return!1;return!0}function vt(e,t){if(Ut(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:ic(t)?[t]:$d(t),n=r.length===1?e:lB(e,r),s=r.length-1,i=r[s];return n&&delete n[i],s!==0&&(lt(n)&&Ft(n)||Array.isArray(n)&&cB(n))&&vt(e,r.slice(0,-1)),e}var uB=e=>{for(const t in e)if($t(e[t]))return!0;return!1};function rE(e){return Array.isArray(e)||lt(e)&&!uB(e)}function jp(e,t={}){for(const r in e){const n=e[r];rE(n)?(t[r]=Array.isArray(n)?[]:{},jp(n,t[r])):rt(n)||(t[r]=!0)}return t}function Rp(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>Rp(r));return t.some(r=>r!==void 0)?t:void 0}if(lt(e)){const t={};for(const r in e){const n=Rp(e[r]);rt(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function uo(e,t,r){r||(r=jp(t));for(const n in e){const s=e[n];if(rE(s))rt(t)||Ep(r[n])?r[n]=jp(s,Array.isArray(s)?[]:{}):uo(s,At(t)?{}:t[n],r[n]);else{const i=t[n];r[n]=!xr(s,i)}}return Rp(r)||{}}const a_={value:!1,isValid:!1},l_={value:!0,isValid:!0};var nE=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!rt(e[0].attributes.value)?rt(e[0].value)||e[0].value===""?l_:{value:e[0].value,isValid:!0}:l_:a_}return a_},sE=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>rt(e)?e:t?e===""?NaN:e&&+e:r&&Ut(e)?new Date(e):n?n(e):e;const c_={isValid:!1,value:null};var iE=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,c_):c_;function u_(e){const t=e.ref;return Jg(t)?t.files:ev(t)?iE(e.refs).value:tE(t)?[...t.selectedOptions].map(({value:r})=>r):sc(t)?nE(e.refs).value:sE(rt(t.value)?e.ref.value:t.value,e)}var dB=(e,t,r,n)=>{const s={};for(const i of e){const l=ae(t,i);l&&ze(s,i,l._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Vu=e=>e instanceof RegExp,za=e=>rt(e)?e:Vu(e)?e.source:lt(e)?Vu(e.value)?e.value.source:e.value:e,d_=e=>({isOnSubmit:!e||e===an.onSubmit,isOnBlur:e===an.onBlur,isOnChange:e===an.onChange,isOnAll:e===an.all,isOnTouch:e===an.onTouched});const h_="AsyncFunction";var hB=e=>!!e&&!!e.validate&&!!($t(e.validate)&&e.validate.constructor.name===h_||lt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===h_)),fB=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),f_=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const ul=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=ae(e,s);if(i){const{_f:l,...a}=i;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],s)&&!n)return!0;if(l.ref&&t(l.ref,l.name)&&!n)return!0;if(ul(a,t))break}else if(lt(a)&&ul(a,t))break}}};function p_(e,t,r){const n=ae(e,r);if(n||ic(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),l=ae(t,i),a=ae(e,i);if(l&&!Array.isArray(l)&&r!==i)return{name:r};if(a&&a.type)return{name:i,error:a};if(a&&a.root&&a.root.type)return{name:`${i}.root`,error:a.root};s.pop()}return{name:r}}var pB=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return Ft(i)||n&&Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(l=>t[l]===(!n||an.all))},mB=(e,t,r)=>!e||!t||e===t||cl(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),gB=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,vB=(e,t)=>!Gg(ae(e,t)).length&&vt(e,t),m_=(e,t,r)=>{const n=cl(ae(e,r));return ze(n,Zk,t[r]),ze(e,r,n),e};function g_(e,t,r="validate"){if(Ut(e)||Array.isArray(e)&&e.every(Ut)||vr(e)&&!e)return{type:r,message:Ut(e)?e:"",ref:t}}var lo=e=>lt(e)&&!Vu(e)?e:{value:e,message:""},v_=async(e,t,r,n,s,i)=>{const{ref:l,refs:a,required:c,maxLength:u,minLength:m,min:d,max:x,pattern:v,validate:_,name:y,valueAsNumber:h,mount:p}=e._f,f=ae(r,y);if(!p||t.has(y))return{};const g=a?a[0]:l,b=T=>{s&&g.reportValidity&&(g.setCustomValidity(vr(T)?"":T||""),g.reportValidity())},w={},k=ev(l),j=sc(l),S=k||j,E=(h||Jg(l))&&rt(l.value)&&rt(f)||Wu(l)&&l.value===""||f===""||Array.isArray(f)&&!f.length||h&&typeof f=="number"&&isNaN(f),N=Jk.bind(null,y,n,w),O=(T,L,$,U=Zr.maxLength,z=Zr.minLength)=>{const K=T?L:$;w[y]={type:T?U:z,message:K,ref:l,...N(T?U:z,K)}};if(i?!Array.isArray(f)||!f.length:c&&(!S&&(E||At(f))||vr(f)&&!f||j&&!nE(a).isValid||k&&!iE(a).isValid)){const{value:T,message:L}=Ut(c)?{value:!!c,message:c}:lo(c);if(T&&(w[y]={type:Zr.required,message:L,ref:g,...N(Zr.required,L)},!n))return b(L),w}if(!E&&(!At(d)||!At(x))){let T,L;const $=lo(x),U=lo(d);if(!At(f)&&!isNaN(f)){const z=l.valueAsNumber||f&&+f;At($.value)||(T=z>$.value),At(U.value)||(L=z<U.value)}else{const z=l.valueAsDate||new Date(f),K=D=>new Date(new Date().toDateString()+" "+D),R=l.type=="time",P=l.type=="week";Ut($.value)&&f&&(T=R?K(f)>K($.value):P?f>$.value:z>new Date($.value)),Ut(U.value)&&f&&(L=R?K(f)<K(U.value):P?f<U.value:z<new Date(U.value))}if((T||L)&&(O(!!T,$.message,U.message,Zr.max,Zr.min),!n))return b(w[y].message),w}if((u||m)&&!E&&(Ut(f)||i&&Array.isArray(f))){const T=lo(u),L=lo(m),$=!At(T.value)&&f.length>+T.value,U=!At(L.value)&&f.length<+L.value;if(($||U)&&(O($,T.message,L.message),!n))return b(w[y].message),w}if(v&&!E&&Ut(f)){const{value:T,message:L}=lo(v);if(Vu(T)&&!f.match(T)&&(w[y]={type:Zr.pattern,message:L,ref:l,...N(Zr.pattern,L)},!n))return b(L),w}if(_){if($t(_)){const T=await _(f,r),L=g_(T,g);if(L&&(w[y]={...L,...N(Zr.validate,L.message)},!n))return b(L.message),w}else if(lt(_)){let T={};for(const L in _){if(!Ft(T)&&!n)break;const $=g_(await _[L](f,r),g,L);$&&(T={...$,...N(L,$.message)},b($.message),n&&(w[y]=T))}if(!Ft(T)&&(w[y]={ref:g,...T},!n))return w}}return b(!0),w};const xB={mode:an.onSubmit,reValidateMode:an.onChange,shouldFocusError:!0},oE={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function yB(e={}){let t={...xB,...e},r={...pt(oE),isLoading:$t(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},s=lt(t.defaultValues)||lt(t.values)?pt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:pt(s),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,u=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...m};let x={...d};const v={array:o_(),state:o_()},_=t.criteriaMode===an.all,y=I=>H=>{clearTimeout(u),u=setTimeout(I,H)},h=async I=>{if(!l.keepIsValid&&!t.disabled&&(d.isValid||x.isValid||I)){let H;t.resolver?(H=Ft((await N()).errors),p()):H=await L({fields:n,onlyCheckValid:!0,eventType:ys.VALID}),H!==r.isValid&&v.state.next({isValid:H})}},p=(I,H)=>{!t.disabled&&(d.isValidating||d.validatingFields||x.isValidating||x.validatingFields)&&((I||Array.from(a.mount)).forEach(q=>{q&&(H?ze(r.validatingFields,q,H):vt(r.validatingFields,q))}),v.state.next({validatingFields:r.validatingFields,isValidating:!Ft(r.validatingFields)}))},f=()=>{r.dirtyFields=uo(s,i)},g=(I,H=[],q,re,se=!0,te=!0)=>{if(re&&q&&!t.disabled){if(l.action=!0,te&&Array.isArray(ae(n,I))){const le=q(ae(n,I),re.argA,re.argB);se&&ze(n,I,le)}if(te&&Array.isArray(ae(r.errors,I))){const le=q(ae(r.errors,I),re.argA,re.argB);se&&ze(r.errors,I,le),vB(r.errors,I)}if((d.touchedFields||x.touchedFields)&&te&&Array.isArray(ae(r.touchedFields,I))){const le=q(ae(r.touchedFields,I),re.argA,re.argB);se&&ze(r.touchedFields,I,le)}(d.dirtyFields||x.dirtyFields)&&f(),v.state.next({name:I,isDirty:U(I,H),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ze(i,I,H)},b=(I,H)=>{ze(r.errors,I,H),v.state.next({errors:r.errors})},w=I=>{r.errors=I,v.state.next({errors:r.errors,isValid:!1})},k=I=>{const H=ic(I)?[I]:$d(I);let q=i,re=s;for(let se=0;se<H.length-1;se++){const te=H[se];if(q=At(q)?q:q[te],re=At(re)?re:re[te],q===null&&re!==null)return!0}return!1},j=(I,H,q,re)=>{const se=ae(n,I);if(se){if(k(I))return;const te=rt(ae(i,I)),le=ae(i,I,rt(q)?ae(s,I):q);rt(le)||re&&re.defaultChecked||H?ze(i,I,H?le:u_(se._f)):R(I,le),l.mount&&!l.action&&(h(),te&&r.isDirty&&(d.isDirty||x.isDirty)&&(U()||(r.isDirty=!1,v.state.next({...r}))))}},S=(I,H,q,re,se)=>{let te=!1,le=!1;const he={name:I};if(!t.disabled){if(!q||re){(d.isDirty||x.isDirty)&&(le=r.isDirty,r.isDirty=he.isDirty=U(),te=le!==he.isDirty);const Re=xr(ae(s,I),H);le=!!ae(r.dirtyFields,I),Re!==r.isDirty?r.dirtyFields=uo(s,i):Re?vt(r.dirtyFields,I):ze(r.dirtyFields,I,!0),he.dirtyFields=r.dirtyFields,te=te||(d.dirtyFields||x.dirtyFields)&&le!==!Re}if(q){const Re=ae(r.touchedFields,I);Re||(ze(r.touchedFields,I,q),he.touchedFields=r.touchedFields,te=te||(d.touchedFields||x.touchedFields)&&Re!==q)}te&&se&&v.state.next(he)}return te?he:{}},E=(I,H,q,re)=>{const se=ae(r.errors,I),te=(d.isValid||x.isValid)&&vr(H)&&r.isValid!==H;if(t.delayError&&q?(c=y(()=>b(I,q)),c(t.delayError)):(clearTimeout(u),c=null,q?ze(r.errors,I,q):vt(r.errors,I)),(q?!xr(se,q):se)||!Ft(re)||te){const le={...re,...te&&vr(H)?{isValid:H}:{},errors:r.errors,name:I};r={...r,...le},v.state.next(le)}},N=async I=>(p(I,!0),await t.resolver(i,t.context,dB(I||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),O=async I=>{const{errors:H}=await N(I);if(p(I),I)for(const q of I){const re=ae(H,q);re?a.array.has(q)&<(re)?m_(r.errors,{[q]:re},q):ze(r.errors,q,re):vt(r.errors,q)}else r.errors=H;return H},T=async({name:I,eventType:H})=>{if(e.validate){const q=await e.validate({formValues:i,formState:r,name:I,eventType:H});if(lt(q))for(const re in q){const se=q[re];se&&B(`${Bh}.${re}`,{message:Ut(se.message)?se.message:"",type:se.type||Zr.validate})}else Ut(q)||!q?B(Bh,{message:q||"",type:Zr.validate}):A(Bh);return q}return!0},L=async({fields:I,onlyCheckValid:H,name:q,eventType:re,context:se={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(se.runRootValidation=!0,!await T({name:q,eventType:re})&&(se.valid=!1,H)))return se.valid;for(const te in I){const le=I[te];if(le){const{_f:he,...Re}=le;if(he){const Je=a.array.has(he.name),Vt=le._f&&hB(le._f),kt=d.validatingFields||d.isValidating||x.validatingFields||x.isValidating;Vt&&kt&&p([he.name],!0);const In=await v_(le,a.disabled,i,_,t.shouldUseNativeValidation&&!H,Je);if(Vt&&kt&&p([he.name]),In[he.name]&&(se.valid=!1,H)||(!H&&(ae(In,he.name)?Je?m_(r.errors,In,he.name):ze(r.errors,he.name,In[he.name]):vt(r.errors,he.name)),e.shouldUseNativeValidation&&In[he.name]))break}!Ft(Re)&&await L({context:se,onlyCheckValid:H,fields:Re,name:te,eventType:re})}}return se.valid},$=()=>{for(const I of a.unMount){const H=ae(n,I);H&&(H._f.refs?H._f.refs.every(q=>!$h(q)):!$h(H._f.ref))&&Q(I)}a.unMount=new Set},U=(I,H)=>!t.disabled&&(I&&H&&ze(i,I,H),!xr(X(),s)),z=(I,H,q)=>kp(I,a,{...l.mount?i:rt(H)?s:Ut(I)?{[I]:H}:H},q,H),K=I=>Gg(ae(l.mount?i:s,I,t.shouldUnregister?ae(s,I,[]):[])),R=(I,H,q={})=>{const re=ae(n,I);let se=H;if(re){const te=re._f;te&&(!te.disabled&&ze(i,I,sE(H,te)),se=Wu(te.ref)&&At(H)?"":H,tE(te.ref)?[...te.ref.options].forEach(le=>le.selected=se.includes(le.value)):te.refs?sc(te.ref)?te.refs.forEach(le=>{(!le.defaultChecked||!le.disabled)&&(Array.isArray(se)?le.checked=!!se.find(he=>he===le.value):le.checked=se===le.value||!!se)}):te.refs.forEach(le=>le.checked=le.value===se):Jg(te.ref)?te.ref.value="":(te.ref.value=se,te.ref.type||v.state.next({name:I,values:pt(i)})))}(q.shouldDirty||q.shouldTouch)&&S(I,se,q.shouldTouch,q.shouldDirty,!0),q.shouldValidate&&J(I)},P=(I,H,q)=>{for(const re in H){if(!H.hasOwnProperty(re))return;const se=H[re],te=I+"."+re,le=ae(n,te);(a.array.has(I)||lt(se)||le&&!le._f)&&!_i(se)?P(te,se,q):R(te,se,q)}},D=(I,H,q={})=>{const re=ae(n,I),se=a.array.has(I),te=pt(H),le=ae(i,I),he=xr(le,te);if(he||ze(i,I,te),se)v.array.next({name:I,values:pt(i)}),(d.isDirty||d.dirtyFields||x.isDirty||x.dirtyFields)&&q.shouldDirty&&(f(),v.state.next({name:I,dirtyFields:r.dirtyFields,isDirty:U(I,te)}));else{const Re=Array.isArray(te)&&!te.length||Ft(te);!re||re._f||At(te)||Re?R(I,te,q):P(I,te,q)}if(!he){const Re=f_(I,a),Je=pt(i);if(!se)for(const Vt of Cp(a.array,I))v.array.next({name:Vt,values:Je});v.state.next({...Re&&r,name:l.mount||Re?I:void 0,values:Je})}},M=I=>{const H=$t(I)?I(i):I;if(!xr(i,H)){i={...i,...H};for(const q of a.mount)D(q,ae(H,q));v.state.next({...r,values:i})}},V=async I=>{l.mount=!0;const H=I.target;let q=H.name,re=!0;const se=ae(n,q),te=Re=>{re=Number.isNaN(Re)||_i(Re)&&isNaN(Re.getTime())||xr(Re,ae(i,q,Re))},le=d_(t.mode),he=d_(t.reValidateMode);if(se){let Re,Je;const Vt=H.type?u_(se._f):Yk(I),kt=I.type===ys.BLUR||I.type===ys.FOCUS_OUT,In=!fB(se._f)&&!e.validate&&!t.resolver&&!ae(r.errors,q)&&!se._f.deps||gB(kt,ae(r.touchedFields,q),r.isSubmitted,he,le),Ea=f_(q,a,kt);ze(i,q,Vt),kt?(!H||!H.readOnly)&&(se._f.onBlur&&se._f.onBlur(I),c&&c(0)):se._f.onChange&&se._f.onChange(I);const Zi=S(q,Vt,kt),oc=!Ft(Zi)||Ea;if(!kt&&v.state.next({name:q,type:I.type,values:pt(i)}),In)return(d.isValid||x.isValid)&&(t.mode==="onBlur"?kt&&h():kt||h()),oc&&v.state.next({name:q,...Ea?{}:Zi});if(!t.resolver&&e.validate&&await T({name:q,eventType:I.type}),!kt&&Ea&&v.state.next({...r}),t.resolver){const{errors:ac}=await N([q]);if(p([q]),te(Vt),re){const ja=p_(r.errors,n,q),Vr=p_(ac,n,ja.name||q);Re=Vr.error,q=Vr.name,Je=Ft(ac)}}else p([q],!0),Re=(await v_(se,a.disabled,i,_,t.shouldUseNativeValidation))[q],p([q]),te(Vt),re&&(Re?Je=!1:(d.isValid||x.isValid)&&(Je=await L({fields:n,onlyCheckValid:!0,name:q,eventType:I.type})));re&&(se._f.deps&&(!Array.isArray(se._f.deps)||se._f.deps.length>0)&&J(se._f.deps),E(q,Je,Re,Zi))}},W=(I,H)=>{if(ae(r.errors,H)&&I.focus)return I.focus(),1},J=async(I,H={})=>{let q,re;const se=cl(I);if(t.resolver){const te=await O(rt(I)?I:se);q=Ft(te),re=I?!se.some(le=>ae(te,le)):q}else I?(re=(await Promise.all(se.map(async te=>{const le=ae(n,te);return await L({fields:le&&le._f?{[te]:le}:le,eventType:ys.TRIGGER})}))).every(Boolean),!(!re&&!r.isValid)&&h()):re=q=await L({fields:n,name:I,eventType:ys.TRIGGER});return v.state.next({...!Ut(I)||(d.isValid||x.isValid)&&q!==r.isValid?{}:{name:I},...t.resolver||!I?{isValid:q}:{},errors:r.errors}),H.shouldFocus&&!re&&ul(n,W,I?se:a.mount),re},X=(I,H)=>{let q={...l.mount?i:s};return H&&(q=eE(H.dirtyFields?r.dirtyFields:r.touchedFields,q)),rt(I)?q:Ut(I)?ae(q,I):I.map(re=>ae(q,re))},fe=(I,H)=>({invalid:!!ae((H||r).errors,I),isDirty:!!ae((H||r).dirtyFields,I),error:ae((H||r).errors,I),isValidating:!!ae(r.validatingFields,I),isTouched:!!ae((H||r).touchedFields,I)}),A=I=>{const H=I?cl(I):void 0;H==null||H.forEach(q=>vt(r.errors,q)),H?H.forEach(q=>{v.state.next({name:q,errors:r.errors})}):v.state.next({errors:{}})},B=(I,H,q)=>{const re=(ae(n,I,{_f:{}})._f||{}).ref,se=ae(r.errors,I)||{},{ref:te,message:le,type:he,...Re}=se;ze(r.errors,I,{...Re,...H,ref:re}),v.state.next({name:I,errors:r.errors,isValid:!1}),q&&q.shouldFocus&&re&&re.focus&&re.focus()},G=(I,H)=>$t(I)?v.state.subscribe({next:q=>"values"in q&&I(q.values||z(void 0,H),q)}):z(I,H,!0),Y=I=>v.state.subscribe({next:H=>{if(mB(I.name,H.name,I.exact)&&pB(H,I.formState||d,Mn,I.reRenderRoot)){const q={...i};I.callback({values:q,...r,...H,defaultValues:s})}}}).unsubscribe,ce=I=>(l.mount=!0,x={...x,...I.formState},Y({...I,formState:{...m,...I.formState}})),Q=(I,H={})=>{for(const q of I?cl(I):a.mount)a.mount.delete(q),a.array.delete(q),H.keepValue||(vt(n,q),vt(i,q)),!H.keepError&&vt(r.errors,q),!H.keepDirty&&vt(r.dirtyFields,q),!H.keepTouched&&vt(r.touchedFields,q),!H.keepIsValidating&&vt(r.validatingFields,q),!t.shouldUnregister&&!H.keepDefaultValue&&vt(s,q);v.state.next({values:pt(i)}),v.state.next({...r,...H.keepDirty?{isDirty:U()}:{}}),!H.keepIsValid&&h()},ge=({disabled:I,name:H})=>{if(vr(I)&&l.mount||I||a.disabled.has(H)){const se=a.disabled.has(H)!==!!I;I?a.disabled.add(H):a.disabled.delete(H),se&&l.mount&&!l.action&&h()}},De=(I,H={})=>{let q=ae(n,I);const re=vr(H.disabled)||vr(t.disabled),se=!a.registerName.has(I)&&q&&q._f&&!q._f.mount;return ze(n,I,{...q||{},_f:{...q&&q._f?q._f:{ref:{name:I}},name:I,mount:!0,...H}}),a.mount.add(I),q&&!se?ge({disabled:vr(H.disabled)?H.disabled:t.disabled,name:I}):j(I,!0,H.value),{...re?{disabled:H.disabled||t.disabled}:{},...t.progressive?{required:!!H.required,min:za(H.min),max:za(H.max),minLength:za(H.minLength),maxLength:za(H.maxLength),pattern:za(H.pattern)}:{},name:I,onChange:V,onBlur:V,ref:te=>{if(te){a.registerName.add(I),De(I,H),a.registerName.delete(I),q=ae(n,I);const le=rt(te.value)&&te.querySelectorAll&&te.querySelectorAll("input,select,textarea")[0]||te,he=aB(le),Re=q._f.refs||[];if(he?Re.find(Je=>Je===le):le===q._f.ref)return;ze(n,I,{_f:{...q._f,...he?{refs:[...Re.filter($h),le,...Array.isArray(ae(s,I))?[{}]:[]],ref:{type:le.type,name:I}}:{ref:le}}}),j(I,!1,void 0,le)}else q=ae(n,I,{}),q._f&&(q._f.mount=!1),(t.shouldUnregister||H.shouldUnregister)&&!(Cp(a.array,I).length&&l.action)&&a.unMount.add(I)}}},Ue=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&ul(n,W,a.mount),Ct=I=>{vr(I)&&(v.state.next({disabled:I}),ul(n,(H,q)=>{const re=ae(n,q);re&&(H.disabled=re._f.disabled||I,Array.isArray(re._f.refs)&&re._f.refs.forEach(se=>{se.disabled=re._f.disabled||I}))},0,!1))},Ce=(I,H)=>async q=>{let re;q&&(q.preventDefault&&q.preventDefault(),q.persist&&q.persist());let se=pt(i);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:te,values:le}=await N();p(),r.errors=te,se=pt(le)}else await L({fields:n,eventType:ys.SUBMIT});if(a.disabled.size)for(const te of a.disabled)vt(se,te);if(vt(r.errors,Zk),Ft(r.errors)){v.state.next({errors:{}});try{await I(se,q)}catch(te){re=te}}else H&&await H({...r.errors},q),Ue(),setTimeout(Ue);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ft(r.errors)&&!re,submitCount:r.submitCount+1,errors:r.errors}),re)throw re},dr=(I,H={})=>{ae(n,I)&&(rt(H.defaultValue)?D(I,pt(ae(s,I))):(D(I,H.defaultValue),ze(s,I,pt(H.defaultValue))),H.keepTouched||vt(r.touchedFields,I),H.keepDirty||(vt(r.dirtyFields,I),r.isDirty=H.defaultValue?U(I,pt(ae(s,I))):U()),H.keepError||(vt(r.errors,I),d.isValid&&h()),v.state.next({...r}))},hr=(I,H={})=>{const q=I?pt(I):s,re=pt(q),se=Ft(I),te=se?s:re;if(H.keepDefaultValues||(s=q),!H.keepValues){if(H.keepDirtyValues){const le=new Set([...a.mount,...Object.keys(uo(s,i))]);for(const he of Array.from(le)){const Re=ae(r.dirtyFields,he),Je=ae(i,he),Vt=ae(te,he);Re&&!rt(Je)?ze(te,he,Je):!Re&&!rt(Vt)&&D(he,Vt)}}else{if(Kg&&rt(I))for(const le of a.mount){const he=ae(n,le);if(he&&he._f){const Re=Array.isArray(he._f.refs)?he._f.refs[0]:he._f.ref;if(Wu(Re)){const Je=Re.closest("form");if(Je){Je.reset();break}}}}if(H.keepFieldsRef)for(const le of a.mount)D(le,ae(te,le));else n={}}i=t.shouldUnregister?H.keepDefaultValues?pt(s):{}:pt(te),v.array.next({values:{...te}}),v.state.next({values:{...te}})}a={mount:H.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!d.isValid||!!H.keepIsValid||!!H.keepDirtyValues||!t.shouldUnregister&&!Ft(te),l.watch=!!t.shouldUnregister,l.keepIsValid=!!H.keepIsValid,l.action=!1,H.keepErrors||(r.errors={}),v.state.next({submitCount:H.keepSubmitCount?r.submitCount:0,isDirty:se?!1:H.keepDirty?r.isDirty:!!(H.keepDefaultValues&&!xr(I,s)),isSubmitted:H.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:se?{}:H.keepDirtyValues?H.keepDefaultValues&&i?uo(s,i):r.dirtyFields:H.keepDefaultValues&&I?uo(s,I):H.keepDirty?r.dirtyFields:{},touchedFields:H.keepTouched?r.touchedFields:{},errors:H.keepErrors?r.errors:{},isSubmitSuccessful:H.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},On=(I,H)=>hr($t(I)?I(i):I,{...t.resetOptions,...H}),Wr=(I,H={})=>{const q=ae(n,I),re=q&&q._f;if(re){const se=re.refs?re.refs[0]:re.ref;se.focus&&setTimeout(()=>{se.focus(),H.shouldSelect&&$t(se.select)&&se.select()})}},Mn=I=>{r={...r,...I}},xn={control:{register:De,unregister:Q,getFieldState:fe,handleSubmit:Ce,setError:B,_subscribe:Y,_runSchema:N,_updateIsValidating:p,_focusError:Ue,_getWatch:z,_getDirty:U,_setValid:h,_setFieldArray:g,_setDisabledField:ge,_setErrors:w,_getFieldArray:K,_reset:hr,_resetDefaultValues:()=>$t(t.defaultValues)&&t.defaultValues().then(I=>{On(I,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:$,_disableForm:Ct,_subjects:v,_proxyFormState:d,get _fields(){return n},get _formValues(){return i},get _state(){return l},set _state(I){l=I},get _defaultValues(){return s},get _names(){return a},set _names(I){a=I},get _formState(){return r},get _options(){return t},set _options(I){t={...t,...I}}},subscribe:ce,trigger:J,register:De,handleSubmit:Ce,watch:G,setValue:D,setValues:M,getValues:X,reset:On,resetField:dr,clearErrors:A,unregister:Q,setError:B,setFocus:Wr,getFieldState:fe};return{...xn,formControl:xn}}function _B(e={}){const t=Z.useRef(void 0),r=Z.useRef(void 0),[n,s]=Z.useState(()=>({...pt(oE),isLoading:$t(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:$t(e.defaultValues)?void 0:e.defaultValues}));if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!$t(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...a}=yB(e);t.current={...a,formState:n}}const i=t.current.control;return i._options=e,Zg(()=>{const l=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState,defaultValues:i._defaultValues}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),i._formState.isReady=!0,l},[i]),Z.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),Z.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),Z.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),Z.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),Z.useEffect(()=>{if(i._proxyFormState.isDirty){const l=i._getDirty();l!==n.isDirty&&i._subjects.state.next({isDirty:l})}},[i,n.isDirty]),Z.useEffect(()=>{var l;e.values&&!xr(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((l=i._options.resetOptions)===null||l===void 0)&&l.keepIsValid||i._setValid(),r.current=e.values,s(a=>({...a}))):i._resetDefaultValues()},[i,e.values]),Z.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=Z.useMemo(()=>Xk(n,i),[i,n]),t.current}const x_=(e,t,r)=>{if(e&&"reportValidity"in e){const n=ae(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},aE=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?x_(n.ref,r,e):n.refs&&n.refs.forEach(s=>x_(s,r,e))}},bB=(e,t)=>{t.shouldUseNativeValidation&&aE(e,t);const r={};for(const n in e){const s=ae(t.fields,n),i=Object.assign(e[n]||{},{ref:s&&s.ref});if(wB(t.names||Object.keys(e),n)){const l=Object.assign({},ae(r,n));ze(l,"root",i),ze(r,n,l)}else ze(r,n,i)}return r},wB=(e,t)=>e.some(r=>r.startsWith(t+"."));var SB=function(e,t){for(var r={};e.length;){var n=e[0],s=n.code,i=n.message,l=n.path.join(".");if(!r[l])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[l]={message:a.message,type:a.code}}else r[l]={message:i,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(m){return m.errors.forEach(function(d){return e.push(d)})}),t){var c=r[l].types,u=c&&c[n.code];r[l]=Jk(l,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r},CB=function(e,t,r){return r===void 0&&(r={}),function(n,s,i){try{return Promise.resolve(function(l,a){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return i.shouldUseNativeValidation&&aE({},i),{errors:{},values:r.raw?n:u}})}catch(u){return a(u)}return c&&c.then?c.then(void 0,a):c}(0,function(l){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(l))return{values:{},errors:bB(SB(l.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw l}))}catch(l){return Promise.reject(l)}}},Fe;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{const i={};for(const l of s)i[l]=l;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),l={};for(const a of i)l[a]=s[a];return e.objectValues(l)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const l in s)Object.prototype.hasOwnProperty.call(s,l)&&i.push(l);return i},e.find=(s,i)=>{for(const l of s)if(i(l))return l},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Fe||(Fe={}));var y_;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(y_||(y_={}));const ve=Fe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_s=e=>{switch(typeof e){case"undefined":return ve.undefined;case"string":return ve.string;case"number":return Number.isNaN(e)?ve.nan:ve.number;case"boolean":return ve.boolean;case"function":return ve.function;case"bigint":return ve.bigint;case"symbol":return ve.symbol;case"object":return Array.isArray(e)?ve.array:e===null?ve.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ve.promise:typeof Map<"u"&&e instanceof Map?ve.map:typeof Set<"u"&&e instanceof Set?ve.set:typeof Date<"u"&&e instanceof Date?ve.date:ve.object;default:return ve.unknown}},oe=Fe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ss extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},n={_errors:[]},s=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(s);else if(l.code==="invalid_return_type")s(l.returnTypeError);else if(l.code==="invalid_arguments")s(l.argumentsError);else if(l.path.length===0)n._errors.push(r(l));else{let a=n,c=0;for(;c<l.path.length;){const u=l.path[c];c===l.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(l))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return s(this),n}static assert(t){if(!(t instanceof ss))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Fe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];r[i]=r[i]||[],r[i].push(t(s))}else n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}ss.create=e=>new ss(e);const Np=(e,t)=>{let r;switch(e.code){case oe.invalid_type:e.received===ve.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case oe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Fe.jsonStringifyReplacer)}`;break;case oe.unrecognized_keys:r=`Unrecognized key(s) in object: ${Fe.joinValues(e.keys,", ")}`;break;case oe.invalid_union:r="Invalid input";break;case oe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Fe.joinValues(e.options)}`;break;case oe.invalid_enum_value:r=`Invalid enum value. Expected ${Fe.joinValues(e.options)}, received '${e.received}'`;break;case oe.invalid_arguments:r="Invalid function arguments";break;case oe.invalid_return_type:r="Invalid function return type";break;case oe.invalid_date:r="Invalid date";break;case oe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Fe.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case oe.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case oe.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case oe.custom:r="Invalid input";break;case oe.invalid_intersection_types:r="Intersection results could not be merged";break;case oe.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case oe.not_finite:r="Number must be finite";break;default:r=t.defaultError,Fe.assertNever(e)}return{message:r}};let kB=Np;function EB(){return kB}const jB=e=>{const{data:t,path:r,errorMaps:n,issueData:s}=e,i=[...r,...s.path||[]],l={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)a=u(l,{data:t,defaultError:a}).message;return{...s,path:i,message:a}};function de(e,t){const r=EB(),n=jB({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Np?void 0:Np].filter(s=>!!s)});e.common.issues.push(n)}class jr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const s of r){if(s.status==="aborted")return ke;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const s of r){const i=await s.key,l=await s.value;n.push({key:i,value:l})}return jr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const s of r){const{key:i,value:l}=s;if(i.status==="aborted"||l.status==="aborted")return ke;i.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||s.alwaysSet)&&(n[i.value]=l.value)}return{status:t.value,value:n}}}const ke=Object.freeze({status:"aborted"}),Xa=e=>({status:"dirty",value:e}),zr=e=>({status:"valid",value:e}),__=e=>e.status==="aborted",b_=e=>e.status==="dirty",da=e=>e.status==="valid",qu=e=>typeof Promise<"u"&&e instanceof Promise;var xe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(xe||(xe={}));class ei{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const w_=(e,t)=>{if(da(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new ss(e.common.issues);return this._error=r,this._error}}};function Ae(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(l,a)=>{const{message:c}=e;return l.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:l.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:s}}class Ie{get description(){return this._def.description}_getType(t){return _s(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:_s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new jr,ctx:{common:t.parent.common,data:t.data,parsedType:_s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(qu(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_s(t)},s=this._parseSync({data:t,path:n.path,parent:n});return w_(n,s)}"~validate"(t){var n,s;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_s(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:r});return da(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(s=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>da(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_s(t)},s=this._parse({data:t,path:n.path,parent:n}),i=await(qu(s)?s:Promise.resolve(s));return w_(n,i)}refine(t,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{const l=t(s),a=()=>i.addIssue({code:oe.custom,...n(s)});return typeof Promise<"u"&&l instanceof Promise?l.then(c=>c?!0:(a(),!1)):l?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new fa({schema:this,typeName:Ee.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Gs.create(this,this._def)}nullable(){return pa.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Tn.create(this)}promise(){return Yu.create(this,this._def)}or(t){return Gu.create([this,t],this._def)}and(t){return Qu.create(this,t,this._def)}transform(t){return new fa({...Ae(this._def),schema:this,typeName:Ee.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Tp({...Ae(this._def),innerType:this,defaultValue:r,typeName:Ee.ZodDefault})}brand(){return new YB({typeName:Ee.ZodBranded,type:this,...Ae(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Ap({...Ae(this._def),innerType:this,catchValue:r,typeName:Ee.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return tv.create(this,t)}readonly(){return Dp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const RB=/^c[^\s-]{8,}$/i,NB=/^[0-9a-z]+$/,PB=/^[0-9A-HJKMNP-TV-Z]{26}$/i,TB=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,AB=/^[a-z0-9_-]{21}$/i,DB=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,LB=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,OB=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,MB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Hh;const IB=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,FB=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,BB=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,$B=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,HB=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,UB=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,lE="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",zB=new RegExp(`^${lE}$`);function cE(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function WB(e){return new RegExp(`^${cE(e)}$`)}function VB(e){let t=`${lE}T${cE(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function qB(e,t){return!!((t==="v4"||!t)&&IB.test(e)||(t==="v6"||!t)&&BB.test(e))}function KB(e,t){if(!DB.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function GB(e,t){return!!((t==="v4"||!t)&&FB.test(e)||(t==="v6"||!t)&&$B.test(e))}class Os extends Ie{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ve.string){const i=this._getOrReturnCtx(t);return de(i,{code:oe.invalid_type,expected:ve.string,received:i.parsedType}),ke}const n=new jr;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),de(s,{code:oe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(s=this._getOrReturnCtx(t,s),de(s,{code:oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const l=t.data.length>i.value,a=t.data.length<i.value;(l||a)&&(s=this._getOrReturnCtx(t,s),l?de(s,{code:oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&de(s,{code:oe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")OB.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"email",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Hh||(Hh=new RegExp(MB,"u")),Hh.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"emoji",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")TB.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"uuid",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")AB.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"nanoid",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")RB.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"cuid",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")NB.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"cuid2",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")PB.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"ulid",code:oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),de(s,{validation:"url",code:oe.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"regex",code:oe.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(t,s),de(s,{code:oe.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(s=this._getOrReturnCtx(t,s),de(s,{code:oe.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),de(s,{code:oe.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?VB(i).test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{code:oe.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?zB.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{code:oe.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?WB(i).test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{code:oe.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?LB.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"duration",code:oe.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?qB(t.data,i.version)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"ip",code:oe.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?KB(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"jwt",code:oe.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?GB(t.data,i.version)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"cidr",code:oe.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?HB.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"base64",code:oe.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?UB.test(t.data)||(s=this._getOrReturnCtx(t,s),de(s,{validation:"base64url",code:oe.invalid_string,message:i.message}),n.dirty()):Fe.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:oe.invalid_string,...xe.errToObj(n)})}_addCheck(t){return new Os({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...xe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...xe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...xe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...xe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...xe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...xe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...xe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...xe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...xe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...xe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...xe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...xe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...xe.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...xe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...xe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...xe.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...xe.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...xe.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...xe.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...xe.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...xe.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...xe.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...xe.errToObj(r)})}nonempty(t){return this.min(1,xe.errToObj(t))}trim(){return new Os({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Os({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Os({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Os.create=e=>new Os({checks:[],typeName:Ee.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Ae(e)});function QB(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,i=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return i%l/10**s}class Ol extends Ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ve.number){const i=this._getOrReturnCtx(t);return de(i,{code:oe.invalid_type,expected:ve.number,received:i.parsedType}),ke}let n;const s=new jr;for(const i of this._def.checks)i.kind==="int"?Fe.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),de(n,{code:oe.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),de(n,{code:oe.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),de(n,{code:oe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?QB(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),de(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),de(n,{code:oe.not_finite,message:i.message}),s.dirty()):Fe.assertNever(i);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,xe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,xe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,xe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,xe.toString(r))}setLimit(t,r,n,s){return new Ol({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:xe.toString(s)}]})}_addCheck(t){return new Ol({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:xe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:xe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:xe.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:xe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:xe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:xe.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Fe.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}Ol.create=e=>new Ol({checks:[],typeName:Ee.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ae(e)});class Ml extends Ie{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ve.bigint)return this._getInvalidInput(t);let n;const s=new jr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),de(n,{code:oe.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),de(n,{code:oe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),de(n,{code:oe.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Fe.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return de(r,{code:oe.invalid_type,expected:ve.bigint,received:r.parsedType}),ke}gte(t,r){return this.setLimit("min",t,!0,xe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,xe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,xe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,xe.toString(r))}setLimit(t,r,n,s){return new Ml({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:xe.toString(s)}]})}_addCheck(t){return new Ml({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:xe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:xe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:xe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:xe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:xe.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Ml.create=e=>new Ml({checks:[],typeName:Ee.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Ae(e)});class S_ extends Ie{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ve.boolean){const n=this._getOrReturnCtx(t);return de(n,{code:oe.invalid_type,expected:ve.boolean,received:n.parsedType}),ke}return zr(t.data)}}S_.create=e=>new S_({typeName:Ee.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ae(e)});class Ku extends Ie{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ve.date){const i=this._getOrReturnCtx(t);return de(i,{code:oe.invalid_type,expected:ve.date,received:i.parsedType}),ke}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return de(i,{code:oe.invalid_date}),ke}const n=new jr;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),de(s,{code:oe.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(s=this._getOrReturnCtx(t,s),de(s,{code:oe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Fe.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ku({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:xe.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:xe.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}Ku.create=e=>new Ku({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ee.ZodDate,...Ae(e)});class C_ extends Ie{_parse(t){if(this._getType(t)!==ve.symbol){const n=this._getOrReturnCtx(t);return de(n,{code:oe.invalid_type,expected:ve.symbol,received:n.parsedType}),ke}return zr(t.data)}}C_.create=e=>new C_({typeName:Ee.ZodSymbol,...Ae(e)});class k_ extends Ie{_parse(t){if(this._getType(t)!==ve.undefined){const n=this._getOrReturnCtx(t);return de(n,{code:oe.invalid_type,expected:ve.undefined,received:n.parsedType}),ke}return zr(t.data)}}k_.create=e=>new k_({typeName:Ee.ZodUndefined,...Ae(e)});class E_ extends Ie{_parse(t){if(this._getType(t)!==ve.null){const n=this._getOrReturnCtx(t);return de(n,{code:oe.invalid_type,expected:ve.null,received:n.parsedType}),ke}return zr(t.data)}}E_.create=e=>new E_({typeName:Ee.ZodNull,...Ae(e)});class j_ extends Ie{constructor(){super(...arguments),this._any=!0}_parse(t){return zr(t.data)}}j_.create=e=>new j_({typeName:Ee.ZodAny,...Ae(e)});class R_ extends Ie{constructor(){super(...arguments),this._unknown=!0}_parse(t){return zr(t.data)}}R_.create=e=>new R_({typeName:Ee.ZodUnknown,...Ae(e)});class ti extends Ie{_parse(t){const r=this._getOrReturnCtx(t);return de(r,{code:oe.invalid_type,expected:ve.never,received:r.parsedType}),ke}}ti.create=e=>new ti({typeName:Ee.ZodNever,...Ae(e)});class N_ extends Ie{_parse(t){if(this._getType(t)!==ve.undefined){const n=this._getOrReturnCtx(t);return de(n,{code:oe.invalid_type,expected:ve.void,received:n.parsedType}),ke}return zr(t.data)}}N_.create=e=>new N_({typeName:Ee.ZodVoid,...Ae(e)});class Tn extends Ie{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==ve.array)return de(r,{code:oe.invalid_type,expected:ve.array,received:r.parsedType}),ke;if(s.exactLength!==null){const l=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(l||a)&&(de(r,{code:l?oe.too_big:oe.too_small,minimum:a?s.exactLength.value:void 0,maximum:l?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(de(r,{code:oe.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(de(r,{code:oe.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((l,a)=>s.type._parseAsync(new ei(r,l,r.path,a)))).then(l=>jr.mergeArray(n,l));const i=[...r.data].map((l,a)=>s.type._parseSync(new ei(r,l,r.path,a)));return jr.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new Tn({...this._def,minLength:{value:t,message:xe.toString(r)}})}max(t,r){return new Tn({...this._def,maxLength:{value:t,message:xe.toString(r)}})}length(t,r){return new Tn({...this._def,exactLength:{value:t,message:xe.toString(r)}})}nonempty(t){return this.min(1,t)}}Tn.create=(e,t)=>new Tn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ee.ZodArray,...Ae(t)});function ho(e){if(e instanceof xt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Gs.create(ho(n))}return new xt({...e._def,shape:()=>t})}else return e instanceof Tn?new Tn({...e._def,type:ho(e.element)}):e instanceof Gs?Gs.create(ho(e.unwrap())):e instanceof pa?pa.create(ho(e.unwrap())):e instanceof $i?$i.create(e.items.map(t=>ho(t))):e}class xt extends Ie{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=Fe.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==ve.object){const u=this._getOrReturnCtx(t);return de(u,{code:oe.invalid_type,expected:ve.object,received:u.parsedType}),ke}const{status:n,ctx:s}=this._processInputParams(t),{shape:i,keys:l}=this._getCached(),a=[];if(!(this._def.catchall instanceof ti&&this._def.unknownKeys==="strip"))for(const u in s.data)l.includes(u)||a.push(u);const c=[];for(const u of l){const m=i[u],d=s.data[u];c.push({key:{status:"valid",value:u},value:m._parse(new ei(s,d,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof ti){const u=this._def.unknownKeys;if(u==="passthrough")for(const m of a)c.push({key:{status:"valid",value:m},value:{status:"valid",value:s.data[m]}});else if(u==="strict")a.length>0&&(de(s,{code:oe.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const m of a){const d=s.data[m];c.push({key:{status:"valid",value:m},value:u._parse(new ei(s,d,s.path,m)),alwaysSet:m in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const m of c){const d=await m.key,x=await m.value;u.push({key:d,value:x,alwaysSet:m.alwaysSet})}return u}).then(u=>jr.mergeObjectSync(n,u)):jr.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return xe.errToObj,new xt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,l;const s=((l=(i=this._def).errorMap)==null?void 0:l.call(i,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:xe.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new xt({...this._def,unknownKeys:"strip"})}passthrough(){return new xt({...this._def,unknownKeys:"passthrough"})}extend(t){return new xt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new xt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ee.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new xt({...this._def,catchall:t})}pick(t){const r={};for(const n of Fe.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new xt({...this._def,shape:()=>r})}omit(t){const r={};for(const n of Fe.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new xt({...this._def,shape:()=>r})}deepPartial(){return ho(this)}partial(t){const r={};for(const n of Fe.objectKeys(this.shape)){const s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}return new xt({...this._def,shape:()=>r})}required(t){const r={};for(const n of Fe.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Gs;)i=i._def.innerType;r[n]=i}return new xt({...this._def,shape:()=>r})}keyof(){return uE(Fe.objectKeys(this.shape))}}xt.create=(e,t)=>new xt({shape:()=>e,unknownKeys:"strip",catchall:ti.create(),typeName:Ee.ZodObject,...Ae(t)});xt.strictCreate=(e,t)=>new xt({shape:()=>e,unknownKeys:"strict",catchall:ti.create(),typeName:Ee.ZodObject,...Ae(t)});xt.lazycreate=(e,t)=>new xt({shape:e,unknownKeys:"strip",catchall:ti.create(),typeName:Ee.ZodObject,...Ae(t)});class Gu extends Ie{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function s(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const l=i.map(a=>new ss(a.ctx.common.issues));return de(r,{code:oe.invalid_union,unionErrors:l}),ke}if(r.common.async)return Promise.all(n.map(async i=>{const l={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(s);{let i;const l=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},m=c._parseSync({data:r.data,path:r.path,parent:u});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const a=l.map(c=>new ss(c));return de(r,{code:oe.invalid_union,unionErrors:a}),ke}}get options(){return this._def.options}}Gu.create=(e,t)=>new Gu({options:e,typeName:Ee.ZodUnion,...Ae(t)});function Pp(e,t){const r=_s(e),n=_s(t);if(e===t)return{valid:!0,data:e};if(r===ve.object&&n===ve.object){const s=Fe.objectKeys(t),i=Fe.objectKeys(e).filter(a=>s.indexOf(a)!==-1),l={...e,...t};for(const a of i){const c=Pp(e[a],t[a]);if(!c.valid)return{valid:!1};l[a]=c.data}return{valid:!0,data:l}}else if(r===ve.array&&n===ve.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const l=e[i],a=t[i],c=Pp(l,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===ve.date&&n===ve.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Qu extends Ie{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=(i,l)=>{if(__(i)||__(l))return ke;const a=Pp(i.value,l.value);return a.valid?((b_(i)||b_(l))&&r.dirty(),{status:r.value,value:a.data}):(de(n,{code:oe.invalid_intersection_types}),ke)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,l])=>s(i,l)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Qu.create=(e,t,r)=>new Qu({left:e,right:t,typeName:Ee.ZodIntersection,...Ae(r)});class $i extends Ie{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ve.array)return de(n,{code:oe.invalid_type,expected:ve.array,received:n.parsedType}),ke;if(n.data.length<this._def.items.length)return de(n,{code:oe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ke;!this._def.rest&&n.data.length>this._def.items.length&&(de(n,{code:oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((l,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new ei(n,l,n.path,a)):null}).filter(l=>!!l);return n.common.async?Promise.all(i).then(l=>jr.mergeArray(r,l)):jr.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new $i({...this._def,rest:t})}}$i.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $i({items:e,typeName:Ee.ZodTuple,rest:null,...Ae(t)})};class P_ extends Ie{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ve.map)return de(n,{code:oe.invalid_type,expected:ve.map,received:n.parsedType}),ke;const s=this._def.keyType,i=this._def.valueType,l=[...n.data.entries()].map(([a,c],u)=>({key:s._parse(new ei(n,a,n.path,[u,"key"])),value:i._parse(new ei(n,c,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of l){const u=await c.key,m=await c.value;if(u.status==="aborted"||m.status==="aborted")return ke;(u.status==="dirty"||m.status==="dirty")&&r.dirty(),a.set(u.value,m.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const c of l){const u=c.key,m=c.value;if(u.status==="aborted"||m.status==="aborted")return ke;(u.status==="dirty"||m.status==="dirty")&&r.dirty(),a.set(u.value,m.value)}return{status:r.value,value:a}}}}P_.create=(e,t,r)=>new P_({valueType:t,keyType:e,typeName:Ee.ZodMap,...Ae(r)});class Il extends Ie{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ve.set)return de(n,{code:oe.invalid_type,expected:ve.set,received:n.parsedType}),ke;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(de(n,{code:oe.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(de(n,{code:oe.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const i=this._def.valueType;function l(c){const u=new Set;for(const m of c){if(m.status==="aborted")return ke;m.status==="dirty"&&r.dirty(),u.add(m.value)}return{status:r.value,value:u}}const a=[...n.data.values()].map((c,u)=>i._parse(new ei(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>l(c)):l(a)}min(t,r){return new Il({...this._def,minSize:{value:t,message:xe.toString(r)}})}max(t,r){return new Il({...this._def,maxSize:{value:t,message:xe.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Il.create=(e,t)=>new Il({valueType:e,minSize:null,maxSize:null,typeName:Ee.ZodSet,...Ae(t)});class T_ extends Ie{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}T_.create=(e,t)=>new T_({getter:e,typeName:Ee.ZodLazy,...Ae(t)});class A_ extends Ie{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return de(r,{received:r.data,code:oe.invalid_literal,expected:this._def.value}),ke}return{status:"valid",value:t.data}}get value(){return this._def.value}}A_.create=(e,t)=>new A_({value:e,typeName:Ee.ZodLiteral,...Ae(t)});function uE(e,t){return new ha({values:e,typeName:Ee.ZodEnum,...Ae(t)})}class ha extends Ie{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return de(r,{expected:Fe.joinValues(n),received:r.parsedType,code:oe.invalid_type}),ke}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return de(r,{received:r.data,code:oe.invalid_enum_value,options:n}),ke}return zr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ha.create(t,{...this._def,...r})}exclude(t,r=this._def){return ha.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}ha.create=uE;class D_ extends Ie{_parse(t){const r=Fe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ve.string&&n.parsedType!==ve.number){const s=Fe.objectValues(r);return de(n,{expected:Fe.joinValues(s),received:n.parsedType,code:oe.invalid_type}),ke}if(this._cache||(this._cache=new Set(Fe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Fe.objectValues(r);return de(n,{received:n.data,code:oe.invalid_enum_value,options:s}),ke}return zr(t.data)}get enum(){return this._def.values}}D_.create=(e,t)=>new D_({values:e,typeName:Ee.ZodNativeEnum,...Ae(t)});class Yu extends Ie{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==ve.promise&&r.common.async===!1)return de(r,{code:oe.invalid_type,expected:ve.promise,received:r.parsedType}),ke;const n=r.parsedType===ve.promise?r.data:Promise.resolve(r.data);return zr(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Yu.create=(e,t)=>new Yu({type:e,typeName:Ee.ZodPromise,...Ae(t)});class fa extends Ie{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ee.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:l=>{de(n,l),l.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const l=s.transform(n.data,i);if(n.common.async)return Promise.resolve(l).then(async a=>{if(r.value==="aborted")return ke;const c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?ke:c.status==="dirty"||r.value==="dirty"?Xa(c.value):c});{if(r.value==="aborted")return ke;const a=this._def.schema._parseSync({data:l,path:n.path,parent:n});return a.status==="aborted"?ke:a.status==="dirty"||r.value==="dirty"?Xa(a.value):a}}if(s.type==="refinement"){const l=a=>{const c=s.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?ke:(a.status==="dirty"&&r.dirty(),l(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?ke:(a.status==="dirty"&&r.dirty(),l(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!da(l))return ke;const a=s.transform(l.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>da(l)?Promise.resolve(s.transform(l.value,i)).then(a=>({status:r.value,value:a})):ke);Fe.assertNever(s)}}fa.create=(e,t,r)=>new fa({schema:e,typeName:Ee.ZodEffects,effect:t,...Ae(r)});fa.createWithPreprocess=(e,t,r)=>new fa({schema:t,effect:{type:"preprocess",transform:e},typeName:Ee.ZodEffects,...Ae(r)});class Gs extends Ie{_parse(t){return this._getType(t)===ve.undefined?zr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Gs.create=(e,t)=>new Gs({innerType:e,typeName:Ee.ZodOptional,...Ae(t)});class pa extends Ie{_parse(t){return this._getType(t)===ve.null?zr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}pa.create=(e,t)=>new pa({innerType:e,typeName:Ee.ZodNullable,...Ae(t)});class Tp extends Ie{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===ve.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Tp.create=(e,t)=>new Tp({innerType:e,typeName:Ee.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ae(t)});class Ap extends Ie{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return qu(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ss(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ss(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ap.create=(e,t)=>new Ap({innerType:e,typeName:Ee.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ae(t)});class L_ extends Ie{_parse(t){if(this._getType(t)!==ve.nan){const n=this._getOrReturnCtx(t);return de(n,{code:oe.invalid_type,expected:ve.nan,received:n.parsedType}),ke}return{status:"valid",value:t.data}}}L_.create=e=>new L_({typeName:Ee.ZodNaN,...Ae(e)});class YB extends Ie{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class tv extends Ie{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?ke:i.status==="dirty"?(r.dirty(),Xa(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ke:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new tv({in:t,out:r,typeName:Ee.ZodPipeline})}}class Dp extends Ie{_parse(t){const r=this._def.innerType._parse(t),n=s=>(da(s)&&(s.value=Object.freeze(s.value)),s);return qu(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}Dp.create=(e,t)=>new Dp({innerType:e,typeName:Ee.ZodReadonly,...Ae(t)});var Ee;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ee||(Ee={}));const O_=Os.create;ti.create;Tn.create;const ZB=xt.create;Gu.create;Qu.create;$i.create;ha.create;Yu.create;Gs.create;pa.create;const XB=oB,dE=C.createContext({}),M_=e=>o.jsx(dE.Provider,{value:{name:e.name},children:o.jsx(sB,{...e})}),hE=C.createContext({}),Hd=()=>{const e=C.useContext(dE),t=C.useContext(hE),{getFieldState:r,formState:n}=iB(),s=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},Lp=C.forwardRef(({className:e,...t},r)=>{const n=C.useId();return o.jsx(hE.Provider,{value:{id:n},children:o.jsx("div",{ref:r,className:ee("flex flex-col gap-1.5",e),...t})})});Lp.displayName="FormItem";const Op=C.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:s}=Hd();return o.jsx(Sr,{ref:r,className:ee(n&&"text-[var(--break-red)]",e),htmlFor:s,...t})});Op.displayName="FormLabel";const Mp=C.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:s,formMessageId:i}=Hd();return o.jsx(zw,{ref:t,id:n,"aria-describedby":r?`${s} ${i}`:s,"aria-invalid":!!r,...e})});Mp.displayName="FormControl";const fE=C.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=Hd();return o.jsx("p",{ref:r,id:n,className:ee("font-mono text-[11px] text-[var(--fg-dim)]",e),...t})});fE.displayName="FormDescription";const Ip=C.forwardRef(({className:e,children:t,...r},n)=>{const{error:s,formMessageId:i}=Hd(),l=s?String((s==null?void 0:s.message)??""):t;return l?o.jsx("p",{ref:n,id:i,className:ee("font-mono text-[11px] text-[var(--break-red)]",e),...r,children:l}):null});Ip.displayName="FormMessage";const JB=ZB({current:O_().min(1,"Current password is required."),next:O_().min(8,"New password must be at least 8 characters.")});function e6(){const[e,t]=C.useState("idle"),r=_B({resolver:CB(JB),defaultValues:{current:"",next:""}}),n=async s=>{t("rotating");try{await me.changeKeystorePassword(s.current,s.next),r.reset({current:"",next:""}),An.success("Password rotated",{description:"Re-run `jinn run` with the new password."})}catch(i){An.error("Rotation failed",{description:i instanceof Error?i.message:String(i)})}finally{t("idle")}};return o.jsx("div",{"data-testid":"security-tab",children:o.jsxs(we,{className:"border-[var(--severity-blocking-border)]",children:[o.jsxs(Yt,{className:"flex flex-row items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsxs(fn,{className:"flex items-center gap-2 text-[var(--break-red)]",children:[o.jsx(b2,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Security"]}),o.jsx(Zs,{children:"Rotate keystore password · last rotated never"})]}),o.jsx(Se,{variant:"destructive",children:"Danger zone"})]}),o.jsx(Ge,{children:o.jsx(XB,{...r,children:o.jsxs("form",{onSubmit:r.handleSubmit(n),className:"flex flex-col gap-4","data-testid":"security-password-form",children:[o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsx(M_,{control:r.control,name:"current",render:({field:s})=>o.jsxs(Lp,{children:[o.jsx(Op,{children:"Current password"}),o.jsx(Mp,{children:o.jsx(gt,{type:"password",autoComplete:"current-password",...s})}),o.jsx(Ip,{})]})}),o.jsx(M_,{control:r.control,name:"next",render:({field:s})=>o.jsxs(Lp,{children:[o.jsx(Op,{children:"New password"}),o.jsx(Mp,{children:o.jsx(gt,{type:"password",autoComplete:"new-password",...s})}),o.jsx(fE,{children:"At least 8 characters."}),o.jsx(Ip,{})]})})]}),o.jsxs(ie,{type:"submit",variant:"destructive",disabled:e==="rotating"||!r.formState.isValid,className:"self-start",children:[o.jsx(f2,{className:"h-3 w-3","aria-hidden":"true"}),e==="rotating"?"Rotating…":"Rotate password"]})]})})})]})})}function t6(e){const t=[],r=e.split(`
|
|
288
|
+
`);let n=0;for(;n<r.length;){const s=r[n]??"";if(/^```/.test(s)){const a=s.slice(3).trim(),c=[];for(n++;n<r.length&&!/^```/.test(r[n]??"");)c.push(r[n]??""),n++;n++,t.push({kind:"code",lang:a,text:c.join(`
|
|
289
|
+
`)});continue}const i=/^(#{1,3})\s+(.*)$/.exec(s);if(i){t.push({kind:"heading",level:i[1].length,text:i[2]}),n++;continue}if(/^-\s+/.test(s)){const a=[];for(;n<r.length&&/^-\s+/.test(r[n]??"");)a.push((r[n]??"").replace(/^-\s+/,"")),n++;t.push({kind:"list",items:a});continue}if(s.trim()===""){n++;continue}const l=[s];for(n++;n<r.length&&(r[n]??"").trim()!==""&&!/^(#{1,3}\s|```|-\s)/.test(r[n]??"");)l.push(r[n]??""),n++;t.push({kind:"paragraph",text:l.join(" ")})}return t}function I_(e){const t=[],r=/`([^`]+)`/g;let n=0,s,i=0;for(;(s=r.exec(e))!==null;)s.index>n&&t.push(e.slice(n,s.index)),t.push(C.createElement("code",{key:`c-${i++}`},s[1])),n=s.index+s[0].length;return n<e.length&&t.push(e.slice(n)),t}function r6(e){const t=t6(e);return C.createElement(C.Fragment,null,...t.map((r,n)=>r.kind==="heading"?r.level===1?C.createElement("h1",{key:n},r.text):r.level===2?C.createElement("h2",{key:n},r.text):C.createElement("h3",{key:n},r.text):r.kind==="code"?C.createElement("pre",{key:n},C.createElement("code",null,r.text??"")):r.kind==="list"?C.createElement("ul",{key:n},...(r.items??[]).map((s,i)=>C.createElement("li",{key:i},...I_(s)))):C.createElement("p",{key:n},...I_(r.text??""))))}const n6=`# Build a plug-in
|
|
290
|
+
|
|
291
|
+
Ship a Jinn SolverPlugin in 60 seconds. Targets the SWE-rebench v2 SolverNet running against the Hermes harness on testnet.
|
|
292
|
+
|
|
293
|
+
## 1. Scaffold
|
|
294
|
+
|
|
295
|
+
\`\`\`bash
|
|
296
|
+
jinn create plugin @you/my-swe-skill --pattern solver-type-plugin --solver-type swe-rebench-v2.v1
|
|
297
|
+
cd @you/my-swe-skill
|
|
298
|
+
yarn install
|
|
299
|
+
yarn test
|
|
300
|
+
\`\`\`
|
|
301
|
+
|
|
302
|
+
The scaffolder emits a working package modeled on \`swe-rebench-v2-runtime\`:
|
|
303
|
+
|
|
304
|
+
\`\`\`
|
|
305
|
+
@you/my-swe-skill/
|
|
306
|
+
├── jinn.plugin.json # the canonical manifest
|
|
307
|
+
├── skills/example/SKILL.md
|
|
308
|
+
├── test/plugin.test.ts # passes immediately
|
|
309
|
+
├── package.json
|
|
310
|
+
├── tsconfig.json
|
|
311
|
+
└── README.md
|
|
312
|
+
\`\`\`
|
|
313
|
+
|
|
314
|
+
## 2. Edit your skill
|
|
315
|
+
|
|
316
|
+
Open \`skills/example/SKILL.md\` and replace it with the skill your plug-in offers. A SolverType plug-in can ship one or more skills; a runtime plug-in usually ships an MCP server in \`.mcp.json\` instead. See \`shape-reference.md\`.
|
|
317
|
+
|
|
318
|
+
## 3. Publish to npm + chain
|
|
319
|
+
|
|
320
|
+
\`\`\`bash
|
|
321
|
+
npm publish --access public
|
|
322
|
+
jinn solver-plugins publish npm:@you/my-swe-skill
|
|
323
|
+
\`\`\`
|
|
324
|
+
|
|
325
|
+
\`jinn solver-plugins publish\` lazily completes your identity bootstrap (Stage 1) the first time you call it. If you have not yet funded your agent EOA with ETH on testnet, the verb pauses and tells you what to send where. Re-run when the wallet is funded.
|
|
326
|
+
|
|
327
|
+
The verb packs the plug-in, uploads the tarball to IPFS, and writes a \`plugin:<cid>\` record on the on-chain IdentityRegistry under your builder agentId.
|
|
328
|
+
|
|
329
|
+
## 4. Confirm it published
|
|
330
|
+
|
|
331
|
+
Open the operator app's \`/build\` route. Under "Published plug-ins for SWE-rebench v2" you should see your plug-in. Under "Your published plug-ins" you should see the same record.
|
|
332
|
+
|
|
333
|
+
## 5. Run it
|
|
334
|
+
|
|
335
|
+
An operator who has joined the SWE-rebench v2 SolverNet can install your plug-in:
|
|
336
|
+
|
|
337
|
+
\`\`\`bash
|
|
338
|
+
jinn solver-plugins show npm:@you/my-swe-skill
|
|
339
|
+
jinn solver-nets add-plugin swe-rebench-v2 npm:@you/my-swe-skill
|
|
340
|
+
\`\`\`
|
|
341
|
+
|
|
342
|
+
The next task they claim runs against your plug-in. The signed envelope's \`executor.plugins[]\` carries your CID; the network explorer attributes the score to your builder agentId.
|
|
343
|
+
|
|
344
|
+
## Next
|
|
345
|
+
|
|
346
|
+
- \`shape-reference.md\` — the full \`jinn.plugin.json\` shape, the two modes, skills + MCP conventions.
|
|
347
|
+
- \`examples.md\` — annotated reference plug-ins.
|
|
348
|
+
- \`publishing-flow.md\` — what \`jinn solver-plugins publish\` does, step by step.
|
|
349
|
+
- \`identity.md\` — staged identity bootstrap; why publishing does not require operator-grade funding.
|
|
350
|
+
- \`compatibility.md\` — \`jinn.supports\` semantics, harness compatibility.
|
|
351
|
+
`,s6="https://github.com/Jinn-Network/mono/blob/next/client/docs/build/quickstart.md",F_="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function i6(){return o.jsxs(we,{className:"p-6",children:[o.jsx(Yt,{className:"mb-2 p-0",children:o.jsx("span",{className:F_,children:"Quickstart · 60 seconds"})}),o.jsxs(Ge,{className:"p-0",children:[o.jsx("div",{className:"hfmf-intro-markdown",children:r6(n6)}),o.jsx(Qe,{className:"my-5"}),o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("span",{className:F_,children:"Next"}),o.jsx("a",{href:s6,target:"_blank",rel:"noreferrer",className:"border-b border-border pb-px font-mono text-[12px] text-primary no-underline hover:text-[var(--accent-sky-hover)]",children:"Read the full quickstart on GitHub →"})]})]})]})}const o6=[{name:"name",type:"string",required:!0,description:"npm package name. Used as the canonical identifier across the registry."},{name:"version",type:"string",required:!0,description:"Semantic version. New versions publish under a new IPFS CID."},{name:"description",type:"string",required:!1,description:"Short prose description of what the plug-in offers."},{name:"jinn.supports",type:"string[]",required:!0,description:'Either ["jinn.runtime"] (runtime plug-in) OR one or more SolverType identifiers (solver-type plug-in). Mixing is rejected.'},{name:"jinn.capabilities",type:"object",required:!1,description:"Optional capabilities map. Reserved for future use; not consumed by Hermes today."},{name:"jinn.mcpServers",type:"object",required:!1,description:"Optional inline MCP server map. The Hermes harness reads .mcp.json instead; declare MCP there for harness-agnostic portability."},{name:"jinn.skills",type:"string[]",required:!1,description:"Relative paths to SKILL.md files. Each declared skill becomes available to the harness as an external skill directory."}],a6=[{id:"runtime",label:"Runtime plug-in",requires:'singleton — supports must be exactly ["jinn.runtime"]',example:'{ "jinn": { "supports": ["jinn.runtime"] } }'},{id:"solver-type",label:"SolverType plug-in",requires:'one or more SolverType ids; cannot include "jinn.runtime"',example:'{ "jinn": { "supports": ["swe-rebench-v2.v1"] } }'}],Uh="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function l6(){return o.jsxs(we,{className:"p-6",children:[o.jsxs(Yt,{className:"mb-5 flex flex-col gap-1 p-0",children:[o.jsx("span",{className:Uh,children:"Reference"}),o.jsx("h2",{className:"m-0 font-serif text-[28px] leading-[1.2] text-foreground",children:"Plug-in shape"})]}),o.jsxs(Ge,{className:"p-0",children:[o.jsxs(Wi,{children:[o.jsx(Vi,{children:o.jsxs(Er,{children:[o.jsx(We,{children:"Field"}),o.jsx(We,{children:"Type"}),o.jsx(We,{children:"Required"}),o.jsx(We,{children:"Description"})]})}),o.jsx(qi,{children:o6.map(e=>o.jsxs(Er,{"data-field-required":e.required?"true":"false",children:[o.jsx(Ve,{className:"font-mono text-[13px] text-primary",children:e.name}),o.jsx(Ve,{className:"font-mono text-[13px] text-muted-foreground",children:e.type}),o.jsx(Ve,{children:o.jsx(Se,{variant:e.required?"default":"outline",children:e.required?"yes":"no"})}),o.jsx(Ve,{className:"font-mono text-[13px] text-muted-foreground",children:e.description})]},e.name))})]}),o.jsx(Qe,{className:"my-8"}),o.jsxs("div",{className:"mb-4 flex flex-col gap-1",children:[o.jsx("span",{className:Uh,children:"Modes"}),o.jsx("h3",{className:"m-0 font-serif text-[22px] leading-[1.25] text-foreground",children:"Two modes"}),o.jsx("p",{className:"m-0 mt-1 max-w-[72ch] font-mono text-[13px] leading-[1.7] text-muted-foreground",children:"The validator enforces exactly two exclusive modes. Mixing is rejected."})]}),o.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:a6.map((e,t)=>o.jsxs(we,{className:"flex flex-col gap-2.5 bg-[var(--bg-sunken)] p-4",children:[o.jsx("span",{className:Uh,children:t===0?"Mode · 01":"Mode · 02"}),o.jsx("h4",{className:"m-0 font-mono text-[15px] font-medium tracking-[-0.01em] text-foreground",children:e.label}),o.jsx("p",{className:"m-0 font-mono text-[12px] leading-[1.6] text-muted-foreground",children:e.requires}),o.jsx("pre",{className:"m-0 overflow-x-auto rounded-sm border border-border bg-background px-3 py-2.5 font-mono text-[12px] leading-[1.5] text-primary",children:o.jsx("code",{children:e.example})})]},e.id))})]})]})}const pE="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]";function c6(e){return e.length>14?`${e.slice(0,8)}…${e.slice(-4)}`:e}function Fc({solverType:e}){return o.jsxs(Yt,{className:"mb-5 flex flex-col gap-1 p-0",children:[o.jsx("span",{className:pE,children:"Registry"}),o.jsxs("h3",{className:"m-0 font-serif text-[22px] leading-[1.25] text-foreground",children:["Published plug-ins for ",e]})]})}function u6({solverType:e}){const{data:t,isLoading:r,error:n}=Te({queryKey:["discovery","plugin-publications",e],queryFn:()=>me.discovery.listPluginPublications({solverType:e}),refetchInterval:3e4});if(r)return o.jsxs(we,{className:"p-6",children:[o.jsx(Fc,{solverType:e}),o.jsxs(Ge,{className:"flex flex-col gap-2 p-0",children:[o.jsx(Ir,{className:"h-4 w-full"}),o.jsx(Ir,{className:"h-4 w-5/6"}),o.jsx(Ir,{className:"h-4 w-4/6"})]})]});if(n)return o.jsxs(we,{className:"p-6",children:[o.jsx(Fc,{solverType:e}),o.jsx(Ge,{className:"p-0",children:o.jsx(Ye,{variant:"blocking",children:o.jsxs(Xe,{children:["Discovery unavailable. ",n.message]})})})]});const s=(t==null?void 0:t.publications)??[];return s.length===0?o.jsxs(we,{className:"p-6",children:[o.jsx(Fc,{solverType:e}),o.jsx(Ge,{className:"p-0",children:o.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-dashed border-border bg-[var(--bg-sunken)] p-6",children:[o.jsx("span",{className:pE,children:"Empty registry"}),o.jsx("p",{className:"m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-foreground",children:"No plug-ins published yet. Be the first."}),o.jsxs("p",{className:"m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-muted-foreground",children:["Run"," ",o.jsx("code",{className:"rounded-sm border border-border bg-background px-1.5 py-px font-mono text-[12px] text-primary",children:"jinn solver-plugins publish"})," ","and your plug-in appears here under your builder agentId."]})]})})]}):o.jsxs(we,{className:"p-6",children:[o.jsx(Fc,{solverType:e}),o.jsx(Ge,{className:"p-0",children:o.jsxs(Wi,{children:[o.jsx(Vi,{children:o.jsxs(Er,{children:[o.jsx(We,{children:"Plug-in"}),o.jsx(We,{children:"Version"}),o.jsx(We,{children:"Builder agentId"}),o.jsx(We,{children:"CID"}),o.jsx(We,{children:"Status"})]})}),o.jsx(qi,{children:s.map(i=>o.jsxs(Er,{children:[o.jsx(Ve,{className:"font-mono text-[12px] text-foreground",children:i.name}),o.jsx(Ve,{className:"font-mono text-[12px] text-muted-foreground",children:i.version}),o.jsx(Ve,{className:"font-mono text-[12px] text-muted-foreground",children:i.builderAgentId}),o.jsx(Ve,{className:"font-mono text-[12px] text-muted-foreground",children:c6(i.cid)}),o.jsx(Ve,{children:i.revoked?o.jsxs(Se,{variant:"outline",className:"rounded-full border-[var(--wane)] text-[var(--wane)]",children:["Revoked",i.revokedReason?` · ${i.revokedReason}`:""]}):o.jsx(Se,{variant:"success",className:"rounded-full",children:"Active"})})]},`${i.builderAgentId}:${i.cid}`))})]})})]})}const Fp="font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",zh="rounded-sm border border-border bg-background px-1.5 py-px font-mono text-[12px] text-primary";function Wa(){return o.jsxs(Yt,{className:"mb-5 flex flex-col gap-1 p-0",children:[o.jsx("span",{className:Fp,children:"Builder"}),o.jsx("h3",{className:"m-0 font-serif text-[22px] leading-[1.25] text-foreground",children:"Your published plug-ins"})]})}function d6({fleetAgentId:e}){const t=!!e,{data:r,isLoading:n,error:s}=Te({queryKey:["discovery","builder-artifacts",e],queryFn:()=>me.discovery.listBuilderArtifacts(e),enabled:t,refetchInterval:3e4});if(!t)return o.jsxs(we,{className:"bg-[var(--bg-sunken)] p-6",children:[o.jsx(Wa,{}),o.jsx(Ge,{className:"p-0",children:o.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-dashed border-border p-6",children:[o.jsx("span",{className:Fp,children:"Identity pending"}),o.jsxs("p",{className:"m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-muted-foreground",children:["Complete identity bootstrap to see your published plug-ins. Run"," ",o.jsx("code",{className:zh,children:"jinn solver-plugins publish"})," on a plug-in and the lazy stage-ensure will provision your builder identity (Stage 1)."]})]})})]});if(n)return o.jsxs(we,{className:"p-6",children:[o.jsx(Wa,{}),o.jsxs(Ge,{className:"flex flex-col gap-2 p-0",children:[o.jsx(Ir,{className:"h-4 w-full"}),o.jsx(Ir,{className:"h-4 w-5/6"}),o.jsx(Ir,{className:"h-4 w-4/6"})]})]});if(s)return o.jsxs(we,{className:"p-6",children:[o.jsx(Wa,{}),o.jsx(Ge,{className:"p-0",children:o.jsx(Ye,{variant:"blocking",children:o.jsx(Xe,{children:"Discovery unavailable."})})})]});const i=((r==null?void 0:r.artifacts)??[]).filter(l=>l.artifactType==="plugin");return i.length===0?o.jsxs(we,{className:"p-6",children:[o.jsx(Wa,{}),o.jsx(Ge,{className:"p-0",children:o.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-dashed border-border bg-[var(--bg-sunken)] p-6",children:[o.jsx("span",{className:Fp,children:"Nothing yet"}),o.jsxs("p",{className:"m-0 max-w-[64ch] font-mono text-[13px] leading-[1.7] text-muted-foreground",children:["You have not published any plug-ins yet. Scaffold one with"," ",o.jsx("code",{className:zh,children:"jinn create plugin"}),", then publish with ",o.jsx("code",{className:zh,children:"jinn solver-plugins publish"}),". It will appear here under your builder agentId."]})]})})]}):o.jsxs(we,{className:"p-6",children:[o.jsx(Wa,{}),o.jsx(Ge,{className:"p-0",children:o.jsxs(Wi,{children:[o.jsx(Vi,{children:o.jsxs(Er,{children:[o.jsx(We,{children:"Plug-in"}),o.jsx(We,{children:"Version"}),o.jsx(We,{children:"Supports"}),o.jsx(We,{children:"Status"})]})}),o.jsx(qi,{children:i.map(l=>o.jsxs(Er,{children:[o.jsx(Ve,{className:"font-mono text-[12px] text-foreground",children:l.name}),o.jsx(Ve,{className:"font-mono text-[12px] text-muted-foreground",children:l.version}),o.jsx(Ve,{className:"font-mono text-[12px] text-muted-foreground",children:l.supports.join(", ")}),o.jsx(Ve,{children:l.revoked?o.jsx(Se,{variant:"outline",className:"rounded-full border-[var(--wane)] text-[var(--wane)]",children:"Revoked"}):o.jsx(Se,{variant:"success",className:"rounded-full",children:"Active"})})]},`${l.builderAgentId}:${l.cid}`))})]})})]})}function h6({value:e,onChange:t}){const r=e==="plugin";return o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ie,{type:"button",variant:r?"outline":"ghost",size:"sm","aria-pressed":r?"true":"false",className:"rounded-full",onClick:()=>{r||t("plugin")},children:"Plug-ins"}),o.jsxs(ie,{type:"button",variant:"ghost",size:"sm",disabled:!0,"aria-pressed":"false",className:"rounded-full opacity-60",children:["Harnesses",o.jsx("span",{className:"ml-1 border-l border-border pl-2 text-[9px] tracking-[0.14em] text-[var(--fg-dim)]",children:"Coming soon"})]})]})}const f6="swe-rebench-v2.v1";function p6(){const{data:e}=Te({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap(),refetchInterval:5e3}),[t,r]=C.useState("plugin");return o.jsxs("div",{className:"mx-auto flex max-w-[1100px] flex-col gap-6 px-6 pb-12 pt-8",children:[o.jsxs("header",{className:"flex flex-col gap-2 pb-2",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--accent-gold)]",children:"Build · Plug-ins"}),o.jsx("p",{className:"m-0 max-w-[64ch] font-mono text-[14px] leading-[1.7] text-muted-foreground",children:"Scaffold a SolverPlugin, publish it to npm and IPFS, watch it appear in the registry under your builder identity. Anchored on the SWE-rebench v2 SolverNet for v0."})]}),o.jsx(i6,{}),o.jsx(l6,{}),o.jsx(Qe,{}),o.jsxs("div",{className:"flex items-center justify-between gap-4 pt-2",children:[o.jsx("span",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.14em] text-[var(--fg-dim)]",children:"Registry"}),o.jsx(h6,{value:t,onChange:r})]}),t==="plugin"?o.jsxs(o.Fragment,{children:[o.jsx(u6,{solverType:f6}),o.jsx(d6,{fleetAgentId:e==null?void 0:e.fleet_agent_id})]}):null]})}const Bc=({...e})=>o.jsx(oO,{theme:"dark",className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-card group-[.toaster]:text-card-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg font-mono text-[12px]",description:"group-[.toast]:text-[var(--fg-muted)]",actionButton:"group-[.toast]:bg-[var(--accent-sky)] group-[.toast]:text-[var(--bg-sunken)] font-mono text-[10px] uppercase tracking-[0.14em]",cancelButton:"group-[.toast]:bg-transparent group-[.toast]:text-[var(--fg-muted)] font-mono text-[10px] uppercase tracking-[0.14em]"}},...e});function m6(){const{data:e,isLoading:t}=Te({queryKey:["bootstrap"],queryFn:()=>me.getBootstrap(),refetchInterval:1500}),r=Mw(),[n,s]=C.useState(!1),i={restartPending:n,setRestartPending:s};if(r.status==="disconnected"&&!e)return o.jsxs(Lr,{delayDuration:150,children:[o.jsx(yD,{connection:r}),o.jsx(Bc,{})]});if(e&&e.mode!=="running")return o.jsxs(Lr,{delayDuration:150,children:[o.jsx(gD,{}),o.jsx(Bc,{})]});if(t||!e)return o.jsxs(Lr,{delayDuration:150,children:[o.jsx(IP,{headline:"Starting jinn"}),o.jsx(Bc,{})]});const l=e.chain==="base"?"mainnet":"testnet",{pluginBuilderUi:a,embeddedAgent:c}=tg();return o.jsx(Lr,{delayDuration:150,children:o.jsxs(n1.Provider,{value:i,children:[o.jsx(Lw,{children:o.jsx(DD,{header:o.jsx(TL,{network:l}),tabs:o.jsx(AL,{}),rail:c?o.jsx(DL,{}):void 0,children:o.jsxs(JN,{children:[o.jsx(Pt,{path:"/events/:id",children:o.jsx(nM,{})}),o.jsx(Pt,{path:"/events",children:o.jsx(eM,{})}),o.jsx(Pt,{path:"/overview",component:qO}),o.jsx(Pt,{path:"/operator/join/:cid",children:o.jsx(E5,{})}),o.jsx(Pt,{path:"/operator/execution-data",children:o.jsx(Ua,{children:o.jsx(G5,{})})}),o.jsx(Pt,{path:"/operator/memberships",children:o.jsx(Ua,{children:o.jsx($F,{onRestartPending:()=>s(!0)})})}),o.jsx(Pt,{path:"/operator/registry",children:o.jsx(Ua,{children:o.jsx(ZF,{})})}),o.jsx(Pt,{path:"/operator/network",children:o.jsx(Ua,{children:o.jsx(XF,{onRestartPending:()=>s(!0)})})}),o.jsx(Pt,{path:"/operator/security",children:o.jsx(Ua,{children:o.jsx(e6,{})})}),o.jsx(Pt,{path:"/operator",children:o.jsx(Ya,{to:"/operator/memberships"})}),o.jsx(Pt,{path:"/captures",children:o.jsx(Ya,{to:"/operator/execution-data"})}),o.jsx(Pt,{path:"/configuration",children:o.jsx(g6,{})}),o.jsx(Pt,{path:"/launcher/create",children:o.jsx(IM,{})}),o.jsx(Pt,{path:"/launcher/launched/:solverNetId",children:o.jsx(F3,{})}),o.jsx(Pt,{path:"/launcher",children:o.jsx(uM,{})}),o.jsx(Pt,{path:"/build",children:a?o.jsx(p6,{}):o.jsx(Ya,{to:"/overview"})}),o.jsx(Pt,{children:o.jsx(Ya,{to:"/overview"})})]})})}),o.jsx(Bc,{})]})})}function g6(){const e=typeof window>"u"?"":window.location.hash;return o.jsx(Ya,{to:`/operator${e}`})}const v6=new pN({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:1e3}}});t2().finally(()=>{Wh.createRoot(document.getElementById("root")).render(o.jsx(Z.StrictMode,{children:o.jsx(mN,{client:v6,children:o.jsx(m6,{})})}))});
|