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