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