okengine 0.21.0 → 0.22.0
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/AGENTS.md +4 -4
- package/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +15 -9
- package/manifest.v1.schema.json +10 -0
- package/package.json +22 -25
- package/site/content/docs/ai/skills.mdx +1 -1
- package/site/content/docs/client/calling.mdx +27 -19
- package/site/content/docs/client/index.mdx +1 -1
- package/site/content/docs/elements/channel/email.mdx +1 -1
- package/site/content/docs/elements/channel/index.mdx +1 -1
- package/site/content/docs/elements/flow/http.mdx +4 -4
- package/site/content/docs/elements/flow/index.mdx +3 -3
- package/site/content/docs/elements/flow/meta.json +1 -1
- package/site/content/docs/elements/gate/tenancy.mdx +1 -1
- package/site/content/docs/elements/vault/rotation.mdx +15 -0
- package/site/content/docs/plugins/otp.mdx +31 -31
- package/site/content/docs/recipes/mailpit.mdx +1 -1
- package/site/content/docs/recipes/meilisearch.mdx +1 -1
- package/site/content/docs/recipes/pgdog.mdx +1 -1
- package/site/content/docs/reference/configuration.mdx +2 -2
- package/site/content/docs/reference/errors.mdx +12 -2
- package/site/content/docs/reference/fx.mdx +28 -15
- package/site/content/docs/reference/idempotency.mdx +192 -0
- package/site/content/docs/reference/index.mdx +6 -1
- package/site/content/docs/reference/meta.json +2 -1
- package/site/content/docs/understand/meta.json +1 -1
- package/site/content/docs/{elements/flow → understand}/routing.mdx +11 -10
- package/site/content/docs/understand/the-architecture.mdx +14 -12
- package/site/content/docs/understand/try-it.mdx +3 -3
- package/src/cli/competitor-mention-removal.test.ts +3 -3
- package/src/cli/dev.test.ts +105 -2
- package/src/cli/dev.ts +37 -2
- package/src/cli/docker-cli.test.ts +1 -1
- package/src/cli/index.ts +9 -1
- package/src/cli/load-config.images.test.ts +10 -10
- package/src/cli/load-config.ts +1 -1
- package/src/cli/vault-cmd.test.ts +23 -0
- package/src/cli/vault-cmd.ts +7 -0
- package/src/client/create.ts +31 -27
- package/src/client/live.ts +44 -101
- package/src/client/sse.ts +20 -66
- package/src/client/stream.ts +25 -67
- package/src/client/transport.test.ts +225 -0
- package/src/client/transport.ts +158 -90
- package/src/client/types.ts +29 -3
- package/src/client/wire.ts +119 -0
- package/src/compiler/aot.ts +3 -32
- package/src/compiler/dynamic.ts +13 -11
- package/src/compiler/effects-infer.ts +726 -16
- package/src/compiler/extract.test.ts +37 -0
- package/src/compiler/extract.ts +113 -12
- package/src/compiler/fixtures/skyport.expected.json +24 -0
- package/src/compiler/fx-follow.test.ts +164 -0
- package/src/compiler/fx-index.ts +399 -0
- package/src/compiler/interpret.ts +45 -0
- package/src/console/server/flows-invoke.test.ts +2 -2
- package/src/console/ui-next/dist/assets/{access-page-tIbsiphz.js → access-page-Ze6ckjdd.js} +2 -2
- package/src/console/ui-next/dist/assets/agent-disclosure-Bkohc_8X.js +1 -0
- package/src/console/ui-next/dist/assets/{cache-glyph-BCC-DxKT.js → cache-glyph-rL0lHxat.js} +1 -1
- package/src/console/ui-next/dist/assets/{call-pii-button-jOmYISdc.js → call-pii-button-Deo4PP18.js} +1 -1
- package/src/console/ui-next/dist/assets/{collapsible-DC2xNaAb.js → collapsible-CoJ6amHf.js} +1 -1
- package/src/console/ui-next/dist/assets/{copy-inline-button-CAYD18cr.js → copy-inline-button-CWG5_ZOh.js} +1 -1
- package/src/console/ui-next/dist/assets/{detail-header-DVWNjWjg.js → detail-header-b_ZzIsmU.js} +1 -1
- package/src/console/ui-next/dist/assets/{dropdown-menu-4h2LOVXM.js → dropdown-menu-nwXEO1Ac.js} +1 -1
- package/src/console/ui-next/dist/assets/duration-tone-BbQ_8z50.js +9 -0
- package/src/console/ui-next/dist/assets/element-icons-CwyLpVXz.js +1 -0
- package/src/console/ui-next/dist/assets/{explorer-empty-CJs5A-wm.js → explorer-empty-C8sSCqYT.js} +1 -1
- package/src/console/ui-next/dist/assets/{flows-page-gT1lsWQK.js → flows-page-D2E7BtKK.js} +1 -1
- package/src/console/ui-next/dist/assets/{highlighted-json-C2GZEJNI.js → highlighted-json-CPYBzDh0.js} +1 -1
- package/src/console/ui-next/dist/assets/{http-method-BdYjcIrD.js → http-method-DTPevKmM.js} +1 -1
- package/src/console/ui-next/dist/assets/index-vTuwmeQz.js +58 -0
- package/src/console/ui-next/dist/assets/observability-page-SJTSzHFJ.js +4 -0
- package/src/console/ui-next/dist/assets/{replica-lag-C4QdAF7J.js → replica-lag-BM27lXld.js} +3 -3
- package/src/console/ui-next/dist/assets/{request-meta-C43DHyld.js → request-meta-BjFT7DNl.js} +1 -1
- package/src/console/ui-next/dist/assets/shortcut-keys-CUNegEV4.js +1 -0
- package/src/console/ui-next/dist/assets/store-page-Qj9ThRE-.js +41 -0
- package/src/console/ui-next/dist/assets/{trace-detail-sheet-Dcpo4Us_.js → trace-detail-sheet-Cmitq3da.js} +2 -2
- package/src/console/ui-next/dist/assets/{tree-expand-toggle-CKJTuv43.js → tree-expand-toggle-CbDIB-7x.js} +2 -2
- package/src/console/ui-next/dist/assets/units-page-_PuYqFty.js +1 -0
- package/src/console/ui-next/dist/assets/{use-vault-list-CT4-gajj.js → use-vault-list-Cs45Czkt.js} +1 -1
- package/src/console/ui-next/dist/assets/{vault-page-BwZ9YjTW.js → vault-page-BOMr0go9.js} +2 -2
- package/src/console/ui-next/dist/index.html +2 -2
- package/src/console/ui-next/src/features/units/detail/flow-contract-panel.tsx +9 -0
- package/src/docker/docker.test.ts +13 -13
- package/src/docker/images-config.test.ts +12 -12
- package/src/docker/stack-id.test.ts +1 -1
- package/src/drivers/journal-postgres.ts +168 -3
- package/src/drivers/meilisearch.ts +2 -0
- package/src/drivers/vault-builtin.test.ts +10 -0
- package/src/drivers/vault-builtin.ts +13 -1
- package/src/drivers/vault-remote-bag.ts +5 -1
- package/src/drivers/vault-types.ts +6 -1
- package/src/elements/store/emit-drizzle.ts +2 -2
- package/src/elements/store/live-default.test.ts +2 -0
- package/src/elements/store/live-http.test.ts +1 -0
- package/src/elements/store/resource-list-docs.test.ts +2 -2
- package/src/elements/store/resource.test.ts +3 -3
- package/src/elements/store/schema-decl.test.ts +1 -0
- package/src/elements/store/sql-condition.ts +24 -7
- package/src/elements/store/sql-session.ts +20 -4
- package/src/elements/store/upsert-app.test.ts +1 -1
- package/src/elements/vault/audit.test.ts +137 -0
- package/src/elements/vault/audit.ts +106 -13
- package/src/elements/vault/boot-chain.ts +9 -1
- package/src/elements/vault/builtin-adapter.ts +33 -3
- package/src/i18n/catalogs/ar.ts +4 -0
- package/src/i18n/catalogs/en.ts +4 -0
- package/src/kernel/abort-scope.ts +33 -2
- package/src/kernel/app.ts +200 -20
- package/src/kernel/auto-cache.test.ts +6 -6
- package/src/kernel/boot-bind/vault.ts +1 -0
- package/src/kernel/boot.ts +19 -1
- package/src/kernel/builtin-errors.ts +8 -0
- package/src/kernel/client-descriptor.test.ts +78 -0
- package/src/kernel/client-descriptor.ts +24 -0
- package/src/kernel/concurrency.test.ts +33 -0
- package/src/kernel/effects-stamping.test.ts +2 -2
- package/src/kernel/errors-compiler.ts +20 -0
- package/src/kernel/errors-text.ts +99 -0
- package/src/kernel/errors.ts +90 -138
- package/src/kernel/external-effects.test.ts +36 -0
- package/src/kernel/flow.ts +24 -0
- package/src/kernel/fx-fetch.ts +5 -1
- package/src/kernel/fx-sql-handle.ts +305 -0
- package/src/kernel/fx.ts +42 -330
- package/src/kernel/idempotency-store.ts +578 -0
- package/src/kernel/idempotency.test.ts +556 -0
- package/src/kernel/idempotency.ts +304 -0
- package/src/kernel/index.ts +1 -0
- package/src/kernel/journal.ts +56 -0
- package/src/kernel/json-result.ts +59 -0
- package/src/kernel/project-out.ts +6 -1
- package/src/manifest/types.ts +8 -0
- package/src/okid-extended.ts +175 -0
- package/src/okid-shared.ts +103 -0
- package/src/okid.ts +30 -213
- package/src/plugins/auth-delivery.mailpit.integration.test.ts +1 -1
- package/src/plugins/otp.test.ts +65 -1
- package/src/plugins/otp.ts +59 -7
- package/src/release/absolute-regression.test.ts +63 -0
- package/src/release/build-lib.ts +9 -0
- package/src/release/http-graph.test.ts +25 -0
- package/src/release/http-graph.ts +90 -0
- package/src/release/index.ts +3 -0
- package/src/release/limits.ts +17 -2
- package/src/release/measure.ts +105 -14
- package/src/test/create-test-app.test.ts +3 -1
- package/src/test/create-test-app.ts +40 -0
- package/src/test/live-signals.test.ts +1 -0
- package/src/test/provisions.integration.test.ts +1 -0
- package/src/test/tenant-isolation.test.ts +1 -0
- package/src/console/ui-next/dist/assets/agent-disclosure-CSKumwS2.js +0 -1
- package/src/console/ui-next/dist/assets/duration-tone-CwoV56jn.js +0 -9
- package/src/console/ui-next/dist/assets/element-icons-BI8cJgdh.js +0 -1
- package/src/console/ui-next/dist/assets/index-Cul17AcV.js +0 -63
- package/src/console/ui-next/dist/assets/observability-page-oY9vdYBk.js +0 -4
- package/src/console/ui-next/dist/assets/shortcut-keys-3ILd8oGn.js +0 -1
- package/src/console/ui-next/dist/assets/store-page-CL0D9dOq.js +0 -41
- package/src/console/ui-next/dist/assets/units-page-1PlT19ft.js +0 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modules that must stay off the static `okengine/http` graph.
|
|
3
|
+
*
|
|
4
|
+
* Add a heavy module here when a cold-start regression pulls it in.
|
|
5
|
+
* One list — the import-graph test matches every entry.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** One forbidden module on the `okengine/http` static graph. */
|
|
9
|
+
export interface HttpGraphForbidden {
|
|
10
|
+
/** Stable id. Printed when the build pulls this module in. */
|
|
11
|
+
readonly id: string;
|
|
12
|
+
/**
|
|
13
|
+
* True when `specifier` is this module.
|
|
14
|
+
* Specifiers are Bun metafile input paths and import paths, including externals.
|
|
15
|
+
*
|
|
16
|
+
* @param specifier - Input path or import specifier
|
|
17
|
+
*/
|
|
18
|
+
readonly test: (specifier: string) => boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Forbidden static imports for `okengine/http`.
|
|
23
|
+
* `zod` and the hybrid-search runtime (`search-runtime`) load on first use
|
|
24
|
+
* elsewhere; a static edge puts them on every cold start.
|
|
25
|
+
*/
|
|
26
|
+
export const HTTP_STATIC_GRAPH_FORBIDDEN: readonly HttpGraphForbidden[] = [
|
|
27
|
+
{
|
|
28
|
+
id: "zod",
|
|
29
|
+
test: (specifier) =>
|
|
30
|
+
specifier === "zod" ||
|
|
31
|
+
specifier.startsWith("zod/") ||
|
|
32
|
+
specifier.includes("node_modules/zod/") ||
|
|
33
|
+
specifier.includes("node_modules/zod@"),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "hybrid-search runtime",
|
|
37
|
+
test: (specifier) =>
|
|
38
|
+
specifier.includes("search-runtime.ts") ||
|
|
39
|
+
specifier.includes("search-runtime.js") ||
|
|
40
|
+
/(^|\/)search-runtime$/.test(specifier),
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
/** Metafile slice this gate reads. */
|
|
45
|
+
interface GraphMetafile {
|
|
46
|
+
readonly inputs: Readonly<
|
|
47
|
+
Record<string, { readonly imports?: readonly { readonly path: string }[] }>
|
|
48
|
+
>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Ids from {@link HTTP_STATIC_GRAPH_FORBIDDEN} that appear in `specifiers`.
|
|
53
|
+
*
|
|
54
|
+
* @param specifiers - Bundled input paths and import specifiers
|
|
55
|
+
*/
|
|
56
|
+
export function forbiddenHttpGraphHits(specifiers: readonly string[]): readonly string[] {
|
|
57
|
+
const hits: string[] = [];
|
|
58
|
+
for (const rule of HTTP_STATIC_GRAPH_FORBIDDEN) {
|
|
59
|
+
if (specifiers.some((specifier) => rule.test(specifier))) hits.push(rule.id);
|
|
60
|
+
}
|
|
61
|
+
return hits;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Static module specifiers for an entry, from a Bun metafile.
|
|
66
|
+
* Includes bundled inputs and every import path (external and dynamic).
|
|
67
|
+
*
|
|
68
|
+
* @param entry - Absolute path to the entry file
|
|
69
|
+
*/
|
|
70
|
+
export async function readStaticGraphSpecifiers(
|
|
71
|
+
entry = `${import.meta.dir}/../http.ts`,
|
|
72
|
+
): Promise<readonly string[]> {
|
|
73
|
+
const result = await Bun.build({
|
|
74
|
+
entrypoints: [entry],
|
|
75
|
+
target: "bun",
|
|
76
|
+
format: "esm",
|
|
77
|
+
metafile: true,
|
|
78
|
+
});
|
|
79
|
+
if (!result.success) {
|
|
80
|
+
throw new Error(`${entry} build failed:\n${result.logs.map(String).join("\n")}`);
|
|
81
|
+
}
|
|
82
|
+
const metafile = result.metafile as GraphMetafile | undefined;
|
|
83
|
+
if (!metafile) throw new Error(`${entry} build returned no metafile`);
|
|
84
|
+
const specifiers = new Set<string>();
|
|
85
|
+
for (const [input, info] of Object.entries(metafile.inputs)) {
|
|
86
|
+
specifiers.add(input);
|
|
87
|
+
for (const imp of info.imports ?? []) specifiers.add(imp.path);
|
|
88
|
+
}
|
|
89
|
+
return [...specifiers];
|
|
90
|
+
}
|
package/src/release/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ export {
|
|
|
18
18
|
} from "./exports.ts";
|
|
19
19
|
|
|
20
20
|
export {
|
|
21
|
+
ABSOLUTE_REGRESSION_RATIO,
|
|
21
22
|
CLIENT_BUDGET_BYTES,
|
|
22
23
|
COLD_START_BUDGET_MS,
|
|
23
24
|
CONSOLE_BUDGET_BYTES,
|
|
@@ -28,6 +29,8 @@ export {
|
|
|
28
29
|
} from "./limits.ts";
|
|
29
30
|
|
|
30
31
|
export {
|
|
32
|
+
absoluteBudgetOk,
|
|
33
|
+
absoluteRegressionCeiling,
|
|
31
34
|
budgetsPass,
|
|
32
35
|
exportRegressionLimitBytes,
|
|
33
36
|
formatBudgetsMarkdown,
|
package/src/release/limits.ts
CHANGED
|
@@ -7,8 +7,13 @@
|
|
|
7
7
|
/** Kernel (edge profile) — gzipped minified bundle. */
|
|
8
8
|
export const KERNEL_EDGE_BUDGET_BYTES = 17 * 1024;
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Client runtime — gzipped minified bundle.
|
|
12
|
+
*
|
|
13
|
+
* 6 kB (was 5 kB). Idempotency inlines the okid alphabet; measured gzip is
|
|
14
|
+
* 5194, which sat over 90% of 5120.
|
|
15
|
+
*/
|
|
16
|
+
export const CLIENT_BUDGET_BYTES = 6 * 1024;
|
|
12
17
|
|
|
13
18
|
/** Console initial load — gzipped html + entry js/css (ui-next SPA, no panel-* split). */
|
|
14
19
|
export const CONSOLE_BUDGET_BYTES = 700 * 1024;
|
|
@@ -27,3 +32,13 @@ export const EXPORT_REGRESSION_TOLERANCE_RATIO = 0.02;
|
|
|
27
32
|
|
|
28
33
|
/** Minimum allowed growth (bytes) before a subpath export fails regression. */
|
|
29
34
|
export const EXPORT_REGRESSION_TOLERANCE_FLOOR_BYTES = 256;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Growth multiple for an absolute budget that still has room under its cap.
|
|
38
|
+
*
|
|
39
|
+
* The sample fails when it reaches this multiple of the last committed value
|
|
40
|
+
* and that multiple is still below the absolute cap. Two is the line: one
|
|
41
|
+
* cold-start run has already printed a phantom jump of about this size, so
|
|
42
|
+
* the probe re-runs before failing instead of tightening the ratio.
|
|
43
|
+
*/
|
|
44
|
+
export const ABSOLUTE_REGRESSION_RATIO = 2;
|
package/src/release/measure.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
resolveExportBudgetTargets,
|
|
14
14
|
} from "./exports.ts";
|
|
15
15
|
import {
|
|
16
|
+
ABSOLUTE_REGRESSION_RATIO,
|
|
16
17
|
CLIENT_BUDGET_BYTES,
|
|
17
18
|
COLD_START_BUDGET_MS,
|
|
18
19
|
CONSOLE_BUDGET_BYTES,
|
|
@@ -80,8 +81,18 @@ export interface BudgetSample {
|
|
|
80
81
|
readonly label: string;
|
|
81
82
|
/** Measured value. */
|
|
82
83
|
readonly value: number;
|
|
83
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* Absolute cap, or the regression ceiling for export samples.
|
|
86
|
+
* Landing copy reads this as the published cap — do not replace it
|
|
87
|
+
* with {@link regressionLimit}.
|
|
88
|
+
*/
|
|
84
89
|
readonly limit: number;
|
|
90
|
+
/**
|
|
91
|
+
* Tighter growth ceiling (`ABSOLUTE_REGRESSION_RATIO` × last committed
|
|
92
|
+
* value) when that multiple is still under {@link limit}. Absent when
|
|
93
|
+
* the absolute cap is the only gate.
|
|
94
|
+
*/
|
|
95
|
+
readonly regressionLimit?: number;
|
|
85
96
|
/** Unit for display / snapshot. */
|
|
86
97
|
readonly unit: "bytes" | "ms";
|
|
87
98
|
/** Gate mode. */
|
|
@@ -298,7 +309,11 @@ process.stdout.write(String(Bun.gzipSync(new Uint8Array(raw)).byteLength));
|
|
|
298
309
|
}
|
|
299
310
|
|
|
300
311
|
/**
|
|
301
|
-
* Gzip size of the client runtime bundle.
|
|
312
|
+
* Gzip size of the client runtime bundle (one file, no split).
|
|
313
|
+
*
|
|
314
|
+
* If this build ever uses `splitting`, the gate must count the entry plus
|
|
315
|
+
* every chunk it imports statically. The entry file alone under-counts the
|
|
316
|
+
* first download when a shared chunk loads with it.
|
|
302
317
|
*/
|
|
303
318
|
export async function measureClientGzipBytes(): Promise<number> {
|
|
304
319
|
const entry = `${import.meta.dir}/../client/budget-entry.ts`;
|
|
@@ -451,17 +466,66 @@ process.stdout.write(String(ms));
|
|
|
451
466
|
/**
|
|
452
467
|
* Median cold-start ms across Bun subprocesses.
|
|
453
468
|
*
|
|
454
|
-
* Takes the best of up to five rounds
|
|
455
|
-
*
|
|
469
|
+
* Takes the best of up to five rounds and returns as soon as one round is
|
|
470
|
+
* under `exitBelowMs`. If every round is still at or above that line, runs
|
|
471
|
+
* one confirmation round and keeps the minimum. A single noisy run has
|
|
472
|
+
* printed a phantom jump of about 2×; the confirmation is what keeps that
|
|
473
|
+
* from failing the regression gate.
|
|
474
|
+
*
|
|
475
|
+
* @param exitBelowMs - Stop when a round is under this (regression ceiling, or the 75 ms cap)
|
|
456
476
|
*/
|
|
457
|
-
export async function measureColdStartMedianMs(
|
|
477
|
+
export async function measureColdStartMedianMs(
|
|
478
|
+
exitBelowMs = COLD_START_BUDGET_MS,
|
|
479
|
+
): Promise<number> {
|
|
458
480
|
let best = Number.POSITIVE_INFINITY;
|
|
459
481
|
for (let round = 0; round < 5; round++) {
|
|
460
482
|
const median = await measureColdStartMedianMsOnce();
|
|
461
483
|
if (median < best) best = median;
|
|
462
|
-
if (best <
|
|
484
|
+
if (best < exitBelowMs) return best;
|
|
463
485
|
}
|
|
464
|
-
|
|
486
|
+
const confirm = await measureColdStartMedianMsOnce();
|
|
487
|
+
return Math.min(best, confirm);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Growth ceiling for an absolute budget that still has room under its cap.
|
|
492
|
+
*
|
|
493
|
+
* Undefined when there is no positive baseline, or when doubling would
|
|
494
|
+
* already miss the absolute cap (kernel and client today). Zero baselines
|
|
495
|
+
* (routing p99 reads as 0 ms) stay on the absolute cap — a ratio of zero
|
|
496
|
+
* would fail the next positive sample.
|
|
497
|
+
*
|
|
498
|
+
* @param previous - Last committed value, if the snapshot has this id
|
|
499
|
+
* @param absoluteLimit - Published cap
|
|
500
|
+
* @param unit - Rounding: whole bytes, or milliseconds to 0.001
|
|
501
|
+
*/
|
|
502
|
+
export function absoluteRegressionCeiling(
|
|
503
|
+
previous: number | undefined,
|
|
504
|
+
absoluteLimit: number,
|
|
505
|
+
unit: BudgetSample["unit"],
|
|
506
|
+
): number | undefined {
|
|
507
|
+
if (previous === undefined || !(previous > 0)) return undefined;
|
|
508
|
+
const raw = previous * ABSOLUTE_REGRESSION_RATIO;
|
|
509
|
+
const ceiling = unit === "bytes" ? Math.round(raw) : Math.round(raw * 1000) / 1000;
|
|
510
|
+
if (ceiling >= absoluteLimit) return undefined;
|
|
511
|
+
return ceiling;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* True when a rounded absolute sample is under the cap and any regression ceiling.
|
|
516
|
+
*
|
|
517
|
+
* @param value - Rounded measurement
|
|
518
|
+
* @param absoluteLimit - Published cap
|
|
519
|
+
* @param regressionLimit - Growth ceiling, when the cap would still allow it
|
|
520
|
+
*/
|
|
521
|
+
export function absoluteBudgetOk(
|
|
522
|
+
value: number,
|
|
523
|
+
absoluteLimit: number,
|
|
524
|
+
regressionLimit: number | undefined,
|
|
525
|
+
): boolean {
|
|
526
|
+
if (value >= absoluteLimit) return false;
|
|
527
|
+
if (regressionLimit !== undefined && value >= regressionLimit) return false;
|
|
528
|
+
return true;
|
|
465
529
|
}
|
|
466
530
|
|
|
467
531
|
/**
|
|
@@ -542,8 +606,15 @@ export async function measureAllBudgets(): Promise<BudgetsSnapshot> {
|
|
|
542
606
|
const previous = await loadPreviousBudgetValues();
|
|
543
607
|
|
|
544
608
|
// Cold start alone first — parallel gzip work contends for CPU on CI and
|
|
545
|
-
// falsely inflates the wall-clock probe.
|
|
546
|
-
|
|
609
|
+
// falsely inflates the wall-clock probe. Exit under the 2× ceiling when
|
|
610
|
+
// that line is tighter than 75 ms, so a phantom jump gets another round
|
|
611
|
+
// instead of being recorded.
|
|
612
|
+
const coldCeiling = absoluteRegressionCeiling(
|
|
613
|
+
previous.get("coldStartMedianMs"),
|
|
614
|
+
COLD_START_BUDGET_MS,
|
|
615
|
+
"ms",
|
|
616
|
+
);
|
|
617
|
+
const coldStartMedianMs = await measureColdStartMedianMs(coldCeiling ?? COLD_START_BUDGET_MS);
|
|
547
618
|
const [kernelEdgeGzipBytes, clientGzipBytes, consoleInitialGzipBytes, httpPing] =
|
|
548
619
|
await Promise.all([
|
|
549
620
|
measureKernelEdgeGzipBytes(),
|
|
@@ -562,6 +633,7 @@ export async function measureAllBudgets(): Promise<BudgetsSnapshot> {
|
|
|
562
633
|
"bytes",
|
|
563
634
|
"absolute",
|
|
564
635
|
"core",
|
|
636
|
+
previous,
|
|
565
637
|
),
|
|
566
638
|
sample(
|
|
567
639
|
"clientGzipBytes",
|
|
@@ -571,6 +643,7 @@ export async function measureAllBudgets(): Promise<BudgetsSnapshot> {
|
|
|
571
643
|
"bytes",
|
|
572
644
|
"absolute",
|
|
573
645
|
"core",
|
|
646
|
+
previous,
|
|
574
647
|
),
|
|
575
648
|
sample(
|
|
576
649
|
"consoleInitialGzipBytes",
|
|
@@ -580,6 +653,7 @@ export async function measureAllBudgets(): Promise<BudgetsSnapshot> {
|
|
|
580
653
|
"bytes",
|
|
581
654
|
"absolute",
|
|
582
655
|
"core",
|
|
656
|
+
previous,
|
|
583
657
|
),
|
|
584
658
|
sample(
|
|
585
659
|
"coldStartMedianMs",
|
|
@@ -589,6 +663,7 @@ export async function measureAllBudgets(): Promise<BudgetsSnapshot> {
|
|
|
589
663
|
"ms",
|
|
590
664
|
"absolute",
|
|
591
665
|
"core",
|
|
666
|
+
previous,
|
|
592
667
|
),
|
|
593
668
|
sample(
|
|
594
669
|
"routingP99Ms",
|
|
@@ -598,6 +673,7 @@ export async function measureAllBudgets(): Promise<BudgetsSnapshot> {
|
|
|
598
673
|
"ms",
|
|
599
674
|
"absolute",
|
|
600
675
|
"core",
|
|
676
|
+
previous,
|
|
601
677
|
),
|
|
602
678
|
regressionSample(
|
|
603
679
|
"httpPingGzipBytes",
|
|
@@ -648,9 +724,7 @@ export function formatBudgetsReport(snapshot: BudgetsSnapshot): string {
|
|
|
648
724
|
lines.push(GROUP_HEADINGS[group]);
|
|
649
725
|
for (const b of rows) {
|
|
650
726
|
const flag = b.ok ? "ok" : "FAIL";
|
|
651
|
-
lines.push(
|
|
652
|
-
` [${flag}] ${b.label}: ${formatValue(b.value, b.unit)} < ${formatValue(b.limit, b.unit)}`,
|
|
653
|
-
);
|
|
727
|
+
lines.push(` [${flag}] ${b.label}: ${formatValue(b.value, b.unit)} < ${formatBound(b)}`);
|
|
654
728
|
}
|
|
655
729
|
}
|
|
656
730
|
return `${lines.join("\n")}\n`;
|
|
@@ -692,7 +766,7 @@ export function formatBudgetsMarkdown(snapshot: BudgetsSnapshot): string {
|
|
|
692
766
|
"",
|
|
693
767
|
`_okengine v${snapshot.version} · measured ${snapshot.measuredAt}_`,
|
|
694
768
|
"",
|
|
695
|
-
"Core rows are absolute AGENTS caps (plus HTTP-ping regression samples). Exports, Plugins, and Drivers fail on regression vs the prior [`budgets.json`](budgets.json) (max +256 B or +2%). Export gzip excludes hard/optional externals (`zod`, `sently`, `oxc-parser`, `ajv`, DuckDB, FormatJS). The `okengine` export row is the **thin root** (gzip); use `okengine/full` for the legacy mega-barrel and `okengine/http` for HTTP-only apps.",
|
|
769
|
+
"Core rows are absolute AGENTS caps (plus HTTP-ping regression samples). An absolute sample also fails when it reaches 2× its last committed value and that multiple is still under the cap (cold start, and any other absolute row with the same headroom). Cold start keeps the best of five rounds and confirms a failure once, so one noisy run does not fail. Exports, Plugins, and Drivers fail on regression vs the prior [`budgets.json`](budgets.json) (max +256 B or +2%). Export gzip excludes hard/optional externals (`zod`, `sently`, `oxc-parser`, `ajv`, DuckDB, FormatJS). The `okengine` export row is the **thin root** (gzip); use `okengine/full` for the legacy mega-barrel and `okengine/http` for HTTP-only apps.",
|
|
696
770
|
];
|
|
697
771
|
const order: readonly BudgetGroup[] = ["core", "exports", "plugins", "drivers"];
|
|
698
772
|
for (const group of order) {
|
|
@@ -758,20 +832,37 @@ function sample(
|
|
|
758
832
|
unit: BudgetSample["unit"],
|
|
759
833
|
gate: BudgetGate,
|
|
760
834
|
group: BudgetGroup,
|
|
835
|
+
previous?: ReadonlyMap<string, number>,
|
|
761
836
|
): BudgetSample {
|
|
762
837
|
const rounded = unit === "bytes" ? Math.round(value) : Math.round(value * 1000) / 1000;
|
|
838
|
+
const regressionLimit =
|
|
839
|
+
gate === "absolute" ? absoluteRegressionCeiling(previous?.get(id), limit, unit) : undefined;
|
|
763
840
|
return {
|
|
764
841
|
id,
|
|
765
842
|
label,
|
|
766
843
|
value: rounded,
|
|
767
844
|
limit,
|
|
845
|
+
...(regressionLimit !== undefined ? { regressionLimit } : {}),
|
|
768
846
|
unit,
|
|
769
847
|
gate,
|
|
770
848
|
group,
|
|
771
|
-
ok: rounded
|
|
849
|
+
ok: absoluteBudgetOk(rounded, limit, regressionLimit),
|
|
772
850
|
};
|
|
773
851
|
}
|
|
774
852
|
|
|
853
|
+
/**
|
|
854
|
+
* CI log bound. When the 2× ceiling is tighter than the cap, print both.
|
|
855
|
+
*
|
|
856
|
+
* @param sample - Measured row
|
|
857
|
+
*/
|
|
858
|
+
function formatBound(row: BudgetSample): string {
|
|
859
|
+
const ceiling = row.regressionLimit;
|
|
860
|
+
if (ceiling !== undefined && ceiling < row.limit) {
|
|
861
|
+
return `${formatValue(ceiling, row.unit)} (cap ${formatValue(row.limit, row.unit)})`;
|
|
862
|
+
}
|
|
863
|
+
return formatValue(row.limit, row.unit);
|
|
864
|
+
}
|
|
865
|
+
|
|
775
866
|
/**
|
|
776
867
|
* Byte sample gated against the previous committed value (+ tolerance).
|
|
777
868
|
* First appearance records a baseline (`ok: true`, `limit` = value + floor).
|
|
@@ -81,6 +81,7 @@ describe("createTestApp — four-applications surface", () => {
|
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
const t = await createTestApp(app, {
|
|
84
|
+
capability: "open",
|
|
84
85
|
gates: [member],
|
|
85
86
|
signals: [orderPlaced],
|
|
86
87
|
boot: {
|
|
@@ -116,7 +117,7 @@ describe("createTestApp — four-applications surface", () => {
|
|
|
116
117
|
resetBindings();
|
|
117
118
|
resetFlowSeq();
|
|
118
119
|
const app = oke({ name: "ai-harness", env: "test" });
|
|
119
|
-
const t = await createTestApp(app);
|
|
120
|
+
const t = await createTestApp(app, { capability: "open" });
|
|
120
121
|
t.ai.mock("ticket-triage", { urgency: "high", team: "ops" });
|
|
121
122
|
expect(t.ai.cost()).toBeLessThan(0.02);
|
|
122
123
|
await t.close();
|
|
@@ -131,6 +132,7 @@ describe("createTestApp — vault gaps still fail boot", () => {
|
|
|
131
132
|
|
|
132
133
|
try {
|
|
133
134
|
await createTestApp(app, {
|
|
135
|
+
capability: "open",
|
|
134
136
|
secrets: [vault("A", { description: "alpha" }), vault("B", { description: "beta" })],
|
|
135
137
|
boot: {
|
|
136
138
|
env: "prod",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import { stat } from "node:fs/promises";
|
|
17
18
|
import {
|
|
18
19
|
createMockAiDriver,
|
|
19
20
|
createChannelInbox,
|
|
@@ -29,6 +30,7 @@ import type { GateDecl } from "../elements/gate.ts";
|
|
|
29
30
|
import { flattenGatePolicies } from "../elements/gate/config.ts";
|
|
30
31
|
import type { SignalDecl } from "../elements/signal.ts";
|
|
31
32
|
import type { VaultSecretDecl } from "../elements/vault.ts";
|
|
33
|
+
import { extractManifest } from "../compiler/extract.ts";
|
|
32
34
|
import type { OkeApp } from "../kernel/app.ts";
|
|
33
35
|
import type { BootOptions } from "../kernel/boot.ts";
|
|
34
36
|
import type { EffectEntry } from "../kernel/effects.ts";
|
|
@@ -212,6 +214,26 @@ export interface CreateTestAppOptions {
|
|
|
212
214
|
readonly vaultSecrets?: Readonly<Record<string, string>>;
|
|
213
215
|
/** Start the background scheduler (default false). */
|
|
214
216
|
readonly startScheduler?: boolean;
|
|
217
|
+
/**
|
|
218
|
+
* `manifest` (default) extracts the app and stamps capability tokens.
|
|
219
|
+
* `open` keeps an ungated token for inline flows that are not an app.
|
|
220
|
+
*/
|
|
221
|
+
readonly capability?: "manifest" | "open";
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* True when `dir` is an app tree (`oke.config.ts` or `src/flows`).
|
|
226
|
+
*
|
|
227
|
+
* @param dir - Candidate root
|
|
228
|
+
*/
|
|
229
|
+
async function isTestAppRoot(dir: string): Promise<boolean> {
|
|
230
|
+
if (await Bun.file(`${dir}/oke.config.ts`).exists()) return true;
|
|
231
|
+
try {
|
|
232
|
+
const info = await stat(`${dir}/src/flows`);
|
|
233
|
+
return info.isDirectory();
|
|
234
|
+
} catch {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
215
237
|
}
|
|
216
238
|
|
|
217
239
|
/**
|
|
@@ -270,8 +292,26 @@ export async function createTestApp<App extends OkeApp>(
|
|
|
270
292
|
};
|
|
271
293
|
const rawGates = options.gates ?? options.boot?.gates ?? appOpts.gate?.policies;
|
|
272
294
|
|
|
295
|
+
const capability = options.capability ?? "manifest";
|
|
296
|
+
let manifest = options.boot?.manifest;
|
|
297
|
+
let rootDir = options.boot?.rootDir;
|
|
298
|
+
if (capability === "manifest" && manifest === undefined) {
|
|
299
|
+
const explicit = rootDir ?? process.env["OKE_ROOT_DIR"];
|
|
300
|
+
const discovered =
|
|
301
|
+
explicit ?? ((await isTestAppRoot(process.cwd())) ? process.cwd() : undefined);
|
|
302
|
+
if (!discovered) {
|
|
303
|
+
throw new Error(
|
|
304
|
+
'createTestApp: no app root. Pass capability: "open" for inline flows, or rootDir for an app tree.',
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
rootDir = discovered;
|
|
308
|
+
manifest = await extractManifest({ rootDir: discovered });
|
|
309
|
+
}
|
|
310
|
+
|
|
273
311
|
await app.boot({
|
|
274
312
|
...(options.boot ?? {}),
|
|
313
|
+
...(capability === "manifest" && rootDir !== undefined ? { rootDir } : {}),
|
|
314
|
+
...(capability === "manifest" && manifest !== undefined ? { manifest } : {}),
|
|
275
315
|
env: "test",
|
|
276
316
|
config,
|
|
277
317
|
// Test-only opt-out (honoured because env is "test" below). Production
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e}from"./xyflow-yApv7D4e.js";import{Er as t}from"./shortcut-keys-3ILd8oGn.js";import{X as n,c as r,l as i}from"./index-Cul17AcV.js";var a=e();function o({open:e,openHeight:o=`auto`,className:s,style:c,transition:l,...u}){let d=i()??!1;return(0,a.jsx)(r.div,{...u,"aria-hidden":!e,inert:!e||void 0,initial:!1,animate:d?{opacity:+!!e}:{opacity:+!!e,clipPath:e?`inset(0 0 0% 0)`:`inset(0 0 100% 0)`,y:e?0:-4},transition:l??{duration:d?0:e?.22:.14,ease:n},className:t(`overflow-hidden`,s),style:{...c,height:e?o:0,pointerEvents:e?void 0:`none`,transformOrigin:`top`}})}export{o as t};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{r as t}from"./react-dom-Ddte4I-Q.js";import{A as n}from"./xyflow-yApv7D4e.js";import{B as r,C as i,F as a,G as o,H as s,I as c,J as l,K as u,M as d,O as f,P as p,S as m,T as h,U as g,V as _,W as v,Y as y,_ as b,b as x,d as S,f as C,g as w,h as T,j as ee,k as te,m as E,p as D,q as O,u as k,v as A,w as j,x as ne,y as re,z as M}from"./index-Cul17AcV.js";var N=[[`path`,{d:`M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],ie=[[`path`,{d:`M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],ae=[[`path`,{d:`M8 5.5L20 5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 12.5L20 12.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M8 19.5L20 19.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M4.375 5.5H4.25M4.5 5.5C4.5 5.63807 4.38807 5.75 4.25 5.75C4.11193 5.75 4 5.63807 4 5.5C4 5.36193 4.11193 5.25 4.25 5.25C4.38807 5.25 4.5 5.36193 4.5 5.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M4.375 12.5H4.25M4.5 12.5C4.5 12.6381 4.38807 12.75 4.25 12.75C4.11193 12.75 4 12.6381 4 12.5C4 12.3619 4.11193 12.25 4.25 12.25C4.38807 12.25 4.5 12.3619 4.5 12.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M4.375 19.5H4.25M4.5 19.5C4.5 19.6381 4.38807 19.75 4.25 19.75C4.11193 19.75 4 19.6381 4 19.5C4 19.3619 4.11193 19.25 4.25 19.25C4.38807 19.25 4.5 19.3619 4.5 19.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],oe=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function P(e,t){return M(e)?e[oe(0,e.length,t)]:e}var se=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return F(this.animations,`duration`)}get iterationDuration(){return F(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function F(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var ce=class extends se{then(e,t){return this.finished.finally(e).then(()=>{})}},I=[];function le(e){g(typeof e.test==`function`&&typeof e.read==`function`,`Effects passed to animate.addEffect() need test() and read().`,`effect-missing-test`),L(e),I.unshift(e)}function L(e){o(I,e)}function ue(e){return I.find(t=>t.test(e))}function de(e,t,n,r={}){let i=[];for(let a in n){let o=n[a],s=e.get(t,a);if(!s){let n=e.read(t,a,o)??fe(o);g(n!==void 0,`"${a}" can't be read from the animated subject. Provide [from, to] keyframes.`,`effect-unreadable-value`),s=f(n),e(t,{[a]:s})}s.start(j(a,s,o,h(r,a))),s.animation&&i.push(s.animation)}return i}function fe(e){let t=Array.isArray(e)?e[0]:void 0;return t===null?void 0:t}function pe(e,t){return e in t}var R=class extends T{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(pe(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return b()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},z=n(),B=e(t(),1);function V(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function me(...e){return t=>{let n=!1,r=e.map(e=>{let r=V(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():V(e[t],null)}}}}function he(...e){return B.useCallback(me(...e),e)}var ge=class extends B.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(x(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=x(e)&&e.offsetWidth||0,r=x(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function _e({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,B.useId)(),s=(0,B.useRef)(null),c=(0,B.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,B.useContext)(S),u=he(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,B.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
2
|
-
[data-motion-pop-id="${o}"] {
|
|
3
|
-
position: absolute !important;
|
|
4
|
-
width: ${e}px !important;
|
|
5
|
-
height: ${u}px !important;
|
|
6
|
-
${_}px !important;
|
|
7
|
-
${v}px !important;
|
|
8
|
-
}
|
|
9
|
-
`),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,z.jsx)(ge,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:B.cloneElement(e,{ref:u})})}var ve=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:d})=>{let f=l(ye),p=(0,B.useId)(),m=(0,B.useRef)(n),h=(0,B.useRef)(r);O(()=>{m.current=n,h.current=r});let g=!0,_=(0,B.useMemo)(()=>(g=!1,{id:p,initial:t,isPresent:n,custom:i,onExitComplete:e=>{f.set(e,!0);for(let e of f.values())if(!e)return;r&&r()},register:e=>(f.set(e,!1),()=>{f.delete(e),!m.current&&!f.size&&h.current?.()})}),[n,f,r]);return a&&g&&(_={..._}),(0,B.useMemo)(()=>{f.forEach((e,t)=>f.set(t,!1))},[n]),B.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),e=(0,z.jsx)(_e,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:d,children:e}),(0,z.jsx)(u.Provider,{value:_,children:e})};function ye(){return new Map}var H=e=>e.key||``;function U(e){let t=[];return B.Children.forEach(e,e=>{(0,B.isValidElement)(e)&&t.push(e)}),t}var be=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:u})=>{let[d,f]=k(o),p=(0,B.useMemo)(()=>U(e),[e]),m=o&&!d?[]:p.map(H),h=(0,B.useRef)(!0),g=(0,B.useRef)(p),_=l(()=>new Map),v=(0,B.useRef)(new Set),[b,x]=(0,B.useState)(p),[S,C]=(0,B.useState)(p);O(()=>{o&&!d&&!S.length&&f?.()},[d,o,S.length,f]),O(()=>{h.current=!1,g.current=p;for(let e=0;e<S.length;e++){let t=H(S[e]);m.includes(t)?(_.delete(t),v.current.delete(t)):_.get(t)!==!0&&_.set(t,!1)}},[S,m.length,m.join(`-`)]);let w=[];if(p!==b){let e=[...p],t=0;for(let n of S){let r=m.indexOf(H(n));r===-1?(e.splice(t++,0,n),w.push(n)):t=r+w.length+1}return a===`wait`&&w.length&&(e=w),C(U(e)),x(p),null}let{forceRender:T}=(0,B.useContext)(y);return(0,z.jsx)(z.Fragment,{children:S.map(e=>{let l=H(e),y=o&&!d?!1:p===S||m.includes(l);return(0,z.jsx)(ve,{isPresent:y,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:u,onExitComplete:y?void 0:()=>{if(v.current.has(l))return;if(_.has(l))v.current.add(l),_.set(l,!0);else return;let e=!0;_.forEach(t=>{t||(e=!1)}),e&&(T?.(),C(g.current),o&&f?.(),r&&r())},anchorX:s,anchorY:c,children:e},l)})})};function W(e){return typeof e==`object`&&!Array.isArray(e)}function G(e,t,n,r){return e==null?[]:typeof e==`string`&&W(t)?ne(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function xe(e,t,n){return e*(t+1)+n*t}function K(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function Se(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(o(e,i),r--)}}function Ce(e,t,n,r,i,a){Se(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:c(i,a,r[o]),easing:P(n,o)})}function we(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Te(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Ee=`easeInOut`,q=20;function De(e,{defaultTransition:t={},...n}={},o,c){let l=t.duration||.3,u=new Map,f=new Map,p={},m=new Map,h=0,g=0,y=0;for(let n=0;n<e.length;n++){let s=e[n];if(typeof s==`string`){m.set(s,g);continue}if(!Array.isArray(s)){m.set(s.name,K(g,s.at,h,m));continue}let[u,b,x={}]=s;x.at!==void 0&&(g=K(g,x.at,h,m));let S=0,C=(e,n,i,o=0,s=0)=>{let u=Oe(e),{delay:f=0,times:p=ee(u),type:m=t.type||`keyframes`,repeat:h,repeatType:b,repeatDelay:x=0,...C}=n,{ease:w=t.ease||`easeOut`,duration:T}=n,E=typeof f==`function`?f(o,s):f,D=u.length,O=te(m)?m:c?.[m||`keyframes`];if(D<=2&&O){let e=100;if(D===2&&je(u)){let t=u[1]-u[0];e=Math.abs(t)}let n={...t,...C};T!==void 0&&(n.duration=_(T));let r=a(n,e,O);w=r.ease,T=r.duration}T??=l;let k=g+E;p.length===1&&p[0]===0&&(p[1]=1);let A=p.length-u.length;if(A>0&&d(p,A),u.length===1&&u.unshift(null),h&&v(h<q,`Sequence segments can't repeat ${h} times — ignoring repeat option. Use a value below ${q} or apply repeat at the sequence level instead.`),h&&h<q){let e=T>0?x/T:0;T=xe(T,h,x);let t=[...u],n=[...p];w=Array.isArray(w)?[...w]:[w];let i=[...w],a=b===`reverse`||b===`mirror`,o=t,s=i;a&&(o=[...t].reverse(),b===`reverse`&&(s=[...i].reverse().map(e=>typeof e==`function`?r(e):e)));for(let r=0;r<h;r++){let c=a&&r%2==0,l=c?o:t,d=c?s:i,f=(r+1)*(1+e);e>0&&(u.push(u[u.length-1]),p.push(f),w.push(`linear`)),u.push(...l);for(let e=0;e<l.length;e++)p.push(n[e]+f),w.push(e===0?`linear`:P(d,e-1))}we(p,h,e)}let j=k+T;Ce(i,u,w,p,k,j),S=Math.max(E+T,S),y=Math.max(j,y)};if(i(u)){let e=J(u,f);C(b,x,Y(`default`,e))}else{let e=G(u,b,o,p),t=e.length;for(let n=0;n<t;n++){b=b,x=x;let r=e[n],i=J(r,f);for(let e in b)C(b[e],ke(x,e),Y(e,i),n,t)}}h=g,g+=S}return f.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Te);let o=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];o.push(n),c.push(s(0,y,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),o.unshift(o[0]),l.unshift(Ee)),c[c.length-1]!==1&&(c.push(1),o.push(null)),u.has(r)||u.set(r,{keyframes:{},transition:{}});let d=u.get(r);d.keyframes[i]=o;let{type:f,...p}=t;d.transition[i]={...p,duration:y,ease:l,times:c,...n}}}),u}function J(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Y(e,t){return t[e]||(t[e]=[]),t[e]}function Oe(e){return Array.isArray(e)?e:[e]}function ke(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Ae=e=>typeof e==`number`,je=e=>e.every(Ae);function Me(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=re(e)&&!A(e)?new D(t):new E(t);n.mount(e),w.set(e,n)}function Ne(e){let t=new R({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),w.set(e,t)}function X(e,t){return i(e)||typeof e==`number`||typeof e==`string`&&!W(t)}function Z(e,t,n,r){let i=[];if(X(e,t))i.push(C(e,W(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=G(e,t,r),o=a.length;g(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o));let c=r instanceof Element,l=c?void 0:ue(r);if(l){i.push(...de(l,r,t,s));continue}let u=c?Me:Ne;w.has(r)||u(r);let d=w.get(r);i.push(...m(d,{...t,transition:s},{}))}}return i}function Pe(e,t,n){let r=[];return De(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=f(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:p}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Z(n,e,t))}),r}function Fe(e){return Array.isArray(e)&&e.some(Array.isArray)}function Ie(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let s=[],c,l={};if(n!==void 0&&(l.reduceMotion=n),r!==void 0&&(l.skipAnimations=r),Fe(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(c=n),s=Pe(e,{...l,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(c=n),s=Z(e,i,{...l,...r},t)}let u=new ce(s);return c&&u.finished.then(c),t&&(t.animations.push(u),u.finished.then(()=>{o(t.animations,u)})),u}return i}var Le=Object.assign(Ie(),{addEffect:le,removeEffect:L}),Re=[{tone:`fast`,belowMs:10},{tone:`good`,belowMs:50},{tone:`ok`,belowMs:100},{tone:`elevated`,belowMs:250},{tone:`warn`,belowMs:500},{tone:`slow`,belowMs:1e3},{tone:`bad`,belowMs:5e3}];function Q(e){if(!Number.isFinite(e)||e<0)return`fast`;for(let t of Re)if(e<t.belowMs)return t.tone;return`critical`}function $(e){switch(e){case`fast`:return`text-emerald-500 dark:text-emerald-400`;case`good`:return`text-emerald-600 dark:text-emerald-300`;case`ok`:return`text-lime-600 dark:text-lime-400`;case`elevated`:return`text-yellow-600 dark:text-yellow-400`;case`warn`:return`text-amber-600 dark:text-amber-400`;case`slow`:return`text-orange-600 dark:text-orange-400`;case`bad`:return`text-destructive`;case`critical`:return`text-rose-700 dark:text-rose-400`}}function ze(e){return $(Q(e))}export{be as a,N as c,Le as i,Q as n,ae as o,$ as r,ie as s,ze as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{r as t}from"./react-dom-Ddte4I-Q.js";import{A as n}from"./xyflow-yApv7D4e.js";import{Dr as r,E as i,Er as a,F as o,I as s,R as c,T as l,cr as u,gr as d,t as f}from"./shortcut-keys-3ILd8oGn.js";var p=[[`path`,{d:`M13.427 8.08396C12.8007 5.84272 12.3226 4 11.0004 4C9.67824 4 9.19964 5.84274 8.5731 8.08399C8.31853 8.99465 8.19125 9.44998 7.82042 9.82077C7.4496 10.1916 6.99434 10.3188 6.08381 10.5732C3.84273 11.1995 2 11.6775 2 13C2 14.3225 3.84273 14.8005 6.08381 15.4268C6.99434 15.6812 7.4496 15.8084 7.82042 16.1792C8.19125 16.55 8.31853 17.0054 8.5731 17.916C9.19964 20.1573 9.67824 22 11.0004 22C12.3226 22 12.8007 20.1573 13.427 17.916C13.6815 17.0054 13.8087 16.5501 14.1795 16.1793C14.5504 15.8085 15.0056 15.6812 15.9162 15.4268C18.1573 14.8005 20 14.3225 20 13C20 11.6775 18.1573 11.1995 15.9162 10.5732C15.0056 10.3188 14.5504 10.1915 14.1795 9.8207C13.8087 9.44986 13.6815 8.99456 13.427 8.08396Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19.5 2.9375V4.5M19.5 4.5V6.0625M19.5 4.5H18.25M19.5 4.5H20.75M22 4.5L21.548 4.34934C20.8497 4.11658 20.5006 4.00019 20.2502 3.74981C19.9998 3.49942 19.8834 3.15027 19.6507 2.45198L19.5 2L19.3493 2.45198C19.1166 3.15027 19.0002 3.49942 18.7498 3.74981C18.4994 4.00019 18.1503 4.11658 17.452 4.34934L17 4.5L17.452 4.65066C18.1503 4.88342 18.4994 4.99981 18.7498 5.25019C19.0002 5.50058 19.1166 5.84973 19.3493 6.54802L19.5 7L19.6507 6.54802C19.8834 5.84973 19.9998 5.50058 20.2502 5.25019C20.5006 4.99981 20.8497 4.88342 21.548 4.65066L22 4.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],m=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 8V12L14 14`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],h=[[`path`,{d:`M7.5 14.5C7.5 11.2002 7.5 9.55025 8.52513 8.52513C9.55025 7.5 11.2002 7.5 14.5 7.5C17.7998 7.5 19.4497 7.5 20.4749 8.52513C21.5 9.55025 21.5 11.2002 21.5 14.5C21.5 17.7998 21.5 19.4497 20.4749 20.4749C19.4497 21.5 17.7998 21.5 14.5 21.5C11.2002 21.5 9.55025 21.5 8.52513 20.4749C7.5 19.4497 7.5 17.7998 7.5 14.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7.5 16.5C6.10355 16.5 5.40533 16.5 4.84402 16.3036C3.83866 15.9518 3.0482 15.1613 2.69641 14.156C2.5 13.5947 2.5 12.8964 2.5 11.5V9.5C2.5 6.20017 2.5 4.55025 3.52513 3.52513C4.55025 2.5 6.20017 2.5 9.5 2.5H11.5C12.8964 2.5 13.5947 2.5 14.156 2.69641C15.1613 3.0482 15.9518 3.83866 16.3036 4.84402C16.5 5.40533 16.5 6.10355 16.5 7.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],g=[[`path`,{d:`M3 12C3 7.75736 3 5.63604 4.31802 4.31802C5.63604 3 7.75736 3 12 3C16.2426 3 18.364 3 19.682 4.31802C21 5.63604 21 7.75736 21 12C21 16.2426 21 18.364 19.682 19.682C18.364 21 16.2426 21 12 21C7.75736 21 5.63604 21 4.31802 19.682C3 18.364 3 16.2426 3 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M3 12H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M11 7.5L17 7.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M7.125 7.5H7M7.25 7.5C7.25 7.63807 7.13807 7.75 7 7.75C6.86193 7.75 6.75 7.63807 6.75 7.5C6.75 7.36193 6.86193 7.25 7 7.25C7.13807 7.25 7.25 7.36193 7.25 7.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M11 16.5L17 16.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M7.125 16.5H7M7.25 16.5C7.25 16.6381 7.13807 16.75 7 16.75C6.86193 16.75 6.75 16.6381 6.75 16.5C6.75 16.3619 6.86193 16.25 7 16.25C7.13807 16.25 7.25 16.3619 7.25 16.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],_=[[`path`,{d:`M8 7L16 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 11L12 11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M13 21.5V21C13 18.1716 13 16.7574 13.8787 15.8787C14.7574 15 16.1716 15 19 15H19.5M20 13.3431V10C20 6.22876 20 4.34315 18.8284 3.17157C17.6569 2 15.7712 2 12 2C8.22877 2 6.34315 2 5.17157 3.17157C4 4.34314 4 6.22876 4 10L4 14.5442C4 17.7892 4 19.4117 4.88607 20.5107C5.06508 20.7327 5.26731 20.9349 5.48933 21.1139C6.58831 22 8.21082 22 11.4558 22C12.1614 22 12.5141 22 12.8372 21.886C12.9044 21.8623 12.9702 21.835 13.0345 21.8043C13.3436 21.6564 13.593 21.407 14.0919 20.9081L18.8284 16.1716C19.4065 15.5935 19.6955 15.3045 19.8478 14.9369C20 14.5694 20 14.1606 20 13.3431Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],v=[[`path`,{d:`M18 4.5C18 5.88071 16.8807 7 15.5 7C14.1193 7 13 5.88071 13 4.5C13 3.11929 14.1193 2 15.5 2C16.8807 2 18 3.11929 18 4.5Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18 19.5C18 20.8807 16.8807 22 15.5 22C14.1193 22 13 20.8807 13 19.5C13 18.1193 14.1193 17 15.5 17C16.8807 17 18 18.1193 18 19.5Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M10 12C10 14.2091 8.20914 16 6 16C3.79086 16 2 14.2091 2 12C2 9.79086 3.79086 8 6 8C8.20914 8 10 9.79086 10 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M22 4.50006L18 4.49997M6 7.99988C6 6.59542 6 5.89319 6.33706 5.38874C6.48298 5.17036 6.67048 4.98286 6.88886 4.83694C7.39331 4.49988 8.09554 4.49988 9.5 4.49988H13M22 19.5002L18 19.5001M6 16.0002C6 17.4046 6 18.1069 6.33706 18.6113C6.48298 18.8297 6.67048 19.0172 6.88886 19.1631C7.39331 19.5002 8.09554 19.5002 9.5 19.5002H13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],y=[[`path`,{d:`M8.5 19.5V20M9.5 20C9.5 20.5523 9.05228 21 8.5 21C7.94772 21 7.5 20.5523 7.5 20C7.5 19.4477 7.94772 19 8.5 19C9.05228 19 9.5 19.4477 9.5 20Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15.5 19.5V20M16.5 20C16.5 20.5523 16.0523 21 15.5 21C14.9477 21 14.5 20.5523 14.5 20C14.5 19.4477 14.9477 19 15.5 19C16.0523 19 16.5 19.4477 16.5 20Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M8.5 3.5V4M9.5 4C9.5 4.55228 9.05228 5 8.5 5C7.94772 5 7.5 4.55228 7.5 4C7.5 3.44772 7.94772 3 8.5 3C9.05228 3 9.5 3.44772 9.5 4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M8.5 11.5V12M9.5 12C9.5 12.5523 9.05228 13 8.5 13C7.94772 13 7.5 12.5523 7.5 12C7.5 11.4477 7.94772 11 8.5 11C9.05228 11 9.5 11.4477 9.5 12Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M15.5 3.5V4M16.5 4C16.5 4.55228 16.0523 5 15.5 5C14.9477 5 14.5 4.55228 14.5 4C14.5 3.44772 14.9477 3 15.5 3C16.0523 3 16.5 3.44772 16.5 4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M15.5 11.5V12M16.5 12C16.5 12.5523 16.0523 13 15.5 13C14.9477 13 14.5 12.5523 14.5 12C14.5 11.4477 14.9477 11 15.5 11C16.0523 11 16.5 11.4477 16.5 12Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],b=[[`path`,{d:`M4 18.001C2.74418 16.3295 2 14.2516 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 14.2516 21.2558 16.3295 20 18.001`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7.52779 16C6.57771 14.9385 6 13.5367 6 12C6 8.68629 8.68629 6 12 6C15.3137 6 18 8.68629 18 12C18 13.5367 17.4223 14.9385 16.4722 16`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12 12V22M9 22H15`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}]],x=[[`path`,{d:`M15.5 14.5C18.8137 14.5 21.5 11.8137 21.5 8.5C21.5 5.18629 18.8137 2.5 15.5 2.5C12.1863 2.5 9.5 5.18629 9.5 8.5C9.5 9.38041 9.68962 10.2165 10.0303 10.9697L2.5 18.5V21.5H5.5V19.5H7.5V17.5H9.5L13.0303 13.9697C13.7835 14.3104 14.6196 14.5 15.5 14.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M17.5 6.5L16.5 7.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],S=[[`path`,{d:`M11 3H13C16.7712 3 18.6569 3 19.8284 4.17157C21 5.34315 21 7.22876 21 11V13C21 16.7712 21 18.6569 19.8284 19.8284C18.6569 21 16.7712 21 13 21H11C7.22876 21 5.34315 21 4.17157 19.8284C3 18.6569 3 16.7712 3 13V11C3 7.22876 3 5.34315 4.17157 4.17157C5.34315 3 7.22876 3 11 3Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8.00488 16.0049L8.00488 8.00488`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],C=[[`path`,{d:`M11 3H13C16.7712 3 18.6569 3 19.8284 4.17157C21 5.34315 21 7.22876 21 11V13C21 16.7712 21 18.6569 19.8284 19.8284C18.6569 21 16.7712 21 13 21H11C7.22876 21 5.34315 21 4.17157 19.8284C3 18.6569 3 16.7712 3 13V11C3 7.22876 3 5.34315 4.17157 4.17157C5.34315 3 7.22876 3 11 3Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M16 8L16 16`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],w=[[`path`,{d:`M2 6L8.91302 9.91697C11.4616 11.361 12.5384 11.361 15.087 9.91697L22 6`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2.01577 13.4756C2.08114 16.5412 2.11383 18.0739 3.24496 19.2094C4.37608 20.3448 5.95033 20.3843 9.09883 20.4634C11.0393 20.5122 12.9607 20.5122 14.9012 20.4634C18.0497 20.3843 19.6239 20.3448 20.7551 19.2094C21.8862 18.0739 21.9189 16.5412 21.9842 13.4756C22.0053 12.4899 22.0053 11.5101 21.9842 10.5244C21.9189 7.45886 21.8862 5.92609 20.7551 4.79066C19.6239 3.65523 18.0497 3.61568 14.9012 3.53657C12.9607 3.48781 11.0393 3.48781 9.09882 3.53656C5.95033 3.61566 4.37608 3.65521 3.24495 4.79065C2.11382 5.92608 2.08114 7.45885 2.01576 10.5244C1.99474 11.5101 1.99475 12.4899 2.01577 13.4756Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],T=[[`path`,{d:`M18.7088 3.49534C16.8165 2.55382 14.5009 2 12 2C9.4991 2 7.1835 2.55382 5.29116 3.49534C4.36318 3.95706 3.89919 4.18792 3.4496 4.91378C3 5.63965 3 6.34248 3 7.74814V11.2371C3 16.9205 7.54236 20.0804 10.173 21.4338C10.9067 21.8113 11.2735 22 12 22C12.7265 22 13.0933 21.8113 13.8269 21.4338C16.4576 20.0804 21 16.9205 21 11.2371L21 7.74814C21 6.34249 21 5.63966 20.5504 4.91378C20.1008 4.18791 19.6368 3.95706 18.7088 3.49534Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9 11.5C9 11.5 10.4079 11.7519 11 13.5C11 13.5 12.5 10.5 15 9.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],E=n();function D({className:e,...t}){return(0,E.jsx)(`div`,{"data-slot":`empty`,className:a(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance`,e),...t})}function ee({className:e,...t}){return(0,E.jsx)(`div`,{"data-slot":`empty-header`,className:a(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var te=l(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function ne({className:e,variant:t=`default`,...n}){return(0,E.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:a(te({variant:t,className:e})),...n})}function re({className:e,...t}){return(0,E.jsx)(`div`,{"data-slot":`empty-title`,className:a(`cn-font-heading text-sm font-medium tracking-tight`,e),...t})}function ie({className:e,...t}){return(0,E.jsx)(`div`,{"data-slot":`empty-description`,className:a(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function ae({className:e,...t}){return(0,E.jsx)(i,{flat:!0,className:a(d,e),...t})}function oe({label:e,keys:t,className:n,children:r}){return(0,E.jsxs)(o,{children:[(0,E.jsx)(c,{render:e=>(0,E.jsx)(`span`,{...e,className:a(`inline-flex items-center`,n),tabIndex:-1,children:r})}),(0,E.jsxs)(s,{side:`bottom`,className:`text-[11px]`,children:[e,t&&t.length>0?(0,E.jsx)(f,{keys:t}):null]})]})}function se({open:e,onToggle:t,noun:n,controlsId:i,dataSlot:a}){let o=e?`Collapse ${n}`:`Expand ${n}`;return(0,E.jsx)(oe,{label:o,className:`flex self-stretch`,children:(0,E.jsx)(`button`,{type:`button`,"aria-expanded":e,"aria-controls":i,"aria-label":o,"data-slot":a,onClick:t,className:u,children:(0,E.jsx)(r,{icon:e?S:C,className:`size-3.5`})})})}var O=e(t(),1);function ce(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function le(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function ue(e){return e/100*window.innerHeight}function de(e){return e/100*window.innerWidth}function fe(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function k({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=fe(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=le(t,i);break;case`em`:r=ce(t,i);break;case`vh`:r=ue(i);break;case`vw`:r=de(i)}return r}function A(e){return parseFloat(e.toFixed(3))}function j({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function pe(e){let{panels:t}=e,n=j({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=A(k({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=A(k({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=A(k({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=A(k({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function M(e,t=`Assertion error`){if(!e)throw Error(t)}function me(e,t){return Array.from(t).sort(e===`horizontal`?he:ge)}function he(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function ge(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function _e(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function ve(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function ye({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=ve(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return M(i,`No rect found`),i}var be;function xe(){return be===void 0&&(be=typeof matchMedia==`function`&&!!matchMedia(`(pointer:coarse)`).matches),be}function Se(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=me(n,Array.from(t.children).filter(_e).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,ye({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=xe()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:j({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var Ce=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0){if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},N={cursorFlags:0,state:`inactive`},P=new Ce;function F(){return N}function we(e){return P.addListener(`change`,e)}function Te(e){let t=N,n={...N};n.cursorFlags=e,N=n,P.emit(`change`,{prev:t,next:n})}function I(e){let t=N;N=e,P.emit(`change`,{prev:t,next:e})}var Ee=e=>e,L=()=>{},De=1,Oe=2,ke=4,Ae=8,je=3,Me=12,R;function Ne(){return R===void 0&&(R=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(R=!0)),R}function Pe({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++}})}if(r!==0||i!==0){if(n===`active`&&e&&Ne()){let t=(e&De)!==0,n=(e&Oe)!==0,r=(e&ke)!==0,i=(e&Ae)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}return Ne()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var Fe=new WeakMap;function Ie(e){if(!e.defaultView||!e.adoptedStyleSheets)return;let{prevStyle:t,styleSheet:n}=Fe.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=F();switch(r.state){case`active`:case`hover`:{let e=Pe({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0)}Fe.set(e,{prevStyle:t,styleSheet:n})}var z=new Map,Le=new Ce;function Re(e){z=new Map(z),z.delete(e)}function ze(e,t){for(let[t]of z)if(t.id===e)return t}function B(e,t){for(let[t,n]of z)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function V(){return z}function Be(e,t){return Le.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function H(e,t,n){let r=z.get(e);z=new Map(z),z.set(e,t),Le.emit(`groupChange`,{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t})}function Ve(e){let t=F(),n=V(),r=!1;return t.state===`active`&&(I({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(Ie(e),r=!0,t.hitRegions.forEach(e=>{if(!n.has(e.group))return;let t=B(e.group.id,!0);H(e.group,t,{isUserInteraction:!0})}))),r}function He(e){e.defaultPrevented||Ve(e.currentTarget)}function Ue(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=ve(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t)}}return r?{distance:i,hitRegion:r}:void 0}function We(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Ge(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:Ze(e),b:Ze(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();M(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:Xe(Ye(n.a)),b:Xe(Ye(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var Ke=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function qe(e){let t=getComputedStyle(Qe(e)??e).display;return t===`flex`||t===`inline-flex`}function Je(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||qe(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||Ke.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function Ye(e){let t=e.length;for(;t--;){let n=e[t];if(M(n,`Missing node`),Je(n))return n}return null}function Xe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ze(e){let t=[];for(;e;)t.push(e),e=Qe(e);return t}function Qe(e){let{parentNode:t}=e;return We(t)?t.host:t}function $e(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function et({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!_e(n)||n.contains(e)||e.contains(n))return!0;if(Ge(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if($e(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function tt(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=Se(r),a=Ue(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&et({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function nt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function U(e,t,n=0){return Math.abs(A(e)-A(t))<=n}function W(e,t){return U(e,t)?0:e>t?1:-1}function G({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(W(r,c)<0){if(a){let e=(i+c)/2;r=W(r,e)<0?i:c}else r=c}return r=Math.min(s,r),r=A(r),r}function K({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(U(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;M(u!=null,`Invalid first pivot index`),M(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];M(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(M(n!=null,`Previous layout not found for panel index ${t}`),U(n,i)){let t=o-n;W(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];M(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(M(n!=null,`Previous layout not found for panel index ${t}`),U(n,o)){let t=n-i;W(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];M(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&W(i,c)<0){if(e>0){let t=c-o,n=t/2;W(i+e,c)<0&&(e=W(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;W(i-e,c)<0&&(e=W(100+e,n)>0?0:-t)}}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];M(e!=null,`Previous layout not found for panel index ${r}`);let a=G({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];M(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=G({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!U(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(nt(c,l))return i;{let t=e<0?d:u,r=s[t];M(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=G({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!U(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];M(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=G({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(U(i,s)||(t-=s-i,l[r]=s),U(t,0))break;e>0?r--:r++}}}if(!U(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function q(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||W(e[n],t[n])!==0)return!1;return!0}function J({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!U(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];M(t!=null,`No layout data found for index ${e}`);let n=100/i*t;r[e]=n}let a=0;for(let e=0;e<t.length;e++){let i=n[e];M(i!=null,`No layout data found for index ${e}`);let o=r[e];M(o!=null,`No layout data found for index ${e}`);let s=G({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!U(a,0))for(let e=0;e<t.length;e++){let n=r[e];M(n!=null,`No layout data found for index ${e}`);let i=n+a,o=G({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,U(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function rt({groupId:e,panelId:t}){let n=()=>{let t=V();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=({nextSize:e,panels:n,prevLayout:r,derivedPanelConstraints:i})=>{let o=a(),s=n.findIndex(e=>e.id===t),c=s===0,l=s===n.length-1;if(l&&e<o&&(c||n.slice(0,s).every((e,t)=>{let n=i[t];return n?.collapsible&&U(n.collapsedSize,r[n.panelId])}))){let e=n.slice(0,s).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:A(100-e)}}return K({delta:l?o-e:e-o,initialLayout:r,panelConstraints:i,pivotIndices:l?[s-1,s]:[s,s+1],prevLayout:r,trigger:`imperative-api`})},s=e=>{if(e===a())return;let{defaultLayoutDeferred:t,derivedPanelConstraints:r,group:i,groupSize:s,layout:c,separatorToPanels:l}=n(),u=J({layout:o({nextSize:e,panels:i.panels,prevLayout:c,derivedPanelConstraints:r}),panelConstraints:r});q(c,u)||H(i,{defaultLayoutDeferred:t,derivedPanelConstraints:r,groupSize:s,layout:u,separatorToPanels:l})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),o=a();e&&o!==t&&(n.expandToSize=o,s(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:o}=i(),c=a();if(e&&c===t){let e=o.expandToSize??n;e===0&&(e=1),s(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&U(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=j({group:t}),o=A(k({groupSize:a,panelElement:r,styleProp:e})/a*100);s(o)}}}function it(e){e.defaultPrevented||tt(e,V()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=rt({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function Y(e){let t=V();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function at({groupId:e}){let t=()=>{let t=V();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=J({layout:e,panelConstraints:r});return n?o:(q(o,c)||H(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function X(e,t){let n=Y(e),r=B(n.id,!0),i=n.separators.find(t=>t.element===e);M(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);M(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=at({groupId:n.id}).getLayout(),c=J({layout:K({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});q(s,c)||H(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function ot(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=Y(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&X(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&X(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&X(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&X(t,-5);break;case`End`:e.preventDefault(),X(t,100);break;case`Enter`:{e.preventDefault();let n=Y(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=B(n.id,!0),o=n.separators.find(e=>e.element===t);M(o,`Matching separator not found`);let s=a.get(o);M(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(M(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];X(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=Y(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);M(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),X(t,-100)}}function st(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=V(),n=tt(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),I({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}function ct({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=K({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(q(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?De:Oe;break;case`vertical`:s|=d<0?ke:Ae}}else H(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&je:c|=s&je,t.movementY===0?c|=o&Me:c|=s&Me,Te(c),Ie(e)}function lt(e){let t=V(),n=F();n.state===`active`&&ct({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function ut(e){if(e.defaultPrevented)return;let t=F(),n=V();switch(t.state){case`active`:if(e.buttons===0){I({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{if(!n.has(e.group))return;let t=B(e.group.id,!0);H(e.group,t,{isUserInteraction:!0})});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.isConnected&&!t.hasPointerCapture?.(e.pointerId)&&t.setPointerCapture?.(e.pointerId)}ct({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=tt(e,n);r.length===0?t.state!==`inactive`&&I({cursorFlags:0,state:`inactive`}):I({cursorFlags:0,hitRegions:r,state:`hover`}),Ie(e.currentTarget);break}}}function dt(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(F().state){case`hover`:I({cursorFlags:0,state:`inactive`})}}function ft(e){e.defaultPrevented||e.pointerType===`mouse`&&e.button>0||Ve(e.currentTarget)&&e.preventDefault()}function pt(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=A(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=A((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function mt(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=j({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:A(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function ht(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function gt(e,t){return e.length===t.length&&e.every((e,n)=>ht(e,t[n]))}function _t({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=A(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=A((r[e]??0)/a*l);else{let e=A(l/c.length);for(let t of c)u[t]=e}return u}function vt(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var Z=new Map;function yt(e){let t=!0;M(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=j({group:e});if(t===0)return;let n=B(e.id);if(!n)return;let r=pe(e),i=n.defaultLayoutDeferred?pt(r):n.layout,a=J({layout:_t({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&q(n.layout,a)&>(n.derivedPanelConstraints,r)&&n.groupSize===t)continue;H(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else mt(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{M(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=j({group:e}),s=pe(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(vt(e.panels,l)||(l=void 0));let u=J({layout:e.mutableState.layouts[c]??l??pt(s),panelConstraints:s}),d=e.element.ownerDocument;Z.set(d,(Z.get(d)??0)+1);let f=new Map;return Se(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),H(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{M(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,ot)}),Z.get(d)===1&&(d.addEventListener(`contextmenu`,He,!0),d.addEventListener(`dblclick`,it,!0),d.addEventListener(`pointerdown`,st,!0),d.addEventListener(`pointerleave`,lt),d.addEventListener(`pointermove`,ut),d.addEventListener(`pointerout`,dt),d.addEventListener(`pointerup`,ft,!0)),function(){t=!1,Z.set(d,Math.max(0,(Z.get(d)??0)-1)),Re(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,ot)}),Z.get(d)||(d.removeEventListener(`contextmenu`,He,!0),d.removeEventListener(`dblclick`,it,!0),d.removeEventListener(`pointerdown`,st,!0),d.removeEventListener(`pointerleave`,lt),d.removeEventListener(`pointermove`,ut),d.removeEventListener(`pointerout`,dt),d.removeEventListener(`pointerup`,ft,!0)),a.disconnect()}}function bt(){let[e,t]=(0,O.useState)({});return[e,(0,O.useCallback)(()=>t({}),[])]}function xt(e){let t=(0,O.useId)();return`${e??t}`}var Q=typeof window<`u`?O.useLayoutEffect:O.useEffect;function $(e){let t=(0,O.useRef)(e);return Q(()=>{t.current=e},[e]),(0,O.useCallback)((...e)=>t.current?.(...e),[t])}function St(...e){return $(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t}})})}function Ct(e){let t=(0,O.useRef)({...e});return Q(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var wt=(0,O.createContext)(null);function Tt(e,t){let n=(0,O.useRef)({getLayout:()=>({}),setLayout:Ee});(0,O.useImperativeHandle)(t,()=>n.current,[]),Q(()=>{Object.assign(n.current,at({groupId:e}))})}function Et({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,O.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=$(e=>{q(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=$((e,t)=>{q(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e,{isUserInteraction:t}))}),_=xt(s),v=(0,O.useRef)(null),[y,b]=bt(),x=(0,O.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=St(v,a);Tt(_,o);let C=$((e,t)=>{let r=F(),i=ze(e),a=B(e);if(a){let e=!1;return r.state===`active`&&(e=r.hitRegions.some(e=>e.group===i)),{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=Ct({defaultLayout:n,disableCursor:r}),T=(0,O.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=me(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=me(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=ze(_),i=B(_);r&&i&&H(r,{...i,derivedPanelConstraints:pe(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),D=(0,O.useRef)(null);return Q(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};D.current=r;let a=yt(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=B(r.id,!0);!o&&s.length>0&&(h(c),g(c,!1));let l=Be(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=U(t.collapsedSize,i[t.panelId]),a=U(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=F().state!==`active`;h(i),o&&g(i,e.isUserInteraction)});return()=>{D.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,O.useEffect)(()=>{let e=D.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,E.jsx)(wt.Provider,{value:T,children:(0,E.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}Et.displayName=`Group`;function Dt(){let e=(0,O.useContext)(wt);return M(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function Ot(e,t){let{id:n}=Dt(),r=(0,O.useRef)({collapse:L,expand:L,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:L});(0,O.useImperativeHandle)(t,()=>r.current,[]),Q(()=>{Object.assign(r.current,rt({groupId:n,panelId:e}))})}function kt({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=xt(c),_=Ct({disabled:a}),v=(0,O.useRef)(null),y=St(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=Dt(),T=d!==null,D=$((e,t,n)=>{d?.(e,c,n)});Q(()=>{let e=v.current;if(e!==null){let t={element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?D:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}};return C(t)}},[s,n,r,i,T,g,h,l,u,D,C,_]),(0,O.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),Ot(g,f);let ee=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},te=(0,O.useSyncExternalStore)(e=>Be(x,e),ee,ee),ne;return ne=te?JSON.parse(te):i===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:i},(0,E.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...At,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...ne},children:(0,E.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}kt.displayName=`Panel`;var At={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function jt(){return(0,O.useRef)(null)}function Mt({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=J({layout:K({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=J({layout:K({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function Nt({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=xt(a),l=Ct({disabled:n,disableDoubleClick:r}),[u,d]=(0,O.useState)({}),[f,p]=(0,O.useState)(`inactive`),[m,h]=(0,O.useState)(!1),g=(0,O.useRef)(null),_=St(g,i),{disableCursor:v,id:y,orientation:b,registerSeparator:x,updateSeparatorProps:S}=Dt(),C=b===`horizontal`?`vertical`:`horizontal`;Q(()=>{let e=g.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=x(t),r=we(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=Be(y,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=n.findIndex(t=>t.panelId===e.id);d(Mt({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[y,c,x,l]),(0,O.useEffect)(()=>{S(c,{disabled:n,disableDoubleClick:r})},[n,r,c,S]);let w;n&&!v&&(w=`not-allowed`);let T;if(n)T=`disabled`;else switch(f){case`active`:T=`active`;break;default:T=m?`focus`:f}return(0,E.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":C,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":T,"data-testid":c,id:c,onBlur:()=>h(!1),onFocus:()=>h(!0),ref:_,role:`separator`,style:{flexBasis:`auto`,cursor:w,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}Nt.displayName=`Separator`;function Pt({className:e,...t}){return(0,E.jsx)(Et,{className:a(`flex h-full w-full data-[orientation=vertical]:flex-col`,e),...t})}var Ft=kt;function It({withHandle:e,className:t,...n}){return(0,E.jsx)(Nt,{className:a(`relative flex items-center justify-center bg-border`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1`,`aria-[orientation=vertical]:w-px`,`aria-[orientation=vertical]:after:absolute aria-[orientation=vertical]:after:inset-y-0 aria-[orientation=vertical]:after:left-1/2 aria-[orientation=vertical]:after:w-1 aria-[orientation=vertical]:after:-translate-x-1/2`,`aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full`,`aria-[orientation=horizontal]:after:absolute aria-[orientation=horizontal]:after:inset-x-0 aria-[orientation=horizontal]:after:top-1/2 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:-translate-y-1/2`,`aria-[orientation=horizontal]:[&>div]:rotate-90`,t),...n,children:e?(0,E.jsx)(`div`,{className:`z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border`,children:(0,E.jsx)(r,{icon:y,className:`size-2.5`})}):null})}function Lt(){let e=jt(),[t,n]=(0,O.useState)(!0);return{panelRef:e,open:t,toggle:()=>{let t=e.current;t&&(t.isCollapsed()?(t.expand(),n(!0)):(t.collapse(),n(!1)))},onResize:()=>{n(!(e.current?.isCollapsed()??!1))}}}var Rt={flow:{icon:v,label:`Flow`,symbol:`Fl`},signal:{icon:b,label:`Signal`,symbol:`Sg`},store:{icon:g,label:`Store`,symbol:`St`},clock:{icon:m,label:`Clock`,symbol:`Ck`},gate:{icon:T,label:`Gate`,symbol:`Gt`},vault:{icon:x,label:`Vault`,symbol:`Vt`},channel:{icon:w,label:`Channel`,symbol:`Ch`},ai:{icon:p,label:`AI`,symbol:`Ai`}};export{y as _,Pt as a,h as b,ae as c,ee as d,ne as f,b as g,x as h,Ft as i,D as l,T as m,Lt as n,se as o,re as p,It as r,oe as s,Rt as t,ie as u,_ as v,m as x,g as y};
|