hanap-labs 2.0.5 → 2.0.7

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.
@@ -1,1015 +0,0 @@
1
- import { computed as e, markRaw as t, nextTick as n, onBeforeUnmount as r, ref as i, useId as a, watch as o } from "vue";
2
- //#region node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
3
- var s = Math.min, c = Math.max, l = Math.round, u = Math.floor, d = (e) => ({
4
- x: e,
5
- y: e
6
- }), f = {
7
- left: "right",
8
- right: "left",
9
- bottom: "top",
10
- top: "bottom"
11
- };
12
- function p(e, t, n) {
13
- return c(e, s(t, n));
14
- }
15
- function m(e, t) {
16
- return typeof e == "function" ? e(t) : e;
17
- }
18
- function h(e) {
19
- return e.split("-")[0];
20
- }
21
- function g(e) {
22
- return e.split("-")[1];
23
- }
24
- function _(e) {
25
- return e === "x" ? "y" : "x";
26
- }
27
- function v(e) {
28
- return e === "y" ? "height" : "width";
29
- }
30
- function y(e) {
31
- let t = e[0];
32
- return t === "t" || t === "b" ? "y" : "x";
33
- }
34
- function b(e) {
35
- return _(y(e));
36
- }
37
- function x(e, t, n) {
38
- n === void 0 && (n = !1);
39
- let r = g(e), i = b(e), a = v(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
40
- return t.reference[a] > t.floating[a] && (o = O(o)), [o, O(o)];
41
- }
42
- function S(e) {
43
- let t = O(e);
44
- return [
45
- C(e),
46
- t,
47
- C(t)
48
- ];
49
- }
50
- function C(e) {
51
- return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
52
- }
53
- var w = ["left", "right"], T = ["right", "left"], E = ["top", "bottom"], ee = ["bottom", "top"];
54
- function D(e, t, n) {
55
- switch (e) {
56
- case "top":
57
- case "bottom": return n ? t ? T : w : t ? w : T;
58
- case "left":
59
- case "right": return t ? E : ee;
60
- default: return [];
61
- }
62
- }
63
- function te(e, t, n, r) {
64
- let i = g(e), a = D(h(e), n === "start", r);
65
- return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(C)))), a;
66
- }
67
- function O(e) {
68
- let t = h(e);
69
- return f[t] + e.slice(t.length);
70
- }
71
- function k(e) {
72
- return {
73
- top: 0,
74
- right: 0,
75
- bottom: 0,
76
- left: 0,
77
- ...e
78
- };
79
- }
80
- function A(e) {
81
- return typeof e == "number" ? {
82
- top: e,
83
- right: e,
84
- bottom: e,
85
- left: e
86
- } : k(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 M(e, t, n) {
104
- let { reference: r, floating: i } = e, a = y(t), o = b(t), s = v(o), c = h(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 (g(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 ne(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 } = m(t, e), p = A(f), h = o[d ? u === "floating" ? "reference" : "floating" : u], g = j(await i.getClippingRect({
148
- element: await (i.isElement == null ? void 0 : i.isElement(h)) ?? !0 ? h : h.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 re = 50, ie = 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: ne
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 } = M(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 < re && (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} = M(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
- }, ae = 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: g = !0, ..._ } = m(e, t);
222
- if ((n = i.arrow) != null && n.alignmentOffset) return {};
223
- let v = h(r), b = y(o), C = h(o) === o, w = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), T = d || (C || !g ? [O(o)] : S(o)), E = p !== "none";
224
- !d && E && T.push(...te(o, g, p, w));
225
- let ee = [o, ...T], D = await s.detectOverflow(t, _), k = [], A = i.flip?.overflows || [];
226
- if (l && k.push(D[v]), u) {
227
- let e = x(r, a, w);
228
- k.push(D[e[0]], D[e[1]]);
229
- }
230
- if (A = [...A, {
231
- placement: r,
232
- overflows: k
233
- }], !k.every((e) => e <= 0)) {
234
- let e = (i.flip?.index || 0) + 1, t = ee[e];
235
- if (t && (!(u === "alignment" && b !== y(t)) || A.every((e) => y(e.placement) === b ? 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 = y(e.placement);
248
- return t === b || 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
- }, oe = /* @__PURE__ */ new Set(["left", "top"]);
265
- async function se(e, t) {
266
- let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = h(n), s = g(n), c = y(n) === "y", l = oe.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = m(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: _ } = 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 _ == "number" && (p = s === "end" ? _ * -1 : _), c ? {
276
- x: p * u,
277
- y: f * l
278
- } : {
279
- x: f * l,
280
- y: p * u
281
- };
282
- }
283
- var ce = 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 se(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
- }, le = 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 } = m(e, t), u = {
312
- x: n,
313
- y: r
314
- }, d = await a.detectOverflow(t, l), f = y(h(i)), g = _(f), v = u[g], b = u[f];
315
- if (o) {
316
- let e = g === "y" ? "top" : "left", t = g === "y" ? "bottom" : "right", n = v + d[e], r = v - d[t];
317
- v = p(n, v, r);
318
- }
319
- if (s) {
320
- let e = f === "y" ? "top" : "left", t = f === "y" ? "bottom" : "right", n = b + d[e], r = b - d[t];
321
- b = p(n, b, r);
322
- }
323
- let x = c.fn({
324
- ...t,
325
- [g]: v,
326
- [f]: b
327
- });
328
- return {
329
- ...x,
330
- data: {
331
- x: x.x - n,
332
- y: x.y - r,
333
- enabled: {
334
- [g]: 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 N() {
345
- return typeof window < "u";
346
- }
347
- function P(e) {
348
- return ue(e) ? (e.nodeName || "").toLowerCase() : "#document";
349
- }
350
- function F(e) {
351
- var t;
352
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
353
- }
354
- function I(e) {
355
- return ((ue(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
356
- }
357
- function ue(e) {
358
- return N() ? e instanceof Node || e instanceof F(e).Node : !1;
359
- }
360
- function L(e) {
361
- return N() ? e instanceof Element || e instanceof F(e).Element : !1;
362
- }
363
- function R(e) {
364
- return N() ? e instanceof HTMLElement || e instanceof F(e).HTMLElement : !1;
365
- }
366
- function de(e) {
367
- return !N() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof F(e).ShadowRoot;
368
- }
369
- function z(e) {
370
- let { overflow: t, overflowX: n, overflowY: r, display: i } = U(e);
371
- return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
372
- }
373
- function fe(e) {
374
- return /^(table|td|th)$/.test(P(e));
375
- }
376
- function B(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 pe = /transform|translate|scale|rotate|perspective|filter/, me = /paint|layout|strict|content/, V = (e) => !!e && e !== "none", he;
387
- function ge(e) {
388
- let t = L(e) ? U(e) : e;
389
- return V(t.transform) || V(t.translate) || V(t.scale) || V(t.rotate) || V(t.perspective) || !ve() && (V(t.backdropFilter) || V(t.filter)) || pe.test(t.willChange || "") || me.test(t.contain || "");
390
- }
391
- function _e(e) {
392
- let t = G(e);
393
- for (; R(t) && !H(t);) {
394
- if (ge(t)) return t;
395
- if (B(t)) return null;
396
- t = G(t);
397
- }
398
- return null;
399
- }
400
- function ve() {
401
- return he ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), he;
402
- }
403
- function H(e) {
404
- return /^(html|body|#document)$/.test(P(e));
405
- }
406
- function U(e) {
407
- return F(e).getComputedStyle(e);
408
- }
409
- function W(e) {
410
- return L(e) ? {
411
- scrollLeft: e.scrollLeft,
412
- scrollTop: e.scrollTop
413
- } : {
414
- scrollLeft: e.scrollX,
415
- scrollTop: e.scrollY
416
- };
417
- }
418
- function G(e) {
419
- if (P(e) === "html") return e;
420
- let t = e.assignedSlot || e.parentNode || de(e) && e.host || I(e);
421
- return de(t) ? t.host : t;
422
- }
423
- function ye(e) {
424
- let t = G(e);
425
- return H(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : R(t) && z(t) ? t : ye(t);
426
- }
427
- function K(e, t, n) {
428
- t === void 0 && (t = []), n === void 0 && (n = !0);
429
- let r = ye(e), i = r === e.ownerDocument?.body, a = F(r);
430
- if (i) {
431
- let e = be(a);
432
- return t.concat(a, a.visualViewport || [], z(r) ? r : [], e && n ? K(e) : []);
433
- } else return t.concat(r, K(r, [], n));
434
- }
435
- function be(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 xe(e) {
441
- let t = U(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = R(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = l(n) !== a || l(r) !== o;
442
- return s && (n = a, r = o), {
443
- width: n,
444
- height: r,
445
- $: s
446
- };
447
- }
448
- function Se(e) {
449
- return L(e) ? e : e.contextElement;
450
- }
451
- function q(e) {
452
- let t = Se(e);
453
- if (!R(t)) return d(1);
454
- let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = xe(t), o = (a ? l(n.width) : n.width) / r, s = (a ? l(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 Ce = /* @__PURE__ */ d(0);
461
- function we(e) {
462
- let t = F(e);
463
- return !ve() || !t.visualViewport ? Ce : {
464
- x: t.visualViewport.offsetLeft,
465
- y: t.visualViewport.offsetTop
466
- };
467
- }
468
- function Te(e, t, n) {
469
- return t === void 0 && (t = !1), !n || t && n !== F(e) ? !1 : t;
470
- }
471
- function J(e, t, n, r) {
472
- t === void 0 && (t = !1), n === void 0 && (n = !1);
473
- let i = e.getBoundingClientRect(), a = Se(e), o = d(1);
474
- t && (r ? L(r) && (o = q(r)) : o = q(e));
475
- let s = Te(a, n, r) ? we(a) : d(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, f = i.height / o.y;
476
- if (a) {
477
- let e = F(a), t = r && L(r) ? F(r) : r, n = e, i = be(n);
478
- for (; i && r && t !== n;) {
479
- let e = q(i), t = i.getBoundingClientRect(), r = U(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, f *= e.y, c += a, l += o, n = F(i), i = be(n);
481
- }
482
- }
483
- return j({
484
- width: u,
485
- height: f,
486
- x: c,
487
- y: l
488
- });
489
- }
490
- function Y(e, t) {
491
- let n = W(e).scrollLeft;
492
- return t ? t.left + n : J(I(e)).left + n;
493
- }
494
- function Ee(e, t) {
495
- let n = e.getBoundingClientRect();
496
- return {
497
- x: n.left + t.scrollLeft - Y(e, n),
498
- y: n.top + t.scrollTop
499
- };
500
- }
501
- function De(e) {
502
- let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = I(r), s = t ? B(t.floating) : !1;
503
- if (r === o || s && a) return n;
504
- let c = {
505
- scrollLeft: 0,
506
- scrollTop: 0
507
- }, l = d(1), u = d(0), f = R(r);
508
- if ((f || !f && !a) && ((P(r) !== "body" || z(o)) && (c = W(r)), f)) {
509
- let e = J(r);
510
- l = q(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
511
- }
512
- let p = o && !f && !a ? Ee(o, c) : d(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 Oe(e) {
521
- return Array.from(e.getClientRects());
522
- }
523
- function ke(e) {
524
- let t = I(e), n = W(e), r = e.ownerDocument.body, i = c(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = c(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + Y(e), s = -n.scrollTop;
525
- return U(r).direction === "rtl" && (o += c(t.clientWidth, r.clientWidth) - i), {
526
- width: i,
527
- height: a,
528
- x: o,
529
- y: s
530
- };
531
- }
532
- var Ae = 25;
533
- function je(e, t) {
534
- let n = F(e), r = I(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 = ve();
538
- (!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
539
- }
540
- let l = Y(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 <= Ae && (a -= o);
544
- } else l <= Ae && (a += l);
545
- return {
546
- width: a,
547
- height: o,
548
- x: s,
549
- y: c
550
- };
551
- }
552
- function Me(e, t) {
553
- let n = J(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = R(e) ? q(e) : d(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 Ne(e, t, n) {
562
- let r;
563
- if (t === "viewport") r = je(e, n);
564
- else if (t === "document") r = ke(I(e));
565
- else if (L(t)) r = Me(t, n);
566
- else {
567
- let n = we(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 Pe(e, t) {
578
- let n = G(e);
579
- return n === t || !L(n) || H(n) ? !1 : U(n).position === "fixed" || Pe(n, t);
580
- }
581
- function Fe(e, t) {
582
- let n = t.get(e);
583
- if (n) return n;
584
- let r = K(e, [], !1).filter((e) => L(e) && P(e) !== "body"), i = null, a = U(e).position === "fixed", o = a ? G(e) : e;
585
- for (; L(o) && !H(o);) {
586
- let t = U(o), n = ge(o);
587
- !n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && (i.position === "absolute" || i.position === "fixed") || z(o) && !n && Pe(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = G(o);
588
- }
589
- return t.set(e, r), r;
590
- }
591
- function Ie(e) {
592
- let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? B(t) ? [] : Fe(t, this._c) : [].concat(n), r], o = Ne(t, a[0], i), l = o.top, u = o.right, d = o.bottom, f = o.left;
593
- for (let e = 1; e < a.length; e++) {
594
- let n = Ne(t, a[e], i);
595
- l = c(n.top, l), u = s(n.right, u), d = s(n.bottom, d), f = c(n.left, f);
596
- }
597
- return {
598
- width: u - f,
599
- height: d - l,
600
- x: f,
601
- y: l
602
- };
603
- }
604
- function Le(e) {
605
- let { width: t, height: n } = xe(e);
606
- return {
607
- width: t,
608
- height: n
609
- };
610
- }
611
- function Re(e, t, n) {
612
- let r = R(t), i = I(t), a = n === "fixed", o = J(e, !0, a, t), s = {
613
- scrollLeft: 0,
614
- scrollTop: 0
615
- }, c = d(0);
616
- function l() {
617
- c.x = Y(i);
618
- }
619
- if (r || !r && !a) if ((P(t) !== "body" || z(i)) && (s = W(t)), r) {
620
- let e = J(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 ? Ee(i, s) : d(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 ze(e) {
633
- return U(e).position === "static";
634
- }
635
- function Be(e, t) {
636
- if (!R(e) || U(e).position === "fixed") return null;
637
- if (t) return t(e);
638
- let n = e.offsetParent;
639
- return I(e) === n && (n = n.ownerDocument.body), n;
640
- }
641
- function Ve(e, t) {
642
- let n = F(e);
643
- if (B(e)) return n;
644
- if (!R(e)) {
645
- let t = G(e);
646
- for (; t && !H(t);) {
647
- if (L(t) && !ze(t)) return t;
648
- t = G(t);
649
- }
650
- return n;
651
- }
652
- let r = Be(e, t);
653
- for (; r && fe(r) && ze(r);) r = Be(r, t);
654
- return r && H(r) && ze(r) && !ge(r) ? n : r || _e(e) || n;
655
- }
656
- var He = async function(e) {
657
- let t = this.getOffsetParent || Ve, n = this.getDimensions, r = await n(e.floating);
658
- return {
659
- reference: Re(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 Ue(e) {
669
- return U(e).direction === "rtl";
670
- }
671
- var We = {
672
- convertOffsetParentRelativeRectToViewportRelativeRect: De,
673
- getDocumentElement: I,
674
- getClippingRect: Ie,
675
- getOffsetParent: Ve,
676
- getElementRects: He,
677
- getClientRects: Oe,
678
- getDimensions: Le,
679
- getScale: q,
680
- isElement: L,
681
- isRTL: Ue
682
- };
683
- function Ge(e, t) {
684
- return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
685
- }
686
- function Ke(e, t) {
687
- let n = null, r, i = I(e);
688
- function a() {
689
- var e;
690
- clearTimeout(r), (e = n) == null || e.disconnect(), n = null;
691
- }
692
- function o(l, d) {
693
- l === void 0 && (l = !1), d === void 0 && (d = 1), a();
694
- let f = e.getBoundingClientRect(), { left: p, top: m, width: h, height: g } = f;
695
- if (l || t(), !h || !g) return;
696
- let _ = u(m), v = u(i.clientWidth - (p + h)), y = u(i.clientHeight - (m + g)), b = u(p), x = {
697
- rootMargin: -_ + "px " + -v + "px " + -y + "px " + -b + "px",
698
- threshold: c(0, s(1, d)) || 1
699
- }, S = !0;
700
- function C(t) {
701
- let n = t[0].intersectionRatio;
702
- if (n !== d) {
703
- if (!S) return o();
704
- n ? o(!1, n) : r = setTimeout(() => {
705
- o(!1, 1e-7);
706
- }, 1e3);
707
- }
708
- n === 1 && !Ge(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 qe(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 = Se(e), u = i || a ? [...l ? K(l) : [], ...t ? K(t) : []] : [];
725
- u.forEach((e) => {
726
- i && e.addEventListener("scroll", n, { passive: !0 }), a && e.addEventListener("resize", n);
727
- });
728
- let d = l && s ? Ke(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 ? J(e) : null;
737
- c && g();
738
- function g() {
739
- let t = J(e);
740
- h && !Ge(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 Je = ce, Ye = le, Xe = ae, Ze = (e, t, n) => {
750
- let r = /* @__PURE__ */ new Map(), i = {
751
- platform: We,
752
- ...n
753
- }, a = {
754
- ...i.platform,
755
- _c: r
756
- };
757
- return ie(e, t, {
758
- ...i,
759
- platform: a
760
- });
761
- }, Qe = (e) => typeof e == "object" && !!e && "$el" in e, $e = (e) => typeof HTMLElement > "u" || e === null ? null : e instanceof HTMLElement ? e : Qe(e) && e.$el instanceof HTMLElement ? e.$el : null, et = (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
- }, tt = (e, t, n) => (r) => {
770
- let i = $e(r);
771
- e.value = i, i && !i.id && (i.id = t), et(n, r);
772
- };
773
- function nt(t = {}) {
774
- let { placement: s = "bottom-start", strategy: c = "fixed", gap: l, offset: u = 5, flip: d = !0, shift: f = !0, middleware: p = [], autoUpdate: m = !0 } = t, h = l ?? u, g = i(null), _ = i(null), v = i({
775
- x: 0,
776
- y: 0
777
- }), y = i(s), b = i(!1), x = [
778
- Je(h),
779
- ...d ? [Xe(typeof d == "boolean" ? void 0 : d)] : [],
780
- ...f ? [Ye(typeof f == "boolean" ? void 0 : f)] : [],
781
- ...p
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 Ze(e, t, {
788
- placement: s,
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 (!m) return;
798
- let e = g.value, t = _.value;
799
- e === null || t === null || (C(), S = qe(e, t, w));
800
- }, E = () => {
801
- b.value = !0;
802
- }, ee = () => {
803
- b.value = !1;
804
- }, D = () => {
805
- b.value = !b.value;
806
- }, te = 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
- })), O = (e = {}) => {
816
- let t = e.id ?? a();
817
- return {
818
- ...e,
819
- id: t,
820
- ref: tt(g, t, e.ref),
821
- "aria-controls": e["aria-controls"] ?? _.value?.id ?? "",
822
- "aria-expanded": e["aria-expanded"] ?? b.value
823
- };
824
- }, k = (e = {}) => {
825
- let t = e.id ?? _.value?.id;
826
- return {
827
- ...e,
828
- id: t ?? a(),
829
- ref: tt(_, t ?? a(), e.ref),
830
- style: e.style === void 0 ? te.value : [te.value, e.style],
831
- "aria-hidden": e["aria-hidden"] ?? !b.value
832
- };
833
- }, A = e(() => O()), j = e(() => k()), M = async () => {
834
- if (g.value === null || _.value === null) {
835
- C();
836
- return;
837
- }
838
- await n(), await w(), T();
839
- };
840
- return o(b, (e) => {
841
- e ? M() : C();
842
- }), o([g, _], () => {
843
- b.value ? M() : C();
844
- }), r(C), {
845
- trigger: A,
846
- floating: j,
847
- getTriggerBindings: O,
848
- getFloatingBindings: k,
849
- referenceElement: g,
850
- floatingElement: _,
851
- visible: b,
852
- styles: te,
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 rt = {
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
- }, it = 1, X = i({
868
- id: 0,
869
- visible: !1,
870
- type: "success",
871
- message: "",
872
- title: "",
873
- durationMs: 0,
874
- colorClass: rt.success
875
- }), Z = i(void 0), at = (e) => Array.isArray(e) ? e[0] ?? "Something went wrong" : e, ot = () => {
876
- Z.value !== void 0 && (clearTimeout(Z.value), Z.value = void 0);
877
- }, st = () => {
878
- X.value.visible = !1, ot();
879
- }, Q = (e, t, n, r) => {
880
- ot();
881
- let i = at(t), a = Math.max(r, 0);
882
- X.value = {
883
- id: it++,
884
- visible: !0,
885
- type: e,
886
- message: i,
887
- title: n,
888
- durationMs: a,
889
- colorClass: rt[e]
890
- }, a > 0 && (Z.value = setTimeout(() => {
891
- X.value.visible = !1, Z.value = void 0;
892
- }, a));
893
- }, ct = (e, t, n) => {
894
- Q("success", e, t ?? "", n ?? 3500);
895
- }, lt = (e, t, n) => {
896
- Q("error", e, t ?? "", n ?? 3500);
897
- }, ut = (e, t, n) => {
898
- Q("info", e, t ?? "", n ?? 3500);
899
- }, dt = (e, t, n) => {
900
- Q("warning", e, t ?? "", n ?? 3500);
901
- };
902
- function ft() {
903
- return {
904
- notification: X,
905
- classes: e(() => X.value.colorClass),
906
- success: ct,
907
- error: lt,
908
- info: ut,
909
- warning: dt,
910
- hide: st
911
- };
912
- }
913
- //#endregion
914
- //#region src/composables/ui/usePopup.ts
915
- var pt = 0, mt = null, ht = null, $ = i({
916
- isVisible: !1,
917
- type: "confirm",
918
- component: null,
919
- props: void 0,
920
- isLoading: !1
921
- }), gt = () => {
922
- mt = null, ht = null;
923
- }, _t = () => {
924
- gt(), $.value = {
925
- isVisible: !1,
926
- type: "confirm",
927
- component: null,
928
- props: void 0,
929
- isLoading: !1
930
- };
931
- }, vt = () => {
932
- setTimeout(_t, 300);
933
- }, yt = (e) => {
934
- console.error("[usePopup] popup callback failed", e);
935
- }, bt = (e) => e instanceof Promise, xt = () => {
936
- if (ht !== null) try {
937
- let e = ht();
938
- bt(e) && e.catch(yt);
939
- } catch (e) {
940
- yt(e);
941
- }
942
- }, St = () => {
943
- $.value.isVisible = !1, vt();
944
- }, Ct = (e) => {
945
- let t = {
946
- onConfirm: (n) => (pt === e && (mt = n), t),
947
- onCancel: (n) => (pt === e && (ht = n), t)
948
- };
949
- return t;
950
- }, wt = (e) => {
951
- gt();
952
- let n = pt + 1;
953
- return pt = 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
- isLoading: !1
967
- }, Ct(n)) : ($.value = {
968
- isVisible: !0,
969
- type: "custom",
970
- component: t(e.component),
971
- props: e.props,
972
- isLoading: !1
973
- }, Ct(n));
974
- }, Tt = () => {
975
- $.value.isLoading || (St(), xt());
976
- }, Et = () => {
977
- if (!$.value.isLoading) {
978
- if (mt === null) {
979
- St();
980
- return;
981
- }
982
- try {
983
- let e = mt();
984
- if (!bt(e)) {
985
- St();
986
- return;
987
- }
988
- $.value.isLoading = !0, e.then(() => {
989
- $.value.isLoading = !1, St();
990
- }).catch((e) => {
991
- $.value.isLoading = !1, yt(e);
992
- });
993
- } catch (e) {
994
- yt(e);
995
- }
996
- }
997
- }, Dt = (e) => {
998
- $.value.isLoading = e;
999
- };
1000
- function Ot() {
1001
- return {
1002
- isVisible: e(() => $.value.isVisible),
1003
- type: e(() => $.value.type),
1004
- component: e(() => $.value.component),
1005
- props: e(() => $.value.props),
1006
- isLoading: e(() => $.value.isLoading),
1007
- open: wt,
1008
- close: Tt,
1009
- confirm: Et,
1010
- resetPopupState: _t,
1011
- setLoading: Dt
1012
- };
1013
- }
1014
- //#endregion
1015
- export { ft as n, nt as r, Ot as t };