@silurus/ooxml 0.72.0 → 0.72.2
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/dist/{docx-BPF-eH0O.js → docx-wLLJuetI.js} +2646 -2175
- package/dist/docx.mjs +2 -2
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{find-cursor-DTrEBxjE.js → find-cursor-DBifiZop.js} +949 -923
- package/dist/{highlight-rect-B--cPQOV.js → highlight-rect-DTgfiJgA.js} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/{pptx-BMxDfEYI.js → pptx-D3L4FQfI.js} +113 -107
- package/dist/pptx.mjs +2 -2
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/render-worker-host-B5esxBj-.js +27 -0
- package/dist/render-worker-host-BzhGwe0I.js +27 -0
- package/dist/render-worker-host-Cg60RAG_.js +27 -0
- package/dist/{segments-Da-soh2U.js → segments--0hIQLXB.js} +1 -1
- package/dist/types/docx.d.ts +30 -0
- package/dist/types/index.d.ts +45 -0
- package/dist/types/pptx.d.ts +11 -0
- package/dist/types/xlsx.d.ts +3 -0
- package/dist/{visible-index-5hdq_oAL.js → visible-index-DSN5XPnm.js} +1 -1
- package/dist/{xlsx-bwQD8c1Q.js → xlsx-BWEqRZ25.js} +344 -337
- package/dist/xlsx.mjs +2 -2
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/render-worker-host-DL_kkykF.js +0 -27
- package/dist/render-worker-host-S0HOWgs0.js +0 -27
- package/dist/render-worker-host-l8yqDUfE.js +0 -27
|
@@ -1821,7 +1821,13 @@ function Kt(e, t) {
|
|
|
1821
1821
|
let n = Gt[e];
|
|
1822
1822
|
return n ? Bt(n, t) : [];
|
|
1823
1823
|
}
|
|
1824
|
-
|
|
1824
|
+
function qt(e, t) {
|
|
1825
|
+
let n = Kt(e, t);
|
|
1826
|
+
if (n.length > 0) return n;
|
|
1827
|
+
let r = e.trim().split(/[\s,]+/).map(Number);
|
|
1828
|
+
return r.length >= 2 && r.every((e) => Number.isFinite(e) && e >= 0) && r.some((e) => e > 0) ? (r.length % 2 != 0 && r.pop(), Bt(r, t)) : [];
|
|
1829
|
+
}
|
|
1830
|
+
var Jt = {
|
|
1825
1831
|
dotted: [1.5, 3],
|
|
1826
1832
|
dottedHeavy: [1.5, 3],
|
|
1827
1833
|
dash: [6, 3],
|
|
@@ -1857,31 +1863,31 @@ var qt = {
|
|
|
1857
1863
|
3
|
|
1858
1864
|
]
|
|
1859
1865
|
};
|
|
1860
|
-
function
|
|
1861
|
-
let n =
|
|
1866
|
+
function Yt(e, t) {
|
|
1867
|
+
let n = Jt[e];
|
|
1862
1868
|
return n ? Bt(n, t) : [];
|
|
1863
1869
|
}
|
|
1864
1870
|
//#endregion
|
|
1865
1871
|
//#region packages/core/src/shape/paint.ts
|
|
1866
|
-
function
|
|
1872
|
+
function Xt(e, t = 1) {
|
|
1867
1873
|
let n = e.charCodeAt(0) === 35 ? e.slice(1) : e;
|
|
1868
1874
|
return `rgba(${parseInt(n.slice(0, 2), 16)},${parseInt(n.slice(2, 4), 16)},${parseInt(n.slice(4, 6), 16)},${n.length >= 8 ? parseInt(n.slice(6, 8), 16) / 255 : t})`;
|
|
1869
1875
|
}
|
|
1870
|
-
function
|
|
1876
|
+
function Zt(e) {
|
|
1871
1877
|
let t = e.charCodeAt(0) === 35 ? e.slice(1) : e, n = parseInt(t.slice(0, 2), 16), r = parseInt(t.slice(2, 4), 16), i = parseInt(t.slice(4, 6), 16);
|
|
1872
1878
|
return .299 * n + .587 * r + .114 * i;
|
|
1873
1879
|
}
|
|
1874
|
-
function
|
|
1875
|
-
return e &&
|
|
1880
|
+
function Qt(e) {
|
|
1881
|
+
return e && Zt(e) < 128 ? "#FFFFFF" : "#000000";
|
|
1876
1882
|
}
|
|
1877
|
-
function
|
|
1883
|
+
function $t(e, t, n, r, i, a) {
|
|
1878
1884
|
if (!e || e.fillType === "none") return null;
|
|
1879
|
-
if (e.fillType === "solid") return
|
|
1880
|
-
if (e.fillType === "pattern") return
|
|
1885
|
+
if (e.fillType === "solid") return Xt(e.color);
|
|
1886
|
+
if (e.fillType === "pattern") return tn(e, t);
|
|
1881
1887
|
if (e.fillType === "gradient") {
|
|
1882
1888
|
let o = e.stops;
|
|
1883
1889
|
if (o.length === 0) return null;
|
|
1884
|
-
if (o.length === 1) return
|
|
1890
|
+
if (o.length === 1) return Xt(o[0].color);
|
|
1885
1891
|
let s;
|
|
1886
1892
|
if (e.gradType === "radial") {
|
|
1887
1893
|
let e = n + i / 2, o = r + a / 2, c = Math.sqrt(i * i + a * a) / 2;
|
|
@@ -1890,34 +1896,36 @@ function Qt(e, t, n, r, i, a) {
|
|
|
1890
1896
|
let o = e.angle * Math.PI / 180, c = n + i / 2, l = r + a / 2, u = (Math.abs(Math.cos(o)) * i + Math.abs(Math.sin(o)) * a) / 2;
|
|
1891
1897
|
s = t.createLinearGradient(c - Math.cos(o) * u, l - Math.sin(o) * u, c + Math.cos(o) * u, l + Math.sin(o) * u);
|
|
1892
1898
|
}
|
|
1893
|
-
for (let e of o) s.addColorStop(Math.min(1, Math.max(0, e.position)),
|
|
1899
|
+
for (let e of o) s.addColorStop(Math.min(1, Math.max(0, e.position)), Xt(e.color));
|
|
1894
1900
|
return s;
|
|
1895
1901
|
}
|
|
1896
1902
|
return null;
|
|
1897
1903
|
}
|
|
1898
|
-
var
|
|
1899
|
-
function
|
|
1900
|
-
let n = `${e.preset}|${e.fg}|${e.bg}`, r =
|
|
1901
|
-
r || (r = /* @__PURE__ */ new Map(),
|
|
1904
|
+
var en = /* @__PURE__ */ new WeakMap();
|
|
1905
|
+
function tn(e, t) {
|
|
1906
|
+
let n = `${e.preset}|${e.fg}|${e.bg}`, r = en.get(t);
|
|
1907
|
+
r || (r = /* @__PURE__ */ new Map(), en.set(t, r));
|
|
1902
1908
|
let i = r.get(n);
|
|
1903
1909
|
if (i) return i;
|
|
1904
1910
|
let a = Rt(e.preset, e.fg, e.bg);
|
|
1905
|
-
if (!a) return
|
|
1911
|
+
if (!a) return Xt(e.fg);
|
|
1906
1912
|
let o = t.createPattern(a, "repeat");
|
|
1907
|
-
return o ? (r.set(n, o), o) :
|
|
1913
|
+
return o ? (r.set(n, o), o) : Xt(e.fg);
|
|
1908
1914
|
}
|
|
1909
|
-
function
|
|
1915
|
+
function nn(e, t, n) {
|
|
1910
1916
|
if (!t) {
|
|
1911
|
-
e.strokeStyle = "transparent", e.lineWidth = 0, e.setLineDash([]);
|
|
1917
|
+
e.strokeStyle = "transparent", e.lineWidth = 0, e.setLineDash([]), e.lineCap = "butt";
|
|
1912
1918
|
return;
|
|
1913
1919
|
}
|
|
1914
|
-
e.strokeStyle =
|
|
1920
|
+
e.strokeStyle = Xt(t.color);
|
|
1915
1921
|
let r = Math.max(.5, t.width * n);
|
|
1916
|
-
e.lineWidth = r
|
|
1922
|
+
e.lineWidth = r;
|
|
1923
|
+
let i = t.dashStyle ? qt(t.dashStyle, r) : [], a = t.lineCap ?? "butt", o = i.some((e, t) => t % 2 == 0 && e === 0);
|
|
1924
|
+
e.lineCap = a === "butt" && o ? "square" : a, e.setLineDash(i);
|
|
1917
1925
|
}
|
|
1918
1926
|
//#endregion
|
|
1919
1927
|
//#region packages/core/src/chart/renderer.ts
|
|
1920
|
-
var
|
|
1928
|
+
var rn = [
|
|
1921
1929
|
"4472C4",
|
|
1922
1930
|
"ED7D31",
|
|
1923
1931
|
"A9D18E",
|
|
@@ -1931,81 +1939,81 @@ var nn = [
|
|
|
1931
1939
|
"255E91",
|
|
1932
1940
|
"967300"
|
|
1933
1941
|
];
|
|
1934
|
-
function rn(e, t) {
|
|
1935
|
-
return t?.color ? `#${t.color}` : `#${nn[e % nn.length]}`;
|
|
1936
|
-
}
|
|
1937
1942
|
function an(e, t) {
|
|
1938
|
-
|
|
1939
|
-
return n ? `#${n}` : `#${nn[e % nn.length]}`;
|
|
1943
|
+
return t?.color ? `#${t.color}` : `#${rn[e % rn.length]}`;
|
|
1940
1944
|
}
|
|
1941
1945
|
function on(e, t) {
|
|
1946
|
+
let n = t.dataPointColors?.[e];
|
|
1947
|
+
return n ? `#${n}` : `#${rn[e % rn.length]}`;
|
|
1948
|
+
}
|
|
1949
|
+
function sn(e, t) {
|
|
1942
1950
|
let n = e.startsWith("#") ? e.slice(1) : e;
|
|
1943
1951
|
if (n.length < 6) return `#${n}`;
|
|
1944
1952
|
let r = Math.max(0, Math.min(1, t)), i = Math.round(parseInt(n.slice(0, 2), 16) * r), a = Math.round(parseInt(n.slice(2, 4), 16) * r), o = Math.round(parseInt(n.slice(4, 6), 16) * r), s = (e) => e.toString(16).padStart(2, "0");
|
|
1945
1953
|
return `#${s(i)}${s(a)}${s(o)}`;
|
|
1946
1954
|
}
|
|
1947
|
-
function
|
|
1955
|
+
function cn(e, t) {
|
|
1948
1956
|
return t && (t.startsWith("+mj") ? e.themeMajorFontLatin ?? null : t.startsWith("+mn") ? e.themeMinorFontLatin ?? null : t);
|
|
1949
1957
|
}
|
|
1950
1958
|
function X(e, t, n) {
|
|
1951
|
-
let r = n === "major" ? e.themeMajorFontLatin : e.themeMinorFontLatin, i =
|
|
1959
|
+
let r = n === "major" ? e.themeMajorFontLatin : e.themeMinorFontLatin, i = cn(e, t) ?? r;
|
|
1952
1960
|
return i ? `"${i}", Calibri, Arial, sans-serif` : "sans-serif";
|
|
1953
1961
|
}
|
|
1954
|
-
function
|
|
1962
|
+
function ln(e) {
|
|
1955
1963
|
return e === "pie" || e === "doughnut";
|
|
1956
1964
|
}
|
|
1957
|
-
function
|
|
1965
|
+
function un(e) {
|
|
1958
1966
|
return !!e.varyColors && e.series.length === 1 && typeof e.chartType == "string" && /Bar/.test(e.chartType);
|
|
1959
1967
|
}
|
|
1960
|
-
function
|
|
1961
|
-
if (r ||
|
|
1968
|
+
function dn(e, t, n, r = !1) {
|
|
1969
|
+
if (r || ln(e)) {
|
|
1962
1970
|
let e = t[0];
|
|
1963
|
-
return e ?
|
|
1971
|
+
return e ? on(n, e) : `#${rn[n % rn.length]}`;
|
|
1964
1972
|
}
|
|
1965
|
-
return
|
|
1973
|
+
return an(n, t[n]);
|
|
1966
1974
|
}
|
|
1967
|
-
function
|
|
1975
|
+
function fn(e, t, n, r, i, a, o, s, c, l = "sans-serif") {
|
|
1968
1976
|
e.save(), e.font = `${o ? "bold " : ""}${a}px ${l}`, e.fillStyle = s;
|
|
1969
1977
|
let u = Pt(e, t, c);
|
|
1970
1978
|
i === "cat" ? (e.textAlign = "center", e.textBaseline = "middle", e.fillText(u, n, r)) : (e.translate(n, r), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", e.fillText(u, 0, 0)), e.restore();
|
|
1971
1979
|
}
|
|
1972
|
-
function
|
|
1980
|
+
function pn(e) {
|
|
1973
1981
|
return e ? `#${e}` : "#555";
|
|
1974
1982
|
}
|
|
1975
|
-
function
|
|
1983
|
+
function mn(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
1976
1984
|
if (t.valAxisTitle) {
|
|
1977
1985
|
let r = n + u + Xe(i) + p / 2, a = s + l / 2;
|
|
1978
|
-
|
|
1986
|
+
fn(e, t.valAxisTitle, r, a, "val", p, t.valAxisTitleFontBold ?? !0, pn(t.valAxisTitleFontColor), l, X(t, t.valAxisTitleFontFace, "major"));
|
|
1979
1987
|
}
|
|
1980
1988
|
if (t.catAxisTitle) {
|
|
1981
1989
|
let n = o + c / 2, i = r + a - d - Xe(a) - f / 2;
|
|
1982
|
-
|
|
1990
|
+
fn(e, t.catAxisTitle, n, i, "cat", f, t.catAxisTitleFontBold ?? !0, pn(t.catAxisTitleFontColor), c, X(t, t.catAxisTitleFontFace, "major"));
|
|
1983
1991
|
}
|
|
1984
1992
|
}
|
|
1985
|
-
function
|
|
1993
|
+
function hn(e) {
|
|
1986
1994
|
return e && (e === "line" || e === "stackedLine" || e === "stackedLinePct" || e === "radar" || e === "scatter" || e === "stock") ? "line" : "fill";
|
|
1987
1995
|
}
|
|
1988
|
-
function
|
|
1996
|
+
function gn(e, t, n) {
|
|
1989
1997
|
if (e !== "scatter") return !1;
|
|
1990
1998
|
let r = t ?? "marker";
|
|
1991
1999
|
return (r === "line" || r === "lineMarker" || r === "lineNoMarker" || r === "smooth" || r === "smoothMarker" || r === "smoothNoMarker") && n.lineHidden !== !0;
|
|
1992
2000
|
}
|
|
1993
|
-
function
|
|
2001
|
+
function _n(e, t, n, r) {
|
|
1994
2002
|
if (e !== "scatter") return null;
|
|
1995
2003
|
let i = n[r];
|
|
1996
|
-
if (!i ||
|
|
2004
|
+
if (!i || gn(e, t, i)) return null;
|
|
1997
2005
|
let a = i.markerSymbol ?? "circle";
|
|
1998
2006
|
if (a === "none") return null;
|
|
1999
|
-
let o =
|
|
2007
|
+
let o = an(r, i);
|
|
2000
2008
|
return {
|
|
2001
2009
|
symbol: a,
|
|
2002
2010
|
fill: i.markerFill ?? o.replace(/^#/, ""),
|
|
2003
2011
|
line: i.markerLine ?? null
|
|
2004
2012
|
};
|
|
2005
2013
|
}
|
|
2006
|
-
function
|
|
2014
|
+
function vn(e, t, n, r, i, a, o, s = null) {
|
|
2007
2015
|
if (s) {
|
|
2008
|
-
|
|
2016
|
+
nr(e, r + a / 2, i + o / 2, s.symbol, o, s.fill, s.line, 1);
|
|
2009
2017
|
return;
|
|
2010
2018
|
}
|
|
2011
2019
|
if (e.fillStyle = n, t === "line") {
|
|
@@ -2016,43 +2024,43 @@ function _n(e, t, n, r, i, a, o, s = null) {
|
|
|
2016
2024
|
e.moveTo(r, s), e.lineTo(r + a, s), e.stroke(), e.lineWidth = t;
|
|
2017
2025
|
} else e.fillRect(r, i, a, o);
|
|
2018
2026
|
}
|
|
2019
|
-
function
|
|
2020
|
-
if (r ||
|
|
2021
|
-
let n = e[0],
|
|
2022
|
-
return Array.from({ length:
|
|
2023
|
-
label: (
|
|
2024
|
-
color:
|
|
2027
|
+
function yn(e, t, n, r = !1, i = []) {
|
|
2028
|
+
if (r || ln(t)) {
|
|
2029
|
+
let n = e[0], a = n ? n.values.length : 0, o = n?.categories ?? i;
|
|
2030
|
+
return Array.from({ length: a }, (n, i) => ({
|
|
2031
|
+
label: (o[i] ?? `Item ${i + 1}`).toString(),
|
|
2032
|
+
color: dn(t, e, i, r),
|
|
2025
2033
|
marker: null
|
|
2026
2034
|
}));
|
|
2027
2035
|
}
|
|
2028
2036
|
return e.map((r, i) => ({
|
|
2029
2037
|
label: r.name || `Series ${i + 1}`,
|
|
2030
|
-
color:
|
|
2031
|
-
marker:
|
|
2038
|
+
color: dn(t, e, i),
|
|
2039
|
+
marker: _n(t, n, e, i)
|
|
2032
2040
|
}));
|
|
2033
2041
|
}
|
|
2034
|
-
var
|
|
2042
|
+
var bn = {
|
|
2035
2043
|
fontFamily: "sans-serif",
|
|
2036
2044
|
color: "#333",
|
|
2037
2045
|
bold: !1,
|
|
2038
2046
|
sizePx: null
|
|
2039
2047
|
};
|
|
2040
|
-
function
|
|
2041
|
-
let
|
|
2048
|
+
function xn(e, t, n, r, i, a, o = "vertical", s, c = bn, l, u = !1, d = []) {
|
|
2049
|
+
let f = hn(s), p = yn(t, s, l, u, d), m = c.bold ? "bold " : "";
|
|
2042
2050
|
if (o === "horizontal") {
|
|
2043
2051
|
let t = c.sizePx ?? Math.max(9, Math.min(12, a * .7));
|
|
2044
|
-
e.font = `${
|
|
2045
|
-
let o = Math.max(1,
|
|
2046
|
-
for (let n = 0; n <
|
|
2052
|
+
e.font = `${m}${t}px ${c.fontFamily}`, e.textBaseline = "middle";
|
|
2053
|
+
let o = Math.max(1, p.length), s = i - 10 - 4, l = p.map((t) => Pt(e, t.label, s)), u = l.map((t) => 14 + e.measureText(t).width), d = n + (i - (u.reduce((e, t) => e + t, 0) + 12 * (o - 1))) / 2, h = r + a / 2;
|
|
2054
|
+
for (let n = 0; n < p.length; n++) vn(e, f, p[n].color, d, h - t / 2, 10, t, p[n].marker), e.fillStyle = c.color, e.textAlign = "left", e.fillText(l[n], d + 10 + 4, h), d += u[n] + 12;
|
|
2047
2055
|
return;
|
|
2048
2056
|
}
|
|
2049
|
-
let
|
|
2050
|
-
e.font = `${
|
|
2051
|
-
let
|
|
2052
|
-
for (let t = 0; t <
|
|
2057
|
+
let h = c.sizePx ?? Math.max(9, Math.min(12, a / (p.length + 1)));
|
|
2058
|
+
e.font = `${m}${h}px ${c.fontFamily}`, e.textBaseline = "middle";
|
|
2059
|
+
let g = h + 4, _ = i - 10 - 4, v = r + (a - g * p.length) / 2;
|
|
2060
|
+
for (let t = 0; t < p.length; t++) vn(e, f, p[t].color, n, v, 10, h, p[t].marker), e.fillStyle = c.color, e.textAlign = "left", e.fillText(Pt(e, p[t].label, _), n + 10 + 4, v + h / 2), v += g;
|
|
2053
2061
|
}
|
|
2054
|
-
function
|
|
2055
|
-
let t =
|
|
2062
|
+
function Sn(e) {
|
|
2063
|
+
let t = cn(e, e.legendFontFace) ?? e.themeMinorFontLatin;
|
|
2056
2064
|
return {
|
|
2057
2065
|
fontFamily: t ? `"${t}", Calibri, Arial, sans-serif` : "sans-serif",
|
|
2058
2066
|
color: e.legendFontColor ? `#${e.legendFontColor}` : "#333",
|
|
@@ -2060,30 +2068,30 @@ function xn(e) {
|
|
|
2060
2068
|
sizePx: e.legendFontSizeHpt == null ? null : e.legendFontSizeHpt / 100
|
|
2061
2069
|
};
|
|
2062
2070
|
}
|
|
2063
|
-
function
|
|
2071
|
+
function Cn(e, t, n, r, i, a, o, s, c, l, u, d) {
|
|
2064
2072
|
if (!n) return;
|
|
2065
|
-
let f =
|
|
2073
|
+
let f = Sn(t), p = un(t), m = t.legendManualLayout;
|
|
2066
2074
|
if (m && m.xMode === "edge" && m.yMode === "edge" && m.w > 0 && m.h > 0) {
|
|
2067
2075
|
let n = r + m.x * a, s = i + m.y * o, c = m.w * a, l = m.h * o, u = c >= l ? "horizontal" : "vertical";
|
|
2068
|
-
|
|
2076
|
+
xn(e, t.series, n, s, c, l, u, t.chartType, f, t.scatterStyle, p, t.categories);
|
|
2069
2077
|
return;
|
|
2070
2078
|
}
|
|
2071
2079
|
switch (n.side) {
|
|
2072
2080
|
case "r":
|
|
2073
|
-
|
|
2081
|
+
xn(e, t.series, r + a - n.reserveW + 4, c, n.reserveW - 8, u, "vertical", t.chartType, f, t.scatterStyle, p, t.categories);
|
|
2074
2082
|
break;
|
|
2075
2083
|
case "l":
|
|
2076
|
-
|
|
2084
|
+
xn(e, t.series, r + 4, c, n.reserveW - 8, u, "vertical", t.chartType, f, t.scatterStyle, p, t.categories);
|
|
2077
2085
|
break;
|
|
2078
2086
|
case "t":
|
|
2079
|
-
|
|
2087
|
+
xn(e, t.series, s, i + d, l, n.reserveH, "horizontal", t.chartType, f, t.scatterStyle, p, t.categories);
|
|
2080
2088
|
break;
|
|
2081
2089
|
case "b":
|
|
2082
|
-
|
|
2090
|
+
xn(e, t.series, s, i + o - n.reserveH, l, n.reserveH, "horizontal", t.chartType, f, t.scatterStyle, p, t.categories);
|
|
2083
2091
|
break;
|
|
2084
2092
|
}
|
|
2085
2093
|
}
|
|
2086
|
-
function
|
|
2094
|
+
function wn(e, t, n, r, i, a, o, s = !1) {
|
|
2087
2095
|
if (t === "none" || !t) return;
|
|
2088
2096
|
let c = o ? Math.max(4, o + 2) : 4, l = e.strokeStyle, u = e.lineWidth;
|
|
2089
2097
|
if (e.strokeStyle = a ?? "#888", e.lineWidth = o ?? 1, e.beginPath(), n === "val") {
|
|
@@ -2095,10 +2103,10 @@ function Cn(e, t, n, r, i, a, o, s = !1) {
|
|
|
2095
2103
|
}
|
|
2096
2104
|
e.stroke(), e.strokeStyle = l, e.lineWidth = u;
|
|
2097
2105
|
}
|
|
2098
|
-
function
|
|
2106
|
+
function Tn(e, t, n, r, i, a) {
|
|
2099
2107
|
a && a.explicit ? (e.strokeStyle = a.color, e.lineWidth = a.width) : (e.strokeStyle = i ? "#aaa" : a?.color ?? "#e0e0e0", e.lineWidth = i ? 1 : a?.width ?? .5), e.beginPath(), e.moveTo(t, r), e.lineTo(t + n, r), e.stroke();
|
|
2100
2108
|
}
|
|
2101
|
-
function
|
|
2109
|
+
function En(e, t) {
|
|
2102
2110
|
let { color: n, width: r } = _t(e.valAxisGridlineColor, e.valAxisGridlineWidthEmu, t);
|
|
2103
2111
|
return {
|
|
2104
2112
|
color: n,
|
|
@@ -2106,29 +2114,29 @@ function Tn(e, t) {
|
|
|
2106
2114
|
explicit: e.valAxisGridlineColor != null
|
|
2107
2115
|
};
|
|
2108
2116
|
}
|
|
2109
|
-
function
|
|
2117
|
+
function Dn(e) {
|
|
2110
2118
|
return e.catAxisMajorGridlines === !0;
|
|
2111
2119
|
}
|
|
2112
|
-
function
|
|
2120
|
+
function On(e, t) {
|
|
2113
2121
|
return _t(e.catAxisGridlineColor, e.catAxisGridlineWidthEmu, t);
|
|
2114
2122
|
}
|
|
2115
|
-
function
|
|
2123
|
+
function kn(e, t) {
|
|
2116
2124
|
if (t <= 0) return [];
|
|
2117
2125
|
let n = vt(e), r = [], i = n ? t : t - 1;
|
|
2118
2126
|
for (let e = 0; e <= i; e++) r.push(n ? e / t : t === 1 ? .5 : e / (t - 1));
|
|
2119
2127
|
return r;
|
|
2120
2128
|
}
|
|
2121
|
-
function
|
|
2129
|
+
function An(e) {
|
|
2122
2130
|
return e.valAxisOrientation === "maxMin";
|
|
2123
2131
|
}
|
|
2124
|
-
function
|
|
2132
|
+
function jn(e) {
|
|
2125
2133
|
return e.catAxisOrientation === "maxMin";
|
|
2126
2134
|
}
|
|
2127
|
-
function
|
|
2135
|
+
function Mn(e) {
|
|
2128
2136
|
return e.valAxisMajorGridlines !== !1;
|
|
2129
2137
|
}
|
|
2130
|
-
function
|
|
2131
|
-
let i =
|
|
2138
|
+
function Nn(e, t, n, r) {
|
|
2139
|
+
let i = An(e), a = e.valAxisLogBase;
|
|
2132
2140
|
if (a != null && isFinite(a) && a >= 2) {
|
|
2133
2141
|
let { min: r, max: o, lines: s } = ut(t, n, a, e.valMin, e.valMax);
|
|
2134
2142
|
return {
|
|
@@ -2156,7 +2164,7 @@ function Mn(e, t, n, r) {
|
|
|
2156
2164
|
frac: (e) => i ? 1 - (e - o) / l : (e - o) / l
|
|
2157
2165
|
};
|
|
2158
2166
|
}
|
|
2159
|
-
function
|
|
2167
|
+
function Pn(e, t, n, r, i, a) {
|
|
2160
2168
|
let o = t.trendLines;
|
|
2161
2169
|
if (!o || o.length === 0) return;
|
|
2162
2170
|
let s = [], c = [];
|
|
@@ -2186,25 +2194,25 @@ function Nn(e, t, n, r, i, a) {
|
|
|
2186
2194
|
}
|
|
2187
2195
|
e.setLineDash(l);
|
|
2188
2196
|
}
|
|
2189
|
-
function
|
|
2197
|
+
function Fn(e, t, n) {
|
|
2190
2198
|
return e ? e / 100 * n : Math.max(8, t * .045);
|
|
2191
2199
|
}
|
|
2192
|
-
function
|
|
2200
|
+
function In(e) {
|
|
2193
2201
|
return e.catAxisTickLabelPos !== "none";
|
|
2194
2202
|
}
|
|
2195
|
-
var
|
|
2196
|
-
function
|
|
2203
|
+
var Ln = 54e5;
|
|
2204
|
+
function Rn(e) {
|
|
2197
2205
|
let t = e.catAxisLabelRotation;
|
|
2198
|
-
return t == null || t === 0 || Math.abs(t) >
|
|
2206
|
+
return t == null || t === 0 || Math.abs(t) > Ln ? 0 : t / 6e4 * (Math.PI / 180);
|
|
2199
2207
|
}
|
|
2200
|
-
function
|
|
2208
|
+
function zn(e, t, n, r, i) {
|
|
2201
2209
|
if (i === 0) {
|
|
2202
2210
|
e.fillText(t, n, r);
|
|
2203
2211
|
return;
|
|
2204
2212
|
}
|
|
2205
2213
|
e.save(), e.translate(n, r), e.rotate(i), e.textAlign = "right", e.textBaseline = "middle", e.fillText(t, 0, 0), e.restore();
|
|
2206
2214
|
}
|
|
2207
|
-
function
|
|
2215
|
+
function Bn(e, t, n) {
|
|
2208
2216
|
if (!e) return null;
|
|
2209
2217
|
let r = [];
|
|
2210
2218
|
for (let e of t) if (e.useSecondaryAxis === !0) for (let t of e.values) t != null && r.push(t);
|
|
@@ -2216,14 +2224,14 @@ function zn(e, t, n) {
|
|
|
2216
2224
|
makeToY: (e, t) => (n) => e + t - (n - o) / l * t
|
|
2217
2225
|
};
|
|
2218
2226
|
}
|
|
2219
|
-
function
|
|
2227
|
+
function Vn(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
2220
2228
|
let m = i + o, { color: h, width: g } = gt(t.lineColor, t.lineWidthEmu, l);
|
|
2221
2229
|
if (t.lineHidden || (e.strokeStyle = h, e.lineWidth = g, e.beginPath(), e.moveTo(m, a), e.lineTo(m, a + s), e.stroke()), !t.hidden) {
|
|
2222
2230
|
e.font = `${u}px sans-serif`, e.fillStyle = t.fontColor ? `#${t.fontColor}` : f, e.textAlign = "left", e.textBaseline = "middle";
|
|
2223
2231
|
let i = n.max - n.min || 1, a = Math.max(1, Math.round(i / n.step));
|
|
2224
2232
|
for (let i = 0; i <= a; i++) {
|
|
2225
2233
|
let a = n.min + i * n.step, o = r(a);
|
|
2226
|
-
|
|
2234
|
+
wn(e, t.majorTickMark, "val", m, o, h, g, !0), e.fillText(Y(a, t.formatCode ?? null, p), m + 14, o);
|
|
2227
2235
|
}
|
|
2228
2236
|
}
|
|
2229
2237
|
if (t.title) {
|
|
@@ -2231,12 +2239,12 @@ function Bn(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2231
2239
|
e.save(), e.fillStyle = t.titleFontColor ? `#${t.titleFontColor}` : t.fontColor ? `#${t.fontColor}` : "#555", e.font = `${t.titleFontBold ? "bold " : ""}${n}px sans-serif`, e.textAlign = "center", e.textBaseline = "middle", e.translate(i + o + d + n * .6, a + s / 2), e.rotate(Math.PI / 2), e.fillText(t.title, 0, 0), e.restore();
|
|
2232
2240
|
}
|
|
2233
2241
|
}
|
|
2234
|
-
function
|
|
2242
|
+
function Hn(e, t, n, r, i, a) {
|
|
2235
2243
|
if (!t.title) return;
|
|
2236
|
-
let o =
|
|
2244
|
+
let o = cn(t, t.titleFontFace), s = o ? `"${o}", Calibri, Arial, sans-serif` : "Calibri, Arial, sans-serif";
|
|
2237
2245
|
e.font = `${t.titleFontBold ?? !0 ? "bold " : ""}${a}px ${s}`, e.fillStyle = t.titleFontColor ? `#${t.titleFontColor}` : "#333", e.textAlign = "center", e.textBaseline = "top", e.fillText(t.title, n + i / 2, r);
|
|
2238
2246
|
}
|
|
2239
|
-
function
|
|
2247
|
+
function Un(e) {
|
|
2240
2248
|
if (e.categories.length > 0) return e.categories;
|
|
2241
2249
|
let t = e.series[0];
|
|
2242
2250
|
if (t?.categories && t.categories.length > 0) return t.categories;
|
|
@@ -2244,7 +2252,7 @@ function Hn(e) {
|
|
|
2244
2252
|
for (let t of e.series) t.values.length > n && (n = t.values.length);
|
|
2245
2253
|
return n > 0 ? Array.from({ length: n }, (e, t) => String(t + 1)) : [];
|
|
2246
2254
|
}
|
|
2247
|
-
function
|
|
2255
|
+
function Wn(e, t, n, r, i, a, o, s, c, l = !1) {
|
|
2248
2256
|
let u = s ?? "outEnd";
|
|
2249
2257
|
if (e.fillStyle = c ? `#${c}` : "#333", o === "vertical") {
|
|
2250
2258
|
let o = n + a / 2, s = l ? r + i : r, c = l ? r : r + i;
|
|
@@ -2254,10 +2262,10 @@ function Un(e, t, n, r, i, a, o, s, c, l = !1) {
|
|
|
2254
2262
|
u === "inBase" ? (e.textAlign = l ? "right" : "left", e.textBaseline = "middle", e.fillText(t, l ? c - 4 : c + 4, o)) : u === "inEnd" ? (e.textAlign = l ? "left" : "right", e.textBaseline = "middle", e.fillText(t, l ? s + 4 : s - 4, o)) : u === "ctr" ? (e.textAlign = "center", e.textBaseline = "middle", e.fillText(t, n + i / 2, o)) : (e.textAlign = l ? "right" : "left", e.textBaseline = "middle", e.fillText(t, l ? s - 2 : s + 2, o));
|
|
2255
2263
|
}
|
|
2256
2264
|
}
|
|
2257
|
-
function
|
|
2258
|
-
let { x: i, y: a, w: o, h: s } = n, c = t.chartType === "clusteredBarH" || t.chartType === "stackedBarH" || t.chartType === "stackedBarHPct", l = t.chartType.startsWith("stacked"), u = t.chartType === "stackedBarPct" || t.chartType === "stackedBarHPct", d = t.series.filter((e) => e.seriesType !== "line"), f = t.series.filter((e) => e.seriesType === "line"), p = !c && t.secondaryValAxis && f.some((e) => e.useSecondaryAxis === !0) ? t.secondaryValAxis : null, m =
|
|
2265
|
+
function Gn(e, t, n, r) {
|
|
2266
|
+
let { x: i, y: a, w: o, h: s } = n, c = t.chartType === "clusteredBarH" || t.chartType === "stackedBarH" || t.chartType === "stackedBarHPct", l = t.chartType.startsWith("stacked"), u = t.chartType === "stackedBarPct" || t.chartType === "stackedBarHPct", d = t.series.filter((e) => e.seriesType !== "line"), f = t.series.filter((e) => e.seriesType === "line"), p = !c && t.secondaryValAxis && f.some((e) => e.useSecondaryAxis === !0) ? t.secondaryValAxis : null, m = Un(t), h = m.length;
|
|
2259
2267
|
if (h === 0) return;
|
|
2260
|
-
let g =
|
|
2268
|
+
let g = un(t), _ = et(t, s, r), v = _.fontPx, y = _.topPad, b = _.bandH, x = Fn(t.catAxisFontSizeHpt, s, r), S = Fn(t.valAxisFontSizeHpt, s, r), C = qe(t, o, s, .22), { legRightW: w, legLeftW: T, legTopH: E, legBottomH: D } = Je(C), O = Ze(t, o, s, r), k = O.catFontPx, A = O.valFontPx, j = O.catBandH, M = O.valBandW, N = b + E + S / 2 + 2, ee = c ? (t.valAxisHidden ? s * .02 : tt(S)) + j + D : tt(x) + j + D, te = s - N - ee, ne = c ? o - ((t.catAxisHidden ? o * .03 : o * .22) + M + T) - (w + o * .03) : 0, re = (c ? ne : te) / r, P = 0, F = 0;
|
|
2261
2269
|
for (let e = 0; e < h; e++) {
|
|
2262
2270
|
let t = 0, n = 0;
|
|
2263
2271
|
for (let r of d) {
|
|
@@ -2273,7 +2281,7 @@ function Wn(e, t, n, r) {
|
|
|
2273
2281
|
}
|
|
2274
2282
|
}
|
|
2275
2283
|
u && (P = P > 0 ? 100 : 0, F = F < 0 ? -100 : 0), t.valMax != null && (P = t.valMax), t.valMin != null && (F = t.valMin), P === 0 && F === 0 && (P = 1);
|
|
2276
|
-
let I =
|
|
2284
|
+
let I = Nn(t, F, P, re), { min: L, max: R, step: z } = I, B = Bn(p, f, te / r), V = B ? B.min : 0, H = B ? B.max : 1, U = B ? B.step : 1, ie = Math.max(8, Math.min(11, s / 20)), W = Math.max(8, Math.min(11, te / 20)), G = e.font, ae = 0;
|
|
2277
2285
|
if (!c && !t.valAxisHidden) {
|
|
2278
2286
|
e.font = `${W}px ${X(t, t.valAxisFontFace, "minor")}`;
|
|
2279
2287
|
let n = 0, r = Math.round((R - L) / z);
|
|
@@ -2297,7 +2305,7 @@ function Wn(e, t, n, r) {
|
|
|
2297
2305
|
b: ee,
|
|
2298
2306
|
l: c ? (t.catAxisHidden ? o * .03 : o * .22) + M + T : T + M + ae
|
|
2299
2307
|
};
|
|
2300
|
-
|
|
2308
|
+
Hn(e, t, i, a + y, o, v);
|
|
2301
2309
|
let { plotRect: { px0: K, py0: q, pw: ue, ph: J } } = nt(t, i, a, o, s, r, {
|
|
2302
2310
|
titleBand: _,
|
|
2303
2311
|
legendSideReserveFrac: .22,
|
|
@@ -2306,16 +2314,16 @@ function Wn(e, t, n, r) {
|
|
|
2306
2314
|
});
|
|
2307
2315
|
if (ue <= 0 || J <= 0) return;
|
|
2308
2316
|
t.plotAreaBg && (e.fillStyle = `#${t.plotAreaBg}`, e.fillRect(K, q, ue, J));
|
|
2309
|
-
let de = H - V || 1, fe = R - L || 1, pe = (e) => q + J - I.frac(e) * J, me = (e) => K + I.frac(e) * ue, he = pe(0), ge = me(0), _e = pe, ve = B ? B.makeToY(q, J) : pe, ye =
|
|
2317
|
+
let de = H - V || 1, fe = R - L || 1, pe = (e) => q + J - I.frac(e) * J, me = (e) => K + I.frac(e) * ue, he = pe(0), ge = me(0), _e = pe, ve = B ? B.makeToY(q, J) : pe, ye = En(t, r), be = Math.round(fe / z);
|
|
2310
2318
|
e.textBaseline = "middle", e.font = `${Math.max(8, Math.min(11, J / 20))}px ${X(t, t.valAxisFontFace, "minor")}`;
|
|
2311
2319
|
let xe = t.valAxisFontColor ? `#${t.valAxisFontColor}` : "#555";
|
|
2312
2320
|
if (e.fillStyle = xe, !t.valAxisHidden) {
|
|
2313
|
-
for (let t of I.minorLines) if (!c)
|
|
2321
|
+
for (let t of I.minorLines) if (!c) Tn(e, K, ue, pe(t), !1, ye);
|
|
2314
2322
|
else {
|
|
2315
2323
|
let n = me(t);
|
|
2316
2324
|
e.strokeStyle = ye.color, e.lineWidth = ye.width, e.beginPath(), e.moveTo(n, q), e.lineTo(n, q + J), e.stroke();
|
|
2317
2325
|
}
|
|
2318
|
-
let n =
|
|
2326
|
+
let n = Mn(t), r = t.valAxisTickLabelPos !== "none";
|
|
2319
2327
|
for (let i of I.majorLines) {
|
|
2320
2328
|
let a = Math.abs(i) < z * 1e-9, o = u ? `${Math.round(i)}%` : Y(i, t.valAxisFormatCode, t.date1904);
|
|
2321
2329
|
if (c) {
|
|
@@ -2323,14 +2331,14 @@ function Wn(e, t, n, r) {
|
|
|
2323
2331
|
n && (e.strokeStyle = ye.explicit ? ye.color : a ? "#aaa" : ye.color, e.lineWidth = ye.explicit ? ye.width : a ? 1 : ye.width, e.beginPath(), e.moveTo(t, q), e.lineTo(t, q + J), e.stroke()), r && (e.textAlign = "center", e.fillText(o, t, q + J + 10));
|
|
2324
2332
|
} else {
|
|
2325
2333
|
let t = pe(i);
|
|
2326
|
-
n &&
|
|
2334
|
+
n && Tn(e, K, ue, t, a, ye), r && (e.textAlign = "right", e.fillText(o, K - 12, t));
|
|
2327
2335
|
}
|
|
2328
2336
|
}
|
|
2329
2337
|
}
|
|
2330
|
-
if (!t.catAxisHidden &&
|
|
2331
|
-
let n =
|
|
2338
|
+
if (!t.catAxisHidden && Dn(t)) {
|
|
2339
|
+
let n = On(t, r);
|
|
2332
2340
|
e.strokeStyle = n.color, e.lineWidth = n.width;
|
|
2333
|
-
for (let n of
|
|
2341
|
+
for (let n of kn(t, h)) {
|
|
2334
2342
|
if (e.beginPath(), c) {
|
|
2335
2343
|
let t = q + n * J;
|
|
2336
2344
|
e.moveTo(K, t), e.lineTo(K + ue, t);
|
|
@@ -2346,13 +2354,13 @@ function Wn(e, t, n, r) {
|
|
|
2346
2354
|
}, De = !t.catAxisHidden && !t.catAxisLineHidden, Oe = !t.valAxisHidden && !t.valAxisLineHidden && t.valAxisLineColor != null, ke = () => {
|
|
2347
2355
|
if (c ? (De && Ee(K, q, K, q + J, Se, Ce), Oe && Ee(K, q + J, K + ue, q + J, we, Te)) : (De && Ee(K, q + J, K + ue, q + J, Se, Ce), Oe && Ee(K, q, K, q + J, we, Te)), !t.valAxisHidden && t.valAxisMajorTickMark && t.valAxisMajorTickMark !== "none") for (let n = 0; n <= be; n++) {
|
|
2348
2356
|
let r = L + n * z;
|
|
2349
|
-
c ?
|
|
2357
|
+
c ? wn(e, t.valAxisMajorTickMark, "cat", q + J, me(r), we, Te) : wn(e, t.valAxisMajorTickMark, "val", K, pe(r), we, Te);
|
|
2350
2358
|
}
|
|
2351
2359
|
if (!t.catAxisHidden && t.catAxisMajorTickMark && t.catAxisMajorTickMark !== "none") {
|
|
2352
2360
|
let n = vt(t), r = n ? h : h - 1;
|
|
2353
2361
|
for (let i = 0; i <= r; i++) {
|
|
2354
2362
|
let r = n ? i / h : h === 1 ? .5 : i / (h - 1);
|
|
2355
|
-
c ?
|
|
2363
|
+
c ? wn(e, t.catAxisMajorTickMark, "val", K, q + r * J, Se, Ce) : wn(e, t.catAxisMajorTickMark, "cat", q + J, K + r * ue, Se, Ce);
|
|
2356
2364
|
}
|
|
2357
2365
|
}
|
|
2358
2366
|
}, Ae = c ? J / h : ue / h, je = l ? 1 : Math.max(1, d.length), Me = l ? 0 : t.barOverlap ?? 0, Ne = t.barGapWidth ?? 150, Pe = Ae / (1 + (je - 1) * (1 - Me / 100) + Ne / 100), Fe = l ? 0 : Pe * (1 - Me / 100), Ie = (Ae - (Pe + (je - 1) * Fe)) / 2;
|
|
@@ -2363,20 +2371,20 @@ function Wn(e, t, n, r) {
|
|
|
2363
2371
|
o === 0 && (o = 1);
|
|
2364
2372
|
}
|
|
2365
2373
|
for (let s = 0; s < d.length; s++) {
|
|
2366
|
-
let f = d[s], p = f.values[n] ?? 0, m = u ? p / o * 100 : p, _ = m < 0, v = g ?
|
|
2374
|
+
let f = d[s], p = f.values[n] ?? 0, m = u ? p / o * 100 : p, _ = m < 0, v = g ? on(n, f) : an(s, f);
|
|
2367
2375
|
if (c) {
|
|
2368
2376
|
let o = l ? s : d.length - 1 - s, c = l ? q + (h - 1 - n) * Ae + Ie : q + (h - 1 - n) * Ae + Ie + o * Fe, p = l ? me(_ ? a : i) : ge, g = me(l ? (_ ? a : i) + m : m), y = Math.min(p, g), b = Math.abs(g - p);
|
|
2369
|
-
e.fillStyle = v, e.fillRect(y, c, b, Pe), t.showDataLabels && m !== 0 && (e.font = `bold ${t.dataLabelFontSizeHpt ? t.dataLabelFontSizeHpt / 100 * r : Math.max(7, Math.min(11, Pe * .6))}px ${X(t, t.dataLabelFontFace, "minor")}`,
|
|
2377
|
+
e.fillStyle = v, e.fillRect(y, c, b, Pe), t.showDataLabels && m !== 0 && (e.font = `bold ${t.dataLabelFontSizeHpt ? t.dataLabelFontSizeHpt / 100 * r : Math.max(7, Math.min(11, Pe * .6))}px ${X(t, t.dataLabelFontFace, "minor")}`, Wn(e, u ? `${Math.round(m)}%` : Y(m, t.dataLabelFormatCode ?? f.valFormatCode ?? null, t.date1904), y, c, b, Pe, "horizontal", t.dataLabelPosition ?? null, f.labelColor ?? t.dataLabelFontColor ?? null, _));
|
|
2370
2378
|
} else {
|
|
2371
2379
|
let o = l ? K + n * Ae + Ie : K + n * Ae + Ie + s * Fe, c = l ? pe(_ ? a : i) : he, d = pe(l ? (_ ? a : i) + m : m), p = Math.min(c, d), h = Math.abs(d - c);
|
|
2372
|
-
e.fillStyle = v, e.fillRect(o, p, Pe, h), t.showDataLabels && m !== 0 && (e.font = `bold ${t.dataLabelFontSizeHpt ? t.dataLabelFontSizeHpt / 100 * r : Math.max(7, Math.min(11, Pe * .6))}px ${X(t, t.dataLabelFontFace, "minor")}`,
|
|
2380
|
+
e.fillStyle = v, e.fillRect(o, p, Pe, h), t.showDataLabels && m !== 0 && (e.font = `bold ${t.dataLabelFontSizeHpt ? t.dataLabelFontSizeHpt / 100 * r : Math.max(7, Math.min(11, Pe * .6))}px ${X(t, t.dataLabelFontFace, "minor")}`, Wn(e, u ? `${Math.round(m)}%` : Y(m, t.dataLabelFormatCode ?? f.valFormatCode ?? null, t.date1904), o, p, h, Pe, "vertical", t.dataLabelPosition ?? null, f.labelColor ?? t.dataLabelFontColor ?? null, _));
|
|
2373
2381
|
}
|
|
2374
2382
|
l && (_ ? a += m : i += m);
|
|
2375
2383
|
}
|
|
2376
2384
|
}
|
|
2377
|
-
if (!t.catAxisHidden &&
|
|
2385
|
+
if (!t.catAxisHidden && In(t)) {
|
|
2378
2386
|
e.fillStyle = t.catAxisFontColor ? `#${t.catAxisFontColor}` : "#555", e.font = `${Math.max(8, Math.min(11, Ae * .5))}px ${X(t, t.catAxisFontFace, "minor")}`;
|
|
2379
|
-
let n = Ae - 4, r = K - 4 - (i + T + M), a =
|
|
2387
|
+
let n = Ae - 4, r = K - 4 - (i + T + M), a = Rn(t);
|
|
2380
2388
|
for (let i = 0; i < h; i++) {
|
|
2381
2389
|
let o = Dt((m[i] ?? "").toString(), t.catAxisFormatCode, t.date1904);
|
|
2382
2390
|
if (c) {
|
|
@@ -2384,12 +2392,12 @@ function Wn(e, t, n, r) {
|
|
|
2384
2392
|
e.textAlign = "right", e.textBaseline = "middle", e.fillText(Pt(e, o, r), K - 4, t);
|
|
2385
2393
|
} else {
|
|
2386
2394
|
let t = K + i * Ae + Ae / 2;
|
|
2387
|
-
e.textAlign = "center", e.textBaseline = "top",
|
|
2395
|
+
e.textAlign = "center", e.textBaseline = "top", zn(e, Pt(e, o, a === 0 ? n : J * .4), t, q + J + 3, a);
|
|
2388
2396
|
}
|
|
2389
2397
|
}
|
|
2390
2398
|
}
|
|
2391
2399
|
if (f.length > 0 && !c) for (let t = 0; t < f.length; t++) {
|
|
2392
|
-
let n = f[t], i =
|
|
2400
|
+
let n = f[t], i = an(d.length + t, n), a = p && n.useSecondaryAxis === !0 ? ve : _e;
|
|
2393
2401
|
e.strokeStyle = i, e.lineWidth = 2, e.setLineDash([]), e.beginPath();
|
|
2394
2402
|
let o = !1;
|
|
2395
2403
|
for (let t = 0; t < h; t++) {
|
|
@@ -2407,7 +2415,7 @@ function Wn(e, t, n, r) {
|
|
|
2407
2415
|
let o = K + t * Ae + Ae / 2, s = a(r);
|
|
2408
2416
|
e.fillStyle = i, e.beginPath(), e.arc(o, s, 3, 0, Math.PI * 2), e.fill();
|
|
2409
2417
|
}
|
|
2410
|
-
|
|
2418
|
+
Pn(e, n, i, (e) => K + e * Ae + Ae / 2, a, r);
|
|
2411
2419
|
}
|
|
2412
2420
|
if (ke(), p) {
|
|
2413
2421
|
let n = K + ue, { color: i, width: a } = gt(p.lineColor, p.lineWidthEmu, r);
|
|
@@ -2416,7 +2424,7 @@ function Wn(e, t, n, r) {
|
|
|
2416
2424
|
let r = Math.max(1, Math.round(de / U));
|
|
2417
2425
|
for (let o = 0; o <= r; o++) {
|
|
2418
2426
|
let r = V + o * U, s = ve(r);
|
|
2419
|
-
|
|
2427
|
+
wn(e, p.majorTickMark, "val", n, s, i, a, !0), e.fillText(Y(r, p.formatCode ?? null, t.date1904), n + 14, s);
|
|
2420
2428
|
}
|
|
2421
2429
|
}
|
|
2422
2430
|
if (p.title) {
|
|
@@ -2424,13 +2432,13 @@ function Wn(e, t, n, r) {
|
|
|
2424
2432
|
e.save(), e.fillStyle = p.titleFontColor ? `#${p.titleFontColor}` : p.fontColor ? `#${p.fontColor}` : "#555", e.font = `${p.titleFontBold ? "bold " : ""}${t}px sans-serif`, e.textAlign = "center", e.textBaseline = "middle", e.translate(K + ue + se + t * .6, q + J / 2), e.rotate(Math.PI / 2), e.fillText(p.title, 0, 0), e.restore();
|
|
2425
2433
|
}
|
|
2426
2434
|
}
|
|
2427
|
-
|
|
2435
|
+
Cn(e, c && !l ? {
|
|
2428
2436
|
...t,
|
|
2429
2437
|
series: [...t.series].reverse()
|
|
2430
|
-
} : t, C, i, a, o, s, K, q, ue, J, b + 2),
|
|
2438
|
+
} : t, C, i, a, o, s, K, q, ue, J, b + 2), mn(e, t, i, a, o, s, K, q, ue, J, T, D, k, A);
|
|
2431
2439
|
}
|
|
2432
|
-
function
|
|
2433
|
-
let { x: i, y: a, w: o, h: s } = n, c =
|
|
2440
|
+
function Kn(e, t, n, r) {
|
|
2441
|
+
let { x: i, y: a, w: o, h: s } = n, c = Un(t), l = c.length;
|
|
2434
2442
|
if (l === 0) return;
|
|
2435
2443
|
let u = t.chartType === "stackedLine" || t.chartType === "stackedLinePct", d = t.chartType === "stackedLinePct", f = d ? c.map((e, n) => {
|
|
2436
2444
|
let r = 0;
|
|
@@ -2441,7 +2449,7 @@ function Gn(e, t, n, r) {
|
|
|
2441
2449
|
let r = 0;
|
|
2442
2450
|
for (let i = 0; i <= e; i++) r += t.series[i].values[n] ?? 0;
|
|
2443
2451
|
return d && f ? r / f[n] * 100 : r;
|
|
2444
|
-
}, h = !u && t.secondaryValAxis && t.series.some((e) => e.useSecondaryAxis === !0) ? t.secondaryValAxis : null, g = (e) => h != null && e.useSecondaryAxis === !0, _ = et(t, s, r), v = _.fontPx, y = _.topPad, b = _.bandH, x = qe(t, o, s, .22), { legRightW: S, legLeftW: C, legTopH: w, legBottomH: T } = Je(x), E =
|
|
2452
|
+
}, h = !u && t.secondaryValAxis && t.series.some((e) => e.useSecondaryAxis === !0) ? t.secondaryValAxis : null, g = (e) => h != null && e.useSecondaryAxis === !0, _ = et(t, s, r), v = _.fontPx, y = _.topPad, b = _.bandH, x = qe(t, o, s, .22), { legRightW: S, legLeftW: C, legTopH: w, legBottomH: T } = Je(x), E = Fn(t.catAxisFontSizeHpt, s, r), D = Fn(t.valAxisFontSizeHpt, s, r), O = Ze(t, o, s, r), k = O.catFontPx, A = O.valFontPx, j = O.catBandH, M = O.valBandW, N = b + w + D / 2 + 2, ee = tt(E) + j + T, te = s - N - ee, ne = Bn(h, t.series, te / r), re = Math.max(8, Math.min(11, s / 20)), P = h?.fontSizeHpt ? h.fontSizeHpt / 100 * r : re, F = 0;
|
|
2445
2453
|
if (h && ne && !h.hidden) {
|
|
2446
2454
|
let n = e.font;
|
|
2447
2455
|
e.font = `${P}px sans-serif`;
|
|
@@ -2455,7 +2463,7 @@ function Gn(e, t, n, r) {
|
|
|
2455
2463
|
b: ee,
|
|
2456
2464
|
l: D * 2.2 + 10 + M + C
|
|
2457
2465
|
};
|
|
2458
|
-
|
|
2466
|
+
Hn(e, t, i, a + y, o, v);
|
|
2459
2467
|
let { plotRect: { px0: R, py0: z, pw: B, ph: V } } = nt(t, i, a, o, s, r, {
|
|
2460
2468
|
titleBand: _,
|
|
2461
2469
|
legendSideReserveFrac: .22,
|
|
@@ -2472,37 +2480,37 @@ function Gn(e, t, n, r) {
|
|
|
2472
2480
|
isFinite(H) || (H = 0, U = 1);
|
|
2473
2481
|
let ie = t.valAxisLogBase != null && t.valAxisLogBase >= 2;
|
|
2474
2482
|
t.valMin == null ? H > 0 && !ie && (H = 0) : H = t.valMin, t.valMax == null ? U < 0 && (U = 0) : U = t.valMax, U === H && (U = H + 1);
|
|
2475
|
-
let W =
|
|
2483
|
+
let W = Nn(t, H, U, V / r);
|
|
2476
2484
|
if (W.max - W.min === 0) return;
|
|
2477
|
-
let G = (e) => z + V - W.frac(e) * V, ae = ne ? ne.makeToY(z, V) : G, oe = (e) => g(e) ? ae : G, se = vt(t), ce =
|
|
2485
|
+
let G = (e) => z + V - W.frac(e) * V, ae = ne ? ne.makeToY(z, V) : G, oe = (e) => g(e) ? ae : G, se = vt(t), ce = jn(t), le = se ? (e) => R + ((ce ? l - 1 - e : e) + .5) / l * B : (e) => {
|
|
2478
2486
|
let t = ce ? l - 1 - e : e;
|
|
2479
2487
|
return R + (l === 1 ? B / 2 : t / (l - 1) * B);
|
|
2480
2488
|
};
|
|
2481
2489
|
if (!t.valAxisHidden) {
|
|
2482
2490
|
e.font = `${D}px ${X(t, t.valAxisFontFace, "minor")}`, e.textBaseline = "middle";
|
|
2483
|
-
let n =
|
|
2484
|
-
for (let t of W.minorLines)
|
|
2485
|
-
let i =
|
|
2491
|
+
let n = En(t, r);
|
|
2492
|
+
for (let t of W.minorLines) Tn(e, R, B, G(t), !1, n);
|
|
2493
|
+
let i = Mn(t), a = t.valAxisTickLabelPos !== "none";
|
|
2486
2494
|
for (let r of W.majorLines) {
|
|
2487
2495
|
let o = G(r);
|
|
2488
|
-
i &&
|
|
2496
|
+
i && Tn(e, R, B, o, r === 0, n), wn(e, t.valAxisMajorTickMark, "val", R, o), a && (e.fillStyle = t.valAxisFontColor ? `#${t.valAxisFontColor}` : "#555", e.textAlign = "right", e.fillText(Y(r, t.valAxisFormatCode, t.date1904), R - 6, o));
|
|
2489
2497
|
}
|
|
2490
2498
|
}
|
|
2491
|
-
if (!t.catAxisHidden &&
|
|
2492
|
-
let n =
|
|
2499
|
+
if (!t.catAxisHidden && Dn(t)) {
|
|
2500
|
+
let n = On(t, r);
|
|
2493
2501
|
e.strokeStyle = n.color, e.lineWidth = n.width;
|
|
2494
|
-
for (let n of
|
|
2502
|
+
for (let n of kn(t, l)) {
|
|
2495
2503
|
let t = R + n * B;
|
|
2496
2504
|
e.beginPath(), e.moveTo(t, z), e.lineTo(t, z + V), e.stroke();
|
|
2497
2505
|
}
|
|
2498
2506
|
}
|
|
2499
2507
|
e.strokeStyle = "#aaa", e.lineWidth = 1, !t.catAxisHidden && !t.catAxisLineHidden && (e.beginPath(), e.moveTo(R, z + V), e.lineTo(R + B, z + V), e.stroke()), !t.valAxisHidden && !t.valAxisLineHidden && (e.beginPath(), e.moveTo(R, z), e.lineTo(R, z + V), e.stroke());
|
|
2500
|
-
let K = Math.max(1, 2.25 * r), q = Math.max(2, 2.5 * r), ue =
|
|
2508
|
+
let K = Math.max(1, 2.25 * r), q = Math.max(2, 2.5 * r), ue = Fn(t.dataLabelFontSizeHpt, s, r);
|
|
2501
2509
|
for (let n = 0; n < t.series.length; n++) {
|
|
2502
|
-
let i = t.series[n], a =
|
|
2510
|
+
let i = t.series[n], a = an(n, i), o = oe(i);
|
|
2503
2511
|
e.strokeStyle = a, e.lineWidth = K, e.setLineDash([]), e.beginPath();
|
|
2504
2512
|
let s = i.smooth === !0, d = [], f = () => {
|
|
2505
|
-
d.length !== 0 && (e.moveTo(d[0].x, d[0].y),
|
|
2513
|
+
d.length !== 0 && (e.moveTo(d[0].x, d[0].y), sr(e, d, s), d = []);
|
|
2506
2514
|
};
|
|
2507
2515
|
for (let e = 0; e < l; e++) {
|
|
2508
2516
|
if (!u && i.values[e] == null) {
|
|
@@ -2519,9 +2527,9 @@ function Gn(e, t, n, r) {
|
|
|
2519
2527
|
}
|
|
2520
2528
|
f(), e.stroke();
|
|
2521
2529
|
let h = (e) => m(n, e);
|
|
2522
|
-
for (let t of i.errBars ?? [])
|
|
2530
|
+
for (let t of i.errBars ?? []) ur(e, i, t, l, le, o, h, a);
|
|
2523
2531
|
e.fillStyle = a;
|
|
2524
|
-
let g = i.showMarker !== !1, _ =
|
|
2532
|
+
let g = i.showMarker !== !1, _ = lr(i), v = dr(e, i, c, l, le, o, h, V, r, t.date1904 ?? !1, u || p === "zero", X(t, t.dataLabelFontFace, "minor"), t.dataLabelPosition ?? "r");
|
|
2525
2533
|
v && (e.fillStyle = a);
|
|
2526
2534
|
for (let s = 0; s < l; s++) {
|
|
2527
2535
|
if (!u && i.values[s] == null && p !== "zero") continue;
|
|
@@ -2530,38 +2538,38 @@ function Gn(e, t, n, r) {
|
|
|
2530
2538
|
let t = (i.dataPointOverrides ?? []).find((e) => e.idx === s), n = t?.markerSymbol ?? i.markerSymbol ?? "circle";
|
|
2531
2539
|
if (n !== "none") {
|
|
2532
2540
|
let l = t?.markerSize ?? i.markerSize ?? 5, u = t?.markerFill ?? t?.color ?? i.markerFill ?? a, d = t?.markerLine ?? i.markerLine ?? null;
|
|
2533
|
-
|
|
2541
|
+
nr(e, le(s), o(c), n, l, u, d, r);
|
|
2534
2542
|
}
|
|
2535
2543
|
} else e.beginPath(), e.arc(le(s), o(c), q, 0, Math.PI * 2), e.fill();
|
|
2536
|
-
t.showDataLabels && !v && (
|
|
2544
|
+
t.showDataLabels && !v && (ar(e, le(s), o(c), Et(c), t.dataLabelPosition ?? "r", ue, void 0, !1, X(t, t.dataLabelFontFace, "minor"), g ? q + 1 : 2), e.fillStyle = a);
|
|
2537
2545
|
}
|
|
2538
|
-
|
|
2546
|
+
Pn(e, i, a, le, o, r);
|
|
2539
2547
|
}
|
|
2540
2548
|
if (!t.catAxisHidden) {
|
|
2541
2549
|
let n = Math.max(1, Math.ceil(l / 8)), r = t.catAxisFontColor ? `#${t.catAxisFontColor}` : "#555";
|
|
2542
2550
|
e.fillStyle = r, e.textAlign = "center", e.textBaseline = "top", e.font = `${E}px ${X(t, t.catAxisFontFace, "minor")}`;
|
|
2543
|
-
let i = B / l * n - 4, a =
|
|
2551
|
+
let i = B / l * n - 4, a = In(t), o = Rn(t);
|
|
2544
2552
|
for (let s = 0; s < l; s += n) {
|
|
2545
2553
|
let n = le(s);
|
|
2546
|
-
|
|
2554
|
+
wn(e, t.catAxisMajorTickMark, "cat", z + V, n), a && (e.fillStyle = r, zn(e, Pt(e, Dt((c[s] ?? "").toString(), t.catAxisFormatCode, t.date1904), o === 0 ? i : V * .4), n, z + V + 5, o));
|
|
2547
2555
|
}
|
|
2548
2556
|
}
|
|
2549
2557
|
if (h && ne) {
|
|
2550
2558
|
let n = t.valAxisFontColor ? `#${t.valAxisFontColor}` : "#555";
|
|
2551
|
-
|
|
2559
|
+
Vn(e, h, ne, ae, R, z, B, V, s, r, P, F, n, t.date1904);
|
|
2552
2560
|
}
|
|
2553
|
-
|
|
2561
|
+
Cn(e, t, x, i, a, o, s, R, z, B, V, b + 2), mn(e, t, i, a, o, s, R, z, B, V, C, T, k, A);
|
|
2554
2562
|
}
|
|
2555
|
-
function
|
|
2556
|
-
let { x: i, y: a, w: o, h: s } = n, c =
|
|
2563
|
+
function qn(e, t, n, r) {
|
|
2564
|
+
let { x: i, y: a, w: o, h: s } = n, c = Un(t), l = c.length;
|
|
2557
2565
|
if (l === 0) return;
|
|
2558
|
-
let u = t.series, d = u.length >= 4, f = d ? 0 : -1, p = +!!d, m = d ? 2 : 1, h = d ? 3 : 2, g = u[p], _ = u[m], v = u[h], y = f >= 0 ? u[f] : void 0, b = et(t, s, r), x = b.fontPx, S = b.topPad, C = b.bandH, w = qe(t, o, s, .22), { legRightW: T, legLeftW: E, legBottomH: D, legTopH: O } = Je(w), k =
|
|
2566
|
+
let u = t.series, d = u.length >= 4, f = d ? 0 : -1, p = +!!d, m = d ? 2 : 1, h = d ? 3 : 2, g = u[p], _ = u[m], v = u[h], y = f >= 0 ? u[f] : void 0, b = et(t, s, r), x = b.fontPx, S = b.topPad, C = b.bandH, w = qe(t, o, s, .22), { legRightW: T, legLeftW: E, legBottomH: D, legTopH: O } = Je(w), k = Fn(t.catAxisFontSizeHpt, s, r), A = Fn(t.valAxisFontSizeHpt, s, r), j = Ze(t, o, s, r), M = j.catFontPx, N = j.valFontPx, ee = j.catBandH, te = j.valBandW, ne = C + O + A / 2 + 2, re = tt(k) + ee + D, P = {
|
|
2559
2567
|
t: ne,
|
|
2560
2568
|
r: T + o * .05,
|
|
2561
2569
|
b: re,
|
|
2562
2570
|
l: A * 2.2 + 10 + te + E
|
|
2563
2571
|
};
|
|
2564
|
-
|
|
2572
|
+
Hn(e, t, i, a + S, o, x);
|
|
2565
2573
|
let { plotRect: { px0: F, py0: I, pw: L, ph: R } } = nt(t, i, a, o, s, r, {
|
|
2566
2574
|
titleBand: b,
|
|
2567
2575
|
legendSideReserveFrac: .22,
|
|
@@ -2575,20 +2583,20 @@ function Kn(e, t, n, r) {
|
|
|
2575
2583
|
n != null && (z = Math.min(z, n), B = Math.max(B, n));
|
|
2576
2584
|
}
|
|
2577
2585
|
isFinite(z) || (z = 0, B = 1), t.valMin == null ? z > 0 && (z = 0) : z = t.valMin, t.valMax == null ? B < 0 && (B = 0) : B = t.valMax, B === z && (B = z + 1);
|
|
2578
|
-
let V =
|
|
2586
|
+
let V = Nn(t, z, B, R / r);
|
|
2579
2587
|
if (V.max - V.min === 0) return;
|
|
2580
|
-
let H = (e) => I + R - V.frac(e) * R, U = vt(t), ie =
|
|
2588
|
+
let H = (e) => I + R - V.frac(e) * R, U = vt(t), ie = jn(t), W = U ? (e) => F + ((ie ? l - 1 - e : e) + .5) / l * L : (e) => {
|
|
2581
2589
|
let t = ie ? l - 1 - e : e;
|
|
2582
2590
|
return F + (l === 1 ? L / 2 : t / (l - 1) * L);
|
|
2583
2591
|
};
|
|
2584
2592
|
if (!t.valAxisHidden) {
|
|
2585
2593
|
e.font = `${A}px ${X(t, t.valAxisFontFace, "minor")}`, e.textBaseline = "middle";
|
|
2586
|
-
let n =
|
|
2587
|
-
for (let t of V.minorLines)
|
|
2588
|
-
let i =
|
|
2594
|
+
let n = En(t, r);
|
|
2595
|
+
for (let t of V.minorLines) Tn(e, F, L, H(t), !1, n);
|
|
2596
|
+
let i = Mn(t), a = t.valAxisTickLabelPos !== "none";
|
|
2589
2597
|
for (let r of V.majorLines) {
|
|
2590
2598
|
let o = H(r);
|
|
2591
|
-
i &&
|
|
2599
|
+
i && Tn(e, F, L, o, r === 0, n), wn(e, t.valAxisMajorTickMark, "val", F, o), a && (e.fillStyle = t.valAxisFontColor ? `#${t.valAxisFontColor}` : "#555", e.textAlign = "right", e.fillText(Y(r, t.valAxisFormatCode, t.date1904), F - 6, o));
|
|
2592
2600
|
}
|
|
2593
2601
|
}
|
|
2594
2602
|
if (e.strokeStyle = "#aaa", e.lineWidth = 1, !t.catAxisHidden && !t.catAxisLineHidden && (e.beginPath(), e.moveTo(F, I + R), e.lineTo(F + L, I + R), e.stroke()), !t.valAxisHidden && !t.valAxisLineHidden && (e.beginPath(), e.moveTo(F, I), e.lineTo(F, I + R), e.stroke()), (t.stockHiLowLines ?? !0) && g != null && _ != null && g && _) {
|
|
@@ -2602,13 +2610,13 @@ function Kn(e, t, n, r) {
|
|
|
2602
2610
|
}
|
|
2603
2611
|
let G = (t, n, i) => {
|
|
2604
2612
|
if (!t) return;
|
|
2605
|
-
let a =
|
|
2613
|
+
let a = an(n, t), o = t.markerSymbol ?? null, s = o != null && o !== "none" && lr(t), c = Math.max(3, L / l * .22);
|
|
2606
2614
|
for (let n = 0; n < l; n++) {
|
|
2607
2615
|
let l = t.values[n];
|
|
2608
2616
|
if (l == null) continue;
|
|
2609
2617
|
let u = W(n), d = H(l);
|
|
2610
2618
|
if (s) {
|
|
2611
|
-
|
|
2619
|
+
nr(e, u, d, o, t.markerSize ?? 3, t.markerFill ?? a, t.markerLine ?? null, r);
|
|
2612
2620
|
continue;
|
|
2613
2621
|
}
|
|
2614
2622
|
e.strokeStyle = a, e.lineWidth = Math.max(1, .75 * r), e.beginPath();
|
|
@@ -2620,16 +2628,16 @@ function Kn(e, t, n, r) {
|
|
|
2620
2628
|
if (!t.catAxisHidden) {
|
|
2621
2629
|
let n = Math.max(1, Math.ceil(l / 8)), r = t.catAxisFontColor ? `#${t.catAxisFontColor}` : "#555";
|
|
2622
2630
|
e.fillStyle = r, e.textAlign = "center", e.textBaseline = "top", e.font = `${k}px ${X(t, t.catAxisFontFace, "minor")}`;
|
|
2623
|
-
let i = L / l * n - 4, a =
|
|
2631
|
+
let i = L / l * n - 4, a = In(t), o = Rn(t);
|
|
2624
2632
|
for (let s = 0; s < l; s += n) {
|
|
2625
2633
|
let n = W(s);
|
|
2626
|
-
|
|
2634
|
+
wn(e, t.catAxisMajorTickMark, "cat", I + R, n), a && (e.fillStyle = r, zn(e, Pt(e, Dt((c[s] ?? "").toString(), t.catAxisFormatCode, t.date1904), o === 0 ? i : R * .4), n, I + R + 5, o));
|
|
2627
2635
|
}
|
|
2628
2636
|
}
|
|
2629
|
-
|
|
2637
|
+
Cn(e, t, w, i, a, o, s, F, I, L, R, C + 2), mn(e, t, i, a, o, s, F, I, L, R, E, D, M, N);
|
|
2630
2638
|
}
|
|
2631
|
-
function
|
|
2632
|
-
let { x: i, y: a, w: o, h: s } = n, c =
|
|
2639
|
+
function Jn(e, t, n, r) {
|
|
2640
|
+
let { x: i, y: a, w: o, h: s } = n, c = Un(t), l = c.length;
|
|
2633
2641
|
if (l === 0) return;
|
|
2634
2642
|
let u = t.chartType === "stackedArea" || t.chartType === "stackedAreaPct", d = t.chartType === "stackedAreaPct", f = d ? c.map((e, n) => {
|
|
2635
2643
|
let r = 0;
|
|
@@ -2638,7 +2646,7 @@ function qn(e, t, n, r) {
|
|
|
2638
2646
|
}) : null, p = (e, n) => {
|
|
2639
2647
|
let r = t.series[e].values[n] ?? 0;
|
|
2640
2648
|
return d && f ? r / f[n] * 100 : r;
|
|
2641
|
-
}, m = !u && t.secondaryValAxis && t.series.some((e) => e.useSecondaryAxis === !0) ? t.secondaryValAxis : null, h = (e) => m != null && e.useSecondaryAxis === !0, g = et(t, s, r), _ = g.fontPx, v = g.topPad, y = g.bandH, b =
|
|
2649
|
+
}, m = !u && t.secondaryValAxis && t.series.some((e) => e.useSecondaryAxis === !0) ? t.secondaryValAxis : null, h = (e) => m != null && e.useSecondaryAxis === !0, g = et(t, s, r), _ = g.fontPx, v = g.topPad, y = g.bandH, b = Fn(t.catAxisFontSizeHpt, s, r), x = Fn(t.valAxisFontSizeHpt, s, r), S = qe(t, o, s, .22), { legRightW: C, legLeftW: w, legTopH: T, legBottomH: E } = Je(S), D = Ze(t, o, s, r), O = D.catFontPx, k = D.valFontPx, A = D.catBandH, j = D.valBandW, M = y + T + x / 2 + 2, N = tt(b) + A + E, ee = s - M - N, te = Bn(m, t.series, ee / r), ne = Math.max(8, Math.min(11, s / 20)), re = m?.fontSizeHpt ? m.fontSizeHpt / 100 * r : ne, P = 0;
|
|
2642
2650
|
if (m && te && !m.hidden) {
|
|
2643
2651
|
let n = e.font;
|
|
2644
2652
|
e.font = `${re}px sans-serif`;
|
|
@@ -2652,7 +2660,7 @@ function qn(e, t, n, r) {
|
|
|
2652
2660
|
b: N,
|
|
2653
2661
|
l: o * .12 + j + w
|
|
2654
2662
|
};
|
|
2655
|
-
|
|
2663
|
+
Hn(e, t, i, a + v, o, _);
|
|
2656
2664
|
let { plotRect: { px0: L, py0: R, pw: z, ph: B } } = nt(t, i, a, o, s, r, {
|
|
2657
2665
|
titleBand: g,
|
|
2658
2666
|
legendSideReserveFrac: .22,
|
|
@@ -2669,31 +2677,31 @@ function qn(e, t, n, r) {
|
|
|
2669
2677
|
d && (V = V > 0 ? 100 : 0), t.valMax != null && (V = t.valMax), V === 0 && (V = 1);
|
|
2670
2678
|
let { max: H, step: U } = ct(0, V, void 0, t.valMax, B / r, t.valAxisMajorUnit), ie = vt(t), W = ie ? (e) => L + (e + .5) / l * z : (e) => L + (l === 1 ? z / 2 : e / (l - 1) * z), G = (e) => R + B - e / H * B, ae = te ? te.makeToY(R, B) : G, oe = (e) => h(e) ? ae : G, { color: se, width: ce } = gt(t.catAxisLineColor, t.catAxisLineWidthEmu, r), { color: le, width: K } = gt(t.valAxisLineColor, t.valAxisLineWidthEmu, r);
|
|
2671
2679
|
if (!t.valAxisHidden) {
|
|
2672
|
-
let n =
|
|
2673
|
-
if (t.valAxisMinorGridlines && i != null && isFinite(i) && i > 0 && i < U) for (let t = i; t < H - 1e-9; t += i) Math.abs(t / U - Math.round(t / U)) > 1e-6 &&
|
|
2674
|
-
if (
|
|
2680
|
+
let n = En(t, r), i = t.valAxisMinorUnit;
|
|
2681
|
+
if (t.valAxisMinorGridlines && i != null && isFinite(i) && i > 0 && i < U) for (let t = i; t < H - 1e-9; t += i) Math.abs(t / U - Math.round(t / U)) > 1e-6 && Tn(e, L, z, G(t), !1, n);
|
|
2682
|
+
if (Mn(t)) {
|
|
2675
2683
|
let t = Math.round(H / U);
|
|
2676
|
-
for (let r = 0; r <= t; r++)
|
|
2684
|
+
for (let r = 0; r <= t; r++) Tn(e, L, z, G(r * U), r === 0, n);
|
|
2677
2685
|
}
|
|
2678
2686
|
}
|
|
2679
|
-
if (!t.catAxisHidden &&
|
|
2680
|
-
let n =
|
|
2687
|
+
if (!t.catAxisHidden && Dn(t)) {
|
|
2688
|
+
let n = On(t, r);
|
|
2681
2689
|
e.strokeStyle = n.color, e.lineWidth = n.width;
|
|
2682
|
-
for (let n of
|
|
2690
|
+
for (let n of kn(t, l)) {
|
|
2683
2691
|
let t = L + n * z;
|
|
2684
2692
|
e.beginPath(), e.moveTo(t, R), e.lineTo(t, R + B), e.stroke();
|
|
2685
2693
|
}
|
|
2686
2694
|
}
|
|
2687
2695
|
let q = u ? Array(l).fill(0) : null;
|
|
2688
2696
|
for (let n = t.series.length - 1; n >= 0; n--) {
|
|
2689
|
-
let r = t.series[n], i =
|
|
2697
|
+
let r = t.series[n], i = an(n, r), a = R + B, o = oe(r), s = r.smooth === !0;
|
|
2690
2698
|
if (e.beginPath(), u && q) {
|
|
2691
2699
|
let t = [];
|
|
2692
2700
|
for (let e = 0; e < l; e++) t.push({
|
|
2693
2701
|
x: W(e),
|
|
2694
2702
|
y: G(p(n, e) + q[e])
|
|
2695
2703
|
});
|
|
2696
|
-
e.moveTo(t[0].x, t[0].y),
|
|
2704
|
+
e.moveTo(t[0].x, t[0].y), sr(e, t, s);
|
|
2697
2705
|
for (let t = l - 1; t >= 0; t--) e.lineTo(W(t), G(q[t]));
|
|
2698
2706
|
for (let e = 0; e < l; e++) q[e] += p(n, e);
|
|
2699
2707
|
} else {
|
|
@@ -2702,9 +2710,9 @@ function qn(e, t, n, r) {
|
|
|
2702
2710
|
x: W(e),
|
|
2703
2711
|
y: o(r.values[e] ?? 0)
|
|
2704
2712
|
});
|
|
2705
|
-
e.moveTo(W(0), a), e.lineTo(t[0].x, t[0].y),
|
|
2713
|
+
e.moveTo(W(0), a), e.lineTo(t[0].x, t[0].y), sr(e, t, s), e.lineTo(W(l - 1), a);
|
|
2706
2714
|
}
|
|
2707
|
-
e.closePath(), e.fillStyle =
|
|
2715
|
+
e.closePath(), e.fillStyle = Xt(i, .6), e.fill(), e.strokeStyle = i, e.lineWidth = 1.5, e.setLineDash([]), e.stroke();
|
|
2708
2716
|
}
|
|
2709
2717
|
{
|
|
2710
2718
|
let n = Math.max(2, 2.5 * r), i = (e, n) => {
|
|
@@ -2716,16 +2724,16 @@ function qn(e, t, n, r) {
|
|
|
2716
2724
|
return t.series[e].values[n] ?? 0;
|
|
2717
2725
|
};
|
|
2718
2726
|
for (let a = 0; a < t.series.length; a++) {
|
|
2719
|
-
let o = t.series[a], s =
|
|
2720
|
-
for (let t of o.errBars ?? [])
|
|
2721
|
-
if (o.showMarker === !0 ||
|
|
2727
|
+
let o = t.series[a], s = an(a, o), u = oe(o), d = (e) => i(a, e);
|
|
2728
|
+
for (let t of o.errBars ?? []) ur(e, o, t, l, W, u, d, s);
|
|
2729
|
+
if (o.showMarker === !0 || lr(o)) for (let t = 0; t < l; t++) {
|
|
2722
2730
|
if (o.values[t] == null) continue;
|
|
2723
2731
|
let i = (o.dataPointOverrides ?? []).find((e) => e.idx === t), a = i?.markerSymbol ?? o.markerSymbol ?? "circle";
|
|
2724
2732
|
if (a === "none") continue;
|
|
2725
2733
|
let c = W(t), l = u(d(t));
|
|
2726
|
-
|
|
2734
|
+
lr(o) ? nr(e, c, l, a, i?.markerSize ?? o.markerSize ?? 5, i?.markerFill ?? i?.color ?? o.markerFill ?? s, i?.markerLine ?? o.markerLine ?? null, r) : (e.fillStyle = s, e.beginPath(), e.arc(c, l, n, 0, Math.PI * 2), e.fill());
|
|
2727
2735
|
}
|
|
2728
|
-
|
|
2736
|
+
dr(e, o, c, l, W, u, d, B, r, t.date1904 ?? !1, !0, X(t, t.dataLabelFontFace, "minor"), t.dataLabelPosition ?? "ctr");
|
|
2729
2737
|
}
|
|
2730
2738
|
}
|
|
2731
2739
|
if (!t.valAxisHidden) {
|
|
@@ -2733,11 +2741,11 @@ function qn(e, t, n, r) {
|
|
|
2733
2741
|
let n = Math.round(H / U);
|
|
2734
2742
|
for (let r = 0; r <= n; r++) {
|
|
2735
2743
|
let n = r * U, i = G(n);
|
|
2736
|
-
|
|
2744
|
+
wn(e, t.valAxisMajorTickMark, "val", L, i, le, K), e.fillStyle = t.valAxisFontColor ? `#${t.valAxisFontColor}` : "#555", e.textAlign = "right", e.fillText(Y(n, t.valAxisFormatCode, t.date1904), L - 6, i);
|
|
2737
2745
|
}
|
|
2738
2746
|
}
|
|
2739
|
-
if (!t.catAxisHidden && !t.catAxisLineHidden && (e.strokeStyle = se, e.lineWidth = ce, e.beginPath(), e.moveTo(L, R + B), e.lineTo(L + z, R + B), e.stroke()), !t.valAxisHidden && !t.valAxisLineHidden && t.valAxisLineColor != null && (e.strokeStyle = le, e.lineWidth = K, e.beginPath(), e.moveTo(L, R), e.lineTo(L, R + B), e.stroke()), !t.catAxisHidden && t.catAxisMajorTickMark && t.catAxisMajorTickMark !== "none") if (ie) for (let n = 0; n <= l; n++)
|
|
2740
|
-
else for (let n = 0; n < l; n++)
|
|
2747
|
+
if (!t.catAxisHidden && !t.catAxisLineHidden && (e.strokeStyle = se, e.lineWidth = ce, e.beginPath(), e.moveTo(L, R + B), e.lineTo(L + z, R + B), e.stroke()), !t.valAxisHidden && !t.valAxisLineHidden && t.valAxisLineColor != null && (e.strokeStyle = le, e.lineWidth = K, e.beginPath(), e.moveTo(L, R), e.lineTo(L, R + B), e.stroke()), !t.catAxisHidden && t.catAxisMajorTickMark && t.catAxisMajorTickMark !== "none") if (ie) for (let n = 0; n <= l; n++) wn(e, t.catAxisMajorTickMark, "cat", R + B, L + n / l * z, se, ce);
|
|
2748
|
+
else for (let n = 0; n < l; n++) wn(e, t.catAxisMajorTickMark, "cat", R + B, W(n), se, ce);
|
|
2741
2749
|
if (!t.catAxisHidden) {
|
|
2742
2750
|
e.fillStyle = t.catAxisFontColor ? `#${t.catAxisFontColor}` : "#555", e.textAlign = "center", e.textBaseline = "top", e.font = `${Math.max(8, Math.min(11, z / l * .8))}px ${X(t, t.catAxisFontFace, "minor")}`;
|
|
2743
2751
|
let n = c.map((e) => Dt((e ?? "").toString(), t.catAxisFormatCode, t.date1904)), r = 0;
|
|
@@ -2747,12 +2755,12 @@ function qn(e, t, n, r) {
|
|
|
2747
2755
|
}
|
|
2748
2756
|
if (m && te) {
|
|
2749
2757
|
let n = t.valAxisFontColor ? `#${t.valAxisFontColor}` : "#555";
|
|
2750
|
-
|
|
2758
|
+
Vn(e, m, te, ae, L, R, z, B, s, r, re, P, n, t.date1904);
|
|
2751
2759
|
}
|
|
2752
|
-
|
|
2760
|
+
Cn(e, t, S, i, a, o, s, L, R, z, B, y + 2), mn(e, t, i, a, o, s, L, R, z, B, w, E, O, k);
|
|
2753
2761
|
}
|
|
2754
|
-
var
|
|
2755
|
-
function
|
|
2762
|
+
var Yn = .88;
|
|
2763
|
+
function Xn(e, t, n, r, i) {
|
|
2756
2764
|
let { x: a, y: o, w: s, h: c } = n, l = t.series[0];
|
|
2757
2765
|
if (!l) return;
|
|
2758
2766
|
let u = l.categories && l.categories.length > 0 ? l.categories : t.categories, d = l.values.map((e) => Math.abs(e ?? 0)), f = d.reduce((e, t) => e + t, 0);
|
|
@@ -2763,7 +2771,7 @@ function Yn(e, t, n, r, i) {
|
|
|
2763
2771
|
legendSideReserveFrac: .28,
|
|
2764
2772
|
radialGapFrac: .02
|
|
2765
2773
|
}), m = p.title.fontPx, h = p.title.bandH;
|
|
2766
|
-
|
|
2774
|
+
Hn(e, t, a, o + p.title.topPad, s, m);
|
|
2767
2775
|
let g = p.legend, { px0: _, py0: v, pw: y, ph: b } = p.plotRect, x = p.center.cx, S = p.center.cy, C = Math.min(y, b) * .42, w = -Math.PI / 2 + (t.firstSliceAngle ?? 0) * Math.PI / 180, T = r ? Math.max(1, Math.min(90, t.holeSize ?? 50)) : 0, E = r ? t.series : [l], D = T / 100 * C, O = (C - D) / E.length, k = (e, t) => {
|
|
2768
2776
|
let n = (e.dataPointOverrides ?? []).find((e) => e.idx === t)?.explosion ?? 0;
|
|
2769
2777
|
return n > 0 ? n / 100 * C : 0;
|
|
@@ -2773,7 +2781,7 @@ function Yn(e, t, n, r, i) {
|
|
|
2773
2781
|
if (a === 0) continue;
|
|
2774
2782
|
let o = C - t * O, s = o - O, c = w;
|
|
2775
2783
|
for (let l = 0; l < i.length; l++) {
|
|
2776
|
-
let u = i[l] / a * Math.PI * 2, d =
|
|
2784
|
+
let u = i[l] / a * Math.PI * 2, d = on(l, n), f = c + u / 2, p = k(n, l), m = p > 0 ? Math.cos(f) * p : 0, h = p > 0 ? Math.sin(f) * p : 0;
|
|
2777
2785
|
if (e.beginPath(), s > .01 ? (e.arc(x + m, S + h, o, c, c + u), e.arc(x + m, S + h, s, c + u, c, !0)) : (e.moveTo(x + m, S + h), e.arc(x + m, S + h, o, c, c + u)), e.closePath(), e.fillStyle = d, e.fill(), e.strokeStyle = "#fff", e.lineWidth = 1, e.stroke(), M && t === 0 && u > .15) {
|
|
2778
2786
|
let t = C * (r ? .75 : .6), n = x + m + Math.cos(f) * t, o = S + h + Math.sin(f) * t, s = Math.round(i[l] / a * 100);
|
|
2779
2787
|
e.font = `bold ${Math.max(8, C * .1)}px ${N}`, e.fillStyle = "#fff", e.textAlign = "center", e.textBaseline = "middle", e.fillText(`${s}%`, n, o);
|
|
@@ -2781,20 +2789,20 @@ function Yn(e, t, n, r, i) {
|
|
|
2781
2789
|
c += u;
|
|
2782
2790
|
}
|
|
2783
2791
|
}
|
|
2784
|
-
if (j &&
|
|
2792
|
+
if (j && Zn(e, t, A, l, u, d, f, x, S, C, D, w, N, i, _, v, y, b), g) {
|
|
2785
2793
|
let n = [{
|
|
2786
2794
|
...l,
|
|
2787
2795
|
categories: u
|
|
2788
2796
|
}];
|
|
2789
|
-
|
|
2797
|
+
Cn(e, {
|
|
2790
2798
|
...t,
|
|
2791
2799
|
series: n
|
|
2792
2800
|
}, g, a, o, s, c, _, v, y, b, h + 2);
|
|
2793
2801
|
}
|
|
2794
2802
|
}
|
|
2795
|
-
function
|
|
2803
|
+
function Zn(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _) {
|
|
2796
2804
|
if (n.labelBox) {
|
|
2797
|
-
|
|
2805
|
+
Qn(e, t, n, r, i, a, o, s, c, l, d, f, p, m, g, h, _);
|
|
2798
2806
|
return;
|
|
2799
2807
|
}
|
|
2800
2808
|
let v = r.dataLabelOverrides ?? [], y = d;
|
|
@@ -2810,11 +2818,11 @@ function Xn(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _) {
|
|
|
2810
2818
|
g && e.push((i[d] ?? "").toString()), _ && e.push(r.name), b && e.push(Y(a[d], n.formatCode ?? null, t.date1904 ?? !1)), x && e.push(`${Math.round(a[d] / o * 100)}%`), S = e.filter(Boolean).join(" ");
|
|
2811
2819
|
}
|
|
2812
2820
|
if (!S) continue;
|
|
2813
|
-
let C = (h?.position ?? n.position ?? "bestFit") === "outEnd", w = C ? l + Math.max(10, l * .12) : u > .01 ? (u + l) / 2 : l *
|
|
2821
|
+
let C = (h?.position ?? n.position ?? "bestFit") === "outEnd", w = C ? l + Math.max(10, l * .12) : u > .01 ? (u + l) / 2 : l * Yn, T = s + Math.cos(m) * w, E = c + Math.sin(m) * w, D = h?.fontSizeHpt ?? n.fontSizeHpt, O = D ? D / 100 : Math.max(8, l * .1), k = h?.fontBold ?? n.fontBold, A = h?.fontColor ?? n.fontColor;
|
|
2814
2822
|
e.font = `${k ? "bold " : ""}${O}px ${f}`, e.fillStyle = A ? `#${A}` : C ? "#333" : "#fff", e.textAlign = "center", e.textBaseline = "middle", e.fillText(S, T, E);
|
|
2815
2823
|
}
|
|
2816
2824
|
}
|
|
2817
|
-
function
|
|
2825
|
+
function Qn(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g) {
|
|
2818
2826
|
let _ = r.dataLabelOverrides ?? [], v = (e) => _.find((t) => t.idx === e), y = n.fontSizeHpt ? n.fontSizeHpt / 100 : Math.max(9, l * .09), b = Math.max(4, y * .45), x = Math.max(2, y * .28), S = y * .22, C = n.labelBox, w = [], T = u;
|
|
2819
2827
|
for (let u = 0; u < a.length; u++) {
|
|
2820
2828
|
let p = a[u] / o * Math.PI * 2, m = T + p / 2;
|
|
@@ -2897,8 +2905,8 @@ function Zn(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g) {
|
|
|
2897
2905
|
for (let n = 0; n < t.lines.length; n++) e.fillText(t.lines[n], t.cxBox, a + n * i);
|
|
2898
2906
|
}
|
|
2899
2907
|
}
|
|
2900
|
-
function
|
|
2901
|
-
let { x: i, y: a, w: o, h: s } = n, c =
|
|
2908
|
+
function $n(e, t, n, r) {
|
|
2909
|
+
let { x: i, y: a, w: o, h: s } = n, c = Un(t), l = c.length;
|
|
2902
2910
|
if (l < 3) return;
|
|
2903
2911
|
let u = nt(t, i, a, o, s, r, {
|
|
2904
2912
|
titleTopPadFrac: .035,
|
|
@@ -2906,7 +2914,7 @@ function Qn(e, t, n, r) {
|
|
|
2906
2914
|
legendSideReserveFrac: .22,
|
|
2907
2915
|
radialGapFrac: .02
|
|
2908
2916
|
}), d = u.legend, f = u.title.fontPx;
|
|
2909
|
-
|
|
2917
|
+
Hn(e, t, i, a + u.title.topPad, o, f);
|
|
2910
2918
|
let { px0: p, py0: m, pw: h, ph: g } = u.plotRect, _ = u.center.cx, v = u.center.cy, y = Math.min(h, g) * .38, b = 0;
|
|
2911
2919
|
for (let e of t.series) for (let t of e.values) b = Math.max(b, t ?? 0);
|
|
2912
2920
|
t.valMax != null && (b = t.valMax), b === 0 && (b = 1);
|
|
@@ -2927,7 +2935,7 @@ function Qn(e, t, n, r) {
|
|
|
2927
2935
|
e.beginPath(), e.moveTo(_, v), e.lineTo(_ + Math.cos(n) * y, v + Math.sin(n) * y), e.stroke();
|
|
2928
2936
|
}
|
|
2929
2937
|
if (!t.valAxisHidden) {
|
|
2930
|
-
e.font = `${
|
|
2938
|
+
e.font = `${Fn(t.valAxisFontSizeHpt, s, r)}px ${X(t, t.valAxisFontFace, "minor")}`, e.fillStyle = "#555", e.textAlign = "right", e.textBaseline = "middle";
|
|
2931
2939
|
for (let t = 1; t <= T; t++) {
|
|
2932
2940
|
let n = E(t), r = n / x * y;
|
|
2933
2941
|
e.fillText(Et(n), _ - 3, v - r);
|
|
@@ -2943,7 +2951,7 @@ function Qn(e, t, n, r) {
|
|
|
2943
2951
|
}
|
|
2944
2952
|
let k = t.radarStyle === "filled", A = Math.max(2, y * .025);
|
|
2945
2953
|
for (let n = 0; n < t.series.length; n++) {
|
|
2946
|
-
let r = t.series[n], i =
|
|
2954
|
+
let r = t.series[n], i = an(n, r), a = [];
|
|
2947
2955
|
for (let e = 0; e < l; e++) {
|
|
2948
2956
|
let t = r.values[e];
|
|
2949
2957
|
if (t == null) {
|
|
@@ -2963,18 +2971,25 @@ function Qn(e, t, n, r) {
|
|
|
2963
2971
|
o ? e.lineTo(t[0], t[1]) : (e.moveTo(t[0], t[1]), o = !0);
|
|
2964
2972
|
}
|
|
2965
2973
|
let s = a.every((e) => e != null);
|
|
2966
|
-
if (k && s ? (e.closePath(), e.fillStyle =
|
|
2974
|
+
if (k && s ? (e.closePath(), e.fillStyle = Xt(i, .25), e.fill()) : s && e.closePath(), e.strokeStyle = i, e.lineWidth = 2, e.stroke(), !k && r.showMarker !== !1) {
|
|
2967
2975
|
e.fillStyle = i;
|
|
2968
2976
|
for (let t of a) t != null && (e.beginPath(), e.arc(t[0], t[1], A, 0, Math.PI * 2), e.fill());
|
|
2969
2977
|
}
|
|
2970
2978
|
}
|
|
2971
|
-
|
|
2979
|
+
Cn(e, t, d, i, a, o, s, p, m, h, g, u.title.bandH + 2);
|
|
2972
2980
|
}
|
|
2973
|
-
function
|
|
2974
|
-
|
|
2981
|
+
function er(e, t, n) {
|
|
2982
|
+
if (n) return t;
|
|
2983
|
+
let r = e[t];
|
|
2984
|
+
if (r == null) return null;
|
|
2985
|
+
let i = parseFloat(r);
|
|
2986
|
+
return Number.isNaN(i) ? null : i;
|
|
2987
|
+
}
|
|
2988
|
+
function tr(e, t, n, r) {
|
|
2989
|
+
let { x: i, y: a, w: o, h: s } = n, c = et(t, s, r), l = c.fontPx, u = c.topPad, d = Fn(t.catAxisFontSizeHpt, s, r), f = Fn(t.valAxisFontSizeHpt, s, r), p = qe(t, o, s, .22), { legRightW: m, legLeftW: h, legTopH: g, legBottomH: _ } = Je(p), v = Ze(t, o, s, r), y = v.catFontPx, b = v.valFontPx, x = v.catBandH, S = v.valBandW;
|
|
2975
2990
|
if (t.title) {
|
|
2976
2991
|
let n = t.titleManualLayout;
|
|
2977
|
-
n && (n.x !== void 0 || n.y !== void 0) ?
|
|
2992
|
+
n && (n.x !== void 0 || n.y !== void 0) ? Hn(e, t, i + n.x * o, a + n.y * s, (n.w ?? .5) * o, l) : Hn(e, t, i, a + u, o, l);
|
|
2978
2993
|
}
|
|
2979
2994
|
let { plotRect: { px0: C, py0: w, pw: T, ph: E } } = nt(t, i, a, o, s, r, {
|
|
2980
2995
|
titleBand: c,
|
|
@@ -2991,17 +3006,28 @@ function $n(e, t, n, r) {
|
|
|
2991
3006
|
t.plotAreaBg && (e.fillStyle = `#${t.plotAreaBg}`, e.fillRect(C, w, T, E));
|
|
2992
3007
|
let D = [], O = [];
|
|
2993
3008
|
for (let e of t.series) {
|
|
2994
|
-
let
|
|
2995
|
-
for (let e of
|
|
3009
|
+
let n = e.categories ?? t.categories;
|
|
3010
|
+
for (let e of n) {
|
|
2996
3011
|
let t = parseFloat(e);
|
|
2997
3012
|
isNaN(t) || D.push(t);
|
|
2998
3013
|
}
|
|
2999
|
-
for (let t of e.values) t != null && O.push(t);
|
|
3000
3014
|
}
|
|
3001
3015
|
let k = D.length === 0;
|
|
3002
3016
|
if (k) {
|
|
3003
3017
|
let e = Math.max(...t.series.map((e) => e.values.length));
|
|
3004
3018
|
for (let t = 0; t < e; t++) D.push(t);
|
|
3019
|
+
for (let e of t.series) for (let t of e.values) t != null && O.push(t);
|
|
3020
|
+
} else {
|
|
3021
|
+
D.length = 0;
|
|
3022
|
+
for (let e of t.series) {
|
|
3023
|
+
let n = e.categories ?? t.categories;
|
|
3024
|
+
for (let t = 0; t < e.values.length; t++) {
|
|
3025
|
+
let r = e.values[t];
|
|
3026
|
+
if (r == null) continue;
|
|
3027
|
+
let i = er(n, t, !1);
|
|
3028
|
+
i != null && (D.push(i), O.push(r));
|
|
3029
|
+
}
|
|
3030
|
+
}
|
|
3005
3031
|
}
|
|
3006
3032
|
let A = Math.min(...D), j = Math.max(...D), M = Math.min(...O), N = Math.max(...O);
|
|
3007
3033
|
A === j && (--A, j += 1), M === N && (--M, N += 1), t.valMin == null ? M > 0 && (M = 0) : M = t.valMin, t.valMax != null && (N = t.valMax);
|
|
@@ -3010,7 +3036,7 @@ function $n(e, t, n, r) {
|
|
|
3010
3036
|
let e = rt(j - A);
|
|
3011
3037
|
e > 0 && (t.catAxisMin ?? (A = Math.floor(A / e) * e), t.catAxisMax ?? (j = Math.ceil(j / e) * e));
|
|
3012
3038
|
}
|
|
3013
|
-
let re = (e) => C + (e - A) / (j - A) * T, P = (e) => w + E - (e - M) / (N - M) * E, F =
|
|
3039
|
+
let re = (e) => C + (e - A) / (j - A) * T, P = (e) => w + E - (e - M) / (N - M) * E, F = En(t, r);
|
|
3014
3040
|
if (!t.valAxisHidden) {
|
|
3015
3041
|
let n = Math.max(8, Math.min(11, E / 20));
|
|
3016
3042
|
e.font = `${t.valAxisFontBold ? "bold " : ""}${n}px ${X(t, t.valAxisFontFace, "minor")}`;
|
|
@@ -3021,14 +3047,14 @@ function $n(e, t, n, r) {
|
|
|
3021
3047
|
let a = P(i);
|
|
3022
3048
|
e.strokeStyle = F.color, e.lineWidth = F.width, e.beginPath(), e.moveTo(C, a), e.lineTo(C + T, a), e.stroke(), e.fillStyle = "#555", e.textAlign = "right", e.textBaseline = "middle", e.fillText(Y(i, t.valAxisFormatCode, t.date1904), C - 4, a);
|
|
3023
3049
|
let o = t.valAxisLineColor ? `#${t.valAxisLineColor}` : void 0;
|
|
3024
|
-
|
|
3050
|
+
wn(e, t.valAxisMajorTickMark, "val", C, a, o, ht(t.valAxisLineWidthEmu, r));
|
|
3025
3051
|
}
|
|
3026
3052
|
}
|
|
3027
3053
|
let I = w + E;
|
|
3028
|
-
if (t.catAxisCrossesAt != null) I =
|
|
3054
|
+
if (t.catAxisCrossesAt != null) I = or(P(t.catAxisCrossesAt), w, w + E);
|
|
3029
3055
|
else {
|
|
3030
3056
|
let e = t.catAxisCrosses ?? "autoZero";
|
|
3031
|
-
e === "autoZero" && M < 0 && N > 0 ? I =
|
|
3057
|
+
e === "autoZero" && M < 0 && N > 0 ? I = or(P(0), w, w + E) : e === "min" ? I = w + E : e === "max" && (I = w);
|
|
3032
3058
|
}
|
|
3033
3059
|
if (!t.catAxisHidden && !t.catAxisLineHidden && (e.save(), e.strokeStyle = t.catAxisLineColor ? `#${t.catAxisLineColor}` : "#888", e.lineWidth = ht(t.catAxisLineWidthEmu, r), e.lineCap = "butt", e.beginPath(), e.moveTo(C, I), e.lineTo(C + T, I), e.stroke(), e.restore()), !t.valAxisHidden && !t.valAxisLineHidden && (e.save(), e.strokeStyle = t.valAxisLineColor ? `#${t.valAxisLineColor}` : "#888", e.lineWidth = ht(t.valAxisLineWidthEmu, r), e.beginPath(), e.moveTo(C, w), e.lineTo(C, w + E), e.stroke(), e.restore()), !t.catAxisHidden) {
|
|
3034
3060
|
let n = Math.max(8, Math.min(11, E / 20));
|
|
@@ -3041,20 +3067,20 @@ function $n(e, t, n, r) {
|
|
|
3041
3067
|
let o = re(a);
|
|
3042
3068
|
e.fillText(Y(a, t.catAxisFormatCode, t.date1904), o, I + 4);
|
|
3043
3069
|
let s = t.catAxisLineColor ? `#${t.catAxisLineColor}` : void 0;
|
|
3044
|
-
|
|
3070
|
+
wn(e, t.catAxisMajorTickMark, "cat", I, o, s, ht(t.catAxisLineWidthEmu, r));
|
|
3045
3071
|
}
|
|
3046
3072
|
}
|
|
3047
3073
|
let L = t.chartType === "bubble", R = L ? "marker" : t.scatterStyle ?? "marker", z = R === "line" || R === "lineMarker" || R === "lineNoMarker", B = R === "smooth" || R === "smoothMarker" || R === "smoothNoMarker", V = R === "lineNoMarker" || R === "smoothNoMarker";
|
|
3048
3074
|
for (let n = 0; n < t.series.length; n++) {
|
|
3049
|
-
let i = t.series[n], a =
|
|
3050
|
-
for (let t of i.errBars ?? [])
|
|
3075
|
+
let i = t.series[n], a = an(n, i), o = i.categories ?? t.categories;
|
|
3076
|
+
for (let t of i.errBars ?? []) rr(e, i, t, o, k, re, P, a);
|
|
3051
3077
|
if ((z || B) && i.lineHidden !== !0) {
|
|
3052
3078
|
let t = [];
|
|
3053
3079
|
for (let e = 0; e < i.values.length; e++) {
|
|
3054
3080
|
let n = i.values[e];
|
|
3055
3081
|
if (n == null) continue;
|
|
3056
|
-
let r =
|
|
3057
|
-
|
|
3082
|
+
let r = er(o, e, k);
|
|
3083
|
+
r != null && t.push({
|
|
3058
3084
|
x: re(r),
|
|
3059
3085
|
y: P(n)
|
|
3060
3086
|
});
|
|
@@ -3077,22 +3103,22 @@ function $n(e, t, n, r) {
|
|
|
3077
3103
|
for (let n = 0; n < i.values.length; n++) {
|
|
3078
3104
|
let s = i.values[n];
|
|
3079
3105
|
if (s == null) continue;
|
|
3080
|
-
let c =
|
|
3081
|
-
if (
|
|
3106
|
+
let c = er(o, n, k);
|
|
3107
|
+
if (c == null) continue;
|
|
3082
3108
|
let l = (i.dataPointOverrides ?? []).find((e) => e.idx === n), u = l?.markerSymbol ?? i.markerSymbol ?? "circle", d = l?.markerSize ?? i.markerSize ?? 5;
|
|
3083
3109
|
if (L && t > 0) {
|
|
3084
3110
|
let e = i.bubbleSizes?.[n];
|
|
3085
3111
|
e != null && e > 0 && (d = Math.sqrt(e) * t * 2 / r);
|
|
3086
3112
|
}
|
|
3087
3113
|
let f = l?.markerFill ?? l?.color ?? i.markerFill ?? a, p = l?.markerLine ?? i.markerLine ?? null;
|
|
3088
|
-
|
|
3114
|
+
nr(e, re(c), P(s), u, d, f, p, r);
|
|
3089
3115
|
}
|
|
3090
3116
|
}
|
|
3091
|
-
|
|
3117
|
+
ir(e, i, o, k, re, P, E, r, t.date1904, X(t, t.dataLabelFontFace, "minor"), t.dataLabelPosition ?? "r");
|
|
3092
3118
|
}
|
|
3093
|
-
|
|
3119
|
+
Cn(e, t, p, i, a, o, s, C, w, T, E, c.bandH + 2), mn(e, t, i, a, o, s, C, w, T, E, h, _, y, b);
|
|
3094
3120
|
}
|
|
3095
|
-
function
|
|
3121
|
+
function nr(e, t, n, r, i, a, o, s) {
|
|
3096
3122
|
let c = Math.max(2, i * s), l = c / 2, u = a.startsWith("#") ? a : `#${a}`, d = o ? o.startsWith("#") ? o : `#${o}` : null;
|
|
3097
3123
|
switch (e.save(), e.fillStyle = u, d && (e.strokeStyle = d, e.lineWidth = 1), r) {
|
|
3098
3124
|
case "square":
|
|
@@ -3132,14 +3158,14 @@ function er(e, t, n, r, i, a, o, s) {
|
|
|
3132
3158
|
}
|
|
3133
3159
|
e.restore();
|
|
3134
3160
|
}
|
|
3135
|
-
function
|
|
3136
|
-
e.save(), e.strokeStyle = n.color ? `#${n.color}` : s, e.lineWidth = n.lineWidthEmu ? Math.max(.5, n.lineWidthEmu / ft) : 1, e.setLineDash(
|
|
3161
|
+
function rr(e, t, n, r, i, a, o, s) {
|
|
3162
|
+
e.save(), e.strokeStyle = n.color ? `#${n.color}` : s, e.lineWidth = n.lineWidthEmu ? Math.max(.5, n.lineWidthEmu / ft) : 1, e.setLineDash(cr(n.dash));
|
|
3137
3163
|
let c = n.barType === "plus" || n.barType === "both", l = n.barType === "minus" || n.barType === "both", u = n.dir === "x", d = e.lineWidth * 1.5;
|
|
3138
3164
|
for (let s = 0; s < t.values.length; s++) {
|
|
3139
3165
|
let f = t.values[s];
|
|
3140
3166
|
if (f == null) continue;
|
|
3141
|
-
let p =
|
|
3142
|
-
if (
|
|
3167
|
+
let p = er(r, s, i);
|
|
3168
|
+
if (p == null) continue;
|
|
3143
3169
|
let m = a(p), h = o(f), g = (t) => {
|
|
3144
3170
|
let r = m, i = h;
|
|
3145
3171
|
u ? r = a(p + t) : i = o(f + t), e.beginPath(), e.moveTo(m, h), e.lineTo(r, i), e.stroke(), n.noEndCap || (e.save(), e.setLineDash([]), e.beginPath(), u ? (e.moveTo(r, i - d), e.lineTo(r, i + d)) : (e.moveTo(r - d, i), e.lineTo(r + d, i)), e.stroke(), e.restore());
|
|
@@ -3155,15 +3181,15 @@ function tr(e, t, n, r, i, a, o, s) {
|
|
|
3155
3181
|
}
|
|
3156
3182
|
e.restore();
|
|
3157
3183
|
}
|
|
3158
|
-
function
|
|
3184
|
+
function ir(e, t, n, r, i, a, o, s, c = !1, l = "sans-serif", u = "r") {
|
|
3159
3185
|
let d = t.dataLabelOverrides ?? [];
|
|
3160
3186
|
if (d.length === 0 && !t.seriesDataLabels) return;
|
|
3161
3187
|
let f = t.seriesDataLabels;
|
|
3162
3188
|
for (let p = 0; p < t.values.length; p++) {
|
|
3163
3189
|
let m = t.values[p];
|
|
3164
3190
|
if (m == null) continue;
|
|
3165
|
-
let h =
|
|
3166
|
-
if (
|
|
3191
|
+
let h = er(n, p, r);
|
|
3192
|
+
if (h == null) continue;
|
|
3167
3193
|
let g = d.find((e) => e.idx === p);
|
|
3168
3194
|
if (g?.deleted) continue;
|
|
3169
3195
|
let _ = g?.showCatName ?? f?.showCatName, v = g?.showSerName ?? f?.showSerName, y = g?.showVal ?? f?.showVal, b;
|
|
@@ -3173,10 +3199,10 @@ function nr(e, t, n, r, i, a, o, s, c = !1, l = "sans-serif", u = "r") {
|
|
|
3173
3199
|
if (_ && !r && e.push(n[p] ?? ""), v && e.push(t.name), y && e.push(Y(m, f?.formatCode ?? null, c)), b = e.filter(Boolean).join(" "), !b) continue;
|
|
3174
3200
|
} else continue;
|
|
3175
3201
|
let x = g?.position ?? f?.position ?? u, S = g?.fontSizeHpt ?? f?.fontSizeHpt, C = S ? S / 100 * s : Math.max(9, Math.min(11, o / 25)), w = g?.fontColor ?? f?.fontColor, T = g?.fontBold ?? f?.fontBold ?? !1;
|
|
3176
|
-
|
|
3202
|
+
ar(e, i(h), a(m), b, x, C, w, T, l);
|
|
3177
3203
|
}
|
|
3178
3204
|
}
|
|
3179
|
-
function
|
|
3205
|
+
function ar(e, t, n, r, i, a, o, s, c = "sans-serif", l = 0) {
|
|
3180
3206
|
e.save(), e.font = `${s ? "bold " : ""}${a}px ${c}`, e.fillStyle = o ? `#${o}` : "#333";
|
|
3181
3207
|
let u = a * .6 + l, d = t, f = n;
|
|
3182
3208
|
switch (i) {
|
|
@@ -3204,17 +3230,17 @@ function rr(e, t, n, r, i, a, o, s, c = "sans-serif", l = 0) {
|
|
|
3204
3230
|
for (let t of p) e.fillText(t, d, g), g += m;
|
|
3205
3231
|
e.restore();
|
|
3206
3232
|
}
|
|
3207
|
-
function
|
|
3233
|
+
function or(e, t, n) {
|
|
3208
3234
|
return e < t ? t : e > n ? n : e;
|
|
3209
3235
|
}
|
|
3210
|
-
function
|
|
3236
|
+
function sr(e, t, n) {
|
|
3211
3237
|
if (t.length !== 0) if (n && t.length >= 3) for (let n = 0; n < t.length - 1; n++) {
|
|
3212
3238
|
let r = t[n - 1] ?? t[n], i = t[n], a = t[n + 1], o = t[n + 2] ?? a, s = i.x + (a.x - r.x) / 6, c = i.y + (a.y - r.y) / 6, l = a.x - (o.x - i.x) / 6, u = a.y - (o.y - i.y) / 6;
|
|
3213
3239
|
e.bezierCurveTo(s, c, l, u, a.x, a.y);
|
|
3214
3240
|
}
|
|
3215
3241
|
else for (let n = 1; n < t.length; n++) e.lineTo(t[n].x, t[n].y);
|
|
3216
3242
|
}
|
|
3217
|
-
function
|
|
3243
|
+
function cr(e) {
|
|
3218
3244
|
if (!e) return [];
|
|
3219
3245
|
switch (e) {
|
|
3220
3246
|
case "solid": return [];
|
|
@@ -3249,13 +3275,13 @@ function or(e) {
|
|
|
3249
3275
|
default: return [];
|
|
3250
3276
|
}
|
|
3251
3277
|
}
|
|
3252
|
-
function
|
|
3278
|
+
function lr(e) {
|
|
3253
3279
|
return e.markerSymbol != null || e.markerSize != null || e.markerFill != null || e.markerLine != null || e.dataPointOverrides != null && e.dataPointOverrides.length > 0;
|
|
3254
3280
|
}
|
|
3255
|
-
function
|
|
3281
|
+
function ur(e, t, n, r, i, a, o, s) {
|
|
3256
3282
|
if (n.dir === "x") return;
|
|
3257
3283
|
let c = n.barType === "plus" || n.barType === "both", l = n.barType === "minus" || n.barType === "both";
|
|
3258
|
-
e.save(), e.strokeStyle = n.color ? `#${n.color}` : s, e.lineWidth = n.lineWidthEmu ? Math.max(.5, n.lineWidthEmu / ft) : 1, e.setLineDash(
|
|
3284
|
+
e.save(), e.strokeStyle = n.color ? `#${n.color}` : s, e.lineWidth = n.lineWidthEmu ? Math.max(.5, n.lineWidthEmu / ft) : 1, e.setLineDash(cr(n.dash));
|
|
3259
3285
|
let u = e.lineWidth * 1.5;
|
|
3260
3286
|
for (let s = 0; s < r; s++) {
|
|
3261
3287
|
if (t.values[s] == null) continue;
|
|
@@ -3274,7 +3300,7 @@ function cr(e, t, n, r, i, a, o, s) {
|
|
|
3274
3300
|
}
|
|
3275
3301
|
e.restore();
|
|
3276
3302
|
}
|
|
3277
|
-
function
|
|
3303
|
+
function dr(e, t, n, r, i, a, o, s, c, l, u, d = "sans-serif", f = "t") {
|
|
3278
3304
|
let p = t.dataLabelOverrides ?? [], m = t.seriesDataLabels;
|
|
3279
3305
|
if (p.length === 0 && !m) return !1;
|
|
3280
3306
|
for (let h = 0; h < r; h++) {
|
|
@@ -3288,11 +3314,11 @@ function lr(e, t, n, r, i, a, o, s, c, l, u, d = "sans-serif", f = "t") {
|
|
|
3288
3314
|
if (_ && e.push(n[h] ?? ""), v && e.push(t.name), y && e.push(Y(r, m?.formatCode ?? null, l)), b = e.filter(Boolean).join(" "), !b) continue;
|
|
3289
3315
|
} else continue;
|
|
3290
3316
|
let x = g?.position ?? m?.position ?? f, S = g?.fontSizeHpt ?? m?.fontSizeHpt, C = S ? S / 100 * c : Math.max(9, Math.min(11, s / 25)), w = g?.fontColor ?? m?.fontColor, T = g?.fontBold ?? m?.fontBold ?? !1;
|
|
3291
|
-
|
|
3317
|
+
ar(e, i(h), a(r), b, x, C, w, T, d);
|
|
3292
3318
|
}
|
|
3293
3319
|
return !0;
|
|
3294
3320
|
}
|
|
3295
|
-
function
|
|
3321
|
+
function fr(e, t, n) {
|
|
3296
3322
|
let { x: r, y: i, w: a, h: o } = n, s = t.plotAreaManualLayout, c, l, u, d;
|
|
3297
3323
|
if (s && s.w != null && s.h != null) c = r + s.x * a, l = i + s.y * o, u = s.w * a, d = s.h * o;
|
|
3298
3324
|
else {
|
|
@@ -3351,7 +3377,7 @@ function ur(e, t, n) {
|
|
|
3351
3377
|
}
|
|
3352
3378
|
e.restore();
|
|
3353
3379
|
}
|
|
3354
|
-
function
|
|
3380
|
+
function pr(e, t, n) {
|
|
3355
3381
|
let r = e.length;
|
|
3356
3382
|
if (r === 0) return 0;
|
|
3357
3383
|
if (r === 1) return e[0];
|
|
@@ -3360,9 +3386,9 @@ function dr(e, t, n) {
|
|
|
3360
3386
|
let a = Math.floor(i), o = i - a;
|
|
3361
3387
|
return a >= r ? e[r - 1] : e[a - 1] + o * (e[a] - e[a - 1]);
|
|
3362
3388
|
}
|
|
3363
|
-
function
|
|
3389
|
+
function mr(e, t) {
|
|
3364
3390
|
if (e.length === 0) return null;
|
|
3365
|
-
let n = [...e].sort((e, t) => e - t), r =
|
|
3391
|
+
let n = [...e].sort((e, t) => e - t), r = pr(n, .25, t), i = pr(n, .5, t), a = pr(n, .75, t), o = a - r, s = r - 1.5 * o, c = a + 1.5 * o, l = [], u = [];
|
|
3366
3392
|
for (let e of n) e < s || e > c ? u.push(e) : l.push(e);
|
|
3367
3393
|
return {
|
|
3368
3394
|
q1: r,
|
|
@@ -3375,10 +3401,10 @@ function fr(e, t) {
|
|
|
3375
3401
|
inner: l
|
|
3376
3402
|
};
|
|
3377
3403
|
}
|
|
3378
|
-
function
|
|
3404
|
+
function hr(e, t, n, r) {
|
|
3379
3405
|
let i = t.chartexBox;
|
|
3380
3406
|
if (!i || i.categories.length === 0 || i.series.length === 0) return;
|
|
3381
|
-
let { x: a, y: o, w: s, h: c } = n, l = et(t, c, r), u =
|
|
3407
|
+
let { x: a, y: o, w: s, h: c } = n, l = et(t, c, r), u = Fn(t.catAxisFontSizeHpt, c, r), d = Fn(t.valAxisFontSizeHpt, c, r), f = nt(t, a, o, s, c, r, {
|
|
3382
3408
|
titleBand: l,
|
|
3383
3409
|
legendSideReserveFrac: 0,
|
|
3384
3410
|
pad: {
|
|
@@ -3388,11 +3414,11 @@ function pr(e, t, n, r) {
|
|
|
3388
3414
|
l: t.valAxisHidden ? s * .02 : s * .1
|
|
3389
3415
|
}
|
|
3390
3416
|
});
|
|
3391
|
-
|
|
3417
|
+
Hn(e, t, a, o + f.title.topPad, s, f.title.fontPx);
|
|
3392
3418
|
let { px0: p, py0: m, pw: h, ph: g } = f.plotRect, _ = i.categories, v = _.length, y = i.series.length, b = Infinity, x = -Infinity;
|
|
3393
3419
|
for (let e of i.series) for (let t of e.valuesByCategory) for (let e of t) e < b && (b = e), e > x && (x = e);
|
|
3394
3420
|
if (!isFinite(b) || !isFinite(x)) return;
|
|
3395
|
-
let { min: S, max: C, step: w } = ct(b, x, t.valMin, t.valMax, g / r, t.valAxisMajorUnit), T = C - S || 1, E = (e) => m + g * (1 - (e - S) / T), D = X(t, t.valAxisFontFace, "minor"), O =
|
|
3421
|
+
let { min: S, max: C, step: w } = ct(b, x, t.valMin, t.valMax, g / r, t.valAxisMajorUnit), T = C - S || 1, E = (e) => m + g * (1 - (e - S) / T), D = X(t, t.valAxisFontFace, "minor"), O = Fn(t.valAxisFontSizeHpt, c, r);
|
|
3396
3422
|
if (e.save(), !t.valAxisHidden) {
|
|
3397
3423
|
e.font = `${O}px ${D}`, e.textAlign = "right", e.textBaseline = "middle";
|
|
3398
3424
|
for (let n = S; n <= C + 1e-6; n += w) {
|
|
@@ -3403,14 +3429,14 @@ function pr(e, t, n, r) {
|
|
|
3403
3429
|
!t.catAxisHidden && !t.catAxisLineHidden && (e.strokeStyle = "#bfbfbf", e.lineWidth = 1, e.beginPath(), e.moveTo(p, m + g), e.lineTo(p + h, m + g), e.stroke());
|
|
3404
3430
|
let k = h / v, A = k / (1 + (t.barGapWidth ?? 150) / 100), j = A * .06, M = (A - j * (y - 1)) / y, N = (e) => {
|
|
3405
3431
|
let n = t.chartexAccents?.[e % (t.chartexAccents?.length ?? 1)];
|
|
3406
|
-
return `#${i.series[e].color ?? n ??
|
|
3407
|
-
}, ee =
|
|
3432
|
+
return `#${i.series[e].color ?? n ?? rn[e % rn.length]}`;
|
|
3433
|
+
}, ee = Fn(t.catAxisFontSizeHpt, c, r);
|
|
3408
3434
|
for (let n = 0; n < v; n++) {
|
|
3409
3435
|
let r = p + k * n + (k - A) / 2;
|
|
3410
3436
|
for (let t = 0; t < y; t++) {
|
|
3411
|
-
let a = i.series[t], o =
|
|
3437
|
+
let a = i.series[t], o = mr(a.valuesByCategory[n] ?? [], a.quartileMethod);
|
|
3412
3438
|
if (!o) continue;
|
|
3413
|
-
let s = r + t * (M + j), c = s + M / 2, l = N(t), u =
|
|
3439
|
+
let s = r + t * (M + j), c = s + M / 2, l = N(t), u = sn(l, .8), d = E(o.q1), f = E(o.q3), p = Math.min(d, f), m = Math.max(1, Math.abs(d - f)), h = M * .4;
|
|
3414
3440
|
e.strokeStyle = u, e.lineWidth = 1, e.beginPath(), e.moveTo(c, E(o.whiskerHi)), e.lineTo(c, f), e.moveTo(c, d), e.lineTo(c, E(o.whiskerLo)), e.moveTo(c - h / 2, E(o.whiskerHi)), e.lineTo(c + h / 2, E(o.whiskerHi)), e.moveTo(c - h / 2, E(o.whiskerLo)), e.lineTo(c + h / 2, E(o.whiskerLo)), e.stroke(), e.fillStyle = l, e.fillRect(s, p, M, m), e.strokeStyle = u, e.lineWidth = .75, e.strokeRect(s + .375, p + .375, M - .75, m - .75);
|
|
3415
3441
|
let g = E(o.median);
|
|
3416
3442
|
if (e.strokeStyle = u, e.lineWidth = 1, e.beginPath(), e.moveTo(s, g), e.lineTo(s + M, g), e.stroke(), a.meanMarker) {
|
|
@@ -3431,7 +3457,7 @@ function pr(e, t, n, r) {
|
|
|
3431
3457
|
}
|
|
3432
3458
|
e.restore();
|
|
3433
3459
|
}
|
|
3434
|
-
function
|
|
3460
|
+
function gr(e) {
|
|
3435
3461
|
let t = {
|
|
3436
3462
|
label: "",
|
|
3437
3463
|
value: 0,
|
|
@@ -3458,19 +3484,19 @@ function mr(e) {
|
|
|
3458
3484
|
}
|
|
3459
3485
|
return t.value = t.children.reduce((e, t) => e + t.value, 0), t;
|
|
3460
3486
|
}
|
|
3461
|
-
function
|
|
3487
|
+
function _r(e) {
|
|
3462
3488
|
let t = e.children.reduce((e, t) => e + t.value, 0);
|
|
3463
3489
|
if (t <= 0) return;
|
|
3464
3490
|
let n = e.a0;
|
|
3465
3491
|
for (let r of e.children) {
|
|
3466
3492
|
let i = (e.a1 - e.a0) * r.value / t;
|
|
3467
|
-
r.a0 = n, r.a1 = n + i, n = r.a1,
|
|
3493
|
+
r.a0 = n, r.a1 = n + i, n = r.a1, _r(r);
|
|
3468
3494
|
}
|
|
3469
3495
|
}
|
|
3470
|
-
function
|
|
3471
|
-
return e.children.length === 0 ? e.depth : Math.max(...e.children.map(
|
|
3496
|
+
function vr(e) {
|
|
3497
|
+
return e.children.length === 0 ? e.depth : Math.max(...e.children.map(vr));
|
|
3472
3498
|
}
|
|
3473
|
-
function
|
|
3499
|
+
function yr(e, t, n, r) {
|
|
3474
3500
|
let i = t.chartexSunburst;
|
|
3475
3501
|
if (!i || i.rows.length === 0) return;
|
|
3476
3502
|
let { x: a, y: o, w: s, h: c } = n, l = nt(t, a, o, s, c, r, {
|
|
@@ -3479,11 +3505,11 @@ function _r(e, t, n, r) {
|
|
|
3479
3505
|
legendSideReserveFrac: 0,
|
|
3480
3506
|
radialGapFrac: .02
|
|
3481
3507
|
});
|
|
3482
|
-
|
|
3483
|
-
let { px0: u, py0: d, pw: f, ph: p } = l.plotRect, m = u + f / 2, h = d + p / 2, g = Math.min(f, p) * .46, _ =
|
|
3508
|
+
Hn(e, t, a, o + l.title.topPad, s, l.title.fontPx);
|
|
3509
|
+
let { px0: u, py0: d, pw: f, ph: p } = l.plotRect, m = u + f / 2, h = d + p / 2, g = Math.min(f, p) * .46, _ = gr(i.rows);
|
|
3484
3510
|
if (_.value <= 0 || _.children.length === 0) return;
|
|
3485
|
-
_.a0 = -Math.PI / 2, _.a1 = -Math.PI / 2 + Math.PI * 2,
|
|
3486
|
-
let v =
|
|
3511
|
+
_.a0 = -Math.PI / 2, _.a1 = -Math.PI / 2 + Math.PI * 2, _r(_);
|
|
3512
|
+
let v = vr(_) + 1, y = g * .18, b = (g - y) / v, x = t.chartexAccents, S = (e) => `#${x?.[e % x.length] ?? rn[e % rn.length]}`, C = X(t, t.dataLabelFontFace, "minor"), w = Math.max(7, Math.min(13, g * .075)), T = Array.from({ length: v }, () => []), E = (e) => {
|
|
3487
3513
|
e.depth >= 0 && T[e.depth].push(e), e.children.forEach(E);
|
|
3488
3514
|
};
|
|
3489
3515
|
E(_), e.save();
|
|
@@ -3512,7 +3538,7 @@ function _r(e, t, n, r) {
|
|
|
3512
3538
|
}
|
|
3513
3539
|
e.restore();
|
|
3514
3540
|
}
|
|
3515
|
-
function
|
|
3541
|
+
function br(e, t, n, r = mt) {
|
|
3516
3542
|
e.save();
|
|
3517
3543
|
try {
|
|
3518
3544
|
let { x: i, y: a, w: o, h: s } = n;
|
|
@@ -3533,42 +3559,42 @@ function vr(e, t, n, r = mt) {
|
|
|
3533
3559
|
case "stackedBarH":
|
|
3534
3560
|
case "stackedBarPct":
|
|
3535
3561
|
case "stackedBarHPct":
|
|
3536
|
-
|
|
3562
|
+
Gn(e, t, n, r);
|
|
3537
3563
|
break;
|
|
3538
3564
|
case "line":
|
|
3539
3565
|
case "stackedLine":
|
|
3540
3566
|
case "stackedLinePct":
|
|
3541
|
-
|
|
3567
|
+
Kn(e, t, n, r);
|
|
3542
3568
|
break;
|
|
3543
3569
|
case "area":
|
|
3544
3570
|
case "stackedArea":
|
|
3545
3571
|
case "stackedAreaPct":
|
|
3546
|
-
|
|
3572
|
+
Jn(e, t, n, r);
|
|
3547
3573
|
break;
|
|
3548
3574
|
case "pie":
|
|
3549
|
-
|
|
3575
|
+
Xn(e, t, n, !1, r);
|
|
3550
3576
|
break;
|
|
3551
3577
|
case "doughnut":
|
|
3552
|
-
|
|
3578
|
+
Xn(e, t, n, !0, r);
|
|
3553
3579
|
break;
|
|
3554
3580
|
case "radar":
|
|
3555
|
-
|
|
3581
|
+
$n(e, t, n, r);
|
|
3556
3582
|
break;
|
|
3557
3583
|
case "scatter":
|
|
3558
3584
|
case "bubble":
|
|
3559
|
-
|
|
3585
|
+
tr(e, t, n, r);
|
|
3560
3586
|
break;
|
|
3561
3587
|
case "waterfall":
|
|
3562
|
-
|
|
3588
|
+
fr(e, t, n);
|
|
3563
3589
|
break;
|
|
3564
3590
|
case "stock":
|
|
3565
|
-
|
|
3591
|
+
qn(e, t, n, r);
|
|
3566
3592
|
break;
|
|
3567
3593
|
case "boxWhisker":
|
|
3568
|
-
|
|
3594
|
+
hr(e, t, n, r);
|
|
3569
3595
|
break;
|
|
3570
3596
|
case "sunburst":
|
|
3571
|
-
|
|
3597
|
+
yr(e, t, n, r);
|
|
3572
3598
|
break;
|
|
3573
3599
|
default: e.fillStyle = "#888", e.font = "11px sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillText(`Chart: ${t.chartType}`, i + o / 2, a + s / 2);
|
|
3574
3600
|
}
|
|
@@ -3578,7 +3604,7 @@ function vr(e, t, n, r = mt) {
|
|
|
3578
3604
|
}
|
|
3579
3605
|
//#endregion
|
|
3580
3606
|
//#region packages/core/src/autoResize.ts
|
|
3581
|
-
function
|
|
3607
|
+
function xr(e, t, n = {}) {
|
|
3582
3608
|
let r = n.pauseWhenHidden ?? !0, i = null, a = 0, o = 0, s = null, c = !1, l = !1, u = () => {
|
|
3583
3609
|
if (!l && !(r && typeof document < "u" && document.hidden)) {
|
|
3584
3610
|
if (s) {
|
|
@@ -3613,7 +3639,7 @@ function yr(e, t, n = {}) {
|
|
|
3613
3639
|
l = !0, f.disconnect(), i !== null && (cancelAnimationFrame(i), i = null), r && typeof document < "u" && document.removeEventListener("visibilitychange", p);
|
|
3614
3640
|
};
|
|
3615
3641
|
}
|
|
3616
|
-
var
|
|
3642
|
+
var Sr = {
|
|
3617
3643
|
accentbordercallout1: {
|
|
3618
3644
|
adj: [
|
|
3619
3645
|
["adj1", "val 18750"],
|
|
@@ -25476,15 +25502,15 @@ var br = {
|
|
|
25476
25502
|
]
|
|
25477
25503
|
}]
|
|
25478
25504
|
}
|
|
25479
|
-
},
|
|
25480
|
-
function
|
|
25505
|
+
}, Cr = 216e5, wr = Math.PI * 2 / Cr;
|
|
25506
|
+
function Tr(e) {
|
|
25481
25507
|
let t = e.trim().split(/\s+/);
|
|
25482
25508
|
return {
|
|
25483
25509
|
op: t[0],
|
|
25484
25510
|
argTokens: t.slice(1)
|
|
25485
25511
|
};
|
|
25486
25512
|
}
|
|
25487
|
-
function
|
|
25513
|
+
function Er(e, t, n) {
|
|
25488
25514
|
let { w: r, h: i, adj: a } = e, o = Math.min(r, i), s = Math.max(r, i), c = Object.create(null);
|
|
25489
25515
|
Object.assign(c, {
|
|
25490
25516
|
w: r,
|
|
@@ -25529,14 +25555,14 @@ function wr(e, t, n) {
|
|
|
25529
25555
|
lsd8: s / 8,
|
|
25530
25556
|
lsd16: s / 16,
|
|
25531
25557
|
lsd32: s / 32,
|
|
25532
|
-
cd:
|
|
25533
|
-
cd2:
|
|
25534
|
-
cd4:
|
|
25535
|
-
cd8:
|
|
25536
|
-
"3cd4": 3 *
|
|
25537
|
-
"3cd8": 3 *
|
|
25538
|
-
"5cd8": 5 *
|
|
25539
|
-
"7cd8": 7 *
|
|
25558
|
+
cd: Cr,
|
|
25559
|
+
cd2: Cr / 2,
|
|
25560
|
+
cd4: Cr / 4,
|
|
25561
|
+
cd8: Cr / 8,
|
|
25562
|
+
"3cd4": 3 * Cr / 4,
|
|
25563
|
+
"3cd8": 3 * Cr / 8,
|
|
25564
|
+
"5cd8": 5 * Cr / 8,
|
|
25565
|
+
"7cd8": 7 * Cr / 8
|
|
25540
25566
|
}), t.forEach(([e, t], n) => {
|
|
25541
25567
|
let r = a[n];
|
|
25542
25568
|
c[e] = typeof r == "number" ? r : u(t), e === "adj" && (c.adj1 = c.adj), e === "adj1" && (c.adj = c.adj1);
|
|
@@ -25573,10 +25599,10 @@ function wr(e, t, n) {
|
|
|
25573
25599
|
case "pin": return t[1] < t[0] ? t[0] : t[1] > t[2] ? t[2] : t[1];
|
|
25574
25600
|
case "sqrt": return Math.sqrt(Math.max(0, t[0]));
|
|
25575
25601
|
case "mod": return Math.sqrt(t[0] * t[0] + t[1] * t[1] + t[2] * t[2]);
|
|
25576
|
-
case "sin": return t[0] * Math.sin(t[1] *
|
|
25577
|
-
case "cos": return t[0] * Math.cos(t[1] *
|
|
25578
|
-
case "tan": return t[0] * Math.tan(t[1] *
|
|
25579
|
-
case "at2": return Math.atan2(t[1], t[0]) /
|
|
25602
|
+
case "sin": return t[0] * Math.sin(t[1] * wr);
|
|
25603
|
+
case "cos": return t[0] * Math.cos(t[1] * wr);
|
|
25604
|
+
case "tan": return t[0] * Math.tan(t[1] * wr);
|
|
25605
|
+
case "at2": return Math.atan2(t[1], t[0]) / wr;
|
|
25580
25606
|
case "cat2": return t[0] * Math.cos(Math.atan2(t[2], t[1]));
|
|
25581
25607
|
case "sat2": return t[0] * Math.sin(Math.atan2(t[2], t[1]));
|
|
25582
25608
|
default: throw Error(`preset-shape: unknown operator "${e}" in "${[n.op, ...n.argTokens].join(" ")}"`);
|
|
@@ -25585,8 +25611,8 @@ function wr(e, t, n) {
|
|
|
25585
25611
|
}
|
|
25586
25612
|
//#endregion
|
|
25587
25613
|
//#region packages/core/src/shape/preset-geometry/path-executor.ts
|
|
25588
|
-
var
|
|
25589
|
-
function
|
|
25614
|
+
var Dr = Math.PI * 2 / 216e5;
|
|
25615
|
+
function Or(e, t, n, r, i, a, o) {
|
|
25590
25616
|
let s = t.w == null ? 1 : a / t.w, c = t.h == null ? 1 : o / t.h, l = (e) => r + e * s, u = (e) => i + e * c, d = 0, f = 0;
|
|
25591
25617
|
for (let r of t.cmds) switch (r[0]) {
|
|
25592
25618
|
case "m": {
|
|
@@ -25610,7 +25636,7 @@ function Er(e, t, n, r, i, a, o) {
|
|
|
25610
25636
|
break;
|
|
25611
25637
|
}
|
|
25612
25638
|
case "a": {
|
|
25613
|
-
let t = n.resolve(r[1]), i = n.resolve(r[2]), a = t * s, o = i * c, l = n.resolve(r[3]) *
|
|
25639
|
+
let t = n.resolve(r[1]), i = n.resolve(r[2]), a = t * s, o = i * c, l = n.resolve(r[3]) * Dr, u = n.resolve(r[4]) * Dr, p = Math.PI * 2, m = (e) => Math.atan2(t * Math.sin(e), i * Math.cos(e)), h = m(l), g = Math.trunc(u / p), _ = u - g * p, v = m(l + _) - h;
|
|
25614
25640
|
_ > 0 && v < 0 ? v += p : _ < 0 && v > 0 && (v -= p);
|
|
25615
25641
|
let y = h + v + g * p, b = d - a * Math.cos(h), x = f - o * Math.sin(h);
|
|
25616
25642
|
Math.abs(a) > 1e-6 && Math.abs(o) > 1e-6 && (e.ellipse(b, x, Math.abs(a), Math.abs(o), 0, h, y, u < 0), d = b + a * Math.cos(y), f = x + o * Math.sin(y));
|
|
@@ -25623,37 +25649,37 @@ function Er(e, t, n, r, i, a, o) {
|
|
|
25623
25649
|
}
|
|
25624
25650
|
//#endregion
|
|
25625
25651
|
//#region packages/core/src/shape/preset-geometry/index.ts
|
|
25626
|
-
var
|
|
25627
|
-
function
|
|
25628
|
-
let t =
|
|
25652
|
+
var kr = Sr, Ar = /* @__PURE__ */ new WeakMap();
|
|
25653
|
+
function jr(e) {
|
|
25654
|
+
let t = Ar.get(e);
|
|
25629
25655
|
return t || (t = {
|
|
25630
|
-
adj: e.adj.map(([e, t]) => [e,
|
|
25631
|
-
gd: e.gd.map(([e, t]) => [e,
|
|
25632
|
-
},
|
|
25656
|
+
adj: e.adj.map(([e, t]) => [e, Tr(t)]),
|
|
25657
|
+
gd: e.gd.map(([e, t]) => [e, Tr(t)])
|
|
25658
|
+
}, Ar.set(e, t)), t;
|
|
25633
25659
|
}
|
|
25634
|
-
function
|
|
25635
|
-
let i =
|
|
25636
|
-
return
|
|
25660
|
+
function Mr(e, t, n, r) {
|
|
25661
|
+
let i = jr(e);
|
|
25662
|
+
return Er({
|
|
25637
25663
|
w: t,
|
|
25638
25664
|
h: n,
|
|
25639
25665
|
adj: r
|
|
25640
25666
|
}, i.adj, i.gd);
|
|
25641
25667
|
}
|
|
25642
|
-
function
|
|
25643
|
-
return e.toLowerCase() in
|
|
25668
|
+
function Nr(e) {
|
|
25669
|
+
return e.toLowerCase() in kr;
|
|
25644
25670
|
}
|
|
25645
|
-
function
|
|
25646
|
-
let s =
|
|
25671
|
+
function Pr(e, t, n, r, i, a, o = []) {
|
|
25672
|
+
let s = kr[t.toLowerCase()];
|
|
25647
25673
|
if (!s) return !1;
|
|
25648
|
-
let c =
|
|
25649
|
-
for (let t of s.paths)
|
|
25674
|
+
let c = Mr(s, i, a, o);
|
|
25675
|
+
for (let t of s.paths) Or(e, t, c, n, r, i, a);
|
|
25650
25676
|
return !0;
|
|
25651
25677
|
}
|
|
25652
|
-
var
|
|
25678
|
+
var Fr = {
|
|
25653
25679
|
wedgeroundrectcallout: "roundrect",
|
|
25654
25680
|
wedgeellipsecallout: "ellipse",
|
|
25655
25681
|
wedgerectcallout: null
|
|
25656
|
-
},
|
|
25682
|
+
}, Ir = {
|
|
25657
25683
|
adj: [],
|
|
25658
25684
|
gd: [],
|
|
25659
25685
|
paths: [{
|
|
@@ -25687,30 +25713,30 @@ var Nr = {
|
|
|
25687
25713
|
]
|
|
25688
25714
|
}]
|
|
25689
25715
|
};
|
|
25690
|
-
function
|
|
25716
|
+
function Lr(e, t, n) {
|
|
25691
25717
|
let r = e[n];
|
|
25692
25718
|
if (typeof r == "number") return r;
|
|
25693
25719
|
let i = t.adj[n];
|
|
25694
25720
|
return i && Number(i[1].replace(/^val\s+/, "")) || 0;
|
|
25695
25721
|
}
|
|
25696
|
-
function
|
|
25697
|
-
let d = t.toLowerCase(), f =
|
|
25722
|
+
function Rr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
25723
|
+
let d = t.toLowerCase(), f = kr[d];
|
|
25698
25724
|
if (!f) return !1;
|
|
25699
|
-
if (d in
|
|
25700
|
-
let e =
|
|
25725
|
+
if (d in Fr) {
|
|
25726
|
+
let e = Lr(o, f, 0), t = Lr(o, f, 1), n = i / 2 + i * e / 1e5, r = a / 2 + a * t / 1e5;
|
|
25701
25727
|
if (n >= 0 && n <= i && r >= 0 && r <= a) {
|
|
25702
|
-
let e =
|
|
25703
|
-
e === "roundrect" ? (f =
|
|
25728
|
+
let e = Fr[d];
|
|
25729
|
+
e === "roundrect" ? (f = kr.roundrect, o = [Lr(o, kr[d], 2)]) : e && kr[e] ? (f = kr[e], o = []) : (f = Ir, o = []);
|
|
25704
25730
|
}
|
|
25705
25731
|
}
|
|
25706
|
-
let p =
|
|
25732
|
+
let p = Mr(f, i, a, o), m = !1, h = f.paths.length - 1;
|
|
25707
25733
|
for (let t = 0; t < f.paths.length; t++) {
|
|
25708
25734
|
let o = f.paths[t];
|
|
25709
|
-
e.beginPath(),
|
|
25735
|
+
e.beginPath(), Or(e, o, p, n, r, i, a);
|
|
25710
25736
|
let d = o.fill;
|
|
25711
25737
|
if (d !== "none" && s != null) {
|
|
25712
25738
|
e.save(), e.fillStyle = s, e.fill();
|
|
25713
|
-
let t =
|
|
25739
|
+
let t = Br(d);
|
|
25714
25740
|
t && (e.fillStyle = t, e.fill()), e.restore(), m ||= (l(), !0);
|
|
25715
25741
|
}
|
|
25716
25742
|
if (o.stroke && c) {
|
|
@@ -25720,10 +25746,10 @@ function Ir(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
25720
25746
|
}
|
|
25721
25747
|
return !0;
|
|
25722
25748
|
}
|
|
25723
|
-
function
|
|
25724
|
-
let o =
|
|
25749
|
+
function zr(e, t, n, r, i, a) {
|
|
25750
|
+
let o = kr[e.toLowerCase()];
|
|
25725
25751
|
if (!o || o.paths.length === 0) return null;
|
|
25726
|
-
let s = o.paths[o.paths.length - 1], c =
|
|
25752
|
+
let s = o.paths[o.paths.length - 1], c = Mr(o, r, i, a), l = s.w == null ? 1 : r / s.w, u = s.h == null ? 1 : i / s.h, d = (e) => t + e * l, f = (e) => n + e * u, p = 0, m = 0, h = 0, g = 0, _ = 0, v = 0, y = !1, b = 0, x = 0, S = [];
|
|
25727
25753
|
for (let e of s.cmds) switch (e[0]) {
|
|
25728
25754
|
case "m":
|
|
25729
25755
|
h = d(c.resolve(e[1])), g = f(c.resolve(e[2])), p = h, m = g, S.push({
|
|
@@ -25763,7 +25789,7 @@ function Lr(e, t, n, r, i, a) {
|
|
|
25763
25789
|
vertices: S
|
|
25764
25790
|
};
|
|
25765
25791
|
}
|
|
25766
|
-
function
|
|
25792
|
+
function Br(e) {
|
|
25767
25793
|
switch (e) {
|
|
25768
25794
|
case "lighten": return "rgba(255,255,255,0.30)";
|
|
25769
25795
|
case "lightenLess": return "rgba(255,255,255,0.15)";
|
|
@@ -25774,21 +25800,21 @@ function Rr(e) {
|
|
|
25774
25800
|
}
|
|
25775
25801
|
//#endregion
|
|
25776
25802
|
//#region packages/core/src/image/svg-image-by-path.ts
|
|
25777
|
-
var
|
|
25778
|
-
function
|
|
25779
|
-
let t =
|
|
25803
|
+
var Vr = /* @__PURE__ */ new WeakMap(), Hr = 256;
|
|
25804
|
+
function Ur(e) {
|
|
25805
|
+
let t = Vr.get(e);
|
|
25780
25806
|
return t || (t = {
|
|
25781
25807
|
imgs: /* @__PURE__ */ new Map(),
|
|
25782
25808
|
urls: /* @__PURE__ */ new Map()
|
|
25783
|
-
},
|
|
25809
|
+
}, Vr.set(e, t)), t;
|
|
25784
25810
|
}
|
|
25785
|
-
function
|
|
25811
|
+
function Wr(e, t) {
|
|
25786
25812
|
e.imgs.delete(t);
|
|
25787
25813
|
let n = e.urls.get(t);
|
|
25788
25814
|
n && (URL.revokeObjectURL(n), e.urls.delete(t));
|
|
25789
25815
|
}
|
|
25790
|
-
function
|
|
25791
|
-
let n =
|
|
25816
|
+
function Gr(e, t) {
|
|
25817
|
+
let n = Ur(t), r = n.imgs.get(e);
|
|
25792
25818
|
if (r) return n.imgs.delete(e), n.imgs.set(e, r), r;
|
|
25793
25819
|
let i = (async () => {
|
|
25794
25820
|
let r = await t(e, "image/svg+xml"), i = URL.createObjectURL(r);
|
|
@@ -25800,30 +25826,30 @@ function Ur(e, t) {
|
|
|
25800
25826
|
}, a.onerror = () => n(/* @__PURE__ */ Error(`svg load failed: ${e}`)), a.src = i;
|
|
25801
25827
|
}), a;
|
|
25802
25828
|
})();
|
|
25803
|
-
if (i.catch(() =>
|
|
25829
|
+
if (i.catch(() => Wr(n, e)), n.imgs.set(e, i), n.imgs.size > Hr) {
|
|
25804
25830
|
let e = n.imgs.keys().next().value;
|
|
25805
|
-
|
|
25831
|
+
Wr(n, e);
|
|
25806
25832
|
}
|
|
25807
25833
|
return i;
|
|
25808
25834
|
}
|
|
25809
|
-
function
|
|
25810
|
-
let t =
|
|
25835
|
+
function Kr(e) {
|
|
25836
|
+
let t = Vr.get(e);
|
|
25811
25837
|
if (t) {
|
|
25812
25838
|
for (let e of t.urls.values()) URL.revokeObjectURL(e);
|
|
25813
|
-
t.urls.clear(), t.imgs.clear(),
|
|
25839
|
+
t.urls.clear(), t.imgs.clear(), Vr.delete(e);
|
|
25814
25840
|
}
|
|
25815
25841
|
}
|
|
25816
25842
|
//#endregion
|
|
25817
25843
|
//#region packages/core/src/image/pixel-budget.ts
|
|
25818
|
-
var
|
|
25819
|
-
function
|
|
25844
|
+
var qr = 32767, Jr = 1 << 26, Yr = qr, Xr = Jr;
|
|
25845
|
+
function Zr(e, t, n, r, i) {
|
|
25820
25846
|
if (n < 40 || t + 40 > e.byteLength) return null;
|
|
25821
25847
|
let a = e.getUint32(t, !0);
|
|
25822
25848
|
if (a < 40) return null;
|
|
25823
25849
|
let o = e.getInt32(t + 4, !0), s = e.getInt32(t + 8, !0), c = e.getUint16(t + 14, !0);
|
|
25824
25850
|
if (e.getUint32(t + 16, !0) !== 0) return null;
|
|
25825
25851
|
let l = s < 0, u = Math.abs(o), d = Math.abs(s);
|
|
25826
|
-
if (u <= 0 || d <= 0 || u >
|
|
25852
|
+
if (u <= 0 || d <= 0 || u > Yr || d > Yr || u * d > Xr) return null;
|
|
25827
25853
|
let f = new Uint8ClampedArray(u * d * 4), p = u * c + 31 >> 5 << 2 >>> 0;
|
|
25828
25854
|
if (r + p * d > r + i + p && r + p * d > e.byteLength) return null;
|
|
25829
25855
|
let m = null;
|
|
@@ -25883,7 +25909,7 @@ function Yr(e, t, n, r, i) {
|
|
|
25883
25909
|
data: f
|
|
25884
25910
|
};
|
|
25885
25911
|
}
|
|
25886
|
-
function
|
|
25912
|
+
function Qr(e, t, n) {
|
|
25887
25913
|
if (n < 40 || t + 40 > e.byteLength) return null;
|
|
25888
25914
|
let r = e.getUint32(t, !0);
|
|
25889
25915
|
if (r < 40) return null;
|
|
@@ -25893,9 +25919,9 @@ function Xr(e, t, n) {
|
|
|
25893
25919
|
n === 0 && (n = 1 << i), a = n;
|
|
25894
25920
|
} else a = e.getUint32(t + 32, !0);
|
|
25895
25921
|
let o = r + a * 4, s = t + o, c = n - o;
|
|
25896
|
-
return c <= 0 ? null :
|
|
25922
|
+
return c <= 0 ? null : Zr(e, t, o, s, c);
|
|
25897
25923
|
}
|
|
25898
|
-
function
|
|
25924
|
+
function $r(e, t, n, r, i, a) {
|
|
25899
25925
|
try {
|
|
25900
25926
|
let o = It(t.width, t.height);
|
|
25901
25927
|
if (!o) return !1;
|
|
@@ -25962,7 +25988,7 @@ var Z = {
|
|
|
25962
25988
|
EXTCREATEPEN: 95,
|
|
25963
25989
|
BITBLT: 76,
|
|
25964
25990
|
STRETCHDIBITS: 81
|
|
25965
|
-
},
|
|
25991
|
+
}, ei = {
|
|
25966
25992
|
WHITE_BRUSH: 2147483648,
|
|
25967
25993
|
LTGRAY_BRUSH: 2147483649,
|
|
25968
25994
|
GRAY_BRUSH: 2147483650,
|
|
@@ -25974,7 +26000,7 @@ var Z = {
|
|
|
25974
26000
|
NULL_PEN: 2147483656,
|
|
25975
26001
|
DC_BRUSH: 2147483666,
|
|
25976
26002
|
DC_PEN: 2147483662
|
|
25977
|
-
},
|
|
26003
|
+
}, ti = {
|
|
25978
26004
|
TEXT: 1,
|
|
25979
26005
|
LOMETRIC: 2,
|
|
25980
26006
|
HIMETRIC: 3,
|
|
@@ -25983,7 +26009,7 @@ var Z = {
|
|
|
25983
26009
|
TWIPS: 6,
|
|
25984
26010
|
ISOTROPIC: 7,
|
|
25985
26011
|
ANISOTROPIC: 8
|
|
25986
|
-
},
|
|
26012
|
+
}, ni = () => ({
|
|
25987
26013
|
m11: 1,
|
|
25988
26014
|
m12: 0,
|
|
25989
26015
|
m21: 0,
|
|
@@ -25991,7 +26017,7 @@ var Z = {
|
|
|
25991
26017
|
dx: 0,
|
|
25992
26018
|
dy: 0
|
|
25993
26019
|
});
|
|
25994
|
-
function
|
|
26020
|
+
function ri(e, t) {
|
|
25995
26021
|
return {
|
|
25996
26022
|
m11: e.m11 * t.m11 + e.m21 * t.m12,
|
|
25997
26023
|
m12: e.m12 * t.m11 + e.m22 * t.m12,
|
|
@@ -26001,7 +26027,7 @@ function ti(e, t) {
|
|
|
26001
26027
|
dy: e.m12 * t.dx + e.m22 * t.dy + e.dy
|
|
26002
26028
|
};
|
|
26003
26029
|
}
|
|
26004
|
-
var
|
|
26030
|
+
var ii = class {
|
|
26005
26031
|
p;
|
|
26006
26032
|
constructor(e, t, n) {
|
|
26007
26033
|
this.dv = e, this.end = n, this.p = t;
|
|
@@ -26045,137 +26071,137 @@ var ni = class {
|
|
|
26045
26071
|
this.p += e;
|
|
26046
26072
|
}
|
|
26047
26073
|
};
|
|
26048
|
-
function
|
|
26074
|
+
function ai(e, t, n) {
|
|
26049
26075
|
return e.wt.m11 * t + e.wt.m21 * n + e.wt.dx;
|
|
26050
26076
|
}
|
|
26051
|
-
function
|
|
26077
|
+
function oi(e, t, n) {
|
|
26052
26078
|
return e.wt.m12 * t + e.wt.m22 * n + e.wt.dy;
|
|
26053
26079
|
}
|
|
26054
|
-
function
|
|
26080
|
+
function si(e) {
|
|
26055
26081
|
return e.winExtX === 0 ? 1 : e.vpExtX / e.winExtX;
|
|
26056
26082
|
}
|
|
26057
|
-
function
|
|
26083
|
+
function ci(e) {
|
|
26058
26084
|
return e.winExtY === 0 ? 1 : e.vpExtY / e.winExtY;
|
|
26059
26085
|
}
|
|
26060
|
-
function
|
|
26061
|
-
return Math.min(Math.abs(
|
|
26086
|
+
function li(e) {
|
|
26087
|
+
return Math.min(Math.abs(si(e)), Math.abs(ci(e)));
|
|
26062
26088
|
}
|
|
26063
|
-
function
|
|
26064
|
-
return e.mapMode ===
|
|
26089
|
+
function ui(e) {
|
|
26090
|
+
return e.mapMode === ti.ISOTROPIC ? si(e) < 0 ? -li(e) : li(e) : si(e);
|
|
26065
26091
|
}
|
|
26066
|
-
function
|
|
26067
|
-
return e.mapMode ===
|
|
26092
|
+
function di(e) {
|
|
26093
|
+
return e.mapMode === ti.ISOTROPIC ? ci(e) < 0 ? -li(e) : li(e) : ci(e);
|
|
26068
26094
|
}
|
|
26069
|
-
function
|
|
26070
|
-
return (t - e.winOrgX) *
|
|
26095
|
+
function fi(e, t) {
|
|
26096
|
+
return (t - e.winOrgX) * ui(e) + e.vpOrgX;
|
|
26071
26097
|
}
|
|
26072
|
-
function
|
|
26073
|
-
return (t - e.winOrgY) *
|
|
26098
|
+
function pi(e, t) {
|
|
26099
|
+
return (t - e.winOrgY) * di(e) + e.vpOrgY;
|
|
26074
26100
|
}
|
|
26075
26101
|
function Q(e, t, n) {
|
|
26076
|
-
let r =
|
|
26102
|
+
let r = fi(e, ai(e, t, n)), i = pi(e, oi(e, t, n));
|
|
26077
26103
|
return [(r - e.left) * e.W / e.boundsW, (i - e.top) * e.H / e.boundsH];
|
|
26078
26104
|
}
|
|
26079
|
-
function
|
|
26105
|
+
function mi(e) {
|
|
26080
26106
|
return (Math.hypot(e.wt.m11, e.wt.m12) + Math.hypot(e.wt.m21, e.wt.m22)) / 2;
|
|
26081
26107
|
}
|
|
26082
|
-
function
|
|
26083
|
-
return (Math.abs(
|
|
26108
|
+
function hi(e) {
|
|
26109
|
+
return (Math.abs(ui(e)) + Math.abs(di(e))) / 2;
|
|
26084
26110
|
}
|
|
26085
|
-
function
|
|
26111
|
+
function gi(e) {
|
|
26086
26112
|
return (e.W / e.boundsW + e.H / e.boundsH) / 2;
|
|
26087
26113
|
}
|
|
26088
|
-
function
|
|
26114
|
+
function _i(e) {
|
|
26089
26115
|
return Math.hypot(e.wt.m21, e.wt.m22);
|
|
26090
26116
|
}
|
|
26091
|
-
function
|
|
26117
|
+
function vi(e) {
|
|
26092
26118
|
return e.H / e.boundsH;
|
|
26093
26119
|
}
|
|
26094
|
-
function
|
|
26095
|
-
let n = t *
|
|
26120
|
+
function yi(e, t) {
|
|
26121
|
+
let n = t * mi(e) * hi(e) * gi(e);
|
|
26096
26122
|
return Math.max(.75, n);
|
|
26097
26123
|
}
|
|
26098
|
-
function
|
|
26099
|
-
if (e.mapMode = t, t ===
|
|
26124
|
+
function bi(e, t) {
|
|
26125
|
+
if (e.mapMode = t, t === ti.TEXT) {
|
|
26100
26126
|
e.winOrgX = 0, e.winOrgY = 0, e.vpOrgX = 0, e.vpOrgY = 0, e.winExtX = 1, e.winExtY = 1, e.vpExtX = 1, e.vpExtY = 1;
|
|
26101
26127
|
return;
|
|
26102
26128
|
}
|
|
26103
|
-
if (t ===
|
|
26104
|
-
let n = 25.4, r = t ===
|
|
26129
|
+
if (t === ti.ANISOTROPIC || t === ti.ISOTROPIC || e.devPxPerMmX <= 0 || e.devPxPerMmY <= 0) return;
|
|
26130
|
+
let n = 25.4, r = t === ti.LOMETRIC ? .1 : t === ti.HIMETRIC ? .01 : t === ti.LOENGLISH ? .01 * n : t === ti.HIENGLISH ? .001 * n : t === ti.TWIPS ? n / 1440 : 0;
|
|
26105
26131
|
r <= 0 || (e.winOrgX = 0, e.winOrgY = 0, e.vpOrgX = 0, e.vpOrgY = 0, e.winExtX = 1, e.winExtY = 1, e.vpExtX = r * e.devPxPerMmX, e.vpExtY = -(r * e.devPxPerMmY));
|
|
26106
26132
|
}
|
|
26107
|
-
var
|
|
26108
|
-
[
|
|
26133
|
+
var xi = {
|
|
26134
|
+
[ei.WHITE_BRUSH]: {
|
|
26109
26135
|
kind: "brush",
|
|
26110
26136
|
fill: "#ffffff"
|
|
26111
26137
|
},
|
|
26112
|
-
[
|
|
26138
|
+
[ei.LTGRAY_BRUSH]: {
|
|
26113
26139
|
kind: "brush",
|
|
26114
26140
|
fill: "#c0c0c0"
|
|
26115
26141
|
},
|
|
26116
|
-
[
|
|
26142
|
+
[ei.GRAY_BRUSH]: {
|
|
26117
26143
|
kind: "brush",
|
|
26118
26144
|
fill: "#808080"
|
|
26119
26145
|
},
|
|
26120
|
-
[
|
|
26146
|
+
[ei.DKGRAY_BRUSH]: {
|
|
26121
26147
|
kind: "brush",
|
|
26122
26148
|
fill: "#404040"
|
|
26123
26149
|
},
|
|
26124
|
-
[
|
|
26150
|
+
[ei.BLACK_BRUSH]: {
|
|
26125
26151
|
kind: "brush",
|
|
26126
26152
|
fill: "#000000"
|
|
26127
26153
|
},
|
|
26128
|
-
[
|
|
26154
|
+
[ei.NULL_BRUSH]: {
|
|
26129
26155
|
kind: "brush",
|
|
26130
26156
|
fill: null
|
|
26131
26157
|
}
|
|
26132
|
-
},
|
|
26133
|
-
[
|
|
26158
|
+
}, Si = {
|
|
26159
|
+
[ei.WHITE_PEN]: {
|
|
26134
26160
|
kind: "pen",
|
|
26135
26161
|
stroke: "#ffffff",
|
|
26136
26162
|
width: 1
|
|
26137
26163
|
},
|
|
26138
|
-
[
|
|
26164
|
+
[ei.BLACK_PEN]: {
|
|
26139
26165
|
kind: "pen",
|
|
26140
26166
|
stroke: "#000000",
|
|
26141
26167
|
width: 1
|
|
26142
26168
|
},
|
|
26143
|
-
[
|
|
26169
|
+
[ei.NULL_PEN]: {
|
|
26144
26170
|
kind: "pen",
|
|
26145
26171
|
stroke: null,
|
|
26146
26172
|
width: 1
|
|
26147
26173
|
},
|
|
26148
|
-
[
|
|
26174
|
+
[ei.DC_PEN]: {
|
|
26149
26175
|
kind: "pen",
|
|
26150
26176
|
stroke: "#000000",
|
|
26151
26177
|
width: 1
|
|
26152
26178
|
}
|
|
26153
26179
|
};
|
|
26154
|
-
function
|
|
26155
|
-
let n =
|
|
26180
|
+
function Ci(e, t) {
|
|
26181
|
+
let n = xi[t];
|
|
26156
26182
|
if (n) {
|
|
26157
26183
|
e.curBrush = n;
|
|
26158
26184
|
return;
|
|
26159
26185
|
}
|
|
26160
|
-
let r =
|
|
26186
|
+
let r = Si[t];
|
|
26161
26187
|
if (r) {
|
|
26162
26188
|
e.curPen = r;
|
|
26163
26189
|
return;
|
|
26164
26190
|
}
|
|
26165
|
-
t ===
|
|
26191
|
+
t === ei.DC_BRUSH && (e.curBrush = e.curBrush ?? {
|
|
26166
26192
|
kind: "brush",
|
|
26167
26193
|
fill: "#000000"
|
|
26168
26194
|
});
|
|
26169
26195
|
}
|
|
26170
|
-
function
|
|
26196
|
+
function wi(e) {
|
|
26171
26197
|
let t = 0, n = 0, r = 0, i = 0;
|
|
26172
26198
|
for (let a = 0; a < e.data.length; a += 4) e.data[a + 3] !== 0 && (t += e.data[a], n += e.data[a + 1], r += e.data[a + 2], i++);
|
|
26173
26199
|
if (i === 0) return "#808080";
|
|
26174
26200
|
let a = (e) => Math.round(e / i).toString(16).padStart(2, "0");
|
|
26175
26201
|
return `#${a(t)}${a(n)}${a(r)}`;
|
|
26176
26202
|
}
|
|
26177
|
-
var
|
|
26178
|
-
function
|
|
26203
|
+
var Ti = (e) => [e.i16(), e.i16()], Ei = (e) => [e.i32(), e.i32()];
|
|
26204
|
+
function Di(e, t, n) {
|
|
26179
26205
|
t.skip(16);
|
|
26180
26206
|
let r = t.u32();
|
|
26181
26207
|
if (r < 2 || r > 1048576 || !e.curPen || e.curPen.stroke == null) return;
|
|
@@ -26186,9 +26212,9 @@ function Ti(e, t, n) {
|
|
|
26186
26212
|
let [r, c] = n(t), [l, u] = Q(e, r, c);
|
|
26187
26213
|
s === 0 ? i.moveTo(l, u) : i.lineTo(l, u), a = r, o = c;
|
|
26188
26214
|
}
|
|
26189
|
-
i.strokeStyle = e.curPen.stroke, i.lineWidth =
|
|
26215
|
+
i.strokeStyle = e.curPen.stroke, i.lineWidth = yi(e, e.curPen.width), i.stroke(), e.drew = !0, e.curX = a, e.curY = o;
|
|
26190
26216
|
}
|
|
26191
|
-
function
|
|
26217
|
+
function Oi(e, t, n) {
|
|
26192
26218
|
t.skip(16);
|
|
26193
26219
|
let r = t.u32();
|
|
26194
26220
|
if (r < 1 || r > 1048576) return;
|
|
@@ -26206,9 +26232,9 @@ function Ei(e, t, n) {
|
|
|
26206
26232
|
}
|
|
26207
26233
|
e.curX = r, e.curY = o;
|
|
26208
26234
|
}
|
|
26209
|
-
a && e.curPen && (i.strokeStyle = e.curPen.stroke, i.lineWidth =
|
|
26235
|
+
a && e.curPen && (i.strokeStyle = e.curPen.stroke, i.lineWidth = yi(e, e.curPen.width), i.stroke(), e.drew = !0);
|
|
26210
26236
|
}
|
|
26211
|
-
function
|
|
26237
|
+
function ki(e, t, n) {
|
|
26212
26238
|
t.skip(16);
|
|
26213
26239
|
let r = t.u32();
|
|
26214
26240
|
if (r < 2 || r > 1048576) return;
|
|
@@ -26219,9 +26245,9 @@ function Di(e, t, n) {
|
|
|
26219
26245
|
let [r, o] = n(t), [s, c] = Q(e, r, o);
|
|
26220
26246
|
a ? i.lineTo(s, c) : (i.moveTo(s, c), a = !0);
|
|
26221
26247
|
}
|
|
26222
|
-
a && (i.closePath(), !e.inPath && (e.curBrush && e.curBrush.fill != null && (i.fillStyle = e.curBrush.fill, i.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (i.strokeStyle = e.curPen.stroke, i.lineWidth =
|
|
26248
|
+
a && (i.closePath(), !e.inPath && (e.curBrush && e.curBrush.fill != null && (i.fillStyle = e.curBrush.fill, i.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (i.strokeStyle = e.curPen.stroke, i.lineWidth = yi(e, e.curPen.width), i.stroke(), e.drew = !0)));
|
|
26223
26249
|
}
|
|
26224
|
-
function
|
|
26250
|
+
function Ai(e, t, n, r) {
|
|
26225
26251
|
t.skip(16);
|
|
26226
26252
|
let i = t.u32();
|
|
26227
26253
|
if (i < 1 || i > 1048576) return;
|
|
@@ -26247,9 +26273,9 @@ function Oi(e, t, n, r) {
|
|
|
26247
26273
|
}
|
|
26248
26274
|
e.curX = r[0], e.curY = r[1];
|
|
26249
26275
|
}
|
|
26250
|
-
o && e.curPen && (s.strokeStyle = e.curPen.stroke, s.lineWidth =
|
|
26276
|
+
o && e.curPen && (s.strokeStyle = e.curPen.stroke, s.lineWidth = yi(e, e.curPen.width), s.stroke(), e.drew = !0);
|
|
26251
26277
|
}
|
|
26252
|
-
function
|
|
26278
|
+
function ji(e, t, n, r) {
|
|
26253
26279
|
t.skip(16);
|
|
26254
26280
|
let i = t.u32(), a = t.u32();
|
|
26255
26281
|
if (i <= 0 || i > 65536 || a <= 0 || a > 2097152) return;
|
|
@@ -26272,23 +26298,23 @@ function ki(e, t, n, r) {
|
|
|
26272
26298
|
}
|
|
26273
26299
|
r && s.closePath(), c = !0;
|
|
26274
26300
|
}
|
|
26275
|
-
!c || e.inPath || (r && e.curBrush && e.curBrush.fill != null && (s.fillStyle = e.curBrush.fill, s.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (s.strokeStyle = e.curPen.stroke, s.lineWidth =
|
|
26301
|
+
!c || e.inPath || (r && e.curBrush && e.curBrush.fill != null && (s.fillStyle = e.curBrush.fill, s.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (s.strokeStyle = e.curPen.stroke, s.lineWidth = yi(e, e.curPen.width), s.stroke(), e.drew = !0));
|
|
26276
26302
|
}
|
|
26277
|
-
function
|
|
26303
|
+
function Mi(e, t, n, r, i) {
|
|
26278
26304
|
let { ctx: a } = e, o = Q(e, t, n), s = Q(e, r, n), c = Q(e, r, i), l = Q(e, t, i);
|
|
26279
|
-
e.inPath || a.beginPath(), a.moveTo(o[0], o[1]), a.lineTo(s[0], s[1]), a.lineTo(c[0], c[1]), a.lineTo(l[0], l[1]), a.closePath(), !e.inPath && (e.curBrush && e.curBrush.fill != null && (a.fillStyle = e.curBrush.fill, a.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (a.strokeStyle = e.curPen.stroke, a.lineWidth =
|
|
26305
|
+
e.inPath || a.beginPath(), a.moveTo(o[0], o[1]), a.lineTo(s[0], s[1]), a.lineTo(c[0], c[1]), a.lineTo(l[0], l[1]), a.closePath(), !e.inPath && (e.curBrush && e.curBrush.fill != null && (a.fillStyle = e.curBrush.fill, a.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (a.strokeStyle = e.curPen.stroke, a.lineWidth = yi(e, e.curPen.width), a.stroke(), e.drew = !0));
|
|
26280
26306
|
}
|
|
26281
|
-
function
|
|
26307
|
+
function Ni(e) {
|
|
26282
26308
|
let t = e.u32(), n = e.u32(), r = e.i32();
|
|
26283
26309
|
e.i32();
|
|
26284
26310
|
let i = e.u32();
|
|
26285
26311
|
return [t, {
|
|
26286
26312
|
kind: "pen",
|
|
26287
|
-
stroke: (n & 255) == 5 ? null :
|
|
26313
|
+
stroke: (n & 255) == 5 ? null : la(i),
|
|
26288
26314
|
width: Math.abs(r)
|
|
26289
26315
|
}];
|
|
26290
26316
|
}
|
|
26291
|
-
function
|
|
26317
|
+
function Pi(e) {
|
|
26292
26318
|
let t = e.u32();
|
|
26293
26319
|
e.skip(16);
|
|
26294
26320
|
let n = e.u32(), r = e.u32();
|
|
@@ -26296,31 +26322,31 @@ function Mi(e) {
|
|
|
26296
26322
|
let i = e.u32();
|
|
26297
26323
|
return [t, {
|
|
26298
26324
|
kind: "pen",
|
|
26299
|
-
stroke: (n & 255) == 5 ? null :
|
|
26325
|
+
stroke: (n & 255) == 5 ? null : la(i),
|
|
26300
26326
|
width: Math.abs(r)
|
|
26301
26327
|
}];
|
|
26302
26328
|
}
|
|
26303
|
-
function
|
|
26329
|
+
function Fi(e) {
|
|
26304
26330
|
let t = e.u32(), n = e.u32(), r = e.u32();
|
|
26305
26331
|
return e.u32(), [t, {
|
|
26306
26332
|
kind: "brush",
|
|
26307
|
-
fill: n === 1 ? null :
|
|
26333
|
+
fill: n === 1 ? null : la(r)
|
|
26308
26334
|
}];
|
|
26309
26335
|
}
|
|
26310
|
-
function
|
|
26336
|
+
function Ii(e, t, n) {
|
|
26311
26337
|
let r = e.u32();
|
|
26312
26338
|
e.u32();
|
|
26313
26339
|
let i = e.u32(), a = e.u32(), o = e.u32(), s = e.u32(), c = "#808080";
|
|
26314
26340
|
try {
|
|
26315
|
-
let e =
|
|
26316
|
-
e && (c =
|
|
26341
|
+
let e = Zr(t, n + i, a, n + o, s);
|
|
26342
|
+
e && (c = wi(e));
|
|
26317
26343
|
} catch {}
|
|
26318
26344
|
return [r, {
|
|
26319
26345
|
kind: "brush",
|
|
26320
26346
|
fill: c
|
|
26321
26347
|
}];
|
|
26322
26348
|
}
|
|
26323
|
-
function
|
|
26349
|
+
function Li(e, t, n) {
|
|
26324
26350
|
let r = e.u32(), i = n + 12, a = t.getInt32(i, !0), o = t.getInt32(i + 8, !0), s = t.getInt32(i + 16, !0), c = t.getUint8(i + 20), l = "";
|
|
26325
26351
|
for (let e = 0; e < 32; e++) {
|
|
26326
26352
|
let n = i + 28 + e * 2;
|
|
@@ -26338,7 +26364,7 @@ function Fi(e, t, n) {
|
|
|
26338
26364
|
escapement: o
|
|
26339
26365
|
}];
|
|
26340
26366
|
}
|
|
26341
|
-
function
|
|
26367
|
+
function Ri(e, t, n, r) {
|
|
26342
26368
|
t.skip(16), t.u32(), t.f32(), t.f32();
|
|
26343
26369
|
let i = t.i32(), a = t.i32(), o = t.u32(), s = t.u32();
|
|
26344
26370
|
if (t.u32(), o <= 0 || o > 65536) return;
|
|
@@ -26349,7 +26375,7 @@ function Ii(e, t, n, r) {
|
|
|
26349
26375
|
c += String.fromCharCode(n.getUint16(t, !0));
|
|
26350
26376
|
}
|
|
26351
26377
|
if (c.length === 0) return;
|
|
26352
|
-
let l = e.curFont, u = Math.abs(l?.height ?? 0) *
|
|
26378
|
+
let l = e.curFont, u = Math.abs(l?.height ?? 0) * _i(e) * Math.abs(di(e)) * vi(e);
|
|
26353
26379
|
if (!Number.isFinite(u) || u < 1) return;
|
|
26354
26380
|
let { ctx: d } = e, [f, p] = Q(e, i, a);
|
|
26355
26381
|
d.fillStyle = e.textColor;
|
|
@@ -26370,29 +26396,29 @@ function Ii(e, t, n, r) {
|
|
|
26370
26396
|
e.drew = !0;
|
|
26371
26397
|
} catch {}
|
|
26372
26398
|
}
|
|
26373
|
-
function
|
|
26399
|
+
function zi(e, t, n, r, i, a, o, s, c, l, u) {
|
|
26374
26400
|
if (i === 0 || o === 0) return;
|
|
26375
|
-
let d =
|
|
26401
|
+
let d = Zr(t, n + r, i, n + a, o);
|
|
26376
26402
|
if (!d) return;
|
|
26377
26403
|
let [f, p] = Q(e, s, c), [m, h] = Q(e, l, u);
|
|
26378
|
-
|
|
26404
|
+
$r(e.ctx, d, f, p, m, h) && (e.drew = !0);
|
|
26379
26405
|
}
|
|
26380
|
-
function
|
|
26406
|
+
function Bi(e, t, n, r) {
|
|
26381
26407
|
t.skip(16);
|
|
26382
26408
|
let i = t.i32(), a = t.i32(), o = t.i32(), s = t.i32();
|
|
26383
|
-
t.u32(), t.i32(), t.i32(), t.skip(24), t.u32(), t.u32(),
|
|
26409
|
+
t.u32(), t.i32(), t.i32(), t.skip(24), t.u32(), t.u32(), zi(e, n, r, t.u32(), t.u32(), t.u32(), t.u32(), i, a, i + o, a + s);
|
|
26384
26410
|
}
|
|
26385
|
-
function
|
|
26411
|
+
function Vi(e, t, n, r) {
|
|
26386
26412
|
t.skip(16);
|
|
26387
26413
|
let i = t.i32(), a = t.i32();
|
|
26388
26414
|
t.i32(), t.i32(), t.i32(), t.i32();
|
|
26389
26415
|
let o = t.u32(), s = t.u32(), c = t.u32(), l = t.u32();
|
|
26390
26416
|
t.u32(), t.u32();
|
|
26391
26417
|
let u = t.i32(), d = t.i32();
|
|
26392
|
-
|
|
26418
|
+
zi(e, n, r, o, s, c, l, i, a, i + u, a + d);
|
|
26393
26419
|
}
|
|
26394
|
-
function
|
|
26395
|
-
if (!
|
|
26420
|
+
function Hi(e, t, n, r) {
|
|
26421
|
+
if (!sa(e) || n <= 0 || r <= 0) return !1;
|
|
26396
26422
|
let i = new DataView(e.buffer, e.byteOffset, e.byteLength), a = {
|
|
26397
26423
|
ctx: t,
|
|
26398
26424
|
W: n,
|
|
@@ -26401,8 +26427,8 @@ function Bi(e, t, n, r) {
|
|
|
26401
26427
|
top: 0,
|
|
26402
26428
|
boundsW: n,
|
|
26403
26429
|
boundsH: r,
|
|
26404
|
-
wt:
|
|
26405
|
-
mapMode:
|
|
26430
|
+
wt: ni(),
|
|
26431
|
+
mapMode: ti.TEXT,
|
|
26406
26432
|
winOrgX: 0,
|
|
26407
26433
|
winOrgY: 0,
|
|
26408
26434
|
winExtX: 1,
|
|
@@ -26432,7 +26458,7 @@ function Bi(e, t, n, r) {
|
|
|
26432
26458
|
if (r < 8 || r & 3) break;
|
|
26433
26459
|
let s = o + r;
|
|
26434
26460
|
if (s > e.length || n === Z.EOF) break;
|
|
26435
|
-
let c = new
|
|
26461
|
+
let c = new ii(i, o + 8, s);
|
|
26436
26462
|
try {
|
|
26437
26463
|
switch (n) {
|
|
26438
26464
|
case Z.HEADER: {
|
|
@@ -26451,11 +26477,11 @@ function Bi(e, t, n, r) {
|
|
|
26451
26477
|
break;
|
|
26452
26478
|
case Z.MODIFYWORLDTRANSFORM: {
|
|
26453
26479
|
let e = c.xform(), t = c.u32();
|
|
26454
|
-
t === 1 ? a.wt =
|
|
26480
|
+
t === 1 ? a.wt = ni() : t === 2 ? a.wt = ri(e, a.wt) : t === 3 ? a.wt = ri(a.wt, e) : t === 4 && (a.wt = e);
|
|
26455
26481
|
break;
|
|
26456
26482
|
}
|
|
26457
26483
|
case Z.SETMAPMODE:
|
|
26458
|
-
|
|
26484
|
+
bi(a, c.u32());
|
|
26459
26485
|
break;
|
|
26460
26486
|
case Z.SETWINDOWORGEX:
|
|
26461
26487
|
a.winOrgX = c.i32(), a.winOrgY = c.i32();
|
|
@@ -26528,7 +26554,7 @@ function Bi(e, t, n, r) {
|
|
|
26528
26554
|
break;
|
|
26529
26555
|
case Z.SELECTOBJECT: {
|
|
26530
26556
|
let e = c.u32();
|
|
26531
|
-
if (e & 2147483648)
|
|
26557
|
+
if (e & 2147483648) Ci(a, e >>> 0);
|
|
26532
26558
|
else {
|
|
26533
26559
|
let t = a.objects.get(e);
|
|
26534
26560
|
t?.kind === "pen" ? a.curPen = t : t?.kind === "brush" ? a.curBrush = t : t?.kind === "font" && (a.curFont = t);
|
|
@@ -26541,72 +26567,72 @@ function Bi(e, t, n, r) {
|
|
|
26541
26567
|
break;
|
|
26542
26568
|
}
|
|
26543
26569
|
case Z.CREATEPEN: {
|
|
26544
|
-
let [e, t] =
|
|
26570
|
+
let [e, t] = Ni(c);
|
|
26545
26571
|
a.objects.set(e, t);
|
|
26546
26572
|
break;
|
|
26547
26573
|
}
|
|
26548
26574
|
case Z.EXTCREATEPEN: {
|
|
26549
|
-
let [e, t] =
|
|
26575
|
+
let [e, t] = Pi(c);
|
|
26550
26576
|
a.objects.set(e, t);
|
|
26551
26577
|
break;
|
|
26552
26578
|
}
|
|
26553
26579
|
case Z.CREATEBRUSHINDIRECT: {
|
|
26554
|
-
let [e, t] =
|
|
26580
|
+
let [e, t] = Fi(c);
|
|
26555
26581
|
a.objects.set(e, t);
|
|
26556
26582
|
break;
|
|
26557
26583
|
}
|
|
26558
26584
|
case Z.CREATEMONOBRUSH:
|
|
26559
26585
|
case Z.CREATEDIBPATTERNBRUSHPT: {
|
|
26560
|
-
let [e, t] =
|
|
26586
|
+
let [e, t] = Ii(c, i, o);
|
|
26561
26587
|
a.objects.set(e, t);
|
|
26562
26588
|
break;
|
|
26563
26589
|
}
|
|
26564
26590
|
case Z.EXTCREATEFONTINDIRECTW: {
|
|
26565
|
-
let [e, t] =
|
|
26591
|
+
let [e, t] = Li(c, i, o);
|
|
26566
26592
|
a.objects.set(e, t);
|
|
26567
26593
|
break;
|
|
26568
26594
|
}
|
|
26569
26595
|
case Z.POLYLINE16:
|
|
26570
|
-
|
|
26596
|
+
Di(a, c, Ti);
|
|
26571
26597
|
break;
|
|
26572
26598
|
case Z.POLYLINE:
|
|
26573
|
-
|
|
26599
|
+
Di(a, c, Ei);
|
|
26574
26600
|
break;
|
|
26575
26601
|
case Z.POLYLINETO16:
|
|
26576
|
-
|
|
26602
|
+
Oi(a, c, Ti);
|
|
26577
26603
|
break;
|
|
26578
26604
|
case Z.POLYLINETO:
|
|
26579
|
-
|
|
26605
|
+
Oi(a, c, Ei);
|
|
26580
26606
|
break;
|
|
26581
26607
|
case Z.POLYGON16:
|
|
26582
|
-
|
|
26608
|
+
ki(a, c, Ti);
|
|
26583
26609
|
break;
|
|
26584
26610
|
case Z.POLYGON:
|
|
26585
|
-
|
|
26611
|
+
ki(a, c, Ei);
|
|
26586
26612
|
break;
|
|
26587
26613
|
case Z.POLYBEZIER16:
|
|
26588
|
-
|
|
26614
|
+
Ai(a, c, Ti, !1);
|
|
26589
26615
|
break;
|
|
26590
26616
|
case Z.POLYBEZIER:
|
|
26591
|
-
|
|
26617
|
+
Ai(a, c, Ei, !1);
|
|
26592
26618
|
break;
|
|
26593
26619
|
case Z.POLYBEZIERTO16:
|
|
26594
|
-
|
|
26620
|
+
Ai(a, c, Ti, !0);
|
|
26595
26621
|
break;
|
|
26596
26622
|
case Z.POLYBEZIERTO:
|
|
26597
|
-
|
|
26623
|
+
Ai(a, c, Ei, !0);
|
|
26598
26624
|
break;
|
|
26599
26625
|
case Z.POLYPOLYGON16:
|
|
26600
|
-
|
|
26626
|
+
ji(a, c, Ti, !0);
|
|
26601
26627
|
break;
|
|
26602
26628
|
case Z.POLYPOLYGON:
|
|
26603
|
-
|
|
26629
|
+
ji(a, c, Ei, !0);
|
|
26604
26630
|
break;
|
|
26605
26631
|
case Z.POLYPOLYLINE16:
|
|
26606
|
-
|
|
26632
|
+
ji(a, c, Ti, !1);
|
|
26607
26633
|
break;
|
|
26608
26634
|
case Z.POLYPOLYLINE:
|
|
26609
|
-
|
|
26635
|
+
ji(a, c, Ei, !1);
|
|
26610
26636
|
break;
|
|
26611
26637
|
case Z.MOVETOEX:
|
|
26612
26638
|
a.curX = c.i32(), a.curY = c.i32();
|
|
@@ -26615,24 +26641,24 @@ function Bi(e, t, n, r) {
|
|
|
26615
26641
|
let e = c.i32(), n = c.i32();
|
|
26616
26642
|
if (a.curPen && a.curPen.stroke != null) {
|
|
26617
26643
|
let [r, i] = Q(a, a.curX, a.curY), [o, s] = Q(a, e, n);
|
|
26618
|
-
t.beginPath(), t.moveTo(r, i), t.lineTo(o, s), t.strokeStyle = a.curPen.stroke, t.lineWidth =
|
|
26644
|
+
t.beginPath(), t.moveTo(r, i), t.lineTo(o, s), t.strokeStyle = a.curPen.stroke, t.lineWidth = yi(a, a.curPen.width), t.stroke(), a.drew = !0;
|
|
26619
26645
|
}
|
|
26620
26646
|
a.curX = e, a.curY = n;
|
|
26621
26647
|
break;
|
|
26622
26648
|
}
|
|
26623
26649
|
case Z.RECTANGLE:
|
|
26624
|
-
|
|
26650
|
+
Mi(a, c.i32(), c.i32(), c.i32(), c.i32());
|
|
26625
26651
|
break;
|
|
26626
26652
|
case Z.ELLIPSE: {
|
|
26627
26653
|
let e = c.i32(), n = c.i32(), r = c.i32(), i = c.i32(), [o, s] = [(e + r) / 2, (n + i) / 2], [l, u] = Q(a, o, s), [d] = Q(a, r, s), [, f] = Q(a, o, i), p = Math.abs(d - l), m = Math.abs(f - u);
|
|
26628
|
-
t.beginPath(), t.ellipse(l, u, p, m, 0, 0, Math.PI * 2), a.curBrush && a.curBrush.fill != null && (t.fillStyle = a.curBrush.fill, t.fill(a.fillRule), a.drew = !0), a.curPen && a.curPen.stroke != null && (t.strokeStyle = a.curPen.stroke, t.lineWidth =
|
|
26654
|
+
t.beginPath(), t.ellipse(l, u, p, m, 0, 0, Math.PI * 2), a.curBrush && a.curBrush.fill != null && (t.fillStyle = a.curBrush.fill, t.fill(a.fillRule), a.drew = !0), a.curPen && a.curPen.stroke != null && (t.strokeStyle = a.curPen.stroke, t.lineWidth = yi(a, a.curPen.width), t.stroke(), a.drew = !0);
|
|
26629
26655
|
break;
|
|
26630
26656
|
}
|
|
26631
26657
|
case Z.SETPOLYFILLMODE:
|
|
26632
26658
|
a.fillRule = c.u32() === 1 ? "evenodd" : "nonzero";
|
|
26633
26659
|
break;
|
|
26634
26660
|
case Z.SETTEXTCOLOR:
|
|
26635
|
-
a.textColor =
|
|
26661
|
+
a.textColor = la(c.u32());
|
|
26636
26662
|
break;
|
|
26637
26663
|
case Z.SETTEXTALIGN:
|
|
26638
26664
|
a.textAlign = c.u32();
|
|
@@ -26641,13 +26667,13 @@ function Bi(e, t, n, r) {
|
|
|
26641
26667
|
a.bkMode = c.u32();
|
|
26642
26668
|
break;
|
|
26643
26669
|
case Z.EXTTEXTOUTW:
|
|
26644
|
-
|
|
26670
|
+
Ri(a, c, i, o);
|
|
26645
26671
|
break;
|
|
26646
26672
|
case Z.BITBLT:
|
|
26647
|
-
|
|
26673
|
+
Bi(a, c, i, o);
|
|
26648
26674
|
break;
|
|
26649
26675
|
case Z.STRETCHDIBITS:
|
|
26650
|
-
|
|
26676
|
+
Vi(a, c, i, o);
|
|
26651
26677
|
break;
|
|
26652
26678
|
default: break;
|
|
26653
26679
|
}
|
|
@@ -26656,55 +26682,55 @@ function Bi(e, t, n, r) {
|
|
|
26656
26682
|
}
|
|
26657
26683
|
return a.drew;
|
|
26658
26684
|
}
|
|
26659
|
-
async function
|
|
26660
|
-
if (!
|
|
26685
|
+
async function Ui(e, t, n) {
|
|
26686
|
+
if (!sa(e) || t <= 0 || n <= 0) return null;
|
|
26661
26687
|
let r = It(t, n);
|
|
26662
26688
|
if (!r) return null;
|
|
26663
26689
|
let i = r.getContext("2d");
|
|
26664
|
-
return !i || (i.lineJoin = "round", i.lineCap = "round", !
|
|
26690
|
+
return !i || (i.lineJoin = "round", i.lineCap = "round", !Hi(e, i, t, n)) ? null : createImageBitmap(r);
|
|
26665
26691
|
}
|
|
26666
26692
|
//#endregion
|
|
26667
26693
|
//#region packages/core/src/image/raster-dimensions.ts
|
|
26668
|
-
function
|
|
26694
|
+
function Wi(e, t) {
|
|
26669
26695
|
return e[t] << 8 | e[t + 1];
|
|
26670
26696
|
}
|
|
26671
|
-
function
|
|
26697
|
+
function Gi(e, t) {
|
|
26672
26698
|
return (e[t] << 24 | e[t + 1] << 16 | e[t + 2] << 8 | e[t + 3]) >>> 0;
|
|
26673
26699
|
}
|
|
26674
|
-
function
|
|
26700
|
+
function Ki(e, t) {
|
|
26675
26701
|
return e[t] | e[t + 1] << 8;
|
|
26676
26702
|
}
|
|
26677
|
-
function
|
|
26703
|
+
function qi(e, t) {
|
|
26678
26704
|
return e[t] | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24 | 0;
|
|
26679
26705
|
}
|
|
26680
|
-
function
|
|
26706
|
+
function Ji(e) {
|
|
26681
26707
|
let t = e.length;
|
|
26682
26708
|
return t >= 24 && e[0] === 137 && e[1] === 80 && e[2] === 78 && e[3] === 71 && e[4] === 13 && e[5] === 10 && e[6] === 26 && e[7] === 10 ? e[12] === 73 && e[13] === 72 && e[14] === 68 && e[15] === 82 ? {
|
|
26683
|
-
width:
|
|
26684
|
-
height:
|
|
26709
|
+
width: Gi(e, 16),
|
|
26710
|
+
height: Gi(e, 20)
|
|
26685
26711
|
} : null : t >= 10 && e[0] === 71 && e[1] === 73 && e[2] === 70 && e[3] === 56 && (e[4] === 55 || e[4] === 57) && e[5] === 97 ? {
|
|
26686
|
-
width:
|
|
26687
|
-
height:
|
|
26688
|
-
} : t >= 26 && e[0] === 66 && e[1] === 77 ?
|
|
26689
|
-
width:
|
|
26690
|
-
height:
|
|
26712
|
+
width: Ki(e, 6),
|
|
26713
|
+
height: Ki(e, 8)
|
|
26714
|
+
} : t >= 26 && e[0] === 66 && e[1] === 77 ? Yi(e, 14) === 12 ? {
|
|
26715
|
+
width: Ki(e, 18),
|
|
26716
|
+
height: Ki(e, 20)
|
|
26691
26717
|
} : {
|
|
26692
|
-
width: Math.abs(
|
|
26693
|
-
height: Math.abs(
|
|
26694
|
-
} : t >= 16 && e[0] === 82 && e[1] === 73 && e[2] === 70 && e[3] === 70 && e[8] === 87 && e[9] === 69 && e[10] === 66 && e[11] === 80 ?
|
|
26718
|
+
width: Math.abs(qi(e, 18)),
|
|
26719
|
+
height: Math.abs(qi(e, 22))
|
|
26720
|
+
} : t >= 16 && e[0] === 82 && e[1] === 73 && e[2] === 70 && e[3] === 70 && e[8] === 87 && e[9] === 69 && e[10] === 66 && e[11] === 80 ? Xi(e) : t >= 4 && e[0] === 255 && e[1] === 216 ? Zi(e) : null;
|
|
26695
26721
|
}
|
|
26696
|
-
function
|
|
26722
|
+
function Yi(e, t) {
|
|
26697
26723
|
return (e[t] | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24) >>> 0;
|
|
26698
26724
|
}
|
|
26699
|
-
function
|
|
26725
|
+
function Xi(e) {
|
|
26700
26726
|
let t = e.length, n = e[12], r = e[13], i = e[14], a = e[15];
|
|
26701
26727
|
if (n === 86 && r === 80 && i === 56 && a === 32) return t < 30 ? null : {
|
|
26702
|
-
width:
|
|
26703
|
-
height:
|
|
26728
|
+
width: Ki(e, 26) & 16383,
|
|
26729
|
+
height: Ki(e, 28) & 16383
|
|
26704
26730
|
};
|
|
26705
26731
|
if (n === 86 && r === 80 && i === 56 && a === 76) {
|
|
26706
26732
|
if (t < 25 || e[20] !== 47) return null;
|
|
26707
|
-
let n =
|
|
26733
|
+
let n = Yi(e, 21);
|
|
26708
26734
|
return {
|
|
26709
26735
|
width: (n & 16383) + 1,
|
|
26710
26736
|
height: (n >>> 14 & 16383) + 1
|
|
@@ -26715,7 +26741,7 @@ function Ji(e) {
|
|
|
26715
26741
|
height: (e[27] | e[28] << 8 | e[29] << 16) + 1
|
|
26716
26742
|
} : null;
|
|
26717
26743
|
}
|
|
26718
|
-
function
|
|
26744
|
+
function Zi(e) {
|
|
26719
26745
|
let t = e.length, n = 2;
|
|
26720
26746
|
for (; n + 1 < t;) {
|
|
26721
26747
|
if (e[n] !== 255) {
|
|
@@ -26732,12 +26758,12 @@ function Yi(e) {
|
|
|
26732
26758
|
continue;
|
|
26733
26759
|
}
|
|
26734
26760
|
if (r === 217 || n + 3 >= t) return null;
|
|
26735
|
-
let i =
|
|
26761
|
+
let i = Wi(e, n + 2);
|
|
26736
26762
|
if (r >= 192 && r <= 207 && r !== 196 && r !== 200 && r !== 204) {
|
|
26737
26763
|
if (n + 8 >= t) return null;
|
|
26738
|
-
let r =
|
|
26764
|
+
let r = Wi(e, n + 5);
|
|
26739
26765
|
return {
|
|
26740
|
-
width:
|
|
26766
|
+
width: Wi(e, n + 7),
|
|
26741
26767
|
height: r
|
|
26742
26768
|
};
|
|
26743
26769
|
}
|
|
@@ -26746,17 +26772,17 @@ function Yi(e) {
|
|
|
26746
26772
|
}
|
|
26747
26773
|
return null;
|
|
26748
26774
|
}
|
|
26749
|
-
function
|
|
26775
|
+
function Qi(e) {
|
|
26750
26776
|
let { width: t, height: n } = e;
|
|
26751
|
-
return !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 || n <= 0 || t > 32767 || n > 32767 ? !0 : t * n >
|
|
26777
|
+
return !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 || n <= 0 || t > 32767 || n > 32767 ? !0 : t * n > Jr;
|
|
26752
26778
|
}
|
|
26753
|
-
function
|
|
26754
|
-
let t =
|
|
26755
|
-
return t !== null &&
|
|
26779
|
+
function $i(e) {
|
|
26780
|
+
let t = Ji(e);
|
|
26781
|
+
return t !== null && Qi(t);
|
|
26756
26782
|
}
|
|
26757
26783
|
//#endregion
|
|
26758
26784
|
//#region packages/core/src/image/wmf.ts
|
|
26759
|
-
var
|
|
26785
|
+
var ea = {
|
|
26760
26786
|
EOF: 0,
|
|
26761
26787
|
SETBKMODE: 258,
|
|
26762
26788
|
SETTEXTALIGN: 302,
|
|
@@ -26777,35 +26803,35 @@ var Qi = {
|
|
|
26777
26803
|
DIBBITBLT: 2368,
|
|
26778
26804
|
DIBSTRETCHBLT: 2881,
|
|
26779
26805
|
STRETCHDIBITS: 3907
|
|
26780
|
-
},
|
|
26781
|
-
function
|
|
26782
|
-
if (e.length < t +
|
|
26806
|
+
}, ta = 2596720087, na = 22, ra = 18, ia = 1179469088;
|
|
26807
|
+
function aa(e, t) {
|
|
26808
|
+
if (e.length < t + ra) return !1;
|
|
26783
26809
|
let n = e[t] | e[t + 1] << 8, r = e[t + 2] | e[t + 3] << 8;
|
|
26784
26810
|
return (n === 1 || n === 2) && r === 9;
|
|
26785
26811
|
}
|
|
26786
|
-
function
|
|
26787
|
-
return e.length < 4 ? !1 : (e[0] | e[1] << 8 | e[2] << 16 | e[3] << 24) >>> 0 ===
|
|
26812
|
+
function oa(e) {
|
|
26813
|
+
return e.length < 4 ? !1 : (e[0] | e[1] << 8 | e[2] << 16 | e[3] << 24) >>> 0 === ta ? !0 : aa(e, 0);
|
|
26788
26814
|
}
|
|
26789
|
-
function
|
|
26815
|
+
function sa(e) {
|
|
26790
26816
|
if (e.length < 44) return !1;
|
|
26791
26817
|
let t = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
26792
|
-
return t.getUint32(0, !0) === 1 && t.getUint32(40, !0) ===
|
|
26818
|
+
return t.getUint32(0, !0) === 1 && t.getUint32(40, !0) === ia;
|
|
26793
26819
|
}
|
|
26794
|
-
function
|
|
26820
|
+
function ca(e) {
|
|
26795
26821
|
return e === "image/wmf" || e === "image/emf";
|
|
26796
26822
|
}
|
|
26797
|
-
function
|
|
26823
|
+
function la(e) {
|
|
26798
26824
|
let t = e & 255, n = e >>> 8 & 255, r = e >>> 16 & 255, i = (e) => e.toString(16).padStart(2, "0");
|
|
26799
26825
|
return `#${i(t)}${i(n)}${i(r)}`;
|
|
26800
26826
|
}
|
|
26801
|
-
function
|
|
26827
|
+
function ua(e, t) {
|
|
26802
26828
|
for (let n = 0; n < e.length; n++) if (e[n] == null) {
|
|
26803
26829
|
e[n] = t;
|
|
26804
26830
|
return;
|
|
26805
26831
|
}
|
|
26806
26832
|
e.push(t);
|
|
26807
26833
|
}
|
|
26808
|
-
var
|
|
26834
|
+
var da = class {
|
|
26809
26835
|
p = 0;
|
|
26810
26836
|
constructor(e, t, n) {
|
|
26811
26837
|
this.b = e, this.end = n, this.p = t;
|
|
@@ -26836,56 +26862,56 @@ var la = class {
|
|
|
26836
26862
|
this.p = Math.min(this.p + Math.max(0, e), this.end);
|
|
26837
26863
|
}
|
|
26838
26864
|
};
|
|
26839
|
-
function
|
|
26865
|
+
function fa(e, t) {
|
|
26840
26866
|
return (t - e.orgX) * (e.W / e.extX);
|
|
26841
26867
|
}
|
|
26842
|
-
function
|
|
26868
|
+
function pa(e, t) {
|
|
26843
26869
|
return (t - e.orgY) * (e.H / e.extY);
|
|
26844
26870
|
}
|
|
26845
|
-
function
|
|
26871
|
+
function ma(e, t) {
|
|
26846
26872
|
let n = t * Math.abs(e.W / e.extX);
|
|
26847
26873
|
return n >= 1 ? n : 1;
|
|
26848
26874
|
}
|
|
26849
|
-
var
|
|
26850
|
-
function
|
|
26851
|
-
return Math.abs(e - t) <=
|
|
26875
|
+
var ha = .001;
|
|
26876
|
+
function ga(e, t, n) {
|
|
26877
|
+
return Math.abs(e - t) <= ha || Math.abs(e - n) <= ha;
|
|
26852
26878
|
}
|
|
26853
|
-
function
|
|
26879
|
+
function _a(e, t, n) {
|
|
26854
26880
|
let r = [], i = n ? t.length : t.length - 1;
|
|
26855
26881
|
for (let n = 0; n < i; n++) {
|
|
26856
|
-
let i = t[n], a = t[(n + 1) % t.length], o = Math.abs(i[0] - a[0]) <=
|
|
26882
|
+
let i = t[n], a = t[(n + 1) % t.length], o = Math.abs(i[0] - a[0]) <= ha && ga(i[0], 0, e.W) && ga(a[0], 0, e.W), s = Math.abs(i[1] - a[1]) <= ha && ga(i[1], 0, e.H) && ga(a[1], 0, e.H);
|
|
26857
26883
|
o || s || r.push([i, a]);
|
|
26858
26884
|
}
|
|
26859
26885
|
return r;
|
|
26860
26886
|
}
|
|
26861
|
-
function
|
|
26887
|
+
function va(e, t, n) {
|
|
26862
26888
|
if (!e.curPen || e.curPen.stroke == null || t.length < 2) return;
|
|
26863
26889
|
let { ctx: r } = e;
|
|
26864
|
-
if (r.strokeStyle = e.curPen.stroke, r.lineWidth =
|
|
26890
|
+
if (r.strokeStyle = e.curPen.stroke, r.lineWidth = ma(e, e.curPen.width), !e.suppressBoundaryFrame) {
|
|
26865
26891
|
r.beginPath(), r.moveTo(t[0][0], t[0][1]);
|
|
26866
26892
|
for (let e = 1; e < t.length; e++) r.lineTo(t[e][0], t[e][1]);
|
|
26867
26893
|
n && r.closePath(), r.stroke(), e.drew = !0;
|
|
26868
26894
|
return;
|
|
26869
26895
|
}
|
|
26870
|
-
let i =
|
|
26896
|
+
let i = _a(e, t, n);
|
|
26871
26897
|
if (i.length === 0) return;
|
|
26872
26898
|
r.beginPath();
|
|
26873
26899
|
let a = null;
|
|
26874
26900
|
for (let [e, t] of i) (!a || a[0] !== e[0] || a[1] !== e[1]) && r.moveTo(e[0], e[1]), r.lineTo(t[0], t[1]), a = t;
|
|
26875
26901
|
r.stroke(), e.drew = !0;
|
|
26876
26902
|
}
|
|
26877
|
-
function
|
|
26903
|
+
function ya(e, t, n) {
|
|
26878
26904
|
let r = [];
|
|
26879
26905
|
for (let i = 0; i < n && !(t.remaining < 4); i++) {
|
|
26880
26906
|
let n = t.i16(), i = t.i16();
|
|
26881
|
-
r.push([
|
|
26907
|
+
r.push([fa(e, n), pa(e, i)]);
|
|
26882
26908
|
}
|
|
26883
26909
|
return r;
|
|
26884
26910
|
}
|
|
26885
|
-
function
|
|
26886
|
-
t.length < 2 || !e.curPen || e.curPen.stroke == null ||
|
|
26911
|
+
function ba(e, t) {
|
|
26912
|
+
t.length < 2 || !e.curPen || e.curPen.stroke == null || va(e, t, !1);
|
|
26887
26913
|
}
|
|
26888
|
-
function
|
|
26914
|
+
function xa(e, t) {
|
|
26889
26915
|
if (t.length < 2) return;
|
|
26890
26916
|
let { ctx: n } = e;
|
|
26891
26917
|
if (e.curBrush && e.curBrush.fill != null) {
|
|
@@ -26893,9 +26919,9 @@ function ya(e, t) {
|
|
|
26893
26919
|
for (let e = 1; e < t.length; e++) n.lineTo(t[e][0], t[e][1]);
|
|
26894
26920
|
n.closePath(), n.fillStyle = e.curBrush.fill, n.fill(e.fillRule), e.drew = !0;
|
|
26895
26921
|
}
|
|
26896
|
-
|
|
26922
|
+
va(e, t, !0);
|
|
26897
26923
|
}
|
|
26898
|
-
function
|
|
26924
|
+
function Sa(e, t) {
|
|
26899
26925
|
let n = t.u16();
|
|
26900
26926
|
if (n <= 0 || n > 65536) return;
|
|
26901
26927
|
let r = [];
|
|
@@ -26911,33 +26937,33 @@ function ba(e, t) {
|
|
|
26911
26937
|
for (let e = 0; e < n && t.remaining >= 4; e++) t.i16(), t.i16();
|
|
26912
26938
|
continue;
|
|
26913
26939
|
}
|
|
26914
|
-
let r =
|
|
26940
|
+
let r = ya(e, t, n);
|
|
26915
26941
|
if (!(r.length < 2)) {
|
|
26916
26942
|
i.moveTo(r[0][0], r[0][1]);
|
|
26917
26943
|
for (let e = 1; e < r.length; e++) i.lineTo(r[e][0], r[e][1]);
|
|
26918
26944
|
i.closePath(), a = !0;
|
|
26919
26945
|
}
|
|
26920
26946
|
}
|
|
26921
|
-
a && (e.curBrush && e.curBrush.fill != null && (i.fillStyle = e.curBrush.fill, i.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (i.strokeStyle = e.curPen.stroke, i.lineWidth =
|
|
26947
|
+
a && (e.curBrush && e.curBrush.fill != null && (i.fillStyle = e.curBrush.fill, i.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (i.strokeStyle = e.curPen.stroke, i.lineWidth = ma(e, e.curPen.width), i.stroke(), e.drew = !0));
|
|
26922
26948
|
}
|
|
26923
|
-
function
|
|
26949
|
+
function Ca(e) {
|
|
26924
26950
|
let t = e.u16(), n = e.i16();
|
|
26925
26951
|
e.i16();
|
|
26926
26952
|
let r = e.u32();
|
|
26927
26953
|
return {
|
|
26928
26954
|
kind: "pen",
|
|
26929
|
-
stroke: (t & 255) == 5 ? null :
|
|
26955
|
+
stroke: (t & 255) == 5 ? null : la(r),
|
|
26930
26956
|
width: Math.abs(n)
|
|
26931
26957
|
};
|
|
26932
26958
|
}
|
|
26933
|
-
function
|
|
26959
|
+
function wa(e) {
|
|
26934
26960
|
let t = e.u16(), n = e.u32();
|
|
26935
26961
|
return e.u16(), {
|
|
26936
26962
|
kind: "brush",
|
|
26937
|
-
fill: t === 1 ? null :
|
|
26963
|
+
fill: t === 1 ? null : la(n)
|
|
26938
26964
|
};
|
|
26939
26965
|
}
|
|
26940
|
-
function
|
|
26966
|
+
function Ta(e) {
|
|
26941
26967
|
let t = e.indexOf(0), n = t >= 0 ? e.subarray(0, t) : e;
|
|
26942
26968
|
if (n.length === 0) return "";
|
|
26943
26969
|
try {
|
|
@@ -26946,7 +26972,7 @@ function Ca(e) {
|
|
|
26946
26972
|
return String.fromCharCode(...n);
|
|
26947
26973
|
}
|
|
26948
26974
|
}
|
|
26949
|
-
function
|
|
26975
|
+
function Ea(e) {
|
|
26950
26976
|
let t = Math.abs(e.i16());
|
|
26951
26977
|
e.i16(), e.i16(), e.i16();
|
|
26952
26978
|
let n = e.i16(), r = e.u8() !== 0;
|
|
@@ -26955,12 +26981,12 @@ function wa(e) {
|
|
|
26955
26981
|
height: t,
|
|
26956
26982
|
weight: n,
|
|
26957
26983
|
italic: r,
|
|
26958
|
-
face:
|
|
26984
|
+
face: Ta(e.bytes(Math.min(32, e.remaining)))
|
|
26959
26985
|
};
|
|
26960
26986
|
}
|
|
26961
|
-
function
|
|
26987
|
+
function Da(e, t, n, r) {
|
|
26962
26988
|
if (t.length === 0) return;
|
|
26963
|
-
let i = e.curFont, a = i?.height || 12, o = Math.abs(
|
|
26989
|
+
let i = e.curFont, a = i?.height || 12, o = Math.abs(pa(e, e.orgY + a) - pa(e, e.orgY));
|
|
26964
26990
|
if (!Number.isFinite(o) || o < 1) return;
|
|
26965
26991
|
let { ctx: s } = e;
|
|
26966
26992
|
try {
|
|
@@ -26968,14 +26994,14 @@ function Ta(e, t, n, r) {
|
|
|
26968
26994
|
let a = i && i.weight >= 700 ? "bold " : "";
|
|
26969
26995
|
s.font = `${i?.italic ? "italic " : ""}${a}${o}px ${i?.face || "sans-serif"}`;
|
|
26970
26996
|
let c = e.textAlign & 6;
|
|
26971
|
-
s.textAlign = c === 2 ? "right" : c === 6 ? "center" : "left", s.textBaseline = (e.textAlign & 24) == 24 ? "alphabetic" : "top", s.fillText(t,
|
|
26997
|
+
s.textAlign = c === 2 ? "right" : c === 6 ? "center" : "left", s.textBaseline = (e.textAlign & 24) == 24 ? "alphabetic" : "top", s.fillText(t, fa(e, n), pa(e, r)), e.drew = !0;
|
|
26972
26998
|
} catch {}
|
|
26973
26999
|
}
|
|
26974
|
-
function
|
|
26975
|
-
if (!
|
|
27000
|
+
function Oa(e, t, n, r, i = !1) {
|
|
27001
|
+
if (!oa(e)) return !1;
|
|
26976
27002
|
let a = 0;
|
|
26977
|
-
(e.length >= 4 ? (e[0] | e[1] << 8 | e[2] << 16 | e[3] << 24) >>> 0 : 0) ===
|
|
26978
|
-
let o = a +
|
|
27003
|
+
(e.length >= 4 ? (e[0] | e[1] << 8 | e[2] << 16 | e[3] << 24) >>> 0 : 0) === ta && (a = na);
|
|
27004
|
+
let o = a + ra;
|
|
26979
27005
|
if (o > e.length) return !1;
|
|
26980
27006
|
let s = {
|
|
26981
27007
|
ctx: t,
|
|
@@ -27000,189 +27026,189 @@ function Ea(e, t, n, r, i = !1) {
|
|
|
27000
27026
|
let t = c.getUint32(o, !0), n = c.getUint16(o + 4, !0);
|
|
27001
27027
|
if (t < 3) break;
|
|
27002
27028
|
let r = t * 2, i = o + r;
|
|
27003
|
-
if (i > e.length || n ===
|
|
27004
|
-
let a = o + 6, l = new
|
|
27029
|
+
if (i > e.length || n === ea.EOF) break;
|
|
27030
|
+
let a = o + 6, l = new da(e, a, i);
|
|
27005
27031
|
switch (n) {
|
|
27006
|
-
case
|
|
27032
|
+
case ea.SETWINDOWORG:
|
|
27007
27033
|
s.orgY = l.i16(), s.orgX = l.i16();
|
|
27008
27034
|
break;
|
|
27009
|
-
case
|
|
27035
|
+
case ea.SETWINDOWEXT: {
|
|
27010
27036
|
let e = l.i16(), t = l.i16();
|
|
27011
27037
|
s.extY = e || 1, s.extX = t || 1, s.haveExt = !0;
|
|
27012
27038
|
break;
|
|
27013
27039
|
}
|
|
27014
|
-
case
|
|
27040
|
+
case ea.SETPOLYFILLMODE:
|
|
27015
27041
|
s.fillRule = l.u16() === 1 ? "evenodd" : "nonzero";
|
|
27016
27042
|
break;
|
|
27017
|
-
case
|
|
27018
|
-
s.textColor =
|
|
27043
|
+
case ea.SETTEXTCOLOR:
|
|
27044
|
+
s.textColor = la(l.u32());
|
|
27019
27045
|
break;
|
|
27020
|
-
case
|
|
27046
|
+
case ea.SETTEXTALIGN:
|
|
27021
27047
|
s.textAlign = l.u16();
|
|
27022
27048
|
break;
|
|
27023
|
-
case
|
|
27024
|
-
|
|
27049
|
+
case ea.CREATEPENINDIRECT:
|
|
27050
|
+
ua(s.objects, Ca(l));
|
|
27025
27051
|
break;
|
|
27026
|
-
case
|
|
27027
|
-
|
|
27052
|
+
case ea.CREATEBRUSHINDIRECT:
|
|
27053
|
+
ua(s.objects, wa(l));
|
|
27028
27054
|
break;
|
|
27029
|
-
case
|
|
27030
|
-
|
|
27055
|
+
case ea.CREATEFONTINDIRECT:
|
|
27056
|
+
ua(s.objects, Ea(l));
|
|
27031
27057
|
break;
|
|
27032
|
-
case
|
|
27058
|
+
case ea.SELECTOBJECT: {
|
|
27033
27059
|
let e = l.u16(), t = s.objects[e];
|
|
27034
27060
|
t?.kind === "pen" ? s.curPen = t : t?.kind === "brush" ? s.curBrush = t : t?.kind === "font" && (s.curFont = t);
|
|
27035
27061
|
break;
|
|
27036
27062
|
}
|
|
27037
|
-
case
|
|
27063
|
+
case ea.DELETEOBJECT: {
|
|
27038
27064
|
let e = l.u16(), t = s.objects[e];
|
|
27039
27065
|
t && (t === s.curPen && (s.curPen = null), t === s.curBrush && (s.curBrush = null), t === s.curFont && (s.curFont = null), s.objects[e] = null);
|
|
27040
27066
|
break;
|
|
27041
27067
|
}
|
|
27042
|
-
case
|
|
27043
|
-
|
|
27068
|
+
case ea.POLYLINE:
|
|
27069
|
+
ba(s, ya(s, l, l.i16()));
|
|
27044
27070
|
break;
|
|
27045
|
-
case
|
|
27046
|
-
|
|
27071
|
+
case ea.POLYGON:
|
|
27072
|
+
xa(s, ya(s, l, l.i16()));
|
|
27047
27073
|
break;
|
|
27048
|
-
case
|
|
27049
|
-
|
|
27074
|
+
case ea.POLYPOLYGON:
|
|
27075
|
+
Sa(s, l);
|
|
27050
27076
|
break;
|
|
27051
|
-
case
|
|
27077
|
+
case ea.RECTANGLE: {
|
|
27052
27078
|
let e = l.i16(), t = l.i16(), n = l.i16(), r = l.i16();
|
|
27053
|
-
|
|
27054
|
-
[
|
|
27055
|
-
[
|
|
27056
|
-
[
|
|
27057
|
-
[
|
|
27079
|
+
xa(s, [
|
|
27080
|
+
[fa(s, r), pa(s, n)],
|
|
27081
|
+
[fa(s, t), pa(s, n)],
|
|
27082
|
+
[fa(s, t), pa(s, e)],
|
|
27083
|
+
[fa(s, r), pa(s, e)]
|
|
27058
27084
|
]);
|
|
27059
27085
|
break;
|
|
27060
27086
|
}
|
|
27061
|
-
case
|
|
27062
|
-
let e = l.u16(), t =
|
|
27087
|
+
case ea.TEXTOUT: {
|
|
27088
|
+
let e = l.u16(), t = Ta(l.bytes(e));
|
|
27063
27089
|
e % 2 != 0 && l.skip(1);
|
|
27064
27090
|
let n = l.i16();
|
|
27065
|
-
|
|
27091
|
+
Da(s, t, l.i16(), n);
|
|
27066
27092
|
break;
|
|
27067
27093
|
}
|
|
27068
|
-
case
|
|
27094
|
+
case ea.STRETCHDIBITS: {
|
|
27069
27095
|
l.u32(), l.i16(), l.i16(), l.i16(), l.i16(), l.u16();
|
|
27070
|
-
let e = l.i16(), t = l.i16(), n = l.i16(), r = l.i16(), o = a + 22, u =
|
|
27096
|
+
let e = l.i16(), t = l.i16(), n = l.i16(), r = l.i16(), o = a + 22, u = Qr(c, o, i - o);
|
|
27071
27097
|
if (u) {
|
|
27072
|
-
let i =
|
|
27073
|
-
|
|
27098
|
+
let i = fa(s, r), a = pa(s, n), o = fa(s, r + t), c = pa(s, n + e);
|
|
27099
|
+
$r(s.ctx, u, i, a, o, c) && (s.drew = !0);
|
|
27074
27100
|
}
|
|
27075
27101
|
break;
|
|
27076
27102
|
}
|
|
27077
|
-
case
|
|
27078
|
-
case
|
|
27079
|
-
case
|
|
27103
|
+
case ea.DIBSTRETCHBLT:
|
|
27104
|
+
case ea.DIBBITBLT:
|
|
27105
|
+
case ea.SETBKMODE: break;
|
|
27080
27106
|
default: break;
|
|
27081
27107
|
}
|
|
27082
27108
|
o = i;
|
|
27083
27109
|
}
|
|
27084
27110
|
return s.drew;
|
|
27085
27111
|
}
|
|
27086
|
-
var
|
|
27087
|
-
function
|
|
27088
|
-
let n = e > 0 ? e : 300, r = t > 0 ? t : 300, i = (e) => Math.max(1, Math.min(
|
|
27112
|
+
var ka = 2e3, Aa = 2;
|
|
27113
|
+
function ja(e, t) {
|
|
27114
|
+
let n = e > 0 ? e : 300, r = t > 0 ? t : 300, i = (e) => Math.max(1, Math.min(ka, Math.round(e)));
|
|
27089
27115
|
return {
|
|
27090
|
-
w: i(n *
|
|
27091
|
-
h: i(r *
|
|
27116
|
+
w: i(n * Aa),
|
|
27117
|
+
h: i(r * Aa)
|
|
27092
27118
|
};
|
|
27093
27119
|
}
|
|
27094
|
-
async function
|
|
27095
|
-
if (!
|
|
27120
|
+
async function Ma(e, t, n, r = !1) {
|
|
27121
|
+
if (!oa(e) || t <= 0 || n <= 0) return null;
|
|
27096
27122
|
let i = It(t, n);
|
|
27097
27123
|
if (!i) return null;
|
|
27098
27124
|
let a = i.getContext("2d");
|
|
27099
|
-
return !a || (a.lineJoin = "round", a.lineCap = "round", !
|
|
27125
|
+
return !a || (a.lineJoin = "round", a.lineCap = "round", !Oa(e, a, t, n, r)) ? null : createImageBitmap(i);
|
|
27100
27126
|
}
|
|
27101
|
-
async function
|
|
27127
|
+
async function Na(e, t = {}) {
|
|
27102
27128
|
let { widthPt: n = 0, heightPt: r = 0, suppressBoundaryFrame: i = !1 } = t, a = new Uint8Array(await e.slice(0, 64 * 1024).arrayBuffer());
|
|
27103
|
-
if (
|
|
27104
|
-
let { w: t, h: a } =
|
|
27105
|
-
return
|
|
27129
|
+
if (oa(a)) {
|
|
27130
|
+
let { w: t, h: a } = ja(n, r);
|
|
27131
|
+
return Ma(new Uint8Array(await e.arrayBuffer()), t, a, i);
|
|
27106
27132
|
}
|
|
27107
|
-
if (
|
|
27108
|
-
let { w: t, h: i } =
|
|
27109
|
-
return
|
|
27133
|
+
if (sa(a)) {
|
|
27134
|
+
let { w: t, h: i } = ja(n, r);
|
|
27135
|
+
return Ui(new Uint8Array(await e.arrayBuffer()), t, i);
|
|
27110
27136
|
}
|
|
27111
|
-
return
|
|
27137
|
+
return $i(a) ? null : createImageBitmap(e);
|
|
27112
27138
|
}
|
|
27113
27139
|
//#endregion
|
|
27114
27140
|
//#region packages/core/src/image/bitmap-image-by-path.ts
|
|
27115
|
-
var
|
|
27116
|
-
function
|
|
27117
|
-
let t =
|
|
27118
|
-
return t || (t = /* @__PURE__ */ new Map(),
|
|
27141
|
+
var Pa = 256, Fa = /* @__PURE__ */ new WeakMap();
|
|
27142
|
+
function Ia(e) {
|
|
27143
|
+
let t = Fa.get(e);
|
|
27144
|
+
return t || (t = /* @__PURE__ */ new Map(), Fa.set(e, t)), t;
|
|
27119
27145
|
}
|
|
27120
|
-
var
|
|
27121
|
-
function
|
|
27122
|
-
!e ||
|
|
27146
|
+
var La = /* @__PURE__ */ new WeakMap(), Ra = /* @__PURE__ */ new WeakSet();
|
|
27147
|
+
function za(e) {
|
|
27148
|
+
!e || Ra.has(e) || (Ra.add(e), e.close());
|
|
27123
27149
|
}
|
|
27124
|
-
function
|
|
27125
|
-
let t =
|
|
27150
|
+
function Ba(e) {
|
|
27151
|
+
let t = La.get(e);
|
|
27126
27152
|
t || (t = {
|
|
27127
27153
|
count: 0,
|
|
27128
27154
|
deferred: []
|
|
27129
|
-
},
|
|
27155
|
+
}, La.set(e, t));
|
|
27130
27156
|
let n = t;
|
|
27131
27157
|
n.count++;
|
|
27132
27158
|
let r = !1;
|
|
27133
27159
|
return () => {
|
|
27134
27160
|
if (!r && (r = !0, n.count--, !(n.count > 0))) {
|
|
27135
|
-
for (let e of n.deferred) e.then((e) =>
|
|
27136
|
-
n.deferred = [],
|
|
27161
|
+
for (let e of n.deferred) e.then((e) => za(e)).catch(() => {});
|
|
27162
|
+
n.deferred = [], La.delete(e);
|
|
27137
27163
|
}
|
|
27138
27164
|
};
|
|
27139
27165
|
}
|
|
27140
|
-
function
|
|
27141
|
-
let n =
|
|
27166
|
+
function Va(e, t) {
|
|
27167
|
+
let n = La.get(e);
|
|
27142
27168
|
if (n && n.count > 0) {
|
|
27143
27169
|
n.deferred.push(t);
|
|
27144
27170
|
return;
|
|
27145
27171
|
}
|
|
27146
|
-
t.then((e) =>
|
|
27172
|
+
t.then((e) => za(e)).catch(() => {});
|
|
27147
27173
|
}
|
|
27148
|
-
function
|
|
27149
|
-
let { widthPt: i = 0, heightPt: a = 0, suppressBoundaryFrame: o = !1 } = r, s =
|
|
27174
|
+
function Ha(e, t, n, r = {}) {
|
|
27175
|
+
let { widthPt: i = 0, heightPt: a = 0, suppressBoundaryFrame: o = !1 } = r, s = Ia(n), c = s.get(e);
|
|
27150
27176
|
if (c) return s.delete(e), s.set(e, c), c.promise;
|
|
27151
|
-
let l = n(e, t).then((e) =>
|
|
27177
|
+
let l = n(e, t).then((e) => Na(e, {
|
|
27152
27178
|
widthPt: i,
|
|
27153
27179
|
heightPt: a,
|
|
27154
27180
|
suppressBoundaryFrame: o
|
|
27155
27181
|
})), u = { promise: l };
|
|
27156
27182
|
if (l.then((e) => {
|
|
27157
27183
|
u.bitmap = e;
|
|
27158
|
-
}).catch(() => {}), l.catch(() => s.delete(e)), s.set(e, u), s.size >
|
|
27184
|
+
}).catch(() => {}), l.catch(() => s.delete(e)), s.set(e, u), s.size > Pa) {
|
|
27159
27185
|
let e = s.keys().next().value, t = s.get(e);
|
|
27160
|
-
s.delete(e), t &&
|
|
27186
|
+
s.delete(e), t && Va(n, t.promise);
|
|
27161
27187
|
}
|
|
27162
27188
|
return l;
|
|
27163
27189
|
}
|
|
27164
|
-
function
|
|
27165
|
-
return
|
|
27190
|
+
function Ua(e, t) {
|
|
27191
|
+
return Fa.get(t)?.get(e)?.bitmap;
|
|
27166
27192
|
}
|
|
27167
|
-
function
|
|
27168
|
-
let t =
|
|
27193
|
+
function Wa(e) {
|
|
27194
|
+
let t = Fa.get(e);
|
|
27169
27195
|
if (t) {
|
|
27170
|
-
for (let n of t.values())
|
|
27171
|
-
t.clear(),
|
|
27196
|
+
for (let n of t.values()) Va(e, n.promise);
|
|
27197
|
+
t.clear(), Fa.delete(e);
|
|
27172
27198
|
}
|
|
27173
27199
|
}
|
|
27174
27200
|
//#endregion
|
|
27175
27201
|
//#region packages/core/src/image/crop.ts
|
|
27176
|
-
function
|
|
27202
|
+
function Ga(e) {
|
|
27177
27203
|
let t = e;
|
|
27178
27204
|
return {
|
|
27179
27205
|
w: t.naturalWidth || (typeof t.width == "number" ? t.width : 0) || 0,
|
|
27180
27206
|
h: t.naturalHeight || (typeof t.height == "number" ? t.height : 0) || 0
|
|
27181
27207
|
};
|
|
27182
27208
|
}
|
|
27183
|
-
function
|
|
27209
|
+
function Ka(e, t) {
|
|
27184
27210
|
if (!t || !(t.l || t.t || t.r || t.b)) return null;
|
|
27185
|
-
let { w: n, h: r } =
|
|
27211
|
+
let { w: n, h: r } = Ga(e);
|
|
27186
27212
|
if (n <= 0 || r <= 0) return null;
|
|
27187
27213
|
let i = (e) => Math.max(0, Math.min(1, e)), a = i(t.l) * n, o = i(t.t) * r;
|
|
27188
27214
|
return {
|
|
@@ -27192,12 +27218,12 @@ function Wa(e, t) {
|
|
|
27192
27218
|
sh: Math.max(1, r - o - i(t.b) * r)
|
|
27193
27219
|
};
|
|
27194
27220
|
}
|
|
27195
|
-
function
|
|
27196
|
-
let s =
|
|
27221
|
+
function qa(e, t, n, r, i, a, o) {
|
|
27222
|
+
let s = Ka(t, n);
|
|
27197
27223
|
s ? e.drawImage(t, s.sx, s.sy, s.sw, s.sh, r, i, a, o) : e.drawImage(t, r, i, a, o);
|
|
27198
27224
|
}
|
|
27199
|
-
function
|
|
27200
|
-
if (!t || !
|
|
27225
|
+
function Ja(e, t, n, r) {
|
|
27226
|
+
if (!t || !ca(e)) return {
|
|
27201
27227
|
widthPt: n,
|
|
27202
27228
|
heightPt: r
|
|
27203
27229
|
};
|
|
@@ -27209,32 +27235,32 @@ function Ka(e, t, n, r) {
|
|
|
27209
27235
|
}
|
|
27210
27236
|
//#endregion
|
|
27211
27237
|
//#region packages/core/src/image/duotone.ts
|
|
27212
|
-
function
|
|
27238
|
+
function Ya(e) {
|
|
27213
27239
|
return /^[0-9a-fA-F]{6}$/.test(e) ? [
|
|
27214
27240
|
parseInt(e.slice(0, 2), 16),
|
|
27215
27241
|
parseInt(e.slice(2, 4), 16),
|
|
27216
27242
|
parseInt(e.slice(4, 6), 16)
|
|
27217
27243
|
] : null;
|
|
27218
27244
|
}
|
|
27219
|
-
function
|
|
27245
|
+
function Xa(e, t, n) {
|
|
27220
27246
|
return (.299 * e + .587 * t + .114 * n) / 255;
|
|
27221
27247
|
}
|
|
27222
|
-
function
|
|
27223
|
-
let r =
|
|
27248
|
+
function Za(e, t, n) {
|
|
27249
|
+
let r = Ya(t), i = Ya(n);
|
|
27224
27250
|
if (!r || !i) return e;
|
|
27225
27251
|
let [a, o, s] = r, [c, l, u] = i, d = e.data;
|
|
27226
27252
|
for (let e = 0; e < d.length; e += 4) {
|
|
27227
27253
|
if (d[e + 3] === 0) continue;
|
|
27228
|
-
let t =
|
|
27254
|
+
let t = Xa(d[e], d[e + 1], d[e + 2]);
|
|
27229
27255
|
d[e] = Math.round(a + (c - a) * t), d[e + 1] = Math.round(o + (l - o) * t), d[e + 2] = Math.round(s + (u - s) * t);
|
|
27230
27256
|
}
|
|
27231
27257
|
return e;
|
|
27232
27258
|
}
|
|
27233
|
-
var
|
|
27234
|
-
async function
|
|
27259
|
+
var Qa = (e, t) => typeof OffscreenCanvas > "u" ? null : new OffscreenCanvas(e, t);
|
|
27260
|
+
async function $a(e, t, n) {
|
|
27235
27261
|
let { width: r, height: i } = n;
|
|
27236
27262
|
if (r <= 0 || i <= 0 || typeof createImageBitmap > "u") return e;
|
|
27237
|
-
let a = (n.offscreenFactory ??
|
|
27263
|
+
let a = (n.offscreenFactory ?? Qa)(r, i);
|
|
27238
27264
|
if (!a) return e;
|
|
27239
27265
|
let o = a.getContext("2d");
|
|
27240
27266
|
if (!o) return e;
|
|
@@ -27245,22 +27271,22 @@ async function Za(e, t, n) {
|
|
|
27245
27271
|
} catch {
|
|
27246
27272
|
return e;
|
|
27247
27273
|
}
|
|
27248
|
-
return
|
|
27274
|
+
return Za(s, t.clr1, t.clr2), o.putImageData(s, 0, 0), createImageBitmap(a);
|
|
27249
27275
|
}
|
|
27250
27276
|
//#endregion
|
|
27251
27277
|
//#region packages/core/src/image/blip-gate.ts
|
|
27252
|
-
function
|
|
27278
|
+
function eo(e) {
|
|
27253
27279
|
return e.svgImagePath != null && e.srcRect == null;
|
|
27254
27280
|
}
|
|
27255
27281
|
//#endregion
|
|
27256
27282
|
//#region packages/core/src/math/mathml.ts
|
|
27257
|
-
var
|
|
27283
|
+
var to = {
|
|
27258
27284
|
"&": "&",
|
|
27259
27285
|
"<": "<",
|
|
27260
27286
|
">": ">",
|
|
27261
27287
|
"\"": """
|
|
27262
|
-
},
|
|
27263
|
-
function
|
|
27288
|
+
}, no = (e) => e.replace(/[&<>"]/g, (e) => to[e]);
|
|
27289
|
+
function ro(e) {
|
|
27264
27290
|
switch (e) {
|
|
27265
27291
|
case "roman": return "normal";
|
|
27266
27292
|
case "bold": return "bold";
|
|
@@ -27268,10 +27294,10 @@ function to(e) {
|
|
|
27268
27294
|
case "italic": return null;
|
|
27269
27295
|
}
|
|
27270
27296
|
}
|
|
27271
|
-
var
|
|
27272
|
-
function
|
|
27273
|
-
let n =
|
|
27274
|
-
a &&= (i += `<mn${r}>${
|
|
27297
|
+
var io = new Set([..."⏞⏟⎴⎵︷︸⏜⏝{}[]()¯_‾"]), ao = "+−±∓×÷·∗⋅∘∙*/", oo = "=≠<>≤≥≈≡∼≅≃→←↔⇒∈∉⊂⊆⊃⊇∝≪≫⊥≔", so = "([{⟨⌈⌊", co = ")]}⟩⌉⌋", lo = ",;";
|
|
27298
|
+
function uo(e, t) {
|
|
27299
|
+
let n = ro(t), r = n ? ` mathvariant="${n}"` : "", i = "", a = "", o = () => {
|
|
27300
|
+
a &&= (i += `<mn${r}>${no(a)}</mn>`, "");
|
|
27275
27301
|
};
|
|
27276
27302
|
for (let t of e) {
|
|
27277
27303
|
if (t === " ") {
|
|
@@ -27282,56 +27308,56 @@ function co(e, t) {
|
|
|
27282
27308
|
a += t;
|
|
27283
27309
|
continue;
|
|
27284
27310
|
}
|
|
27285
|
-
o(),
|
|
27311
|
+
o(), ao.includes(t) || oo.includes(t) || lo.includes(t) ? i += `<mo>${no(t)}</mo>` : so.includes(t) || co.includes(t) ? i += `<mo fence="true" stretchy="false">${no(t)}</mo>` : i += `<mi${r}>${no(t)}</mi>`;
|
|
27286
27312
|
}
|
|
27287
27313
|
return o(), i;
|
|
27288
27314
|
}
|
|
27289
|
-
function
|
|
27290
|
-
return e.map(
|
|
27315
|
+
function fo(e) {
|
|
27316
|
+
return e.map(po).join("");
|
|
27291
27317
|
}
|
|
27292
27318
|
function $(e) {
|
|
27293
|
-
return `<mrow>${
|
|
27319
|
+
return `<mrow>${fo(e)}</mrow>`;
|
|
27294
27320
|
}
|
|
27295
|
-
function
|
|
27321
|
+
function po(e) {
|
|
27296
27322
|
switch (e.kind) {
|
|
27297
|
-
case "run": return
|
|
27323
|
+
case "run": return uo(e.text, e.style);
|
|
27298
27324
|
case "group": return $(e.items);
|
|
27299
27325
|
case "fraction": return `<mfrac${e.bar === !1 ? " linethickness=\"0\"" : ""}>${$(e.num)}${$(e.den)}</mfrac>`;
|
|
27300
27326
|
case "sup": return `<msup>${$(e.base)}${$(e.sup ?? [])}</msup>`;
|
|
27301
27327
|
case "sub": return `<msub>${$(e.base)}${$(e.sub ?? [])}</msub>`;
|
|
27302
27328
|
case "subSup": return `<msubsup>${$(e.base)}${$(e.sub ?? [])}${$(e.sup ?? [])}</msubsup>`;
|
|
27303
|
-
case "nary": return
|
|
27304
|
-
case "delimiter": return
|
|
27305
|
-
case "radical": return e.index && e.index.length ? `<mroot>${$(e.radicand)}${$(e.index)}</mroot>` : `<msqrt>${
|
|
27306
|
-
case "limit": return
|
|
27307
|
-
case "array": return
|
|
27329
|
+
case "nary": return So(e);
|
|
27330
|
+
case "delimiter": return Co(e);
|
|
27331
|
+
case "radical": return e.index && e.index.length ? `<mroot>${$(e.radicand)}${$(e.index)}</mroot>` : `<msqrt>${fo(e.radicand)}</msqrt>`;
|
|
27332
|
+
case "limit": return yo(e);
|
|
27333
|
+
case "array": return bo(e);
|
|
27308
27334
|
case "groupChr": {
|
|
27309
|
-
let t = $(e.base), n =
|
|
27335
|
+
let t = $(e.base), n = io.has(e.char), r = e.pos === "top" ? "mover" : "munder", i = `<mo stretchy="${n}">${no(e.char)}</mo>`;
|
|
27310
27336
|
return n ? `<${r}>${t}${i}</${r}>` : `<${r} accent="true">${t}${i}</${r}>`;
|
|
27311
27337
|
}
|
|
27312
27338
|
case "bar": {
|
|
27313
27339
|
let t = $(e.base), n = "<mo stretchy=\"true\">―</mo>";
|
|
27314
27340
|
return e.pos === "bot" ? `<munder>${t}${n}</munder>` : `<mover>${t}${n}</mover>`;
|
|
27315
27341
|
}
|
|
27316
|
-
case "accent": return
|
|
27342
|
+
case "accent": return vo(e);
|
|
27317
27343
|
case "func": return `<mrow>${$(e.name)}<mo>⁡</mo>${$(e.arg)}</mrow>`;
|
|
27318
|
-
case "phant": return
|
|
27344
|
+
case "phant": return mo(e);
|
|
27319
27345
|
case "sPre": return `<mmultiscripts>${$(e.base)}<mprescripts/>${$(e.sub)}${$(e.sup)}</mmultiscripts>`;
|
|
27320
27346
|
case "box": return $(e.base);
|
|
27321
|
-
case "borderBox": return
|
|
27347
|
+
case "borderBox": return ho(e);
|
|
27322
27348
|
}
|
|
27323
27349
|
}
|
|
27324
|
-
function
|
|
27325
|
-
let t = e.show ?
|
|
27350
|
+
function mo(e) {
|
|
27351
|
+
let t = e.show ? fo(e.base) : `<mphantom>${fo(e.base)}</mphantom>`, n = [];
|
|
27326
27352
|
return e.zeroWid && n.push("width=\"0\""), e.zeroAsc && n.push("height=\"0\""), e.zeroDesc && n.push("depth=\"0\""), n.length ? `<mpadded ${n.join(" ")}>${t}</mpadded>` : `<mrow>${t}</mrow>`;
|
|
27327
27353
|
}
|
|
27328
|
-
function
|
|
27354
|
+
function ho(e) {
|
|
27329
27355
|
let t = [], n = !e.hideTop, r = !e.hideBot, i = !e.hideLeft, a = !e.hideRight;
|
|
27330
27356
|
n && r && i && a ? t.push("box") : (n && t.push("top"), r && t.push("bottom"), i && t.push("left"), a && t.push("right")), e.strikeH && t.push("horizontalstrike"), e.strikeV && t.push("verticalstrike"), e.strikeBltr && t.push("updiagonalstrike"), e.strikeTlbr && t.push("downdiagonalstrike");
|
|
27331
|
-
let o =
|
|
27357
|
+
let o = fo(e.base);
|
|
27332
27358
|
return t.length ? `<menclose notation="${t.join(" ")}">${o}</menclose>` : `<mrow>${o}</mrow>`;
|
|
27333
27359
|
}
|
|
27334
|
-
var
|
|
27360
|
+
var go = {
|
|
27335
27361
|
"̀": "`",
|
|
27336
27362
|
"́": "´",
|
|
27337
27363
|
"̂": "^",
|
|
@@ -27342,7 +27368,7 @@ var mo = {
|
|
|
27342
27368
|
"̌": "ˇ",
|
|
27343
27369
|
"⃗": "→",
|
|
27344
27370
|
"⃖": "←"
|
|
27345
|
-
},
|
|
27371
|
+
}, _o = new Set([
|
|
27346
27372
|
"̅",
|
|
27347
27373
|
"̄",
|
|
27348
27374
|
"¯",
|
|
@@ -27350,53 +27376,53 @@ var mo = {
|
|
|
27350
27376
|
"̲",
|
|
27351
27377
|
"̳"
|
|
27352
27378
|
]);
|
|
27353
|
-
function
|
|
27379
|
+
function vo(e) {
|
|
27354
27380
|
let t = $(e.base);
|
|
27355
|
-
if (
|
|
27356
|
-
let n =
|
|
27357
|
-
return `<mover accent="true">${t}<mo stretchy="${n === "→" || n === "←" ? "true" : "false"}">${
|
|
27381
|
+
if (_o.has(e.char)) return `<mover>${t}<mo stretchy="true">―</mo></mover>`;
|
|
27382
|
+
let n = go[e.char] ?? e.char;
|
|
27383
|
+
return `<mover accent="true">${t}<mo stretchy="${n === "→" || n === "←" ? "true" : "false"}">${no(n)}</mo></mover>`;
|
|
27358
27384
|
}
|
|
27359
|
-
function
|
|
27385
|
+
function yo(e) {
|
|
27360
27386
|
let t = $(e.base), n = e.lower && e.lower.length ? $(e.lower) : null, r = e.upper && e.upper.length ? $(e.upper) : null;
|
|
27361
27387
|
return n && r ? `<munderover>${t}${n}${r}</munderover>` : n ? `<munder>${t}${n}</munder>` : r ? `<mover>${t}${r}</mover>` : t;
|
|
27362
27388
|
}
|
|
27363
|
-
function
|
|
27389
|
+
function bo(e) {
|
|
27364
27390
|
let t = Math.max(1, ...e.rows.map((e) => e.length)), n;
|
|
27365
27391
|
n = e.align === "eq" ? Array.from({ length: t }, (e, t) => t % 2 == 0 ? "right" : "left").join(" ") : e.align === "left" ? "left" : "center";
|
|
27366
|
-
let r = e.rows.map((e) => `<mtr>${e.map((e) => `<mtd>${
|
|
27392
|
+
let r = e.rows.map((e) => `<mtr>${e.map((e) => `<mtd>${fo(e)}</mtd>`).join("")}</mtr>`).join("");
|
|
27367
27393
|
return `<mtable columnalign="${n}" rowspacing="0.2em" columnspacing="0.3em">${r}</mtable>`;
|
|
27368
27394
|
}
|
|
27369
|
-
var
|
|
27370
|
-
function
|
|
27371
|
-
let t = e.limLoc === "subSup" ? !0 : e.limLoc === "undOvr" ? !1 :
|
|
27372
|
-
return a = t ? r.length && i.length ? `<msubsup>${n}${$(r)}${$(i)}</msubsup>` : r.length ? `<msub>${n}${$(r)}</msub>` : i.length ? `<msup>${n}${$(i)}</msup>` : n : r.length && i.length ? `<munderover>${n}${$(r)}${$(i)}</munderover>` : r.length ? `<munder>${n}${$(r)}</munder>` : i.length ? `<mover>${n}${$(i)}</mover>` : n, `<mrow>${a}${
|
|
27395
|
+
var xo = new Set([..."∫∬∭∮∯∰∱∲∳⨌⨍⨎⨏⨐⨑⨒⨓⨔⨕⨖⨗"]);
|
|
27396
|
+
function So(e) {
|
|
27397
|
+
let t = e.limLoc === "subSup" ? !0 : e.limLoc === "undOvr" ? !1 : xo.has(e.op), n = `<mo largeop="true">${no(e.op)}</mo>`, r = e.sub ?? [], i = e.sup ?? [], a;
|
|
27398
|
+
return a = t ? r.length && i.length ? `<msubsup>${n}${$(r)}${$(i)}</msubsup>` : r.length ? `<msub>${n}${$(r)}</msub>` : i.length ? `<msup>${n}${$(i)}</msup>` : n : r.length && i.length ? `<munderover>${n}${$(r)}${$(i)}</munderover>` : r.length ? `<munder>${n}${$(r)}</munder>` : i.length ? `<mover>${n}${$(i)}</mover>` : n, `<mrow>${a}${fo(e.body)}</mrow>`;
|
|
27373
27399
|
}
|
|
27374
|
-
function
|
|
27375
|
-
let t = (e) => `<mo fence="true" stretchy="true">${
|
|
27400
|
+
function Co(e) {
|
|
27401
|
+
let t = (e) => `<mo fence="true" stretchy="true">${no(e)}</mo>`, n = e.items.map((e) => $(e)).join("<mo separator=\"true\">,</mo>");
|
|
27376
27402
|
return `<mrow>${t(e.begChar)}${n}${t(e.endChar)}</mrow>`;
|
|
27377
27403
|
}
|
|
27378
|
-
function
|
|
27379
|
-
return `<math xmlns="http://www.w3.org/1998/Math/MathML" display="${t ? "block" : "inline"}">${
|
|
27404
|
+
function wo(e, t) {
|
|
27405
|
+
return `<math xmlns="http://www.w3.org/1998/Math/MathML" display="${t ? "block" : "inline"}">${fo(e)}</math>`;
|
|
27380
27406
|
}
|
|
27381
27407
|
//#endregion
|
|
27382
27408
|
//#region packages/core/src/canvas/env.ts
|
|
27383
|
-
function
|
|
27409
|
+
function To(e) {
|
|
27384
27410
|
return typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement;
|
|
27385
27411
|
}
|
|
27386
|
-
function
|
|
27412
|
+
function Eo(e = 1) {
|
|
27387
27413
|
return typeof window < "u" && window.devicePixelRatio || e;
|
|
27388
27414
|
}
|
|
27389
27415
|
//#endregion
|
|
27390
27416
|
//#region packages/core/src/canvas/crisp.ts
|
|
27391
|
-
function
|
|
27417
|
+
function Do(e, t, n) {
|
|
27392
27418
|
let r = Math.round(t * n) % 2 == 1 ? .5 : 0, i = e * n;
|
|
27393
27419
|
return (Math.round(i - r) + r) / n - e;
|
|
27394
27420
|
}
|
|
27395
27421
|
//#endregion
|
|
27396
27422
|
//#region packages/core/src/canvas/clamp.ts
|
|
27397
|
-
var
|
|
27398
|
-
function
|
|
27399
|
-
let n = Number.isFinite(e) && e > 0 ? Math.max(1, Math.round(e)) : 1, r = Number.isFinite(t) && t > 0 ? Math.max(1, Math.round(t)) : 1, i = Math.min(1,
|
|
27423
|
+
var Oo = 32767, ko = 1 << 24;
|
|
27424
|
+
function Ao(e, t) {
|
|
27425
|
+
let n = Number.isFinite(e) && e > 0 ? Math.max(1, Math.round(e)) : 1, r = Number.isFinite(t) && t > 0 ? Math.max(1, Math.round(t)) : 1, i = Math.min(1, Oo / n, Oo / r), a = n * r, o = a > 16777216 ? Math.sqrt(ko / a) : 1, s = Math.min(i, o);
|
|
27400
27426
|
return s >= 1 ? {
|
|
27401
27427
|
width: n,
|
|
27402
27428
|
height: r,
|
|
@@ -27411,11 +27437,11 @@ function Oo(e, t) {
|
|
|
27411
27437
|
}
|
|
27412
27438
|
//#endregion
|
|
27413
27439
|
//#region packages/core/src/worker/bridge.ts
|
|
27414
|
-
function
|
|
27440
|
+
function jo() {
|
|
27415
27441
|
let e = /* @__PURE__ */ Error("worker request aborted");
|
|
27416
27442
|
return e.name = "AbortError", e;
|
|
27417
27443
|
}
|
|
27418
|
-
var
|
|
27444
|
+
var Mo = class {
|
|
27419
27445
|
_worker;
|
|
27420
27446
|
_opts;
|
|
27421
27447
|
_pending = /* @__PURE__ */ new Map();
|
|
@@ -27451,7 +27477,7 @@ var Ao = class {
|
|
|
27451
27477
|
let r = this._nextId++, i = n?.timeoutMs ?? this._opts.timeoutMs, a = n?.signal;
|
|
27452
27478
|
return new Promise((n, o) => {
|
|
27453
27479
|
if (a?.aborted) {
|
|
27454
|
-
o(
|
|
27480
|
+
o(jo());
|
|
27455
27481
|
return;
|
|
27456
27482
|
}
|
|
27457
27483
|
let s, c;
|
|
@@ -27466,7 +27492,7 @@ var Ao = class {
|
|
|
27466
27492
|
e && (this._pending.delete(r), e.cleanup(), e.reject(/* @__PURE__ */ Error(`worker request timed out after ${i}ms`)));
|
|
27467
27493
|
}, i)), a && (c = () => {
|
|
27468
27494
|
let e = this._pending.get(r);
|
|
27469
|
-
e && (this._pending.delete(r), e.cleanup(), e.reject(
|
|
27495
|
+
e && (this._pending.delete(r), e.cleanup(), e.reject(jo()));
|
|
27470
27496
|
}, a.addEventListener("abort", c)), this._worker.postMessage(e(r), t);
|
|
27471
27497
|
});
|
|
27472
27498
|
}
|
|
@@ -27476,7 +27502,7 @@ var Ao = class {
|
|
|
27476
27502
|
terminate() {
|
|
27477
27503
|
this._worker.removeEventListener("message", this._handle), this._worker.removeEventListener("messageerror", this._handleWorkerError), this._worker.removeEventListener("error", this._handleWorkerError), this._worker.terminate(), this._rejectAll(/* @__PURE__ */ Error("Worker terminated"));
|
|
27478
27504
|
}
|
|
27479
|
-
},
|
|
27505
|
+
}, No = [
|
|
27480
27506
|
"L",
|
|
27481
27507
|
"R",
|
|
27482
27508
|
"AL",
|
|
@@ -27500,7 +27526,7 @@ var Ao = class {
|
|
|
27500
27526
|
"RLI",
|
|
27501
27527
|
"FSI",
|
|
27502
27528
|
"PDI"
|
|
27503
|
-
],
|
|
27529
|
+
], Po = [
|
|
27504
27530
|
0,
|
|
27505
27531
|
9,
|
|
27506
27532
|
10,
|
|
@@ -28768,7 +28794,7 @@ var Ao = class {
|
|
|
28768
28794
|
1048574,
|
|
28769
28795
|
1048576,
|
|
28770
28796
|
1114110
|
|
28771
|
-
],
|
|
28797
|
+
], Fo = [
|
|
28772
28798
|
9,
|
|
28773
28799
|
11,
|
|
28774
28800
|
10,
|
|
@@ -30036,7 +30062,7 @@ var Ao = class {
|
|
|
30036
30062
|
9,
|
|
30037
30063
|
0,
|
|
30038
30064
|
9
|
|
30039
|
-
],
|
|
30065
|
+
], Io = [
|
|
30040
30066
|
40,
|
|
30041
30067
|
41,
|
|
30042
30068
|
41,
|
|
@@ -30893,7 +30919,7 @@ var Ao = class {
|
|
|
30893
30919
|
65379,
|
|
30894
30920
|
65379,
|
|
30895
30921
|
65378
|
|
30896
|
-
],
|
|
30922
|
+
], Lo = [
|
|
30897
30923
|
40,
|
|
30898
30924
|
41,
|
|
30899
30925
|
0,
|
|
@@ -31281,42 +31307,42 @@ var Ao = class {
|
|
|
31281
31307
|
];
|
|
31282
31308
|
//#endregion
|
|
31283
31309
|
//#region packages/core/src/text/bidi/char-data.ts
|
|
31284
|
-
function
|
|
31285
|
-
let t = 0, n =
|
|
31310
|
+
function Ro(e) {
|
|
31311
|
+
let t = 0, n = Po.length - 1;
|
|
31286
31312
|
for (; t < n;) {
|
|
31287
31313
|
let r = t + n + 1 >> 1;
|
|
31288
|
-
|
|
31314
|
+
Po[r] <= e ? t = r : n = r - 1;
|
|
31289
31315
|
}
|
|
31290
|
-
return
|
|
31316
|
+
return Fo[t];
|
|
31291
31317
|
}
|
|
31292
|
-
function
|
|
31293
|
-
return
|
|
31318
|
+
function zo(e) {
|
|
31319
|
+
return No[Ro(e)];
|
|
31294
31320
|
}
|
|
31295
|
-
var
|
|
31321
|
+
var Bo = (() => {
|
|
31296
31322
|
let e = /* @__PURE__ */ new Map();
|
|
31297
|
-
for (let t = 0; t <
|
|
31323
|
+
for (let t = 0; t < Io.length; t += 2) e.set(Io[t], Io[t + 1]);
|
|
31298
31324
|
return e;
|
|
31299
31325
|
})();
|
|
31300
|
-
function
|
|
31301
|
-
return
|
|
31326
|
+
function Vo(e) {
|
|
31327
|
+
return Bo.get(e) ?? null;
|
|
31302
31328
|
}
|
|
31303
|
-
var
|
|
31329
|
+
var Ho = (() => {
|
|
31304
31330
|
let e = /* @__PURE__ */ new Map();
|
|
31305
|
-
for (let t = 0; t <
|
|
31306
|
-
pair:
|
|
31307
|
-
type:
|
|
31331
|
+
for (let t = 0; t < Lo.length; t += 3) e.set(Lo[t], {
|
|
31332
|
+
pair: Lo[t + 1],
|
|
31333
|
+
type: Lo[t + 2] === 0 ? "o" : "c"
|
|
31308
31334
|
});
|
|
31309
31335
|
return e;
|
|
31310
31336
|
})();
|
|
31311
|
-
function
|
|
31312
|
-
return
|
|
31337
|
+
function Uo(e) {
|
|
31338
|
+
return Ho.get(e) ?? null;
|
|
31313
31339
|
}
|
|
31314
|
-
var
|
|
31315
|
-
function
|
|
31340
|
+
var Wo = (e) => e === "RLE" || e === "LRE" || e === "RLO" || e === "LRO" || e === "PDF" || e === "BN", Go = (e) => e === "LRI" || e === "RLI" || e === "FSI", Ko = (e) => e === "B" || e === "S" || e === "WS" || e === "ON" || e === "FSI" || e === "LRI" || e === "RLI" || e === "PDI", qo = (e) => e & 1 ? e + 2 : e + 1, Jo = (e) => e & 1 ? e + 1 : e + 2;
|
|
31341
|
+
function Yo(e, t, n) {
|
|
31316
31342
|
let r = 0;
|
|
31317
31343
|
for (let i = t; i < n; i++) {
|
|
31318
31344
|
let t = e[i];
|
|
31319
|
-
if (
|
|
31345
|
+
if (Go(t)) r++;
|
|
31320
31346
|
else if (t === "PDI") r > 0 && r--;
|
|
31321
31347
|
else if (r === 0) {
|
|
31322
31348
|
if (t === "L") return 0;
|
|
@@ -31325,11 +31351,11 @@ function qo(e, t, n) {
|
|
|
31325
31351
|
}
|
|
31326
31352
|
return 0;
|
|
31327
31353
|
}
|
|
31328
|
-
function
|
|
31354
|
+
function Xo(e) {
|
|
31329
31355
|
let t = e.length, n = new Int32Array(t).fill(t), r = new Int32Array(t).fill(-1), i = [];
|
|
31330
31356
|
for (let a = 0; a < t; a++) {
|
|
31331
31357
|
let t = e[a];
|
|
31332
|
-
if (
|
|
31358
|
+
if (Go(t)) i.push(a);
|
|
31333
31359
|
else if (t === "PDI" && i.length) {
|
|
31334
31360
|
let e = i.pop();
|
|
31335
31361
|
n[e] = a, r[a] = e;
|
|
@@ -31340,7 +31366,7 @@ function Jo(e) {
|
|
|
31340
31366
|
initOf: r
|
|
31341
31367
|
};
|
|
31342
31368
|
}
|
|
31343
|
-
function
|
|
31369
|
+
function Zo(e, t, n) {
|
|
31344
31370
|
let r = e.length, i = Array(r).fill(t), a = e.slice(), o = [{
|
|
31345
31371
|
level: t,
|
|
31346
31372
|
override: "neutral",
|
|
@@ -31354,7 +31380,7 @@ function Yo(e, t, n) {
|
|
|
31354
31380
|
case "RLO":
|
|
31355
31381
|
case "LRO": {
|
|
31356
31382
|
i[d] = u().level;
|
|
31357
|
-
let e = r === "RLE" || r === "RLO" ?
|
|
31383
|
+
let e = r === "RLE" || r === "RLO" ? qo(u().level) : Jo(u().level);
|
|
31358
31384
|
e <= 125 && s === 0 && c === 0 ? o.push({
|
|
31359
31385
|
level: e,
|
|
31360
31386
|
override: r === "RLO" ? "R" : r === "LRO" ? "L" : "neutral",
|
|
@@ -31369,8 +31395,8 @@ function Yo(e, t, n) {
|
|
|
31369
31395
|
let t = u().override;
|
|
31370
31396
|
t !== "neutral" && (a[d] = t);
|
|
31371
31397
|
let f;
|
|
31372
|
-
f = r === "RLI" ? "R" : r === "LRI" ? "L" :
|
|
31373
|
-
let p = f === "R" ?
|
|
31398
|
+
f = r === "RLI" ? "R" : r === "LRI" ? "L" : Yo(e, d + 1, n[d]) === 1 ? "R" : "L";
|
|
31399
|
+
let p = f === "R" ? qo(u().level) : Jo(u().level);
|
|
31374
31400
|
p <= 125 && s === 0 && c === 0 ? (l++, o.push({
|
|
31375
31401
|
level: p,
|
|
31376
31402
|
override: "neutral",
|
|
@@ -31412,10 +31438,10 @@ function Yo(e, t, n) {
|
|
|
31412
31438
|
types: a
|
|
31413
31439
|
};
|
|
31414
31440
|
}
|
|
31415
|
-
function
|
|
31441
|
+
function Qo(e) {
|
|
31416
31442
|
return e === 9001 ? 12296 : e === 9002 ? 12297 : e;
|
|
31417
31443
|
}
|
|
31418
|
-
function
|
|
31444
|
+
function $o(e, t, n, r, i, a) {
|
|
31419
31445
|
let o = e.length, s = [];
|
|
31420
31446
|
for (let e = 0; e < o; e++) n[e] || s.push(e);
|
|
31421
31447
|
let c = [];
|
|
@@ -31433,7 +31459,7 @@ function Zo(e, t, n, r, i, a) {
|
|
|
31433
31459
|
for (;;) {
|
|
31434
31460
|
for (let e of p) f.push(e);
|
|
31435
31461
|
let t = p[p.length - 1];
|
|
31436
|
-
if (
|
|
31462
|
+
if (Go(e[t]) && i[t] !== o) {
|
|
31437
31463
|
let e = l.get(i[t]);
|
|
31438
31464
|
if (e) {
|
|
31439
31465
|
p = e;
|
|
@@ -31448,7 +31474,7 @@ function Zo(e, t, n, r, i, a) {
|
|
|
31448
31474
|
break;
|
|
31449
31475
|
}
|
|
31450
31476
|
let g = u(Math.max(m, h)), _ = f[f.length - 1], v = r;
|
|
31451
|
-
if (!(
|
|
31477
|
+
if (!(Go(e[_]) && i[_] === o)) {
|
|
31452
31478
|
for (let e = _ + 1; e < o; e++) if (!n[e]) {
|
|
31453
31479
|
v = t[e];
|
|
31454
31480
|
break;
|
|
@@ -31464,8 +31490,8 @@ function Zo(e, t, n, r, i, a) {
|
|
|
31464
31490
|
}
|
|
31465
31491
|
return d;
|
|
31466
31492
|
}
|
|
31467
|
-
var
|
|
31468
|
-
function
|
|
31493
|
+
var es = (e) => e === "L" ? "L" : e === "R" || e === "EN" || e === "AN" ? "R" : null;
|
|
31494
|
+
function ts(e, t, n, r, i) {
|
|
31469
31495
|
let a = e.indices, o = a.length, { sos: s, eos: c, level: l } = e;
|
|
31470
31496
|
for (let e = 0; e < o; e++) {
|
|
31471
31497
|
let t = a[e];
|
|
@@ -31512,15 +31538,15 @@ function $o(e, t, n, r, i) {
|
|
|
31512
31538
|
outer: for (let n = 0; n < o; n++) {
|
|
31513
31539
|
let i = a[n];
|
|
31514
31540
|
if (r[i] !== "ON") continue;
|
|
31515
|
-
let o =
|
|
31541
|
+
let o = Uo(t[i]);
|
|
31516
31542
|
if (o) if (o.type === "o") {
|
|
31517
31543
|
if (e.length === 63) break outer;
|
|
31518
31544
|
e.push({
|
|
31519
|
-
expect:
|
|
31545
|
+
expect: Qo(o.pair),
|
|
31520
31546
|
pos: n
|
|
31521
31547
|
});
|
|
31522
31548
|
} else {
|
|
31523
|
-
let r =
|
|
31549
|
+
let r = Qo(t[i]);
|
|
31524
31550
|
for (let t = e.length - 1; t >= 0; t--) if (e[t].expect === r) {
|
|
31525
31551
|
f.push({
|
|
31526
31552
|
open: e[t].pos,
|
|
@@ -31538,7 +31564,7 @@ function $o(e, t, n, r, i) {
|
|
|
31538
31564
|
for (let { open: e, close: t } of f) {
|
|
31539
31565
|
let n = !1, i = !1;
|
|
31540
31566
|
for (let o = e + 1; o < t; o++) {
|
|
31541
|
-
let e =
|
|
31567
|
+
let e = es(r[a[o]]);
|
|
31542
31568
|
e === u ? n = !0 : e === d && (i = !0);
|
|
31543
31569
|
}
|
|
31544
31570
|
let o = null;
|
|
@@ -31546,7 +31572,7 @@ function $o(e, t, n, r, i) {
|
|
|
31546
31572
|
else if (i) {
|
|
31547
31573
|
let t = s;
|
|
31548
31574
|
for (let n = e - 1; n >= 0; n--) {
|
|
31549
|
-
let e =
|
|
31575
|
+
let e = es(r[a[n]]);
|
|
31550
31576
|
if (e) {
|
|
31551
31577
|
t = e;
|
|
31552
31578
|
break;
|
|
@@ -31557,29 +31583,29 @@ function $o(e, t, n, r, i) {
|
|
|
31557
31583
|
o && (r[a[e]] = o, r[a[t]] = o, p(e, o), p(t, o));
|
|
31558
31584
|
}
|
|
31559
31585
|
for (let e = 0; e < o; e++) {
|
|
31560
|
-
if (!
|
|
31586
|
+
if (!Ko(r[a[e]])) continue;
|
|
31561
31587
|
let t = e;
|
|
31562
|
-
for (; t < o &&
|
|
31563
|
-
let n = e > 0 ?
|
|
31588
|
+
for (; t < o && Ko(r[a[t]]);) t++;
|
|
31589
|
+
let n = e > 0 ? es(r[a[e - 1]]) : s, i = t < o ? es(r[a[t]]) : c;
|
|
31564
31590
|
if (n && i && n === i) for (let i = e; i < t; i++) r[a[i]] = n;
|
|
31565
31591
|
e = t - 1;
|
|
31566
31592
|
}
|
|
31567
|
-
for (let e = 0; e < o; e++)
|
|
31593
|
+
for (let e = 0; e < o; e++) Ko(r[a[e]]) && (r[a[e]] = u);
|
|
31568
31594
|
for (let e = 0; e < o; e++) {
|
|
31569
31595
|
let t = a[e], n = r[t];
|
|
31570
31596
|
l & 1 ? (n === "L" || n === "EN" || n === "AN") && (i[t] += 1) : n === "R" ? i[t] += 1 : (n === "AN" || n === "EN") && (i[t] += 2);
|
|
31571
31597
|
}
|
|
31572
31598
|
}
|
|
31573
|
-
function
|
|
31599
|
+
function ns(e, t, n) {
|
|
31574
31600
|
let r = e.length, i = Array(r);
|
|
31575
|
-
for (let t = 0; t < r; t++) i[t] = n?.[t] ??
|
|
31576
|
-
let a = t === "rtl" ? 1 : t === "ltr" ? 0 :
|
|
31577
|
-
for (let e = 0; e < r; e++) u[e] =
|
|
31578
|
-
let d =
|
|
31579
|
-
for (let t of d)
|
|
31601
|
+
for (let t = 0; t < r; t++) i[t] = n?.[t] ?? zo(e[t]);
|
|
31602
|
+
let a = t === "rtl" ? 1 : t === "ltr" ? 0 : Yo(i, 0, r), { pdiOf: o, initOf: s } = Xo(i), { levels: c, types: l } = Zo(i, a, o), u = Array(r);
|
|
31603
|
+
for (let e = 0; e < r; e++) u[e] = Wo(i[e]);
|
|
31604
|
+
let d = $o(i, c, u, a, o, s), f = l.slice();
|
|
31605
|
+
for (let t of d) ts(t, e, i, f, c);
|
|
31580
31606
|
let p = (e) => {
|
|
31581
31607
|
let t = i[e];
|
|
31582
|
-
return t === "WS" ||
|
|
31608
|
+
return t === "WS" || Go(t) || t === "PDI" || u[e];
|
|
31583
31609
|
};
|
|
31584
31610
|
for (let e = 0; e < r; e++) {
|
|
31585
31611
|
let t = i[e];
|
|
@@ -31595,7 +31621,7 @@ function es(e, t, n) {
|
|
|
31595
31621
|
paragraphLevel: a
|
|
31596
31622
|
};
|
|
31597
31623
|
}
|
|
31598
|
-
function
|
|
31624
|
+
function rs(e, t, n) {
|
|
31599
31625
|
let r = [];
|
|
31600
31626
|
for (let i = t; i < n; i++) {
|
|
31601
31627
|
let t = e[i];
|
|
@@ -31623,7 +31649,7 @@ function ts(e, t, n) {
|
|
|
31623
31649
|
}
|
|
31624
31650
|
//#endregion
|
|
31625
31651
|
//#region packages/core/src/text/bidi/uax9/index.ts
|
|
31626
|
-
function
|
|
31652
|
+
function is(e) {
|
|
31627
31653
|
let t = [], n = [], r = [];
|
|
31628
31654
|
for (let i = 0; i < e.length;) {
|
|
31629
31655
|
let a = e.codePointAt(i), o = a > 65535 ? 2 : 1;
|
|
@@ -31635,9 +31661,9 @@ function ns(e) {
|
|
|
31635
31661
|
starts: r
|
|
31636
31662
|
};
|
|
31637
31663
|
}
|
|
31638
|
-
var
|
|
31664
|
+
var as = class {
|
|
31639
31665
|
computeLevels(e, t, n) {
|
|
31640
|
-
let { cps: r, units: i, starts: a } =
|
|
31666
|
+
let { cps: r, units: i, starts: a } = is(e), { levels: o, paragraphLevel: s } = ns(r, t, n ? r.map((e, t) => n[a[t]] ?? null) : void 0), c = new Uint8Array(e.length), l = 0;
|
|
31641
31667
|
for (let e = 0; e < o.length; e++) {
|
|
31642
31668
|
let t = o[e] === -1 ? 255 : o[e];
|
|
31643
31669
|
for (let n = 0; n < i[e]; n++) c[l++] = t;
|
|
@@ -31648,63 +31674,63 @@ var rs = class {
|
|
|
31648
31674
|
};
|
|
31649
31675
|
}
|
|
31650
31676
|
reorderVisual(e, t, n) {
|
|
31651
|
-
return
|
|
31677
|
+
return rs(e, t, n);
|
|
31652
31678
|
}
|
|
31653
31679
|
getMirror(e) {
|
|
31654
|
-
return
|
|
31680
|
+
return Vo(e);
|
|
31655
31681
|
}
|
|
31656
31682
|
};
|
|
31657
|
-
function
|
|
31658
|
-
return new
|
|
31683
|
+
function os() {
|
|
31684
|
+
return new as();
|
|
31659
31685
|
}
|
|
31660
31686
|
//#endregion
|
|
31661
31687
|
//#region packages/core/src/text/bidi/engine.ts
|
|
31662
|
-
var
|
|
31663
|
-
function
|
|
31664
|
-
return
|
|
31688
|
+
var ss = null;
|
|
31689
|
+
function cs() {
|
|
31690
|
+
return ss === null && (ss = os()), ss;
|
|
31665
31691
|
}
|
|
31666
31692
|
//#endregion
|
|
31667
31693
|
//#region packages/core/src/text/bidi/line-order.ts
|
|
31668
|
-
var
|
|
31669
|
-
function
|
|
31670
|
-
return
|
|
31694
|
+
var ls = /[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF\u200F\u202B\u202E\u2067]|[\u{10800}-\u{10FFF}\u{1E800}-\u{1EFFF}]/u;
|
|
31695
|
+
function us(e) {
|
|
31696
|
+
return ls.test(e);
|
|
31671
31697
|
}
|
|
31672
|
-
function
|
|
31698
|
+
function ds(e, t, n) {
|
|
31673
31699
|
let r = n.length, i = new Uint8Array(r);
|
|
31674
31700
|
for (let a = 0; a < r; a++) {
|
|
31675
31701
|
let r = e[n[a]];
|
|
31676
31702
|
i[a] = r === 255 ? t : r;
|
|
31677
31703
|
}
|
|
31678
31704
|
return {
|
|
31679
|
-
order:
|
|
31705
|
+
order: cs().reorderVisual(i, 0, r),
|
|
31680
31706
|
segLevels: i
|
|
31681
31707
|
};
|
|
31682
31708
|
}
|
|
31683
31709
|
//#endregion
|
|
31684
31710
|
//#region packages/core/src/text/kinsoku/rules.ts
|
|
31685
|
-
var
|
|
31686
|
-
function
|
|
31711
|
+
var fs = "”’)〕]}〉》」』】〙〗〟⦆»、。,.・:;/?!‐ー゠–〜~ぁぃぅぇぉっゃゅょゎゕゖァィゥェォッャュョヮヵヶㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ゝゞヽヾ゛゜%‰℃°′″。」、・ー゙゚!),.:;?]}⦆", ps = "“‘(〔[{〈《「『【〘〖〝⦅«$¥#£¢([{⦅";
|
|
31712
|
+
function ms(e) {
|
|
31687
31713
|
let t = /* @__PURE__ */ new Set();
|
|
31688
31714
|
for (let n of e) t.add(n.codePointAt(0));
|
|
31689
31715
|
return t;
|
|
31690
31716
|
}
|
|
31691
|
-
function
|
|
31717
|
+
function hs(e) {
|
|
31692
31718
|
return {
|
|
31693
31719
|
enabled: e?.kinsoku !== !1,
|
|
31694
|
-
lineStartForbidden:
|
|
31695
|
-
lineEndForbidden:
|
|
31720
|
+
lineStartForbidden: ms(e?.noLineBreaksBefore ?? fs),
|
|
31721
|
+
lineEndForbidden: ms(e?.noLineBreaksAfter ?? ps)
|
|
31696
31722
|
};
|
|
31697
31723
|
}
|
|
31698
|
-
var
|
|
31724
|
+
var gs = hs();
|
|
31699
31725
|
//#endregion
|
|
31700
31726
|
//#region packages/core/src/text/kinsoku/split.ts
|
|
31701
|
-
function
|
|
31727
|
+
function _s(e, t, n, r = 1) {
|
|
31702
31728
|
if (!n.enabled || t <= 0 || t >= e.length) return t;
|
|
31703
31729
|
let i = (t) => t < e.length && n.lineStartForbidden.has(e[t].codePointAt(0)), a = (t) => t >= 0 && n.lineEndForbidden.has(e[t].codePointAt(0)), o = t;
|
|
31704
31730
|
for (; o > r && (i(o) || a(o - 1));) o--;
|
|
31705
31731
|
return o <= r && (i(o) || a(o - 1)) ? t : o;
|
|
31706
31732
|
}
|
|
31707
|
-
function
|
|
31733
|
+
function vs(e, t, n) {
|
|
31708
31734
|
if (!t.enabled) return 0;
|
|
31709
31735
|
let r = e.length - n;
|
|
31710
31736
|
for (let n = 1; n <= r; n++) {
|
|
@@ -31717,15 +31743,15 @@ function gs(e, t, n) {
|
|
|
31717
31743
|
}
|
|
31718
31744
|
//#endregion
|
|
31719
31745
|
//#region packages/core/src/text/cjk-ranges.ts
|
|
31720
|
-
function
|
|
31746
|
+
function ys(e) {
|
|
31721
31747
|
return e >= 12288 && e <= 40959 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65280 && e <= 65519;
|
|
31722
31748
|
}
|
|
31723
|
-
function
|
|
31724
|
-
return e === 32 || e === 9 || e === 10 || e === 13 ? !1 : !
|
|
31749
|
+
function bs(e) {
|
|
31750
|
+
return e === 32 || e === 9 || e === 10 || e === 13 ? !1 : !ys(e);
|
|
31725
31751
|
}
|
|
31726
31752
|
//#endregion
|
|
31727
31753
|
//#region packages/core/src/text/line-break-class.generated.ts
|
|
31728
|
-
var
|
|
31754
|
+
var xs = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB.CL.CP.EB.EM.EX.H2.H3.HL.HH.HY.ID.IN.IS.JL.JT.JV.NS.NU.OP.PO.PR.QU.RI.SY.VF.VI".split("."), Ss = [
|
|
31729
31755
|
0,
|
|
31730
31756
|
9,
|
|
31731
31757
|
10,
|
|
@@ -34348,7 +34374,7 @@ var ys = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
|
|
|
34348
34374
|
917632,
|
|
34349
34375
|
917760,
|
|
34350
34376
|
918e3
|
|
34351
|
-
],
|
|
34377
|
+
], Cs = [
|
|
34352
34378
|
1,
|
|
34353
34379
|
15,
|
|
34354
34380
|
4,
|
|
@@ -36971,7 +36997,7 @@ var ys = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
|
|
|
36971
36997
|
11,
|
|
36972
36998
|
1,
|
|
36973
36999
|
11
|
|
36974
|
-
],
|
|
37000
|
+
], ws = [
|
|
36975
37001
|
4352,
|
|
36976
37002
|
8361,
|
|
36977
37003
|
8986,
|
|
@@ -37101,7 +37127,7 @@ var ys = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
|
|
|
37101
37127
|
129775,
|
|
37102
37128
|
131072,
|
|
37103
37129
|
196608
|
|
37104
|
-
],
|
|
37130
|
+
], Ts = [
|
|
37105
37131
|
4448,
|
|
37106
37132
|
8362,
|
|
37107
37133
|
8988,
|
|
@@ -37234,68 +37260,68 @@ var ys = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
|
|
|
37234
37260
|
];
|
|
37235
37261
|
//#endregion
|
|
37236
37262
|
//#region packages/core/src/text/line-break.ts
|
|
37237
|
-
function
|
|
37238
|
-
let t = 0, n =
|
|
37263
|
+
function Es(e) {
|
|
37264
|
+
let t = 0, n = Ss.length - 1;
|
|
37239
37265
|
for (; t < n;) {
|
|
37240
37266
|
let r = t + n + 1 >> 1;
|
|
37241
|
-
|
|
37267
|
+
Ss[r] <= e ? t = r : n = r - 1;
|
|
37242
37268
|
}
|
|
37243
|
-
return
|
|
37269
|
+
return xs[Cs[t]];
|
|
37244
37270
|
}
|
|
37245
|
-
function
|
|
37246
|
-
let t = 0, n =
|
|
37247
|
-
if (n < 0 || e <
|
|
37271
|
+
function Ds(e) {
|
|
37272
|
+
let t = 0, n = ws.length - 1;
|
|
37273
|
+
if (n < 0 || e < ws[0]) return !1;
|
|
37248
37274
|
for (; t < n;) {
|
|
37249
37275
|
let r = t + n + 1 >> 1;
|
|
37250
|
-
|
|
37276
|
+
ws[r] <= e ? t = r : n = r - 1;
|
|
37251
37277
|
}
|
|
37252
|
-
return e <
|
|
37278
|
+
return e < Ts[t];
|
|
37253
37279
|
}
|
|
37254
|
-
function
|
|
37255
|
-
let n =
|
|
37280
|
+
function Os(e, t) {
|
|
37281
|
+
let n = Es(e);
|
|
37256
37282
|
if (n === "OP") return !0;
|
|
37257
|
-
let r =
|
|
37258
|
-
return !!(i && (a || r === "NU" || r === "PR" || r === "PO") || a && (n === "NU" || n === "PR" || n === "PO") || n === "PR" && (r === "ID" || r === "EB" || r === "EM") || (n === "ID" || n === "EB" || n === "EM") && r === "PO" || n === "NU" && (r === "NU" || r === "PO" || r === "PR") || r === "NU" && (n === "PO" || n === "PR" || n === "HY" || n === "IS") || (i || n === "NU") && r === "OP" && !
|
|
37283
|
+
let r = Es(t), i = n === "AL" || n === "HL", a = r === "AL" || r === "HL";
|
|
37284
|
+
return !!(i && (a || r === "NU" || r === "PR" || r === "PO") || a && (n === "NU" || n === "PR" || n === "PO") || n === "PR" && (r === "ID" || r === "EB" || r === "EM") || (n === "ID" || n === "EB" || n === "EM") && r === "PO" || n === "NU" && (r === "NU" || r === "PO" || r === "PR") || r === "NU" && (n === "PO" || n === "PR" || n === "HY" || n === "IS") || (i || n === "NU") && r === "OP" && !Ds(t) || n === "CP" && !Ds(e) && (a || r === "NU"));
|
|
37259
37285
|
}
|
|
37260
37286
|
//#endregion
|
|
37261
37287
|
//#region packages/core/src/text/sea-break.ts
|
|
37262
|
-
function
|
|
37288
|
+
function ks(e) {
|
|
37263
37289
|
return e === "my" || e === "bo";
|
|
37264
37290
|
}
|
|
37265
|
-
function
|
|
37291
|
+
function As(e) {
|
|
37266
37292
|
return e >= 3584 && e <= 3711 || e >= 3712 && e <= 3839 || e >= 6016 && e <= 6143 || e >= 4096 && e <= 4255 || e >= 43616 && e <= 43647 || e >= 43488 && e <= 43519 || e >= 3840 && e <= 4095;
|
|
37267
37293
|
}
|
|
37268
|
-
function
|
|
37294
|
+
function js(e) {
|
|
37269
37295
|
return e === 3633 || e >= 3635 && e <= 3642 || e >= 3655 && e <= 3662 || e === 3761 || e >= 3763 && e <= 3772 || e >= 3784 && e <= 3790 || e >= 6068 && e <= 6099 || e === 6109;
|
|
37270
37296
|
}
|
|
37271
|
-
function
|
|
37297
|
+
function Ms(e) {
|
|
37272
37298
|
return e <= 3711 ? "th" : e <= 3839 ? "lo" : e <= 4095 ? "bo" : e <= 4255 ? "my" : e <= 6143 ? "km" : "my";
|
|
37273
37299
|
}
|
|
37274
|
-
function
|
|
37275
|
-
for (let t of e) if (
|
|
37300
|
+
function Ns(e) {
|
|
37301
|
+
for (let t of e) if (As(t.codePointAt(0))) return !0;
|
|
37276
37302
|
return !1;
|
|
37277
37303
|
}
|
|
37278
|
-
function
|
|
37304
|
+
function Ps(e) {
|
|
37279
37305
|
for (let t of e) {
|
|
37280
37306
|
let e = t.codePointAt(0);
|
|
37281
|
-
if (
|
|
37307
|
+
if (As(e)) return ks(Ms(e));
|
|
37282
37308
|
}
|
|
37283
37309
|
return !1;
|
|
37284
37310
|
}
|
|
37285
|
-
function
|
|
37311
|
+
function Fs(e) {
|
|
37286
37312
|
let t = !1;
|
|
37287
37313
|
for (let n of e) {
|
|
37288
37314
|
let e = n.codePointAt(0);
|
|
37289
|
-
if (
|
|
37290
|
-
if (
|
|
37315
|
+
if (As(e)) {
|
|
37316
|
+
if (ks(Ms(e))) return !1;
|
|
37291
37317
|
t = !0;
|
|
37292
37318
|
}
|
|
37293
37319
|
}
|
|
37294
37320
|
return t;
|
|
37295
37321
|
}
|
|
37296
|
-
var
|
|
37297
|
-
function
|
|
37298
|
-
let t =
|
|
37322
|
+
var Is, Ls = /* @__PURE__ */ new Map();
|
|
37323
|
+
function Rs(e) {
|
|
37324
|
+
let t = Ls.get(e);
|
|
37299
37325
|
if (t !== void 0) return t;
|
|
37300
37326
|
let n = null;
|
|
37301
37327
|
try {
|
|
@@ -37303,36 +37329,36 @@ function Is(e) {
|
|
|
37303
37329
|
} catch {
|
|
37304
37330
|
n = null;
|
|
37305
37331
|
}
|
|
37306
|
-
return
|
|
37332
|
+
return Ls.set(e, n), n;
|
|
37307
37333
|
}
|
|
37308
|
-
function
|
|
37309
|
-
if (
|
|
37310
|
-
if (typeof
|
|
37311
|
-
let t =
|
|
37334
|
+
function zs(e) {
|
|
37335
|
+
if (Is === null) return null;
|
|
37336
|
+
if (typeof Is == "function") {
|
|
37337
|
+
let t = Is;
|
|
37312
37338
|
return (n) => t(n, e);
|
|
37313
37339
|
}
|
|
37314
|
-
let t =
|
|
37340
|
+
let t = Rs(e);
|
|
37315
37341
|
return t ? (e) => t.segment(e) : null;
|
|
37316
37342
|
}
|
|
37317
|
-
function
|
|
37318
|
-
if (!
|
|
37343
|
+
function Bs(e) {
|
|
37344
|
+
if (!Ns(e)) return [];
|
|
37319
37345
|
let t = [], n = e.length, r = 0;
|
|
37320
37346
|
for (; r < n;) {
|
|
37321
37347
|
let i = e.codePointAt(r), a = i > 65535 ? 2 : 1;
|
|
37322
|
-
if (!
|
|
37348
|
+
if (!As(i)) {
|
|
37323
37349
|
r += a;
|
|
37324
37350
|
continue;
|
|
37325
37351
|
}
|
|
37326
|
-
let o =
|
|
37352
|
+
let o = Ms(i), s = ks(o), c = r + a;
|
|
37327
37353
|
for (; c < n;) {
|
|
37328
37354
|
let t = e.codePointAt(c);
|
|
37329
|
-
if (!
|
|
37355
|
+
if (!As(t) || ks(Ms(t)) !== s) break;
|
|
37330
37356
|
c += t > 65535 ? 2 : 1;
|
|
37331
37357
|
}
|
|
37332
37358
|
let l = e.slice(r, c);
|
|
37333
|
-
if (s) for (let e of
|
|
37359
|
+
if (s) for (let e of Js(l)) t.push(r + e);
|
|
37334
37360
|
else {
|
|
37335
|
-
let e =
|
|
37361
|
+
let e = zs(o);
|
|
37336
37362
|
if (e) {
|
|
37337
37363
|
let n = [];
|
|
37338
37364
|
try {
|
|
@@ -37345,42 +37371,42 @@ function Rs(e) {
|
|
|
37345
37371
|
}
|
|
37346
37372
|
return t;
|
|
37347
37373
|
}
|
|
37348
|
-
function
|
|
37349
|
-
if (!
|
|
37374
|
+
function Vs(e) {
|
|
37375
|
+
if (!Ns(e)) return [];
|
|
37350
37376
|
let t = [], n = e.length, r = e.codePointAt(0), i = r > 65535 ? 2 : 1;
|
|
37351
37377
|
for (; i < n;) {
|
|
37352
37378
|
let n = e.codePointAt(i), a = n > 65535 ? 2 : 1;
|
|
37353
|
-
|
|
37379
|
+
As(r) !== As(n) && !Hs(r) && !Hs(n) && t.push(i), r = n, i += a;
|
|
37354
37380
|
}
|
|
37355
37381
|
return t;
|
|
37356
37382
|
}
|
|
37357
|
-
function
|
|
37383
|
+
function Hs(e) {
|
|
37358
37384
|
return e === 32 || e === 9 || e === 10 || e === 13 || e === 12288 || e === 160 || e === 8199 || e === 8239 || e === 8288 || e === 65279;
|
|
37359
37385
|
}
|
|
37360
|
-
function
|
|
37361
|
-
if (!
|
|
37362
|
-
let n = e.length, r = new Set(
|
|
37386
|
+
function Us(e, t) {
|
|
37387
|
+
if (!Ns(e)) return [];
|
|
37388
|
+
let n = e.length, r = new Set(Bs(e)), i = new Set(Js(e)), a = (e) => {
|
|
37363
37389
|
i.has(e) && r.add(e);
|
|
37364
37390
|
};
|
|
37365
|
-
for (let t of
|
|
37391
|
+
for (let t of Vs(e)) a(t);
|
|
37366
37392
|
if (t?.cjk) {
|
|
37367
37393
|
let t = e.codePointAt(0), r = t > 65535 ? 2 : 1;
|
|
37368
37394
|
for (; r < n;) {
|
|
37369
37395
|
let n = e.codePointAt(r);
|
|
37370
|
-
(
|
|
37396
|
+
(ys(n) || ys(t)) && a(r), t = n, r += n > 65535 ? 2 : 1;
|
|
37371
37397
|
}
|
|
37372
37398
|
}
|
|
37373
37399
|
let o = t?.kinsoku, s = o != null && o.enabled !== !1, c = [];
|
|
37374
37400
|
for (let t of r) if (!(t <= 0 || t >= n)) {
|
|
37375
37401
|
if (s) {
|
|
37376
|
-
let n = e.codePointAt(t), r =
|
|
37402
|
+
let n = e.codePointAt(t), r = Ws(e, t);
|
|
37377
37403
|
if (r !== void 0 && o.lineEndForbidden.has(r) || o.lineStartForbidden.has(n)) continue;
|
|
37378
37404
|
}
|
|
37379
37405
|
c.push(t);
|
|
37380
37406
|
}
|
|
37381
37407
|
return c.sort((e, t) => e - t), c;
|
|
37382
37408
|
}
|
|
37383
|
-
function
|
|
37409
|
+
function Ws(e, t) {
|
|
37384
37410
|
if (t <= 0) return;
|
|
37385
37411
|
let n = e.charCodeAt(t - 1);
|
|
37386
37412
|
if (n >= 56320 && n <= 57343 && t >= 2) {
|
|
@@ -37389,7 +37415,7 @@ function Hs(e, t) {
|
|
|
37389
37415
|
}
|
|
37390
37416
|
return n;
|
|
37391
37417
|
}
|
|
37392
|
-
function
|
|
37418
|
+
function Gs(e, t, n, r, i, a = !1) {
|
|
37393
37419
|
let o = e.length;
|
|
37394
37420
|
if (n >= o) return n;
|
|
37395
37421
|
if (a) {
|
|
@@ -37405,19 +37431,19 @@ function Us(e, t, n, r, i, a = !1) {
|
|
|
37405
37431
|
for (let a of t) a <= n || a >= o || i(e.slice(n, a)) <= r && (s = a);
|
|
37406
37432
|
return i(e.slice(n, o)) <= r && (s = o), s;
|
|
37407
37433
|
}
|
|
37408
|
-
var
|
|
37409
|
-
function
|
|
37410
|
-
if (
|
|
37434
|
+
var Ks;
|
|
37435
|
+
function qs() {
|
|
37436
|
+
if (Ks !== void 0) return Ks;
|
|
37411
37437
|
let e = null;
|
|
37412
37438
|
try {
|
|
37413
37439
|
typeof Intl < "u" && typeof Intl.Segmenter == "function" && (e = new Intl.Segmenter(void 0, { granularity: "grapheme" }));
|
|
37414
37440
|
} catch {
|
|
37415
37441
|
e = null;
|
|
37416
37442
|
}
|
|
37417
|
-
return
|
|
37443
|
+
return Ks = e, e;
|
|
37418
37444
|
}
|
|
37419
|
-
function
|
|
37420
|
-
let t =
|
|
37445
|
+
function Js(e) {
|
|
37446
|
+
let t = qs();
|
|
37421
37447
|
if (t) try {
|
|
37422
37448
|
let n = [];
|
|
37423
37449
|
for (let r of t.segment(e)) r.index > 0 && n.push(r.index);
|
|
@@ -37432,12 +37458,12 @@ function Ks(e) {
|
|
|
37432
37458
|
}
|
|
37433
37459
|
//#endregion
|
|
37434
37460
|
//#region packages/core/src/text/vertical-orientation.generated.ts
|
|
37435
|
-
var
|
|
37461
|
+
var Ys = [
|
|
37436
37462
|
"U",
|
|
37437
37463
|
"R",
|
|
37438
37464
|
"Tu",
|
|
37439
37465
|
"Tr"
|
|
37440
|
-
],
|
|
37466
|
+
], Xs = [
|
|
37441
37467
|
0,
|
|
37442
37468
|
167,
|
|
37443
37469
|
168,
|
|
@@ -37718,7 +37744,7 @@ var qs = [
|
|
|
37718
37744
|
1048574,
|
|
37719
37745
|
1048576,
|
|
37720
37746
|
1114110
|
|
37721
|
-
],
|
|
37747
|
+
], Zs = [
|
|
37722
37748
|
1,
|
|
37723
37749
|
0,
|
|
37724
37750
|
1,
|
|
@@ -38002,29 +38028,29 @@ var qs = [
|
|
|
38002
38028
|
];
|
|
38003
38029
|
//#endregion
|
|
38004
38030
|
//#region packages/core/src/text/vertical-orientation.ts
|
|
38005
|
-
function
|
|
38006
|
-
let t = 0, n =
|
|
38031
|
+
function Qs(e) {
|
|
38032
|
+
let t = 0, n = Xs.length - 1;
|
|
38007
38033
|
for (; t < n;) {
|
|
38008
38034
|
let r = t + n + 1 >> 1;
|
|
38009
|
-
|
|
38035
|
+
Xs[r] <= e ? t = r : n = r - 1;
|
|
38010
38036
|
}
|
|
38011
|
-
return
|
|
38037
|
+
return Zs[t];
|
|
38012
38038
|
}
|
|
38013
|
-
function
|
|
38014
|
-
return
|
|
38039
|
+
function $s(e) {
|
|
38040
|
+
return Ys[Qs(e)];
|
|
38015
38041
|
}
|
|
38016
|
-
function
|
|
38017
|
-
return
|
|
38042
|
+
function ec(e) {
|
|
38043
|
+
return tc.get(e) ?? null;
|
|
38018
38044
|
}
|
|
38019
|
-
var
|
|
38045
|
+
var tc = new Map([
|
|
38020
38046
|
[65292, 65040],
|
|
38021
38047
|
[12289, 65041],
|
|
38022
38048
|
[12290, 65042]
|
|
38023
38049
|
]);
|
|
38024
|
-
function
|
|
38025
|
-
return
|
|
38050
|
+
function nc(e) {
|
|
38051
|
+
return rc.get(e) ?? null;
|
|
38026
38052
|
}
|
|
38027
|
-
var
|
|
38053
|
+
var rc = new Map([
|
|
38028
38054
|
[65288, 65077],
|
|
38029
38055
|
[65289, 65078],
|
|
38030
38056
|
[65371, 65079],
|
|
@@ -38043,43 +38069,43 @@ var tc = new Map([
|
|
|
38043
38069
|
[12303, 65092],
|
|
38044
38070
|
[12310, 65047],
|
|
38045
38071
|
[12311, 65048]
|
|
38046
|
-
]),
|
|
38047
|
-
function
|
|
38048
|
-
return
|
|
38072
|
+
]), ic = new Set([65307]);
|
|
38073
|
+
function ac(e) {
|
|
38074
|
+
return ic.has(e);
|
|
38049
38075
|
}
|
|
38050
|
-
var
|
|
38076
|
+
var oc = new Set([
|
|
38051
38077
|
12540,
|
|
38052
38078
|
12316,
|
|
38053
38079
|
65374
|
|
38054
38080
|
]);
|
|
38055
|
-
function
|
|
38056
|
-
return
|
|
38081
|
+
function sc(e) {
|
|
38082
|
+
return oc.has(e);
|
|
38057
38083
|
}
|
|
38058
38084
|
//#endregion
|
|
38059
38085
|
//#region packages/core/src/text/vertical-vert-feature.ts
|
|
38060
|
-
var
|
|
38061
|
-
function
|
|
38086
|
+
var cc = 256, lc = 200, uc = /* @__PURE__ */ new WeakMap();
|
|
38087
|
+
function dc(e) {
|
|
38062
38088
|
return typeof HTMLCanvasElement > "u" ? null : e.canvas instanceof HTMLCanvasElement ? e.canvas : null;
|
|
38063
38089
|
}
|
|
38064
|
-
function
|
|
38090
|
+
function fc(e, t) {
|
|
38065
38091
|
return e.replace(/(^|\s)\d*\.?\d+(?:px|pt|pc|in|cm|mm|q|em|rem|%)(?:\/[^\s]+)?(?=\s)/i, `$1${t}`);
|
|
38066
38092
|
}
|
|
38067
|
-
function
|
|
38093
|
+
function pc(e, t = !0) {
|
|
38068
38094
|
let n = e.trim();
|
|
38069
38095
|
return [...n === "" || n.toLowerCase() === "normal" ? [] : n.split(",").map((e) => e.trim()).filter((e) => !/^(["'])vert\1(?:\s+(?:on|off|\d+))?$/i.test(e)), `"vert" ${+!!t}`].join(", ");
|
|
38070
38096
|
}
|
|
38071
|
-
function
|
|
38097
|
+
function mc(e) {
|
|
38072
38098
|
try {
|
|
38073
38099
|
let t = e.ownerDocument?.defaultView, n = t?.getComputedStyle ? t.getComputedStyle(e) : typeof getComputedStyle == "function" ? getComputedStyle(e) : null;
|
|
38074
38100
|
if (n?.fontFeatureSettings) return n.fontFeatureSettings;
|
|
38075
38101
|
} catch {}
|
|
38076
38102
|
return e.style.fontFeatureSettings;
|
|
38077
38103
|
}
|
|
38078
|
-
function
|
|
38079
|
-
let t =
|
|
38104
|
+
function hc(e) {
|
|
38105
|
+
let t = uc.get(e);
|
|
38080
38106
|
if (t) return t;
|
|
38081
38107
|
let n = e.createElement("canvas");
|
|
38082
|
-
n.width =
|
|
38108
|
+
n.width = cc, n.height = cc, n.setAttribute("aria-hidden", "true"), Object.assign(n.style, {
|
|
38083
38109
|
position: "fixed",
|
|
38084
38110
|
left: "-99999px",
|
|
38085
38111
|
top: "0",
|
|
@@ -38093,9 +38119,9 @@ function pc(e) {
|
|
|
38093
38119
|
}, i = () => {
|
|
38094
38120
|
r.epoch += 1, r.cache.clear();
|
|
38095
38121
|
};
|
|
38096
|
-
return e.fonts?.addEventListener?.("loadingdone", i), e.fonts?.addEventListener?.("loadingerror", i),
|
|
38122
|
+
return e.fonts?.addEventListener?.("loadingdone", i), e.fonts?.addEventListener?.("loadingerror", i), uc.set(e, r), r;
|
|
38097
38123
|
}
|
|
38098
|
-
function
|
|
38124
|
+
function gc(e, t) {
|
|
38099
38125
|
let { width: n, height: r } = e.canvas, i = e.getImageData(0, 0, n, r).data, a = new Uint8ClampedArray(n * r), o = n, s = r, c = -1, l = -1, u = 0, d = 0, f = 0;
|
|
38100
38126
|
for (let e = 0; e < r; e += 1) for (let t = 0; t < n; t += 1) {
|
|
38101
38127
|
let r = i[(e * n + t) * 4 + 3];
|
|
@@ -38122,28 +38148,28 @@ function mc(e, t) {
|
|
|
38122
38148
|
]
|
|
38123
38149
|
};
|
|
38124
38150
|
}
|
|
38125
|
-
function
|
|
38151
|
+
function _c(e, t, n) {
|
|
38126
38152
|
let r = e.canvas;
|
|
38127
38153
|
r.style.fontFeatureSettings = n, e.font = e.font, e.clearRect(0, 0, r.width, r.height);
|
|
38128
38154
|
let i = String.fromCodePoint(t);
|
|
38129
|
-
return e.fillText(i, r.width / 2, r.height / 2),
|
|
38155
|
+
return e.fillText(i, r.width / 2, r.height / 2), gc(e, i);
|
|
38130
38156
|
}
|
|
38131
|
-
function
|
|
38157
|
+
function vc(e, t) {
|
|
38132
38158
|
let n = 0, r = Math.min(e.length, t.length);
|
|
38133
38159
|
for (let i = 0; i < r; i += 1) n += Math.abs(e[i] - t[i]);
|
|
38134
38160
|
return n;
|
|
38135
38161
|
}
|
|
38136
|
-
function
|
|
38162
|
+
function yc(e, t, n, r) {
|
|
38137
38163
|
let i = (e, t, n, r) => {
|
|
38138
|
-
let i = Math.max(
|
|
38139
|
-
return Math.min(
|
|
38164
|
+
let i = Math.max(vc(e, t), vc(n, r));
|
|
38165
|
+
return Math.min(vc(e, n), vc(e, r), vc(t, n), vc(t, r)) > i;
|
|
38140
38166
|
};
|
|
38141
38167
|
return i(e.alpha, t.alpha, n.alpha, r.alpha) || i(e.geometry, t.geometry, n.geometry, r.geometry) || i(e.metrics, t.metrics, n.metrics, r.metrics);
|
|
38142
38168
|
}
|
|
38143
|
-
function
|
|
38144
|
-
let n =
|
|
38169
|
+
function bc(e, t) {
|
|
38170
|
+
let n = dc(e);
|
|
38145
38171
|
if (n === null || typeof document > "u") return !1;
|
|
38146
|
-
let r = n.ownerDocument ?? document, i =
|
|
38172
|
+
let r = n.ownerDocument ?? document, i = hc(r), a = mc(n), o = `${i.epoch}:${fc(e.font, "<size>")}:${a}:${t}`, s = i.cache.get(o);
|
|
38147
38173
|
if (s !== void 0) return s;
|
|
38148
38174
|
let c = !1, l = r.body ?? r.documentElement;
|
|
38149
38175
|
if (!l) return !1;
|
|
@@ -38153,9 +38179,9 @@ function vc(e, t) {
|
|
|
38153
38179
|
if (d !== null) {
|
|
38154
38180
|
let n = i.canvas.style.fontFeatureSettings;
|
|
38155
38181
|
try {
|
|
38156
|
-
d.font =
|
|
38157
|
-
let n =
|
|
38158
|
-
c = i !== null && o !== null && s !== null && l !== null &&
|
|
38182
|
+
d.font = fc(e.font, `${lc}px`), d.fillStyle = "#000", d.textAlign = "center", d.textBaseline = "middle";
|
|
38183
|
+
let n = pc(a, !1), r = pc(a, !0), i = _c(d, t, n), o = _c(d, t, n), s = _c(d, t, r), l = _c(d, t, r);
|
|
38184
|
+
c = i !== null && o !== null && s !== null && l !== null && yc(i, o, s, l);
|
|
38159
38185
|
} catch {
|
|
38160
38186
|
c = !1;
|
|
38161
38187
|
} finally {
|
|
@@ -38164,19 +38190,19 @@ function vc(e, t) {
|
|
|
38164
38190
|
}
|
|
38165
38191
|
return i.cache.set(o, c), c;
|
|
38166
38192
|
}
|
|
38167
|
-
function
|
|
38193
|
+
function xc(e, t) {
|
|
38168
38194
|
let n = e.canvas, r = n?.style;
|
|
38169
38195
|
if (!r) return t();
|
|
38170
38196
|
let i = r.fontFeatureSettings;
|
|
38171
|
-
r.fontFeatureSettings =
|
|
38197
|
+
r.fontFeatureSettings = pc(mc(n)), e.font = e.font;
|
|
38172
38198
|
try {
|
|
38173
38199
|
return t();
|
|
38174
38200
|
} finally {
|
|
38175
38201
|
r.fontFeatureSettings = i, e.font = e.font;
|
|
38176
38202
|
}
|
|
38177
38203
|
}
|
|
38178
|
-
function
|
|
38179
|
-
return
|
|
38204
|
+
function Sc(e, t) {
|
|
38205
|
+
return xc(e, () => {
|
|
38180
38206
|
let n = e.textAlign, r = e.textBaseline;
|
|
38181
38207
|
e.textAlign = "center", e.textBaseline = "middle";
|
|
38182
38208
|
try {
|
|
@@ -38195,17 +38221,17 @@ function bc(e, t) {
|
|
|
38195
38221
|
}
|
|
38196
38222
|
//#endregion
|
|
38197
38223
|
//#region packages/core/src/interaction/zoom.ts
|
|
38198
|
-
var
|
|
38199
|
-
function
|
|
38200
|
-
return e * Math.exp(-t *
|
|
38224
|
+
var Cc = .01;
|
|
38225
|
+
function wc(e, t) {
|
|
38226
|
+
return e * Math.exp(-t * Cc);
|
|
38201
38227
|
}
|
|
38202
|
-
function
|
|
38228
|
+
function Tc(e, t, n, r, i) {
|
|
38203
38229
|
let a = n > 0 ? r / n : 1, o = (e + t) * a - t, s = i.maxScroll > 0 ? i.maxScroll : 0;
|
|
38204
38230
|
return o < 0 ? 0 : o > s ? s : o;
|
|
38205
38231
|
}
|
|
38206
38232
|
//#endregion
|
|
38207
38233
|
//#region packages/core/src/interaction/zoomable.ts
|
|
38208
|
-
var
|
|
38234
|
+
var Ec = Object.freeze([
|
|
38209
38235
|
.25,
|
|
38210
38236
|
.33,
|
|
38211
38237
|
.5,
|
|
@@ -38221,22 +38247,22 @@ var wc = Object.freeze([
|
|
|
38221
38247
|
2.5,
|
|
38222
38248
|
3,
|
|
38223
38249
|
4
|
|
38224
|
-
]),
|
|
38225
|
-
function
|
|
38226
|
-
for (let t of
|
|
38227
|
-
return
|
|
38228
|
-
}
|
|
38229
|
-
function
|
|
38230
|
-
for (let t =
|
|
38231
|
-
let n =
|
|
38232
|
-
if (n < e -
|
|
38250
|
+
]), Dc = .005;
|
|
38251
|
+
function Oc(e) {
|
|
38252
|
+
for (let t of Ec) if (t > e + Dc) return t;
|
|
38253
|
+
return Ec[Ec.length - 1];
|
|
38254
|
+
}
|
|
38255
|
+
function kc(e) {
|
|
38256
|
+
for (let t = Ec.length - 1; t >= 0; t--) {
|
|
38257
|
+
let n = Ec[t];
|
|
38258
|
+
if (n < e - Dc) return n;
|
|
38233
38259
|
}
|
|
38234
|
-
return
|
|
38260
|
+
return Ec[0];
|
|
38235
38261
|
}
|
|
38236
|
-
function
|
|
38262
|
+
function Ac(e, t, n) {
|
|
38237
38263
|
return e < t ? t : e > n ? n : e;
|
|
38238
38264
|
}
|
|
38239
|
-
function
|
|
38265
|
+
function jc(e, t) {
|
|
38240
38266
|
let { contentWidth: n, contentHeight: r, containerWidth: i, containerHeight: a } = e;
|
|
38241
38267
|
if (n <= 0 || i <= 0) return 0;
|
|
38242
38268
|
let o = i / n;
|
|
@@ -38247,13 +38273,13 @@ function kc(e, t) {
|
|
|
38247
38273
|
}
|
|
38248
38274
|
//#endregion
|
|
38249
38275
|
//#region packages/core/src/interaction/hyperlink.ts
|
|
38250
|
-
var
|
|
38276
|
+
var Mc = [
|
|
38251
38277
|
"http",
|
|
38252
38278
|
"https",
|
|
38253
38279
|
"mailto",
|
|
38254
38280
|
"tel"
|
|
38255
38281
|
];
|
|
38256
|
-
function
|
|
38282
|
+
function Nc(e) {
|
|
38257
38283
|
let t = "";
|
|
38258
38284
|
for (let n of e) {
|
|
38259
38285
|
let e = n.codePointAt(0);
|
|
@@ -38262,18 +38288,18 @@ function jc(e) {
|
|
|
38262
38288
|
let n = /^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(t);
|
|
38263
38289
|
return n ? n[1].toLowerCase() : null;
|
|
38264
38290
|
}
|
|
38265
|
-
function
|
|
38291
|
+
function Pc(e, t = Mc) {
|
|
38266
38292
|
if (e === "") return null;
|
|
38267
|
-
let n =
|
|
38293
|
+
let n = Nc(e);
|
|
38268
38294
|
return n === null || t.includes(n) ? e : null;
|
|
38269
38295
|
}
|
|
38270
|
-
function
|
|
38271
|
-
let r =
|
|
38296
|
+
function Fc(e, t = Mc, n = typeof window < "u" ? window : void 0) {
|
|
38297
|
+
let r = Pc(e, t);
|
|
38272
38298
|
return r === null || !n ? !1 : (n.open(r, "_blank", "noopener,noreferrer"), !0);
|
|
38273
38299
|
}
|
|
38274
38300
|
//#endregion
|
|
38275
38301
|
//#region packages/core/src/text/line-metrics.ts
|
|
38276
|
-
var
|
|
38302
|
+
var Ic = [
|
|
38277
38303
|
[(e) => e.includes("meiryo") || e.includes("メイリオ"), {
|
|
38278
38304
|
asc: 2210 / 2048,
|
|
38279
38305
|
desc: 1059 / 2048
|
|
@@ -38296,22 +38322,22 @@ var Pc = [
|
|
|
38296
38322
|
desc: 501 / 2048
|
|
38297
38323
|
}]
|
|
38298
38324
|
];
|
|
38299
|
-
function
|
|
38325
|
+
function Lc(e, t) {
|
|
38300
38326
|
if (!e) return null;
|
|
38301
38327
|
let n = e.toLowerCase();
|
|
38302
|
-
for (let [e, r] of
|
|
38328
|
+
for (let [e, r] of Ic) if (e(n) && (t || !r.eaOnly)) return r;
|
|
38303
38329
|
return null;
|
|
38304
38330
|
}
|
|
38305
|
-
function
|
|
38306
|
-
let n =
|
|
38331
|
+
function Rc(e, t = !1) {
|
|
38332
|
+
let n = Lc(e, t);
|
|
38307
38333
|
return n === null ? null : n.asc + n.desc;
|
|
38308
38334
|
}
|
|
38309
|
-
function
|
|
38310
|
-
let r =
|
|
38335
|
+
function zc(e, t, n = !1) {
|
|
38336
|
+
let r = Rc(e, n);
|
|
38311
38337
|
return r === null ? 0 : r * t;
|
|
38312
38338
|
}
|
|
38313
|
-
function
|
|
38314
|
-
let a =
|
|
38339
|
+
function Bc(e, t, n, r, i = !1) {
|
|
38340
|
+
let a = Lc(e, i);
|
|
38315
38341
|
if (a === null) return {
|
|
38316
38342
|
ascent: n,
|
|
38317
38343
|
descent: r
|
|
@@ -38327,7 +38353,7 @@ function Rc(e, t, n, r, i = !1) {
|
|
|
38327
38353
|
}
|
|
38328
38354
|
//#endregion
|
|
38329
38355
|
//#region packages/core/src/search/text-index.ts
|
|
38330
|
-
function
|
|
38356
|
+
function Vc(e) {
|
|
38331
38357
|
let t = e.toLowerCase();
|
|
38332
38358
|
if (t.length === e.length) return t;
|
|
38333
38359
|
let n = "";
|
|
@@ -38337,17 +38363,17 @@ function zc(e) {
|
|
|
38337
38363
|
}
|
|
38338
38364
|
return n;
|
|
38339
38365
|
}
|
|
38340
|
-
function
|
|
38366
|
+
function Hc(e) {
|
|
38341
38367
|
let t = Array(e.length), n = 0, r = "";
|
|
38342
38368
|
for (let i = 0; i < e.length; i++) t[i] = n, r += e[i].text, n += e[i].text.length;
|
|
38343
38369
|
return {
|
|
38344
38370
|
text: r,
|
|
38345
|
-
folded:
|
|
38371
|
+
folded: Vc(r),
|
|
38346
38372
|
runStart: t,
|
|
38347
38373
|
runCount: e.length
|
|
38348
38374
|
};
|
|
38349
38375
|
}
|
|
38350
|
-
function
|
|
38376
|
+
function Uc(e, t) {
|
|
38351
38377
|
let { runStart: n } = e, r = 0, i = n.length - 1;
|
|
38352
38378
|
for (; r < i;) {
|
|
38353
38379
|
let e = r + i + 1 >> 1;
|
|
@@ -38355,8 +38381,8 @@ function Vc(e, t) {
|
|
|
38355
38381
|
}
|
|
38356
38382
|
return r;
|
|
38357
38383
|
}
|
|
38358
|
-
function
|
|
38359
|
-
let { runStart: r, runCount: i, text: a } = e, o = [], s =
|
|
38384
|
+
function Wc(e, t, n) {
|
|
38385
|
+
let { runStart: r, runCount: i, text: a } = e, o = [], s = Uc(e, t), c = t;
|
|
38360
38386
|
for (; c < n && s < i;) {
|
|
38361
38387
|
let e = s + 1 < i ? r[s + 1] : a.length, t = Math.min(n, e), l = c - r[s], u = t - r[s];
|
|
38362
38388
|
u > l && o.push({
|
|
@@ -38367,26 +38393,26 @@ function Hc(e, t, n) {
|
|
|
38367
38393
|
}
|
|
38368
38394
|
return o;
|
|
38369
38395
|
}
|
|
38370
|
-
function
|
|
38396
|
+
function Gc(e, t, n = {}) {
|
|
38371
38397
|
if (t.length === 0) return [];
|
|
38372
|
-
let r = n.caseSensitive ?? !1, i = r ? e.text : e.folded, a = r ? t :
|
|
38398
|
+
let r = n.caseSensitive ?? !1, i = r ? e.text : e.folded, a = r ? t : Vc(t), o = [], s = 0, c = 0;
|
|
38373
38399
|
for (;;) {
|
|
38374
38400
|
let t = i.indexOf(a, s);
|
|
38375
38401
|
if (t === -1) break;
|
|
38376
38402
|
o.push({
|
|
38377
38403
|
matchIndex: c,
|
|
38378
|
-
slices:
|
|
38404
|
+
slices: Wc(e, t, t + a.length)
|
|
38379
38405
|
}), c++, s = t + a.length;
|
|
38380
38406
|
}
|
|
38381
38407
|
return o;
|
|
38382
38408
|
}
|
|
38383
38409
|
//#endregion
|
|
38384
38410
|
//#region packages/core/src/search/find-cursor.ts
|
|
38385
|
-
function
|
|
38411
|
+
function Kc(e, t) {
|
|
38386
38412
|
return t <= 0 ? -1 : e < 0 ? 0 : (e + 1) % t;
|
|
38387
38413
|
}
|
|
38388
|
-
function
|
|
38414
|
+
function qc(e, t) {
|
|
38389
38415
|
return t <= 0 ? -1 : e < 0 ? t - 1 : (e - 1 + t) % t;
|
|
38390
38416
|
}
|
|
38391
38417
|
//#endregion
|
|
38392
|
-
export {
|
|
38418
|
+
export { qa as $, As as A, pt as At, us as B, Pe as Bt, ac as C, Yt as Ct, Fs as D, St as Dt, Js as E, wt as Et, vs as F, Re as Ft, Eo as G, Ce as Gt, Mo as H, Ae as Ht, _s as I, Fe as It, eo as J, be as Jt, To as K, Se as Kt, gs as L, Ie as Lt, Os as M, ze as Mt, ys as N, Be as Nt, Ps as O, Ct as Ot, bs as P, He as Pt, Ka as Q, hs as R, Le as Rt, sc as S, Ht as St, Gs as T, It as Tt, Ao as U, je as Ut, cs as V, Oe as Vt, Do as W, Te as Wt, Ya as X, t as Xt, $a as Y, n as Yt, Xa as Z, bc as _, br as _t, Bc as a, Ha as at, ec as b, Xt as bt, Nc as c, Kr as ct, jc as d, zr as dt, Ga as et, Oc as f, Nr as ft, Sc as g, xr as gt, wc as h, Er as ht, Gc as i, Wa as it, Us as j, mt as jt, js as k, ft as kt, Fc as l, Gr as lt, Tc as m, Tr as mt, qc as n, Ba as nt, zc as o, Ua as ot, kc as p, Rr as pt, wo as q, ye as qt, Hc as r, Va as rt, Mc as s, $i as st, Kc as t, Ja as tt, Ac as u, Pr as ut, xc as v, nn as vt, Ns as w, Wt as wt, $s as x, $t as xt, nc as y, Qt as yt, ds as z, Ue as zt };
|