@qredence/fleet 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/dist/web/client/assets/DialogTitle-BlVq-tcv.js +1 -0
  3. package/dist/web/client/assets/FloatingPortal-D8-EPDs2.js +1 -0
  4. package/dist/web/client/assets/activity-BPIKUzOU.js +1 -0
  5. package/dist/web/client/assets/agents-BMQXA18L.js +2 -0
  6. package/dist/web/client/assets/agents-page-D2soW46O.js +1 -0
  7. package/dist/web/client/assets/alert-CzWGeumf.js +1 -0
  8. package/dist/web/client/assets/alert-dialog-D-e1Pr4q.js +1 -0
  9. package/dist/web/client/assets/artifacts-panel-6JEdy6jU.js +1 -0
  10. package/dist/web/client/assets/badge-CzQFgmVK.js +1 -0
  11. package/dist/web/client/assets/chat-command-palette-Bxr5EkO6.js +1 -0
  12. package/dist/web/client/assets/chat-hpzV6IA6.js +57 -0
  13. package/dist/web/client/assets/chat-queries-ty76G6rK.js +3 -0
  14. package/dist/web/client/assets/clock-3-BwWCSCm_.js +1 -0
  15. package/dist/web/client/assets/{command-imgUMV3r.js → command-xo-NK4xO.js} +1 -1
  16. package/dist/web/client/assets/connectors-E4KW6hBL.js +2 -0
  17. package/dist/web/client/assets/connectors-page-CDzzjCIJ.js +1 -0
  18. package/dist/web/client/assets/create-project-dialog-Db-WhUmP.js +1 -0
  19. package/dist/web/client/assets/dialog-CK8dym6z.js +1 -0
  20. package/dist/web/client/assets/{fork-picker-dialog-Cgi48NnT.js → fork-picker-dialog-DSaFeUii.js} +1 -1
  21. package/dist/web/client/assets/globals-DDDleTbS.css +2 -0
  22. package/dist/web/client/assets/index-Cf8tRpHL.js +13 -0
  23. package/dist/web/client/assets/{input-7g8_nw-Z.js → input-CBoTMPC_.js} +1 -1
  24. package/dist/web/client/assets/{input-group-Nq03Qums.js → input-group-BFubAtz9.js} +1 -1
  25. package/dist/web/client/assets/mcp-connections-section-BsNhp1b2.js +2 -0
  26. package/dist/web/client/assets/message-queue-Btjt9wK2.js +1 -0
  27. package/dist/web/client/assets/{model-selector-list-Cp687pdm.js → model-selector-list-CbDAT0Rw.js} +1 -1
  28. package/dist/web/client/assets/mutation-Da9zdeWr.js +1 -0
  29. package/dist/web/client/assets/notify-BIL0-CGy.js +1 -0
  30. package/dist/web/client/assets/open-panel-action-message-SdA1VU42.js +1 -0
  31. package/dist/web/client/assets/openui-renderer-DG-iML7M.js +291 -0
  32. package/dist/web/client/assets/pencil-Cbgq3ybX.js +1 -0
  33. package/dist/web/client/assets/plus-DUP2JPVG.js +1 -0
  34. package/dist/web/client/assets/product-page-header-Ck6I13CE.js +1 -0
  35. package/dist/web/client/assets/provider-catalog-CLEDlH_v.js +1 -0
  36. package/dist/web/client/assets/provider-label-BItazQ6H.js +1 -0
  37. package/dist/web/client/assets/right-panel-context-CjX-HkDO.js +1 -0
  38. package/dist/web/client/assets/right-panel-registry-BAJ6TuEY.js +2 -0
  39. package/dist/web/client/assets/rotate-ccw-DLkfsmG9.js +1 -0
  40. package/dist/web/client/assets/routes--tnF7d6H.js +14 -0
  41. package/dist/web/client/assets/select-DYh951qi.js +1 -0
  42. package/dist/web/client/assets/{session-activity-panel-Bc4-HSfb.js → session-activity-panel-DwaXiSrS.js} +1 -1
  43. package/dist/web/client/assets/{session-insights-panel-D0v_DKcb.js → session-insights-panel-BXEmuJKf.js} +1 -1
  44. package/dist/web/client/assets/{session-tool-renderer-C7mYeUOs.js → session-tool-renderer-DEABxZG3.js} +25 -25
  45. package/dist/web/client/assets/{session-tree-panel-By9m9tGB.js → session-tree-panel-5QgMvXoX.js} +1 -1
  46. package/dist/web/client/assets/settings-dialog-BomLOETY.js +3 -0
  47. package/dist/web/client/assets/sparkles-CASAe1AI.js +1 -0
  48. package/dist/web/client/assets/{subagent-chat-panel-DsPmLZSf.js → subagent-chat-panel-R2RoX1Yt.js} +1 -1
  49. package/dist/web/client/assets/subagent-transcript-DVZhMo7a.js +1 -0
  50. package/dist/web/client/assets/{subagents-panel-gQ9BLfV3.js → subagents-panel-CMMRUP8F.js} +1 -1
  51. package/dist/web/client/assets/switch-BrxDfsX6.js +1 -0
  52. package/dist/web/client/assets/toast-BNWkgZ0u.js +1 -0
  53. package/dist/web/client/assets/{tool-output-normalizer-CADgEiI4.js → tool-output-normalizer-DDU09Zc6.js} +1 -1
  54. package/dist/web/client/assets/tool-part-normalizer-CF6bmJ0s.js +4 -0
  55. package/dist/web/client/assets/tool-result-7qREIVv_.js +5 -0
  56. package/dist/web/client/assets/tool-timeline-CGhwMeNl.js +2 -0
  57. package/dist/web/client/assets/trash-sm2UyOxe.js +1 -0
  58. package/dist/web/client/assets/types-gIgIxnnG.js +1 -0
  59. package/dist/web/client/assets/useNavigate-CVhM7pag.js +1 -0
  60. package/dist/web/client/assets/useRender-CzJUrRlB.js +1 -0
  61. package/dist/web/client/assets/useScrollLock-BcsteNzT.js +1 -0
  62. package/dist/web/client/assets/with-selector-B_VDO56x.js +1 -0
  63. package/dist/web/client/bundle-budget.json +6 -6
  64. package/dist/web/server/{_tanstack-start-manifest_v-BiNPG4xt-BZTMSM2I.js → _tanstack-start-manifest_v-Io433TLr-YWPNQWQI.js} +44 -23
  65. package/dist/web/server/agents-DOgCHixY-KUZP2VDO.js +22 -0
  66. package/dist/web/server/agents-page-BdiR9H8w-M6X6SXMF.js +215 -0
  67. package/dist/web/server/{artifacts-panel-CqGBNU4q-UHNMC7PK.js → artifacts-panel-cYqS54cM-K6SF3K6W.js} +27 -17
  68. package/dist/web/server/{chat-command-palette-B94-zIEz-ES2ZB4ZF.js → chat-command-palette-BDnwcymZ-DSTFIAOD.js} +22 -13
  69. package/dist/web/server/chunk-2ETDIMNM.js +40 -0
  70. package/dist/web/server/{chunk-K67IDUAI.js → chunk-2OC2FKHR.js} +42 -32
  71. package/dist/web/server/{chunk-2VKVSL6Y.js → chunk-35RIM6VP.js} +128 -127
  72. package/dist/web/server/{chunk-5GUEYYYO.js → chunk-37EK2TYH.js} +4591 -13688
  73. package/dist/web/server/chunk-5MOXRFX6.js +826 -0
  74. package/dist/web/server/chunk-6GYLXDX3.js +588 -0
  75. package/dist/web/server/chunk-7DQQMT5V.js +8993 -0
  76. package/dist/web/server/chunk-APOS34PW.js +8965 -0
  77. package/dist/web/server/{chunk-YQO36OP6.js → chunk-AXN2OBPF.js} +2 -4
  78. package/dist/web/server/chunk-BD7YKYWL.js +1007 -0
  79. package/dist/web/server/chunk-BLGKLQJG.js +432 -0
  80. package/dist/web/server/{chunk-BAHZXA4D.js → chunk-BZ2EAUZZ.js} +10 -12
  81. package/dist/web/server/chunk-C5XHGLET.js +193 -0
  82. package/dist/web/server/chunk-CE7U5QB2.js +42 -0
  83. package/dist/web/server/{chunk-E6T36NM5.js → chunk-FI3UF2GW.js} +36 -353
  84. package/dist/web/server/{chunk-LTTBT3J7.js → chunk-FNV3WZXL.js} +5 -9
  85. package/dist/web/server/{chunk-2FHYWKDN.js → chunk-FSQWWR2M.js} +46 -16
  86. package/dist/web/server/chunk-FT7HNDR5.js +143 -0
  87. package/dist/web/server/chunk-GNXIDE26.js +44 -0
  88. package/dist/web/server/{chunk-EAKPTSWR.js → chunk-HAFELESQ.js} +5 -7
  89. package/dist/web/server/{chunk-WSK55TKE.js → chunk-KBMRRJQN.js} +96 -10
  90. package/dist/web/server/chunk-KSGGSGOA.js +50 -0
  91. package/dist/web/server/{chunk-SGAQVAYL.js → chunk-NSFKPEFI.js} +2 -2
  92. package/dist/web/server/chunk-NZCEQWK2.js +6891 -0
  93. package/dist/web/server/chunk-OO7NBFQQ.js +15 -0
  94. package/dist/web/server/{chunk-EL2JCDAM.js → chunk-PQVTLG3E.js} +9 -9
  95. package/dist/web/server/{chunk-LQM6QR7S.js → chunk-Q4ECIATK.js} +61 -47
  96. package/dist/web/server/chunk-QOZCYKMA.js +769 -0
  97. package/dist/web/server/{chunk-CZLGB3NE.js → chunk-R4BS3KYI.js} +2 -4
  98. package/dist/web/server/{chunk-FB2QLQTN.js → chunk-RHJEOG37.js} +12 -13
  99. package/dist/web/server/chunk-RX2ZJARF.js +73 -0
  100. package/dist/web/server/chunk-TXZDDJCT.js +5115 -0
  101. package/dist/web/server/{chunk-OAYEN3JV.js → chunk-VDEUVEWL.js} +2253 -1
  102. package/dist/web/server/{chunk-ABMGW6QH.js → chunk-W2GI7NRX.js} +16140 -15708
  103. package/dist/web/server/{chunk-SI5IQSG4.js → chunk-W7GGECTL.js} +8 -7
  104. package/dist/web/server/connectors-Dv_uPdv0-2X5VWQXK.js +22 -0
  105. package/dist/web/server/connectors-page-DW75T-uH-EKRHUZ6K.js +66 -0
  106. package/dist/web/server/{create-project-dialog-CFPX6Ihl-EO4XTINS.js → create-project-dialog-BS5Sva46-BO4RLW2Q.js} +25 -14
  107. package/dist/web/server/{fork-picker-dialog-B2RBFzoZ-R6GXPSPL.js → fork-picker-dialog-DFpKOdAw-JPLJSYYU.js} +7 -10
  108. package/dist/web/server/{markdown-BvCfOB26-VDH4YOQD.js → markdown-Cc8V9dOF-JTNTJKQU.js} +5 -6
  109. package/dist/web/server/{markdown-code-SYc-BQvp-MR4FXT5C.js → markdown-code-gaRnbgNM-V5LIRYCD.js} +7 -8
  110. package/dist/web/server/{message-queue-D32rLiJo-HEBRGH5B.js → message-queue-nQ2_kU82-KKSLYR4S.js} +7 -14
  111. package/dist/web/server/{model-selector-list-DKzt_xEN-5ZPU6XDY.js → model-selector-list-By_G7_Hr-GXT27BZO.js} +12 -14
  112. package/dist/web/server/{openui-renderer-CeVtOdYl-PY37PCJI.js → openui-renderer-Q31y65CQ-QNVSP4NN.js} +20 -13
  113. package/dist/web/server/{prompt-suggestions-CpTK_fHV-Q4ILLZKC.js → prompt-suggestions-B67Uy5Rk-5SMTSIFQ.js} +5 -4
  114. package/dist/web/server/{repl-panel-1kSS1UGd-DDM5ADGZ.js → repl-panel-1kSS1UGd-POXRYDDJ.js} +2 -3
  115. package/dist/web/server/{resources-panel-S4NHlpz7-NF7WYYSR.js → resources-panel-CH8sG0Od-4BZN6SLY.js} +18 -10
  116. package/dist/web/server/router-8EzTM9Eq-COVGJKKX.js +23 -0
  117. package/dist/web/server/routes-88H0fiN3-WIAZJ3RT.js +124 -0
  118. package/dist/web/server/server.js +3 -3
  119. package/dist/web/server/{session-activity-panel-Bz2GrdMk-PCOXG46X.js → session-activity-panel-CgSOde03-B5RCAGB4.js} +18 -10
  120. package/dist/web/server/{session-insights-panel-CfMX2NRu-6HWZTTAC.js → session-insights-panel-BiVObm_6-AP4FITT7.js} +2 -12
  121. package/dist/web/server/{session-reasoning-panel-CpiTdyQz-O3B5CDKS.js → session-reasoning-panel-Dmny6YTk-D3HQV2YB.js} +17 -9
  122. package/dist/web/server/session-tool-renderer-BrnTO2w3-V6EE6AB2.js +34 -0
  123. package/dist/web/server/{session-tree-panel-CzkE0RFB-P4KWA7S2.js → session-tree-panel-BEqR_cAJ-TZS7VRCB.js} +18 -11
  124. package/dist/web/server/{settings-dialog-BUgVNpr1-THSYIOZL.js → settings-dialog-DkesVBrS-BAAA3YNU.js} +238 -847
  125. package/dist/web/server/{subagent-chat-panel-mw3kEFfK-CDYX7LST.js → subagent-chat-panel-Bfmt1bCE-DKDVH3NJ.js} +23 -15
  126. package/dist/web/server/{subagents-panel-2ZJfYrXG-NDJKHJHD.js → subagents-panel-ChJDDvad-GNCHDTPB.js} +24 -17
  127. package/dist/web/server/{workspace-panel-xznrPDLt-QCJRZOF3.js → workspace-panel-Cij_JylD-WPYSV5FA.js} +23 -15
  128. package/package.json +1 -1
  129. package/dist/web/client/assets/DialogTitle-RY2UDuCY.js +0 -1
  130. package/dist/web/client/assets/FloatingPortal-XC0MCNnD.js +0 -1
  131. package/dist/web/client/assets/action-swap-BWRUNKQA.js +0 -1
  132. package/dist/web/client/assets/alert-dialog-DGNvg0B1.js +0 -1
  133. package/dist/web/client/assets/artifacts-panel-BGXpKRJ7.js +0 -1
  134. package/dist/web/client/assets/badge-DM06QVqB.js +0 -57
  135. package/dist/web/client/assets/chat-command-palette-PenyaZBw.js +0 -1
  136. package/dist/web/client/assets/create-project-dialog-C00d5yCq.js +0 -1
  137. package/dist/web/client/assets/dialog-zCNOQI63.js +0 -1
  138. package/dist/web/client/assets/globals-BuMuB_ea.css +0 -2
  139. package/dist/web/client/assets/index-BqBdQGWs.js +0 -13
  140. package/dist/web/client/assets/message-queue-sSljtjYz.js +0 -1
  141. package/dist/web/client/assets/mutation-DOi2Qgfa.js +0 -1
  142. package/dist/web/client/assets/notify-Cqdu6EV8.js +0 -1
  143. package/dist/web/client/assets/openui-renderer-BdYTcn-_.js +0 -291
  144. package/dist/web/client/assets/provider-label-QrVOwKBO.js +0 -1
  145. package/dist/web/client/assets/right-panel-context-DHKWoetk.js +0 -1
  146. package/dist/web/client/assets/right-panel-registry-BaLZiKny.js +0 -2
  147. package/dist/web/client/assets/routes-BkFkhfO3.js +0 -16
  148. package/dist/web/client/assets/select-BhV4ikeN.js +0 -1
  149. package/dist/web/client/assets/settings-dialog-Dpt4Ha_m.js +0 -2
  150. package/dist/web/client/assets/sparkles-BwVa9zQJ.js +0 -1
  151. package/dist/web/client/assets/subagent-transcript-CNQ9wGk2.js +0 -1
  152. package/dist/web/client/assets/switch-C7Myu-Dt.js +0 -1
  153. package/dist/web/client/assets/toast-DlbKi6K-.js +0 -1
  154. package/dist/web/client/assets/tool-part-normalizer-CYK62WZM.js +0 -4
  155. package/dist/web/client/assets/tool-result-bjAGZ2qm.js +0 -5
  156. package/dist/web/client/assets/tool-timeline-eNqH1zj7.js +0 -2
  157. package/dist/web/client/assets/types-D5hZ8IyV.js +0 -1
  158. package/dist/web/client/assets/useRender-Bbk_fl72.js +0 -1
  159. package/dist/web/server/chunk-2PAW6K4Q.js +0 -56
  160. package/dist/web/server/chunk-7L5PCCYR.js +0 -2287
  161. package/dist/web/server/chunk-FB3UHLLN.js +0 -49
  162. package/dist/web/server/chunk-OSPDNT7S.js +0 -25404
  163. package/dist/web/server/router-DVKxZik_-254GZAJW.js +0 -30
  164. package/dist/web/server/routes-BTxAklRp-UM7ZTLLP.js +0 -140
  165. package/dist/web/server/session-tool-renderer-BZiOxtt1-T3ZGAQKX.js +0 -26
