@backbay/glia 0.2.0-alpha.6 → 0.2.0-alpha.8

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 (226) hide show
  1. package/dist/audio/index.js +1145 -5
  2. package/dist/audio/index.js.map +1 -1
  3. package/dist/components/index.js +3187 -10
  4. package/dist/components/index.js.map +1 -1
  5. package/dist/core.js +19714 -12
  6. package/dist/core.js.map +1 -1
  7. package/dist/emotion/index.js +1 -1
  8. package/dist/emotion/index.js.map +1 -1
  9. package/dist/hooks/index.js +941 -6
  10. package/dist/hooks/index.js.map +1 -1
  11. package/dist/index.js +31841 -183
  12. package/dist/index.js.map +1 -1
  13. package/dist/primitives/index.js +21111 -57
  14. package/dist/primitives/index.js.map +1 -1
  15. package/dist/protocol/index.js +360 -2
  16. package/dist/protocol/index.js.map +1 -1
  17. package/dist/speakeasy/index.js +2786 -38
  18. package/dist/speakeasy/index.js.map +1 -1
  19. package/dist/styles.css +1 -1
  20. package/dist/theme/index.js +1150 -3
  21. package/dist/theme/index.js.map +1 -1
  22. package/dist/vision/index.js +370 -2
  23. package/dist/vision/index.js.map +1 -1
  24. package/dist/workspace/index.js +16824 -2
  25. package/dist/workspace/index.js.map +1 -1
  26. package/package.json +16 -10
  27. package/dist/AuroraBackground-AP6ZHVFA.js +0 -6
  28. package/dist/AuroraBackground-AP6ZHVFA.js.map +0 -1
  29. package/dist/BentoGrid-CDARICNM.js +0 -6
  30. package/dist/BentoGrid-CDARICNM.js.map +0 -1
  31. package/dist/CommandPalette-JCWJKRBY.js +0 -6
  32. package/dist/CommandPalette-JCWJKRBY.js.map +0 -1
  33. package/dist/Glass-H4X4ZI4P.js +0 -7
  34. package/dist/Glass-H4X4ZI4P.js.map +0 -1
  35. package/dist/GlitchText-KLQ57PPY.js +0 -6
  36. package/dist/GlitchText-KLQ57PPY.js.map +0 -1
  37. package/dist/GlowButton-VGBPMZO7.js +0 -6
  38. package/dist/GlowButton-VGBPMZO7.js.map +0 -1
  39. package/dist/Graph3D-GO7N2EZQ.js +0 -540
  40. package/dist/Graph3D-GO7N2EZQ.js.map +0 -1
  41. package/dist/HUDProgressRing-N6C5NAEV.js +0 -6
  42. package/dist/HUDProgressRing-N6C5NAEV.js.map +0 -1
  43. package/dist/KPIStat-PBQK27ZB.js +0 -6
  44. package/dist/KPIStat-PBQK27ZB.js.map +0 -1
  45. package/dist/NeonToast-W5F7MU3U.js +0 -6
  46. package/dist/NeonToast-W5F7MU3U.js.map +0 -1
  47. package/dist/ParticleField-WK6CNHWU.js +0 -51
  48. package/dist/ParticleField-WK6CNHWU.js.map +0 -1
  49. package/dist/TextGenerateEffect-EUCEIIUJ.js +0 -6
  50. package/dist/TextGenerateEffect-EUCEIIUJ.js.map +0 -1
  51. package/dist/ThreeDCard-VH5I3SSY.js +0 -6
  52. package/dist/ThreeDCard-VH5I3SSY.js.map +0 -1
  53. package/dist/TypingAnimation-GIWOHPIX.js +0 -6
  54. package/dist/TypingAnimation-GIWOHPIX.js.map +0 -1
  55. package/dist/alert-dialog-QOSYBIIE.js +0 -19
  56. package/dist/alert-dialog-QOSYBIIE.js.map +0 -1
  57. package/dist/avatar-N5R37PCU.js +0 -10
  58. package/dist/avatar-N5R37PCU.js.map +0 -1
  59. package/dist/badge-GTVIIGPY.js +0 -8
  60. package/dist/badge-GTVIIGPY.js.map +0 -1
  61. package/dist/button-D7IMSV2D.js +0 -8
  62. package/dist/button-D7IMSV2D.js.map +0 -1
  63. package/dist/chunk-3CMPQOMY.js +0 -69
  64. package/dist/chunk-3CMPQOMY.js.map +0 -1
  65. package/dist/chunk-3OQT6IYR.js +0 -41
  66. package/dist/chunk-3OQT6IYR.js.map +0 -1
  67. package/dist/chunk-43B2WVLS.js +0 -85
  68. package/dist/chunk-43B2WVLS.js.map +0 -1
  69. package/dist/chunk-4SRFO5W3.js +0 -121
  70. package/dist/chunk-4SRFO5W3.js.map +0 -1
  71. package/dist/chunk-5IZELOOU.js +0 -362
  72. package/dist/chunk-5IZELOOU.js.map +0 -1
  73. package/dist/chunk-6DM4ACSS.js +0 -154
  74. package/dist/chunk-6DM4ACSS.js.map +0 -1
  75. package/dist/chunk-6IGT34PC.js +0 -50
  76. package/dist/chunk-6IGT34PC.js.map +0 -1
  77. package/dist/chunk-6RKBCJHN.js +0 -194
  78. package/dist/chunk-6RKBCJHN.js.map +0 -1
  79. package/dist/chunk-6RX2WGCO.js +0 -108
  80. package/dist/chunk-6RX2WGCO.js.map +0 -1
  81. package/dist/chunk-7K4WZM3U.js +0 -189
  82. package/dist/chunk-7K4WZM3U.js.map +0 -1
  83. package/dist/chunk-7MDBHJPT.js +0 -407
  84. package/dist/chunk-7MDBHJPT.js.map +0 -1
  85. package/dist/chunk-7UQD6ROV.js +0 -9
  86. package/dist/chunk-7UQD6ROV.js.map +0 -1
  87. package/dist/chunk-AFNIVLZP.js +0 -1069
  88. package/dist/chunk-AFNIVLZP.js.map +0 -1
  89. package/dist/chunk-ANWYRO6A.js +0 -407
  90. package/dist/chunk-ANWYRO6A.js.map +0 -1
  91. package/dist/chunk-DIXPOHDO.js +0 -71
  92. package/dist/chunk-DIXPOHDO.js.map +0 -1
  93. package/dist/chunk-DWYMKYPI.js +0 -3
  94. package/dist/chunk-DWYMKYPI.js.map +0 -1
  95. package/dist/chunk-E3NVDCZG.js +0 -280
  96. package/dist/chunk-E3NVDCZG.js.map +0 -1
  97. package/dist/chunk-EBM7YBKL.js +0 -399
  98. package/dist/chunk-EBM7YBKL.js.map +0 -1
  99. package/dist/chunk-EPAM7IWW.js +0 -294
  100. package/dist/chunk-EPAM7IWW.js.map +0 -1
  101. package/dist/chunk-EXQ7GYRS.js +0 -134
  102. package/dist/chunk-EXQ7GYRS.js.map +0 -1
  103. package/dist/chunk-F4QTUZ3C.js +0 -136
  104. package/dist/chunk-F4QTUZ3C.js.map +0 -1
  105. package/dist/chunk-FEW533R2.js +0 -105
  106. package/dist/chunk-FEW533R2.js.map +0 -1
  107. package/dist/chunk-FFZLJKC7.js +0 -270
  108. package/dist/chunk-FFZLJKC7.js.map +0 -1
  109. package/dist/chunk-GEAMOBF7.js +0 -8486
  110. package/dist/chunk-GEAMOBF7.js.map +0 -1
  111. package/dist/chunk-GRTRSCTD.js +0 -74
  112. package/dist/chunk-GRTRSCTD.js.map +0 -1
  113. package/dist/chunk-IKGYOGLK.js +0 -16
  114. package/dist/chunk-IKGYOGLK.js.map +0 -1
  115. package/dist/chunk-IQ7WYWVJ.js +0 -73
  116. package/dist/chunk-IQ7WYWVJ.js.map +0 -1
  117. package/dist/chunk-IXIVWQLF.js +0 -543
  118. package/dist/chunk-IXIVWQLF.js.map +0 -1
  119. package/dist/chunk-JCJU57RC.js +0 -115
  120. package/dist/chunk-JCJU57RC.js.map +0 -1
  121. package/dist/chunk-KORSTBU4.js +0 -117
  122. package/dist/chunk-KORSTBU4.js.map +0 -1
  123. package/dist/chunk-KSEZ6UM2.js +0 -235
  124. package/dist/chunk-KSEZ6UM2.js.map +0 -1
  125. package/dist/chunk-MHPF7R3O.js +0 -1376
  126. package/dist/chunk-MHPF7R3O.js.map +0 -1
  127. package/dist/chunk-MPC5IH7E.js +0 -81
  128. package/dist/chunk-MPC5IH7E.js.map +0 -1
  129. package/dist/chunk-MQIU2NYA.js +0 -114
  130. package/dist/chunk-MQIU2NYA.js.map +0 -1
  131. package/dist/chunk-NYMBJOGR.js +0 -2192
  132. package/dist/chunk-NYMBJOGR.js.map +0 -1
  133. package/dist/chunk-OBZD2M3C.js +0 -169
  134. package/dist/chunk-OBZD2M3C.js.map +0 -1
  135. package/dist/chunk-ODM2AG6G.js +0 -176
  136. package/dist/chunk-ODM2AG6G.js.map +0 -1
  137. package/dist/chunk-ONDKF5LP.js +0 -53
  138. package/dist/chunk-ONDKF5LP.js.map +0 -1
  139. package/dist/chunk-P25YCWQB.js +0 -41
  140. package/dist/chunk-P25YCWQB.js.map +0 -1
  141. package/dist/chunk-PFYVNM6H.js +0 -14
  142. package/dist/chunk-PFYVNM6H.js.map +0 -1
  143. package/dist/chunk-PWNNSGFL.js +0 -20
  144. package/dist/chunk-PWNNSGFL.js.map +0 -1
  145. package/dist/chunk-Q2PGZVOT.js +0 -36
  146. package/dist/chunk-Q2PGZVOT.js.map +0 -1
  147. package/dist/chunk-Q2XDMV7U.js +0 -76
  148. package/dist/chunk-Q2XDMV7U.js.map +0 -1
  149. package/dist/chunk-QG7FH2FI.js +0 -45
  150. package/dist/chunk-QG7FH2FI.js.map +0 -1
  151. package/dist/chunk-R7HUOK2D.js +0 -1914
  152. package/dist/chunk-R7HUOK2D.js.map +0 -1
  153. package/dist/chunk-REUYY7G5.js +0 -773
  154. package/dist/chunk-REUYY7G5.js.map +0 -1
  155. package/dist/chunk-RHC2Z2HT.js +0 -199
  156. package/dist/chunk-RHC2Z2HT.js.map +0 -1
  157. package/dist/chunk-RMCVLIFE.js +0 -23
  158. package/dist/chunk-RMCVLIFE.js.map +0 -1
  159. package/dist/chunk-ROZLTXGR.js +0 -234
  160. package/dist/chunk-ROZLTXGR.js.map +0 -1
  161. package/dist/chunk-RSS2C2O3.js +0 -17
  162. package/dist/chunk-RSS2C2O3.js.map +0 -1
  163. package/dist/chunk-SAGCG5SH.js +0 -355
  164. package/dist/chunk-SAGCG5SH.js.map +0 -1
  165. package/dist/chunk-TM6AOUSD.js +0 -40
  166. package/dist/chunk-TM6AOUSD.js.map +0 -1
  167. package/dist/chunk-TPK4BYCO.js +0 -970
  168. package/dist/chunk-TPK4BYCO.js.map +0 -1
  169. package/dist/chunk-UNQIL4K2.js +0 -34
  170. package/dist/chunk-UNQIL4K2.js.map +0 -1
  171. package/dist/chunk-UUG6L75Y.js +0 -47
  172. package/dist/chunk-UUG6L75Y.js.map +0 -1
  173. package/dist/chunk-V2SYMV4W.js +0 -114
  174. package/dist/chunk-V2SYMV4W.js.map +0 -1
  175. package/dist/chunk-V7EN5CTH.js +0 -130
  176. package/dist/chunk-V7EN5CTH.js.map +0 -1
  177. package/dist/chunk-VITKG2HL.js +0 -1125
  178. package/dist/chunk-VITKG2HL.js.map +0 -1
  179. package/dist/chunk-VYEWU5LO.js +0 -2631
  180. package/dist/chunk-VYEWU5LO.js.map +0 -1
  181. package/dist/chunk-W67QAGSH.js +0 -178
  182. package/dist/chunk-W67QAGSH.js.map +0 -1
  183. package/dist/chunk-WWBIN6KV.js +0 -1353
  184. package/dist/chunk-WWBIN6KV.js.map +0 -1
  185. package/dist/chunk-X77Z4PFB.js +0 -224
  186. package/dist/chunk-X77Z4PFB.js.map +0 -1
  187. package/dist/chunk-X7VG7OTT.js +0 -8
  188. package/dist/chunk-X7VG7OTT.js.map +0 -1
  189. package/dist/chunk-XE4K2SGI.js +0 -74
  190. package/dist/chunk-XE4K2SGI.js.map +0 -1
  191. package/dist/chunk-YIUG7IJK.js +0 -628
  192. package/dist/chunk-YIUG7IJK.js.map +0 -1
  193. package/dist/chunk-YNVN3V4Y.js +0 -13
  194. package/dist/chunk-YNVN3V4Y.js.map +0 -1
  195. package/dist/chunk-Z2S54IZX.js +0 -198
  196. package/dist/chunk-Z2S54IZX.js.map +0 -1
  197. package/dist/chunk-ZR6AH25Z.js +0 -17
  198. package/dist/chunk-ZR6AH25Z.js.map +0 -1
  199. package/dist/dialog-SPM3DTTI.js +0 -17
  200. package/dist/dialog-SPM3DTTI.js.map +0 -1
  201. package/dist/dropdown-menu-HMTWKWGK.js +0 -21
  202. package/dist/dropdown-menu-HMTWKWGK.js.map +0 -1
  203. package/dist/input-BH4P4S26.js +0 -6
  204. package/dist/input-BH4P4S26.js.map +0 -1
  205. package/dist/label-5Z4Q6VER.js +0 -8
  206. package/dist/label-5Z4Q6VER.js.map +0 -1
  207. package/dist/popover-IFOUXYLI.js +0 -18
  208. package/dist/popover-IFOUXYLI.js.map +0 -1
  209. package/dist/scroll-area-DJXNW6QX.js +0 -14
  210. package/dist/scroll-area-DJXNW6QX.js.map +0 -1
  211. package/dist/select-FZ277C3G.js +0 -22
  212. package/dist/select-FZ277C3G.js.map +0 -1
  213. package/dist/separator-BTMLN4NB.js +0 -8
  214. package/dist/separator-BTMLN4NB.js.map +0 -1
  215. package/dist/skeleton-DXIWBH4W.js +0 -6
  216. package/dist/skeleton-DXIWBH4W.js.map +0 -1
  217. package/dist/switch-4MCXIZBY.js +0 -13
  218. package/dist/switch-4MCXIZBY.js.map +0 -1
  219. package/dist/tabs-O7AW3APK.js +0 -17
  220. package/dist/tabs-O7AW3APK.js.map +0 -1
  221. package/dist/textarea-IB5WAFDO.js +0 -6
  222. package/dist/textarea-IB5WAFDO.js.map +0 -1
  223. package/dist/toggle-XVPPG6P4.js +0 -10
  224. package/dist/toggle-XVPPG6P4.js.map +0 -1
  225. package/dist/tooltip-JICZTD4F.js +0 -18
  226. package/dist/tooltip-JICZTD4F.js.map +0 -1
