@silurus/ooxml 0.89.10 → 0.89.12

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 (49) hide show
  1. package/dist/assets/{render-worker-jGsxSIGb.js → render-worker-BD7EhV2y.js} +17 -17
  2. package/dist/assets/render-worker-BiKxVVB1.js +16 -0
  3. package/dist/assets/{render-worker-Coh33rbW.js → render-worker-CVqXtEMW.js} +13 -13
  4. package/dist/{bounded-raw-part-cache-B5a6cGKO.js → bounded-raw-part-cache-D2Q0FIoE.js} +719 -663
  5. package/dist/{canvas-viewer-mechanics-BsqaoYgK.js → canvas-viewer-mechanics-_ZBxW_sN.js} +1 -1
  6. package/dist/{comment-overlay-controller-b3tKmzMa.js → comment-overlay-controller-CVvQCYhQ.js} +8 -8
  7. package/dist/{comment-ui-runtime-Bp37ytDC.js → comment-ui-runtime-CYkt_9-b.js} +2 -2
  8. package/dist/{comment-ui-runtime-BkpFlPT0.js → comment-ui-runtime-DhTTGSay.js} +3 -3
  9. package/dist/{document-model-source-Ca2fk_Fc.js → document-model-source-C6wGN8m3.js} +45 -45
  10. package/dist/{document-pull-client-CTGM4i1m.js → document-pull-client-BfGXPuQc.js} +4117 -4128
  11. package/dist/{document-pull-worker-hMKJ5RdB.js → document-pull-worker-Bl3wlLXC.js} +4 -4
  12. package/dist/{docx-B-47Ff78.js → docx-CNscQaT8.js} +496 -496
  13. package/dist/{docx-DwdB7I59.js → docx-Cry-eklK.js} +7 -7
  14. package/dist/{docx-model-source-CWuvf9jk.js → docx-model-source-Cj8DGdLl.js} +6 -6
  15. package/dist/docx.mjs +3 -3
  16. package/dist/{drawingml-shape-B1_kg4BV.js → drawingml-shape-CFzAXuvj.js} +88 -116
  17. package/dist/{font-preload-demand-NqcVKIpX.js → font-preload-demand-DhFVOxz4.js} +1 -1
  18. package/dist/{host-layout-measure-IFLllYwV.js → host-layout-measure-CWKDrVpo.js} +1 -1
  19. package/dist/index.mjs +3 -3
  20. package/dist/internal-companion.mjs +2 -2
  21. package/dist/{line-distribute-CwtditQo.js → line-distribute-DxnuaRdO.js} +24 -24
  22. package/dist/{model-source-Cch44xsb.js → model-source-DksDDVb4.js} +1 -1
  23. package/dist/{model-source-session-DRcqFGfM.js → model-source-session-8wqlNxsQ.js} +2 -2
  24. package/dist/{model-source-session-ClNCRDOg.js → model-source-session-BogYRDwj.js} +2 -2
  25. package/dist/{model-source-session-DSABX94B.js → model-source-session-ifwyPPhZ.js} +2 -2
  26. package/dist/node.mjs +4 -4
  27. package/dist/{pptx-DbjWegUB.js → pptx-Bons7t3Y.js} +26 -26
  28. package/dist/{pptx-C1CiFW1D.js → pptx-CQtPbMxI.js} +10 -10
  29. package/dist/{pptx-model-source-C9TuBisH.js → pptx-model-source-mg-O0LR9.js} +5 -5
  30. package/dist/pptx.mjs +4 -4
  31. package/dist/{presentation-model-source-DLNioq7T.js → presentation-model-source-CK6_hY1W.js} +5 -5
  32. package/dist/{render-Bf_Gywxw.js → render-C7F07FrC.js} +2 -2
  33. package/dist/{render-worker-host-80mSndWp.js → render-worker-host-Cj-U3WPe.js} +1 -1
  34. package/dist/{render-worker-host-CVr53kg0.js → render-worker-host-D7L6GMbE.js} +1 -1
  35. package/dist/{render-worker-host-pKls3F_t.js → render-worker-host-stI5Lppz.js} +1 -1
  36. package/dist/{renderer-DuYC3xXi.js → renderer-N76SnQW7.js} +1286 -1212
  37. package/dist/{resource-measurement-CfJtbwiR.js → resource-measurement-B2hzmYlu.js} +90 -90
  38. package/dist/{session-DPXK_lpI.js → session-D5au4i-W.js} +166 -166
  39. package/dist/{slide-pull-client-3g6TxaKa.js → slide-pull-client-3mJmNjjB.js} +854 -904
  40. package/dist/{wasm-runtime-generation-D97yoAXz.js → wasm-runtime-generation--_2SjW2G.js} +1 -1
  41. package/dist/{workbook-model-source-D1dmkDMP.js → workbook-model-source-CI1q6nxK.js} +6 -6
  42. package/dist/{worksheet-pull-client-BudfclVl.js → worksheet-pull-client-C2h4AMwt.js} +18 -18
  43. package/dist/{xlsx-DBhYlJKp.js → xlsx-CKXeKvxl.js} +452 -452
  44. package/dist/{xlsx-DA0uR1B1.js → xlsx-DujIp7CR.js} +4 -4
  45. package/dist/{xlsx-model-source-zemVDAfl.js → xlsx-model-source-fs0svOUo.js} +6 -6
  46. package/dist/xlsx.mjs +4 -4
  47. package/dist/xlsx_parser_bg.wasm +0 -0
  48. package/package.json +1 -1
  49. package/dist/assets/render-worker-Ck21oePL.js +0 -16
