@kubohiroya/turbowarp-bubble 0.7.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 +69 -28
- package/THIRD_PARTY_NOTICES.md +10 -0
- package/dist/turbowarp-adapter.js +2098 -939
- package/dist/turbowarp-bubble.js +1605 -121
- package/dist/types/asset-manager-image-adapter.d.ts +18 -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 +17 -24
- package/docs/block-manual.md +30 -37
- package/docs/index.html +23 -32
- package/docs/ja/index.html +23 -32
- 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, Ae);
|
|
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 ne(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 L(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 R(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 z(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 le(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 ue(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 de(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 ge = 2048, _e = 2112, B = Uint8Array, ve = Uint16Array, ye = Int32Array, be
|
|
|
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 ge = 2048, _e = 2112, B = Uint8Array, ve = Uint16Array, ye = Int32Array, be
|
|
|
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 ge = 2048, _e = 2112, B = Uint8Array, ve = Uint16Array, ye = Int32Array, be
|
|
|
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,30 +4430,30 @@ 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
|
|
4008
4437
|
//#region src/portrait-layout.ts
|
|
4009
|
-
var
|
|
4438
|
+
var hi = Object.freeze([
|
|
4010
4439
|
"left",
|
|
4011
4440
|
"right",
|
|
4012
4441
|
"top-left",
|
|
4013
4442
|
"top-right",
|
|
4014
4443
|
"bottom-left",
|
|
4015
4444
|
"bottom-right"
|
|
4016
|
-
]),
|
|
4445
|
+
]), gi = Object.freeze({
|
|
4017
4446
|
x: 0,
|
|
4018
4447
|
y: 0,
|
|
4019
4448
|
zoomPercent: 100
|
|
4020
4449
|
});
|
|
4021
|
-
function
|
|
4450
|
+
function _i(e) {
|
|
4022
4451
|
if (typeof e != "string") throw TypeError("Bubble portrait placement must be a string.");
|
|
4023
4452
|
let t = e.trim().toLowerCase().replaceAll("_", "-");
|
|
4024
|
-
if (!
|
|
4453
|
+
if (!hi.includes(t)) throw TypeError(`Unsupported Bubble portrait placement: ${e}`);
|
|
4025
4454
|
return t;
|
|
4026
4455
|
}
|
|
4027
|
-
function
|
|
4456
|
+
function vi(e) {
|
|
4028
4457
|
if (!Array.isArray(e) || e.length !== 2 && e.length !== 3) throw TypeError("Bubble portrait offset must be [x, y] or [x, y, zoom].");
|
|
4029
4458
|
let [t, n, r = 100] = e;
|
|
4030
4459
|
if (![
|
|
@@ -4038,7 +4467,7 @@ function kr(e) {
|
|
|
4038
4467
|
zoomPercent: r
|
|
4039
4468
|
});
|
|
4040
4469
|
}
|
|
4041
|
-
function
|
|
4470
|
+
function yi(e) {
|
|
4042
4471
|
if (typeof e != "number" || !Number.isFinite(e) || e < 0) throw TypeError("Bubble portrait corner radius must be zero or greater.");
|
|
4043
4472
|
return e;
|
|
4044
4473
|
}
|
|
@@ -4049,11 +4478,11 @@ var Z = class extends Error {
|
|
|
4049
4478
|
constructor(e, t) {
|
|
4050
4479
|
super(t), this.name = "BubbleCompositionError", this.code = e;
|
|
4051
4480
|
}
|
|
4052
|
-
},
|
|
4481
|
+
}, bi = /* @__PURE__ */ new Set(["say", "think"]), xi = /* @__PURE__ */ new Set([
|
|
4053
4482
|
"idle",
|
|
4054
4483
|
"talking",
|
|
4055
4484
|
"awaiting-continue"
|
|
4056
|
-
]),
|
|
4485
|
+
]), Si = /* @__PURE__ */ new Set([
|
|
4057
4486
|
"fadeIn",
|
|
4058
4487
|
"fadeOut",
|
|
4059
4488
|
"floatIn",
|
|
@@ -4065,7 +4494,7 @@ var Z = class extends Error {
|
|
|
4065
4494
|
"shake",
|
|
4066
4495
|
"explode",
|
|
4067
4496
|
"animateBubbleShape"
|
|
4068
|
-
]),
|
|
4497
|
+
]), Ci = /* @__PURE__ */ new Set([
|
|
4069
4498
|
"linear",
|
|
4070
4499
|
"easeIn",
|
|
4071
4500
|
"easeOut",
|
|
@@ -4074,45 +4503,45 @@ var Z = class extends Error {
|
|
|
4074
4503
|
function Q(e) {
|
|
4075
4504
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
4076
4505
|
}
|
|
4077
|
-
function
|
|
4506
|
+
function wi(e, t, n, r) {
|
|
4078
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));
|
|
4079
4508
|
if (a.length > 0 || o.length > 0) throw new Z("BUBBLE-COMPOSITION-001", `${r} has missing or unknown properties.`);
|
|
4080
4509
|
}
|
|
4081
|
-
function
|
|
4510
|
+
function Ti(e, t) {
|
|
4082
4511
|
if (typeof e != "string" || e.trim().length === 0) throw new Z("BUBBLE-COMPOSITION-001", `${t} must be a non-empty string.`);
|
|
4083
4512
|
return e.trim();
|
|
4084
4513
|
}
|
|
4085
|
-
function
|
|
4514
|
+
function Ei(e, t) {
|
|
4086
4515
|
if (typeof e != "string" || e.length === 0) throw new Z("BUBBLE-COMPOSITION-001", `${t} must be a non-empty string.`);
|
|
4087
4516
|
return e;
|
|
4088
4517
|
}
|
|
4089
|
-
function
|
|
4518
|
+
function Di(e, t, n) {
|
|
4090
4519
|
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", `${t} must be an object.`);
|
|
4091
|
-
if (
|
|
4092
|
-
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;
|
|
4093
4522
|
if (typeof i != "number" || !Number.isFinite(i) || i <= 0) throw new Z("BUBBLE-COMPOSITION-001", `${t}.frameIntervalSeconds must be a positive finite number.`);
|
|
4094
4523
|
return Object.freeze({
|
|
4095
4524
|
frames: r,
|
|
4096
4525
|
frameIntervalSeconds: i
|
|
4097
4526
|
});
|
|
4098
4527
|
}
|
|
4099
|
-
function
|
|
4528
|
+
function Oi(e) {
|
|
4100
4529
|
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble portrait must be an object.");
|
|
4101
|
-
|
|
4530
|
+
wi(e, ["base"], [
|
|
4102
4531
|
"blink",
|
|
4103
4532
|
"lipSync",
|
|
4104
4533
|
"placement",
|
|
4105
4534
|
"offset",
|
|
4106
4535
|
"cornerRadius"
|
|
4107
4536
|
], "Bubble portrait");
|
|
4108
|
-
let t = e.blink === void 0 ? void 0 :
|
|
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;
|
|
4109
4538
|
try {
|
|
4110
|
-
r =
|
|
4539
|
+
r = _i(e.placement ?? "left"), i = e.offset === void 0 ? gi : vi(e.offset), a = yi(e.cornerRadius ?? 0);
|
|
4111
4540
|
} catch (e) {
|
|
4112
4541
|
throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble portrait layout is invalid.");
|
|
4113
4542
|
}
|
|
4114
4543
|
return Object.freeze({
|
|
4115
|
-
base:
|
|
4544
|
+
base: Ei(e.base, "Bubble portrait base"),
|
|
4116
4545
|
...t === void 0 ? {} : { blink: t },
|
|
4117
4546
|
...n === void 0 ? {} : { lipSync: n },
|
|
4118
4547
|
placement: r,
|
|
@@ -4120,9 +4549,9 @@ function zr(e) {
|
|
|
4120
4549
|
cornerRadius: a
|
|
4121
4550
|
});
|
|
4122
4551
|
}
|
|
4123
|
-
function
|
|
4552
|
+
function ki(e, t) {
|
|
4124
4553
|
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", `${t} must be an object.`);
|
|
4125
|
-
if (
|
|
4554
|
+
if (wi(e, ["name"], [
|
|
4126
4555
|
"durationSeconds",
|
|
4127
4556
|
"ease",
|
|
4128
4557
|
"direction",
|
|
@@ -4130,7 +4559,7 @@ function Br(e, t) {
|
|
|
4130
4559
|
"relativeScale",
|
|
4131
4560
|
"speed",
|
|
4132
4561
|
"visualStyle"
|
|
4133
|
-
], t), !
|
|
4562
|
+
], t), !Si.has(e.name)) throw new Z("BUBBLE-COMPOSITION-001", `${t}.name is not a supported Bubble motion.`);
|
|
4134
4563
|
let n = (n, r, i = !1) => {
|
|
4135
4564
|
let a = e[n];
|
|
4136
4565
|
if (a !== void 0) {
|
|
@@ -4140,9 +4569,9 @@ function Br(e, t) {
|
|
|
4140
4569
|
}, r = n("durationSeconds", 0), i = n("count", 1, !0), a = n("relativeScale", 0), o = n("speed", 0), s = e.direction;
|
|
4141
4570
|
if (s !== void 0 && typeof s != "number" && typeof s != "string") throw new Z("BUBBLE-COMPOSITION-001", `${t}.direction is invalid.`);
|
|
4142
4571
|
let c = e.ease ?? "easeInOut";
|
|
4143
|
-
if (typeof c != "string" || !
|
|
4572
|
+
if (typeof c != "string" || !Ci.has(c)) throw new Z("BUBBLE-COMPOSITION-001", `${t}.ease is invalid.`);
|
|
4144
4573
|
let l = e.visualStyle;
|
|
4145
|
-
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.`);
|
|
4146
4575
|
return Object.freeze({
|
|
4147
4576
|
name: e.name,
|
|
4148
4577
|
...r === void 0 ? {} : { durationSeconds: r },
|
|
@@ -4154,10 +4583,10 @@ function Br(e, t) {
|
|
|
4154
4583
|
...l === void 0 ? {} : { visualStyle: l }
|
|
4155
4584
|
});
|
|
4156
4585
|
}
|
|
4157
|
-
function
|
|
4586
|
+
function Ai(e) {
|
|
4158
4587
|
if (e === void 0) return;
|
|
4159
4588
|
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble audio must be an object.");
|
|
4160
|
-
|
|
4589
|
+
wi(e, [], [
|
|
4161
4590
|
"voice",
|
|
4162
4591
|
"reveal",
|
|
4163
4592
|
"finish"
|
|
@@ -4169,13 +4598,13 @@ function Vr(e) {
|
|
|
4169
4598
|
"finish"
|
|
4170
4599
|
]) {
|
|
4171
4600
|
let r = e[n];
|
|
4172
|
-
r !== void 0 && (t[n] =
|
|
4601
|
+
r !== void 0 && (t[n] = Ei(r, `Bubble audio ${n}`));
|
|
4173
4602
|
}
|
|
4174
4603
|
return Object.freeze(t);
|
|
4175
4604
|
}
|
|
4176
|
-
function
|
|
4605
|
+
function ji(e) {
|
|
4177
4606
|
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble style must be an object.");
|
|
4178
|
-
|
|
4607
|
+
wi(e, ["name", "textStyle"], [
|
|
4179
4608
|
"placement",
|
|
4180
4609
|
"maxWidth",
|
|
4181
4610
|
"textLocale",
|
|
@@ -4190,35 +4619,35 @@ function Hr(e) {
|
|
|
4190
4619
|
"showAnimation",
|
|
4191
4620
|
"hideAnimation"
|
|
4192
4621
|
], "Bubble style");
|
|
4193
|
-
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;
|
|
4194
4623
|
if (e.reveal !== void 0) try {
|
|
4195
|
-
r =
|
|
4624
|
+
r = di(e.reveal);
|
|
4196
4625
|
} catch (e) {
|
|
4197
4626
|
throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble reveal is invalid.");
|
|
4198
4627
|
}
|
|
4199
|
-
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;
|
|
4200
4629
|
try {
|
|
4201
|
-
s =
|
|
4630
|
+
s = _e(e.placement ?? "up-right");
|
|
4202
4631
|
} catch (e) {
|
|
4203
4632
|
throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble placement is invalid.");
|
|
4204
4633
|
}
|
|
4205
4634
|
let c, l, u;
|
|
4206
4635
|
try {
|
|
4207
|
-
c =
|
|
4636
|
+
c = xe(e.distance ?? 12), l = Se(e.tailLength ?? 18), u = e.offset === void 0 ? ye : Ce(e.offset);
|
|
4208
4637
|
} catch (e) {
|
|
4209
4638
|
throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble actor-relative transform is invalid.");
|
|
4210
4639
|
}
|
|
4211
4640
|
let d = e.visualStyle ?? "NORMAL";
|
|
4212
|
-
if (typeof d != "string" || !
|
|
4641
|
+
if (typeof d != "string" || !je.includes(d)) throw new Z("BUBBLE-COMPOSITION-001", `Unsupported Bubble visual style: ${String(d)}`);
|
|
4213
4642
|
let f;
|
|
4214
4643
|
if (e.maxWidth !== void 0) {
|
|
4215
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.");
|
|
4216
4645
|
f = e.maxWidth;
|
|
4217
4646
|
}
|
|
4218
|
-
let p = e.textLocale === void 0 ? void 0 :
|
|
4647
|
+
let p = e.textLocale === void 0 ? void 0 : Ti(e.textLocale, "Bubble style text locale");
|
|
4219
4648
|
return Object.freeze({
|
|
4220
|
-
name:
|
|
4221
|
-
textStyle:
|
|
4649
|
+
name: Ti(e.name, "Bubble style name"),
|
|
4650
|
+
textStyle: Ti(e.textStyle, "Bubble text style name"),
|
|
4222
4651
|
...f === void 0 ? {} : { maxWidth: f },
|
|
4223
4652
|
...p === void 0 ? {} : { textLocale: p },
|
|
4224
4653
|
placement: s,
|
|
@@ -4234,13 +4663,13 @@ function Hr(e) {
|
|
|
4234
4663
|
...o === void 0 ? {} : { hideAnimation: o }
|
|
4235
4664
|
});
|
|
4236
4665
|
}
|
|
4237
|
-
function
|
|
4666
|
+
function Mi(e) {
|
|
4238
4667
|
if (e !== void 0) {
|
|
4239
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.");
|
|
4240
4669
|
return e;
|
|
4241
4670
|
}
|
|
4242
4671
|
}
|
|
4243
|
-
function
|
|
4672
|
+
function Ni(e) {
|
|
4244
4673
|
if (e !== void 0) {
|
|
4245
4674
|
if (!Q(e) || typeof e.playSound != "function") throw TypeError("Bubble audio capability must provide playSound.");
|
|
4246
4675
|
if (e.isRegistered !== void 0 && typeof e.isRegistered != "function") throw TypeError("Bubble audio capability isRegistered must be a function.");
|
|
@@ -4248,67 +4677,67 @@ function Wr(e) {
|
|
|
4248
4677
|
return e;
|
|
4249
4678
|
}
|
|
4250
4679
|
}
|
|
4251
|
-
function
|
|
4680
|
+
function Pi(e) {
|
|
4252
4681
|
if (e === void 0) throw new Z("BUBBLE-COMPOSITION-006", "Bubble image assets require an image capability. Provide options.imageResolver.");
|
|
4253
4682
|
return e;
|
|
4254
4683
|
}
|
|
4255
|
-
function
|
|
4684
|
+
function Fi(e) {
|
|
4256
4685
|
if (!Q(e) || typeof e.setText != "function" || typeof e.releaseTarget != "function") throw TypeError("Bubble text capability must provide setText and releaseTarget.");
|
|
4257
4686
|
return e;
|
|
4258
4687
|
}
|
|
4259
|
-
function
|
|
4688
|
+
function Ii() {
|
|
4260
4689
|
return Object.freeze({
|
|
4261
4690
|
setTimeout: (e, t) => globalThis.setTimeout(e, t),
|
|
4262
4691
|
clearTimeout: (e) => globalThis.clearTimeout(e)
|
|
4263
4692
|
});
|
|
4264
4693
|
}
|
|
4265
|
-
function
|
|
4694
|
+
function Li(e) {
|
|
4266
4695
|
if (!Q(e) || typeof e.setTimeout != "function" || typeof e.clearTimeout != "function") throw TypeError("Bubble scheduler must provide setTimeout and clearTimeout.");
|
|
4267
4696
|
return e;
|
|
4268
4697
|
}
|
|
4269
|
-
function
|
|
4698
|
+
function Ri(e, t) {
|
|
4270
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.`);
|
|
4271
4700
|
return e;
|
|
4272
4701
|
}
|
|
4273
|
-
function
|
|
4702
|
+
function zi(e) {
|
|
4274
4703
|
if (typeof e != "object" || !e) throw new Z("BUBBLE-COMPOSITION-004", "Bubble text target must be a non-null object.");
|
|
4275
4704
|
return e;
|
|
4276
4705
|
}
|
|
4277
|
-
function
|
|
4706
|
+
function Bi(e, t) {
|
|
4278
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.");
|
|
4279
4708
|
let n = e.targets;
|
|
4280
|
-
|
|
4709
|
+
zi(n.text);
|
|
4281
4710
|
let r = /* @__PURE__ */ new Set(), i = (e, t) => {
|
|
4282
4711
|
let i = n[e];
|
|
4283
4712
|
if (!t && i === void 0) return;
|
|
4284
|
-
let a =
|
|
4713
|
+
let a = Ri(i, `Bubble surface ${e}`);
|
|
4285
4714
|
if (r.has(a.id)) throw new Z("BUBBLE-COMPOSITION-004", "Bubble image layers must use distinct target IDs.");
|
|
4286
4715
|
r.add(a.id);
|
|
4287
4716
|
};
|
|
4288
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;
|
|
4289
4718
|
}
|
|
4290
|
-
function
|
|
4719
|
+
function Vi(e, t) {
|
|
4291
4720
|
if (e === void 0) throw new Z("BUBBLE-COMPOSITION-006", `Bubble image capability is required for: ${t}. Provide options.imageResolver.`);
|
|
4292
4721
|
if (!e.isRegistered(t)) throw new Z("BUBBLE-COMPOSITION-003", `Bubble image asset is not registered: ${t}`);
|
|
4293
4722
|
if (!e.getMimeType(t).startsWith("image/")) throw new Z("BUBBLE-COMPOSITION-003", `Bubble asset is not an image: ${t}`);
|
|
4294
4723
|
}
|
|
4295
|
-
function
|
|
4724
|
+
function Hi(e, t) {
|
|
4296
4725
|
if (e === void 0) throw new Z("BUBBLE-COMPOSITION-006", `Bubble audio assets require an audio capability: ${t}. Provide options.audio.`);
|
|
4297
4726
|
if (e.isRegistered?.(t) === !1) throw new Z("BUBBLE-COMPOSITION-003", `Bubble audio asset is not registered: ${t}`);
|
|
4298
4727
|
let n = e.getMimeType?.(t);
|
|
4299
4728
|
if (n !== void 0 && !n.startsWith("audio/")) throw new Z("BUBBLE-COMPOSITION-003", `Bubble asset is not audio: ${t}`);
|
|
4300
4729
|
}
|
|
4301
|
-
function
|
|
4730
|
+
function Ui(e) {
|
|
4302
4731
|
return [...e.portrait === void 0 ? [] : [
|
|
4303
4732
|
e.portrait.base,
|
|
4304
4733
|
...e.portrait.blink?.frames ?? [],
|
|
4305
4734
|
...e.portrait.lipSync?.frames ?? []
|
|
4306
4735
|
], ...e.continueIndicator?.frames ?? []];
|
|
4307
4736
|
}
|
|
4308
|
-
function
|
|
4737
|
+
function Wi(e, t, n) {
|
|
4309
4738
|
if (t.maxWidth === void 0) return e;
|
|
4310
4739
|
if (typeof n.measureText != "function") throw new Z("BUBBLE-COMPOSITION-007", "Bubble style maxWidth requires the text capability measureText method.");
|
|
4311
|
-
return
|
|
4740
|
+
return si({
|
|
4312
4741
|
text: e,
|
|
4313
4742
|
maxWidth: t.maxWidth,
|
|
4314
4743
|
...t.textLocale === void 0 ? {} : { locale: t.textLocale },
|
|
@@ -4318,11 +4747,11 @@ function ti(e, t, n) {
|
|
|
4318
4747
|
}) ?? 0
|
|
4319
4748
|
}).lines.map(({ text: e }) => e).join("\n");
|
|
4320
4749
|
}
|
|
4321
|
-
function
|
|
4750
|
+
function Gi(e, t) {
|
|
4322
4751
|
if (e.length === 1) throw e[0];
|
|
4323
4752
|
if (e.length > 1) throw AggregateError(e, t);
|
|
4324
4753
|
}
|
|
4325
|
-
function
|
|
4754
|
+
function Ki(e) {
|
|
4326
4755
|
let t = !1, n = 0, r = 0, i, a = Promise.resolve(), o = async (t) => {
|
|
4327
4756
|
let n = e.animation.frames[t];
|
|
4328
4757
|
n !== void 0 && await e.imageResolver.applyToTarget(n, e.target);
|
|
@@ -4357,40 +4786,40 @@ function ri(e) {
|
|
|
4357
4786
|
}
|
|
4358
4787
|
});
|
|
4359
4788
|
}
|
|
4360
|
-
function
|
|
4789
|
+
function qi(e) {
|
|
4361
4790
|
if (!Q(e)) throw new Z("BUBBLE-COMPOSITION-001", "Show bubble input must be an object.");
|
|
4362
|
-
if (
|
|
4791
|
+
if (wi(e, [
|
|
4363
4792
|
"actor",
|
|
4364
4793
|
"actorKey",
|
|
4365
4794
|
"kind",
|
|
4366
4795
|
"text",
|
|
4367
4796
|
"styleName"
|
|
4368
|
-
], ["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.");
|
|
4369
4798
|
if (typeof e.text != "string") throw new Z("BUBBLE-COMPOSITION-001", "Bubble text must be a string.");
|
|
4370
4799
|
let t = e.animationMode ?? "talking";
|
|
4371
|
-
if (!
|
|
4800
|
+
if (!xi.has(t)) throw new Z("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid.");
|
|
4372
4801
|
let n;
|
|
4373
4802
|
if (e.reveal !== void 0) try {
|
|
4374
|
-
n =
|
|
4803
|
+
n = di(e.reveal);
|
|
4375
4804
|
} catch (e) {
|
|
4376
4805
|
throw new Z("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble reveal is invalid.");
|
|
4377
4806
|
}
|
|
4378
4807
|
return {
|
|
4379
4808
|
actor: e.actor,
|
|
4380
|
-
actorKey:
|
|
4809
|
+
actorKey: Ti(e.actorKey, "Bubble actor key"),
|
|
4381
4810
|
kind: e.kind,
|
|
4382
4811
|
text: e.text,
|
|
4383
|
-
styleName:
|
|
4812
|
+
styleName: Ti(e.styleName, "Bubble style name"),
|
|
4384
4813
|
animationMode: t,
|
|
4385
4814
|
...n === void 0 ? {} : { reveal: n }
|
|
4386
4815
|
};
|
|
4387
4816
|
}
|
|
4388
|
-
function
|
|
4817
|
+
function Ji(e) {
|
|
4389
4818
|
if (!Q(e)) throw TypeError("Bubble composition options must be an object.");
|
|
4390
|
-
let t =
|
|
4819
|
+
let t = Mi(e.imageResolver), n = Ni(e.audio), r = Fi(e.textCapability);
|
|
4391
4820
|
if (typeof e.createSurface != "function") throw TypeError("Bubble composition createSurface must be a function.");
|
|
4392
4821
|
if (e.onAnimationError !== void 0 && typeof e.onAnimationError != "function") throw TypeError("Bubble composition onAnimationError must be a function.");
|
|
4393
|
-
let i =
|
|
4822
|
+
let i = Li(e.scheduler ?? Ii()), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = !1, l = () => {
|
|
4394
4823
|
if (c) throw new Z("BUBBLE-COMPOSITION-005", "Bubble composition has been disposed.");
|
|
4395
4824
|
}, u = async (e, t) => {
|
|
4396
4825
|
let n = (s.get(e) ?? Promise.resolve()).catch(() => void 0).then(t);
|
|
@@ -4410,8 +4839,8 @@ function ai(e) {
|
|
|
4410
4839
|
reveal: s.reveal
|
|
4411
4840
|
}));
|
|
4412
4841
|
let d = s.text, f = (e) => {
|
|
4413
|
-
let n = new Set(
|
|
4414
|
-
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);
|
|
4415
4844
|
return r;
|
|
4416
4845
|
}, p = f(u);
|
|
4417
4846
|
for (let e of [
|
|
@@ -4419,13 +4848,13 @@ function ai(e) {
|
|
|
4419
4848
|
u.audio?.reveal,
|
|
4420
4849
|
u.audio?.finish,
|
|
4421
4850
|
u.reveal?.sound
|
|
4422
|
-
]) e !== void 0 &&
|
|
4851
|
+
]) e !== void 0 && Hi(n, e);
|
|
4423
4852
|
let m = async (e, t = !1) => {
|
|
4424
4853
|
e !== void 0 && n !== void 0 && await n.playSound(e, { untilDone: t });
|
|
4425
4854
|
}, h = async (e, t, n) => {
|
|
4426
|
-
let r =
|
|
4855
|
+
let r = Ui(e).length === 0 ? void 0 : Pi(t), i = [];
|
|
4427
4856
|
if (e.portrait) {
|
|
4428
|
-
let t =
|
|
4857
|
+
let t = Pi(r);
|
|
4429
4858
|
i.push(Promise.resolve(t.applyToTarget(e.portrait.base, n.targets.portraitBase)));
|
|
4430
4859
|
let a = e.portrait.blink?.frames[0];
|
|
4431
4860
|
a !== void 0 && i.push(Promise.resolve(t.applyToTarget(a, n.targets.portraitBlink)));
|
|
@@ -4434,47 +4863,47 @@ function ai(e) {
|
|
|
4434
4863
|
}
|
|
4435
4864
|
let a = e.continueIndicator?.frames[0];
|
|
4436
4865
|
if (a !== void 0) {
|
|
4437
|
-
let e =
|
|
4866
|
+
let e = Pi(r);
|
|
4438
4867
|
i.push(Promise.resolve(e.applyToTarget(a, n.targets.continueIndicator)));
|
|
4439
4868
|
}
|
|
4440
4869
|
await Promise.all(i);
|
|
4441
4870
|
}, g = (t, n, r) => {
|
|
4442
|
-
x = t.portrait?.blink === void 0 ? void 0 :
|
|
4871
|
+
x = t.portrait?.blink === void 0 ? void 0 : Ki({
|
|
4443
4872
|
actorKey: s.actorKey,
|
|
4444
4873
|
layer: "portraitBlink",
|
|
4445
4874
|
animation: t.portrait.blink,
|
|
4446
4875
|
target: r.targets.portraitBlink,
|
|
4447
|
-
imageResolver:
|
|
4876
|
+
imageResolver: Pi(n),
|
|
4448
4877
|
scheduler: i,
|
|
4449
4878
|
...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
|
|
4450
|
-
}), S = t.portrait?.lipSync === void 0 ? void 0 :
|
|
4879
|
+
}), S = t.portrait?.lipSync === void 0 ? void 0 : Ki({
|
|
4451
4880
|
actorKey: s.actorKey,
|
|
4452
4881
|
layer: "portraitLipSync",
|
|
4453
4882
|
animation: t.portrait.lipSync,
|
|
4454
4883
|
target: r.targets.portraitLipSync,
|
|
4455
|
-
imageResolver:
|
|
4884
|
+
imageResolver: Pi(n),
|
|
4456
4885
|
scheduler: i,
|
|
4457
4886
|
...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
|
|
4458
|
-
}), C = t.continueIndicator === void 0 ? void 0 :
|
|
4887
|
+
}), C = t.continueIndicator === void 0 ? void 0 : Ki({
|
|
4459
4888
|
actorKey: s.actorKey,
|
|
4460
4889
|
layer: "continueIndicator",
|
|
4461
4890
|
animation: t.continueIndicator,
|
|
4462
4891
|
target: r.targets.continueIndicator,
|
|
4463
|
-
imageResolver:
|
|
4892
|
+
imageResolver: Pi(n),
|
|
4464
4893
|
scheduler: i,
|
|
4465
4894
|
...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
|
|
4466
4895
|
});
|
|
4467
4896
|
}, _ = o.get(s.actorKey);
|
|
4468
4897
|
_ && await _.close();
|
|
4469
|
-
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;
|
|
4470
4899
|
try {
|
|
4471
|
-
v =
|
|
4900
|
+
v = Bi(await e.createSurface(Object.freeze({
|
|
4472
4901
|
actor: s.actor,
|
|
4473
4902
|
actorKey: s.actorKey,
|
|
4474
4903
|
kind: s.kind,
|
|
4475
4904
|
style: u
|
|
4476
4905
|
})), u);
|
|
4477
|
-
let t =
|
|
4906
|
+
let t = Wi(s.text, u, r);
|
|
4478
4907
|
w?.layout === "RESERVED" && (r.setText({
|
|
4479
4908
|
styleName: u.textStyle,
|
|
4480
4909
|
target: v.targets.text,
|
|
@@ -4482,15 +4911,15 @@ function ai(e) {
|
|
|
4482
4911
|
}), v.captureTextLayout?.()), r.setText({
|
|
4483
4912
|
styleName: u.textStyle,
|
|
4484
4913
|
target: v.targets.text,
|
|
4485
|
-
text:
|
|
4914
|
+
text: Wi(w ? mi(T, E) : s.text, u, r)
|
|
4486
4915
|
}), y = !0, await h(u, p, v), g(u, p, v);
|
|
4487
4916
|
let a = "idle", c = !1, l = Promise.resolve(), _ = async () => {
|
|
4488
4917
|
if (!v) return;
|
|
4489
|
-
let e = w ?
|
|
4918
|
+
let e = w ? mi(T, E) : d;
|
|
4490
4919
|
r.setText({
|
|
4491
4920
|
styleName: u.textStyle,
|
|
4492
4921
|
target: v.targets.text,
|
|
4493
|
-
text:
|
|
4922
|
+
text: Wi(e, u, r)
|
|
4494
4923
|
}), await v.show();
|
|
4495
4924
|
}, k = () => {
|
|
4496
4925
|
O += 1, D !== void 0 && i.clearTimeout(D), D = void 0;
|
|
@@ -4517,10 +4946,10 @@ function ai(e) {
|
|
|
4517
4946
|
},
|
|
4518
4947
|
setText(e) {
|
|
4519
4948
|
return c ? Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`)) : typeof e == "string" ? (l = l.then(async () => {
|
|
4520
|
-
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({
|
|
4521
4950
|
styleName: u.textStyle,
|
|
4522
4951
|
target: v.targets.text,
|
|
4523
|
-
text:
|
|
4952
|
+
text: Wi(e, u, r)
|
|
4524
4953
|
}), v.captureTextLayout?.()), await _(), j()) : await _());
|
|
4525
4954
|
}), l) : Promise.reject(new Z("BUBBLE-COMPOSITION-001", "Bubble text must be a string."));
|
|
4526
4955
|
},
|
|
@@ -4528,32 +4957,32 @@ function ai(e) {
|
|
|
4528
4957
|
if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
4529
4958
|
let t;
|
|
4530
4959
|
try {
|
|
4531
|
-
t =
|
|
4960
|
+
t = ji(e);
|
|
4532
4961
|
} catch (e) {
|
|
4533
4962
|
return Promise.reject(e);
|
|
4534
4963
|
}
|
|
4535
4964
|
return l = l.then(async () => {
|
|
4536
4965
|
if (!v) return;
|
|
4537
|
-
|
|
4966
|
+
Bi(v, t);
|
|
4538
4967
|
let e = f(t);
|
|
4539
4968
|
for (let e of [
|
|
4540
4969
|
t.audio?.voice,
|
|
4541
4970
|
t.audio?.reveal,
|
|
4542
4971
|
t.audio?.finish,
|
|
4543
4972
|
t.reveal?.sound
|
|
4544
|
-
]) e !== void 0 &&
|
|
4973
|
+
]) e !== void 0 && Hi(n, e);
|
|
4545
4974
|
await Promise.all([
|
|
4546
4975
|
x?.stop(),
|
|
4547
4976
|
S?.stop(),
|
|
4548
4977
|
C?.stop()
|
|
4549
|
-
]), 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({
|
|
4550
4979
|
styleName: t.textStyle,
|
|
4551
4980
|
target: v.targets.text,
|
|
4552
|
-
text:
|
|
4981
|
+
text: Wi(d, t, r)
|
|
4553
4982
|
}), v.captureTextLayout?.()), r.setText({
|
|
4554
4983
|
styleName: t.textStyle,
|
|
4555
4984
|
target: v.targets.text,
|
|
4556
|
-
text:
|
|
4985
|
+
text: Wi(d, t, r)
|
|
4557
4986
|
}), g(t, e, v), await Promise.all([
|
|
4558
4987
|
v.setLayerVisible("portraitBase", t.portrait !== void 0),
|
|
4559
4988
|
v.setLayerVisible("portraitBlink", t.portrait?.blink !== void 0),
|
|
@@ -4565,7 +4994,7 @@ function ai(e) {
|
|
|
4565
4994
|
}), l;
|
|
4566
4995
|
},
|
|
4567
4996
|
setAnimationMode(e) {
|
|
4568
|
-
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."));
|
|
4569
4998
|
},
|
|
4570
4999
|
revealNext() {
|
|
4571
5000
|
if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
@@ -4583,13 +5012,13 @@ function ai(e) {
|
|
|
4583
5012
|
if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
4584
5013
|
let t = e.timeoutSeconds ?? 0;
|
|
4585
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 () => {
|
|
4586
|
-
if (k(), e.unit !== void 0 && (w =
|
|
5015
|
+
if (k(), e.unit !== void 0 && (w = di({
|
|
4587
5016
|
...w ?? {},
|
|
4588
5017
|
unit: e.unit
|
|
4589
|
-
}), T =
|
|
5018
|
+
}), T = pi(d, w), E = Math.min(1, T.length), w.layout === "RESERVED" && v && (r.setText({
|
|
4590
5019
|
styleName: u.textStyle,
|
|
4591
5020
|
target: v.targets.text,
|
|
4592
|
-
text:
|
|
5021
|
+
text: Wi(d, u, r)
|
|
4593
5022
|
}), v.captureTextLayout?.())), w) for (; await A(););
|
|
4594
5023
|
let n = e.condition;
|
|
4595
5024
|
if (n === void 0 && t === 0) {
|
|
@@ -4623,7 +5052,7 @@ function ai(e) {
|
|
|
4623
5052
|
if (c) return Promise.reject(new Z("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${s.actorKey}`));
|
|
4624
5053
|
let t;
|
|
4625
5054
|
try {
|
|
4626
|
-
t =
|
|
5055
|
+
t = ki(e, "Bubble motion");
|
|
4627
5056
|
} catch (e) {
|
|
4628
5057
|
return Promise.reject(e);
|
|
4629
5058
|
}
|
|
@@ -4666,7 +5095,7 @@ function ai(e) {
|
|
|
4666
5095
|
} catch (t) {
|
|
4667
5096
|
e.push(t);
|
|
4668
5097
|
}
|
|
4669
|
-
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}`);
|
|
4670
5099
|
}
|
|
4671
5100
|
});
|
|
4672
5101
|
return o.set(s.actorKey, N), j(), u.showAnimation !== void 0 && await N.animate(u.showAnimation), N;
|
|
@@ -4698,50 +5127,85 @@ function ai(e) {
|
|
|
4698
5127
|
return Object.freeze({
|
|
4699
5128
|
defineStyle(e) {
|
|
4700
5129
|
l();
|
|
4701
|
-
let t =
|
|
5130
|
+
let t = ji(e);
|
|
4702
5131
|
a.set(t.name, t);
|
|
4703
5132
|
},
|
|
4704
5133
|
hasActiveBubble(e) {
|
|
4705
|
-
return o.has(
|
|
5134
|
+
return o.has(Ti(e, "Bubble actor key"));
|
|
4706
5135
|
},
|
|
4707
5136
|
async show(e) {
|
|
4708
5137
|
l();
|
|
4709
|
-
let t =
|
|
5138
|
+
let t = qi(e);
|
|
4710
5139
|
return u(t.actorKey, () => d(t));
|
|
4711
5140
|
},
|
|
4712
5141
|
releaseTarget(e) {
|
|
4713
5142
|
l();
|
|
4714
|
-
let t =
|
|
5143
|
+
let t = Ti(e, "Bubble actor key");
|
|
4715
5144
|
return u(t, async () => {
|
|
4716
5145
|
await o.get(t)?.close();
|
|
4717
5146
|
});
|
|
4718
5147
|
},
|
|
4719
5148
|
async releaseAll() {
|
|
4720
|
-
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");
|
|
4721
5150
|
},
|
|
4722
5151
|
async dispose() {
|
|
4723
5152
|
if (c) return;
|
|
4724
5153
|
c = !0, await Promise.allSettled([...s.values()]);
|
|
4725
5154
|
let e = await Promise.allSettled([...o.values()].map((e) => e.close()));
|
|
4726
|
-
a.clear(),
|
|
5155
|
+
a.clear(), Gi(e.flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to dispose bubble composition");
|
|
4727
5156
|
}
|
|
4728
5157
|
});
|
|
4729
5158
|
}
|
|
4730
5159
|
//#endregion
|
|
4731
5160
|
//#region src/turbowarp-svg-text-adapter.ts
|
|
4732
|
-
function
|
|
5161
|
+
function Yi(e) {
|
|
4733
5162
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
4734
5163
|
}
|
|
4735
|
-
function
|
|
4736
|
-
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.");
|
|
4737
5166
|
return e;
|
|
4738
5167
|
}
|
|
4739
|
-
function
|
|
4740
|
-
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.");
|
|
4741
5170
|
return e;
|
|
4742
5171
|
}
|
|
4743
|
-
function
|
|
4744
|
-
|
|
5172
|
+
function Qi(e) {
|
|
5173
|
+
if (!Yi(e) || typeof e.layoutText != "function") throw TypeError("SVG Text overlay adapter requires the layoutText composition API.");
|
|
5174
|
+
return e;
|
|
5175
|
+
}
|
|
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);
|
|
4745
5209
|
return Object.freeze({
|
|
4746
5210
|
setText({ styleName: e, target: n, text: r }) {
|
|
4747
5211
|
t.setText({
|
|
@@ -4758,8 +5222,8 @@ function li(e) {
|
|
|
4758
5222
|
}
|
|
4759
5223
|
});
|
|
4760
5224
|
}
|
|
4761
|
-
function
|
|
4762
|
-
let t =
|
|
5225
|
+
function na(e) {
|
|
5226
|
+
let t = Zi(e), n = {
|
|
4763
5227
|
setText({ styleName: e, target: n, text: r }) {
|
|
4764
5228
|
t.setText({
|
|
4765
5229
|
styleName: e,
|
|
@@ -4776,19 +5240,698 @@ function ui(e) {
|
|
|
4776
5240
|
text: n
|
|
4777
5241
|
}) ?? 0), Object.freeze(n);
|
|
4778
5242
|
}
|
|
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
|
+
}
|
|
4779
5922
|
//#endregion
|
|
4780
5923
|
//#region src/turbowarp-adapter.ts
|
|
4781
|
-
var
|
|
5924
|
+
var Ya = "sprite", Xa = 96, Za = 18, Qa = 8, $a = 16, eo = 0, $ = class extends Error {
|
|
4782
5925
|
code;
|
|
4783
5926
|
constructor(e, t) {
|
|
4784
5927
|
super(t), this.name = "BubbleRuntimeAdapterError", this.code = e;
|
|
4785
5928
|
}
|
|
4786
5929
|
};
|
|
4787
|
-
function
|
|
5930
|
+
function to(e) {
|
|
4788
5931
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
4789
5932
|
}
|
|
4790
|
-
function
|
|
4791
|
-
if (!
|
|
5933
|
+
function no(e) {
|
|
5934
|
+
if (!to(e)) throw new $("BUBBLE-RUNTIME-001", "Bubble requires the TurboWarp renderer.");
|
|
4792
5935
|
let t = [
|
|
4793
5936
|
"createSVGSkin",
|
|
4794
5937
|
"createDrawable",
|
|
@@ -4804,11 +5947,45 @@ function vi(e) {
|
|
|
4804
5947
|
if (t.some((t) => typeof e[t] != "function")) throw new $("BUBBLE-RUNTIME-001", `Bubble renderer must provide ${t.join(", ")}.`);
|
|
4805
5948
|
return e;
|
|
4806
5949
|
}
|
|
4807
|
-
function
|
|
4808
|
-
|
|
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.");
|
|
4809
5986
|
return e;
|
|
4810
5987
|
}
|
|
4811
|
-
function
|
|
5988
|
+
function lo(e) {
|
|
4812
5989
|
try {
|
|
4813
5990
|
let t = e.getBoundsForBubble?.();
|
|
4814
5991
|
if (t && [
|
|
@@ -4826,7 +6003,7 @@ function bi(e) {
|
|
|
4826
6003
|
top: n
|
|
4827
6004
|
};
|
|
4828
6005
|
}
|
|
4829
|
-
function
|
|
6006
|
+
function uo(e, t, n) {
|
|
4830
6007
|
let r = e.getCurrentSkinSize(t.drawableID);
|
|
4831
6008
|
if (!Array.isArray(r) || r.length < 2) return n;
|
|
4832
6009
|
let i = Number(r[0]), a = Number(r[1]);
|
|
@@ -4835,42 +6012,8 @@ function xi(e, t, n) {
|
|
|
4835
6012
|
height: a
|
|
4836
6013
|
};
|
|
4837
6014
|
}
|
|
4838
|
-
function
|
|
4839
|
-
|
|
4840
|
-
}
|
|
4841
|
-
function Ci(e, t) {
|
|
4842
|
-
let n = Si(e);
|
|
4843
|
-
switch (t) {
|
|
4844
|
-
case "linear": return n;
|
|
4845
|
-
case "easeIn": return n * n;
|
|
4846
|
-
case "easeOut": return 1 - (1 - n) * (1 - n);
|
|
4847
|
-
case "easeInOut": return n < .5 ? 2 * n * n : 1 - (-2 * n + 2) ** 2 / 2;
|
|
4848
|
-
default: return n;
|
|
4849
|
-
}
|
|
4850
|
-
}
|
|
4851
|
-
function wi(e, t, n) {
|
|
4852
|
-
let r = Math.max(0, t * 1e3);
|
|
4853
|
-
return r === 0 ? (n(1), Promise.resolve()) : new Promise((t, i) => {
|
|
4854
|
-
let a = 0, o, s = () => {
|
|
4855
|
-
let c = Math.min(16, r - a);
|
|
4856
|
-
a += c;
|
|
4857
|
-
try {
|
|
4858
|
-
n(Si(a / r));
|
|
4859
|
-
} catch (t) {
|
|
4860
|
-
o !== void 0 && e.clearTimeout(o), i(t);
|
|
4861
|
-
return;
|
|
4862
|
-
}
|
|
4863
|
-
if (a >= r) {
|
|
4864
|
-
t();
|
|
4865
|
-
return;
|
|
4866
|
-
}
|
|
4867
|
-
o = e.setTimeout(s, Math.min(16, r - a));
|
|
4868
|
-
};
|
|
4869
|
-
o = e.setTimeout(s, Math.min(16, r));
|
|
4870
|
-
});
|
|
4871
|
-
}
|
|
4872
|
-
function Ti(e, t, n, r = 1) {
|
|
4873
|
-
let i = xi(e, t, {
|
|
6015
|
+
function fo(e, t, n, r = 1) {
|
|
6016
|
+
let i = uo(e, t, {
|
|
4874
6017
|
width: n,
|
|
4875
6018
|
height: n
|
|
4876
6019
|
}), a = Math.min(n / i.width, n / i.height) * r;
|
|
@@ -4880,35 +6023,35 @@ function Ti(e, t, n, r = 1) {
|
|
|
4880
6023
|
scalePercent: a * 100
|
|
4881
6024
|
};
|
|
4882
6025
|
}
|
|
4883
|
-
function
|
|
6026
|
+
function po(e, t, n) {
|
|
4884
6027
|
let r = Math.min(n, e / 2, t / 2), i = e - r, a = t - r;
|
|
4885
6028
|
return `<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}" viewBox="0 0 ${e} ${t}">
|
|
4886
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}"/>
|
|
4887
6030
|
</svg>`;
|
|
4888
6031
|
}
|
|
4889
|
-
function
|
|
6032
|
+
function mo(e, t, n) {
|
|
4890
6033
|
return n < t ? (t + n) / 2 : Math.min(n, Math.max(t, e));
|
|
4891
6034
|
}
|
|
4892
|
-
function
|
|
6035
|
+
function ho(e, t, n, r, i) {
|
|
4893
6036
|
let a = t + r * 2, o = n + i * 2;
|
|
4894
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}"`));
|
|
4895
6038
|
}
|
|
4896
|
-
function
|
|
4897
|
-
let t =
|
|
6039
|
+
function go(e) {
|
|
6040
|
+
let t = ve(e);
|
|
4898
6041
|
return (Math.atan2(-t.x, -t.y) * 180 / Math.PI % 360 + 360) % 360;
|
|
4899
6042
|
}
|
|
4900
|
-
function
|
|
4901
|
-
let a = e.renderer, o =
|
|
4902
|
-
|
|
6043
|
+
function _o(e, t, n, r, i) {
|
|
6044
|
+
let a = e.renderer, o = eo;
|
|
6045
|
+
eo += 1;
|
|
4903
6046
|
let s = [], c, l, u = (e) => {
|
|
4904
|
-
let t = a.createDrawable(
|
|
6047
|
+
let t = a.createDrawable(Ya);
|
|
4905
6048
|
if (!Number.isInteger(t) || t < 0) throw new $("BUBBLE-RUNTIME-001", `TurboWarp did not create the Bubble ${e} drawable.`);
|
|
4906
6049
|
let r = Object.freeze({
|
|
4907
6050
|
id: `bubble:${n}:${o}:${e}`,
|
|
4908
6051
|
isStage: !1,
|
|
4909
6052
|
drawableID: t
|
|
4910
6053
|
});
|
|
4911
|
-
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;
|
|
4912
6055
|
};
|
|
4913
6056
|
try {
|
|
4914
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({
|
|
@@ -4919,21 +6062,21 @@ function Ai(e, t, n, r, i) {
|
|
|
4919
6062
|
...h ? { continueIndicator: h } : {}
|
|
4920
6063
|
}), _ = /* @__PURE__ */ new Map();
|
|
4921
6064
|
o && _.set("portraitBase", o), d && _.set("portraitBlink", d), f && _.set("portraitLipSync", f), h && _.set("continueIndicator", h);
|
|
4922
|
-
let
|
|
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 = () => {
|
|
4923
6066
|
for (let e of s) {
|
|
4924
|
-
let t =
|
|
4925
|
-
t && a.updateDrawablePosition(e.drawableID, [t[0] +
|
|
4926
|
-
let n =
|
|
4927
|
-
n && a.updateDrawableScale(e.drawableID, [n[0] *
|
|
4928
|
-
}
|
|
4929
|
-
},
|
|
4930
|
-
let r =
|
|
4931
|
-
a.updateDrawableVisible(n.drawableID,
|
|
4932
|
-
for (let [e, t] of _) a.updateDrawableVisible(t.drawableID,
|
|
4933
|
-
p && a.updateDrawableVisible(p.drawableID,
|
|
4934
|
-
},
|
|
4935
|
-
if (
|
|
4936
|
-
let e =
|
|
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
|
+
}
|
|
6072
|
+
}, M = () => {
|
|
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, {
|
|
4937
6080
|
width: 180,
|
|
4938
6081
|
height: 48
|
|
4939
6082
|
});
|
|
@@ -4941,76 +6084,76 @@ function Ai(e, t, n, r, i) {
|
|
|
4941
6084
|
let i = {
|
|
4942
6085
|
width: r.width * e,
|
|
4943
6086
|
height: r.height * e
|
|
4944
|
-
}, s =
|
|
6087
|
+
}, s = Xa * ((C.portrait?.offset.zoomPercent ?? 100) / 100), u = o !== void 0 && C.portrait !== void 0, g = u ? fo(a, o, s, e) : {
|
|
4945
6088
|
width: 0,
|
|
4946
6089
|
height: 0,
|
|
4947
6090
|
scalePercent: 0
|
|
4948
6091
|
}, _ = /* @__PURE__ */ new Map();
|
|
4949
6092
|
u && _.set(o.drawableID, g.scalePercent);
|
|
4950
6093
|
for (let t of [d, f]) if (t && u) {
|
|
4951
|
-
let n =
|
|
6094
|
+
let n = fo(a, t, s, e);
|
|
4952
6095
|
_.set(t.drawableID, n.scalePercent);
|
|
4953
6096
|
}
|
|
4954
|
-
let v = h ?
|
|
6097
|
+
let v = h ? fo(a, h, Za, e) : {
|
|
4955
6098
|
width: 0,
|
|
4956
6099
|
height: 0,
|
|
4957
6100
|
scalePercent: 0
|
|
4958
|
-
}, y = g.width + (u ?
|
|
4959
|
-
if (
|
|
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;
|
|
4960
6103
|
else {
|
|
4961
|
-
let e =
|
|
4962
|
-
bounds:
|
|
4963
|
-
bubbleWidth:
|
|
6104
|
+
let e = we({
|
|
6105
|
+
bounds: lo(t),
|
|
6106
|
+
bubbleWidth: N,
|
|
4964
6107
|
bubbleHeight: P,
|
|
4965
|
-
direction:
|
|
4966
|
-
distance:
|
|
4967
|
-
tailLength:
|
|
4968
|
-
offset:
|
|
6108
|
+
direction: C.placement.direction,
|
|
6109
|
+
distance: C.distance,
|
|
6110
|
+
tailLength: C.tailLength,
|
|
6111
|
+
offset: C.offset
|
|
4969
6112
|
});
|
|
4970
|
-
|
|
6113
|
+
V = e.x, H = e.y;
|
|
4971
6114
|
}
|
|
4972
|
-
|
|
4973
|
-
let
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
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
|
|
4977
6120
|
] : [
|
|
4978
6121
|
0,
|
|
4979
6122
|
0,
|
|
4980
6123
|
100
|
|
4981
|
-
],
|
|
6124
|
+
], se = ae === null ? {
|
|
4982
6125
|
x: 0,
|
|
4983
6126
|
y: 0
|
|
4984
|
-
} :
|
|
4985
|
-
style:
|
|
4986
|
-
width:
|
|
4987
|
-
height:
|
|
4988
|
-
tailDirection:
|
|
4989
|
-
tailLength:
|
|
4990
|
-
offset:
|
|
4991
|
-
}),
|
|
4992
|
-
baseBubbleHeight:
|
|
4993
|
-
baseBubbleWidth:
|
|
4994
|
-
bodyOffset:
|
|
4995
|
-
tailDirection:
|
|
4996
|
-
tailLength:
|
|
4997
|
-
viewportExtraX:
|
|
4998
|
-
viewportExtraY:
|
|
4999
|
-
visualStyle:
|
|
5000
|
-
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
|
|
5001
6144
|
});
|
|
5002
|
-
if (
|
|
5003
|
-
let e =
|
|
5004
|
-
style:
|
|
6145
|
+
if (ue !== x) {
|
|
6146
|
+
let e = ho(tt({
|
|
6147
|
+
style: C.visualStyle,
|
|
5005
6148
|
lines: [],
|
|
5006
|
-
width:
|
|
5007
|
-
height:
|
|
5008
|
-
tailDirection:
|
|
5009
|
-
tailLength:
|
|
5010
|
-
offset:
|
|
5011
|
-
title: `${
|
|
5012
|
-
...
|
|
5013
|
-
}),
|
|
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);
|
|
5014
6157
|
if (!Number.isInteger(t) || t < 0) throw new $("BUBBLE-RUNTIME-001", "TurboWarp did not create the Bubble body SVG skin.");
|
|
5015
6158
|
try {
|
|
5016
6159
|
a.updateDrawableSkinId(n.drawableID, t);
|
|
@@ -5018,27 +6161,27 @@ function Ai(e, t, n, r, i) {
|
|
|
5018
6161
|
throw a.destroySkin(t), e;
|
|
5019
6162
|
}
|
|
5020
6163
|
let r = c;
|
|
5021
|
-
c = t,
|
|
6164
|
+
c = t, x = ue, r !== void 0 && a.destroySkin(r);
|
|
5022
6165
|
}
|
|
5023
|
-
a.updateDrawableScale(n.drawableID, [100, 100]), a.updateDrawablePosition(n.drawableID, [
|
|
5024
|
-
let
|
|
5025
|
-
|
|
5026
|
-
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;
|
|
5027
6170
|
for (let e of [
|
|
5028
6171
|
o,
|
|
5029
6172
|
d,
|
|
5030
6173
|
f
|
|
5031
|
-
]) e && a.updateDrawablePosition(e.drawableID, [
|
|
6174
|
+
]) e && a.updateDrawablePosition(e.drawableID, [ge, _e]);
|
|
5032
6175
|
if (p) {
|
|
5033
|
-
let t = g.width / e, n = g.height / e, r = Math.min(
|
|
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({
|
|
5034
6177
|
maskHeight: n,
|
|
5035
6178
|
maskWidth: t,
|
|
5036
6179
|
radius: r
|
|
5037
6180
|
}) : "";
|
|
5038
|
-
if (i !==
|
|
6181
|
+
if (i !== S) {
|
|
5039
6182
|
let e = l;
|
|
5040
|
-
if (l = void 0,
|
|
5041
|
-
let e = a.createSVGSkin(
|
|
6183
|
+
if (l = void 0, S = i, r > 0) {
|
|
6184
|
+
let e = a.createSVGSkin(po(t, n, r));
|
|
5042
6185
|
if (!Number.isInteger(e) || e < 0) throw new $("BUBBLE-RUNTIME-001", "TurboWarp did not create the Bubble portrait corner mask SVG skin.");
|
|
5043
6186
|
try {
|
|
5044
6187
|
a.updateDrawableSkinId(p.drawableID, e), l = e;
|
|
@@ -5048,13 +6191,13 @@ function Ai(e, t, n, r, i) {
|
|
|
5048
6191
|
}
|
|
5049
6192
|
e !== void 0 && a.destroySkin(e);
|
|
5050
6193
|
}
|
|
5051
|
-
a.updateDrawablePosition(p.drawableID, [
|
|
6194
|
+
a.updateDrawablePosition(p.drawableID, [ge, _e]);
|
|
5052
6195
|
}
|
|
5053
|
-
a.updateDrawablePosition(m.drawableID, [
|
|
5054
|
-
let
|
|
5055
|
-
e &&
|
|
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);
|
|
5056
6199
|
};
|
|
5057
|
-
|
|
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]);
|
|
5058
6201
|
for (let e of [
|
|
5059
6202
|
o,
|
|
5060
6203
|
d,
|
|
@@ -5062,156 +6205,172 @@ function Ai(e, t, n, r, i) {
|
|
|
5062
6205
|
]) {
|
|
5063
6206
|
if (!e) continue;
|
|
5064
6207
|
let t = _.get(e.drawableID) ?? 0;
|
|
5065
|
-
|
|
6208
|
+
E.set(e.drawableID, [t, t]);
|
|
5066
6209
|
}
|
|
5067
|
-
p &&
|
|
5068
|
-
},
|
|
5069
|
-
|
|
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();
|
|
5070
6213
|
};
|
|
5071
|
-
return
|
|
6214
|
+
return C.placement.basis === "actor" && (t.onTargetVisualChange = F), Object.freeze({
|
|
5072
6215
|
targets: g,
|
|
5073
6216
|
setLayerVisible(e, t) {
|
|
5074
|
-
|
|
6217
|
+
b || (v.set(e, t), M());
|
|
5075
6218
|
},
|
|
5076
6219
|
updateStyle(e) {
|
|
5077
|
-
if (
|
|
5078
|
-
let n =
|
|
5079
|
-
|
|
5080
|
-
let r =
|
|
5081
|
-
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();
|
|
5082
6225
|
},
|
|
5083
6226
|
captureTextLayout() {
|
|
5084
|
-
|
|
6227
|
+
b || (w = uo(a, m, {
|
|
5085
6228
|
width: 180,
|
|
5086
6229
|
height: 48
|
|
5087
|
-
}),
|
|
6230
|
+
}), N());
|
|
5088
6231
|
},
|
|
5089
6232
|
clearTextLayout() {
|
|
5090
|
-
|
|
6233
|
+
w = void 0, N();
|
|
5091
6234
|
},
|
|
5092
6235
|
async animate(e) {
|
|
5093
|
-
if (
|
|
6236
|
+
if (b) return;
|
|
5094
6237
|
let t = Math.max(0, e.durationSeconds ?? 0), n = () => {
|
|
5095
|
-
|
|
5096
|
-
}, r = (t) =>
|
|
6238
|
+
b || (j(), M());
|
|
6239
|
+
}, r = (t) => da(t, e.ease ?? "easeInOut");
|
|
5097
6240
|
if (e.name === "fadeIn" || e.name === "floatIn" || e.name === "zoomIn" || e.name === "riseUp") {
|
|
5098
|
-
|
|
6241
|
+
y = !0;
|
|
5099
6242
|
let a = e.name === "floatIn" || e.name === "riseUp" ? [0, 16] : [0, 0], o = e.name === "zoomIn" ? .01 : 1;
|
|
5100
|
-
|
|
6243
|
+
D = a, O = o, k = e.name === "fadeIn" ? 0 : 1, n(), await fa(i, t, (t) => {
|
|
5101
6244
|
let i = r(t);
|
|
5102
|
-
|
|
5103
|
-
}),
|
|
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();
|
|
5104
6247
|
return;
|
|
5105
6248
|
}
|
|
5106
6249
|
if (e.name === "fadeOut" || e.name === "floatOut" || e.name === "zoomOut" || e.name === "sink") {
|
|
5107
6250
|
let a = e.name === "floatOut" || e.name === "sink" ? [0, -16] : [0, 0], o = e.name === "zoomOut" ? .01 : 1;
|
|
5108
|
-
|
|
6251
|
+
D = [0, 0], O = 1, k = 1, n(), await fa(i, t, (t) => {
|
|
5109
6252
|
let i = r(t);
|
|
5110
|
-
|
|
5111
|
-
}),
|
|
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;
|
|
5112
6255
|
return;
|
|
5113
6256
|
}
|
|
5114
6257
|
if (e.name === "shake") {
|
|
5115
|
-
let a = Math.max(1, Math.floor(e.count ?? 1)), o = t > 0 ? t : a * .08, s =
|
|
5116
|
-
|
|
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) => {
|
|
5117
6260
|
let t = r(e) * a * Math.PI * 2, i = Math.sin(t) * 5;
|
|
5118
|
-
|
|
5119
|
-
}),
|
|
6261
|
+
D = [s.x * i, s.y * i], n();
|
|
6262
|
+
}), D = [0, 0], N();
|
|
5120
6263
|
return;
|
|
5121
6264
|
}
|
|
5122
6265
|
if (e.name === "explode") {
|
|
5123
6266
|
let a = Math.max(1, Math.floor(e.count ?? 1)), o = t > 0 ? t : a * .12, s = e.relativeScale ?? 1.15;
|
|
5124
|
-
await
|
|
6267
|
+
await fa(i, o, (e) => {
|
|
5125
6268
|
let t = r(e), i = Math.abs(Math.sin(t * a * Math.PI));
|
|
5126
|
-
|
|
5127
|
-
}),
|
|
6269
|
+
O = 1 + (s - 1) * i, n();
|
|
6270
|
+
}), O = 1, N();
|
|
5128
6271
|
return;
|
|
5129
6272
|
}
|
|
5130
6273
|
if (e.name === "animateBubbleShape") {
|
|
5131
|
-
let n = e.visualStyle ??
|
|
5132
|
-
|
|
6274
|
+
let n = e.visualStyle ?? C.visualStyle, r = C.visualStyle, a = e.speed === void 0 ? 1 : Math.max(0, e.speed);
|
|
6275
|
+
A = {
|
|
5133
6276
|
from: r,
|
|
5134
6277
|
to: n,
|
|
5135
6278
|
progress: 0
|
|
5136
|
-
},
|
|
5137
|
-
let o = t === 0 ? 1 :
|
|
5138
|
-
|
|
6279
|
+
}, N(), await fa(i, t, (i) => {
|
|
6280
|
+
let o = t === 0 ? 1 : ua(i * Math.max(a, 1) / 1);
|
|
6281
|
+
A = {
|
|
5139
6282
|
from: r,
|
|
5140
6283
|
to: n,
|
|
5141
|
-
progress:
|
|
5142
|
-
},
|
|
5143
|
-
}),
|
|
6284
|
+
progress: da(o, e.ease ?? "easeInOut")
|
|
6285
|
+
}, N();
|
|
6286
|
+
}), A = void 0, N();
|
|
5144
6287
|
return;
|
|
5145
6288
|
}
|
|
5146
6289
|
},
|
|
5147
6290
|
show() {
|
|
5148
|
-
|
|
6291
|
+
b || (y = !0, N());
|
|
5149
6292
|
},
|
|
5150
6293
|
hide() {
|
|
5151
|
-
|
|
6294
|
+
b || (y = !1, M());
|
|
5152
6295
|
},
|
|
5153
6296
|
dispose() {
|
|
5154
|
-
if (!
|
|
5155
|
-
|
|
5156
|
-
for (let e of [...s].reverse()) a.destroyDrawable(e.drawableID,
|
|
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);
|
|
5157
6300
|
c !== void 0 && (a.destroySkin(c), c = void 0), l !== void 0 && (a.destroySkin(l), l = void 0), e.requestRedraw?.();
|
|
5158
6301
|
}
|
|
5159
6302
|
}
|
|
5160
6303
|
});
|
|
5161
6304
|
} catch (e) {
|
|
5162
|
-
for (let e of [...s].reverse()) a.destroyDrawable(e.drawableID,
|
|
6305
|
+
for (let e of [...s].reverse()) a.destroyDrawable(e.drawableID, Ya);
|
|
5163
6306
|
throw c !== void 0 && a.destroySkin(c), l !== void 0 && a.destroySkin(l), e;
|
|
5164
6307
|
}
|
|
5165
6308
|
}
|
|
5166
|
-
function
|
|
5167
|
-
if (!
|
|
5168
|
-
let n = e, r =
|
|
5169
|
-
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;
|
|
5170
6323
|
else try {
|
|
5171
|
-
|
|
6324
|
+
f = ta(n.ext_kubohiroyasvgtext);
|
|
5172
6325
|
} catch {
|
|
5173
6326
|
throw new $("BUBBLE-RUNTIME-003", "Bubble requires a text capability. Load @kubohiroya/turbowarp-svg-text or provide options.textCapability before using Bubble blocks.");
|
|
5174
6327
|
}
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
if (!Number.isInteger(a) || a < 0) throw new $("BUBBLE-RUNTIME-001", "Bubble image target drawable is invalid.");
|
|
5186
|
-
let o = await i().resolveSkin(e);
|
|
5187
|
-
if (!_i(o) || !Number.isInteger(o.skinId) || o.skinId < 0) throw new $("BUBBLE-RUNTIME-002", `Asset Manager did not resolve an image skin: ${String(e)}`);
|
|
5188
|
-
r.updateDrawableSkinId(a, o.skinId), n.requestRedraw?.();
|
|
5189
|
-
}
|
|
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 });
|
|
5190
6338
|
},
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
return i().isLoaded({ NAME: e });
|
|
5194
|
-
},
|
|
5195
|
-
getMimeType(e) {
|
|
5196
|
-
return i().getAssetMimeType({ NAME: e });
|
|
5197
|
-
},
|
|
5198
|
-
async playSound(e, t = {}) {
|
|
5199
|
-
let n = i(), r = t.untilDone ? n?.playSoundUntilDone : n?.playSound;
|
|
5200
|
-
if (typeof r != "function") throw new $("BUBBLE-RUNTIME-002", "TurboWarp Asset Manager does not provide audio playback.");
|
|
5201
|
-
await r.call(n, { NAME: e });
|
|
5202
|
-
}
|
|
6339
|
+
getMimeType(e) {
|
|
6340
|
+
return d().getAssetMimeType({ NAME: e });
|
|
5203
6341
|
},
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
if (!
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
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);
|
|
5211
6370
|
},
|
|
5212
6371
|
...t.scheduler === void 0 ? {} : { scheduler: t.scheduler },
|
|
5213
6372
|
...t.onAnimationError === void 0 ? {} : { onAnimationError: t.onAnimationError }
|
|
5214
6373
|
});
|
|
5215
6374
|
}
|
|
5216
6375
|
//#endregion
|
|
5217
|
-
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 };
|