@silurus/ooxml 0.89.0 → 0.89.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.
Files changed (65) hide show
  1. package/THIRD_PARTY_NOTICES.md +1 -1
  2. package/dist/assets/render-worker-C5G_Nr_A.js +35 -0
  3. package/dist/assets/render-worker-DQfWdNsm.js +16 -0
  4. package/dist/assets/render-worker-Ds7LjwU-.js +15 -0
  5. package/dist/bounded-raw-part-cache-CsnNptAy.js +33925 -0
  6. package/dist/{canvas-viewer-mechanics-DfQqRKkD.js → canvas-viewer-mechanics-BZ8QCrRi.js} +2 -2
  7. package/dist/{cfb-guard-9QTRTg7f.js → cfb-guard-dNeUiANF.js} +1 -1
  8. package/dist/chart-ex.mjs +477 -477
  9. package/dist/{comment-overlay-controller-B5_zGgG5.js → comment-overlay-controller-CBvQx-En.js} +16 -16
  10. package/dist/{comment-ui-runtime-D_sb2K6s.js → comment-ui-runtime-BKidRH36.js} +3 -3
  11. package/dist/{comment-ui-runtime-Jy-3goA9.js → comment-ui-runtime-C47QoDUy.js} +3 -3
  12. package/dist/{document-model-source-BKNrXjAL.js → document-model-source-MzFPrxt0.js} +44 -44
  13. package/dist/{document-pull-client-CxONDGbk.js → document-pull-client-BoJeuURD.js} +6102 -7994
  14. package/dist/{document-pull-worker-AMyXYpPq.js → document-pull-worker-CaP8XESP.js} +18 -18
  15. package/dist/{docx-D91ER1_S.js → docx-BN70UhvX.js} +24 -24
  16. package/dist/{docx-DhDnKEI6.js → docx-BRRtSvk3.js} +556 -556
  17. package/dist/{docx-model-source-CdrSt3hF.js → docx-model-source-CTO9iw_W.js} +12 -12
  18. package/dist/docx.mjs +4 -4
  19. package/dist/{drawingml-shape-ChcGZNd8.js → drawingml-shape-CHmq8kpM.js} +55 -55
  20. package/dist/{duotone-ekYik4ix.js → duotone-DN8P4aXe.js} +1 -1
  21. package/dist/{emf-UT6I8rVi.js → emf-CGFQIz6c.js} +60 -60
  22. package/dist/{font-preload-demand-CdJZUMCT.js → font-preload-demand-Dmy31xt-.js} +2 -2
  23. package/dist/{grid-geometry-uQOgViJU.js → grid-geometry-C3IG20ut.js} +1 -1
  24. package/dist/{host-layout-measure-CCEgaC_v.js → host-layout-measure-DsuQ2UJs.js} +1 -1
  25. package/dist/index.mjs +3 -3
  26. package/dist/internal-companion.mjs +2 -2
  27. package/dist/{line-distribute-CPOV6csk.js → line-distribute-Bu8psjGd.js} +153 -70
  28. package/dist/{model-source-DJGzDtGb.js → model-source-s5hRpk4w.js} +4 -4
  29. package/dist/{model-source-session-Bu9CHFHc.js → model-source-session-6fuaqbGs.js} +18 -18
  30. package/dist/{model-source-session-CDuijwv1.js → model-source-session-DqrR4XHR.js} +2 -2
  31. package/dist/{model-source-session-sKpNiIJI.js → model-source-session-cPJSF_Ak.js} +10 -10
  32. package/dist/node.mjs +5 -5
  33. package/dist/{bounded-raw-part-cache-B7JoC1CD.js → plot-area-frame-Bs_j4uu7.js} +15189 -37964
  34. package/dist/{pptx-C_uxLVKB.js → pptx-CaJ6ILnw.js} +9 -9
  35. package/dist/{pptx-CDP9dZHe.js → pptx-_BOGcBym.js} +58 -58
  36. package/dist/{pptx-model-source-O7LhpOjz.js → pptx-model-source-B_9afw9R.js} +5 -5
  37. package/dist/pptx.mjs +5 -5
  38. package/dist/{presentation-model-source-tmROzteR.js → presentation-model-source-CGHLyX32.js} +5 -5
  39. package/dist/region-map.mjs +53 -53
  40. package/dist/{render-CJVglUHl.js → render-CzbDzRKa.js} +2 -2
  41. package/dist/{render-worker-host-BseIaVvm.js → render-worker-host-B1u6BOUd.js} +1 -1
  42. package/dist/{render-worker-host-CyxPU4JU.js → render-worker-host-C-EECo68.js} +1 -1
  43. package/dist/{render-worker-host-aF6aWkC0.js → render-worker-host-DDqZTCVf.js} +1 -1
  44. package/dist/renderer-CD2cvVAF.js +5823 -0
  45. package/dist/{renderer-CkGLj0CC.js → renderer-DRoeb14O.js} +696 -696
  46. package/dist/{resource-measurement-mXw-WjMF.js → resource-measurement-Dhhm7P_l.js} +162 -161
  47. package/dist/{session-Csv9maad.js → session-XPmC0CUd.js} +176 -176
  48. package/dist/{slide-pull-client-DRZYwBTu.js → slide-pull-client-tq7U_fYg.js} +1454 -1484
  49. package/dist/{three-d-BK5siJgJ.js → three-d-BKwNPAP4.js} +107 -107
  50. package/dist/three-d.mjs +625 -625
  51. package/dist/{wasm-runtime-generation-DX4y0Ecl.js → wasm-runtime-generation-D6TKZdNb.js} +4 -4
  52. package/dist/{workbook-model-source-BTC4ISTS.js → workbook-model-source-BIGrfZy6.js} +6 -6
  53. package/dist/worker-source-DrwhR9fw.js +22 -0
  54. package/dist/{worksheet-pull-client-CkHgbtyM.js → worksheet-pull-client-ClvPO_Jf.js} +74 -74
  55. package/dist/{xlsx-CpSDPAEU.js → xlsx-CsmREBaZ.js} +430 -420
  56. package/dist/{xlsx-D5569TPf.js → xlsx-DmHfeNNp.js} +24 -24
  57. package/dist/{xlsx-model-source-DPSkjFic.js → xlsx-model-source-D1flORqy.js} +55 -55
  58. package/dist/xlsx.mjs +5 -5
  59. package/package.json +1 -1
  60. package/dist/assets/render-worker-CUOU6mL2.js +0 -16
  61. package/dist/assets/render-worker-DOqrFhSU.js +0 -15
  62. package/dist/assets/render-worker-DvWUdZUN.js +0 -35
  63. package/dist/plot-area-frame-CaJFvZ7p.js +0 -8502
  64. package/dist/renderer-Czw1cCC7.js +0 -5823
  65. package/dist/worker-source-I1cIYBel.js +0 -22
