@opentiny/tiny-robot 0.3.1-alpha.5 → 0.3.1-alpha.7

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