@@ -1,5 +1,5 @@
1
1
  import { So as e } from "./plot-area-frame-DNYMd9Pf.js";
2
- import { C as t, D as n, E as r, in as i, ln as a, tn as o, un as s, v as c, w as l, y as u } from "./bounded-raw-part-cache-B5a6cGKO.js";
2
+ import { C as t, D as n, E as r, an as i, cn as a, mn as o, pn as s, v as c, w as l, y as u } from "./bounded-raw-part-cache-D2Q0FIoE.js";
3
3
  function d(e, t, n, r, i, a = 0) {
4
4
  let o = e.map((e) => e.width), s = (t) => {
5
5
  let n = 0;
@@ -26,9 +26,9 @@ function d(e, t, n, r, i, a = 0) {
26
26
  }
27
27
  return o;
28
28
  }
29
- 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);
30
- function h(e, s) {
31
- let c = s.sameStyle ?? ((e, t) => e === t), u = [[]], h = [], g = [-1], _ = [], v = 0;
29
+ var f = /^\p{Script_Extensions=Latin}$/u, p = (e) => e.type === "text" && e.text === " ", m = (e) => e.type === "text" && o(e.text.codePointAt(0) ?? 0);
30
+ function h(e, o) {
31
+ let c = o.sameStyle ?? ((e, t) => e === t), u = [[]], h = [], g = [-1], _ = [], v = 0;
32
32
  for (let t of e) {
33
33
  if (h.push(u.length - 1), t.type === "break") {
34
34
  _[u.length - 1] = v, u.push([]), g.push(-1), v++;
@@ -46,7 +46,7 @@ function h(e, s) {
46
46
  }
47
47
  let e = [
48
48
  0,
49
- ...i(t.text),
49
+ ...a(t.text),
50
50
  t.text.length
51
51
  ];
52
52
  for (let n = 0; n + 1 < e.length; n++) {
@@ -66,45 +66,45 @@ function h(e, s) {
66
66
  }
67
67
  let y = [], b = [], x = [], S = new Uint8Array(e.length);
68
68
  for (let e = 0; e < u.length; e++) {
69
- let i = u[e];
70
- if (b.push(y.length), e === u.length - 1) for (; i.length > 0 && p(i.at(-1));) i.pop();
71
- let h = i.length, v = /* @__PURE__ */ new Set();
72
- if (i.some((e) => e.type === "text" && o(e.text))) {
69
+ let a = u[e];
70
+ if (b.push(y.length), e === u.length - 1) for (; a.length > 0 && p(a.at(-1));) a.pop();
71
+ let h = a.length, v = /* @__PURE__ */ new Set();
72
+ if (a.some((e) => e.type === "text" && i(e.text))) {
73
73
  let e = "", t = [0];
74
- for (let n of i) e += n.type === "text" ? n.text : "", t.push(e.length);
75
- let n = new Set(a(e, { cjk: !0 }));
74
+ for (let n of a) e += n.type === "text" ? n.text : "", t.push(e.length);
75
+ let n = new Set(s(e, { cjk: !0 }));
76
76
  for (let e = 1; e < t.length; e++) n.has(t[e]) && v.add(e);
77
77
  }
78
- let C = s.eastAsianLineBreak !== !1, w = (e) => e === 160 || e === 8239 || e === 8288 || e === 65279, T = (e) => {
78
+ let C = o.eastAsianLineBreak !== !1, w = (e) => e === 160 || e === 8239 || e === 8288 || e === 65279, T = (e) => {
79
79
  if (e <= 0 || e >= h) return !1;
80
- let n = i[e - 1], r = i[e];
80
+ let n = a[e - 1], r = a[e];
81
81
  if (r.type === "tab") return !0;
82
82
  if (n.type === "tab") return !1;
83
83
  if (p(n) || p(r) || v.has(e) || n.type === "object" || r.type === "object") return !0;
84
- let a = [...n.text].at(-1)?.codePointAt(0), o = r.text.codePointAt(0);
85
- if (a === void 0 || o === void 0) return !1;
86
- if (a === 8203 || !C && (m(n) || m(r)) && !w(a) && !w(o)) return !0;
87
- if (t(a, o)) return !1;
84
+ let i = [...n.text].at(-1)?.codePointAt(0), o = r.text.codePointAt(0);
85
+ if (i === void 0 || o === void 0) return !1;
86
+ if (i === 8203 || !C && (m(n) || m(r)) && !w(i) && !w(o)) return !0;
87
+ if (t(i, o)) return !1;
88
88
  if (m(n) || m(r)) return !0;
89
- if (e > 1 && (l(a) === "HY" || l(a) === "HH")) {
90
- let t = i[e - 2];
89
+ if (e > 1 && (l(i) === "HY" || l(i) === "HH")) {
90
+ let t = a[e - 2];
91
91
  if (t.type === "text" && f.test([...t.text].at(-1) ?? "") && f.test([...r.text][0] ?? "")) return !0;
92
92
  }
93
93
  return !1;
94
94
  }, E = new Uint8Array(h + 1);
95
95
  for (let e = 1; e < h; e++) E[e] = +!!T(e);
96
- let D = i[0]?.style, O = h > 0 && i.every((e) => e.type === "text" && c(D, e.style)) ? i.map((e) => e.type === "text" ? e.text : "").join("") : null, k = O === null ? null : new Int32Array(h + 1);
96
+ let D = a[0]?.style, O = h > 0 && a.every((e) => e.type === "text" && c(D, e.style)) ? a.map((e) => e.type === "text" ? e.text : "").join("") : null, k = O === null ? null : new Int32Array(h + 1);
97
97
  if (k) for (let e = 0; e < h; e++) {
98
- let t = i[e];
98
+ let t = a[e];
99
99
  k[e + 1] = k[e] + (t.type === "text" ? t.text.length : 0);
100
100
  }
101
101
  let A = null, j = 0, M = (e) => {
102
- let t = i[e], n = i[e + 1];
103
- if (t?.type !== "tab" || !s.tabStops?.length || n?.type !== "text" || !/^[\p{Script_Extensions=Latin}\p{Number}]$/u.test(n.text)) return !1;
102
+ let t = a[e], n = a[e + 1];
103
+ if (t?.type !== "tab" || !o.tabStops?.length || n?.type !== "text" || !/^[\p{Script_Extensions=Latin}\p{Number}]$/u.test(n.text)) return !1;
104
104
  if (A === null) {
105
105
  j = $, A = new Uint8Array(h - j + 1), A[h - j] = 1;
106
106
  for (let e = h - 1; e >= j; e--) {
107
- let t = i[e], n = e - j;
107
+ let t = a[e], n = e - j;
108
108
  A[n] = A[n + 1] && t.type === "text" && !p(t) && !m(t) ? 1 : 0;
109
109
  }
110
110
  }
@@ -114,7 +114,7 @@ function h(e, s) {
114
114
  P = $;
115
115
  let e = [], t = new Int32Array(h - P + 1);
116
116
  for (let n = P; n < h; n++) {
117
- let r = i[n];
117
+ let r = a[n];
118
118
  if (r.type === "text") for (let t of r.text) e.push(t);
119
119
  t[n + 1 - P] = e.length;
120
120
  }
@@ -124,12 +124,12 @@ function h(e, s) {
124
124
  };
125
125
  }
126
126
  return N;
127
- }, I = (e, t) => e.type === "text" && t.type === "text" && s.kinsokuAcrossRuns?.(e.style, t.style, e.text, t.text) === !0, L = null, R = 0, z = (e) => {
127
+ }, I = (e, t) => e.type === "text" && t.type === "text" && o.kinsokuAcrossRuns?.(e.style, t.style, e.text, t.text) === !0, L = null, R = 0, z = (e) => {
128
128
  if (L === null) {
129
129
  R = $, L = new Int32Array(h - $ + 1);
130
130
  let e = $ + 1;
131
131
  for (let t = $ + 1; t < h; t++) {
132
- let n = i[t - 1], r = i[t];
132
+ let n = a[t - 1], r = a[t];
133
133
  (n.type !== "text" || r.type !== "text" || n.run !== r.run && !I(n, r)) && (e = t), L[t - R] = e;
134
134
  }
135
135
  }
@@ -160,23 +160,23 @@ function h(e, s) {
160
160
  }, V = (e, t) => {
161
161
  let n = 0, r = e.map((t, r) => {
162
162
  if (t.type === "text") {
163
- t.width = s.measureText(t.text, t.style);
163
+ t.width = o.measureText(t.text, t.style);
164
164
  let n = e[r - 1];
165
- n?.type === "text" && (t.width += s.boundaryAdvance?.(n.style, t.style) ?? 0);
165
+ n?.type === "text" && (t.width += o.boundaryAdvance?.(n.style, t.style) ?? 0);
166
166
  }
167
- return t.type === "tab" && (t.width = 0, n = s.measureText(" ", t.style)), {
167
+ return t.type === "tab" && (t.width = 0, n = o.measureText(" ", t.style)), {
168
168
  isTab: t.type === "tab",
169
169
  width: t.width
170
170
  };
171
171
  });
172
172
  if (r.some((e) => e.isTab)) {
173
- let i = d(r, s.tabStops ?? [], s.tabStartPen?.(t) ?? (t === 0 ? s.firstLineIndent ?? 0 : 0), Infinity, n, s.defaultTabSize ?? 0);
173
+ let i = d(r, o.tabStops ?? [], o.tabStartPen?.(t) ?? (t === 0 ? o.firstLineIndent ?? 0 : 0), Infinity, n, o.defaultTabSize ?? 0);
174
174
  for (let t = 0; t < e.length; t++) e[t].width = i[t];
175
175
  }
176
176
  return e.reduce((e, t) => e + t.width, 0);
177
177
  }, H = (e, t, n) => {
178
178
  if (O !== null && k && D !== void 0) {
179
- let n = O.slice(k[e], k[t]), r = s.measureText(n, D);
179
+ let n = O.slice(k[e], k[t]), r = o.measureText(n, D);
180
180
  return {
181
181
  segments: [{
182
182
  type: "text",
@@ -188,7 +188,7 @@ function h(e, s) {
188
188
  };
189
189
  }
190
190
  let r = [];
191
- for (let n = e; n < t; n++) B(r, i[n]);
191
+ for (let n = e; n < t; n++) B(r, a[n]);
192
192
  return {
193
193
  segments: r,
194
194
  width: V(r, n)
@@ -196,7 +196,7 @@ function h(e, s) {
196
196
  }, U = null, W = (e, t) => {
197
197
  let n = "";
198
198
  for (let r = e; r < t; r++) {
199
- let e = i[r];
199
+ let e = a[r];
200
200
  e.type === "text" && (n += e.text);
201
201
  }
202
202
  return n;
@@ -208,33 +208,33 @@ function h(e, s) {
208
208
  }
209
209
  return t;
210
210
  }, K = () => {
211
- let e = new Int32Array(h).fill(-1), t = new Int32Array(h).fill(-1), n = new Float64Array(h).fill(NaN), r = new Float64Array(h), a = new Float64Array(h + 1), o = new Float64Array(h + 1), l = new Int32Array(h + 1), u = -1, d, f = null, p = 0, m = 0, g = (e) => {
211
+ let e = new Int32Array(h).fill(-1), t = new Int32Array(h).fill(-1), n = new Float64Array(h).fill(NaN), r = new Float64Array(h), i = 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) => {
212
212
  for (let n = u; u >= 0 && n < e; n++) t[n] = e;
213
213
  };
214
214
  for (let t = 0; t < h; t++) {
215
- let h = i[t];
216
- if (l[t + 1] = l[t] + +(h.type === "tab"), h.type === "text" && u >= 0 && c(d, h.style) || (g(t), p = o[t], h.type === "text" ? (f = u >= 0 ? s.boundaryAdvance?.(d, h.style) ?? 0 : null, u = t, d = h.style) : (u = -1, d = void 0)), h.type === "text") {
215
+ let h = a[t];
216
+ if (l[t + 1] = l[t] + +(h.type === "tab"), h.type === "text" && u >= 0 && c(d, h.style) || (g(t), p = s[t], h.type === "text" ? (f = u >= 0 ? o.boundaryAdvance?.(d, h.style) ?? 0 : null, u = t, d = h.style) : (u = -1, d = void 0)), h.type === "text") {
217
217
  let i = d;
218
- if (e[t] = u, t - u <= 8) m = s.measureText(W(u, t + 1), i), n[t] = m;
218
+ if (e[t] = u, t - u <= 8) m = o.measureText(W(u, t + 1), i), n[t] = m;
219
219
  else {
220
220
  let e = W(t - 8, t);
221
- r[t] = s.measureText(e + h.text, i) - s.measureText(e, i), m += r[t];
221
+ r[t] = o.measureText(e + h.text, i) - o.measureText(e, i), m += r[t];
222
222
  }
223
- o[t + 1] = p + (f === null ? m : m + f);
224
- } else o[t + 1] = p + (h.type === "object" ? h.width : 0);
225
- a[t + 1] = a[t] + r[t];
223
+ s[t + 1] = p + (f === null ? m : m + f);
224
+ } else s[t + 1] = p + (h.type === "object" ? h.width : 0);
225
+ i[t + 1] = i[t] + r[t];
226
226
  }
227
227
  g(h);
228
228
  let _ = new Float64Array(h + 1);
229
- _[h] = o[h];
230
- for (let e = h - 1; e >= 0; e--) _[e] = Math.min(o[e], _[e + 1]);
229
+ _[h] = s[h];
230
+ for (let e = h - 1; e >= 0; e--) _[e] = Math.min(s[e], _[e + 1]);
231
231
  let v = new Float64Array(h + 1).fill(Infinity);
232
- for (let e = h; e >= 1; e--) i[e - 1].type === "text" && (v[e] = e === t[e - 1] ? a[e] : Math.min(a[e], v[e + 1]));
232
+ for (let e = h; e >= 1; e--) a[e - 1].type === "text" && (v[e] = e === t[e - 1] ? i[e] : Math.min(i[e], v[e + 1]));
233
233
  let y = new Int32Array(h), b = [];
234
234
  for (let e = 0; e < h; e++) {
235
- let t = i[e];
236
- if (t.type !== "tab" || (s.defaultTabSize ?? 0) > 0) continue;
237
- let n = s.measureText(" ", t.style), r = b.indexOf(n);
235
+ let t = a[e];
236
+ if (t.type !== "tab" || (o.defaultTabSize ?? 0) > 0) continue;
237
+ let n = o.measureText(" ", t.style), r = b.indexOf(n);
238
238
  r < 0 && (r = b.push(n) - 1), y[e] = r;
239
239
  }
240
240
  return b.length === 0 && b.push(0), {
@@ -242,10 +242,10 @@ function h(e, s) {
242
242
  segEnd: t,
243
243
  head: n,
244
244
  tail: r,
245
- tailSum: a,
246
- tailBlockMin: G(a),
247
- natural: o,
248
- naturalBlockMin: G(o),
245
+ tailSum: i,
246
+ tailBlockMin: G(i),
247
+ natural: s,
248
+ naturalBlockMin: G(s),
249
249
  naturalSuffixMin: _,
250
250
  tailSuffixMin: v,
251
251
  tabsBefore: l,
@@ -269,34 +269,34 @@ function h(e, s) {
269
269
  let r = Math.min(n, t + 8 + 1) - 1;
270
270
  return e.head[r] + (e.tailSum[n] - e.tailSum[r + 1]);
271
271
  }
272
- let r = Math.min(n, t + 8 + 1), a = J.get(r);
273
- return a === void 0 && (a = s.measureText(W(t, r), i[t].style), J.set(r, a)), a + (e.tailSum[n] - e.tailSum[r]);
272
+ let r = Math.min(n, t + 8 + 1), i = J.get(r);
273
+ return i === void 0 && (i = o.measureText(W(t, r), a[t].style), J.set(r, i)), i + (e.tailSum[n] - e.tailSum[r]);
274
274
  }, ee = (e, t, n) => {
275
275
  let r = U ??= K();
276
276
  if (J.clear(), r.tabsBefore[h] !== r.tabsBefore[e]) return te(r, e, t, n);
277
- let a = i[e], o = a.type === "text" ? r.segEnd[e] : e + 1, c = a.type === "text" ? Y(r, e, o) : a.type === "object" ? a.width : 0;
278
- if (o < h) {
279
- let t = i[o], l = a.type === "text" && t.type === "text" && s.boundaryAdvance ? s.boundaryAdvance(a.style, t.style) - s.boundaryAdvance(i[r.segStart[e]].style, t.style) : 0, u = q(r.natural, r.naturalBlockMin, c + l - r.natural[o], o, h, n);
277
+ let i = a[e], s = i.type === "text" ? r.segEnd[e] : e + 1, c = i.type === "text" ? Y(r, e, s) : i.type === "object" ? i.width : 0;
278
+ if (s < h) {
279
+ let t = a[s], l = i.type === "text" && t.type === "text" && o.boundaryAdvance ? o.boundaryAdvance(i.style, t.style) - o.boundaryAdvance(a[r.segStart[e]].style, t.style) : 0, u = q(r.natural, r.naturalBlockMin, c + l - r.natural[s], s, h, n);
280
280
  if (u >= 0) return u;
281
281
  }
282
- if (c <= n) return o;
283
- if (a.type !== "text") return e;
282
+ if (c <= n) return s;
283
+ if (i.type !== "text") return e;
284
284
  let l = e + 8 + 1;
285
- if (o - 1 > l) {
286
- let t = Y(r, e, l) - r.tailSum[l], i = q(r.tailSum, r.tailBlockMin, t, l, o - 1, n);
285
+ if (s - 1 > l) {
286
+ let t = Y(r, e, l) - r.tailSum[l], i = q(r.tailSum, r.tailBlockMin, t, l, s - 1, n);
287
287
  if (i >= 0) return i;
288
288
  }
289
- for (let t = Math.min(o - 1, l); t > e; t--) if (Y(r, e, t) <= n) return t;
289
+ for (let t = Math.min(s - 1, l); t > e; t--) if (Y(r, e, t) <= n) return t;
290
290
  return e;
291
291
  }, te = (e, t, n, r) => {
292
- let a = s.tabStartPen?.(n) ?? (n === 0 ? s.firstLineIndent ?? 0 : 0), o = s.tabStops ?? [], c = s.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 = i[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 = i[w], D = T + (w < h && C.type === "text" && E.type === "text" && s.boundaryAdvance ? s.boundaryAdvance(C.style, E.style) - s.boundaryAdvance(i[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) => {
292
+ let i = o.tabStartPen?.(n) ?? (n === 0 ? o.firstLineIndent ?? 0 : 0), s = o.tabStops ?? [], c = o.defaultTabSize ?? 0, l = e.gapValues, u = l.length, d = new Float64Array(u), f = new Float64Array(u).fill(i), 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 = a[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 = a[w], D = T + (w < h && C.type === "text" && E.type === "text" && o.boundaryAdvance ? o.boundaryAdvance(C.style, E.style) - o.boundaryAdvance(a[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) => {
293
293
  if (!A || t < O && t < w) return !1;
294
294
  let n = Infinity;
295
295
  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;
296
296
  }, N = t, P = -1, F = null;
297
297
  for (let n = t + 1; n <= h; n++) {
298
- let a = n - 1, C = i[a];
299
- if (C.type === "text" && P >= 0 && e.segStart[a] === e.segStart[a - 1]) {
298
+ let i = n - 1, C = a[i];
299
+ if (C.type === "text" && P >= 0 && e.segStart[i] === e.segStart[i - 1]) {
300
300
  let r = X(e, P, t, n);
301
301
  x = F === null ? r : r + F;
302
302
  } else {
@@ -309,18 +309,18 @@ function h(e, s) {
309
309
  }
310
310
  p[e] = f[e];
311
311
  let t = null;
312
- for (let n of o) n.pos > f[e] && (t === null || n.pos < t.pos) && (t = n);
312
+ for (let n of s) n.pos > f[e] && (t === null || n.pos < t.pos) && (t = n);
313
313
  t === null && c > 0 && (t = {
314
314
  pos: (Math.floor(f[e] / c) + 1) * c,
315
315
  algn: "l"
316
316
  }), _[e] = +(t === null), m[e] = t?.pos ?? 0, g[e] = t?.algn === "ctr" ? .5 : +(t?.algn === "r" || t?.algn === "dec"), v[e] = 0;
317
317
  }
318
- y = !0, b = e.tabGap[a], P = -1, x = 0, S = !1;
318
+ y = !0, b = e.tabGap[i], P = -1, x = 0, S = !1;
319
319
  } else if (C.type === "text") {
320
- let r = P >= 0 ? i[P] : void 0;
321
- F = r?.type === "text" ? s.boundaryAdvance?.(r.style, C.style) ?? 0 : null, P = a;
322
- let o = X(e, P, t, n);
323
- x = F === null ? o : o + F, S = !0;
320
+ let r = P >= 0 ? a[P] : void 0;
321
+ F = r?.type === "text" ? o.boundaryAdvance?.(r.style, C.style) ?? 0 : null, P = i;
322
+ let s = X(e, P, t, n);
323
+ x = F === null ? s : s + F, S = !0;
324
324
  } else P = -1, x = C.width, S = !0;
325
325
  }
326
326
  let w;
@@ -343,7 +343,7 @@ function h(e, s) {
343
343
  }, X = (e, t, n, r) => t === n ? Y(e, n, r) : Y(e, t, r), Z = new Int32Array(h).fill(-1);
344
344
  x.push(Z);
345
345
  let Q = (e, t) => {
346
- for (let n = e; n < t; n++) Z[n] = y.length - 1, S[i[n].run] = 1;
346
+ for (let n = e; n < t; n++) Z[n] = y.length - 1, S[a[n].run] = 1;
347
347
  }, $ = 0;
348
348
  if (h === 0) {
349
349
  y.push({
@@ -356,13 +356,13 @@ function h(e, s) {
356
356
  continue;
357
357
  }
358
358
  for (; $ < h;) {
359
- let t = y.length, a = s.maxWidth - (t === 0 ? s.firstLineIndent ?? 0 : 0), o = (e) => O !== null && k && D !== void 0 ? s.measureText(O.slice(k[$], k[e]), D) : H($, e, t).width, c = h;
360
- if (Number.isFinite(a) && s.nonMonotoneMeasure) c = ee($, t, a);
361
- else if (Number.isFinite(a)) {
359
+ let t = y.length, i = o.maxWidth - (t === 0 ? o.firstLineIndent ?? 0 : 0), s = (e) => O !== null && k && D !== void 0 ? o.measureText(O.slice(k[$], k[e]), D) : H($, e, t).width, c = h;
360
+ if (Number.isFinite(i) && o.nonMonotoneMeasure) c = ee($, t, i);
361
+ else if (Number.isFinite(i)) {
362
362
  let e = $, t = h, n = 1;
363
363
  for (; e < h;) {
364
364
  let r = Math.min(h, $ + n);
365
- if (o(r) <= a) {
365
+ if (s(r) <= i) {
366
366
  if (e = r, r === h) break;
367
367
  n *= 2;
368
368
  } else {
@@ -372,7 +372,7 @@ function h(e, s) {
372
372
  }
373
373
  for (; e < t;) {
374
374
  let n = Math.ceil((e + t) / 2);
375
- o(n) <= a ? e = n : t = n - 1;
375
+ s(n) <= i ? e = n : t = n - 1;
376
376
  }
377
377
  c = e;
378
378
  }
@@ -383,11 +383,11 @@ function h(e, s) {
383
383
  }
384
384
  let l = 0;
385
385
  for (let e = $ + 1; e <= c; e++) E[e] && (l = e);
386
- if (l > $ && M(l) && (l = h), M($)) for (l = $ + 2; l < h && !p(i[l]) && i[l].type !== "tab";) l++;
387
- if (l === 0) if (i[$].type === "tab" && c <= $ + 1) {
388
- if (l = $ + 1, l < h && i[l].type === "text") for (l++; l < h && !E[l];) l++;
386
+ if (l > $ && M(l) && (l = h), M($)) for (l = $ + 2; l < h && !p(a[l]) && a[l].type !== "tab";) l++;
387
+ if (l === 0) if (a[$].type === "tab" && c <= $ + 1) {
388
+ if (l = $ + 1, l < h && a[l].type === "text") for (l++; l < h && !E[l];) l++;
389
389
  } else l = Math.max($ + 1, c);
390
- let d = i[l - 1], f = l < h ? i[l] : void 0;
390
+ let d = a[l - 1], f = l < h ? a[l] : void 0;
391
391
  if (C && f && (m(d) || m(f)) && (d.run === f.run || I(d, f))) {
392
392
  let { chars: e, offsets: t } = F(), i = t[$ - P], a = t[l - P];
393
393
  if (a - i > 1 && a < e.length) {
@@ -402,7 +402,7 @@ function h(e, s) {
402
402
  } else l - u > $ && (l -= u);
403
403
  }
404
404
  }
405
- for (y.push(H($, l, t)), Q($, l), $ = l; $ < h && p(i[$]);) $++;
405
+ for (y.push(H($, l, t)), Q($, l), $ = l; $ < h && p(a[$]);) $++;
406
406
  }
407
407
  }
408
408
  for (let e = 0; e < _.length; e++) {
@@ -620,29 +620,29 @@ function j(e, t, n = !1, r = !1) {
620
620
  return i?.stackedVerticalGlyphs?.includes(a) ? "vert" : t >= 128 && i?.stackedVrt2OnlyGlyphs?.includes(a) ? "nominal" : void 0;
621
621
  }
622
622
  function M(e, t, n, r = !1) {
623
- let a = [], o = i(e);
623
+ let i = [], o = a(e);
624
624
  o.push(e.length);
625
625
  let s = 0;
626
- for (let i of o) {
627
- let o = e.slice(s, i);
628
- if (s = i, !o) continue;
626
+ for (let a of o) {
627
+ let o = e.slice(s, a);
628
+ if (s = a, !o) continue;
629
629
  let c = o.codePointAt(0) ?? 0, l = r ? void 0 : j(t.family, c, t.bold, t.italic);
630
- r || !A(c) ? a.push({
630
+ r || !A(c) ? i.push({
631
631
  text: o,
632
632
  kind: "upright",
633
633
  advance: n.upright
634
- }) : l ? a.push({
634
+ }) : l ? i.push({
635
635
  text: o,
636
636
  kind: "verticalGlyph",
637
637
  advance: n.verticalGlyph,
638
638
  ...l === "nominal" ? { nominal: !0 } : {}
639
- }) : a.push({
639
+ }) : i.push({
640
640
  text: o,
641
641
  kind: "rotated",
642
642
  advance: n.rotated(o)
643
643
  });
644
644
  }
645
- return a;
645
+ return i;
646
646
  }
647
647
  function N(e) {
648
648
  return e.nominal ? e.text : P(e.text);