@kubohiroya/turbowarp-bubble 0.6.0 → 0.8.0
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/README.md +80 -28
- package/THIRD_PARTY_NOTICES.md +10 -0
- package/dist/composition.js +297 -245
- package/dist/extension-manifest.json +35 -0
- package/dist/turbowarp-adapter.js +2199 -942
- package/dist/turbowarp-bubble.js +1868 -173
- package/dist/types/asset-manager-image-adapter.d.ts +18 -0
- package/dist/types/composition.d.ts +10 -0
- package/dist/types/portrait-layout.d.ts +14 -0
- package/dist/types/surface-motion.d.ts +8 -0
- package/dist/types/svg-overlay-surface.d.ts +97 -0
- package/dist/types/text-capability.d.ts +2 -2
- package/dist/types/turbowarp-adapter.d.ts +19 -2
- package/dist/types/turbowarp-svg-text-adapter.d.ts +35 -0
- package/docs/assets/block-quick-start.svg +27 -52
- package/docs/block-manual.ja.md +52 -54
- package/docs/block-manual.md +65 -67
- package/docs/index.html +32 -33
- package/docs/ja/index.html +32 -33
- package/docs/release-notes-0.8.0.md +45 -0
- package/package.json +6 -9
|
@@ -8,7 +8,436 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
8
8
|
}, c = (n, r, o) => (o = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
|
|
9
9
|
value: n,
|
|
10
10
|
enumerable: !0
|
|
11
|
-
}) : o, n)), l =
|
|
11
|
+
}) : o, n)), l = {
|
|
12
|
+
extensionName: "SVG Text",
|
|
13
|
+
blocks: [{
|
|
14
|
+
opcode: "defineStyle",
|
|
15
|
+
blockType: "COMMAND",
|
|
16
|
+
text: "define text style [STYLE] background [BACKGROUND] text [TEXT_COLOR] font [FONT] size [SIZE] align [ALIGN]",
|
|
17
|
+
description: "Defines or replaces a named text style for SVG text actors. Bubble shape and placement are owned by the host Bubble layer.",
|
|
18
|
+
arguments: {
|
|
19
|
+
STYLE: {
|
|
20
|
+
type: "STRING",
|
|
21
|
+
defaultValue: "default"
|
|
22
|
+
},
|
|
23
|
+
BACKGROUND: {
|
|
24
|
+
type: "COLOR",
|
|
25
|
+
defaultValue: "#ffffff"
|
|
26
|
+
},
|
|
27
|
+
TEXT_COLOR: {
|
|
28
|
+
type: "COLOR",
|
|
29
|
+
defaultValue: "#575e75"
|
|
30
|
+
},
|
|
31
|
+
FONT: {
|
|
32
|
+
type: "STRING",
|
|
33
|
+
defaultValue: "Helvetica"
|
|
34
|
+
},
|
|
35
|
+
SIZE: {
|
|
36
|
+
type: "NUMBER",
|
|
37
|
+
defaultValue: 100
|
|
38
|
+
},
|
|
39
|
+
ALIGN: {
|
|
40
|
+
type: "STRING",
|
|
41
|
+
defaultValue: "left",
|
|
42
|
+
menu: "alignment"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}, {
|
|
46
|
+
opcode: "setText",
|
|
47
|
+
blockType: "COMMAND",
|
|
48
|
+
text: "set this sprite text [TEXT] with style [STYLE]",
|
|
49
|
+
description: "Replaces this sprite's skin with responsive styled SVG text.",
|
|
50
|
+
arguments: {
|
|
51
|
+
TEXT: {
|
|
52
|
+
type: "STRING",
|
|
53
|
+
defaultValue: "Title\\nSubtitle"
|
|
54
|
+
},
|
|
55
|
+
STYLE: {
|
|
56
|
+
type: "STRING",
|
|
57
|
+
defaultValue: "default"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}],
|
|
61
|
+
menus: { alignment: {
|
|
62
|
+
acceptReporters: !0,
|
|
63
|
+
items: [
|
|
64
|
+
"left",
|
|
65
|
+
"center",
|
|
66
|
+
"right"
|
|
67
|
+
]
|
|
68
|
+
} }
|
|
69
|
+
}, u = 480, d = 360, f = 100, p = 50, m = 1, h = 128, g = {
|
|
70
|
+
fontSize: 14,
|
|
71
|
+
lineHeight: 16,
|
|
72
|
+
padding: 12,
|
|
73
|
+
cornerRadius: 8
|
|
74
|
+
}, _ = Object.freeze({
|
|
75
|
+
alignment: "left",
|
|
76
|
+
backgroundColor: "#ffffff",
|
|
77
|
+
font: "Helvetica",
|
|
78
|
+
fontPercent: f,
|
|
79
|
+
textColor: "#575e75"
|
|
80
|
+
}), v = Object.freeze({
|
|
81
|
+
..._,
|
|
82
|
+
rubyFontPercent: p,
|
|
83
|
+
rubyGap: m
|
|
84
|
+
});
|
|
85
|
+
function y(e, t, n) {
|
|
86
|
+
let r = C(t, n), i = e.split("\n").map((e) => ({
|
|
87
|
+
text: e,
|
|
88
|
+
width: D(e, r.fontSize)
|
|
89
|
+
})), a = Math.max(1, ...i.map((e) => e.width)), o = Math.max(1, Math.ceil(a + r.padding * 2)), s = Math.max(1, Math.ceil(r.lineHeight * i.length + r.padding * 2)), c = t.alignment === "center" ? o / 2 : t.alignment === "right" ? o - r.padding : r.padding, l = Object.freeze(i.map((e, t) => Object.freeze({
|
|
90
|
+
baseline: r.padding + r.fontSize + r.lineHeight * t,
|
|
91
|
+
text: e.text,
|
|
92
|
+
width: e.width,
|
|
93
|
+
x: c
|
|
94
|
+
}))), u = w(t, r);
|
|
95
|
+
return Object.freeze({
|
|
96
|
+
height: s,
|
|
97
|
+
lines: l,
|
|
98
|
+
preserveWhitespace: !0,
|
|
99
|
+
style: u,
|
|
100
|
+
width: o
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function b(e, t, n, r) {
|
|
104
|
+
let i = C(t, n), a = i.fontSize * (t.rubyFontPercent / f), o = t.rubyGap * i.fontScale, s = Object.freeze({
|
|
105
|
+
...w(t, i),
|
|
106
|
+
rubyFontPercent: t.rubyFontPercent,
|
|
107
|
+
rubyFontSize: a,
|
|
108
|
+
rubyGap: o
|
|
109
|
+
}), c = e.map((e) => e.type === "ruby" ? e.base : e.text).join(""), l = e.map((e) => e.type === "ruby" ? e.reading : e.text).join(""), u = [], d = [];
|
|
110
|
+
for (let [t, n] of e.entries()) {
|
|
111
|
+
if (n.type === "ruby") {
|
|
112
|
+
let e = Object.freeze({
|
|
113
|
+
end: n.base.length,
|
|
114
|
+
index: u.length,
|
|
115
|
+
runIndex: t,
|
|
116
|
+
start: 0,
|
|
117
|
+
type: "ruby"
|
|
118
|
+
});
|
|
119
|
+
u.push(e);
|
|
120
|
+
let r = D(n.base, i.fontSize), o = D(n.reading, a);
|
|
121
|
+
d.push({
|
|
122
|
+
base: n.base,
|
|
123
|
+
baseWidth: r,
|
|
124
|
+
reading: n.reading,
|
|
125
|
+
readingWidth: o,
|
|
126
|
+
reveal: e,
|
|
127
|
+
type: "ruby",
|
|
128
|
+
width: Math.max(r, o)
|
|
129
|
+
});
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
for (let e of T(n.text)) {
|
|
133
|
+
if (e.segment === "\n") {
|
|
134
|
+
d.push("break");
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
let n = Object.freeze({
|
|
138
|
+
end: e.end,
|
|
139
|
+
index: u.length,
|
|
140
|
+
runIndex: t,
|
|
141
|
+
start: e.start,
|
|
142
|
+
type: "text"
|
|
143
|
+
});
|
|
144
|
+
u.push(n), d.push({
|
|
145
|
+
reveal: n,
|
|
146
|
+
text: e.segment,
|
|
147
|
+
type: "text",
|
|
148
|
+
width: D(e.segment, i.fontSize)
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
let p = r === void 0 ? void 0 : Math.max(1, r - i.padding * 2), m = [], h = {
|
|
153
|
+
units: [],
|
|
154
|
+
width: 0
|
|
155
|
+
}, g = () => {
|
|
156
|
+
m.push(h), h = {
|
|
157
|
+
units: [],
|
|
158
|
+
width: 0
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
for (let e of d) {
|
|
162
|
+
if (e === "break") {
|
|
163
|
+
g();
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
p !== void 0 && h.units.length > 0 && h.width + e.width > p && g(), h.units.push(e), h.width += e.width;
|
|
167
|
+
}
|
|
168
|
+
g();
|
|
169
|
+
let _ = Math.max(1, ...m.map((e) => e.width)) + i.padding * 2, v = Math.max(1, Math.ceil(r === void 0 ? _ : Math.max(r, _))), y = Math.max(0, i.lineHeight - i.fontSize), b = i.padding, x = Object.freeze(m.map((e) => {
|
|
170
|
+
let n = e.units.some((e) => e.type === "ruby"), r = i.fontSize + (n ? a + o : 0), s = y, c = r + s, l = b + r, u = t.alignment === "center" ? (v - e.width) / 2 : t.alignment === "right" ? v - i.padding - e.width : i.padding, d = u, f = Object.freeze(e.units.map((e) => {
|
|
171
|
+
if (e.type === "text") {
|
|
172
|
+
let t = Object.freeze({
|
|
173
|
+
baseline: l,
|
|
174
|
+
revealIndex: e.reveal.index,
|
|
175
|
+
text: e.text,
|
|
176
|
+
type: "text",
|
|
177
|
+
width: e.width,
|
|
178
|
+
x: d
|
|
179
|
+
});
|
|
180
|
+
return d += e.width, t;
|
|
181
|
+
}
|
|
182
|
+
let t = d, n = Object.freeze({
|
|
183
|
+
baseline: l,
|
|
184
|
+
fontSize: i.fontSize,
|
|
185
|
+
text: e.base,
|
|
186
|
+
width: e.baseWidth,
|
|
187
|
+
x: t + (e.width - e.baseWidth) / 2
|
|
188
|
+
}), r = Object.freeze({
|
|
189
|
+
baseline: l - i.fontSize - o,
|
|
190
|
+
fontSize: a,
|
|
191
|
+
text: e.reading,
|
|
192
|
+
width: e.readingWidth,
|
|
193
|
+
x: t + (e.width - e.readingWidth) / 2
|
|
194
|
+
}), s = Object.freeze({
|
|
195
|
+
base: n,
|
|
196
|
+
reading: r,
|
|
197
|
+
revealIndex: e.reveal.index,
|
|
198
|
+
type: "ruby",
|
|
199
|
+
width: e.width,
|
|
200
|
+
x: t
|
|
201
|
+
});
|
|
202
|
+
return d += e.width, s;
|
|
203
|
+
})), m = Object.freeze({
|
|
204
|
+
ascent: r,
|
|
205
|
+
baseline: l,
|
|
206
|
+
descent: s,
|
|
207
|
+
fragments: f,
|
|
208
|
+
height: c,
|
|
209
|
+
overflow: p !== void 0 && e.width > p,
|
|
210
|
+
width: e.width,
|
|
211
|
+
x: u
|
|
212
|
+
});
|
|
213
|
+
return b += c, m;
|
|
214
|
+
})), S = Math.max(1, Math.ceil(b + i.padding)), E = x.some((e) => e.overflow);
|
|
215
|
+
return Object.freeze({
|
|
216
|
+
height: S,
|
|
217
|
+
lines: x,
|
|
218
|
+
overflow: E,
|
|
219
|
+
plainText: c,
|
|
220
|
+
preserveWhitespace: !0,
|
|
221
|
+
readingText: l,
|
|
222
|
+
revealUnits: Object.freeze(u),
|
|
223
|
+
style: s,
|
|
224
|
+
width: v
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
function x(e, t) {
|
|
228
|
+
let n = e.trim();
|
|
229
|
+
return n === "" ? t : n.toLowerCase() === "transparent" || /^#(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/iu.test(n) || globalThis.CSS?.supports?.("color", n) ? n : t;
|
|
230
|
+
}
|
|
231
|
+
function S(e) {
|
|
232
|
+
let t = e.trim(), n = [...t].some((e) => {
|
|
233
|
+
let t = e.codePointAt(0) ?? 0;
|
|
234
|
+
return t <= 31 || t === 127 || ",;{}".includes(e);
|
|
235
|
+
});
|
|
236
|
+
return t === "" || t.length > h || n ? _.font : t;
|
|
237
|
+
}
|
|
238
|
+
function C(e, t) {
|
|
239
|
+
let n = Math.min(t[0] / u, t[1] / d), r = n * (e.fontPercent / f);
|
|
240
|
+
return {
|
|
241
|
+
cornerRadius: g.cornerRadius * n,
|
|
242
|
+
fontScale: r,
|
|
243
|
+
fontSize: g.fontSize * r,
|
|
244
|
+
lineHeight: g.lineHeight * r,
|
|
245
|
+
padding: g.padding * n
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function w(e, t) {
|
|
249
|
+
return Object.freeze({
|
|
250
|
+
alignment: e.alignment,
|
|
251
|
+
backgroundColor: e.backgroundColor,
|
|
252
|
+
cornerRadius: t.cornerRadius,
|
|
253
|
+
font: e.font,
|
|
254
|
+
fontPercent: e.fontPercent,
|
|
255
|
+
fontSize: t.fontSize,
|
|
256
|
+
lineHeight: t.lineHeight,
|
|
257
|
+
padding: t.padding,
|
|
258
|
+
textColor: e.textColor
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
function T(e) {
|
|
262
|
+
let t = [], n = "", r = 0, i = !1, a = 0;
|
|
263
|
+
for (let o of e) !(n !== "" && (i || o === "" || E(o))) && n !== "" && (t.push({
|
|
264
|
+
end: a,
|
|
265
|
+
segment: n,
|
|
266
|
+
start: r
|
|
267
|
+
}), n = ""), n === "" && (r = a), n += o, i = o === "", a += o.length;
|
|
268
|
+
return n !== "" && t.push({
|
|
269
|
+
end: a,
|
|
270
|
+
segment: n,
|
|
271
|
+
start: r
|
|
272
|
+
}), t;
|
|
273
|
+
}
|
|
274
|
+
function E(e) {
|
|
275
|
+
if (/\p{Mark}/u.test(e)) return !0;
|
|
276
|
+
let t = e.codePointAt(0) ?? 0;
|
|
277
|
+
return t >= 65024 && t <= 65039 || t >= 917760 && t <= 917999 || t >= 127995 && t <= 127999;
|
|
278
|
+
}
|
|
279
|
+
function D(e, t) {
|
|
280
|
+
let n = 0;
|
|
281
|
+
for (let t of e) {
|
|
282
|
+
if (/\p{Mark}/u.test(t)) continue;
|
|
283
|
+
if (/\s/u.test(t)) {
|
|
284
|
+
n += .35;
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
let e = t.codePointAt(0) ?? 0;
|
|
288
|
+
n += e <= 127 ? .62 : 1;
|
|
289
|
+
}
|
|
290
|
+
return n * t;
|
|
291
|
+
}
|
|
292
|
+
l.blocks, l.menus;
|
|
293
|
+
var O = "default", k = 1e5, A = 1e3, j = 1024, M = 1e4, N = 1e5, P = 256, F = 512;
|
|
294
|
+
function I(e) {
|
|
295
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
296
|
+
}
|
|
297
|
+
function L(e, t) {
|
|
298
|
+
let n = Error(t);
|
|
299
|
+
return Object.defineProperty(n, "code", { value: e }), n;
|
|
300
|
+
}
|
|
301
|
+
function R(e, t, n, r) {
|
|
302
|
+
let i = /* @__PURE__ */ new Set([...t, ...n]);
|
|
303
|
+
if (t.some((t) => !Object.prototype.hasOwnProperty.call(e, t)) || Object.keys(e).some((e) => !i.has(e))) throw L("SVG-TEXT-COMPOSITION-001", `${r} has missing or unknown properties.`);
|
|
304
|
+
}
|
|
305
|
+
function z(e, t) {
|
|
306
|
+
if (typeof e != "string" || e.trim().length === 0) throw L("SVG-TEXT-COMPOSITION-001", `${t} must be a non-empty string.`);
|
|
307
|
+
return e.trim();
|
|
308
|
+
}
|
|
309
|
+
function B(e, t) {
|
|
310
|
+
if (e !== void 0 && (typeof e != "string" || e.length === 0)) throw L("SVG-TEXT-COMPOSITION-001", `${t} must be a non-empty string when provided.`);
|
|
311
|
+
}
|
|
312
|
+
function ee(e) {
|
|
313
|
+
if (!I(e)) throw L("SVG-TEXT-COMPOSITION-001", "SVG Text style must be an object.");
|
|
314
|
+
R(e, ["name"], [
|
|
315
|
+
"alignment",
|
|
316
|
+
"backgroundColor",
|
|
317
|
+
"font",
|
|
318
|
+
"fontPercent",
|
|
319
|
+
"rubyFontPercent",
|
|
320
|
+
"rubyGap",
|
|
321
|
+
"textColor"
|
|
322
|
+
], "SVG Text style");
|
|
323
|
+
let t = z(e.name, "SVG Text style name");
|
|
324
|
+
if (e.alignment !== void 0 && e.alignment !== "left" && e.alignment !== "center" && e.alignment !== "right") throw L("SVG-TEXT-COMPOSITION-001", "SVG Text alignment is invalid.");
|
|
325
|
+
if (B(e.backgroundColor, "SVG Text backgroundColor"), B(e.font, "SVG Text font"), B(e.textColor, "SVG Text textColor"), e.fontPercent !== void 0 && (typeof e.fontPercent != "number" || !Number.isFinite(e.fontPercent) || e.fontPercent < 1 || e.fontPercent > 1e3)) throw L("SVG-TEXT-COMPOSITION-001", "SVG Text fontPercent must be a finite number from 1 to 1000.");
|
|
326
|
+
if (e.rubyFontPercent !== void 0 && (typeof e.rubyFontPercent != "number" || !Number.isFinite(e.rubyFontPercent) || e.rubyFontPercent < 10 || e.rubyFontPercent > 100)) throw L("SVG-TEXT-COMPOSITION-001", "SVG Text rubyFontPercent must be a finite number from 10 to 100.");
|
|
327
|
+
if (e.rubyGap !== void 0 && (typeof e.rubyGap != "number" || !Number.isFinite(e.rubyGap) || e.rubyGap < 0 || e.rubyGap > 100)) throw L("SVG-TEXT-COMPOSITION-001", "SVG Text rubyGap must be a finite number from 0 to 100.");
|
|
328
|
+
return {
|
|
329
|
+
...e,
|
|
330
|
+
name: t
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function te(e) {
|
|
334
|
+
return Object.freeze({
|
|
335
|
+
alignment: e.alignment ?? _.alignment,
|
|
336
|
+
backgroundColor: x(e.backgroundColor ?? "", _.backgroundColor),
|
|
337
|
+
font: S(e.font ?? ""),
|
|
338
|
+
fontPercent: e.fontPercent ?? _.fontPercent,
|
|
339
|
+
rubyFontPercent: e.rubyFontPercent ?? v.rubyFontPercent,
|
|
340
|
+
rubyGap: e.rubyGap ?? v.rubyGap,
|
|
341
|
+
textColor: x(e.textColor ?? "", _.textColor)
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
function ne(e) {
|
|
345
|
+
if (!Array.isArray(e) || e.length !== 2 || e.some((e) => typeof e != "number" || !Number.isFinite(e) || e <= 0)) throw L("SVG-TEXT-COMPOSITION-001", "SVG Text nativeSize must be [width, height] with two positive finite numbers.");
|
|
346
|
+
return e;
|
|
347
|
+
}
|
|
348
|
+
function re(e) {
|
|
349
|
+
return e.replace(/\\r\\n|\\n|\\r/gu, "\n");
|
|
350
|
+
}
|
|
351
|
+
function ie(e) {
|
|
352
|
+
return re(e.replace(/\r\n?|\n/gu, "\n"));
|
|
353
|
+
}
|
|
354
|
+
function V(e) {
|
|
355
|
+
return L("SVG-TEXT-COMPOSITION-007", e);
|
|
356
|
+
}
|
|
357
|
+
function H(e) {
|
|
358
|
+
if (!Array.isArray(e)) throw L("SVG-TEXT-COMPOSITION-001", "SVG Text rich content runs must be an array.");
|
|
359
|
+
if (e.length > j) throw V(`SVG Text rich content exceeds ${j} runs.`);
|
|
360
|
+
let t = 0, n = 0, r = 1, i = e.map((e, i) => {
|
|
361
|
+
if (!I(e)) throw L("SVG-TEXT-COMPOSITION-001", `SVG Text rich content run ${i} must be an object.`);
|
|
362
|
+
if (e.type === "text") {
|
|
363
|
+
if (R(e, ["type", "text"], [], `SVG Text rich content run ${i}`), typeof e.text != "string") throw L("SVG-TEXT-COMPOSITION-001", `SVG Text rich content run ${i} text must be a string.`);
|
|
364
|
+
let a = ie(e.text);
|
|
365
|
+
return t += a.length, r += a.split("\n").length - 1, n += [...a.replace(/\n/gu, "")].length, Object.freeze({
|
|
366
|
+
text: a,
|
|
367
|
+
type: "text"
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
if (e.type === "ruby") {
|
|
371
|
+
if (R(e, [
|
|
372
|
+
"type",
|
|
373
|
+
"base",
|
|
374
|
+
"reading"
|
|
375
|
+
], [], `SVG Text rich content run ${i}`), typeof e.base != "string" || typeof e.reading != "string") throw L("SVG-TEXT-COMPOSITION-001", `SVG Text rich content run ${i} ruby base and reading must be strings.`);
|
|
376
|
+
let r = ie(e.base), a = ie(e.reading);
|
|
377
|
+
if (r.length === 0 || a.length === 0 || r.includes("\n") || a.includes("\n")) throw L("SVG-TEXT-COMPOSITION-001", `SVG Text rich content run ${i} ruby base and reading must be non-empty single-line strings.`);
|
|
378
|
+
if (r.length > P) throw V(`SVG Text ruby base exceeds ${P} characters.`);
|
|
379
|
+
if (a.length > F) throw V(`SVG Text ruby reading exceeds ${F} characters.`);
|
|
380
|
+
return t += r.length + a.length, n += 1, Object.freeze({
|
|
381
|
+
base: r,
|
|
382
|
+
reading: a,
|
|
383
|
+
type: "ruby"
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
throw L("SVG-TEXT-COMPOSITION-001", `SVG Text rich content run ${i} type is invalid.`);
|
|
387
|
+
});
|
|
388
|
+
if (t > k) throw V(`SVG Text rich content exceeds ${k} characters.`);
|
|
389
|
+
if (r > A) throw V(`SVG Text rich content exceeds ${A} lines.`);
|
|
390
|
+
if (n > M) throw V(`SVG Text rich content exceeds ${M} layout fragments.`);
|
|
391
|
+
return Object.freeze(i);
|
|
392
|
+
}
|
|
393
|
+
function ae(e) {
|
|
394
|
+
if (e !== void 0) {
|
|
395
|
+
if (typeof e != "number" || !Number.isFinite(e) || e <= 0 || e > N) throw L("SVG-TEXT-COMPOSITION-001", `SVG Text maxWidth must be a finite number greater than 0 and no greater than ${N}.`);
|
|
396
|
+
return e;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
function oe(e, t) {
|
|
400
|
+
if (!I(t)) throw L("SVG-TEXT-COMPOSITION-001", "SVG Text layout input is invalid.");
|
|
401
|
+
R(t, [
|
|
402
|
+
"styleName",
|
|
403
|
+
"text",
|
|
404
|
+
"nativeSize"
|
|
405
|
+
], [], "SVG Text layout input");
|
|
406
|
+
let n = z(t.styleName, "SVG Text styleName"), r = e.get(n);
|
|
407
|
+
if (!r) throw L("SVG-TEXT-COMPOSITION-003", `SVG Text style is not defined: ${n}`);
|
|
408
|
+
if (typeof t.text != "string") throw L("SVG-TEXT-COMPOSITION-001", "SVG Text text must be a string.");
|
|
409
|
+
return y(re(t.text), r, ne(t.nativeSize));
|
|
410
|
+
}
|
|
411
|
+
function se(e, t) {
|
|
412
|
+
if (!I(t)) throw L("SVG-TEXT-COMPOSITION-001", "SVG Text rich layout input is invalid.");
|
|
413
|
+
R(t, [
|
|
414
|
+
"styleName",
|
|
415
|
+
"runs",
|
|
416
|
+
"nativeSize"
|
|
417
|
+
], ["maxWidth"], "SVG Text rich layout input");
|
|
418
|
+
let n = z(t.styleName, "SVG Text styleName"), r = e.get(n);
|
|
419
|
+
if (!r) throw L("SVG-TEXT-COMPOSITION-003", `SVG Text style is not defined: ${n}`);
|
|
420
|
+
let i = H(t.runs), a = ne(t.nativeSize), o = ae(t.maxWidth);
|
|
421
|
+
return o === void 0 ? b(i, r, a) : b(i, r, a, o);
|
|
422
|
+
}
|
|
423
|
+
function ce() {
|
|
424
|
+
let e = /* @__PURE__ */ new Map([[O, v]]);
|
|
425
|
+
return Object.freeze({
|
|
426
|
+
defineStyle(t) {
|
|
427
|
+
let n = ee(t);
|
|
428
|
+
e.set(n.name, te(n));
|
|
429
|
+
},
|
|
430
|
+
layoutRichText(t) {
|
|
431
|
+
return se(e, t);
|
|
432
|
+
},
|
|
433
|
+
layoutText(t) {
|
|
434
|
+
return oe(e, t);
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
//#endregion
|
|
439
|
+
//#region src/placement.ts
|
|
440
|
+
var le = [
|
|
12
441
|
"up",
|
|
13
442
|
"up-up-right",
|
|
14
443
|
"up-right",
|
|
@@ -25,11 +454,11 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
25
454
|
"left-up-left",
|
|
26
455
|
"up-left",
|
|
27
456
|
"up-up-left"
|
|
28
|
-
],
|
|
457
|
+
], ue = [
|
|
29
458
|
"HEADER_LIKE",
|
|
30
459
|
"CENTER",
|
|
31
460
|
"FOOTER_LIKE"
|
|
32
|
-
],
|
|
461
|
+
], de = /* @__PURE__ */ new Map([
|
|
33
462
|
["east", "right"],
|
|
34
463
|
["east-northeast", "right-up-right"],
|
|
35
464
|
["east-southeast", "right-down-right"],
|
|
@@ -46,17 +475,17 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
46
475
|
["west", "left"],
|
|
47
476
|
["west-northwest", "left-up-left"],
|
|
48
477
|
["west-southwest", "left-down-left"]
|
|
49
|
-
]),
|
|
478
|
+
]), fe = new Set(le), pe = new Set(ue), me = Math.SQRT2 - 1, he = Object.freeze({
|
|
50
479
|
down: {
|
|
51
480
|
x: 0,
|
|
52
481
|
y: -1
|
|
53
482
|
},
|
|
54
483
|
"down-down-left": {
|
|
55
|
-
x: -
|
|
484
|
+
x: -me,
|
|
56
485
|
y: -1
|
|
57
486
|
},
|
|
58
487
|
"down-down-right": {
|
|
59
|
-
x:
|
|
488
|
+
x: me,
|
|
60
489
|
y: -1
|
|
61
490
|
},
|
|
62
491
|
"down-left": {
|
|
@@ -73,11 +502,11 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
73
502
|
},
|
|
74
503
|
"left-down-left": {
|
|
75
504
|
x: -1,
|
|
76
|
-
y: -
|
|
505
|
+
y: -me
|
|
77
506
|
},
|
|
78
507
|
"left-up-left": {
|
|
79
508
|
x: -1,
|
|
80
|
-
y:
|
|
509
|
+
y: me
|
|
81
510
|
},
|
|
82
511
|
right: {
|
|
83
512
|
x: 1,
|
|
@@ -85,11 +514,11 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
85
514
|
},
|
|
86
515
|
"right-down-right": {
|
|
87
516
|
x: 1,
|
|
88
|
-
y: -
|
|
517
|
+
y: -me
|
|
89
518
|
},
|
|
90
519
|
"right-up-right": {
|
|
91
520
|
x: 1,
|
|
92
|
-
y:
|
|
521
|
+
y: me
|
|
93
522
|
},
|
|
94
523
|
up: {
|
|
95
524
|
x: 0,
|
|
@@ -104,18 +533,18 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
104
533
|
y: 1
|
|
105
534
|
},
|
|
106
535
|
"up-up-left": {
|
|
107
|
-
x: -
|
|
536
|
+
x: -me,
|
|
108
537
|
y: 1
|
|
109
538
|
},
|
|
110
539
|
"up-up-right": {
|
|
111
|
-
x:
|
|
540
|
+
x: me,
|
|
112
541
|
y: 1
|
|
113
542
|
}
|
|
114
543
|
});
|
|
115
|
-
function
|
|
544
|
+
function ge(e) {
|
|
116
545
|
return Math.abs(e) < 1e-12 ? 0 : Math.abs(1 - Math.abs(e)) < 1e-12 ? Math.sign(e) : e;
|
|
117
546
|
}
|
|
118
|
-
function
|
|
547
|
+
function _e(e) {
|
|
119
548
|
if (typeof e == "number") {
|
|
120
549
|
if (!Number.isFinite(e) || e < 0 || e > 360) throw TypeError("Bubble placement angle must be from 0 through 360.");
|
|
121
550
|
return Object.freeze({
|
|
@@ -125,16 +554,16 @@ function _(e) {
|
|
|
125
554
|
}
|
|
126
555
|
if (typeof e != "string" || e.trim().length === 0) throw TypeError("Bubble placement must be a direction, angle, or region.");
|
|
127
556
|
let t = e.trim(), n = t.toUpperCase();
|
|
128
|
-
if (
|
|
557
|
+
if (pe.has(n)) return Object.freeze({
|
|
129
558
|
basis: "background",
|
|
130
559
|
region: n
|
|
131
560
|
});
|
|
132
561
|
let r = t.toLowerCase();
|
|
133
|
-
if (
|
|
562
|
+
if (fe.has(r)) return Object.freeze({
|
|
134
563
|
basis: "actor",
|
|
135
564
|
direction: r
|
|
136
565
|
});
|
|
137
|
-
let i =
|
|
566
|
+
let i = de.get(r);
|
|
138
567
|
if (i) return Object.freeze({
|
|
139
568
|
basis: "actor",
|
|
140
569
|
direction: i
|
|
@@ -146,38 +575,38 @@ function _(e) {
|
|
|
146
575
|
});
|
|
147
576
|
throw TypeError("Bubble placement is invalid.");
|
|
148
577
|
}
|
|
149
|
-
function
|
|
150
|
-
if (typeof e == "string") return
|
|
578
|
+
function ve(e) {
|
|
579
|
+
if (typeof e == "string") return he[e];
|
|
151
580
|
let t = e * Math.PI / 180;
|
|
152
581
|
return Object.freeze({
|
|
153
|
-
x:
|
|
154
|
-
y:
|
|
582
|
+
x: ge(Math.sin(t)),
|
|
583
|
+
y: ge(Math.cos(t))
|
|
155
584
|
});
|
|
156
585
|
}
|
|
157
586
|
//#endregion
|
|
158
587
|
//#region src/actor-transform.ts
|
|
159
|
-
var
|
|
588
|
+
var ye = Object.freeze({
|
|
160
589
|
x: 0,
|
|
161
590
|
y: 0,
|
|
162
591
|
scalePercent: 100
|
|
163
592
|
});
|
|
164
|
-
function
|
|
593
|
+
function be(e, t) {
|
|
165
594
|
if (typeof e != "number" || !Number.isFinite(e)) throw TypeError(`${t} must be a finite number.`);
|
|
166
595
|
return e;
|
|
167
596
|
}
|
|
168
|
-
function
|
|
169
|
-
let t =
|
|
597
|
+
function xe(e) {
|
|
598
|
+
let t = be(e, "Bubble distance");
|
|
170
599
|
if (t < 0) throw TypeError("Bubble distance must be zero or greater.");
|
|
171
600
|
return t;
|
|
172
601
|
}
|
|
173
|
-
function
|
|
174
|
-
let t =
|
|
602
|
+
function Se(e) {
|
|
603
|
+
let t = be(e, "Bubble tail length");
|
|
175
604
|
if (t <= 0) throw TypeError("Bubble tail length must be greater than zero.");
|
|
176
605
|
return t;
|
|
177
606
|
}
|
|
178
|
-
function
|
|
607
|
+
function Ce(e) {
|
|
179
608
|
if (!Array.isArray(e) || e.length !== 2 && e.length !== 3) throw TypeError("Bubble offset must be [x, y] or [x, y, scale].");
|
|
180
|
-
let t =
|
|
609
|
+
let t = be(e[0], "Bubble offset x"), n = be(e[1], "Bubble offset y"), r = be(e.length === 3 ? e[2] : 100, "Bubble offset scale");
|
|
181
610
|
if (r <= 0) throw TypeError("Bubble offset scale must be greater than zero.");
|
|
182
611
|
return Object.freeze({
|
|
183
612
|
x: t,
|
|
@@ -185,8 +614,8 @@ function C(e) {
|
|
|
185
614
|
scalePercent: r
|
|
186
615
|
});
|
|
187
616
|
}
|
|
188
|
-
function
|
|
189
|
-
let t = (e.bounds.left + e.bounds.right) / 2, n = (e.bounds.top + e.bounds.bottom) / 2, r =
|
|
617
|
+
function we(e) {
|
|
618
|
+
let t = (e.bounds.left + e.bounds.right) / 2, n = (e.bounds.top + e.bounds.bottom) / 2, r = ve(e.direction), i = e.distance + e.tailLength, a = r.x < 0 ? t - e.bounds.left + i + e.bubbleWidth / 2 : e.bounds.right - t + i + e.bubbleWidth / 2, o = r.y < 0 ? n - e.bounds.bottom + i + e.bubbleHeight / 2 : e.bounds.top - n + i + e.bubbleHeight / 2, s = Math.min(r.x === 0 ? Infinity : a / Math.abs(r.x), r.y === 0 ? Infinity : o / Math.abs(r.y));
|
|
190
619
|
return Object.freeze({
|
|
191
620
|
x: t + r.x * s + e.offset.x,
|
|
192
621
|
y: n + r.y * s + e.offset.y
|
|
@@ -194,7 +623,7 @@ function w(e) {
|
|
|
194
623
|
}
|
|
195
624
|
//#endregion
|
|
196
625
|
//#region node_modules/.pnpm/jsclipper@https+++codeload.github.com+platener+jsclipper+tar.gz+56aed19845113e1939d8971c47233054659436b1/node_modules/jsclipper/jsclipper.js
|
|
197
|
-
var
|
|
626
|
+
var Te = /* @__PURE__ */ o(((e, t) => {
|
|
198
627
|
(function() {
|
|
199
628
|
var e = {}, n = !1;
|
|
200
629
|
t !== void 0 && t.exports ? (t.exports = e, n = !0) : typeof document < "u" ? window.ClipperLib = e : self.ClipperLib = e;
|
|
@@ -337,7 +766,7 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
337
766
|
for (s = a - 1; s >= 0; --s) t[s] = 0;
|
|
338
767
|
t[a] = o, t.t = this.t + a + 1, t.s = this.s, t.clamp();
|
|
339
768
|
}
|
|
340
|
-
function
|
|
769
|
+
function P(e, t) {
|
|
341
770
|
t.s = this.s;
|
|
342
771
|
var n = Math.floor(e / this.DB);
|
|
343
772
|
if (n >= this.t) {
|
|
@@ -349,7 +778,7 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
349
778
|
for (var o = n + 1; o < this.t; ++o) t[o - n - 1] |= (this[o] & a) << i, t[o - n] = this[o] >> r;
|
|
350
779
|
r > 0 && (t[this.t - n - 1] |= (this.s & a) << i), t.t = this.t - n, t.clamp();
|
|
351
780
|
}
|
|
352
|
-
function
|
|
781
|
+
function F(e, t) {
|
|
353
782
|
for (var n = 0, r = 0, i = Math.min(e.t, this.t); n < i;) r += this[n] - e[n], t[n++] = r & this.DM, r >>= this.DB;
|
|
354
783
|
if (e.t < this.t) {
|
|
355
784
|
for (r -= e.s; n < this.t;) r += this[n], t[n++] = r & this.DM, r >>= this.DB;
|
|
@@ -360,13 +789,13 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
360
789
|
}
|
|
361
790
|
t.s = r < 0 ? -1 : 0, r < -1 ? t[n++] = this.DV + r : r > 0 && (t[n++] = r), t.t = n, t.clamp();
|
|
362
791
|
}
|
|
363
|
-
function
|
|
792
|
+
function I(e, t) {
|
|
364
793
|
var n = this.abs(), r = e.abs(), i = n.t;
|
|
365
794
|
for (t.t = i + r.t; --i >= 0;) t[i] = 0;
|
|
366
795
|
for (i = 0; i < r.t; ++i) t[i + n.t] = n.am(0, r[i], t, i, 0, n.t);
|
|
367
796
|
t.s = 0, t.clamp(), this.s != e.s && c.ZERO.subTo(t, t);
|
|
368
797
|
}
|
|
369
|
-
function
|
|
798
|
+
function L(e) {
|
|
370
799
|
for (var t = this.abs(), n = e.t = 2 * t.t; --n >= 0;) e[n] = 0;
|
|
371
800
|
for (n = 0; n < t.t - 1; ++n) {
|
|
372
801
|
var r = t.am(n, t[n], e, 2 * n, 0, 1);
|
|
@@ -374,7 +803,7 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
374
803
|
}
|
|
375
804
|
e.t > 0 && (e[e.t - 1] += t.am(n, t[n], e, 2 * n, 0, 1)), e.s = 0, e.clamp();
|
|
376
805
|
}
|
|
377
|
-
function
|
|
806
|
+
function R(e, t, n) {
|
|
378
807
|
var r = e.abs();
|
|
379
808
|
if (!(r.t <= 0)) {
|
|
380
809
|
var i = this.abs();
|
|
@@ -397,48 +826,48 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
397
826
|
}
|
|
398
827
|
}
|
|
399
828
|
}
|
|
400
|
-
function
|
|
829
|
+
function z(e) {
|
|
401
830
|
var t = l();
|
|
402
831
|
return this.abs().divRemTo(e, null, t), this.s < 0 && t.compareTo(c.ZERO) > 0 && e.subTo(t, t), t;
|
|
403
832
|
}
|
|
404
|
-
function
|
|
833
|
+
function B(e) {
|
|
405
834
|
this.m = e;
|
|
406
835
|
}
|
|
407
|
-
function
|
|
836
|
+
function ee(e) {
|
|
408
837
|
return e.s < 0 || e.compareTo(this.m) >= 0 ? e.mod(this.m) : e;
|
|
409
838
|
}
|
|
410
|
-
function
|
|
839
|
+
function te(e) {
|
|
411
840
|
return e;
|
|
412
841
|
}
|
|
413
|
-
function
|
|
842
|
+
function ne(e) {
|
|
414
843
|
e.divRemTo(this.m, null, e);
|
|
415
844
|
}
|
|
416
|
-
function
|
|
845
|
+
function re(e, t, n) {
|
|
417
846
|
e.multiplyTo(t, n), this.reduce(n);
|
|
418
847
|
}
|
|
419
|
-
function
|
|
848
|
+
function ie(e, t) {
|
|
420
849
|
e.squareTo(t), this.reduce(t);
|
|
421
850
|
}
|
|
422
|
-
|
|
423
|
-
function
|
|
851
|
+
B.prototype.convert = ee, B.prototype.revert = te, B.prototype.reduce = ne, B.prototype.mulTo = re, B.prototype.sqrTo = ie;
|
|
852
|
+
function V() {
|
|
424
853
|
if (this.t < 1) return 0;
|
|
425
854
|
var e = this[0];
|
|
426
855
|
if (!(e & 1)) return 0;
|
|
427
856
|
var t = e & 3;
|
|
428
857
|
return t = t * (2 - (e & 15) * t) & 15, t = t * (2 - (e & 255) * t) & 255, t = t * (2 - ((e & 65535) * t & 65535)) & 65535, t = t * (2 - e * t % this.DV) % this.DV, t > 0 ? this.DV - t : -t;
|
|
429
858
|
}
|
|
430
|
-
function
|
|
859
|
+
function H(e) {
|
|
431
860
|
this.m = e, this.mp = e.invDigit(), this.mpl = this.mp & 32767, this.mph = this.mp >> 15, this.um = (1 << e.DB - 15) - 1, this.mt2 = 2 * e.t;
|
|
432
861
|
}
|
|
433
|
-
function
|
|
862
|
+
function ae(e) {
|
|
434
863
|
var t = l();
|
|
435
864
|
return e.abs().dlShiftTo(this.m.t, t), t.divRemTo(this.m, null, t), e.s < 0 && t.compareTo(c.ZERO) > 0 && this.m.subTo(t, t), t;
|
|
436
865
|
}
|
|
437
|
-
function
|
|
866
|
+
function oe(e) {
|
|
438
867
|
var t = l();
|
|
439
868
|
return e.copyTo(t), this.reduce(t), t;
|
|
440
869
|
}
|
|
441
|
-
function
|
|
870
|
+
function se(e) {
|
|
442
871
|
for (; e.t <= this.mt2;) e[e.t++] = 0;
|
|
443
872
|
for (var t = 0; t < this.m.t; ++t) {
|
|
444
873
|
var n = e[t] & 32767, r = n * this.mpl + ((n * this.mph + (e[t] >> 15) * this.mpl & this.um) << 15) & e.DM;
|
|
@@ -446,17 +875,17 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
446
875
|
}
|
|
447
876
|
e.clamp(), e.drShiftTo(this.m.t, e), e.compareTo(this.m) >= 0 && e.subTo(this.m, e);
|
|
448
877
|
}
|
|
449
|
-
function
|
|
878
|
+
function ce(e, t) {
|
|
450
879
|
e.squareTo(t), this.reduce(t);
|
|
451
880
|
}
|
|
452
|
-
function
|
|
881
|
+
function le(e, t, n) {
|
|
453
882
|
e.multiplyTo(t, n), this.reduce(n);
|
|
454
883
|
}
|
|
455
|
-
|
|
456
|
-
function
|
|
884
|
+
H.prototype.convert = ae, H.prototype.revert = oe, H.prototype.reduce = se, H.prototype.mulTo = le, H.prototype.sqrTo = ce;
|
|
885
|
+
function ue() {
|
|
457
886
|
return (this.t > 0 ? this[0] & 1 : this.s) == 0;
|
|
458
887
|
}
|
|
459
|
-
function
|
|
888
|
+
function de(e, t) {
|
|
460
889
|
if (e > 4294967295 || e < 1) return c.ONE;
|
|
461
890
|
var n = l(), r = l(), i = t.convert(this), a = k(e) - 1;
|
|
462
891
|
for (i.copyTo(n); --a >= 0;) if (t.sqrTo(n, r), (e & 1 << a) > 0) t.mulTo(r, i, n);
|
|
@@ -466,16 +895,16 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
466
895
|
}
|
|
467
896
|
return t.revert(n);
|
|
468
897
|
}
|
|
469
|
-
function
|
|
470
|
-
var n = e < 256 || t.isEven() ? new
|
|
898
|
+
function fe(e, t) {
|
|
899
|
+
var n = e < 256 || t.isEven() ? new B(t) : new H(t);
|
|
471
900
|
return this.exp(e, n);
|
|
472
901
|
}
|
|
473
|
-
c.prototype.copyTo = b, c.prototype.fromInt = x, c.prototype.fromString = C, c.prototype.clamp = w, c.prototype.dlShiftTo = j, c.prototype.drShiftTo = M, c.prototype.lShiftTo = N, c.prototype.rShiftTo =
|
|
474
|
-
function
|
|
902
|
+
c.prototype.copyTo = b, c.prototype.fromInt = x, c.prototype.fromString = C, c.prototype.clamp = w, c.prototype.dlShiftTo = j, c.prototype.drShiftTo = M, c.prototype.lShiftTo = N, c.prototype.rShiftTo = P, c.prototype.subTo = F, c.prototype.multiplyTo = I, c.prototype.squareTo = L, c.prototype.divRemTo = R, c.prototype.invDigit = V, c.prototype.isEven = ue, c.prototype.exp = de, c.prototype.toString = T, c.prototype.negate = E, c.prototype.abs = D, c.prototype.compareTo = O, c.prototype.bitLength = A, c.prototype.mod = z, c.prototype.modPowInt = fe, c.ZERO = S(0), c.ONE = S(1);
|
|
903
|
+
function pe() {
|
|
475
904
|
var e = l();
|
|
476
905
|
return this.copyTo(e), e;
|
|
477
906
|
}
|
|
478
|
-
function
|
|
907
|
+
function me() {
|
|
479
908
|
if (this.s < 0) {
|
|
480
909
|
if (this.t == 1) return this[0] - this.DV;
|
|
481
910
|
if (this.t == 0) return -1;
|
|
@@ -483,25 +912,25 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
483
912
|
else if (this.t == 0) return 0;
|
|
484
913
|
return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];
|
|
485
914
|
}
|
|
486
|
-
function
|
|
915
|
+
function he() {
|
|
487
916
|
return this.t == 0 ? this.s : this[0] << 24 >> 24;
|
|
488
917
|
}
|
|
489
|
-
function
|
|
918
|
+
function ge() {
|
|
490
919
|
return this.t == 0 ? this.s : this[0] << 16 >> 16;
|
|
491
920
|
}
|
|
492
|
-
function
|
|
921
|
+
function _e(e) {
|
|
493
922
|
return Math.floor(Math.LN2 * this.DB / Math.log(e));
|
|
494
923
|
}
|
|
495
|
-
function
|
|
924
|
+
function ve() {
|
|
496
925
|
return this.s < 0 ? -1 : this.t <= 0 || this.t == 1 && this[0] <= 0 ? 0 : 1;
|
|
497
926
|
}
|
|
498
|
-
function
|
|
927
|
+
function ye(e) {
|
|
499
928
|
if (e ??= 10, this.signum() == 0 || e < 2 || e > 36) return "0";
|
|
500
929
|
var t = this.chunkSize(e), n = e ** +t, r = S(n), i = l(), a = l(), o = "";
|
|
501
930
|
for (this.divRemTo(r, i, a); i.signum() > 0;) o = (n + a.intValue()).toString(e).substr(1) + o, i.divRemTo(r, i, a);
|
|
502
931
|
return a.intValue().toString(e) + o;
|
|
503
932
|
}
|
|
504
|
-
function
|
|
933
|
+
function be(e, t) {
|
|
505
934
|
this.fromInt(0), t ??= 10;
|
|
506
935
|
for (var n = this.chunkSize(t), r = t ** +n, i = !1, a = 0, o = 0, s = 0; s < e.length; ++s) {
|
|
507
936
|
var l = y(e, s);
|
|
@@ -513,32 +942,32 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
513
942
|
}
|
|
514
943
|
a > 0 && (this.dMultiply(t ** +a), this.dAddOffset(o, 0)), i && c.ZERO.subTo(this, this);
|
|
515
944
|
}
|
|
516
|
-
function
|
|
945
|
+
function xe(e, t, n) {
|
|
517
946
|
if (typeof t == "number") {
|
|
518
947
|
if (e < 2) this.fromInt(1);
|
|
519
|
-
else for (this.fromNumber(e, n), this.testBit(e - 1) || this.bitwiseTo(c.ONE.shiftLeft(e - 1),
|
|
948
|
+
else for (this.fromNumber(e, n), this.testBit(e - 1) || this.bitwiseTo(c.ONE.shiftLeft(e - 1), ke, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(t);) this.dAddOffset(2, 0), this.bitLength() > e && this.subTo(c.ONE.shiftLeft(e - 1), this);
|
|
520
949
|
} else {
|
|
521
950
|
var r = [], i = e & 7;
|
|
522
951
|
r.length = (e >> 3) + 1, t.nextBytes(r), i > 0 ? r[0] &= (1 << i) - 1 : r[0] = 0, this.fromString(r, 256);
|
|
523
952
|
}
|
|
524
953
|
}
|
|
525
|
-
function
|
|
954
|
+
function Se() {
|
|
526
955
|
var e = this.t, t = [];
|
|
527
956
|
t[0] = this.s;
|
|
528
957
|
var n = this.DB - e * this.DB % 8, r, i = 0;
|
|
529
958
|
if (e-- > 0) for (n < this.DB && (r = this[e] >> n) != (this.s & this.DM) >> n && (t[i++] = r | this.s << this.DB - n); e >= 0;) n < 8 ? (r = (this[e] & (1 << n) - 1) << 8 - n, r |= this[--e] >> (n += this.DB - 8)) : (r = this[e] >> (n -= 8) & 255, n <= 0 && (n += this.DB, --e)), r & 128 && (r |= -256), i == 0 && (this.s & 128) != (r & 128) && ++i, (i > 0 || r != this.s) && (t[i++] = r);
|
|
530
959
|
return t;
|
|
531
960
|
}
|
|
532
|
-
function
|
|
961
|
+
function Ce(e) {
|
|
533
962
|
return this.compareTo(e) == 0;
|
|
534
963
|
}
|
|
535
|
-
function
|
|
964
|
+
function we(e) {
|
|
536
965
|
return this.compareTo(e) < 0 ? this : e;
|
|
537
966
|
}
|
|
538
|
-
function
|
|
967
|
+
function Te(e) {
|
|
539
968
|
return this.compareTo(e) > 0 ? this : e;
|
|
540
969
|
}
|
|
541
|
-
function
|
|
970
|
+
function Ee(e, t, n) {
|
|
542
971
|
var r, i, a = Math.min(e.t, this.t);
|
|
543
972
|
for (r = 0; r < a; ++r) n[r] = t(this[r], e[r]);
|
|
544
973
|
if (e.t < this.t) {
|
|
@@ -550,39 +979,39 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
550
979
|
}
|
|
551
980
|
n.s = t(this.s, e.s), n.clamp();
|
|
552
981
|
}
|
|
553
|
-
function
|
|
982
|
+
function De(e, t) {
|
|
554
983
|
return e & t;
|
|
555
984
|
}
|
|
556
|
-
function
|
|
985
|
+
function Oe(e) {
|
|
557
986
|
var t = l();
|
|
558
|
-
return this.bitwiseTo(e,
|
|
987
|
+
return this.bitwiseTo(e, De, t), t;
|
|
559
988
|
}
|
|
560
|
-
function
|
|
989
|
+
function ke(e, t) {
|
|
561
990
|
return e | t;
|
|
562
991
|
}
|
|
563
|
-
function
|
|
992
|
+
function Ae(e) {
|
|
564
993
|
var t = l();
|
|
565
|
-
return this.bitwiseTo(e,
|
|
994
|
+
return this.bitwiseTo(e, ke, t), t;
|
|
566
995
|
}
|
|
567
|
-
function
|
|
996
|
+
function je(e, t) {
|
|
568
997
|
return e ^ t;
|
|
569
998
|
}
|
|
570
|
-
function
|
|
999
|
+
function Me(e) {
|
|
571
1000
|
var t = l();
|
|
572
|
-
return this.bitwiseTo(e,
|
|
1001
|
+
return this.bitwiseTo(e, je, t), t;
|
|
573
1002
|
}
|
|
574
|
-
function
|
|
1003
|
+
function Ne(e, t) {
|
|
575
1004
|
return e & ~t;
|
|
576
1005
|
}
|
|
577
|
-
function
|
|
1006
|
+
function Pe(e) {
|
|
578
1007
|
var t = l();
|
|
579
|
-
return this.bitwiseTo(e,
|
|
1008
|
+
return this.bitwiseTo(e, Ne, t), t;
|
|
580
1009
|
}
|
|
581
|
-
function
|
|
1010
|
+
function Fe() {
|
|
582
1011
|
for (var e = l(), t = 0; t < this.t; ++t) e[t] = this.DM & ~this[t];
|
|
583
1012
|
return e.t = this.t, e.s = ~this.s, e;
|
|
584
1013
|
}
|
|
585
|
-
function
|
|
1014
|
+
function Ie(e) {
|
|
586
1015
|
var t = l();
|
|
587
1016
|
return e < 0 ? this.rShiftTo(-e, t) : this.lShiftTo(e, t), t;
|
|
588
1017
|
}
|
|
@@ -603,28 +1032,28 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
603
1032
|
for (var t = 0; e != 0;) e &= e - 1, ++t;
|
|
604
1033
|
return t;
|
|
605
1034
|
}
|
|
606
|
-
function
|
|
1035
|
+
function Ve() {
|
|
607
1036
|
for (var e = 0, t = this.s & this.DM, n = 0; n < this.t; ++n) e += Be(this[n] ^ t);
|
|
608
1037
|
return e;
|
|
609
1038
|
}
|
|
610
|
-
function
|
|
1039
|
+
function He(e) {
|
|
611
1040
|
var t = Math.floor(e / this.DB);
|
|
612
1041
|
return t >= this.t ? this.s != 0 : !!(this[t] & 1 << e % this.DB);
|
|
613
1042
|
}
|
|
614
|
-
function
|
|
1043
|
+
function Ue(e, t) {
|
|
615
1044
|
var n = c.ONE.shiftLeft(e);
|
|
616
1045
|
return this.bitwiseTo(n, t, n), n;
|
|
617
1046
|
}
|
|
618
|
-
function Ue(e) {
|
|
619
|
-
return this.changeBit(e, V);
|
|
620
|
-
}
|
|
621
1047
|
function We(e) {
|
|
622
|
-
return this.changeBit(e,
|
|
1048
|
+
return this.changeBit(e, ke);
|
|
623
1049
|
}
|
|
624
1050
|
function Ge(e) {
|
|
625
|
-
return this.changeBit(e,
|
|
1051
|
+
return this.changeBit(e, Ne);
|
|
1052
|
+
}
|
|
1053
|
+
function Ke(e) {
|
|
1054
|
+
return this.changeBit(e, je);
|
|
626
1055
|
}
|
|
627
|
-
function
|
|
1056
|
+
function qe(e, t) {
|
|
628
1057
|
for (var n = 0, r = 0, i = Math.min(e.t, this.t); n < i;) r += this[n] + e[n], t[n++] = r & this.DM, r >>= this.DB;
|
|
629
1058
|
if (e.t < this.t) {
|
|
630
1059
|
for (r += e.s; n < this.t;) r += this[n], t[n++] = r & this.DM, r >>= this.DB;
|
|
@@ -635,45 +1064,45 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
635
1064
|
}
|
|
636
1065
|
t.s = r < 0 ? -1 : 0, r > 0 ? t[n++] = r : r < -1 && (t[n++] = this.DV + r), t.t = n, t.clamp();
|
|
637
1066
|
}
|
|
638
|
-
function
|
|
1067
|
+
function Je(e) {
|
|
639
1068
|
var t = l();
|
|
640
1069
|
return this.addTo(e, t), t;
|
|
641
1070
|
}
|
|
642
|
-
function
|
|
1071
|
+
function Ye(e) {
|
|
643
1072
|
var t = l();
|
|
644
1073
|
return this.subTo(e, t), t;
|
|
645
1074
|
}
|
|
646
|
-
function
|
|
1075
|
+
function Xe(e) {
|
|
647
1076
|
var t = l();
|
|
648
1077
|
return this.multiplyTo(e, t), t;
|
|
649
1078
|
}
|
|
650
|
-
function
|
|
1079
|
+
function Ze() {
|
|
651
1080
|
var e = l();
|
|
652
1081
|
return this.squareTo(e), e;
|
|
653
1082
|
}
|
|
654
|
-
function
|
|
1083
|
+
function Qe(e) {
|
|
655
1084
|
var t = l();
|
|
656
1085
|
return this.divRemTo(e, t, null), t;
|
|
657
1086
|
}
|
|
658
|
-
function
|
|
1087
|
+
function $e(e) {
|
|
659
1088
|
var t = l();
|
|
660
1089
|
return this.divRemTo(e, null, t), t;
|
|
661
1090
|
}
|
|
662
|
-
function
|
|
1091
|
+
function et(e) {
|
|
663
1092
|
var t = l(), n = l();
|
|
664
1093
|
return this.divRemTo(e, t, n), [t, n];
|
|
665
1094
|
}
|
|
666
|
-
function
|
|
1095
|
+
function tt(e) {
|
|
667
1096
|
this[this.t] = this.am(0, e - 1, this, 0, 0, this.t), ++this.t, this.clamp();
|
|
668
1097
|
}
|
|
669
|
-
function
|
|
1098
|
+
function nt(e, t) {
|
|
670
1099
|
if (e != 0) {
|
|
671
1100
|
for (; this.t <= t;) this[this.t++] = 0;
|
|
672
1101
|
for (this[t] += e; this[t] >= this.DV;) this[t] -= this.DV, ++t >= this.t && (this[this.t++] = 0), ++this[t];
|
|
673
1102
|
}
|
|
674
1103
|
}
|
|
675
|
-
function
|
|
676
|
-
function
|
|
1104
|
+
function rt() {}
|
|
1105
|
+
function U(e) {
|
|
677
1106
|
return e;
|
|
678
1107
|
}
|
|
679
1108
|
function it(e, t, n) {
|
|
@@ -682,9 +1111,9 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
682
1111
|
function at(e, t) {
|
|
683
1112
|
e.squareTo(t);
|
|
684
1113
|
}
|
|
685
|
-
|
|
1114
|
+
rt.prototype.convert = U, rt.prototype.revert = U, rt.prototype.mulTo = it, rt.prototype.sqrTo = at;
|
|
686
1115
|
function ot(e) {
|
|
687
|
-
return this.exp(e, new
|
|
1116
|
+
return this.exp(e, new rt());
|
|
688
1117
|
}
|
|
689
1118
|
function st(e, t, n) {
|
|
690
1119
|
var r = Math.min(this.t + e.t, t);
|
|
@@ -727,7 +1156,7 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
727
1156
|
function ht(e, t) {
|
|
728
1157
|
var n = e.bitLength(), r, i = S(1), a;
|
|
729
1158
|
if (n <= 0) return i;
|
|
730
|
-
r = n < 18 ? 1 : n < 48 ? 3 : n < 144 ? 4 : n < 768 ? 5 : 6, a = n < 8 ? new
|
|
1159
|
+
r = n < 18 ? 1 : n < 48 ? 3 : n < 144 ? 4 : n < 768 ? 5 : 6, a = n < 8 ? new B(t) : t.isEven() ? new lt(t) : new H(t);
|
|
731
1160
|
var o = [], s = 3, c = r - 1, u = (1 << r) - 1;
|
|
732
1161
|
if (o[1] = a.convert(this), r > 1) {
|
|
733
1162
|
var d = l();
|
|
@@ -745,7 +1174,7 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
745
1174
|
}
|
|
746
1175
|
return a.revert(i);
|
|
747
1176
|
}
|
|
748
|
-
function
|
|
1177
|
+
function W(e) {
|
|
749
1178
|
var t = this.s < 0 ? this.negate() : this.clone(), n = e.s < 0 ? e.negate() : e.clone();
|
|
750
1179
|
if (t.compareTo(n) < 0) {
|
|
751
1180
|
var r = t;
|
|
@@ -756,7 +1185,7 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
756
1185
|
for (i < a && (a = i), a > 0 && (t.rShiftTo(a, t), n.rShiftTo(a, n)); t.signum() > 0;) (i = t.getLowestSetBit()) > 0 && t.rShiftTo(i, t), (i = n.getLowestSetBit()) > 0 && n.rShiftTo(i, n), t.compareTo(n) >= 0 ? (t.subTo(n, t), t.rShiftTo(1, t)) : (n.subTo(t, n), n.rShiftTo(1, n));
|
|
757
1186
|
return a > 0 && n.lShiftTo(a, n), n;
|
|
758
1187
|
}
|
|
759
|
-
function
|
|
1188
|
+
function gt(e) {
|
|
760
1189
|
if (e <= 0) return 0;
|
|
761
1190
|
var t = this.DV % e, n = this.s < 0 ? e - 1 : 0;
|
|
762
1191
|
if (this.t > 0) {
|
|
@@ -765,7 +1194,7 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
765
1194
|
}
|
|
766
1195
|
return n;
|
|
767
1196
|
}
|
|
768
|
-
function
|
|
1197
|
+
function _t(e) {
|
|
769
1198
|
var t = e.isEven();
|
|
770
1199
|
if (this.isEven() && t || e.signum() == 0) return c.ZERO;
|
|
771
1200
|
for (var n = e.clone(), r = this.clone(), i = S(1), a = S(0), o = S(0), s = S(1); n.signum() != 0;) {
|
|
@@ -779,7 +1208,7 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
779
1208
|
else return s;
|
|
780
1209
|
return s.signum() < 0 ? s.add(e) : s;
|
|
781
1210
|
}
|
|
782
|
-
var
|
|
1211
|
+
var G = [
|
|
783
1212
|
2,
|
|
784
1213
|
3,
|
|
785
1214
|
5,
|
|
@@ -948,27 +1377,27 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
948
1377
|
983,
|
|
949
1378
|
991,
|
|
950
1379
|
997
|
|
951
|
-
],
|
|
952
|
-
function
|
|
1380
|
+
], vt = (1 << 26) / G[G.length - 1];
|
|
1381
|
+
function yt(e) {
|
|
953
1382
|
var t, n = this.abs();
|
|
954
|
-
if (n.t == 1 && n[0] <=
|
|
955
|
-
for (t = 0; t <
|
|
1383
|
+
if (n.t == 1 && n[0] <= G[G.length - 1]) {
|
|
1384
|
+
for (t = 0; t < G.length; ++t) if (n[0] == G[t]) return !0;
|
|
956
1385
|
return !1;
|
|
957
1386
|
}
|
|
958
1387
|
if (n.isEven()) return !1;
|
|
959
|
-
for (t = 1; t <
|
|
960
|
-
for (var r =
|
|
961
|
-
for (r = n.modInt(r); t < i;) if (r %
|
|
1388
|
+
for (t = 1; t < G.length;) {
|
|
1389
|
+
for (var r = G[t], i = t + 1; i < G.length && r < vt;) r *= G[i++];
|
|
1390
|
+
for (r = n.modInt(r); t < i;) if (r % G[t++] == 0) return !1;
|
|
962
1391
|
}
|
|
963
1392
|
return n.millerRabin(e);
|
|
964
1393
|
}
|
|
965
|
-
function
|
|
1394
|
+
function bt(e) {
|
|
966
1395
|
var t = this.subtract(c.ONE), n = t.getLowestSetBit();
|
|
967
1396
|
if (n <= 0) return !1;
|
|
968
1397
|
var r = t.shiftRight(n);
|
|
969
|
-
e = e + 1 >> 1, e >
|
|
1398
|
+
e = e + 1 >> 1, e > G.length && (e = G.length);
|
|
970
1399
|
for (var i = l(), a = 0; a < e; ++a) {
|
|
971
|
-
i.fromInt(
|
|
1400
|
+
i.fromInt(G[Math.floor(Math.random() * G.length)]);
|
|
972
1401
|
var o = i.modPow(r, this);
|
|
973
1402
|
if (o.compareTo(c.ONE) != 0 && o.compareTo(t) != 0) {
|
|
974
1403
|
for (var s = 1; s++ < n && o.compareTo(t) != 0;) if (o = o.modPowInt(2, this), o.compareTo(c.ONE) == 0) return !1;
|
|
@@ -977,29 +1406,29 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
977
1406
|
}
|
|
978
1407
|
return !0;
|
|
979
1408
|
}
|
|
980
|
-
c.prototype.chunkSize =
|
|
981
|
-
var
|
|
982
|
-
if (
|
|
983
|
-
return this.compareTo(
|
|
984
|
-
},
|
|
1409
|
+
c.prototype.chunkSize = _e, c.prototype.toRadix = ye, c.prototype.fromRadix = be, c.prototype.fromNumber = xe, c.prototype.bitwiseTo = Ee, c.prototype.changeBit = Ue, c.prototype.addTo = qe, c.prototype.dMultiply = tt, c.prototype.dAddOffset = nt, c.prototype.multiplyLowerTo = st, c.prototype.multiplyUpperTo = ct, c.prototype.modInt = gt, c.prototype.millerRabin = bt, c.prototype.clone = pe, c.prototype.intValue = me, c.prototype.byteValue = he, c.prototype.shortValue = ge, c.prototype.signum = ve, c.prototype.toByteArray = Se, c.prototype.equals = Ce, c.prototype.min = we, c.prototype.max = Te, c.prototype.and = Oe, c.prototype.or = Ae, c.prototype.xor = Me, c.prototype.andNot = Pe, c.prototype.not = Fe, c.prototype.shiftLeft = Ie, c.prototype.shiftRight = Le, c.prototype.getLowestSetBit = ze, c.prototype.bitCount = Ve, c.prototype.testBit = He, c.prototype.setBit = We, c.prototype.clearBit = Ge, c.prototype.flipBit = Ke, c.prototype.add = Je, c.prototype.subtract = Ye, c.prototype.multiply = Xe, c.prototype.divide = Qe, c.prototype.remainder = $e, c.prototype.divideAndRemainder = et, c.prototype.modPow = ht, c.prototype.modInverse = _t, c.prototype.pow = ot, c.prototype.gcd = W, c.prototype.isProbablePrime = yt, c.prototype.square = Ze;
|
|
1410
|
+
var K = c;
|
|
1411
|
+
if (K.prototype.IsNegative = function() {
|
|
1412
|
+
return this.compareTo(K.ZERO) == -1;
|
|
1413
|
+
}, K.op_Equality = function(e, t) {
|
|
985
1414
|
return e.compareTo(t) == 0;
|
|
986
|
-
},
|
|
1415
|
+
}, K.op_Inequality = function(e, t) {
|
|
987
1416
|
return e.compareTo(t) != 0;
|
|
988
|
-
},
|
|
1417
|
+
}, K.op_GreaterThan = function(e, t) {
|
|
989
1418
|
return e.compareTo(t) > 0;
|
|
990
|
-
},
|
|
1419
|
+
}, K.op_LessThan = function(e, t) {
|
|
991
1420
|
return e.compareTo(t) < 0;
|
|
992
|
-
},
|
|
993
|
-
return new
|
|
994
|
-
},
|
|
995
|
-
return new
|
|
996
|
-
},
|
|
997
|
-
return new
|
|
998
|
-
},
|
|
1421
|
+
}, K.op_Addition = function(e, t) {
|
|
1422
|
+
return new K(e).add(new K(t));
|
|
1423
|
+
}, K.op_Subtraction = function(e, t) {
|
|
1424
|
+
return new K(e).subtract(new K(t));
|
|
1425
|
+
}, K.Int128Mul = function(e, t) {
|
|
1426
|
+
return new K(e).multiply(new K(t));
|
|
1427
|
+
}, K.op_Division = function(e, t) {
|
|
999
1428
|
return e.divide(t);
|
|
1000
|
-
},
|
|
1429
|
+
}, K.prototype.ToDouble = function() {
|
|
1001
1430
|
return parseFloat(this.toString());
|
|
1002
|
-
},
|
|
1431
|
+
}, q === void 0) var q = function(e, t) {
|
|
1003
1432
|
var n;
|
|
1004
1433
|
if (Object.getOwnPropertyNames === void 0) {
|
|
1005
1434
|
for (n in t.prototype) (e.prototype[n] === void 0 || e.prototype[n] == Object.prototype[n]) && (e.prototype[n] = t.prototype[n]);
|
|
@@ -1055,7 +1484,7 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
1055
1484
|
return this.m_Childs.length > 0 ? this.m_Childs[0] : null;
|
|
1056
1485
|
}, e.PolyTree.prototype.Total = function() {
|
|
1057
1486
|
return this.m_AllPolys.length;
|
|
1058
|
-
},
|
|
1487
|
+
}, q(e.PolyTree, e.PolyNode), e.Math_Abs_Int64 = e.Math_Abs_Int32 = e.Math_Abs_Double = function(e) {
|
|
1059
1488
|
return Math.abs(e);
|
|
1060
1489
|
}, e.Math_Max_Int32_Int32 = function(e, t) {
|
|
1061
1490
|
return Math.max(e, t);
|
|
@@ -1168,7 +1597,7 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
1168
1597
|
} while (r != n);
|
|
1169
1598
|
return !1;
|
|
1170
1599
|
}, e.ClipperBase.prototype.PointOnLineSegment = function(e, t, n, r) {
|
|
1171
|
-
return r ? e.X == t.X && e.Y == t.Y || e.X == n.X && e.Y == n.Y || e.X > t.X == e.X < n.X && e.Y > t.Y == e.Y < n.Y &&
|
|
1600
|
+
return r ? e.X == t.X && e.Y == t.Y || e.X == n.X && e.Y == n.Y || e.X > t.X == e.X < n.X && e.Y > t.Y == e.Y < n.Y && K.op_Equality(K.Int128Mul(e.X - t.X, n.Y - t.Y), K.Int128Mul(n.X - t.X, e.Y - t.Y)) : e.X == t.X && e.Y == t.Y || e.X == n.X && e.Y == n.Y || e.X > t.X == e.X < n.X && e.Y > t.Y == e.Y < n.Y && (e.X - t.X) * (n.Y - t.Y) == (n.X - t.X) * (e.Y - t.Y);
|
|
1172
1601
|
}, e.ClipperBase.prototype.PointOnPolygon = function(e, t, n) {
|
|
1173
1602
|
for (var r = t;;) {
|
|
1174
1603
|
if (this.PointOnLineSegment(e, r.Pt, r.Next.Pt, n)) return !0;
|
|
@@ -1177,13 +1606,13 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
1177
1606
|
return !1;
|
|
1178
1607
|
}, e.ClipperBase.prototype.SlopesEqual = e.ClipperBase.SlopesEqual = function() {
|
|
1179
1608
|
var t = arguments, n = t.length, r, i, a, o, s, c, l;
|
|
1180
|
-
return n == 3 ? (r = t[0], i = t[1], l = t[2], l ?
|
|
1609
|
+
return n == 3 ? (r = t[0], i = t[1], l = t[2], l ? K.op_Equality(K.Int128Mul(r.Delta.Y, i.Delta.X), K.Int128Mul(r.Delta.X, i.Delta.Y)) : e.Cast_Int64(r.Delta.Y * i.Delta.X) == e.Cast_Int64(r.Delta.X * i.Delta.Y)) : n == 4 ? (a = t[0], o = t[1], s = t[2], l = t[3], l ? K.op_Equality(K.Int128Mul(a.Y - o.Y, o.X - s.X), K.Int128Mul(a.X - o.X, o.Y - s.Y)) : e.Cast_Int64((a.Y - o.Y) * (o.X - s.X)) - e.Cast_Int64((a.X - o.X) * (o.Y - s.Y)) === 0) : (a = t[0], o = t[1], s = t[2], c = t[3], l = t[4], l ? K.op_Equality(K.Int128Mul(a.Y - o.Y, s.X - c.X), K.Int128Mul(a.X - o.X, s.Y - c.Y)) : e.Cast_Int64((a.Y - o.Y) * (s.X - c.X)) - e.Cast_Int64((a.X - o.X) * (s.Y - c.Y)) === 0);
|
|
1181
1610
|
}, e.ClipperBase.SlopesEqual3 = function(t, n, r) {
|
|
1182
|
-
return r ?
|
|
1611
|
+
return r ? K.op_Equality(K.Int128Mul(t.Delta.Y, n.Delta.X), K.Int128Mul(t.Delta.X, n.Delta.Y)) : e.Cast_Int64(t.Delta.Y * n.Delta.X) == e.Cast_Int64(t.Delta.X * n.Delta.Y);
|
|
1183
1612
|
}, e.ClipperBase.SlopesEqual4 = function(t, n, r, i) {
|
|
1184
|
-
return i ?
|
|
1613
|
+
return i ? K.op_Equality(K.Int128Mul(t.Y - n.Y, n.X - r.X), K.Int128Mul(t.X - n.X, n.Y - r.Y)) : e.Cast_Int64((t.Y - n.Y) * (n.X - r.X)) - e.Cast_Int64((t.X - n.X) * (n.Y - r.Y)) === 0;
|
|
1185
1614
|
}, e.ClipperBase.SlopesEqual5 = function(t, n, r, i, a) {
|
|
1186
|
-
return a ?
|
|
1615
|
+
return a ? K.op_Equality(K.Int128Mul(t.Y - n.Y, r.X - i.X), K.Int128Mul(t.X - n.X, r.Y - i.Y)) : e.Cast_Int64((t.Y - n.Y) * (r.X - i.X)) - e.Cast_Int64((t.X - n.X) * (r.Y - i.Y)) === 0;
|
|
1187
1616
|
}, e.ClipperBase.prototype.Clear = function() {
|
|
1188
1617
|
this.DisposeLocalMinimaList();
|
|
1189
1618
|
for (var t = 0, n = this.m_edges.length; t < n; ++t) {
|
|
@@ -1861,16 +2290,16 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
1861
2290
|
}
|
|
1862
2291
|
this.m_IntersectList.length = 0;
|
|
1863
2292
|
};
|
|
1864
|
-
var
|
|
2293
|
+
var xt = function(e) {
|
|
1865
2294
|
return e < 0 ? Math.ceil(e - .5) : Math.round(e);
|
|
1866
|
-
},
|
|
2295
|
+
}, St = function(e) {
|
|
1867
2296
|
return e < 0 ? Math.ceil(e - .5) : Math.floor(e + .5);
|
|
1868
|
-
},
|
|
2297
|
+
}, Ct = function(e) {
|
|
1869
2298
|
return e < 0 ? -Math.round(Math.abs(e)) : Math.round(e);
|
|
1870
|
-
},
|
|
2299
|
+
}, wt = function(e) {
|
|
1871
2300
|
return e < 0 ? (e -= .5, e < -2147483648 ? Math.ceil(e) : e | 0) : (e += .5, e > 2147483647 ? Math.floor(e) : e | 0);
|
|
1872
2301
|
};
|
|
1873
|
-
a.msie ? e.Clipper.Round =
|
|
2302
|
+
a.msie ? e.Clipper.Round = xt : a.chromium ? e.Clipper.Round = Ct : a.safari ? e.Clipper.Round = wt : e.Clipper.Round = St, e.Clipper.TopX = function(t, n) {
|
|
1874
2303
|
return n == t.Top.Y ? t.Top.X : t.Bot.X + e.Clipper.Round(t.Dx * (n - t.Bot.Y));
|
|
1875
2304
|
}, e.Clipper.prototype.IntersectPoint = function(t, n, r) {
|
|
1876
2305
|
r.X = 0, r.Y = 0;
|
|
@@ -2248,7 +2677,7 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
2248
2677
|
}, e.Clipper.ClosedPathsFromPolyTree = function(t) {
|
|
2249
2678
|
var n = new e.Paths();
|
|
2250
2679
|
return e.Clipper.AddPolyNodeToPaths(t, e.Clipper.NodeType.ntClosed, n), n;
|
|
2251
|
-
},
|
|
2680
|
+
}, q(e.Clipper, e.ClipperBase), e.Clipper.NodeType = {
|
|
2252
2681
|
ntAny: 0,
|
|
2253
2682
|
ntOpen: 1,
|
|
2254
2683
|
ntClosed: 2
|
|
@@ -2511,8 +2940,8 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
2511
2940
|
return n;
|
|
2512
2941
|
};
|
|
2513
2942
|
})();
|
|
2514
|
-
})),
|
|
2515
|
-
var n =
|
|
2943
|
+
})), Ee = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
2944
|
+
var n = Te(), r = 10 ** 5;
|
|
2516
2945
|
function i(e) {
|
|
2517
2946
|
return e.map(function(e) {
|
|
2518
2947
|
return {
|
|
@@ -2697,16 +3126,16 @@ var T = /* @__PURE__ */ o(((e, t) => {
|
|
|
2697
3126
|
Polygon: _,
|
|
2698
3127
|
ClipperLib: n
|
|
2699
3128
|
};
|
|
2700
|
-
})))(), 1),
|
|
3129
|
+
})))(), 1), De = 18, Oe = Object.freeze({
|
|
2701
3130
|
x: 0,
|
|
2702
3131
|
y: 0,
|
|
2703
3132
|
scalePercent: 100
|
|
2704
3133
|
});
|
|
2705
|
-
function
|
|
3134
|
+
function ke(e) {
|
|
2706
3135
|
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw TypeError("Bubble tail length must be greater than zero.");
|
|
2707
3136
|
return e;
|
|
2708
3137
|
}
|
|
2709
|
-
function
|
|
3138
|
+
function Ae(e) {
|
|
2710
3139
|
if (e.length !== 2 && e.length !== 3) throw TypeError("Bubble offset must be [x, y] or [x, y, scale].");
|
|
2711
3140
|
let [t, n, r = 100] = e;
|
|
2712
3141
|
if (![
|
|
@@ -2720,7 +3149,7 @@ function A(e) {
|
|
|
2720
3149
|
scalePercent: r
|
|
2721
3150
|
});
|
|
2722
3151
|
}
|
|
2723
|
-
var
|
|
3152
|
+
var je = Object.freeze([
|
|
2724
3153
|
"NORMAL",
|
|
2725
3154
|
"THINKING",
|
|
2726
3155
|
"DREAMING",
|
|
@@ -2732,21 +3161,21 @@ var j = Object.freeze([
|
|
|
2732
3161
|
"NARRATION",
|
|
2733
3162
|
"NO_BUBBLE"
|
|
2734
3163
|
]);
|
|
2735
|
-
function
|
|
3164
|
+
function Me(e) {
|
|
2736
3165
|
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
|
2737
3166
|
}
|
|
2738
|
-
function
|
|
3167
|
+
function Ne(e, t) {
|
|
2739
3168
|
let n = e ?? t;
|
|
2740
3169
|
if (!Number.isFinite(n) || n <= 0) throw TypeError("Bubble SVG dimensions must be positive and finite.");
|
|
2741
3170
|
return n;
|
|
2742
3171
|
}
|
|
2743
|
-
function
|
|
3172
|
+
function Pe(e) {
|
|
2744
3173
|
if (e === null) return null;
|
|
2745
3174
|
let t = e ?? 180;
|
|
2746
3175
|
if (!Number.isFinite(t)) throw TypeError("tailDirection must be finite.");
|
|
2747
3176
|
return (t % 360 + 360) % 360;
|
|
2748
3177
|
}
|
|
2749
|
-
function
|
|
3178
|
+
function Fe(e, t, n = 18) {
|
|
2750
3179
|
let r = e - 24, i = t - 24;
|
|
2751
3180
|
return [
|
|
2752
3181
|
{
|
|
@@ -2777,24 +3206,24 @@ function P(e, t, n = 18) {
|
|
|
2777
3206
|
};
|
|
2778
3207
|
}));
|
|
2779
3208
|
}
|
|
2780
|
-
function
|
|
3209
|
+
function Ie(e, t) {
|
|
2781
3210
|
return e.x * t.y - e.y * t.x;
|
|
2782
3211
|
}
|
|
2783
|
-
function
|
|
3212
|
+
function Le(e, t) {
|
|
2784
3213
|
return {
|
|
2785
3214
|
x: e.x - t.x,
|
|
2786
3215
|
y: e.y - t.y
|
|
2787
3216
|
};
|
|
2788
3217
|
}
|
|
2789
|
-
function
|
|
3218
|
+
function Re(e, t) {
|
|
2790
3219
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
2791
3220
|
}
|
|
2792
|
-
function
|
|
3221
|
+
function ze(e, t, n, r) {
|
|
2793
3222
|
let i = t, a = r;
|
|
2794
3223
|
for (; a > 0;) {
|
|
2795
3224
|
let t = (i + n + e.length) % e.length, r = e[i], o = e[t];
|
|
2796
3225
|
if (!r || !o) throw Error("Bubble border path is invalid.");
|
|
2797
|
-
let s =
|
|
3226
|
+
let s = Re(r, o);
|
|
2798
3227
|
if (a <= s) {
|
|
2799
3228
|
let e = a / s;
|
|
2800
3229
|
return {
|
|
@@ -2808,14 +3237,14 @@ function ie(e, t, n, r) {
|
|
|
2808
3237
|
if (!o) throw Error("Bubble border path is empty.");
|
|
2809
3238
|
return o;
|
|
2810
3239
|
}
|
|
2811
|
-
function
|
|
3240
|
+
function Be(e, t, n, r, i) {
|
|
2812
3241
|
let a;
|
|
2813
3242
|
for (let r = 0; r < e.length; r += 1) {
|
|
2814
3243
|
let i = e[r], o = e[(r + 1) % e.length];
|
|
2815
3244
|
if (!i || !o) continue;
|
|
2816
|
-
let s =
|
|
3245
|
+
let s = Le(o, i), c = Ie(n, s);
|
|
2817
3246
|
if (Math.abs(c) < 1e-9) continue;
|
|
2818
|
-
let l =
|
|
3247
|
+
let l = Le(i, t), u = Ie(l, s) / c, d = Ie(l, n) / c;
|
|
2819
3248
|
u < 0 || d < -1e-9 || d > 1 + 1e-9 || a && u >= a.rayScale || (a = {
|
|
2820
3249
|
edgeIndex: r,
|
|
2821
3250
|
point: {
|
|
@@ -2833,61 +3262,61 @@ function F(e, t, n, r, i) {
|
|
|
2833
3262
|
], s = a.edgeIndex + 1;
|
|
2834
3263
|
return {
|
|
2835
3264
|
borderPoint: a.point,
|
|
2836
|
-
base: [
|
|
3265
|
+
base: [ze(o, s, -1, 9), ze(o, s, 1, 9)],
|
|
2837
3266
|
tip: {
|
|
2838
3267
|
x: i?.x ?? t.x + n.x * (a.rayScale + r),
|
|
2839
3268
|
y: i?.y ?? t.y + n.y * (a.rayScale + r)
|
|
2840
3269
|
}
|
|
2841
3270
|
};
|
|
2842
3271
|
}
|
|
2843
|
-
function
|
|
3272
|
+
function Ve(e) {
|
|
2844
3273
|
let t = e * Math.PI / 180;
|
|
2845
3274
|
return {
|
|
2846
3275
|
x: Math.sin(t),
|
|
2847
3276
|
y: -Math.cos(t)
|
|
2848
3277
|
};
|
|
2849
3278
|
}
|
|
2850
|
-
function
|
|
3279
|
+
function He(e, t, n, r) {
|
|
2851
3280
|
return {
|
|
2852
3281
|
x: n.x + (e.x - t.x) * r,
|
|
2853
3282
|
y: n.y + (e.y - t.y) * r
|
|
2854
3283
|
};
|
|
2855
3284
|
}
|
|
2856
|
-
function
|
|
3285
|
+
function Ue(e, t, n, r, i, a) {
|
|
2857
3286
|
let o = {
|
|
2858
3287
|
x: t / 2,
|
|
2859
3288
|
y: n / 2
|
|
2860
|
-
}, s =
|
|
3289
|
+
}, s = Ve(r), c = Be(e, o, s, i), l = Re(o, c.borderPoint), u = a.scalePercent / 100, d = {
|
|
2861
3290
|
x: o.x - s.x * l * (u - 1) + a.x,
|
|
2862
3291
|
y: o.y - s.y * l * (u - 1) - a.y
|
|
2863
3292
|
};
|
|
2864
3293
|
return {
|
|
2865
|
-
body: e.map((e) =>
|
|
3294
|
+
body: e.map((e) => He(e, o, d, u)),
|
|
2866
3295
|
bodyCenter: d,
|
|
2867
3296
|
tip: c.tip
|
|
2868
3297
|
};
|
|
2869
3298
|
}
|
|
2870
|
-
function
|
|
3299
|
+
function We(e) {
|
|
2871
3300
|
let t = e[0];
|
|
2872
3301
|
if (!t) throw Error("Bubble polygon is empty.");
|
|
2873
3302
|
return `M ${t.x.toFixed(4)} ${t.y.toFixed(4)} ${e.slice(1).map(({ x: e, y: t }) => `L ${e.toFixed(4)} ${t.toFixed(4)}`).join(" ")} Z`;
|
|
2874
3303
|
}
|
|
2875
|
-
function
|
|
3304
|
+
function Ge(e) {
|
|
2876
3305
|
return Math.abs(e.reduce((t, n, r) => {
|
|
2877
3306
|
let i = e[(r + 1) % e.length];
|
|
2878
3307
|
return i ? t + n.x * i.y - i.x * n.y : t;
|
|
2879
3308
|
}, 0) / 2);
|
|
2880
3309
|
}
|
|
2881
|
-
function
|
|
2882
|
-
return `<path d="${
|
|
3310
|
+
function Ke(e, t, n, r = "") {
|
|
3311
|
+
return `<path d="${We(e)}" fill="${t}" stroke="${n}" stroke-width="3" stroke-linejoin="round" ${r}/>`;
|
|
2883
3312
|
}
|
|
2884
|
-
function
|
|
2885
|
-
let o =
|
|
3313
|
+
function qe(e, t, n, r, i, a = "") {
|
|
3314
|
+
let o = Le(n, t), s = Math.hypot(o.x, o.y);
|
|
2886
3315
|
if (!(s > 0)) throw TypeError("Bubble body center and tail tip must differ.");
|
|
2887
|
-
let c =
|
|
3316
|
+
let c = Be(e, t, {
|
|
2888
3317
|
x: o.x / s,
|
|
2889
3318
|
y: o.y / s
|
|
2890
|
-
}, 0, n), l = (e) => e.map(({ x: e, y: t }) => [e, t]), u =
|
|
3319
|
+
}, 0, n), l = (e) => e.map(({ x: e, y: t }) => [e, t]), u = Ee.default.union([l(e)], [[l([
|
|
2891
3320
|
c.base[0],
|
|
2892
3321
|
c.tip,
|
|
2893
3322
|
c.base[1]
|
|
@@ -2896,11 +3325,11 @@ function ce(e, t, n, r, i, a = "") {
|
|
|
2896
3325
|
let d = u.map((e) => e.map(([e, t]) => ({
|
|
2897
3326
|
x: e,
|
|
2898
3327
|
y: t
|
|
2899
|
-
}))).sort((e, t) =>
|
|
3328
|
+
}))).sort((e, t) => Ge(t) - Ge(e))[0];
|
|
2900
3329
|
if (!d) throw Error("JSClipper returned an empty Bubble outline.");
|
|
2901
|
-
return `<path d="${
|
|
3330
|
+
return `<path d="${We(d)}" fill="${r}" stroke="${i}" stroke-width="3" stroke-linejoin="round" data-boolean-operation="union" data-tail-base-on-border="true" ${a}/>`;
|
|
2902
3331
|
}
|
|
2903
|
-
function
|
|
3332
|
+
function Je(e, t, n, r) {
|
|
2904
3333
|
let i = e - 24, a = t - 24, o = e / 2, s = t / 2;
|
|
2905
3334
|
return `<path d="M 42 ${s}
|
|
2906
3335
|
C 22 ${s - 20}, 32 42, 60 44
|
|
@@ -2913,8 +3342,8 @@ function le(e, t, n, r) {
|
|
|
2913
3342
|
C 31 ${a + 2}, 17 ${s + 20}, 42 ${s} Z"
|
|
2914
3343
|
fill="${n}" stroke="${r}" stroke-width="3" stroke-linejoin="round"/>`;
|
|
2915
3344
|
}
|
|
2916
|
-
function
|
|
2917
|
-
let o =
|
|
3345
|
+
function Ye(e, t, n, r, i, a) {
|
|
3346
|
+
let o = Le(n, t), s = Math.hypot(o.x, o.y), c = Be(e, t, {
|
|
2918
3347
|
x: o.x / s,
|
|
2919
3348
|
y: o.y / s
|
|
2920
3349
|
}, 0, n), l = {
|
|
@@ -2942,7 +3371,7 @@ function ue(e, t, n, r, i, a) {
|
|
|
2942
3371
|
radius: 3.5
|
|
2943
3372
|
}]).map(({ ratio: e, radius: t }) => `<circle cx="${l.x + (c.tip.x - l.x) * e}" cy="${l.y + (c.tip.y - l.y) * e}" r="${t}" fill="${r}" stroke="${i}" stroke-width="2"/>`).join("");
|
|
2944
3373
|
}
|
|
2945
|
-
function
|
|
3374
|
+
function Xe(e, t) {
|
|
2946
3375
|
let n = e / 2, r = t / 2;
|
|
2947
3376
|
return Array.from({ length: 28 }, (i, a) => {
|
|
2948
3377
|
let o = a * Math.PI * 2 / 28 - Math.PI / 2, s = a % 2 == 0, c = s ? e / 2 - 6 : e / 2 - 22, l = s ? t / 2 - 6 : t / 2 - 22;
|
|
@@ -2952,7 +3381,7 @@ function de(e, t) {
|
|
|
2952
3381
|
};
|
|
2953
3382
|
});
|
|
2954
3383
|
}
|
|
2955
|
-
function
|
|
3384
|
+
function Ze(e, t) {
|
|
2956
3385
|
let n = e - 24, r = t - 24, i = Array.from({ length: 21 }, (e, t) => {
|
|
2957
3386
|
let n = t / 20;
|
|
2958
3387
|
return {
|
|
@@ -2985,61 +3414,61 @@ function fe(e, t) {
|
|
|
2985
3414
|
}))
|
|
2986
3415
|
];
|
|
2987
3416
|
}
|
|
2988
|
-
function
|
|
2989
|
-
return e === "YELLING" ?
|
|
3417
|
+
function Qe(e, t, n) {
|
|
3418
|
+
return e === "YELLING" ? Xe(t, n) : e === "WAVY" ? Ze(t, n) : Fe(t, n);
|
|
2990
3419
|
}
|
|
2991
|
-
function
|
|
2992
|
-
let t =
|
|
3420
|
+
function $e(e) {
|
|
3421
|
+
let t = Ne(e.width, 220), n = Ne(e.height, 112), r = Pe(e.tailDirection);
|
|
2993
3422
|
if (r === null) throw TypeError("Bubble body center offset requires a tail direction.");
|
|
2994
|
-
let i =
|
|
3423
|
+
let i = ke(e.tailLength ?? De), a = Ae(e.offset), o = {
|
|
2995
3424
|
x: t / 2,
|
|
2996
3425
|
y: n / 2
|
|
2997
|
-
}, s =
|
|
3426
|
+
}, s = Ue(Qe(e.style, t, n), t, n, r, i, a);
|
|
2998
3427
|
return Object.freeze({
|
|
2999
3428
|
x: s.bodyCenter.x - o.x,
|
|
3000
3429
|
y: s.bodyCenter.y - o.y
|
|
3001
3430
|
});
|
|
3002
3431
|
}
|
|
3003
|
-
function
|
|
3004
|
-
let c =
|
|
3005
|
-
if (r === null) return
|
|
3006
|
-
let l =
|
|
3007
|
-
return
|
|
3432
|
+
function et(e, t, n, r, i, a, o, s) {
|
|
3433
|
+
let c = Fe(t, n), l = (e) => r === null ? e : Ue(e, t, n, r, o, s).body, u = (e, c = "") => {
|
|
3434
|
+
if (r === null) return Ke(e, i, a, c);
|
|
3435
|
+
let l = Ue(e, t, n, r, o, s);
|
|
3436
|
+
return qe(l.body, l.bodyCenter, l.tip, i, a, c);
|
|
3008
3437
|
};
|
|
3009
3438
|
switch (e) {
|
|
3010
3439
|
case "NO_BUBBLE": return "";
|
|
3011
3440
|
case "THINKING":
|
|
3012
3441
|
case "DREAMING": {
|
|
3013
|
-
if (r === null) return
|
|
3014
|
-
let l =
|
|
3442
|
+
if (r === null) return Je(t, n, i, a);
|
|
3443
|
+
let l = Ue(c, t, n, r, o, s), u = s.scalePercent / 100, d = {
|
|
3015
3444
|
x: t / 2,
|
|
3016
3445
|
y: n / 2
|
|
3017
3446
|
}, f = l.bodyCenter.x - d.x * u, p = l.bodyCenter.y - d.y * u;
|
|
3018
|
-
return `${
|
|
3447
|
+
return `${Ye(l.body, l.bodyCenter, l.tip, i, a, e === "DREAMING")}<g transform="translate(${f} ${p}) scale(${u})">${Je(t, n, i, a)}</g>`;
|
|
3019
3448
|
}
|
|
3020
|
-
case "YELLING": return u(
|
|
3021
|
-
case "WAVY": return u(
|
|
3449
|
+
case "YELLING": return u(Xe(t, n));
|
|
3450
|
+
case "WAVY": return u(Ze(t, n));
|
|
3022
3451
|
case "WHISPERING": return u(c, "stroke-dasharray=\"5 5\"");
|
|
3023
3452
|
case "ANNOUNCEMENT": return `${u(c)}<rect x="30" y="30" width="${t - 60}" height="${n - 60}" rx="13" fill="none" stroke="${a}" stroke-width="1.5"/>`;
|
|
3024
|
-
case "NARRATION": return
|
|
3453
|
+
case "NARRATION": return Ke(l(c), i, a);
|
|
3025
3454
|
case "OFF_PANEL": return u(c);
|
|
3026
3455
|
case "NORMAL": return u(c);
|
|
3027
3456
|
}
|
|
3028
3457
|
}
|
|
3029
|
-
function
|
|
3030
|
-
if (!
|
|
3458
|
+
function tt(e) {
|
|
3459
|
+
if (!je.includes(e.style)) throw TypeError(`Unsupported Bubble visual style: ${String(e.style)}`);
|
|
3031
3460
|
if (!Array.isArray(e.lines) || e.lines.some((e) => typeof e != "string")) throw TypeError("lines must be an array of strings.");
|
|
3032
|
-
let t =
|
|
3033
|
-
if (s !== void 0 && (!
|
|
3461
|
+
let t = Ne(e.width, 220), n = Ne(e.height, 112), r = Ne(e.fontSize, 15), i = Pe(e.tailDirection), a = ke(e.tailLength ?? De), o = e.offset === void 0 ? Oe : Ae(e.offset), s = e.shapeTransition;
|
|
3462
|
+
if (s !== void 0 && (!je.includes(s.from) || !je.includes(s.to) || !Number.isFinite(s.progress) || s.progress < 0 || s.progress > 1)) throw TypeError("Bubble shape transition is invalid.");
|
|
3034
3463
|
let c = e.fillColor ?? "#fff4cc", l = e.borderColor ?? "#6f5b45", u = e.textColor ?? "#25283a", d = e.fontFamily ?? "Noto Sans JP, sans-serif", f = r * 1.35, p = n / 2 - (e.lines.length - 1) * f / 2 + r * .35, m = i === null ? 1 : o.scalePercent / 100, h = i === null ? {
|
|
3035
3464
|
x: t / 2,
|
|
3036
3465
|
y: n / 2
|
|
3037
|
-
} :
|
|
3466
|
+
} : Ue(Fe(t, n), t, n, i, a, o).bodyCenter, g = e.lines.map((e, t) => `<text x="${h.x}" y="${h.y + (p + t * f - n / 2) * m}" text-anchor="middle" fill="${Me(u)}" font-family="${Me(d)}" font-size="${r * m}">${Me(e)}</text>`).join(""), _ = s === void 0 ? et(e.style, t, n, i, c, l, a, o) : `<g opacity="${(1 - s.progress).toFixed(4)}">${et(s.from, t, n, i, c, l, a, o)}</g><g opacity="${s.progress.toFixed(4)}">${et(s.to, t, n, i, c, l, a, o)}</g>`, v = Me(e.title ?? `${e.style} bubble`), y = s === void 0 ? "" : ` data-bubble-shape-transition-from="${s.from}" data-bubble-shape-transition-to="${s.to}" data-bubble-shape-transition-progress="${s.progress.toFixed(4)}"`;
|
|
3038
3467
|
return `<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}" viewBox="0 0 ${t} ${n}" role="img" data-bubble-renderer="canonical" data-bubble-style="${e.style}"${y}><title>${v}</title>${_}${g}</svg>`;
|
|
3039
3468
|
}
|
|
3040
3469
|
//#endregion
|
|
3041
3470
|
//#region node_modules/.pnpm/@cto.af+unicode-trie-runtime@3.2.9/node_modules/@cto.af/unicode-trie-runtime/constants.js
|
|
3042
|
-
var
|
|
3471
|
+
var nt = 2048, rt = 2112, U = Uint8Array, it = Uint16Array, at = Int32Array, ot = new U([
|
|
3043
3472
|
0,
|
|
3044
3473
|
0,
|
|
3045
3474
|
0,
|
|
@@ -3072,7 +3501,7 @@ var _e = 2048, ve = 2112, z = Uint8Array, ye = Uint16Array, be = Int32Array, xe
|
|
|
3072
3501
|
0,
|
|
3073
3502
|
0,
|
|
3074
3503
|
0
|
|
3075
|
-
]),
|
|
3504
|
+
]), st = new U([
|
|
3076
3505
|
0,
|
|
3077
3506
|
0,
|
|
3078
3507
|
0,
|
|
@@ -3105,7 +3534,7 @@ var _e = 2048, ve = 2112, z = Uint8Array, ye = Uint16Array, be = Int32Array, xe
|
|
|
3105
3534
|
13,
|
|
3106
3535
|
0,
|
|
3107
3536
|
0
|
|
3108
|
-
]),
|
|
3537
|
+
]), ct = new U([
|
|
3109
3538
|
16,
|
|
3110
3539
|
17,
|
|
3111
3540
|
18,
|
|
@@ -3125,51 +3554,51 @@ var _e = 2048, ve = 2112, z = Uint8Array, ye = Uint16Array, be = Int32Array, xe
|
|
|
3125
3554
|
14,
|
|
3126
3555
|
1,
|
|
3127
3556
|
15
|
|
3128
|
-
]),
|
|
3129
|
-
for (var n = new
|
|
3130
|
-
for (var i = new
|
|
3557
|
+
]), lt = function(e, t) {
|
|
3558
|
+
for (var n = new it(31), r = 0; r < 31; ++r) n[r] = t += 1 << e[r - 1];
|
|
3559
|
+
for (var i = new at(n[30]), r = 1; r < 30; ++r) for (var a = n[r]; a < n[r + 1]; ++a) i[a] = a - n[r] << 5 | r;
|
|
3131
3560
|
return {
|
|
3132
3561
|
b: n,
|
|
3133
3562
|
r: i
|
|
3134
3563
|
};
|
|
3135
|
-
},
|
|
3136
|
-
|
|
3137
|
-
var
|
|
3138
|
-
|
|
3139
|
-
for (var
|
|
3140
|
-
var
|
|
3141
|
-
|
|
3142
|
-
}
|
|
3143
|
-
for (var
|
|
3144
|
-
for (var r = e.length, i = 0, a = new
|
|
3145
|
-
var o = new
|
|
3564
|
+
}, ut = lt(ot, 2), dt = ut.b, ft = ut.r;
|
|
3565
|
+
dt[28] = 258, ft[258] = 28;
|
|
3566
|
+
var pt = lt(st, 0), mt = pt.b;
|
|
3567
|
+
pt.r;
|
|
3568
|
+
for (var ht = new it(32768), W = 0; W < 32768; ++W) {
|
|
3569
|
+
var gt = (W & 43690) >> 1 | (W & 21845) << 1;
|
|
3570
|
+
gt = (gt & 52428) >> 2 | (gt & 13107) << 2, gt = (gt & 61680) >> 4 | (gt & 3855) << 4, ht[W] = ((gt & 65280) >> 8 | (gt & 255) << 8) >> 1;
|
|
3571
|
+
}
|
|
3572
|
+
for (var _t = (function(e, t, n) {
|
|
3573
|
+
for (var r = e.length, i = 0, a = new it(t); i < r; ++i) e[i] && ++a[e[i] - 1];
|
|
3574
|
+
var o = new it(t);
|
|
3146
3575
|
for (i = 1; i < t; ++i) o[i] = o[i - 1] + a[i - 1] << 1;
|
|
3147
3576
|
var s;
|
|
3148
3577
|
if (n) {
|
|
3149
|
-
s = new
|
|
3578
|
+
s = new it(1 << t);
|
|
3150
3579
|
var c = 15 - t;
|
|
3151
|
-
for (i = 0; i < r; ++i) if (e[i]) for (var l = i << 4 | e[i], u = t - e[i], d = o[e[i] - 1]++ << u, f = d | (1 << u) - 1; d <= f; ++d) s[
|
|
3152
|
-
} else for (s = new
|
|
3580
|
+
for (i = 0; i < r; ++i) if (e[i]) for (var l = i << 4 | e[i], u = t - e[i], d = o[e[i] - 1]++ << u, f = d | (1 << u) - 1; d <= f; ++d) s[ht[d] >> c] = l;
|
|
3581
|
+
} else for (s = new it(r), i = 0; i < r; ++i) e[i] && (s[i] = ht[o[e[i] - 1]++] >> 15 - e[i]);
|
|
3153
3582
|
return s;
|
|
3154
|
-
}),
|
|
3155
|
-
for (var
|
|
3156
|
-
for (var
|
|
3157
|
-
for (var
|
|
3158
|
-
for (var
|
|
3159
|
-
var
|
|
3583
|
+
}), G = new U(288), W = 0; W < 144; ++W) G[W] = 8;
|
|
3584
|
+
for (var W = 144; W < 256; ++W) G[W] = 9;
|
|
3585
|
+
for (var W = 256; W < 280; ++W) G[W] = 7;
|
|
3586
|
+
for (var W = 280; W < 288; ++W) G[W] = 8;
|
|
3587
|
+
for (var vt = new U(32), W = 0; W < 32; ++W) vt[W] = 5;
|
|
3588
|
+
var yt = /*#__PURE__*/ _t(G, 9, 1), bt = /*#__PURE__*/ _t(vt, 5, 1), K = function(e) {
|
|
3160
3589
|
for (var t = e[0], n = 1; n < e.length; ++n) e[n] > t && (t = e[n]);
|
|
3161
3590
|
return t;
|
|
3162
|
-
},
|
|
3591
|
+
}, q = function(e, t, n) {
|
|
3163
3592
|
var r = t / 8 | 0;
|
|
3164
3593
|
return (e[r] | e[r + 1] << 8) >> (t & 7) & n;
|
|
3165
|
-
},
|
|
3594
|
+
}, xt = function(e, t) {
|
|
3166
3595
|
var n = t / 8 | 0;
|
|
3167
3596
|
return (e[n] | e[n + 1] << 8 | e[n + 2] << 16) >> (t & 7);
|
|
3168
|
-
},
|
|
3597
|
+
}, St = function(e) {
|
|
3169
3598
|
return (e + 7) / 8 | 0;
|
|
3170
|
-
},
|
|
3171
|
-
return (t == null || t < 0) && (t = 0), (n == null || n > e.length) && (n = e.length), new
|
|
3172
|
-
},
|
|
3599
|
+
}, Ct = function(e, t, n) {
|
|
3600
|
+
return (t == null || t < 0) && (t = 0), (n == null || n > e.length) && (n = e.length), new U(e.subarray(t, n));
|
|
3601
|
+
}, wt = [
|
|
3173
3602
|
"unexpected EOF",
|
|
3174
3603
|
"invalid block type",
|
|
3175
3604
|
"invalid length/literal",
|
|
@@ -3184,121 +3613,121 @@ var Pe = /*#__PURE__*/ je(Me, 9, 1), Fe = /*#__PURE__*/ je(Ne, 5, 1), Ie = funct
|
|
|
3184
3613
|
"filename too long",
|
|
3185
3614
|
"stream finishing",
|
|
3186
3615
|
"invalid zip data"
|
|
3187
|
-
],
|
|
3188
|
-
var r = Error(t ||
|
|
3189
|
-
if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r,
|
|
3616
|
+
], Tt = function(e, t, n) {
|
|
3617
|
+
var r = Error(t || wt[e]);
|
|
3618
|
+
if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r, Tt), !n) throw r;
|
|
3190
3619
|
return r;
|
|
3191
|
-
},
|
|
3620
|
+
}, Et = function(e, t, n, r) {
|
|
3192
3621
|
var i = e.length, a = r ? r.length : 0;
|
|
3193
|
-
if (!i || t.f && !t.l) return n || new
|
|
3622
|
+
if (!i || t.f && !t.l) return n || new U(0);
|
|
3194
3623
|
var o = !n, s = o || t.i != 2, c = t.i;
|
|
3195
|
-
o && (n = new
|
|
3624
|
+
o && (n = new U(i * 3));
|
|
3196
3625
|
var l = function(e) {
|
|
3197
3626
|
var t = n.length;
|
|
3198
3627
|
if (e > t) {
|
|
3199
|
-
var r = new
|
|
3628
|
+
var r = new U(Math.max(t * 2, e));
|
|
3200
3629
|
r.set(n), n = r;
|
|
3201
3630
|
}
|
|
3202
3631
|
}, u = t.f || 0, d = t.p || 0, f = t.b || 0, p = t.l, m = t.d, h = t.m, g = t.n, _ = i * 8;
|
|
3203
3632
|
do {
|
|
3204
3633
|
if (!p) {
|
|
3205
|
-
u =
|
|
3206
|
-
var v =
|
|
3634
|
+
u = q(e, d, 1);
|
|
3635
|
+
var v = q(e, d + 1, 3);
|
|
3207
3636
|
if (d += 3, !v) {
|
|
3208
|
-
var y =
|
|
3637
|
+
var y = St(d) + 4, b = e[y - 4] | e[y - 3] << 8, x = y + b;
|
|
3209
3638
|
if (x > i) {
|
|
3210
|
-
c &&
|
|
3639
|
+
c && Tt(0);
|
|
3211
3640
|
break;
|
|
3212
3641
|
}
|
|
3213
3642
|
s && l(f + b), n.set(e.subarray(y, x), f), t.b = f += b, t.p = d = x * 8, t.f = u;
|
|
3214
3643
|
continue;
|
|
3215
3644
|
}
|
|
3216
|
-
if (v == 1) p =
|
|
3645
|
+
if (v == 1) p = yt, m = bt, h = 9, g = 5;
|
|
3217
3646
|
else if (v == 2) {
|
|
3218
|
-
var S =
|
|
3647
|
+
var S = q(e, d, 31) + 257, C = q(e, d + 10, 15) + 4, w = S + q(e, d + 5, 31) + 1;
|
|
3219
3648
|
d += 14;
|
|
3220
|
-
for (var T = new
|
|
3649
|
+
for (var T = new U(w), E = new U(19), D = 0; D < C; ++D) E[ct[D]] = q(e, d + D * 3, 7);
|
|
3221
3650
|
d += C * 3;
|
|
3222
|
-
for (var O =
|
|
3223
|
-
var j = A[
|
|
3651
|
+
for (var O = K(E), k = (1 << O) - 1, A = _t(E, O, 1), D = 0; D < w;) {
|
|
3652
|
+
var j = A[q(e, d, k)];
|
|
3224
3653
|
d += j & 15;
|
|
3225
3654
|
var y = j >> 4;
|
|
3226
3655
|
if (y < 16) T[D++] = y;
|
|
3227
3656
|
else {
|
|
3228
3657
|
var M = 0, N = 0;
|
|
3229
|
-
for (y == 16 ? (N = 3 +
|
|
3658
|
+
for (y == 16 ? (N = 3 + q(e, d, 3), d += 2, M = T[D - 1]) : y == 17 ? (N = 3 + q(e, d, 7), d += 3) : y == 18 && (N = 11 + q(e, d, 127), d += 7); N--;) T[D++] = M;
|
|
3230
3659
|
}
|
|
3231
3660
|
}
|
|
3232
|
-
var
|
|
3233
|
-
h =
|
|
3234
|
-
} else
|
|
3661
|
+
var P = T.subarray(0, S), F = T.subarray(S);
|
|
3662
|
+
h = K(P), g = K(F), p = _t(P, h, 1), m = _t(F, g, 1);
|
|
3663
|
+
} else Tt(1);
|
|
3235
3664
|
if (d > _) {
|
|
3236
|
-
c &&
|
|
3665
|
+
c && Tt(0);
|
|
3237
3666
|
break;
|
|
3238
3667
|
}
|
|
3239
3668
|
}
|
|
3240
3669
|
s && l(f + 131072);
|
|
3241
|
-
for (var
|
|
3242
|
-
var M = p[
|
|
3670
|
+
for (var I = (1 << h) - 1, L = (1 << g) - 1, R = d;; R = d) {
|
|
3671
|
+
var M = p[xt(e, d) & I], z = M >> 4;
|
|
3243
3672
|
if (d += M & 15, d > _) {
|
|
3244
|
-
c &&
|
|
3673
|
+
c && Tt(0);
|
|
3245
3674
|
break;
|
|
3246
3675
|
}
|
|
3247
|
-
if (M ||
|
|
3248
|
-
else if (
|
|
3249
|
-
|
|
3676
|
+
if (M || Tt(2), z < 256) n[f++] = z;
|
|
3677
|
+
else if (z == 256) {
|
|
3678
|
+
R = d, p = null;
|
|
3250
3679
|
break;
|
|
3251
3680
|
} else {
|
|
3252
|
-
var
|
|
3253
|
-
if (
|
|
3254
|
-
var D =
|
|
3255
|
-
|
|
3681
|
+
var B = z - 254;
|
|
3682
|
+
if (z > 264) {
|
|
3683
|
+
var D = z - 257, ee = ot[D];
|
|
3684
|
+
B = q(e, d, (1 << ee) - 1) + dt[D], d += ee;
|
|
3256
3685
|
}
|
|
3257
|
-
var
|
|
3258
|
-
|
|
3259
|
-
var
|
|
3260
|
-
if (
|
|
3261
|
-
var
|
|
3262
|
-
|
|
3686
|
+
var te = m[xt(e, d) & L], ne = te >> 4;
|
|
3687
|
+
te || Tt(3), d += te & 15;
|
|
3688
|
+
var F = mt[ne];
|
|
3689
|
+
if (ne > 3) {
|
|
3690
|
+
var ee = st[ne];
|
|
3691
|
+
F += xt(e, d) & (1 << ee) - 1, d += ee;
|
|
3263
3692
|
}
|
|
3264
3693
|
if (d > _) {
|
|
3265
|
-
c &&
|
|
3694
|
+
c && Tt(0);
|
|
3266
3695
|
break;
|
|
3267
3696
|
}
|
|
3268
3697
|
s && l(f + 131072);
|
|
3269
|
-
var
|
|
3270
|
-
if (f <
|
|
3271
|
-
var
|
|
3272
|
-
for (
|
|
3698
|
+
var re = f + B;
|
|
3699
|
+
if (f < F) {
|
|
3700
|
+
var ie = a - F, V = Math.min(F, re);
|
|
3701
|
+
for (ie + f < 0 && Tt(3); f < V; ++f) n[f] = r[ie + f];
|
|
3273
3702
|
}
|
|
3274
|
-
for (; f <
|
|
3703
|
+
for (; f < re; ++f) n[f] = n[f - F];
|
|
3275
3704
|
}
|
|
3276
3705
|
}
|
|
3277
|
-
t.l = p, t.p =
|
|
3706
|
+
t.l = p, t.p = R, t.b = f, t.f = u, p && (u = 1, t.m = h, t.d = m, t.n = g);
|
|
3278
3707
|
} while (!u);
|
|
3279
|
-
return f != n.length && o ?
|
|
3280
|
-
},
|
|
3281
|
-
(e[0] != 31 || e[1] != 139 || e[2] != 8) &&
|
|
3708
|
+
return f != n.length && o ? Ct(n, 0, f) : n.subarray(0, f);
|
|
3709
|
+
}, Dt = /*#__PURE__*/ new U(0), Ot = function(e) {
|
|
3710
|
+
(e[0] != 31 || e[1] != 139 || e[2] != 8) && Tt(6, "invalid gzip data");
|
|
3282
3711
|
var t = e[3], n = 10;
|
|
3283
3712
|
t & 4 && (n += (e[10] | e[11] << 8) + 2);
|
|
3284
3713
|
for (var r = (t >> 3 & 1) + (t >> 4 & 1); r > 0; r -= !e[n++]);
|
|
3285
3714
|
return n + (t & 2);
|
|
3286
|
-
},
|
|
3715
|
+
}, kt = function(e) {
|
|
3287
3716
|
var t = e.length;
|
|
3288
3717
|
return (e[t - 4] | e[t - 3] << 8 | e[t - 2] << 16 | e[t - 1] << 24) >>> 0;
|
|
3289
3718
|
};
|
|
3290
|
-
function
|
|
3291
|
-
var n =
|
|
3292
|
-
return n + 8 > e.length &&
|
|
3719
|
+
function At(e, t) {
|
|
3720
|
+
var n = Ot(e);
|
|
3721
|
+
return n + 8 > e.length && Tt(6, "invalid gzip data"), Et(e.subarray(n, -8), { i: 2 }, t && t.out || new U(kt(e)), t && t.dictionary);
|
|
3293
3722
|
}
|
|
3294
|
-
var
|
|
3723
|
+
var jt = typeof TextDecoder < "u" && /*#__PURE__*/ new TextDecoder();
|
|
3295
3724
|
try {
|
|
3296
|
-
|
|
3725
|
+
jt.decode(Dt, { stream: !0 });
|
|
3297
3726
|
} catch {}
|
|
3298
3727
|
//#endregion
|
|
3299
3728
|
//#region node_modules/.pnpm/@cto.af+unicode-trie-runtime@3.2.9/node_modules/@cto.af/unicode-trie-runtime/swap.js
|
|
3300
|
-
var
|
|
3301
|
-
function
|
|
3729
|
+
var Mt = new Uint8Array(new Uint32Array([305419896]).buffer)[0] === 18;
|
|
3730
|
+
function Nt(e) {
|
|
3302
3731
|
let t = e.length;
|
|
3303
3732
|
for (let n = 0; n < t; n += 4) [e[n], e[n + 1], e[n + 2], e[n + 3]] = [
|
|
3304
3733
|
e[n + 3],
|
|
@@ -3307,15 +3736,15 @@ function Je(e) {
|
|
|
3307
3736
|
e[n]
|
|
3308
3737
|
];
|
|
3309
3738
|
}
|
|
3310
|
-
function
|
|
3311
|
-
var
|
|
3739
|
+
function Pt(e) {}
|
|
3740
|
+
var Ft = Mt ? Nt : Pt, It = new TextDecoder(), Lt = class e {
|
|
3312
3741
|
constructor(e) {
|
|
3313
3742
|
if (e instanceof Uint8Array) {
|
|
3314
3743
|
let t = 0, n = new DataView(e.buffer);
|
|
3315
3744
|
if (this.highStart = n.getUint32(0, !0), this.errorValue = n.getUint32(4, !0), t = n.getUint32(8, !0), t !== 4294967295) throw Error("Trie created with old version of @cto.af/unicode-trie.");
|
|
3316
3745
|
if (t = n.getUint32(12, !0), 16 + t > e.byteLength) throw RangeError("Invalid input length");
|
|
3317
3746
|
let r = e.subarray(16 + t);
|
|
3318
|
-
this.values = r.length ? JSON.parse(
|
|
3747
|
+
this.values = r.length ? JSON.parse(It.decode(At(r))) : [], e = At(e.subarray(16, 16 + t)), Ft(e), this.data = new Int32Array(e.buffer);
|
|
3319
3748
|
} else ({data: this.data, highStart: this.highStart, errorValue: this.errorValue, values: this.values = []} = e);
|
|
3320
3749
|
}
|
|
3321
3750
|
static fromBase64(t) {
|
|
@@ -3328,10 +3757,10 @@ var Xe = qe ? Je : Ye, Ze = new TextDecoder(), Qe = class e {
|
|
|
3328
3757
|
let n = (this.data[e >> 5] << 2) + (e & 31);
|
|
3329
3758
|
t = this.data[n];
|
|
3330
3759
|
} else if (e <= 65535) {
|
|
3331
|
-
let n = (this.data[
|
|
3760
|
+
let n = (this.data[nt + (e - 55296 >> 5)] << 2) + (e & 31);
|
|
3332
3761
|
t = this.data[n];
|
|
3333
3762
|
} else if (e < this.highStart) {
|
|
3334
|
-
let n = this.data[
|
|
3763
|
+
let n = this.data[rt - 32 + (e >> 11)];
|
|
3335
3764
|
n = this.data[n + (e >> 5 & 63)], n = (n << 2) + (e & 31), t = this.data[n];
|
|
3336
3765
|
} else t = this.data[this.data.length - 4];
|
|
3337
3766
|
return t;
|
|
@@ -3340,26 +3769,26 @@ var Xe = qe ? Je : Ye, Ze = new TextDecoder(), Qe = class e {
|
|
|
3340
3769
|
let t = this.get(e);
|
|
3341
3770
|
return this.values[t] ?? t;
|
|
3342
3771
|
}
|
|
3343
|
-
},
|
|
3344
|
-
function
|
|
3772
|
+
}, Rt = Lt.fromBase64("AAgOAAEAAAD/////nRQAAB+LCAC4xcFoAgPtnQnwlkUdx1+URLxABcUUghTEEK8Cmwp0LJAa\n MRrFbBSPSXHSAUYNdFQoBWMKyQrUCo/EyMIjD3TIAxXJM5NBHBm0RDSPzDOVdAz7/nB/07bt\n s8/e+/zhfef9zD7HPs/e129/u8/yzVutVWANeBl079xq9QJ9wUCwDxjqYQ4DI8BoMBYcBY4D\n 48FEw3NTwDTp/BxwAZgJLgaXgCvAAnADuA3cDe4Hj0rPLQerwLPgJfAaeBe8Az4EnT/Ram0D\n eoBdwe5gENgX0DsOhHkQGAlGgTHgaHACGA8mgilgGpgBLgJzweVgPlgIbgF3iPOl4BGwAqwG\n a8Er4C2wDnwEumzRanUDPUFv0B8MBgeAL4BDwNfAN8C3wIngO+A0cCZowd/nwrwA/Eic/wzm\n L8EMHM+HuRDcDP4g7t8Hk3hYmI8BCv+TwvwLTOZvglfBawKyQ7wrjv8Ns1OXVqsroPNuwuwJ\n szfoL86JwTgeIp3HYJj0vhE4Hg3GgnHgZMDhnYDjyWCqZP9CHM8Gc8S1y2BeBa4FvweLxPN3\n wVwq7Dwirp0KVuB4NVgLXgSvg/fA+6C1Jf6gO+gF+oI9wQa3YQ4FwwDlwREwR4Mj+L6GY3Dv\n eMN9OY7JPAV2Jwn7Z8E8F0wHs8AcMA9cA64Dt4I7wT3gQfA4eAI8DdaKd7wizLdgvg86dUWa\n g+1BL0D3+sIcAAaLc5X9xfUDYR4EDlUYJR2PAUeCY8FJ4DRwJjgXTAezwBwwD1wDrgO3gjuF\n G/fAfBA8Js5XwnwaPF/htypeFfbfhvm+w7OdtkL6Axe3thP2uSzuhPM+YICA6tZ9YA4FwwGV\n 55F0XTBGOlY5GhwHxoOJYAqYBn4AfiyOLwVXgvnSc9dKxzeC28XxEoNbbdq0iQvXEe24aNOm\n TZs2bdq0aePC0ob55yFhPg5IHlI3Rl4Je8+I/vALMN+T7v3DMN5+B/c+BJ23hhwQ0LUeMM+G\n OQrshuM9AMkJ94b5WfBF8GVwKPg6+CYgOc7xME8BLFsiJuH8LPA9MFO8/yJhMnNxfjm4AlwJ\n rgK/AleD+e177Xvte+177XvR7/0O3ARuBSQzLcmd8ENJSoe/TZsmE9qfvR9l7FHwhNL3c+Ep\n zbPP4trz4FXwT/AB2Gyb/7WzJc67g16gLxgIBgOasxkCcxgoXf/c2+1jDu7ean0fLDbwDvjc\n 9pi7Aj8H8r1V4vxlmLvtgLlCMBesBNvs+PG9g2GeBxaB5aB7j1brOczh9UN8nAiuBs8BGg8c\n BqgP/xOqI2n+VvAQzile53T6L6NwLts5G+eLwSpxfT3M4dtiTg0sAevB8O1wDuT35GZJA9yX\n 461NmzZtNiXWow6cTrpKaCNGU3uhtPNjcW0cOEFq28fjeAI4HUwWz8iQbIvsrYM5VTw3HSbp\n Fs2EebG4dpnGPYL0hM4n3SfcXyDsLhTmzTBvA3eI86VKn6MK0lshfao/kt9x/pjk7ydFW7lG\n vIt0rl4W99+EuQ58BEh3jP3bBW1oVxHObjjeCfQB7B7bG8DXYJ5OelYwvwS+Ath9fuY0KT4O\n E88dKcxjYJIs8NswT5WeVSG/k/0zYOcccL54nuLvh+QHmD8V5jJA8fILnP8Lz10N87eAdMRu\n grlY9Bfo/AGYfwYrxPl9eOdqHK8l/+D47zDfFv76AOZmyFeTcLwVzB1AL9AXDAT7gSFgGBgB\n yH87ks4ZjseK86+CcdQ+a8JI90/GvQniPtufjPOp4vkLYc4Gc8Hl4NfgesP7Fin3OE3uwvVl\n 4BGwQrKzGsd/BS+C18Hb4APhdif0J7sC1unbHsf83C7SMd3vh/O9yC4YCoaBQ8Aoyd4YHB8J\n jgUngVMBlQ8qG2dI9nScg/sXgJngYsnupTi+EvxG+DMnXI7UuCZuNPjn9pqwboxQOeXwc50Q\n gyUinh8wxPfDFfeW4/qqAvmmaVDb6PvsGiX+XvLM2/1Qb76xEZeLGOlEdTC1i+tEnNMx1Z8f\n ivPOGJtvDXYEJNfw9eeueL4uHLvDziBA/Rb5+gG4Rvq0n5feQTKJXHp8rlBfaiT8R7KcKnnV\n 4Yb42BQ4wjL9joG9E8Apjul9uBL3TS+/kxC+74LzGpAvTHl7BvznUyYuwnM05iGoLM/F+Tzl\n XdyHqStbZM4S5/PxjoXgJvEuWqvAdkmuKIeL6hV5TET9e6r/qsJPazHIvBfveQgsF248BXMF\n 1YcOcXGERXv4AslIPeNXhuL3TVFnroO5HmwB2WtT8j21Mdsa/NMT93qDDevFkJ79Fbsb1s7g\n 2hDLMFE/cZh434iAeKD3jDY8T/fHGu5TuMfVuH+y8KeOCeJZPp+cIU1JD4fcmiq5NVvIIaqe\n oXJyIezPBpeAK8AC8Xxvi/5YXd1+A951C6C1R4uFeTdMurdMmC78Cc+sBM+ANdLzNF/xBlgH\n PpKud8G8xXagB9gZ9AF0fQ+Yg8QxcQCOh4rz4TBHimM5TQ/HNT5egHDQfdZFOkrcI/nEcTge\n Dyh+JsKcIt41TZgzYM5S3j9H8gsxD+dXSe4x10rXrleeyc2iwu6XhsJ/F8WBqMeJ/ysfBpaJ\n PNKReXzzThvYDKd1YFn0hscg/tsALZ21ec4GsTS0hWLZou4kDX9oaELHdI1EeiT24ntUtVGX\n g0yq7igpbCD7BL2HIXfl89RQWCgMHJ7ckPuUlpj63XBO8Y9pyE2aTf2nK5NQC4hWvuvoKfIl\n lXkqGwzlz50EfMx1BOVhztP8HNvdWXlWhp6Xz8ndlOWN/V6K0u43Dc4fch7gc9s4U/OU/Azn\n vZLkKrdNheqTKnzeVxff/FOvc19D/dW9SzZjkuKdMfPmxlrn5Ix3mzzWBKhs9NL4l9rxqj5J\n 06HwcD6W8zQf01iDzLrfLhmpc1vNVza/qvGXnP7UZ2PUcZlLnHOcksk0KZ+nyGe2412KW13c\n p65rOQ3qwmCyo8afzi7bsY2PmPV4yfYqZl7qKO1F6nhyreNs6rvY+S9XnOjaai7TssxAHqfn\n 8GuV/9XrVfZi5PVcZaXK367u636hfuP8bCtL8u3np+6vURhK9BObUPZjxm+scZ0810DkrFfV\n 8uY6zgotWy5ygSq35DJYlyZqedWVX5s2UTeeqQqT6pZr+vJ4QRc/fF1uj6rCZYprU1hypG/d\n sRznpnS1Sd+6dKzLa3X5wzZ9dfWEa5/Mtfzq0qRE+vqWX10eqErfkL6tOubxLb8s1zG54RLO\n nPWzb/3pkl9z1J8ufcQqP9fl9ao6w9Re6cKsS7u6a3Xto2s81NWvpjxqW/5s5IEpxpncTtr2\n 4XPWpbHGWa79Idv0NMWZKR5i1aemn+38oxwum2dKpm+M9jJm+pr6RrHSV9eH9dXnyN0XijEO\n i5GedX16VzluqvZXHr9UpY1P/9a1zSs176m2kbb+NY13qvKLjYwqtP1V/eLT//5kQ1B/1G8I\n eZ/LfA3LgUzxw8dVcZYiLuvcjB33IX7wybe6NKM+gox8jfRq+JjSi87l+ViGrut0buvaqdhy\n QPKj3MawSbqApBfLZoi81kcuXqV3XXc9VHbeBH0L+nF5N7W/Nm2NnBer+rasD9bEute1flTD\n lst9Ux1vK8PWjZFD+x27Fma3wvQujG/fMFQ/0iX/hD7f9PClnr9OHX8+Mh65PTS1Iyn9UULX\n M/b8vq9uKf9ID7KkjkvOtOe+om/8cxvu6meXubpY+jcuc0Wx3TeNBVOH33e+LKQ+rZM55pQd\n cNz3kc4578rygFhy7Fj1H4872f88FpD1hNV1Iy76tbnr35Dyn1v3yCT3KhEnJdpnG1mui46u\n ryzBNNaiH5eH0HFfbPlWqvouVX0ZKjdW65S68XQqfWC1nJSUO8eoj0OfjxGGUjI1V/erZGIh\n P507n8qIa7z1tXinLK/sZwnb/7TS7+drNtj43+Y9sttN00121aMOnR+wTb/UuIZ/d4FrfydV\n PSOXCRmf+jfl/E9KuUMpuVPMfnKMdQIucze69X6m8YPvngAl9yOwqWNt5Wsu+hSp9xRoytr0\n UN3tunhPHQ91brDsoqqOZSivyed7iDzXX8p/JJ8le2QSA4C8lwntkcP7bvGxfC7bJfaUIDd5\n j7CqsiCv/dYh+4HcIbkTYdpLgOWwbNdk31R/k/tqnKpy2oGB43o1H9js0cPhk/ebUfegsZVT\n h8pW5D2aVNQ9nFzQPStf4+MQN4jYfZ4Q+TDndzUNTfqAVfs7uazFtc03KfaP0u3LZYvP877u\n ++6zpf5SuOfiJ9+w6PylXtPdZ1Pdx80UZ1VxoYahLl/Y7tflUxbqwhyr7OjioCpuTOexymmM\n 99vGWe5960LdoT5PrDlkNn39yrIdFzdTxKkqa0o9n5NyfjbFL6T9i03O9jTEjVT9CZt61qWe\n DAmTbX1rkw4ubWysflyu/Uh19Utdv8QUb/wevs/vlN3YK0J95hvGWP26FP0CXV0ix6XOfmi8\n lNw7tlSc284PqXnZlKf5umpfVx7Ue3K5q4onnT9079H5h8ubyX5VGZHfIVOiPynLz2RkPSTV\n /2p/0NZM2Ufw7dPm3tveJp46kn5prDC7miXDUCoOc7QdKeU9KeZZbNZTsw6ZKjPna6G6jLZ6\n v6Y9S0rqHMbaN8j3flUbVIdpnonTleaP+JsiapunntfVOer7WUdXNw+jCyvNYxE6P9Ix+7Mu\n TCa3uM3mb9JUmfLe1q59N19yulXnD5dfU/yRyn/8vR2Cr9H8JB/btsm29undfCw/56tbVmVX\n d53nXtV0+Iw4rjNTk8udOvdtwl13j1B1YuT5b04HMpsW/7HCr8t/dF0Of846J3W9HPtdNnUf\n x7UvpdsiV1mJjawiFLWODEm73G1mLF1J2/GB7X7UtvqhJeeTfPc4T7mPtLpuWqWJ66malIZV\n Oq6uerCp9Oh1dlzCzrpIudKf92/hsZbP+hIbHa0Q/fQYe/v4lmd5T5s6veq6vYViyzJT69KV\n 2t/FlN451zKFrm3i9U0264J0fQOX9U5Vfe6S+xPRL8VaHJe8rK69qpNJqe92jX81XX3X2fr8\n XPaHsq1PdPWWa12Sag1GaXmwT98pZ/2vy8+h7e8gsHdGcrvn+ou5l5j6K7GfmPobXJiY4xLb\n d9C3GKnM2H7Xkd7j+z1I03X5ftWxjd9KwDLy0mNPV/fUtSCh4wyeF5DXS8nzWnSd9Jqrfrye\n UWfa3NP1O131E9TnTDItvs/rn9Qwm9y3lS/yuiSdDK2J32LmH61l4/l7DpMcFl0cy/HpKvNU\n 5Z6yuzmgsPj4PZX78jydfMzx1BFk7Gr61smlU9yXf7w+UL7Pa5Fc9pe3lTntI+YJYvTvQ9Y9\n x9gbNOU66lxyYJPsuqPtBRpjvW7uX6n9Y3LpfMUe8+fYy6sJ+99x2QyVR1TJrEvlz9Lxmzq8\n Kct+jO8mpnIrV35pYv3rso+6j2w1RzkxpWeOslpV38Xey7lJ7XVVnDdFVyDn2o2m7A1s871r\n U3+hbp661LfjbL6l6vL9O5v5uiqdcd/9mG3sVrlrktHl3m+5Ln46Qply/f51rDq2afV3U92P\n 9Z2CVPu71+kExf4uhm265Mpfcrjl9S+p/WGjb9FEeYmrHlhsXTLb772b2v3U8bKvoAk6VaQ3\n ZdqvWf2FytNd9g1W/c57VNf9+JuMuXT+ZJ1tnZ6T7U+un1PXpSm/BxKiZ+b6nUC5P+bybdoU\n 3wWR9zP1WcOrrtc06dG7rA9gf6lzCCVlQKl1cKvW16r7MjdxPqHue3m55l5M6yRy1q8p6i+d\n GzbfR5Dtqeeu1D2rulVlp+67ulXfzlDPqS/AP52us+kb5aoetdp226wrqOtHuvxc9InlsMrX\n 5HCkgvtULt80VtPB5tvHlLbU51R1leQ+nW0ftknjClM7Ktf7Pt9n161FKfULHbeU/P5brO/5\n 8PeveZ2l+s31OpmmizxP5z/VrssvNP7Vb9XbUGr+LWSdWKr4c/lemct7U/1KfJcs5nfiXNcz\n Va3lCf2OXi75c+gaSd/4SyH/pmds+8G2fWCbvmwMeZapf6v2g9hU16vF7l/65K8cc6uh7bIs\n W8jdLyyxp4BPPOru6+Qx8rd8beIyhew8xjoMtU8l90dcyldseUOJPpPLevpc7ZnvL8f4oaRO\n ad34WVeefPYVSdG+27T7vPdESj0VV5leyvXoufQvffKZTpZmGy+27UNKfYCc5dWmj2fbp44Z\n P6G/WN9X1cl8beoieS7ad7+PGP14nz1ATO1q3Xx2jHnpWO1xR1uPovumYQndrFD9uyrdvpD4\n b9L8Yaz9wxl5bbVu/XlT9j2X/Rr6Hl7brYPd0V1jM5bOk+84oUn7xpeeH7IhVJ7j25+IrU9s\n ig+XOi7lGMtGj9pGB903/kuMQVPuORpjv7+c35AvvYYkNO1CviFvU4/HkF+qe2ZTG+VTn1bt\n fV7y5/PtqNR76oeuy4zlH3n/9ND3qPuxu7xb3cuj7heahiXq4ljrC1R5vm5M39HGFz7yzRLr\n k1PoMMfcPzeGvDPWPssxw6Rzo8QcXmp3XGSSHX2/Et08k67f5dtmuupKN2FvMpOsKObeDnVx\n k3ofp1h6VrFIVVdV7T2fYm9013l7k/5rbNlKaBuXso7LLV+K1d67uuWiJ19ShhcjvUP97FsO\n Q+V7pdfDpy5rtv2qEPkU7XFY0v3Q+Oc8FpqHdHV9Xf415XFbPTPfPk7qNWsufow9vkqlz6v+\n eA4udH9l3XxtiA5ZyN5XpvxSNzdetRdQlWnKjzbP695Xt9+WTz/bJk5y6tDVlYHUe0Crv9Bv\n vMf+bnzq79DHenfs/ZD3y4TO7b0S7vPM8Z5yL2mTG1XXKcyMLh5093OzvwbVfzr/1hHDby7u\n ufhH5z/Vrm1YZPsheUtn2pQh+RnfMmCqy3PN7aSeN0oRtrp8m6oONOXflHVfrnj0ccdU1lVS\n yYu7Ssjz96ZwxEgz13rX1c3Y+Sp2vJve7eN+zP3nYsojYunAhMq1cs2vM1X9J99+Q2g+d+1z\n 5OznpXJD1zcKcc/U33KN39TzgCnr4lz95Fz1cW79kxT6SDF00UruT5ZDZ8Xl9x83MV0I0CwB\n AB+LCAC4xcFoAgMdjksWhCAMBO/CelYzJ4gMCqiI4t/n/a9hyk29JN3p5DL7bj7GTQrbKypR\n dDVVywyhZCz4xkUhnSIj5EExoFoQisIfbICE2WJOoAESSK7wecCscDJSxRXMbBAlfLCyIbTh\n T8tr5/YikvVFSYq3dURbKo/gf+Q3zBCELycCXW/uB2mPjCb8AAAA"), zt = Object.fromEntries(Rt.values.map((e, t) => [e, t])), { values: Bt } = Rt, { AI: Vt, AL: Ht, CJ: Ut, CM: Wt, NS: Gt, SA: Kt, SG: qt, SP: Jt, XX: Yt } = zt;
|
|
3773
|
+
function Xt(e) {
|
|
3345
3774
|
switch (e) {
|
|
3346
3775
|
case null: return null;
|
|
3347
3776
|
case -1: return "sot";
|
|
3348
3777
|
case -2: return "eot";
|
|
3349
|
-
default: return
|
|
3778
|
+
default: return Bt[e];
|
|
3350
3779
|
}
|
|
3351
3780
|
}
|
|
3352
|
-
function
|
|
3781
|
+
function Zt(e, t) {
|
|
3353
3782
|
switch (e) {
|
|
3354
|
-
case
|
|
3355
|
-
case
|
|
3356
|
-
case
|
|
3357
|
-
case
|
|
3358
|
-
case
|
|
3783
|
+
case Vt:
|
|
3784
|
+
case qt:
|
|
3785
|
+
case Yt: return Ht;
|
|
3786
|
+
case Kt: return /^[\p{gc=Mn}\p{gc=Mc}]$/u.test(t) ? Wt : Ht;
|
|
3787
|
+
case Ut: return Gt;
|
|
3359
3788
|
}
|
|
3360
3789
|
return e;
|
|
3361
3790
|
}
|
|
3362
|
-
var
|
|
3791
|
+
var Qt = class {
|
|
3363
3792
|
cp = -Infinity;
|
|
3364
3793
|
cls = -1;
|
|
3365
3794
|
char = "";
|
|
@@ -3369,15 +3798,15 @@ var pt = class {
|
|
|
3369
3798
|
this.cls = e, this.cp = t, this.char = n, this.len = r;
|
|
3370
3799
|
}
|
|
3371
3800
|
[Symbol.for("nodejs.util.inspect.custom")](e, t, n) {
|
|
3372
|
-
return `${
|
|
3801
|
+
return `${Xt(this.cls)}(${this.cp.toString(16).padStart(4, "0")}:${JSON.stringify(this.char)})${this.ignored ? "Ig" : ""}`;
|
|
3373
3802
|
}
|
|
3374
|
-
},
|
|
3803
|
+
}, $t = class {
|
|
3375
3804
|
str = "";
|
|
3376
3805
|
len = 0;
|
|
3377
3806
|
prevChunk = 0;
|
|
3378
|
-
prev = new
|
|
3379
|
-
cur = new
|
|
3380
|
-
next = new
|
|
3807
|
+
prev = new Qt(-1, -Infinity, "", 0);
|
|
3808
|
+
cur = new Qt(-1, -Infinity, "", 0);
|
|
3809
|
+
next = new Qt(-1, -Infinity, "", 0);
|
|
3381
3810
|
LB8 = !1;
|
|
3382
3811
|
spaces = !1;
|
|
3383
3812
|
RI = 0;
|
|
@@ -3390,13 +3819,13 @@ var pt = class {
|
|
|
3390
3819
|
this.next.ignored ? this.cur.len = this.next.len : (this.prev = this.cur, this.cur = this.next), this.next = e;
|
|
3391
3820
|
}
|
|
3392
3821
|
pushEnd() {
|
|
3393
|
-
this.push(new
|
|
3822
|
+
this.push(new Qt(-2, Infinity, "", this.next.len));
|
|
3394
3823
|
}
|
|
3395
3824
|
*codePoints(e, t = !0) {
|
|
3396
3825
|
if (t) for (; e < this.len;) if (e === this.cur.len && this.next.cls >= 0) yield this.next, e += this.next.char.length;
|
|
3397
3826
|
else {
|
|
3398
|
-
let t = this.str.codePointAt(e), n = String.fromCodePoint(t), r =
|
|
3399
|
-
e += n.length, yield new
|
|
3827
|
+
let t = this.str.codePointAt(e), n = String.fromCodePoint(t), r = Rt.get(t);
|
|
3828
|
+
e += n.length, yield new Qt(Zt(r, n), t, n, e);
|
|
3400
3829
|
}
|
|
3401
3830
|
else for (; e > 0;) if (e === this.cur.len) yield this.cur, e -= this.cur.char.length;
|
|
3402
3831
|
else if (e === this.prev.len) yield this.prev, e -= this.prev.char.length;
|
|
@@ -3404,11 +3833,11 @@ var pt = class {
|
|
|
3404
3833
|
let t = e - 1, n = this.str.charCodeAt(t);
|
|
3405
3834
|
n >= 56320 && n <= 57343 && t--;
|
|
3406
3835
|
let r = this.str.codePointAt(t), i = String.fromCodePoint(r);
|
|
3407
|
-
yield new
|
|
3836
|
+
yield new Qt(Zt(Rt.get(r), i), r, i, e), e = t;
|
|
3408
3837
|
}
|
|
3409
3838
|
}
|
|
3410
3839
|
classAfterSpaces(e) {
|
|
3411
|
-
for (let { cls: t } of this.codePoints(e)) if (t !==
|
|
3840
|
+
for (let { cls: t } of this.codePoints(e)) if (t !== Jt) return t;
|
|
3412
3841
|
return -2;
|
|
3413
3842
|
}
|
|
3414
3843
|
afterNext(e = 1) {
|
|
@@ -3422,371 +3851,371 @@ var pt = class {
|
|
|
3422
3851
|
let r = `${n(this.prev)} => ${n(this.cur)} => ${n(this.next)}`;
|
|
3423
3852
|
return this.LB8 && (r += " LB8"), this.spaces && (r += " spaces"), this.RI > 0 && (r += ` RI: ${this.RI}`), this.props && (r += ` ${JSON.stringify(this.props)}`), r;
|
|
3424
3853
|
}
|
|
3425
|
-
},
|
|
3854
|
+
}, en = class {
|
|
3426
3855
|
string = void 0;
|
|
3427
3856
|
props = void 0;
|
|
3428
3857
|
constructor(e, t = !1) {
|
|
3429
3858
|
this.position = e, this.required = t;
|
|
3430
3859
|
}
|
|
3431
|
-
},
|
|
3432
|
-
Object.fromEntries(
|
|
3433
|
-
var { values:
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
]),
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3860
|
+
}, tn = Lt.fromBase64("AAAEAAAAAAD/////wQIAAB+LCAC1xcFoAgPtmj1IHUEQxzd5FiaEkMLSKqQIViEQCEmTjyqk\n SUgR7OySTrHxdVoIYqUg2AgqFhYWFhYidpYqKDaClVZaqJWF2qj/xT1cjjtv772Z3T1uHvzY\n 753d2b252ds3+1SpRbAMVkGSrlMo5LNjIfqoB/uEfR2Ao5yy4zb7PgUX4Brcgo6GUi9AF+gG\n r0EPeAc+AN3mM8KvJu6DH0bWb08yeyEneV77rHia/yjbMvEBxJum7mCqzQjSo1beuBWfRFy3\n 1fHpR2QJgiAIgiAIgiAIQpoZc45c8HhGd2WJYUyy5oIgCP5oRPhuEQQh7vvPVuAe34q5x1lH\n uJFh15J7HRt9Z7MJ9iKwg1fP72kG4osqz3ynUlNPHjhC2i5/9UypX8DOa6bSa0hfAbsf33zE\n /EPLr7NtOYj4zlTfD+v7dG0r8uzhXM39qEPH9TtBvTNwUXK9dyv0frzE3DSxje8mZ0yNjuz8\n zlT+S6T1OnQh7M5oo+f+Bvk67EGY/OfiPeKfTL5+hr6ZuM13k/cT4R/QC86tMfdZbf4a2Un6\n H9L9OXNIGCoo12yDYdR7mzG+tP8yhjoTpt607tuh/6r7b1VG7yv5ya/OP7iZQXEdYyi9UNel\n WKM83YTQE/f8qftudz9y7G/OdWlXLxTPYRm9cu+ZMutMaYuK2tnjyqpb5jnPa8+xH7n3eJFO\n ivRGbTNC6su3PeHYM0V7OxZ/hUtWLP5ZFfzDmMYQSieU8qj78rF3fMsI+axX5fwWYvw+5t9u\n f0VnNR964yh31bdLOce8qfYb11ndVWeUvibHfCj8tZD2LNZvTRyyW/GfQr1/OM8gob/LcPn8\n If3iVmVT23Iu/69KaxHzOYn6XenTNw1551DW/3V5X7v6c9Tfh7jPX9TrFtqOhjgPttqeW28u\n 33192kvqs2vW7w7BeyuJcEoAAB+LCAC1xcFoAgOLVvJT0lGKVIoFANHfAiwJAAAA");
|
|
3861
|
+
Object.fromEntries(tn.values.map((e, t) => [e, t]));
|
|
3862
|
+
var { values: nn } = tn, { AK: rn, AL: an, AP: on, AS: sn, B2: cn, BA: ln, BB: un, BK: dn, CB: fn, CL: pn, CM: mn, CP: hn, CR: gn, EB: _n, EM: vn, EX: yn, GL: bn, H2: xn, H3: Sn, HH: Cn, HL: wn, HY: Tn, ID: En, IN: Dn, IS: On, JL: kn, JT: An, JV: jn, LF: Mn, NU: Nn, OP: Pn, NL: Fn, NS: In, PO: Ln, PR: Rn, RI: zn, SP: J, SY: Bn, QU: Vn, VF: Hn, VI: Un, WJ: Wn, ZW: Gn, ZWJ: Kn } = zt, qn = /* @__PURE__ */ new Set([
|
|
3863
|
+
an,
|
|
3864
|
+
wn,
|
|
3865
|
+
Nn
|
|
3866
|
+
]), Jn = /* @__PURE__ */ new Set([
|
|
3867
|
+
dn,
|
|
3868
|
+
gn,
|
|
3869
|
+
Mn,
|
|
3870
|
+
Fn,
|
|
3442
3871
|
J,
|
|
3443
|
-
|
|
3444
|
-
]),
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
]),
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
]),
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
]),
|
|
3872
|
+
Gn
|
|
3873
|
+
]), Yn = /* @__PURE__ */ new Set([
|
|
3874
|
+
En,
|
|
3875
|
+
_n,
|
|
3876
|
+
vn
|
|
3877
|
+
]), Xn = /* @__PURE__ */ new Set([
|
|
3878
|
+
kn,
|
|
3879
|
+
jn,
|
|
3880
|
+
xn,
|
|
3881
|
+
Sn
|
|
3882
|
+
]), Zn = /* @__PURE__ */ new Set([
|
|
3883
|
+
kn,
|
|
3884
|
+
jn,
|
|
3885
|
+
An,
|
|
3886
|
+
xn,
|
|
3887
|
+
Sn
|
|
3888
|
+
]), Qn = /* @__PURE__ */ new Set([jn, An]), $n = /* @__PURE__ */ new Set([
|
|
3460
3889
|
J,
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
]),
|
|
3890
|
+
bn,
|
|
3891
|
+
Wn,
|
|
3892
|
+
pn,
|
|
3893
|
+
Vn,
|
|
3894
|
+
hn,
|
|
3895
|
+
yn,
|
|
3896
|
+
On,
|
|
3897
|
+
Bn,
|
|
3898
|
+
dn,
|
|
3899
|
+
gn,
|
|
3900
|
+
Mn,
|
|
3901
|
+
Fn,
|
|
3902
|
+
Gn
|
|
3903
|
+
]), er = /* @__PURE__ */ new Set([
|
|
3475
3904
|
-1,
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3905
|
+
dn,
|
|
3906
|
+
gn,
|
|
3907
|
+
Mn,
|
|
3908
|
+
Fn,
|
|
3909
|
+
Pn,
|
|
3910
|
+
Vn,
|
|
3911
|
+
bn,
|
|
3483
3912
|
J,
|
|
3484
|
-
|
|
3485
|
-
]), Y = Symbol("PASS"), X = Symbol("NO_BREAK"),
|
|
3486
|
-
function
|
|
3913
|
+
Gn
|
|
3914
|
+
]), Y = Symbol("PASS"), X = Symbol("NO_BREAK"), tr = Symbol("MAY_BREAK"), nr = Symbol("MUST_BREAK");
|
|
3915
|
+
function rr(e) {
|
|
3487
3916
|
return e.cur.cls === -1 && e.next.cls !== -2 ? X : Y;
|
|
3488
3917
|
}
|
|
3489
|
-
function
|
|
3490
|
-
return e.next.cls === -2 && (e.cur.len === 0 || e.cur.len !== e.prevChunk) ?
|
|
3918
|
+
function ar(e) {
|
|
3919
|
+
return e.next.cls === -2 && (e.cur.len === 0 || e.cur.len !== e.prevChunk) ? nr : Y;
|
|
3491
3920
|
}
|
|
3492
|
-
function
|
|
3493
|
-
return e.cur.cls ===
|
|
3921
|
+
function or(e) {
|
|
3922
|
+
return e.cur.cls === dn ? nr : Y;
|
|
3494
3923
|
}
|
|
3495
|
-
function
|
|
3924
|
+
function sr(e) {
|
|
3496
3925
|
switch (e.cur.cls) {
|
|
3497
|
-
case
|
|
3498
|
-
case
|
|
3499
|
-
case
|
|
3926
|
+
case gn: return e.next.cls === Mn ? X : nr;
|
|
3927
|
+
case Mn:
|
|
3928
|
+
case Fn: return nr;
|
|
3500
3929
|
}
|
|
3501
3930
|
return Y;
|
|
3502
3931
|
}
|
|
3503
|
-
function
|
|
3932
|
+
function cr(e) {
|
|
3504
3933
|
switch (e.next.cls) {
|
|
3505
|
-
case
|
|
3506
|
-
case
|
|
3507
|
-
case
|
|
3508
|
-
case
|
|
3934
|
+
case dn:
|
|
3935
|
+
case gn:
|
|
3936
|
+
case Mn:
|
|
3937
|
+
case Fn: return X;
|
|
3509
3938
|
}
|
|
3510
3939
|
return Y;
|
|
3511
3940
|
}
|
|
3512
|
-
function
|
|
3513
|
-
return e.cur.cls !==
|
|
3941
|
+
function lr(e) {
|
|
3942
|
+
return e.cur.cls !== zn && (e.RI = 0), e.spaces ? (e.next.cls !== J && (e.spaces = !1), X) : Y;
|
|
3514
3943
|
}
|
|
3515
|
-
function
|
|
3516
|
-
if (e.next.cls ===
|
|
3944
|
+
function ur(e) {
|
|
3945
|
+
if (e.next.cls === Gn) return X;
|
|
3517
3946
|
if (e.next.cls === J) switch (e.cur.cls) {
|
|
3518
|
-
case
|
|
3519
|
-
case
|
|
3520
|
-
case
|
|
3521
|
-
case
|
|
3522
|
-
case
|
|
3523
|
-
case
|
|
3947
|
+
case Gn:
|
|
3948
|
+
case Pn:
|
|
3949
|
+
case Vn:
|
|
3950
|
+
case pn:
|
|
3951
|
+
case hn:
|
|
3952
|
+
case cn: break;
|
|
3524
3953
|
default: return X;
|
|
3525
3954
|
}
|
|
3526
3955
|
return Y;
|
|
3527
3956
|
}
|
|
3528
|
-
function
|
|
3529
|
-
return e.LB8 ? (e.LB8 = !1,
|
|
3957
|
+
function dr(e) {
|
|
3958
|
+
return e.LB8 ? (e.LB8 = !1, tr) : e.cur.cls === Gn ? e.next.cls === J ? (e.LB8 = !0, X) : tr : Y;
|
|
3530
3959
|
}
|
|
3531
|
-
function
|
|
3532
|
-
return e.cur.cls ===
|
|
3960
|
+
function fr(e) {
|
|
3961
|
+
return e.cur.cls === Kn ? X : Y;
|
|
3533
3962
|
}
|
|
3534
|
-
function
|
|
3535
|
-
return !
|
|
3963
|
+
function pr(e) {
|
|
3964
|
+
return !Jn.has(e.cur.cls) && (e.next.cls === mn || e.next.cls === Kn) ? (e.next.ignored = !0, X) : Y;
|
|
3536
3965
|
}
|
|
3537
|
-
function
|
|
3538
|
-
return e.cur.cls ===
|
|
3966
|
+
function mr(e) {
|
|
3967
|
+
return e.cur.cls === mn && (e.cur.cls = an), e.next.cls === mn && (e.next.cls = an), Y;
|
|
3539
3968
|
}
|
|
3540
|
-
function
|
|
3541
|
-
return e.next.cls ===
|
|
3969
|
+
function hr(e) {
|
|
3970
|
+
return e.next.cls === Wn || e.cur.cls === Wn ? X : Y;
|
|
3542
3971
|
}
|
|
3543
|
-
function
|
|
3544
|
-
return e.cur.cls ===
|
|
3972
|
+
function gr(e) {
|
|
3973
|
+
return e.cur.cls === bn ? X : Y;
|
|
3545
3974
|
}
|
|
3546
|
-
function
|
|
3547
|
-
if (e.next.cls ===
|
|
3975
|
+
function _r(e) {
|
|
3976
|
+
if (e.next.cls === bn) switch (e.cur.cls) {
|
|
3548
3977
|
case J:
|
|
3549
|
-
case
|
|
3550
|
-
case
|
|
3551
|
-
case
|
|
3978
|
+
case ln:
|
|
3979
|
+
case Tn:
|
|
3980
|
+
case Cn: return Y;
|
|
3552
3981
|
default: return X;
|
|
3553
3982
|
}
|
|
3554
3983
|
return Y;
|
|
3555
3984
|
}
|
|
3556
|
-
function
|
|
3985
|
+
function vr(e) {
|
|
3557
3986
|
switch (e.next.cls) {
|
|
3558
|
-
case
|
|
3559
|
-
case
|
|
3560
|
-
case
|
|
3561
|
-
case
|
|
3987
|
+
case pn:
|
|
3988
|
+
case hn:
|
|
3989
|
+
case yn:
|
|
3990
|
+
case Bn: return X;
|
|
3562
3991
|
}
|
|
3563
3992
|
return Y;
|
|
3564
3993
|
}
|
|
3565
|
-
function
|
|
3566
|
-
return e.cur.cls ===
|
|
3994
|
+
function yr(e) {
|
|
3995
|
+
return e.cur.cls === Pn ? (e.next.cls === J && (e.spaces = !0), X) : Y;
|
|
3567
3996
|
}
|
|
3568
|
-
function
|
|
3569
|
-
return
|
|
3997
|
+
function br(e) {
|
|
3998
|
+
return er.has(e.prev.cls) && /^\p{Pi}$/u.test(e.cur.char) && e.cur.cls === Vn ? (e.spaces = !0, X) : Y;
|
|
3570
3999
|
}
|
|
3571
|
-
function
|
|
3572
|
-
if (/^\p{gc=Pf}$/u.test(e.next.char) && e.next.cls ===
|
|
4000
|
+
function xr(e) {
|
|
4001
|
+
if (/^\p{gc=Pf}$/u.test(e.next.char) && e.next.cls === Vn) {
|
|
3573
4002
|
let t = e.afterNext();
|
|
3574
|
-
if (!t ||
|
|
4003
|
+
if (!t || $n.has(t.cls)) return X;
|
|
3575
4004
|
}
|
|
3576
4005
|
return Y;
|
|
3577
4006
|
}
|
|
3578
|
-
function
|
|
3579
|
-
return e.cur.cls === J && e.next.cls ===
|
|
4007
|
+
function Sr(e) {
|
|
4008
|
+
return e.cur.cls === J && e.next.cls === On && e.afterNext()?.cls === Nn ? tr : Y;
|
|
3580
4009
|
}
|
|
3581
|
-
function
|
|
3582
|
-
return e.next.cls ===
|
|
4010
|
+
function Cr(e) {
|
|
4011
|
+
return e.next.cls === On ? X : Y;
|
|
3583
4012
|
}
|
|
3584
|
-
function
|
|
3585
|
-
if (e.cur.cls ===
|
|
3586
|
-
if (e.classAfterSpaces(e.cur.len) ===
|
|
4013
|
+
function wr(e) {
|
|
4014
|
+
if (e.cur.cls === pn || e.cur.cls === hn) {
|
|
4015
|
+
if (e.classAfterSpaces(e.cur.len) === In) return e.next.cls === J && (e.spaces = !0), X;
|
|
3587
4016
|
if (e.next.cls === J) return X;
|
|
3588
4017
|
}
|
|
3589
4018
|
return Y;
|
|
3590
4019
|
}
|
|
3591
|
-
function
|
|
3592
|
-
if (e.cur.cls ===
|
|
3593
|
-
if (e.classAfterSpaces(e.cur.len) ===
|
|
4020
|
+
function Tr(e) {
|
|
4021
|
+
if (e.cur.cls === cn) {
|
|
4022
|
+
if (e.classAfterSpaces(e.cur.len) === cn) return e.next.cls === J && (e.spaces = !0), X;
|
|
3594
4023
|
if (e.next.cls === J) return X;
|
|
3595
4024
|
}
|
|
3596
4025
|
return Y;
|
|
3597
4026
|
}
|
|
3598
|
-
function
|
|
3599
|
-
return e.cur.cls === J ?
|
|
4027
|
+
function Er(e) {
|
|
4028
|
+
return e.cur.cls === J ? tr : Y;
|
|
3600
4029
|
}
|
|
3601
|
-
function
|
|
3602
|
-
return e.next.cls ===
|
|
4030
|
+
function Dr(e) {
|
|
4031
|
+
return e.next.cls === Vn && !/^\p{Pi}$/u.test(e.next.char) || e.cur.cls === Vn && !/^\p{Pf}$/u.test(e.cur.char) ? X : Y;
|
|
3603
4032
|
}
|
|
3604
|
-
function
|
|
3605
|
-
if (!
|
|
3606
|
-
if (e.next.cls ===
|
|
4033
|
+
function Or(e) {
|
|
4034
|
+
if (!tn.get(e.cur.cp) && e.next.cls === Vn) return X;
|
|
4035
|
+
if (e.next.cls === Vn) {
|
|
3607
4036
|
let t = e.afterNext();
|
|
3608
|
-
if (!t || !
|
|
4037
|
+
if (!t || !tn.get(t.cp)) return X;
|
|
3609
4038
|
}
|
|
3610
|
-
return e.cur.cls ===
|
|
4039
|
+
return e.cur.cls === Vn && !tn.get(e.next.cp) || (e.prev.cls === -1 || !tn.get(e.prev.cp)) && e.cur.cls === Vn ? X : Y;
|
|
3611
4040
|
}
|
|
3612
|
-
function
|
|
3613
|
-
return e.cur.cls ===
|
|
4041
|
+
function kr(e) {
|
|
4042
|
+
return e.cur.cls === fn || e.next.cls === fn ? tr : Y;
|
|
3614
4043
|
}
|
|
3615
|
-
var
|
|
4044
|
+
var Ar = /* @__PURE__ */ new Set([
|
|
3616
4045
|
-1,
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
4046
|
+
dn,
|
|
4047
|
+
gn,
|
|
4048
|
+
Mn,
|
|
4049
|
+
Fn,
|
|
3621
4050
|
J,
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
4051
|
+
Gn,
|
|
4052
|
+
fn,
|
|
4053
|
+
bn
|
|
3625
4054
|
]);
|
|
3626
|
-
function
|
|
3627
|
-
return
|
|
4055
|
+
function jr(e) {
|
|
4056
|
+
return Ar.has(e.prev.cls) && (e.cur.cls === Tn || e.cur.cls === Cn) && (e.next.cls === an || e.next.cls === wn) ? X : Y;
|
|
3628
4057
|
}
|
|
3629
|
-
function
|
|
3630
|
-
if (e.cur.cls ===
|
|
4058
|
+
function Mr(e) {
|
|
4059
|
+
if (e.cur.cls === un) return X;
|
|
3631
4060
|
switch (e.next.cls) {
|
|
3632
|
-
case
|
|
3633
|
-
case
|
|
3634
|
-
case
|
|
3635
|
-
case
|
|
4061
|
+
case ln:
|
|
4062
|
+
case Cn:
|
|
4063
|
+
case Tn:
|
|
4064
|
+
case In: return X;
|
|
3636
4065
|
}
|
|
3637
4066
|
return Y;
|
|
3638
4067
|
}
|
|
3639
|
-
function
|
|
3640
|
-
return e.prev.cls ===
|
|
4068
|
+
function Nr(e) {
|
|
4069
|
+
return e.prev.cls === wn && (e.cur.cls === Tn || e.cur.cls === Cn) && e.next.cls !== wn ? X : Y;
|
|
3641
4070
|
}
|
|
3642
|
-
function
|
|
3643
|
-
return e.cur.cls ===
|
|
4071
|
+
function Pr(e) {
|
|
4072
|
+
return e.cur.cls === Bn && e.next.cls === wn ? X : Y;
|
|
3644
4073
|
}
|
|
3645
|
-
function
|
|
3646
|
-
return e.next.cls ===
|
|
4074
|
+
function Fr(e) {
|
|
4075
|
+
return e.next.cls === Dn ? X : Y;
|
|
3647
4076
|
}
|
|
3648
|
-
function
|
|
4077
|
+
function Ir(e) {
|
|
3649
4078
|
switch (e.cur.cls) {
|
|
3650
|
-
case
|
|
3651
|
-
case
|
|
3652
|
-
if (e.next.cls ===
|
|
4079
|
+
case an:
|
|
4080
|
+
case wn:
|
|
4081
|
+
if (e.next.cls === Nn) return X;
|
|
3653
4082
|
break;
|
|
3654
|
-
case
|
|
4083
|
+
case Nn: if (e.next.cls === an || e.next.cls === wn) return X;
|
|
3655
4084
|
}
|
|
3656
4085
|
return Y;
|
|
3657
4086
|
}
|
|
3658
|
-
function
|
|
3659
|
-
return e.cur.cls ===
|
|
4087
|
+
function Lr(e) {
|
|
4088
|
+
return e.cur.cls === Rn && Yn.has(e.next.cls) || e.next.cls === Ln && Yn.has(e.cur.cls) ? X : Y;
|
|
3660
4089
|
}
|
|
3661
|
-
function
|
|
3662
|
-
return (e.cur.cls ===
|
|
4090
|
+
function Rr(e) {
|
|
4091
|
+
return (e.cur.cls === Rn || e.cur.cls === Ln) && (e.next.cls === an || e.next.cls === wn) || (e.cur.cls === an || e.cur.cls === wn) && (e.next.cls === Rn || e.next.cls === Ln) ? X : Y;
|
|
3663
4092
|
}
|
|
3664
|
-
var
|
|
3665
|
-
function
|
|
4093
|
+
var zr = /* @__PURE__ */ new Set([Ln, Rn]), Br = /* @__PURE__ */ new Set([pn, hn]);
|
|
4094
|
+
function Vr(e) {
|
|
3666
4095
|
let t = null;
|
|
3667
|
-
if (
|
|
3668
|
-
case
|
|
3669
|
-
case
|
|
3670
|
-
case
|
|
4096
|
+
if (zr.has(e.next.cls) ? t = Br.has(e.cur.cls) ? e.prev.len : e.cur.len : e.next.cls === Nn && (t = e.cur.len), t !== null) SyIsLoop: for (let { cls: n } of e.codePoints(t, !1)) switch (n) {
|
|
4097
|
+
case Bn:
|
|
4098
|
+
case On: continue;
|
|
4099
|
+
case Nn: return X;
|
|
3671
4100
|
default: break SyIsLoop;
|
|
3672
4101
|
}
|
|
3673
|
-
if (e.cur.cls ===
|
|
3674
|
-
if (e.next.cls ===
|
|
4102
|
+
if (e.cur.cls === Ln || e.cur.cls === Rn) {
|
|
4103
|
+
if (e.next.cls === Pn) {
|
|
3675
4104
|
let t = e.afterNext();
|
|
3676
|
-
if (t && (t.cls ===
|
|
3677
|
-
} else if (e.next.cls ===
|
|
4105
|
+
if (t && (t.cls === Nn || t.cls === On && e.afterNext(2)?.cls === Nn)) return X;
|
|
4106
|
+
} else if (e.next.cls === Nn) return X;
|
|
3678
4107
|
}
|
|
3679
|
-
return e.cur.cls ===
|
|
4108
|
+
return e.cur.cls === Tn && e.next.cls === Nn || e.cur.cls === On && e.next.cls === Nn ? X : Y;
|
|
3680
4109
|
}
|
|
3681
|
-
function
|
|
4110
|
+
function Hr(e) {
|
|
3682
4111
|
switch (e.cur.cls) {
|
|
3683
|
-
case
|
|
3684
|
-
if (
|
|
4112
|
+
case kn:
|
|
4113
|
+
if (Xn.has(e.next.cls)) return X;
|
|
3685
4114
|
break;
|
|
3686
|
-
case
|
|
3687
|
-
case
|
|
3688
|
-
if (
|
|
4115
|
+
case jn:
|
|
4116
|
+
case xn:
|
|
4117
|
+
if (Qn.has(e.next.cls)) return X;
|
|
3689
4118
|
break;
|
|
3690
|
-
case
|
|
3691
|
-
case
|
|
4119
|
+
case An:
|
|
4120
|
+
case Sn: if (e.next.cls === An) return X;
|
|
3692
4121
|
}
|
|
3693
4122
|
return Y;
|
|
3694
4123
|
}
|
|
3695
|
-
function
|
|
4124
|
+
function Ur(e) {
|
|
3696
4125
|
switch (e.cur.cls) {
|
|
3697
|
-
case
|
|
3698
|
-
case
|
|
3699
|
-
case
|
|
3700
|
-
case
|
|
3701
|
-
case
|
|
3702
|
-
if (e.next.cls ===
|
|
4126
|
+
case kn:
|
|
4127
|
+
case jn:
|
|
4128
|
+
case An:
|
|
4129
|
+
case xn:
|
|
4130
|
+
case Sn:
|
|
4131
|
+
if (e.next.cls === Ln) return X;
|
|
3703
4132
|
break;
|
|
3704
|
-
case
|
|
4133
|
+
case Rn: if (Zn.has(e.next.cls)) return X;
|
|
3705
4134
|
}
|
|
3706
4135
|
return Y;
|
|
3707
4136
|
}
|
|
3708
|
-
function
|
|
3709
|
-
return (e.cur.cls ===
|
|
4137
|
+
function Wr(e) {
|
|
4138
|
+
return (e.cur.cls === an || e.cur.cls === wn) && (e.next.cls === an || e.next.cls === wn) ? X : Y;
|
|
3710
4139
|
}
|
|
3711
|
-
function
|
|
4140
|
+
function Gr(e) {
|
|
3712
4141
|
let { prev: t, cur: n, next: r } = e;
|
|
3713
4142
|
function i(e) {
|
|
3714
|
-
return e.cls ===
|
|
4143
|
+
return e.cls === rn || e.char === "◌" || e.cls === sn;
|
|
3715
4144
|
}
|
|
3716
|
-
return n.cls ===
|
|
4145
|
+
return n.cls === on && i(r) || i(n) && (r.cls === Hn || r.cls === Un) || i(t) && n.cls === Un && (r.cls === rn || r.char === "◌") || i(n) && i(r) && e.afterNext()?.cls === Hn ? X : Y;
|
|
3717
4146
|
}
|
|
3718
|
-
function
|
|
3719
|
-
return e.cur.cls ===
|
|
4147
|
+
function Kr(e) {
|
|
4148
|
+
return e.cur.cls === On && (e.next.cls === an || e.next.cls === wn) ? X : Y;
|
|
3720
4149
|
}
|
|
3721
|
-
function
|
|
4150
|
+
function qr(e) {
|
|
3722
4151
|
switch (e.cur.cls) {
|
|
3723
|
-
case
|
|
3724
|
-
case
|
|
3725
|
-
case
|
|
3726
|
-
if (e.next.cls ===
|
|
4152
|
+
case an:
|
|
4153
|
+
case wn:
|
|
4154
|
+
case Nn:
|
|
4155
|
+
if (e.next.cls === Pn && !tn.get(e.next.cp)) return X;
|
|
3727
4156
|
break;
|
|
3728
|
-
case
|
|
4157
|
+
case hn: if (!tn.get(e.cur.cp) && qn.has(e.next.cls)) return X;
|
|
3729
4158
|
}
|
|
3730
4159
|
return Y;
|
|
3731
4160
|
}
|
|
3732
|
-
function
|
|
3733
|
-
if (e.cur.cls ===
|
|
3734
|
-
if (e.next.cls ===
|
|
4161
|
+
function Jr(e) {
|
|
4162
|
+
if (e.cur.cls === zn) {
|
|
4163
|
+
if (e.next.cls === zn && ++e.RI % 2 != 0) return X;
|
|
3735
4164
|
} else e.RI = 0;
|
|
3736
4165
|
return Y;
|
|
3737
4166
|
}
|
|
3738
|
-
function
|
|
3739
|
-
return e.cur.cls ===
|
|
4167
|
+
function Yr(e) {
|
|
4168
|
+
return e.cur.cls === _n && e.next.cls === vn || e.next.cls === vn && /^\p{ExtPict}$/u.test(e.cur.char) && /^\p{gc=Cn}$/u.test(e.cur.char) ? X : Y;
|
|
3740
4169
|
}
|
|
3741
|
-
function
|
|
3742
|
-
return
|
|
4170
|
+
function Xr() {
|
|
4171
|
+
return tr;
|
|
3743
4172
|
}
|
|
3744
|
-
var
|
|
3745
|
-
mn,
|
|
3746
|
-
hn,
|
|
3747
|
-
gn,
|
|
3748
|
-
_n,
|
|
3749
|
-
vn,
|
|
3750
|
-
yn,
|
|
3751
|
-
bn,
|
|
3752
|
-
xn,
|
|
3753
|
-
Sn,
|
|
3754
|
-
Cn,
|
|
3755
|
-
wn,
|
|
3756
|
-
Tn,
|
|
3757
|
-
En,
|
|
3758
|
-
Dn,
|
|
3759
|
-
On,
|
|
3760
|
-
kn,
|
|
3761
|
-
An,
|
|
3762
|
-
jn,
|
|
3763
|
-
Mn,
|
|
3764
|
-
Nn,
|
|
3765
|
-
Pn,
|
|
3766
|
-
Fn,
|
|
3767
|
-
In,
|
|
3768
|
-
Ln,
|
|
3769
|
-
Rn,
|
|
3770
|
-
zn,
|
|
3771
|
-
Vn,
|
|
3772
|
-
Un,
|
|
3773
|
-
Hn,
|
|
3774
|
-
Wn,
|
|
3775
|
-
Gn,
|
|
3776
|
-
Kn,
|
|
3777
|
-
qn,
|
|
3778
|
-
Jn,
|
|
3779
|
-
Zn,
|
|
3780
|
-
Qn,
|
|
3781
|
-
$n,
|
|
3782
|
-
er,
|
|
3783
|
-
tr,
|
|
3784
|
-
nr,
|
|
4173
|
+
var Zr = [
|
|
3785
4174
|
rr,
|
|
3786
4175
|
ar,
|
|
3787
4176
|
or,
|
|
3788
|
-
sr
|
|
3789
|
-
|
|
4177
|
+
sr,
|
|
4178
|
+
cr,
|
|
4179
|
+
lr,
|
|
4180
|
+
ur,
|
|
4181
|
+
dr,
|
|
4182
|
+
fr,
|
|
4183
|
+
pr,
|
|
4184
|
+
mr,
|
|
4185
|
+
hr,
|
|
4186
|
+
gr,
|
|
4187
|
+
_r,
|
|
4188
|
+
vr,
|
|
4189
|
+
yr,
|
|
4190
|
+
br,
|
|
4191
|
+
xr,
|
|
4192
|
+
Sr,
|
|
4193
|
+
Cr,
|
|
4194
|
+
wr,
|
|
4195
|
+
Tr,
|
|
4196
|
+
Er,
|
|
4197
|
+
Dr,
|
|
4198
|
+
Or,
|
|
4199
|
+
kr,
|
|
4200
|
+
jr,
|
|
4201
|
+
Nr,
|
|
4202
|
+
Mr,
|
|
4203
|
+
Pr,
|
|
4204
|
+
Fr,
|
|
4205
|
+
Ir,
|
|
4206
|
+
Lr,
|
|
4207
|
+
Rr,
|
|
4208
|
+
Vr,
|
|
4209
|
+
Hr,
|
|
4210
|
+
Ur,
|
|
4211
|
+
Wr,
|
|
4212
|
+
Gr,
|
|
4213
|
+
Kr,
|
|
4214
|
+
qr,
|
|
4215
|
+
Jr,
|
|
4216
|
+
Yr,
|
|
4217
|
+
Xr
|
|
4218
|
+
], Qr = class {
|
|
3790
4219
|
#e;
|
|
3791
4220
|
constructor(e = {}) {
|
|
3792
4221
|
if (this.#e = {
|
|
@@ -3794,7 +4223,7 @@ var cr = [
|
|
|
3794
4223
|
example7: !1,
|
|
3795
4224
|
verbose: !1,
|
|
3796
4225
|
...e
|
|
3797
|
-
}, this.rules = [...
|
|
4226
|
+
}, this.rules = [...Zr], this.#e.example7) throw Error("'example7' flag deprecated");
|
|
3798
4227
|
this.#e.verbose && this.rules.unshift((e) => (console.log(e.cur.len, e), Y));
|
|
3799
4228
|
}
|
|
3800
4229
|
removeRule(...e) {
|
|
@@ -3822,8 +4251,8 @@ var cr = [
|
|
|
3822
4251
|
switch (n) {
|
|
3823
4252
|
case Y: break;
|
|
3824
4253
|
case X: return this.#e.verbose && console.log(` ${t.name}: NO_BREAK`), null;
|
|
3825
|
-
case
|
|
3826
|
-
case
|
|
4254
|
+
case tr: return this.#e.verbose && console.log(` ${t.name}: MAY_BREAK`), new en(e.cur.len);
|
|
4255
|
+
case nr: return this.#e.verbose && console.log(` ${t.name}: MUST_BREAK`), new en(e.cur.len, !0);
|
|
3827
4256
|
default: throw Error(`Invalid state: "${n}"`);
|
|
3828
4257
|
}
|
|
3829
4258
|
}
|
|
@@ -3834,44 +4263,44 @@ var cr = [
|
|
|
3834
4263
|
t && (this.#e.string && (t.string = e.str.slice(e.prevChunk, e.cur.len)), e.props &&= (t.props = e.props, void 0), yield t, e.prevChunk = e.cur.len);
|
|
3835
4264
|
}
|
|
3836
4265
|
*breaks(e) {
|
|
3837
|
-
let t = new
|
|
4266
|
+
let t = new $t(e);
|
|
3838
4267
|
for (let e of t.codePoints(0)) t.push(e), yield* this.#n(t);
|
|
3839
4268
|
t.pushEnd(), yield* this.#n(t);
|
|
3840
4269
|
}
|
|
3841
4270
|
};
|
|
3842
4271
|
//#endregion
|
|
3843
4272
|
//#region src/text-layout.ts
|
|
3844
|
-
function
|
|
4273
|
+
function $r(e, t) {
|
|
3845
4274
|
let n = new Intl.Segmenter(t, { granularity: "grapheme" }), r = /* @__PURE__ */ new Set([0]);
|
|
3846
4275
|
for (let t of n.segment(e)) r.add(t.index + t.segment.length);
|
|
3847
4276
|
return r;
|
|
3848
4277
|
}
|
|
3849
|
-
var
|
|
3850
|
-
#e = new
|
|
4278
|
+
var ei = class {
|
|
4279
|
+
#e = new Qr();
|
|
3851
4280
|
#t;
|
|
3852
4281
|
constructor(e = "ja") {
|
|
3853
4282
|
this.#t = e;
|
|
3854
4283
|
}
|
|
3855
4284
|
getBreakOpportunities(e) {
|
|
3856
|
-
let t =
|
|
4285
|
+
let t = $r(e, this.#t), n = /* @__PURE__ */ new Map();
|
|
3857
4286
|
for (let r of this.#e.breaks(e)) t.has(r.position) && n.set(r.position, (n.get(r.position) ?? !1) || r.required);
|
|
3858
4287
|
return Object.freeze([...n].sort(([e], [t]) => e - t).map(([e, t]) => Object.freeze({
|
|
3859
4288
|
position: e,
|
|
3860
4289
|
required: t
|
|
3861
4290
|
})));
|
|
3862
4291
|
}
|
|
3863
|
-
},
|
|
3864
|
-
function
|
|
3865
|
-
let t =
|
|
4292
|
+
}, ti = /* @__PURE__ */ new Map(), ni = /\r\n|[\n\r\v\f\u0085\u2028\u2029]/gu;
|
|
4293
|
+
function ri(e) {
|
|
4294
|
+
let t = ti.get(e);
|
|
3866
4295
|
if (t) return t;
|
|
3867
|
-
let n = new
|
|
3868
|
-
return
|
|
4296
|
+
let n = new ei(e);
|
|
4297
|
+
return ti.set(e, n), n;
|
|
3869
4298
|
}
|
|
3870
|
-
function
|
|
4299
|
+
function ii(e, t) {
|
|
3871
4300
|
if (!Number.isFinite(e) || e < 0) throw TypeError(`${t} must return a non-negative finite number.`);
|
|
3872
4301
|
return e;
|
|
3873
4302
|
}
|
|
3874
|
-
function
|
|
4303
|
+
function ai(e, t, n) {
|
|
3875
4304
|
let r = /* @__PURE__ */ new Map();
|
|
3876
4305
|
for (let i of t.getBreakOpportunities(e)) {
|
|
3877
4306
|
let { position: t, required: a } = i;
|
|
@@ -3882,28 +4311,28 @@ function gr(e, t, n) {
|
|
|
3882
4311
|
required: t
|
|
3883
4312
|
}));
|
|
3884
4313
|
}
|
|
3885
|
-
function
|
|
4314
|
+
function oi(e, t, n, r, i) {
|
|
3886
4315
|
if (e.length === 0) return [{
|
|
3887
4316
|
text: "",
|
|
3888
4317
|
start: t,
|
|
3889
4318
|
end: t,
|
|
3890
4319
|
width: 0
|
|
3891
4320
|
}];
|
|
3892
|
-
let a =
|
|
4321
|
+
let a = $r(e, i), o = [...a].sort((e, t) => e - t), s = ai(e, r, a), c = [], l = 0;
|
|
3893
4322
|
for (; l < e.length;) {
|
|
3894
4323
|
let r = s.find((e) => e.position > l && e.required)?.position ?? e.length, i, a = 0;
|
|
3895
4324
|
for (let t of s) {
|
|
3896
4325
|
if (t.position <= l || t.position > r) continue;
|
|
3897
|
-
let o = e.slice(l, t.position), s =
|
|
4326
|
+
let o = e.slice(l, t.position), s = ii(n.measureText(o), "measureText");
|
|
3898
4327
|
s <= n.maxWidth && (i = t.position, a = s);
|
|
3899
4328
|
}
|
|
3900
4329
|
if (i === void 0) {
|
|
3901
4330
|
let t = o.filter((e) => e > l && e <= r);
|
|
3902
4331
|
for (let r of t) {
|
|
3903
|
-
let t = e.slice(l, r), o =
|
|
4332
|
+
let t = e.slice(l, r), o = ii(n.measureText(t), "measureText");
|
|
3904
4333
|
o <= n.maxWidth && (i = r, a = o);
|
|
3905
4334
|
}
|
|
3906
|
-
i === void 0 && (i = t[0] ?? r, a =
|
|
4335
|
+
i === void 0 && (i = t[0] ?? r, a = ii(n.measureText(e.slice(l, i)), "measureText"));
|
|
3907
4336
|
}
|
|
3908
4337
|
c.push({
|
|
3909
4338
|
text: e.slice(l, i),
|
|
@@ -3914,37 +4343,37 @@ function _r(e, t, n, r, i) {
|
|
|
3914
4343
|
}
|
|
3915
4344
|
return c;
|
|
3916
4345
|
}
|
|
3917
|
-
function
|
|
4346
|
+
function si(e) {
|
|
3918
4347
|
if (typeof e.text != "string") throw TypeError("text must be a string.");
|
|
3919
4348
|
if (!Number.isFinite(e.maxWidth) || e.maxWidth <= 0) throw TypeError("maxWidth must be a positive finite number.");
|
|
3920
4349
|
if (typeof e.measureText != "function") throw TypeError("measureText must be a function.");
|
|
3921
|
-
let t = e.locale ?? "ja", n = e.lineBreakProvider ??
|
|
3922
|
-
for (let a of e.text.matchAll(
|
|
4350
|
+
let t = e.locale ?? "ja", n = e.lineBreakProvider ?? ri(t), r = [], i = 0;
|
|
4351
|
+
for (let a of e.text.matchAll(ni)) {
|
|
3923
4352
|
let o = a.index;
|
|
3924
|
-
r.push(...
|
|
4353
|
+
r.push(...oi(e.text.slice(i, o), i, e, n, t)), i = o + a[0].length;
|
|
3925
4354
|
}
|
|
3926
|
-
return r.push(...
|
|
4355
|
+
return r.push(...oi(e.text.slice(i), i, e, n, t)), Object.freeze({
|
|
3927
4356
|
lines: Object.freeze(r.map((e) => Object.freeze(e))),
|
|
3928
4357
|
maxLineWidth: Math.max(0, ...r.map((e) => e.width))
|
|
3929
4358
|
});
|
|
3930
4359
|
}
|
|
3931
4360
|
//#endregion
|
|
3932
4361
|
//#region src/reveal.ts
|
|
3933
|
-
var
|
|
4362
|
+
var ci = Object.freeze([
|
|
3934
4363
|
"CHARACTER",
|
|
3935
4364
|
"WORD",
|
|
3936
4365
|
"LINE",
|
|
3937
4366
|
"BLOCK"
|
|
3938
4367
|
]);
|
|
3939
|
-
function
|
|
4368
|
+
function li(e) {
|
|
3940
4369
|
let t = globalThis.Intl?.Segmenter;
|
|
3941
4370
|
return typeof t == "function" ? [...new t(void 0, { granularity: "grapheme" }).segment(e)].map(({ segment: e }) => e) : Array.from(e);
|
|
3942
4371
|
}
|
|
3943
|
-
function
|
|
3944
|
-
if (typeof e != "string" || !
|
|
4372
|
+
function ui(e) {
|
|
4373
|
+
if (typeof e != "string" || !ci.includes(e)) throw TypeError("Bubble reveal unit must be CHARACTER, WORD, LINE, or BLOCK.");
|
|
3945
4374
|
return e;
|
|
3946
4375
|
}
|
|
3947
|
-
function
|
|
4376
|
+
function di(e) {
|
|
3948
4377
|
if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("Bubble reveal must be an object.");
|
|
3949
4378
|
let t = e, n = /* @__PURE__ */ new Set([
|
|
3950
4379
|
"unit",
|
|
@@ -3955,7 +4384,7 @@ function Sr(e) {
|
|
|
3955
4384
|
"sound"
|
|
3956
4385
|
]);
|
|
3957
4386
|
if (Object.keys(t).filter((e) => !n.has(e)).length > 0 || t.unit === void 0) throw TypeError("Bubble reveal has unknown or missing properties.");
|
|
3958
|
-
let r =
|
|
4387
|
+
let r = ui(t.unit), i = t.delimiters ?? " \r\n";
|
|
3959
4388
|
if (typeof i != "string" || i.length === 0) throw TypeError("Bubble WORD delimiters must be a non-empty string.");
|
|
3960
4389
|
let a = t.showDelimiters ?? !1;
|
|
3961
4390
|
if (typeof a != "boolean") throw TypeError("Bubble reveal showDelimiters must be boolean.");
|
|
@@ -3974,16 +4403,16 @@ function Sr(e) {
|
|
|
3974
4403
|
...c === void 0 ? {} : { sound: c }
|
|
3975
4404
|
});
|
|
3976
4405
|
}
|
|
3977
|
-
function
|
|
4406
|
+
function fi(e, t, n) {
|
|
3978
4407
|
let r = new Set(Array.from(t)), i = [], a = "";
|
|
3979
|
-
for (let t of
|
|
4408
|
+
for (let t of li(e)) a += t, r.has(t) && ((n || a.slice(0, -t.length).length > 0) && i.push(n ? a : a.slice(0, -t.length)), a = "");
|
|
3980
4409
|
return a.length > 0 && i.push(a), i.filter((e) => e.length > 0);
|
|
3981
4410
|
}
|
|
3982
|
-
function
|
|
4411
|
+
function pi(e, t) {
|
|
3983
4412
|
if (e.length === 0) return Object.freeze([""]);
|
|
3984
|
-
if (t.unit === "CHARACTER") return Object.freeze(
|
|
4413
|
+
if (t.unit === "CHARACTER") return Object.freeze(li(e));
|
|
3985
4414
|
if (t.unit === "WORD") {
|
|
3986
|
-
let n =
|
|
4415
|
+
let n = fi(e, t.delimiters, t.showDelimiters);
|
|
3987
4416
|
if (t.showDelimiters) return Object.freeze(n);
|
|
3988
4417
|
let r = [], i = 0;
|
|
3989
4418
|
for (let a of n) {
|
|
@@ -4001,21 +4430,59 @@ function wr(e, t) {
|
|
|
4001
4430
|
let i = r;
|
|
4002
4431
|
return Object.freeze(i.length > 0 ? i : [e]);
|
|
4003
4432
|
}
|
|
4004
|
-
function
|
|
4433
|
+
function mi(e, t) {
|
|
4005
4434
|
return e.slice(0, Math.max(0, Math.min(t, e.length))).join("");
|
|
4006
4435
|
}
|
|
4007
4436
|
//#endregion
|
|
4437
|
+
//#region src/portrait-layout.ts
|
|
4438
|
+
var hi = Object.freeze([
|
|
4439
|
+
"left",
|
|
4440
|
+
"right",
|
|
4441
|
+
"top-left",
|
|
4442
|
+
"top-right",
|
|
4443
|
+
"bottom-left",
|
|
4444
|
+
"bottom-right"
|
|
4445
|
+
]), gi = Object.freeze({
|
|
4446
|
+
x: 0,
|
|
4447
|
+
y: 0,
|
|
4448
|
+
zoomPercent: 100
|
|
4449
|
+
});
|
|
4450
|
+
function _i(e) {
|
|
4451
|
+
if (typeof e != "string") throw TypeError("Bubble portrait placement must be a string.");
|
|
4452
|
+
let t = e.trim().toLowerCase().replaceAll("_", "-");
|
|
4453
|
+
if (!hi.includes(t)) throw TypeError(`Unsupported Bubble portrait placement: ${e}`);
|
|
4454
|
+
return t;
|
|
4455
|
+
}
|
|
4456
|
+
function vi(e) {
|
|
4457
|
+
if (!Array.isArray(e) || e.length !== 2 && e.length !== 3) throw TypeError("Bubble portrait offset must be [x, y] or [x, y, zoom].");
|
|
4458
|
+
let [t, n, r = 100] = e;
|
|
4459
|
+
if (![
|
|
4460
|
+
t,
|
|
4461
|
+
n,
|
|
4462
|
+
r
|
|
4463
|
+
].every(Number.isFinite) || r <= 0) throw TypeError("Bubble portrait offset values must be finite and zoom positive.");
|
|
4464
|
+
return Object.freeze({
|
|
4465
|
+
x: t,
|
|
4466
|
+
y: n,
|
|
4467
|
+
zoomPercent: r
|
|
4468
|
+
});
|
|
4469
|
+
}
|
|
4470
|
+
function yi(e) {
|
|
4471
|
+
if (typeof e != "number" || !Number.isFinite(e) || e < 0) throw TypeError("Bubble portrait corner radius must be zero or greater.");
|
|
4472
|
+
return e;
|
|
4473
|
+
}
|
|
4474
|
+
//#endregion
|
|
4008
4475
|
//#region src/composition.ts
|
|
4009
4476
|
var Z = class extends Error {
|
|
4010
4477
|
code;
|
|
4011
4478
|
constructor(e, t) {
|
|
4012
4479
|
super(t), this.name = "BubbleCompositionError", this.code = e;
|
|
4013
4480
|
}
|
|
4014
|
-
},
|
|
4481
|
+
}, bi = /* @__PURE__ */ new Set(["say", "think"]), xi = /* @__PURE__ */ new Set([
|
|
4015
4482
|
"idle",
|
|
4016
4483
|
"talking",
|
|
4017
4484
|
"awaiting-continue"
|
|
4018
|
-
]),
|
|
4485
|
+
]), Si = /* @__PURE__ */ new Set([
|
|
4019
4486
|
"fadeIn",
|
|
4020
4487
|
"fadeOut",
|
|
4021
4488
|
"floatIn",
|
|
@@ -4027,7 +4494,7 @@ var Z = class extends Error {
|
|
|
4027
4494
|
"shake",
|
|
4028
4495
|
"explode",
|
|
4029
4496
|
"animateBubbleShape"
|
|
4030
|
-
]),
|
|
4497
|
+
]), Ci = /* @__PURE__ */ new Set([
|
|
4031
4498
|
"linear",
|
|
4032
4499
|
"easeIn",
|
|
4033
4500
|
"easeOut",
|
|
@@ -4036,41 +4503,55 @@ var Z = class extends Error {
|
|
|
4036
4503
|
function Q(e) {
|
|
4037
4504
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
4038
4505
|
}
|
|
4039
|
-
function
|
|
4506
|
+
function wi(e, t, n, r) {
|
|
4040
4507
|
let i = /* @__PURE__ */ new Set([...t, ...n]), a = t.filter((t) => !Object.prototype.hasOwnProperty.call(e, t)), o = Object.keys(e).filter((e) => !i.has(e));
|
|
4041
4508
|
if (a.length > 0 || o.length > 0) throw new Z("BUBBLE-COMPOSITION-001", `${r} has missing or unknown properties.`);
|
|
4042
4509
|
}
|
|
4043
|
-
function
|
|
4510
|
+
function Ti(e, t) {
|
|
4044
4511
|
if (typeof e != "string" || e.trim().length === 0) throw new Z("BUBBLE-COMPOSITION-001", `${t} must be a non-empty string.`);
|
|
4045
4512
|
return e.trim();
|
|
4046
4513
|
}
|
|
4047
|
-
function
|
|
4514
|
+
function Ei(e, t) {
|
|
4048
4515
|
if (typeof e != "string" || e.length === 0) throw new Z("BUBBLE-COMPOSITION-001", `${t} must be a non-empty string.`);
|
|
4049
4516
|
return e;
|
|
4050
4517
|
}
|
|
4051
|
-
function
|
|
4518
|
+
function Di(e, t, n) {
|
|
4052
4519
|
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", `${t} must be an object.`);
|
|
4053
|
-
if (
|
|
4054
|
-
let r = Object.freeze(e.frames.map((e, n) =>
|
|
4520
|
+
if (wi(e, ["frames", "frameIntervalSeconds"], [], t), !Array.isArray(e.frames) || e.frames.length < n) throw new Z("BUBBLE-COMPOSITION-001", `${t}.frames must contain at least ${n} image asset name${n === 1 ? "" : "s"}.`);
|
|
4521
|
+
let r = Object.freeze(e.frames.map((e, n) => Ei(e, `${t}.frames[${n}]`))), i = e.frameIntervalSeconds;
|
|
4055
4522
|
if (typeof i != "number" || !Number.isFinite(i) || i <= 0) throw new Z("BUBBLE-COMPOSITION-001", `${t}.frameIntervalSeconds must be a positive finite number.`);
|
|
4056
4523
|
return Object.freeze({
|
|
4057
4524
|
frames: r,
|
|
4058
4525
|
frameIntervalSeconds: i
|
|
4059
4526
|
});
|
|
4060
4527
|
}
|
|
4061
|
-
function
|
|
4528
|
+
function Oi(e) {
|
|
4062
4529
|
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble portrait must be an object.");
|
|
4063
|
-
|
|
4064
|
-
|
|
4530
|
+
wi(e, ["base"], [
|
|
4531
|
+
"blink",
|
|
4532
|
+
"lipSync",
|
|
4533
|
+
"placement",
|
|
4534
|
+
"offset",
|
|
4535
|
+
"cornerRadius"
|
|
4536
|
+
], "Bubble portrait");
|
|
4537
|
+
let t = e.blink === void 0 ? void 0 : Di(e.blink, "Bubble portrait blink", 1), n = e.lipSync === void 0 ? void 0 : Di(e.lipSync, "Bubble portrait lip-sync", 1), r, i, a;
|
|
4538
|
+
try {
|
|
4539
|
+
r = _i(e.placement ?? "left"), i = e.offset === void 0 ? gi : vi(e.offset), a = yi(e.cornerRadius ?? 0);
|
|
4540
|
+
} catch (e) {
|
|
4541
|
+
throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble portrait layout is invalid.");
|
|
4542
|
+
}
|
|
4065
4543
|
return Object.freeze({
|
|
4066
|
-
base:
|
|
4544
|
+
base: Ei(e.base, "Bubble portrait base"),
|
|
4067
4545
|
...t === void 0 ? {} : { blink: t },
|
|
4068
|
-
...n === void 0 ? {} : { lipSync: n }
|
|
4546
|
+
...n === void 0 ? {} : { lipSync: n },
|
|
4547
|
+
placement: r,
|
|
4548
|
+
offset: i,
|
|
4549
|
+
cornerRadius: a
|
|
4069
4550
|
});
|
|
4070
4551
|
}
|
|
4071
|
-
function
|
|
4552
|
+
function ki(e, t) {
|
|
4072
4553
|
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", `${t} must be an object.`);
|
|
4073
|
-
if (
|
|
4554
|
+
if (wi(e, ["name"], [
|
|
4074
4555
|
"durationSeconds",
|
|
4075
4556
|
"ease",
|
|
4076
4557
|
"direction",
|
|
@@ -4078,7 +4559,7 @@ function Fr(e, t) {
|
|
|
4078
4559
|
"relativeScale",
|
|
4079
4560
|
"speed",
|
|
4080
4561
|
"visualStyle"
|
|
4081
|
-
], t), !
|
|
4562
|
+
], t), !Si.has(e.name)) throw new Z("BUBBLE-COMPOSITION-001", `${t}.name is not a supported Bubble motion.`);
|
|
4082
4563
|
let n = (n, r, i = !1) => {
|
|
4083
4564
|
let a = e[n];
|
|
4084
4565
|
if (a !== void 0) {
|
|
@@ -4088,9 +4569,9 @@ function Fr(e, t) {
|
|
|
4088
4569
|
}, r = n("durationSeconds", 0), i = n("count", 1, !0), a = n("relativeScale", 0), o = n("speed", 0), s = e.direction;
|
|
4089
4570
|
if (s !== void 0 && typeof s != "number" && typeof s != "string") throw new Z("BUBBLE-COMPOSITION-001", `${t}.direction is invalid.`);
|
|
4090
4571
|
let c = e.ease ?? "easeInOut";
|
|
4091
|
-
if (typeof c != "string" || !
|
|
4572
|
+
if (typeof c != "string" || !Ci.has(c)) throw new Z("BUBBLE-COMPOSITION-001", `${t}.ease is invalid.`);
|
|
4092
4573
|
let l = e.visualStyle;
|
|
4093
|
-
if (l !== void 0 && (typeof l != "string" || !
|
|
4574
|
+
if (l !== void 0 && (typeof l != "string" || !je.includes(l))) throw new Z("BUBBLE-COMPOSITION-001", `${t}.visualStyle is invalid.`);
|
|
4094
4575
|
return Object.freeze({
|
|
4095
4576
|
name: e.name,
|
|
4096
4577
|
...r === void 0 ? {} : { durationSeconds: r },
|
|
@@ -4102,10 +4583,10 @@ function Fr(e, t) {
|
|
|
4102
4583
|
...l === void 0 ? {} : { visualStyle: l }
|
|
4103
4584
|
});
|
|
4104
4585
|
}
|
|
4105
|
-
function
|
|
4586
|
+
function Ai(e) {
|
|
4106
4587
|
if (e === void 0) return;
|
|
4107
4588
|
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble audio must be an object.");
|
|
4108
|
-
|
|
4589
|
+
wi(e, [], [
|
|
4109
4590
|
"voice",
|
|
4110
4591
|
"reveal",
|
|
4111
4592
|
"finish"
|
|
@@ -4117,13 +4598,13 @@ function Ir(e) {
|
|
|
4117
4598
|
"finish"
|
|
4118
4599
|
]) {
|
|
4119
4600
|
let r = e[n];
|
|
4120
|
-
r !== void 0 && (t[n] =
|
|
4601
|
+
r !== void 0 && (t[n] = Ei(r, `Bubble audio ${n}`));
|
|
4121
4602
|
}
|
|
4122
4603
|
return Object.freeze(t);
|
|
4123
4604
|
}
|
|
4124
|
-
function
|
|
4605
|
+
function ji(e) {
|
|
4125
4606
|
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble style must be an object.");
|
|
4126
|
-
|
|
4607
|
+
wi(e, ["name", "textStyle"], [
|
|
4127
4608
|
"placement",
|
|
4128
4609
|
"maxWidth",
|
|
4129
4610
|
"textLocale",
|
|
@@ -4138,35 +4619,35 @@ function Lr(e) {
|
|
|
4138
4619
|
"showAnimation",
|
|
4139
4620
|
"hideAnimation"
|
|
4140
4621
|
], "Bubble style");
|
|
4141
|
-
let t = e.portrait === void 0 ? void 0 :
|
|
4622
|
+
let t = e.portrait === void 0 ? void 0 : Oi(e.portrait), n = e.continueIndicator === void 0 ? void 0 : Di(e.continueIndicator, "Bubble continue indicator", 2), r;
|
|
4142
4623
|
if (e.reveal !== void 0) try {
|
|
4143
|
-
r =
|
|
4624
|
+
r = di(e.reveal);
|
|
4144
4625
|
} catch (e) {
|
|
4145
4626
|
throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble reveal is invalid.");
|
|
4146
4627
|
}
|
|
4147
|
-
let i =
|
|
4628
|
+
let i = Ai(e.audio), a = e.showAnimation === void 0 ? void 0 : ki(e.showAnimation, "Bubble showAnimation"), o = e.hideAnimation === void 0 ? void 0 : ki(e.hideAnimation, "Bubble hideAnimation"), s;
|
|
4148
4629
|
try {
|
|
4149
|
-
s =
|
|
4630
|
+
s = _e(e.placement ?? "up-right");
|
|
4150
4631
|
} catch (e) {
|
|
4151
4632
|
throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble placement is invalid.");
|
|
4152
4633
|
}
|
|
4153
4634
|
let c, l, u;
|
|
4154
4635
|
try {
|
|
4155
|
-
c =
|
|
4636
|
+
c = xe(e.distance ?? 12), l = Se(e.tailLength ?? 18), u = e.offset === void 0 ? ye : Ce(e.offset);
|
|
4156
4637
|
} catch (e) {
|
|
4157
4638
|
throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble actor-relative transform is invalid.");
|
|
4158
4639
|
}
|
|
4159
4640
|
let d = e.visualStyle ?? "NORMAL";
|
|
4160
|
-
if (typeof d != "string" || !
|
|
4641
|
+
if (typeof d != "string" || !je.includes(d)) throw new Z("BUBBLE-COMPOSITION-001", `Unsupported Bubble visual style: ${String(d)}`);
|
|
4161
4642
|
let f;
|
|
4162
4643
|
if (e.maxWidth !== void 0) {
|
|
4163
4644
|
if (typeof e.maxWidth != "number" || !Number.isFinite(e.maxWidth) || e.maxWidth <= 0) throw new Z("BUBBLE-COMPOSITION-001", "Bubble style maxWidth must be a positive finite number.");
|
|
4164
4645
|
f = e.maxWidth;
|
|
4165
4646
|
}
|
|
4166
|
-
let p = e.textLocale === void 0 ? void 0 :
|
|
4647
|
+
let p = e.textLocale === void 0 ? void 0 : Ti(e.textLocale, "Bubble style text locale");
|
|
4167
4648
|
return Object.freeze({
|
|
4168
|
-
name:
|
|
4169
|
-
textStyle:
|
|
4649
|
+
name: Ti(e.name, "Bubble style name"),
|
|
4650
|
+
textStyle: Ti(e.textStyle, "Bubble text style name"),
|
|
4170
4651
|
...f === void 0 ? {} : { maxWidth: f },
|
|
4171
4652
|
...p === void 0 ? {} : { textLocale: p },
|
|
4172
4653
|
placement: s,
|
|
@@ -4182,13 +4663,13 @@ function Lr(e) {
|
|
|
4182
4663
|
...o === void 0 ? {} : { hideAnimation: o }
|
|
4183
4664
|
});
|
|
4184
4665
|
}
|
|
4185
|
-
function
|
|
4666
|
+
function Mi(e) {
|
|
4186
4667
|
if (e !== void 0) {
|
|
4187
4668
|
if (!Q(e) || typeof e.applyToTarget != "function" || typeof e.getMimeType != "function" || typeof e.isRegistered != "function") throw TypeError("Bubble image capability must provide applyToTarget, getMimeType, and isRegistered.");
|
|
4188
4669
|
return e;
|
|
4189
4670
|
}
|
|
4190
4671
|
}
|
|
4191
|
-
function
|
|
4672
|
+
function Ni(e) {
|
|
4192
4673
|
if (e !== void 0) {
|
|
4193
4674
|
if (!Q(e) || typeof e.playSound != "function") throw TypeError("Bubble audio capability must provide playSound.");
|
|
4194
4675
|
if (e.isRegistered !== void 0 && typeof e.isRegistered != "function") throw TypeError("Bubble audio capability isRegistered must be a function.");
|
|
@@ -4196,67 +4677,67 @@ function zr(e) {
|
|
|
4196
4677
|
return e;
|
|
4197
4678
|
}
|
|
4198
4679
|
}
|
|
4199
|
-
function
|
|
4680
|
+
function Pi(e) {
|
|
4200
4681
|
if (e === void 0) throw new Z("BUBBLE-COMPOSITION-006", "Bubble image assets require an image capability. Provide options.imageResolver.");
|
|
4201
4682
|
return e;
|
|
4202
4683
|
}
|
|
4203
|
-
function
|
|
4684
|
+
function Fi(e) {
|
|
4204
4685
|
if (!Q(e) || typeof e.setText != "function" || typeof e.releaseTarget != "function") throw TypeError("Bubble text capability must provide setText and releaseTarget.");
|
|
4205
4686
|
return e;
|
|
4206
4687
|
}
|
|
4207
|
-
function
|
|
4688
|
+
function Ii() {
|
|
4208
4689
|
return Object.freeze({
|
|
4209
4690
|
setTimeout: (e, t) => globalThis.setTimeout(e, t),
|
|
4210
4691
|
clearTimeout: (e) => globalThis.clearTimeout(e)
|
|
4211
4692
|
});
|
|
4212
4693
|
}
|
|
4213
|
-
function
|
|
4694
|
+
function Li(e) {
|
|
4214
4695
|
if (!Q(e) || typeof e.setTimeout != "function" || typeof e.clearTimeout != "function") throw TypeError("Bubble scheduler must provide setTimeout and clearTimeout.");
|
|
4215
4696
|
return e;
|
|
4216
4697
|
}
|
|
4217
|
-
function
|
|
4698
|
+
function Ri(e, t) {
|
|
4218
4699
|
if (!Q(e) || typeof e.id != "string" || e.id.length === 0 || typeof e.isStage != "boolean") throw new Z("BUBBLE-COMPOSITION-004", `${t} must provide id and isStage.`);
|
|
4219
4700
|
return e;
|
|
4220
4701
|
}
|
|
4221
|
-
function
|
|
4702
|
+
function zi(e) {
|
|
4222
4703
|
if (typeof e != "object" || !e) throw new Z("BUBBLE-COMPOSITION-004", "Bubble text target must be a non-null object.");
|
|
4223
4704
|
return e;
|
|
4224
4705
|
}
|
|
4225
|
-
function
|
|
4706
|
+
function Bi(e, t) {
|
|
4226
4707
|
if (!Q(e) || !Q(e.targets) || typeof e.setLayerVisible != "function" || typeof e.updateStyle != "function" || typeof e.show != "function" || typeof e.hide != "function" || typeof e.dispose != "function") throw new Z("BUBBLE-COMPOSITION-004", "Bubble surface is invalid.");
|
|
4227
4708
|
let n = e.targets;
|
|
4228
|
-
|
|
4709
|
+
zi(n.text);
|
|
4229
4710
|
let r = /* @__PURE__ */ new Set(), i = (e, t) => {
|
|
4230
4711
|
let i = n[e];
|
|
4231
4712
|
if (!t && i === void 0) return;
|
|
4232
|
-
let a =
|
|
4713
|
+
let a = Ri(i, `Bubble surface ${e}`);
|
|
4233
4714
|
if (r.has(a.id)) throw new Z("BUBBLE-COMPOSITION-004", "Bubble image layers must use distinct target IDs.");
|
|
4234
4715
|
r.add(a.id);
|
|
4235
4716
|
};
|
|
4236
4717
|
return i("portraitBase", t.portrait !== void 0), i("portraitBlink", t.portrait?.blink !== void 0), i("portraitLipSync", t.portrait?.lipSync !== void 0), i("continueIndicator", t.continueIndicator !== void 0), e;
|
|
4237
4718
|
}
|
|
4238
|
-
function
|
|
4719
|
+
function Vi(e, t) {
|
|
4239
4720
|
if (e === void 0) throw new Z("BUBBLE-COMPOSITION-006", `Bubble image capability is required for: ${t}. Provide options.imageResolver.`);
|
|
4240
4721
|
if (!e.isRegistered(t)) throw new Z("BUBBLE-COMPOSITION-003", `Bubble image asset is not registered: ${t}`);
|
|
4241
4722
|
if (!e.getMimeType(t).startsWith("image/")) throw new Z("BUBBLE-COMPOSITION-003", `Bubble asset is not an image: ${t}`);
|
|
4242
4723
|
}
|
|
4243
|
-
function
|
|
4724
|
+
function Hi(e, t) {
|
|
4244
4725
|
if (e === void 0) throw new Z("BUBBLE-COMPOSITION-006", `Bubble audio assets require an audio capability: ${t}. Provide options.audio.`);
|
|
4245
4726
|
if (e.isRegistered?.(t) === !1) throw new Z("BUBBLE-COMPOSITION-003", `Bubble audio asset is not registered: ${t}`);
|
|
4246
4727
|
let n = e.getMimeType?.(t);
|
|
4247
4728
|
if (n !== void 0 && !n.startsWith("audio/")) throw new Z("BUBBLE-COMPOSITION-003", `Bubble asset is not audio: ${t}`);
|
|
4248
4729
|
}
|
|
4249
|
-
function
|
|
4730
|
+
function Ui(e) {
|
|
4250
4731
|
return [...e.portrait === void 0 ? [] : [
|
|
4251
4732
|
e.portrait.base,
|
|
4252
4733
|
...e.portrait.blink?.frames ?? [],
|
|
4253
4734
|
...e.portrait.lipSync?.frames ?? []
|
|
4254
4735
|
], ...e.continueIndicator?.frames ?? []];
|
|
4255
4736
|
}
|
|
4256
|
-
function
|
|
4737
|
+
function Wi(e, t, n) {
|
|
4257
4738
|
if (t.maxWidth === void 0) return e;
|
|
4258
4739
|
if (typeof n.measureText != "function") throw new Z("BUBBLE-COMPOSITION-007", "Bubble style maxWidth requires the text capability measureText method.");
|
|
4259
|
-
return
|
|
4740
|
+
return si({
|
|
4260
4741
|
text: e,
|
|
4261
4742
|
maxWidth: t.maxWidth,
|
|
4262
4743
|
...t.textLocale === void 0 ? {} : { locale: t.textLocale },
|
|
@@ -4266,11 +4747,11 @@ function Xr(e, t, n) {
|
|
|
4266
4747
|
}) ?? 0
|
|
4267
4748
|
}).lines.map(({ text: e }) => e).join("\n");
|
|
4268
4749
|
}
|
|
4269
|
-
function
|
|
4750
|
+
function Gi(e, t) {
|
|
4270
4751
|
if (e.length === 1) throw e[0];
|
|
4271
4752
|
if (e.length > 1) throw AggregateError(e, t);
|
|
4272
4753
|
}
|
|
4273
|
-
function
|
|
4754
|
+
function Ki(e) {
|
|
4274
4755
|
let t = !1, n = 0, r = 0, i, a = Promise.resolve(), o = async (t) => {
|
|
4275
4756
|
let n = e.animation.frames[t];
|
|
4276
4757
|
n !== void 0 && await e.imageResolver.applyToTarget(n, e.target);
|
|
@@ -4305,40 +4786,40 @@ function Qr(e) {
|
|
|
4305
4786
|
}
|
|
4306
4787
|
});
|
|
4307
4788
|
}
|
|
4308
|
-
function
|
|
4789
|
+
function qi(e) {
|
|
4309
4790
|
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Show bubble input must be an object.");
|
|
4310
|
-
if (
|
|
4791
|
+
if (wi(e, [
|
|
4311
4792
|
"actor",
|
|
4312
4793
|
"actorKey",
|
|
4313
4794
|
"kind",
|
|
4314
4795
|
"text",
|
|
4315
4796
|
"styleName"
|
|
4316
|
-
], ["animationMode", "reveal"], "Show bubble input"), !
|
|
4797
|
+
], ["animationMode", "reveal"], "Show bubble input"), !bi.has(e.kind)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble kind must be say or think.");
|
|
4317
4798
|
if (typeof e.text != "string") throw new Z("BUBBLE-COMPOSITION-001", "Bubble text must be a string.");
|
|
4318
4799
|
let t = e.animationMode ?? "talking";
|
|
4319
|
-
if (!
|
|
4800
|
+
if (!xi.has(t)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid.");
|
|
4320
4801
|
let n;
|
|
4321
4802
|
if (e.reveal !== void 0) try {
|
|
4322
|
-
n =
|
|
4803
|
+
n = di(e.reveal);
|
|
4323
4804
|
} catch (e) {
|
|
4324
4805
|
throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble reveal is invalid.");
|
|
4325
4806
|
}
|
|
4326
4807
|
return {
|
|
4327
4808
|
actor: e.actor,
|
|
4328
|
-
actorKey:
|
|
4809
|
+
actorKey: Ti(e.actorKey, "Bubble actor key"),
|
|
4329
4810
|
kind: e.kind,
|
|
4330
4811
|
text: e.text,
|
|
4331
|
-
styleName:
|
|
4812
|
+
styleName: Ti(e.styleName, "Bubble style name"),
|
|
4332
4813
|
animationMode: t,
|
|
4333
4814
|
...n === void 0 ? {} : { reveal: n }
|
|
4334
4815
|
};
|
|
4335
4816
|
}
|
|
4336
|
-
function
|
|
4817
|
+
function Ji(e) {
|
|
4337
4818
|
if (!Q(e)) throw TypeError("Bubble composition options must be an object.");
|
|
4338
|
-
let t =
|
|
4819
|
+
let t = Mi(e.imageResolver), n = Ni(e.audio), r = Fi(e.textCapability);
|
|
4339
4820
|
if (typeof e.createSurface != "function") throw TypeError("Bubble composition createSurface must be a function.");
|
|
4340
4821
|
if (e.onAnimationError !== void 0 && typeof e.onAnimationError != "function") throw TypeError("Bubble composition onAnimationError must be a function.");
|
|
4341
|
-
let i =
|
|
4822
|
+
let i = Li(e.scheduler ?? Ii()), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = !1, l = () => {
|
|
4342
4823
|
if (c) throw new Z("BUBBLE-COMPOSITION-005", "Bubble composition has been disposed.");
|
|
4343
4824
|
}, u = async (e, t) => {
|
|
4344
4825
|
let n = (s.get(e) ?? Promise.resolve()).catch(() => void 0).then(t);
|
|
@@ -4358,8 +4839,8 @@ function ei(e) {
|
|
|
4358
4839
|
reveal: s.reveal
|
|
4359
4840
|
}));
|
|
4360
4841
|
let d = s.text, f = (e) => {
|
|
4361
|
-
let n = new Set(
|
|
4362
|
-
for (let e of n)
|
|
4842
|
+
let n = new Set(Ui(e)), r = n.size === 0 ? void 0 : Pi(t);
|
|
4843
|
+
for (let e of n) Vi(r, e);
|
|
4363
4844
|
return r;
|
|
4364
4845
|
}, p = f(u);
|
|
4365
4846
|
for (let e of [
|
|
@@ -4367,13 +4848,13 @@ function ei(e) {
|
|
|
4367
4848
|
u.audio?.reveal,
|
|
4368
4849
|
u.audio?.finish,
|
|
4369
4850
|
u.reveal?.sound
|
|
4370
|
-
]) e !== void 0 &&
|
|
4851
|
+
]) e !== void 0 && Hi(n, e);
|
|
4371
4852
|
let m = async (e, t = !1) => {
|
|
4372
4853
|
e !== void 0 && n !== void 0 && await n.playSound(e, { untilDone: t });
|
|
4373
4854
|
}, h = async (e, t, n) => {
|
|
4374
|
-
let r =
|
|
4855
|
+
let r = Ui(e).length === 0 ? void 0 : Pi(t), i = [];
|
|
4375
4856
|
if (e.portrait) {
|
|
4376
|
-
let t =
|
|
4857
|
+
let t = Pi(r);
|
|
4377
4858
|
i.push(Promise.resolve(t.applyToTarget(e.portrait.base, n.targets.portraitBase)));
|
|
4378
4859
|
let a = e.portrait.blink?.frames[0];
|
|
4379
4860
|
a !== void 0 && i.push(Promise.resolve(t.applyToTarget(a, n.targets.portraitBlink)));
|
|
@@ -4382,47 +4863,47 @@ function ei(e) {
|
|
|
4382
4863
|
}
|
|
4383
4864
|
let a = e.continueIndicator?.frames[0];
|
|
4384
4865
|
if (a !== void 0) {
|
|
4385
|
-
let e =
|
|
4866
|
+
let e = Pi(r);
|
|
4386
4867
|
i.push(Promise.resolve(e.applyToTarget(a, n.targets.continueIndicator)));
|
|
4387
4868
|
}
|
|
4388
4869
|
await Promise.all(i);
|
|
4389
4870
|
}, g = (t, n, r) => {
|
|
4390
|
-
x = t.portrait?.blink === void 0 ? void 0 :
|
|
4871
|
+
x = t.portrait?.blink === void 0 ? void 0 : Ki({
|
|
4391
4872
|
actorKey: s.actorKey,
|
|
4392
4873
|
layer: "portraitBlink",
|
|
4393
4874
|
animation: t.portrait.blink,
|
|
4394
4875
|
target: r.targets.portraitBlink,
|
|
4395
|
-
imageResolver:
|
|
4876
|
+
imageResolver: Pi(n),
|
|
4396
4877
|
scheduler: i,
|
|
4397
4878
|
...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
|
|
4398
|
-
}), S = t.portrait?.lipSync === void 0 ? void 0 :
|
|
4879
|
+
}), S = t.portrait?.lipSync === void 0 ? void 0 : Ki({
|
|
4399
4880
|
actorKey: s.actorKey,
|
|
4400
4881
|
layer: "portraitLipSync",
|
|
4401
4882
|
animation: t.portrait.lipSync,
|
|
4402
4883
|
target: r.targets.portraitLipSync,
|
|
4403
|
-
imageResolver:
|
|
4884
|
+
imageResolver: Pi(n),
|
|
4404
4885
|
scheduler: i,
|
|
4405
4886
|
...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
|
|
4406
|
-
}), C = t.continueIndicator === void 0 ? void 0 :
|
|
4887
|
+
}), C = t.continueIndicator === void 0 ? void 0 : Ki({
|
|
4407
4888
|
actorKey: s.actorKey,
|
|
4408
4889
|
layer: "continueIndicator",
|
|
4409
4890
|
animation: t.continueIndicator,
|
|
4410
4891
|
target: r.targets.continueIndicator,
|
|
4411
|
-
imageResolver:
|
|
4892
|
+
imageResolver: Pi(n),
|
|
4412
4893
|
scheduler: i,
|
|
4413
4894
|
...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
|
|
4414
4895
|
});
|
|
4415
4896
|
}, _ = o.get(s.actorKey);
|
|
4416
4897
|
_ && await _.close();
|
|
4417
|
-
let v, y = !1, b = !1, x, S, C, w = u.reveal, T = w ?
|
|
4898
|
+
let v, y = !1, b = !1, x, S, C, w = u.reveal, T = w ? pi(s.text, w) : Object.freeze([s.text]), E = w ? Math.min(1, T.length) : 1, D, O = 0;
|
|
4418
4899
|
try {
|
|
4419
|
-
v =
|
|
4900
|
+
v = Bi(await e.createSurface(Object.freeze({
|
|
4420
4901
|
actor: s.actor,
|
|
4421
4902
|
actorKey: s.actorKey,
|
|
4422
4903
|
kind: s.kind,
|
|
4423
4904
|
style: u
|
|
4424
4905
|
})), u);
|
|
4425
|
-
let t =
|
|
4906
|
+
let t = Wi(s.text, u, r);
|
|
4426
4907
|
w?.layout === "RESERVED" && (r.setText({
|
|
4427
4908
|
styleName: u.textStyle,
|
|
4428
4909
|
target: v.targets.text,
|
|
@@ -4430,15 +4911,15 @@ function ei(e) {
|
|
|
4430
4911
|
}), v.captureTextLayout?.()), r.setText({
|
|
4431
4912
|
styleName: u.textStyle,
|
|
4432
4913
|
target: v.targets.text,
|
|
4433
|
-
text:
|
|
4914
|
+
text: Wi(w ? mi(T, E) : s.text, u, r)
|
|
4434
4915
|
}), y = !0, await h(u, p, v), g(u, p, v);
|
|
4435
4916
|
let a = "idle", c = !1, l = Promise.resolve(), _ = async () => {
|
|
4436
4917
|
if (!v) return;
|
|
4437
|
-
let e = w ?
|
|
4918
|
+
let e = w ? mi(T, E) : d;
|
|
4438
4919
|
r.setText({
|
|
4439
4920
|
styleName: u.textStyle,
|
|
4440
4921
|
target: v.targets.text,
|
|
4441
|
-
text:
|
|
4922
|
+
text: Wi(e, u, r)
|
|
4442
4923
|
}), await v.show();
|
|
4443
4924
|
}, k = () => {
|
|
4444
4925
|
O += 1, D !== void 0 && i.clearTimeout(D), D = void 0;
|
|
@@ -4465,10 +4946,10 @@ function ei(e) {
|
|
|
4465
4946
|
},
|
|
4466
4947
|
setText(e) {
|
|
4467
4948
|
return c ? Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`)) : typeof e == "string" ? (l = l.then(async () => {
|
|
4468
|
-
v && (k(), d = e, w ? (T =
|
|
4949
|
+
v && (k(), d = e, w ? (T = pi(e, w), E = Math.min(1, T.length), w.layout === "RESERVED" && (r.setText({
|
|
4469
4950
|
styleName: u.textStyle,
|
|
4470
4951
|
target: v.targets.text,
|
|
4471
|
-
text:
|
|
4952
|
+
text: Wi(e, u, r)
|
|
4472
4953
|
}), v.captureTextLayout?.()), await _(), j()) : await _());
|
|
4473
4954
|
}), l) : Promise.reject(new Z("BUBBLE-COMPOSITION-001", "Bubble text must be a string."));
|
|
4474
4955
|
},
|
|
@@ -4476,32 +4957,32 @@ function ei(e) {
|
|
|
4476
4957
|
if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
4477
4958
|
let t;
|
|
4478
4959
|
try {
|
|
4479
|
-
t =
|
|
4960
|
+
t = ji(e);
|
|
4480
4961
|
} catch (e) {
|
|
4481
4962
|
return Promise.reject(e);
|
|
4482
4963
|
}
|
|
4483
4964
|
return l = l.then(async () => {
|
|
4484
4965
|
if (!v) return;
|
|
4485
|
-
|
|
4966
|
+
Bi(v, t);
|
|
4486
4967
|
let e = f(t);
|
|
4487
4968
|
for (let e of [
|
|
4488
4969
|
t.audio?.voice,
|
|
4489
4970
|
t.audio?.reveal,
|
|
4490
4971
|
t.audio?.finish,
|
|
4491
4972
|
t.reveal?.sound
|
|
4492
|
-
]) e !== void 0 &&
|
|
4973
|
+
]) e !== void 0 && Hi(n, e);
|
|
4493
4974
|
await Promise.all([
|
|
4494
4975
|
x?.stop(),
|
|
4495
4976
|
S?.stop(),
|
|
4496
4977
|
C?.stop()
|
|
4497
|
-
]), await h(t, e, v), await v.updateStyle(t), u = t, w = t.reveal, T = w ?
|
|
4978
|
+
]), await h(t, e, v), await v.updateStyle(t), u = t, w = t.reveal, T = w ? pi(d, w) : Object.freeze([d]), E = w ? Math.min(1, T.length) : 1, k(), w?.layout === "RESERVED" && (r.setText({
|
|
4498
4979
|
styleName: t.textStyle,
|
|
4499
4980
|
target: v.targets.text,
|
|
4500
|
-
text:
|
|
4981
|
+
text: Wi(d, t, r)
|
|
4501
4982
|
}), v.captureTextLayout?.()), r.setText({
|
|
4502
4983
|
styleName: t.textStyle,
|
|
4503
4984
|
target: v.targets.text,
|
|
4504
|
-
text:
|
|
4985
|
+
text: Wi(d, t, r)
|
|
4505
4986
|
}), g(t, e, v), await Promise.all([
|
|
4506
4987
|
v.setLayerVisible("portraitBase", t.portrait !== void 0),
|
|
4507
4988
|
v.setLayerVisible("portraitBlink", t.portrait?.blink !== void 0),
|
|
@@ -4513,7 +4994,7 @@ function ei(e) {
|
|
|
4513
4994
|
}), l;
|
|
4514
4995
|
},
|
|
4515
4996
|
setAnimationMode(e) {
|
|
4516
|
-
return c ? Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`)) :
|
|
4997
|
+
return c ? Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`)) : xi.has(e) ? (l = l.then(() => M(e)), l) : Promise.reject(new Z("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid."));
|
|
4517
4998
|
},
|
|
4518
4999
|
revealNext() {
|
|
4519
5000
|
if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
@@ -4531,13 +5012,13 @@ function ei(e) {
|
|
|
4531
5012
|
if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
4532
5013
|
let t = e.timeoutSeconds ?? 0;
|
|
4533
5014
|
return !Number.isFinite(t) || t < 0 ? Promise.reject(new Z("BUBBLE-COMPOSITION-001", "Bubble finish timeoutSeconds must be zero or greater.")) : e.condition !== void 0 && typeof e.condition != "function" ? Promise.reject(new Z("BUBBLE-COMPOSITION-001", "Bubble finish condition must be a function.")) : (l = l.then(async () => {
|
|
4534
|
-
if (k(), e.unit !== void 0 && (w =
|
|
5015
|
+
if (k(), e.unit !== void 0 && (w = di({
|
|
4535
5016
|
...w ?? {},
|
|
4536
5017
|
unit: e.unit
|
|
4537
|
-
}), T =
|
|
5018
|
+
}), T = pi(d, w), E = Math.min(1, T.length), w.layout === "RESERVED" && v && (r.setText({
|
|
4538
5019
|
styleName: u.textStyle,
|
|
4539
5020
|
target: v.targets.text,
|
|
4540
|
-
text:
|
|
5021
|
+
text: Wi(d, u, r)
|
|
4541
5022
|
}), v.captureTextLayout?.())), w) for (; await A(););
|
|
4542
5023
|
let n = e.condition;
|
|
4543
5024
|
if (n === void 0 && t === 0) {
|
|
@@ -4571,7 +5052,7 @@ function ei(e) {
|
|
|
4571
5052
|
if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
4572
5053
|
let t;
|
|
4573
5054
|
try {
|
|
4574
|
-
t =
|
|
5055
|
+
t = ki(e, "Bubble motion");
|
|
4575
5056
|
} catch (e) {
|
|
4576
5057
|
return Promise.reject(e);
|
|
4577
5058
|
}
|
|
@@ -4614,7 +5095,7 @@ function ei(e) {
|
|
|
4614
5095
|
} catch (t) {
|
|
4615
5096
|
e.push(t);
|
|
4616
5097
|
}
|
|
4617
|
-
o.get(s.actorKey) === N && o.delete(s.actorKey),
|
|
5098
|
+
o.get(s.actorKey) === N && o.delete(s.actorKey), Gi(e, `Failed to close bubble: ${s.actorKey}`);
|
|
4618
5099
|
}
|
|
4619
5100
|
});
|
|
4620
5101
|
return o.set(s.actorKey, N), j(), u.showAnimation !== void 0 && await N.animate(u.showAnimation), N;
|
|
@@ -4646,50 +5127,85 @@ function ei(e) {
|
|
|
4646
5127
|
return Object.freeze({
|
|
4647
5128
|
defineStyle(e) {
|
|
4648
5129
|
l();
|
|
4649
|
-
let t =
|
|
5130
|
+
let t = ji(e);
|
|
4650
5131
|
a.set(t.name, t);
|
|
4651
5132
|
},
|
|
4652
5133
|
hasActiveBubble(e) {
|
|
4653
|
-
return o.has(
|
|
5134
|
+
return o.has(Ti(e, "Bubble actor key"));
|
|
4654
5135
|
},
|
|
4655
5136
|
async show(e) {
|
|
4656
5137
|
l();
|
|
4657
|
-
let t =
|
|
5138
|
+
let t = qi(e);
|
|
4658
5139
|
return u(t.actorKey, () => d(t));
|
|
4659
5140
|
},
|
|
4660
5141
|
releaseTarget(e) {
|
|
4661
5142
|
l();
|
|
4662
|
-
let t =
|
|
5143
|
+
let t = Ti(e, "Bubble actor key");
|
|
4663
5144
|
return u(t, async () => {
|
|
4664
5145
|
await o.get(t)?.close();
|
|
4665
5146
|
});
|
|
4666
5147
|
},
|
|
4667
5148
|
async releaseAll() {
|
|
4668
|
-
l(), await Promise.allSettled([...s.values()]),
|
|
5149
|
+
l(), await Promise.allSettled([...s.values()]), Gi((await Promise.allSettled([...o.values()].map((e) => e.close()))).flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to release all bubbles");
|
|
4669
5150
|
},
|
|
4670
5151
|
async dispose() {
|
|
4671
5152
|
if (c) return;
|
|
4672
5153
|
c = !0, await Promise.allSettled([...s.values()]);
|
|
4673
5154
|
let e = await Promise.allSettled([...o.values()].map((e) => e.close()));
|
|
4674
|
-
a.clear(),
|
|
5155
|
+
a.clear(), Gi(e.flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to dispose bubble composition");
|
|
4675
5156
|
}
|
|
4676
5157
|
});
|
|
4677
5158
|
}
|
|
4678
5159
|
//#endregion
|
|
4679
5160
|
//#region src/turbowarp-svg-text-adapter.ts
|
|
4680
|
-
function
|
|
5161
|
+
function Yi(e) {
|
|
4681
5162
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
4682
5163
|
}
|
|
4683
|
-
function
|
|
4684
|
-
if (!
|
|
5164
|
+
function Xi(e) {
|
|
5165
|
+
if (!Yi(e) || typeof e.setText != "function" || typeof e.releaseTextActor != "function") throw TypeError("TurboWarp SVG Text adapter requires setText and releaseTextActor.");
|
|
4685
5166
|
return e;
|
|
4686
5167
|
}
|
|
4687
|
-
function
|
|
4688
|
-
if (!
|
|
5168
|
+
function Zi(e) {
|
|
5169
|
+
if (!Yi(e) || typeof e.setText != "function" || typeof e.releaseTarget != "function") throw TypeError("SVG Text composition adapter requires setText and releaseTarget.");
|
|
5170
|
+
return e;
|
|
5171
|
+
}
|
|
5172
|
+
function Qi(e) {
|
|
5173
|
+
if (!Yi(e) || typeof e.layoutText != "function") throw TypeError("SVG Text overlay adapter requires the layoutText composition API.");
|
|
4689
5174
|
return e;
|
|
4690
5175
|
}
|
|
4691
|
-
function
|
|
4692
|
-
let
|
|
5176
|
+
function $i(e, t) {
|
|
5177
|
+
let n = Number(e);
|
|
5178
|
+
if (!Number.isFinite(n)) throw TypeError(`${t} must be a finite number.`);
|
|
5179
|
+
return n;
|
|
5180
|
+
}
|
|
5181
|
+
function ea(e) {
|
|
5182
|
+
if (!Yi(e) || !Yi(e.style) || !Array.isArray(e.lines)) throw TypeError("SVG Text layout result is invalid.");
|
|
5183
|
+
let t = e.style, n = t.alignment;
|
|
5184
|
+
if (n !== "left" && n !== "center" && n !== "right") throw TypeError("SVG Text layout alignment is invalid.");
|
|
5185
|
+
let r = $i(e.width, "SVG Text layout width"), i = $i(e.height, "SVG Text layout height"), a = Object.freeze(e.lines.map((e) => {
|
|
5186
|
+
if (!Yi(e) || typeof e.text != "string") throw TypeError("SVG Text layout line is invalid.");
|
|
5187
|
+
return Object.freeze({
|
|
5188
|
+
baseline: $i(e.baseline, "SVG Text line baseline") - i / 2,
|
|
5189
|
+
text: e.text,
|
|
5190
|
+
x: $i(e.x, "SVG Text line x") - r / 2
|
|
5191
|
+
});
|
|
5192
|
+
}));
|
|
5193
|
+
return Object.freeze({
|
|
5194
|
+
alignment: n,
|
|
5195
|
+
backgroundColor: String(t.backgroundColor),
|
|
5196
|
+
backgroundCornerRadius: $i(t.cornerRadius, "SVG Text corner radius"),
|
|
5197
|
+
fill: String(t.textColor),
|
|
5198
|
+
fontFamily: String(t.font),
|
|
5199
|
+
fontSize: $i(t.fontSize, "SVG Text font size"),
|
|
5200
|
+
height: i,
|
|
5201
|
+
lineHeight: $i(t.lineHeight, "SVG Text line height"),
|
|
5202
|
+
lines: a,
|
|
5203
|
+
preserveWhitespace: e.preserveWhitespace !== !1,
|
|
5204
|
+
width: r
|
|
5205
|
+
});
|
|
5206
|
+
}
|
|
5207
|
+
function ta(e) {
|
|
5208
|
+
let t = Xi(e);
|
|
4693
5209
|
return Object.freeze({
|
|
4694
5210
|
setText({ styleName: e, target: n, text: r }) {
|
|
4695
5211
|
t.setText({
|
|
@@ -4706,8 +5222,8 @@ function ii(e) {
|
|
|
4706
5222
|
}
|
|
4707
5223
|
});
|
|
4708
5224
|
}
|
|
4709
|
-
function
|
|
4710
|
-
let t =
|
|
5225
|
+
function na(e) {
|
|
5226
|
+
let t = Zi(e), n = {
|
|
4711
5227
|
setText({ styleName: e, target: n, text: r }) {
|
|
4712
5228
|
t.setText({
|
|
4713
5229
|
styleName: e,
|
|
@@ -4724,19 +5240,698 @@ function ai(e) {
|
|
|
4724
5240
|
text: n
|
|
4725
5241
|
}) ?? 0), Object.freeze(n);
|
|
4726
5242
|
}
|
|
4727
|
-
|
|
5243
|
+
function ra(e) {
|
|
5244
|
+
let t = Qi(e);
|
|
5245
|
+
return Object.freeze({
|
|
5246
|
+
layoutText({ nativeSize: e, styleName: n, text: r }) {
|
|
5247
|
+
return ea(t.layoutText({
|
|
5248
|
+
nativeSize: [e.width, e.height],
|
|
5249
|
+
styleName: n,
|
|
5250
|
+
text: r
|
|
5251
|
+
}));
|
|
5252
|
+
},
|
|
5253
|
+
measureText({ nativeSize: e, styleName: n, text: r }) {
|
|
5254
|
+
let i = t.layoutText({
|
|
5255
|
+
nativeSize: [e.width, e.height],
|
|
5256
|
+
styleName: n,
|
|
5257
|
+
text: r
|
|
5258
|
+
});
|
|
5259
|
+
return Math.max(1, ...i.lines.map((e) => $i(e.width, "SVG Text line width")));
|
|
5260
|
+
}
|
|
5261
|
+
});
|
|
5262
|
+
}
|
|
5263
|
+
//#endregion
|
|
5264
|
+
//#region src/asset-manager-image-adapter.ts
|
|
5265
|
+
var ia = /* @__PURE__ */ new Set([
|
|
5266
|
+
"image/avif",
|
|
5267
|
+
"image/gif",
|
|
5268
|
+
"image/jpeg",
|
|
5269
|
+
"image/png",
|
|
5270
|
+
"image/svg+xml",
|
|
5271
|
+
"image/webp"
|
|
5272
|
+
]);
|
|
5273
|
+
function aa(e) {
|
|
5274
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
5275
|
+
}
|
|
5276
|
+
function oa(e) {
|
|
5277
|
+
let t = e.split(";", 1)[0]?.trim().toLowerCase() ?? "";
|
|
5278
|
+
return t === "image/jpg" || t === "image/pjpeg" ? "image/jpeg" : t === "image/x-png" ? "image/png" : t;
|
|
5279
|
+
}
|
|
5280
|
+
function sa(e) {
|
|
5281
|
+
return ia.has(oa(e));
|
|
5282
|
+
}
|
|
5283
|
+
function ca(e) {
|
|
5284
|
+
if (!aa(e) || typeof e.url != "string" || !e.url.startsWith("blob:") || typeof e.mimeType != "string" || !sa(e.mimeType) || typeof e.width != "number" || !Number.isFinite(e.width) || e.width <= 0 || typeof e.height != "number" || !Number.isFinite(e.height) || e.height <= 0 || typeof e.release != "function") throw TypeError("Asset Manager DOM image resources must provide a supported MIME type, positive intrinsic dimensions, a blob URL, and release().");
|
|
5285
|
+
return e;
|
|
5286
|
+
}
|
|
5287
|
+
function la(e) {
|
|
5288
|
+
if (!aa(e) || typeof e.isRegistered != "function" || typeof e.getMimeType != "function" || typeof e.resolveDOMImageResource != "function") throw TypeError("Asset Manager DOM image capability is invalid.");
|
|
5289
|
+
let t = e;
|
|
5290
|
+
return Object.freeze({
|
|
5291
|
+
isRegistered(e) {
|
|
5292
|
+
return t.isRegistered(e) && sa(t.getMimeType(e));
|
|
5293
|
+
},
|
|
5294
|
+
getMimeType(e) {
|
|
5295
|
+
return oa(t.getMimeType(e));
|
|
5296
|
+
},
|
|
5297
|
+
async resolveImage(e) {
|
|
5298
|
+
let n = oa(t.getMimeType(e));
|
|
5299
|
+
if (!t.isRegistered(e) || !sa(n)) throw TypeError("Asset Manager image is not registered with a Bubble-compatible MIME type.");
|
|
5300
|
+
let r = await t.resolveDOMImageResource(e);
|
|
5301
|
+
try {
|
|
5302
|
+
ca(r);
|
|
5303
|
+
let e = oa(r.mimeType);
|
|
5304
|
+
if (e !== n) throw TypeError("Asset Manager DOM image resource MIME type changed during resolution.");
|
|
5305
|
+
return Object.freeze({
|
|
5306
|
+
height: r.height,
|
|
5307
|
+
mimeType: e,
|
|
5308
|
+
src: r.url,
|
|
5309
|
+
width: r.width,
|
|
5310
|
+
release: () => r.release(),
|
|
5311
|
+
...e === "image/svg+xml" ? { svgSecurity: "sanitized" } : {}
|
|
5312
|
+
});
|
|
5313
|
+
} catch (e) {
|
|
5314
|
+
throw r?.release?.(), e;
|
|
5315
|
+
}
|
|
5316
|
+
}
|
|
5317
|
+
});
|
|
5318
|
+
}
|
|
5319
|
+
//#endregion
|
|
5320
|
+
//#region src/surface-motion.ts
|
|
5321
|
+
function ua(e) {
|
|
5322
|
+
return Math.max(0, Math.min(1, e));
|
|
5323
|
+
}
|
|
5324
|
+
function da(e, t) {
|
|
5325
|
+
let n = ua(e);
|
|
5326
|
+
switch (t) {
|
|
5327
|
+
case "linear": return n;
|
|
5328
|
+
case "easeIn": return n * n;
|
|
5329
|
+
case "easeOut": return 1 - (1 - n) * (1 - n);
|
|
5330
|
+
case "easeInOut": return n < .5 ? 2 * n * n : 1 - (-2 * n + 2) ** 2 / 2;
|
|
5331
|
+
default: return n;
|
|
5332
|
+
}
|
|
5333
|
+
}
|
|
5334
|
+
function fa(e, t, n) {
|
|
5335
|
+
let r = Math.max(0, t * 1e3);
|
|
5336
|
+
return r === 0 ? (n(1), Promise.resolve()) : new Promise((t, i) => {
|
|
5337
|
+
let a = 0, o, s = () => {
|
|
5338
|
+
let c = Math.min(16, r - a);
|
|
5339
|
+
a += c;
|
|
5340
|
+
try {
|
|
5341
|
+
n(ua(a / r));
|
|
5342
|
+
} catch (t) {
|
|
5343
|
+
o !== void 0 && e.clearTimeout(o), i(t);
|
|
5344
|
+
return;
|
|
5345
|
+
}
|
|
5346
|
+
if (a >= r) {
|
|
5347
|
+
t();
|
|
5348
|
+
return;
|
|
5349
|
+
}
|
|
5350
|
+
o = e.setTimeout(s, Math.min(16, r - a));
|
|
5351
|
+
};
|
|
5352
|
+
o = e.setTimeout(s, Math.min(16, r));
|
|
5353
|
+
});
|
|
5354
|
+
}
|
|
5355
|
+
//#endregion
|
|
5356
|
+
//#region src/svg-overlay-surface.ts
|
|
5357
|
+
var pa = "http://www.w3.org/2000/svg", ma = "http://www.w3.org/XML/1998/namespace", ha = 96, ga = 18, _a = 8, va = 16, ya = Symbol("BubbleSvgOverlayTextTarget"), ba = Symbol("BubbleSvgOverlayImageTarget"), xa = 0, Sa = Object.freeze(["scratch-render", "svg-overlay"]), Ca = "svg-overlay", wa = "error";
|
|
5358
|
+
function Ta(e) {
|
|
5359
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
5360
|
+
}
|
|
5361
|
+
function Ea(e) {
|
|
5362
|
+
let t = e.getNativeSize(), n = Array.isArray(t) ? Number(t[0]) : NaN, r = Array.isArray(t) ? Number(t[1]) : NaN;
|
|
5363
|
+
return Object.freeze({
|
|
5364
|
+
width: n > 0 ? n : 480,
|
|
5365
|
+
height: r > 0 ? r : 360
|
|
5366
|
+
});
|
|
5367
|
+
}
|
|
5368
|
+
function Da(e, t) {
|
|
5369
|
+
let n = Number(e);
|
|
5370
|
+
if (!Number.isFinite(n) || n <= 0) throw TypeError(`${t} must be a positive finite number.`);
|
|
5371
|
+
return n;
|
|
5372
|
+
}
|
|
5373
|
+
function Oa(e, t) {
|
|
5374
|
+
if (typeof e != "string" || e.length === 0 || e.length > 128) throw TypeError(`${t} must be a non-empty color string.`);
|
|
5375
|
+
if (/url\s*\(|[<>;]/iu.test(e)) throw TypeError(`${t} contains a disallowed SVG value.`);
|
|
5376
|
+
return e;
|
|
5377
|
+
}
|
|
5378
|
+
function ka(e) {
|
|
5379
|
+
if (typeof e != "string" || e.length === 0 || e.length > 256 || /url\s*\(|[<>{};]/iu.test(e)) throw TypeError("SVG overlay fontFamily is invalid.");
|
|
5380
|
+
return e;
|
|
5381
|
+
}
|
|
5382
|
+
function Aa(e) {
|
|
5383
|
+
if (!Ta(e) || !Array.isArray(e.lines)) throw TypeError("SVG overlay text layout is invalid.");
|
|
5384
|
+
let t = e.alignment;
|
|
5385
|
+
if (t !== "left" && t !== "center" && t !== "right") throw TypeError("SVG overlay text alignment is invalid.");
|
|
5386
|
+
let n = e.fontStyle;
|
|
5387
|
+
if (n !== void 0 && n !== "normal" && n !== "italic") throw TypeError("SVG overlay fontStyle is invalid.");
|
|
5388
|
+
let r = e.fontWeight;
|
|
5389
|
+
if (r !== void 0 && r !== "normal" && r !== "bold" && (!Number.isFinite(r) || Number(r) < 1 || Number(r) > 1e3)) throw TypeError("SVG overlay fontWeight is invalid.");
|
|
5390
|
+
let i = Object.freeze(e.lines.map((e) => {
|
|
5391
|
+
if (typeof e == "string") return e;
|
|
5392
|
+
if (!Ta(e) || typeof e.text != "string") throw TypeError("SVG overlay text lines must be strings or positioned line records.");
|
|
5393
|
+
let t = e.x !== void 0;
|
|
5394
|
+
if (t !== (e.baseline !== void 0)) throw TypeError("SVG overlay positioned text lines require both x and baseline.");
|
|
5395
|
+
if (t && (!Number.isFinite(e.x) || !Number.isFinite(e.baseline))) throw TypeError("SVG overlay text line coordinates must be finite numbers.");
|
|
5396
|
+
return Object.freeze({
|
|
5397
|
+
text: e.text,
|
|
5398
|
+
...t ? {
|
|
5399
|
+
x: Number(e.x),
|
|
5400
|
+
baseline: Number(e.baseline)
|
|
5401
|
+
} : {}
|
|
5402
|
+
});
|
|
5403
|
+
})), a = e.backgroundColor === void 0 ? void 0 : Oa(e.backgroundColor, "SVG overlay backgroundColor"), o = e.backgroundCornerRadius === void 0 ? void 0 : Number(e.backgroundCornerRadius);
|
|
5404
|
+
if (o !== void 0 && (!Number.isFinite(o) || o < 0)) throw TypeError("SVG overlay backgroundCornerRadius must be a non-negative finite number.");
|
|
5405
|
+
let s = e.preserveWhitespace;
|
|
5406
|
+
if (s !== void 0 && typeof s != "boolean") throw TypeError("SVG overlay preserveWhitespace must be a boolean.");
|
|
5407
|
+
return Object.freeze({
|
|
5408
|
+
alignment: t,
|
|
5409
|
+
fill: Oa(e.fill, "SVG overlay text fill"),
|
|
5410
|
+
fontFamily: ka(e.fontFamily),
|
|
5411
|
+
fontSize: Da(e.fontSize, "SVG overlay fontSize"),
|
|
5412
|
+
height: Da(e.height, "SVG overlay text height"),
|
|
5413
|
+
lineHeight: Da(e.lineHeight, "SVG overlay lineHeight"),
|
|
5414
|
+
lines: i,
|
|
5415
|
+
width: Da(e.width, "SVG overlay text width"),
|
|
5416
|
+
...a === void 0 ? {} : { backgroundColor: a },
|
|
5417
|
+
...o === void 0 ? {} : { backgroundCornerRadius: o },
|
|
5418
|
+
...n === void 0 ? {} : { fontStyle: n },
|
|
5419
|
+
...r === void 0 ? {} : { fontWeight: r },
|
|
5420
|
+
...s === void 0 ? {} : { preserveWhitespace: s }
|
|
5421
|
+
});
|
|
5422
|
+
}
|
|
5423
|
+
function ja(e, t) {
|
|
5424
|
+
let n = {
|
|
5425
|
+
width: 180,
|
|
5426
|
+
height: 48
|
|
5427
|
+
}, r, i, a, o = (r) => {
|
|
5428
|
+
let i = Aa(r), a = [];
|
|
5429
|
+
if (i.backgroundColor !== void 0 && i.backgroundColor !== "transparent") {
|
|
5430
|
+
let t = e.createElementNS(pa, "rect");
|
|
5431
|
+
t.setAttribute("x", String(-i.width / 2)), t.setAttribute("y", String(-i.height / 2)), t.setAttribute("width", String(i.width)), t.setAttribute("height", String(i.height)), t.setAttribute("fill", i.backgroundColor), i.backgroundCornerRadius !== void 0 && t.setAttribute("rx", String(i.backgroundCornerRadius)), a.push(t);
|
|
5432
|
+
}
|
|
5433
|
+
let o = e.createElementNS(pa, "text"), s = i.alignment === "left" ? "start" : i.alignment === "right" ? "end" : "middle", c = i.alignment === "left" ? -i.width / 2 : i.alignment === "right" ? i.width / 2 : 0;
|
|
5434
|
+
o.setAttribute("text-anchor", s), o.setAttribute("fill", i.fill), o.setAttribute("font-family", i.fontFamily), o.setAttribute("font-size", String(i.fontSize)), i.preserveWhitespace !== !1 && o.setAttributeNS(ma, "xml:space", "preserve"), i.fontStyle !== void 0 && o.setAttribute("font-style", i.fontStyle), i.fontWeight !== void 0 && o.setAttribute("font-weight", String(i.fontWeight));
|
|
5435
|
+
let l = -Math.max(i.fontSize, (i.lines.length - 1) * i.lineHeight + i.fontSize) / 2 + i.fontSize;
|
|
5436
|
+
i.lines.forEach((t, n) => {
|
|
5437
|
+
let r = e.createElementNS(pa, "tspan"), a = typeof t == "string" ? void 0 : t;
|
|
5438
|
+
r.setAttribute("x", String(a?.x ?? c)), r.setAttribute("y", String(a?.baseline ?? l + n * i.lineHeight)), r.textContent = typeof t == "string" ? t : t.text, o.appendChild(r);
|
|
5439
|
+
}), a.push(o), t.replaceChildren(...a), n = {
|
|
5440
|
+
width: i.width,
|
|
5441
|
+
height: i.height
|
|
5442
|
+
};
|
|
5443
|
+
};
|
|
5444
|
+
return Object.freeze({
|
|
5445
|
+
[ya]: !0,
|
|
5446
|
+
group: t,
|
|
5447
|
+
captureLayout() {
|
|
5448
|
+
i = r, a = { ...n };
|
|
5449
|
+
},
|
|
5450
|
+
clear() {
|
|
5451
|
+
t.replaceChildren(), n = {
|
|
5452
|
+
width: 180,
|
|
5453
|
+
height: 48
|
|
5454
|
+
}, r = void 0, i = void 0, a = void 0;
|
|
5455
|
+
},
|
|
5456
|
+
clearCapturedLayout() {
|
|
5457
|
+
i = void 0, a = void 0;
|
|
5458
|
+
},
|
|
5459
|
+
getCapturedSize() {
|
|
5460
|
+
return a;
|
|
5461
|
+
},
|
|
5462
|
+
getSize() {
|
|
5463
|
+
return n;
|
|
5464
|
+
},
|
|
5465
|
+
refresh() {
|
|
5466
|
+
if (i !== void 0) {
|
|
5467
|
+
let e = Aa(i());
|
|
5468
|
+
a = {
|
|
5469
|
+
width: e.width,
|
|
5470
|
+
height: e.height
|
|
5471
|
+
};
|
|
5472
|
+
}
|
|
5473
|
+
r !== void 0 && o(r());
|
|
5474
|
+
},
|
|
5475
|
+
render(e, t) {
|
|
5476
|
+
r = t, o(e);
|
|
5477
|
+
}
|
|
5478
|
+
});
|
|
5479
|
+
}
|
|
5480
|
+
function Ma(e) {
|
|
5481
|
+
let t = e;
|
|
5482
|
+
if (t?.[ya] !== !0) throw TypeError("SVG overlay text target is invalid.");
|
|
5483
|
+
return t;
|
|
5484
|
+
}
|
|
5485
|
+
function Na(e, t) {
|
|
5486
|
+
if (!Ta(e) || typeof e.layoutText != "function") throw TypeError("SVG overlay backend requires a text layout capability.");
|
|
5487
|
+
let n = e;
|
|
5488
|
+
return Object.freeze({
|
|
5489
|
+
setText({ styleName: e, target: r, text: i }) {
|
|
5490
|
+
let a = Ma(r), o = () => n.layoutText({
|
|
5491
|
+
nativeSize: Ea(t),
|
|
5492
|
+
styleName: e,
|
|
5493
|
+
text: i
|
|
5494
|
+
});
|
|
5495
|
+
a.render(o(), o);
|
|
5496
|
+
},
|
|
5497
|
+
releaseTarget(e) {
|
|
5498
|
+
Ma(e).clear();
|
|
5499
|
+
},
|
|
5500
|
+
measureText({ styleName: e, text: r }) {
|
|
5501
|
+
let i = Ea(t);
|
|
5502
|
+
return Da(n.measureText?.({
|
|
5503
|
+
nativeSize: i,
|
|
5504
|
+
styleName: e,
|
|
5505
|
+
text: r
|
|
5506
|
+
}) ?? n.layoutText({
|
|
5507
|
+
nativeSize: i,
|
|
5508
|
+
styleName: e,
|
|
5509
|
+
text: r
|
|
5510
|
+
}).width, "SVG overlay measured text width");
|
|
5511
|
+
}
|
|
5512
|
+
});
|
|
5513
|
+
}
|
|
5514
|
+
function Pa(e) {
|
|
5515
|
+
return !(/* @__PURE__ */ new Set([
|
|
5516
|
+
"image/avif",
|
|
5517
|
+
"image/gif",
|
|
5518
|
+
"image/jpeg",
|
|
5519
|
+
"image/png",
|
|
5520
|
+
"image/svg+xml",
|
|
5521
|
+
"image/webp"
|
|
5522
|
+
])).has(e.mimeType.toLowerCase()) || e.mimeType.toLowerCase() === "image/svg+xml" && e.svgSecurity !== "sanitized" ? !1 : e.src.startsWith("blob:") ? typeof e.release == "function" : /^data:image\/(?:avif|gif|jpeg|png|webp);base64,/iu.test(e.src);
|
|
5523
|
+
}
|
|
5524
|
+
async function Fa(e) {
|
|
5525
|
+
await e?.release?.();
|
|
5526
|
+
}
|
|
5527
|
+
function Ia(e, t, n) {
|
|
5528
|
+
let r = e.createElementNS(pa, "image");
|
|
5529
|
+
r.setAttribute("preserveAspectRatio", "xMidYMid meet"), n.appendChild(r);
|
|
5530
|
+
let i, a = {
|
|
5531
|
+
width: 1,
|
|
5532
|
+
height: 1
|
|
5533
|
+
}, o = 0, s = () => {
|
|
5534
|
+
r.setAttribute("x", String(-a.width / 2)), r.setAttribute("y", String(-a.height / 2)), r.setAttribute("width", String(a.width)), r.setAttribute("height", String(a.height));
|
|
5535
|
+
};
|
|
5536
|
+
return s(), Object.freeze({
|
|
5537
|
+
id: t,
|
|
5538
|
+
isStage: !1,
|
|
5539
|
+
[ba]: !0,
|
|
5540
|
+
group: n,
|
|
5541
|
+
async applyResource(e) {
|
|
5542
|
+
let t = o + 1;
|
|
5543
|
+
o = t;
|
|
5544
|
+
try {
|
|
5545
|
+
if (Da(e.width, "SVG overlay image width"), Da(e.height, "SVG overlay image height"), typeof e.mimeType != "string" || !e.mimeType.startsWith("image/") || typeof e.src != "string" || !Pa(e)) throw TypeError("SVG overlay image resources must use a supported MIME type, a releasable blob URL or approved raster data URL, and sanitized SVG metadata when applicable.");
|
|
5546
|
+
} catch (t) {
|
|
5547
|
+
throw await Fa(e), t;
|
|
5548
|
+
}
|
|
5549
|
+
if (t !== o) {
|
|
5550
|
+
await Fa(e);
|
|
5551
|
+
return;
|
|
5552
|
+
}
|
|
5553
|
+
let n = i;
|
|
5554
|
+
i = e, r.setAttribute("href", e.src), await Fa(n);
|
|
5555
|
+
},
|
|
5556
|
+
getSize() {
|
|
5557
|
+
return i ? {
|
|
5558
|
+
width: i.width,
|
|
5559
|
+
height: i.height
|
|
5560
|
+
} : {
|
|
5561
|
+
width: 1,
|
|
5562
|
+
height: 1
|
|
5563
|
+
};
|
|
5564
|
+
},
|
|
5565
|
+
async release() {
|
|
5566
|
+
o += 1;
|
|
5567
|
+
let e = i;
|
|
5568
|
+
i = void 0, r.removeAttribute("href"), await Fa(e);
|
|
5569
|
+
},
|
|
5570
|
+
setDisplaySize(e) {
|
|
5571
|
+
a = e, s();
|
|
5572
|
+
},
|
|
5573
|
+
setVisible(e) {
|
|
5574
|
+
n.setAttribute("visibility", e ? "visible" : "hidden");
|
|
5575
|
+
}
|
|
5576
|
+
});
|
|
5577
|
+
}
|
|
5578
|
+
function La(e) {
|
|
5579
|
+
let t = e;
|
|
5580
|
+
if (t?.[ba] !== !0) throw TypeError("SVG overlay image target is invalid.");
|
|
5581
|
+
return t;
|
|
5582
|
+
}
|
|
5583
|
+
function Ra(e) {
|
|
5584
|
+
if (!Ta(e) || typeof e.isRegistered != "function" || typeof e.getMimeType != "function" || typeof e.resolveImage != "function") throw TypeError("SVG overlay image capability is invalid.");
|
|
5585
|
+
let t = e;
|
|
5586
|
+
return Object.freeze({
|
|
5587
|
+
isRegistered(e) {
|
|
5588
|
+
return t.isRegistered(e);
|
|
5589
|
+
},
|
|
5590
|
+
getMimeType(e) {
|
|
5591
|
+
return t.getMimeType(e);
|
|
5592
|
+
},
|
|
5593
|
+
async applyToTarget(e, n) {
|
|
5594
|
+
await La(n).applyResource(await t.resolveImage(e));
|
|
5595
|
+
}
|
|
5596
|
+
});
|
|
5597
|
+
}
|
|
5598
|
+
function za(e, t) {
|
|
5599
|
+
let n = t.createElementNS(pa, "svg");
|
|
5600
|
+
n.setAttribute("xmlns", pa), n.setAttribute("aria-hidden", "true"), n.setAttribute("focusable", "false"), n.setAttribute("data-bubble-render-backend", "svg-overlay"), n.style.display = "block", n.style.overflow = "hidden", n.style.pointerEvents = "none";
|
|
5601
|
+
let r = /* @__PURE__ */ new Set(), i = !1, a = () => {
|
|
5602
|
+
let t = Ea(e);
|
|
5603
|
+
return n.setAttribute("width", String(t.width)), n.setAttribute("height", String(t.height)), n.setAttribute("viewBox", `0 0 ${t.width} ${t.height}`), t;
|
|
5604
|
+
};
|
|
5605
|
+
return Object.freeze({
|
|
5606
|
+
document: t,
|
|
5607
|
+
renderer: e,
|
|
5608
|
+
acquire(t) {
|
|
5609
|
+
if (!r.has(t)) {
|
|
5610
|
+
if (a(), !i) try {
|
|
5611
|
+
e.addOverlay(n, "scale"), i = !0;
|
|
5612
|
+
} catch (t) {
|
|
5613
|
+
throw e.removeOverlay(n), t;
|
|
5614
|
+
}
|
|
5615
|
+
n.appendChild(t), r.add(t);
|
|
5616
|
+
}
|
|
5617
|
+
},
|
|
5618
|
+
release(t) {
|
|
5619
|
+
r.delete(t) && (t.remove(), r.size === 0 && i && (e.removeOverlay(n), i = !1));
|
|
5620
|
+
},
|
|
5621
|
+
updateNativeSize: a
|
|
5622
|
+
});
|
|
5623
|
+
}
|
|
5624
|
+
function Ba(e) {
|
|
5625
|
+
try {
|
|
5626
|
+
let t = e.getBoundsForBubble?.();
|
|
5627
|
+
if (t && [
|
|
5628
|
+
t.bottom,
|
|
5629
|
+
t.left,
|
|
5630
|
+
t.right,
|
|
5631
|
+
t.top
|
|
5632
|
+
].every((e) => Number.isFinite(e))) return t;
|
|
5633
|
+
} catch {}
|
|
5634
|
+
let t = Number.isFinite(e.x) ? Number(e.x) : 0, n = Number.isFinite(e.y) ? Number(e.y) : 0;
|
|
5635
|
+
return {
|
|
5636
|
+
bottom: n,
|
|
5637
|
+
left: t,
|
|
5638
|
+
right: t,
|
|
5639
|
+
top: n
|
|
5640
|
+
};
|
|
5641
|
+
}
|
|
5642
|
+
function Va(e, t, n) {
|
|
5643
|
+
return n < t ? (t + n) / 2 : Math.min(n, Math.max(t, e));
|
|
5644
|
+
}
|
|
5645
|
+
function Ha(e) {
|
|
5646
|
+
let t = ve(e);
|
|
5647
|
+
return (Math.atan2(-t.x, -t.y) * 180 / Math.PI % 360 + 360) % 360;
|
|
5648
|
+
}
|
|
5649
|
+
var Ua = /* @__PURE__ */ new Set([
|
|
5650
|
+
"circle",
|
|
5651
|
+
"g",
|
|
5652
|
+
"path",
|
|
5653
|
+
"rect",
|
|
5654
|
+
"title"
|
|
5655
|
+
]), Wa = /* @__PURE__ */ new Set([
|
|
5656
|
+
"cx",
|
|
5657
|
+
"cy",
|
|
5658
|
+
"d",
|
|
5659
|
+
"data-boolean-operation",
|
|
5660
|
+
"data-tail-base-on-border",
|
|
5661
|
+
"fill",
|
|
5662
|
+
"fill-rule",
|
|
5663
|
+
"height",
|
|
5664
|
+
"opacity",
|
|
5665
|
+
"r",
|
|
5666
|
+
"rx",
|
|
5667
|
+
"stroke",
|
|
5668
|
+
"stroke-dasharray",
|
|
5669
|
+
"stroke-linejoin",
|
|
5670
|
+
"stroke-width",
|
|
5671
|
+
"transform",
|
|
5672
|
+
"width",
|
|
5673
|
+
"x",
|
|
5674
|
+
"y"
|
|
5675
|
+
]);
|
|
5676
|
+
function Ga(e, t) {
|
|
5677
|
+
let n = e.localName;
|
|
5678
|
+
if (!Ua.has(n)) throw TypeError(`Bubble body SVG element is not allowed: ${n}`);
|
|
5679
|
+
let r = t.createElementNS(pa, n);
|
|
5680
|
+
for (let t of e.getAttributeNames()) {
|
|
5681
|
+
if (!Wa.has(t)) throw TypeError(`Bubble body SVG attribute is not allowed: ${t}`);
|
|
5682
|
+
let n = e.getAttribute(t) ?? "";
|
|
5683
|
+
if (/javascript:|url\s*\(/iu.test(n)) throw TypeError("Bubble body SVG contains an unsafe attribute value.");
|
|
5684
|
+
r.setAttribute(t, n);
|
|
5685
|
+
}
|
|
5686
|
+
n === "title" && (r.textContent = e.textContent ?? "");
|
|
5687
|
+
for (let n of Array.from(e.children)) r.appendChild(Ga(n, t));
|
|
5688
|
+
return r;
|
|
5689
|
+
}
|
|
5690
|
+
function Ka(e, t, n) {
|
|
5691
|
+
let r = n.defaultView?.DOMParser;
|
|
5692
|
+
if (!r) throw TypeError("SVG overlay backend requires DOMParser.");
|
|
5693
|
+
let i = new r().parseFromString(t, "image/svg+xml");
|
|
5694
|
+
if (i.querySelector("parsererror")) throw TypeError("Canonical Bubble body SVG could not be parsed.");
|
|
5695
|
+
let a = Array.from(i.documentElement.children).map((e) => Ga(e, n));
|
|
5696
|
+
e.replaceChildren(...a);
|
|
5697
|
+
}
|
|
5698
|
+
function qa(e, t, n = 1) {
|
|
5699
|
+
let r = e.getSize(), i = Math.min(t / r.width, t / r.height), a = {
|
|
5700
|
+
width: r.width * i * n,
|
|
5701
|
+
height: r.height * i * n
|
|
5702
|
+
};
|
|
5703
|
+
return e.setDisplaySize(a), a;
|
|
5704
|
+
}
|
|
5705
|
+
function Ja(e, t, n, r, i) {
|
|
5706
|
+
let { document: a, renderer: o } = e, s = xa;
|
|
5707
|
+
xa += 1;
|
|
5708
|
+
let c = a.createElementNS(pa, "g");
|
|
5709
|
+
c.setAttribute("data-bubble-surface", `${n}:${s}`);
|
|
5710
|
+
let l = a.createElementNS(pa, "g");
|
|
5711
|
+
l.setAttribute("data-bubble-layer", "body"), c.appendChild(l);
|
|
5712
|
+
let u = (e) => {
|
|
5713
|
+
let t = a.createElementNS(pa, "g");
|
|
5714
|
+
return t.setAttribute("data-bubble-layer", e), t.setAttribute("visibility", "hidden"), c.appendChild(t), t;
|
|
5715
|
+
}, d = Ia(a, `bubble:${n}:${s}:portrait-base`, u("portrait-base")), f = Ia(a, `bubble:${n}:${s}:portrait-blink`, u("portrait-blink")), p = Ia(a, `bubble:${n}:${s}:portrait-lip-sync`, u("portrait-lip-sync")), m = u("text"), h = ja(a, m), g = Ia(a, `bubble:${n}:${s}:continue-indicator`, u("continue-indicator")), _ = Object.freeze({
|
|
5716
|
+
text: h,
|
|
5717
|
+
portraitBase: d,
|
|
5718
|
+
portraitBlink: f,
|
|
5719
|
+
portraitLipSync: p,
|
|
5720
|
+
continueIndicator: g
|
|
5721
|
+
}), v = /* @__PURE__ */ new Map([
|
|
5722
|
+
["portraitBase", d],
|
|
5723
|
+
["portraitBlink", f],
|
|
5724
|
+
["portraitLipSync", p],
|
|
5725
|
+
["continueIndicator", g]
|
|
5726
|
+
]), y = /* @__PURE__ */ new Map(), b = `bubble-portrait-clip-${s}`, x = a.createElementNS(pa, "defs"), S = a.createElementNS(pa, "clipPath"), C = a.createElementNS(pa, "rect");
|
|
5727
|
+
S.setAttribute("id", b), S.appendChild(C), x.appendChild(S), c.insertBefore(x, l);
|
|
5728
|
+
let w = r, T = !1, E = !1, D = "", O = [0, 0], k = 1, A = 1, j = [0, 0], M, N = (t = e.updateNativeSize()) => {
|
|
5729
|
+
let n = t.width / 2 + j[0], r = t.height / 2 - j[1], i = n + O[0], a = r - O[1];
|
|
5730
|
+
c.setAttribute("transform", `translate(${i} ${a}) scale(${k}) translate(${-n} ${-r})`), c.setAttribute("opacity", String(A));
|
|
5731
|
+
}, P = (e) => e === "continueIndicator" ? w.continueIndicator !== void 0 : e === "portraitBase" ? w.portrait !== void 0 : e === "portraitBlink" ? w.portrait?.blink !== void 0 : w.portrait?.lipSync !== void 0, F = (e) => {
|
|
5732
|
+
let n = w.placement.basis === "background" || t.visible !== !1, r = E && n && A > 0;
|
|
5733
|
+
c.setAttribute("visibility", r ? "visible" : "hidden"), l.setAttribute("visibility", r && w.visualStyle !== "NO_BUBBLE" ? "visible" : "hidden"), m.setAttribute("visibility", r ? "visible" : "hidden");
|
|
5734
|
+
for (let [e, t] of v) t.setVisible(r && P(e) && (y.get(e) ?? !1));
|
|
5735
|
+
N(e);
|
|
5736
|
+
}, I = () => {
|
|
5737
|
+
if (T) return;
|
|
5738
|
+
let n = e.updateNativeSize(), r = w.placement.basis === "actor" ? w.offset.scalePercent / 100 : 1, i = h.getCapturedSize() ?? h.getSize(), o = {
|
|
5739
|
+
width: i.width * r,
|
|
5740
|
+
height: i.height * r
|
|
5741
|
+
}, s = (w.portrait?.offset.zoomPercent ?? 100) / 100, c = w.portrait !== void 0, u = c ? qa(d, ha * s, r) : {
|
|
5742
|
+
width: 0,
|
|
5743
|
+
height: 0
|
|
5744
|
+
};
|
|
5745
|
+
for (let e of [f, p]) c && qa(e, ha * s, r);
|
|
5746
|
+
let _ = qa(g, ga, r), v = u.width + (c ? _a * r : 0) + o.width, y = Math.max(u.height, o.height), x = v / r + 48, S = y / r + 48, E = -n.width / 2, O = n.width / 2, k = n.height / 2, A = -n.height / 2, N, P;
|
|
5747
|
+
if (w.placement.basis === "background") N = 0, P = w.placement.region === "HEADER_LIKE" ? k - va - y / 2 : w.placement.region === "FOOTER_LIKE" ? A + va + y / 2 : 0;
|
|
5748
|
+
else {
|
|
5749
|
+
let e = we({
|
|
5750
|
+
bounds: Ba(t),
|
|
5751
|
+
bubbleWidth: v,
|
|
5752
|
+
bubbleHeight: y,
|
|
5753
|
+
direction: w.placement.direction,
|
|
5754
|
+
distance: w.distance,
|
|
5755
|
+
tailLength: w.tailLength,
|
|
5756
|
+
offset: w.offset
|
|
5757
|
+
});
|
|
5758
|
+
N = e.x, P = e.y;
|
|
5759
|
+
}
|
|
5760
|
+
N = Va(N, E + v / 2, O - v / 2), P = Va(P, A + y / 2, k - y / 2), j = [N, P];
|
|
5761
|
+
let I = w.placement.basis === "actor" ? Ha(w.placement.direction) : null, L = w.placement.basis === "actor" ? [
|
|
5762
|
+
w.offset.x,
|
|
5763
|
+
w.offset.y,
|
|
5764
|
+
w.offset.scalePercent
|
|
5765
|
+
] : [
|
|
5766
|
+
0,
|
|
5767
|
+
0,
|
|
5768
|
+
100
|
|
5769
|
+
], R = I === null ? {
|
|
5770
|
+
x: 0,
|
|
5771
|
+
y: 0
|
|
5772
|
+
} : $e({
|
|
5773
|
+
style: w.visualStyle,
|
|
5774
|
+
width: x,
|
|
5775
|
+
height: S,
|
|
5776
|
+
tailDirection: I,
|
|
5777
|
+
tailLength: w.tailLength,
|
|
5778
|
+
offset: L
|
|
5779
|
+
}), z = JSON.stringify({
|
|
5780
|
+
baseBubbleHeight: S,
|
|
5781
|
+
baseBubbleWidth: x,
|
|
5782
|
+
bodyOffset: L,
|
|
5783
|
+
shapeTransition: M,
|
|
5784
|
+
tailDirection: I,
|
|
5785
|
+
tailLength: w.tailLength,
|
|
5786
|
+
visualStyle: w.visualStyle
|
|
5787
|
+
});
|
|
5788
|
+
z !== D && (Ka(l, tt({
|
|
5789
|
+
style: w.visualStyle,
|
|
5790
|
+
lines: [],
|
|
5791
|
+
width: x,
|
|
5792
|
+
height: S,
|
|
5793
|
+
tailDirection: I,
|
|
5794
|
+
tailLength: w.tailLength,
|
|
5795
|
+
offset: L,
|
|
5796
|
+
title: `${w.name} Bubble body`,
|
|
5797
|
+
...M === void 0 ? {} : { shapeTransition: M }
|
|
5798
|
+
}), a), D = z), l.setAttribute("data-bubble-style", w.visualStyle), M === void 0 ? (l.removeAttribute("data-bubble-shape-transition-from"), l.removeAttribute("data-bubble-shape-transition-to"), l.removeAttribute("data-bubble-shape-transition-progress")) : (l.setAttribute("data-bubble-shape-transition-from", M.from), l.setAttribute("data-bubble-shape-transition-to", M.to), l.setAttribute("data-bubble-shape-transition-progress", String(M.progress)));
|
|
5799
|
+
let B = N - R.x, ee = P + R.y;
|
|
5800
|
+
l.setAttribute("transform", `translate(${n.width / 2 + B - x / 2} ${n.height / 2 - ee - S / 2})`);
|
|
5801
|
+
let te = N - v / 2, ne = w.portrait?.placement ?? "left", re = ne.endsWith("right"), ie = (w.portrait?.offset.x ?? 0) * r, V = (w.portrait?.offset.y ?? 0) * r, H = (re ? te + o.width + _a * r : te) + u.width / 2 + ie, ae = P;
|
|
5802
|
+
ne.startsWith("top-") ? ae = P + y / 2 - u.height / 2 : ne.startsWith("bottom-") && (ae = P - y / 2 + u.height / 2), ae += V;
|
|
5803
|
+
let oe = (re || !c ? te : te + u.width + _a * r) + o.width / 2, se = (e, t) => `translate(${n.width / 2 + e} ${n.height / 2 - t})`;
|
|
5804
|
+
for (let e of [
|
|
5805
|
+
d,
|
|
5806
|
+
f,
|
|
5807
|
+
p
|
|
5808
|
+
]) e.group.setAttribute("transform", se(H, ae));
|
|
5809
|
+
m.setAttribute("transform", `${se(oe, P)} scale(${r})`);
|
|
5810
|
+
let ce = oe + o.width / 2 - _.width / 2 - _a * r, le = P - o.height / 2 + _.height / 2 + _a * r;
|
|
5811
|
+
g.group.setAttribute("transform", se(ce, le));
|
|
5812
|
+
let ue = Math.min(w.portrait?.cornerRadius ?? 0, u.width / 2, u.height / 2);
|
|
5813
|
+
C.setAttribute("x", String(-u.width / 2)), C.setAttribute("y", String(-u.height / 2)), C.setAttribute("width", String(u.width)), C.setAttribute("height", String(u.height)), C.setAttribute("rx", String(ue));
|
|
5814
|
+
for (let e of [
|
|
5815
|
+
d,
|
|
5816
|
+
f,
|
|
5817
|
+
p
|
|
5818
|
+
]) ue > 0 ? e.group.setAttribute("clip-path", `url(#${b})`) : e.group.removeAttribute("clip-path");
|
|
5819
|
+
F(n);
|
|
5820
|
+
}, L = t.onTargetVisualChange, R = (e) => {
|
|
5821
|
+
L?.(e), I();
|
|
5822
|
+
}, z = () => {
|
|
5823
|
+
h.refresh(), I();
|
|
5824
|
+
};
|
|
5825
|
+
return e.acquire(c), w.placement.basis === "actor" && (t.onTargetVisualChange = R), o.on?.("NativeSizeChanged", z), Object.freeze({
|
|
5826
|
+
targets: _,
|
|
5827
|
+
setLayerVisible(e, t) {
|
|
5828
|
+
T || (y.set(e, t), F());
|
|
5829
|
+
},
|
|
5830
|
+
updateStyle(e) {
|
|
5831
|
+
if (T) return;
|
|
5832
|
+
let n = w.placement.basis === "actor";
|
|
5833
|
+
w = e, O = [0, 0], k = 1, A = 1, M = void 0, D = "", e.reveal?.layout !== "RESERVED" && h.clearCapturedLayout();
|
|
5834
|
+
let r = w.placement.basis === "actor";
|
|
5835
|
+
n && !r ? t.onTargetVisualChange === R && (t.onTargetVisualChange = L ?? null) : !n && r && (t.onTargetVisualChange = R), I();
|
|
5836
|
+
},
|
|
5837
|
+
captureTextLayout() {
|
|
5838
|
+
T || (h.captureLayout(), I());
|
|
5839
|
+
},
|
|
5840
|
+
clearTextLayout() {
|
|
5841
|
+
h.clearCapturedLayout(), I();
|
|
5842
|
+
},
|
|
5843
|
+
async animate(e) {
|
|
5844
|
+
if (T) return;
|
|
5845
|
+
let t = Math.max(0, e.durationSeconds ?? 0), n = () => {
|
|
5846
|
+
T || F();
|
|
5847
|
+
}, r = (t) => da(t, e.ease ?? "easeInOut");
|
|
5848
|
+
if (e.name === "fadeIn" || e.name === "floatIn" || e.name === "zoomIn" || e.name === "riseUp") {
|
|
5849
|
+
E = !0;
|
|
5850
|
+
let a = e.name === "floatIn" || e.name === "riseUp" ? [0, 16] : [0, 0], o = e.name === "zoomIn" ? .01 : 1;
|
|
5851
|
+
O = a, k = o, A = e.name === "fadeIn" ? 0 : 1, n(), await fa(i, t, (t) => {
|
|
5852
|
+
let i = r(t);
|
|
5853
|
+
O = [a[0] * (1 - i), a[1] * (1 - i)], k = o + (1 - o) * i, A = e.name === "fadeIn" ? i : 1, n();
|
|
5854
|
+
}), O = [0, 0], k = 1, A = 1, I();
|
|
5855
|
+
return;
|
|
5856
|
+
}
|
|
5857
|
+
if (e.name === "fadeOut" || e.name === "floatOut" || e.name === "zoomOut" || e.name === "sink") {
|
|
5858
|
+
let a = e.name === "floatOut" || e.name === "sink" ? [0, -16] : [0, 0], o = e.name === "zoomOut" ? .01 : 1;
|
|
5859
|
+
await fa(i, t, (t) => {
|
|
5860
|
+
let i = r(t);
|
|
5861
|
+
O = [a[0] * i, a[1] * i], k = 1 + (o - 1) * i, A = e.name === "fadeOut" ? 1 - i : 1, n();
|
|
5862
|
+
}), E = !1, F(), O = [0, 0], k = 1, A = 1;
|
|
5863
|
+
return;
|
|
5864
|
+
}
|
|
5865
|
+
if (e.name === "shake") {
|
|
5866
|
+
let a = Math.max(1, Math.floor(e.count ?? 1)), o = t > 0 ? t : a * .08, s = ve(typeof e.direction == "number" ? e.direction : e.direction ?? "right");
|
|
5867
|
+
await fa(i, o, (e) => {
|
|
5868
|
+
let t = Math.sin(r(e) * a * Math.PI * 2) * 5;
|
|
5869
|
+
O = [s.x * t, s.y * t], n();
|
|
5870
|
+
}), O = [0, 0], I();
|
|
5871
|
+
return;
|
|
5872
|
+
}
|
|
5873
|
+
if (e.name === "explode") {
|
|
5874
|
+
let a = Math.max(1, Math.floor(e.count ?? 1)), o = t > 0 ? t : a * .12, s = e.relativeScale ?? 1.15;
|
|
5875
|
+
await fa(i, o, (e) => {
|
|
5876
|
+
let t = Math.abs(Math.sin(r(e) * a * Math.PI));
|
|
5877
|
+
k = 1 + (s - 1) * t, n();
|
|
5878
|
+
}), k = 1, I();
|
|
5879
|
+
return;
|
|
5880
|
+
}
|
|
5881
|
+
if (e.name === "animateBubbleShape") {
|
|
5882
|
+
let n = e.visualStyle ?? w.visualStyle, r = w.visualStyle, a = e.speed === void 0 ? 1 : Math.max(0, e.speed);
|
|
5883
|
+
M = {
|
|
5884
|
+
from: r,
|
|
5885
|
+
to: n,
|
|
5886
|
+
progress: 0
|
|
5887
|
+
}, I(), await fa(i, t, (i) => {
|
|
5888
|
+
let o = t === 0 ? 1 : ua(i * Math.max(a, 1));
|
|
5889
|
+
M = {
|
|
5890
|
+
from: r,
|
|
5891
|
+
to: n,
|
|
5892
|
+
progress: da(o, e.ease ?? "easeInOut")
|
|
5893
|
+
}, D = "", I();
|
|
5894
|
+
}), M = void 0, D = "", I();
|
|
5895
|
+
}
|
|
5896
|
+
},
|
|
5897
|
+
show() {
|
|
5898
|
+
T || (E = !0, I());
|
|
5899
|
+
},
|
|
5900
|
+
hide() {
|
|
5901
|
+
T || (E = !1, F());
|
|
5902
|
+
},
|
|
5903
|
+
async dispose() {
|
|
5904
|
+
if (T) return;
|
|
5905
|
+
T = !0;
|
|
5906
|
+
let n = [], r = (e) => {
|
|
5907
|
+
try {
|
|
5908
|
+
e();
|
|
5909
|
+
} catch (e) {
|
|
5910
|
+
n.push(e);
|
|
5911
|
+
}
|
|
5912
|
+
};
|
|
5913
|
+
r(() => {
|
|
5914
|
+
t.onTargetVisualChange === R && (t.onTargetVisualChange = L ?? null);
|
|
5915
|
+
}), r(() => o.off?.("NativeSizeChanged", z)), r(() => e.release(c)), r(() => h.clear());
|
|
5916
|
+
let i = await Promise.allSettled([...v.values()].map((e) => e.release()));
|
|
5917
|
+
if (n.push(...i.flatMap((e) => e.status === "rejected" ? [e.reason] : [])), n.length === 1) throw n[0];
|
|
5918
|
+
if (n.length > 1) throw AggregateError(n, "Failed to dispose SVG overlay Bubble surface.");
|
|
5919
|
+
}
|
|
5920
|
+
});
|
|
5921
|
+
}
|
|
5922
|
+
//#endregion
|
|
4728
5923
|
//#region src/turbowarp-adapter.ts
|
|
4729
|
-
var
|
|
5924
|
+
var Ya = "sprite", Xa = 96, Za = 18, Qa = 8, $a = 16, eo = 0, $ = class extends Error {
|
|
4730
5925
|
code;
|
|
4731
5926
|
constructor(e, t) {
|
|
4732
5927
|
super(t), this.name = "BubbleRuntimeAdapterError", this.code = e;
|
|
4733
5928
|
}
|
|
4734
5929
|
};
|
|
4735
|
-
function
|
|
5930
|
+
function to(e) {
|
|
4736
5931
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
4737
5932
|
}
|
|
4738
|
-
function
|
|
4739
|
-
if (!
|
|
5933
|
+
function no(e) {
|
|
5934
|
+
if (!to(e)) throw new $("BUBBLE-RUNTIME-001", "Bubble requires the TurboWarp renderer.");
|
|
4740
5935
|
let t = [
|
|
4741
5936
|
"createSVGSkin",
|
|
4742
5937
|
"createDrawable",
|
|
@@ -4752,11 +5947,45 @@ function pi(e) {
|
|
|
4752
5947
|
if (t.some((t) => typeof e[t] != "function")) throw new $("BUBBLE-RUNTIME-001", `Bubble renderer must provide ${t.join(", ")}.`);
|
|
4753
5948
|
return e;
|
|
4754
5949
|
}
|
|
4755
|
-
function
|
|
4756
|
-
|
|
5950
|
+
function ro(e) {
|
|
5951
|
+
let t = e ?? "svg-overlay";
|
|
5952
|
+
if (t !== "scratch-render" && t !== "svg-overlay") throw new $("BUBBLE-RUNTIME-004", "Bubble bubbleRenderBackend must be scratch-render or svg-overlay.");
|
|
5953
|
+
return t;
|
|
5954
|
+
}
|
|
5955
|
+
function io(e) {
|
|
5956
|
+
let t = e ?? "error";
|
|
5957
|
+
if (t !== "error" && t !== "fallback") throw new $("BUBBLE-RUNTIME-004", "Bubble svgOverlayUnsupportedBehavior must be error or fallback.");
|
|
5958
|
+
return t;
|
|
5959
|
+
}
|
|
5960
|
+
function ao(e) {
|
|
5961
|
+
let t = e ?? (globalThis.document === void 0 ? void 0 : globalThis.document);
|
|
5962
|
+
if (t !== void 0) {
|
|
5963
|
+
if (!to(t) || typeof t.createElementNS != "function") throw new $("BUBBLE-RUNTIME-004", "Bubble SVG overlay document must provide createElementNS().");
|
|
5964
|
+
return t;
|
|
5965
|
+
}
|
|
5966
|
+
}
|
|
5967
|
+
function oo(e, t, n) {
|
|
5968
|
+
if (typeof e.addOverlay != "function" || typeof e.removeOverlay != "function") return "the renderer does not provide addOverlay() and removeOverlay()";
|
|
5969
|
+
if (t === void 0) return "the host does not provide a DOM document";
|
|
5970
|
+
if (typeof t.defaultView?.DOMParser != "function") return "the host document does not provide DOMParser";
|
|
5971
|
+
if (!to(n) || typeof n.layoutText != "function") return "a host-neutral svgOverlayTextCapability is not available";
|
|
5972
|
+
}
|
|
5973
|
+
function so() {
|
|
5974
|
+
let e = ce(), t = /* @__PURE__ */ new Set(), n = (n) => {
|
|
5975
|
+
e.defineStyle({
|
|
5976
|
+
name: n,
|
|
5977
|
+
backgroundColor: "transparent"
|
|
5978
|
+
}), t.add(n);
|
|
5979
|
+
};
|
|
5980
|
+
return n("default"), ra(Object.freeze({ layoutText(r) {
|
|
5981
|
+
return t.has(r.styleName) || n(r.styleName), e.layoutText(r);
|
|
5982
|
+
} }));
|
|
5983
|
+
}
|
|
5984
|
+
function co(e) {
|
|
5985
|
+
if (!to(e) || typeof e.isLoaded != "function" || typeof e.getAssetMimeType != "function" || typeof e.resolveSkin != "function") throw new $("BUBBLE-RUNTIME-002", "Bubble image assets require an imageResolver capability. Load @kubohiroya/turbowarp-asset-manager or provide options.imageResolver before using image features.");
|
|
4757
5986
|
return e;
|
|
4758
5987
|
}
|
|
4759
|
-
function
|
|
5988
|
+
function lo(e) {
|
|
4760
5989
|
try {
|
|
4761
5990
|
let t = e.getBoundsForBubble?.();
|
|
4762
5991
|
if (t && [
|
|
@@ -4774,7 +6003,7 @@ function hi(e) {
|
|
|
4774
6003
|
top: n
|
|
4775
6004
|
};
|
|
4776
6005
|
}
|
|
4777
|
-
function
|
|
6006
|
+
function uo(e, t, n) {
|
|
4778
6007
|
let r = e.getCurrentSkinSize(t.drawableID);
|
|
4779
6008
|
if (!Array.isArray(r) || r.length < 2) return n;
|
|
4780
6009
|
let i = Number(r[0]), a = Number(r[1]);
|
|
@@ -4783,169 +6012,148 @@ function gi(e, t, n) {
|
|
|
4783
6012
|
height: a
|
|
4784
6013
|
};
|
|
4785
6014
|
}
|
|
4786
|
-
function
|
|
4787
|
-
|
|
4788
|
-
}
|
|
4789
|
-
function vi(e, t) {
|
|
4790
|
-
let n = _i(e);
|
|
4791
|
-
switch (t) {
|
|
4792
|
-
case "linear": return n;
|
|
4793
|
-
case "easeIn": return n * n;
|
|
4794
|
-
case "easeOut": return 1 - (1 - n) * (1 - n);
|
|
4795
|
-
case "easeInOut": return n < .5 ? 2 * n * n : 1 - (-2 * n + 2) ** 2 / 2;
|
|
4796
|
-
default: return n;
|
|
4797
|
-
}
|
|
4798
|
-
}
|
|
4799
|
-
function yi(e, t, n) {
|
|
4800
|
-
let r = Math.max(0, t * 1e3);
|
|
4801
|
-
return r === 0 ? (n(1), Promise.resolve()) : new Promise((t, i) => {
|
|
4802
|
-
let a = 0, o, s = () => {
|
|
4803
|
-
let c = Math.min(16, r - a);
|
|
4804
|
-
a += c;
|
|
4805
|
-
try {
|
|
4806
|
-
n(_i(a / r));
|
|
4807
|
-
} catch (t) {
|
|
4808
|
-
o !== void 0 && e.clearTimeout(o), i(t);
|
|
4809
|
-
return;
|
|
4810
|
-
}
|
|
4811
|
-
if (a >= r) {
|
|
4812
|
-
t();
|
|
4813
|
-
return;
|
|
4814
|
-
}
|
|
4815
|
-
o = e.setTimeout(s, Math.min(16, r - a));
|
|
4816
|
-
};
|
|
4817
|
-
o = e.setTimeout(s, Math.min(16, r));
|
|
4818
|
-
});
|
|
4819
|
-
}
|
|
4820
|
-
function bi(e, t, n, r = 1) {
|
|
4821
|
-
let i = gi(e, t, {
|
|
6015
|
+
function fo(e, t, n, r = 1) {
|
|
6016
|
+
let i = uo(e, t, {
|
|
4822
6017
|
width: n,
|
|
4823
6018
|
height: n
|
|
4824
6019
|
}), a = Math.min(n / i.width, n / i.height) * r;
|
|
4825
6020
|
return e.updateDrawableScale(t.drawableID, [a * 100, a * 100]), {
|
|
4826
6021
|
width: i.width * a,
|
|
4827
|
-
height: i.height * a
|
|
6022
|
+
height: i.height * a,
|
|
6023
|
+
scalePercent: a * 100
|
|
4828
6024
|
};
|
|
4829
6025
|
}
|
|
4830
|
-
function
|
|
6026
|
+
function po(e, t, n) {
|
|
6027
|
+
let r = Math.min(n, e / 2, t / 2), i = e - r, a = t - r;
|
|
6028
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}" viewBox="0 0 ${e} ${t}">
|
|
6029
|
+
<path d="M0 0H${e}V${t}H0Z M${r} 0H${i}A${r} ${r} 0 0 1 ${e} ${r}V${a}A${r} ${r} 0 0 1 ${i} ${t}H${r}A${r} ${r} 0 0 1 0 ${a}V${r}A${r} ${r} 0 0 1 ${r} 0Z" fill="#fff4cc" fill-rule="evenodd" data-bubble-portrait-corner-radius="${r}"/>
|
|
6030
|
+
</svg>`;
|
|
6031
|
+
}
|
|
6032
|
+
function mo(e, t, n) {
|
|
4831
6033
|
return n < t ? (t + n) / 2 : Math.min(n, Math.max(t, e));
|
|
4832
6034
|
}
|
|
4833
|
-
function
|
|
6035
|
+
function ho(e, t, n, r, i) {
|
|
4834
6036
|
let a = t + r * 2, o = n + i * 2;
|
|
4835
6037
|
return e.replace(/<svg\b[^>]*>/u, (e) => e.replace(/\bwidth="[^"]*"/u, `width="${a}"`).replace(/\bheight="[^"]*"/u, `height="${o}"`).replace(/\bviewBox="[^"]*"/u, `viewBox="${-r} ${-i} ${a} ${o}"`));
|
|
4836
6038
|
}
|
|
4837
|
-
function
|
|
4838
|
-
let t =
|
|
6039
|
+
function go(e) {
|
|
6040
|
+
let t = ve(e);
|
|
4839
6041
|
return (Math.atan2(-t.x, -t.y) * 180 / Math.PI % 360 + 360) % 360;
|
|
4840
6042
|
}
|
|
4841
|
-
function
|
|
4842
|
-
let a = e.renderer, o =
|
|
4843
|
-
|
|
4844
|
-
let s = [], c, l = (e) => {
|
|
4845
|
-
let t = a.createDrawable(
|
|
6043
|
+
function _o(e, t, n, r, i) {
|
|
6044
|
+
let a = e.renderer, o = eo;
|
|
6045
|
+
eo += 1;
|
|
6046
|
+
let s = [], c, l, u = (e) => {
|
|
6047
|
+
let t = a.createDrawable(Ya);
|
|
4846
6048
|
if (!Number.isInteger(t) || t < 0) throw new $("BUBBLE-RUNTIME-001", `TurboWarp did not create the Bubble ${e} drawable.`);
|
|
4847
6049
|
let r = Object.freeze({
|
|
4848
6050
|
id: `bubble:${n}:${o}:${e}`,
|
|
4849
6051
|
isStage: !1,
|
|
4850
6052
|
drawableID: t
|
|
4851
6053
|
});
|
|
4852
|
-
return s.push(r), a.updateDrawableVisible(t, !1), a.setDrawableOrder?.(t, Infinity,
|
|
6054
|
+
return s.push(r), a.updateDrawableVisible(t, !1), a.setDrawableOrder?.(t, Infinity, Ya), r;
|
|
4853
6055
|
};
|
|
4854
6056
|
try {
|
|
4855
|
-
let n =
|
|
4856
|
-
text:
|
|
6057
|
+
let n = u("body"), o = r.portrait ? u("portrait-base") : void 0, d = r.portrait?.blink ? u("portrait-blink") : void 0, f = r.portrait?.lipSync ? u("portrait-lip-sync") : void 0, p = r.portrait ? u("portrait-corner-mask") : void 0, m = u("text"), h = r.continueIndicator ? u("continue-indicator") : void 0, g = Object.freeze({
|
|
6058
|
+
text: m,
|
|
4857
6059
|
...o ? { portraitBase: o } : {},
|
|
4858
|
-
...
|
|
4859
|
-
...
|
|
4860
|
-
...
|
|
4861
|
-
}),
|
|
4862
|
-
o &&
|
|
4863
|
-
let
|
|
6060
|
+
...d ? { portraitBlink: d } : {},
|
|
6061
|
+
...f ? { portraitLipSync: f } : {},
|
|
6062
|
+
...h ? { continueIndicator: h } : {}
|
|
6063
|
+
}), _ = /* @__PURE__ */ new Map();
|
|
6064
|
+
o && _.set("portraitBase", o), d && _.set("portraitBlink", d), f && _.set("portraitLipSync", f), h && _.set("continueIndicator", h);
|
|
6065
|
+
let v = /* @__PURE__ */ new Map(), y = !1, b = !1, x = "", S = "", C = r, w, T = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), D = [0, 0], O = 1, k = 1, A, j = () => {
|
|
4864
6066
|
for (let e of s) {
|
|
4865
|
-
let t =
|
|
4866
|
-
t && a.updateDrawablePosition(e.drawableID, [t[0] +
|
|
4867
|
-
let n =
|
|
4868
|
-
n && a.updateDrawableScale(e.drawableID, [n[0] *
|
|
4869
|
-
}
|
|
4870
|
-
}, j = () => {
|
|
4871
|
-
let r = x.placement.basis === "background" || t.visible !== !1;
|
|
4872
|
-
a.updateDrawableVisible(n.drawableID, _ && r && x.visualStyle !== "NO_BUBBLE" && (a.updateDrawableEffect !== void 0 || O > 0)), a.updateDrawableVisible(f.drawableID, _ && r && (a.updateDrawableEffect !== void 0 || O > 0));
|
|
4873
|
-
for (let [e, t] of h) a.updateDrawableVisible(t.drawableID, _ && r && (g.get(e) ?? !1) && (a.updateDrawableEffect !== void 0 || O > 0));
|
|
4874
|
-
A(), e.requestRedraw?.();
|
|
6067
|
+
let t = T.get(e.drawableID);
|
|
6068
|
+
t && a.updateDrawablePosition(e.drawableID, [t[0] + D[0], t[1] + D[1]]);
|
|
6069
|
+
let n = E.get(e.drawableID);
|
|
6070
|
+
n && a.updateDrawableScale(e.drawableID, [n[0] * O, n[1] * O]), a.updateDrawableEffect?.(e.drawableID, "ghost", (1 - k) * 100);
|
|
6071
|
+
}
|
|
4875
6072
|
}, M = () => {
|
|
4876
|
-
|
|
4877
|
-
|
|
6073
|
+
let r = C.placement.basis === "background" || t.visible !== !1;
|
|
6074
|
+
a.updateDrawableVisible(n.drawableID, y && r && C.visualStyle !== "NO_BUBBLE" && (a.updateDrawableEffect !== void 0 || k > 0)), a.updateDrawableVisible(m.drawableID, y && r && (a.updateDrawableEffect !== void 0 || k > 0));
|
|
6075
|
+
for (let [e, t] of _) a.updateDrawableVisible(t.drawableID, y && r && (v.get(e) ?? !1) && (a.updateDrawableEffect !== void 0 || k > 0));
|
|
6076
|
+
p && a.updateDrawableVisible(p.drawableID, y && r && C.portrait !== void 0 && C.portrait.cornerRadius > 0 && C.visualStyle !== "NO_BUBBLE" && (v.get("portraitBase") ?? !1) && (a.updateDrawableEffect !== void 0 || k > 0)), j(), e.requestRedraw?.();
|
|
6077
|
+
}, N = () => {
|
|
6078
|
+
if (b) return;
|
|
6079
|
+
let e = C.placement.basis === "actor" ? C.offset.scalePercent / 100 : 1, r = w ?? uo(a, m, {
|
|
4878
6080
|
width: 180,
|
|
4879
6081
|
height: 48
|
|
4880
6082
|
});
|
|
4881
|
-
a.updateDrawableScale(
|
|
6083
|
+
a.updateDrawableScale(m.drawableID, [e * 100, e * 100]);
|
|
4882
6084
|
let i = {
|
|
4883
6085
|
width: r.width * e,
|
|
4884
6086
|
height: r.height * e
|
|
4885
|
-
}, s = o ?
|
|
6087
|
+
}, s = Xa * ((C.portrait?.offset.zoomPercent ?? 100) / 100), u = o !== void 0 && C.portrait !== void 0, g = u ? fo(a, o, s, e) : {
|
|
4886
6088
|
width: 0,
|
|
4887
|
-
height: 0
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
6089
|
+
height: 0,
|
|
6090
|
+
scalePercent: 0
|
|
6091
|
+
}, _ = /* @__PURE__ */ new Map();
|
|
6092
|
+
u && _.set(o.drawableID, g.scalePercent);
|
|
6093
|
+
for (let t of [d, f]) if (t && u) {
|
|
6094
|
+
let n = fo(a, t, s, e);
|
|
6095
|
+
_.set(t.drawableID, n.scalePercent);
|
|
6096
|
+
}
|
|
6097
|
+
let v = h ? fo(a, h, Za, e) : {
|
|
4891
6098
|
width: 0,
|
|
4892
|
-
height: 0
|
|
4893
|
-
|
|
4894
|
-
|
|
6099
|
+
height: 0,
|
|
6100
|
+
scalePercent: 0
|
|
6101
|
+
}, y = g.width + (u ? Qa * e : 0) + i.width, D = Math.max(g.height, i.height), O = y / e + 48, k = D / e + 48, N = y, P = D, F = a.getNativeSize(), I = Array.isArray(F) && Number(F[0]) > 0 ? Number(F[0]) : 480, L = Array.isArray(F) && Number(F[1]) > 0 ? Number(F[1]) : 360, R = -I / 2, z = I / 2, B = L / 2, ee = -L / 2, te = R + N / 2, ne = z - N / 2, re = ee + P / 2, ie = B - P / 2, V, H;
|
|
6102
|
+
if (C.placement.basis === "background") V = 0, H = C.placement.region === "HEADER_LIKE" ? B - $a - P / 2 : C.placement.region === "FOOTER_LIKE" ? ee + $a + P / 2 : 0;
|
|
4895
6103
|
else {
|
|
4896
|
-
let e =
|
|
4897
|
-
bounds:
|
|
4898
|
-
bubbleWidth:
|
|
4899
|
-
bubbleHeight:
|
|
4900
|
-
direction:
|
|
4901
|
-
distance:
|
|
4902
|
-
tailLength:
|
|
4903
|
-
offset:
|
|
6104
|
+
let e = we({
|
|
6105
|
+
bounds: lo(t),
|
|
6106
|
+
bubbleWidth: N,
|
|
6107
|
+
bubbleHeight: P,
|
|
6108
|
+
direction: C.placement.direction,
|
|
6109
|
+
distance: C.distance,
|
|
6110
|
+
tailLength: C.tailLength,
|
|
6111
|
+
offset: C.offset
|
|
4904
6112
|
});
|
|
4905
|
-
|
|
6113
|
+
V = e.x, H = e.y;
|
|
4906
6114
|
}
|
|
4907
|
-
|
|
4908
|
-
let
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
6115
|
+
V = mo(V, te, ne), H = mo(H, re, ie);
|
|
6116
|
+
let ae = C.placement.basis === "actor" ? go(C.placement.direction) : null, oe = C.placement.basis === "actor" ? [
|
|
6117
|
+
C.offset.x,
|
|
6118
|
+
C.offset.y,
|
|
6119
|
+
C.offset.scalePercent
|
|
4912
6120
|
] : [
|
|
4913
6121
|
0,
|
|
4914
6122
|
0,
|
|
4915
6123
|
100
|
|
4916
|
-
],
|
|
6124
|
+
], se = ae === null ? {
|
|
4917
6125
|
x: 0,
|
|
4918
6126
|
y: 0
|
|
4919
|
-
} :
|
|
4920
|
-
style:
|
|
4921
|
-
width:
|
|
4922
|
-
height:
|
|
4923
|
-
tailDirection:
|
|
4924
|
-
tailLength:
|
|
4925
|
-
offset:
|
|
4926
|
-
}),
|
|
4927
|
-
baseBubbleHeight:
|
|
4928
|
-
baseBubbleWidth:
|
|
4929
|
-
bodyOffset:
|
|
4930
|
-
tailDirection:
|
|
4931
|
-
tailLength:
|
|
4932
|
-
viewportExtraX:
|
|
4933
|
-
viewportExtraY:
|
|
4934
|
-
visualStyle:
|
|
4935
|
-
shapeTransition:
|
|
6127
|
+
} : $e({
|
|
6128
|
+
style: C.visualStyle,
|
|
6129
|
+
width: O,
|
|
6130
|
+
height: k,
|
|
6131
|
+
tailDirection: ae,
|
|
6132
|
+
tailLength: C.tailLength,
|
|
6133
|
+
offset: oe
|
|
6134
|
+
}), ce = Math.abs(oe[0]) + O * Math.abs(e - 1) + Math.max(0, C.tailLength - 18) + 8, le = Math.abs(oe[1]) + k * Math.abs(e - 1) + Math.max(0, C.tailLength - 18) + 8, ue = JSON.stringify({
|
|
6135
|
+
baseBubbleHeight: k,
|
|
6136
|
+
baseBubbleWidth: O,
|
|
6137
|
+
bodyOffset: oe,
|
|
6138
|
+
tailDirection: ae,
|
|
6139
|
+
tailLength: C.tailLength,
|
|
6140
|
+
viewportExtraX: ce,
|
|
6141
|
+
viewportExtraY: le,
|
|
6142
|
+
visualStyle: C.visualStyle,
|
|
6143
|
+
shapeTransition: A
|
|
4936
6144
|
});
|
|
4937
|
-
if (
|
|
4938
|
-
let e =
|
|
4939
|
-
style:
|
|
6145
|
+
if (ue !== x) {
|
|
6146
|
+
let e = ho(tt({
|
|
6147
|
+
style: C.visualStyle,
|
|
4940
6148
|
lines: [],
|
|
4941
|
-
width:
|
|
4942
|
-
height:
|
|
4943
|
-
tailDirection:
|
|
4944
|
-
tailLength:
|
|
4945
|
-
offset:
|
|
4946
|
-
title: `${
|
|
4947
|
-
...
|
|
4948
|
-
}),
|
|
6149
|
+
width: O,
|
|
6150
|
+
height: k,
|
|
6151
|
+
tailDirection: ae,
|
|
6152
|
+
tailLength: C.tailLength,
|
|
6153
|
+
offset: oe,
|
|
6154
|
+
title: `${C.name} Bubble body`,
|
|
6155
|
+
...A === void 0 ? {} : { shapeTransition: A }
|
|
6156
|
+
}), O, k, ce, le), t = a.createSVGSkin(e);
|
|
4949
6157
|
if (!Number.isInteger(t) || t < 0) throw new $("BUBBLE-RUNTIME-001", "TurboWarp did not create the Bubble body SVG skin.");
|
|
4950
6158
|
try {
|
|
4951
6159
|
a.updateDrawableSkinId(n.drawableID, t);
|
|
@@ -4953,167 +6161,216 @@ function wi(e, t, n, r, i) {
|
|
|
4953
6161
|
throw a.destroySkin(t), e;
|
|
4954
6162
|
}
|
|
4955
6163
|
let r = c;
|
|
4956
|
-
c = t,
|
|
6164
|
+
c = t, x = ue, r !== void 0 && a.destroySkin(r);
|
|
4957
6165
|
}
|
|
4958
|
-
a.updateDrawableScale(n.drawableID, [100, 100]), a.updateDrawablePosition(n.drawableID, [
|
|
4959
|
-
let
|
|
6166
|
+
a.updateDrawableScale(n.drawableID, [100, 100]), a.updateDrawablePosition(n.drawableID, [V - se.x, H + se.y]);
|
|
6167
|
+
let de = V - y / 2, fe = C.portrait?.placement ?? "left", pe = fe.endsWith("right"), me = (C.portrait?.offset.x ?? 0) * e, he = (C.portrait?.offset.y ?? 0) * e, ge = (pe ? de + i.width + Qa * e : de) + g.width / 2 + me, _e = H;
|
|
6168
|
+
fe.startsWith("top-") ? _e = H + D / 2 - g.height / 2 : fe.startsWith("bottom-") && (_e = H - D / 2 + g.height / 2), _e += he;
|
|
6169
|
+
let ve = (pe || !u ? de : de + g.width + Qa * e) + i.width / 2;
|
|
4960
6170
|
for (let e of [
|
|
4961
6171
|
o,
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
]) e && a.updateDrawablePosition(e.drawableID, [
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
6172
|
+
d,
|
|
6173
|
+
f
|
|
6174
|
+
]) e && a.updateDrawablePosition(e.drawableID, [ge, _e]);
|
|
6175
|
+
if (p) {
|
|
6176
|
+
let t = g.width / e, n = g.height / e, r = Math.min(C.portrait?.cornerRadius ?? 0, t / 2, n / 2), i = r > 0 ? JSON.stringify({
|
|
6177
|
+
maskHeight: n,
|
|
6178
|
+
maskWidth: t,
|
|
6179
|
+
radius: r
|
|
6180
|
+
}) : "";
|
|
6181
|
+
if (i !== S) {
|
|
6182
|
+
let e = l;
|
|
6183
|
+
if (l = void 0, S = i, r > 0) {
|
|
6184
|
+
let e = a.createSVGSkin(po(t, n, r));
|
|
6185
|
+
if (!Number.isInteger(e) || e < 0) throw new $("BUBBLE-RUNTIME-001", "TurboWarp did not create the Bubble portrait corner mask SVG skin.");
|
|
6186
|
+
try {
|
|
6187
|
+
a.updateDrawableSkinId(p.drawableID, e), l = e;
|
|
6188
|
+
} catch (t) {
|
|
6189
|
+
throw a.destroySkin(e), t;
|
|
6190
|
+
}
|
|
6191
|
+
}
|
|
6192
|
+
e !== void 0 && a.destroySkin(e);
|
|
6193
|
+
}
|
|
6194
|
+
a.updateDrawablePosition(p.drawableID, [ge, _e]);
|
|
6195
|
+
}
|
|
6196
|
+
a.updateDrawablePosition(m.drawableID, [ve, H]), h && a.updateDrawablePosition(h.drawableID, [ve + i.width / 2 - v.width / 2 - Qa * e, H - i.height / 2 + v.height / 2 + Qa * e]);
|
|
6197
|
+
let ye = (e, t) => {
|
|
6198
|
+
e && T.set(e.drawableID, t);
|
|
4968
6199
|
};
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
6200
|
+
ye(n, [V - se.x, H + se.y]), ye(m, [ve, H]), ye(o, [ge, _e]), ye(d, [ge, _e]), ye(f, [ge, _e]), ye(p, [ge, _e]), E.set(n.drawableID, [100, 100]), E.set(m.drawableID, [e * 100, e * 100]);
|
|
6201
|
+
for (let e of [
|
|
6202
|
+
o,
|
|
6203
|
+
d,
|
|
6204
|
+
f
|
|
6205
|
+
]) {
|
|
6206
|
+
if (!e) continue;
|
|
6207
|
+
let t = _.get(e.drawableID) ?? 0;
|
|
6208
|
+
E.set(e.drawableID, [t, t]);
|
|
6209
|
+
}
|
|
6210
|
+
p && E.set(p.drawableID, [e * 100, e * 100]), h && E.set(h.drawableID, [v.scalePercent, v.scalePercent]), h && ye(h, [ve + i.width / 2 - v.width / 2 - Qa * e, H - i.height / 2 + v.height / 2 + Qa * e]), j(), M();
|
|
6211
|
+
}, P = t.onTargetVisualChange, F = (e) => {
|
|
6212
|
+
P?.(e), N();
|
|
4972
6213
|
};
|
|
4973
|
-
return
|
|
4974
|
-
targets:
|
|
6214
|
+
return C.placement.basis === "actor" && (t.onTargetVisualChange = F), Object.freeze({
|
|
6215
|
+
targets: g,
|
|
4975
6216
|
setLayerVisible(e, t) {
|
|
4976
|
-
|
|
6217
|
+
b || (v.set(e, t), M());
|
|
4977
6218
|
},
|
|
4978
6219
|
updateStyle(e) {
|
|
4979
|
-
if (
|
|
4980
|
-
let n =
|
|
4981
|
-
|
|
4982
|
-
let r =
|
|
4983
|
-
n && !r ? t.onTargetVisualChange ===
|
|
6220
|
+
if (b) return;
|
|
6221
|
+
let n = C.placement.basis === "actor";
|
|
6222
|
+
C = e, D = [0, 0], O = 1, k = 1, A = void 0, e.reveal?.layout !== "RESERVED" && (w = void 0);
|
|
6223
|
+
let r = C.placement.basis === "actor";
|
|
6224
|
+
n && !r ? t.onTargetVisualChange === F && (t.onTargetVisualChange = P ?? null) : !n && r && (t.onTargetVisualChange = F), N();
|
|
4984
6225
|
},
|
|
4985
6226
|
captureTextLayout() {
|
|
4986
|
-
|
|
6227
|
+
b || (w = uo(a, m, {
|
|
4987
6228
|
width: 180,
|
|
4988
6229
|
height: 48
|
|
4989
|
-
}),
|
|
6230
|
+
}), N());
|
|
4990
6231
|
},
|
|
4991
6232
|
clearTextLayout() {
|
|
4992
|
-
|
|
6233
|
+
w = void 0, N();
|
|
4993
6234
|
},
|
|
4994
6235
|
async animate(e) {
|
|
4995
|
-
if (
|
|
6236
|
+
if (b) return;
|
|
4996
6237
|
let t = Math.max(0, e.durationSeconds ?? 0), n = () => {
|
|
4997
|
-
|
|
4998
|
-
}, r = (t) =>
|
|
6238
|
+
b || (j(), M());
|
|
6239
|
+
}, r = (t) => da(t, e.ease ?? "easeInOut");
|
|
4999
6240
|
if (e.name === "fadeIn" || e.name === "floatIn" || e.name === "zoomIn" || e.name === "riseUp") {
|
|
5000
|
-
|
|
6241
|
+
y = !0;
|
|
5001
6242
|
let a = e.name === "floatIn" || e.name === "riseUp" ? [0, 16] : [0, 0], o = e.name === "zoomIn" ? .01 : 1;
|
|
5002
|
-
|
|
6243
|
+
D = a, O = o, k = e.name === "fadeIn" ? 0 : 1, n(), await fa(i, t, (t) => {
|
|
5003
6244
|
let i = r(t);
|
|
5004
|
-
|
|
5005
|
-
}),
|
|
6245
|
+
D = [a[0] * (1 - i), a[1] * (1 - i)], O = o + (1 - o) * i, k = e.name === "fadeIn" ? i : 1, n();
|
|
6246
|
+
}), D = [0, 0], O = 1, k = 1, N();
|
|
5006
6247
|
return;
|
|
5007
6248
|
}
|
|
5008
6249
|
if (e.name === "fadeOut" || e.name === "floatOut" || e.name === "zoomOut" || e.name === "sink") {
|
|
5009
6250
|
let a = e.name === "floatOut" || e.name === "sink" ? [0, -16] : [0, 0], o = e.name === "zoomOut" ? .01 : 1;
|
|
5010
|
-
|
|
6251
|
+
D = [0, 0], O = 1, k = 1, n(), await fa(i, t, (t) => {
|
|
5011
6252
|
let i = r(t);
|
|
5012
|
-
|
|
5013
|
-
}),
|
|
6253
|
+
D = [a[0] * i, a[1] * i], O = 1 + (o - 1) * i, k = e.name === "fadeOut" ? 1 - i : 1, n();
|
|
6254
|
+
}), D = a, O = o, k = e.name === "fadeOut" ? 0 : 1, n(), y = !1, M(), D = [0, 0], O = 1, k = 1;
|
|
5014
6255
|
return;
|
|
5015
6256
|
}
|
|
5016
6257
|
if (e.name === "shake") {
|
|
5017
|
-
let a = Math.max(1, Math.floor(e.count ?? 1)), o = t > 0 ? t : a * .08, s =
|
|
5018
|
-
|
|
6258
|
+
let a = Math.max(1, Math.floor(e.count ?? 1)), o = t > 0 ? t : a * .08, s = ve(typeof e.direction == "number" ? e.direction : e.direction ?? "right") ?? ve("right");
|
|
6259
|
+
D = [0, 0], await fa(i, o, (e) => {
|
|
5019
6260
|
let t = r(e) * a * Math.PI * 2, i = Math.sin(t) * 5;
|
|
5020
|
-
|
|
5021
|
-
}),
|
|
6261
|
+
D = [s.x * i, s.y * i], n();
|
|
6262
|
+
}), D = [0, 0], N();
|
|
5022
6263
|
return;
|
|
5023
6264
|
}
|
|
5024
6265
|
if (e.name === "explode") {
|
|
5025
6266
|
let a = Math.max(1, Math.floor(e.count ?? 1)), o = t > 0 ? t : a * .12, s = e.relativeScale ?? 1.15;
|
|
5026
|
-
await
|
|
6267
|
+
await fa(i, o, (e) => {
|
|
5027
6268
|
let t = r(e), i = Math.abs(Math.sin(t * a * Math.PI));
|
|
5028
|
-
|
|
5029
|
-
}),
|
|
6269
|
+
O = 1 + (s - 1) * i, n();
|
|
6270
|
+
}), O = 1, N();
|
|
5030
6271
|
return;
|
|
5031
6272
|
}
|
|
5032
6273
|
if (e.name === "animateBubbleShape") {
|
|
5033
|
-
let n = e.visualStyle ??
|
|
5034
|
-
|
|
6274
|
+
let n = e.visualStyle ?? C.visualStyle, r = C.visualStyle, a = e.speed === void 0 ? 1 : Math.max(0, e.speed);
|
|
6275
|
+
A = {
|
|
5035
6276
|
from: r,
|
|
5036
6277
|
to: n,
|
|
5037
6278
|
progress: 0
|
|
5038
|
-
},
|
|
5039
|
-
let o = t === 0 ? 1 :
|
|
5040
|
-
|
|
6279
|
+
}, N(), await fa(i, t, (i) => {
|
|
6280
|
+
let o = t === 0 ? 1 : ua(i * Math.max(a, 1) / 1);
|
|
6281
|
+
A = {
|
|
5041
6282
|
from: r,
|
|
5042
6283
|
to: n,
|
|
5043
|
-
progress:
|
|
5044
|
-
},
|
|
5045
|
-
}),
|
|
6284
|
+
progress: da(o, e.ease ?? "easeInOut")
|
|
6285
|
+
}, N();
|
|
6286
|
+
}), A = void 0, N();
|
|
5046
6287
|
return;
|
|
5047
6288
|
}
|
|
5048
6289
|
},
|
|
5049
6290
|
show() {
|
|
5050
|
-
|
|
6291
|
+
b || (y = !0, N());
|
|
5051
6292
|
},
|
|
5052
6293
|
hide() {
|
|
5053
|
-
|
|
6294
|
+
b || (y = !1, M());
|
|
5054
6295
|
},
|
|
5055
6296
|
dispose() {
|
|
5056
|
-
if (!
|
|
5057
|
-
|
|
5058
|
-
for (let e of [...s].reverse()) a.destroyDrawable(e.drawableID,
|
|
5059
|
-
c !== void 0 && (a.destroySkin(c), c = void 0), e.requestRedraw?.();
|
|
6297
|
+
if (!b) {
|
|
6298
|
+
b = !0, C.placement.basis === "actor" && t.onTargetVisualChange === F && (t.onTargetVisualChange = P ?? null);
|
|
6299
|
+
for (let e of [...s].reverse()) a.destroyDrawable(e.drawableID, Ya);
|
|
6300
|
+
c !== void 0 && (a.destroySkin(c), c = void 0), l !== void 0 && (a.destroySkin(l), l = void 0), e.requestRedraw?.();
|
|
5060
6301
|
}
|
|
5061
6302
|
}
|
|
5062
6303
|
});
|
|
5063
6304
|
} catch (e) {
|
|
5064
|
-
for (let e of [...s].reverse()) a.destroyDrawable(e.drawableID,
|
|
5065
|
-
throw c !== void 0 && a.destroySkin(c), e;
|
|
6305
|
+
for (let e of [...s].reverse()) a.destroyDrawable(e.drawableID, Ya);
|
|
6306
|
+
throw c !== void 0 && a.destroySkin(c), l !== void 0 && a.destroySkin(l), e;
|
|
5066
6307
|
}
|
|
5067
6308
|
}
|
|
5068
|
-
function
|
|
5069
|
-
if (!
|
|
5070
|
-
let n = e, r =
|
|
5071
|
-
if (
|
|
6309
|
+
function vo(e, t = {}) {
|
|
6310
|
+
if (!to(e)) throw new $("BUBBLE-RUNTIME-001", "Bubble requires the TurboWarp runtime.");
|
|
6311
|
+
let n = e, r = no(n.renderer), i = ro(t.bubbleRenderBackend), a = i === "svg-overlay" ? t.svgOverlayTextCapability ?? so() : void 0, o = io(t.svgOverlayUnsupportedBehavior), s = i === "svg-overlay" ? ao(t.document) : void 0, c = i === "svg-overlay" ? oo(r, s, a) : void 0;
|
|
6312
|
+
if (i === "svg-overlay" && c !== void 0 && o === "error") throw new $("BUBBLE-RUNTIME-004", `Bubble SVG overlay backend is unavailable because ${c}. Use scratch-render or install the required public upstream capability.`);
|
|
6313
|
+
let l = i === "svg-overlay" && c === void 0 ? "svg-overlay" : "scratch-render", u = t.scheduler ?? {
|
|
6314
|
+
setTimeout: (e, t) => globalThis.setTimeout(e, t),
|
|
6315
|
+
clearTimeout: (e) => globalThis.clearTimeout(e)
|
|
6316
|
+
}, d = () => co(n.ext_kubohiroyaassetmanager), f;
|
|
6317
|
+
if (l === "svg-overlay") try {
|
|
6318
|
+
f = Na(a, r);
|
|
6319
|
+
} catch (e) {
|
|
6320
|
+
throw new $("BUBBLE-RUNTIME-004", `Bubble SVG overlay text capability is invalid: ${e instanceof Error ? e.message : String(e)}`);
|
|
6321
|
+
}
|
|
6322
|
+
else if (t.textCapability !== void 0) f = t.textCapability;
|
|
5072
6323
|
else try {
|
|
5073
|
-
|
|
6324
|
+
f = ta(n.ext_kubohiroyasvgtext);
|
|
5074
6325
|
} catch {
|
|
5075
6326
|
throw new $("BUBBLE-RUNTIME-003", "Bubble requires a text capability. Load @kubohiroya/turbowarp-svg-text or provide options.textCapability before using Bubble blocks.");
|
|
5076
6327
|
}
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
if (!Number.isInteger(a) || a < 0) throw new $("BUBBLE-RUNTIME-001", "Bubble image target drawable is invalid.");
|
|
5088
|
-
let o = await i().resolveSkin(e);
|
|
5089
|
-
if (!fi(o) || !Number.isInteger(o.skinId) || o.skinId < 0) throw new $("BUBBLE-RUNTIME-002", `Asset Manager did not resolve an image skin: ${String(e)}`);
|
|
5090
|
-
r.updateDrawableSkinId(a, o.skinId), n.requestRedraw?.();
|
|
5091
|
-
}
|
|
6328
|
+
let p;
|
|
6329
|
+
if (l === "svg-overlay") {
|
|
6330
|
+
if (t.svgOverlayImageCapability !== void 0) try {
|
|
6331
|
+
p = Ra(t.svgOverlayImageCapability);
|
|
6332
|
+
} catch (e) {
|
|
6333
|
+
throw new $("BUBBLE-RUNTIME-004", `Bubble SVG overlay image capability is invalid: ${e instanceof Error ? e.message : String(e)}`);
|
|
6334
|
+
}
|
|
6335
|
+
} else p = t.imageResolver ?? {
|
|
6336
|
+
isRegistered(e) {
|
|
6337
|
+
return d().isLoaded({ NAME: e });
|
|
5092
6338
|
},
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
return i().isLoaded({ NAME: e });
|
|
5096
|
-
},
|
|
5097
|
-
getMimeType(e) {
|
|
5098
|
-
return i().getAssetMimeType({ NAME: e });
|
|
5099
|
-
},
|
|
5100
|
-
async playSound(e, t = {}) {
|
|
5101
|
-
let n = i(), r = t.untilDone ? n?.playSoundUntilDone : n?.playSound;
|
|
5102
|
-
if (typeof r != "function") throw new $("BUBBLE-RUNTIME-002", "TurboWarp Asset Manager does not provide audio playback.");
|
|
5103
|
-
await r.call(n, { NAME: e });
|
|
5104
|
-
}
|
|
6339
|
+
getMimeType(e) {
|
|
6340
|
+
return d().getAssetMimeType({ NAME: e });
|
|
5105
6341
|
},
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
if (!
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
6342
|
+
async applyToTarget(e, t) {
|
|
6343
|
+
let i = t.drawableID;
|
|
6344
|
+
if (!Number.isInteger(i) || i < 0) throw new $("BUBBLE-RUNTIME-001", "Bubble image target drawable is invalid.");
|
|
6345
|
+
let a = await d().resolveSkin(e);
|
|
6346
|
+
if (!to(a) || !Number.isInteger(a.skinId) || a.skinId < 0) throw new $("BUBBLE-RUNTIME-002", `Asset Manager did not resolve an image skin: ${String(e)}`);
|
|
6347
|
+
r.updateDrawableSkinId(i, a.skinId), n.requestRedraw?.();
|
|
6348
|
+
}
|
|
6349
|
+
};
|
|
6350
|
+
let m = t.audio ?? {
|
|
6351
|
+
isRegistered(e) {
|
|
6352
|
+
return d().isLoaded({ NAME: e });
|
|
6353
|
+
},
|
|
6354
|
+
getMimeType(e) {
|
|
6355
|
+
return d().getAssetMimeType({ NAME: e });
|
|
6356
|
+
},
|
|
6357
|
+
async playSound(e, t = {}) {
|
|
6358
|
+
let n = d(), r = t.untilDone ? n?.playSoundUntilDone : n?.playSound;
|
|
6359
|
+
if (typeof r != "function") throw new $("BUBBLE-RUNTIME-002", "TurboWarp Asset Manager does not provide audio playback.");
|
|
6360
|
+
await r.call(n, { NAME: e });
|
|
6361
|
+
}
|
|
6362
|
+
}, h = l === "svg-overlay" ? za(r, s) : void 0;
|
|
6363
|
+
return Ji({
|
|
6364
|
+
...p === void 0 ? {} : { imageResolver: p },
|
|
6365
|
+
audio: m,
|
|
6366
|
+
textCapability: f,
|
|
6367
|
+
createSurface({ actor: e, actorKey: t, style: r }) {
|
|
6368
|
+
if (!to(e) || typeof e.id != "string") throw new $("BUBBLE-RUNTIME-001", "Bubble actor target is invalid.");
|
|
6369
|
+
return l === "svg-overlay" ? Ja(h, e, t, r, u) : _o(n, e, t, r, u);
|
|
5113
6370
|
},
|
|
5114
6371
|
...t.scheduler === void 0 ? {} : { scheduler: t.scheduler },
|
|
5115
6372
|
...t.onAnimationError === void 0 ? {} : { onAnimationError: t.onAnimationError }
|
|
5116
6373
|
});
|
|
5117
6374
|
}
|
|
5118
6375
|
//#endregion
|
|
5119
|
-
export { $ as BubbleRuntimeAdapterError,
|
|
6376
|
+
export { $ as BubbleRuntimeAdapterError, Sa as bubbleRenderBackends, la as createAssetManagerSvgOverlayImageCapability, Ra as createSvgOverlayImageAdapter, Ja as createSvgOverlaySurface, za as createSvgOverlaySurfaceManager, Na as createSvgOverlayTextAdapter, na as createSvgTextCompositionCapability, ra as createSvgTextOverlayTextCapability, vo as createTurboWarpBubbleComposition, ta as createTurboWarpSvgTextCapability, wa as defaultBubbleOverlayUnsupportedBehavior, Ca as defaultBubbleRenderBackend };
|