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