@theoremjs/studio 0.3.5-next.904.g8358918 → 0.3.5-next.906.g6f050f4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/agreement.js +14 -22
- package/compile.js +4 -12
- package/cookbooks/catalog.d.ts +3 -2
- package/cookbooks/catalog.js +15 -14
- package/draft.d.ts +5 -4
- package/package.json +4 -4
- package/page/assets/{BottomSheet-BYdlF6XQ.js → BottomSheet-v4keekfB.js} +1 -1
- package/page/assets/{ConsoleFrame-DgNj2ehp.js → ConsoleFrame-CHnnxxNA.js} +1 -1
- package/page/assets/{DateInput-BfsmvDs5.js → DateInput-CYFXY_3W.js} +1 -1
- package/page/assets/{MenuBottomSheet-r-jmETty.js → MenuBottomSheet-BR8JYBqn.js} +1 -1
- package/page/assets/{PowerSearchBottomSheet-CY2Zi0Vy.js → PowerSearchBottomSheet-DSkpQQys.js} +1 -1
- package/page/assets/{RankedBars-DR1262If.js → RankedBars-C_arZO1h.js} +1 -1
- package/page/assets/{SchemaFields-BcxoQ-RS.js → SchemaFields-DvOp5_M3.js} +1 -1
- package/page/assets/{TokenizerBottomSheet-DP12CqGy.js → TokenizerBottomSheet-DjiTJgA9.js} +1 -1
- package/page/assets/{ToolResultCharts-DBy__Gzd.js → ToolResultCharts-t1kqy-J6.js} +1 -1
- package/page/assets/{Toolbar-CChVUPbd.js → Toolbar-CkD1V_z_.js} +1 -1
- package/page/assets/{TraceInspector-D3W8LNxk.js → TraceInspector-CGGxz_g-.js} +2 -2
- package/page/assets/{TraceOverview-BOAil2sC.js → TraceOverview-C3RFiWfu.js} +3 -3
- package/page/assets/{_virtual_studio-type-sources-CcQ5cTIW.js → _virtual_studio-type-sources-CuPTbB69.js} +33 -11
- package/page/assets/browser-connection-UWxIyv6u.js +1 -0
- package/page/assets/browser-engine-Ds0-ThtZ.js +16 -0
- package/page/assets/{browser-transport-4vn70sx3.js → browser-transport-Dq9itWDy.js} +2 -2
- package/page/assets/compile-NWqVUG3a.js +4 -0
- package/page/assets/encode-files-Dc2wHsb6.js +1 -0
- package/page/assets/{export-agent-DWn0TAdZ.js → export-agent-Y0Y8mdbB.js} +1 -1
- package/page/assets/{getRadiusAndStrokeWidthFromDot-BI5WDjtg.js → getRadiusAndStrokeWidthFromDot-bzD-VA8b.js} +1 -1
- package/page/assets/{guardrail-health-DnLVYEtS.js → guardrail-health-BGyQi_jA.js} +2 -2
- package/page/assets/{guardrail-tester-CgkIXUW-.js → guardrail-tester-DbR85sml.js} +1 -1
- package/page/assets/{index-DAxq_qzW.js → index-Cfhzi3KD.js} +25 -35
- package/page/assets/{json-code-DULxkQH1.js → json-code-D2imJbsd.js} +1 -1
- package/page/assets/{labels-provider-CN0ynnGL.js → labels-provider-CTjEbRdu.js} +1 -1
- package/page/assets/{live-messages-Dt4DGCkr.js → live-messages-Bp_b714P.js} +1 -1
- package/page/assets/prompt-row-eETPWTfK.js +76 -0
- package/page/assets/reader-C8mnJAB6.js +5 -0
- package/page/assets/registry-DJBxNVIO.js +1 -0
- package/page/assets/schema-D4bn5YDU.js +3 -0
- package/page/assets/shaped-data-yrTrXPh4.js +25 -0
- package/page/assets/{stub-D6-YFRxO.js → stub-CZ_Xswg8.js} +1 -1
- package/page/assets/studio-code-pane-lxwvQgJE.js +8 -0
- package/page/assets/{studio-console-BZz0jUMB.js → studio-console-BNOXf-xr.js} +1 -1
- package/page/assets/{studio-decision-D1yEsQ3m.js → studio-decision-C9oxa1xo.js} +1 -1
- package/page/assets/{studio-embedding-DRF-NK_i.js → studio-embedding-D8rA6MOH.js} +1 -1
- package/page/assets/{studio-host-console-CZejZcSC.js → studio-host-console-XPl__wj7.js} +2 -2
- package/page/assets/studio-labels-CUJQgb-k.js +3 -0
- package/page/assets/studio-live-B3gN-hIU.js +5 -0
- package/page/assets/{studio-map-Zq-pNrcV.js → studio-map-Cf2DHvn2.js} +1 -1
- package/page/assets/{studio-trace-replay-BNp97GqQ.js → studio-trace-replay-BCOqVguH.js} +1 -1
- package/page/assets/{studio-type-checker-DrrdfEam.js → studio-type-checker-BWW15y7M.js} +1 -1
- package/page/assets/{tool-schema-lNJyGpcM.js → tool-schema-BMNs-MyH.js} +1 -1
- package/page/assets/{trace-record-CmhXXllR.js → trace-record-CS_K7b8l.js} +1 -1
- package/page/assets/tree-D6WoHLJe.js +3 -0
- package/page/assets/{turn-client-Bm5Tte8I.js → turn-client-8TS8z-jZ.js} +2 -2
- package/page/assets/types-D9SHTHld.js +1 -0
- package/page/assets/{use-one-call-ECBRqoZW.js → use-one-call-Ch9fKeMJ.js} +1 -1
- package/page/assets/{useDismissSearchOnTouchDrag-DSSwkvQ7.js → useDismissSearchOnTouchDrag-DJ9Di3hZ.js} +1 -1
- package/page/assets/{workspace-LbPd2mMU.js → workspace-CCtOtOGD.js} +1 -1
- package/page/index.html +17 -17
- package/prompt-doc.d.ts +21 -2
- package/prompt-doc.js +53 -2
- package/read-source.js +21 -34
- package/system-markup.d.ts +8 -11
- package/system-markup.js +20 -10
- package/ui/prompt-editor.d.ts +11 -7
- package/ui/prompt-editor.js +17 -11
- package/ui/prompt-row.d.ts +8 -3
- package/ui/prompt-row.js +34 -5
- package/ui/studio-save.js +1 -1
- package/page/assets/browser-connection-DpdHh7mX.js +0 -1
- package/page/assets/browser-engine-COa0Cf0K.js +0 -16
- package/page/assets/compile-BsLXJF_p.js +0 -2
- package/page/assets/encode-files-DPDNany5.js +0 -1
- package/page/assets/prompt-row-YsMR0nZ1.js +0 -76
- package/page/assets/reader-Btbbru9A.js +0 -5
- package/page/assets/registry-BCB7ry_Z.js +0 -1
- package/page/assets/schema-CvmO11hb.js +0 -3
- package/page/assets/shaped-data-D9qzQU2m.js +0 -25
- package/page/assets/studio-code-pane-Bl2XWCCE.js +0 -10
- package/page/assets/studio-labels-CCTfc6TG.js +0 -3
- package/page/assets/studio-live-yHLKnUP3.js +0 -5
- package/page/assets/tree-DxJnvWmh.js +0 -3
- package/page/assets/types-YRukYg-4.js +0 -1
package/README.md
CHANGED
|
@@ -13,6 +13,8 @@ The **studio** is a screen for one agent **profile** (see [`@theoremjs/agents`](
|
|
|
13
13
|
|
|
14
14
|
In the form, the system prompt opens formatted. Private text sits on a shaded ground. A block that starts and ends on private text is one shaded box, with its bullets inside it and any shared words in it cut out. Each option is one row: its name, then its values.
|
|
15
15
|
|
|
16
|
+
The studio keeps the prompt exactly as your file writes it: its lines, its parts and the white space at their edges. A line you don't change stays as written when you save, and a prompt you don't touch never shows as different from your files.
|
|
17
|
+
|
|
16
18
|
A value the files write once, in a constant or a helper, changes on every agent that shares it. Taking a model or a setting out of one agent takes it out of that agent only.
|
|
17
19
|
|
|
18
20
|
The screen keeps the profile it edits in the browser, as a **draft**. It sends the draft with every request to a server under `/api/studio`. You choose which server answers:
|
package/agreement.js
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
8
|
import { BOUNDARIES, DETECTORS, resolveAllow, resolveDetect, TOOL_BOUNDARIES, } from '@theoremjs/agents/guardrails';
|
|
9
|
-
import { unsetValue } from '@theoremjs/agents/kernel';
|
|
9
|
+
import { systemReading, unsetValue } from '@theoremjs/agents/kernel';
|
|
10
10
|
import { STUDIO_POLICY_UNSET } from "./policy.js";
|
|
11
|
-
import {
|
|
11
|
+
import { linesOf } from "./system-markup.js";
|
|
12
12
|
function isRecord(value) {
|
|
13
13
|
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
14
14
|
}
|
|
@@ -52,37 +52,29 @@ function detectAsRead(detect, boundaries) {
|
|
|
52
52
|
allow: Object.fromEntries(allow),
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
+
const isPart = (part) => typeof part === 'string' || (isRecord(part) && typeof part.private === 'string');
|
|
55
56
|
/**
|
|
56
|
-
* A prompt as the
|
|
57
|
-
*
|
|
58
|
-
* why: this is studio policy, so a prompt written as one text opens as the same prompt.
|
|
57
|
+
* A prompt as the kernel reads it, so two that send the same words with the same marks agree
|
|
58
|
+
* however each is cut into parts. A value that is no prompt stays as it is.
|
|
59
59
|
*/
|
|
60
|
-
function
|
|
61
|
-
if (typeof system
|
|
60
|
+
function promptAsRead(system) {
|
|
61
|
+
if (typeof system === 'string')
|
|
62
|
+
return systemReading(linesOf(system));
|
|
63
|
+
if (!Array.isArray(system))
|
|
62
64
|
return system;
|
|
63
|
-
const
|
|
64
|
-
return
|
|
65
|
-
if (typeof line === 'string')
|
|
66
|
-
return plainLines(line);
|
|
67
|
-
if (!Array.isArray(line))
|
|
68
|
-
return [line];
|
|
69
|
-
return [
|
|
70
|
-
promptLine(line.map((part) => isRecord(part) && typeof part.private === 'string'
|
|
71
|
-
? { private: part.private.trim() }
|
|
72
|
-
: part)),
|
|
73
|
-
];
|
|
74
|
-
});
|
|
65
|
+
const isPrompt = system.every((line) => typeof line === 'string' || (Array.isArray(line) && line.every(isPart)));
|
|
66
|
+
return isPrompt ? systemReading(linesOf(system)) : system;
|
|
75
67
|
}
|
|
76
|
-
/** A profile with its prompt as the
|
|
68
|
+
/** A profile with its prompt as the kernel reads it. */
|
|
77
69
|
function promptRead(profile) {
|
|
78
70
|
if (!isRecord(profile.identity) || profile.identity.system === undefined)
|
|
79
71
|
return profile;
|
|
80
72
|
return {
|
|
81
73
|
...profile,
|
|
82
|
-
identity: { ...profile.identity, system:
|
|
74
|
+
identity: { ...profile.identity, system: promptAsRead(profile.identity.system) },
|
|
83
75
|
};
|
|
84
76
|
}
|
|
85
|
-
/** A profile with its prompt
|
|
77
|
+
/** A profile with its prompt and its `detect` as the kernel reads them. */
|
|
86
78
|
function asRead(project) {
|
|
87
79
|
if (!isRecord(project))
|
|
88
80
|
return project;
|
package/compile.js
CHANGED
|
@@ -10,7 +10,7 @@ import { COMPACTION_DRAFT_DEFAULTS, draftAllows, draftFacets, INLINE_LABELS, MOD
|
|
|
10
10
|
import { isGoogleRoute, isProviderBuiltinId, modelBindingViolation } from "./policy.js";
|
|
11
11
|
import { modelRoute, protocolOptionFields, servedProtocols, servesProfileType, } from "./providers.js";
|
|
12
12
|
import { bindingSlots, defaultEffortRequired, defaultModelRequired, inputLimitsRequired, } from "./requirements.js";
|
|
13
|
-
import {
|
|
13
|
+
import { linesOf } from "./system-markup.js";
|
|
14
14
|
import { parseJsonSchema } from "./tool-schema.js";
|
|
15
15
|
import { modelBindingNodeId, toolSpecNodeId } from "./tree.js";
|
|
16
16
|
import { STUDIO_TOOL_TYPE_MESSAGE, STUDIO_TOOL_TYPES } from "./types.js";
|
|
@@ -341,18 +341,10 @@ function reportOptions(options, report) {
|
|
|
341
341
|
});
|
|
342
342
|
return isWrong;
|
|
343
343
|
}
|
|
344
|
-
/** The prompt
|
|
344
|
+
/** The prompt as written and the options it reads, each problem reported on the identity section. */
|
|
345
345
|
function compilePrompt(draft, report) {
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
report('identity', parsed.message, 'system');
|
|
349
|
-
const lines = parsed.ok ? parsed.lines : [];
|
|
350
|
-
const [first] = lines;
|
|
351
|
-
const system = lines.length === 0
|
|
352
|
-
? undefined
|
|
353
|
-
: lines.length === 1 && typeof first === 'string'
|
|
354
|
-
? first
|
|
355
|
-
: lines;
|
|
346
|
+
const written = draft.identity.system;
|
|
347
|
+
const system = linesOf(written).length === 0 ? undefined : written;
|
|
356
348
|
const isWrong = reportOptions(draft.identity.options, report);
|
|
357
349
|
const declared = draftOptions(draft.identity.options);
|
|
358
350
|
const code = compileOptions(declared.filter((option) => !option.isShownInChat));
|
package/cookbooks/catalog.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { SystemLine } from '@theoremjs/agents/kernel';
|
|
1
2
|
import { type DecisionImageDraft, type StudioDraft, type ToolSpecDraft } from '../draft.ts';
|
|
2
3
|
import { type StudioWorkspace } from '../workspace.ts';
|
|
3
|
-
/** Public cognitive block
|
|
4
|
-
export declare const DEMO_RESEARCH_SYSTEM
|
|
4
|
+
/** Public cognitive block, then the research standards, kept private. */
|
|
5
|
+
export declare const DEMO_RESEARCH_SYSTEM: SystemLine[];
|
|
5
6
|
export declare const DEMO_CONCIERGE_SYSTEM = "Role: Elite, charismatic travel concierge.\n\nCommunication Standards:\n- Readable Formatting: Use markdown where it helps the reader: short headings, bullet lists, bold for key names, and tables for side-by-side comparisons.\n- Adaptive Pacing: Deliver high-signal, concise answers. Avoid overwhelming monologues; provide the immediate insight or recommendation first, then offer a natural next step.\n\nTool & Fact Grounding:\n- Absolute Grounding: Ground all dynamic facts (weather, currency conversions, distances, geography, destination research) using available tools before answering. Never invent live data.\n- Silent Execution: Never narrate tool calls, announce function names, or reference underlying APIs. Seamlessly integrate verified findings into your response.\n- Complete Resolution: Execute multi-step tool chains silently to completion before delivering the synthesized answer.\n\nMultimodal Understanding:\n- Immediately extract actionable constraints (dates, flight times, locations, budgets) from provided images, documents, tickets, or audio, and weave them directly into your response.";
|
|
6
7
|
export declare const DEMO_ARCHITECT_SYSTEM = "Role: Senior software architect who researches before advising.\n\nCommunication Standards:\n- Readable Formatting: Use markdown where it helps the reader: short headings, bullet lists, code blocks for code, and tables for side-by-side comparisons.\n- Answer First: Lead with the recommendation, then the reasons and the trade-offs. Name what you could not confirm.\n\nTool & Fact Grounding:\n- Absolute Grounding: Ground claims about a library, a repository, a package version, or a cloud service in the tools before answering. Never invent an API, a version, or a default.\n- Silent Execution: Never narrate tool calls or announce function names. Work findings into the answer.\n- Complete Resolution: Finish multi-step research before you answer.\n\nAudio briefings:\n- When asked for a podcast, a briefing, or anything to listen to, write a short spoken script of what you found, in plain sentences with no markdown, and pass it to narrate. Then say in one line what the briefing covers.";
|
|
7
8
|
export declare const DEMO_LIVE_CONCIERGE_SYSTEM = "Role: Elite, charismatic travel concierge, on a call.\n\nSpeaking:\n- Speak in short, natural sentences. No lists, no markdown, no reading out of addresses, or codes unless asked.\n- Give the recommendation first, then offer one next step.\n\nTool & Fact Grounding:\n- Ground weather, currency, distances, and places in the tools before you answer. Never invent live data.\n- Never name a tool or say that you are calling one.";
|
package/cookbooks/catalog.js
CHANGED
|
@@ -33,24 +33,25 @@ const EXAMPLE_PICKS = {
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
};
|
|
36
|
-
/** Public cognitive block
|
|
37
|
-
export const DEMO_RESEARCH_SYSTEM =
|
|
38
|
-
|
|
39
|
-
Cognitive Standards:
|
|
36
|
+
/** Public cognitive block, then the research standards, kept private. */
|
|
37
|
+
export const DEMO_RESEARCH_SYSTEM = [
|
|
38
|
+
`Role: Advanced reasoning engine for research on how language models keep, retrieve, and recombine context. You solve high-complexity, ambiguous, and multi-variable problems through deep first-principles analysis.`,
|
|
39
|
+
`Cognitive Standards:
|
|
40
40
|
- First-Principles Decomposition: Reduce problems to foundational mechanics, physical laws, and core causal primitives. Do not rely on surface-level heuristics or rote pattern-matching.
|
|
41
41
|
- Adversarial Stress-Testing: Actively challenge initial assumptions. Explore competing hypotheses, edge cases, failure modes, and potential confounds before converging on a solution.
|
|
42
42
|
- Systems Dynamics: Model non-linear interactions, feedback loops, dependencies, and second-order consequences across variables.
|
|
43
|
-
- Epistemic Precision: Explicitly distinguish established empirical facts from logical deductions, probabilistic estimates, and speculative hypotheses. Calibrate confidence to available evidence
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Standards:
|
|
43
|
+
- Epistemic Precision: Explicitly distinguish established empirical facts from logical deductions, probabilistic estimates, and speculative hypotheses. Calibrate confidence to available evidence.`,
|
|
44
|
+
`Execution:
|
|
45
|
+
Provide thorough, exhaustive, and intellectually uncompromised reasoning. Prioritize causal clarity, mathematical/scientific validity, and deep insight over artificial brevity.`,
|
|
46
|
+
[
|
|
47
|
+
{
|
|
48
|
+
private: `Standards:
|
|
50
49
|
- The newest work is often not indexed yet; one search is rarely enough.
|
|
51
50
|
- A claim rests on a primary source: the paper, the model card, the dataset card, the repository. A blog or a list is a lead to its primary source; DeepWiki answers are leads only.
|
|
52
|
-
- Quote exact words from what the tools returned. Say how sure you are, and what you could not check
|
|
53
|
-
}
|
|
51
|
+
- Quote exact words from what the tools returned. Say how sure you are, and what you could not check.`,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
];
|
|
54
55
|
export const DEMO_CONCIERGE_SYSTEM = `Role: Elite, charismatic travel concierge.
|
|
55
56
|
|
|
56
57
|
Communication Standards:
|
|
@@ -512,7 +513,7 @@ export function createResearchScoutDraft() {
|
|
|
512
513
|
const base = exampleTextDraft({
|
|
513
514
|
agentId: 'research.scout',
|
|
514
515
|
handle: 'scout',
|
|
515
|
-
system: [DEMO_RESEARCH_SYSTEM, ...RESEARCH_READER_LINES]
|
|
516
|
+
system: [...DEMO_RESEARCH_SYSTEM, ...RESEARCH_READER_LINES],
|
|
516
517
|
options: [
|
|
517
518
|
researchOption('focus', 'Focus', [RESEARCH_MODELS_FOCUS, 'arXiv', 'GitHub', 'Anywhere']),
|
|
518
519
|
researchOption('reader', 'Reader', ['anyone', 'reviewer', 'student']),
|
package/draft.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { type LabelKey } from '@theoremjs/agents';
|
|
7
7
|
import { type BlockedReplyOnBlock, type Boundary, type DestinationGate, type DetectAction, type Detector, type TaintGate, type UrlDetector } from '@theoremjs/agents/guardrails';
|
|
8
|
-
import { type JsonObject, type ProfileItemRule, type ProviderLimits } from '@theoremjs/agents/kernel';
|
|
8
|
+
import { type JsonObject, type ProfileItemRule, type ProfileSystem, type ProviderLimits } from '@theoremjs/agents/kernel';
|
|
9
9
|
import { type ScrubSwitch } from '@theoremjs/agents/observability';
|
|
10
10
|
import { type CompactionMeter, type CompactionTiming, type ContextSender, type ContinueStopKind, type KeySlot, type LiveActivityHandling, type LiveEndSensitivity, type LiveStartSensitivity, type ProfileGraphFacetId, type ProfileType, type SpeechAudioFormat, type StepLimitMode, type StreamMode, type ThinkingLevel } from '@theoremjs/agents/schema';
|
|
11
11
|
import type { ModelPicks, ModelStart } from './lent-keys.ts';
|
|
@@ -38,10 +38,11 @@ export interface IdentityDraft {
|
|
|
38
38
|
profileType: StudioProfileType | '';
|
|
39
39
|
handle: string;
|
|
40
40
|
/**
|
|
41
|
-
* The
|
|
42
|
-
*
|
|
41
|
+
* The prompt exactly as the file writes it, its lines and private parts as written; a blank one
|
|
42
|
+
* is ''. Shown and typed as markup, which is only a view of it. Unused on speech, which has no
|
|
43
|
+
* system channel.
|
|
43
44
|
*/
|
|
44
|
-
system:
|
|
45
|
+
system: ProfileSystem;
|
|
45
46
|
options: OptionDraft[];
|
|
46
47
|
}
|
|
47
48
|
export interface ModelsDraft {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theoremjs/studio",
|
|
3
|
-
"version": "0.3.5-next.
|
|
3
|
+
"version": "0.3.5-next.906.g6f050f4",
|
|
4
4
|
"description": "Theorem Studio: open a project's agents in a local studio on Deno, edit and run them, and save back to its files; or show the studio screen in a Vite app.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -92,9 +92,9 @@
|
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"zod": "^4.6.5",
|
|
95
|
-
"@theoremjs/agents": "0.3.5-next.
|
|
96
|
-
"@theoremjs/web": "0.3.5-next.
|
|
97
|
-
"@theoremjs/react": "0.3.5-next.
|
|
95
|
+
"@theoremjs/agents": "0.3.5-next.906.g6f050f4",
|
|
96
|
+
"@theoremjs/web": "0.3.5-next.906.g6f050f4",
|
|
97
|
+
"@theoremjs/react": "0.3.5-next.906.g6f050f4"
|
|
98
98
|
},
|
|
99
99
|
"peerDependenciesMeta": {
|
|
100
100
|
"@theoremjs/react": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{d as n,l as r,r as i,u as a}from"./themeProps-Bo2jNkIC.js";import{T as o,o as s,t as c}from"./coarsePointer-B10KWVuz.js";import{r as l,t as u}from"./useMergedRefs-S6y2xAId.js";import{t as d}from"./mergeProps-ptS-gIMz.js";import{i as f,n as p}from"./useFocusTrap-DyznXJtp.js";import{A as m,B as h,E as g,I as _,M as ee,P as v,_ as y,b as te,c as ne,d as re,f as b,g as ie,h as x,j as ae,l as S,m as C,n as oe,p as w,s as T,t as E,u as D,v as se,y as O}from"./useLayerDismissal-DwwLDEpO.js";import{a as k,h as A,n as ce,t as j}from"./padding.stylex-Nfq09GFM.js";import{i as le,t as M}from"./sharedResizeObserver-Ce0raAy-.js";import{a as ue,s as N,t as P}from"./focusReturn-DNKESCUc.js";import{i as de}from"./focusOutline.stylex-DXNeAcgS.js";import{S as fe,T as F,_ as pe,k as I,t as L}from"./scrollView-DKN9Tc2s.js";import{t as R}from"./useMediaQuery-Q9CwxYQy.js";import{t as z}from"./useIsHydrating-DmtPcCGm.js";import{n as me,t as B}from"./useScrollLock-DGeH0BW_.js";import{_ as he,d as V,f as H,l as ge,n as _e,r as ve,u as ye}from"./scroll-74w_rjcI.js";import{t as be}from"./useScrollableArea-DLpP0enQ.js";import{t as U}from"./useDevWarning-WeXt8Pe8.js";import{t as xe}from"./container.stylex-CS4Pmkv3.js";import{t as Se}from"./rubberBand-urxgJfJ0.js";import{n as W}from"./projection-C57DLs2K.js";import{a as Ce,i as we,n as Te}from"./modalOutlet-CNlIUlZC.js";import{un as G}from"./index-DAxq_qzW.js";var K=t(n(),1),Ee=v();function De(e){let t=e*1e3;return t/(1+t)}function Oe(e,t){let n=0;for(let r=1;r<e.length;r+=1)Math.abs(e[r]-t)<Math.abs(e[n]-t)&&(n=r);return n}function ke({points:e,position:t,velocity:n,flickThreshold:r,tolerance:i=0,flickPastProjection:a=!1,projection:o,start:s,fromIndex:c,maxSteps:l}){if(e.length===0)throw RangeError(`resolveSnapPoint needs at least one snap point`);let u=o==null||Math.abs(n)<(o.minSpeed??0)?0:n,d=W(e,{position:t,velocity:u,rate:o==null?void 0:De(o.seconds),fromIndex:c,maxSteps:l}),f=d.index;if(Math.abs(n)>=r){let r=-1;if(n>0)r=e.findIndex(e=>e>t+i);else for(let n=e.length-1;n>=0&&r===-1;--n)e[n]<t-i&&(r=n);if(r!==-1&&(n>0?r>f:r<f)&&(f=r),a){let t=d.projected,r=n>0?e.length-1:0;if(n>0){let n=e.findIndex(e=>e>=t-i);r=n===-1?r:n}else for(let n=e.length-1;n>=0;--n)if(e[n]<=t+i){r=n;break}(n>0?r>f:r<f)&&(f=r)}}if(s!=null&&n!==0&&Math.sign(n)===Math.sign(s-t)&&(f=Oe(e,s)),c!=null&&l!=null){let t=Math.min(Math.max(c,0),e.length-1);f=Math.min(Math.max(f,t-l),t+l)}return{index:f,projected:d.projected}}var Ae=/^(\d+(?:\.\d+)?|\.\d+)(px|%)$/i;function je(e,t){if(typeof e==`number`)return Number.isFinite(e)&&e>0&&e<=1?e*t:null;let n=Ae.exec(e.trim());if(n===null)return null;let r=Number.parseFloat(n[1]);return r>0?n[2].toLowerCase()===`%`?r/100*t:r:null}function Me(e){return je(e,1)!==null}function Ne(e,t){let n=[];for(let r of e){let e=je(r,t);e!==null&&n.push(e)}return n}function Pe(e,t,n=48){let r=[0,...t.filter(t=>t>0&&t<e).map(t=>e-t)].sort((e,t)=>e-t),i=[];for(let e of r){let t=i[i.length-1];(t===void 0||e-t>=n)&&i.push(e)}return i}function Fe(e,t){return t.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t,t[0])}var Ie=.3;function Le(e,t){if(e.length<2||t<=0)return null;let n=e[e.length-1];return t-n<=.25*t?n:null}function Re(e,t,n,r){let i=r!==null,a=i?t[t.length-2]:t[t.length-1],o=i?r:n,s=i?Ie:0;return e<=a?1:e>=o?s:1-(1-s)*((e-a)/(o-a))}function ze(e,t,n,r){let i=t;if(n>0){let e=t.filter(e=>e>=r);e.length>0&&(i=e)}else if(n<0){let e=t.filter(e=>e<=r);e.length>0&&(i=e)}return Fe(e,i)}function Be(e,t){let n=e.ownerDocument.defaultView;if(n==null)return null;for(let r=e.parentElement;r!=null;r=r.parentElement){if(L.has(n.getComputedStyle(r).overflowY)&&r.scrollHeight>r.clientHeight)return r;if(r===t)return null}return null}function Ve(e,t,n,r){return r<=n?0:t>r?t-r:e<n?e-n:0}function q(e,t,n,{entrance:r=!1}={}){if(!n.animated||n.curve==null||performance.now()>=n.start+n.curve.durationMs)return e.set(t),null;let i=r?{at:n.start,crossfadeAs:`entrance`}:{at:n.start},a=n.curve.durationMs/1e3,o=re(n.curve.points),s={};for(let[r,i]of Object.entries(t)){let t=e.get(r,n.start),c=e=>t+(i-t)*o(Math.min(1,Math.max(0,e/a)));s[r]={duration:a,at:c,velocity:e=>{if(e>=a)return 0;let t=Math.max(0,e-.001),n=Math.min(a,e+.001);return(c(n)-c(t))/(n-t)}}}return e.play(s,i)}var He=new WeakSet;function Ue(e){return He.add(e),()=>{He.delete(e)}}function We(e){for(let t=e.parentElement;t!=null;t=t.parentElement)if(He.has(t))return!0;return!1}function Ge(e){let t=e.ownerDocument,n=Be(e);return n==null||n===t.body||n===t.documentElement?t.scrollingElement??t.documentElement:n}function Ke(e,t){return e.getBoundingClientRect().bottom-t.get(`y`)}function qe(e){let t=e.ownerDocument.defaultView?.getComputedStyle(e).translate??``;return parseFloat(t.split(` `)[1]??``)||0}function Je(e){let t=e.ownerDocument.defaultView,n=Ye(e);if(t==null||n==null)return null;let r=J(n,t);return r===`docked`?{docked:n}:r}function Ye(e){let t=e.ownerDocument.defaultView;if(t==null)return null;for(let n=e.parentElement;n!=null;n=n.parentElement)if(t.getComputedStyle(n).position===`fixed`)return n;return null}function Xe(e,t){let n=t.getComputedStyle(e).transform,r=/^matrix(3d)?\(([^)]*)\)$/.exec(n);if(r==null)return 0;let i=(r[2]??``).split(`,`).map(Number),a=r[1]==null?i[5]:i[13];return a!=null&&Number.isFinite(a)?a:0}function J(e,t){let n=g(t),r=e.getBoundingClientRect();if(r.height>=n-1)return`fills-viewport`;let i=r.bottom-qe(e)-Xe(e,t);return Math.abs(n-i)<=1?`docked`:`floating`}var Ze=new WeakMap;function Qe(e,t){let n=t.getComputedStyle(e).translate;if(n===``||n===`none`)return!1;let r=Ze.get(e);return r==null||r.get(`y`)===0}var $e=new Set([`transform`,`translate`,`top`,`bottom`,`inset`,`inset-block`,`inset-block-start`,`inset-block-end`]),Y=new Set([`offset`,`computedOffset`,`easing`,`composite`]);function et(e){if(`transitionProperty`in e)return[String(e.transitionProperty)];let t=e.effect;if(t==null||!(`getKeyframes`in t))return[];let n=new Set;for(let e of t.getKeyframes())for(let t of Object.keys(e))Y.has(t)||n.add(t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`));return[...n]}function tt(e){if(typeof e.getAnimations!=`function`)return!1;let t=Ze.has(e);return e.getAnimations().some(e=>{if(e.playState!==`running`)return!1;let n=`transitionProperty`in e;if(!n&&!(`animationName`in e))return!1;let r=et(e);return t&&n&&r.every(e=>e===`translate`)?!1:r.some(e=>$e.has(e))})}function nt(e){let t=e.ownerDocument.defaultView;return t!=null&&t.getComputedStyle(e).position===`fixed`&&J(e,t)===`docked`}function rt(e,t,n,r){let i=e+n-(g(r)-t);return t>0&&i>1?i:0}function it(e,t,n,r,i,a){if(!a&&(!nt(e)||tt(e)))return 0;let o=rt(Ke(e,t),n,0,i),s=ut(e);if(s!=null){if(!a)return o;let e=rt(Ke(s,t),n,r,i);return Math.max(o,e)}return y(e.ownerDocument.activeElement)?0:t.get(`y`)<0?o:0}function at(e,t,n){let r=e.ownerDocument;e===(r.scrollingElement??r.documentElement)?n.scrollBy({top:t,behavior:`instant`}):e.scrollTop+=t}function ot(e,t,n,r,i,a=0){let o=e.ownerDocument,s=g(i)-n,c=0,l=n>1?s-r:s;if(t!==(o.scrollingElement??o.documentElement)){let e=t.getBoundingClientRect();c=Math.max(c,e.top+a),l=Math.min(l,e.bottom+a)}let u=e.getBoundingClientRect();return Ve(u.top+a,u.bottom+a,c,l)}function st(e,t,n,r,i){let a=ot(e,t,n,r,i);Math.abs(a)>1&&at(t,a,i)}function ct(e,t,n,r){C(e,t,n);let i=e.ownerDocument.defaultView,a={bubbles:!0,cancelable:!0,composed:!0,detail:1,clientX:t,clientY:n,screenX:r.screenX,screenY:r.screenY},o=i?.PointerEvent,s=typeof o==`function`?new o(`click`,{...a,pointerType:`touch`,isPrimary:!0,pointerId:r.identifier}):new((i?.MouseEvent)??MouseEvent)(`click`,a);e.dispatchEvent(s)}function lt(e,t){let n=te(e,{owns:t}),r=x(e);return{report(e){e===r?n.isRevealPan(e)&&n.putBack():(r=e,n.report())},stop:()=>n.stop()}}function ut(e){let t=e.ownerDocument.activeElement;return t!=null&&t!==e&&e.contains(t)&&y(t)?t:null}function dt(e){return e!=null&&ie(e)&&c(e)}function ft(e,{move:t,offset:n}){let r=e.ownerDocument,i=r.defaultView;if(!dt(i))return()=>{};let a=Ue(e),o=se(r,{claim:t=>t instanceof i.HTMLElement&&t!==e&&e.contains(t)&&y(t)?t:null}),s=b(e,{claim:t=>{let n=w(t,e);return n!=null&&n!==r.activeElement?n:null},deliver:ct}),c=t===`ride`?vt(e,n,i,!0):pt(e,()=>ut(e),e,n,i);return()=>{c(!0),s(),o(),a()}}function pt(e,t,n,r,i){let a=e=>{let a=t();a!=null&&st(a,n,e,r,i)},o=lt(i,e=>e===t()),s=x(i),c=O(i,e=>{e.type===`viewport`&&(Math.abs(e.height-s)>1&&(s=e.height,a(e.height)),o.report(e.height))}),l=()=>a(x(i));return e.addEventListener(`focusin`,l),a(x(i)),()=>{c(),o.stop(),e.removeEventListener(`focusin`,l)}}function mt(e,t,n){return t>1&&e.getBoundingClientRect().height>g(n)-t+1}function ht(e){let t=ut(e),n=t==null?null:Be(t,e);return t==null||n==null?null:{field:t,scroller:n}}function gt(e,t,n,r,i){if(!nt(e)||tt(e))return 0;let a=rt(Ke(e,t),n,0,i),o=ut(e);if(o==null)return y(e.ownerDocument.activeElement)?0:Math.min(Math.max(0,-t.get(`y`)),a);let s=rt(Ke(o,t),n,r,i);return Math.min(s,a)}var _t=new WeakMap;function vt(e,t,n,r){_t.get(e)?.();let i=H(e);Ze.set(e,i);let a=D(n)===`chromium`?ne(n):null,o=`riding`,s=null,c=null,l=lt(n,t=>e.contains(t)),u=0,d=null,f=()=>{o=`ended`,s?.(),c?.(),s=null,c=null,l.stop(),h(),u!==0&&(n.cancelAnimationFrame(u),u=0),_t.get(e)===f&&_t.delete(e)};_t.set(e,f);let p=(a,s)=>{if(o===`ended`)return;let c=!r&&mt(e,a,n),l=c?ht(e):null,u=c?l==null?gt(e,i,a,t,n):0:it(e,i,a,t,n,r),d=u>0?-u:0,p=l==null?0:ot(l.field,l.scroller,a,t,n,d-i.get(`y`));l!=null&&Math.abs(p)>1&&at(l.scroller,p,n),(d!==0||i.get(`y`)!==0)&&(s==null?i.set({y:d}):q(i,{y:d},s)),o===`waiting`&&a<=1&&f()},m=e=>{e!=null&&(d=e),u===0&&(u=n.requestAnimationFrame(()=>{u=0;let e=d;d=null,p(e?.to??a?.inset??x(n),e)}))};a==null?s=O(n,e=>{e.type===`viewport`&&(m(null),l.report(e.height))}):c=a.subscribe(m);let h=I(n,`focusin`,()=>m(null));return m(null),(e=!1)=>{o!==`ended`&&(e||x(n)<=1?(f(),i.get(`y`)!==0&&i.set({y:0})):o=`waiting`)}}function yt(e){if(We(e))return null;let t=Je(e);if(t===`floating`||t===`fills-viewport`)return bt(e,Ye(e));if(t==null){let t=Ge(e);return t.scrollHeight>t.clientHeight?{reveal:t}:null}let n=e.ownerDocument.defaultView;return n!=null&&Qe(t.docked,n)?bt(e,t.docked):{ride:t.docked}}function bt(e,t){let n=t==null?null:Be(e,t);return n==null?null:{reveal:n}}function xt(e,{offset:t=10}={}){let n=e.ownerDocument,r=n.defaultView;if(!dt(r))return()=>{};let i=se(n,{claim:t=>t===e&&yt(e)!=null?e:null}),a=b(e,{claim:()=>n.activeElement!==e&&yt(e)!=null?e:null,deliver:ct}),o=null,s=null,c=()=>{if(o!=null)return;let i=yt(e);i!=null&&(o=`ride`in i?vt(i.ride,t,r,!1):pt(e,()=>n.activeElement===e?e:null,i.reveal,t,r))},l=()=>{o?.(),s=o??s,o=null};return e.addEventListener(`focus`,c),e.addEventListener(`blur`,l),()=>{e.removeEventListener(`focus`,c),e.removeEventListener(`blur`,l),o?.(!0),s?.(!0),o=null,s=null,a(),i()}}var St=4;function Ct(){return g(window)-x(window)}var wt=new WeakSet;function Tt(e,t){let n=e-t;return n>1?n:0}function Et(){return x(window)<=.5}function Dt(){let e=pe(document);return e!=null&&(T(e)||S(e))}function Ot(e,{move:t,inset:n=!1,offset:r=10,isEnabled:i=!0,isExpanded:a=!0,isOpen:o=!0,isPageScrollLocked:c=!1}={}){let[l,u]=(0,K.useState)(0),d=(0,K.useRef)(!1),f=(0,K.useRef)(!1),p=(0,K.useRef)(i),m=(0,K.useRef)(a),h=(0,K.useRef)(o);p.current=i,m.current=a,h.current=o;let g=R(s,!1),_=(0,K.useCallback)(t=>{let n=e.current,r=document.activeElement;p.current&&n!=null&&r instanceof HTMLElement&&r!==n&&n.contains(r)&&(f.current=d.current,t==null?r.blur():t.focus({preventScroll:!0}))},[e]);return(0,K.useEffect)(()=>{i&&!o&&_()},[_,i,o]),ye(e,e=>!i||n||!g?()=>{}:t==null?xt(e,{offset:r}):ft(e,{move:t,offset:r}),`${i}|${t}|${n}|${r}|${g}`),ye(e,e=>{let t=e.querySelector(`[data-scroll-axis]`);if(!i||!n||t==null)return()=>{};let a=Ue(e),o=null,s=null,l=0,p=0,_=g&&D(window)===`chromium`?ne(window):null,ee=()=>{let e=t.firstElementChild;return _!=null&&e instanceof HTMLElement?H(e):null},v=()=>{let e=t.firstElementChild;return e instanceof HTMLElement?qe(e):0},re=e=>{let t=_?.transition;return t!=null&&t.kind===`show`&&t.animated&&t.curve!=null&&(e||performance.now()<t.start+t.curve.durationMs)?t:null},b=null,ae=null,S=null,C=null,oe=g&&ie(window),T=e=>{let n=e!==l,r=n?t.scrollHeight:0;l=e,(0,Ee.flushSync)(()=>u(e)),n&&(p=e===0?0:Math.max(0,p+t.scrollHeight-r))},E=()=>{T(0),C!=null&&(s=null,t.scrollTop=C),o=null,S=null,C=null,ae=null,d.current=!1,f.current=!1},k=(e,n,r=null,i=null)=>{s=null;let a=r==null?null:ee();if(r!=null&&a!=null){let n=t.scrollTop;t.scrollTop=n+e;let o=t.scrollTop-n;if(o!==0){let e=a.get(`y`,r.start)+o;a.set({y:i==null?e:Math.min(e,i)}),q(a,{y:0},r,{entrance:i!=null})}return}if(typeof t.scrollBy!=`function`){t.scrollTop+=e;return}let o=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,c=n&&!o?`smooth`:`instant`;c===`smooth`&&(s=t.scrollTop+e),t.scrollBy({top:e,behavior:c})},A=()=>{if(s==null)return 0;let e=Math.max(t.scrollTop,t.scrollHeight-t.clientHeight),n=Math.min(s,e)-t.scrollTop;return Math.abs(n)<1?0:n},ce=(e,n,i=null)=>{let a=t.getBoundingClientRect(),o=e.getBoundingClientRect(),s=Ct(),c=Tt(a.bottom,s)>0?r:0,l=a.top,u=Math.min(a.bottom,s-c),d=A()+v(),f=o.bottom-d,p=Ve(o.top-d,f,l,u);p>0?k(p,n,i,Math.max(0,s-u-St)):p<0&&k(p,n,i)},j=e=>{let t=Ct();if(Et()||Tt(e.bodyBottom,t)===0){E();return}let n=Math.max(0,e.bodyBottom-(t-r));T(n)},le=()=>se(document,{isActive:()=>m.current,claim:e=>w(e,t),park:n=>{h.current&&w(n,t)&&e.focus({preventScroll:!0})}}),ue=(e=!1)=>{if(b!=null&&b.onReveal?.()!==!0)return;let n=Ct(),i=document.activeElement,a=i instanceof HTMLElement&&t.contains(i)&&y(i)?i:null;if(d.current&&Et()){let e=pe();E(),m.current&&a!=null&&ce(a,!1),e();return}if(!m.current||a==null){if(f.current&&o){let e=pe();j(o),e(),m.current&&d.current&&!Dt()&&L();return}E();return}d.current&&S!=null&&n>S+.5&&C!=null&&(s=null,t.scrollTop=C,S=n),f.current=!1;let l=t.getBoundingClientRect(),u=Tt(l.bottom,n),p=u>0?r:0;o=u>0?{bodyBottom:l.bottom}:null,u>0&&!d.current&&(S=n,C=t.scrollTop,c&&(ae={x:window.scrollX,y:window.scrollY})),d.current=u>0;let h=u>0?Math.max(0,l.bottom-(n-p)):0;T(h),ce(a,u>0&&!wt.has(window),u>0?re(e):null)},N=()=>{let e=t.scrollTop,n=Math.max(0,t.scrollHeight-p-t.clientHeight),r=Math.min(n,C??e),i=document.activeElement;if(m.current&&i instanceof HTMLElement&&t.contains(i)&&y(i)){let a=t.getBoundingClientRect(),o=i.getBoundingClientRect(),s=e-r-v();o.bottom+s>a.bottom?r+=o.bottom+s-a.bottom:o.top+s<a.top&&(r+=o.top+s-a.top),r=Math.min(n,Math.max(0,r))}return r},P=()=>{let e=t.firstElementChild;return oe&&_==null&&e instanceof HTMLElement?H(e):null},de=(e,t)=>e.animate({y:t},{spring:ve}),pe=()=>{let e=P();if(e==null)return()=>{};let n=e.get(`y`)-t.scrollTop;return()=>{let r=n+t.scrollTop;Math.abs(r-e.get(`y`))<.5||(e.set({y:r}),de(e,0))}},L=()=>{let e=P();if(e==null||b!=null)return;let n=t.scrollTop-N();if(n===0)return;let r={release:()=>{b===r&&(b=null)},onReveal:()=>{let n=document.activeElement;if(n instanceof HTMLElement&&t.contains(n)&&Dt())return r.release(),de(e,0),!0;if(Et()){r.release();let n=e.get(`y`),i=e.getVelocity(`y`),a=t.scrollTop;E();let o=a-t.scrollTop;Math.abs(n-o)<.5?e.set({y:0}):(e.set({y:n-o}),e.animate({y:0},{spring:ve,velocity:{y:i}}))}return!1}};b=r,de(e,n)},R=e=>{b?.release();let n=ee(),r=t.scrollTop-N(),i=n!=null&&r!==0?q(n,{y:r},e):null,a,o=!1,s=()=>{ue(),n?.set({y:0})},c={release:()=>{clearTimeout(a),b===c&&(b=null)},onReveal:()=>(o&&Et()&&(c.release(),s()),!1)};b=c;let l=()=>{b===c&&(o=!0,(!d.current||Et())&&(c.release(),s()))};if(i==null){let t=e.start+(e.curve?.durationMs??0);a=setTimeout(l,Math.max(0,t-performance.now()))}else i.finished.then(l)},z=_?.subscribe(e=>{if(e.curve!=null){if(e.kind===`hide`)d.current&&e.animated&&R(e);else if(b!=null){b.release();let t=ee();t!=null&&q(t,{y:0},e)}}}),me=0,B=()=>{cancelAnimationFrame(me),me=requestAnimationFrame(()=>ue())},he=()=>{let e=ae;if(e==null||window.scrollX===e.x&&window.scrollY===e.y)return;window.scrollTo(e.x,e.y);let n=document.activeElement;n instanceof HTMLElement&&t.contains(n)&&y(n)&&ce(n,!1)},V=[],ge=()=>{if(typeof ResizeObserver>`u`)return;for(let e of V)e();V=[];let n=new Set([t,e]);for(let e of t.children)n.add(e);let r=document.activeElement;if(r instanceof HTMLElement&&t.contains(r))for(let e=r;e&&e!==t;e=e.parentElement)n.add(e);for(let e of n)V.push(M(e,B))},_e=typeof MutationObserver>`u`?null:new MutationObserver(e=>{e.every(e=>e.type===`attributes`&&e.target===t)||(ge(),B())}),ye=()=>{ge(),B()},be=()=>{f.current=d.current,B()},U=t=>{t.target===e&&t.propertyName===`transform`&&B()},xe=oe?le():null,Se=x(window),W=g?te(window,{owns:e=>d.current&&t.contains(e),onTouch:()=>{s=null}}):null,Ce=O(window,t=>{if(t.type===`viewport`){if(t.height!==Se)Se=t.height,W?.report(),cancelAnimationFrame(me),ue(!0);else if(W?.isRevealPan(t.height)===!0){wt.add(window),cancelAnimationFrame(me);let t=A();t===0&&ue();let n=document.activeElement,r=e.closest(`dialog`);r!=null&&n instanceof HTMLElement&&n.getBoundingClientRect().bottom-v()-t<=Ct()&&W?.putBack(r)}else B()}});t.addEventListener(`focusin`,ye),t.addEventListener(`focusout`,be),e.addEventListener(`transitionend`,U);let we=I(window,`scroll`,e=>{let t=e.target;(!F(t)||fe(t))&&he()});return _e?.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),ge(),B(),()=>{a(),cancelAnimationFrame(me),xe?.(),Ce(),z?.(),b?.release(),(ee()??P())?.set({y:0}),W?.stop(),t.removeEventListener(`focusin`,ye),t.removeEventListener(`focusout`,be),e.removeEventListener(`transitionend`,U),we();for(let e of V)e();_e?.disconnect(),u(0),d.current=!1,f.current=!1}},`${i}|${n}|${c}|${g}|${r}`),{inset:l,dismiss:_}}var kt={release:{fastSpeed:1008,projectionSeconds:.1,minProjectionSpeed:250,detentTolerance:1}},At=.998/.0020000000000000018,jt=48,Mt=100,Nt=.4,Pt=40;function Ft(e){return e.syntheticTouch===!0}function It(e){return e.touchType===`stylus`?`pen`:`touch`}var Lt=.35,Rt=4,zt=8;function Bt(){typeof navigator<`u`&&typeof navigator.vibrate==`function`&&(an()||navigator.vibrate(8))}function Vt(e,t){let n=t[0],r=Math.abs(e-n);for(let i of t){let t=Math.abs(e-i);t<r&&(r=t,n=i)}if(r>=Pt)return e;let i=r/Pt,a=1-i*i;return e+(n-e)*a}function Ht(e,t,n){return Math.max(0,e-t-n)}function Ut(e,t){return`${Math.max(0,e-Math.max(0,t))}px`}function Wt(e){return e>0?`${e}px`:void 0}function Gt(e){let t=Number.parseFloat(getComputedStyle(e).paddingBlockEnd);return Number.isFinite(t)?t:0}function Kt(e){if(!e)return 0;let t=Gt(e);return Math.max(0,e.scrollHeight-e.clientHeight-t)-e.scrollTop}function qt(e){if(e.scrollHeight-e.clientHeight<=1)return!1;let{overflowY:t}=getComputedStyle(e);return t===`auto`||t===`scroll`}function Jt(e,t){for(let n=e instanceof Element?e:null;n!=null&&n!==t;n=n.parentElement)if(n.localName===`dialog`)return!0;return!1}function Yt(e,t){let n=[];for(let r=e instanceof Element?e:null;r!=null&&r!==t;r=r.parentElement)r instanceof HTMLElement&&qt(r)&&n.push(r);return n.push(t),n}function Xt(e){return e.scrollTop<=0}function Zt(e){return e.scrollTop+e.clientHeight>=e.scrollHeight-1}function Qt(e){return e.every(Xt)}function $t(e){return e.every(Zt)}function en(e){return e.some(e=>e.scrollHeight-e.clientHeight>1)}function tn(e){let t=e.map(e=>e.style.overscrollBehaviorY);for(let t of e)t.style.overscrollBehaviorY=`none`;return()=>{e.forEach((e,n)=>{e.style.overscrollBehaviorY=t[n]})}}function nn(e){e?.releaseContentHold!=null&&(e.releaseContentHold(),e.releaseContentHold=null)}function rn(e,t,n){return Math.max(0,e-n-t)}function an(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function on({isOpen:e,isOpenRequested:t=e,canDismiss:n=!0,offscreenBlockEndInset:r=0,onDismiss:i,snapHeights:a,onSnap:o,onTravelStart:s,onScrimOpacity:c,hasFixedHeight:l=!1}){let[u,d]=(0,K.useState)(0),[f,p]=(0,K.useState)(0),[m,h]=(0,K.useState)(!1),[g,_]=(0,K.useState)(null),[ee,v]=(0,K.useState)(0);g!=null&&(g.pending?t?(_(null),v(e=>e+1)):_({...g,pending:!1}):t&&_(null));let y=g!=null&&!g.pending&&!t,te=y&&g.isTouch,ne=y?g.exit:null,[re,b]=(0,K.useState)(!1),[ie,x]=(0,K.useState)(0),[ae,S]=(0,K.useState)(0),[C,oe]=(0,K.useState)(0),w=(0,K.useRef)(0),T=(0,K.useRef)(0),[E,D]=(0,K.useState)(null),[se,O]=(0,K.useState)(!1),k=(0,K.useRef)(0),A=(0,K.useRef)(null),ce=(0,K.useRef)(null),j=(0,K.useRef)(r);j.current=Math.max(0,r);let le=(0,K.useCallback)(e=>{let t=Math.max(0,e);w.current=t,oe(t)},[]),M=(0,K.useCallback)(e=>{let t=Math.max(0,e);Math.abs(t-k.current)>.5&&(k.current=t,S(t))},[]),ue=(0,K.useCallback)(()=>{O(!0),A.current=null,D(null);let e=ce.current;ce.current=null,e!=null&&M(e)},[M]),N=(0,K.useCallback)((e,t,n,r,i,a,o)=>{let s=Ht(e,n,a);o&&Math.abs(r-t)>.5&&!an()?(ce.current=s,A.current=i,D(i)):(ce.current=null,A.current=null,D(null),O(Math.abs(i-n)>.5),M(s))},[M]),P=(0,K.useRef)(0);m||(P.current=f);let de=(0,K.useRef)(e);de.current=e;let fe=(0,K.useRef)(a);fe.current=a;let F=(0,K.useRef)(s);F.current=s;let pe=(0,K.useRef)(i),I=(0,K.useRef)(n),L=(0,K.useRef)(o),R=(0,K.useRef)(c),z=(0,K.useRef)(l);(0,K.useEffect)(()=>{pe.current=i,I.current=n,L.current=o,R.current=c,z.current=l});let me=(0,K.useRef)(null);(0,K.useLayoutEffect)(()=>{let e=me.current;ee!==0&&e!=null&&(me.current=null,R.current?.(e))},[ee]);let B=(0,K.useRef)(null),he=(0,K.useRef)(0),V=(0,K.useRef)(null),H=(0,K.useRef)(null),ge=(0,K.useRef)(null);(0,K.useLayoutEffect)(()=>{if(!se)return;V.current?.offsetHeight;let e=requestAnimationFrame(()=>{O(!1)});return()=>cancelAnimationFrame(e)},[se]);let ve=(0,K.useCallback)(e=>{e<=0||!de.current||P.current>0||(he.current=e,x(t=>t===e?t:e))},[]),ye=(0,K.useCallback)(e=>{if(ge.current?.disconnect(),ge.current=null,V.current=e,!e||typeof ResizeObserver>`u`){e&&ve(e.getBoundingClientRect().height);return}let t=new ResizeObserver(e=>{let t=e[0];if(t){let e=t.borderBoxSize?.[0]?.blockSize;ve(e??t.target.getBoundingClientRect().height)}});t.observe(e),ge.current=t},[ve]);(0,K.useEffect)(()=>()=>ge.current?.disconnect(),[]),(0,K.useEffect)(()=>{e&&(d(0),p(0),h(!1),b(!1),O(!1),le(0),T.current=0,k.current=0,A.current=null,ce.current=null,S(0),D(null))},[e,le]);let be=(0,K.useCallback)(()=>he.current>0?he.current:V.current?.getBoundingClientRect().height??0,[]),U=(0,K.useCallback)(e=>{let t=rn(e,0,j.current),n=Pe(t,fe.current?.()??[]);return{offsets:n,peekOffset:Le(n,t)}},[]),xe=(0,K.useCallback)(()=>{let e=V.current;if(!e)return he.current;let t=e.style.height;if(t===``)return e.getBoundingClientRect().height;e.style.height=``;let n=e.getBoundingClientRect().height;return e.style.height=t,n},[]),W=(0,K.useCallback)(()=>{if(!de.current||B.current!=null||A.current!=null)return;let e=xe();if(e<=0)return;let{offsets:t,peekOffset:n}=U(e),r=Math.min(T.current,t.length-1),i=t[r],a=i===n?0:i,o=w.current;if(e===he.current&&Math.abs(i-P.current)<=.5&&Math.abs(a-o)<=.5)return;he.current=e,x(e),T.current=r,N(o,i,a,i,o,Kt(H.current),!1),le(a),p(i),L.current?.(rn(e,i,j.current));let s=t[t.length-1],c=rn(e,s,j.current);R.current?.(Re(i,t,s+c*Nt,n))},[xe,N,le,U]);(0,K.useEffect)(()=>{if(e&&typeof window<`u`)return window.addEventListener(`resize`,W),window.addEventListener(`orientationchange`,W),()=>{window.removeEventListener(`resize`,W),window.removeEventListener(`orientationchange`,W)}},[e,W]);let Ce=(0,K.useRef)(!1);(0,K.useLayoutEffect)(()=>{Ce.current?W():Ce.current=!0},[W,a]);let we=(0,K.useCallback)((e,t)=>{let n=V.current;if(n==null)return;let r=e-t;n.style.transform=r===0?``:`translateY(${r}px)`},[]),Te=(0,K.useCallback)((e,t)=>{let n=V.current;n!=null&&e>0&&!z.current&&(n.style.height=Ut(e,t));let r=H.current;r!=null&&(r.style.paddingBlockEnd=Wt(k.current)??``)},[]),G=(0,K.useCallback)(e=>{let t=B.current;if(t==null)return;B.current=null,e?.hasPointerCapture?.(t.pointerId)&&e.releasePointerCapture(t.pointerId),d(t.baseOffset),h(!1),b(!1),N(t.baseLayoutOffset,t.baseOffset,t.baseLayoutOffset,t.renderedOffset,t.layoutOffset,t.naturalEndGap,!0);let{offsets:n,peekOffset:r}=U(t.height),i=n[n.length-1],a=i+rn(t.height,i,j.current)*Nt;R.current?.(Re(t.baseOffset,n,a,r))},[N,U]);(0,K.useEffect)(()=>{if(!e)return;let t=()=>G(),n=()=>{document.visibilityState===`hidden`&&G()};return window.addEventListener(`blur`,t),document.addEventListener(`visibilitychange`,n),()=>{window.removeEventListener(`blur`,t),document.removeEventListener(`visibilitychange`,n)}},[G,e]);let Ee=(0,K.useCallback)((e,t,n,r,i,a,o,s,c,l,u)=>{let{offsets:d,peekOffset:f}=U(n),m=d[d.length-1],h=rn(n,m,j.current),g=m+h*Nt,ee=i>jt?e+t*At:e,v=e=>{let t=e===f?0:e;N(o,e,t,s,c,l,!0),le(t),T.current=Math.max(0,d.indexOf(e)),p(e),L.current?.(rn(n,e,j.current)),R.current?.(Re(e,d,g,f)),e!==a&&Bt()},y=e=>{I.current?(N(o,a,o,o,o,l,!1),me.current=Re(a,d,g,f),_({isTouch:u,pending:!0,exit:e}),pe.current()):v(m)};if(u){let{fastSpeed:r,minProjectionSpeed:o,projectionSeconds:s,detentTolerance:c}=kt.release,l=[...d,m+h],{index:u}=ke({points:l,position:e,velocity:t*1e3,flickThreshold:i>zt?r:1/0,tolerance:c,flickPastProjection:!0,projection:{seconds:s,minSpeed:o},start:a});u===l.length-1?y({distance:Math.max(0,n-e),velocity:t*1e3}):v(l[u])}else r>0&&ee>g?y(null):v(ze(Math.min(Math.max(ee,0),m),d,r,a))},[N,le,U]),De=(0,K.useCallback)((e,t,n)=>{let r=e.currentTarget,i=Ft(e);i||r.setPointerCapture?.(e.pointerId);let a=n??e.clientY,o=Kt(H.current),s=w.current;B.current={syntheticTouch:i,pointerType:e.pointerType,pointerId:e.pointerId,startCoord:a,lastCoord:e.clientY,lastTime:e.timeStamp,samples:[{t:e.timeStamp,y:e.clientY}],velocity:0,height:t,reserve:j.current,baseOffset:f,baseLayoutOffset:s,renderedOffset:f,layoutOffset:s,naturalEndGap:o,hasTraveled:!1},M(Ht(s,s,o)),d(f),h(!0)},[f,M]),Oe=(0,K.useCallback)(e=>{e.button===0&&e.isPrimary&&(e.preventDefault(),De(e,be()))},[De,be]),Ae=(0,K.useCallback)(e=>{B.current!=null&&(e.preventDefault(),G(e.currentTarget))},[G]),je=(0,K.useCallback)(e=>{B.current?.syntheticTouch||B.current?.pointerId===e.pointerId&&G()},[G]),Me=(0,K.useCallback)(e=>{let t=B.current;if(!t||t.pointerId!==e.pointerId||t.syntheticTouch&&!Ft(e))return;let n=e.clientY-t.startCoord;if(e.timeStamp-t.lastTime>0){for(t.lastCoord=e.clientY,t.lastTime=e.timeStamp,t.samples.push({t:e.timeStamp,y:e.clientY});t.samples.length>2&&e.timeStamp-t.samples[0].t>Mt;)t.samples.shift();let n=t.samples[0],r=Math.min(e.timeStamp-n.t,Mt);t.velocity=r>0?(e.clientY-n.y)/r:0}let{offsets:r,peekOffset:i}=U(t.height),a=t.baseOffset+n,o=r[r.length-1],s;s=a<0?t.pointerType===`touch`?Math.max(-t.reserve,Se(a,t.height-t.reserve,_e.rubberBand.coefficient)):Math.max(-48,a*Lt):a>o?a:Vt(a,r);let c=s<t.baseOffset?0:t.baseLayoutOffset,l=c!==t.layoutOffset;t.renderedOffset=s,t.layoutOffset=c,P.current=s,M(Ht(t.baseLayoutOffset,c,t.naturalEndGap)),we(s,c),l&&(Te(t.height,c),d(s)),!t.hasTraveled&&s!==t.baseOffset&&(t.hasTraveled=!0,b(!0),F.current?.());let u=r[r.length-1],f=u+rn(t.height,u,j.current)*Nt;R.current?.(Re(s,r,f,i))},[U,M,Te,we]),Ne=(0,K.useCallback)(e=>{let t=B.current;if(!t||t.pointerId!==e.pointerId||t.syntheticTouch&&!Ft(e))return;let n=e.currentTarget,r=e.clientY-t.startCoord,i=Math.max(0,t.baseOffset+r),a=r===0?0:r>0?1:-1,o=e.timeStamp-t.lastTime<Mt?t.velocity:0;B.current=null,t.syntheticTouch||n.releasePointerCapture?.(e.pointerId),h(!1),b(!1),Ee(i,o,t.height||1,a,Math.abs(r),t.baseOffset,t.baseLayoutOffset,t.renderedOffset,t.layoutOffset,t.naturalEndGap,t.pointerType===`touch`)},[Ee]),Fe=(0,K.useRef)(null),Ie=(0,K.useCallback)(e=>{if(e.button!==0||!e.isPrimary)return;let t=e.currentTarget;if(Jt(e.target,t)){Fe.current=null;return}let n=Yt(e.target,t);Qt(n)?Fe.current={pointerId:e.pointerId,startCoord:e.clientY,scrollers:n}:Fe.current=null},[]),Be=(0,K.useCallback)(e=>{if(B.current){Me(e);return}let t=Fe.current;if(!t||t.pointerId!==e.pointerId)return;let n=e.clientY-t.startCoord;n>zt&&Qt(t.scrollers)?(Fe.current=null,De(e,be(),t.startCoord),Me(e)):n<0&&(Fe.current=null)},[De,Me,be]),Ve=(0,K.useCallback)(e=>{Fe.current=null,!B.current?.syntheticTouch&&B.current&&Ne(e)},[Ne]),q=(0,K.useRef)(null),He=(0,K.useRef)(null),Ue=(0,K.useCallback)(e=>{nn(q.current),q.current=null,Fe.current=null,G(e)},[G]),We=(0,K.useRef)(De),Ge=(0,K.useRef)(G),Ke=(0,K.useRef)(Ue),qe=(0,K.useRef)(Me),Je=(0,K.useRef)(Ne),Ye=(0,K.useRef)(be);(0,K.useEffect)(()=>{We.current=De,Ge.current=G,Ke.current=Ue,qe.current=Me,Je.current=Ne,Ye.current=be});let Xe=(0,K.useCallback)(e=>{let t=(e,t)=>({syntheticTouch:!0,pointerId:e.identifier,pointerType:It(e),clientY:e.clientY,timeStamp:Date.now(),currentTarget:t,setPointerCapture:()=>{},releasePointerCapture:()=>{}}),n=e=>{let t=e.currentTarget;if(e.touches.length>1){Ke.current(t);return}let n=e.changedTouches[0];if(nn(q.current),!n||Jt(e.target,t)){q.current=null;return}let r=Yt(e.target,t),i=Qt(r),a=$t(r)&&(P.current>0||!en(r));q.current={id:n.identifier,startY:n.clientY,scrollers:r,top:i,bottom:a,contentEndY:null,promotedAtContentEnd:!1,releaseContentHold:null}},r=e=>{let n=e.currentTarget;if(e.touches.length>1){Ke.current(n);return}let r=q.current;if(B.current){let i=[...e.changedTouches].find(e=>e.identifier===B.current?.pointerId);if(!i)return;if(r?.promotedAtContentEnd&&r.contentEndY!=null){if(i.clientY>=r.contentEndY){r.contentEndY=null,r.promotedAtContentEnd=!1,nn(r),Ge.current(n);return}qe.current(t(i,n));return}e.preventDefault(),qe.current(t(i,n));return}if(!r)return;let i=[...e.changedTouches].find(e=>e.identifier===r.id);if(!i)return;let a=i.clientY-r.startY,o=r.top&&a>zt&&Qt(r.scrollers),s=r.bottom&&a<-8&&$t(r.scrollers);o||s?(e.preventDefault(),nn(r),q.current=null,We.current(t(i,n),Ye.current(),r.startY),qe.current(t(i,n))):((r.top&&a<0||r.bottom&&a>0)&&(r.top=!1,r.bottom=!1),$t(r.scrollers)?r.contentEndY==null?(r.contentEndY=i.clientY,r.releaseContentHold??=tn(r.scrollers)):r.contentEndY-i.clientY>=Rt&&(r.promotedAtContentEnd=!0,We.current(t(i,n),Ye.current(),r.contentEndY),qe.current(t(i,n))):(r.contentEndY=null,nn(r)))},i=e=>{nn(q.current),q.current=null;let n=B.current?.pointerId;if(n==null)return;let r=[...e.changedTouches].find(e=>e.identifier===n),i=e.currentTarget;r?Je.current(t(r,i)):e.touches.length===0&&Ge.current(i)},a=H.current;if(a&&He.current){let e=He.current;a.removeEventListener(`touchstart`,e.start),a.removeEventListener(`touchmove`,e.move),a.removeEventListener(`touchend`,e.end),a.removeEventListener(`touchcancel`,e.end)}H.current=e,e?(e.addEventListener(`touchstart`,n,{passive:!0}),e.addEventListener(`touchmove`,r,{passive:!1}),e.addEventListener(`touchend`,i,{passive:!0}),e.addEventListener(`touchcancel`,i,{passive:!0}),He.current={start:n,move:r,end:i}):He.current=null},[]),J=(0,K.useCallback)(e=>{if(k.current<=0)return;let t=Gt(e),n=Math.max(0,e.scrollHeight-e.clientHeight-t),r=Math.max(0,e.scrollTop-n);r<k.current-.5&&M(r)},[M]),Ze=(0,K.useCallback)(e=>{B.current==null&&A.current==null&&J(e.currentTarget)},[J]),Qe=(0,K.useCallback)(e=>{e.isPrimary?Oe(e):Ue(e.currentTarget)},[Oe,Ue]),$e=(0,K.useCallback)(e=>{e.isPrimary?Ie(e):Ue(e.currentTarget)},[Ie,Ue]),Y=(0,K.useCallback)(e=>{e.touches.length>1&&Ue(e.currentTarget)},[Ue]),et=(0,K.useCallback)(e=>{let t=B.current;t?.pointerId!==e.pointerId||t.syntheticTouch||G(e.currentTarget)},[G]),tt=m?u:f;return{sheetRef:ye,contentProps:(0,K.useMemo)(()=>({style:{transform:tt===0?void 0:`translateY(${tt}px)`,transition:e&&(m||se)?`none`:void 0,touchAction:`pinch-zoom`,overscrollBehavior:`contain`}}),[tt,m,e,se]),handleProps:(0,K.useMemo)(()=>({style:{touchAction:`pinch-zoom`,cursor:`grab`},onContextMenu:Ae,onLostPointerCapture:je,onPointerDown:Qe,onPointerMove:Me,onPointerUp:Ne,onPointerCancel:et,onTouchStart:Y,onTouchMove:Y}),[Ne,Ae,et,Qe,Y,je,Me]),bodyProps:(0,K.useMemo)(()=>({ref:Xe,onContextMenu:Ae,onLostPointerCapture:je,onPointerDown:$e,onPointerMove:Be,onPointerUp:Ve,onPointerCancel:Ve,onScroll:Ze}),[Xe,Ve,$e,Be,Ze,Ae,je]),bodyElementRef:H,dragOffset:u,settledOffset:f,isDragging:m,isTraveling:re,isDismissedByTouchDrag:te,dragExit:ne,activeOffsetRef:P,sheetHeight:ie,scrollPreservationInset:ae,settlingLayoutOffset:E,settledLayoutOffset:C,completeScrollAreaSettle:ue}}var X=r(),sn={hug:`92dvh`,capped:`62dvh`,tall:`92dvh`},cn=48,ln=.4;function un(e){return Math.max(cn,Math.ceil(e*ln))}var dn=48,fn=3,pn=50;o[`--spacing-6`];var mn=[`height`,`minHeight`,`maxHeight`,`blockSize`,`minBlockSize`,`maxBlockSize`];function hn(e){return Array.isArray(e)?e.some(hn):typeof e==`object`&&!!e}function gn(){return typeof Element<`u`&&typeof Element.prototype.animate==`function`}function _n(e,t){return he(e,ge.sheetDismissSwipe,{from:0,to:t.distance,velocity:t.velocity,epsilon:V.y})}function vn(e){let t=e.closest(`dialog`),n=e.ownerDocument;if(t==null||typeof n.getAnimations!=`function`)return;let r=n.getAnimations().filter(e=>{let n=e.effect;return n?.target===t&&e.transitionProperty===`opacity`&&Number(n.getKeyframes().at(-1)?.opacity)===0}),i=r.filter(e=>e.effect.pseudoElement===`::backdrop`);return(i.length>0?i:r.filter(e=>!e.effect.pseudoElement)).at(-1)}function yn(){return typeof window>`u`?0:window.innerHeight}function bn(e){return I(window,`resize`,e)}function xn(){return()=>{}}function Sn(e){let t=``;for(let n of e??[])t+=`${typeof n}:${n}|`;return t}var Cn={k4zj60:`x1ipgmjk`,$$css:!0},Z={sheet:{kfzvcC:`x67bb7w`,kB7OPa:`x9f619`,kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kAzted:`x2lwn1j`,kzqmXN:`xh8yej3`,ks0D6T:`x11gisft`,kWkggS:`x10xzikg`,kEafiO:`x11xkdxz`,kPef9Z:`x13fuv20`,kLZC3w:`x1pc3f07`,k2ei4v:`xgbv0en`,kVhnKS:`x1t7ytsu`,kGJrpR:`x1j92z86`,ke9TFa:`xw8tdv1`,k8ry5P:`x18b5jzi`,kBCPoo:`x1gejf6u`,krdFHd:`x81l70g`,kfmiAY:`x7hs6f1`,kGVxlE:`x1kcpxr7`,kI3sdo:`x1a2a7pz`,kVQacm:`xb3r6kr`,kGO01o:`x5559hn`,k1K539:`xgwt18o`,k3aq6I:`xnn1q72 xhbqy3z xspp5ug`,kSiTet:`x1hc1fzr x1igigxu xgo67oj`,k1ekBW:`xwcsmn1`,kIyJzY:`x80gvsz xzg1mie x1qzunnh`,kAMwcw:`xlr8y92`,k6sLGO:`x1q1rmc8`,$$css:!0},sheetSettled:{kIyJzY:`xpvlhck`,$$css:!0},sheetClosing:{k3aq6I:`x1weeur4 x1oe9tb1`,kSiTet:`x1m67veq`,kAMwcw:`x1j6inz x1s1rlkj`,$$css:!0},sheetClosingCrossFade:{k3aq6I:`xnn1q72`,kSiTet:`xg01cxk`,kIyJzY:`x8uwg2f`,$$css:!0},sheetFading:{kSiTet:`xg01cxk`,$$css:!0},sheetInactive:{kfzvcC:`x47corl`,$$css:!0},body:{kzQI83:`x1iyjqo2`,kAzted:`x2lwn1j`,kB7OPa:`x9f619`,kFalU9:`xge0x1e`,kInvED:`x1wfwxd8 x1nw7mhf`,kWkggS:`x10xzikg`,kGO01o:`x18d9i69`,$$css:!0},content:{k1xSpc:`xufnvkl`,kB7OPa:`x9f619`,kZKoxP:`x5yr21d`,kAzted:`x1lh6h5t`,$$css:!0},tallKeyboardBody:{kFlMNQ:`xrw9175`,$$css:!0},tallKeyboardContent:{k5JduY:`x1s928wv`,kc3QkE:`xhkezso`,k4zj60:`x1gmr53x`,kloYau:`x2q1x1w`,$$css:!0},keyboardInset:e=>[Cn,{"--x-nsbhg8":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}],budget:{kZKoxP:`x1fqcpoh`,$$css:!0},hugHeight:{kZKoxP:`xg7h5cd`,kskxy:`xkche18`,$$css:!0}};function wn(e,t){return e?t:{...t,ref:void 0}}function Tn(e){return e.kind===`open`?e.entering?`entering`:null:e.kind===`retained`?e.motion===`covered`?null:e.motion:e.kind===`exiting`?`exiting`:null}function En(e,t,n){if(e==null)return n(),()=>{};let r=!1,i=null,a=0,o=()=>{r||(r=!0,i!=null&&clearTimeout(i),e.removeEventListener(`transitionend`,s),e.removeEventListener(`transitioncancel`,s),n())},s=n=>{n.target===e&&n.propertyName===t&&(n.type===`transitioncancel`&&Dn(e,t)?i!=null&&(clearTimeout(i),i=setTimeout(o,a)):o())};e.addEventListener(`transitionend`,s),e.addEventListener(`transitioncancel`,s);let c=getComputedStyle(e);if(e.style.transition.trim()===`none`||c.transition.trim()===`none`)return o(),()=>{};let l=c.transitionProperty.split(`,`).map(e=>e.trim()),u=c.transitionDuration.split(`,`).map(On),d=c.transitionDelay.split(`,`).map(On),f=!1,p=l.reduce((e,n,r)=>{if(n!==t&&n!==`all`)return e;let i=u[r%u.length],a=d[r%d.length];return i==null||a==null?(f=!0,e):Math.max(e,i+a)},0);return f?()=>{e.removeEventListener(`transitionend`,s),e.removeEventListener(`transitioncancel`,s)}:p<=0?(o(),()=>{}):(a=p+pn,i=setTimeout(o,a),()=>{i!=null&&clearTimeout(i),e.removeEventListener(`transitionend`,s),e.removeEventListener(`transitioncancel`,s)})}function Dn(e,t){return(e.getAnimations?.()??[]).some(e=>e.transitionProperty===t&&(e.playState===`running`||e.playState===`paused`))}function On(e){let t=e.trim();if(!/^-?(?:\d+|\d*\.\d+)(?:ms|s)$/.test(t))return null;let n=Number.parseFloat(e);return t.endsWith(`ms`)?n:n*1e3}function kn({ref:e,state:t,isOpenRequested:n,height:r,label:o,children:s,padding:c,snapPoints:u,className:p,style:g,tabIndex:_,xstyle:ee,isEntrySettled:v=!1,onEntrySettled:y,onTransitionEnd:te,isSwipeDismissAllowed:ne=!0,isPageScrollLocked:re=!1,onDismiss:b,onScrimOpacity:ie,onScrimFadeDuration:x,onElementChange:S,handleRef:C,onMotionStart:oe,onMotionComplete:w,...T}){let E=(0,K.useRef)(null),D=(0,K.useRef)(null),se=(0,K.useRef)(t),O=(0,K.useRef)(!1),le=(0,K.useRef)(oe),M=(0,K.useRef)(w),ue=(0,K.useRef)(x),N=(0,K.useRef)(null),P=(0,K.useRef)(null),fe=t.kind===`open`&&t.entering,F=se.current,pe=F.kind===`open`&&F.entering;fe&&!pe?O.current=F.kind===`retained`:fe||(O.current=!1),(0,K.useLayoutEffect)(()=>{se.current=t,le.current=oe,M.current=w,ue.current=x},[w,oe,x,t]);let I=t.kind===`open`,L=t.kind!==`hidden`,z=t.kind===`retained`,me=z||t.kind===`exiting`,B=t.kind===`exiting`,he=z&&t.motion===`fading`,V=R(`(prefers-reduced-motion: reduce)`),_e=z&&!V?t.alignmentOffset:0,ve=Sn(u),ye=(0,K.useRef)(u);ye.current=u;let{snapHeights:Se,ignoredSnapPointsMessage:W}=(0,K.useMemo)(()=>{if(ve===``)return{snapHeights:void 0,ignoredSnapPointsMessage:``};let e=(ye.current??[]).filter(e=>!Me(e));return{snapHeights:()=>Ne(ye.current??[],yn()),ignoredSnapPointsMessage:e.length===0?``:`snapPoints ignored ${JSON.stringify(e)}. A snap point is a viewport fraction above 0 and up to 1 (0.5 is half the screen), a px length ('320px'), or a percentage ('50%').`}},[ve]);U(`BottomSheet`,W,W!==``);let Ce=g?.height,we=mn.some(e=>g?.[e]!=null)||hn(ee)||p!=null&&p!==``,Te=R(`(any-pointer: coarse)`),G=L&&Te&&!we,Ee=(0,K.useSyncExternalStore)(G?bn:xn,()=>G?yn():0,()=>0),De=Ee>0?un(Ee):cn,{contentProps:Oe,handleProps:ke,bodyProps:Ae,bodyElementRef:je,sheetRef:Pe,dragOffset:Fe,settledOffset:Ie,isDragging:Le,isDismissedByTouchDrag:Re,dragExit:ze,sheetHeight:Be,scrollPreservationInset:Ve,settlingLayoutOffset:q,settledLayoutOffset:He,completeScrollAreaSettle:Ue}=on({isOpen:I,isOpenRequested:n??I,canDismiss:ne,offscreenBlockEndInset:De,onDismiss:b,snapHeights:Se,onTravelStart:()=>{D.current?.(E.current??void 0)},onScrimOpacity:ie,hasFixedHeight:Ce!=null}),{getViewportProps:We,getContentProps:Ge}=be({axis:`both`,keyboardAccess:{owner:`contentOrViewport`,label:o},overscroll:`contain`,stickyContainment:`always`}),Ke=(0,K.useRef)(L),qe=(0,K.useCallback)(e=>{Pe(Ke.current?e:null),E.current=e,S?.(e)},[S,Pe]),Je=(0,K.useRef)(null);(0,K.useLayoutEffect)(()=>{if(Ke.current===L)return;Ke.current=L,Pe(L?E.current:null);let e=Je.current;!L&&e!=null&&(Je.current=null,H(e).set({y:0}))},[L,Pe]);let Ye=Ot(E,{move:`ride`,inset:!0,offset:dn,isEnabled:r===`tall`&&L,isExpanded:Ie===0,isOpen:I,isPageScrollLocked:re}),Xe=Ye.inset;D.current=Ye.dismiss,(0,K.useImperativeHandle)(e,()=>E.current,[]);let J=Tn(t),Ze=R(`(prefers-reduced-motion: reduce) and (pointer: coarse)`)||V&&Re,Qe=ze!=null&&!Ze&&!V&&gn()?ze:null;(0,K.useLayoutEffect)(()=>{let e=E.current;if(Qe!=null&&e!=null)return ue.current?.(e,_n(e,Qe)),()=>{ue.current?.(e,null)}},[Qe]),(0,K.useLayoutEffect)(()=>{if(J==null)return;N.current!==J&&(N.current=null),P.current=null;let e=()=>{N.current===J?M.current?.(J):P.current=J};if(J===`entering`&&O.current){e();return}let t=E.current;if(J===`exiting`&&Qe!=null&&t!=null){Je.current=t;let n=H(t).animate({y:Qe.distance},{spring:ge.sheetDismissSwipe,velocity:{y:Qe.velocity}}),r=!0,i=!1,a=null;return n.started.then(e=>{let n=i=>{if(a=null,!r)return;let o=vn(t);o==null?i>0&&(a=requestAnimationFrame(()=>n(i-1))):o.startTime=e};n(fn)}),n.finished.then(()=>{i=!0,ue.current?.(t,null),r&&e()}),()=>{r=!1,a!=null&&cancelAnimationFrame(a),i||n.retarget({y:0})}}let n=Ze&&J===`exiting`;return En(E.current,J===`fading`||n?`opacity`:`transform`,e)},[J,Ze,Qe]),(0,K.useLayoutEffect)(()=>{if(q!=null)return En(E.current,`transform`,Ue)},[Ue,q]),(0,K.useEffect)(()=>{if(J!=null)return le.current?.(J),N.current=J,P.current===J&&(P.current=null,M.current?.(J)),()=>{N.current===J&&(N.current=null),P.current===J&&(P.current=null)}},[J]);let $e=c==null,Y=c??4,et=A[Y],tt=typeof r==`string`&&r in sn?sn[r]:typeof r==`number`?`${r}px`:r,nt=Be>0,rt=Oe.style.transform,it;if(nt){let e=Le?Fe<Ie?0:He:q??He,t=(Le?Fe:Ie)-e;it=e>0||Le||q!=null?Ut(Be,e):void 0,rt=t===0?void 0:`translateY(${t}px)`}let at=_e>0?[rt,`translateY(${_e}px)`].filter(Boolean).join(` `):rt,ot=I?rt:z?at:void 0,st=g?.transform,ct=I||z||B?it:void 0,lt=Wt(Ve);(0,K.useLayoutEffect)(()=>{if(Le)return;let e=E.current;e!=null&&(st==null&&(ze==null||B&&Qe==null)&&(e.style.transform=ot??``),Ce??(e.style.height=ct??``));let t=je.current;t!=null&&(t.style.paddingBlockEnd=lt??``)});let ut={transition:Oe.style.transition,touchAction:Oe.style.touchAction,overscrollBehavior:Oe.style.overscrollBehavior,height:ct};return(0,X.jsxs)(`div`,{...T,ref:qe,tabIndex:_??-1,onTransitionEnd:e=>{te?.(e),v&&e.target===e.currentTarget&&y?.()},...d(i(`bottom-sheet`),a(ae.reset,m.reset,Z.sheet,h.reset,r===`hug`?Z.hugHeight:Z.budget,B&&Z.sheetClosing,B&&Ze&&Z.sheetClosingCrossFade,he&&Z.sheetFading,me&&Z.sheetInactive,v&&Z.sheetSettled,ee),p,{"--_sheet-budget":tt,"--_sheet-reserve":`${De}px`,...I?ut:z||B?{height:ct}:{},...g}),children:[(0,X.jsx)(`div`,{ref:C,className:`x10l6tqk x13vifvy x1o0tod xtijo5x x1vjfegm x78zum5 x6s0dn4 xl56j7k xvpftlf xafqdz2 x1so62im x1j4r261 x1jm3nie x16khyan x1cpjm7i x1oke5ut x34npju xmwhqxd x1hw15nc`,...ke,"aria-hidden":`true`}),(0,X.jsx)(`div`,{...wn(L,We({...Ae,...d(a(de.focusVisible,Z.body,r===`tall`&&Z.tallKeyboardBody),lt==null?{}:{style:{paddingBlockEnd:lt}})})),children:(0,X.jsx)(`div`,{...wn(L,Ge(a(Z.content,r===`tall`&&Z.tallKeyboardContent,r===`tall`&&Xe>0&&Z.keyboardInset(Xe),...xe($e?{useThemeDefault:`bottom-sheet`}:{paddingInnerX:et,paddingInnerY:et,paddingOuterX:et,paddingOuterY:et}),!$e&&Y!==4&&f[Y],!$e&&Y!==4&&k[Y],!$e&&Y!==4&&ce[Y],!$e&&Y!==4&&j[Y]))),children:(0,X.jsx)(l,{children:s})})})]})}kn.displayName=`BottomSheetPanel`;function An(){return(0,X.jsx)(`div`,{className:`xixxii4 x17y0mx6 x1ey2m1c x1kpxq89 x10xzikg xhtitgo x47corl x1cb67k9 xt2iwb0`,"data-sheet-edge-tint":``,"aria-hidden":`true`})}var jn=(0,K.createContext)(null);jn.displayName=`BottomSheetHostContext`;var Mn={isOpen:!0},Nn={isOpen:!1},Pn={isStacked:!1,isTop:!1,isCovered:!1,depth:0,ownsScrim:!1,isScrimHandoff:!1,isBlocked:!1,isScrimTakenOver:!1,replacedMotion:null,alignmentOffset:0,isReplacing:!1},Fn=1,In=8,Ln=Symbol.for(`astryx.bottomSheetStack.v${In}`),Rn=In;function zn(){return{shape:Rn,entries:[],shownOrder:new WeakMap,listenedDocuments:new WeakMap,batchOpened:[],batchClosed:[],batchActor:null,batchPair:null,lastPress:new WeakMap,pendingDrops:[],pendingReplaceFocus:null,closingTogether:new Map,rankByKey:new WeakMap,currentBatch:0,nextSeq:0,isBatchDirty:!1,isSealScheduled:!1,focusToKeep:new WeakMap,deferredTopLayer:new WeakMap}}function Bn(){let e=globalThis,t=e[Ln];if(t!=null)return t.shape===Rn?t:zn();let n=zn();return e[Ln]=n,n}var Q=Bn();function Vn(){return Q.isBatchDirty=!0,Hn(),{batch:Q.currentBatch,seq:Q.nextSeq++}}function Hn(){Q.isSealScheduled||typeof queueMicrotask!=`function`||(Q.isSealScheduled=!0,queueMicrotask(()=>{Q.isSealScheduled=!1,Un()}))}function Un(){Lr(),Wn(),Q.isBatchDirty&&=(Q.currentBatch+=1,!1),Q.batchOpened=[],Q.batchClosed=[],Q.batchActor=null,Q.batchPair=null}function Wn(){if(Q.batchOpened.length>0)return;let e=Q.batchClosed.filter(e=>e.isModal&&e.replace==null&&e.replacing==null);if(e.length<2)return;let t=new Map;for(let n of e){let e=t.get(n.doc)??[];e.push(n),t.set(n.doc,e)}for(let[e,n]of t){if(n.length<2)continue;let t=nr(e,!0);if(t.some(e=>e.isOpen))continue;let r=t.filter(e=>n.includes(e)),i=r[0],a={members:r,pending:new Set(r),returnTarget:i.getReturnTarget?.()??null};for(let e of r)Q.closingTogether.set(e,a)}}function Gn(e){let t=Q.entries.find(t=>t.key===e);return t!=null&&Q.closingTogether.has(t)}function Kn(e){if(e.pending.size>0||e.reported)return;e.reported=!0;let t=e.returnTarget;t!=null&&t.isConnected&&N(t)}function qn(e){let t=Q.entries.find(t=>t.key===e),n=t==null?void 0:Q.closingTogether.get(t);t!=null&&n!=null&&Jn(t,n)}function Jn(e,t){Q.closingTogether.delete(e),t.pending.delete(e),Kn(t)}function Yn(e){if(Q.listenedDocuments.has(e))return;let t=t=>{t.target instanceof Element&&Q.lastPress.set(e,{target:new WeakRef(t.target),at:Date.now()})};e.addEventListener(`pointerdown`,t,!0),e.addEventListener(`click`,t,!0),e.addEventListener(`keydown`,t,!0),Q.listenedDocuments.set(e,()=>{e.removeEventListener(`pointerdown`,t,!0),e.removeEventListener(`click`,t,!0),e.removeEventListener(`keydown`,t,!0),Q.lastPress.delete(e)})}function Xn(e){if(Q.entries.some(t=>t.doc===e))return;let t=Q.listenedDocuments.get(e);t!=null&&(Q.listenedDocuments.delete(e),t())}var Zn=1e3;function Qn(e,t){let n=Q.lastPress.get(e),r=n?.target.deref();return n!=null&&r!=null&&r.isConnected&&Date.now()-n.at<=Zn&&!$n(r,t)?r:e.activeElement}function $n(e,t){let n=Q.entries.find(n=>{let r=n.getElement();return n.doc===t.doc&&r!=null&&r.contains(e)});return n==null||n===t?!1:!n.isOpen||n.replace!=null}function er(e,t){Q.batchOpened.length===0&&Q.batchClosed.length===0&&(Q.batchActor=Qn(e.doc,e)),(t===`opened`?Q.batchOpened:Q.batchClosed).push(e)}function tr(e,t){if(e.rank.batch!==t.rank.batch)return e.rank.batch-t.rank.batch;let n=e.getTreeAnchor?.()??e.getElement(),r=t.getTreeAnchor?.()??t.getElement();if(n!=null&&r!=null&&n!==r){let e=n.compareDocumentPosition(r);if(e&Node.DOCUMENT_POSITION_FOLLOWING)return-1;if(e&Node.DOCUMENT_POSITION_PRECEDING)return 1}return e.rank.seq-t.rank.seq}function nr(e,t){return Q.entries.filter(n=>n.doc===e&&n.isModal===t).sort(tr)}function rr(e){return nr(e.doc,e.isModal)}function ir(e,t){let n=Q.shownOrder.get(e);return n==null?[]:t?n.modal:n.nonModal}function ar(e,t,n){let r=Q.shownOrder.get(e)??{modal:[],nonModal:[]};t?r.modal=n:r.nonModal=n,Q.shownOrder.set(e,r)}function or(e,t){return e.isStacked===t.isStacked&&e.isTop===t.isTop&&e.isCovered===t.isCovered&&e.depth===t.depth&&e.ownsScrim===t.ownsScrim&&e.isScrimHandoff===t.isScrimHandoff&&e.isBlocked===t.isBlocked&&e.isScrimTakenOver===t.isScrimTakenOver&&e.replacedMotion===t.replacedMotion&&e.alignmentOffset===t.alignmentOffset&&e.isReplacing===t.isReplacing}function sr(e,t){let n=[];if(!t){for(let t of e){let e={...Pn,replacedMotion:t.replace?.motion??null,alignmentOffset:t.replace?.alignmentOffset??0,isReplacing:t.replacing!=null};or(t.view,e)||(t.view=e,n.push(t))}for(let e of n)e.onView(e.view);return}let r=e.filter(e=>e.isOpen),i=r[r.length-1]??null,a=e.find(e=>e.isOpen||e.replace!=null)??null;e.forEach((t,r)=>{let o=0;for(let n=r+1;n<e.length;n+=1)e[n].isOpen&&e[n]!==t.replace?.replacer&&(o+=1);let s=t.isOpen&&o>0,c=t.getElement(),l=c!=null&&e.some(e=>{let n=e.getElement();return e!==t&&n!=null&&c.contains(n)}),u=t===a,d=u&&t.isOpen&&e.slice(0,r).some(e=>!e.isOpen),f={isStacked:e.length>1,isTop:t===i,isCovered:s,depth:o,ownsScrim:u,isScrimHandoff:d,isBlocked:s&&!l,isScrimTakenOver:!t.isOpen&&a!=null&&a!==t,replacedMotion:t.replace?.motion??null,alignmentOffset:t.replace?.alignmentOffset??0,isReplacing:t.replacing!=null};or(t.view,f)||(t.view=f,n.push(t))});for(let e of n)e.onView(e.view)}function cr(e){let t=e.ownerDocument,n=t.activeElement;if(n instanceof HTMLElement&&n!==t.body){let r=n.closest(`dialog`);r!=null&&r!==e&&!r.contains(e)&&!e.contains(r)&&fr(r)&&Q.focusToKeep.set(t,n),n.blur()}e.showModal()}function lr(e){e.style.setProperty(`--_sheet-scrim-duration`,`0s`),e.style.setProperty(`--_sheet-scrim-opacity`,`0`),cr(e),typeof getComputedStyle==`function`&&getComputedStyle(e,`::backdrop`).opacity,e.style.removeProperty(`--_sheet-scrim-duration`)}function ur(e,t,n){e!=null&&(!e.open||e.style.getPropertyValue(`--_sheet-scrim-opacity`)===t?e.style.setProperty(`--_sheet-scrim-opacity`,t):(e.style.setProperty(`--_sheet-scrim-duration`,`0s`),e.style.setProperty(`--_sheet-scrim-opacity`,t),dr(n),n.frame=requestAnimationFrame(()=>{n.frame=requestAnimationFrame(()=>{n.frame=null,e.style.removeProperty(`--_sheet-scrim-duration`)})})))}function dr(e){e.frame!=null&&(cancelAnimationFrame(e.frame),e.frame=null)}function fr(e){if(e==null)return!1;if(e.open)return!0;try{return e.matches(`:popover-open`)}catch{return!1}}function pr(e){let t=[];for(let n of Array.from(e.ownerDocument.querySelectorAll(`dialog[open]`)))n===e||n.contains(e)||n.hasAttribute(`inert`)||n.getAttribute(`aria-hidden`)===`true`||Q.entries.some(e=>!e.isOpen&&e.getElement()===n)||vr(n)&&t.push(n);return t}function mr(e,t,n){let r=e.ownerDocument,i=Q.deferredTopLayer.get(r);if(i??(i={deferred:new Map,blockers:new WeakSet,removals:null,stopListeningForClose:null},Q.deferredTopLayer.set(r,i)),i.stopListeningForClose==null){let e=()=>{gr(r)};r.addEventListener(`close`,e,!0),i.stopListeningForClose=()=>{r.removeEventListener(`close`,e,!0)}}i.deferred.set(e,t);for(let e of n)i.blockers.add(e);if(i.removals==null&&typeof MutationObserver==`function`){let{blockers:e}=i,t=new MutationObserver(t=>{t.some(t=>hr(t,e))&&gr(r)});t.observe(r,{childList:!0,subtree:!0}),i.removals=t}}function hr(e,t){for(let n of Array.from(e.removedNodes))if(n instanceof Element&&(n instanceof HTMLDialogElement?[n]:Array.from(n.querySelectorAll(`dialog`))).some(e=>t.has(e)))return!0;return!1}function gr(e){let t=Q.deferredTopLayer.get(e);if(t==null||t.deferred.size===0)return;let{deferred:n}=t;for(let[r,i]of Array.from(n)){if(!r.isConnected||!r.open){n.delete(r);continue}let a=pr(r);if(a.length>0){for(let e of a)t.blockers.add(e);continue}n.delete(r);let o=e.activeElement;r.close(),yr(r,i),e.activeElement!==o&&o instanceof HTMLElement&&o.isConnected&&o.focus({preventScroll:!0})}n.size===0&&_r(t)}function _r(e){e.removals?.disconnect(),e.removals=null,e.stopListeningForClose?.(),e.stopListeningForClose=null}function vr(e){try{if(e.matches(`:modal`))return!0}catch{}return e.getAttribute(`aria-modal`)===`true`}function yr(e,t){if(typeof e.showPopover!=`function`){e.show();return}let n=pr(e);if(n.length>0){e.show(),mr(e,t,n);return}let r=e.ownerDocument,i=t?.hasAttribute(`autofocus`)??!1;t!=null&&!i&&t.setAttribute(`autofocus`,``);try{e.showPopover()}finally{t!=null&&!i&&t.removeAttribute(`autofocus`)}Te(),t!=null&&r.activeElement===t&&!Sr(e)&&br(t)?.focus({preventScroll:!0})}function br(e){let t=e.querySelectorAll(`a[href], area[href], button, input, select, textarea, iframe, summary, [contenteditable]:not([contenteditable="false"]), [tabindex]`);for(let n of Array.from(t))if(!(n===e||n.tabIndex<0)&&!(n.disabled===!0||n.closest(`[inert]`)!=null||n.getAttribute(`type`)===`hidden`||n.hidden||typeof n.checkVisibility==`function`&&!n.checkVisibility()))return n;return null}var xr=null;function Sr(e){if(xr!=null)return xr;let t=e.ownerDocument,n=t.activeElement,r=t.createElement(`dialog`);r.setAttribute(`aria-hidden`,`true`),r.style.cssText=`position:fixed;inset:auto;opacity:0;pointer-events:none`;let i=t.createElement(`div`);i.tabIndex=-1;let a=t.createElement(`button`);a.type=`button`,i.appendChild(a),r.appendChild(i),e.appendChild(r);try{r.show(),xr=t.activeElement===i,r.close()}catch{xr=!0}finally{r.remove(),t.activeElement!==n&&n instanceof HTMLElement&&n.isConnected&&n.focus({preventScroll:!0})}return xr}function Cr(e){let t=Q.deferredTopLayer.get(e.ownerDocument);if(t!=null&&t.deferred.delete(e)&&t.deferred.size===0&&_r(t),e.hasAttribute(`popover`)&&typeof e.hidePopover==`function`)try{e.hidePopover()}catch{}e.open&&e.close()}function wr(e){if(e==null||!fr(e))return;let t=e.ownerDocument,n=t.activeElement;Cr(e),t.activeElement!==n&&n instanceof HTMLElement&&n.isConnected&&n.focus({preventScroll:!0})}function Tr(){if(Q.batchOpened.length!==1||Q.batchClosed.length!==1){Er();return}let[e]=Q.batchOpened,[t]=Q.batchClosed;if(Q.batchPair!=null&&Q.batchPair.replaced===t||t===e||t.replaceable==null||e.replaceable==null||t.doc!==e.doc||t.isModal!==e.isModal||t.replace?.replacer===e||!e.isOpen||t.isOpen)return;let n=t.getElement(),r=e.getElement();if(n==null||r==null||n.contains(r)||r.contains(n)||rr(t).some(n=>n!==e&&n!==t&&n.isOpen&&tr(n,t)>0))return;let i=Q.batchActor;(i==null||i===t.doc.body||n.contains(i))&&(t.replacing!=null&&t.replacing!==e&&Or(t.replacing),t.replace!=null&&(t.replace.replacer.replacing=null),e.replace!=null&&(e.replace=null),t.replace={replacer:e,motion:`covered`,alignmentOffset:0,isAlignmentComplete:!1,isEnteringComplete:!1},e.replacing=t,Q.batchPair={replaced:t,replacer:e,replacerOpener:e.replaceable.getOpener()},Q.lastPress.delete(e.doc),e.replaceable.setOpener(t.replaceable.getOpener()),Q.pendingReplaceFocus=e)}function Er(){let e=Q.batchPair;if(e==null)return;Q.batchPair=null;let{replaced:t,replacer:n,replacerOpener:r}=e;t.replace?.replacer===n&&(t.replace=null),n.replacing===t&&(n.replacing=null),n.replaceable?.setOpener(r),Q.pendingReplaceFocus===n&&(Q.pendingReplaceFocus=null)}function Dr(){let e=Q.pendingReplaceFocus;if(e==null)return;let t=e.getElement();t!=null&&fr(t)&&(Q.pendingReplaceFocus=null,e.focus(`replace`))}function Or(e){let t=e.replace;if(t==null)return;let{replacer:n}=t;e.replace=null,n.replacing===e&&(n.replacing=null),e.hide(),e.replaceable?.finish()}function kr(e){let t=e.getBoundingClientRect().top,n=e.ownerDocument.defaultView;if(n==null||typeof n.DOMMatrixReadOnly!=`function`)return t;let{transform:r}=n.getComputedStyle(e);return r===``||r===`none`?t:t-new n.DOMMatrixReadOnly(r).m42}function Ar(e,t){return e==null||t==null?0:Math.max(0,kr(e)-t.getBoundingClientRect().top)}function jr(e,t,n){let r=Q.entries.find(t=>t.key===e);if(r==null)return;if(n===`entering`){let e=r.replacing,n=e?.replace??null;if(e==null||n==null||n.replacer!==r)return;if(t===`start`){if(n.motion!==`covered`)return;let t=Ar(r.replaceable?.getPanel()??null,e.replaceable?.getPanel()??null);if(t>Fn&&(n.motion=`aligning`,n.alignmentOffset=t,n.isAlignmentComplete=!1),r.isEnteringInPlace)r.isEnteringInPlace=!1,n.isEnteringComplete=!0,n.motion!==`aligning`&&(n.motion=`fading`);else if(n.motion===`covered`)return}else{if(n.isEnteringComplete=!0,n.motion===`aligning`&&!n.isAlignmentComplete)return;n.motion=`fading`}Pr(r.doc,r.isModal);return}let i=r.replace;i!=null&&t===`complete`&&(n===`aligning`&&i.motion===`aligning`?(i.isEnteringComplete?i.motion=`fading`:i.isAlignmentComplete=!0,Pr(r.doc,r.isModal)):n===`fading`&&i.motion===`fading`&&(Or(r),Pr(r.doc,r.isModal)))}function Mr(e,t,n){let r=ir(e,t),i=n.filter(e=>{let t=e.getElement();return t!=null&&t.isConnected}),a=0,o=0;for(;a<i.length;){let e=r.indexOf(i[a],o);if(e===-1)break;o=e+1,a+=1}let s=new Set(i.slice(0,a)),c=i.slice(a),l=Nr(e,c),u=!1;for(let e=r.length-1;e>=0;--e)s.has(r[e])||r[e].hide();for(let e of c){let t=l!=null&&e.getElement()?.contains(l)?l:null,n=t?.hasAttribute(`autofocus`)??!1;t!=null&&!n&&t.setAttribute(`autofocus`,``),e.show(),t!=null&&!n&&t.removeAttribute(`autofocus`),u=!0}if(ar(e,t,i),!u)return;if(c.some(e=>r.includes(e))&&Te(),l!=null&&l.isConnected){e.activeElement!==l&&l.focus({preventScroll:!0});return}let d=i.filter(e=>e.isOpen);d[d.length-1]?.focus(`open`)}function Nr(e,t){let n=Q.focusToKeep.get(e);Q.focusToKeep.delete(e);let r=e.activeElement,i=n!=null&&n.isConnected?n:r instanceof HTMLElement&&r!==e.body?r:null;if(i==null)return null;for(let e of t){let t=e.getElement();if(e.isOpen&&t!=null&&t.contains(i))return i}return null}function Pr(e,t){Tr(),Q.batchOpened.length>0&&Q.batchClosed.length>0&&Lr();let n=nr(e,t);sr(n,t),Mr(e,t,n),Q.focusToKeep.delete(e),Dr(),gr(e)}function Fr(e,t,n=!0){let{key:r}=e,i=Q.rankByKey.get(r),a;i!=null&&!i.isClosed&&(i.detachedBatch==null||i.detachedBatch===Q.currentBatch)?(a={batch:i.batch,seq:i.seq},i.detachedBatch=null):(a=Vn(),Q.rankByKey.set(r,{...a,isClosed:!t,detachedBatch:null}));let o=e.getElement()?.ownerDocument??document;Yn(o);let s={...e,rank:a,isOpen:t,doc:o,isModal:n,view:Pn,replace:null,replacing:null,isEnteringInPlace:!1};return Q.entries.push(s),t&&a.batch===Q.currentBatch&&Q.isBatchDirty&&er(s,`opened`),Pr(s.doc,s.isModal),()=>{let e=Q.entries.indexOf(s);if(e===-1)return;Q.entries.splice(e,1),Xn(s.doc),ar(s.doc,s.isModal,ir(s.doc,s.isModal).filter(e=>e!==s)),Q.batchOpened=Q.batchOpened.filter(e=>e!==s),Q.batchClosed=Q.batchClosed.filter(e=>e!==s),Q.pendingDrops=Q.pendingDrops.filter(e=>e!==s),Q.pendingReplaceFocus===s&&(Q.pendingReplaceFocus=null),(Q.batchPair?.replaced===s||Q.batchPair?.replacer===s)&&(Q.batchPair=null);let t=Q.closingTogether.get(s);s.replace!=null&&(s.replace.replacer.replacing=null,s.replace=null),s.replacing!=null&&(s.replacing.replace=null,s.replacing=null),s.hide(),t!=null&&Jn(s,t);let n=Q.rankByKey.get(r);n!=null&&(n.detachedBatch=Q.currentBatch,Q.isBatchDirty=!0,Hn()),s.view=Pn,s.onView(s.view),Pr(s.doc,s.isModal)}}function Ir(e,t){let n=Q.entries.find(t=>t.key===e);if(n==null||n.isOpen===t)return;n.isOpen=t;let r=Q.rankByKey.get(e);if(t){if(Q.closingTogether.has(n)){let e=Q.closingTogether.get(n);Q.closingTogether.delete(n),e?.pending.delete(n)}n.rank=Vn(),Q.rankByKey.set(e,{...n.rank,isClosed:!1,detachedBatch:null}),er(n,`opened`),n.replace!=null&&(n.replace.replacer.replacing=null,n.replace=null,n.isEnteringInPlace=!0)}else r!=null&&(r.isClosed=!0),Q.isBatchDirty=!0,Hn(),er(n,`closed`),n.isEnteringInPlace=!1,n.replacing!=null&&Q.pendingDrops.push(n.replacing);Pr(n.doc,n.isModal)}function Lr(){if(Q.pendingDrops.length===0)return;let e=Q.pendingDrops;Q.pendingDrops=[];for(let t of e){let e=t.replace?.replacer;e!=null&&!e.isOpen&&Or(t)}}function Rr(e){let t=Q.entries.find(t=>t.key===e);if(t==null)return null;let n=rr(t);for(let e=n.indexOf(t)-1;e>=0;--e){let t=n[e],r=t.getElement();if(t.isOpen&&r!=null)return{element:r,focus:()=>t.focus(`reveal`)}}return null}function zr(e){let t=e.closest(`dialog`);for(let n of e.querySelectorAll(`[data-autofocus]`))if(!(n.closest(`dialog`)!==t||n.closest(`[inert]`)!=null||typeof n.checkVisibility==`function`&&!n.checkVisibility())&&(n.focus({preventScroll:!0}),n.ownerDocument.activeElement===n))return!0;return!1}function Br(e,t,n){if(e==null)return;let r=e.closest(`dialog`);if(r!=null&&(r.hasAttribute(`inert`)||r.getAttribute(`aria-hidden`)===`true`))return;let i=e.ownerDocument.activeElement,a=i!=null&&e.contains(i)&&i.closest(`dialog`)===e.closest(`dialog`);a&&(t===`reveal`||t===`replace`&&i!==e)||(t===`reveal`?P(e):a&&i?.hasAttribute(`data-autofocus`)===!0||zr(e)||!a&&(n||t===`replace`)&&e.focus({preventScroll:!0}))}var Vr=(0,K.createContext)(null);Vr.displayName=`BottomSheetSwitcherContext`;var Hr=e({BottomSheet:()=>$r}),$={dialog:{kVAEAm:`xixxii4`,kpwlN0:`x10a8y8t`,kzqmXN:`x1o6l61p`,kZKoxP:`xtdtrs8`,ks0D6T:`x1x1rfll`,kskxy:`x7ab17h`,kogj98:`x1ghz6dp`,kmVPX3:`x1717udv`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kWkggS:`xjbqb8w`,kVQacm:`x1rea2x4`,k1xSpc:`x1s85apg`,kI3sdo:`x1a2a7pz`,$$css:!0},dialogOpen:{k1xSpc:`x1lliihq`,$$css:!0},dialogPanelHost:{k1xSpc:`x78zum5`,kjj79g:`xl56j7k`,kGNEyG:`xuk3077`,$$css:!0},dialogNonModal:{kfzvcC:`x47corl`,kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,$$css:!0},dialogNonModalItem:{kfzvcC:`x47corl`,kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,$$css:!0},dialogNonModalItemTop:{kY2c9j:`x1vjfegm`,$$css:!0},scrim:{kGyWv1:`xnixb3f`,k5sjJv:`xni466t xxiuuzi`,kND0Po:`xc0dz0a`,k9an0g:`x10buo38`,kb4ib:`x15h3t91`,kwHxkk:`x142juwg`,k4oj2o:`x15l12jy`,$$css:!0},scrimSettled:{k9an0g:`x108qnu8`,$$css:!0},scrimClosing:{kb4ib:`x1cz9k3x`,$$css:!0},exitHoldingFocus:{kfzvcC:`x47corl`,$$css:!0},positioner:{kVAEAm:`x10l6tqk`,kkqhue:`x17y0mx6`,krVfgx:`x1ey2m1c`,k1xSpc:`x78zum5`,kjj79g:`xl56j7k`,kfzvcC:`x47corl`,$$css:!0},positionerHidden:{k1xSpc:`x1s85apg`,$$css:!0},positionerTop:{kY2c9j:`x1vjfegm`,$$css:!0},positionerStackMotion:{k3nNDw:`x1fpg8nb`,k1ekBW:`x11xpdln`,kIyJzY:`x80gvsz`,kAMwcw:`xlr8y92`,k6CgDc:`xzg1mie`,$$css:!0},positionerReceded1:{k3aq6I:`xfkfg1k`,$$css:!0},positionerReceded2:{k3aq6I:`xdo3dbm`,$$css:!0}};function Ur(e){return[e.isStacked&&$.positionerStackMotion,e.depth===1&&$.positionerReceded1,e.depth>=2&&$.positionerReceded2]}function Wr(e){e.preventDefault(),e.stopPropagation()}function Gr(e){e.key!==`Tab`&&(e.preventDefault(),e.stopPropagation())}function Kr(e,t){if(e.isStacked)return t?e.isTop?`top`:`covered`:e.replacedMotion==null?`exiting`:`replaced`}function qr(e){return e.isStacked&&!e.ownsScrim?`0`:`1`}function Jr(e,t,n){if(e==null)return;let r=e.style.getPropertyValue(`--_sheet-scrim-duration`);t==null?(n.current!=null&&r===n.current&&e.style.removeProperty(`--_sheet-scrim-duration`),n.current=null):r!==`0s`&&(n.current=`${t}ms`,e.style.setProperty(`--_sheet-scrim-duration`,n.current))}function Yr(e,t){switch(e){case`active`:return{kind:`open`,entering:!1};case`entering`:return{kind:`open`,entering:!0};case`covered`:case`aligning`:case`fading`:return{kind:`retained`,motion:e,alignmentOffset:t};case`exiting`:return{kind:`exiting`};case`hidden`:return{kind:`hidden`}}}function Xr(e,t){Br(e,`open`,t)}function Zr({ref:e,isOpen:t,onOpenChange:n,label:r,children:i,height:o=`capped`,snapPoints:s,hasScrim:c=!0,finalFocusRef:l,purpose:d=`info`,xstyle:f,...m}){let h=(0,K.useRef)(null),g=(0,K.useRef)(null),v=(0,K.useRef)(null),y=(0,K.useRef)(!1),te=(0,K.useRef)(l);te.current=l;let ne=(0,K.use)(jn)?.isOpen??!0,re=z(),b=t&&ne&&!re,[ie,x]=Ce(t,b,!1),ae=ie&&b;p(h,b&&c);let[S,C]=(0,K.useState)(b);b&&!S&&C(!0);let w=b||S,T=(0,K.useRef)({}),[D,se]=(0,K.useState)(Pn),O=(0,K.useRef)(b);O.current=b;let k=!b&&S&&D.replacedMotion!=null,[A,ce]=(0,K.useState)(!1),[j,M]=(0,K.useState)(!1),[P,de]=(0,K.useState)(b);P!==b&&(de(b),ce(!1),M(!1));let fe=b?{kind:`open`,entering:D.isReplacing}:k?{kind:`retained`,motion:D.replacedMotion??`covered`,alignmentOffset:D.alignmentOffset}:S?A?{kind:`exiting`}:{kind:`open`,entering:!1}:{kind:`hidden`},F=(0,K.use)(G),pe=(0,K.useCallback)(()=>{b&&d!==`required`&&F&&n(!1)},[F,b,n,d]),I=(0,K.useCallback)(()=>{d===`info`&&n(!1)},[n,d]),L=(0,K.useCallback)(e=>{g.current=e},[]),R=(0,K.useRef)(D);R.current=D;let he=(0,K.useRef)({frame:null});(0,K.useEffect)(()=>()=>dr(he.current),[]);let V=(0,K.useCallback)(e=>ur(h.current,e,he.current),[]),H=(0,K.useCallback)(e=>{let t=R.current;(!t.isStacked||t.ownsScrim)&&h.current?.style.setProperty(`--_sheet-scrim-opacity`,String(e))},[]),ge=(0,K.useRef)(null),_e=(0,K.useCallback)((e,t)=>{let n=R.current;(!n.isStacked||n.ownsScrim)&&Jr(e.closest(`dialog`),t,ge)},[]);(0,K.useLayoutEffect)(()=>{if(!w)return;let e=T.current,t=h.current,n=t==null?null:ue(t,{keepRestingFocus:!0}),r=Fr({key:e,getElement:()=>h.current,show:()=>{let e=h.current;e==null||fr(e)||(v.current??=document.activeElement,c?(e.style.setProperty(`--_sheet-scrim-opacity`,qr(R.current)),e.showModal()):yr(e,g.current))},hide:()=>wr(h.current),focus:e=>Br(g.current,e,c),getReturnTarget:()=>te.current?.current??v.current,onView:e=>{R.current=e,se(e),O.current||e.replacedMotion!=null?V(qr(e)):e.isScrimTakenOver&&V(`0`)},replaceable:{getPanel:()=>g.current,getOpener:()=>v.current,setOpener:e=>{v.current=e},finish:()=>{v.current=null,C(!1)}}},O.current,c);return()=>{if(n!=null&&fr(t)){let t=te.current?.current??v.current,r=c?Rr(e):null;n(()=>{(r==null||r.element.isConnected)&&(r!=null&&(t==null||!r.element.contains(t))?r.focus():t!=null&&t.isConnected&&N(t))})}r()}},[c,w,V]),(0,K.useLayoutEffect)(()=>{if(!b){let e=h.current;y.current=e!=null&&e.contains(e.ownerDocument.activeElement)}w&&Ir(T.current,b),b||(ce(!0),M(y.current))},[c,b,w]);let ve=we(h,b&&c,D.isTop,`bottom-sheet`);(0,K.useEffect)(()=>{Un()}),(0,K.useLayoutEffect)(()=>{let e=h.current;e!=null&&c&&(b||k?e.style.setProperty(`--_sheet-scrim-opacity`,qr(R.current)):S&&e.style.setProperty(`--_sheet-scrim-opacity`,`0`))},[c,b,S,k]);let ye=(0,K.useCallback)(e=>{jr(T.current,`start`,e)},[]),be=(0,K.useCallback)(e=>{if(jr(T.current,`complete`,e),e!==`exiting`||b)return;if(c&&R.current.depth>0){wr(h.current),C(!1),v.current=null;return}if(c&&Gn(T.current)){wr(h.current),C(!1),v.current=null,qn(T.current);return}let t=h.current;t!=null&&Cr(t),C(!1);let n=c?Rr(T.current):null,r=l?.current??(c||y.current?v.current:null);n!=null&&(r==null||!n.element.contains(r))?n.focus():r!=null&&N(r),v.current=null},[l,c,b]),{ref:xe}=_(),Se=!b&&S&&!k&&j,W=(0,K.useCallback)(e=>{if(e==null||!Se)return;let t=()=>{e.contains(e.ownerDocument.activeElement)||M(!1)},n=()=>queueMicrotask(t);e.addEventListener(`focusout`,n);let r=le(e,{childList:!0,subtree:!0,attributeFilter:[`disabled`,`hidden`,`inert`]},t);return()=>{e.removeEventListener(`focusout`,n),r()}},[Se]),Te=u(h,xe,W);B(w&&c),U(`BottomSheet`,"requires a non-empty `label` for an accessible name; the open sheet has no built-in heading to derive one from.",b&&!r);let{shouldDismissOnCloseRequest:Ee}=E({isActive:w,escapeBehavior:b&&d!==`required`&&F?`close`:`block`,onDismiss:pe,getContainer:()=>h.current,isPresent:()=>fr(h.current)&&!R.current.isCovered&&R.current.replacedMotion==null}),De=(0,K.useCallback)(e=>{e.target===e.currentTarget&&(e.preventDefault(),Ee()&&pe())},[pe,Ee]),Oe=(0,K.useCallback)(e=>{c&&e.target===e.currentTarget&&I()},[I,c]),ke=!b&&S,Ae=ke&&!k&&(!A||j),je=ke&&!Ae||D.isBlocked;return(0,X.jsxs)(`dialog`,{...a($.dialog,w&&$.dialogOpen,w&&$.dialogPanelHost,...Ur(D),c&&$.scrim,c&&ae&&$.scrimSettled,c&&ke&&$.scrimClosing,Ae&&$.exitHoldingFocus,!c&&$.dialogNonModal),ref:Te,popover:c?void 0:`manual`,"aria-label":r,"aria-hidden":je?`true`:void 0,"aria-modal":c&&b?`true`:void 0,role:d===`required`?`alertdialog`:void 0,inert:je?!0:void 0,"data-sheet-stack":c?Kr(D,b):void 0,"data-sheet-stack-depth":c&&D.depth>0?D.depth:void 0,onCancel:De,onClickCapture:Ae?Wr:void 0,onKeyDownCapture:Ae?Gr:void 0,onKeyUpCapture:Ae?Gr:void 0,...ee({onClick:Oe}),children:[(0,X.jsx)(kn,{...m,ref:e,state:fe,isEntrySettled:ae,onEntrySettled:x,isOpenRequested:b,height:o,label:r,snapPoints:s,isSwipeDismissAllowed:d===`info`,isPageScrollLocked:w&&c,xstyle:f,onDismiss:I,onScrimOpacity:H,onScrimFadeDuration:_e,onElementChange:L,handleRef:ve,onMotionStart:ye,onMotionComplete:be,children:(0,X.jsx)(me,{dialogRef:h,isOpen:b&&c,children:(0,X.jsx)(oe,{children:(0,X.jsx)(G,{value:!0,children:(0,X.jsx)(jn,{value:b?Mn:Nn,children:i})})})})}),w&&(0,X.jsx)(An,{})]})}function Qr({switcher:e,ref:t,sheetId:n,label:r,children:i,height:o=`capped`,snapPoints:s,purpose:c=`info`,xstyle:l,...u}){let{activeSheet:f,hasScrim:p,onActiveSheetChange:m,getSheetPhase:h,getSheetAlignmentOffset:g,hostSheet:_,isScrimOwner:v,isFlowClosing:y,registerSheetElement:te,registerSheetDialog:ne,registerSheetPurpose:re,onBeforeSheetPresent:b,isCoveredInTopLayer:ie,onSheetEnterStart:x,onSheetTransitionComplete:ae,onSheetScrimOpacityChange:S,stackView:C,dialogProps:w,onDialogCancel:T,onDialogClick:E,onDialogKeyDown:D,settledSheet:se,releaseSettledSheet:O}=e,k=typeof n==`string`&&n.length>0,A=k?h(n):`hidden`,ce=Yr(A,k?g(n):0),j=A===`active`||A===`entering`,le=A===`covered`||A===`aligning`||A===`fading`||A===`exiting`,M=A!==`hidden`,ue=k&&M&&se===n,N=A===`active`||A===`entering`,P=k&&v(n),de=le||p&&C.isBlocked,fe=k&&_===n,F=(0,K.useRef)(null),pe=(0,K.useRef)(null),I=(0,K.useRef)(null),L=(0,K.useRef)(A),R=L.current,z=(0,K.useRef)(!1);(0,K.useLayoutEffect)(()=>{L.current=A},[A]);let B=(0,K.useCallback)(()=>{c===`info`&&k&&f===n&&m(null)},[f,k,m,c,n]),he=(0,K.useCallback)(e=>{I.current=e,k&&te(n,e)},[k,te,n]),V=(0,K.useCallback)(e=>{F.current=e,k&&ne(n,e)},[k,ne,n]),H=(0,K.useCallback)(e=>{e===`entering`&&k&&x(n)},[k,x,n]),ge=(0,K.useCallback)(e=>{k&&ae({sheetId:n,phase:e})},[k,ae,n]),_e=(0,K.useCallback)(e=>{k&&S(n,e)},[k,S,n]),ve=(0,K.useRef)(null),ye=(0,K.useCallback)((e,t)=>{Jr(e.closest(`dialog`),t,ve)},[]);(0,K.useLayoutEffect)(()=>{if(k)return re(n,c),()=>re(n,null)},[k,c,re,n]),(0,K.useLayoutEffect)(()=>{let e=F.current;if(e==null||!k)return;if(!M){e.open&&e.close(),pe.current=null;return}let t=p?`modal`:`non-modal`;e.open&&pe.current!==t&&e.close(),e.open&&p&&j&&ie(n)&&e.close(),e.open||(p?(b(n),P?cr(e):lr(e)):e.show()),pe.current=t},[p,k,ie,j,M,b,P,n]),(0,K.useLayoutEffect)(()=>()=>{let e=F.current;e?.open&&e.close()},[]),(0,K.useEffect)(()=>{if(j){let e=R===`active`||R===`entering`;(!z.current||!e)&&Xr(I.current,p),z.current=!0}else A===`hidden`&&(z.current=!1)},[p,j,A,R]),U(`BottomSheet`,"requires a non-empty `label` for an accessible name; the open sheet has no built-in heading to derive one from.",j&&!r);let{className:be,style:xe,xstyle:Se,"aria-label":W,"aria-labelledby":Ce,id:we,"data-testid":Te,...Ee}=w,De=d(a($.dialog,M&&$.dialogOpen,p&&$.scrim,p&&ue&&$.scrimSettled,p&&P&&y&&$.scrimClosing,!p&&$.dialogNonModalItem,!p&&N&&$.dialogNonModalItemTop,Se),be,xe);return(0,X.jsxs)(`dialog`,{...Ee,...De,id:fe?we:void 0,"data-testid":fe?Te:void 0,ref:V,"aria-label":W??(Ce==null?r:void 0),"aria-labelledby":Ce,"aria-modal":p&&j?`true`:void 0,"aria-hidden":de?`true`:void 0,inert:de?!0:void 0,"data-sheet-stack":p&&M?Kr(C,f!=null):void 0,"data-sheet-stack-depth":p&&M&&C.depth>0?C.depth:void 0,role:c===`required`?`alertdialog`:Ee.role,onCancel:T,onKeyDown:D,...ee({...Ee,onClick:E}),children:[(0,X.jsx)(`div`,{...a($.positioner,!M&&$.positionerHidden,N&&$.positionerTop,...p?Ur(C):[]),hidden:!M,"aria-hidden":de?`true`:void 0,inert:de?!0:void 0,children:(0,X.jsx)(kn,{...u,ref:t,state:ce,isEntrySettled:ue,onEntrySettled:O,isOpenRequested:k&&f===n,height:o,label:r,snapPoints:s,isSwipeDismissAllowed:c===`info`,isPageScrollLocked:p,xstyle:l,onDismiss:B,onScrimOpacity:_e,onScrimFadeDuration:ye,onElementChange:he,onMotionStart:H,onMotionComplete:ge,children:(0,X.jsx)(Vr,{value:null,children:(0,X.jsx)(me,{dialogRef:F,isOpen:M&&p,children:(0,X.jsx)(oe,{children:(0,X.jsx)(G,{value:!0,children:(0,X.jsx)(jn,{value:j?Mn:Nn,children:i})})})})})})}),M&&(0,X.jsx)(An,{})]})}function $r(e){let t=(0,K.use)(Vr),n=e.sheetId,r=typeof n==`string`&&n.length>0;return U(`BottomSheet`,"requires a non-empty `sheetId` when nested in BottomSheetSwitcher; standalone `isOpen` / `onOpenChange` props are ignored there.",t!=null&&!r),U(`BottomSheet`,"`sheetId` only works inside BottomSheetSwitcher. Use `isOpen` and `onOpenChange` for a standalone sheet.",t==null&&n!=null),t==null?(0,X.jsx)(Zr,{...e}):(0,X.jsx)(Qr,{...e,switcher:t})}$r.displayName=`BottomSheet`;export{Hr as n,$r as t};
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{d as n,l as r,r as i,u as a}from"./themeProps-Bo2jNkIC.js";import{T as o,o as s,t as c}from"./coarsePointer-B10KWVuz.js";import{r as l,t as u}from"./useMergedRefs-S6y2xAId.js";import{t as d}from"./mergeProps-ptS-gIMz.js";import{i as f,n as p}from"./useFocusTrap-DyznXJtp.js";import{A as m,B as h,E as g,I as _,M as ee,P as v,_ as y,b as te,c as ne,d as re,f as b,g as ie,h as x,j as ae,l as S,m as C,n as oe,p as w,s as T,t as E,u as D,v as se,y as O}from"./useLayerDismissal-DwwLDEpO.js";import{a as k,h as A,n as ce,t as j}from"./padding.stylex-Nfq09GFM.js";import{i as le,t as M}from"./sharedResizeObserver-Ce0raAy-.js";import{a as ue,s as N,t as P}from"./focusReturn-DNKESCUc.js";import{i as de}from"./focusOutline.stylex-DXNeAcgS.js";import{S as fe,T as F,_ as pe,k as I,t as L}from"./scrollView-DKN9Tc2s.js";import{t as R}from"./useMediaQuery-Q9CwxYQy.js";import{t as z}from"./useIsHydrating-DmtPcCGm.js";import{n as me,t as B}from"./useScrollLock-DGeH0BW_.js";import{_ as he,d as V,f as H,l as ge,n as _e,r as ve,u as ye}from"./scroll-74w_rjcI.js";import{t as be}from"./useScrollableArea-DLpP0enQ.js";import{t as U}from"./useDevWarning-WeXt8Pe8.js";import{t as xe}from"./container.stylex-CS4Pmkv3.js";import{t as Se}from"./rubberBand-urxgJfJ0.js";import{n as W}from"./projection-C57DLs2K.js";import{a as Ce,i as we,n as Te}from"./modalOutlet-CNlIUlZC.js";import{un as G}from"./index-Cfhzi3KD.js";var K=t(n(),1),Ee=v();function De(e){let t=e*1e3;return t/(1+t)}function Oe(e,t){let n=0;for(let r=1;r<e.length;r+=1)Math.abs(e[r]-t)<Math.abs(e[n]-t)&&(n=r);return n}function ke({points:e,position:t,velocity:n,flickThreshold:r,tolerance:i=0,flickPastProjection:a=!1,projection:o,start:s,fromIndex:c,maxSteps:l}){if(e.length===0)throw RangeError(`resolveSnapPoint needs at least one snap point`);let u=o==null||Math.abs(n)<(o.minSpeed??0)?0:n,d=W(e,{position:t,velocity:u,rate:o==null?void 0:De(o.seconds),fromIndex:c,maxSteps:l}),f=d.index;if(Math.abs(n)>=r){let r=-1;if(n>0)r=e.findIndex(e=>e>t+i);else for(let n=e.length-1;n>=0&&r===-1;--n)e[n]<t-i&&(r=n);if(r!==-1&&(n>0?r>f:r<f)&&(f=r),a){let t=d.projected,r=n>0?e.length-1:0;if(n>0){let n=e.findIndex(e=>e>=t-i);r=n===-1?r:n}else for(let n=e.length-1;n>=0;--n)if(e[n]<=t+i){r=n;break}(n>0?r>f:r<f)&&(f=r)}}if(s!=null&&n!==0&&Math.sign(n)===Math.sign(s-t)&&(f=Oe(e,s)),c!=null&&l!=null){let t=Math.min(Math.max(c,0),e.length-1);f=Math.min(Math.max(f,t-l),t+l)}return{index:f,projected:d.projected}}var Ae=/^(\d+(?:\.\d+)?|\.\d+)(px|%)$/i;function je(e,t){if(typeof e==`number`)return Number.isFinite(e)&&e>0&&e<=1?e*t:null;let n=Ae.exec(e.trim());if(n===null)return null;let r=Number.parseFloat(n[1]);return r>0?n[2].toLowerCase()===`%`?r/100*t:r:null}function Me(e){return je(e,1)!==null}function Ne(e,t){let n=[];for(let r of e){let e=je(r,t);e!==null&&n.push(e)}return n}function Pe(e,t,n=48){let r=[0,...t.filter(t=>t>0&&t<e).map(t=>e-t)].sort((e,t)=>e-t),i=[];for(let e of r){let t=i[i.length-1];(t===void 0||e-t>=n)&&i.push(e)}return i}function Fe(e,t){return t.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t,t[0])}var Ie=.3;function Le(e,t){if(e.length<2||t<=0)return null;let n=e[e.length-1];return t-n<=.25*t?n:null}function Re(e,t,n,r){let i=r!==null,a=i?t[t.length-2]:t[t.length-1],o=i?r:n,s=i?Ie:0;return e<=a?1:e>=o?s:1-(1-s)*((e-a)/(o-a))}function ze(e,t,n,r){let i=t;if(n>0){let e=t.filter(e=>e>=r);e.length>0&&(i=e)}else if(n<0){let e=t.filter(e=>e<=r);e.length>0&&(i=e)}return Fe(e,i)}function Be(e,t){let n=e.ownerDocument.defaultView;if(n==null)return null;for(let r=e.parentElement;r!=null;r=r.parentElement){if(L.has(n.getComputedStyle(r).overflowY)&&r.scrollHeight>r.clientHeight)return r;if(r===t)return null}return null}function Ve(e,t,n,r){return r<=n?0:t>r?t-r:e<n?e-n:0}function q(e,t,n,{entrance:r=!1}={}){if(!n.animated||n.curve==null||performance.now()>=n.start+n.curve.durationMs)return e.set(t),null;let i=r?{at:n.start,crossfadeAs:`entrance`}:{at:n.start},a=n.curve.durationMs/1e3,o=re(n.curve.points),s={};for(let[r,i]of Object.entries(t)){let t=e.get(r,n.start),c=e=>t+(i-t)*o(Math.min(1,Math.max(0,e/a)));s[r]={duration:a,at:c,velocity:e=>{if(e>=a)return 0;let t=Math.max(0,e-.001),n=Math.min(a,e+.001);return(c(n)-c(t))/(n-t)}}}return e.play(s,i)}var He=new WeakSet;function Ue(e){return He.add(e),()=>{He.delete(e)}}function We(e){for(let t=e.parentElement;t!=null;t=t.parentElement)if(He.has(t))return!0;return!1}function Ge(e){let t=e.ownerDocument,n=Be(e);return n==null||n===t.body||n===t.documentElement?t.scrollingElement??t.documentElement:n}function Ke(e,t){return e.getBoundingClientRect().bottom-t.get(`y`)}function qe(e){let t=e.ownerDocument.defaultView?.getComputedStyle(e).translate??``;return parseFloat(t.split(` `)[1]??``)||0}function Je(e){let t=e.ownerDocument.defaultView,n=Ye(e);if(t==null||n==null)return null;let r=J(n,t);return r===`docked`?{docked:n}:r}function Ye(e){let t=e.ownerDocument.defaultView;if(t==null)return null;for(let n=e.parentElement;n!=null;n=n.parentElement)if(t.getComputedStyle(n).position===`fixed`)return n;return null}function Xe(e,t){let n=t.getComputedStyle(e).transform,r=/^matrix(3d)?\(([^)]*)\)$/.exec(n);if(r==null)return 0;let i=(r[2]??``).split(`,`).map(Number),a=r[1]==null?i[5]:i[13];return a!=null&&Number.isFinite(a)?a:0}function J(e,t){let n=g(t),r=e.getBoundingClientRect();if(r.height>=n-1)return`fills-viewport`;let i=r.bottom-qe(e)-Xe(e,t);return Math.abs(n-i)<=1?`docked`:`floating`}var Ze=new WeakMap;function Qe(e,t){let n=t.getComputedStyle(e).translate;if(n===``||n===`none`)return!1;let r=Ze.get(e);return r==null||r.get(`y`)===0}var $e=new Set([`transform`,`translate`,`top`,`bottom`,`inset`,`inset-block`,`inset-block-start`,`inset-block-end`]),Y=new Set([`offset`,`computedOffset`,`easing`,`composite`]);function et(e){if(`transitionProperty`in e)return[String(e.transitionProperty)];let t=e.effect;if(t==null||!(`getKeyframes`in t))return[];let n=new Set;for(let e of t.getKeyframes())for(let t of Object.keys(e))Y.has(t)||n.add(t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`));return[...n]}function tt(e){if(typeof e.getAnimations!=`function`)return!1;let t=Ze.has(e);return e.getAnimations().some(e=>{if(e.playState!==`running`)return!1;let n=`transitionProperty`in e;if(!n&&!(`animationName`in e))return!1;let r=et(e);return t&&n&&r.every(e=>e===`translate`)?!1:r.some(e=>$e.has(e))})}function nt(e){let t=e.ownerDocument.defaultView;return t!=null&&t.getComputedStyle(e).position===`fixed`&&J(e,t)===`docked`}function rt(e,t,n,r){let i=e+n-(g(r)-t);return t>0&&i>1?i:0}function it(e,t,n,r,i,a){if(!a&&(!nt(e)||tt(e)))return 0;let o=rt(Ke(e,t),n,0,i),s=ut(e);if(s!=null){if(!a)return o;let e=rt(Ke(s,t),n,r,i);return Math.max(o,e)}return y(e.ownerDocument.activeElement)?0:t.get(`y`)<0?o:0}function at(e,t,n){let r=e.ownerDocument;e===(r.scrollingElement??r.documentElement)?n.scrollBy({top:t,behavior:`instant`}):e.scrollTop+=t}function ot(e,t,n,r,i,a=0){let o=e.ownerDocument,s=g(i)-n,c=0,l=n>1?s-r:s;if(t!==(o.scrollingElement??o.documentElement)){let e=t.getBoundingClientRect();c=Math.max(c,e.top+a),l=Math.min(l,e.bottom+a)}let u=e.getBoundingClientRect();return Ve(u.top+a,u.bottom+a,c,l)}function st(e,t,n,r,i){let a=ot(e,t,n,r,i);Math.abs(a)>1&&at(t,a,i)}function ct(e,t,n,r){C(e,t,n);let i=e.ownerDocument.defaultView,a={bubbles:!0,cancelable:!0,composed:!0,detail:1,clientX:t,clientY:n,screenX:r.screenX,screenY:r.screenY},o=i?.PointerEvent,s=typeof o==`function`?new o(`click`,{...a,pointerType:`touch`,isPrimary:!0,pointerId:r.identifier}):new((i?.MouseEvent)??MouseEvent)(`click`,a);e.dispatchEvent(s)}function lt(e,t){let n=te(e,{owns:t}),r=x(e);return{report(e){e===r?n.isRevealPan(e)&&n.putBack():(r=e,n.report())},stop:()=>n.stop()}}function ut(e){let t=e.ownerDocument.activeElement;return t!=null&&t!==e&&e.contains(t)&&y(t)?t:null}function dt(e){return e!=null&&ie(e)&&c(e)}function ft(e,{move:t,offset:n}){let r=e.ownerDocument,i=r.defaultView;if(!dt(i))return()=>{};let a=Ue(e),o=se(r,{claim:t=>t instanceof i.HTMLElement&&t!==e&&e.contains(t)&&y(t)?t:null}),s=b(e,{claim:t=>{let n=w(t,e);return n!=null&&n!==r.activeElement?n:null},deliver:ct}),c=t===`ride`?vt(e,n,i,!0):pt(e,()=>ut(e),e,n,i);return()=>{c(!0),s(),o(),a()}}function pt(e,t,n,r,i){let a=e=>{let a=t();a!=null&&st(a,n,e,r,i)},o=lt(i,e=>e===t()),s=x(i),c=O(i,e=>{e.type===`viewport`&&(Math.abs(e.height-s)>1&&(s=e.height,a(e.height)),o.report(e.height))}),l=()=>a(x(i));return e.addEventListener(`focusin`,l),a(x(i)),()=>{c(),o.stop(),e.removeEventListener(`focusin`,l)}}function mt(e,t,n){return t>1&&e.getBoundingClientRect().height>g(n)-t+1}function ht(e){let t=ut(e),n=t==null?null:Be(t,e);return t==null||n==null?null:{field:t,scroller:n}}function gt(e,t,n,r,i){if(!nt(e)||tt(e))return 0;let a=rt(Ke(e,t),n,0,i),o=ut(e);if(o==null)return y(e.ownerDocument.activeElement)?0:Math.min(Math.max(0,-t.get(`y`)),a);let s=rt(Ke(o,t),n,r,i);return Math.min(s,a)}var _t=new WeakMap;function vt(e,t,n,r){_t.get(e)?.();let i=H(e);Ze.set(e,i);let a=D(n)===`chromium`?ne(n):null,o=`riding`,s=null,c=null,l=lt(n,t=>e.contains(t)),u=0,d=null,f=()=>{o=`ended`,s?.(),c?.(),s=null,c=null,l.stop(),h(),u!==0&&(n.cancelAnimationFrame(u),u=0),_t.get(e)===f&&_t.delete(e)};_t.set(e,f);let p=(a,s)=>{if(o===`ended`)return;let c=!r&&mt(e,a,n),l=c?ht(e):null,u=c?l==null?gt(e,i,a,t,n):0:it(e,i,a,t,n,r),d=u>0?-u:0,p=l==null?0:ot(l.field,l.scroller,a,t,n,d-i.get(`y`));l!=null&&Math.abs(p)>1&&at(l.scroller,p,n),(d!==0||i.get(`y`)!==0)&&(s==null?i.set({y:d}):q(i,{y:d},s)),o===`waiting`&&a<=1&&f()},m=e=>{e!=null&&(d=e),u===0&&(u=n.requestAnimationFrame(()=>{u=0;let e=d;d=null,p(e?.to??a?.inset??x(n),e)}))};a==null?s=O(n,e=>{e.type===`viewport`&&(m(null),l.report(e.height))}):c=a.subscribe(m);let h=I(n,`focusin`,()=>m(null));return m(null),(e=!1)=>{o!==`ended`&&(e||x(n)<=1?(f(),i.get(`y`)!==0&&i.set({y:0})):o=`waiting`)}}function yt(e){if(We(e))return null;let t=Je(e);if(t===`floating`||t===`fills-viewport`)return bt(e,Ye(e));if(t==null){let t=Ge(e);return t.scrollHeight>t.clientHeight?{reveal:t}:null}let n=e.ownerDocument.defaultView;return n!=null&&Qe(t.docked,n)?bt(e,t.docked):{ride:t.docked}}function bt(e,t){let n=t==null?null:Be(e,t);return n==null?null:{reveal:n}}function xt(e,{offset:t=10}={}){let n=e.ownerDocument,r=n.defaultView;if(!dt(r))return()=>{};let i=se(n,{claim:t=>t===e&&yt(e)!=null?e:null}),a=b(e,{claim:()=>n.activeElement!==e&&yt(e)!=null?e:null,deliver:ct}),o=null,s=null,c=()=>{if(o!=null)return;let i=yt(e);i!=null&&(o=`ride`in i?vt(i.ride,t,r,!1):pt(e,()=>n.activeElement===e?e:null,i.reveal,t,r))},l=()=>{o?.(),s=o??s,o=null};return e.addEventListener(`focus`,c),e.addEventListener(`blur`,l),()=>{e.removeEventListener(`focus`,c),e.removeEventListener(`blur`,l),o?.(!0),s?.(!0),o=null,s=null,a(),i()}}var St=4;function Ct(){return g(window)-x(window)}var wt=new WeakSet;function Tt(e,t){let n=e-t;return n>1?n:0}function Et(){return x(window)<=.5}function Dt(){let e=pe(document);return e!=null&&(T(e)||S(e))}function Ot(e,{move:t,inset:n=!1,offset:r=10,isEnabled:i=!0,isExpanded:a=!0,isOpen:o=!0,isPageScrollLocked:c=!1}={}){let[l,u]=(0,K.useState)(0),d=(0,K.useRef)(!1),f=(0,K.useRef)(!1),p=(0,K.useRef)(i),m=(0,K.useRef)(a),h=(0,K.useRef)(o);p.current=i,m.current=a,h.current=o;let g=R(s,!1),_=(0,K.useCallback)(t=>{let n=e.current,r=document.activeElement;p.current&&n!=null&&r instanceof HTMLElement&&r!==n&&n.contains(r)&&(f.current=d.current,t==null?r.blur():t.focus({preventScroll:!0}))},[e]);return(0,K.useEffect)(()=>{i&&!o&&_()},[_,i,o]),ye(e,e=>!i||n||!g?()=>{}:t==null?xt(e,{offset:r}):ft(e,{move:t,offset:r}),`${i}|${t}|${n}|${r}|${g}`),ye(e,e=>{let t=e.querySelector(`[data-scroll-axis]`);if(!i||!n||t==null)return()=>{};let a=Ue(e),o=null,s=null,l=0,p=0,_=g&&D(window)===`chromium`?ne(window):null,ee=()=>{let e=t.firstElementChild;return _!=null&&e instanceof HTMLElement?H(e):null},v=()=>{let e=t.firstElementChild;return e instanceof HTMLElement?qe(e):0},re=e=>{let t=_?.transition;return t!=null&&t.kind===`show`&&t.animated&&t.curve!=null&&(e||performance.now()<t.start+t.curve.durationMs)?t:null},b=null,ae=null,S=null,C=null,oe=g&&ie(window),T=e=>{let n=e!==l,r=n?t.scrollHeight:0;l=e,(0,Ee.flushSync)(()=>u(e)),n&&(p=e===0?0:Math.max(0,p+t.scrollHeight-r))},E=()=>{T(0),C!=null&&(s=null,t.scrollTop=C),o=null,S=null,C=null,ae=null,d.current=!1,f.current=!1},k=(e,n,r=null,i=null)=>{s=null;let a=r==null?null:ee();if(r!=null&&a!=null){let n=t.scrollTop;t.scrollTop=n+e;let o=t.scrollTop-n;if(o!==0){let e=a.get(`y`,r.start)+o;a.set({y:i==null?e:Math.min(e,i)}),q(a,{y:0},r,{entrance:i!=null})}return}if(typeof t.scrollBy!=`function`){t.scrollTop+=e;return}let o=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,c=n&&!o?`smooth`:`instant`;c===`smooth`&&(s=t.scrollTop+e),t.scrollBy({top:e,behavior:c})},A=()=>{if(s==null)return 0;let e=Math.max(t.scrollTop,t.scrollHeight-t.clientHeight),n=Math.min(s,e)-t.scrollTop;return Math.abs(n)<1?0:n},ce=(e,n,i=null)=>{let a=t.getBoundingClientRect(),o=e.getBoundingClientRect(),s=Ct(),c=Tt(a.bottom,s)>0?r:0,l=a.top,u=Math.min(a.bottom,s-c),d=A()+v(),f=o.bottom-d,p=Ve(o.top-d,f,l,u);p>0?k(p,n,i,Math.max(0,s-u-St)):p<0&&k(p,n,i)},j=e=>{let t=Ct();if(Et()||Tt(e.bodyBottom,t)===0){E();return}let n=Math.max(0,e.bodyBottom-(t-r));T(n)},le=()=>se(document,{isActive:()=>m.current,claim:e=>w(e,t),park:n=>{h.current&&w(n,t)&&e.focus({preventScroll:!0})}}),ue=(e=!1)=>{if(b!=null&&b.onReveal?.()!==!0)return;let n=Ct(),i=document.activeElement,a=i instanceof HTMLElement&&t.contains(i)&&y(i)?i:null;if(d.current&&Et()){let e=pe();E(),m.current&&a!=null&&ce(a,!1),e();return}if(!m.current||a==null){if(f.current&&o){let e=pe();j(o),e(),m.current&&d.current&&!Dt()&&L();return}E();return}d.current&&S!=null&&n>S+.5&&C!=null&&(s=null,t.scrollTop=C,S=n),f.current=!1;let l=t.getBoundingClientRect(),u=Tt(l.bottom,n),p=u>0?r:0;o=u>0?{bodyBottom:l.bottom}:null,u>0&&!d.current&&(S=n,C=t.scrollTop,c&&(ae={x:window.scrollX,y:window.scrollY})),d.current=u>0;let h=u>0?Math.max(0,l.bottom-(n-p)):0;T(h),ce(a,u>0&&!wt.has(window),u>0?re(e):null)},N=()=>{let e=t.scrollTop,n=Math.max(0,t.scrollHeight-p-t.clientHeight),r=Math.min(n,C??e),i=document.activeElement;if(m.current&&i instanceof HTMLElement&&t.contains(i)&&y(i)){let a=t.getBoundingClientRect(),o=i.getBoundingClientRect(),s=e-r-v();o.bottom+s>a.bottom?r+=o.bottom+s-a.bottom:o.top+s<a.top&&(r+=o.top+s-a.top),r=Math.min(n,Math.max(0,r))}return r},P=()=>{let e=t.firstElementChild;return oe&&_==null&&e instanceof HTMLElement?H(e):null},de=(e,t)=>e.animate({y:t},{spring:ve}),pe=()=>{let e=P();if(e==null)return()=>{};let n=e.get(`y`)-t.scrollTop;return()=>{let r=n+t.scrollTop;Math.abs(r-e.get(`y`))<.5||(e.set({y:r}),de(e,0))}},L=()=>{let e=P();if(e==null||b!=null)return;let n=t.scrollTop-N();if(n===0)return;let r={release:()=>{b===r&&(b=null)},onReveal:()=>{let n=document.activeElement;if(n instanceof HTMLElement&&t.contains(n)&&Dt())return r.release(),de(e,0),!0;if(Et()){r.release();let n=e.get(`y`),i=e.getVelocity(`y`),a=t.scrollTop;E();let o=a-t.scrollTop;Math.abs(n-o)<.5?e.set({y:0}):(e.set({y:n-o}),e.animate({y:0},{spring:ve,velocity:{y:i}}))}return!1}};b=r,de(e,n)},R=e=>{b?.release();let n=ee(),r=t.scrollTop-N(),i=n!=null&&r!==0?q(n,{y:r},e):null,a,o=!1,s=()=>{ue(),n?.set({y:0})},c={release:()=>{clearTimeout(a),b===c&&(b=null)},onReveal:()=>(o&&Et()&&(c.release(),s()),!1)};b=c;let l=()=>{b===c&&(o=!0,(!d.current||Et())&&(c.release(),s()))};if(i==null){let t=e.start+(e.curve?.durationMs??0);a=setTimeout(l,Math.max(0,t-performance.now()))}else i.finished.then(l)},z=_?.subscribe(e=>{if(e.curve!=null){if(e.kind===`hide`)d.current&&e.animated&&R(e);else if(b!=null){b.release();let t=ee();t!=null&&q(t,{y:0},e)}}}),me=0,B=()=>{cancelAnimationFrame(me),me=requestAnimationFrame(()=>ue())},he=()=>{let e=ae;if(e==null||window.scrollX===e.x&&window.scrollY===e.y)return;window.scrollTo(e.x,e.y);let n=document.activeElement;n instanceof HTMLElement&&t.contains(n)&&y(n)&&ce(n,!1)},V=[],ge=()=>{if(typeof ResizeObserver>`u`)return;for(let e of V)e();V=[];let n=new Set([t,e]);for(let e of t.children)n.add(e);let r=document.activeElement;if(r instanceof HTMLElement&&t.contains(r))for(let e=r;e&&e!==t;e=e.parentElement)n.add(e);for(let e of n)V.push(M(e,B))},_e=typeof MutationObserver>`u`?null:new MutationObserver(e=>{e.every(e=>e.type===`attributes`&&e.target===t)||(ge(),B())}),ye=()=>{ge(),B()},be=()=>{f.current=d.current,B()},U=t=>{t.target===e&&t.propertyName===`transform`&&B()},xe=oe?le():null,Se=x(window),W=g?te(window,{owns:e=>d.current&&t.contains(e),onTouch:()=>{s=null}}):null,Ce=O(window,t=>{if(t.type===`viewport`){if(t.height!==Se)Se=t.height,W?.report(),cancelAnimationFrame(me),ue(!0);else if(W?.isRevealPan(t.height)===!0){wt.add(window),cancelAnimationFrame(me);let t=A();t===0&&ue();let n=document.activeElement,r=e.closest(`dialog`);r!=null&&n instanceof HTMLElement&&n.getBoundingClientRect().bottom-v()-t<=Ct()&&W?.putBack(r)}else B()}});t.addEventListener(`focusin`,ye),t.addEventListener(`focusout`,be),e.addEventListener(`transitionend`,U);let we=I(window,`scroll`,e=>{let t=e.target;(!F(t)||fe(t))&&he()});return _e?.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),ge(),B(),()=>{a(),cancelAnimationFrame(me),xe?.(),Ce(),z?.(),b?.release(),(ee()??P())?.set({y:0}),W?.stop(),t.removeEventListener(`focusin`,ye),t.removeEventListener(`focusout`,be),e.removeEventListener(`transitionend`,U),we();for(let e of V)e();_e?.disconnect(),u(0),d.current=!1,f.current=!1}},`${i}|${n}|${c}|${g}|${r}`),{inset:l,dismiss:_}}var kt={release:{fastSpeed:1008,projectionSeconds:.1,minProjectionSpeed:250,detentTolerance:1}},At=.998/.0020000000000000018,jt=48,Mt=100,Nt=.4,Pt=40;function Ft(e){return e.syntheticTouch===!0}function It(e){return e.touchType===`stylus`?`pen`:`touch`}var Lt=.35,Rt=4,zt=8;function Bt(){typeof navigator<`u`&&typeof navigator.vibrate==`function`&&(an()||navigator.vibrate(8))}function Vt(e,t){let n=t[0],r=Math.abs(e-n);for(let i of t){let t=Math.abs(e-i);t<r&&(r=t,n=i)}if(r>=Pt)return e;let i=r/Pt,a=1-i*i;return e+(n-e)*a}function Ht(e,t,n){return Math.max(0,e-t-n)}function Ut(e,t){return`${Math.max(0,e-Math.max(0,t))}px`}function Wt(e){return e>0?`${e}px`:void 0}function Gt(e){let t=Number.parseFloat(getComputedStyle(e).paddingBlockEnd);return Number.isFinite(t)?t:0}function Kt(e){if(!e)return 0;let t=Gt(e);return Math.max(0,e.scrollHeight-e.clientHeight-t)-e.scrollTop}function qt(e){if(e.scrollHeight-e.clientHeight<=1)return!1;let{overflowY:t}=getComputedStyle(e);return t===`auto`||t===`scroll`}function Jt(e,t){for(let n=e instanceof Element?e:null;n!=null&&n!==t;n=n.parentElement)if(n.localName===`dialog`)return!0;return!1}function Yt(e,t){let n=[];for(let r=e instanceof Element?e:null;r!=null&&r!==t;r=r.parentElement)r instanceof HTMLElement&&qt(r)&&n.push(r);return n.push(t),n}function Xt(e){return e.scrollTop<=0}function Zt(e){return e.scrollTop+e.clientHeight>=e.scrollHeight-1}function Qt(e){return e.every(Xt)}function $t(e){return e.every(Zt)}function en(e){return e.some(e=>e.scrollHeight-e.clientHeight>1)}function tn(e){let t=e.map(e=>e.style.overscrollBehaviorY);for(let t of e)t.style.overscrollBehaviorY=`none`;return()=>{e.forEach((e,n)=>{e.style.overscrollBehaviorY=t[n]})}}function nn(e){e?.releaseContentHold!=null&&(e.releaseContentHold(),e.releaseContentHold=null)}function rn(e,t,n){return Math.max(0,e-n-t)}function an(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function on({isOpen:e,isOpenRequested:t=e,canDismiss:n=!0,offscreenBlockEndInset:r=0,onDismiss:i,snapHeights:a,onSnap:o,onTravelStart:s,onScrimOpacity:c,hasFixedHeight:l=!1}){let[u,d]=(0,K.useState)(0),[f,p]=(0,K.useState)(0),[m,h]=(0,K.useState)(!1),[g,_]=(0,K.useState)(null),[ee,v]=(0,K.useState)(0);g!=null&&(g.pending?t?(_(null),v(e=>e+1)):_({...g,pending:!1}):t&&_(null));let y=g!=null&&!g.pending&&!t,te=y&&g.isTouch,ne=y?g.exit:null,[re,b]=(0,K.useState)(!1),[ie,x]=(0,K.useState)(0),[ae,S]=(0,K.useState)(0),[C,oe]=(0,K.useState)(0),w=(0,K.useRef)(0),T=(0,K.useRef)(0),[E,D]=(0,K.useState)(null),[se,O]=(0,K.useState)(!1),k=(0,K.useRef)(0),A=(0,K.useRef)(null),ce=(0,K.useRef)(null),j=(0,K.useRef)(r);j.current=Math.max(0,r);let le=(0,K.useCallback)(e=>{let t=Math.max(0,e);w.current=t,oe(t)},[]),M=(0,K.useCallback)(e=>{let t=Math.max(0,e);Math.abs(t-k.current)>.5&&(k.current=t,S(t))},[]),ue=(0,K.useCallback)(()=>{O(!0),A.current=null,D(null);let e=ce.current;ce.current=null,e!=null&&M(e)},[M]),N=(0,K.useCallback)((e,t,n,r,i,a,o)=>{let s=Ht(e,n,a);o&&Math.abs(r-t)>.5&&!an()?(ce.current=s,A.current=i,D(i)):(ce.current=null,A.current=null,D(null),O(Math.abs(i-n)>.5),M(s))},[M]),P=(0,K.useRef)(0);m||(P.current=f);let de=(0,K.useRef)(e);de.current=e;let fe=(0,K.useRef)(a);fe.current=a;let F=(0,K.useRef)(s);F.current=s;let pe=(0,K.useRef)(i),I=(0,K.useRef)(n),L=(0,K.useRef)(o),R=(0,K.useRef)(c),z=(0,K.useRef)(l);(0,K.useEffect)(()=>{pe.current=i,I.current=n,L.current=o,R.current=c,z.current=l});let me=(0,K.useRef)(null);(0,K.useLayoutEffect)(()=>{let e=me.current;ee!==0&&e!=null&&(me.current=null,R.current?.(e))},[ee]);let B=(0,K.useRef)(null),he=(0,K.useRef)(0),V=(0,K.useRef)(null),H=(0,K.useRef)(null),ge=(0,K.useRef)(null);(0,K.useLayoutEffect)(()=>{if(!se)return;V.current?.offsetHeight;let e=requestAnimationFrame(()=>{O(!1)});return()=>cancelAnimationFrame(e)},[se]);let ve=(0,K.useCallback)(e=>{e<=0||!de.current||P.current>0||(he.current=e,x(t=>t===e?t:e))},[]),ye=(0,K.useCallback)(e=>{if(ge.current?.disconnect(),ge.current=null,V.current=e,!e||typeof ResizeObserver>`u`){e&&ve(e.getBoundingClientRect().height);return}let t=new ResizeObserver(e=>{let t=e[0];if(t){let e=t.borderBoxSize?.[0]?.blockSize;ve(e??t.target.getBoundingClientRect().height)}});t.observe(e),ge.current=t},[ve]);(0,K.useEffect)(()=>()=>ge.current?.disconnect(),[]),(0,K.useEffect)(()=>{e&&(d(0),p(0),h(!1),b(!1),O(!1),le(0),T.current=0,k.current=0,A.current=null,ce.current=null,S(0),D(null))},[e,le]);let be=(0,K.useCallback)(()=>he.current>0?he.current:V.current?.getBoundingClientRect().height??0,[]),U=(0,K.useCallback)(e=>{let t=rn(e,0,j.current),n=Pe(t,fe.current?.()??[]);return{offsets:n,peekOffset:Le(n,t)}},[]),xe=(0,K.useCallback)(()=>{let e=V.current;if(!e)return he.current;let t=e.style.height;if(t===``)return e.getBoundingClientRect().height;e.style.height=``;let n=e.getBoundingClientRect().height;return e.style.height=t,n},[]),W=(0,K.useCallback)(()=>{if(!de.current||B.current!=null||A.current!=null)return;let e=xe();if(e<=0)return;let{offsets:t,peekOffset:n}=U(e),r=Math.min(T.current,t.length-1),i=t[r],a=i===n?0:i,o=w.current;if(e===he.current&&Math.abs(i-P.current)<=.5&&Math.abs(a-o)<=.5)return;he.current=e,x(e),T.current=r,N(o,i,a,i,o,Kt(H.current),!1),le(a),p(i),L.current?.(rn(e,i,j.current));let s=t[t.length-1],c=rn(e,s,j.current);R.current?.(Re(i,t,s+c*Nt,n))},[xe,N,le,U]);(0,K.useEffect)(()=>{if(e&&typeof window<`u`)return window.addEventListener(`resize`,W),window.addEventListener(`orientationchange`,W),()=>{window.removeEventListener(`resize`,W),window.removeEventListener(`orientationchange`,W)}},[e,W]);let Ce=(0,K.useRef)(!1);(0,K.useLayoutEffect)(()=>{Ce.current?W():Ce.current=!0},[W,a]);let we=(0,K.useCallback)((e,t)=>{let n=V.current;if(n==null)return;let r=e-t;n.style.transform=r===0?``:`translateY(${r}px)`},[]),Te=(0,K.useCallback)((e,t)=>{let n=V.current;n!=null&&e>0&&!z.current&&(n.style.height=Ut(e,t));let r=H.current;r!=null&&(r.style.paddingBlockEnd=Wt(k.current)??``)},[]),G=(0,K.useCallback)(e=>{let t=B.current;if(t==null)return;B.current=null,e?.hasPointerCapture?.(t.pointerId)&&e.releasePointerCapture(t.pointerId),d(t.baseOffset),h(!1),b(!1),N(t.baseLayoutOffset,t.baseOffset,t.baseLayoutOffset,t.renderedOffset,t.layoutOffset,t.naturalEndGap,!0);let{offsets:n,peekOffset:r}=U(t.height),i=n[n.length-1],a=i+rn(t.height,i,j.current)*Nt;R.current?.(Re(t.baseOffset,n,a,r))},[N,U]);(0,K.useEffect)(()=>{if(!e)return;let t=()=>G(),n=()=>{document.visibilityState===`hidden`&&G()};return window.addEventListener(`blur`,t),document.addEventListener(`visibilitychange`,n),()=>{window.removeEventListener(`blur`,t),document.removeEventListener(`visibilitychange`,n)}},[G,e]);let Ee=(0,K.useCallback)((e,t,n,r,i,a,o,s,c,l,u)=>{let{offsets:d,peekOffset:f}=U(n),m=d[d.length-1],h=rn(n,m,j.current),g=m+h*Nt,ee=i>jt?e+t*At:e,v=e=>{let t=e===f?0:e;N(o,e,t,s,c,l,!0),le(t),T.current=Math.max(0,d.indexOf(e)),p(e),L.current?.(rn(n,e,j.current)),R.current?.(Re(e,d,g,f)),e!==a&&Bt()},y=e=>{I.current?(N(o,a,o,o,o,l,!1),me.current=Re(a,d,g,f),_({isTouch:u,pending:!0,exit:e}),pe.current()):v(m)};if(u){let{fastSpeed:r,minProjectionSpeed:o,projectionSeconds:s,detentTolerance:c}=kt.release,l=[...d,m+h],{index:u}=ke({points:l,position:e,velocity:t*1e3,flickThreshold:i>zt?r:1/0,tolerance:c,flickPastProjection:!0,projection:{seconds:s,minSpeed:o},start:a});u===l.length-1?y({distance:Math.max(0,n-e),velocity:t*1e3}):v(l[u])}else r>0&&ee>g?y(null):v(ze(Math.min(Math.max(ee,0),m),d,r,a))},[N,le,U]),De=(0,K.useCallback)((e,t,n)=>{let r=e.currentTarget,i=Ft(e);i||r.setPointerCapture?.(e.pointerId);let a=n??e.clientY,o=Kt(H.current),s=w.current;B.current={syntheticTouch:i,pointerType:e.pointerType,pointerId:e.pointerId,startCoord:a,lastCoord:e.clientY,lastTime:e.timeStamp,samples:[{t:e.timeStamp,y:e.clientY}],velocity:0,height:t,reserve:j.current,baseOffset:f,baseLayoutOffset:s,renderedOffset:f,layoutOffset:s,naturalEndGap:o,hasTraveled:!1},M(Ht(s,s,o)),d(f),h(!0)},[f,M]),Oe=(0,K.useCallback)(e=>{e.button===0&&e.isPrimary&&(e.preventDefault(),De(e,be()))},[De,be]),Ae=(0,K.useCallback)(e=>{B.current!=null&&(e.preventDefault(),G(e.currentTarget))},[G]),je=(0,K.useCallback)(e=>{B.current?.syntheticTouch||B.current?.pointerId===e.pointerId&&G()},[G]),Me=(0,K.useCallback)(e=>{let t=B.current;if(!t||t.pointerId!==e.pointerId||t.syntheticTouch&&!Ft(e))return;let n=e.clientY-t.startCoord;if(e.timeStamp-t.lastTime>0){for(t.lastCoord=e.clientY,t.lastTime=e.timeStamp,t.samples.push({t:e.timeStamp,y:e.clientY});t.samples.length>2&&e.timeStamp-t.samples[0].t>Mt;)t.samples.shift();let n=t.samples[0],r=Math.min(e.timeStamp-n.t,Mt);t.velocity=r>0?(e.clientY-n.y)/r:0}let{offsets:r,peekOffset:i}=U(t.height),a=t.baseOffset+n,o=r[r.length-1],s;s=a<0?t.pointerType===`touch`?Math.max(-t.reserve,Se(a,t.height-t.reserve,_e.rubberBand.coefficient)):Math.max(-48,a*Lt):a>o?a:Vt(a,r);let c=s<t.baseOffset?0:t.baseLayoutOffset,l=c!==t.layoutOffset;t.renderedOffset=s,t.layoutOffset=c,P.current=s,M(Ht(t.baseLayoutOffset,c,t.naturalEndGap)),we(s,c),l&&(Te(t.height,c),d(s)),!t.hasTraveled&&s!==t.baseOffset&&(t.hasTraveled=!0,b(!0),F.current?.());let u=r[r.length-1],f=u+rn(t.height,u,j.current)*Nt;R.current?.(Re(s,r,f,i))},[U,M,Te,we]),Ne=(0,K.useCallback)(e=>{let t=B.current;if(!t||t.pointerId!==e.pointerId||t.syntheticTouch&&!Ft(e))return;let n=e.currentTarget,r=e.clientY-t.startCoord,i=Math.max(0,t.baseOffset+r),a=r===0?0:r>0?1:-1,o=e.timeStamp-t.lastTime<Mt?t.velocity:0;B.current=null,t.syntheticTouch||n.releasePointerCapture?.(e.pointerId),h(!1),b(!1),Ee(i,o,t.height||1,a,Math.abs(r),t.baseOffset,t.baseLayoutOffset,t.renderedOffset,t.layoutOffset,t.naturalEndGap,t.pointerType===`touch`)},[Ee]),Fe=(0,K.useRef)(null),Ie=(0,K.useCallback)(e=>{if(e.button!==0||!e.isPrimary)return;let t=e.currentTarget;if(Jt(e.target,t)){Fe.current=null;return}let n=Yt(e.target,t);Qt(n)?Fe.current={pointerId:e.pointerId,startCoord:e.clientY,scrollers:n}:Fe.current=null},[]),Be=(0,K.useCallback)(e=>{if(B.current){Me(e);return}let t=Fe.current;if(!t||t.pointerId!==e.pointerId)return;let n=e.clientY-t.startCoord;n>zt&&Qt(t.scrollers)?(Fe.current=null,De(e,be(),t.startCoord),Me(e)):n<0&&(Fe.current=null)},[De,Me,be]),Ve=(0,K.useCallback)(e=>{Fe.current=null,!B.current?.syntheticTouch&&B.current&&Ne(e)},[Ne]),q=(0,K.useRef)(null),He=(0,K.useRef)(null),Ue=(0,K.useCallback)(e=>{nn(q.current),q.current=null,Fe.current=null,G(e)},[G]),We=(0,K.useRef)(De),Ge=(0,K.useRef)(G),Ke=(0,K.useRef)(Ue),qe=(0,K.useRef)(Me),Je=(0,K.useRef)(Ne),Ye=(0,K.useRef)(be);(0,K.useEffect)(()=>{We.current=De,Ge.current=G,Ke.current=Ue,qe.current=Me,Je.current=Ne,Ye.current=be});let Xe=(0,K.useCallback)(e=>{let t=(e,t)=>({syntheticTouch:!0,pointerId:e.identifier,pointerType:It(e),clientY:e.clientY,timeStamp:Date.now(),currentTarget:t,setPointerCapture:()=>{},releasePointerCapture:()=>{}}),n=e=>{let t=e.currentTarget;if(e.touches.length>1){Ke.current(t);return}let n=e.changedTouches[0];if(nn(q.current),!n||Jt(e.target,t)){q.current=null;return}let r=Yt(e.target,t),i=Qt(r),a=$t(r)&&(P.current>0||!en(r));q.current={id:n.identifier,startY:n.clientY,scrollers:r,top:i,bottom:a,contentEndY:null,promotedAtContentEnd:!1,releaseContentHold:null}},r=e=>{let n=e.currentTarget;if(e.touches.length>1){Ke.current(n);return}let r=q.current;if(B.current){let i=[...e.changedTouches].find(e=>e.identifier===B.current?.pointerId);if(!i)return;if(r?.promotedAtContentEnd&&r.contentEndY!=null){if(i.clientY>=r.contentEndY){r.contentEndY=null,r.promotedAtContentEnd=!1,nn(r),Ge.current(n);return}qe.current(t(i,n));return}e.preventDefault(),qe.current(t(i,n));return}if(!r)return;let i=[...e.changedTouches].find(e=>e.identifier===r.id);if(!i)return;let a=i.clientY-r.startY,o=r.top&&a>zt&&Qt(r.scrollers),s=r.bottom&&a<-8&&$t(r.scrollers);o||s?(e.preventDefault(),nn(r),q.current=null,We.current(t(i,n),Ye.current(),r.startY),qe.current(t(i,n))):((r.top&&a<0||r.bottom&&a>0)&&(r.top=!1,r.bottom=!1),$t(r.scrollers)?r.contentEndY==null?(r.contentEndY=i.clientY,r.releaseContentHold??=tn(r.scrollers)):r.contentEndY-i.clientY>=Rt&&(r.promotedAtContentEnd=!0,We.current(t(i,n),Ye.current(),r.contentEndY),qe.current(t(i,n))):(r.contentEndY=null,nn(r)))},i=e=>{nn(q.current),q.current=null;let n=B.current?.pointerId;if(n==null)return;let r=[...e.changedTouches].find(e=>e.identifier===n),i=e.currentTarget;r?Je.current(t(r,i)):e.touches.length===0&&Ge.current(i)},a=H.current;if(a&&He.current){let e=He.current;a.removeEventListener(`touchstart`,e.start),a.removeEventListener(`touchmove`,e.move),a.removeEventListener(`touchend`,e.end),a.removeEventListener(`touchcancel`,e.end)}H.current=e,e?(e.addEventListener(`touchstart`,n,{passive:!0}),e.addEventListener(`touchmove`,r,{passive:!1}),e.addEventListener(`touchend`,i,{passive:!0}),e.addEventListener(`touchcancel`,i,{passive:!0}),He.current={start:n,move:r,end:i}):He.current=null},[]),J=(0,K.useCallback)(e=>{if(k.current<=0)return;let t=Gt(e),n=Math.max(0,e.scrollHeight-e.clientHeight-t),r=Math.max(0,e.scrollTop-n);r<k.current-.5&&M(r)},[M]),Ze=(0,K.useCallback)(e=>{B.current==null&&A.current==null&&J(e.currentTarget)},[J]),Qe=(0,K.useCallback)(e=>{e.isPrimary?Oe(e):Ue(e.currentTarget)},[Oe,Ue]),$e=(0,K.useCallback)(e=>{e.isPrimary?Ie(e):Ue(e.currentTarget)},[Ie,Ue]),Y=(0,K.useCallback)(e=>{e.touches.length>1&&Ue(e.currentTarget)},[Ue]),et=(0,K.useCallback)(e=>{let t=B.current;t?.pointerId!==e.pointerId||t.syntheticTouch||G(e.currentTarget)},[G]),tt=m?u:f;return{sheetRef:ye,contentProps:(0,K.useMemo)(()=>({style:{transform:tt===0?void 0:`translateY(${tt}px)`,transition:e&&(m||se)?`none`:void 0,touchAction:`pinch-zoom`,overscrollBehavior:`contain`}}),[tt,m,e,se]),handleProps:(0,K.useMemo)(()=>({style:{touchAction:`pinch-zoom`,cursor:`grab`},onContextMenu:Ae,onLostPointerCapture:je,onPointerDown:Qe,onPointerMove:Me,onPointerUp:Ne,onPointerCancel:et,onTouchStart:Y,onTouchMove:Y}),[Ne,Ae,et,Qe,Y,je,Me]),bodyProps:(0,K.useMemo)(()=>({ref:Xe,onContextMenu:Ae,onLostPointerCapture:je,onPointerDown:$e,onPointerMove:Be,onPointerUp:Ve,onPointerCancel:Ve,onScroll:Ze}),[Xe,Ve,$e,Be,Ze,Ae,je]),bodyElementRef:H,dragOffset:u,settledOffset:f,isDragging:m,isTraveling:re,isDismissedByTouchDrag:te,dragExit:ne,activeOffsetRef:P,sheetHeight:ie,scrollPreservationInset:ae,settlingLayoutOffset:E,settledLayoutOffset:C,completeScrollAreaSettle:ue}}var X=r(),sn={hug:`92dvh`,capped:`62dvh`,tall:`92dvh`},cn=48,ln=.4;function un(e){return Math.max(cn,Math.ceil(e*ln))}var dn=48,fn=3,pn=50;o[`--spacing-6`];var mn=[`height`,`minHeight`,`maxHeight`,`blockSize`,`minBlockSize`,`maxBlockSize`];function hn(e){return Array.isArray(e)?e.some(hn):typeof e==`object`&&!!e}function gn(){return typeof Element<`u`&&typeof Element.prototype.animate==`function`}function _n(e,t){return he(e,ge.sheetDismissSwipe,{from:0,to:t.distance,velocity:t.velocity,epsilon:V.y})}function vn(e){let t=e.closest(`dialog`),n=e.ownerDocument;if(t==null||typeof n.getAnimations!=`function`)return;let r=n.getAnimations().filter(e=>{let n=e.effect;return n?.target===t&&e.transitionProperty===`opacity`&&Number(n.getKeyframes().at(-1)?.opacity)===0}),i=r.filter(e=>e.effect.pseudoElement===`::backdrop`);return(i.length>0?i:r.filter(e=>!e.effect.pseudoElement)).at(-1)}function yn(){return typeof window>`u`?0:window.innerHeight}function bn(e){return I(window,`resize`,e)}function xn(){return()=>{}}function Sn(e){let t=``;for(let n of e??[])t+=`${typeof n}:${n}|`;return t}var Cn={k4zj60:`x1ipgmjk`,$$css:!0},Z={sheet:{kfzvcC:`x67bb7w`,kB7OPa:`x9f619`,kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kAzted:`x2lwn1j`,kzqmXN:`xh8yej3`,ks0D6T:`x11gisft`,kWkggS:`x10xzikg`,kEafiO:`x11xkdxz`,kPef9Z:`x13fuv20`,kLZC3w:`x1pc3f07`,k2ei4v:`xgbv0en`,kVhnKS:`x1t7ytsu`,kGJrpR:`x1j92z86`,ke9TFa:`xw8tdv1`,k8ry5P:`x18b5jzi`,kBCPoo:`x1gejf6u`,krdFHd:`x81l70g`,kfmiAY:`x7hs6f1`,kGVxlE:`x1kcpxr7`,kI3sdo:`x1a2a7pz`,kVQacm:`xb3r6kr`,kGO01o:`x5559hn`,k1K539:`xgwt18o`,k3aq6I:`xnn1q72 xhbqy3z xspp5ug`,kSiTet:`x1hc1fzr x1igigxu xgo67oj`,k1ekBW:`xwcsmn1`,kIyJzY:`x80gvsz xzg1mie x1qzunnh`,kAMwcw:`xlr8y92`,k6sLGO:`x1q1rmc8`,$$css:!0},sheetSettled:{kIyJzY:`xpvlhck`,$$css:!0},sheetClosing:{k3aq6I:`x1weeur4 x1oe9tb1`,kSiTet:`x1m67veq`,kAMwcw:`x1j6inz x1s1rlkj`,$$css:!0},sheetClosingCrossFade:{k3aq6I:`xnn1q72`,kSiTet:`xg01cxk`,kIyJzY:`x8uwg2f`,$$css:!0},sheetFading:{kSiTet:`xg01cxk`,$$css:!0},sheetInactive:{kfzvcC:`x47corl`,$$css:!0},body:{kzQI83:`x1iyjqo2`,kAzted:`x2lwn1j`,kB7OPa:`x9f619`,kFalU9:`xge0x1e`,kInvED:`x1wfwxd8 x1nw7mhf`,kWkggS:`x10xzikg`,kGO01o:`x18d9i69`,$$css:!0},content:{k1xSpc:`xufnvkl`,kB7OPa:`x9f619`,kZKoxP:`x5yr21d`,kAzted:`x1lh6h5t`,$$css:!0},tallKeyboardBody:{kFlMNQ:`xrw9175`,$$css:!0},tallKeyboardContent:{k5JduY:`x1s928wv`,kc3QkE:`xhkezso`,k4zj60:`x1gmr53x`,kloYau:`x2q1x1w`,$$css:!0},keyboardInset:e=>[Cn,{"--x-nsbhg8":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}],budget:{kZKoxP:`x1fqcpoh`,$$css:!0},hugHeight:{kZKoxP:`xg7h5cd`,kskxy:`xkche18`,$$css:!0}};function wn(e,t){return e?t:{...t,ref:void 0}}function Tn(e){return e.kind===`open`?e.entering?`entering`:null:e.kind===`retained`?e.motion===`covered`?null:e.motion:e.kind===`exiting`?`exiting`:null}function En(e,t,n){if(e==null)return n(),()=>{};let r=!1,i=null,a=0,o=()=>{r||(r=!0,i!=null&&clearTimeout(i),e.removeEventListener(`transitionend`,s),e.removeEventListener(`transitioncancel`,s),n())},s=n=>{n.target===e&&n.propertyName===t&&(n.type===`transitioncancel`&&Dn(e,t)?i!=null&&(clearTimeout(i),i=setTimeout(o,a)):o())};e.addEventListener(`transitionend`,s),e.addEventListener(`transitioncancel`,s);let c=getComputedStyle(e);if(e.style.transition.trim()===`none`||c.transition.trim()===`none`)return o(),()=>{};let l=c.transitionProperty.split(`,`).map(e=>e.trim()),u=c.transitionDuration.split(`,`).map(On),d=c.transitionDelay.split(`,`).map(On),f=!1,p=l.reduce((e,n,r)=>{if(n!==t&&n!==`all`)return e;let i=u[r%u.length],a=d[r%d.length];return i==null||a==null?(f=!0,e):Math.max(e,i+a)},0);return f?()=>{e.removeEventListener(`transitionend`,s),e.removeEventListener(`transitioncancel`,s)}:p<=0?(o(),()=>{}):(a=p+pn,i=setTimeout(o,a),()=>{i!=null&&clearTimeout(i),e.removeEventListener(`transitionend`,s),e.removeEventListener(`transitioncancel`,s)})}function Dn(e,t){return(e.getAnimations?.()??[]).some(e=>e.transitionProperty===t&&(e.playState===`running`||e.playState===`paused`))}function On(e){let t=e.trim();if(!/^-?(?:\d+|\d*\.\d+)(?:ms|s)$/.test(t))return null;let n=Number.parseFloat(e);return t.endsWith(`ms`)?n:n*1e3}function kn({ref:e,state:t,isOpenRequested:n,height:r,label:o,children:s,padding:c,snapPoints:u,className:p,style:g,tabIndex:_,xstyle:ee,isEntrySettled:v=!1,onEntrySettled:y,onTransitionEnd:te,isSwipeDismissAllowed:ne=!0,isPageScrollLocked:re=!1,onDismiss:b,onScrimOpacity:ie,onScrimFadeDuration:x,onElementChange:S,handleRef:C,onMotionStart:oe,onMotionComplete:w,...T}){let E=(0,K.useRef)(null),D=(0,K.useRef)(null),se=(0,K.useRef)(t),O=(0,K.useRef)(!1),le=(0,K.useRef)(oe),M=(0,K.useRef)(w),ue=(0,K.useRef)(x),N=(0,K.useRef)(null),P=(0,K.useRef)(null),fe=t.kind===`open`&&t.entering,F=se.current,pe=F.kind===`open`&&F.entering;fe&&!pe?O.current=F.kind===`retained`:fe||(O.current=!1),(0,K.useLayoutEffect)(()=>{se.current=t,le.current=oe,M.current=w,ue.current=x},[w,oe,x,t]);let I=t.kind===`open`,L=t.kind!==`hidden`,z=t.kind===`retained`,me=z||t.kind===`exiting`,B=t.kind===`exiting`,he=z&&t.motion===`fading`,V=R(`(prefers-reduced-motion: reduce)`),_e=z&&!V?t.alignmentOffset:0,ve=Sn(u),ye=(0,K.useRef)(u);ye.current=u;let{snapHeights:Se,ignoredSnapPointsMessage:W}=(0,K.useMemo)(()=>{if(ve===``)return{snapHeights:void 0,ignoredSnapPointsMessage:``};let e=(ye.current??[]).filter(e=>!Me(e));return{snapHeights:()=>Ne(ye.current??[],yn()),ignoredSnapPointsMessage:e.length===0?``:`snapPoints ignored ${JSON.stringify(e)}. A snap point is a viewport fraction above 0 and up to 1 (0.5 is half the screen), a px length ('320px'), or a percentage ('50%').`}},[ve]);U(`BottomSheet`,W,W!==``);let Ce=g?.height,we=mn.some(e=>g?.[e]!=null)||hn(ee)||p!=null&&p!==``,Te=R(`(any-pointer: coarse)`),G=L&&Te&&!we,Ee=(0,K.useSyncExternalStore)(G?bn:xn,()=>G?yn():0,()=>0),De=Ee>0?un(Ee):cn,{contentProps:Oe,handleProps:ke,bodyProps:Ae,bodyElementRef:je,sheetRef:Pe,dragOffset:Fe,settledOffset:Ie,isDragging:Le,isDismissedByTouchDrag:Re,dragExit:ze,sheetHeight:Be,scrollPreservationInset:Ve,settlingLayoutOffset:q,settledLayoutOffset:He,completeScrollAreaSettle:Ue}=on({isOpen:I,isOpenRequested:n??I,canDismiss:ne,offscreenBlockEndInset:De,onDismiss:b,snapHeights:Se,onTravelStart:()=>{D.current?.(E.current??void 0)},onScrimOpacity:ie,hasFixedHeight:Ce!=null}),{getViewportProps:We,getContentProps:Ge}=be({axis:`both`,keyboardAccess:{owner:`contentOrViewport`,label:o},overscroll:`contain`,stickyContainment:`always`}),Ke=(0,K.useRef)(L),qe=(0,K.useCallback)(e=>{Pe(Ke.current?e:null),E.current=e,S?.(e)},[S,Pe]),Je=(0,K.useRef)(null);(0,K.useLayoutEffect)(()=>{if(Ke.current===L)return;Ke.current=L,Pe(L?E.current:null);let e=Je.current;!L&&e!=null&&(Je.current=null,H(e).set({y:0}))},[L,Pe]);let Ye=Ot(E,{move:`ride`,inset:!0,offset:dn,isEnabled:r===`tall`&&L,isExpanded:Ie===0,isOpen:I,isPageScrollLocked:re}),Xe=Ye.inset;D.current=Ye.dismiss,(0,K.useImperativeHandle)(e,()=>E.current,[]);let J=Tn(t),Ze=R(`(prefers-reduced-motion: reduce) and (pointer: coarse)`)||V&&Re,Qe=ze!=null&&!Ze&&!V&&gn()?ze:null;(0,K.useLayoutEffect)(()=>{let e=E.current;if(Qe!=null&&e!=null)return ue.current?.(e,_n(e,Qe)),()=>{ue.current?.(e,null)}},[Qe]),(0,K.useLayoutEffect)(()=>{if(J==null)return;N.current!==J&&(N.current=null),P.current=null;let e=()=>{N.current===J?M.current?.(J):P.current=J};if(J===`entering`&&O.current){e();return}let t=E.current;if(J===`exiting`&&Qe!=null&&t!=null){Je.current=t;let n=H(t).animate({y:Qe.distance},{spring:ge.sheetDismissSwipe,velocity:{y:Qe.velocity}}),r=!0,i=!1,a=null;return n.started.then(e=>{let n=i=>{if(a=null,!r)return;let o=vn(t);o==null?i>0&&(a=requestAnimationFrame(()=>n(i-1))):o.startTime=e};n(fn)}),n.finished.then(()=>{i=!0,ue.current?.(t,null),r&&e()}),()=>{r=!1,a!=null&&cancelAnimationFrame(a),i||n.retarget({y:0})}}let n=Ze&&J===`exiting`;return En(E.current,J===`fading`||n?`opacity`:`transform`,e)},[J,Ze,Qe]),(0,K.useLayoutEffect)(()=>{if(q!=null)return En(E.current,`transform`,Ue)},[Ue,q]),(0,K.useEffect)(()=>{if(J!=null)return le.current?.(J),N.current=J,P.current===J&&(P.current=null,M.current?.(J)),()=>{N.current===J&&(N.current=null),P.current===J&&(P.current=null)}},[J]);let $e=c==null,Y=c??4,et=A[Y],tt=typeof r==`string`&&r in sn?sn[r]:typeof r==`number`?`${r}px`:r,nt=Be>0,rt=Oe.style.transform,it;if(nt){let e=Le?Fe<Ie?0:He:q??He,t=(Le?Fe:Ie)-e;it=e>0||Le||q!=null?Ut(Be,e):void 0,rt=t===0?void 0:`translateY(${t}px)`}let at=_e>0?[rt,`translateY(${_e}px)`].filter(Boolean).join(` `):rt,ot=I?rt:z?at:void 0,st=g?.transform,ct=I||z||B?it:void 0,lt=Wt(Ve);(0,K.useLayoutEffect)(()=>{if(Le)return;let e=E.current;e!=null&&(st==null&&(ze==null||B&&Qe==null)&&(e.style.transform=ot??``),Ce??(e.style.height=ct??``));let t=je.current;t!=null&&(t.style.paddingBlockEnd=lt??``)});let ut={transition:Oe.style.transition,touchAction:Oe.style.touchAction,overscrollBehavior:Oe.style.overscrollBehavior,height:ct};return(0,X.jsxs)(`div`,{...T,ref:qe,tabIndex:_??-1,onTransitionEnd:e=>{te?.(e),v&&e.target===e.currentTarget&&y?.()},...d(i(`bottom-sheet`),a(ae.reset,m.reset,Z.sheet,h.reset,r===`hug`?Z.hugHeight:Z.budget,B&&Z.sheetClosing,B&&Ze&&Z.sheetClosingCrossFade,he&&Z.sheetFading,me&&Z.sheetInactive,v&&Z.sheetSettled,ee),p,{"--_sheet-budget":tt,"--_sheet-reserve":`${De}px`,...I?ut:z||B?{height:ct}:{},...g}),children:[(0,X.jsx)(`div`,{ref:C,className:`x10l6tqk x13vifvy x1o0tod xtijo5x x1vjfegm x78zum5 x6s0dn4 xl56j7k xvpftlf xafqdz2 x1so62im x1j4r261 x1jm3nie x16khyan x1cpjm7i x1oke5ut x34npju xmwhqxd x1hw15nc`,...ke,"aria-hidden":`true`}),(0,X.jsx)(`div`,{...wn(L,We({...Ae,...d(a(de.focusVisible,Z.body,r===`tall`&&Z.tallKeyboardBody),lt==null?{}:{style:{paddingBlockEnd:lt}})})),children:(0,X.jsx)(`div`,{...wn(L,Ge(a(Z.content,r===`tall`&&Z.tallKeyboardContent,r===`tall`&&Xe>0&&Z.keyboardInset(Xe),...xe($e?{useThemeDefault:`bottom-sheet`}:{paddingInnerX:et,paddingInnerY:et,paddingOuterX:et,paddingOuterY:et}),!$e&&Y!==4&&f[Y],!$e&&Y!==4&&k[Y],!$e&&Y!==4&&ce[Y],!$e&&Y!==4&&j[Y]))),children:(0,X.jsx)(l,{children:s})})})]})}kn.displayName=`BottomSheetPanel`;function An(){return(0,X.jsx)(`div`,{className:`xixxii4 x17y0mx6 x1ey2m1c x1kpxq89 x10xzikg xhtitgo x47corl x1cb67k9 xt2iwb0`,"data-sheet-edge-tint":``,"aria-hidden":`true`})}var jn=(0,K.createContext)(null);jn.displayName=`BottomSheetHostContext`;var Mn={isOpen:!0},Nn={isOpen:!1},Pn={isStacked:!1,isTop:!1,isCovered:!1,depth:0,ownsScrim:!1,isScrimHandoff:!1,isBlocked:!1,isScrimTakenOver:!1,replacedMotion:null,alignmentOffset:0,isReplacing:!1},Fn=1,In=8,Ln=Symbol.for(`astryx.bottomSheetStack.v${In}`),Rn=In;function zn(){return{shape:Rn,entries:[],shownOrder:new WeakMap,listenedDocuments:new WeakMap,batchOpened:[],batchClosed:[],batchActor:null,batchPair:null,lastPress:new WeakMap,pendingDrops:[],pendingReplaceFocus:null,closingTogether:new Map,rankByKey:new WeakMap,currentBatch:0,nextSeq:0,isBatchDirty:!1,isSealScheduled:!1,focusToKeep:new WeakMap,deferredTopLayer:new WeakMap}}function Bn(){let e=globalThis,t=e[Ln];if(t!=null)return t.shape===Rn?t:zn();let n=zn();return e[Ln]=n,n}var Q=Bn();function Vn(){return Q.isBatchDirty=!0,Hn(),{batch:Q.currentBatch,seq:Q.nextSeq++}}function Hn(){Q.isSealScheduled||typeof queueMicrotask!=`function`||(Q.isSealScheduled=!0,queueMicrotask(()=>{Q.isSealScheduled=!1,Un()}))}function Un(){Lr(),Wn(),Q.isBatchDirty&&=(Q.currentBatch+=1,!1),Q.batchOpened=[],Q.batchClosed=[],Q.batchActor=null,Q.batchPair=null}function Wn(){if(Q.batchOpened.length>0)return;let e=Q.batchClosed.filter(e=>e.isModal&&e.replace==null&&e.replacing==null);if(e.length<2)return;let t=new Map;for(let n of e){let e=t.get(n.doc)??[];e.push(n),t.set(n.doc,e)}for(let[e,n]of t){if(n.length<2)continue;let t=nr(e,!0);if(t.some(e=>e.isOpen))continue;let r=t.filter(e=>n.includes(e)),i=r[0],a={members:r,pending:new Set(r),returnTarget:i.getReturnTarget?.()??null};for(let e of r)Q.closingTogether.set(e,a)}}function Gn(e){let t=Q.entries.find(t=>t.key===e);return t!=null&&Q.closingTogether.has(t)}function Kn(e){if(e.pending.size>0||e.reported)return;e.reported=!0;let t=e.returnTarget;t!=null&&t.isConnected&&N(t)}function qn(e){let t=Q.entries.find(t=>t.key===e),n=t==null?void 0:Q.closingTogether.get(t);t!=null&&n!=null&&Jn(t,n)}function Jn(e,t){Q.closingTogether.delete(e),t.pending.delete(e),Kn(t)}function Yn(e){if(Q.listenedDocuments.has(e))return;let t=t=>{t.target instanceof Element&&Q.lastPress.set(e,{target:new WeakRef(t.target),at:Date.now()})};e.addEventListener(`pointerdown`,t,!0),e.addEventListener(`click`,t,!0),e.addEventListener(`keydown`,t,!0),Q.listenedDocuments.set(e,()=>{e.removeEventListener(`pointerdown`,t,!0),e.removeEventListener(`click`,t,!0),e.removeEventListener(`keydown`,t,!0),Q.lastPress.delete(e)})}function Xn(e){if(Q.entries.some(t=>t.doc===e))return;let t=Q.listenedDocuments.get(e);t!=null&&(Q.listenedDocuments.delete(e),t())}var Zn=1e3;function Qn(e,t){let n=Q.lastPress.get(e),r=n?.target.deref();return n!=null&&r!=null&&r.isConnected&&Date.now()-n.at<=Zn&&!$n(r,t)?r:e.activeElement}function $n(e,t){let n=Q.entries.find(n=>{let r=n.getElement();return n.doc===t.doc&&r!=null&&r.contains(e)});return n==null||n===t?!1:!n.isOpen||n.replace!=null}function er(e,t){Q.batchOpened.length===0&&Q.batchClosed.length===0&&(Q.batchActor=Qn(e.doc,e)),(t===`opened`?Q.batchOpened:Q.batchClosed).push(e)}function tr(e,t){if(e.rank.batch!==t.rank.batch)return e.rank.batch-t.rank.batch;let n=e.getTreeAnchor?.()??e.getElement(),r=t.getTreeAnchor?.()??t.getElement();if(n!=null&&r!=null&&n!==r){let e=n.compareDocumentPosition(r);if(e&Node.DOCUMENT_POSITION_FOLLOWING)return-1;if(e&Node.DOCUMENT_POSITION_PRECEDING)return 1}return e.rank.seq-t.rank.seq}function nr(e,t){return Q.entries.filter(n=>n.doc===e&&n.isModal===t).sort(tr)}function rr(e){return nr(e.doc,e.isModal)}function ir(e,t){let n=Q.shownOrder.get(e);return n==null?[]:t?n.modal:n.nonModal}function ar(e,t,n){let r=Q.shownOrder.get(e)??{modal:[],nonModal:[]};t?r.modal=n:r.nonModal=n,Q.shownOrder.set(e,r)}function or(e,t){return e.isStacked===t.isStacked&&e.isTop===t.isTop&&e.isCovered===t.isCovered&&e.depth===t.depth&&e.ownsScrim===t.ownsScrim&&e.isScrimHandoff===t.isScrimHandoff&&e.isBlocked===t.isBlocked&&e.isScrimTakenOver===t.isScrimTakenOver&&e.replacedMotion===t.replacedMotion&&e.alignmentOffset===t.alignmentOffset&&e.isReplacing===t.isReplacing}function sr(e,t){let n=[];if(!t){for(let t of e){let e={...Pn,replacedMotion:t.replace?.motion??null,alignmentOffset:t.replace?.alignmentOffset??0,isReplacing:t.replacing!=null};or(t.view,e)||(t.view=e,n.push(t))}for(let e of n)e.onView(e.view);return}let r=e.filter(e=>e.isOpen),i=r[r.length-1]??null,a=e.find(e=>e.isOpen||e.replace!=null)??null;e.forEach((t,r)=>{let o=0;for(let n=r+1;n<e.length;n+=1)e[n].isOpen&&e[n]!==t.replace?.replacer&&(o+=1);let s=t.isOpen&&o>0,c=t.getElement(),l=c!=null&&e.some(e=>{let n=e.getElement();return e!==t&&n!=null&&c.contains(n)}),u=t===a,d=u&&t.isOpen&&e.slice(0,r).some(e=>!e.isOpen),f={isStacked:e.length>1,isTop:t===i,isCovered:s,depth:o,ownsScrim:u,isScrimHandoff:d,isBlocked:s&&!l,isScrimTakenOver:!t.isOpen&&a!=null&&a!==t,replacedMotion:t.replace?.motion??null,alignmentOffset:t.replace?.alignmentOffset??0,isReplacing:t.replacing!=null};or(t.view,f)||(t.view=f,n.push(t))});for(let e of n)e.onView(e.view)}function cr(e){let t=e.ownerDocument,n=t.activeElement;if(n instanceof HTMLElement&&n!==t.body){let r=n.closest(`dialog`);r!=null&&r!==e&&!r.contains(e)&&!e.contains(r)&&fr(r)&&Q.focusToKeep.set(t,n),n.blur()}e.showModal()}function lr(e){e.style.setProperty(`--_sheet-scrim-duration`,`0s`),e.style.setProperty(`--_sheet-scrim-opacity`,`0`),cr(e),typeof getComputedStyle==`function`&&getComputedStyle(e,`::backdrop`).opacity,e.style.removeProperty(`--_sheet-scrim-duration`)}function ur(e,t,n){e!=null&&(!e.open||e.style.getPropertyValue(`--_sheet-scrim-opacity`)===t?e.style.setProperty(`--_sheet-scrim-opacity`,t):(e.style.setProperty(`--_sheet-scrim-duration`,`0s`),e.style.setProperty(`--_sheet-scrim-opacity`,t),dr(n),n.frame=requestAnimationFrame(()=>{n.frame=requestAnimationFrame(()=>{n.frame=null,e.style.removeProperty(`--_sheet-scrim-duration`)})})))}function dr(e){e.frame!=null&&(cancelAnimationFrame(e.frame),e.frame=null)}function fr(e){if(e==null)return!1;if(e.open)return!0;try{return e.matches(`:popover-open`)}catch{return!1}}function pr(e){let t=[];for(let n of Array.from(e.ownerDocument.querySelectorAll(`dialog[open]`)))n===e||n.contains(e)||n.hasAttribute(`inert`)||n.getAttribute(`aria-hidden`)===`true`||Q.entries.some(e=>!e.isOpen&&e.getElement()===n)||vr(n)&&t.push(n);return t}function mr(e,t,n){let r=e.ownerDocument,i=Q.deferredTopLayer.get(r);if(i??(i={deferred:new Map,blockers:new WeakSet,removals:null,stopListeningForClose:null},Q.deferredTopLayer.set(r,i)),i.stopListeningForClose==null){let e=()=>{gr(r)};r.addEventListener(`close`,e,!0),i.stopListeningForClose=()=>{r.removeEventListener(`close`,e,!0)}}i.deferred.set(e,t);for(let e of n)i.blockers.add(e);if(i.removals==null&&typeof MutationObserver==`function`){let{blockers:e}=i,t=new MutationObserver(t=>{t.some(t=>hr(t,e))&&gr(r)});t.observe(r,{childList:!0,subtree:!0}),i.removals=t}}function hr(e,t){for(let n of Array.from(e.removedNodes))if(n instanceof Element&&(n instanceof HTMLDialogElement?[n]:Array.from(n.querySelectorAll(`dialog`))).some(e=>t.has(e)))return!0;return!1}function gr(e){let t=Q.deferredTopLayer.get(e);if(t==null||t.deferred.size===0)return;let{deferred:n}=t;for(let[r,i]of Array.from(n)){if(!r.isConnected||!r.open){n.delete(r);continue}let a=pr(r);if(a.length>0){for(let e of a)t.blockers.add(e);continue}n.delete(r);let o=e.activeElement;r.close(),yr(r,i),e.activeElement!==o&&o instanceof HTMLElement&&o.isConnected&&o.focus({preventScroll:!0})}n.size===0&&_r(t)}function _r(e){e.removals?.disconnect(),e.removals=null,e.stopListeningForClose?.(),e.stopListeningForClose=null}function vr(e){try{if(e.matches(`:modal`))return!0}catch{}return e.getAttribute(`aria-modal`)===`true`}function yr(e,t){if(typeof e.showPopover!=`function`){e.show();return}let n=pr(e);if(n.length>0){e.show(),mr(e,t,n);return}let r=e.ownerDocument,i=t?.hasAttribute(`autofocus`)??!1;t!=null&&!i&&t.setAttribute(`autofocus`,``);try{e.showPopover()}finally{t!=null&&!i&&t.removeAttribute(`autofocus`)}Te(),t!=null&&r.activeElement===t&&!Sr(e)&&br(t)?.focus({preventScroll:!0})}function br(e){let t=e.querySelectorAll(`a[href], area[href], button, input, select, textarea, iframe, summary, [contenteditable]:not([contenteditable="false"]), [tabindex]`);for(let n of Array.from(t))if(!(n===e||n.tabIndex<0)&&!(n.disabled===!0||n.closest(`[inert]`)!=null||n.getAttribute(`type`)===`hidden`||n.hidden||typeof n.checkVisibility==`function`&&!n.checkVisibility()))return n;return null}var xr=null;function Sr(e){if(xr!=null)return xr;let t=e.ownerDocument,n=t.activeElement,r=t.createElement(`dialog`);r.setAttribute(`aria-hidden`,`true`),r.style.cssText=`position:fixed;inset:auto;opacity:0;pointer-events:none`;let i=t.createElement(`div`);i.tabIndex=-1;let a=t.createElement(`button`);a.type=`button`,i.appendChild(a),r.appendChild(i),e.appendChild(r);try{r.show(),xr=t.activeElement===i,r.close()}catch{xr=!0}finally{r.remove(),t.activeElement!==n&&n instanceof HTMLElement&&n.isConnected&&n.focus({preventScroll:!0})}return xr}function Cr(e){let t=Q.deferredTopLayer.get(e.ownerDocument);if(t!=null&&t.deferred.delete(e)&&t.deferred.size===0&&_r(t),e.hasAttribute(`popover`)&&typeof e.hidePopover==`function`)try{e.hidePopover()}catch{}e.open&&e.close()}function wr(e){if(e==null||!fr(e))return;let t=e.ownerDocument,n=t.activeElement;Cr(e),t.activeElement!==n&&n instanceof HTMLElement&&n.isConnected&&n.focus({preventScroll:!0})}function Tr(){if(Q.batchOpened.length!==1||Q.batchClosed.length!==1){Er();return}let[e]=Q.batchOpened,[t]=Q.batchClosed;if(Q.batchPair!=null&&Q.batchPair.replaced===t||t===e||t.replaceable==null||e.replaceable==null||t.doc!==e.doc||t.isModal!==e.isModal||t.replace?.replacer===e||!e.isOpen||t.isOpen)return;let n=t.getElement(),r=e.getElement();if(n==null||r==null||n.contains(r)||r.contains(n)||rr(t).some(n=>n!==e&&n!==t&&n.isOpen&&tr(n,t)>0))return;let i=Q.batchActor;(i==null||i===t.doc.body||n.contains(i))&&(t.replacing!=null&&t.replacing!==e&&Or(t.replacing),t.replace!=null&&(t.replace.replacer.replacing=null),e.replace!=null&&(e.replace=null),t.replace={replacer:e,motion:`covered`,alignmentOffset:0,isAlignmentComplete:!1,isEnteringComplete:!1},e.replacing=t,Q.batchPair={replaced:t,replacer:e,replacerOpener:e.replaceable.getOpener()},Q.lastPress.delete(e.doc),e.replaceable.setOpener(t.replaceable.getOpener()),Q.pendingReplaceFocus=e)}function Er(){let e=Q.batchPair;if(e==null)return;Q.batchPair=null;let{replaced:t,replacer:n,replacerOpener:r}=e;t.replace?.replacer===n&&(t.replace=null),n.replacing===t&&(n.replacing=null),n.replaceable?.setOpener(r),Q.pendingReplaceFocus===n&&(Q.pendingReplaceFocus=null)}function Dr(){let e=Q.pendingReplaceFocus;if(e==null)return;let t=e.getElement();t!=null&&fr(t)&&(Q.pendingReplaceFocus=null,e.focus(`replace`))}function Or(e){let t=e.replace;if(t==null)return;let{replacer:n}=t;e.replace=null,n.replacing===e&&(n.replacing=null),e.hide(),e.replaceable?.finish()}function kr(e){let t=e.getBoundingClientRect().top,n=e.ownerDocument.defaultView;if(n==null||typeof n.DOMMatrixReadOnly!=`function`)return t;let{transform:r}=n.getComputedStyle(e);return r===``||r===`none`?t:t-new n.DOMMatrixReadOnly(r).m42}function Ar(e,t){return e==null||t==null?0:Math.max(0,kr(e)-t.getBoundingClientRect().top)}function jr(e,t,n){let r=Q.entries.find(t=>t.key===e);if(r==null)return;if(n===`entering`){let e=r.replacing,n=e?.replace??null;if(e==null||n==null||n.replacer!==r)return;if(t===`start`){if(n.motion!==`covered`)return;let t=Ar(r.replaceable?.getPanel()??null,e.replaceable?.getPanel()??null);if(t>Fn&&(n.motion=`aligning`,n.alignmentOffset=t,n.isAlignmentComplete=!1),r.isEnteringInPlace)r.isEnteringInPlace=!1,n.isEnteringComplete=!0,n.motion!==`aligning`&&(n.motion=`fading`);else if(n.motion===`covered`)return}else{if(n.isEnteringComplete=!0,n.motion===`aligning`&&!n.isAlignmentComplete)return;n.motion=`fading`}Pr(r.doc,r.isModal);return}let i=r.replace;i!=null&&t===`complete`&&(n===`aligning`&&i.motion===`aligning`?(i.isEnteringComplete?i.motion=`fading`:i.isAlignmentComplete=!0,Pr(r.doc,r.isModal)):n===`fading`&&i.motion===`fading`&&(Or(r),Pr(r.doc,r.isModal)))}function Mr(e,t,n){let r=ir(e,t),i=n.filter(e=>{let t=e.getElement();return t!=null&&t.isConnected}),a=0,o=0;for(;a<i.length;){let e=r.indexOf(i[a],o);if(e===-1)break;o=e+1,a+=1}let s=new Set(i.slice(0,a)),c=i.slice(a),l=Nr(e,c),u=!1;for(let e=r.length-1;e>=0;--e)s.has(r[e])||r[e].hide();for(let e of c){let t=l!=null&&e.getElement()?.contains(l)?l:null,n=t?.hasAttribute(`autofocus`)??!1;t!=null&&!n&&t.setAttribute(`autofocus`,``),e.show(),t!=null&&!n&&t.removeAttribute(`autofocus`),u=!0}if(ar(e,t,i),!u)return;if(c.some(e=>r.includes(e))&&Te(),l!=null&&l.isConnected){e.activeElement!==l&&l.focus({preventScroll:!0});return}let d=i.filter(e=>e.isOpen);d[d.length-1]?.focus(`open`)}function Nr(e,t){let n=Q.focusToKeep.get(e);Q.focusToKeep.delete(e);let r=e.activeElement,i=n!=null&&n.isConnected?n:r instanceof HTMLElement&&r!==e.body?r:null;if(i==null)return null;for(let e of t){let t=e.getElement();if(e.isOpen&&t!=null&&t.contains(i))return i}return null}function Pr(e,t){Tr(),Q.batchOpened.length>0&&Q.batchClosed.length>0&&Lr();let n=nr(e,t);sr(n,t),Mr(e,t,n),Q.focusToKeep.delete(e),Dr(),gr(e)}function Fr(e,t,n=!0){let{key:r}=e,i=Q.rankByKey.get(r),a;i!=null&&!i.isClosed&&(i.detachedBatch==null||i.detachedBatch===Q.currentBatch)?(a={batch:i.batch,seq:i.seq},i.detachedBatch=null):(a=Vn(),Q.rankByKey.set(r,{...a,isClosed:!t,detachedBatch:null}));let o=e.getElement()?.ownerDocument??document;Yn(o);let s={...e,rank:a,isOpen:t,doc:o,isModal:n,view:Pn,replace:null,replacing:null,isEnteringInPlace:!1};return Q.entries.push(s),t&&a.batch===Q.currentBatch&&Q.isBatchDirty&&er(s,`opened`),Pr(s.doc,s.isModal),()=>{let e=Q.entries.indexOf(s);if(e===-1)return;Q.entries.splice(e,1),Xn(s.doc),ar(s.doc,s.isModal,ir(s.doc,s.isModal).filter(e=>e!==s)),Q.batchOpened=Q.batchOpened.filter(e=>e!==s),Q.batchClosed=Q.batchClosed.filter(e=>e!==s),Q.pendingDrops=Q.pendingDrops.filter(e=>e!==s),Q.pendingReplaceFocus===s&&(Q.pendingReplaceFocus=null),(Q.batchPair?.replaced===s||Q.batchPair?.replacer===s)&&(Q.batchPair=null);let t=Q.closingTogether.get(s);s.replace!=null&&(s.replace.replacer.replacing=null,s.replace=null),s.replacing!=null&&(s.replacing.replace=null,s.replacing=null),s.hide(),t!=null&&Jn(s,t);let n=Q.rankByKey.get(r);n!=null&&(n.detachedBatch=Q.currentBatch,Q.isBatchDirty=!0,Hn()),s.view=Pn,s.onView(s.view),Pr(s.doc,s.isModal)}}function Ir(e,t){let n=Q.entries.find(t=>t.key===e);if(n==null||n.isOpen===t)return;n.isOpen=t;let r=Q.rankByKey.get(e);if(t){if(Q.closingTogether.has(n)){let e=Q.closingTogether.get(n);Q.closingTogether.delete(n),e?.pending.delete(n)}n.rank=Vn(),Q.rankByKey.set(e,{...n.rank,isClosed:!1,detachedBatch:null}),er(n,`opened`),n.replace!=null&&(n.replace.replacer.replacing=null,n.replace=null,n.isEnteringInPlace=!0)}else r!=null&&(r.isClosed=!0),Q.isBatchDirty=!0,Hn(),er(n,`closed`),n.isEnteringInPlace=!1,n.replacing!=null&&Q.pendingDrops.push(n.replacing);Pr(n.doc,n.isModal)}function Lr(){if(Q.pendingDrops.length===0)return;let e=Q.pendingDrops;Q.pendingDrops=[];for(let t of e){let e=t.replace?.replacer;e!=null&&!e.isOpen&&Or(t)}}function Rr(e){let t=Q.entries.find(t=>t.key===e);if(t==null)return null;let n=rr(t);for(let e=n.indexOf(t)-1;e>=0;--e){let t=n[e],r=t.getElement();if(t.isOpen&&r!=null)return{element:r,focus:()=>t.focus(`reveal`)}}return null}function zr(e){let t=e.closest(`dialog`);for(let n of e.querySelectorAll(`[data-autofocus]`))if(!(n.closest(`dialog`)!==t||n.closest(`[inert]`)!=null||typeof n.checkVisibility==`function`&&!n.checkVisibility())&&(n.focus({preventScroll:!0}),n.ownerDocument.activeElement===n))return!0;return!1}function Br(e,t,n){if(e==null)return;let r=e.closest(`dialog`);if(r!=null&&(r.hasAttribute(`inert`)||r.getAttribute(`aria-hidden`)===`true`))return;let i=e.ownerDocument.activeElement,a=i!=null&&e.contains(i)&&i.closest(`dialog`)===e.closest(`dialog`);a&&(t===`reveal`||t===`replace`&&i!==e)||(t===`reveal`?P(e):a&&i?.hasAttribute(`data-autofocus`)===!0||zr(e)||!a&&(n||t===`replace`)&&e.focus({preventScroll:!0}))}var Vr=(0,K.createContext)(null);Vr.displayName=`BottomSheetSwitcherContext`;var Hr=e({BottomSheet:()=>$r}),$={dialog:{kVAEAm:`xixxii4`,kpwlN0:`x10a8y8t`,kzqmXN:`x1o6l61p`,kZKoxP:`xtdtrs8`,ks0D6T:`x1x1rfll`,kskxy:`x7ab17h`,kogj98:`x1ghz6dp`,kmVPX3:`x1717udv`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kWkggS:`xjbqb8w`,kVQacm:`x1rea2x4`,k1xSpc:`x1s85apg`,kI3sdo:`x1a2a7pz`,$$css:!0},dialogOpen:{k1xSpc:`x1lliihq`,$$css:!0},dialogPanelHost:{k1xSpc:`x78zum5`,kjj79g:`xl56j7k`,kGNEyG:`xuk3077`,$$css:!0},dialogNonModal:{kfzvcC:`x47corl`,kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,$$css:!0},dialogNonModalItem:{kfzvcC:`x47corl`,kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,$$css:!0},dialogNonModalItemTop:{kY2c9j:`x1vjfegm`,$$css:!0},scrim:{kGyWv1:`xnixb3f`,k5sjJv:`xni466t xxiuuzi`,kND0Po:`xc0dz0a`,k9an0g:`x10buo38`,kb4ib:`x15h3t91`,kwHxkk:`x142juwg`,k4oj2o:`x15l12jy`,$$css:!0},scrimSettled:{k9an0g:`x108qnu8`,$$css:!0},scrimClosing:{kb4ib:`x1cz9k3x`,$$css:!0},exitHoldingFocus:{kfzvcC:`x47corl`,$$css:!0},positioner:{kVAEAm:`x10l6tqk`,kkqhue:`x17y0mx6`,krVfgx:`x1ey2m1c`,k1xSpc:`x78zum5`,kjj79g:`xl56j7k`,kfzvcC:`x47corl`,$$css:!0},positionerHidden:{k1xSpc:`x1s85apg`,$$css:!0},positionerTop:{kY2c9j:`x1vjfegm`,$$css:!0},positionerStackMotion:{k3nNDw:`x1fpg8nb`,k1ekBW:`x11xpdln`,kIyJzY:`x80gvsz`,kAMwcw:`xlr8y92`,k6CgDc:`xzg1mie`,$$css:!0},positionerReceded1:{k3aq6I:`xfkfg1k`,$$css:!0},positionerReceded2:{k3aq6I:`xdo3dbm`,$$css:!0}};function Ur(e){return[e.isStacked&&$.positionerStackMotion,e.depth===1&&$.positionerReceded1,e.depth>=2&&$.positionerReceded2]}function Wr(e){e.preventDefault(),e.stopPropagation()}function Gr(e){e.key!==`Tab`&&(e.preventDefault(),e.stopPropagation())}function Kr(e,t){if(e.isStacked)return t?e.isTop?`top`:`covered`:e.replacedMotion==null?`exiting`:`replaced`}function qr(e){return e.isStacked&&!e.ownsScrim?`0`:`1`}function Jr(e,t,n){if(e==null)return;let r=e.style.getPropertyValue(`--_sheet-scrim-duration`);t==null?(n.current!=null&&r===n.current&&e.style.removeProperty(`--_sheet-scrim-duration`),n.current=null):r!==`0s`&&(n.current=`${t}ms`,e.style.setProperty(`--_sheet-scrim-duration`,n.current))}function Yr(e,t){switch(e){case`active`:return{kind:`open`,entering:!1};case`entering`:return{kind:`open`,entering:!0};case`covered`:case`aligning`:case`fading`:return{kind:`retained`,motion:e,alignmentOffset:t};case`exiting`:return{kind:`exiting`};case`hidden`:return{kind:`hidden`}}}function Xr(e,t){Br(e,`open`,t)}function Zr({ref:e,isOpen:t,onOpenChange:n,label:r,children:i,height:o=`capped`,snapPoints:s,hasScrim:c=!0,finalFocusRef:l,purpose:d=`info`,xstyle:f,...m}){let h=(0,K.useRef)(null),g=(0,K.useRef)(null),v=(0,K.useRef)(null),y=(0,K.useRef)(!1),te=(0,K.useRef)(l);te.current=l;let ne=(0,K.use)(jn)?.isOpen??!0,re=z(),b=t&&ne&&!re,[ie,x]=Ce(t,b,!1),ae=ie&&b;p(h,b&&c);let[S,C]=(0,K.useState)(b);b&&!S&&C(!0);let w=b||S,T=(0,K.useRef)({}),[D,se]=(0,K.useState)(Pn),O=(0,K.useRef)(b);O.current=b;let k=!b&&S&&D.replacedMotion!=null,[A,ce]=(0,K.useState)(!1),[j,M]=(0,K.useState)(!1),[P,de]=(0,K.useState)(b);P!==b&&(de(b),ce(!1),M(!1));let fe=b?{kind:`open`,entering:D.isReplacing}:k?{kind:`retained`,motion:D.replacedMotion??`covered`,alignmentOffset:D.alignmentOffset}:S?A?{kind:`exiting`}:{kind:`open`,entering:!1}:{kind:`hidden`},F=(0,K.use)(G),pe=(0,K.useCallback)(()=>{b&&d!==`required`&&F&&n(!1)},[F,b,n,d]),I=(0,K.useCallback)(()=>{d===`info`&&n(!1)},[n,d]),L=(0,K.useCallback)(e=>{g.current=e},[]),R=(0,K.useRef)(D);R.current=D;let he=(0,K.useRef)({frame:null});(0,K.useEffect)(()=>()=>dr(he.current),[]);let V=(0,K.useCallback)(e=>ur(h.current,e,he.current),[]),H=(0,K.useCallback)(e=>{let t=R.current;(!t.isStacked||t.ownsScrim)&&h.current?.style.setProperty(`--_sheet-scrim-opacity`,String(e))},[]),ge=(0,K.useRef)(null),_e=(0,K.useCallback)((e,t)=>{let n=R.current;(!n.isStacked||n.ownsScrim)&&Jr(e.closest(`dialog`),t,ge)},[]);(0,K.useLayoutEffect)(()=>{if(!w)return;let e=T.current,t=h.current,n=t==null?null:ue(t,{keepRestingFocus:!0}),r=Fr({key:e,getElement:()=>h.current,show:()=>{let e=h.current;e==null||fr(e)||(v.current??=document.activeElement,c?(e.style.setProperty(`--_sheet-scrim-opacity`,qr(R.current)),e.showModal()):yr(e,g.current))},hide:()=>wr(h.current),focus:e=>Br(g.current,e,c),getReturnTarget:()=>te.current?.current??v.current,onView:e=>{R.current=e,se(e),O.current||e.replacedMotion!=null?V(qr(e)):e.isScrimTakenOver&&V(`0`)},replaceable:{getPanel:()=>g.current,getOpener:()=>v.current,setOpener:e=>{v.current=e},finish:()=>{v.current=null,C(!1)}}},O.current,c);return()=>{if(n!=null&&fr(t)){let t=te.current?.current??v.current,r=c?Rr(e):null;n(()=>{(r==null||r.element.isConnected)&&(r!=null&&(t==null||!r.element.contains(t))?r.focus():t!=null&&t.isConnected&&N(t))})}r()}},[c,w,V]),(0,K.useLayoutEffect)(()=>{if(!b){let e=h.current;y.current=e!=null&&e.contains(e.ownerDocument.activeElement)}w&&Ir(T.current,b),b||(ce(!0),M(y.current))},[c,b,w]);let ve=we(h,b&&c,D.isTop,`bottom-sheet`);(0,K.useEffect)(()=>{Un()}),(0,K.useLayoutEffect)(()=>{let e=h.current;e!=null&&c&&(b||k?e.style.setProperty(`--_sheet-scrim-opacity`,qr(R.current)):S&&e.style.setProperty(`--_sheet-scrim-opacity`,`0`))},[c,b,S,k]);let ye=(0,K.useCallback)(e=>{jr(T.current,`start`,e)},[]),be=(0,K.useCallback)(e=>{if(jr(T.current,`complete`,e),e!==`exiting`||b)return;if(c&&R.current.depth>0){wr(h.current),C(!1),v.current=null;return}if(c&&Gn(T.current)){wr(h.current),C(!1),v.current=null,qn(T.current);return}let t=h.current;t!=null&&Cr(t),C(!1);let n=c?Rr(T.current):null,r=l?.current??(c||y.current?v.current:null);n!=null&&(r==null||!n.element.contains(r))?n.focus():r!=null&&N(r),v.current=null},[l,c,b]),{ref:xe}=_(),Se=!b&&S&&!k&&j,W=(0,K.useCallback)(e=>{if(e==null||!Se)return;let t=()=>{e.contains(e.ownerDocument.activeElement)||M(!1)},n=()=>queueMicrotask(t);e.addEventListener(`focusout`,n);let r=le(e,{childList:!0,subtree:!0,attributeFilter:[`disabled`,`hidden`,`inert`]},t);return()=>{e.removeEventListener(`focusout`,n),r()}},[Se]),Te=u(h,xe,W);B(w&&c),U(`BottomSheet`,"requires a non-empty `label` for an accessible name; the open sheet has no built-in heading to derive one from.",b&&!r);let{shouldDismissOnCloseRequest:Ee}=E({isActive:w,escapeBehavior:b&&d!==`required`&&F?`close`:`block`,onDismiss:pe,getContainer:()=>h.current,isPresent:()=>fr(h.current)&&!R.current.isCovered&&R.current.replacedMotion==null}),De=(0,K.useCallback)(e=>{e.target===e.currentTarget&&(e.preventDefault(),Ee()&&pe())},[pe,Ee]),Oe=(0,K.useCallback)(e=>{c&&e.target===e.currentTarget&&I()},[I,c]),ke=!b&&S,Ae=ke&&!k&&(!A||j),je=ke&&!Ae||D.isBlocked;return(0,X.jsxs)(`dialog`,{...a($.dialog,w&&$.dialogOpen,w&&$.dialogPanelHost,...Ur(D),c&&$.scrim,c&&ae&&$.scrimSettled,c&&ke&&$.scrimClosing,Ae&&$.exitHoldingFocus,!c&&$.dialogNonModal),ref:Te,popover:c?void 0:`manual`,"aria-label":r,"aria-hidden":je?`true`:void 0,"aria-modal":c&&b?`true`:void 0,role:d===`required`?`alertdialog`:void 0,inert:je?!0:void 0,"data-sheet-stack":c?Kr(D,b):void 0,"data-sheet-stack-depth":c&&D.depth>0?D.depth:void 0,onCancel:De,onClickCapture:Ae?Wr:void 0,onKeyDownCapture:Ae?Gr:void 0,onKeyUpCapture:Ae?Gr:void 0,...ee({onClick:Oe}),children:[(0,X.jsx)(kn,{...m,ref:e,state:fe,isEntrySettled:ae,onEntrySettled:x,isOpenRequested:b,height:o,label:r,snapPoints:s,isSwipeDismissAllowed:d===`info`,isPageScrollLocked:w&&c,xstyle:f,onDismiss:I,onScrimOpacity:H,onScrimFadeDuration:_e,onElementChange:L,handleRef:ve,onMotionStart:ye,onMotionComplete:be,children:(0,X.jsx)(me,{dialogRef:h,isOpen:b&&c,children:(0,X.jsx)(oe,{children:(0,X.jsx)(G,{value:!0,children:(0,X.jsx)(jn,{value:b?Mn:Nn,children:i})})})})}),w&&(0,X.jsx)(An,{})]})}function Qr({switcher:e,ref:t,sheetId:n,label:r,children:i,height:o=`capped`,snapPoints:s,purpose:c=`info`,xstyle:l,...u}){let{activeSheet:f,hasScrim:p,onActiveSheetChange:m,getSheetPhase:h,getSheetAlignmentOffset:g,hostSheet:_,isScrimOwner:v,isFlowClosing:y,registerSheetElement:te,registerSheetDialog:ne,registerSheetPurpose:re,onBeforeSheetPresent:b,isCoveredInTopLayer:ie,onSheetEnterStart:x,onSheetTransitionComplete:ae,onSheetScrimOpacityChange:S,stackView:C,dialogProps:w,onDialogCancel:T,onDialogClick:E,onDialogKeyDown:D,settledSheet:se,releaseSettledSheet:O}=e,k=typeof n==`string`&&n.length>0,A=k?h(n):`hidden`,ce=Yr(A,k?g(n):0),j=A===`active`||A===`entering`,le=A===`covered`||A===`aligning`||A===`fading`||A===`exiting`,M=A!==`hidden`,ue=k&&M&&se===n,N=A===`active`||A===`entering`,P=k&&v(n),de=le||p&&C.isBlocked,fe=k&&_===n,F=(0,K.useRef)(null),pe=(0,K.useRef)(null),I=(0,K.useRef)(null),L=(0,K.useRef)(A),R=L.current,z=(0,K.useRef)(!1);(0,K.useLayoutEffect)(()=>{L.current=A},[A]);let B=(0,K.useCallback)(()=>{c===`info`&&k&&f===n&&m(null)},[f,k,m,c,n]),he=(0,K.useCallback)(e=>{I.current=e,k&&te(n,e)},[k,te,n]),V=(0,K.useCallback)(e=>{F.current=e,k&&ne(n,e)},[k,ne,n]),H=(0,K.useCallback)(e=>{e===`entering`&&k&&x(n)},[k,x,n]),ge=(0,K.useCallback)(e=>{k&&ae({sheetId:n,phase:e})},[k,ae,n]),_e=(0,K.useCallback)(e=>{k&&S(n,e)},[k,S,n]),ve=(0,K.useRef)(null),ye=(0,K.useCallback)((e,t)=>{Jr(e.closest(`dialog`),t,ve)},[]);(0,K.useLayoutEffect)(()=>{if(k)return re(n,c),()=>re(n,null)},[k,c,re,n]),(0,K.useLayoutEffect)(()=>{let e=F.current;if(e==null||!k)return;if(!M){e.open&&e.close(),pe.current=null;return}let t=p?`modal`:`non-modal`;e.open&&pe.current!==t&&e.close(),e.open&&p&&j&&ie(n)&&e.close(),e.open||(p?(b(n),P?cr(e):lr(e)):e.show()),pe.current=t},[p,k,ie,j,M,b,P,n]),(0,K.useLayoutEffect)(()=>()=>{let e=F.current;e?.open&&e.close()},[]),(0,K.useEffect)(()=>{if(j){let e=R===`active`||R===`entering`;(!z.current||!e)&&Xr(I.current,p),z.current=!0}else A===`hidden`&&(z.current=!1)},[p,j,A,R]),U(`BottomSheet`,"requires a non-empty `label` for an accessible name; the open sheet has no built-in heading to derive one from.",j&&!r);let{className:be,style:xe,xstyle:Se,"aria-label":W,"aria-labelledby":Ce,id:we,"data-testid":Te,...Ee}=w,De=d(a($.dialog,M&&$.dialogOpen,p&&$.scrim,p&&ue&&$.scrimSettled,p&&P&&y&&$.scrimClosing,!p&&$.dialogNonModalItem,!p&&N&&$.dialogNonModalItemTop,Se),be,xe);return(0,X.jsxs)(`dialog`,{...Ee,...De,id:fe?we:void 0,"data-testid":fe?Te:void 0,ref:V,"aria-label":W??(Ce==null?r:void 0),"aria-labelledby":Ce,"aria-modal":p&&j?`true`:void 0,"aria-hidden":de?`true`:void 0,inert:de?!0:void 0,"data-sheet-stack":p&&M?Kr(C,f!=null):void 0,"data-sheet-stack-depth":p&&M&&C.depth>0?C.depth:void 0,role:c===`required`?`alertdialog`:Ee.role,onCancel:T,onKeyDown:D,...ee({...Ee,onClick:E}),children:[(0,X.jsx)(`div`,{...a($.positioner,!M&&$.positionerHidden,N&&$.positionerTop,...p?Ur(C):[]),hidden:!M,"aria-hidden":de?`true`:void 0,inert:de?!0:void 0,children:(0,X.jsx)(kn,{...u,ref:t,state:ce,isEntrySettled:ue,onEntrySettled:O,isOpenRequested:k&&f===n,height:o,label:r,snapPoints:s,isSwipeDismissAllowed:c===`info`,isPageScrollLocked:p,xstyle:l,onDismiss:B,onScrimOpacity:_e,onScrimFadeDuration:ye,onElementChange:he,onMotionStart:H,onMotionComplete:ge,children:(0,X.jsx)(Vr,{value:null,children:(0,X.jsx)(me,{dialogRef:F,isOpen:M&&p,children:(0,X.jsx)(oe,{children:(0,X.jsx)(G,{value:!0,children:(0,X.jsx)(jn,{value:j?Mn:Nn,children:i})})})})})})}),M&&(0,X.jsx)(An,{})]})}function $r(e){let t=(0,K.use)(Vr),n=e.sheetId,r=typeof n==`string`&&n.length>0;return U(`BottomSheet`,"requires a non-empty `sheetId` when nested in BottomSheetSwitcher; standalone `isOpen` / `onOpenChange` props are ignored there.",t!=null&&!r),U(`BottomSheet`,"`sheetId` only works inside BottomSheetSwitcher. Use `isOpen` and `onOpenChange` for a standalone sheet.",t==null&&n!=null),t==null?(0,X.jsx)(Zr,{...e}):(0,X.jsx)(Qr,{...e,switcher:t})}$r.displayName=`BottomSheet`;export{Hr as n,$r as t};
|