@wix/site-ui 1.30.0 → 1.31.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 (173) hide show
  1. package/dist/1268.js +99 -0
  2. package/dist/1279.js +7 -0
  3. package/dist/1457.js +10 -0
  4. package/dist/1477.js +106 -0
  5. package/dist/1500.js +111 -0
  6. package/dist/167.js +6 -0
  7. package/dist/2274.js +34 -0
  8. package/dist/2287.js +17 -0
  9. package/dist/2418.js +31 -0
  10. package/dist/2801.js +20 -0
  11. package/dist/285.js +86 -0
  12. package/dist/2861.js +6 -0
  13. package/dist/3020.js +7 -0
  14. package/dist/3021.js +72 -0
  15. package/dist/3056.js +229 -0
  16. package/dist/3140.js +4 -0
  17. package/dist/3248.js +307 -0
  18. package/dist/3296.js +4 -0
  19. package/dist/3319.js +400 -0
  20. package/dist/3395.js +4 -0
  21. package/dist/3485.js +854 -0
  22. package/dist/353.js +14 -0
  23. package/dist/3670.js +418 -0
  24. package/dist/3829.js +113 -0
  25. package/dist/4026.js +12 -0
  26. package/dist/4143.js +46 -0
  27. package/dist/42.js +32 -0
  28. package/dist/4281.js +30 -0
  29. package/dist/4346.js +2 -0
  30. package/dist/4388.js +418 -0
  31. package/dist/4490.js +32 -0
  32. package/dist/4495.js +9 -0
  33. package/dist/4549.js +24 -0
  34. package/dist/4586.js +41 -0
  35. package/dist/4586.js.LICENSE.txt +19 -0
  36. package/dist/4707.js +19 -0
  37. package/dist/4723.js +7 -0
  38. package/dist/4745.js +7 -0
  39. package/dist/4768.js +35 -0
  40. package/dist/4922.js +15 -0
  41. package/dist/5036.js +17 -0
  42. package/dist/5085.js +20 -0
  43. package/dist/5299.js +597 -0
  44. package/dist/5659.js +4 -0
  45. package/dist/5778.js +10 -0
  46. package/dist/5864.js +86 -0
  47. package/dist/5992.js +913 -0
  48. package/dist/5992.js.LICENSE.txt +19 -0
  49. package/dist/6003.js +10 -0
  50. package/dist/6046.js +29 -0
  51. package/dist/6089.js +2355 -0
  52. package/dist/6107.js +10 -0
  53. package/dist/6247.js +20 -0
  54. package/dist/6270.js +487 -0
  55. package/dist/6329.js +32 -0
  56. package/dist/6330.js +30 -0
  57. package/dist/6499.js +7 -0
  58. package/dist/6535.js +71 -0
  59. package/dist/6588.js +382 -0
  60. package/dist/6706.js +16 -0
  61. package/dist/6825.js +7 -0
  62. package/dist/6882.js +1562 -0
  63. package/dist/6914.js +30 -0
  64. package/dist/7021.js +13 -0
  65. package/dist/7366.js +83 -0
  66. package/dist/7373.js +25 -0
  67. package/dist/7541.js +25 -0
  68. package/dist/7564.js +10 -0
  69. package/dist/7642.js +20 -0
  70. package/dist/7725.js +10 -0
  71. package/dist/7871.js +38 -0
  72. package/dist/8052.js +352 -0
  73. package/dist/8106.js +238 -0
  74. package/dist/8171.js +346 -0
  75. package/dist/8225.js +21 -0
  76. package/dist/8272.js +333 -0
  77. package/dist/8527.js +58 -0
  78. package/dist/8724.js +10 -0
  79. package/dist/8750.js +1920 -0
  80. package/dist/8758.js +43 -0
  81. package/dist/880.js +149 -0
  82. package/dist/8935.js +8 -0
  83. package/dist/8960.js +22 -0
  84. package/dist/8971.js +40 -0
  85. package/dist/8979.js +10 -0
  86. package/dist/8996.js +71 -0
  87. package/dist/904.js +121 -0
  88. package/dist/9048.js +52 -0
  89. package/dist/9087.js +256 -0
  90. package/dist/9189.js +158 -0
  91. package/dist/9255.js +136 -0
  92. package/dist/9352.js +148 -0
  93. package/dist/951.js +22 -0
  94. package/dist/9635.js +22 -0
  95. package/dist/9829.js +4 -0
  96. package/dist/9863.js +8 -0
  97. package/dist/Accordion/index.d.ts +569 -12
  98. package/dist/Accordion/index.js +423 -8
  99. package/dist/AlertDialog/index.d.ts +1417 -18
  100. package/dist/AlertDialog/index.js +34 -14
  101. package/dist/Autocomplete/index.d.ts +1861 -38
  102. package/dist/Autocomplete/index.js +98 -24
  103. package/dist/Avatar/index.d.ts +129 -7
  104. package/dist/Avatar/index.js +149 -6
  105. package/dist/Breadcrumbs/index.d.ts +960 -7
  106. package/dist/Breadcrumbs/index.js +5 -5
  107. package/dist/Button/index.d.ts +88 -6
  108. package/dist/Button/index.js +27 -3
  109. package/dist/Checkbox/index.d.ts +425 -5
  110. package/dist/Checkbox/index.js +45 -5
  111. package/dist/CheckboxGroup/index.d.ts +318 -3
  112. package/dist/CheckboxGroup/index.js +166 -3
  113. package/dist/Collapsible/index.d.ts +377 -7
  114. package/dist/Collapsible/index.js +160 -6
  115. package/dist/Combobox/index.d.ts +1984 -48
  116. package/dist/Combobox/index.js +352 -29
  117. package/dist/ContextMenu/index.d.ts +2340 -36
  118. package/dist/ContextMenu/index.js +197 -22
  119. package/dist/Dialog/index.d.ts +1355 -18
  120. package/dist/Dialog/index.js +16 -14
  121. package/dist/Drawer/index.d.ts +1653 -18
  122. package/dist/Drawer/index.js +2797 -20
  123. package/dist/Field/index.d.ts +655 -15
  124. package/dist/Field/index.js +677 -10
  125. package/dist/Fieldset/index.d.ts +94 -5
  126. package/dist/Fieldset/index.js +68 -5
  127. package/dist/Form/index.d.ts +331 -2
  128. package/dist/Form/index.js +106 -3
  129. package/dist/Input/index.d.ts +692 -3
  130. package/dist/Input/index.js +10 -3
  131. package/dist/Menu/index.d.ts +2301 -36
  132. package/dist/Menu/index.js +365 -26
  133. package/dist/Menubar/index.d.ts +2301 -3
  134. package/dist/Menubar/index.js +105 -3
  135. package/dist/Meter/index.d.ts +175 -11
  136. package/dist/Meter/index.js +129 -9
  137. package/dist/NavigationMenu/index.d.ts +978 -28
  138. package/dist/NavigationMenu/index.js +1034 -17
  139. package/dist/NumberField/index.d.ts +612 -15
  140. package/dist/NumberField/index.js +1409 -11
  141. package/dist/Popover/index.d.ts +1655 -20
  142. package/dist/Popover/index.js +792 -17
  143. package/dist/PreviewCard/index.d.ts +1523 -14
  144. package/dist/PreviewCard/index.js +679 -14
  145. package/dist/Progress/index.d.ts +183 -11
  146. package/dist/Progress/index.js +181 -9
  147. package/dist/Radio/index.d.ts +185 -6
  148. package/dist/Radio/index.js +253 -6
  149. package/dist/RadioGroup/index.d.ts +341 -2
  150. package/dist/RadioGroup/index.js +154 -3
  151. package/dist/ScrollArea/index.d.ts +265 -13
  152. package/dist/ScrollArea/index.js +892 -10
  153. package/dist/Select/index.d.ts +1493 -38
  154. package/dist/Select/index.js +1824 -23
  155. package/dist/Separator/index.d.ts +80 -6
  156. package/dist/Separator/index.js +3 -3
  157. package/dist/Slider/index.d.ts +678 -16
  158. package/dist/Slider/index.js +1199 -11
  159. package/dist/Switch/index.d.ts +393 -5
  160. package/dist/Switch/index.js +208 -6
  161. package/dist/Tabs/index.d.ts +523 -12
  162. package/dist/Tabs/index.js +685 -9
  163. package/dist/Toggle/index.d.ts +305 -2
  164. package/dist/Toggle/index.js +76 -3
  165. package/dist/ToggleGroup/index.d.ts +316 -2
  166. package/dist/ToggleGroup/index.js +102 -3
  167. package/dist/Toolbar/index.d.ts +282 -13
  168. package/dist/Toolbar/index.js +230 -9
  169. package/dist/Tooltip/index.d.ts +1572 -14
  170. package/dist/Tooltip/index.js +965 -14
  171. package/dist/index.d.ts +12749 -652
  172. package/dist/rslib-runtime.js +18 -0
  173. package/package.json +3 -3
