@opentiny/tiny-robot 0.3.0-alpha.8 → 0.3.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index3.js CHANGED
@@ -1,688 +1,161 @@
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 { onMounted as U, nextTick as B, h as C, defineComponent as g, render as R, onBeforeUnmount as D, Teleport as W, computed as h, ref as E, createBlock as F, openBlock as _, Transition as j, normalizeProps as q, guardReactiveProps as L, withCtx as Z, createElementBlock as G, createCommentVNode as J, renderSlot as K, useSlots as Q, watch as X, useAttrs as Y, resolveDynamicComponent as ee, unref as S, mergeProps as k, createVNode as te } from "vue";
2
+ import { b as oe, a as re, e as ne } from "./index2.js";
3
+ import { t as u } from "./utils.js";
4
+ import { _ as N } from "./_plugin-vue_export-helper.js";
5
+ import { u as se } from "./useSlotRefs.js";
6
+ const pe = g({
7
+ setup: (r) => () => C(W, r.propsFactory(), r.vnodeFactory()),
8
+ props: ["propsFactory", "vnodeFactory"]
9
+ });
10
+ function ae(r, n) {
11
+ let e = null, t = null, s = !1;
12
+ U(() => {
13
+ B(() => {
14
+ s || (t = document.createElement("div"), e = C(pe, { propsFactory: r, vnodeFactory: n }), R(e, t));
42
15
  });
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);
16
+ }), D(() => {
17
+ s = !0, B(() => {
18
+ t && (R(null, t), t.remove(), e = null, t = null);
61
19
  });
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
- });
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
- }
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
20
  });
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
21
  }
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();
22
+ function ce(r, n) {
23
+ return h(() => {
24
+ var v;
25
+ if (n instanceof HTMLElement)
26
+ return n;
27
+ const e = n, t = oe(r), s = (v = t == null ? void 0 : t.getRootNode) == null ? void 0 : v.call(t), i = s instanceof ShadowRoot, d = i ? s : document.body;
28
+ if (e) {
29
+ if (!i && e === "body")
30
+ return document.body;
31
+ const f = d.querySelector(e);
32
+ if (f instanceof Node) return f;
33
+ }
34
+ return d;
499
35
  });
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
36
  }
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
37
+ const ie = /* @__PURE__ */ g({
38
+ __name: "Popper",
39
+ props: {
40
+ show: { type: Boolean },
41
+ transitionProps: {}
42
+ },
43
+ setup(r, { expose: n }) {
44
+ const e = E(null);
45
+ return n({
46
+ popperRef: e
47
+ }), (t, s) => (_(), F(j, q(L(t.transitionProps)), {
48
+ default: Z(() => [
49
+ t.show ? (_(), G("div", {
50
+ key: 0,
51
+ class: "tr-base-popper",
52
+ ref_key: "popperRef",
53
+ ref: e
54
+ }, [
55
+ K(t.$slots, "default", {}, void 0, !0)
56
+ ], 512)) : J("", !0)
57
+ ]),
58
+ _: 3
59
+ }, 16));
60
+ }
61
+ }), le = /* @__PURE__ */ N(ie, [["__scopeId", "data-v-25c13ab7"]]), ue = /* @__PURE__ */ g({
62
+ inheritAttrs: !1,
63
+ __name: "index",
64
+ props: {
65
+ appendTo: {},
66
+ offset: {},
67
+ placement: {
68
+ default: "top-center"
539
69
  },
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;
70
+ preventOverflow: {
71
+ type: Boolean
550
72
  },
551
- set(w) {
552
- h(w, void 0);
553
- }
554
- }), d = I({
555
- get() {
556
- return p.value;
73
+ show: {
74
+ type: Boolean
557
75
  },
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)
76
+ transitionProps: {},
77
+ triggerEvents: {}
78
+ },
79
+ setup(r, {
80
+ expose: n
81
+ }) {
82
+ const e = r, t = Q(), {
83
+ vnodes: s,
84
+ ref: i,
85
+ setRef: d
86
+ } = se(t.trigger), v = (o = {}) => {
87
+ const p = {};
88
+ for (const [c, a] of Object.entries(o))
89
+ /^on[A-Z]/.test(c) && typeof a == "function" && (p[c] = a);
90
+ return p;
91
+ }, f = E(null), b = h(() => {
92
+ var o;
93
+ return ((o = f.value) == null ? void 0 : o.popperRef) || null;
94
+ }), m = h(() => {
95
+ var o, p;
96
+ return typeof e.offset == "number" ? {
97
+ mainAxis: e.offset,
98
+ crossAxis: 0
99
+ } : {
100
+ mainAxis: ((o = e.offset) == null ? void 0 : o.mainAxis) ?? 0,
101
+ crossAxis: ((p = e.offset) == null ? void 0 : p.crossAxis) ?? 0
102
+ };
103
+ }), {
104
+ top: $,
105
+ bottom: O,
106
+ left: w,
107
+ right: V,
108
+ width: z,
109
+ update: A
110
+ } = re(i), {
111
+ width: y,
112
+ height: P
113
+ } = ne(b, void 0, {
114
+ box: "border-box"
115
+ }), H = h(() => {
116
+ const {
117
+ placement: o,
118
+ preventOverflow: p
119
+ } = e, c = {}, a = (l, x) => {
120
+ if (!p) {
121
+ c[l] = x;
122
+ return;
123
+ }
124
+ const T = u(l === "top" ? P.value : y.value);
125
+ l === "top" ? c[l] = `clamp(var(--tr-base-popper-min-top), ${x}, calc(var(--tr-base-popper-max-bottom) - ${T}))` : l === "left" && (c[l] = `clamp(var(--tr-base-popper-min-left), ${x}, calc(var(--tr-base-popper-max-right) - ${T}))`);
126
+ };
127
+ return o.includes("top") && a("top", u($.value - P.value - m.value.mainAxis)), o.includes("bottom") && a("top", u(O.value + m.value.mainAxis)), o.includes("left") && a("left", u(w.value + m.value.crossAxis)), o.includes("right") && a("left", u(V.value - y.value + m.value.crossAxis)), o.includes("center") && a("left", u(w.value + z.value / 2 - y.value / 2 + m.value.crossAxis)), c;
573
128
  });
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());
129
+ X(() => e.show, (o) => {
130
+ o && A();
131
+ }, {
132
+ flush: "post"
133
+ });
134
+ const I = ce(i, e.appendTo), M = Y();
135
+ return ae(() => ({
136
+ to: I.value
137
+ }), () => te(le, k({
138
+ ref: f,
139
+ show: e.show,
140
+ transitionProps: e.transitionProps,
141
+ style: H.value
142
+ }, M), {
143
+ default: () => {
144
+ var o;
145
+ return [(o = t.content) == null ? void 0 : o.call(t)];
146
+ }
147
+ })), n({
148
+ triggerRef: i,
149
+ popperRef: b,
150
+ update: A
151
+ }), (o, p) => (_(), F(ee(S(s)[0]), k({
152
+ ref: S(d)
153
+ }, v(e.triggerEvents)), null, 16));
672
154
  }
673
- return { width: n, height: i };
674
- }
155
+ }), fe = /* @__PURE__ */ N(ue, [["__scopeId", "data-v-f1e25842"]]);
156
+ fe.name = "TrBasePopper";
675
157
  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
158
+ fe as B,
159
+ ae as c,
160
+ ce as u
688
161
  };