@@ -1,4 +1,5 @@
1
- import { C as e, Cn as t, Sn as n, _n as r, b as i, fn as a, g as o, h as s, mn as c, w as l, x as u } from "./bounded-raw-part-cache-B7JoC1CD.js";
1
+ import { _o as e } from "./plot-area-frame-Bs_j4uu7.js";
2
+ import { C as t, Qt as n, b as r, g as i, h as a, on as o, sn as s, tn as c, w as l, x as u } from "./bounded-raw-part-cache-CsnNptAy.js";
2
3
  //#region packages/core/src/drawingml-text/tab.ts
3
4
  function d(e, t, n, r, i, a = 0) {
4
5
  let o = e.map((e) => e.width), s = (t) => {
@@ -28,85 +29,85 @@ function d(e, t, n, r, i, a = 0) {
28
29
  }
29
30
  //#endregion
30
31
  //#region packages/core/src/drawingml-text/break.ts
31
- var f = /^\p{Script_Extensions=Latin}$/u, p = (e) => e.type === "text" && e.text === " ", m = (e) => e.type === "text" && t(e.text.codePointAt(0) ?? 0);
32
- function h(t, a) {
33
- let o = a.sameStyle ?? ((e, t) => e === t), s = [[]], h = [], g = [-1], _ = [], v = 0;
34
- for (let e of t) {
35
- if (h.push(s.length - 1), e.type === "break") {
32
+ var f = /^\p{Script_Extensions=Latin}$/u, p = (e) => e.type === "text" && e.text === " ", m = (e) => e.type === "text" && s(e.text.codePointAt(0) ?? 0);
33
+ function h(e, i) {
34
+ let a = i.sameStyle ?? ((e, t) => e === t), s = [[]], h = [], g = [-1], _ = [], v = 0;
35
+ for (let t of e) {
36
+ if (h.push(s.length - 1), t.type === "break") {
36
37
  _[s.length - 1] = v, s.push([]), g.push(-1), v++;
37
38
  continue;
38
39
  }
39
- if (e.type === "object") {
40
- e.display && s.at(-1).length > 0 && (s.push([]), g.push(-1)), s.at(-1).push({
40
+ if (t.type === "object") {
41
+ t.display && s.at(-1).length > 0 && (s.push([]), g.push(-1)), s.at(-1).push({
41
42
  type: "object",
42
- style: e.style,
43
+ style: t.style,
43
44
  run: v,
44
- width: e.width,
45
- payload: e.payload
46
- }), e.display && (s.push([]), g.push(-1)), v++;
45
+ width: t.width,
46
+ payload: t.payload
47
+ }), t.display && (s.push([]), g.push(-1)), v++;
47
48
  continue;
48
49
  }
49
- let t = [
50
+ let e = [
50
51
  0,
51
- ...r(e.text),
52
- e.text.length
52
+ ...c(t.text),
53
+ t.text.length
53
54
  ];
54
- for (let n = 0; n + 1 < t.length; n++) {
55
- let r = e.text.slice(t[n], t[n + 1]);
55
+ for (let n = 0; n + 1 < e.length; n++) {
56
+ let r = t.text.slice(e[n], e[n + 1]);
56
57
  r === "\n" ? (s.push([]), g.push(v)) : r === " " ? s.at(-1).push({
57
58
  type: "tab",
58
- style: e.style,
59
+ style: t.style,
59
60
  run: v
60
61
  }) : r !== "\r" && s.at(-1).push({
61
62
  type: "text",
62
63
  text: r,
63
- style: e.style,
64
+ style: t.style,
64
65
  run: v
65
66
  });
66
67
  }
67
68
  v++;
68
69
  }
69
- let y = [], b = [], x = [], S = new Uint8Array(t.length);
70
- for (let t = 0; t < s.length; t++) {
71
- let r = s[t];
72
- if (b.push(y.length), t === s.length - 1) for (; r.length > 0 && p(r.at(-1));) r.pop();
73
- let h = r.length, v = /* @__PURE__ */ new Set();
74
- if (r.some((e) => e.type === "text" && c(e.text))) {
70
+ let y = [], b = [], x = [], S = new Uint8Array(e.length);
71
+ for (let e = 0; e < s.length; e++) {
72
+ let c = s[e];
73
+ if (b.push(y.length), e === s.length - 1) for (; c.length > 0 && p(c.at(-1));) c.pop();
74
+ let h = c.length, v = /* @__PURE__ */ new Set();
75
+ if (c.some((e) => e.type === "text" && n(e.text))) {
75
76
  let e = "", t = [0];
76
- for (let n of r) e += n.type === "text" ? n.text : "", t.push(e.length);
77
- let i = new Set(n(e, { cjk: !0 }));
78
- for (let e = 1; e < t.length; e++) i.has(t[e]) && v.add(e);
77
+ for (let n of c) e += n.type === "text" ? n.text : "", t.push(e.length);
78
+ let n = new Set(o(e, { cjk: !0 }));
79
+ for (let e = 1; e < t.length; e++) n.has(t[e]) && v.add(e);
79
80
  }
80
- let C = a.eastAsianLineBreak !== !1, w = (e) => e === 160 || e === 8239 || e === 8288 || e === 65279, T = (e) => {
81
+ let C = i.eastAsianLineBreak !== !1, w = (e) => e === 160 || e === 8239 || e === 8288 || e === 65279, T = (e) => {
81
82
  if (e <= 0 || e >= h) return !1;
82
- let t = r[e - 1], n = r[e];
83
+ let t = c[e - 1], n = c[e];
83
84
  if (n.type === "tab") return !0;
84
85
  if (t.type === "tab") return !1;
85
86
  if (p(t) || p(n) || v.has(e) || t.type === "object" || n.type === "object") return !0;
86
- let a = [...t.text].at(-1)?.codePointAt(0), o = n.text.codePointAt(0);
87
- if (a === void 0 || o === void 0) return !1;
88
- if (a === 8203 || !C && (m(t) || m(n)) && !w(a) && !w(o)) return !0;
89
- if (i(a, o)) return !1;
87
+ let i = [...t.text].at(-1)?.codePointAt(0), a = n.text.codePointAt(0);
88
+ if (i === void 0 || a === void 0) return !1;
89
+ if (i === 8203 || !C && (m(t) || m(n)) && !w(i) && !w(a)) return !0;
90
+ if (r(i, a)) return !1;
90
91
  if (m(t) || m(n)) return !0;
91
- if (e > 1 && (u(a) === "HY" || u(a) === "HH")) {
92
- let t = r[e - 2];
92
+ if (e > 1 && (u(i) === "HY" || u(i) === "HH")) {
93
+ let t = c[e - 2];
93
94
  if (t.type === "text" && f.test([...t.text].at(-1) ?? "") && f.test([...n.text][0] ?? "")) return !0;
94
95
  }
95
96
  return !1;
96
97
  }, E = new Uint8Array(h + 1);
97
98
  for (let e = 1; e < h; e++) E[e] = +!!T(e);
98
- let D = r[0]?.style, O = h > 0 && r.every((e) => e.type === "text" && o(D, e.style)) ? r.map((e) => e.type === "text" ? e.text : "").join("") : null, k = O === null ? null : new Int32Array(h + 1);
99
+ let D = c[0]?.style, O = h > 0 && c.every((e) => e.type === "text" && a(D, e.style)) ? c.map((e) => e.type === "text" ? e.text : "").join("") : null, k = O === null ? null : new Int32Array(h + 1);
99
100
  if (k) for (let e = 0; e < h; e++) {
100
- let t = r[e];
101
+ let t = c[e];
101
102
  k[e + 1] = k[e] + (t.type === "text" ? t.text.length : 0);
102
103
  }
103
104
  let A = null, j = 0, M = (e) => {
104
- let t = r[e], n = r[e + 1];
105
- if (t?.type !== "tab" || !a.tabStops?.length || n?.type !== "text" || !/^[\p{Script_Extensions=Latin}\p{Number}]$/u.test(n.text)) return !1;
105
+ let t = c[e], n = c[e + 1];
106
+ if (t?.type !== "tab" || !i.tabStops?.length || n?.type !== "text" || !/^[\p{Script_Extensions=Latin}\p{Number}]$/u.test(n.text)) return !1;
106
107
  if (A === null) {
107
108
  j = $, A = new Uint8Array(h - j + 1), A[h - j] = 1;
108
109
  for (let e = h - 1; e >= j; e--) {
109
- let t = r[e], n = e - j;
110
+ let t = c[e], n = e - j;
110
111
  A[n] = A[n + 1] && t.type === "text" && !p(t) && !m(t) ? 1 : 0;
111
112
  }
112
113
  }
@@ -116,8 +117,8 @@ function h(t, a) {
116
117
  P = $;
117
118
  let e = [], t = new Int32Array(h - P + 1);
118
119
  for (let n = P; n < h; n++) {
119
- let i = r[n];
120
- if (i.type === "text") for (let t of i.text) e.push(t);
120
+ let r = c[n];
121
+ if (r.type === "text") for (let t of r.text) e.push(t);
121
122
  t[n + 1 - P] = e.length;
122
123
  }
123
124
  N = {
@@ -126,20 +127,20 @@ function h(t, a) {
126
127
  };
127
128
  }
128
129
  return N;
129
- }, I = (e, t) => e.type === "text" && t.type === "text" && a.kinsokuAcrossRuns?.(e.style, t.style, e.text, t.text) === !0, L = null, R = 0, z = (e) => {
130
+ }, I = (e, t) => e.type === "text" && t.type === "text" && i.kinsokuAcrossRuns?.(e.style, t.style, e.text, t.text) === !0, L = null, R = 0, z = (e) => {
130
131
  if (L === null) {
131
132
  R = $, L = new Int32Array(h - $ + 1);
132
133
  let e = $ + 1;
133
134
  for (let t = $ + 1; t < h; t++) {
134
- let n = r[t - 1], i = r[t];
135
- (n.type !== "text" || i.type !== "text" || n.run !== i.run && !I(n, i)) && (e = t), L[t - R] = e;
135
+ let n = c[t - 1], r = c[t];
136
+ (n.type !== "text" || r.type !== "text" || n.run !== r.run && !I(n, r)) && (e = t), L[t - R] = e;
136
137
  }
137
138
  }
138
139
  return Math.max($ + 1, L[e - R]);
139
140
  }, B = (e, t) => {
140
141
  if (t.type === "text") {
141
142
  let n = e.at(-1);
142
- if (n?.type === "text" && o(n.style, t.style)) {
143
+ if (n?.type === "text" && a(n.style, t.style)) {
143
144
  n.text += t.text;
144
145
  return;
145
146
  }
@@ -162,23 +163,23 @@ function h(t, a) {
162
163
  }, V = (e, t) => {
163
164
  let n = 0, r = e.map((t, r) => {
164
165
  if (t.type === "text") {
165
- t.width = a.measureText(t.text, t.style);
166
+ t.width = i.measureText(t.text, t.style);
166
167
  let n = e[r - 1];
167
- n?.type === "text" && (t.width += a.boundaryAdvance?.(n.style, t.style) ?? 0);
168
+ n?.type === "text" && (t.width += i.boundaryAdvance?.(n.style, t.style) ?? 0);
168
169
  }
169
- return t.type === "tab" && (t.width = 0, n = a.measureText(" ", t.style)), {
170
+ return t.type === "tab" && (t.width = 0, n = i.measureText(" ", t.style)), {
170
171
  isTab: t.type === "tab",
171
172
  width: t.width
172
173
  };
173
174
  });
174
175
  if (r.some((e) => e.isTab)) {
175
- let i = d(r, a.tabStops ?? [], a.tabStartPen?.(t) ?? (t === 0 ? a.firstLineIndent ?? 0 : 0), Infinity, n, a.defaultTabSize ?? 0);
176
- for (let t = 0; t < e.length; t++) e[t].width = i[t];
176
+ let a = d(r, i.tabStops ?? [], i.tabStartPen?.(t) ?? (t === 0 ? i.firstLineIndent ?? 0 : 0), Infinity, n, i.defaultTabSize ?? 0);
177
+ for (let t = 0; t < e.length; t++) e[t].width = a[t];
177
178
  }
178
179
  return e.reduce((e, t) => e + t.width, 0);
179
180
  }, H = (e, t, n) => {
180
181
  if (O !== null && k && D !== void 0) {
181
- let n = O.slice(k[e], k[t]), r = a.measureText(n, D);
182
+ let n = O.slice(k[e], k[t]), r = i.measureText(n, D);
182
183
  return {
183
184
  segments: [{
184
185
  type: "text",
@@ -189,16 +190,16 @@ function h(t, a) {
189
190
  width: r
190
191
  };
191
192
  }
192
- let i = [];
193
- for (let n = e; n < t; n++) B(i, r[n]);
193
+ let r = [];
194
+ for (let n = e; n < t; n++) B(r, c[n]);
194
195
  return {
195
- segments: i,
196
- width: V(i, n)
196
+ segments: r,
197
+ width: V(r, n)
197
198
  };
198
199
  }, U = null, W = (e, t) => {
199
200
  let n = "";
200
- for (let i = e; i < t; i++) {
201
- let e = r[i];
201
+ for (let r = e; r < t; r++) {
202
+ let e = c[r];
202
203
  e.type === "text" && (n += e.text);
203
204
  }
204
205
  return n;
@@ -210,44 +211,44 @@ function h(t, a) {
210
211
  }
211
212
  return t;
212
213
  }, K = () => {
213
- let e = new Int32Array(h).fill(-1), t = new Int32Array(h).fill(-1), n = new Float64Array(h).fill(NaN), i = new Float64Array(h), s = new Float64Array(h + 1), c = new Float64Array(h + 1), l = new Int32Array(h + 1), u = -1, d, f = null, p = 0, m = 0, g = (e) => {
214
+ let e = new Int32Array(h).fill(-1), t = new Int32Array(h).fill(-1), n = new Float64Array(h).fill(NaN), r = new Float64Array(h), o = new Float64Array(h + 1), s = new Float64Array(h + 1), l = new Int32Array(h + 1), u = -1, d, f = null, p = 0, m = 0, g = (e) => {
214
215
  for (let n = u; u >= 0 && n < e; n++) t[n] = e;
215
216
  };
216
217
  for (let t = 0; t < h; t++) {
217
- let h = r[t];
218
- if (l[t + 1] = l[t] + +(h.type === "tab"), h.type === "text" && u >= 0 && o(d, h.style) || (g(t), p = c[t], h.type === "text" ? (f = u >= 0 ? a.boundaryAdvance?.(d, h.style) ?? 0 : null, u = t, d = h.style) : (u = -1, d = void 0)), h.type === "text") {
219
- let r = d;
220
- if (e[t] = u, t - u <= 8) m = a.measureText(W(u, t + 1), r), n[t] = m;
218
+ let h = c[t];
219
+ if (l[t + 1] = l[t] + +(h.type === "tab"), h.type === "text" && u >= 0 && a(d, h.style) || (g(t), p = s[t], h.type === "text" ? (f = u >= 0 ? i.boundaryAdvance?.(d, h.style) ?? 0 : null, u = t, d = h.style) : (u = -1, d = void 0)), h.type === "text") {
220
+ let a = d;
221
+ if (e[t] = u, t - u <= 8) m = i.measureText(W(u, t + 1), a), n[t] = m;
221
222
  else {
222
223
  let e = W(t - 8, t);
223
- i[t] = a.measureText(e + h.text, r) - a.measureText(e, r), m += i[t];
224
+ r[t] = i.measureText(e + h.text, a) - i.measureText(e, a), m += r[t];
224
225
  }
225
- c[t + 1] = p + (f === null ? m : m + f);
226
- } else c[t + 1] = p + (h.type === "object" ? h.width : 0);
227
- s[t + 1] = s[t] + i[t];
226
+ s[t + 1] = p + (f === null ? m : m + f);
227
+ } else s[t + 1] = p + (h.type === "object" ? h.width : 0);
228
+ o[t + 1] = o[t] + r[t];
228
229
  }
229
230
  g(h);
230
231
  let _ = new Float64Array(h + 1);
231
- _[h] = c[h];
232
- for (let e = h - 1; e >= 0; e--) _[e] = Math.min(c[e], _[e + 1]);
232
+ _[h] = s[h];
233
+ for (let e = h - 1; e >= 0; e--) _[e] = Math.min(s[e], _[e + 1]);
233
234
  let v = new Float64Array(h + 1).fill(Infinity);
234
- for (let e = h; e >= 1; e--) r[e - 1].type === "text" && (v[e] = e === t[e - 1] ? s[e] : Math.min(s[e], v[e + 1]));
235
+ for (let e = h; e >= 1; e--) c[e - 1].type === "text" && (v[e] = e === t[e - 1] ? o[e] : Math.min(o[e], v[e + 1]));
235
236
  let y = new Int32Array(h), b = [];
236
237
  for (let e = 0; e < h; e++) {
237
- let t = r[e];
238
- if (t.type !== "tab" || (a.defaultTabSize ?? 0) > 0) continue;
239
- let n = a.measureText(" ", t.style), i = b.indexOf(n);
240
- i < 0 && (i = b.push(n) - 1), y[e] = i;
238
+ let t = c[e];
239
+ if (t.type !== "tab" || (i.defaultTabSize ?? 0) > 0) continue;
240
+ let n = i.measureText(" ", t.style), r = b.indexOf(n);
241
+ r < 0 && (r = b.push(n) - 1), y[e] = r;
241
242
  }
242
243
  return b.length === 0 && b.push(0), {
243
244
  segStart: e,
244
245
  segEnd: t,
245
246
  head: n,
246
- tail: i,
247
- tailSum: s,
248
- tailBlockMin: G(s),
249
- natural: c,
250
- naturalBlockMin: G(c),
247
+ tail: r,
248
+ tailSum: o,
249
+ tailBlockMin: G(o),
250
+ natural: s,
251
+ naturalBlockMin: G(s),
251
252
  naturalSuffixMin: _,
252
253
  tailSuffixMin: v,
253
254
  tabsBefore: l,
@@ -271,34 +272,34 @@ function h(t, a) {
271
272
  let r = Math.min(n, t + 8 + 1) - 1;
272
273
  return e.head[r] + (e.tailSum[n] - e.tailSum[r + 1]);
273
274
  }
274
- let i = Math.min(n, t + 8 + 1), o = J.get(i);
275
- return o === void 0 && (o = a.measureText(W(t, i), r[t].style), J.set(i, o)), o + (e.tailSum[n] - e.tailSum[i]);
275
+ let r = Math.min(n, t + 8 + 1), a = J.get(r);
276
+ return a === void 0 && (a = i.measureText(W(t, r), c[t].style), J.set(r, a)), a + (e.tailSum[n] - e.tailSum[r]);
276
277
  }, ee = (e, t, n) => {
277
- let i = U ??= K();
278
- if (J.clear(), i.tabsBefore[h] !== i.tabsBefore[e]) return te(i, e, t, n);
279
- let o = r[e], s = o.type === "text" ? i.segEnd[e] : e + 1, c = o.type === "text" ? Y(i, e, s) : o.type === "object" ? o.width : 0;
280
- if (s < h) {
281
- let t = r[s], l = o.type === "text" && t.type === "text" && a.boundaryAdvance ? a.boundaryAdvance(o.style, t.style) - a.boundaryAdvance(r[i.segStart[e]].style, t.style) : 0, u = q(i.natural, i.naturalBlockMin, c + l - i.natural[s], s, h, n);
278
+ let r = U ??= K();
279
+ if (J.clear(), r.tabsBefore[h] !== r.tabsBefore[e]) return te(r, e, t, n);
280
+ let a = c[e], o = a.type === "text" ? r.segEnd[e] : e + 1, s = a.type === "text" ? Y(r, e, o) : a.type === "object" ? a.width : 0;
281
+ if (o < h) {
282
+ let t = c[o], l = a.type === "text" && t.type === "text" && i.boundaryAdvance ? i.boundaryAdvance(a.style, t.style) - i.boundaryAdvance(c[r.segStart[e]].style, t.style) : 0, u = q(r.natural, r.naturalBlockMin, s + l - r.natural[o], o, h, n);
282
283
  if (u >= 0) return u;
283
284
  }
284
- if (c <= n) return s;
285
- if (o.type !== "text") return e;
285
+ if (s <= n) return o;
286
+ if (a.type !== "text") return e;
286
287
  let l = e + 8 + 1;
287
- if (s - 1 > l) {
288
- let t = Y(i, e, l) - i.tailSum[l], r = q(i.tailSum, i.tailBlockMin, t, l, s - 1, n);
289
- if (r >= 0) return r;
288
+ if (o - 1 > l) {
289
+ let t = Y(r, e, l) - r.tailSum[l], i = q(r.tailSum, r.tailBlockMin, t, l, o - 1, n);
290
+ if (i >= 0) return i;
290
291
  }
291
- for (let t = Math.min(s - 1, l); t > e; t--) if (Y(i, e, t) <= n) return t;
292
+ for (let t = Math.min(o - 1, l); t > e; t--) if (Y(r, e, t) <= n) return t;
292
293
  return e;
293
- }, te = (e, t, n, i) => {
294
- let o = a.tabStartPen?.(n) ?? (n === 0 ? a.firstLineIndent ?? 0 : 0), s = a.tabStops ?? [], c = a.defaultTabSize ?? 0, l = e.gapValues, u = l.length, d = new Float64Array(u), f = new Float64Array(u).fill(o), p = new Float64Array(u), m = new Float64Array(u), g = new Float64Array(u), _ = new Uint8Array(u), v = new Float64Array(u), y = !1, b = 0, x = 0, S = !1, C = r[t], w = C.type === "text" ? e.segEnd[t] : t + 1, T = C.type === "text" ? Y(e, t, w) : C.type === "object" ? C.width : 0, E = r[w], D = T + (w < h && C.type === "text" && E.type === "text" && a.boundaryAdvance ? a.boundaryAdvance(C.style, E.style) - a.boundaryAdvance(r[e.segStart[t]].style, E.style) : 0) - e.natural[w], O = t + 8 + 1, k = C.type === "text" && w > O ? Y(e, t, O) - e.tailSum[O] : 0, A = l.every((e) => e >= 0), j = 1e-9 * Math.max(1, Math.abs(i)), M = (t) => {
294
+ }, te = (e, t, n, r) => {
295
+ let a = i.tabStartPen?.(n) ?? (n === 0 ? i.firstLineIndent ?? 0 : 0), o = i.tabStops ?? [], s = i.defaultTabSize ?? 0, l = e.gapValues, u = l.length, d = new Float64Array(u), f = new Float64Array(u).fill(a), p = new Float64Array(u), m = new Float64Array(u), g = new Float64Array(u), _ = new Uint8Array(u), v = new Float64Array(u), y = !1, b = 0, x = 0, S = !1, C = c[t], w = C.type === "text" ? e.segEnd[t] : t + 1, T = C.type === "text" ? Y(e, t, w) : C.type === "object" ? C.width : 0, E = c[w], D = T + (w < h && C.type === "text" && E.type === "text" && i.boundaryAdvance ? i.boundaryAdvance(C.style, E.style) - i.boundaryAdvance(c[e.segStart[t]].style, E.style) : 0) - e.natural[w], O = t + 8 + 1, k = C.type === "text" && w > O ? Y(e, t, O) - e.tailSum[O] : 0, A = l.every((e) => e >= 0), j = 1e-9 * Math.max(1, Math.abs(r)), M = (t) => {
295
296
  if (!A || t < O && t < w) return !1;
296
297
  let n = Infinity;
297
- return t < w && (n = k + e.tailSuffixMin[t + 1]), w < h && (n = Math.min(n, D + e.naturalSuffixMin[Math.max(t + 1, w + 1)])), n > i + j;
298
+ return t < w && (n = k + e.tailSuffixMin[t + 1]), w < h && (n = Math.min(n, D + e.naturalSuffixMin[Math.max(t + 1, w + 1)])), n > r + j;
298
299
  }, N = t, P = -1, F = null;
299
300
  for (let n = t + 1; n <= h; n++) {
300
- let o = n - 1, C = r[o];
301
- if (C.type === "text" && P >= 0 && e.segStart[o] === e.segStart[o - 1]) {
301
+ let a = n - 1, C = c[a];
302
+ if (C.type === "text" && P >= 0 && e.segStart[a] === e.segStart[a - 1]) {
302
303
  let r = X(e, P, t, n);
303
304
  x = F === null ? r : r + F;
304
305
  } else {
@@ -311,18 +312,18 @@ function h(t, a) {
311
312
  }
312
313
  p[e] = f[e];
313
314
  let t = null;
314
- for (let n of s) n.pos > f[e] && (t === null || n.pos < t.pos) && (t = n);
315
- t === null && c > 0 && (t = {
316
- pos: (Math.floor(f[e] / c) + 1) * c,
315
+ for (let n of o) n.pos > f[e] && (t === null || n.pos < t.pos) && (t = n);
316
+ t === null && s > 0 && (t = {
317
+ pos: (Math.floor(f[e] / s) + 1) * s,
317
318
  algn: "l"
318
319
  }), _[e] = +(t === null), m[e] = t?.pos ?? 0, g[e] = t?.algn === "ctr" ? .5 : +(t?.algn === "r" || t?.algn === "dec"), v[e] = 0;
319
320
  }
320
- y = !0, b = e.tabGap[o], P = -1, x = 0, S = !1;
321
+ y = !0, b = e.tabGap[a], P = -1, x = 0, S = !1;
321
322
  } else if (C.type === "text") {
322
- let i = P >= 0 ? r[P] : void 0;
323
- F = i?.type === "text" ? a.boundaryAdvance?.(i.style, C.style) ?? 0 : null, P = o;
324
- let s = X(e, P, t, n);
325
- x = F === null ? s : s + F, S = !0;
323
+ let r = P >= 0 ? c[P] : void 0;
324
+ F = r?.type === "text" ? i.boundaryAdvance?.(r.style, C.style) ?? 0 : null, P = a;
325
+ let o = X(e, P, t, n);
326
+ x = F === null ? o : o + F, S = !0;
326
327
  } else P = -1, x = C.width, S = !0;
327
328
  }
328
329
  let w;
@@ -335,7 +336,7 @@ function h(t, a) {
335
336
  }
336
337
  w = d[b] + t + e;
337
338
  }
338
- if (w <= i) {
339
+ if (w <= r) {
339
340
  if (n === h) return h;
340
341
  N = n;
341
342
  }
@@ -345,55 +346,55 @@ function h(t, a) {
345
346
  }, X = (e, t, n, r) => t === n ? Y(e, n, r) : Y(e, t, r), Z = new Int32Array(h).fill(-1);
346
347
  x.push(Z);
347
348
  let Q = (e, t) => {
348
- for (let n = e; n < t; n++) Z[n] = y.length - 1, S[r[n].run] = 1;
349
+ for (let n = e; n < t; n++) Z[n] = y.length - 1, S[c[n].run] = 1;
349
350
  }, $ = 0;
350
351
  if (h === 0) {
351
352
  y.push({
352
353
  segments: [],
353
354
  width: 0,
354
- ...t + 1 < s.length ? { endsWithBreak: !0 } : {},
355
- ...g[t] >= 0 ? { lineFeedRun: g[t] } : {},
356
- ..._[t] === void 0 ? {} : { endBreakRun: _[t] }
355
+ ...e + 1 < s.length ? { endsWithBreak: !0 } : {},
356
+ ...g[e] >= 0 ? { lineFeedRun: g[e] } : {},
357
+ ..._[e] === void 0 ? {} : { endBreakRun: _[e] }
357
358
  });
358
359
  continue;
359
360
  }
360
361
  for (; $ < h;) {
361
- let n = y.length, i = a.maxWidth - (n === 0 ? a.firstLineIndent ?? 0 : 0), o = (e) => O !== null && k && D !== void 0 ? a.measureText(O.slice(k[$], k[e]), D) : H($, e, n).width, c = h;
362
- if (Number.isFinite(i) && a.nonMonotoneMeasure) c = ee($, n, i);
363
- else if (Number.isFinite(i)) {
362
+ let n = y.length, r = i.maxWidth - (n === 0 ? i.firstLineIndent ?? 0 : 0), a = (e) => O !== null && k && D !== void 0 ? i.measureText(O.slice(k[$], k[e]), D) : H($, e, n).width, o = h;
363
+ if (Number.isFinite(r) && i.nonMonotoneMeasure) o = ee($, n, r);
364
+ else if (Number.isFinite(r)) {
364
365
  let e = $, t = h, n = 1;
365
366
  for (; e < h;) {
366
- let r = Math.min(h, $ + n);
367
- if (o(r) <= i) {
368
- if (e = r, r === h) break;
367
+ let i = Math.min(h, $ + n);
368
+ if (a(i) <= r) {
369
+ if (e = i, i === h) break;
369
370
  n *= 2;
370
371
  } else {
371
- t = r - 1;
372
+ t = i - 1;
372
373
  break;
373
374
  }
374
375
  }
375
376
  for (; e < t;) {
376
377
  let n = Math.ceil((e + t) / 2);
377
- o(n) <= i ? e = n : t = n - 1;
378
+ a(n) <= r ? e = n : t = n - 1;
378
379
  }
379
- c = e;
380
+ o = e;
380
381
  }
381
- if (c >= h) {
382
- let e = H($, h, n);
383
- t + 1 < s.length && (e.endsWithBreak = !0), y.push(e), Q($, h);
382
+ if (o >= h) {
383
+ let t = H($, h, n);
384
+ e + 1 < s.length && (t.endsWithBreak = !0), y.push(t), Q($, h);
384
385
  break;
385
386
  }
386
387
  let u = 0;
387
- for (let e = $ + 1; e <= c; e++) E[e] && (u = e);
388
- if (u > $ && M(u) && (u = h), M($)) for (u = $ + 2; u < h && !p(r[u]) && r[u].type !== "tab";) u++;
389
- if (u === 0) if (r[$].type === "tab" && c <= $ + 1) {
390
- if (u = $ + 1, u < h && r[u].type === "text") for (u++; u < h && !E[u];) u++;
391
- } else u = Math.max($ + 1, c);
392
- let d = r[u - 1], f = u < h ? r[u] : void 0;
388
+ for (let e = $ + 1; e <= o; e++) E[e] && (u = e);
389
+ if (u > $ && M(u) && (u = h), M($)) for (u = $ + 2; u < h && !p(c[u]) && c[u].type !== "tab";) u++;
390
+ if (u === 0) if (c[$].type === "tab" && o <= $ + 1) {
391
+ if (u = $ + 1, u < h && c[u].type === "text") for (u++; u < h && !E[u];) u++;
392
+ } else u = Math.max($ + 1, o);
393
+ let d = c[u - 1], f = u < h ? c[u] : void 0;
393
394
  if (C && f && (m(d) || m(f)) && (d.run === f.run || I(d, f))) {
394
- let { chars: t, offsets: n } = F(), r = n[$ - P], i = n[u - P];
395
- if (i - r > 1 && i < t.length) {
396
- let a = d.run !== f.run, o = a ? z(u) : $ + 1, s = e(t, i, l, a ? n[o - P] : r + 1), c = i - s;
395
+ let { chars: e, offsets: n } = F(), r = n[$ - P], i = n[u - P];
396
+ if (i - r > 1 && i < e.length) {
397
+ let a = d.run !== f.run, o = a ? z(u) : $ + 1, s = t(e, i, l, a ? n[o - P] : r + 1), c = i - s;
397
398
  if (c > 0) if (a) {
398
399
  let e = o, t = u;
399
400
  for (; e < t;) {
@@ -404,7 +405,7 @@ function h(t, a) {
404
405
  } else u - c > $ && (u -= c);
405
406
  }
406
407
  }
407
- for (y.push(H($, u, n)), Q($, u), $ = u; $ < h && p(r[$]);) $++;
408
+ for (y.push(H($, u, n)), Q($, u), $ = u; $ < h && p(c[$]);) $++;
408
409
  }
409
410
  }
410
411
  for (let e = 0; e < _.length; e++) {
@@ -413,19 +414,19 @@ function h(t, a) {
413
414
  let n = b[e], r = e + 1 < b.length ? b[e + 1] : y.length;
414
415
  r > n && (y[r - 1].endBreakRun = t);
415
416
  }
416
- for (let e = 0; e < t.length; e++) {
417
- if (t[e].type !== "text" || S[e]) continue;
418
- let n = h[e], r = s[n], i = x[n], a = 0, o = r.length;
417
+ for (let t = 0; t < e.length; t++) {
418
+ if (e[t].type !== "text" || S[t]) continue;
419
+ let n = h[t], r = s[n], i = x[n], a = 0, o = r.length;
419
420
  for (; a < o;) {
420
- let t = a + o >> 1;
421
- r[t].run < e ? a = t + 1 : o = t;
421
+ let e = a + o >> 1;
422
+ r[e].run < t ? a = e + 1 : o = e;
422
423
  }
423
424
  let c = b[n];
424
425
  for (let e = a - 1; e >= 0; e--) if (i[e] >= 0) {
425
426
  c = i[e];
426
427
  break;
427
428
  }
428
- (y[c].hiddenRuns ??= []).push(e);
429
+ (y[c].hiddenRuns ??= []).push(t);
429
430
  }
430
431
  return y;
431
432
  }
@@ -597,12 +598,12 @@ function T(e, t) {
597
598
  //#endregion
598
599
  //#region packages/core/src/drawingml-text/stacked-faces.ts
599
600
  var E = 7 / 6;
600
- function D(e, t, n) {
601
- let r = t ? 700 : 400, i = a(e, {
602
- weight: r,
603
- style: n ? "italic" : "normal"
601
+ function D(t, n, r) {
602
+ let i = n ? 700 : 400, a = e(t, {
603
+ weight: i,
604
+ style: r ? "italic" : "normal"
604
605
  });
605
- return i.length === 0 && (i = a(e, { weight: r })), i.length === 0 && (i = a(e)), i.find((e) => e.source === "macos-supplemental") ?? i.find((e) => e.source === "office-mac") ?? i[0];
606
+ return a.length === 0 && (a = e(t, { weight: i })), a.length === 0 && (a = e(t)), a.find((e) => e.source === "macos-supplemental") ?? a.find((e) => e.source === "office-mac") ?? a[0];
606
607
  }
607
608
  function O(e, t, n) {
608
609
  let r = D(e, t, n);
@@ -631,30 +632,30 @@ function j(e, t, n = !1, r = !1) {
631
632
  }
632
633
  //#endregion
633
634
  //#region packages/core/src/drawingml-text/stacked-glyphs.ts
634
- function M(e, t, n, i = !1) {
635
- let a = [], o = r(e);
636
- o.push(e.length);
637
- let s = 0;
638
- for (let r of o) {
639
- let o = e.slice(s, r);
640
- if (s = r, !o) continue;
641
- let c = o.codePointAt(0) ?? 0, l = i ? void 0 : j(t.family, c, t.bold, t.italic);
642
- i || !A(c) ? a.push({
643
- text: o,
635
+ function M(e, t, n, r = !1) {
636
+ let i = [], a = c(e);
637
+ a.push(e.length);
638
+ let o = 0;
639
+ for (let s of a) {
640
+ let a = e.slice(o, s);
641
+ if (o = s, !a) continue;
642
+ let c = a.codePointAt(0) ?? 0, l = r ? void 0 : j(t.family, c, t.bold, t.italic);
643
+ r || !A(c) ? i.push({
644
+ text: a,
644
645
  kind: "upright",
645
646
  advance: n.upright
646
- }) : l ? a.push({
647
- text: o,
647
+ }) : l ? i.push({
648
+ text: a,
648
649
  kind: "verticalGlyph",
649
650
  advance: n.verticalGlyph,
650
651
  ...l === "nominal" ? { nominal: !0 } : {}
651
- }) : a.push({
652
- text: o,
652
+ }) : i.push({
653
+ text: a,
653
654
  kind: "rotated",
654
- advance: n.rotated(o)
655
+ advance: n.rotated(a)
655
656
  });
656
657
  }
657
- return a;
658
+ return i;
658
659
  }
659
660
  function N(e) {
660
661
  return e.nominal ? e.text : P(e.text);
@@ -662,7 +663,7 @@ function N(e) {
662
663
  function P(e) {
663
664
  let t = e.codePointAt(0) ?? 0;
664
665
  if (String.fromCodePoint(t) !== e) return null;
665
- let n = o(t) ?? s(t);
666
+ let n = i(t) ?? a(t);
666
667
  return n === null ? null : String.fromCodePoint(n);
667
668
  }
668
669
  function F(e, t, n, r) {