hanap-labs 6.0.0 → 6.0.2

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.
@@ -0,0 +1,1011 @@
1
+ import { computed as e, markRaw as t, nextTick as n, onBeforeUnmount as r, readonly as i, ref as a, useId as o, watch as s } from "vue";
2
+ //#region node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
3
+ var c = Math.min, l = Math.max, u = Math.round, d = Math.floor, f = (e) => ({
4
+ x: e,
5
+ y: e
6
+ }), p = {
7
+ left: "right",
8
+ right: "left",
9
+ bottom: "top",
10
+ top: "bottom"
11
+ };
12
+ function m(e, t, n) {
13
+ return l(e, c(t, n));
14
+ }
15
+ function h(e, t) {
16
+ return typeof e == "function" ? e(t) : e;
17
+ }
18
+ function g(e) {
19
+ return e.split("-")[0];
20
+ }
21
+ function _(e) {
22
+ return e.split("-")[1];
23
+ }
24
+ function v(e) {
25
+ return e === "x" ? "y" : "x";
26
+ }
27
+ function y(e) {
28
+ return e === "y" ? "height" : "width";
29
+ }
30
+ function b(e) {
31
+ let t = e[0];
32
+ return t === "t" || t === "b" ? "y" : "x";
33
+ }
34
+ function x(e) {
35
+ return v(b(e));
36
+ }
37
+ function S(e, t, n) {
38
+ n === void 0 && (n = !1);
39
+ let r = _(e), i = x(e), a = y(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
40
+ return t.reference[a] > t.floating[a] && (o = k(o)), [o, k(o)];
41
+ }
42
+ function C(e) {
43
+ let t = k(e);
44
+ return [
45
+ w(e),
46
+ t,
47
+ w(t)
48
+ ];
49
+ }
50
+ function w(e) {
51
+ return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
52
+ }
53
+ var T = ["left", "right"], E = ["right", "left"], ee = ["top", "bottom"], D = ["bottom", "top"];
54
+ function O(e, t, n) {
55
+ switch (e) {
56
+ case "top":
57
+ case "bottom": return n ? t ? E : T : t ? T : E;
58
+ case "left":
59
+ case "right": return t ? ee : D;
60
+ default: return [];
61
+ }
62
+ }
63
+ function te(e, t, n, r) {
64
+ let i = _(e), a = O(g(e), n === "start", r);
65
+ return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(w)))), a;
66
+ }
67
+ function k(e) {
68
+ let t = g(e);
69
+ return p[t] + e.slice(t.length);
70
+ }
71
+ function A(e) {
72
+ return {
73
+ top: 0,
74
+ right: 0,
75
+ bottom: 0,
76
+ left: 0,
77
+ ...e
78
+ };
79
+ }
80
+ function ne(e) {
81
+ return typeof e == "number" ? {
82
+ top: e,
83
+ right: e,
84
+ bottom: e,
85
+ left: e
86
+ } : A(e);
87
+ }
88
+ function j(e) {
89
+ let { x: t, y: n, width: r, height: i } = e;
90
+ return {
91
+ width: r,
92
+ height: i,
93
+ top: n,
94
+ left: t,
95
+ right: t + r,
96
+ bottom: n + i,
97
+ x: t,
98
+ y: n
99
+ };
100
+ }
101
+ //#endregion
102
+ //#region node_modules/@floating-ui/core/dist/floating-ui.core.mjs
103
+ function re(e, t, n) {
104
+ let { reference: r, floating: i } = e, a = b(t), o = x(t), s = y(o), c = g(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
105
+ switch (c) {
106
+ case "top":
107
+ p = {
108
+ x: u,
109
+ y: r.y - i.height
110
+ };
111
+ break;
112
+ case "bottom":
113
+ p = {
114
+ x: u,
115
+ y: r.y + r.height
116
+ };
117
+ break;
118
+ case "right":
119
+ p = {
120
+ x: r.x + r.width,
121
+ y: d
122
+ };
123
+ break;
124
+ case "left":
125
+ p = {
126
+ x: r.x - i.width,
127
+ y: d
128
+ };
129
+ break;
130
+ default: p = {
131
+ x: r.x,
132
+ y: r.y
133
+ };
134
+ }
135
+ switch (_(t)) {
136
+ case "start":
137
+ p[o] -= f * (n && l ? -1 : 1);
138
+ break;
139
+ case "end":
140
+ p[o] += f * (n && l ? -1 : 1);
141
+ break;
142
+ }
143
+ return p;
144
+ }
145
+ async function ie(e, t) {
146
+ t === void 0 && (t = {});
147
+ let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = h(t, e), p = ne(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], g = j(await i.getClippingRect({
148
+ element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
149
+ boundary: c,
150
+ rootBoundary: l,
151
+ strategy: s
152
+ })), _ = u === "floating" ? {
153
+ x: n,
154
+ y: r,
155
+ width: a.floating.width,
156
+ height: a.floating.height
157
+ } : a.reference, v = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), y = await (i.isElement == null ? void 0 : i.isElement(v)) && await (i.getScale == null ? void 0 : i.getScale(v)) || {
158
+ x: 1,
159
+ y: 1
160
+ }, b = j(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
161
+ elements: o,
162
+ rect: _,
163
+ offsetParent: v,
164
+ strategy: s
165
+ }) : _);
166
+ return {
167
+ top: (g.top - b.top + p.top) / y.y,
168
+ bottom: (b.bottom - g.bottom + p.bottom) / y.y,
169
+ left: (g.left - b.left + p.left) / y.x,
170
+ right: (b.right - g.right + p.right) / y.x
171
+ };
172
+ }
173
+ var ae = 50, oe = async (e, t, n) => {
174
+ let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
175
+ ...o,
176
+ detectOverflow: ie
177
+ }, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
178
+ reference: e,
179
+ floating: t,
180
+ strategy: i
181
+ }), { x: u, y: d } = re(l, r, c), f = r, p = 0, m = {};
182
+ for (let n = 0; n < a.length; n++) {
183
+ let h = a[n];
184
+ if (!h) continue;
185
+ let { name: g, fn: _ } = h, { x: v, y, data: b, reset: x } = await _({
186
+ x: u,
187
+ y: d,
188
+ initialPlacement: r,
189
+ placement: f,
190
+ strategy: i,
191
+ middlewareData: m,
192
+ rects: l,
193
+ platform: s,
194
+ elements: {
195
+ reference: e,
196
+ floating: t
197
+ }
198
+ });
199
+ u = v ?? u, d = y ?? d, m[g] = {
200
+ ...m[g],
201
+ ...b
202
+ }, x && p < ae && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
203
+ reference: e,
204
+ floating: t,
205
+ strategy: i
206
+ }) : x.rects), {x: u, y: d} = re(l, f, c)), n = -1);
207
+ }
208
+ return {
209
+ x: u,
210
+ y: d,
211
+ placement: f,
212
+ strategy: i,
213
+ middlewareData: m
214
+ };
215
+ }, se = function(e) {
216
+ return e === void 0 && (e = {}), {
217
+ name: "flip",
218
+ options: e,
219
+ async fn(t) {
220
+ var n;
221
+ let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ..._ } = h(e, t);
222
+ if ((n = i.arrow) != null && n.alignmentOffset) return {};
223
+ let v = g(r), y = b(o), x = g(o) === o, w = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), T = d || (x || !m ? [k(o)] : C(o)), E = p !== "none";
224
+ !d && E && T.push(...te(o, m, p, w));
225
+ let ee = [o, ...T], D = await s.detectOverflow(t, _), O = [], A = i.flip?.overflows || [];
226
+ if (l && O.push(D[v]), u) {
227
+ let e = S(r, a, w);
228
+ O.push(D[e[0]], D[e[1]]);
229
+ }
230
+ if (A = [...A, {
231
+ placement: r,
232
+ overflows: O
233
+ }], !O.every((e) => e <= 0)) {
234
+ let e = (i.flip?.index || 0) + 1, t = ee[e];
235
+ if (t && (!(u === "alignment" && y !== b(t)) || A.every((e) => b(e.placement) === y ? e.overflows[0] > 0 : !0))) return {
236
+ data: {
237
+ index: e,
238
+ overflows: A
239
+ },
240
+ reset: { placement: t }
241
+ };
242
+ let n = A.filter((e) => e.overflows[0] <= 0).sort((e, t) => e.overflows[1] - t.overflows[1])[0]?.placement;
243
+ if (!n) switch (f) {
244
+ case "bestFit": {
245
+ let e = A.filter((e) => {
246
+ if (E) {
247
+ let t = b(e.placement);
248
+ return t === y || t === "y";
249
+ }
250
+ return !0;
251
+ }).map((e) => [e.placement, e.overflows.filter((e) => e > 0).reduce((e, t) => e + t, 0)]).sort((e, t) => e[1] - t[1])[0]?.[0];
252
+ e && (n = e);
253
+ break;
254
+ }
255
+ case "initialPlacement":
256
+ n = o;
257
+ break;
258
+ }
259
+ if (r !== n) return { reset: { placement: n } };
260
+ }
261
+ return {};
262
+ }
263
+ };
264
+ }, ce = /* @__PURE__ */ new Set(["left", "top"]);
265
+ async function le(e, t) {
266
+ let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = g(n), s = _(n), c = b(n) === "y", l = ce.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = h(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
267
+ mainAxis: d,
268
+ crossAxis: 0,
269
+ alignmentAxis: null
270
+ } : {
271
+ mainAxis: d.mainAxis || 0,
272
+ crossAxis: d.crossAxis || 0,
273
+ alignmentAxis: d.alignmentAxis
274
+ };
275
+ return s && typeof m == "number" && (p = s === "end" ? m * -1 : m), c ? {
276
+ x: p * u,
277
+ y: f * l
278
+ } : {
279
+ x: f * l,
280
+ y: p * u
281
+ };
282
+ }
283
+ var ue = function(e) {
284
+ return e === void 0 && (e = 0), {
285
+ name: "offset",
286
+ options: e,
287
+ async fn(t) {
288
+ var n;
289
+ let { x: r, y: i, placement: a, middlewareData: o } = t, s = await le(t, e);
290
+ return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
291
+ x: r + s.x,
292
+ y: i + s.y,
293
+ data: {
294
+ ...s,
295
+ placement: a
296
+ }
297
+ };
298
+ }
299
+ };
300
+ }, de = function(e) {
301
+ return e === void 0 && (e = {}), {
302
+ name: "shift",
303
+ options: e,
304
+ async fn(t) {
305
+ let { x: n, y: r, placement: i, platform: a } = t, { mainAxis: o = !0, crossAxis: s = !1, limiter: c = { fn: (e) => {
306
+ let { x: t, y: n } = e;
307
+ return {
308
+ x: t,
309
+ y: n
310
+ };
311
+ } }, ...l } = h(e, t), u = {
312
+ x: n,
313
+ y: r
314
+ }, d = await a.detectOverflow(t, l), f = b(g(i)), p = v(f), _ = u[p], y = u[f];
315
+ if (o) {
316
+ let e = p === "y" ? "top" : "left", t = p === "y" ? "bottom" : "right", n = _ + d[e], r = _ - d[t];
317
+ _ = m(n, _, r);
318
+ }
319
+ if (s) {
320
+ let e = f === "y" ? "top" : "left", t = f === "y" ? "bottom" : "right", n = y + d[e], r = y - d[t];
321
+ y = m(n, y, r);
322
+ }
323
+ let x = c.fn({
324
+ ...t,
325
+ [p]: _,
326
+ [f]: y
327
+ });
328
+ return {
329
+ ...x,
330
+ data: {
331
+ x: x.x - n,
332
+ y: x.y - r,
333
+ enabled: {
334
+ [p]: o,
335
+ [f]: s
336
+ }
337
+ }
338
+ };
339
+ }
340
+ };
341
+ };
342
+ //#endregion
343
+ //#region node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
344
+ function M() {
345
+ return typeof window < "u";
346
+ }
347
+ function N(e) {
348
+ return fe(e) ? (e.nodeName || "").toLowerCase() : "#document";
349
+ }
350
+ function P(e) {
351
+ var t;
352
+ return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
353
+ }
354
+ function F(e) {
355
+ return ((fe(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
356
+ }
357
+ function fe(e) {
358
+ return M() ? e instanceof Node || e instanceof P(e).Node : !1;
359
+ }
360
+ function I(e) {
361
+ return M() ? e instanceof Element || e instanceof P(e).Element : !1;
362
+ }
363
+ function L(e) {
364
+ return M() ? e instanceof HTMLElement || e instanceof P(e).HTMLElement : !1;
365
+ }
366
+ function pe(e) {
367
+ return !M() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof P(e).ShadowRoot;
368
+ }
369
+ function R(e) {
370
+ let { overflow: t, overflowX: n, overflowY: r, display: i } = H(e);
371
+ return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
372
+ }
373
+ function me(e) {
374
+ return /^(table|td|th)$/.test(N(e));
375
+ }
376
+ function z(e) {
377
+ try {
378
+ if (e.matches(":popover-open")) return !0;
379
+ } catch {}
380
+ try {
381
+ return e.matches(":modal");
382
+ } catch {
383
+ return !1;
384
+ }
385
+ }
386
+ var he = /transform|translate|scale|rotate|perspective|filter/, ge = /paint|layout|strict|content/, B = (e) => !!e && e !== "none", _e;
387
+ function ve(e) {
388
+ let t = I(e) ? H(e) : e;
389
+ return B(t.transform) || B(t.translate) || B(t.scale) || B(t.rotate) || B(t.perspective) || !be() && (B(t.backdropFilter) || B(t.filter)) || he.test(t.willChange || "") || ge.test(t.contain || "");
390
+ }
391
+ function ye(e) {
392
+ let t = W(e);
393
+ for (; L(t) && !V(t);) {
394
+ if (ve(t)) return t;
395
+ if (z(t)) return null;
396
+ t = W(t);
397
+ }
398
+ return null;
399
+ }
400
+ function be() {
401
+ return _e ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), _e;
402
+ }
403
+ function V(e) {
404
+ return /^(html|body|#document)$/.test(N(e));
405
+ }
406
+ function H(e) {
407
+ return P(e).getComputedStyle(e);
408
+ }
409
+ function U(e) {
410
+ return I(e) ? {
411
+ scrollLeft: e.scrollLeft,
412
+ scrollTop: e.scrollTop
413
+ } : {
414
+ scrollLeft: e.scrollX,
415
+ scrollTop: e.scrollY
416
+ };
417
+ }
418
+ function W(e) {
419
+ if (N(e) === "html") return e;
420
+ let t = e.assignedSlot || e.parentNode || pe(e) && e.host || F(e);
421
+ return pe(t) ? t.host : t;
422
+ }
423
+ function xe(e) {
424
+ let t = W(e);
425
+ return V(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : L(t) && R(t) ? t : xe(t);
426
+ }
427
+ function G(e, t, n) {
428
+ t === void 0 && (t = []), n === void 0 && (n = !0);
429
+ let r = xe(e), i = r === e.ownerDocument?.body, a = P(r);
430
+ if (i) {
431
+ let e = Se(a);
432
+ return t.concat(a, a.visualViewport || [], R(r) ? r : [], e && n ? G(e) : []);
433
+ } else return t.concat(r, G(r, [], n));
434
+ }
435
+ function Se(e) {
436
+ return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
437
+ }
438
+ //#endregion
439
+ //#region node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
440
+ function Ce(e) {
441
+ let t = H(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = L(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = u(n) !== a || u(r) !== o;
442
+ return s && (n = a, r = o), {
443
+ width: n,
444
+ height: r,
445
+ $: s
446
+ };
447
+ }
448
+ function we(e) {
449
+ return I(e) ? e : e.contextElement;
450
+ }
451
+ function K(e) {
452
+ let t = we(e);
453
+ if (!L(t)) return f(1);
454
+ let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = Ce(t), o = (a ? u(n.width) : n.width) / r, s = (a ? u(n.height) : n.height) / i;
455
+ return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
456
+ x: o,
457
+ y: s
458
+ };
459
+ }
460
+ var Te = /* @__PURE__ */ f(0);
461
+ function Ee(e) {
462
+ let t = P(e);
463
+ return !be() || !t.visualViewport ? Te : {
464
+ x: t.visualViewport.offsetLeft,
465
+ y: t.visualViewport.offsetTop
466
+ };
467
+ }
468
+ function De(e, t, n) {
469
+ return t === void 0 && (t = !1), !n || t && n !== P(e) ? !1 : t;
470
+ }
471
+ function q(e, t, n, r) {
472
+ t === void 0 && (t = !1), n === void 0 && (n = !1);
473
+ let i = e.getBoundingClientRect(), a = we(e), o = f(1);
474
+ t && (r ? I(r) && (o = K(r)) : o = K(e));
475
+ let s = De(a, n, r) ? Ee(a) : f(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
476
+ if (a) {
477
+ let e = P(a), t = r && I(r) ? P(r) : r, n = e, i = Se(n);
478
+ for (; i && r && t !== n;) {
479
+ let e = K(i), t = i.getBoundingClientRect(), r = H(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
480
+ c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = P(i), i = Se(n);
481
+ }
482
+ }
483
+ return j({
484
+ width: u,
485
+ height: d,
486
+ x: c,
487
+ y: l
488
+ });
489
+ }
490
+ function J(e, t) {
491
+ let n = U(e).scrollLeft;
492
+ return t ? t.left + n : q(F(e)).left + n;
493
+ }
494
+ function Oe(e, t) {
495
+ let n = e.getBoundingClientRect();
496
+ return {
497
+ x: n.left + t.scrollLeft - J(e, n),
498
+ y: n.top + t.scrollTop
499
+ };
500
+ }
501
+ function ke(e) {
502
+ let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = F(r), s = t ? z(t.floating) : !1;
503
+ if (r === o || s && a) return n;
504
+ let c = {
505
+ scrollLeft: 0,
506
+ scrollTop: 0
507
+ }, l = f(1), u = f(0), d = L(r);
508
+ if ((d || !d && !a) && ((N(r) !== "body" || R(o)) && (c = U(r)), d)) {
509
+ let e = q(r);
510
+ l = K(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
511
+ }
512
+ let p = o && !d && !a ? Oe(o, c) : f(0);
513
+ return {
514
+ width: n.width * l.x,
515
+ height: n.height * l.y,
516
+ x: n.x * l.x - c.scrollLeft * l.x + u.x + p.x,
517
+ y: n.y * l.y - c.scrollTop * l.y + u.y + p.y
518
+ };
519
+ }
520
+ function Ae(e) {
521
+ return Array.from(e.getClientRects());
522
+ }
523
+ function je(e) {
524
+ let t = F(e), n = U(e), r = e.ownerDocument.body, i = l(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = l(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + J(e), s = -n.scrollTop;
525
+ return H(r).direction === "rtl" && (o += l(t.clientWidth, r.clientWidth) - i), {
526
+ width: i,
527
+ height: a,
528
+ x: o,
529
+ y: s
530
+ };
531
+ }
532
+ var Me = 25;
533
+ function Ne(e, t) {
534
+ let n = P(e), r = F(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
535
+ if (i) {
536
+ a = i.width, o = i.height;
537
+ let e = be();
538
+ (!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
539
+ }
540
+ let l = J(r);
541
+ if (l <= 0) {
542
+ let e = r.ownerDocument, t = e.body, n = getComputedStyle(t), i = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, o = Math.abs(r.clientWidth - t.clientWidth - i);
543
+ o <= Me && (a -= o);
544
+ } else l <= Me && (a += l);
545
+ return {
546
+ width: a,
547
+ height: o,
548
+ x: s,
549
+ y: c
550
+ };
551
+ }
552
+ function Pe(e, t) {
553
+ let n = q(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = L(e) ? K(e) : f(1);
554
+ return {
555
+ width: e.clientWidth * a.x,
556
+ height: e.clientHeight * a.y,
557
+ x: i * a.x,
558
+ y: r * a.y
559
+ };
560
+ }
561
+ function Fe(e, t, n) {
562
+ let r;
563
+ if (t === "viewport") r = Ne(e, n);
564
+ else if (t === "document") r = je(F(e));
565
+ else if (I(t)) r = Pe(t, n);
566
+ else {
567
+ let n = Ee(e);
568
+ r = {
569
+ x: t.x - n.x,
570
+ y: t.y - n.y,
571
+ width: t.width,
572
+ height: t.height
573
+ };
574
+ }
575
+ return j(r);
576
+ }
577
+ function Ie(e, t) {
578
+ let n = W(e);
579
+ return n === t || !I(n) || V(n) ? !1 : H(n).position === "fixed" || Ie(n, t);
580
+ }
581
+ function Le(e, t) {
582
+ let n = t.get(e);
583
+ if (n) return n;
584
+ let r = G(e, [], !1).filter((e) => I(e) && N(e) !== "body"), i = null, a = H(e).position === "fixed", o = a ? W(e) : e;
585
+ for (; I(o) && !V(o);) {
586
+ let t = H(o), n = ve(o);
587
+ !n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && (i.position === "absolute" || i.position === "fixed") || R(o) && !n && Ie(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = W(o);
588
+ }
589
+ return t.set(e, r), r;
590
+ }
591
+ function Re(e) {
592
+ let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? z(t) ? [] : Le(t, this._c) : [].concat(n), r], o = Fe(t, a[0], i), s = o.top, u = o.right, d = o.bottom, f = o.left;
593
+ for (let e = 1; e < a.length; e++) {
594
+ let n = Fe(t, a[e], i);
595
+ s = l(n.top, s), u = c(n.right, u), d = c(n.bottom, d), f = l(n.left, f);
596
+ }
597
+ return {
598
+ width: u - f,
599
+ height: d - s,
600
+ x: f,
601
+ y: s
602
+ };
603
+ }
604
+ function ze(e) {
605
+ let { width: t, height: n } = Ce(e);
606
+ return {
607
+ width: t,
608
+ height: n
609
+ };
610
+ }
611
+ function Be(e, t, n) {
612
+ let r = L(t), i = F(t), a = n === "fixed", o = q(e, !0, a, t), s = {
613
+ scrollLeft: 0,
614
+ scrollTop: 0
615
+ }, c = f(0);
616
+ function l() {
617
+ c.x = J(i);
618
+ }
619
+ if (r || !r && !a) if ((N(t) !== "body" || R(i)) && (s = U(t)), r) {
620
+ let e = q(t, !0, a, t);
621
+ c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
622
+ } else i && l();
623
+ a && !r && i && l();
624
+ let u = i && !r && !a ? Oe(i, s) : f(0);
625
+ return {
626
+ x: o.left + s.scrollLeft - c.x - u.x,
627
+ y: o.top + s.scrollTop - c.y - u.y,
628
+ width: o.width,
629
+ height: o.height
630
+ };
631
+ }
632
+ function Ve(e) {
633
+ return H(e).position === "static";
634
+ }
635
+ function He(e, t) {
636
+ if (!L(e) || H(e).position === "fixed") return null;
637
+ if (t) return t(e);
638
+ let n = e.offsetParent;
639
+ return F(e) === n && (n = n.ownerDocument.body), n;
640
+ }
641
+ function Ue(e, t) {
642
+ let n = P(e);
643
+ if (z(e)) return n;
644
+ if (!L(e)) {
645
+ let t = W(e);
646
+ for (; t && !V(t);) {
647
+ if (I(t) && !Ve(t)) return t;
648
+ t = W(t);
649
+ }
650
+ return n;
651
+ }
652
+ let r = He(e, t);
653
+ for (; r && me(r) && Ve(r);) r = He(r, t);
654
+ return r && V(r) && Ve(r) && !ve(r) ? n : r || ye(e) || n;
655
+ }
656
+ var We = async function(e) {
657
+ let t = this.getOffsetParent || Ue, n = this.getDimensions, r = await n(e.floating);
658
+ return {
659
+ reference: Be(e.reference, await t(e.floating), e.strategy),
660
+ floating: {
661
+ x: 0,
662
+ y: 0,
663
+ width: r.width,
664
+ height: r.height
665
+ }
666
+ };
667
+ };
668
+ function Ge(e) {
669
+ return H(e).direction === "rtl";
670
+ }
671
+ var Ke = {
672
+ convertOffsetParentRelativeRectToViewportRelativeRect: ke,
673
+ getDocumentElement: F,
674
+ getClippingRect: Re,
675
+ getOffsetParent: Ue,
676
+ getElementRects: We,
677
+ getClientRects: Ae,
678
+ getDimensions: ze,
679
+ getScale: K,
680
+ isElement: I,
681
+ isRTL: Ge
682
+ };
683
+ function qe(e, t) {
684
+ return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
685
+ }
686
+ function Je(e, t) {
687
+ let n = null, r, i = F(e);
688
+ function a() {
689
+ var e;
690
+ clearTimeout(r), (e = n) == null || e.disconnect(), n = null;
691
+ }
692
+ function o(s, u) {
693
+ s === void 0 && (s = !1), u === void 0 && (u = 1), a();
694
+ let f = e.getBoundingClientRect(), { left: p, top: m, width: h, height: g } = f;
695
+ if (s || t(), !h || !g) return;
696
+ let _ = d(m), v = d(i.clientWidth - (p + h)), y = d(i.clientHeight - (m + g)), b = d(p), x = {
697
+ rootMargin: -_ + "px " + -v + "px " + -y + "px " + -b + "px",
698
+ threshold: l(0, c(1, u)) || 1
699
+ }, S = !0;
700
+ function C(t) {
701
+ let n = t[0].intersectionRatio;
702
+ if (n !== u) {
703
+ if (!S) return o();
704
+ n ? o(!1, n) : r = setTimeout(() => {
705
+ o(!1, 1e-7);
706
+ }, 1e3);
707
+ }
708
+ n === 1 && !qe(f, e.getBoundingClientRect()) && o(), S = !1;
709
+ }
710
+ try {
711
+ n = new IntersectionObserver(C, {
712
+ ...x,
713
+ root: i.ownerDocument
714
+ });
715
+ } catch {
716
+ n = new IntersectionObserver(C, x);
717
+ }
718
+ n.observe(e);
719
+ }
720
+ return o(!0), a;
721
+ }
722
+ function Ye(e, t, n, r) {
723
+ r === void 0 && (r = {});
724
+ let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = we(e), u = i || a ? [...l ? G(l) : [], ...t ? G(t) : []] : [];
725
+ u.forEach((e) => {
726
+ i && e.addEventListener("scroll", n, { passive: !0 }), a && e.addEventListener("resize", n);
727
+ });
728
+ let d = l && s ? Je(l, n) : null, f = -1, p = null;
729
+ o && (p = new ResizeObserver((e) => {
730
+ let [r] = e;
731
+ r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
732
+ var e;
733
+ (e = p) == null || e.observe(t);
734
+ })), n();
735
+ }), l && !c && p.observe(l), t && p.observe(t));
736
+ let m, h = c ? q(e) : null;
737
+ c && g();
738
+ function g() {
739
+ let t = q(e);
740
+ h && !qe(h, t) && n(), h = t, m = requestAnimationFrame(g);
741
+ }
742
+ return n(), () => {
743
+ var e;
744
+ u.forEach((e) => {
745
+ i && e.removeEventListener("scroll", n), a && e.removeEventListener("resize", n);
746
+ }), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
747
+ };
748
+ }
749
+ var Xe = ue, Ze = de, Qe = se, $e = (e, t, n) => {
750
+ let r = /* @__PURE__ */ new Map(), i = {
751
+ platform: Ke,
752
+ ...n
753
+ }, a = {
754
+ ...i.platform,
755
+ _c: r
756
+ };
757
+ return oe(e, t, {
758
+ ...i,
759
+ platform: a
760
+ });
761
+ }, et = (e) => typeof e == "object" && !!e && "$el" in e, tt = (e) => typeof HTMLElement > "u" || e === null ? null : e instanceof HTMLElement ? e : et(e) && e.$el instanceof HTMLElement ? e.$el : null, nt = (e, t) => {
762
+ if (e != null) {
763
+ if (typeof e == "function") {
764
+ e(t, {});
765
+ return;
766
+ }
767
+ typeof e == "object" && "value" in e && (e.value = t);
768
+ }
769
+ }, rt = (e, t, n) => (r) => {
770
+ let i = tt(r);
771
+ e.value = i, i && !i.id && (i.id = t), nt(n, r);
772
+ };
773
+ function it(t = {}) {
774
+ let { placement: i = "bottom-start", strategy: c = "fixed", offset: l = 5, flip: u = !0, shift: d = !0, middleware: f = [], autoUpdate: p = !0 } = t, m = o(), h = o(), g = a(null), _ = a(null), v = a({
775
+ x: 0,
776
+ y: 0
777
+ }), y = a(i), b = a(!1), x = [
778
+ Xe(l),
779
+ ...u ? [Qe(typeof u == "boolean" ? void 0 : u)] : [],
780
+ ...d ? [Ze(typeof d == "boolean" ? void 0 : d)] : [],
781
+ ...f
782
+ ], S = null, C = () => {
783
+ S !== null && (S(), S = null);
784
+ }, w = async () => {
785
+ let e = g.value, t = _.value;
786
+ if (e === null || t === null) return;
787
+ let n = await $e(e, t, {
788
+ placement: i,
789
+ strategy: c,
790
+ middleware: x
791
+ });
792
+ v.value = {
793
+ x: n.x,
794
+ y: n.y
795
+ }, y.value = n.placement;
796
+ }, T = () => {
797
+ if (!p) return;
798
+ let e = g.value, t = _.value;
799
+ e === null || t === null || (C(), S = Ye(e, t, w));
800
+ }, E = () => {
801
+ b.value = !0;
802
+ }, ee = () => {
803
+ b.value = !1;
804
+ }, D = () => {
805
+ b.value = !b.value;
806
+ }, O = e(() => ({
807
+ position: c,
808
+ top: `${v.value.y}px`,
809
+ left: `${v.value.x}px`,
810
+ visibility: b.value ? "visible" : "hidden",
811
+ opacity: +!!b.value,
812
+ pointerEvents: b.value ? "auto" : "none",
813
+ transform: b.value ? "scale(1)" : "scale(0.98)",
814
+ transition: "opacity 150ms ease, transform 150ms ease"
815
+ })), te = (e = {}) => {
816
+ let t = e.id ?? m;
817
+ return {
818
+ ...e,
819
+ id: t,
820
+ ref: rt(g, t, e.ref),
821
+ "aria-controls": e["aria-controls"] ?? _.value?.id ?? h,
822
+ "aria-expanded": e["aria-expanded"] ?? b.value
823
+ };
824
+ }, k = (e = {}) => {
825
+ let t = e.id ?? _.value?.id ?? h;
826
+ return {
827
+ ...e,
828
+ id: t,
829
+ ref: rt(_, t, e.ref),
830
+ style: e.style === void 0 ? O.value : [O.value, e.style],
831
+ "aria-hidden": e["aria-hidden"] ?? !b.value
832
+ };
833
+ }, A = e(() => te()), ne = e(() => k()), j = async () => {
834
+ if (g.value === null || _.value === null) {
835
+ C();
836
+ return;
837
+ }
838
+ await n(), await w(), T();
839
+ };
840
+ return s(b, (e) => {
841
+ e ? j() : C();
842
+ }), s([g, _], () => {
843
+ b.value ? j() : C();
844
+ }), r(C), {
845
+ trigger: A,
846
+ floating: ne,
847
+ getTriggerBindings: te,
848
+ getFloatingBindings: k,
849
+ referenceElement: g,
850
+ floatingElement: _,
851
+ visible: b,
852
+ styles: O,
853
+ resolvedPlacement: y,
854
+ show: E,
855
+ hide: ee,
856
+ toggle: D,
857
+ updatePosition: w
858
+ };
859
+ }
860
+ //#endregion
861
+ //#region src/composables/ui/useNotify.ts
862
+ var at = {
863
+ success: "hl-bg-success/10 hl-text-success hl-border hl-border-success/20",
864
+ error: "hl-bg-danger/10 hl-text-danger hl-border hl-border-danger/20",
865
+ info: "hl-bg-info/10 hl-text-info hl-border hl-border-info/20",
866
+ warning: "hl-bg-warning/10 hl-text-warning hl-border hl-border-warning/20"
867
+ }, ot = 1, Y = a({
868
+ id: 0,
869
+ visible: !1,
870
+ type: "success",
871
+ message: "",
872
+ title: "",
873
+ durationMs: 0,
874
+ colorClass: at.success
875
+ }), X = a(void 0), st = e(() => Y.value.colorClass), ct = (e) => Array.isArray(e) ? e.length > 0 ? e.join("\n") : "Something went wrong" : e, lt = () => {
876
+ X.value !== void 0 && (clearTimeout(X.value), X.value = void 0);
877
+ }, ut = () => {
878
+ Y.value.visible = !1, lt();
879
+ }, Z = (e, t, n, r) => {
880
+ lt();
881
+ let i = ct(t), a = Math.max(r, 0);
882
+ Y.value = {
883
+ id: ot++,
884
+ visible: !0,
885
+ type: e,
886
+ message: i,
887
+ title: n,
888
+ durationMs: a,
889
+ colorClass: at[e]
890
+ }, a > 0 && (X.value = setTimeout(() => {
891
+ Y.value.visible = !1, X.value = void 0;
892
+ }, a));
893
+ }, dt = (e, t, n) => {
894
+ Z("success", e, t ?? "", n ?? 3500);
895
+ }, ft = (e, t, n) => {
896
+ Z("error", e, t ?? "", n ?? 3500);
897
+ }, pt = (e, t, n) => {
898
+ Z("info", e, t ?? "", n ?? 3500);
899
+ }, mt = (e, t, n) => {
900
+ Z("warning", e, t ?? "", n ?? 3500);
901
+ };
902
+ function ht() {
903
+ return {
904
+ notification: i(Y),
905
+ classes: st,
906
+ success: dt,
907
+ error: ft,
908
+ info: pt,
909
+ warning: mt,
910
+ hide: ut
911
+ };
912
+ }
913
+ //#endregion
914
+ //#region src/composables/ui/usePopup.ts
915
+ var Q = 0, gt = null, _t = null, vt = 300, $ = a({
916
+ isVisible: !1,
917
+ type: "confirm",
918
+ component: null,
919
+ props: void 0,
920
+ loading: !1
921
+ }), yt = () => {
922
+ gt = null, _t = null;
923
+ }, bt = () => {
924
+ yt(), $.value = {
925
+ isVisible: !1,
926
+ type: "confirm",
927
+ component: null,
928
+ props: void 0,
929
+ loading: !1
930
+ };
931
+ }, xt = () => {
932
+ setTimeout(bt, vt);
933
+ }, St = (e) => {
934
+ console.error("[usePopup] popup callback failed", e);
935
+ }, Ct = (e) => e instanceof Promise, wt = () => {
936
+ if (_t !== null) try {
937
+ let e = _t();
938
+ Ct(e) && e.catch(St);
939
+ } catch (e) {
940
+ St(e);
941
+ }
942
+ }, Tt = () => {
943
+ $.value.isVisible = !1, xt();
944
+ }, Et = (e) => {
945
+ let t = {
946
+ onConfirm: (n) => (Q === e && (gt = n), t),
947
+ onCancel: (n) => (Q === e && (_t = n), t)
948
+ };
949
+ return t;
950
+ }, Dt = (e) => {
951
+ yt();
952
+ let n = Q + 1;
953
+ return Q = n, e.type === "confirm" ? ($.value = {
954
+ isVisible: !0,
955
+ type: "confirm",
956
+ component: null,
957
+ props: {
958
+ title: e.title,
959
+ message: e.message,
960
+ confirmText: e.confirmText,
961
+ cancelText: e.cancelText,
962
+ icon: e.icon,
963
+ iconSource: e.iconSource,
964
+ hideIcon: e.hideIcon
965
+ },
966
+ loading: !1
967
+ }, Et(n)) : ($.value = {
968
+ isVisible: !0,
969
+ type: "custom",
970
+ component: t(e.component),
971
+ props: e.props,
972
+ loading: !1
973
+ }, Et(n));
974
+ }, Ot = () => {
975
+ $.value.loading || (Tt(), wt());
976
+ }, kt = () => {
977
+ if (!$.value.loading) {
978
+ if (gt === null) {
979
+ Tt();
980
+ return;
981
+ }
982
+ try {
983
+ let e = gt();
984
+ if (!Ct(e)) {
985
+ Tt();
986
+ return;
987
+ }
988
+ $.value.loading = !0, e.then(() => {
989
+ $.value.loading = !1, Tt();
990
+ }).catch((e) => {
991
+ $.value.loading = !1, St(e);
992
+ });
993
+ } catch (e) {
994
+ St(e);
995
+ }
996
+ }
997
+ };
998
+ function At() {
999
+ return {
1000
+ isVisible: e(() => $.value.isVisible),
1001
+ loading: e(() => $.value.loading),
1002
+ type: e(() => $.value.type),
1003
+ component: e(() => $.value.component),
1004
+ props: e(() => $.value.props),
1005
+ open: Dt,
1006
+ close: Ot,
1007
+ confirm: kt
1008
+ };
1009
+ }
1010
+ //#endregion
1011
+ export { ht as n, it as r, At as t };