@pfct/purple 1.16.2 → 1.17.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 (166) hide show
  1. package/dist/chunks/Accordion.DYya7dTN.js +1 -0
  2. package/dist/chunks/Accordion.DgWTtf1u.js +716 -0
  3. package/dist/chunks/Divider.CptJ_x2Y.js +1 -0
  4. package/dist/chunks/{Divider.DBtnaPqJ.js → Divider.DR-c4z_i.js} +16 -13
  5. package/dist/chunks/DotLottie.BQNTv0XO.js +5 -0
  6. package/dist/chunks/DotLottie.qOfU0HjI.js +1993 -0
  7. package/dist/chunks/Switch.D7T_jbtK.js +207 -0
  8. package/dist/chunks/Switch.DUWZASi8.js +1 -0
  9. package/dist/chunks/Toast.Bnm65xmy.js +1 -0
  10. package/dist/chunks/Toast.C7OnkFjA.js +698 -0
  11. package/dist/chunks/{bottomSheet.BGKwHjuP.js → bottomSheet.DCURoJ3z.js} +1 -1
  12. package/dist/chunks/{bottomSheet.C99fAuQK.js → bottomSheet.DqOEMG09.js} +1 -1
  13. package/dist/chunks/checkbox.DjQsU_Pk.js +1 -0
  14. package/dist/chunks/{checkbox.DNdnhspb.js → checkbox.Dl8nNqLc.js} +100 -92
  15. package/dist/chunks/dist.AclwPuO5.js +1 -0
  16. package/dist/chunks/{dist.BskID78S.js → dist.B0edyUiC.js} +176 -178
  17. package/dist/chunks/dist.B4GZ3aX4.js +111 -0
  18. package/dist/chunks/dist.BE2xxxwt.js +96 -0
  19. package/dist/chunks/dist.Ba6P-3sU.js +1 -0
  20. package/dist/chunks/dist.BaV_5zx8.js +186 -0
  21. package/dist/chunks/{dist.CDZCWPu4.js → dist.BnLwXMBJ.js} +8 -4
  22. package/dist/chunks/dist.BpQ7SpeW.js +227 -0
  23. package/dist/chunks/dist.Bui5aGSB.js +197 -0
  24. package/dist/chunks/dist.CBOTGT1c.js +1 -0
  25. package/dist/chunks/dist.CIvT5XE_.js +1 -0
  26. package/dist/chunks/dist.CKG-hzoQ.js +1 -0
  27. package/dist/chunks/{dist.QtpYoD01.js → dist.CVClT59R.js} +8 -3
  28. package/dist/chunks/dist.CcSbgqVt.js +1 -0
  29. package/dist/chunks/dist.Cf8FjzvS.js +1 -0
  30. package/dist/chunks/{dist.DIjdcvlQ.js → dist.Cx1JFVV3.js} +48 -59
  31. package/dist/chunks/dist.D7s7BenH.js +1 -0
  32. package/dist/chunks/dist.DQ5uOc4y.js +1 -0
  33. package/dist/chunks/dist.DWzqVshx.js +16 -0
  34. package/dist/chunks/dist.DfLaHIBc.js +1 -0
  35. package/dist/chunks/dist.DomaJxrX.js +1 -0
  36. package/dist/chunks/dist.e7n2cf43.js +144 -0
  37. package/dist/chunks/dist.gUJz6qTg.js +185 -0
  38. package/dist/chunks/dist.zJ3rbM0i.js +1 -0
  39. package/dist/chunks/drawer.Cots0_ea.js +7 -0
  40. package/dist/chunks/drawer.ftfBm36h.js +1836 -0
  41. package/dist/chunks/es2015.CfvYaoE5.js +41 -0
  42. package/dist/chunks/{es2015.ByVyszJo.js → es2015.DCKfm2VN.js} +168 -187
  43. package/dist/chunks/{src.D-VoFbup.js → src.BAhu5d2_.js} +1 -1
  44. package/dist/chunks/{src.CmgILXZE.js → src.DlM6Ki-I.js} +5 -5
  45. package/dist/chunks/tooltip.8vKL7w2a.js +1 -0
  46. package/dist/chunks/tooltip.D9PoXwtV.js +448 -0
  47. package/dist/components/Accordion/index.cjs.js +1 -1
  48. package/dist/components/Accordion/index.esm.js +1 -1
  49. package/dist/components/Control/Switch/index.cjs.js +1 -1
  50. package/dist/components/Control/Switch/index.esm.js +1 -1
  51. package/dist/components/Control/index.cjs.js +1 -1
  52. package/dist/components/Control/index.esm.js +2 -2
  53. package/dist/components/Divider/index.cjs.js +1 -1
  54. package/dist/components/Divider/index.esm.js +1 -1
  55. package/dist/components/LegacyModal/index.cjs.js +1 -1
  56. package/dist/components/LegacyModal/index.esm.js +1 -1
  57. package/dist/components/MiniButton/IconMiniButton/index.cjs.js +1 -1
  58. package/dist/components/MiniButton/IconMiniButton/index.esm.js +1 -1
  59. package/dist/components/MiniButton/UnderLineMiniButton/index.cjs.js +1 -1
  60. package/dist/components/MiniButton/UnderLineMiniButton/index.esm.js +1 -1
  61. package/dist/components/Modal/index.cjs.js +1 -1
  62. package/dist/components/Modal/index.esm.js +1 -1
  63. package/dist/components/Pagination/index.cjs.js +1 -1
  64. package/dist/components/Pagination/index.esm.js +1 -1
  65. package/dist/components/Tabs/FillTabs/index.cjs.js +1 -1
  66. package/dist/components/Tabs/FillTabs/index.esm.js +1 -1
  67. package/dist/components/Tabs/index.cjs.js +1 -1
  68. package/dist/components/Tabs/index.esm.js +1 -1
  69. package/dist/components/Tag/index.cjs.js +1 -1
  70. package/dist/components/Tag/index.esm.js +1 -1
  71. package/dist/components/Terms/index.cjs.js +1 -1
  72. package/dist/components/Terms/index.esm.js +3 -3
  73. package/dist/components/Toast/index.cjs.js +1 -1
  74. package/dist/components/Toast/index.esm.js +1 -1
  75. package/dist/components/index.cjs.js +1 -1
  76. package/dist/components/index.esm.js +8 -8
  77. package/dist/components/ui/bottomSheet.cjs.js +1 -1
  78. package/dist/components/ui/bottomSheet.esm.js +1 -1
  79. package/dist/components/ui/button.cjs.js +1 -1
  80. package/dist/components/ui/button.esm.js +1 -1
  81. package/dist/components/ui/checkbox.cjs.js +1 -1
  82. package/dist/components/ui/checkbox.esm.js +1 -1
  83. package/dist/components/ui/dialog.cjs.js +1 -1
  84. package/dist/components/ui/dialog.esm.js +1 -1
  85. package/dist/components/ui/drawer.cjs.js +1 -1
  86. package/dist/components/ui/drawer.esm.js +1 -1
  87. package/dist/components/ui/impact-tooltip.cjs.js +1 -1
  88. package/dist/components/ui/impact-tooltip.esm.js +1 -1
  89. package/dist/components/ui/select.cjs.js +1 -1
  90. package/dist/components/ui/select.esm.js +3 -3
  91. package/dist/components/ui/tooltip.cjs.js +1 -1
  92. package/dist/components/ui/tooltip.esm.js +1 -1
  93. package/dist/components/ui/typography.cjs.js +1 -1
  94. package/dist/components/ui/typography.esm.js +1 -1
  95. package/dist/icons/src/aliases/aliases.cjs.js +1 -1
  96. package/dist/icons/src/aliases/aliases.d.ts +1 -1
  97. package/dist/icons/src/aliases/aliases.d.ts.map +1 -1
  98. package/dist/icons/src/aliases/aliases.esm.js +3 -3
  99. package/dist/icons/src/aliases/index.cjs.js +1 -1
  100. package/dist/icons/src/aliases/index.esm.js +3 -3
  101. package/dist/icons/src/aliases/prefixed.cjs.js +1 -1
  102. package/dist/icons/src/aliases/prefixed.d.ts +9 -9
  103. package/dist/icons/src/aliases/prefixed.d.ts.map +1 -1
  104. package/dist/icons/src/aliases/prefixed.esm.js +3 -3
  105. package/dist/icons/src/aliases/suffixed.cjs.js +1 -1
  106. package/dist/icons/src/aliases/suffixed.d.ts +10 -10
  107. package/dist/icons/src/aliases/suffixed.d.ts.map +1 -1
  108. package/dist/icons/src/aliases/suffixed.esm.js +3 -3
  109. package/dist/icons/src/icons/index.cjs.js +1 -1
  110. package/dist/icons/src/icons/index.esm.js +3 -3
  111. package/dist/index.cjs.js +1 -1
  112. package/dist/index.esm.js +12 -12
  113. package/dist/library/DotLottie/index.cjs.js +1 -1
  114. package/dist/library/DotLottie/index.d.ts +13 -0
  115. package/dist/library/DotLottie/index.d.ts.map +1 -1
  116. package/dist/library/DotLottie/index.esm.js +1 -1
  117. package/dist/library/Lottie/index.cjs.js +1 -1
  118. package/dist/library/Lottie/index.d.ts +13 -0
  119. package/dist/library/Lottie/index.d.ts.map +1 -1
  120. package/dist/library/Lottie/index.esm.js +25 -25
  121. package/dist/library/index.cjs.js +1 -1
  122. package/dist/library/index.esm.js +1 -1
  123. package/package.json +4 -4
  124. package/dist/chunks/Accordion.Cs1f4aQZ.js +0 -373
  125. package/dist/chunks/Accordion.ZIp0NsA0.js +0 -1
  126. package/dist/chunks/Divider.BIS4pXEy.js +0 -1
  127. package/dist/chunks/DotLottie.CaDygpsw.js +0 -73962
  128. package/dist/chunks/DotLottie.Cf-SL2bJ.js +0 -5
  129. package/dist/chunks/Switch.C6xwIjJR.js +0 -1
  130. package/dist/chunks/Switch.D_myxCrS.js +0 -200
  131. package/dist/chunks/Toast.Cjdk4za6.js +0 -1
  132. package/dist/chunks/Toast.D1-VfeA2.js +0 -685
  133. package/dist/chunks/checkbox.CfWB_nqn.js +0 -1
  134. package/dist/chunks/dist.B2wZmrK1.js +0 -98
  135. package/dist/chunks/dist.B8tpQk-4.js +0 -1
  136. package/dist/chunks/dist.BC0-iqKU.js +0 -1
  137. package/dist/chunks/dist.BGATFz6w.js +0 -1
  138. package/dist/chunks/dist.BQIeYu70.js +0 -1
  139. package/dist/chunks/dist.BWsA5f1f.js +0 -1
  140. package/dist/chunks/dist.BixLWWwb.js +0 -71
  141. package/dist/chunks/dist.Bxqi8VAi.js +0 -1
  142. package/dist/chunks/dist.C8FJXTu6.js +0 -10
  143. package/dist/chunks/dist.C8NniehT.js +0 -1
  144. package/dist/chunks/dist.C8k7jQIp.js +0 -87
  145. package/dist/chunks/dist.CEJ-WCY_.js +0 -44
  146. package/dist/chunks/dist.CIQdvun-.js +0 -1
  147. package/dist/chunks/dist.Cff8LOoN.js +0 -67
  148. package/dist/chunks/dist.CmRTDXGG.js +0 -1
  149. package/dist/chunks/dist.CwMFqhEQ.js +0 -146
  150. package/dist/chunks/dist.CwWM0zXK.js +0 -25
  151. package/dist/chunks/dist.CyhalHxz.js +0 -1
  152. package/dist/chunks/dist.Czpint58.js +0 -1
  153. package/dist/chunks/dist.D3cPoDZ_.js +0 -194
  154. package/dist/chunks/dist.D4mQo5QB.js +0 -1
  155. package/dist/chunks/dist.D5ataprQ.js +0 -1
  156. package/dist/chunks/dist.D6A3yc_d.js +0 -11
  157. package/dist/chunks/dist.DKOi9kq6.js +0 -1
  158. package/dist/chunks/dist.DhCw5vjE.js +0 -1
  159. package/dist/chunks/dist.DrfVZqiO.js +0 -186
  160. package/dist/chunks/dist.SHmlpKFY.js +0 -1
  161. package/dist/chunks/dist.kg7EEYPp.js +0 -12
  162. package/dist/chunks/drawer.Cji5AtcU.js +0 -1720
  163. package/dist/chunks/drawer.Gt1AjdVH.js +0 -7
  164. package/dist/chunks/es2015.D2emqwtq.js +0 -41
  165. package/dist/chunks/tooltip.DGgNTZ5B.js +0 -444
  166. package/dist/chunks/tooltip.vEwTtt8v.js +0 -1
