@opentiny/tiny-robot 0.2.9 → 0.2.11

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