@@ -1,1069 +0,0 @@
1
- import { useCallbackRef } from './chunk-PFYVNM6H.js';
2
- import { Primitive } from './chunk-EXQ7GYRS.js';
3
- import { useComposedRefs } from './chunk-P25YCWQB.js';
4
- import * as React8 from 'react';
5
- import { useState } from 'react';
6
- import { jsx } from 'react/jsx-runtime';
7
-
8
- var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
9
- var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
10
- var EVENT_OPTIONS = { bubbles: false, cancelable: true };
11
- var FOCUS_SCOPE_NAME = "FocusScope";
12
- var FocusScope = React8.forwardRef((props, forwardedRef) => {
13
- const {
14
- loop = false,
15
- trapped = false,
16
- onMountAutoFocus: onMountAutoFocusProp,
17
- onUnmountAutoFocus: onUnmountAutoFocusProp,
18
- ...scopeProps
19
- } = props;
20
- const [container, setContainer] = React8.useState(null);
21
- const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
22
- const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
23
- const lastFocusedElementRef = React8.useRef(null);
24
- const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
25
- const focusScope = React8.useRef({
26
- paused: false,
27
- pause() {
28
- this.paused = true;
29
- },
30
- resume() {
31
- this.paused = false;
32
- }
33
- }).current;
34
- React8.useEffect(() => {
35
- if (trapped) {
36
- let handleFocusIn2 = function(event) {
37
- if (focusScope.paused || !container) return;
38
- const target = event.target;
39
- if (container.contains(target)) {
40
- lastFocusedElementRef.current = target;
41
- } else {
42
- focus(lastFocusedElementRef.current, { select: true });
43
- }
44
- }, handleFocusOut2 = function(event) {
45
- if (focusScope.paused || !container) return;
46
- const relatedTarget = event.relatedTarget;
47
- if (relatedTarget === null) return;
48
- if (!container.contains(relatedTarget)) {
49
- focus(lastFocusedElementRef.current, { select: true });
50
- }
51
- }, handleMutations2 = function(mutations) {
52
- const focusedElement = document.activeElement;
53
- if (focusedElement !== document.body) return;
54
- for (const mutation of mutations) {
55
- if (mutation.removedNodes.length > 0) focus(container);
56
- }
57
- };
58
- document.addEventListener("focusin", handleFocusIn2);
59
- document.addEventListener("focusout", handleFocusOut2);
60
- const mutationObserver = new MutationObserver(handleMutations2);
61
- if (container) mutationObserver.observe(container, { childList: true, subtree: true });
62
- return () => {
63
- document.removeEventListener("focusin", handleFocusIn2);
64
- document.removeEventListener("focusout", handleFocusOut2);
65
- mutationObserver.disconnect();
66
- };
67
- }
68
- }, [trapped, container, focusScope.paused]);
69
- React8.useEffect(() => {
70
- if (container) {
71
- focusScopesStack.add(focusScope);
72
- const previouslyFocusedElement = document.activeElement;
73
- const hasFocusedCandidate = container.contains(previouslyFocusedElement);
74
- if (!hasFocusedCandidate) {
75
- const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
76
- container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
77
- container.dispatchEvent(mountEvent);
78
- if (!mountEvent.defaultPrevented) {
79
- focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
80
- if (document.activeElement === previouslyFocusedElement) {
81
- focus(container);
82
- }
83
- }
84
- }
85
- return () => {
86
- container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
87
- setTimeout(() => {
88
- const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
89
- container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
90
- container.dispatchEvent(unmountEvent);
91
- if (!unmountEvent.defaultPrevented) {
92
- focus(previouslyFocusedElement ?? document.body, { select: true });
93
- }
94
- container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
95
- focusScopesStack.remove(focusScope);
96
- }, 0);
97
- };
98
- }
99
- }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
100
- const handleKeyDown = React8.useCallback(
101
- (event) => {
102
- if (!loop && !trapped) return;
103
- if (focusScope.paused) return;
104
- const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
105
- const focusedElement = document.activeElement;
106
- if (isTabKey && focusedElement) {
107
- const container2 = event.currentTarget;
108
- const [first, last] = getTabbableEdges(container2);
109
- const hasTabbableElementsInside = first && last;
110
- if (!hasTabbableElementsInside) {
111
- if (focusedElement === container2) event.preventDefault();
112
- } else {
113
- if (!event.shiftKey && focusedElement === last) {
114
- event.preventDefault();
115
- if (loop) focus(first, { select: true });
116
- } else if (event.shiftKey && focusedElement === first) {
117
- event.preventDefault();
118
- if (loop) focus(last, { select: true });
119
- }
120
- }
121
- }
122
- },
123
- [loop, trapped, focusScope.paused]
124
- );
125
- return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
126
- });
127
- FocusScope.displayName = FOCUS_SCOPE_NAME;
128
- function focusFirst(candidates, { select = false } = {}) {
129
- const previouslyFocusedElement = document.activeElement;
130
- for (const candidate of candidates) {
131
- focus(candidate, { select });
132
- if (document.activeElement !== previouslyFocusedElement) return;
133
- }
134
- }
135
- function getTabbableEdges(container) {
136
- const candidates = getTabbableCandidates(container);
137
- const first = findVisible(candidates, container);
138
- const last = findVisible(candidates.reverse(), container);
139
- return [first, last];
140
- }
141
- function getTabbableCandidates(container) {
142
- const nodes = [];
143
- const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
144
- acceptNode: (node) => {
145
- const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
146
- if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
147
- return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
148
- }
149
- });
150
- while (walker.nextNode()) nodes.push(walker.currentNode);
151
- return nodes;
152
- }
153
- function findVisible(elements, container) {
154
- for (const element of elements) {
155
- if (!isHidden(element, { upTo: container })) return element;
156
- }
157
- }
158
- function isHidden(node, { upTo }) {
159
- if (getComputedStyle(node).visibility === "hidden") return true;
160
- while (node) {
161
- if (upTo !== void 0 && node === upTo) return false;
162
- if (getComputedStyle(node).display === "none") return true;
163
- node = node.parentElement;
164
- }
165
- return false;
166
- }
167
- function isSelectableInput(element) {
168
- return element instanceof HTMLInputElement && "select" in element;
169
- }
170
- function focus(element, { select = false } = {}) {
171
- if (element && element.focus) {
172
- const previouslyFocusedElement = document.activeElement;
173
- element.focus({ preventScroll: true });
174
- if (element !== previouslyFocusedElement && isSelectableInput(element) && select)
175
- element.select();
176
- }
177
- }
178
- var focusScopesStack = createFocusScopesStack();
179
- function createFocusScopesStack() {
180
- let stack = [];
181
- return {
182
- add(focusScope) {
183
- const activeFocusScope = stack[0];
184
- if (focusScope !== activeFocusScope) {
185
- activeFocusScope?.pause();
186
- }
187
- stack = arrayRemove(stack, focusScope);
188
- stack.unshift(focusScope);
189
- },
190
- remove(focusScope) {
191
- stack = arrayRemove(stack, focusScope);
192
- stack[0]?.resume();
193
- }
194
- };
195
- }
196
- function arrayRemove(array, item) {
197
- const updatedArray = [...array];
198
- const index = updatedArray.indexOf(item);
199
- if (index !== -1) {
200
- updatedArray.splice(index, 1);
201
- }
202
- return updatedArray;
203
- }
204
- function removeLinks(items) {
205
- return items.filter((item) => item.tagName !== "A");
206
- }
207
- var count = 0;
208
- function useFocusGuards() {
209
- React8.useEffect(() => {
210
- const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
211
- document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
212
- document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
213
- count++;
214
- return () => {
215
- if (count === 1) {
216
- document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
217
- }
218
- count--;
219
- };
220
- }, []);
221
- }
222
- function createFocusGuard() {
223
- const element = document.createElement("span");
224
- element.setAttribute("data-radix-focus-guard", "");
225
- element.tabIndex = 0;
226
- element.style.outline = "none";
227
- element.style.opacity = "0";
228
- element.style.position = "fixed";
229
- element.style.pointerEvents = "none";
230
- return element;
231
- }
232
-
233
- // ../../node_modules/react-remove-scroll/node_modules/tslib/tslib.es6.mjs
234
- var __assign = function() {
235
- __assign = Object.assign || function __assign3(t) {
236
- for (var s, i = 1, n = arguments.length; i < n; i++) {
237
- s = arguments[i];
238
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
239
- }
240
- return t;
241
- };
242
- return __assign.apply(this, arguments);
243
- };
244
- function __rest(s, e) {
245
- var t = {};
246
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
247
- t[p] = s[p];
248
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
249
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
250
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
251
- t[p[i]] = s[p[i]];
252
- }
253
- return t;
254
- }
255
- function __spreadArray(to, from, pack) {
256
- for (var i = 0, l = from.length, ar; i < l; i++) {
257
- if (ar || !(i in from)) {
258
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
259
- ar[i] = from[i];
260
- }
261
- }
262
- return to.concat(ar || Array.prototype.slice.call(from));
263
- }
264
-
265
- // ../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js
266
- var zeroRightClassName = "right-scroll-bar-position";
267
- var fullWidthClassName = "width-before-scroll-bar";
268
- var noScrollbarsClassName = "with-scroll-bars-hidden";
269
- var removedBarSizeVariable = "--removed-body-scroll-bar-size";
270
-
271
- // ../../node_modules/use-callback-ref/dist/es2015/assignRef.js
272
- function assignRef(ref, value) {
273
- if (typeof ref === "function") {
274
- ref(value);
275
- } else if (ref) {
276
- ref.current = value;
277
- }
278
- return ref;
279
- }
280
- function useCallbackRef2(initialValue, callback) {
281
- var ref = useState(function() {
282
- return {
283
- // value
284
- value: initialValue,
285
- // last callback
286
- callback,
287
- // "memoized" public interface
288
- facade: {
289
- get current() {
290
- return ref.value;
291
- },
292
- set current(value) {
293
- var last = ref.value;
294
- if (last !== value) {
295
- ref.value = value;
296
- ref.callback(value, last);
297
- }
298
- }
299
- }
300
- };
301
- })[0];
302
- ref.callback = callback;
303
- return ref.facade;
304
- }
305
- var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React8.useLayoutEffect : React8.useEffect;
306
- var currentValues = /* @__PURE__ */ new WeakMap();
307
- function useMergeRefs(refs, defaultValue) {
308
- var callbackRef = useCallbackRef2(null, function(newValue) {
309
- return refs.forEach(function(ref) {
310
- return assignRef(ref, newValue);
311
- });
312
- });
313
- useIsomorphicLayoutEffect(function() {
314
- var oldValue = currentValues.get(callbackRef);
315
- if (oldValue) {
316
- var prevRefs_1 = new Set(oldValue);
317
- var nextRefs_1 = new Set(refs);
318
- var current_1 = callbackRef.current;
319
- prevRefs_1.forEach(function(ref) {
320
- if (!nextRefs_1.has(ref)) {
321
- assignRef(ref, null);
322
- }
323
- });
324
- nextRefs_1.forEach(function(ref) {
325
- if (!prevRefs_1.has(ref)) {
326
- assignRef(ref, current_1);
327
- }
328
- });
329
- }
330
- currentValues.set(callbackRef, refs);
331
- }, [refs]);
332
- return callbackRef;
333
- }
334
-
335
- // ../../node_modules/use-sidecar/node_modules/tslib/tslib.es6.mjs
336
- var __assign2 = function() {
337
- __assign2 = Object.assign || function __assign3(t) {
338
- for (var s, i = 1, n = arguments.length; i < n; i++) {
339
- s = arguments[i];
340
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
341
- }
342
- return t;
343
- };
344
- return __assign2.apply(this, arguments);
345
- };
346
- function __rest2(s, e) {
347
- var t = {};
348
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
349
- t[p] = s[p];
350
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
351
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
352
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
353
- t[p[i]] = s[p[i]];
354
- }
355
- return t;
356
- }
357
-
358
- // ../../node_modules/use-sidecar/dist/es2015/medium.js
359
- function ItoI(a) {
360
- return a;
361
- }
362
- function innerCreateMedium(defaults, middleware) {
363
- if (middleware === void 0) {
364
- middleware = ItoI;
365
- }
366
- var buffer = [];
367
- var assigned = false;
368
- var medium = {
369
- read: function() {
370
- if (assigned) {
371
- throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
372
- }
373
- if (buffer.length) {
374
- return buffer[buffer.length - 1];
375
- }
376
- return defaults;
377
- },
378
- useMedium: function(data) {
379
- var item = middleware(data, assigned);
380
- buffer.push(item);
381
- return function() {
382
- buffer = buffer.filter(function(x) {
383
- return x !== item;
384
- });
385
- };
386
- },
387
- assignSyncMedium: function(cb) {
388
- assigned = true;
389
- while (buffer.length) {
390
- var cbs = buffer;
391
- buffer = [];
392
- cbs.forEach(cb);
393
- }
394
- buffer = {
395
- push: function(x) {
396
- return cb(x);
397
- },
398
- filter: function() {
399
- return buffer;
400
- }
401
- };
402
- },
403
- assignMedium: function(cb) {
404
- assigned = true;
405
- var pendingQueue = [];
406
- if (buffer.length) {
407
- var cbs = buffer;
408
- buffer = [];
409
- cbs.forEach(cb);
410
- pendingQueue = buffer;
411
- }
412
- var executeQueue = function() {
413
- var cbs2 = pendingQueue;
414
- pendingQueue = [];
415
- cbs2.forEach(cb);
416
- };
417
- var cycle = function() {
418
- return Promise.resolve().then(executeQueue);
419
- };
420
- cycle();
421
- buffer = {
422
- push: function(x) {
423
- pendingQueue.push(x);
424
- cycle();
425
- },
426
- filter: function(filter) {
427
- pendingQueue = pendingQueue.filter(filter);
428
- return buffer;
429
- }
430
- };
431
- }
432
- };
433
- return medium;
434
- }
435
- function createSidecarMedium(options) {
436
- if (options === void 0) {
437
- options = {};
438
- }
439
- var medium = innerCreateMedium(null);
440
- medium.options = __assign2({ async: true, ssr: false }, options);
441
- return medium;
442
- }
443
- var SideCar = function(_a) {
444
- var sideCar = _a.sideCar, rest = __rest2(_a, ["sideCar"]);
445
- if (!sideCar) {
446
- throw new Error("Sidecar: please provide `sideCar` property to import the right car");
447
- }
448
- var Target = sideCar.read();
449
- if (!Target) {
450
- throw new Error("Sidecar medium not found");
451
- }
452
- return React8.createElement(Target, __assign2({}, rest));
453
- };
454
- SideCar.isSideCarExport = true;
455
- function exportSidecar(medium, exported) {
456
- medium.useMedium(exported);
457
- return SideCar;
458
- }
459
-
460
- // ../../node_modules/react-remove-scroll/dist/es2015/medium.js
461
- var effectCar = createSidecarMedium();
462
-
463
- // ../../node_modules/react-remove-scroll/dist/es2015/UI.js
464
- var nothing = function() {
465
- return;
466
- };
467
- var RemoveScroll = React8.forwardRef(function(props, parentRef) {
468
- var ref = React8.useRef(null);
469
- var _a = React8.useState({
470
- onScrollCapture: nothing,
471
- onWheelCapture: nothing,
472
- onTouchMoveCapture: nothing
473
- }), callbacks = _a[0], setCallbacks = _a[1];
474
- var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
475
- var SideCar2 = sideCar;
476
- var containerRef = useMergeRefs([ref, parentRef]);
477
- var containerProps = __assign(__assign({}, rest), callbacks);
478
- return React8.createElement(
479
- React8.Fragment,
480
- null,
481
- enabled && React8.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
482
- forwardProps ? React8.cloneElement(React8.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React8.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
483
- );
484
- });
485
- RemoveScroll.defaultProps = {
486
- enabled: true,
487
- removeScrollBar: true,
488
- inert: false
489
- };
490
- RemoveScroll.classNames = {
491
- fullWidth: fullWidthClassName,
492
- zeroRight: zeroRightClassName
493
- };
494
- var getNonce = function() {
495
- if (typeof __webpack_nonce__ !== "undefined") {
496
- return __webpack_nonce__;
497
- }
498
- return void 0;
499
- };
500
-
501
- // ../../node_modules/react-style-singleton/dist/es2015/singleton.js
502
- function makeStyleTag() {
503
- if (!document)
504
- return null;
505
- var tag = document.createElement("style");
506
- tag.type = "text/css";
507
- var nonce = getNonce();
508
- if (nonce) {
509
- tag.setAttribute("nonce", nonce);
510
- }
511
- return tag;
512
- }
513
- function injectStyles(tag, css) {
514
- if (tag.styleSheet) {
515
- tag.styleSheet.cssText = css;
516
- } else {
517
- tag.appendChild(document.createTextNode(css));
518
- }
519
- }
520
- function insertStyleTag(tag) {
521
- var head = document.head || document.getElementsByTagName("head")[0];
522
- head.appendChild(tag);
523
- }
524
- var stylesheetSingleton = function() {
525
- var counter = 0;
526
- var stylesheet = null;
527
- return {
528
- add: function(style) {
529
- if (counter == 0) {
530
- if (stylesheet = makeStyleTag()) {
531
- injectStyles(stylesheet, style);
532
- insertStyleTag(stylesheet);
533
- }
534
- }
535
- counter++;
536
- },
537
- remove: function() {
538
- counter--;
539
- if (!counter && stylesheet) {
540
- stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
541
- stylesheet = null;
542
- }
543
- }
544
- };
545
- };
546
-
547
- // ../../node_modules/react-style-singleton/dist/es2015/hook.js
548
- var styleHookSingleton = function() {
549
- var sheet = stylesheetSingleton();
550
- return function(styles, isDynamic) {
551
- React8.useEffect(function() {
552
- sheet.add(styles);
553
- return function() {
554
- sheet.remove();
555
- };
556
- }, [styles && isDynamic]);
557
- };
558
- };
559
-
560
- // ../../node_modules/react-style-singleton/dist/es2015/component.js
561
- var styleSingleton = function() {
562
- var useStyle = styleHookSingleton();
563
- var Sheet = function(_a) {
564
- var styles = _a.styles, dynamic = _a.dynamic;
565
- useStyle(styles, dynamic);
566
- return null;
567
- };
568
- return Sheet;
569
- };
570
-
571
- // ../../node_modules/react-remove-scroll-bar/dist/es2015/utils.js
572
- var zeroGap = {
573
- left: 0,
574
- top: 0,
575
- right: 0,
576
- gap: 0
577
- };
578
- var parse = function(x) {
579
- return parseInt(x || "", 10) || 0;
580
- };
581
- var getOffset = function(gapMode) {
582
- var cs = window.getComputedStyle(document.body);
583
- var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
584
- var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
585
- var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
586
- return [parse(left), parse(top), parse(right)];
587
- };
588
- var getGapWidth = function(gapMode) {
589
- if (gapMode === void 0) {
590
- gapMode = "margin";
591
- }
592
- if (typeof window === "undefined") {
593
- return zeroGap;
594
- }
595
- var offsets = getOffset(gapMode);
596
- var documentWidth = document.documentElement.clientWidth;
597
- var windowWidth = window.innerWidth;
598
- return {
599
- left: offsets[0],
600
- top: offsets[1],
601
- right: offsets[2],
602
- gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
603
- };
604
- };
605
-
606
- // ../../node_modules/react-remove-scroll-bar/dist/es2015/component.js
607
- var Style = styleSingleton();
608
- var lockAttribute = "data-scroll-locked";
609
- var getStyles = function(_a, allowRelative, gapMode, important) {
610
- var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
611
- if (gapMode === void 0) {
612
- gapMode = "margin";
613
- }
614
- return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
615
- allowRelative && "position: relative ".concat(important, ";"),
616
- gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
617
- gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
618
- ].filter(Boolean).join(""), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
619
- };
620
- var getCurrentUseCounter = function() {
621
- var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
622
- return isFinite(counter) ? counter : 0;
623
- };
624
- var useLockAttribute = function() {
625
- React8.useEffect(function() {
626
- document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
627
- return function() {
628
- var newCounter = getCurrentUseCounter() - 1;
629
- if (newCounter <= 0) {
630
- document.body.removeAttribute(lockAttribute);
631
- } else {
632
- document.body.setAttribute(lockAttribute, newCounter.toString());
633
- }
634
- };
635
- }, []);
636
- };
637
- var RemoveScrollBar = function(_a) {
638
- var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
639
- useLockAttribute();
640
- var gap = React8.useMemo(function() {
641
- return getGapWidth(gapMode);
642
- }, [gapMode]);
643
- return React8.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
644
- };
645
-
646
- // ../../node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
647
- var passiveSupported = false;
648
- if (typeof window !== "undefined") {
649
- try {
650
- options = Object.defineProperty({}, "passive", {
651
- get: function() {
652
- passiveSupported = true;
653
- return true;
654
- }
655
- });
656
- window.addEventListener("test", options, options);
657
- window.removeEventListener("test", options, options);
658
- } catch (err) {
659
- passiveSupported = false;
660
- }
661
- }
662
- var options;
663
- var nonPassive = passiveSupported ? { passive: false } : false;
664
-
665
- // ../../node_modules/react-remove-scroll/dist/es2015/handleScroll.js
666
- var alwaysContainsScroll = function(node) {
667
- return node.tagName === "TEXTAREA";
668
- };
669
- var elementCanBeScrolled = function(node, overflow) {
670
- if (!(node instanceof Element)) {
671
- return false;
672
- }
673
- var styles = window.getComputedStyle(node);
674
- return (
675
- // not-not-scrollable
676
- styles[overflow] !== "hidden" && // contains scroll inside self
677
- !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible")
678
- );
679
- };
680
- var elementCouldBeVScrolled = function(node) {
681
- return elementCanBeScrolled(node, "overflowY");
682
- };
683
- var elementCouldBeHScrolled = function(node) {
684
- return elementCanBeScrolled(node, "overflowX");
685
- };
686
- var locationCouldBeScrolled = function(axis, node) {
687
- var ownerDocument = node.ownerDocument;
688
- var current = node;
689
- do {
690
- if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) {
691
- current = current.host;
692
- }
693
- var isScrollable = elementCouldBeScrolled(axis, current);
694
- if (isScrollable) {
695
- var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
696
- if (scrollHeight > clientHeight) {
697
- return true;
698
- }
699
- }
700
- current = current.parentNode;
701
- } while (current && current !== ownerDocument.body);
702
- return false;
703
- };
704
- var getVScrollVariables = function(_a) {
705
- var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
706
- return [
707
- scrollTop,
708
- scrollHeight,
709
- clientHeight
710
- ];
711
- };
712
- var getHScrollVariables = function(_a) {
713
- var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
714
- return [
715
- scrollLeft,
716
- scrollWidth,
717
- clientWidth
718
- ];
719
- };
720
- var elementCouldBeScrolled = function(axis, node) {
721
- return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
722
- };
723
- var getScrollVariables = function(axis, node) {
724
- return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
725
- };
726
- var getDirectionFactor = function(axis, direction) {
727
- return axis === "h" && direction === "rtl" ? -1 : 1;
728
- };
729
- var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
730
- var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
731
- var delta = directionFactor * sourceDelta;
732
- var target = event.target;
733
- var targetInLock = endTarget.contains(target);
734
- var shouldCancelScroll = false;
735
- var isDeltaPositive = delta > 0;
736
- var availableScroll = 0;
737
- var availableScrollTop = 0;
738
- do {
739
- if (!target) {
740
- break;
741
- }
742
- var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
743
- var elementScroll = scroll_1 - capacity - directionFactor * position;
744
- if (position || elementScroll) {
745
- if (elementCouldBeScrolled(axis, target)) {
746
- availableScroll += elementScroll;
747
- availableScrollTop += position;
748
- }
749
- }
750
- var parent_1 = target.parentNode;
751
- target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
752
- } while (
753
- // portaled content
754
- !targetInLock && target !== document.body || // self content
755
- targetInLock && (endTarget.contains(target) || endTarget === target)
756
- );
757
- if (isDeltaPositive && (Math.abs(availableScroll) < 1 || false)) {
758
- shouldCancelScroll = true;
759
- } else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || false)) {
760
- shouldCancelScroll = true;
761
- }
762
- return shouldCancelScroll;
763
- };
764
-
765
- // ../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js
766
- var getTouchXY = function(event) {
767
- return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
768
- };
769
- var getDeltaXY = function(event) {
770
- return [event.deltaX, event.deltaY];
771
- };
772
- var extractRef = function(ref) {
773
- return ref && "current" in ref ? ref.current : ref;
774
- };
775
- var deltaCompare = function(x, y) {
776
- return x[0] === y[0] && x[1] === y[1];
777
- };
778
- var generateStyle = function(id) {
779
- return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n");
780
- };
781
- var idCounter = 0;
782
- var lockStack = [];
783
- function RemoveScrollSideCar(props) {
784
- var shouldPreventQueue = React8.useRef([]);
785
- var touchStartRef = React8.useRef([0, 0]);
786
- var activeAxis = React8.useRef();
787
- var id = React8.useState(idCounter++)[0];
788
- var Style2 = React8.useState(styleSingleton)[0];
789
- var lastProps = React8.useRef(props);
790
- React8.useEffect(function() {
791
- lastProps.current = props;
792
- }, [props]);
793
- React8.useEffect(function() {
794
- if (props.inert) {
795
- document.body.classList.add("block-interactivity-".concat(id));
796
- var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef)).filter(Boolean);
797
- allow_1.forEach(function(el) {
798
- return el.classList.add("allow-interactivity-".concat(id));
799
- });
800
- return function() {
801
- document.body.classList.remove("block-interactivity-".concat(id));
802
- allow_1.forEach(function(el) {
803
- return el.classList.remove("allow-interactivity-".concat(id));
804
- });
805
- };
806
- }
807
- return;
808
- }, [props.inert, props.lockRef.current, props.shards]);
809
- var shouldCancelEvent = React8.useCallback(function(event, parent) {
810
- if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
811
- return !lastProps.current.allowPinchZoom;
812
- }
813
- var touch = getTouchXY(event);
814
- var touchStart = touchStartRef.current;
815
- var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
816
- var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
817
- var currentAxis;
818
- var target = event.target;
819
- var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
820
- if ("touches" in event && moveDirection === "h" && target.type === "range") {
821
- return false;
822
- }
823
- var selection = window.getSelection();
824
- var anchorNode = selection && selection.anchorNode;
825
- var isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;
826
- if (isTouchingSelection) {
827
- return false;
828
- }
829
- var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
830
- if (!canBeScrolledInMainDirection) {
831
- return true;
832
- }
833
- if (canBeScrolledInMainDirection) {
834
- currentAxis = moveDirection;
835
- } else {
836
- currentAxis = moveDirection === "v" ? "h" : "v";
837
- canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
838
- }
839
- if (!canBeScrolledInMainDirection) {
840
- return false;
841
- }
842
- if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) {
843
- activeAxis.current = currentAxis;
844
- }
845
- if (!currentAxis) {
846
- return true;
847
- }
848
- var cancelingAxis = activeAxis.current || currentAxis;
849
- return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
850
- }, []);
851
- var shouldPrevent = React8.useCallback(function(_event) {
852
- var event = _event;
853
- if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
854
- return;
855
- }
856
- var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
857
- var sourceEvent = shouldPreventQueue.current.filter(function(e) {
858
- return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
859
- })[0];
860
- if (sourceEvent && sourceEvent.should) {
861
- if (event.cancelable) {
862
- event.preventDefault();
863
- }
864
- return;
865
- }
866
- if (!sourceEvent) {
867
- var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
868
- return node.contains(event.target);
869
- });
870
- var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
871
- if (shouldStop) {
872
- if (event.cancelable) {
873
- event.preventDefault();
874
- }
875
- }
876
- }
877
- }, []);
878
- var shouldCancel = React8.useCallback(function(name, delta, target, should) {
879
- var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
880
- shouldPreventQueue.current.push(event);
881
- setTimeout(function() {
882
- shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
883
- return e !== event;
884
- });
885
- }, 1);
886
- }, []);
887
- var scrollTouchStart = React8.useCallback(function(event) {
888
- touchStartRef.current = getTouchXY(event);
889
- activeAxis.current = void 0;
890
- }, []);
891
- var scrollWheel = React8.useCallback(function(event) {
892
- shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
893
- }, []);
894
- var scrollTouchMove = React8.useCallback(function(event) {
895
- shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
896
- }, []);
897
- React8.useEffect(function() {
898
- lockStack.push(Style2);
899
- props.setCallbacks({
900
- onScrollCapture: scrollWheel,
901
- onWheelCapture: scrollWheel,
902
- onTouchMoveCapture: scrollTouchMove
903
- });
904
- document.addEventListener("wheel", shouldPrevent, nonPassive);
905
- document.addEventListener("touchmove", shouldPrevent, nonPassive);
906
- document.addEventListener("touchstart", scrollTouchStart, nonPassive);
907
- return function() {
908
- lockStack = lockStack.filter(function(inst) {
909
- return inst !== Style2;
910
- });
911
- document.removeEventListener("wheel", shouldPrevent, nonPassive);
912
- document.removeEventListener("touchmove", shouldPrevent, nonPassive);
913
- document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
914
- };
915
- }, []);
916
- var removeScrollBar = props.removeScrollBar, inert = props.inert;
917
- return React8.createElement(
918
- React8.Fragment,
919
- null,
920
- inert ? React8.createElement(Style2, { styles: generateStyle(id) }) : null,
921
- removeScrollBar ? React8.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
922
- );
923
- }
924
- function getOutermostShadowParent(node) {
925
- var shadowParent = null;
926
- while (node !== null) {
927
- if (node instanceof ShadowRoot) {
928
- shadowParent = node.host;
929
- node = node.host;
930
- }
931
- node = node.parentNode;
932
- }
933
- return shadowParent;
934
- }
935
-
936
- // ../../node_modules/react-remove-scroll/dist/es2015/sidecar.js
937
- var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
938
-
939
- // ../../node_modules/react-remove-scroll/dist/es2015/Combination.js
940
- var ReactRemoveScroll = React8.forwardRef(function(props, ref) {
941
- return React8.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
942
- });
943
- ReactRemoveScroll.classNames = RemoveScroll.classNames;
944
- var Combination_default = ReactRemoveScroll;
945
-
946
- // ../../node_modules/aria-hidden/dist/es2015/index.js
947
- var getDefaultParent = function(originalTarget) {
948
- if (typeof document === "undefined") {
949
- return null;
950
- }
951
- var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
952
- return sampleTarget.ownerDocument.body;
953
- };
954
- var counterMap = /* @__PURE__ */ new WeakMap();
955
- var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
956
- var markerMap = {};
957
- var lockCount = 0;
958
- var unwrapHost = function(node) {
959
- return node && (node.host || unwrapHost(node.parentNode));
960
- };
961
- var correctTargets = function(parent, targets) {
962
- return targets.map(function(target) {
963
- if (parent.contains(target)) {
964
- return target;
965
- }
966
- var correctedTarget = unwrapHost(target);
967
- if (correctedTarget && parent.contains(correctedTarget)) {
968
- return correctedTarget;
969
- }
970
- console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
971
- return null;
972
- }).filter(function(x) {
973
- return Boolean(x);
974
- });
975
- };
976
- var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
977
- var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
978
- if (!markerMap[markerName]) {
979
- markerMap[markerName] = /* @__PURE__ */ new WeakMap();
980
- }
981
- var markerCounter = markerMap[markerName];
982
- var hiddenNodes = [];
983
- var elementsToKeep = /* @__PURE__ */ new Set();
984
- var elementsToStop = new Set(targets);
985
- var keep = function(el) {
986
- if (!el || elementsToKeep.has(el)) {
987
- return;
988
- }
989
- elementsToKeep.add(el);
990
- keep(el.parentNode);
991
- };
992
- targets.forEach(keep);
993
- var deep = function(parent) {
994
- if (!parent || elementsToStop.has(parent)) {
995
- return;
996
- }
997
- Array.prototype.forEach.call(parent.children, function(node) {
998
- if (elementsToKeep.has(node)) {
999
- deep(node);
1000
- } else {
1001
- try {
1002
- var attr = node.getAttribute(controlAttribute);
1003
- var alreadyHidden = attr !== null && attr !== "false";
1004
- var counterValue = (counterMap.get(node) || 0) + 1;
1005
- var markerValue = (markerCounter.get(node) || 0) + 1;
1006
- counterMap.set(node, counterValue);
1007
- markerCounter.set(node, markerValue);
1008
- hiddenNodes.push(node);
1009
- if (counterValue === 1 && alreadyHidden) {
1010
- uncontrolledNodes.set(node, true);
1011
- }
1012
- if (markerValue === 1) {
1013
- node.setAttribute(markerName, "true");
1014
- }
1015
- if (!alreadyHidden) {
1016
- node.setAttribute(controlAttribute, "true");
1017
- }
1018
- } catch (e) {
1019
- console.error("aria-hidden: cannot operate on ", node, e);
1020
- }
1021
- }
1022
- });
1023
- };
1024
- deep(parentNode);
1025
- elementsToKeep.clear();
1026
- lockCount++;
1027
- return function() {
1028
- hiddenNodes.forEach(function(node) {
1029
- var counterValue = counterMap.get(node) - 1;
1030
- var markerValue = markerCounter.get(node) - 1;
1031
- counterMap.set(node, counterValue);
1032
- markerCounter.set(node, markerValue);
1033
- if (!counterValue) {
1034
- if (!uncontrolledNodes.has(node)) {
1035
- node.removeAttribute(controlAttribute);
1036
- }
1037
- uncontrolledNodes.delete(node);
1038
- }
1039
- if (!markerValue) {
1040
- node.removeAttribute(markerName);
1041
- }
1042
- });
1043
- lockCount--;
1044
- if (!lockCount) {
1045
- counterMap = /* @__PURE__ */ new WeakMap();
1046
- counterMap = /* @__PURE__ */ new WeakMap();
1047
- uncontrolledNodes = /* @__PURE__ */ new WeakMap();
1048
- markerMap = {};
1049
- }
1050
- };
1051
- };
1052
- var hideOthers = function(originalTarget, parentNode, markerName) {
1053
- if (markerName === void 0) {
1054
- markerName = "data-aria-hidden";
1055
- }
1056
- var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
1057
- var activeParentNode = parentNode || getDefaultParent(originalTarget);
1058
- if (!activeParentNode) {
1059
- return function() {
1060
- return null;
1061
- };
1062
- }
1063
- targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
1064
- return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
1065
- };
1066
-
1067
- export { Combination_default, FocusScope, hideOthers, useFocusGuards };
1068
- //# sourceMappingURL=chunk-AFNIVLZP.js.map
1069
- //# sourceMappingURL=chunk-AFNIVLZP.js.map