@pie-players/pie-tool-answer-eliminator 0.3.50 → 0.3.51
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/{dist-DfQrc9XY.js → dist-BV1q85ZL.js} +25 -24
- package/dist/tool-answer-eliminator.js +1016 -963
- package/package.json +4 -4
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
var
|
|
1
|
+
import { t as f } from "./defineProperty-Dt7ri80W.js";
|
|
2
|
+
var es = Object.create, si = Object.defineProperty, ts = Object.getOwnPropertyDescriptor, ns = Object.getOwnPropertyNames, rs = Object.getPrototypeOf, is = Object.prototype.hasOwnProperty, ah = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), os = (e, t, n, r) => {
|
|
3
3
|
if (t && typeof t == "object" || typeof t == "function")
|
|
4
|
-
for (var i =
|
|
5
|
-
a = i[o], !
|
|
4
|
+
for (var i = ns(t), o = 0, s = i.length, a; o < s; o++)
|
|
5
|
+
a = i[o], !is.call(e, a) && a !== n && si(e, a, {
|
|
6
6
|
get: ((l) => t[l]).bind(null, a),
|
|
7
|
-
enumerable: !(r =
|
|
7
|
+
enumerable: !(r = ts(t, a)) || r.enumerable
|
|
8
8
|
});
|
|
9
9
|
return e;
|
|
10
|
-
},
|
|
10
|
+
}, ss = (e, t, n) => (n = e != null ? es(rs(e)) : {}, os(t || !e || !e.__esModule ? si(n, "default", {
|
|
11
11
|
value: e,
|
|
12
12
|
enumerable: !0
|
|
13
|
-
}) : n, e)),
|
|
13
|
+
}) : n, e)), lh = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (t, n) => (typeof require < "u" ? require : t)[n] }) : e)(function(e) {
|
|
14
14
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
15
15
|
throw Error('Calling `require` for "' + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
16
16
|
});
|
|
@@ -19,12 +19,12 @@ if (typeof window < "u") {
|
|
|
19
19
|
((mr = (vr = window).__svelte ?? (vr.__svelte = {})).v ?? (mr.v = /* @__PURE__ */ new Set())).add("5");
|
|
20
20
|
}
|
|
21
21
|
var qt = {}, H = /* @__PURE__ */ Symbol("uninitialized");
|
|
22
|
-
var
|
|
22
|
+
var as = Array.isArray, ls = Array.prototype.indexOf, Vt = Array.prototype.includes, cs = Array.from, Gt = Object.keys, Ut = Object.defineProperty, Be = Object.getOwnPropertyDescriptor, us = Object.prototype, hs = Array.prototype, ds = Object.getPrototypeOf, yr = Object.isExtensible, fs = () => {
|
|
23
23
|
};
|
|
24
|
-
function
|
|
24
|
+
function ps(e) {
|
|
25
25
|
for (var t = 0; t < e.length; t++) e[t]();
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function gs() {
|
|
28
28
|
var e, t;
|
|
29
29
|
return {
|
|
30
30
|
promise: new Promise((n, r) => {
|
|
@@ -34,51 +34,51 @@ function hs() {
|
|
|
34
34
|
reject: t
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var ch = 1 << 24, ae = 1024, le = 2048, Ye = 4096, ai = 8192, ms = 16384, li = 32768, br = 1 << 25, ci = 65536, uh = 1 << 17, hh = 1 << 18, Ct = 1 << 19, vs = 1 << 20, xt = 65536, Tr = 1 << 21, dh = 1 << 22, ui = 1 << 23, St = /* @__PURE__ */ Symbol("$state"), hi = /* @__PURE__ */ Symbol("legacy props"), ys = /* @__PURE__ */ Symbol("proxy path"), bs = /* @__PURE__ */ Symbol("attributes"), Ts = /* @__PURE__ */ Symbol("class"), Ss = /* @__PURE__ */ Symbol("style"), _s = /* @__PURE__ */ Symbol("text"), Yn = new class extends Error {
|
|
38
38
|
constructor(...t) {
|
|
39
|
-
super(...t),
|
|
39
|
+
super(...t), f(this, "name", "StaleReactionError"), f(this, "message", "The reaction that called `getAbortSignal()` was re-run or destroyed");
|
|
40
40
|
}
|
|
41
|
-
}(),
|
|
42
|
-
function
|
|
41
|
+
}(), ph = !!globalThis.document?.contentType && /* @__PURE__ */ globalThis.document.contentType.includes("xml");
|
|
42
|
+
function ws(e) {
|
|
43
43
|
throw new Error("https://svelte.dev/e/lifecycle_outside_component");
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function ks(e) {
|
|
46
46
|
throw new Error("https://svelte.dev/e/effect_in_teardown");
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function Es() {
|
|
49
49
|
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function As(e) {
|
|
52
52
|
throw new Error("https://svelte.dev/e/effect_orphan");
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function Cs() {
|
|
55
55
|
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function xs() {
|
|
58
58
|
throw new Error("https://svelte.dev/e/hydration_failed");
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Is(e) {
|
|
61
61
|
throw new Error("https://svelte.dev/e/props_invalid_value");
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Os() {
|
|
64
64
|
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function Ms() {
|
|
67
67
|
throw new Error("https://svelte.dev/e/state_prototype_fixed");
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Ls() {
|
|
70
70
|
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function Rs() {
|
|
73
73
|
throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror");
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function $s() {
|
|
76
76
|
console.warn("https://svelte.dev/e/derived_inert");
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function di(e) {
|
|
79
79
|
console.warn("https://svelte.dev/e/hydration_mismatch");
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function Ps() {
|
|
82
82
|
console.warn("https://svelte.dev/e/svelte_boundary_reset_noop");
|
|
83
83
|
}
|
|
84
84
|
var re = !1;
|
|
@@ -88,19 +88,19 @@ function Lt(e) {
|
|
|
88
88
|
var D;
|
|
89
89
|
function kt(e) {
|
|
90
90
|
if (e === null)
|
|
91
|
-
throw
|
|
91
|
+
throw di(), qt;
|
|
92
92
|
return D = e;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function fi() {
|
|
95
95
|
return kt(/* @__PURE__ */ dt(D));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Ns(e = 1) {
|
|
98
98
|
if (re) {
|
|
99
99
|
for (var t = e, n = D; t--; ) n = /* @__PURE__ */ dt(n);
|
|
100
100
|
D = n;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function Hs(e = !0) {
|
|
104
104
|
for (var t = 0, n = D; ; ) {
|
|
105
105
|
if (n.nodeType === 8) {
|
|
106
106
|
var r = n.data;
|
|
@@ -113,27 +113,27 @@ function Rs(e = !0) {
|
|
|
113
113
|
e && n.remove(), n = i;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function pi(e) {
|
|
117
117
|
return e === this.v;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function Bs(e, t) {
|
|
120
120
|
return e != e ? t == t : e !== t || e !== null && typeof e == "object" || typeof e == "function";
|
|
121
121
|
}
|
|
122
|
-
function
|
|
123
|
-
return
|
|
122
|
+
function gi(e) {
|
|
123
|
+
return !Bs(e, this.v);
|
|
124
124
|
}
|
|
125
125
|
var Ce = !1, It = !1;
|
|
126
126
|
function Sr(e, t) {
|
|
127
|
-
return e.label = t,
|
|
127
|
+
return e.label = t, Ws(e.v, t), e;
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
return e?.[
|
|
129
|
+
function Ws(e, t) {
|
|
130
|
+
return e?.[ys]?.(t), e;
|
|
131
131
|
}
|
|
132
132
|
var L = null;
|
|
133
133
|
function Kt(e) {
|
|
134
134
|
L = e;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function mi(e, t = !1, n) {
|
|
137
137
|
L = {
|
|
138
138
|
p: L,
|
|
139
139
|
i: !1,
|
|
@@ -149,11 +149,11 @@ function fi(e, t = !1, n) {
|
|
|
149
149
|
} : null
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function vi(e) {
|
|
153
153
|
var t = L, n = t.e;
|
|
154
154
|
if (n !== null) {
|
|
155
155
|
t.e = null;
|
|
156
|
-
for (var r of n)
|
|
156
|
+
for (var r of n) ji(r);
|
|
157
157
|
}
|
|
158
158
|
return e !== void 0 && (t.x = e), t.i = !0, L = t.p, e ?? {};
|
|
159
159
|
}
|
|
@@ -161,26 +161,26 @@ function ln() {
|
|
|
161
161
|
return !It || L !== null && L.l === null;
|
|
162
162
|
}
|
|
163
163
|
var $e = [];
|
|
164
|
-
function
|
|
164
|
+
function yi() {
|
|
165
165
|
var e = $e;
|
|
166
|
-
$e = [],
|
|
166
|
+
$e = [], ps(e);
|
|
167
167
|
}
|
|
168
168
|
function at(e) {
|
|
169
169
|
if ($e.length === 0 && !_t) {
|
|
170
170
|
var t = $e;
|
|
171
171
|
queueMicrotask(() => {
|
|
172
|
-
t === $e &&
|
|
172
|
+
t === $e && yi();
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
175
|
$e.push(e);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
178
|
-
for (; $e.length > 0; )
|
|
177
|
+
function zs() {
|
|
178
|
+
for (; $e.length > 0; ) yi();
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function bi(e) {
|
|
181
181
|
var t = E;
|
|
182
182
|
if (t === null)
|
|
183
|
-
return k.f |=
|
|
183
|
+
return k.f |= ui, e;
|
|
184
184
|
if ((t.f & 32768) === 0 && (t.f & 4) === 0)
|
|
185
185
|
throw e;
|
|
186
186
|
it(e, t);
|
|
@@ -200,23 +200,23 @@ function it(e, t) {
|
|
|
200
200
|
}
|
|
201
201
|
throw e;
|
|
202
202
|
}
|
|
203
|
-
var
|
|
203
|
+
var Fs = ~(le | Ye | ae);
|
|
204
204
|
function P(e, t) {
|
|
205
|
-
e.f = e.f &
|
|
205
|
+
e.f = e.f & Fs | t;
|
|
206
206
|
}
|
|
207
207
|
function Jn(e) {
|
|
208
208
|
(e.f & 512) !== 0 || e.deps === null ? P(e, ae) : P(e, Ye);
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function Ti(e) {
|
|
211
211
|
if (e !== null)
|
|
212
212
|
for (const t of e)
|
|
213
|
-
(t.f & 2) === 0 || (t.f & 65536) === 0 || (t.f ^= xt,
|
|
213
|
+
(t.f & 2) === 0 || (t.f & 65536) === 0 || (t.f ^= xt, Ti(t.deps));
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
(e.f & 2048) !== 0 ? t.add(e) : (e.f & 4096) !== 0 && n.add(e),
|
|
215
|
+
function Si(e, t, n) {
|
|
216
|
+
(e.f & 2048) !== 0 ? t.add(e) : (e.f & 4096) !== 0 && n.add(e), Ti(e.deps), P(e, ae);
|
|
217
217
|
}
|
|
218
|
-
var
|
|
219
|
-
function
|
|
218
|
+
var Ds = !1, Rt = !1;
|
|
219
|
+
function js(e) {
|
|
220
220
|
var t = Rt;
|
|
221
221
|
try {
|
|
222
222
|
return Rt = !1, [e(), Rt];
|
|
@@ -224,14 +224,14 @@ function zs(e) {
|
|
|
224
224
|
Rt = t;
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function _i(e, t) {
|
|
228
228
|
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
229
229
|
}
|
|
230
230
|
function Qn(e, t) {
|
|
231
|
-
|
|
231
|
+
_i(e, t), t.add(e);
|
|
232
232
|
}
|
|
233
233
|
function w(e, t, n) {
|
|
234
|
-
|
|
234
|
+
_i(e, t), t.set(e, n);
|
|
235
235
|
}
|
|
236
236
|
function _(e, t, n) {
|
|
237
237
|
if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
@@ -243,10 +243,10 @@ function T(e, t, n) {
|
|
|
243
243
|
function d(e, t) {
|
|
244
244
|
return e.get(_(e, t));
|
|
245
245
|
}
|
|
246
|
-
var
|
|
247
|
-
var
|
|
246
|
+
var wi, Xt = null, et = null, x = null, En = null, z = null, An = null, _t = !1, vn = !1, lt = null, Yt = null, ki = 0;
|
|
247
|
+
var qs = 1, Jt = /* @__PURE__ */ new WeakMap(), We = /* @__PURE__ */ new WeakMap(), Pe = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Cn = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap(), Bt = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakSet(), ht = class Ei {
|
|
248
248
|
constructor() {
|
|
249
|
-
Qn(this, R),
|
|
249
|
+
Qn(this, R), f(this, "id", qs++), w(this, Jt, !1), f(this, "linked", !0), w(this, We, null), w(this, Pe, null), f(this, "async_deriveds", /* @__PURE__ */ new Map()), f(this, "current", /* @__PURE__ */ new Map()), f(this, "previous", /* @__PURE__ */ new Map()), w(this, Qt, /* @__PURE__ */ new Set()), w(this, $t, /* @__PURE__ */ new Set()), w(this, tt, 0), w(this, Le, /* @__PURE__ */ new Map()), w(this, mt, null), w(this, J, []), w(this, Cn, []), w(this, Ge, /* @__PURE__ */ new Set()), w(this, me, /* @__PURE__ */ new Set()), w(this, Ae, /* @__PURE__ */ new Map()), w(this, Bt, /* @__PURE__ */ new Set()), f(this, "is_fork", !1), w(this, vt, !1), et === null ? Xt = et = this : (T(Pe, et, this), T(We, this, et)), et = this;
|
|
250
250
|
}
|
|
251
251
|
skip_effect(t) {
|
|
252
252
|
d(Ae, this).has(t) || d(Ae, this).set(t, {
|
|
@@ -266,19 +266,19 @@ var Ws = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap
|
|
|
266
266
|
d(Bt, this).add(t);
|
|
267
267
|
}
|
|
268
268
|
capture(t, n, r = !1) {
|
|
269
|
-
t.v !== H && !this.previous.has(t) && this.previous.set(t, t.v), (t.f & 8388608) === 0 && (this.current.set(t, [n, r]),
|
|
269
|
+
t.v !== H && !this.previous.has(t) && this.previous.set(t, t.v), (t.f & 8388608) === 0 && (this.current.set(t, [n, r]), z?.set(t, n)), this.is_fork || (t.v = n);
|
|
270
270
|
}
|
|
271
271
|
activate() {
|
|
272
272
|
x = this;
|
|
273
273
|
}
|
|
274
274
|
deactivate() {
|
|
275
|
-
x = null,
|
|
275
|
+
x = null, z = null;
|
|
276
276
|
}
|
|
277
277
|
flush() {
|
|
278
278
|
try {
|
|
279
279
|
vn = !0, x = this, _(R, this, Zt).call(this);
|
|
280
280
|
} finally {
|
|
281
|
-
|
|
281
|
+
ki = 0, An = null, lt = null, Yt = null, vn = !1, x = null, z = null, De.clear();
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
discard() {
|
|
@@ -286,7 +286,7 @@ var Ws = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap
|
|
|
286
286
|
d($t, this).clear(), _(R, this, en).call(this), d(mt, this)?.resolve();
|
|
287
287
|
}
|
|
288
288
|
register_created_effect(t) {
|
|
289
|
-
d(
|
|
289
|
+
d(Cn, this).push(t);
|
|
290
290
|
}
|
|
291
291
|
increment(t, n) {
|
|
292
292
|
if (T(tt, this, d(tt, this) + 1), t) {
|
|
@@ -315,11 +315,11 @@ var Ws = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap
|
|
|
315
315
|
d($t, this).add(t);
|
|
316
316
|
}
|
|
317
317
|
settled() {
|
|
318
|
-
return (d(mt, this) ?? T(mt, this,
|
|
318
|
+
return (d(mt, this) ?? T(mt, this, gs())).promise;
|
|
319
319
|
}
|
|
320
320
|
static ensure() {
|
|
321
321
|
if (x === null) {
|
|
322
|
-
const t = x = new
|
|
322
|
+
const t = x = new Ei();
|
|
323
323
|
!vn && !_t && at(() => {
|
|
324
324
|
d(Jt, t) || t.flush();
|
|
325
325
|
});
|
|
@@ -327,12 +327,12 @@ var Ws = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap
|
|
|
327
327
|
return x;
|
|
328
328
|
}
|
|
329
329
|
apply() {
|
|
330
|
-
if (!Ce || !this.is_fork && d(
|
|
331
|
-
|
|
330
|
+
if (!Ce || !this.is_fork && d(We, this) === null && d(Pe, this) === null) {
|
|
331
|
+
z = null;
|
|
332
332
|
return;
|
|
333
333
|
}
|
|
334
|
-
|
|
335
|
-
for (const [n, [r]] of this.current)
|
|
334
|
+
z = /* @__PURE__ */ new Map();
|
|
335
|
+
for (const [n, [r]] of this.current) z.set(n, r);
|
|
336
336
|
for (let n = Xt; n !== null; n = d(Pe, n))
|
|
337
337
|
if (!(n === this || n.is_fork)) {
|
|
338
338
|
var t = !1;
|
|
@@ -344,18 +344,18 @@ var Ws = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap
|
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
if (!t)
|
|
347
|
-
for (const [r, i] of n.previous)
|
|
347
|
+
for (const [r, i] of n.previous) z.has(r) || z.set(r, i);
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
schedule(t) {
|
|
351
|
-
if (
|
|
351
|
+
if (An = t, t.b?.is_pending && (t.f & 16777228) !== 0 && (t.f & 32768) === 0) {
|
|
352
352
|
t.b.defer_effect(t);
|
|
353
353
|
return;
|
|
354
354
|
}
|
|
355
355
|
for (var n = t; n.parent !== null; ) {
|
|
356
356
|
n = n.parent;
|
|
357
357
|
var r = n.f;
|
|
358
|
-
if (lt !== null && n === E && (Ce || (k === null || (k.f & 2) === 0) && !
|
|
358
|
+
if (lt !== null && n === E && (Ce || (k === null || (k.f & 2) === 0) && !Ds))
|
|
359
359
|
return;
|
|
360
360
|
if ((r & 96) !== 0) {
|
|
361
361
|
if ((r & 1024) === 0) return;
|
|
@@ -365,7 +365,7 @@ var Ws = 1, Jt = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap
|
|
|
365
365
|
d(J, this).push(n);
|
|
366
366
|
}
|
|
367
367
|
};
|
|
368
|
-
|
|
368
|
+
wi = ht;
|
|
369
369
|
function _r() {
|
|
370
370
|
if (this.is_fork) return !0;
|
|
371
371
|
for (const n of d(Le, this).keys()) {
|
|
@@ -381,7 +381,7 @@ function _r() {
|
|
|
381
381
|
return !1;
|
|
382
382
|
}
|
|
383
383
|
function Zt() {
|
|
384
|
-
T(Jt, this, !0),
|
|
384
|
+
T(Jt, this, !0), ki++ > 1e3 && (_(R, this, en).call(this), Ks());
|
|
385
385
|
for (const a of d(Ge, this))
|
|
386
386
|
d(me, this).delete(a), P(a, le), this.schedule(a);
|
|
387
387
|
for (const a of d(me, this))
|
|
@@ -390,36 +390,36 @@ function Zt() {
|
|
|
390
390
|
T(J, this, []), this.apply();
|
|
391
391
|
var t = lt = [], n = [], r = Yt = [];
|
|
392
392
|
for (const a of e) try {
|
|
393
|
-
_(R, this,
|
|
393
|
+
_(R, this, Ai).call(this, a, t, n);
|
|
394
394
|
} catch (l) {
|
|
395
|
-
throw
|
|
395
|
+
throw Ii(a), _(R, this, _r).call(this) || this.discard(), l;
|
|
396
396
|
}
|
|
397
397
|
if (x = null, r.length > 0) {
|
|
398
|
-
var i =
|
|
398
|
+
var i = wi.ensure();
|
|
399
399
|
for (const a of r) i.schedule(a);
|
|
400
400
|
}
|
|
401
401
|
if (lt = null, Yt = null, _(R, this, _r).call(this)) {
|
|
402
402
|
_(R, this, yt).call(this, n), _(R, this, yt).call(this, t);
|
|
403
|
-
for (const [a, l] of d(Ae, this))
|
|
403
|
+
for (const [a, l] of d(Ae, this)) xi(a, l);
|
|
404
404
|
r.length > 0 && _(R, x, Zt).call(x);
|
|
405
405
|
return;
|
|
406
406
|
}
|
|
407
|
-
const o = _(R, this,
|
|
407
|
+
const o = _(R, this, Vs).call(this);
|
|
408
408
|
if (o) {
|
|
409
|
-
_(R, this, yt).call(this, n), _(R, this, yt).call(this, t), _(R, o,
|
|
409
|
+
_(R, this, yt).call(this, n), _(R, this, yt).call(this, t), _(R, o, Gs).call(o, this);
|
|
410
410
|
return;
|
|
411
411
|
}
|
|
412
412
|
d(Ge, this).clear(), d(me, this).clear();
|
|
413
413
|
for (const a of d(Qt, this)) a(this);
|
|
414
|
-
d(Qt, this).clear(),
|
|
414
|
+
d(Qt, this).clear(), En = this, wr(n), wr(t), En = null, d(mt, this)?.resolve();
|
|
415
415
|
var s = x;
|
|
416
|
-
if (d(tt, this) === 0 && (d(J, this).length === 0 || s !== null) && (_(R, this, en).call(this), Ce && (_(R, this,
|
|
416
|
+
if (d(tt, this) === 0 && (d(J, this).length === 0 || s !== null) && (_(R, this, en).call(this), Ce && (_(R, this, Us).call(this), x = s)), d(J, this).length > 0) if (s !== null) {
|
|
417
417
|
const a = s;
|
|
418
418
|
d(J, a).push(...d(J, this).filter((l) => !d(J, a).includes(l)));
|
|
419
419
|
} else s = this;
|
|
420
420
|
s !== null && _(R, s, Zt).call(s);
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function Ai(e, t, n) {
|
|
423
423
|
e.f ^= ae;
|
|
424
424
|
for (var r = e.first; r !== null; ) {
|
|
425
425
|
var i = r.f, o = (i & 96) !== 0;
|
|
@@ -441,16 +441,16 @@ function wi(e, t, n) {
|
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
function
|
|
445
|
-
for (var e = d(
|
|
444
|
+
function Vs() {
|
|
445
|
+
for (var e = d(We, this); e !== null; ) {
|
|
446
446
|
if (!e.is_fork) {
|
|
447
447
|
for (const [t, [, n]] of this.current) if (e.current.has(t) && !n) return e;
|
|
448
448
|
}
|
|
449
|
-
e = d(
|
|
449
|
+
e = d(We, e);
|
|
450
450
|
}
|
|
451
451
|
return null;
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function Gs(e) {
|
|
454
454
|
for (const [n, r] of e.current)
|
|
455
455
|
!this.previous.has(n) && e.previous.has(n) && this.previous.set(n, e.previous.get(n)), this.current.set(n, r);
|
|
456
456
|
for (const [n, r] of e.async_deriveds) {
|
|
@@ -474,22 +474,22 @@ function Ds(e) {
|
|
|
474
474
|
this.oncommit(() => e.discard()), _(R, e, en).call(e), x = this, _(R, this, Zt).call(this);
|
|
475
475
|
}
|
|
476
476
|
function yt(e) {
|
|
477
|
-
for (var t = 0; t < e.length; t += 1)
|
|
477
|
+
for (var t = 0; t < e.length; t += 1) Si(e[t], d(Ge, this), d(me, this));
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function Us() {
|
|
480
480
|
for (let c = Xt; c !== null; c = d(Pe, c)) {
|
|
481
481
|
var e = c.id < this.id, t = [];
|
|
482
|
-
for (const [u, [h,
|
|
482
|
+
for (const [u, [h, p]] of this.current) {
|
|
483
483
|
if (c.current.has(u)) {
|
|
484
484
|
var n = c.current.get(u)[0];
|
|
485
|
-
if (e && h !== n) c.current.set(u, [h,
|
|
485
|
+
if (e && h !== n) c.current.set(u, [h, p]);
|
|
486
486
|
else continue;
|
|
487
487
|
}
|
|
488
488
|
t.push(u);
|
|
489
489
|
}
|
|
490
490
|
if (e) for (const [u, h] of this.async_deriveds) {
|
|
491
|
-
const
|
|
492
|
-
|
|
491
|
+
const p = c.async_deriveds.get(u);
|
|
492
|
+
p && h.promise.then(p.resolve).catch(p.reject);
|
|
493
493
|
}
|
|
494
494
|
if (d(Jt, c)) {
|
|
495
495
|
var r = [...c.current.keys()].filter((u) => !c.current.get(u)[1] && !this.current.has(u));
|
|
@@ -501,17 +501,17 @@ function js() {
|
|
|
501
501
|
});
|
|
502
502
|
c.activate();
|
|
503
503
|
var i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
504
|
-
for (var s of t)
|
|
504
|
+
for (var s of t) Ci(s, r, i, o);
|
|
505
505
|
o = /* @__PURE__ */ new Map();
|
|
506
506
|
var a = [...c.current].filter(([u, h]) => {
|
|
507
|
-
const
|
|
508
|
-
return
|
|
507
|
+
const p = this.current.get(u);
|
|
508
|
+
return p ? p[0] !== h[0] || p[1] !== h[1] : !0;
|
|
509
509
|
}).map(([u]) => u);
|
|
510
510
|
if (a.length > 0)
|
|
511
|
-
for (const u of d(
|
|
511
|
+
for (const u of d(Cn, this)) (u.f & 155648) === 0 && Zn(u, a, o) && ((u.f & 4194320) !== 0 ? (P(u, le), c.schedule(u)) : d(Ge, c).add(u));
|
|
512
512
|
if (d(J, c).length > 0 && !d(vt, c)) {
|
|
513
513
|
c.apply();
|
|
514
|
-
for (var l of d(J, c)) _(R, c,
|
|
514
|
+
for (var l of d(J, c)) _(R, c, Ai).call(c, l, [], []);
|
|
515
515
|
T(J, c, []);
|
|
516
516
|
}
|
|
517
517
|
c.deactivate();
|
|
@@ -521,8 +521,8 @@ function js() {
|
|
|
521
521
|
}
|
|
522
522
|
function en() {
|
|
523
523
|
if (this.linked) {
|
|
524
|
-
var e = d(
|
|
525
|
-
e === null ? Xt = t : T(Pe, e, t), t === null ? et = e : T(
|
|
524
|
+
var e = d(We, this), t = d(Pe, this);
|
|
525
|
+
e === null ? Xt = t : T(Pe, e, t), t === null ? et = e : T(We, t, e), this.linked = !1;
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
function pe(e) {
|
|
@@ -531,23 +531,23 @@ function pe(e) {
|
|
|
531
531
|
try {
|
|
532
532
|
var n;
|
|
533
533
|
for (e && (x !== null && !x.is_fork && x.flush(), n = e()); ; ) {
|
|
534
|
-
if (
|
|
534
|
+
if (zs(), x === null) return n;
|
|
535
535
|
x.flush();
|
|
536
536
|
}
|
|
537
537
|
} finally {
|
|
538
538
|
_t = t;
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
|
-
function
|
|
541
|
+
function Ks() {
|
|
542
542
|
if (0) {
|
|
543
543
|
var e;
|
|
544
544
|
for (const n of x.current.keys()) for (const [r, i] of n.updated ?? [])
|
|
545
545
|
var t;
|
|
546
546
|
}
|
|
547
547
|
try {
|
|
548
|
-
|
|
548
|
+
Cs();
|
|
549
549
|
} catch (n) {
|
|
550
|
-
it(n,
|
|
550
|
+
it(n, An);
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
var ge = null;
|
|
@@ -556,7 +556,7 @@ function wr(e) {
|
|
|
556
556
|
if (t !== 0) {
|
|
557
557
|
for (var n = 0; n < t; ) {
|
|
558
558
|
var r = e[n++];
|
|
559
|
-
if ((r.f & 24576) === 0 && Ot(r) && (ge = /* @__PURE__ */ new Set(), ct(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null &&
|
|
559
|
+
if ((r.f & 24576) === 0 && Ot(r) && (ge = /* @__PURE__ */ new Set(), ct(r), r.deps === null && r.first === null && r.nodes === null && r.teardown === null && r.ac === null && Vi(r), ge?.size > 0)) {
|
|
560
560
|
De.clear();
|
|
561
561
|
for (const i of ge) {
|
|
562
562
|
if ((i.f & 24576) !== 0) continue;
|
|
@@ -575,11 +575,11 @@ function wr(e) {
|
|
|
575
575
|
ge = null;
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function Ci(e, t, n, r) {
|
|
579
579
|
if (!n.has(e) && (n.add(e), e.reactions !== null))
|
|
580
580
|
for (const i of e.reactions) {
|
|
581
581
|
const o = i.f;
|
|
582
|
-
(o & 2) !== 0 ?
|
|
582
|
+
(o & 2) !== 0 ? Ci(i, t, n, r) : (o & 4194320) !== 0 && (o & 2048) === 0 && Zn(i, t, r) && (P(i, le), er(i));
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
585
|
function Zn(e, t, n) {
|
|
@@ -595,19 +595,19 @@ function Zn(e, t, n) {
|
|
|
595
595
|
function er(e) {
|
|
596
596
|
x.schedule(e);
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function xi(e, t) {
|
|
599
599
|
if (!((e.f & 32) !== 0 && (e.f & 1024) !== 0)) {
|
|
600
600
|
(e.f & 2048) !== 0 ? t.d.push(e) : (e.f & 4096) !== 0 && t.m.push(e), P(e, ae);
|
|
601
601
|
for (var n = e.first; n !== null; )
|
|
602
|
-
|
|
602
|
+
xi(n, t), n = n.next;
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function Ii(e) {
|
|
606
606
|
P(e, ae);
|
|
607
607
|
for (var t = e.first; t !== null; )
|
|
608
|
-
|
|
608
|
+
Ii(t), t = t.next;
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function Xs(e) {
|
|
611
611
|
let t = 0, n = cn(0), r;
|
|
612
612
|
return () => {
|
|
613
613
|
rr() && (b(n), ir(() => (t === 0 && (r = hn(() => e(() => wt(n)))), t += 1, () => {
|
|
@@ -617,31 +617,31 @@ function Vs(e) {
|
|
|
617
617
|
})));
|
|
618
618
|
};
|
|
619
619
|
}
|
|
620
|
-
var
|
|
621
|
-
function
|
|
622
|
-
new
|
|
620
|
+
var Ys = ci | Ct;
|
|
621
|
+
function Js(e, t, n, r) {
|
|
622
|
+
new Qs(e, t, n, r);
|
|
623
623
|
}
|
|
624
|
-
var ie = /* @__PURE__ */ new WeakMap(),
|
|
624
|
+
var ie = /* @__PURE__ */ new WeakMap(), xn = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), kr = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakSet(), Qs = class {
|
|
625
625
|
constructor(e, t, n, r) {
|
|
626
|
-
Qn(this, B),
|
|
626
|
+
Qn(this, B), f(this, "parent", void 0), f(this, "is_pending", !1), f(this, "transform_error", void 0), w(this, ie, void 0), w(this, xn, re ? D : null), w(this, ue, void 0), w(this, Et, void 0), w(this, Q, void 0), w(this, he, null), w(this, K, null), w(this, te, null), w(this, ze, null), w(this, nt, 0), w(this, Fe, 0), w(this, Pt, !1), w(this, In, /* @__PURE__ */ new Set()), w(this, On, /* @__PURE__ */ new Set()), w(this, Oe, null), w(this, kr, Xs(() => (T(Oe, this, cn(d(nt, this))), () => {
|
|
627
627
|
T(Oe, this, null);
|
|
628
628
|
}))), T(ie, this, e), T(ue, this, t), T(Et, this, (i) => {
|
|
629
629
|
var o = E;
|
|
630
630
|
o.b = this, o.f |= 128, n(i);
|
|
631
|
-
}), this.parent = E.b, this.transform_error = r ?? this.parent?.transform_error ?? ((i) => i), T(Q, this,
|
|
631
|
+
}), this.parent = E.b, this.transform_error = r ?? this.parent?.transform_error ?? ((i) => i), T(Q, this, ma(() => {
|
|
632
632
|
if (re) {
|
|
633
|
-
const i = d(
|
|
634
|
-
|
|
633
|
+
const i = d(xn, this);
|
|
634
|
+
fi();
|
|
635
635
|
const o = i.data === "[!";
|
|
636
636
|
if (i.data.startsWith("[?")) {
|
|
637
637
|
const s = JSON.parse(i.data.slice(2));
|
|
638
|
-
_(B, this,
|
|
639
|
-
} else o ? _(B, this,
|
|
640
|
-
} else _(B, this,
|
|
641
|
-
},
|
|
638
|
+
_(B, this, ea).call(this, s);
|
|
639
|
+
} else o ? _(B, this, ta).call(this) : _(B, this, Zs).call(this);
|
|
640
|
+
} else _(B, this, Oi).call(this);
|
|
641
|
+
}, Ys)), re && T(ie, this, D);
|
|
642
642
|
}
|
|
643
643
|
defer_effect(e) {
|
|
644
|
-
|
|
644
|
+
Si(e, d(In, this), d(On, this));
|
|
645
645
|
}
|
|
646
646
|
is_rendered() {
|
|
647
647
|
return !this.is_pending && (!this.parent || this.parent.is_rendered());
|
|
@@ -650,8 +650,8 @@ var ie = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new WeakMap(), ue =
|
|
|
650
650
|
return !!d(ue, this).pending;
|
|
651
651
|
}
|
|
652
652
|
update_pending_count(e, t) {
|
|
653
|
-
_(B, this,
|
|
654
|
-
T(Pt, this, !1), d(Oe, this) &&
|
|
653
|
+
_(B, this, Mi).call(this, e, t), T(nt, this, d(nt, this) + e), !(!d(Oe, this) || d(Pt, this)) && (T(Pt, this, !0), at(() => {
|
|
654
|
+
T(Pt, this, !1), d(Oe, this) && Pi(d(Oe, this), d(nt, this));
|
|
655
655
|
}));
|
|
656
656
|
}
|
|
657
657
|
get_effect_pending() {
|
|
@@ -664,36 +664,36 @@ var ie = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new WeakMap(), ue =
|
|
|
664
664
|
})) : _(B, this, Er).call(this, e);
|
|
665
665
|
}
|
|
666
666
|
};
|
|
667
|
-
function
|
|
667
|
+
function Zs() {
|
|
668
668
|
try {
|
|
669
669
|
T(he, this, Ue(() => d(Et, this).call(this, d(ie, this))));
|
|
670
670
|
} catch (e) {
|
|
671
671
|
this.error(e);
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function ea(e) {
|
|
675
675
|
const t = d(ue, this).failed;
|
|
676
676
|
t && T(te, this, Ue(() => {
|
|
677
677
|
t(d(ie, this), () => e, () => () => {
|
|
678
678
|
});
|
|
679
679
|
}));
|
|
680
680
|
}
|
|
681
|
-
function
|
|
681
|
+
function ta() {
|
|
682
682
|
const e = d(ue, this).pending;
|
|
683
683
|
e && (this.is_pending = !0, T(K, this, Ue(() => e(d(ie, this)))), at(() => {
|
|
684
|
-
var t = T(
|
|
685
|
-
t.append(n), T(he, this, _(B, this,
|
|
684
|
+
var t = T(ze, this, document.createDocumentFragment()), n = zi();
|
|
685
|
+
t.append(n), T(he, this, _(B, this, Mn).call(this, () => Ue(() => d(Et, this).call(this, n)))), d(Fe, this) === 0 && (d(ie, this).before(t), T(ze, this, null), un(d(K, this), () => {
|
|
686
686
|
T(K, this, null);
|
|
687
687
|
}), _(B, this, tr).call(this, x));
|
|
688
688
|
}));
|
|
689
689
|
}
|
|
690
|
-
function
|
|
690
|
+
function Oi() {
|
|
691
691
|
try {
|
|
692
692
|
if (this.is_pending = this.has_pending_snippet(), T(Fe, this, 0), T(nt, this, 0), T(he, this, Ue(() => {
|
|
693
693
|
d(Et, this).call(this, d(ie, this));
|
|
694
694
|
})), d(Fe, this) > 0) {
|
|
695
|
-
var e = T(
|
|
696
|
-
|
|
695
|
+
var e = T(ze, this, document.createDocumentFragment());
|
|
696
|
+
ba(d(he, this), e);
|
|
697
697
|
const t = d(ue, this).pending;
|
|
698
698
|
T(K, this, Ue(() => t(d(ie, this))));
|
|
699
699
|
} else _(B, this, tr).call(this, x);
|
|
@@ -702,45 +702,45 @@ function Ci() {
|
|
|
702
702
|
}
|
|
703
703
|
}
|
|
704
704
|
function tr(e) {
|
|
705
|
-
this.is_pending = !1, e.transfer_effects(d(
|
|
705
|
+
this.is_pending = !1, e.transfer_effects(d(In, this), d(On, this));
|
|
706
706
|
}
|
|
707
|
-
function
|
|
707
|
+
function Mn(e) {
|
|
708
708
|
var t = E, n = k, r = L;
|
|
709
709
|
xe(d(Q, this)), de(d(Q, this)), Kt(d(Q, this).ctx);
|
|
710
710
|
try {
|
|
711
711
|
return ht.ensure(), e();
|
|
712
712
|
} catch (i) {
|
|
713
|
-
return
|
|
713
|
+
return bi(i), null;
|
|
714
714
|
} finally {
|
|
715
715
|
xe(t), de(n), Kt(r);
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
|
-
function
|
|
718
|
+
function Mi(e, t) {
|
|
719
719
|
if (!this.has_pending_snippet()) {
|
|
720
720
|
if (this.parent) {
|
|
721
721
|
var n;
|
|
722
|
-
_(B, n = this.parent,
|
|
722
|
+
_(B, n = this.parent, Mi).call(n, e, t);
|
|
723
723
|
}
|
|
724
724
|
return;
|
|
725
725
|
}
|
|
726
726
|
T(Fe, this, d(Fe, this) + e), d(Fe, this) === 0 && (_(B, this, tr).call(this, t), d(K, this) && un(d(K, this), () => {
|
|
727
727
|
T(K, this, null);
|
|
728
|
-
}), d(
|
|
728
|
+
}), d(ze, this) && (d(ie, this).before(d(ze, this)), T(ze, this, null)));
|
|
729
729
|
}
|
|
730
730
|
function Er(e) {
|
|
731
|
-
d(he, this) && (oe(d(he, this)), T(he, this, null)), d(K, this) && (oe(d(K, this)), T(K, this, null)), d(te, this) && (oe(d(te, this)), T(te, this, null)), re && (kt(d(
|
|
731
|
+
d(he, this) && (oe(d(he, this)), T(he, this, null)), d(K, this) && (oe(d(K, this)), T(K, this, null)), d(te, this) && (oe(d(te, this)), T(te, this, null)), re && (kt(d(xn, this)), Ns(), kt(Hs()));
|
|
732
732
|
var t = d(ue, this).onerror;
|
|
733
733
|
let n = d(ue, this).failed;
|
|
734
734
|
var r = !1, i = !1;
|
|
735
735
|
const o = () => {
|
|
736
736
|
if (r) {
|
|
737
|
-
|
|
737
|
+
Ps();
|
|
738
738
|
return;
|
|
739
739
|
}
|
|
740
|
-
r = !0, i &&
|
|
740
|
+
r = !0, i && Rs(), d(te, this) !== null && un(d(te, this), () => {
|
|
741
741
|
T(te, this, null);
|
|
742
|
-
}), _(B, this,
|
|
743
|
-
_(B, this,
|
|
742
|
+
}), _(B, this, Mn).call(this, () => {
|
|
743
|
+
_(B, this, Oi).call(this);
|
|
744
744
|
});
|
|
745
745
|
}, s = (a) => {
|
|
746
746
|
try {
|
|
@@ -748,7 +748,7 @@ function Er(e) {
|
|
|
748
748
|
} catch (l) {
|
|
749
749
|
it(l, d(Q, this) && d(Q, this).parent);
|
|
750
750
|
}
|
|
751
|
-
n && T(te, this, _(B, this,
|
|
751
|
+
n && T(te, this, _(B, this, Mn).call(this, () => {
|
|
752
752
|
try {
|
|
753
753
|
return Ue(() => {
|
|
754
754
|
var l = E;
|
|
@@ -777,7 +777,7 @@ function tn(e) {
|
|
|
777
777
|
ctx: L,
|
|
778
778
|
deps: null,
|
|
779
779
|
effects: null,
|
|
780
|
-
equals:
|
|
780
|
+
equals: pi,
|
|
781
781
|
f: t,
|
|
782
782
|
fn: e,
|
|
783
783
|
reactions: null,
|
|
@@ -791,14 +791,14 @@ function tn(e) {
|
|
|
791
791
|
// @__NO_SIDE_EFFECTS__
|
|
792
792
|
function Ar(e) {
|
|
793
793
|
const t = /* @__PURE__ */ tn(e);
|
|
794
|
-
return Ce ||
|
|
794
|
+
return Ce || Ui(t), t;
|
|
795
795
|
}
|
|
796
796
|
// @__NO_SIDE_EFFECTS__
|
|
797
|
-
function
|
|
797
|
+
function na(e) {
|
|
798
798
|
const t = /* @__PURE__ */ tn(e);
|
|
799
|
-
return t.equals =
|
|
799
|
+
return t.equals = gi, t;
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function ra(e) {
|
|
802
802
|
var t = e.effects;
|
|
803
803
|
if (t !== null) {
|
|
804
804
|
e.effects = null;
|
|
@@ -808,39 +808,39 @@ function Zs(e) {
|
|
|
808
808
|
function nr(e) {
|
|
809
809
|
var t, n = E, r = e.parent;
|
|
810
810
|
if (!ve && r !== null && e.v !== H && (r.f & 24576) !== 0)
|
|
811
|
-
return
|
|
811
|
+
return $s(), e.v;
|
|
812
812
|
xe(r);
|
|
813
813
|
try {
|
|
814
|
-
e.f &= ~xt,
|
|
814
|
+
e.f &= ~xt, ra(e), t = Ji(e);
|
|
815
815
|
} finally {
|
|
816
816
|
xe(n);
|
|
817
817
|
}
|
|
818
818
|
return t;
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function Li(e) {
|
|
821
821
|
var t = nr(e);
|
|
822
|
-
if (!e.equals(t) && (e.wv =
|
|
822
|
+
if (!e.equals(t) && (e.wv = Xi(), (!x?.is_fork || e.deps === null) && (x !== null ? (x.capture(e, t, !0), En?.capture(e, t, !0)) : e.v = t, e.deps === null))) {
|
|
823
823
|
P(e, ae);
|
|
824
824
|
return;
|
|
825
825
|
}
|
|
826
|
-
ve || (
|
|
826
|
+
ve || (z !== null ? (rr() || x?.is_fork) && z.set(e, t) : Jn(e));
|
|
827
827
|
}
|
|
828
|
-
function
|
|
828
|
+
function ia(e) {
|
|
829
829
|
if (e.effects !== null)
|
|
830
|
-
for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(Yn), t.fn !== null && (t.teardown =
|
|
830
|
+
for (const t of e.effects) (t.teardown || t.ac) && (t.teardown?.(), t.ac?.abort(Yn), t.fn !== null && (t.teardown = fs), t.ac = null, At(t, 0), or(t));
|
|
831
831
|
}
|
|
832
|
-
function
|
|
832
|
+
function Ri(e) {
|
|
833
833
|
if (e.effects !== null)
|
|
834
834
|
for (const t of e.effects) t.teardown && t.fn !== null && ct(t);
|
|
835
835
|
}
|
|
836
836
|
var nn = /* @__PURE__ */ new Set(), De = /* @__PURE__ */ new Map();
|
|
837
|
-
var
|
|
837
|
+
var $i = !1;
|
|
838
838
|
function cn(e, t) {
|
|
839
839
|
var n = {
|
|
840
840
|
f: 0,
|
|
841
841
|
v: e,
|
|
842
842
|
reactions: null,
|
|
843
|
-
equals:
|
|
843
|
+
equals: pi,
|
|
844
844
|
rv: 0,
|
|
845
845
|
wv: 0
|
|
846
846
|
};
|
|
@@ -849,36 +849,36 @@ function cn(e, t) {
|
|
|
849
849
|
// @__NO_SIDE_EFFECTS__
|
|
850
850
|
function F(e, t) {
|
|
851
851
|
const n = cn(e, t);
|
|
852
|
-
return
|
|
852
|
+
return Ui(n), n;
|
|
853
853
|
}
|
|
854
854
|
// @__NO_SIDE_EFFECTS__
|
|
855
|
-
function
|
|
855
|
+
function oa(e, t = !1, n = !0) {
|
|
856
856
|
const r = cn(e);
|
|
857
|
-
if (t || (r.equals =
|
|
857
|
+
if (t || (r.equals = gi), It && n && L !== null && L.l !== null) {
|
|
858
858
|
var i;
|
|
859
859
|
((i = L.l).s ?? (i.s = [])).push(r);
|
|
860
860
|
}
|
|
861
861
|
return r;
|
|
862
862
|
}
|
|
863
863
|
function M(e, t, n = !1) {
|
|
864
|
-
k !== null && (!ne || (k.f & 131072) !== 0) && ln() && (k.f & 4325394) !== 0 && (se === null || !se.has(e)) &&
|
|
864
|
+
k !== null && (!ne || (k.f & 131072) !== 0) && ln() && (k.f & 4325394) !== 0 && (se === null || !se.has(e)) && Ls();
|
|
865
865
|
let r = n ? ot(t) : t;
|
|
866
|
-
return
|
|
866
|
+
return Pi(e, r, Yt);
|
|
867
867
|
}
|
|
868
|
-
function
|
|
868
|
+
function Pi(e, t, n = null) {
|
|
869
869
|
if (!e.equals(t)) {
|
|
870
870
|
De.set(e, ve ? t : e.v);
|
|
871
871
|
var r = ht.ensure();
|
|
872
872
|
if (r.capture(e, t), (e.f & 2) !== 0) {
|
|
873
873
|
const i = e;
|
|
874
|
-
(e.f & 2048) !== 0 && nr(i),
|
|
874
|
+
(e.f & 2048) !== 0 && nr(i), z === null && Jn(i);
|
|
875
875
|
}
|
|
876
|
-
e.wv =
|
|
876
|
+
e.wv = Xi(), Ni(e, le, n), ln() && E !== null && (E.f & 1024) !== 0 && (E.f & 96) === 0 && (Y === null ? Sa([e]) : Y.push(e)), !r.is_fork && nn.size > 0 && !$i && sa();
|
|
877
877
|
}
|
|
878
878
|
return t;
|
|
879
879
|
}
|
|
880
|
-
function
|
|
881
|
-
|
|
880
|
+
function sa() {
|
|
881
|
+
$i = !1;
|
|
882
882
|
for (const e of nn) {
|
|
883
883
|
(e.f & 1024) !== 0 && P(e, Ye);
|
|
884
884
|
let t;
|
|
@@ -894,7 +894,7 @@ function na() {
|
|
|
894
894
|
function wt(e) {
|
|
895
895
|
M(e, e.v + 1);
|
|
896
896
|
}
|
|
897
|
-
function
|
|
897
|
+
function Ni(e, t, n) {
|
|
898
898
|
var r = e.reactions;
|
|
899
899
|
if (r !== null)
|
|
900
900
|
for (var i = ln(), o = r.length, s = 0; s < o; s++) {
|
|
@@ -904,7 +904,7 @@ function Ri(e, t, n) {
|
|
|
904
904
|
if (c && P(a, t), (l & 131072) !== 0) nn.add(a);
|
|
905
905
|
else if ((l & 2) !== 0) {
|
|
906
906
|
var u = a;
|
|
907
|
-
|
|
907
|
+
z?.delete(u), (l & 65536) === 0 && (l & 512 && (E === null || (E.f & 2097152) === 0) && (a.f |= xt), Ni(u, Ye, n));
|
|
908
908
|
} else if (c) {
|
|
909
909
|
var h = a;
|
|
910
910
|
(l & 16) !== 0 && ge !== null && ge.add(h), n !== null ? n.push(h) : er(h);
|
|
@@ -912,17 +912,17 @@ function Ri(e, t, n) {
|
|
|
912
912
|
}
|
|
913
913
|
}
|
|
914
914
|
}
|
|
915
|
-
var
|
|
915
|
+
var aa = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;
|
|
916
916
|
function ot(e) {
|
|
917
917
|
if (typeof e != "object" || e === null || St in e) return e;
|
|
918
|
-
const t =
|
|
919
|
-
if (t !==
|
|
920
|
-
var n = /* @__PURE__ */ new Map(), r =
|
|
918
|
+
const t = ds(e);
|
|
919
|
+
if (t !== us && t !== hs) return e;
|
|
920
|
+
var n = /* @__PURE__ */ new Map(), r = as(e), i = /* @__PURE__ */ F(0), o = null, s = je, a = (h) => {
|
|
921
921
|
if (je === s) return h();
|
|
922
|
-
var
|
|
922
|
+
var p = k, g = je;
|
|
923
923
|
de(null), Ir(s);
|
|
924
924
|
var m = h();
|
|
925
|
-
return de(
|
|
925
|
+
return de(p), Ir(g), m;
|
|
926
926
|
};
|
|
927
927
|
r && n.set("length", /* @__PURE__ */ F(e.length, o));
|
|
928
928
|
var l = "";
|
|
@@ -930,49 +930,49 @@ function ot(e) {
|
|
|
930
930
|
function u(h) {
|
|
931
931
|
if (!c) {
|
|
932
932
|
c = !0, l = h, Sr(i, `${l} version`);
|
|
933
|
-
for (const [
|
|
933
|
+
for (const [p, g] of n) Sr(g, la(l, p));
|
|
934
934
|
c = !1;
|
|
935
935
|
}
|
|
936
936
|
}
|
|
937
937
|
return new Proxy(e, {
|
|
938
|
-
defineProperty(h,
|
|
939
|
-
(!("value" in g) || g.configurable === !1 || g.enumerable === !1 || g.writable === !1) &&
|
|
940
|
-
var m = n.get(
|
|
938
|
+
defineProperty(h, p, g) {
|
|
939
|
+
(!("value" in g) || g.configurable === !1 || g.enumerable === !1 || g.writable === !1) && Os();
|
|
940
|
+
var m = n.get(p);
|
|
941
941
|
return m === void 0 ? a(() => {
|
|
942
942
|
var v = /* @__PURE__ */ F(g.value, o);
|
|
943
|
-
return n.set(
|
|
943
|
+
return n.set(p, v), v;
|
|
944
944
|
}) : M(m, g.value, !0), !0;
|
|
945
945
|
},
|
|
946
|
-
deleteProperty(h,
|
|
947
|
-
var g = n.get(
|
|
946
|
+
deleteProperty(h, p) {
|
|
947
|
+
var g = n.get(p);
|
|
948
948
|
if (g === void 0) {
|
|
949
|
-
if (
|
|
949
|
+
if (p in h) {
|
|
950
950
|
const m = a(() => /* @__PURE__ */ F(H, o));
|
|
951
|
-
n.set(
|
|
951
|
+
n.set(p, m), wt(i);
|
|
952
952
|
}
|
|
953
953
|
} else
|
|
954
954
|
M(g, H), wt(i);
|
|
955
955
|
return !0;
|
|
956
956
|
},
|
|
957
|
-
get(h,
|
|
958
|
-
if (
|
|
959
|
-
var m = n.get(
|
|
960
|
-
if (m === void 0 && (!v || Be(h,
|
|
961
|
-
var S = /* @__PURE__ */ F(ot(v ? h[
|
|
957
|
+
get(h, p, g) {
|
|
958
|
+
if (p === St) return e;
|
|
959
|
+
var m = n.get(p), v = p in h;
|
|
960
|
+
if (m === void 0 && (!v || Be(h, p)?.writable) && (m = a(() => {
|
|
961
|
+
var S = /* @__PURE__ */ F(ot(v ? h[p] : H), o);
|
|
962
962
|
return S;
|
|
963
|
-
}), n.set(
|
|
963
|
+
}), n.set(p, m)), m !== void 0) {
|
|
964
964
|
var y = b(m);
|
|
965
965
|
return y === H ? void 0 : y;
|
|
966
966
|
}
|
|
967
|
-
return Reflect.get(h,
|
|
967
|
+
return Reflect.get(h, p, g);
|
|
968
968
|
},
|
|
969
|
-
getOwnPropertyDescriptor(h,
|
|
970
|
-
var g = Reflect.getOwnPropertyDescriptor(h,
|
|
969
|
+
getOwnPropertyDescriptor(h, p) {
|
|
970
|
+
var g = Reflect.getOwnPropertyDescriptor(h, p);
|
|
971
971
|
if (g && "value" in g) {
|
|
972
|
-
var m = n.get(
|
|
972
|
+
var m = n.get(p);
|
|
973
973
|
m && (g.value = b(m));
|
|
974
974
|
} else if (g === void 0) {
|
|
975
|
-
var v = n.get(
|
|
975
|
+
var v = n.get(p), y = v?.v;
|
|
976
976
|
if (v !== void 0 && y !== H) return {
|
|
977
977
|
enumerable: !0,
|
|
978
978
|
configurable: !0,
|
|
@@ -982,31 +982,31 @@ function ot(e) {
|
|
|
982
982
|
}
|
|
983
983
|
return g;
|
|
984
984
|
},
|
|
985
|
-
has(h,
|
|
986
|
-
if (
|
|
987
|
-
var g = n.get(
|
|
988
|
-
return (g !== void 0 || E !== null && (!m || Be(h,
|
|
989
|
-
var v = /* @__PURE__ */ F(m ? ot(h[
|
|
985
|
+
has(h, p) {
|
|
986
|
+
if (p === St) return !0;
|
|
987
|
+
var g = n.get(p), m = g !== void 0 && g.v !== H || Reflect.has(h, p);
|
|
988
|
+
return (g !== void 0 || E !== null && (!m || Be(h, p)?.writable)) && (g === void 0 && (g = a(() => {
|
|
989
|
+
var v = /* @__PURE__ */ F(m ? ot(h[p]) : H, o);
|
|
990
990
|
return v;
|
|
991
|
-
}), n.set(
|
|
991
|
+
}), n.set(p, g)), b(g) === H) ? !1 : m;
|
|
992
992
|
},
|
|
993
|
-
set(h,
|
|
994
|
-
var v = n.get(
|
|
995
|
-
if (r &&
|
|
993
|
+
set(h, p, g, m) {
|
|
994
|
+
var v = n.get(p), y = p in h;
|
|
995
|
+
if (r && p === "length") for (var S = g; S < v.v; S += 1) {
|
|
996
996
|
var O = n.get(S + "");
|
|
997
997
|
O !== void 0 ? M(O, H) : S in h && (O = a(() => /* @__PURE__ */ F(H, o)), n.set(S + "", O));
|
|
998
998
|
}
|
|
999
999
|
if (v === void 0)
|
|
1000
|
-
(!y || Be(h,
|
|
1000
|
+
(!y || Be(h, p)?.writable) && (v = a(() => /* @__PURE__ */ F(void 0, o)), M(v, ot(g)), n.set(p, v));
|
|
1001
1001
|
else {
|
|
1002
1002
|
y = v.v !== H;
|
|
1003
1003
|
var V = a(() => ot(g));
|
|
1004
1004
|
M(v, V);
|
|
1005
1005
|
}
|
|
1006
|
-
var A = Reflect.getOwnPropertyDescriptor(h,
|
|
1006
|
+
var A = Reflect.getOwnPropertyDescriptor(h, p);
|
|
1007
1007
|
if (A?.set && A.set.call(m, g), !y) {
|
|
1008
|
-
if (r && typeof
|
|
1009
|
-
var G = n.get("length"), Z = Number(
|
|
1008
|
+
if (r && typeof p == "string") {
|
|
1009
|
+
var G = n.get("length"), Z = Number(p);
|
|
1010
1010
|
Number.isInteger(Z) && Z >= G.v && M(G, Z + 1);
|
|
1011
1011
|
}
|
|
1012
1012
|
wt(i);
|
|
@@ -1015,47 +1015,47 @@ function ot(e) {
|
|
|
1015
1015
|
},
|
|
1016
1016
|
ownKeys(h) {
|
|
1017
1017
|
b(i);
|
|
1018
|
-
var
|
|
1018
|
+
var p = Reflect.ownKeys(h).filter((v) => {
|
|
1019
1019
|
var y = n.get(v);
|
|
1020
1020
|
return y === void 0 || y.v !== H;
|
|
1021
1021
|
});
|
|
1022
|
-
for (var [g, m] of n) m.v !== H && !(g in h) &&
|
|
1023
|
-
return
|
|
1022
|
+
for (var [g, m] of n) m.v !== H && !(g in h) && p.push(g);
|
|
1023
|
+
return p;
|
|
1024
1024
|
},
|
|
1025
1025
|
setPrototypeOf() {
|
|
1026
|
-
|
|
1026
|
+
Ms();
|
|
1027
1027
|
}
|
|
1028
1028
|
});
|
|
1029
1029
|
}
|
|
1030
|
-
function
|
|
1031
|
-
return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` :
|
|
1030
|
+
function la(e, t) {
|
|
1031
|
+
return typeof t == "symbol" ? `${e}[Symbol(${t.description ?? ""})]` : aa.test(t) ? `${e}.${t}` : /^\d+$/.test(t) ? `${e}[${t}]` : `${e}['${t}']`;
|
|
1032
1032
|
}
|
|
1033
|
-
var Cr,
|
|
1034
|
-
function
|
|
1033
|
+
var Cr, ca, Hi, Bi, Wi;
|
|
1034
|
+
function Ln() {
|
|
1035
1035
|
if (Cr === void 0) {
|
|
1036
|
-
Cr = window,
|
|
1036
|
+
Cr = window, ca = document, Hi = /Firefox/.test(navigator.userAgent);
|
|
1037
1037
|
var e = Element.prototype, t = Node.prototype, n = Text.prototype;
|
|
1038
|
-
|
|
1038
|
+
Bi = Be(t, "firstChild").get, Wi = Be(t, "nextSibling").get, yr(e) && (e[Ts] = void 0, e[bs] = null, e[Ss] = void 0, e.__e = void 0), yr(n) && (n[_s] = void 0);
|
|
1039
1039
|
}
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1041
|
+
function zi(e = "") {
|
|
1042
1042
|
return document.createTextNode(e);
|
|
1043
1043
|
}
|
|
1044
1044
|
// @__NO_SIDE_EFFECTS__
|
|
1045
|
-
function
|
|
1046
|
-
return
|
|
1045
|
+
function Rn(e) {
|
|
1046
|
+
return Bi.call(e);
|
|
1047
1047
|
}
|
|
1048
1048
|
// @__NO_SIDE_EFFECTS__
|
|
1049
1049
|
function dt(e) {
|
|
1050
|
-
return
|
|
1050
|
+
return Wi.call(e);
|
|
1051
1051
|
}
|
|
1052
|
-
function
|
|
1052
|
+
function ua(e) {
|
|
1053
1053
|
e.textContent = "";
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1055
|
+
function Fi(e, t, n) {
|
|
1056
1056
|
return t == null || t === "http://www.w3.org/1999/xhtml" ? n ? document.createElement(e, { is: n }) : document.createElement(e) : n ? document.createElementNS(t, e, { is: n }) : document.createElementNS(t, e);
|
|
1057
1057
|
}
|
|
1058
|
-
function
|
|
1058
|
+
function Di(e) {
|
|
1059
1059
|
var t = k, n = E;
|
|
1060
1060
|
de(null), xe(null);
|
|
1061
1061
|
try {
|
|
@@ -1064,16 +1064,16 @@ function zi(e) {
|
|
|
1064
1064
|
de(t), xe(n);
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
1068
|
-
E === null && (k === null &&
|
|
1067
|
+
function ha(e) {
|
|
1068
|
+
E === null && (k === null && As(e), Es()), ve && ks(e);
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function da(e, t) {
|
|
1071
1071
|
var n = t.last;
|
|
1072
1072
|
n === null ? t.last = t.first = e : (n.next = e, e.prev = n, t.last = e);
|
|
1073
1073
|
}
|
|
1074
1074
|
function Je(e, t) {
|
|
1075
1075
|
var n = E;
|
|
1076
|
-
n !== null && (n.f & 8192) !== 0 && (e |=
|
|
1076
|
+
n !== null && (n.f & 8192) !== 0 && (e |= ai);
|
|
1077
1077
|
var r = {
|
|
1078
1078
|
ctx: L,
|
|
1079
1079
|
deps: null,
|
|
@@ -1099,9 +1099,9 @@ function Je(e, t) {
|
|
|
1099
1099
|
} catch (s) {
|
|
1100
1100
|
throw oe(r), s;
|
|
1101
1101
|
}
|
|
1102
|
-
i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && (i.f & 524288) === 0 && (i = i.first, (e & 16) !== 0 && (e & 65536) !== 0 && i !== null && (i.f |=
|
|
1102
|
+
i.deps === null && i.teardown === null && i.nodes === null && i.first === i.last && (i.f & 524288) === 0 && (i = i.first, (e & 16) !== 0 && (e & 65536) !== 0 && i !== null && (i.f |= ci));
|
|
1103
1103
|
}
|
|
1104
|
-
if (i !== null && (i.parent = n, n !== null &&
|
|
1104
|
+
if (i !== null && (i.parent = n, n !== null && da(i, n), k !== null && (k.f & 2) !== 0 && (e & 64) === 0)) {
|
|
1105
1105
|
var o = k;
|
|
1106
1106
|
(o.effects ?? (o.effects = [])).push(i);
|
|
1107
1107
|
}
|
|
@@ -1111,24 +1111,24 @@ function rr() {
|
|
|
1111
1111
|
return k !== null && !ne;
|
|
1112
1112
|
}
|
|
1113
1113
|
function Re(e) {
|
|
1114
|
-
|
|
1114
|
+
ha("$effect");
|
|
1115
1115
|
var t = E.f;
|
|
1116
1116
|
if (!k && (t & 32) !== 0 && L !== null && !L.i) {
|
|
1117
1117
|
var n = L;
|
|
1118
1118
|
(n.e ?? (n.e = [])).push(e);
|
|
1119
|
-
} else return
|
|
1119
|
+
} else return ji(e);
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1122
|
-
return Je(4 |
|
|
1121
|
+
function ji(e) {
|
|
1122
|
+
return Je(4 | vs, e);
|
|
1123
1123
|
}
|
|
1124
|
-
function
|
|
1124
|
+
function fa(e) {
|
|
1125
1125
|
ht.ensure();
|
|
1126
1126
|
const t = Je(64 | Ct, e);
|
|
1127
1127
|
return () => {
|
|
1128
1128
|
oe(t);
|
|
1129
1129
|
};
|
|
1130
1130
|
}
|
|
1131
|
-
function
|
|
1131
|
+
function pa(e) {
|
|
1132
1132
|
ht.ensure();
|
|
1133
1133
|
const t = Je(64 | Ct, e);
|
|
1134
1134
|
return (n = {}) => new Promise((r) => {
|
|
@@ -1137,20 +1137,20 @@ function ua(e) {
|
|
|
1137
1137
|
}) : (oe(t), r(void 0));
|
|
1138
1138
|
});
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1140
|
+
function ga(e) {
|
|
1141
1141
|
return Je(4, e);
|
|
1142
1142
|
}
|
|
1143
1143
|
function ir(e, t = 0) {
|
|
1144
1144
|
return Je(8 | t, e);
|
|
1145
1145
|
}
|
|
1146
|
-
function
|
|
1146
|
+
function ma(e, t = 0) {
|
|
1147
1147
|
var n = Je(16 | t, e);
|
|
1148
1148
|
return n;
|
|
1149
1149
|
}
|
|
1150
1150
|
function Ue(e) {
|
|
1151
1151
|
return Je(32 | Ct, e);
|
|
1152
1152
|
}
|
|
1153
|
-
function
|
|
1153
|
+
function qi(e) {
|
|
1154
1154
|
var t = e.teardown;
|
|
1155
1155
|
if (t !== null) {
|
|
1156
1156
|
const n = ve, r = k;
|
|
@@ -1166,14 +1166,14 @@ function or(e, t = !1) {
|
|
|
1166
1166
|
var n = e.first;
|
|
1167
1167
|
for (e.first = e.last = null; n !== null; ) {
|
|
1168
1168
|
const i = n.ac;
|
|
1169
|
-
i !== null &&
|
|
1169
|
+
i !== null && Di(() => {
|
|
1170
1170
|
i.abort(Yn);
|
|
1171
1171
|
});
|
|
1172
1172
|
var r = n.next;
|
|
1173
1173
|
(n.f & 64) !== 0 ? n.parent = null : oe(n, t), n = r;
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
|
-
function
|
|
1176
|
+
function va(e) {
|
|
1177
1177
|
for (var t = e.first; t !== null; ) {
|
|
1178
1178
|
var n = t.next;
|
|
1179
1179
|
(t.f & 32) === 0 && oe(t), t = n;
|
|
@@ -1181,26 +1181,26 @@ function fa(e) {
|
|
|
1181
1181
|
}
|
|
1182
1182
|
function oe(e, t = !0) {
|
|
1183
1183
|
var n = !1;
|
|
1184
|
-
(t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (
|
|
1184
|
+
(t || (e.f & 262144) !== 0) && e.nodes !== null && e.nodes.end !== null && (ya(e.nodes.start, e.nodes.end), n = !0), P(e, br), or(e, t && !n), At(e, 0);
|
|
1185
1185
|
var r = e.nodes && e.nodes.t;
|
|
1186
1186
|
if (r !== null) for (const o of r) o.stop();
|
|
1187
|
-
|
|
1187
|
+
qi(e), e.f ^= br, e.f |= ms;
|
|
1188
1188
|
var i = e.parent;
|
|
1189
|
-
i !== null && i.first !== null &&
|
|
1189
|
+
i !== null && i.first !== null && Vi(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes = e.ac = e.b = null;
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1191
|
+
function ya(e, t) {
|
|
1192
1192
|
for (; e !== null; ) {
|
|
1193
1193
|
var n = e === t ? null : /* @__PURE__ */ dt(e);
|
|
1194
1194
|
e.remove(), e = n;
|
|
1195
1195
|
}
|
|
1196
1196
|
}
|
|
1197
|
-
function
|
|
1197
|
+
function Vi(e) {
|
|
1198
1198
|
var t = e.parent, n = e.prev, r = e.next;
|
|
1199
1199
|
n !== null && (n.next = r), r !== null && (r.prev = n), t !== null && (t.first === e && (t.first = r), t.last === e && (t.last = n));
|
|
1200
1200
|
}
|
|
1201
1201
|
function un(e, t, n = !0) {
|
|
1202
1202
|
var r = [];
|
|
1203
|
-
|
|
1203
|
+
Gi(e, r, !0);
|
|
1204
1204
|
var i = () => {
|
|
1205
1205
|
n && oe(e), t && t();
|
|
1206
1206
|
}, o = r.length;
|
|
@@ -1209,9 +1209,9 @@ function un(e, t, n = !0) {
|
|
|
1209
1209
|
for (var a of r) a.out(s);
|
|
1210
1210
|
} else i();
|
|
1211
1211
|
}
|
|
1212
|
-
function
|
|
1212
|
+
function Gi(e, t, n) {
|
|
1213
1213
|
if ((e.f & 8192) === 0) {
|
|
1214
|
-
e.f ^=
|
|
1214
|
+
e.f ^= ai;
|
|
1215
1215
|
var r = e.nodes && e.nodes.t;
|
|
1216
1216
|
if (r !== null)
|
|
1217
1217
|
for (const a of r) (a.is_global || n) && t.push(a);
|
|
@@ -1219,20 +1219,20 @@ function ji(e, t, n) {
|
|
|
1219
1219
|
var o = i.next;
|
|
1220
1220
|
if ((i.f & 64) === 0) {
|
|
1221
1221
|
var s = (i.f & 65536) !== 0 || (i.f & 32) !== 0 && (e.f & 16) !== 0;
|
|
1222
|
-
|
|
1222
|
+
Gi(i, t, s ? n : !1);
|
|
1223
1223
|
}
|
|
1224
1224
|
i = o;
|
|
1225
1225
|
}
|
|
1226
1226
|
}
|
|
1227
1227
|
}
|
|
1228
|
-
function
|
|
1228
|
+
function ba(e, t) {
|
|
1229
1229
|
if (e.nodes)
|
|
1230
1230
|
for (var n = e.nodes.start, r = e.nodes.end; n !== null; ) {
|
|
1231
1231
|
var i = n === r ? null : /* @__PURE__ */ dt(n);
|
|
1232
1232
|
t.append(n), n = i;
|
|
1233
1233
|
}
|
|
1234
1234
|
}
|
|
1235
|
-
var
|
|
1235
|
+
var Ta = null, Wt = !1, ve = !1;
|
|
1236
1236
|
function xr(e) {
|
|
1237
1237
|
ve = e;
|
|
1238
1238
|
}
|
|
@@ -1245,19 +1245,19 @@ function xe(e) {
|
|
|
1245
1245
|
E = e;
|
|
1246
1246
|
}
|
|
1247
1247
|
var se = null;
|
|
1248
|
-
function
|
|
1248
|
+
function Ui(e) {
|
|
1249
1249
|
k !== null && (!Ce || (k.f & 2) !== 0) && (se ?? (se = /* @__PURE__ */ new Set())).add(e);
|
|
1250
1250
|
}
|
|
1251
1251
|
var q = null, U = 0, Y = null;
|
|
1252
|
-
function
|
|
1252
|
+
function Sa(e) {
|
|
1253
1253
|
Y = e;
|
|
1254
1254
|
}
|
|
1255
|
-
var
|
|
1255
|
+
var Ki = 1, Ne = 0, je = Ne;
|
|
1256
1256
|
function Ir(e) {
|
|
1257
1257
|
je = e;
|
|
1258
1258
|
}
|
|
1259
|
-
function
|
|
1260
|
-
return ++
|
|
1259
|
+
function Xi() {
|
|
1260
|
+
return ++Ki;
|
|
1261
1261
|
}
|
|
1262
1262
|
function Ot(e) {
|
|
1263
1263
|
var t = e.f;
|
|
@@ -1265,57 +1265,57 @@ function Ot(e) {
|
|
|
1265
1265
|
if (t & 2 && (e.f &= ~xt), (t & 4096) !== 0) {
|
|
1266
1266
|
for (var n = e.deps, r = n.length, i = 0; i < r; i++) {
|
|
1267
1267
|
var o = n[i];
|
|
1268
|
-
if (Ot(o) &&
|
|
1268
|
+
if (Ot(o) && Li(o), o.wv > e.wv) return !0;
|
|
1269
1269
|
}
|
|
1270
|
-
(t & 512) !== 0 &&
|
|
1270
|
+
(t & 512) !== 0 && z === null && P(e, ae);
|
|
1271
1271
|
}
|
|
1272
1272
|
return !1;
|
|
1273
1273
|
}
|
|
1274
|
-
function
|
|
1274
|
+
function Yi(e, t, n = !0) {
|
|
1275
1275
|
var r = e.reactions;
|
|
1276
1276
|
if (r !== null && !(!Ce && se !== null && se.has(e)))
|
|
1277
1277
|
for (var i = 0; i < r.length; i++) {
|
|
1278
1278
|
var o = r[i];
|
|
1279
|
-
(o.f & 2) !== 0 ?
|
|
1279
|
+
(o.f & 2) !== 0 ? Yi(o, t, !1) : t === o && (n ? P(o, le) : (o.f & 1024) !== 0 && P(o, Ye), er(o));
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
|
-
function
|
|
1282
|
+
function Ji(e) {
|
|
1283
1283
|
var t = q, n = U, r = Y, i = k, o = se, s = L, a = ne, l = je, c = e.f;
|
|
1284
|
-
q = null, U = 0, Y = null, k = (c & 96) === 0 ? e : null, se = null, Kt(e.ctx), ne = !1, je = ++Ne, e.ac !== null && (
|
|
1284
|
+
q = null, U = 0, Y = null, k = (c & 96) === 0 ? e : null, se = null, Kt(e.ctx), ne = !1, je = ++Ne, e.ac !== null && (Di(() => {
|
|
1285
1285
|
e.ac.abort(Yn);
|
|
1286
1286
|
}), e.ac = null);
|
|
1287
1287
|
try {
|
|
1288
1288
|
e.f |= Tr;
|
|
1289
1289
|
var u = e.fn, h = u();
|
|
1290
|
-
e.f |=
|
|
1291
|
-
var
|
|
1290
|
+
e.f |= li;
|
|
1291
|
+
var p = e.deps, g = x?.is_fork;
|
|
1292
1292
|
if (q !== null) {
|
|
1293
1293
|
var m;
|
|
1294
|
-
if (g || At(e, U),
|
|
1295
|
-
for (
|
|
1296
|
-
else e.deps =
|
|
1297
|
-
if (rr() && (e.f & 512) !== 0) for (m = U; m <
|
|
1294
|
+
if (g || At(e, U), p !== null && U > 0)
|
|
1295
|
+
for (p.length = U + q.length, m = 0; m < q.length; m++) p[U + m] = q[m];
|
|
1296
|
+
else e.deps = p = q;
|
|
1297
|
+
if (rr() && (e.f & 512) !== 0) for (m = U; m < p.length; m++) {
|
|
1298
1298
|
var v;
|
|
1299
|
-
((v =
|
|
1299
|
+
((v = p[m]).reactions ?? (v.reactions = [])).push(e);
|
|
1300
1300
|
}
|
|
1301
|
-
} else !g &&
|
|
1302
|
-
if (ln() && Y !== null && !ne &&
|
|
1301
|
+
} else !g && p !== null && U < p.length && (At(e, U), p.length = U);
|
|
1302
|
+
if (ln() && Y !== null && !ne && p !== null && (e.f & 6146) === 0) for (m = 0; m < Y.length; m++) Yi(Y[m], e);
|
|
1303
1303
|
if (i !== null && i !== e) {
|
|
1304
1304
|
if (Ne++, i.deps !== null) for (let y = 0; y < n; y += 1) i.deps[y].rv = Ne;
|
|
1305
1305
|
if (t !== null) for (const y of t) y.rv = Ne;
|
|
1306
1306
|
Y !== null && (r === null ? r = Y : r.push(...Y));
|
|
1307
1307
|
}
|
|
1308
|
-
return (e.f & 8388608) !== 0 && (e.f ^=
|
|
1308
|
+
return (e.f & 8388608) !== 0 && (e.f ^= ui), h;
|
|
1309
1309
|
} catch (y) {
|
|
1310
|
-
return
|
|
1310
|
+
return bi(y);
|
|
1311
1311
|
} finally {
|
|
1312
1312
|
e.f ^= Tr, q = t, U = n, Y = r, k = i, se = o, Kt(s), ne = a, je = l;
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function _a(e, t) {
|
|
1316
1316
|
let n = t.reactions;
|
|
1317
1317
|
if (n !== null) {
|
|
1318
|
-
var r =
|
|
1318
|
+
var r = ls.call(n, e);
|
|
1319
1319
|
if (r !== -1) {
|
|
1320
1320
|
var i = n.length - 1;
|
|
1321
1321
|
i === 0 ? n = t.reactions = null : (n[r] = n[i], n.pop());
|
|
@@ -1323,34 +1323,34 @@ function ya(e, t) {
|
|
|
1323
1323
|
}
|
|
1324
1324
|
if (n === null && (t.f & 2) !== 0 && (q === null || !Vt.call(q, t))) {
|
|
1325
1325
|
var o = t;
|
|
1326
|
-
(o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~xt), o.v !== H && Jn(o),
|
|
1326
|
+
(o.f & 512) !== 0 && (o.f ^= 512, o.f &= ~xt), o.v !== H && Jn(o), ia(o), At(o, 0);
|
|
1327
1327
|
}
|
|
1328
1328
|
}
|
|
1329
1329
|
function At(e, t) {
|
|
1330
1330
|
var n = e.deps;
|
|
1331
1331
|
if (n !== null)
|
|
1332
|
-
for (var r = t; r < n.length; r++)
|
|
1332
|
+
for (var r = t; r < n.length; r++) _a(e, n[r]);
|
|
1333
1333
|
}
|
|
1334
1334
|
function ct(e) {
|
|
1335
1335
|
var t = e.f;
|
|
1336
1336
|
if ((t & 16384) === 0) {
|
|
1337
1337
|
P(e, ae);
|
|
1338
|
-
var n = E, r =
|
|
1339
|
-
if (E = e,
|
|
1338
|
+
var n = E, r = Wt;
|
|
1339
|
+
if (E = e, Wt = !0, 0)
|
|
1340
1340
|
var i, o;
|
|
1341
1341
|
try {
|
|
1342
|
-
(t & 16777232) !== 0 ?
|
|
1343
|
-
var s =
|
|
1344
|
-
if (e.teardown = typeof s == "function" ? s : null, e.wv =
|
|
1342
|
+
(t & 16777232) !== 0 ? va(e) : or(e), qi(e);
|
|
1343
|
+
var s = Ji(e);
|
|
1344
|
+
if (e.teardown = typeof s == "function" ? s : null, e.wv = Ki, 0)
|
|
1345
1345
|
for (var a of e.deps) ;
|
|
1346
1346
|
} finally {
|
|
1347
|
-
|
|
1347
|
+
Wt = r, E = n;
|
|
1348
1348
|
}
|
|
1349
1349
|
}
|
|
1350
1350
|
}
|
|
1351
1351
|
function b(e) {
|
|
1352
1352
|
var t = (e.f & 2) !== 0;
|
|
1353
|
-
if (
|
|
1353
|
+
if (Ta?.add(e), k !== null && !ne && !(E !== null && (E.f & 16384) !== 0) && (se === null || !se.has(e))) {
|
|
1354
1354
|
var n = k.deps;
|
|
1355
1355
|
if ((k.f & 2097152) !== 0)
|
|
1356
1356
|
e.rv < Ne && (e.rv = Ne, q === null && n !== null && n[U] === e ? U++ : q === null ? q = [e] : q.push(e));
|
|
@@ -1374,25 +1374,25 @@ function b(e) {
|
|
|
1374
1374
|
var l = e;
|
|
1375
1375
|
if (ve) {
|
|
1376
1376
|
var c = l.v;
|
|
1377
|
-
return ((l.f & 1024) === 0 && l.reactions !== null ||
|
|
1377
|
+
return ((l.f & 1024) === 0 && l.reactions !== null || Zi(l)) && (c = nr(l)), De.set(l, c), c;
|
|
1378
1378
|
}
|
|
1379
|
-
var u = (l.f & 512) === 0 && !ne && k !== null && (
|
|
1380
|
-
Ot(l) && (u && (l.f |= 512),
|
|
1379
|
+
var u = (l.f & 512) === 0 && !ne && k !== null && (Wt || (k.f & 512) !== 0), h = (l.f & li) === 0;
|
|
1380
|
+
Ot(l) && (u && (l.f |= 512), Li(l)), u && !h && (Ri(l), Qi(l));
|
|
1381
1381
|
}
|
|
1382
|
-
if (
|
|
1382
|
+
if (z?.has(e)) return z.get(e);
|
|
1383
1383
|
if ((e.f & 8388608) !== 0) throw e.v;
|
|
1384
1384
|
return e.v;
|
|
1385
1385
|
}
|
|
1386
|
-
function
|
|
1386
|
+
function Qi(e) {
|
|
1387
1387
|
if (e.f |= 512, e.deps !== null)
|
|
1388
1388
|
for (const t of e.deps)
|
|
1389
|
-
(t.reactions ?? (t.reactions = [])).push(e), (t.f & 2) !== 0 && (t.f & 512) === 0 && (
|
|
1389
|
+
(t.reactions ?? (t.reactions = [])).push(e), (t.f & 2) !== 0 && (t.f & 512) === 0 && (Ri(t), Qi(t));
|
|
1390
1390
|
}
|
|
1391
|
-
function
|
|
1391
|
+
function Zi(e) {
|
|
1392
1392
|
if (e.v === H) return !0;
|
|
1393
1393
|
if (e.deps === null) return !1;
|
|
1394
1394
|
for (const t of e.deps)
|
|
1395
|
-
if (De.has(t) || (t.f & 2) !== 0 &&
|
|
1395
|
+
if (De.has(t) || (t.f & 2) !== 0 && Zi(t)) return !0;
|
|
1396
1396
|
return !1;
|
|
1397
1397
|
}
|
|
1398
1398
|
function hn(e) {
|
|
@@ -1403,7 +1403,7 @@ function hn(e) {
|
|
|
1403
1403
|
ne = t;
|
|
1404
1404
|
}
|
|
1405
1405
|
}
|
|
1406
|
-
var Nt = /* @__PURE__ */ Symbol("events"),
|
|
1406
|
+
var Nt = /* @__PURE__ */ Symbol("events"), wa = /* @__PURE__ */ new Set(), Or = /* @__PURE__ */ new Set(), Mr = null;
|
|
1407
1407
|
function Lr(e) {
|
|
1408
1408
|
var t = this, n = t.ownerDocument, r = e.type, i = e.composedPath?.() || [], o = i[0] || e.target;
|
|
1409
1409
|
Mr = e;
|
|
@@ -1428,36 +1428,36 @@ function Lr(e) {
|
|
|
1428
1428
|
var u = k, h = E;
|
|
1429
1429
|
de(null), xe(null);
|
|
1430
1430
|
try {
|
|
1431
|
-
for (var
|
|
1431
|
+
for (var p, g = []; o !== null && o !== t; ) {
|
|
1432
1432
|
try {
|
|
1433
1433
|
var m = o[Nt]?.[r];
|
|
1434
1434
|
m != null && (!o.disabled || e.target === o) && m.call(o, e);
|
|
1435
1435
|
} catch (v) {
|
|
1436
|
-
|
|
1436
|
+
p ? g.push(v) : p = v;
|
|
1437
1437
|
}
|
|
1438
1438
|
if (e.cancelBubble) break;
|
|
1439
1439
|
s++, o = s < i.length ? i[s] : null;
|
|
1440
1440
|
}
|
|
1441
|
-
if (
|
|
1441
|
+
if (p) {
|
|
1442
1442
|
for (let v of g) queueMicrotask(() => {
|
|
1443
1443
|
throw v;
|
|
1444
1444
|
});
|
|
1445
|
-
throw
|
|
1445
|
+
throw p;
|
|
1446
1446
|
}
|
|
1447
1447
|
} finally {
|
|
1448
1448
|
e[Nt] = t, delete e.currentTarget, de(u), xe(h);
|
|
1449
1449
|
}
|
|
1450
1450
|
}
|
|
1451
1451
|
}
|
|
1452
|
-
var
|
|
1453
|
-
function
|
|
1454
|
-
return
|
|
1452
|
+
var ka = globalThis?.window?.trustedTypes && /* @__PURE__ */ globalThis.window.trustedTypes.createPolicy("svelte-trusted-html", { createHTML: (e) => e });
|
|
1453
|
+
function Ea(e) {
|
|
1454
|
+
return ka?.createHTML(e) ?? e;
|
|
1455
1455
|
}
|
|
1456
|
-
function
|
|
1457
|
-
var t =
|
|
1458
|
-
return t.innerHTML =
|
|
1456
|
+
function Aa(e) {
|
|
1457
|
+
var t = Fi("template");
|
|
1458
|
+
return t.innerHTML = Ea(e.replaceAll("<!>", "<!---->")), t.content;
|
|
1459
1459
|
}
|
|
1460
|
-
function
|
|
1460
|
+
function zt(e, t) {
|
|
1461
1461
|
var n = E;
|
|
1462
1462
|
n.nodes === null && (n.nodes = {
|
|
1463
1463
|
start: e,
|
|
@@ -1467,29 +1467,29 @@ function Wt(e, t) {
|
|
|
1467
1467
|
});
|
|
1468
1468
|
}
|
|
1469
1469
|
// @__NO_SIDE_EFFECTS__
|
|
1470
|
-
function
|
|
1470
|
+
function Ca(e, t) {
|
|
1471
1471
|
var n = (t & 1) !== 0, r = (t & 2) !== 0, i, o = !e.startsWith("<!>");
|
|
1472
1472
|
return () => {
|
|
1473
1473
|
if (re)
|
|
1474
|
-
return
|
|
1475
|
-
i === void 0 && (i =
|
|
1476
|
-
var s = r ||
|
|
1474
|
+
return zt(D, null), D;
|
|
1475
|
+
i === void 0 && (i = Aa(o ? e : "<!>" + e), n || (i = /* @__PURE__ */ Rn(i)));
|
|
1476
|
+
var s = r || Hi ? document.importNode(i, !0) : i.cloneNode(!0);
|
|
1477
1477
|
if (n) {
|
|
1478
|
-
var a = /* @__PURE__ */
|
|
1479
|
-
|
|
1480
|
-
} else
|
|
1478
|
+
var a = /* @__PURE__ */ Rn(s), l = s.lastChild;
|
|
1479
|
+
zt(a, l);
|
|
1480
|
+
} else zt(s, s);
|
|
1481
1481
|
return s;
|
|
1482
1482
|
};
|
|
1483
1483
|
}
|
|
1484
|
-
function
|
|
1484
|
+
function eo(e, t) {
|
|
1485
1485
|
if (re) {
|
|
1486
1486
|
var n = E;
|
|
1487
|
-
((n.f & 32768) === 0 || n.nodes.end === null) && (n.nodes.end = D),
|
|
1487
|
+
((n.f & 32768) === 0 || n.nodes.end === null) && (n.nodes.end = D), fi();
|
|
1488
1488
|
return;
|
|
1489
1489
|
}
|
|
1490
1490
|
e !== null && e.before(t);
|
|
1491
1491
|
}
|
|
1492
|
-
var
|
|
1492
|
+
var xa = [
|
|
1493
1493
|
"allowfullscreen",
|
|
1494
1494
|
"async",
|
|
1495
1495
|
"autofocus",
|
|
@@ -1518,8 +1518,8 @@ var ka = [
|
|
|
1518
1518
|
"defer",
|
|
1519
1519
|
"disablepictureinpicture",
|
|
1520
1520
|
"disableremoteplayback"
|
|
1521
|
-
],
|
|
1522
|
-
...
|
|
1521
|
+
], gh = [
|
|
1522
|
+
...xa,
|
|
1523
1523
|
"formNoValidate",
|
|
1524
1524
|
"isMap",
|
|
1525
1525
|
"noModule",
|
|
@@ -1534,17 +1534,17 @@ var ka = [
|
|
|
1534
1534
|
"allowFullscreen",
|
|
1535
1535
|
"disablePictureInPicture",
|
|
1536
1536
|
"disableRemotePlayback"
|
|
1537
|
-
],
|
|
1538
|
-
function
|
|
1539
|
-
return
|
|
1537
|
+
], Ia = ["touchstart", "touchmove"];
|
|
1538
|
+
function Oa(e) {
|
|
1539
|
+
return Ia.includes(e);
|
|
1540
1540
|
}
|
|
1541
|
-
var
|
|
1541
|
+
var Ma = [
|
|
1542
1542
|
"$state",
|
|
1543
1543
|
"$state.raw",
|
|
1544
1544
|
"$derived",
|
|
1545
1545
|
"$derived.by"
|
|
1546
|
-
],
|
|
1547
|
-
...
|
|
1546
|
+
], mh = [
|
|
1547
|
+
...Ma,
|
|
1548
1548
|
"$state.eager",
|
|
1549
1549
|
"$state.snapshot",
|
|
1550
1550
|
"$props",
|
|
@@ -1560,17 +1560,17 @@ var Ca = [
|
|
|
1560
1560
|
"$inspect.trace",
|
|
1561
1561
|
"$host"
|
|
1562
1562
|
], Rr = !0;
|
|
1563
|
-
function
|
|
1564
|
-
return
|
|
1563
|
+
function to(e, t) {
|
|
1564
|
+
return no(e, t);
|
|
1565
1565
|
}
|
|
1566
|
-
function
|
|
1567
|
-
|
|
1566
|
+
function La(e, t) {
|
|
1567
|
+
Ln(), t.intro = t.intro ?? !1;
|
|
1568
1568
|
const n = t.target, r = re, i = D;
|
|
1569
1569
|
try {
|
|
1570
|
-
for (var o = /* @__PURE__ */
|
|
1570
|
+
for (var o = /* @__PURE__ */ Rn(n); o && (o.nodeType !== 8 || o.data !== "["); ) o = /* @__PURE__ */ dt(o);
|
|
1571
1571
|
if (!o) throw qt;
|
|
1572
1572
|
Lt(!0), kt(o);
|
|
1573
|
-
const s =
|
|
1573
|
+
const s = no(e, {
|
|
1574
1574
|
...t,
|
|
1575
1575
|
anchor: o
|
|
1576
1576
|
});
|
|
@@ -1578,30 +1578,30 @@ function xa(e, t) {
|
|
|
1578
1578
|
} catch (s) {
|
|
1579
1579
|
if (s instanceof Error && s.message.split(`
|
|
1580
1580
|
`).some((a) => a.startsWith("https://svelte.dev/e/"))) throw s;
|
|
1581
|
-
return s !== qt && console.warn("Failed to hydrate: ", s), t.recover === !1 &&
|
|
1581
|
+
return s !== qt && console.warn("Failed to hydrate: ", s), t.recover === !1 && xs(), Ln(), ua(n), Lt(!1), to(e, t);
|
|
1582
1582
|
} finally {
|
|
1583
1583
|
Lt(r), kt(i);
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
1586
|
var Ht = /* @__PURE__ */ new Map();
|
|
1587
|
-
function
|
|
1588
|
-
|
|
1589
|
-
var l = void 0, c =
|
|
1590
|
-
var u = n ?? t.appendChild(
|
|
1591
|
-
|
|
1587
|
+
function no(e, { target: t, anchor: n, props: r = {}, events: i, context: o, intro: s = !0, transformError: a }) {
|
|
1588
|
+
Ln();
|
|
1589
|
+
var l = void 0, c = pa(() => {
|
|
1590
|
+
var u = n ?? t.appendChild(zi());
|
|
1591
|
+
Js(u, { pending: () => {
|
|
1592
1592
|
} }, (g) => {
|
|
1593
|
-
|
|
1593
|
+
mi({});
|
|
1594
1594
|
var m = L;
|
|
1595
|
-
if (o && (m.c = o), i && (r.$$events = i), re &&
|
|
1596
|
-
throw
|
|
1597
|
-
|
|
1595
|
+
if (o && (m.c = o), i && (r.$$events = i), re && zt(g, null), Rr = s, l = e(g, r) || {}, Rr = !0, re && (E.nodes.end = D, D === null || D.nodeType !== 8 || D.data !== "]"))
|
|
1596
|
+
throw di(), qt;
|
|
1597
|
+
vi();
|
|
1598
1598
|
}, a);
|
|
1599
|
-
var h = /* @__PURE__ */ new Set(),
|
|
1599
|
+
var h = /* @__PURE__ */ new Set(), p = (g) => {
|
|
1600
1600
|
for (var m = 0; m < g.length; m++) {
|
|
1601
1601
|
var v = g[m];
|
|
1602
1602
|
if (!h.has(v)) {
|
|
1603
1603
|
h.add(v);
|
|
1604
|
-
var y =
|
|
1604
|
+
var y = Oa(v);
|
|
1605
1605
|
for (const V of [t, document]) {
|
|
1606
1606
|
var S = Ht.get(V);
|
|
1607
1607
|
S === void 0 && (S = /* @__PURE__ */ new Map(), Ht.set(V, S));
|
|
@@ -1611,28 +1611,28 @@ function Zi(e, { target: t, anchor: n, props: r = {}, events: i, context: o, int
|
|
|
1611
1611
|
}
|
|
1612
1612
|
}
|
|
1613
1613
|
};
|
|
1614
|
-
return
|
|
1614
|
+
return p(cs(wa)), Or.add(p), () => {
|
|
1615
1615
|
for (var g of h) for (const y of [t, document]) {
|
|
1616
1616
|
var m = Ht.get(y), v = m.get(g);
|
|
1617
1617
|
--v == 0 ? (y.removeEventListener(g, Lr), m.delete(g), m.size === 0 && Ht.delete(y)) : m.set(g, v);
|
|
1618
1618
|
}
|
|
1619
|
-
Or.delete(
|
|
1619
|
+
Or.delete(p), u !== n && u.parentNode?.removeChild(u);
|
|
1620
1620
|
};
|
|
1621
1621
|
});
|
|
1622
|
-
return
|
|
1622
|
+
return $n.set(l, c), l;
|
|
1623
1623
|
}
|
|
1624
|
-
var
|
|
1625
|
-
function
|
|
1626
|
-
const n =
|
|
1627
|
-
return n ? (
|
|
1624
|
+
var $n = /* @__PURE__ */ new WeakMap();
|
|
1625
|
+
function Ra(e, t) {
|
|
1626
|
+
const n = $n.get(e);
|
|
1627
|
+
return n ? ($n.delete(e), n(t)) : Promise.resolve();
|
|
1628
1628
|
}
|
|
1629
|
-
function
|
|
1630
|
-
L === null &&
|
|
1629
|
+
function $a(e) {
|
|
1630
|
+
L === null && ws("onMount"), It && L.l !== null ? Pa(L).m.push(e) : Re(() => {
|
|
1631
1631
|
const t = hn(e);
|
|
1632
1632
|
if (typeof t == "function") return t;
|
|
1633
1633
|
});
|
|
1634
1634
|
}
|
|
1635
|
-
function
|
|
1635
|
+
function Pa(e) {
|
|
1636
1636
|
var t = e.l;
|
|
1637
1637
|
return t.u ?? (t.u = {
|
|
1638
1638
|
a: [],
|
|
@@ -1640,34 +1640,34 @@ function Ma(e) {
|
|
|
1640
1640
|
m: []
|
|
1641
1641
|
});
|
|
1642
1642
|
}
|
|
1643
|
-
var
|
|
1643
|
+
var ro, rt = /* @__PURE__ */ new WeakMap(), rn = /* @__PURE__ */ new WeakMap(), yn = /* @__PURE__ */ new WeakMap(), $r = /* @__PURE__ */ new WeakSet(), io = class {
|
|
1644
1644
|
constructor(e) {
|
|
1645
1645
|
Qn(this, $r), w(this, rt, /* @__PURE__ */ new WeakMap()), w(this, rn, void 0), w(this, yn, void 0), T(yn, this, e);
|
|
1646
1646
|
}
|
|
1647
1647
|
observe(e, t) {
|
|
1648
1648
|
var n = d(rt, this).get(e) || /* @__PURE__ */ new Set();
|
|
1649
|
-
return n.add(t), d(rt, this).set(e, n), _($r, this,
|
|
1649
|
+
return n.add(t), d(rt, this).set(e, n), _($r, this, Na).call(this).observe(e, d(yn, this)), () => {
|
|
1650
1650
|
var r = d(rt, this).get(e);
|
|
1651
1651
|
r.delete(t), r.size === 0 && (d(rt, this).delete(e), d(rn, this).unobserve(e));
|
|
1652
1652
|
};
|
|
1653
1653
|
}
|
|
1654
1654
|
};
|
|
1655
|
-
|
|
1656
|
-
function
|
|
1655
|
+
ro = io;
|
|
1656
|
+
function Na() {
|
|
1657
1657
|
return d(rn, this) ?? T(rn, this, new ResizeObserver((e) => {
|
|
1658
1658
|
for (var t of e) {
|
|
1659
|
-
|
|
1659
|
+
ro.entries.set(t.target, t);
|
|
1660
1660
|
for (var n of d(rt, this).get(t.target) || []) n(t);
|
|
1661
1661
|
}
|
|
1662
1662
|
}));
|
|
1663
1663
|
}
|
|
1664
|
-
|
|
1664
|
+
f(io, "entries", /* @__PURE__ */ new WeakMap());
|
|
1665
1665
|
function bn(e, t) {
|
|
1666
1666
|
return e === t || e?.[St] === t;
|
|
1667
1667
|
}
|
|
1668
|
-
function
|
|
1668
|
+
function Ha(e = {}, t, n, r) {
|
|
1669
1669
|
var i = L.r, o = E;
|
|
1670
|
-
return
|
|
1670
|
+
return ga(() => {
|
|
1671
1671
|
var s, a;
|
|
1672
1672
|
return ir(() => {
|
|
1673
1673
|
s = a, a = r?.() || [], hn(() => {
|
|
@@ -1689,11 +1689,11 @@ function we(e, t, n, r) {
|
|
|
1689
1689
|
var i = !It || (n & 2) !== 0, o = (n & 8) !== 0, s = (n & 16) !== 0, a = r, l = !0, c = void 0, u = () => s && i ? (c ?? (c = /* @__PURE__ */ tn(r)), b(c)) : (l && (l = !1, a = s ? hn(r) : r), a);
|
|
1690
1690
|
let h;
|
|
1691
1691
|
if (o) {
|
|
1692
|
-
var
|
|
1693
|
-
h = Be(e, t)?.set ?? (
|
|
1692
|
+
var p = St in e || hi in e;
|
|
1693
|
+
h = Be(e, t)?.set ?? (p && t in e ? (A) => e[t] = A : void 0);
|
|
1694
1694
|
}
|
|
1695
1695
|
var g, m = !1;
|
|
1696
|
-
o ? [g, m] =
|
|
1696
|
+
o ? [g, m] = js(() => e[t]) : g = e[t], g === void 0 && r !== void 0 && (g = u(), h && (i && Is(t), h(g)));
|
|
1697
1697
|
var v;
|
|
1698
1698
|
if (i ? v = () => {
|
|
1699
1699
|
var A = e[t];
|
|
@@ -1708,7 +1708,7 @@ function we(e, t, n, r) {
|
|
|
1708
1708
|
return arguments.length > 0 ? ((!i || !G || y || m) && h(G ? v() : A), A) : v();
|
|
1709
1709
|
});
|
|
1710
1710
|
}
|
|
1711
|
-
var S = !1, O = ((n & 1) !== 0 ? tn :
|
|
1711
|
+
var S = !1, O = ((n & 1) !== 0 ? tn : na)(() => (S = !1, v()));
|
|
1712
1712
|
o && b(O);
|
|
1713
1713
|
var V = E;
|
|
1714
1714
|
return (function(A, G) {
|
|
@@ -1719,14 +1719,14 @@ function we(e, t, n, r) {
|
|
|
1719
1719
|
return ve && S || (V.f & 16384) !== 0 ? O.v : b(O);
|
|
1720
1720
|
});
|
|
1721
1721
|
}
|
|
1722
|
-
function
|
|
1723
|
-
return new
|
|
1722
|
+
function Ba(e) {
|
|
1723
|
+
return new Wa(e);
|
|
1724
1724
|
}
|
|
1725
|
-
var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(),
|
|
1725
|
+
var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), Wa = class {
|
|
1726
1726
|
constructor(e) {
|
|
1727
1727
|
w(this, Me, void 0), w(this, ce, void 0);
|
|
1728
1728
|
var t = /* @__PURE__ */ new Map(), n = (i, o) => {
|
|
1729
|
-
var s = /* @__PURE__ */
|
|
1729
|
+
var s = /* @__PURE__ */ oa(o, !1, !1);
|
|
1730
1730
|
return t.set(i, s), s;
|
|
1731
1731
|
};
|
|
1732
1732
|
const r = new Proxy({
|
|
@@ -1737,13 +1737,13 @@ var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), Pa =
|
|
|
1737
1737
|
return b(t.get(o) ?? n(o, Reflect.get(i, o)));
|
|
1738
1738
|
},
|
|
1739
1739
|
has(i, o) {
|
|
1740
|
-
return o ===
|
|
1740
|
+
return o === hi ? !0 : (b(t.get(o) ?? n(o, Reflect.get(i, o))), Reflect.has(i, o));
|
|
1741
1741
|
},
|
|
1742
1742
|
set(i, o, s) {
|
|
1743
1743
|
return M(t.get(o) ?? n(o, s), s), Reflect.set(i, o, s);
|
|
1744
1744
|
}
|
|
1745
1745
|
});
|
|
1746
|
-
T(ce, this, (e.hydrate ?
|
|
1746
|
+
T(ce, this, (e.hydrate ? La : to)(e.component, {
|
|
1747
1747
|
target: e.target,
|
|
1748
1748
|
anchor: e.anchor,
|
|
1749
1749
|
props: r,
|
|
@@ -1765,7 +1765,7 @@ var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), Pa =
|
|
|
1765
1765
|
d(ce, this).$set = (i) => {
|
|
1766
1766
|
Object.assign(r, i);
|
|
1767
1767
|
}, d(ce, this).$destroy = () => {
|
|
1768
|
-
|
|
1768
|
+
Ra(d(ce, this));
|
|
1769
1769
|
};
|
|
1770
1770
|
}
|
|
1771
1771
|
$set(e) {
|
|
@@ -1781,10 +1781,10 @@ var Me = /* @__PURE__ */ new WeakMap(), ce = /* @__PURE__ */ new WeakMap(), Pa =
|
|
|
1781
1781
|
$destroy() {
|
|
1782
1782
|
d(ce, this).$destroy();
|
|
1783
1783
|
}
|
|
1784
|
-
},
|
|
1785
|
-
typeof HTMLElement == "function" && (
|
|
1784
|
+
}, oo;
|
|
1785
|
+
typeof HTMLElement == "function" && (oo = class extends HTMLElement {
|
|
1786
1786
|
constructor(e, t, n) {
|
|
1787
|
-
super(),
|
|
1787
|
+
super(), f(this, "$$ctor", void 0), f(this, "$$s", void 0), f(this, "$$c", void 0), f(this, "$$cn", !1), f(this, "$$d", {}), f(this, "$$r", !1), f(this, "$$p_d", {}), f(this, "$$l", {}), f(this, "$$l_u", /* @__PURE__ */ new Map()), f(this, "$$me", void 0), f(this, "$$shadowRoot", null), this.$$ctor = e, this.$$s = t, n && (this.$$shadowRoot = this.attachShadow(n));
|
|
1788
1788
|
}
|
|
1789
1789
|
addEventListener(e, t, n) {
|
|
1790
1790
|
if (this.$$l[e] = this.$$l[e] || [], this.$$l[e].push(t), this.$$c) {
|
|
@@ -1803,19 +1803,19 @@ typeof HTMLElement == "function" && (no = class extends HTMLElement {
|
|
|
1803
1803
|
if (this.$$cn = !0, !this.$$c) {
|
|
1804
1804
|
let e = function(r) {
|
|
1805
1805
|
return (i) => {
|
|
1806
|
-
const o =
|
|
1807
|
-
r !== "default" && (o.name = r),
|
|
1806
|
+
const o = Fi("slot");
|
|
1807
|
+
r !== "default" && (o.name = r), eo(i, o);
|
|
1808
1808
|
};
|
|
1809
1809
|
};
|
|
1810
1810
|
if (await Promise.resolve(), !this.$$cn || this.$$c) return;
|
|
1811
|
-
const t = {}, n =
|
|
1811
|
+
const t = {}, n = za(this);
|
|
1812
1812
|
for (const r of this.$$s) r in n && (r === "default" && !this.$$d.children ? (this.$$d.children = e(r), t.default = !0) : t[r] = e(r));
|
|
1813
1813
|
for (const r of this.attributes) {
|
|
1814
1814
|
const i = this.$$g_p(r.name);
|
|
1815
1815
|
i in this.$$d || (this.$$d[i] = Ft(i, r.value, this.$$p_d, "toProp"));
|
|
1816
1816
|
}
|
|
1817
1817
|
for (const r in this.$$p_d) !(r in this.$$d) && this[r] !== void 0 && (this.$$d[r] = this[r], delete this[r]);
|
|
1818
|
-
this.$$c =
|
|
1818
|
+
this.$$c = Ba({
|
|
1819
1819
|
component: this.$$ctor,
|
|
1820
1820
|
target: this.$$shadowRoot || this,
|
|
1821
1821
|
props: {
|
|
@@ -1823,7 +1823,7 @@ typeof HTMLElement == "function" && (no = class extends HTMLElement {
|
|
|
1823
1823
|
$$slots: t,
|
|
1824
1824
|
$$host: this
|
|
1825
1825
|
}
|
|
1826
|
-
}), this.$$me =
|
|
1826
|
+
}), this.$$me = fa(() => {
|
|
1827
1827
|
ir(() => {
|
|
1828
1828
|
this.$$r = !0;
|
|
1829
1829
|
for (const r of Gt(this.$$c)) {
|
|
@@ -1880,14 +1880,14 @@ function Ft(e, t, n, r) {
|
|
|
1880
1880
|
return t;
|
|
1881
1881
|
}
|
|
1882
1882
|
}
|
|
1883
|
-
function
|
|
1883
|
+
function za(e) {
|
|
1884
1884
|
const t = {};
|
|
1885
1885
|
return e.childNodes.forEach((n) => {
|
|
1886
1886
|
t[n.slot || "default"] = !0;
|
|
1887
1887
|
}), t;
|
|
1888
1888
|
}
|
|
1889
|
-
function
|
|
1890
|
-
let s = class extends
|
|
1889
|
+
function Fa(e, t, n, r, i, o) {
|
|
1890
|
+
let s = class extends oo {
|
|
1891
1891
|
constructor() {
|
|
1892
1892
|
super(e, n, i), this.$$p_d = t;
|
|
1893
1893
|
}
|
|
@@ -1912,16 +1912,16 @@ function Ha(e, t, n, r, i, o) {
|
|
|
1912
1912
|
} });
|
|
1913
1913
|
}), o && (s = o(s)), e.element = s, s;
|
|
1914
1914
|
}
|
|
1915
|
-
var
|
|
1915
|
+
var Da = class extends Event {
|
|
1916
1916
|
constructor(e, t, n, r) {
|
|
1917
1917
|
super("context-request", {
|
|
1918
1918
|
bubbles: !0,
|
|
1919
1919
|
composed: !0
|
|
1920
|
-
}),
|
|
1920
|
+
}), f(this, "context", void 0), f(this, "contextTarget", void 0), f(this, "callback", void 0), f(this, "subscribe", void 0), this.context = e, this.contextTarget = t, this.callback = n, this.subscribe = r ?? !1;
|
|
1921
1921
|
}
|
|
1922
|
-
},
|
|
1922
|
+
}, ja = class {
|
|
1923
1923
|
constructor(e, t) {
|
|
1924
|
-
|
|
1924
|
+
f(this, "host", void 0), f(this, "context", void 0), f(this, "subscribe", void 0), f(this, "onValue", void 0), f(this, "isConnected", !1), f(this, "unsubscribe", void 0), f(this, "currentValue", void 0), f(this, "handleValue", (n, r) => {
|
|
1925
1925
|
r !== this.unsubscribe && (this.unsubscribe?.(), this.unsubscribe = r), !this.subscribe && this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.currentValue = n, this.onValue?.(n);
|
|
1926
1926
|
}), this.host = e, this.context = t.context, this.subscribe = t.subscribe ?? !0, this.onValue = t.onValue;
|
|
1927
1927
|
}
|
|
@@ -1935,12 +1935,12 @@ var Ba = class extends Event {
|
|
|
1935
1935
|
return this.currentValue;
|
|
1936
1936
|
}
|
|
1937
1937
|
requestValue() {
|
|
1938
|
-
this.host.dispatchEvent(new
|
|
1938
|
+
this.host.dispatchEvent(new Da(this.context, this.host, this.handleValue, this.subscribe));
|
|
1939
1939
|
}
|
|
1940
|
-
}, dn = (e) => e,
|
|
1941
|
-
function
|
|
1940
|
+
}, dn = (e) => e, qa = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.runtimeContext")), vh = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.hostRuntimeContext")), Va = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.shellContext")), yh = dn(/* @__PURE__ */ Symbol.for("pie.assessmentToolkit.regionScopeContext"));
|
|
1941
|
+
function so(e, t, n) {
|
|
1942
1942
|
let r = !1;
|
|
1943
|
-
const i = new
|
|
1943
|
+
const i = new ja(e, {
|
|
1944
1944
|
context: t,
|
|
1945
1945
|
subscribe: !0,
|
|
1946
1946
|
onValue: (c) => {
|
|
@@ -1964,19 +1964,19 @@ function ro(e, t, n) {
|
|
|
1964
1964
|
globalThis.clearInterval(l), e.removeEventListener("context-provider", o), i.disconnect();
|
|
1965
1965
|
};
|
|
1966
1966
|
}
|
|
1967
|
-
function
|
|
1968
|
-
return
|
|
1967
|
+
function Ga(e, t) {
|
|
1968
|
+
return so(e, qa, t);
|
|
1969
1969
|
}
|
|
1970
|
-
function
|
|
1971
|
-
return
|
|
1970
|
+
function Ua(e, t) {
|
|
1971
|
+
return so(e, Va, t);
|
|
1972
1972
|
}
|
|
1973
|
-
function
|
|
1974
|
-
return
|
|
1973
|
+
function Ka(e, t) {
|
|
1974
|
+
return Ga(e, t);
|
|
1975
1975
|
}
|
|
1976
|
-
function
|
|
1977
|
-
return
|
|
1976
|
+
function Xa(e, t) {
|
|
1977
|
+
return Ua(e, t);
|
|
1978
1978
|
}
|
|
1979
|
-
var
|
|
1979
|
+
var Ya = class {
|
|
1980
1980
|
serialize(e, t) {
|
|
1981
1981
|
return {
|
|
1982
1982
|
startContainer: this.getNodePath(e.startContainer, t),
|
|
@@ -2041,17 +2041,17 @@ var Ga = class {
|
|
|
2041
2041
|
deserializeMany(e, t) {
|
|
2042
2042
|
return e.map((n) => this.deserialize(n, t));
|
|
2043
2043
|
}
|
|
2044
|
-
},
|
|
2044
|
+
}, W;
|
|
2045
2045
|
(function(e) {
|
|
2046
2046
|
e.TTS_WORD = "tts-word", e.TTS_SENTENCE = "tts-sentence", e.ANNOTATION = "annotation";
|
|
2047
|
-
})(
|
|
2047
|
+
})(W || (W = {}));
|
|
2048
2048
|
var st;
|
|
2049
2049
|
(function(e) {
|
|
2050
2050
|
e.YELLOW = "yellow", e.GREEN = "green", e.BLUE = "blue", e.PINK = "pink", e.ORANGE = "orange", e.UNDERLINE = "underline";
|
|
2051
2051
|
})(st || (st = {}));
|
|
2052
|
-
var
|
|
2052
|
+
var ao = class Pn {
|
|
2053
2053
|
constructor(t = {}) {
|
|
2054
|
-
if (
|
|
2054
|
+
if (f(this, "config", void 0), f(this, "ttsWordHighlight", null), f(this, "ttsSentenceHighlight", null), f(this, "ttsWordElementHighlights", /* @__PURE__ */ new Set()), f(this, "ttsSentenceElementHighlights", /* @__PURE__ */ new Set()), f(this, "annotations", /* @__PURE__ */ new Map()), f(this, "colorHighlights", /* @__PURE__ */ new Map()), f(this, "nextAnnotationId", 1), f(this, "supported", !1), f(this, "rangeSerializer", void 0), f(this, "themeObserver", null), f(this, "explicitTTSColorOverride", null), this.config = t, this.rangeSerializer = new Ya(), typeof CSS > "u" || !("highlights" in CSS)) {
|
|
2055
2055
|
console.warn("CSS Custom Highlight API not supported (SSR or unsupported browser)");
|
|
2056
2056
|
return;
|
|
2057
2057
|
}
|
|
@@ -2159,14 +2159,14 @@ var io = class Nn {
|
|
|
2159
2159
|
0.56,
|
|
2160
2160
|
0.5
|
|
2161
2161
|
];
|
|
2162
|
-
let h = u[u.length - 1],
|
|
2162
|
+
let h = u[u.length - 1], p = -1 / 0;
|
|
2163
2163
|
for (const G of u) {
|
|
2164
2164
|
const Z = this.blend(c, a, G), pt = this.contrastRatio(Z, a), C = this.contrastRatio(Z, l), gr = pt * 1.2 + C * 0.8;
|
|
2165
2165
|
if (pt >= 1.25 && C >= 2.4) {
|
|
2166
2166
|
h = G;
|
|
2167
2167
|
break;
|
|
2168
2168
|
}
|
|
2169
|
-
gr >
|
|
2169
|
+
gr > p && (p = gr, h = G);
|
|
2170
2170
|
}
|
|
2171
2171
|
const g = Math.max(0.24, Math.min(0.85, h * 0.55)), m = Math.max(0.55, Math.min(0.95, h + 0.2)), v = Math.max(0.22, Math.min(0.6, h * 0.45)), y = l, S = this.blend(y, a, m), O = this.contrastRatio(S, a), V = this.relativeLuminance(a) > 0.45 ? [
|
|
2172
2172
|
0,
|
|
@@ -2287,10 +2287,10 @@ var io = class Nn {
|
|
|
2287
2287
|
this.highlightTTSElementFallbacks(t);
|
|
2288
2288
|
}
|
|
2289
2289
|
highlightTTSElementFallbacks(t) {
|
|
2290
|
-
typeof Element > "u" || this.highlightElementFallbacks(t, "data-pie-tts-sentence-element", this.ttsSentenceElementHighlights,
|
|
2290
|
+
typeof Element > "u" || this.highlightElementFallbacks(t, "data-pie-tts-sentence-element", this.ttsSentenceElementHighlights, Pn.SENTENCE_FALLBACK_SELECTOR);
|
|
2291
2291
|
}
|
|
2292
2292
|
highlightTTSWordElementFallbacks(t) {
|
|
2293
|
-
typeof Element > "u" || this.highlightElementFallbacks(t, "data-pie-tts-word-element", this.ttsWordElementHighlights,
|
|
2293
|
+
typeof Element > "u" || this.highlightElementFallbacks(t, "data-pie-tts-word-element", this.ttsWordElementHighlights, Pn.WORD_FALLBACK_SELECTOR);
|
|
2294
2294
|
}
|
|
2295
2295
|
highlightElementFallbacks(t, n, r, i) {
|
|
2296
2296
|
for (const o of t) {
|
|
@@ -2334,7 +2334,7 @@ var io = class Nn {
|
|
|
2334
2334
|
const r = `annotation-${this.nextAnnotationId++}`, i = t.cloneRange(), o = {
|
|
2335
2335
|
id: r,
|
|
2336
2336
|
range: i,
|
|
2337
|
-
type:
|
|
2337
|
+
type: W.ANNOTATION,
|
|
2338
2338
|
color: n,
|
|
2339
2339
|
timestamp: Date.now()
|
|
2340
2340
|
};
|
|
@@ -2395,16 +2395,16 @@ var io = class Nn {
|
|
|
2395
2395
|
highlightRange(t, n, r = st.YELLOW) {
|
|
2396
2396
|
if (this.supported)
|
|
2397
2397
|
switch (n) {
|
|
2398
|
-
case
|
|
2399
|
-
case
|
|
2400
|
-
const i = n ===
|
|
2401
|
-
if (i && (i.clear(), i.add(t), n ===
|
|
2398
|
+
case W.TTS_WORD:
|
|
2399
|
+
case W.TTS_SENTENCE: {
|
|
2400
|
+
const i = n === W.TTS_WORD ? this.ttsWordHighlight : this.ttsSentenceHighlight;
|
|
2401
|
+
if (i && (i.clear(), i.add(t), n === W.TTS_WORD)) {
|
|
2402
2402
|
for (const o of this.ttsWordElementHighlights) o.removeAttribute("data-pie-tts-word-element");
|
|
2403
2403
|
this.ttsWordElementHighlights.clear(), this.highlightTTSWordElementFallbacks([t]);
|
|
2404
2404
|
}
|
|
2405
2405
|
break;
|
|
2406
2406
|
}
|
|
2407
|
-
case
|
|
2407
|
+
case W.ANNOTATION:
|
|
2408
2408
|
this.addAnnotation(t, r);
|
|
2409
2409
|
break;
|
|
2410
2410
|
}
|
|
@@ -2412,13 +2412,13 @@ var io = class Nn {
|
|
|
2412
2412
|
clearHighlights(t) {
|
|
2413
2413
|
if (this.supported)
|
|
2414
2414
|
switch (t) {
|
|
2415
|
-
case
|
|
2415
|
+
case W.TTS_WORD:
|
|
2416
2416
|
this.clearTTSWord();
|
|
2417
2417
|
break;
|
|
2418
|
-
case
|
|
2418
|
+
case W.TTS_SENTENCE:
|
|
2419
2419
|
this.clearTTSSentence();
|
|
2420
2420
|
break;
|
|
2421
|
-
case
|
|
2421
|
+
case W.ANNOTATION:
|
|
2422
2422
|
this.clearAnnotations();
|
|
2423
2423
|
break;
|
|
2424
2424
|
}
|
|
@@ -2454,14 +2454,14 @@ var io = class Nn {
|
|
|
2454
2454
|
}
|
|
2455
2455
|
}
|
|
2456
2456
|
};
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
function
|
|
2457
|
+
f(ao, "SENTENCE_FALLBACK_SELECTOR", "math, mjx-container, svg, img, canvas, [role='img']");
|
|
2458
|
+
f(ao, "WORD_FALLBACK_SELECTOR", "svg, img, canvas, [role='img']");
|
|
2459
|
+
function lo(e) {
|
|
2460
2460
|
return (...t) => {
|
|
2461
2461
|
console.debug(`[${e}]`, ...t);
|
|
2462
2462
|
};
|
|
2463
2463
|
}
|
|
2464
|
-
var
|
|
2464
|
+
var bh = lo("I18nService"), Tn = {
|
|
2465
2465
|
assessment: [],
|
|
2466
2466
|
section: [],
|
|
2467
2467
|
item: [],
|
|
@@ -2482,19 +2482,19 @@ function ke(e, t) {
|
|
|
2482
2482
|
if (e.find((n) => typeof n != "string") !== void 0) throw new Error(`Invalid tools config at "${t}": all entries must be strings.`);
|
|
2483
2483
|
return e;
|
|
2484
2484
|
}
|
|
2485
|
-
function
|
|
2485
|
+
function Ja(e) {
|
|
2486
2486
|
if (e != null) {
|
|
2487
2487
|
if (!qe(e)) throw new Error('Invalid tools config at "placement": expected an object with section/item/passage arrays.');
|
|
2488
2488
|
return e;
|
|
2489
2489
|
}
|
|
2490
2490
|
}
|
|
2491
|
-
function
|
|
2491
|
+
function Qa(e) {
|
|
2492
2492
|
if (e != null) {
|
|
2493
2493
|
if (!qe(e)) throw new Error('Invalid tools config at "policy": expected an object with allowed/blocked arrays.');
|
|
2494
2494
|
return e;
|
|
2495
2495
|
}
|
|
2496
2496
|
}
|
|
2497
|
-
function
|
|
2497
|
+
function Za(e, t) {
|
|
2498
2498
|
if (t == null) return;
|
|
2499
2499
|
if (!qe(t)) throw new Error(`Invalid tools config at "providers.${e}": expected an object.`);
|
|
2500
2500
|
const n = t, r = (i) => i === "polly" || i === "google" || i === "custom";
|
|
@@ -2503,14 +2503,14 @@ function Xa(e, t) {
|
|
|
2503
2503
|
if ("provider" in n && n.provider !== void 0 && !qe(n.provider) && !(e === "textToSpeech" && r(n.provider))) throw new Error(`Invalid tools config at "providers.${e}.provider": expected an object.`);
|
|
2504
2504
|
return n;
|
|
2505
2505
|
}
|
|
2506
|
-
function
|
|
2506
|
+
function el(e) {
|
|
2507
2507
|
if (e == null) return {};
|
|
2508
2508
|
if (!qe(e)) throw new Error('Invalid tools config at "providers": expected an object keyed by tool id.');
|
|
2509
2509
|
const t = {};
|
|
2510
|
-
for (const [n, r] of Object.entries(e)) t[n] =
|
|
2510
|
+
for (const [n, r] of Object.entries(e)) t[n] = Za(n, r);
|
|
2511
2511
|
return t;
|
|
2512
2512
|
}
|
|
2513
|
-
function
|
|
2513
|
+
function co(e) {
|
|
2514
2514
|
const t = e.trim();
|
|
2515
2515
|
return t || "";
|
|
2516
2516
|
}
|
|
@@ -2519,20 +2519,20 @@ function Ee(e) {
|
|
|
2519
2519
|
const t = /* @__PURE__ */ new Set();
|
|
2520
2520
|
for (const n of e) {
|
|
2521
2521
|
if (typeof n != "string") throw new Error("Invalid tools config: tool list entries must be strings.");
|
|
2522
|
-
const r =
|
|
2522
|
+
const r = co(n);
|
|
2523
2523
|
r && t.add(r);
|
|
2524
2524
|
}
|
|
2525
2525
|
return Array.from(t);
|
|
2526
2526
|
}
|
|
2527
|
-
function
|
|
2527
|
+
function tl(e, t) {
|
|
2528
2528
|
if (e != null) {
|
|
2529
2529
|
if (e === "on" || e === "off") return e;
|
|
2530
2530
|
throw new Error(`Invalid tools config at "${t}": expected "on" or "off", got ${JSON.stringify(e)}.`);
|
|
2531
2531
|
}
|
|
2532
2532
|
}
|
|
2533
|
-
function
|
|
2533
|
+
function nl(e) {
|
|
2534
2534
|
if (e != null && !qe(e)) throw new Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');
|
|
2535
|
-
const t =
|
|
2535
|
+
const t = Qa(e?.policy), n = Ja(e?.placement), r = el(e?.providers), i = tl(e?.pnpEnforcement, "pnpEnforcement"), o = {
|
|
2536
2536
|
policy: {
|
|
2537
2537
|
allowed: Ee(ke(t?.allowed, "policy.allowed")),
|
|
2538
2538
|
blocked: Ee(ke(t?.blocked, "policy.blocked"))
|
|
@@ -2546,7 +2546,7 @@ function Qa(e) {
|
|
|
2546
2546
|
};
|
|
2547
2547
|
return i && (o.pnpEnforcement = i), o;
|
|
2548
2548
|
}
|
|
2549
|
-
var
|
|
2549
|
+
var rl = [
|
|
2550
2550
|
"assessment",
|
|
2551
2551
|
"section",
|
|
2552
2552
|
"item",
|
|
@@ -2557,7 +2557,7 @@ var Za = [
|
|
|
2557
2557
|
function Dt(e, t) {
|
|
2558
2558
|
if (typeof e != "string" || e.trim().length === 0) throw new Error(`Invalid tool registration: "${t}" must be a non-empty string.`);
|
|
2559
2559
|
}
|
|
2560
|
-
var
|
|
2560
|
+
var il = [
|
|
2561
2561
|
{
|
|
2562
2562
|
pattern: /<script\b/i,
|
|
2563
2563
|
reason: "contains a <script> tag"
|
|
@@ -2575,17 +2575,17 @@ var el = [
|
|
|
2575
2575
|
reason: "contains a <foreignObject> element"
|
|
2576
2576
|
}
|
|
2577
2577
|
];
|
|
2578
|
-
function
|
|
2578
|
+
function ol(e, t, n) {
|
|
2579
2579
|
const r = t.trimStart(), i = r.toLowerCase().startsWith("<svg"), o = /^https?:/i.test(r);
|
|
2580
2580
|
if (/^data:/i.test(r)) throw new Error(`Invalid tool registration "${e}": "${n}" may not be a data: URL.`);
|
|
2581
2581
|
if (!(!i && !o)) {
|
|
2582
|
-
for (const { pattern: s, reason: a } of
|
|
2582
|
+
for (const { pattern: s, reason: a } of il) if (s.test(t)) throw new Error(`Invalid tool registration "${e}": "${n}" ${a}. Inline SVG icons must not include scriptable content.`);
|
|
2583
2583
|
}
|
|
2584
2584
|
}
|
|
2585
2585
|
function Pr(e) {
|
|
2586
2586
|
if (Dt(e.toolId, "toolId"), Dt(e.name, "name"), Dt(e.description, "description"), typeof e.icon != "string" && typeof e.icon != "function") throw new Error(`Invalid tool registration "${e.toolId}": "icon" must be a string or function.`);
|
|
2587
|
-
if (typeof e.icon == "string" &&
|
|
2588
|
-
const t = e.supportedLevels.find((n) => !
|
|
2587
|
+
if (typeof e.icon == "string" && ol(e.toolId, e.icon, "icon"), !Array.isArray(e.supportedLevels) || e.supportedLevels.length === 0) throw new Error(`Invalid tool registration "${e.toolId}": "supportedLevels" must be a non-empty array.`);
|
|
2588
|
+
const t = e.supportedLevels.find((n) => !rl.includes(n));
|
|
2589
2589
|
if (t) throw new Error(`Invalid tool registration "${e.toolId}": unsupported level "${t}".`);
|
|
2590
2590
|
if (e.activation !== void 0 && e.activation !== "toolbar-toggle" && e.activation !== "selection-gateway") throw new Error(`Invalid tool registration "${e.toolId}": unsupported activation "${String(e.activation)}".`);
|
|
2591
2591
|
if (e.singletonScope !== void 0 && e.singletonScope !== "section") throw new Error(`Invalid tool registration "${e.toolId}": unsupported singletonScope "${String(e.singletonScope)}".`);
|
|
@@ -2594,12 +2594,12 @@ function Pr(e) {
|
|
|
2594
2594
|
if (typeof e.isVisibleInContext != "function") throw new Error(`Invalid tool registration "${e.toolId}": "isVisibleInContext" must be a function.`);
|
|
2595
2595
|
if (typeof e.renderToolbar != "function") throw new Error(`Invalid tool registration "${e.toolId}": "renderToolbar" must be a function.`);
|
|
2596
2596
|
}
|
|
2597
|
-
var
|
|
2597
|
+
var sl = class {
|
|
2598
2598
|
constructor() {
|
|
2599
|
-
|
|
2599
|
+
f(this, "tools", /* @__PURE__ */ new Map()), f(this, "pnpIndex", /* @__PURE__ */ new Map()), f(this, "componentOverrides", {}), f(this, "moduleLoaders", /* @__PURE__ */ new Map()), f(this, "loadedToolModules", /* @__PURE__ */ new Set()), f(this, "moduleLoadPromises", /* @__PURE__ */ new Map());
|
|
2600
2600
|
}
|
|
2601
2601
|
normalizeToolId(e) {
|
|
2602
|
-
return
|
|
2602
|
+
return co(e);
|
|
2603
2603
|
}
|
|
2604
2604
|
normalizeToolIds(e) {
|
|
2605
2605
|
return e.map((t) => this.normalizeToolId(t));
|
|
@@ -2737,20 +2737,20 @@ var nl = class {
|
|
|
2737
2737
|
return r.renderToolbar(t, i);
|
|
2738
2738
|
}
|
|
2739
2739
|
};
|
|
2740
|
-
function
|
|
2740
|
+
function uo(e) {
|
|
2741
2741
|
return e.level === "item";
|
|
2742
2742
|
}
|
|
2743
|
-
function
|
|
2743
|
+
function al(e) {
|
|
2744
2744
|
return e.level === "passage";
|
|
2745
2745
|
}
|
|
2746
|
-
function
|
|
2746
|
+
function ll(e) {
|
|
2747
2747
|
return e.level === "rubric";
|
|
2748
2748
|
}
|
|
2749
|
-
function
|
|
2749
|
+
function ho(e) {
|
|
2750
2750
|
return e.level === "element";
|
|
2751
2751
|
}
|
|
2752
2752
|
function sr(e) {
|
|
2753
|
-
if (
|
|
2753
|
+
if (ho(e)) {
|
|
2754
2754
|
const t = e.item.config;
|
|
2755
2755
|
if (!t) return "";
|
|
2756
2756
|
const n = [], r = (a) => a.replace(/<[^>]*>/g, " ").trim(), i = t.elements?.[e.elementId];
|
|
@@ -2765,7 +2765,7 @@ function sr(e) {
|
|
|
2765
2765
|
}
|
|
2766
2766
|
return n.filter(Boolean).join(" ").trim();
|
|
2767
2767
|
}
|
|
2768
|
-
if (
|
|
2768
|
+
if (uo(e)) {
|
|
2769
2769
|
const t = e.item;
|
|
2770
2770
|
if (!t?.config) return "";
|
|
2771
2771
|
const n = t.config, r = [], i = (l) => l.replace(/<[^>]*>/g, " ").trim();
|
|
@@ -2784,7 +2784,7 @@ function sr(e) {
|
|
|
2784
2784
|
}
|
|
2785
2785
|
return r.filter(Boolean).join(" ").trim();
|
|
2786
2786
|
}
|
|
2787
|
-
if (
|
|
2787
|
+
if (al(e)) {
|
|
2788
2788
|
const t = e.passage;
|
|
2789
2789
|
if (!t?.config) return "";
|
|
2790
2790
|
const n = t.config, r = [], i = (l) => l.replace(/<[^>]*>/g, " ").trim();
|
|
@@ -2803,7 +2803,7 @@ function sr(e) {
|
|
|
2803
2803
|
}
|
|
2804
2804
|
return r.filter(Boolean).join(" ").trim();
|
|
2805
2805
|
}
|
|
2806
|
-
if (
|
|
2806
|
+
if (ll(e)) {
|
|
2807
2807
|
const t = e.rubricBlock;
|
|
2808
2808
|
return t.passage?.config ? (t.passage.config.markup || "").replace(/<[^>]*>/g, " ").trim() : (t.content || "").replace(/<[^>]*>/g, " ").trim();
|
|
2809
2809
|
}
|
|
@@ -2820,7 +2820,7 @@ function fn(e) {
|
|
|
2820
2820
|
/\d+\s*[+\-*/=]\s*\d+/
|
|
2821
2821
|
].some((n) => n.test(t));
|
|
2822
2822
|
}
|
|
2823
|
-
function
|
|
2823
|
+
function cl(e) {
|
|
2824
2824
|
const t = [
|
|
2825
2825
|
"pie-multiple-choice",
|
|
2826
2826
|
"pie-inline-choice",
|
|
@@ -2829,7 +2829,7 @@ function ol(e) {
|
|
|
2829
2829
|
"inline-choice",
|
|
2830
2830
|
"select-text"
|
|
2831
2831
|
];
|
|
2832
|
-
if (
|
|
2832
|
+
if (ho(e)) {
|
|
2833
2833
|
const n = e.item.config;
|
|
2834
2834
|
if (!n?.models) return !1;
|
|
2835
2835
|
const r = (Array.isArray(n.models) ? n.models : Object.values(n.models)).find((o) => o && typeof o == "object" && o.id === e.elementId);
|
|
@@ -2837,7 +2837,7 @@ function ol(e) {
|
|
|
2837
2837
|
const i = r.element || "";
|
|
2838
2838
|
return t.includes(i);
|
|
2839
2839
|
}
|
|
2840
|
-
if (
|
|
2840
|
+
if (uo(e)) {
|
|
2841
2841
|
const n = e.item.config?.models;
|
|
2842
2842
|
return (Array.isArray(n) ? n : n && typeof n == "object" ? Object.values(n) : []).some((r) => {
|
|
2843
2843
|
if (!r || typeof r != "object") return !1;
|
|
@@ -2850,7 +2850,7 @@ function ol(e) {
|
|
|
2850
2850
|
function pn(e) {
|
|
2851
2851
|
return sr(e).trim().length >= 10;
|
|
2852
2852
|
}
|
|
2853
|
-
function
|
|
2853
|
+
function ul(e) {
|
|
2854
2854
|
const t = sr(e);
|
|
2855
2855
|
return [
|
|
2856
2856
|
/chemistry|chemical|element|atom|molecule|compound/i,
|
|
@@ -2861,25 +2861,25 @@ function sl(e) {
|
|
|
2861
2861
|
/physics|force|energy|velocity|acceleration/i
|
|
2862
2862
|
].some((n) => n.test(t));
|
|
2863
2863
|
}
|
|
2864
|
-
var
|
|
2864
|
+
var hl = [
|
|
2865
2865
|
"assessment",
|
|
2866
2866
|
"section",
|
|
2867
2867
|
"item",
|
|
2868
2868
|
"passage",
|
|
2869
2869
|
"rubric"
|
|
2870
|
-
],
|
|
2871
|
-
function
|
|
2872
|
-
return
|
|
2870
|
+
], dl = new Set(hl);
|
|
2871
|
+
function fl(e) {
|
|
2872
|
+
return dl.has(e);
|
|
2873
2873
|
}
|
|
2874
2874
|
function ar(e, t, n) {
|
|
2875
2875
|
const r = e.trim(), i = n.trim();
|
|
2876
2876
|
if (!r || !i) throw new Error("Tool instance ids require non-empty tool and scope ids");
|
|
2877
|
-
if (!
|
|
2877
|
+
if (!fl(t)) throw new Error(`Unknown tool scope level '${t}'. Register custom levels with registerToolScopeLevel().`);
|
|
2878
2878
|
return `${r}:${t}:${i}`;
|
|
2879
2879
|
}
|
|
2880
|
-
var
|
|
2880
|
+
var pl = class {
|
|
2881
2881
|
constructor() {
|
|
2882
|
-
|
|
2882
|
+
f(this, "providerId", "desmos-calculator"), f(this, "providerName", "Desmos Calculator"), f(this, "category", "calculator"), f(this, "version", "1.10"), f(this, "requiresAuth", !0), f(this, "desmosProvider", null), f(this, "config", null);
|
|
2883
2883
|
}
|
|
2884
2884
|
async emitTelemetry(e, t) {
|
|
2885
2885
|
try {
|
|
@@ -2981,13 +2981,13 @@ var ul = class {
|
|
|
2981
2981
|
text: e,
|
|
2982
2982
|
offset: 0
|
|
2983
2983
|
}];
|
|
2984
|
-
},
|
|
2984
|
+
}, fo = (e) => String(e || "").trim().toLowerCase(), gl = () => fo((typeof navigator < "u" ? navigator.language || navigator.languages?.[0] : "") || "en-US"), ml = (e, t) => {
|
|
2985
2985
|
if (t) {
|
|
2986
2986
|
const s = e.find((a) => a.name === t);
|
|
2987
2987
|
if (s) return s;
|
|
2988
2988
|
}
|
|
2989
|
-
const n =
|
|
2990
|
-
const a =
|
|
2989
|
+
const n = gl(), r = n.split("-")[0] || "en", i = (s) => {
|
|
2990
|
+
const a = fo(s.lang);
|
|
2991
2991
|
return a === n || a.startsWith(`${r}-`);
|
|
2992
2992
|
}, o = [
|
|
2993
2993
|
(s) => s.localService && i(s),
|
|
@@ -3001,14 +3001,14 @@ var ul = class {
|
|
|
3001
3001
|
if (a) return a;
|
|
3002
3002
|
}
|
|
3003
3003
|
return e[0] || null;
|
|
3004
|
-
},
|
|
3004
|
+
}, vl = (e) => !e.default, po = class {
|
|
3005
3005
|
constructor() {
|
|
3006
|
-
|
|
3006
|
+
f(this, "providerId", "browser"), f(this, "providerName", "Browser Speech Synthesis"), f(this, "version", "1.0.0");
|
|
3007
3007
|
}
|
|
3008
3008
|
async initialize(e) {
|
|
3009
3009
|
if (typeof window > "u") throw new Error("BrowserTTSProvider requires browser environment");
|
|
3010
3010
|
if (!("speechSynthesis" in window)) throw new Error("Browser does not support Speech Synthesis API");
|
|
3011
|
-
return new
|
|
3011
|
+
return new yl(e);
|
|
3012
3012
|
}
|
|
3013
3013
|
supportsFeature(e) {
|
|
3014
3014
|
return !0;
|
|
@@ -3026,9 +3026,9 @@ var ul = class {
|
|
|
3026
3026
|
}
|
|
3027
3027
|
destroy() {
|
|
3028
3028
|
}
|
|
3029
|
-
},
|
|
3029
|
+
}, yl = class {
|
|
3030
3030
|
constructor(e) {
|
|
3031
|
-
|
|
3031
|
+
f(this, "utterance", null), f(this, "config", null), f(this, "_isPlaying", !1), f(this, "_isPaused", !1), f(this, "speakRunId", 0), f(this, "onWordBoundary", void 0), this.config = e;
|
|
3032
3032
|
}
|
|
3033
3033
|
async speak(e) {
|
|
3034
3034
|
if (!this.config) throw new Error("TTS not initialized");
|
|
@@ -3113,8 +3113,8 @@ var ul = class {
|
|
|
3113
3113
|
}
|
|
3114
3114
|
const o = new SpeechSynthesisUtterance(e);
|
|
3115
3115
|
this.utterance = o;
|
|
3116
|
-
const s =
|
|
3117
|
-
s &&
|
|
3116
|
+
const s = ml(speechSynthesis.getVoices(), this.config?.voice);
|
|
3117
|
+
s && vl(s) && (o.voice = s), this.config?.rate && (o.rate = this.config.rate), this.config?.pitch && (o.pitch = this.config.pitch);
|
|
3118
3118
|
const a = () => {
|
|
3119
3119
|
this.utterance === o && (this.utterance = null);
|
|
3120
3120
|
};
|
|
@@ -3142,8 +3142,8 @@ var ul = class {
|
|
|
3142
3142
|
n === this.speakRunId && (this._isPaused = !1);
|
|
3143
3143
|
}, o.onboundary = (l) => {
|
|
3144
3144
|
if (n !== this.speakRunId || (console.log("[BrowserProvider] Boundary event:", l.name, "charIndex:", l.charIndex, "charLength:", l.charLength), l.name !== "word" || !this.onWordBoundary) || this.getHighlightMode() === "sentence") return;
|
|
3145
|
-
const c = Math.max(0, Math.min(l.charIndex, Math.max(0, e.length - 1))), u = Number(l.charLength || 0), h = this.inferWordLength(e, c),
|
|
3146
|
-
console.log("[BrowserProvider] Calling onWordBoundary with word:", g, "at position:", m), this.onWordBoundary(g, m,
|
|
3145
|
+
const c = Math.max(0, Math.min(l.charIndex, Math.max(0, e.length - 1))), u = Number(l.charLength || 0), h = this.inferWordLength(e, c), p = Number.isFinite(u) && u > 0 && u <= 80 && c + u <= e.length ? u : h, g = e.substring(c, Math.min(e.length, c + p)).trim(), m = t + c;
|
|
3146
|
+
console.log("[BrowserProvider] Calling onWordBoundary with word:", g, "at position:", m), this.onWordBoundary(g, m, p);
|
|
3147
3147
|
}, speechSynthesis.speak(o);
|
|
3148
3148
|
});
|
|
3149
3149
|
}
|
|
@@ -3168,7 +3168,7 @@ var ul = class {
|
|
|
3168
3168
|
...e.providerOptions || {}
|
|
3169
3169
|
});
|
|
3170
3170
|
}
|
|
3171
|
-
},
|
|
3171
|
+
}, bl = class {
|
|
3172
3172
|
async emitTelemetry(e, t) {
|
|
3173
3173
|
try {
|
|
3174
3174
|
await this.config?.onTelemetry?.(e, t);
|
|
@@ -3177,7 +3177,7 @@ var ul = class {
|
|
|
3177
3177
|
}
|
|
3178
3178
|
}
|
|
3179
3179
|
constructor(e = "browser") {
|
|
3180
|
-
|
|
3180
|
+
f(this, "providerId", "tts-service"), f(this, "providerName", "Text-to-Speech"), f(this, "category", "tts"), f(this, "version", "1.0"), f(this, "requiresAuth", void 0), f(this, "ttsProvider", null), f(this, "config", null), this.requiresAuth = e !== "browser";
|
|
3181
3181
|
}
|
|
3182
3182
|
async initialize(e) {
|
|
3183
3183
|
if (this.ttsProvider) {
|
|
@@ -3200,7 +3200,7 @@ var ul = class {
|
|
|
3200
3200
|
}
|
|
3201
3201
|
async _initializeBrowserTTS(e) {
|
|
3202
3202
|
if (typeof window > "u" || !("speechSynthesis" in window)) throw new Error("[TTSToolProvider] Browser TTS not supported (Web Speech API not available)");
|
|
3203
|
-
this.ttsProvider = new
|
|
3203
|
+
this.ttsProvider = new po(), console.log("[TTSToolProvider] Browser TTS initialized (Web Speech API)");
|
|
3204
3204
|
}
|
|
3205
3205
|
async _initializeServerTTS(e) {
|
|
3206
3206
|
if (!e.apiEndpoint) throw new Error("[TTSToolProvider] apiEndpoint required for server-based TTS backends");
|
|
@@ -3212,7 +3212,7 @@ var ul = class {
|
|
|
3212
3212
|
});
|
|
3213
3213
|
const n = await (async () => {
|
|
3214
3214
|
try {
|
|
3215
|
-
const r = await import("./dist-
|
|
3215
|
+
const r = await import("./dist-BV1q85ZL.js");
|
|
3216
3216
|
return await this.emitTelemetry("pie-tool-library-load-success", {
|
|
3217
3217
|
toolId: "textToSpeech",
|
|
3218
3218
|
operation: "server-provider-module-import",
|
|
@@ -3258,7 +3258,7 @@ var ul = class {
|
|
|
3258
3258
|
destroy() {
|
|
3259
3259
|
this.ttsProvider && (this.ttsProvider.destroy(), this.ttsProvider = null), this.config = null, console.log("[TTSToolProvider] Destroyed");
|
|
3260
3260
|
}
|
|
3261
|
-
},
|
|
3261
|
+
}, Tl = /* @__PURE__ */ new Set([
|
|
3262
3262
|
"annotation-xml",
|
|
3263
3263
|
"color-profile",
|
|
3264
3264
|
"font-face",
|
|
@@ -3267,16 +3267,16 @@ var ul = class {
|
|
|
3267
3267
|
"font-face-format",
|
|
3268
3268
|
"font-face-name",
|
|
3269
3269
|
"missing-glyph"
|
|
3270
|
-
]),
|
|
3270
|
+
]), Sl = /^[a-z][a-z0-9._-]*-[a-z0-9._-]*$/, _l = (e, t = "custom element tag") => {
|
|
3271
3271
|
if (!e || typeof e != "string") throw new Error(`Invalid ${t}: expected a non-empty string`);
|
|
3272
3272
|
const n = e.trim();
|
|
3273
3273
|
if (!n) throw new Error(`Invalid ${t}: tag is empty`);
|
|
3274
3274
|
if (n !== n.toLowerCase()) throw new Error(`Invalid ${t} "${n}": custom element names must be lowercase`);
|
|
3275
3275
|
if (!n.includes("-")) throw new Error(`Invalid ${t} "${n}": custom element names must include a hyphen`);
|
|
3276
|
-
if (
|
|
3277
|
-
if (!
|
|
3276
|
+
if (Tl.has(n)) throw new Error(`Invalid ${t} "${n}": this name is reserved by the HTML spec`);
|
|
3277
|
+
if (!Sl.test(n)) throw new Error(`Invalid ${t} "${n}": allowed characters are lowercase letters, numbers, ".", "_" and "-"`);
|
|
3278
3278
|
return n;
|
|
3279
|
-
},
|
|
3279
|
+
}, go = {
|
|
3280
3280
|
calculator: "pie-tool-calculator",
|
|
3281
3281
|
textToSpeech: "pie-tool-text-to-speech",
|
|
3282
3282
|
ruler: "pie-tool-ruler",
|
|
@@ -3288,29 +3288,29 @@ var ul = class {
|
|
|
3288
3288
|
annotationToolbar: "pie-tool-annotation-toolbar",
|
|
3289
3289
|
graph: "pie-tool-graph",
|
|
3290
3290
|
periodicTable: "pie-tool-periodic-table"
|
|
3291
|
-
},
|
|
3292
|
-
const i =
|
|
3291
|
+
}, wl = (e, t) => _l(t?.toolTagMap?.[e] ?? go[e] ?? e, `tool component tag for "${e}"`), kl = (e) => document.createElement(e), fe = (e, t, n, r) => {
|
|
3292
|
+
const i = wl(e, r), o = r?.toolComponentFactories?.[e] ?? r?.toolComponentFactory;
|
|
3293
3293
|
return o ? o({
|
|
3294
3294
|
toolId: e,
|
|
3295
3295
|
tagName: i,
|
|
3296
3296
|
context: t,
|
|
3297
3297
|
toolbarContext: n
|
|
3298
|
-
}) :
|
|
3299
|
-
},
|
|
3300
|
-
function
|
|
3298
|
+
}) : kl(i);
|
|
3299
|
+
}, Nn = /* @__PURE__ */ new WeakMap();
|
|
3300
|
+
function El(e, t) {
|
|
3301
3301
|
if (!e) return null;
|
|
3302
|
-
const n =
|
|
3302
|
+
const n = Nn.get(e), r = n?.get(t);
|
|
3303
3303
|
return r ? r.isConnected ? r : (n?.delete(t), null) : null;
|
|
3304
3304
|
}
|
|
3305
|
-
function
|
|
3305
|
+
function Al(e, t, n) {
|
|
3306
3306
|
if (!e) return;
|
|
3307
|
-
let r =
|
|
3308
|
-
r || (r = /* @__PURE__ */ new Map(),
|
|
3307
|
+
let r = Nn.get(e);
|
|
3308
|
+
r || (r = /* @__PURE__ */ new Map(), Nn.set(e, r)), r.set(t, n);
|
|
3309
3309
|
}
|
|
3310
3310
|
function Nr(e) {
|
|
3311
3311
|
return e === "basic" || e === "scientific" ? e : null;
|
|
3312
3312
|
}
|
|
3313
|
-
function
|
|
3313
|
+
function Cl(e) {
|
|
3314
3314
|
const t = e.getToolRenderParams?.("calculator") ?? {}, n = Nr(t.calculatorType), r = t.availableTypes;
|
|
3315
3315
|
return {
|
|
3316
3316
|
calculatorType: n,
|
|
@@ -3322,14 +3322,14 @@ function Hr(e, t, n) {
|
|
|
3322
3322
|
const r = e;
|
|
3323
3323
|
t ? (r.calculatorType = t, e.setAttribute("calculator-type", t)) : (delete r.calculatorType, e.removeAttribute("calculator-type")), n && n.length > 0 ? r.availableTypes = n : delete r.availableTypes;
|
|
3324
3324
|
}
|
|
3325
|
-
var
|
|
3325
|
+
var xl = {
|
|
3326
3326
|
toolId: "calculator",
|
|
3327
3327
|
name: "Calculator",
|
|
3328
3328
|
description: "Multi-type calculator (basic, scientific, graphing)",
|
|
3329
3329
|
icon: "calculator",
|
|
3330
3330
|
provider: {
|
|
3331
3331
|
getProviderId: (e) => typeof e?.provider?.id == "string" && e.provider.id.length > 0 ? e.provider.id : "calculator-desmos",
|
|
3332
|
-
createProvider: () => new
|
|
3332
|
+
createProvider: () => new pl(),
|
|
3333
3333
|
getInitConfig: (e) => e?.provider?.init ?? {},
|
|
3334
3334
|
getAuthFetcher: (e) => {
|
|
3335
3335
|
const t = e?.provider?.runtime?.authFetcher;
|
|
@@ -3355,8 +3355,8 @@ var kl = {
|
|
|
3355
3355
|
return fn(e);
|
|
3356
3356
|
},
|
|
3357
3357
|
renderToolbar(e, t) {
|
|
3358
|
-
const { calculatorType: n, availableTypes: r, displayName: i } =
|
|
3359
|
-
a ||
|
|
3358
|
+
const { calculatorType: n, availableTypes: r, displayName: i } = Cl(t), o = ar(this.toolId, t.scope.level, t.scope.scopeId), s = t.componentOverrides, a = El(t.toolCoordinator, o), l = a ?? fe(this.toolId, e, t, s);
|
|
3359
|
+
a || Al(t.toolCoordinator, o, l), l.setAttribute("tool-id", o), l.toolkitCoordinator = t.toolkitCoordinator, Hr(l, n, r);
|
|
3360
3360
|
const c = n === null ? "Open scientific calculator" : `Open ${i.toLowerCase()}`, u = n === null ? "Close scientific calculator" : `Close ${i.toLowerCase()}`, h = {
|
|
3361
3361
|
toolId: this.toolId,
|
|
3362
3362
|
label: i,
|
|
@@ -3367,7 +3367,7 @@ var kl = {
|
|
|
3367
3367
|
onClick: () => t.toggleTool(this.toolId),
|
|
3368
3368
|
active: t.isToolVisible(o)
|
|
3369
3369
|
};
|
|
3370
|
-
let
|
|
3370
|
+
let p = h.active;
|
|
3371
3371
|
return l.visible !== h.active && (l.visible = h.active), {
|
|
3372
3372
|
toolId: this.toolId,
|
|
3373
3373
|
elements: [{
|
|
@@ -3389,7 +3389,7 @@ var kl = {
|
|
|
3389
3389
|
button: h,
|
|
3390
3390
|
sync: () => {
|
|
3391
3391
|
const g = t.isToolVisible(o);
|
|
3392
|
-
h.active = g, h.label = i, h.ariaLabel = g ? u : c, h.tooltip = g ? `Close ${i.toLowerCase()}` : i,
|
|
3392
|
+
h.active = g, h.label = i, h.ariaLabel = g ? u : c, h.tooltip = g ? `Close ${i.toLowerCase()}` : i, p !== g && (l.visible = g, p = g), l.toolkitCoordinator !== t.toolkitCoordinator && (l.toolkitCoordinator = t.toolkitCoordinator), Hr(l, n, r);
|
|
3393
3393
|
},
|
|
3394
3394
|
subscribeActive: (g) => t.subscribeVisibility ? t.subscribeVisibility(() => {
|
|
3395
3395
|
g(t.isToolVisible(o));
|
|
@@ -3397,7 +3397,7 @@ var kl = {
|
|
|
3397
3397
|
}
|
|
3398
3398
|
};
|
|
3399
3399
|
}
|
|
3400
|
-
}, $ = (e) => e.trim().replace(/\s+/g, " "),
|
|
3400
|
+
}, $ = (e) => e.trim().replace(/\s+/g, " "), mo = () => /[\p{L}]+|\d+(?:\.\d+)?|[±√=+\-*/()²³^×÷≤≥≠≈<>|%°'′\u2062]/gu, vo = (e) => {
|
|
3401
3401
|
if (e.hidden || e.tagName?.toLowerCase() === "mjx-assistive-mml" || e.getAttribute("aria-hidden") === "true" || e.hasAttribute("inert")) return !0;
|
|
3402
3402
|
const t = e.classList;
|
|
3403
3403
|
if (t?.contains("sr-only") || t?.contains("pie-sr-only") || t?.contains("visually-hidden")) return !0;
|
|
@@ -3411,12 +3411,12 @@ var kl = {
|
|
|
3411
3411
|
}, ft = (e, t) => {
|
|
3412
3412
|
let n = e.nodeType === 1 ? e : e.parentElement;
|
|
3413
3413
|
for (; n; ) {
|
|
3414
|
-
if (
|
|
3414
|
+
if (vo(n)) return !0;
|
|
3415
3415
|
if (t && n === t) break;
|
|
3416
3416
|
n = n.parentElement;
|
|
3417
3417
|
}
|
|
3418
3418
|
return !1;
|
|
3419
|
-
},
|
|
3419
|
+
}, yo = (e, t, n) => {
|
|
3420
3420
|
if (!e || !t || /\s/.test(e) || /\s/.test(t)) return !1;
|
|
3421
3421
|
const r = n?.boundarySpacingMode ?? "segmenterPreferred";
|
|
3422
3422
|
if (r === "none") return !1;
|
|
@@ -3441,29 +3441,29 @@ var kl = {
|
|
|
3441
3441
|
const c = document.createTreeWalker(e, NodeFilter.SHOW_TEXT);
|
|
3442
3442
|
let u = c.nextNode();
|
|
3443
3443
|
for (; u; ) {
|
|
3444
|
-
const
|
|
3445
|
-
if (
|
|
3446
|
-
const g =
|
|
3447
|
-
!o && !s &&
|
|
3444
|
+
const p = u;
|
|
3445
|
+
if (p.parentElement && !ft(p, e)) {
|
|
3446
|
+
const g = p.textContent || "", m = g.match(/\S/), v = m ? m[0] : null;
|
|
3447
|
+
!o && !s && yo(l, v, t) && (r.push(" "), a && n.set(i, a), i++, s = !0);
|
|
3448
3448
|
for (let y = 0; y < g.length; y++) {
|
|
3449
3449
|
const S = g[y], O = /\s/.test(S);
|
|
3450
3450
|
o ? O || (o = !1, r.push(S), n.set(i, {
|
|
3451
|
-
node:
|
|
3451
|
+
node: p,
|
|
3452
3452
|
offset: y
|
|
3453
3453
|
}), a = {
|
|
3454
|
-
node:
|
|
3454
|
+
node: p,
|
|
3455
3455
|
offset: y
|
|
3456
3456
|
}, i++, s = !1, l = S) : O ? (s || (r.push(" "), n.set(i, {
|
|
3457
|
-
node:
|
|
3457
|
+
node: p,
|
|
3458
3458
|
offset: y
|
|
3459
3459
|
}), a = {
|
|
3460
|
-
node:
|
|
3460
|
+
node: p,
|
|
3461
3461
|
offset: y
|
|
3462
3462
|
}, i++), s = !0) : (r.push(S), n.set(i, {
|
|
3463
|
-
node:
|
|
3463
|
+
node: p,
|
|
3464
3464
|
offset: y
|
|
3465
3465
|
}), a = {
|
|
3466
|
-
node:
|
|
3466
|
+
node: p,
|
|
3467
3467
|
offset: y
|
|
3468
3468
|
}, i++, s = !1, l = S);
|
|
3469
3469
|
}
|
|
@@ -3476,49 +3476,49 @@ var kl = {
|
|
|
3476
3476
|
text: h,
|
|
3477
3477
|
map: n
|
|
3478
3478
|
};
|
|
3479
|
-
}, _n = null, Br = Promise.resolve(),
|
|
3479
|
+
}, _n = null, Br = Promise.resolve(), Il = (e) => (e || "en").split("-")[0].toLowerCase() || "en", Ol = async () => (_n || (_n = import("./sre-Dddi65jB.js").then((e) => /* @__PURE__ */ ss(e.default, 1)).then((e) => {
|
|
3480
3480
|
const t = e.default || e;
|
|
3481
3481
|
if (!t || typeof t.toSpeech != "function") throw new Error("speech-rule-engine did not expose toSpeech");
|
|
3482
3482
|
return t;
|
|
3483
|
-
})), _n),
|
|
3484
|
-
if (!
|
|
3485
|
-
const t =
|
|
3483
|
+
})), _n), Ml = (e) => e === "en" ? "clearspeak" : "mathspeak", Wr = (e) => !!e && typeof e == "object" && !Array.isArray(e), zr = (e) => typeof e == "string" && e.trim() ? e.trim() : void 0, gn = (e) => {
|
|
3484
|
+
if (!Wr(e)) return;
|
|
3485
|
+
const t = zr(e.domain), n = zr(e.style), r = Wr(e.engineOptions) ? e.engineOptions : void 0;
|
|
3486
3486
|
if (!(!t && !n && !r))
|
|
3487
3487
|
return {
|
|
3488
3488
|
...t ? { domain: t } : {},
|
|
3489
3489
|
...n ? { style: n } : {},
|
|
3490
3490
|
...r ? { engineOptions: r } : {}
|
|
3491
3491
|
};
|
|
3492
|
-
},
|
|
3493
|
-
const i =
|
|
3492
|
+
}, Ll = async (e, t, n, r) => {
|
|
3493
|
+
const i = Il(t), o = gn(r);
|
|
3494
3494
|
await e.setupEngine?.({
|
|
3495
3495
|
...o?.engineOptions || {},
|
|
3496
3496
|
locale: i,
|
|
3497
|
-
domain: o?.domain ||
|
|
3497
|
+
domain: o?.domain || Ml(i),
|
|
3498
3498
|
...o?.style ? { style: o.style } : {},
|
|
3499
3499
|
modality: "speech",
|
|
3500
3500
|
markup: n
|
|
3501
3501
|
}), await e.engineReady?.();
|
|
3502
|
-
},
|
|
3502
|
+
}, Rl = async (e) => {
|
|
3503
3503
|
const t = Br.then(e, e);
|
|
3504
3504
|
return Br = t.then(() => {
|
|
3505
3505
|
}, () => {
|
|
3506
3506
|
}), t;
|
|
3507
|
-
},
|
|
3507
|
+
}, bo = async (e, t, n, r, i) => Rl(async () => (await Ll(e, n, r, i), e.toSpeech(t))), $l = (e) => e.replace(/^\s*<\?xml[^>]*\?>\s*/i, ""), Pl = async (e, t, n, r) => {
|
|
3508
3508
|
try {
|
|
3509
|
-
const i =
|
|
3509
|
+
const i = $l(await bo(e, t, n, "ssml", r));
|
|
3510
3510
|
return i.includes("<speak") ? i : null;
|
|
3511
3511
|
} catch (i) {
|
|
3512
3512
|
return console.debug("[TTSService] Math SSML generation failed; using plain", { message: i instanceof Error ? i.message : String(i) }), null;
|
|
3513
3513
|
}
|
|
3514
|
-
},
|
|
3514
|
+
}, To = async (e, t = {}) => {
|
|
3515
3515
|
if (!e.some((c) => c.type === "math")) return {
|
|
3516
3516
|
speechText: $(e.map((c) => c.type === "text" ? c.text : c.fallbackText).join(" ")),
|
|
3517
3517
|
usedMathSpeech: !1,
|
|
3518
3518
|
usedFallback: !1
|
|
3519
3519
|
};
|
|
3520
3520
|
let n = null, r = !1, i = !1;
|
|
3521
|
-
const o = t.loadSre ||
|
|
3521
|
+
const o = t.loadSre || Ol, s = [];
|
|
3522
3522
|
for (const c of e) {
|
|
3523
3523
|
if (c.type === "text") {
|
|
3524
3524
|
s.push(c.text);
|
|
@@ -3526,7 +3526,7 @@ var kl = {
|
|
|
3526
3526
|
}
|
|
3527
3527
|
try {
|
|
3528
3528
|
n || (n = await o());
|
|
3529
|
-
const u = $(await
|
|
3529
|
+
const u = $(await bo(n, c.mathml, t.language, "none", t.mathSpeech));
|
|
3530
3530
|
if (u) {
|
|
3531
3531
|
s.push(u), r = !0;
|
|
3532
3532
|
continue;
|
|
@@ -3538,33 +3538,68 @@ var kl = {
|
|
|
3538
3538
|
}
|
|
3539
3539
|
const a = $(s.join(" "));
|
|
3540
3540
|
let l;
|
|
3541
|
-
return t.produceSsml && n && r && e.length === 1 && e[0].type === "math" && (l = await
|
|
3541
|
+
return t.produceSsml && n && r && e.length === 1 && e[0].type === "math" && (l = await Pl(n, e[0].mathml, t.language, t.mathSpeech) ?? void 0), {
|
|
3542
3542
|
speechText: a,
|
|
3543
3543
|
usedMathSpeech: r,
|
|
3544
3544
|
usedFallback: i,
|
|
3545
3545
|
ssml: l
|
|
3546
3546
|
};
|
|
3547
|
-
},
|
|
3547
|
+
}, Nl = /* @__PURE__ */ new Set([
|
|
3548
3548
|
"reserved-row",
|
|
3549
3549
|
"expanding-row",
|
|
3550
3550
|
"floating-overlay",
|
|
3551
3551
|
"left-aligned"
|
|
3552
|
-
]), Fr = (e) => e && typeof e == "object" ? e : {},
|
|
3552
|
+
]), Fr = (e) => e && typeof e == "object" ? e : {}, Hl = (e) => e === "polly" || e === "google" || e === "server", X = (e, t) => e === void 0 ? t : e, sn = (e, t = "left-aligned") => typeof e == "string" && Nl.has(e) ? e : t, Dr = Object.freeze([0.8, 1.25]), jr = (e) => {
|
|
3553
|
+
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) return;
|
|
3554
|
+
const t = Math.round(e * 100) / 100;
|
|
3555
|
+
return t === 1 ? void 0 : t;
|
|
3556
|
+
}, qr = (e) => {
|
|
3557
|
+
if (typeof e != "string") return;
|
|
3558
|
+
const t = e.trim();
|
|
3559
|
+
return t.length ? t : void 0;
|
|
3560
|
+
}, Vr = (e) => `${e}x`, So = (e, t) => t ? `Speed ${e}` : `${e} speed`, Bl = (e, t, n) => t ? t.toLowerCase().includes(e.toLowerCase()) ? t : `${e} ${t}` : So(e, n), Wl = (e) => {
|
|
3561
|
+
if (typeof e == "number") return jr(e);
|
|
3562
|
+
if (!e || typeof e != "object" || Array.isArray(e)) return;
|
|
3563
|
+
const t = e, n = jr(t.rate);
|
|
3564
|
+
if (n === void 0) return;
|
|
3565
|
+
const r = qr(t.label), i = qr(t.ariaLabel);
|
|
3566
|
+
return {
|
|
3567
|
+
rate: n,
|
|
3568
|
+
...r ? { label: r } : {},
|
|
3569
|
+
...i ? { ariaLabel: i } : {}
|
|
3570
|
+
};
|
|
3571
|
+
}, Hn = (e) => {
|
|
3553
3572
|
if (!Array.isArray(e)) return [...Dr];
|
|
3554
3573
|
if (e.length === 0) return [];
|
|
3555
|
-
const t = /* @__PURE__ */ new Set();
|
|
3556
|
-
for (const
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3574
|
+
const t = /* @__PURE__ */ new Set(), n = [];
|
|
3575
|
+
for (const r of e) {
|
|
3576
|
+
const i = Wl(r);
|
|
3577
|
+
if (i === void 0) continue;
|
|
3578
|
+
const o = typeof i == "number" ? i : i.rate;
|
|
3579
|
+
t.has(o) || (t.add(o), n.push(i));
|
|
3580
|
+
}
|
|
3581
|
+
return n.length ? n : [...Dr];
|
|
3582
|
+
}, zl = (e) => Hn(e).map((t) => {
|
|
3583
|
+
if (typeof t == "number") {
|
|
3584
|
+
const i = Vr(t);
|
|
3585
|
+
return {
|
|
3586
|
+
rate: t,
|
|
3587
|
+
label: i,
|
|
3588
|
+
ariaLabel: So(i, !0)
|
|
3589
|
+
};
|
|
3560
3590
|
}
|
|
3561
|
-
|
|
3562
|
-
|
|
3591
|
+
const n = Vr(t.rate), r = t.label || n;
|
|
3592
|
+
return {
|
|
3593
|
+
rate: t.rate,
|
|
3594
|
+
label: r,
|
|
3595
|
+
ariaLabel: Bl(r, t.ariaLabel, r === n)
|
|
3596
|
+
};
|
|
3597
|
+
}), Fl = (e) => {
|
|
3563
3598
|
const t = {
|
|
3564
3599
|
...e,
|
|
3565
3600
|
layoutMode: sn(e.layoutMode)
|
|
3566
3601
|
}, n = e.backend || "browser";
|
|
3567
|
-
if (!
|
|
3602
|
+
if (!Hl(n)) return t;
|
|
3568
3603
|
const r = {
|
|
3569
3604
|
...t,
|
|
3570
3605
|
apiEndpoint: X(t.apiEndpoint, "/api/tts"),
|
|
@@ -3585,14 +3620,14 @@ var kl = {
|
|
|
3585
3620
|
...r,
|
|
3586
3621
|
defaultVoice: X(r.defaultVoice, "en-US-Wavenet-A")
|
|
3587
3622
|
} : r;
|
|
3588
|
-
},
|
|
3623
|
+
}, wn = (e) => {
|
|
3589
3624
|
const t = Fr(e), n = Fr(t.settings);
|
|
3590
|
-
return
|
|
3625
|
+
return Fl({
|
|
3591
3626
|
...t,
|
|
3592
3627
|
...n
|
|
3593
3628
|
});
|
|
3594
|
-
}, Bn = (e) => e.backend || "browser",
|
|
3595
|
-
const t = Bn(e), n =
|
|
3629
|
+
}, Bn = (e) => e.backend || "browser", _o = (e, t) => t === "polly" || t === "google" ? t : e.serverProvider || e.provider, wo = (e, t) => e.transportMode || (t === "custom" ? "custom" : "pie"), Dl = (e) => {
|
|
3630
|
+
const t = Bn(e), n = _o(e, t), r = wo(e, n), i = gn(e.mathSpeech);
|
|
3596
3631
|
return {
|
|
3597
3632
|
voice: e.defaultVoice,
|
|
3598
3633
|
rate: e.rate,
|
|
@@ -3618,8 +3653,8 @@ var kl = {
|
|
|
3618
3653
|
validateEndpoint: e.validateEndpoint,
|
|
3619
3654
|
...typeof e.mathTokenHighlighting == "boolean" ? { mathTokenHighlighting: e.mathTokenHighlighting } : {}
|
|
3620
3655
|
};
|
|
3621
|
-
},
|
|
3622
|
-
switch (
|
|
3656
|
+
}, ko = (e) => sn(e.layoutMode), jl = (e) => {
|
|
3657
|
+
switch (ko(e)) {
|
|
3623
3658
|
case "reserved-row":
|
|
3624
3659
|
return {
|
|
3625
3660
|
mount: "before-buttons",
|
|
@@ -3645,21 +3680,21 @@ var kl = {
|
|
|
3645
3680
|
}
|
|
3646
3681
|
};
|
|
3647
3682
|
}
|
|
3648
|
-
}, gt = /* @__PURE__ */ new Map(),
|
|
3683
|
+
}, gt = /* @__PURE__ */ new Map(), ql = "__pieToolElementUnmount", Gr = "pie-tool-active-change", Vl = {
|
|
3649
3684
|
toolId: "textToSpeech",
|
|
3650
3685
|
name: "Text to Speech",
|
|
3651
3686
|
description: "Read content aloud",
|
|
3652
3687
|
icon: "volume-up",
|
|
3653
3688
|
provider: {
|
|
3654
3689
|
getProviderId: () => "tts",
|
|
3655
|
-
createProvider: (e) => new
|
|
3690
|
+
createProvider: (e) => new bl(Bn(wn(e))),
|
|
3656
3691
|
getInitConfig: (e) => {
|
|
3657
|
-
const t =
|
|
3692
|
+
const t = wn(e), n = Bn(t), r = _o(t, n);
|
|
3658
3693
|
return {
|
|
3659
3694
|
backend: n,
|
|
3660
3695
|
serverProvider: r,
|
|
3661
|
-
transportMode:
|
|
3662
|
-
...
|
|
3696
|
+
transportMode: wo(t, r),
|
|
3697
|
+
...Dl(t)
|
|
3663
3698
|
};
|
|
3664
3699
|
},
|
|
3665
3700
|
getAuthFetcher: (e) => {
|
|
@@ -3668,9 +3703,9 @@ var kl = {
|
|
|
3668
3703
|
},
|
|
3669
3704
|
sanitizeConfig: (e) => {
|
|
3670
3705
|
const t = e.settings && typeof e.settings == "object" ? { ...e.settings } : void 0;
|
|
3671
|
-
t && "layoutMode" in t && (t.layoutMode = sn(t.layoutMode)), t && "speedOptions" in t && (t.speedOptions =
|
|
3706
|
+
t && "layoutMode" in t && (t.layoutMode = sn(t.layoutMode)), t && "speedOptions" in t && (t.speedOptions = Hn(t.speedOptions));
|
|
3672
3707
|
const n = { ...e };
|
|
3673
|
-
return "layoutMode" in n && (n.layoutMode = sn(n.layoutMode)), "speedOptions" in n && (n.speedOptions =
|
|
3708
|
+
return "layoutMode" in n && (n.layoutMode = sn(n.layoutMode)), "speedOptions" in n && (n.speedOptions = Hn(n.speedOptions)), t && (n.settings = t), n;
|
|
3674
3709
|
},
|
|
3675
3710
|
lazy: !0
|
|
3676
3711
|
},
|
|
@@ -3685,12 +3720,12 @@ var kl = {
|
|
|
3685
3720
|
return pn(e);
|
|
3686
3721
|
},
|
|
3687
3722
|
renderToolbar(e, t) {
|
|
3688
|
-
const n = () =>
|
|
3723
|
+
const n = () => wn(t.toolkitCoordinator?.getToolConfig(this.toolId) || void 0), r = () => zl(n().speedOptions), i = () => ko(n()), o = () => jl(n()), s = ar(this.toolId, t.scope.level, t.scope.scopeId), a = () => {
|
|
3689
3724
|
const u = t.ui?.size;
|
|
3690
3725
|
return u === "sm" || u === "lg" ? u : "md";
|
|
3691
3726
|
}, l = () => {
|
|
3692
3727
|
let u = gt.get(s);
|
|
3693
|
-
return u && typeof u.isConnected == "boolean" && !u.isConnected && (gt.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[
|
|
3728
|
+
return u && typeof u.isConnected == "boolean" && !u.isConnected && (gt.delete(s), u = void 0), u || (u = document.createElement("pie-tool-tts-inline"), u[ql] = () => {
|
|
3694
3729
|
gt.get(s) === u && gt.delete(s);
|
|
3695
3730
|
}, gt.set(s, u)), u.setAttribute("tool-id", s), u.setAttribute("catalog-id", t.catalogId || t.itemId), u.setAttribute("language", t.language || "en-US"), u.setAttribute("size", a()), u.setAttribute("layout-mode", i()), u.speedOptions = r(), u;
|
|
3696
3731
|
}, c = o();
|
|
@@ -3706,12 +3741,12 @@ var kl = {
|
|
|
3706
3741
|
} }
|
|
3707
3742
|
}],
|
|
3708
3743
|
subscribeActive: (u) => {
|
|
3709
|
-
const h = l(),
|
|
3744
|
+
const h = l(), p = (g) => {
|
|
3710
3745
|
const m = g.detail;
|
|
3711
3746
|
u(m?.active === !0);
|
|
3712
3747
|
};
|
|
3713
|
-
return h.addEventListener(
|
|
3714
|
-
h.removeEventListener(
|
|
3748
|
+
return h.addEventListener(Gr, p), () => {
|
|
3749
|
+
h.removeEventListener(Gr, p);
|
|
3715
3750
|
};
|
|
3716
3751
|
},
|
|
3717
3752
|
sync: () => {
|
|
@@ -3739,7 +3774,7 @@ function Se(e) {
|
|
|
3739
3774
|
function cr(e, t) {
|
|
3740
3775
|
e.setAttribute("data-pie-tool-surface", t);
|
|
3741
3776
|
}
|
|
3742
|
-
var
|
|
3777
|
+
var Gl = {
|
|
3743
3778
|
toolId: "ruler",
|
|
3744
3779
|
name: "Ruler",
|
|
3745
3780
|
description: "On-screen ruler for measurements",
|
|
@@ -3781,7 +3816,7 @@ var zl = {
|
|
|
3781
3816
|
subscribeActive: n.subscribeActive
|
|
3782
3817
|
};
|
|
3783
3818
|
}
|
|
3784
|
-
},
|
|
3819
|
+
}, Ul = {
|
|
3785
3820
|
toolId: "protractor",
|
|
3786
3821
|
name: "Protractor",
|
|
3787
3822
|
description: "On-screen protractor for angle measurements",
|
|
@@ -3823,7 +3858,7 @@ var zl = {
|
|
|
3823
3858
|
subscribeActive: n.subscribeActive
|
|
3824
3859
|
};
|
|
3825
3860
|
}
|
|
3826
|
-
},
|
|
3861
|
+
}, Kl = {
|
|
3827
3862
|
toolId: "answerEliminator",
|
|
3828
3863
|
name: "Answer Eliminator",
|
|
3829
3864
|
description: "Strike through answer choices",
|
|
@@ -3836,7 +3871,7 @@ var zl = {
|
|
|
3836
3871
|
"choiceMasking"
|
|
3837
3872
|
],
|
|
3838
3873
|
isVisibleInContext(e) {
|
|
3839
|
-
return
|
|
3874
|
+
return cl(e);
|
|
3840
3875
|
},
|
|
3841
3876
|
renderToolbar(e, t) {
|
|
3842
3877
|
const n = Te(this.toolId, t), r = t.componentOverrides ?? {}, i = fe(this.toolId, e, t, r);
|
|
@@ -3870,7 +3905,7 @@ var zl = {
|
|
|
3870
3905
|
subscribeActive: n.subscribeActive
|
|
3871
3906
|
};
|
|
3872
3907
|
}
|
|
3873
|
-
},
|
|
3908
|
+
}, Xl = {
|
|
3874
3909
|
toolId: "highlighter",
|
|
3875
3910
|
name: "Highlighter",
|
|
3876
3911
|
description: "Highlight text",
|
|
@@ -3921,7 +3956,7 @@ var zl = {
|
|
|
3921
3956
|
subscribeActive: n.subscribeActive
|
|
3922
3957
|
};
|
|
3923
3958
|
}
|
|
3924
|
-
},
|
|
3959
|
+
}, Yl = {
|
|
3925
3960
|
toolId: "lineReader",
|
|
3926
3961
|
name: "Line Reader",
|
|
3927
3962
|
description: "Reading guide overlay",
|
|
@@ -3970,7 +4005,7 @@ var zl = {
|
|
|
3970
4005
|
subscribeActive: n.subscribeActive
|
|
3971
4006
|
};
|
|
3972
4007
|
}
|
|
3973
|
-
},
|
|
4008
|
+
}, Jl = {
|
|
3974
4009
|
toolId: "theme",
|
|
3975
4010
|
name: "Theme",
|
|
3976
4011
|
description: "Accessible themes and contrast",
|
|
@@ -4025,7 +4060,7 @@ var zl = {
|
|
|
4025
4060
|
subscribeActive: n.subscribeActive
|
|
4026
4061
|
};
|
|
4027
4062
|
}
|
|
4028
|
-
},
|
|
4063
|
+
}, Ql = {
|
|
4029
4064
|
toolId: "annotationToolbar",
|
|
4030
4065
|
name: "Highlighter",
|
|
4031
4066
|
description: "Highlight and annotate text",
|
|
@@ -4076,7 +4111,7 @@ var zl = {
|
|
|
4076
4111
|
subscribeActive: n.subscribeActive
|
|
4077
4112
|
};
|
|
4078
4113
|
}
|
|
4079
|
-
},
|
|
4114
|
+
}, Zl = {
|
|
4080
4115
|
toolId: "graph",
|
|
4081
4116
|
name: "Graph",
|
|
4082
4117
|
description: "Graphing calculator and coordinate plane",
|
|
@@ -4129,7 +4164,7 @@ var zl = {
|
|
|
4129
4164
|
subscribeActive: n.subscribeActive
|
|
4130
4165
|
};
|
|
4131
4166
|
}
|
|
4132
|
-
},
|
|
4167
|
+
}, ec = {
|
|
4133
4168
|
toolId: "periodicTable",
|
|
4134
4169
|
name: "Periodic Table",
|
|
4135
4170
|
description: "Chemistry periodic table reference",
|
|
@@ -4141,7 +4176,7 @@ var zl = {
|
|
|
4141
4176
|
"elementReference"
|
|
4142
4177
|
],
|
|
4143
4178
|
isVisibleInContext(e) {
|
|
4144
|
-
return
|
|
4179
|
+
return ul(e);
|
|
4145
4180
|
},
|
|
4146
4181
|
renderToolbar(e, t) {
|
|
4147
4182
|
const n = Te(this.toolId, t), r = {
|
|
@@ -4181,54 +4216,54 @@ var zl = {
|
|
|
4181
4216
|
subscribeActive: n.subscribeActive
|
|
4182
4217
|
};
|
|
4183
4218
|
}
|
|
4184
|
-
},
|
|
4185
|
-
|
|
4186
|
-
Bl,
|
|
4187
|
-
zl,
|
|
4188
|
-
Wl,
|
|
4189
|
-
Fl,
|
|
4190
|
-
Dl,
|
|
4191
|
-
jl,
|
|
4192
|
-
ql,
|
|
4219
|
+
}, tc = [
|
|
4220
|
+
xl,
|
|
4193
4221
|
Vl,
|
|
4194
4222
|
Gl,
|
|
4195
|
-
Ul
|
|
4223
|
+
Ul,
|
|
4224
|
+
Kl,
|
|
4225
|
+
Xl,
|
|
4226
|
+
Yl,
|
|
4227
|
+
Jl,
|
|
4228
|
+
Ql,
|
|
4229
|
+
Zl,
|
|
4230
|
+
ec
|
|
4196
4231
|
];
|
|
4197
|
-
function
|
|
4198
|
-
const t = new
|
|
4232
|
+
function nc(e = {}) {
|
|
4233
|
+
const t = new sl(), n = {
|
|
4199
4234
|
toolTagMap: {
|
|
4200
|
-
...
|
|
4235
|
+
...go,
|
|
4201
4236
|
...e.toolTagMap || {}
|
|
4202
4237
|
},
|
|
4203
4238
|
toolComponentFactory: e.toolComponentFactory,
|
|
4204
4239
|
toolComponentFactories: e.toolComponentFactories
|
|
4205
4240
|
}, r = (i) => e.overrides?.[i.toolId] || i;
|
|
4206
|
-
return e.includePackagedTools &&
|
|
4241
|
+
return e.includePackagedTools && rc(t, {
|
|
4207
4242
|
toolIds: e.toolIds,
|
|
4208
4243
|
applyOverrides: r
|
|
4209
4244
|
}), e.toolModuleLoaders && Object.keys(e.toolModuleLoaders).length > 0 && t.setToolModuleLoaders(e.toolModuleLoaders), t.setComponentOverrides(n), t;
|
|
4210
4245
|
}
|
|
4211
|
-
function
|
|
4246
|
+
function rc(e, t = {}) {
|
|
4212
4247
|
const n = t.toolIds && t.toolIds.length > 0 ? new Set(t.toolIds) : null, r = t.applyOverrides || ((i) => i);
|
|
4213
|
-
for (const i of
|
|
4248
|
+
for (const i of tc)
|
|
4214
4249
|
n && !n.has(i.toolId) || e.register(r(i));
|
|
4215
4250
|
}
|
|
4216
|
-
function
|
|
4217
|
-
return
|
|
4251
|
+
function ic(e = {}) {
|
|
4252
|
+
return nc({
|
|
4218
4253
|
...e,
|
|
4219
4254
|
includePackagedTools: !0
|
|
4220
4255
|
});
|
|
4221
4256
|
}
|
|
4222
|
-
function
|
|
4223
|
-
const e =
|
|
4257
|
+
function oc() {
|
|
4258
|
+
const e = ic(), t = /* @__PURE__ */ new Set();
|
|
4224
4259
|
for (const n of e.getAllTools()) for (const r of n.pnpSupportIds || []) t.add(r);
|
|
4225
4260
|
return [...t].sort();
|
|
4226
4261
|
}
|
|
4227
|
-
var
|
|
4228
|
-
supports: [...
|
|
4262
|
+
var sc = oc(), Th = {
|
|
4263
|
+
supports: [...sc],
|
|
4229
4264
|
prohibitedSupports: [],
|
|
4230
4265
|
activateAtInit: []
|
|
4231
|
-
},
|
|
4266
|
+
}, ac = {
|
|
4232
4267
|
visual: {
|
|
4233
4268
|
magnification: "magnification",
|
|
4234
4269
|
screenMagnifier: "screenMagnifier",
|
|
@@ -4341,11 +4376,11 @@ var Zl = Ql(), fh = {
|
|
|
4341
4376
|
itemGlossary: "itemGlossary",
|
|
4342
4377
|
tutorialAvailable: "tutorialAvailable"
|
|
4343
4378
|
}
|
|
4344
|
-
},
|
|
4379
|
+
}, Sh = Object.values(ac).flatMap((e) => Object.values(e)), _h = lo("ToolCoordinator"), Wn;
|
|
4345
4380
|
(function(e) {
|
|
4346
4381
|
e[e.BASE = 0] = "BASE", e[e.TOOL = 1e3] = "TOOL", e[e.MODAL = 2e3] = "MODAL", e[e.CONTROL = 3e3] = "CONTROL", e[e.HIGHLIGHT = 4e3] = "HIGHLIGHT";
|
|
4347
|
-
})(
|
|
4348
|
-
var
|
|
4382
|
+
})(Wn || (Wn = {}));
|
|
4383
|
+
var lc = /* @__PURE__ */ new Set([
|
|
4349
4384
|
"speak",
|
|
4350
4385
|
"p",
|
|
4351
4386
|
"s",
|
|
@@ -4354,20 +4389,20 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4354
4389
|
"say-as",
|
|
4355
4390
|
"voice",
|
|
4356
4391
|
"lang"
|
|
4357
|
-
]),
|
|
4392
|
+
]), Ur = /* @__PURE__ */ new Set(["audio", "phoneme"]), Eo = (e) => e.replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(/ /g, " ").replace(/ /g, " ").replace(/&/g, "&"), jt = (e, t, n) => {
|
|
4358
4393
|
for (let r = 0; r < t.length; r++) e.push({
|
|
4359
4394
|
char: t[r],
|
|
4360
4395
|
rawOffset: n === null ? null : n + r
|
|
4361
4396
|
});
|
|
4362
|
-
},
|
|
4397
|
+
}, cc = (e, t, n) => {
|
|
4363
4398
|
const r = t.slice(n).match(/^&(quot|apos|lt|gt|nbsp|amp|#160);/i);
|
|
4364
|
-
return r ? (jt(e,
|
|
4365
|
-
},
|
|
4399
|
+
return r ? (jt(e, Eo(r[0]), n), r[0].length) : 0;
|
|
4400
|
+
}, Kr = (e) => {
|
|
4366
4401
|
e.push({
|
|
4367
4402
|
char: " ",
|
|
4368
4403
|
rawOffset: null
|
|
4369
4404
|
});
|
|
4370
|
-
},
|
|
4405
|
+
}, uc = (e) => {
|
|
4371
4406
|
const t = /* @__PURE__ */ new Map(), n = [];
|
|
4372
4407
|
let r = !0;
|
|
4373
4408
|
for (const i of e) {
|
|
@@ -4383,19 +4418,19 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4383
4418
|
text: n.join(""),
|
|
4384
4419
|
rawToSpokenOffsetMap: t
|
|
4385
4420
|
};
|
|
4386
|
-
},
|
|
4421
|
+
}, hc = (e) => e.match(/^<\/?\s*([A-Za-z0-9:-]+)/)?.[1]?.toLowerCase() || "", dc = (e, t) => {
|
|
4387
4422
|
const n = new RegExp(`${t}\\s*=\\s*("([^"]*)"|'([^']*)')`, "i"), r = e.match(n);
|
|
4388
|
-
return
|
|
4389
|
-
},
|
|
4423
|
+
return Eo(r?.[2] ?? r?.[3] ?? "") || null;
|
|
4424
|
+
}, Ao = (e) => {
|
|
4390
4425
|
const t = [];
|
|
4391
4426
|
let n = !1, r = !1, i = 0;
|
|
4392
4427
|
for (; i < e.length; ) {
|
|
4393
4428
|
const s = e[i];
|
|
4394
4429
|
if (s !== "<") {
|
|
4395
4430
|
if (s === "&") {
|
|
4396
|
-
const
|
|
4397
|
-
if (
|
|
4398
|
-
i +=
|
|
4431
|
+
const p = cc(t, e, i);
|
|
4432
|
+
if (p > 0) {
|
|
4433
|
+
i += p;
|
|
4399
4434
|
continue;
|
|
4400
4435
|
}
|
|
4401
4436
|
}
|
|
@@ -4408,36 +4443,36 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4408
4443
|
continue;
|
|
4409
4444
|
}
|
|
4410
4445
|
r = !0;
|
|
4411
|
-
const l = e.slice(i, a + 1), c =
|
|
4446
|
+
const l = e.slice(i, a + 1), c = hc(l), u = /^<\s*\//.test(l), h = /\/\s*>$/.test(l);
|
|
4412
4447
|
if (!u && c === "sub") {
|
|
4413
|
-
const
|
|
4414
|
-
if (!
|
|
4448
|
+
const p = dc(l, "alias");
|
|
4449
|
+
if (!p) {
|
|
4415
4450
|
n = !0, i = a + 1;
|
|
4416
4451
|
continue;
|
|
4417
4452
|
}
|
|
4418
|
-
jt(t,
|
|
4453
|
+
jt(t, p, null);
|
|
4419
4454
|
const g = e.toLowerCase().indexOf("</sub>", a + 1);
|
|
4420
4455
|
i = g >= 0 ? g + 6 : a + 1;
|
|
4421
4456
|
continue;
|
|
4422
4457
|
}
|
|
4423
4458
|
if (!u && c === "break") {
|
|
4424
|
-
|
|
4459
|
+
Kr(t), i = a + 1;
|
|
4425
4460
|
continue;
|
|
4426
4461
|
}
|
|
4427
|
-
if (!u &&
|
|
4462
|
+
if (!u && Ur.has(c) && (n = !0, h)) {
|
|
4428
4463
|
i = a + 1;
|
|
4429
4464
|
continue;
|
|
4430
4465
|
}
|
|
4431
|
-
c && !
|
|
4466
|
+
c && !lc.has(c) && !Ur.has(c) && c !== "break" && c !== "sub" && (n = !0), !u && (c === "p" || c === "s") && Kr(t), i = a + 1;
|
|
4432
4467
|
}
|
|
4433
|
-
const o =
|
|
4468
|
+
const o = uc(t);
|
|
4434
4469
|
return {
|
|
4435
4470
|
spokenText: $(o.text),
|
|
4436
4471
|
rawToSpokenOffsetMap: o.rawToSpokenOffsetMap,
|
|
4437
4472
|
unsupportedSemantic: n,
|
|
4438
4473
|
hasMarkup: r
|
|
4439
4474
|
};
|
|
4440
|
-
},
|
|
4475
|
+
}, fc = mo(), Co = /* @__PURE__ */ new Map([
|
|
4441
4476
|
["zero", "0"],
|
|
4442
4477
|
["one", "1"],
|
|
4443
4478
|
["two", "2"],
|
|
@@ -4449,7 +4484,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4449
4484
|
["eight", "8"],
|
|
4450
4485
|
["nine", "9"],
|
|
4451
4486
|
["ten", "10"]
|
|
4452
|
-
]),
|
|
4487
|
+
]), pc = [
|
|
4453
4488
|
{
|
|
4454
4489
|
phrase: [
|
|
4455
4490
|
"plus",
|
|
@@ -4524,9 +4559,9 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4524
4559
|
visible: "+",
|
|
4525
4560
|
score: 5
|
|
4526
4561
|
}
|
|
4527
|
-
],
|
|
4562
|
+
], zn = (e) => {
|
|
4528
4563
|
const t = [];
|
|
4529
|
-
for (const n of e.matchAll(
|
|
4564
|
+
for (const n of e.matchAll(fc)) {
|
|
4530
4565
|
const r = n[0], i = n.index ?? 0;
|
|
4531
4566
|
t.push({
|
|
4532
4567
|
text: r,
|
|
@@ -4536,7 +4571,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4536
4571
|
});
|
|
4537
4572
|
}
|
|
4538
4573
|
return t;
|
|
4539
|
-
}, Fn = (e) =>
|
|
4574
|
+
}, Fn = (e) => Co.get(e.normalized) || e.normalized, gc = (e, t) => {
|
|
4540
4575
|
const n = [];
|
|
4541
4576
|
for (let r = 0; r < e.length; r++) {
|
|
4542
4577
|
for (let i = 0; i < t.length; i++) Fn(e[r]) === Fn(t[i]) && n.push({
|
|
@@ -4545,7 +4580,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4545
4580
|
visibleToken: i,
|
|
4546
4581
|
score: 10
|
|
4547
4582
|
});
|
|
4548
|
-
for (const i of
|
|
4583
|
+
for (const i of pc) {
|
|
4549
4584
|
const o = e.slice(r, r + i.phrase.length);
|
|
4550
4585
|
if (o.length === i.phrase.length && o.every((s, a) => s.normalized === i.phrase[a]))
|
|
4551
4586
|
for (let s = 0; s < t.length; s++)
|
|
@@ -4558,15 +4593,15 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4558
4593
|
}
|
|
4559
4594
|
}
|
|
4560
4595
|
return n;
|
|
4561
|
-
},
|
|
4562
|
-
const n =
|
|
4596
|
+
}, mc = (e, t) => {
|
|
4597
|
+
const n = gc(e, t).sort((l, c) => e[l.spokenStartToken].start - e[c.spokenStartToken].start || t[l.visibleToken].start - t[c.visibleToken].start), r = new Array(n.length).fill(0), i = new Array(n.length).fill(-1);
|
|
4563
4598
|
for (let l = 0; l < n.length; l++) {
|
|
4564
4599
|
const c = n[l];
|
|
4565
4600
|
r[l] = c.score;
|
|
4566
4601
|
for (let u = 0; u < l; u++) {
|
|
4567
4602
|
const h = n[u];
|
|
4568
4603
|
if (h.spokenEndToken <= c.spokenStartToken && h.visibleToken < c.visibleToken) {
|
|
4569
|
-
const
|
|
4604
|
+
const p = c.spokenStartToken - h.spokenEndToken, g = c.visibleToken - h.visibleToken - 1, m = Math.max(0, Math.abs(p - g) - 2), v = r[u] + c.score - m;
|
|
4570
4605
|
v > r[l] && (r[l] = v, i[l] = u);
|
|
4571
4606
|
}
|
|
4572
4607
|
}
|
|
@@ -4588,12 +4623,12 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4588
4623
|
score: l.score
|
|
4589
4624
|
};
|
|
4590
4625
|
});
|
|
4591
|
-
},
|
|
4626
|
+
}, vc = (e, t, n) => {
|
|
4592
4627
|
if (e.length === 0) return 0;
|
|
4593
4628
|
const r = e.length / Math.max(1, Math.min(t.length, n.length)), i = e.reduce((o, s) => o + s.score, 0) / e.length / 10;
|
|
4594
4629
|
return Math.min(1, r * i);
|
|
4595
|
-
},
|
|
4596
|
-
const t =
|
|
4630
|
+
}, xo = (e) => {
|
|
4631
|
+
const t = Ao(e.speechText), n = $(e.visibleText), r = t.spokenText, i = zn(r), o = zn(n), s = t.unsupportedSemantic ? [] : mc(i, o), a = vc(s, i, o), l = r === n && r.length > 0, c = s.length === 1 && s[0].score === 10 && i.length <= 2 && o.length <= 2, u = t.unsupportedSemantic ? "region-fallback" : l ? "exact-word" : (s.length >= 2 || c) && a >= 0.12 ? "anchor-span" : "region-fallback", h = t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text";
|
|
4597
4632
|
return {
|
|
4598
4633
|
speechText: e.speechText,
|
|
4599
4634
|
spokenText: r,
|
|
@@ -4606,16 +4641,16 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4606
4641
|
visibleTokens: o,
|
|
4607
4642
|
rawToSpokenOffsetMap: t.rawToSpokenOffsetMap
|
|
4608
4643
|
};
|
|
4609
|
-
}, ur = (e, t) => e.find((n) => n.start <= t && t < n.end) || null,
|
|
4644
|
+
}, ur = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, Io = (e) => {
|
|
4610
4645
|
if (!e || /^<[^>]+>$/.test(e.trim())) return null;
|
|
4611
|
-
const t =
|
|
4612
|
-
return t ?
|
|
4613
|
-
},
|
|
4614
|
-
const r =
|
|
4646
|
+
const t = zn(e)[0];
|
|
4647
|
+
return t ? Co.get(t.normalized) || t.normalized : null;
|
|
4648
|
+
}, Xr = (e, t, n) => {
|
|
4649
|
+
const r = Io(n);
|
|
4615
4650
|
if (!t || !r) return !1;
|
|
4616
4651
|
const i = ur(e.spokenTokens, t.start);
|
|
4617
4652
|
return i ? Fn(i) === r : !1;
|
|
4618
|
-
},
|
|
4653
|
+
}, Yr = (e, t) => {
|
|
4619
4654
|
const n = e.rawToSpokenOffsetMap.get(t);
|
|
4620
4655
|
if (n !== void 0) return n;
|
|
4621
4656
|
for (let r = t; r < e.speechText.length; r++) {
|
|
@@ -4624,36 +4659,36 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4624
4659
|
if (e.speechText[r] === ">") break;
|
|
4625
4660
|
}
|
|
4626
4661
|
return null;
|
|
4627
|
-
},
|
|
4628
|
-
const r =
|
|
4662
|
+
}, Jr = (e, t, n) => {
|
|
4663
|
+
const r = Yr(e, t);
|
|
4629
4664
|
if (r === null) return null;
|
|
4630
|
-
const i =
|
|
4665
|
+
const i = Yr(e, Math.max(t, t + n - 1)), o = ur(e.spokenTokens, r), s = i !== null && i >= r ? i - r + 1 : o ? o.end - r : n;
|
|
4631
4666
|
return {
|
|
4632
4667
|
start: r,
|
|
4633
4668
|
length: Math.max(1, s)
|
|
4634
4669
|
};
|
|
4635
|
-
},
|
|
4670
|
+
}, Qr = (e, t, n) => {
|
|
4636
4671
|
if (t < 0 || t >= e.spokenText.length) return null;
|
|
4637
4672
|
const r = ur(e.spokenTokens, t);
|
|
4638
4673
|
return r ? {
|
|
4639
4674
|
start: t,
|
|
4640
4675
|
length: Math.min(n, r.end - t)
|
|
4641
4676
|
} : null;
|
|
4642
|
-
},
|
|
4677
|
+
}, yc = (e, t, n = 1, r) => {
|
|
4643
4678
|
if (e.boundaryOffsetMode === "unsupported" || !Number.isFinite(t)) return null;
|
|
4644
4679
|
const i = Math.max(1, Number.isFinite(n) ? n : 1);
|
|
4645
4680
|
if (r && /^<[^>]+>$/.test(r.trim())) return null;
|
|
4646
4681
|
if (e.boundaryOffsetMode === "raw-ssml") {
|
|
4647
|
-
const o =
|
|
4682
|
+
const o = Jr(e, t, i), s = Qr(e, t, i);
|
|
4648
4683
|
if (r) {
|
|
4649
|
-
if (
|
|
4650
|
-
if (
|
|
4651
|
-
if (
|
|
4684
|
+
if (Xr(e, o, r)) return o;
|
|
4685
|
+
if (Xr(e, s, r)) return s;
|
|
4686
|
+
if (Io(r)) return null;
|
|
4652
4687
|
}
|
|
4653
4688
|
return o || s;
|
|
4654
4689
|
}
|
|
4655
|
-
return
|
|
4656
|
-
},
|
|
4690
|
+
return Qr(e, t, i) || Jr(e, t, i);
|
|
4691
|
+
}, bc = (e, t) => {
|
|
4657
4692
|
if (e.playbackMode === "region-fallback") return null;
|
|
4658
4693
|
const n = e.anchors.find((o) => o.spokenStart <= t && t < o.spokenEnd);
|
|
4659
4694
|
if (n) return {
|
|
@@ -4675,7 +4710,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4675
4710
|
start: Math.min(r.visibleStart, i.visibleStart),
|
|
4676
4711
|
end: Math.max(r.visibleEnd, i.visibleEnd)
|
|
4677
4712
|
} : null;
|
|
4678
|
-
},
|
|
4713
|
+
}, Tc = /* @__PURE__ */ new Map([
|
|
4679
4714
|
["+", ["plus"]],
|
|
4680
4715
|
["-", ["minus", "negative"]],
|
|
4681
4716
|
["−", ["minus", "negative"]],
|
|
@@ -4699,12 +4734,12 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4699
4734
|
["•", ["times"]],
|
|
4700
4735
|
["·", ["times"]],
|
|
4701
4736
|
["", ["times", "multiplied by"]]
|
|
4702
|
-
]),
|
|
4737
|
+
]), Sc = /* @__PURE__ */ new Map([
|
|
4703
4738
|
["", "function-application"],
|
|
4704
4739
|
["", "implicit-multiply"],
|
|
4705
4740
|
["", "invisible-separator"],
|
|
4706
4741
|
["", "invisible-plus"]
|
|
4707
|
-
]),
|
|
4742
|
+
]), Oo = /* @__PURE__ */ new Map([["2", ["squared"]], ["3", ["cubed"]]]), _c = /* @__PURE__ */ new Map([
|
|
4708
4743
|
["msqrt", "radical"],
|
|
4709
4744
|
["mroot", "radical"],
|
|
4710
4745
|
["msub", "subscript"],
|
|
@@ -4714,11 +4749,11 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4714
4749
|
["munderover", "underoverscript"],
|
|
4715
4750
|
["mmultiscripts", "multiscript"],
|
|
4716
4751
|
["menclose", "enclosure"]
|
|
4717
|
-
]),
|
|
4752
|
+
]), wc = (e) => e.replace(/\s+/g, " ").trim(), Ve = (e) => (e.localName || e.tagName || "").toLowerCase(), kc = (e) => e.nodeType === Node.ELEMENT_NODE, ut = (e) => Array.from(e.childNodes).filter(kc), hr = (e) => wc(e.textContent || ""), ye = (e, t) => ({
|
|
4718
4753
|
type: "element-range",
|
|
4719
4754
|
quality: t,
|
|
4720
4755
|
element: e
|
|
4721
|
-
}),
|
|
4756
|
+
}), Ec = (e) => {
|
|
4722
4757
|
switch (e) {
|
|
4723
4758
|
case "mi":
|
|
4724
4759
|
return "identifier";
|
|
@@ -4734,15 +4769,15 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4734
4769
|
default:
|
|
4735
4770
|
return "unknown";
|
|
4736
4771
|
}
|
|
4737
|
-
},
|
|
4738
|
-
const t = e.normalized ??
|
|
4772
|
+
}, Ac = (e, t) => t === "operator" ? e === "−" ? "-" : e : e.toLowerCase(), Cc = (e, t, n) => n === "fraction" ? ["over", "divided by"] : n === "superscript" ? Oo.get(e) ?? [] : e === "|" ? ["absolute value"] : t === "operator" ? Tc.get(e) || [] : [], Ke = (e) => {
|
|
4773
|
+
const t = e.normalized ?? Ac(e.text, e.kind || "unknown");
|
|
4739
4774
|
return {
|
|
4740
4775
|
id: `math-token-${e.state.nextId++}`,
|
|
4741
4776
|
kind: e.kind,
|
|
4742
4777
|
role: e.role,
|
|
4743
4778
|
text: e.text,
|
|
4744
4779
|
normalized: t,
|
|
4745
|
-
spokenAliases:
|
|
4780
|
+
spokenAliases: Cc(e.text, e.kind, e.role),
|
|
4746
4781
|
sourceElement: e.sourceElement,
|
|
4747
4782
|
path: e.path,
|
|
4748
4783
|
target: e.target || ye(e.sourceElement, "element-range"),
|
|
@@ -4750,9 +4785,9 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4750
4785
|
};
|
|
4751
4786
|
}, Xe = (e, t, n = "tokens") => {
|
|
4752
4787
|
e[n].push(t);
|
|
4753
|
-
},
|
|
4788
|
+
}, Mo = (e, t, n) => {
|
|
4754
4789
|
ut(e).forEach((r, i) => be(r, t, `${n}/${Ve(r)}[${i}]`));
|
|
4755
|
-
},
|
|
4790
|
+
}, xc = (e, t, n) => {
|
|
4756
4791
|
const r = ut(e);
|
|
4757
4792
|
r[0] && be(r[0], t, `${n}/numerator`), Xe(t, Ke({
|
|
4758
4793
|
state: t,
|
|
@@ -4763,7 +4798,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4763
4798
|
path: n,
|
|
4764
4799
|
target: ye(e, "element-range")
|
|
4765
4800
|
})), r[1] && be(r[1], t, `${n}/denominator`);
|
|
4766
|
-
},
|
|
4801
|
+
}, Ic = (e, t, n) => {
|
|
4767
4802
|
const r = e.getAttribute("open") || "(", i = e.getAttribute("close") || ")";
|
|
4768
4803
|
Xe(t, Ke({
|
|
4769
4804
|
state: t,
|
|
@@ -4773,7 +4808,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4773
4808
|
sourceElement: e,
|
|
4774
4809
|
path: `${n}/open`,
|
|
4775
4810
|
target: ye(e, "element-range")
|
|
4776
|
-
})),
|
|
4811
|
+
})), Mo(e, t, n), Xe(t, Ke({
|
|
4777
4812
|
state: t,
|
|
4778
4813
|
kind: "operator",
|
|
4779
4814
|
role: i === "|" ? "absolute-value-fence" : "close-fence",
|
|
@@ -4782,13 +4817,13 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4782
4817
|
path: `${n}/close`,
|
|
4783
4818
|
target: ye(e, "element-range")
|
|
4784
4819
|
}));
|
|
4785
|
-
},
|
|
4820
|
+
}, Oc = (e, t, n) => {
|
|
4786
4821
|
const r = ut(e);
|
|
4787
4822
|
r[0] && be(r[0], t, `${n}/base`);
|
|
4788
4823
|
const i = r[1];
|
|
4789
4824
|
if (!i) return;
|
|
4790
4825
|
const o = hr(i);
|
|
4791
|
-
if (
|
|
4826
|
+
if (Oo.has(o)) {
|
|
4792
4827
|
Xe(t, Ke({
|
|
4793
4828
|
state: t,
|
|
4794
4829
|
kind: "structure",
|
|
@@ -4802,7 +4837,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4802
4837
|
return;
|
|
4803
4838
|
}
|
|
4804
4839
|
be(i, t, `${n}/exponent`);
|
|
4805
|
-
},
|
|
4840
|
+
}, Mc = (e, t, n, r) => {
|
|
4806
4841
|
Xe(t, Ke({
|
|
4807
4842
|
state: t,
|
|
4808
4843
|
kind: "structure",
|
|
@@ -4813,7 +4848,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4813
4848
|
path: n,
|
|
4814
4849
|
target: ye(e, "element-range")
|
|
4815
4850
|
}));
|
|
4816
|
-
},
|
|
4851
|
+
}, Lc = (e, t, n) => {
|
|
4817
4852
|
let r = 0;
|
|
4818
4853
|
for (const i of ut(e))
|
|
4819
4854
|
(Ve(i) === "mtr" || Ve(i) === "mlabeledtr") && (r++, Xe(t, Ke({
|
|
@@ -4826,10 +4861,10 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4826
4861
|
path: `${n}/row[${r}]`,
|
|
4827
4862
|
target: ye(i, "region-fallback")
|
|
4828
4863
|
}), "layoutTargets")), be(i, t, `${n}/${Ve(i)}[${r}]`);
|
|
4829
|
-
},
|
|
4864
|
+
}, Rc = (e, t, n) => {
|
|
4830
4865
|
const r = hr(e);
|
|
4831
4866
|
if (!r) return;
|
|
4832
|
-
const i =
|
|
4867
|
+
const i = Ec(Ve(e)), o = i === "operator" ? Sc.get(r) : void 0, s = o ?? (i === "operator" && (r === "(" || r === ")") ? "grouping-fence" : i);
|
|
4833
4868
|
Xe(t, Ke({
|
|
4834
4869
|
state: t,
|
|
4835
4870
|
kind: i,
|
|
@@ -4860,19 +4895,19 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4860
4895
|
case "mtext":
|
|
4861
4896
|
case "ms":
|
|
4862
4897
|
case "mspace":
|
|
4863
|
-
|
|
4898
|
+
Rc(e, t, n);
|
|
4864
4899
|
return;
|
|
4865
4900
|
case "mfrac":
|
|
4866
|
-
|
|
4901
|
+
xc(e, t, n);
|
|
4867
4902
|
return;
|
|
4868
4903
|
case "msup":
|
|
4869
|
-
|
|
4904
|
+
Oc(e, t, n);
|
|
4870
4905
|
return;
|
|
4871
4906
|
case "mfenced":
|
|
4872
|
-
|
|
4907
|
+
Ic(e, t, n);
|
|
4873
4908
|
return;
|
|
4874
4909
|
case "mtable":
|
|
4875
|
-
|
|
4910
|
+
Lc(e, t, n);
|
|
4876
4911
|
return;
|
|
4877
4912
|
case "mphantom":
|
|
4878
4913
|
return;
|
|
@@ -4882,15 +4917,15 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4882
4917
|
return;
|
|
4883
4918
|
}
|
|
4884
4919
|
default: {
|
|
4885
|
-
const i =
|
|
4920
|
+
const i = _c.get(r);
|
|
4886
4921
|
if (i) {
|
|
4887
|
-
|
|
4922
|
+
Mc(e, t, n, i);
|
|
4888
4923
|
return;
|
|
4889
4924
|
}
|
|
4890
|
-
|
|
4925
|
+
Mo(e, t, n);
|
|
4891
4926
|
}
|
|
4892
4927
|
}
|
|
4893
|
-
},
|
|
4928
|
+
}, $c = (e) => {
|
|
4894
4929
|
const t = {
|
|
4895
4930
|
tokens: [],
|
|
4896
4931
|
layoutTargets: [],
|
|
@@ -4901,7 +4936,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4901
4936
|
layoutTargets: t.layoutTargets,
|
|
4902
4937
|
expressionTarget: ye(e, "region-fallback")
|
|
4903
4938
|
};
|
|
4904
|
-
},
|
|
4939
|
+
}, Pc = (e) => e.boundary && e.alignment.segments.find((t) => t.speechTokenIds.includes(e.boundary.token.id))?.target || null, Nc = 0.95, Hc = (e) => {
|
|
4905
4940
|
const t = [], n = /* @__PURE__ */ new Set(), r = (i) => {
|
|
4906
4941
|
const o = i.toLowerCase().trim().split(/\s+/).filter(Boolean);
|
|
4907
4942
|
if (o.length === 0) return;
|
|
@@ -4911,7 +4946,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4911
4946
|
r(e.normalized);
|
|
4912
4947
|
for (const i of e.spokenAliases) r(i);
|
|
4913
4948
|
return t;
|
|
4914
|
-
},
|
|
4949
|
+
}, Zr = (e, t, n) => {
|
|
4915
4950
|
let r = 0;
|
|
4916
4951
|
for (const i of n) {
|
|
4917
4952
|
if (i.length <= r) continue;
|
|
@@ -4926,13 +4961,13 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4926
4961
|
o && (r = i.length);
|
|
4927
4962
|
}
|
|
4928
4963
|
return r;
|
|
4929
|
-
},
|
|
4964
|
+
}, Bc = (e, t) => {
|
|
4930
4965
|
const n = [];
|
|
4931
4966
|
let r = 0;
|
|
4932
4967
|
for (const i of t) {
|
|
4933
|
-
const o =
|
|
4968
|
+
const o = Hc(i);
|
|
4934
4969
|
if (i.optional) {
|
|
4935
|
-
const s =
|
|
4970
|
+
const s = Zr(e, r, o);
|
|
4936
4971
|
s > 0 && (n.push({
|
|
4937
4972
|
speechTokens: e.slice(r, r + s),
|
|
4938
4973
|
math: i
|
|
@@ -4940,7 +4975,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4940
4975
|
continue;
|
|
4941
4976
|
}
|
|
4942
4977
|
for (; r < e.length; ) {
|
|
4943
|
-
const s =
|
|
4978
|
+
const s = Zr(e, r, o);
|
|
4944
4979
|
if (s > 0) {
|
|
4945
4980
|
n.push({
|
|
4946
4981
|
speechTokens: e.slice(r, r + s),
|
|
@@ -4952,23 +4987,23 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4952
4987
|
}
|
|
4953
4988
|
}
|
|
4954
4989
|
return n;
|
|
4955
|
-
},
|
|
4990
|
+
}, Wc = (e, t, n) => {
|
|
4956
4991
|
const r = n.filter((s) => !s.optional).length, i = e.filter((s) => !s.math.optional).length, o = e.reduce((s, a) => s + a.speechTokens.length, 0);
|
|
4957
4992
|
return r > 0 && i === r && o === t.length;
|
|
4958
|
-
},
|
|
4993
|
+
}, zc = (e) => e.map(({ speechTokens: t, math: n }) => ({
|
|
4959
4994
|
speechTokenIds: t.map((r) => r.id),
|
|
4960
4995
|
mathTokenIds: [n.id],
|
|
4961
4996
|
score: 1,
|
|
4962
4997
|
confidence: 1,
|
|
4963
4998
|
target: n.target
|
|
4964
|
-
})),
|
|
4965
|
-
const t = e.minExactWordConfidence ??
|
|
4999
|
+
})), Fc = (e) => {
|
|
5000
|
+
const t = e.minExactWordConfidence ?? Nc, n = Bc(e.speech.tokens, e.math.tokens), r = Wc(n, e.speech.tokens, e.math.tokens) ? 1 : 0;
|
|
4966
5001
|
return {
|
|
4967
|
-
segments: r >= t ?
|
|
5002
|
+
segments: r >= t ? zc(n) : [],
|
|
4968
5003
|
confidence: r,
|
|
4969
5004
|
fallbackTarget: e.math.expressionTarget
|
|
4970
5005
|
};
|
|
4971
|
-
},
|
|
5006
|
+
}, Lo = mo(), Dc = /* @__PURE__ */ new Map([
|
|
4972
5007
|
["zero", "0"],
|
|
4973
5008
|
["one", "1"],
|
|
4974
5009
|
["two", "2"],
|
|
@@ -4980,17 +5015,17 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
4980
5015
|
["eight", "8"],
|
|
4981
5016
|
["nine", "9"],
|
|
4982
5017
|
["ten", "10"]
|
|
4983
|
-
]),
|
|
5018
|
+
]), Ro = (e) => {
|
|
4984
5019
|
const t = e.toLowerCase();
|
|
4985
|
-
return
|
|
4986
|
-
},
|
|
5020
|
+
return Dc.get(t) || t;
|
|
5021
|
+
}, jc = (e) => {
|
|
4987
5022
|
const t = [];
|
|
4988
|
-
for (const n of e.matchAll(
|
|
5023
|
+
for (const n of e.matchAll(Lo)) {
|
|
4989
5024
|
const r = n[0], i = n.index ?? 0;
|
|
4990
5025
|
t.push({
|
|
4991
5026
|
id: `speech-token-${t.length}`,
|
|
4992
5027
|
text: r,
|
|
4993
|
-
normalized:
|
|
5028
|
+
normalized: Ro(r),
|
|
4994
5029
|
start: i,
|
|
4995
5030
|
end: i + r.length,
|
|
4996
5031
|
sourceStart: i,
|
|
@@ -5000,11 +5035,11 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5000
5035
|
}
|
|
5001
5036
|
return t;
|
|
5002
5037
|
}, Mt = (e) => {
|
|
5003
|
-
const t =
|
|
5038
|
+
const t = Ao(e.speechText);
|
|
5004
5039
|
return {
|
|
5005
5040
|
speechText: e.speechText,
|
|
5006
5041
|
spokenText: t.spokenText,
|
|
5007
|
-
tokens:
|
|
5042
|
+
tokens: jc(t.spokenText),
|
|
5008
5043
|
rawToSpokenOffsetMap: t.rawToSpokenOffsetMap,
|
|
5009
5044
|
boundaryOffsetSpace: t.unsupportedSemantic ? "unsupported" : t.hasMarkup ? "raw-ssml" : "plain-spoken-text",
|
|
5010
5045
|
unsupportedSemantic: t.unsupportedSemantic,
|
|
@@ -5012,9 +5047,9 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5012
5047
|
};
|
|
5013
5048
|
}, dr = (e) => {
|
|
5014
5049
|
if (!e || /^<[^>]+>$/.test(e.trim())) return null;
|
|
5015
|
-
const t = e.match(
|
|
5016
|
-
return t?.[0] ?
|
|
5017
|
-
},
|
|
5050
|
+
const t = e.match(Lo);
|
|
5051
|
+
return t?.[0] ? Ro(t[0]) : null;
|
|
5052
|
+
}, qc = (e, t) => e.find((n) => n.start <= t && t < n.end) || null, Vc = (e, t) => {
|
|
5018
5053
|
const n = e.rawToSpokenOffsetMap.get(t);
|
|
5019
5054
|
if (n !== void 0) return n;
|
|
5020
5055
|
for (let r = t; r < e.speechText.length; r++) {
|
|
@@ -5025,7 +5060,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5025
5060
|
return null;
|
|
5026
5061
|
}, Dn = (e, t, n) => {
|
|
5027
5062
|
if (t === null) return null;
|
|
5028
|
-
const r =
|
|
5063
|
+
const r = qc(e.tokens, t);
|
|
5029
5064
|
return r ? {
|
|
5030
5065
|
token: r,
|
|
5031
5066
|
start: t,
|
|
@@ -5035,9 +5070,9 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5035
5070
|
}, jn = (e, t) => {
|
|
5036
5071
|
const n = dr(t);
|
|
5037
5072
|
return !!(e && n && e.token.normalized === n);
|
|
5038
|
-
},
|
|
5073
|
+
}, Gc = (e) => {
|
|
5039
5074
|
if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
|
|
5040
|
-
const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = Dn(e.tokenization,
|
|
5075
|
+
const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = Dn(e.tokenization, Vc(e.tokenization, e.position), t), r = Dn(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
|
|
5041
5076
|
return jn(n, e.boundaryWord) ? {
|
|
5042
5077
|
...n,
|
|
5043
5078
|
confidence: 1
|
|
@@ -5045,7 +5080,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5045
5080
|
...r,
|
|
5046
5081
|
confidence: 1
|
|
5047
5082
|
} : e.boundaryWord && dr(e.boundaryWord) ? null : e.tokenization.boundaryOffsetSpace === "raw-ssml" ? n || r : r || n;
|
|
5048
|
-
},
|
|
5083
|
+
}, Uc = (e) => {
|
|
5049
5084
|
if (e.tokenization.boundaryOffsetSpace === "unsupported" || !Number.isFinite(e.position) || e.boundaryWord && /^<[^>]+>$/.test(e.boundaryWord.trim())) return null;
|
|
5050
5085
|
const t = Math.max(1, Number.isFinite(e.length) ? e.length : 1), n = Dn(e.tokenization, e.position >= 0 && e.position < e.tokenization.spokenText.length ? e.position : null, t);
|
|
5051
5086
|
return jn(n, e.boundaryWord) ? {
|
|
@@ -5053,27 +5088,27 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5053
5088
|
confidence: 1
|
|
5054
5089
|
} : e.boundaryWord && dr(e.boundaryWord) ? null : n;
|
|
5055
5090
|
}, an = (e) => {
|
|
5056
|
-
const t = Mt({ speechText: e.speechText }), n =
|
|
5091
|
+
const t = Mt({ speechText: e.speechText }), n = $c(e.mathElement);
|
|
5057
5092
|
return {
|
|
5058
5093
|
speech: t,
|
|
5059
5094
|
math: n,
|
|
5060
|
-
result:
|
|
5095
|
+
result: Fc({
|
|
5061
5096
|
speech: t,
|
|
5062
5097
|
math: n
|
|
5063
5098
|
})
|
|
5064
5099
|
};
|
|
5065
|
-
},
|
|
5066
|
-
const n =
|
|
5100
|
+
}, Kc = (e, t) => {
|
|
5101
|
+
const n = Uc({
|
|
5067
5102
|
tokenization: e.speech,
|
|
5068
5103
|
position: t.position,
|
|
5069
5104
|
length: t.length,
|
|
5070
5105
|
boundaryWord: t.boundaryWord
|
|
5071
5106
|
});
|
|
5072
|
-
return
|
|
5107
|
+
return Pc({
|
|
5073
5108
|
alignment: e.result,
|
|
5074
5109
|
boundary: n
|
|
5075
5110
|
});
|
|
5076
|
-
},
|
|
5111
|
+
}, Xc = (e, t) => {
|
|
5077
5112
|
if (!t.boundaryWord || /^<[^>]+>$/.test(t.boundaryWord.trim())) return null;
|
|
5078
5113
|
const n = Mt({ speechText: t.boundaryWord }).tokens[0];
|
|
5079
5114
|
if (!n) return null;
|
|
@@ -5082,7 +5117,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5082
5117
|
return i.normalized.toLowerCase() === o || i.spokenAliases.some((s) => s.toLowerCase() === o);
|
|
5083
5118
|
});
|
|
5084
5119
|
return r.length === 1 ? r[0].target : null;
|
|
5085
|
-
}, qn = "http://www.w3.org/1998/Math/MathML",
|
|
5120
|
+
}, qn = "http://www.w3.org/1998/Math/MathML", Yc = /* @__PURE__ */ new Set([
|
|
5086
5121
|
"math",
|
|
5087
5122
|
"maction",
|
|
5088
5123
|
"menclose",
|
|
@@ -5116,7 +5151,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5116
5151
|
"semantics",
|
|
5117
5152
|
"annotation",
|
|
5118
5153
|
"annotation-xml"
|
|
5119
|
-
]),
|
|
5154
|
+
]), Jc = /* @__PURE__ */ new Set([
|
|
5120
5155
|
"accent",
|
|
5121
5156
|
"accentunder",
|
|
5122
5157
|
"align",
|
|
@@ -5168,44 +5203,44 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5168
5203
|
"width",
|
|
5169
5204
|
"xmlns",
|
|
5170
5205
|
"xml:lang"
|
|
5171
|
-
]),
|
|
5206
|
+
]), $o = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), Qc = (e) => $o(e).replace(/"/g, """), Zc = (e, t) => {
|
|
5172
5207
|
const n = e.toLowerCase(), r = t.trim().toLowerCase();
|
|
5173
|
-
return !!(n.startsWith("on") || !
|
|
5174
|
-
},
|
|
5208
|
+
return !!(n.startsWith("on") || !Jc.has(n) || r.includes("javascript:") || r.includes("data:text/html"));
|
|
5209
|
+
}, eu = (e) => {
|
|
5175
5210
|
const t = e.localName.toLowerCase();
|
|
5176
|
-
if (!
|
|
5211
|
+
if (!Yc.has(t)) return !1;
|
|
5177
5212
|
const n = e.namespaceURI;
|
|
5178
5213
|
return !n || n === qn || n === "http://www.w3.org/1999/xhtml";
|
|
5179
|
-
},
|
|
5180
|
-
if (e.nodeType === Node.TEXT_NODE) return
|
|
5214
|
+
}, Po = (e) => {
|
|
5215
|
+
if (e.nodeType === Node.TEXT_NODE) return $o(e.textContent || "");
|
|
5181
5216
|
if (e.nodeType === Node.COMMENT_NODE) return "";
|
|
5182
5217
|
if (e.nodeType !== Node.ELEMENT_NODE) return null;
|
|
5183
5218
|
const t = e;
|
|
5184
|
-
if (!
|
|
5219
|
+
if (!eu(t)) return null;
|
|
5185
5220
|
const n = t.localName.toLowerCase(), r = [];
|
|
5186
5221
|
for (const o of Array.from(t.attributes)) {
|
|
5187
5222
|
const s = o.name.toLowerCase();
|
|
5188
|
-
if (!
|
|
5223
|
+
if (!Zc(s, o.value)) {
|
|
5189
5224
|
if (s === "xmlns" && o.value !== qn) return null;
|
|
5190
|
-
r.push(`${s}="${
|
|
5225
|
+
r.push(`${s}="${Qc(o.value)}"`);
|
|
5191
5226
|
}
|
|
5192
5227
|
}
|
|
5193
5228
|
n === "math" && !r.some((o) => o.startsWith("xmlns=")) && r.unshift(`xmlns="${qn}"`);
|
|
5194
5229
|
const i = [];
|
|
5195
5230
|
for (const o of Array.from(t.childNodes)) {
|
|
5196
|
-
const s =
|
|
5231
|
+
const s = Po(o);
|
|
5197
5232
|
if (s === null) return null;
|
|
5198
5233
|
i.push(s);
|
|
5199
5234
|
}
|
|
5200
5235
|
return `<${n}${r.length > 0 ? ` ${r.join(" ")}` : ""}>${i.join("")}</${n}>`;
|
|
5201
|
-
},
|
|
5236
|
+
}, tu = (e) => typeof DOMParser < "u" ? new DOMParser().parseFromString(e, "application/xml") : null, kn = (e) => {
|
|
5202
5237
|
const t = String(e || "").trim();
|
|
5203
5238
|
if (!t) return null;
|
|
5204
|
-
const n =
|
|
5239
|
+
const n = tu(t);
|
|
5205
5240
|
if (!n || n.getElementsByTagName("parsererror").length > 0) return null;
|
|
5206
5241
|
const r = n.documentElement;
|
|
5207
|
-
return !r || r.localName.toLowerCase() !== "math" ? null :
|
|
5208
|
-
},
|
|
5242
|
+
return !r || r.localName.toLowerCase() !== "math" ? null : Po(r);
|
|
5243
|
+
}, No = (e) => ({
|
|
5209
5244
|
chars: [],
|
|
5210
5245
|
map: /* @__PURE__ */ new Map(),
|
|
5211
5246
|
position: 0,
|
|
@@ -5213,28 +5248,28 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5213
5248
|
lastCharWasWhitespace: !1,
|
|
5214
5249
|
lastMapped: null,
|
|
5215
5250
|
options: e
|
|
5216
|
-
}),
|
|
5251
|
+
}), Ho = (e) => e.classList?.contains("MathJax") || e.tagName?.toLowerCase() === "mjx-container", Bo = (e) => e.tagName?.toLowerCase() === "mjx-assistive-mml", Wo = (e) => {
|
|
5217
5252
|
const t = e.tagName?.toLowerCase();
|
|
5218
5253
|
return t === "annotation" || t === "annotation-xml";
|
|
5219
|
-
},
|
|
5254
|
+
}, nu = (e) => {
|
|
5220
5255
|
const t = e.getAttribute("data-mathml");
|
|
5221
5256
|
return t && t.trim() ? t : null;
|
|
5222
|
-
},
|
|
5223
|
-
if (e.tagName.toLowerCase() === "math") return
|
|
5224
|
-
const t =
|
|
5257
|
+
}, ru = (e) => e.querySelector("mjx-assistive-mml math")?.outerHTML || null, iu = (e) => {
|
|
5258
|
+
if (e.tagName.toLowerCase() === "math") return kn(e.outerHTML);
|
|
5259
|
+
const t = nu(e);
|
|
5225
5260
|
if (t) {
|
|
5226
|
-
const n =
|
|
5261
|
+
const n = kn(t);
|
|
5227
5262
|
if (n) return n;
|
|
5228
5263
|
}
|
|
5229
|
-
if (
|
|
5230
|
-
const n =
|
|
5264
|
+
if (Ho(e)) {
|
|
5265
|
+
const n = ru(e);
|
|
5231
5266
|
if (n) {
|
|
5232
|
-
const r =
|
|
5267
|
+
const r = kn(n);
|
|
5233
5268
|
if (r) return r;
|
|
5234
5269
|
}
|
|
5235
5270
|
}
|
|
5236
5271
|
return null;
|
|
5237
|
-
},
|
|
5272
|
+
}, ou = /* @__PURE__ */ new Set([
|
|
5238
5273
|
"P",
|
|
5239
5274
|
"H1",
|
|
5240
5275
|
"H2",
|
|
@@ -5250,7 +5285,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5250
5285
|
"FIGCAPTION",
|
|
5251
5286
|
"LABEL",
|
|
5252
5287
|
"BUTTON"
|
|
5253
|
-
]),
|
|
5288
|
+
]), su = /* @__PURE__ */ new Set([
|
|
5254
5289
|
"heading",
|
|
5255
5290
|
"listitem",
|
|
5256
5291
|
"option",
|
|
@@ -5259,24 +5294,24 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5259
5294
|
"cell",
|
|
5260
5295
|
"columnheader",
|
|
5261
5296
|
"rowheader"
|
|
5262
|
-
]),
|
|
5297
|
+
]), au = (e, t) => {
|
|
5263
5298
|
let n = e.parentElement, r = null;
|
|
5264
5299
|
for (; n && n !== t; ) {
|
|
5265
5300
|
const i = (n.getAttribute("role") || "").toLowerCase(), o = n.tagName.toUpperCase();
|
|
5266
|
-
if (
|
|
5301
|
+
if (ou.has(o) || su.has(i)) {
|
|
5267
5302
|
r = n;
|
|
5268
5303
|
break;
|
|
5269
5304
|
}
|
|
5270
5305
|
n = n.parentElement;
|
|
5271
5306
|
}
|
|
5272
5307
|
return r || t;
|
|
5273
|
-
},
|
|
5308
|
+
}, lu = (e) => !!(typeof e.querySelector == "function" && e.querySelector("math, [data-mathml], .MathJax, mjx-container, mjx-assistive-mml")) || e.tagName?.toLowerCase() === "math" || e.hasAttribute?.("data-mathml") || Ho(e), He = (e, t, n) => {
|
|
5274
5309
|
/[.,;:!?]/.test(t) && e.chars.length > 0 && e.chars[e.chars.length - 1] === " " && (e.chars.pop(), e.position--, e.map.delete(e.position)), e.chars.push(t), n ? (e.map.set(e.position, n), e.lastMapped = n) : e.lastMapped && e.map.set(e.position, e.lastMapped), e.position++;
|
|
5275
|
-
},
|
|
5310
|
+
}, zo = (e, t) => {
|
|
5276
5311
|
if (e.inLeadingWhitespace || e.lastCharWasWhitespace || e.chars.length === 0) return !1;
|
|
5277
5312
|
const n = e.chars[e.chars.length - 1];
|
|
5278
|
-
return
|
|
5279
|
-
},
|
|
5313
|
+
return yo(n, t, e.options);
|
|
5314
|
+
}, Fo = (e, t) => {
|
|
5280
5315
|
const n = t.textContent || "";
|
|
5281
5316
|
let r = !1;
|
|
5282
5317
|
for (let i = 0; i < n.length; i++) {
|
|
@@ -5295,7 +5330,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5295
5330
|
}), e.lastCharWasWhitespace = !0;
|
|
5296
5331
|
continue;
|
|
5297
5332
|
}
|
|
5298
|
-
!r &&
|
|
5333
|
+
!r && zo(e, o) && He(e, " ", {
|
|
5299
5334
|
node: t,
|
|
5300
5335
|
offset: i
|
|
5301
5336
|
}), He(e, o, {
|
|
@@ -5303,7 +5338,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5303
5338
|
offset: i
|
|
5304
5339
|
}), r = !0, e.lastCharWasWhitespace = !1;
|
|
5305
5340
|
}
|
|
5306
|
-
},
|
|
5341
|
+
}, cu = (e, t) => {
|
|
5307
5342
|
for (let n = 0; n < t.text.length; n++) {
|
|
5308
5343
|
const r = t.text[n], i = /\s/.test(r), o = t.map.get(n) || null, s = o?.node || e.lastMapped?.node || null, a = o?.offset ?? e.lastMapped?.offset ?? 0, l = o ? {
|
|
5309
5344
|
node: o.node,
|
|
@@ -5320,7 +5355,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5320
5355
|
e.lastCharWasWhitespace || He(e, " ", l), e.lastCharWasWhitespace = !0;
|
|
5321
5356
|
continue;
|
|
5322
5357
|
}
|
|
5323
|
-
n === 0 &&
|
|
5358
|
+
n === 0 && zo(e, r) && He(e, " ", l), He(e, r, l), e.lastCharWasWhitespace = !1, o ? (e.map.set(e.position - 1, {
|
|
5324
5359
|
node: o.node,
|
|
5325
5360
|
offset: o.offset
|
|
5326
5361
|
}), e.lastMapped = {
|
|
@@ -5331,7 +5366,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5331
5366
|
offset: a
|
|
5332
5367
|
});
|
|
5333
5368
|
}
|
|
5334
|
-
},
|
|
5369
|
+
}, uu = (e) => {
|
|
5335
5370
|
if (typeof DOMParser > "u") return "";
|
|
5336
5371
|
const t = new DOMParser().parseFromString(e, "application/xml");
|
|
5337
5372
|
if (t.getElementsByTagName("parsererror").length > 0) return "";
|
|
@@ -5343,38 +5378,38 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5343
5378
|
}
|
|
5344
5379
|
if (i.nodeType !== 1) return;
|
|
5345
5380
|
const o = i;
|
|
5346
|
-
if (!
|
|
5381
|
+
if (!Wo(o))
|
|
5347
5382
|
for (const s of Array.from(o.childNodes)) r(s);
|
|
5348
5383
|
};
|
|
5349
5384
|
return r(t.documentElement), $(n.join(" "));
|
|
5350
|
-
},
|
|
5351
|
-
const r =
|
|
5385
|
+
}, hu = (e, t, n) => {
|
|
5386
|
+
const r = No(n), i = (a) => {
|
|
5352
5387
|
if (ft(a, e)) return;
|
|
5353
5388
|
if (a.nodeType === 3) {
|
|
5354
|
-
|
|
5389
|
+
Fo(r, a);
|
|
5355
5390
|
return;
|
|
5356
5391
|
}
|
|
5357
5392
|
if (a.nodeType !== 1) return;
|
|
5358
5393
|
const l = a;
|
|
5359
|
-
if (!(
|
|
5394
|
+
if (!(Bo(l) || Wo(l)))
|
|
5360
5395
|
for (const c of Array.from(l.childNodes)) i(c);
|
|
5361
5396
|
};
|
|
5362
|
-
i(e),
|
|
5397
|
+
i(e), Do(r);
|
|
5363
5398
|
const o = $(r.chars.join(""));
|
|
5364
5399
|
if (o) return {
|
|
5365
5400
|
text: o,
|
|
5366
5401
|
map: r.map
|
|
5367
5402
|
};
|
|
5368
|
-
const s =
|
|
5403
|
+
const s = uu(t);
|
|
5369
5404
|
return s ? {
|
|
5370
5405
|
text: s,
|
|
5371
5406
|
map: /* @__PURE__ */ new Map()
|
|
5372
5407
|
} : on(e, n);
|
|
5373
|
-
},
|
|
5408
|
+
}, Do = (e) => {
|
|
5374
5409
|
for (; e.chars.length > 0 && /\s/.test(e.chars[e.chars.length - 1]); )
|
|
5375
5410
|
e.chars.pop(), e.position--, e.map.delete(e.position);
|
|
5376
|
-
},
|
|
5377
|
-
const n =
|
|
5411
|
+
}, du = (e, t) => {
|
|
5412
|
+
const n = No(t), r = [];
|
|
5378
5413
|
let i = 0, o, s = !1;
|
|
5379
5414
|
const a = () => {
|
|
5380
5415
|
const u = $(n.chars.slice(i, n.chars.length).join(""));
|
|
@@ -5386,22 +5421,22 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5386
5421
|
}, l = (u) => {
|
|
5387
5422
|
if (ft(u, e)) return;
|
|
5388
5423
|
if (u.nodeType === Node.TEXT_NODE) {
|
|
5389
|
-
const g =
|
|
5390
|
-
o && g !== o && a(), o = g,
|
|
5424
|
+
const g = au(u, e);
|
|
5425
|
+
o && g !== o && a(), o = g, Fo(n, u);
|
|
5391
5426
|
return;
|
|
5392
5427
|
}
|
|
5393
5428
|
if (u.nodeType !== Node.ELEMENT_NODE) return;
|
|
5394
5429
|
const h = u;
|
|
5395
|
-
if (
|
|
5396
|
-
const
|
|
5397
|
-
if (
|
|
5430
|
+
if (Bo(h)) return;
|
|
5431
|
+
const p = iu(h);
|
|
5432
|
+
if (p) {
|
|
5398
5433
|
a();
|
|
5399
|
-
const g =
|
|
5400
|
-
|
|
5434
|
+
const g = hu(h, p, t);
|
|
5435
|
+
cu(n, g);
|
|
5401
5436
|
const m = $(g.text);
|
|
5402
5437
|
r.push({
|
|
5403
5438
|
type: "math",
|
|
5404
|
-
mathml:
|
|
5439
|
+
mathml: p,
|
|
5405
5440
|
fallbackText: m,
|
|
5406
5441
|
sourceElement: h
|
|
5407
5442
|
}), i = n.chars.length, s = !0;
|
|
@@ -5410,7 +5445,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5410
5445
|
for (const g of Array.from(h.childNodes)) l(g);
|
|
5411
5446
|
};
|
|
5412
5447
|
for (const u of Array.from(e.childNodes)) l(u);
|
|
5413
|
-
|
|
5448
|
+
Do(n), a();
|
|
5414
5449
|
const c = n.chars.join("");
|
|
5415
5450
|
for (; n.map.has(c.length); ) n.map.delete(c.length);
|
|
5416
5451
|
return {
|
|
@@ -5420,7 +5455,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5420
5455
|
containsMathMarkup: s
|
|
5421
5456
|
};
|
|
5422
5457
|
}, bt = (e, t) => {
|
|
5423
|
-
if (!
|
|
5458
|
+
if (!lu(e)) {
|
|
5424
5459
|
const { text: n, map: r } = on(e, t);
|
|
5425
5460
|
return {
|
|
5426
5461
|
visibleText: n,
|
|
@@ -5432,8 +5467,8 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5432
5467
|
containsMathMarkup: !1
|
|
5433
5468
|
};
|
|
5434
5469
|
}
|
|
5435
|
-
return
|
|
5436
|
-
},
|
|
5470
|
+
return du(e, t);
|
|
5471
|
+
}, fu = (e, t) => To([e], t), pu = (e) => (e || "en").split("-")[0].toLowerCase() || "en", gu = /* @__PURE__ */ new Set([
|
|
5437
5472
|
"H1",
|
|
5438
5473
|
"H2",
|
|
5439
5474
|
"H3",
|
|
@@ -5443,17 +5478,17 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5443
5478
|
"LI",
|
|
5444
5479
|
"LABEL",
|
|
5445
5480
|
"BUTTON"
|
|
5446
|
-
]),
|
|
5481
|
+
]), mu = /* @__PURE__ */ new Set([
|
|
5447
5482
|
"heading",
|
|
5448
5483
|
"listitem",
|
|
5449
5484
|
"option",
|
|
5450
5485
|
"radio"
|
|
5451
|
-
]),
|
|
5486
|
+
]), vu = (e) => {
|
|
5452
5487
|
if (e.type !== "text" || !e.sourceElement) return !1;
|
|
5453
5488
|
const t = e.sourceElement.tagName.toUpperCase(), n = (e.sourceElement.getAttribute("role") || "").toLowerCase();
|
|
5454
|
-
return
|
|
5455
|
-
},
|
|
5456
|
-
const t = e.resolveMathSpeech ??
|
|
5489
|
+
return gu.has(t) || mu.has(n);
|
|
5490
|
+
}, yu = async (e) => {
|
|
5491
|
+
const t = e.resolveMathSpeech ?? fu, { visibleText: n } = e, r = [];
|
|
5457
5492
|
let i = 0;
|
|
5458
5493
|
const o = (a) => {
|
|
5459
5494
|
const l = $(a), c = n.indexOf(l, i), u = c >= 0 ? c : i, h = u + l.length;
|
|
@@ -5465,7 +5500,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5465
5500
|
for (let a = 0; a < e.chunks.length; a++) {
|
|
5466
5501
|
const l = e.chunks[a];
|
|
5467
5502
|
if (l.type === "text") {
|
|
5468
|
-
const g =
|
|
5503
|
+
const g = vu(l) ? [{
|
|
5469
5504
|
text: l.text,
|
|
5470
5505
|
offset: 0
|
|
5471
5506
|
}] : lr(l.text, { locale: e.language });
|
|
@@ -5489,54 +5524,54 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5489
5524
|
language: e.language,
|
|
5490
5525
|
produceSsml: e.produceSsml,
|
|
5491
5526
|
mathSpeech: e.mathSpeech
|
|
5492
|
-
}), h = !u.speechText,
|
|
5527
|
+
}), h = !u.speechText, p = u.speechText || l.fallbackText;
|
|
5493
5528
|
r.push({
|
|
5494
5529
|
sourceChunkIndex: a,
|
|
5495
5530
|
segment: {
|
|
5496
5531
|
kind: "math",
|
|
5497
|
-
spokenText:
|
|
5532
|
+
spokenText: p,
|
|
5498
5533
|
mathml: l.mathml,
|
|
5499
5534
|
fallbackText: l.fallbackText,
|
|
5500
5535
|
visibleSpan: c,
|
|
5501
5536
|
usedFallback: h,
|
|
5502
5537
|
ssml: u.ssml
|
|
5503
5538
|
}
|
|
5504
|
-
}), s.push(
|
|
5539
|
+
}), s.push(p);
|
|
5505
5540
|
}
|
|
5506
5541
|
return {
|
|
5507
5542
|
segments: r,
|
|
5508
|
-
locale:
|
|
5543
|
+
locale: pu(e.language),
|
|
5509
5544
|
visibleText: n,
|
|
5510
5545
|
plainSpeechText: $(s.join(" "))
|
|
5511
5546
|
};
|
|
5512
|
-
},
|
|
5513
|
-
const t = Math.max(1, e.maxEntries ??
|
|
5547
|
+
}, bu = (e) => (e || "en").split("-")[0].toLowerCase() || "en", Tu = "sre-v1", Su = 256, Vn = (e) => Array.isArray(e) ? `array:[${e.map(Vn).join(",")}]` : e && typeof e == "object" ? `object:{${Object.entries(e).sort(([t], [n]) => t.localeCompare(n)).map(([t, n]) => `${JSON.stringify(t)}:${Vn(n)}`).join(",")}}` : e === null ? "null:null" : typeof e > "u" ? "undefined:" : typeof e == "function" ? `function:${e.name || "anonymous"}` : typeof e == "symbol" ? `symbol:${String(e)}` : typeof e == "bigint" ? `bigint:${e.toString()}` : typeof e == "number" ? Number.isFinite(e) ? `number:${e}` : `number:${String(e)}` : `${typeof e}:${JSON.stringify(e)}`, ei = (e, t, n, r) => `${Tu}\0${bu(e)}\0${t ? "ssml" : "plain"}\0${Vn(n ?? null)}\0${r}`, _u = (e = {}) => {
|
|
5548
|
+
const t = Math.max(1, e.maxEntries ?? Su), n = e.resolve ?? ((o, s) => To([o], s)), r = /* @__PURE__ */ new Map(), i = (o, s) => {
|
|
5514
5549
|
for (r.delete(o), r.set(o, s); r.size > t; ) {
|
|
5515
5550
|
const a = r.keys().next().value;
|
|
5516
5551
|
a !== void 0 && r.delete(a);
|
|
5517
5552
|
}
|
|
5518
5553
|
};
|
|
5519
5554
|
return async (o, s) => {
|
|
5520
|
-
const a = gn(s.mathSpeech), l = s.produceSsml === !0, c =
|
|
5555
|
+
const a = gn(s.mathSpeech), l = s.produceSsml === !0, c = ei(s.language, l, a, o.mathml), u = r.get(c);
|
|
5521
5556
|
if (u)
|
|
5522
5557
|
return r.delete(c), r.set(c, u), u;
|
|
5523
5558
|
const h = await n(o, {
|
|
5524
5559
|
...s,
|
|
5525
5560
|
mathSpeech: a
|
|
5526
5561
|
});
|
|
5527
|
-
return l && h.ssml && t > 1 && i(
|
|
5562
|
+
return l && h.ssml && t > 1 && i(ei(s.language, !1, a, o.mathml), {
|
|
5528
5563
|
speechText: h.speechText,
|
|
5529
5564
|
usedMathSpeech: h.usedMathSpeech,
|
|
5530
5565
|
usedFallback: h.usedFallback
|
|
5531
5566
|
}), i(c, h), h;
|
|
5532
5567
|
};
|
|
5533
|
-
},
|
|
5568
|
+
}, wu = (e) => !e || /^<[^>]+>$/.test(e.trim()) ? null : Mt({ speechText: e }).tokens[0]?.normalized || null, ku = (e, t) => {
|
|
5534
5569
|
const n = Mt({ speechText: e.speechText });
|
|
5535
5570
|
if (!Number.isFinite(t.position)) return {
|
|
5536
5571
|
boundary: null,
|
|
5537
5572
|
spokenText: n.spokenText
|
|
5538
5573
|
};
|
|
5539
|
-
const r =
|
|
5574
|
+
const r = Gc({
|
|
5540
5575
|
tokenization: n,
|
|
5541
5576
|
position: t.position,
|
|
5542
5577
|
length: t.length,
|
|
@@ -5549,8 +5584,8 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5549
5584
|
} : null,
|
|
5550
5585
|
spokenText: n.spokenText
|
|
5551
5586
|
};
|
|
5552
|
-
},
|
|
5553
|
-
const n =
|
|
5587
|
+
}, Eu = (e, t, n) => n ? Mt({ speechText: e }).tokens.find((r) => r.start <= t && t < r.end)?.normalized === n : !0, Au = (e, t) => {
|
|
5588
|
+
const n = wu(t.word);
|
|
5554
5589
|
if (e.id !== t.chunkId) return {
|
|
5555
5590
|
chunkId: t.chunkId,
|
|
5556
5591
|
normalizedWord: n,
|
|
@@ -5569,12 +5604,12 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5569
5604
|
};
|
|
5570
5605
|
let r, i;
|
|
5571
5606
|
if (e.catalogAlignment)
|
|
5572
|
-
r =
|
|
5607
|
+
r = yc(e.catalogAlignment, t.position, t.length, t.word), i = e.catalogAlignment.spokenText;
|
|
5573
5608
|
else {
|
|
5574
|
-
const o =
|
|
5609
|
+
const o = ku(e, t);
|
|
5575
5610
|
r = o.boundary, i = o.spokenText;
|
|
5576
5611
|
}
|
|
5577
|
-
return r ?
|
|
5612
|
+
return r ? Eu(i, r.start, n) ? {
|
|
5578
5613
|
chunkId: e.id,
|
|
5579
5614
|
normalizedWord: n,
|
|
5580
5615
|
chunkSpokenStart: r.start,
|
|
@@ -5614,12 +5649,12 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5614
5649
|
quality: "region",
|
|
5615
5650
|
confidence: e.confidence,
|
|
5616
5651
|
reason: e.reason
|
|
5617
|
-
},
|
|
5652
|
+
}, jo = /* @__PURE__ */ new Map([
|
|
5618
5653
|
["mi", "mjx-mi"],
|
|
5619
5654
|
["mn", "mjx-mn"],
|
|
5620
5655
|
["mo", "mjx-mo"],
|
|
5621
5656
|
["mtext", "mjx-mtext"]
|
|
5622
|
-
]), Gn = "mi,mn,mo,mtext",
|
|
5657
|
+
]), Gn = "mi,mn,mo,mtext", qo = "mjx-mi,mjx-mn,mjx-mo,mjx-mtext", Vo = [
|
|
5623
5658
|
"mjx-mfrac",
|
|
5624
5659
|
"mjx-msqrt",
|
|
5625
5660
|
"mjx-mroot",
|
|
@@ -5627,14 +5662,14 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5627
5662
|
"mjx-munder",
|
|
5628
5663
|
"mjx-mover",
|
|
5629
5664
|
"mjx-munderover"
|
|
5630
|
-
].join(","),
|
|
5665
|
+
].join(","), Go = (e) => e.type === "text-range" ? e.node.parentElement : e.element, mn = (e) => {
|
|
5631
5666
|
let t = e;
|
|
5632
5667
|
for (; t; ) {
|
|
5633
5668
|
if (t.localName?.toLowerCase() === "mjx-container") return t;
|
|
5634
5669
|
t = t.parentElement;
|
|
5635
5670
|
}
|
|
5636
5671
|
return null;
|
|
5637
|
-
},
|
|
5672
|
+
}, ti = (e) => !e || mn(e) ? !1 : !ft(e), Uo = (e) => {
|
|
5638
5673
|
const t = e.getBoundingClientRect?.();
|
|
5639
5674
|
return !!(t && t.width > 0 && t.height > 0);
|
|
5640
5675
|
}, Un = (e) => {
|
|
@@ -5644,38 +5679,38 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5644
5679
|
t = t.parentElement;
|
|
5645
5680
|
}
|
|
5646
5681
|
return null;
|
|
5647
|
-
},
|
|
5682
|
+
}, Ko = (e, t) => {
|
|
5648
5683
|
if (e.length === 0 || e.length !== t.length) return !1;
|
|
5649
5684
|
for (let n = 0; n < e.length; n += 1) {
|
|
5650
|
-
const r =
|
|
5685
|
+
const r = jo.get(e[n].localName.toLowerCase());
|
|
5651
5686
|
if (!r || t[n].localName.toLowerCase() !== r) return !1;
|
|
5652
5687
|
}
|
|
5653
5688
|
return !0;
|
|
5654
|
-
},
|
|
5655
|
-
if (!e || !
|
|
5689
|
+
}, Cu = (e, t) => {
|
|
5690
|
+
if (!e || !jo.has(e.localName.toLowerCase()) || t.querySelector(Vo)) return null;
|
|
5656
5691
|
const n = Un(e), r = t.querySelector("mjx-math");
|
|
5657
5692
|
if (!n || !r) return null;
|
|
5658
5693
|
const i = Array.from(n.querySelectorAll(Gn)), o = i.indexOf(e);
|
|
5659
5694
|
if (o < 0) return null;
|
|
5660
|
-
const s = Array.from(r.querySelectorAll(
|
|
5661
|
-
if (!
|
|
5695
|
+
const s = Array.from(r.querySelectorAll(qo));
|
|
5696
|
+
if (!Ko(i, s)) return null;
|
|
5662
5697
|
const a = s[o];
|
|
5663
|
-
return !a || !
|
|
5664
|
-
},
|
|
5698
|
+
return !a || !Uo(a) ? null : a;
|
|
5699
|
+
}, xu = (e) => {
|
|
5665
5700
|
const t = mn(e);
|
|
5666
5701
|
if (t) {
|
|
5667
|
-
if (t.querySelector(
|
|
5702
|
+
if (t.querySelector(Vo)) return "expression";
|
|
5668
5703
|
const r = Un(e) ?? e, i = t.querySelector("mjx-math");
|
|
5669
5704
|
if (!i) return "expression";
|
|
5670
|
-
const o = Array.from(r.querySelectorAll(Gn)), s = Array.from(i.querySelectorAll(
|
|
5671
|
-
return
|
|
5705
|
+
const o = Array.from(r.querySelectorAll(Gn)), s = Array.from(i.querySelectorAll(qo));
|
|
5706
|
+
return Ko(o, s) && s.some((a) => Uo(a)) ? "token" : "expression";
|
|
5672
5707
|
}
|
|
5673
5708
|
const n = Un(e) ?? e;
|
|
5674
5709
|
return Array.from(n.querySelectorAll(Gn)).some((r) => !ft(r)) ? "token" : "expression";
|
|
5675
5710
|
}, Kn = (e) => {
|
|
5676
|
-
const t =
|
|
5711
|
+
const t = Go(e), n = mn(t);
|
|
5677
5712
|
if (n) {
|
|
5678
|
-
const r =
|
|
5713
|
+
const r = Cu(t, n);
|
|
5679
5714
|
return r ? {
|
|
5680
5715
|
type: "element",
|
|
5681
5716
|
quality: "semantic-token",
|
|
@@ -5686,35 +5721,35 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5686
5721
|
element: n
|
|
5687
5722
|
};
|
|
5688
5723
|
}
|
|
5689
|
-
return e.type === "text-range" ?
|
|
5724
|
+
return e.type === "text-range" ? ti(e.node.parentElement) ? {
|
|
5690
5725
|
type: "text-range",
|
|
5691
5726
|
quality: "semantic-token",
|
|
5692
5727
|
node: e.node,
|
|
5693
5728
|
startOffset: e.startOffset,
|
|
5694
5729
|
endOffset: e.endOffset
|
|
5695
|
-
} : null :
|
|
5730
|
+
} : null : ti(e.element) ? {
|
|
5696
5731
|
type: "element",
|
|
5697
5732
|
quality: e.quality === "region-fallback" ? "expression" : "semantic-token",
|
|
5698
5733
|
element: e.element
|
|
5699
5734
|
} : null;
|
|
5700
|
-
},
|
|
5735
|
+
}, Iu = Kn, Ou = () => {
|
|
5701
5736
|
const e = /* @__PURE__ */ new WeakMap();
|
|
5702
5737
|
return (t) => {
|
|
5703
|
-
const n =
|
|
5738
|
+
const n = Go(t), r = mn(n);
|
|
5704
5739
|
if (!n || !r) return Kn(t);
|
|
5705
5740
|
if (e.has(n)) return e.get(n) ?? null;
|
|
5706
5741
|
const i = Kn(t);
|
|
5707
5742
|
return e.set(n, i), i;
|
|
5708
5743
|
};
|
|
5709
|
-
},
|
|
5744
|
+
}, Mu = (e, t, n, r = e.mathAlignments, i = Iu) => {
|
|
5710
5745
|
if (t.chunkSpokenStart === null || t.chunkSpokenEnd === null) return null;
|
|
5711
5746
|
let o = null;
|
|
5712
5747
|
for (const s of r) {
|
|
5713
|
-
const a =
|
|
5748
|
+
const a = Kc(s.alignment, {
|
|
5714
5749
|
position: t.chunkSpokenStart,
|
|
5715
5750
|
length: Math.max(1, t.chunkSpokenEnd - t.chunkSpokenStart),
|
|
5716
5751
|
boundaryWord: n.word
|
|
5717
|
-
}) ||
|
|
5752
|
+
}) || Xc(s.alignment, { boundaryWord: n.word });
|
|
5718
5753
|
if (!a) continue;
|
|
5719
5754
|
const l = i(a);
|
|
5720
5755
|
if (l) {
|
|
@@ -5723,7 +5758,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5723
5758
|
}
|
|
5724
5759
|
}
|
|
5725
5760
|
return o;
|
|
5726
|
-
},
|
|
5761
|
+
}, Xo = (e, t, n) => {
|
|
5727
5762
|
if (!e || typeof document > "u" || n <= t) return null;
|
|
5728
5763
|
const r = e.get(t);
|
|
5729
5764
|
let i = e.get(Math.max(t, n - 1));
|
|
@@ -5735,17 +5770,17 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5735
5770
|
} catch {
|
|
5736
5771
|
return null;
|
|
5737
5772
|
}
|
|
5738
|
-
},
|
|
5773
|
+
}, Lu = (e, t) => {
|
|
5739
5774
|
if (!e.catalogAlignment || t.chunkSpokenStart === null) return null;
|
|
5740
|
-
const n =
|
|
5775
|
+
const n = bc(e.catalogAlignment, t.chunkSpokenStart);
|
|
5741
5776
|
if (!n) return null;
|
|
5742
|
-
const r =
|
|
5777
|
+
const r = Xo(e.visibleMap, n.start, n.end);
|
|
5743
5778
|
return r ? {
|
|
5744
5779
|
type: "range",
|
|
5745
5780
|
quality: e.catalogAlignment.playbackMode === "exact-word" ? "exact-word" : "semantic-token",
|
|
5746
5781
|
range: r
|
|
5747
5782
|
} : null;
|
|
5748
|
-
},
|
|
5783
|
+
}, Ru = (e) => e.regionRange ? {
|
|
5749
5784
|
type: "range",
|
|
5750
5785
|
quality: "region",
|
|
5751
5786
|
range: e.regionRange
|
|
@@ -5753,43 +5788,43 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5753
5788
|
type: "element",
|
|
5754
5789
|
quality: "region",
|
|
5755
5790
|
element: e.regionElement
|
|
5756
|
-
} : null,
|
|
5791
|
+
} : null, ni = (e, t = e.chunk.mathAlignments) => {
|
|
5757
5792
|
if (t.length !== 1) return null;
|
|
5758
5793
|
const n = t[0]?.alignment.result.fallbackTarget;
|
|
5759
5794
|
return n ? e.renderedMathTargetResolver(n) : null;
|
|
5760
|
-
},
|
|
5795
|
+
}, $u = (e, t) => e ? t.mathAlignments.filter(({ element: n }) => {
|
|
5761
5796
|
try {
|
|
5762
5797
|
return e.type === "range" ? e.range.intersectsNode(n) : e.type === "element" ? e.element === n || e.element.contains(n) : e.node.parentElement?.contains(n) || !1;
|
|
5763
5798
|
} catch {
|
|
5764
5799
|
return !1;
|
|
5765
5800
|
}
|
|
5766
|
-
}) : t.mathAlignments,
|
|
5801
|
+
}) : t.mathAlignments, ri = () => ({
|
|
5767
5802
|
activeTarget: null,
|
|
5768
5803
|
regionTarget: null,
|
|
5769
5804
|
quality: "region",
|
|
5770
5805
|
confidence: 0,
|
|
5771
5806
|
reason: "boundary chunk id was not found"
|
|
5772
|
-
}),
|
|
5807
|
+
}), ii = (e) => e.length === 1 ? e[0].element : null, Pu = (e, t) => t.length > 0 && t.every(({ element: n }) => e.mathCapabilityByElement.get(n) === "token"), Nu = 3, Hu = (e, t, n) => {
|
|
5773
5808
|
if (!t || t.type !== "range") return !1;
|
|
5774
5809
|
const { startContainer: r, endContainer: i } = t.range;
|
|
5775
|
-
return r === i && r.nodeType ===
|
|
5776
|
-
},
|
|
5810
|
+
return r === i && r.nodeType === Nu ? !1 : n.some(({ element: o }) => e.mathCapabilityByElement.get(o) === "token" && o.contains(r) && o.contains(i));
|
|
5811
|
+
}, Bu = (e, t) => ({
|
|
5777
5812
|
chunk: e,
|
|
5778
|
-
regionTarget:
|
|
5779
|
-
renderedMathTargetResolver:
|
|
5780
|
-
mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: n }) => [n, t ?
|
|
5813
|
+
regionTarget: Ru(e),
|
|
5814
|
+
renderedMathTargetResolver: Ou(),
|
|
5815
|
+
mathCapabilityByElement: new Map(e.mathAlignments.map(({ element: n }) => [n, t ? xu(n) : "expression"])),
|
|
5781
5816
|
heldTokenByElement: /* @__PURE__ */ new Map()
|
|
5782
|
-
}),
|
|
5783
|
-
const t = e.mathTokenHighlighting !== !1, n = new Map(e.chunks.map((r) => [r.id,
|
|
5817
|
+
}), Wu = (e) => {
|
|
5818
|
+
const t = e.mathTokenHighlighting !== !1, n = new Map(e.chunks.map((r) => [r.id, Bu(r, t)]));
|
|
5784
5819
|
return {
|
|
5785
5820
|
chunks: e.chunks,
|
|
5786
5821
|
resolveInitial(r) {
|
|
5787
5822
|
const i = n.get(r);
|
|
5788
|
-
if (!i) return
|
|
5823
|
+
if (!i) return ri();
|
|
5789
5824
|
const o = i.chunk.mathAlignments, s = o.length === 1 ? o[0].element : null, a = s ? i.mathCapabilityByElement.get(s) : null;
|
|
5790
5825
|
return Ze(a === "expression" ? {
|
|
5791
5826
|
semanticTarget: null,
|
|
5792
|
-
expressionTarget:
|
|
5827
|
+
expressionTarget: ni(i),
|
|
5793
5828
|
regionTarget: i.regionTarget,
|
|
5794
5829
|
confidence: 0.5,
|
|
5795
5830
|
reason: "initial expression (sticky expression mode)"
|
|
@@ -5803,11 +5838,11 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5803
5838
|
},
|
|
5804
5839
|
resolveBoundary(r) {
|
|
5805
5840
|
const i = n.get(r.chunkId);
|
|
5806
|
-
if (!i) return
|
|
5807
|
-
const { chunk: o } = i, s =
|
|
5841
|
+
if (!i) return ri();
|
|
5842
|
+
const { chunk: o } = i, s = Au(o, r), a = Lu(o, s), l = $u(a, o), c = (!a || l.length > 0 ? Mu(o, s, r, l, i.renderedMathTargetResolver) : null) || null, u = t && c && c.quality !== "expression" ? c : null, h = c && c.quality === "expression" ? c : null;
|
|
5808
5843
|
if (u) {
|
|
5809
|
-
const
|
|
5810
|
-
return
|
|
5844
|
+
const p = ii(l);
|
|
5845
|
+
return p && i.heldTokenByElement.set(p, u), Ze({
|
|
5811
5846
|
semanticTarget: u,
|
|
5812
5847
|
expressionTarget: null,
|
|
5813
5848
|
regionTarget: i.regionTarget,
|
|
@@ -5815,15 +5850,15 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5815
5850
|
reason: s.reason
|
|
5816
5851
|
});
|
|
5817
5852
|
}
|
|
5818
|
-
if (a && (t ? !
|
|
5853
|
+
if (a && (t ? !Hu(i, a, l) : l.length === 0)) return Ze({
|
|
5819
5854
|
semanticTarget: a,
|
|
5820
5855
|
expressionTarget: null,
|
|
5821
5856
|
regionTarget: i.regionTarget,
|
|
5822
5857
|
confidence: s.confidence,
|
|
5823
5858
|
reason: s.reason
|
|
5824
5859
|
});
|
|
5825
|
-
if (
|
|
5826
|
-
const
|
|
5860
|
+
if (Pu(i, l)) {
|
|
5861
|
+
const p = ii(l), g = p ? i.heldTokenByElement.get(p) ?? null : null;
|
|
5827
5862
|
return Ze({
|
|
5828
5863
|
semanticTarget: g,
|
|
5829
5864
|
expressionTarget: null,
|
|
@@ -5834,21 +5869,21 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5834
5869
|
}
|
|
5835
5870
|
return Ze({
|
|
5836
5871
|
semanticTarget: null,
|
|
5837
|
-
expressionTarget: h ??
|
|
5872
|
+
expressionTarget: h ?? ni(i, l),
|
|
5838
5873
|
regionTarget: i.regionTarget,
|
|
5839
5874
|
confidence: s.confidence,
|
|
5840
5875
|
reason: s.reason
|
|
5841
5876
|
});
|
|
5842
5877
|
}
|
|
5843
5878
|
};
|
|
5844
|
-
},
|
|
5879
|
+
}, zu = (e) => {
|
|
5845
5880
|
if (e.alignment?.boundaryOffsetMode) return e.alignment.boundaryOffsetMode;
|
|
5846
5881
|
const t = e.mathAlignment?.speech.boundaryOffsetSpace;
|
|
5847
5882
|
return t || "plain-spoken-text";
|
|
5848
|
-
},
|
|
5883
|
+
}, Fu = (e) => e.mathAlignments?.length ? e.mathAlignments : e.mathAlignment && e.sourceElement ? [{
|
|
5849
5884
|
element: e.sourceElement,
|
|
5850
5885
|
alignment: e.mathAlignment
|
|
5851
|
-
}] : [],
|
|
5886
|
+
}] : [], Du = (e) => (e.chunks && e.chunks.length ? e.chunks : [{
|
|
5852
5887
|
speechText: e.speechText || "",
|
|
5853
5888
|
visibleText: e.visibleText || e.speechText || "",
|
|
5854
5889
|
sourceElement: e.sourceElement || e.contentRoot,
|
|
@@ -5865,9 +5900,9 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5865
5900
|
regionRange: t.regionRange,
|
|
5866
5901
|
visibleMap: t.visibleMap,
|
|
5867
5902
|
catalogAlignment: t.alignment,
|
|
5868
|
-
mathAlignments:
|
|
5869
|
-
offsetSpace:
|
|
5870
|
-
})),
|
|
5903
|
+
mathAlignments: Fu(t),
|
|
5904
|
+
offsetSpace: zu(t)
|
|
5905
|
+
})), ju = [
|
|
5871
5906
|
"[data-pie-tts-region]",
|
|
5872
5907
|
"[data-catalog-region]",
|
|
5873
5908
|
"li",
|
|
@@ -5877,18 +5912,18 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5877
5912
|
"[role='group']",
|
|
5878
5913
|
"[role='region']",
|
|
5879
5914
|
"div"
|
|
5880
|
-
].join(","),
|
|
5881
|
-
const n = e.closest(
|
|
5915
|
+
].join(","), Yo = (e, t) => {
|
|
5916
|
+
const n = e.closest(ju);
|
|
5882
5917
|
return n && t.contains(n) ? n : e;
|
|
5883
|
-
},
|
|
5918
|
+
}, qu = (e, t, n) => {
|
|
5884
5919
|
const r = /* @__PURE__ */ new Map();
|
|
5885
5920
|
for (let i = t; i < n; i++) {
|
|
5886
5921
|
const o = e.get(i);
|
|
5887
5922
|
o && r.set(i - t, o);
|
|
5888
5923
|
}
|
|
5889
5924
|
return r;
|
|
5890
|
-
},
|
|
5891
|
-
const t = bt(e.contentRoot, e.textProcessingOptions), n = await
|
|
5925
|
+
}, Vu = async (e) => {
|
|
5926
|
+
const t = bt(e.contentRoot, e.textProcessingOptions), n = await yu({
|
|
5892
5927
|
chunks: t.chunks,
|
|
5893
5928
|
visibleText: t.visibleText,
|
|
5894
5929
|
language: e.language,
|
|
@@ -5906,8 +5941,8 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5906
5941
|
segment: r,
|
|
5907
5942
|
anchor: {
|
|
5908
5943
|
sourceElement: a,
|
|
5909
|
-
regionElement:
|
|
5910
|
-
visibleMap:
|
|
5944
|
+
regionElement: Yo(a, e.contentRoot),
|
|
5945
|
+
visibleMap: qu(t.map, r.visibleSpan.start, r.visibleSpan.end)
|
|
5911
5946
|
}
|
|
5912
5947
|
};
|
|
5913
5948
|
}
|
|
@@ -5927,8 +5962,8 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5927
5962
|
containsMathMarkup: t.containsMathMarkup,
|
|
5928
5963
|
visibleText: t.visibleText
|
|
5929
5964
|
};
|
|
5930
|
-
},
|
|
5931
|
-
const n =
|
|
5965
|
+
}, Gu = (e, t) => {
|
|
5966
|
+
const n = xo({
|
|
5932
5967
|
speechText: e.spokenText,
|
|
5933
5968
|
visibleText: e.spokenText
|
|
5934
5969
|
});
|
|
@@ -5937,13 +5972,13 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5937
5972
|
visibleText: e.visibleText,
|
|
5938
5973
|
sourceElement: t.sourceElement,
|
|
5939
5974
|
regionElement: t.regionElement,
|
|
5940
|
-
regionRange:
|
|
5975
|
+
regionRange: Xo(t.visibleMap, 0, e.visibleText.length) ?? void 0,
|
|
5941
5976
|
speechMatchesVisibleText: !0,
|
|
5942
5977
|
playbackMode: n.playbackMode,
|
|
5943
5978
|
alignment: n,
|
|
5944
5979
|
visibleMap: t.visibleMap
|
|
5945
5980
|
};
|
|
5946
|
-
},
|
|
5981
|
+
}, Jo = (e, t) => {
|
|
5947
5982
|
const n = t.sourceElement;
|
|
5948
5983
|
return {
|
|
5949
5984
|
speechText: e.spokenText,
|
|
@@ -5956,7 +5991,7 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5956
5991
|
speechText: e.spokenText
|
|
5957
5992
|
}) : void 0
|
|
5958
5993
|
};
|
|
5959
|
-
},
|
|
5994
|
+
}, Uu = (e, t, n) => {
|
|
5960
5995
|
const r = t.sourceElement;
|
|
5961
5996
|
return {
|
|
5962
5997
|
speechText: n,
|
|
@@ -5968,15 +6003,15 @@ var tc = /* @__PURE__ */ new Set([
|
|
|
5968
6003
|
mathElement: r,
|
|
5969
6004
|
speechText: n
|
|
5970
6005
|
}) : void 0,
|
|
5971
|
-
plainFallback:
|
|
6006
|
+
plainFallback: Jo(e, t)
|
|
5972
6007
|
};
|
|
5973
|
-
},
|
|
6008
|
+
}, Ku = (e, t = {}) => e.items.map(({ segment: n, anchor: r }) => n.kind === "prose" ? Gu(n, r) : t.format === "ssml" && n.ssml ? Uu(n, r, n.ssml) : Jo(n, r)), Xu = "pie-tts-control-handoff", I;
|
|
5974
6009
|
(function(e) {
|
|
5975
6010
|
e.IDLE = "idle", e.LOADING = "loading", e.PLAYING = "playing", e.PAUSED = "paused", e.ERROR = "error";
|
|
5976
6011
|
})(I || (I = {}));
|
|
5977
|
-
var
|
|
6012
|
+
var Yu = (e, t) => e === t || e.startContainer === t.startContainer && e.startOffset === t.startOffset && e.endContainer === t.endContainer && e.endOffset === t.endOffset, Ju = (e, t) => e === t ? !0 : !e || !t || e.type !== t.type || e.quality !== t.quality ? !1 : e.type === "range" && t.type === "range" ? Yu(e.range, t.range) : e.type === "element" && t.type === "element" ? e.element === t.element : e.type === "text-range" && t.type === "text-range" ? e.node === t.node && e.startOffset === t.startOffset && e.endOffset === t.endOffset : !1, Qu = class Xn {
|
|
5978
6013
|
constructor() {
|
|
5979
|
-
|
|
6014
|
+
f(this, "currentProvider", null), f(this, "provider", null), f(this, "highlightCoordinator", null), f(this, "catalogResolver", null), f(this, "state", I.IDLE), f(this, "ttsConfig", {}), f(this, "currentText", null), f(this, "currentContentElement", null), f(this, "normalizedToDOM", /* @__PURE__ */ new Map()), f(this, "listeners", /* @__PURE__ */ new Map()), f(this, "lastError", null), f(this, "speakRunId", 0), f(this, "currentBoundaryOffset", 0), f(this, "activeWordBoundaryOffset", 0), f(this, "seekSegments", []), f(this, "sentenceHighlightSegments", []), f(this, "currentSeekSegmentIndex", 0), f(this, "activeSentenceStartOffset", null), f(this, "activeHighlightMode", "word"), f(this, "lastRenderedRegionTarget", null), f(this, "telemetryReporter", null), f(this, "generatedMathSpeechResolver", _u());
|
|
5980
6015
|
}
|
|
5981
6016
|
debugLog(t, n) {
|
|
5982
6017
|
Xn.debugEnabled && (n === void 0 ? console.debug(t) : console.debug(t, n));
|
|
@@ -6099,7 +6134,7 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6099
6134
|
return t.includes("<") ? /<\s*break\b|<\s*speak\b|<\s*prosody\b|<\s*p\b|<\s*s\b/i.test(t) : !1;
|
|
6100
6135
|
}
|
|
6101
6136
|
isElementHidden(t) {
|
|
6102
|
-
return
|
|
6137
|
+
return vo(t);
|
|
6103
6138
|
}
|
|
6104
6139
|
getBoundaryStrength(t) {
|
|
6105
6140
|
const n = Number(t.getAttribute("data-tts-break-ms"));
|
|
@@ -6152,8 +6187,8 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6152
6187
|
for (; a; ) {
|
|
6153
6188
|
const c = a, u = c.parentElement;
|
|
6154
6189
|
if (u && !this.isElementHidden(u)) {
|
|
6155
|
-
const h = this.getBoundaryAnchor(c, t),
|
|
6156
|
-
h &&
|
|
6190
|
+
const h = this.getBoundaryAnchor(c, t), p = o.get(c);
|
|
6191
|
+
h && p !== void 0 && h.anchor !== l && p > 0 && (r.set(p, Math.max(r.get(p) || 0, h.units)), l = h.anchor);
|
|
6157
6192
|
}
|
|
6158
6193
|
a = s.nextNode();
|
|
6159
6194
|
}
|
|
@@ -6168,12 +6203,12 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6168
6203
|
const r = Array.from(n.keys()).filter((l) => l > 0 && l < t.length).sort((l, c) => l - c), i = [];
|
|
6169
6204
|
let o = 0;
|
|
6170
6205
|
for (const l of r) {
|
|
6171
|
-
const c = t.substring(o, l), u = c.match(/^\s*/)?.[0].length || 0, h = c.match(/\s*$/)?.[0].length || 0,
|
|
6172
|
-
if (g >
|
|
6173
|
-
const m = t.substring(
|
|
6206
|
+
const c = t.substring(o, l), u = c.match(/^\s*/)?.[0].length || 0, h = c.match(/\s*$/)?.[0].length || 0, p = o + u, g = l - h;
|
|
6207
|
+
if (g > p) {
|
|
6208
|
+
const m = t.substring(p, g);
|
|
6174
6209
|
i.push({
|
|
6175
6210
|
text: m,
|
|
6176
|
-
startOffset:
|
|
6211
|
+
startOffset: p,
|
|
6177
6212
|
pauseMsAfter: this.resolvePauseMsFromUnits(n.get(l) || 0)
|
|
6178
6213
|
});
|
|
6179
6214
|
}
|
|
@@ -6212,7 +6247,7 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6212
6247
|
}
|
|
6213
6248
|
let u = a;
|
|
6214
6249
|
for (const h of [...c, l]) {
|
|
6215
|
-
const
|
|
6250
|
+
const p = r.substring(u, h), g = p.match(/^\s*/)?.[0].length || 0, m = p.match(/\s*$/)?.[0].length || 0, v = u + g, y = h - m;
|
|
6216
6251
|
y > v && o.push({
|
|
6217
6252
|
text: r.substring(v, y),
|
|
6218
6253
|
startOffset: v,
|
|
@@ -6241,7 +6276,7 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6241
6276
|
this.currentBoundaryOffset = 0;
|
|
6242
6277
|
const s = this.provider.onWordBoundary;
|
|
6243
6278
|
this.provider.onWordBoundary = (a, l, c) => {
|
|
6244
|
-
Number.isFinite(l) && (this.currentBoundaryOffset = l, this.currentSeekSegmentIndex = this.getCurrentSeekSegmentIndex())
|
|
6279
|
+
s?.(a, l, c), Number.isFinite(l) && (this.currentBoundaryOffset = l, this.currentSeekSegmentIndex = this.getCurrentSeekSegmentIndex());
|
|
6245
6280
|
};
|
|
6246
6281
|
try {
|
|
6247
6282
|
await o.speakSegments(t);
|
|
@@ -6250,6 +6285,10 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6250
6285
|
}
|
|
6251
6286
|
return;
|
|
6252
6287
|
}
|
|
6288
|
+
this.configureWordBoundaryHighlighting({
|
|
6289
|
+
highlightMode: r?.highlightMode || "word",
|
|
6290
|
+
wordBoundaryOffset: this.activeWordBoundaryOffset
|
|
6291
|
+
});
|
|
6253
6292
|
for (const s of t) {
|
|
6254
6293
|
if (n !== this.speakRunId) return;
|
|
6255
6294
|
const a = this.seekSegments.findIndex((c) => c.startOffset === s.startOffset);
|
|
@@ -6314,14 +6353,14 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6314
6353
|
if (await this.applyLanguageSettings(n), r !== this.speakRunId) return;
|
|
6315
6354
|
const i = await this.resolveSpeechContent(t, n);
|
|
6316
6355
|
if (r !== this.speakRunId) return;
|
|
6317
|
-
const { contentToSpeak: o, speechText: s, highlightText: a, normalizedText: l, usedCatalogSpoken: c, speechSource: u, speechMatchesVisibleText: h, speechChunks:
|
|
6356
|
+
const { contentToSpeak: o, speechText: s, highlightText: a, normalizedText: l, usedCatalogSpoken: c, speechSource: u, speechMatchesVisibleText: h, speechChunks: p } = i;
|
|
6318
6357
|
this.logResolvedSpeechContent({
|
|
6319
6358
|
contentToSpeak: o,
|
|
6320
6359
|
speechSource: u,
|
|
6321
6360
|
catalogId: n?.catalogId
|
|
6322
6361
|
}), this.initializeSpeakTracking(a, n);
|
|
6323
6362
|
const g = n?.highlightModeOverride || (h ? this.resolveHighlightMode() : "sentence");
|
|
6324
|
-
this.activeHighlightMode = g;
|
|
6363
|
+
this.activeHighlightMode = g, this.activeWordBoundaryOffset = n?.wordBoundaryOffset || 0;
|
|
6325
6364
|
const m = this.hasExplicitBreakSemantics(o), v = !!this.currentContentElement && !c && !m && h;
|
|
6326
6365
|
if (this.seekSegments = m || !h ? [] : v && this.currentContentElement ? this.createSpeechPlan(this.currentContentElement, l) : this.createSeekSegmentsFromText(a), this.sentenceHighlightSegments = m ? [] : this.createSentenceHighlightSegments({
|
|
6327
6366
|
contentToSpeak: a,
|
|
@@ -6340,7 +6379,7 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6340
6379
|
runId: r,
|
|
6341
6380
|
highlightMode: g,
|
|
6342
6381
|
contentToSpeak: s,
|
|
6343
|
-
speechChunks:
|
|
6382
|
+
speechChunks: p
|
|
6344
6383
|
}), r !== this.speakRunId) return;
|
|
6345
6384
|
this.setState(I.IDLE), this.clearHighlightsAndTracking();
|
|
6346
6385
|
} catch (i) {
|
|
@@ -6351,7 +6390,7 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6351
6390
|
}
|
|
6352
6391
|
async switchProviderToBrowser(t, n) {
|
|
6353
6392
|
if (!this.currentProvider) return !1;
|
|
6354
|
-
const r = new
|
|
6393
|
+
const r = new po(), i = this.currentProvider.providerId, o = { ...this.ttsConfig }, s = n?.operation || "tts-initialize", a = n?.contentToSpeak ?? "", l = a.replace(/\s+/g, " ").trim().slice(0, 120), c = a.length > 0 ? {
|
|
6355
6394
|
textLength: a.length,
|
|
6356
6395
|
textPreview: l.length < a.length ? `${l}…` : l
|
|
6357
6396
|
} : {};
|
|
@@ -6490,9 +6529,9 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6490
6529
|
context: n.catalogContext
|
|
6491
6530
|
}) : null;
|
|
6492
6531
|
}, a = (u, h) => {
|
|
6493
|
-
const
|
|
6494
|
-
if (
|
|
6495
|
-
const g =
|
|
6532
|
+
const p = l(u);
|
|
6533
|
+
if (p.length !== 1) return null;
|
|
6534
|
+
const g = p[0], m = bt(g, this.getTextProcessingOptions(n.language)).visibleText || $(g.textContent || ""), v = (y) => $(y).replace(/\s+/g, "");
|
|
6496
6535
|
return v(m) === v(h) ? g : null;
|
|
6497
6536
|
}, l = (u) => {
|
|
6498
6537
|
const h = Array.from(u.querySelectorAll("math"));
|
|
@@ -6504,27 +6543,27 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6504
6543
|
return;
|
|
6505
6544
|
}
|
|
6506
6545
|
if (u.nodeType !== Node.ELEMENT_NODE) return;
|
|
6507
|
-
const h = u,
|
|
6508
|
-
if (
|
|
6546
|
+
const h = u, p = s(h);
|
|
6547
|
+
if (p) {
|
|
6509
6548
|
o();
|
|
6510
|
-
const g = bt(h, this.getTextProcessingOptions(n.language)), m = g.visibleText || $(h.textContent || ""), v =
|
|
6511
|
-
speechText:
|
|
6549
|
+
const g = bt(h, this.getTextProcessingOptions(n.language)), m = g.visibleText || $(h.textContent || ""), v = xo({
|
|
6550
|
+
speechText: p.content,
|
|
6512
6551
|
visibleText: m
|
|
6513
6552
|
}), y = a(h, m), S = y ? an({
|
|
6514
6553
|
mathElement: y,
|
|
6515
|
-
speechText:
|
|
6554
|
+
speechText: p.content
|
|
6516
6555
|
}) : void 0, O = S ? void 0 : l(h).map((A) => ({
|
|
6517
6556
|
element: A,
|
|
6518
6557
|
alignment: an({
|
|
6519
6558
|
mathElement: A,
|
|
6520
|
-
speechText:
|
|
6559
|
+
speechText: p.content
|
|
6521
6560
|
})
|
|
6522
|
-
})), V = $(
|
|
6561
|
+
})), V = $(p.content);
|
|
6523
6562
|
r.push({
|
|
6524
|
-
speechText:
|
|
6563
|
+
speechText: p.content,
|
|
6525
6564
|
visibleText: m,
|
|
6526
6565
|
sourceElement: h,
|
|
6527
|
-
regionElement:
|
|
6566
|
+
regionElement: Yo(h, t),
|
|
6528
6567
|
speechMatchesVisibleText: V === m,
|
|
6529
6568
|
playbackMode: v.playbackMode,
|
|
6530
6569
|
alignment: v,
|
|
@@ -6543,7 +6582,7 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6543
6582
|
return !t || t.providerId?.toLowerCase() === "browser" ? "plain" : t.getCapabilities?.().supportsSSML ? "ssml" : "plain";
|
|
6544
6583
|
}
|
|
6545
6584
|
async resolveGeneratedSpeechContent(t, n, r) {
|
|
6546
|
-
const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await
|
|
6585
|
+
const i = this.resolveGeneratedPlaybackFormat(), { plan: o, containsMathMarkup: s, visibleText: a } = await Vu({
|
|
6547
6586
|
contentRoot: t,
|
|
6548
6587
|
language: r,
|
|
6549
6588
|
mathSpeech: this.getMathSpeechOptions(),
|
|
@@ -6560,7 +6599,7 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6560
6599
|
containsMathMarkup: !1,
|
|
6561
6600
|
speechMatchesVisibleText: !0
|
|
6562
6601
|
};
|
|
6563
|
-
const c =
|
|
6602
|
+
const c = Ku(o, { format: i }), u = o.plainSpeechText;
|
|
6564
6603
|
return {
|
|
6565
6604
|
contentToSpeak: u,
|
|
6566
6605
|
speechText: u,
|
|
@@ -6614,12 +6653,12 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6614
6653
|
if (!(!n && !t.regionRange || !this.highlightCoordinator))
|
|
6615
6654
|
try {
|
|
6616
6655
|
if (this.lastRenderedRegionTarget = null, t.regionRange) {
|
|
6617
|
-
this.highlightCoordinator.clearHighlights?.(
|
|
6656
|
+
this.highlightCoordinator.clearHighlights?.(W.TTS_WORD), this.highlightCoordinator.highlightTTSSentence([t.regionRange]);
|
|
6618
6657
|
return;
|
|
6619
6658
|
}
|
|
6620
6659
|
if (!n) return;
|
|
6621
6660
|
const r = document.createRange();
|
|
6622
|
-
r.selectNodeContents(n), this.highlightCoordinator.clearHighlights?.(
|
|
6661
|
+
r.selectNodeContents(n), this.highlightCoordinator.clearHighlights?.(W.TTS_WORD), this.highlightCoordinator.highlightTTSSentence([r]);
|
|
6623
6662
|
} catch {
|
|
6624
6663
|
}
|
|
6625
6664
|
}
|
|
@@ -6629,11 +6668,11 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6629
6668
|
this.highlightCoordinator.highlightTTSWord(t.startContainer, t.startOffset, t.endOffset);
|
|
6630
6669
|
return;
|
|
6631
6670
|
}
|
|
6632
|
-
this.highlightCoordinator.highlightRange(t,
|
|
6671
|
+
this.highlightCoordinator.highlightRange(t, W.TTS_WORD, st.YELLOW);
|
|
6633
6672
|
}
|
|
6634
6673
|
}
|
|
6635
6674
|
highlightRenderableRegionTarget(t) {
|
|
6636
|
-
if (!(!this.highlightCoordinator || !t || typeof document > "u") && !
|
|
6675
|
+
if (!(!this.highlightCoordinator || !t || typeof document > "u") && !Ju(this.lastRenderedRegionTarget, t))
|
|
6637
6676
|
try {
|
|
6638
6677
|
const n = document.createRange();
|
|
6639
6678
|
if (t.type === "element") n.selectNodeContents(t.element);
|
|
@@ -6649,7 +6688,7 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6649
6688
|
highlightRenderableActiveTarget(t) {
|
|
6650
6689
|
if (!this.highlightCoordinator || typeof document > "u") return;
|
|
6651
6690
|
if (!t) {
|
|
6652
|
-
this.highlightCoordinator.clearHighlights(
|
|
6691
|
+
this.highlightCoordinator.clearHighlights(W.TTS_WORD);
|
|
6653
6692
|
return;
|
|
6654
6693
|
}
|
|
6655
6694
|
if (t.type === "text-range") {
|
|
@@ -6684,10 +6723,10 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6684
6723
|
async speakCatalogChunkOnce(t, n) {
|
|
6685
6724
|
if (!this.provider) return;
|
|
6686
6725
|
this.lastRenderedRegionTarget = null;
|
|
6687
|
-
const r = t.regionElement || t.sourceElement || this.currentContentElement, i = r ?
|
|
6726
|
+
const r = t.regionElement || t.sourceElement || this.currentContentElement, i = r ? Du({
|
|
6688
6727
|
contentRoot: r,
|
|
6689
6728
|
chunks: [t]
|
|
6690
|
-
})[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ?
|
|
6729
|
+
})[0] : null, o = this.ttsConfig.mathTokenHighlighting !== !1, s = i ? Wu({
|
|
6691
6730
|
chunks: [i],
|
|
6692
6731
|
mathTokenHighlighting: o
|
|
6693
6732
|
}) : null;
|
|
@@ -6701,14 +6740,14 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6701
6740
|
}
|
|
6702
6741
|
return;
|
|
6703
6742
|
}
|
|
6704
|
-
const a = this.provider, l = a.onWordBoundary, c = (u, h,
|
|
6743
|
+
const a = this.provider, l = a.onWordBoundary, c = (u, h, p) => {
|
|
6705
6744
|
if (n === this.speakRunId && s && i) {
|
|
6706
6745
|
const g = i.offsetSpace === "unsupported" ? "unknown" : i.offsetSpace;
|
|
6707
6746
|
this.renderHighlightDecision(s.resolveBoundary({
|
|
6708
6747
|
chunkId: i.id,
|
|
6709
6748
|
word: u,
|
|
6710
6749
|
position: h,
|
|
6711
|
-
length:
|
|
6750
|
+
length: p,
|
|
6712
6751
|
providerOffsetSpace: g
|
|
6713
6752
|
}));
|
|
6714
6753
|
return;
|
|
@@ -6737,7 +6776,7 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6737
6776
|
this.provider && await this.provider.speak(t.contentToSpeak);
|
|
6738
6777
|
}
|
|
6739
6778
|
clearHighlightsAndTracking() {
|
|
6740
|
-
this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.seekSegments = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null;
|
|
6779
|
+
this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.activeWordBoundaryOffset = 0, this.seekSegments = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null;
|
|
6741
6780
|
}
|
|
6742
6781
|
async speakRange(t, n) {
|
|
6743
6782
|
if (!this.provider) throw new Error("TTS service not initialized");
|
|
@@ -6769,22 +6808,36 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6769
6808
|
resume() {
|
|
6770
6809
|
this.provider && this.state === I.PAUSED && (this.provider.resume(), this.setState(I.PLAYING));
|
|
6771
6810
|
}
|
|
6811
|
+
normalizePlaybackRate(t) {
|
|
6812
|
+
return Number.isFinite(t) ? Math.max(0.25, Math.min(4, t)) : 1;
|
|
6813
|
+
}
|
|
6814
|
+
async restartFromSeekIndex(t) {
|
|
6815
|
+
if (!this.provider || this.seekSegments.length === 0) return;
|
|
6816
|
+
const n = Math.max(0, Math.min(this.seekSegments.length - 1, t));
|
|
6817
|
+
this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.currentSeekSegmentIndex = n;
|
|
6818
|
+
const r = ++this.speakRunId, i = this.seekSegments.slice(n);
|
|
6819
|
+
this.setState(I.PLAYING);
|
|
6820
|
+
try {
|
|
6821
|
+
if (this.configureWordBoundaryHighlighting({
|
|
6822
|
+
highlightMode: this.activeHighlightMode,
|
|
6823
|
+
wordBoundaryOffset: this.activeWordBoundaryOffset
|
|
6824
|
+
}), await this.speakWithPlan(i, r, { highlightMode: this.activeHighlightMode }), r !== this.speakRunId) return;
|
|
6825
|
+
this.setState(I.IDLE), this.clearHighlightsAndTracking();
|
|
6826
|
+
} catch (o) {
|
|
6827
|
+
if (r !== this.speakRunId) return;
|
|
6828
|
+
throw this.lastError = o instanceof Error ? o.message : String(o), this.setState(I.ERROR), this.clearHighlightsAndTracking(), o;
|
|
6829
|
+
}
|
|
6830
|
+
}
|
|
6831
|
+
async setPlaybackRate(t) {
|
|
6832
|
+
const n = this.normalizePlaybackRate(t);
|
|
6833
|
+
await this.updateSettings({ rate: n }), !(this.state !== I.PLAYING || !this.currentText || this.seekSegments.length === 0 || this.hasExplicitBreakSemantics(this.currentText)) && await this.restartFromSeekIndex(this.getCurrentSeekSegmentIndex());
|
|
6834
|
+
}
|
|
6772
6835
|
async seekBy(t) {
|
|
6773
6836
|
if (!this.provider || !this.currentText || this.state !== I.PLAYING && this.state !== I.PAUSED || this.hasExplicitBreakSemantics(this.currentText) || this.seekSegments.length === 0) return;
|
|
6774
6837
|
const n = Number.isFinite(t) ? Math.trunc(t) : 0;
|
|
6775
6838
|
if (n === 0) return;
|
|
6776
6839
|
const r = this.getCurrentSeekSegmentIndex(), i = Math.max(0, Math.min(this.seekSegments.length - 1, r + n));
|
|
6777
|
-
|
|
6778
|
-
this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.currentSeekSegmentIndex = i;
|
|
6779
|
-
const o = ++this.speakRunId, s = this.seekSegments.slice(i);
|
|
6780
|
-
this.setState(I.PLAYING);
|
|
6781
|
-
try {
|
|
6782
|
-
if (await this.speakWithPlan(s, o, { highlightMode: this.activeHighlightMode }), o !== this.speakRunId) return;
|
|
6783
|
-
this.setState(I.IDLE), this.clearHighlightsAndTracking();
|
|
6784
|
-
} catch (a) {
|
|
6785
|
-
if (o !== this.speakRunId) return;
|
|
6786
|
-
throw this.lastError = a instanceof Error ? a.message : String(a), this.setState(I.ERROR), this.clearHighlightsAndTracking(), a;
|
|
6787
|
-
}
|
|
6840
|
+
i !== r && await this.restartFromSeekIndex(i);
|
|
6788
6841
|
}
|
|
6789
6842
|
async seekForward(t = 1) {
|
|
6790
6843
|
const n = Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : 1;
|
|
@@ -6795,10 +6848,10 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6795
6848
|
await this.seekBy(-n);
|
|
6796
6849
|
}
|
|
6797
6850
|
stop() {
|
|
6798
|
-
this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.setState(I.IDLE), this.currentText = null, this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.seekSegments = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null);
|
|
6851
|
+
this.provider && (this.speakRunId += 1, this.provider.onWordBoundary = void 0, this.provider.stop(), this.setState(I.IDLE), this.currentText = null, this.highlightCoordinator && this.highlightCoordinator.clearTTS(), this.lastRenderedRegionTarget = null, this.currentContentElement = null, this.normalizedToDOM.clear(), this.currentBoundaryOffset = 0, this.activeWordBoundaryOffset = 0, this.seekSegments = [], this.sentenceHighlightSegments = [], this.currentSeekSegmentIndex = 0, this.activeSentenceStartOffset = null);
|
|
6799
6852
|
}
|
|
6800
6853
|
requestControlHandoff() {
|
|
6801
|
-
typeof window > "u" || window.dispatchEvent(new CustomEvent(
|
|
6854
|
+
typeof window > "u" || window.dispatchEvent(new CustomEvent(Xu, { detail: { source: "host" } }));
|
|
6802
6855
|
}
|
|
6803
6856
|
isPlaying() {
|
|
6804
6857
|
return this.state === I.PLAYING;
|
|
@@ -6869,14 +6922,14 @@ var ju = (e, t) => e === t || e.startContainer === t.startContainer && e.startOf
|
|
|
6869
6922
|
});
|
|
6870
6923
|
}
|
|
6871
6924
|
};
|
|
6872
|
-
|
|
6925
|
+
f(Qu, "debugEnabled", (() => {
|
|
6873
6926
|
try {
|
|
6874
6927
|
if (typeof process < "u" && process.env?.PIE_TTS_DEBUG === "1") return !0;
|
|
6875
6928
|
} catch {
|
|
6876
6929
|
}
|
|
6877
6930
|
return globalThis.__PIE_TTS_DEBUG__ === !0;
|
|
6878
6931
|
})());
|
|
6879
|
-
var
|
|
6932
|
+
var wh = nl({
|
|
6880
6933
|
policy: {
|
|
6881
6934
|
allowed: [],
|
|
6882
6935
|
blocked: []
|
|
@@ -6887,9 +6940,9 @@ var mh = Qa({
|
|
|
6887
6940
|
passage: []
|
|
6888
6941
|
},
|
|
6889
6942
|
providers: {}
|
|
6890
|
-
}),
|
|
6943
|
+
}), Qo, Ie = class ee {
|
|
6891
6944
|
constructor() {
|
|
6892
|
-
|
|
6945
|
+
f(this, "elementType", "multiple-choice"), f(this, "priority", 100);
|
|
6893
6946
|
}
|
|
6894
6947
|
canHandle(t) {
|
|
6895
6948
|
return t.tagName.toLowerCase() === "multiple-choice" || t.classList.contains("multiple-choice");
|
|
@@ -6936,39 +6989,39 @@ var mh = Qa({
|
|
|
6936
6989
|
for (const n of t.querySelectorAll(".feedback-tick")) n.setAttribute(ee.FEEDBACK_HOOK_ATTR, "true");
|
|
6937
6990
|
}
|
|
6938
6991
|
};
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
var
|
|
6992
|
+
Qo = Ie;
|
|
6993
|
+
f(Ie, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
|
|
6994
|
+
f(Ie, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label");
|
|
6995
|
+
f(Ie, "ROOT_HOOK_ATTR", "data-pie-answer-eliminator-root");
|
|
6996
|
+
f(Ie, "FEEDBACK_HOOK_ATTR", "data-pie-answer-eliminator-feedback-tick");
|
|
6997
|
+
f(Ie, "CHOICE_SELECTOR", `[${Qo.CHOICE_HOOK_ATTR}="true"], .corespring-checkbox, .corespring-radio-button`);
|
|
6998
|
+
var Zo = "ebsr-multiple-choice", Zu = `${Zo}--version-`, fr = (e) => {
|
|
6946
6999
|
if (!(e instanceof HTMLElement)) return !1;
|
|
6947
7000
|
const t = e.tagName.toLowerCase();
|
|
6948
|
-
return t ===
|
|
6949
|
-
},
|
|
7001
|
+
return t === Zo || t.startsWith(Zu);
|
|
7002
|
+
}, oi = (e, t) => Array.from(e.querySelectorAll(`[id="${t}"]`)).find(fr) ?? null, eh = (e) => {
|
|
6950
7003
|
let t = e.parentElement;
|
|
6951
7004
|
for (; t !== null; ) {
|
|
6952
7005
|
if (fr(t)) return t;
|
|
6953
7006
|
t = t.parentElement;
|
|
6954
7007
|
}
|
|
6955
7008
|
return null;
|
|
6956
|
-
},
|
|
7009
|
+
}, th = class {
|
|
6957
7010
|
constructor() {
|
|
6958
|
-
|
|
7011
|
+
f(this, "elementType", "ebsr"), f(this, "priority", 110), f(this, "mcAdapter", new Ie());
|
|
6959
7012
|
}
|
|
6960
7013
|
canHandle(e) {
|
|
6961
7014
|
return e.tagName.toLowerCase() === "ebsr" || Array.from(e.querySelectorAll("*")).some(fr);
|
|
6962
7015
|
}
|
|
6963
7016
|
findChoices(e) {
|
|
6964
|
-
const t =
|
|
7017
|
+
const t = oi(e, "a"), n = oi(e, "b"), r = [];
|
|
6965
7018
|
return t && r.push(...this.mcAdapter.findChoices(t)), n && r.push(...this.mcAdapter.findChoices(n)), r;
|
|
6966
7019
|
}
|
|
6967
7020
|
createChoiceRange(e) {
|
|
6968
7021
|
return this.mcAdapter.createChoiceRange(e);
|
|
6969
7022
|
}
|
|
6970
7023
|
getChoiceId(e) {
|
|
6971
|
-
return `${
|
|
7024
|
+
return `${eh(e)?.id || "unknown"}-${this.mcAdapter.getChoiceId(e)}`;
|
|
6972
7025
|
}
|
|
6973
7026
|
getChoiceLabel(e) {
|
|
6974
7027
|
return this.mcAdapter.getChoiceLabel(e);
|
|
@@ -6979,9 +7032,9 @@ var Xo = "ebsr-multiple-choice", Gu = `${Xo}--version-`, fr = (e) => {
|
|
|
6979
7032
|
getButtonContainer(e) {
|
|
6980
7033
|
return this.mcAdapter.getButtonContainer(e);
|
|
6981
7034
|
}
|
|
6982
|
-
},
|
|
7035
|
+
}, nh = class {
|
|
6983
7036
|
constructor() {
|
|
6984
|
-
|
|
7037
|
+
f(this, "elementType", "inline-dropdown"), f(this, "priority", 90);
|
|
6985
7038
|
}
|
|
6986
7039
|
canHandle(e) {
|
|
6987
7040
|
return e.tagName.toLowerCase() === "inline-dropdown" || e.querySelector('[role="combobox"]') !== null;
|
|
@@ -7005,12 +7058,12 @@ var Xo = "ebsr-multiple-choice", Gu = `${Xo}--version-`, fr = (e) => {
|
|
|
7005
7058
|
getButtonContainer(e) {
|
|
7006
7059
|
return e;
|
|
7007
7060
|
}
|
|
7008
|
-
},
|
|
7061
|
+
}, rh = class {
|
|
7009
7062
|
constructor() {
|
|
7010
|
-
|
|
7063
|
+
f(this, "adapters", void 0), this.adapters = [
|
|
7011
7064
|
new Ie(),
|
|
7012
|
-
new
|
|
7013
|
-
new
|
|
7065
|
+
new th(),
|
|
7066
|
+
new nh()
|
|
7014
7067
|
].sort((e, t) => t.priority - e.priority);
|
|
7015
7068
|
}
|
|
7016
7069
|
findAdapter(e) {
|
|
@@ -7033,7 +7086,7 @@ var Xo = "ebsr-multiple-choice", Gu = `${Xo}--version-`, fr = (e) => {
|
|
|
7033
7086
|
}
|
|
7034
7087
|
}, Qe = class j {
|
|
7035
7088
|
constructor() {
|
|
7036
|
-
|
|
7089
|
+
f(this, "name", "mask"), f(this, "highlights", /* @__PURE__ */ new Map()), f(this, "ranges", /* @__PURE__ */ new Map()), f(this, "fallbackContainers", /* @__PURE__ */ new Map());
|
|
7037
7090
|
}
|
|
7038
7091
|
initialize() {
|
|
7039
7092
|
}
|
|
@@ -7113,15 +7166,15 @@ var Xo = "ebsr-multiple-choice", Gu = `${Xo}--version-`, fr = (e) => {
|
|
|
7113
7166
|
r.selectNodeContents(n), this.removeAriaAttributes(r), this.fallbackContainers.delete(t);
|
|
7114
7167
|
}
|
|
7115
7168
|
};
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7169
|
+
f(Qe, "HIGHLIGHT_STYLE_PREFIX", "pie-answer-eliminator-mask-highlight-");
|
|
7170
|
+
f(Qe, "HIGHLIGHT_NAME_PREFIX", "pie-answer-masked-");
|
|
7171
|
+
f(Qe, "FALLBACK_CLASS", "pie-answer-masked-fallback");
|
|
7172
|
+
f(Qe, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
|
|
7173
|
+
f(Qe, "ELIMINATED_ATTR", "data-pie-answer-eliminated");
|
|
7174
|
+
f(Qe, "ELIMINATED_ID_ATTR", "data-pie-answer-eliminated-id");
|
|
7122
7175
|
var _e = class N {
|
|
7123
7176
|
constructor() {
|
|
7124
|
-
|
|
7177
|
+
f(this, "name", "strikethrough"), f(this, "highlights", /* @__PURE__ */ new Map()), f(this, "ranges", /* @__PURE__ */ new Map()), f(this, "fallbackContainers", /* @__PURE__ */ new Map());
|
|
7125
7178
|
}
|
|
7126
7179
|
initialize() {
|
|
7127
7180
|
this.isSupported() || console.warn("CSS Custom Highlight API not supported, using fallback");
|
|
@@ -7213,17 +7266,17 @@ var _e = class N {
|
|
|
7213
7266
|
return t.querySelector(`[${N.LABEL_HOOK_ATTR}="true"]`) || t.querySelector("label");
|
|
7214
7267
|
}
|
|
7215
7268
|
};
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7269
|
+
f(_e, "HIGHLIGHT_STYLE_PREFIX", "pie-answer-eliminator-highlight-");
|
|
7270
|
+
f(_e, "HIGHLIGHT_NAME_PREFIX", "pie-answer-eliminated-");
|
|
7271
|
+
f(_e, "FALLBACK_CLASS", "pie-answer-eliminator-eliminated-fallback");
|
|
7272
|
+
f(_e, "SR_CLASS", "pie-answer-eliminator-sr-announcement");
|
|
7273
|
+
f(_e, "CHOICE_HOOK_ATTR", "data-pie-answer-eliminator-choice");
|
|
7274
|
+
f(_e, "LABEL_HOOK_ATTR", "data-pie-answer-eliminator-label");
|
|
7275
|
+
f(_e, "ELIMINATED_ATTR", "data-pie-answer-eliminated");
|
|
7276
|
+
f(_e, "ELIMINATED_ID_ATTR", "data-pie-answer-eliminated-id");
|
|
7224
7277
|
var pr = class Tt {
|
|
7225
7278
|
constructor(t = "strikethrough", n = "right") {
|
|
7226
|
-
|
|
7279
|
+
f(this, "registry", void 0), f(this, "strategy", void 0), f(this, "eliminatedChoices", /* @__PURE__ */ new Set()), f(this, "choiceElements", /* @__PURE__ */ new Map()), f(this, "choiceButtons", /* @__PURE__ */ new Map()), f(this, "choiceAdapters", /* @__PURE__ */ new Map()), f(this, "buttonAlignment", "right"), f(this, "shouldRestoreState", !0), f(this, "storeIntegration", null), this.registry = new rh(), this.strategy = this.createStrategy(t), this.strategy.initialize(), this.buttonAlignment = n;
|
|
7227
7280
|
}
|
|
7228
7281
|
createStrategy(t) {
|
|
7229
7282
|
return t === "mask" ? new Qe() : new _e();
|
|
@@ -7365,27 +7418,27 @@ var pr = class Tt {
|
|
|
7365
7418
|
this.cleanupButtons(), this.strategy.destroy();
|
|
7366
7419
|
}
|
|
7367
7420
|
};
|
|
7368
|
-
|
|
7369
|
-
|
|
7370
|
-
var
|
|
7371
|
-
function
|
|
7372
|
-
|
|
7373
|
-
let n = we(t, "visible", 7, !1), r = we(t, "toolId", 7, "answerEliminator"), i = we(t, "strategy", 7, "strikethrough"), o = we(t, "alwaysOn", 7, !1), s = we(t, "buttonAlignment", 7, "right"), a = we(t, "scopeElement", 7, null), l = we(t, "elementToolStateStore", 7, null), c = we(t, "globalElementId", 7, ""), u = /* @__PURE__ */ F(null), h = /* @__PURE__ */ F(null),
|
|
7421
|
+
f(pr, "TOGGLE_CLASS", "pie-answer-eliminator-toggle");
|
|
7422
|
+
f(pr, "TOGGLE_ACTIVE_CLASS", "pie-answer-eliminator-toggle--active");
|
|
7423
|
+
var ih = /* @__PURE__ */ Ca('<div style="display: none;" aria-hidden="true"></div>');
|
|
7424
|
+
function oh(e, t) {
|
|
7425
|
+
mi(t, !0);
|
|
7426
|
+
let n = we(t, "visible", 7, !1), r = we(t, "toolId", 7, "answerEliminator"), i = we(t, "strategy", 7, "strikethrough"), o = we(t, "alwaysOn", 7, !1), s = we(t, "buttonAlignment", 7, "right"), a = we(t, "scopeElement", 7, null), l = we(t, "elementToolStateStore", 7, null), c = we(t, "globalElementId", 7, ""), u = /* @__PURE__ */ F(null), h = /* @__PURE__ */ F(null), p = /* @__PURE__ */ F(null);
|
|
7374
7427
|
const g = /* @__PURE__ */ Ar(() => b(h)?.toolCoordinator);
|
|
7375
7428
|
let m = /* @__PURE__ */ F(null), v = /* @__PURE__ */ F(null), y = /* @__PURE__ */ F(null), S = /* @__PURE__ */ F(null), O = /* @__PURE__ */ Ar(() => o() || n());
|
|
7376
7429
|
Re(() => {
|
|
7377
7430
|
if (b(u))
|
|
7378
|
-
return
|
|
7431
|
+
return Ka(b(u), (C) => {
|
|
7379
7432
|
M(h, C, !0);
|
|
7380
7433
|
});
|
|
7381
7434
|
}), Re(() => {
|
|
7382
7435
|
if (b(u))
|
|
7383
|
-
return
|
|
7384
|
-
M(
|
|
7436
|
+
return Xa(b(u), (C) => {
|
|
7437
|
+
M(p, C, !0);
|
|
7385
7438
|
});
|
|
7386
7439
|
});
|
|
7387
7440
|
function V() {
|
|
7388
|
-
return a() || b(
|
|
7441
|
+
return a() || b(p)?.scopeElement || null;
|
|
7389
7442
|
}
|
|
7390
7443
|
function A() {
|
|
7391
7444
|
if (!b(O) || !b(m)) return;
|
|
@@ -7404,13 +7457,13 @@ function Qu(e, t) {
|
|
|
7404
7457
|
});
|
|
7405
7458
|
}
|
|
7406
7459
|
Re(() => {
|
|
7407
|
-
!b(g) || !r() || (b(S) && b(y) && (b(S) !== b(g) || b(y) !== r()) && (b(S).unregisterTool(b(y)), M(S, null), M(y, null)), b(y) || (b(g).registerTool(r(), "Answer Eliminator", void 0,
|
|
7460
|
+
!b(g) || !r() || (b(S) && b(y) && (b(S) !== b(g) || b(y) !== r()) && (b(S).unregisterTool(b(y)), M(S, null), M(y, null)), b(y) || (b(g).registerTool(r(), "Answer Eliminator", void 0, Wn.MODAL), M(S, b(g), !0), M(y, r())));
|
|
7408
7461
|
}), Re(() => {
|
|
7409
7462
|
b(m) && l() && c() && b(m).setStoreIntegration(l(), c());
|
|
7410
|
-
}),
|
|
7463
|
+
}), $a(() => (M(m, new pr(i(), s()), !0), b(m) && l() && c() && b(m).setStoreIntegration(l(), c()), b(O) ? A() : b(m).cleanup(), () => {
|
|
7411
7464
|
b(m)?.destroy(), M(m, null), b(S) && b(y) && (b(S).unregisterTool(b(y)), M(S, null), M(y, null));
|
|
7412
7465
|
})), Re(() => {
|
|
7413
|
-
const C = b(
|
|
7466
|
+
const C = b(p)?.contextVersion ?? null;
|
|
7414
7467
|
if (C !== null) {
|
|
7415
7468
|
if (b(v) === null) {
|
|
7416
7469
|
M(v, C, !0);
|
|
@@ -7470,10 +7523,10 @@ function Qu(e, t) {
|
|
|
7470
7523
|
set globalElementId(C = "") {
|
|
7471
7524
|
c(C), pe();
|
|
7472
7525
|
}
|
|
7473
|
-
}, pt =
|
|
7474
|
-
return
|
|
7526
|
+
}, pt = ih();
|
|
7527
|
+
return Ha(pt, (C) => M(u, C), () => b(u)), eo(e, pt), vi(Z);
|
|
7475
7528
|
}
|
|
7476
|
-
customElements.define("pie-tool-answer-eliminator",
|
|
7529
|
+
customElements.define("pie-tool-answer-eliminator", Fa(oh, {
|
|
7477
7530
|
visible: {
|
|
7478
7531
|
attribute: "visible",
|
|
7479
7532
|
type: "Boolean"
|
|
@@ -7499,7 +7552,7 @@ customElements.define("pie-tool-answer-eliminator", Ha(Qu, {
|
|
|
7499
7552
|
globalElementId: { type: "String" }
|
|
7500
7553
|
}, [], [], { mode: "open" }));
|
|
7501
7554
|
export {
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7555
|
+
oh as default,
|
|
7556
|
+
lh as n,
|
|
7557
|
+
ah as t
|
|
7505
7558
|
};
|