@opentiny/tiny-robot 0.3.0-alpha.13 → 0.3.0-alpha.15

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