@opentiny/tiny-robot 0.3.0-alpha.8 → 0.3.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index3.js CHANGED
@@ -1,688 +1,151 @@
1
- import { onMounted as ie, nextTick as ve, watch as L, getCurrentScope as me, onScopeDispose as pe, isRef as he, getCurrentInstance as B, toValue as b, hasInjectionContext as se, inject as we, shallowRef as y, computed as I, reactive as ee, unref as ge, watchEffect as le, ref as be, readonly as ye } from "vue";
2
- function H(e) {
3
- return me() ? (pe(e), !0) : !1;
4
- }
5
- function te() {
6
- const e = /* @__PURE__ */ new Set(), t = (u) => {
7
- e.delete(u);
8
- };
9
- return {
10
- on: (u) => {
11
- e.add(u);
12
- const l = () => t(u);
13
- return H(l), {
14
- off: l
15
- };
16
- },
17
- off: t,
18
- trigger: (...u) => Promise.all(Array.from(e).map((l) => l(...u))),
19
- clear: () => {
20
- e.clear();
21
- }
22
- };
23
- }
24
- const N = /* @__PURE__ */ new WeakMap(), Se = (...e) => {
25
- var t;
26
- const o = e[0], r = (t = B()) == null ? void 0 : t.proxy;
27
- if (r == null && !se())
28
- throw new Error("injectLocal must be called in setup");
29
- return r && N.has(r) && o in N.get(r) ? N.get(r)[o] : we(...e);
30
- }, $ = typeof window < "u" && typeof document < "u";
31
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
32
- const Ee = (e) => e != null, Te = Object.prototype.toString, Oe = (e) => Te.call(e) === "[object Object]", O = () => {
33
- }, We = (e, t) => Object.prototype.hasOwnProperty.call(e, t), xe = /* @__PURE__ */ Me();
34
- function Me() {
35
- var e, t;
36
- return $ && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
37
- }
38
- function G(e, t) {
39
- function o(...r) {
40
- return new Promise((f, u) => {
41
- Promise.resolve(e(() => t.apply(this, r), { fn: t, thisArg: this, args: r })).then(f).catch(u);
1
+ import { nextTick as R, h as k, defineComponent as g, render as B, onBeforeUnmount as j, Teleport as Z, computed as m, ref as $, createBlock as C, openBlock as h, Transition as q, normalizeProps as G, guardReactiveProps as J, withCtx as K, createElementBlock as L, createCommentVNode as Q, renderSlot as X, useSlots as Y, watch as ee, useAttrs as te, reactive as oe, resolveDynamicComponent as re, unref as T, mergeProps as S, createVNode as se } from "vue";
2
+ import { d as ne, f as pe, c as ae } from "./index2.js";
3
+ import { t as c } from "./utils.js";
4
+ import { _ as O } from "./_plugin-vue_export-helper.js";
5
+ import { u as le } from "./useSlotRefs.js";
6
+ const ce = g({
7
+ setup: (r) => () => k(Z, r.teleportProps, r.vnodeFactory()),
8
+ props: ["teleportProps", "vnodeFactory"]
9
+ });
10
+ function ie(r, p) {
11
+ let e = null, o = null, a = !1;
12
+ R(() => {
13
+ a || (o = document.createElement("div"), e = k(ce, { teleportProps: r, vnodeFactory: p }), B(e, o));
14
+ }), j(() => {
15
+ a = !0, R(() => {
16
+ o && (B(null, o), o.remove(), e = null, o = null);
42
17
  });
43
- }
44
- return o;
45
- }
46
- const Re = (e) => e();
47
- function ue(e, t = {}) {
48
- let o, r, f = O;
49
- const u = (i) => {
50
- clearTimeout(i), f(), f = O;
51
- };
52
- let l;
53
- return (i) => {
54
- const a = b(e), c = b(t.maxWait);
55
- return o && u(o), a <= 0 || c !== void 0 && c <= 0 ? (r && (u(r), r = void 0), Promise.resolve(i())) : new Promise((s, v) => {
56
- f = t.rejectOnCancel ? v : s, l = i, c && !r && (r = setTimeout(() => {
57
- o && u(o), r = void 0, s(l());
58
- }, c)), o = setTimeout(() => {
59
- r && u(r), r = void 0, s(i());
60
- }, a);
61
- });
62
- };
63
- }
64
- function ce(...e) {
65
- let t = 0, o, r = !0, f = O, u, l, n, i, a;
66
- !he(e[0]) && typeof e[0] == "object" ? { delay: l, trailing: n = !0, leading: i = !0, rejectOnCancel: a = !1 } = e[0] : [l, n = !0, i = !0, a = !1] = e;
67
- const c = () => {
68
- o && (clearTimeout(o), o = void 0, f(), f = O);
69
- };
70
- return (v) => {
71
- const m = b(l), p = Date.now() - t, E = () => u = v();
72
- return c(), m <= 0 ? (t = Date.now(), E()) : (p > m && (i || !r) ? (t = Date.now(), E()) : n && (u = new Promise((d, h) => {
73
- f = a ? h : d, o = setTimeout(() => {
74
- t = Date.now(), r = !0, d(E()), c();
75
- }, Math.max(0, m - p));
76
- })), !i && !o && (o = setTimeout(() => r = !0, m)), r = !1, u);
77
- };
78
- }
79
- function ne(e) {
80
- return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
81
- }
82
- function C(e) {
83
- return Array.isArray(e) ? e : [e];
84
- }
85
- function Fe(e) {
86
- return B();
87
- }
88
- function Ie(e, t = 200, o = {}) {
89
- return G(
90
- ue(t, o),
91
- e
92
- );
93
- }
94
- function Pe(e, t = 200, o = !1, r = !0, f = !1) {
95
- return G(
96
- ce(t, o, r, f),
97
- e
98
- );
99
- }
100
- function ae(e, t, o = {}) {
101
- const {
102
- eventFilter: r = Re,
103
- ...f
104
- } = o;
105
- return L(
106
- e,
107
- G(
108
- r,
109
- t
110
- ),
111
- f
112
- );
113
- }
114
- function z(e, t = !0, o) {
115
- Fe() ? ie(e, o) : t ? e() : ve(e);
116
- }
117
- function Ne(e, t, o = {}) {
118
- const {
119
- debounce: r = 0,
120
- maxWait: f = void 0,
121
- ...u
122
- } = o;
123
- return ae(
124
- e,
125
- t,
126
- {
127
- ...u,
128
- eventFilter: ue(r, { maxWait: f })
129
- }
130
- );
131
- }
132
- function _e(e, t, o) {
133
- return L(
134
- e,
135
- t,
136
- {
137
- ...o,
138
- immediate: !0
139
- }
140
- );
141
- }
142
- function Be(e, t, o = {}) {
143
- const {
144
- throttle: r = 0,
145
- trailing: f = !0,
146
- leading: u = !0,
147
- ...l
148
- } = o;
149
- return ae(
150
- e,
151
- t,
152
- {
153
- ...l,
154
- eventFilter: ce(r, f, u)
155
- }
156
- );
157
- }
158
- const F = $ ? window : void 0, Ae = $ ? window.document : void 0;
159
- function S(e) {
160
- var t;
161
- const o = b(e);
162
- return (t = o == null ? void 0 : o.$el) != null ? t : o;
163
- }
164
- function M(...e) {
165
- const t = [], o = () => {
166
- t.forEach((n) => n()), t.length = 0;
167
- }, r = (n, i, a, c) => (n.addEventListener(i, a, c), () => n.removeEventListener(i, a, c)), f = I(() => {
168
- const n = C(b(e[0])).filter((i) => i != null);
169
- return n.every((i) => typeof i != "string") ? n : void 0;
170
- }), u = _e(
171
- () => {
172
- var n, i;
173
- return [
174
- (i = (n = f.value) == null ? void 0 : n.map((a) => S(a))) != null ? i : [F].filter((a) => a != null),
175
- C(b(f.value ? e[1] : e[0])),
176
- C(ge(f.value ? e[2] : e[1])),
177
- // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
178
- b(f.value ? e[3] : e[2])
179
- ];
180
- },
181
- ([n, i, a, c]) => {
182
- if (o(), !(n != null && n.length) || !(i != null && i.length) || !(a != null && a.length))
183
- return;
184
- const s = Oe(c) ? { ...c } : c;
185
- t.push(
186
- ...n.flatMap(
187
- (v) => i.flatMap(
188
- (m) => a.map((p) => r(v, m, p, s))
189
- )
190
- )
191
- );
192
- },
193
- { flush: "post" }
194
- ), l = () => {
195
- u(), o();
196
- };
197
- return H(o), l;
198
- }
199
- let oe = !1;
200
- function $e(e, t, o = {}) {
201
- const { window: r = F, ignore: f = [], capture: u = !0, detectIframe: l = !1, controls: n = !1 } = o;
202
- if (!r)
203
- return n ? { stop: O, cancel: O, trigger: O } : O;
204
- if (xe && !oe) {
205
- oe = !0;
206
- const d = { passive: !0 };
207
- Array.from(r.document.body.children).forEach((h) => h.addEventListener("click", O, d)), r.document.documentElement.addEventListener("click", O, d);
208
- }
209
- let i = !0;
210
- const a = (d) => b(f).some((h) => {
211
- if (typeof h == "string")
212
- return Array.from(r.document.querySelectorAll(h)).some((g) => g === d.target || d.composedPath().includes(g));
213
- {
214
- const g = S(h);
215
- return g && (d.target === g || d.composedPath().includes(g));
216
- }
217
18
  });
218
- function c(d) {
219
- const h = b(d);
220
- return h && h.$.subTree.shapeFlag === 16;
221
- }
222
- function s(d, h) {
223
- const g = b(d), T = g.$.subTree && g.$.subTree.children;
224
- return T == null || !Array.isArray(T) ? !1 : T.some((W) => W.el === h.target || h.composedPath().includes(W.el));
225
- }
226
- const v = (d) => {
227
- const h = S(e);
228
- if (d.target != null && !(!(h instanceof Element) && c(e) && s(e, d)) && !(!h || h === d.target || d.composedPath().includes(h))) {
229
- if ("detail" in d && d.detail === 0 && (i = !a(d)), !i) {
230
- i = !0;
231
- return;
232
- }
233
- t(d);
234
- }
235
- };
236
- let m = !1;
237
- const p = [
238
- M(r, "click", (d) => {
239
- m || (m = !0, setTimeout(() => {
240
- m = !1;
241
- }, 0), v(d));
242
- }, { passive: !0, capture: u }),
243
- M(r, "pointerdown", (d) => {
244
- const h = S(e);
245
- i = !a(d) && !!(h && !d.composedPath().includes(h));
246
- }, { passive: !0 }),
247
- l && M(r, "blur", (d) => {
248
- setTimeout(() => {
249
- var h;
250
- const g = S(e);
251
- ((h = r.document.activeElement) == null ? void 0 : h.tagName) === "IFRAME" && !(g != null && g.contains(r.document.activeElement)) && t(d);
252
- }, 0);
253
- }, { passive: !0 })
254
- ].filter(Boolean), E = () => p.forEach((d) => d());
255
- return n ? {
256
- stop: E,
257
- cancel: () => {
258
- i = !1;
259
- },
260
- trigger: (d) => {
261
- i = !0, v(d), i = !1;
262
- }
263
- } : E;
264
- }
265
- function Le() {
266
- const e = y(!1), t = B();
267
- return t && ie(() => {
268
- e.value = !0;
269
- }, t), e;
270
- }
271
- function U(e) {
272
- const t = Le();
273
- return I(() => (t.value, !!e()));
274
- }
275
- function Y(e, t, o = {}) {
276
- const { window: r = F, ...f } = o;
277
- let u;
278
- const l = U(() => r && "MutationObserver" in r), n = () => {
279
- u && (u.disconnect(), u = void 0);
280
- }, i = I(() => {
281
- const v = b(e), m = C(v).map(S).filter(Ee);
282
- return new Set(m);
283
- }), a = L(
284
- () => i.value,
285
- (v) => {
286
- n(), l.value && v.size && (u = new MutationObserver(t), v.forEach((m) => u.observe(m, f)));
287
- },
288
- { immediate: !0, flush: "post" }
289
- ), c = () => u == null ? void 0 : u.takeRecords(), s = () => {
290
- a(), n();
291
- };
292
- return H(s), {
293
- isSupported: l,
294
- stop: s,
295
- takeRecords: c
296
- };
297
19
  }
298
- function De(e, t, o = {}) {
299
- const {
300
- window: r = F,
301
- document: f = r == null ? void 0 : r.document,
302
- flush: u = "sync"
303
- } = o;
304
- if (!r || !f)
305
- return O;
306
- let l;
307
- const n = (c) => {
308
- l == null || l(), l = c;
309
- }, i = le(() => {
310
- const c = S(e);
311
- if (c) {
312
- const { stop: s } = Y(
313
- f,
314
- (v) => {
315
- v.map((p) => [...p.removedNodes]).flat().some((p) => p === c || p.contains(c)) && t(v);
316
- },
317
- {
318
- window: r,
319
- childList: !0,
320
- subtree: !0
321
- }
322
- );
323
- n(s);
324
- }
325
- }, { flush: u }), a = () => {
326
- i(), n();
327
- };
328
- return H(a), a;
329
- }
330
- const ke = Symbol("vueuse-ssr-width");
331
- function Ce() {
332
- const e = se() ? Se(ke, null) : null;
333
- return typeof e == "number" ? e : void 0;
334
- }
335
- function He(e, t = {}) {
336
- const { window: o = F, ssrWidth: r = Ce() } = t, f = U(() => o && "matchMedia" in o && typeof o.matchMedia == "function"), u = y(typeof r == "number"), l = y(), n = y(!1), i = (a) => {
337
- n.value = a.matches;
338
- };
339
- return le(() => {
340
- if (u.value) {
341
- u.value = !f.value;
342
- const a = b(e).split(",");
343
- n.value = a.some((c) => {
344
- const s = c.includes("not all"), v = c.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), m = c.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
345
- let p = !!(v || m);
346
- return v && p && (p = r >= ne(v[1])), m && p && (p = r <= ne(m[1])), s ? !p : p;
347
- });
348
- return;
349
- }
350
- f.value && (l.value = o.matchMedia(b(e)), n.value = l.value.matches);
351
- }), M(l, "change", i, { passive: !0 }), I(() => n.value);
352
- }
353
- function fe(e, t, o = {}) {
354
- const { window: r = F, ...f } = o;
355
- let u;
356
- const l = U(() => r && "ResizeObserver" in r), n = () => {
357
- u && (u.disconnect(), u = void 0);
358
- }, i = I(() => {
359
- const s = b(e);
360
- return Array.isArray(s) ? s.map((v) => S(v)) : [S(s)];
361
- }), a = L(
362
- i,
363
- (s) => {
364
- if (n(), l.value && r) {
365
- u = new ResizeObserver(t);
366
- for (const v of s)
367
- v && u.observe(v, f);
368
- }
369
- },
370
- { immediate: !0, flush: "post" }
371
- ), c = () => {
372
- n(), a();
373
- };
374
- return H(c), {
375
- isSupported: l,
376
- stop: c
377
- };
378
- }
379
- function Ge(e, t = {}) {
380
- const {
381
- reset: o = !0,
382
- windowResize: r = !0,
383
- windowScroll: f = !0,
384
- immediate: u = !0,
385
- updateTiming: l = "sync"
386
- } = t, n = y(0), i = y(0), a = y(0), c = y(0), s = y(0), v = y(0), m = y(0), p = y(0);
387
- function E() {
388
- const h = S(e);
389
- if (!h) {
390
- o && (n.value = 0, i.value = 0, a.value = 0, c.value = 0, s.value = 0, v.value = 0, m.value = 0, p.value = 0);
391
- return;
392
- }
393
- const g = h.getBoundingClientRect();
394
- n.value = g.height, i.value = g.bottom, a.value = g.left, c.value = g.right, s.value = g.top, v.value = g.width, m.value = g.x, p.value = g.y;
395
- }
396
- function d() {
397
- l === "sync" ? E() : l === "next-frame" && requestAnimationFrame(() => E());
398
- }
399
- return fe(e, d), L(() => S(e), (h) => !h && d()), Y(e, d, {
400
- attributeFilter: ["style", "class"]
401
- }), f && M("scroll", d, { capture: !0, passive: !0 }), r && M("resize", d, { passive: !0 }), z(() => {
402
- u && d();
403
- }), {
404
- height: n,
405
- bottom: i,
406
- left: a,
407
- right: c,
408
- top: s,
409
- width: v,
410
- x: m,
411
- y: p,
412
- update: d
413
- };
414
- }
415
- function Ue(e, t = {}) {
416
- const {
417
- delayEnter: o = 0,
418
- delayLeave: r = 0,
419
- triggerOnRemoval: f = !1,
420
- window: u = F
421
- } = t, l = y(!1);
422
- let n;
423
- const i = (a) => {
424
- const c = a ? o : r;
425
- n && (clearTimeout(n), n = void 0), c ? n = setTimeout(() => l.value = a, c) : l.value = a;
426
- };
427
- return u && (M(e, "mouseenter", () => i(!0), { passive: !0 }), M(e, "mouseleave", () => i(!1), { passive: !0 }), f && De(
428
- I(() => S(e)),
429
- () => i(!1)
430
- )), l;
431
- }
432
- function Ye(e, t = { width: 0, height: 0 }, o = {}) {
433
- const { window: r = F, box: f = "content-box" } = o, u = I(() => {
434
- var s, v;
435
- return (v = (s = S(e)) == null ? void 0 : s.namespaceURI) == null ? void 0 : v.includes("svg");
436
- }), l = y(t.width), n = y(t.height), { stop: i } = fe(
437
- e,
438
- ([s]) => {
439
- const v = f === "border-box" ? s.borderBoxSize : f === "content-box" ? s.contentBoxSize : s.devicePixelContentBoxSize;
440
- if (r && u.value) {
441
- const m = S(e);
442
- if (m) {
443
- const p = m.getBoundingClientRect();
444
- l.value = p.width, n.value = p.height;
445
- }
446
- } else if (v) {
447
- const m = C(v);
448
- l.value = m.reduce((p, { inlineSize: E }) => p + E, 0), n.value = m.reduce((p, { blockSize: E }) => p + E, 0);
449
- } else
450
- l.value = s.contentRect.width, n.value = s.contentRect.height;
451
- },
452
- o
453
- );
454
- z(() => {
455
- const s = S(e);
456
- s && (l.value = "offsetWidth" in s ? s.offsetWidth : t.width, n.value = "offsetHeight" in s ? s.offsetHeight : t.height);
457
- });
458
- const a = L(
459
- () => S(e),
460
- (s) => {
461
- l.value = s ? t.width : 0, n.value = s ? t.height : 0;
462
- }
463
- );
464
- function c() {
465
- i(), a();
466
- }
467
- return {
468
- width: l,
469
- height: n,
470
- stop: c
471
- };
472
- }
473
- const je = {
474
- multiple: !0,
475
- accept: "*",
476
- reset: !1,
477
- directory: !1
478
- };
479
- function Ve(e) {
480
- if (!e)
481
- return null;
482
- if (e instanceof FileList)
483
- return e;
484
- const t = new DataTransfer();
485
- for (const o of e)
486
- t.items.add(o);
487
- return t.files;
488
- }
489
- function Qe(e = {}) {
490
- const {
491
- document: t = Ae
492
- } = e, o = be(Ve(e.initialFiles)), { on: r, trigger: f } = te(), { on: u, trigger: l } = te();
493
- let n;
494
- t && (n = S(e.input) || t.createElement("input"), n.type = "file", n.onchange = (c) => {
495
- const s = c.target;
496
- o.value = s.files, f(o.value);
497
- }, n.oncancel = () => {
498
- l();
20
+ function ue(r, p) {
21
+ return m(() => {
22
+ var f;
23
+ const e = ne(r), o = (f = e == null ? void 0 : e.getRootNode) == null ? void 0 : f.call(e);
24
+ return o instanceof ShadowRoot ? o : document.body;
499
25
  });
500
- const i = () => {
501
- o.value = null, n && n.value && (n.value = "", f(null));
502
- }, a = (c) => {
503
- if (!n)
504
- return;
505
- const s = {
506
- ...je,
507
- ...e,
508
- ...c
509
- };
510
- n.multiple = s.multiple, n.accept = s.accept, n.webkitdirectory = s.directory, We(s, "capture") && (n.capture = s.capture), s.reset && i(), n.click();
511
- };
512
- return {
513
- files: ye(o),
514
- open: a,
515
- reset: i,
516
- onCancel: u,
517
- onChange: r
518
- };
519
26
  }
520
- const re = 1;
521
- function Xe(e, t = {}) {
522
- const {
523
- throttle: o = 0,
524
- idle: r = 200,
525
- onStop: f = O,
526
- onScroll: u = O,
527
- offset: l = {
528
- left: 0,
529
- right: 0,
530
- top: 0,
531
- bottom: 0
532
- },
533
- observe: n = {
534
- mutation: !1
535
- },
536
- eventListenerOptions: i = {
537
- capture: !1,
538
- passive: !0
27
+ const fe = /* @__PURE__ */ g({
28
+ __name: "Popper",
29
+ props: {
30
+ show: { type: Boolean },
31
+ transitionProps: {}
32
+ },
33
+ setup(r, { expose: p }) {
34
+ const e = $(null);
35
+ return p({
36
+ popperRef: e
37
+ }), (o, a) => (h(), C(q, G(J(o.transitionProps)), {
38
+ default: K(() => [
39
+ o.show ? (h(), L("div", {
40
+ key: 0,
41
+ class: "tr-base-popper",
42
+ ref_key: "popperRef",
43
+ ref: e
44
+ }, [
45
+ X(o.$slots, "default", {}, void 0, !0)
46
+ ], 512)) : Q("", !0)
47
+ ]),
48
+ _: 3
49
+ }, 16));
50
+ }
51
+ }), de = /* @__PURE__ */ O(fe, [["__scopeId", "data-v-25c13ab7"]]), me = /* @__PURE__ */ g({
52
+ inheritAttrs: !1,
53
+ __name: "index",
54
+ props: {
55
+ appendTo: {},
56
+ offset: {},
57
+ placement: {
58
+ default: "top-center"
539
59
  },
540
- behavior: a = "auto",
541
- window: c = F,
542
- onError: s = (w) => {
543
- console.error(w);
544
- }
545
- } = t, v = typeof n == "boolean" ? {
546
- mutation: n
547
- } : n, m = y(0), p = y(0), E = I({
548
- get() {
549
- return m.value;
60
+ preventOverflow: {
61
+ type: Boolean
550
62
  },
551
- set(w) {
552
- h(w, void 0);
553
- }
554
- }), d = I({
555
- get() {
556
- return p.value;
63
+ show: {
64
+ type: Boolean
557
65
  },
558
- set(w) {
559
- h(void 0, w);
560
- }
561
- });
562
- function h(w, _) {
563
- var x, D, k, V;
564
- if (!c)
565
- return;
566
- const R = b(e);
567
- if (!R)
568
- return;
569
- (k = R instanceof Document ? c.document.body : R) == null || k.scrollTo({
570
- top: (x = b(_)) != null ? x : d.value,
571
- left: (D = b(w)) != null ? D : E.value,
572
- behavior: b(a)
66
+ transitionProps: {},
67
+ triggerEvents: {}
68
+ },
69
+ setup(r, {
70
+ expose: p
71
+ }) {
72
+ const e = r, o = Y(), {
73
+ vnodes: a,
74
+ ref: u,
75
+ setRef: f
76
+ } = le(o.trigger), E = (t = {}) => {
77
+ const s = {};
78
+ for (const [l, n] of Object.entries(t))
79
+ /^on[A-Z]/.test(l) && typeof n == "function" && (s[l] = n);
80
+ return s;
81
+ }, x = $(null), _ = m(() => {
82
+ var t;
83
+ return ((t = x.value) == null ? void 0 : t.popperRef) || null;
84
+ }), i = m(() => {
85
+ var t, s;
86
+ return typeof e.offset == "number" ? {
87
+ mainAxis: e.offset,
88
+ crossAxis: 0
89
+ } : {
90
+ mainAxis: ((t = e.offset) == null ? void 0 : t.mainAxis) ?? 0,
91
+ crossAxis: ((s = e.offset) == null ? void 0 : s.crossAxis) ?? 0
92
+ };
93
+ }), {
94
+ top: N,
95
+ bottom: V,
96
+ left: w,
97
+ right: z,
98
+ width: D,
99
+ update: y
100
+ } = pe(u), {
101
+ width: P,
102
+ height: v
103
+ } = ae(_, void 0, {
104
+ box: "border-box"
105
+ }), F = m(() => {
106
+ const {
107
+ placement: t,
108
+ preventOverflow: s
109
+ } = e, l = {}, n = (d, A) => {
110
+ if (!s) {
111
+ l[d] = A;
112
+ return;
113
+ }
114
+ const b = d === "top" || d === "bottom", M = b ? "100dvh" : "100dvw", W = c(b ? v.value : P.value);
115
+ l[d] = `clamp(0px, ${A}, calc(${M} - ${W}))`;
116
+ };
117
+ return t.includes("top") && n("top", c(N.value - v.value - i.value.mainAxis)), t.includes("bottom") && n("bottom", `calc(100% - ${c(V.value + v.value + i.value.mainAxis)})`), t.includes("left") && n("left", c(w.value + i.value.crossAxis)), t.includes("right") && n("right", `calc(100% - ${c(z.value + i.value.crossAxis)})`), t.includes("center") && n("left", c(w.value + D.value / 2 - P.value / 2 + i.value.crossAxis)), l;
573
118
  });
574
- const P = ((V = R == null ? void 0 : R.document) == null ? void 0 : V.documentElement) || (R == null ? void 0 : R.documentElement) || R;
575
- E != null && (m.value = P.scrollLeft), d != null && (p.value = P.scrollTop);
576
- }
577
- const g = y(!1), T = ee({
578
- left: !0,
579
- right: !1,
580
- top: !0,
581
- bottom: !1
582
- }), W = ee({
583
- left: !1,
584
- right: !1,
585
- top: !1,
586
- bottom: !1
587
- }), Q = (w) => {
588
- g.value && (g.value = !1, W.left = !1, W.right = !1, W.top = !1, W.bottom = !1, f(w));
589
- }, de = Ie(Q, o + r), j = (w) => {
590
- var _;
591
- if (!c)
592
- return;
593
- const x = ((_ = w == null ? void 0 : w.document) == null ? void 0 : _.documentElement) || (w == null ? void 0 : w.documentElement) || S(w), { display: D, flexDirection: k, direction: V } = getComputedStyle(x), R = V === "rtl" ? -1 : 1, P = x.scrollLeft;
594
- W.left = P < m.value, W.right = P > m.value;
595
- const q = Math.abs(P * R) <= (l.left || 0), J = Math.abs(P * R) + x.clientWidth >= x.scrollWidth - (l.right || 0) - re;
596
- D === "flex" && k === "row-reverse" ? (T.left = J, T.right = q) : (T.left = q, T.right = J), m.value = P;
597
- let A = x.scrollTop;
598
- w === c.document && !A && (A = c.document.body.scrollTop), W.top = A < p.value, W.bottom = A > p.value;
599
- const K = Math.abs(A) <= (l.top || 0), Z = Math.abs(A) + x.clientHeight >= x.scrollHeight - (l.bottom || 0) - re;
600
- D === "flex" && k === "column-reverse" ? (T.top = Z, T.bottom = K) : (T.top = K, T.bottom = Z), p.value = A;
601
- }, X = (w) => {
602
- var _;
603
- if (!c)
604
- return;
605
- const x = (_ = w.target.documentElement) != null ? _ : w.target;
606
- j(x), g.value = !0, de(w), u(w);
607
- };
608
- return M(
609
- e,
610
- "scroll",
611
- o ? Pe(X, o, !0, !1) : X,
612
- i
613
- ), z(() => {
614
- try {
615
- const w = b(e);
616
- if (!w)
617
- return;
618
- j(w);
619
- } catch (w) {
620
- s(w);
621
- }
622
- }), v != null && v.mutation && e != null && e !== c && e !== document && Y(
623
- e,
624
- () => {
625
- const w = b(e);
626
- w && j(w);
627
- },
628
- {
629
- attributes: !0,
630
- childList: !0,
631
- subtree: !0
632
- }
633
- ), M(
634
- e,
635
- "scrollend",
636
- Q,
637
- i
638
- ), {
639
- x: E,
640
- y: d,
641
- isScrolling: g,
642
- arrivedState: T,
643
- directions: W,
644
- measure() {
645
- const w = b(e);
646
- c && w && j(w);
647
- }
648
- };
649
- }
650
- function qe(e = {}) {
651
- const {
652
- window: t = F,
653
- initialWidth: o = Number.POSITIVE_INFINITY,
654
- initialHeight: r = Number.POSITIVE_INFINITY,
655
- listenOrientation: f = !0,
656
- includeScrollbar: u = !0,
657
- type: l = "inner"
658
- } = e, n = y(o), i = y(r), a = () => {
659
- if (t)
660
- if (l === "outer")
661
- n.value = t.outerWidth, i.value = t.outerHeight;
662
- else if (l === "visual" && t.visualViewport) {
663
- const { width: s, height: v, scale: m } = t.visualViewport;
664
- n.value = Math.round(s * m), i.value = Math.round(v * m);
665
- } else u ? (n.value = t.innerWidth, i.value = t.innerHeight) : (n.value = t.document.documentElement.clientWidth, i.value = t.document.documentElement.clientHeight);
666
- };
667
- a(), z(a);
668
- const c = { passive: !0 };
669
- if (M("resize", a, c), t && l === "visual" && t.visualViewport && M(t.visualViewport, "resize", a, c), f) {
670
- const s = He("(orientation: portrait)");
671
- L(s, () => a());
119
+ ee(() => e.show, (t) => {
120
+ t && y();
121
+ }, {
122
+ flush: "post"
123
+ });
124
+ const I = ue(u), U = te(), H = oe({
125
+ to: e.appendTo || I.value
126
+ });
127
+ return ie(H, () => se(de, S({
128
+ ref: x,
129
+ show: e.show,
130
+ transitionProps: e.transitionProps,
131
+ style: F.value
132
+ }, U), {
133
+ default: () => {
134
+ var t;
135
+ return [(t = o.content) == null ? void 0 : t.call(o)];
136
+ }
137
+ })), p({
138
+ triggerRef: u,
139
+ popperRef: _,
140
+ update: y
141
+ }), (t, s) => (h(), C(re(T(a)[0]), S({
142
+ ref: T(f)
143
+ }, E(e.triggerEvents)), null, 16));
672
144
  }
673
- return { width: n, height: i };
674
- }
145
+ }), ve = /* @__PURE__ */ O(me, [["__scopeId", "data-v-c09160be"]]);
146
+ ve.name = "TrBasePopper";
675
147
  export {
676
- Ge as a,
677
- Ue as b,
678
- qe as c,
679
- Qe as d,
680
- Ye as e,
681
- S as f,
682
- M as g,
683
- He as h,
684
- Be as i,
685
- $e as o,
686
- Xe as u,
687
- Ne as w
148
+ ve as B,
149
+ ie as c,
150
+ ue as u
688
151
  };