@silurus/ooxml 0.82.1 → 0.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -3
- package/dist/assets/{render-worker-Cy-QsDge.js → render-worker-Bu31cf1J.js} +4 -4
- package/dist/assets/render-worker-DuztdEcX.js +11 -0
- package/dist/{canvas-viewer-mechanics-CS_qbr6T.js → canvas-viewer-mechanics-h07vpVOQ.js} +42 -2
- package/dist/{comment-ui-runtime-C1RV_3iu.js → comment-ui-runtime-BelHJt73.js} +2 -2
- package/dist/{comment-ui-runtime-DgCZpPR0.js → comment-ui-runtime-DD5a3x3k.js} +2 -2
- package/dist/{comments-Cf9W7r3M.js → comments-AAaNnQTi.js} +7 -2
- package/dist/{document-pull-client-B1WOjA0z.js → document-pull-client-BAhqoTmm.js} +4508 -3952
- package/dist/docx-Dg73PGgC.js +2707 -0
- package/dist/docx.mjs +6 -6
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/dom-interaction-boundary-CepOlXt6.js +217 -0
- package/dist/index.mjs +4 -4
- package/dist/line-distribute-D7A_wnJg.js +1003 -0
- package/dist/{line-metrics-B3syvDn2.js → line-metrics-Bpn7OeZD.js} +616 -616
- package/dist/node.mjs +308 -308
- package/dist/pptx-BcUCETmQ.js +2990 -0
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-BC8p7vZQ.js → render-CL-7V3E8.js} +1 -1
- package/dist/{render-worker-host-DhnkTyjj.js → render-worker-host-DDZo0feh.js} +1 -1
- package/dist/{render-worker-host-BNnXCtAu.js → render-worker-host-FJ19-fUI.js} +1 -1
- package/dist/{resource-measurement-CsW4_eYt.js → resource-measurement-DuiFWzam.js} +3 -3
- package/dist/{session-Da7LEQUB.js → session-BjydZEDF.js} +107 -94
- package/dist/{slide-pull-client-Bg9DusLX.js → slide-pull-client-CwvvncPA.js} +1158 -935
- package/dist/types/docx.d.ts +98 -8
- package/dist/types/index.d.ts +184 -13
- package/dist/types/node.d.ts +2 -2
- package/dist/types/pptx.d.ts +94 -5
- package/dist/types/xlsx.d.ts +2 -2
- package/dist/{worksheet-pull-client-CYtwXP5D.js → worksheet-pull-client-DyFsDF4A.js} +32 -32
- package/dist/{xlsx-DMWeXT-c.js → xlsx-BibrHQ52.js} +476 -476
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +3 -1
- package/dist/assets/render-worker-aHayzR7v.js +0 -11
- package/dist/docx-HoZXZUPA.js +0 -2162
- package/dist/dom-interaction-boundary-C8F6HO5x.js +0 -119
- package/dist/line-distribute-iXsUCIH-.js +0 -1003
- package/dist/pptx-DEUP4Yq5.js +0 -2432
- /package/dist/{comment-occurrence-C34fWs_F.js → comment-occurrence-X54si2ob.js} +0 -0
- /package/dist/{highlight-rect-MaCt0om0.js → highlight-rect-Hes0z_Mj.js} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { t as e } from "./chunk-DmhlhrBa.js";
|
|
2
|
-
import {
|
|
3
|
-
import { C as
|
|
2
|
+
import { $ as t, A as n, At as r, B as i, C as a, Ct as o, D as s, Dt as c, Et as l, Ht as u, M as d, Mt as f, Nt as p, O as m, Ot as h, Pt as g, Qt as _, R as v, S as y, T as b, V as x, Vt as S, W as C, Zt as w, _ as T, a as E, at as D, c as O, d as k, dt as A, et as j, f as M, ft as N, g as ee, h as P, it as F, j as te, jt as I, lt as L, m as R, n as z, nt as ne, p as B, rt as V, s as re, tt as H, u as ie, ut as U, w as ae, y as oe, z as se } from "./line-metrics-Bpn7OeZD.js";
|
|
3
|
+
import { C as ce, E as le, S as ue, T as de, _ as fe, a as pe, b as me, d as W, f as G, h as K, i as he, l as ge, m as _e, p as ve, t as ye, u as q, v as be, w as xe, x as Se, y as Ce } from "./canvas-viewer-mechanics-h07vpVOQ.js";
|
|
4
4
|
import { a as we, i as Te, t as Ee } from "./bounded-raw-part-cache-C6ro6Ezf.js";
|
|
5
5
|
import { C as De, _ as J, c as Oe, cn as ke, h as Ae, in as je, k as Me, l as Ne, ln as Pe, nn as Fe, o as Ie, s as Le, un as Re, v as ze, w as Be } from "./plot-area-frame-DHV02PJU.js";
|
|
6
6
|
import { a as Ve, i as Y, r as He } from "./units-BzZ0gAxs.js";
|
|
7
7
|
import { L as Ue } from "./three-d-7MaVzQuZ.js";
|
|
8
8
|
import { k as We } from "./renderer-CYr9YTXM.js";
|
|
9
|
-
import { i as Ge } from "./resource-measurement-
|
|
9
|
+
import { i as Ge } from "./resource-measurement-DuiFWzam.js";
|
|
10
10
|
import { n as Ke } from "./renderer-module-contract-DLbb7zY0.js";
|
|
11
11
|
import { n as qe, r as Je, t as Ye } from "./visible-index-BFE3PWiY.js";
|
|
12
|
-
import { a as Xe, c as Ze, d as Qe, i as $e, l as et, n as tt, o as nt, s as rt, t as it, u as at } from "./worksheet-pull-client-
|
|
12
|
+
import { a as Xe, c as Ze, d as Qe, i as $e, l as et, n as tt, o as nt, s as rt, t as it, u as at } from "./worksheet-pull-client-DyFsDF4A.js";
|
|
13
13
|
//#region packages/core/src/sparkline/renderer.ts
|
|
14
14
|
function ot(e, t, n) {
|
|
15
15
|
let { values: r } = n;
|
|
@@ -96,7 +96,7 @@ function lt(e, t, n, r, i, a) {
|
|
|
96
96
|
//#endregion
|
|
97
97
|
//#region packages/core/src/text/bidi/segments.ts
|
|
98
98
|
function ut(e, t) {
|
|
99
|
-
return e === !0 ? "rtl" : e === !1 ? "ltr" :
|
|
99
|
+
return e === !0 ? "rtl" : e === !1 ? "ltr" : d().computeLevels(t, "auto").paragraphLevel === 1 ? "rtl" : "ltr";
|
|
100
100
|
}
|
|
101
101
|
//#endregion
|
|
102
102
|
//#region packages/xlsx/src/worker.ts?worker&inline
|
|
@@ -1200,7 +1200,7 @@ function Nn(e, t) {
|
|
|
1200
1200
|
var Pn = u;
|
|
1201
1201
|
function Fn(e, t) {
|
|
1202
1202
|
let n = Pn;
|
|
1203
|
-
return new
|
|
1203
|
+
return new _(`XLSX renderer ${e.resource} exceeded its hard limit of ${n} entries`, {
|
|
1204
1204
|
stage: "rendering",
|
|
1205
1205
|
violation: {
|
|
1206
1206
|
format: "xlsx",
|
|
@@ -1466,13 +1466,13 @@ var tr = (e) => {
|
|
|
1466
1466
|
return typeof t == "string" ? t : void 0;
|
|
1467
1467
|
};
|
|
1468
1468
|
function nr(e, t) {
|
|
1469
|
-
let n = e === 2 ||
|
|
1469
|
+
let n = e === 2 || te(t);
|
|
1470
1470
|
return {
|
|
1471
1471
|
needBidi: n,
|
|
1472
1472
|
baseRtl: n && er(e, t)
|
|
1473
1473
|
};
|
|
1474
1474
|
}
|
|
1475
|
-
function rr(e,
|
|
1475
|
+
function rr(e, t) {
|
|
1476
1476
|
let r = e.length;
|
|
1477
1477
|
if (r === 0) return {
|
|
1478
1478
|
order: [],
|
|
@@ -1484,7 +1484,7 @@ function rr(e, n) {
|
|
|
1484
1484
|
let n = tr(e[t]) ?? "";
|
|
1485
1485
|
i += n.length > 0 ? n : "";
|
|
1486
1486
|
}
|
|
1487
|
-
let { levels: o, paragraphLevel: s } =
|
|
1487
|
+
let { levels: o, paragraphLevel: s } = d().computeLevels(i, t ? "rtl" : "ltr"), { order: c, segLevels: l } = n(o, s, a), u = Array(r);
|
|
1488
1488
|
for (let e = 0; e < r; e++) u[e] = (l[e] & 1) == 1;
|
|
1489
1489
|
return {
|
|
1490
1490
|
order: c,
|
|
@@ -1782,18 +1782,18 @@ function fr(e, t) {
|
|
|
1782
1782
|
//#endregion
|
|
1783
1783
|
//#region packages/xlsx/src/vertical-text.ts
|
|
1784
1784
|
function pr(e, t, n, r, i, a = !1) {
|
|
1785
|
-
let o = t.codePointAt(0) ?? 0, s =
|
|
1786
|
-
if (a &&
|
|
1785
|
+
let o = t.codePointAt(0) ?? 0, s = M(o);
|
|
1786
|
+
if (a && B(o)) {
|
|
1787
1787
|
e.save(), e.translate(n, r + i / 2), e.textAlign = "center", e.textBaseline = "middle", O(e, () => e.fillText(t, 0, 0)), e.restore();
|
|
1788
1788
|
return;
|
|
1789
1789
|
}
|
|
1790
1790
|
if (s === "Tr") {
|
|
1791
|
-
let a =
|
|
1791
|
+
let a = ie(o);
|
|
1792
1792
|
if (a !== null) {
|
|
1793
1793
|
e.fillText(String.fromCodePoint(a), n, r);
|
|
1794
1794
|
return;
|
|
1795
1795
|
}
|
|
1796
|
-
if (
|
|
1796
|
+
if (R(o)) {
|
|
1797
1797
|
e.fillText(t, n, r);
|
|
1798
1798
|
return;
|
|
1799
1799
|
}
|
|
@@ -1813,12 +1813,12 @@ function mr(e) {
|
|
|
1813
1813
|
function hr(e, t) {
|
|
1814
1814
|
return t ? `${e}|duo:${t.clr1}:${t.clr2}` : e;
|
|
1815
1815
|
}
|
|
1816
|
-
var gr =
|
|
1816
|
+
var gr = l.map((e) => `"${e}"`).join(", "), _r = c.map((e) => `"${e}"`).join(", "), vr = `"Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${gr}, sans-serif`, yr = `"Cambria", "Caladea", "Times New Roman", "Liberation Serif", "Noto Naskh Arabic", "Noto Sans Arabic", ${_r}, serif`, br = "\"Courier New\", \"Liberation Mono\", monospace";
|
|
1817
1817
|
function xr(e) {
|
|
1818
|
-
let t = e ?
|
|
1818
|
+
let t = e ? I(e) : null, n = f(e);
|
|
1819
1819
|
if (!t) return n === "serif" ? yr : n === "mono" ? br : vr;
|
|
1820
|
-
let
|
|
1821
|
-
return `${
|
|
1820
|
+
let i = n === "serif";
|
|
1821
|
+
return `${r(t, i ? "serif" : "sans").map((e) => `"${e}"`).join(", ")}, "Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${i ? _r : gr}, ${i ? "serif" : "sans-serif"}`;
|
|
1822
1822
|
}
|
|
1823
1823
|
function Sr(e) {
|
|
1824
1824
|
return e ? `"${e}", ${xr(e)}` : vr;
|
|
@@ -2105,7 +2105,7 @@ function Rr(e, t, n) {
|
|
|
2105
2105
|
}
|
|
2106
2106
|
function $(e, t, n = 1, r) {
|
|
2107
2107
|
let i = Math.round(e * Ve * n * t);
|
|
2108
|
-
return r ? Math.max(i, Math.round(
|
|
2108
|
+
return r ? Math.max(i, Math.round(z(r, e * Ve * t))) : i;
|
|
2109
2109
|
}
|
|
2110
2110
|
function zr(e, t = 1) {
|
|
2111
2111
|
return `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${Math.max(1, Math.round(e.size * Ve * t))}px ${Sr(e.name)}`;
|
|
@@ -2145,13 +2145,13 @@ function Vr(e, t, n) {
|
|
|
2145
2145
|
let i = e.measureText(t).width;
|
|
2146
2146
|
return e.font = r, i;
|
|
2147
2147
|
}
|
|
2148
|
-
function Hr(e,
|
|
2149
|
-
if (e.save(), e.strokeStyle =
|
|
2150
|
-
let
|
|
2151
|
-
e.moveTo(
|
|
2148
|
+
function Hr(e, n, r, i, a, o, s = 1) {
|
|
2149
|
+
if (e.save(), e.strokeStyle = a, e.lineWidth = .5, e.beginPath(), o) {
|
|
2150
|
+
let a = i - 1, o = i + 1, c = a + t(a, .5, s), l = o + t(o, .5, s);
|
|
2151
|
+
e.moveTo(n, c), e.lineTo(r, c), e.moveTo(n, l), e.lineTo(r, l);
|
|
2152
2152
|
} else {
|
|
2153
|
-
let
|
|
2154
|
-
e.moveTo(
|
|
2153
|
+
let a = i + t(i, .5, s);
|
|
2154
|
+
e.moveTo(n, a), e.lineTo(r, a);
|
|
2155
2155
|
}
|
|
2156
2156
|
e.stroke(), e.restore();
|
|
2157
2157
|
}
|
|
@@ -2222,24 +2222,24 @@ function qr(e, t, n) {
|
|
|
2222
2222
|
function Jr(e, t) {
|
|
2223
2223
|
if (e.length === 0 || t.length === 0) return 0;
|
|
2224
2224
|
let n = [...e, ...t], r = e.length;
|
|
2225
|
-
return r -
|
|
2225
|
+
return r - s(n, r, m, 1);
|
|
2226
2226
|
}
|
|
2227
2227
|
function Yr(e, t) {
|
|
2228
2228
|
let n = t;
|
|
2229
2229
|
for (; n < e.length;) {
|
|
2230
2230
|
let t = e[e.length - n - 1], r = e[e.length - n], i = t?.codePointAt(0), a = r?.codePointAt(0);
|
|
2231
|
-
if (i !== void 0 && a !== void 0 &&
|
|
2231
|
+
if (i !== void 0 && a !== void 0 && b(i) && b(a)) n++;
|
|
2232
2232
|
else break;
|
|
2233
2233
|
}
|
|
2234
2234
|
return n >= e.length ? t : n;
|
|
2235
2235
|
}
|
|
2236
2236
|
function Xr(e, t) {
|
|
2237
2237
|
if (e.length === 0 || t.length === 0) return 0;
|
|
2238
|
-
let n = t[0].codePointAt(0), r = e.length - 1,
|
|
2239
|
-
if (
|
|
2238
|
+
let n = t[0].codePointAt(0), r = e.length - 1, i = e[r].codePointAt(0);
|
|
2239
|
+
if (i === void 0 || n === void 0 || i === 8203 || n === 8203 || !a(i, n)) return 0;
|
|
2240
2240
|
for (; r > 0;) {
|
|
2241
2241
|
let t = e[r - 1].codePointAt(0), n = e[r].codePointAt(0);
|
|
2242
|
-
if (t === void 0 || n === void 0 || !
|
|
2242
|
+
if (t === void 0 || n === void 0 || !a(t, n)) break;
|
|
2243
2243
|
r--;
|
|
2244
2244
|
}
|
|
2245
2245
|
return r === 0 ? 0 : e.length - r;
|
|
@@ -2248,7 +2248,7 @@ function Zr(e, t, n) {
|
|
|
2248
2248
|
let r = [], i = [], a = 0;
|
|
2249
2249
|
for (; a < t.length;) {
|
|
2250
2250
|
let e = t[a], n = e.codePointAt(0) ?? 0;
|
|
2251
|
-
if (
|
|
2251
|
+
if (ae(n)) i.push(e), a += n > 65535 ? 2 : 1;
|
|
2252
2252
|
else if (e === " ") {
|
|
2253
2253
|
let e = a;
|
|
2254
2254
|
for (; e < t.length && t[e] === " ";) e++;
|
|
@@ -2257,10 +2257,10 @@ function Zr(e, t, n) {
|
|
|
2257
2257
|
let e = a;
|
|
2258
2258
|
for (; e < t.length;) {
|
|
2259
2259
|
let n = t[e], r = n.codePointAt(0) ?? 0;
|
|
2260
|
-
if (n === " " ||
|
|
2260
|
+
if (n === " " || ae(r)) break;
|
|
2261
2261
|
e += r > 65535 ? 2 : 1;
|
|
2262
2262
|
}
|
|
2263
|
-
let n = t.slice(a, e), r =
|
|
2263
|
+
let n = t.slice(a, e), r = P(n) ? y(n) : null;
|
|
2264
2264
|
if (r && r.length > 0) {
|
|
2265
2265
|
let e = 0;
|
|
2266
2266
|
for (let t of r) i.push(n.slice(e, t)), e = t;
|
|
@@ -2314,7 +2314,7 @@ function Qr(e, t, n, r, i) {
|
|
|
2314
2314
|
let a = e.measureText(t).width;
|
|
2315
2315
|
if (o.length > 0 && s + a > i) {
|
|
2316
2316
|
let i = o.flatMap((e) => [...e.text]), a = Jr(i, [...t]);
|
|
2317
|
-
a > 0 ? a = Yr(i, a) : !
|
|
2317
|
+
a > 0 ? a = Yr(i, a) : !P(t) && !P(o[o.length - 1]?.text ?? "") && !/^\s/u.test(t) && !/\s$/u.test(i.at(-1) ?? "") && (a = Xr(i, [...t]));
|
|
2318
2318
|
let u = o[o.length - 1], d = [...u.text];
|
|
2319
2319
|
a > d.length && (a = d.length);
|
|
2320
2320
|
let f = null;
|
|
@@ -2340,21 +2340,21 @@ function Qr(e, t, n, r, i) {
|
|
|
2340
2340
|
width: a
|
|
2341
2341
|
}), s += a, n.size > c && (c = n.size, l = n.name);
|
|
2342
2342
|
}, g = (t, n) => {
|
|
2343
|
-
let a =
|
|
2343
|
+
let a = y(t);
|
|
2344
2344
|
if (a.length === 0) {
|
|
2345
2345
|
h(t, n);
|
|
2346
2346
|
return;
|
|
2347
2347
|
}
|
|
2348
2348
|
e.font = zr(ti(n), r);
|
|
2349
|
-
let o = (t) => e.measureText(t).width, c =
|
|
2349
|
+
let o = (t) => e.measureText(t).width, c = oe(t), l = t.length, u = 0;
|
|
2350
2350
|
for (; u < l;) {
|
|
2351
|
-
let e = i - s, r =
|
|
2351
|
+
let e = i - s, r = ee(t, a, u, e, o, c);
|
|
2352
2352
|
if (r <= u) {
|
|
2353
2353
|
if (s > 0) {
|
|
2354
2354
|
p();
|
|
2355
2355
|
continue;
|
|
2356
2356
|
}
|
|
2357
|
-
let n = a.find((e) => e > u) ?? l, i = t.slice(u, n), d = T(i), f =
|
|
2357
|
+
let n = a.find((e) => e > u) ?? l, i = t.slice(u, n), d = T(i), f = ee(i, d, 0, e, o, c);
|
|
2358
2358
|
f <= 0 && (f = d.length > 0 ? d[0] : i.length), r = u + f;
|
|
2359
2359
|
}
|
|
2360
2360
|
h(t.slice(u, r), n), u = r, u < l && p();
|
|
@@ -2365,7 +2365,7 @@ function Qr(e, t, n, r, i) {
|
|
|
2365
2365
|
for (; i < e.text.length;) {
|
|
2366
2366
|
let t = e.text[i], n = t.codePointAt(0) ?? 0;
|
|
2367
2367
|
if (n === 10) r.push("\n"), i += 1;
|
|
2368
|
-
else if (
|
|
2368
|
+
else if (ae(n)) r.push(t), i += n > 65535 ? 2 : 1;
|
|
2369
2369
|
else if (t === " ") {
|
|
2370
2370
|
let t = i;
|
|
2371
2371
|
for (; t < e.text.length && e.text[t] === " ";) t++;
|
|
@@ -2374,13 +2374,13 @@ function Qr(e, t, n, r, i) {
|
|
|
2374
2374
|
let t = i;
|
|
2375
2375
|
for (; t < e.text.length;) {
|
|
2376
2376
|
let n = e.text[t], r = n.codePointAt(0) ?? 0;
|
|
2377
|
-
if (n === " " || n === "\n" ||
|
|
2377
|
+
if (n === " " || n === "\n" || ae(r)) break;
|
|
2378
2378
|
t += r > 65535 ? 2 : 1;
|
|
2379
2379
|
}
|
|
2380
2380
|
r.push(e.text.slice(i, t)), i = t;
|
|
2381
2381
|
}
|
|
2382
2382
|
}
|
|
2383
|
-
for (let e of r) e === "\n" ? (m(), f++) :
|
|
2383
|
+
for (let e of r) e === "\n" ? (m(), f++) : P(e) ? g(e, t) : h(e, t);
|
|
2384
2384
|
}
|
|
2385
2385
|
return (o.length > 0 || a.length > 0) && m(), a;
|
|
2386
2386
|
}
|
|
@@ -2415,36 +2415,36 @@ function ti(e) {
|
|
|
2415
2415
|
size: e.size * .65
|
|
2416
2416
|
} : e;
|
|
2417
2417
|
}
|
|
2418
|
-
function ni(e,
|
|
2419
|
-
e.textAlign = "left", e.textBaseline =
|
|
2420
|
-
let
|
|
2421
|
-
for (let
|
|
2422
|
-
let
|
|
2423
|
-
if (
|
|
2424
|
-
|
|
2418
|
+
function ni(e, n, r, i, a, o, s, c) {
|
|
2419
|
+
e.textAlign = "left", e.textBaseline = a;
|
|
2420
|
+
let l = c.needBidi ? rr(n, c.baseRtl ?? !1) : null, u = e, d = r;
|
|
2421
|
+
for (let r = 0; r < n.length; r++) {
|
|
2422
|
+
let f = l ? l.order[r] : r;
|
|
2423
|
+
if (l) try {
|
|
2424
|
+
u.direction = l.rtl[f] ? "rtl" : "ltr";
|
|
2425
2425
|
} catch {}
|
|
2426
|
-
let
|
|
2427
|
-
e.font = zr(
|
|
2428
|
-
let
|
|
2429
|
-
e.fillStyle =
|
|
2430
|
-
let
|
|
2431
|
-
|
|
2432
|
-
let
|
|
2433
|
-
if (
|
|
2434
|
-
let
|
|
2435
|
-
if (
|
|
2436
|
-
let
|
|
2437
|
-
Hr(e,
|
|
2426
|
+
let p = n[f], m = ti(p.font);
|
|
2427
|
+
e.font = zr(m, o);
|
|
2428
|
+
let h = c.fontColor ?? p.font.color;
|
|
2429
|
+
e.fillStyle = h ? J(h) : "#000000";
|
|
2430
|
+
let g = $(p.font.size, o), _ = 0;
|
|
2431
|
+
p.font.vertAlign === "superscript" ? _ = -Math.round(g * .35) : p.font.vertAlign === "subscript" && (_ = Math.round(g * .1)), e.fillText(p.text, d, i + _);
|
|
2432
|
+
let v = $(m.size, o);
|
|
2433
|
+
if (p.font.underline || p.font.strike) {
|
|
2434
|
+
let n = $r(a, i, v);
|
|
2435
|
+
if (p.font.underline) {
|
|
2436
|
+
let t = h ? J(h) : "#000000", r = p.font.underlineStyle === "double" || p.font.underlineStyle === "doubleAccounting";
|
|
2437
|
+
Hr(e, d, d + p.width, n.underline + _, t, r, s);
|
|
2438
2438
|
}
|
|
2439
|
-
if (
|
|
2440
|
-
let
|
|
2441
|
-
e.save(), e.strokeStyle =
|
|
2439
|
+
if (p.font.strike) {
|
|
2440
|
+
let r = n.strike + _, i = r + t(r, .5, s);
|
|
2441
|
+
e.save(), e.strokeStyle = h ? J(h) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(d, i), e.lineTo(d + p.width, i), e.stroke(), e.restore();
|
|
2442
2442
|
}
|
|
2443
2443
|
}
|
|
2444
|
-
|
|
2444
|
+
d += p.width;
|
|
2445
2445
|
}
|
|
2446
|
-
if (
|
|
2447
|
-
|
|
2446
|
+
if (l) try {
|
|
2447
|
+
u.direction = "ltr";
|
|
2448
2448
|
} catch {}
|
|
2449
2449
|
}
|
|
2450
2450
|
function ri(e, t, n, r, i, a, o, s) {
|
|
@@ -2644,395 +2644,395 @@ function yi(e) {
|
|
|
2644
2644
|
let n = parseInt(t.slice(0, 2), 16), r = parseInt(t.slice(2, 4), 16), i = parseInt(t.slice(4, 6), 16), a = (e) => Math.round(e * .2 + 255 * .8), o = (e) => e.toString(16).padStart(2, "0").toUpperCase();
|
|
2645
2645
|
return `#${o(a(n))}${o(a(r))}${o(a(i))}`;
|
|
2646
2646
|
}
|
|
2647
|
-
function bi(e,
|
|
2648
|
-
if (
|
|
2649
|
-
let { styles:
|
|
2650
|
-
for (let e = 0; e <
|
|
2651
|
-
let
|
|
2652
|
-
for (let e = 0; e <
|
|
2653
|
-
e.save(), e.beginPath(), e.rect(
|
|
2654
|
-
let
|
|
2655
|
-
for (let
|
|
2656
|
-
let a =
|
|
2657
|
-
if (
|
|
2658
|
-
let p =
|
|
2647
|
+
function bi(e, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g) {
|
|
2648
|
+
if (h <= 0 || g <= 0) return;
|
|
2649
|
+
let { styles: _, cellMap: v, mergeAnchorMap: y, mergeSkipSet: b, cfContext: x, cs: S, dpr: C } = n, w = a.length, T = o.length, E = new Set(c), D = new Set(s), O = (e, t) => n.rtl ? wr(e, t, n.canvasW) : e, k = [], A = -l;
|
|
2650
|
+
for (let e = 0; e < w; e++) k.push(A), A += a[e];
|
|
2651
|
+
let j = [], M = -u;
|
|
2652
|
+
for (let e = 0; e < T; e++) j.push(M), M += o[e];
|
|
2653
|
+
e.save(), e.beginPath(), e.rect(O(p, h), m, h, g), e.clip();
|
|
2654
|
+
let N = [], ee = [], P = [];
|
|
2655
|
+
for (let t of n.worksheet.mergeCells ?? []) {
|
|
2656
|
+
let a = t.top, o = t.left;
|
|
2657
|
+
if (E.has(a) && D.has(o) || !c.some((e) => e >= t.top && e <= t.bottom) || !s.some((e) => e >= t.left && e <= t.right)) continue;
|
|
2658
|
+
let p = n.mergeAnchorMap.get(`${a}:${o}`);
|
|
2659
2659
|
if (!p) continue;
|
|
2660
|
-
let m =
|
|
2661
|
-
m =
|
|
2662
|
-
let y = `${a}:${
|
|
2663
|
-
if (Pr(e, j.fill ??
|
|
2664
|
-
let t = Math.max(0, (
|
|
2660
|
+
let m = d - l + n.colAxis.offsetOf(o) - n.colAxis.offsetOf(i), h = f - u + n.rowAxis.offsetOf(a) - n.rowAxis.offsetOf(r), g = p.totalW, v = p.totalH;
|
|
2661
|
+
m = O(m, g);
|
|
2662
|
+
let y = `${a}:${o}`, b = n.cellMap.get(y), { font: w, fill: T, border: k, xf: A } = Wr(_, Kr(n.worksheet, b, o)), j = $n(b, a, o, x, _.dxfs ?? []);
|
|
2663
|
+
if (Pr(e, j.fill ?? T, m, h, g, v), j.dataBar && j.dataBar.ratio > 0) {
|
|
2664
|
+
let t = Math.max(0, (g - 4) * j.dataBar.ratio);
|
|
2665
2665
|
kr(e, j.dataBar.color, m + 2, h + 2, t, v - 4, j.dataBar.gradient);
|
|
2666
2666
|
}
|
|
2667
|
-
let M = na(ta(k, a,
|
|
2668
|
-
if (ee.push(() => ia(e, M, m, h,
|
|
2669
|
-
let N = tn(
|
|
2670
|
-
if (!P || P === "0" &&
|
|
2671
|
-
let F = w.bold || !!j.fontBold,
|
|
2667
|
+
let M = na(ta(k, a, o, p.right, p.bottom, n.cellMap, _), j.border);
|
|
2668
|
+
if (ee.push(() => ia(e, M, m, h, g, v, C)), !b) continue;
|
|
2669
|
+
let N = tn(b, _, j.numFmt, n.worksheet.date1904), P = N.text;
|
|
2670
|
+
if (!P || P === "0" && n.worksheet.showZeros === !1) continue;
|
|
2671
|
+
let F = w.bold || !!j.fontBold, te = w.italic || !!j.fontItalic, I = w.underline || !!j.fontUnderline, L = w.strike || !!j.fontStrike, R = F !== w.bold || te !== w.italic || I !== w.underline || L !== w.strike ? {
|
|
2672
2672
|
...w,
|
|
2673
2673
|
bold: F,
|
|
2674
|
-
italic:
|
|
2675
|
-
underline:
|
|
2676
|
-
strike:
|
|
2674
|
+
italic: te,
|
|
2675
|
+
underline: I,
|
|
2676
|
+
strike: L
|
|
2677
2677
|
} : w;
|
|
2678
|
-
e.font = zr(
|
|
2679
|
-
let z =
|
|
2678
|
+
e.font = zr(R, S);
|
|
2679
|
+
let z = n.hyperlinkMap.get(y) ? "#0563C1" : j.fontColor ?? N.color ?? w.color;
|
|
2680
2680
|
e.fillStyle = z ? J(z) : "#000000";
|
|
2681
|
-
let ne =
|
|
2682
|
-
e.save(), e.beginPath(), e.rect(m, h,
|
|
2683
|
-
let
|
|
2684
|
-
B === "right" ? (
|
|
2685
|
-
let
|
|
2686
|
-
if (A.wrapText &&
|
|
2681
|
+
let ne = b.value.type === "number", B = A.alignH ?? (ne ? "right" : "left"), V = A.alignV ?? "bottom", re = A.indent ? Math.round(A.indent * 3 * n.mdw) : 0, H = 3 + (B === "left" || !A.alignH ? re : 0);
|
|
2682
|
+
e.save(), e.beginPath(), e.rect(m, h, g, v), e.clip();
|
|
2683
|
+
let ie;
|
|
2684
|
+
B === "right" ? (ie = m + g - 3, e.textAlign = "right") : B === "center" ? (ie = m + g / 2, e.textAlign = "center") : (ie = m + H, e.textAlign = "left");
|
|
2685
|
+
let U = b.value.type === "text" ? b.value.runs : void 0, ae = U && U.length > 0;
|
|
2686
|
+
if (A.wrapText && ae) li(e, U, R, {
|
|
2687
2687
|
alignH: B,
|
|
2688
|
-
alignV:
|
|
2688
|
+
alignV: V,
|
|
2689
2689
|
cx: m,
|
|
2690
2690
|
cy: h,
|
|
2691
|
-
cellW:
|
|
2691
|
+
cellW: g,
|
|
2692
2692
|
cellH: v,
|
|
2693
2693
|
leftPad: H,
|
|
2694
2694
|
paddingX: 3,
|
|
2695
2695
|
paddingY: 2
|
|
2696
|
-
},
|
|
2696
|
+
}, S, C, {
|
|
2697
2697
|
fontColor: j.fontColor,
|
|
2698
2698
|
readingOrder: A.readingOrder
|
|
2699
2699
|
});
|
|
2700
|
-
else if (A.wrapText) ci(e, P,
|
|
2700
|
+
else if (A.wrapText) ci(e, P, ie, R, {
|
|
2701
2701
|
alignH: B,
|
|
2702
|
-
alignV:
|
|
2702
|
+
alignV: V,
|
|
2703
2703
|
cx: m,
|
|
2704
2704
|
cy: h,
|
|
2705
|
-
cellW:
|
|
2705
|
+
cellW: g,
|
|
2706
2706
|
cellH: v,
|
|
2707
2707
|
leftPad: H,
|
|
2708
2708
|
paddingX: 3,
|
|
2709
2709
|
paddingY: 2
|
|
2710
|
-
},
|
|
2711
|
-
else if (
|
|
2710
|
+
}, S);
|
|
2711
|
+
else if (ae) si(e, U, R, {
|
|
2712
2712
|
alignH: B,
|
|
2713
|
-
alignV:
|
|
2713
|
+
alignV: V,
|
|
2714
2714
|
cx: m,
|
|
2715
2715
|
cy: h,
|
|
2716
|
-
cellW:
|
|
2716
|
+
cellW: g,
|
|
2717
2717
|
cellH: v,
|
|
2718
2718
|
leftPad: H,
|
|
2719
2719
|
paddingX: 3,
|
|
2720
2720
|
paddingY: 2
|
|
2721
|
-
},
|
|
2721
|
+
}, S, C, {
|
|
2722
2722
|
fontColor: j.fontColor,
|
|
2723
2723
|
readingOrder: A.readingOrder
|
|
2724
2724
|
});
|
|
2725
2725
|
else {
|
|
2726
2726
|
let { baseline: t, textY: n } = ei({
|
|
2727
2727
|
alignH: B,
|
|
2728
|
-
alignV:
|
|
2728
|
+
alignV: V,
|
|
2729
2729
|
cx: m,
|
|
2730
2730
|
cy: h,
|
|
2731
|
-
cellW:
|
|
2731
|
+
cellW: g,
|
|
2732
2732
|
cellH: v,
|
|
2733
2733
|
leftPad: H,
|
|
2734
2734
|
paddingX: 3,
|
|
2735
2735
|
paddingY: 2
|
|
2736
2736
|
});
|
|
2737
|
-
e.textBaseline = t, e.fillText(P,
|
|
2737
|
+
e.textBaseline = t, e.fillText(P, ie, n);
|
|
2738
2738
|
}
|
|
2739
2739
|
e.restore();
|
|
2740
2740
|
}
|
|
2741
|
-
for (let
|
|
2742
|
-
let
|
|
2743
|
-
if ((
|
|
2744
|
-
let t =
|
|
2745
|
-
return t != null &&
|
|
2741
|
+
for (let r = 0; r < T; r++) {
|
|
2742
|
+
let i = c[r], l = f + j[r], u = o[r];
|
|
2743
|
+
if ((l + u <= m || l >= m + g) && !s.some((e) => {
|
|
2744
|
+
let t = y.get(`${i}:${e}`);
|
|
2745
|
+
return t != null && l + t.totalH > m && l < m + g;
|
|
2746
2746
|
})) continue;
|
|
2747
|
-
let
|
|
2748
|
-
if (
|
|
2749
|
-
for (let t =
|
|
2750
|
-
for (let t =
|
|
2747
|
+
let T = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Set(), D = -1, A = (e) => {
|
|
2748
|
+
if (D >= 0 && e - D >= 2) {
|
|
2749
|
+
for (let t = D; t < e - 1; t++) T.add(t);
|
|
2750
|
+
for (let t = D + 1; t < e; t++) E.add(t);
|
|
2751
2751
|
}
|
|
2752
|
-
|
|
2752
|
+
D = -1;
|
|
2753
2753
|
};
|
|
2754
|
-
for (let e = 0; e <=
|
|
2755
|
-
let
|
|
2756
|
-
if (e <
|
|
2757
|
-
let a = `${
|
|
2758
|
-
if (!
|
|
2759
|
-
let
|
|
2760
|
-
|
|
2754
|
+
for (let e = 0; e <= w; e++) {
|
|
2755
|
+
let t = !1, r = !1;
|
|
2756
|
+
if (e < w) {
|
|
2757
|
+
let a = `${i}:${s[e]}`;
|
|
2758
|
+
if (!b.has(a) && !y.has(a)) {
|
|
2759
|
+
let i = v.get(a);
|
|
2760
|
+
t = Wr(_, Kr(n.worksheet, i, s[e])).xf.alignH === "centerContinuous", r = !!(i && i.value && i.value.type !== "empty");
|
|
2761
2761
|
}
|
|
2762
2762
|
}
|
|
2763
|
-
|
|
2764
|
-
}
|
|
2765
|
-
for (let
|
|
2766
|
-
let
|
|
2767
|
-
if (
|
|
2768
|
-
let
|
|
2769
|
-
if (
|
|
2770
|
-
let I =
|
|
2771
|
-
if (
|
|
2772
|
-
let t = Math.max(0, (
|
|
2773
|
-
kr(e, H.dataBar.color, I + 2,
|
|
2763
|
+
t ? r && D >= 0 && e > D ? (A(e), D = e) : D < 0 && (D = e) : A(e);
|
|
2764
|
+
}
|
|
2765
|
+
for (let o = 0; o < w; o++) {
|
|
2766
|
+
let c = s[o], f = d + k[o], D = a[o], A = `${i}:${c}`;
|
|
2767
|
+
if (b.has(A)) continue;
|
|
2768
|
+
let j = y.get(A), M = j ? j.totalW : D, F = j ? j.totalH : u, te = f + M <= p || f >= p + h;
|
|
2769
|
+
if (l + F <= m || l >= m + g || te && !n.overflowTextAnchors.has(A)) continue;
|
|
2770
|
+
let I = O(f, M), L = v.get(A), { font: R, fill: z, border: ne, xf: V } = Wr(_, Kr(n.worksheet, L, c)), H = $n(L, i, c, x, _.dxfs ?? []), ie = H.fill ?? z, U = n.tableStyleMap.get(A), ae = _.dxfs ?? [], oe = (e) => e == null ? void 0 : ae[e], se = oe(U?.wholeTableDxf), ce = oe(U?.headerRowDxf), le = oe(U?.totalRowDxf), ue = oe(U?.firstColumnDxf), de = oe(U?.lastColumnDxf), fe = oe(U?.stripeDxf), pe = U?.isHeader && ce?.fill?.fgColor ? ce : U?.isTotals && le?.fill?.fgColor ? le : U?.isLastCol && de?.fill?.fgColor ? de : U?.isFirstCol && ue?.fill?.fgColor ? ue : fe?.fill?.fgColor ? fe : !U?.isHeader && !U?.isTotals && se?.fill?.fgColor ? se : void 0, me = Pr(e, ie, I, l, M, F);
|
|
2771
|
+
if (me || (U && pe?.fill?.fgColor ? (e.fillStyle = J(pe.fill.fgColor), e.fillRect(I, l, M, F), me = !0) : U && !U.isCustom && U.isBanded && (e.fillStyle = yi(U.accent), e.fillRect(I, l, M, F), me = !0)), n.commentCells.has(A) && Lr(e, I, l, M, F), H.dataBar && H.dataBar.ratio > 0) {
|
|
2772
|
+
let t = Math.max(0, (M - 4) * H.dataBar.ratio);
|
|
2773
|
+
kr(e, H.dataBar.color, I + 2, l + 2, t, F - 4, H.dataBar.gradient);
|
|
2774
2774
|
}
|
|
2775
|
-
let
|
|
2776
|
-
if (
|
|
2775
|
+
let W = n.sparklineMap.get(A);
|
|
2776
|
+
if (W && ot(e, {
|
|
2777
2777
|
x: I,
|
|
2778
|
-
y:
|
|
2779
|
-
w:
|
|
2780
|
-
h:
|
|
2781
|
-
},
|
|
2782
|
-
if (e.strokeStyle = "#d0d0d0", e.lineWidth = .5, e.beginPath(), !
|
|
2783
|
-
let
|
|
2784
|
-
e.moveTo(
|
|
2778
|
+
y: l,
|
|
2779
|
+
w: M,
|
|
2780
|
+
h: F
|
|
2781
|
+
}, W), n.worksheet.isChartSheet !== !0 && n.worksheet.showGridlines !== !1 && !me) {
|
|
2782
|
+
if (e.strokeStyle = "#d0d0d0", e.lineWidth = .5, e.beginPath(), !T.has(o)) {
|
|
2783
|
+
let n = I + M + t(I + M, .5, C);
|
|
2784
|
+
e.moveTo(n, l), e.lineTo(n, l + F);
|
|
2785
2785
|
}
|
|
2786
|
-
let
|
|
2787
|
-
if (e.moveTo(I,
|
|
2788
|
-
let
|
|
2789
|
-
e.moveTo(I,
|
|
2786
|
+
let n = l + F + t(l + F, .5, C);
|
|
2787
|
+
if (e.moveTo(I, n), e.lineTo(I + M, n), r === 0) {
|
|
2788
|
+
let n = l + t(l, .5, C);
|
|
2789
|
+
e.moveTo(I, n), e.lineTo(I + M, n);
|
|
2790
2790
|
}
|
|
2791
|
-
if (
|
|
2792
|
-
let
|
|
2793
|
-
e.moveTo(
|
|
2791
|
+
if (o === 0) {
|
|
2792
|
+
let n = I + t(I, .5, C);
|
|
2793
|
+
e.moveTo(n, l), e.lineTo(n, l + F);
|
|
2794
2794
|
}
|
|
2795
2795
|
e.stroke();
|
|
2796
2796
|
}
|
|
2797
|
-
let G = na(
|
|
2798
|
-
(
|
|
2797
|
+
let G = na(j ? ta(ne, i, c, j.right, j.bottom, v, _) : ne, H.border);
|
|
2798
|
+
(T.has(o) || E.has(o)) && (G = {
|
|
2799
2799
|
...G,
|
|
2800
|
-
left:
|
|
2801
|
-
right:
|
|
2800
|
+
left: E.has(o) ? null : G.left,
|
|
2801
|
+
right: T.has(o) ? null : G.right
|
|
2802
2802
|
});
|
|
2803
|
-
let K =
|
|
2804
|
-
if (he?.style && (
|
|
2803
|
+
let K = v.get(`${i - 1}:${c}`), he = K ? Wr(_, Kr(n.worksheet, K, c)).border.bottom : null;
|
|
2804
|
+
if (he?.style && (r === 0 || G.top?.style) && (G = {
|
|
2805
2805
|
...G,
|
|
2806
2806
|
top: ca(G.top, he)
|
|
2807
|
-
}), !
|
|
2808
|
-
let e =
|
|
2809
|
-
|
|
2807
|
+
}), !E.has(o)) {
|
|
2808
|
+
let e = v.get(`${i}:${c - 1}`), t = e ? Wr(_, Kr(n.worksheet, e, c - 1)).border.right : null;
|
|
2809
|
+
t?.style && (o === 0 || G.left?.style) && (G = {
|
|
2810
2810
|
...G,
|
|
2811
|
-
left: ca(G.left,
|
|
2811
|
+
left: ca(G.left, t)
|
|
2812
2812
|
});
|
|
2813
2813
|
}
|
|
2814
|
-
let ge =
|
|
2814
|
+
let ge = U ? _i(U, se, ce, c) : null, _e = n.autoFilterCells.has(A), ve = () => {
|
|
2815
2815
|
if (ge) {
|
|
2816
|
-
if (ge.kind === "dxf") ia(e, ge.border, I,
|
|
2816
|
+
if (ge.kind === "dxf") ia(e, ge.border, I, l, M, F, C);
|
|
2817
2817
|
else if (ge.kind === "accent") {
|
|
2818
|
-
let
|
|
2819
|
-
if (e.strokeStyle = ge.color, e.lineWidth = ge.lineWidth, e.beginPath(), e.moveTo(I,
|
|
2820
|
-
let
|
|
2821
|
-
e.moveTo(I,
|
|
2818
|
+
let n = .5 / C;
|
|
2819
|
+
if (e.strokeStyle = ge.color, e.lineWidth = ge.lineWidth, e.beginPath(), e.moveTo(I, l + F - n), e.lineTo(I + M, l + F - n), ge.topEdge) {
|
|
2820
|
+
let n = l + t(l, ge.lineWidth, C);
|
|
2821
|
+
e.moveTo(I, n), e.lineTo(I + M, n);
|
|
2822
2822
|
}
|
|
2823
2823
|
e.stroke();
|
|
2824
2824
|
}
|
|
2825
2825
|
}
|
|
2826
|
-
_e && hi(e, I,
|
|
2826
|
+
_e && hi(e, I, l, D, F);
|
|
2827
2827
|
};
|
|
2828
|
-
if (
|
|
2828
|
+
if (j) {
|
|
2829
2829
|
let t = G;
|
|
2830
|
-
ee.push(() => ia(e, t, I,
|
|
2830
|
+
ee.push(() => ia(e, t, I, l, M, F, C)), ve();
|
|
2831
2831
|
} else {
|
|
2832
2832
|
let t = G;
|
|
2833
|
-
|
|
2834
|
-
ia(e, t, I,
|
|
2833
|
+
P.push(() => {
|
|
2834
|
+
ia(e, t, I, l, M, F, C), ve();
|
|
2835
2835
|
});
|
|
2836
2836
|
}
|
|
2837
2837
|
if (!L) continue;
|
|
2838
|
-
let ye = tn(L,
|
|
2839
|
-
!q || q === "0" &&
|
|
2840
|
-
let
|
|
2838
|
+
let ye = tn(L, _, H.numFmt, n.worksheet.date1904), q = ye.text;
|
|
2839
|
+
!q || q === "0" && n.worksheet.showZeros === !1 || N.push(() => {
|
|
2840
|
+
let r = U?.isHeader ? ce : U?.isTotals ? le : U?.isLastCol && de ? de : U?.isFirstCol && ue ? ue : fe || (U ? se : void 0), u = U ? U.isCustom ? !!r?.font?.bold : U.isHeader || U.isTotals : !1, d = R.bold || !!H.fontBold || u, f = R.italic || !!H.fontItalic, p = R.underline || !!H.fontUnderline, m = R.strike || !!H.fontStrike, h = d !== R.bold || f !== R.italic || p !== R.underline || m !== R.strike ? {
|
|
2841
2841
|
...R,
|
|
2842
|
-
bold:
|
|
2843
|
-
italic:
|
|
2844
|
-
underline:
|
|
2845
|
-
strike:
|
|
2842
|
+
bold: d,
|
|
2843
|
+
italic: f,
|
|
2844
|
+
underline: p,
|
|
2845
|
+
strike: m
|
|
2846
2846
|
} : R;
|
|
2847
|
-
e.font = zr(
|
|
2848
|
-
let
|
|
2849
|
-
e.fillStyle =
|
|
2850
|
-
let
|
|
2851
|
-
if (
|
|
2852
|
-
let
|
|
2853
|
-
if (
|
|
2854
|
-
let
|
|
2855
|
-
if (
|
|
2856
|
-
|
|
2847
|
+
e.font = zr(h, S);
|
|
2848
|
+
let g = n.hyperlinkMap.get(A), x = r?.font?.color ?? null, T = g ? "#0563C1" : H.fontColor ?? ye.color ?? x ?? R.color;
|
|
2849
|
+
e.fillStyle = T ? J(T) : "#000000";
|
|
2850
|
+
let E = L.value.type === "number", D = V.alignH ?? (E ? "right" : "left"), O = V.alignV ?? "bottom", k = V.indent ? Math.round(V.indent * 3 * n.mdw) : 0, N = H.iconSet ? Math.max(8, Math.round(Math.min(M, F) * .55)) : 0, ee = N > 0 ? N + 4 : 0, P = 3 + (D === "left" || !V.alignH ? k : 0) + ee, te = M, z = o;
|
|
2851
|
+
if (D === "centerContinuous" && !j) for (let e = o + 1; e < w; e++) {
|
|
2852
|
+
let t = `${i}:${s[e]}`;
|
|
2853
|
+
if (b.has(t) || y.has(t)) break;
|
|
2854
|
+
let r = v.get(t);
|
|
2855
|
+
if (r && r.value.type !== "empty" || Wr(_, Kr(n.worksheet, r, s[e])).xf.alignH !== "centerContinuous") break;
|
|
2856
|
+
te += a[e], z = e;
|
|
2857
2857
|
}
|
|
2858
|
-
let
|
|
2859
|
-
if (!
|
|
2860
|
-
let
|
|
2858
|
+
let ne = n.rtl ? I - (te - M) : I, ie = D === "centerContinuous" ? ne : I, ae = D === "centerContinuous" ? te : M, oe = q.includes("\n");
|
|
2859
|
+
if (!j && !V.wrapText && !V.textRotation && !E && !oe) {
|
|
2860
|
+
let t = e.measureText(q).width, r = D === "centerContinuous", c = r ? t + 6 : t + P + 3, l = r ? te : M;
|
|
2861
2861
|
if (c > l) {
|
|
2862
|
-
let e = c - l,
|
|
2863
|
-
|
|
2864
|
-
let d =
|
|
2865
|
-
if (
|
|
2866
|
-
let e =
|
|
2867
|
-
for (let t = f; t >= 0 && t <
|
|
2868
|
-
let n = `${
|
|
2869
|
-
if (
|
|
2870
|
-
let
|
|
2871
|
-
if (
|
|
2872
|
-
|
|
2862
|
+
let e = c - l, t = 0, u = 0;
|
|
2863
|
+
D === "right" ? u = e : D === "center" || r ? (u = e / 2, t = e / 2) : t = e;
|
|
2864
|
+
let d = n.rtl ? -1 : 1, f = n.rtl ? o - 1 : z + 1, p = n.rtl ? 1 : -1, m = n.rtl ? z + 1 : o - 1;
|
|
2865
|
+
if (t > 0) {
|
|
2866
|
+
let e = t;
|
|
2867
|
+
for (let t = f; t >= 0 && t < w && e > 0; t += d) {
|
|
2868
|
+
let n = `${i}:${s[t]}`;
|
|
2869
|
+
if (b.has(n) || y.has(n)) break;
|
|
2870
|
+
let r = v.get(n);
|
|
2871
|
+
if (r && r.value.type !== "empty") break;
|
|
2872
|
+
ae += a[t], e -= a[t];
|
|
2873
2873
|
}
|
|
2874
2874
|
}
|
|
2875
2875
|
if (u > 0) {
|
|
2876
2876
|
let e = u;
|
|
2877
|
-
for (let t = m; t >= 0 && t <
|
|
2878
|
-
let n = `${
|
|
2879
|
-
if (
|
|
2880
|
-
let
|
|
2881
|
-
if (
|
|
2882
|
-
|
|
2877
|
+
for (let t = m; t >= 0 && t < w && e > 0; t += p) {
|
|
2878
|
+
let n = `${i}:${s[t]}`;
|
|
2879
|
+
if (b.has(n) || y.has(n)) break;
|
|
2880
|
+
let r = v.get(n);
|
|
2881
|
+
if (r && r.value.type !== "empty") break;
|
|
2882
|
+
ie -= a[t], ae += a[t], e -= a[t];
|
|
2883
2883
|
}
|
|
2884
2884
|
}
|
|
2885
2885
|
}
|
|
2886
2886
|
}
|
|
2887
|
-
let
|
|
2888
|
-
if (
|
|
2889
|
-
let t = Math.max(1,
|
|
2887
|
+
let pe = q, me = 0;
|
|
2888
|
+
if (D === "fill" && !E && q.length > 0) {
|
|
2889
|
+
let t = Math.max(1, M - 6), n = e.measureText(q).width;
|
|
2890
2890
|
if (n > 0 && n < t) {
|
|
2891
2891
|
let e = Math.max(1, Math.floor(t / n));
|
|
2892
|
-
|
|
2892
|
+
pe = q.repeat(e);
|
|
2893
2893
|
}
|
|
2894
2894
|
}
|
|
2895
|
-
if (
|
|
2896
|
-
let t = Math.max(1,
|
|
2897
|
-
n < t && (
|
|
2895
|
+
if (D === "distributed" || D === "justify" && !V.wrapText && !oe) {
|
|
2896
|
+
let t = Math.max(1, M - 6), n = e.measureText(pe).width, r = Math.max(1, [...pe].length - 1);
|
|
2897
|
+
n < t && (me = Math.max(0, (t - n) / r));
|
|
2898
2898
|
}
|
|
2899
|
-
let
|
|
2900
|
-
|
|
2899
|
+
let W, G;
|
|
2900
|
+
D === "right" ? (W = I + M - 3, G = "right") : D === "center" ? (W = I + M / 2, G = "center") : D === "centerContinuous" ? (W = ne + te / 2, G = "center") : D === "distributed" || D === "justify" && !V.wrapText && !oe ? (W = I + 3, G = "left") : (W = I + P, G = "left");
|
|
2901
2901
|
let K = V.textRotation ?? 0, he = K === 255, ge = K > 0 && K !== 255;
|
|
2902
|
-
if (H.iconSet &&
|
|
2903
|
-
let t = $(R.size,
|
|
2902
|
+
if (H.iconSet && N > 0 && (e.save(), e.beginPath(), e.rect(I, l, M, F), e.clip(), mi(e, H.iconSet.name, H.iconSet.index, I + 2, l + (F - N) / 2, N), e.restore()), e.save(), e.beginPath(), e.rect(ie, l, ae, F), e.clip(), he) {
|
|
2903
|
+
let t = $(R.size, S, 1.1), n = [...q].length * t, r = O === "top" ? l + 2 : O === "center" ? l + (F - n) / 2 : l + F - n - 2;
|
|
2904
2904
|
e.textAlign = "center", e.textBaseline = "top";
|
|
2905
2905
|
for (let n of q) {
|
|
2906
|
-
let i = n.codePointAt(0) ?? 0, a =
|
|
2907
|
-
pr(e, n, I +
|
|
2906
|
+
let i = n.codePointAt(0) ?? 0, a = B(i) && re(e, i);
|
|
2907
|
+
pr(e, n, I + M / 2, r, t, a), r += t;
|
|
2908
2908
|
}
|
|
2909
2909
|
e.restore();
|
|
2910
2910
|
return;
|
|
2911
2911
|
}
|
|
2912
2912
|
if (ge) {
|
|
2913
2913
|
let t = K <= 90 ? -(K * Math.PI / 180) : (K - 90) * Math.PI / 180;
|
|
2914
|
-
e.translate(I +
|
|
2914
|
+
e.translate(I + M / 2, l + F / 2), e.rotate(t), e.textAlign = "center", e.textBaseline = "middle", e.fillText(q, 0, 0), e.restore();
|
|
2915
2915
|
return;
|
|
2916
2916
|
}
|
|
2917
2917
|
if (V.shrinkToFit) {
|
|
2918
|
-
let t = e.measureText(q).width, n =
|
|
2918
|
+
let t = e.measureText(q).width, n = M - P - 3;
|
|
2919
2919
|
if (t > n && t > 0) {
|
|
2920
|
-
let r = n / t, i =
|
|
2920
|
+
let r = n / t, i = D === "right" ? I + M - 3 : D === "center" ? I + M / 2 : I + P;
|
|
2921
2921
|
e.transform(r, 0, 0, 1, i * (1 - r), 0);
|
|
2922
2922
|
}
|
|
2923
2923
|
}
|
|
2924
|
-
if (e.textAlign = G,
|
|
2925
|
-
e.letterSpacing = `${
|
|
2924
|
+
if (e.textAlign = G, me > 0) try {
|
|
2925
|
+
e.letterSpacing = `${me}px`;
|
|
2926
2926
|
} catch {}
|
|
2927
2927
|
try {
|
|
2928
2928
|
e.direction = er(V.readingOrder, q) ? "rtl" : "ltr";
|
|
2929
2929
|
} catch {}
|
|
2930
2930
|
let _e = L.value.type === "text" ? L.value.runs : void 0, ve = _e && _e.length > 0;
|
|
2931
|
-
if (V.wrapText && ve) li(e, _e,
|
|
2932
|
-
alignH:
|
|
2933
|
-
alignV:
|
|
2931
|
+
if (V.wrapText && ve) li(e, _e, h, {
|
|
2932
|
+
alignH: D,
|
|
2933
|
+
alignV: O,
|
|
2934
2934
|
cx: I,
|
|
2935
|
-
cy:
|
|
2936
|
-
cellW:
|
|
2937
|
-
cellH:
|
|
2938
|
-
leftPad:
|
|
2935
|
+
cy: l,
|
|
2936
|
+
cellW: M,
|
|
2937
|
+
cellH: F,
|
|
2938
|
+
leftPad: P,
|
|
2939
2939
|
paddingX: 3,
|
|
2940
2940
|
paddingY: 2
|
|
2941
|
-
},
|
|
2941
|
+
}, S, C, {
|
|
2942
2942
|
fontColor: H.fontColor,
|
|
2943
2943
|
readingOrder: V.readingOrder
|
|
2944
2944
|
});
|
|
2945
|
-
else if (V.wrapText) ci(e, q,
|
|
2946
|
-
alignH:
|
|
2947
|
-
alignV:
|
|
2945
|
+
else if (V.wrapText) ci(e, q, W, h, {
|
|
2946
|
+
alignH: D,
|
|
2947
|
+
alignV: O,
|
|
2948
2948
|
cx: I,
|
|
2949
|
-
cy:
|
|
2950
|
-
cellW:
|
|
2951
|
-
cellH:
|
|
2952
|
-
leftPad:
|
|
2949
|
+
cy: l,
|
|
2950
|
+
cellW: M,
|
|
2951
|
+
cellH: F,
|
|
2952
|
+
leftPad: P,
|
|
2953
2953
|
paddingX: 3,
|
|
2954
2954
|
paddingY: 2
|
|
2955
|
-
},
|
|
2956
|
-
else if (ve) si(e, _e,
|
|
2957
|
-
alignH:
|
|
2958
|
-
alignV:
|
|
2955
|
+
}, S);
|
|
2956
|
+
else if (ve) si(e, _e, h, {
|
|
2957
|
+
alignH: D,
|
|
2958
|
+
alignV: O,
|
|
2959
2959
|
cx: I,
|
|
2960
|
-
cy:
|
|
2961
|
-
cellW:
|
|
2962
|
-
cellH:
|
|
2963
|
-
leftPad:
|
|
2960
|
+
cy: l,
|
|
2961
|
+
cellW: M,
|
|
2962
|
+
cellH: F,
|
|
2963
|
+
leftPad: P,
|
|
2964
2964
|
paddingX: 3,
|
|
2965
2965
|
paddingY: 2
|
|
2966
|
-
},
|
|
2966
|
+
}, S, C, {
|
|
2967
2967
|
fontColor: H.fontColor,
|
|
2968
2968
|
readingOrder: V.readingOrder
|
|
2969
2969
|
});
|
|
2970
2970
|
else {
|
|
2971
|
-
let
|
|
2972
|
-
|
|
2973
|
-
let
|
|
2974
|
-
...
|
|
2975
|
-
size:
|
|
2976
|
-
} :
|
|
2977
|
-
|
|
2978
|
-
let
|
|
2979
|
-
let e = Math.min(
|
|
2971
|
+
let n = h.vertAlign, r = $(R.size, S), i = 0;
|
|
2972
|
+
n === "superscript" ? i = -Math.round(r * .35) : n === "subscript" && (i = Math.round(r * .1));
|
|
2973
|
+
let a = n ? {
|
|
2974
|
+
...h,
|
|
2975
|
+
size: h.size * .65
|
|
2976
|
+
} : h;
|
|
2977
|
+
n && (e.font = zr(a, S));
|
|
2978
|
+
let o = null, s = () => o ??= e.measureText(q), c = () => {
|
|
2979
|
+
let e = Math.min(s().width, ae - P - 3);
|
|
2980
2980
|
return {
|
|
2981
|
-
x:
|
|
2981
|
+
x: D === "right" ? I + M - 3 - e : D === "center" ? I + M / 2 - e / 2 : I + P,
|
|
2982
2982
|
width: e
|
|
2983
2983
|
};
|
|
2984
|
-
},
|
|
2985
|
-
if (
|
|
2986
|
-
let { x: t, width: n } =
|
|
2987
|
-
Hr(e, t, t + n,
|
|
2984
|
+
}, u = $(a.size, S);
|
|
2985
|
+
if (h.underline || g) {
|
|
2986
|
+
let { x: t, width: n } = c(), r = (O === "top" ? l + 2 + u + 1 : O === "center" ? l + F / 2 + Math.round(u * .55) : l + F - 2 + 1) + i, a = g ? "#0563C1" : T ? J(T) : "#000000", o = h.underlineStyle === "double" || h.underlineStyle === "doubleAccounting";
|
|
2987
|
+
Hr(e, t, t + n, r, a, o, C);
|
|
2988
2988
|
}
|
|
2989
|
-
if (
|
|
2990
|
-
let { x:
|
|
2991
|
-
e.save(), e.strokeStyle =
|
|
2989
|
+
if (h.strike) {
|
|
2990
|
+
let { x: n, width: r } = c(), a = (O === "top" ? l + 2 + Math.round(u * .5) : O === "center" ? l + F / 2 : l + F - 2 - Math.round(u * .35)) + i, o = a + t(a, .5, C);
|
|
2991
|
+
e.save(), e.strokeStyle = T ? J(T) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(n, o), e.lineTo(n + r, o), e.stroke(), e.restore();
|
|
2992
2992
|
}
|
|
2993
2993
|
if (q.includes("\n")) {
|
|
2994
|
-
let t = q.split("\n"), n = $(R.size,
|
|
2995
|
-
|
|
2996
|
-
for (let
|
|
2994
|
+
let t = q.split("\n"), n = $(R.size, S, 1.2, R.name ?? void 0), r = t.length * n, a;
|
|
2995
|
+
O === "top" ? (a = l + 2, e.textBaseline = "top") : O === "center" ? (a = l + (F - r) / 2, e.textBaseline = "top") : (a = l + F - r - 2, e.textBaseline = "top");
|
|
2996
|
+
for (let r = 0; r < t.length; r++) e.fillText(t[r], W, a + r * n + i);
|
|
2997
2997
|
} else {
|
|
2998
2998
|
let { baseline: t, textY: n } = ei({
|
|
2999
|
-
alignH:
|
|
3000
|
-
alignV:
|
|
2999
|
+
alignH: D,
|
|
3000
|
+
alignV: O,
|
|
3001
3001
|
cx: I,
|
|
3002
|
-
cy:
|
|
3003
|
-
cellW:
|
|
3004
|
-
cellH:
|
|
3005
|
-
leftPad:
|
|
3002
|
+
cy: l,
|
|
3003
|
+
cellW: M,
|
|
3004
|
+
cellH: F,
|
|
3005
|
+
leftPad: P,
|
|
3006
3006
|
paddingX: 3,
|
|
3007
3007
|
paddingY: 2
|
|
3008
3008
|
});
|
|
3009
|
-
e.textBaseline = t, e.fillText(
|
|
3009
|
+
e.textBaseline = t, e.fillText(pe, W, n + i);
|
|
3010
3010
|
}
|
|
3011
3011
|
}
|
|
3012
3012
|
let be = L.value.type === "text" ? L.value.phoneticRuns : void 0;
|
|
3013
3013
|
if (L.showPhonetic && be && be.length > 0 && !q.includes("\n")) {
|
|
3014
|
-
let t = zr(
|
|
3015
|
-
r =
|
|
3016
|
-
let i =
|
|
3017
|
-
Br(e, be, L.value.type === "text" ? L.value.phoneticPr : void 0, q, t,
|
|
3014
|
+
let t = zr(h, S), n = Vr(e, q, t), r;
|
|
3015
|
+
r = D === "right" ? I + M - 3 - n : D === "center" ? I + M / 2 - n / 2 : I + P;
|
|
3016
|
+
let i = T ? J(T) : "#000000";
|
|
3017
|
+
Br(e, be, L.value.type === "text" ? L.value.phoneticPr : void 0, q, t, _, r, l, S, i);
|
|
3018
3018
|
}
|
|
3019
|
-
e.restore(), q &&
|
|
3020
|
-
sheetName:
|
|
3021
|
-
cellRef: fr(
|
|
3019
|
+
e.restore(), q && n.onTextRun && n.onTextRun({
|
|
3020
|
+
sheetName: n.worksheet.name,
|
|
3021
|
+
cellRef: fr(i, c),
|
|
3022
3022
|
text: q,
|
|
3023
3023
|
x: I,
|
|
3024
|
-
y:
|
|
3025
|
-
width:
|
|
3026
|
-
height:
|
|
3027
|
-
row:
|
|
3028
|
-
col:
|
|
3024
|
+
y: l,
|
|
3025
|
+
width: M,
|
|
3026
|
+
height: F,
|
|
3027
|
+
row: i,
|
|
3028
|
+
col: c
|
|
3029
3029
|
});
|
|
3030
3030
|
});
|
|
3031
3031
|
}
|
|
3032
3032
|
}
|
|
3033
|
-
for (let e of
|
|
3033
|
+
for (let e of P) e();
|
|
3034
3034
|
for (let e of ee) e();
|
|
3035
|
-
for (let e of
|
|
3035
|
+
for (let e of N) e();
|
|
3036
3036
|
e.restore();
|
|
3037
3037
|
}
|
|
3038
3038
|
var xi = /* @__PURE__ */ new WeakMap();
|
|
@@ -3241,7 +3241,7 @@ function Ii(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g) {
|
|
|
3241
3241
|
bold: E,
|
|
3242
3242
|
italic: D
|
|
3243
3243
|
} : v, m);
|
|
3244
|
-
let O = y.alignH ?? "left", k = y.indent ? Math.round(y.indent * 3 * h) : 0, A = c.sizeOf(u), j = l.sizeOf(i), M = b.iconSet ? Math.max(8, Math.round(Math.min(A, j) * .55)) : 0,
|
|
3244
|
+
let O = y.alignH ?? "left", k = y.indent ? Math.round(y.indent * 3 * h) : 0, A = c.sizeOf(u), j = l.sizeOf(i), M = b.iconSet ? Math.max(8, Math.round(Math.min(A, j) * .55)) : 0, N = M > 0 ? M + 4 : 0, ee = 3 + (O === "left" || !y.alignH ? k : 0) + N, P = e.measureText(x).width + ee + 3, F = Math.max(0, P - A);
|
|
3245
3245
|
return F <= 0 ? !1 : (O === "center" || O === "centerContinuous" ? F / 2 : ((g ? d === "higher" ? "left" : "right" : d === "higher" ? "right" : "left") == "left" ? O === "right" : O !== "right") ? F : 0) > f;
|
|
3246
3246
|
};
|
|
3247
3247
|
for (let e of u) {
|
|
@@ -3261,104 +3261,104 @@ function Ii(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g) {
|
|
|
3261
3261
|
function Li(e, t) {
|
|
3262
3262
|
xi.set(t, Ci(e));
|
|
3263
3263
|
}
|
|
3264
|
-
function Ri(e,
|
|
3265
|
-
let
|
|
3266
|
-
e.clearRect(0, 0,
|
|
3267
|
-
let
|
|
3268
|
-
for (let e of
|
|
3269
|
-
let t =
|
|
3270
|
-
Ln(
|
|
3264
|
+
function Ri(e, n, r, i, a = {}) {
|
|
3265
|
+
let o = a.dpr ?? 1, s = a.cellScale ?? 1, c = n.isChartSheet === !0, l = Q(n), u = l.maximumDigitWidth, d = e.canvas.width / o, f = e.canvas.height / o;
|
|
3266
|
+
e.clearRect(0, 0, d, f), e.fillStyle = "#ffffff", e.fillRect(0, 0, d, f);
|
|
3267
|
+
let p = (e) => Math.round(e * s), m = c ? 0 : p(50), h = c ? 0 : p(22), { row: g, col: _, rows: v, cols: y } = i, b = (a.scrollOffsetX ?? 0) * s, x = (a.scrollOffsetY ?? 0) * s, { col: S, row: C } = l.axesAtScale(s), w = S.bandsToCover(1, c ? 0 : a.freezeCols ?? 0, Math.max(0, d - m)), T = C.bandsToCover(1, c ? 0 : a.freezeRows ?? 0, Math.max(0, f - h)), E = T.at(-1)?.index ?? 0, D = w.at(-1)?.index ?? 0, O = w.map(({ index: e }) => e), k = T.map(({ index: e }) => e), A = w.map(({ size: e }) => e), j = T.map(({ size: e }) => e), M = A.reduce((e, t) => e + t, 0), N = j.reduce((e, t) => e + t, 0), ee = S.bandsToCover(_, Math.min(16384, _ + y - 1)), P = C.bandsToCover(g, Math.min(1048576, g + v - 1)), F = ee.map(({ index: e }) => e), te = P.map(({ index: e }) => e), I = ee.map(({ size: e }) => e), L = P.map(({ size: e }) => e), { cellMap: R, cfContext: z, mergeSkipSet: ne, autoFilterCells: B, hyperlinkMap: V, commentCells: re, tableStyleMap: H, sparklineMap: ie, nonEmptyColsByRow: U } = Ci(n), ae = /* @__PURE__ */ new Map(), oe = Si("worksheet-merge-anchor-index", "index-merge-anchor-coordinates");
|
|
3268
|
+
for (let e of n.mergeCells ?? []) {
|
|
3269
|
+
let t = S.offsetOf(e.right + 1) - S.offsetOf(e.left), n = C.offsetOf(e.bottom + 1) - C.offsetOf(e.top);
|
|
3270
|
+
Ln(ae, `${e.top}:${e.left}`, {
|
|
3271
3271
|
totalW: t,
|
|
3272
3272
|
totalH: n,
|
|
3273
3273
|
right: e.right,
|
|
3274
3274
|
bottom: e.bottom
|
|
3275
|
-
},
|
|
3275
|
+
}, oe);
|
|
3276
3276
|
}
|
|
3277
|
-
let
|
|
3278
|
-
worksheet:
|
|
3279
|
-
styles:
|
|
3277
|
+
let se = F[0] ?? _, ce = F.at(-1) ?? Math.min(16384, _ + y - 1), le = Ii(e, n, r, R, U, z, H, ae, S, C, [...new Set([...k, ...te])], se, ce, D + 1, s, u, n.rightToLeft === !0), ue = S.bandsToCover(le.startCol, le.endCol), de = ue.map(({ index: e }) => e), fe = ue.map(({ size: e }) => e), pe = b + S.offsetOf(se) - S.offsetOf(le.startCol), me = {
|
|
3278
|
+
worksheet: n,
|
|
3279
|
+
styles: r,
|
|
3280
3280
|
cellMap: R,
|
|
3281
|
-
mergeAnchorMap:
|
|
3281
|
+
mergeAnchorMap: ae,
|
|
3282
3282
|
mergeSkipSet: ne,
|
|
3283
|
-
cfContext:
|
|
3284
|
-
colWidths:
|
|
3283
|
+
cfContext: z,
|
|
3284
|
+
colWidths: fe,
|
|
3285
3285
|
rowHeights: L,
|
|
3286
|
-
colAxis:
|
|
3287
|
-
rowAxis:
|
|
3288
|
-
frozenColWidths:
|
|
3289
|
-
frozenRowHeights:
|
|
3290
|
-
frozenW:
|
|
3291
|
-
frozenH:
|
|
3292
|
-
startRow:
|
|
3293
|
-
startCol:
|
|
3294
|
-
cs:
|
|
3295
|
-
dpr:
|
|
3286
|
+
colAxis: S,
|
|
3287
|
+
rowAxis: C,
|
|
3288
|
+
frozenColWidths: A,
|
|
3289
|
+
frozenRowHeights: j,
|
|
3290
|
+
frozenW: M,
|
|
3291
|
+
frozenH: N,
|
|
3292
|
+
startRow: g,
|
|
3293
|
+
startCol: _,
|
|
3294
|
+
cs: s,
|
|
3295
|
+
dpr: o,
|
|
3296
3296
|
autoFilterCells: B,
|
|
3297
|
-
hyperlinkMap:
|
|
3298
|
-
commentCells:
|
|
3297
|
+
hyperlinkMap: V,
|
|
3298
|
+
commentCells: re,
|
|
3299
3299
|
tableStyleMap: H,
|
|
3300
|
-
sparklineMap:
|
|
3301
|
-
overflowTextAnchors:
|
|
3302
|
-
mdw:
|
|
3303
|
-
onTextRun:
|
|
3304
|
-
rtl:
|
|
3305
|
-
canvasW:
|
|
3306
|
-
threeD:
|
|
3307
|
-
},
|
|
3308
|
-
|
|
3309
|
-
let ve =
|
|
3310
|
-
if (
|
|
3300
|
+
sparklineMap: ie,
|
|
3301
|
+
overflowTextAnchors: le.anchorKeys,
|
|
3302
|
+
mdw: u,
|
|
3303
|
+
onTextRun: a.onTextRun,
|
|
3304
|
+
rtl: n.rightToLeft === !0,
|
|
3305
|
+
canvasW: d,
|
|
3306
|
+
threeD: a.threeD
|
|
3307
|
+
}, W = m, G = h, K = W + M, he = G + N, ge = Math.max(0, d - K), _e = Math.max(0, f - he);
|
|
3308
|
+
E > 0 && D > 0 && bi(e, me, 1, 1, A, j, O, k, 0, 0, W, G, W, G, M, N), E > 0 && bi(e, me, 1, le.startCol, fe, j, de, k, pe, 0, K, G, K, G, ge, N), D > 0 && bi(e, me, g, 1, A, L, O, te, 0, x, W, he, W, he, M, _e), c || bi(e, me, g, le.startCol, fe, L, de, te, pe, x, K, he, K, he, ge, _e), Bi(e, n, S, C, a.loadedImages, s, g, _, b, x, K, he, ge, _e, n.rightToLeft === !0, d, a.threeD, a.regionMap, a.chartEx), !c && n.slicers && n.slicers.length > 0 && Sa(e, n, S, C, s, g, _, b, x, K, he, ge, _e, n.rightToLeft === !0, d), c || zi(e, d, f, g, _, v, y, I, L, F, te, b, x, A, j, O, k, M, N, m, h, s, o, a.selectedRowRange ?? null, a.selectedColRange ?? null, n.rightToLeft === !0, a.chromeColors);
|
|
3309
|
+
let ve = n.rightToLeft === !0;
|
|
3310
|
+
if (E > 0) {
|
|
3311
3311
|
e.save(), e.strokeStyle = Er, e.lineWidth = .5, e.beginPath();
|
|
3312
|
-
let
|
|
3313
|
-
e.moveTo(0,
|
|
3312
|
+
let n = he + t(he, .5, o);
|
|
3313
|
+
e.moveTo(0, n), e.lineTo(d, n), e.stroke(), e.restore();
|
|
3314
3314
|
}
|
|
3315
|
-
if (
|
|
3315
|
+
if (D > 0) {
|
|
3316
3316
|
e.save(), e.strokeStyle = Er, e.lineWidth = .5, e.beginPath();
|
|
3317
|
-
let
|
|
3318
|
-
e.moveTo(
|
|
3319
|
-
}
|
|
3320
|
-
}
|
|
3321
|
-
function zi(e,
|
|
3322
|
-
let
|
|
3323
|
-
e.fillStyle =
|
|
3324
|
-
let
|
|
3325
|
-
e.moveTo(
|
|
3326
|
-
let
|
|
3327
|
-
let
|
|
3328
|
-
e.fillStyle = ee(
|
|
3329
|
-
let
|
|
3330
|
-
e.moveTo(
|
|
3331
|
-
}, H = (
|
|
3332
|
-
let
|
|
3333
|
-
e.fillStyle =
|
|
3334
|
-
let
|
|
3335
|
-
e.moveTo(
|
|
3336
|
-
let
|
|
3337
|
-
|
|
3317
|
+
let n = ve ? d - K : K, r = n + t(n, .5, o);
|
|
3318
|
+
e.moveTo(r, h), e.lineTo(r, f), e.stroke(), e.restore();
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
function zi(e, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T, E, D) {
|
|
3322
|
+
let O = D?.surface ?? "#f8f9fa", k = D?.mutedSurface ?? "#e8eaed", A = D?.selectedSurface ?? "#caddf6", j = D?.border ?? "#c8ccd0", M = D?.accent ?? "#5b9bd5", N = D?.text ?? "#444", ee = (e) => !T || e < T.start || e > T.end ? O : T.strong ? A : k, P = (e) => !T || e < T.start || e > T.end ? j : T.strong ? M : j, F = (e) => !w || e < w.start || e > w.end ? O : w.strong ? A : k, te = (e) => !w || e < w.start || e > w.end ? j : w.strong ? M : j, I = `${Math.max(1, Math.round(11 * S))}px ${vr}`, L = b + v, R = x + y, z = .5 / C, ne = (e, t) => E ? wr(e, t, n) : e, B = E ? n - b : 0;
|
|
3323
|
+
e.fillStyle = O, e.fillRect(B, 0, b, x), e.strokeStyle = j, e.lineWidth = .5, e.beginPath();
|
|
3324
|
+
let V = E ? B + t(B, .5, C) : B + b - z;
|
|
3325
|
+
e.moveTo(V, 0), e.lineTo(V, x), e.moveTo(B, x - z), e.lineTo(B + b, x - z), e.stroke(), e.font = I, e.fillStyle = N;
|
|
3326
|
+
let re = (n, r, i) => {
|
|
3327
|
+
let a = ne(r, i);
|
|
3328
|
+
e.fillStyle = ee(n), e.fillRect(a, 0, i, x), e.strokeStyle = P(n), e.lineWidth = .5, e.beginPath();
|
|
3329
|
+
let o = a + t(a, .5, C);
|
|
3330
|
+
e.moveTo(o, 0), e.lineTo(o, x), e.moveTo(a, x - z), e.lineTo(a + i, x - z), e.stroke(), e.fillStyle = N, e.textAlign = "center", e.textBaseline = "middle", e.fillText(ui(n), a + i / 2, x / 2);
|
|
3331
|
+
}, H = (n, r, i) => {
|
|
3332
|
+
let a = B;
|
|
3333
|
+
e.fillStyle = F(n), e.fillRect(a, r, b, i), e.strokeStyle = te(n), e.lineWidth = .5, e.beginPath();
|
|
3334
|
+
let o = r + t(r, .5, C), s = E ? a + t(a, .5, C) : a + b - z;
|
|
3335
|
+
e.moveTo(s, r), e.lineTo(s, r + i), e.moveTo(a, o), e.lineTo(a + b, o), e.stroke(), e.fillStyle = N, e.textBaseline = "middle";
|
|
3336
|
+
let c = Math.max(2, Math.round(4 * S));
|
|
3337
|
+
E ? (e.textAlign = "left", e.fillText(String(n), a + c, r + i / 2)) : (e.textAlign = "right", e.fillText(String(n), a + b - c, r + i / 2));
|
|
3338
3338
|
};
|
|
3339
|
-
if (
|
|
3340
|
-
e.save(), e.beginPath(), e.rect(ne(
|
|
3341
|
-
let t = y;
|
|
3342
|
-
for (let e = 0; e < p.length; e++) V(h[e], t, p[e]), t += p[e];
|
|
3343
|
-
e.restore();
|
|
3344
|
-
}
|
|
3345
|
-
e.save(), e.beginPath(), e.rect(ne(L, t - L), 0, t - L, b), e.clip();
|
|
3346
|
-
let U = L - d;
|
|
3347
|
-
for (let e = 0; e < s.length; e++) {
|
|
3348
|
-
let n = s[e];
|
|
3349
|
-
U + n > L && U < t && V(l[e], U, n), U += n;
|
|
3350
|
-
}
|
|
3351
|
-
if (e.restore(), m.length > 0) {
|
|
3352
|
-
e.save(), e.beginPath(), e.rect(B, b, y, v), e.clip();
|
|
3339
|
+
if (m.length > 0) {
|
|
3340
|
+
e.save(), e.beginPath(), e.rect(ne(b, v), 0, v, x), e.clip();
|
|
3353
3341
|
let t = b;
|
|
3354
|
-
for (let e = 0; e < m.length; e++)
|
|
3342
|
+
for (let e = 0; e < m.length; e++) re(g[e], t, m[e]), t += m[e];
|
|
3355
3343
|
e.restore();
|
|
3356
3344
|
}
|
|
3357
|
-
e.save(), e.beginPath(), e.rect(
|
|
3358
|
-
let
|
|
3345
|
+
e.save(), e.beginPath(), e.rect(ne(L, n - L), 0, n - L, x), e.clip();
|
|
3346
|
+
let ie = L - f;
|
|
3359
3347
|
for (let e = 0; e < c.length; e++) {
|
|
3360
3348
|
let t = c[e];
|
|
3361
|
-
|
|
3349
|
+
ie + t > L && ie < n && re(u[e], ie, t), ie += t;
|
|
3350
|
+
}
|
|
3351
|
+
if (e.restore(), h.length > 0) {
|
|
3352
|
+
e.save(), e.beginPath(), e.rect(B, x, b, y), e.clip();
|
|
3353
|
+
let t = x;
|
|
3354
|
+
for (let e = 0; e < h.length; e++) H(_[e], t, h[e]), t += h[e];
|
|
3355
|
+
e.restore();
|
|
3356
|
+
}
|
|
3357
|
+
e.save(), e.beginPath(), e.rect(B, R, b, r - R), e.clip();
|
|
3358
|
+
let U = R - p;
|
|
3359
|
+
for (let e = 0; e < l.length; e++) {
|
|
3360
|
+
let t = l[e];
|
|
3361
|
+
U + t > R && U < r && H(d[e], U, t), U += t;
|
|
3362
3362
|
}
|
|
3363
3363
|
e.restore();
|
|
3364
3364
|
}
|
|
@@ -3438,7 +3438,7 @@ function Wi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g = t.shapeGroups ??
|
|
|
3438
3438
|
}
|
|
3439
3439
|
e.restore();
|
|
3440
3440
|
}
|
|
3441
|
-
function Gi(e, t, n, r, i, a,
|
|
3441
|
+
function Gi(e, t, n, r, i, a, s, c) {
|
|
3442
3442
|
if (e.save(), t.rot !== 0 || t.flipH || t.flipV ? (e.translate(n + i / 2, r + a / 2), e.rotate(t.rot * Math.PI / 180), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), e.translate(-i / 2, -a / 2)) : e.translate(n, r), t.geom.type === "custom") for (let n of t.geom.paths) {
|
|
3443
3443
|
if (n.w <= 0 || n.h <= 0) continue;
|
|
3444
3444
|
let r = i / n.w, o = a / n.h;
|
|
@@ -3483,21 +3483,21 @@ function Gi(e, t, n, r, i, a, o, s) {
|
|
|
3483
3483
|
fillType: "solid",
|
|
3484
3484
|
color: t.fillColor
|
|
3485
3485
|
} : null), e, 0, 0, i, a, t.rot), r = t.strokeColor && t.strokeWidth > 0 ? () => ea(e, t, i, a) : null;
|
|
3486
|
-
|
|
3486
|
+
o(e, t.geom.name, 0, 0, i, a, t.geom.adj ?? [], n, r, () => {}) || (e.beginPath(), e.rect(0, 0, i, a), Qi(e, t, i, a));
|
|
3487
3487
|
} else if (t.geom.type === "image") {
|
|
3488
|
-
let n =
|
|
3488
|
+
let n = c?.get(hr(t.geom.imagePath, t.geom.duotone));
|
|
3489
3489
|
if (n) {
|
|
3490
3490
|
let r = t.geom.alpha;
|
|
3491
3491
|
r != null && r < 1 ? (e.save(), e.globalAlpha = r, Fe(e, n, t.geom.srcRect, 0, 0, i, a), e.restore()) : Fe(e, n, t.geom.srcRect, 0, 0, i, a);
|
|
3492
3492
|
}
|
|
3493
3493
|
}
|
|
3494
|
-
t.text && Zi(e, t.text, i, a,
|
|
3494
|
+
t.text && Zi(e, t.text, i, a, s), e.restore();
|
|
3495
3495
|
}
|
|
3496
3496
|
var Ki = /* @__PURE__ */ new WeakMap();
|
|
3497
3497
|
function qi(e, t) {
|
|
3498
3498
|
let n = e.tinted.get(t);
|
|
3499
3499
|
if (n) return n;
|
|
3500
|
-
let r =
|
|
3500
|
+
let r = V(e.raster, t);
|
|
3501
3501
|
return e.tinted.set(t, r), r;
|
|
3502
3502
|
}
|
|
3503
3503
|
function Ji(e) {
|
|
@@ -3517,7 +3517,7 @@ async function Xi(e, t) {
|
|
|
3517
3517
|
if (n.length !== 0) {
|
|
3518
3518
|
await t.loadMathJax();
|
|
3519
3519
|
for (let e of n) if (!Ki.has(e.nodes)) try {
|
|
3520
|
-
let n = await t.mathMLToSvg(
|
|
3520
|
+
let n = await t.mathMLToSvg(F(e.nodes, e.display)), r = await ne(n, "#000000");
|
|
3521
3521
|
Ki.set(e.nodes, {
|
|
3522
3522
|
raster: r,
|
|
3523
3523
|
widthEm: n.widthEm,
|
|
@@ -3550,7 +3550,7 @@ function Zi(e, t, n, r, i) {
|
|
|
3550
3550
|
return n.spaceLine && (n.spaceLine.type === "pct" ? r *= n.spaceLine.val / 1e5 : r = n.spaceLine.val * Ve * i), t.autoFit === "norm" && t.lnSpcReduction != null && n.spaceLine?.type !== "pts" && (r *= 1 - t.lnSpcReduction), r;
|
|
3551
3551
|
}, T = () => {
|
|
3552
3552
|
if (b === 0) {
|
|
3553
|
-
let e = (E || Cr) * Ve * i, t = Math.max(
|
|
3553
|
+
let e = (E || Cr) * Ve * i, t = Math.max(z(D, e), z(O, e)), n = e * 1.2;
|
|
3554
3554
|
b = C ? n : Math.max(n, t), x = f(`${e}px ${Sr(D)}`, e);
|
|
3555
3555
|
}
|
|
3556
3556
|
b = w(b), m.push({
|
|
@@ -3602,7 +3602,7 @@ function Zi(e, t, n, r, i) {
|
|
|
3602
3602
|
continue;
|
|
3603
3603
|
}
|
|
3604
3604
|
E = t.size > 0 ? t.size : Cr, D = t.fontFace, O = t.fontFaceEa;
|
|
3605
|
-
let { font: n, px: o } = d(t), s = t.color ?? "#000000", c = Math.max(
|
|
3605
|
+
let { font: n, px: o } = d(t), s = t.color ?? "#000000", c = Math.max(z(t.fontFace, o), z(t.fontFaceEa, o)), l = o * 1.2, g = C ? l : Math.max(l, c);
|
|
3606
3606
|
b = Math.max(b, g), x = Math.max(x, f(n, o)), e.font = n;
|
|
3607
3607
|
let k = t.text.split("\n");
|
|
3608
3608
|
for (let t = 0; t < k.length; t++) {
|
|
@@ -3748,84 +3748,84 @@ function ra(e, t, n, r, i = 1) {
|
|
|
3748
3748
|
innerEnd: r ? t - i : t
|
|
3749
3749
|
};
|
|
3750
3750
|
}
|
|
3751
|
-
function ia(e,
|
|
3752
|
-
let
|
|
3751
|
+
function ia(e, n, r, i, a, o, s = 1) {
|
|
3752
|
+
let c = [
|
|
3753
3753
|
{
|
|
3754
|
-
edge:
|
|
3755
|
-
x1:
|
|
3756
|
-
y1:
|
|
3757
|
-
x2:
|
|
3758
|
-
y2:
|
|
3754
|
+
edge: n.top,
|
|
3755
|
+
x1: r,
|
|
3756
|
+
y1: i,
|
|
3757
|
+
x2: r + a,
|
|
3758
|
+
y2: i,
|
|
3759
3759
|
kind: "h"
|
|
3760
3760
|
},
|
|
3761
3761
|
{
|
|
3762
|
-
edge:
|
|
3763
|
-
x1:
|
|
3764
|
-
y1:
|
|
3765
|
-
x2:
|
|
3766
|
-
y2:
|
|
3762
|
+
edge: n.bottom,
|
|
3763
|
+
x1: r,
|
|
3764
|
+
y1: i + o,
|
|
3765
|
+
x2: r + a,
|
|
3766
|
+
y2: i + o,
|
|
3767
3767
|
kind: "h"
|
|
3768
3768
|
},
|
|
3769
3769
|
{
|
|
3770
|
-
edge:
|
|
3771
|
-
x1:
|
|
3772
|
-
y1:
|
|
3773
|
-
x2:
|
|
3774
|
-
y2:
|
|
3770
|
+
edge: n.left,
|
|
3771
|
+
x1: r,
|
|
3772
|
+
y1: i,
|
|
3773
|
+
x2: r,
|
|
3774
|
+
y2: i + o,
|
|
3775
3775
|
kind: "v"
|
|
3776
3776
|
},
|
|
3777
3777
|
{
|
|
3778
|
-
edge:
|
|
3779
|
-
x1:
|
|
3780
|
-
y1:
|
|
3781
|
-
x2:
|
|
3782
|
-
y2:
|
|
3778
|
+
edge: n.right,
|
|
3779
|
+
x1: r + a,
|
|
3780
|
+
y1: i,
|
|
3781
|
+
x2: r + a,
|
|
3782
|
+
y2: i + o,
|
|
3783
3783
|
kind: "v"
|
|
3784
3784
|
},
|
|
3785
3785
|
{
|
|
3786
|
-
edge:
|
|
3787
|
-
x1:
|
|
3788
|
-
y1:
|
|
3789
|
-
x2:
|
|
3790
|
-
y2:
|
|
3786
|
+
edge: n.diagonalUp,
|
|
3787
|
+
x1: r,
|
|
3788
|
+
y1: i + o,
|
|
3789
|
+
x2: r + a,
|
|
3790
|
+
y2: i,
|
|
3791
3791
|
kind: "d"
|
|
3792
3792
|
},
|
|
3793
3793
|
{
|
|
3794
|
-
edge:
|
|
3795
|
-
x1:
|
|
3796
|
-
y1:
|
|
3797
|
-
x2:
|
|
3798
|
-
y2:
|
|
3794
|
+
edge: n.diagonalDown,
|
|
3795
|
+
x1: r,
|
|
3796
|
+
y1: i,
|
|
3797
|
+
x2: r + a,
|
|
3798
|
+
y2: i + o,
|
|
3799
3799
|
kind: "d"
|
|
3800
3800
|
}
|
|
3801
3801
|
];
|
|
3802
|
-
for (let { edge:
|
|
3803
|
-
if (!
|
|
3804
|
-
let
|
|
3805
|
-
if (
|
|
3806
|
-
e.strokeStyle =
|
|
3807
|
-
let t =
|
|
3808
|
-
e.beginPath(), e.moveTo(
|
|
3802
|
+
for (let { edge: l, x1: u, y1: d, x2: f, y2: p, kind: m } of c) {
|
|
3803
|
+
if (!l || !l.style || l.style === "none") continue;
|
|
3804
|
+
let c = l.color ? J(l.color) : "#000000";
|
|
3805
|
+
if (l.style === "double" && m === "d") {
|
|
3806
|
+
e.strokeStyle = c, e.lineWidth = 1, e.setLineDash([]);
|
|
3807
|
+
let t = f - u, n = p - d, r = Math.hypot(t, n), i = -n / r * 1, a = t / r * 1;
|
|
3808
|
+
e.beginPath(), e.moveTo(u + i, d + a), e.lineTo(f + i, p + a), e.moveTo(u - i, d - a), e.lineTo(f - i, p - a), e.stroke();
|
|
3809
3809
|
continue;
|
|
3810
3810
|
}
|
|
3811
|
-
if (
|
|
3812
|
-
if (e.strokeStyle =
|
|
3813
|
-
let
|
|
3811
|
+
if (l.style === "double" && m !== "d") {
|
|
3812
|
+
if (e.strokeStyle = c, e.lineWidth = 1, e.setLineDash([]), e.beginPath(), m === "h") {
|
|
3813
|
+
let t = d === i, s = t ? i - 1 : i + o + 1, c = t ? i + 1 : i + o - 1, l = ra(r, r + a, !!n.left?.style && n.left.style !== "none", !!n.right?.style && n.right.style !== "none", 1);
|
|
3814
3814
|
e.moveTo(l.outerStart, s), e.lineTo(l.outerEnd, s), e.moveTo(l.innerStart, c), e.lineTo(l.innerEnd, c);
|
|
3815
3815
|
} else {
|
|
3816
|
-
let
|
|
3817
|
-
e.moveTo(s,
|
|
3816
|
+
let t = u === r, s = t ? r - 1 : r + a + 1, c = t ? r + 1 : r + a - 1, l = ra(i, i + o, !!n.top?.style && n.top.style !== "none", !!n.bottom?.style && n.bottom.style !== "none", 1);
|
|
3817
|
+
e.moveTo(s, l.outerStart), e.lineTo(s, l.outerEnd), e.moveTo(c, l.innerStart), e.lineTo(c, l.innerEnd);
|
|
3818
3818
|
}
|
|
3819
3819
|
e.stroke();
|
|
3820
3820
|
continue;
|
|
3821
3821
|
}
|
|
3822
|
-
e.beginPath(), e.strokeStyle =
|
|
3823
|
-
let
|
|
3824
|
-
e.lineWidth =
|
|
3825
|
-
let
|
|
3826
|
-
e.setLineDash(
|
|
3827
|
-
let
|
|
3828
|
-
e.moveTo(
|
|
3822
|
+
e.beginPath(), e.strokeStyle = c;
|
|
3823
|
+
let h = aa(l.style);
|
|
3824
|
+
e.lineWidth = h;
|
|
3825
|
+
let g = oa(l.style);
|
|
3826
|
+
e.setLineDash(g);
|
|
3827
|
+
let _ = m === "v" ? t(u, h, s) : 0, v = m === "h" ? t(d, h, s) : 0;
|
|
3828
|
+
e.moveTo(u + _, d + v), e.lineTo(f + _, p + v), e.stroke(), e.setLineDash([]);
|
|
3829
3829
|
}
|
|
3830
3830
|
}
|
|
3831
3831
|
function aa(e) {
|
|
@@ -3983,12 +3983,12 @@ async function ja(e, t, n, r, i = 0, a = 0, o = null, s = null, c, l = !1) {
|
|
|
3983
3983
|
svgImagePath: n,
|
|
3984
3984
|
srcRect: o
|
|
3985
3985
|
};
|
|
3986
|
-
if (!s &&
|
|
3987
|
-
return await
|
|
3986
|
+
if (!s && D(p)) try {
|
|
3987
|
+
return await U(p.svgImagePath, r);
|
|
3988
3988
|
} catch {
|
|
3989
|
-
return u ?
|
|
3989
|
+
return u ? U(e, r) : f();
|
|
3990
3990
|
}
|
|
3991
|
-
return u ?
|
|
3991
|
+
return u ? U(e, r) : f();
|
|
3992
3992
|
}
|
|
3993
3993
|
async function Ma(e, t, n, r) {
|
|
3994
3994
|
if (t.clear(), !n) return;
|
|
@@ -4054,7 +4054,7 @@ function Pa(e, t, n) {
|
|
|
4054
4054
|
return ur.forWorksheet(i, a), ki(e, i, n), ur.forWorksheet(i, a), Na.set(t, i), i;
|
|
4055
4055
|
}
|
|
4056
4056
|
async function Fa(e, t, n, r = {}) {
|
|
4057
|
-
let i = r.fetchImage ?
|
|
4057
|
+
let i = r.fetchImage ? A(r.fetchImage) : void 0;
|
|
4058
4058
|
try {
|
|
4059
4059
|
await Ia(e, t, n, r);
|
|
4060
4060
|
} finally {
|
|
@@ -4064,7 +4064,7 @@ async function Fa(e, t, n, r = {}) {
|
|
|
4064
4064
|
async function Ia(e, t, n, r = {}) {
|
|
4065
4065
|
let i = e.styles, a = t.getContext("2d");
|
|
4066
4066
|
if (!a) throw Error("XLSX render target does not provide a 2-D canvas context");
|
|
4067
|
-
let o = Pa(a, e.ws, i), s =
|
|
4067
|
+
let o = Pa(a, e.ws, i), s = H(t) ? t.clientWidth || 800 : t.width, c = H(t) ? t.clientHeight || 600 : t.height, l = r.width ?? s, u = r.height ?? c, d = /* @__PURE__ */ new Map();
|
|
4068
4068
|
if (await Ma(o, d, r.fetchImage, {
|
|
4069
4069
|
viewport: n,
|
|
4070
4070
|
width: l,
|
|
@@ -4073,8 +4073,8 @@ async function Ia(e, t, n, r = {}) {
|
|
|
4073
4073
|
freezeRows: r.freezeRows,
|
|
4074
4074
|
freezeCols: r.freezeCols
|
|
4075
4075
|
}), e.math && Yi(o) && await Xi(o, e.math), r[Oa]?.() === !1) return;
|
|
4076
|
-
let f = r.dpr ??
|
|
4077
|
-
if (t.width !== h && (t.width = h), t.height !== g && (t.height = g),
|
|
4076
|
+
let f = r.dpr ?? j(), p = Ue(l * f, u * f), m = p.clamped ? f * p.scale : f, h = p.width, g = p.height;
|
|
4077
|
+
if (t.width !== h && (t.width = h), t.height !== g && (t.height = g), H(t)) {
|
|
4078
4078
|
let e = `${l}px`, n = `${u}px`;
|
|
4079
4079
|
t.style.width !== e && (t.style.width = e), t.style.height !== n && (t.style.height = n);
|
|
4080
4080
|
}
|
|
@@ -4113,8 +4113,8 @@ function La(e, t, n, r, i) {
|
|
|
4113
4113
|
//#endregion
|
|
4114
4114
|
//#region packages/xlsx/src/google-fonts.ts
|
|
4115
4115
|
var Ra = {
|
|
4116
|
-
...
|
|
4117
|
-
...
|
|
4116
|
+
...g,
|
|
4117
|
+
...h
|
|
4118
4118
|
};
|
|
4119
4119
|
function* za(e) {
|
|
4120
4120
|
for (let t of e?.sharedStrings ?? []) if (t.runs && t.runs.length > 0) for (let e of t.runs) yield e.text;
|
|
@@ -4122,8 +4122,8 @@ function* za(e) {
|
|
|
4122
4122
|
}
|
|
4123
4123
|
function Ba(e) {
|
|
4124
4124
|
let t = /* @__PURE__ */ new Set(), n = null;
|
|
4125
|
-
for (let r of e?.styles?.fonts ?? []) r.name && (t.add(r.name), n ??=
|
|
4126
|
-
for (let r of
|
|
4125
|
+
for (let r of e?.styles?.fonts ?? []) r.name && (t.add(r.name), n ??= I(r.name));
|
|
4126
|
+
for (let r of p(za(e), n)) t.add(r);
|
|
4127
4127
|
return t;
|
|
4128
4128
|
}
|
|
4129
4129
|
function Va(e) {
|
|
@@ -4249,7 +4249,7 @@ var Ya = Symbol("retain-xlsx-viewer-fonts"), Xa = Symbol("prepare-xlsx-viewer-ro
|
|
|
4249
4249
|
sheetLoads = /* @__PURE__ */ new Map();
|
|
4250
4250
|
rawParts = new Ee({
|
|
4251
4251
|
maxEntries: 64,
|
|
4252
|
-
maxBytes:
|
|
4252
|
+
maxBytes: S
|
|
4253
4253
|
});
|
|
4254
4254
|
queuedImageLoads = /* @__PURE__ */ new Map();
|
|
4255
4255
|
_fetchImage = (e, t) => this.getImageWithinArchiveOperation(e, t);
|
|
@@ -4274,9 +4274,9 @@ var Ya = Symbol("retain-xlsx-viewer-fonts"), Xa = Symbol("prepare-xlsx-viewer-ro
|
|
|
4274
4274
|
};
|
|
4275
4275
|
resourceFailure = null;
|
|
4276
4276
|
constructor(e, t, n) {
|
|
4277
|
-
this.worker = e, this._mode = t, this.bridge = new
|
|
4277
|
+
this.worker = e, this._mode = t, this.bridge = new ce(this.worker, {
|
|
4278
4278
|
correlate: (e) => "protocol" in e && e.protocol === "ooxml-pull-v1" ? e.requestId : "id" in e ? e.id : void 0,
|
|
4279
|
-
toError: (e) => "type" in e && e.type === "error" ?
|
|
4279
|
+
toError: (e) => "type" in e && e.type === "error" ? C(e) : void 0
|
|
4280
4280
|
});
|
|
4281
4281
|
let r = new URL(n ?? mt, location.href).href;
|
|
4282
4282
|
this.bridge.post({
|
|
@@ -4287,32 +4287,32 @@ var Ya = Symbol("retain-xlsx-viewer-fonts"), Xa = Symbol("prepare-xlsx-viewer-ro
|
|
|
4287
4287
|
get mode() {
|
|
4288
4288
|
return this._mode;
|
|
4289
4289
|
}
|
|
4290
|
-
static async load(t,
|
|
4291
|
-
let
|
|
4290
|
+
static async load(t, n = {}) {
|
|
4291
|
+
let r = i(n), a = n.mode ?? "main", o = new v({
|
|
4292
4292
|
enabled: !0,
|
|
4293
4293
|
format: "xlsx",
|
|
4294
4294
|
mode: a,
|
|
4295
|
-
policy:
|
|
4296
|
-
onMetrics:
|
|
4297
|
-
emitToConsole:
|
|
4295
|
+
policy: r.policy,
|
|
4296
|
+
onMetrics: r.onResourceMetrics,
|
|
4297
|
+
emitToConsole: r.debug
|
|
4298
4298
|
});
|
|
4299
4299
|
try {
|
|
4300
4300
|
if (a === "worker" && (typeof Worker > "u" || typeof OffscreenCanvas > "u")) throw Error("mode: 'worker' requires Worker and OffscreenCanvas support");
|
|
4301
|
-
let
|
|
4301
|
+
let i = typeof t == "string" ? void 0 : t, s;
|
|
4302
4302
|
if (typeof t == "string") {
|
|
4303
4303
|
let e = await fetch(t);
|
|
4304
4304
|
if (!e.ok) throw Error(`Failed to fetch: ${e.status} ${e.statusText}`);
|
|
4305
4305
|
s = await e.arrayBuffer();
|
|
4306
4306
|
} else s = t;
|
|
4307
|
-
s =
|
|
4308
|
-
let c = s ===
|
|
4307
|
+
s = le(await de(s, n.password));
|
|
4308
|
+
let c = s === i;
|
|
4309
4309
|
o.setSourceBytes(s.byteLength), o.checkpoint("container ready");
|
|
4310
4310
|
let l = a === "worker" ? (await import("./render-worker-host-CmPBviYJ.js")).createRenderWorker() : new pt(), u;
|
|
4311
4311
|
try {
|
|
4312
|
-
return u = new e(l, a,
|
|
4312
|
+
return u = new e(l, a, n.wasmUrl), u.metrics = o, await u._load(s, n, r.policy, (e) => o.observeUsage(e), c), o.checkpoint("workbook index ready"), o.succeed({ sheets: u.sheetCount }), u;
|
|
4313
4313
|
} catch (e) {
|
|
4314
4314
|
let t = u;
|
|
4315
|
-
throw
|
|
4315
|
+
throw ue(l, t ? () => t.destroy() : void 0), e;
|
|
4316
4316
|
}
|
|
4317
4317
|
} catch (e) {
|
|
4318
4318
|
throw o.fail(e), e;
|
|
@@ -4416,7 +4416,7 @@ var Ya = Symbol("retain-xlsx-viewer-fonts"), Xa = Symbol("prepare-xlsx-viewer-ro
|
|
|
4416
4416
|
async getResourceMetrics() {
|
|
4417
4417
|
let e = this.metrics;
|
|
4418
4418
|
if (!e) throw Error("Workbook not loaded");
|
|
4419
|
-
return
|
|
4419
|
+
return se(e, async (e) => (await this.bridge.request((e) => ({
|
|
4420
4420
|
type: "resourceUsage",
|
|
4421
4421
|
id: e
|
|
4422
4422
|
}), void 0, { timeoutMs: e })).usage);
|
|
@@ -4459,7 +4459,7 @@ var Ya = Symbol("retain-xlsx-viewer-fonts"), Xa = Symbol("prepare-xlsx-viewer-ro
|
|
|
4459
4459
|
if (!a || !o) throw Error(`XLSX worksheet ${e} did not produce a terminal model`);
|
|
4460
4460
|
return this.retainedSheetUsage = o, this.sheetCache.set(e, a), a;
|
|
4461
4461
|
} catch (e) {
|
|
4462
|
-
throw e instanceof
|
|
4462
|
+
throw e instanceof _ && (this.resourceFailure ??= e), e;
|
|
4463
4463
|
}
|
|
4464
4464
|
}
|
|
4465
4465
|
ensureWorksheetPullClient() {
|
|
@@ -4487,7 +4487,7 @@ var Ya = Symbol("retain-xlsx-viewer-fonts"), Xa = Symbol("prepare-xlsx-viewer-ro
|
|
|
4487
4487
|
try {
|
|
4488
4488
|
return await e();
|
|
4489
4489
|
} catch (e) {
|
|
4490
|
-
throw e instanceof
|
|
4490
|
+
throw e instanceof _ && (this.resourceFailure ??= e), e;
|
|
4491
4491
|
}
|
|
4492
4492
|
}, n = (this.archiveOperationTail ?? Promise.resolve()).then(t, t);
|
|
4493
4493
|
return this.archiveOperationTail = n.then(() => void 0, () => void 0), n;
|
|
@@ -4566,7 +4566,7 @@ var Ya = Symbol("retain-xlsx-viewer-fonts"), Xa = Symbol("prepare-xlsx-viewer-ro
|
|
|
4566
4566
|
this.assertResourceHealthy();
|
|
4567
4567
|
let r = Ja(n), i = {
|
|
4568
4568
|
...r.opts,
|
|
4569
|
-
dpr: n.dpr ??
|
|
4569
|
+
dpr: n.dpr ?? j()
|
|
4570
4570
|
};
|
|
4571
4571
|
if (this._mode === "worker") {
|
|
4572
4572
|
if (!Number.isInteger(e) || e < 0 || e >= this.sheetCount) throw Error(`Sheet index ${e} out of range (count: ${this.sheetCount})`);
|
|
@@ -4614,7 +4614,7 @@ var Ya = Symbol("retain-xlsx-viewer-fonts"), Xa = Symbol("prepare-xlsx-viewer-ro
|
|
|
4614
4614
|
destroy() {
|
|
4615
4615
|
this.generation = (this.generation ?? 1) + 1, this.worksheetPullClient?.cancelAll("closed").catch(() => void 0), this.worksheetPullClient = null, this.bridge.terminate(), this.parsedWorkbook = null, this.sheetCache.clear(), this.sheetLoads.clear(), this.fontsDestroyed = !0;
|
|
4616
4616
|
for (let e of this.retainedFontSets.values()) e.faces && we(e.faces);
|
|
4617
|
-
this.retainedFontSets.clear(), this.googleFontNames = [],
|
|
4617
|
+
this.retainedFontSets.clear(), this.googleFontNames = [], N(this._fetchImage), L(this._fetchImage), this.rawParts.clear(), this.queuedImageLoads?.clear();
|
|
4618
4618
|
}
|
|
4619
4619
|
assertResourceHealthy() {
|
|
4620
4620
|
if (this.resourceFailure) throw this.resourceFailure;
|
|
@@ -4833,7 +4833,7 @@ function _o(e, t, n, r, i) {
|
|
|
4833
4833
|
for (let a = e.charts.length - 1; a >= 0; a--) {
|
|
4834
4834
|
let o = e.charts[a], s = oo(o, r);
|
|
4835
4835
|
if (!s || !co(s, r) || !so(n, s)) continue;
|
|
4836
|
-
let c =
|
|
4836
|
+
let c = W(o.chart, i);
|
|
4837
4837
|
return {
|
|
4838
4838
|
...go(e, t, "chart", a, o, c.text, c.truncated, c.maxTextCharacters),
|
|
4839
4839
|
seriesCount: o.chart.series.length
|
|
@@ -5314,7 +5314,7 @@ function Jo(e, t) {
|
|
|
5314
5314
|
//#endregion
|
|
5315
5315
|
//#region packages/xlsx/src/internal/sheet-viewer-runtime.ts
|
|
5316
5316
|
var Yo = class {
|
|
5317
|
-
owner = new
|
|
5317
|
+
owner = new pe("SheetAcquisition");
|
|
5318
5318
|
get current() {
|
|
5319
5319
|
return this.owner.current;
|
|
5320
5320
|
}
|
|
@@ -5742,7 +5742,7 @@ var as = Symbol("XlsxViewer.borrowedWorkbook"), os;
|
|
|
5742
5742
|
function ss() {
|
|
5743
5743
|
return os ??= import("./comment-ui-runtime-DTGN3Vyy.js");
|
|
5744
5744
|
}
|
|
5745
|
-
var cs = 150, ls = 280, us = 200, ds = 240, fs = 200, ps = 30, ms = 50, hs = 1, gs = 1, _s = .45, vs = "data-xlsx-viewer-styles", ys = ".xlsx-tab-strip::-webkit-scrollbar{display:none}[data-xlsx-viewport-input]:focus{outline:none}[data-xlsx-viewport-input]:focus-visible{outline:2px solid var(--ooxml-xlsx-focus-ring
|
|
5745
|
+
var cs = 150, ls = 280, us = 200, ds = 240, fs = 200, ps = 30, ms = 50, hs = 1, gs = 1, _s = .45, vs = "data-xlsx-viewer-styles", ys = ".xlsx-tab-strip::-webkit-scrollbar{display:none}[data-xlsx-viewport-input]:focus{outline:none}[data-xlsx-viewport-input]:focus-visible{outline:2px solid var(--ooxml-xlsx-focus-ring,transparent);outline-offset:-2px}.xlsx-tab-nav{background:transparent;transition:background 0.1s;}.xlsx-tab-nav:hover{background:color-mix(in srgb,var(--ooxml-xlsx-chrome-text,#444) 8%,transparent);}.xlsx-zoom-slider{-webkit-appearance:none;appearance:none;background:transparent;height:15px;margin:0;}.xlsx-zoom-slider::-webkit-slider-runnable-track{height:4px;background:var(--ooxml-xlsx-chrome-border,#c4c4c4);border-radius:2px;}.xlsx-zoom-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:12px;height:12px;margin-top:-4px;border-radius:50%;background:var(--ooxml-xlsx-chrome-text-muted,#808080);cursor:pointer;}.xlsx-zoom-slider:hover::-webkit-slider-thumb{background:var(--ooxml-xlsx-chrome-text,#5f5f5f);}.xlsx-zoom-slider::-moz-range-track{height:4px;background:var(--ooxml-xlsx-chrome-border,#c4c4c4);border-radius:2px;}.xlsx-zoom-slider::-moz-range-thumb{width:12px;height:12px;border:none;border-radius:50%;background:var(--ooxml-xlsx-chrome-text-muted,#808080);cursor:pointer;}";
|
|
5746
5746
|
function bs(e) {
|
|
5747
5747
|
if (!e.head || e.head.querySelector(`style[${vs}]`)) return;
|
|
5748
5748
|
let t = e.createElement("style");
|
|
@@ -7267,7 +7267,7 @@ var Gs = class {
|
|
|
7267
7267
|
};
|
|
7268
7268
|
else return !1;
|
|
7269
7269
|
let r = this.opts.onHyperlinkClick;
|
|
7270
|
-
return r ? (r(n), !0) : (n.kind === "external" ?
|
|
7270
|
+
return r ? (r(n), !0) : (n.kind === "external" ? E(n.url, void 0, this.hostWindow) : this.navigateInternalHyperlink(n.ref).catch((e) => this._reportRenderError(e)), !0);
|
|
7271
7271
|
}
|
|
7272
7272
|
async navigateInternalHyperlink(e) {
|
|
7273
7273
|
let t = ao(e, this.currentSheet, this.sheetNames, this.currentWorksheet?.definedNames ?? []);
|
|
@@ -7741,8 +7741,8 @@ var Gs = class {
|
|
|
7741
7741
|
if (this.viewport.setScale(i), this.zoomSlider && (this.zoomSlider.value = String(this.zoomScaleToPos(i, t, n))), this.zoomLabel && (this.zoomLabel.textContent = `${r}%`), this.currentWorksheet) {
|
|
7742
7742
|
let e = this.effectiveScrollLeft, t = this.viewportTop;
|
|
7743
7743
|
if (this.layoutGutters(), this.updateSpacerSize(this.currentWorksheet), o) {
|
|
7744
|
-
this.viewportTop =
|
|
7745
|
-
let n = this.screenX(o.x, 0), r = this.maxScrollLeft, s =
|
|
7744
|
+
this.viewportTop = me(t, o.y, a, i, { maxScroll: this.maxScrollTop });
|
|
7745
|
+
let n = this.screenX(o.x, 0), r = this.maxScrollLeft, s = me(e, n, a, i, { maxScroll: r });
|
|
7746
7746
|
this.setViewportLeft(s);
|
|
7747
7747
|
} else this.setViewportLeft(e);
|
|
7748
7748
|
}
|
|
@@ -7767,7 +7767,7 @@ var Gs = class {
|
|
|
7767
7767
|
_fit(e) {
|
|
7768
7768
|
let t = this.currentWorksheet;
|
|
7769
7769
|
if (!t) return;
|
|
7770
|
-
let { width: n, height: r } = this._naturalContentExtent(t), i =
|
|
7770
|
+
let { width: n, height: r } = this._naturalContentExtent(t), i = fe({
|
|
7771
7771
|
contentWidth: n,
|
|
7772
7772
|
contentHeight: r,
|
|
7773
7773
|
containerWidth: this.canvasArea.clientWidth,
|
|
@@ -8072,14 +8072,14 @@ var Gs = class {
|
|
|
8072
8072
|
MAX_SELECTION_CONTEXT_CELLS: () => wo,
|
|
8073
8073
|
MAX_SELECTION_CONTEXT_TEXT_CHARACTERS: () => To,
|
|
8074
8074
|
OoxmlDecodedImageLimitError: () => ke,
|
|
8075
|
-
OoxmlError: () =>
|
|
8076
|
-
OoxmlResourceLimitError: () =>
|
|
8075
|
+
OoxmlError: () => w,
|
|
8076
|
+
OoxmlResourceLimitError: () => _,
|
|
8077
8077
|
XlsxSheetViewer: () => qs,
|
|
8078
8078
|
XlsxViewer: () => Ks,
|
|
8079
8079
|
XlsxWorkbook: () => Qa,
|
|
8080
8080
|
autoResize: () => xe,
|
|
8081
8081
|
isOoxmlDecodedImageLimitError: () => Pe,
|
|
8082
|
-
openExternalHyperlink: () =>
|
|
8082
|
+
openExternalHyperlink: () => E,
|
|
8083
8083
|
resolveSharedStrings: () => $e
|
|
8084
8084
|
});
|
|
8085
8085
|
//#endregion
|