@@ -0,0 +1,1007 @@
1
+ import {
2
+ COMPOSITE_KEYS,
3
+ FOCUSABLE_POPUP_PROPS,
4
+ InternalBackdrop,
5
+ PopupHandleAttachment,
6
+ createDefaultInitialFocus,
7
+ createPopupOpenState,
8
+ useBaseUiId,
9
+ useImplicitActiveTrigger,
10
+ useOpenMethodTriggerProps,
11
+ useOpenStateTransitions,
12
+ usePopupInteractionProps,
13
+ usePopupRootStore,
14
+ usePopupRootSync,
15
+ useScrollLock,
16
+ useTriggerDataForwarding
17
+ } from "./chunk-TXZDDJCT.js";
18
+ import {
19
+ AnimationFrame,
20
+ CLICK_TRIGGER_IDENTIFIER,
21
+ CommonPopupDataAttributes_exports,
22
+ FloatingFocusManager,
23
+ FloatingPortal,
24
+ FloatingRootStore,
25
+ PopupTriggerMap,
26
+ ReactStore,
27
+ contains,
28
+ createChangeEventDetails,
29
+ fastComponentRef,
30
+ getTarget,
31
+ inertValue,
32
+ popupStateMapping,
33
+ popupTransitionStateMapping,
34
+ reason_parts_exports,
35
+ transitionStatusMapping,
36
+ triggerOpenStateMapping,
37
+ useClick,
38
+ useDismiss,
39
+ useOpenChangeComplete
40
+ } from "./chunk-APOS34PW.js";
41
+ import {
42
+ EMPTY_OBJECT,
43
+ NOOP,
44
+ formatErrorMessage_default,
45
+ useButton,
46
+ useIsoLayoutEffect,
47
+ useRenderElement
48
+ } from "./chunk-FSQWWR2M.js";
49
+
50
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/backdrop/DialogBackdrop.mjs
51
+ import * as React2 from "react";
52
+
53
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/root/DialogRootContext.mjs
54
+ import * as React from "react";
55
+ var DialogRootContext = /* @__PURE__ */ React.createContext(void 0);
56
+ if (process.env.NODE_ENV !== "production") DialogRootContext.displayName = "DialogRootContext";
57
+ function useDialogRootContext(optional) {
58
+ const store = React.useContext(DialogRootContext);
59
+ if (!optional && store === void 0) {
60
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>." : formatErrorMessage_default(27));
61
+ }
62
+ return store;
63
+ }
64
+
65
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/backdrop/DialogBackdrop.mjs
66
+ var DialogBackdrop = /* @__PURE__ */ React2.forwardRef(function DialogBackdrop2(componentProps, forwardedRef) {
67
+ const {
68
+ render,
69
+ className,
70
+ style,
71
+ forceRender = false,
72
+ ...elementProps
73
+ } = componentProps;
74
+ const store = useDialogRootContext();
75
+ const open2 = store.useState("open");
76
+ const nested = store.useState("nested");
77
+ const mounted = store.useState("mounted");
78
+ const transitionStatus = store.useState("transitionStatus");
79
+ const state = {
80
+ open: open2,
81
+ transitionStatus
82
+ };
83
+ return useRenderElement("div", componentProps, {
84
+ state,
85
+ ref: [store.context.backdropRef, forwardedRef],
86
+ stateAttributesMapping: popupTransitionStateMapping,
87
+ props: [{
88
+ role: "presentation",
89
+ hidden: !mounted,
90
+ style: {
91
+ userSelect: "none",
92
+ WebkitUserSelect: "none"
93
+ }
94
+ }, elementProps],
95
+ enabled: forceRender || !nested
96
+ });
97
+ });
98
+ if (process.env.NODE_ENV !== "production") DialogBackdrop.displayName = "DialogBackdrop";
99
+
100
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/close/DialogClose.mjs
101
+ import * as React3 from "react";
102
+ var DialogClose = /* @__PURE__ */ React3.forwardRef(function DialogClose2(componentProps, forwardedRef) {
103
+ const {
104
+ render,
105
+ className,
106
+ style,
107
+ disabled = false,
108
+ nativeButton = true,
109
+ ...elementProps
110
+ } = componentProps;
111
+ const store = useDialogRootContext();
112
+ const open2 = store.useState("open");
113
+ const {
114
+ getButtonProps,
115
+ buttonRef
116
+ } = useButton({
117
+ disabled,
118
+ native: nativeButton
119
+ });
120
+ const state = {
121
+ disabled
122
+ };
123
+ function handleClick(event) {
124
+ if (open2) {
125
+ store.setOpen(false, createChangeEventDetails(reason_parts_exports.closePress, event.nativeEvent));
126
+ }
127
+ }
128
+ return useRenderElement("button", componentProps, {
129
+ state,
130
+ ref: [forwardedRef, buttonRef],
131
+ props: [{
132
+ onClick: handleClick
133
+ }, elementProps, getButtonProps]
134
+ });
135
+ });
136
+ if (process.env.NODE_ENV !== "production") DialogClose.displayName = "DialogClose";
137
+
138
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/description/DialogDescription.mjs
139
+ import * as React4 from "react";
140
+ var DialogDescription = /* @__PURE__ */ React4.forwardRef(function DialogDescription2(componentProps, forwardedRef) {
141
+ const {
142
+ render,
143
+ className,
144
+ style,
145
+ id: idProp,
146
+ ...elementProps
147
+ } = componentProps;
148
+ const store = useDialogRootContext();
149
+ const id = useBaseUiId(idProp);
150
+ store.useSyncedValueWithCleanup("descriptionElementId", id);
151
+ return useRenderElement("p", componentProps, {
152
+ ref: forwardedRef,
153
+ props: [{
154
+ id
155
+ }, elementProps]
156
+ });
157
+ });
158
+ if (process.env.NODE_ENV !== "production") DialogDescription.displayName = "DialogDescription";
159
+
160
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/popup/DialogPopup.mjs
161
+ import * as React7 from "react";
162
+
163
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popups/popupHandle.mjs
164
+ var BasePopupHandle = class {
165
+ /**
166
+ * Stores of every root currently using this handle, in attach order. A handle is meant to be used
167
+ * by a single mounted root, but roots can transiently overlap (e.g. during an animated route
168
+ * transition), so this stack lets `attachStore`'s cleanup restore the previous root instead of
169
+ * leaving a still-mounted root uncontrollable when a newer overlapping root detaches first.
170
+ */
171
+ attachedStores = [];
172
+ /**
173
+ * Store of the root that currently controls the handle: the most recently attached one still
174
+ * mounted, or `null` when no root is attached. Imperative methods are no-ops while this is `null`.
175
+ */
176
+ attachedStoreValue = null;
177
+ /**
178
+ * Listeners notified when `attachedStore` changes, so detached triggers can follow the store pointer.
179
+ */
180
+ storeListeners = /* @__PURE__ */ new Set();
181
+ /**
182
+ * Creates a handle backed by the store used while no root is attached.
183
+ *
184
+ * @param fallbackStore Inert, closed store handed to detached triggers while no root is attached,
185
+ * so they can render and register without a mounted root. Triggers register into whichever store
186
+ * `store` currently resolves to, so while detached they live in this store's trigger map and
187
+ * migrate themselves to the root's store (and back) as it attaches/detaches.
188
+ * @param componentName Component name used to prefix dev warnings, e.g. `'Menu'` produces
189
+ * `MenuHandle.open()` in warning text.
190
+ * @param throwOnMissingTrigger Whether `open(triggerId)` throws when no trigger with that id is
191
+ * registered. Anchored popups (Menu, Popover, Tooltip, PreviewCard) need a trigger to anchor to,
192
+ * so they throw; Dialog is not anchored and instead opens unassociated with a dev warning.
193
+ */
194
+ constructor(fallbackStore, componentName, throwOnMissingTrigger = true) {
195
+ this.fallbackStore = fallbackStore;
196
+ this.componentName = componentName;
197
+ this.throwOnMissingTrigger = throwOnMissingTrigger;
198
+ }
199
+ get attachedStore() {
200
+ return this.attachedStoreValue;
201
+ }
202
+ /**
203
+ * Store that detached triggers read from: the attached root's store, or an inert fallback store
204
+ * used while no root is attached.
205
+ * @internal
206
+ */
207
+ get store() {
208
+ return this.attachedStoreValue ?? this.fallbackStore;
209
+ }
210
+ /**
211
+ * Stable fallback store used for server rendering and hydration. Root stores cannot be recorded on
212
+ * the handle during render because a handle can be shared by concurrent server-rendered requests.
213
+ * @internal
214
+ */
215
+ get serverStore() {
216
+ return this.fallbackStore;
217
+ }
218
+ /**
219
+ * Subscribes to changes of the attached store pointer so detached triggers re-render and re-bind
220
+ * when a root attaches or detaches. Returns a function that removes the listener.
221
+ * @internal
222
+ */
223
+ subscribeStore(listener) {
224
+ this.storeListeners.add(listener);
225
+ return () => {
226
+ this.storeListeners.delete(listener);
227
+ };
228
+ }
229
+ /**
230
+ * Points the handle at a root's store and notifies subscribers so detached triggers re-render and
231
+ * re-register into it (their registration effect migrates them when the store pointer changes).
232
+ * Returns a cleanup function that detaches the store again.
233
+ * @internal
234
+ */
235
+ attachStore(newStore) {
236
+ this.attachedStores.push(newStore);
237
+ this.setActiveStore(newStore);
238
+ if (process.env.NODE_ENV !== "production") {
239
+ if (this.attachedStores.length > 1) {
240
+ const dev = this;
241
+ (dev.overlapWarningFrame ??= AnimationFrame.create()).request(() => {
242
+ if (this.attachedStores.length > 1) {
243
+ console.warn("Base UI: A handle is attached to more than one mounted root at the same time. The most recently mounted root takes over and the previous one stops being controlled by the handle. A handle should be used by a single root that stays mounted for the lifetime of the handle.");
244
+ }
245
+ });
246
+ }
247
+ }
248
+ return () => {
249
+ const index = this.attachedStores.lastIndexOf(newStore);
250
+ if (index !== -1) {
251
+ this.attachedStores.splice(index, 1);
252
+ }
253
+ this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null);
254
+ };
255
+ }
256
+ /**
257
+ * Sets the store that currently controls the handle and notifies subscribers when it changes, so
258
+ * detached triggers re-render and migrate their registration to the new store.
259
+ */
260
+ setActiveStore(store) {
261
+ if (this.attachedStoreValue !== store) {
262
+ this.attachedStoreValue = store;
263
+ this.storeListeners.forEach((listener) => {
264
+ listener();
265
+ });
266
+ }
267
+ }
268
+ /**
269
+ * Opens the attached root's store and associates it with the trigger with the given id, or a
270
+ * no-op (with a dev warning) while no root is attached. Shared by every concrete handle's public
271
+ * `open()` method, which only narrows the parameter type.
272
+ *
273
+ * When a trigger id is given but no matching trigger is registered, anchored popups throw (see
274
+ * `throwOnMissingTrigger`); Dialog opens unassociated with a dev warning instead.
275
+ *
276
+ * This method should only be called in an event handler or an effect (not during rendering).
277
+ *
278
+ * @param triggerId ID of the trigger to associate with the popup, or `null`/`undefined` to open
279
+ * without associating any trigger.
280
+ */
281
+ openByTrigger(triggerId) {
282
+ const attachedStore = this.attachedStore;
283
+ if (attachedStore === null) {
284
+ if (process.env.NODE_ENV !== "production") {
285
+ console.warn(`Base UI: ${this.componentName}Handle.open() was called while no root using this handle is mounted. The call was ignored; mount a root with this handle before opening it imperatively.`);
286
+ }
287
+ return;
288
+ }
289
+ let triggerElement;
290
+ if (triggerId) {
291
+ for (let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1) {
292
+ triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId);
293
+ }
294
+ triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId);
295
+ }
296
+ if (triggerId && !triggerElement) {
297
+ if (this.throwOnMissingTrigger) {
298
+ throw new Error(process.env.NODE_ENV !== "production" ? `Base UI: ${this.componentName}Handle.open() was called with the trigger id "${triggerId}", but no matching trigger is registered with this handle. An anchored popup cannot open without a trigger to anchor to. Pass the id of a mounted ${this.componentName}.Trigger that has this handle set on its "handle" prop.` : formatErrorMessage_default(99, this.componentName, triggerId, this.componentName));
299
+ }
300
+ if (process.env.NODE_ENV !== "production") {
301
+ console.warn(`Base UI: ${this.componentName}Handle.open: No trigger found with id "${triggerId}". The popup will open, but the trigger will not be associated with it.`);
302
+ }
303
+ }
304
+ attachedStore.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement));
305
+ }
306
+ /**
307
+ * Closes the popup by setting the attached root's store to closed, or a no-op (with a dev warning)
308
+ * while no root is attached. Shared by every concrete handle's public `close()` method.
309
+ *
310
+ * This method should only be called in an event handler or an effect (not during rendering).
311
+ */
312
+ closePopup() {
313
+ const attachedStore = this.attachedStore;
314
+ if (attachedStore === null) {
315
+ if (process.env.NODE_ENV !== "production") {
316
+ console.warn(`Base UI: ${this.componentName}Handle.close() was called while no root using this handle is mounted. The call was ignored.`);
317
+ }
318
+ return;
319
+ }
320
+ attachedStore.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction));
321
+ }
322
+ };
323
+
324
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popups/store.mjs
325
+ function createInitialPopupStoreState(triggerElements, floatingId, nested = false) {
326
+ return {
327
+ open: false,
328
+ openProp: void 0,
329
+ mounted: false,
330
+ transitionStatus: void 0,
331
+ floatingRootContext: new FloatingRootStore({
332
+ open: false,
333
+ transitionStatus: void 0,
334
+ floatingElement: null,
335
+ referenceElement: null,
336
+ triggerElements,
337
+ floatingId,
338
+ syncOnly: true,
339
+ nested,
340
+ onOpenChange: void 0
341
+ }),
342
+ floatingId,
343
+ triggerCount: 0,
344
+ preventUnmountingOnClose: false,
345
+ payload: void 0,
346
+ activeTriggerId: null,
347
+ activeTriggerElement: null,
348
+ triggerIdProp: void 0,
349
+ popupElement: null,
350
+ positionerElement: null,
351
+ activeTriggerProps: EMPTY_OBJECT,
352
+ inactiveTriggerProps: EMPTY_OBJECT,
353
+ popupProps: EMPTY_OBJECT
354
+ };
355
+ }
356
+ var activeTriggerIdSelector = (state) => state.triggerIdProp ?? state.activeTriggerId;
357
+ var openSelector = (state) => state.openProp ?? state.open;
358
+ var popupIdSelector = (state) => {
359
+ const popupId = state.popupElement?.id ?? state.floatingId;
360
+ return popupId || void 0;
361
+ };
362
+ function triggerOwnsOpenPopup(state, triggerId) {
363
+ return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) === triggerId;
364
+ }
365
+ function triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) {
366
+ if (triggerOwnsOpenPopup(state, triggerId)) {
367
+ return true;
368
+ }
369
+ return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) == null && state.triggerCount === 1;
370
+ }
371
+ var popupStoreSelectors = {
372
+ open: openSelector,
373
+ mounted: (state) => state.mounted,
374
+ transitionStatus: (state) => state.transitionStatus,
375
+ floatingRootContext: (state) => state.floatingRootContext,
376
+ triggerCount: (state) => state.triggerCount,
377
+ preventUnmountingOnClose: (state) => state.preventUnmountingOnClose,
378
+ payload: (state) => state.payload,
379
+ activeTriggerId: activeTriggerIdSelector,
380
+ activeTriggerElement: (state) => state.mounted ? state.activeTriggerElement : null,
381
+ popupId: popupIdSelector,
382
+ /**
383
+ * Whether the trigger with the given ID was used to open the popup.
384
+ */
385
+ isTriggerActive: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId,
386
+ /**
387
+ * Whether the popup is open and was activated by a trigger with the given ID.
388
+ */
389
+ isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId),
390
+ /**
391
+ * Whether the popup is mounted and was activated by a trigger with the given ID.
392
+ */
393
+ isMountedByTrigger: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.mounted,
394
+ triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps,
395
+ /**
396
+ * Popup id for the trigger that currently owns the open popup.
397
+ */
398
+ triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : void 0,
399
+ popupProps: (state) => state.popupProps,
400
+ popupElement: (state) => state.popupElement,
401
+ positionerElement: (state) => state.positionerElement
402
+ };
403
+
404
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs
405
+ import * as React5 from "react";
406
+ import { useSyncExternalStore } from "use-sync-external-store/shim";
407
+ function usePopupHandleStore(handle) {
408
+ const subscribe = React5.useCallback((listener) => {
409
+ if (handle === void 0) {
410
+ return NOOP;
411
+ }
412
+ return handle.subscribeStore(listener);
413
+ }, [handle]);
414
+ const getSnapshot = React5.useCallback(() => {
415
+ return handle === void 0 ? void 0 : handle.store;
416
+ }, [handle]);
417
+ return useSyncExternalStore(subscribe, getSnapshot, () => handle?.serverStore);
418
+ }
419
+
420
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/portal/DialogPortalContext.mjs
421
+ import * as React6 from "react";
422
+ var DialogPortalContext = /* @__PURE__ */ React6.createContext(void 0);
423
+ if (process.env.NODE_ENV !== "production") DialogPortalContext.displayName = "DialogPortalContext";
424
+ function useDialogPortalContext() {
425
+ const value = React6.useContext(DialogPortalContext);
426
+ if (value === void 0) {
427
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Dialog.Portal> is missing." : formatErrorMessage_default(26));
428
+ }
429
+ return value;
430
+ }
431
+
432
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/popup/DialogPopupCssVars.mjs
433
+ var nestedDialogs = "--nested-dialogs";
434
+
435
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/popup/DialogPopupDataAttributes.mjs
436
+ var open = CommonPopupDataAttributes_exports.open;
437
+ var closed = CommonPopupDataAttributes_exports.closed;
438
+ var startingStyle = CommonPopupDataAttributes_exports.startingStyle;
439
+ var endingStyle = CommonPopupDataAttributes_exports.endingStyle;
440
+ var nestedDialogOpen = "data-nested-dialog-open";
441
+
442
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/utils/stateAttributesMapping.mjs
443
+ var dialogStateAttributesMapping = {
444
+ ...popupStateMapping,
445
+ ...transitionStatusMapping,
446
+ nestedDialogOpen(value) {
447
+ return value ? {
448
+ [nestedDialogOpen]: ""
449
+ } : null;
450
+ }
451
+ };
452
+
453
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/popup/DialogPopup.mjs
454
+ import { jsx as _jsx } from "react/jsx-runtime";
455
+ var DialogPopup = /* @__PURE__ */ React7.forwardRef(function DialogPopup2(componentProps, forwardedRef) {
456
+ const {
457
+ render,
458
+ className,
459
+ style,
460
+ finalFocus,
461
+ initialFocus,
462
+ ...elementProps
463
+ } = componentProps;
464
+ const store = useDialogRootContext();
465
+ const descriptionElementId = store.useState("descriptionElementId");
466
+ const disablePointerDismissal = store.useState("disablePointerDismissal");
467
+ const floatingRootContext = store.useState("floatingRootContext");
468
+ const rootPopupProps = store.useState("popupProps");
469
+ const modal = store.useState("modal");
470
+ const mounted = store.useState("mounted");
471
+ const nested = store.useState("nested");
472
+ const nestedOpenDialogCount = store.useState("nestedOpenDialogCount");
473
+ const open2 = store.useState("open");
474
+ const openMethod = store.useState("openMethod");
475
+ const titleElementId = store.useState("titleElementId");
476
+ const transitionStatus = store.useState("transitionStatus");
477
+ const role = store.useState("role");
478
+ const floatingId = floatingRootContext.useState("floatingId");
479
+ useDialogPortalContext();
480
+ useOpenChangeComplete({
481
+ open: open2,
482
+ ref: store.context.popupRef,
483
+ onComplete() {
484
+ if (open2) {
485
+ store.context.onOpenChangeComplete?.(true);
486
+ }
487
+ }
488
+ });
489
+ const resolvedInitialFocus = initialFocus === void 0 ? createDefaultInitialFocus(store.context.popupRef) : initialFocus;
490
+ const nestedDialogOpen2 = nestedOpenDialogCount > 0;
491
+ const setPopupElement = store.useStateSetter("popupElement");
492
+ const state = {
493
+ open: open2,
494
+ nested,
495
+ transitionStatus,
496
+ nestedDialogOpen: nestedDialogOpen2
497
+ };
498
+ const element = useRenderElement("div", componentProps, {
499
+ state,
500
+ props: [rootPopupProps, {
501
+ id: floatingId,
502
+ "aria-labelledby": titleElementId,
503
+ "aria-describedby": descriptionElementId,
504
+ role,
505
+ ...FOCUSABLE_POPUP_PROPS,
506
+ hidden: !mounted,
507
+ onKeyDown(event) {
508
+ if (COMPOSITE_KEYS.has(event.key)) {
509
+ event.stopPropagation();
510
+ }
511
+ },
512
+ style: {
513
+ [nestedDialogs]: nestedOpenDialogCount
514
+ }
515
+ }, elementProps],
516
+ ref: [forwardedRef, store.context.popupRef, setPopupElement],
517
+ stateAttributesMapping: dialogStateAttributesMapping
518
+ });
519
+ return /* @__PURE__ */ _jsx(FloatingFocusManager, {
520
+ context: floatingRootContext,
521
+ openInteractionType: openMethod,
522
+ disabled: !mounted,
523
+ closeOnFocusOut: !disablePointerDismissal,
524
+ initialFocus: resolvedInitialFocus,
525
+ returnFocus: finalFocus,
526
+ modal: modal !== false,
527
+ restoreFocus: "popup",
528
+ children: element
529
+ });
530
+ });
531
+ if (process.env.NODE_ENV !== "production") DialogPopup.displayName = "DialogPopup";
532
+
533
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/portal/DialogPortal.mjs
534
+ import * as React8 from "react";
535
+ import { jsx as _jsx2, jsxs as _jsxs } from "react/jsx-runtime";
536
+ var DialogPortal = /* @__PURE__ */ React8.forwardRef(function DialogPortal2(props, forwardedRef) {
537
+ const {
538
+ keepMounted = false,
539
+ ...portalProps
540
+ } = props;
541
+ const store = useDialogRootContext();
542
+ const mounted = store.useState("mounted");
543
+ const modal = store.useState("modal");
544
+ const open2 = store.useState("open");
545
+ const shouldRender = mounted || keepMounted;
546
+ if (!shouldRender) {
547
+ return null;
548
+ }
549
+ return /* @__PURE__ */ _jsx2(DialogPortalContext.Provider, {
550
+ value: keepMounted,
551
+ children: /* @__PURE__ */ _jsxs(FloatingPortal, {
552
+ ref: forwardedRef,
553
+ ...portalProps,
554
+ children: [mounted && modal === true && /* @__PURE__ */ _jsx2(InternalBackdrop, {
555
+ ref: store.context.internalBackdropRef,
556
+ inert: inertValue(!open2)
557
+ }), props.children]
558
+ })
559
+ });
560
+ });
561
+ if (process.env.NODE_ENV !== "production") DialogPortal.displayName = "DialogPortal";
562
+
563
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/title/DialogTitle.mjs
564
+ import * as React9 from "react";
565
+ var DialogTitle = /* @__PURE__ */ React9.forwardRef(function DialogTitle2(componentProps, forwardedRef) {
566
+ const {
567
+ render,
568
+ className,
569
+ style,
570
+ id: idProp,
571
+ ...elementProps
572
+ } = componentProps;
573
+ const store = useDialogRootContext();
574
+ const id = useBaseUiId(idProp);
575
+ store.useSyncedValueWithCleanup("titleElementId", id);
576
+ return useRenderElement("h2", componentProps, {
577
+ ref: forwardedRef,
578
+ props: [{
579
+ id
580
+ }, elementProps]
581
+ });
582
+ });
583
+ if (process.env.NODE_ENV !== "production") DialogTitle.displayName = "DialogTitle";
584
+
585
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/viewport/DialogViewport.mjs
586
+ import * as React10 from "react";
587
+ var DialogViewport = /* @__PURE__ */ React10.forwardRef(function DialogViewport2(componentProps, forwardedRef) {
588
+ const {
589
+ render,
590
+ className,
591
+ style,
592
+ children,
593
+ ...elementProps
594
+ } = componentProps;
595
+ const keepMounted = useDialogPortalContext();
596
+ const store = useDialogRootContext();
597
+ const open2 = store.useState("open");
598
+ const nested = store.useState("nested");
599
+ const transitionStatus = store.useState("transitionStatus");
600
+ const nestedOpenDialogCount = store.useState("nestedOpenDialogCount");
601
+ const mounted = store.useState("mounted");
602
+ const setViewportElement = store.useStateSetter("viewportElement");
603
+ const nestedDialogOpen2 = nestedOpenDialogCount > 0;
604
+ const state = {
605
+ open: open2,
606
+ nested,
607
+ transitionStatus,
608
+ nestedDialogOpen: nestedDialogOpen2
609
+ };
610
+ const shouldRender = keepMounted || mounted;
611
+ return useRenderElement("div", componentProps, {
612
+ enabled: shouldRender,
613
+ state,
614
+ ref: [forwardedRef, setViewportElement],
615
+ stateAttributesMapping: dialogStateAttributesMapping,
616
+ props: [{
617
+ role: "presentation",
618
+ hidden: !mounted,
619
+ style: {
620
+ pointerEvents: !open2 ? "none" : void 0
621
+ },
622
+ children
623
+ }, elementProps]
624
+ });
625
+ });
626
+ if (process.env.NODE_ENV !== "production") DialogViewport.displayName = "DialogViewport";
627
+
628
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/root/useRenderDialogRoot.mjs
629
+ import * as React13 from "react";
630
+
631
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/root/useDialogRoot.mjs
632
+ import * as React11 from "react";
633
+ function DialogInteractions({
634
+ store,
635
+ parentContext,
636
+ isDrawer
637
+ }) {
638
+ const open2 = store.useState("open");
639
+ const disablePointerDismissal = store.useState("disablePointerDismissal");
640
+ const modal = store.useState("modal");
641
+ const popupElement = store.useState("popupElement");
642
+ const floatingRootContext = store.useState("floatingRootContext");
643
+ const [ownNestedOpenDialogs, setOwnNestedOpenDialogs] = React11.useState(0);
644
+ const [ownNestedOpenDrawers, setOwnNestedOpenDrawers] = React11.useState(0);
645
+ const isTopmost = ownNestedOpenDialogs === 0;
646
+ const dismiss = useDismiss(floatingRootContext, {
647
+ outsidePressEvent() {
648
+ if (store.context.internalBackdropRef.current || store.context.backdropRef.current) {
649
+ return "intentional";
650
+ }
651
+ return {
652
+ mouse: modal === "trap-focus" ? "sloppy" : "intentional",
653
+ touch: "sloppy"
654
+ };
655
+ },
656
+ outsidePress(event) {
657
+ if (!store.context.outsidePressEnabledRef.current) {
658
+ return false;
659
+ }
660
+ if ("button" in event && event.button !== 0) {
661
+ return false;
662
+ }
663
+ if ("touches" in event) {
664
+ if (event.type === "touchend") {
665
+ if (event.changedTouches.length !== 1 || event.touches.length !== 0) {
666
+ return false;
667
+ }
668
+ } else if (event.touches.length !== 1) {
669
+ return false;
670
+ }
671
+ }
672
+ const target = getTarget(event);
673
+ if (isTopmost && !disablePointerDismissal) {
674
+ if (modal) {
675
+ const internalBackdrop = store.context.internalBackdropRef.current;
676
+ const backdrop = store.context.backdropRef.current;
677
+ return internalBackdrop || backdrop ? internalBackdrop === target || backdrop === target || contains(target, popupElement) && !target?.hasAttribute("data-base-ui-portal") : true;
678
+ }
679
+ return true;
680
+ }
681
+ return false;
682
+ },
683
+ escapeKey: isTopmost
684
+ });
685
+ useScrollLock(open2 && modal === true, popupElement);
686
+ store.useContextCallback("onNestedDialogOpen", (dialogCount, drawerCount) => {
687
+ setOwnNestedOpenDialogs(dialogCount);
688
+ setOwnNestedOpenDrawers(drawerCount);
689
+ });
690
+ useIsoLayoutEffect(() => {
691
+ if (parentContext?.onNestedDialogOpen) {
692
+ if (open2) {
693
+ parentContext.onNestedDialogOpen(ownNestedOpenDialogs + 1, ownNestedOpenDrawers + (isDrawer ? 1 : 0));
694
+ } else {
695
+ parentContext.onNestedDialogOpen(0, 0);
696
+ }
697
+ }
698
+ return () => {
699
+ if (parentContext?.onNestedDialogOpen && open2) {
700
+ parentContext.onNestedDialogOpen(0, 0);
701
+ }
702
+ };
703
+ }, [isDrawer, open2, ownNestedOpenDialogs, ownNestedOpenDrawers, parentContext]);
704
+ usePopupInteractionProps(store, {
705
+ // `enabled` is not passed to `useDismiss`, so its props are always defined,
706
+ // and `trigger` is the same object as `reference`.
707
+ activeTriggerProps: dismiss.reference,
708
+ inactiveTriggerProps: dismiss.trigger,
709
+ // DialogPopup and DrawerPopup spread `FOCUSABLE_POPUP_PROPS` directly, so
710
+ // this only needs to carry the dismiss handlers.
711
+ popupProps: dismiss.floating,
712
+ nestedOpenDialogCount: ownNestedOpenDialogs,
713
+ nestedOpenDrawerCount: ownNestedOpenDrawers
714
+ });
715
+ return null;
716
+ }
717
+
718
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/store/DialogStore.mjs
719
+ import * as React12 from "react";
720
+
721
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/NullStore.mjs
722
+ var NullStore = class extends ReactStore {
723
+ // `update`/`set`/`notifyAll` funnel through `setState` in the base `Store`, so overriding
724
+ // `setState` alone would neutralize them today. They are overridden explicitly so the store stays
725
+ // inert even if a future base-class change stops routing a mutator through `setState`.
726
+ setState(_newState) {
727
+ }
728
+ update(_changes) {
729
+ }
730
+ set(_key, _value) {
731
+ }
732
+ notifyAll() {
733
+ }
734
+ };
735
+
736
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/store/DialogStore.mjs
737
+ var selectors = {
738
+ ...popupStoreSelectors,
739
+ modal: (state) => state.modal,
740
+ nested: (state) => state.nested,
741
+ nestedOpenDialogCount: (state) => state.nestedOpenDialogCount,
742
+ nestedOpenDrawerCount: (state) => state.nestedOpenDrawerCount,
743
+ disablePointerDismissal: (state) => state.disablePointerDismissal,
744
+ openMethod: (state) => state.openMethod,
745
+ descriptionElementId: (state) => state.descriptionElementId,
746
+ titleElementId: (state) => state.titleElementId,
747
+ viewportElement: (state) => state.viewportElement,
748
+ role: (state) => state.role
749
+ };
750
+ var DialogStore = class extends ReactStore {
751
+ constructor(initialState, floatingId, nested) {
752
+ const triggerElements = new PopupTriggerMap();
753
+ const state = createInitialState(initialState, triggerElements, floatingId, nested);
754
+ super(state, createInitialContext(triggerElements), selectors);
755
+ }
756
+ setOpen = (nextOpen, eventDetails) => {
757
+ eventDetails.preventUnmountOnClose = () => {
758
+ this.set("preventUnmountingOnClose", true);
759
+ };
760
+ if (!nextOpen && eventDetails.trigger == null && this.state.activeTriggerId != null) {
761
+ eventDetails.trigger = this.state.activeTriggerElement ?? void 0;
762
+ }
763
+ this.context.onOpenChange?.(nextOpen, eventDetails);
764
+ if (eventDetails.isCanceled) {
765
+ return;
766
+ }
767
+ this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
768
+ this.update(createPopupOpenState(this.state, nextOpen, eventDetails.trigger));
769
+ };
770
+ };
771
+ function createNullDialogStore() {
772
+ const triggerElements = new PopupTriggerMap();
773
+ return new NullStore(Object.freeze(createInitialState(void 0, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors);
774
+ }
775
+ function createInitialState(initialState, triggerElements, floatingId, nested = false) {
776
+ const state = {
777
+ ...createInitialPopupStoreState(triggerElements, floatingId, nested),
778
+ modal: true,
779
+ disablePointerDismissal: false,
780
+ viewportElement: null,
781
+ descriptionElementId: void 0,
782
+ titleElementId: void 0,
783
+ openMethod: null,
784
+ nested: false,
785
+ nestedOpenDialogCount: 0,
786
+ nestedOpenDrawerCount: 0,
787
+ role: "dialog",
788
+ ...initialState
789
+ };
790
+ return state;
791
+ }
792
+ function createInitialContext(triggerElements) {
793
+ return {
794
+ popupRef: /* @__PURE__ */ React12.createRef(),
795
+ backdropRef: /* @__PURE__ */ React12.createRef(),
796
+ internalBackdropRef: /* @__PURE__ */ React12.createRef(),
797
+ outsidePressEnabledRef: {
798
+ current: true
799
+ },
800
+ triggerElements,
801
+ onOpenChange: void 0,
802
+ onOpenChangeComplete: void 0
803
+ };
804
+ }
805
+
806
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/root/useRenderDialogRoot.mjs
807
+ import { jsx as _jsx3, jsxs as _jsxs2 } from "react/jsx-runtime";
808
+ function useRenderDialogRoot(mode, props) {
809
+ const {
810
+ children,
811
+ open: openProp,
812
+ defaultOpen = false,
813
+ onOpenChange,
814
+ onOpenChangeComplete,
815
+ disablePointerDismissal: disablePointerDismissalProp = false,
816
+ modal: modalProp = true,
817
+ actionsRef,
818
+ handle,
819
+ triggerId: triggerIdProp,
820
+ defaultTriggerId: defaultTriggerIdProp = null
821
+ } = props;
822
+ const isDrawer = mode === "drawer";
823
+ const isAlertDialog = mode === "alert-dialog";
824
+ const modal = isAlertDialog ? true : modalProp;
825
+ const disablePointerDismissal = isAlertDialog || disablePointerDismissalProp;
826
+ const role = isAlertDialog ? "alertdialog" : "dialog";
827
+ const parentStore = useDialogRootContext(true);
828
+ const nested = parentStore != null;
829
+ const rootState = {
830
+ modal,
831
+ disablePointerDismissal,
832
+ nested,
833
+ role
834
+ };
835
+ const store = usePopupRootStore((floatingId, floatingNested) => new DialogStore({
836
+ open: defaultOpen,
837
+ openProp,
838
+ activeTriggerId: defaultTriggerIdProp,
839
+ triggerIdProp,
840
+ ...rootState
841
+ }, floatingId, floatingNested), true);
842
+ store.useControlledProp("openProp", openProp);
843
+ store.useControlledProp("triggerIdProp", triggerIdProp);
844
+ store.useSyncedValues(rootState);
845
+ store.useContextCallback("onOpenChange", onOpenChange);
846
+ store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
847
+ const open2 = store.useState("open");
848
+ const mounted = store.useState("mounted");
849
+ const payload = store.useState("payload");
850
+ usePopupRootSync(store, open2);
851
+ useImplicitActiveTrigger(store);
852
+ const {
853
+ forceUnmount
854
+ } = useOpenStateTransitions(open2, store);
855
+ React13.useImperativeHandle(actionsRef, () => ({
856
+ unmount: forceUnmount,
857
+ close: () => store.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction))
858
+ }), [forceUnmount, store]);
859
+ const shouldRenderInteractions = open2 || mounted;
860
+ return /* @__PURE__ */ _jsxs2(DialogRootContext.Provider, {
861
+ value: store,
862
+ children: [handle && /* @__PURE__ */ _jsx3(PopupHandleAttachment, {
863
+ handle,
864
+ store
865
+ }), shouldRenderInteractions && /* @__PURE__ */ _jsx3(DialogInteractions, {
866
+ store,
867
+ parentContext: parentStore?.context,
868
+ isDrawer
869
+ }), typeof children === "function" ? children({
870
+ payload
871
+ }) : children]
872
+ });
873
+ }
874
+
875
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/trigger/DialogTrigger.mjs
876
+ import * as React14 from "react";
877
+ var DialogTrigger = fastComponentRef(function DialogTrigger2(componentProps, forwardedRef) {
878
+ const {
879
+ render,
880
+ className,
881
+ style,
882
+ disabled = false,
883
+ nativeButton = true,
884
+ id: idProp,
885
+ payload,
886
+ handle,
887
+ ...elementProps
888
+ } = componentProps;
889
+ const dialogRootStore = useDialogRootContext(true);
890
+ const handleStore = usePopupHandleStore(handle);
891
+ const store = handleStore ?? dialogRootStore;
892
+ if (!store) {
893
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle." : formatErrorMessage_default(79));
894
+ }
895
+ const thisTriggerId = useBaseUiId(idProp);
896
+ const floatingContext = store.useState("floatingRootContext");
897
+ const isOpenedByThisTrigger = store.useState("isOpenedByTrigger", thisTriggerId);
898
+ const popupId = store.useState("triggerPopupId", thisTriggerId);
899
+ const triggerElementRef = React14.useRef(null);
900
+ const {
901
+ registerTrigger,
902
+ isMountedByThisTrigger
903
+ } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {
904
+ payload
905
+ });
906
+ const {
907
+ getButtonProps,
908
+ buttonRef
909
+ } = useButton({
910
+ disabled,
911
+ native: nativeButton
912
+ });
913
+ const click = useClick(floatingContext);
914
+ const interactionTypeProps = useOpenMethodTriggerProps(() => store.select("open"), (interactionType) => {
915
+ store.set("openMethod", interactionType);
916
+ });
917
+ const state = {
918
+ disabled,
919
+ open: isOpenedByThisTrigger
920
+ };
921
+ const rootTriggerProps = store.useState("triggerProps", isMountedByThisTrigger);
922
+ return useRenderElement("button", componentProps, {
923
+ state,
924
+ ref: [buttonRef, forwardedRef, registerTrigger, triggerElementRef],
925
+ props: [click.reference, rootTriggerProps, interactionTypeProps, {
926
+ [CLICK_TRIGGER_IDENTIFIER]: "",
927
+ id: thisTriggerId,
928
+ "aria-haspopup": "dialog",
929
+ "aria-expanded": isOpenedByThisTrigger,
930
+ "aria-controls": popupId
931
+ }, elementProps, getButtonProps],
932
+ stateAttributesMapping: triggerOpenStateMapping
933
+ });
934
+ });
935
+ if (process.env.NODE_ENV !== "production") DialogTrigger.displayName = "DialogTrigger";
936
+
937
+ // node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/store/DialogHandle.mjs
938
+ var DialogHandle = class extends BasePopupHandle {
939
+ constructor() {
940
+ super(createNullDialogStore(), "Dialog", false);
941
+ }
942
+ /**
943
+ * Opens the dialog, optionally associating it with a trigger.
944
+ *
945
+ * This method should only be called in an event handler or an effect (not during rendering).
946
+ *
947
+ * @param triggerId ID of the trigger to associate with the dialog. The trigger must be a matching
948
+ * `Dialog.Trigger` with this handle passed as a prop. Pass `null` to open without associating any trigger.
949
+ */
950
+ open(triggerId) {
951
+ this.openByTrigger(triggerId);
952
+ }
953
+ /**
954
+ * Opens the dialog with the given payload, without associating it with any trigger.
955
+ *
956
+ * This method should only be called in an event handler or an effect (not during rendering).
957
+ *
958
+ * @param payload Payload to set when opening the dialog. It is exposed to the root's render-prop children.
959
+ */
960
+ openWithPayload(payload) {
961
+ const attachedStore = this.attachedStore;
962
+ if (attachedStore === null) {
963
+ if (process.env.NODE_ENV !== "production") {
964
+ console.warn("Base UI: DialogHandle.openWithPayload() was called while no root using this handle is mounted. The call and its payload were ignored; mount a root with this handle before opening it imperatively.");
965
+ }
966
+ return;
967
+ }
968
+ attachedStore.set("payload", payload);
969
+ attachedStore.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction));
970
+ }
971
+ /**
972
+ * Closes the dialog.
973
+ *
974
+ * This method should only be called in an event handler or an effect (not during rendering).
975
+ */
976
+ close() {
977
+ this.closePopup();
978
+ }
979
+ /**
980
+ * Whether the dialog is currently open. Returns `false` while no root is attached to the handle.
981
+ */
982
+ get isOpen() {
983
+ return this.attachedStore?.select("open") ?? false;
984
+ }
985
+ };
986
+ function createDialogHandle() {
987
+ return new DialogHandle();
988
+ }
989
+
990
+ export {
991
+ BasePopupHandle,
992
+ createInitialPopupStoreState,
993
+ popupStoreSelectors,
994
+ usePopupHandleStore,
995
+ NullStore,
996
+ useRenderDialogRoot,
997
+ DialogBackdrop,
998
+ DialogClose,
999
+ DialogDescription,
1000
+ DialogPopup,
1001
+ DialogPortal,
1002
+ DialogTitle,
1003
+ DialogTrigger,
1004
+ DialogViewport,
1005
+ DialogHandle,
1006
+ createDialogHandle
1007
+ };