package/dist/5992.js ADDED
@@ -0,0 +1,913 @@
1
+ /*! LICENSE: 5992.js.LICENSE.txt */
2
+ import { __webpack_require__ } from "./rslib-runtime.js";
3
+ import "./4586.js";
4
+ import { NOOP, useRefWithInit, isReactVersionAtLeast, esm_formatErrorMessage } from "./8272.js";
5
+ import { useIsoLayoutEffect } from "./6499.js";
6
+ import { useStableCallback } from "./7541.js";
7
+ import { createEventEmitter, useFloatingTree } from "./285.js";
8
+ import { isReactEvent, isClickLikeEvent } from "./6330.js";
9
+ import { Timeout, useTimeout } from "./42.js";
10
+ import { isEventTargetWithin, isRootElement } from "./8758.js";
11
+ import { createChangeEventDetails } from "./4768.js";
12
+ import { triggerPress, outsidePress as reason_parts_outsidePress, escapeKey as reason_parts_escapeKey } from "./2418.js";
13
+ import { getTarget, contains } from "./4549.js";
14
+ import { isHTMLElement, getComputedStyle, isWebKit, isElement, isLastTraversableNode, isShadowRoot, getParentNode } from "./3829.js";
15
+ import { ownerDocument } from "./9829.js";
16
+ import { addEventListener } from "./4723.js";
17
+ import { mergeCleanups } from "./4495.js";
18
+ import * as __rspack_external_react from "react";
19
+ __webpack_require__.add({
20
+ "../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js" (__unused_rspack_module, exports, __webpack_require__) {
21
+ /**
22
+ * @license React
23
+ * use-sync-external-store-with-selector.development.js
24
+ *
25
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
26
+ *
27
+ * This source code is licensed under the MIT license found in the
28
+ * LICENSE file in the root directory of this source tree.
29
+ */ "production" !== process.env.NODE_ENV && function() {
30
+ function is(x, y) {
31
+ return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
32
+ }
33
+ "u" > typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
34
+ var React = __webpack_require__("react?1096"), objectIs = "function" == typeof Object.is ? Object.is : is, useSyncExternalStore = React.useSyncExternalStore, useRef = React.useRef, useEffect = React.useEffect, useMemo = React.useMemo, useDebugValue = React.useDebugValue;
35
+ exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
36
+ var instRef = useRef(null);
37
+ if (null === instRef.current) {
38
+ var inst = {
39
+ hasValue: !1,
40
+ value: null
41
+ };
42
+ instRef.current = inst;
43
+ } else inst = instRef.current;
44
+ instRef = useMemo(function() {
45
+ function memoizedSelector(nextSnapshot) {
46
+ if (!hasMemo) {
47
+ hasMemo = !0;
48
+ memoizedSnapshot = nextSnapshot;
49
+ nextSnapshot = selector(nextSnapshot);
50
+ if (void 0 !== isEqual && inst.hasValue) {
51
+ var currentSelection = inst.value;
52
+ if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection;
53
+ }
54
+ return memoizedSelection = nextSnapshot;
55
+ }
56
+ currentSelection = memoizedSelection;
57
+ if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
58
+ var nextSelection = selector(nextSnapshot);
59
+ if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection;
60
+ memoizedSnapshot = nextSnapshot;
61
+ return memoizedSelection = nextSelection;
62
+ }
63
+ var hasMemo = !1, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
64
+ return [
65
+ function() {
66
+ return memoizedSelector(getSnapshot());
67
+ },
68
+ null === maybeGetServerSnapshot ? void 0 : function() {
69
+ return memoizedSelector(maybeGetServerSnapshot());
70
+ }
71
+ ];
72
+ }, [
73
+ getSnapshot,
74
+ getServerSnapshot,
75
+ selector,
76
+ isEqual
77
+ ]);
78
+ var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
79
+ useEffect(function() {
80
+ inst.hasValue = !0;
81
+ inst.value = value;
82
+ }, [
83
+ value
84
+ ]);
85
+ useDebugValue(value);
86
+ return value;
87
+ };
88
+ "u" > typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
89
+ }();
90
+ },
91
+ "../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js" (__unused_rspack_module, exports, __webpack_require__) {
92
+ /**
93
+ * @license React
94
+ * use-sync-external-store-with-selector.production.js
95
+ *
96
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
97
+ *
98
+ * This source code is licensed under the MIT license found in the
99
+ * LICENSE file in the root directory of this source tree.
100
+ */ var React = __webpack_require__("react?1096");
101
+ function is(x, y) {
102
+ return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
103
+ }
104
+ var objectIs = "function" == typeof Object.is ? Object.is : is, useSyncExternalStore = React.useSyncExternalStore, useRef = React.useRef, useEffect = React.useEffect, useMemo = React.useMemo, useDebugValue = React.useDebugValue;
105
+ exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
106
+ var instRef = useRef(null);
107
+ if (null === instRef.current) {
108
+ var inst = {
109
+ hasValue: !1,
110
+ value: null
111
+ };
112
+ instRef.current = inst;
113
+ } else inst = instRef.current;
114
+ instRef = useMemo(function() {
115
+ function memoizedSelector(nextSnapshot) {
116
+ if (!hasMemo) {
117
+ hasMemo = !0;
118
+ memoizedSnapshot = nextSnapshot;
119
+ nextSnapshot = selector(nextSnapshot);
120
+ if (void 0 !== isEqual && inst.hasValue) {
121
+ var currentSelection = inst.value;
122
+ if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection;
123
+ }
124
+ return memoizedSelection = nextSnapshot;
125
+ }
126
+ currentSelection = memoizedSelection;
127
+ if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
128
+ var nextSelection = selector(nextSnapshot);
129
+ if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection;
130
+ memoizedSnapshot = nextSnapshot;
131
+ return memoizedSelection = nextSelection;
132
+ }
133
+ var hasMemo = !1, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
134
+ return [
135
+ function() {
136
+ return memoizedSelector(getSnapshot());
137
+ },
138
+ null === maybeGetServerSnapshot ? void 0 : function() {
139
+ return memoizedSelector(maybeGetServerSnapshot());
140
+ }
141
+ ];
142
+ }, [
143
+ getSnapshot,
144
+ getServerSnapshot,
145
+ selector,
146
+ isEqual
147
+ ]);
148
+ var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
149
+ useEffect(function() {
150
+ inst.hasValue = !0;
151
+ inst.value = value;
152
+ }, [
153
+ value
154
+ ]);
155
+ useDebugValue(value);
156
+ return value;
157
+ };
158
+ },
159
+ "../../node_modules/use-sync-external-store/with-selector.js" (module, __unused_rspack_exports, __webpack_require__) {
160
+ if ('production' === process.env.NODE_ENV) module.exports = __webpack_require__("../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js");
161
+ else module.exports = __webpack_require__("../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js");
162
+ },
163
+ "react?1096" (module) {
164
+ module.exports = __rspack_external_react;
165
+ }
166
+ });
167
+ function getNodeChildren(nodes, id, onlyOpenChildren = true) {
168
+ const directChildren = nodes.filter((node)=>node.parentId === id);
169
+ return directChildren.flatMap((child)=>[
170
+ ...!onlyOpenChildren || child.context?.open ? [
171
+ child
172
+ ] : [],
173
+ ...getNodeChildren(nodes, child.id, onlyOpenChildren)
174
+ ]);
175
+ }
176
+ function getNodeAncestors(nodes, id) {
177
+ let allAncestors = [];
178
+ let currentParentId = nodes.find((node)=>node.id === id)?.parentId;
179
+ while(currentParentId){
180
+ const currentNode = nodes.find((node)=>node.id === currentParentId);
181
+ currentParentId = currentNode?.parentId;
182
+ if (currentNode) allAncestors = allAncestors.concat(currentNode);
183
+ }
184
+ return allAncestors;
185
+ }
186
+ function createAttribute(name) {
187
+ return `data-base-ui-${name}`;
188
+ }
189
+ const createSelector = (a, b, c, d, e, f, ...other)=>{
190
+ if (other.length > 0) throw new Error("production" !== process.env.NODE_ENV ? 'Unsupported number of selectors' : esm_formatErrorMessage(1));
191
+ let selector;
192
+ if (a && b && c && d && e && f) selector = (state, a1, a2, a3)=>{
193
+ const va = a(state, a1, a2, a3);
194
+ const vb = b(state, a1, a2, a3);
195
+ const vc = c(state, a1, a2, a3);
196
+ const vd = d(state, a1, a2, a3);
197
+ const ve = e(state, a1, a2, a3);
198
+ return f(va, vb, vc, vd, ve, a1, a2, a3);
199
+ };
200
+ else if (a && b && c && d && e) selector = (state, a1, a2, a3)=>{
201
+ const va = a(state, a1, a2, a3);
202
+ const vb = b(state, a1, a2, a3);
203
+ const vc = c(state, a1, a2, a3);
204
+ const vd = d(state, a1, a2, a3);
205
+ return e(va, vb, vc, vd, a1, a2, a3);
206
+ };
207
+ else if (a && b && c && d) selector = (state, a1, a2, a3)=>{
208
+ const va = a(state, a1, a2, a3);
209
+ const vb = b(state, a1, a2, a3);
210
+ const vc = c(state, a1, a2, a3);
211
+ return d(va, vb, vc, a1, a2, a3);
212
+ };
213
+ else if (a && b && c) selector = (state, a1, a2, a3)=>{
214
+ const va = a(state, a1, a2, a3);
215
+ const vb = b(state, a1, a2, a3);
216
+ return c(va, vb, a1, a2, a3);
217
+ };
218
+ else if (a && b) selector = (state, a1, a2, a3)=>{
219
+ const va = a(state, a1, a2, a3);
220
+ return b(va, a1, a2, a3);
221
+ };
222
+ else if (a) selector = a;
223
+ else throw new Error('Missing arguments');
224
+ return selector;
225
+ };
226
+ const hooks = [];
227
+ let currentInstance;
228
+ function getInstance() {
229
+ return currentInstance;
230
+ }
231
+ function register(hook) {
232
+ hooks.push(hook);
233
+ }
234
+ function fastComponent(fn) {
235
+ const FastComponent = (props, forwardedRef)=>{
236
+ const instance = useRefWithInit(createInstance).current;
237
+ let result;
238
+ try {
239
+ currentInstance = instance;
240
+ for (const hook of hooks)hook.before(instance);
241
+ result = fn(props, forwardedRef);
242
+ for (const hook of hooks)hook.after(instance);
243
+ instance.didInitialize = true;
244
+ } finally{
245
+ currentInstance = void 0;
246
+ }
247
+ return result;
248
+ };
249
+ FastComponent.displayName = fn.displayName || fn.name;
250
+ return FastComponent;
251
+ }
252
+ function fastComponentRef(fn) {
253
+ return /*#__PURE__*/ __rspack_external_react.forwardRef(fastComponent(fn));
254
+ }
255
+ function createInstance() {
256
+ return {
257
+ didInitialize: false
258
+ };
259
+ }
260
+ const use_sync_external_store = __webpack_require__("../../node_modules/use-sync-external-store/index.js");
261
+ const with_selector = __webpack_require__("../../node_modules/use-sync-external-store/with-selector.js");
262
+ const canUseRawUseSyncExternalStore = isReactVersionAtLeast(19);
263
+ const useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;
264
+ function useStore(store, selector, a1, a2, a3) {
265
+ return useStoreImplementation(store, selector, a1, a2, a3);
266
+ }
267
+ function useStoreR19(store, selector, a1, a2, a3) {
268
+ const getSelection = __rspack_external_react.useCallback(()=>selector(store.getSnapshot(), a1, a2, a3), [
269
+ store,
270
+ selector,
271
+ a1,
272
+ a2,
273
+ a3
274
+ ]);
275
+ return (0, use_sync_external_store.useSyncExternalStore)(store.subscribe, getSelection, getSelection);
276
+ }
277
+ register({
278
+ before (instance) {
279
+ instance.syncIndex = 0;
280
+ if (!instance.didInitialize) {
281
+ instance.syncTick = 1;
282
+ instance.syncHooks = [];
283
+ instance.didChangeStore = true;
284
+ instance.getSnapshot = ()=>{
285
+ let didChange = false;
286
+ for(let i = 0; i < instance.syncHooks.length; i += 1){
287
+ const hook = instance.syncHooks[i];
288
+ const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);
289
+ if (hook.didChange || !Object.is(hook.value, value)) {
290
+ didChange = true;
291
+ hook.value = value;
292
+ hook.didChange = false;
293
+ }
294
+ }
295
+ if (didChange) instance.syncTick += 1;
296
+ return instance.syncTick;
297
+ };
298
+ }
299
+ },
300
+ after (instance) {
301
+ if (instance.syncHooks.length > 0) {
302
+ if (instance.didChangeStore) {
303
+ instance.didChangeStore = false;
304
+ instance.subscribe = (onStoreChange)=>{
305
+ const stores = new Set();
306
+ for (const hook of instance.syncHooks)stores.add(hook.store);
307
+ const unsubscribes = [];
308
+ for (const store of stores)unsubscribes.push(store.subscribe(onStoreChange));
309
+ return ()=>{
310
+ for (const unsubscribe of unsubscribes)unsubscribe();
311
+ };
312
+ };
313
+ }
314
+ (0, use_sync_external_store.useSyncExternalStore)(instance.subscribe, instance.getSnapshot, instance.getSnapshot);
315
+ }
316
+ }
317
+ });
318
+ function useStoreFast(store, selector, a1, a2, a3) {
319
+ const instance = getInstance();
320
+ if (!instance) return useStoreR19(store, selector, a1, a2, a3);
321
+ const index = instance.syncIndex;
322
+ instance.syncIndex += 1;
323
+ let hook;
324
+ if (instance.didInitialize) {
325
+ hook = instance.syncHooks[index];
326
+ if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {
327
+ if (hook.store !== store) instance.didChangeStore = true;
328
+ hook.store = store;
329
+ hook.selector = selector;
330
+ hook.a1 = a1;
331
+ hook.a2 = a2;
332
+ hook.a3 = a3;
333
+ hook.didChange = true;
334
+ }
335
+ } else {
336
+ hook = {
337
+ store,
338
+ selector,
339
+ a1,
340
+ a2,
341
+ a3,
342
+ value: selector(store.getSnapshot(), a1, a2, a3),
343
+ didChange: false
344
+ };
345
+ instance.syncHooks.push(hook);
346
+ }
347
+ return hook.value;
348
+ }
349
+ function useStoreLegacy(store, selector, a1, a2, a3) {
350
+ return (0, with_selector.useSyncExternalStoreWithSelector)(store.subscribe, store.getSnapshot, store.getSnapshot, (state)=>selector(state, a1, a2, a3));
351
+ }
352
+ class Store {
353
+ constructor(state){
354
+ this.state = state;
355
+ this.listeners = new Set();
356
+ this.updateTick = 0;
357
+ }
358
+ subscribe = (fn)=>{
359
+ this.listeners.add(fn);
360
+ return ()=>{
361
+ this.listeners.delete(fn);
362
+ };
363
+ };
364
+ getSnapshot = ()=>this.state;
365
+ setState(newState) {
366
+ if (this.state === newState) return;
367
+ this.state = newState;
368
+ this.updateTick += 1;
369
+ const currentTick = this.updateTick;
370
+ for (const listener of this.listeners){
371
+ if (currentTick !== this.updateTick) return;
372
+ listener(newState);
373
+ }
374
+ }
375
+ update(changes) {
376
+ for(const key in changes)if (!Object.is(this.state[key], changes[key])) return void this.setState({
377
+ ...this.state,
378
+ ...changes
379
+ });
380
+ }
381
+ set(key, value) {
382
+ if (!Object.is(this.state[key], value)) this.setState({
383
+ ...this.state,
384
+ [key]: value
385
+ });
386
+ }
387
+ notifyAll() {
388
+ const newState = {
389
+ ...this.state
390
+ };
391
+ this.setState(newState);
392
+ }
393
+ use(selector, a1, a2, a3) {
394
+ return useStore(this, selector, a1, a2, a3);
395
+ }
396
+ }
397
+ class ReactStore extends Store {
398
+ constructor(state, context = {}, selectors){
399
+ super(state);
400
+ this.context = context;
401
+ this.selectors = selectors;
402
+ }
403
+ useSyncedValue(key, value) {
404
+ __rspack_external_react.useDebugValue(key);
405
+ const store = this;
406
+ useIsoLayoutEffect(()=>{
407
+ if (store.state[key] !== value) store.set(key, value);
408
+ }, [
409
+ store,
410
+ key,
411
+ value
412
+ ]);
413
+ }
414
+ useSyncedValueWithCleanup(key, value) {
415
+ const store = this;
416
+ useIsoLayoutEffect(()=>{
417
+ if (store.state[key] !== value) store.set(key, value);
418
+ return ()=>{
419
+ store.set(key, void 0);
420
+ };
421
+ }, [
422
+ store,
423
+ key,
424
+ value
425
+ ]);
426
+ }
427
+ useSyncedValues(statePart) {
428
+ const store = this;
429
+ if ('production' !== process.env.NODE_ENV) {
430
+ __rspack_external_react.useDebugValue(statePart, (p)=>Object.keys(p));
431
+ const keys = __rspack_external_react.useRef(Object.keys(statePart)).current;
432
+ const nextKeys = Object.keys(statePart);
433
+ if (keys.length !== nextKeys.length || keys.some((key, index)=>key !== nextKeys[index])) console.error('ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.');
434
+ }
435
+ const dependencies = Object.values(statePart);
436
+ useIsoLayoutEffect(()=>{
437
+ store.update(statePart);
438
+ }, [
439
+ store,
440
+ ...dependencies
441
+ ]);
442
+ }
443
+ useControlledProp(key, controlled) {
444
+ __rspack_external_react.useDebugValue(key);
445
+ const store = this;
446
+ const isControlled = void 0 !== controlled;
447
+ useIsoLayoutEffect(()=>{
448
+ if (isControlled && !Object.is(store.state[key], controlled)) store.setState({
449
+ ...store.state,
450
+ [key]: controlled
451
+ });
452
+ }, [
453
+ store,
454
+ key,
455
+ controlled,
456
+ isControlled
457
+ ]);
458
+ if ('production' !== process.env.NODE_ENV) {
459
+ const cache = this.controlledValues ??= new Map();
460
+ if (!cache.has(key)) cache.set(key, isControlled);
461
+ const previouslyControlled = cache.get(key);
462
+ if (void 0 !== previouslyControlled && previouslyControlled !== isControlled) console.error(`A component is changing the ${isControlled ? '' : 'un'}controlled state of ${key.toString()} to be ${isControlled ? 'un' : ''}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);
463
+ }
464
+ }
465
+ select(key, a1, a2, a3) {
466
+ const selector = this.selectors[key];
467
+ return selector(this.state, a1, a2, a3);
468
+ }
469
+ useState(key, a1, a2, a3) {
470
+ __rspack_external_react.useDebugValue(key);
471
+ return useStore(this, this.selectors[key], a1, a2, a3);
472
+ }
473
+ useContextCallback(key, fn) {
474
+ __rspack_external_react.useDebugValue(key);
475
+ const stableFunction = useStableCallback(fn ?? NOOP);
476
+ this.context[key] = stableFunction;
477
+ }
478
+ useStateSetter(key) {
479
+ const ref = __rspack_external_react.useRef(void 0);
480
+ if (void 0 === ref.current) ref.current = (value)=>{
481
+ this.set(key, value);
482
+ };
483
+ return ref.current;
484
+ }
485
+ observe(selector, listener) {
486
+ let selectFn;
487
+ selectFn = 'function' == typeof selector ? selector : this.selectors[selector];
488
+ let prevValue = selectFn(this.state);
489
+ listener(prevValue, prevValue, this);
490
+ return this.subscribe((nextState)=>{
491
+ const nextValue = selectFn(nextState);
492
+ if (!Object.is(prevValue, nextValue)) {
493
+ const oldValue = prevValue;
494
+ prevValue = nextValue;
495
+ listener(nextValue, oldValue, this);
496
+ }
497
+ });
498
+ }
499
+ }
500
+ const FloatingRootStore_selectors = {
501
+ open: createSelector((state)=>state.open),
502
+ transitionStatus: createSelector((state)=>state.transitionStatus),
503
+ domReferenceElement: createSelector((state)=>state.domReferenceElement),
504
+ referenceElement: createSelector((state)=>state.positionReference ?? state.referenceElement),
505
+ floatingElement: createSelector((state)=>state.floatingElement),
506
+ floatingId: createSelector((state)=>state.floatingId)
507
+ };
508
+ class FloatingRootStore extends ReactStore {
509
+ constructor(options){
510
+ const { syncOnly, nested, onOpenChange, triggerElements, ...initialState } = options;
511
+ super({
512
+ ...initialState,
513
+ positionReference: initialState.referenceElement,
514
+ domReferenceElement: initialState.referenceElement
515
+ }, {
516
+ onOpenChange,
517
+ dataRef: {
518
+ current: {}
519
+ },
520
+ events: createEventEmitter(),
521
+ nested,
522
+ triggerElements
523
+ }, FloatingRootStore_selectors);
524
+ this.syncOnly = syncOnly;
525
+ }
526
+ syncOpenEvent = (newOpen, event)=>{
527
+ if (!newOpen || !this.state.open || null != event && isClickLikeEvent(event)) this.context.dataRef.current.openEvent = newOpen ? event : void 0;
528
+ };
529
+ dispatchOpenChange = (newOpen, eventDetails)=>{
530
+ this.syncOpenEvent(newOpen, eventDetails.event);
531
+ const details = {
532
+ open: newOpen,
533
+ reason: eventDetails.reason,
534
+ nativeEvent: eventDetails.event,
535
+ nested: this.context.nested,
536
+ triggerElement: eventDetails.trigger
537
+ };
538
+ this.context.events.emit('openchange', details);
539
+ };
540
+ setOpen = (newOpen, eventDetails)=>{
541
+ if (this.syncOnly) return void this.context.onOpenChange?.(newOpen, eventDetails);
542
+ this.dispatchOpenChange(newOpen, eventDetails);
543
+ this.context.onOpenChange?.(newOpen, eventDetails);
544
+ };
545
+ }
546
+ const bubbleHandlerKeys = {
547
+ intentional: 'onClick',
548
+ sloppy: 'onPointerDown'
549
+ };
550
+ function alwaysFalse() {
551
+ return false;
552
+ }
553
+ function normalizeProp(normalizable) {
554
+ return {
555
+ escapeKey: 'boolean' == typeof normalizable ? normalizable : normalizable?.escapeKey ?? false,
556
+ outsidePress: 'boolean' == typeof normalizable ? normalizable : normalizable?.outsidePress ?? true
557
+ };
558
+ }
559
+ function useDismiss(context, props = {}) {
560
+ const { enabled = true, escapeKey = true, outsidePress: outsidePressProp = true, outsidePressEvent = 'sloppy', referencePress = alwaysFalse, referencePressEvent = 'sloppy', bubbles, externalTree } = props;
561
+ const store = 'rootStore' in context ? context.rootStore : context;
562
+ const open = store.useState('open');
563
+ const floatingElement = store.useState('floatingElement');
564
+ const { dataRef } = store.context;
565
+ const tree = useFloatingTree(externalTree);
566
+ const outsidePressFn = useStableCallback('function' == typeof outsidePressProp ? outsidePressProp : ()=>false);
567
+ const outsidePress = 'function' == typeof outsidePressProp ? outsidePressFn : outsidePressProp;
568
+ const outsidePressEnabled = false !== outsidePress;
569
+ const getOutsidePressEventProp = useStableCallback(()=>outsidePressEvent);
570
+ const { escapeKey: escapeKeyBubbles, outsidePress: outsidePressBubbles } = normalizeProp(bubbles);
571
+ const pressStartedInsideRef = __rspack_external_react.useRef(false);
572
+ const pressStartPreventedRef = __rspack_external_react.useRef(false);
573
+ const suppressNextOutsideClickRef = __rspack_external_react.useRef(false);
574
+ const isComposingRef = __rspack_external_react.useRef(false);
575
+ const currentPointerTypeRef = __rspack_external_react.useRef('');
576
+ const touchStateRef = __rspack_external_react.useRef(null);
577
+ const cancelDismissOnEndTimeout = useTimeout();
578
+ const clearInsideReactTreeTimeout = useTimeout();
579
+ const clearInsideReactTree = useStableCallback(()=>{
580
+ clearInsideReactTreeTimeout.clear();
581
+ dataRef.current.insideReactTree = false;
582
+ });
583
+ const hasBlockingChild = useStableCallback((bubbleKey)=>{
584
+ const nodeId = dataRef.current.floatingContext?.nodeId;
585
+ const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];
586
+ return children.some((child)=>child.context?.open && !child.context.dataRef.current[bubbleKey]);
587
+ });
588
+ const isEventWithinOwnElements = useStableCallback((event)=>isEventTargetWithin(event, store.select('floatingElement')) || isEventTargetWithin(event, store.select('domReferenceElement')));
589
+ const closeOnReferencePress = useStableCallback((event)=>{
590
+ if (!referencePress()) return;
591
+ store.setOpen(false, createChangeEventDetails(triggerPress, event.nativeEvent));
592
+ });
593
+ const closeOnEscapeKeyDown = useStableCallback((event)=>{
594
+ if (!open || !enabled || !escapeKey || 'Escape' !== event.key) return;
595
+ if (isComposingRef.current) return;
596
+ if (!escapeKeyBubbles && hasBlockingChild('__escapeKeyBubbles')) return;
597
+ const native = isReactEvent(event) ? event.nativeEvent : event;
598
+ const eventDetails = createChangeEventDetails(reason_parts_escapeKey, native);
599
+ store.setOpen(false, eventDetails);
600
+ if (!eventDetails.isCanceled) event.preventDefault();
601
+ if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) event.stopPropagation();
602
+ });
603
+ const markInsideReactTree = useStableCallback(()=>{
604
+ dataRef.current.insideReactTree = true;
605
+ clearInsideReactTreeTimeout.start(0, clearInsideReactTree);
606
+ });
607
+ const markPressStartedInsideReactTree = useStableCallback((event)=>{
608
+ if (!open || !enabled || 0 !== event.button) return;
609
+ const target = getTarget(event.nativeEvent);
610
+ if (!contains(store.select('floatingElement'), target)) return;
611
+ if (!pressStartedInsideRef.current) {
612
+ pressStartedInsideRef.current = true;
613
+ pressStartPreventedRef.current = false;
614
+ }
615
+ });
616
+ const markInsidePressStartPrevented = useStableCallback((event)=>{
617
+ if (!open || !enabled) return;
618
+ if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) return;
619
+ if (pressStartedInsideRef.current) pressStartPreventedRef.current = true;
620
+ });
621
+ __rspack_external_react.useEffect(()=>{
622
+ if (!open || !enabled) return;
623
+ dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;
624
+ dataRef.current.__outsidePressBubbles = outsidePressBubbles;
625
+ const compositionTimeout = new Timeout();
626
+ const preventedPressSuppressionTimeout = new Timeout();
627
+ function handleCompositionStart() {
628
+ compositionTimeout.clear();
629
+ isComposingRef.current = true;
630
+ }
631
+ function handleCompositionEnd() {
632
+ compositionTimeout.start(isWebKit() ? 5 : 0, ()=>{
633
+ isComposingRef.current = false;
634
+ });
635
+ }
636
+ function suppressImmediateOutsideClickAfterPreventedStart() {
637
+ suppressNextOutsideClickRef.current = true;
638
+ preventedPressSuppressionTimeout.start(0, ()=>{
639
+ suppressNextOutsideClickRef.current = false;
640
+ });
641
+ }
642
+ function resetPressStartState() {
643
+ pressStartedInsideRef.current = false;
644
+ pressStartPreventedRef.current = false;
645
+ }
646
+ function getOutsidePressEvent() {
647
+ const type = currentPointerTypeRef.current;
648
+ const computedType = 'pen' !== type && type ? type : 'mouse';
649
+ const outsidePressEventValue = getOutsidePressEventProp();
650
+ const resolved = 'function' == typeof outsidePressEventValue ? outsidePressEventValue() : outsidePressEventValue;
651
+ if ('string' == typeof resolved) return resolved;
652
+ return resolved[computedType];
653
+ }
654
+ function shouldIgnoreEvent(event) {
655
+ const computedOutsidePressEvent = getOutsidePressEvent();
656
+ return 'intentional' === computedOutsidePressEvent && 'click' !== event.type || 'sloppy' === computedOutsidePressEvent && 'click' === event.type;
657
+ }
658
+ function isEventWithinFloatingTree(event) {
659
+ const nodeId = dataRef.current.floatingContext?.nodeId;
660
+ const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some((node)=>isEventTargetWithin(event, node.context?.elements.floating));
661
+ return isEventWithinOwnElements(event) || targetIsInsideChildren;
662
+ }
663
+ function closeOnPressOutside(event) {
664
+ if (shouldIgnoreEvent(event)) {
665
+ if ('click' !== event.type && !isEventWithinOwnElements(event)) {
666
+ preventedPressSuppressionTimeout.clear();
667
+ suppressNextOutsideClickRef.current = false;
668
+ }
669
+ clearInsideReactTree();
670
+ return;
671
+ }
672
+ if (dataRef.current.insideReactTree) return void clearInsideReactTree();
673
+ const target = getTarget(event);
674
+ const inertSelector = `[${createAttribute('inert')}]`;
675
+ const targetRoot = isElement(target) ? target.getRootNode() : null;
676
+ const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select('floatingElement'))).querySelectorAll(inertSelector));
677
+ const triggers = store.context.triggerElements;
678
+ if (target && (triggers.hasElement(target) || triggers.hasMatchingElement((trigger)=>contains(trigger, target)))) return;
679
+ let targetRootAncestor = isElement(target) ? target : null;
680
+ while(targetRootAncestor && !isLastTraversableNode(targetRootAncestor)){
681
+ const nextParent = getParentNode(targetRootAncestor);
682
+ if (isLastTraversableNode(nextParent) || !isElement(nextParent)) break;
683
+ targetRootAncestor = nextParent;
684
+ }
685
+ if (markers.length && isElement(target) && !isRootElement(target) && !contains(target, store.select('floatingElement')) && markers.every((marker)=>!contains(targetRootAncestor, marker))) return;
686
+ if (isHTMLElement(target) && !('touches' in event)) {
687
+ const lastTraversableNode = isLastTraversableNode(target);
688
+ const style = getComputedStyle(target);
689
+ const scrollRe = /auto|scroll/;
690
+ const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);
691
+ const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);
692
+ const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;
693
+ const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;
694
+ const isRTL = 'rtl' === style.direction;
695
+ const pressedVerticalScrollbar = canScrollY && (isRTL ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);
696
+ const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;
697
+ if (pressedVerticalScrollbar || pressedHorizontalScrollbar) return;
698
+ }
699
+ if (isEventWithinFloatingTree(event)) return;
700
+ if ('intentional' === getOutsidePressEvent() && suppressNextOutsideClickRef.current) {
701
+ preventedPressSuppressionTimeout.clear();
702
+ suppressNextOutsideClickRef.current = false;
703
+ return;
704
+ }
705
+ if ('function' == typeof outsidePress && !outsidePress(event)) return;
706
+ if (hasBlockingChild('__outsidePressBubbles')) return;
707
+ store.setOpen(false, createChangeEventDetails(reason_parts_outsidePress, event));
708
+ clearInsideReactTree();
709
+ }
710
+ function handlePointerDown(event) {
711
+ if ('sloppy' !== getOutsidePressEvent() || 'touch' === event.pointerType || !store.select('open') || !enabled || isEventWithinOwnElements(event)) return;
712
+ closeOnPressOutside(event);
713
+ }
714
+ function handleTouchStart(event) {
715
+ if ('sloppy' !== getOutsidePressEvent() || !store.select('open') || !enabled || isEventWithinOwnElements(event)) return;
716
+ const touch = event.touches[0];
717
+ if (touch) {
718
+ touchStateRef.current = {
719
+ startTime: Date.now(),
720
+ startX: touch.clientX,
721
+ startY: touch.clientY,
722
+ dismissOnTouchEnd: false,
723
+ dismissOnMouseDown: true
724
+ };
725
+ cancelDismissOnEndTimeout.start(1000, ()=>{
726
+ if (touchStateRef.current) {
727
+ touchStateRef.current.dismissOnTouchEnd = false;
728
+ touchStateRef.current.dismissOnMouseDown = false;
729
+ }
730
+ });
731
+ }
732
+ }
733
+ function addTargetEventListenerOnce(event, listener) {
734
+ const target = getTarget(event);
735
+ if (!target) return;
736
+ const unsubscribe = addEventListener(target, event.type, ()=>{
737
+ listener(event);
738
+ unsubscribe();
739
+ });
740
+ }
741
+ function handleTouchStartCapture(event) {
742
+ currentPointerTypeRef.current = 'touch';
743
+ addTargetEventListenerOnce(event, handleTouchStart);
744
+ }
745
+ function closeOnPressOutsideCapture(event) {
746
+ cancelDismissOnEndTimeout.clear();
747
+ if ('pointerdown' === event.type) currentPointerTypeRef.current = event.pointerType;
748
+ if ('mousedown' === event.type && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) return;
749
+ addTargetEventListenerOnce(event, (targetEvent)=>{
750
+ if ('pointerdown' === targetEvent.type) handlePointerDown(targetEvent);
751
+ else closeOnPressOutside(targetEvent);
752
+ });
753
+ }
754
+ function handlePressEndCapture(event) {
755
+ if (!pressStartedInsideRef.current) return;
756
+ const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current;
757
+ resetPressStartState();
758
+ if ('intentional' !== getOutsidePressEvent()) return;
759
+ if ('pointercancel' === event.type) {
760
+ if (pressStartedInsideDefaultPrevented) suppressImmediateOutsideClickAfterPreventedStart();
761
+ return;
762
+ }
763
+ if (isEventWithinFloatingTree(event)) return;
764
+ if (pressStartedInsideDefaultPrevented) return void suppressImmediateOutsideClickAfterPreventedStart();
765
+ if ('function' == typeof outsidePress && !outsidePress(event)) return;
766
+ preventedPressSuppressionTimeout.clear();
767
+ suppressNextOutsideClickRef.current = true;
768
+ clearInsideReactTree();
769
+ }
770
+ function handleTouchMove(event) {
771
+ if ('sloppy' !== getOutsidePressEvent() || !touchStateRef.current || isEventWithinOwnElements(event)) return;
772
+ const touch = event.touches[0];
773
+ if (!touch) return;
774
+ const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX);
775
+ const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY);
776
+ const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
777
+ if (distance > 5) touchStateRef.current.dismissOnTouchEnd = true;
778
+ if (distance > 10) {
779
+ closeOnPressOutside(event);
780
+ cancelDismissOnEndTimeout.clear();
781
+ touchStateRef.current = null;
782
+ }
783
+ }
784
+ function handleTouchMoveCapture(event) {
785
+ addTargetEventListenerOnce(event, handleTouchMove);
786
+ }
787
+ function handleTouchEnd(event) {
788
+ if ('sloppy' !== getOutsidePressEvent() || !touchStateRef.current || isEventWithinOwnElements(event)) return;
789
+ if (touchStateRef.current.dismissOnTouchEnd) closeOnPressOutside(event);
790
+ cancelDismissOnEndTimeout.clear();
791
+ touchStateRef.current = null;
792
+ }
793
+ function handleTouchEndCapture(event) {
794
+ addTargetEventListenerOnce(event, handleTouchEnd);
795
+ }
796
+ const doc = ownerDocument(floatingElement);
797
+ const unsubscribe = mergeCleanups(escapeKey && mergeCleanups(addEventListener(doc, 'keydown', closeOnEscapeKeyDown), addEventListener(doc, 'compositionstart', handleCompositionStart), addEventListener(doc, 'compositionend', handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, 'click', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerdown', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerup', handlePressEndCapture, true), addEventListener(doc, 'pointercancel', handlePressEndCapture, true), addEventListener(doc, 'mousedown', closeOnPressOutsideCapture, true), addEventListener(doc, 'mouseup', handlePressEndCapture, true), addEventListener(doc, 'touchstart', handleTouchStartCapture, true), addEventListener(doc, 'touchmove', handleTouchMoveCapture, true), addEventListener(doc, 'touchend', handleTouchEndCapture, true)));
798
+ return ()=>{
799
+ unsubscribe();
800
+ compositionTimeout.clear();
801
+ preventedPressSuppressionTimeout.clear();
802
+ resetPressStartState();
803
+ suppressNextOutsideClickRef.current = false;
804
+ };
805
+ }, [
806
+ dataRef,
807
+ floatingElement,
808
+ escapeKey,
809
+ outsidePressEnabled,
810
+ outsidePress,
811
+ open,
812
+ enabled,
813
+ escapeKeyBubbles,
814
+ outsidePressBubbles,
815
+ closeOnEscapeKeyDown,
816
+ clearInsideReactTree,
817
+ getOutsidePressEventProp,
818
+ hasBlockingChild,
819
+ isEventWithinOwnElements,
820
+ tree,
821
+ store,
822
+ cancelDismissOnEndTimeout
823
+ ]);
824
+ __rspack_external_react.useEffect(clearInsideReactTree, [
825
+ outsidePress,
826
+ clearInsideReactTree
827
+ ]);
828
+ const reference = __rspack_external_react.useMemo(()=>({
829
+ onKeyDown: closeOnEscapeKeyDown,
830
+ [bubbleHandlerKeys[referencePressEvent]]: closeOnReferencePress,
831
+ ...'intentional' !== referencePressEvent && {
832
+ onClick: closeOnReferencePress
833
+ }
834
+ }), [
835
+ closeOnEscapeKeyDown,
836
+ closeOnReferencePress,
837
+ referencePressEvent
838
+ ]);
839
+ const floating = __rspack_external_react.useMemo(()=>({
840
+ onKeyDown: closeOnEscapeKeyDown,
841
+ onPointerDown: markInsidePressStartPrevented,
842
+ onMouseDown: markInsidePressStartPrevented,
843
+ onClickCapture: markInsideReactTree,
844
+ onMouseDownCapture (event) {
845
+ markInsideReactTree();
846
+ markPressStartedInsideReactTree(event);
847
+ },
848
+ onPointerDownCapture (event) {
849
+ markInsideReactTree();
850
+ markPressStartedInsideReactTree(event);
851
+ },
852
+ onMouseUpCapture: markInsideReactTree,
853
+ onTouchEndCapture: markInsideReactTree,
854
+ onTouchMoveCapture: markInsideReactTree
855
+ }), [
856
+ closeOnEscapeKeyDown,
857
+ markInsideReactTree,
858
+ markPressStartedInsideReactTree,
859
+ markInsidePressStartPrevented
860
+ ]);
861
+ return __rspack_external_react.useMemo(()=>enabled ? {
862
+ reference,
863
+ floating,
864
+ trigger: reference
865
+ } : {}, [
866
+ enabled,
867
+ reference,
868
+ floating
869
+ ]);
870
+ }
871
+ class PopupTriggerMap {
872
+ constructor(){
873
+ this.elementsSet = new Set();
874
+ this.idMap = new Map();
875
+ }
876
+ add(id, element) {
877
+ const existingElement = this.idMap.get(id);
878
+ if (existingElement === element) return;
879
+ if (void 0 !== existingElement) this.elementsSet.delete(existingElement);
880
+ this.elementsSet.add(element);
881
+ this.idMap.set(id, element);
882
+ if ('production' !== process.env.NODE_ENV) {
883
+ if (this.elementsSet.size !== this.idMap.size) throw new Error('Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.');
884
+ }
885
+ }
886
+ delete(id) {
887
+ const element = this.idMap.get(id);
888
+ if (element) {
889
+ this.elementsSet.delete(element);
890
+ this.idMap.delete(id);
891
+ }
892
+ }
893
+ hasElement(element) {
894
+ return this.elementsSet.has(element);
895
+ }
896
+ hasMatchingElement(predicate) {
897
+ for (const element of this.elementsSet)if (predicate(element)) return true;
898
+ return false;
899
+ }
900
+ getById(id) {
901
+ return this.idMap.get(id);
902
+ }
903
+ entries() {
904
+ return this.idMap.entries();
905
+ }
906
+ elements() {
907
+ return this.elementsSet.values();
908
+ }
909
+ get size() {
910
+ return this.idMap.size;
911
+ }
912
+ }
913
+ export { FloatingRootStore, PopupTriggerMap, ReactStore, Store, createAttribute, createSelector, fastComponent, fastComponentRef, getNodeAncestors, getNodeChildren, useDismiss, useStore };