@qredence/fleet 0.5.11 → 0.6.1
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/CHANGELOG.md +14 -0
- package/dist/web/client/assets/action-swap-roll-COzQ86wm.js +1 -0
- package/dist/web/client/assets/agent-activity-svETLf_5.js +1 -0
- package/dist/web/client/assets/agent-disclosure-DAMuuGcM.js +1 -0
- package/dist/web/client/assets/analytics-stub-B6zGMuSV.js +1 -0
- package/dist/web/client/assets/{artifacts-panel-CQmFEF_H.js → artifacts-panel-HVjqBMyx.js} +1 -1
- package/dist/web/client/assets/button-C5wFDY5_.js +1 -0
- package/dist/web/client/assets/card-DA3Vnqay.js +1 -0
- package/dist/web/client/assets/{chat-yh02zgA7.js → chat-BhYseKd6.js} +7 -7
- package/dist/web/client/assets/{chat-command-palette-CmHTS3rs.js → chat-command-palette-LILDO_vG.js} +1 -1
- package/dist/web/client/assets/{citations-C_tPOJE_.js → citations-BPv8HIpf.js} +2 -2
- package/dist/web/client/assets/command-PhicLCoO.js +1 -0
- package/dist/web/client/assets/dialog-pBGUjAQ7.js +1 -0
- package/dist/web/client/assets/fleet-message-queue-fbYYwMj0.js +1 -0
- package/dist/web/client/assets/{fleet-pi-tool-renderer-BEDIO3al.js → fleet-pi-tool-renderer-BRgNnmaJ.js} +28 -28
- package/dist/web/client/assets/fleet-reasoning-panel-CjA2dwUJ.js +1 -0
- package/dist/web/client/assets/{fork-picker-dialog-ByBOGVsa.js → fork-picker-dialog-B7NNpVmW.js} +1 -1
- package/dist/web/client/assets/globals-CuIiqOTg.css +2 -0
- package/dist/web/client/assets/horizontal-resize-Cp3iHMH7.js +1 -0
- package/dist/web/client/assets/index-CSGplyr_.js +12 -0
- package/dist/web/client/assets/{input-0wwjWjKq.js → input-PcdubeKn.js} +1 -1
- package/dist/web/client/assets/input-group-C2HJEZvl.js +1 -0
- package/dist/web/client/assets/ipython-tool-CyuMOxz1.js +3 -0
- package/dist/web/client/assets/{markdown-code-CuQcR3UO.js → markdown-code-xNyjdZ4g.js} +1 -1
- package/dist/web/client/assets/{markdown-DInPmRUG.js → markdown-lvexwooo.js} +2 -2
- package/dist/web/client/assets/{model-selector-list-DsKTuAgS.js → model-selector-list-CoXX358G.js} +1 -1
- package/dist/web/client/assets/{notify-DgMKgZZW.js → notify-DxL0VD7Z.js} +1 -1
- package/dist/web/client/assets/openui-renderer-TLNe5e_Q.js +378 -0
- package/dist/web/client/assets/pencil-DcUwsKLn.js +1 -0
- package/dist/web/client/assets/prompt-input-fwP8TsgQ.js +1 -0
- package/dist/web/client/assets/{prompt-suggestions-Cc--lSNR.js → prompt-suggestions-BlGXmWS7.js} +1 -1
- package/dist/web/client/assets/provider-catalog-DYMFdbKc.js +1 -0
- package/dist/web/client/assets/provider-label-B4q5mI65.js +1 -0
- package/dist/web/client/assets/{repl-panel-DsPX04Xr.js → repl-panel-C5om8MGU.js} +1 -1
- package/dist/web/client/assets/{right-panel-registry-DewpBWHM.js → right-panel-registry-BBlxLxnx.js} +2 -2
- package/dist/web/client/assets/routes-XGsAIqBJ.js +16 -0
- package/dist/web/client/assets/settings-dialog-BSBasR3o.js +2 -0
- package/dist/web/client/assets/{subagent-chat-panel-DkVUumrP.js → subagent-chat-panel-oeLDPDAK.js} +1 -1
- package/dist/web/client/assets/{subagent-transcript-D8wmQxXe.js → subagent-transcript-DaVHjNUH.js} +1 -1
- package/dist/web/client/assets/{subagents-panel-BMp2Ego0.js → subagents-panel-D_aVgSCi.js} +1 -1
- package/dist/web/client/assets/surfaces-BhAXz9So.js +1 -0
- package/dist/web/client/assets/{switch-9rTeg6J6.js → switch-WhXeJNNY.js} +1 -1
- package/dist/web/client/assets/{toast-Bt9p2OL4.js → toast-D3c9XeGe.js} +1 -1
- package/dist/web/client/assets/{tool-result-DfnPN0FQ.js → tool-result-Cki8WUNc.js} +3 -3
- package/dist/web/client/assets/virtualized-turn-list-CdMa-ydT.js +6 -0
- package/dist/web/client/assets/workspace-panel-77bDbprs.js +1 -0
- package/dist/web/client/bundle-budget.json +6 -6
- package/dist/web/launcher.mjs +10 -1
- package/dist/web/server/{_tanstack-start-manifest_v-po4woX6g-AUGCOEZ2.js → _tanstack-start-manifest_v-0L7fqnH4-KMVGUFE4.js} +25 -24
- package/dist/web/server/{agent-activity-CS2rbF_C-A3R26CYH.js → agent-activity-BuEE6iVw-CDZLK4D2.js} +4 -4
- package/dist/web/server/{artifacts-panel-8GGUCtOd-X5TNKTY2.js → artifacts-panel-D3ySO--V-XSL53CXL.js} +18 -18
- package/dist/web/server/{chat-command-palette-Dgl5tqWn-72LLEWUD.js → chat-command-palette-kAbXhWVg-TJWXH2WW.js} +9 -9
- package/dist/web/server/{chunk-O4OTWWPF.js → chunk-2DDWXTVG.js} +5 -5
- package/dist/web/server/{chunk-MIW4LJTV.js → chunk-2JHTYWD5.js} +15 -23
- package/dist/web/server/{chunk-7MDZVLIY.js → chunk-3TIMGWWI.js} +1 -2
- package/dist/web/server/{chunk-AGFRJQZ7.js → chunk-4WBFCB4O.js} +257 -257
- package/dist/web/server/{chunk-P6UMR32I.js → chunk-5UCAJBAH.js} +4 -4
- package/dist/web/server/{chunk-BXWAUTTH.js → chunk-D27LRYVT.js} +42 -42
- package/dist/web/server/{chunk-YXXRP3NS.js → chunk-DLUZFOG3.js} +5 -5
- package/dist/web/server/{chunk-K3BXQG3N.js → chunk-EBG3XFGQ.js} +60 -60
- package/dist/web/server/{chunk-2ATMSG7U.js → chunk-EJEPDVK6.js} +3 -3
- package/dist/web/server/{chunk-IJPCV6DH.js → chunk-FYDQK6UX.js} +1 -1
- package/dist/web/server/{chunk-WKV2Z4KO.js → chunk-HF7DG7PC.js} +74 -74
- package/dist/web/server/{chunk-WYL2DW5R.js → chunk-JTCCQZLN.js} +2 -2
- package/dist/web/server/{chunk-UAPNEWCA.js → chunk-KP2PNDGL.js} +6 -6
- package/dist/web/server/chunk-M5RSPNYN.js +22 -0
- package/dist/web/server/{chunk-7SR6WDM2.js → chunk-MNBGB2SP.js} +2 -2
- package/dist/web/server/{chunk-HSJMLO36.js → chunk-MNPHMZU7.js} +3 -3
- package/dist/web/server/{chunk-JQDLJ7KI.js → chunk-NGCQJ33Y.js} +1134 -1134
- package/dist/web/server/{chunk-7SD2ZSEA.js → chunk-NIDBN7BQ.js} +1 -1
- package/dist/web/server/{chunk-ZJFA4F5X.js → chunk-NIZBFVJF.js} +2 -2
- package/dist/web/server/{chunk-P7H2OPKF.js → chunk-NJ4QEZHK.js} +11 -4
- package/dist/web/server/{chunk-WM4PUT6M.js → chunk-NNKJTKOQ.js} +234 -234
- package/dist/web/server/{chunk-N6NOTURM.js → chunk-NWDI3OWB.js} +4 -4
- package/dist/web/server/{chunk-ABBWBBSS.js → chunk-O3HDELZ2.js} +74826 -74825
- package/dist/web/server/{chunk-GGT2ZKDB.js → chunk-PLYZ7P2Y.js} +11 -155
- package/dist/web/server/chunk-PTCKOR23.js +39 -0
- package/dist/web/server/{chunk-RNOJACWQ.js → chunk-QFRCJWQQ.js} +7 -7
- package/dist/web/server/{chunk-NXJ32VFR.js → chunk-QIULBRTU.js} +13 -13
- package/dist/web/server/{chunk-XKKXXG6N.js → chunk-RIP3PBWT.js} +3 -3
- package/dist/web/server/{chunk-YKVGQBZA.js → chunk-S5LFXXDY.js} +625 -622
- package/dist/web/server/{chunk-XLNCWZMZ.js → chunk-UCUFC553.js} +3 -1
- package/dist/web/server/{chunk-KOUEJ3NU.js → chunk-UL2725KQ.js} +3 -3
- package/dist/web/server/{chunk-HFQTI7AX.js → chunk-VPKX7QRU.js} +3 -3
- package/dist/web/server/{chunk-LZ4Q5KUJ.js → chunk-WNCAL4HN.js} +133 -133
- package/dist/web/server/{chunk-C5X6G26O.js → chunk-XIB6XNUX.js} +436 -436
- package/dist/web/server/{chunk-JUROEEWM.js → chunk-YGYOBX7G.js} +82 -4
- package/dist/web/server/{chunk-WILCIZYU.js → chunk-ZIFSJ3HQ.js} +626 -626
- package/dist/web/server/fleet-message-queue-D_w8lSeY-T3HB7HVQ.js +152 -0
- package/dist/web/server/{fleet-pi-tool-renderer-umKunT3K-O4GBH35V.js → fleet-pi-tool-renderer-qwc-qZFq-4U556N5Q.js} +12 -12
- package/dist/web/server/{fleet-reasoning-panel-BxC2COxi-GPLMQSTT.js → fleet-reasoning-panel-DG_vuvv0-NCZWEEIT.js} +26 -26
- package/dist/web/server/{fleet-subagent-list-CpSYzCIq-JDH2LHSS.js → fleet-subagent-list-BGb0PjhF-2X67FMUV.js} +1 -1
- package/dist/web/server/{fleet-tool-timeline-IB36_PB2-XJENTO6I.js → fleet-tool-timeline-D6yM4ZMz-ZSFVRRRI.js} +1 -1
- package/dist/web/server/{fork-picker-dialog-DlINz9UQ-UWIXFDJX.js → fork-picker-dialog-Ds6Tgtu3-DIBWN7MV.js} +5 -5
- package/dist/web/server/{model-selector-list-OYnzNbyu-HBGCNF2L.js → model-selector-list-DxeGZoD2-P6S6FSJH.js} +9 -9
- package/dist/web/server/{openui-renderer-Cj7kfqyL-EKJ6JTTQ.js → openui-renderer-MKFv6LlH-MDRSVFEY.js} +11 -11
- package/dist/web/server/{prompt-suggestions-D4AEEY7K-RZSP7PWV.js → prompt-suggestions-BOItmGnD-YQA7RHLG.js} +2 -2
- package/dist/web/server/{repl-panel-D5KsoJik-BQKO53JO.js → repl-panel-CuyF8wt5-CHDT2Q3N.js} +2 -2
- package/dist/web/server/{router-Ci1wxI7I-E2AYMNON.js → router-Dg72SESP-PCWKLFRG.js} +1239 -470
- package/dist/web/server/{routes-CRpm9-Sa-IYK6MUJO.js → routes-BGrVtPYF-SURPAJN6.js} +5781 -5588
- package/dist/web/server/server.js +2 -2
- package/dist/web/server/{settings-dialog-BvkgNflv-GPJ6COQO.js → settings-dialog-CK0FJlTg-HZRBAXDZ.js} +1577 -1264
- package/dist/web/server/{subagent-chat-panel-CMuvW9Sd-M5TEEGQW.js → subagent-chat-panel-gzamnTgK-PQ2TLLJF.js} +21 -21
- package/dist/web/server/{subagents-panel-DgfB6_Yy-4INEPE3Y.js → subagents-panel-Berjd7HJ-EI5ZKC6V.js} +20 -20
- package/dist/web/server/{workspace-panel-bpwj-Veu-Q2CEJMN4.js → workspace-panel-CBBa_3UO-B4PPFPMA.js} +46 -21
- package/package.json +1 -1
- package/dist/web/client/assets/action-swap-roll-BB8DFMuf.js +0 -1
- package/dist/web/client/assets/agent-activity-CwMDU7aP.js +0 -1
- package/dist/web/client/assets/agent-disclosure-B8SnhQXL.js +0 -1
- package/dist/web/client/assets/analytics-stub-Cas1He0w.js +0 -1
- package/dist/web/client/assets/button-BR2WWrFo.js +0 -1
- package/dist/web/client/assets/card-BKl76a3R.js +0 -1
- package/dist/web/client/assets/command-DPfiaYUL.js +0 -1
- package/dist/web/client/assets/dialog-BEZuZhzk.js +0 -1
- package/dist/web/client/assets/fleet-message-queue-DUz6Hfrf.js +0 -1
- package/dist/web/client/assets/fleet-reasoning-panel-CbkO7u-v.js +0 -1
- package/dist/web/client/assets/globals-B_I1Eq1u.css +0 -2
- package/dist/web/client/assets/horizontal-resize-qK6eRhIG.js +0 -1
- package/dist/web/client/assets/index-C1zOjrMK.js +0 -12
- package/dist/web/client/assets/input-group-BFDsCVS9.js +0 -1
- package/dist/web/client/assets/ipython-tool-ldJ9F1Cw.js +0 -3
- package/dist/web/client/assets/openui-renderer-J3dhPpL4.js +0 -378
- package/dist/web/client/assets/prompt-input-qPIXZ-Rb.js +0 -1
- package/dist/web/client/assets/provider-catalog-D8G66gwc.js +0 -1
- package/dist/web/client/assets/provider-label-Dpr7djG9.js +0 -1
- package/dist/web/client/assets/routes-vNkVToAF.js +0 -16
- package/dist/web/client/assets/settings-dialog-B-v4me3Y.js +0 -1
- package/dist/web/client/assets/surfaces-DI-U-_2a.js +0 -1
- package/dist/web/client/assets/virtualized-turn-list-DMJENRY0.js +0 -6
- package/dist/web/client/assets/workspace-panel-G6yMpKJ8.js +0 -1
- package/dist/web/server/chunk-QK4CHLVV.js +0 -17
- package/dist/web/server/fleet-message-queue-j0DCU5Xy-5HKBHMPV.js +0 -75
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PromptInput
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S5LFXXDY.js";
|
|
4
4
|
import "./chunk-7CNGNFFK.js";
|
|
5
5
|
import "./chunk-PVJCTQFK.js";
|
|
6
6
|
import {
|
|
7
7
|
SubagentTranscriptView
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-QFRCJWQQ.js";
|
|
9
|
+
import "./chunk-ZIFSJ3HQ.js";
|
|
10
10
|
import "./chunk-FJV6EQDW.js";
|
|
11
11
|
import "./chunk-OKL5ZRVB.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-JTCCQZLN.js";
|
|
13
|
+
import "./chunk-UL2725KQ.js";
|
|
14
14
|
import "./chunk-UCA4WN66.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-NGCQJ33Y.js";
|
|
16
|
+
import "./chunk-NWDI3OWB.js";
|
|
17
17
|
import "./chunk-QPNUGF3V.js";
|
|
18
18
|
import "./chunk-V3S6BVXO.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-UCUFC553.js";
|
|
20
20
|
import "./chunk-2ST2ULW7.js";
|
|
21
21
|
import "./chunk-BLSX7WHW.js";
|
|
22
22
|
import "./chunk-3JMESBAT.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-FYDQK6UX.js";
|
|
24
24
|
import "./chunk-XA42CHF2.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-NIDBN7BQ.js";
|
|
26
26
|
import "./chunk-42XU6WV7.js";
|
|
27
27
|
import "./chunk-P66QQWUM.js";
|
|
28
28
|
import "./chunk-JIULUYHT.js";
|
|
29
29
|
import "./chunk-LY5XOHHU.js";
|
|
30
30
|
import "./chunk-4UBOIY2S.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-DLUZFOG3.js";
|
|
32
|
+
import "./chunk-EJEPDVK6.js";
|
|
33
|
+
import "./chunk-VPKX7QRU.js";
|
|
34
|
+
import "./chunk-MNPHMZU7.js";
|
|
35
35
|
import "./chunk-OOXWPL22.js";
|
|
36
36
|
import "./chunk-O2DUZJYK.js";
|
|
37
37
|
import "./chunk-ON33WDZX.js";
|
|
38
38
|
import "./chunk-TNL4YV63.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-NIZBFVJF.js";
|
|
40
40
|
import "./chunk-3C4CFCIS.js";
|
|
41
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-EBG3XFGQ.js";
|
|
42
42
|
import "./chunk-FAGDMGLK.js";
|
|
43
43
|
import "./chunk-NFRJDPB3.js";
|
|
44
44
|
import "./chunk-OZO5ARFA.js";
|
|
45
45
|
import "./chunk-L46H6IDX.js";
|
|
46
46
|
import "./chunk-WWJF4RO2.js";
|
|
47
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-WNCAL4HN.js";
|
|
48
48
|
import "./chunk-4QD4PCVP.js";
|
|
49
49
|
import "./chunk-S3PQ6HKH.js";
|
|
50
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-MNBGB2SP.js";
|
|
51
51
|
import "./chunk-JBLHIEVG.js";
|
|
52
|
-
import "./chunk-
|
|
52
|
+
import "./chunk-XIB6XNUX.js";
|
|
53
53
|
import "./chunk-ST5I2PLN.js";
|
|
54
54
|
import "./chunk-AR7O7JXD.js";
|
|
55
55
|
import "./chunk-ZCVWADNW.js";
|
|
56
56
|
import "./chunk-HFQZLPU2.js";
|
|
57
|
-
import "./chunk-
|
|
57
|
+
import "./chunk-QIULBRTU.js";
|
|
58
58
|
import "./chunk-X7D6GFQU.js";
|
|
59
59
|
import "./chunk-BYXBJQAS.js";
|
|
60
60
|
import "./chunk-4ZIEVI5O.js";
|
|
@@ -64,7 +64,7 @@ import "./chunk-JDCCC7A7.js";
|
|
|
64
64
|
import "./chunk-L547YHC4.js";
|
|
65
65
|
import "./chunk-MLKGABMK.js";
|
|
66
66
|
|
|
67
|
-
// web/app/dist/server/assets/subagent-chat-panel-
|
|
67
|
+
// web/app/dist/server/assets/subagent-chat-panel-gzamnTgK.js
|
|
68
68
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
69
69
|
function SubagentComposer({ disabled, sending, onSend, onStop, placeholder = "Message this subagent\u2026 (Enter to steer)" }) {
|
|
70
70
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SubagentTranscriptView
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-QFRCJWQQ.js";
|
|
4
|
+
import "./chunk-ZIFSJ3HQ.js";
|
|
5
5
|
import "./chunk-FJV6EQDW.js";
|
|
6
6
|
import "./chunk-OKL5ZRVB.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-JTCCQZLN.js";
|
|
8
|
+
import "./chunk-UL2725KQ.js";
|
|
9
9
|
import {
|
|
10
10
|
Bot
|
|
11
11
|
} from "./chunk-UCA4WN66.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-NGCQJ33Y.js";
|
|
13
|
+
import "./chunk-NWDI3OWB.js";
|
|
14
14
|
import "./chunk-QPNUGF3V.js";
|
|
15
15
|
import "./chunk-V3S6BVXO.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-UCUFC553.js";
|
|
17
17
|
import "./chunk-2ST2ULW7.js";
|
|
18
18
|
import "./chunk-BLSX7WHW.js";
|
|
19
19
|
import "./chunk-3JMESBAT.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-FYDQK6UX.js";
|
|
21
21
|
import "./chunk-XA42CHF2.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-NIDBN7BQ.js";
|
|
23
23
|
import {
|
|
24
24
|
orderedRlmChildren,
|
|
25
25
|
rlmStatusIcon
|
|
@@ -28,19 +28,19 @@ import "./chunk-P66QQWUM.js";
|
|
|
28
28
|
import "./chunk-JIULUYHT.js";
|
|
29
29
|
import "./chunk-LY5XOHHU.js";
|
|
30
30
|
import "./chunk-4UBOIY2S.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-DLUZFOG3.js";
|
|
32
|
+
import "./chunk-EJEPDVK6.js";
|
|
33
|
+
import "./chunk-VPKX7QRU.js";
|
|
34
|
+
import "./chunk-MNPHMZU7.js";
|
|
35
35
|
import "./chunk-OOXWPL22.js";
|
|
36
36
|
import "./chunk-O2DUZJYK.js";
|
|
37
37
|
import "./chunk-ON33WDZX.js";
|
|
38
38
|
import "./chunk-TNL4YV63.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-NIZBFVJF.js";
|
|
40
40
|
import {
|
|
41
41
|
ChevronRight
|
|
42
42
|
} from "./chunk-3C4CFCIS.js";
|
|
43
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-EBG3XFGQ.js";
|
|
44
44
|
import "./chunk-FAGDMGLK.js";
|
|
45
45
|
import "./chunk-NFRJDPB3.js";
|
|
46
46
|
import "./chunk-OZO5ARFA.js";
|
|
@@ -48,17 +48,17 @@ import "./chunk-L46H6IDX.js";
|
|
|
48
48
|
import "./chunk-WWJF4RO2.js";
|
|
49
49
|
import {
|
|
50
50
|
Button
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-WNCAL4HN.js";
|
|
52
52
|
import "./chunk-4QD4PCVP.js";
|
|
53
53
|
import "./chunk-S3PQ6HKH.js";
|
|
54
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-MNBGB2SP.js";
|
|
55
55
|
import "./chunk-JBLHIEVG.js";
|
|
56
|
-
import "./chunk-
|
|
56
|
+
import "./chunk-XIB6XNUX.js";
|
|
57
57
|
import "./chunk-ST5I2PLN.js";
|
|
58
58
|
import "./chunk-AR7O7JXD.js";
|
|
59
59
|
import "./chunk-ZCVWADNW.js";
|
|
60
60
|
import "./chunk-HFQZLPU2.js";
|
|
61
|
-
import "./chunk-
|
|
61
|
+
import "./chunk-QIULBRTU.js";
|
|
62
62
|
import "./chunk-X7D6GFQU.js";
|
|
63
63
|
import "./chunk-BYXBJQAS.js";
|
|
64
64
|
import "./chunk-4ZIEVI5O.js";
|
|
@@ -70,7 +70,7 @@ import "./chunk-JDCCC7A7.js";
|
|
|
70
70
|
import "./chunk-L547YHC4.js";
|
|
71
71
|
import "./chunk-MLKGABMK.js";
|
|
72
72
|
|
|
73
|
-
// web/app/dist/server/assets/subagents-panel-
|
|
73
|
+
// web/app/dist/server/assets/subagents-panel-Berjd7HJ.js
|
|
74
74
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
75
75
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
76
76
|
function SubagentsPanelContent({ agents, loadSession, onOpenTab, parentSessionId, tree }) {
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
readStoredWidth,
|
|
9
9
|
startHorizontalResize,
|
|
10
10
|
storeStoredWidth
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-HF7DG7PC.js";
|
|
12
|
+
import "./chunk-PTCKOR23.js";
|
|
13
13
|
import {
|
|
14
14
|
Folder
|
|
15
15
|
} from "./chunk-GS2IZGRC.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
AnimatePresence,
|
|
25
25
|
useReducedMotion
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-NIZBFVJF.js";
|
|
27
27
|
import {
|
|
28
28
|
ChevronRight
|
|
29
29
|
} from "./chunk-3C4CFCIS.js";
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
SPRING_LAYOUT,
|
|
33
33
|
SPRING_SWAP,
|
|
34
34
|
motion
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-EBG3XFGQ.js";
|
|
36
36
|
import "./chunk-FAGDMGLK.js";
|
|
37
37
|
import {
|
|
38
38
|
Markdown
|
|
@@ -66,7 +66,7 @@ import "./chunk-JDCCC7A7.js";
|
|
|
66
66
|
import "./chunk-L547YHC4.js";
|
|
67
67
|
import "./chunk-MLKGABMK.js";
|
|
68
68
|
|
|
69
|
-
// web/app/dist/server/assets/workspace-panel-
|
|
69
|
+
// web/app/dist/server/assets/workspace-panel-CBBa_3UO.js
|
|
70
70
|
import { Children, Fragment, isValidElement, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
71
71
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
72
72
|
function FileTreeFolder(_props) {
|
|
@@ -388,6 +388,15 @@ function useWorkspaceSplitLayout(_workspace) {
|
|
|
388
388
|
splitStyle: isSplitLayout ? { gridTemplateColumns: `${treeWidth}px 8px minmax(160px, 1fr)` } : void 0
|
|
389
389
|
};
|
|
390
390
|
}
|
|
391
|
+
var WORKSPACE_PREVIEW_TIMEOUT_MS = 15e3;
|
|
392
|
+
function previewLoadError(err) {
|
|
393
|
+
if (err instanceof DOMException && err.name === "AbortError") return /* @__PURE__ */ new Error("Preview timed out");
|
|
394
|
+
if (err instanceof Error) {
|
|
395
|
+
if (err.name === "AbortError" || /aborted|timed out/i.test(err.message)) return /* @__PURE__ */ new Error("Preview timed out");
|
|
396
|
+
return err;
|
|
397
|
+
}
|
|
398
|
+
return new Error(String(err));
|
|
399
|
+
}
|
|
391
400
|
function WorkspacePanelContent({ error, emptyDescription = "agent-workspace has not been loaded yet.", emptyTitle = "Workspace unavailable", loadWorkspaceFile, loading, onSelectedPathChange, previewEmptyDescription = "Choose a workspace file to preview its Markdown.", previewEmptyTitle = "Select a file", scopePath, scopeLabel, selectedPath: selectedPathProp, treeTestId = "workspace-tree", workspace }) {
|
|
392
401
|
const [internalSelectedPath, setInternalSelectedPath] = useState(null);
|
|
393
402
|
const isControlled = onSelectedPathChange !== void 0;
|
|
@@ -450,26 +459,42 @@ function WorkspacePanelContent({ error, emptyDescription = "agent-workspace has
|
|
|
450
459
|
workspace
|
|
451
460
|
]);
|
|
452
461
|
useEffect(() => {
|
|
453
|
-
if (!selectedPath)
|
|
462
|
+
if (!selectedPath) {
|
|
463
|
+
setPreviewLoading(false);
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
const selected = selectedPath;
|
|
467
|
+
const controller = new AbortController();
|
|
468
|
+
const timeoutId = window.setTimeout(() => controller.abort(), WORKSPACE_PREVIEW_TIMEOUT_MS);
|
|
454
469
|
let cancelled = false;
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
470
|
+
setPreview((current) => current?.path === selected ? current : null);
|
|
471
|
+
setPreviewLoading(true);
|
|
472
|
+
setPreviewError(null);
|
|
473
|
+
(async () => {
|
|
458
474
|
try {
|
|
459
|
-
const body = await loadWorkspaceFile(
|
|
460
|
-
|
|
475
|
+
const body = await Promise.race([loadWorkspaceFile(selected, controller.signal), new Promise((_, reject) => {
|
|
476
|
+
const onAbort = () => reject(new DOMException("Preview timed out", "AbortError"));
|
|
477
|
+
if (controller.signal.aborted) {
|
|
478
|
+
onAbort();
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
controller.signal.addEventListener("abort", onAbort, { once: true });
|
|
482
|
+
})]);
|
|
483
|
+
if (cancelled) return;
|
|
484
|
+
setPreview(body);
|
|
485
|
+
setPreviewError(null);
|
|
461
486
|
} catch (err) {
|
|
462
|
-
if (
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
}
|
|
487
|
+
if (cancelled) return;
|
|
488
|
+
setPreview(null);
|
|
489
|
+
setPreviewError(previewLoadError(err));
|
|
466
490
|
} finally {
|
|
467
491
|
if (!cancelled) setPreviewLoading(false);
|
|
468
492
|
}
|
|
469
|
-
}
|
|
470
|
-
loadPreview();
|
|
493
|
+
})();
|
|
471
494
|
return () => {
|
|
472
495
|
cancelled = true;
|
|
496
|
+
window.clearTimeout(timeoutId);
|
|
497
|
+
controller.abort();
|
|
473
498
|
};
|
|
474
499
|
}, [
|
|
475
500
|
loadWorkspaceFile,
|
|
@@ -607,23 +632,23 @@ function WorkspacePreview({ emptyDescription, emptyTitle, error, loading, previe
|
|
|
607
632
|
title: emptyTitle,
|
|
608
633
|
description: emptyDescription
|
|
609
634
|
}),
|
|
610
|
-
selectedPath && loading && /* @__PURE__ */ jsx(WorkspacePreviewSkeleton, {}),
|
|
635
|
+
selectedPath && loading && !preview && /* @__PURE__ */ jsx(WorkspacePreviewSkeleton, {}),
|
|
611
636
|
selectedPath && error && /* @__PURE__ */ jsx(ResourceNotice, {
|
|
612
637
|
icon: CircleAlert,
|
|
613
638
|
title: "Unable to load preview",
|
|
614
639
|
description: error.message
|
|
615
640
|
}),
|
|
616
|
-
selectedPath && !
|
|
641
|
+
selectedPath && !error && preview?.status === "too-large" && /* @__PURE__ */ jsx(ResourceNotice, {
|
|
617
642
|
icon: CircleAlert,
|
|
618
643
|
title: "Preview too large",
|
|
619
644
|
description: `${preview.name} is too large to preview safely.`
|
|
620
645
|
}),
|
|
621
|
-
selectedPath && !
|
|
646
|
+
selectedPath && !error && preview?.status === "unsupported" && /* @__PURE__ */ jsx(ResourceNotice, {
|
|
622
647
|
icon: CircleAlert,
|
|
623
648
|
title: "Unsupported preview",
|
|
624
649
|
description: `${preview.name} is not a supported text file.`
|
|
625
650
|
}),
|
|
626
|
-
selectedPath && !
|
|
651
|
+
selectedPath && !error && preview && (preview.status === void 0 || preview.status === "ok") && /* @__PURE__ */ jsx(Markdown, {
|
|
627
652
|
className: "text-label leading-relaxed",
|
|
628
653
|
content: preview.content
|
|
629
654
|
})
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{d as r,i,r as a,u as o}from"./ease-u56MhKYS.js";import{n as s,t as c}from"./use-reduced-motion-eORd7fqW.js";import{t as l}from"./utils-Eg7xtNmV.js";import{t as u}from"./createLucideIcon-DwxZHm0M.js";var d=u(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),f=u(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),p=e(t(),1),m=n(),h={duration:.2,ease:`easeInOut`},g=o,_={duration:.14,ease:a},v=`blur(8px)`,y=`blur(3px)`,b=.025,x={initial:{opacity:0,y:`105%`,filter:y},animate:(e=0)=>({opacity:1,y:`0%`,filter:`blur(0px)`,transition:{...o,delay:e}}),exit:(e=0)=>({opacity:0,y:`-105%`,filter:y,transition:{duration:.16,ease:a,delay:e*.5}})},S={blur:{initial:{opacity:0,scale:.94,filter:v},animate:{opacity:1,scale:1,filter:`blur(0px)`,transition:h},exit:{opacity:0,scale:.94,filter:v,transition:h}},roll:{initial:{opacity:0,y:`90%`,filter:y},animate:{opacity:1,y:`0%`,filter:`blur(0px)`,transition:g},exit:{opacity:0,y:`-90%`,filter:y,transition:_}}};function C({value:e,children:t,animation:n=`blur`,className:a}){let o=c(),u=(0,p.useRef)(null),[d,f]=(0,p.useState)();(0,p.useLayoutEffect)(()=>{let e=u.current?.offsetWidth;e&&f(t=>t===e?t:e)});let h=typeof t==`string`?t:null,g=n===`cascade`&&h!==null&&!o,_=n===`cascade`?`roll`:n;return(0,m.jsxs)(`span`,{className:l(`relative inline-block overflow-hidden whitespace-nowrap align-bottom`,a),style:{width:d,transition:o?void 0:`width 220ms ${i}`},children:[(0,m.jsx)(`span`,{ref:u,"aria-hidden":!0,className:`invisible inline-block whitespace-nowrap`,children:t}),g?(0,m.jsx)(`span`,{className:`sr-only`,children:h}):null,(0,m.jsx)(s,{initial:!1,children:g?(0,m.jsx)(r.span,{"aria-hidden":!0,initial:`initial`,animate:`animate`,exit:`exit`,className:`absolute left-0 top-0 inline-block whitespace-pre`,children:h.split(``).map((e,t)=>(0,m.jsx)(r.span,{custom:t*b,variants:x,className:`inline-block whitespace-pre`,children:e},t))},`cascade-${e}`):(0,m.jsx)(r.span,{variants:S[_],initial:!o&&`initial`,animate:o?{opacity:1,filter:`blur(0px)`,scale:1,y:0}:`animate`,exit:o?void 0:`exit`,className:`absolute left-0 top-0 inline-block`,children:t},`${n}-${e}`)})]})}function w(e){return(0,m.jsx)(C,{...e,animation:`roll`})}export{f as n,d as r,w as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{d as r,o as i,r as a,u as o}from"./ease-u56MhKYS.js";import{n as s,t as c}from"./use-reduced-motion-eORd7fqW.js";import{t as l}from"./utils-Eg7xtNmV.js";import{t as u}from"./createLucideIcon-DwxZHm0M.js";import{t as d}from"./check-JjHKAZas.js";import{t as f}from"./chevron-down-BEVGmnSb.js";import{t as p}from"./earth-DGZXAN5r.js";import{t as m}from"./file-text-T-NcAlZs.js";import{t as h}from"./image-BbPmlw-n.js";import{t as g}from"./message-square-hbDao-A1.js";import{t as _}from"./search-eWVnAJsb.js";import{t as v}from"./sparkles-DuclzqlE.js";import{t as y}from"./square-terminal-BYTN_I86.js";import{t as b}from"./wrench-BJNNe07k.js";import{t as x}from"./agent-disclosure-B8SnhQXL.js";import{t as S}from"./safe-external-url-D3PJJIcM.js";var C=u(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),w=u(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),T=e(t(),1),E=`@keyframes beui-text-shimmer{from{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion: reduce){.beui-text-shimmer{animation:none !important}}`,D=`beui-text-shimmer bg-[length:200%_100%] bg-clip-text text-transparent bg-[linear-gradient(110deg,var(--muted-foreground)_30%,var(--foreground)_50%,var(--muted-foreground)_70%)]`;function O(e){return{animation:`beui-text-shimmer ${e}s linear infinite`}}var k=n();function A({children:e,as:t=`span`,duration:n=2.5,className:r}){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`style`,{children:E}),(0,k.jsx)(t,{style:O(n),className:l(`inline-block`,D,r),children:e})]})}function j({children:e=`Thinking…`,duration:t=1.8,className:n}){return(0,k.jsx)(A,{as:`span`,duration:t,className:l(`font-medium`,n),children:e})}function M({item:e}){let t=e.status??`complete`;return(0,k.jsxs)(`div`,{className:`flex min-h-7 items-start gap-2.5 rounded-md px-1.5 py-1`,children:[(0,k.jsx)(`span`,{"aria-hidden":`true`,className:`mt-0.5 grid size-4 shrink-0 place-items-center text-muted-foreground/70`,children:t===`complete`?(0,k.jsx)(d,{className:`size-4`,strokeWidth:1.8}):t===`active`?(0,k.jsxs)(`span`,{className:`relative grid size-3 place-items-center`,children:[(0,k.jsx)(r.span,{className:`absolute inset-0 rounded-full bg-foreground/10`,animate:{opacity:[.35,.8,.35]},transition:{duration:1.5,repeat:1/0}}),(0,k.jsx)(`span`,{className:`size-1.5 rounded-full bg-foreground/60`})]}):(0,k.jsx)(C,{className:`size-3`,strokeWidth:1.5})}),(0,k.jsx)(`span`,{className:l(`min-w-0 flex-1 leading-5`,t===`pending`?`text-muted-foreground/55`:`text-foreground/90`),children:e.label}),e.meta?(0,k.jsx)(`span`,{className:`shrink-0 leading-5 text-muted-foreground/55`,children:e.meta}):null]})}function N({item:e}){return(0,k.jsx)(`div`,{className:`rounded-md px-1.5 py-1 leading-5 text-muted-foreground`,children:e.content})}function P({result:e}){let t=e.url&&S(e.url)?e.url:void 0,n=(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-5 shrink-0 place-items-center text-muted-foreground`,children:e.icon??(0,k.jsx)(p,{className:`size-3`,strokeWidth:2})}),(0,k.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground/90`,children:e.title}),e.domain?(0,k.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground/55`,children:e.domain}):null]}),r=l(`flex min-h-7 items-center gap-2 rounded-md px-1.5 py-1 text-left outline-none transition-colors`,t&&`focus-visible:ring-2 focus-visible:ring-ring`);return t?(0,k.jsx)(`a`,{href:t,className:r,children:n}):(0,k.jsx)(`div`,{className:r,children:n})}function F({item:e}){let t=c()??!1,n=t?{opacity:1}:{opacity:0,y:6},o={opacity:1,y:0},l=t?{opacity:0}:{opacity:0,y:-3},u=t?{duration:0}:{opacity:{duration:.18,ease:a},y:i,layout:i};return(0,k.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,k.jsxs)(`div`,{className:`flex min-h-7 items-center gap-2.5 rounded-md px-1.5 py-1 text-muted-foreground`,children:[(0,k.jsx)(_,{"aria-hidden":`true`,className:`size-4 shrink-0`,strokeWidth:1.7}),(0,k.jsx)(`span`,{className:`min-w-0 truncate`,children:e.query})]}),e.results?.length?(0,k.jsx)(`div`,{className:`space-y-0.5 pl-4`,children:(0,k.jsx)(s,{initial:!0,mode:`popLayout`,children:e.results.map(e=>(0,k.jsx)(r.div,{layout:`position`,initial:n,animate:o,exit:l,transition:u,children:(0,k.jsx)(P,{result:e})},e.id))})}):null,(0,k.jsx)(s,{initial:!0,children:e.moreCount?(0,k.jsxs)(r.div,{initial:n,animate:o,exit:l,transition:u,className:`px-1.5 py-1 pl-8 text-muted-foreground/55`,children:[`+`,e.moreCount,` more`]},`more-results`):null})]})}function I({action:e}){return e===`read`?(0,k.jsx)(m,{className:`size-4`}):e===`edit`||e===`write`?(0,k.jsx)(w,{className:`size-4`}):e===`run`?(0,k.jsx)(y,{className:`size-4`}):(0,k.jsx)(b,{className:`size-4`})}function L({action:e}){return(0,k.jsx)(`button`,{type:`button`,"aria-label":e.ariaLabel??e.label,onClick:e.onClick,className:`shrink-0 rounded-md px-1.5 py-1 text-[0.625rem] font-medium text-primary outline-none hover:bg-primary/10 focus-visible:ring-2 focus-visible:ring-ring`,children:e.label})}function R({item:e}){let t=e.action.charAt(0).toUpperCase()+e.action.slice(1),n=typeof e.additions==`number`||typeof e.deletions==`number`;return(0,k.jsxs)(`div`,{className:`grid min-h-8 min-w-0 grid-cols-[1rem_auto_minmax(0,1fr)_auto] items-center gap-2.5 rounded-md px-1.5 py-0.5 leading-5`,children:[(0,k.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-4 shrink-0 place-items-center text-muted-foreground/70`,children:(0,k.jsx)(I,{action:e.action})}),(0,k.jsx)(`span`,{className:`shrink-0 font-medium text-foreground/90`,children:t}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate rounded-lg bg-muted/80 px-2.5 py-1 font-mono text-xs text-muted-foreground/70`,children:e.target}),n||e.openAction?(0,k.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[n?(0,k.jsxs)(`span`,{className:`flex items-center gap-2 font-mono tabular-nums`,children:[typeof e.additions==`number`?(0,k.jsxs)(`span`,{className:`text-emerald-500`,children:[`+`,e.additions]}):null,typeof e.deletions==`number`?(0,k.jsxs)(`span`,{className:`text-rose-500`,children:[`−`,e.deletions]}):null]}):null,e.openAction?(0,k.jsx)(L,{action:e.openAction}):null]}):null]})}function z({kind:e}){return e===`thinking`?(0,k.jsx)(v,{className:`size-4`}):e===`message`?(0,k.jsx)(g,{className:`size-4`}):e===`write`?(0,k.jsx)(w,{className:`size-4`}):e===`run`?(0,k.jsx)(y,{className:`size-4`}):e===`read`?(0,k.jsx)(h,{className:`size-4`}):(0,k.jsx)(b,{className:`size-4`})}function B({item:e}){let t=e.kind===`thinking`;return(0,k.jsxs)(`div`,{className:l(`grid min-h-8 grid-cols-[1rem_auto_minmax(0,1fr)_auto] gap-2.5 rounded-md px-1.5 py-0.5`,t?`items-start`:`items-center`),children:[(0,k.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-4 place-items-center text-muted-foreground/70`,children:e.icon??(0,k.jsx)(z,{kind:e.kind})}),(0,k.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground/90`,children:e.label}),e.detail?(0,k.jsx)(`span`,{className:l(`min-w-0 rounded-lg bg-muted/80 px-2.5 py-1 font-mono text-xs text-muted-foreground/70`,t?`max-h-40 overflow-y-auto whitespace-pre-wrap break-words`:`truncate`),children:e.detail}):(0,k.jsx)(`span`,{}),e.action?(0,k.jsx)(L,{action:e.action}):null]})}function V({item:e}){return e.type===`text`?(0,k.jsx)(N,{item:e}):e.type===`search`?(0,k.jsx)(F,{item:e}):e.type===`tool`?(0,k.jsx)(R,{item:e}):e.type===`trace`?(0,k.jsx)(B,{item:e}):(0,k.jsx)(M,{item:e})}function H(e){let t=Math.max(0,Math.round(e));if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return r===0?`${n}m`:`${n}m ${r}s`}function U({open:e,defaultOpen:t,onOpenChange:n}){let[r,i]=(0,T.useState)(t),a=e!==void 0;return[e??r,(0,T.useCallback)(e=>{a||i(e),n?.(e)},[a,n])]}function W(e){let t=e[0]?.type;return t&&e.every(e=>e.type===t)?t:`mixed`}function G(e){return e===`search`?`Searching the web…`:e===`tool`?`Running tools…`:e===`trace`?`Working through the run…`:e===`mixed`?`Working through it…`:`Thinking…`}function K(e,t,n){if(e===`step`||e===`text`)return(0,k.jsxs)(k.Fragment,{children:[`Thought for `,(0,k.jsx)(`span`,{className:`tabular-nums`,children:H(n)})]});if(e===`search`)return`Searched the web`;if(e===`tool`)return`Ran ${t.length} ${t.length===1?`tool`:`tools`}`;if(e===`trace`){let e=t.filter(e=>e.type===`trace`&&(e.kind===`thinking`||e.kind===`message`)).length,n=t.length-e;return`${n} ${n===1?`tool call`:`tool calls`}, ${e} ${e===1?`message`:`messages`}`}return`Completed ${t.length} ${t.length===1?`step`:`steps`}`}function q({items:e,contentType:t,status:n=`working`,duration:u=0,open:d,defaultOpen:p=!1,onOpenChange:m,collapseOnComplete:h=!0,activeLabel:g,summary:_,renderWorkingStatus:v,renderCompletedStatus:y,maxHeight:b=208,className:S,contentClassName:C}){let w=c()??!1,E=(0,T.useId)(),D=`${E}-trigger`,O=`${E}-content`,A=(0,T.useRef)(null),M=(0,T.useRef)(null),N=(0,T.useRef)(n),[P,F]=(0,T.useState)(0),[I,L]=U({open:d,defaultOpen:p,onOpenChange:m}),R=n===`working`,z=R||I,B=e.length?W(e):t??`mixed`,H=R?Math.max(0,b):Math.min(P,Math.max(0,b)),q=P>b,J=R?Math.min(0,H-P):0;(0,T.useLayoutEffect)(()=>{let e=A.current;if(!e)return;let t=()=>F(e.offsetHeight);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,T.useEffect)(()=>{N.current===`working`&&n===`complete`&&L(!h),N.current=n},[h,L,n]);let Y=()=>{let e=!I;L(e),e&&requestAnimationFrame(()=>M.current?.scrollTo({top:0}))},X=g??G(B),Z=_??K(B,e,u),Q=q?R?`linear-gradient(to bottom, transparent, black 12px)`:`linear-gradient(to bottom, transparent, black 12px, black calc(100% - 12px), transparent)`:void 0;return(0,k.jsxs)(`div`,{"data-state":R?`working`:z?`open`:`closed`,"data-content":B,"aria-busy":R,className:l(`w-full text-sm`,S),children:[R?(0,k.jsx)(`div`,{id:D,role:`status`,className:`flex h-7 min-w-0 items-center text-muted-foreground`,children:v?v({label:X,duration:u}):(0,k.jsx)(j,{children:X})}):(0,k.jsxs)(`button`,{id:D,type:`button`,"aria-expanded":z,"aria-controls":O,onClick:Y,className:`group flex h-7 min-w-0 items-center gap-1.5 rounded-md text-left font-medium text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,children:[(0,k.jsx)(`span`,{className:`truncate`,children:y?y({summary:Z,duration:u}):Z}),(0,k.jsx)(r.span,{"aria-hidden":`true`,animate:{rotate:z?180:0},transition:w?{duration:0}:o,className:`inline-flex shrink-0 text-muted-foreground/70 group-hover:text-foreground`,children:(0,k.jsx)(f,{className:`size-3.5`})})]}),(0,k.jsx)(x,{id:O,role:`region`,"aria-labelledby":D,open:z,openHeight:H,children:(0,k.jsx)(`div`,{ref:M,className:l(`scrollbar-hide pr-1`,q&&z&&!R?`overflow-y-auto`:`overflow-y-hidden`),style:{height:H,maskImage:Q,WebkitMaskImage:Q},children:(0,k.jsx)(r.div,{ref:A,role:`list`,initial:!1,animate:{y:J},transition:w?{duration:0}:i,className:l(`space-y-0.5 py-2`,C),children:(0,k.jsx)(s,{mode:`popLayout`,children:e.map(e=>(0,k.jsx)(r.div,{layout:`position`,role:`listitem`,initial:w?{opacity:1}:{opacity:0,y:6},animate:{opacity:1,y:0},exit:w?{opacity:0}:{opacity:0,y:-3},transition:w?{duration:0}:{opacity:{duration:.18,ease:a},y:i,layout:i},children:(0,k.jsx)(V,{item:e})},e.id))})})})})]})}export{q as AgentActivity};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-NZYk81nU.js";import{d as t,r as n}from"./ease-u56MhKYS.js";import{t as r}from"./use-reduced-motion-eORd7fqW.js";import{t as i}from"./utils-Eg7xtNmV.js";var a=e();function o({open:e,openHeight:o=`auto`,className:s,style:c,transition:l,...u}){let d=r()??!1;return(0,a.jsx)(t.div,{...u,"aria-hidden":!e,inert:!e,initial:!1,animate:d?{opacity:+!!e}:{opacity:+!!e,clipPath:e?`inset(0 0 0% 0)`:`inset(0 0 100% 0)`,y:e?0:-4},transition:l??{duration:d?0:e?.22:.14,ease:n},className:i(`overflow-hidden`,s),style:{...c,height:e?o:0,pointerEvents:e?void 0:`none`,transformOrigin:`top`}})}export{o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{a as r,d as i,i as a,l as o,n as s}from"./layout-gyLzPvVv.js";var c=e(t(),1),l=c.createContext(null);function u(e){return c.useContext(l)}function d(e){let t=u();return c.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var f=n(),p=c.createContext(void 0),m=e=>{let t=c.useContext(p);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},h=({client:e,children:t})=>(c.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,f.jsx)(p.Provider,{value:e,children:t})),g={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},_=new class{#e=g;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function v(e){setTimeout(e,0)}var y=typeof window>`u`||`Deno`in globalThis;function b(){}function x(e,t){return typeof e==`function`?e(t):e}function S(e){return typeof e==`number`&&e>=0&&e!==1/0}function C(e,t){return Math.max(e+(t||0)-Date.now(),0)}function w(e,t){return typeof e==`function`?e(t):e}function ee(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==T(o,t.options))return!1}else if(!D(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function te(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(E(t.options.mutationKey)!==E(a))return!1}else if(!D(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function T(e,t){return(t?.queryKeyHashFn||E)(e)}function E(e){return JSON.stringify(e,(e,t)=>A(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function D(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!D(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!D(e[r],t[r]))return!1;return!0}return!1}var ne=Object.prototype.hasOwnProperty;function O(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=k(e)&&k(t);if(!r&&!(A(e)&&A(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ne.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=O(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function re(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function k(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function A(e){if(!j(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!j(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function j(e){return Object.prototype.toString.call(e)===`[object Object]`}function M(e){return new Promise(t=>{_.setTimeout(t,e)})}function N(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:O(e,t)}function ie(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ae(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var P=Symbol();function F(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===P?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function oe(e,t){return typeof e==`function`?e(...t):!!e}function I(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var se=()=>y,L=()=>se(),R=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},z=new class extends R{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ce=v;function le(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ce,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var B=le(),V=new class extends R{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function H(e){return Math.min(1e3*2**e,3e4)}function U(e){return(e??`online`)!==`online`||V.isOnline()}var W=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function G(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(b);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new W(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>z.isFocused()&&(e.networkMode===`always`||V.isOnline())&&e.canRun(),p=()=>U(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(L()?0:3),a=e.retryDelay??H,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),M(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var K=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),S(this.gcTime)&&(this.#e=_.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(L()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(_.clearTimeout(this.#e),this.#e=void 0)}};function ue(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{I(e,()=>t.signal,()=>n=!0)},u=F(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ae:ie;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?de:q,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:q(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function q(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function de(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var fe=class extends K{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=X(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=X(this.options);e.data!==void 0&&(this.setState(Y(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=N(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(b).catch(b):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>w(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===P||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>w(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!C(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=F(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ue(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=G({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof W&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof W){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...J(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Y(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),B.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function J(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:U(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Y(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function X(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var pe=class extends K{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Z(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=G({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),B.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Z(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}function me({children:e,features:t,strict:n=!1}){let[,r]=(0,c.useState)(!Q(t)),a=(0,c.useRef)(void 0);if(!Q(t)){let{renderer:e,...n}=t;a.current=e,o(n)}return(0,c.useEffect)(()=>{Q(t)&&t().then(({renderer:e,...t})=>{o(t),a.current=e,r(!0)})},[]),(0,f.jsx)(i.Provider,{value:{renderer:a.current,strict:n},children:e})}function Q(e){return typeof e==`function`}var he={renderer:r,...a,...s};function $(e){if(typeof window>`u`||typeof PerformanceObserver>`u`)return()=>{};let t=window.location.pathname,n=[],r,i=!1,a=!1;try{let o=new PerformanceObserver(e=>{if(i)return;let t=e.getEntries(),n=t[t.length-1];n&&(r=n.startTime)});o.observe({type:`largest-contentful-paint`,buffered:!0}),n.push(o);let s=0,c=0,l=0,u=0,d=!1,f=e=>{for(let t of e){let e=t;if(!e.hadRecentInput){let n=e.value??0;d&&t.startTime-u<1e3&&t.startTime-l<5e3?c+=n:(c=n,l=t.startTime),d=!0,u=t.startTime,s=Math.max(s,c)}}},p=new PerformanceObserver(e=>f(e.getEntries()));p.observe({type:`layout-shift`,buffered:!0}),n.push(p);let m=new Map,h=e=>{for(let t of e){let e=t;e.interactionId&&m.set(e.interactionId,Math.max(m.get(e.interactionId)??0,e.duration??0))}},g=()=>{if(m.size===0)return;let e=[...m.values()].sort((e,t)=>e-t),t=performance.interactionCount,n=typeof t==`number`&&Number.isFinite(t)?Math.max(t,e.length):e.length,r=Math.floor(n/50);return e[Math.max(0,e.length-r-1)]},_=new PerformanceObserver(e=>h(e.getEntries()));_.observe({type:`event`,buffered:!0,durationThreshold:40}),n.push(_);let v=()=>{if(i)return;let n=o.takeRecords(),a=n[n.length-1];a&&(r=a.startTime),i=!0,r!==void 0&&e({name:`LCP`,value:r,url:t})},y=()=>{if(a)return;v(),f(p.takeRecords()),h(_.takeRecords()),a=!0,d&&e({name:`CLS`,value:s,url:t});let n=g();n!==void 0&&e({name:`INP`,value:n,url:t})},b=()=>v(),x=()=>{document.visibilityState===`hidden`&&y()},S=[`pointerdown`,`keydown`,`touchstart`];for(let e of S)window.addEventListener(e,b,{capture:!0});return document.addEventListener(`visibilitychange`,x),window.addEventListener(`pagehide`,y),()=>{y();for(let e of S)window.removeEventListener(e,b,{capture:!0});document.removeEventListener(`visibilitychange`,x),window.removeEventListener(`pagehide`,y);for(let e of n)e.disconnect()}}catch{}return()=>{for(let e of n)e.disconnect()}}function ge(){if(typeof window>`u`||window.__fleetVitalsInit)return;window.__fleetVitalsInit=!0;let e=e=>{try{let t=JSON.stringify(e);navigator.sendBeacon&&navigator.sendBeacon(`/api/analytics/vitals`,t)}catch{}},t=$(e);window.addEventListener(`pageshow`,n=>{n.persisted&&(t(),t=$(e))})}function _e(e){}function ve(){}function ye(e){}function be(e){}export{P as A,ee as C,w as D,N as E,d as F,u as I,l as L,_ as M,h as N,re as O,m as P,te as S,D as T,x as _,ve as a,y as b,pe as c,J as d,V as f,L as g,R as h,ge as i,C as j,oe as k,Z as l,z as m,be as n,he as o,B as p,_e as r,me as s,ye as t,fe as u,E as v,b as w,S as x,T as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{i as n,r}from"./bundle-mjs-DKHVkVWu.js";import{t as i}from"./react-dom-Bwxum3ti.js";import{t as a}from"./jsx-runtime-NZYk81nU.js";import{F as o,G as s,J as c,K as l,O as u,P as d,S as f,X as p,at as m,ct as h,et as g,it as _,rt as v,st as y,t as ee,tt as b,v as x,z as S}from"./createBaseUIEventDetails-DV0dQrBX.js";import{t as C}from"./utils-Eg7xtNmV.js";var te=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),w=t(((e,t)=>{t.exports=te()})),ne=t((e=>{var t=n(),r=w();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),T=t(((e,t)=>{t.exports=ne()})),E=w(),re=e(T(),1),D=e(n(),1),O=[],k=void 0;function ie(){return k}function ae(e){O.push(e)}function oe(e){let t=(t,n)=>{let r=_(ce).current,i;try{k=r;for(let e of O)e.before(r);i=e(t,n);for(let e of O)e.after(r);r.didInitialize=!0}finally{k=void 0}return i};return t.displayName=e.displayName||e.name,t}function se(e){return D.forwardRef(oe(e))}function ce(){return{didInitialize:!1}}var le=b(19)?de:fe;function A(e,t,n,r,i){return le(e,t,n,r,i)}function ue(e,t,n,r,i){let a=D.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,E.useSyncExternalStore)(e.subscribe,a,a)}ae({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,E.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function de(e,t,n,r,i){let a=ie();if(!a)return ue(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function fe(e,t,n,r,i){return(0,re.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var pe=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return A(this,e,t,n,r)}},me=class extends pe{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){D.useDebugValue(e);let n=this;v(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;v(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);v(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){D.useDebugValue(e);let n=this,r=t!==void 0;v(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return D.useDebugValue(e),A(this,this.selectors[e],t,n,r)}useContextCallback(e,t){D.useDebugValue(e);let n=g(t??h);this.context[e]=n}useStateSetter(e){let t=D.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},he=e(i(),1);function j(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}var M=a();function N(e){return e?.ownerDocument||document}var P=0,ge=class e{static create(){return new e}currentId=P;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=P,t()},e)}isStarted(){return this.currentId!==P}clear=()=>{this.currentId!==P&&(clearTimeout(this.currentId),this.currentId=P)};disposeEffect=()=>this.clear};function _e(){let e=_(ge.create).current;return m(e.disposeEffect),e}function ve(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:ye,platform:be,maxTouchPoints:xe}=ve(),F=ye.toLowerCase(),I=be.toLowerCase(),L=/^i(os$|p)/.test(I)||I===`macintel`&&xe>1,R=`android`,Se=I===R||F.includes(R),Ce=!L&&I.startsWith(`mac`);I.startsWith(`win`),!Se&&/^(linux|chrome os)/.test(I);var we=Ce||L,z=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!z&&F.includes(`firefox`),!z&&F.includes(`chrom`);var Te=we,B=/jsdom|happydom/.test(F),Ee=`data-base-ui-focusable`,De=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Oe=`ArrowLeft`,ke=`ArrowRight`,Ae=`ArrowUp`,je=`ArrowDown`;function V(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function H(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&p(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Me(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Ne(e,t){if(!s(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(H(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Pe(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Fe(e){return e.matches(`html,body`)}function U(e){return l(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Ie(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${De}`)!=null}function Le(e){return e?e.getAttribute(`role`)===`combobox`&&U(e):!1}function Re(e){if(!e||B)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function ze(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Be(e,t){return t<0||t>=e.length}function Ve(e,t){return W(e.current,{disabledIndices:t})}function He(e,t){return W(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function W(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&G(e,a,r));return a}function G(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!K(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Ue(e){return e.visibility===`hidden`||e.visibility===`collapse`}function K(e,t=e?o(e):null){return!e||!e.isConnected||!t||Ue(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var We=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Ge(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return p(n)?n.host:null}function q(e){for(let t of Array.from(e.children))if(S(t)===`summary`)return t;return null}function Ke(e,t){let n=q(t);return!!n&&(e===n||H(n,e))}function J(e){let t=e?S(e):``;return e!=null&&e.matches(We)&&(t!==`summary`||e.parentElement!=null&&S(e.parentElement)===`details`&&q(e.parentElement)===e)&&(t!==`details`||q(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Y(e){if(!J(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Ge(t)){let n=t!==e,r=S(t)===`slot`;if(t.hasAttribute(`inert`)||n&&S(t)===`details`&&!t.open&&!Ke(e,t)||t.hasAttribute(`hidden`)||!r&&!qe(t,n))return!1}return!0}function qe(e,t){let n=o(e);return t?n.display!==`none`:K(e,n)}function Je(e){let t=e.tabIndex;if(t<0){let t=S(e);if(t===`details`||t===`audio`||t===`video`||l(e)&&e.isContentEditable)return 0}return t}function X(e){if(S(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Ye(e,t){let n=X(e);if(!n)return!0;let r=t.find(e=>{let t=X(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=X(e);return t?.name===n.name&&t.form===n.form})===n}function Xe(e){if(l(e)&&S(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return l(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Ze(e,t){Xe(e).forEach(e=>{J(e)&&t.push(e),Ze(e,t)})}function Qe(e,t,n){Xe(e).forEach(e=>{l(e)&&e.matches(t)&&n.push(e),Qe(e,t,n)})}function $e(e){return Y(e)&&Je(e)>=0}function et(e){let t=[];return Ze(e,t),t.filter(Y)}function Z(e){let t=et(e);return t.filter(e=>Je(e)>=0&&Ye(e,t))}function tt(e,t){let n=Z(e),r=n.length;if(r===0)return;let i=V(N(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function nt(e){return tt(N(e).body,1)||e}function rt(e){return tt(N(e).body,-1)||e}function it(e,t){if(!e)return null;let n=Z(N(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function at(e){return it(e,1)}function ot(e){return it(e,-1)}function Q(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!H(n,r)}function st(e){Z(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function ct(e){let t=[];Qe(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var lt={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},ut={...lt,position:`fixed`,top:0,left:0},dt={...lt,position:`absolute`},$=D.forwardRef(function(e,t){let[n,r]=D.useState();v(()=>{Te&&z&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,M.jsx)(`span`,{...e,ref:t,style:ut,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function ft(e){return b(19)?e:e?`true`:void 0}var pt={style:{transition:`none`}},mt=`data-base-ui-click-trigger`,ht=`data-base-ui-swipe-ignore`,gt=`data-swipe-ignore`,_t=`[${ht}]`,vt=`[${gt}]`,yt={fallbackAxisSide:`none`},bt={fallbackAxisSide:`end`},xt={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function St(e){return`data-base-ui-${e}`}var Ct=D.createContext(null),wt=()=>D.useContext(Ct),Tt=St(`portal`);function Et(e={}){let{ref:t,container:n,componentProps:r=y,elementProps:i}=e,a=f(),o=wt()?.portalNode,[s,l]=D.useState(null),[d,p]=D.useState(null),m=g(e=>{e!==null&&p(e)}),h=D.useRef(null);v(()=>{if(n===null){h.current&&(h.current=null,p(null),l(null));return}let e=(n&&(c(n)?n:n.current))??o??document.body;if(e==null){h.current&&(h.current=null,p(null),l(null));return}h.current!==e&&(h.current=e,p(null),l(e))},[n,o]);let _=u(`div`,r,{ref:[t,m],props:[{id:a,[Tt]:``},i]}),ee=s&&_?he.createPortal(_,s):null;return{node:d,nodeId:D.isValidElement(_)?_.props.id:void 0,subtree:ee}}var Dt=D.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=Et({container:o,ref:t,componentProps:e,elementProps:s}),f=D.useRef(null),p=D.useRef(null),m=D.useRef(null),h=D.useRef(null),[g,_]=D.useState(null),y=D.useRef(!1),b=g?.modal,x=g?.open,S=!!g&&!g.modal&&g.open&&!!c;D.useEffect(()=>{if(!c||b)return;function e(e){c&&e.relatedTarget&&Q(e)&&(e.type===`focusin`?y.current&&=(ct(c),!1):(st(c),y.current=!0))}return j(d(c,`focusin`,e,!0),d(c,`focusout`,e,!0))},[c,b]),v(()=>{!c||x!==!0||!y.current||(ct(c),y.current=!1)},[x,c]);let C=D.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:c,setFocusManagerState:_}),[c]);return(0,M.jsxs)(D.Fragment,{children:[u,(0,M.jsxs)(Ct.Provider,{value:C,children:[S&&c&&(0,M.jsx)($,{"data-type":`outside`,ref:f,onFocus:e=>{Q(e,c)?m.current?.focus():rt(g?g.domReference:null)?.focus()}}),S&&c&&(0,M.jsx)(`span`,{"aria-owns":l,style:xt}),c&&he.createPortal(a,c),S&&c&&(0,M.jsx)($,{"data-type":`outside`,ref:p,onFocus:e=>{Q(e,c)?h.current?.focus():(nt(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,ee(`focus-out`,e.nativeEvent)))}})]})]})}),Ot=D.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:d}=x({disabled:i,focusableWhenDisabled:a,native:o});return u(`button`,e,{state:{disabled:i},ref:[t,d],props:[c,l]})}),kt=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,At=r,jt=(e,t)=>n=>{if(t?.variants==null)return At(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=kt(t)||kt(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return At(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Mt=jt(`group/button inline-flex shrink-0 items-center justify-center rounded-full border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 rounded-full px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5`,xs:`h-6 gap-1 rounded-full px-2 text-xs in-data-[slot=button-group]:rounded-full has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-full px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-full has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 rounded-full px-3.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8 rounded-full`,"icon-xs":`size-6 rounded-full in-data-[slot=button-group]:rounded-full [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-full in-data-[slot=button-group]:rounded-full`,"icon-lg":`size-9 rounded-full`}},defaultVariants:{variant:`default`,size:`default`}});function Nt({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,M.jsx)(Ot,{"data-slot":`button`,className:C(Mt({variant:t,size:n,className:e})),...r})}export{_e as $,G as A,H as B,$e as C,Ve as D,He as E,Ne as F,Ae as G,je as H,Le as I,z as J,Ee as K,U as L,Pe as M,Ie as N,K as O,Fe as P,ge as Q,Re as R,Q as S,W as T,Oe as U,Me as V,ke as W,L as X,Se as Y,Ce as Z,et as _,wt as a,se as at,at as b,mt as c,vt as d,N as et,bt as f,dt as g,ut as h,Et as i,oe as it,ze as j,Be as k,pt as l,$ as m,jt as n,me as nt,St as o,T as ot,ft as p,B as q,Dt as r,A as rt,_t as s,w as st,Nt as t,j as tt,yt as u,nt as v,Z as w,ot as x,rt as y,V as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-hePW80VL.js";import{i as e}from"./bundle-mjs-DKHVkVWu.js";import{t}from"./jsx-runtime-NZYk81nU.js";import{t as n}from"./utils-Eg7xtNmV.js";e();var r=t();function i({className:e,size:t=`default`,...i}){return(0,r.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:n(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function a({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-header`,className:n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-title`,className:n(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-description`,className:n(`text-sm text-muted-foreground`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`card-content`,className:n(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}export{o as a,a as i,c as n,s as r,i as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{a as r,n as i,o as a,r as o,t as s}from"./dialog-BEZuZhzk.js";import{t as c}from"./utils-Eg7xtNmV.js";import{t as l}from"./check-JjHKAZas.js";import{t as u}from"./search-eWVnAJsb.js";import{T as d,g as f,i as p,m,n as h,r as g,t as _}from"./dist-BPaFisIZ.js";import{n as v,t as y}from"./input-group-BFDsCVS9.js";var b=e(t(),1),x=1,ee=.9,S=.8,C=.17,w=.1,T=.999,E=.9999,D=.99,O=/[\\\/_+.#"@\[\(\{&]/,k=/[\\\/_+.#"@\[\(\{&]/g,A=/[\s-]/,j=/[\s-]/g;function M(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?x:D;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=M(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=x:O.test(e.charAt(l-1))?(d*=S,p=e.slice(i,l-1).match(k),p&&i>0&&(d*=T**+p.length)):A.test(e.charAt(l-1))?(d*=ee,m=e.slice(i,l-1).match(j),m&&i>0&&(d*=T**+m.length)):(d*=C,i>0&&(d*=T**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=E)),(d<w&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=M(e,t,n,r,l+1,a+2,o),f*w>d&&(d=f*w)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function N(e){return e.toLowerCase().replace(j,` `)}function P(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,M(e,t,N(e),N(t),0,0,{})}var F=`[cmdk-group=""]`,I=`[cmdk-group-items=""]`,te=`[cmdk-group-heading=""]`,L=`[cmdk-item=""]`,R=`${L}:not([aria-disabled="true"])`,z=`cmdk-item-select`,B=`data-value`,ne=(e,t,n)=>P(e,t,n),re=b.createContext(void 0),V=()=>b.useContext(re),H=b.createContext(void 0),U=()=>b.useContext(H),W=b.createContext(void 0),G=b.forwardRef((e,t)=>{let n=X(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=X(()=>new Set),i=X(()=>new Map),a=X(()=>new Map),o=X(()=>new Set),s=J(e),{label:c,children:l,value:u,onValueChange:d,filter:p,shouldFilter:h,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,x=m(),ee=m(),S=m(),C=b.useRef(null),w=me();Y(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,T.emit()}},[u]),Y(()=>{w(6,j)},[]);let T=b.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)A(),O(),w(1,k);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(S);e?e.focus():(i=document.getElementById(x))==null||i.focus()}if(w(7,()=>{n.current.selectedItemId=M()?.id,T.emit()}),r||w(5,j),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}T.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),E=b.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,D(t,r)),w(2,()=>{O(),T.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),w(3,()=>{A(),O(),n.current.value||k(),T.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=M();w(4,()=>{A(),t?.getAttribute(`id`)===e&&k(),T.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:x,inputId:S,labelId:ee,listInnerRef:C}),[]);function D(e,t){let r=s.current?.filter??ne;return e?r(e,n.current.search,t):0}function O(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=C.current;N().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(I);t?t.appendChild(e.parentElement===t?e:e.closest(`${I} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${I} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=C.current?.querySelector(`${F}[${B}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function k(){let e=N().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(B);T.setState(`value`,e||void 0)}function A(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=D(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function j(){var e;let t=M();t&&(t.parentElement?.firstChild===t&&((e=t.closest(F)?.querySelector(te))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function M(){return C.current?.querySelector(`${L}[aria-selected="true"]`)}function N(){return Array.from(C.current?.querySelectorAll(R)||[])}function P(e){let t=N()[e];t&&T.setState(`value`,t.getAttribute(B))}function V(e){var t;let n=M(),r=N(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&T.setState(`value`,a.getAttribute(B))}function U(e){let t=M()?.closest(F),n;for(;t&&!n;)t=e>0?de(t,F):fe(t,F),n=t?.querySelector(R);n?T.setState(`value`,n.getAttribute(B)):V(e)}let W=()=>P(N().length-1),G=e=>{e.preventDefault(),e.metaKey?W():e.altKey?U(1):V(1)},K=e=>{e.preventDefault(),e.metaKey?P(0):e.altKey?U(-1):V(-1)};return b.createElement(f.div,{ref:t,tabIndex:-1,...y,"cmdk-root":``,onKeyDown:e=>{var t;(t=y.onKeyDown)==null||t.call(y,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:v&&e.ctrlKey&&G(e);break;case`ArrowDown`:G(e);break;case`p`:case`k`:v&&e.ctrlKey&&K(e);break;case`ArrowUp`:K(e);break;case`Home`:e.preventDefault(),P(0);break;case`End`:e.preventDefault(),W();break;case`Enter`:{e.preventDefault();let t=M();if(t){let e=new Event(z);t.dispatchEvent(e)}}}}},b.createElement(`label`,{"cmdk-label":``,htmlFor:E.inputId,id:E.labelId,style:ge},c),Q(e,e=>b.createElement(H.Provider,{value:T},b.createElement(re.Provider,{value:E},e))))}),K=b.forwardRef((e,t)=>{let n=m(),r=b.useRef(null),i=b.useContext(W),a=V(),o=J(e),s=o.current?.forceMount??i?.forceMount;Y(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=pe(n,r,[e.value,e.children,r],e.keywords),l=U(),u=Z(e=>e.value&&e.value===c.current),p=Z(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);b.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(z,h),()=>t.removeEventListener(z,h)},[p,e.onSelect,e.disabled]);function h(){var e,t;g(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function g(){l.setState(`value`,c.current,!0)}if(!p)return null;let{disabled:_,value:v,onSelect:y,forceMount:x,keywords:ee,...S}=e;return b.createElement(f.div,{ref:d(r,t),...S,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!_,"aria-selected":!!u,"data-disabled":!!_,"data-selected":!!u,onPointerMove:_||a.getDisablePointerSelection()?void 0:g,onClick:_?void 0:h},e.children)}),ie=b.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=m(),s=b.useRef(null),c=b.useRef(null),l=m(),u=V(),p=Z(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));Y(()=>u.group(o),[]),pe(o,s,[e.value,e.heading,c]);let h=b.useMemo(()=>({id:o,forceMount:i}),[i]);return b.createElement(f.div,{ref:d(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!p||void 0},n&&b.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),Q(e,e=>b.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},b.createElement(W.Provider,{value:h},e))))}),ae=b.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=b.useRef(null),a=Z(e=>!e.search);return!n&&!a?null:b.createElement(f.div,{ref:d(i,t),...r,"cmdk-separator":``,role:`separator`})}),oe=b.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=U(),o=Z(e=>e.search),s=Z(e=>e.selectedItemId),c=V();return b.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),b.createElement(f.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),se=b.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=b.useRef(null),o=b.useRef(null),s=Z(e=>e.selectedItemId),c=V();return b.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),b.createElement(f.div,{ref:d(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},Q(e,e=>b.createElement(`div`,{ref:d(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),ce=b.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return b.createElement(_,{open:n,onOpenChange:r},b.createElement(p,{container:o},b.createElement(g,{"cmdk-overlay":``,className:i}),b.createElement(h,{"aria-label":e.label,"cmdk-dialog":``,className:a},b.createElement(G,{ref:t,...s}))))}),le=b.forwardRef((e,t)=>Z(e=>e.filtered.count===0)?b.createElement(f.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),ue=b.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return b.createElement(f.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Q(e,e=>b.createElement(`div`,{"aria-hidden":!0},e)))}),q=Object.assign(G,{List:se,Item:K,Input:oe,Group:ie,Separator:ae,Dialog:ce,Empty:le,Loading:ue});function de(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function fe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function J(e){let t=b.useRef(e);return Y(()=>{t.current=e}),t}var Y=typeof window>`u`?b.useEffect:b.useLayoutEffect;function X(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=U(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function pe(e,t,n,r=[]){let i=b.useRef(),a=V();return Y(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(B,s),i.current=s}),i}var me=()=>{let[e,t]=b.useState(),n=X(()=>new Map);return Y(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function he(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Q({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(he(t),{ref:t.ref},n(t.props.children)):n(t)}var ge={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},$=n();function _e({className:e,...t}){return(0,$.jsx)(q,{"data-slot":`command`,className:c(`flex size-full flex-col overflow-hidden !rounded-xl p-1 text-popover-foreground`,e),...t})}function ve({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:l,showCloseButton:u=!1,...d}){return(0,$.jsx)(s,{...d,children:(0,$.jsxs)(i,{className:c(`top-1/3 translate-y-0 overflow-hidden !rounded-xl p-0`,l),showCloseButton:u,children:[(0,$.jsxs)(r,{className:`sr-only`,children:[(0,$.jsx)(a,{children:e}),(0,$.jsx)(o,{children:t})]}),(0,$.jsx)(_e,{children:n})]})})}function ye({className:e,...t}){return(0,$.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,$.jsxs)(y,{className:`!h-8 !rounded-lg border-input/30 bg-input/30 !shadow-none *:data-[slot=input-group-addon]:!pl-2`,children:[(0,$.jsx)(q.Input,{"data-slot":`command-input`,className:c(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,$.jsx)(v,{children:(0,$.jsx)(u,{className:`size-4 shrink-0 opacity-50`})})]})})}function be({className:e,...t}){return(0,$.jsx)(q.List,{"data-slot":`command-list`,className:c(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function xe({className:e,...t}){return(0,$.jsx)(q.Empty,{"data-slot":`command-empty`,className:c(`py-6 text-center text-sm`,e),...t})}function Se({className:e,...t}){return(0,$.jsx)(q.Group,{"data-slot":`command-group`,className:c(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function Ce({className:e,...t}){return(0,$.jsx)(q.Separator,{"data-slot":`command-separator`,className:c(`-mx-1 h-px bg-border`,e),...t})}function we({className:e,children:t,...n}){return(0,$.jsxs)(q.Item,{"data-slot":`command-item`,className:c(`group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:!rounded-lg data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground`,e),...n,children:[t,(0,$.jsx)(l,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}export{ye as a,Ce as c,Se as i,ve as n,we as o,xe as r,be as s,_e as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./react-dom-Bwxum3ti.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{$ as i,B as a,C as o,I as s,J as c,K as l,L as u,M as d,O as f,P as p,Q as m,S as h,V as g,X as _,Y as v,_ as y,a as b,et as x,j as ee,m as S,nt as C,o as te,p as ne,q as re,r as ie,t as w,tt as ae,v as oe,w as T,y as se,z as E}from"./button-BR2WWrFo.js";import{C as D,D as O,E as k,F as ce,G as A,H as le,K as j,M,N as ue,O as N,P,S as F,T as I,U as L,X as de,Y as R,a as z,ct as B,et as V,f as H,g as U,h as W,it as fe,j as G,nt as pe,o as me,p as he,q as ge,r as _e,rt as K,s as ve,st as q,t as ye,v as be,z as xe}from"./createBaseUIEventDetails-DV0dQrBX.js";import{n as Se,r as Ce,t as we}from"./useBaseUiId-CHqXB2UQ.js";import{t as Te}from"./utils-Eg7xtNmV.js";import{t as J}from"./x-CsRC_tCI.js";var Y=e(t(),1);function Ee(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Ee(e,t.id,n)])}function De(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Oe(e){e.preventDefault(),e.stopPropagation()}function X(e){return`nativeEvent`in e}function ke(e){return e.pointerType===``&&e.isTrusted?!0:v&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Ae(e){return re?!1:!v&&e.width===0&&e.height===0||v&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Z(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function je(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Me=0;function Ne(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Me);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),B;let o=requestAnimationFrame(a);return Me=o,()=>{Me===o&&(cancelAnimationFrame(o),Me=0)}}var Pe={inert:new WeakMap,"aria-hidden":new WeakMap},Fe=`data-base-ui-inert`,Ie={inert:new WeakSet,"aria-hidden":new WeakSet},Le=new WeakMap,Re=0;function ze(e){return Ie[e]}function Be(e){return e?de(e)?e.host:Be(e.parentNode):null}var Ve=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Be(t);return e.contains(n)?n:null}).filter(e=>e!=null),He=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Ue=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{xe(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function We(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Ve(t,e),l=i?Ue(t,He(c),new Set(c)):[],u=[],d=[];if(a){let e=Pe[a],n=ze(a);s=n,o=e;let r=Ve(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);Ue(t,He(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Le.get(e)||0)+1;Le.set(e,t),d.push(e),t===1&&e.setAttribute(Fe,``)}),Re+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(Le.get(e)||0)-1;Le.set(e,t),t||e.removeAttribute(Fe)}),--Re,Re||(Pe.inert=new WeakMap,Pe[`aria-hidden`]=new WeakMap,Ie.inert=new WeakSet,Ie[`aria-hidden`]=new WeakSet,Le=new WeakMap)}}function Ge(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=x(e[0]).body;return We(e,a,n,r,{mark:i})}function Ke(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var qe=class{nodesRef={current:[]};events=Ke();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Q=r(),Je=Y.createContext(null),Ye=Y.createContext(null),Xe=()=>Y.useContext(Je)?.id||null,Ze=e=>{let t=Y.useContext(Ye);return e??t};function Qe(e){let t=F(),n=Ze(e),r=Xe();return K(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function $e(e){let{children:t,id:n}=e,r=Xe();return(0,Q.jsx)(Je.Provider,{value:Y.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function et(e){let{children:t,externalTree:n}=e,r=fe(()=>n??new qe).current;return(0,Q.jsx)(Ye.Provider,{value:r,children:t})}function tt(e,t){let n=L(g(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var nt=20,$=[];function rt(){$=$.filter(e=>e.deref()?.isConnected)}function it(e){rt(),e&&xe(e)!==`body`&&($.push(new WeakRef(e)),$.length>nt&&($=$.slice(-20)))}function at(){return rt(),$[$.length-1]?.deref()}function ot(e){return e?o(e)?e:T(e)[0]||e:null}function st(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=y(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return o(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function ct(e){let{context:t,children:n,disabled:r=!1,initialFocus:l=!0,returnFocus:d=!0,restoreFocus:p=!1,modal:m=!0,closeOnFocusOut:_=!0,openInteractionType:v=``,nextFocusableElement:y,previousFocusableElement:C,beforeContentFocusGuardRef:ne,externalTree:re,getInsideElements:ie}=e,w=`rootStore`in t?t.rootStore:t,D=w.useState(`open`),O=w.useState(`domReferenceElement`),k=w.useState(`floatingElement`),{events:ce,dataRef:A}=w.context,le=V(()=>A.current.floatingContext?.nodeId),M=l===!1,N=s(O)&&M,F=Ce(l),L=Ce(d),de=Ce(v),R=Ce(D),z=Ze(re),B=b(),H=Y.useRef(!1),U=Y.useRef(!1),W=Y.useRef(!1),fe=Y.useRef(null),pe=Y.useRef(``),he=Y.useRef(``),ge=Y.useRef(null),_e=Y.useRef(null),ve=G(ge,ne,B?.beforeInsideRef),q=G(_e,B?.afterInsideRef),be=i(),Se=i(),we=ue(),Te=B!=null,J=ee(k),X=V((e=J)=>e?T(e):[]),Z=V(()=>ie?.().filter(e=>e!=null)??[]);Y.useEffect(()=>{if(r||!m)return;function e(e){e.key===`Tab`&&a(J,E(x(J)))&&X().length===0&&!N&&Oe(e)}let t=x(J);return P(t,`keydown`,e)},[r,J,m,N,X]),Y.useEffect(()=>{if(r||!D)return;let e=x(J);function t(){W.current=!1}function n(e){let t=g(e),n=Z(),r=a(k,t)||a(O,t)||a(B?.portalNode,t)||n.some(e=>e===t||a(e,t));W.current=!r,he.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(U.current=!0,Se.start(0,()=>{U.current=!1}))}function i(){he.current=`keyboard`}return ae(P(e,`pointerdown`,n,!0),P(e,`pointerup`,t,!0),P(e,`pointercancel`,t,!0),P(e,`keydown`,i,!0),t)},[r,k,O,J,D,B,Se,Z]),Y.useEffect(()=>{if(r||!_)return;let e=x(J);function t(){U.current=!0,Se.start(0,()=>{U.current=!1})}function n(e){let t=g(e);o(t)&&(fe.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=g(t);m&&n==null&&i!=null&&a(k,i)&&it(i),queueMicrotask(()=>{let o=le(),s=w.context.triggerElements,c=Z(),l=n?.hasAttribute(te(`focus-guard`))&&[ge.current,_e.current,B?.beforeInsideRef.current,B?.afterInsideRef.current,B?.beforeOutsideRef.current,B?.afterOutsideRef.current,I(C),I(y)].includes(n),u=!(a(O,n)||a(k,n)||a(n,k)||a(B?.portalNode,n)||c.some(e=>e===n||a(e,n))||s.hasMatchingElement(e=>a(e,n))||l||z&&(Ee(z.nodesRef.current,o).find(e=>a(e.context?.elements.floating,n)||a(e.context?.elements.domReference,n))||De(z.nodesRef.current,o).find(e=>[e.context?.elements.floating,ee(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===O&&J&&st(J),p&&r!==O&&!f(i)&&E(e)===e.body){if(j(J)&&(J.focus(),p===`popup`)){we.request(()=>{J.focus()});return}let e=X(),t=fe.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||J;j(n)&&n.focus()}if(A.current.insideReactTree){A.current.insideReactTree=!1;return}(N||!m)&&n&&u&&!U.current&&(N||n!==at())&&(H.current=!0,w.setOpen(!1,ye(me,t)))})}function s(){W.current||(A.current.insideReactTree=!0,be.start(0,()=>{A.current.insideReactTree=!1}))}let c=j(O)?O:null;if(!(!k&&!c))return ae(c&&P(c,`focusout`,i),c&&P(c,`pointerdown`,t),k&&P(k,`focusin`,n),k&&P(k,`focusout`,i),k&&B&&P(k,`focusout`,s,!0))},[r,O,k,J,m,z,B,w,_,p,X,N,le,A,be,Se,we,y,C,Z]),Y.useEffect(()=>{if(r||!k||!D)return;let e=Array.from(B?.portalNode?.querySelectorAll(`[${te(`portal`)}]`)||[]),t=(z?De(z.nodesRef.current,le()):[]).find(e=>s(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Ge([k,...e,ge.current,_e.current,B?.beforeOutsideRef.current,B?.afterOutsideRef.current,...Z(),t,I(C),I(y),N?O:null].filter(e=>e!=null),{ariaHidden:m||N,mark:!1}),i=Ge([k,...e].filter(e=>e!=null));return()=>{i(),n()}},[D,r,O,k,m,B,N,z,le,y,C,Z]),K(()=>{if(!D||r||!j(J))return;pe.current=``,he.current=``;let e=x(J),t=E(e);queueMicrotask(()=>{let n=F.current,r=typeof n==`function`?n(de.current||``):n;if(r===void 0||r===!1||a(J,t))return;let i=null,o=()=>(i??=X(J),i[0]||J),s;s=r===!0||r===null?o():I(r),s||=o();let c=a(J,E(e));Ne(s,{preventScroll:s===J,shouldFocus(){if(!R.current)return!1;if(c)return!0;let t=E(e);return!(t!==s&&a(J,t))}})})},[r,D,J,X,F,de,R]),K(()=>{if(r||!J)return;let e=x(J),t=E(e),n=de.current==null;it(t);function i(e){if(e.open||(pe.current=tt(e.nativeEvent,he.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(H.current=!0),e.reason===`outside-press`){if(e.nested)H.current=!1;else if(ke(e.nativeEvent)||Ae(e.nativeEvent))H.current=!1;else{let e=!1;x(J).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?H.current=!1:H.current=!0}}}ce.on(`openchange`,i);function o(e){let r=L.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=O?.isConnected?O:null,o=t?.isConnected&&xe(t)!==`body`?t:null,s=n?o||a:a||o;return s||=at()||null,typeof i==`boolean`?s:I(i)||s||null}return()=>{ce.off(`openchange`,i);let t=E(e),n=Z(),r=a(k,t)||n.some(e=>e===t||a(e,t))||z&&Ee(z.nodesRef.current,le(),!1).some(e=>a(e.context?.elements.floating,t)),s=L.current,c=pe.current,l=o(c);queueMicrotask(()=>{let n=ot(l),i=typeof s!=`boolean`;if(s&&!H.current&&j(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};c===`keyboard`&&(e.focusVisible=!0),n.focus(e)}H.current=!1})}},[r,k,J,L,de,ce,z,O,le,Z]),K(()=>{if(!c||D||!k)return;let e=E(x(k));!j(e)||!u(e)||a(k,e)&&e.blur()},[D,k]),K(()=>{if(!(r||!B))return B.setFocusManagerState({modal:m,closeOnFocusOut:_,open:D,onOpenChange:w.setOpen,domReference:O}),()=>{B.setFocusManagerState(null)}},[r,B,m,D,w,_,O]),K(()=>{if(!(r||!J))return st(J),()=>{queueMicrotask(rt)}},[r,J]);let je=!r&&(!m||!N)&&(Te||m);return(0,Q.jsxs)(Y.Fragment,{children:[je&&(0,Q.jsx)(S,{"data-type":`inside`,ref:ve,onFocus:e=>{if(m){let e=X();Ne(e[e.length-1])}else B?.portalNode&&(H.current=!1,h(e,B.portalNode)?oe(O)?.focus():I(C??B.beforeOutsideRef)?.focus())}}),n,je&&(0,Q.jsx)(S,{"data-type":`inside`,ref:q,onFocus:e=>{m?Ne(X()[0]):B?.portalNode&&(_&&(H.current=!0),h(e,B.portalNode)?se(O)?.focus():I(y??B.afterOutsideRef)?.focus())}})]})}function lt(){return!1}function ut(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function dt(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:o=!0,outsidePressEvent:s=`sloppy`,referencePress:l=lt,bubbles:u,externalTree:f}=t,h=`rootStore`in e?e.rootStore:e,_=h.useState(`open`),v=h.useState(`floatingElement`),{dataRef:y}=h.context,b=Ze(f),ee=V(typeof o==`function`?o:()=>!1),S=typeof o==`function`?ee:o,C=S!==!1,ne=V(()=>s),{escapeKey:re,outsidePress:ie}=ut(u),w=Y.useRef(!1),oe=Y.useRef(!1),T=Y.useRef(!1),se=Y.useRef(!1),E=Y.useRef(``),D=Y.useRef(null),O=i(),k=i(),M=V(()=>{k.clear(),y.current.insideReactTree=!1}),ue=V(e=>{let t=y.current.floatingContext?.nodeId;return(b?Ee(b.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=V(e=>d(e,h.select(`floatingElement`))||d(e,h.select(`domReferenceElement`))),F=V(e=>{l()&&h.setOpen(!1,ye(U,e.nativeEvent))}),I=V(e=>{if(!_||!n||!r||e.key!==`Escape`||se.current||!re&&ue(`__escapeKeyBubbles`))return;let t=X(e)?e.nativeEvent:e,i=ye(z,t);h.setOpen(!1,i),i.isCanceled||e.preventDefault(),!re&&!i.isPropagationAllowed&&e.stopPropagation()}),L=V(()=>{y.current.insideReactTree=!0,k.start(0,M)}),R=V(e=>{if(!_||!n||e.button!==0)return;let t=g(e.nativeEvent);a(h.select(`floatingElement`),t)&&(w.current||(w.current=!0,oe.current=!1))}),B=V(e=>{!_||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&w.current&&(oe.current=!0)});Y.useEffect(()=>{if(!_||!n)return M;y.current.__escapeKeyBubbles=re,y.current.__outsidePressBubbles=ie;let e=new m,t=new m;function i(){e.clear(),se.current=!0}function o(){e.start(c?5:0,()=>{se.current=!1})}function s(){T.current=!0,t.start(0,()=>{T.current=!1})}function l(){w.current=!1,oe.current=!1}function u(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=ne(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function f(e){let t=u();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function ee(e){let t=y.current.floatingContext?.nodeId,n=b&&Ee(b.nodesRef.current,t).some(t=>d(e,t.context?.elements.floating));return N(e)||n}function k(e){if(f(e)){e.type!==`click`&&!N(e)&&(t.clear(),T.current=!1),M();return}if(y.current.insideReactTree){M();return}let n=g(e),r=`[${te(`inert`)}]`,i=A(n)?n.getRootNode():null,o=Array.from((de(i)?i:x(h.select(`floatingElement`))).querySelectorAll(r)),s=h.context.triggerElements;if(n&&(s.hasElement(n)||s.hasMatchingElement(e=>a(e,n))))return;let c=A(n)?n:null;for(;c&&!ge(c);){let e=le(c);if(ge(e)||!A(e))break;c=e}if(!(o.length&&A(n)&&!p(n)&&!a(n,h.select(`floatingElement`))&&o.every(e=>!a(c,e)))){if(j(n)&&!(`touches`in e)){let t=ge(n),r=ce(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!ee(e)){if(u()===`intentional`&&T.current){t.clear(),T.current=!1;return}typeof S==`function`&&!S(e)||ue(`__outsidePressBubbles`)||(h.setOpen(!1,ye(he,e)),M())}}}function F(e){u()!==`sloppy`||e.pointerType===`touch`||!h.select(`open`)||!n||N(e)||k(e)}function L(e){if(u()!==`sloppy`||!h.select(`open`)||!n||N(e))return;let t=e.touches[0];t&&(D.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function R(e,t){let n=g(e);if(!n)return;let r=P(n,e.type,()=>{t(e),r()})}function z(e){E.current=`touch`,R(e,L)}function B(e){O.clear(),e.type===`pointerdown`&&(E.current=e.pointerType),!(e.type===`mousedown`&&D.current&&!D.current.dismissOnMouseDown)&&R(e,e=>{e.type===`pointerdown`?F(e):k(e)})}function V(e){if(!w.current)return;let n=oe.current;if(l(),u()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!ee(e)){if(n){s();return}typeof S==`function`&&!S(e)||(t.clear(),T.current=!0,M())}}}function H(e){if(u()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function U(e){R(e,H)}function W(e){u()!==`sloppy`||!D.current||N(e)||(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function fe(e){R(e,W)}let G=x(v),pe=ae(r&&ae(P(G,`keydown`,I),P(G,`compositionstart`,i),P(G,`compositionend`,o)),C&&ae(P(G,`click`,B,!0),P(G,`pointerdown`,B,!0),P(G,`pointerup`,V,!0),P(G,`pointercancel`,V,!0),P(G,`mousedown`,B,!0),P(G,`mouseup`,V,!0),P(G,`touchstart`,z,!0),P(G,`touchmove`,U,!0),P(G,`touchend`,fe,!0)));return()=>{pe(),e.clear(),t.clear(),l(),T.current=!1,M()}},[y,v,r,C,S,_,n,re,ie,I,M,ne,ue,N,b,h,O]);let H=Y.useMemo(()=>({onKeyDown:I,onPointerDown:F,onClick:F}),[I,F]),W=Y.useMemo(()=>({onKeyDown:I,onPointerDown:B,onMouseDown:B,onClickCapture:L,onMouseDownCapture(e){L(),R(e)},onPointerDownCapture(e){L(),R(e)},onMouseUpCapture:L,onTouchEndCapture:L,onTouchMoveCapture:L}),[I,L,R,B]);return Y.useMemo(()=>n?{reference:H,floating:W,trigger:H}:{},[n,H,W])}var ft=e(n(),1),pt={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},mt=class extends C{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Ke(),nested:n,triggerElements:i},pt),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&je(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function ht(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=Y.useRef(null);r===void 0&&f.current===null&&(f.current=new mt({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),K(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};A(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}var gt={tabIndex:-1,[l]:``};function _t(e){return t=>t!==`touch`||e.current}function vt(e,t=!1){let n=F(),r=Xe()!=null,i=fe(()=>e(n,r)).current;return ht({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function yt({handle:e,store:t}){return K(()=>e.attachStore(t),[e,t]),null}function bt(e,t){let n=Y.useRef(null),r=Y.useRef(null);return Y.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function xt(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function St(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Ct(e,t,n,r={}){let i=n.reason,a=i===W,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=St(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i={...r.extraState,open:t};o?i.instantType=`focus`:s?i.instantType=`dismiss`:a&&(i.instantType=void 0),xt(i,t,n.trigger,c()),e.update(i)};a?ft.flushSync(l):l()}function wt(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=bt(e,n),o=V(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=Y.useCallback(e=>{a(e),e&&o(e)},[a,o]);return K(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Tt(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=Y.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);K(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=ye(H);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Et(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Se(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=V(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return D({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function Dt(e,t){e.useSyncedValues(t),K(()=>()=>{e.update({activeTriggerProps:q,inactiveTriggerProps:q,popupProps:q})},[e])}function Ot(e,t){K(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),K(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var kt=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function At(){return new mt({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new kt,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function jt(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:At(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:q,inactiveTriggerProps:q,popupProps:q}}function Mt(e,t,n=!1){return new mt({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var Nt=e=>e.triggerIdProp??e.activeTriggerId,Pt=e=>e.openProp??e.open,Ft=e=>(e.popupElement?.id??e.floatingId)||void 0;function It(e,t){return t!==void 0&&Pt(e)&&Nt(e)===t}function Lt(e,t){return It(e,t)?!0:t!==void 0&&Pt(e)&&Nt(e)==null&&e.triggerCount===1}var Rt={open:Pt,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Nt,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Ft,isTriggerActive:(e,t)=>t!==void 0&&Nt(e)===t,isOpenedByTrigger:(e,t)=>It(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Nt(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Lt(e,t)?Ft(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=k.startingStyle]=`startingStyle`,e[e.endingStyle=k.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var zt={"data-popup-open":``},Bt={"data-popup-open":``,"data-pressed":``},Vt={"data-open":``},Ht={"data-closed":``},Ut={"data-anchor-hidden":``},Wt={open(e){return e?zt:null}},Gt={open(e){return e?Bt:null}},Kt={open(e){return e?Vt:Ht},anchorHidden(e){return e?Ut:null}},qt={...Kt,...O},Jt=`ArrowUp`,Yt=`ArrowDown`,Xt=`ArrowLeft`,Zt=`ArrowRight`,Qt=`Home`,$t=new Set([Jt,Yt,Xt,Zt,Qt,`End`]),en=[`Shift`,`Control`,`Alt`,`Meta`];function tn(e){return j(e)&&e.tagName===`INPUT`}function nn(e){return!!(tn(e)&&e.selectionStart!=null||j(e)&&e.tagName===`TEXTAREA`)}function rn(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=an(e,t,`left`),a=on(e),o=on(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=an(e,t,`top`),r=on(e),i=on(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function an(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function on(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var sn=Y.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),cn={},ln={},un=``;function dn(e,t){return R(e)?e:t}function fn(e,t,n){return/hidden|clip/.test(e.getComputedStyle(dn(t,n)).overflowY)}function pn(e){if(typeof document>`u`)return!1;let t=x(e);return L(t).innerWidth-t.documentElement.clientWidth>0}function mn(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=x(e),n=t.documentElement,r=t.body,i=dn(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function hn(e){let t=x(e),n=t.documentElement,r=t.body,i=dn(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function gn(e){let t=x(e),n=t.documentElement,r=t.body,i=L(n),a=0,o=0,s=!1,l=M.create();if(c&&(i.visualViewport?.scale??1)!==1)return()=>{};function u(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,cn={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},un=n.style.scrollBehavior,ln={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=dn(n,r);if(s=mn(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function d(){Object.assign(n.style,cn),Object.assign(r.style,ln),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=un)}function f(){d(),l.request(u)}u();let p=P(i,`resize`,f);return()=>{l.cancel(),d(),typeof i.removeEventListener==`function`&&p()}}var _n=new class{lockCount=0;restore=null;timeoutLock=m.create();timeoutUnlock=m.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=x(e),n=t.documentElement,r=t.body,i=L(n);if(fn(i,n,r)){let t=new i.MutationObserver(()=>{fn(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=_||!pn(e);this.restore=a?hn(e):gn(e)}};function vn(e=!0,t=null){K(()=>{if(e)return _n.acquire(t)},[e,t])}var yn={1:`bg-surface-1`,2:`bg-surface-2`,3:`bg-surface-3`,4:`bg-surface-4`,5:`bg-surface-5`,6:`bg-surface-6`,7:`bg-surface-7`,8:`bg-surface-8`},bn={1:`shadow-surface-1`,2:`shadow-surface-2`,3:`shadow-surface-3`,4:`shadow-surface-4`,5:`shadow-surface-5`,6:`shadow-surface-6`,7:`shadow-surface-7`,8:`shadow-surface-8`};function xn(e,t=e){let n=Math.round(Math.max(1,Math.min(8,e))),r=Math.round(Math.max(1,Math.min(8,t)));return`${yn[n]} ${bn[r]}`}var Sn=(0,Y.createContext)(1);function Cn(){return(0,Y.useContext)(Sn)}function wn({value:e,children:t}){return(0,Q.jsx)(Sn.Provider,{value:Math.max(1,Math.min(8,e)),children:t})}var Tn=Y.createContext(void 0);function En(e){let t=Y.useContext(Tn);if(!e&&t===void 0)throw Error(pe(27));return t}var Dn=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=En(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return N(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:qt,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),On=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=En(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=be({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,ye(_e,e.nativeEvent))}return N(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),kn=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=En(),c=we(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),N(`p`,e,{ref:t,props:[{id:c},o]})}),An=Y.createContext(void 0);function jn(){let e=Y.useContext(An);if(e===void 0)throw Error(pe(26));return e}var Mn={...Kt,...O,nestedDialogOpen(e){return e?{"data-nested-dialog-open":``}:null}},Nn=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=En(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),ee=d.useState(`floatingId`);jn(),D({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let S=o===void 0?_t(c.context.popupRef):o,C=g>0,te=c.useStateSetter(`popupElement`),ne=N(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:C},props:[f,{id:ee,"aria-labelledby":y,"aria-describedby":l,role:x,...gt,hidden:!m,onKeyDown(e){$t.has(e.key)&&e.stopPropagation()},style:{"--nested-dialogs":g}},s],ref:[t,c.context.popupRef,te],stateAttributesMapping:Mn});return(0,Q.jsx)(ct,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:S,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:ne})}),Pn=Y.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=En(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Q.jsx)(An.Provider,{value:n,children:(0,Q.jsxs)(ie,{ref:t,...r,children:[a&&o===!0&&(0,Q.jsx)(sn,{ref:i.context.internalBackdropRef,inert:ne(!s)}),e.children]})}):null});function Fn({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=Y.useState(0),[d,f]=Y.useState(0),p=l===0,m=dt(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=g(t);if(p&&!i){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||a(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return vn(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{u(e),f(t)}),K(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(l+1,d+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),Dt(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var In={...Rt,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Ln=class extends C{constructor(e,t,n){let r=new kt,i=Rn(e,r,t,n);super(i,zn(r),In)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};xt(n,e,t.trigger),this.update(n)}};function Rn(e,t,n,r=!1){let i={...jt(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e};return i.floatingRootContext=Mt(t,n,r),i}function zn(e){return{popupRef:Y.createRef(),backdropRef:Y.createRef(),internalBackdropRef:Y.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Bn(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=En(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=vt((e,t)=>new Ln({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),ee=b.useState(`mounted`),S=b.useState(`payload`);Ot(b,x),Tt(b);let{forceUnmount:C}=Et(x,b);Y.useImperativeHandle(l,()=>({unmount:C,close:()=>b.setOpen(!1,ye(ve))}),[C,b]);let te=x||ee;return(0,Q.jsxs)(Tn.Provider,{value:b,children:[u&&(0,Q.jsx)(yt,{handle:u,store:b}),te&&(0,Q.jsx)(Fn,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:S}):n]})}function Vn(e){return Bn(`dialog`,e)}var Hn=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=En(),c=we(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),N(`h2`,e,{ref:t,props:[{id:c},o]})}),Un=4;function Wn({...e}){return(0,Q.jsx)(Vn,{"data-slot":`dialog`,...e})}function Gn({...e}){return(0,Q.jsx)(Pn,{"data-slot":`dialog-portal`,...e})}function Kn({className:e,...t}){return(0,Q.jsx)(Dn,{"data-slot":`dialog-overlay`,className:Te(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function qn({className:e,children:t,showCloseButton:n=!0,overlayClassName:r,...i}){let a=Cn(),o=Math.min(a+Un,8);return(0,Q.jsxs)(Gn,{children:[(0,Q.jsx)(Kn,{className:r}),(0,Q.jsxs)(Nn,{"data-slot":`dialog-content`,className:Te(`fixed top-1/2 left-1/2 z-[51] grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl p-4 text-sm text-popover-foreground duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,xn(o),e),...i,children:[(0,Q.jsx)(wn,{value:o,children:t}),n&&(0,Q.jsxs)(On,{"data-slot":`dialog-close`,render:(0,Q.jsx)(w,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Q.jsx)(J,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Jn({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`dialog-header`,className:Te(`flex flex-col gap-2`,e),...t})}function Yn({className:e,showCloseButton:t=!1,children:n,...r}){return(0,Q.jsxs)(`div`,{"data-slot":`dialog-footer`,className:Te(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,Q.jsx)(On,{render:(0,Q.jsx)(w,{variant:`outline`}),children:`Close`})]})}function Xn({className:e,...t}){return(0,Q.jsx)(Hn,{"data-slot":`dialog-title`,className:Te(`font-heading text-base leading-none font-medium`,e),...t})}function Zn({className:e,...t}){return(0,Q.jsx)(kn,{"data-slot":`dialog-description`,className:Te(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}export{et as $,qt as A,St as B,Jt as C,nn as D,en as E,Rt as F,Dt as G,xt as H,kt as I,wt as J,vt as K,gt as L,Wt as M,jt as N,rn as O,Mt as P,$e as Q,yt as R,Zt as S,Qt as T,Tt as U,_t as V,Et as W,dt as X,mt as Y,ct as Z,xn as _,Jn as a,ke as at,Yt as b,Vn as c,Ee as ct,Nn as d,Qe as et,kn as f,Cn as g,wn as h,Yn as i,Z as it,Gt as j,Kt as k,Bn as l,Dn as m,qn as n,Ze as nt,Xn as o,Ae as ot,On as p,Ot as q,Zn as r,Ne as rt,Hn as s,Oe as st,Wn as t,Xe as tt,Pn as u,vn as v,$t as w,Xt as x,sn as y,Ct as z};
|