@bloklabs/cli 1.16.0 → 1.16.1

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.
@@ -0,0 +1,1067 @@
1
+ //#region src/components/shared/color-presets.ts
2
+ var e = [
3
+ {
4
+ name: "gray",
5
+ text: "#787774",
6
+ bg: "#f1f1ef"
7
+ },
8
+ {
9
+ name: "brown",
10
+ text: "#9f6b53",
11
+ bg: "#f4eeee"
12
+ },
13
+ {
14
+ name: "orange",
15
+ text: "#d9730d",
16
+ bg: "#fbecdd"
17
+ },
18
+ {
19
+ name: "yellow",
20
+ text: "#cb9b00",
21
+ bg: "#fbf3db"
22
+ },
23
+ {
24
+ name: "green",
25
+ text: "#448361",
26
+ bg: "#edf3ec"
27
+ },
28
+ {
29
+ name: "blue",
30
+ text: "#337ea9",
31
+ bg: "#e7f3f8"
32
+ },
33
+ {
34
+ name: "purple",
35
+ text: "#9065b0",
36
+ bg: "#f6f3f9"
37
+ },
38
+ {
39
+ name: "pink",
40
+ text: "#c14c8a",
41
+ bg: "#f9f0f5"
42
+ },
43
+ {
44
+ name: "red",
45
+ text: "#d44c47",
46
+ bg: "#fdebec"
47
+ }
48
+ ], t = [
49
+ {
50
+ name: "gray",
51
+ text: "#9b9b9b",
52
+ bg: "#2f2f2f"
53
+ },
54
+ {
55
+ name: "brown",
56
+ text: "#c59177",
57
+ bg: "#452a1c"
58
+ },
59
+ {
60
+ name: "orange",
61
+ text: "#dc8c47",
62
+ bg: "#4d2f14"
63
+ },
64
+ {
65
+ name: "yellow",
66
+ text: "#d4ab49",
67
+ bg: "#544012"
68
+ },
69
+ {
70
+ name: "green",
71
+ text: "#5db184",
72
+ bg: "#1e432f"
73
+ },
74
+ {
75
+ name: "blue",
76
+ text: "#5c9fcc",
77
+ bg: "#123a54"
78
+ },
79
+ {
80
+ name: "purple",
81
+ text: "#a67dca",
82
+ bg: "#341d49"
83
+ },
84
+ {
85
+ name: "pink",
86
+ text: "#d45e99",
87
+ bg: "#4b1b33"
88
+ },
89
+ {
90
+ name: "red",
91
+ text: "#dd5e5a",
92
+ bg: "#4e1a18"
93
+ }
94
+ ];
95
+ //#endregion
96
+ //#region src/components/utils/default-page-colors.ts
97
+ function n(e) {
98
+ let t = e.replace(/\s/g, "").toLowerCase();
99
+ return t === "rgb(255,255,255)" || t === "#ffffff" || t === "#fff" || t === "white";
100
+ }
101
+ function r(e) {
102
+ let t = e.replace(/\s/g, "").toLowerCase(), n = /^rgba?\((\d+),(\d+),(\d+)(?:,[\d.]+)?\)$/.exec(t);
103
+ if (n) {
104
+ let e = parseInt(n[1], 10) / 255, t = parseInt(n[2], 10) / 255, r = parseInt(n[3], 10) / 255;
105
+ return .2126 * e + .7152 * t + .0722 * r;
106
+ }
107
+ let r = /^hsla?\(([\d.]+),([\d.]+)%,([\d.]+)%(?:,[\d.]+)?\)$/.exec(t);
108
+ if (r) {
109
+ let e = parseFloat(r[1]) / 360, t = parseFloat(r[2]) / 100, n = parseFloat(r[3]) / 100;
110
+ if (t === 0) return .2126 * n + .7152 * n + .0722 * n;
111
+ let i = n < .5 ? n * (1 + t) : n + t - n * t, a = 2 * n - i, o = (e) => e < 0 ? e + 1 : e > 1 ? e - 1 : e, s = (e) => {
112
+ let t = o(e);
113
+ return t < 1 / 6 ? a + (i - a) * 6 * t : t < 1 / 2 ? i : t < 2 / 3 ? a + (i - a) * (2 / 3 - t) * 6 : a;
114
+ }, c = s(e + 1 / 3), l = s(e), u = s(e - 1 / 3);
115
+ return .2126 * c + .7152 * l + .0722 * u;
116
+ }
117
+ let i = /^#([0-9a-f]{6}|[0-9a-f]{3})$/.exec(t);
118
+ if (i) {
119
+ let e = i[1], t = e.length === 3 ? [
120
+ e[0] + e[0],
121
+ e[1] + e[1],
122
+ e[2] + e[2]
123
+ ] : [
124
+ e.substring(0, 2),
125
+ e.substring(2, 4),
126
+ e.substring(4, 6)
127
+ ], n = parseInt(t[0], 16) / 255, r = parseInt(t[1], 16) / 255, a = parseInt(t[2], 16) / 255;
128
+ return .2126 * n + .7152 * r + .0722 * a;
129
+ }
130
+ return -1;
131
+ }
132
+ function i(e) {
133
+ let t = r(e);
134
+ return t >= 0 && t < .12;
135
+ }
136
+ var a = 250;
137
+ function o(e) {
138
+ let t = e.replace(/\s/g, "").toLowerCase();
139
+ if (t === "transparent") return {
140
+ r: 0,
141
+ g: 0,
142
+ b: 0,
143
+ a: 0
144
+ };
145
+ if (t === "white") return {
146
+ r: 255,
147
+ g: 255,
148
+ b: 255,
149
+ a: 1
150
+ };
151
+ let n = /^rgba?\((\d+),(\d+),(\d+)(?:,([\d.]+))?\)$/.exec(t);
152
+ if (n) return {
153
+ r: parseInt(n[1], 10),
154
+ g: parseInt(n[2], 10),
155
+ b: parseInt(n[3], 10),
156
+ a: n[4] === void 0 ? 1 : parseFloat(n[4])
157
+ };
158
+ let r = /^#([0-9a-f]{6}|[0-9a-f]{3})$/.exec(t);
159
+ if (r) {
160
+ let e = r[1], t = e.length === 3 ? [
161
+ e[0] + e[0],
162
+ e[1] + e[1],
163
+ e[2] + e[2]
164
+ ] : [
165
+ e.substring(0, 2),
166
+ e.substring(2, 4),
167
+ e.substring(4, 6)
168
+ ];
169
+ return {
170
+ r: parseInt(t[0], 16),
171
+ g: parseInt(t[1], 16),
172
+ b: parseInt(t[2], 16),
173
+ a: 1
174
+ };
175
+ }
176
+ return null;
177
+ }
178
+ function s(e) {
179
+ let t = o(e);
180
+ return t !== null && (t.a === 0 || t.r >= a && t.g >= a && t.b >= a) || i(e);
181
+ }
182
+ //#endregion
183
+ //#region src/components/utils/color-mapping.ts
184
+ function c(e, t, n) {
185
+ let r = t / 100, i = n / 100;
186
+ if (r === 0) {
187
+ let e = Math.round(i * 255);
188
+ return [
189
+ e,
190
+ e,
191
+ e
192
+ ];
193
+ }
194
+ let a = (e) => e < 0 ? e + 1 : e > 1 ? e - 1 : e, o = (e, t, n) => {
195
+ let r = a(n);
196
+ return r < 1 / 6 ? e + (t - e) * 6 * r : r < 1 / 2 ? t : r < 2 / 3 ? e + (t - e) * (2 / 3 - r) * 6 : e;
197
+ }, s = i < .5 ? i * (1 + r) : i + r - i * r, c = 2 * i - s, l = e / 360;
198
+ return [
199
+ Math.round(o(c, s, l + 1 / 3) * 255),
200
+ Math.round(o(c, s, l) * 255),
201
+ Math.round(o(c, s, l - 1 / 3) * 255)
202
+ ];
203
+ }
204
+ function l(e) {
205
+ let t = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);
206
+ if (t) return [
207
+ parseInt(t[1], 16),
208
+ parseInt(t[2], 16),
209
+ parseInt(t[3], 16)
210
+ ];
211
+ let n = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})[0-9a-f]{2}$/i.exec(e);
212
+ if (n) return [
213
+ parseInt(n[1], 16),
214
+ parseInt(n[2], 16),
215
+ parseInt(n[3], 16)
216
+ ];
217
+ let r = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(e);
218
+ if (r) return [
219
+ parseInt(r[1] + r[1], 16),
220
+ parseInt(r[2] + r[2], 16),
221
+ parseInt(r[3] + r[3], 16)
222
+ ];
223
+ let i = /^#([0-9a-f])([0-9a-f])([0-9a-f])[0-9a-f]$/i.exec(e);
224
+ if (i) return [
225
+ parseInt(i[1] + i[1], 16),
226
+ parseInt(i[2] + i[2], 16),
227
+ parseInt(i[3] + i[3], 16)
228
+ ];
229
+ let a = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*[\d.]+\s*)?\)$/i.exec(e);
230
+ if (a) return [
231
+ Number(a[1]),
232
+ Number(a[2]),
233
+ Number(a[3])
234
+ ];
235
+ let o = /^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*[\d.]+\s*)?\)$/i.exec(e);
236
+ return o ? c(Number(o[1]), Number(o[2]), Number(o[3])) : null;
237
+ }
238
+ var u = .1;
239
+ function d(e) {
240
+ let t = e[0] / 255, n = e[1] / 255, r = e[2] / 255, i = Math.max(t, n, r), a = Math.min(t, n, r), o = (i + a) / 2;
241
+ if (i === a) return [
242
+ 0,
243
+ 0,
244
+ o
245
+ ];
246
+ let s = i - a, c = o > .5 ? s / (2 - i - a) : s / (i + a);
247
+ return [
248
+ ((e) => e === t ? ((n - r) / s + (n < r ? 6 : 0)) / 6 : e === n ? ((r - t) / s + 2) / 6 : ((t - n) / s + 4) / 6)(i) * 360,
249
+ c,
250
+ o
251
+ ];
252
+ }
253
+ function f(e, t) {
254
+ let n = e[1] < u, r = t[1] < u;
255
+ if (n && r) {
256
+ let n = Math.abs(e[2] - t[2]);
257
+ return n * n;
258
+ }
259
+ if (n !== r) return 1e3;
260
+ let i = Math.abs(e[0] - t[0]), a = Math.min(i, 360 - i) / 180, o = Math.abs(e[1] - t[1]), s = Math.abs(e[2] - t[2]);
261
+ return 8 * a * a + 1 * o * o + 1 * s * s;
262
+ }
263
+ function p(t, r) {
264
+ if (r === "bg" && (n(t) || i(t))) return t;
265
+ let a = l(t);
266
+ if (a === null) return t;
267
+ let o = d(a);
268
+ return e.reduce((e, t) => {
269
+ let n = l(t[r]);
270
+ if (n === null) return e;
271
+ let i = f(o, d(n));
272
+ return i < e.distance ? {
273
+ color: t[r],
274
+ distance: i
275
+ } : e;
276
+ }, {
277
+ color: t,
278
+ distance: Infinity
279
+ }).color;
280
+ }
281
+ function m(r, a) {
282
+ if (a === "bg" && (n(r) || i(r))) return null;
283
+ let o = l(r);
284
+ if (o === null) return null;
285
+ let s = d(o);
286
+ return [...e, ...t].reduce((e, t) => {
287
+ let n = l(t[a]);
288
+ if (n === null) return e;
289
+ let r = f(s, d(n));
290
+ return e === null || r < e.distance ? {
291
+ name: t.name,
292
+ distance: r
293
+ } : e;
294
+ }, null)?.name ?? null;
295
+ }
296
+ //#endregion
297
+ //#region src/shared/inline-normalization-policy.ts
298
+ var h = /* @__PURE__ */ new Set([
299
+ "A",
300
+ "B",
301
+ "STRONG",
302
+ "I",
303
+ "EM",
304
+ "U",
305
+ "S",
306
+ "DEL",
307
+ "INS",
308
+ "MARK",
309
+ "CODE",
310
+ "SUB",
311
+ "SUP",
312
+ "SMALL",
313
+ "SPAN",
314
+ "FONT"
315
+ ]), ee = new Set([...h].filter((e) => e !== "A")), te = /* @__PURE__ */ new Set([
316
+ "IMG",
317
+ "IFRAME",
318
+ "VIDEO",
319
+ "AUDIO",
320
+ "INPUT",
321
+ "SVG",
322
+ "CANVAS",
323
+ "OBJECT",
324
+ "EMBED"
325
+ ]), ne = /* @__PURE__ */ new Set([
326
+ "U",
327
+ "S",
328
+ "DEL",
329
+ "INS"
330
+ ]), g = /* @__PURE__ */ new Set([
331
+ "background-color",
332
+ "background",
333
+ "text-decoration",
334
+ "text-decoration-line",
335
+ "border",
336
+ "border-bottom",
337
+ "box-shadow",
338
+ "outline"
339
+ ]), _ = /* @__PURE__ */ new Set([
340
+ "",
341
+ "none",
342
+ "transparent",
343
+ "initial",
344
+ "unset"
345
+ ]), v = (e) => {
346
+ let t = e.attributes.filter((e) => e.name.toLowerCase() !== "style").map((e) => `${e.name.toLowerCase()}=${e.value}`).sort(), n = e.styleDeclarations.map((e) => `${e.property.toLowerCase()}:${e.value.trim()}`).sort();
347
+ return `${e.tagName}|${t.join("|")}|${n.join(";")}`;
348
+ }, y = (e) => e.attributes.some((e) => e.name.toLowerCase() === "id"), re = (e) => ne.has(e.tagName) ? !0 : e.styleDeclarations.some((e) => g.has(e.property.toLowerCase()) && !_.has(e.value.trim().toLowerCase())), ie = (e) => {
349
+ if (!ee.has(e.tagName)) return !1;
350
+ let t = e.text();
351
+ return t.trim().length > 0 || e.hasVoidContentDescendant() ? !1 : t.length === 0 || !re(e);
352
+ }, ae = (e, t) => !h.has(e.tagName) || y(e) || y(t) ? !1 : v(e) === v(t), oe = (e, t) => {
353
+ if (!h.has(e.tagName) || y(e)) return !1;
354
+ let n = v(e);
355
+ return t.some((e) => v(e) === n);
356
+ }, b = (e) => {
357
+ let t = e.style, n = Array.from({ length: t.length }, (e, n) => {
358
+ let r = t.item(n);
359
+ return {
360
+ property: r,
361
+ value: t.getPropertyValue(r)
362
+ };
363
+ });
364
+ return {
365
+ tagName: e.tagName.toUpperCase(),
366
+ attributes: Array.from(e.attributes).map((e) => ({
367
+ name: e.name,
368
+ value: e.value
369
+ })),
370
+ styleDeclarations: n,
371
+ text: () => e.textContent ?? "",
372
+ hasVoidContentDescendant: () => Array.from(e.querySelectorAll("*")).some((e) => te.has(e.tagName.toUpperCase()))
373
+ };
374
+ }, x = (e, t) => {
375
+ let n = e.parentElement;
376
+ return n === null || n === t ? [] : [b(n), ...x(n, t)];
377
+ }, se = (e) => {
378
+ let t = e.parentNode;
379
+ if (t !== null) {
380
+ for (; e.firstChild !== null;) t.insertBefore(e.firstChild, e);
381
+ t.removeChild(e);
382
+ }
383
+ }, ce = (e) => {
384
+ let t = (t) => e.contains(t), n = (e) => t(e) && h.has(e.tagName.toUpperCase()), r = Array.from(e.querySelectorAll("*")).filter((t) => {
385
+ if (!n(t)) return !1;
386
+ let r = b(t);
387
+ return ie(r) || oe(r, x(t, e));
388
+ });
389
+ r.forEach(se);
390
+ let i = (e, t) => {
391
+ let n = e.nextSibling;
392
+ if (n === null || n.nodeType !== Node.ELEMENT_NODE || !ae(t, b(n))) return !1;
393
+ let r = n;
394
+ for (; r.firstChild !== null;) e.appendChild(r.firstChild);
395
+ return r.remove(), i(e, t), !0;
396
+ }, a = Array.from(e.querySelectorAll("*")).filter(n).map((e) => t(e) && i(e, b(e))).some(Boolean);
397
+ return r.length > 0 || a;
398
+ }, S = (e) => {
399
+ let t = (n) => n === 0 || !ce(e) ? !1 : (t(n - 1), !0), n = t(10);
400
+ return n && e.normalize?.(), n;
401
+ }, le = "data-blok-columns-candidate", ue = /(<br\s*\/?>)/i, de = /^<br\s*\/?>$/i;
402
+ function C(e) {
403
+ let t = e.split(ue), n = t.reduce((e, t, n) => de.test(t) || t.trim() === "" ? e : n, -1);
404
+ return t.slice(0, n + 1).join("").trimEnd();
405
+ }
406
+ //#endregion
407
+ //#region src/components/utils/spacer-paragraph.ts
408
+ function w(e, t = {}) {
409
+ let { lineBreaksAreContent: n = !0 } = t, r = Array.from(e.children);
410
+ return !(n ? r.length > 0 : r.some((e) => e.tagName !== "BR")) && (e.textContent ?? "").replace(/\s/g, "") === "";
411
+ }
412
+ //#endregion
413
+ //#region src/tools/list/paste-handler.ts
414
+ var fe = /* @__PURE__ */ new Set(/* @__PURE__ */ "decimal.decimal-leading-zero.lower-roman.upper-roman.lower-greek.lower-latin.upper-latin.lower-alpha.upper-alpha.arabic-indic.armenian.bengali.cambodian.cjk-decimal.devanagari.georgian.gujarati.gurmukhi.hebrew.kannada.khmer.lao.malayalam.mongolian.myanmar.oriya.persian.telugu.thai.tibetan".split(".")), pe = /* @__PURE__ */ new Set([
415
+ "disc",
416
+ "circle",
417
+ "square",
418
+ "none"
419
+ ]), me = (e) => {
420
+ let t = e.getAttribute("data-list-style");
421
+ if (t === "ordered") return "ordered";
422
+ if (t === "unordered") return "unordered";
423
+ let n = e.getAttribute("style");
424
+ if (!n) return null;
425
+ let r = n.match(/list-style-type\s*:\s*([^;]+)/);
426
+ if (!r) return null;
427
+ let i = r[1].trim().toLowerCase();
428
+ return fe.has(i) ? "ordered" : pe.has(i) ? "unordered" : null;
429
+ }, T = (e) => {
430
+ if (e instanceof HTMLInputElement && e.type === "checkbox") return e;
431
+ let t = e.querySelector("input[type=\"checkbox\"]");
432
+ return t instanceof HTMLInputElement ? t : null;
433
+ }, he = (e, t) => {
434
+ let n = e.parentElement, r = T(e) !== null;
435
+ return n?.tagName === "OL" ? "ordered" : n?.tagName === "UL" ? r ? "checklist" : "unordered" : me(e) || (r ? "checklist" : t);
436
+ }, ge = (e) => {
437
+ let t = T(e);
438
+ if (t === null) return {
439
+ text: e.innerHTML || e.textContent || "",
440
+ checked: !1
441
+ };
442
+ let n = e.cloneNode(!0);
443
+ return n.querySelectorAll("input[type=\"checkbox\"]").forEach((e) => e.remove()), {
444
+ text: n.innerHTML.trim(),
445
+ checked: t.checked
446
+ };
447
+ }, _e = (e) => {
448
+ let t = e.getAttribute("aria-level");
449
+ if (t) return Math.max(0, parseInt(t, 10) - 1);
450
+ let n = E(e) - 1;
451
+ return n > 0 ? n : 0;
452
+ }, E = (e) => {
453
+ let t = e.parentElement;
454
+ return t === null ? 0 : +(t.tagName === "UL" || t.tagName === "OL") + E(t);
455
+ }, ve = /<br\s*\/?>/i, D = (e) => e.split(ve).map((e) => e.trim()).filter(Boolean), O = (e) => e instanceof HTMLElement && (e.tagName === "UL" || e.tagName === "OL"), k = (e) => Array.from(e.querySelectorAll("li")).map((t) => {
456
+ let n = he(t, e.tagName === "OL" ? "ordered" : "unordered"), r = _e(t), i = t.cloneNode(!0);
457
+ i.querySelectorAll("ul, ol").forEach((e) => e.remove());
458
+ let { text: a, checked: o } = ge(i);
459
+ return {
460
+ tool: "list",
461
+ data: {
462
+ text: C(a).trim(),
463
+ style: n,
464
+ checked: o,
465
+ depth: r
466
+ }
467
+ };
468
+ }), A = (e) => Array.from(e.querySelectorAll("tr")).filter((t) => {
469
+ let n = t.closest("table")?.parentElement?.closest("table");
470
+ return n == null || !e.contains(n);
471
+ }), j = (e) => Array.from(e.children).filter((e) => e.tagName === "TD" || e.tagName === "TH"), M = (e) => {
472
+ let t = e.cloneNode(!0);
473
+ return t.querySelectorAll("br").forEach((e) => e.replaceWith("\n")), t.textContent ?? "";
474
+ }, N = (e) => e instanceof HTMLElement && (e.tagName === "PRE" || e.tagName === "BLOK-CELL-CODE"), P = (e) => {
475
+ let t = [], n = [], r = () => {
476
+ D(n.join("")).forEach((e) => t.push({
477
+ tool: "paragraph",
478
+ data: { text: e }
479
+ })), n.length = 0;
480
+ };
481
+ for (let i of e) O(i) ? (r(), t.push(...k(i))) : i instanceof HTMLElement && (i.tagName === "P" || i.tagName === "DIV") ? (r(), n.push(i.innerHTML), r()) : N(i) ? (r(), t.push({
482
+ tool: "code",
483
+ data: { code: M(i) }
484
+ })) : i instanceof HTMLElement && i.tagName === "TABLE" ? (r(), A(i).flatMap(j).forEach((e) => t.push(...P(Array.from(e.childNodes))))) : n.push(i instanceof HTMLElement ? i.outerHTML : i.textContent ?? "");
485
+ return r(), t;
486
+ }, F = (e) => {
487
+ let t = document.createElement("div");
488
+ t.innerHTML = e;
489
+ let n = P(Array.from(t.childNodes));
490
+ return n.length > 0 ? n : [{
491
+ tool: "paragraph",
492
+ data: { text: "" }
493
+ }];
494
+ }, ye = 1e3, be = 65534, I = (e, t, n) => {
495
+ let r = Number.parseInt(e.getAttribute(t) ?? "", 10);
496
+ return !Number.isFinite(r) || r < 1 ? 1 : Math.min(r, n);
497
+ }, xe = (e, t) => {
498
+ let n = Array.from(e), r = n.map(() => []), i = { hasMerges: !1 }, a = (e, t) => e[t] === void 0 ? t : a(e, t + 1), o = (e, n, i, a) => {
499
+ Array.from({ length: i }).forEach((i, o) => {
500
+ Array.from({ length: a }).forEach((i, a) => {
501
+ (o !== 0 || a !== 0) && (r[e + o][n + a] ??= t.covered([e, n]));
502
+ });
503
+ });
504
+ };
505
+ n.forEach((e, s) => {
506
+ j(e).reduce((e, c) => {
507
+ let l = a(r[s], e), u = I(c, "colspan", ye), d = Math.min(I(c, "rowspan", be), n.length - s);
508
+ return r[s][l] = t.cell(c, {
509
+ colspan: u,
510
+ rowspan: d
511
+ }), (u > 1 || d > 1) && (i.hasMerges = !0, o(s, l, d, u)), l + u;
512
+ }, 0);
513
+ });
514
+ let s = i.hasMerges ? r : r.filter((e) => e.length > 0), c = s.reduce((e, t) => Math.max(e, t.length), 0);
515
+ return s.map((e) => Array.from({ length: c }, (n, r) => e[r] ?? t.filler()));
516
+ }, Se = /* @__PURE__ */ new Set(/* @__PURE__ */ "aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkgrey.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkslategrey.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dimgrey.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.green.greenyellow.grey.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightgrey.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightslategrey.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.slategrey.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen".split(".")), Ce = /* @__PURE__ */ new Set(["transparent", "currentcolor"]), we = 256, L = "[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)", R = `${L}%?`, z = `${L}%`, B = `${L}(?:deg|grad|rad|turn)?`, V = " *, *", H = " +", U = `(?: */ *${R})?`, Te = RegExp(`^rgba?\\( *${R}${V}${R}${V}${R}(?:${V}${R})? *\\)$`, "i"), Ee = RegExp(`^rgba?\\( *${R}${H}${R}${H}${R}${U} *\\)$`, "i"), De = RegExp(`^hsla?\\( *${B}${V}${z}${V}${z}(?:${V}${R})? *\\)$`, "i"), Oe = RegExp(`^hsla?\\( *${B}${H}${R}${H}${R}${U} *\\)$`, "i"), ke = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i, Ae = /^var\(--[a-zA-Z0-9_-]+\)$/, je = (e) => {
517
+ if (typeof e != "string" || e.length === 0 || e.length > we) return !1;
518
+ let t = e.toLowerCase();
519
+ return Se.has(t) || Ce.has(t) || ke.test(e) || Ae.test(e) || Te.test(e) || Ee.test(e) || De.test(e) || Oe.test(e);
520
+ }, W = "data-latex", Me = /* @__PURE__ */ new Set(["color", "background-color"]), Ne = {
521
+ br: !0,
522
+ strong: {},
523
+ b: {},
524
+ em: {},
525
+ i: {},
526
+ u: {},
527
+ s: {},
528
+ del: {},
529
+ a: {
530
+ href: !0,
531
+ target: !0,
532
+ rel: !0
533
+ },
534
+ code: {},
535
+ sup: {},
536
+ sub: {},
537
+ mark: (e) => {
538
+ let t = e.style, n = Array.from({ length: t.length }, (e, n) => t.item(n));
539
+ for (let e of n) Me.has(e) || t.removeProperty(e);
540
+ return t.length > 0 ? { style: !0 } : {};
541
+ },
542
+ span: (e) => {
543
+ let t = e.getAttribute(W);
544
+ return t !== null && (e.textContent !== t && (e.textContent = t), { [W]: !0 });
545
+ }
546
+ }, Pe = [
547
+ "left",
548
+ "center",
549
+ "right"
550
+ ], Fe = [
551
+ "top",
552
+ "middle",
553
+ "bottom"
554
+ ], G = {
555
+ left: "right",
556
+ center: "center",
557
+ right: "left"
558
+ };
559
+ function Ie(e, t) {
560
+ return t === "rtl" ? G[e] : e;
561
+ }
562
+ function Le(e, t, n = "ltr") {
563
+ let r = e?.trim().toLowerCase(), i = Pe.find((e) => e === r), a = i === void 0 ? r === "end" ? "right" : "left" : Ie(i, n), o = Fe.find((e) => e === t?.trim().toLowerCase()) ?? "top";
564
+ if (a !== "left" || o !== "top") return `${o}-${a}`;
565
+ }
566
+ ({ ...Ne });
567
+ function Re(e) {
568
+ let t = e.replace(/\s/g, "");
569
+ return t === "rgb(0,0,0)" || t === "#000000";
570
+ }
571
+ function ze(e) {
572
+ let t = /background-color\s*:\s*([^;]+)/i.exec(e)?.[1];
573
+ if (t !== void 0) return t.trim();
574
+ if (!/(?<![a-z-])background\s*:/i.test(e)) return;
575
+ let n = document.implementation.createHTMLDocument("").createElement("div");
576
+ return n.style.cssText = e, n.style.backgroundColor || void 0;
577
+ }
578
+ function K(e) {
579
+ let t = (/(?<![a-z-])direction\s*:\s*(rtl|ltr)\b/i.exec(e.getAttribute("style") ?? "")?.[1] ?? e.getAttribute("dir"))?.trim().toLowerCase();
580
+ return t === "rtl" || t === "ltr" ? t : e.parentElement === null ? "ltr" : K(e.parentElement);
581
+ }
582
+ function Be(e, t = "ltr") {
583
+ let n = {}, r = ze(e);
584
+ r !== void 0 && !s(r) && (n.color = p(r, "bg"));
585
+ let i = /(?<![a-z-])color\s*:\s*([^;]+)/i.exec(e)?.[1]?.trim();
586
+ i !== void 0 && !Re(i) && (n.textColor = p(i, "text"));
587
+ let a = Le(/(?<![a-z-])text-align\s*:\s*([^;]+)/i.exec(e)?.[1], /vertical-align\s*:\s*([^;]+)/i.exec(e)?.[1], t);
588
+ return a !== void 0 && (n.placement = a), n;
589
+ }
590
+ function Ve(e, t = "ltr") {
591
+ let n = e.getAttribute("style") ?? "", r = [n], i = e.getAttribute("align")?.trim(), a = e.getAttribute("valign")?.trim(), o = e.getAttribute("bgcolor")?.trim();
592
+ return i !== void 0 && /^[a-z]+$/i.test(i) && !/(?<![a-z-])text-align\s*:/i.test(n) && r.push(`text-align:${i}`), a !== void 0 && /^[a-z]+$/i.test(a) && !/vertical-align\s*:/i.test(n) && r.push(`vertical-align:${a}`), je(o) && !/(?<![a-z-])background(?:-color)?\s*:/i.test(n) && r.push(`background-color:${o}`), Be(r.join(";"), t);
593
+ }
594
+ //#endregion
595
+ //#region src/components/modules/paste/table-direction-preprocessor.ts
596
+ function He(e) {
597
+ if (!/<table[\s>]/i.test(e)) return e;
598
+ let t = new DOMParser().parseFromString(e, "text/html"), n = Array.from(t.querySelectorAll("table")).filter((e) => {
599
+ let t = e.getAttribute("dir")?.trim().toLowerCase() === "rtl" ? "rtl" : "ltr";
600
+ return K(e) !== t;
601
+ });
602
+ return n.length === 0 ? e : (n.forEach((e) => e.setAttribute("dir", K(e))), t.documentElement.outerHTML);
603
+ }
604
+ //#endregion
605
+ //#region src/preprocess/legacy-cms-html.ts
606
+ function Ue(e) {
607
+ We(e), qe(e), Xe(e), Qe(e), $e(e), et(e);
608
+ }
609
+ function We(e) {
610
+ let t = e.ownerDocument;
611
+ for (let n of Array.from(e.querySelectorAll("div[style]"))) {
612
+ if (n.closest("table")) continue;
613
+ let e = Ye(n);
614
+ if (!e || J(e)) continue;
615
+ let r = t.createElement("aside");
616
+ r.style.backgroundColor = e, r.append(...Array.from(n.childNodes)), Ge(r), Ke(r), n.replaceWith(r);
617
+ }
618
+ }
619
+ function Ge(e) {
620
+ for (;;) {
621
+ let t = Array.from(e.querySelectorAll(":scope > div")).filter((e) => !e.getAttribute("style") && !e.getAttribute("class"));
622
+ if (t.length === 0) break;
623
+ for (let e of t) e.replaceWith(...Array.from(e.childNodes));
624
+ }
625
+ }
626
+ function Ke(e) {
627
+ for (let t of Array.from(e.querySelectorAll("p"))) {
628
+ let e = t.lastElementChild;
629
+ e?.tagName === "BR" && e.remove();
630
+ }
631
+ }
632
+ var q = 250;
633
+ function qe(e) {
634
+ let t = e.querySelectorAll("[style*=\"background-color\"]");
635
+ for (let e of Array.from(t)) J(e.style.backgroundColor) && (e.style.removeProperty("background-color"), e.getAttribute("style")?.trim() === "" && e.removeAttribute("style"), Je(e) && e.replaceWith(...Array.from(e.childNodes)));
636
+ }
637
+ function J(e) {
638
+ if (!e) return !1;
639
+ let t = e.replace(/\s/g, "").toLowerCase();
640
+ if (t === "transparent") return !0;
641
+ let n = t.match(/^rgba?\((\d+),(\d+),(\d+)(?:,([^)]+))?\)$/);
642
+ if (!n) return !1;
643
+ if ((n[4] === void 0 ? 1 : parseFloat(n[4])) === 0) return !0;
644
+ let r = parseInt(n[1], 10), i = parseInt(n[2], 10), a = parseInt(n[3], 10);
645
+ return r >= q && i >= q && a >= q;
646
+ }
647
+ function Je(e) {
648
+ return e.attributes.length > 0 ? !1 : (e.textContent ?? "").replace(/[\s\u00A0]/g, "").length === 0;
649
+ }
650
+ function Ye(e) {
651
+ if (e.style.backgroundColor) return e.style.backgroundColor;
652
+ let t = (e.getAttribute("style") ?? "").match(/background:\s*([^;]+)/i);
653
+ if (t) {
654
+ let e = t[1].trim().match(/^(rgb[a]?\([^)]+\)|#[0-9a-fA-F]{3,8}|[a-z]+)$/i);
655
+ if (e) return e[1];
656
+ }
657
+ return "";
658
+ }
659
+ function Xe(e) {
660
+ for (let t of Array.from(e.querySelectorAll("td, th"))) {
661
+ let e = t.querySelectorAll("p");
662
+ if (e.length !== 0) {
663
+ for (let t of Array.from(e)) Ze(t);
664
+ rt(t);
665
+ }
666
+ }
667
+ }
668
+ function Ze(e) {
669
+ if (e.innerHTML.trim() === "" || e.innerHTML.trim() === "&nbsp;") {
670
+ e.remove();
671
+ return;
672
+ }
673
+ let t = e.ownerDocument, n = t.createDocumentFragment();
674
+ n.append(...Array.from(e.childNodes)), n.append(t.createElement("br")), e.replaceWith(n);
675
+ }
676
+ function Qe(e) {
677
+ for (let t of Array.from(e.querySelectorAll("p"))) t.closest("td") || t.closest("th") || w(t, { lineBreaksAreContent: !1 }) && t.remove();
678
+ }
679
+ function $e(e) {
680
+ let t = e.ownerDocument;
681
+ for (let n of Array.from(e.querySelectorAll("del, strike"))) {
682
+ let e = t.createElement("s");
683
+ e.append(...Array.from(n.childNodes)), n.replaceWith(e);
684
+ }
685
+ }
686
+ var Y = /^[\u2022\u00B7][\s\u00A0]*|^-\s/;
687
+ function et(e) {
688
+ let t = e.ownerDocument, n = nt(e);
689
+ for (let e of n) {
690
+ let n = t.createElement("ul");
691
+ e[0].before(n);
692
+ for (let t of e) tt(t, n);
693
+ }
694
+ }
695
+ function tt(e, t) {
696
+ let n = e.ownerDocument.createElement("li"), r = X(e);
697
+ r && (r.textContent = (r.textContent ?? "").replace(Y, "")), n.append(...Array.from(e.childNodes)), t.appendChild(n), e.remove();
698
+ }
699
+ function nt(e) {
700
+ let t = [], n = Array.from(e.childNodes);
701
+ for (let e of n) {
702
+ if (e.nodeType !== Node.ELEMENT_NODE) continue;
703
+ let n = e;
704
+ if (!(n.tagName === "P" && Y.test(n.textContent ?? ""))) continue;
705
+ let r = t[t.length - 1], i = n.previousElementSibling;
706
+ r && i !== null && r[r.length - 1] === i ? r.push(n) : t.push([n]);
707
+ }
708
+ return t;
709
+ }
710
+ function rt(e) {
711
+ for (;;) {
712
+ let t = e.lastChild;
713
+ if (!t) break;
714
+ let n = t.nodeType === Node.ELEMENT_NODE && t.tagName === "BR", r = t.nodeType === Node.TEXT_NODE && t.textContent?.trim() === "";
715
+ if (!n && !r) break;
716
+ t.remove();
717
+ }
718
+ }
719
+ function X(e) {
720
+ if (e.nodeType === Node.TEXT_NODE) return e;
721
+ for (let t of Array.from(e.childNodes)) {
722
+ let e = X(t);
723
+ if (e) return e;
724
+ }
725
+ return null;
726
+ }
727
+ //#endregion
728
+ //#region src/cli/commands/convert-html/sanitizer.ts
729
+ var it = {
730
+ B: !0,
731
+ STRONG: !0,
732
+ I: !0,
733
+ EM: !0,
734
+ A: /* @__PURE__ */ new Set(["href"]),
735
+ S: !0,
736
+ U: !0,
737
+ CODE: !0,
738
+ MARK: /* @__PURE__ */ new Set(["style"]),
739
+ BR: !0,
740
+ P: !0,
741
+ H1: !0,
742
+ H2: !0,
743
+ H3: !0,
744
+ H4: !0,
745
+ H5: !0,
746
+ H6: !0,
747
+ UL: !0,
748
+ OL: !0,
749
+ LI: /* @__PURE__ */ new Set(["aria-level"]),
750
+ TABLE: /* @__PURE__ */ new Set(["dir"]),
751
+ THEAD: !0,
752
+ TBODY: !0,
753
+ TR: !0,
754
+ CAPTION: !0,
755
+ TD: /* @__PURE__ */ new Set([
756
+ "style",
757
+ "colspan",
758
+ "rowspan",
759
+ "align",
760
+ "valign",
761
+ "bgcolor"
762
+ ]),
763
+ TH: /* @__PURE__ */ new Set([
764
+ "style",
765
+ "colspan",
766
+ "rowspan",
767
+ "align",
768
+ "valign",
769
+ "bgcolor"
770
+ ]),
771
+ BLOCKQUOTE: !0,
772
+ PRE: !0,
773
+ HR: !0,
774
+ ASIDE: /* @__PURE__ */ new Set(["style"]),
775
+ DETAILS: !0,
776
+ SUMMARY: !0,
777
+ IMG: /* @__PURE__ */ new Set(["src", "style"])
778
+ };
779
+ function at(e) {
780
+ Z(e);
781
+ }
782
+ function ot(e) {
783
+ let t = Array.from(e.childNodes);
784
+ for (let n of t) e.before(n);
785
+ return e.remove(), t.filter((e) => e.nodeType === e.ELEMENT_NODE);
786
+ }
787
+ function st(e, t) {
788
+ for (let n of Array.from(e.attributes)) (t === !0 || !t.has(n.name)) && e.removeAttribute(n.name);
789
+ }
790
+ function Z(e) {
791
+ let t = Array.from(e.childNodes);
792
+ for (let e of t) {
793
+ if (e.nodeType !== e.ELEMENT_NODE) continue;
794
+ let n = e, r = it[n.tagName];
795
+ if (r === void 0) {
796
+ t.push(...ot(n));
797
+ continue;
798
+ }
799
+ st(n, r), Z(n);
800
+ }
801
+ }
802
+ //#endregion
803
+ //#region src/cli/commands/convert-html/id-generator.ts
804
+ function ct() {
805
+ let e = /* @__PURE__ */ new Map();
806
+ return (t) => {
807
+ let n = (e.get(t) ?? 0) + 1;
808
+ return e.set(t, n), `${t}-${n}`;
809
+ };
810
+ }
811
+ //#endregion
812
+ //#region src/cli/commands/convert-html/block-builder.ts
813
+ function lt(e) {
814
+ let t = ct(), n = [];
815
+ for (let r of Array.from(e.childNodes)) ut(r, n, t);
816
+ return n;
817
+ }
818
+ function ut(e, t, n) {
819
+ if (e.nodeType === Node.TEXT_NODE) {
820
+ let r = e.textContent?.trim() ?? "";
821
+ r && t.push({
822
+ id: n("paragraph"),
823
+ type: "paragraph",
824
+ data: { text: r }
825
+ });
826
+ return;
827
+ }
828
+ if (e.nodeType !== Node.ELEMENT_NODE) return;
829
+ let r = e, i = r.tagName;
830
+ if (i === "P") {
831
+ t.push({
832
+ id: n("paragraph"),
833
+ type: "paragraph",
834
+ data: { text: r.innerHTML }
835
+ });
836
+ return;
837
+ }
838
+ if (/^H[1-6]$/.test(i)) {
839
+ let e = Number(i[1]);
840
+ t.push({
841
+ id: n("header"),
842
+ type: "header",
843
+ data: {
844
+ text: r.innerHTML,
845
+ level: e
846
+ }
847
+ });
848
+ return;
849
+ }
850
+ if (i === "BLOCKQUOTE") {
851
+ t.push({
852
+ id: n("quote"),
853
+ type: "quote",
854
+ data: {
855
+ text: r.innerHTML,
856
+ size: "default"
857
+ }
858
+ });
859
+ return;
860
+ }
861
+ if (i === "PRE") {
862
+ t.push({
863
+ id: n("code"),
864
+ type: "code",
865
+ data: {
866
+ code: r.textContent ?? "",
867
+ language: "plain-text"
868
+ }
869
+ });
870
+ return;
871
+ }
872
+ if (i === "HR") {
873
+ t.push({
874
+ id: n("divider"),
875
+ type: "divider",
876
+ data: {}
877
+ });
878
+ return;
879
+ }
880
+ if (i === "IMG") {
881
+ let e = r.getAttribute("src") ?? "", i = _t(r, "width");
882
+ t.push({
883
+ id: n("image"),
884
+ type: "image",
885
+ data: { url: e },
886
+ stretched: null,
887
+ key: null,
888
+ width: i
889
+ });
890
+ return;
891
+ }
892
+ if (i === "DETAILS") {
893
+ let e = r.querySelector("summary"), i = e ? e.innerHTML : r.innerHTML;
894
+ t.push({
895
+ id: n("toggle"),
896
+ type: "toggle",
897
+ data: { text: i }
898
+ });
899
+ return;
900
+ }
901
+ if (i === "UL" || i === "OL") {
902
+ Q(r, i === "OL" ? "ordered" : "unordered", 0, t, n);
903
+ return;
904
+ }
905
+ if (i === "TABLE") {
906
+ pt(r, t, n);
907
+ return;
908
+ }
909
+ if (i === "ASIDE") {
910
+ mt(r, t, n);
911
+ return;
912
+ }
913
+ t.push({
914
+ id: n("paragraph"),
915
+ type: "paragraph",
916
+ data: { text: r.innerHTML }
917
+ });
918
+ }
919
+ function Q(e, t, n, r, i) {
920
+ let a = e.getAttribute("start"), o = a ? Number(a) : null, s = Array.from(e.children).filter((e) => e.tagName === "LI");
921
+ for (let [e, a] of s.entries()) {
922
+ let s = a.cloneNode(!0), c = [];
923
+ for (let e of Array.from(s.querySelectorAll("ul, ol"))) c.push(e.cloneNode(!0)), e.remove();
924
+ let l = s.innerHTML.trim(), u = a.getAttribute("aria-level"), d = u ? Math.max(0, parseInt(u, 10) - 1) : n;
925
+ r.push({
926
+ id: i("list"),
927
+ type: "list",
928
+ data: {
929
+ text: l,
930
+ style: t,
931
+ depth: d === 0 ? null : d,
932
+ checked: null,
933
+ start: e === 0 && o !== null ? o : null
934
+ }
935
+ });
936
+ for (let e of c) Q(e, e.tagName === "OL" ? "ordered" : "unordered", n + 1, r, i);
937
+ }
938
+ }
939
+ var dt = [
940
+ "h1",
941
+ "h2",
942
+ "h3",
943
+ "h4",
944
+ "h5",
945
+ "h6",
946
+ "blockquote"
947
+ ].flatMap((e) => [`td ${e}`, `th ${e}`]).join(", ");
948
+ function ft(e) {
949
+ for (let t of Array.from(e.querySelectorAll(dt))) {
950
+ let e = t.ownerDocument;
951
+ t.replaceWith(e.createElement("br"), ...Array.from(t.childNodes), e.createElement("br"));
952
+ }
953
+ }
954
+ function pt(e, t, n) {
955
+ let r = Array.from(e.children).find((e) => e.tagName === "CAPTION")?.innerHTML.trim() ?? "";
956
+ r && t.push({
957
+ id: n("paragraph"),
958
+ type: "paragraph",
959
+ data: { text: r }
960
+ }), ft(e);
961
+ let i = n("table"), a = A(e), o = xe(a, {
962
+ cell: (e, t) => ({
963
+ kind: "cell",
964
+ el: e,
965
+ ...t
966
+ }),
967
+ covered: (e) => ({
968
+ kind: "covered",
969
+ origin: e
970
+ }),
971
+ filler: () => ({ kind: "filler" })
972
+ }), s = K(e), c = o.map((e) => e.map((e) => e.kind === "covered" ? {
973
+ blocks: [],
974
+ mergedInto: e.origin
975
+ } : e.kind === "filler" ? {
976
+ blocks: [],
977
+ color: null,
978
+ textColor: null
979
+ } : ht(e, s, i, t, n))), l = (e) => e?.tagName === "TH", u = a[0] ? j(a[0]) : [], d = a.some((e) => e.parentElement?.tagName === "THEAD") || u.length > 0 && u.every(l), f = a.length >= 2 && a.every((e) => l(j(e)[0])), p = (o[0] ?? []).map((e) => {
980
+ if (e.kind !== "cell" || e.colspan > 1) return null;
981
+ let t = parseInt($(e.el, "width") ?? "", 10);
982
+ return isNaN(t) ? null : t;
983
+ }), m = {
984
+ id: i,
985
+ type: "table",
986
+ data: {
987
+ withHeadings: d,
988
+ withHeadingColumn: f,
989
+ content: c,
990
+ ...p.some((e) => e !== null) ? { colWidths: p } : {}
991
+ }
992
+ }, h = t.findIndex((e) => e.parent === i);
993
+ h >= 0 ? t.splice(h, 0, m) : t.push(m);
994
+ }
995
+ function mt(e, t, r) {
996
+ let a = r("callout"), o = $(e, "background-color"), s = o && !n(o) && !i(o) ? m(o, "bg") : null, c = [];
997
+ for (let n of Array.from(e.childNodes)) {
998
+ let e = gt(n, a, t, r);
999
+ e && c.push(e);
1000
+ }
1001
+ let l = t.findIndex((e) => e.parent === a), u = {
1002
+ id: a,
1003
+ type: "callout",
1004
+ data: {
1005
+ emoji: "💡",
1006
+ backgroundColor: s
1007
+ },
1008
+ content: c
1009
+ };
1010
+ l >= 0 ? t.splice(l, 0, u) : t.push(u);
1011
+ }
1012
+ function ht(e, t, n, r, i) {
1013
+ let a = e.el, { color: o, textColor: s, placement: c } = Ve(a, t), l = a.innerHTML.trim();
1014
+ return {
1015
+ blocks: l ? F(l).map((e) => {
1016
+ let t = i(e.tool);
1017
+ return r.push({
1018
+ id: t,
1019
+ type: e.tool,
1020
+ parent: n,
1021
+ data: e.data
1022
+ }), t;
1023
+ }) : [],
1024
+ color: o === void 0 ? null : m(o, "bg"),
1025
+ textColor: s === void 0 ? null : m(s, "text"),
1026
+ ...c === void 0 ? {} : { placement: c },
1027
+ ...e.colspan > 1 ? { colspan: e.colspan } : {},
1028
+ ...e.rowspan > 1 ? { rowspan: e.rowspan } : {}
1029
+ };
1030
+ }
1031
+ function gt(e, t, n, r) {
1032
+ if (e.nodeType === Node.ELEMENT_NODE) {
1033
+ let i = e, a = r("paragraph");
1034
+ return n.push({
1035
+ id: a,
1036
+ type: "paragraph",
1037
+ parent: t,
1038
+ data: { text: i.innerHTML }
1039
+ }), a;
1040
+ }
1041
+ if (e.nodeType === Node.TEXT_NODE) {
1042
+ let i = e.textContent?.trim() ?? "";
1043
+ if (!i) return null;
1044
+ let a = r("paragraph");
1045
+ return n.push({
1046
+ id: a,
1047
+ type: "paragraph",
1048
+ parent: t,
1049
+ data: { text: i }
1050
+ }), a;
1051
+ }
1052
+ return null;
1053
+ }
1054
+ function _t(e, t) {
1055
+ let n = $(e, t);
1056
+ if (!n) return null;
1057
+ let r = parseInt(n, 10);
1058
+ return isNaN(r) ? null : r;
1059
+ }
1060
+ function $(e, t) {
1061
+ let n = e.getAttribute("style");
1062
+ if (!n) return null;
1063
+ let r = RegExp(`(?<![\\-a-z])${t}\\s*:\\s*([^;]+)`).exec(n);
1064
+ return r ? r[1].trim() : null;
1065
+ }
1066
+ //#endregion
1067
+ export { j as a, C as c, p as d, s as f, He as i, le as l, at as n, A as o, Ue as r, w as s, lt as t, S as u };