glyphx 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,2398 @@
1
+ import * as i from "react";
2
+ import De, { useEffect as Te, useState as vn, useRef as It } from "react";
3
+ import * as pn from "react-dom";
4
+ import mn from "react-dom";
5
+ function hn(e) {
6
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
7
+ }
8
+ var Me = { exports: {} }, Ae = {};
9
+ var vt;
10
+ function gn() {
11
+ if (vt) return Ae;
12
+ vt = 1;
13
+ var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
14
+ function n(r, o, a) {
15
+ var c = null;
16
+ if (a !== void 0 && (c = "" + a), o.key !== void 0 && (c = "" + o.key), "key" in o) {
17
+ a = {};
18
+ for (var s in o)
19
+ s !== "key" && (a[s] = o[s]);
20
+ } else a = o;
21
+ return o = a.ref, {
22
+ $$typeof: e,
23
+ type: r,
24
+ key: c,
25
+ ref: o !== void 0 ? o : null,
26
+ props: a
27
+ };
28
+ }
29
+ return Ae.Fragment = t, Ae.jsx = n, Ae.jsxs = n, Ae;
30
+ }
31
+ var Ie = {};
32
+ var pt;
33
+ function yn() {
34
+ return pt || (pt = 1, process.env.NODE_ENV !== "production" && (function() {
35
+ function e(f) {
36
+ if (f == null) return null;
37
+ if (typeof f == "function")
38
+ return f.$$typeof === Z ? null : f.displayName || f.name || null;
39
+ if (typeof f == "string") return f;
40
+ switch (f) {
41
+ case R:
42
+ return "Fragment";
43
+ case j:
44
+ return "Profiler";
45
+ case T:
46
+ return "StrictMode";
47
+ case X:
48
+ return "Suspense";
49
+ case A:
50
+ return "SuspenseList";
51
+ case ie:
52
+ return "Activity";
53
+ }
54
+ if (typeof f == "object")
55
+ switch (typeof f.tag == "number" && console.error(
56
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
57
+ ), f.$$typeof) {
58
+ case g:
59
+ return "Portal";
60
+ case B:
61
+ return f.displayName || "Context";
62
+ case M:
63
+ return (f._context.displayName || "Context") + ".Consumer";
64
+ case Y:
65
+ var P = f.render;
66
+ return f = f.displayName, f || (f = P.displayName || P.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
67
+ case G:
68
+ return P = f.displayName || null, P !== null ? P : e(f.type) || "Memo";
69
+ case ne:
70
+ P = f._payload, f = f._init;
71
+ try {
72
+ return e(f(P));
73
+ } catch {
74
+ }
75
+ }
76
+ return null;
77
+ }
78
+ function t(f) {
79
+ return "" + f;
80
+ }
81
+ function n(f) {
82
+ try {
83
+ t(f);
84
+ var P = !1;
85
+ } catch {
86
+ P = !0;
87
+ }
88
+ if (P) {
89
+ P = console;
90
+ var U = P.error, l = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
91
+ return U.call(
92
+ P,
93
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
94
+ l
95
+ ), t(f);
96
+ }
97
+ }
98
+ function r(f) {
99
+ if (f === R) return "<>";
100
+ if (typeof f == "object" && f !== null && f.$$typeof === ne)
101
+ return "<...>";
102
+ try {
103
+ var P = e(f);
104
+ return P ? "<" + P + ">" : "<...>";
105
+ } catch {
106
+ return "<...>";
107
+ }
108
+ }
109
+ function o() {
110
+ var f = oe.A;
111
+ return f === null ? null : f.getOwner();
112
+ }
113
+ function a() {
114
+ return Error("react-stack-top-frame");
115
+ }
116
+ function c(f) {
117
+ if (Se.call(f, "key")) {
118
+ var P = Object.getOwnPropertyDescriptor(f, "key").get;
119
+ if (P && P.isReactWarning) return !1;
120
+ }
121
+ return f.key !== void 0;
122
+ }
123
+ function s(f, P) {
124
+ function U() {
125
+ le || (le = !0, console.error(
126
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
127
+ P
128
+ ));
129
+ }
130
+ U.isReactWarning = !0, Object.defineProperty(f, "key", {
131
+ get: U,
132
+ configurable: !0
133
+ });
134
+ }
135
+ function h() {
136
+ var f = e(this.type);
137
+ return _e[f] || (_e[f] = !0, console.error(
138
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
139
+ )), f = this.props.ref, f !== void 0 ? f : null;
140
+ }
141
+ function d(f, P, U, l, u, v) {
142
+ var p = U.ref;
143
+ return f = {
144
+ $$typeof: $,
145
+ type: f,
146
+ key: P,
147
+ props: U,
148
+ _owner: l
149
+ }, (p !== void 0 ? p : null) !== null ? Object.defineProperty(f, "ref", {
150
+ enumerable: !1,
151
+ get: h
152
+ }) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
153
+ configurable: !1,
154
+ enumerable: !1,
155
+ writable: !0,
156
+ value: 0
157
+ }), Object.defineProperty(f, "_debugInfo", {
158
+ configurable: !1,
159
+ enumerable: !1,
160
+ writable: !0,
161
+ value: null
162
+ }), Object.defineProperty(f, "_debugStack", {
163
+ configurable: !1,
164
+ enumerable: !1,
165
+ writable: !0,
166
+ value: u
167
+ }), Object.defineProperty(f, "_debugTask", {
168
+ configurable: !1,
169
+ enumerable: !1,
170
+ writable: !0,
171
+ value: v
172
+ }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
173
+ }
174
+ function E(f, P, U, l, u, v) {
175
+ var p = P.children;
176
+ if (p !== void 0)
177
+ if (l)
178
+ if (pe(p)) {
179
+ for (l = 0; l < p.length; l++)
180
+ y(p[l]);
181
+ Object.freeze && Object.freeze(p);
182
+ } else
183
+ console.error(
184
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
185
+ );
186
+ else y(p);
187
+ if (Se.call(P, "key")) {
188
+ p = e(f);
189
+ var w = Object.keys(P).filter(function(m) {
190
+ return m !== "key";
191
+ });
192
+ l = 0 < w.length ? "{key: someKey, " + w.join(": ..., ") + ": ...}" : "{key: someKey}", H[p + l] || (w = 0 < w.length ? "{" + w.join(": ..., ") + ": ...}" : "{}", console.error(
193
+ `A props object containing a "key" prop is being spread into JSX:
194
+ let props = %s;
195
+ <%s {...props} />
196
+ React keys must be passed directly to JSX without using spread:
197
+ let props = %s;
198
+ <%s key={someKey} {...props} />`,
199
+ l,
200
+ p,
201
+ w,
202
+ p
203
+ ), H[p + l] = !0);
204
+ }
205
+ if (p = null, U !== void 0 && (n(U), p = "" + U), c(P) && (n(P.key), p = "" + P.key), "key" in P) {
206
+ U = {};
207
+ for (var x in P)
208
+ x !== "key" && (U[x] = P[x]);
209
+ } else U = P;
210
+ return p && s(
211
+ U,
212
+ typeof f == "function" ? f.displayName || f.name || "Unknown" : f
213
+ ), d(
214
+ f,
215
+ p,
216
+ U,
217
+ o(),
218
+ u,
219
+ v
220
+ );
221
+ }
222
+ function y(f) {
223
+ C(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === ne && (f._payload.status === "fulfilled" ? C(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
224
+ }
225
+ function C(f) {
226
+ return typeof f == "object" && f !== null && f.$$typeof === $;
227
+ }
228
+ var _ = De, $ = /* @__PURE__ */ Symbol.for("react.transitional.element"), g = /* @__PURE__ */ Symbol.for("react.portal"), R = /* @__PURE__ */ Symbol.for("react.fragment"), T = /* @__PURE__ */ Symbol.for("react.strict_mode"), j = /* @__PURE__ */ Symbol.for("react.profiler"), M = /* @__PURE__ */ Symbol.for("react.consumer"), B = /* @__PURE__ */ Symbol.for("react.context"), Y = /* @__PURE__ */ Symbol.for("react.forward_ref"), X = /* @__PURE__ */ Symbol.for("react.suspense"), A = /* @__PURE__ */ Symbol.for("react.suspense_list"), G = /* @__PURE__ */ Symbol.for("react.memo"), ne = /* @__PURE__ */ Symbol.for("react.lazy"), ie = /* @__PURE__ */ Symbol.for("react.activity"), Z = /* @__PURE__ */ Symbol.for("react.client.reference"), oe = _.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Se = Object.prototype.hasOwnProperty, pe = Array.isArray, me = console.createTask ? console.createTask : function() {
229
+ return null;
230
+ };
231
+ _ = {
232
+ react_stack_bottom_frame: function(f) {
233
+ return f();
234
+ }
235
+ };
236
+ var le, _e = {}, J = _.react_stack_bottom_frame.bind(
237
+ _,
238
+ a
239
+ )(), Ce = me(r(a)), H = {};
240
+ Ie.Fragment = R, Ie.jsx = function(f, P, U) {
241
+ var l = 1e4 > oe.recentlyCreatedOwnerStacks++;
242
+ return E(
243
+ f,
244
+ P,
245
+ U,
246
+ !1,
247
+ l ? Error("react-stack-top-frame") : J,
248
+ l ? me(r(f)) : Ce
249
+ );
250
+ }, Ie.jsxs = function(f, P, U) {
251
+ var l = 1e4 > oe.recentlyCreatedOwnerStacks++;
252
+ return E(
253
+ f,
254
+ P,
255
+ U,
256
+ !0,
257
+ l ? Error("react-stack-top-frame") : J,
258
+ l ? me(r(f)) : Ce
259
+ );
260
+ };
261
+ })()), Ie;
262
+ }
263
+ var mt;
264
+ function bn() {
265
+ return mt || (mt = 1, process.env.NODE_ENV === "production" ? Me.exports = gn() : Me.exports = yn()), Me.exports;
266
+ }
267
+ var b = bn();
268
+ const ht = (e) => {
269
+ let t;
270
+ const n = /* @__PURE__ */ new Set(), r = (d, E) => {
271
+ const y = typeof d == "function" ? d(t) : d;
272
+ if (!Object.is(y, t)) {
273
+ const C = t;
274
+ t = E ?? (typeof y != "object" || y === null) ? y : Object.assign({}, t, y), n.forEach((_) => _(t, C));
275
+ }
276
+ }, o = () => t, s = { setState: r, getState: o, getInitialState: () => h, subscribe: (d) => (n.add(d), () => n.delete(d)) }, h = t = e(r, o, s);
277
+ return s;
278
+ }, En = ((e) => e ? ht(e) : ht), xn = (e) => e;
279
+ function wn(e, t = xn) {
280
+ const n = De.useSyncExternalStore(
281
+ e.subscribe,
282
+ De.useCallback(() => t(e.getState()), [e, t]),
283
+ De.useCallback(() => t(e.getInitialState()), [e, t])
284
+ );
285
+ return De.useDebugValue(n), n;
286
+ }
287
+ const gt = (e) => {
288
+ const t = En(e), n = (r) => wn(t, r);
289
+ return Object.assign(n, t), n;
290
+ }, Sn = ((e) => e ? gt(e) : gt);
291
+ function _n(e) {
292
+ return e.map((t) => {
293
+ const n = [t.title, t.subtitle, ...t.keywords ?? []];
294
+ return {
295
+ ...t,
296
+ searchText: n.join(" ").toLowerCase()
297
+ };
298
+ });
299
+ }
300
+ var ze = { exports: {} }, Cn = ze.exports, yt;
301
+ function Rn() {
302
+ return yt || (yt = 1, (function(e) {
303
+ ((t, n) => {
304
+ e.exports ? e.exports = n() : t.fuzzysort = n();
305
+ })(Cn, (t) => {
306
+ var n = (l, u) => {
307
+ if (!l || !u) return H;
308
+ var v = $(l);
309
+ le(u) || (u = _(u));
310
+ var p = v.bitflags;
311
+ return (p & u._bitflags) !== p ? H : R(v, u);
312
+ }, r = (l, u, v) => {
313
+ if (!l) return v?.all ? g(u, v) : Ce;
314
+ var p = $(l), w = p.bitflags, x = p.containsSpace, m = y(v?.threshold || 0), N = v?.limit || _e, S = 0, k = 0, I = u.length;
315
+ function ae(Ee) {
316
+ S < N ? (U.add(Ee), ++S) : (++k, Ee._score > U.peek()._score && U.replaceTop(Ee));
317
+ }
318
+ if (v?.key)
319
+ for (var Q = v.key, L = 0; L < I; ++L) {
320
+ var re = u[L], F = me(re, Q);
321
+ if (F && (le(F) || (F = _(F)), (w & F._bitflags) === w)) {
322
+ var z = R(p, F);
323
+ z !== H && (z._score < m || (z.obj = re, ae(z)));
324
+ }
325
+ }
326
+ else if (v?.keys) {
327
+ var he = v.keys, ce = he.length;
328
+ e: for (var L = 0; L < I; ++L) {
329
+ var re = u[L];
330
+ {
331
+ for (var ee = 0, D = 0; D < ce; ++D) {
332
+ var Q = he[D], F = me(re, Q);
333
+ if (!F) {
334
+ Se[D] = f;
335
+ continue;
336
+ }
337
+ le(F) || (F = _(F)), Se[D] = F, ee |= F._bitflags;
338
+ }
339
+ if ((w & ee) !== w) continue;
340
+ }
341
+ if (x) for (let W = 0; W < p.spaceSearches.length; W++) Z[W] = J;
342
+ for (var D = 0; D < ce; ++D) {
343
+ if (F = Se[D], F === f) {
344
+ pe[D] = f;
345
+ continue;
346
+ }
347
+ if (pe[D] = R(
348
+ p,
349
+ F,
350
+ /*allowSpaces=*/
351
+ !1,
352
+ /*allowPartialMatch=*/
353
+ x
354
+ ), pe[D] === H) {
355
+ pe[D] = f;
356
+ continue;
357
+ }
358
+ if (x) for (let V = 0; V < p.spaceSearches.length; V++) {
359
+ if (oe[V] > -1e3 && Z[V] > J) {
360
+ var q = (Z[V] + oe[V]) / 4;
361
+ q > Z[V] && (Z[V] = q);
362
+ }
363
+ oe[V] > Z[V] && (Z[V] = oe[V]);
364
+ }
365
+ }
366
+ if (x) {
367
+ for (let W = 0; W < p.spaceSearches.length; W++)
368
+ if (Z[W] === J) continue e;
369
+ } else {
370
+ var O = !1;
371
+ for (let W = 0; W < ce; W++)
372
+ if (pe[W]._score !== J) {
373
+ O = !0;
374
+ break;
375
+ }
376
+ if (!O) continue;
377
+ }
378
+ var se = new h(ce);
379
+ for (let W = 0; W < ce; W++)
380
+ se[W] = pe[W];
381
+ if (x) {
382
+ var K = 0;
383
+ for (let W = 0; W < p.spaceSearches.length; W++) K += Z[W];
384
+ } else {
385
+ var K = J;
386
+ for (let V = 0; V < ce; V++) {
387
+ var z = se[V];
388
+ if (z._score > -1e3 && K > J) {
389
+ var q = (K + z._score) / 4;
390
+ q > K && (K = q);
391
+ }
392
+ z._score > K && (K = z._score);
393
+ }
394
+ }
395
+ if (se.obj = re, se._score = K, v?.scoreFn) {
396
+ if (K = v.scoreFn(se), !K) continue;
397
+ K = y(K), se._score = K;
398
+ }
399
+ K < m || ae(se);
400
+ }
401
+ } else
402
+ for (var L = 0; L < I; ++L) {
403
+ var F = u[L];
404
+ if (F && (le(F) || (F = _(F)), (w & F._bitflags) === w)) {
405
+ var z = R(p, F);
406
+ z !== H && (z._score < m || ae(z));
407
+ }
408
+ }
409
+ if (S === 0) return Ce;
410
+ for (var ge = new Array(S), L = S - 1; L >= 0; --L) ge[L] = U.poll();
411
+ return ge.total = S + k, ge;
412
+ }, o = (l, u = "<b>", v = "</b>") => {
413
+ for (var p = typeof u == "function" ? u : void 0, w = l.target, x = w.length, m = l.indexes, N = "", S = 0, k = 0, I = !1, ae = [], Q = 0; Q < x; ++Q) {
414
+ var L = w[Q];
415
+ if (m[k] === Q) {
416
+ if (++k, I || (I = !0, p ? (ae.push(N), N = "") : N += u), k === m.length) {
417
+ p ? (N += L, ae.push(p(N, S++)), N = "", ae.push(w.substr(Q + 1))) : N += L + v + w.substr(Q + 1);
418
+ break;
419
+ }
420
+ } else
421
+ I && (I = !1, p ? (ae.push(p(N, S++)), N = "") : N += v);
422
+ N += L;
423
+ }
424
+ return p ? ae : N;
425
+ }, a = (l) => {
426
+ typeof l == "number" ? l = "" + l : typeof l != "string" && (l = "");
427
+ var u = M(l);
428
+ return d(l, { _targetLower: u._lower, _targetLowerCodes: u.lowerCodes, _bitflags: u.bitflags });
429
+ }, c = () => {
430
+ X.clear(), A.clear();
431
+ };
432
+ class s {
433
+ get indexes() {
434
+ return this._indexes.slice(0, this._indexes.len).sort((u, v) => u - v);
435
+ }
436
+ set indexes(u) {
437
+ return this._indexes = u;
438
+ }
439
+ highlight(u, v) {
440
+ return o(this, u, v);
441
+ }
442
+ get score() {
443
+ return E(this._score);
444
+ }
445
+ set score(u) {
446
+ this._score = y(u);
447
+ }
448
+ }
449
+ class h extends Array {
450
+ get score() {
451
+ return E(this._score);
452
+ }
453
+ set score(u) {
454
+ this._score = y(u);
455
+ }
456
+ }
457
+ var d = (l, u) => {
458
+ const v = new s();
459
+ return v.target = l, v.obj = u.obj ?? H, v._score = u._score ?? J, v._indexes = u._indexes ?? [], v._targetLower = u._targetLower ?? "", v._targetLowerCodes = u._targetLowerCodes ?? H, v._nextBeginningIndexes = u._nextBeginningIndexes ?? H, v._bitflags = u._bitflags ?? 0, v;
460
+ }, E = (l) => l === J ? 0 : l > 1 ? l : Math.E ** (((-l + 1) ** 0.04307 - 1) * -2), y = (l) => l === 0 ? J : l > 1 ? l : 1 - Math.pow(Math.log(l) / -2 + 1, 1 / 0.04307), C = (l) => {
461
+ typeof l == "number" ? l = "" + l : typeof l != "string" && (l = ""), l = l.trim();
462
+ var u = M(l), v = [];
463
+ if (u.containsSpace) {
464
+ var p = l.split(/\s+/);
465
+ p = [...new Set(p)];
466
+ for (var w = 0; w < p.length; w++)
467
+ if (p[w] !== "") {
468
+ var x = M(p[w]);
469
+ v.push({ lowerCodes: x.lowerCodes, _lower: p[w].toLowerCase(), containsSpace: !1 });
470
+ }
471
+ }
472
+ return { lowerCodes: u.lowerCodes, _lower: u._lower, containsSpace: u.containsSpace, bitflags: u.bitflags, spaceSearches: v };
473
+ }, _ = (l) => {
474
+ if (l.length > 999) return a(l);
475
+ var u = X.get(l);
476
+ return u !== void 0 || (u = a(l), X.set(l, u)), u;
477
+ }, $ = (l) => {
478
+ if (l.length > 999) return C(l);
479
+ var u = A.get(l);
480
+ return u !== void 0 || (u = C(l), A.set(l, u)), u;
481
+ }, g = (l, u) => {
482
+ var v = [];
483
+ v.total = l.length;
484
+ var p = u?.limit || _e;
485
+ if (u?.key)
486
+ for (var w = 0; w < l.length; w++) {
487
+ var x = l[w], m = me(x, u.key);
488
+ if (m != H) {
489
+ le(m) || (m = _(m));
490
+ var N = d(m.target, { _score: m._score, obj: x });
491
+ if (v.push(N), v.length >= p) return v;
492
+ }
493
+ }
494
+ else if (u?.keys)
495
+ for (var w = 0; w < l.length; w++) {
496
+ for (var x = l[w], S = new h(u.keys.length), k = u.keys.length - 1; k >= 0; --k) {
497
+ var m = me(x, u.keys[k]);
498
+ if (!m) {
499
+ S[k] = f;
500
+ continue;
501
+ }
502
+ le(m) || (m = _(m)), m._score = J, m._indexes.len = 0, S[k] = m;
503
+ }
504
+ if (S.obj = x, S._score = J, v.push(S), v.length >= p) return v;
505
+ }
506
+ else
507
+ for (var w = 0; w < l.length; w++) {
508
+ var m = l[w];
509
+ if (m != H && (le(m) || (m = _(m)), m._score = J, m._indexes.len = 0, v.push(m), v.length >= p))
510
+ return v;
511
+ }
512
+ return v;
513
+ }, R = (l, u, v = !1, p = !1) => {
514
+ if (v === !1 && l.containsSpace) return T(l, u, p);
515
+ for (var w = l._lower, x = l.lowerCodes, m = x[0], N = u._targetLowerCodes, S = x.length, k = N.length, L = 0, I = 0, ae = 0; ; ) {
516
+ var Q = m === N[I];
517
+ if (Q) {
518
+ if (G[ae++] = I, ++L, L === S) break;
519
+ m = x[L];
520
+ }
521
+ if (++I, I >= k) return H;
522
+ }
523
+ var L = 0, re = !1, F = 0, z = u._nextBeginningIndexes;
524
+ z === H && (z = u._nextBeginningIndexes = Y(u.target)), I = G[0] === 0 ? 0 : z[G[0] - 1];
525
+ var he = 0;
526
+ if (I !== k) for (; ; )
527
+ if (I >= k) {
528
+ if (L <= 0 || (++he, he > 200)) break;
529
+ --L;
530
+ var ce = ne[--F];
531
+ I = z[ce];
532
+ } else {
533
+ var Q = x[L] === N[I];
534
+ if (Q) {
535
+ if (ne[F++] = I, ++L, L === S) {
536
+ re = !0;
537
+ break;
538
+ }
539
+ ++I;
540
+ } else
541
+ I = z[I];
542
+ }
543
+ var ee = S <= 1 ? -1 : u._targetLower.indexOf(w, G[0]), D = !!~ee, q = D ? ee === 0 || u._nextBeginningIndexes[ee - 1] === ee : !1;
544
+ if (D && !q) {
545
+ for (var O = 0; O < z.length; O = z[O])
546
+ if (!(O <= ee)) {
547
+ for (var se = 0; se < S && x[se] === u._targetLowerCodes[O + se]; se++) ;
548
+ if (se === S) {
549
+ ee = O, q = !0;
550
+ break;
551
+ }
552
+ }
553
+ }
554
+ var K = (W) => {
555
+ for (var V = 0, dt = 0, de = 1; de < S; ++de)
556
+ W[de] - W[de - 1] !== 1 && (V -= W[de], ++dt);
557
+ var dn = W[S - 1] - W[0] - (S - 1);
558
+ if (V -= (12 + dn) * dt, W[0] !== 0 && (V -= W[0] * W[0] * 0.2), !re)
559
+ V *= 1e3;
560
+ else {
561
+ for (var Ze = 1, de = z[0]; de < k; de = z[de]) ++Ze;
562
+ Ze > 24 && (V *= (Ze - 24) * 10);
563
+ }
564
+ return V -= (k - S) / 2, D && (V /= 1 + S * S * 1), q && (V /= 1 + S * S * 1), V -= (k - S) / 2, V;
565
+ };
566
+ if (re)
567
+ if (q) {
568
+ for (var O = 0; O < S; ++O) G[O] = ee + O;
569
+ var ge = G, Ee = K(G);
570
+ } else
571
+ var ge = ne, Ee = K(ne);
572
+ else {
573
+ if (D) for (var O = 0; O < S; ++O) G[O] = ee + O;
574
+ var ge = G, Ee = K(ge);
575
+ }
576
+ u._score = Ee;
577
+ for (var O = 0; O < S; ++O) u._indexes[O] = ge[O];
578
+ u._indexes.len = S;
579
+ const je = new s();
580
+ return je.target = u.target, je._score = u._score, je._indexes = u._indexes, je;
581
+ }, T = (l, u, v) => {
582
+ for (var p = /* @__PURE__ */ new Set(), w = 0, x = H, m = 0, N = l.spaceSearches, S = N.length, k = 0, I = () => {
583
+ for (let q = k - 1; q >= 0; q--) u._nextBeginningIndexes[ie[q * 2 + 0]] = ie[q * 2 + 1];
584
+ }, ae = !1, D = 0; D < S; ++D) {
585
+ oe[D] = J;
586
+ var Q = N[D];
587
+ if (x = R(Q, u), v) {
588
+ if (x === H) continue;
589
+ ae = !0;
590
+ } else if (x === H)
591
+ return I(), H;
592
+ var L = D === S - 1;
593
+ if (!L) {
594
+ var re = x._indexes, F = !0;
595
+ for (let O = 0; O < re.len - 1; O++)
596
+ if (re[O + 1] - re[O] !== 1) {
597
+ F = !1;
598
+ break;
599
+ }
600
+ if (F) {
601
+ var z = re[re.len - 1] + 1, he = u._nextBeginningIndexes[z - 1];
602
+ for (let O = z - 1; O >= 0 && he === u._nextBeginningIndexes[O]; O--)
603
+ u._nextBeginningIndexes[O] = z, ie[k * 2 + 0] = O, ie[k * 2 + 1] = he, k++;
604
+ }
605
+ }
606
+ w += x._score / S, oe[D] = x._score / S, x._indexes[0] < m && (w -= (m - x._indexes[0]) * 2), m = x._indexes[0];
607
+ for (var ce = 0; ce < x._indexes.len; ++ce) p.add(x._indexes[ce]);
608
+ }
609
+ if (v && !ae) return H;
610
+ I();
611
+ var ee = R(
612
+ l,
613
+ u,
614
+ /*allowSpaces=*/
615
+ !0
616
+ );
617
+ if (ee !== H && ee._score > w) {
618
+ if (v)
619
+ for (var D = 0; D < S; ++D)
620
+ oe[D] = ee._score / S;
621
+ return ee;
622
+ }
623
+ v && (x = u), x._score = w;
624
+ var D = 0;
625
+ for (let q of p) x._indexes[D++] = q;
626
+ return x._indexes.len = D, x;
627
+ }, j = (l) => l.replace(new RegExp("\\p{Script=Latin}+", "gu"), (u) => u.normalize("NFD")).replace(/[\u0300-\u036f]/g, ""), M = (l) => {
628
+ l = j(l);
629
+ for (var u = l.length, v = l.toLowerCase(), p = [], w = 0, x = !1, m = 0; m < u; ++m) {
630
+ var N = p[m] = v.charCodeAt(m);
631
+ if (N === 32) {
632
+ x = !0;
633
+ continue;
634
+ }
635
+ var S = N >= 97 && N <= 122 ? N - 97 : N >= 48 && N <= 57 ? 26 : N <= 127 ? 30 : 31;
636
+ w |= 1 << S;
637
+ }
638
+ return { lowerCodes: p, bitflags: w, containsSpace: x, _lower: v };
639
+ }, B = (l) => {
640
+ for (var u = l.length, v = [], p = 0, w = !1, x = !1, m = 0; m < u; ++m) {
641
+ var N = l.charCodeAt(m), S = N >= 65 && N <= 90, k = S || N >= 97 && N <= 122 || N >= 48 && N <= 57, I = S && !w || !x || !k;
642
+ w = S, x = k, I && (v[p++] = m);
643
+ }
644
+ return v;
645
+ }, Y = (l) => {
646
+ l = j(l);
647
+ for (var u = l.length, v = B(l), p = [], w = v[0], x = 0, m = 0; m < u; ++m)
648
+ w > m ? p[m] = w : (w = v[++x], p[m] = w === void 0 ? u : w);
649
+ return p;
650
+ }, X = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map(), G = [], ne = [], ie = [], Z = [], oe = [], Se = [], pe = [], me = (l, u) => {
651
+ var v = l[u];
652
+ if (v !== void 0) return v;
653
+ if (typeof u == "function") return u(l);
654
+ var p = u;
655
+ Array.isArray(u) || (p = u.split("."));
656
+ for (var w = p.length, x = -1; l && ++x < w; ) l = l[p[x]];
657
+ return l;
658
+ }, le = (l) => typeof l == "object" && typeof l._bitflags == "number", _e = 1 / 0, J = -_e, Ce = [];
659
+ Ce.total = 0;
660
+ var H = null, f = a(""), P = (l) => {
661
+ var u = [], v = 0, p = {}, w = (x) => {
662
+ for (var m = 0, N = u[m], S = 1; S < v; ) {
663
+ var k = S + 1;
664
+ m = S, k < v && u[k]._score < u[S]._score && (m = k), u[m - 1 >> 1] = u[m], S = 1 + (m << 1);
665
+ }
666
+ for (var I = m - 1 >> 1; m > 0 && N._score < u[I]._score; I = (m = I) - 1 >> 1) u[m] = u[I];
667
+ u[m] = N;
668
+ };
669
+ return p.add = ((x) => {
670
+ var m = v;
671
+ u[v++] = x;
672
+ for (var N = m - 1 >> 1; m > 0 && x._score < u[N]._score; N = (m = N) - 1 >> 1) u[m] = u[N];
673
+ u[m] = x;
674
+ }), p.poll = ((x) => {
675
+ if (v !== 0) {
676
+ var m = u[0];
677
+ return u[0] = u[--v], w(), m;
678
+ }
679
+ }), p.peek = ((x) => {
680
+ if (v !== 0) return u[0];
681
+ }), p.replaceTop = ((x) => {
682
+ u[0] = x, w();
683
+ }), p;
684
+ }, U = P();
685
+ return { single: n, go: r, prepare: a, cleanup: c };
686
+ });
687
+ })(ze)), ze.exports;
688
+ }
689
+ var Nn = Rn();
690
+ const Pn = /* @__PURE__ */ hn(Nn);
691
+ function On(e, t) {
692
+ return t.trim() ? Pn.go(t, e, {
693
+ key: "searchText",
694
+ threshold: -1e3
695
+ }).map((r) => ({
696
+ item: r.obj,
697
+ indexes: r.indexes
698
+ })) : e.map((r) => ({
699
+ item: r,
700
+ indexes: null
701
+ }));
702
+ }
703
+ async function Tn(e) {
704
+ try {
705
+ await e.run();
706
+ } catch (t) {
707
+ console.error(`[command-palette] Command failed: ${e.id}`, t);
708
+ }
709
+ }
710
+ const te = Sn((e, t) => ({
711
+ commands: [],
712
+ normalized: [],
713
+ results: [],
714
+ query: "",
715
+ isOpen: !1,
716
+ selectedIndex: 0,
717
+ registerCommands: (n) => {
718
+ const r = _n(n);
719
+ e({
720
+ commands: n,
721
+ normalized: r,
722
+ results: r.map((o) => ({
723
+ item: o,
724
+ indexes: null
725
+ })),
726
+ selectedIndex: 0
727
+ });
728
+ },
729
+ setQuery: (n) => {
730
+ const { normalized: r } = t(), o = On(r, n);
731
+ e({
732
+ query: n,
733
+ results: o,
734
+ selectedIndex: 0
735
+ });
736
+ },
737
+ selectNext: () => {
738
+ const { selectedIndex: n, results: r } = t();
739
+ e({
740
+ selectedIndex: r.length === 0 ? 0 : (n + 1) % r.length
741
+ });
742
+ },
743
+ selectPrev: () => {
744
+ const { selectedIndex: n, results: r } = t();
745
+ e({
746
+ selectedIndex: r.length === 0 ? 0 : (n - 1 + r.length) % r.length
747
+ });
748
+ },
749
+ selectFirst: () => e({ selectedIndex: 0 }),
750
+ open: () => e({ isOpen: !0 }),
751
+ close: () => e({
752
+ isOpen: !1,
753
+ query: "",
754
+ selectedIndex: 0
755
+ })
756
+ }));
757
+ function An(e) {
758
+ Te(() => {
759
+ const t = (n) => {
760
+ const r = n.key.toLowerCase() === "k";
761
+ if (navigator.platform.startsWith("Mac")) {
762
+ n.metaKey && r && (n.preventDefault(), e());
763
+ return;
764
+ }
765
+ n.ctrlKey && r && (n.preventDefault(), e());
766
+ };
767
+ return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
768
+ }, [e]);
769
+ }
770
+ function be(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
771
+ return function(o) {
772
+ if (e?.(o), n === !1 || !o.defaultPrevented)
773
+ return t?.(o);
774
+ };
775
+ }
776
+ function bt(e, t) {
777
+ if (typeof e == "function")
778
+ return e(t);
779
+ e != null && (e.current = t);
780
+ }
781
+ function ct(...e) {
782
+ return (t) => {
783
+ let n = !1;
784
+ const r = e.map((o) => {
785
+ const a = bt(o, t);
786
+ return !n && typeof a == "function" && (n = !0), a;
787
+ });
788
+ if (n)
789
+ return () => {
790
+ for (let o = 0; o < r.length; o++) {
791
+ const a = r[o];
792
+ typeof a == "function" ? a() : bt(e[o], null);
793
+ }
794
+ };
795
+ };
796
+ }
797
+ function we(...e) {
798
+ return i.useCallback(ct(...e), e);
799
+ }
800
+ function In(e, t) {
801
+ const n = i.createContext(t), r = (a) => {
802
+ const { children: c, ...s } = a, h = i.useMemo(() => s, Object.values(s));
803
+ return /* @__PURE__ */ b.jsx(n.Provider, { value: h, children: c });
804
+ };
805
+ r.displayName = e + "Provider";
806
+ function o(a) {
807
+ const c = i.useContext(n);
808
+ if (c) return c;
809
+ if (t !== void 0) return t;
810
+ throw new Error(`\`${a}\` must be used within \`${e}\``);
811
+ }
812
+ return [r, o];
813
+ }
814
+ function Dn(e, t = []) {
815
+ let n = [];
816
+ function r(a, c) {
817
+ const s = i.createContext(c), h = n.length;
818
+ n = [...n, c];
819
+ const d = (y) => {
820
+ const { scope: C, children: _, ...$ } = y, g = C?.[e]?.[h] || s, R = i.useMemo(() => $, Object.values($));
821
+ return /* @__PURE__ */ b.jsx(g.Provider, { value: R, children: _ });
822
+ };
823
+ d.displayName = a + "Provider";
824
+ function E(y, C) {
825
+ const _ = C?.[e]?.[h] || s, $ = i.useContext(_);
826
+ if ($) return $;
827
+ if (c !== void 0) return c;
828
+ throw new Error(`\`${y}\` must be used within \`${a}\``);
829
+ }
830
+ return [d, E];
831
+ }
832
+ const o = () => {
833
+ const a = n.map((c) => i.createContext(c));
834
+ return function(s) {
835
+ const h = s?.[e] || a;
836
+ return i.useMemo(
837
+ () => ({ [`__scope${e}`]: { ...s, [e]: h } }),
838
+ [s, h]
839
+ );
840
+ };
841
+ };
842
+ return o.scopeName = e, [r, kn(o, ...t)];
843
+ }
844
+ function kn(...e) {
845
+ const t = e[0];
846
+ if (e.length === 1) return t;
847
+ const n = () => {
848
+ const r = e.map((o) => ({
849
+ useScope: o(),
850
+ scopeName: o.scopeName
851
+ }));
852
+ return function(a) {
853
+ const c = r.reduce((s, { useScope: h, scopeName: d }) => {
854
+ const y = h(a)[`__scope${d}`];
855
+ return { ...s, ...y };
856
+ }, {});
857
+ return i.useMemo(() => ({ [`__scope${t.scopeName}`]: c }), [c]);
858
+ };
859
+ };
860
+ return n.scopeName = t.scopeName, n;
861
+ }
862
+ var ke = globalThis?.document ? i.useLayoutEffect : () => {
863
+ }, Ln = i[" useId ".trim().toString()] || (() => {
864
+ }), jn = 0;
865
+ function Je(e) {
866
+ const [t, n] = i.useState(Ln());
867
+ return ke(() => {
868
+ n((r) => r ?? String(jn++));
869
+ }, [e]), e || (t ? `radix-${t}` : "");
870
+ }
871
+ var Mn = i[" useInsertionEffect ".trim().toString()] || ke;
872
+ function Fn({
873
+ prop: e,
874
+ defaultProp: t,
875
+ onChange: n = () => {
876
+ },
877
+ caller: r
878
+ }) {
879
+ const [o, a, c] = Wn({
880
+ defaultProp: t,
881
+ onChange: n
882
+ }), s = e !== void 0, h = s ? e : o;
883
+ {
884
+ const E = i.useRef(e !== void 0);
885
+ i.useEffect(() => {
886
+ const y = E.current;
887
+ y !== s && console.warn(
888
+ `${r} is changing from ${y ? "controlled" : "uncontrolled"} to ${s ? "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.`
889
+ ), E.current = s;
890
+ }, [s, r]);
891
+ }
892
+ const d = i.useCallback(
893
+ (E) => {
894
+ if (s) {
895
+ const y = $n(E) ? E(e) : E;
896
+ y !== e && c.current?.(y);
897
+ } else
898
+ a(E);
899
+ },
900
+ [s, e, a, c]
901
+ );
902
+ return [h, d];
903
+ }
904
+ function Wn({
905
+ defaultProp: e,
906
+ onChange: t
907
+ }) {
908
+ const [n, r] = i.useState(e), o = i.useRef(n), a = i.useRef(t);
909
+ return Mn(() => {
910
+ a.current = t;
911
+ }, [t]), i.useEffect(() => {
912
+ o.current !== n && (a.current?.(n), o.current = n);
913
+ }, [n, o]), [n, r, a];
914
+ }
915
+ function $n(e) {
916
+ return typeof e == "function";
917
+ }
918
+ // @__NO_SIDE_EFFECTS__
919
+ function Dt(e) {
920
+ const t = /* @__PURE__ */ Bn(e), n = i.forwardRef((r, o) => {
921
+ const { children: a, ...c } = r, s = i.Children.toArray(a), h = s.find(zn);
922
+ if (h) {
923
+ const d = h.props.children, E = s.map((y) => y === h ? i.Children.count(d) > 1 ? i.Children.only(null) : i.isValidElement(d) ? d.props.children : null : y);
924
+ return /* @__PURE__ */ b.jsx(t, { ...c, ref: o, children: i.isValidElement(d) ? i.cloneElement(d, void 0, E) : null });
925
+ }
926
+ return /* @__PURE__ */ b.jsx(t, { ...c, ref: o, children: a });
927
+ });
928
+ return n.displayName = `${e}.Slot`, n;
929
+ }
930
+ // @__NO_SIDE_EFFECTS__
931
+ function Bn(e) {
932
+ const t = i.forwardRef((n, r) => {
933
+ const { children: o, ...a } = n;
934
+ if (i.isValidElement(o)) {
935
+ const c = Yn(o), s = Vn(a, o.props);
936
+ return o.type !== i.Fragment && (s.ref = r ? ct(r, c) : c), i.cloneElement(o, s);
937
+ }
938
+ return i.Children.count(o) > 1 ? i.Children.only(null) : null;
939
+ });
940
+ return t.displayName = `${e}.SlotClone`, t;
941
+ }
942
+ var Un = /* @__PURE__ */ Symbol("radix.slottable");
943
+ function zn(e) {
944
+ return i.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Un;
945
+ }
946
+ function Vn(e, t) {
947
+ const n = { ...t };
948
+ for (const r in t) {
949
+ const o = e[r], a = t[r];
950
+ /^on[A-Z]/.test(r) ? o && a ? n[r] = (...s) => {
951
+ const h = a(...s);
952
+ return o(...s), h;
953
+ } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...a } : r === "className" && (n[r] = [o, a].filter(Boolean).join(" "));
954
+ }
955
+ return { ...e, ...n };
956
+ }
957
+ function Yn(e) {
958
+ let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
959
+ 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);
960
+ }
961
+ var Hn = [
962
+ "a",
963
+ "button",
964
+ "div",
965
+ "form",
966
+ "h2",
967
+ "h3",
968
+ "img",
969
+ "input",
970
+ "label",
971
+ "li",
972
+ "nav",
973
+ "ol",
974
+ "p",
975
+ "select",
976
+ "span",
977
+ "svg",
978
+ "ul"
979
+ ], ve = Hn.reduce((e, t) => {
980
+ const n = /* @__PURE__ */ Dt(`Primitive.${t}`), r = i.forwardRef((o, a) => {
981
+ const { asChild: c, ...s } = o, h = c ? n : t;
982
+ return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ b.jsx(h, { ...s, ref: a });
983
+ });
984
+ return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
985
+ }, {});
986
+ function Gn(e, t) {
987
+ e && pn.flushSync(() => e.dispatchEvent(t));
988
+ }
989
+ function Le(e) {
990
+ const t = i.useRef(e);
991
+ return i.useEffect(() => {
992
+ t.current = e;
993
+ }), i.useMemo(() => (...n) => t.current?.(...n), []);
994
+ }
995
+ function Kn(e, t = globalThis?.document) {
996
+ const n = Le(e);
997
+ i.useEffect(() => {
998
+ const r = (o) => {
999
+ o.key === "Escape" && n(o);
1000
+ };
1001
+ return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
1002
+ }, [n, t]);
1003
+ }
1004
+ var Xn = "DismissableLayer", st = "dismissableLayer.update", qn = "dismissableLayer.pointerDownOutside", Zn = "dismissableLayer.focusOutside", Et, kt = i.createContext({
1005
+ layers: /* @__PURE__ */ new Set(),
1006
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
1007
+ branches: /* @__PURE__ */ new Set()
1008
+ }), Lt = i.forwardRef(
1009
+ (e, t) => {
1010
+ const {
1011
+ disableOutsidePointerEvents: n = !1,
1012
+ onEscapeKeyDown: r,
1013
+ onPointerDownOutside: o,
1014
+ onFocusOutside: a,
1015
+ onInteractOutside: c,
1016
+ onDismiss: s,
1017
+ ...h
1018
+ } = e, d = i.useContext(kt), [E, y] = i.useState(null), C = E?.ownerDocument ?? globalThis?.document, [, _] = i.useState({}), $ = we(t, (A) => y(A)), g = Array.from(d.layers), [R] = [...d.layersWithOutsidePointerEventsDisabled].slice(-1), T = g.indexOf(R), j = E ? g.indexOf(E) : -1, M = d.layersWithOutsidePointerEventsDisabled.size > 0, B = j >= T, Y = er((A) => {
1019
+ const G = A.target, ne = [...d.branches].some((ie) => ie.contains(G));
1020
+ !B || ne || (o?.(A), c?.(A), A.defaultPrevented || s?.());
1021
+ }, C), X = tr((A) => {
1022
+ const G = A.target;
1023
+ [...d.branches].some((ie) => ie.contains(G)) || (a?.(A), c?.(A), A.defaultPrevented || s?.());
1024
+ }, C);
1025
+ return Kn((A) => {
1026
+ j === d.layers.size - 1 && (r?.(A), !A.defaultPrevented && s && (A.preventDefault(), s()));
1027
+ }, C), i.useEffect(() => {
1028
+ if (E)
1029
+ return n && (d.layersWithOutsidePointerEventsDisabled.size === 0 && (Et = C.body.style.pointerEvents, C.body.style.pointerEvents = "none"), d.layersWithOutsidePointerEventsDisabled.add(E)), d.layers.add(E), xt(), () => {
1030
+ n && d.layersWithOutsidePointerEventsDisabled.size === 1 && (C.body.style.pointerEvents = Et);
1031
+ };
1032
+ }, [E, C, n, d]), i.useEffect(() => () => {
1033
+ E && (d.layers.delete(E), d.layersWithOutsidePointerEventsDisabled.delete(E), xt());
1034
+ }, [E, d]), i.useEffect(() => {
1035
+ const A = () => _({});
1036
+ return document.addEventListener(st, A), () => document.removeEventListener(st, A);
1037
+ }, []), /* @__PURE__ */ b.jsx(
1038
+ ve.div,
1039
+ {
1040
+ ...h,
1041
+ ref: $,
1042
+ style: {
1043
+ pointerEvents: M ? B ? "auto" : "none" : void 0,
1044
+ ...e.style
1045
+ },
1046
+ onFocusCapture: be(e.onFocusCapture, X.onFocusCapture),
1047
+ onBlurCapture: be(e.onBlurCapture, X.onBlurCapture),
1048
+ onPointerDownCapture: be(
1049
+ e.onPointerDownCapture,
1050
+ Y.onPointerDownCapture
1051
+ )
1052
+ }
1053
+ );
1054
+ }
1055
+ );
1056
+ Lt.displayName = Xn;
1057
+ var Jn = "DismissableLayerBranch", Qn = i.forwardRef((e, t) => {
1058
+ const n = i.useContext(kt), r = i.useRef(null), o = we(t, r);
1059
+ return i.useEffect(() => {
1060
+ const a = r.current;
1061
+ if (a)
1062
+ return n.branches.add(a), () => {
1063
+ n.branches.delete(a);
1064
+ };
1065
+ }, [n.branches]), /* @__PURE__ */ b.jsx(ve.div, { ...e, ref: o });
1066
+ });
1067
+ Qn.displayName = Jn;
1068
+ function er(e, t = globalThis?.document) {
1069
+ const n = Le(e), r = i.useRef(!1), o = i.useRef(() => {
1070
+ });
1071
+ return i.useEffect(() => {
1072
+ const a = (s) => {
1073
+ if (s.target && !r.current) {
1074
+ let h = function() {
1075
+ jt(
1076
+ qn,
1077
+ n,
1078
+ d,
1079
+ { discrete: !0 }
1080
+ );
1081
+ };
1082
+ const d = { originalEvent: s };
1083
+ s.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = h, t.addEventListener("click", o.current, { once: !0 })) : h();
1084
+ } else
1085
+ t.removeEventListener("click", o.current);
1086
+ r.current = !1;
1087
+ }, c = window.setTimeout(() => {
1088
+ t.addEventListener("pointerdown", a);
1089
+ }, 0);
1090
+ return () => {
1091
+ window.clearTimeout(c), t.removeEventListener("pointerdown", a), t.removeEventListener("click", o.current);
1092
+ };
1093
+ }, [t, n]), {
1094
+ // ensures we check React component tree (not just DOM tree)
1095
+ onPointerDownCapture: () => r.current = !0
1096
+ };
1097
+ }
1098
+ function tr(e, t = globalThis?.document) {
1099
+ const n = Le(e), r = i.useRef(!1);
1100
+ return i.useEffect(() => {
1101
+ const o = (a) => {
1102
+ a.target && !r.current && jt(Zn, n, { originalEvent: a }, {
1103
+ discrete: !1
1104
+ });
1105
+ };
1106
+ return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
1107
+ }, [t, n]), {
1108
+ onFocusCapture: () => r.current = !0,
1109
+ onBlurCapture: () => r.current = !1
1110
+ };
1111
+ }
1112
+ function xt() {
1113
+ const e = new CustomEvent(st);
1114
+ document.dispatchEvent(e);
1115
+ }
1116
+ function jt(e, t, n, { discrete: r }) {
1117
+ const o = n.originalEvent.target, a = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
1118
+ t && o.addEventListener(e, t, { once: !0 }), r ? Gn(o, a) : o.dispatchEvent(a);
1119
+ }
1120
+ var Qe = "focusScope.autoFocusOnMount", et = "focusScope.autoFocusOnUnmount", wt = { bubbles: !1, cancelable: !0 }, nr = "FocusScope", Mt = i.forwardRef((e, t) => {
1121
+ const {
1122
+ loop: n = !1,
1123
+ trapped: r = !1,
1124
+ onMountAutoFocus: o,
1125
+ onUnmountAutoFocus: a,
1126
+ ...c
1127
+ } = e, [s, h] = i.useState(null), d = Le(o), E = Le(a), y = i.useRef(null), C = we(t, (g) => h(g)), _ = i.useRef({
1128
+ paused: !1,
1129
+ pause() {
1130
+ this.paused = !0;
1131
+ },
1132
+ resume() {
1133
+ this.paused = !1;
1134
+ }
1135
+ }).current;
1136
+ i.useEffect(() => {
1137
+ if (r) {
1138
+ let g = function(M) {
1139
+ if (_.paused || !s) return;
1140
+ const B = M.target;
1141
+ s.contains(B) ? y.current = B : ye(y.current, { select: !0 });
1142
+ }, R = function(M) {
1143
+ if (_.paused || !s) return;
1144
+ const B = M.relatedTarget;
1145
+ B !== null && (s.contains(B) || ye(y.current, { select: !0 }));
1146
+ }, T = function(M) {
1147
+ if (document.activeElement === document.body)
1148
+ for (const Y of M)
1149
+ Y.removedNodes.length > 0 && ye(s);
1150
+ };
1151
+ document.addEventListener("focusin", g), document.addEventListener("focusout", R);
1152
+ const j = new MutationObserver(T);
1153
+ return s && j.observe(s, { childList: !0, subtree: !0 }), () => {
1154
+ document.removeEventListener("focusin", g), document.removeEventListener("focusout", R), j.disconnect();
1155
+ };
1156
+ }
1157
+ }, [r, s, _.paused]), i.useEffect(() => {
1158
+ if (s) {
1159
+ _t.add(_);
1160
+ const g = document.activeElement;
1161
+ if (!s.contains(g)) {
1162
+ const T = new CustomEvent(Qe, wt);
1163
+ s.addEventListener(Qe, d), s.dispatchEvent(T), T.defaultPrevented || (rr(cr(Ft(s)), { select: !0 }), document.activeElement === g && ye(s));
1164
+ }
1165
+ return () => {
1166
+ s.removeEventListener(Qe, d), setTimeout(() => {
1167
+ const T = new CustomEvent(et, wt);
1168
+ s.addEventListener(et, E), s.dispatchEvent(T), T.defaultPrevented || ye(g ?? document.body, { select: !0 }), s.removeEventListener(et, E), _t.remove(_);
1169
+ }, 0);
1170
+ };
1171
+ }
1172
+ }, [s, d, E, _]);
1173
+ const $ = i.useCallback(
1174
+ (g) => {
1175
+ if (!n && !r || _.paused) return;
1176
+ const R = g.key === "Tab" && !g.altKey && !g.ctrlKey && !g.metaKey, T = document.activeElement;
1177
+ if (R && T) {
1178
+ const j = g.currentTarget, [M, B] = or(j);
1179
+ M && B ? !g.shiftKey && T === B ? (g.preventDefault(), n && ye(M, { select: !0 })) : g.shiftKey && T === M && (g.preventDefault(), n && ye(B, { select: !0 })) : T === j && g.preventDefault();
1180
+ }
1181
+ },
1182
+ [n, r, _.paused]
1183
+ );
1184
+ return /* @__PURE__ */ b.jsx(ve.div, { tabIndex: -1, ...c, ref: C, onKeyDown: $ });
1185
+ });
1186
+ Mt.displayName = nr;
1187
+ function rr(e, { select: t = !1 } = {}) {
1188
+ const n = document.activeElement;
1189
+ for (const r of e)
1190
+ if (ye(r, { select: t }), document.activeElement !== n) return;
1191
+ }
1192
+ function or(e) {
1193
+ const t = Ft(e), n = St(t, e), r = St(t.reverse(), e);
1194
+ return [n, r];
1195
+ }
1196
+ function Ft(e) {
1197
+ const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
1198
+ acceptNode: (r) => {
1199
+ const o = r.tagName === "INPUT" && r.type === "hidden";
1200
+ return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
1201
+ }
1202
+ });
1203
+ for (; n.nextNode(); ) t.push(n.currentNode);
1204
+ return t;
1205
+ }
1206
+ function St(e, t) {
1207
+ for (const n of e)
1208
+ if (!ar(n, { upTo: t })) return n;
1209
+ }
1210
+ function ar(e, { upTo: t }) {
1211
+ if (getComputedStyle(e).visibility === "hidden") return !0;
1212
+ for (; e; ) {
1213
+ if (t !== void 0 && e === t) return !1;
1214
+ if (getComputedStyle(e).display === "none") return !0;
1215
+ e = e.parentElement;
1216
+ }
1217
+ return !1;
1218
+ }
1219
+ function sr(e) {
1220
+ return e instanceof HTMLInputElement && "select" in e;
1221
+ }
1222
+ function ye(e, { select: t = !1 } = {}) {
1223
+ if (e && e.focus) {
1224
+ const n = document.activeElement;
1225
+ e.focus({ preventScroll: !0 }), e !== n && sr(e) && t && e.select();
1226
+ }
1227
+ }
1228
+ var _t = ir();
1229
+ function ir() {
1230
+ let e = [];
1231
+ return {
1232
+ add(t) {
1233
+ const n = e[0];
1234
+ t !== n && n?.pause(), e = Ct(e, t), e.unshift(t);
1235
+ },
1236
+ remove(t) {
1237
+ e = Ct(e, t), e[0]?.resume();
1238
+ }
1239
+ };
1240
+ }
1241
+ function Ct(e, t) {
1242
+ const n = [...e], r = n.indexOf(t);
1243
+ return r !== -1 && n.splice(r, 1), n;
1244
+ }
1245
+ function cr(e) {
1246
+ return e.filter((t) => t.tagName !== "A");
1247
+ }
1248
+ var ur = "Portal", Wt = i.forwardRef((e, t) => {
1249
+ const { container: n, ...r } = e, [o, a] = i.useState(!1);
1250
+ ke(() => a(!0), []);
1251
+ const c = n || o && globalThis?.document?.body;
1252
+ return c ? mn.createPortal(/* @__PURE__ */ b.jsx(ve.div, { ...r, ref: t }), c) : null;
1253
+ });
1254
+ Wt.displayName = ur;
1255
+ function lr(e, t) {
1256
+ return i.useReducer((n, r) => t[n][r] ?? n, e);
1257
+ }
1258
+ var Ke = (e) => {
1259
+ const { present: t, children: n } = e, r = fr(t), o = typeof n == "function" ? n({ present: r.isPresent }) : i.Children.only(n), a = we(r.ref, dr(o));
1260
+ return typeof n == "function" || r.isPresent ? i.cloneElement(o, { ref: a }) : null;
1261
+ };
1262
+ Ke.displayName = "Presence";
1263
+ function fr(e) {
1264
+ const [t, n] = i.useState(), r = i.useRef(null), o = i.useRef(e), a = i.useRef("none"), c = e ? "mounted" : "unmounted", [s, h] = lr(c, {
1265
+ mounted: {
1266
+ UNMOUNT: "unmounted",
1267
+ ANIMATION_OUT: "unmountSuspended"
1268
+ },
1269
+ unmountSuspended: {
1270
+ MOUNT: "mounted",
1271
+ ANIMATION_END: "unmounted"
1272
+ },
1273
+ unmounted: {
1274
+ MOUNT: "mounted"
1275
+ }
1276
+ });
1277
+ return i.useEffect(() => {
1278
+ const d = Fe(r.current);
1279
+ a.current = s === "mounted" ? d : "none";
1280
+ }, [s]), ke(() => {
1281
+ const d = r.current, E = o.current;
1282
+ if (E !== e) {
1283
+ const C = a.current, _ = Fe(d);
1284
+ e ? h("MOUNT") : _ === "none" || d?.display === "none" ? h("UNMOUNT") : h(E && C !== _ ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
1285
+ }
1286
+ }, [e, h]), ke(() => {
1287
+ if (t) {
1288
+ let d;
1289
+ const E = t.ownerDocument.defaultView ?? window, y = (_) => {
1290
+ const g = Fe(r.current).includes(CSS.escape(_.animationName));
1291
+ if (_.target === t && g && (h("ANIMATION_END"), !o.current)) {
1292
+ const R = t.style.animationFillMode;
1293
+ t.style.animationFillMode = "forwards", d = E.setTimeout(() => {
1294
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = R);
1295
+ });
1296
+ }
1297
+ }, C = (_) => {
1298
+ _.target === t && (a.current = Fe(r.current));
1299
+ };
1300
+ return t.addEventListener("animationstart", C), t.addEventListener("animationcancel", y), t.addEventListener("animationend", y), () => {
1301
+ E.clearTimeout(d), t.removeEventListener("animationstart", C), t.removeEventListener("animationcancel", y), t.removeEventListener("animationend", y);
1302
+ };
1303
+ } else
1304
+ h("ANIMATION_END");
1305
+ }, [t, h]), {
1306
+ isPresent: ["mounted", "unmountSuspended"].includes(s),
1307
+ ref: i.useCallback((d) => {
1308
+ r.current = d ? getComputedStyle(d) : null, n(d);
1309
+ }, [])
1310
+ };
1311
+ }
1312
+ function Fe(e) {
1313
+ return e?.animationName || "none";
1314
+ }
1315
+ function dr(e) {
1316
+ let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
1317
+ 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);
1318
+ }
1319
+ var tt = 0;
1320
+ function vr() {
1321
+ i.useEffect(() => {
1322
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
1323
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? Rt()), document.body.insertAdjacentElement("beforeend", e[1] ?? Rt()), tt++, () => {
1324
+ tt === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), tt--;
1325
+ };
1326
+ }, []);
1327
+ }
1328
+ function Rt() {
1329
+ const e = document.createElement("span");
1330
+ 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;
1331
+ }
1332
+ var fe = function() {
1333
+ return fe = Object.assign || function(t) {
1334
+ for (var n, r = 1, o = arguments.length; r < o; r++) {
1335
+ n = arguments[r];
1336
+ for (var a in n) Object.prototype.hasOwnProperty.call(n, a) && (t[a] = n[a]);
1337
+ }
1338
+ return t;
1339
+ }, fe.apply(this, arguments);
1340
+ };
1341
+ function $t(e, t) {
1342
+ var n = {};
1343
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
1344
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
1345
+ for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
1346
+ t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
1347
+ return n;
1348
+ }
1349
+ function pr(e, t, n) {
1350
+ if (n || arguments.length === 2) for (var r = 0, o = t.length, a; r < o; r++)
1351
+ (a || !(r in t)) && (a || (a = Array.prototype.slice.call(t, 0, r)), a[r] = t[r]);
1352
+ return e.concat(a || Array.prototype.slice.call(t));
1353
+ }
1354
+ var Ve = "right-scroll-bar-position", Ye = "width-before-scroll-bar", mr = "with-scroll-bars-hidden", hr = "--removed-body-scroll-bar-size";
1355
+ function nt(e, t) {
1356
+ return typeof e == "function" ? e(t) : e && (e.current = t), e;
1357
+ }
1358
+ function gr(e, t) {
1359
+ var n = vn(function() {
1360
+ return {
1361
+ // value
1362
+ value: e,
1363
+ // last callback
1364
+ callback: t,
1365
+ // "memoized" public interface
1366
+ facade: {
1367
+ get current() {
1368
+ return n.value;
1369
+ },
1370
+ set current(r) {
1371
+ var o = n.value;
1372
+ o !== r && (n.value = r, n.callback(r, o));
1373
+ }
1374
+ }
1375
+ };
1376
+ })[0];
1377
+ return n.callback = t, n.facade;
1378
+ }
1379
+ var yr = typeof window < "u" ? i.useLayoutEffect : i.useEffect, Nt = /* @__PURE__ */ new WeakMap();
1380
+ function br(e, t) {
1381
+ var n = gr(null, function(r) {
1382
+ return e.forEach(function(o) {
1383
+ return nt(o, r);
1384
+ });
1385
+ });
1386
+ return yr(function() {
1387
+ var r = Nt.get(n);
1388
+ if (r) {
1389
+ var o = new Set(r), a = new Set(e), c = n.current;
1390
+ o.forEach(function(s) {
1391
+ a.has(s) || nt(s, null);
1392
+ }), a.forEach(function(s) {
1393
+ o.has(s) || nt(s, c);
1394
+ });
1395
+ }
1396
+ Nt.set(n, e);
1397
+ }, [e]), n;
1398
+ }
1399
+ function Er(e) {
1400
+ return e;
1401
+ }
1402
+ function xr(e, t) {
1403
+ t === void 0 && (t = Er);
1404
+ var n = [], r = !1, o = {
1405
+ read: function() {
1406
+ if (r)
1407
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
1408
+ return n.length ? n[n.length - 1] : e;
1409
+ },
1410
+ useMedium: function(a) {
1411
+ var c = t(a, r);
1412
+ return n.push(c), function() {
1413
+ n = n.filter(function(s) {
1414
+ return s !== c;
1415
+ });
1416
+ };
1417
+ },
1418
+ assignSyncMedium: function(a) {
1419
+ for (r = !0; n.length; ) {
1420
+ var c = n;
1421
+ n = [], c.forEach(a);
1422
+ }
1423
+ n = {
1424
+ push: function(s) {
1425
+ return a(s);
1426
+ },
1427
+ filter: function() {
1428
+ return n;
1429
+ }
1430
+ };
1431
+ },
1432
+ assignMedium: function(a) {
1433
+ r = !0;
1434
+ var c = [];
1435
+ if (n.length) {
1436
+ var s = n;
1437
+ n = [], s.forEach(a), c = n;
1438
+ }
1439
+ var h = function() {
1440
+ var E = c;
1441
+ c = [], E.forEach(a);
1442
+ }, d = function() {
1443
+ return Promise.resolve().then(h);
1444
+ };
1445
+ d(), n = {
1446
+ push: function(E) {
1447
+ c.push(E), d();
1448
+ },
1449
+ filter: function(E) {
1450
+ return c = c.filter(E), n;
1451
+ }
1452
+ };
1453
+ }
1454
+ };
1455
+ return o;
1456
+ }
1457
+ function wr(e) {
1458
+ e === void 0 && (e = {});
1459
+ var t = xr(null);
1460
+ return t.options = fe({ async: !0, ssr: !1 }, e), t;
1461
+ }
1462
+ var Bt = function(e) {
1463
+ var t = e.sideCar, n = $t(e, ["sideCar"]);
1464
+ if (!t)
1465
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
1466
+ var r = t.read();
1467
+ if (!r)
1468
+ throw new Error("Sidecar medium not found");
1469
+ return i.createElement(r, fe({}, n));
1470
+ };
1471
+ Bt.isSideCarExport = !0;
1472
+ function Sr(e, t) {
1473
+ return e.useMedium(t), Bt;
1474
+ }
1475
+ var Ut = wr(), rt = function() {
1476
+ }, Xe = i.forwardRef(function(e, t) {
1477
+ var n = i.useRef(null), r = i.useState({
1478
+ onScrollCapture: rt,
1479
+ onWheelCapture: rt,
1480
+ onTouchMoveCapture: rt
1481
+ }), o = r[0], a = r[1], c = e.forwardProps, s = e.children, h = e.className, d = e.removeScrollBar, E = e.enabled, y = e.shards, C = e.sideCar, _ = e.noRelative, $ = e.noIsolation, g = e.inert, R = e.allowPinchZoom, T = e.as, j = T === void 0 ? "div" : T, M = e.gapMode, B = $t(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), Y = C, X = br([n, t]), A = fe(fe({}, B), o);
1482
+ return i.createElement(
1483
+ i.Fragment,
1484
+ null,
1485
+ E && i.createElement(Y, { sideCar: Ut, removeScrollBar: d, shards: y, noRelative: _, noIsolation: $, inert: g, setCallbacks: a, allowPinchZoom: !!R, lockRef: n, gapMode: M }),
1486
+ c ? i.cloneElement(i.Children.only(s), fe(fe({}, A), { ref: X })) : i.createElement(j, fe({}, A, { className: h, ref: X }), s)
1487
+ );
1488
+ });
1489
+ Xe.defaultProps = {
1490
+ enabled: !0,
1491
+ removeScrollBar: !0,
1492
+ inert: !1
1493
+ };
1494
+ Xe.classNames = {
1495
+ fullWidth: Ye,
1496
+ zeroRight: Ve
1497
+ };
1498
+ var _r = function() {
1499
+ if (typeof __webpack_nonce__ < "u")
1500
+ return __webpack_nonce__;
1501
+ };
1502
+ function Cr() {
1503
+ if (!document)
1504
+ return null;
1505
+ var e = document.createElement("style");
1506
+ e.type = "text/css";
1507
+ var t = _r();
1508
+ return t && e.setAttribute("nonce", t), e;
1509
+ }
1510
+ function Rr(e, t) {
1511
+ e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
1512
+ }
1513
+ function Nr(e) {
1514
+ var t = document.head || document.getElementsByTagName("head")[0];
1515
+ t.appendChild(e);
1516
+ }
1517
+ var Pr = function() {
1518
+ var e = 0, t = null;
1519
+ return {
1520
+ add: function(n) {
1521
+ e == 0 && (t = Cr()) && (Rr(t, n), Nr(t)), e++;
1522
+ },
1523
+ remove: function() {
1524
+ e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
1525
+ }
1526
+ };
1527
+ }, Or = function() {
1528
+ var e = Pr();
1529
+ return function(t, n) {
1530
+ i.useEffect(function() {
1531
+ return e.add(t), function() {
1532
+ e.remove();
1533
+ };
1534
+ }, [t && n]);
1535
+ };
1536
+ }, zt = function() {
1537
+ var e = Or(), t = function(n) {
1538
+ var r = n.styles, o = n.dynamic;
1539
+ return e(r, o), null;
1540
+ };
1541
+ return t;
1542
+ }, Tr = {
1543
+ left: 0,
1544
+ top: 0,
1545
+ right: 0,
1546
+ gap: 0
1547
+ }, ot = function(e) {
1548
+ return parseInt(e || "", 10) || 0;
1549
+ }, Ar = function(e) {
1550
+ var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
1551
+ return [ot(n), ot(r), ot(o)];
1552
+ }, Ir = function(e) {
1553
+ if (e === void 0 && (e = "margin"), typeof window > "u")
1554
+ return Tr;
1555
+ var t = Ar(e), n = document.documentElement.clientWidth, r = window.innerWidth;
1556
+ return {
1557
+ left: t[0],
1558
+ top: t[1],
1559
+ right: t[2],
1560
+ gap: Math.max(0, r - n + t[2] - t[0])
1561
+ };
1562
+ }, Dr = zt(), Oe = "data-scroll-locked", kr = function(e, t, n, r) {
1563
+ var o = e.left, a = e.top, c = e.right, s = e.gap;
1564
+ return n === void 0 && (n = "margin"), `
1565
+ .`.concat(mr, ` {
1566
+ overflow: hidden `).concat(r, `;
1567
+ padding-right: `).concat(s, "px ").concat(r, `;
1568
+ }
1569
+ body[`).concat(Oe, `] {
1570
+ overflow: hidden `).concat(r, `;
1571
+ overscroll-behavior: contain;
1572
+ `).concat([
1573
+ t && "position: relative ".concat(r, ";"),
1574
+ n === "margin" && `
1575
+ padding-left: `.concat(o, `px;
1576
+ padding-top: `).concat(a, `px;
1577
+ padding-right: `).concat(c, `px;
1578
+ margin-left:0;
1579
+ margin-top:0;
1580
+ margin-right: `).concat(s, "px ").concat(r, `;
1581
+ `),
1582
+ n === "padding" && "padding-right: ".concat(s, "px ").concat(r, ";")
1583
+ ].filter(Boolean).join(""), `
1584
+ }
1585
+
1586
+ .`).concat(Ve, ` {
1587
+ right: `).concat(s, "px ").concat(r, `;
1588
+ }
1589
+
1590
+ .`).concat(Ye, ` {
1591
+ margin-right: `).concat(s, "px ").concat(r, `;
1592
+ }
1593
+
1594
+ .`).concat(Ve, " .").concat(Ve, ` {
1595
+ right: 0 `).concat(r, `;
1596
+ }
1597
+
1598
+ .`).concat(Ye, " .").concat(Ye, ` {
1599
+ margin-right: 0 `).concat(r, `;
1600
+ }
1601
+
1602
+ body[`).concat(Oe, `] {
1603
+ `).concat(hr, ": ").concat(s, `px;
1604
+ }
1605
+ `);
1606
+ }, Pt = function() {
1607
+ var e = parseInt(document.body.getAttribute(Oe) || "0", 10);
1608
+ return isFinite(e) ? e : 0;
1609
+ }, Lr = function() {
1610
+ i.useEffect(function() {
1611
+ return document.body.setAttribute(Oe, (Pt() + 1).toString()), function() {
1612
+ var e = Pt() - 1;
1613
+ e <= 0 ? document.body.removeAttribute(Oe) : document.body.setAttribute(Oe, e.toString());
1614
+ };
1615
+ }, []);
1616
+ }, jr = function(e) {
1617
+ var t = e.noRelative, n = e.noImportant, r = e.gapMode, o = r === void 0 ? "margin" : r;
1618
+ Lr();
1619
+ var a = i.useMemo(function() {
1620
+ return Ir(o);
1621
+ }, [o]);
1622
+ return i.createElement(Dr, { styles: kr(a, !t, o, n ? "" : "!important") });
1623
+ }, it = !1;
1624
+ if (typeof window < "u")
1625
+ try {
1626
+ var We = Object.defineProperty({}, "passive", {
1627
+ get: function() {
1628
+ return it = !0, !0;
1629
+ }
1630
+ });
1631
+ window.addEventListener("test", We, We), window.removeEventListener("test", We, We);
1632
+ } catch {
1633
+ it = !1;
1634
+ }
1635
+ var Re = it ? { passive: !1 } : !1, Mr = function(e) {
1636
+ return e.tagName === "TEXTAREA";
1637
+ }, Vt = function(e, t) {
1638
+ if (!(e instanceof Element))
1639
+ return !1;
1640
+ var n = window.getComputedStyle(e);
1641
+ return (
1642
+ // not-not-scrollable
1643
+ n[t] !== "hidden" && // contains scroll inside self
1644
+ !(n.overflowY === n.overflowX && !Mr(e) && n[t] === "visible")
1645
+ );
1646
+ }, Fr = function(e) {
1647
+ return Vt(e, "overflowY");
1648
+ }, Wr = function(e) {
1649
+ return Vt(e, "overflowX");
1650
+ }, Ot = function(e, t) {
1651
+ var n = t.ownerDocument, r = t;
1652
+ do {
1653
+ typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
1654
+ var o = Yt(e, r);
1655
+ if (o) {
1656
+ var a = Ht(e, r), c = a[1], s = a[2];
1657
+ if (c > s)
1658
+ return !0;
1659
+ }
1660
+ r = r.parentNode;
1661
+ } while (r && r !== n.body);
1662
+ return !1;
1663
+ }, $r = function(e) {
1664
+ var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
1665
+ return [
1666
+ t,
1667
+ n,
1668
+ r
1669
+ ];
1670
+ }, Br = function(e) {
1671
+ var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
1672
+ return [
1673
+ t,
1674
+ n,
1675
+ r
1676
+ ];
1677
+ }, Yt = function(e, t) {
1678
+ return e === "v" ? Fr(t) : Wr(t);
1679
+ }, Ht = function(e, t) {
1680
+ return e === "v" ? $r(t) : Br(t);
1681
+ }, Ur = function(e, t) {
1682
+ return e === "h" && t === "rtl" ? -1 : 1;
1683
+ }, zr = function(e, t, n, r, o) {
1684
+ var a = Ur(e, window.getComputedStyle(t).direction), c = a * r, s = n.target, h = t.contains(s), d = !1, E = c > 0, y = 0, C = 0;
1685
+ do {
1686
+ if (!s)
1687
+ break;
1688
+ var _ = Ht(e, s), $ = _[0], g = _[1], R = _[2], T = g - R - a * $;
1689
+ ($ || T) && Yt(e, s) && (y += T, C += $);
1690
+ var j = s.parentNode;
1691
+ s = j && j.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? j.host : j;
1692
+ } while (
1693
+ // portaled content
1694
+ !h && s !== document.body || // self content
1695
+ h && (t.contains(s) || t === s)
1696
+ );
1697
+ return (E && Math.abs(y) < 1 || !E && Math.abs(C) < 1) && (d = !0), d;
1698
+ }, $e = function(e) {
1699
+ return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
1700
+ }, Tt = function(e) {
1701
+ return [e.deltaX, e.deltaY];
1702
+ }, At = function(e) {
1703
+ return e && "current" in e ? e.current : e;
1704
+ }, Vr = function(e, t) {
1705
+ return e[0] === t[0] && e[1] === t[1];
1706
+ }, Yr = function(e) {
1707
+ return `
1708
+ .block-interactivity-`.concat(e, ` {pointer-events: none;}
1709
+ .allow-interactivity-`).concat(e, ` {pointer-events: all;}
1710
+ `);
1711
+ }, Hr = 0, Ne = [];
1712
+ function Gr(e) {
1713
+ var t = i.useRef([]), n = i.useRef([0, 0]), r = i.useRef(), o = i.useState(Hr++)[0], a = i.useState(zt)[0], c = i.useRef(e);
1714
+ i.useEffect(function() {
1715
+ c.current = e;
1716
+ }, [e]), i.useEffect(function() {
1717
+ if (e.inert) {
1718
+ document.body.classList.add("block-interactivity-".concat(o));
1719
+ var g = pr([e.lockRef.current], (e.shards || []).map(At), !0).filter(Boolean);
1720
+ return g.forEach(function(R) {
1721
+ return R.classList.add("allow-interactivity-".concat(o));
1722
+ }), function() {
1723
+ document.body.classList.remove("block-interactivity-".concat(o)), g.forEach(function(R) {
1724
+ return R.classList.remove("allow-interactivity-".concat(o));
1725
+ });
1726
+ };
1727
+ }
1728
+ }, [e.inert, e.lockRef.current, e.shards]);
1729
+ var s = i.useCallback(function(g, R) {
1730
+ if ("touches" in g && g.touches.length === 2 || g.type === "wheel" && g.ctrlKey)
1731
+ return !c.current.allowPinchZoom;
1732
+ var T = $e(g), j = n.current, M = "deltaX" in g ? g.deltaX : j[0] - T[0], B = "deltaY" in g ? g.deltaY : j[1] - T[1], Y, X = g.target, A = Math.abs(M) > Math.abs(B) ? "h" : "v";
1733
+ if ("touches" in g && A === "h" && X.type === "range")
1734
+ return !1;
1735
+ var G = window.getSelection(), ne = G && G.anchorNode, ie = ne ? ne === X || ne.contains(X) : !1;
1736
+ if (ie)
1737
+ return !1;
1738
+ var Z = Ot(A, X);
1739
+ if (!Z)
1740
+ return !0;
1741
+ if (Z ? Y = A : (Y = A === "v" ? "h" : "v", Z = Ot(A, X)), !Z)
1742
+ return !1;
1743
+ if (!r.current && "changedTouches" in g && (M || B) && (r.current = Y), !Y)
1744
+ return !0;
1745
+ var oe = r.current || Y;
1746
+ return zr(oe, R, g, oe === "h" ? M : B);
1747
+ }, []), h = i.useCallback(function(g) {
1748
+ var R = g;
1749
+ if (!(!Ne.length || Ne[Ne.length - 1] !== a)) {
1750
+ var T = "deltaY" in R ? Tt(R) : $e(R), j = t.current.filter(function(Y) {
1751
+ return Y.name === R.type && (Y.target === R.target || R.target === Y.shadowParent) && Vr(Y.delta, T);
1752
+ })[0];
1753
+ if (j && j.should) {
1754
+ R.cancelable && R.preventDefault();
1755
+ return;
1756
+ }
1757
+ if (!j) {
1758
+ var M = (c.current.shards || []).map(At).filter(Boolean).filter(function(Y) {
1759
+ return Y.contains(R.target);
1760
+ }), B = M.length > 0 ? s(R, M[0]) : !c.current.noIsolation;
1761
+ B && R.cancelable && R.preventDefault();
1762
+ }
1763
+ }
1764
+ }, []), d = i.useCallback(function(g, R, T, j) {
1765
+ var M = { name: g, delta: R, target: T, should: j, shadowParent: Kr(T) };
1766
+ t.current.push(M), setTimeout(function() {
1767
+ t.current = t.current.filter(function(B) {
1768
+ return B !== M;
1769
+ });
1770
+ }, 1);
1771
+ }, []), E = i.useCallback(function(g) {
1772
+ n.current = $e(g), r.current = void 0;
1773
+ }, []), y = i.useCallback(function(g) {
1774
+ d(g.type, Tt(g), g.target, s(g, e.lockRef.current));
1775
+ }, []), C = i.useCallback(function(g) {
1776
+ d(g.type, $e(g), g.target, s(g, e.lockRef.current));
1777
+ }, []);
1778
+ i.useEffect(function() {
1779
+ return Ne.push(a), e.setCallbacks({
1780
+ onScrollCapture: y,
1781
+ onWheelCapture: y,
1782
+ onTouchMoveCapture: C
1783
+ }), document.addEventListener("wheel", h, Re), document.addEventListener("touchmove", h, Re), document.addEventListener("touchstart", E, Re), function() {
1784
+ Ne = Ne.filter(function(g) {
1785
+ return g !== a;
1786
+ }), document.removeEventListener("wheel", h, Re), document.removeEventListener("touchmove", h, Re), document.removeEventListener("touchstart", E, Re);
1787
+ };
1788
+ }, []);
1789
+ var _ = e.removeScrollBar, $ = e.inert;
1790
+ return i.createElement(
1791
+ i.Fragment,
1792
+ null,
1793
+ $ ? i.createElement(a, { styles: Yr(o) }) : null,
1794
+ _ ? i.createElement(jr, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
1795
+ );
1796
+ }
1797
+ function Kr(e) {
1798
+ for (var t = null; e !== null; )
1799
+ e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
1800
+ return t;
1801
+ }
1802
+ const Xr = Sr(Ut, Gr);
1803
+ var Gt = i.forwardRef(function(e, t) {
1804
+ return i.createElement(Xe, fe({}, e, { ref: t, sideCar: Xr }));
1805
+ });
1806
+ Gt.classNames = Xe.classNames;
1807
+ var qr = function(e) {
1808
+ if (typeof document > "u")
1809
+ return null;
1810
+ var t = Array.isArray(e) ? e[0] : e;
1811
+ return t.ownerDocument.body;
1812
+ }, Pe = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap(), Ue = {}, at = 0, Kt = function(e) {
1813
+ return e && (e.host || Kt(e.parentNode));
1814
+ }, Zr = function(e, t) {
1815
+ return t.map(function(n) {
1816
+ if (e.contains(n))
1817
+ return n;
1818
+ var r = Kt(n);
1819
+ return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
1820
+ }).filter(function(n) {
1821
+ return !!n;
1822
+ });
1823
+ }, Jr = function(e, t, n, r) {
1824
+ var o = Zr(t, Array.isArray(e) ? e : [e]);
1825
+ Ue[n] || (Ue[n] = /* @__PURE__ */ new WeakMap());
1826
+ var a = Ue[n], c = [], s = /* @__PURE__ */ new Set(), h = new Set(o), d = function(y) {
1827
+ !y || s.has(y) || (s.add(y), d(y.parentNode));
1828
+ };
1829
+ o.forEach(d);
1830
+ var E = function(y) {
1831
+ !y || h.has(y) || Array.prototype.forEach.call(y.children, function(C) {
1832
+ if (s.has(C))
1833
+ E(C);
1834
+ else
1835
+ try {
1836
+ var _ = C.getAttribute(r), $ = _ !== null && _ !== "false", g = (Pe.get(C) || 0) + 1, R = (a.get(C) || 0) + 1;
1837
+ Pe.set(C, g), a.set(C, R), c.push(C), g === 1 && $ && Be.set(C, !0), R === 1 && C.setAttribute(n, "true"), $ || C.setAttribute(r, "true");
1838
+ } catch (T) {
1839
+ console.error("aria-hidden: cannot operate on ", C, T);
1840
+ }
1841
+ });
1842
+ };
1843
+ return E(t), s.clear(), at++, function() {
1844
+ c.forEach(function(y) {
1845
+ var C = Pe.get(y) - 1, _ = a.get(y) - 1;
1846
+ Pe.set(y, C), a.set(y, _), C || (Be.has(y) || y.removeAttribute(r), Be.delete(y)), _ || y.removeAttribute(n);
1847
+ }), at--, at || (Pe = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakMap(), Ue = {});
1848
+ };
1849
+ }, Qr = function(e, t, n) {
1850
+ n === void 0 && (n = "data-aria-hidden");
1851
+ var r = Array.from(Array.isArray(e) ? e : [e]), o = qr(e);
1852
+ return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live], script"))), Jr(r, o, n, "aria-hidden")) : function() {
1853
+ return null;
1854
+ };
1855
+ }, qe = "Dialog", [Xt] = Dn(qe), [eo, ue] = Xt(qe), qt = (e) => {
1856
+ const {
1857
+ __scopeDialog: t,
1858
+ children: n,
1859
+ open: r,
1860
+ defaultOpen: o,
1861
+ onOpenChange: a,
1862
+ modal: c = !0
1863
+ } = e, s = i.useRef(null), h = i.useRef(null), [d, E] = Fn({
1864
+ prop: r,
1865
+ defaultProp: o ?? !1,
1866
+ onChange: a,
1867
+ caller: qe
1868
+ });
1869
+ return /* @__PURE__ */ b.jsx(
1870
+ eo,
1871
+ {
1872
+ scope: t,
1873
+ triggerRef: s,
1874
+ contentRef: h,
1875
+ contentId: Je(),
1876
+ titleId: Je(),
1877
+ descriptionId: Je(),
1878
+ open: d,
1879
+ onOpenChange: E,
1880
+ onOpenToggle: i.useCallback(() => E((y) => !y), [E]),
1881
+ modal: c,
1882
+ children: n
1883
+ }
1884
+ );
1885
+ };
1886
+ qt.displayName = qe;
1887
+ var Zt = "DialogTrigger", to = i.forwardRef(
1888
+ (e, t) => {
1889
+ const { __scopeDialog: n, ...r } = e, o = ue(Zt, n), a = we(t, o.triggerRef);
1890
+ return /* @__PURE__ */ b.jsx(
1891
+ ve.button,
1892
+ {
1893
+ type: "button",
1894
+ "aria-haspopup": "dialog",
1895
+ "aria-expanded": o.open,
1896
+ "aria-controls": o.contentId,
1897
+ "data-state": ft(o.open),
1898
+ ...r,
1899
+ ref: a,
1900
+ onClick: be(e.onClick, o.onOpenToggle)
1901
+ }
1902
+ );
1903
+ }
1904
+ );
1905
+ to.displayName = Zt;
1906
+ var ut = "DialogPortal", [no, Jt] = Xt(ut, {
1907
+ forceMount: void 0
1908
+ }), Qt = (e) => {
1909
+ const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, a = ue(ut, t);
1910
+ return /* @__PURE__ */ b.jsx(no, { scope: t, forceMount: n, children: i.Children.map(r, (c) => /* @__PURE__ */ b.jsx(Ke, { present: n || a.open, children: /* @__PURE__ */ b.jsx(Wt, { asChild: !0, container: o, children: c }) })) });
1911
+ };
1912
+ Qt.displayName = ut;
1913
+ var He = "DialogOverlay", en = i.forwardRef(
1914
+ (e, t) => {
1915
+ const n = Jt(He, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, a = ue(He, e.__scopeDialog);
1916
+ return a.modal ? /* @__PURE__ */ b.jsx(Ke, { present: r || a.open, children: /* @__PURE__ */ b.jsx(oo, { ...o, ref: t }) }) : null;
1917
+ }
1918
+ );
1919
+ en.displayName = He;
1920
+ var ro = /* @__PURE__ */ Dt("DialogOverlay.RemoveScroll"), oo = i.forwardRef(
1921
+ (e, t) => {
1922
+ const { __scopeDialog: n, ...r } = e, o = ue(He, n);
1923
+ return (
1924
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
1925
+ // ie. when `Overlay` and `Content` are siblings
1926
+ /* @__PURE__ */ b.jsx(Gt, { as: ro, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ b.jsx(
1927
+ ve.div,
1928
+ {
1929
+ "data-state": ft(o.open),
1930
+ ...r,
1931
+ ref: t,
1932
+ style: { pointerEvents: "auto", ...r.style }
1933
+ }
1934
+ ) })
1935
+ );
1936
+ }
1937
+ ), xe = "DialogContent", tn = i.forwardRef(
1938
+ (e, t) => {
1939
+ const n = Jt(xe, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, a = ue(xe, e.__scopeDialog);
1940
+ return /* @__PURE__ */ b.jsx(Ke, { present: r || a.open, children: a.modal ? /* @__PURE__ */ b.jsx(ao, { ...o, ref: t }) : /* @__PURE__ */ b.jsx(so, { ...o, ref: t }) });
1941
+ }
1942
+ );
1943
+ tn.displayName = xe;
1944
+ var ao = i.forwardRef(
1945
+ (e, t) => {
1946
+ const n = ue(xe, e.__scopeDialog), r = i.useRef(null), o = we(t, n.contentRef, r);
1947
+ return i.useEffect(() => {
1948
+ const a = r.current;
1949
+ if (a) return Qr(a);
1950
+ }, []), /* @__PURE__ */ b.jsx(
1951
+ nn,
1952
+ {
1953
+ ...e,
1954
+ ref: o,
1955
+ trapFocus: n.open,
1956
+ disableOutsidePointerEvents: !0,
1957
+ onCloseAutoFocus: be(e.onCloseAutoFocus, (a) => {
1958
+ a.preventDefault(), n.triggerRef.current?.focus();
1959
+ }),
1960
+ onPointerDownOutside: be(e.onPointerDownOutside, (a) => {
1961
+ const c = a.detail.originalEvent, s = c.button === 0 && c.ctrlKey === !0;
1962
+ (c.button === 2 || s) && a.preventDefault();
1963
+ }),
1964
+ onFocusOutside: be(
1965
+ e.onFocusOutside,
1966
+ (a) => a.preventDefault()
1967
+ )
1968
+ }
1969
+ );
1970
+ }
1971
+ ), so = i.forwardRef(
1972
+ (e, t) => {
1973
+ const n = ue(xe, e.__scopeDialog), r = i.useRef(!1), o = i.useRef(!1);
1974
+ return /* @__PURE__ */ b.jsx(
1975
+ nn,
1976
+ {
1977
+ ...e,
1978
+ ref: t,
1979
+ trapFocus: !1,
1980
+ disableOutsidePointerEvents: !1,
1981
+ onCloseAutoFocus: (a) => {
1982
+ e.onCloseAutoFocus?.(a), a.defaultPrevented || (r.current || n.triggerRef.current?.focus(), a.preventDefault()), r.current = !1, o.current = !1;
1983
+ },
1984
+ onInteractOutside: (a) => {
1985
+ e.onInteractOutside?.(a), a.defaultPrevented || (r.current = !0, a.detail.originalEvent.type === "pointerdown" && (o.current = !0));
1986
+ const c = a.target;
1987
+ n.triggerRef.current?.contains(c) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && o.current && a.preventDefault();
1988
+ }
1989
+ }
1990
+ );
1991
+ }
1992
+ ), nn = i.forwardRef(
1993
+ (e, t) => {
1994
+ const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: a, ...c } = e, s = ue(xe, n), h = i.useRef(null), d = we(t, h);
1995
+ return vr(), /* @__PURE__ */ b.jsxs(b.Fragment, { children: [
1996
+ /* @__PURE__ */ b.jsx(
1997
+ Mt,
1998
+ {
1999
+ asChild: !0,
2000
+ loop: !0,
2001
+ trapped: r,
2002
+ onMountAutoFocus: o,
2003
+ onUnmountAutoFocus: a,
2004
+ children: /* @__PURE__ */ b.jsx(
2005
+ Lt,
2006
+ {
2007
+ role: "dialog",
2008
+ id: s.contentId,
2009
+ "aria-describedby": s.descriptionId,
2010
+ "aria-labelledby": s.titleId,
2011
+ "data-state": ft(s.open),
2012
+ ...c,
2013
+ ref: d,
2014
+ onDismiss: () => s.onOpenChange(!1)
2015
+ }
2016
+ )
2017
+ }
2018
+ ),
2019
+ /* @__PURE__ */ b.jsxs(b.Fragment, { children: [
2020
+ /* @__PURE__ */ b.jsx(co, { titleId: s.titleId }),
2021
+ /* @__PURE__ */ b.jsx(lo, { contentRef: h, descriptionId: s.descriptionId })
2022
+ ] })
2023
+ ] });
2024
+ }
2025
+ ), lt = "DialogTitle", rn = i.forwardRef(
2026
+ (e, t) => {
2027
+ const { __scopeDialog: n, ...r } = e, o = ue(lt, n);
2028
+ return /* @__PURE__ */ b.jsx(ve.h2, { id: o.titleId, ...r, ref: t });
2029
+ }
2030
+ );
2031
+ rn.displayName = lt;
2032
+ var on = "DialogDescription", an = i.forwardRef(
2033
+ (e, t) => {
2034
+ const { __scopeDialog: n, ...r } = e, o = ue(on, n);
2035
+ return /* @__PURE__ */ b.jsx(ve.p, { id: o.descriptionId, ...r, ref: t });
2036
+ }
2037
+ );
2038
+ an.displayName = on;
2039
+ var sn = "DialogClose", io = i.forwardRef(
2040
+ (e, t) => {
2041
+ const { __scopeDialog: n, ...r } = e, o = ue(sn, n);
2042
+ return /* @__PURE__ */ b.jsx(
2043
+ ve.button,
2044
+ {
2045
+ type: "button",
2046
+ ...r,
2047
+ ref: t,
2048
+ onClick: be(e.onClick, () => o.onOpenChange(!1))
2049
+ }
2050
+ );
2051
+ }
2052
+ );
2053
+ io.displayName = sn;
2054
+ function ft(e) {
2055
+ return e ? "open" : "closed";
2056
+ }
2057
+ var cn = "DialogTitleWarning", [Uo, un] = In(cn, {
2058
+ contentName: xe,
2059
+ titleName: lt,
2060
+ docsSlug: "dialog"
2061
+ }), co = ({ titleId: e }) => {
2062
+ const t = un(cn), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
2063
+
2064
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
2065
+
2066
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
2067
+ return i.useEffect(() => {
2068
+ e && (document.getElementById(e) || console.error(n));
2069
+ }, [n, e]), null;
2070
+ }, uo = "DialogDescriptionWarning", lo = ({ contentRef: e, descriptionId: t }) => {
2071
+ const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${un(uo).contentName}}.`;
2072
+ return i.useEffect(() => {
2073
+ const o = e.current?.getAttribute("aria-describedby");
2074
+ t && o && (document.getElementById(t) || console.warn(r));
2075
+ }, [r, e, t]), null;
2076
+ }, fo = qt, vo = Qt, po = en, mo = tn, ho = rn, go = an, yo = /* @__PURE__ */ Symbol.for("react.lazy"), Ge = i[" use ".trim().toString()];
2077
+ function bo(e) {
2078
+ return typeof e == "object" && e !== null && "then" in e;
2079
+ }
2080
+ function ln(e) {
2081
+ return e != null && typeof e == "object" && "$$typeof" in e && e.$$typeof === yo && "_payload" in e && bo(e._payload);
2082
+ }
2083
+ // @__NO_SIDE_EFFECTS__
2084
+ function Eo(e) {
2085
+ const t = /* @__PURE__ */ xo(e), n = i.forwardRef((r, o) => {
2086
+ let { children: a, ...c } = r;
2087
+ ln(a) && typeof Ge == "function" && (a = Ge(a._payload));
2088
+ const s = i.Children.toArray(a), h = s.find(So);
2089
+ if (h) {
2090
+ const d = h.props.children, E = s.map((y) => y === h ? i.Children.count(d) > 1 ? i.Children.only(null) : i.isValidElement(d) ? d.props.children : null : y);
2091
+ return /* @__PURE__ */ b.jsx(t, { ...c, ref: o, children: i.isValidElement(d) ? i.cloneElement(d, void 0, E) : null });
2092
+ }
2093
+ return /* @__PURE__ */ b.jsx(t, { ...c, ref: o, children: a });
2094
+ });
2095
+ return n.displayName = `${e}.Slot`, n;
2096
+ }
2097
+ // @__NO_SIDE_EFFECTS__
2098
+ function xo(e) {
2099
+ const t = i.forwardRef((n, r) => {
2100
+ let { children: o, ...a } = n;
2101
+ if (ln(o) && typeof Ge == "function" && (o = Ge(o._payload)), i.isValidElement(o)) {
2102
+ const c = Co(o), s = _o(a, o.props);
2103
+ return o.type !== i.Fragment && (s.ref = r ? ct(r, c) : c), i.cloneElement(o, s);
2104
+ }
2105
+ return i.Children.count(o) > 1 ? i.Children.only(null) : null;
2106
+ });
2107
+ return t.displayName = `${e}.SlotClone`, t;
2108
+ }
2109
+ var wo = /* @__PURE__ */ Symbol("radix.slottable");
2110
+ function So(e) {
2111
+ return i.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === wo;
2112
+ }
2113
+ function _o(e, t) {
2114
+ const n = { ...t };
2115
+ for (const r in t) {
2116
+ const o = e[r], a = t[r];
2117
+ /^on[A-Z]/.test(r) ? o && a ? n[r] = (...s) => {
2118
+ const h = a(...s);
2119
+ return o(...s), h;
2120
+ } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...a } : r === "className" && (n[r] = [o, a].filter(Boolean).join(" "));
2121
+ }
2122
+ return { ...e, ...n };
2123
+ }
2124
+ function Co(e) {
2125
+ let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
2126
+ 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);
2127
+ }
2128
+ var Ro = [
2129
+ "a",
2130
+ "button",
2131
+ "div",
2132
+ "form",
2133
+ "h2",
2134
+ "h3",
2135
+ "img",
2136
+ "input",
2137
+ "label",
2138
+ "li",
2139
+ "nav",
2140
+ "ol",
2141
+ "p",
2142
+ "select",
2143
+ "span",
2144
+ "svg",
2145
+ "ul"
2146
+ ], No = Ro.reduce((e, t) => {
2147
+ const n = /* @__PURE__ */ Eo(`Primitive.${t}`), r = i.forwardRef((o, a) => {
2148
+ const { asChild: c, ...s } = o, h = c ? n : t;
2149
+ return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ b.jsx(h, { ...s, ref: a });
2150
+ });
2151
+ return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
2152
+ }, {}), Po = Object.freeze({
2153
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
2154
+ position: "absolute",
2155
+ border: 0,
2156
+ width: 1,
2157
+ height: 1,
2158
+ padding: 0,
2159
+ margin: -1,
2160
+ overflow: "hidden",
2161
+ clip: "rect(0, 0, 0, 0)",
2162
+ whiteSpace: "nowrap",
2163
+ wordWrap: "normal"
2164
+ }), Oo = "VisuallyHidden", fn = i.forwardRef(
2165
+ (e, t) => /* @__PURE__ */ b.jsx(
2166
+ No.span,
2167
+ {
2168
+ ...e,
2169
+ ref: t,
2170
+ style: { ...Po, ...e.style }
2171
+ }
2172
+ )
2173
+ );
2174
+ fn.displayName = Oo;
2175
+ var To = fn;
2176
+ function Ao({ open: e, onOpenChange: t, children: n }) {
2177
+ return /* @__PURE__ */ b.jsx(fo, { open: e, onOpenChange: t, children: /* @__PURE__ */ b.jsxs(vo, { children: [
2178
+ /* @__PURE__ */ b.jsx(po, { className: "fixed inset-0 bg-black/30 backdrop-blur-sm" }),
2179
+ /* @__PURE__ */ b.jsx(
2180
+ "div",
2181
+ {
2182
+ className: `
2183
+ fixed left-1/2 top-[20%]
2184
+ -translate-x-1/2
2185
+ will-change-transform will-change-opacity
2186
+ data-[state=open]:animate-[spotlight-in_180ms_cubic-bezier(0.16,1,0.3,1)]
2187
+ data-[state=closed]:animate-[spotlight-out_120ms_ease-out]
2188
+ `,
2189
+ "data-state": e ? "open" : "closed",
2190
+ children: /* @__PURE__ */ b.jsxs(
2191
+ mo,
2192
+ {
2193
+ "aria-describedby": "command-palette-description",
2194
+ className: `
2195
+ w-[520px] max-w-[90vw]
2196
+ rounded-xl
2197
+ border border-[rgb(var(--border))]
2198
+ bg-[rgb(var(--glass))]
2199
+ text-[rgb(var(--fg))]
2200
+ backdrop-blur-xl
2201
+ shadow-xl
2202
+ `,
2203
+ children: [
2204
+ /* @__PURE__ */ b.jsxs(To, { children: [
2205
+ /* @__PURE__ */ b.jsx(ho, { children: "Command Palette" }),
2206
+ /* @__PURE__ */ b.jsx(go, { id: "command-palette-description", children: "Type to search and run commands" })
2207
+ ] }),
2208
+ n
2209
+ ]
2210
+ }
2211
+ )
2212
+ }
2213
+ )
2214
+ ] }) });
2215
+ }
2216
+ function Io() {
2217
+ const e = te((r) => r.query), t = te((r) => r.setQuery), n = It(null);
2218
+ return Te(() => {
2219
+ const r = requestAnimationFrame(() => {
2220
+ n.current?.focus();
2221
+ });
2222
+ return () => cancelAnimationFrame(r);
2223
+ }, []), /* @__PURE__ */ b.jsx(
2224
+ "input",
2225
+ {
2226
+ ref: n,
2227
+ value: e,
2228
+ onChange: (r) => t(r.target.value),
2229
+ placeholder: "Type a command…",
2230
+ spellCheck: !1,
2231
+ autoComplete: "off",
2232
+ className: `
2233
+ w-full
2234
+ bg-transparent
2235
+ px-3 py-2
2236
+ text-sm
2237
+ placeholder:text-[rgb(var(--muted))]
2238
+ caret-color-[rgb(var(--fg))]
2239
+ focus:outline-none
2240
+ `
2241
+ }
2242
+ );
2243
+ }
2244
+ function Do(e) {
2245
+ const t = /* @__PURE__ */ new Map();
2246
+ for (const n of e) {
2247
+ const r = n.item.group ?? "Other";
2248
+ t.has(r) || t.set(r, []), t.get(r).push(n);
2249
+ }
2250
+ return Array.from(t.entries()).map(([n, r]) => ({
2251
+ group: n,
2252
+ items: r
2253
+ }));
2254
+ }
2255
+ function ko(e, t) {
2256
+ Te(() => {
2257
+ t && e.current && e.current.scrollIntoView({
2258
+ block: "nearest",
2259
+ inline: "nearest"
2260
+ });
2261
+ }, [t, e]);
2262
+ }
2263
+ function Lo(e, t) {
2264
+ return !t || t.length === 0 ? e : e.split("").map(
2265
+ (n, r) => t.includes(r) ? /* @__PURE__ */ b.jsx("span", { className: "text-blue-400", children: n }, r) : /* @__PURE__ */ b.jsx("span", { children: n }, r)
2266
+ );
2267
+ }
2268
+ function jo({ command: e, matchIndexes: t, index: n }) {
2269
+ const r = te((s) => s.close), o = te((s) => s.selectedIndex), a = n === o, c = It(null);
2270
+ return ko(c, a), /* @__PURE__ */ b.jsx("li", { children: /* @__PURE__ */ b.jsxs(
2271
+ "button",
2272
+ {
2273
+ ref: c,
2274
+ onClick: async () => {
2275
+ await Tn(e), r();
2276
+ },
2277
+ className: `
2278
+ flex w-full items-center justify-between
2279
+ rounded-md px-3 py-2 text-left text-sm
2280
+ ${a ? "bg-zinc-800 text-white" : "text-zinc-100 hover:bg-zinc-800"}
2281
+ `,
2282
+ children: [
2283
+ /* @__PURE__ */ b.jsx("span", { children: Lo(e.title, t) }),
2284
+ e.shortcut && /* @__PURE__ */ b.jsx("span", { className: "text-xs text-zinc-500", children: e.shortcut })
2285
+ ]
2286
+ }
2287
+ ) });
2288
+ }
2289
+ function Mo() {
2290
+ const e = te((r) => r.results);
2291
+ if (e.length === 0)
2292
+ return /* @__PURE__ */ b.jsxs("div", { className: "px-3 py-8 text-center text-sm text-[rgb(var(--muted))]", children: [
2293
+ /* @__PURE__ */ b.jsx("p", { children: "No matching commands" }),
2294
+ /* @__PURE__ */ b.jsx("p", { className: "mt-1 text-xs", children: "Try a different keyword" })
2295
+ ] });
2296
+ const t = Do(e);
2297
+ let n = 0;
2298
+ return /* @__PURE__ */ b.jsx(
2299
+ "div",
2300
+ {
2301
+ className: `max-h-64 overflow-y-auto transition-opacity
2302
+ duration-150
2303
+ opacity-100
2304
+ data-[empty=true]:opacity-60`,
2305
+ children: t.map(({ group: r, items: o }) => /* @__PURE__ */ b.jsxs("div", { children: [
2306
+ /* @__PURE__ */ b.jsx("div", { className: "px-3 py-2 text-xs font-semibold text-zinc-500", children: r }),
2307
+ /* @__PURE__ */ b.jsx("ul", { children: o.map((a) => {
2308
+ const c = n++;
2309
+ return /* @__PURE__ */ b.jsx(
2310
+ jo,
2311
+ {
2312
+ command: a.item,
2313
+ matchIndexes: a.indexes,
2314
+ index: c
2315
+ },
2316
+ a.item.id
2317
+ );
2318
+ }) })
2319
+ ] }, r))
2320
+ }
2321
+ );
2322
+ }
2323
+ function Fo() {
2324
+ const e = te((c) => c.isOpen), t = te((c) => c.close), n = te((c) => c.selectNext), r = te((c) => c.selectPrev), o = te((c) => c.results), a = te((c) => c.selectedIndex);
2325
+ Te(() => {
2326
+ if (!e) return;
2327
+ const c = (s) => {
2328
+ switch (s.key) {
2329
+ case "ArrowDown":
2330
+ s.preventDefault(), n();
2331
+ break;
2332
+ case "ArrowUp":
2333
+ s.preventDefault(), r();
2334
+ break;
2335
+ case "Enter":
2336
+ s.preventDefault();
2337
+ const h = o[a];
2338
+ h && (h.item.run(), t());
2339
+ break;
2340
+ case "Escape":
2341
+ s.preventDefault(), t();
2342
+ break;
2343
+ }
2344
+ };
2345
+ return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
2346
+ }, [e, n, r, t, o, a]);
2347
+ }
2348
+ function Wo({ onOpenChange: e }) {
2349
+ const t = te((r) => r.isOpen), n = te((r) => r.close);
2350
+ return Fo(), /* @__PURE__ */ b.jsx(
2351
+ Ao,
2352
+ {
2353
+ open: t,
2354
+ onOpenChange: (r) => {
2355
+ r || n(), e?.(r);
2356
+ },
2357
+ children: /* @__PURE__ */ b.jsxs("div", { className: "relative flex flex-col gap-2 p-2", children: [
2358
+ /* @__PURE__ */ b.jsxs(
2359
+ "span",
2360
+ {
2361
+ className: `
2362
+ absolute right-3 top-3
2363
+ text-xs text-[rgb(var(--muted))]
2364
+ pointer-events-none
2365
+ select-none
2366
+ `,
2367
+ children: [
2368
+ /* @__PURE__ */ b.jsx("kbd", { className: "rounded border px-1.5 py-0.5 text-[10px]", children: "Esc" }),
2369
+ " to close"
2370
+ ]
2371
+ }
2372
+ ),
2373
+ /* @__PURE__ */ b.jsx(Io, {}),
2374
+ /* @__PURE__ */ b.jsx(Mo, {})
2375
+ ] })
2376
+ }
2377
+ );
2378
+ }
2379
+ function zo({ commands: e, open: t, onOpenChange: n }) {
2380
+ const r = te((c) => c.open), o = te((c) => c.close), a = te((c) => c.registerCommands);
2381
+ return An(() => {
2382
+ n?.(!0), r();
2383
+ }), Te(() => {
2384
+ a(e);
2385
+ }, [e, a]), Te(() => {
2386
+ t !== void 0 && (t ? r() : o());
2387
+ }, [t, r, o]), /* @__PURE__ */ b.jsx(
2388
+ Wo,
2389
+ {
2390
+ onOpenChange: (c) => {
2391
+ n?.(c), c || o();
2392
+ }
2393
+ }
2394
+ );
2395
+ }
2396
+ export {
2397
+ zo as GlyphX
2398
+ };