@ddict/popup 1.0.7 → 1.0.9
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/assets/icons/arrow-full-screen.svg +10 -0
- package/dist/assets/icons/book-one.svg +5 -0
- package/dist/assets/icons/cancel.svg +4 -0
- package/dist/assets/icons/favorite-filled.svg +3 -0
- package/dist/assets/icons/favorite.svg +3 -0
- package/dist/assets/icons/google-translate.svg +3 -0
- package/dist/assets/icons/logo.svg +9 -0
- package/dist/assets/icons/setting.svg +4 -0
- package/dist/assets/icons/transfer.svg +6 -0
- package/dist/assets/icons/volume-stop.svg +3 -0
- package/dist/assets/icons/volume.svg +3 -0
- package/dist/popup.css +1 -1
- package/dist/popup.es.js +1557 -1330
- package/dist/popup.umd.js +9 -9
- package/package.json +1 -1
package/dist/popup.es.js
CHANGED
|
@@ -1,103 +1,151 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { openBlock as S, createElementBlock as $, createElementVNode as g, computed as w, unref as P, shallowRef as cn, watch as j, triggerRef as it, onScopeDispose as Ze, ref as E, onUnmounted as St, inject as Te, watchEffect as ie, onMounted as pe, cloneVNode as Et, h as Oe, Fragment as G, defineComponent as ae, provide as et, reactive as Ot, nextTick as te, toRaw as Y, mergeModels as dn, useModel as fn, createBlock as Z, withCtx as ke, createVNode as z, renderList as le, normalizeClass as ye, toDisplayString as ee, effectScope as $t, markRaw as de, hasInjectionContext as pn, getCurrentInstance as It, isRef as xe, isReactive as tt, toRef as We, getCurrentScope as Ct, toRefs as at, createCommentVNode as X, withModifiers as vn, createTextVNode as hn, withDirectives as Tt, vModelText as Pt, pushScopeId as mn, popScopeId as gn } from "vue";
|
|
2
|
+
const bn = "/assets/icons/logo.svg", _n = "/assets/icons/book-one.svg", yn = "/assets/icons/arrow-full-screen.svg", xn = "/assets/icons/setting.svg", wn = { class: "flex justify-between" }, Sn = /* @__PURE__ */ g("div", { class: "flex flex-row" }, [
|
|
3
|
+
/* @__PURE__ */ g("img", {
|
|
4
|
+
src: bn,
|
|
5
|
+
alt: "Vue logo",
|
|
6
|
+
class: "w-24"
|
|
7
|
+
})
|
|
8
|
+
], -1), En = { class: "flex" }, On = /* @__PURE__ */ g("img", {
|
|
9
|
+
src: _n,
|
|
10
|
+
alt: "Reader",
|
|
11
|
+
class: "w-7"
|
|
12
|
+
}, null, -1), $n = [
|
|
13
|
+
On
|
|
14
|
+
], In = /* @__PURE__ */ g("img", {
|
|
15
|
+
src: yn,
|
|
16
|
+
alt: "Full screen",
|
|
17
|
+
class: "w-7"
|
|
18
|
+
}, null, -1), Cn = [
|
|
19
|
+
In
|
|
20
|
+
], Tn = /* @__PURE__ */ g("img", {
|
|
21
|
+
src: xn,
|
|
22
|
+
alt: "Setting",
|
|
23
|
+
class: "w-7"
|
|
24
|
+
}, null, -1), Pn = [
|
|
25
|
+
Tn
|
|
26
|
+
], kn = {
|
|
27
|
+
__name: "Header",
|
|
28
|
+
emits: ["settings", "fullScreen", "reader"],
|
|
29
|
+
setup(e, { emit: o }) {
|
|
30
|
+
const t = o;
|
|
31
|
+
return (n, s) => (S(), $("div", wn, [
|
|
32
|
+
Sn,
|
|
33
|
+
g("div", En, [
|
|
34
|
+
g("button", {
|
|
35
|
+
class: "btn btn-ghost btn-circle",
|
|
36
|
+
onClick: s[0] || (s[0] = (r) => t("reader"))
|
|
37
|
+
}, $n),
|
|
38
|
+
g("button", {
|
|
39
|
+
class: "btn btn-ghost btn-circle",
|
|
40
|
+
onClick: s[1] || (s[1] = (r) => t("fullScreen"))
|
|
41
|
+
}, Cn),
|
|
42
|
+
g("button", {
|
|
43
|
+
class: "btn btn-ghost btn-circle",
|
|
44
|
+
onClick: s[2] || (s[2] = (r) => t("settings"))
|
|
45
|
+
}, Pn)
|
|
46
|
+
])
|
|
47
|
+
]));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
function we(e, o, t) {
|
|
51
|
+
let n = t.initialDeps ?? [], s;
|
|
4
52
|
return () => {
|
|
5
|
-
var r, i,
|
|
53
|
+
var r, i, l, a;
|
|
6
54
|
let u;
|
|
7
55
|
t.key && ((r = t.debug) != null && r.call(t)) && (u = Date.now());
|
|
8
|
-
const
|
|
9
|
-
if (!(
|
|
10
|
-
return
|
|
11
|
-
n =
|
|
12
|
-
let
|
|
13
|
-
if (t.key && ((i = t.debug) != null && i.call(t)) && (
|
|
14
|
-
const m = Math.round((Date.now() - u) * 100) / 100,
|
|
15
|
-
for (
|
|
16
|
-
|
|
17
|
-
return
|
|
56
|
+
const p = e();
|
|
57
|
+
if (!(p.length !== n.length || p.some((m, v) => n[v] !== m)))
|
|
58
|
+
return s;
|
|
59
|
+
n = p;
|
|
60
|
+
let h;
|
|
61
|
+
if (t.key && ((i = t.debug) != null && i.call(t)) && (h = Date.now()), s = o(...p), t.key && ((l = t.debug) != null && l.call(t))) {
|
|
62
|
+
const m = Math.round((Date.now() - u) * 100) / 100, v = Math.round((Date.now() - h) * 100) / 100, I = v / 16, V = (T, C) => {
|
|
63
|
+
for (T = String(T); T.length < C; )
|
|
64
|
+
T = " " + T;
|
|
65
|
+
return T;
|
|
18
66
|
};
|
|
19
67
|
console.info(
|
|
20
|
-
`%c⏱ ${
|
|
68
|
+
`%c⏱ ${V(v, 5)} /${V(m, 5)} ms`,
|
|
21
69
|
`
|
|
22
70
|
font-size: .6rem;
|
|
23
71
|
font-weight: bold;
|
|
24
72
|
color: hsl(${Math.max(
|
|
25
73
|
0,
|
|
26
|
-
Math.min(120 - 120 *
|
|
74
|
+
Math.min(120 - 120 * I, 120)
|
|
27
75
|
)}deg 100% 31%);`,
|
|
28
76
|
t == null ? void 0 : t.key
|
|
29
77
|
);
|
|
30
78
|
}
|
|
31
|
-
return (a = t == null ? void 0 : t.onChange) == null || a.call(t,
|
|
79
|
+
return (a = t == null ? void 0 : t.onChange) == null || a.call(t, s), s;
|
|
32
80
|
};
|
|
33
81
|
}
|
|
34
|
-
function
|
|
82
|
+
function Ge(e, o) {
|
|
35
83
|
if (e === void 0)
|
|
36
84
|
throw new Error("Unexpected undefined");
|
|
37
85
|
return e;
|
|
38
86
|
}
|
|
39
|
-
const
|
|
87
|
+
const Rn = (e, o) => Math.abs(e - o) < 1, Nn = (e, o, t) => {
|
|
40
88
|
let n;
|
|
41
|
-
return function(...
|
|
42
|
-
e.clearTimeout(n), n = e.setTimeout(() => o.apply(this,
|
|
89
|
+
return function(...s) {
|
|
90
|
+
e.clearTimeout(n), n = e.setTimeout(() => o.apply(this, s), t);
|
|
43
91
|
};
|
|
44
|
-
},
|
|
92
|
+
}, Dn = (e) => e, Ln = (e) => {
|
|
45
93
|
const o = Math.max(e.startIndex - e.overscan, 0), t = Math.min(e.endIndex + e.overscan, e.count - 1), n = [];
|
|
46
|
-
for (let
|
|
47
|
-
n.push(
|
|
94
|
+
for (let s = o; s <= t; s++)
|
|
95
|
+
n.push(s);
|
|
48
96
|
return n;
|
|
49
|
-
},
|
|
97
|
+
}, Vn = (e, o) => {
|
|
50
98
|
const t = e.scrollElement;
|
|
51
99
|
if (!t)
|
|
52
100
|
return;
|
|
53
101
|
const n = e.targetWindow;
|
|
54
102
|
if (!n)
|
|
55
103
|
return;
|
|
56
|
-
const
|
|
57
|
-
const { width:
|
|
58
|
-
o({ width: Math.round(
|
|
104
|
+
const s = (i) => {
|
|
105
|
+
const { width: l, height: a } = i;
|
|
106
|
+
o({ width: Math.round(l), height: Math.round(a) });
|
|
59
107
|
};
|
|
60
|
-
if (
|
|
108
|
+
if (s(t.getBoundingClientRect()), !n.ResizeObserver)
|
|
61
109
|
return () => {
|
|
62
110
|
};
|
|
63
111
|
const r = new n.ResizeObserver((i) => {
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
const a =
|
|
112
|
+
const l = i[0];
|
|
113
|
+
if (l != null && l.borderBoxSize) {
|
|
114
|
+
const a = l.borderBoxSize[0];
|
|
67
115
|
if (a) {
|
|
68
|
-
|
|
116
|
+
s({ width: a.inlineSize, height: a.blockSize });
|
|
69
117
|
return;
|
|
70
118
|
}
|
|
71
119
|
}
|
|
72
|
-
|
|
120
|
+
s(t.getBoundingClientRect());
|
|
73
121
|
});
|
|
74
122
|
return r.observe(t, { box: "border-box" }), () => {
|
|
75
123
|
r.unobserve(t);
|
|
76
124
|
};
|
|
77
125
|
}, ut = {
|
|
78
126
|
passive: !0
|
|
79
|
-
},
|
|
127
|
+
}, An = typeof window > "u" ? !0 : "onscrollend" in window, Mn = (e, o) => {
|
|
80
128
|
const t = e.scrollElement;
|
|
81
129
|
if (!t)
|
|
82
130
|
return;
|
|
83
131
|
const n = e.targetWindow;
|
|
84
132
|
if (!n)
|
|
85
133
|
return;
|
|
86
|
-
let
|
|
87
|
-
const r =
|
|
88
|
-
} :
|
|
134
|
+
let s = 0;
|
|
135
|
+
const r = An ? () => {
|
|
136
|
+
} : Nn(
|
|
89
137
|
n,
|
|
90
138
|
() => {
|
|
91
|
-
o(
|
|
139
|
+
o(s, !1);
|
|
92
140
|
},
|
|
93
141
|
e.options.isScrollingResetDelay
|
|
94
142
|
), i = (u) => () => {
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
return a(), t.addEventListener("scroll",
|
|
98
|
-
t.removeEventListener("scroll",
|
|
143
|
+
s = t[e.options.horizontal ? "scrollLeft" : "scrollTop"], r(), o(s, u);
|
|
144
|
+
}, l = i(!0), a = i(!1);
|
|
145
|
+
return a(), t.addEventListener("scroll", l, ut), t.addEventListener("scrollend", a, ut), () => {
|
|
146
|
+
t.removeEventListener("scroll", l), t.removeEventListener("scrollend", a);
|
|
99
147
|
};
|
|
100
|
-
},
|
|
148
|
+
}, jn = (e, o, t) => {
|
|
101
149
|
if (o != null && o.borderBoxSize) {
|
|
102
150
|
const n = o.borderBoxSize[0];
|
|
103
151
|
if (n)
|
|
@@ -108,43 +156,43 @@ const hn = (e, o) => Math.abs(e - o) < 1, mn = (e, o, t) => {
|
|
|
108
156
|
return Math.round(
|
|
109
157
|
e.getBoundingClientRect()[t.options.horizontal ? "width" : "height"]
|
|
110
158
|
);
|
|
111
|
-
},
|
|
159
|
+
}, Fn = (e, {
|
|
112
160
|
adjustments: o = 0,
|
|
113
161
|
behavior: t
|
|
114
162
|
}, n) => {
|
|
115
|
-
var
|
|
163
|
+
var s, r;
|
|
116
164
|
const i = e + o;
|
|
117
|
-
(r = (
|
|
165
|
+
(r = (s = n.scrollElement) == null ? void 0 : s.scrollTo) == null || r.call(s, {
|
|
118
166
|
[n.options.horizontal ? "left" : "top"]: i,
|
|
119
167
|
behavior: t
|
|
120
168
|
});
|
|
121
169
|
};
|
|
122
|
-
class
|
|
170
|
+
class Bn {
|
|
123
171
|
constructor(o) {
|
|
124
172
|
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollToIndexTimeoutId = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
|
|
125
173
|
let t = null;
|
|
126
|
-
const n = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((
|
|
127
|
-
|
|
174
|
+
const n = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((s) => {
|
|
175
|
+
s.forEach((r) => {
|
|
128
176
|
this._measureElement(r.target, r);
|
|
129
177
|
});
|
|
130
178
|
}));
|
|
131
179
|
return {
|
|
132
180
|
disconnect: () => {
|
|
133
|
-
var
|
|
134
|
-
return (
|
|
181
|
+
var s;
|
|
182
|
+
return (s = n()) == null ? void 0 : s.disconnect();
|
|
135
183
|
},
|
|
136
|
-
observe: (
|
|
184
|
+
observe: (s) => {
|
|
137
185
|
var r;
|
|
138
|
-
return (r = n()) == null ? void 0 : r.observe(
|
|
186
|
+
return (r = n()) == null ? void 0 : r.observe(s, { box: "border-box" });
|
|
139
187
|
},
|
|
140
|
-
unobserve: (
|
|
188
|
+
unobserve: (s) => {
|
|
141
189
|
var r;
|
|
142
|
-
return (r = n()) == null ? void 0 : r.unobserve(
|
|
190
|
+
return (r = n()) == null ? void 0 : r.unobserve(s);
|
|
143
191
|
}
|
|
144
192
|
};
|
|
145
193
|
})(), this.range = null, this.setOptions = (t) => {
|
|
146
|
-
Object.entries(t).forEach(([n,
|
|
147
|
-
typeof
|
|
194
|
+
Object.entries(t).forEach(([n, s]) => {
|
|
195
|
+
typeof s > "u" && delete t[n];
|
|
148
196
|
}), this.options = {
|
|
149
197
|
debug: !1,
|
|
150
198
|
initialOffset: 0,
|
|
@@ -154,11 +202,11 @@ class On {
|
|
|
154
202
|
scrollPaddingStart: 0,
|
|
155
203
|
scrollPaddingEnd: 0,
|
|
156
204
|
horizontal: !1,
|
|
157
|
-
getItemKey:
|
|
158
|
-
rangeExtractor:
|
|
205
|
+
getItemKey: Dn,
|
|
206
|
+
rangeExtractor: Ln,
|
|
159
207
|
onChange: () => {
|
|
160
208
|
},
|
|
161
|
-
measureElement:
|
|
209
|
+
measureElement: jn,
|
|
162
210
|
initialRect: { width: 0, height: 0 },
|
|
163
211
|
scrollMargin: 0,
|
|
164
212
|
gap: 0,
|
|
@@ -170,12 +218,12 @@ class On {
|
|
|
170
218
|
...t
|
|
171
219
|
};
|
|
172
220
|
}, this.notify = (t, n) => {
|
|
173
|
-
var
|
|
174
|
-
const { startIndex: i, endIndex:
|
|
221
|
+
var s, r;
|
|
222
|
+
const { startIndex: i, endIndex: l } = this.range ?? {
|
|
175
223
|
startIndex: void 0,
|
|
176
224
|
endIndex: void 0
|
|
177
225
|
}, a = this.calculateRange();
|
|
178
|
-
(t || i !== (a == null ? void 0 : a.startIndex) ||
|
|
226
|
+
(t || i !== (a == null ? void 0 : a.startIndex) || l !== (a == null ? void 0 : a.endIndex)) && ((r = (s = this.options).onChange) == null || r.call(s, this, n));
|
|
179
227
|
}, this.cleanup = () => {
|
|
180
228
|
this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.observer.disconnect(), this.elementsCache.clear();
|
|
181
229
|
}, this._didMount = () => () => {
|
|
@@ -192,31 +240,31 @@ class On {
|
|
|
192
240
|
adjustments: void 0,
|
|
193
241
|
behavior: void 0
|
|
194
242
|
}), this.unsubs.push(
|
|
195
|
-
this.options.observeElementRect(this, (
|
|
196
|
-
this.scrollRect =
|
|
243
|
+
this.options.observeElementRect(this, (s) => {
|
|
244
|
+
this.scrollRect = s, this.notify(!1, !1);
|
|
197
245
|
})
|
|
198
246
|
), this.unsubs.push(
|
|
199
|
-
this.options.observeElementOffset(this, (
|
|
200
|
-
this.scrollAdjustments = 0, this.scrollDirection = r ? this.getScrollOffset() <
|
|
247
|
+
this.options.observeElementOffset(this, (s, r) => {
|
|
248
|
+
this.scrollAdjustments = 0, this.scrollDirection = r ? this.getScrollOffset() < s ? "forward" : "backward" : null, this.scrollOffset = s;
|
|
201
249
|
const i = this.isScrolling;
|
|
202
250
|
this.isScrolling = r, this.notify(i !== r, r);
|
|
203
251
|
})
|
|
204
252
|
);
|
|
205
253
|
}
|
|
206
254
|
}, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (t, n) => {
|
|
207
|
-
const
|
|
255
|
+
const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
208
256
|
for (let i = n - 1; i >= 0; i--) {
|
|
209
|
-
const
|
|
210
|
-
if (
|
|
257
|
+
const l = t[i];
|
|
258
|
+
if (s.has(l.lane))
|
|
211
259
|
continue;
|
|
212
260
|
const a = r.get(
|
|
213
|
-
|
|
261
|
+
l.lane
|
|
214
262
|
);
|
|
215
|
-
if (a == null ||
|
|
263
|
+
if (a == null || l.end > a.end ? r.set(l.lane, l) : l.end < a.end && s.set(l.lane, !0), s.size === this.options.lanes)
|
|
216
264
|
break;
|
|
217
265
|
}
|
|
218
|
-
return r.size === this.options.lanes ? Array.from(r.values()).sort((i,
|
|
219
|
-
}, this.getMeasurementOptions =
|
|
266
|
+
return r.size === this.options.lanes ? Array.from(r.values()).sort((i, l) => i.end === l.end ? i.index - l.index : i.end - l.end)[0] : void 0;
|
|
267
|
+
}, this.getMeasurementOptions = we(
|
|
220
268
|
() => [
|
|
221
269
|
this.options.count,
|
|
222
270
|
this.options.paddingStart,
|
|
@@ -224,19 +272,19 @@ class On {
|
|
|
224
272
|
this.options.getItemKey,
|
|
225
273
|
this.options.enabled
|
|
226
274
|
],
|
|
227
|
-
(t, n,
|
|
275
|
+
(t, n, s, r, i) => (this.pendingMeasuredCacheIndexes = [], {
|
|
228
276
|
count: t,
|
|
229
277
|
paddingStart: n,
|
|
230
|
-
scrollMargin:
|
|
278
|
+
scrollMargin: s,
|
|
231
279
|
getItemKey: r,
|
|
232
280
|
enabled: i
|
|
233
281
|
}),
|
|
234
282
|
{
|
|
235
283
|
key: !1
|
|
236
284
|
}
|
|
237
|
-
), this.getMeasurements =
|
|
285
|
+
), this.getMeasurements = we(
|
|
238
286
|
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
239
|
-
({ count: t, paddingStart: n, scrollMargin:
|
|
287
|
+
({ count: t, paddingStart: n, scrollMargin: s, getItemKey: r, enabled: i }, l) => {
|
|
240
288
|
var a;
|
|
241
289
|
if (!i)
|
|
242
290
|
return this.measurementsCache = [], this.itemSizeCache.clear(), [];
|
|
@@ -245,59 +293,59 @@ class On {
|
|
|
245
293
|
}));
|
|
246
294
|
const u = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
247
295
|
this.pendingMeasuredCacheIndexes = [];
|
|
248
|
-
const
|
|
296
|
+
const p = this.measurementsCache.slice(0, u);
|
|
249
297
|
for (let c = u; c < t; c++) {
|
|
250
|
-
let
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
if (!
|
|
254
|
-
|
|
298
|
+
let h = (a = this.measurementsCache[c]) == null ? void 0 : a.measureElement;
|
|
299
|
+
h || (h = (M) => {
|
|
300
|
+
const y = r(c), R = this.elementsCache.get(y);
|
|
301
|
+
if (!M) {
|
|
302
|
+
R && (this.observer.unobserve(R), this.elementsCache.delete(y));
|
|
255
303
|
return;
|
|
256
304
|
}
|
|
257
|
-
|
|
305
|
+
R !== M && (R && this.observer.unobserve(R), this.observer.observe(M), this.elementsCache.set(y, M)), M.isConnected && this.resizeItem(
|
|
258
306
|
c,
|
|
259
|
-
this.options.measureElement(
|
|
307
|
+
this.options.measureElement(M, void 0, this)
|
|
260
308
|
);
|
|
261
309
|
});
|
|
262
|
-
const m = r(c),
|
|
263
|
-
|
|
310
|
+
const m = r(c), v = this.options.lanes === 1 ? p[c - 1] : this.getFurthestMeasurement(p, c), I = v ? v.end + this.options.gap : n + s, V = l.get(m), T = typeof V == "number" ? V : this.options.estimateSize(c), C = I + T, L = v ? v.lane : c % this.options.lanes;
|
|
311
|
+
p[c] = {
|
|
264
312
|
index: c,
|
|
265
|
-
start:
|
|
266
|
-
size:
|
|
267
|
-
end:
|
|
313
|
+
start: I,
|
|
314
|
+
size: T,
|
|
315
|
+
end: C,
|
|
268
316
|
key: m,
|
|
269
|
-
lane:
|
|
270
|
-
measureElement:
|
|
317
|
+
lane: L,
|
|
318
|
+
measureElement: h
|
|
271
319
|
};
|
|
272
320
|
}
|
|
273
|
-
return this.measurementsCache =
|
|
321
|
+
return this.measurementsCache = p, p;
|
|
274
322
|
},
|
|
275
323
|
{
|
|
276
324
|
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
277
325
|
debug: () => this.options.debug
|
|
278
326
|
}
|
|
279
|
-
), this.calculateRange =
|
|
327
|
+
), this.calculateRange = we(
|
|
280
328
|
() => [this.getMeasurements(), this.getSize(), this.getScrollOffset()],
|
|
281
|
-
(t, n,
|
|
329
|
+
(t, n, s) => this.range = t.length > 0 && n > 0 ? zn({
|
|
282
330
|
measurements: t,
|
|
283
331
|
outerSize: n,
|
|
284
|
-
scrollOffset:
|
|
332
|
+
scrollOffset: s
|
|
285
333
|
}) : null,
|
|
286
334
|
{
|
|
287
335
|
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
288
336
|
debug: () => this.options.debug
|
|
289
337
|
}
|
|
290
|
-
), this.getIndexes =
|
|
338
|
+
), this.getIndexes = we(
|
|
291
339
|
() => [
|
|
292
340
|
this.options.rangeExtractor,
|
|
293
341
|
this.calculateRange(),
|
|
294
342
|
this.options.overscan,
|
|
295
343
|
this.options.count
|
|
296
344
|
],
|
|
297
|
-
(t, n,
|
|
345
|
+
(t, n, s, r) => n === null ? [] : t({
|
|
298
346
|
startIndex: n.startIndex,
|
|
299
347
|
endIndex: n.endIndex,
|
|
300
|
-
overscan:
|
|
348
|
+
overscan: s,
|
|
301
349
|
count: r
|
|
302
350
|
}),
|
|
303
351
|
{
|
|
@@ -305,40 +353,40 @@ class On {
|
|
|
305
353
|
debug: () => this.options.debug
|
|
306
354
|
}
|
|
307
355
|
), this.indexFromElement = (t) => {
|
|
308
|
-
const n = this.options.indexAttribute,
|
|
309
|
-
return
|
|
356
|
+
const n = this.options.indexAttribute, s = t.getAttribute(n);
|
|
357
|
+
return s ? parseInt(s, 10) : (console.warn(
|
|
310
358
|
`Missing attribute name '${n}={index}' on measured element.`
|
|
311
359
|
), -1);
|
|
312
360
|
}, this._measureElement = (t, n) => {
|
|
313
|
-
const
|
|
361
|
+
const s = this.indexFromElement(t), r = this.getMeasurements()[s];
|
|
314
362
|
if (!r || !t.isConnected) {
|
|
315
|
-
this.elementsCache.forEach((
|
|
316
|
-
|
|
363
|
+
this.elementsCache.forEach((l, a) => {
|
|
364
|
+
l === t && (this.observer.unobserve(t), this.elementsCache.delete(a));
|
|
317
365
|
});
|
|
318
366
|
return;
|
|
319
367
|
}
|
|
320
368
|
const i = this.elementsCache.get(r.key);
|
|
321
|
-
i !== t && (i && this.observer.unobserve(i), this.observer.observe(t), this.elementsCache.set(r.key, t)), this.resizeItem(
|
|
369
|
+
i !== t && (i && this.observer.unobserve(i), this.observer.observe(t), this.elementsCache.set(r.key, t)), this.resizeItem(s, this.options.measureElement(t, n, this));
|
|
322
370
|
}, this.resizeItem = (t, n) => {
|
|
323
|
-
const
|
|
324
|
-
if (!
|
|
371
|
+
const s = this.getMeasurements()[t];
|
|
372
|
+
if (!s)
|
|
325
373
|
return;
|
|
326
|
-
const r = this.itemSizeCache.get(
|
|
327
|
-
i !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(
|
|
374
|
+
const r = this.itemSizeCache.get(s.key) ?? s.size, i = n - r;
|
|
375
|
+
i !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(s, i, this) : s.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", i), this._scrollToOffset(this.getScrollOffset(), {
|
|
328
376
|
adjustments: this.scrollAdjustments += i,
|
|
329
377
|
behavior: void 0
|
|
330
|
-
})), this.pendingMeasuredCacheIndexes.push(
|
|
378
|
+
})), this.pendingMeasuredCacheIndexes.push(s.index), this.itemSizeCache = new Map(this.itemSizeCache.set(s.key, n)), this.notify(!0, !1));
|
|
331
379
|
}, this.measureElement = (t) => {
|
|
332
380
|
t && this._measureElement(t, void 0);
|
|
333
|
-
}, this.getVirtualItems =
|
|
381
|
+
}, this.getVirtualItems = we(
|
|
334
382
|
() => [this.getIndexes(), this.getMeasurements()],
|
|
335
383
|
(t, n) => {
|
|
336
|
-
const
|
|
384
|
+
const s = [];
|
|
337
385
|
for (let r = 0, i = t.length; r < i; r++) {
|
|
338
|
-
const
|
|
339
|
-
|
|
386
|
+
const l = t[r], a = n[l];
|
|
387
|
+
s.push(a);
|
|
340
388
|
}
|
|
341
|
-
return
|
|
389
|
+
return s;
|
|
342
390
|
},
|
|
343
391
|
{
|
|
344
392
|
key: process.env.NODE_ENV !== "production" && "getIndexes",
|
|
@@ -347,60 +395,60 @@ class On {
|
|
|
347
395
|
), this.getVirtualItemForOffset = (t) => {
|
|
348
396
|
const n = this.getMeasurements();
|
|
349
397
|
if (n.length !== 0)
|
|
350
|
-
return
|
|
351
|
-
n[
|
|
398
|
+
return Ge(
|
|
399
|
+
n[kt(
|
|
352
400
|
0,
|
|
353
401
|
n.length - 1,
|
|
354
|
-
(
|
|
402
|
+
(s) => Ge(n[s]).start,
|
|
355
403
|
t
|
|
356
404
|
)]
|
|
357
405
|
);
|
|
358
406
|
}, this.getOffsetForAlignment = (t, n) => {
|
|
359
|
-
const
|
|
360
|
-
n === "auto" && (t <= r ? n = "start" : t >= r +
|
|
361
|
-
const i = this.options.horizontal ? "scrollWidth" : "scrollHeight", a = (this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[i] : this.scrollElement[i] : 0) -
|
|
407
|
+
const s = this.getSize(), r = this.getScrollOffset();
|
|
408
|
+
n === "auto" && (t <= r ? n = "start" : t >= r + s ? n = "end" : n = "start"), n === "start" ? t = t : n === "end" ? t = t - s : n === "center" && (t = t - s / 2);
|
|
409
|
+
const i = this.options.horizontal ? "scrollWidth" : "scrollHeight", a = (this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[i] : this.scrollElement[i] : 0) - s;
|
|
362
410
|
return Math.max(Math.min(a, t), 0);
|
|
363
411
|
}, this.getOffsetForIndex = (t, n = "auto") => {
|
|
364
412
|
t = Math.max(0, Math.min(t, this.options.count - 1));
|
|
365
|
-
const
|
|
366
|
-
if (!
|
|
413
|
+
const s = this.getMeasurements()[t];
|
|
414
|
+
if (!s)
|
|
367
415
|
return;
|
|
368
416
|
const r = this.getSize(), i = this.getScrollOffset();
|
|
369
417
|
if (n === "auto")
|
|
370
|
-
if (
|
|
418
|
+
if (s.end >= i + r - this.options.scrollPaddingEnd)
|
|
371
419
|
n = "end";
|
|
372
|
-
else if (
|
|
420
|
+
else if (s.start <= i + this.options.scrollPaddingStart)
|
|
373
421
|
n = "start";
|
|
374
422
|
else
|
|
375
423
|
return [i, n];
|
|
376
|
-
const
|
|
377
|
-
return [this.getOffsetForAlignment(
|
|
424
|
+
const l = n === "end" ? s.end + this.options.scrollPaddingEnd : s.start - this.options.scrollPaddingStart;
|
|
425
|
+
return [this.getOffsetForAlignment(l, n), n];
|
|
378
426
|
}, this.isDynamicMode = () => this.elementsCache.size > 0, this.cancelScrollToIndex = () => {
|
|
379
427
|
this.scrollToIndexTimeoutId !== null && this.targetWindow && (this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId), this.scrollToIndexTimeoutId = null);
|
|
380
|
-
}, this.scrollToOffset = (t, { align: n = "start", behavior:
|
|
381
|
-
this.cancelScrollToIndex(),
|
|
428
|
+
}, this.scrollToOffset = (t, { align: n = "start", behavior: s } = {}) => {
|
|
429
|
+
this.cancelScrollToIndex(), s === "smooth" && this.isDynamicMode() && console.warn(
|
|
382
430
|
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
383
431
|
), this._scrollToOffset(this.getOffsetForAlignment(t, n), {
|
|
384
432
|
adjustments: void 0,
|
|
385
|
-
behavior:
|
|
433
|
+
behavior: s
|
|
386
434
|
});
|
|
387
|
-
}, this.scrollToIndex = (t, { align: n = "auto", behavior:
|
|
388
|
-
t = Math.max(0, Math.min(t, this.options.count - 1)), this.cancelScrollToIndex(),
|
|
435
|
+
}, this.scrollToIndex = (t, { align: n = "auto", behavior: s } = {}) => {
|
|
436
|
+
t = Math.max(0, Math.min(t, this.options.count - 1)), this.cancelScrollToIndex(), s === "smooth" && this.isDynamicMode() && console.warn(
|
|
389
437
|
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
390
438
|
);
|
|
391
439
|
const r = this.getOffsetForIndex(t, n);
|
|
392
440
|
if (!r) return;
|
|
393
|
-
const [i,
|
|
394
|
-
this._scrollToOffset(i, { adjustments: void 0, behavior:
|
|
441
|
+
const [i, l] = r;
|
|
442
|
+
this._scrollToOffset(i, { adjustments: void 0, behavior: s }), s !== "smooth" && this.isDynamicMode() && this.targetWindow && (this.scrollToIndexTimeoutId = this.targetWindow.setTimeout(() => {
|
|
395
443
|
if (this.scrollToIndexTimeoutId = null, this.elementsCache.has(
|
|
396
444
|
this.options.getItemKey(t)
|
|
397
445
|
)) {
|
|
398
|
-
const [u] =
|
|
399
|
-
this.getOffsetForIndex(t,
|
|
446
|
+
const [u] = Ge(
|
|
447
|
+
this.getOffsetForIndex(t, l)
|
|
400
448
|
);
|
|
401
|
-
|
|
449
|
+
Rn(u, this.getScrollOffset()) || this.scrollToIndex(t, { align: l, behavior: s });
|
|
402
450
|
} else
|
|
403
|
-
this.scrollToIndex(t, { align:
|
|
451
|
+
this.scrollToIndex(t, { align: l, behavior: s });
|
|
404
452
|
}));
|
|
405
453
|
}, this.scrollBy = (t, { behavior: n } = {}) => {
|
|
406
454
|
this.cancelScrollToIndex(), n === "smooth" && this.isDynamicMode() && console.warn(
|
|
@@ -412,94 +460,94 @@ class On {
|
|
|
412
460
|
}, this.getTotalSize = () => {
|
|
413
461
|
var t;
|
|
414
462
|
const n = this.getMeasurements();
|
|
415
|
-
let
|
|
416
|
-
return n.length === 0 ?
|
|
463
|
+
let s;
|
|
464
|
+
return n.length === 0 ? s = this.options.paddingStart : s = this.options.lanes === 1 ? ((t = n[n.length - 1]) == null ? void 0 : t.end) ?? 0 : Math.max(
|
|
417
465
|
...n.slice(-this.options.lanes).map((r) => r.end)
|
|
418
|
-
),
|
|
466
|
+
), s - this.options.scrollMargin + this.options.paddingEnd;
|
|
419
467
|
}, this._scrollToOffset = (t, {
|
|
420
468
|
adjustments: n,
|
|
421
|
-
behavior:
|
|
469
|
+
behavior: s
|
|
422
470
|
}) => {
|
|
423
|
-
this.options.scrollToFn(t, { behavior:
|
|
471
|
+
this.options.scrollToFn(t, { behavior: s, adjustments: n }, this);
|
|
424
472
|
}, this.measure = () => {
|
|
425
473
|
var t, n;
|
|
426
474
|
this.itemSizeCache = /* @__PURE__ */ new Map(), (n = (t = this.options).onChange) == null || n.call(t, this, !1);
|
|
427
475
|
}, this.setOptions(o);
|
|
428
476
|
}
|
|
429
477
|
}
|
|
430
|
-
const
|
|
478
|
+
const kt = (e, o, t, n) => {
|
|
431
479
|
for (; e <= o; ) {
|
|
432
|
-
const
|
|
480
|
+
const s = (e + o) / 2 | 0, r = t(s);
|
|
433
481
|
if (r < n)
|
|
434
|
-
e =
|
|
482
|
+
e = s + 1;
|
|
435
483
|
else if (r > n)
|
|
436
|
-
o =
|
|
484
|
+
o = s - 1;
|
|
437
485
|
else
|
|
438
|
-
return
|
|
486
|
+
return s;
|
|
439
487
|
}
|
|
440
488
|
return e > 0 ? e - 1 : 0;
|
|
441
489
|
};
|
|
442
|
-
function
|
|
490
|
+
function zn({
|
|
443
491
|
measurements: e,
|
|
444
492
|
outerSize: o,
|
|
445
493
|
scrollOffset: t
|
|
446
494
|
}) {
|
|
447
|
-
const n = e.length - 1, r =
|
|
495
|
+
const n = e.length - 1, r = kt(0, n, (l) => e[l].start, t);
|
|
448
496
|
let i = r;
|
|
449
497
|
for (; i < n && e[i].end < t + o; )
|
|
450
498
|
i++;
|
|
451
499
|
return { startIndex: r, endIndex: i };
|
|
452
500
|
}
|
|
453
|
-
function
|
|
454
|
-
const o = new
|
|
501
|
+
function Un(e) {
|
|
502
|
+
const o = new Bn(P(e)), t = cn(o), n = o._didMount();
|
|
455
503
|
return j(
|
|
456
|
-
() =>
|
|
457
|
-
(
|
|
458
|
-
|
|
504
|
+
() => P(e).getScrollElement(),
|
|
505
|
+
(s) => {
|
|
506
|
+
s && o._willUpdate();
|
|
459
507
|
},
|
|
460
508
|
{
|
|
461
509
|
immediate: !0
|
|
462
510
|
}
|
|
463
511
|
), j(
|
|
464
|
-
() =>
|
|
465
|
-
(
|
|
512
|
+
() => P(e),
|
|
513
|
+
(s) => {
|
|
466
514
|
o.setOptions({
|
|
467
|
-
...
|
|
515
|
+
...s,
|
|
468
516
|
onChange: (r, i) => {
|
|
469
|
-
var
|
|
470
|
-
|
|
517
|
+
var l;
|
|
518
|
+
it(t), (l = s.onChange) == null || l.call(s, r, i);
|
|
471
519
|
}
|
|
472
|
-
}), o._willUpdate(),
|
|
520
|
+
}), o._willUpdate(), it(t);
|
|
473
521
|
},
|
|
474
522
|
{
|
|
475
523
|
immediate: !0
|
|
476
524
|
}
|
|
477
|
-
),
|
|
478
|
-
}
|
|
479
|
-
function
|
|
480
|
-
return
|
|
481
|
-
|
|
482
|
-
observeElementRect:
|
|
483
|
-
observeElementOffset:
|
|
484
|
-
scrollToFn:
|
|
485
|
-
...
|
|
525
|
+
), Ze(n), t;
|
|
526
|
+
}
|
|
527
|
+
function Hn(e) {
|
|
528
|
+
return Un(
|
|
529
|
+
w(() => ({
|
|
530
|
+
observeElementRect: Vn,
|
|
531
|
+
observeElementOffset: Mn,
|
|
532
|
+
scrollToFn: Fn,
|
|
533
|
+
...P(e)
|
|
486
534
|
}))
|
|
487
535
|
);
|
|
488
536
|
}
|
|
489
|
-
function
|
|
490
|
-
let n =
|
|
491
|
-
return [
|
|
492
|
-
return
|
|
537
|
+
function Wn(e, o, t) {
|
|
538
|
+
let n = E(t == null ? void 0 : t.value), s = w(() => e.value !== void 0);
|
|
539
|
+
return [w(() => s.value ? e.value : n.value), function(r) {
|
|
540
|
+
return s.value || (n.value = r), o == null ? void 0 : o(r);
|
|
493
541
|
}];
|
|
494
542
|
}
|
|
495
|
-
function
|
|
543
|
+
function Gn(e) {
|
|
496
544
|
typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((o) => setTimeout(() => {
|
|
497
545
|
throw o;
|
|
498
546
|
}));
|
|
499
547
|
}
|
|
500
|
-
function
|
|
501
|
-
let e = [], o = { addEventListener(t, n,
|
|
502
|
-
return t.addEventListener(n,
|
|
548
|
+
function Ae() {
|
|
549
|
+
let e = [], o = { addEventListener(t, n, s, r) {
|
|
550
|
+
return t.addEventListener(n, s, r), o.add(() => t.removeEventListener(n, s, r));
|
|
503
551
|
}, requestAnimationFrame(...t) {
|
|
504
552
|
let n = requestAnimationFrame(...t);
|
|
505
553
|
o.add(() => cancelAnimationFrame(n));
|
|
@@ -512,59 +560,59 @@ function Le() {
|
|
|
512
560
|
o.add(() => clearTimeout(n));
|
|
513
561
|
}, microTask(...t) {
|
|
514
562
|
let n = { current: !0 };
|
|
515
|
-
return
|
|
563
|
+
return Gn(() => {
|
|
516
564
|
n.current && t[0]();
|
|
517
565
|
}), o.add(() => {
|
|
518
566
|
n.current = !1;
|
|
519
567
|
});
|
|
520
|
-
}, style(t, n,
|
|
568
|
+
}, style(t, n, s) {
|
|
521
569
|
let r = t.style.getPropertyValue(n);
|
|
522
|
-
return Object.assign(t.style, { [n]:
|
|
570
|
+
return Object.assign(t.style, { [n]: s }), this.add(() => {
|
|
523
571
|
Object.assign(t.style, { [n]: r });
|
|
524
572
|
});
|
|
525
573
|
}, group(t) {
|
|
526
|
-
let n =
|
|
574
|
+
let n = Ae();
|
|
527
575
|
return t(n), this.add(() => n.dispose());
|
|
528
576
|
}, add(t) {
|
|
529
577
|
return e.push(t), () => {
|
|
530
578
|
let n = e.indexOf(t);
|
|
531
|
-
if (n >= 0) for (let
|
|
579
|
+
if (n >= 0) for (let s of e.splice(n, 1)) s();
|
|
532
580
|
};
|
|
533
581
|
}, dispose() {
|
|
534
582
|
for (let t of e.splice(0)) t();
|
|
535
583
|
} };
|
|
536
584
|
return o;
|
|
537
585
|
}
|
|
538
|
-
function
|
|
539
|
-
let e =
|
|
586
|
+
function qn() {
|
|
587
|
+
let e = Ae();
|
|
540
588
|
return St(() => e.dispose()), e;
|
|
541
589
|
}
|
|
542
|
-
function
|
|
543
|
-
let e =
|
|
590
|
+
function Jn() {
|
|
591
|
+
let e = qn();
|
|
544
592
|
return (o) => {
|
|
545
593
|
e.dispose(), e.nextFrame(o);
|
|
546
594
|
};
|
|
547
595
|
}
|
|
548
|
-
let
|
|
549
|
-
function
|
|
550
|
-
return
|
|
596
|
+
let Kn = Symbol("headlessui.useid"), Yn = 0;
|
|
597
|
+
function Pe() {
|
|
598
|
+
return Te(Kn, () => `${++Yn}`)();
|
|
551
599
|
}
|
|
552
|
-
function
|
|
600
|
+
function N(e) {
|
|
553
601
|
var o;
|
|
554
602
|
if (e == null || e.value == null) return null;
|
|
555
603
|
let t = (o = e.value.$el) != null ? o : e.value;
|
|
556
604
|
return t instanceof Node ? t : null;
|
|
557
605
|
}
|
|
558
|
-
function
|
|
606
|
+
function se(e, o, ...t) {
|
|
559
607
|
if (e in o) {
|
|
560
|
-
let
|
|
561
|
-
return typeof
|
|
608
|
+
let s = o[e];
|
|
609
|
+
return typeof s == "function" ? s(...t) : s;
|
|
562
610
|
}
|
|
563
|
-
let n = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(o).map((
|
|
564
|
-
throw Error.captureStackTrace && Error.captureStackTrace(n,
|
|
611
|
+
let n = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(o).map((s) => `"${s}"`).join(", ")}.`);
|
|
612
|
+
throw Error.captureStackTrace && Error.captureStackTrace(n, se), n;
|
|
565
613
|
}
|
|
566
|
-
var
|
|
567
|
-
let
|
|
614
|
+
var Qn = Object.defineProperty, Xn = (e, o, t) => o in e ? Qn(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, ct = (e, o, t) => (Xn(e, typeof o != "symbol" ? o + "" : o, t), t);
|
|
615
|
+
let Zn = class {
|
|
568
616
|
constructor() {
|
|
569
617
|
ct(this, "current", this.detect()), ct(this, "currentId", 0);
|
|
570
618
|
}
|
|
@@ -586,21 +634,21 @@ let Ln = class {
|
|
|
586
634
|
detect() {
|
|
587
635
|
return typeof window > "u" || typeof document > "u" ? "server" : "client";
|
|
588
636
|
}
|
|
589
|
-
},
|
|
590
|
-
function
|
|
591
|
-
if (
|
|
637
|
+
}, nt = new Zn();
|
|
638
|
+
function ot(e) {
|
|
639
|
+
if (nt.isServer) return null;
|
|
592
640
|
if (e instanceof Node) return e.ownerDocument;
|
|
593
641
|
if (e != null && e.hasOwnProperty("value")) {
|
|
594
|
-
let o =
|
|
642
|
+
let o = N(e);
|
|
595
643
|
if (o) return o.ownerDocument;
|
|
596
644
|
}
|
|
597
645
|
return document;
|
|
598
646
|
}
|
|
599
647
|
let dt = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
|
|
600
|
-
var
|
|
601
|
-
function
|
|
648
|
+
var eo = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e))(eo || {}), to = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(to || {}), no = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(no || {}), Rt = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(Rt || {});
|
|
649
|
+
function oo(e, o = 0) {
|
|
602
650
|
var t;
|
|
603
|
-
return e === ((t =
|
|
651
|
+
return e === ((t = ot(e)) == null ? void 0 : t.body) ? !1 : se(o, { 0() {
|
|
604
652
|
return e.matches(dt);
|
|
605
653
|
}, 1() {
|
|
606
654
|
let n = e;
|
|
@@ -611,219 +659,219 @@ function Fn(e, o = 0) {
|
|
|
611
659
|
return !1;
|
|
612
660
|
} });
|
|
613
661
|
}
|
|
614
|
-
var
|
|
662
|
+
var so = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(so || {});
|
|
615
663
|
typeof window < "u" && typeof document < "u" && (document.addEventListener("keydown", (e) => {
|
|
616
664
|
e.metaKey || e.altKey || e.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
617
665
|
}, !0), document.addEventListener("click", (e) => {
|
|
618
666
|
e.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
619
667
|
}, !0));
|
|
620
|
-
function
|
|
668
|
+
function lo(e, o = (t) => t) {
|
|
621
669
|
return e.slice().sort((t, n) => {
|
|
622
|
-
let
|
|
623
|
-
if (
|
|
624
|
-
let i =
|
|
670
|
+
let s = o(t), r = o(n);
|
|
671
|
+
if (s === null || r === null) return 0;
|
|
672
|
+
let i = s.compareDocumentPosition(r);
|
|
625
673
|
return i & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
626
674
|
});
|
|
627
675
|
}
|
|
628
|
-
function
|
|
676
|
+
function ro() {
|
|
629
677
|
return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
|
|
630
678
|
}
|
|
631
|
-
function
|
|
679
|
+
function io() {
|
|
632
680
|
return /Android/gi.test(window.navigator.userAgent);
|
|
633
681
|
}
|
|
634
|
-
function
|
|
635
|
-
return
|
|
682
|
+
function Nt() {
|
|
683
|
+
return ro() || io();
|
|
636
684
|
}
|
|
637
685
|
function Re(e, o, t) {
|
|
638
|
-
|
|
686
|
+
nt.isServer || ie((n) => {
|
|
639
687
|
document.addEventListener(e, o, t), n(() => document.removeEventListener(e, o, t));
|
|
640
688
|
});
|
|
641
689
|
}
|
|
642
|
-
function
|
|
643
|
-
|
|
690
|
+
function ao(e, o, t) {
|
|
691
|
+
nt.isServer || ie((n) => {
|
|
644
692
|
window.addEventListener(e, o, t), n(() => window.removeEventListener(e, o, t));
|
|
645
693
|
});
|
|
646
694
|
}
|
|
647
|
-
function
|
|
695
|
+
function uo(e, o, t = w(() => !0)) {
|
|
648
696
|
function n(r, i) {
|
|
649
697
|
if (!t.value || r.defaultPrevented) return;
|
|
650
|
-
let
|
|
651
|
-
if (
|
|
652
|
-
let a = function u(
|
|
653
|
-
return typeof
|
|
698
|
+
let l = i(r);
|
|
699
|
+
if (l === null || !l.getRootNode().contains(l)) return;
|
|
700
|
+
let a = function u(p) {
|
|
701
|
+
return typeof p == "function" ? u(p()) : Array.isArray(p) || p instanceof Set ? p : [p];
|
|
654
702
|
}(e);
|
|
655
703
|
for (let u of a) {
|
|
656
704
|
if (u === null) continue;
|
|
657
|
-
let
|
|
658
|
-
if (
|
|
705
|
+
let p = u instanceof HTMLElement ? u : N(u);
|
|
706
|
+
if (p != null && p.contains(l) || r.composed && r.composedPath().includes(p)) return;
|
|
659
707
|
}
|
|
660
|
-
return !
|
|
708
|
+
return !oo(l, Rt.Loose) && l.tabIndex !== -1 && r.preventDefault(), o(r, l);
|
|
661
709
|
}
|
|
662
|
-
let
|
|
710
|
+
let s = E(null);
|
|
663
711
|
Re("pointerdown", (r) => {
|
|
664
|
-
var i,
|
|
665
|
-
t.value && (
|
|
712
|
+
var i, l;
|
|
713
|
+
t.value && (s.value = ((l = (i = r.composedPath) == null ? void 0 : i.call(r)) == null ? void 0 : l[0]) || r.target);
|
|
666
714
|
}, !0), Re("mousedown", (r) => {
|
|
667
|
-
var i,
|
|
668
|
-
t.value && (
|
|
715
|
+
var i, l;
|
|
716
|
+
t.value && (s.value = ((l = (i = r.composedPath) == null ? void 0 : i.call(r)) == null ? void 0 : l[0]) || r.target);
|
|
669
717
|
}, !0), Re("click", (r) => {
|
|
670
|
-
|
|
671
|
-
}, !0), Re("touchend", (r) => n(r, () => r.target instanceof HTMLElement ? r.target : null), !0),
|
|
718
|
+
Nt() || s.value && (n(r, () => s.value), s.value = null);
|
|
719
|
+
}, !0), Re("touchend", (r) => n(r, () => r.target instanceof HTMLElement ? r.target : null), !0), ao("blur", (r) => n(r, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
|
|
672
720
|
}
|
|
673
721
|
function ft(e, o) {
|
|
674
722
|
if (e) return e;
|
|
675
723
|
let t = o ?? "button";
|
|
676
724
|
if (typeof t == "string" && t.toLowerCase() === "button") return "button";
|
|
677
725
|
}
|
|
678
|
-
function
|
|
679
|
-
let t =
|
|
680
|
-
return
|
|
726
|
+
function co(e, o) {
|
|
727
|
+
let t = E(ft(e.value.type, e.value.as));
|
|
728
|
+
return pe(() => {
|
|
681
729
|
t.value = ft(e.value.type, e.value.as);
|
|
682
|
-
}),
|
|
730
|
+
}), ie(() => {
|
|
683
731
|
var n;
|
|
684
|
-
t.value ||
|
|
732
|
+
t.value || N(o) && N(o) instanceof HTMLButtonElement && !((n = N(o)) != null && n.hasAttribute("type")) && (t.value = "button");
|
|
685
733
|
}), t;
|
|
686
734
|
}
|
|
687
|
-
function
|
|
735
|
+
function pt(e) {
|
|
688
736
|
return [e.screenX, e.screenY];
|
|
689
737
|
}
|
|
690
|
-
function
|
|
691
|
-
let e =
|
|
738
|
+
function fo() {
|
|
739
|
+
let e = E([-1, -1]);
|
|
692
740
|
return { wasMoved(o) {
|
|
693
|
-
let t =
|
|
741
|
+
let t = pt(o);
|
|
694
742
|
return e.value[0] === t[0] && e.value[1] === t[1] ? !1 : (e.value = t, !0);
|
|
695
743
|
}, update(o) {
|
|
696
|
-
e.value =
|
|
744
|
+
e.value = pt(o);
|
|
697
745
|
} };
|
|
698
746
|
}
|
|
699
|
-
function
|
|
700
|
-
|
|
701
|
-
let
|
|
702
|
-
if (!
|
|
703
|
-
let r =
|
|
747
|
+
function po({ container: e, accept: o, walk: t, enabled: n }) {
|
|
748
|
+
ie(() => {
|
|
749
|
+
let s = e.value;
|
|
750
|
+
if (!s || n !== void 0 && !n.value) return;
|
|
751
|
+
let r = ot(e);
|
|
704
752
|
if (!r) return;
|
|
705
|
-
let i = Object.assign((a) => o(a), { acceptNode: o }),
|
|
706
|
-
for (;
|
|
753
|
+
let i = Object.assign((a) => o(a), { acceptNode: o }), l = r.createTreeWalker(s, NodeFilter.SHOW_ELEMENT, i, !1);
|
|
754
|
+
for (; l.nextNode(); ) t(l.currentNode);
|
|
707
755
|
});
|
|
708
756
|
}
|
|
709
|
-
var
|
|
710
|
-
function
|
|
757
|
+
var $e = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))($e || {}), vo = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(vo || {});
|
|
758
|
+
function ve({ visible: e = !0, features: o = 0, ourProps: t, theirProps: n, ...s }) {
|
|
711
759
|
var r;
|
|
712
|
-
let i =
|
|
713
|
-
if (e || o & 2 && i.static) return
|
|
760
|
+
let i = Lt(n, t), l = Object.assign(s, { props: i });
|
|
761
|
+
if (e || o & 2 && i.static) return qe(l);
|
|
714
762
|
if (o & 1) {
|
|
715
763
|
let a = (r = i.unmount) == null || r ? 0 : 1;
|
|
716
|
-
return
|
|
764
|
+
return se(a, { 0() {
|
|
717
765
|
return null;
|
|
718
766
|
}, 1() {
|
|
719
|
-
return
|
|
767
|
+
return qe({ ...s, props: { ...i, hidden: !0, style: { display: "none" } } });
|
|
720
768
|
} });
|
|
721
769
|
}
|
|
722
|
-
return
|
|
770
|
+
return qe(l);
|
|
723
771
|
}
|
|
724
|
-
function
|
|
772
|
+
function qe({ props: e, attrs: o, slots: t, slot: n, name: s }) {
|
|
725
773
|
var r, i;
|
|
726
|
-
let { as:
|
|
774
|
+
let { as: l, ...a } = Fe(e, ["unmount", "static"]), u = (r = t.default) == null ? void 0 : r.call(t, n), p = {};
|
|
727
775
|
if (n) {
|
|
728
|
-
let c = !1,
|
|
729
|
-
for (let [m,
|
|
730
|
-
c && (
|
|
731
|
-
}
|
|
732
|
-
if (
|
|
733
|
-
if (u =
|
|
734
|
-
let [c, ...
|
|
735
|
-
if (!
|
|
736
|
-
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map((
|
|
776
|
+
let c = !1, h = [];
|
|
777
|
+
for (let [m, v] of Object.entries(n)) typeof v == "boolean" && (c = !0), v === !0 && h.push(m);
|
|
778
|
+
c && (p["data-headlessui-state"] = h.join(" "));
|
|
779
|
+
}
|
|
780
|
+
if (l === "template") {
|
|
781
|
+
if (u = Dt(u ?? []), Object.keys(a).length > 0 || Object.keys(o).length > 0) {
|
|
782
|
+
let [c, ...h] = u ?? [];
|
|
783
|
+
if (!mo(c) || h.length > 0) throw new Error(['Passing props on "template"!', "", `The current component <${s} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(a).concat(Object.keys(o)).map((I) => I.trim()).filter((I, V, T) => T.indexOf(I) === V).sort((I, V) => I.localeCompare(V)).map((I) => ` - ${I}`).join(`
|
|
784
|
+
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map((I) => ` - ${I}`).join(`
|
|
737
785
|
`)].join(`
|
|
738
786
|
`));
|
|
739
|
-
let m =
|
|
740
|
-
for (let
|
|
741
|
-
return
|
|
787
|
+
let m = Lt((i = c.props) != null ? i : {}, a, p), v = Et(c, m, !0);
|
|
788
|
+
for (let I in m) I.startsWith("on") && (v.props || (v.props = {}), v.props[I] = m[I]);
|
|
789
|
+
return v;
|
|
742
790
|
}
|
|
743
791
|
return Array.isArray(u) && u.length === 1 ? u[0] : u;
|
|
744
792
|
}
|
|
745
|
-
return Oe(
|
|
793
|
+
return Oe(l, Object.assign({}, a, p), { default: () => u });
|
|
746
794
|
}
|
|
747
|
-
function
|
|
748
|
-
return e.flatMap((o) => o.type ===
|
|
795
|
+
function Dt(e) {
|
|
796
|
+
return e.flatMap((o) => o.type === G ? Dt(o.children) : [o]);
|
|
749
797
|
}
|
|
750
|
-
function
|
|
798
|
+
function Lt(...e) {
|
|
751
799
|
if (e.length === 0) return {};
|
|
752
800
|
if (e.length === 1) return e[0];
|
|
753
801
|
let o = {}, t = {};
|
|
754
|
-
for (let n of e) for (let
|
|
802
|
+
for (let n of e) for (let s in n) s.startsWith("on") && typeof n[s] == "function" ? (t[s] != null || (t[s] = []), t[s].push(n[s])) : o[s] = n[s];
|
|
755
803
|
if (o.disabled || o["aria-disabled"]) return Object.assign(o, Object.fromEntries(Object.keys(t).map((n) => [n, void 0])));
|
|
756
|
-
for (let n in t) Object.assign(o, { [n](
|
|
804
|
+
for (let n in t) Object.assign(o, { [n](s, ...r) {
|
|
757
805
|
let i = t[n];
|
|
758
|
-
for (let
|
|
759
|
-
if (
|
|
760
|
-
s
|
|
806
|
+
for (let l of i) {
|
|
807
|
+
if (s instanceof Event && s.defaultPrevented) return;
|
|
808
|
+
l(s, ...r);
|
|
761
809
|
}
|
|
762
810
|
} });
|
|
763
811
|
return o;
|
|
764
812
|
}
|
|
765
|
-
function
|
|
813
|
+
function ho(e) {
|
|
766
814
|
let o = Object.assign({}, e);
|
|
767
815
|
for (let t in o) o[t] === void 0 && delete o[t];
|
|
768
816
|
return o;
|
|
769
817
|
}
|
|
770
|
-
function
|
|
818
|
+
function Fe(e, o = []) {
|
|
771
819
|
let t = Object.assign({}, e);
|
|
772
820
|
for (let n of o) n in t && delete t[n];
|
|
773
821
|
return t;
|
|
774
822
|
}
|
|
775
|
-
function
|
|
823
|
+
function mo(e) {
|
|
776
824
|
return e == null ? !1 : typeof e.type == "string" || typeof e.type == "object" || typeof e.type == "function";
|
|
777
825
|
}
|
|
778
|
-
var
|
|
779
|
-
let
|
|
826
|
+
var Vt = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(Vt || {});
|
|
827
|
+
let go = ae({ name: "Hidden", props: { as: { type: [Object, String], default: "div" }, features: { type: Number, default: 1 } }, setup(e, { slots: o, attrs: t }) {
|
|
780
828
|
return () => {
|
|
781
829
|
var n;
|
|
782
|
-
let { features:
|
|
783
|
-
return
|
|
830
|
+
let { features: s, ...r } = e, i = { "aria-hidden": (s & 2) === 2 ? !0 : (n = r["aria-hidden"]) != null ? n : void 0, hidden: (s & 4) === 4 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(s & 4) === 4 && (s & 2) !== 2 && { display: "none" } } };
|
|
831
|
+
return ve({ ourProps: i, theirProps: r, slot: {}, attrs: t, slots: o, name: "Hidden" });
|
|
784
832
|
};
|
|
785
|
-
} }),
|
|
833
|
+
} }), At = Symbol("Context");
|
|
786
834
|
var Ie = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(Ie || {});
|
|
787
|
-
function
|
|
788
|
-
return
|
|
835
|
+
function bo() {
|
|
836
|
+
return Te(At, null);
|
|
789
837
|
}
|
|
790
|
-
function
|
|
791
|
-
|
|
838
|
+
function _o(e) {
|
|
839
|
+
et(At, e);
|
|
792
840
|
}
|
|
793
841
|
var W = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(W || {}), Mt = ((e) => (e[e.Left = 0] = "Left", e[e.Right = 2] = "Right", e))(Mt || {});
|
|
794
|
-
function
|
|
842
|
+
function yo(e) {
|
|
795
843
|
function o() {
|
|
796
844
|
document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", o));
|
|
797
845
|
}
|
|
798
846
|
typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", o), o());
|
|
799
847
|
}
|
|
800
|
-
let
|
|
801
|
-
|
|
848
|
+
let ce = [];
|
|
849
|
+
yo(() => {
|
|
802
850
|
function e(o) {
|
|
803
|
-
o.target instanceof HTMLElement && o.target !== document.body &&
|
|
851
|
+
o.target instanceof HTMLElement && o.target !== document.body && ce[0] !== o.target && (ce.unshift(o.target), ce = ce.filter((t) => t != null && t.isConnected), ce.splice(10));
|
|
804
852
|
}
|
|
805
853
|
window.addEventListener("click", e, { capture: !0 }), window.addEventListener("mousedown", e, { capture: !0 }), window.addEventListener("focus", e, { capture: !0 }), document.body.addEventListener("click", e, { capture: !0 }), document.body.addEventListener("mousedown", e, { capture: !0 }), document.body.addEventListener("focus", e, { capture: !0 });
|
|
806
854
|
});
|
|
807
|
-
function
|
|
855
|
+
function xo(e) {
|
|
808
856
|
throw new Error("Unexpected object: " + e);
|
|
809
857
|
}
|
|
810
|
-
var
|
|
811
|
-
function
|
|
858
|
+
var U = ((e) => (e[e.First = 0] = "First", e[e.Previous = 1] = "Previous", e[e.Next = 2] = "Next", e[e.Last = 3] = "Last", e[e.Specific = 4] = "Specific", e[e.Nothing = 5] = "Nothing", e))(U || {});
|
|
859
|
+
function vt(e, o) {
|
|
812
860
|
let t = o.resolveItems();
|
|
813
861
|
if (t.length <= 0) return null;
|
|
814
|
-
let n = o.resolveActiveIndex(),
|
|
862
|
+
let n = o.resolveActiveIndex(), s = n ?? -1;
|
|
815
863
|
switch (e.focus) {
|
|
816
864
|
case 0: {
|
|
817
865
|
for (let r = 0; r < t.length; ++r) if (!o.resolveDisabled(t[r], r, t)) return r;
|
|
818
866
|
return n;
|
|
819
867
|
}
|
|
820
868
|
case 1: {
|
|
821
|
-
|
|
822
|
-
for (let r =
|
|
869
|
+
s === -1 && (s = t.length);
|
|
870
|
+
for (let r = s - 1; r >= 0; --r) if (!o.resolveDisabled(t[r], r, t)) return r;
|
|
823
871
|
return n;
|
|
824
872
|
}
|
|
825
873
|
case 2: {
|
|
826
|
-
for (let r =
|
|
874
|
+
for (let r = s + 1; r < t.length; ++r) if (!o.resolveDisabled(t[r], r, t)) return r;
|
|
827
875
|
return n;
|
|
828
876
|
}
|
|
829
877
|
case 3: {
|
|
@@ -837,369 +885,369 @@ function pt(e, o) {
|
|
|
837
885
|
case 5:
|
|
838
886
|
return null;
|
|
839
887
|
default:
|
|
840
|
-
|
|
888
|
+
xo(e);
|
|
841
889
|
}
|
|
842
890
|
}
|
|
843
|
-
function
|
|
844
|
-
for (let [n,
|
|
891
|
+
function jt(e = {}, o = null, t = []) {
|
|
892
|
+
for (let [n, s] of Object.entries(e)) Bt(t, Ft(o, n), s);
|
|
845
893
|
return t;
|
|
846
894
|
}
|
|
847
|
-
function
|
|
895
|
+
function Ft(e, o) {
|
|
848
896
|
return e ? e + "[" + o + "]" : o;
|
|
849
897
|
}
|
|
850
|
-
function
|
|
851
|
-
if (Array.isArray(t)) for (let [n,
|
|
852
|
-
else t instanceof Date ? e.push([o, t.toISOString()]) : typeof t == "boolean" ? e.push([o, t ? "1" : "0"]) : typeof t == "string" ? e.push([o, t]) : typeof t == "number" ? e.push([o, `${t}`]) : t == null ? e.push([o, ""]) :
|
|
898
|
+
function Bt(e, o, t) {
|
|
899
|
+
if (Array.isArray(t)) for (let [n, s] of t.entries()) Bt(e, Ft(o, n.toString()), s);
|
|
900
|
+
else t instanceof Date ? e.push([o, t.toISOString()]) : typeof t == "boolean" ? e.push([o, t ? "1" : "0"]) : typeof t == "string" ? e.push([o, t]) : typeof t == "number" ? e.push([o, `${t}`]) : t == null ? e.push([o, ""]) : jt(t, o, e);
|
|
853
901
|
}
|
|
854
|
-
function
|
|
902
|
+
function wo(e, o) {
|
|
855
903
|
return e === o;
|
|
856
904
|
}
|
|
857
|
-
var
|
|
905
|
+
var So = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(So || {}), Eo = ((e) => (e[e.Single = 0] = "Single", e[e.Multi = 1] = "Multi", e))(Eo || {}), Oo = ((e) => (e[e.Pointer = 0] = "Pointer", e[e.Focus = 1] = "Focus", e[e.Other = 2] = "Other", e))(Oo || {});
|
|
858
906
|
let zt = Symbol("ComboboxContext");
|
|
859
|
-
function
|
|
860
|
-
let o =
|
|
907
|
+
function he(e) {
|
|
908
|
+
let o = Te(zt, null);
|
|
861
909
|
if (o === null) {
|
|
862
910
|
let t = new Error(`<${e} /> is missing a parent <Combobox /> component.`);
|
|
863
|
-
throw Error.captureStackTrace && Error.captureStackTrace(t,
|
|
911
|
+
throw Error.captureStackTrace && Error.captureStackTrace(t, he), t;
|
|
864
912
|
}
|
|
865
913
|
return o;
|
|
866
914
|
}
|
|
867
|
-
let
|
|
868
|
-
let t =
|
|
869
|
-
let
|
|
870
|
-
if (!
|
|
871
|
-
let a = window.getComputedStyle(
|
|
915
|
+
let Ut = Symbol("VirtualContext"), $o = ae({ name: "VirtualProvider", setup(e, { slots: o }) {
|
|
916
|
+
let t = he("VirtualProvider"), n = w(() => {
|
|
917
|
+
let l = N(t.optionsRef);
|
|
918
|
+
if (!l) return { start: 0, end: 0 };
|
|
919
|
+
let a = window.getComputedStyle(l);
|
|
872
920
|
return { start: parseFloat(a.paddingBlockStart || a.paddingTop), end: parseFloat(a.paddingBlockEnd || a.paddingBottom) };
|
|
873
|
-
}),
|
|
921
|
+
}), s = Hn(w(() => ({ scrollPaddingStart: n.value.start, scrollPaddingEnd: n.value.end, count: t.virtual.value.options.length, estimateSize() {
|
|
874
922
|
return 40;
|
|
875
923
|
}, getScrollElement() {
|
|
876
|
-
return
|
|
877
|
-
}, overscan: 12 }))), r =
|
|
878
|
-
var
|
|
879
|
-
return (
|
|
880
|
-
}), i =
|
|
924
|
+
return N(t.optionsRef);
|
|
925
|
+
}, overscan: 12 }))), r = w(() => {
|
|
926
|
+
var l;
|
|
927
|
+
return (l = t.virtual.value) == null ? void 0 : l.options;
|
|
928
|
+
}), i = E(0);
|
|
881
929
|
return j([r], () => {
|
|
882
930
|
i.value += 1;
|
|
883
|
-
}),
|
|
884
|
-
if (
|
|
931
|
+
}), et(Ut, t.virtual.value ? s : null), () => [Oe("div", { style: { position: "relative", width: "100%", height: `${s.value.getTotalSize()}px` }, ref: (l) => {
|
|
932
|
+
if (l) {
|
|
885
933
|
if (typeof process < "u" && process.env.JEST_WORKER_ID !== void 0 || t.activationTrigger.value === 0) return;
|
|
886
|
-
t.activeOptionIndex.value !== null && t.virtual.value.options.length > t.activeOptionIndex.value &&
|
|
934
|
+
t.activeOptionIndex.value !== null && t.virtual.value.options.length > t.activeOptionIndex.value && s.value.scrollToIndex(t.activeOptionIndex.value);
|
|
887
935
|
}
|
|
888
|
-
} },
|
|
889
|
-
} }),
|
|
890
|
-
let
|
|
891
|
-
function
|
|
892
|
-
let f = c.value !== null ?
|
|
893
|
-
return
|
|
894
|
-
}
|
|
895
|
-
let
|
|
896
|
-
function
|
|
897
|
-
return
|
|
898
|
-
return
|
|
936
|
+
} }, s.value.getVirtualItems().map((l) => Et(o.default({ option: t.virtual.value.options[l.index], open: t.comboboxState.value === 0 })[0], { key: `${i.value}-${l.index}`, "data-index": l.index, "aria-setsize": t.virtual.value.options.length, "aria-posinset": l.index + 1, style: { position: "absolute", top: 0, left: 0, transform: `translateY(${l.start}px)`, overflowAnchor: "none" } })))];
|
|
937
|
+
} }), Io = ae({ name: "Combobox", emits: { "update:modelValue": (e) => !0 }, props: { as: { type: [Object, String], default: "template" }, disabled: { type: [Boolean], default: !1 }, by: { type: [String, Function], nullable: !0, default: null }, modelValue: { type: [Object, String, Number, Boolean], default: void 0 }, defaultValue: { type: [Object, String, Number, Boolean], default: void 0 }, form: { type: String, optional: !0 }, name: { type: String, optional: !0 }, nullable: { type: Boolean, default: !1 }, multiple: { type: [Boolean], default: !1 }, immediate: { type: [Boolean], default: !1 }, virtual: { type: Object, default: null } }, inheritAttrs: !1, setup(e, { slots: o, attrs: t, emit: n }) {
|
|
938
|
+
let s = E(1), r = E(null), i = E(null), l = E(null), a = E(null), u = E({ static: !1, hold: !1 }), p = E([]), c = E(null), h = E(2), m = E(!1);
|
|
939
|
+
function v(d = (f) => f) {
|
|
940
|
+
let f = c.value !== null ? p.value[c.value] : null, x = d(p.value.slice()), O = x.length > 0 && x[0].dataRef.order.value !== null ? x.sort((A, q) => A.dataRef.order.value - q.dataRef.order.value) : lo(x, (A) => N(A.dataRef.domRef)), D = f ? O.indexOf(f) : null;
|
|
941
|
+
return D === -1 && (D = null), { options: O, activeOptionIndex: D };
|
|
942
|
+
}
|
|
943
|
+
let I = w(() => e.multiple ? 1 : 0), V = w(() => e.nullable), [T, C] = Wn(w(() => e.modelValue), (d) => n("update:modelValue", d), w(() => e.defaultValue)), L = w(() => T.value === void 0 ? se(I.value, { 1: [], 0: void 0 }) : T.value), M = null, y = null;
|
|
944
|
+
function R(d) {
|
|
945
|
+
return se(I.value, { 0() {
|
|
946
|
+
return C == null ? void 0 : C(d);
|
|
899
947
|
}, 1: () => {
|
|
900
|
-
let f =
|
|
901
|
-
return
|
|
948
|
+
let f = Y(b.value.value).slice(), x = Y(d), O = f.findIndex((D) => b.compare(x, Y(D)));
|
|
949
|
+
return O === -1 ? f.push(x) : f.splice(O, 1), C == null ? void 0 : C(f);
|
|
902
950
|
} });
|
|
903
951
|
}
|
|
904
|
-
let
|
|
952
|
+
let _ = w(() => {
|
|
905
953
|
});
|
|
906
|
-
j([
|
|
907
|
-
if (
|
|
908
|
-
let
|
|
909
|
-
|
|
954
|
+
j([_], ([d], [f]) => {
|
|
955
|
+
if (b.virtual.value && d && f && c.value !== null) {
|
|
956
|
+
let x = d.indexOf(f[c.value]);
|
|
957
|
+
x !== -1 ? c.value = x : c.value = null;
|
|
910
958
|
}
|
|
911
959
|
});
|
|
912
|
-
let
|
|
960
|
+
let b = { comboboxState: s, value: L, mode: I, compare(d, f) {
|
|
913
961
|
if (typeof e.by == "string") {
|
|
914
|
-
let
|
|
915
|
-
return (d == null ? void 0 : d[
|
|
962
|
+
let x = e.by;
|
|
963
|
+
return (d == null ? void 0 : d[x]) === (f == null ? void 0 : f[x]);
|
|
916
964
|
}
|
|
917
|
-
return e.by === null ?
|
|
965
|
+
return e.by === null ? wo(d, f) : e.by(d, f);
|
|
918
966
|
}, calculateIndex(d) {
|
|
919
|
-
return
|
|
920
|
-
}, defaultValue:
|
|
921
|
-
|
|
922
|
-
}, activeOptionIndex:
|
|
923
|
-
if (m.value && c.value === null && (
|
|
924
|
-
if (
|
|
925
|
-
let f =
|
|
926
|
-
var
|
|
927
|
-
return !((
|
|
967
|
+
return b.virtual.value ? e.by === null ? b.virtual.value.options.indexOf(d) : b.virtual.value.options.findIndex((f) => b.compare(f, d)) : p.value.findIndex((f) => b.compare(f.dataRef.value, d));
|
|
968
|
+
}, defaultValue: w(() => e.defaultValue), nullable: V, immediate: w(() => !1), virtual: w(() => null), inputRef: i, labelRef: r, buttonRef: l, optionsRef: a, disabled: w(() => e.disabled), options: p, change(d) {
|
|
969
|
+
C(d);
|
|
970
|
+
}, activeOptionIndex: w(() => {
|
|
971
|
+
if (m.value && c.value === null && (b.virtual.value ? b.virtual.value.options.length > 0 : p.value.length > 0)) {
|
|
972
|
+
if (b.virtual.value) {
|
|
973
|
+
let f = b.virtual.value.options.findIndex((x) => {
|
|
974
|
+
var O;
|
|
975
|
+
return !((O = b.virtual.value) != null && O.disabled(x));
|
|
928
976
|
});
|
|
929
977
|
if (f !== -1) return f;
|
|
930
978
|
}
|
|
931
|
-
let d =
|
|
979
|
+
let d = p.value.findIndex((f) => !f.dataRef.disabled);
|
|
932
980
|
if (d !== -1) return d;
|
|
933
981
|
}
|
|
934
982
|
return c.value;
|
|
935
|
-
}), activationTrigger:
|
|
936
|
-
m.value = !1, !e.disabled &&
|
|
983
|
+
}), activationTrigger: h, optionsPropsRef: u, closeCombobox() {
|
|
984
|
+
m.value = !1, !e.disabled && s.value !== 1 && (s.value = 1, c.value = null);
|
|
937
985
|
}, openCombobox() {
|
|
938
|
-
if (m.value = !0, !e.disabled &&
|
|
939
|
-
if (
|
|
940
|
-
let d =
|
|
986
|
+
if (m.value = !0, !e.disabled && s.value !== 0) {
|
|
987
|
+
if (b.value.value) {
|
|
988
|
+
let d = b.calculateIndex(b.value.value);
|
|
941
989
|
d !== -1 && (c.value = d);
|
|
942
990
|
}
|
|
943
|
-
|
|
991
|
+
s.value = 0;
|
|
944
992
|
}
|
|
945
993
|
}, setActivationTrigger(d) {
|
|
946
|
-
|
|
947
|
-
}, goToOption(d, f,
|
|
948
|
-
m.value = !1,
|
|
949
|
-
if (e.disabled || a.value && !u.value.static &&
|
|
950
|
-
if (
|
|
951
|
-
c.value = d ===
|
|
952
|
-
var
|
|
953
|
-
return (
|
|
994
|
+
h.value = d;
|
|
995
|
+
}, goToOption(d, f, x) {
|
|
996
|
+
m.value = !1, M !== null && cancelAnimationFrame(M), M = requestAnimationFrame(() => {
|
|
997
|
+
if (e.disabled || a.value && !u.value.static && s.value === 1) return;
|
|
998
|
+
if (b.virtual.value) {
|
|
999
|
+
c.value = d === U.Specific ? f : vt({ focus: d }, { resolveItems: () => b.virtual.value.options, resolveActiveIndex: () => {
|
|
1000
|
+
var A, q;
|
|
1001
|
+
return (q = (A = b.activeOptionIndex.value) != null ? A : b.virtual.value.options.findIndex((J) => {
|
|
954
1002
|
var F;
|
|
955
|
-
return !((F =
|
|
956
|
-
})) != null ?
|
|
957
|
-
}, resolveDisabled: (
|
|
1003
|
+
return !((F = b.virtual.value) != null && F.disabled(J));
|
|
1004
|
+
})) != null ? q : null;
|
|
1005
|
+
}, resolveDisabled: (A) => b.virtual.value.disabled(A), resolveId() {
|
|
958
1006
|
throw new Error("Function not implemented.");
|
|
959
|
-
} }),
|
|
1007
|
+
} }), h.value = x ?? 2;
|
|
960
1008
|
return;
|
|
961
1009
|
}
|
|
962
|
-
let
|
|
963
|
-
if (
|
|
964
|
-
let
|
|
965
|
-
|
|
1010
|
+
let O = v();
|
|
1011
|
+
if (O.activeOptionIndex === null) {
|
|
1012
|
+
let A = O.options.findIndex((q) => !q.dataRef.disabled);
|
|
1013
|
+
A !== -1 && (O.activeOptionIndex = A);
|
|
966
1014
|
}
|
|
967
|
-
let
|
|
968
|
-
c.value =
|
|
1015
|
+
let D = d === U.Specific ? f : vt({ focus: d }, { resolveItems: () => O.options, resolveActiveIndex: () => O.activeOptionIndex, resolveId: (A) => A.id, resolveDisabled: (A) => A.dataRef.disabled });
|
|
1016
|
+
c.value = D, h.value = x ?? 2, p.value = O.options;
|
|
969
1017
|
});
|
|
970
1018
|
}, selectOption(d) {
|
|
971
|
-
let f =
|
|
1019
|
+
let f = p.value.find((O) => O.id === d);
|
|
972
1020
|
if (!f) return;
|
|
973
|
-
let { dataRef:
|
|
974
|
-
|
|
1021
|
+
let { dataRef: x } = f;
|
|
1022
|
+
R(x.value);
|
|
975
1023
|
}, selectActiveOption() {
|
|
976
|
-
if (
|
|
977
|
-
if (
|
|
1024
|
+
if (b.activeOptionIndex.value !== null) {
|
|
1025
|
+
if (b.virtual.value) R(b.virtual.value.options[b.activeOptionIndex.value]);
|
|
978
1026
|
else {
|
|
979
|
-
let { dataRef: d } =
|
|
980
|
-
|
|
1027
|
+
let { dataRef: d } = p.value[b.activeOptionIndex.value];
|
|
1028
|
+
R(d.value);
|
|
981
1029
|
}
|
|
982
|
-
|
|
1030
|
+
b.goToOption(U.Specific, b.activeOptionIndex.value);
|
|
983
1031
|
}
|
|
984
1032
|
}, registerOption(d, f) {
|
|
985
|
-
let
|
|
986
|
-
if (
|
|
987
|
-
|
|
1033
|
+
let x = Ot({ id: d, dataRef: f });
|
|
1034
|
+
if (b.virtual.value) {
|
|
1035
|
+
p.value.push(x);
|
|
988
1036
|
return;
|
|
989
1037
|
}
|
|
990
|
-
|
|
991
|
-
let
|
|
992
|
-
c.value === null &&
|
|
993
|
-
let
|
|
994
|
-
|
|
1038
|
+
y && cancelAnimationFrame(y);
|
|
1039
|
+
let O = v((D) => (D.push(x), D));
|
|
1040
|
+
c.value === null && b.isSelected(f.value.value) && (O.activeOptionIndex = O.options.indexOf(x)), p.value = O.options, c.value = O.activeOptionIndex, h.value = 2, O.options.some((D) => !N(D.dataRef.domRef)) && (y = requestAnimationFrame(() => {
|
|
1041
|
+
let D = v();
|
|
1042
|
+
p.value = D.options, c.value = D.activeOptionIndex;
|
|
995
1043
|
}));
|
|
996
1044
|
}, unregisterOption(d, f) {
|
|
997
|
-
if (
|
|
998
|
-
|
|
1045
|
+
if (M !== null && cancelAnimationFrame(M), f && (m.value = !0), b.virtual.value) {
|
|
1046
|
+
p.value = p.value.filter((O) => O.id !== d);
|
|
999
1047
|
return;
|
|
1000
1048
|
}
|
|
1001
|
-
let
|
|
1002
|
-
let
|
|
1003
|
-
return
|
|
1049
|
+
let x = v((O) => {
|
|
1050
|
+
let D = O.findIndex((A) => A.id === d);
|
|
1051
|
+
return D !== -1 && O.splice(D, 1), O;
|
|
1004
1052
|
});
|
|
1005
|
-
|
|
1053
|
+
p.value = x.options, c.value = x.activeOptionIndex, h.value = 2;
|
|
1006
1054
|
}, isSelected(d) {
|
|
1007
|
-
return
|
|
1055
|
+
return se(I.value, { 0: () => b.compare(Y(b.value.value), Y(d)), 1: () => Y(b.value.value).some((f) => b.compare(Y(f), Y(d))) });
|
|
1008
1056
|
}, isActive(d) {
|
|
1009
|
-
return c.value ===
|
|
1057
|
+
return c.value === b.calculateIndex(d);
|
|
1010
1058
|
} };
|
|
1011
|
-
|
|
1012
|
-
let
|
|
1059
|
+
uo([i, l, a], () => b.closeCombobox(), w(() => s.value === 0)), et(zt, b), _o(w(() => se(s.value, { 0: Ie.Open, 1: Ie.Closed })));
|
|
1060
|
+
let k = w(() => {
|
|
1013
1061
|
var d;
|
|
1014
|
-
return (d =
|
|
1062
|
+
return (d = N(i)) == null ? void 0 : d.closest("form");
|
|
1015
1063
|
});
|
|
1016
|
-
return
|
|
1017
|
-
j([
|
|
1018
|
-
if (!
|
|
1064
|
+
return pe(() => {
|
|
1065
|
+
j([k], () => {
|
|
1066
|
+
if (!k.value || e.defaultValue === void 0) return;
|
|
1019
1067
|
function d() {
|
|
1020
|
-
|
|
1068
|
+
b.change(e.defaultValue);
|
|
1021
1069
|
}
|
|
1022
|
-
return
|
|
1070
|
+
return k.value.addEventListener("reset", d), () => {
|
|
1023
1071
|
var f;
|
|
1024
|
-
(f =
|
|
1072
|
+
(f = k.value) == null || f.removeEventListener("reset", d);
|
|
1025
1073
|
};
|
|
1026
1074
|
}, { immediate: !0 });
|
|
1027
1075
|
}), () => {
|
|
1028
|
-
var d, f,
|
|
1029
|
-
let { name:
|
|
1030
|
-
return Oe(
|
|
1076
|
+
var d, f, x;
|
|
1077
|
+
let { name: O, disabled: D, form: A, ...q } = e, J = { open: s.value === 0, disabled: D, activeIndex: b.activeOptionIndex.value, activeOption: b.activeOptionIndex.value === null ? null : b.virtual.value ? b.virtual.value.options[(d = b.activeOptionIndex.value) != null ? d : 0] : (x = (f = b.options.value[b.activeOptionIndex.value]) == null ? void 0 : f.dataRef.value) != null ? x : null, value: L.value };
|
|
1078
|
+
return Oe(G, [...O != null && L.value != null ? jt({ [O]: L.value }).map(([F, un]) => Oe(go, ho({ features: Vt.Hidden, key: F, as: "input", type: "hidden", hidden: !0, readOnly: !0, form: A, disabled: D, name: F, value: un }))) : [], ve({ theirProps: { ...t, ...Fe(q, ["by", "defaultValue", "immediate", "modelValue", "multiple", "nullable", "onUpdate:modelValue", "virtual"]) }, ourProps: {}, slot: J, slots: o, attrs: t, name: "Combobox" })]);
|
|
1031
1079
|
};
|
|
1032
1080
|
} });
|
|
1033
|
-
|
|
1081
|
+
ae({ name: "ComboboxLabel", props: { as: { type: [Object, String], default: "label" }, id: { type: String, default: null } }, setup(e, { attrs: o, slots: t }) {
|
|
1034
1082
|
var n;
|
|
1035
|
-
let
|
|
1083
|
+
let s = (n = e.id) != null ? n : `headlessui-combobox-label-${Pe()}`, r = he("ComboboxLabel");
|
|
1036
1084
|
function i() {
|
|
1037
|
-
var
|
|
1038
|
-
(
|
|
1085
|
+
var l;
|
|
1086
|
+
(l = N(r.inputRef)) == null || l.focus({ preventScroll: !0 });
|
|
1039
1087
|
}
|
|
1040
1088
|
return () => {
|
|
1041
|
-
let
|
|
1042
|
-
return
|
|
1089
|
+
let l = { open: r.comboboxState.value === 0, disabled: r.disabled.value }, { ...a } = e, u = { id: s, ref: r.labelRef, onClick: i };
|
|
1090
|
+
return ve({ ourProps: u, theirProps: a, slot: l, attrs: o, slots: t, name: "ComboboxLabel" });
|
|
1043
1091
|
};
|
|
1044
1092
|
} });
|
|
1045
|
-
let
|
|
1046
|
-
var
|
|
1047
|
-
let r = (
|
|
1093
|
+
let Co = ae({ name: "ComboboxButton", props: { as: { type: [Object, String], default: "button" }, id: { type: String, default: null } }, setup(e, { attrs: o, slots: t, expose: n }) {
|
|
1094
|
+
var s;
|
|
1095
|
+
let r = (s = e.id) != null ? s : `headlessui-combobox-button-${Pe()}`, i = he("ComboboxButton");
|
|
1048
1096
|
n({ el: i.buttonRef, $el: i.buttonRef });
|
|
1049
|
-
function
|
|
1050
|
-
i.disabled.value || (i.comboboxState.value === 0 ? i.closeCombobox() : (
|
|
1097
|
+
function l(p) {
|
|
1098
|
+
i.disabled.value || (i.comboboxState.value === 0 ? i.closeCombobox() : (p.preventDefault(), i.openCombobox()), te(() => {
|
|
1051
1099
|
var c;
|
|
1052
|
-
return (c =
|
|
1100
|
+
return (c = N(i.inputRef)) == null ? void 0 : c.focus({ preventScroll: !0 });
|
|
1053
1101
|
}));
|
|
1054
1102
|
}
|
|
1055
|
-
function a(
|
|
1056
|
-
switch (
|
|
1103
|
+
function a(p) {
|
|
1104
|
+
switch (p.key) {
|
|
1057
1105
|
case W.ArrowDown:
|
|
1058
|
-
|
|
1106
|
+
p.preventDefault(), p.stopPropagation(), i.comboboxState.value === 1 && i.openCombobox(), te(() => {
|
|
1059
1107
|
var c;
|
|
1060
1108
|
return (c = i.inputRef.value) == null ? void 0 : c.focus({ preventScroll: !0 });
|
|
1061
1109
|
});
|
|
1062
1110
|
return;
|
|
1063
1111
|
case W.ArrowUp:
|
|
1064
|
-
|
|
1065
|
-
i.value.value || i.goToOption(
|
|
1066
|
-
})),
|
|
1112
|
+
p.preventDefault(), p.stopPropagation(), i.comboboxState.value === 1 && (i.openCombobox(), te(() => {
|
|
1113
|
+
i.value.value || i.goToOption(U.Last);
|
|
1114
|
+
})), te(() => {
|
|
1067
1115
|
var c;
|
|
1068
1116
|
return (c = i.inputRef.value) == null ? void 0 : c.focus({ preventScroll: !0 });
|
|
1069
1117
|
});
|
|
1070
1118
|
return;
|
|
1071
1119
|
case W.Escape:
|
|
1072
1120
|
if (i.comboboxState.value !== 0) return;
|
|
1073
|
-
|
|
1121
|
+
p.preventDefault(), i.optionsRef.value && !i.optionsPropsRef.value.static && p.stopPropagation(), i.closeCombobox(), te(() => {
|
|
1074
1122
|
var c;
|
|
1075
1123
|
return (c = i.inputRef.value) == null ? void 0 : c.focus({ preventScroll: !0 });
|
|
1076
1124
|
});
|
|
1077
1125
|
return;
|
|
1078
1126
|
}
|
|
1079
1127
|
}
|
|
1080
|
-
let u =
|
|
1128
|
+
let u = co(w(() => ({ as: e.as, type: o.type })), i.buttonRef);
|
|
1081
1129
|
return () => {
|
|
1082
|
-
var
|
|
1083
|
-
let
|
|
1084
|
-
return
|
|
1130
|
+
var p, c;
|
|
1131
|
+
let h = { open: i.comboboxState.value === 0, disabled: i.disabled.value, value: i.value.value }, { ...m } = e, v = { ref: i.buttonRef, id: r, type: u.value, tabindex: "-1", "aria-haspopup": "listbox", "aria-controls": (p = N(i.optionsRef)) == null ? void 0 : p.id, "aria-expanded": i.comboboxState.value === 0, "aria-labelledby": i.labelRef.value ? [(c = N(i.labelRef)) == null ? void 0 : c.id, r].join(" ") : void 0, disabled: i.disabled.value === !0 ? !0 : void 0, onKeydown: a, onClick: l };
|
|
1132
|
+
return ve({ ourProps: v, theirProps: m, slot: h, attrs: o, slots: t, name: "ComboboxButton" });
|
|
1085
1133
|
};
|
|
1086
|
-
} }),
|
|
1134
|
+
} }), To = ae({ name: "ComboboxInput", props: { as: { type: [Object, String], default: "input" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, displayValue: { type: Function }, defaultValue: { type: String, default: void 0 }, id: { type: String, default: null } }, emits: { change: (e) => !0 }, setup(e, { emit: o, attrs: t, slots: n, expose: s }) {
|
|
1087
1135
|
var r;
|
|
1088
|
-
let i = (r = e.id) != null ? r : `headlessui-combobox-input-${
|
|
1089
|
-
|
|
1090
|
-
function
|
|
1091
|
-
|
|
1092
|
-
let
|
|
1093
|
-
|
|
1094
|
-
}
|
|
1095
|
-
let c =
|
|
1096
|
-
var
|
|
1097
|
-
let
|
|
1098
|
-
return
|
|
1136
|
+
let i = (r = e.id) != null ? r : `headlessui-combobox-input-${Pe()}`, l = he("ComboboxInput"), a = w(() => ot(N(l.inputRef))), u = { value: !1 };
|
|
1137
|
+
s({ el: l.inputRef, $el: l.inputRef });
|
|
1138
|
+
function p() {
|
|
1139
|
+
l.change(null);
|
|
1140
|
+
let y = N(l.optionsRef);
|
|
1141
|
+
y && (y.scrollTop = 0), l.goToOption(U.Nothing);
|
|
1142
|
+
}
|
|
1143
|
+
let c = w(() => {
|
|
1144
|
+
var y;
|
|
1145
|
+
let R = l.value.value;
|
|
1146
|
+
return N(l.inputRef) ? typeof e.displayValue < "u" && R !== void 0 ? (y = e.displayValue(R)) != null ? y : "" : typeof R == "string" ? R : "" : "";
|
|
1099
1147
|
});
|
|
1100
|
-
|
|
1101
|
-
j([c,
|
|
1148
|
+
pe(() => {
|
|
1149
|
+
j([c, l.comboboxState, a], ([y, R], [_, b]) => {
|
|
1102
1150
|
if (u.value) return;
|
|
1103
|
-
let
|
|
1104
|
-
|
|
1151
|
+
let k = N(l.inputRef);
|
|
1152
|
+
k && ((b === 0 && R === 1 || y !== _) && (k.value = y), requestAnimationFrame(() => {
|
|
1105
1153
|
var d;
|
|
1106
|
-
if (u.value || !
|
|
1107
|
-
let { selectionStart: f, selectionEnd:
|
|
1108
|
-
Math.abs((
|
|
1154
|
+
if (u.value || !k || ((d = a.value) == null ? void 0 : d.activeElement) !== k) return;
|
|
1155
|
+
let { selectionStart: f, selectionEnd: x } = k;
|
|
1156
|
+
Math.abs((x ?? 0) - (f ?? 0)) === 0 && f === 0 && k.setSelectionRange(k.value.length, k.value.length);
|
|
1109
1157
|
}));
|
|
1110
|
-
}, { immediate: !0 }), j([
|
|
1111
|
-
if (
|
|
1158
|
+
}, { immediate: !0 }), j([l.comboboxState], ([y], [R]) => {
|
|
1159
|
+
if (y === 0 && R === 1) {
|
|
1112
1160
|
if (u.value) return;
|
|
1113
|
-
let
|
|
1114
|
-
if (!
|
|
1115
|
-
let
|
|
1116
|
-
|
|
1161
|
+
let _ = N(l.inputRef);
|
|
1162
|
+
if (!_) return;
|
|
1163
|
+
let b = _.value, { selectionStart: k, selectionEnd: d, selectionDirection: f } = _;
|
|
1164
|
+
_.value = "", _.value = b, f !== null ? _.setSelectionRange(k, d, f) : _.setSelectionRange(k, d);
|
|
1117
1165
|
}
|
|
1118
1166
|
});
|
|
1119
1167
|
});
|
|
1120
|
-
let
|
|
1168
|
+
let h = E(!1);
|
|
1121
1169
|
function m() {
|
|
1122
|
-
|
|
1170
|
+
h.value = !0;
|
|
1123
1171
|
}
|
|
1124
|
-
function
|
|
1125
|
-
|
|
1126
|
-
|
|
1172
|
+
function v() {
|
|
1173
|
+
Ae().nextFrame(() => {
|
|
1174
|
+
h.value = !1;
|
|
1127
1175
|
});
|
|
1128
1176
|
}
|
|
1129
|
-
let
|
|
1130
|
-
function
|
|
1131
|
-
switch (u.value = !0,
|
|
1177
|
+
let I = Jn();
|
|
1178
|
+
function V(y) {
|
|
1179
|
+
switch (u.value = !0, I(() => {
|
|
1132
1180
|
u.value = !1;
|
|
1133
|
-
}),
|
|
1181
|
+
}), y.key) {
|
|
1134
1182
|
case W.Enter:
|
|
1135
|
-
if (u.value = !1,
|
|
1136
|
-
if (
|
|
1137
|
-
|
|
1183
|
+
if (u.value = !1, l.comboboxState.value !== 0 || h.value) return;
|
|
1184
|
+
if (y.preventDefault(), y.stopPropagation(), l.activeOptionIndex.value === null) {
|
|
1185
|
+
l.closeCombobox();
|
|
1138
1186
|
return;
|
|
1139
1187
|
}
|
|
1140
|
-
|
|
1188
|
+
l.selectActiveOption(), l.mode.value === 0 && l.closeCombobox();
|
|
1141
1189
|
break;
|
|
1142
1190
|
case W.ArrowDown:
|
|
1143
|
-
return u.value = !1,
|
|
1191
|
+
return u.value = !1, y.preventDefault(), y.stopPropagation(), se(l.comboboxState.value, { 0: () => l.goToOption(U.Next), 1: () => l.openCombobox() });
|
|
1144
1192
|
case W.ArrowUp:
|
|
1145
|
-
return u.value = !1,
|
|
1146
|
-
|
|
1147
|
-
|
|
1193
|
+
return u.value = !1, y.preventDefault(), y.stopPropagation(), se(l.comboboxState.value, { 0: () => l.goToOption(U.Previous), 1: () => {
|
|
1194
|
+
l.openCombobox(), te(() => {
|
|
1195
|
+
l.value.value || l.goToOption(U.Last);
|
|
1148
1196
|
});
|
|
1149
1197
|
} });
|
|
1150
1198
|
case W.Home:
|
|
1151
|
-
if (
|
|
1152
|
-
return u.value = !1,
|
|
1199
|
+
if (y.shiftKey) break;
|
|
1200
|
+
return u.value = !1, y.preventDefault(), y.stopPropagation(), l.goToOption(U.First);
|
|
1153
1201
|
case W.PageUp:
|
|
1154
|
-
return u.value = !1,
|
|
1202
|
+
return u.value = !1, y.preventDefault(), y.stopPropagation(), l.goToOption(U.First);
|
|
1155
1203
|
case W.End:
|
|
1156
|
-
if (
|
|
1157
|
-
return u.value = !1,
|
|
1204
|
+
if (y.shiftKey) break;
|
|
1205
|
+
return u.value = !1, y.preventDefault(), y.stopPropagation(), l.goToOption(U.Last);
|
|
1158
1206
|
case W.PageDown:
|
|
1159
|
-
return u.value = !1,
|
|
1207
|
+
return u.value = !1, y.preventDefault(), y.stopPropagation(), l.goToOption(U.Last);
|
|
1160
1208
|
case W.Escape:
|
|
1161
|
-
if (u.value = !1,
|
|
1162
|
-
|
|
1209
|
+
if (u.value = !1, l.comboboxState.value !== 0) return;
|
|
1210
|
+
y.preventDefault(), l.optionsRef.value && !l.optionsPropsRef.value.static && y.stopPropagation(), l.nullable.value && l.mode.value === 0 && l.value.value === null && p(), l.closeCombobox();
|
|
1163
1211
|
break;
|
|
1164
1212
|
case W.Tab:
|
|
1165
|
-
if (u.value = !1,
|
|
1166
|
-
|
|
1213
|
+
if (u.value = !1, l.comboboxState.value !== 0) return;
|
|
1214
|
+
l.mode.value === 0 && l.activationTrigger.value !== 1 && l.selectActiveOption(), l.closeCombobox();
|
|
1167
1215
|
break;
|
|
1168
1216
|
}
|
|
1169
1217
|
}
|
|
1170
|
-
function
|
|
1171
|
-
o("change",
|
|
1218
|
+
function T(y) {
|
|
1219
|
+
o("change", y), l.nullable.value && l.mode.value === 0 && y.target.value === "" && p(), l.openCombobox();
|
|
1172
1220
|
}
|
|
1173
|
-
function
|
|
1174
|
-
var
|
|
1175
|
-
let
|
|
1176
|
-
if (u.value = !1, !((
|
|
1221
|
+
function C(y) {
|
|
1222
|
+
var R, _, b;
|
|
1223
|
+
let k = (R = y.relatedTarget) != null ? R : ce.find((d) => d !== y.currentTarget);
|
|
1224
|
+
if (u.value = !1, !((_ = N(l.optionsRef)) != null && _.contains(k)) && !((b = N(l.buttonRef)) != null && b.contains(k)) && l.comboboxState.value === 0) return y.preventDefault(), l.mode.value === 0 && (l.nullable.value && l.value.value === null ? p() : l.activationTrigger.value !== 1 && l.selectActiveOption()), l.closeCombobox();
|
|
1177
1225
|
}
|
|
1178
|
-
function
|
|
1179
|
-
var
|
|
1180
|
-
let
|
|
1181
|
-
(
|
|
1182
|
-
|
|
1226
|
+
function L(y) {
|
|
1227
|
+
var R, _, b;
|
|
1228
|
+
let k = (R = y.relatedTarget) != null ? R : ce.find((d) => d !== y.currentTarget);
|
|
1229
|
+
(_ = N(l.buttonRef)) != null && _.contains(k) || (b = N(l.optionsRef)) != null && b.contains(k) || l.disabled.value || l.immediate.value && l.comboboxState.value !== 0 && (l.openCombobox(), Ae().nextFrame(() => {
|
|
1230
|
+
l.setActivationTrigger(1);
|
|
1183
1231
|
}));
|
|
1184
1232
|
}
|
|
1185
|
-
let
|
|
1186
|
-
var
|
|
1187
|
-
return (
|
|
1233
|
+
let M = w(() => {
|
|
1234
|
+
var y, R, _, b;
|
|
1235
|
+
return (b = (_ = (R = e.defaultValue) != null ? R : l.defaultValue.value !== void 0 ? (y = e.displayValue) == null ? void 0 : y.call(e, l.defaultValue.value) : null) != null ? _ : l.defaultValue.value) != null ? b : "";
|
|
1188
1236
|
});
|
|
1189
1237
|
return () => {
|
|
1190
|
-
var
|
|
1191
|
-
let
|
|
1192
|
-
return
|
|
1238
|
+
var y, R, _, b, k, d, f;
|
|
1239
|
+
let x = { open: l.comboboxState.value === 0 }, { displayValue: O, onChange: D, ...A } = e, q = { "aria-controls": (y = l.optionsRef.value) == null ? void 0 : y.id, "aria-expanded": l.comboboxState.value === 0, "aria-activedescendant": l.activeOptionIndex.value === null ? void 0 : l.virtual.value ? (R = l.options.value.find((J) => !l.virtual.value.disabled(J.dataRef.value) && l.compare(J.dataRef.value, l.virtual.value.options[l.activeOptionIndex.value]))) == null ? void 0 : R.id : (_ = l.options.value[l.activeOptionIndex.value]) == null ? void 0 : _.id, "aria-labelledby": (d = (b = N(l.labelRef)) == null ? void 0 : b.id) != null ? d : (k = N(l.buttonRef)) == null ? void 0 : k.id, "aria-autocomplete": "list", id: i, onCompositionstart: m, onCompositionend: v, onKeydown: V, onInput: T, onFocus: L, onBlur: C, role: "combobox", type: (f = t.type) != null ? f : "text", tabIndex: 0, ref: l.inputRef, defaultValue: M.value, disabled: l.disabled.value === !0 ? !0 : void 0 };
|
|
1240
|
+
return ve({ ourProps: q, theirProps: A, slot: x, attrs: t, slots: n, features: $e.RenderStrategy | $e.Static, name: "ComboboxInput" });
|
|
1193
1241
|
};
|
|
1194
|
-
} }),
|
|
1195
|
-
let
|
|
1196
|
-
n({ el:
|
|
1197
|
-
|
|
1198
|
-
}),
|
|
1199
|
-
|
|
1242
|
+
} }), Po = ae({ name: "ComboboxOptions", props: { as: { type: [Object, String], default: "ul" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, hold: { type: [Boolean], default: !1 } }, setup(e, { attrs: o, slots: t, expose: n }) {
|
|
1243
|
+
let s = he("ComboboxOptions"), r = `headlessui-combobox-options-${Pe()}`;
|
|
1244
|
+
n({ el: s.optionsRef, $el: s.optionsRef }), ie(() => {
|
|
1245
|
+
s.optionsPropsRef.value.static = e.static;
|
|
1246
|
+
}), ie(() => {
|
|
1247
|
+
s.optionsPropsRef.value.hold = e.hold;
|
|
1200
1248
|
});
|
|
1201
|
-
let i =
|
|
1202
|
-
|
|
1249
|
+
let i = bo(), l = w(() => i !== null ? (i.value & Ie.Open) === Ie.Open : s.comboboxState.value === 0);
|
|
1250
|
+
po({ container: w(() => N(s.optionsRef)), enabled: w(() => s.comboboxState.value === 0), accept(u) {
|
|
1203
1251
|
return u.getAttribute("role") === "option" ? NodeFilter.FILTER_REJECT : u.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
|
|
1204
1252
|
}, walk(u) {
|
|
1205
1253
|
u.setAttribute("role", "none");
|
|
@@ -1208,75 +1256,105 @@ let co = se({ name: "ComboboxButton", props: { as: { type: [Object, String], def
|
|
|
1208
1256
|
u.preventDefault();
|
|
1209
1257
|
}
|
|
1210
1258
|
return () => {
|
|
1211
|
-
var u,
|
|
1212
|
-
let
|
|
1213
|
-
return
|
|
1259
|
+
var u, p, c;
|
|
1260
|
+
let h = { open: s.comboboxState.value === 0 }, m = { "aria-labelledby": (c = (u = N(s.labelRef)) == null ? void 0 : u.id) != null ? c : (p = N(s.buttonRef)) == null ? void 0 : p.id, id: r, ref: s.optionsRef, role: "listbox", "aria-multiselectable": s.mode.value === 1 ? !0 : void 0, onMousedown: a }, v = Fe(e, ["hold"]);
|
|
1261
|
+
return ve({ ourProps: m, theirProps: v, slot: h, attrs: o, slots: s.virtual.value && s.comboboxState.value === 0 ? { ...t, default: () => [Oe($o, {}, t.default)] } : t, features: $e.RenderStrategy | $e.Static, visible: l.value, name: "ComboboxOptions" });
|
|
1214
1262
|
};
|
|
1215
|
-
} }),
|
|
1216
|
-
let
|
|
1263
|
+
} }), ko = ae({ name: "ComboboxOption", props: { as: { type: [Object, String], default: "li" }, value: { type: [Object, String, Number, Boolean] }, disabled: { type: Boolean, default: !1 }, order: { type: [Number], default: null } }, setup(e, { slots: o, attrs: t, expose: n }) {
|
|
1264
|
+
let s = he("ComboboxOption"), r = `headlessui-combobox-option-${Pe()}`, i = E(null), l = w(() => e.disabled);
|
|
1217
1265
|
n({ el: i, $el: i });
|
|
1218
|
-
let a =
|
|
1219
|
-
var
|
|
1220
|
-
return
|
|
1221
|
-
}), u =
|
|
1222
|
-
|
|
1223
|
-
let
|
|
1224
|
-
|
|
1225
|
-
}),
|
|
1226
|
-
|
|
1227
|
-
var
|
|
1228
|
-
return (
|
|
1266
|
+
let a = w(() => {
|
|
1267
|
+
var C;
|
|
1268
|
+
return s.virtual.value ? s.activeOptionIndex.value === s.calculateIndex(e.value) : s.activeOptionIndex.value === null ? !1 : ((C = s.options.value[s.activeOptionIndex.value]) == null ? void 0 : C.id) === r;
|
|
1269
|
+
}), u = w(() => s.isSelected(e.value)), p = Te(Ut, null), c = w(() => ({ disabled: e.disabled, value: e.value, domRef: i, order: w(() => e.order) }));
|
|
1270
|
+
pe(() => s.registerOption(r, c)), St(() => s.unregisterOption(r, a.value)), ie(() => {
|
|
1271
|
+
let C = N(i);
|
|
1272
|
+
C && (p == null || p.value.measureElement(C));
|
|
1273
|
+
}), ie(() => {
|
|
1274
|
+
s.comboboxState.value === 0 && a.value && (s.virtual.value || s.activationTrigger.value !== 0 && te(() => {
|
|
1275
|
+
var C, L;
|
|
1276
|
+
return (L = (C = N(i)) == null ? void 0 : C.scrollIntoView) == null ? void 0 : L.call(C, { block: "nearest" });
|
|
1229
1277
|
}));
|
|
1230
1278
|
});
|
|
1231
|
-
function
|
|
1232
|
-
|
|
1233
|
-
var
|
|
1234
|
-
return (
|
|
1235
|
-
}),
|
|
1279
|
+
function h(C) {
|
|
1280
|
+
C.preventDefault(), C.button === Mt.Left && (l.value || (s.selectOption(r), Nt() || requestAnimationFrame(() => {
|
|
1281
|
+
var L;
|
|
1282
|
+
return (L = N(s.inputRef)) == null ? void 0 : L.focus({ preventScroll: !0 });
|
|
1283
|
+
}), s.mode.value === 0 && s.closeCombobox()));
|
|
1236
1284
|
}
|
|
1237
1285
|
function m() {
|
|
1238
|
-
var
|
|
1239
|
-
if (e.disabled || (
|
|
1240
|
-
let
|
|
1241
|
-
|
|
1286
|
+
var C;
|
|
1287
|
+
if (e.disabled || (C = s.virtual.value) != null && C.disabled(e.value)) return s.goToOption(U.Nothing);
|
|
1288
|
+
let L = s.calculateIndex(e.value);
|
|
1289
|
+
s.goToOption(U.Specific, L);
|
|
1242
1290
|
}
|
|
1243
|
-
let
|
|
1244
|
-
function
|
|
1245
|
-
|
|
1291
|
+
let v = fo();
|
|
1292
|
+
function I(C) {
|
|
1293
|
+
v.update(C);
|
|
1246
1294
|
}
|
|
1247
|
-
function
|
|
1248
|
-
var
|
|
1249
|
-
if (!
|
|
1250
|
-
let
|
|
1251
|
-
|
|
1295
|
+
function V(C) {
|
|
1296
|
+
var L;
|
|
1297
|
+
if (!v.wasMoved(C) || e.disabled || (L = s.virtual.value) != null && L.disabled(e.value) || a.value) return;
|
|
1298
|
+
let M = s.calculateIndex(e.value);
|
|
1299
|
+
s.goToOption(U.Specific, M, 0);
|
|
1252
1300
|
}
|
|
1253
|
-
function
|
|
1254
|
-
var
|
|
1255
|
-
|
|
1301
|
+
function T(C) {
|
|
1302
|
+
var L;
|
|
1303
|
+
v.wasMoved(C) && (e.disabled || (L = s.virtual.value) != null && L.disabled(e.value) || a.value && (s.optionsPropsRef.value.hold || s.goToOption(U.Nothing)));
|
|
1256
1304
|
}
|
|
1257
1305
|
return () => {
|
|
1258
|
-
let { disabled:
|
|
1259
|
-
return
|
|
1306
|
+
let { disabled: C } = e, L = { active: a.value, selected: u.value, disabled: C }, M = { id: r, ref: i, role: "option", tabIndex: C === !0 ? void 0 : -1, "aria-disabled": C === !0 ? !0 : void 0, "aria-selected": u.value, disabled: void 0, onMousedown: h, onFocus: m, onPointerenter: I, onMouseenter: I, onPointermove: V, onMousemove: V, onPointerleave: T, onMouseleave: T }, y = Fe(e, ["order", "value"]);
|
|
1307
|
+
return ve({ ourProps: M, theirProps: y, slot: L, attrs: t, slots: o, name: "ComboboxOption" });
|
|
1260
1308
|
};
|
|
1261
1309
|
} });
|
|
1262
|
-
function
|
|
1263
|
-
return
|
|
1310
|
+
function Ro(e, o) {
|
|
1311
|
+
return S(), $("svg", {
|
|
1312
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1313
|
+
viewBox: "0 0 20 20",
|
|
1314
|
+
fill: "currentColor",
|
|
1315
|
+
"aria-hidden": "true",
|
|
1316
|
+
"data-slot": "icon"
|
|
1317
|
+
}, [
|
|
1318
|
+
g("path", {
|
|
1319
|
+
"fill-rule": "evenodd",
|
|
1320
|
+
d: "M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",
|
|
1321
|
+
"clip-rule": "evenodd"
|
|
1322
|
+
})
|
|
1323
|
+
]);
|
|
1324
|
+
}
|
|
1325
|
+
function No(e, o) {
|
|
1326
|
+
return S(), $("svg", {
|
|
1264
1327
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1265
1328
|
viewBox: "0 0 20 20",
|
|
1266
1329
|
fill: "currentColor",
|
|
1267
1330
|
"aria-hidden": "true",
|
|
1268
1331
|
"data-slot": "icon"
|
|
1269
1332
|
}, [
|
|
1270
|
-
|
|
1333
|
+
g("path", {
|
|
1271
1334
|
"fill-rule": "evenodd",
|
|
1272
1335
|
d: "M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z",
|
|
1273
1336
|
"clip-rule": "evenodd"
|
|
1274
1337
|
})
|
|
1275
1338
|
]);
|
|
1276
1339
|
}
|
|
1340
|
+
function Do(e, o) {
|
|
1341
|
+
return S(), $("svg", {
|
|
1342
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1343
|
+
viewBox: "0 0 20 20",
|
|
1344
|
+
fill: "currentColor",
|
|
1345
|
+
"aria-hidden": "true",
|
|
1346
|
+
"data-slot": "icon"
|
|
1347
|
+
}, [
|
|
1348
|
+
g("path", {
|
|
1349
|
+
"fill-rule": "evenodd",
|
|
1350
|
+
d: "M9.47 6.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 1 1-1.06 1.06L10 8.06l-3.72 3.72a.75.75 0 0 1-1.06-1.06l4.25-4.25Z",
|
|
1351
|
+
"clip-rule": "evenodd"
|
|
1352
|
+
})
|
|
1353
|
+
]);
|
|
1354
|
+
}
|
|
1277
1355
|
const ht = {
|
|
1278
1356
|
__name: "Select",
|
|
1279
|
-
props: /* @__PURE__ */
|
|
1357
|
+
props: /* @__PURE__ */ dn({
|
|
1280
1358
|
languages: {
|
|
1281
1359
|
type: Object,
|
|
1282
1360
|
required: !0
|
|
@@ -1287,53 +1365,54 @@ const ht = {
|
|
|
1287
1365
|
}),
|
|
1288
1366
|
emits: ["update:modelValue"],
|
|
1289
1367
|
setup(e) {
|
|
1290
|
-
const o = e, t =
|
|
1291
|
-
([,
|
|
1292
|
-
)), i = (
|
|
1293
|
-
|
|
1368
|
+
const o = e, t = fn(e, "modelValue"), n = E(""), s = E(null), r = w(() => Object.entries(o.languages).filter(
|
|
1369
|
+
([, l]) => l.toLowerCase().includes(n.value.toLowerCase())
|
|
1370
|
+
)), i = (l) => {
|
|
1371
|
+
l.target.value = "", n.value = "", s.value && s.value.$el.click();
|
|
1294
1372
|
};
|
|
1295
|
-
return (
|
|
1373
|
+
return (l, a) => (S(), Z(P(Io), {
|
|
1296
1374
|
modelValue: t.value,
|
|
1297
|
-
"onUpdate:modelValue": a[
|
|
1375
|
+
"onUpdate:modelValue": a[3] || (a[3] = (u) => t.value = u),
|
|
1298
1376
|
as: "div",
|
|
1299
1377
|
class: "relative mt-1"
|
|
1300
1378
|
}, {
|
|
1301
|
-
default:
|
|
1302
|
-
|
|
1303
|
-
class: "w-full border border-gray-300 rounded
|
|
1379
|
+
default: ke(() => [
|
|
1380
|
+
z(P(To), {
|
|
1381
|
+
class: "w-full bg-white border border-gray-300 rounded py-2.5 pl-3 pr-10 text-sm text-gray-800 font-medium focus:outline-none focus:ring-0.5 focus:ring-gray-400 focus:border-gray-400",
|
|
1304
1382
|
onChange: a[0] || (a[0] = (u) => n.value = u.target.value),
|
|
1305
1383
|
displayValue: (u) => e.languages[u],
|
|
1306
1384
|
onFocus: a[1] || (a[1] = (u) => i(u))
|
|
1307
1385
|
}, null, 8, ["displayValue"]),
|
|
1308
|
-
|
|
1386
|
+
z(P(Co), {
|
|
1309
1387
|
ref_key: "btnSelect",
|
|
1310
|
-
ref:
|
|
1388
|
+
ref: s,
|
|
1311
1389
|
class: "absolute inset-y-0 right-0 flex items-center pr-2"
|
|
1312
1390
|
}, {
|
|
1313
|
-
default:
|
|
1314
|
-
|
|
1391
|
+
default: ke(() => [
|
|
1392
|
+
z(P(No), {
|
|
1315
1393
|
class: "h-5 w-5 text-gray-400",
|
|
1316
|
-
"aria-hidden": "true"
|
|
1394
|
+
"aria-hidden": "true",
|
|
1395
|
+
onClick: a[2] || (a[2] = (u) => i(u))
|
|
1317
1396
|
})
|
|
1318
1397
|
]),
|
|
1319
1398
|
_: 1
|
|
1320
1399
|
}, 512),
|
|
1321
|
-
|
|
1322
|
-
default:
|
|
1323
|
-
(
|
|
1400
|
+
z(P(Po), { class: "absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm z-50" }, {
|
|
1401
|
+
default: ke(() => [
|
|
1402
|
+
(S(!0), $(G, null, le(r.value, ([u, p]) => (S(), Z(P(ko), {
|
|
1324
1403
|
key: u,
|
|
1325
1404
|
value: u
|
|
1326
1405
|
}, {
|
|
1327
|
-
default:
|
|
1328
|
-
|
|
1329
|
-
class:
|
|
1406
|
+
default: ke(({ active: c, selected: h }) => [
|
|
1407
|
+
g("li", {
|
|
1408
|
+
class: ye([
|
|
1330
1409
|
"relative cursor-default select-none py-2 pl-3 pr-9",
|
|
1331
|
-
c ? "bg-[#3B5695] text-white" : "text-
|
|
1410
|
+
c ? "bg-[#3B5695] text-white" : "text-textCustom"
|
|
1332
1411
|
])
|
|
1333
1412
|
}, [
|
|
1334
|
-
|
|
1335
|
-
class:
|
|
1336
|
-
},
|
|
1413
|
+
g("span", {
|
|
1414
|
+
class: ye(["block truncate", h && "font-semibold"])
|
|
1415
|
+
}, ee(p), 3)
|
|
1337
1416
|
], 2)
|
|
1338
1417
|
]),
|
|
1339
1418
|
_: 2
|
|
@@ -1345,37 +1424,19 @@ const ht = {
|
|
|
1345
1424
|
_: 1
|
|
1346
1425
|
}, 8, ["modelValue"]));
|
|
1347
1426
|
}
|
|
1348
|
-
},
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
], -1), bo = [
|
|
1362
|
-
go
|
|
1363
|
-
], yo = /* @__PURE__ */ I("svg", {
|
|
1364
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1365
|
-
class: "h-6 w-6",
|
|
1366
|
-
fill: "none",
|
|
1367
|
-
viewBox: "0 0 24 24",
|
|
1368
|
-
stroke: "currentColor"
|
|
1369
|
-
}, [
|
|
1370
|
-
/* @__PURE__ */ I("path", {
|
|
1371
|
-
"stroke-linecap": "round",
|
|
1372
|
-
"stroke-linejoin": "round",
|
|
1373
|
-
"stroke-width": "2",
|
|
1374
|
-
d: "M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"
|
|
1375
|
-
})
|
|
1376
|
-
], -1), _o = [
|
|
1377
|
-
yo
|
|
1378
|
-
], wo = {
|
|
1427
|
+
}, Ht = "/assets/icons/transfer.svg", Lo = { key: 0 }, Vo = /* @__PURE__ */ g("img", {
|
|
1428
|
+
src: Ht,
|
|
1429
|
+
alt: "swap",
|
|
1430
|
+
class: "w-4"
|
|
1431
|
+
}, null, -1), Ao = [
|
|
1432
|
+
Vo
|
|
1433
|
+
], Mo = /* @__PURE__ */ g("img", {
|
|
1434
|
+
src: Ht,
|
|
1435
|
+
alt: "swap",
|
|
1436
|
+
class: "w-4"
|
|
1437
|
+
}, null, -1), jo = [
|
|
1438
|
+
Mo
|
|
1439
|
+
], Fo = {
|
|
1379
1440
|
__name: "SwapBtn",
|
|
1380
1441
|
props: {
|
|
1381
1442
|
isBidirect: {
|
|
@@ -1386,52 +1447,52 @@ const ht = {
|
|
|
1386
1447
|
emits: ["swap"],
|
|
1387
1448
|
setup(e, { emit: o }) {
|
|
1388
1449
|
const t = o;
|
|
1389
|
-
return (n,
|
|
1450
|
+
return (n, s) => e.isBidirect ? (S(), $("button", {
|
|
1390
1451
|
key: 1,
|
|
1391
|
-
onClick:
|
|
1392
|
-
},
|
|
1452
|
+
onClick: s[0] || (s[0] = (r) => t("swap"))
|
|
1453
|
+
}, jo)) : (S(), $("button", Lo, Ao));
|
|
1393
1454
|
}
|
|
1394
1455
|
};
|
|
1395
|
-
var
|
|
1396
|
-
function
|
|
1456
|
+
var Wt = !1;
|
|
1457
|
+
function Ne(e, o, t) {
|
|
1397
1458
|
return Array.isArray(e) ? (e.length = Math.max(e.length, o), e.splice(o, 1, t), t) : (e[o] = t, t);
|
|
1398
1459
|
}
|
|
1399
|
-
function
|
|
1460
|
+
function Je(e, o) {
|
|
1400
1461
|
if (Array.isArray(e)) {
|
|
1401
1462
|
e.splice(o, 1);
|
|
1402
1463
|
return;
|
|
1403
1464
|
}
|
|
1404
1465
|
delete e[o];
|
|
1405
1466
|
}
|
|
1406
|
-
function
|
|
1407
|
-
return
|
|
1467
|
+
function Bo() {
|
|
1468
|
+
return Gt().__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
1408
1469
|
}
|
|
1409
|
-
function
|
|
1470
|
+
function Gt() {
|
|
1410
1471
|
return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
|
|
1411
1472
|
}
|
|
1412
|
-
const
|
|
1413
|
-
let
|
|
1414
|
-
function
|
|
1473
|
+
const zo = typeof Proxy == "function", Uo = "devtools-plugin:setup", Ho = "plugin:settings:set";
|
|
1474
|
+
let ge, Ke;
|
|
1475
|
+
function Wo() {
|
|
1415
1476
|
var e;
|
|
1416
|
-
return
|
|
1477
|
+
return ge !== void 0 || (typeof window < "u" && window.performance ? (ge = !0, Ke = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (ge = !0, Ke = globalThis.perf_hooks.performance) : ge = !1), ge;
|
|
1417
1478
|
}
|
|
1418
|
-
function
|
|
1419
|
-
return
|
|
1479
|
+
function Go() {
|
|
1480
|
+
return Wo() ? Ke.now() : Date.now();
|
|
1420
1481
|
}
|
|
1421
|
-
class
|
|
1482
|
+
class qo {
|
|
1422
1483
|
constructor(o, t) {
|
|
1423
1484
|
this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = o, this.hook = t;
|
|
1424
1485
|
const n = {};
|
|
1425
1486
|
if (o.settings)
|
|
1426
1487
|
for (const i in o.settings) {
|
|
1427
|
-
const
|
|
1428
|
-
n[i] =
|
|
1488
|
+
const l = o.settings[i];
|
|
1489
|
+
n[i] = l.defaultValue;
|
|
1429
1490
|
}
|
|
1430
|
-
const
|
|
1491
|
+
const s = `__vue-devtools-plugin-settings__${o.id}`;
|
|
1431
1492
|
let r = Object.assign({}, n);
|
|
1432
1493
|
try {
|
|
1433
|
-
const i = localStorage.getItem(
|
|
1434
|
-
Object.assign(r,
|
|
1494
|
+
const i = localStorage.getItem(s), l = JSON.parse(i);
|
|
1495
|
+
Object.assign(r, l);
|
|
1435
1496
|
} catch {
|
|
1436
1497
|
}
|
|
1437
1498
|
this.fallbacks = {
|
|
@@ -1440,32 +1501,32 @@ class Co {
|
|
|
1440
1501
|
},
|
|
1441
1502
|
setSettings(i) {
|
|
1442
1503
|
try {
|
|
1443
|
-
localStorage.setItem(
|
|
1504
|
+
localStorage.setItem(s, JSON.stringify(i));
|
|
1444
1505
|
} catch {
|
|
1445
1506
|
}
|
|
1446
1507
|
r = i;
|
|
1447
1508
|
},
|
|
1448
1509
|
now() {
|
|
1449
|
-
return
|
|
1510
|
+
return Go();
|
|
1450
1511
|
}
|
|
1451
|
-
}, t && t.on(
|
|
1452
|
-
i === this.plugin.id && this.fallbacks.setSettings(
|
|
1512
|
+
}, t && t.on(Ho, (i, l) => {
|
|
1513
|
+
i === this.plugin.id && this.fallbacks.setSettings(l);
|
|
1453
1514
|
}), this.proxiedOn = new Proxy({}, {
|
|
1454
|
-
get: (i,
|
|
1515
|
+
get: (i, l) => this.target ? this.target.on[l] : (...a) => {
|
|
1455
1516
|
this.onQueue.push({
|
|
1456
|
-
method:
|
|
1517
|
+
method: l,
|
|
1457
1518
|
args: a
|
|
1458
1519
|
});
|
|
1459
1520
|
}
|
|
1460
1521
|
}), this.proxiedTarget = new Proxy({}, {
|
|
1461
|
-
get: (i,
|
|
1462
|
-
method:
|
|
1522
|
+
get: (i, l) => this.target ? this.target[l] : l === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(l) ? (...a) => (this.targetQueue.push({
|
|
1523
|
+
method: l,
|
|
1463
1524
|
args: a,
|
|
1464
1525
|
resolve: () => {
|
|
1465
1526
|
}
|
|
1466
|
-
}), this.fallbacks[
|
|
1527
|
+
}), this.fallbacks[l](...a)) : (...a) => new Promise((u) => {
|
|
1467
1528
|
this.targetQueue.push({
|
|
1468
|
-
method:
|
|
1529
|
+
method: l,
|
|
1469
1530
|
args: a,
|
|
1470
1531
|
resolve: u
|
|
1471
1532
|
});
|
|
@@ -1480,12 +1541,12 @@ class Co {
|
|
|
1480
1541
|
t.resolve(await this.target[t.method](...t.args));
|
|
1481
1542
|
}
|
|
1482
1543
|
}
|
|
1483
|
-
function
|
|
1484
|
-
const t = e, n =
|
|
1485
|
-
if (
|
|
1486
|
-
|
|
1544
|
+
function qt(e, o) {
|
|
1545
|
+
const t = e, n = Gt(), s = Bo(), r = zo && t.enableEarlyProxy;
|
|
1546
|
+
if (s && (n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !r))
|
|
1547
|
+
s.emit(Uo, e, o);
|
|
1487
1548
|
else {
|
|
1488
|
-
const i = r ? new
|
|
1549
|
+
const i = r ? new qo(t, s) : null;
|
|
1489
1550
|
(n.__VUE_DEVTOOLS_PLUGINS__ = n.__VUE_DEVTOOLS_PLUGINS__ || []).push({
|
|
1490
1551
|
pluginDescriptor: t,
|
|
1491
1552
|
setupFn: o,
|
|
@@ -1498,31 +1559,31 @@ function Wt(e, o) {
|
|
|
1498
1559
|
* (c) 2023 Eduardo San Martin Morote
|
|
1499
1560
|
* @license MIT
|
|
1500
1561
|
*/
|
|
1501
|
-
let
|
|
1502
|
-
const
|
|
1562
|
+
let Se;
|
|
1563
|
+
const Ce = (e) => Se = e, Jt = process.env.NODE_ENV !== "production" ? Symbol("pinia") : (
|
|
1503
1564
|
/* istanbul ignore next */
|
|
1504
1565
|
Symbol()
|
|
1505
1566
|
);
|
|
1506
|
-
function
|
|
1567
|
+
function fe(e) {
|
|
1507
1568
|
return e && typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" && typeof e.toJSON != "function";
|
|
1508
1569
|
}
|
|
1509
|
-
var
|
|
1570
|
+
var ne;
|
|
1510
1571
|
(function(e) {
|
|
1511
1572
|
e.direct = "direct", e.patchObject = "patch object", e.patchFunction = "patch function";
|
|
1512
|
-
})(
|
|
1513
|
-
const
|
|
1514
|
-
function
|
|
1573
|
+
})(ne || (ne = {}));
|
|
1574
|
+
const Be = typeof window < "u", Ee = (process.env.NODE_ENV !== "production" || !1) && process.env.NODE_ENV !== "test" && Be, mt = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof global == "object" && global.global === global ? global : typeof globalThis == "object" ? globalThis : { HTMLElement: null };
|
|
1575
|
+
function Jo(e, { autoBom: o = !1 } = {}) {
|
|
1515
1576
|
return o && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type) ? new Blob(["\uFEFF", e], { type: e.type }) : e;
|
|
1516
1577
|
}
|
|
1517
|
-
function
|
|
1578
|
+
function st(e, o, t) {
|
|
1518
1579
|
const n = new XMLHttpRequest();
|
|
1519
1580
|
n.open("GET", e), n.responseType = "blob", n.onload = function() {
|
|
1520
|
-
|
|
1581
|
+
Qt(n.response, o, t);
|
|
1521
1582
|
}, n.onerror = function() {
|
|
1522
1583
|
console.error("could not download file");
|
|
1523
1584
|
}, n.send();
|
|
1524
1585
|
}
|
|
1525
|
-
function
|
|
1586
|
+
function Kt(e) {
|
|
1526
1587
|
const o = new XMLHttpRequest();
|
|
1527
1588
|
o.open("HEAD", e, !1);
|
|
1528
1589
|
try {
|
|
@@ -1531,7 +1592,7 @@ function qt(e) {
|
|
|
1531
1592
|
}
|
|
1532
1593
|
return o.status >= 200 && o.status <= 299;
|
|
1533
1594
|
}
|
|
1534
|
-
function
|
|
1595
|
+
function De(e) {
|
|
1535
1596
|
try {
|
|
1536
1597
|
e.dispatchEvent(new MouseEvent("click"));
|
|
1537
1598
|
} catch {
|
|
@@ -1539,152 +1600,152 @@ function Ne(e) {
|
|
|
1539
1600
|
t.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), e.dispatchEvent(t);
|
|
1540
1601
|
}
|
|
1541
1602
|
}
|
|
1542
|
-
const
|
|
1603
|
+
const Le = typeof navigator == "object" ? navigator : { userAgent: "" }, Yt = /Macintosh/.test(Le.userAgent) && /AppleWebKit/.test(Le.userAgent) && !/Safari/.test(Le.userAgent), Qt = Be ? (
|
|
1543
1604
|
// Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program
|
|
1544
|
-
typeof HTMLAnchorElement < "u" && "download" in HTMLAnchorElement.prototype && !
|
|
1605
|
+
typeof HTMLAnchorElement < "u" && "download" in HTMLAnchorElement.prototype && !Yt ? Ko : (
|
|
1545
1606
|
// Use msSaveOrOpenBlob as a second approach
|
|
1546
|
-
"msSaveOrOpenBlob" in
|
|
1607
|
+
"msSaveOrOpenBlob" in Le ? Yo : (
|
|
1547
1608
|
// Fallback to using FileReader and a popup
|
|
1548
|
-
|
|
1609
|
+
Qo
|
|
1549
1610
|
)
|
|
1550
1611
|
)
|
|
1551
1612
|
) : () => {
|
|
1552
1613
|
};
|
|
1553
|
-
function
|
|
1614
|
+
function Ko(e, o = "download", t) {
|
|
1554
1615
|
const n = document.createElement("a");
|
|
1555
|
-
n.download = o, n.rel = "noopener", typeof e == "string" ? (n.href = e, n.origin !== location.origin ?
|
|
1616
|
+
n.download = o, n.rel = "noopener", typeof e == "string" ? (n.href = e, n.origin !== location.origin ? Kt(n.href) ? st(e, o, t) : (n.target = "_blank", De(n)) : De(n)) : (n.href = URL.createObjectURL(e), setTimeout(function() {
|
|
1556
1617
|
URL.revokeObjectURL(n.href);
|
|
1557
1618
|
}, 4e4), setTimeout(function() {
|
|
1558
|
-
|
|
1619
|
+
De(n);
|
|
1559
1620
|
}, 0));
|
|
1560
1621
|
}
|
|
1561
|
-
function
|
|
1622
|
+
function Yo(e, o = "download", t) {
|
|
1562
1623
|
if (typeof e == "string")
|
|
1563
|
-
if (
|
|
1564
|
-
|
|
1624
|
+
if (Kt(e))
|
|
1625
|
+
st(e, o, t);
|
|
1565
1626
|
else {
|
|
1566
1627
|
const n = document.createElement("a");
|
|
1567
1628
|
n.href = e, n.target = "_blank", setTimeout(function() {
|
|
1568
|
-
|
|
1629
|
+
De(n);
|
|
1569
1630
|
});
|
|
1570
1631
|
}
|
|
1571
1632
|
else
|
|
1572
|
-
navigator.msSaveOrOpenBlob(
|
|
1633
|
+
navigator.msSaveOrOpenBlob(Jo(e, t), o);
|
|
1573
1634
|
}
|
|
1574
|
-
function
|
|
1635
|
+
function Qo(e, o, t, n) {
|
|
1575
1636
|
if (n = n || open("", "_blank"), n && (n.document.title = n.document.body.innerText = "downloading..."), typeof e == "string")
|
|
1576
|
-
return
|
|
1577
|
-
const
|
|
1578
|
-
if ((i ||
|
|
1579
|
-
const
|
|
1580
|
-
|
|
1581
|
-
let a =
|
|
1637
|
+
return st(e, o, t);
|
|
1638
|
+
const s = e.type === "application/octet-stream", r = /constructor/i.test(String(mt.HTMLElement)) || "safari" in mt, i = /CriOS\/[\d]+/.test(navigator.userAgent);
|
|
1639
|
+
if ((i || s && r || Yt) && typeof FileReader < "u") {
|
|
1640
|
+
const l = new FileReader();
|
|
1641
|
+
l.onloadend = function() {
|
|
1642
|
+
let a = l.result;
|
|
1582
1643
|
if (typeof a != "string")
|
|
1583
1644
|
throw n = null, new Error("Wrong reader.result type");
|
|
1584
1645
|
a = i ? a : a.replace(/^data:[^;]*;/, "data:attachment/file;"), n ? n.location.href = a : location.assign(a), n = null;
|
|
1585
|
-
},
|
|
1646
|
+
}, l.readAsDataURL(e);
|
|
1586
1647
|
} else {
|
|
1587
|
-
const
|
|
1588
|
-
n ? n.location.assign(
|
|
1589
|
-
URL.revokeObjectURL(
|
|
1648
|
+
const l = URL.createObjectURL(e);
|
|
1649
|
+
n ? n.location.assign(l) : location.href = l, n = null, setTimeout(function() {
|
|
1650
|
+
URL.revokeObjectURL(l);
|
|
1590
1651
|
}, 4e4);
|
|
1591
1652
|
}
|
|
1592
1653
|
}
|
|
1593
|
-
function
|
|
1654
|
+
function B(e, o) {
|
|
1594
1655
|
const t = "🍍 " + e;
|
|
1595
1656
|
typeof __VUE_DEVTOOLS_TOAST__ == "function" ? __VUE_DEVTOOLS_TOAST__(t, o) : o === "error" ? console.error(t) : o === "warn" ? console.warn(t) : console.log(t);
|
|
1596
1657
|
}
|
|
1597
|
-
function
|
|
1658
|
+
function lt(e) {
|
|
1598
1659
|
return "_a" in e && "install" in e;
|
|
1599
1660
|
}
|
|
1600
|
-
function
|
|
1661
|
+
function Xt() {
|
|
1601
1662
|
if (!("clipboard" in navigator))
|
|
1602
|
-
return
|
|
1663
|
+
return B("Your browser doesn't support the Clipboard API", "error"), !0;
|
|
1603
1664
|
}
|
|
1604
|
-
function
|
|
1605
|
-
return e instanceof Error && e.message.toLowerCase().includes("document is not focused") ? (
|
|
1665
|
+
function Zt(e) {
|
|
1666
|
+
return e instanceof Error && e.message.toLowerCase().includes("document is not focused") ? (B('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', "warn"), !0) : !1;
|
|
1606
1667
|
}
|
|
1607
|
-
async function
|
|
1608
|
-
if (!
|
|
1668
|
+
async function Xo(e) {
|
|
1669
|
+
if (!Xt())
|
|
1609
1670
|
try {
|
|
1610
|
-
await navigator.clipboard.writeText(JSON.stringify(e.state.value)),
|
|
1671
|
+
await navigator.clipboard.writeText(JSON.stringify(e.state.value)), B("Global state copied to clipboard.");
|
|
1611
1672
|
} catch (o) {
|
|
1612
|
-
if (
|
|
1673
|
+
if (Zt(o))
|
|
1613
1674
|
return;
|
|
1614
|
-
|
|
1675
|
+
B("Failed to serialize the state. Check the console for more details.", "error"), console.error(o);
|
|
1615
1676
|
}
|
|
1616
1677
|
}
|
|
1617
|
-
async function
|
|
1618
|
-
if (!
|
|
1678
|
+
async function Zo(e) {
|
|
1679
|
+
if (!Xt())
|
|
1619
1680
|
try {
|
|
1620
|
-
|
|
1681
|
+
en(e, JSON.parse(await navigator.clipboard.readText())), B("Global state pasted from clipboard.");
|
|
1621
1682
|
} catch (o) {
|
|
1622
|
-
if (
|
|
1683
|
+
if (Zt(o))
|
|
1623
1684
|
return;
|
|
1624
|
-
|
|
1685
|
+
B("Failed to deserialize the state from clipboard. Check the console for more details.", "error"), console.error(o);
|
|
1625
1686
|
}
|
|
1626
1687
|
}
|
|
1627
|
-
async function
|
|
1688
|
+
async function es(e) {
|
|
1628
1689
|
try {
|
|
1629
|
-
|
|
1690
|
+
Qt(new Blob([JSON.stringify(e.state.value)], {
|
|
1630
1691
|
type: "text/plain;charset=utf-8"
|
|
1631
1692
|
}), "pinia-state.json");
|
|
1632
1693
|
} catch (o) {
|
|
1633
|
-
|
|
1694
|
+
B("Failed to export the state as JSON. Check the console for more details.", "error"), console.error(o);
|
|
1634
1695
|
}
|
|
1635
1696
|
}
|
|
1636
|
-
let
|
|
1637
|
-
function
|
|
1638
|
-
|
|
1697
|
+
let oe;
|
|
1698
|
+
function ts() {
|
|
1699
|
+
oe || (oe = document.createElement("input"), oe.type = "file", oe.accept = ".json");
|
|
1639
1700
|
function e() {
|
|
1640
1701
|
return new Promise((o, t) => {
|
|
1641
|
-
|
|
1642
|
-
const n =
|
|
1702
|
+
oe.onchange = async () => {
|
|
1703
|
+
const n = oe.files;
|
|
1643
1704
|
if (!n)
|
|
1644
1705
|
return o(null);
|
|
1645
|
-
const
|
|
1646
|
-
return o(
|
|
1647
|
-
},
|
|
1706
|
+
const s = n.item(0);
|
|
1707
|
+
return o(s ? { text: await s.text(), file: s } : null);
|
|
1708
|
+
}, oe.oncancel = () => o(null), oe.onerror = t, oe.click();
|
|
1648
1709
|
});
|
|
1649
1710
|
}
|
|
1650
1711
|
return e;
|
|
1651
1712
|
}
|
|
1652
|
-
async function
|
|
1713
|
+
async function ns(e) {
|
|
1653
1714
|
try {
|
|
1654
|
-
const t = await
|
|
1715
|
+
const t = await ts()();
|
|
1655
1716
|
if (!t)
|
|
1656
1717
|
return;
|
|
1657
|
-
const { text: n, file:
|
|
1658
|
-
|
|
1718
|
+
const { text: n, file: s } = t;
|
|
1719
|
+
en(e, JSON.parse(n)), B(`Global state imported from "${s.name}".`);
|
|
1659
1720
|
} catch (o) {
|
|
1660
|
-
|
|
1721
|
+
B("Failed to import the state from JSON. Check the console for more details.", "error"), console.error(o);
|
|
1661
1722
|
}
|
|
1662
1723
|
}
|
|
1663
|
-
function
|
|
1724
|
+
function en(e, o) {
|
|
1664
1725
|
for (const t in o) {
|
|
1665
1726
|
const n = e.state.value[t];
|
|
1666
1727
|
n ? Object.assign(n, o[t]) : e.state.value[t] = o[t];
|
|
1667
1728
|
}
|
|
1668
1729
|
}
|
|
1669
|
-
function
|
|
1730
|
+
function Q(e) {
|
|
1670
1731
|
return {
|
|
1671
1732
|
_custom: {
|
|
1672
1733
|
display: e
|
|
1673
1734
|
}
|
|
1674
1735
|
};
|
|
1675
1736
|
}
|
|
1676
|
-
const
|
|
1677
|
-
function
|
|
1678
|
-
return
|
|
1679
|
-
id:
|
|
1680
|
-
label:
|
|
1737
|
+
const tn = "🍍 Pinia (root)", Ye = "_root";
|
|
1738
|
+
function os(e) {
|
|
1739
|
+
return lt(e) ? {
|
|
1740
|
+
id: Ye,
|
|
1741
|
+
label: tn
|
|
1681
1742
|
} : {
|
|
1682
1743
|
id: e.$id,
|
|
1683
1744
|
label: e.$id
|
|
1684
1745
|
};
|
|
1685
1746
|
}
|
|
1686
|
-
function
|
|
1687
|
-
if (
|
|
1747
|
+
function ss(e) {
|
|
1748
|
+
if (lt(e)) {
|
|
1688
1749
|
const t = Array.from(e._s.keys()), n = e._s;
|
|
1689
1750
|
return {
|
|
1690
1751
|
state: t.map((r) => ({
|
|
@@ -1697,7 +1758,7 @@ function jo(e) {
|
|
|
1697
1758
|
return {
|
|
1698
1759
|
editable: !1,
|
|
1699
1760
|
key: r,
|
|
1700
|
-
value: i._getters.reduce((
|
|
1761
|
+
value: i._getters.reduce((l, a) => (l[a] = i[a], l), {})
|
|
1701
1762
|
};
|
|
1702
1763
|
})
|
|
1703
1764
|
};
|
|
@@ -1719,49 +1780,49 @@ function jo(e) {
|
|
|
1719
1780
|
value: e[t]
|
|
1720
1781
|
}))), o;
|
|
1721
1782
|
}
|
|
1722
|
-
function
|
|
1783
|
+
function ls(e) {
|
|
1723
1784
|
return e ? Array.isArray(e) ? e.reduce((o, t) => (o.keys.push(t.key), o.operations.push(t.type), o.oldValue[t.key] = t.oldValue, o.newValue[t.key] = t.newValue, o), {
|
|
1724
1785
|
oldValue: {},
|
|
1725
1786
|
keys: [],
|
|
1726
1787
|
operations: [],
|
|
1727
1788
|
newValue: {}
|
|
1728
1789
|
}) : {
|
|
1729
|
-
operation:
|
|
1730
|
-
key:
|
|
1790
|
+
operation: Q(e.type),
|
|
1791
|
+
key: Q(e.key),
|
|
1731
1792
|
oldValue: e.oldValue,
|
|
1732
1793
|
newValue: e.newValue
|
|
1733
1794
|
} : {};
|
|
1734
1795
|
}
|
|
1735
|
-
function
|
|
1796
|
+
function rs(e) {
|
|
1736
1797
|
switch (e) {
|
|
1737
|
-
case
|
|
1798
|
+
case ne.direct:
|
|
1738
1799
|
return "mutation";
|
|
1739
|
-
case
|
|
1800
|
+
case ne.patchFunction:
|
|
1740
1801
|
return "$patch";
|
|
1741
|
-
case
|
|
1802
|
+
case ne.patchObject:
|
|
1742
1803
|
return "$patch";
|
|
1743
1804
|
default:
|
|
1744
1805
|
return "unknown";
|
|
1745
1806
|
}
|
|
1746
1807
|
}
|
|
1747
|
-
let
|
|
1748
|
-
const
|
|
1749
|
-
function
|
|
1750
|
-
|
|
1808
|
+
let _e = !0;
|
|
1809
|
+
const Ve = [], ue = "pinia:mutations", H = "pinia", { assign: is } = Object, Me = (e) => "🍍 " + e;
|
|
1810
|
+
function as(e, o) {
|
|
1811
|
+
qt({
|
|
1751
1812
|
id: "dev.esm.pinia",
|
|
1752
1813
|
label: "Pinia 🍍",
|
|
1753
1814
|
logo: "https://pinia.vuejs.org/logo.svg",
|
|
1754
1815
|
packageName: "pinia",
|
|
1755
1816
|
homepage: "https://pinia.vuejs.org",
|
|
1756
|
-
componentStateTypes:
|
|
1817
|
+
componentStateTypes: Ve,
|
|
1757
1818
|
app: e
|
|
1758
1819
|
}, (t) => {
|
|
1759
|
-
typeof t.now != "function" &&
|
|
1760
|
-
id:
|
|
1820
|
+
typeof t.now != "function" && B("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."), t.addTimelineLayer({
|
|
1821
|
+
id: ue,
|
|
1761
1822
|
label: "Pinia 🍍",
|
|
1762
1823
|
color: 15064968
|
|
1763
1824
|
}), t.addInspector({
|
|
1764
|
-
id:
|
|
1825
|
+
id: H,
|
|
1765
1826
|
label: "Pinia 🍍",
|
|
1766
1827
|
icon: "storage",
|
|
1767
1828
|
treeFilterPlaceholder: "Search stores",
|
|
@@ -1769,28 +1830,28 @@ function Uo(e, o) {
|
|
|
1769
1830
|
{
|
|
1770
1831
|
icon: "content_copy",
|
|
1771
1832
|
action: () => {
|
|
1772
|
-
|
|
1833
|
+
Xo(o);
|
|
1773
1834
|
},
|
|
1774
1835
|
tooltip: "Serialize and copy the state"
|
|
1775
1836
|
},
|
|
1776
1837
|
{
|
|
1777
1838
|
icon: "content_paste",
|
|
1778
1839
|
action: async () => {
|
|
1779
|
-
await
|
|
1840
|
+
await Zo(o), t.sendInspectorTree(H), t.sendInspectorState(H);
|
|
1780
1841
|
},
|
|
1781
1842
|
tooltip: "Replace the state with the content of your clipboard"
|
|
1782
1843
|
},
|
|
1783
1844
|
{
|
|
1784
1845
|
icon: "save",
|
|
1785
1846
|
action: () => {
|
|
1786
|
-
|
|
1847
|
+
es(o);
|
|
1787
1848
|
},
|
|
1788
1849
|
tooltip: "Save the state as a JSON file"
|
|
1789
1850
|
},
|
|
1790
1851
|
{
|
|
1791
1852
|
icon: "folder_open",
|
|
1792
1853
|
action: async () => {
|
|
1793
|
-
await
|
|
1854
|
+
await ns(o), t.sendInspectorTree(H), t.sendInspectorState(H);
|
|
1794
1855
|
},
|
|
1795
1856
|
tooltip: "Import the state from a JSON file"
|
|
1796
1857
|
}
|
|
@@ -1800,44 +1861,44 @@ function Uo(e, o) {
|
|
|
1800
1861
|
icon: "restore",
|
|
1801
1862
|
tooltip: 'Reset the state (with "$reset")',
|
|
1802
1863
|
action: (n) => {
|
|
1803
|
-
const
|
|
1804
|
-
|
|
1864
|
+
const s = o._s.get(n);
|
|
1865
|
+
s ? typeof s.$reset != "function" ? B(`Cannot reset "${n}" store because it doesn't have a "$reset" method implemented.`, "warn") : (s.$reset(), B(`Store "${n}" reset.`)) : B(`Cannot reset "${n}" store because it wasn't found.`, "warn");
|
|
1805
1866
|
}
|
|
1806
1867
|
}
|
|
1807
1868
|
]
|
|
1808
|
-
}), t.on.inspectComponent((n,
|
|
1869
|
+
}), t.on.inspectComponent((n, s) => {
|
|
1809
1870
|
const r = n.componentInstance && n.componentInstance.proxy;
|
|
1810
1871
|
if (r && r._pStores) {
|
|
1811
1872
|
const i = n.componentInstance.proxy._pStores;
|
|
1812
|
-
Object.values(i).forEach((
|
|
1873
|
+
Object.values(i).forEach((l) => {
|
|
1813
1874
|
n.instanceData.state.push({
|
|
1814
|
-
type: Me(
|
|
1875
|
+
type: Me(l.$id),
|
|
1815
1876
|
key: "state",
|
|
1816
1877
|
editable: !0,
|
|
1817
|
-
value:
|
|
1878
|
+
value: l._isOptionsAPI ? {
|
|
1818
1879
|
_custom: {
|
|
1819
|
-
value:
|
|
1880
|
+
value: Y(l.$state),
|
|
1820
1881
|
actions: [
|
|
1821
1882
|
{
|
|
1822
1883
|
icon: "restore",
|
|
1823
1884
|
tooltip: "Reset the state of this store",
|
|
1824
|
-
action: () =>
|
|
1885
|
+
action: () => l.$reset()
|
|
1825
1886
|
}
|
|
1826
1887
|
]
|
|
1827
1888
|
}
|
|
1828
1889
|
} : (
|
|
1829
1890
|
// NOTE: workaround to unwrap transferred refs
|
|
1830
|
-
Object.keys(
|
|
1891
|
+
Object.keys(l.$state).reduce((a, u) => (a[u] = l.$state[u], a), {})
|
|
1831
1892
|
)
|
|
1832
|
-
}),
|
|
1833
|
-
type: Me(
|
|
1893
|
+
}), l._getters && l._getters.length && n.instanceData.state.push({
|
|
1894
|
+
type: Me(l.$id),
|
|
1834
1895
|
key: "getters",
|
|
1835
1896
|
editable: !1,
|
|
1836
|
-
value:
|
|
1897
|
+
value: l._getters.reduce((a, u) => {
|
|
1837
1898
|
try {
|
|
1838
|
-
a[u] =
|
|
1839
|
-
} catch (
|
|
1840
|
-
a[u] =
|
|
1899
|
+
a[u] = l[u];
|
|
1900
|
+
} catch (p) {
|
|
1901
|
+
a[u] = p;
|
|
1841
1902
|
}
|
|
1842
1903
|
return a;
|
|
1843
1904
|
}, {})
|
|
@@ -1845,48 +1906,48 @@ function Uo(e, o) {
|
|
|
1845
1906
|
});
|
|
1846
1907
|
}
|
|
1847
1908
|
}), t.on.getInspectorTree((n) => {
|
|
1848
|
-
if (n.app === e && n.inspectorId ===
|
|
1849
|
-
let
|
|
1850
|
-
|
|
1909
|
+
if (n.app === e && n.inspectorId === H) {
|
|
1910
|
+
let s = [o];
|
|
1911
|
+
s = s.concat(Array.from(o._s.values())), n.rootNodes = (n.filter ? s.filter((r) => "$id" in r ? r.$id.toLowerCase().includes(n.filter.toLowerCase()) : tn.toLowerCase().includes(n.filter.toLowerCase())) : s).map(os);
|
|
1851
1912
|
}
|
|
1852
1913
|
}), t.on.getInspectorState((n) => {
|
|
1853
|
-
if (n.app === e && n.inspectorId ===
|
|
1854
|
-
const
|
|
1855
|
-
if (!
|
|
1914
|
+
if (n.app === e && n.inspectorId === H) {
|
|
1915
|
+
const s = n.nodeId === Ye ? o : o._s.get(n.nodeId);
|
|
1916
|
+
if (!s)
|
|
1856
1917
|
return;
|
|
1857
|
-
|
|
1918
|
+
s && (n.state = ss(s));
|
|
1858
1919
|
}
|
|
1859
|
-
}), t.on.editInspectorState((n,
|
|
1860
|
-
if (n.app === e && n.inspectorId ===
|
|
1861
|
-
const r = n.nodeId ===
|
|
1920
|
+
}), t.on.editInspectorState((n, s) => {
|
|
1921
|
+
if (n.app === e && n.inspectorId === H) {
|
|
1922
|
+
const r = n.nodeId === Ye ? o : o._s.get(n.nodeId);
|
|
1862
1923
|
if (!r)
|
|
1863
|
-
return
|
|
1924
|
+
return B(`store "${n.nodeId}" not found`, "error");
|
|
1864
1925
|
const { path: i } = n;
|
|
1865
|
-
|
|
1926
|
+
lt(r) ? i.unshift("state") : (i.length !== 1 || !r._customProperties.has(i[0]) || i[0] in r.$state) && i.unshift("$state"), _e = !1, n.set(r, i, n.state.value), _e = !0;
|
|
1866
1927
|
}
|
|
1867
1928
|
}), t.on.editComponentState((n) => {
|
|
1868
1929
|
if (n.type.startsWith("🍍")) {
|
|
1869
|
-
const
|
|
1930
|
+
const s = n.type.replace(/^🍍\s*/, ""), r = o._s.get(s);
|
|
1870
1931
|
if (!r)
|
|
1871
|
-
return
|
|
1932
|
+
return B(`store "${s}" not found`, "error");
|
|
1872
1933
|
const { path: i } = n;
|
|
1873
1934
|
if (i[0] !== "state")
|
|
1874
|
-
return
|
|
1935
|
+
return B(`Invalid path for store "${s}":
|
|
1875
1936
|
${i}
|
|
1876
1937
|
Only state can be modified.`);
|
|
1877
|
-
i[0] = "$state",
|
|
1938
|
+
i[0] = "$state", _e = !1, n.set(r, i, n.state.value), _e = !0;
|
|
1878
1939
|
}
|
|
1879
1940
|
});
|
|
1880
1941
|
});
|
|
1881
1942
|
}
|
|
1882
|
-
function
|
|
1883
|
-
|
|
1943
|
+
function us(e, o) {
|
|
1944
|
+
Ve.includes(Me(o.$id)) || Ve.push(Me(o.$id)), qt({
|
|
1884
1945
|
id: "dev.esm.pinia",
|
|
1885
1946
|
label: "Pinia 🍍",
|
|
1886
1947
|
logo: "https://pinia.vuejs.org/logo.svg",
|
|
1887
1948
|
packageName: "pinia",
|
|
1888
1949
|
homepage: "https://pinia.vuejs.org",
|
|
1889
|
-
componentStateTypes:
|
|
1950
|
+
componentStateTypes: Ve,
|
|
1890
1951
|
app: e,
|
|
1891
1952
|
settings: {
|
|
1892
1953
|
logStoreChanges: {
|
|
@@ -1902,81 +1963,81 @@ function Ho(e, o) {
|
|
|
1902
1963
|
}
|
|
1903
1964
|
}, (t) => {
|
|
1904
1965
|
const n = typeof t.now == "function" ? t.now.bind(t) : Date.now;
|
|
1905
|
-
o.$onAction(({ after: i, onError:
|
|
1906
|
-
const
|
|
1966
|
+
o.$onAction(({ after: i, onError: l, name: a, args: u }) => {
|
|
1967
|
+
const p = nn++;
|
|
1907
1968
|
t.addTimelineEvent({
|
|
1908
|
-
layerId:
|
|
1969
|
+
layerId: ue,
|
|
1909
1970
|
event: {
|
|
1910
1971
|
time: n(),
|
|
1911
1972
|
title: "🛫 " + a,
|
|
1912
1973
|
subtitle: "start",
|
|
1913
1974
|
data: {
|
|
1914
|
-
store:
|
|
1915
|
-
action:
|
|
1975
|
+
store: Q(o.$id),
|
|
1976
|
+
action: Q(a),
|
|
1916
1977
|
args: u
|
|
1917
1978
|
},
|
|
1918
|
-
groupId:
|
|
1979
|
+
groupId: p
|
|
1919
1980
|
}
|
|
1920
1981
|
}), i((c) => {
|
|
1921
|
-
|
|
1922
|
-
layerId:
|
|
1982
|
+
re = void 0, t.addTimelineEvent({
|
|
1983
|
+
layerId: ue,
|
|
1923
1984
|
event: {
|
|
1924
1985
|
time: n(),
|
|
1925
1986
|
title: "🛬 " + a,
|
|
1926
1987
|
subtitle: "end",
|
|
1927
1988
|
data: {
|
|
1928
|
-
store:
|
|
1929
|
-
action:
|
|
1989
|
+
store: Q(o.$id),
|
|
1990
|
+
action: Q(a),
|
|
1930
1991
|
args: u,
|
|
1931
1992
|
result: c
|
|
1932
1993
|
},
|
|
1933
|
-
groupId:
|
|
1994
|
+
groupId: p
|
|
1934
1995
|
}
|
|
1935
1996
|
});
|
|
1936
|
-
}),
|
|
1937
|
-
|
|
1938
|
-
layerId:
|
|
1997
|
+
}), l((c) => {
|
|
1998
|
+
re = void 0, t.addTimelineEvent({
|
|
1999
|
+
layerId: ue,
|
|
1939
2000
|
event: {
|
|
1940
2001
|
time: n(),
|
|
1941
2002
|
logType: "error",
|
|
1942
2003
|
title: "💥 " + a,
|
|
1943
2004
|
subtitle: "end",
|
|
1944
2005
|
data: {
|
|
1945
|
-
store:
|
|
1946
|
-
action:
|
|
2006
|
+
store: Q(o.$id),
|
|
2007
|
+
action: Q(a),
|
|
1947
2008
|
args: u,
|
|
1948
2009
|
error: c
|
|
1949
2010
|
},
|
|
1950
|
-
groupId:
|
|
2011
|
+
groupId: p
|
|
1951
2012
|
}
|
|
1952
2013
|
});
|
|
1953
2014
|
});
|
|
1954
2015
|
}, !0), o._customProperties.forEach((i) => {
|
|
1955
|
-
j(() =>
|
|
1956
|
-
t.notifyComponentUpdate(), t.sendInspectorState(
|
|
1957
|
-
layerId:
|
|
2016
|
+
j(() => P(o[i]), (l, a) => {
|
|
2017
|
+
t.notifyComponentUpdate(), t.sendInspectorState(H), _e && t.addTimelineEvent({
|
|
2018
|
+
layerId: ue,
|
|
1958
2019
|
event: {
|
|
1959
2020
|
time: n(),
|
|
1960
2021
|
title: "Change",
|
|
1961
2022
|
subtitle: i,
|
|
1962
2023
|
data: {
|
|
1963
|
-
newValue:
|
|
2024
|
+
newValue: l,
|
|
1964
2025
|
oldValue: a
|
|
1965
2026
|
},
|
|
1966
|
-
groupId:
|
|
2027
|
+
groupId: re
|
|
1967
2028
|
}
|
|
1968
2029
|
});
|
|
1969
2030
|
}, { deep: !0 });
|
|
1970
|
-
}), o.$subscribe(({ events: i, type:
|
|
1971
|
-
if (t.notifyComponentUpdate(), t.sendInspectorState(
|
|
2031
|
+
}), o.$subscribe(({ events: i, type: l }, a) => {
|
|
2032
|
+
if (t.notifyComponentUpdate(), t.sendInspectorState(H), !_e)
|
|
1972
2033
|
return;
|
|
1973
2034
|
const u = {
|
|
1974
2035
|
time: n(),
|
|
1975
|
-
title:
|
|
1976
|
-
data:
|
|
1977
|
-
groupId:
|
|
2036
|
+
title: rs(l),
|
|
2037
|
+
data: is({ store: Q(o.$id) }, ls(i)),
|
|
2038
|
+
groupId: re
|
|
1978
2039
|
};
|
|
1979
|
-
|
|
2040
|
+
l === ne.patchFunction ? u.subtitle = "⤵️" : l === ne.patchObject ? u.subtitle = "🧩" : i && !Array.isArray(i) && (u.subtitle = i.type), i && (u.data["rawEvent(s)"] = {
|
|
1980
2041
|
_custom: {
|
|
1981
2042
|
display: "DebuggerEvent",
|
|
1982
2043
|
type: "object",
|
|
@@ -1984,71 +2045,71 @@ function Ho(e, o) {
|
|
|
1984
2045
|
value: i
|
|
1985
2046
|
}
|
|
1986
2047
|
}), t.addTimelineEvent({
|
|
1987
|
-
layerId:
|
|
2048
|
+
layerId: ue,
|
|
1988
2049
|
event: u
|
|
1989
2050
|
});
|
|
1990
2051
|
}, { detached: !0, flush: "sync" });
|
|
1991
|
-
const
|
|
1992
|
-
o._hotUpdate =
|
|
1993
|
-
|
|
1994
|
-
layerId:
|
|
2052
|
+
const s = o._hotUpdate;
|
|
2053
|
+
o._hotUpdate = de((i) => {
|
|
2054
|
+
s(i), t.addTimelineEvent({
|
|
2055
|
+
layerId: ue,
|
|
1995
2056
|
event: {
|
|
1996
2057
|
time: n(),
|
|
1997
2058
|
title: "🔥 " + o.$id,
|
|
1998
2059
|
subtitle: "HMR update",
|
|
1999
2060
|
data: {
|
|
2000
|
-
store:
|
|
2001
|
-
info:
|
|
2061
|
+
store: Q(o.$id),
|
|
2062
|
+
info: Q("HMR update")
|
|
2002
2063
|
}
|
|
2003
2064
|
}
|
|
2004
|
-
}), t.notifyComponentUpdate(), t.sendInspectorTree(
|
|
2065
|
+
}), t.notifyComponentUpdate(), t.sendInspectorTree(H), t.sendInspectorState(H);
|
|
2005
2066
|
});
|
|
2006
2067
|
const { $dispose: r } = o;
|
|
2007
2068
|
o.$dispose = () => {
|
|
2008
|
-
r(), t.notifyComponentUpdate(), t.sendInspectorTree(
|
|
2009
|
-
}, t.notifyComponentUpdate(), t.sendInspectorTree(
|
|
2069
|
+
r(), t.notifyComponentUpdate(), t.sendInspectorTree(H), t.sendInspectorState(H), t.getSettings().logStoreChanges && B(`Disposed "${o.$id}" store 🗑`);
|
|
2070
|
+
}, t.notifyComponentUpdate(), t.sendInspectorTree(H), t.sendInspectorState(H), t.getSettings().logStoreChanges && B(`"${o.$id}" store installed 🆕`);
|
|
2010
2071
|
});
|
|
2011
2072
|
}
|
|
2012
|
-
let
|
|
2073
|
+
let nn = 0, re;
|
|
2013
2074
|
function gt(e, o, t) {
|
|
2014
|
-
const n = o.reduce((
|
|
2015
|
-
for (const
|
|
2016
|
-
e[
|
|
2017
|
-
const r =
|
|
2075
|
+
const n = o.reduce((s, r) => (s[r] = Y(e)[r], s), {});
|
|
2076
|
+
for (const s in n)
|
|
2077
|
+
e[s] = function() {
|
|
2078
|
+
const r = nn, i = t ? new Proxy(e, {
|
|
2018
2079
|
get(...a) {
|
|
2019
|
-
return
|
|
2080
|
+
return re = r, Reflect.get(...a);
|
|
2020
2081
|
},
|
|
2021
2082
|
set(...a) {
|
|
2022
|
-
return
|
|
2083
|
+
return re = r, Reflect.set(...a);
|
|
2023
2084
|
}
|
|
2024
2085
|
}) : e;
|
|
2025
|
-
|
|
2026
|
-
const
|
|
2027
|
-
return
|
|
2086
|
+
re = r;
|
|
2087
|
+
const l = n[s].apply(i, arguments);
|
|
2088
|
+
return re = void 0, l;
|
|
2028
2089
|
};
|
|
2029
2090
|
}
|
|
2030
|
-
function
|
|
2091
|
+
function cs({ app: e, store: o, options: t }) {
|
|
2031
2092
|
if (o.$id.startsWith("__hot:"))
|
|
2032
2093
|
return;
|
|
2033
2094
|
o._isOptionsAPI = !!t.state, gt(o, Object.keys(t.actions), o._isOptionsAPI);
|
|
2034
2095
|
const n = o._hotUpdate;
|
|
2035
|
-
|
|
2036
|
-
n.apply(this, arguments), gt(o, Object.keys(
|
|
2037
|
-
},
|
|
2096
|
+
Y(o)._hotUpdate = function(s) {
|
|
2097
|
+
n.apply(this, arguments), gt(o, Object.keys(s._hmrPayload.actions), !!o._isOptionsAPI);
|
|
2098
|
+
}, us(
|
|
2038
2099
|
e,
|
|
2039
2100
|
// FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
|
|
2040
2101
|
o
|
|
2041
2102
|
);
|
|
2042
2103
|
}
|
|
2043
|
-
function
|
|
2044
|
-
const e =
|
|
2104
|
+
function ds() {
|
|
2105
|
+
const e = $t(!0), o = e.run(() => E({}));
|
|
2045
2106
|
let t = [], n = [];
|
|
2046
|
-
const
|
|
2107
|
+
const s = de({
|
|
2047
2108
|
install(r) {
|
|
2048
|
-
|
|
2109
|
+
Ce(s), s._a = r, r.provide(Jt, s), r.config.globalProperties.$pinia = s, Ee && as(r, s), n.forEach((i) => t.push(i)), n = [];
|
|
2049
2110
|
},
|
|
2050
2111
|
use(r) {
|
|
2051
|
-
return !this._a && !
|
|
2112
|
+
return !this._a && !Wt ? n.push(r) : t.push(r), this;
|
|
2052
2113
|
},
|
|
2053
2114
|
_p: t,
|
|
2054
2115
|
// it's actually undefined here
|
|
@@ -2058,232 +2119,232 @@ function Go() {
|
|
|
2058
2119
|
_s: /* @__PURE__ */ new Map(),
|
|
2059
2120
|
state: o
|
|
2060
2121
|
});
|
|
2061
|
-
return
|
|
2122
|
+
return Ee && typeof Proxy < "u" && s.use(cs), s;
|
|
2062
2123
|
}
|
|
2063
|
-
function
|
|
2124
|
+
function on(e, o) {
|
|
2064
2125
|
for (const t in o) {
|
|
2065
2126
|
const n = o[t];
|
|
2066
2127
|
if (!(t in e))
|
|
2067
2128
|
continue;
|
|
2068
|
-
const
|
|
2069
|
-
|
|
2129
|
+
const s = e[t];
|
|
2130
|
+
fe(s) && fe(n) && !xe(n) && !tt(n) ? e[t] = on(s, n) : e[t] = n;
|
|
2070
2131
|
}
|
|
2071
2132
|
return e;
|
|
2072
2133
|
}
|
|
2073
|
-
const
|
|
2134
|
+
const sn = () => {
|
|
2074
2135
|
};
|
|
2075
|
-
function bt(e, o, t, n =
|
|
2136
|
+
function bt(e, o, t, n = sn) {
|
|
2076
2137
|
e.push(o);
|
|
2077
|
-
const
|
|
2138
|
+
const s = () => {
|
|
2078
2139
|
const r = e.indexOf(o);
|
|
2079
2140
|
r > -1 && (e.splice(r, 1), n());
|
|
2080
2141
|
};
|
|
2081
|
-
return !t && Ct() &&
|
|
2142
|
+
return !t && Ct() && Ze(s), s;
|
|
2082
2143
|
}
|
|
2083
|
-
function
|
|
2144
|
+
function be(e, ...o) {
|
|
2084
2145
|
e.slice().forEach((t) => {
|
|
2085
2146
|
t(...o);
|
|
2086
2147
|
});
|
|
2087
2148
|
}
|
|
2088
|
-
const
|
|
2089
|
-
function
|
|
2149
|
+
const fs = (e) => e();
|
|
2150
|
+
function Qe(e, o) {
|
|
2090
2151
|
e instanceof Map && o instanceof Map && o.forEach((t, n) => e.set(n, t)), e instanceof Set && o instanceof Set && o.forEach(e.add, e);
|
|
2091
2152
|
for (const t in o) {
|
|
2092
2153
|
if (!o.hasOwnProperty(t))
|
|
2093
2154
|
continue;
|
|
2094
|
-
const n = o[t],
|
|
2095
|
-
|
|
2155
|
+
const n = o[t], s = e[t];
|
|
2156
|
+
fe(s) && fe(n) && e.hasOwnProperty(t) && !xe(n) && !tt(n) ? e[t] = Qe(s, n) : e[t] = n;
|
|
2096
2157
|
}
|
|
2097
2158
|
return e;
|
|
2098
2159
|
}
|
|
2099
|
-
const
|
|
2160
|
+
const ps = process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
|
|
2100
2161
|
/* istanbul ignore next */
|
|
2101
2162
|
Symbol()
|
|
2102
2163
|
);
|
|
2103
|
-
function
|
|
2104
|
-
return !
|
|
2164
|
+
function vs(e) {
|
|
2165
|
+
return !fe(e) || !e.hasOwnProperty(ps);
|
|
2105
2166
|
}
|
|
2106
|
-
const { assign:
|
|
2107
|
-
function
|
|
2108
|
-
return !!(
|
|
2167
|
+
const { assign: K } = Object;
|
|
2168
|
+
function _t(e) {
|
|
2169
|
+
return !!(xe(e) && e.effect);
|
|
2109
2170
|
}
|
|
2110
|
-
function
|
|
2111
|
-
const { state:
|
|
2171
|
+
function yt(e, o, t, n) {
|
|
2172
|
+
const { state: s, actions: r, getters: i } = o, l = t.state.value[e];
|
|
2112
2173
|
let a;
|
|
2113
2174
|
function u() {
|
|
2114
|
-
!
|
|
2115
|
-
const
|
|
2175
|
+
!l && (process.env.NODE_ENV === "production" || !n) && (t.state.value[e] = s ? s() : {});
|
|
2176
|
+
const p = process.env.NODE_ENV !== "production" && n ? (
|
|
2116
2177
|
// use ref() to unwrap refs inside state TODO: check if this is still necessary
|
|
2117
|
-
at(
|
|
2178
|
+
at(E(s ? s() : {}).value)
|
|
2118
2179
|
) : at(t.state.value[e]);
|
|
2119
|
-
return
|
|
2120
|
-
|
|
2180
|
+
return K(p, r, Object.keys(i || {}).reduce((c, h) => (process.env.NODE_ENV !== "production" && h in p && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${h}" in store "${e}".`), c[h] = de(w(() => {
|
|
2181
|
+
Ce(t);
|
|
2121
2182
|
const m = t._s.get(e);
|
|
2122
|
-
return i[
|
|
2183
|
+
return i[h].call(m, m);
|
|
2123
2184
|
})), c), {}));
|
|
2124
2185
|
}
|
|
2125
|
-
return a =
|
|
2186
|
+
return a = Xe(e, u, o, t, n, !0), a;
|
|
2126
2187
|
}
|
|
2127
|
-
function
|
|
2188
|
+
function Xe(e, o, t = {}, n, s, r) {
|
|
2128
2189
|
let i;
|
|
2129
|
-
const
|
|
2190
|
+
const l = K({ actions: {} }, t);
|
|
2130
2191
|
if (process.env.NODE_ENV !== "production" && !n._e.active)
|
|
2131
2192
|
throw new Error("Pinia destroyed");
|
|
2132
2193
|
const a = {
|
|
2133
2194
|
deep: !0
|
|
2134
2195
|
// flush: 'post',
|
|
2135
2196
|
};
|
|
2136
|
-
process.env.NODE_ENV !== "production" && !
|
|
2137
|
-
u ? m = d : u == !1 && !
|
|
2197
|
+
process.env.NODE_ENV !== "production" && !Wt && (a.onTrigger = (d) => {
|
|
2198
|
+
u ? m = d : u == !1 && !_._hotUpdating && (Array.isArray(m) ? m.push(d) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
|
|
2138
2199
|
});
|
|
2139
|
-
let u,
|
|
2140
|
-
const
|
|
2141
|
-
!r && !
|
|
2142
|
-
const
|
|
2143
|
-
let
|
|
2144
|
-
function
|
|
2200
|
+
let u, p, c = [], h = [], m;
|
|
2201
|
+
const v = n.state.value[e];
|
|
2202
|
+
!r && !v && (process.env.NODE_ENV === "production" || !s) && (n.state.value[e] = {});
|
|
2203
|
+
const I = E({});
|
|
2204
|
+
let V;
|
|
2205
|
+
function T(d) {
|
|
2145
2206
|
let f;
|
|
2146
|
-
u =
|
|
2147
|
-
type:
|
|
2207
|
+
u = p = !1, process.env.NODE_ENV !== "production" && (m = []), typeof d == "function" ? (d(n.state.value[e]), f = {
|
|
2208
|
+
type: ne.patchFunction,
|
|
2148
2209
|
storeId: e,
|
|
2149
2210
|
events: m
|
|
2150
|
-
}) : (
|
|
2151
|
-
type:
|
|
2211
|
+
}) : (Qe(n.state.value[e], d), f = {
|
|
2212
|
+
type: ne.patchObject,
|
|
2152
2213
|
payload: d,
|
|
2153
2214
|
storeId: e,
|
|
2154
2215
|
events: m
|
|
2155
2216
|
});
|
|
2156
|
-
const
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
}),
|
|
2160
|
-
}
|
|
2161
|
-
const
|
|
2162
|
-
const { state: f } = t,
|
|
2163
|
-
this.$patch((
|
|
2164
|
-
|
|
2217
|
+
const x = V = Symbol();
|
|
2218
|
+
te().then(() => {
|
|
2219
|
+
V === x && (u = !0);
|
|
2220
|
+
}), p = !0, be(c, f, n.state.value[e]);
|
|
2221
|
+
}
|
|
2222
|
+
const C = r ? function() {
|
|
2223
|
+
const { state: f } = t, x = f ? f() : {};
|
|
2224
|
+
this.$patch((O) => {
|
|
2225
|
+
K(O, x);
|
|
2165
2226
|
});
|
|
2166
2227
|
} : (
|
|
2167
2228
|
/* istanbul ignore next */
|
|
2168
2229
|
process.env.NODE_ENV !== "production" ? () => {
|
|
2169
2230
|
throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`);
|
|
2170
|
-
} :
|
|
2231
|
+
} : sn
|
|
2171
2232
|
);
|
|
2172
|
-
function
|
|
2173
|
-
i.stop(), c = [],
|
|
2233
|
+
function L() {
|
|
2234
|
+
i.stop(), c = [], h = [], n._s.delete(e);
|
|
2174
2235
|
}
|
|
2175
|
-
function
|
|
2236
|
+
function M(d, f) {
|
|
2176
2237
|
return function() {
|
|
2177
|
-
|
|
2178
|
-
const
|
|
2179
|
-
function
|
|
2180
|
-
|
|
2238
|
+
Ce(n);
|
|
2239
|
+
const x = Array.from(arguments), O = [], D = [];
|
|
2240
|
+
function A(F) {
|
|
2241
|
+
O.push(F);
|
|
2181
2242
|
}
|
|
2182
|
-
function
|
|
2183
|
-
|
|
2243
|
+
function q(F) {
|
|
2244
|
+
D.push(F);
|
|
2184
2245
|
}
|
|
2185
|
-
|
|
2186
|
-
args:
|
|
2246
|
+
be(h, {
|
|
2247
|
+
args: x,
|
|
2187
2248
|
name: d,
|
|
2188
|
-
store:
|
|
2189
|
-
after:
|
|
2190
|
-
onError:
|
|
2249
|
+
store: _,
|
|
2250
|
+
after: A,
|
|
2251
|
+
onError: q
|
|
2191
2252
|
});
|
|
2192
|
-
let
|
|
2253
|
+
let J;
|
|
2193
2254
|
try {
|
|
2194
|
-
|
|
2255
|
+
J = f.apply(this && this.$id === e ? this : _, x);
|
|
2195
2256
|
} catch (F) {
|
|
2196
|
-
throw
|
|
2257
|
+
throw be(D, F), F;
|
|
2197
2258
|
}
|
|
2198
|
-
return
|
|
2259
|
+
return J instanceof Promise ? J.then((F) => (be(O, F), F)).catch((F) => (be(D, F), Promise.reject(F))) : (be(O, J), J);
|
|
2199
2260
|
};
|
|
2200
2261
|
}
|
|
2201
|
-
const
|
|
2262
|
+
const y = /* @__PURE__ */ de({
|
|
2202
2263
|
actions: {},
|
|
2203
2264
|
getters: {},
|
|
2204
2265
|
state: [],
|
|
2205
|
-
hotState:
|
|
2206
|
-
}),
|
|
2266
|
+
hotState: I
|
|
2267
|
+
}), R = {
|
|
2207
2268
|
_p: n,
|
|
2208
2269
|
// _s: scope,
|
|
2209
2270
|
$id: e,
|
|
2210
|
-
$onAction: bt.bind(null,
|
|
2211
|
-
$patch:
|
|
2212
|
-
$reset:
|
|
2271
|
+
$onAction: bt.bind(null, h),
|
|
2272
|
+
$patch: T,
|
|
2273
|
+
$reset: C,
|
|
2213
2274
|
$subscribe(d, f = {}) {
|
|
2214
|
-
const
|
|
2215
|
-
(f.flush === "sync" ?
|
|
2275
|
+
const x = bt(c, d, f.detached, () => O()), O = i.run(() => j(() => n.state.value[e], (D) => {
|
|
2276
|
+
(f.flush === "sync" ? p : u) && d({
|
|
2216
2277
|
storeId: e,
|
|
2217
|
-
type:
|
|
2278
|
+
type: ne.direct,
|
|
2218
2279
|
events: m
|
|
2219
|
-
},
|
|
2220
|
-
},
|
|
2221
|
-
return
|
|
2280
|
+
}, D);
|
|
2281
|
+
}, K({}, a, f)));
|
|
2282
|
+
return x;
|
|
2222
2283
|
},
|
|
2223
|
-
$dispose:
|
|
2224
|
-
},
|
|
2284
|
+
$dispose: L
|
|
2285
|
+
}, _ = Ot(process.env.NODE_ENV !== "production" || Ee ? K(
|
|
2225
2286
|
{
|
|
2226
|
-
_hmrPayload:
|
|
2227
|
-
_customProperties:
|
|
2287
|
+
_hmrPayload: y,
|
|
2288
|
+
_customProperties: de(/* @__PURE__ */ new Set())
|
|
2228
2289
|
// devtools custom properties
|
|
2229
2290
|
},
|
|
2230
|
-
|
|
2291
|
+
R
|
|
2231
2292
|
// must be added later
|
|
2232
2293
|
// setupStore
|
|
2233
|
-
) :
|
|
2234
|
-
n._s.set(e,
|
|
2235
|
-
const
|
|
2236
|
-
for (const d in
|
|
2237
|
-
const f =
|
|
2238
|
-
if (
|
|
2239
|
-
process.env.NODE_ENV !== "production" &&
|
|
2294
|
+
) : R);
|
|
2295
|
+
n._s.set(e, _);
|
|
2296
|
+
const k = (n._a && n._a.runWithContext || fs)(() => n._e.run(() => (i = $t()).run(o)));
|
|
2297
|
+
for (const d in k) {
|
|
2298
|
+
const f = k[d];
|
|
2299
|
+
if (xe(f) && !_t(f) || tt(f))
|
|
2300
|
+
process.env.NODE_ENV !== "production" && s ? Ne(I.value, d, We(k, d)) : r || (v && vs(f) && (xe(f) ? f.value = v[d] : Qe(f, v[d])), n.state.value[e][d] = f), process.env.NODE_ENV !== "production" && y.state.push(d);
|
|
2240
2301
|
else if (typeof f == "function") {
|
|
2241
|
-
const
|
|
2242
|
-
|
|
2243
|
-
} else process.env.NODE_ENV !== "production" &&
|
|
2302
|
+
const x = process.env.NODE_ENV !== "production" && s ? f : M(d, f);
|
|
2303
|
+
k[d] = x, process.env.NODE_ENV !== "production" && (y.actions[d] = f), l.actions[d] = f;
|
|
2304
|
+
} else process.env.NODE_ENV !== "production" && _t(f) && (y.getters[d] = r ? (
|
|
2244
2305
|
// @ts-expect-error
|
|
2245
2306
|
t.getters[d]
|
|
2246
|
-
) : f,
|
|
2247
|
-
(
|
|
2307
|
+
) : f, Be && (k._getters || // @ts-expect-error: same
|
|
2308
|
+
(k._getters = de([]))).push(d));
|
|
2248
2309
|
}
|
|
2249
|
-
if (
|
|
2250
|
-
get: () => process.env.NODE_ENV !== "production" &&
|
|
2310
|
+
if (K(_, k), K(Y(_), k), Object.defineProperty(_, "$state", {
|
|
2311
|
+
get: () => process.env.NODE_ENV !== "production" && s ? I.value : n.state.value[e],
|
|
2251
2312
|
set: (d) => {
|
|
2252
|
-
if (process.env.NODE_ENV !== "production" &&
|
|
2313
|
+
if (process.env.NODE_ENV !== "production" && s)
|
|
2253
2314
|
throw new Error("cannot set hotState");
|
|
2254
|
-
|
|
2255
|
-
|
|
2315
|
+
T((f) => {
|
|
2316
|
+
K(f, d);
|
|
2256
2317
|
});
|
|
2257
2318
|
}
|
|
2258
|
-
}), process.env.NODE_ENV !== "production" && (
|
|
2259
|
-
|
|
2260
|
-
if (f in
|
|
2261
|
-
const
|
|
2262
|
-
typeof
|
|
2319
|
+
}), process.env.NODE_ENV !== "production" && (_._hotUpdate = de((d) => {
|
|
2320
|
+
_._hotUpdating = !0, d._hmrPayload.state.forEach((f) => {
|
|
2321
|
+
if (f in _.$state) {
|
|
2322
|
+
const x = d.$state[f], O = _.$state[f];
|
|
2323
|
+
typeof x == "object" && fe(x) && fe(O) ? on(x, O) : d.$state[f] = O;
|
|
2263
2324
|
}
|
|
2264
|
-
|
|
2265
|
-
}), Object.keys(
|
|
2266
|
-
f in d.$state ||
|
|
2267
|
-
}), u = !1,
|
|
2325
|
+
Ne(_, f, We(d.$state, f));
|
|
2326
|
+
}), Object.keys(_.$state).forEach((f) => {
|
|
2327
|
+
f in d.$state || Je(_, f);
|
|
2328
|
+
}), u = !1, p = !1, n.state.value[e] = We(d._hmrPayload, "hotState"), p = !0, te().then(() => {
|
|
2268
2329
|
u = !0;
|
|
2269
2330
|
});
|
|
2270
2331
|
for (const f in d._hmrPayload.actions) {
|
|
2271
|
-
const
|
|
2272
|
-
|
|
2332
|
+
const x = d[f];
|
|
2333
|
+
Ne(_, f, M(f, x));
|
|
2273
2334
|
}
|
|
2274
2335
|
for (const f in d._hmrPayload.getters) {
|
|
2275
|
-
const
|
|
2336
|
+
const x = d._hmrPayload.getters[f], O = r ? (
|
|
2276
2337
|
// special handling of options api
|
|
2277
|
-
|
|
2278
|
-
) :
|
|
2279
|
-
|
|
2338
|
+
w(() => (Ce(n), x.call(_, _)))
|
|
2339
|
+
) : x;
|
|
2340
|
+
Ne(_, f, O);
|
|
2280
2341
|
}
|
|
2281
|
-
Object.keys(
|
|
2282
|
-
f in d._hmrPayload.getters ||
|
|
2283
|
-
}), Object.keys(
|
|
2284
|
-
f in d._hmrPayload.actions ||
|
|
2285
|
-
}),
|
|
2286
|
-
})),
|
|
2342
|
+
Object.keys(_._hmrPayload.getters).forEach((f) => {
|
|
2343
|
+
f in d._hmrPayload.getters || Je(_, f);
|
|
2344
|
+
}), Object.keys(_._hmrPayload.actions).forEach((f) => {
|
|
2345
|
+
f in d._hmrPayload.actions || Je(_, f);
|
|
2346
|
+
}), _._hmrPayload = d._hmrPayload, _._getters = d._getters, _._hotUpdating = !1;
|
|
2347
|
+
})), Ee) {
|
|
2287
2348
|
const d = {
|
|
2288
2349
|
writable: !0,
|
|
2289
2350
|
configurable: !0,
|
|
@@ -2291,67 +2352,67 @@ function Ke(e, o, t = {}, n, l, r) {
|
|
|
2291
2352
|
enumerable: !1
|
|
2292
2353
|
};
|
|
2293
2354
|
["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((f) => {
|
|
2294
|
-
Object.defineProperty(
|
|
2355
|
+
Object.defineProperty(_, f, K({ value: _[f] }, d));
|
|
2295
2356
|
});
|
|
2296
2357
|
}
|
|
2297
2358
|
return n._p.forEach((d) => {
|
|
2298
|
-
if (
|
|
2359
|
+
if (Ee) {
|
|
2299
2360
|
const f = i.run(() => d({
|
|
2300
|
-
store:
|
|
2361
|
+
store: _,
|
|
2301
2362
|
app: n._a,
|
|
2302
2363
|
pinia: n,
|
|
2303
|
-
options:
|
|
2364
|
+
options: l
|
|
2304
2365
|
}));
|
|
2305
|
-
Object.keys(f || {}).forEach((
|
|
2366
|
+
Object.keys(f || {}).forEach((x) => _._customProperties.add(x)), K(_, f);
|
|
2306
2367
|
} else
|
|
2307
|
-
|
|
2308
|
-
store:
|
|
2368
|
+
K(_, i.run(() => d({
|
|
2369
|
+
store: _,
|
|
2309
2370
|
app: n._a,
|
|
2310
2371
|
pinia: n,
|
|
2311
|
-
options:
|
|
2372
|
+
options: l
|
|
2312
2373
|
})));
|
|
2313
|
-
}), process.env.NODE_ENV !== "production" &&
|
|
2374
|
+
}), process.env.NODE_ENV !== "production" && _.$state && typeof _.$state == "object" && typeof _.$state.constructor == "function" && !_.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
|
|
2314
2375
|
state: () => new MyClass()
|
|
2315
|
-
Found in store "${
|
|
2376
|
+
Found in store "${_.$id}".`), v && r && t.hydrate && t.hydrate(_.$state, v), u = !0, p = !0, _;
|
|
2316
2377
|
}
|
|
2317
|
-
function
|
|
2318
|
-
let n,
|
|
2378
|
+
function rt(e, o, t) {
|
|
2379
|
+
let n, s;
|
|
2319
2380
|
const r = typeof o == "function";
|
|
2320
2381
|
if (typeof e == "string")
|
|
2321
|
-
n = e,
|
|
2322
|
-
else if (
|
|
2382
|
+
n = e, s = r ? t : o;
|
|
2383
|
+
else if (s = e, n = e.id, process.env.NODE_ENV !== "production" && typeof n != "string")
|
|
2323
2384
|
throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');
|
|
2324
|
-
function i(
|
|
2325
|
-
const u =
|
|
2326
|
-
if (
|
|
2385
|
+
function i(l, a) {
|
|
2386
|
+
const u = pn();
|
|
2387
|
+
if (l = // in test mode, ignore the argument provided as we can always retrieve a
|
|
2327
2388
|
// pinia instance with getActivePinia()
|
|
2328
|
-
(process.env.NODE_ENV === "test" &&
|
|
2389
|
+
(process.env.NODE_ENV === "test" && Se && Se._testing ? null : l) || (u ? Te(Jt, null) : null), l && Ce(l), process.env.NODE_ENV !== "production" && !Se)
|
|
2329
2390
|
throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
2330
2391
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
2331
2392
|
This will fail in production.`);
|
|
2332
|
-
|
|
2333
|
-
const
|
|
2393
|
+
l = Se, l._s.has(n) || (r ? Xe(n, o, s, l) : yt(n, s, l), process.env.NODE_ENV !== "production" && (i._pinia = l));
|
|
2394
|
+
const p = l._s.get(n);
|
|
2334
2395
|
if (process.env.NODE_ENV !== "production" && a) {
|
|
2335
|
-
const c = "__hot:" + n,
|
|
2336
|
-
a._hotUpdate(
|
|
2396
|
+
const c = "__hot:" + n, h = r ? Xe(c, o, s, l, !0) : yt(c, K({}, s), l, !0);
|
|
2397
|
+
a._hotUpdate(h), delete l.state.value[c], l._s.delete(c);
|
|
2337
2398
|
}
|
|
2338
|
-
if (process.env.NODE_ENV !== "production" &&
|
|
2339
|
-
const c =
|
|
2399
|
+
if (process.env.NODE_ENV !== "production" && Be) {
|
|
2400
|
+
const c = It();
|
|
2340
2401
|
if (c && c.proxy && // avoid adding stores that are just built for hot module replacement
|
|
2341
2402
|
!a) {
|
|
2342
|
-
const
|
|
2343
|
-
m[n] =
|
|
2403
|
+
const h = c.proxy, m = "_pStores" in h ? h._pStores : h._pStores = {};
|
|
2404
|
+
m[n] = p;
|
|
2344
2405
|
}
|
|
2345
2406
|
}
|
|
2346
|
-
return
|
|
2407
|
+
return p;
|
|
2347
2408
|
}
|
|
2348
2409
|
return i.$id = n, i;
|
|
2349
2410
|
}
|
|
2350
|
-
const
|
|
2351
|
-
const e =
|
|
2411
|
+
const ze = rt("language", () => {
|
|
2412
|
+
const e = E("auto"), o = E("en"), t = E({
|
|
2352
2413
|
src: [],
|
|
2353
2414
|
target: []
|
|
2354
|
-
}), n =
|
|
2415
|
+
}), n = w(() => t.value.src[e.value]), s = w(() => t.value.target[o.value]);
|
|
2355
2416
|
function r(a, u) {
|
|
2356
2417
|
e.value = a == null ? void 0 : a.src, o.value = a == null ? void 0 : a.target, t.value = u;
|
|
2357
2418
|
}
|
|
@@ -2360,118 +2421,110 @@ const st = lt("language", () => {
|
|
|
2360
2421
|
const a = e.value;
|
|
2361
2422
|
e.value = o.value, o.value = a;
|
|
2362
2423
|
}
|
|
2363
|
-
function
|
|
2424
|
+
function l(a) {
|
|
2364
2425
|
return t.value.src[a] || t.value.target[a];
|
|
2365
2426
|
}
|
|
2366
|
-
return { languages: t, src: e, target: o, srcLabel: n, targetLabel:
|
|
2367
|
-
}),
|
|
2427
|
+
return { languages: t, src: e, target: o, srcLabel: n, targetLabel: s, init: r, swap: i, getLabel: l };
|
|
2428
|
+
}), hs = {
|
|
2368
2429
|
key: 0,
|
|
2369
|
-
class: "flex
|
|
2370
|
-
},
|
|
2430
|
+
class: "flex"
|
|
2431
|
+
}, ms = {
|
|
2371
2432
|
__name: "Selects",
|
|
2372
2433
|
setup(e) {
|
|
2373
|
-
const o =
|
|
2434
|
+
const o = ze();
|
|
2374
2435
|
function t() {
|
|
2375
2436
|
o.swap();
|
|
2376
2437
|
}
|
|
2377
|
-
return (n,
|
|
2378
|
-
|
|
2379
|
-
modelValue:
|
|
2380
|
-
"onUpdate:modelValue":
|
|
2381
|
-
languages:
|
|
2438
|
+
return (n, s) => P(o).languages ? (S(), $("div", hs, [
|
|
2439
|
+
z(ht, {
|
|
2440
|
+
modelValue: P(o).src,
|
|
2441
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => P(o).src = r),
|
|
2442
|
+
languages: P(o).languages.src,
|
|
2382
2443
|
class: "grow"
|
|
2383
2444
|
}, null, 8, ["modelValue", "languages"]),
|
|
2384
|
-
|
|
2385
|
-
isBidirect:
|
|
2386
|
-
class: "grow-0",
|
|
2445
|
+
z(Fo, {
|
|
2446
|
+
isBidirect: P(o).src !== "auto",
|
|
2447
|
+
class: "grow-0 mx-3",
|
|
2387
2448
|
onSwap: t
|
|
2388
2449
|
}, null, 8, ["isBidirect"]),
|
|
2389
|
-
|
|
2390
|
-
modelValue:
|
|
2391
|
-
"onUpdate:modelValue":
|
|
2392
|
-
languages:
|
|
2450
|
+
z(ht, {
|
|
2451
|
+
modelValue: P(o).target,
|
|
2452
|
+
"onUpdate:modelValue": s[1] || (s[1] = (r) => P(o).target = r),
|
|
2453
|
+
languages: P(o).languages.target,
|
|
2393
2454
|
class: "grow"
|
|
2394
2455
|
}, null, 8, ["modelValue", "languages"])
|
|
2395
|
-
])) :
|
|
2456
|
+
])) : X("", !0);
|
|
2396
2457
|
}
|
|
2397
|
-
},
|
|
2458
|
+
}, gs = {
|
|
2398
2459
|
INPUT_MAX_LENGTH: 5e3,
|
|
2399
2460
|
INPUT_DEBOUNCE: 500
|
|
2400
|
-
},
|
|
2461
|
+
}, Ue = (e, o) => {
|
|
2401
2462
|
const t = e.__vccOpts || e;
|
|
2402
|
-
for (const [n,
|
|
2403
|
-
t[n] =
|
|
2463
|
+
for (const [n, s] of o)
|
|
2464
|
+
t[n] = s;
|
|
2404
2465
|
return t;
|
|
2405
|
-
},
|
|
2406
|
-
function
|
|
2407
|
-
return
|
|
2408
|
-
}
|
|
2409
|
-
const
|
|
2410
|
-
function
|
|
2411
|
-
const a =
|
|
2412
|
-
function
|
|
2413
|
-
var
|
|
2414
|
-
typeof i == "function" && i.call(this),
|
|
2415
|
-
}
|
|
2416
|
-
return
|
|
2417
|
-
const
|
|
2418
|
-
a.value =
|
|
2419
|
-
src:
|
|
2420
|
-
volume:
|
|
2421
|
-
rate:
|
|
2422
|
-
onload:
|
|
2423
|
-
...
|
|
2466
|
+
}, bs = {}, _s = { class: "mr-2 loading loading-dots loading-xs" };
|
|
2467
|
+
function ys(e, o) {
|
|
2468
|
+
return S(), $("span", _s);
|
|
2469
|
+
}
|
|
2470
|
+
const xs = /* @__PURE__ */ Ue(bs, [["render", ys]]), ws = "/assets/icons/volume.svg", Ss = "/assets/icons/volume-stop.svg";
|
|
2471
|
+
function Es(e, { volume: o = 1, playbackRate: t = 1, soundEnabled: n = !0, interrupt: s = !1, autoplay: r = !1, onload: i, ...l } = {}) {
|
|
2472
|
+
const a = E(null), u = E(!1), p = E(null), c = E(null);
|
|
2473
|
+
function h() {
|
|
2474
|
+
var T;
|
|
2475
|
+
typeof i == "function" && i.call(this), p.value = (p.value || ((T = c.value) == null ? void 0 : T.duration()) || 0) * 1e3, r === !0 && (u.value = !0);
|
|
2476
|
+
}
|
|
2477
|
+
return pe(async () => {
|
|
2478
|
+
const T = await import("./howler-DJIW9wc6.js").then((C) => C.h);
|
|
2479
|
+
a.value = T.default.Howl, c.value = new a.value({
|
|
2480
|
+
src: P(e),
|
|
2481
|
+
volume: P(o),
|
|
2482
|
+
rate: P(t),
|
|
2483
|
+
onload: h,
|
|
2484
|
+
...l
|
|
2424
2485
|
});
|
|
2425
2486
|
}), j(
|
|
2426
2487
|
() => [e],
|
|
2427
2488
|
() => {
|
|
2428
2489
|
a.value && a.value && c && c.value && (c.value = new a.value({
|
|
2429
|
-
src:
|
|
2430
|
-
volume:
|
|
2431
|
-
rate:
|
|
2432
|
-
onload:
|
|
2433
|
-
...
|
|
2490
|
+
src: P(e),
|
|
2491
|
+
volume: P(o),
|
|
2492
|
+
rate: P(t),
|
|
2493
|
+
onload: h,
|
|
2494
|
+
...l
|
|
2434
2495
|
}));
|
|
2435
2496
|
}
|
|
2436
2497
|
), j(
|
|
2437
|
-
() => [
|
|
2498
|
+
() => [P(o), P(t)],
|
|
2438
2499
|
() => {
|
|
2439
|
-
c.value && (c.value.volume(
|
|
2500
|
+
c.value && (c.value.volume(P(o)), c.value.rate(P(t)));
|
|
2440
2501
|
}
|
|
2441
2502
|
), {
|
|
2442
|
-
play: (
|
|
2443
|
-
typeof
|
|
2503
|
+
play: (T) => {
|
|
2504
|
+
typeof T > "u" && (T = {}), !(!c.value || !n && !T.forceSoundEnabled) && (s && c.value.stop(), T.playbackRate && c.value.rate(T.playbackRate), c.value.play(T.id), c.value.once("end", () => {
|
|
2444
2505
|
c.value && c.value && !c.value.playing() && (u.value = !1);
|
|
2445
2506
|
}), u.value = !0);
|
|
2446
2507
|
},
|
|
2447
2508
|
sound: c,
|
|
2448
2509
|
isPlaying: u,
|
|
2449
|
-
duration:
|
|
2450
|
-
pause: (
|
|
2451
|
-
c.value && (c.value.pause(typeof
|
|
2510
|
+
duration: p,
|
|
2511
|
+
pause: (T) => {
|
|
2512
|
+
c.value && (c.value.pause(typeof T == "number" ? T : void 0), u.value = !1);
|
|
2452
2513
|
},
|
|
2453
|
-
stop: (
|
|
2454
|
-
c.value && (c.value.stop(typeof
|
|
2514
|
+
stop: (T) => {
|
|
2515
|
+
c.value && (c.value.stop(typeof T == "number" ? T : void 0), u.value = !1);
|
|
2455
2516
|
}
|
|
2456
2517
|
};
|
|
2457
2518
|
}
|
|
2458
|
-
const
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
},
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
viewBox: "0 0 24 24"
|
|
2468
|
-
}, [
|
|
2469
|
-
/* @__PURE__ */ I("path", {
|
|
2470
|
-
"fill-rule": "evenodd",
|
|
2471
|
-
d: "M4.5 7.5a3 3 0 0 1 3-3h9a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3h-9a3 3 0 0 1-3-3v-9Z",
|
|
2472
|
-
"clip-rule": "evenodd"
|
|
2473
|
-
})
|
|
2474
|
-
], -1), il = {
|
|
2519
|
+
const Os = {
|
|
2520
|
+
key: 0,
|
|
2521
|
+
src: ws,
|
|
2522
|
+
alt: "Play"
|
|
2523
|
+
}, $s = {
|
|
2524
|
+
key: 1,
|
|
2525
|
+
src: Ss,
|
|
2526
|
+
alt: "Stop"
|
|
2527
|
+
}, Is = {
|
|
2475
2528
|
__name: "SpeakBtn",
|
|
2476
2529
|
props: {
|
|
2477
2530
|
url: {
|
|
@@ -2480,59 +2533,62 @@ const ll = { class: "swap" }, sl = /* @__PURE__ */ I("svg", {
|
|
|
2480
2533
|
}
|
|
2481
2534
|
},
|
|
2482
2535
|
setup(e) {
|
|
2483
|
-
const o = e, { play: t, stop: n, isPlaying:
|
|
2536
|
+
const o = e, { play: t, stop: n, isPlaying: s } = Es(o.url), r = E(!1);
|
|
2484
2537
|
j(
|
|
2485
|
-
() =>
|
|
2486
|
-
(
|
|
2487
|
-
r.value =
|
|
2538
|
+
() => s.value,
|
|
2539
|
+
(l) => {
|
|
2540
|
+
r.value = l;
|
|
2488
2541
|
}
|
|
2489
2542
|
);
|
|
2490
2543
|
function i() {
|
|
2491
|
-
if (
|
|
2544
|
+
if (s.value) {
|
|
2492
2545
|
n();
|
|
2493
2546
|
return;
|
|
2494
2547
|
}
|
|
2495
2548
|
t();
|
|
2496
2549
|
}
|
|
2497
|
-
return (
|
|
2550
|
+
return (l, a) => (S(), $("button", {
|
|
2498
2551
|
class: "btn btn-xs btn-ghost btn-circle",
|
|
2499
|
-
onClick:
|
|
2552
|
+
onClick: vn(i, ["prevent"])
|
|
2500
2553
|
}, [
|
|
2501
|
-
|
|
2502
|
-
Xe(I("input", {
|
|
2503
|
-
"onUpdate:modelValue": a[0] || (a[0] = (u) => r.value = u),
|
|
2504
|
-
type: "checkbox"
|
|
2505
|
-
}, null, 512), [
|
|
2506
|
-
[vn, r.value]
|
|
2507
|
-
]),
|
|
2508
|
-
sl,
|
|
2509
|
-
rl
|
|
2510
|
-
])
|
|
2554
|
+
P(s) ? (S(), $("img", $s)) : (S(), $("img", Os))
|
|
2511
2555
|
]));
|
|
2512
2556
|
}
|
|
2513
|
-
},
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
class: "w-5 h-5"
|
|
2520
|
-
}, [
|
|
2521
|
-
/* @__PURE__ */ I("path", {
|
|
2522
|
-
"stroke-linecap": "round",
|
|
2523
|
-
"stroke-linejoin": "round",
|
|
2524
|
-
d: "m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"
|
|
2525
|
-
})
|
|
2526
|
-
], -1), cl = [
|
|
2527
|
-
ul
|
|
2557
|
+
}, Cs = "/assets/icons/cancel.svg", Ts = {}, Ps = { class: "btn btn-xs btn-circle btn-ghost" }, ks = /* @__PURE__ */ g("img", {
|
|
2558
|
+
src: Cs,
|
|
2559
|
+
alt: "Clear",
|
|
2560
|
+
class: "w-4"
|
|
2561
|
+
}, null, -1), Rs = [
|
|
2562
|
+
ks
|
|
2528
2563
|
];
|
|
2529
|
-
function
|
|
2530
|
-
return
|
|
2531
|
-
class: "btn btn-xs btn-ghost btn-circle p-0",
|
|
2532
|
-
onClick: o[0] || (o[0] = (...t) => e.onClick && e.onClick(...t))
|
|
2533
|
-
}, cl);
|
|
2564
|
+
function Ns(e, o) {
|
|
2565
|
+
return S(), $("button", Ps, Rs);
|
|
2534
2566
|
}
|
|
2535
|
-
const
|
|
2567
|
+
const Ds = /* @__PURE__ */ Ue(Ts, [["render", Ns]]), Ls = "/assets/icons/favorite-filled.svg", Vs = "/assets/icons/favorite.svg", As = { class: "btn btn-xs btn-circle btn-ghost" }, Ms = {
|
|
2568
|
+
key: 0,
|
|
2569
|
+
src: Ls,
|
|
2570
|
+
alt: "Clear",
|
|
2571
|
+
class: "w-4"
|
|
2572
|
+
}, js = {
|
|
2573
|
+
key: 1,
|
|
2574
|
+
src: Vs,
|
|
2575
|
+
alt: "Clear",
|
|
2576
|
+
class: "w-4"
|
|
2577
|
+
}, Fs = {
|
|
2578
|
+
__name: "FavoriteBtn",
|
|
2579
|
+
props: {
|
|
2580
|
+
isFilled: Boolean
|
|
2581
|
+
},
|
|
2582
|
+
setup(e) {
|
|
2583
|
+
const o = e;
|
|
2584
|
+
return (t, n) => (S(), $("button", As, [
|
|
2585
|
+
o.isFilled ? (S(), $("img", Ms)) : (S(), $("img", js))
|
|
2586
|
+
]));
|
|
2587
|
+
}
|
|
2588
|
+
}, Bs = { class: "flex flex-row rounded-t-lg bg-white border border-b-0 px-1 pr-1 pt-1 gap-1 items-center" }, zs = { class: "text-sm text-gray-600" }, Us = {
|
|
2589
|
+
key: 0,
|
|
2590
|
+
class: "italic"
|
|
2591
|
+
}, Hs = /* @__PURE__ */ g("div", { class: "flex-grow" }, null, -1), ln = {
|
|
2536
2592
|
__name: "TranslationBtnGroup",
|
|
2537
2593
|
props: {
|
|
2538
2594
|
loading: {
|
|
@@ -2558,163 +2614,182 @@ const fl = /* @__PURE__ */ ze(al, [["render", dl]]), vl = { class: "flex flex-ro
|
|
|
2558
2614
|
isClearBtn: {
|
|
2559
2615
|
type: Boolean,
|
|
2560
2616
|
default: !1
|
|
2617
|
+
},
|
|
2618
|
+
isFavoriteBtn: {
|
|
2619
|
+
type: Boolean,
|
|
2620
|
+
default: !1
|
|
2621
|
+
},
|
|
2622
|
+
isFavorite: {
|
|
2623
|
+
type: Boolean,
|
|
2624
|
+
default: !1
|
|
2625
|
+
},
|
|
2626
|
+
onFavorite: {
|
|
2627
|
+
type: Function,
|
|
2628
|
+
default: () => {
|
|
2629
|
+
}
|
|
2561
2630
|
}
|
|
2562
2631
|
},
|
|
2563
|
-
emits: ["clear"],
|
|
2632
|
+
emits: ["clear", "favorite"],
|
|
2564
2633
|
setup(e, { emit: o }) {
|
|
2565
2634
|
const t = e, n = o;
|
|
2566
|
-
return (
|
|
2567
|
-
t.tts ? (
|
|
2635
|
+
return (s, r) => (S(), $("div", Bs, [
|
|
2636
|
+
t.tts ? (S(), Z(Is, {
|
|
2568
2637
|
key: 0,
|
|
2569
2638
|
url: t.tts
|
|
2570
|
-
}, null, 8, ["url"])) :
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
e.phonetic ? (
|
|
2639
|
+
}, null, 8, ["url"])) : X("", !0),
|
|
2640
|
+
g("div", zs, [
|
|
2641
|
+
hn(ee(e.srcLabel) + " ", 1),
|
|
2642
|
+
e.phonetic ? (S(), $("span", Us, "- [" + ee(t.phonetic) + "]", 1)) : X("", !0)
|
|
2574
2643
|
]),
|
|
2575
|
-
|
|
2576
|
-
t.loading ? (
|
|
2577
|
-
t.src && t.isClearBtn ? (
|
|
2644
|
+
Hs,
|
|
2645
|
+
t.loading ? (S(), Z(xs, { key: 1 })) : X("", !0),
|
|
2646
|
+
t.src && t.isClearBtn ? (S(), Z(Ds, {
|
|
2578
2647
|
key: 2,
|
|
2579
2648
|
onClick: r[0] || (r[0] = (i) => n("clear"))
|
|
2580
|
-
})) :
|
|
2649
|
+
})) : X("", !0),
|
|
2650
|
+
t.src && t.isFavoriteBtn ? (S(), Z(Fs, {
|
|
2651
|
+
key: 3,
|
|
2652
|
+
isFilled: t.isFavorite,
|
|
2653
|
+
onClick: r[1] || (r[1] = (i) => n("favorite"))
|
|
2654
|
+
}, null, 8, ["isFilled"])) : X("", !0)
|
|
2581
2655
|
]));
|
|
2582
2656
|
}
|
|
2583
|
-
},
|
|
2584
|
-
const e =
|
|
2657
|
+
}, me = rt("translation", () => {
|
|
2658
|
+
const e = E(null), o = E(null), t = E({
|
|
2585
2659
|
src: null,
|
|
2586
2660
|
target: null
|
|
2587
|
-
}), n =
|
|
2661
|
+
}), n = E(null), s = E([]), r = E([]), i = E([]), l = E([]), a = E({
|
|
2588
2662
|
src: null,
|
|
2589
2663
|
target: null
|
|
2590
|
-
}),
|
|
2591
|
-
function
|
|
2592
|
-
e.value =
|
|
2664
|
+
}), u = ze(), p = w(() => u.getLabel(e.value)), c = w(() => u.getLabel(o.value));
|
|
2665
|
+
function h(v) {
|
|
2666
|
+
e.value = v.src, o.value = v.target, t.value = v.phonetic, n.value = v.result, s.value = v.dictionary, r.value = v.definitions, i.value = v.synonyms, l.value = v.examples, a.value = v.tts;
|
|
2593
2667
|
}
|
|
2594
|
-
function
|
|
2668
|
+
function m() {
|
|
2595
2669
|
e.value = null, o.value = null, t.value = {
|
|
2596
2670
|
src: null,
|
|
2597
2671
|
target: null
|
|
2598
|
-
}, n.value = null,
|
|
2672
|
+
}, n.value = null, s.value = [], r.value = [], i.value = [], l.value = [], a.value = {
|
|
2599
2673
|
src: null,
|
|
2600
2674
|
target: null
|
|
2601
2675
|
};
|
|
2602
2676
|
}
|
|
2603
2677
|
return {
|
|
2604
2678
|
src: e,
|
|
2605
|
-
srcLabel:
|
|
2679
|
+
srcLabel: p,
|
|
2606
2680
|
target: o,
|
|
2607
|
-
targetLabel:
|
|
2681
|
+
targetLabel: c,
|
|
2608
2682
|
phonetic: t,
|
|
2609
2683
|
result: n,
|
|
2610
|
-
dictionary:
|
|
2684
|
+
dictionary: s,
|
|
2611
2685
|
definitions: r,
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2686
|
+
synonyms: i,
|
|
2687
|
+
examples: l,
|
|
2688
|
+
tts: a,
|
|
2689
|
+
init: h,
|
|
2690
|
+
reset: m
|
|
2616
2691
|
};
|
|
2617
2692
|
});
|
|
2618
|
-
function
|
|
2619
|
-
return Ct() ? (
|
|
2693
|
+
function Ws(e) {
|
|
2694
|
+
return Ct() ? (Ze(e), !0) : !1;
|
|
2620
2695
|
}
|
|
2621
|
-
function
|
|
2622
|
-
return typeof e == "function" ? e() :
|
|
2696
|
+
function je(e) {
|
|
2697
|
+
return typeof e == "function" ? e() : P(e);
|
|
2623
2698
|
}
|
|
2624
|
-
const
|
|
2699
|
+
const Gs = typeof window < "u" && typeof document < "u";
|
|
2625
2700
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
2626
|
-
const
|
|
2701
|
+
const xt = () => {
|
|
2627
2702
|
};
|
|
2628
|
-
function
|
|
2703
|
+
function qs(e, o) {
|
|
2629
2704
|
function t(...n) {
|
|
2630
|
-
return new Promise((
|
|
2631
|
-
Promise.resolve(e(() => o.apply(this, n), { fn: o, thisArg: this, args: n })).then(
|
|
2705
|
+
return new Promise((s, r) => {
|
|
2706
|
+
Promise.resolve(e(() => o.apply(this, n), { fn: o, thisArg: this, args: n })).then(s).catch(r);
|
|
2632
2707
|
});
|
|
2633
2708
|
}
|
|
2634
2709
|
return t;
|
|
2635
2710
|
}
|
|
2636
|
-
function
|
|
2637
|
-
let t, n,
|
|
2638
|
-
const r = (
|
|
2639
|
-
clearTimeout(
|
|
2711
|
+
function Js(e, o = {}) {
|
|
2712
|
+
let t, n, s = xt;
|
|
2713
|
+
const r = (l) => {
|
|
2714
|
+
clearTimeout(l), s(), s = xt;
|
|
2640
2715
|
};
|
|
2641
|
-
return (
|
|
2642
|
-
const a =
|
|
2643
|
-
return t && r(t), a <= 0 || u !== void 0 && u <= 0 ? (n && (r(n), n = null), Promise.resolve(
|
|
2644
|
-
|
|
2645
|
-
t && r(t), n = null,
|
|
2716
|
+
return (l) => {
|
|
2717
|
+
const a = je(e), u = je(o.maxWait);
|
|
2718
|
+
return t && r(t), a <= 0 || u !== void 0 && u <= 0 ? (n && (r(n), n = null), Promise.resolve(l())) : new Promise((p, c) => {
|
|
2719
|
+
s = o.rejectOnCancel ? c : p, u && !n && (n = setTimeout(() => {
|
|
2720
|
+
t && r(t), n = null, p(l());
|
|
2646
2721
|
}, u)), t = setTimeout(() => {
|
|
2647
|
-
n && r(n), n = null,
|
|
2722
|
+
n && r(n), n = null, p(l());
|
|
2648
2723
|
}, a);
|
|
2649
2724
|
});
|
|
2650
2725
|
};
|
|
2651
2726
|
}
|
|
2652
|
-
function
|
|
2653
|
-
return
|
|
2654
|
-
|
|
2727
|
+
function Ks(e, o = 200, t = {}) {
|
|
2728
|
+
return qs(
|
|
2729
|
+
Js(o, t),
|
|
2655
2730
|
e
|
|
2656
2731
|
);
|
|
2657
2732
|
}
|
|
2658
|
-
function
|
|
2733
|
+
function wt(e) {
|
|
2659
2734
|
var o;
|
|
2660
|
-
const t =
|
|
2735
|
+
const t = je(e);
|
|
2661
2736
|
return (o = t == null ? void 0 : t.$el) != null ? o : t;
|
|
2662
2737
|
}
|
|
2663
|
-
const
|
|
2664
|
-
function
|
|
2665
|
-
const e =
|
|
2666
|
-
return o &&
|
|
2738
|
+
const Ys = Gs ? window : void 0;
|
|
2739
|
+
function Qs() {
|
|
2740
|
+
const e = E(!1), o = It();
|
|
2741
|
+
return o && pe(() => {
|
|
2667
2742
|
e.value = !0;
|
|
2668
2743
|
}, o), e;
|
|
2669
2744
|
}
|
|
2670
|
-
function
|
|
2671
|
-
const o =
|
|
2672
|
-
return
|
|
2745
|
+
function Xs(e) {
|
|
2746
|
+
const o = Qs();
|
|
2747
|
+
return w(() => (o.value, !!e()));
|
|
2673
2748
|
}
|
|
2674
|
-
function
|
|
2675
|
-
const { window: n =
|
|
2749
|
+
function Zs(e, o, t = {}) {
|
|
2750
|
+
const { window: n = Ys, ...s } = t;
|
|
2676
2751
|
let r;
|
|
2677
|
-
const i =
|
|
2752
|
+
const i = Xs(() => n && "ResizeObserver" in n), l = () => {
|
|
2678
2753
|
r && (r.disconnect(), r = void 0);
|
|
2679
|
-
}, a =
|
|
2754
|
+
}, a = w(() => Array.isArray(e) ? e.map((c) => wt(c)) : [wt(e)]), u = j(
|
|
2680
2755
|
a,
|
|
2681
2756
|
(c) => {
|
|
2682
|
-
if (
|
|
2757
|
+
if (l(), i.value && n) {
|
|
2683
2758
|
r = new ResizeObserver(o);
|
|
2684
|
-
for (const
|
|
2685
|
-
|
|
2759
|
+
for (const h of c)
|
|
2760
|
+
h && r.observe(h, s);
|
|
2686
2761
|
}
|
|
2687
2762
|
},
|
|
2688
2763
|
{ immediate: !0, flush: "post" }
|
|
2689
|
-
),
|
|
2690
|
-
|
|
2764
|
+
), p = () => {
|
|
2765
|
+
l(), u();
|
|
2691
2766
|
};
|
|
2692
|
-
return
|
|
2767
|
+
return Ws(p), {
|
|
2693
2768
|
isSupported: i,
|
|
2694
|
-
stop:
|
|
2769
|
+
stop: p
|
|
2695
2770
|
};
|
|
2696
2771
|
}
|
|
2697
|
-
function
|
|
2772
|
+
function rn(e) {
|
|
2698
2773
|
var o;
|
|
2699
|
-
const t =
|
|
2774
|
+
const t = E(e == null ? void 0 : e.element), n = E(e == null ? void 0 : e.input), s = (o = e == null ? void 0 : e.styleProp) != null ? o : "height", r = E(1);
|
|
2700
2775
|
function i() {
|
|
2701
|
-
var
|
|
2776
|
+
var l;
|
|
2702
2777
|
if (!t.value)
|
|
2703
2778
|
return;
|
|
2704
2779
|
let a = "";
|
|
2705
|
-
t.value.style[
|
|
2780
|
+
t.value.style[s] = "1px", r.value = (l = t.value) == null ? void 0 : l.scrollHeight, e != null && e.styleTarget ? je(e.styleTarget).style[s] = `${r.value}px` : a = `${r.value}px`, t.value.style[s] = a;
|
|
2706
2781
|
}
|
|
2707
|
-
return j([n, t], () =>
|
|
2708
|
-
var
|
|
2709
|
-
return (
|
|
2710
|
-
}),
|
|
2782
|
+
return j([n, t], () => te(i), { immediate: !0 }), j(r, () => {
|
|
2783
|
+
var l;
|
|
2784
|
+
return (l = e == null ? void 0 : e.onResize) == null ? void 0 : l.call(e);
|
|
2785
|
+
}), Zs(t, () => i()), e != null && e.watch && j(e.watch, i, { immediate: !0, deep: !0 }), {
|
|
2711
2786
|
textarea: t,
|
|
2712
2787
|
input: n,
|
|
2713
2788
|
triggerResize: i
|
|
2714
2789
|
};
|
|
2715
2790
|
}
|
|
2716
|
-
const
|
|
2717
|
-
__name: "
|
|
2791
|
+
const el = {
|
|
2792
|
+
__name: "TranslationInput",
|
|
2718
2793
|
props: {
|
|
2719
2794
|
text: {
|
|
2720
2795
|
type: String,
|
|
@@ -2723,163 +2798,291 @@ const Il = {
|
|
|
2723
2798
|
},
|
|
2724
2799
|
emits: ["change", "clear"],
|
|
2725
2800
|
setup(e, { emit: o }) {
|
|
2726
|
-
const t =
|
|
2727
|
-
var
|
|
2728
|
-
return (
|
|
2729
|
-
}), a =
|
|
2730
|
-
var
|
|
2731
|
-
return (
|
|
2732
|
-
}), { textarea: u } =
|
|
2733
|
-
|
|
2734
|
-
},
|
|
2735
|
-
function
|
|
2736
|
-
if (!
|
|
2801
|
+
const t = me(), n = e, s = E(n.text), r = w(() => t.src), i = w(() => t.srcLabel), l = w(() => {
|
|
2802
|
+
var v;
|
|
2803
|
+
return (v = t.phonetic) == null ? void 0 : v.src;
|
|
2804
|
+
}), a = w(() => {
|
|
2805
|
+
var v;
|
|
2806
|
+
return (v = t.tts) == null ? void 0 : v.src;
|
|
2807
|
+
}), { textarea: u } = rn({ input: s, styleProp: "minHeight" }), p = o, c = Ks(() => {
|
|
2808
|
+
p("change", s.value);
|
|
2809
|
+
}, gs.INPUT_DEBOUNCE);
|
|
2810
|
+
function h() {
|
|
2811
|
+
if (!s.value) {
|
|
2737
2812
|
m();
|
|
2738
2813
|
return;
|
|
2739
2814
|
}
|
|
2740
2815
|
c();
|
|
2741
2816
|
}
|
|
2742
2817
|
function m() {
|
|
2743
|
-
|
|
2818
|
+
p("clear"), s.value = "", u.value.focus();
|
|
2744
2819
|
}
|
|
2745
|
-
return (
|
|
2746
|
-
|
|
2820
|
+
return j(
|
|
2821
|
+
() => n.text,
|
|
2822
|
+
(v) => {
|
|
2823
|
+
s.value = v;
|
|
2824
|
+
}
|
|
2825
|
+
), (v, I) => (S(), $(G, null, [
|
|
2826
|
+
z(ln, {
|
|
2747
2827
|
src: r.value,
|
|
2748
2828
|
srcLabel: i.value,
|
|
2749
2829
|
tts: a.value,
|
|
2750
|
-
phonetic:
|
|
2830
|
+
phonetic: l.value,
|
|
2751
2831
|
isClearBtn: !0,
|
|
2752
2832
|
onClear: m
|
|
2753
2833
|
}, null, 8, ["src", "srcLabel", "tts", "phonetic"]),
|
|
2754
|
-
|
|
2834
|
+
Tt(g("textarea", {
|
|
2755
2835
|
ref_key: "textarea",
|
|
2756
2836
|
ref: u,
|
|
2757
|
-
"onUpdate:modelValue":
|
|
2758
|
-
class: "w-full border border-t-0
|
|
2837
|
+
"onUpdate:modelValue": I[0] || (I[0] = (V) => s.value = V),
|
|
2838
|
+
class: "w-full border rounded-b-md border-t-0 outline-none outline-0 px-3 pl-5 bg-white text-gray-800 font-semibold resize-none pb-3",
|
|
2759
2839
|
autofocus: "",
|
|
2760
2840
|
rows: "2",
|
|
2761
|
-
onInput:
|
|
2841
|
+
onInput: h
|
|
2762
2842
|
}, null, 544), [
|
|
2763
2843
|
[
|
|
2764
|
-
|
|
2765
|
-
|
|
2844
|
+
Pt,
|
|
2845
|
+
s.value,
|
|
2766
2846
|
void 0,
|
|
2767
2847
|
{ trim: !0 }
|
|
2768
2848
|
]
|
|
2769
2849
|
])
|
|
2770
2850
|
], 64));
|
|
2771
2851
|
}
|
|
2772
|
-
},
|
|
2773
|
-
|
|
2852
|
+
}, tl = /* @__PURE__ */ Ue(el, [["__scopeId", "data-v-ef4399dd"]]), nl = "/assets/icons/google-translate.svg", an = rt("loader", () => ({ loading: E(!1) })), ol = (e) => (mn("data-v-cbd6addc"), e = e(), gn(), e), sl = { class: "flex flex-col" }, ll = /* @__PURE__ */ ol(() => /* @__PURE__ */ g("div", { class: "w-full flex align-item-center justify-end" }, [
|
|
2853
|
+
/* @__PURE__ */ g("span", { class: "text-sm" }, "Powered by Google Translate"),
|
|
2854
|
+
/* @__PURE__ */ g("img", {
|
|
2855
|
+
src: nl,
|
|
2856
|
+
alt: "Google",
|
|
2857
|
+
class: "h-5 ml-2"
|
|
2858
|
+
})
|
|
2859
|
+
], -1)), rl = {
|
|
2860
|
+
__name: "TranslationResult",
|
|
2861
|
+
props: {
|
|
2862
|
+
isFavoriteFeatureEnabled: Boolean
|
|
2863
|
+
},
|
|
2774
2864
|
setup(e) {
|
|
2775
|
-
const o =
|
|
2776
|
-
var
|
|
2777
|
-
return (
|
|
2778
|
-
}),
|
|
2779
|
-
var
|
|
2780
|
-
return (
|
|
2781
|
-
}),
|
|
2782
|
-
return (
|
|
2783
|
-
|
|
2784
|
-
loading:
|
|
2785
|
-
src:
|
|
2786
|
-
srcLabel:
|
|
2787
|
-
tts:
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2865
|
+
const o = me(), t = E(!1), n = w(() => o.result), s = w(() => o.target), r = w(() => o.targetLabel), i = w(() => {
|
|
2866
|
+
var h;
|
|
2867
|
+
return (h = o.phonetic) == null ? void 0 : h.target;
|
|
2868
|
+
}), l = w(() => {
|
|
2869
|
+
var h;
|
|
2870
|
+
return (h = o.tts) == null ? void 0 : h.target;
|
|
2871
|
+
}), a = e, u = an(), { textarea: p, input: c } = rn({ input: n, styleProp: "minHeight" });
|
|
2872
|
+
return (h, m) => (S(), $(G, null, [
|
|
2873
|
+
z(ln, {
|
|
2874
|
+
loading: P(u).loading,
|
|
2875
|
+
src: s.value,
|
|
2876
|
+
srcLabel: r.value,
|
|
2877
|
+
tts: l.value,
|
|
2878
|
+
isFavoriteBtn: a.isFavoriteFeatureEnabled,
|
|
2879
|
+
isFavorite: t.value,
|
|
2880
|
+
phonetic: i.value,
|
|
2881
|
+
onFavorite: m[0] || (m[0] = (v) => t.value = !t.value)
|
|
2882
|
+
}, null, 8, ["loading", "src", "srcLabel", "tts", "isFavoriteBtn", "isFavorite", "phonetic"]),
|
|
2883
|
+
g("div", sl, [
|
|
2884
|
+
Tt(g("textarea", {
|
|
2885
|
+
ref_key: "textarea",
|
|
2886
|
+
ref: p,
|
|
2887
|
+
"onUpdate:modelValue": m[1] || (m[1] = (v) => xe(c) ? c.value = v : null),
|
|
2888
|
+
class: "w-full border rounded-b-md border-t-0 outline-none outline-0 px-3 pl-5 bg-white text-gray-800 font-semibold resize-none pb-3",
|
|
2889
|
+
readonly: "",
|
|
2890
|
+
rows: "2",
|
|
2891
|
+
spellcheck: "false"
|
|
2892
|
+
}, null, 512), [
|
|
2893
|
+
[Pt, P(c)]
|
|
2894
|
+
]),
|
|
2895
|
+
ll
|
|
2800
2896
|
])
|
|
2801
2897
|
], 64));
|
|
2802
2898
|
}
|
|
2803
|
-
},
|
|
2804
|
-
__name: "
|
|
2899
|
+
}, il = /* @__PURE__ */ Ue(rl, [["__scopeId", "data-v-cbd6addc"]]), al = { class: "btn btn-sm btn-circle btn-ghost" }, He = {
|
|
2900
|
+
__name: "ToggleBtn",
|
|
2901
|
+
props: {
|
|
2902
|
+
isExpanded: Boolean
|
|
2903
|
+
},
|
|
2805
2904
|
setup(e) {
|
|
2806
|
-
const o =
|
|
2807
|
-
return (
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2905
|
+
const o = e;
|
|
2906
|
+
return (t, n) => (S(), $("button", al, [
|
|
2907
|
+
o.isExpanded ? (S(), Z(P(Do), {
|
|
2908
|
+
key: 0,
|
|
2909
|
+
class: "w-7 text-gray-400"
|
|
2910
|
+
})) : (S(), Z(P(Ro), {
|
|
2911
|
+
key: 1,
|
|
2912
|
+
class: "w-7 text-gray-400"
|
|
2913
|
+
}))
|
|
2914
|
+
]));
|
|
2915
|
+
}
|
|
2916
|
+
}, ul = { class: "card border bg-white rounded-lg" }, cl = { class: "card-body px-4 py-2 gap-0" }, dl = { class: "flex justify-between items-center" }, fl = /* @__PURE__ */ g("h2", { class: "card-title text-base font-bold leading-6 text-textCustom" }, "Translations", -1), pl = { class: "capitalize text-base font-normal text-textSecondary mb-1" }, vl = { class: "list-none list-inside" }, hl = ["onClick"], ml = { class: "text-base font-normal text-gray-800 leading-4" }, gl = {
|
|
2917
|
+
__name: "Dictionary",
|
|
2918
|
+
emits: ["translate"],
|
|
2919
|
+
setup(e, { emit: o }) {
|
|
2920
|
+
const t = E(!0), n = me(), s = ze(), r = w(() => n.dictionary), i = o, l = () => {
|
|
2921
|
+
t.value = !t.value;
|
|
2922
|
+
}, a = (u) => {
|
|
2923
|
+
const p = n.src, c = n.target;
|
|
2924
|
+
s.src = c, s.target = p, i("translate", u);
|
|
2925
|
+
};
|
|
2926
|
+
return (u, p) => (S(), $("div", ul, [
|
|
2927
|
+
g("div", cl, [
|
|
2928
|
+
g("div", dl, [
|
|
2929
|
+
fl,
|
|
2930
|
+
z(He, {
|
|
2931
|
+
isExpanded: t.value,
|
|
2932
|
+
onClick: l
|
|
2933
|
+
}, null, 8, ["isExpanded"])
|
|
2934
|
+
]),
|
|
2935
|
+
g("div", {
|
|
2936
|
+
class: ye(["overflow-hidden transition-all duration-300 ease-in-out", t.value ? "max-h-[2000px] opacity-100" : "max-h-0 opacity-0"])
|
|
2937
|
+
}, [
|
|
2938
|
+
g("ul", null, [
|
|
2939
|
+
(S(!0), $(G, null, le(r.value, (c, h) => (S(), $("li", {
|
|
2940
|
+
key: `${c.pos}-${h}`,
|
|
2941
|
+
class: "mb-2"
|
|
2942
|
+
}, [
|
|
2943
|
+
g("h5", pl, ee(c.pos), 1),
|
|
2944
|
+
g("ul", vl, [
|
|
2945
|
+
(S(!0), $(G, null, le(c.items, (m, v) => (S(), $("li", {
|
|
2946
|
+
key: `${m.word}-${v}`
|
|
2947
|
+
}, [
|
|
2948
|
+
g("span", {
|
|
2949
|
+
class: "p-3 m-0.5 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",
|
|
2950
|
+
onClick: (I) => a(m.word)
|
|
2951
|
+
}, ee(m.word), 9, hl),
|
|
2952
|
+
g("small", ml, " - " + ee(m.reverse_translation.join(", ")), 1)
|
|
2953
|
+
]))), 128))
|
|
2954
|
+
])
|
|
2955
|
+
]))), 128))
|
|
2956
|
+
])
|
|
2957
|
+
], 2)
|
|
2829
2958
|
])
|
|
2830
2959
|
]));
|
|
2831
2960
|
}
|
|
2832
|
-
},
|
|
2961
|
+
}, bl = { class: "card border bg-white rounded-lg" }, _l = { class: "card-body px-4 py-2 gap-0" }, yl = { class: "flex justify-between items-center" }, xl = /* @__PURE__ */ g("h2", { class: "card-title text-base font-bold leading-6 text-textCustom" }, "Definitions", -1), wl = { class: "capitalize text-base font-normal text-textSecondary mb-1" }, Sl = { class: "text-base text-textCustom list-decimal list-outside ml-5" }, El = /* @__PURE__ */ g("br", null, null, -1), Ol = {
|
|
2833
2962
|
key: 0,
|
|
2834
2963
|
class: "italic"
|
|
2835
|
-
},
|
|
2964
|
+
}, $l = {
|
|
2836
2965
|
__name: "Definition",
|
|
2837
2966
|
setup(e) {
|
|
2838
|
-
const o =
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2967
|
+
const o = E(!0), t = me(), n = w(() => t.definitions), s = () => {
|
|
2968
|
+
o.value = !o.value;
|
|
2969
|
+
};
|
|
2970
|
+
return (r, i) => (S(), $("div", bl, [
|
|
2971
|
+
g("div", _l, [
|
|
2972
|
+
g("div", yl, [
|
|
2973
|
+
xl,
|
|
2974
|
+
z(He, {
|
|
2975
|
+
isExpanded: o.value,
|
|
2976
|
+
onClick: s
|
|
2977
|
+
}, null, 8, ["isExpanded"])
|
|
2978
|
+
]),
|
|
2979
|
+
g("div", {
|
|
2980
|
+
class: ye(["overflow-hidden transition-all duration-300 ease-in-out", o.value ? "max-h-[2000px] opacity-100" : "max-h-0 opacity-0"])
|
|
2981
|
+
}, [
|
|
2982
|
+
g("ul", null, [
|
|
2983
|
+
(S(!0), $(G, null, le(n.value, (l, a) => (S(), $("li", {
|
|
2984
|
+
key: `${l.pos}-${a}`,
|
|
2985
|
+
class: "mb-2"
|
|
2986
|
+
}, [
|
|
2987
|
+
g("h5", wl, ee(l.pos), 1),
|
|
2988
|
+
g("ul", Sl, [
|
|
2989
|
+
(S(!0), $(G, null, le(l.items, (u, p) => (S(), $("li", {
|
|
2990
|
+
key: `${u.gloss}-${p}`,
|
|
2991
|
+
class: "mb-1"
|
|
2992
|
+
}, [
|
|
2993
|
+
g("span", null, ee(u.gloss), 1),
|
|
2994
|
+
El,
|
|
2995
|
+
u.example ? (S(), $("small", Ol, '"' + ee(u.example) + '"', 1)) : X("", !0)
|
|
2996
|
+
]))), 128))
|
|
2997
|
+
])
|
|
2998
|
+
]))), 128))
|
|
2999
|
+
])
|
|
3000
|
+
], 2)
|
|
2860
3001
|
])
|
|
2861
3002
|
]));
|
|
2862
3003
|
}
|
|
2863
|
-
},
|
|
3004
|
+
}, Il = { class: "card border bg-white rounded-lg" }, Cl = { class: "card-body px-4 py-2 gap-0" }, Tl = { class: "flex justify-between items-center" }, Pl = /* @__PURE__ */ g("h2", { class: "card-title text-base font-bold leading-6 text-textCustom" }, "Examples", -1), kl = { class: "text-textCustom list-decimal list-outside ml-7 mt-2" }, Rl = ["innerHTML"], Nl = {
|
|
2864
3005
|
__name: "Example",
|
|
2865
3006
|
setup(e) {
|
|
2866
|
-
const o =
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
3007
|
+
const o = E(!0), t = me(), n = w(() => t.examples), s = () => {
|
|
3008
|
+
o.value = !o.value;
|
|
3009
|
+
};
|
|
3010
|
+
return (r, i) => (S(), $("div", Il, [
|
|
3011
|
+
g("div", Cl, [
|
|
3012
|
+
g("div", Tl, [
|
|
3013
|
+
Pl,
|
|
3014
|
+
z(He, {
|
|
3015
|
+
isExpanded: o.value,
|
|
3016
|
+
onClick: s
|
|
3017
|
+
}, null, 8, ["isExpanded"])
|
|
3018
|
+
]),
|
|
3019
|
+
g("div", {
|
|
3020
|
+
class: ye(["overflow-hidden transition-all duration-300 ease-in-out", o.value ? "max-h-[1000px] opacity-100" : "max-h-0 opacity-0"])
|
|
3021
|
+
}, [
|
|
3022
|
+
g("ul", kl, [
|
|
3023
|
+
(S(!0), $(G, null, le(n.value, (l, a) => (S(), $("li", {
|
|
3024
|
+
key: `${l.definition_id}-${a}`,
|
|
3025
|
+
innerHTML: l
|
|
3026
|
+
}, null, 8, Rl))), 128))
|
|
3027
|
+
])
|
|
3028
|
+
], 2)
|
|
3029
|
+
])
|
|
3030
|
+
]));
|
|
3031
|
+
}
|
|
3032
|
+
}, Dl = { class: "card border bg-white rounded-lg" }, Ll = { class: "card-body px-4 py-2 gap-0" }, Vl = { class: "flex justify-between items-center" }, Al = /* @__PURE__ */ g("h2", { class: "card-title text-base font-bold leading-6 text-textCustom" }, "Synonyms", -1), Ml = { class: "capitalize text-base font-normal text-textSecondary mb-1" }, jl = { class: "list-none list-inside" }, Fl = { class: "flex flex-wrap" }, Bl = ["onClick"], zl = {
|
|
3033
|
+
__name: "Synonyms",
|
|
3034
|
+
emits: ["translate"],
|
|
3035
|
+
setup(e, { emit: o }) {
|
|
3036
|
+
const t = E(!0), n = me(), s = w(() => n.synonyms), r = o, i = () => {
|
|
3037
|
+
t.value = !t.value;
|
|
3038
|
+
}, l = (a) => {
|
|
3039
|
+
r("translate", a);
|
|
3040
|
+
};
|
|
3041
|
+
return (a, u) => (S(), $("div", Dl, [
|
|
3042
|
+
g("div", Ll, [
|
|
3043
|
+
g("div", Vl, [
|
|
3044
|
+
Al,
|
|
3045
|
+
z(He, {
|
|
3046
|
+
isExpanded: t.value,
|
|
3047
|
+
onClick: i
|
|
3048
|
+
}, null, 8, ["isExpanded"])
|
|
3049
|
+
]),
|
|
3050
|
+
g("div", {
|
|
3051
|
+
class: ye(["overflow-hidden transition-all duration-300 ease-in-out", t.value ? "max-h-[2000px] opacity-100" : "max-h-0 opacity-0"])
|
|
3052
|
+
}, [
|
|
3053
|
+
g("ul", null, [
|
|
3054
|
+
(S(!0), $(G, null, le(s.value, (p, c) => (S(), $("li", {
|
|
3055
|
+
key: `${p.pos}-${c}`,
|
|
3056
|
+
class: "mb-2"
|
|
3057
|
+
}, [
|
|
3058
|
+
g("h5", Ml, ee(p.pos), 1),
|
|
3059
|
+
g("ul", jl, [
|
|
3060
|
+
(S(!0), $(G, null, le(p.items, (h, m) => (S(), $("li", {
|
|
3061
|
+
key: `${h.word}-${m}`,
|
|
3062
|
+
class: "mb-2"
|
|
3063
|
+
}, [
|
|
3064
|
+
g("div", Fl, [
|
|
3065
|
+
(S(!0), $(G, null, le(h.synonym, (v, I) => (S(), $("span", {
|
|
3066
|
+
key: `${v}-${I}`,
|
|
3067
|
+
class: "p-3 m-0.5 ml-0 font-normal badge badge-ghost bg-primaryColor text-white cursor-pointer border-0 rounded-lg",
|
|
3068
|
+
onClick: (V) => l(v)
|
|
3069
|
+
}, ee(v), 9, Bl))), 128))
|
|
3070
|
+
])
|
|
3071
|
+
]))), 128))
|
|
3072
|
+
])
|
|
3073
|
+
]))), 128))
|
|
3074
|
+
])
|
|
3075
|
+
], 2)
|
|
2876
3076
|
])
|
|
2877
3077
|
]));
|
|
2878
3078
|
}
|
|
2879
|
-
},
|
|
3079
|
+
}, Ul = { class: "bg-white min-h-screen flex flex-col" }, Hl = { class: "py-2 px-5 shadow-lg" }, Wl = { class: "px-5 flex-grow" }, Gl = { class: "flex flex-col lg:flex-row lg:gap-2" }, ql = { class: "w-full lg:w-[calc(50%-1rem)] my-2" }, Jl = /* @__PURE__ */ g("div", { class: "w-6 h-4 mx-auto hidden lg:block" }, null, -1), Kl = { class: "w-full lg:w-[calc(50%-1rem)] my-2" }, Yl = { class: "grid grid-cols-1 lg:grid-cols-3 gap-4" }, Ql = {
|
|
2880
3080
|
key: 0,
|
|
2881
|
-
class: "
|
|
2882
|
-
},
|
|
3081
|
+
class: "w-full my-4"
|
|
3082
|
+
}, Xl = /* @__PURE__ */ g("div", { class: "mt-auto py-5 px-5" }, [
|
|
3083
|
+
/* @__PURE__ */ g("span", { class: "block text-center text-gray-700" }, " The site is not affiliated with Google Translate "),
|
|
3084
|
+
/* @__PURE__ */ g("span", { class: "block text-center text-gray-700" }, "Since 2011")
|
|
3085
|
+
], -1), tr = {
|
|
2883
3086
|
__name: "Popup",
|
|
2884
3087
|
props: {
|
|
2885
3088
|
opt: {
|
|
@@ -2893,60 +3096,84 @@ const Il = {
|
|
|
2893
3096
|
translation: {
|
|
2894
3097
|
type: Object,
|
|
2895
3098
|
default: null
|
|
3099
|
+
},
|
|
3100
|
+
isFavoriteFeatureEnabled: {
|
|
3101
|
+
type: Boolean,
|
|
3102
|
+
default: !1
|
|
2896
3103
|
}
|
|
2897
3104
|
},
|
|
2898
|
-
emits: ["opt", "translate"],
|
|
3105
|
+
emits: ["opt", "translate", "reader", "settings", "fullscreen"],
|
|
2899
3106
|
setup(e, { emit: o }) {
|
|
2900
|
-
var
|
|
2901
|
-
const t =
|
|
3107
|
+
var h;
|
|
3108
|
+
const t = ds(), n = me(t), s = ze(t), r = an(t), i = e, l = o, a = E((h = i.translation) == null ? void 0 : h.text);
|
|
2902
3109
|
j(
|
|
2903
3110
|
() => i.translation,
|
|
2904
3111
|
(m) => {
|
|
2905
3112
|
r.loading = !1, n.init(m);
|
|
2906
3113
|
},
|
|
2907
3114
|
{ immediate: !0 }
|
|
2908
|
-
), j([() => i.opt, () => i.languages], ([m,
|
|
2909
|
-
|
|
2910
|
-
}), j([() =>
|
|
2911
|
-
|
|
2912
|
-
}),
|
|
2913
|
-
|
|
3115
|
+
), j([() => i.opt, () => i.languages], ([m, v]) => {
|
|
3116
|
+
s.init(m, v);
|
|
3117
|
+
}), j([() => s.src, () => s.target], ([m, v]) => {
|
|
3118
|
+
l("opt", { src: m, target: v }), a.value && c(a.value);
|
|
3119
|
+
}), pe(() => {
|
|
3120
|
+
s.init(i.opt, i.languages);
|
|
2914
3121
|
});
|
|
2915
3122
|
function u() {
|
|
2916
3123
|
a.value = "", n.reset();
|
|
2917
3124
|
}
|
|
2918
|
-
function
|
|
2919
|
-
m && (
|
|
3125
|
+
function p(m) {
|
|
3126
|
+
m && c(m);
|
|
2920
3127
|
}
|
|
2921
|
-
function c() {
|
|
2922
|
-
r.loading = !0,
|
|
2923
|
-
src:
|
|
2924
|
-
target:
|
|
2925
|
-
text:
|
|
3128
|
+
function c(m) {
|
|
3129
|
+
a.value = m, r.loading = !0, l("translate", {
|
|
3130
|
+
src: s.src,
|
|
3131
|
+
target: s.target,
|
|
3132
|
+
text: m
|
|
2926
3133
|
});
|
|
2927
3134
|
}
|
|
2928
|
-
return (m,
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
3135
|
+
return (m, v) => (S(), $("div", Ul, [
|
|
3136
|
+
g("div", Hl, [
|
|
3137
|
+
z(kn, {
|
|
3138
|
+
onReader: v[0] || (v[0] = (I) => l("reader")),
|
|
3139
|
+
onSettings: v[1] || (v[1] = (I) => l("settings")),
|
|
3140
|
+
onFullScreen: v[2] || (v[2] = (I) => l("fullscreen"))
|
|
3141
|
+
})
|
|
3142
|
+
]),
|
|
3143
|
+
g("div", Wl, [
|
|
3144
|
+
z(ms, { class: "my-4" }),
|
|
3145
|
+
g("div", Gl, [
|
|
3146
|
+
g("div", ql, [
|
|
3147
|
+
z(tl, {
|
|
3148
|
+
text: a.value,
|
|
3149
|
+
onChange: p,
|
|
3150
|
+
onClear: u
|
|
3151
|
+
}, null, 8, ["text"])
|
|
3152
|
+
]),
|
|
3153
|
+
Jl,
|
|
3154
|
+
g("div", Kl, [
|
|
3155
|
+
z(il, { isFavoriteFeatureEnabled: e.isFavoriteFeatureEnabled }, null, 8, ["isFavoriteFeatureEnabled"])
|
|
3156
|
+
])
|
|
3157
|
+
]),
|
|
3158
|
+
g("div", Yl, [
|
|
3159
|
+
P(n).dictionary.length ? (S(), Z(gl, {
|
|
3160
|
+
key: 0,
|
|
3161
|
+
onTranslate: c
|
|
3162
|
+
})) : X("", !0),
|
|
3163
|
+
P(n).definitions.length ? (S(), Z($l, { key: 1 })) : X("", !0),
|
|
3164
|
+
P(n).synonyms.length ? (S(), Z(zl, {
|
|
3165
|
+
key: 2,
|
|
3166
|
+
onTranslate: c
|
|
3167
|
+
})) : X("", !0)
|
|
2937
3168
|
]),
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
])
|
|
3169
|
+
P(n).examples.length ? (S(), $("div", Ql, [
|
|
3170
|
+
z(Nl)
|
|
3171
|
+
])) : X("", !0)
|
|
2941
3172
|
]),
|
|
2942
|
-
|
|
2943
|
-
H(Ml),
|
|
2944
|
-
H(Wl),
|
|
2945
|
-
H(Ql)
|
|
2946
|
-
])) : ue("", !0)
|
|
3173
|
+
Xl
|
|
2947
3174
|
]));
|
|
2948
3175
|
}
|
|
2949
3176
|
};
|
|
2950
3177
|
export {
|
|
2951
|
-
|
|
3178
|
+
tr as default
|
|
2952
3179
|
};
|