@purpurds/popover 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE.txt +905 -0
- package/dist/metadata.js +8 -0
- package/dist/popover-back.d.ts +9 -0
- package/dist/popover-back.d.ts.map +1 -0
- package/dist/popover-button.d.ts +37 -0
- package/dist/popover-button.d.ts.map +1 -0
- package/dist/popover-content.d.ts +93 -0
- package/dist/popover-content.d.ts.map +1 -0
- package/dist/popover-flow.d.ts +65 -0
- package/dist/popover-flow.d.ts.map +1 -0
- package/dist/popover-footer.d.ts +16 -0
- package/dist/popover-footer.d.ts.map +1 -0
- package/dist/popover-header.d.ts +7 -0
- package/dist/popover-header.d.ts.map +1 -0
- package/dist/popover-internal-context.d.ts +15 -0
- package/dist/popover-internal-context.d.ts.map +1 -0
- package/dist/popover-next.d.ts +9 -0
- package/dist/popover-next.d.ts.map +1 -0
- package/dist/popover-standalone.d.ts +12 -0
- package/dist/popover-standalone.d.ts.map +1 -0
- package/dist/popover-steps.d.ts +6 -0
- package/dist/popover-steps.d.ts.map +1 -0
- package/dist/popover-trigger.d.ts +27 -0
- package/dist/popover-trigger.d.ts.map +1 -0
- package/dist/popover-walkthrough.d.ts +13 -0
- package/dist/popover-walkthrough.d.ts.map +1 -0
- package/dist/popover.cjs.js +42 -0
- package/dist/popover.cjs.js.map +1 -0
- package/dist/popover.d.ts +36 -0
- package/dist/popover.d.ts.map +1 -0
- package/dist/popover.es.js +3849 -0
- package/dist/popover.es.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/use-screen-size.hook.d.ts +7 -0
- package/dist/use-screen-size.hook.d.ts.map +1 -0
- package/dist/use-smooth-scroll.d.ts +5 -0
- package/dist/use-smooth-scroll.d.ts.map +1 -0
- package/dist/usePopoverTrigger.d.ts +5 -0
- package/dist/usePopoverTrigger.d.ts.map +1 -0
- package/dist/usePopoverWalkthrough.d.ts +7 -0
- package/dist/usePopoverWalkthrough.d.ts.map +1 -0
- package/eslint.config.mjs +2 -0
- package/package.json +82 -0
- package/src/global.d.ts +4 -0
- package/src/popover-back.test.tsx +63 -0
- package/src/popover-back.tsx +40 -0
- package/src/popover-button.test.tsx +51 -0
- package/src/popover-button.tsx +84 -0
- package/src/popover-content.test.tsx +1122 -0
- package/src/popover-content.tsx +277 -0
- package/src/popover-flow.tsx +170 -0
- package/src/popover-footer.test.tsx +21 -0
- package/src/popover-footer.tsx +32 -0
- package/src/popover-header.test.tsx +22 -0
- package/src/popover-header.tsx +32 -0
- package/src/popover-internal-context.tsx +28 -0
- package/src/popover-next.test.tsx +61 -0
- package/src/popover-next.tsx +40 -0
- package/src/popover-standalone.tsx +48 -0
- package/src/popover-steps.tsx +32 -0
- package/src/popover-trigger.tsx +71 -0
- package/src/popover-walkthrough.test.tsx +346 -0
- package/src/popover-walkthrough.tsx +45 -0
- package/src/popover.module.scss +315 -0
- package/src/popover.stories.tsx +1157 -0
- package/src/popover.test.tsx +642 -0
- package/src/popover.tsx +76 -0
- package/src/use-screen-size.hook.ts +39 -0
- package/src/use-smooth-scroll.ts +62 -0
- package/src/usePopoverTrigger.ts +59 -0
- package/src/usePopoverWalkthrough.ts +85 -0
- package/vitest.setup.ts +30 -0
|
@@ -0,0 +1,3849 @@
|
|
|
1
|
+
import { jsxs as U, jsx as w, Fragment as Mn } from "react/jsx-runtime";
|
|
2
|
+
import * as p from "react";
|
|
3
|
+
import { forwardRef as Ge, createContext as bt, useContext as Ze, useState as ce, useCallback as B, useMemo as to, useEffect as he, useLayoutEffect as no, useRef as me } from "react";
|
|
4
|
+
import * as kn from "react-dom";
|
|
5
|
+
import ro from "react-dom";
|
|
6
|
+
const oo = {
|
|
7
|
+
LG: "lg"
|
|
8
|
+
};
|
|
9
|
+
function io(e) {
|
|
10
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
11
|
+
}
|
|
12
|
+
var Ut = { exports: {} }, Yt;
|
|
13
|
+
function so() {
|
|
14
|
+
return Yt || (Yt = 1, (function(e) {
|
|
15
|
+
(function() {
|
|
16
|
+
var t = {}.hasOwnProperty;
|
|
17
|
+
function n() {
|
|
18
|
+
for (var o = "", s = 0; s < arguments.length; s++) {
|
|
19
|
+
var a = arguments[s];
|
|
20
|
+
a && (o = i(o, r.call(this, a)));
|
|
21
|
+
}
|
|
22
|
+
return o;
|
|
23
|
+
}
|
|
24
|
+
function r(o) {
|
|
25
|
+
if (typeof o == "string" || typeof o == "number")
|
|
26
|
+
return this && this[o] || o;
|
|
27
|
+
if (typeof o != "object")
|
|
28
|
+
return "";
|
|
29
|
+
if (Array.isArray(o))
|
|
30
|
+
return n.apply(this, o);
|
|
31
|
+
if (o.toString !== Object.prototype.toString && !o.toString.toString().includes("[native code]"))
|
|
32
|
+
return o.toString();
|
|
33
|
+
var s = "";
|
|
34
|
+
for (var a in o)
|
|
35
|
+
t.call(o, a) && o[a] && (s = i(s, this && this[a] || a));
|
|
36
|
+
return s;
|
|
37
|
+
}
|
|
38
|
+
function i(o, s) {
|
|
39
|
+
return s ? o ? o + " " + s : o + s : o;
|
|
40
|
+
}
|
|
41
|
+
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
42
|
+
})();
|
|
43
|
+
})(Ut)), Ut.exports;
|
|
44
|
+
}
|
|
45
|
+
var ao = so();
|
|
46
|
+
const co = /* @__PURE__ */ io(ao), uo = "_rotate_12t9p_1", lo = "_dash_12t9p_1", fo = {
|
|
47
|
+
"purpur-spinner": "_purpur-spinner_12t9p_2",
|
|
48
|
+
rotate: uo,
|
|
49
|
+
"purpur-spinner--xxs": "_purpur-spinner--xxs_12t9p_6",
|
|
50
|
+
"purpur-spinner--xs": "_purpur-spinner--xs_12t9p_10",
|
|
51
|
+
"purpur-spinner--sm": "_purpur-spinner--sm_12t9p_14",
|
|
52
|
+
"purpur-spinner--md": "_purpur-spinner--md_12t9p_18",
|
|
53
|
+
"purpur-spinner--lg": "_purpur-spinner--lg_12t9p_22",
|
|
54
|
+
"purpur-spinner__circle": "_purpur-spinner__circle_12t9p_26",
|
|
55
|
+
dash: lo,
|
|
56
|
+
"purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_12t9p_41",
|
|
57
|
+
"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_12t9p_44"
|
|
58
|
+
}, Xt = co.bind(fo), Ce = "purpur-spinner", po = {
|
|
59
|
+
SM: "sm"
|
|
60
|
+
}, Fn = ({
|
|
61
|
+
disabled: e = !1,
|
|
62
|
+
negative: t = !1,
|
|
63
|
+
size: n = po.SM,
|
|
64
|
+
className: r,
|
|
65
|
+
...i
|
|
66
|
+
}) => /* @__PURE__ */ w("div", { className: Xt(Ce, `${Ce}--${n}`, r), ...i, children: /* @__PURE__ */ w("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ w(
|
|
67
|
+
"circle",
|
|
68
|
+
{
|
|
69
|
+
className: Xt(`${Ce}__circle`, {
|
|
70
|
+
[`${Ce}__circle--disabled`]: e,
|
|
71
|
+
[`${Ce}__circle--negative`]: t
|
|
72
|
+
}),
|
|
73
|
+
cx: "25",
|
|
74
|
+
cy: "25",
|
|
75
|
+
r: "20"
|
|
76
|
+
}
|
|
77
|
+
) }) });
|
|
78
|
+
Fn.displayName = "Spinner";
|
|
79
|
+
function ho(e) {
|
|
80
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
81
|
+
}
|
|
82
|
+
var Kt = { exports: {} }, qt;
|
|
83
|
+
function vo() {
|
|
84
|
+
return qt || (qt = 1, (function(e) {
|
|
85
|
+
(function() {
|
|
86
|
+
var t = {}.hasOwnProperty;
|
|
87
|
+
function n() {
|
|
88
|
+
for (var o = "", s = 0; s < arguments.length; s++) {
|
|
89
|
+
var a = arguments[s];
|
|
90
|
+
a && (o = i(o, r.call(this, a)));
|
|
91
|
+
}
|
|
92
|
+
return o;
|
|
93
|
+
}
|
|
94
|
+
function r(o) {
|
|
95
|
+
if (typeof o == "string" || typeof o == "number")
|
|
96
|
+
return this && this[o] || o;
|
|
97
|
+
if (typeof o != "object")
|
|
98
|
+
return "";
|
|
99
|
+
if (Array.isArray(o))
|
|
100
|
+
return n.apply(this, o);
|
|
101
|
+
if (o.toString !== Object.prototype.toString && !o.toString.toString().includes("[native code]"))
|
|
102
|
+
return o.toString();
|
|
103
|
+
var s = "";
|
|
104
|
+
for (var a in o)
|
|
105
|
+
t.call(o, a) && o[a] && (s = i(s, this && this[a] || a));
|
|
106
|
+
return s;
|
|
107
|
+
}
|
|
108
|
+
function i(o, s) {
|
|
109
|
+
return s ? o ? o + " " + s : o + s : o;
|
|
110
|
+
}
|
|
111
|
+
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
112
|
+
})();
|
|
113
|
+
})(Kt)), Kt.exports;
|
|
114
|
+
}
|
|
115
|
+
var go = vo();
|
|
116
|
+
const mo = /* @__PURE__ */ ho(go), yo = {
|
|
117
|
+
"purpur-button": "_purpur-button_10jh0_1",
|
|
118
|
+
"purpur-button--xs": "_purpur-button--xs_10jh0_22",
|
|
119
|
+
"purpur-button--icon-only": "_purpur-button--icon-only_10jh0_25",
|
|
120
|
+
"purpur-button--sm": "_purpur-button--sm_10jh0_28",
|
|
121
|
+
"purpur-button--md": "_purpur-button--md_10jh0_34",
|
|
122
|
+
"purpur-button--lg": "_purpur-button--lg_10jh0_40",
|
|
123
|
+
"purpur-button--full-width": "_purpur-button--full-width_10jh0_46",
|
|
124
|
+
"purpur-button--primary": "_purpur-button--primary_10jh0_64",
|
|
125
|
+
"purpur-button--disabled": "_purpur-button--disabled_10jh0_68",
|
|
126
|
+
"purpur-button--primary-negative": "_purpur-button--primary-negative_10jh0_74",
|
|
127
|
+
"purpur-button--secondary": "_purpur-button--secondary_10jh0_86",
|
|
128
|
+
"purpur-button--secondary-negative": "_purpur-button--secondary-negative_10jh0_97",
|
|
129
|
+
"purpur-button--expressive": "_purpur-button--expressive_10jh0_108",
|
|
130
|
+
"purpur-button--expressive-negative": "_purpur-button--expressive-negative_10jh0_118",
|
|
131
|
+
"purpur-button--negative": "_purpur-button--negative_10jh0_130",
|
|
132
|
+
"purpur-button--destructive": "_purpur-button--destructive_10jh0_137",
|
|
133
|
+
"purpur-button--destructive-negative": "_purpur-button--destructive-negative_10jh0_147",
|
|
134
|
+
"purpur-button--tertiary-purple": "_purpur-button--tertiary-purple_10jh0_157",
|
|
135
|
+
"purpur-button--tertiary-purple-negative": "_purpur-button--tertiary-purple-negative_10jh0_170",
|
|
136
|
+
"purpur-button--text-negative": "_purpur-button--text-negative_10jh0_185",
|
|
137
|
+
"purpur-button--text": "_purpur-button--text_10jh0_185",
|
|
138
|
+
"purpur-button__spinner": "_purpur-button__spinner_10jh0_235"
|
|
139
|
+
}, Gt = mo.bind(yo), J = "purpur-button", Ae = Ge(
|
|
140
|
+
({
|
|
141
|
+
children: e,
|
|
142
|
+
className: t,
|
|
143
|
+
disabled: n = !1,
|
|
144
|
+
fullWidth: r = !1,
|
|
145
|
+
iconOnly: i,
|
|
146
|
+
loading: o = !1,
|
|
147
|
+
negative: s = !1,
|
|
148
|
+
onClick: a,
|
|
149
|
+
size: u = "md",
|
|
150
|
+
variant: c,
|
|
151
|
+
type: f = "button",
|
|
152
|
+
...l
|
|
153
|
+
}, h) => {
|
|
154
|
+
if (i && c === "destructive")
|
|
155
|
+
return null;
|
|
156
|
+
const v = Gt(
|
|
157
|
+
[
|
|
158
|
+
J,
|
|
159
|
+
`${J}--${s ? `${c}-negative` : c}`,
|
|
160
|
+
`${J}--${u}`
|
|
161
|
+
],
|
|
162
|
+
{
|
|
163
|
+
[`${J}--icon-only`]: i,
|
|
164
|
+
[`${J}--negative`]: s,
|
|
165
|
+
[`${J}--full-width`]: r,
|
|
166
|
+
[`${J}--disabled`]: n || o
|
|
167
|
+
},
|
|
168
|
+
t
|
|
169
|
+
), g = (m) => {
|
|
170
|
+
n || o ? m.preventDefault() : a && a(m);
|
|
171
|
+
}, d = !!l["aria-disabled"] || n || o;
|
|
172
|
+
return /* @__PURE__ */ U(
|
|
173
|
+
"button",
|
|
174
|
+
{
|
|
175
|
+
className: v,
|
|
176
|
+
type: f,
|
|
177
|
+
ref: h,
|
|
178
|
+
"aria-disabled": d,
|
|
179
|
+
onClick: g,
|
|
180
|
+
...l,
|
|
181
|
+
children: [
|
|
182
|
+
o && /* @__PURE__ */ w(
|
|
183
|
+
Fn,
|
|
184
|
+
{
|
|
185
|
+
size: u === oo.LG ? "xs" : "xxs",
|
|
186
|
+
negative: s,
|
|
187
|
+
disabled: d,
|
|
188
|
+
className: Gt(`${J}__spinner`)
|
|
189
|
+
}
|
|
190
|
+
),
|
|
191
|
+
" ",
|
|
192
|
+
e
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
Ae.displayName = "Button";
|
|
199
|
+
const xt = bt(null), St = () => {
|
|
200
|
+
const e = Ze(xt);
|
|
201
|
+
if (!e)
|
|
202
|
+
throw new Error("usePopoverFlow must be used within a PopoverFlow provider");
|
|
203
|
+
return e;
|
|
204
|
+
}, Re = () => Ze(xt), _o = ({
|
|
205
|
+
children: e,
|
|
206
|
+
initialStep: t = 1,
|
|
207
|
+
onComplete: n,
|
|
208
|
+
onDismiss: r,
|
|
209
|
+
separatorText: i,
|
|
210
|
+
stepText: o,
|
|
211
|
+
backLabel: s,
|
|
212
|
+
nextLabel: a,
|
|
213
|
+
finishLabel: u,
|
|
214
|
+
openDelay: c = 0
|
|
215
|
+
}) => {
|
|
216
|
+
const [f, l] = ce(t), [h, v] = ce(/* @__PURE__ */ new Set()), g = B((_) => {
|
|
217
|
+
v((b) => {
|
|
218
|
+
const P = new Set(b);
|
|
219
|
+
return P.add(_), P;
|
|
220
|
+
});
|
|
221
|
+
}, []), d = B((_) => {
|
|
222
|
+
v((b) => {
|
|
223
|
+
const P = new Set(b);
|
|
224
|
+
return P.delete(_), P;
|
|
225
|
+
});
|
|
226
|
+
}, []), m = B(() => {
|
|
227
|
+
l((_) => {
|
|
228
|
+
const b = _ + 1;
|
|
229
|
+
return b > h.size ? (n?.(), _) : b;
|
|
230
|
+
});
|
|
231
|
+
}, [h.size, n]), y = B(() => {
|
|
232
|
+
l((_) => Math.max(1, _ - 1));
|
|
233
|
+
}, []), x = B(() => {
|
|
234
|
+
l(0), r?.();
|
|
235
|
+
}, [r]), S = to(
|
|
236
|
+
() => ({
|
|
237
|
+
currentStep: f,
|
|
238
|
+
totalSteps: h.size,
|
|
239
|
+
next: m,
|
|
240
|
+
back: y,
|
|
241
|
+
dismiss: x,
|
|
242
|
+
registerStep: g,
|
|
243
|
+
unregisterStep: d,
|
|
244
|
+
separatorText: i,
|
|
245
|
+
stepText: o,
|
|
246
|
+
backLabel: s,
|
|
247
|
+
nextLabel: a,
|
|
248
|
+
finishLabel: u,
|
|
249
|
+
openDelay: c
|
|
250
|
+
}),
|
|
251
|
+
[
|
|
252
|
+
f,
|
|
253
|
+
h.size,
|
|
254
|
+
m,
|
|
255
|
+
y,
|
|
256
|
+
x,
|
|
257
|
+
g,
|
|
258
|
+
d,
|
|
259
|
+
i,
|
|
260
|
+
o,
|
|
261
|
+
s,
|
|
262
|
+
a,
|
|
263
|
+
u,
|
|
264
|
+
c
|
|
265
|
+
]
|
|
266
|
+
);
|
|
267
|
+
return /* @__PURE__ */ w(xt.Provider, { value: S, children: e });
|
|
268
|
+
}, Ct = bt(null), Pt = () => Ze(Ct), Dn = bt({ negative: !1 }), Et = () => Ze(Dn), wo = "600px", bo = 150, Zt = {
|
|
269
|
+
MAX_MD: `(max-width: ${wo})`
|
|
270
|
+
}, Ot = () => {
|
|
271
|
+
const e = window.matchMedia(Zt.MAX_MD);
|
|
272
|
+
function t() {
|
|
273
|
+
r(e.matches);
|
|
274
|
+
}
|
|
275
|
+
const [n, r] = ce(() => typeof window > "u" ? !1 : window.matchMedia(Zt.MAX_MD).matches), i = B(() => {
|
|
276
|
+
let o;
|
|
277
|
+
return () => {
|
|
278
|
+
clearTimeout(o), o = setTimeout(() => t(), bo);
|
|
279
|
+
};
|
|
280
|
+
}, [t]);
|
|
281
|
+
return he(() => {
|
|
282
|
+
if (!(typeof window > "u"))
|
|
283
|
+
return window.addEventListener("resize", i), () => window.removeEventListener("resize", i);
|
|
284
|
+
}, [i]), { isMdOrSmaller: n };
|
|
285
|
+
}, At = ({
|
|
286
|
+
children: e,
|
|
287
|
+
onClick: t
|
|
288
|
+
}) => {
|
|
289
|
+
const { back: n } = St(), { negative: r } = Et(), { isMdOrSmaller: i } = Ot();
|
|
290
|
+
return /* @__PURE__ */ w(
|
|
291
|
+
Ae,
|
|
292
|
+
{
|
|
293
|
+
size: "sm",
|
|
294
|
+
variant: "secondary",
|
|
295
|
+
onClick: () => {
|
|
296
|
+
t?.(), n();
|
|
297
|
+
},
|
|
298
|
+
negative: !r,
|
|
299
|
+
fullWidth: i,
|
|
300
|
+
children: e
|
|
301
|
+
}
|
|
302
|
+
);
|
|
303
|
+
};
|
|
304
|
+
At.displayName = "PopoverBack";
|
|
305
|
+
function te(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
306
|
+
return function(i) {
|
|
307
|
+
if (e?.(i), n === !1 || !i.defaultPrevented)
|
|
308
|
+
return t?.(i);
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
function Qt(e, t) {
|
|
312
|
+
if (typeof e == "function")
|
|
313
|
+
return e(t);
|
|
314
|
+
e != null && (e.current = t);
|
|
315
|
+
}
|
|
316
|
+
function Ln(...e) {
|
|
317
|
+
return (t) => {
|
|
318
|
+
let n = !1;
|
|
319
|
+
const r = e.map((i) => {
|
|
320
|
+
const o = Qt(i, t);
|
|
321
|
+
return !n && typeof o == "function" && (n = !0), o;
|
|
322
|
+
});
|
|
323
|
+
if (n)
|
|
324
|
+
return () => {
|
|
325
|
+
for (let i = 0; i < r.length; i++) {
|
|
326
|
+
const o = r[i];
|
|
327
|
+
typeof o == "function" ? o() : Qt(e[i], null);
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
function ie(...e) {
|
|
333
|
+
return p.useCallback(Ln(...e), e);
|
|
334
|
+
}
|
|
335
|
+
function $n(e, t = []) {
|
|
336
|
+
let n = [];
|
|
337
|
+
function r(o, s) {
|
|
338
|
+
const a = p.createContext(s), u = n.length;
|
|
339
|
+
n = [...n, s];
|
|
340
|
+
const c = (l) => {
|
|
341
|
+
const { scope: h, children: v, ...g } = l, d = h?.[e]?.[u] || a, m = p.useMemo(() => g, Object.values(g));
|
|
342
|
+
return /* @__PURE__ */ w(d.Provider, { value: m, children: v });
|
|
343
|
+
};
|
|
344
|
+
c.displayName = o + "Provider";
|
|
345
|
+
function f(l, h) {
|
|
346
|
+
const v = h?.[e]?.[u] || a, g = p.useContext(v);
|
|
347
|
+
if (g) return g;
|
|
348
|
+
if (s !== void 0) return s;
|
|
349
|
+
throw new Error(`\`${l}\` must be used within \`${o}\``);
|
|
350
|
+
}
|
|
351
|
+
return [c, f];
|
|
352
|
+
}
|
|
353
|
+
const i = () => {
|
|
354
|
+
const o = n.map((s) => p.createContext(s));
|
|
355
|
+
return function(a) {
|
|
356
|
+
const u = a?.[e] || o;
|
|
357
|
+
return p.useMemo(
|
|
358
|
+
() => ({ [`__scope${e}`]: { ...a, [e]: u } }),
|
|
359
|
+
[a, u]
|
|
360
|
+
);
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
return i.scopeName = e, [r, xo(i, ...t)];
|
|
364
|
+
}
|
|
365
|
+
function xo(...e) {
|
|
366
|
+
const t = e[0];
|
|
367
|
+
if (e.length === 1) return t;
|
|
368
|
+
const n = () => {
|
|
369
|
+
const r = e.map((i) => ({
|
|
370
|
+
useScope: i(),
|
|
371
|
+
scopeName: i.scopeName
|
|
372
|
+
}));
|
|
373
|
+
return function(o) {
|
|
374
|
+
const s = r.reduce((a, { useScope: u, scopeName: c }) => {
|
|
375
|
+
const l = u(o)[`__scope${c}`];
|
|
376
|
+
return { ...a, ...l };
|
|
377
|
+
}, {});
|
|
378
|
+
return p.useMemo(() => ({ [`__scope${t.scopeName}`]: s }), [s]);
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
return n.scopeName = t.scopeName, n;
|
|
382
|
+
}
|
|
383
|
+
// @__NO_SIDE_EFFECTS__
|
|
384
|
+
function In(e) {
|
|
385
|
+
const t = /* @__PURE__ */ So(e), n = p.forwardRef((r, i) => {
|
|
386
|
+
const { children: o, ...s } = r, a = p.Children.toArray(o), u = a.find(Po);
|
|
387
|
+
if (u) {
|
|
388
|
+
const c = u.props.children, f = a.map((l) => l === u ? p.Children.count(c) > 1 ? p.Children.only(null) : p.isValidElement(c) ? c.props.children : null : l);
|
|
389
|
+
return /* @__PURE__ */ w(t, { ...s, ref: i, children: p.isValidElement(c) ? p.cloneElement(c, void 0, f) : null });
|
|
390
|
+
}
|
|
391
|
+
return /* @__PURE__ */ w(t, { ...s, ref: i, children: o });
|
|
392
|
+
});
|
|
393
|
+
return n.displayName = `${e}.Slot`, n;
|
|
394
|
+
}
|
|
395
|
+
// @__NO_SIDE_EFFECTS__
|
|
396
|
+
function So(e) {
|
|
397
|
+
const t = p.forwardRef((n, r) => {
|
|
398
|
+
const { children: i, ...o } = n;
|
|
399
|
+
if (p.isValidElement(i)) {
|
|
400
|
+
const s = Oo(i), a = Eo(o, i.props);
|
|
401
|
+
return i.type !== p.Fragment && (a.ref = r ? Ln(r, s) : s), p.cloneElement(i, a);
|
|
402
|
+
}
|
|
403
|
+
return p.Children.count(i) > 1 ? p.Children.only(null) : null;
|
|
404
|
+
});
|
|
405
|
+
return t.displayName = `${e}.SlotClone`, t;
|
|
406
|
+
}
|
|
407
|
+
var Co = Symbol("radix.slottable");
|
|
408
|
+
function Po(e) {
|
|
409
|
+
return p.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Co;
|
|
410
|
+
}
|
|
411
|
+
function Eo(e, t) {
|
|
412
|
+
const n = { ...t };
|
|
413
|
+
for (const r in t) {
|
|
414
|
+
const i = e[r], o = t[r];
|
|
415
|
+
/^on[A-Z]/.test(r) ? i && o ? n[r] = (...a) => {
|
|
416
|
+
const u = o(...a);
|
|
417
|
+
return i(...a), u;
|
|
418
|
+
} : i && (n[r] = i) : r === "style" ? n[r] = { ...i, ...o } : r === "className" && (n[r] = [i, o].filter(Boolean).join(" "));
|
|
419
|
+
}
|
|
420
|
+
return { ...e, ...n };
|
|
421
|
+
}
|
|
422
|
+
function Oo(e) {
|
|
423
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
424
|
+
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);
|
|
425
|
+
}
|
|
426
|
+
var Ao = [
|
|
427
|
+
"a",
|
|
428
|
+
"button",
|
|
429
|
+
"div",
|
|
430
|
+
"form",
|
|
431
|
+
"h2",
|
|
432
|
+
"h3",
|
|
433
|
+
"img",
|
|
434
|
+
"input",
|
|
435
|
+
"label",
|
|
436
|
+
"li",
|
|
437
|
+
"nav",
|
|
438
|
+
"ol",
|
|
439
|
+
"p",
|
|
440
|
+
"select",
|
|
441
|
+
"span",
|
|
442
|
+
"svg",
|
|
443
|
+
"ul"
|
|
444
|
+
], Q = Ao.reduce((e, t) => {
|
|
445
|
+
const n = /* @__PURE__ */ In(`Primitive.${t}`), r = p.forwardRef((i, o) => {
|
|
446
|
+
const { asChild: s, ...a } = i, u = s ? n : t;
|
|
447
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ w(u, { ...a, ref: o });
|
|
448
|
+
});
|
|
449
|
+
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
450
|
+
}, {});
|
|
451
|
+
function Ro(e, t) {
|
|
452
|
+
e && kn.flushSync(() => e.dispatchEvent(t));
|
|
453
|
+
}
|
|
454
|
+
function ye(e) {
|
|
455
|
+
const t = p.useRef(e);
|
|
456
|
+
return p.useEffect(() => {
|
|
457
|
+
t.current = e;
|
|
458
|
+
}), p.useMemo(() => (...n) => t.current?.(...n), []);
|
|
459
|
+
}
|
|
460
|
+
function No(e, t = globalThis?.document) {
|
|
461
|
+
const n = ye(e);
|
|
462
|
+
p.useEffect(() => {
|
|
463
|
+
const r = (i) => {
|
|
464
|
+
i.key === "Escape" && n(i);
|
|
465
|
+
};
|
|
466
|
+
return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
|
|
467
|
+
}, [n, t]);
|
|
468
|
+
}
|
|
469
|
+
var To = "DismissableLayer", gt = "dismissableLayer.update", Mo = "dismissableLayer.pointerDownOutside", ko = "dismissableLayer.focusOutside", Jt, Wn = p.createContext({
|
|
470
|
+
layers: /* @__PURE__ */ new Set(),
|
|
471
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
472
|
+
branches: /* @__PURE__ */ new Set()
|
|
473
|
+
}), Bn = p.forwardRef(
|
|
474
|
+
(e, t) => {
|
|
475
|
+
const {
|
|
476
|
+
disableOutsidePointerEvents: n = !1,
|
|
477
|
+
onEscapeKeyDown: r,
|
|
478
|
+
onPointerDownOutside: i,
|
|
479
|
+
onFocusOutside: o,
|
|
480
|
+
onInteractOutside: s,
|
|
481
|
+
onDismiss: a,
|
|
482
|
+
...u
|
|
483
|
+
} = e, c = p.useContext(Wn), [f, l] = p.useState(null), h = f?.ownerDocument ?? globalThis?.document, [, v] = p.useState({}), g = ie(t, (C) => l(C)), d = Array.from(c.layers), [m] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), y = d.indexOf(m), x = f ? d.indexOf(f) : -1, S = c.layersWithOutsidePointerEventsDisabled.size > 0, _ = x >= y, b = Lo((C) => {
|
|
484
|
+
const A = C.target, T = [...c.branches].some((N) => N.contains(A));
|
|
485
|
+
!_ || T || (i?.(C), s?.(C), C.defaultPrevented || a?.());
|
|
486
|
+
}, h), P = $o((C) => {
|
|
487
|
+
const A = C.target;
|
|
488
|
+
[...c.branches].some((N) => N.contains(A)) || (o?.(C), s?.(C), C.defaultPrevented || a?.());
|
|
489
|
+
}, h);
|
|
490
|
+
return No((C) => {
|
|
491
|
+
x === c.layers.size - 1 && (r?.(C), !C.defaultPrevented && a && (C.preventDefault(), a()));
|
|
492
|
+
}, h), p.useEffect(() => {
|
|
493
|
+
if (f)
|
|
494
|
+
return n && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (Jt = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(f)), c.layers.add(f), en(), () => {
|
|
495
|
+
n && c.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = Jt);
|
|
496
|
+
};
|
|
497
|
+
}, [f, h, n, c]), p.useEffect(() => () => {
|
|
498
|
+
f && (c.layers.delete(f), c.layersWithOutsidePointerEventsDisabled.delete(f), en());
|
|
499
|
+
}, [f, c]), p.useEffect(() => {
|
|
500
|
+
const C = () => v({});
|
|
501
|
+
return document.addEventListener(gt, C), () => document.removeEventListener(gt, C);
|
|
502
|
+
}, []), /* @__PURE__ */ w(
|
|
503
|
+
Q.div,
|
|
504
|
+
{
|
|
505
|
+
...u,
|
|
506
|
+
ref: g,
|
|
507
|
+
style: {
|
|
508
|
+
pointerEvents: S ? _ ? "auto" : "none" : void 0,
|
|
509
|
+
...e.style
|
|
510
|
+
},
|
|
511
|
+
onFocusCapture: te(e.onFocusCapture, P.onFocusCapture),
|
|
512
|
+
onBlurCapture: te(e.onBlurCapture, P.onBlurCapture),
|
|
513
|
+
onPointerDownCapture: te(
|
|
514
|
+
e.onPointerDownCapture,
|
|
515
|
+
b.onPointerDownCapture
|
|
516
|
+
)
|
|
517
|
+
}
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
);
|
|
521
|
+
Bn.displayName = To;
|
|
522
|
+
var Fo = "DismissableLayerBranch", Do = p.forwardRef((e, t) => {
|
|
523
|
+
const n = p.useContext(Wn), r = p.useRef(null), i = ie(t, r);
|
|
524
|
+
return p.useEffect(() => {
|
|
525
|
+
const o = r.current;
|
|
526
|
+
if (o)
|
|
527
|
+
return n.branches.add(o), () => {
|
|
528
|
+
n.branches.delete(o);
|
|
529
|
+
};
|
|
530
|
+
}, [n.branches]), /* @__PURE__ */ w(Q.div, { ...e, ref: i });
|
|
531
|
+
});
|
|
532
|
+
Do.displayName = Fo;
|
|
533
|
+
function Lo(e, t = globalThis?.document) {
|
|
534
|
+
const n = ye(e), r = p.useRef(!1), i = p.useRef(() => {
|
|
535
|
+
});
|
|
536
|
+
return p.useEffect(() => {
|
|
537
|
+
const o = (a) => {
|
|
538
|
+
if (a.target && !r.current) {
|
|
539
|
+
let u = function() {
|
|
540
|
+
jn(
|
|
541
|
+
Mo,
|
|
542
|
+
n,
|
|
543
|
+
c,
|
|
544
|
+
{ discrete: !0 }
|
|
545
|
+
);
|
|
546
|
+
};
|
|
547
|
+
const c = { originalEvent: a };
|
|
548
|
+
a.pointerType === "touch" ? (t.removeEventListener("click", i.current), i.current = u, t.addEventListener("click", i.current, { once: !0 })) : u();
|
|
549
|
+
} else
|
|
550
|
+
t.removeEventListener("click", i.current);
|
|
551
|
+
r.current = !1;
|
|
552
|
+
}, s = window.setTimeout(() => {
|
|
553
|
+
t.addEventListener("pointerdown", o);
|
|
554
|
+
}, 0);
|
|
555
|
+
return () => {
|
|
556
|
+
window.clearTimeout(s), t.removeEventListener("pointerdown", o), t.removeEventListener("click", i.current);
|
|
557
|
+
};
|
|
558
|
+
}, [t, n]), {
|
|
559
|
+
// ensures we check React component tree (not just DOM tree)
|
|
560
|
+
onPointerDownCapture: () => r.current = !0
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
function $o(e, t = globalThis?.document) {
|
|
564
|
+
const n = ye(e), r = p.useRef(!1);
|
|
565
|
+
return p.useEffect(() => {
|
|
566
|
+
const i = (o) => {
|
|
567
|
+
o.target && !r.current && jn(ko, n, { originalEvent: o }, {
|
|
568
|
+
discrete: !1
|
|
569
|
+
});
|
|
570
|
+
};
|
|
571
|
+
return t.addEventListener("focusin", i), () => t.removeEventListener("focusin", i);
|
|
572
|
+
}, [t, n]), {
|
|
573
|
+
onFocusCapture: () => r.current = !0,
|
|
574
|
+
onBlurCapture: () => r.current = !1
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
function en() {
|
|
578
|
+
const e = new CustomEvent(gt);
|
|
579
|
+
document.dispatchEvent(e);
|
|
580
|
+
}
|
|
581
|
+
function jn(e, t, n, { discrete: r }) {
|
|
582
|
+
const i = n.originalEvent.target, o = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
|
|
583
|
+
t && i.addEventListener(e, t, { once: !0 }), r ? Ro(i, o) : i.dispatchEvent(o);
|
|
584
|
+
}
|
|
585
|
+
var ot = 0;
|
|
586
|
+
function Io() {
|
|
587
|
+
p.useEffect(() => {
|
|
588
|
+
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
589
|
+
return document.body.insertAdjacentElement("afterbegin", e[0] ?? tn()), document.body.insertAdjacentElement("beforeend", e[1] ?? tn()), ot++, () => {
|
|
590
|
+
ot === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), ot--;
|
|
591
|
+
};
|
|
592
|
+
}, []);
|
|
593
|
+
}
|
|
594
|
+
function tn() {
|
|
595
|
+
const e = document.createElement("span");
|
|
596
|
+
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;
|
|
597
|
+
}
|
|
598
|
+
var it = "focusScope.autoFocusOnMount", st = "focusScope.autoFocusOnUnmount", nn = { bubbles: !1, cancelable: !0 }, Wo = "FocusScope", zn = p.forwardRef((e, t) => {
|
|
599
|
+
const {
|
|
600
|
+
loop: n = !1,
|
|
601
|
+
trapped: r = !1,
|
|
602
|
+
onMountAutoFocus: i,
|
|
603
|
+
onUnmountAutoFocus: o,
|
|
604
|
+
...s
|
|
605
|
+
} = e, [a, u] = p.useState(null), c = ye(i), f = ye(o), l = p.useRef(null), h = ie(t, (d) => u(d)), v = p.useRef({
|
|
606
|
+
paused: !1,
|
|
607
|
+
pause() {
|
|
608
|
+
this.paused = !0;
|
|
609
|
+
},
|
|
610
|
+
resume() {
|
|
611
|
+
this.paused = !1;
|
|
612
|
+
}
|
|
613
|
+
}).current;
|
|
614
|
+
p.useEffect(() => {
|
|
615
|
+
if (r) {
|
|
616
|
+
let d = function(S) {
|
|
617
|
+
if (v.paused || !a) return;
|
|
618
|
+
const _ = S.target;
|
|
619
|
+
a.contains(_) ? l.current = _ : ee(l.current, { select: !0 });
|
|
620
|
+
}, m = function(S) {
|
|
621
|
+
if (v.paused || !a) return;
|
|
622
|
+
const _ = S.relatedTarget;
|
|
623
|
+
_ !== null && (a.contains(_) || ee(l.current, { select: !0 }));
|
|
624
|
+
}, y = function(S) {
|
|
625
|
+
if (document.activeElement === document.body)
|
|
626
|
+
for (const b of S)
|
|
627
|
+
b.removedNodes.length > 0 && ee(a);
|
|
628
|
+
};
|
|
629
|
+
document.addEventListener("focusin", d), document.addEventListener("focusout", m);
|
|
630
|
+
const x = new MutationObserver(y);
|
|
631
|
+
return a && x.observe(a, { childList: !0, subtree: !0 }), () => {
|
|
632
|
+
document.removeEventListener("focusin", d), document.removeEventListener("focusout", m), x.disconnect();
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
}, [r, a, v.paused]), p.useEffect(() => {
|
|
636
|
+
if (a) {
|
|
637
|
+
on.add(v);
|
|
638
|
+
const d = document.activeElement;
|
|
639
|
+
if (!a.contains(d)) {
|
|
640
|
+
const y = new CustomEvent(it, nn);
|
|
641
|
+
a.addEventListener(it, c), a.dispatchEvent(y), y.defaultPrevented || (Bo(Uo(Hn(a)), { select: !0 }), document.activeElement === d && ee(a));
|
|
642
|
+
}
|
|
643
|
+
return () => {
|
|
644
|
+
a.removeEventListener(it, c), setTimeout(() => {
|
|
645
|
+
const y = new CustomEvent(st, nn);
|
|
646
|
+
a.addEventListener(st, f), a.dispatchEvent(y), y.defaultPrevented || ee(d ?? document.body, { select: !0 }), a.removeEventListener(st, f), on.remove(v);
|
|
647
|
+
}, 0);
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
}, [a, c, f, v]);
|
|
651
|
+
const g = p.useCallback(
|
|
652
|
+
(d) => {
|
|
653
|
+
if (!n && !r || v.paused) return;
|
|
654
|
+
const m = d.key === "Tab" && !d.altKey && !d.ctrlKey && !d.metaKey, y = document.activeElement;
|
|
655
|
+
if (m && y) {
|
|
656
|
+
const x = d.currentTarget, [S, _] = jo(x);
|
|
657
|
+
S && _ ? !d.shiftKey && y === _ ? (d.preventDefault(), n && ee(S, { select: !0 })) : d.shiftKey && y === S && (d.preventDefault(), n && ee(_, { select: !0 })) : y === x && d.preventDefault();
|
|
658
|
+
}
|
|
659
|
+
},
|
|
660
|
+
[n, r, v.paused]
|
|
661
|
+
);
|
|
662
|
+
return /* @__PURE__ */ w(Q.div, { tabIndex: -1, ...s, ref: h, onKeyDown: g });
|
|
663
|
+
});
|
|
664
|
+
zn.displayName = Wo;
|
|
665
|
+
function Bo(e, { select: t = !1 } = {}) {
|
|
666
|
+
const n = document.activeElement;
|
|
667
|
+
for (const r of e)
|
|
668
|
+
if (ee(r, { select: t }), document.activeElement !== n) return;
|
|
669
|
+
}
|
|
670
|
+
function jo(e) {
|
|
671
|
+
const t = Hn(e), n = rn(t, e), r = rn(t.reverse(), e);
|
|
672
|
+
return [n, r];
|
|
673
|
+
}
|
|
674
|
+
function Hn(e) {
|
|
675
|
+
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
676
|
+
acceptNode: (r) => {
|
|
677
|
+
const i = r.tagName === "INPUT" && r.type === "hidden";
|
|
678
|
+
return r.disabled || r.hidden || i ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
for (; n.nextNode(); ) t.push(n.currentNode);
|
|
682
|
+
return t;
|
|
683
|
+
}
|
|
684
|
+
function rn(e, t) {
|
|
685
|
+
for (const n of e)
|
|
686
|
+
if (!zo(n, { upTo: t })) return n;
|
|
687
|
+
}
|
|
688
|
+
function zo(e, { upTo: t }) {
|
|
689
|
+
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
690
|
+
for (; e; ) {
|
|
691
|
+
if (t !== void 0 && e === t) return !1;
|
|
692
|
+
if (getComputedStyle(e).display === "none") return !0;
|
|
693
|
+
e = e.parentElement;
|
|
694
|
+
}
|
|
695
|
+
return !1;
|
|
696
|
+
}
|
|
697
|
+
function Ho(e) {
|
|
698
|
+
return e instanceof HTMLInputElement && "select" in e;
|
|
699
|
+
}
|
|
700
|
+
function ee(e, { select: t = !1 } = {}) {
|
|
701
|
+
if (e && e.focus) {
|
|
702
|
+
const n = document.activeElement;
|
|
703
|
+
e.focus({ preventScroll: !0 }), e !== n && Ho(e) && t && e.select();
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
var on = Vo();
|
|
707
|
+
function Vo() {
|
|
708
|
+
let e = [];
|
|
709
|
+
return {
|
|
710
|
+
add(t) {
|
|
711
|
+
const n = e[0];
|
|
712
|
+
t !== n && n?.pause(), e = sn(e, t), e.unshift(t);
|
|
713
|
+
},
|
|
714
|
+
remove(t) {
|
|
715
|
+
e = sn(e, t), e[0]?.resume();
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
function sn(e, t) {
|
|
720
|
+
const n = [...e], r = n.indexOf(t);
|
|
721
|
+
return r !== -1 && n.splice(r, 1), n;
|
|
722
|
+
}
|
|
723
|
+
function Uo(e) {
|
|
724
|
+
return e.filter((t) => t.tagName !== "A");
|
|
725
|
+
}
|
|
726
|
+
var ne = globalThis?.document ? p.useLayoutEffect : () => {
|
|
727
|
+
}, Yo = p[" useId ".trim().toString()] || (() => {
|
|
728
|
+
}), Xo = 0;
|
|
729
|
+
function Ko(e) {
|
|
730
|
+
const [t, n] = p.useState(Yo());
|
|
731
|
+
return ne(() => {
|
|
732
|
+
n((r) => r ?? String(Xo++));
|
|
733
|
+
}, [e]), e || (t ? `radix-${t}` : "");
|
|
734
|
+
}
|
|
735
|
+
const qo = ["top", "right", "bottom", "left"], re = Math.min, I = Math.max, Ye = Math.round, De = Math.floor, X = (e) => ({
|
|
736
|
+
x: e,
|
|
737
|
+
y: e
|
|
738
|
+
}), Go = {
|
|
739
|
+
left: "right",
|
|
740
|
+
right: "left",
|
|
741
|
+
bottom: "top",
|
|
742
|
+
top: "bottom"
|
|
743
|
+
}, Zo = {
|
|
744
|
+
start: "end",
|
|
745
|
+
end: "start"
|
|
746
|
+
};
|
|
747
|
+
function mt(e, t, n) {
|
|
748
|
+
return I(e, re(t, n));
|
|
749
|
+
}
|
|
750
|
+
function G(e, t) {
|
|
751
|
+
return typeof e == "function" ? e(t) : e;
|
|
752
|
+
}
|
|
753
|
+
function Z(e) {
|
|
754
|
+
return e.split("-")[0];
|
|
755
|
+
}
|
|
756
|
+
function be(e) {
|
|
757
|
+
return e.split("-")[1];
|
|
758
|
+
}
|
|
759
|
+
function Rt(e) {
|
|
760
|
+
return e === "x" ? "y" : "x";
|
|
761
|
+
}
|
|
762
|
+
function Nt(e) {
|
|
763
|
+
return e === "y" ? "height" : "width";
|
|
764
|
+
}
|
|
765
|
+
const Qo = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
766
|
+
function Y(e) {
|
|
767
|
+
return Qo.has(Z(e)) ? "y" : "x";
|
|
768
|
+
}
|
|
769
|
+
function Tt(e) {
|
|
770
|
+
return Rt(Y(e));
|
|
771
|
+
}
|
|
772
|
+
function Jo(e, t, n) {
|
|
773
|
+
n === void 0 && (n = !1);
|
|
774
|
+
const r = be(e), i = Tt(e), o = Nt(i);
|
|
775
|
+
let s = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
776
|
+
return t.reference[o] > t.floating[o] && (s = Xe(s)), [s, Xe(s)];
|
|
777
|
+
}
|
|
778
|
+
function ei(e) {
|
|
779
|
+
const t = Xe(e);
|
|
780
|
+
return [yt(e), t, yt(t)];
|
|
781
|
+
}
|
|
782
|
+
function yt(e) {
|
|
783
|
+
return e.replace(/start|end/g, (t) => Zo[t]);
|
|
784
|
+
}
|
|
785
|
+
const an = ["left", "right"], cn = ["right", "left"], ti = ["top", "bottom"], ni = ["bottom", "top"];
|
|
786
|
+
function ri(e, t, n) {
|
|
787
|
+
switch (e) {
|
|
788
|
+
case "top":
|
|
789
|
+
case "bottom":
|
|
790
|
+
return n ? t ? cn : an : t ? an : cn;
|
|
791
|
+
case "left":
|
|
792
|
+
case "right":
|
|
793
|
+
return t ? ti : ni;
|
|
794
|
+
default:
|
|
795
|
+
return [];
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
function oi(e, t, n, r) {
|
|
799
|
+
const i = be(e);
|
|
800
|
+
let o = ri(Z(e), n === "start", r);
|
|
801
|
+
return i && (o = o.map((s) => s + "-" + i), t && (o = o.concat(o.map(yt)))), o;
|
|
802
|
+
}
|
|
803
|
+
function Xe(e) {
|
|
804
|
+
return e.replace(/left|right|bottom|top/g, (t) => Go[t]);
|
|
805
|
+
}
|
|
806
|
+
function ii(e) {
|
|
807
|
+
return {
|
|
808
|
+
top: 0,
|
|
809
|
+
right: 0,
|
|
810
|
+
bottom: 0,
|
|
811
|
+
left: 0,
|
|
812
|
+
...e
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
function Vn(e) {
|
|
816
|
+
return typeof e != "number" ? ii(e) : {
|
|
817
|
+
top: e,
|
|
818
|
+
right: e,
|
|
819
|
+
bottom: e,
|
|
820
|
+
left: e
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
function Ke(e) {
|
|
824
|
+
const {
|
|
825
|
+
x: t,
|
|
826
|
+
y: n,
|
|
827
|
+
width: r,
|
|
828
|
+
height: i
|
|
829
|
+
} = e;
|
|
830
|
+
return {
|
|
831
|
+
width: r,
|
|
832
|
+
height: i,
|
|
833
|
+
top: n,
|
|
834
|
+
left: t,
|
|
835
|
+
right: t + r,
|
|
836
|
+
bottom: n + i,
|
|
837
|
+
x: t,
|
|
838
|
+
y: n
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
function un(e, t, n) {
|
|
842
|
+
let {
|
|
843
|
+
reference: r,
|
|
844
|
+
floating: i
|
|
845
|
+
} = e;
|
|
846
|
+
const o = Y(t), s = Tt(t), a = Nt(s), u = Z(t), c = o === "y", f = r.x + r.width / 2 - i.width / 2, l = r.y + r.height / 2 - i.height / 2, h = r[a] / 2 - i[a] / 2;
|
|
847
|
+
let v;
|
|
848
|
+
switch (u) {
|
|
849
|
+
case "top":
|
|
850
|
+
v = {
|
|
851
|
+
x: f,
|
|
852
|
+
y: r.y - i.height
|
|
853
|
+
};
|
|
854
|
+
break;
|
|
855
|
+
case "bottom":
|
|
856
|
+
v = {
|
|
857
|
+
x: f,
|
|
858
|
+
y: r.y + r.height
|
|
859
|
+
};
|
|
860
|
+
break;
|
|
861
|
+
case "right":
|
|
862
|
+
v = {
|
|
863
|
+
x: r.x + r.width,
|
|
864
|
+
y: l
|
|
865
|
+
};
|
|
866
|
+
break;
|
|
867
|
+
case "left":
|
|
868
|
+
v = {
|
|
869
|
+
x: r.x - i.width,
|
|
870
|
+
y: l
|
|
871
|
+
};
|
|
872
|
+
break;
|
|
873
|
+
default:
|
|
874
|
+
v = {
|
|
875
|
+
x: r.x,
|
|
876
|
+
y: r.y
|
|
877
|
+
};
|
|
878
|
+
}
|
|
879
|
+
switch (be(t)) {
|
|
880
|
+
case "start":
|
|
881
|
+
v[s] -= h * (n && c ? -1 : 1);
|
|
882
|
+
break;
|
|
883
|
+
case "end":
|
|
884
|
+
v[s] += h * (n && c ? -1 : 1);
|
|
885
|
+
break;
|
|
886
|
+
}
|
|
887
|
+
return v;
|
|
888
|
+
}
|
|
889
|
+
const si = async (e, t, n) => {
|
|
890
|
+
const {
|
|
891
|
+
placement: r = "bottom",
|
|
892
|
+
strategy: i = "absolute",
|
|
893
|
+
middleware: o = [],
|
|
894
|
+
platform: s
|
|
895
|
+
} = n, a = o.filter(Boolean), u = await (s.isRTL == null ? void 0 : s.isRTL(t));
|
|
896
|
+
let c = await s.getElementRects({
|
|
897
|
+
reference: e,
|
|
898
|
+
floating: t,
|
|
899
|
+
strategy: i
|
|
900
|
+
}), {
|
|
901
|
+
x: f,
|
|
902
|
+
y: l
|
|
903
|
+
} = un(c, r, u), h = r, v = {}, g = 0;
|
|
904
|
+
for (let d = 0; d < a.length; d++) {
|
|
905
|
+
const {
|
|
906
|
+
name: m,
|
|
907
|
+
fn: y
|
|
908
|
+
} = a[d], {
|
|
909
|
+
x,
|
|
910
|
+
y: S,
|
|
911
|
+
data: _,
|
|
912
|
+
reset: b
|
|
913
|
+
} = await y({
|
|
914
|
+
x: f,
|
|
915
|
+
y: l,
|
|
916
|
+
initialPlacement: r,
|
|
917
|
+
placement: h,
|
|
918
|
+
strategy: i,
|
|
919
|
+
middlewareData: v,
|
|
920
|
+
rects: c,
|
|
921
|
+
platform: s,
|
|
922
|
+
elements: {
|
|
923
|
+
reference: e,
|
|
924
|
+
floating: t
|
|
925
|
+
}
|
|
926
|
+
});
|
|
927
|
+
f = x ?? f, l = S ?? l, v = {
|
|
928
|
+
...v,
|
|
929
|
+
[m]: {
|
|
930
|
+
...v[m],
|
|
931
|
+
..._
|
|
932
|
+
}
|
|
933
|
+
}, b && g <= 50 && (g++, typeof b == "object" && (b.placement && (h = b.placement), b.rects && (c = b.rects === !0 ? await s.getElementRects({
|
|
934
|
+
reference: e,
|
|
935
|
+
floating: t,
|
|
936
|
+
strategy: i
|
|
937
|
+
}) : b.rects), {
|
|
938
|
+
x: f,
|
|
939
|
+
y: l
|
|
940
|
+
} = un(c, h, u)), d = -1);
|
|
941
|
+
}
|
|
942
|
+
return {
|
|
943
|
+
x: f,
|
|
944
|
+
y: l,
|
|
945
|
+
placement: h,
|
|
946
|
+
strategy: i,
|
|
947
|
+
middlewareData: v
|
|
948
|
+
};
|
|
949
|
+
};
|
|
950
|
+
async function Ee(e, t) {
|
|
951
|
+
var n;
|
|
952
|
+
t === void 0 && (t = {});
|
|
953
|
+
const {
|
|
954
|
+
x: r,
|
|
955
|
+
y: i,
|
|
956
|
+
platform: o,
|
|
957
|
+
rects: s,
|
|
958
|
+
elements: a,
|
|
959
|
+
strategy: u
|
|
960
|
+
} = e, {
|
|
961
|
+
boundary: c = "clippingAncestors",
|
|
962
|
+
rootBoundary: f = "viewport",
|
|
963
|
+
elementContext: l = "floating",
|
|
964
|
+
altBoundary: h = !1,
|
|
965
|
+
padding: v = 0
|
|
966
|
+
} = G(t, e), g = Vn(v), m = a[h ? l === "floating" ? "reference" : "floating" : l], y = Ke(await o.getClippingRect({
|
|
967
|
+
element: (n = await (o.isElement == null ? void 0 : o.isElement(m))) == null || n ? m : m.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(a.floating)),
|
|
968
|
+
boundary: c,
|
|
969
|
+
rootBoundary: f,
|
|
970
|
+
strategy: u
|
|
971
|
+
})), x = l === "floating" ? {
|
|
972
|
+
x: r,
|
|
973
|
+
y: i,
|
|
974
|
+
width: s.floating.width,
|
|
975
|
+
height: s.floating.height
|
|
976
|
+
} : s.reference, S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(a.floating)), _ = await (o.isElement == null ? void 0 : o.isElement(S)) ? await (o.getScale == null ? void 0 : o.getScale(S)) || {
|
|
977
|
+
x: 1,
|
|
978
|
+
y: 1
|
|
979
|
+
} : {
|
|
980
|
+
x: 1,
|
|
981
|
+
y: 1
|
|
982
|
+
}, b = Ke(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
983
|
+
elements: a,
|
|
984
|
+
rect: x,
|
|
985
|
+
offsetParent: S,
|
|
986
|
+
strategy: u
|
|
987
|
+
}) : x);
|
|
988
|
+
return {
|
|
989
|
+
top: (y.top - b.top + g.top) / _.y,
|
|
990
|
+
bottom: (b.bottom - y.bottom + g.bottom) / _.y,
|
|
991
|
+
left: (y.left - b.left + g.left) / _.x,
|
|
992
|
+
right: (b.right - y.right + g.right) / _.x
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
const ai = (e) => ({
|
|
996
|
+
name: "arrow",
|
|
997
|
+
options: e,
|
|
998
|
+
async fn(t) {
|
|
999
|
+
const {
|
|
1000
|
+
x: n,
|
|
1001
|
+
y: r,
|
|
1002
|
+
placement: i,
|
|
1003
|
+
rects: o,
|
|
1004
|
+
platform: s,
|
|
1005
|
+
elements: a,
|
|
1006
|
+
middlewareData: u
|
|
1007
|
+
} = t, {
|
|
1008
|
+
element: c,
|
|
1009
|
+
padding: f = 0
|
|
1010
|
+
} = G(e, t) || {};
|
|
1011
|
+
if (c == null)
|
|
1012
|
+
return {};
|
|
1013
|
+
const l = Vn(f), h = {
|
|
1014
|
+
x: n,
|
|
1015
|
+
y: r
|
|
1016
|
+
}, v = Tt(i), g = Nt(v), d = await s.getDimensions(c), m = v === "y", y = m ? "top" : "left", x = m ? "bottom" : "right", S = m ? "clientHeight" : "clientWidth", _ = o.reference[g] + o.reference[v] - h[v] - o.floating[g], b = h[v] - o.reference[v], P = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c));
|
|
1017
|
+
let C = P ? P[S] : 0;
|
|
1018
|
+
(!C || !await (s.isElement == null ? void 0 : s.isElement(P))) && (C = a.floating[S] || o.floating[g]);
|
|
1019
|
+
const A = _ / 2 - b / 2, T = C / 2 - d[g] / 2 - 1, N = re(l[y], T), E = re(l[x], T), R = N, M = C - d[g] - E, k = C / 2 - d[g] / 2 + A, $ = mt(R, k, M), F = !u.arrow && be(i) != null && k !== $ && o.reference[g] / 2 - (k < R ? N : E) - d[g] / 2 < 0, D = F ? k < R ? k - R : k - M : 0;
|
|
1020
|
+
return {
|
|
1021
|
+
[v]: h[v] + D,
|
|
1022
|
+
data: {
|
|
1023
|
+
[v]: $,
|
|
1024
|
+
centerOffset: k - $ - D,
|
|
1025
|
+
...F && {
|
|
1026
|
+
alignmentOffset: D
|
|
1027
|
+
}
|
|
1028
|
+
},
|
|
1029
|
+
reset: F
|
|
1030
|
+
};
|
|
1031
|
+
}
|
|
1032
|
+
}), ci = function(e) {
|
|
1033
|
+
return e === void 0 && (e = {}), {
|
|
1034
|
+
name: "flip",
|
|
1035
|
+
options: e,
|
|
1036
|
+
async fn(t) {
|
|
1037
|
+
var n, r;
|
|
1038
|
+
const {
|
|
1039
|
+
placement: i,
|
|
1040
|
+
middlewareData: o,
|
|
1041
|
+
rects: s,
|
|
1042
|
+
initialPlacement: a,
|
|
1043
|
+
platform: u,
|
|
1044
|
+
elements: c
|
|
1045
|
+
} = t, {
|
|
1046
|
+
mainAxis: f = !0,
|
|
1047
|
+
crossAxis: l = !0,
|
|
1048
|
+
fallbackPlacements: h,
|
|
1049
|
+
fallbackStrategy: v = "bestFit",
|
|
1050
|
+
fallbackAxisSideDirection: g = "none",
|
|
1051
|
+
flipAlignment: d = !0,
|
|
1052
|
+
...m
|
|
1053
|
+
} = G(e, t);
|
|
1054
|
+
if ((n = o.arrow) != null && n.alignmentOffset)
|
|
1055
|
+
return {};
|
|
1056
|
+
const y = Z(i), x = Y(a), S = Z(a) === a, _ = await (u.isRTL == null ? void 0 : u.isRTL(c.floating)), b = h || (S || !d ? [Xe(a)] : ei(a)), P = g !== "none";
|
|
1057
|
+
!h && P && b.push(...oi(a, d, g, _));
|
|
1058
|
+
const C = [a, ...b], A = await Ee(t, m), T = [];
|
|
1059
|
+
let N = ((r = o.flip) == null ? void 0 : r.overflows) || [];
|
|
1060
|
+
if (f && T.push(A[y]), l) {
|
|
1061
|
+
const k = Jo(i, s, _);
|
|
1062
|
+
T.push(A[k[0]], A[k[1]]);
|
|
1063
|
+
}
|
|
1064
|
+
if (N = [...N, {
|
|
1065
|
+
placement: i,
|
|
1066
|
+
overflows: T
|
|
1067
|
+
}], !T.every((k) => k <= 0)) {
|
|
1068
|
+
var E, R;
|
|
1069
|
+
const k = (((E = o.flip) == null ? void 0 : E.index) || 0) + 1, $ = C[k];
|
|
1070
|
+
if ($ && (!(l === "alignment" ? x !== Y($) : !1) || // We leave the current main axis only if every placement on that axis
|
|
1071
|
+
// overflows the main axis.
|
|
1072
|
+
N.every((O) => Y(O.placement) === x ? O.overflows[0] > 0 : !0)))
|
|
1073
|
+
return {
|
|
1074
|
+
data: {
|
|
1075
|
+
index: k,
|
|
1076
|
+
overflows: N
|
|
1077
|
+
},
|
|
1078
|
+
reset: {
|
|
1079
|
+
placement: $
|
|
1080
|
+
}
|
|
1081
|
+
};
|
|
1082
|
+
let F = (R = N.filter((D) => D.overflows[0] <= 0).sort((D, O) => D.overflows[1] - O.overflows[1])[0]) == null ? void 0 : R.placement;
|
|
1083
|
+
if (!F)
|
|
1084
|
+
switch (v) {
|
|
1085
|
+
case "bestFit": {
|
|
1086
|
+
var M;
|
|
1087
|
+
const D = (M = N.filter((O) => {
|
|
1088
|
+
if (P) {
|
|
1089
|
+
const L = Y(O.placement);
|
|
1090
|
+
return L === x || // Create a bias to the `y` side axis due to horizontal
|
|
1091
|
+
// reading directions favoring greater width.
|
|
1092
|
+
L === "y";
|
|
1093
|
+
}
|
|
1094
|
+
return !0;
|
|
1095
|
+
}).map((O) => [O.placement, O.overflows.filter((L) => L > 0).reduce((L, H) => L + H, 0)]).sort((O, L) => O[1] - L[1])[0]) == null ? void 0 : M[0];
|
|
1096
|
+
D && (F = D);
|
|
1097
|
+
break;
|
|
1098
|
+
}
|
|
1099
|
+
case "initialPlacement":
|
|
1100
|
+
F = a;
|
|
1101
|
+
break;
|
|
1102
|
+
}
|
|
1103
|
+
if (i !== F)
|
|
1104
|
+
return {
|
|
1105
|
+
reset: {
|
|
1106
|
+
placement: F
|
|
1107
|
+
}
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1110
|
+
return {};
|
|
1111
|
+
}
|
|
1112
|
+
};
|
|
1113
|
+
};
|
|
1114
|
+
function ln(e, t) {
|
|
1115
|
+
return {
|
|
1116
|
+
top: e.top - t.height,
|
|
1117
|
+
right: e.right - t.width,
|
|
1118
|
+
bottom: e.bottom - t.height,
|
|
1119
|
+
left: e.left - t.width
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
function fn(e) {
|
|
1123
|
+
return qo.some((t) => e[t] >= 0);
|
|
1124
|
+
}
|
|
1125
|
+
const ui = function(e) {
|
|
1126
|
+
return e === void 0 && (e = {}), {
|
|
1127
|
+
name: "hide",
|
|
1128
|
+
options: e,
|
|
1129
|
+
async fn(t) {
|
|
1130
|
+
const {
|
|
1131
|
+
rects: n
|
|
1132
|
+
} = t, {
|
|
1133
|
+
strategy: r = "referenceHidden",
|
|
1134
|
+
...i
|
|
1135
|
+
} = G(e, t);
|
|
1136
|
+
switch (r) {
|
|
1137
|
+
case "referenceHidden": {
|
|
1138
|
+
const o = await Ee(t, {
|
|
1139
|
+
...i,
|
|
1140
|
+
elementContext: "reference"
|
|
1141
|
+
}), s = ln(o, n.reference);
|
|
1142
|
+
return {
|
|
1143
|
+
data: {
|
|
1144
|
+
referenceHiddenOffsets: s,
|
|
1145
|
+
referenceHidden: fn(s)
|
|
1146
|
+
}
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
case "escaped": {
|
|
1150
|
+
const o = await Ee(t, {
|
|
1151
|
+
...i,
|
|
1152
|
+
altBoundary: !0
|
|
1153
|
+
}), s = ln(o, n.floating);
|
|
1154
|
+
return {
|
|
1155
|
+
data: {
|
|
1156
|
+
escapedOffsets: s,
|
|
1157
|
+
escaped: fn(s)
|
|
1158
|
+
}
|
|
1159
|
+
};
|
|
1160
|
+
}
|
|
1161
|
+
default:
|
|
1162
|
+
return {};
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
};
|
|
1166
|
+
}, Un = /* @__PURE__ */ new Set(["left", "top"]);
|
|
1167
|
+
async function li(e, t) {
|
|
1168
|
+
const {
|
|
1169
|
+
placement: n,
|
|
1170
|
+
platform: r,
|
|
1171
|
+
elements: i
|
|
1172
|
+
} = e, o = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), s = Z(n), a = be(n), u = Y(n) === "y", c = Un.has(s) ? -1 : 1, f = o && u ? -1 : 1, l = G(t, e);
|
|
1173
|
+
let {
|
|
1174
|
+
mainAxis: h,
|
|
1175
|
+
crossAxis: v,
|
|
1176
|
+
alignmentAxis: g
|
|
1177
|
+
} = typeof l == "number" ? {
|
|
1178
|
+
mainAxis: l,
|
|
1179
|
+
crossAxis: 0,
|
|
1180
|
+
alignmentAxis: null
|
|
1181
|
+
} : {
|
|
1182
|
+
mainAxis: l.mainAxis || 0,
|
|
1183
|
+
crossAxis: l.crossAxis || 0,
|
|
1184
|
+
alignmentAxis: l.alignmentAxis
|
|
1185
|
+
};
|
|
1186
|
+
return a && typeof g == "number" && (v = a === "end" ? g * -1 : g), u ? {
|
|
1187
|
+
x: v * f,
|
|
1188
|
+
y: h * c
|
|
1189
|
+
} : {
|
|
1190
|
+
x: h * c,
|
|
1191
|
+
y: v * f
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1194
|
+
const fi = function(e) {
|
|
1195
|
+
return e === void 0 && (e = 0), {
|
|
1196
|
+
name: "offset",
|
|
1197
|
+
options: e,
|
|
1198
|
+
async fn(t) {
|
|
1199
|
+
var n, r;
|
|
1200
|
+
const {
|
|
1201
|
+
x: i,
|
|
1202
|
+
y: o,
|
|
1203
|
+
placement: s,
|
|
1204
|
+
middlewareData: a
|
|
1205
|
+
} = t, u = await li(t, e);
|
|
1206
|
+
return s === ((n = a.offset) == null ? void 0 : n.placement) && (r = a.arrow) != null && r.alignmentOffset ? {} : {
|
|
1207
|
+
x: i + u.x,
|
|
1208
|
+
y: o + u.y,
|
|
1209
|
+
data: {
|
|
1210
|
+
...u,
|
|
1211
|
+
placement: s
|
|
1212
|
+
}
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
};
|
|
1216
|
+
}, pi = function(e) {
|
|
1217
|
+
return e === void 0 && (e = {}), {
|
|
1218
|
+
name: "shift",
|
|
1219
|
+
options: e,
|
|
1220
|
+
async fn(t) {
|
|
1221
|
+
const {
|
|
1222
|
+
x: n,
|
|
1223
|
+
y: r,
|
|
1224
|
+
placement: i
|
|
1225
|
+
} = t, {
|
|
1226
|
+
mainAxis: o = !0,
|
|
1227
|
+
crossAxis: s = !1,
|
|
1228
|
+
limiter: a = {
|
|
1229
|
+
fn: (m) => {
|
|
1230
|
+
let {
|
|
1231
|
+
x: y,
|
|
1232
|
+
y: x
|
|
1233
|
+
} = m;
|
|
1234
|
+
return {
|
|
1235
|
+
x: y,
|
|
1236
|
+
y: x
|
|
1237
|
+
};
|
|
1238
|
+
}
|
|
1239
|
+
},
|
|
1240
|
+
...u
|
|
1241
|
+
} = G(e, t), c = {
|
|
1242
|
+
x: n,
|
|
1243
|
+
y: r
|
|
1244
|
+
}, f = await Ee(t, u), l = Y(Z(i)), h = Rt(l);
|
|
1245
|
+
let v = c[h], g = c[l];
|
|
1246
|
+
if (o) {
|
|
1247
|
+
const m = h === "y" ? "top" : "left", y = h === "y" ? "bottom" : "right", x = v + f[m], S = v - f[y];
|
|
1248
|
+
v = mt(x, v, S);
|
|
1249
|
+
}
|
|
1250
|
+
if (s) {
|
|
1251
|
+
const m = l === "y" ? "top" : "left", y = l === "y" ? "bottom" : "right", x = g + f[m], S = g - f[y];
|
|
1252
|
+
g = mt(x, g, S);
|
|
1253
|
+
}
|
|
1254
|
+
const d = a.fn({
|
|
1255
|
+
...t,
|
|
1256
|
+
[h]: v,
|
|
1257
|
+
[l]: g
|
|
1258
|
+
});
|
|
1259
|
+
return {
|
|
1260
|
+
...d,
|
|
1261
|
+
data: {
|
|
1262
|
+
x: d.x - n,
|
|
1263
|
+
y: d.y - r,
|
|
1264
|
+
enabled: {
|
|
1265
|
+
[h]: o,
|
|
1266
|
+
[l]: s
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
};
|
|
1270
|
+
}
|
|
1271
|
+
};
|
|
1272
|
+
}, di = function(e) {
|
|
1273
|
+
return e === void 0 && (e = {}), {
|
|
1274
|
+
options: e,
|
|
1275
|
+
fn(t) {
|
|
1276
|
+
const {
|
|
1277
|
+
x: n,
|
|
1278
|
+
y: r,
|
|
1279
|
+
placement: i,
|
|
1280
|
+
rects: o,
|
|
1281
|
+
middlewareData: s
|
|
1282
|
+
} = t, {
|
|
1283
|
+
offset: a = 0,
|
|
1284
|
+
mainAxis: u = !0,
|
|
1285
|
+
crossAxis: c = !0
|
|
1286
|
+
} = G(e, t), f = {
|
|
1287
|
+
x: n,
|
|
1288
|
+
y: r
|
|
1289
|
+
}, l = Y(i), h = Rt(l);
|
|
1290
|
+
let v = f[h], g = f[l];
|
|
1291
|
+
const d = G(a, t), m = typeof d == "number" ? {
|
|
1292
|
+
mainAxis: d,
|
|
1293
|
+
crossAxis: 0
|
|
1294
|
+
} : {
|
|
1295
|
+
mainAxis: 0,
|
|
1296
|
+
crossAxis: 0,
|
|
1297
|
+
...d
|
|
1298
|
+
};
|
|
1299
|
+
if (u) {
|
|
1300
|
+
const S = h === "y" ? "height" : "width", _ = o.reference[h] - o.floating[S] + m.mainAxis, b = o.reference[h] + o.reference[S] - m.mainAxis;
|
|
1301
|
+
v < _ ? v = _ : v > b && (v = b);
|
|
1302
|
+
}
|
|
1303
|
+
if (c) {
|
|
1304
|
+
var y, x;
|
|
1305
|
+
const S = h === "y" ? "width" : "height", _ = Un.has(Z(i)), b = o.reference[l] - o.floating[S] + (_ && ((y = s.offset) == null ? void 0 : y[l]) || 0) + (_ ? 0 : m.crossAxis), P = o.reference[l] + o.reference[S] + (_ ? 0 : ((x = s.offset) == null ? void 0 : x[l]) || 0) - (_ ? m.crossAxis : 0);
|
|
1306
|
+
g < b ? g = b : g > P && (g = P);
|
|
1307
|
+
}
|
|
1308
|
+
return {
|
|
1309
|
+
[h]: v,
|
|
1310
|
+
[l]: g
|
|
1311
|
+
};
|
|
1312
|
+
}
|
|
1313
|
+
};
|
|
1314
|
+
}, hi = function(e) {
|
|
1315
|
+
return e === void 0 && (e = {}), {
|
|
1316
|
+
name: "size",
|
|
1317
|
+
options: e,
|
|
1318
|
+
async fn(t) {
|
|
1319
|
+
var n, r;
|
|
1320
|
+
const {
|
|
1321
|
+
placement: i,
|
|
1322
|
+
rects: o,
|
|
1323
|
+
platform: s,
|
|
1324
|
+
elements: a
|
|
1325
|
+
} = t, {
|
|
1326
|
+
apply: u = () => {
|
|
1327
|
+
},
|
|
1328
|
+
...c
|
|
1329
|
+
} = G(e, t), f = await Ee(t, c), l = Z(i), h = be(i), v = Y(i) === "y", {
|
|
1330
|
+
width: g,
|
|
1331
|
+
height: d
|
|
1332
|
+
} = o.floating;
|
|
1333
|
+
let m, y;
|
|
1334
|
+
l === "top" || l === "bottom" ? (m = l, y = h === (await (s.isRTL == null ? void 0 : s.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (y = l, m = h === "end" ? "top" : "bottom");
|
|
1335
|
+
const x = d - f.top - f.bottom, S = g - f.left - f.right, _ = re(d - f[m], x), b = re(g - f[y], S), P = !t.middlewareData.shift;
|
|
1336
|
+
let C = _, A = b;
|
|
1337
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (A = S), (r = t.middlewareData.shift) != null && r.enabled.y && (C = x), P && !h) {
|
|
1338
|
+
const N = I(f.left, 0), E = I(f.right, 0), R = I(f.top, 0), M = I(f.bottom, 0);
|
|
1339
|
+
v ? A = g - 2 * (N !== 0 || E !== 0 ? N + E : I(f.left, f.right)) : C = d - 2 * (R !== 0 || M !== 0 ? R + M : I(f.top, f.bottom));
|
|
1340
|
+
}
|
|
1341
|
+
await u({
|
|
1342
|
+
...t,
|
|
1343
|
+
availableWidth: A,
|
|
1344
|
+
availableHeight: C
|
|
1345
|
+
});
|
|
1346
|
+
const T = await s.getDimensions(a.floating);
|
|
1347
|
+
return g !== T.width || d !== T.height ? {
|
|
1348
|
+
reset: {
|
|
1349
|
+
rects: !0
|
|
1350
|
+
}
|
|
1351
|
+
} : {};
|
|
1352
|
+
}
|
|
1353
|
+
};
|
|
1354
|
+
};
|
|
1355
|
+
function Qe() {
|
|
1356
|
+
return typeof window < "u";
|
|
1357
|
+
}
|
|
1358
|
+
function xe(e) {
|
|
1359
|
+
return Yn(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
1360
|
+
}
|
|
1361
|
+
function W(e) {
|
|
1362
|
+
var t;
|
|
1363
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
1364
|
+
}
|
|
1365
|
+
function q(e) {
|
|
1366
|
+
var t;
|
|
1367
|
+
return (t = (Yn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
1368
|
+
}
|
|
1369
|
+
function Yn(e) {
|
|
1370
|
+
return Qe() ? e instanceof Node || e instanceof W(e).Node : !1;
|
|
1371
|
+
}
|
|
1372
|
+
function j(e) {
|
|
1373
|
+
return Qe() ? e instanceof Element || e instanceof W(e).Element : !1;
|
|
1374
|
+
}
|
|
1375
|
+
function K(e) {
|
|
1376
|
+
return Qe() ? e instanceof HTMLElement || e instanceof W(e).HTMLElement : !1;
|
|
1377
|
+
}
|
|
1378
|
+
function pn(e) {
|
|
1379
|
+
return !Qe() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof W(e).ShadowRoot;
|
|
1380
|
+
}
|
|
1381
|
+
const vi = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
1382
|
+
function Ne(e) {
|
|
1383
|
+
const {
|
|
1384
|
+
overflow: t,
|
|
1385
|
+
overflowX: n,
|
|
1386
|
+
overflowY: r,
|
|
1387
|
+
display: i
|
|
1388
|
+
} = z(e);
|
|
1389
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !vi.has(i);
|
|
1390
|
+
}
|
|
1391
|
+
const gi = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
1392
|
+
function mi(e) {
|
|
1393
|
+
return gi.has(xe(e));
|
|
1394
|
+
}
|
|
1395
|
+
const yi = [":popover-open", ":modal"];
|
|
1396
|
+
function Je(e) {
|
|
1397
|
+
return yi.some((t) => {
|
|
1398
|
+
try {
|
|
1399
|
+
return e.matches(t);
|
|
1400
|
+
} catch {
|
|
1401
|
+
return !1;
|
|
1402
|
+
}
|
|
1403
|
+
});
|
|
1404
|
+
}
|
|
1405
|
+
const _i = ["transform", "translate", "scale", "rotate", "perspective"], wi = ["transform", "translate", "scale", "rotate", "perspective", "filter"], bi = ["paint", "layout", "strict", "content"];
|
|
1406
|
+
function Mt(e) {
|
|
1407
|
+
const t = kt(), n = j(e) ? z(e) : e;
|
|
1408
|
+
return _i.some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || wi.some((r) => (n.willChange || "").includes(r)) || bi.some((r) => (n.contain || "").includes(r));
|
|
1409
|
+
}
|
|
1410
|
+
function xi(e) {
|
|
1411
|
+
let t = oe(e);
|
|
1412
|
+
for (; K(t) && !_e(t); ) {
|
|
1413
|
+
if (Mt(t))
|
|
1414
|
+
return t;
|
|
1415
|
+
if (Je(t))
|
|
1416
|
+
return null;
|
|
1417
|
+
t = oe(t);
|
|
1418
|
+
}
|
|
1419
|
+
return null;
|
|
1420
|
+
}
|
|
1421
|
+
function kt() {
|
|
1422
|
+
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
1423
|
+
}
|
|
1424
|
+
const Si = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
1425
|
+
function _e(e) {
|
|
1426
|
+
return Si.has(xe(e));
|
|
1427
|
+
}
|
|
1428
|
+
function z(e) {
|
|
1429
|
+
return W(e).getComputedStyle(e);
|
|
1430
|
+
}
|
|
1431
|
+
function et(e) {
|
|
1432
|
+
return j(e) ? {
|
|
1433
|
+
scrollLeft: e.scrollLeft,
|
|
1434
|
+
scrollTop: e.scrollTop
|
|
1435
|
+
} : {
|
|
1436
|
+
scrollLeft: e.scrollX,
|
|
1437
|
+
scrollTop: e.scrollY
|
|
1438
|
+
};
|
|
1439
|
+
}
|
|
1440
|
+
function oe(e) {
|
|
1441
|
+
if (xe(e) === "html")
|
|
1442
|
+
return e;
|
|
1443
|
+
const t = (
|
|
1444
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
1445
|
+
e.assignedSlot || // DOM Element detected.
|
|
1446
|
+
e.parentNode || // ShadowRoot detected.
|
|
1447
|
+
pn(e) && e.host || // Fallback.
|
|
1448
|
+
q(e)
|
|
1449
|
+
);
|
|
1450
|
+
return pn(t) ? t.host : t;
|
|
1451
|
+
}
|
|
1452
|
+
function Xn(e) {
|
|
1453
|
+
const t = oe(e);
|
|
1454
|
+
return _e(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : K(t) && Ne(t) ? t : Xn(t);
|
|
1455
|
+
}
|
|
1456
|
+
function Oe(e, t, n) {
|
|
1457
|
+
var r;
|
|
1458
|
+
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
1459
|
+
const i = Xn(e), o = i === ((r = e.ownerDocument) == null ? void 0 : r.body), s = W(i);
|
|
1460
|
+
if (o) {
|
|
1461
|
+
const a = _t(s);
|
|
1462
|
+
return t.concat(s, s.visualViewport || [], Ne(i) ? i : [], a && n ? Oe(a) : []);
|
|
1463
|
+
}
|
|
1464
|
+
return t.concat(i, Oe(i, [], n));
|
|
1465
|
+
}
|
|
1466
|
+
function _t(e) {
|
|
1467
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
1468
|
+
}
|
|
1469
|
+
function Kn(e) {
|
|
1470
|
+
const t = z(e);
|
|
1471
|
+
let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
|
|
1472
|
+
const i = K(e), o = i ? e.offsetWidth : n, s = i ? e.offsetHeight : r, a = Ye(n) !== o || Ye(r) !== s;
|
|
1473
|
+
return a && (n = o, r = s), {
|
|
1474
|
+
width: n,
|
|
1475
|
+
height: r,
|
|
1476
|
+
$: a
|
|
1477
|
+
};
|
|
1478
|
+
}
|
|
1479
|
+
function Ft(e) {
|
|
1480
|
+
return j(e) ? e : e.contextElement;
|
|
1481
|
+
}
|
|
1482
|
+
function ve(e) {
|
|
1483
|
+
const t = Ft(e);
|
|
1484
|
+
if (!K(t))
|
|
1485
|
+
return X(1);
|
|
1486
|
+
const n = t.getBoundingClientRect(), {
|
|
1487
|
+
width: r,
|
|
1488
|
+
height: i,
|
|
1489
|
+
$: o
|
|
1490
|
+
} = Kn(t);
|
|
1491
|
+
let s = (o ? Ye(n.width) : n.width) / r, a = (o ? Ye(n.height) : n.height) / i;
|
|
1492
|
+
return (!s || !Number.isFinite(s)) && (s = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
1493
|
+
x: s,
|
|
1494
|
+
y: a
|
|
1495
|
+
};
|
|
1496
|
+
}
|
|
1497
|
+
const Ci = /* @__PURE__ */ X(0);
|
|
1498
|
+
function qn(e) {
|
|
1499
|
+
const t = W(e);
|
|
1500
|
+
return !kt() || !t.visualViewport ? Ci : {
|
|
1501
|
+
x: t.visualViewport.offsetLeft,
|
|
1502
|
+
y: t.visualViewport.offsetTop
|
|
1503
|
+
};
|
|
1504
|
+
}
|
|
1505
|
+
function Pi(e, t, n) {
|
|
1506
|
+
return t === void 0 && (t = !1), !n || t && n !== W(e) ? !1 : t;
|
|
1507
|
+
}
|
|
1508
|
+
function ue(e, t, n, r) {
|
|
1509
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
1510
|
+
const i = e.getBoundingClientRect(), o = Ft(e);
|
|
1511
|
+
let s = X(1);
|
|
1512
|
+
t && (r ? j(r) && (s = ve(r)) : s = ve(e));
|
|
1513
|
+
const a = Pi(o, n, r) ? qn(o) : X(0);
|
|
1514
|
+
let u = (i.left + a.x) / s.x, c = (i.top + a.y) / s.y, f = i.width / s.x, l = i.height / s.y;
|
|
1515
|
+
if (o) {
|
|
1516
|
+
const h = W(o), v = r && j(r) ? W(r) : r;
|
|
1517
|
+
let g = h, d = _t(g);
|
|
1518
|
+
for (; d && r && v !== g; ) {
|
|
1519
|
+
const m = ve(d), y = d.getBoundingClientRect(), x = z(d), S = y.left + (d.clientLeft + parseFloat(x.paddingLeft)) * m.x, _ = y.top + (d.clientTop + parseFloat(x.paddingTop)) * m.y;
|
|
1520
|
+
u *= m.x, c *= m.y, f *= m.x, l *= m.y, u += S, c += _, g = W(d), d = _t(g);
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
return Ke({
|
|
1524
|
+
width: f,
|
|
1525
|
+
height: l,
|
|
1526
|
+
x: u,
|
|
1527
|
+
y: c
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1530
|
+
function tt(e, t) {
|
|
1531
|
+
const n = et(e).scrollLeft;
|
|
1532
|
+
return t ? t.left + n : ue(q(e)).left + n;
|
|
1533
|
+
}
|
|
1534
|
+
function Gn(e, t) {
|
|
1535
|
+
const n = e.getBoundingClientRect(), r = n.left + t.scrollLeft - tt(e, n), i = n.top + t.scrollTop;
|
|
1536
|
+
return {
|
|
1537
|
+
x: r,
|
|
1538
|
+
y: i
|
|
1539
|
+
};
|
|
1540
|
+
}
|
|
1541
|
+
function Ei(e) {
|
|
1542
|
+
let {
|
|
1543
|
+
elements: t,
|
|
1544
|
+
rect: n,
|
|
1545
|
+
offsetParent: r,
|
|
1546
|
+
strategy: i
|
|
1547
|
+
} = e;
|
|
1548
|
+
const o = i === "fixed", s = q(r), a = t ? Je(t.floating) : !1;
|
|
1549
|
+
if (r === s || a && o)
|
|
1550
|
+
return n;
|
|
1551
|
+
let u = {
|
|
1552
|
+
scrollLeft: 0,
|
|
1553
|
+
scrollTop: 0
|
|
1554
|
+
}, c = X(1);
|
|
1555
|
+
const f = X(0), l = K(r);
|
|
1556
|
+
if ((l || !l && !o) && ((xe(r) !== "body" || Ne(s)) && (u = et(r)), K(r))) {
|
|
1557
|
+
const v = ue(r);
|
|
1558
|
+
c = ve(r), f.x = v.x + r.clientLeft, f.y = v.y + r.clientTop;
|
|
1559
|
+
}
|
|
1560
|
+
const h = s && !l && !o ? Gn(s, u) : X(0);
|
|
1561
|
+
return {
|
|
1562
|
+
width: n.width * c.x,
|
|
1563
|
+
height: n.height * c.y,
|
|
1564
|
+
x: n.x * c.x - u.scrollLeft * c.x + f.x + h.x,
|
|
1565
|
+
y: n.y * c.y - u.scrollTop * c.y + f.y + h.y
|
|
1566
|
+
};
|
|
1567
|
+
}
|
|
1568
|
+
function Oi(e) {
|
|
1569
|
+
return Array.from(e.getClientRects());
|
|
1570
|
+
}
|
|
1571
|
+
function Ai(e) {
|
|
1572
|
+
const t = q(e), n = et(e), r = e.ownerDocument.body, i = I(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), o = I(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
|
|
1573
|
+
let s = -n.scrollLeft + tt(e);
|
|
1574
|
+
const a = -n.scrollTop;
|
|
1575
|
+
return z(r).direction === "rtl" && (s += I(t.clientWidth, r.clientWidth) - i), {
|
|
1576
|
+
width: i,
|
|
1577
|
+
height: o,
|
|
1578
|
+
x: s,
|
|
1579
|
+
y: a
|
|
1580
|
+
};
|
|
1581
|
+
}
|
|
1582
|
+
const dn = 25;
|
|
1583
|
+
function Ri(e, t) {
|
|
1584
|
+
const n = W(e), r = q(e), i = n.visualViewport;
|
|
1585
|
+
let o = r.clientWidth, s = r.clientHeight, a = 0, u = 0;
|
|
1586
|
+
if (i) {
|
|
1587
|
+
o = i.width, s = i.height;
|
|
1588
|
+
const f = kt();
|
|
1589
|
+
(!f || f && t === "fixed") && (a = i.offsetLeft, u = i.offsetTop);
|
|
1590
|
+
}
|
|
1591
|
+
const c = tt(r);
|
|
1592
|
+
if (c <= 0) {
|
|
1593
|
+
const f = r.ownerDocument, l = f.body, h = getComputedStyle(l), v = f.compatMode === "CSS1Compat" && parseFloat(h.marginLeft) + parseFloat(h.marginRight) || 0, g = Math.abs(r.clientWidth - l.clientWidth - v);
|
|
1594
|
+
g <= dn && (o -= g);
|
|
1595
|
+
} else c <= dn && (o += c);
|
|
1596
|
+
return {
|
|
1597
|
+
width: o,
|
|
1598
|
+
height: s,
|
|
1599
|
+
x: a,
|
|
1600
|
+
y: u
|
|
1601
|
+
};
|
|
1602
|
+
}
|
|
1603
|
+
const Ni = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1604
|
+
function Ti(e, t) {
|
|
1605
|
+
const n = ue(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, o = K(e) ? ve(e) : X(1), s = e.clientWidth * o.x, a = e.clientHeight * o.y, u = i * o.x, c = r * o.y;
|
|
1606
|
+
return {
|
|
1607
|
+
width: s,
|
|
1608
|
+
height: a,
|
|
1609
|
+
x: u,
|
|
1610
|
+
y: c
|
|
1611
|
+
};
|
|
1612
|
+
}
|
|
1613
|
+
function hn(e, t, n) {
|
|
1614
|
+
let r;
|
|
1615
|
+
if (t === "viewport")
|
|
1616
|
+
r = Ri(e, n);
|
|
1617
|
+
else if (t === "document")
|
|
1618
|
+
r = Ai(q(e));
|
|
1619
|
+
else if (j(t))
|
|
1620
|
+
r = Ti(t, n);
|
|
1621
|
+
else {
|
|
1622
|
+
const i = qn(e);
|
|
1623
|
+
r = {
|
|
1624
|
+
x: t.x - i.x,
|
|
1625
|
+
y: t.y - i.y,
|
|
1626
|
+
width: t.width,
|
|
1627
|
+
height: t.height
|
|
1628
|
+
};
|
|
1629
|
+
}
|
|
1630
|
+
return Ke(r);
|
|
1631
|
+
}
|
|
1632
|
+
function Zn(e, t) {
|
|
1633
|
+
const n = oe(e);
|
|
1634
|
+
return n === t || !j(n) || _e(n) ? !1 : z(n).position === "fixed" || Zn(n, t);
|
|
1635
|
+
}
|
|
1636
|
+
function Mi(e, t) {
|
|
1637
|
+
const n = t.get(e);
|
|
1638
|
+
if (n)
|
|
1639
|
+
return n;
|
|
1640
|
+
let r = Oe(e, [], !1).filter((a) => j(a) && xe(a) !== "body"), i = null;
|
|
1641
|
+
const o = z(e).position === "fixed";
|
|
1642
|
+
let s = o ? oe(e) : e;
|
|
1643
|
+
for (; j(s) && !_e(s); ) {
|
|
1644
|
+
const a = z(s), u = Mt(s);
|
|
1645
|
+
!u && a.position === "fixed" && (i = null), (o ? !u && !i : !u && a.position === "static" && !!i && Ni.has(i.position) || Ne(s) && !u && Zn(e, s)) ? r = r.filter((f) => f !== s) : i = a, s = oe(s);
|
|
1646
|
+
}
|
|
1647
|
+
return t.set(e, r), r;
|
|
1648
|
+
}
|
|
1649
|
+
function ki(e) {
|
|
1650
|
+
let {
|
|
1651
|
+
element: t,
|
|
1652
|
+
boundary: n,
|
|
1653
|
+
rootBoundary: r,
|
|
1654
|
+
strategy: i
|
|
1655
|
+
} = e;
|
|
1656
|
+
const s = [...n === "clippingAncestors" ? Je(t) ? [] : Mi(t, this._c) : [].concat(n), r], a = s[0], u = s.reduce((c, f) => {
|
|
1657
|
+
const l = hn(t, f, i);
|
|
1658
|
+
return c.top = I(l.top, c.top), c.right = re(l.right, c.right), c.bottom = re(l.bottom, c.bottom), c.left = I(l.left, c.left), c;
|
|
1659
|
+
}, hn(t, a, i));
|
|
1660
|
+
return {
|
|
1661
|
+
width: u.right - u.left,
|
|
1662
|
+
height: u.bottom - u.top,
|
|
1663
|
+
x: u.left,
|
|
1664
|
+
y: u.top
|
|
1665
|
+
};
|
|
1666
|
+
}
|
|
1667
|
+
function Fi(e) {
|
|
1668
|
+
const {
|
|
1669
|
+
width: t,
|
|
1670
|
+
height: n
|
|
1671
|
+
} = Kn(e);
|
|
1672
|
+
return {
|
|
1673
|
+
width: t,
|
|
1674
|
+
height: n
|
|
1675
|
+
};
|
|
1676
|
+
}
|
|
1677
|
+
function Di(e, t, n) {
|
|
1678
|
+
const r = K(t), i = q(t), o = n === "fixed", s = ue(e, !0, o, t);
|
|
1679
|
+
let a = {
|
|
1680
|
+
scrollLeft: 0,
|
|
1681
|
+
scrollTop: 0
|
|
1682
|
+
};
|
|
1683
|
+
const u = X(0);
|
|
1684
|
+
function c() {
|
|
1685
|
+
u.x = tt(i);
|
|
1686
|
+
}
|
|
1687
|
+
if (r || !r && !o)
|
|
1688
|
+
if ((xe(t) !== "body" || Ne(i)) && (a = et(t)), r) {
|
|
1689
|
+
const v = ue(t, !0, o, t);
|
|
1690
|
+
u.x = v.x + t.clientLeft, u.y = v.y + t.clientTop;
|
|
1691
|
+
} else i && c();
|
|
1692
|
+
o && !r && i && c();
|
|
1693
|
+
const f = i && !r && !o ? Gn(i, a) : X(0), l = s.left + a.scrollLeft - u.x - f.x, h = s.top + a.scrollTop - u.y - f.y;
|
|
1694
|
+
return {
|
|
1695
|
+
x: l,
|
|
1696
|
+
y: h,
|
|
1697
|
+
width: s.width,
|
|
1698
|
+
height: s.height
|
|
1699
|
+
};
|
|
1700
|
+
}
|
|
1701
|
+
function at(e) {
|
|
1702
|
+
return z(e).position === "static";
|
|
1703
|
+
}
|
|
1704
|
+
function vn(e, t) {
|
|
1705
|
+
if (!K(e) || z(e).position === "fixed")
|
|
1706
|
+
return null;
|
|
1707
|
+
if (t)
|
|
1708
|
+
return t(e);
|
|
1709
|
+
let n = e.offsetParent;
|
|
1710
|
+
return q(e) === n && (n = n.ownerDocument.body), n;
|
|
1711
|
+
}
|
|
1712
|
+
function Qn(e, t) {
|
|
1713
|
+
const n = W(e);
|
|
1714
|
+
if (Je(e))
|
|
1715
|
+
return n;
|
|
1716
|
+
if (!K(e)) {
|
|
1717
|
+
let i = oe(e);
|
|
1718
|
+
for (; i && !_e(i); ) {
|
|
1719
|
+
if (j(i) && !at(i))
|
|
1720
|
+
return i;
|
|
1721
|
+
i = oe(i);
|
|
1722
|
+
}
|
|
1723
|
+
return n;
|
|
1724
|
+
}
|
|
1725
|
+
let r = vn(e, t);
|
|
1726
|
+
for (; r && mi(r) && at(r); )
|
|
1727
|
+
r = vn(r, t);
|
|
1728
|
+
return r && _e(r) && at(r) && !Mt(r) ? n : r || xi(e) || n;
|
|
1729
|
+
}
|
|
1730
|
+
const Li = async function(e) {
|
|
1731
|
+
const t = this.getOffsetParent || Qn, n = this.getDimensions, r = await n(e.floating);
|
|
1732
|
+
return {
|
|
1733
|
+
reference: Di(e.reference, await t(e.floating), e.strategy),
|
|
1734
|
+
floating: {
|
|
1735
|
+
x: 0,
|
|
1736
|
+
y: 0,
|
|
1737
|
+
width: r.width,
|
|
1738
|
+
height: r.height
|
|
1739
|
+
}
|
|
1740
|
+
};
|
|
1741
|
+
};
|
|
1742
|
+
function $i(e) {
|
|
1743
|
+
return z(e).direction === "rtl";
|
|
1744
|
+
}
|
|
1745
|
+
const Ii = {
|
|
1746
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Ei,
|
|
1747
|
+
getDocumentElement: q,
|
|
1748
|
+
getClippingRect: ki,
|
|
1749
|
+
getOffsetParent: Qn,
|
|
1750
|
+
getElementRects: Li,
|
|
1751
|
+
getClientRects: Oi,
|
|
1752
|
+
getDimensions: Fi,
|
|
1753
|
+
getScale: ve,
|
|
1754
|
+
isElement: j,
|
|
1755
|
+
isRTL: $i
|
|
1756
|
+
};
|
|
1757
|
+
function Jn(e, t) {
|
|
1758
|
+
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
1759
|
+
}
|
|
1760
|
+
function Wi(e, t) {
|
|
1761
|
+
let n = null, r;
|
|
1762
|
+
const i = q(e);
|
|
1763
|
+
function o() {
|
|
1764
|
+
var a;
|
|
1765
|
+
clearTimeout(r), (a = n) == null || a.disconnect(), n = null;
|
|
1766
|
+
}
|
|
1767
|
+
function s(a, u) {
|
|
1768
|
+
a === void 0 && (a = !1), u === void 0 && (u = 1), o();
|
|
1769
|
+
const c = e.getBoundingClientRect(), {
|
|
1770
|
+
left: f,
|
|
1771
|
+
top: l,
|
|
1772
|
+
width: h,
|
|
1773
|
+
height: v
|
|
1774
|
+
} = c;
|
|
1775
|
+
if (a || t(), !h || !v)
|
|
1776
|
+
return;
|
|
1777
|
+
const g = De(l), d = De(i.clientWidth - (f + h)), m = De(i.clientHeight - (l + v)), y = De(f), S = {
|
|
1778
|
+
rootMargin: -g + "px " + -d + "px " + -m + "px " + -y + "px",
|
|
1779
|
+
threshold: I(0, re(1, u)) || 1
|
|
1780
|
+
};
|
|
1781
|
+
let _ = !0;
|
|
1782
|
+
function b(P) {
|
|
1783
|
+
const C = P[0].intersectionRatio;
|
|
1784
|
+
if (C !== u) {
|
|
1785
|
+
if (!_)
|
|
1786
|
+
return s();
|
|
1787
|
+
C ? s(!1, C) : r = setTimeout(() => {
|
|
1788
|
+
s(!1, 1e-7);
|
|
1789
|
+
}, 1e3);
|
|
1790
|
+
}
|
|
1791
|
+
C === 1 && !Jn(c, e.getBoundingClientRect()) && s(), _ = !1;
|
|
1792
|
+
}
|
|
1793
|
+
try {
|
|
1794
|
+
n = new IntersectionObserver(b, {
|
|
1795
|
+
...S,
|
|
1796
|
+
// Handle <iframe>s
|
|
1797
|
+
root: i.ownerDocument
|
|
1798
|
+
});
|
|
1799
|
+
} catch {
|
|
1800
|
+
n = new IntersectionObserver(b, S);
|
|
1801
|
+
}
|
|
1802
|
+
n.observe(e);
|
|
1803
|
+
}
|
|
1804
|
+
return s(!0), o;
|
|
1805
|
+
}
|
|
1806
|
+
function Bi(e, t, n, r) {
|
|
1807
|
+
r === void 0 && (r = {});
|
|
1808
|
+
const {
|
|
1809
|
+
ancestorScroll: i = !0,
|
|
1810
|
+
ancestorResize: o = !0,
|
|
1811
|
+
elementResize: s = typeof ResizeObserver == "function",
|
|
1812
|
+
layoutShift: a = typeof IntersectionObserver == "function",
|
|
1813
|
+
animationFrame: u = !1
|
|
1814
|
+
} = r, c = Ft(e), f = i || o ? [...c ? Oe(c) : [], ...Oe(t)] : [];
|
|
1815
|
+
f.forEach((y) => {
|
|
1816
|
+
i && y.addEventListener("scroll", n, {
|
|
1817
|
+
passive: !0
|
|
1818
|
+
}), o && y.addEventListener("resize", n);
|
|
1819
|
+
});
|
|
1820
|
+
const l = c && a ? Wi(c, n) : null;
|
|
1821
|
+
let h = -1, v = null;
|
|
1822
|
+
s && (v = new ResizeObserver((y) => {
|
|
1823
|
+
let [x] = y;
|
|
1824
|
+
x && x.target === c && v && (v.unobserve(t), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
|
|
1825
|
+
var S;
|
|
1826
|
+
(S = v) == null || S.observe(t);
|
|
1827
|
+
})), n();
|
|
1828
|
+
}), c && !u && v.observe(c), v.observe(t));
|
|
1829
|
+
let g, d = u ? ue(e) : null;
|
|
1830
|
+
u && m();
|
|
1831
|
+
function m() {
|
|
1832
|
+
const y = ue(e);
|
|
1833
|
+
d && !Jn(d, y) && n(), d = y, g = requestAnimationFrame(m);
|
|
1834
|
+
}
|
|
1835
|
+
return n(), () => {
|
|
1836
|
+
var y;
|
|
1837
|
+
f.forEach((x) => {
|
|
1838
|
+
i && x.removeEventListener("scroll", n), o && x.removeEventListener("resize", n);
|
|
1839
|
+
}), l?.(), (y = v) == null || y.disconnect(), v = null, u && cancelAnimationFrame(g);
|
|
1840
|
+
};
|
|
1841
|
+
}
|
|
1842
|
+
const ji = fi, zi = pi, Hi = ci, Vi = hi, Ui = ui, gn = ai, Yi = di, Xi = (e, t, n) => {
|
|
1843
|
+
const r = /* @__PURE__ */ new Map(), i = {
|
|
1844
|
+
platform: Ii,
|
|
1845
|
+
...n
|
|
1846
|
+
}, o = {
|
|
1847
|
+
...i.platform,
|
|
1848
|
+
_c: r
|
|
1849
|
+
};
|
|
1850
|
+
return si(e, t, {
|
|
1851
|
+
...i,
|
|
1852
|
+
platform: o
|
|
1853
|
+
});
|
|
1854
|
+
};
|
|
1855
|
+
var Ki = typeof document < "u", qi = function() {
|
|
1856
|
+
}, He = Ki ? no : qi;
|
|
1857
|
+
function qe(e, t) {
|
|
1858
|
+
if (e === t)
|
|
1859
|
+
return !0;
|
|
1860
|
+
if (typeof e != typeof t)
|
|
1861
|
+
return !1;
|
|
1862
|
+
if (typeof e == "function" && e.toString() === t.toString())
|
|
1863
|
+
return !0;
|
|
1864
|
+
let n, r, i;
|
|
1865
|
+
if (e && t && typeof e == "object") {
|
|
1866
|
+
if (Array.isArray(e)) {
|
|
1867
|
+
if (n = e.length, n !== t.length) return !1;
|
|
1868
|
+
for (r = n; r-- !== 0; )
|
|
1869
|
+
if (!qe(e[r], t[r]))
|
|
1870
|
+
return !1;
|
|
1871
|
+
return !0;
|
|
1872
|
+
}
|
|
1873
|
+
if (i = Object.keys(e), n = i.length, n !== Object.keys(t).length)
|
|
1874
|
+
return !1;
|
|
1875
|
+
for (r = n; r-- !== 0; )
|
|
1876
|
+
if (!{}.hasOwnProperty.call(t, i[r]))
|
|
1877
|
+
return !1;
|
|
1878
|
+
for (r = n; r-- !== 0; ) {
|
|
1879
|
+
const o = i[r];
|
|
1880
|
+
if (!(o === "_owner" && e.$$typeof) && !qe(e[o], t[o]))
|
|
1881
|
+
return !1;
|
|
1882
|
+
}
|
|
1883
|
+
return !0;
|
|
1884
|
+
}
|
|
1885
|
+
return e !== e && t !== t;
|
|
1886
|
+
}
|
|
1887
|
+
function er(e) {
|
|
1888
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1889
|
+
}
|
|
1890
|
+
function mn(e, t) {
|
|
1891
|
+
const n = er(e);
|
|
1892
|
+
return Math.round(t * n) / n;
|
|
1893
|
+
}
|
|
1894
|
+
function ct(e) {
|
|
1895
|
+
const t = p.useRef(e);
|
|
1896
|
+
return He(() => {
|
|
1897
|
+
t.current = e;
|
|
1898
|
+
}), t;
|
|
1899
|
+
}
|
|
1900
|
+
function Gi(e) {
|
|
1901
|
+
e === void 0 && (e = {});
|
|
1902
|
+
const {
|
|
1903
|
+
placement: t = "bottom",
|
|
1904
|
+
strategy: n = "absolute",
|
|
1905
|
+
middleware: r = [],
|
|
1906
|
+
platform: i,
|
|
1907
|
+
elements: {
|
|
1908
|
+
reference: o,
|
|
1909
|
+
floating: s
|
|
1910
|
+
} = {},
|
|
1911
|
+
transform: a = !0,
|
|
1912
|
+
whileElementsMounted: u,
|
|
1913
|
+
open: c
|
|
1914
|
+
} = e, [f, l] = p.useState({
|
|
1915
|
+
x: 0,
|
|
1916
|
+
y: 0,
|
|
1917
|
+
strategy: n,
|
|
1918
|
+
placement: t,
|
|
1919
|
+
middlewareData: {},
|
|
1920
|
+
isPositioned: !1
|
|
1921
|
+
}), [h, v] = p.useState(r);
|
|
1922
|
+
qe(h, r) || v(r);
|
|
1923
|
+
const [g, d] = p.useState(null), [m, y] = p.useState(null), x = p.useCallback((O) => {
|
|
1924
|
+
O !== P.current && (P.current = O, d(O));
|
|
1925
|
+
}, []), S = p.useCallback((O) => {
|
|
1926
|
+
O !== C.current && (C.current = O, y(O));
|
|
1927
|
+
}, []), _ = o || g, b = s || m, P = p.useRef(null), C = p.useRef(null), A = p.useRef(f), T = u != null, N = ct(u), E = ct(i), R = ct(c), M = p.useCallback(() => {
|
|
1928
|
+
if (!P.current || !C.current)
|
|
1929
|
+
return;
|
|
1930
|
+
const O = {
|
|
1931
|
+
placement: t,
|
|
1932
|
+
strategy: n,
|
|
1933
|
+
middleware: h
|
|
1934
|
+
};
|
|
1935
|
+
E.current && (O.platform = E.current), Xi(P.current, C.current, O).then((L) => {
|
|
1936
|
+
const H = {
|
|
1937
|
+
...L,
|
|
1938
|
+
// The floating element's position may be recomputed while it's closed
|
|
1939
|
+
// but still mounted (such as when transitioning out). To ensure
|
|
1940
|
+
// `isPositioned` will be `false` initially on the next open, avoid
|
|
1941
|
+
// setting it to `true` when `open === false` (must be specified).
|
|
1942
|
+
isPositioned: R.current !== !1
|
|
1943
|
+
};
|
|
1944
|
+
k.current && !qe(A.current, H) && (A.current = H, kn.flushSync(() => {
|
|
1945
|
+
l(H);
|
|
1946
|
+
}));
|
|
1947
|
+
});
|
|
1948
|
+
}, [h, t, n, E, R]);
|
|
1949
|
+
He(() => {
|
|
1950
|
+
c === !1 && A.current.isPositioned && (A.current.isPositioned = !1, l((O) => ({
|
|
1951
|
+
...O,
|
|
1952
|
+
isPositioned: !1
|
|
1953
|
+
})));
|
|
1954
|
+
}, [c]);
|
|
1955
|
+
const k = p.useRef(!1);
|
|
1956
|
+
He(() => (k.current = !0, () => {
|
|
1957
|
+
k.current = !1;
|
|
1958
|
+
}), []), He(() => {
|
|
1959
|
+
if (_ && (P.current = _), b && (C.current = b), _ && b) {
|
|
1960
|
+
if (N.current)
|
|
1961
|
+
return N.current(_, b, M);
|
|
1962
|
+
M();
|
|
1963
|
+
}
|
|
1964
|
+
}, [_, b, M, N, T]);
|
|
1965
|
+
const $ = p.useMemo(() => ({
|
|
1966
|
+
reference: P,
|
|
1967
|
+
floating: C,
|
|
1968
|
+
setReference: x,
|
|
1969
|
+
setFloating: S
|
|
1970
|
+
}), [x, S]), F = p.useMemo(() => ({
|
|
1971
|
+
reference: _,
|
|
1972
|
+
floating: b
|
|
1973
|
+
}), [_, b]), D = p.useMemo(() => {
|
|
1974
|
+
const O = {
|
|
1975
|
+
position: n,
|
|
1976
|
+
left: 0,
|
|
1977
|
+
top: 0
|
|
1978
|
+
};
|
|
1979
|
+
if (!F.floating)
|
|
1980
|
+
return O;
|
|
1981
|
+
const L = mn(F.floating, f.x), H = mn(F.floating, f.y);
|
|
1982
|
+
return a ? {
|
|
1983
|
+
...O,
|
|
1984
|
+
transform: "translate(" + L + "px, " + H + "px)",
|
|
1985
|
+
...er(F.floating) >= 1.5 && {
|
|
1986
|
+
willChange: "transform"
|
|
1987
|
+
}
|
|
1988
|
+
} : {
|
|
1989
|
+
position: n,
|
|
1990
|
+
left: L,
|
|
1991
|
+
top: H
|
|
1992
|
+
};
|
|
1993
|
+
}, [n, a, F.floating, f.x, f.y]);
|
|
1994
|
+
return p.useMemo(() => ({
|
|
1995
|
+
...f,
|
|
1996
|
+
update: M,
|
|
1997
|
+
refs: $,
|
|
1998
|
+
elements: F,
|
|
1999
|
+
floatingStyles: D
|
|
2000
|
+
}), [f, M, $, F, D]);
|
|
2001
|
+
}
|
|
2002
|
+
const Zi = (e) => {
|
|
2003
|
+
function t(n) {
|
|
2004
|
+
return {}.hasOwnProperty.call(n, "current");
|
|
2005
|
+
}
|
|
2006
|
+
return {
|
|
2007
|
+
name: "arrow",
|
|
2008
|
+
options: e,
|
|
2009
|
+
fn(n) {
|
|
2010
|
+
const {
|
|
2011
|
+
element: r,
|
|
2012
|
+
padding: i
|
|
2013
|
+
} = typeof e == "function" ? e(n) : e;
|
|
2014
|
+
return r && t(r) ? r.current != null ? gn({
|
|
2015
|
+
element: r.current,
|
|
2016
|
+
padding: i
|
|
2017
|
+
}).fn(n) : {} : r ? gn({
|
|
2018
|
+
element: r,
|
|
2019
|
+
padding: i
|
|
2020
|
+
}).fn(n) : {};
|
|
2021
|
+
}
|
|
2022
|
+
};
|
|
2023
|
+
}, Qi = (e, t) => ({
|
|
2024
|
+
...ji(e),
|
|
2025
|
+
options: [e, t]
|
|
2026
|
+
}), Ji = (e, t) => ({
|
|
2027
|
+
...zi(e),
|
|
2028
|
+
options: [e, t]
|
|
2029
|
+
}), es = (e, t) => ({
|
|
2030
|
+
...Yi(e),
|
|
2031
|
+
options: [e, t]
|
|
2032
|
+
}), ts = (e, t) => ({
|
|
2033
|
+
...Hi(e),
|
|
2034
|
+
options: [e, t]
|
|
2035
|
+
}), ns = (e, t) => ({
|
|
2036
|
+
...Vi(e),
|
|
2037
|
+
options: [e, t]
|
|
2038
|
+
}), rs = (e, t) => ({
|
|
2039
|
+
...Ui(e),
|
|
2040
|
+
options: [e, t]
|
|
2041
|
+
}), os = (e, t) => ({
|
|
2042
|
+
...Zi(e),
|
|
2043
|
+
options: [e, t]
|
|
2044
|
+
});
|
|
2045
|
+
var is = "Arrow", tr = p.forwardRef((e, t) => {
|
|
2046
|
+
const { children: n, width: r = 10, height: i = 5, ...o } = e;
|
|
2047
|
+
return /* @__PURE__ */ w(
|
|
2048
|
+
Q.svg,
|
|
2049
|
+
{
|
|
2050
|
+
...o,
|
|
2051
|
+
ref: t,
|
|
2052
|
+
width: r,
|
|
2053
|
+
height: i,
|
|
2054
|
+
viewBox: "0 0 30 10",
|
|
2055
|
+
preserveAspectRatio: "none",
|
|
2056
|
+
children: e.asChild ? n : /* @__PURE__ */ w("polygon", { points: "0,0 30,0 15,10" })
|
|
2057
|
+
}
|
|
2058
|
+
);
|
|
2059
|
+
});
|
|
2060
|
+
tr.displayName = is;
|
|
2061
|
+
var ss = tr;
|
|
2062
|
+
function as(e) {
|
|
2063
|
+
const [t, n] = p.useState(void 0);
|
|
2064
|
+
return ne(() => {
|
|
2065
|
+
if (e) {
|
|
2066
|
+
n({ width: e.offsetWidth, height: e.offsetHeight });
|
|
2067
|
+
const r = new ResizeObserver((i) => {
|
|
2068
|
+
if (!Array.isArray(i) || !i.length)
|
|
2069
|
+
return;
|
|
2070
|
+
const o = i[0];
|
|
2071
|
+
let s, a;
|
|
2072
|
+
if ("borderBoxSize" in o) {
|
|
2073
|
+
const u = o.borderBoxSize, c = Array.isArray(u) ? u[0] : u;
|
|
2074
|
+
s = c.inlineSize, a = c.blockSize;
|
|
2075
|
+
} else
|
|
2076
|
+
s = e.offsetWidth, a = e.offsetHeight;
|
|
2077
|
+
n({ width: s, height: a });
|
|
2078
|
+
});
|
|
2079
|
+
return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
|
|
2080
|
+
} else
|
|
2081
|
+
n(void 0);
|
|
2082
|
+
}, [e]), t;
|
|
2083
|
+
}
|
|
2084
|
+
var Dt = "Popper", [nr, rr] = $n(Dt), [cs, or] = nr(Dt), ir = (e) => {
|
|
2085
|
+
const { __scopePopper: t, children: n } = e, [r, i] = p.useState(null);
|
|
2086
|
+
return /* @__PURE__ */ w(cs, { scope: t, anchor: r, onAnchorChange: i, children: n });
|
|
2087
|
+
};
|
|
2088
|
+
ir.displayName = Dt;
|
|
2089
|
+
var sr = "PopperAnchor", ar = p.forwardRef(
|
|
2090
|
+
(e, t) => {
|
|
2091
|
+
const { __scopePopper: n, virtualRef: r, ...i } = e, o = or(sr, n), s = p.useRef(null), a = ie(t, s), u = p.useRef(null);
|
|
2092
|
+
return p.useEffect(() => {
|
|
2093
|
+
const c = u.current;
|
|
2094
|
+
u.current = r?.current || s.current, c !== u.current && o.onAnchorChange(u.current);
|
|
2095
|
+
}), r ? null : /* @__PURE__ */ w(Q.div, { ...i, ref: a });
|
|
2096
|
+
}
|
|
2097
|
+
);
|
|
2098
|
+
ar.displayName = sr;
|
|
2099
|
+
var Lt = "PopperContent", [us, ls] = nr(Lt), cr = p.forwardRef(
|
|
2100
|
+
(e, t) => {
|
|
2101
|
+
const {
|
|
2102
|
+
__scopePopper: n,
|
|
2103
|
+
side: r = "bottom",
|
|
2104
|
+
sideOffset: i = 0,
|
|
2105
|
+
align: o = "center",
|
|
2106
|
+
alignOffset: s = 0,
|
|
2107
|
+
arrowPadding: a = 0,
|
|
2108
|
+
avoidCollisions: u = !0,
|
|
2109
|
+
collisionBoundary: c = [],
|
|
2110
|
+
collisionPadding: f = 0,
|
|
2111
|
+
sticky: l = "partial",
|
|
2112
|
+
hideWhenDetached: h = !1,
|
|
2113
|
+
updatePositionStrategy: v = "optimized",
|
|
2114
|
+
onPlaced: g,
|
|
2115
|
+
...d
|
|
2116
|
+
} = e, m = or(Lt, n), [y, x] = p.useState(null), S = ie(t, (Se) => x(Se)), [_, b] = p.useState(null), P = as(_), C = P?.width ?? 0, A = P?.height ?? 0, T = r + (o !== "center" ? "-" + o : ""), N = typeof f == "number" ? f : { top: 0, right: 0, bottom: 0, left: 0, ...f }, E = Array.isArray(c) ? c : [c], R = E.length > 0, M = {
|
|
2117
|
+
padding: N,
|
|
2118
|
+
boundary: E.filter(ps),
|
|
2119
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
2120
|
+
altBoundary: R
|
|
2121
|
+
}, { refs: k, floatingStyles: $, placement: F, isPositioned: D, middlewareData: O } = Gi({
|
|
2122
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
2123
|
+
strategy: "fixed",
|
|
2124
|
+
placement: T,
|
|
2125
|
+
whileElementsMounted: (...Se) => Bi(...Se, {
|
|
2126
|
+
animationFrame: v === "always"
|
|
2127
|
+
}),
|
|
2128
|
+
elements: {
|
|
2129
|
+
reference: m.anchor
|
|
2130
|
+
},
|
|
2131
|
+
middleware: [
|
|
2132
|
+
Qi({ mainAxis: i + A, alignmentAxis: s }),
|
|
2133
|
+
u && Ji({
|
|
2134
|
+
mainAxis: !0,
|
|
2135
|
+
crossAxis: !1,
|
|
2136
|
+
limiter: l === "partial" ? es() : void 0,
|
|
2137
|
+
...M
|
|
2138
|
+
}),
|
|
2139
|
+
u && ts({ ...M }),
|
|
2140
|
+
ns({
|
|
2141
|
+
...M,
|
|
2142
|
+
apply: ({ elements: Se, rects: Vt, availableWidth: Zr, availableHeight: Qr }) => {
|
|
2143
|
+
const { width: Jr, height: eo } = Vt.reference, Fe = Se.floating.style;
|
|
2144
|
+
Fe.setProperty("--radix-popper-available-width", `${Zr}px`), Fe.setProperty("--radix-popper-available-height", `${Qr}px`), Fe.setProperty("--radix-popper-anchor-width", `${Jr}px`), Fe.setProperty("--radix-popper-anchor-height", `${eo}px`);
|
|
2145
|
+
}
|
|
2146
|
+
}),
|
|
2147
|
+
_ && os({ element: _, padding: a }),
|
|
2148
|
+
ds({ arrowWidth: C, arrowHeight: A }),
|
|
2149
|
+
h && rs({ strategy: "referenceHidden", ...M })
|
|
2150
|
+
]
|
|
2151
|
+
}), [L, H] = fr(F), Ht = ye(g);
|
|
2152
|
+
ne(() => {
|
|
2153
|
+
D && Ht?.();
|
|
2154
|
+
}, [D, Ht]);
|
|
2155
|
+
const Yr = O.arrow?.x, Xr = O.arrow?.y, Kr = O.arrow?.centerOffset !== 0, [qr, Gr] = p.useState();
|
|
2156
|
+
return ne(() => {
|
|
2157
|
+
y && Gr(window.getComputedStyle(y).zIndex);
|
|
2158
|
+
}, [y]), /* @__PURE__ */ w(
|
|
2159
|
+
"div",
|
|
2160
|
+
{
|
|
2161
|
+
ref: k.setFloating,
|
|
2162
|
+
"data-radix-popper-content-wrapper": "",
|
|
2163
|
+
style: {
|
|
2164
|
+
...$,
|
|
2165
|
+
transform: D ? $.transform : "translate(0, -200%)",
|
|
2166
|
+
// keep off the page when measuring
|
|
2167
|
+
minWidth: "max-content",
|
|
2168
|
+
zIndex: qr,
|
|
2169
|
+
"--radix-popper-transform-origin": [
|
|
2170
|
+
O.transformOrigin?.x,
|
|
2171
|
+
O.transformOrigin?.y
|
|
2172
|
+
].join(" "),
|
|
2173
|
+
// hide the content if using the hide middleware and should be hidden
|
|
2174
|
+
// set visibility to hidden and disable pointer events so the UI behaves
|
|
2175
|
+
// as if the PopperContent isn't there at all
|
|
2176
|
+
...O.hide?.referenceHidden && {
|
|
2177
|
+
visibility: "hidden",
|
|
2178
|
+
pointerEvents: "none"
|
|
2179
|
+
}
|
|
2180
|
+
},
|
|
2181
|
+
dir: e.dir,
|
|
2182
|
+
children: /* @__PURE__ */ w(
|
|
2183
|
+
us,
|
|
2184
|
+
{
|
|
2185
|
+
scope: n,
|
|
2186
|
+
placedSide: L,
|
|
2187
|
+
onArrowChange: b,
|
|
2188
|
+
arrowX: Yr,
|
|
2189
|
+
arrowY: Xr,
|
|
2190
|
+
shouldHideArrow: Kr,
|
|
2191
|
+
children: /* @__PURE__ */ w(
|
|
2192
|
+
Q.div,
|
|
2193
|
+
{
|
|
2194
|
+
"data-side": L,
|
|
2195
|
+
"data-align": H,
|
|
2196
|
+
...d,
|
|
2197
|
+
ref: S,
|
|
2198
|
+
style: {
|
|
2199
|
+
...d.style,
|
|
2200
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
2201
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
2202
|
+
animation: D ? void 0 : "none"
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
)
|
|
2206
|
+
}
|
|
2207
|
+
)
|
|
2208
|
+
}
|
|
2209
|
+
);
|
|
2210
|
+
}
|
|
2211
|
+
);
|
|
2212
|
+
cr.displayName = Lt;
|
|
2213
|
+
var ur = "PopperArrow", fs = {
|
|
2214
|
+
top: "bottom",
|
|
2215
|
+
right: "left",
|
|
2216
|
+
bottom: "top",
|
|
2217
|
+
left: "right"
|
|
2218
|
+
}, lr = p.forwardRef(function(t, n) {
|
|
2219
|
+
const { __scopePopper: r, ...i } = t, o = ls(ur, r), s = fs[o.placedSide];
|
|
2220
|
+
return (
|
|
2221
|
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
2222
|
+
// doesn't report size as we'd expect on SVG elements.
|
|
2223
|
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
2224
|
+
/* @__PURE__ */ w(
|
|
2225
|
+
"span",
|
|
2226
|
+
{
|
|
2227
|
+
ref: o.onArrowChange,
|
|
2228
|
+
style: {
|
|
2229
|
+
position: "absolute",
|
|
2230
|
+
left: o.arrowX,
|
|
2231
|
+
top: o.arrowY,
|
|
2232
|
+
[s]: 0,
|
|
2233
|
+
transformOrigin: {
|
|
2234
|
+
top: "",
|
|
2235
|
+
right: "0 0",
|
|
2236
|
+
bottom: "center 0",
|
|
2237
|
+
left: "100% 0"
|
|
2238
|
+
}[o.placedSide],
|
|
2239
|
+
transform: {
|
|
2240
|
+
top: "translateY(100%)",
|
|
2241
|
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
2242
|
+
bottom: "rotate(180deg)",
|
|
2243
|
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
2244
|
+
}[o.placedSide],
|
|
2245
|
+
visibility: o.shouldHideArrow ? "hidden" : void 0
|
|
2246
|
+
},
|
|
2247
|
+
children: /* @__PURE__ */ w(
|
|
2248
|
+
ss,
|
|
2249
|
+
{
|
|
2250
|
+
...i,
|
|
2251
|
+
ref: n,
|
|
2252
|
+
style: {
|
|
2253
|
+
...i.style,
|
|
2254
|
+
// ensures the element can be measured correctly (mostly for if SVG)
|
|
2255
|
+
display: "block"
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
)
|
|
2259
|
+
}
|
|
2260
|
+
)
|
|
2261
|
+
);
|
|
2262
|
+
});
|
|
2263
|
+
lr.displayName = ur;
|
|
2264
|
+
function ps(e) {
|
|
2265
|
+
return e !== null;
|
|
2266
|
+
}
|
|
2267
|
+
var ds = (e) => ({
|
|
2268
|
+
name: "transformOrigin",
|
|
2269
|
+
options: e,
|
|
2270
|
+
fn(t) {
|
|
2271
|
+
const { placement: n, rects: r, middlewareData: i } = t, s = i.arrow?.centerOffset !== 0, a = s ? 0 : e.arrowWidth, u = s ? 0 : e.arrowHeight, [c, f] = fr(n), l = { start: "0%", center: "50%", end: "100%" }[f], h = (i.arrow?.x ?? 0) + a / 2, v = (i.arrow?.y ?? 0) + u / 2;
|
|
2272
|
+
let g = "", d = "";
|
|
2273
|
+
return c === "bottom" ? (g = s ? l : `${h}px`, d = `${-u}px`) : c === "top" ? (g = s ? l : `${h}px`, d = `${r.floating.height + u}px`) : c === "right" ? (g = `${-u}px`, d = s ? l : `${v}px`) : c === "left" && (g = `${r.floating.width + u}px`, d = s ? l : `${v}px`), { data: { x: g, y: d } };
|
|
2274
|
+
}
|
|
2275
|
+
});
|
|
2276
|
+
function fr(e) {
|
|
2277
|
+
const [t, n = "center"] = e.split("-");
|
|
2278
|
+
return [t, n];
|
|
2279
|
+
}
|
|
2280
|
+
var hs = ir, pr = ar, vs = cr, gs = lr, ms = "Portal", dr = p.forwardRef((e, t) => {
|
|
2281
|
+
const { container: n, ...r } = e, [i, o] = p.useState(!1);
|
|
2282
|
+
ne(() => o(!0), []);
|
|
2283
|
+
const s = n || i && globalThis?.document?.body;
|
|
2284
|
+
return s ? ro.createPortal(/* @__PURE__ */ w(Q.div, { ...r, ref: t }), s) : null;
|
|
2285
|
+
});
|
|
2286
|
+
dr.displayName = ms;
|
|
2287
|
+
function ys(e, t) {
|
|
2288
|
+
return p.useReducer((n, r) => t[n][r] ?? n, e);
|
|
2289
|
+
}
|
|
2290
|
+
var $t = (e) => {
|
|
2291
|
+
const { present: t, children: n } = e, r = _s(t), i = typeof n == "function" ? n({ present: r.isPresent }) : p.Children.only(n), o = ie(r.ref, ws(i));
|
|
2292
|
+
return typeof n == "function" || r.isPresent ? p.cloneElement(i, { ref: o }) : null;
|
|
2293
|
+
};
|
|
2294
|
+
$t.displayName = "Presence";
|
|
2295
|
+
function _s(e) {
|
|
2296
|
+
const [t, n] = p.useState(), r = p.useRef(null), i = p.useRef(e), o = p.useRef("none"), s = e ? "mounted" : "unmounted", [a, u] = ys(s, {
|
|
2297
|
+
mounted: {
|
|
2298
|
+
UNMOUNT: "unmounted",
|
|
2299
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
2300
|
+
},
|
|
2301
|
+
unmountSuspended: {
|
|
2302
|
+
MOUNT: "mounted",
|
|
2303
|
+
ANIMATION_END: "unmounted"
|
|
2304
|
+
},
|
|
2305
|
+
unmounted: {
|
|
2306
|
+
MOUNT: "mounted"
|
|
2307
|
+
}
|
|
2308
|
+
});
|
|
2309
|
+
return p.useEffect(() => {
|
|
2310
|
+
const c = Le(r.current);
|
|
2311
|
+
o.current = a === "mounted" ? c : "none";
|
|
2312
|
+
}, [a]), ne(() => {
|
|
2313
|
+
const c = r.current, f = i.current;
|
|
2314
|
+
if (f !== e) {
|
|
2315
|
+
const h = o.current, v = Le(c);
|
|
2316
|
+
e ? u("MOUNT") : v === "none" || c?.display === "none" ? u("UNMOUNT") : u(f && h !== v ? "ANIMATION_OUT" : "UNMOUNT"), i.current = e;
|
|
2317
|
+
}
|
|
2318
|
+
}, [e, u]), ne(() => {
|
|
2319
|
+
if (t) {
|
|
2320
|
+
let c;
|
|
2321
|
+
const f = t.ownerDocument.defaultView ?? window, l = (v) => {
|
|
2322
|
+
const d = Le(r.current).includes(CSS.escape(v.animationName));
|
|
2323
|
+
if (v.target === t && d && (u("ANIMATION_END"), !i.current)) {
|
|
2324
|
+
const m = t.style.animationFillMode;
|
|
2325
|
+
t.style.animationFillMode = "forwards", c = f.setTimeout(() => {
|
|
2326
|
+
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = m);
|
|
2327
|
+
});
|
|
2328
|
+
}
|
|
2329
|
+
}, h = (v) => {
|
|
2330
|
+
v.target === t && (o.current = Le(r.current));
|
|
2331
|
+
};
|
|
2332
|
+
return t.addEventListener("animationstart", h), t.addEventListener("animationcancel", l), t.addEventListener("animationend", l), () => {
|
|
2333
|
+
f.clearTimeout(c), t.removeEventListener("animationstart", h), t.removeEventListener("animationcancel", l), t.removeEventListener("animationend", l);
|
|
2334
|
+
};
|
|
2335
|
+
} else
|
|
2336
|
+
u("ANIMATION_END");
|
|
2337
|
+
}, [t, u]), {
|
|
2338
|
+
isPresent: ["mounted", "unmountSuspended"].includes(a),
|
|
2339
|
+
ref: p.useCallback((c) => {
|
|
2340
|
+
r.current = c ? getComputedStyle(c) : null, n(c);
|
|
2341
|
+
}, [])
|
|
2342
|
+
};
|
|
2343
|
+
}
|
|
2344
|
+
function Le(e) {
|
|
2345
|
+
return e?.animationName || "none";
|
|
2346
|
+
}
|
|
2347
|
+
function ws(e) {
|
|
2348
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
2349
|
+
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);
|
|
2350
|
+
}
|
|
2351
|
+
var bs = p[" useInsertionEffect ".trim().toString()] || ne;
|
|
2352
|
+
function xs({
|
|
2353
|
+
prop: e,
|
|
2354
|
+
defaultProp: t,
|
|
2355
|
+
onChange: n = () => {
|
|
2356
|
+
},
|
|
2357
|
+
caller: r
|
|
2358
|
+
}) {
|
|
2359
|
+
const [i, o, s] = Ss({
|
|
2360
|
+
defaultProp: t,
|
|
2361
|
+
onChange: n
|
|
2362
|
+
}), a = e !== void 0, u = a ? e : i;
|
|
2363
|
+
{
|
|
2364
|
+
const f = p.useRef(e !== void 0);
|
|
2365
|
+
p.useEffect(() => {
|
|
2366
|
+
const l = f.current;
|
|
2367
|
+
l !== a && console.warn(
|
|
2368
|
+
`${r} is changing from ${l ? "controlled" : "uncontrolled"} to ${a ? "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.`
|
|
2369
|
+
), f.current = a;
|
|
2370
|
+
}, [a, r]);
|
|
2371
|
+
}
|
|
2372
|
+
const c = p.useCallback(
|
|
2373
|
+
(f) => {
|
|
2374
|
+
if (a) {
|
|
2375
|
+
const l = Cs(f) ? f(e) : f;
|
|
2376
|
+
l !== e && s.current?.(l);
|
|
2377
|
+
} else
|
|
2378
|
+
o(f);
|
|
2379
|
+
},
|
|
2380
|
+
[a, e, o, s]
|
|
2381
|
+
);
|
|
2382
|
+
return [u, c];
|
|
2383
|
+
}
|
|
2384
|
+
function Ss({
|
|
2385
|
+
defaultProp: e,
|
|
2386
|
+
onChange: t
|
|
2387
|
+
}) {
|
|
2388
|
+
const [n, r] = p.useState(e), i = p.useRef(n), o = p.useRef(t);
|
|
2389
|
+
return bs(() => {
|
|
2390
|
+
o.current = t;
|
|
2391
|
+
}, [t]), p.useEffect(() => {
|
|
2392
|
+
i.current !== n && (o.current?.(n), i.current = n);
|
|
2393
|
+
}, [n, i]), [n, r, o];
|
|
2394
|
+
}
|
|
2395
|
+
function Cs(e) {
|
|
2396
|
+
return typeof e == "function";
|
|
2397
|
+
}
|
|
2398
|
+
var Ps = function(e) {
|
|
2399
|
+
if (typeof document > "u")
|
|
2400
|
+
return null;
|
|
2401
|
+
var t = Array.isArray(e) ? e[0] : e;
|
|
2402
|
+
return t.ownerDocument.body;
|
|
2403
|
+
}, le = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), Ie = {}, ut = 0, hr = function(e) {
|
|
2404
|
+
return e && (e.host || hr(e.parentNode));
|
|
2405
|
+
}, Es = function(e, t) {
|
|
2406
|
+
return t.map(function(n) {
|
|
2407
|
+
if (e.contains(n))
|
|
2408
|
+
return n;
|
|
2409
|
+
var r = hr(n);
|
|
2410
|
+
return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
|
|
2411
|
+
}).filter(function(n) {
|
|
2412
|
+
return !!n;
|
|
2413
|
+
});
|
|
2414
|
+
}, Os = function(e, t, n, r) {
|
|
2415
|
+
var i = Es(t, Array.isArray(e) ? e : [e]);
|
|
2416
|
+
Ie[n] || (Ie[n] = /* @__PURE__ */ new WeakMap());
|
|
2417
|
+
var o = Ie[n], s = [], a = /* @__PURE__ */ new Set(), u = new Set(i), c = function(l) {
|
|
2418
|
+
!l || a.has(l) || (a.add(l), c(l.parentNode));
|
|
2419
|
+
};
|
|
2420
|
+
i.forEach(c);
|
|
2421
|
+
var f = function(l) {
|
|
2422
|
+
!l || u.has(l) || Array.prototype.forEach.call(l.children, function(h) {
|
|
2423
|
+
if (a.has(h))
|
|
2424
|
+
f(h);
|
|
2425
|
+
else
|
|
2426
|
+
try {
|
|
2427
|
+
var v = h.getAttribute(r), g = v !== null && v !== "false", d = (le.get(h) || 0) + 1, m = (o.get(h) || 0) + 1;
|
|
2428
|
+
le.set(h, d), o.set(h, m), s.push(h), d === 1 && g && $e.set(h, !0), m === 1 && h.setAttribute(n, "true"), g || h.setAttribute(r, "true");
|
|
2429
|
+
} catch (y) {
|
|
2430
|
+
console.error("aria-hidden: cannot operate on ", h, y);
|
|
2431
|
+
}
|
|
2432
|
+
});
|
|
2433
|
+
};
|
|
2434
|
+
return f(t), a.clear(), ut++, function() {
|
|
2435
|
+
s.forEach(function(l) {
|
|
2436
|
+
var h = le.get(l) - 1, v = o.get(l) - 1;
|
|
2437
|
+
le.set(l, h), o.set(l, v), h || ($e.has(l) || l.removeAttribute(r), $e.delete(l)), v || l.removeAttribute(n);
|
|
2438
|
+
}), ut--, ut || (le = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), Ie = {});
|
|
2439
|
+
};
|
|
2440
|
+
}, As = function(e, t, n) {
|
|
2441
|
+
n === void 0 && (n = "data-aria-hidden");
|
|
2442
|
+
var r = Array.from(Array.isArray(e) ? e : [e]), i = Ps(e);
|
|
2443
|
+
return i ? (r.push.apply(r, Array.from(i.querySelectorAll("[aria-live], script"))), Os(r, i, n, "aria-hidden")) : function() {
|
|
2444
|
+
return null;
|
|
2445
|
+
};
|
|
2446
|
+
}, V = function() {
|
|
2447
|
+
return V = Object.assign || function(t) {
|
|
2448
|
+
for (var n, r = 1, i = arguments.length; r < i; r++) {
|
|
2449
|
+
n = arguments[r];
|
|
2450
|
+
for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
|
|
2451
|
+
}
|
|
2452
|
+
return t;
|
|
2453
|
+
}, V.apply(this, arguments);
|
|
2454
|
+
};
|
|
2455
|
+
function vr(e, t) {
|
|
2456
|
+
var n = {};
|
|
2457
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
2458
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
2459
|
+
for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)
|
|
2460
|
+
t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
|
|
2461
|
+
return n;
|
|
2462
|
+
}
|
|
2463
|
+
function Rs(e, t, n) {
|
|
2464
|
+
if (n || arguments.length === 2) for (var r = 0, i = t.length, o; r < i; r++)
|
|
2465
|
+
(o || !(r in t)) && (o || (o = Array.prototype.slice.call(t, 0, r)), o[r] = t[r]);
|
|
2466
|
+
return e.concat(o || Array.prototype.slice.call(t));
|
|
2467
|
+
}
|
|
2468
|
+
var Ve = "right-scroll-bar-position", Ue = "width-before-scroll-bar", Ns = "with-scroll-bars-hidden", Ts = "--removed-body-scroll-bar-size";
|
|
2469
|
+
function lt(e, t) {
|
|
2470
|
+
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
2471
|
+
}
|
|
2472
|
+
function Ms(e, t) {
|
|
2473
|
+
var n = ce(function() {
|
|
2474
|
+
return {
|
|
2475
|
+
// value
|
|
2476
|
+
value: e,
|
|
2477
|
+
// last callback
|
|
2478
|
+
callback: t,
|
|
2479
|
+
// "memoized" public interface
|
|
2480
|
+
facade: {
|
|
2481
|
+
get current() {
|
|
2482
|
+
return n.value;
|
|
2483
|
+
},
|
|
2484
|
+
set current(r) {
|
|
2485
|
+
var i = n.value;
|
|
2486
|
+
i !== r && (n.value = r, n.callback(r, i));
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
};
|
|
2490
|
+
})[0];
|
|
2491
|
+
return n.callback = t, n.facade;
|
|
2492
|
+
}
|
|
2493
|
+
var ks = typeof window < "u" ? p.useLayoutEffect : p.useEffect, yn = /* @__PURE__ */ new WeakMap();
|
|
2494
|
+
function Fs(e, t) {
|
|
2495
|
+
var n = Ms(null, function(r) {
|
|
2496
|
+
return e.forEach(function(i) {
|
|
2497
|
+
return lt(i, r);
|
|
2498
|
+
});
|
|
2499
|
+
});
|
|
2500
|
+
return ks(function() {
|
|
2501
|
+
var r = yn.get(n);
|
|
2502
|
+
if (r) {
|
|
2503
|
+
var i = new Set(r), o = new Set(e), s = n.current;
|
|
2504
|
+
i.forEach(function(a) {
|
|
2505
|
+
o.has(a) || lt(a, null);
|
|
2506
|
+
}), o.forEach(function(a) {
|
|
2507
|
+
i.has(a) || lt(a, s);
|
|
2508
|
+
});
|
|
2509
|
+
}
|
|
2510
|
+
yn.set(n, e);
|
|
2511
|
+
}, [e]), n;
|
|
2512
|
+
}
|
|
2513
|
+
function Ds(e) {
|
|
2514
|
+
return e;
|
|
2515
|
+
}
|
|
2516
|
+
function Ls(e, t) {
|
|
2517
|
+
t === void 0 && (t = Ds);
|
|
2518
|
+
var n = [], r = !1, i = {
|
|
2519
|
+
read: function() {
|
|
2520
|
+
if (r)
|
|
2521
|
+
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
2522
|
+
return n.length ? n[n.length - 1] : e;
|
|
2523
|
+
},
|
|
2524
|
+
useMedium: function(o) {
|
|
2525
|
+
var s = t(o, r);
|
|
2526
|
+
return n.push(s), function() {
|
|
2527
|
+
n = n.filter(function(a) {
|
|
2528
|
+
return a !== s;
|
|
2529
|
+
});
|
|
2530
|
+
};
|
|
2531
|
+
},
|
|
2532
|
+
assignSyncMedium: function(o) {
|
|
2533
|
+
for (r = !0; n.length; ) {
|
|
2534
|
+
var s = n;
|
|
2535
|
+
n = [], s.forEach(o);
|
|
2536
|
+
}
|
|
2537
|
+
n = {
|
|
2538
|
+
push: function(a) {
|
|
2539
|
+
return o(a);
|
|
2540
|
+
},
|
|
2541
|
+
filter: function() {
|
|
2542
|
+
return n;
|
|
2543
|
+
}
|
|
2544
|
+
};
|
|
2545
|
+
},
|
|
2546
|
+
assignMedium: function(o) {
|
|
2547
|
+
r = !0;
|
|
2548
|
+
var s = [];
|
|
2549
|
+
if (n.length) {
|
|
2550
|
+
var a = n;
|
|
2551
|
+
n = [], a.forEach(o), s = n;
|
|
2552
|
+
}
|
|
2553
|
+
var u = function() {
|
|
2554
|
+
var f = s;
|
|
2555
|
+
s = [], f.forEach(o);
|
|
2556
|
+
}, c = function() {
|
|
2557
|
+
return Promise.resolve().then(u);
|
|
2558
|
+
};
|
|
2559
|
+
c(), n = {
|
|
2560
|
+
push: function(f) {
|
|
2561
|
+
s.push(f), c();
|
|
2562
|
+
},
|
|
2563
|
+
filter: function(f) {
|
|
2564
|
+
return s = s.filter(f), n;
|
|
2565
|
+
}
|
|
2566
|
+
};
|
|
2567
|
+
}
|
|
2568
|
+
};
|
|
2569
|
+
return i;
|
|
2570
|
+
}
|
|
2571
|
+
function $s(e) {
|
|
2572
|
+
e === void 0 && (e = {});
|
|
2573
|
+
var t = Ls(null);
|
|
2574
|
+
return t.options = V({ async: !0, ssr: !1 }, e), t;
|
|
2575
|
+
}
|
|
2576
|
+
var gr = function(e) {
|
|
2577
|
+
var t = e.sideCar, n = vr(e, ["sideCar"]);
|
|
2578
|
+
if (!t)
|
|
2579
|
+
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
2580
|
+
var r = t.read();
|
|
2581
|
+
if (!r)
|
|
2582
|
+
throw new Error("Sidecar medium not found");
|
|
2583
|
+
return p.createElement(r, V({}, n));
|
|
2584
|
+
};
|
|
2585
|
+
gr.isSideCarExport = !0;
|
|
2586
|
+
function Is(e, t) {
|
|
2587
|
+
return e.useMedium(t), gr;
|
|
2588
|
+
}
|
|
2589
|
+
var mr = $s(), ft = function() {
|
|
2590
|
+
}, nt = p.forwardRef(function(e, t) {
|
|
2591
|
+
var n = p.useRef(null), r = p.useState({
|
|
2592
|
+
onScrollCapture: ft,
|
|
2593
|
+
onWheelCapture: ft,
|
|
2594
|
+
onTouchMoveCapture: ft
|
|
2595
|
+
}), i = r[0], o = r[1], s = e.forwardProps, a = e.children, u = e.className, c = e.removeScrollBar, f = e.enabled, l = e.shards, h = e.sideCar, v = e.noRelative, g = e.noIsolation, d = e.inert, m = e.allowPinchZoom, y = e.as, x = y === void 0 ? "div" : y, S = e.gapMode, _ = vr(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), b = h, P = Fs([n, t]), C = V(V({}, _), i);
|
|
2596
|
+
return p.createElement(
|
|
2597
|
+
p.Fragment,
|
|
2598
|
+
null,
|
|
2599
|
+
f && p.createElement(b, { sideCar: mr, removeScrollBar: c, shards: l, noRelative: v, noIsolation: g, inert: d, setCallbacks: o, allowPinchZoom: !!m, lockRef: n, gapMode: S }),
|
|
2600
|
+
s ? p.cloneElement(p.Children.only(a), V(V({}, C), { ref: P })) : p.createElement(x, V({}, C, { className: u, ref: P }), a)
|
|
2601
|
+
);
|
|
2602
|
+
});
|
|
2603
|
+
nt.defaultProps = {
|
|
2604
|
+
enabled: !0,
|
|
2605
|
+
removeScrollBar: !0,
|
|
2606
|
+
inert: !1
|
|
2607
|
+
};
|
|
2608
|
+
nt.classNames = {
|
|
2609
|
+
fullWidth: Ue,
|
|
2610
|
+
zeroRight: Ve
|
|
2611
|
+
};
|
|
2612
|
+
var Ws = function() {
|
|
2613
|
+
if (typeof __webpack_nonce__ < "u")
|
|
2614
|
+
return __webpack_nonce__;
|
|
2615
|
+
};
|
|
2616
|
+
function Bs() {
|
|
2617
|
+
if (!document)
|
|
2618
|
+
return null;
|
|
2619
|
+
var e = document.createElement("style");
|
|
2620
|
+
e.type = "text/css";
|
|
2621
|
+
var t = Ws();
|
|
2622
|
+
return t && e.setAttribute("nonce", t), e;
|
|
2623
|
+
}
|
|
2624
|
+
function js(e, t) {
|
|
2625
|
+
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
|
|
2626
|
+
}
|
|
2627
|
+
function zs(e) {
|
|
2628
|
+
var t = document.head || document.getElementsByTagName("head")[0];
|
|
2629
|
+
t.appendChild(e);
|
|
2630
|
+
}
|
|
2631
|
+
var Hs = function() {
|
|
2632
|
+
var e = 0, t = null;
|
|
2633
|
+
return {
|
|
2634
|
+
add: function(n) {
|
|
2635
|
+
e == 0 && (t = Bs()) && (js(t, n), zs(t)), e++;
|
|
2636
|
+
},
|
|
2637
|
+
remove: function() {
|
|
2638
|
+
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
|
|
2639
|
+
}
|
|
2640
|
+
};
|
|
2641
|
+
}, Vs = function() {
|
|
2642
|
+
var e = Hs();
|
|
2643
|
+
return function(t, n) {
|
|
2644
|
+
p.useEffect(function() {
|
|
2645
|
+
return e.add(t), function() {
|
|
2646
|
+
e.remove();
|
|
2647
|
+
};
|
|
2648
|
+
}, [t && n]);
|
|
2649
|
+
};
|
|
2650
|
+
}, yr = function() {
|
|
2651
|
+
var e = Vs(), t = function(n) {
|
|
2652
|
+
var r = n.styles, i = n.dynamic;
|
|
2653
|
+
return e(r, i), null;
|
|
2654
|
+
};
|
|
2655
|
+
return t;
|
|
2656
|
+
}, Us = {
|
|
2657
|
+
left: 0,
|
|
2658
|
+
top: 0,
|
|
2659
|
+
right: 0,
|
|
2660
|
+
gap: 0
|
|
2661
|
+
}, pt = function(e) {
|
|
2662
|
+
return parseInt(e || "", 10) || 0;
|
|
2663
|
+
}, Ys = function(e) {
|
|
2664
|
+
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], i = t[e === "padding" ? "paddingRight" : "marginRight"];
|
|
2665
|
+
return [pt(n), pt(r), pt(i)];
|
|
2666
|
+
}, Xs = function(e) {
|
|
2667
|
+
if (e === void 0 && (e = "margin"), typeof window > "u")
|
|
2668
|
+
return Us;
|
|
2669
|
+
var t = Ys(e), n = document.documentElement.clientWidth, r = window.innerWidth;
|
|
2670
|
+
return {
|
|
2671
|
+
left: t[0],
|
|
2672
|
+
top: t[1],
|
|
2673
|
+
right: t[2],
|
|
2674
|
+
gap: Math.max(0, r - n + t[2] - t[0])
|
|
2675
|
+
};
|
|
2676
|
+
}, Ks = yr(), ge = "data-scroll-locked", qs = function(e, t, n, r) {
|
|
2677
|
+
var i = e.left, o = e.top, s = e.right, a = e.gap;
|
|
2678
|
+
return n === void 0 && (n = "margin"), `
|
|
2679
|
+
.`.concat(Ns, ` {
|
|
2680
|
+
overflow: hidden `).concat(r, `;
|
|
2681
|
+
padding-right: `).concat(a, "px ").concat(r, `;
|
|
2682
|
+
}
|
|
2683
|
+
body[`).concat(ge, `] {
|
|
2684
|
+
overflow: hidden `).concat(r, `;
|
|
2685
|
+
overscroll-behavior: contain;
|
|
2686
|
+
`).concat([
|
|
2687
|
+
t && "position: relative ".concat(r, ";"),
|
|
2688
|
+
n === "margin" && `
|
|
2689
|
+
padding-left: `.concat(i, `px;
|
|
2690
|
+
padding-top: `).concat(o, `px;
|
|
2691
|
+
padding-right: `).concat(s, `px;
|
|
2692
|
+
margin-left:0;
|
|
2693
|
+
margin-top:0;
|
|
2694
|
+
margin-right: `).concat(a, "px ").concat(r, `;
|
|
2695
|
+
`),
|
|
2696
|
+
n === "padding" && "padding-right: ".concat(a, "px ").concat(r, ";")
|
|
2697
|
+
].filter(Boolean).join(""), `
|
|
2698
|
+
}
|
|
2699
|
+
|
|
2700
|
+
.`).concat(Ve, ` {
|
|
2701
|
+
right: `).concat(a, "px ").concat(r, `;
|
|
2702
|
+
}
|
|
2703
|
+
|
|
2704
|
+
.`).concat(Ue, ` {
|
|
2705
|
+
margin-right: `).concat(a, "px ").concat(r, `;
|
|
2706
|
+
}
|
|
2707
|
+
|
|
2708
|
+
.`).concat(Ve, " .").concat(Ve, ` {
|
|
2709
|
+
right: 0 `).concat(r, `;
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
.`).concat(Ue, " .").concat(Ue, ` {
|
|
2713
|
+
margin-right: 0 `).concat(r, `;
|
|
2714
|
+
}
|
|
2715
|
+
|
|
2716
|
+
body[`).concat(ge, `] {
|
|
2717
|
+
`).concat(Ts, ": ").concat(a, `px;
|
|
2718
|
+
}
|
|
2719
|
+
`);
|
|
2720
|
+
}, _n = function() {
|
|
2721
|
+
var e = parseInt(document.body.getAttribute(ge) || "0", 10);
|
|
2722
|
+
return isFinite(e) ? e : 0;
|
|
2723
|
+
}, Gs = function() {
|
|
2724
|
+
p.useEffect(function() {
|
|
2725
|
+
return document.body.setAttribute(ge, (_n() + 1).toString()), function() {
|
|
2726
|
+
var e = _n() - 1;
|
|
2727
|
+
e <= 0 ? document.body.removeAttribute(ge) : document.body.setAttribute(ge, e.toString());
|
|
2728
|
+
};
|
|
2729
|
+
}, []);
|
|
2730
|
+
}, Zs = function(e) {
|
|
2731
|
+
var t = e.noRelative, n = e.noImportant, r = e.gapMode, i = r === void 0 ? "margin" : r;
|
|
2732
|
+
Gs();
|
|
2733
|
+
var o = p.useMemo(function() {
|
|
2734
|
+
return Xs(i);
|
|
2735
|
+
}, [i]);
|
|
2736
|
+
return p.createElement(Ks, { styles: qs(o, !t, i, n ? "" : "!important") });
|
|
2737
|
+
}, wt = !1;
|
|
2738
|
+
if (typeof window < "u")
|
|
2739
|
+
try {
|
|
2740
|
+
var We = Object.defineProperty({}, "passive", {
|
|
2741
|
+
get: function() {
|
|
2742
|
+
return wt = !0, !0;
|
|
2743
|
+
}
|
|
2744
|
+
});
|
|
2745
|
+
window.addEventListener("test", We, We), window.removeEventListener("test", We, We);
|
|
2746
|
+
} catch {
|
|
2747
|
+
wt = !1;
|
|
2748
|
+
}
|
|
2749
|
+
var fe = wt ? { passive: !1 } : !1, Qs = function(e) {
|
|
2750
|
+
return e.tagName === "TEXTAREA";
|
|
2751
|
+
}, _r = function(e, t) {
|
|
2752
|
+
if (!(e instanceof Element))
|
|
2753
|
+
return !1;
|
|
2754
|
+
var n = window.getComputedStyle(e);
|
|
2755
|
+
return (
|
|
2756
|
+
// not-not-scrollable
|
|
2757
|
+
n[t] !== "hidden" && // contains scroll inside self
|
|
2758
|
+
!(n.overflowY === n.overflowX && !Qs(e) && n[t] === "visible")
|
|
2759
|
+
);
|
|
2760
|
+
}, Js = function(e) {
|
|
2761
|
+
return _r(e, "overflowY");
|
|
2762
|
+
}, ea = function(e) {
|
|
2763
|
+
return _r(e, "overflowX");
|
|
2764
|
+
}, wn = function(e, t) {
|
|
2765
|
+
var n = t.ownerDocument, r = t;
|
|
2766
|
+
do {
|
|
2767
|
+
typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
|
|
2768
|
+
var i = wr(e, r);
|
|
2769
|
+
if (i) {
|
|
2770
|
+
var o = br(e, r), s = o[1], a = o[2];
|
|
2771
|
+
if (s > a)
|
|
2772
|
+
return !0;
|
|
2773
|
+
}
|
|
2774
|
+
r = r.parentNode;
|
|
2775
|
+
} while (r && r !== n.body);
|
|
2776
|
+
return !1;
|
|
2777
|
+
}, ta = function(e) {
|
|
2778
|
+
var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
|
|
2779
|
+
return [
|
|
2780
|
+
t,
|
|
2781
|
+
n,
|
|
2782
|
+
r
|
|
2783
|
+
];
|
|
2784
|
+
}, na = function(e) {
|
|
2785
|
+
var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
|
|
2786
|
+
return [
|
|
2787
|
+
t,
|
|
2788
|
+
n,
|
|
2789
|
+
r
|
|
2790
|
+
];
|
|
2791
|
+
}, wr = function(e, t) {
|
|
2792
|
+
return e === "v" ? Js(t) : ea(t);
|
|
2793
|
+
}, br = function(e, t) {
|
|
2794
|
+
return e === "v" ? ta(t) : na(t);
|
|
2795
|
+
}, ra = function(e, t) {
|
|
2796
|
+
return e === "h" && t === "rtl" ? -1 : 1;
|
|
2797
|
+
}, oa = function(e, t, n, r, i) {
|
|
2798
|
+
var o = ra(e, window.getComputedStyle(t).direction), s = o * r, a = n.target, u = t.contains(a), c = !1, f = s > 0, l = 0, h = 0;
|
|
2799
|
+
do {
|
|
2800
|
+
if (!a)
|
|
2801
|
+
break;
|
|
2802
|
+
var v = br(e, a), g = v[0], d = v[1], m = v[2], y = d - m - o * g;
|
|
2803
|
+
(g || y) && wr(e, a) && (l += y, h += g);
|
|
2804
|
+
var x = a.parentNode;
|
|
2805
|
+
a = x && x.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? x.host : x;
|
|
2806
|
+
} while (
|
|
2807
|
+
// portaled content
|
|
2808
|
+
!u && a !== document.body || // self content
|
|
2809
|
+
u && (t.contains(a) || t === a)
|
|
2810
|
+
);
|
|
2811
|
+
return (f && Math.abs(l) < 1 || !f && Math.abs(h) < 1) && (c = !0), c;
|
|
2812
|
+
}, Be = function(e) {
|
|
2813
|
+
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
2814
|
+
}, bn = function(e) {
|
|
2815
|
+
return [e.deltaX, e.deltaY];
|
|
2816
|
+
}, xn = function(e) {
|
|
2817
|
+
return e && "current" in e ? e.current : e;
|
|
2818
|
+
}, ia = function(e, t) {
|
|
2819
|
+
return e[0] === t[0] && e[1] === t[1];
|
|
2820
|
+
}, sa = function(e) {
|
|
2821
|
+
return `
|
|
2822
|
+
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
2823
|
+
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
2824
|
+
`);
|
|
2825
|
+
}, aa = 0, pe = [];
|
|
2826
|
+
function ca(e) {
|
|
2827
|
+
var t = p.useRef([]), n = p.useRef([0, 0]), r = p.useRef(), i = p.useState(aa++)[0], o = p.useState(yr)[0], s = p.useRef(e);
|
|
2828
|
+
p.useEffect(function() {
|
|
2829
|
+
s.current = e;
|
|
2830
|
+
}, [e]), p.useEffect(function() {
|
|
2831
|
+
if (e.inert) {
|
|
2832
|
+
document.body.classList.add("block-interactivity-".concat(i));
|
|
2833
|
+
var d = Rs([e.lockRef.current], (e.shards || []).map(xn), !0).filter(Boolean);
|
|
2834
|
+
return d.forEach(function(m) {
|
|
2835
|
+
return m.classList.add("allow-interactivity-".concat(i));
|
|
2836
|
+
}), function() {
|
|
2837
|
+
document.body.classList.remove("block-interactivity-".concat(i)), d.forEach(function(m) {
|
|
2838
|
+
return m.classList.remove("allow-interactivity-".concat(i));
|
|
2839
|
+
});
|
|
2840
|
+
};
|
|
2841
|
+
}
|
|
2842
|
+
}, [e.inert, e.lockRef.current, e.shards]);
|
|
2843
|
+
var a = p.useCallback(function(d, m) {
|
|
2844
|
+
if ("touches" in d && d.touches.length === 2 || d.type === "wheel" && d.ctrlKey)
|
|
2845
|
+
return !s.current.allowPinchZoom;
|
|
2846
|
+
var y = Be(d), x = n.current, S = "deltaX" in d ? d.deltaX : x[0] - y[0], _ = "deltaY" in d ? d.deltaY : x[1] - y[1], b, P = d.target, C = Math.abs(S) > Math.abs(_) ? "h" : "v";
|
|
2847
|
+
if ("touches" in d && C === "h" && P.type === "range")
|
|
2848
|
+
return !1;
|
|
2849
|
+
var A = wn(C, P);
|
|
2850
|
+
if (!A)
|
|
2851
|
+
return !0;
|
|
2852
|
+
if (A ? b = C : (b = C === "v" ? "h" : "v", A = wn(C, P)), !A)
|
|
2853
|
+
return !1;
|
|
2854
|
+
if (!r.current && "changedTouches" in d && (S || _) && (r.current = b), !b)
|
|
2855
|
+
return !0;
|
|
2856
|
+
var T = r.current || b;
|
|
2857
|
+
return oa(T, m, d, T === "h" ? S : _);
|
|
2858
|
+
}, []), u = p.useCallback(function(d) {
|
|
2859
|
+
var m = d;
|
|
2860
|
+
if (!(!pe.length || pe[pe.length - 1] !== o)) {
|
|
2861
|
+
var y = "deltaY" in m ? bn(m) : Be(m), x = t.current.filter(function(b) {
|
|
2862
|
+
return b.name === m.type && (b.target === m.target || m.target === b.shadowParent) && ia(b.delta, y);
|
|
2863
|
+
})[0];
|
|
2864
|
+
if (x && x.should) {
|
|
2865
|
+
m.cancelable && m.preventDefault();
|
|
2866
|
+
return;
|
|
2867
|
+
}
|
|
2868
|
+
if (!x) {
|
|
2869
|
+
var S = (s.current.shards || []).map(xn).filter(Boolean).filter(function(b) {
|
|
2870
|
+
return b.contains(m.target);
|
|
2871
|
+
}), _ = S.length > 0 ? a(m, S[0]) : !s.current.noIsolation;
|
|
2872
|
+
_ && m.cancelable && m.preventDefault();
|
|
2873
|
+
}
|
|
2874
|
+
}
|
|
2875
|
+
}, []), c = p.useCallback(function(d, m, y, x) {
|
|
2876
|
+
var S = { name: d, delta: m, target: y, should: x, shadowParent: ua(y) };
|
|
2877
|
+
t.current.push(S), setTimeout(function() {
|
|
2878
|
+
t.current = t.current.filter(function(_) {
|
|
2879
|
+
return _ !== S;
|
|
2880
|
+
});
|
|
2881
|
+
}, 1);
|
|
2882
|
+
}, []), f = p.useCallback(function(d) {
|
|
2883
|
+
n.current = Be(d), r.current = void 0;
|
|
2884
|
+
}, []), l = p.useCallback(function(d) {
|
|
2885
|
+
c(d.type, bn(d), d.target, a(d, e.lockRef.current));
|
|
2886
|
+
}, []), h = p.useCallback(function(d) {
|
|
2887
|
+
c(d.type, Be(d), d.target, a(d, e.lockRef.current));
|
|
2888
|
+
}, []);
|
|
2889
|
+
p.useEffect(function() {
|
|
2890
|
+
return pe.push(o), e.setCallbacks({
|
|
2891
|
+
onScrollCapture: l,
|
|
2892
|
+
onWheelCapture: l,
|
|
2893
|
+
onTouchMoveCapture: h
|
|
2894
|
+
}), document.addEventListener("wheel", u, fe), document.addEventListener("touchmove", u, fe), document.addEventListener("touchstart", f, fe), function() {
|
|
2895
|
+
pe = pe.filter(function(d) {
|
|
2896
|
+
return d !== o;
|
|
2897
|
+
}), document.removeEventListener("wheel", u, fe), document.removeEventListener("touchmove", u, fe), document.removeEventListener("touchstart", f, fe);
|
|
2898
|
+
};
|
|
2899
|
+
}, []);
|
|
2900
|
+
var v = e.removeScrollBar, g = e.inert;
|
|
2901
|
+
return p.createElement(
|
|
2902
|
+
p.Fragment,
|
|
2903
|
+
null,
|
|
2904
|
+
g ? p.createElement(o, { styles: sa(i) }) : null,
|
|
2905
|
+
v ? p.createElement(Zs, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
|
|
2906
|
+
);
|
|
2907
|
+
}
|
|
2908
|
+
function ua(e) {
|
|
2909
|
+
for (var t = null; e !== null; )
|
|
2910
|
+
e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
2911
|
+
return t;
|
|
2912
|
+
}
|
|
2913
|
+
const la = Is(mr, ca);
|
|
2914
|
+
var xr = p.forwardRef(function(e, t) {
|
|
2915
|
+
return p.createElement(nt, V({}, e, { ref: t, sideCar: la }));
|
|
2916
|
+
});
|
|
2917
|
+
xr.classNames = nt.classNames;
|
|
2918
|
+
var rt = "Popover", [Sr] = $n(rt, [
|
|
2919
|
+
rr
|
|
2920
|
+
]), Te = rr(), [fa, se] = Sr(rt), Cr = (e) => {
|
|
2921
|
+
const {
|
|
2922
|
+
__scopePopover: t,
|
|
2923
|
+
children: n,
|
|
2924
|
+
open: r,
|
|
2925
|
+
defaultOpen: i,
|
|
2926
|
+
onOpenChange: o,
|
|
2927
|
+
modal: s = !1
|
|
2928
|
+
} = e, a = Te(t), u = p.useRef(null), [c, f] = p.useState(!1), [l, h] = xs({
|
|
2929
|
+
prop: r,
|
|
2930
|
+
defaultProp: i ?? !1,
|
|
2931
|
+
onChange: o,
|
|
2932
|
+
caller: rt
|
|
2933
|
+
});
|
|
2934
|
+
return /* @__PURE__ */ w(hs, { ...a, children: /* @__PURE__ */ w(
|
|
2935
|
+
fa,
|
|
2936
|
+
{
|
|
2937
|
+
scope: t,
|
|
2938
|
+
contentId: Ko(),
|
|
2939
|
+
triggerRef: u,
|
|
2940
|
+
open: l,
|
|
2941
|
+
onOpenChange: h,
|
|
2942
|
+
onOpenToggle: p.useCallback(() => h((v) => !v), [h]),
|
|
2943
|
+
hasCustomAnchor: c,
|
|
2944
|
+
onCustomAnchorAdd: p.useCallback(() => f(!0), []),
|
|
2945
|
+
onCustomAnchorRemove: p.useCallback(() => f(!1), []),
|
|
2946
|
+
modal: s,
|
|
2947
|
+
children: n
|
|
2948
|
+
}
|
|
2949
|
+
) });
|
|
2950
|
+
};
|
|
2951
|
+
Cr.displayName = rt;
|
|
2952
|
+
var Pr = "PopoverAnchor", pa = p.forwardRef(
|
|
2953
|
+
(e, t) => {
|
|
2954
|
+
const { __scopePopover: n, ...r } = e, i = se(Pr, n), o = Te(n), { onCustomAnchorAdd: s, onCustomAnchorRemove: a } = i;
|
|
2955
|
+
return p.useEffect(() => (s(), () => a()), [s, a]), /* @__PURE__ */ w(pr, { ...o, ...r, ref: t });
|
|
2956
|
+
}
|
|
2957
|
+
);
|
|
2958
|
+
pa.displayName = Pr;
|
|
2959
|
+
var Er = "PopoverTrigger", Or = p.forwardRef(
|
|
2960
|
+
(e, t) => {
|
|
2961
|
+
const { __scopePopover: n, ...r } = e, i = se(Er, n), o = Te(n), s = ie(t, i.triggerRef), a = /* @__PURE__ */ w(
|
|
2962
|
+
Q.button,
|
|
2963
|
+
{
|
|
2964
|
+
type: "button",
|
|
2965
|
+
"aria-haspopup": "dialog",
|
|
2966
|
+
"aria-expanded": i.open,
|
|
2967
|
+
"aria-controls": i.contentId,
|
|
2968
|
+
"data-state": Fr(i.open),
|
|
2969
|
+
...r,
|
|
2970
|
+
ref: s,
|
|
2971
|
+
onClick: te(e.onClick, i.onOpenToggle)
|
|
2972
|
+
}
|
|
2973
|
+
);
|
|
2974
|
+
return i.hasCustomAnchor ? a : /* @__PURE__ */ w(pr, { asChild: !0, ...o, children: a });
|
|
2975
|
+
}
|
|
2976
|
+
);
|
|
2977
|
+
Or.displayName = Er;
|
|
2978
|
+
var It = "PopoverPortal", [da, ha] = Sr(It, {
|
|
2979
|
+
forceMount: void 0
|
|
2980
|
+
}), Ar = (e) => {
|
|
2981
|
+
const { __scopePopover: t, forceMount: n, children: r, container: i } = e, o = se(It, t);
|
|
2982
|
+
return /* @__PURE__ */ w(da, { scope: t, forceMount: n, children: /* @__PURE__ */ w($t, { present: n || o.open, children: /* @__PURE__ */ w(dr, { asChild: !0, container: i, children: r }) }) });
|
|
2983
|
+
};
|
|
2984
|
+
Ar.displayName = It;
|
|
2985
|
+
var we = "PopoverContent", Rr = p.forwardRef(
|
|
2986
|
+
(e, t) => {
|
|
2987
|
+
const n = ha(we, e.__scopePopover), { forceMount: r = n.forceMount, ...i } = e, o = se(we, e.__scopePopover);
|
|
2988
|
+
return /* @__PURE__ */ w($t, { present: r || o.open, children: o.modal ? /* @__PURE__ */ w(ga, { ...i, ref: t }) : /* @__PURE__ */ w(ma, { ...i, ref: t }) });
|
|
2989
|
+
}
|
|
2990
|
+
);
|
|
2991
|
+
Rr.displayName = we;
|
|
2992
|
+
var va = /* @__PURE__ */ In("PopoverContent.RemoveScroll"), ga = p.forwardRef(
|
|
2993
|
+
(e, t) => {
|
|
2994
|
+
const n = se(we, e.__scopePopover), r = p.useRef(null), i = ie(t, r), o = p.useRef(!1);
|
|
2995
|
+
return p.useEffect(() => {
|
|
2996
|
+
const s = r.current;
|
|
2997
|
+
if (s) return As(s);
|
|
2998
|
+
}, []), /* @__PURE__ */ w(xr, { as: va, allowPinchZoom: !0, children: /* @__PURE__ */ w(
|
|
2999
|
+
Nr,
|
|
3000
|
+
{
|
|
3001
|
+
...e,
|
|
3002
|
+
ref: i,
|
|
3003
|
+
trapFocus: n.open,
|
|
3004
|
+
disableOutsidePointerEvents: !0,
|
|
3005
|
+
onCloseAutoFocus: te(e.onCloseAutoFocus, (s) => {
|
|
3006
|
+
s.preventDefault(), o.current || n.triggerRef.current?.focus();
|
|
3007
|
+
}),
|
|
3008
|
+
onPointerDownOutside: te(
|
|
3009
|
+
e.onPointerDownOutside,
|
|
3010
|
+
(s) => {
|
|
3011
|
+
const a = s.detail.originalEvent, u = a.button === 0 && a.ctrlKey === !0, c = a.button === 2 || u;
|
|
3012
|
+
o.current = c;
|
|
3013
|
+
},
|
|
3014
|
+
{ checkForDefaultPrevented: !1 }
|
|
3015
|
+
),
|
|
3016
|
+
onFocusOutside: te(
|
|
3017
|
+
e.onFocusOutside,
|
|
3018
|
+
(s) => s.preventDefault(),
|
|
3019
|
+
{ checkForDefaultPrevented: !1 }
|
|
3020
|
+
)
|
|
3021
|
+
}
|
|
3022
|
+
) });
|
|
3023
|
+
}
|
|
3024
|
+
), ma = p.forwardRef(
|
|
3025
|
+
(e, t) => {
|
|
3026
|
+
const n = se(we, e.__scopePopover), r = p.useRef(!1), i = p.useRef(!1);
|
|
3027
|
+
return /* @__PURE__ */ w(
|
|
3028
|
+
Nr,
|
|
3029
|
+
{
|
|
3030
|
+
...e,
|
|
3031
|
+
ref: t,
|
|
3032
|
+
trapFocus: !1,
|
|
3033
|
+
disableOutsidePointerEvents: !1,
|
|
3034
|
+
onCloseAutoFocus: (o) => {
|
|
3035
|
+
e.onCloseAutoFocus?.(o), o.defaultPrevented || (r.current || n.triggerRef.current?.focus(), o.preventDefault()), r.current = !1, i.current = !1;
|
|
3036
|
+
},
|
|
3037
|
+
onInteractOutside: (o) => {
|
|
3038
|
+
e.onInteractOutside?.(o), o.defaultPrevented || (r.current = !0, o.detail.originalEvent.type === "pointerdown" && (i.current = !0));
|
|
3039
|
+
const s = o.target;
|
|
3040
|
+
n.triggerRef.current?.contains(s) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && i.current && o.preventDefault();
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
);
|
|
3044
|
+
}
|
|
3045
|
+
), Nr = p.forwardRef(
|
|
3046
|
+
(e, t) => {
|
|
3047
|
+
const {
|
|
3048
|
+
__scopePopover: n,
|
|
3049
|
+
trapFocus: r,
|
|
3050
|
+
onOpenAutoFocus: i,
|
|
3051
|
+
onCloseAutoFocus: o,
|
|
3052
|
+
disableOutsidePointerEvents: s,
|
|
3053
|
+
onEscapeKeyDown: a,
|
|
3054
|
+
onPointerDownOutside: u,
|
|
3055
|
+
onFocusOutside: c,
|
|
3056
|
+
onInteractOutside: f,
|
|
3057
|
+
...l
|
|
3058
|
+
} = e, h = se(we, n), v = Te(n);
|
|
3059
|
+
return Io(), /* @__PURE__ */ w(
|
|
3060
|
+
zn,
|
|
3061
|
+
{
|
|
3062
|
+
asChild: !0,
|
|
3063
|
+
loop: !0,
|
|
3064
|
+
trapped: r,
|
|
3065
|
+
onMountAutoFocus: i,
|
|
3066
|
+
onUnmountAutoFocus: o,
|
|
3067
|
+
children: /* @__PURE__ */ w(
|
|
3068
|
+
Bn,
|
|
3069
|
+
{
|
|
3070
|
+
asChild: !0,
|
|
3071
|
+
disableOutsidePointerEvents: s,
|
|
3072
|
+
onInteractOutside: f,
|
|
3073
|
+
onEscapeKeyDown: a,
|
|
3074
|
+
onPointerDownOutside: u,
|
|
3075
|
+
onFocusOutside: c,
|
|
3076
|
+
onDismiss: () => h.onOpenChange(!1),
|
|
3077
|
+
children: /* @__PURE__ */ w(
|
|
3078
|
+
vs,
|
|
3079
|
+
{
|
|
3080
|
+
"data-state": Fr(h.open),
|
|
3081
|
+
role: "dialog",
|
|
3082
|
+
id: h.contentId,
|
|
3083
|
+
...v,
|
|
3084
|
+
...l,
|
|
3085
|
+
ref: t,
|
|
3086
|
+
style: {
|
|
3087
|
+
...l.style,
|
|
3088
|
+
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
3089
|
+
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
|
3090
|
+
"--radix-popover-content-available-height": "var(--radix-popper-available-height)",
|
|
3091
|
+
"--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
|
|
3092
|
+
"--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
|
|
3093
|
+
}
|
|
3094
|
+
}
|
|
3095
|
+
)
|
|
3096
|
+
}
|
|
3097
|
+
)
|
|
3098
|
+
}
|
|
3099
|
+
);
|
|
3100
|
+
}
|
|
3101
|
+
), Tr = "PopoverClose", Mr = p.forwardRef(
|
|
3102
|
+
(e, t) => {
|
|
3103
|
+
const { __scopePopover: n, ...r } = e, i = se(Tr, n);
|
|
3104
|
+
return /* @__PURE__ */ w(
|
|
3105
|
+
Q.button,
|
|
3106
|
+
{
|
|
3107
|
+
type: "button",
|
|
3108
|
+
...r,
|
|
3109
|
+
ref: t,
|
|
3110
|
+
onClick: te(e.onClick, () => i.onOpenChange(!1))
|
|
3111
|
+
}
|
|
3112
|
+
);
|
|
3113
|
+
}
|
|
3114
|
+
);
|
|
3115
|
+
Mr.displayName = Tr;
|
|
3116
|
+
var ya = "PopoverArrow", kr = p.forwardRef(
|
|
3117
|
+
(e, t) => {
|
|
3118
|
+
const { __scopePopover: n, ...r } = e, i = Te(n);
|
|
3119
|
+
return /* @__PURE__ */ w(gs, { ...i, ...r, ref: t });
|
|
3120
|
+
}
|
|
3121
|
+
);
|
|
3122
|
+
kr.displayName = ya;
|
|
3123
|
+
function Fr(e) {
|
|
3124
|
+
return e ? "open" : "closed";
|
|
3125
|
+
}
|
|
3126
|
+
var Dr = Cr, _a = Or, wa = Ar, ba = Rr, Lr = Mr, xa = kr;
|
|
3127
|
+
const Wt = ({
|
|
3128
|
+
children: e,
|
|
3129
|
+
asChild: t,
|
|
3130
|
+
onClick: n,
|
|
3131
|
+
variant: r = "primary",
|
|
3132
|
+
dismiss: i = !0,
|
|
3133
|
+
fullWidth: o
|
|
3134
|
+
}) => {
|
|
3135
|
+
const s = Re(), { isMdOrSmaller: a } = Ot(), { negative: u } = Et(), h = t ? e : /* @__PURE__ */ w(
|
|
3136
|
+
Ae,
|
|
3137
|
+
{
|
|
3138
|
+
variant: r,
|
|
3139
|
+
size: "sm",
|
|
3140
|
+
fullWidth: o ?? a,
|
|
3141
|
+
negative: !u,
|
|
3142
|
+
onClick: () => {
|
|
3143
|
+
n?.(), i && s?.dismiss();
|
|
3144
|
+
},
|
|
3145
|
+
children: e
|
|
3146
|
+
}
|
|
3147
|
+
);
|
|
3148
|
+
return i ? /* @__PURE__ */ w(Lr, { asChild: !0, children: h }) : h;
|
|
3149
|
+
};
|
|
3150
|
+
Wt.displayName = "PopoverButton";
|
|
3151
|
+
function Sa(e) {
|
|
3152
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3153
|
+
}
|
|
3154
|
+
var Sn = { exports: {} }, Cn;
|
|
3155
|
+
function Ca() {
|
|
3156
|
+
return Cn || (Cn = 1, (function(e) {
|
|
3157
|
+
(function() {
|
|
3158
|
+
var t = {}.hasOwnProperty;
|
|
3159
|
+
function n() {
|
|
3160
|
+
for (var o = "", s = 0; s < arguments.length; s++) {
|
|
3161
|
+
var a = arguments[s];
|
|
3162
|
+
a && (o = i(o, r.call(this, a)));
|
|
3163
|
+
}
|
|
3164
|
+
return o;
|
|
3165
|
+
}
|
|
3166
|
+
function r(o) {
|
|
3167
|
+
if (typeof o == "string" || typeof o == "number")
|
|
3168
|
+
return this && this[o] || o;
|
|
3169
|
+
if (typeof o != "object")
|
|
3170
|
+
return "";
|
|
3171
|
+
if (Array.isArray(o))
|
|
3172
|
+
return n.apply(this, o);
|
|
3173
|
+
if (o.toString !== Object.prototype.toString && !o.toString.toString().includes("[native code]"))
|
|
3174
|
+
return o.toString();
|
|
3175
|
+
var s = "";
|
|
3176
|
+
for (var a in o)
|
|
3177
|
+
t.call(o, a) && o[a] && (s = i(s, this && this[a] || a));
|
|
3178
|
+
return s;
|
|
3179
|
+
}
|
|
3180
|
+
function i(o, s) {
|
|
3181
|
+
return s ? o ? o + " " + s : o + s : o;
|
|
3182
|
+
}
|
|
3183
|
+
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
3184
|
+
})();
|
|
3185
|
+
})(Sn)), Sn.exports;
|
|
3186
|
+
}
|
|
3187
|
+
var Pa = Ca();
|
|
3188
|
+
const Ea = /* @__PURE__ */ Sa(Pa), Oa = {
|
|
3189
|
+
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
3190
|
+
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
3191
|
+
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
3192
|
+
"purpur-icon--sm": "_purpur-icon--sm_8u1lq_12",
|
|
3193
|
+
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
3194
|
+
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
3195
|
+
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
3196
|
+
}, Aa = Ea.bind(Oa), Pn = "purpur-icon", Ra = "md", Na = (e) => e.filter((t) => Object.keys(t).length >= 1).map((t) => `${t.name}="${t.value}"`).join(" "), Ta = ({ content: e = "", title: t } = {}) => {
|
|
3197
|
+
const n = [
|
|
3198
|
+
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
3199
|
+
{ name: "fill", value: "currentColor" },
|
|
3200
|
+
{ name: "viewBox", value: "0 0 24 24" },
|
|
3201
|
+
t ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
3202
|
+
], r = t ? `<title>${t}</title>` : "";
|
|
3203
|
+
return `<svg ${Na(n)}>${r}${e}</svg>`;
|
|
3204
|
+
}, Ma = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), $r = ({ svg: e, allyTitle: t, className: n, size: r = Ra, ...i }) => {
|
|
3205
|
+
const o = Ta({
|
|
3206
|
+
content: Ma(e.svg),
|
|
3207
|
+
title: t
|
|
3208
|
+
}), s = Aa(Pn, `${Pn}--${r}`, n);
|
|
3209
|
+
return /* @__PURE__ */ w("span", { className: s, dangerouslySetInnerHTML: { __html: o }, ...i });
|
|
3210
|
+
};
|
|
3211
|
+
$r.displayName = "Icon";
|
|
3212
|
+
const ka = {
|
|
3213
|
+
name: "close",
|
|
3214
|
+
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',
|
|
3215
|
+
keywords: ["close"],
|
|
3216
|
+
category: "utility"
|
|
3217
|
+
}, Ir = (e) => /* @__PURE__ */ w($r, { ...e, svg: ka });
|
|
3218
|
+
Ir.displayName = "IconClose";
|
|
3219
|
+
function Fa(e) {
|
|
3220
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3221
|
+
}
|
|
3222
|
+
var En = { exports: {} }, On;
|
|
3223
|
+
function Da() {
|
|
3224
|
+
return On || (On = 1, (function(e) {
|
|
3225
|
+
(function() {
|
|
3226
|
+
var t = {}.hasOwnProperty;
|
|
3227
|
+
function n() {
|
|
3228
|
+
for (var o = "", s = 0; s < arguments.length; s++) {
|
|
3229
|
+
var a = arguments[s];
|
|
3230
|
+
a && (o = i(o, r.call(this, a)));
|
|
3231
|
+
}
|
|
3232
|
+
return o;
|
|
3233
|
+
}
|
|
3234
|
+
function r(o) {
|
|
3235
|
+
if (typeof o == "string" || typeof o == "number")
|
|
3236
|
+
return this && this[o] || o;
|
|
3237
|
+
if (typeof o != "object")
|
|
3238
|
+
return "";
|
|
3239
|
+
if (Array.isArray(o))
|
|
3240
|
+
return n.apply(this, o);
|
|
3241
|
+
if (o.toString !== Object.prototype.toString && !o.toString.toString().includes("[native code]"))
|
|
3242
|
+
return o.toString();
|
|
3243
|
+
var s = "";
|
|
3244
|
+
for (var a in o)
|
|
3245
|
+
t.call(o, a) && o[a] && (s = i(s, this && this[a] || a));
|
|
3246
|
+
return s;
|
|
3247
|
+
}
|
|
3248
|
+
function i(o, s) {
|
|
3249
|
+
return s ? o ? o + " " + s : o + s : o;
|
|
3250
|
+
}
|
|
3251
|
+
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
3252
|
+
})();
|
|
3253
|
+
})(En)), En.exports;
|
|
3254
|
+
}
|
|
3255
|
+
var La = Da();
|
|
3256
|
+
const $a = /* @__PURE__ */ Fa(La), Ia = {
|
|
3257
|
+
"purpur-paragraph": "_purpur-paragraph_1vz75_1",
|
|
3258
|
+
"purpur-paragraph--disabled": "_purpur-paragraph--disabled_1vz75_7",
|
|
3259
|
+
"purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1vz75_10",
|
|
3260
|
+
"purpur-paragraph--negative": "_purpur-paragraph--negative_1vz75_13",
|
|
3261
|
+
"purpur-paragraph--paragraph-100": "_purpur-paragraph--paragraph-100_1vz75_16",
|
|
3262
|
+
"purpur-paragraph--paragraph-100-medium": "_purpur-paragraph--paragraph-100-medium_1vz75_22",
|
|
3263
|
+
"purpur-paragraph--paragraph-100-bold": "_purpur-paragraph--paragraph-100-bold_1vz75_29",
|
|
3264
|
+
"purpur-paragraph--paragraph-200": "_purpur-paragraph--paragraph-200_1vz75_36",
|
|
3265
|
+
"purpur-paragraph--preamble-100": "_purpur-paragraph--preamble-100_1vz75_42",
|
|
3266
|
+
"purpur-paragraph--preamble-200": "_purpur-paragraph--preamble-200_1vz75_48",
|
|
3267
|
+
"purpur-paragraph--additional-100": "_purpur-paragraph--additional-100_1vz75_54",
|
|
3268
|
+
"purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_1vz75_60",
|
|
3269
|
+
"purpur-paragraph--additional-100-bold": "_purpur-paragraph--additional-100-bold_1vz75_67",
|
|
3270
|
+
"purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_1vz75_74",
|
|
3271
|
+
"purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_1vz75_82"
|
|
3272
|
+
}, Wa = $a.bind(Ia), Ba = {
|
|
3273
|
+
PARAGRAPH100: "paragraph-100"
|
|
3274
|
+
}, Pe = "purpur-paragraph", Bt = ({
|
|
3275
|
+
children: e,
|
|
3276
|
+
className: t,
|
|
3277
|
+
disabled: n,
|
|
3278
|
+
enableHyphenation: r = !1,
|
|
3279
|
+
negative: i = !1,
|
|
3280
|
+
variant: o = Ba.PARAGRAPH100,
|
|
3281
|
+
...s
|
|
3282
|
+
}) => {
|
|
3283
|
+
const a = Wa(t, Pe, `${Pe}--${o}`, {
|
|
3284
|
+
[`${Pe}--hyphens`]: r,
|
|
3285
|
+
[`${Pe}--disabled`]: n,
|
|
3286
|
+
[`${Pe}--negative`]: i
|
|
3287
|
+
});
|
|
3288
|
+
return /* @__PURE__ */ w("p", { ...s, className: a, children: e });
|
|
3289
|
+
};
|
|
3290
|
+
Bt.displayName = "Paragraph";
|
|
3291
|
+
function ja(e) {
|
|
3292
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3293
|
+
}
|
|
3294
|
+
var dt = { exports: {} };
|
|
3295
|
+
var An;
|
|
3296
|
+
function za() {
|
|
3297
|
+
return An || (An = 1, (function(e) {
|
|
3298
|
+
(function() {
|
|
3299
|
+
var t = {}.hasOwnProperty;
|
|
3300
|
+
function n() {
|
|
3301
|
+
for (var o = "", s = 0; s < arguments.length; s++) {
|
|
3302
|
+
var a = arguments[s];
|
|
3303
|
+
a && (o = i(o, r.call(this, a)));
|
|
3304
|
+
}
|
|
3305
|
+
return o;
|
|
3306
|
+
}
|
|
3307
|
+
function r(o) {
|
|
3308
|
+
if (typeof o == "string" || typeof o == "number")
|
|
3309
|
+
return this && this[o] || o;
|
|
3310
|
+
if (typeof o != "object")
|
|
3311
|
+
return "";
|
|
3312
|
+
if (Array.isArray(o))
|
|
3313
|
+
return n.apply(this, o);
|
|
3314
|
+
if (o.toString !== Object.prototype.toString && !o.toString.toString().includes("[native code]"))
|
|
3315
|
+
return o.toString();
|
|
3316
|
+
var s = "";
|
|
3317
|
+
for (var a in o)
|
|
3318
|
+
t.call(o, a) && o[a] && (s = i(s, this && this[a] || a));
|
|
3319
|
+
return s;
|
|
3320
|
+
}
|
|
3321
|
+
function i(o, s) {
|
|
3322
|
+
return s ? o ? o + " " + s : o + s : o;
|
|
3323
|
+
}
|
|
3324
|
+
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
3325
|
+
})();
|
|
3326
|
+
})(dt)), dt.exports;
|
|
3327
|
+
}
|
|
3328
|
+
var Ha = za();
|
|
3329
|
+
const Me = /* @__PURE__ */ ja(Ha), Va = "_highlightState1_10ko3_1", Ua = "_fadeIn_10ko3_1", Ya = "_slideFromTop_10ko3_1", Xa = "_slideFromBottom_10ko3_1", Ka = "_slideFromLeft_10ko3_1", qa = "_slideFromRight_10ko3_1", Ga = "_fadeOut_10ko3_1", Za = "_slideToTop_10ko3_1", Qa = "_slideToBottom_10ko3_1", Ja = "_slideToLeft_10ko3_1", ec = "_slideToRight_10ko3_1", ke = {
|
|
3330
|
+
"purpur-popover__trigger": "_purpur-popover__trigger_10ko3_1",
|
|
3331
|
+
"purpur-popover__trigger-highlight": "_purpur-popover__trigger-highlight_10ko3_5",
|
|
3332
|
+
"purpur-popover__trigger-highlight--state1": "_purpur-popover__trigger-highlight--state1_10ko3_14",
|
|
3333
|
+
highlightState1: Va,
|
|
3334
|
+
"purpur-popover__trigger-highlight--negative": "_purpur-popover__trigger-highlight--negative_10ko3_29",
|
|
3335
|
+
"purpur-popover__trigger-highlight--state2": "_purpur-popover__trigger-highlight--state2_10ko3_33",
|
|
3336
|
+
"purpur-popover__inner": "_purpur-popover__inner_10ko3_45",
|
|
3337
|
+
"purpur-popover__content": "_purpur-popover__content_10ko3_52",
|
|
3338
|
+
fadeIn: Ua,
|
|
3339
|
+
slideFromTop: Ya,
|
|
3340
|
+
slideFromBottom: Xa,
|
|
3341
|
+
slideFromLeft: Ka,
|
|
3342
|
+
slideFromRight: qa,
|
|
3343
|
+
fadeOut: Ga,
|
|
3344
|
+
slideToTop: Za,
|
|
3345
|
+
slideToBottom: Qa,
|
|
3346
|
+
slideToLeft: Ja,
|
|
3347
|
+
slideToRight: ec,
|
|
3348
|
+
"purpur-popover__arrow": "_purpur-popover__arrow_10ko3_103",
|
|
3349
|
+
"purpur-popover__body": "_purpur-popover__body_10ko3_106",
|
|
3350
|
+
"purpur-popover__icon": "_purpur-popover__icon_10ko3_107",
|
|
3351
|
+
"purpur-popover__steps": "_purpur-popover__steps_10ko3_108",
|
|
3352
|
+
"purpur-popover__title": "_purpur-popover__title_10ko3_109",
|
|
3353
|
+
"purpur-popover__content--negative": "_purpur-popover__content--negative_10ko3_112",
|
|
3354
|
+
"purpur-popover__header-content": "_purpur-popover__header-content_10ko3_124",
|
|
3355
|
+
"purpur-popover__close": "_purpur-popover__close_10ko3_137",
|
|
3356
|
+
"purpur-popover__footer": "_purpur-popover__footer_10ko3_142",
|
|
3357
|
+
"purpur-popover__footer-button-group": "_purpur-popover__footer-button-group_10ko3_155"
|
|
3358
|
+
}, tc = Me.bind(ke), Wr = () => {
|
|
3359
|
+
const e = St(), n = Pt()?.walkthroughStep || e.currentStep, { totalSteps: r, separatorText: i, stepText: o } = e;
|
|
3360
|
+
return /* @__PURE__ */ w(Mn, { children: /* @__PURE__ */ U(
|
|
3361
|
+
Bt,
|
|
3362
|
+
{
|
|
3363
|
+
className: tc("purpur-popover__steps"),
|
|
3364
|
+
role: "status",
|
|
3365
|
+
"aria-live": "polite",
|
|
3366
|
+
"aria-atomic": "true",
|
|
3367
|
+
children: [
|
|
3368
|
+
o,
|
|
3369
|
+
" ",
|
|
3370
|
+
n,
|
|
3371
|
+
" ",
|
|
3372
|
+
i,
|
|
3373
|
+
" ",
|
|
3374
|
+
r
|
|
3375
|
+
]
|
|
3376
|
+
}
|
|
3377
|
+
) });
|
|
3378
|
+
};
|
|
3379
|
+
Wr.displayName = "PopoverSteps";
|
|
3380
|
+
const Rn = Me.bind(ke), jt = ({ children: e, className: t }) => {
|
|
3381
|
+
const n = Re();
|
|
3382
|
+
return /* @__PURE__ */ U("div", { className: Rn("purpur-popover__footer", t), children: [
|
|
3383
|
+
n && /* @__PURE__ */ w(Wr, {}),
|
|
3384
|
+
/* @__PURE__ */ w("div", { className: Rn("purpur-popover__footer-button-group"), children: e })
|
|
3385
|
+
] });
|
|
3386
|
+
};
|
|
3387
|
+
jt.displayName = "PopoverFooter";
|
|
3388
|
+
function nc(e) {
|
|
3389
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3390
|
+
}
|
|
3391
|
+
var Nn = { exports: {} }, Tn;
|
|
3392
|
+
function rc() {
|
|
3393
|
+
return Tn || (Tn = 1, (function(e) {
|
|
3394
|
+
(function() {
|
|
3395
|
+
var t = {}.hasOwnProperty;
|
|
3396
|
+
function n() {
|
|
3397
|
+
for (var o = "", s = 0; s < arguments.length; s++) {
|
|
3398
|
+
var a = arguments[s];
|
|
3399
|
+
a && (o = i(o, r(a)));
|
|
3400
|
+
}
|
|
3401
|
+
return o;
|
|
3402
|
+
}
|
|
3403
|
+
function r(o) {
|
|
3404
|
+
if (typeof o == "string" || typeof o == "number")
|
|
3405
|
+
return o;
|
|
3406
|
+
if (typeof o != "object")
|
|
3407
|
+
return "";
|
|
3408
|
+
if (Array.isArray(o))
|
|
3409
|
+
return n.apply(null, o);
|
|
3410
|
+
if (o.toString !== Object.prototype.toString && !o.toString.toString().includes("[native code]"))
|
|
3411
|
+
return o.toString();
|
|
3412
|
+
var s = "";
|
|
3413
|
+
for (var a in o)
|
|
3414
|
+
t.call(o, a) && o[a] && (s = i(s, a));
|
|
3415
|
+
return s;
|
|
3416
|
+
}
|
|
3417
|
+
function i(o, s) {
|
|
3418
|
+
return s ? o ? o + " " + s : o + s : o;
|
|
3419
|
+
}
|
|
3420
|
+
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
3421
|
+
})();
|
|
3422
|
+
})(Nn)), Nn.exports;
|
|
3423
|
+
}
|
|
3424
|
+
var oc = rc();
|
|
3425
|
+
const ic = /* @__PURE__ */ nc(oc), je = {
|
|
3426
|
+
"purpur-heading": "_purpur-heading_vo751_1",
|
|
3427
|
+
"purpur-heading--hyphens": "_purpur-heading--hyphens_vo751_8",
|
|
3428
|
+
"purpur-heading--negative": "_purpur-heading--negative_vo751_11",
|
|
3429
|
+
"purpur-heading--subsection-100": "_purpur-heading--subsection-100_vo751_14",
|
|
3430
|
+
"purpur-heading--title-100": "_purpur-heading--title-100_vo751_20",
|
|
3431
|
+
"purpur-heading--title-200": "_purpur-heading--title-200_vo751_26",
|
|
3432
|
+
"purpur-heading--title-300": "_purpur-heading--title-300_vo751_32",
|
|
3433
|
+
"purpur-heading--title-400": "_purpur-heading--title-400_vo751_38",
|
|
3434
|
+
"purpur-heading--title-500": "_purpur-heading--title-500_vo751_44",
|
|
3435
|
+
"purpur-heading--title-600": "_purpur-heading--title-600_vo751_50",
|
|
3436
|
+
"purpur-heading--title-700": "_purpur-heading--title-700_vo751_56",
|
|
3437
|
+
"purpur-heading--display-5": "_purpur-heading--display-5_vo751_62",
|
|
3438
|
+
"purpur-heading--display-10": "_purpur-heading--display-10_vo751_68",
|
|
3439
|
+
"purpur-heading--display-15": "_purpur-heading--display-15_vo751_74",
|
|
3440
|
+
"purpur-heading--display-20": "_purpur-heading--display-20_vo751_80",
|
|
3441
|
+
"purpur-heading--display-25": "_purpur-heading--display-25_vo751_86",
|
|
3442
|
+
"purpur-heading--display-50": "_purpur-heading--display-50_vo751_92",
|
|
3443
|
+
"purpur-heading--display-100": "_purpur-heading--display-100_vo751_98",
|
|
3444
|
+
"purpur-heading--display-200": "_purpur-heading--display-200_vo751_104"
|
|
3445
|
+
}, sc = {
|
|
3446
|
+
TITLE100: "title-100"
|
|
3447
|
+
}, ze = "purpur-heading", Br = ({
|
|
3448
|
+
children: e,
|
|
3449
|
+
className: t = "",
|
|
3450
|
+
enableHyphenation: n = !1,
|
|
3451
|
+
negative: r = !1,
|
|
3452
|
+
tag: i,
|
|
3453
|
+
variant: o = sc.TITLE100,
|
|
3454
|
+
...s
|
|
3455
|
+
}) => {
|
|
3456
|
+
const a = i, u = ic([
|
|
3457
|
+
t,
|
|
3458
|
+
je[ze],
|
|
3459
|
+
je[`${ze}--${o}`],
|
|
3460
|
+
{
|
|
3461
|
+
[je[`${ze}--hyphens`]]: n,
|
|
3462
|
+
[je[`${ze}--negative`]]: r
|
|
3463
|
+
}
|
|
3464
|
+
]);
|
|
3465
|
+
return /* @__PURE__ */ w(a, { className: u, ...s, children: e });
|
|
3466
|
+
};
|
|
3467
|
+
Br.displayName = "Heading";
|
|
3468
|
+
const ht = Me.bind(ke), jr = Ge(
|
|
3469
|
+
({ title: e, icon: t }, n) => /* @__PURE__ */ U("div", { ref: n, className: ht("purpur-popover__header-content"), children: [
|
|
3470
|
+
t && /* @__PURE__ */ w("span", { className: ht("purpur-popover__icon"), children: t }),
|
|
3471
|
+
/* @__PURE__ */ w(
|
|
3472
|
+
Br,
|
|
3473
|
+
{
|
|
3474
|
+
tag: "h2",
|
|
3475
|
+
variant: "title-100",
|
|
3476
|
+
className: ht("purpur-popover__title"),
|
|
3477
|
+
id: "popover-heading",
|
|
3478
|
+
children: e
|
|
3479
|
+
}
|
|
3480
|
+
)
|
|
3481
|
+
] })
|
|
3482
|
+
);
|
|
3483
|
+
jr.displayName = "PopoverHeader";
|
|
3484
|
+
const zt = ({
|
|
3485
|
+
children: e,
|
|
3486
|
+
onClick: t
|
|
3487
|
+
}) => {
|
|
3488
|
+
const { next: n } = St(), { negative: r } = Et(), { isMdOrSmaller: i } = Ot();
|
|
3489
|
+
return /* @__PURE__ */ w(
|
|
3490
|
+
Ae,
|
|
3491
|
+
{
|
|
3492
|
+
size: "sm",
|
|
3493
|
+
variant: "primary",
|
|
3494
|
+
onClick: () => {
|
|
3495
|
+
t?.(), n();
|
|
3496
|
+
},
|
|
3497
|
+
negative: !r,
|
|
3498
|
+
fullWidth: i,
|
|
3499
|
+
children: e
|
|
3500
|
+
}
|
|
3501
|
+
);
|
|
3502
|
+
};
|
|
3503
|
+
zt.displayName = "PopoverNext";
|
|
3504
|
+
const de = Me.bind(ke), zr = Ge(
|
|
3505
|
+
({
|
|
3506
|
+
children: e,
|
|
3507
|
+
className: t,
|
|
3508
|
+
beakPosition: n = "down",
|
|
3509
|
+
align: r = "center",
|
|
3510
|
+
alignOffset: i = 0,
|
|
3511
|
+
sideOffset: o = 5,
|
|
3512
|
+
// How close or far the popover is from the trigger
|
|
3513
|
+
negative: s = !1,
|
|
3514
|
+
closeIconAriaLabel: a,
|
|
3515
|
+
title: u,
|
|
3516
|
+
icon: c,
|
|
3517
|
+
body: f,
|
|
3518
|
+
onAction: l,
|
|
3519
|
+
zIndex: h = 210,
|
|
3520
|
+
...v
|
|
3521
|
+
}, g) => {
|
|
3522
|
+
const d = Re(), m = Pt(), y = me(null), S = {
|
|
3523
|
+
up: "bottom",
|
|
3524
|
+
right: "left",
|
|
3525
|
+
down: "top",
|
|
3526
|
+
left: "right",
|
|
3527
|
+
none: "bottom"
|
|
3528
|
+
// Default position when no arrow
|
|
3529
|
+
}[n], _ = n !== "none";
|
|
3530
|
+
let b = e;
|
|
3531
|
+
if (d && !e) {
|
|
3532
|
+
const E = m?.walkthroughStep || d.currentStep, R = E === 1, M = E === d.totalSteps;
|
|
3533
|
+
b = /* @__PURE__ */ U(jt, { children: [
|
|
3534
|
+
!R && /* @__PURE__ */ w(At, { onClick: () => l?.({ type: "back", step: E }), children: d.backLabel }),
|
|
3535
|
+
M ? /* @__PURE__ */ w(
|
|
3536
|
+
Wt,
|
|
3537
|
+
{
|
|
3538
|
+
onClick: () => l?.({ type: "finish", step: E }),
|
|
3539
|
+
dismiss: !0,
|
|
3540
|
+
children: d.finishLabel
|
|
3541
|
+
}
|
|
3542
|
+
) : /* @__PURE__ */ w(zt, { onClick: () => l?.({ type: "next", step: E }), children: d.nextLabel })
|
|
3543
|
+
] });
|
|
3544
|
+
}
|
|
3545
|
+
const P = (E) => {
|
|
3546
|
+
if (E.preventDefault(), d) {
|
|
3547
|
+
const R = E.currentTarget;
|
|
3548
|
+
setTimeout(() => {
|
|
3549
|
+
R.setAttribute("tabindex", "-1"), R.focus();
|
|
3550
|
+
}, 0);
|
|
3551
|
+
}
|
|
3552
|
+
v.onOpenAutoFocus?.(E);
|
|
3553
|
+
}, C = (E) => {
|
|
3554
|
+
d && E.preventDefault(), v.onCloseAutoFocus?.(E);
|
|
3555
|
+
}, A = (E) => {
|
|
3556
|
+
const R = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
3557
|
+
d && !R ? (E.preventDefault(), setTimeout(() => {
|
|
3558
|
+
l?.({ type: "dismiss", step: d.currentStep }), d.dismiss();
|
|
3559
|
+
}, 200)) : (l?.({ type: "dismiss", step: d?.currentStep }), d?.dismiss());
|
|
3560
|
+
}, T = (E) => {
|
|
3561
|
+
const R = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
3562
|
+
d && !R ? (E.preventDefault(), setTimeout(() => {
|
|
3563
|
+
l?.({ type: "dismiss", step: d.currentStep }), d.dismiss();
|
|
3564
|
+
}, 200)) : (l?.({ type: "dismiss", step: d?.currentStep }), d?.dismiss());
|
|
3565
|
+
}, N = (E) => {
|
|
3566
|
+
if (m?.disableClickOutside) {
|
|
3567
|
+
E.preventDefault();
|
|
3568
|
+
return;
|
|
3569
|
+
}
|
|
3570
|
+
if (d) {
|
|
3571
|
+
const R = E.target;
|
|
3572
|
+
R.closest("[role='dialog']") || R.closest(".purpur-popover__trigger") || R.closest("button[aria-haspopup='dialog']") || (l?.({ type: "dismiss", step: d.currentStep }), setTimeout(() => {
|
|
3573
|
+
d.dismiss();
|
|
3574
|
+
}, 0));
|
|
3575
|
+
}
|
|
3576
|
+
};
|
|
3577
|
+
return /* @__PURE__ */ w(wa, { children: /* @__PURE__ */ U(
|
|
3578
|
+
ba,
|
|
3579
|
+
{
|
|
3580
|
+
"data-testid": "popover-content",
|
|
3581
|
+
role: "dialog",
|
|
3582
|
+
"aria-modal": "true",
|
|
3583
|
+
"aria-labelledby": v["aria-label"] ? void 0 : "popover-heading",
|
|
3584
|
+
ref: g,
|
|
3585
|
+
side: S,
|
|
3586
|
+
sideOffset: o,
|
|
3587
|
+
align: r,
|
|
3588
|
+
alignOffset: i,
|
|
3589
|
+
style: {
|
|
3590
|
+
"--popover-z-index": h
|
|
3591
|
+
},
|
|
3592
|
+
className: de(
|
|
3593
|
+
"purpur-popover__content",
|
|
3594
|
+
{ "purpur-popover__content--negative": s },
|
|
3595
|
+
t
|
|
3596
|
+
),
|
|
3597
|
+
onOpenAutoFocus: P,
|
|
3598
|
+
onCloseAutoFocus: C,
|
|
3599
|
+
onEscapeKeyDown: T,
|
|
3600
|
+
onInteractOutside: N,
|
|
3601
|
+
...v,
|
|
3602
|
+
children: [
|
|
3603
|
+
/* @__PURE__ */ U(Dn.Provider, { value: { negative: s }, children: [
|
|
3604
|
+
/* @__PURE__ */ U("div", { className: de("purpur-popover__inner"), children: [
|
|
3605
|
+
/* @__PURE__ */ w(jr, { ref: y, title: u, icon: c }),
|
|
3606
|
+
/* @__PURE__ */ w(Bt, { className: de("purpur-popover__body"), children: f })
|
|
3607
|
+
] }),
|
|
3608
|
+
b,
|
|
3609
|
+
/* @__PURE__ */ w(Lr, { asChild: !0, onClick: A, children: /* @__PURE__ */ w(
|
|
3610
|
+
Ae,
|
|
3611
|
+
{
|
|
3612
|
+
variant: s ? "text" : "tertiary-purple",
|
|
3613
|
+
size: "sm",
|
|
3614
|
+
"aria-label": a,
|
|
3615
|
+
className: de("purpur-popover__close"),
|
|
3616
|
+
negative: !s,
|
|
3617
|
+
iconOnly: !0,
|
|
3618
|
+
children: /* @__PURE__ */ w(Ir, { size: "xs", className: de("purpur-popover__icon") })
|
|
3619
|
+
}
|
|
3620
|
+
) })
|
|
3621
|
+
] }),
|
|
3622
|
+
_ && /* @__PURE__ */ w(
|
|
3623
|
+
xa,
|
|
3624
|
+
{
|
|
3625
|
+
className: de("purpur-popover__arrow"),
|
|
3626
|
+
"aria-hidden": "true",
|
|
3627
|
+
tabIndex: -1
|
|
3628
|
+
}
|
|
3629
|
+
)
|
|
3630
|
+
]
|
|
3631
|
+
}
|
|
3632
|
+
) });
|
|
3633
|
+
}
|
|
3634
|
+
);
|
|
3635
|
+
zr.displayName = "PopoverContent";
|
|
3636
|
+
const Hr = ({
|
|
3637
|
+
children: e,
|
|
3638
|
+
open: t,
|
|
3639
|
+
defaultOpen: n = !1,
|
|
3640
|
+
onOpenChange: r,
|
|
3641
|
+
disableClickOutside: i,
|
|
3642
|
+
...o
|
|
3643
|
+
}) => {
|
|
3644
|
+
const [s, a] = ce(n), u = t !== void 0, c = u ? t : s;
|
|
3645
|
+
return /* @__PURE__ */ w(Dr, { open: c, onOpenChange: (l) => {
|
|
3646
|
+
u || a(l), r?.(l);
|
|
3647
|
+
}, ...o, children: /* @__PURE__ */ w(
|
|
3648
|
+
Ct.Provider,
|
|
3649
|
+
{
|
|
3650
|
+
value: {
|
|
3651
|
+
isOpen: c,
|
|
3652
|
+
walkthroughStep: 0,
|
|
3653
|
+
disableClickOutside: i
|
|
3654
|
+
},
|
|
3655
|
+
children: e
|
|
3656
|
+
}
|
|
3657
|
+
) });
|
|
3658
|
+
};
|
|
3659
|
+
Hr.displayName = "PopoverStandalone";
|
|
3660
|
+
const ac = (e) => {
|
|
3661
|
+
const t = me(null), n = B(() => {
|
|
3662
|
+
t.current && (cancelAnimationFrame(t.current), t.current = null);
|
|
3663
|
+
}, []);
|
|
3664
|
+
return { scrollToElement: B(
|
|
3665
|
+
(i, o = 600) => {
|
|
3666
|
+
const s = window.matchMedia("(prefers-reduced-motion: reduce)").matches, a = i.getBoundingClientRect(), u = a.top + window.pageYOffset, c = a.height, f = window.innerHeight;
|
|
3667
|
+
let l = u - f / 2 + c / 2;
|
|
3668
|
+
const h = document.documentElement.scrollHeight, v = Math.max(0, h - f);
|
|
3669
|
+
if (l = Math.max(0, Math.min(l, v)), s) {
|
|
3670
|
+
window.scrollTo(0, l), e?.();
|
|
3671
|
+
return;
|
|
3672
|
+
}
|
|
3673
|
+
const g = window.pageYOffset, d = l - g, m = performance.now(), y = (x) => {
|
|
3674
|
+
const S = x - m, _ = Math.min(S / o, 1), b = _ < 0.5 ? 2 * _ * _ : 1 - Math.pow(-2 * _ + 2, 2) / 2, P = g + d * b;
|
|
3675
|
+
window.scrollTo(0, P), _ < 1 ? t.current = requestAnimationFrame(y) : (t.current = null, e?.());
|
|
3676
|
+
};
|
|
3677
|
+
n(), t.current = requestAnimationFrame(y);
|
|
3678
|
+
},
|
|
3679
|
+
[e, n]
|
|
3680
|
+
), cancelScroll: n };
|
|
3681
|
+
};
|
|
3682
|
+
function cc(e) {
|
|
3683
|
+
const t = me(null), n = Pt(), r = Re(), i = me(!1), { scrollToElement: o, cancelScroll: s } = ac(n?.onScrollComplete);
|
|
3684
|
+
return he(() => {
|
|
3685
|
+
typeof e == "function" ? e(t.current) : e && (e.current = t.current);
|
|
3686
|
+
}, [e]), he(() => {
|
|
3687
|
+
if (r && n?.walkthroughStep !== void 0 && r.currentStep === n.walkthroughStep && t.current && !i.current) {
|
|
3688
|
+
const u = t.current, c = u.getBoundingClientRect(), f = 100;
|
|
3689
|
+
c.top >= -f && c.bottom <= window.innerHeight + f && c.left >= -f && c.right <= window.innerWidth + f ? n?.onScrollComplete?.() : (n?.onScrollStart?.(), o(u)), i.current = !0;
|
|
3690
|
+
} else r?.currentStep !== n?.walkthroughStep && (i.current = !1, s());
|
|
3691
|
+
}, [r?.currentStep, n?.walkthroughStep, r, o, s, n]), he(() => s, [s]), { triggerRef: t, context: n };
|
|
3692
|
+
}
|
|
3693
|
+
const vt = Me.bind(ke), Vr = Ge(
|
|
3694
|
+
({ children: e, className: t, highlight: n = !0, negative: r = !1, ...i }, o) => {
|
|
3695
|
+
const { triggerRef: s, context: a } = cc(o);
|
|
3696
|
+
return /* @__PURE__ */ U(
|
|
3697
|
+
"div",
|
|
3698
|
+
{
|
|
3699
|
+
className: vt(
|
|
3700
|
+
"purpur-popover__trigger",
|
|
3701
|
+
{ "purpur-popover__trigger--highlight": a?.isOpen && n },
|
|
3702
|
+
t
|
|
3703
|
+
),
|
|
3704
|
+
children: [
|
|
3705
|
+
a?.isOpen && n && /* @__PURE__ */ U(Mn, { children: [
|
|
3706
|
+
/* @__PURE__ */ w(
|
|
3707
|
+
"div",
|
|
3708
|
+
{
|
|
3709
|
+
className: vt(
|
|
3710
|
+
"purpur-popover__trigger-highlight",
|
|
3711
|
+
"purpur-popover__trigger-highlight--state1",
|
|
3712
|
+
{ "purpur-popover__trigger-highlight--negative": r }
|
|
3713
|
+
),
|
|
3714
|
+
"aria-hidden": "true"
|
|
3715
|
+
}
|
|
3716
|
+
),
|
|
3717
|
+
/* @__PURE__ */ w(
|
|
3718
|
+
"div",
|
|
3719
|
+
{
|
|
3720
|
+
className: vt(
|
|
3721
|
+
"purpur-popover__trigger-highlight",
|
|
3722
|
+
"purpur-popover__trigger-highlight--state2",
|
|
3723
|
+
{ "purpur-popover__trigger-highlight--negative": r }
|
|
3724
|
+
),
|
|
3725
|
+
"aria-hidden": "true"
|
|
3726
|
+
}
|
|
3727
|
+
)
|
|
3728
|
+
] }),
|
|
3729
|
+
/* @__PURE__ */ w(
|
|
3730
|
+
_a,
|
|
3731
|
+
{
|
|
3732
|
+
ref: s,
|
|
3733
|
+
asChild: !0,
|
|
3734
|
+
"aria-expanded": a?.isOpen ?? !1,
|
|
3735
|
+
"aria-haspopup": "dialog",
|
|
3736
|
+
...i,
|
|
3737
|
+
children: e
|
|
3738
|
+
}
|
|
3739
|
+
)
|
|
3740
|
+
]
|
|
3741
|
+
}
|
|
3742
|
+
);
|
|
3743
|
+
}
|
|
3744
|
+
);
|
|
3745
|
+
Vr.displayName = "PopoverTrigger";
|
|
3746
|
+
function uc(e) {
|
|
3747
|
+
const t = Re(), [n, r] = ce(!1), [i, o] = ce(!1), s = me(null), a = me(0);
|
|
3748
|
+
he(() => t ? (t.registerStep(e), () => t.unregisterStep(e)) : () => {
|
|
3749
|
+
}, [t, e]);
|
|
3750
|
+
const u = t?.currentStep === e, c = B(() => {
|
|
3751
|
+
o(!0);
|
|
3752
|
+
}, []), f = B(() => {
|
|
3753
|
+
if (o(!1), u) {
|
|
3754
|
+
const h = t.openDelay;
|
|
3755
|
+
s.current = window.setTimeout(() => {
|
|
3756
|
+
r(!0), a.current = Date.now();
|
|
3757
|
+
}, h);
|
|
3758
|
+
}
|
|
3759
|
+
}, [u, t]);
|
|
3760
|
+
he(() => {
|
|
3761
|
+
if (s.current && (clearTimeout(s.current), s.current = null), u) {
|
|
3762
|
+
if (!i) {
|
|
3763
|
+
const h = t.openDelay;
|
|
3764
|
+
s.current = window.setTimeout(() => {
|
|
3765
|
+
r(!0), a.current = Date.now();
|
|
3766
|
+
}, h);
|
|
3767
|
+
}
|
|
3768
|
+
} else
|
|
3769
|
+
r(!1), o(!1), a.current = 0;
|
|
3770
|
+
return () => {
|
|
3771
|
+
s.current && (clearTimeout(s.current), s.current = null);
|
|
3772
|
+
};
|
|
3773
|
+
}, [u, i, t]);
|
|
3774
|
+
const l = B(
|
|
3775
|
+
(h, v) => {
|
|
3776
|
+
if (v?.(h), !h && n && t && t.currentStep === e) {
|
|
3777
|
+
if (Date.now() - a.current < 10 || s.current !== null)
|
|
3778
|
+
return;
|
|
3779
|
+
t.dismiss();
|
|
3780
|
+
}
|
|
3781
|
+
},
|
|
3782
|
+
[n, t, e]
|
|
3783
|
+
);
|
|
3784
|
+
return {
|
|
3785
|
+
actuallyOpen: n,
|
|
3786
|
+
onScrollStart: c,
|
|
3787
|
+
onScrollComplete: f,
|
|
3788
|
+
handleOpenChange: l
|
|
3789
|
+
};
|
|
3790
|
+
}
|
|
3791
|
+
const Ur = ({
|
|
3792
|
+
children: e,
|
|
3793
|
+
step: t,
|
|
3794
|
+
onOpenChange: n,
|
|
3795
|
+
disableClickOutside: r = !0,
|
|
3796
|
+
...i
|
|
3797
|
+
}) => {
|
|
3798
|
+
const { actuallyOpen: o, onScrollStart: s, onScrollComplete: a, handleOpenChange: u } = uc(t);
|
|
3799
|
+
return /* @__PURE__ */ w(
|
|
3800
|
+
Dr,
|
|
3801
|
+
{
|
|
3802
|
+
open: o,
|
|
3803
|
+
onOpenChange: (c) => u(c, n),
|
|
3804
|
+
...i,
|
|
3805
|
+
children: /* @__PURE__ */ w(
|
|
3806
|
+
Ct.Provider,
|
|
3807
|
+
{
|
|
3808
|
+
value: {
|
|
3809
|
+
isOpen: o,
|
|
3810
|
+
walkthroughStep: t,
|
|
3811
|
+
onScrollStart: s,
|
|
3812
|
+
onScrollComplete: a,
|
|
3813
|
+
disableClickOutside: r
|
|
3814
|
+
},
|
|
3815
|
+
children: e
|
|
3816
|
+
}
|
|
3817
|
+
)
|
|
3818
|
+
}
|
|
3819
|
+
);
|
|
3820
|
+
};
|
|
3821
|
+
Ur.displayName = "PopoverWalkthrough";
|
|
3822
|
+
const ae = (e) => {
|
|
3823
|
+
const { multistep: t = !1, disableClickOutside: n, ...r } = e;
|
|
3824
|
+
return t ? /* @__PURE__ */ w(
|
|
3825
|
+
Ur,
|
|
3826
|
+
{
|
|
3827
|
+
...r,
|
|
3828
|
+
disableClickOutside: n ?? !0
|
|
3829
|
+
}
|
|
3830
|
+
) : /* @__PURE__ */ w(
|
|
3831
|
+
Hr,
|
|
3832
|
+
{
|
|
3833
|
+
...r,
|
|
3834
|
+
disableClickOutside: n
|
|
3835
|
+
}
|
|
3836
|
+
);
|
|
3837
|
+
};
|
|
3838
|
+
ae.Back = At;
|
|
3839
|
+
ae.Button = Wt;
|
|
3840
|
+
ae.Content = zr;
|
|
3841
|
+
ae.Flow = _o;
|
|
3842
|
+
ae.Footer = jt;
|
|
3843
|
+
ae.Next = zt;
|
|
3844
|
+
ae.Trigger = Vr;
|
|
3845
|
+
ae.displayName = "Popover";
|
|
3846
|
+
export {
|
|
3847
|
+
ae as Popover
|
|
3848
|
+
};
|
|
3849
|
+
//# sourceMappingURL=popover.es.js.map
|