@oneb/ui-vue 0.2.13 → 0.2.15

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,1829 @@
1
+ import { d as pt, e as mt, _ as ht, r as gt, f as vt } from "./OneHelpMenu-7eb95bc3.js";
2
+ import { defineComponent as xe, ref as D, watch as Ge, onBeforeUnmount as Je, provide as wt, computed as I, openBlock as v, createElementBlock as y, createElementVNode as p, renderSlot as V, normalizeProps as pe, guardReactiveProps as me, createCommentVNode as T, withDirectives as Le, normalizeClass as E, toDisplayString as _, vShow as yt, createBlock as _e, withCtx as re, createVNode as Re, unref as H, normalizeStyle as he, Fragment as j, renderList as Z, onMounted as Ze, onUnmounted as xt, vModelText as Fe, mergeProps as de, createTextVNode as Pe, nextTick as Me } from "vue";
3
+ import { _ as Qe } from "./_plugin-vue_export-helper-dad06003.js";
4
+ import { _ as We } from "./OneAvatar.vue_vue_type_script_setup_true_lang-08ab80dd.js";
5
+ const ge = Math.min, Q = Math.max, ve = Math.round, fe = Math.floor, z = (e) => ({
6
+ x: e,
7
+ y: e
8
+ }), bt = {
9
+ left: "right",
10
+ right: "left",
11
+ bottom: "top",
12
+ top: "bottom"
13
+ }, kt = {
14
+ start: "end",
15
+ end: "start"
16
+ };
17
+ function je(e, t, o) {
18
+ return Q(e, ge(t, o));
19
+ }
20
+ function be(e, t) {
21
+ return typeof e == "function" ? e(t) : e;
22
+ }
23
+ function ee(e) {
24
+ return e.split("-")[0];
25
+ }
26
+ function ke(e) {
27
+ return e.split("-")[1];
28
+ }
29
+ function et(e) {
30
+ return e === "x" ? "y" : "x";
31
+ }
32
+ function tt(e) {
33
+ return e === "y" ? "height" : "width";
34
+ }
35
+ function oe(e) {
36
+ return ["top", "bottom"].includes(ee(e)) ? "y" : "x";
37
+ }
38
+ function nt(e) {
39
+ return et(oe(e));
40
+ }
41
+ function Ct(e, t, o) {
42
+ o === void 0 && (o = !1);
43
+ const n = ke(e), s = nt(e), i = tt(s);
44
+ let l = s === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
45
+ return t.reference[i] > t.floating[i] && (l = we(l)), [l, we(l)];
46
+ }
47
+ function At(e) {
48
+ const t = we(e);
49
+ return [Ee(e), t, Ee(t)];
50
+ }
51
+ function Ee(e) {
52
+ return e.replace(/start|end/g, (t) => kt[t]);
53
+ }
54
+ function Ot(e, t, o) {
55
+ const n = ["left", "right"], s = ["right", "left"], i = ["top", "bottom"], l = ["bottom", "top"];
56
+ switch (e) {
57
+ case "top":
58
+ case "bottom":
59
+ return o ? t ? s : n : t ? n : s;
60
+ case "left":
61
+ case "right":
62
+ return t ? i : l;
63
+ default:
64
+ return [];
65
+ }
66
+ }
67
+ function Rt(e, t, o, n) {
68
+ const s = ke(e);
69
+ let i = Ot(ee(e), o === "start", n);
70
+ return s && (i = i.map((l) => l + "-" + s), t && (i = i.concat(i.map(Ee)))), i;
71
+ }
72
+ function we(e) {
73
+ return e.replace(/left|right|bottom|top/g, (t) => bt[t]);
74
+ }
75
+ function Mt(e) {
76
+ return {
77
+ top: 0,
78
+ right: 0,
79
+ bottom: 0,
80
+ left: 0,
81
+ ...e
82
+ };
83
+ }
84
+ function $t(e) {
85
+ return typeof e != "number" ? Mt(e) : {
86
+ top: e,
87
+ right: e,
88
+ bottom: e,
89
+ left: e
90
+ };
91
+ }
92
+ function ye(e) {
93
+ const {
94
+ x: t,
95
+ y: o,
96
+ width: n,
97
+ height: s
98
+ } = e;
99
+ return {
100
+ width: n,
101
+ height: s,
102
+ top: o,
103
+ left: t,
104
+ right: t + n,
105
+ bottom: o + s,
106
+ x: t,
107
+ y: o
108
+ };
109
+ }
110
+ function Ie(e, t, o) {
111
+ let {
112
+ reference: n,
113
+ floating: s
114
+ } = e;
115
+ const i = oe(t), l = nt(t), r = tt(l), c = ee(t), u = i === "y", d = n.x + n.width / 2 - s.width / 2, m = n.y + n.height / 2 - s.height / 2, w = n[r] / 2 - s[r] / 2;
116
+ let g;
117
+ switch (c) {
118
+ case "top":
119
+ g = {
120
+ x: d,
121
+ y: n.y - s.height
122
+ };
123
+ break;
124
+ case "bottom":
125
+ g = {
126
+ x: d,
127
+ y: n.y + n.height
128
+ };
129
+ break;
130
+ case "right":
131
+ g = {
132
+ x: n.x + n.width,
133
+ y: m
134
+ };
135
+ break;
136
+ case "left":
137
+ g = {
138
+ x: n.x - s.width,
139
+ y: m
140
+ };
141
+ break;
142
+ default:
143
+ g = {
144
+ x: n.x,
145
+ y: n.y
146
+ };
147
+ }
148
+ switch (ke(t)) {
149
+ case "start":
150
+ g[l] -= w * (o && u ? -1 : 1);
151
+ break;
152
+ case "end":
153
+ g[l] += w * (o && u ? -1 : 1);
154
+ break;
155
+ }
156
+ return g;
157
+ }
158
+ const Lt = async (e, t, o) => {
159
+ const {
160
+ placement: n = "bottom",
161
+ strategy: s = "absolute",
162
+ middleware: i = [],
163
+ platform: l
164
+ } = o, r = i.filter(Boolean), c = await (l.isRTL == null ? void 0 : l.isRTL(t));
165
+ let u = await l.getElementRects({
166
+ reference: e,
167
+ floating: t,
168
+ strategy: s
169
+ }), {
170
+ x: d,
171
+ y: m
172
+ } = Ie(u, n, c), w = n, g = {}, f = 0;
173
+ for (let x = 0; x < r.length; x++) {
174
+ const {
175
+ name: b,
176
+ fn: A
177
+ } = r[x], {
178
+ x: R,
179
+ y: O,
180
+ data: S,
181
+ reset: $
182
+ } = await A({
183
+ x: d,
184
+ y: m,
185
+ initialPlacement: n,
186
+ placement: w,
187
+ strategy: s,
188
+ middlewareData: g,
189
+ rects: u,
190
+ platform: l,
191
+ elements: {
192
+ reference: e,
193
+ floating: t
194
+ }
195
+ });
196
+ d = R ?? d, m = O ?? m, g = {
197
+ ...g,
198
+ [b]: {
199
+ ...g[b],
200
+ ...S
201
+ }
202
+ }, $ && f <= 50 && (f++, typeof $ == "object" && ($.placement && (w = $.placement), $.rects && (u = $.rects === !0 ? await l.getElementRects({
203
+ reference: e,
204
+ floating: t,
205
+ strategy: s
206
+ }) : $.rects), {
207
+ x: d,
208
+ y: m
209
+ } = Ie(u, w, c)), x = -1);
210
+ }
211
+ return {
212
+ x: d,
213
+ y: m,
214
+ placement: w,
215
+ strategy: s,
216
+ middlewareData: g
217
+ };
218
+ };
219
+ async function ot(e, t) {
220
+ var o;
221
+ t === void 0 && (t = {});
222
+ const {
223
+ x: n,
224
+ y: s,
225
+ platform: i,
226
+ rects: l,
227
+ elements: r,
228
+ strategy: c
229
+ } = e, {
230
+ boundary: u = "clippingAncestors",
231
+ rootBoundary: d = "viewport",
232
+ elementContext: m = "floating",
233
+ altBoundary: w = !1,
234
+ padding: g = 0
235
+ } = be(t, e), f = $t(g), b = r[w ? m === "floating" ? "reference" : "floating" : m], A = ye(await i.getClippingRect({
236
+ element: (o = await (i.isElement == null ? void 0 : i.isElement(b))) == null || o ? b : b.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(r.floating)),
237
+ boundary: u,
238
+ rootBoundary: d,
239
+ strategy: c
240
+ })), R = m === "floating" ? {
241
+ x: n,
242
+ y: s,
243
+ width: l.floating.width,
244
+ height: l.floating.height
245
+ } : l.reference, O = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(r.floating)), S = await (i.isElement == null ? void 0 : i.isElement(O)) ? await (i.getScale == null ? void 0 : i.getScale(O)) || {
246
+ x: 1,
247
+ y: 1
248
+ } : {
249
+ x: 1,
250
+ y: 1
251
+ }, $ = ye(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
252
+ elements: r,
253
+ rect: R,
254
+ offsetParent: O,
255
+ strategy: c
256
+ }) : R);
257
+ return {
258
+ top: (A.top - $.top + f.top) / S.y,
259
+ bottom: ($.bottom - A.bottom + f.bottom) / S.y,
260
+ left: (A.left - $.left + f.left) / S.x,
261
+ right: ($.right - A.right + f.right) / S.x
262
+ };
263
+ }
264
+ const _t = function(e) {
265
+ return e === void 0 && (e = {}), {
266
+ name: "flip",
267
+ options: e,
268
+ async fn(t) {
269
+ var o, n;
270
+ const {
271
+ placement: s,
272
+ middlewareData: i,
273
+ rects: l,
274
+ initialPlacement: r,
275
+ platform: c,
276
+ elements: u
277
+ } = t, {
278
+ mainAxis: d = !0,
279
+ crossAxis: m = !0,
280
+ fallbackPlacements: w,
281
+ fallbackStrategy: g = "bestFit",
282
+ fallbackAxisSideDirection: f = "none",
283
+ flipAlignment: x = !0,
284
+ ...b
285
+ } = be(e, t);
286
+ if ((o = i.arrow) != null && o.alignmentOffset)
287
+ return {};
288
+ const A = ee(s), R = oe(r), O = ee(r) === r, S = await (c.isRTL == null ? void 0 : c.isRTL(u.floating)), $ = w || (O || !x ? [we(r)] : At(r)), U = f !== "none";
289
+ !w && U && $.push(...Rt(r, x, f, S));
290
+ const q = [r, ...$], ie = await ot(t, b), J = [];
291
+ let Y = ((n = i.flip) == null ? void 0 : n.overflows) || [];
292
+ if (d && J.push(ie[A]), m) {
293
+ const k = Ct(s, l, S);
294
+ J.push(ie[k[0]], ie[k[1]]);
295
+ }
296
+ if (Y = [...Y, {
297
+ placement: s,
298
+ overflows: J
299
+ }], !J.every((k) => k <= 0)) {
300
+ var ue, a;
301
+ const k = (((ue = i.flip) == null ? void 0 : ue.index) || 0) + 1, C = q[k];
302
+ if (C)
303
+ return {
304
+ data: {
305
+ index: k,
306
+ overflows: Y
307
+ },
308
+ reset: {
309
+ placement: C
310
+ }
311
+ };
312
+ let L = (a = Y.filter((M) => M.overflows[0] <= 0).sort((M, F) => M.overflows[1] - F.overflows[1])[0]) == null ? void 0 : a.placement;
313
+ if (!L)
314
+ switch (g) {
315
+ case "bestFit": {
316
+ var h;
317
+ const M = (h = Y.filter((F) => {
318
+ if (U) {
319
+ const X = oe(F.placement);
320
+ return X === R || // Create a bias to the `y` side axis due to horizontal
321
+ // reading directions favoring greater width.
322
+ X === "y";
323
+ }
324
+ return !0;
325
+ }).map((F) => [F.placement, F.overflows.filter((X) => X > 0).reduce((X, ft) => X + ft, 0)]).sort((F, X) => F[1] - X[1])[0]) == null ? void 0 : h[0];
326
+ M && (L = M);
327
+ break;
328
+ }
329
+ case "initialPlacement":
330
+ L = r;
331
+ break;
332
+ }
333
+ if (s !== L)
334
+ return {
335
+ reset: {
336
+ placement: L
337
+ }
338
+ };
339
+ }
340
+ return {};
341
+ }
342
+ };
343
+ };
344
+ async function Et(e, t) {
345
+ const {
346
+ placement: o,
347
+ platform: n,
348
+ elements: s
349
+ } = e, i = await (n.isRTL == null ? void 0 : n.isRTL(s.floating)), l = ee(o), r = ke(o), c = oe(o) === "y", u = ["left", "top"].includes(l) ? -1 : 1, d = i && c ? -1 : 1, m = be(t, e);
350
+ let {
351
+ mainAxis: w,
352
+ crossAxis: g,
353
+ alignmentAxis: f
354
+ } = typeof m == "number" ? {
355
+ mainAxis: m,
356
+ crossAxis: 0,
357
+ alignmentAxis: null
358
+ } : {
359
+ mainAxis: m.mainAxis || 0,
360
+ crossAxis: m.crossAxis || 0,
361
+ alignmentAxis: m.alignmentAxis
362
+ };
363
+ return r && typeof f == "number" && (g = r === "end" ? f * -1 : f), c ? {
364
+ x: g * d,
365
+ y: w * u
366
+ } : {
367
+ x: w * u,
368
+ y: g * d
369
+ };
370
+ }
371
+ const St = function(e) {
372
+ return e === void 0 && (e = 0), {
373
+ name: "offset",
374
+ options: e,
375
+ async fn(t) {
376
+ var o, n;
377
+ const {
378
+ x: s,
379
+ y: i,
380
+ placement: l,
381
+ middlewareData: r
382
+ } = t, c = await Et(t, e);
383
+ return l === ((o = r.offset) == null ? void 0 : o.placement) && (n = r.arrow) != null && n.alignmentOffset ? {} : {
384
+ x: s + c.x,
385
+ y: i + c.y,
386
+ data: {
387
+ ...c,
388
+ placement: l
389
+ }
390
+ };
391
+ }
392
+ };
393
+ }, Tt = function(e) {
394
+ return e === void 0 && (e = {}), {
395
+ name: "shift",
396
+ options: e,
397
+ async fn(t) {
398
+ const {
399
+ x: o,
400
+ y: n,
401
+ placement: s
402
+ } = t, {
403
+ mainAxis: i = !0,
404
+ crossAxis: l = !1,
405
+ limiter: r = {
406
+ fn: (b) => {
407
+ let {
408
+ x: A,
409
+ y: R
410
+ } = b;
411
+ return {
412
+ x: A,
413
+ y: R
414
+ };
415
+ }
416
+ },
417
+ ...c
418
+ } = be(e, t), u = {
419
+ x: o,
420
+ y: n
421
+ }, d = await ot(t, c), m = oe(ee(s)), w = et(m);
422
+ let g = u[w], f = u[m];
423
+ if (i) {
424
+ const b = w === "y" ? "top" : "left", A = w === "y" ? "bottom" : "right", R = g + d[b], O = g - d[A];
425
+ g = je(R, g, O);
426
+ }
427
+ if (l) {
428
+ const b = m === "y" ? "top" : "left", A = m === "y" ? "bottom" : "right", R = f + d[b], O = f - d[A];
429
+ f = je(R, f, O);
430
+ }
431
+ const x = r.fn({
432
+ ...t,
433
+ [w]: g,
434
+ [m]: f
435
+ });
436
+ return {
437
+ ...x,
438
+ data: {
439
+ x: x.x - o,
440
+ y: x.y - n,
441
+ enabled: {
442
+ [w]: i,
443
+ [m]: l
444
+ }
445
+ }
446
+ };
447
+ }
448
+ };
449
+ };
450
+ function Ce() {
451
+ return typeof window < "u";
452
+ }
453
+ function le(e) {
454
+ return st(e) ? (e.nodeName || "").toLowerCase() : "#document";
455
+ }
456
+ function B(e) {
457
+ var t;
458
+ return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
459
+ }
460
+ function K(e) {
461
+ var t;
462
+ return (t = (st(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
463
+ }
464
+ function st(e) {
465
+ return Ce() ? e instanceof Node || e instanceof B(e).Node : !1;
466
+ }
467
+ function P(e) {
468
+ return Ce() ? e instanceof Element || e instanceof B(e).Element : !1;
469
+ }
470
+ function N(e) {
471
+ return Ce() ? e instanceof HTMLElement || e instanceof B(e).HTMLElement : !1;
472
+ }
473
+ function ze(e) {
474
+ return !Ce() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof B(e).ShadowRoot;
475
+ }
476
+ function ce(e) {
477
+ const {
478
+ overflow: t,
479
+ overflowX: o,
480
+ overflowY: n,
481
+ display: s
482
+ } = W(e);
483
+ return /auto|scroll|overlay|hidden|clip/.test(t + n + o) && !["inline", "contents"].includes(s);
484
+ }
485
+ function Dt(e) {
486
+ return ["table", "td", "th"].includes(le(e));
487
+ }
488
+ function Ae(e) {
489
+ return [":popover-open", ":modal"].some((t) => {
490
+ try {
491
+ return e.matches(t);
492
+ } catch {
493
+ return !1;
494
+ }
495
+ });
496
+ }
497
+ function Te(e) {
498
+ const t = De(), o = P(e) ? W(e) : e;
499
+ return ["transform", "translate", "scale", "rotate", "perspective"].some((n) => o[n] ? o[n] !== "none" : !1) || (o.containerType ? o.containerType !== "normal" : !1) || !t && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !t && (o.filter ? o.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((n) => (o.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (o.contain || "").includes(n));
500
+ }
501
+ function Vt(e) {
502
+ let t = G(e);
503
+ for (; N(t) && !se(t); ) {
504
+ if (Te(t))
505
+ return t;
506
+ if (Ae(t))
507
+ return null;
508
+ t = G(t);
509
+ }
510
+ return null;
511
+ }
512
+ function De() {
513
+ return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
514
+ }
515
+ function se(e) {
516
+ return ["html", "body", "#document"].includes(le(e));
517
+ }
518
+ function W(e) {
519
+ return B(e).getComputedStyle(e);
520
+ }
521
+ function Oe(e) {
522
+ return P(e) ? {
523
+ scrollLeft: e.scrollLeft,
524
+ scrollTop: e.scrollTop
525
+ } : {
526
+ scrollLeft: e.scrollX,
527
+ scrollTop: e.scrollY
528
+ };
529
+ }
530
+ function G(e) {
531
+ if (le(e) === "html")
532
+ return e;
533
+ const t = (
534
+ // Step into the shadow DOM of the parent of a slotted node.
535
+ e.assignedSlot || // DOM Element detected.
536
+ e.parentNode || // ShadowRoot detected.
537
+ ze(e) && e.host || // Fallback.
538
+ K(e)
539
+ );
540
+ return ze(t) ? t.host : t;
541
+ }
542
+ function lt(e) {
543
+ const t = G(e);
544
+ return se(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : N(t) && ce(t) ? t : lt(t);
545
+ }
546
+ function ae(e, t, o) {
547
+ var n;
548
+ t === void 0 && (t = []), o === void 0 && (o = !0);
549
+ const s = lt(e), i = s === ((n = e.ownerDocument) == null ? void 0 : n.body), l = B(s);
550
+ if (i) {
551
+ const r = Se(l);
552
+ return t.concat(l, l.visualViewport || [], ce(s) ? s : [], r && o ? ae(r) : []);
553
+ }
554
+ return t.concat(s, ae(s, [], o));
555
+ }
556
+ function Se(e) {
557
+ return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
558
+ }
559
+ function it(e) {
560
+ const t = W(e);
561
+ let o = parseFloat(t.width) || 0, n = parseFloat(t.height) || 0;
562
+ const s = N(e), i = s ? e.offsetWidth : o, l = s ? e.offsetHeight : n, r = ve(o) !== i || ve(n) !== l;
563
+ return r && (o = i, n = l), {
564
+ width: o,
565
+ height: n,
566
+ $: r
567
+ };
568
+ }
569
+ function Ve(e) {
570
+ return P(e) ? e : e.contextElement;
571
+ }
572
+ function ne(e) {
573
+ const t = Ve(e);
574
+ if (!N(t))
575
+ return z(1);
576
+ const o = t.getBoundingClientRect(), {
577
+ width: n,
578
+ height: s,
579
+ $: i
580
+ } = it(t);
581
+ let l = (i ? ve(o.width) : o.width) / n, r = (i ? ve(o.height) : o.height) / s;
582
+ return (!l || !Number.isFinite(l)) && (l = 1), (!r || !Number.isFinite(r)) && (r = 1), {
583
+ x: l,
584
+ y: r
585
+ };
586
+ }
587
+ const Bt = /* @__PURE__ */ z(0);
588
+ function rt(e) {
589
+ const t = B(e);
590
+ return !De() || !t.visualViewport ? Bt : {
591
+ x: t.visualViewport.offsetLeft,
592
+ y: t.visualViewport.offsetTop
593
+ };
594
+ }
595
+ function Ft(e, t, o) {
596
+ return t === void 0 && (t = !1), !o || t && o !== B(e) ? !1 : t;
597
+ }
598
+ function te(e, t, o, n) {
599
+ t === void 0 && (t = !1), o === void 0 && (o = !1);
600
+ const s = e.getBoundingClientRect(), i = Ve(e);
601
+ let l = z(1);
602
+ t && (n ? P(n) && (l = ne(n)) : l = ne(e));
603
+ const r = Ft(i, o, n) ? rt(i) : z(0);
604
+ let c = (s.left + r.x) / l.x, u = (s.top + r.y) / l.y, d = s.width / l.x, m = s.height / l.y;
605
+ if (i) {
606
+ const w = B(i), g = n && P(n) ? B(n) : n;
607
+ let f = w, x = Se(f);
608
+ for (; x && n && g !== f; ) {
609
+ const b = ne(x), A = x.getBoundingClientRect(), R = W(x), O = A.left + (x.clientLeft + parseFloat(R.paddingLeft)) * b.x, S = A.top + (x.clientTop + parseFloat(R.paddingTop)) * b.y;
610
+ c *= b.x, u *= b.y, d *= b.x, m *= b.y, c += O, u += S, f = B(x), x = Se(f);
611
+ }
612
+ }
613
+ return ye({
614
+ width: d,
615
+ height: m,
616
+ x: c,
617
+ y: u
618
+ });
619
+ }
620
+ function Be(e, t) {
621
+ const o = Oe(e).scrollLeft;
622
+ return t ? t.left + o : te(K(e)).left + o;
623
+ }
624
+ function at(e, t, o) {
625
+ o === void 0 && (o = !1);
626
+ const n = e.getBoundingClientRect(), s = n.left + t.scrollLeft - (o ? 0 : (
627
+ // RTL <body> scrollbar.
628
+ Be(e, n)
629
+ )), i = n.top + t.scrollTop;
630
+ return {
631
+ x: s,
632
+ y: i
633
+ };
634
+ }
635
+ function Pt(e) {
636
+ let {
637
+ elements: t,
638
+ rect: o,
639
+ offsetParent: n,
640
+ strategy: s
641
+ } = e;
642
+ const i = s === "fixed", l = K(n), r = t ? Ae(t.floating) : !1;
643
+ if (n === l || r && i)
644
+ return o;
645
+ let c = {
646
+ scrollLeft: 0,
647
+ scrollTop: 0
648
+ }, u = z(1);
649
+ const d = z(0), m = N(n);
650
+ if ((m || !m && !i) && ((le(n) !== "body" || ce(l)) && (c = Oe(n)), N(n))) {
651
+ const g = te(n);
652
+ u = ne(n), d.x = g.x + n.clientLeft, d.y = g.y + n.clientTop;
653
+ }
654
+ const w = l && !m && !i ? at(l, c, !0) : z(0);
655
+ return {
656
+ width: o.width * u.x,
657
+ height: o.height * u.y,
658
+ x: o.x * u.x - c.scrollLeft * u.x + d.x + w.x,
659
+ y: o.y * u.y - c.scrollTop * u.y + d.y + w.y
660
+ };
661
+ }
662
+ function Wt(e) {
663
+ return Array.from(e.getClientRects());
664
+ }
665
+ function jt(e) {
666
+ const t = K(e), o = Oe(e), n = e.ownerDocument.body, s = Q(t.scrollWidth, t.clientWidth, n.scrollWidth, n.clientWidth), i = Q(t.scrollHeight, t.clientHeight, n.scrollHeight, n.clientHeight);
667
+ let l = -o.scrollLeft + Be(e);
668
+ const r = -o.scrollTop;
669
+ return W(n).direction === "rtl" && (l += Q(t.clientWidth, n.clientWidth) - s), {
670
+ width: s,
671
+ height: i,
672
+ x: l,
673
+ y: r
674
+ };
675
+ }
676
+ function It(e, t) {
677
+ const o = B(e), n = K(e), s = o.visualViewport;
678
+ let i = n.clientWidth, l = n.clientHeight, r = 0, c = 0;
679
+ if (s) {
680
+ i = s.width, l = s.height;
681
+ const u = De();
682
+ (!u || u && t === "fixed") && (r = s.offsetLeft, c = s.offsetTop);
683
+ }
684
+ return {
685
+ width: i,
686
+ height: l,
687
+ x: r,
688
+ y: c
689
+ };
690
+ }
691
+ function zt(e, t) {
692
+ const o = te(e, !0, t === "fixed"), n = o.top + e.clientTop, s = o.left + e.clientLeft, i = N(e) ? ne(e) : z(1), l = e.clientWidth * i.x, r = e.clientHeight * i.y, c = s * i.x, u = n * i.y;
693
+ return {
694
+ width: l,
695
+ height: r,
696
+ x: c,
697
+ y: u
698
+ };
699
+ }
700
+ function Ne(e, t, o) {
701
+ let n;
702
+ if (t === "viewport")
703
+ n = It(e, o);
704
+ else if (t === "document")
705
+ n = jt(K(e));
706
+ else if (P(t))
707
+ n = zt(t, o);
708
+ else {
709
+ const s = rt(e);
710
+ n = {
711
+ x: t.x - s.x,
712
+ y: t.y - s.y,
713
+ width: t.width,
714
+ height: t.height
715
+ };
716
+ }
717
+ return ye(n);
718
+ }
719
+ function ct(e, t) {
720
+ const o = G(e);
721
+ return o === t || !P(o) || se(o) ? !1 : W(o).position === "fixed" || ct(o, t);
722
+ }
723
+ function Nt(e, t) {
724
+ const o = t.get(e);
725
+ if (o)
726
+ return o;
727
+ let n = ae(e, [], !1).filter((r) => P(r) && le(r) !== "body"), s = null;
728
+ const i = W(e).position === "fixed";
729
+ let l = i ? G(e) : e;
730
+ for (; P(l) && !se(l); ) {
731
+ const r = W(l), c = Te(l);
732
+ !c && r.position === "fixed" && (s = null), (i ? !c && !s : !c && r.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ce(l) && !c && ct(e, l)) ? n = n.filter((d) => d !== l) : s = r, l = G(l);
733
+ }
734
+ return t.set(e, n), n;
735
+ }
736
+ function Kt(e) {
737
+ let {
738
+ element: t,
739
+ boundary: o,
740
+ rootBoundary: n,
741
+ strategy: s
742
+ } = e;
743
+ const l = [...o === "clippingAncestors" ? Ae(t) ? [] : Nt(t, this._c) : [].concat(o), n], r = l[0], c = l.reduce((u, d) => {
744
+ const m = Ne(t, d, s);
745
+ return u.top = Q(m.top, u.top), u.right = ge(m.right, u.right), u.bottom = ge(m.bottom, u.bottom), u.left = Q(m.left, u.left), u;
746
+ }, Ne(t, r, s));
747
+ return {
748
+ width: c.right - c.left,
749
+ height: c.bottom - c.top,
750
+ x: c.left,
751
+ y: c.top
752
+ };
753
+ }
754
+ function Ht(e) {
755
+ const {
756
+ width: t,
757
+ height: o
758
+ } = it(e);
759
+ return {
760
+ width: t,
761
+ height: o
762
+ };
763
+ }
764
+ function Ut(e, t, o) {
765
+ const n = N(t), s = K(t), i = o === "fixed", l = te(e, !0, i, t);
766
+ let r = {
767
+ scrollLeft: 0,
768
+ scrollTop: 0
769
+ };
770
+ const c = z(0);
771
+ if (n || !n && !i)
772
+ if ((le(t) !== "body" || ce(s)) && (r = Oe(t)), n) {
773
+ const w = te(t, !0, i, t);
774
+ c.x = w.x + t.clientLeft, c.y = w.y + t.clientTop;
775
+ } else
776
+ s && (c.x = Be(s));
777
+ const u = s && !n && !i ? at(s, r) : z(0), d = l.left + r.scrollLeft - c.x - u.x, m = l.top + r.scrollTop - c.y - u.y;
778
+ return {
779
+ x: d,
780
+ y: m,
781
+ width: l.width,
782
+ height: l.height
783
+ };
784
+ }
785
+ function $e(e) {
786
+ return W(e).position === "static";
787
+ }
788
+ function Ke(e, t) {
789
+ if (!N(e) || W(e).position === "fixed")
790
+ return null;
791
+ if (t)
792
+ return t(e);
793
+ let o = e.offsetParent;
794
+ return K(e) === o && (o = o.ownerDocument.body), o;
795
+ }
796
+ function ut(e, t) {
797
+ const o = B(e);
798
+ if (Ae(e))
799
+ return o;
800
+ if (!N(e)) {
801
+ let s = G(e);
802
+ for (; s && !se(s); ) {
803
+ if (P(s) && !$e(s))
804
+ return s;
805
+ s = G(s);
806
+ }
807
+ return o;
808
+ }
809
+ let n = Ke(e, t);
810
+ for (; n && Dt(n) && $e(n); )
811
+ n = Ke(n, t);
812
+ return n && se(n) && $e(n) && !Te(n) ? o : n || Vt(e) || o;
813
+ }
814
+ const qt = async function(e) {
815
+ const t = this.getOffsetParent || ut, o = this.getDimensions, n = await o(e.floating);
816
+ return {
817
+ reference: Ut(e.reference, await t(e.floating), e.strategy),
818
+ floating: {
819
+ x: 0,
820
+ y: 0,
821
+ width: n.width,
822
+ height: n.height
823
+ }
824
+ };
825
+ };
826
+ function Yt(e) {
827
+ return W(e).direction === "rtl";
828
+ }
829
+ const Xt = {
830
+ convertOffsetParentRelativeRectToViewportRelativeRect: Pt,
831
+ getDocumentElement: K,
832
+ getClippingRect: Kt,
833
+ getOffsetParent: ut,
834
+ getElementRects: qt,
835
+ getClientRects: Wt,
836
+ getDimensions: Ht,
837
+ getScale: ne,
838
+ isElement: P,
839
+ isRTL: Yt
840
+ };
841
+ function dt(e, t) {
842
+ return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
843
+ }
844
+ function Gt(e, t) {
845
+ let o = null, n;
846
+ const s = K(e);
847
+ function i() {
848
+ var r;
849
+ clearTimeout(n), (r = o) == null || r.disconnect(), o = null;
850
+ }
851
+ function l(r, c) {
852
+ r === void 0 && (r = !1), c === void 0 && (c = 1), i();
853
+ const u = e.getBoundingClientRect(), {
854
+ left: d,
855
+ top: m,
856
+ width: w,
857
+ height: g
858
+ } = u;
859
+ if (r || t(), !w || !g)
860
+ return;
861
+ const f = fe(m), x = fe(s.clientWidth - (d + w)), b = fe(s.clientHeight - (m + g)), A = fe(d), O = {
862
+ rootMargin: -f + "px " + -x + "px " + -b + "px " + -A + "px",
863
+ threshold: Q(0, ge(1, c)) || 1
864
+ };
865
+ let S = !0;
866
+ function $(U) {
867
+ const q = U[0].intersectionRatio;
868
+ if (q !== c) {
869
+ if (!S)
870
+ return l();
871
+ q ? l(!1, q) : n = setTimeout(() => {
872
+ l(!1, 1e-7);
873
+ }, 1e3);
874
+ }
875
+ q === 1 && !dt(u, e.getBoundingClientRect()) && l(), S = !1;
876
+ }
877
+ try {
878
+ o = new IntersectionObserver($, {
879
+ ...O,
880
+ // Handle <iframe>s
881
+ root: s.ownerDocument
882
+ });
883
+ } catch {
884
+ o = new IntersectionObserver($, O);
885
+ }
886
+ o.observe(e);
887
+ }
888
+ return l(!0), i;
889
+ }
890
+ function Jt(e, t, o, n) {
891
+ n === void 0 && (n = {});
892
+ const {
893
+ ancestorScroll: s = !0,
894
+ ancestorResize: i = !0,
895
+ elementResize: l = typeof ResizeObserver == "function",
896
+ layoutShift: r = typeof IntersectionObserver == "function",
897
+ animationFrame: c = !1
898
+ } = n, u = Ve(e), d = s || i ? [...u ? ae(u) : [], ...ae(t)] : [];
899
+ d.forEach((A) => {
900
+ s && A.addEventListener("scroll", o, {
901
+ passive: !0
902
+ }), i && A.addEventListener("resize", o);
903
+ });
904
+ const m = u && r ? Gt(u, o) : null;
905
+ let w = -1, g = null;
906
+ l && (g = new ResizeObserver((A) => {
907
+ let [R] = A;
908
+ R && R.target === u && g && (g.unobserve(t), cancelAnimationFrame(w), w = requestAnimationFrame(() => {
909
+ var O;
910
+ (O = g) == null || O.observe(t);
911
+ })), o();
912
+ }), u && !c && g.observe(u), g.observe(t));
913
+ let f, x = c ? te(e) : null;
914
+ c && b();
915
+ function b() {
916
+ const A = te(e);
917
+ x && !dt(x, A) && o(), x = A, f = requestAnimationFrame(b);
918
+ }
919
+ return o(), () => {
920
+ var A;
921
+ d.forEach((R) => {
922
+ s && R.removeEventListener("scroll", o), i && R.removeEventListener("resize", o);
923
+ }), m == null || m(), (A = g) == null || A.disconnect(), g = null, c && cancelAnimationFrame(f);
924
+ };
925
+ }
926
+ const He = St, Ue = Tt, qe = _t, Ye = (e, t, o) => {
927
+ const n = /* @__PURE__ */ new Map(), s = {
928
+ platform: Xt,
929
+ ...o
930
+ }, i = {
931
+ ...s.platform,
932
+ _c: n
933
+ };
934
+ return Lt(e, t, {
935
+ ...s,
936
+ platform: i
937
+ });
938
+ }, Zt = ["data-opened"], Qt = {
939
+ key: 0,
940
+ class: "text-sm text-secondary-content px-3 py-2 text-left"
941
+ }, en = /* @__PURE__ */ xe({
942
+ __name: "OneDropdownAuto",
943
+ props: pt,
944
+ emits: ["open", "close"],
945
+ setup(e, { emit: t }) {
946
+ const o = e, n = D(!1), s = D(null), i = D(null);
947
+ let l = null;
948
+ Ge(n, (d) => {
949
+ d && i.value && s.value ? (Ye(i.value, s.value, {
950
+ placement: o.stick ? o.stick : "bottom-start",
951
+ // Розташування меню нижче кнопки, вирівняне зліва
952
+ middleware: [He(5), qe(), Ue({ padding: 8 })]
953
+ // Відступ у 4px від кнопки
954
+ }).then(({ x: m, y: w }) => {
955
+ Object.assign(s.value.style, {
956
+ left: `${m}px`,
957
+ top: `${w}px`
958
+ });
959
+ }), l = Jt(i.value, s.value, () => {
960
+ Ye(i.value, s.value, {
961
+ placement: o.stick ? o.stick : "bottom-start",
962
+ middleware: [He(4), qe(), Ue({ padding: 8 })]
963
+ }).then(({ x: m, y: w }) => {
964
+ Object.assign(s.value.style, {
965
+ left: `${m}px`,
966
+ top: `${w}px`
967
+ });
968
+ });
969
+ })) : l && (l(), l = null);
970
+ }), Je(() => {
971
+ l && l();
972
+ });
973
+ const r = t, c = () => {
974
+ n.value = !n.value, n.value ? r("open") : r("close");
975
+ };
976
+ wt("OneDropdown", {
977
+ onToggle: c
978
+ });
979
+ const u = I(() => [
980
+ "absolute z-10 w-fit rounded-md bg-white",
981
+ "py-1 shadow-lg ring-black ring-opacity-5 focus:outline-none",
982
+ "overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"
983
+ ]);
984
+ return (d, m) => (v(), y("div", {
985
+ class: "relative inline-block",
986
+ "data-opened": n.value
987
+ }, [
988
+ p("div", {
989
+ ref_key: "buttonRef",
990
+ ref: i
991
+ }, [
992
+ V(d.$slots, "button", pe(me({ onToggle: c, isExpanded: n.value })))
993
+ ], 512),
994
+ n.value ? (v(), y("div", {
995
+ key: 0,
996
+ class: "fixed top-0 left-0 w-screen h-screen z-10",
997
+ onClick: c
998
+ })) : T("", !0),
999
+ Le(p("div", {
1000
+ ref_key: "menuRef",
1001
+ ref: s,
1002
+ class: E(["menu", u.value]),
1003
+ role: "menu",
1004
+ "aria-orientation": "vertical",
1005
+ tabindex: "-1",
1006
+ style: { display: "none" }
1007
+ }, [
1008
+ d.title ? (v(), y("div", Qt, _(d.title), 1)) : T("", !0),
1009
+ V(d.$slots, "menu", pe(me({ onToggle: c })))
1010
+ ], 2), [
1011
+ [yt, n.value]
1012
+ ])
1013
+ ], 8, Zt));
1014
+ }
1015
+ }), tn = {}, nn = { class: "border-t border-secondary-stroke my-1" };
1016
+ function on(e, t) {
1017
+ return v(), y("div", nn);
1018
+ }
1019
+ const mo = /* @__PURE__ */ Qe(tn, [["render", on]]), sn = ["onClick"], ln = { class: "grid" }, rn = { class: "font-semibold px-3" }, an = { class: "rounded-lg m-3 border" }, cn = {
1020
+ class: "space-x-2 flex items-center px-3 py-2",
1021
+ style: { width: "300px" }
1022
+ }, un = { class: "flex-shrink-0" }, dn = { class: "w-full text-left" }, fn = { class: "flex-shrink-0" }, pn = { class: "px-3 py-2" }, mn = { class: "text-secondary-content text-left pb-1 text-sm uppercase" }, hn = {
1023
+ key: 0,
1024
+ class: "space-y-2"
1025
+ }, gn = ["onClick"], vn = { class: "pl-2" }, wn = { class: "text-sm mt-1" }, yn = { class: "text-xs mt-1" }, Xe = 3, ho = /* @__PURE__ */ xe({
1026
+ __name: "OneBrowserMenuGrid",
1027
+ props: mt,
1028
+ setup(e) {
1029
+ const t = e, o = () => {
1030
+ typeof t.onChange == "function" && t.onChange();
1031
+ }, n = D(!1), s = I(() => t.apps ? n.value ? t.apps : t.apps.slice(0, Xe) : []), i = () => {
1032
+ n.value = !n.value;
1033
+ }, l = (r) => {
1034
+ typeof t.onApp == "function" && t.onApp(r);
1035
+ };
1036
+ return (r, c) => (v(), _e(ht, { stick: "right" }, {
1037
+ button: re(({ onToggle: u, isExpanded: d }) => [
1038
+ p("button", {
1039
+ onClick: u,
1040
+ class: E(["p-1 rounded-md hover:bg-secondary-10", [d ? "bg-secondary-25" : ""]])
1041
+ }, [
1042
+ Re(H(gt), {
1043
+ class: "text-secondary-base",
1044
+ style: he(`width: ${r.iconSize}px; height: ${r.iconSize}px`)
1045
+ }, null, 8, ["style"])
1046
+ ], 10, sn)
1047
+ ]),
1048
+ menu: re(() => {
1049
+ var u, d, m, w;
1050
+ return [
1051
+ p("div", ln, [
1052
+ p("div", rn, _((u = r.workspace) == null ? void 0 : u.title), 1),
1053
+ p("div", an, [
1054
+ p("div", cn, [
1055
+ p("div", un, [
1056
+ Re(We, {
1057
+ text: ((d = r.workspace) == null ? void 0 : d.name) || "",
1058
+ src: (m = r.workspace) == null ? void 0 : m.photo_url,
1059
+ size: 44,
1060
+ rounded: !1,
1061
+ class: "mx-auto"
1062
+ }, null, 8, ["text", "src"])
1063
+ ]),
1064
+ p("div", dn, _((w = r.workspace) == null ? void 0 : w.name), 1),
1065
+ p("div", fn, [
1066
+ p("button", {
1067
+ class: "text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",
1068
+ onClick: o
1069
+ }, _(r.changeLabel), 1)
1070
+ ])
1071
+ ]),
1072
+ c[0] || (c[0] = p("hr", null, null, -1))
1073
+ ])
1074
+ ]),
1075
+ p("div", pn, [
1076
+ p("div", mn, _(r.appsTitle), 1),
1077
+ p("div", null, [
1078
+ r.apps && r.apps.length ? (v(), y("div", hn, [
1079
+ (v(!0), y(j, null, Z(s.value, (g) => (v(), y("div", {
1080
+ key: g.id,
1081
+ onClick: (f) => l(g),
1082
+ class: "flex items-center rounded-lg hover:bg-secondary-10 border p-2 bg-[#FAFAFA] cursor-pointer"
1083
+ }, [
1084
+ Re(We, {
1085
+ text: g.name,
1086
+ src: g.photo_url,
1087
+ size: 44,
1088
+ rounded: !1
1089
+ }, null, 8, ["text", "src"]),
1090
+ p("div", vn, [
1091
+ p("p", wn, _(g.name), 1),
1092
+ p("p", yn, _(g.short), 1)
1093
+ ])
1094
+ ], 8, gn))), 128))
1095
+ ])) : T("", !0),
1096
+ r.apps && r.apps.length > Xe ? (v(), y("button", {
1097
+ key: 1,
1098
+ onClick: i,
1099
+ class: "mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs"
1100
+ }, _(n.value ? "Приховати" : "Дивитися всі"), 1)) : T("", !0)
1101
+ ])
1102
+ ])
1103
+ ];
1104
+ }),
1105
+ _: 1
1106
+ }));
1107
+ }
1108
+ }), xn = {
1109
+ useModal: {
1110
+ required: !0,
1111
+ type: Object
1112
+ },
1113
+ title: {
1114
+ required: !1,
1115
+ type: String
1116
+ },
1117
+ size: {
1118
+ type: String,
1119
+ default: "medium"
1120
+ },
1121
+ onClose: {
1122
+ type: Function
1123
+ },
1124
+ classModal: {
1125
+ type: Boolean,
1126
+ default: !1
1127
+ },
1128
+ titleCenter: {
1129
+ type: Boolean,
1130
+ default: !1
1131
+ },
1132
+ classTitle: {
1133
+ type: String,
1134
+ default: ""
1135
+ },
1136
+ canClose: {
1137
+ type: Function,
1138
+ default: () => !0
1139
+ },
1140
+ customWidth: {
1141
+ type: String,
1142
+ default: ""
1143
+ }
1144
+ }, bn = {
1145
+ "3xs": ["max-w-xs"],
1146
+ xs: ["max-w-sm"],
1147
+ sm: ["max-w-md"],
1148
+ small: ["max-w-lg"],
1149
+ md: ["max-w-xl"],
1150
+ medium: ["max-w-xl"],
1151
+ large: ["max-w-2xl"],
1152
+ xl: ["max-w-3xl"],
1153
+ "2xl": ["max-w-4xl"],
1154
+ "3xl": ["max-w-4xl"],
1155
+ "4xl": ["max-w-5xl"],
1156
+ "5xl": ["max-w-5xl"],
1157
+ "7xl": ["max-w-7xl"]
1158
+ }, kn = (e = "medium") => {
1159
+ const t = [];
1160
+ return t.push(...bn[e] ?? []), t;
1161
+ }, Cn = { class: "relative bg-white rounded-lg shadow h-full" }, An = /* @__PURE__ */ xe({
1162
+ __name: "OneModal",
1163
+ props: xn,
1164
+ emits: ["isOpen", "closed"],
1165
+ setup(e, { expose: t, emit: o }) {
1166
+ const n = e, s = o, i = I(() => {
1167
+ var x, b;
1168
+ const f = n.useModal;
1169
+ return ((x = f == null ? void 0 : f.isOpened) == null ? void 0 : x.value) ?? ((b = f == null ? void 0 : f.isOpen) == null ? void 0 : b.value) ?? !1;
1170
+ }), l = I(() => kn(n.size)), r = I(() => n.customWidth ? { width: n.customWidth } : {}), c = D(null), u = D(!1);
1171
+ function d(f) {
1172
+ u.value = !1, c.value && !c.value.contains(f.target) && (u.value = !0);
1173
+ }
1174
+ function m(f) {
1175
+ u.value && c.value && !c.value.contains(f.target) && w();
1176
+ }
1177
+ const w = () => {
1178
+ var x, b;
1179
+ if (n.canClose && !n.canClose())
1180
+ return;
1181
+ const f = n.useModal;
1182
+ (x = f == null ? void 0 : f.close) == null || x.call(f), (b = n.onClose) == null || b.call(n), s("closed"), s("isOpen");
1183
+ };
1184
+ return t({
1185
+ open: () => {
1186
+ var x;
1187
+ const f = n.useModal;
1188
+ (x = f == null ? void 0 : f.open) == null || x.call(f), s("isOpen");
1189
+ },
1190
+ close: w
1191
+ }), (f, x) => i.value ? (v(), y("div", {
1192
+ key: 0,
1193
+ tabindex: "-1",
1194
+ onMousedown: d,
1195
+ onMouseup: m,
1196
+ class: E(["modal backdrop !m-0", { "modal-mobile": f.classModal }])
1197
+ }, [
1198
+ p("div", {
1199
+ class: E([
1200
+ "relative w-full max-h-full",
1201
+ l.value,
1202
+ { "fixed bottom-0 left-0 right-0 w-full bg-white rounded-t-xl mobile-modal": f.classModal }
1203
+ ]),
1204
+ style: he(r.value),
1205
+ ref_key: "modalContent",
1206
+ ref: c
1207
+ }, [
1208
+ p("div", Cn, [
1209
+ f.title ? (v(), y("div", {
1210
+ key: 0,
1211
+ class: E([
1212
+ f.titleCenter ? "grid grid-cols-4" : "flex items-start justify-between",
1213
+ "p-3 border-b rounded-t",
1214
+ f.classTitle
1215
+ ])
1216
+ }, [
1217
+ p("h3", {
1218
+ class: E(["text-xl font-semibold text-gray-900 whitespace-nowrap overflow-hidden text-ellipsis", f.titleCenter ? "col-span-2 text-center col-start-2" : ""])
1219
+ }, _(f.title), 3),
1220
+ p("button", {
1221
+ type: "button",
1222
+ class: "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center",
1223
+ onClick: w
1224
+ }, x[0] || (x[0] = [
1225
+ p("svg", {
1226
+ xmlns: "http://www.w3.org/2000/svg",
1227
+ fill: "none",
1228
+ viewBox: "0 0 24 24",
1229
+ "stroke-width": "1.8",
1230
+ stroke: "currentColor",
1231
+ "aria-hidden": "true",
1232
+ class: "w-5 h-5"
1233
+ }, [
1234
+ p("path", {
1235
+ "stroke-linecap": "round",
1236
+ "stroke-linejoin": "round",
1237
+ d: "M6 18L18 6M6 6l12 12"
1238
+ })
1239
+ ], -1)
1240
+ ]))
1241
+ ], 2)) : T("", !0),
1242
+ V(f.$slots, "header", {}, void 0, !0),
1243
+ V(f.$slots, "body", {}, void 0, !0),
1244
+ V(f.$slots, "default", {}, void 0, !0),
1245
+ V(f.$slots, "footer", { close: w }, void 0, !0)
1246
+ ])
1247
+ ], 6)
1248
+ ], 34)) : T("", !0);
1249
+ }
1250
+ });
1251
+ const On = /* @__PURE__ */ Qe(An, [["__scopeId", "data-v-3560b61e"]]);
1252
+ function Rn(e = !1) {
1253
+ const t = D(e), o = D(void 0);
1254
+ let n = null;
1255
+ const s = () => {
1256
+ n && (clearTimeout(n), n = null), t.value = !1, o.value = void 0;
1257
+ }, i = (c) => {
1258
+ o.value = c, t.value = !0;
1259
+ }, l = (c) => {
1260
+ n && clearTimeout(n), n = setTimeout(s, c * 1e3);
1261
+ }, r = (c) => {
1262
+ c.key === "Escape" && t.value && s();
1263
+ };
1264
+ return Ze(() => {
1265
+ document.addEventListener("keydown", r);
1266
+ }), Je(() => {
1267
+ document.removeEventListener("keydown", r), n && clearTimeout(n);
1268
+ }), {
1269
+ isOpened: t,
1270
+ isOpen: t,
1271
+ // alias for backward compatibility
1272
+ data: o,
1273
+ open: i,
1274
+ close: s,
1275
+ closeWithDelay: l
1276
+ };
1277
+ }
1278
+ const Mn = ["onClick"], $n = ["onKeydown"], Ln = {
1279
+ key: 0,
1280
+ class: "text-sm font-medium text-gray-700 px-3 pt-2.5 pb-1.5"
1281
+ }, _n = {
1282
+ key: 1,
1283
+ class: "px-3 py-2"
1284
+ }, En = { class: "relative" }, Sn = ["placeholder"], Tn = {
1285
+ key: 2,
1286
+ class: "border-b border-gray-100"
1287
+ }, Dn = ["onClick"], Vn = {
1288
+ key: 3,
1289
+ class: "flex justify-center py-4"
1290
+ }, Bn = ["aria-selected", "onClick"], Fn = {
1291
+ key: 0,
1292
+ xmlns: "http://www.w3.org/2000/svg",
1293
+ fill: "none",
1294
+ viewBox: "0 0 24 24",
1295
+ "stroke-width": "1.5",
1296
+ stroke: "currentColor",
1297
+ class: "w-4 h-4 text-blue-600 shrink-0"
1298
+ }, Pn = {
1299
+ key: 1,
1300
+ class: "w-4 h-4 shrink-0"
1301
+ }, Wn = ["aria-selected", "onClick", "onMouseenter"], jn = {
1302
+ key: 0,
1303
+ xmlns: "http://www.w3.org/2000/svg",
1304
+ fill: "none",
1305
+ viewBox: "0 0 24 24",
1306
+ "stroke-width": "1.5",
1307
+ stroke: "currentColor",
1308
+ class: "w-4 h-4 text-blue-600 shrink-0"
1309
+ }, In = {
1310
+ key: 1,
1311
+ class: "w-4 h-4 shrink-0"
1312
+ }, zn = ["aria-selected", "onClick", "onMouseenter"], Nn = {
1313
+ key: 0,
1314
+ xmlns: "http://www.w3.org/2000/svg",
1315
+ fill: "none",
1316
+ viewBox: "0 0 24 24",
1317
+ "stroke-width": "1.5",
1318
+ stroke: "currentColor",
1319
+ class: "w-4 h-4 text-blue-600 shrink-0"
1320
+ }, Kn = {
1321
+ key: 1,
1322
+ class: "w-4 h-4 shrink-0"
1323
+ }, Hn = {
1324
+ key: 3,
1325
+ class: "px-3 py-4 text-sm text-gray-500 text-center"
1326
+ }, Un = { class: "pb-6" }, qn = {
1327
+ key: 0,
1328
+ class: "relative px-3 py-3"
1329
+ }, Yn = { class: "relative" }, Xn = ["placeholder"], Gn = {
1330
+ key: 1,
1331
+ class: "px-3 py-2"
1332
+ }, Jn = {
1333
+ key: 2,
1334
+ class: "flex justify-center py-8"
1335
+ }, Zn = {
1336
+ key: 3,
1337
+ class: "overflow-auto h-[60dvh] divide-y",
1338
+ role: "listbox"
1339
+ }, Qn = ["aria-selected"], eo = {
1340
+ key: 0,
1341
+ xmlns: "http://www.w3.org/2000/svg",
1342
+ fill: "none",
1343
+ viewBox: "0 0 24 24",
1344
+ "stroke-width": "1.5",
1345
+ stroke: "currentColor",
1346
+ class: "w-5 h-5 text-blue-600 shrink-0"
1347
+ }, to = {
1348
+ key: 1,
1349
+ class: "w-5 h-5 shrink-0"
1350
+ }, no = ["aria-selected", "onClick"], oo = {
1351
+ key: 0,
1352
+ xmlns: "http://www.w3.org/2000/svg",
1353
+ fill: "none",
1354
+ viewBox: "0 0 24 24",
1355
+ "stroke-width": "1.5",
1356
+ stroke: "currentColor",
1357
+ class: "w-5 h-5 text-blue-600 shrink-0"
1358
+ }, so = {
1359
+ key: 1,
1360
+ class: "w-5 h-5 shrink-0"
1361
+ }, lo = ["aria-selected", "onClick"], io = {
1362
+ key: 0,
1363
+ xmlns: "http://www.w3.org/2000/svg",
1364
+ fill: "none",
1365
+ viewBox: "0 0 24 24",
1366
+ "stroke-width": "1.5",
1367
+ stroke: "currentColor",
1368
+ class: "w-5 h-5 text-blue-600 shrink-0"
1369
+ }, ro = {
1370
+ key: 1,
1371
+ class: "w-5 h-5 shrink-0"
1372
+ }, ao = {
1373
+ key: 3,
1374
+ class: "px-3 py-8 text-sm text-gray-500 text-center"
1375
+ }, go = /* @__PURE__ */ xe({
1376
+ __name: "OneDropdownSelect",
1377
+ props: vt,
1378
+ emits: ["update:modelValue", "search", "create"],
1379
+ setup(e, { emit: t }) {
1380
+ const o = e, n = t, s = D(!1);
1381
+ let i = null;
1382
+ Ze(() => {
1383
+ i = window.matchMedia("(max-width: 767px)"), s.value = i.matches;
1384
+ const a = (h) => {
1385
+ s.value = h.matches;
1386
+ };
1387
+ i.addEventListener("change", a), xt(() => {
1388
+ i == null || i.removeEventListener("change", a);
1389
+ });
1390
+ });
1391
+ const l = Rn(), r = D(null), c = () => {
1392
+ u.value = "", d.value = -1, l.open(), Me(() => {
1393
+ var a;
1394
+ (a = r.value) == null || a.focus();
1395
+ });
1396
+ }, u = D(""), d = D(-1), m = D(null), w = D(null), g = D({}), f = (a, h) => {
1397
+ a && (g.value[h] = a);
1398
+ }, x = I(() => o.allowEmpty ? 1 : 0), b = I(() => {
1399
+ if (!u.value.trim())
1400
+ return o.items;
1401
+ const a = u.value.toLowerCase();
1402
+ return o.items.filter(
1403
+ (h) => String(h[o.labelKey] ?? "").toLowerCase().includes(a)
1404
+ );
1405
+ }), A = I(() => {
1406
+ if (!o.groupKey)
1407
+ return [];
1408
+ const a = [], h = /* @__PURE__ */ new Map();
1409
+ let k = x.value;
1410
+ for (const C of b.value) {
1411
+ const L = String(C[o.groupKey] ?? "");
1412
+ let M = h.get(L);
1413
+ M || (M = { label: L, entries: [] }, h.set(L, M), a.push(M)), M.entries.push({ item: C, flatIndex: k }), k++;
1414
+ }
1415
+ return a;
1416
+ }), R = I(() => o.modelValue === null || o.modelValue === void 0 ? o.placeholder : o.modelValue[o.labelKey] ?? o.placeholder), O = (a) => o.modelValue ? o.modelValue[o.valueKey] === a[o.valueKey] : !1, S = I(() => b.value.length + x.value), $ = (a, h) => {
1417
+ n("update:modelValue", a), h();
1418
+ }, U = (a) => {
1419
+ n("create", u.value), a();
1420
+ }, q = () => {
1421
+ u.value = "", d.value = -1, Me(() => {
1422
+ var a;
1423
+ (a = m.value) == null || a.focus();
1424
+ });
1425
+ }, ie = () => {
1426
+ u.value = "", d.value = -1;
1427
+ }, J = () => {
1428
+ d.value = 0, n("search", u.value);
1429
+ }, Y = () => {
1430
+ Me(() => {
1431
+ const a = g.value[d.value];
1432
+ a && a.scrollIntoView({ block: "nearest" });
1433
+ });
1434
+ }, ue = (a, h) => {
1435
+ switch (a.key) {
1436
+ case "ArrowDown":
1437
+ a.preventDefault(), d.value < S.value - 1 ? d.value++ : d.value = 0, Y();
1438
+ break;
1439
+ case "ArrowUp":
1440
+ a.preventDefault(), d.value > 0 ? d.value-- : d.value = S.value - 1, Y();
1441
+ break;
1442
+ case "Enter":
1443
+ if (a.preventDefault(), d.value >= 0)
1444
+ if (o.allowEmpty && d.value === 0)
1445
+ $(null, h);
1446
+ else {
1447
+ const k = d.value - x.value, C = b.value[k];
1448
+ C && $(C, h);
1449
+ }
1450
+ break;
1451
+ case "Escape":
1452
+ a.preventDefault(), h();
1453
+ break;
1454
+ }
1455
+ };
1456
+ return Ge(u, () => {
1457
+ d.value = 0;
1458
+ }), (a, h) => s.value ? (v(), y(j, { key: 1 }, [
1459
+ V(a.$slots, "button", pe(me({ onToggle: c, isExpanded: H(l).isOpened.value, selectedLabel: R.value })), () => [
1460
+ p("button", {
1461
+ class: "inline-flex items-center justify-between gap-2 rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm hover:bg-gray-50 transition-colors min-w-[180px]",
1462
+ style: he(a.maxWidth ? { maxWidth: a.maxWidth } : void 0),
1463
+ onClick: c
1464
+ }, [
1465
+ p("span", {
1466
+ class: E(["truncate", a.modelValue ? "text-gray-900" : "text-gray-500"])
1467
+ }, _(R.value), 3),
1468
+ h[13] || (h[13] = p("svg", {
1469
+ xmlns: "http://www.w3.org/2000/svg",
1470
+ fill: "none",
1471
+ viewBox: "0 0 24 24",
1472
+ "stroke-width": "1.5",
1473
+ stroke: "currentColor",
1474
+ class: "w-4 h-4 text-gray-400 shrink-0"
1475
+ }, [
1476
+ p("path", {
1477
+ "stroke-linecap": "round",
1478
+ "stroke-linejoin": "round",
1479
+ d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
1480
+ })
1481
+ ], -1))
1482
+ ], 4)
1483
+ ]),
1484
+ H(l).isOpened.value ? (v(), _e(H(On), {
1485
+ key: 0,
1486
+ useModal: H(l),
1487
+ title: a.title || a.placeholder,
1488
+ size: "sm",
1489
+ classModal: !0,
1490
+ titleCenter: !0
1491
+ }, {
1492
+ default: re(() => [
1493
+ p("div", Un, [
1494
+ a.searchable ? (v(), y("div", qn, [
1495
+ p("div", Yn, [
1496
+ h[14] || (h[14] = p("svg", {
1497
+ xmlns: "http://www.w3.org/2000/svg",
1498
+ fill: "none",
1499
+ viewBox: "0 0 24 24",
1500
+ "stroke-width": "1.5",
1501
+ stroke: "currentColor",
1502
+ class: "absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"
1503
+ }, [
1504
+ p("path", {
1505
+ "stroke-linecap": "round",
1506
+ "stroke-linejoin": "round",
1507
+ d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
1508
+ })
1509
+ ], -1)),
1510
+ Le(p("input", {
1511
+ ref_key: "mobileSearchInputRef",
1512
+ ref: r,
1513
+ "onUpdate:modelValue": h[2] || (h[2] = (k) => u.value = k),
1514
+ type: "text",
1515
+ placeholder: a.searchPlaceholder,
1516
+ class: "w-full rounded-md border border-gray-300 py-2 pl-8 pr-3 text-sm outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",
1517
+ onInput: J
1518
+ }, null, 40, Xn), [
1519
+ [Fe, u.value]
1520
+ ])
1521
+ ])
1522
+ ])) : T("", !0),
1523
+ a.createLabel ? (v(), y("div", Gn, [
1524
+ p("button", {
1525
+ class: "w-full flex items-center justify-center gap-2 py-2 text-sm text-blue-700 hover:text-blue-500",
1526
+ onClick: h[3] || (h[3] = (k) => U(() => H(l).close()))
1527
+ }, [
1528
+ h[15] || (h[15] = p("svg", {
1529
+ xmlns: "http://www.w3.org/2000/svg",
1530
+ fill: "none",
1531
+ viewBox: "0 0 24 24",
1532
+ "stroke-width": "1.5",
1533
+ stroke: "currentColor",
1534
+ class: "w-4 h-4"
1535
+ }, [
1536
+ p("path", {
1537
+ "stroke-linecap": "round",
1538
+ "stroke-linejoin": "round",
1539
+ d: "M12 4.5v15m7.5-7.5h-15"
1540
+ })
1541
+ ], -1)),
1542
+ p("span", null, _(a.createLabel), 1)
1543
+ ])
1544
+ ])) : T("", !0),
1545
+ a.isLoading ? (v(), y("div", Jn, h[16] || (h[16] = [
1546
+ p("div", { class: "animate-spin w-6 h-6 border-2 border-blue-500 border-t-transparent rounded-full" }, null, -1)
1547
+ ]))) : (v(), y("div", Zn, [
1548
+ a.allowEmpty ? (v(), y("button", {
1549
+ key: 0,
1550
+ class: E(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors", a.modelValue === null ? "bg-gray-50 font-medium" : ""]),
1551
+ role: "option",
1552
+ "aria-selected": a.modelValue === null,
1553
+ onClick: h[4] || (h[4] = (k) => $(null, () => H(l).close()))
1554
+ }, [
1555
+ a.modelValue === null ? (v(), y("svg", eo, h[17] || (h[17] = [
1556
+ p("path", {
1557
+ "stroke-linecap": "round",
1558
+ "stroke-linejoin": "round",
1559
+ d: "M4.5 12.75l6 6 9-13.5"
1560
+ }, null, -1)
1561
+ ]))) : (v(), y("span", to)),
1562
+ p("span", null, _(a.emptyLabel ?? a.placeholder), 1)
1563
+ ], 10, Qn)) : T("", !0),
1564
+ a.groupKey ? (v(!0), y(j, { key: 1 }, Z(A.value, (k, C) => (v(), y(j, {
1565
+ key: k.label
1566
+ }, [
1567
+ p("div", {
1568
+ class: E(["px-3 pt-3 pb-1 text-xs font-semibold text-gray-500 uppercase tracking-wide", C > 0 ? "border-t border-gray-100" : ""])
1569
+ }, _(k.label), 3),
1570
+ (v(!0), y(j, null, Z(k.entries, (L) => (v(), y("button", {
1571
+ key: L.item[a.valueKey],
1572
+ class: E(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", O(L.item) ? "bg-gray-50 font-medium" : ""]),
1573
+ role: "option",
1574
+ "aria-selected": O(L.item),
1575
+ onClick: (M) => $(L.item, () => H(l).close())
1576
+ }, [
1577
+ O(L.item) ? (v(), y("svg", oo, h[18] || (h[18] = [
1578
+ p("path", {
1579
+ "stroke-linecap": "round",
1580
+ "stroke-linejoin": "round",
1581
+ d: "M4.5 12.75l6 6 9-13.5"
1582
+ }, null, -1)
1583
+ ]))) : (v(), y("span", so)),
1584
+ V(a.$slots, "item", de({ ref_for: !0 }, { item: L.item }), () => [
1585
+ p("span", null, _(L.item[a.labelKey]), 1)
1586
+ ])
1587
+ ], 10, no))), 128))
1588
+ ], 64))), 128)) : (v(!0), y(j, { key: 2 }, Z(b.value, (k) => (v(), y("button", {
1589
+ key: k[a.valueKey],
1590
+ class: E(["flex items-center gap-3 w-full px-3 py-3 text-sm text-left hover:bg-gray-50 transition-colors break-words", O(k) ? "bg-gray-50 font-medium" : ""]),
1591
+ role: "option",
1592
+ "aria-selected": O(k),
1593
+ onClick: (C) => $(k, () => H(l).close())
1594
+ }, [
1595
+ O(k) ? (v(), y("svg", io, h[19] || (h[19] = [
1596
+ p("path", {
1597
+ "stroke-linecap": "round",
1598
+ "stroke-linejoin": "round",
1599
+ d: "M4.5 12.75l6 6 9-13.5"
1600
+ }, null, -1)
1601
+ ]))) : (v(), y("span", ro)),
1602
+ V(a.$slots, "item", de({ ref_for: !0 }, { item: k }), () => [
1603
+ p("span", null, _(k[a.labelKey]), 1)
1604
+ ])
1605
+ ], 10, lo))), 128)),
1606
+ b.value.length === 0 && !a.allowEmpty ? (v(), y("div", ao, [
1607
+ V(a.$slots, "empty", {}, () => [
1608
+ h[20] || (h[20] = Pe(" Nothing found "))
1609
+ ])
1610
+ ])) : T("", !0)
1611
+ ]))
1612
+ ])
1613
+ ]),
1614
+ _: 3
1615
+ }, 8, ["useModal", "title"])) : T("", !0)
1616
+ ], 64)) : (v(), _e(en, {
1617
+ key: 0,
1618
+ stick: a.stick,
1619
+ onOpen: q,
1620
+ onClose: ie
1621
+ }, {
1622
+ button: re(({ onToggle: k, isExpanded: C }) => [
1623
+ V(a.$slots, "button", pe(me({ onToggle: k, isExpanded: C, selectedLabel: R.value })), () => [
1624
+ p("button", {
1625
+ class: E(["inline-flex items-center justify-between gap-2 rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm hover:bg-gray-50 transition-colors min-w-[180px]", C ? "ring-1 ring-blue-500 border-blue-500" : ""]),
1626
+ style: he(a.maxWidth ? { maxWidth: a.maxWidth } : void 0),
1627
+ onClick: k
1628
+ }, [
1629
+ p("span", {
1630
+ class: E(["truncate", a.modelValue ? "text-gray-900" : "text-gray-500"])
1631
+ }, _(R.value), 3),
1632
+ (v(), y("svg", {
1633
+ xmlns: "http://www.w3.org/2000/svg",
1634
+ fill: "none",
1635
+ viewBox: "0 0 24 24",
1636
+ "stroke-width": "1.5",
1637
+ stroke: "currentColor",
1638
+ class: E(["w-4 h-4 text-gray-400 transition-transform shrink-0", C ? "rotate-180" : ""])
1639
+ }, h[5] || (h[5] = [
1640
+ p("path", {
1641
+ "stroke-linecap": "round",
1642
+ "stroke-linejoin": "round",
1643
+ d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
1644
+ }, null, -1)
1645
+ ]), 2))
1646
+ ], 14, Mn)
1647
+ ])
1648
+ ]),
1649
+ menu: re(({ onToggle: k }) => [
1650
+ p("div", {
1651
+ class: "min-w-[240px] w-full",
1652
+ onKeydown: (C) => ue(C, k)
1653
+ }, [
1654
+ a.title ? (v(), y("div", Ln, _(a.title), 1)) : T("", !0),
1655
+ a.searchable ? (v(), y("div", _n, [
1656
+ p("div", En, [
1657
+ h[6] || (h[6] = p("svg", {
1658
+ xmlns: "http://www.w3.org/2000/svg",
1659
+ fill: "none",
1660
+ viewBox: "0 0 24 24",
1661
+ "stroke-width": "1.5",
1662
+ stroke: "currentColor",
1663
+ class: "absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"
1664
+ }, [
1665
+ p("path", {
1666
+ "stroke-linecap": "round",
1667
+ "stroke-linejoin": "round",
1668
+ d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
1669
+ })
1670
+ ], -1)),
1671
+ Le(p("input", {
1672
+ ref_key: "searchInputRef",
1673
+ ref: m,
1674
+ "onUpdate:modelValue": h[0] || (h[0] = (C) => u.value = C),
1675
+ type: "text",
1676
+ placeholder: a.searchPlaceholder,
1677
+ class: "w-full rounded-md border border-gray-300 py-1.5 pl-8 pr-3 text-sm outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500",
1678
+ onInput: J
1679
+ }, null, 40, Sn), [
1680
+ [Fe, u.value]
1681
+ ])
1682
+ ])
1683
+ ])) : T("", !0),
1684
+ a.createLabel ? (v(), y("div", Tn, [
1685
+ p("button", {
1686
+ class: "flex items-center gap-2 w-full px-3 py-2 text-sm text-blue-700 hover:bg-gray-50 transition-colors",
1687
+ onClick: (C) => U(k)
1688
+ }, [
1689
+ h[7] || (h[7] = p("svg", {
1690
+ xmlns: "http://www.w3.org/2000/svg",
1691
+ fill: "none",
1692
+ viewBox: "0 0 24 24",
1693
+ "stroke-width": "1.5",
1694
+ stroke: "currentColor",
1695
+ class: "w-4 h-4"
1696
+ }, [
1697
+ p("path", {
1698
+ "stroke-linecap": "round",
1699
+ "stroke-linejoin": "round",
1700
+ d: "M12 4.5v15m7.5-7.5h-15"
1701
+ })
1702
+ ], -1)),
1703
+ p("span", null, _(a.createLabel), 1)
1704
+ ], 8, Dn)
1705
+ ])) : T("", !0),
1706
+ a.isLoading ? (v(), y("div", Vn, h[8] || (h[8] = [
1707
+ p("svg", {
1708
+ class: "animate-spin h-5 w-5 text-gray-400",
1709
+ xmlns: "http://www.w3.org/2000/svg",
1710
+ fill: "none",
1711
+ viewBox: "0 0 24 24"
1712
+ }, [
1713
+ p("circle", {
1714
+ class: "opacity-25",
1715
+ cx: "12",
1716
+ cy: "12",
1717
+ r: "10",
1718
+ stroke: "currentColor",
1719
+ "stroke-width": "4"
1720
+ }),
1721
+ p("path", {
1722
+ class: "opacity-75",
1723
+ fill: "currentColor",
1724
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
1725
+ })
1726
+ ], -1)
1727
+ ]))) : (v(), y("div", {
1728
+ key: 4,
1729
+ ref_key: "listRef",
1730
+ ref: w,
1731
+ class: "max-h-[300px] overflow-y-auto",
1732
+ role: "listbox"
1733
+ }, [
1734
+ a.allowEmpty ? (v(), y("button", {
1735
+ key: 0,
1736
+ ref: (C) => f(C, 0),
1737
+ class: E(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors", [
1738
+ a.modelValue === null ? "bg-gray-100 font-medium" : "hover:bg-gray-50",
1739
+ d.value === 0 ? "bg-gray-50" : ""
1740
+ ]]),
1741
+ role: "option",
1742
+ "aria-selected": a.modelValue === null,
1743
+ onClick: (C) => $(null, k),
1744
+ onMouseenter: h[1] || (h[1] = (C) => d.value = 0)
1745
+ }, [
1746
+ a.modelValue === null ? (v(), y("svg", Fn, h[9] || (h[9] = [
1747
+ p("path", {
1748
+ "stroke-linecap": "round",
1749
+ "stroke-linejoin": "round",
1750
+ d: "M4.5 12.75l6 6 9-13.5"
1751
+ }, null, -1)
1752
+ ]))) : (v(), y("span", Pn)),
1753
+ p("span", null, _(a.emptyLabel ?? a.placeholder), 1)
1754
+ ], 42, Bn)) : T("", !0),
1755
+ a.groupKey ? (v(!0), y(j, { key: 1 }, Z(A.value, (C, L) => (v(), y(j, {
1756
+ key: C.label
1757
+ }, [
1758
+ p("div", {
1759
+ class: E(["px-3 pt-2 pb-1 text-xs font-semibold text-gray-500 uppercase tracking-wide", L > 0 ? "border-t border-gray-100 mt-1" : ""])
1760
+ }, _(C.label), 3),
1761
+ (v(!0), y(j, null, Z(C.entries, (M) => (v(), y("button", {
1762
+ key: M.item[a.valueKey],
1763
+ ref_for: !0,
1764
+ ref: (F) => f(F, M.flatIndex),
1765
+ class: E(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
1766
+ O(M.item) ? "bg-gray-100 font-medium" : "hover:bg-gray-50",
1767
+ d.value === M.flatIndex ? "bg-gray-50" : ""
1768
+ ]]),
1769
+ role: "option",
1770
+ "aria-selected": O(M.item),
1771
+ onClick: (F) => $(M.item, k),
1772
+ onMouseenter: (F) => d.value = M.flatIndex
1773
+ }, [
1774
+ O(M.item) ? (v(), y("svg", jn, h[10] || (h[10] = [
1775
+ p("path", {
1776
+ "stroke-linecap": "round",
1777
+ "stroke-linejoin": "round",
1778
+ d: "M4.5 12.75l6 6 9-13.5"
1779
+ }, null, -1)
1780
+ ]))) : (v(), y("span", In)),
1781
+ V(a.$slots, "item", de({ ref_for: !0 }, { item: M.item }), () => [
1782
+ p("span", null, _(M.item[a.labelKey]), 1)
1783
+ ])
1784
+ ], 42, Wn))), 128))
1785
+ ], 64))), 128)) : (v(!0), y(j, { key: 2 }, Z(b.value, (C, L) => (v(), y("button", {
1786
+ key: C[a.valueKey],
1787
+ ref_for: !0,
1788
+ ref: (M) => f(M, x.value + L),
1789
+ class: E(["flex items-center gap-2 w-full px-3 py-2 text-sm text-left transition-colors break-words", [
1790
+ O(C) ? "bg-gray-100 font-medium" : "hover:bg-gray-50",
1791
+ d.value === x.value + L ? "bg-gray-50" : ""
1792
+ ]]),
1793
+ role: "option",
1794
+ "aria-selected": O(C),
1795
+ onClick: (M) => $(C, k),
1796
+ onMouseenter: (M) => d.value = x.value + L
1797
+ }, [
1798
+ O(C) ? (v(), y("svg", Nn, h[11] || (h[11] = [
1799
+ p("path", {
1800
+ "stroke-linecap": "round",
1801
+ "stroke-linejoin": "round",
1802
+ d: "M4.5 12.75l6 6 9-13.5"
1803
+ }, null, -1)
1804
+ ]))) : (v(), y("span", Kn)),
1805
+ V(a.$slots, "item", de({ ref_for: !0 }, { item: C }), () => [
1806
+ p("span", null, _(C[a.labelKey]), 1)
1807
+ ])
1808
+ ], 42, zn))), 128)),
1809
+ b.value.length === 0 && !a.allowEmpty ? (v(), y("div", Hn, [
1810
+ V(a.$slots, "empty", {}, () => [
1811
+ h[12] || (h[12] = Pe(" Nothing found "))
1812
+ ])
1813
+ ])) : T("", !0)
1814
+ ], 512))
1815
+ ], 40, $n)
1816
+ ]),
1817
+ _: 3
1818
+ }, 8, ["stick"]));
1819
+ }
1820
+ });
1821
+ export {
1822
+ On as O,
1823
+ en as _,
1824
+ mo as a,
1825
+ ho as b,
1826
+ go as c,
1827
+ xn as m,
1828
+ Rn as u
1829
+ };