@@ -0,0 +1,1836 @@
1
+ import { t as e } from "./utils.UNiIm9Bz.js";
2
+ import { n as t, t as n } from "./es2015.DCKfm2VN.js";
3
+ import * as r from "react";
4
+ import i, { useEffect as a, useLayoutEffect as o, useMemo as s } from "react";
5
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ import * as d from "react-dom";
7
+ typeof window < "u" && window.document && window.document.createElement;
8
+ function f(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
9
+ return function(r) {
10
+ if (e?.(r), n === !1 || !r.defaultPrevented) return t?.(r);
11
+ };
12
+ }
13
+ //#endregion
14
+ //#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
15
+ function p(e, t) {
16
+ if (typeof e == "function") return e(t);
17
+ e != null && (e.current = t);
18
+ }
19
+ function m(...e) {
20
+ return (t) => {
21
+ let n = !1, r = e.map((e) => {
22
+ let r = p(e, t);
23
+ return !n && typeof r == "function" && (n = !0), r;
24
+ });
25
+ if (n) return () => {
26
+ for (let t = 0; t < r.length; t++) {
27
+ let n = r[t];
28
+ typeof n == "function" ? n() : p(e[t], null);
29
+ }
30
+ };
31
+ };
32
+ }
33
+ function h(...e) {
34
+ return r.useCallback(m(...e), e);
35
+ }
36
+ //#endregion
37
+ //#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-context/dist/index.mjs
38
+ function g(e, t) {
39
+ let n = r.createContext(t);
40
+ n.displayName = e + "Context";
41
+ let i = (e) => {
42
+ let { children: t, ...i } = e, a = r.useMemo(() => i, Object.values(i));
43
+ return /* @__PURE__ */ l(n.Provider, {
44
+ value: a,
45
+ children: t
46
+ });
47
+ };
48
+ i.displayName = e + "Provider";
49
+ function a(i) {
50
+ let a = r.useContext(n);
51
+ if (a) return a;
52
+ if (t !== void 0) return t;
53
+ throw Error(`\`${i}\` must be used within \`${e}\``);
54
+ }
55
+ return [i, a];
56
+ }
57
+ function _(e, t = []) {
58
+ let n = [];
59
+ function i(t, i) {
60
+ let a = r.createContext(i);
61
+ a.displayName = t + "Context";
62
+ let o = n.length;
63
+ n = [...n, i];
64
+ let s = (t) => {
65
+ let { scope: n, children: i, ...s } = t, c = n?.[e]?.[o] || a, u = r.useMemo(() => s, Object.values(s));
66
+ return /* @__PURE__ */ l(c.Provider, {
67
+ value: u,
68
+ children: i
69
+ });
70
+ };
71
+ s.displayName = t + "Provider";
72
+ function c(n, s) {
73
+ let c = s?.[e]?.[o] || a, l = r.useContext(c);
74
+ if (l) return l;
75
+ if (i !== void 0) return i;
76
+ throw Error(`\`${n}\` must be used within \`${t}\``);
77
+ }
78
+ return [s, c];
79
+ }
80
+ let a = () => {
81
+ let t = n.map((e) => r.createContext(e));
82
+ return function(n) {
83
+ let i = n?.[e] || t;
84
+ return r.useMemo(() => ({ [`__scope${e}`]: {
85
+ ...n,
86
+ [e]: i
87
+ } }), [n, i]);
88
+ };
89
+ };
90
+ return a.scopeName = e, [i, v(a, ...t)];
91
+ }
92
+ function v(...e) {
93
+ let t = e[0];
94
+ if (e.length === 1) return t;
95
+ let n = () => {
96
+ let n = e.map((e) => ({
97
+ useScope: e(),
98
+ scopeName: e.scopeName
99
+ }));
100
+ return function(e) {
101
+ let i = n.reduce((t, { useScope: n, scopeName: r }) => {
102
+ let i = n(e)[`__scope${r}`];
103
+ return {
104
+ ...t,
105
+ ...i
106
+ };
107
+ }, {});
108
+ return r.useMemo(() => ({ [`__scope${t.scopeName}`]: i }), [i]);
109
+ };
110
+ };
111
+ return n.scopeName = t.scopeName, n;
112
+ }
113
+ //#endregion
114
+ //#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-id/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
115
+ var y = globalThis?.document ? r.useLayoutEffect : () => {}, b = r.useId || (() => void 0), x = 0;
116
+ function S(e) {
117
+ let [t, n] = r.useState(b());
118
+ return y(() => {
119
+ e || n((e) => e ?? String(x++));
120
+ }, [e]), e || (t ? `radix-${t}` : "");
121
+ }
122
+ //#endregion
123
+ //#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-controllable-state/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
124
+ var C = globalThis?.document ? r.useLayoutEffect : () => {}, w = r.useInsertionEffect || C;
125
+ function T({ prop: e, defaultProp: t, onChange: n = () => {}, caller: i }) {
126
+ let [a, o, s] = E({
127
+ defaultProp: t,
128
+ onChange: n
129
+ }), c = e !== void 0, l = c ? e : a;
130
+ {
131
+ let t = r.useRef(e !== void 0);
132
+ r.useEffect(() => {
133
+ let e = t.current;
134
+ e !== c && console.warn(`${i} is changing from ${e ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`), t.current = c;
135
+ }, [c, i]);
136
+ }
137
+ return [l, r.useCallback((t) => {
138
+ if (c) {
139
+ let n = ee(t) ? t(e) : t;
140
+ n !== e && s.current?.(n);
141
+ } else o(t);
142
+ }, [
143
+ c,
144
+ e,
145
+ o,
146
+ s
147
+ ])];
148
+ }
149
+ function E({ defaultProp: e, onChange: t }) {
150
+ let [n, i] = r.useState(e), a = r.useRef(n), o = r.useRef(t);
151
+ return w(() => {
152
+ o.current = t;
153
+ }, [t]), r.useEffect(() => {
154
+ a.current !== n && (o.current?.(n), a.current = n);
155
+ }, [n, a]), [
156
+ n,
157
+ i,
158
+ o
159
+ ];
160
+ }
161
+ function ee(e) {
162
+ return typeof e == "function";
163
+ }
164
+ //#endregion
165
+ //#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.mjs
166
+ // @__NO_SIDE_EFFECTS__
167
+ function D(e) {
168
+ let t = r.forwardRef((t, n) => {
169
+ let { children: i, ...a } = t, o = null, s = !1, c = [];
170
+ A(i) && typeof M == "function" && (i = M(i._payload)), r.Children.forEach(i, (e) => {
171
+ if (ie(e)) {
172
+ s = !0;
173
+ let t = e, n = "child" in t.props ? t.props.child : t.props.children;
174
+ A(n) && typeof M == "function" && (n = M(n._payload)), o = O(t, n), c.push(o?.props?.children);
175
+ } else c.push(e);
176
+ }), o ? o = r.cloneElement(o, void 0, c) : !s && r.Children.count(i) === 1 && r.isValidElement(i) && (o = i);
177
+ let l = o ? re(o) : void 0, u = h(n, l);
178
+ if (!o) {
179
+ if (i || i === 0) throw Error(s ? j(e) : oe(e));
180
+ return i;
181
+ }
182
+ let d = ne(a, o.props ?? {});
183
+ return o.type !== r.Fragment && (d.ref = n ? u : l), r.cloneElement(o, d);
184
+ });
185
+ return t.displayName = `${e}.Slot`, t;
186
+ }
187
+ var te = Symbol.for("radix.slottable"), O = (e, t) => {
188
+ if ("child" in e.props) {
189
+ let t = e.props.child;
190
+ return r.isValidElement(t) ? r.cloneElement(t, void 0, e.props.children(t.props.children)) : null;
191
+ }
192
+ return r.isValidElement(t) ? t : null;
193
+ };
194
+ function ne(e, t) {
195
+ let n = { ...t };
196
+ for (let r in t) {
197
+ let i = e[r], a = t[r];
198
+ /^on[A-Z]/.test(r) ? i && a ? n[r] = (...e) => {
199
+ let t = a(...e);
200
+ return i(...e), t;
201
+ } : i && (n[r] = i) : r === "style" ? n[r] = {
202
+ ...i,
203
+ ...a
204
+ } : r === "className" && (n[r] = [i, a].filter(Boolean).join(" "));
205
+ }
206
+ return {
207
+ ...e,
208
+ ...n
209
+ };
210
+ }
211
+ function re(e) {
212
+ let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
213
+ return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
214
+ }
215
+ function ie(e) {
216
+ return r.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === te;
217
+ }
218
+ var k = Symbol.for("react.lazy");
219
+ function A(e) {
220
+ return typeof e == "object" && !!e && "$$typeof" in e && e.$$typeof === k && "_payload" in e && ae(e._payload);
221
+ }
222
+ function ae(e) {
223
+ return typeof e == "object" && !!e && "then" in e;
224
+ }
225
+ var oe = (e) => `${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`, j = (e) => `${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`, M = r.use, N = [
226
+ "a",
227
+ "button",
228
+ "div",
229
+ "form",
230
+ "h2",
231
+ "h3",
232
+ "img",
233
+ "input",
234
+ "label",
235
+ "li",
236
+ "nav",
237
+ "ol",
238
+ "p",
239
+ "select",
240
+ "span",
241
+ "svg",
242
+ "ul"
243
+ ].reduce((e, t) => {
244
+ let n = /* @__PURE__ */ D(`Primitive.${t}`), i = r.forwardRef((e, r) => {
245
+ let { asChild: i, ...a } = e, o = i ? n : t;
246
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ l(o, {
247
+ ...a,
248
+ ref: r
249
+ });
250
+ });
251
+ return i.displayName = `Primitive.${t}`, {
252
+ ...e,
253
+ [t]: i
254
+ };
255
+ }, {});
256
+ function se(e, t) {
257
+ e && d.flushSync(() => e.dispatchEvent(t));
258
+ }
259
+ //#endregion
260
+ //#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
261
+ function P(e) {
262
+ let t = r.useRef(e);
263
+ return r.useEffect(() => {
264
+ t.current = e;
265
+ }), r.useMemo(() => ((...e) => t.current?.(...e)), []);
266
+ }
267
+ //#endregion
268
+ //#region node_modules/@radix-ui/react-use-escape-keydown/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
269
+ function F(e) {
270
+ let t = r.useRef(e);
271
+ return r.useEffect(() => {
272
+ t.current = e;
273
+ }), r.useMemo(() => ((...e) => t.current?.(...e)), []);
274
+ }
275
+ //#endregion
276
+ //#region node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
277
+ function ce(e, t = globalThis?.document) {
278
+ let n = F(e);
279
+ r.useEffect(() => {
280
+ let e = (e) => {
281
+ e.key === "Escape" && n(e);
282
+ };
283
+ return t.addEventListener("keydown", e, { capture: !0 }), () => t.removeEventListener("keydown", e, { capture: !0 });
284
+ }, [n, t]);
285
+ }
286
+ //#endregion
287
+ //#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
288
+ var le = "DismissableLayer", I = "dismissableLayer.update", ue = "dismissableLayer.pointerDownOutside", de = "dismissableLayer.focusOutside", L, fe = r.createContext({
289
+ layers: /* @__PURE__ */ new Set(),
290
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
291
+ branches: /* @__PURE__ */ new Set()
292
+ }), pe = r.forwardRef((e, t) => {
293
+ let { disableOutsidePointerEvents: n = !1, onEscapeKeyDown: i, onPointerDownOutside: a, onFocusOutside: o, onInteractOutside: s, onDismiss: c, ...u } = e, d = r.useContext(fe), [p, m] = r.useState(null), g = p?.ownerDocument ?? globalThis?.document, [, _] = r.useState({}), v = h(t, (e) => m(e)), y = Array.from(d.layers), [b] = [...d.layersWithOutsidePointerEventsDisabled].slice(-1), x = y.indexOf(b), S = p ? y.indexOf(p) : -1, C = d.layersWithOutsidePointerEventsDisabled.size > 0, w = S >= x, T = R((e) => {
294
+ let t = e.target, n = [...d.branches].some((e) => e.contains(t));
295
+ !w || n || (a?.(e), s?.(e), e.defaultPrevented || c?.());
296
+ }, g), E = ge((e) => {
297
+ let t = e.target;
298
+ [...d.branches].some((e) => e.contains(t)) || (o?.(e), s?.(e), e.defaultPrevented || c?.());
299
+ }, g);
300
+ return ce((e) => {
301
+ S === d.layers.size - 1 && (i?.(e), !e.defaultPrevented && c && (e.preventDefault(), c()));
302
+ }, g), r.useEffect(() => {
303
+ if (p) return n && (d.layersWithOutsidePointerEventsDisabled.size === 0 && (L = g.body.style.pointerEvents, g.body.style.pointerEvents = "none"), d.layersWithOutsidePointerEventsDisabled.add(p)), d.layers.add(p), _e(), () => {
304
+ n && (d.layersWithOutsidePointerEventsDisabled.delete(p), d.layersWithOutsidePointerEventsDisabled.size === 0 && (g.body.style.pointerEvents = L));
305
+ };
306
+ }, [
307
+ p,
308
+ g,
309
+ n,
310
+ d
311
+ ]), r.useEffect(() => () => {
312
+ p && (d.layers.delete(p), d.layersWithOutsidePointerEventsDisabled.delete(p), _e());
313
+ }, [p, d]), r.useEffect(() => {
314
+ let e = () => _({});
315
+ return document.addEventListener(I, e), () => document.removeEventListener(I, e);
316
+ }, []), /* @__PURE__ */ l(N.div, {
317
+ ...u,
318
+ ref: v,
319
+ style: {
320
+ pointerEvents: C ? w ? "auto" : "none" : void 0,
321
+ ...e.style
322
+ },
323
+ onFocusCapture: f(e.onFocusCapture, E.onFocusCapture),
324
+ onBlurCapture: f(e.onBlurCapture, E.onBlurCapture),
325
+ onPointerDownCapture: f(e.onPointerDownCapture, T.onPointerDownCapture)
326
+ });
327
+ });
328
+ pe.displayName = le;
329
+ var me = "DismissableLayerBranch", he = r.forwardRef((e, t) => {
330
+ let n = r.useContext(fe), i = r.useRef(null), a = h(t, i);
331
+ return r.useEffect(() => {
332
+ let e = i.current;
333
+ if (e) return n.branches.add(e), () => {
334
+ n.branches.delete(e);
335
+ };
336
+ }, [n.branches]), /* @__PURE__ */ l(N.div, {
337
+ ...e,
338
+ ref: a
339
+ });
340
+ });
341
+ he.displayName = me;
342
+ function R(e, t = globalThis?.document) {
343
+ let n = P(e), i = r.useRef(!1), a = r.useRef(() => {});
344
+ return r.useEffect(() => {
345
+ let e = (e) => {
346
+ if (e.target && !i.current) {
347
+ let r = function() {
348
+ z(ue, n, i, { discrete: !0 });
349
+ }, i = { originalEvent: e };
350
+ e.pointerType === "touch" ? (t.removeEventListener("click", a.current), a.current = r, t.addEventListener("click", a.current, { once: !0 })) : r();
351
+ } else t.removeEventListener("click", a.current);
352
+ i.current = !1;
353
+ }, r = window.setTimeout(() => {
354
+ t.addEventListener("pointerdown", e);
355
+ }, 0);
356
+ return () => {
357
+ window.clearTimeout(r), t.removeEventListener("pointerdown", e), t.removeEventListener("click", a.current);
358
+ };
359
+ }, [t, n]), { onPointerDownCapture: () => i.current = !0 };
360
+ }
361
+ function ge(e, t = globalThis?.document) {
362
+ let n = P(e), i = r.useRef(!1);
363
+ return r.useEffect(() => {
364
+ let e = (e) => {
365
+ e.target && !i.current && z(de, n, { originalEvent: e }, { discrete: !1 });
366
+ };
367
+ return t.addEventListener("focusin", e), () => t.removeEventListener("focusin", e);
368
+ }, [t, n]), {
369
+ onFocusCapture: () => i.current = !0,
370
+ onBlurCapture: () => i.current = !1
371
+ };
372
+ }
373
+ function _e() {
374
+ let e = new CustomEvent(I);
375
+ document.dispatchEvent(e);
376
+ }
377
+ function z(e, t, n, { discrete: r }) {
378
+ let i = n.originalEvent.target, a = new CustomEvent(e, {
379
+ bubbles: !1,
380
+ cancelable: !0,
381
+ detail: n
382
+ });
383
+ t && i.addEventListener(e, t, { once: !0 }), r ? se(i, a) : i.dispatchEvent(a);
384
+ }
385
+ //#endregion
386
+ //#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
387
+ function ve(e) {
388
+ let t = r.useRef(e);
389
+ return r.useEffect(() => {
390
+ t.current = e;
391
+ }), r.useMemo(() => ((...e) => t.current?.(...e)), []);
392
+ }
393
+ //#endregion
394
+ //#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
395
+ var B = "focusScope.autoFocusOnMount", ye = "focusScope.autoFocusOnUnmount", be = {
396
+ bubbles: !1,
397
+ cancelable: !0
398
+ }, V = "FocusScope", xe = r.forwardRef((e, t) => {
399
+ let { loop: n = !1, trapped: i = !1, onMountAutoFocus: a, onUnmountAutoFocus: o, ...s } = e, [c, u] = r.useState(null), d = ve(a), f = ve(o), p = r.useRef(null), m = h(t, (e) => u(e)), g = r.useRef({
400
+ paused: !1,
401
+ pause() {
402
+ this.paused = !0;
403
+ },
404
+ resume() {
405
+ this.paused = !1;
406
+ }
407
+ }).current;
408
+ r.useEffect(() => {
409
+ if (i) {
410
+ let e = function(e) {
411
+ if (g.paused || !c) return;
412
+ let t = e.target;
413
+ c.contains(t) ? p.current = t : U(p.current, { select: !0 });
414
+ }, t = function(e) {
415
+ if (g.paused || !c) return;
416
+ let t = e.relatedTarget;
417
+ t !== null && (c.contains(t) || U(p.current, { select: !0 }));
418
+ }, n = function(e) {
419
+ if (document.activeElement === document.body) for (let t of e) t.removedNodes.length > 0 && U(c);
420
+ };
421
+ document.addEventListener("focusin", e), document.addEventListener("focusout", t);
422
+ let r = new MutationObserver(n);
423
+ return c && r.observe(c, {
424
+ childList: !0,
425
+ subtree: !0
426
+ }), () => {
427
+ document.removeEventListener("focusin", e), document.removeEventListener("focusout", t), r.disconnect();
428
+ };
429
+ }
430
+ }, [
431
+ i,
432
+ c,
433
+ g.paused
434
+ ]), r.useEffect(() => {
435
+ if (c) {
436
+ De.add(g);
437
+ let e = document.activeElement;
438
+ if (!c.contains(e)) {
439
+ let t = new CustomEvent(B, be);
440
+ c.addEventListener(B, d), c.dispatchEvent(t), t.defaultPrevented || (Se(Ae(H(c)), { select: !0 }), document.activeElement === e && U(c));
441
+ }
442
+ return () => {
443
+ c.removeEventListener(B, d), setTimeout(() => {
444
+ let t = new CustomEvent(ye, be);
445
+ c.addEventListener(ye, f), c.dispatchEvent(t), t.defaultPrevented || U(e ?? document.body, { select: !0 }), c.removeEventListener(ye, f), De.remove(g);
446
+ }, 0);
447
+ };
448
+ }
449
+ }, [
450
+ c,
451
+ d,
452
+ f,
453
+ g
454
+ ]);
455
+ let _ = r.useCallback((e) => {
456
+ if (!n && !i || g.paused) return;
457
+ let t = e.key === "Tab" && !e.altKey && !e.ctrlKey && !e.metaKey, r = document.activeElement;
458
+ if (t && r) {
459
+ let t = e.currentTarget, [i, a] = Ce(t);
460
+ i && a ? !e.shiftKey && r === a ? (e.preventDefault(), n && U(i, { select: !0 })) : e.shiftKey && r === i && (e.preventDefault(), n && U(a, { select: !0 })) : r === t && e.preventDefault();
461
+ }
462
+ }, [
463
+ n,
464
+ i,
465
+ g.paused
466
+ ]);
467
+ return /* @__PURE__ */ l(N.div, {
468
+ tabIndex: -1,
469
+ ...s,
470
+ ref: m,
471
+ onKeyDown: _
472
+ });
473
+ });
474
+ xe.displayName = V;
475
+ function Se(e, { select: t = !1 } = {}) {
476
+ let n = document.activeElement;
477
+ for (let r of e) if (U(r, { select: t }), document.activeElement !== n) return;
478
+ }
479
+ function Ce(e) {
480
+ let t = H(e);
481
+ return [we(t, e), we(t.reverse(), e)];
482
+ }
483
+ function H(e) {
484
+ let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: (e) => {
485
+ let t = e.tagName === "INPUT" && e.type === "hidden";
486
+ return e.disabled || e.hidden || t ? NodeFilter.FILTER_SKIP : e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
487
+ } });
488
+ for (; n.nextNode();) t.push(n.currentNode);
489
+ return t;
490
+ }
491
+ function we(e, t) {
492
+ for (let n of e) if (!Te(n, { upTo: t })) return n;
493
+ }
494
+ function Te(e, { upTo: t }) {
495
+ if (getComputedStyle(e).visibility === "hidden") return !0;
496
+ for (; e;) {
497
+ if (t !== void 0 && e === t) return !1;
498
+ if (getComputedStyle(e).display === "none") return !0;
499
+ e = e.parentElement;
500
+ }
501
+ return !1;
502
+ }
503
+ function Ee(e) {
504
+ return e instanceof HTMLInputElement && "select" in e;
505
+ }
506
+ function U(e, { select: t = !1 } = {}) {
507
+ if (e && e.focus) {
508
+ let n = document.activeElement;
509
+ e.focus({ preventScroll: !0 }), e !== n && Ee(e) && t && e.select();
510
+ }
511
+ }
512
+ var De = Oe();
513
+ function Oe() {
514
+ let e = [];
515
+ return {
516
+ add(t) {
517
+ let n = e[0];
518
+ t !== n && n?.pause(), e = ke(e, t), e.unshift(t);
519
+ },
520
+ remove(t) {
521
+ e = ke(e, t), e[0]?.resume();
522
+ }
523
+ };
524
+ }
525
+ function ke(e, t) {
526
+ let n = [...e], r = n.indexOf(t);
527
+ return r !== -1 && n.splice(r, 1), n;
528
+ }
529
+ function Ae(e) {
530
+ return e.filter((e) => e.tagName !== "A");
531
+ }
532
+ //#endregion
533
+ //#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
534
+ var je = globalThis?.document ? r.useLayoutEffect : () => {}, Me = "Portal", Ne = r.forwardRef((e, t) => {
535
+ let { container: n, ...i } = e, [a, o] = r.useState(!1);
536
+ je(() => o(!0), []);
537
+ let s = n || a && globalThis?.document?.body;
538
+ return s ? d.createPortal(/* @__PURE__ */ l(N.div, {
539
+ ...i,
540
+ ref: t
541
+ }), s) : null;
542
+ });
543
+ Ne.displayName = Me;
544
+ //#endregion
545
+ //#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-presence/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
546
+ var Pe = globalThis?.document ? r.useLayoutEffect : () => {};
547
+ //#endregion
548
+ //#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-presence/dist/index.mjs
549
+ function Fe(e, t) {
550
+ return r.useReducer((e, n) => t[e][n] ?? e, e);
551
+ }
552
+ var Ie = (e) => {
553
+ let { present: t, children: n } = e, i = Le(t), a = typeof n == "function" ? n({ present: i.isPresent }) : r.Children.only(n), o = ze(i.ref, Ve(a));
554
+ return typeof n == "function" || i.isPresent ? r.cloneElement(a, { ref: o }) : null;
555
+ };
556
+ Ie.displayName = "Presence";
557
+ function Le(e) {
558
+ let [t, n] = r.useState(), i = r.useRef(null), a = r.useRef(e), o = r.useRef("none"), [s, c] = Fe(e ? "mounted" : "unmounted", {
559
+ mounted: {
560
+ UNMOUNT: "unmounted",
561
+ ANIMATION_OUT: "unmountSuspended"
562
+ },
563
+ unmountSuspended: {
564
+ MOUNT: "mounted",
565
+ ANIMATION_END: "unmounted"
566
+ },
567
+ unmounted: { MOUNT: "mounted" }
568
+ });
569
+ return r.useEffect(() => {
570
+ let e = Be(i.current);
571
+ o.current = s === "mounted" ? e : "none";
572
+ }, [s]), Pe(() => {
573
+ let t = i.current, n = a.current;
574
+ if (n !== e) {
575
+ let r = o.current, i = Be(t);
576
+ e ? c("MOUNT") : i === "none" || t?.display === "none" ? c("UNMOUNT") : c(n && r !== i ? "ANIMATION_OUT" : "UNMOUNT"), a.current = e;
577
+ }
578
+ }, [e, c]), Pe(() => {
579
+ if (t) {
580
+ let e, n = t.ownerDocument.defaultView ?? window, r = (r) => {
581
+ let o = Be(i.current).includes(CSS.escape(r.animationName));
582
+ if (r.target === t && o && (c("ANIMATION_END"), !a.current)) {
583
+ let r = t.style.animationFillMode;
584
+ t.style.animationFillMode = "forwards", e = n.setTimeout(() => {
585
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = r);
586
+ });
587
+ }
588
+ }, s = (e) => {
589
+ e.target === t && (o.current = Be(i.current));
590
+ };
591
+ return t.addEventListener("animationstart", s), t.addEventListener("animationcancel", r), t.addEventListener("animationend", r), () => {
592
+ n.clearTimeout(e), t.removeEventListener("animationstart", s), t.removeEventListener("animationcancel", r), t.removeEventListener("animationend", r);
593
+ };
594
+ } else c("ANIMATION_END");
595
+ }, [t, c]), {
596
+ isPresent: ["mounted", "unmountSuspended"].includes(s),
597
+ ref: r.useCallback((e) => {
598
+ i.current = e ? getComputedStyle(e) : null, n(e);
599
+ }, [])
600
+ };
601
+ }
602
+ function Re(e, t) {
603
+ if (typeof e == "function") return e(t);
604
+ e != null && (e.current = t);
605
+ }
606
+ function ze(...e) {
607
+ let t = r.useRef(e);
608
+ return t.current = e, r.useCallback((e) => {
609
+ let n = t.current, r = !1, i = n.map((t) => {
610
+ let n = Re(t, e);
611
+ return !r && typeof n == "function" && (r = !0), n;
612
+ });
613
+ if (r) return () => {
614
+ for (let e = 0; e < i.length; e++) {
615
+ let t = i[e];
616
+ typeof t == "function" ? t() : Re(n[e], null);
617
+ }
618
+ };
619
+ }, []);
620
+ }
621
+ function Be(e) {
622
+ return e?.animationName || "none";
623
+ }
624
+ function Ve(e) {
625
+ let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
626
+ return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
627
+ }
628
+ //#endregion
629
+ //#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
630
+ var He = 0, W = null;
631
+ function Ue() {
632
+ r.useEffect(() => {
633
+ W ||= {
634
+ start: We(),
635
+ end: We()
636
+ };
637
+ let { start: e, end: t } = W;
638
+ return document.body.firstElementChild !== e && document.body.insertAdjacentElement("afterbegin", e), document.body.lastElementChild !== t && document.body.insertAdjacentElement("beforeend", t), He++, () => {
639
+ He === 1 && (W?.start.remove(), W?.end.remove(), W = null), He = Math.max(0, He - 1);
640
+ };
641
+ }, []);
642
+ }
643
+ function We() {
644
+ let e = document.createElement("span");
645
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
646
+ }
647
+ //#endregion
648
+ //#region node_modules/vaul/node_modules/@radix-ui/react-dialog/dist/index.mjs
649
+ var Ge = "Dialog", [Ke, qe] = _(Ge), [Je, G] = Ke(Ge), Ye = (e) => {
650
+ let { __scopeDialog: t, children: n, open: i, defaultOpen: a, onOpenChange: o, modal: s = !0 } = e, c = r.useRef(null), u = r.useRef(null), [d, f] = T({
651
+ prop: i,
652
+ defaultProp: a ?? !1,
653
+ onChange: o,
654
+ caller: Ge
655
+ });
656
+ return /* @__PURE__ */ l(Je, {
657
+ scope: t,
658
+ triggerRef: c,
659
+ contentRef: u,
660
+ contentId: S(),
661
+ titleId: S(),
662
+ descriptionId: S(),
663
+ open: d,
664
+ onOpenChange: f,
665
+ onOpenToggle: r.useCallback(() => f((e) => !e), [f]),
666
+ modal: s,
667
+ children: n
668
+ });
669
+ };
670
+ Ye.displayName = Ge;
671
+ var Xe = "DialogTrigger", Ze = r.forwardRef((e, t) => {
672
+ let { __scopeDialog: n, ...r } = e, i = G(Xe, n), a = h(t, i.triggerRef);
673
+ return /* @__PURE__ */ l(N.button, {
674
+ type: "button",
675
+ "aria-haspopup": "dialog",
676
+ "aria-expanded": i.open,
677
+ "aria-controls": i.open ? i.contentId : void 0,
678
+ "data-state": gt(i.open),
679
+ ...r,
680
+ ref: a,
681
+ onClick: f(e.onClick, i.onOpenToggle)
682
+ });
683
+ });
684
+ Ze.displayName = Xe;
685
+ var Qe = "DialogPortal", [$e, et] = Ke(Qe, { forceMount: void 0 }), tt = (e) => {
686
+ let { __scopeDialog: t, forceMount: n, children: i, container: a } = e, o = G(Qe, t);
687
+ return /* @__PURE__ */ l($e, {
688
+ scope: t,
689
+ forceMount: n,
690
+ children: r.Children.map(i, (e) => /* @__PURE__ */ l(Ie, {
691
+ present: n || o.open,
692
+ children: /* @__PURE__ */ l(Ne, {
693
+ asChild: !0,
694
+ container: a,
695
+ children: e
696
+ })
697
+ }))
698
+ });
699
+ };
700
+ tt.displayName = Qe;
701
+ var nt = "DialogOverlay", rt = r.forwardRef((e, t) => {
702
+ let n = et(nt, e.__scopeDialog), { forceMount: r = n.forceMount, ...i } = e, a = G(nt, e.__scopeDialog);
703
+ return a.modal ? /* @__PURE__ */ l(Ie, {
704
+ present: r || a.open,
705
+ children: /* @__PURE__ */ l(at, {
706
+ ...i,
707
+ ref: t
708
+ })
709
+ }) : null;
710
+ });
711
+ rt.displayName = nt;
712
+ var it = /* @__PURE__ */ D("DialogOverlay.RemoveScroll"), at = r.forwardRef((e, n) => {
713
+ let { __scopeDialog: r, ...i } = e, a = G(nt, r);
714
+ return /* @__PURE__ */ l(t, {
715
+ as: it,
716
+ allowPinchZoom: !0,
717
+ shards: [a.contentRef],
718
+ children: /* @__PURE__ */ l(N.div, {
719
+ "data-state": gt(a.open),
720
+ ...i,
721
+ ref: n,
722
+ style: {
723
+ pointerEvents: "auto",
724
+ ...i.style
725
+ }
726
+ })
727
+ });
728
+ }), K = "DialogContent", ot = r.forwardRef((e, t) => {
729
+ let n = et(K, e.__scopeDialog), { forceMount: r = n.forceMount, ...i } = e, a = G(K, e.__scopeDialog);
730
+ return /* @__PURE__ */ l(Ie, {
731
+ present: r || a.open,
732
+ children: a.modal ? /* @__PURE__ */ l(st, {
733
+ ...i,
734
+ ref: t
735
+ }) : /* @__PURE__ */ l(ct, {
736
+ ...i,
737
+ ref: t
738
+ })
739
+ });
740
+ });
741
+ ot.displayName = K;
742
+ var st = r.forwardRef((e, t) => {
743
+ let i = G(K, e.__scopeDialog), a = r.useRef(null), o = h(t, i.contentRef, a);
744
+ return r.useEffect(() => {
745
+ let e = a.current;
746
+ if (e) return n(e);
747
+ }, []), /* @__PURE__ */ l(lt, {
748
+ ...e,
749
+ ref: o,
750
+ trapFocus: i.open,
751
+ disableOutsidePointerEvents: i.open,
752
+ onCloseAutoFocus: f(e.onCloseAutoFocus, (e) => {
753
+ e.preventDefault(), i.triggerRef.current?.focus();
754
+ }),
755
+ onPointerDownOutside: f(e.onPointerDownOutside, (e) => {
756
+ let t = e.detail.originalEvent, n = t.button === 0 && t.ctrlKey === !0;
757
+ (t.button === 2 || n) && e.preventDefault();
758
+ }),
759
+ onFocusOutside: f(e.onFocusOutside, (e) => e.preventDefault())
760
+ });
761
+ }), ct = r.forwardRef((e, t) => {
762
+ let n = G(K, e.__scopeDialog), i = r.useRef(!1), a = r.useRef(!1);
763
+ return /* @__PURE__ */ l(lt, {
764
+ ...e,
765
+ ref: t,
766
+ trapFocus: !1,
767
+ disableOutsidePointerEvents: !1,
768
+ onCloseAutoFocus: (t) => {
769
+ e.onCloseAutoFocus?.(t), t.defaultPrevented || (i.current || n.triggerRef.current?.focus(), t.preventDefault()), i.current = !1, a.current = !1;
770
+ },
771
+ onInteractOutside: (t) => {
772
+ e.onInteractOutside?.(t), t.defaultPrevented || (i.current = !0, t.detail.originalEvent.type === "pointerdown" && (a.current = !0));
773
+ let r = t.target;
774
+ n.triggerRef.current?.contains(r) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && a.current && t.preventDefault();
775
+ }
776
+ });
777
+ }), lt = r.forwardRef((e, t) => {
778
+ let { __scopeDialog: n, trapFocus: i, onOpenAutoFocus: a, onCloseAutoFocus: o, ...s } = e, d = G(K, n), f = r.useRef(null), p = h(t, f);
779
+ return Ue(), /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(xe, {
780
+ asChild: !0,
781
+ loop: !0,
782
+ trapped: i,
783
+ onMountAutoFocus: a,
784
+ onUnmountAutoFocus: o,
785
+ children: /* @__PURE__ */ l(pe, {
786
+ role: "dialog",
787
+ id: d.contentId,
788
+ "aria-describedby": d.descriptionId,
789
+ "aria-labelledby": d.titleId,
790
+ "data-state": gt(d.open),
791
+ ...s,
792
+ ref: p,
793
+ onDismiss: () => d.onOpenChange(!1)
794
+ })
795
+ }), /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(bt, { titleId: d.titleId }), /* @__PURE__ */ l(St, {
796
+ contentRef: f,
797
+ descriptionId: d.descriptionId
798
+ })] })] });
799
+ }), ut = "DialogTitle", dt = r.forwardRef((e, t) => {
800
+ let { __scopeDialog: n, ...r } = e, i = G(ut, n);
801
+ return /* @__PURE__ */ l(N.h2, {
802
+ id: i.titleId,
803
+ ...r,
804
+ ref: t
805
+ });
806
+ });
807
+ dt.displayName = ut;
808
+ var ft = "DialogDescription", pt = r.forwardRef((e, t) => {
809
+ let { __scopeDialog: n, ...r } = e, i = G(ft, n);
810
+ return /* @__PURE__ */ l(N.p, {
811
+ id: i.descriptionId,
812
+ ...r,
813
+ ref: t
814
+ });
815
+ });
816
+ pt.displayName = ft;
817
+ var mt = "DialogClose", ht = r.forwardRef((e, t) => {
818
+ let { __scopeDialog: n, ...r } = e, i = G(mt, n);
819
+ return /* @__PURE__ */ l(N.button, {
820
+ type: "button",
821
+ ...r,
822
+ ref: t,
823
+ onClick: f(e.onClick, () => i.onOpenChange(!1))
824
+ });
825
+ });
826
+ ht.displayName = mt;
827
+ function gt(e) {
828
+ return e ? "open" : "closed";
829
+ }
830
+ var _t = "DialogTitleWarning", [vt, yt] = g(_t, {
831
+ contentName: K,
832
+ titleName: ut,
833
+ docsSlug: "dialog"
834
+ }), bt = ({ titleId: e }) => {
835
+ let t = yt(_t), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
836
+
837
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
838
+
839
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
840
+ return r.useEffect(() => {
841
+ e && (document.getElementById(e) || console.error(n));
842
+ }, [n, e]), null;
843
+ }, xt = "DialogDescriptionWarning", St = ({ contentRef: e, descriptionId: t }) => {
844
+ let n = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${yt(xt).contentName}}.`;
845
+ return r.useEffect(() => {
846
+ let r = e.current?.getAttribute("aria-describedby");
847
+ t && r && (document.getElementById(t) || console.warn(n));
848
+ }, [
849
+ n,
850
+ e,
851
+ t
852
+ ]), null;
853
+ }, Ct = Ye, wt = Ze, Tt = tt, Et = rt, Dt = ot, Ot = dt, kt = pt, At = ht;
854
+ //#endregion
855
+ //#region node_modules/vaul/dist/index.mjs
856
+ function jt(e) {
857
+ if (!e || typeof document > "u") return;
858
+ let t = document.head || document.getElementsByTagName("head")[0], n = document.createElement("style");
859
+ n.type = "text/css", t.appendChild(n), n.styleSheet ? n.styleSheet.cssText = e : n.appendChild(document.createTextNode(e));
860
+ }
861
+ var Mt = i.createContext({
862
+ drawerRef: { current: null },
863
+ overlayRef: { current: null },
864
+ onPress: () => {},
865
+ onRelease: () => {},
866
+ onDrag: () => {},
867
+ onNestedDrag: () => {},
868
+ onNestedOpenChange: () => {},
869
+ onNestedRelease: () => {},
870
+ openProp: void 0,
871
+ dismissible: !1,
872
+ isOpen: !1,
873
+ isDragging: !1,
874
+ keyboardIsOpen: { current: !1 },
875
+ snapPointsOffset: null,
876
+ snapPoints: null,
877
+ handleOnly: !1,
878
+ modal: !1,
879
+ shouldFade: !1,
880
+ activeSnapPoint: null,
881
+ onOpenChange: () => {},
882
+ setActiveSnapPoint: () => {},
883
+ closeDrawer: () => {},
884
+ direction: "bottom",
885
+ shouldAnimate: { current: !0 },
886
+ shouldScaleBackground: !1,
887
+ setBackgroundColorOnScale: !0,
888
+ noBodyStyles: !1,
889
+ container: null,
890
+ autoFocus: !1
891
+ }), q = () => {
892
+ let e = i.useContext(Mt);
893
+ if (!e) throw Error("useDrawerContext must be used within a Drawer.Root");
894
+ return e;
895
+ };
896
+ jt("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");
897
+ function Nt() {
898
+ let e = navigator.userAgent;
899
+ return typeof window < "u" && (/Firefox/.test(e) && /Mobile/.test(e) || /FxiOS/.test(e));
900
+ }
901
+ function Pt() {
902
+ return zt(/^Mac/);
903
+ }
904
+ function Ft() {
905
+ return zt(/^iPhone/);
906
+ }
907
+ function It() {
908
+ return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
909
+ }
910
+ function Lt() {
911
+ return zt(/^iPad/) || Pt() && navigator.maxTouchPoints > 1;
912
+ }
913
+ function Rt() {
914
+ return Ft() || Lt();
915
+ }
916
+ function zt(e) {
917
+ return typeof window < "u" && window.navigator != null ? e.test(window.navigator.platform) : void 0;
918
+ }
919
+ var Bt = 24, Vt = typeof window < "u" ? o : a;
920
+ function Ht(...e) {
921
+ return (...t) => {
922
+ for (let n of e) typeof n == "function" && n(...t);
923
+ };
924
+ }
925
+ var Ut = typeof document < "u" && window.visualViewport;
926
+ function Wt(e) {
927
+ let t = window.getComputedStyle(e);
928
+ return /(auto|scroll)/.test(t.overflow + t.overflowX + t.overflowY);
929
+ }
930
+ function Gt(e) {
931
+ for (Wt(e) && (e = e.parentElement); e && !Wt(e);) e = e.parentElement;
932
+ return e || document.scrollingElement || document.documentElement;
933
+ }
934
+ var Kt = /* @__PURE__ */ new Set([
935
+ "checkbox",
936
+ "radio",
937
+ "range",
938
+ "color",
939
+ "file",
940
+ "image",
941
+ "button",
942
+ "submit",
943
+ "reset"
944
+ ]), qt = 0, Jt;
945
+ function Yt(e = {}) {
946
+ let { isDisabled: t } = e;
947
+ Vt(() => {
948
+ if (!t) return qt++, qt === 1 && Rt() && (Jt = Xt()), () => {
949
+ qt--, qt === 0 && Jt?.();
950
+ };
951
+ }, [t]);
952
+ }
953
+ function Xt() {
954
+ let e, t = 0, n = (n) => {
955
+ e = Gt(n.target), !(e === document.documentElement && e === document.body) && (t = n.changedTouches[0].pageY);
956
+ }, r = (n) => {
957
+ if (!e || e === document.documentElement || e === document.body) {
958
+ n.preventDefault();
959
+ return;
960
+ }
961
+ let r = n.changedTouches[0].pageY, i = e.scrollTop, a = e.scrollHeight - e.clientHeight;
962
+ a !== 0 && ((i <= 0 && r > t || i >= a && r < t) && n.preventDefault(), t = r);
963
+ }, i = (e) => {
964
+ let t = e.target;
965
+ $t(t) && t !== document.activeElement && (e.preventDefault(), t.style.transform = "translateY(-2000px)", t.focus(), requestAnimationFrame(() => {
966
+ t.style.transform = "";
967
+ }));
968
+ }, a = (e) => {
969
+ let t = e.target;
970
+ $t(t) && (t.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
971
+ t.style.transform = "", Ut && (Ut.height < window.innerHeight ? requestAnimationFrame(() => {
972
+ Qt(t);
973
+ }) : Ut.addEventListener("resize", () => Qt(t), { once: !0 }));
974
+ }));
975
+ }, o = () => {
976
+ window.scrollTo(0, 0);
977
+ }, s = window.pageXOffset, c = window.pageYOffset, l = Ht(Zt(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`));
978
+ window.scrollTo(0, 0);
979
+ let u = Ht(J(document, "touchstart", n, {
980
+ passive: !1,
981
+ capture: !0
982
+ }), J(document, "touchmove", r, {
983
+ passive: !1,
984
+ capture: !0
985
+ }), J(document, "touchend", i, {
986
+ passive: !1,
987
+ capture: !0
988
+ }), J(document, "focus", a, !0), J(window, "scroll", o));
989
+ return () => {
990
+ l(), u(), window.scrollTo(s, c);
991
+ };
992
+ }
993
+ function Zt(e, t, n) {
994
+ let r = e.style[t];
995
+ return e.style[t] = n, () => {
996
+ e.style[t] = r;
997
+ };
998
+ }
999
+ function J(e, t, n, r) {
1000
+ return e.addEventListener(t, n, r), () => {
1001
+ e.removeEventListener(t, n, r);
1002
+ };
1003
+ }
1004
+ function Qt(e) {
1005
+ let t = document.scrollingElement || document.documentElement;
1006
+ for (; e && e !== t;) {
1007
+ let t = Gt(e);
1008
+ if (t !== document.documentElement && t !== document.body && t !== e) {
1009
+ let n = t.getBoundingClientRect().top, r = e.getBoundingClientRect().top;
1010
+ e.getBoundingClientRect().bottom > t.getBoundingClientRect().bottom + Bt && (t.scrollTop += r - n);
1011
+ }
1012
+ e = t.parentElement;
1013
+ }
1014
+ }
1015
+ function $t(e) {
1016
+ return e instanceof HTMLInputElement && !Kt.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
1017
+ }
1018
+ function en(e, t) {
1019
+ typeof e == "function" ? e(t) : e != null && (e.current = t);
1020
+ }
1021
+ function tn(...e) {
1022
+ return (t) => e.forEach((e) => en(e, t));
1023
+ }
1024
+ function nn(...e) {
1025
+ return r.useCallback(tn(...e), e);
1026
+ }
1027
+ var rn = /* @__PURE__ */ new WeakMap();
1028
+ function Y(e, t, n = !1) {
1029
+ if (!e || !(e instanceof HTMLElement)) return;
1030
+ let r = {};
1031
+ Object.entries(t).forEach(([t, n]) => {
1032
+ if (t.startsWith("--")) {
1033
+ e.style.setProperty(t, n);
1034
+ return;
1035
+ }
1036
+ r[t] = e.style[t], e.style[t] = n;
1037
+ }), !n && rn.set(e, r);
1038
+ }
1039
+ function an(e, t) {
1040
+ if (!e || !(e instanceof HTMLElement)) return;
1041
+ let n = rn.get(e);
1042
+ n && (e.style[t] = n[t]);
1043
+ }
1044
+ var X = (e) => {
1045
+ switch (e) {
1046
+ case "top":
1047
+ case "bottom": return !0;
1048
+ case "left":
1049
+ case "right": return !1;
1050
+ default: return e;
1051
+ }
1052
+ };
1053
+ function on(e, t) {
1054
+ if (!e) return null;
1055
+ let n = window.getComputedStyle(e), r = n.transform || n.webkitTransform || n.mozTransform, i = r.match(/^matrix3d\((.+)\)$/);
1056
+ return i ? parseFloat(i[1].split(", ")[X(t) ? 13 : 12]) : (i = r.match(/^matrix\((.+)\)$/), i ? parseFloat(i[1].split(", ")[X(t) ? 5 : 4]) : null);
1057
+ }
1058
+ function sn(e) {
1059
+ return 8 * (Math.log(e + 1) - 2);
1060
+ }
1061
+ function cn(e, t) {
1062
+ if (!e) return () => {};
1063
+ let n = e.style.cssText;
1064
+ return Object.assign(e.style, t), () => {
1065
+ e.style.cssText = n;
1066
+ };
1067
+ }
1068
+ var Z = {
1069
+ DURATION: .5,
1070
+ EASE: [
1071
+ .32,
1072
+ .72,
1073
+ 0,
1074
+ 1
1075
+ ]
1076
+ }, ln = .4, un = .25, dn = 100, fn = 8, pn = 16, mn = 26, hn = "vaul-dragging";
1077
+ function gn(e) {
1078
+ let t = i.useRef(e);
1079
+ return i.useEffect(() => {
1080
+ t.current = e;
1081
+ }), i.useMemo(() => (...e) => t.current == null ? void 0 : t.current.call(t, ...e), []);
1082
+ }
1083
+ function _n({ defaultProp: e, onChange: t }) {
1084
+ let n = i.useState(e), [r] = n, a = i.useRef(r), o = gn(t);
1085
+ return i.useEffect(() => {
1086
+ a.current !== r && (o(r), a.current = r);
1087
+ }, [
1088
+ r,
1089
+ a,
1090
+ o
1091
+ ]), n;
1092
+ }
1093
+ function vn({ prop: e, defaultProp: t, onChange: n = () => {} }) {
1094
+ let [r, a] = _n({
1095
+ defaultProp: t,
1096
+ onChange: n
1097
+ }), o = e !== void 0, s = o ? e : r, c = gn(n);
1098
+ return [s, i.useCallback((t) => {
1099
+ if (o) {
1100
+ let n = typeof t == "function" ? t(e) : t;
1101
+ n !== e && c(n);
1102
+ } else a(t);
1103
+ }, [
1104
+ o,
1105
+ e,
1106
+ a,
1107
+ c
1108
+ ])];
1109
+ }
1110
+ function yn({ activeSnapPointProp: e, setActiveSnapPointProp: t, snapPoints: n, drawerRef: r, overlayRef: a, fadeFromIndex: o, onSnapPointChange: s, direction: c = "bottom", container: l, snapToSequentialPoint: u }) {
1111
+ let [d, f] = vn({
1112
+ prop: e,
1113
+ defaultProp: n?.[0],
1114
+ onChange: t
1115
+ }), [p, m] = i.useState(typeof window < "u" ? {
1116
+ innerWidth: window.innerWidth,
1117
+ innerHeight: window.innerHeight
1118
+ } : void 0);
1119
+ i.useEffect(() => {
1120
+ function e() {
1121
+ m({
1122
+ innerWidth: window.innerWidth,
1123
+ innerHeight: window.innerHeight
1124
+ });
1125
+ }
1126
+ return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
1127
+ }, []);
1128
+ let h = i.useMemo(() => d === n?.[n.length - 1] || null, [n, d]), g = i.useMemo(() => n?.findIndex((e) => e === d) ?? null, [n, d]), _ = n && n.length > 0 && (o || o === 0) && !Number.isNaN(o) && n[o] === d || !n, v = i.useMemo(() => {
1129
+ let e = l ? {
1130
+ width: l.getBoundingClientRect().width,
1131
+ height: l.getBoundingClientRect().height
1132
+ } : typeof window < "u" ? {
1133
+ width: window.innerWidth,
1134
+ height: window.innerHeight
1135
+ } : {
1136
+ width: 0,
1137
+ height: 0
1138
+ };
1139
+ return n?.map((t) => {
1140
+ let n = typeof t == "string", r = 0;
1141
+ if (n && (r = parseInt(t, 10)), X(c)) {
1142
+ let i = n ? r : p ? t * e.height : 0;
1143
+ return p ? c === "bottom" ? e.height - i : -e.height + i : i;
1144
+ }
1145
+ let i = n ? r : p ? t * e.width : 0;
1146
+ return p ? c === "right" ? e.width - i : -e.width + i : i;
1147
+ }) ?? [];
1148
+ }, [
1149
+ n,
1150
+ p,
1151
+ l
1152
+ ]), y = i.useMemo(() => g === null ? null : v?.[g], [v, g]), b = i.useCallback((e) => {
1153
+ let t = v?.findIndex((t) => t === e) ?? null;
1154
+ s(t), Y(r.current, {
1155
+ transition: `transform ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})`,
1156
+ transform: X(c) ? `translate3d(0, ${e}px, 0)` : `translate3d(${e}px, 0, 0)`
1157
+ }), v && t !== v.length - 1 && o !== void 0 && t !== o && t < o ? Y(a.current, {
1158
+ transition: `opacity ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})`,
1159
+ opacity: "0"
1160
+ }) : Y(a.current, {
1161
+ transition: `opacity ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})`,
1162
+ opacity: "1"
1163
+ }), f(n?.[Math.max(t, 0)]);
1164
+ }, [
1165
+ r.current,
1166
+ n,
1167
+ v,
1168
+ o,
1169
+ a,
1170
+ f
1171
+ ]);
1172
+ i.useEffect(() => {
1173
+ if (d || e) {
1174
+ let t = n?.findIndex((t) => t === e || t === d) ?? -1;
1175
+ v && t !== -1 && typeof v[t] == "number" && b(v[t]);
1176
+ }
1177
+ }, [
1178
+ d,
1179
+ e,
1180
+ n,
1181
+ v,
1182
+ b
1183
+ ]);
1184
+ function x({ draggedDistance: e, closeDrawer: t, velocity: r, dismissible: i }) {
1185
+ if (o === void 0) return;
1186
+ let s = c === "bottom" || c === "right" ? (y ?? 0) - e : (y ?? 0) + e, l = g === o - 1, d = g === 0, f = e > 0;
1187
+ if (l && Y(a.current, { transition: `opacity ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})` }), !u && r > 2 && !f) {
1188
+ i ? t() : b(v[0]);
1189
+ return;
1190
+ }
1191
+ if (!u && r > 2 && f && v && n) {
1192
+ b(v[n.length - 1]);
1193
+ return;
1194
+ }
1195
+ let p = v?.reduce((e, t) => typeof e != "number" || typeof t != "number" ? e : Math.abs(t - s) < Math.abs(e - s) ? t : e), m = X(c) ? window.innerHeight : window.innerWidth;
1196
+ if (r > ln && Math.abs(e) < m * .4) {
1197
+ let e = f ? 1 : -1;
1198
+ if (e > 0 && h && n) {
1199
+ b(v[n.length - 1]);
1200
+ return;
1201
+ }
1202
+ if (d && e < 0 && i && t(), g === null) return;
1203
+ b(v[g + e]);
1204
+ return;
1205
+ }
1206
+ b(p);
1207
+ }
1208
+ function S({ draggedDistance: e }) {
1209
+ if (y === null) return;
1210
+ let t = c === "bottom" || c === "right" ? y - e : y + e;
1211
+ (c === "bottom" || c === "right") && t < v[v.length - 1] || (c === "top" || c === "left") && t > v[v.length - 1] || Y(r.current, { transform: X(c) ? `translate3d(0, ${t}px, 0)` : `translate3d(${t}px, 0, 0)` });
1212
+ }
1213
+ function C(e, t) {
1214
+ if (!n || typeof g != "number" || !v || o === void 0) return null;
1215
+ let r = g === o - 1;
1216
+ if (g >= o && t) return 0;
1217
+ if (r && !t) return 1;
1218
+ if (!_ && !r) return null;
1219
+ let i = r ? g + 1 : g - 1, a = r ? v[i] - v[i - 1] : v[i + 1] - v[i], s = e / Math.abs(a);
1220
+ return r ? 1 - s : s;
1221
+ }
1222
+ return {
1223
+ isLastSnapPoint: h,
1224
+ activeSnapPoint: d,
1225
+ shouldFade: _,
1226
+ getPercentageDragged: C,
1227
+ setActiveSnapPoint: f,
1228
+ activeSnapPointIndex: g,
1229
+ onRelease: x,
1230
+ onDrag: S,
1231
+ snapPointsOffset: v
1232
+ };
1233
+ }
1234
+ function bn() {
1235
+ let { direction: e, isOpen: t, shouldScaleBackground: n, setBackgroundColorOnScale: r, noBodyStyles: a } = q(), o = i.useRef(null), c = s(() => document.body.style.backgroundColor, []);
1236
+ function l() {
1237
+ return (window.innerWidth - mn) / window.innerWidth;
1238
+ }
1239
+ i.useEffect(() => {
1240
+ if (t && n) {
1241
+ o.current && clearTimeout(o.current);
1242
+ let t = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]");
1243
+ if (!t) return;
1244
+ r && !a && cn(document.body, { background: "black" }), cn(t, {
1245
+ transformOrigin: X(e) ? "top" : "left",
1246
+ transitionProperty: "transform, border-radius",
1247
+ transitionDuration: `${Z.DURATION}s`,
1248
+ transitionTimingFunction: `cubic-bezier(${Z.EASE.join(",")})`
1249
+ });
1250
+ let n = cn(t, {
1251
+ borderRadius: `${fn}px`,
1252
+ overflow: "hidden",
1253
+ ...X(e) ? { transform: `scale(${l()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)` } : { transform: `scale(${l()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)` }
1254
+ });
1255
+ return () => {
1256
+ n(), o.current = window.setTimeout(() => {
1257
+ c ? document.body.style.background = c : document.body.style.removeProperty("background");
1258
+ }, Z.DURATION * 1e3);
1259
+ };
1260
+ }
1261
+ }, [
1262
+ t,
1263
+ n,
1264
+ c
1265
+ ]);
1266
+ }
1267
+ var Q = null;
1268
+ function xn({ isOpen: e, modal: t, nested: n, hasBeenOpened: r, preventScrollRestoration: a, noBodyStyles: o }) {
1269
+ let [s, c] = i.useState(() => typeof window < "u" ? window.location.href : ""), l = i.useRef(0), u = i.useCallback(() => {
1270
+ if (It() && Q === null && e && !o) {
1271
+ Q = {
1272
+ position: document.body.style.position,
1273
+ top: document.body.style.top,
1274
+ left: document.body.style.left,
1275
+ height: document.body.style.height,
1276
+ right: "unset"
1277
+ };
1278
+ let { scrollX: e, innerHeight: t } = window;
1279
+ document.body.style.setProperty("position", "fixed", "important"), Object.assign(document.body.style, {
1280
+ top: `${-l.current}px`,
1281
+ left: `${-e}px`,
1282
+ right: "0px",
1283
+ height: "auto"
1284
+ }), window.setTimeout(() => window.requestAnimationFrame(() => {
1285
+ let e = t - window.innerHeight;
1286
+ e && l.current >= t && (document.body.style.top = `${-(l.current + e)}px`);
1287
+ }), 300);
1288
+ }
1289
+ }, [e]), d = i.useCallback(() => {
1290
+ if (It() && Q !== null && !o) {
1291
+ let e = -parseInt(document.body.style.top, 10), t = -parseInt(document.body.style.left, 10);
1292
+ Object.assign(document.body.style, Q), window.requestAnimationFrame(() => {
1293
+ if (a && s !== window.location.href) {
1294
+ c(window.location.href);
1295
+ return;
1296
+ }
1297
+ window.scrollTo(t, e);
1298
+ }), Q = null;
1299
+ }
1300
+ }, [s]);
1301
+ return i.useEffect(() => {
1302
+ function e() {
1303
+ l.current = window.scrollY;
1304
+ }
1305
+ return e(), window.addEventListener("scroll", e), () => {
1306
+ window.removeEventListener("scroll", e);
1307
+ };
1308
+ }, []), i.useEffect(() => {
1309
+ if (t) return () => {
1310
+ typeof document > "u" || document.querySelector("[data-vaul-drawer]") || d();
1311
+ };
1312
+ }, [t, d]), i.useEffect(() => {
1313
+ n || !r || (e ? (!window.matchMedia("(display-mode: standalone)").matches && u(), t || window.setTimeout(() => {
1314
+ d();
1315
+ }, 500)) : d());
1316
+ }, [
1317
+ e,
1318
+ r,
1319
+ s,
1320
+ t,
1321
+ n,
1322
+ u,
1323
+ d
1324
+ ]), { restorePositionSetting: d };
1325
+ }
1326
+ function Sn({ open: e, onOpenChange: t, children: n, onDrag: r, onRelease: a, snapPoints: o, shouldScaleBackground: s = !1, setBackgroundColorOnScale: c = !0, closeThreshold: l = un, scrollLockTimeout: u = dn, dismissible: d = !0, handleOnly: f = !1, fadeFromIndex: p = o && o.length - 1, activeSnapPoint: m, setActiveSnapPoint: h, fixed: g, modal: _ = !0, onClose: v, nested: y, noBodyStyles: b = !1, direction: x = "bottom", defaultOpen: S = !1, disablePreventScroll: C = !0, snapToSequentialPoint: w = !1, preventScrollRestoration: T = !1, repositionInputs: E = !0, onAnimationEnd: ee, container: D, autoFocus: te = !1 }) {
1327
+ let [O = !1, ne] = vn({
1328
+ defaultProp: S,
1329
+ prop: e,
1330
+ onChange: (e) => {
1331
+ t?.(e), !e && !y && be(), setTimeout(() => {
1332
+ ee?.(e);
1333
+ }, Z.DURATION * 1e3), e && !_ && typeof window < "u" && window.requestAnimationFrame(() => {
1334
+ document.body.style.pointerEvents = "auto";
1335
+ }), e || (document.body.style.pointerEvents = "auto");
1336
+ }
1337
+ }), [re, ie] = i.useState(!1), [k, A] = i.useState(!1), [ae, oe] = i.useState(!1), j = i.useRef(null), M = i.useRef(null), N = i.useRef(null), se = i.useRef(null), P = i.useRef(null), F = i.useRef(!1), ce = i.useRef(null), le = i.useRef(0), I = i.useRef(!1), ue = i.useRef(!S), de = i.useRef(0), L = i.useRef(null), fe = i.useRef(L.current?.getBoundingClientRect().height || 0), pe = i.useRef(L.current?.getBoundingClientRect().width || 0), me = i.useRef(0), { activeSnapPoint: he, activeSnapPointIndex: R, setActiveSnapPoint: ge, onRelease: _e, snapPointsOffset: z, onDrag: ve, shouldFade: B, getPercentageDragged: ye } = yn({
1338
+ snapPoints: o,
1339
+ activeSnapPointProp: m,
1340
+ setActiveSnapPointProp: h,
1341
+ drawerRef: L,
1342
+ fadeFromIndex: p,
1343
+ overlayRef: j,
1344
+ onSnapPointChange: i.useCallback((e) => {
1345
+ o && e === z.length - 1 && (M.current = /* @__PURE__ */ new Date());
1346
+ }, []),
1347
+ direction: x,
1348
+ container: D,
1349
+ snapToSequentialPoint: w
1350
+ });
1351
+ Yt({ isDisabled: !O || k || !_ || ae || !re || !E || !C });
1352
+ let { restorePositionSetting: be } = xn({
1353
+ isOpen: O,
1354
+ modal: _,
1355
+ nested: y ?? !1,
1356
+ hasBeenOpened: re,
1357
+ preventScrollRestoration: T,
1358
+ noBodyStyles: b
1359
+ });
1360
+ function V() {
1361
+ return (window.innerWidth - mn) / window.innerWidth;
1362
+ }
1363
+ function xe(e) {
1364
+ !d && !o || L.current && !L.current.contains(e.target) || (fe.current = L.current?.getBoundingClientRect().height || 0, pe.current = L.current?.getBoundingClientRect().width || 0, A(!0), N.current = /* @__PURE__ */ new Date(), Rt() && window.addEventListener("touchend", () => F.current = !1, { once: !0 }), e.target.setPointerCapture(e.pointerId), le.current = X(x) ? e.pageY : e.pageX);
1365
+ }
1366
+ function Se(e, t) {
1367
+ let n = e, r = window.getSelection()?.toString(), i = L.current ? on(L.current, x) : null, a = /* @__PURE__ */ new Date();
1368
+ if (n.tagName === "SELECT" || n.hasAttribute("data-vaul-no-drag") || n.closest("[data-vaul-no-drag]")) return !1;
1369
+ if (x === "right" || x === "left") return !0;
1370
+ if (M.current && a.getTime() - M.current.getTime() < 500) return !1;
1371
+ if (i !== null && (x === "bottom" ? i > 0 : i < 0)) return !0;
1372
+ if (r && r.length > 0) return !1;
1373
+ if (P.current && a.getTime() - P.current.getTime() < u && i === 0 || t) return P.current = a, !1;
1374
+ for (; n;) {
1375
+ if (n.scrollHeight > n.clientHeight) {
1376
+ if (n.scrollTop !== 0) return P.current = /* @__PURE__ */ new Date(), !1;
1377
+ if (n.getAttribute("role") === "dialog") return !0;
1378
+ }
1379
+ n = n.parentNode;
1380
+ }
1381
+ return !0;
1382
+ }
1383
+ function Ce(e) {
1384
+ if (L.current && k) {
1385
+ let t = x === "bottom" || x === "right" ? 1 : -1, n = (le.current - (X(x) ? e.pageY : e.pageX)) * t, i = n > 0, a = o && !d && !i;
1386
+ if (a && R === 0) return;
1387
+ let c = Math.abs(n), l = document.querySelector("[data-vaul-drawer-wrapper]"), u = c / (x === "bottom" || x === "top" ? fe.current : pe.current), f = ye(c, i);
1388
+ if (f !== null && (u = f), a && u >= 1 || !F.current && !Se(e.target, i)) return;
1389
+ if (L.current.classList.add(hn), F.current = !0, Y(L.current, { transition: "none" }), Y(j.current, { transition: "none" }), o && ve({ draggedDistance: n }), i && !o) {
1390
+ let e = sn(n), r = Math.min(e * -1, 0) * t;
1391
+ Y(L.current, { transform: X(x) ? `translate3d(0, ${r}px, 0)` : `translate3d(${r}px, 0, 0)` });
1392
+ return;
1393
+ }
1394
+ let m = 1 - u;
1395
+ if ((B || p && R === p - 1) && (r?.(e, u), Y(j.current, {
1396
+ opacity: `${m}`,
1397
+ transition: "none"
1398
+ }, !0)), l && j.current && s) {
1399
+ let e = Math.min(V() + u * (1 - V()), 1), t = 8 - u * 8, n = Math.max(0, 14 - u * 14);
1400
+ Y(l, {
1401
+ borderRadius: `${t}px`,
1402
+ transform: X(x) ? `scale(${e}) translate3d(0, ${n}px, 0)` : `scale(${e}) translate3d(${n}px, 0, 0)`,
1403
+ transition: "none"
1404
+ }, !0);
1405
+ }
1406
+ if (!o) {
1407
+ let e = c * t;
1408
+ Y(L.current, { transform: X(x) ? `translate3d(0, ${e}px, 0)` : `translate3d(${e}px, 0, 0)` });
1409
+ }
1410
+ }
1411
+ }
1412
+ i.useEffect(() => {
1413
+ window.requestAnimationFrame(() => {
1414
+ ue.current = !0;
1415
+ });
1416
+ }, []), i.useEffect(() => {
1417
+ var e;
1418
+ function t() {
1419
+ if (!L.current || !E) return;
1420
+ let e = document.activeElement;
1421
+ if ($t(e) || I.current) {
1422
+ let e = window.visualViewport?.height || 0, t = window.innerHeight, n = t - e, r = L.current.getBoundingClientRect().height || 0, i = r > t * .8;
1423
+ me.current ||= r;
1424
+ let a = L.current.getBoundingClientRect().top;
1425
+ if (Math.abs(de.current - n) > 60 && (I.current = !I.current), o && o.length > 0 && z && R) {
1426
+ let e = z[R] || 0;
1427
+ n += e;
1428
+ }
1429
+ if (de.current = n, r > e || I.current) {
1430
+ let t = L.current.getBoundingClientRect().height, r = t;
1431
+ t > e && (r = e - (i ? a : mn)), g ? L.current.style.height = `${t - Math.max(n, 0)}px` : L.current.style.height = `${Math.max(r, e - a)}px`;
1432
+ } else Nt() || (L.current.style.height = `${me.current}px`);
1433
+ o && o.length > 0 && !I.current ? L.current.style.bottom = "0px" : L.current.style.bottom = `${Math.max(n, 0)}px`;
1434
+ }
1435
+ }
1436
+ return (e = window.visualViewport) == null || e.addEventListener("resize", t), () => window.visualViewport?.removeEventListener("resize", t);
1437
+ }, [
1438
+ R,
1439
+ o,
1440
+ z
1441
+ ]);
1442
+ function H(e) {
1443
+ Te(), v?.(), e || ne(!1), setTimeout(() => {
1444
+ o && ge(o[0]);
1445
+ }, Z.DURATION * 1e3);
1446
+ }
1447
+ function we() {
1448
+ if (!L.current) return;
1449
+ let e = document.querySelector("[data-vaul-drawer-wrapper]"), t = on(L.current, x);
1450
+ Y(L.current, {
1451
+ transform: "translate3d(0, 0, 0)",
1452
+ transition: `transform ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})`
1453
+ }), Y(j.current, {
1454
+ transition: `opacity ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})`,
1455
+ opacity: "1"
1456
+ }), s && t && t > 0 && O && Y(e, {
1457
+ borderRadius: `${fn}px`,
1458
+ overflow: "hidden",
1459
+ ...X(x) ? {
1460
+ transform: `scale(${V()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
1461
+ transformOrigin: "top"
1462
+ } : {
1463
+ transform: `scale(${V()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
1464
+ transformOrigin: "left"
1465
+ },
1466
+ transitionProperty: "transform, border-radius",
1467
+ transitionDuration: `${Z.DURATION}s`,
1468
+ transitionTimingFunction: `cubic-bezier(${Z.EASE.join(",")})`
1469
+ }, !0);
1470
+ }
1471
+ function Te() {
1472
+ !k || !L.current || (L.current.classList.remove(hn), F.current = !1, A(!1), se.current = /* @__PURE__ */ new Date());
1473
+ }
1474
+ function Ee(e) {
1475
+ if (!k || !L.current) return;
1476
+ L.current.classList.remove(hn), F.current = !1, A(!1), se.current = /* @__PURE__ */ new Date();
1477
+ let t = on(L.current, x);
1478
+ if (!e || !Se(e.target, !1) || !t || Number.isNaN(t) || N.current === null) return;
1479
+ let n = se.current.getTime() - N.current.getTime(), r = le.current - (X(x) ? e.pageY : e.pageX), i = Math.abs(r) / n;
1480
+ if (i > .05 && (oe(!0), setTimeout(() => {
1481
+ oe(!1);
1482
+ }, 200)), o) {
1483
+ _e({
1484
+ draggedDistance: r * (x === "bottom" || x === "right" ? 1 : -1),
1485
+ closeDrawer: H,
1486
+ velocity: i,
1487
+ dismissible: d
1488
+ }), a?.(e, !0);
1489
+ return;
1490
+ }
1491
+ if (x === "bottom" || x === "right" ? r > 0 : r < 0) {
1492
+ we(), a?.(e, !0);
1493
+ return;
1494
+ }
1495
+ if (i > ln) {
1496
+ H(), a?.(e, !1);
1497
+ return;
1498
+ }
1499
+ let s = Math.min(L.current.getBoundingClientRect().height ?? 0, window.innerHeight), c = Math.min(L.current.getBoundingClientRect().width ?? 0, window.innerWidth);
1500
+ if (Math.abs(t) >= (x === "left" || x === "right" ? c : s) * l) {
1501
+ H(), a?.(e, !1);
1502
+ return;
1503
+ }
1504
+ a?.(e, !0), we();
1505
+ }
1506
+ i.useEffect(() => (O && (Y(document.documentElement, { scrollBehavior: "auto" }), M.current = /* @__PURE__ */ new Date()), () => {
1507
+ an(document.documentElement, "scrollBehavior");
1508
+ }), [O]);
1509
+ function U(e) {
1510
+ let t = e ? (window.innerWidth - pn) / window.innerWidth : 1, n = e ? -16 : 0;
1511
+ ce.current && window.clearTimeout(ce.current), Y(L.current, {
1512
+ transition: `transform ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})`,
1513
+ transform: X(x) ? `scale(${t}) translate3d(0, ${n}px, 0)` : `scale(${t}) translate3d(${n}px, 0, 0)`
1514
+ }), !e && L.current && (ce.current = setTimeout(() => {
1515
+ let e = on(L.current, x);
1516
+ Y(L.current, {
1517
+ transition: "none",
1518
+ transform: X(x) ? `translate3d(0, ${e}px, 0)` : `translate3d(${e}px, 0, 0)`
1519
+ });
1520
+ }, 500));
1521
+ }
1522
+ function De(e, t) {
1523
+ if (t < 0) return;
1524
+ let n = (window.innerWidth - pn) / window.innerWidth, r = n + t * (1 - n), i = -16 + t * pn;
1525
+ Y(L.current, {
1526
+ transform: X(x) ? `scale(${r}) translate3d(0, ${i}px, 0)` : `scale(${r}) translate3d(${i}px, 0, 0)`,
1527
+ transition: "none"
1528
+ });
1529
+ }
1530
+ function Oe(e, t) {
1531
+ let n = X(x) ? window.innerHeight : window.innerWidth, r = t ? (n - pn) / n : 1, i = t ? -16 : 0;
1532
+ t && Y(L.current, {
1533
+ transition: `transform ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})`,
1534
+ transform: X(x) ? `scale(${r}) translate3d(0, ${i}px, 0)` : `scale(${r}) translate3d(${i}px, 0, 0)`
1535
+ });
1536
+ }
1537
+ return i.useEffect(() => {
1538
+ _ || window.requestAnimationFrame(() => {
1539
+ document.body.style.pointerEvents = "auto";
1540
+ });
1541
+ }, [_]), /*#__PURE__*/ i.createElement(Ct, {
1542
+ defaultOpen: S,
1543
+ onOpenChange: (e) => {
1544
+ !d && !e || (e ? ie(!0) : H(!0), ne(e));
1545
+ },
1546
+ open: O
1547
+ }, /*#__PURE__*/ i.createElement(Mt.Provider, { value: {
1548
+ activeSnapPoint: he,
1549
+ snapPoints: o,
1550
+ setActiveSnapPoint: ge,
1551
+ drawerRef: L,
1552
+ overlayRef: j,
1553
+ onOpenChange: t,
1554
+ onPress: xe,
1555
+ onRelease: Ee,
1556
+ onDrag: Ce,
1557
+ dismissible: d,
1558
+ shouldAnimate: ue,
1559
+ handleOnly: f,
1560
+ isOpen: O,
1561
+ isDragging: k,
1562
+ shouldFade: B,
1563
+ closeDrawer: H,
1564
+ onNestedDrag: De,
1565
+ onNestedOpenChange: U,
1566
+ onNestedRelease: Oe,
1567
+ keyboardIsOpen: I,
1568
+ modal: _,
1569
+ snapPointsOffset: z,
1570
+ activeSnapPointIndex: R,
1571
+ direction: x,
1572
+ shouldScaleBackground: s,
1573
+ setBackgroundColorOnScale: c,
1574
+ noBodyStyles: b,
1575
+ container: D,
1576
+ autoFocus: te
1577
+ } }, n));
1578
+ }
1579
+ var Cn = /*#__PURE__*/ i.forwardRef(function({ ...e }, t) {
1580
+ let { overlayRef: n, snapPoints: r, onRelease: a, shouldFade: o, isOpen: s, modal: c, shouldAnimate: l } = q(), u = nn(t, n), d = r && r.length > 0;
1581
+ if (!c) return null;
1582
+ let f = i.useCallback((e) => a(e), [a]);
1583
+ return /*#__PURE__*/ i.createElement(Et, {
1584
+ onMouseUp: f,
1585
+ ref: u,
1586
+ "data-vaul-overlay": "",
1587
+ "data-vaul-snap-points": s && d ? "true" : "false",
1588
+ "data-vaul-snap-points-overlay": s && o ? "true" : "false",
1589
+ "data-vaul-animate": l?.current ? "true" : "false",
1590
+ ...e
1591
+ });
1592
+ });
1593
+ Cn.displayName = "Drawer.Overlay";
1594
+ var wn = /*#__PURE__*/ i.forwardRef(function({ onPointerDownOutside: e, style: t, onOpenAutoFocus: n, ...r }, a) {
1595
+ let { drawerRef: o, onPress: s, onRelease: c, onDrag: l, keyboardIsOpen: u, snapPointsOffset: d, activeSnapPointIndex: f, modal: p, isOpen: m, direction: h, snapPoints: g, container: _, handleOnly: v, shouldAnimate: y, autoFocus: b } = q(), [x, S] = i.useState(!1), C = nn(a, o), w = i.useRef(null), T = i.useRef(null), E = i.useRef(!1), ee = g && g.length > 0;
1596
+ bn();
1597
+ let D = (e, t, n = 0) => {
1598
+ if (E.current) return !0;
1599
+ let r = Math.abs(e.y), i = Math.abs(e.x), a = i > r, o = ["bottom", "right"].includes(t) ? 1 : -1;
1600
+ if (t === "left" || t === "right") {
1601
+ if (!(e.x * o < 0) && i >= 0 && i <= n) return a;
1602
+ } else if (!(e.y * o < 0) && r >= 0 && r <= n) return !a;
1603
+ return E.current = !0, !0;
1604
+ };
1605
+ i.useEffect(() => {
1606
+ ee && window.requestAnimationFrame(() => {
1607
+ S(!0);
1608
+ });
1609
+ }, []);
1610
+ function te(e) {
1611
+ w.current = null, E.current = !1, c(e);
1612
+ }
1613
+ return /*#__PURE__*/ i.createElement(Dt, {
1614
+ "data-vaul-drawer-direction": h,
1615
+ "data-vaul-drawer": "",
1616
+ "data-vaul-delayed-snap-points": x ? "true" : "false",
1617
+ "data-vaul-snap-points": m && ee ? "true" : "false",
1618
+ "data-vaul-custom-container": _ ? "true" : "false",
1619
+ "data-vaul-animate": y?.current ? "true" : "false",
1620
+ ...r,
1621
+ ref: C,
1622
+ style: d && d.length > 0 ? {
1623
+ "--snap-point-height": `${d[f ?? 0]}px`,
1624
+ ...t
1625
+ } : t,
1626
+ onPointerDown: (e) => {
1627
+ v || (r.onPointerDown == null || r.onPointerDown.call(r, e), w.current = {
1628
+ x: e.pageX,
1629
+ y: e.pageY
1630
+ }, s(e));
1631
+ },
1632
+ onOpenAutoFocus: (e) => {
1633
+ n?.(e), b || e.preventDefault();
1634
+ },
1635
+ onPointerDownOutside: (t) => {
1636
+ if (e?.(t), !p || t.defaultPrevented) {
1637
+ t.preventDefault();
1638
+ return;
1639
+ }
1640
+ u.current &&= !1;
1641
+ },
1642
+ onFocusOutside: (e) => {
1643
+ if (!p) {
1644
+ e.preventDefault();
1645
+ return;
1646
+ }
1647
+ },
1648
+ onPointerMove: (e) => {
1649
+ if (T.current = e, v || (r.onPointerMove == null || r.onPointerMove.call(r, e), !w.current)) return;
1650
+ let t = e.pageY - w.current.y, n = e.pageX - w.current.x, i = e.pointerType === "touch" ? 10 : 2;
1651
+ D({
1652
+ x: n,
1653
+ y: t
1654
+ }, h, i) ? l(e) : (Math.abs(n) > i || Math.abs(t) > i) && (w.current = null);
1655
+ },
1656
+ onPointerUp: (e) => {
1657
+ r.onPointerUp == null || r.onPointerUp.call(r, e), w.current = null, E.current = !1, c(e);
1658
+ },
1659
+ onPointerOut: (e) => {
1660
+ r.onPointerOut == null || r.onPointerOut.call(r, e), te(T.current);
1661
+ },
1662
+ onContextMenu: (e) => {
1663
+ r.onContextMenu == null || r.onContextMenu.call(r, e), T.current && te(T.current);
1664
+ }
1665
+ });
1666
+ });
1667
+ wn.displayName = "Drawer.Content";
1668
+ var Tn = 250, En = 120, Dn = /*#__PURE__*/ i.forwardRef(function({ preventCycle: e = !1, children: t, ...n }, r) {
1669
+ let { closeDrawer: a, isDragging: o, snapPoints: s, activeSnapPoint: c, setActiveSnapPoint: l, dismissible: u, handleOnly: d, isOpen: f, onPress: p, onDrag: m } = q(), h = i.useRef(null), g = i.useRef(!1);
1670
+ function _() {
1671
+ if (g.current) {
1672
+ b();
1673
+ return;
1674
+ }
1675
+ window.setTimeout(() => {
1676
+ v();
1677
+ }, En);
1678
+ }
1679
+ function v() {
1680
+ if (o || e || g.current) {
1681
+ b();
1682
+ return;
1683
+ }
1684
+ if (b(), !s || s.length === 0) {
1685
+ u || a();
1686
+ return;
1687
+ }
1688
+ if (c === s[s.length - 1] && u) {
1689
+ a();
1690
+ return;
1691
+ }
1692
+ let t = s.findIndex((e) => e === c);
1693
+ if (t === -1) return;
1694
+ let n = s[t + 1];
1695
+ l(n);
1696
+ }
1697
+ function y() {
1698
+ h.current = window.setTimeout(() => {
1699
+ g.current = !0;
1700
+ }, Tn);
1701
+ }
1702
+ function b() {
1703
+ h.current && window.clearTimeout(h.current), g.current = !1;
1704
+ }
1705
+ return /*#__PURE__*/ i.createElement("div", {
1706
+ onClick: _,
1707
+ onPointerCancel: b,
1708
+ onPointerDown: (e) => {
1709
+ d && p(e), y();
1710
+ },
1711
+ onPointerMove: (e) => {
1712
+ d && m(e);
1713
+ },
1714
+ ref: r,
1715
+ "data-vaul-drawer-visible": f ? "true" : "false",
1716
+ "data-vaul-handle": "",
1717
+ "aria-hidden": "true",
1718
+ ...n
1719
+ }, /*#__PURE__*/ i.createElement("span", {
1720
+ "data-vaul-handle-hitarea": "",
1721
+ "aria-hidden": "true"
1722
+ }, t));
1723
+ });
1724
+ Dn.displayName = "Drawer.Handle";
1725
+ function On({ onDrag: e, onOpenChange: t, open: n, ...r }) {
1726
+ let { onNestedDrag: a, onNestedOpenChange: o, onNestedRelease: s } = q();
1727
+ if (!a) throw Error("Drawer.NestedRoot must be placed in another drawer");
1728
+ return /*#__PURE__*/ i.createElement(Sn, {
1729
+ nested: !0,
1730
+ open: n,
1731
+ onClose: () => {
1732
+ o(!1);
1733
+ },
1734
+ onDrag: (t, n) => {
1735
+ a(t, n), e?.(t, n);
1736
+ },
1737
+ onOpenChange: (e) => {
1738
+ e && o(e), t?.(e);
1739
+ },
1740
+ onRelease: s,
1741
+ ...r
1742
+ });
1743
+ }
1744
+ function kn(e) {
1745
+ let t = q(), { container: n = t.container, ...r } = e;
1746
+ return /*#__PURE__*/ i.createElement(Tt, {
1747
+ container: n,
1748
+ ...r
1749
+ });
1750
+ }
1751
+ var $ = {
1752
+ Root: Sn,
1753
+ NestedRoot: On,
1754
+ Content: wn,
1755
+ Overlay: Cn,
1756
+ Trigger: wt,
1757
+ Portal: kn,
1758
+ Handle: Dn,
1759
+ Close: At,
1760
+ Title: Ot,
1761
+ Description: kt
1762
+ };
1763
+ //#endregion
1764
+ //#region src/components/ui/drawer.tsx
1765
+ function An({ ...e }) {
1766
+ return /* @__PURE__ */ l($.Root, {
1767
+ "data-slot": "drawer",
1768
+ ...e
1769
+ });
1770
+ }
1771
+ function jn({ ...e }) {
1772
+ return /* @__PURE__ */ l($.Trigger, {
1773
+ "data-slot": "drawer-trigger",
1774
+ ...e
1775
+ });
1776
+ }
1777
+ function Mn({ ...e }) {
1778
+ return /* @__PURE__ */ l($.Portal, {
1779
+ "data-slot": "drawer-portal",
1780
+ ...e
1781
+ });
1782
+ }
1783
+ function Nn({ ...e }) {
1784
+ return /* @__PURE__ */ l($.Close, {
1785
+ "data-slot": "drawer-close",
1786
+ ...e
1787
+ });
1788
+ }
1789
+ function Pn({ className: t, ...n }) {
1790
+ return /* @__PURE__ */ l($.Overlay, {
1791
+ className: e("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-1000 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in", t),
1792
+ "data-slot": "drawer-overlay",
1793
+ ...n
1794
+ });
1795
+ }
1796
+ function Fn({ className: t, children: n, ...r }) {
1797
+ return /* @__PURE__ */ u(Mn, {
1798
+ "data-slot": "drawer-portal",
1799
+ children: [/* @__PURE__ */ l(Pn, {}), /* @__PURE__ */ l($.Content, {
1800
+ className: e("group/drawer-content fixed z-1000 flex h-auto flex-col bg-white", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-0", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm", t),
1801
+ "data-slot": "drawer-content",
1802
+ ...r,
1803
+ children: n
1804
+ })]
1805
+ });
1806
+ }
1807
+ function In({ className: t, ...n }) {
1808
+ return /* @__PURE__ */ l("div", {
1809
+ className: e("flex flex-col gap-2 p-5", t),
1810
+ "data-slot": "drawer-header",
1811
+ ...n
1812
+ });
1813
+ }
1814
+ function Ln({ className: t, ...n }) {
1815
+ return /* @__PURE__ */ l("div", {
1816
+ className: e("mt-auto flex flex-col gap-2 p-5", t),
1817
+ "data-slot": "drawer-footer",
1818
+ ...n
1819
+ });
1820
+ }
1821
+ function Rn({ className: t, ...n }) {
1822
+ return /* @__PURE__ */ l($.Title, {
1823
+ className: e("font-semibold text-foreground", t),
1824
+ "data-slot": "drawer-title",
1825
+ ...n
1826
+ });
1827
+ }
1828
+ function zn({ className: t, ...n }) {
1829
+ return /* @__PURE__ */ l($.Description, {
1830
+ className: e("text-muted-foreground text-sm", t),
1831
+ "data-slot": "drawer-description",
1832
+ ...n
1833
+ });
1834
+ }
1835
+ //#endregion
1836
+ export { Ln as a, Mn as c, zn as i, Rn as l, Nn as n, In as o, Fn as r, Pn as s, An as t, jn as u };