@silurus/ooxml 0.59.3 → 0.60.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/dist/docx-B4CmtwJQ.js +2100 -0
- package/dist/docx.mjs +2 -2
- package/dist/index.mjs +3 -3
- package/dist/{pptx-DsFZ4AtI.js → pptx-CcRBxO-i.js} +611 -631
- package/dist/pptx.mjs +2 -2
- package/dist/render-worker-host-CChgqx5o.js +27 -0
- package/dist/render-worker-host-CI4BVZcT.js +27 -0
- package/dist/render-worker-host-qS8zOCxE.js +27 -0
- package/dist/{src-BAZYl43H.js → src-CWqt1QE0.js} +272 -250
- package/dist/types/docx.d.ts +24 -0
- package/dist/types/index.d.ts +25 -0
- package/dist/{xlsx-9W9zIvga.js → xlsx-B8GnK1Ad.js} +545 -524
- package/dist/xlsx.mjs +2 -2
- package/package.json +1 -1
- package/dist/docx-CPesjmsh.js +0 -1928
- package/dist/render-worker-host-BT6u-XRr.js +0 -27
- package/dist/render-worker-host-Bv6bpyhr.js +0 -27
- package/dist/render-worker-host-C6mRacrU.js +0 -27
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as e, H as t, I as n, L as r, M as i, O as a, R as o, U as s, V as c, a as l, b as u, i as d, j as f, k as p, n as m, o as h, r as g, s as _, t as v, w as y, z as b } from "./src-CWqt1QE0.js";
|
|
2
2
|
import { t as x } from "./mathjax-CNh-4Cw1.js";
|
|
3
3
|
//#region packages/xlsx/src/worker.ts?worker&inline
|
|
4
4
|
var S = "function e(e,t,n,r){let i,o;try{let p=l(e,_.__wbindgen_malloc),m=g,h=u(n,_.__wbindgen_malloc,_.__wbindgen_realloc),v=g,y=_.parse_sheet(p,m,t,h,v,!c(r),c(r)?BigInt(0):r);var s=y[0],f=y[1];if(y[3])throw s=0,f=0,d(y[2]);return i=s,o=f,a(s,f)}finally{_.__wbindgen_free(i,o,1)}}function t(e,t){let n,r;try{let s=l(e,_.__wbindgen_malloc),u=g,f=_.parse_xlsx(s,u,!c(t),c(t)?BigInt(0):t);var i=f[0],o=f[1];if(f[3])throw i=0,o=0,d(f[2]);return n=i,r=o,a(i,o)}finally{_.__wbindgen_free(n,r,1)}}function n(){return{__proto__:null,\"./xlsx_parser_bg.js\":{__proto__:null,__wbg_error_a6fa202b58aa1cd3:function(e,t){let n,r;try{n=e,r=t,console.error(a(e,t))}finally{_.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=u(n,_.__wbindgen_malloc,_.__wbindgen_realloc),a=g;i().setInt32(e+4,a,!0),i().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return a(e,t)},__wbindgen_init_externref_table:function(){let e=_.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}let r=null;function i(){return(r===null||r.buffer.detached===!0||r.buffer.detached===void 0&&r.buffer!==_.memory.buffer)&&(r=new DataView(_.memory.buffer)),r}function a(e,t){return e>>>=0,m(e,t)}let o=null;function s(){return(o===null||o.byteLength===0)&&(o=new Uint8Array(_.memory.buffer)),o}function c(e){return e==null}function l(e,t){let n=t(e.length*1,1)>>>0;return s().set(e,n/1),g=e.length,n}function u(e,t,n){if(n===void 0){let n=h.encode(e),r=t(n.length,1)>>>0;return s().subarray(r,r+n.length).set(n),g=n.length,r}let r=e.length,i=t(r,1)>>>0,a=s(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=s().subarray(i+o,i+r),a=h.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return g=o,i}function d(e){let t=_.__wbindgen_externrefs.get(e);return _.__externref_table_dealloc(e),t}let f=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});f.decode();let p=0;function m(e,t){return p+=t,p>=2146435072&&(f=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),f.decode(),p=t),f.decode(s().subarray(e,e+t))}const h=new TextEncoder;`encodeInto`in h||(h.encodeInto=function(e,t){let n=h.encode(e);return t.set(n),{read:e.length,written:n.length}});let g=0,_;function v(e,t){return _=e.exports,r=null,o=null,_.__wbindgen_start(),_}async function y(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.ok&&n(e.type)&&e.headers.get(`Content-Type`)!==`application/wasm`)console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\",t);else throw t}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}function n(e){switch(e){case`basic`:case`cors`:case`default`:return!0}return!1}}async function b(e){if(_!==void 0)return _;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn(`using deprecated parameters for the initialization function; pass a single object instead`));let t=n();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:r,module:i}=await y(await e,t);return v(r,i)}const x=e=>`https://fonts.googleapis.com/css2?family=${e}:wght@400;700&display=swap`;x(`Noto+Sans+KR`),x(`Noto+Sans+SC`),x(`Noto+Sans+TC`),x(`Noto+Sans+JP`),x(`Noto+Serif+KR`),x(`Noto+Serif+SC`),x(`Noto+Serif+TC`),x(`Noto+Serif+JP`),x(`Noto+Sans`),x(`Noto+Serif`),x(`Noto+Sans+Devanagari`),x(`Noto+Sans+Thai`),x(`Noto+Sans+Hebrew`),x(`Noto+Serif+Hebrew`),Math.PI*2/216e5,Math.PI*2/216e5,35*Math.PI/180,12*Math.PI/180;function S(e){if(!e.startsWith(`data:`))return null;let t=e.indexOf(`,`);if(t===-1)return null;let n=atob(e.slice(t+1)),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r.buffer}const C=[40,41,41,40,60,62,62,60,91,93,93,91,123,125,125,123,171,187,187,171,3898,3899,3899,3898,3900,3901,3901,3900,5787,5788,5788,5787,8249,8250,8250,8249,8261,8262,8262,8261,8317,8318,8318,8317,8333,8334,8334,8333,8712,8715,8713,8716,8714,8717,8715,8712,8716,8713,8717,8714,8725,10741,8735,11262,8736,10659,8737,10651,8738,10656,8740,10990,8764,8765,8765,8764,8771,8909,8773,8780,8780,8773,8786,8787,8787,8786,8788,8789,8789,8788,8804,8805,8805,8804,8806,8807,8807,8806,8808,8809,8809,8808,8810,8811,8811,8810,8814,8815,8815,8814,8816,8817,8817,8816,8818,8819,8819,8818,8820,8821,8821,8820,8822,8823,8823,8822,8824,8825,8825,8824,8826,8827,8827,8826,8828,8829,8829,8828,8830,8831,8831,8830,8832,8833,8833,8832,8834,8835,8835,8834,8836,8837,8837,8836,8838,8839,8839,8838,8840,8841,8841,8840,8842,8843,8843,8842,8847,8848,8848,8847,8849,8850,8850,8849,8856,10680,8866,8867,8867,8866,8870,10974,8872,10980,8873,10979,8875,10981,8880,8881,8881,8880,8882,8883,8883,8882,8884,8885,8885,8884,8886,8887,8887,8886,8888,10204,8905,8906,8906,8905,8907,8908,8908,8907,8909,8771,8912,8913,8913,8912,8918,8919,8919,8918,8920,8921,8921,8920,8922,8923,8923,8922,8924,8925,8925,8924,8926,8927,8927,8926,8928,8929,8929,8928,8930,8931,8931,8930,8932,8933,8933,8932,8934,8935,8935,8934,8936,8937,8937,8936,8938,8939,8939,8938,8940,8941,8941,8940,8944,8945,8945,8944,8946,8954,8947,8955,8948,8956,8950,8957,8951,8958,8954,8946,8955,8947,8956,8948,8957,8950,8958,8951,8968,8969,8969,8968,8970,8971,8971,8970,9001,9002,9002,9001,10088,10089,10089,10088,10090,10091,10091,10090,10092,10093,10093,10092,10094,10095,10095,10094,10096,10097,10097,10096,10098,10099,10099,10098,10100,10101,10101,10100,10179,10180,10180,10179,10181,10182,10182,10181,10184,10185,10185,10184,10187,10189,10189,10187,10197,10198,10198,10197,10204,8888,10205,10206,10206,10205,10210,10211,10211,10210,10212,10213,10213,10212,10214,10215,10215,10214,10216,10217,10217,10216,10218,10219,10219,10218,10220,10221,10221,10220,10222,10223,10223,10222,10627,10628,10628,10627,10629,10630,10630,10629,10631,10632,10632,10631,10633,10634,10634,10633,10635,10636,10636,10635,10637,10640,10638,10639,10639,10638,10640,10637,10641,10642,10642,10641,10643,10644,10644,10643,10645,10646,10646,10645,10647,10648,10648,10647,10651,8737,10656,8738,10659,8736,10660,10661,10661,10660,10664,10665,10665,10664,10666,10667,10667,10666,10668,10669,10669,10668,10670,10671,10671,10670,10680,8856,10688,10689,10689,10688,10692,10693,10693,10692,10703,10704,10704,10703,10705,10706,10706,10705,10708,10709,10709,10708,10712,10713,10713,10712,10714,10715,10715,10714,10728,10729,10729,10728,10741,8725,10744,10745,10745,10744,10748,10749,10749,10748,10795,10796,10796,10795,10797,10798,10798,10797,10804,10805,10805,10804,10812,10813,10813,10812,10852,10853,10853,10852,10873,10874,10874,10873,10875,10876,10876,10875,10877,10878,10878,10877,10879,10880,10880,10879,10881,10882,10882,10881,10883,10884,10884,10883,10885,10886,10886,10885,10887,10888,10888,10887,10889,10890,10890,10889,10891,10892,10892,10891,10893,10894,10894,10893,10895,10896,10896,10895,10897,10898,10898,10897,10899,10900,10900,10899,10901,10902,10902,10901,10903,10904,10904,10903,10905,10906,10906,10905,10907,10908,10908,10907,10909,10910,10910,10909,10911,10912,10912,10911,10913,10914,10914,10913,10918,10919,10919,10918,10920,10921,10921,10920,10922,10923,10923,10922,10924,10925,10925,10924,10927,10928,10928,10927,10929,10930,10930,10929,10931,10932,10932,10931,10933,10934,10934,10933,10935,10936,10936,10935,10937,10938,10938,10937,10939,10940,10940,10939,10941,10942,10942,10941,10943,10944,10944,10943,10945,10946,10946,10945,10947,10948,10948,10947,10949,10950,10950,10949,10951,10952,10952,10951,10953,10954,10954,10953,10955,10956,10956,10955,10957,10958,10958,10957,10959,10960,10960,10959,10961,10962,10962,10961,10963,10964,10964,10963,10965,10966,10966,10965,10974,8870,10979,8873,10980,8872,10981,8875,10988,10989,10989,10988,10990,8740,10999,11e3,11e3,10999,11001,11002,11002,11001,11262,8735,11778,11779,11779,11778,11780,11781,11781,11780,11785,11786,11786,11785,11788,11789,11789,11788,11804,11805,11805,11804,11808,11809,11809,11808,11810,11811,11811,11810,11812,11813,11813,11812,11814,11815,11815,11814,11816,11817,11817,11816,11861,11862,11862,11861,11863,11864,11864,11863,11865,11866,11866,11865,11867,11868,11868,11867,12296,12297,12297,12296,12298,12299,12299,12298,12300,12301,12301,12300,12302,12303,12303,12302,12304,12305,12305,12304,12308,12309,12309,12308,12310,12311,12311,12310,12312,12313,12313,12312,12314,12315,12315,12314,65113,65114,65114,65113,65115,65116,65116,65115,65117,65118,65118,65117,65124,65125,65125,65124,65288,65289,65289,65288,65308,65310,65310,65308,65339,65341,65341,65339,65371,65373,65373,65371,65375,65376,65376,65375,65378,65379,65379,65378],w=[40,41,0,41,40,1,91,93,0,93,91,1,123,125,0,125,123,1,3898,3899,0,3899,3898,1,3900,3901,0,3901,3900,1,5787,5788,0,5788,5787,1,8261,8262,0,8262,8261,1,8317,8318,0,8318,8317,1,8333,8334,0,8334,8333,1,8968,8969,0,8969,8968,1,8970,8971,0,8971,8970,1,9001,9002,0,9002,9001,1,10088,10089,0,10089,10088,1,10090,10091,0,10091,10090,1,10092,10093,0,10093,10092,1,10094,10095,0,10095,10094,1,10096,10097,0,10097,10096,1,10098,10099,0,10099,10098,1,10100,10101,0,10101,10100,1,10181,10182,0,10182,10181,1,10214,10215,0,10215,10214,1,10216,10217,0,10217,10216,1,10218,10219,0,10219,10218,1,10220,10221,0,10221,10220,1,10222,10223,0,10223,10222,1,10627,10628,0,10628,10627,1,10629,10630,0,10630,10629,1,10631,10632,0,10632,10631,1,10633,10634,0,10634,10633,1,10635,10636,0,10636,10635,1,10637,10640,0,10638,10639,1,10639,10638,0,10640,10637,1,10641,10642,0,10642,10641,1,10643,10644,0,10644,10643,1,10645,10646,0,10646,10645,1,10647,10648,0,10648,10647,1,10712,10713,0,10713,10712,1,10714,10715,0,10715,10714,1,10748,10749,0,10749,10748,1,11810,11811,0,11811,11810,1,11812,11813,0,11813,11812,1,11814,11815,0,11815,11814,1,11816,11817,0,11817,11816,1,11861,11862,0,11862,11861,1,11863,11864,0,11864,11863,1,11865,11866,0,11866,11865,1,11867,11868,0,11868,11867,1,12296,12297,0,12297,12296,1,12298,12299,0,12299,12298,1,12300,12301,0,12301,12300,1,12302,12303,0,12303,12302,1,12304,12305,0,12305,12304,1,12308,12309,0,12309,12308,1,12310,12311,0,12311,12310,1,12312,12313,0,12313,12312,1,12314,12315,0,12315,12314,1,65113,65114,0,65114,65113,1,65115,65116,0,65116,65115,1,65117,65118,0,65118,65117,1,65288,65289,0,65289,65288,1,65339,65341,0,65341,65339,1,65371,65373,0,65373,65371,1,65375,65376,0,65376,65375,1,65378,65379,0,65379,65378,1];(()=>{let e=new Map;for(let t=0;t<C.length;t+=2)e.set(C[t],C[t+1]);return e})(),(()=>{let e=new Map;for(let t=0;t<w.length;t+=3)e.set(w[t],{pair:w[t+1],type:w[t+2]===0?`o`:`c`});return e})();let T=null;self.onmessage=async n=>{let r=n.data;if(r.type===`init`){T=b(S(r.wasmUrl)??r.wasmUrl);return}let i=r.id;try{if(await T,r.type===`parse`){let e=typeof r.maxZipEntryBytes==`number`&&r.maxZipEntryBytes>0?BigInt(r.maxZipEntryBytes):void 0,n=t(new Uint8Array(r.data),e),a={type:`parsed`,id:i,workbook:JSON.parse(n)};self.postMessage(a)}else if(r.type===`parseSheet`){let t=typeof r.maxZipEntryBytes==`number`&&r.maxZipEntryBytes>0?BigInt(r.maxZipEntryBytes):void 0,n=e(new Uint8Array(r.data),r.sheetIndex,r.sheetName,t),a={type:`parsedSheet`,id:i,worksheet:JSON.parse(n)};self.postMessage(a)}}catch(e){let t={type:`error`,id:i,message:String(e)};self.postMessage(t)}};", C = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", S], { type: "text/javascript;charset=utf-8" });
|
|
@@ -211,22 +211,22 @@ function H(e, t) {
|
|
|
211
211
|
if (r && r.kind === "op" && (r.text === "<" || r.text === ">" || r.text === "<=" || r.text === ">=" || r.text === "=" || r.text === "<>")) {
|
|
212
212
|
B(e);
|
|
213
213
|
let i = ee(e, t);
|
|
214
|
-
return
|
|
214
|
+
return U(r.text, n, i);
|
|
215
215
|
}
|
|
216
216
|
return n;
|
|
217
217
|
}
|
|
218
218
|
function ee(e, t) {
|
|
219
|
-
let n =
|
|
219
|
+
let n = te(e, t);
|
|
220
220
|
for (;;) {
|
|
221
221
|
let r = z(e);
|
|
222
222
|
if (!r || r.kind !== "op" || r.text !== "&") break;
|
|
223
223
|
B(e);
|
|
224
|
-
let i =
|
|
224
|
+
let i = te(e, t);
|
|
225
225
|
n = M(n) + M(i);
|
|
226
226
|
}
|
|
227
227
|
return n;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function U(e, t, n) {
|
|
230
230
|
let r = typeof t == "string" && isNaN(parseFloat(t)) ? null : j(t), i = typeof n == "string" && isNaN(parseFloat(n)) ? null : j(n);
|
|
231
231
|
if (r !== null && i !== null) switch (e) {
|
|
232
232
|
case "<": return r < i;
|
|
@@ -247,24 +247,24 @@ function te(e, t, n) {
|
|
|
247
247
|
}
|
|
248
248
|
return !1;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
let n =
|
|
250
|
+
function te(e, t) {
|
|
251
|
+
let n = ne(e, t);
|
|
252
252
|
for (;;) {
|
|
253
253
|
let r = z(e);
|
|
254
254
|
if (!r || r.kind !== "op" || r.text !== "+" && r.text !== "-") break;
|
|
255
255
|
B(e);
|
|
256
|
-
let i =
|
|
256
|
+
let i = ne(e, t);
|
|
257
257
|
n = r.text === "+" ? j(n) + j(i) : j(n) - j(i);
|
|
258
258
|
}
|
|
259
259
|
return n;
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
let n =
|
|
261
|
+
function ne(e, t) {
|
|
262
|
+
let n = re(e, t);
|
|
263
263
|
for (;;) {
|
|
264
264
|
let r = z(e);
|
|
265
265
|
if (!r || r.kind !== "op" || r.text !== "*" && r.text !== "/") break;
|
|
266
266
|
B(e);
|
|
267
|
-
let i =
|
|
267
|
+
let i = re(e, t);
|
|
268
268
|
if (r.text === "*") n = j(n) * j(i);
|
|
269
269
|
else {
|
|
270
270
|
let e = j(i);
|
|
@@ -273,11 +273,11 @@ function re(e, t) {
|
|
|
273
273
|
}
|
|
274
274
|
return n;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function re(e, t) {
|
|
277
277
|
let n = z(e);
|
|
278
|
-
return n && n.kind === "op" && n.text === "-" ? (B(e), -j(
|
|
278
|
+
return n && n.kind === "op" && n.text === "-" ? (B(e), -j(re(e, t))) : n && n.kind === "op" && n.text === "+" ? (B(e), j(re(e, t))) : ie(e, t);
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function ie(e, t) {
|
|
281
281
|
let n = B(e);
|
|
282
282
|
if (!n) return 0;
|
|
283
283
|
if (n.kind === "num") return parseFloat(n.text);
|
|
@@ -293,9 +293,9 @@ function ae(e, t) {
|
|
|
293
293
|
B(e);
|
|
294
294
|
let r = B(e);
|
|
295
295
|
if (r?.kind !== "ref" || !r.ref) throw Error("range: expected ref after :");
|
|
296
|
-
return
|
|
296
|
+
return se(n.ref, r.ref, t);
|
|
297
297
|
}
|
|
298
|
-
return
|
|
298
|
+
return oe(n.ref, t);
|
|
299
299
|
}
|
|
300
300
|
if (n.kind === "name") {
|
|
301
301
|
if (z(e)?.kind === "lparen") {
|
|
@@ -304,10 +304,10 @@ function ae(e, t) {
|
|
|
304
304
|
if (z(e)?.kind !== "rparen") for (r.push(V(e, t)); z(e)?.kind === "comma";) B(e), r.push(V(e, t));
|
|
305
305
|
let i = B(e);
|
|
306
306
|
if (!i || i.kind !== "rparen") throw Error("missing )");
|
|
307
|
-
return
|
|
307
|
+
return le(n.text, r, t);
|
|
308
308
|
}
|
|
309
309
|
let r = t.definedNames.get(n.text);
|
|
310
|
-
return r && t.depth < O ? R(
|
|
310
|
+
return r && t.depth < O ? R(ae(r.formula), {
|
|
311
311
|
...t,
|
|
312
312
|
anchorRow: 1,
|
|
313
313
|
anchorCol: 1,
|
|
@@ -316,20 +316,20 @@ function ae(e, t) {
|
|
|
316
316
|
}
|
|
317
317
|
return 0;
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function ae(e) {
|
|
320
320
|
let t = e.match(/^(?:'[^']*'|[A-Za-z_][A-Za-z0-9_.]*)!(.*)$/);
|
|
321
321
|
return t ? t[1] : e;
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function oe(e, t) {
|
|
324
324
|
let n = e.colAbs ? e.col : e.col + (t.col - t.anchorCol), r = e.rowAbs ? e.row : e.row + (t.row - t.anchorRow);
|
|
325
|
-
return
|
|
325
|
+
return ce(t.cellIndex.get(`${r}:${n}`));
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function se(e, t, n) {
|
|
328
328
|
let r = e.colAbs ? e.col : e.col + (n.col - n.anchorCol), i = e.rowAbs ? e.row : e.row + (n.row - n.anchorRow), a = t.colAbs ? t.col : t.col + (n.col - n.anchorCol), o = t.rowAbs ? t.row : t.row + (n.row - n.anchorRow), s = Math.min(r, a), c = Math.max(r, a), l = Math.min(i, o), u = Math.max(i, o), d = [], f = 4096;
|
|
329
|
-
for (let e = l; e <= u && d.length < f; e++) for (let t = s; t <= c && d.length < f; t++) d.push(
|
|
329
|
+
for (let e = l; e <= u && d.length < f; e++) for (let t = s; t <= c && d.length < f; t++) d.push(ce(n.cellIndex.get(`${e}:${t}`)));
|
|
330
330
|
return d;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function ce(e) {
|
|
333
333
|
if (!e) return null;
|
|
334
334
|
switch (e.value.type) {
|
|
335
335
|
case "number": return e.value.number;
|
|
@@ -339,7 +339,7 @@ function le(e) {
|
|
|
339
339
|
default: return null;
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function le(e, t, n) {
|
|
343
343
|
switch (e.toUpperCase()) {
|
|
344
344
|
case "AND": return t.flatMap(E).every((e) => A(e));
|
|
345
345
|
case "OR": return t.flatMap(E).some((e) => A(e));
|
|
@@ -426,10 +426,10 @@ function ue(e, t, n) {
|
|
|
426
426
|
case "COUNT": return t.flatMap(E).filter((e) => typeof e == "number").length;
|
|
427
427
|
case "COUNTA": return t.flatMap(E).filter((e) => e != null && e !== "").length;
|
|
428
428
|
case "COUNTBLANK": return t.flatMap(E).filter((e) => e == null || e === "").length;
|
|
429
|
-
case "COUNTIF": return
|
|
430
|
-
case "SUMIF": return
|
|
429
|
+
case "COUNTIF": return W(E(t[0]), t[1]);
|
|
430
|
+
case "SUMIF": return ue(E(t[0]), t[1], t[2] === void 0 ? null : E(t[2]));
|
|
431
431
|
case "AVERAGEIF": {
|
|
432
|
-
let e = E(t[0]), n =
|
|
432
|
+
let e = E(t[0]), n = ue(e, t[1], t[2] === void 0 ? null : E(t[2])), r = W(e, t[1]);
|
|
433
433
|
return r === 0 ? null : j(n) / r;
|
|
434
434
|
}
|
|
435
435
|
case "LEN": return M(t[0]).length;
|
|
@@ -467,33 +467,33 @@ function ue(e, t, n) {
|
|
|
467
467
|
case "VALUE": return j(t[0]);
|
|
468
468
|
case "ROW": return n.row;
|
|
469
469
|
case "COLUMN": return n.col;
|
|
470
|
-
case "TODAY": return
|
|
471
|
-
case "NOW": return
|
|
472
|
-
case "DATE": return
|
|
473
|
-
case "YEAR": return
|
|
474
|
-
case "MONTH": return
|
|
475
|
-
case "DAY": return
|
|
470
|
+
case "TODAY": return J();
|
|
471
|
+
case "NOW": return de();
|
|
472
|
+
case "DATE": return fe(j(t[0]), j(t[1]), j(t[2]));
|
|
473
|
+
case "YEAR": return pe(j(t[0])).y;
|
|
474
|
+
case "MONTH": return pe(j(t[0])).m;
|
|
475
|
+
case "DAY": return pe(j(t[0])).d;
|
|
476
476
|
case "WEEKDAY": {
|
|
477
|
-
let e =
|
|
477
|
+
let e = Y(j(t[0])).getUTCDay(), n = j(t[1] ?? 1);
|
|
478
478
|
return n === 2 ? e === 0 ? 7 : e : n === 3 ? e === 0 ? 6 : e - 1 : e + 1;
|
|
479
479
|
}
|
|
480
480
|
default: return 0;
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
|
-
function
|
|
484
|
-
let n =
|
|
483
|
+
function W(e, t) {
|
|
484
|
+
let n = G(t), r = 0;
|
|
485
485
|
for (let t of e) n(t) && r++;
|
|
486
486
|
return r;
|
|
487
487
|
}
|
|
488
|
-
function
|
|
489
|
-
let r =
|
|
488
|
+
function ue(e, t, n) {
|
|
489
|
+
let r = G(t), i = n ?? e, a = 0;
|
|
490
490
|
for (let t = 0; t < e.length; t++) if (r(e[t])) {
|
|
491
491
|
let e = i[t];
|
|
492
492
|
typeof e == "number" && (a += e);
|
|
493
493
|
}
|
|
494
494
|
return a;
|
|
495
495
|
}
|
|
496
|
-
function
|
|
496
|
+
function G(e) {
|
|
497
497
|
let t = D(e);
|
|
498
498
|
if (typeof t != "string") {
|
|
499
499
|
let e = typeof t == "number" ? t : null;
|
|
@@ -520,24 +520,24 @@ function W(e) {
|
|
|
520
520
|
}
|
|
521
521
|
};
|
|
522
522
|
}
|
|
523
|
-
var
|
|
524
|
-
function
|
|
523
|
+
var K = 25569, q = 864e5;
|
|
524
|
+
function J() {
|
|
525
525
|
let e = /* @__PURE__ */ new Date(), t = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate());
|
|
526
|
-
return Math.floor(t /
|
|
526
|
+
return Math.floor(t / q) + K;
|
|
527
527
|
}
|
|
528
|
-
function
|
|
529
|
-
return Date.now() /
|
|
528
|
+
function de() {
|
|
529
|
+
return Date.now() / q + K;
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function fe(e, t, n) {
|
|
532
532
|
let r = Date.UTC(e, t - 1, n);
|
|
533
|
-
return Math.floor(r /
|
|
533
|
+
return Math.floor(r / q) + K;
|
|
534
534
|
}
|
|
535
|
-
function
|
|
536
|
-
let t = (Math.floor(e) -
|
|
535
|
+
function Y(e) {
|
|
536
|
+
let t = (Math.floor(e) - K) * q;
|
|
537
537
|
return new Date(t);
|
|
538
538
|
}
|
|
539
|
-
function
|
|
540
|
-
let t =
|
|
539
|
+
function pe(e) {
|
|
540
|
+
let t = Y(e);
|
|
541
541
|
return {
|
|
542
542
|
y: t.getUTCFullYear(),
|
|
543
543
|
m: t.getUTCMonth() + 1,
|
|
@@ -546,7 +546,7 @@ function me(e) {
|
|
|
546
546
|
}
|
|
547
547
|
//#endregion
|
|
548
548
|
//#region packages/xlsx/src/number-format.ts
|
|
549
|
-
function
|
|
549
|
+
function me(e) {
|
|
550
550
|
switch (e.type) {
|
|
551
551
|
case "empty": return "";
|
|
552
552
|
case "text": return e.text;
|
|
@@ -555,15 +555,15 @@ function he(e) {
|
|
|
555
555
|
case "error": return e.error;
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
|
-
function
|
|
558
|
+
function he(e, t, n) {
|
|
559
559
|
let r = t.cellXfs[e.styleIndex ?? 0]?.numFmtId ?? 0, i = t.numFmts?.find((e) => e.numFmtId === r)?.formatCode ?? null, a = n?.numFmtId ?? r, o = n?.formatCode ?? i;
|
|
560
560
|
if (e.value.type !== "number") {
|
|
561
|
-
let t =
|
|
562
|
-
return o ?
|
|
561
|
+
let t = me(e.value);
|
|
562
|
+
return o ? ge(t, o) : t;
|
|
563
563
|
}
|
|
564
|
-
return
|
|
564
|
+
return Oe(_e(e.formula) ?? e.value.number, a, o);
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function ge(e, t) {
|
|
567
567
|
let n = t.split(";");
|
|
568
568
|
if (n.length < 4) return e;
|
|
569
569
|
let r = n[3];
|
|
@@ -582,12 +582,12 @@ function _e(e, t) {
|
|
|
582
582
|
}
|
|
583
583
|
return i;
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function _e(e) {
|
|
586
586
|
if (!e) return null;
|
|
587
587
|
let t = e.trim().replace(/^=/, "").toUpperCase().replace(/\s+/g, "");
|
|
588
|
-
return t === "TODAY()" ?
|
|
588
|
+
return t === "TODAY()" ? J() : t === "NOW()" ? de() : null;
|
|
589
589
|
}
|
|
590
|
-
var
|
|
590
|
+
var ve = {
|
|
591
591
|
14: "m/d/yyyy",
|
|
592
592
|
15: "d-mmm-yy",
|
|
593
593
|
16: "d-mmm",
|
|
@@ -611,7 +611,7 @@ var ye = {
|
|
|
611
611
|
56: "m\"月\"d\"日\"",
|
|
612
612
|
57: "[$-411]ge.m.d",
|
|
613
613
|
58: "[$-411]ggge\"年\"m\"月\"d\"日\""
|
|
614
|
-
},
|
|
614
|
+
}, ye = [
|
|
615
615
|
"January",
|
|
616
616
|
"February",
|
|
617
617
|
"March",
|
|
@@ -624,7 +624,7 @@ var ye = {
|
|
|
624
624
|
"October",
|
|
625
625
|
"November",
|
|
626
626
|
"December"
|
|
627
|
-
],
|
|
627
|
+
], be = [
|
|
628
628
|
"Sunday",
|
|
629
629
|
"Monday",
|
|
630
630
|
"Tuesday",
|
|
@@ -632,7 +632,7 @@ var ye = {
|
|
|
632
632
|
"Thursday",
|
|
633
633
|
"Friday",
|
|
634
634
|
"Saturday"
|
|
635
|
-
],
|
|
635
|
+
], xe = [
|
|
636
636
|
"日",
|
|
637
637
|
"月",
|
|
638
638
|
"火",
|
|
@@ -640,7 +640,7 @@ var ye = {
|
|
|
640
640
|
"木",
|
|
641
641
|
"金",
|
|
642
642
|
"土"
|
|
643
|
-
],
|
|
643
|
+
], Se = [
|
|
644
644
|
"日曜日",
|
|
645
645
|
"月曜日",
|
|
646
646
|
"火曜日",
|
|
@@ -648,7 +648,7 @@ var ye = {
|
|
|
648
648
|
"木曜日",
|
|
649
649
|
"金曜日",
|
|
650
650
|
"土曜日"
|
|
651
|
-
],
|
|
651
|
+
], Ce = [
|
|
652
652
|
{
|
|
653
653
|
start: new Date(Date.UTC(2019, 4, 1)),
|
|
654
654
|
abbr: "R",
|
|
@@ -680,14 +680,14 @@ var ye = {
|
|
|
680
680
|
long: "明治"
|
|
681
681
|
}
|
|
682
682
|
];
|
|
683
|
-
function
|
|
684
|
-
for (let t of
|
|
683
|
+
function we(e) {
|
|
684
|
+
for (let t of Ce) if (e.getTime() >= t.start.getTime()) return {
|
|
685
685
|
abbr: t.abbr,
|
|
686
686
|
short: t.short,
|
|
687
687
|
long: t.long,
|
|
688
688
|
year: e.getUTCFullYear() - t.start.getUTCFullYear() + 1
|
|
689
689
|
};
|
|
690
|
-
let t =
|
|
690
|
+
let t = Ce[Ce.length - 1];
|
|
691
691
|
return {
|
|
692
692
|
abbr: t.abbr,
|
|
693
693
|
short: t.short,
|
|
@@ -695,11 +695,11 @@ function Te(e) {
|
|
|
695
695
|
year: e.getUTCFullYear()
|
|
696
696
|
};
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function Te(e) {
|
|
699
699
|
return /* @__PURE__ */ new Date((e - 25569) * 86400 * 1e3);
|
|
700
700
|
}
|
|
701
|
-
function
|
|
702
|
-
let n =
|
|
701
|
+
function Ee(e, t) {
|
|
702
|
+
let n = Te(e), r = n.getUTCFullYear(), i = n.getUTCMonth() + 1, a = n.getUTCDate(), o = n.getUTCDay(), s = n.getUTCHours(), c = n.getUTCMinutes(), l = n.getUTCSeconds(), u = t.split(";")[0], d = /am\/pm|a\/p/i.test(u), f = null, p = () => f ??= we(n), m = "", h = 0, g = !1;
|
|
703
703
|
for (; h < u.length;) {
|
|
704
704
|
let t = u[h];
|
|
705
705
|
if (t === "\"") {
|
|
@@ -727,11 +727,11 @@ function De(e, t) {
|
|
|
727
727
|
let e = 0;
|
|
728
728
|
for (; h < u.length && u[h].toLowerCase() === "m";) e++, h++;
|
|
729
729
|
let t = u.slice(h).replace(/\[[^\]]*\]/g, "");
|
|
730
|
-
g || /^:s/i.test(t) ? m += e >= 2 ? String(c).padStart(2, "0") : String(c) : e === 1 ? m += String(i) : e === 2 ? m += String(i).padStart(2, "0") : e === 3 ? m +=
|
|
730
|
+
g || /^:s/i.test(t) ? m += e >= 2 ? String(c).padStart(2, "0") : String(c) : e === 1 ? m += String(i) : e === 2 ? m += String(i).padStart(2, "0") : e === 3 ? m += ye[i - 1].slice(0, 3) : e === 4 ? m += ye[i - 1] : m += ye[i - 1][0], g = !1;
|
|
731
731
|
} else if (t === "d" || t === "D") {
|
|
732
732
|
let e = 0;
|
|
733
733
|
for (; h < u.length && u[h].toLowerCase() === "d";) e++, h++;
|
|
734
|
-
e === 1 ? m += String(a) : e === 2 ? m += String(a).padStart(2, "0") : e === 3 ? m +=
|
|
734
|
+
e === 1 ? m += String(a) : e === 2 ? m += String(a).padStart(2, "0") : e === 3 ? m += be[o].slice(0, 3) : m += be[o], g = !1;
|
|
735
735
|
} else if (t === "h" || t === "H") {
|
|
736
736
|
let e = 0;
|
|
737
737
|
for (; h < u.length && u[h].toLowerCase() === "h";) e++, h++;
|
|
@@ -758,49 +758,49 @@ function De(e, t) {
|
|
|
758
758
|
m += e >= 2 ? String(t).padStart(2, "0") : String(t), g = !1;
|
|
759
759
|
} else if (t === "A" || t === "a") {
|
|
760
760
|
let e = u.slice(h).toUpperCase();
|
|
761
|
-
e.startsWith("AAAA") ? (m +=
|
|
761
|
+
e.startsWith("AAAA") ? (m += Se[o], h += 4) : e.startsWith("AAA") ? (m += xe[o], h += 3) : e.startsWith("AM/PM") ? (m += s < 12 ? "AM" : "PM", h += 5) : e.startsWith("A/P") ? (m += s < 12 ? "A" : "P", h += 3) : (m += t, h++), g = !1;
|
|
762
762
|
} else m += t, h++, t !== ":" && t !== "/" && t !== "-" && t !== "." && t !== " " && (g = !1);
|
|
763
763
|
}
|
|
764
764
|
return m;
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function De(e) {
|
|
767
767
|
if (/\[[hms]+\]/i.test(e)) return !0;
|
|
768
768
|
let t = e.replace(/"[^"]*"/g, "").replace(/\[[^\]]*\]/g, "");
|
|
769
769
|
return /[yd]/i.test(t) || /a{3,}/i.test(t);
|
|
770
770
|
}
|
|
771
|
-
function
|
|
772
|
-
let r =
|
|
773
|
-
if (r) return
|
|
771
|
+
function Oe(e, t, n) {
|
|
772
|
+
let r = ve[t];
|
|
773
|
+
if (r) return Ee(e, r);
|
|
774
774
|
if (n && n.trim().toLowerCase() === "general") return String(e);
|
|
775
|
-
if (n) return
|
|
775
|
+
if (n) return De(n) ? Ee(e, n) : Ne(e, n);
|
|
776
776
|
switch (t) {
|
|
777
777
|
case 0: return String(e);
|
|
778
778
|
case 1: return Math.round(e).toString();
|
|
779
779
|
case 2: return e.toFixed(2);
|
|
780
|
-
case 3: return
|
|
781
|
-
case 4: return
|
|
780
|
+
case 3: return ke(e, 0);
|
|
781
|
+
case 4: return ke(e, 2);
|
|
782
782
|
case 9: return Math.round(e * 100) + "%";
|
|
783
783
|
case 10: return (e * 100).toFixed(2) + "%";
|
|
784
784
|
case 11: return e.toExponential(2);
|
|
785
785
|
case 37:
|
|
786
|
-
case 38: return
|
|
786
|
+
case 38: return ke(e, 0);
|
|
787
787
|
case 39:
|
|
788
|
-
case 40: return
|
|
788
|
+
case 40: return ke(e, 2);
|
|
789
789
|
case 49: return String(e);
|
|
790
790
|
default: return String(e);
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function ke(e, t) {
|
|
794
794
|
return e.toLocaleString("en-US", {
|
|
795
795
|
minimumFractionDigits: t,
|
|
796
796
|
maximumFractionDigits: t
|
|
797
797
|
});
|
|
798
798
|
}
|
|
799
|
-
function
|
|
799
|
+
function Ae(e) {
|
|
800
800
|
let t = e.match(/\.([0#]+)/);
|
|
801
801
|
return t ? t[1].length : 0;
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function je(e) {
|
|
804
804
|
let t = [], n = "", r = !1, i = !1, a = (e) => {
|
|
805
805
|
if (!e) return;
|
|
806
806
|
let n = t[t.length - 1];
|
|
@@ -837,44 +837,44 @@ function Me(e) {
|
|
|
837
837
|
numSpec: n
|
|
838
838
|
};
|
|
839
839
|
}
|
|
840
|
-
function
|
|
841
|
-
let n = t.includes(",") && /[#0]/.test(t), r =
|
|
842
|
-
return n ?
|
|
840
|
+
function Me(e, t) {
|
|
841
|
+
let n = t.includes(",") && /[#0]/.test(t), r = Ae(t);
|
|
842
|
+
return n ? ke(e, r) : t.includes(".") ? e.toFixed(r) : /[#0?]/.test(t) ? Math.round(e).toString() : String(e);
|
|
843
843
|
}
|
|
844
|
-
function
|
|
844
|
+
function Ne(e, t) {
|
|
845
845
|
let n = t.split(";"), r, i = !1;
|
|
846
846
|
e > 0 ? r = n[0] : e < 0 ? n.length > 1 ? (r = n[1], i = !0) : r = n[0] : r = n.length > 2 ? n[2] : n[0];
|
|
847
|
-
let { tokens: a, numSpec: o } =
|
|
847
|
+
let { tokens: a, numSpec: o } = je(r), s = a.some((e) => e.kind === "percent"), c = a.find((e) => e.kind === "sci"), l = i ? Math.abs(e) : e;
|
|
848
848
|
s && (l *= 100);
|
|
849
849
|
let u, d = "";
|
|
850
850
|
if (c) {
|
|
851
|
-
let e =
|
|
851
|
+
let e = Ae(o), [t, n] = l.toExponential(e).split("e");
|
|
852
852
|
u = t;
|
|
853
853
|
let r = parseInt(n, 10);
|
|
854
854
|
d = (r < 0 ? "-" : c.expSign ? "+" : "") + String(Math.abs(r)).padStart(2, "0");
|
|
855
|
-
} else u =
|
|
855
|
+
} else u = Me(l, o);
|
|
856
856
|
let f = "", p = !1;
|
|
857
857
|
for (let e of a) e.kind === "lit" ? f += e.text : e.kind === "percent" ? f += "%" : e.kind === "num" ? (f += u, p = !0) : e.kind === "sci" && (f += "E" + d);
|
|
858
858
|
return !p && (o.length > 0 || c) && (f += u), f;
|
|
859
859
|
}
|
|
860
860
|
//#endregion
|
|
861
861
|
//#region packages/xlsx/src/conditional-format.ts
|
|
862
|
-
function
|
|
862
|
+
function Pe(e, t, n) {
|
|
863
863
|
for (let r of e) if (t >= r.top && t <= r.bottom && n >= r.left && n <= r.right) return !0;
|
|
864
864
|
return !1;
|
|
865
865
|
}
|
|
866
|
-
function
|
|
866
|
+
function Fe(e) {
|
|
867
867
|
return e && e.value.type === "number" ? e.value.number : null;
|
|
868
868
|
}
|
|
869
|
-
function
|
|
869
|
+
function Ie(e) {
|
|
870
870
|
return e && e.value.type === "text" ? e.value.text : null;
|
|
871
871
|
}
|
|
872
|
-
function
|
|
872
|
+
function Le(e, t) {
|
|
873
873
|
let n = [];
|
|
874
|
-
for (let r of e.rows) for (let e of r.cells) e.value.type === "number" &&
|
|
874
|
+
for (let r of e.rows) for (let e of r.cells) e.value.type === "number" && Pe(t, e.row, e.col) && n.push(e.value.number);
|
|
875
875
|
return n;
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function Re(e, t) {
|
|
878
878
|
let n = t.length ? Math.min(...t) : 0, r = t.length ? Math.max(...t) : 0, i = e.value == null ? NaN : parseFloat(e.value);
|
|
879
879
|
switch (e.kind) {
|
|
880
880
|
case "min": return n;
|
|
@@ -892,20 +892,20 @@ function ze(e, t) {
|
|
|
892
892
|
default: return isNaN(i) ? 0 : i;
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
|
-
function
|
|
895
|
+
function ze(e) {
|
|
896
896
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
897
897
|
for (let t of e.rows) for (let e of t.cells) n.set(`${e.row}:${e.col}`, e);
|
|
898
898
|
let r = /* @__PURE__ */ new Map();
|
|
899
899
|
for (let t of e.definedNames ?? []) r.set(t.name, t);
|
|
900
900
|
for (let n of e.conditionalFormats ?? []) {
|
|
901
|
-
let r =
|
|
901
|
+
let r = Le(e, n.sqref);
|
|
902
902
|
for (let e of n.rules) {
|
|
903
903
|
let i = {
|
|
904
904
|
rule: e,
|
|
905
905
|
sqref: n.sqref
|
|
906
906
|
};
|
|
907
|
-
if (e.type === "colorScale") i.scaleStops = e.stops.map((e) =>
|
|
908
|
-
else if (e.type === "dataBar") i.barMin =
|
|
907
|
+
if (e.type === "colorScale") i.scaleStops = e.stops.map((e) => Re(e, r));
|
|
908
|
+
else if (e.type === "dataBar") i.barMin = Re(e.min, r), i.barMax = Re(e.max, r);
|
|
909
909
|
else if (e.type === "top10") {
|
|
910
910
|
let t = [...r].sort((e, t) => e - t), n = t.length;
|
|
911
911
|
if (n > 0) {
|
|
@@ -924,7 +924,7 @@ function Be(e) {
|
|
|
924
924
|
i.avgStdDev = Math.sqrt(e);
|
|
925
925
|
}
|
|
926
926
|
}
|
|
927
|
-
} else e.type === "iconSet" && (i.iconThresholds = e.cfvos.map((e) =>
|
|
927
|
+
} else e.type === "iconSet" && (i.iconThresholds = e.cfvos.map((e) => Re(e, r)));
|
|
928
928
|
t.push(i);
|
|
929
929
|
}
|
|
930
930
|
}
|
|
@@ -935,7 +935,7 @@ function Be(e) {
|
|
|
935
935
|
definedNames: r
|
|
936
936
|
};
|
|
937
937
|
}
|
|
938
|
-
function
|
|
938
|
+
function Be(e, t, n) {
|
|
939
939
|
switch (t) {
|
|
940
940
|
case "greaterThan": return e > (n[0] ?? 0);
|
|
941
941
|
case "greaterThanOrEqual": return e >= (n[0] ?? 0);
|
|
@@ -948,13 +948,13 @@ function Ve(e, t, n) {
|
|
|
948
948
|
default: return !1;
|
|
949
949
|
}
|
|
950
950
|
}
|
|
951
|
-
function
|
|
951
|
+
function Ve(e) {
|
|
952
952
|
let t = e.trim();
|
|
953
953
|
if (t.length >= 2 && t.startsWith("\"") && t.endsWith("\"")) return { text: t.slice(1, -1).replace(/""/g, "\"") };
|
|
954
954
|
let n = parseFloat(t);
|
|
955
955
|
return isNaN(n) ? { text: t } : { num: n };
|
|
956
956
|
}
|
|
957
|
-
function
|
|
957
|
+
function He(e, t, n) {
|
|
958
958
|
let r = n[0] ?? "", i = n[1] ?? "", a = (e) => e.toLowerCase();
|
|
959
959
|
switch (t) {
|
|
960
960
|
case "equal": return a(e) === a(r);
|
|
@@ -968,21 +968,21 @@ function Ue(e, t, n) {
|
|
|
968
968
|
default: return !1;
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
|
-
function
|
|
971
|
+
function Ue(e, t, n) {
|
|
972
972
|
let r = e.replace("#", ""), i = t.replace("#", ""), a = parseInt(r.slice(0, 2), 16), o = parseInt(r.slice(2, 4), 16), s = parseInt(r.slice(4, 6), 16), c = parseInt(i.slice(0, 2), 16), l = parseInt(i.slice(2, 4), 16), u = parseInt(i.slice(4, 6), 16), d = Math.round(a + (c - a) * n), f = Math.round(o + (l - o) * n), p = Math.round(s + (u - s) * n);
|
|
973
973
|
return `#${d.toString(16).padStart(2, "0").toUpperCase()}${f.toString(16).padStart(2, "0").toUpperCase()}${p.toString(16).padStart(2, "0").toUpperCase()}`;
|
|
974
974
|
}
|
|
975
|
-
function
|
|
975
|
+
function We(e, t, n) {
|
|
976
976
|
if (!t.length) return "#FFFFFF";
|
|
977
977
|
if (e <= n[0]) return t[0].color;
|
|
978
978
|
if (e >= n[n.length - 1]) return t[t.length - 1].color;
|
|
979
979
|
for (let r = 1; r < n.length; r++) if (e <= n[r]) {
|
|
980
980
|
let i = n[r - 1], a = n[r], o = a === i ? 0 : (e - i) / (a - i);
|
|
981
|
-
return
|
|
981
|
+
return Ue(t[r - 1].color, t[r].color, o);
|
|
982
982
|
}
|
|
983
983
|
return t[t.length - 1].color;
|
|
984
984
|
}
|
|
985
|
-
function
|
|
985
|
+
function Ge(e, t) {
|
|
986
986
|
if (t && (t.fill && !e.fill && (e.fill = t.fill), t.font?.color && e.fontColor == null && (e.fontColor = t.font.color), t.font?.bold && e.fontBold == null && (e.fontBold = !0), t.font?.italic && e.fontItalic == null && (e.fontItalic = !0), t.font?.underline && e.fontUnderline == null && (e.fontUnderline = !0), t.font?.strike && e.fontStrike == null && (e.fontStrike = !0), t.numFmt && e.numFmt == null && (e.numFmt = {
|
|
987
987
|
numFmtId: t.numFmt.numFmtId,
|
|
988
988
|
formatCode: t.numFmt.formatCode || null
|
|
@@ -998,12 +998,12 @@ function Ke(e, t) {
|
|
|
998
998
|
};
|
|
999
999
|
}
|
|
1000
1000
|
}
|
|
1001
|
-
function
|
|
1001
|
+
function Ke(e, t, n, r, i) {
|
|
1002
1002
|
let a = {};
|
|
1003
1003
|
if (!r.compiled.length) return a;
|
|
1004
1004
|
for (let o of r.compiled) {
|
|
1005
|
-
if (!
|
|
1006
|
-
let s = o.rule, c =
|
|
1005
|
+
if (!Pe(o.sqref, t, n)) continue;
|
|
1006
|
+
let s = o.rule, c = Fe(e);
|
|
1007
1007
|
if (s.type === "expression") {
|
|
1008
1008
|
let e = o.sqref[0];
|
|
1009
1009
|
if (!e) continue;
|
|
@@ -1015,19 +1015,19 @@ function qe(e, t, n, r, i) {
|
|
|
1015
1015
|
cellIndex: r.cellIndex,
|
|
1016
1016
|
definedNames: r.definedNames,
|
|
1017
1017
|
depth: 0
|
|
1018
|
-
}) && (
|
|
1018
|
+
}) && (Ge(a, s.dxfId == null ? null : i[s.dxfId]), s.stopIfTrue)) break;
|
|
1019
1019
|
continue;
|
|
1020
1020
|
}
|
|
1021
1021
|
if (s.type === "cellIs") {
|
|
1022
|
-
let t = s.formulas.map(
|
|
1023
|
-
c != null && t.every((e) => e.num != null) ? r =
|
|
1022
|
+
let t = s.formulas.map(Ve), n = Ie(e), r = !1;
|
|
1023
|
+
c != null && t.every((e) => e.num != null) ? r = Be(c, s.operator, t.map((e) => e.num)) : n != null && t.every((e) => e.text != null) && (r = He(n, s.operator, t.map((e) => e.text))), r && Ge(a, s.dxfId == null ? null : i[s.dxfId]);
|
|
1024
1024
|
} else if (s.type === "top10") {
|
|
1025
1025
|
if (c == null || o.top10Threshold == null) continue;
|
|
1026
|
-
(o.top10IsTop ? c >= o.top10Threshold : c <= o.top10Threshold) &&
|
|
1026
|
+
(o.top10IsTop ? c >= o.top10Threshold : c <= o.top10Threshold) && Ge(a, s.dxfId == null ? null : i[s.dxfId]);
|
|
1027
1027
|
} else if (s.type === "aboveAverage") {
|
|
1028
1028
|
if (c == null || o.avgValue == null) continue;
|
|
1029
1029
|
let e = o.avgStdDev == null ? 0 : o.avgStdDev * (s.stdDev ?? 1), t = o.avgIsAbove ? o.avgValue + e : o.avgValue - e, n = s.equalAverage === !0;
|
|
1030
|
-
(o.avgIsAbove ? n ? c >= t : c > t : n ? c <= t : c < t) &&
|
|
1030
|
+
(o.avgIsAbove ? n ? c >= t : c > t : n ? c <= t : c < t) && Ge(a, s.dxfId == null ? null : i[s.dxfId]);
|
|
1031
1031
|
} else if (s.type === "iconSet") {
|
|
1032
1032
|
if (c == null || !o.iconThresholds?.length) continue;
|
|
1033
1033
|
let e = o.iconThresholds, t = e.length, n = 0;
|
|
@@ -1044,7 +1044,7 @@ function qe(e, t, n, r, i) {
|
|
|
1044
1044
|
};
|
|
1045
1045
|
} else if (s.type === "colorScale") {
|
|
1046
1046
|
if (c == null || !o.scaleStops || a.fill) continue;
|
|
1047
|
-
let e =
|
|
1047
|
+
let e = We(c, s.stops, o.scaleStops);
|
|
1048
1048
|
a.fill = {
|
|
1049
1049
|
patternType: "solid",
|
|
1050
1050
|
fgColor: e,
|
|
@@ -1064,22 +1064,22 @@ function qe(e, t, n, r, i) {
|
|
|
1064
1064
|
}
|
|
1065
1065
|
//#endregion
|
|
1066
1066
|
//#region packages/xlsx/src/bidi-line.ts
|
|
1067
|
-
function
|
|
1067
|
+
function qe(e, t) {
|
|
1068
1068
|
return e === 2 ? !0 : e === 1 ? !1 : v(void 0, t) === "rtl";
|
|
1069
1069
|
}
|
|
1070
|
-
var
|
|
1070
|
+
var Je = /[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF\u200F\u202B\u202E\u2067]|[\u{10800}-\u{10FFF}\u{1E800}-\u{1EFFF}]/u, Ye = (e) => {
|
|
1071
1071
|
let t = e.text;
|
|
1072
1072
|
return typeof t == "string" ? t : void 0;
|
|
1073
1073
|
};
|
|
1074
|
-
function
|
|
1074
|
+
function Xe(e) {
|
|
1075
1075
|
for (let t of e) {
|
|
1076
|
-
let e =
|
|
1077
|
-
if (e !== void 0 &&
|
|
1076
|
+
let e = Ye(t);
|
|
1077
|
+
if (e !== void 0 && Je.test(e)) return !0;
|
|
1078
1078
|
}
|
|
1079
1079
|
return !1;
|
|
1080
1080
|
}
|
|
1081
|
-
var
|
|
1082
|
-
function
|
|
1081
|
+
var Ze = "";
|
|
1082
|
+
function Qe(e, t) {
|
|
1083
1083
|
let n = e.length;
|
|
1084
1084
|
if (n === 0) return {
|
|
1085
1085
|
order: [],
|
|
@@ -1088,8 +1088,8 @@ function $e(e, t) {
|
|
|
1088
1088
|
let r = "", i = Array(n);
|
|
1089
1089
|
for (let t = 0; t < n; t++) {
|
|
1090
1090
|
i[t] = r.length;
|
|
1091
|
-
let n =
|
|
1092
|
-
r += n.length > 0 ? n :
|
|
1091
|
+
let n = Ye(e[t]) ?? "";
|
|
1092
|
+
r += n.length > 0 ? n : Ze;
|
|
1093
1093
|
}
|
|
1094
1094
|
let a = m(), { levels: o, paragraphLevel: s } = a.computeLevels(r, t ? "rtl" : "ltr"), c = new Uint8Array(n);
|
|
1095
1095
|
for (let e = 0; e < n; e++) {
|
|
@@ -1105,7 +1105,7 @@ function $e(e, t) {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
//#endregion
|
|
1107
1107
|
//#region packages/xlsx/src/a1.ts
|
|
1108
|
-
function
|
|
1108
|
+
function $e(e) {
|
|
1109
1109
|
let t = /^\$?([A-Z]+)\$?(\d+)$/.exec(e.trim());
|
|
1110
1110
|
if (!t) return null;
|
|
1111
1111
|
let n = t[1], r = 0;
|
|
@@ -1117,24 +1117,24 @@ function et(e) {
|
|
|
1117
1117
|
}
|
|
1118
1118
|
//#endregion
|
|
1119
1119
|
//#region packages/xlsx/src/renderer.ts
|
|
1120
|
-
var
|
|
1121
|
-
function
|
|
1120
|
+
var et = n.map((e) => `"${e}"`).join(", "), tt = r.map((e) => `"${e}"`).join(", "), nt = `"Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${et}, sans-serif`;
|
|
1121
|
+
function rt(e) {
|
|
1122
1122
|
return /song|sung|simsun|nsimsun|batang|gungsuh|mincho|mingliu|pmingliu|fangsong|kaiti|simkai|simfang|stsong|stkaiti|新細明|細明|宋体|明朝|楷体|楷體|仿宋|標楷|游明朝/.test(e);
|
|
1123
1123
|
}
|
|
1124
|
-
function
|
|
1125
|
-
let
|
|
1126
|
-
if (!
|
|
1127
|
-
let
|
|
1128
|
-
return `${
|
|
1124
|
+
function it(t) {
|
|
1125
|
+
let n = t ? e(t) : null;
|
|
1126
|
+
if (!n) return nt;
|
|
1127
|
+
let r = rt((t ?? "").toLowerCase());
|
|
1128
|
+
return `${b(n, r ? "serif" : "sans").map((e) => `"${e}"`).join(", ")}, "Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${r ? tt : et}, ${r ? "serif" : "sans-serif"}`;
|
|
1129
1129
|
}
|
|
1130
|
-
function
|
|
1131
|
-
return e ? `"${e}", ${
|
|
1130
|
+
function at(e) {
|
|
1131
|
+
return e ? `"${e}", ${it(e)}` : nt;
|
|
1132
1132
|
}
|
|
1133
|
-
var
|
|
1134
|
-
function
|
|
1133
|
+
var ot = 11, st = 8;
|
|
1134
|
+
function ct(e, t, n) {
|
|
1135
1135
|
return n - e - t;
|
|
1136
1136
|
}
|
|
1137
|
-
var
|
|
1137
|
+
var lt = "#7a7a7a", ut = /* @__PURE__ */ new Map(), dt = {
|
|
1138
1138
|
"meiryo ui": {
|
|
1139
1139
|
10: 8,
|
|
1140
1140
|
11: 8
|
|
@@ -1144,32 +1144,32 @@ var ut = "#7a7a7a", dt = /* @__PURE__ */ new Map(), ft = {
|
|
|
1144
1144
|
11: 8
|
|
1145
1145
|
}
|
|
1146
1146
|
};
|
|
1147
|
-
function
|
|
1148
|
-
let n = `${e}:${t}`, r =
|
|
1147
|
+
function ft(e, t) {
|
|
1148
|
+
let n = `${e}:${t}`, r = ut.get(n);
|
|
1149
1149
|
if (r !== void 0) return r;
|
|
1150
|
-
let
|
|
1151
|
-
if (
|
|
1152
|
-
let
|
|
1153
|
-
if (!
|
|
1154
|
-
let
|
|
1155
|
-
if (!
|
|
1156
|
-
|
|
1157
|
-
let
|
|
1150
|
+
let a = dt[e.toLowerCase()]?.[Math.round(t)];
|
|
1151
|
+
if (a !== void 0) return ut.set(n, a), a;
|
|
1152
|
+
let o = t * i, s = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1) : typeof document < "u" ? document.createElement("canvas") : null;
|
|
1153
|
+
if (!s) return st;
|
|
1154
|
+
let c = s.getContext("2d");
|
|
1155
|
+
if (!c) return st;
|
|
1156
|
+
c.font = `${o}px ${at(e)}`;
|
|
1157
|
+
let l = 0;
|
|
1158
1158
|
for (let e of "0123456789") {
|
|
1159
|
-
let t =
|
|
1160
|
-
t >
|
|
1159
|
+
let t = c.measureText(e).width;
|
|
1160
|
+
t > l && (l = t);
|
|
1161
1161
|
}
|
|
1162
|
-
let
|
|
1163
|
-
return
|
|
1162
|
+
let u = Math.round(l) || st;
|
|
1163
|
+
return ut.set(n, u), u;
|
|
1164
1164
|
}
|
|
1165
|
-
function
|
|
1166
|
-
return !e.defaultFontFamily || !e.defaultFontSize ?
|
|
1165
|
+
function pt(e) {
|
|
1166
|
+
return !e.defaultFontFamily || !e.defaultFontSize ? st : ft(e.defaultFontFamily, e.defaultFontSize);
|
|
1167
1167
|
}
|
|
1168
|
-
function X(e, t =
|
|
1168
|
+
function X(e, t = st) {
|
|
1169
1169
|
return Math.trunc((256 * e + 128 / t) / 256 * t);
|
|
1170
1170
|
}
|
|
1171
1171
|
function Z(e) {
|
|
1172
|
-
return Math.round(e *
|
|
1172
|
+
return Math.round(e * i);
|
|
1173
1173
|
}
|
|
1174
1174
|
function Q(e, t = 1) {
|
|
1175
1175
|
let n = e.replace("#", ""), r = parseInt(n.slice(0, 2), 16), i = parseInt(n.slice(2, 4), 16), a = parseInt(n.slice(4, 6), 16);
|
|
@@ -1374,16 +1374,16 @@ function vt(e, t, n, r) {
|
|
|
1374
1374
|
if (gt.has(s)) return gt.get(s);
|
|
1375
1375
|
let c = _t[t];
|
|
1376
1376
|
if (!c) return gt.set(s, null), null;
|
|
1377
|
-
let l = c.length,
|
|
1378
|
-
if (!
|
|
1379
|
-
let f =
|
|
1377
|
+
let l = c.length, d = u(l, l);
|
|
1378
|
+
if (!d) return gt.set(s, null), null;
|
|
1379
|
+
let f = d.getContext("2d");
|
|
1380
1380
|
if (!f) return gt.set(s, null), null;
|
|
1381
1381
|
f.fillStyle = Q(r), f.fillRect(0, 0, l, l), f.fillStyle = Q(n);
|
|
1382
1382
|
for (let e = 0; e < l; e++) {
|
|
1383
1383
|
let t = c[e];
|
|
1384
1384
|
for (let n = 0; n < l; n++) t & 1 << l - 1 - n && f.fillRect(n, e, 1, 1);
|
|
1385
1385
|
}
|
|
1386
|
-
let p = e.createPattern(
|
|
1386
|
+
let p = e.createPattern(d, "repeat");
|
|
1387
1387
|
if (p && typeof DOMMatrix < "u" && (a >= 2 || o >= 2)) {
|
|
1388
1388
|
let e = new DOMMatrix();
|
|
1389
1389
|
e.scaleSelf(1 / a, 1 / o), p.setTransform(e);
|
|
@@ -1419,7 +1419,7 @@ function bt(e, t, n, r, i, a) {
|
|
|
1419
1419
|
}
|
|
1420
1420
|
return o;
|
|
1421
1421
|
}
|
|
1422
|
-
var xt =
|
|
1422
|
+
var xt = $e;
|
|
1423
1423
|
function St(e, t, n, r, i) {
|
|
1424
1424
|
let a = Math.max(4, Math.min(8, Math.min(r, i) * .18));
|
|
1425
1425
|
e.save(), e.fillStyle = "#D40000", e.beginPath(), e.moveTo(t + r - a, n), e.lineTo(t + r, n), e.lineTo(t + r, n + a), e.closePath(), e.fill(), e.restore();
|
|
@@ -1429,7 +1429,7 @@ function Ct(e, t, n) {
|
|
|
1429
1429
|
return `rgb(${Math.round(a * d + c * (1 - d))},${Math.round(o * d + l * (1 - d))},${Math.round(s * d + u * (1 - d))})`;
|
|
1430
1430
|
}
|
|
1431
1431
|
function wt(e, t = 1) {
|
|
1432
|
-
return `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${Math.max(1, Math.round(e.size *
|
|
1432
|
+
return `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${Math.max(1, Math.round(e.size * i * t))}px ${at(e.name)}`;
|
|
1433
1433
|
}
|
|
1434
1434
|
function Tt(e, t, n, r, i, a) {
|
|
1435
1435
|
e.save(), e.strokeStyle = i, e.lineWidth = .5, e.beginPath(), a ? (e.moveTo(t, r - 1), e.lineTo(n, r - 1), e.moveTo(t, r + 1), e.lineTo(n, r + 1)) : (e.moveTo(t, r), e.lineTo(n, r)), e.stroke(), e.restore();
|
|
@@ -1464,7 +1464,7 @@ function Dt(e, t) {
|
|
|
1464
1464
|
italic: !1,
|
|
1465
1465
|
underline: !1,
|
|
1466
1466
|
strike: !1,
|
|
1467
|
-
size:
|
|
1467
|
+
size: ot,
|
|
1468
1468
|
color: null,
|
|
1469
1469
|
name: null
|
|
1470
1470
|
},
|
|
@@ -1691,63 +1691,84 @@ function Vt(e) {
|
|
|
1691
1691
|
let n = parseInt(t.slice(0, 2), 16), r = parseInt(t.slice(2, 4), 16), i = parseInt(t.slice(4, 6), 16), a = (e) => Math.round(e * .2 + 255 * .8), o = (e) => e.toString(16).padStart(2, "0").toUpperCase();
|
|
1692
1692
|
return `#${o(a(n))}${o(a(r))}${o(a(i))}`;
|
|
1693
1693
|
}
|
|
1694
|
-
function Ht(e, t, n, r,
|
|
1695
|
-
if (
|
|
1696
|
-
let { styles: h, cellMap: g, mergeAnchorMap: v, mergeSkipSet: y, cfContext: b, cs: x, dpr: S } = t, C =
|
|
1697
|
-
for (let e = 0; e < C; e++) E.push(D), D +=
|
|
1698
|
-
let O = [], k = -
|
|
1699
|
-
for (let e = 0; e < w; e++) O.push(k), k +=
|
|
1700
|
-
e.save(), e.beginPath(), e.rect(T(
|
|
1694
|
+
function Ht(e, t, n, r, a, o, s, c, l, u, d, f, p, m) {
|
|
1695
|
+
if (p <= 0 || m <= 0) return;
|
|
1696
|
+
let { styles: h, cellMap: g, mergeAnchorMap: v, mergeSkipSet: y, cfContext: b, cs: x, dpr: S } = t, C = a.length, w = o.length, T = (e, n) => t.rtl ? ct(e, n, t.canvasW) : e, E = [], D = -s;
|
|
1697
|
+
for (let e = 0; e < C; e++) E.push(D), D += a[e];
|
|
1698
|
+
let O = [], k = -c;
|
|
1699
|
+
for (let e = 0; e < w; e++) O.push(k), k += o[e];
|
|
1700
|
+
e.save(), e.beginPath(), e.rect(T(d, p), f, p, m), e.clip();
|
|
1701
1701
|
let A = [];
|
|
1702
|
-
for (let
|
|
1703
|
-
let
|
|
1704
|
-
if (
|
|
1705
|
-
let
|
|
1706
|
-
if (!
|
|
1707
|
-
let
|
|
1708
|
-
if (
|
|
1702
|
+
for (let a of t.worksheet.mergeCells ?? []) {
|
|
1703
|
+
let o = a.top, d = a.left;
|
|
1704
|
+
if (o >= n && o < n + w && d >= r && d < r + C || a.bottom < n || a.top >= n + w || a.right < r || a.left >= r + C) continue;
|
|
1705
|
+
let f = t.mergeAnchorMap.get(`${o}:${d}`);
|
|
1706
|
+
if (!f) continue;
|
|
1707
|
+
let p;
|
|
1708
|
+
if (d >= r) p = l + E[d - r];
|
|
1709
1709
|
else {
|
|
1710
1710
|
let e = 0;
|
|
1711
|
-
for (let n =
|
|
1712
|
-
|
|
1711
|
+
for (let n = d; n < r; n++) e += Math.round(X(t.worksheet.colWidths[n] ?? t.worksheet.defaultColWidth, t.mdw) * x);
|
|
1712
|
+
p = l - s - e;
|
|
1713
1713
|
}
|
|
1714
|
-
let
|
|
1715
|
-
if (
|
|
1714
|
+
let m;
|
|
1715
|
+
if (o >= n) m = u + O[o - n];
|
|
1716
1716
|
else {
|
|
1717
1717
|
let e = 0;
|
|
1718
|
-
for (let r =
|
|
1719
|
-
|
|
1718
|
+
for (let r = o; r < n; r++) e += Math.round(Z(t.worksheet.rowHeights[r] ?? t.worksheet.defaultRowHeight) * x);
|
|
1719
|
+
m = u - c - e;
|
|
1720
|
+
}
|
|
1721
|
+
let g = f.totalW, _ = f.totalH;
|
|
1722
|
+
p = T(p, g);
|
|
1723
|
+
let v = `${o}:${d}`, y = t.cellMap.get(v), { font: S, fill: D, border: k, xf: A } = Dt(h, y?.styleIndex ?? 0), j = Ke(y, o, d, b, h.dxfs ?? []);
|
|
1724
|
+
if (yt(e, j.fill ?? D, p, m, g, _), j.dataBar && j.dataBar.ratio > 0) {
|
|
1725
|
+
let t = Math.max(0, (g - 4) * j.dataBar.ratio);
|
|
1726
|
+
mt(e, j.dataBar.color, p + 2, m + 2, t, _ - 4, j.dataBar.gradient);
|
|
1727
|
+
}
|
|
1728
|
+
if (un(e, ln(cn(k, o, d, f.right, f.bottom, t.cellMap, h), j.border), p, m, g, _), !y) continue;
|
|
1729
|
+
let M = he(y, h, j.numFmt);
|
|
1730
|
+
if (!M || M === "0" && t.worksheet.showZeros === !1) continue;
|
|
1731
|
+
let N = S.bold || !!j.fontBold, P = S.italic || !!j.fontItalic, F = S.underline || !!j.fontUnderline, I = S.strike || !!j.fontStrike, L = N !== S.bold || P !== S.italic || F !== S.underline || I !== S.strike ? {
|
|
1732
|
+
...S,
|
|
1733
|
+
bold: N,
|
|
1734
|
+
italic: P,
|
|
1735
|
+
underline: F,
|
|
1736
|
+
strike: I
|
|
1737
|
+
} : S;
|
|
1738
|
+
e.font = wt(L, x);
|
|
1739
|
+
let R = t.hyperlinkMap.get(v) ? "#0563C1" : j.fontColor ?? S.color;
|
|
1740
|
+
e.fillStyle = R ? Q(R) : "#000000";
|
|
1741
|
+
let z = y.value.type === "number", B = A.alignH ?? (z ? "right" : "left"), V = A.alignV ?? "bottom", H = A.indent ? Math.round(A.indent * 3 * t.mdw) : 0, ee = 3 + (B === "left" || !A.alignH ? H : 0);
|
|
1742
|
+
e.save(), e.beginPath(), e.rect(p, m, g, _), e.clip();
|
|
1743
|
+
let U;
|
|
1744
|
+
B === "right" ? (U = p + g - 3, e.textAlign = "right") : B === "center" ? (U = p + g / 2, e.textAlign = "center") : (U = p + ee, e.textAlign = "left");
|
|
1745
|
+
let te = y.value.type === "text" ? y.value.runs : void 0, ne = te && te.length > 0;
|
|
1746
|
+
if (A.wrapText && ne) {
|
|
1747
|
+
let t = jt(e, te, L, x, g - ee - 3), n = t.reduce((e, t) => e + Math.round(t.maxFontSize * i * 1.2), 0), r;
|
|
1748
|
+
r = V === "top" ? m + 2 : V === "center" ? m + (_ - n) / 2 : m + _ - n - 2, e.textAlign = "left", e.textBaseline = "top";
|
|
1749
|
+
for (let n of t) {
|
|
1750
|
+
let t = Math.round(n.maxFontSize * i * 1.2), a = n.segments.reduce((e, t) => e + t.width, 0), o;
|
|
1751
|
+
o = B === "right" ? p + g - 3 - a : B === "center" ? p + g / 2 - a / 2 : p + ee;
|
|
1752
|
+
for (let t of n.segments) {
|
|
1753
|
+
e.font = wt(t.font, x);
|
|
1754
|
+
let n = j.fontColor ?? t.font.color;
|
|
1755
|
+
e.fillStyle = n ? Q(n) : "#000000", e.fillText(t.text, o, r), o += t.width;
|
|
1756
|
+
}
|
|
1757
|
+
r += t;
|
|
1758
|
+
}
|
|
1759
|
+
} else if (A.wrapText) {
|
|
1760
|
+
let t = Ot(e, M, g - ee - 3), n = Math.round(S.size * i * 1.2), r = t.length * n, a;
|
|
1761
|
+
a = V === "top" ? m + 2 : V === "center" ? m + (_ - r) / 2 : m + _ - r - 2, e.textBaseline = "top";
|
|
1762
|
+
for (let r = 0; r < t.length; r++) e.fillText(t[r], U, a + r * n);
|
|
1763
|
+
} else {
|
|
1764
|
+
let t;
|
|
1765
|
+
V === "top" ? (e.textBaseline = "top", t = m + 2) : V === "center" ? (e.textBaseline = "middle", t = m + _ / 2) : (e.textBaseline = "bottom", t = m + _ - 2), e.fillText(M, U, t);
|
|
1720
1766
|
}
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
mt(e, A.dataBar.color, f + 2, p + 2, t, g - 4, A.dataBar.gradient);
|
|
1727
|
-
}
|
|
1728
|
-
if (un(e, ln(cn(D, a, u, d.right, d.bottom, t.cellMap, h), A.border), f, p, m, g), !v) continue;
|
|
1729
|
-
let j = ge(v, h, A.numFmt);
|
|
1730
|
-
if (!j || j === "0" && t.worksheet.showZeros === !1) continue;
|
|
1731
|
-
let M = y.bold || !!A.fontBold, N = y.italic || !!A.fontItalic, P = y.underline || !!A.fontUnderline, F = y.strike || !!A.fontStrike;
|
|
1732
|
-
e.font = wt(M !== y.bold || N !== y.italic || P !== y.underline || F !== y.strike ? {
|
|
1733
|
-
...y,
|
|
1734
|
-
bold: M,
|
|
1735
|
-
italic: N,
|
|
1736
|
-
underline: P,
|
|
1737
|
-
strike: F
|
|
1738
|
-
} : y, x);
|
|
1739
|
-
let I = t.hyperlinkMap.get(_) ? "#0563C1" : A.fontColor ?? y.color;
|
|
1740
|
-
e.fillStyle = I ? Q(I) : "#000000";
|
|
1741
|
-
let L = v.value.type === "number", R = k.alignH ?? (L ? "right" : "left"), z = k.alignV ?? "bottom", B = k.indent ? Math.round(k.indent * 3 * t.mdw) : 0, V = 3 + (R === "left" || !k.alignH ? B : 0);
|
|
1742
|
-
e.save(), e.beginPath(), e.rect(f, p, m, g), e.clip();
|
|
1743
|
-
let H;
|
|
1744
|
-
R === "right" ? (H = f + m - 3, e.textAlign = "right") : R === "center" ? (H = f + m / 2, e.textAlign = "center") : (H = f + V, e.textAlign = "left");
|
|
1745
|
-
let ee;
|
|
1746
|
-
z === "top" ? (e.textBaseline = "top", ee = p + 2) : z === "center" ? (e.textBaseline = "middle", ee = p + g / 2) : (e.textBaseline = "bottom", ee = p + g - 2), e.fillText(j, H, ee), e.restore();
|
|
1747
|
-
}
|
|
1748
|
-
for (let o = 0; o < w; o++) {
|
|
1749
|
-
let s = n + o, w = l + O[o], D = a[o];
|
|
1750
|
-
if (w + D <= d || w >= d + m) continue;
|
|
1767
|
+
e.restore();
|
|
1768
|
+
}
|
|
1769
|
+
for (let s = 0; s < w; s++) {
|
|
1770
|
+
let c = n + s, w = u + O[s], D = o[s];
|
|
1771
|
+
if (w + D <= f || w >= f + m) continue;
|
|
1751
1772
|
let k = /* @__PURE__ */ new Set(), j = /* @__PURE__ */ new Set(), M = -1, N = (e) => {
|
|
1752
1773
|
if (M >= 0 && e - M >= 2) {
|
|
1753
1774
|
for (let t = M; t < e - 1; t++) k.add(t);
|
|
@@ -1758,7 +1779,7 @@ function Ht(e, t, n, r, i, a, o, s, c, l, u, d, f, m) {
|
|
|
1758
1779
|
for (let e = 0; e <= C; e++) {
|
|
1759
1780
|
let t = !1, n = !1;
|
|
1760
1781
|
if (e < C) {
|
|
1761
|
-
let i = `${
|
|
1782
|
+
let i = `${c}:${r + e}`;
|
|
1762
1783
|
if (!y.has(i) && !v.has(i)) {
|
|
1763
1784
|
let e = g.get(i);
|
|
1764
1785
|
t = Dt(h, e?.styleIndex ?? 0).xf.alignH === "centerContinuous", n = !!(e && e.value && e.value.type !== "empty");
|
|
@@ -1767,258 +1788,258 @@ function Ht(e, t, n, r, i, a, o, s, c, l, u, d, f, m) {
|
|
|
1767
1788
|
t ? n && M >= 0 && e > M ? (N(e), M = e) : M < 0 && (M = e) : N(e);
|
|
1768
1789
|
}
|
|
1769
1790
|
for (let n = 0; n < C; n++) {
|
|
1770
|
-
let
|
|
1771
|
-
if (
|
|
1772
|
-
let m = `${
|
|
1791
|
+
let o = r + n, u = l + E[n], f = a[n];
|
|
1792
|
+
if (u + f <= d || u >= d + p) continue;
|
|
1793
|
+
let m = `${c}:${o}`;
|
|
1773
1794
|
if (y.has(m)) continue;
|
|
1774
|
-
let O = v.get(m), M = O ? O.totalW :
|
|
1775
|
-
if (yt(e, V, P, w, M, N) ?
|
|
1795
|
+
let O = v.get(m), M = O ? O.totalW : f, N = O ? O.totalH : D, P = T(u, M), F = g.get(m), { font: I, fill: L, border: R, xf: z } = Dt(h, F?.styleIndex ?? 0), B = Ke(F, c, o, b, h.dxfs ?? []), V = B.fill ?? L, H = t.tableStyleMap.get(m), ee = h.dxfs ?? [], U = (e) => e == null ? void 0 : ee[e], te = U(H?.wholeTableDxf), ne = U(H?.headerRowDxf), re = U(H?.totalRowDxf), ie = U(H?.firstColumnDxf), ae = U(H?.lastColumnDxf), oe = U(H?.stripeDxf), se = H?.isHeader && ne?.fill?.fgColor ? ne : H?.isTotals && re?.fill?.fgColor ? re : H?.isLastCol && ae?.fill?.fgColor ? ae : H?.isFirstCol && ie?.fill?.fgColor ? ie : oe?.fill?.fgColor ? oe : !H?.isHeader && !H?.isTotals && te?.fill?.fgColor ? te : void 0, ce = !1;
|
|
1796
|
+
if (yt(e, V, P, w, M, N) ? ce = !0 : H && se?.fill?.fgColor ? (e.fillStyle = Q(se.fill.fgColor), e.fillRect(P, w, M, N), ce = !0) : H && !H.isCustom && H.isBanded && (e.fillStyle = Vt(H.accent), e.fillRect(P, w, M, N), ce = !0), t.commentCells.has(m) && St(e, P, w, M, N), B.dataBar && B.dataBar.ratio > 0) {
|
|
1776
1797
|
let t = Math.max(0, (M - 4) * B.dataBar.ratio);
|
|
1777
1798
|
mt(e, B.dataBar.color, P + 2, w + 2, t, N - 4, B.dataBar.gradient);
|
|
1778
1799
|
}
|
|
1779
|
-
let
|
|
1780
|
-
if (
|
|
1800
|
+
let le = t.sparklineMap.get(m);
|
|
1801
|
+
if (le && _(e, {
|
|
1781
1802
|
x: P,
|
|
1782
1803
|
y: w,
|
|
1783
1804
|
w: M,
|
|
1784
1805
|
h: N
|
|
1785
|
-
},
|
|
1806
|
+
}, le), t.worksheet.showGridlines !== !1) {
|
|
1786
1807
|
let t = .5 / S;
|
|
1787
|
-
e.strokeStyle = "#d0d0d0", e.lineWidth = .5, e.beginPath(), k.has(n) || (e.moveTo(P + M + t, w), e.lineTo(P + M + t, w + N)), e.moveTo(P, w + N + t), e.lineTo(P + M, w + N + t),
|
|
1808
|
+
e.strokeStyle = "#d0d0d0", e.lineWidth = .5, e.beginPath(), k.has(n) || (e.moveTo(P + M + t, w), e.lineTo(P + M + t, w + N)), e.moveTo(P, w + N + t), e.lineTo(P + M, w + N + t), s === 0 && (e.moveTo(P, w + t), e.lineTo(P + M, w + t)), n === 0 && (e.moveTo(P + t, w), e.lineTo(P + t, w + N)), e.stroke();
|
|
1788
1809
|
}
|
|
1789
|
-
let
|
|
1790
|
-
(k.has(n) || j.has(n)) && (
|
|
1791
|
-
...
|
|
1792
|
-
left: j.has(n) ? null :
|
|
1793
|
-
right: k.has(n) ? null :
|
|
1810
|
+
let W = ln(O ? cn(R, c, o, O.right, O.bottom, g, h) : R, B.border);
|
|
1811
|
+
(k.has(n) || j.has(n)) && (W = {
|
|
1812
|
+
...W,
|
|
1813
|
+
left: j.has(n) ? null : W.left,
|
|
1814
|
+
right: k.has(n) ? null : W.right
|
|
1794
1815
|
});
|
|
1795
|
-
let
|
|
1796
|
-
if (
|
|
1797
|
-
let e =
|
|
1798
|
-
|
|
1799
|
-
...
|
|
1816
|
+
let ue = g.get(`${c - 1}:${o}`), G = ce && ue ? Dt(h, ue.styleIndex).border.bottom : null, K = !1;
|
|
1817
|
+
if (G?.style) {
|
|
1818
|
+
let e = W.top, t = mn(e, G);
|
|
1819
|
+
W = {
|
|
1820
|
+
...W,
|
|
1800
1821
|
top: t
|
|
1801
|
-
},
|
|
1822
|
+
}, K = t === G && e !== G;
|
|
1802
1823
|
}
|
|
1803
|
-
let
|
|
1804
|
-
if (
|
|
1805
|
-
let e = g.get(`${
|
|
1824
|
+
let q = !1;
|
|
1825
|
+
if (ce && !j.has(n)) {
|
|
1826
|
+
let e = g.get(`${c}:${o - 1}`), t = e ? Dt(h, e.styleIndex).border.right : null;
|
|
1806
1827
|
if (t?.style) {
|
|
1807
|
-
let e =
|
|
1808
|
-
|
|
1809
|
-
...
|
|
1828
|
+
let e = W.left, n = mn(e, t);
|
|
1829
|
+
W = {
|
|
1830
|
+
...W,
|
|
1810
1831
|
left: n
|
|
1811
|
-
},
|
|
1832
|
+
}, q = n === t && e !== t;
|
|
1812
1833
|
}
|
|
1813
1834
|
}
|
|
1814
|
-
if (un(e,
|
|
1815
|
-
let t = zt(H,
|
|
1835
|
+
if (un(e, W, P, w, M, N, K, q), H) {
|
|
1836
|
+
let t = zt(H, te, ne, o);
|
|
1816
1837
|
if (t.kind === "dxf") un(e, t.border, P, w, M, N);
|
|
1817
1838
|
else if (t.kind === "accent") {
|
|
1818
1839
|
let n = .5 / S;
|
|
1819
1840
|
e.strokeStyle = t.color, e.lineWidth = t.lineWidth, e.beginPath(), e.moveTo(P, w + N - n), e.lineTo(P + M, w + N - n), t.topEdge && (e.moveTo(P, w + n), e.lineTo(P + M, w + n)), e.stroke();
|
|
1820
1841
|
}
|
|
1821
1842
|
}
|
|
1822
|
-
if (t.autoFilterCells.has(m) && Lt(e, P, w,
|
|
1823
|
-
let
|
|
1824
|
-
!
|
|
1825
|
-
let
|
|
1843
|
+
if (t.autoFilterCells.has(m) && Lt(e, P, w, f, N), !F) continue;
|
|
1844
|
+
let J = he(F, h, B.numFmt);
|
|
1845
|
+
!J || J === "0" && t.worksheet.showZeros === !1 || A.push(() => {
|
|
1846
|
+
let s = H?.isHeader ? ne : H?.isTotals ? re : H?.isLastCol && ae ? ae : H?.isFirstCol && ie ? ie : oe || (H ? te : void 0), l = H ? H.isCustom ? !!s?.font?.bold : H.isHeader || H.isTotals : !1, u = I.bold || !!B.fontBold || l, d = I.italic || !!B.fontItalic, f = I.underline || !!B.fontUnderline, p = I.strike || !!B.fontStrike, _ = u !== I.bold || d !== I.italic || f !== I.underline || p !== I.strike ? {
|
|
1826
1847
|
...I,
|
|
1827
|
-
bold:
|
|
1828
|
-
italic:
|
|
1829
|
-
underline:
|
|
1830
|
-
strike:
|
|
1848
|
+
bold: u,
|
|
1849
|
+
italic: d,
|
|
1850
|
+
underline: f,
|
|
1851
|
+
strike: p
|
|
1831
1852
|
} : I;
|
|
1832
1853
|
e.font = wt(_, x);
|
|
1833
|
-
let b = t.hyperlinkMap.get(m), S =
|
|
1854
|
+
let b = t.hyperlinkMap.get(m), S = s?.font?.color ?? null, T = b ? "#0563C1" : B.fontColor ?? S ?? I.color;
|
|
1834
1855
|
e.fillStyle = T ? Q(T) : "#000000";
|
|
1835
|
-
let E = F.value.type === "number", D = z.alignH ?? (E ? "right" : "left"), k = z.alignV ?? "bottom", A = z.indent ? Math.round(z.indent * 3 * t.mdw) : 0, j = B.iconSet ? Math.max(8, Math.round(Math.min(M, N) * .55)) : 0, L = j > 0 ? j + 4 : 0, R = 3 + (D === "left" || !z.alignH ? A : 0) + L, V = M, ee = P,
|
|
1856
|
+
let E = F.value.type === "number", D = z.alignH ?? (E ? "right" : "left"), k = z.alignV ?? "bottom", A = z.indent ? Math.round(z.indent * 3 * t.mdw) : 0, j = B.iconSet ? Math.max(8, Math.round(Math.min(M, N) * .55)) : 0, L = j > 0 ? j + 4 : 0, R = 3 + (D === "left" || !z.alignH ? A : 0) + L, V = M, ee = P, U = n;
|
|
1836
1857
|
if (D === "centerContinuous" && !O) for (let e = n + 1; e < C; e++) {
|
|
1837
|
-
let t = `${
|
|
1858
|
+
let t = `${c}:${r + e}`;
|
|
1838
1859
|
if (y.has(t) || v.has(t)) break;
|
|
1839
1860
|
let n = g.get(t);
|
|
1840
1861
|
if (n && n.value.type !== "empty" || Dt(h, n?.styleIndex ?? 0).xf.alignH !== "centerContinuous") break;
|
|
1841
|
-
V +=
|
|
1862
|
+
V += a[e], U = e;
|
|
1842
1863
|
}
|
|
1843
|
-
let
|
|
1844
|
-
if (!O && !z.wrapText && !z.textRotation && !E && !
|
|
1845
|
-
let t = e.measureText(
|
|
1846
|
-
if (o >
|
|
1847
|
-
let e = o -
|
|
1848
|
-
if (D === "right" ? l = e : D === "center" ||
|
|
1849
|
-
let e = t, o =
|
|
1864
|
+
let se = D === "centerContinuous" ? ee : P, ce = D === "centerContinuous" ? V : M, le = J.includes("\n");
|
|
1865
|
+
if (!O && !z.wrapText && !z.textRotation && !E && !le) {
|
|
1866
|
+
let t = e.measureText(J).width, i = D === "centerContinuous", o = i ? t + 6 : t + R + 3, s = i ? V : M;
|
|
1867
|
+
if (o > s) {
|
|
1868
|
+
let e = o - s, t = 0, l = 0;
|
|
1869
|
+
if (D === "right" ? l = e : D === "center" || i ? (l = e / 2, t = e / 2) : t = e, t > 0) {
|
|
1870
|
+
let e = t, o = i ? U + 1 : n + 1;
|
|
1850
1871
|
for (let t = o; t < C && e > 0; t++) {
|
|
1851
|
-
let n = `${
|
|
1872
|
+
let n = `${c}:${r + t}`;
|
|
1852
1873
|
if (y.has(n) || v.has(n)) break;
|
|
1853
|
-
let
|
|
1854
|
-
if (
|
|
1855
|
-
|
|
1874
|
+
let i = g.get(n);
|
|
1875
|
+
if (i && i.value.type !== "empty") break;
|
|
1876
|
+
ce += a[t], e -= a[t];
|
|
1856
1877
|
}
|
|
1857
1878
|
}
|
|
1858
1879
|
if (l > 0) {
|
|
1859
1880
|
let e = l;
|
|
1860
1881
|
for (let t = n - 1; t >= 0 && e > 0; t--) {
|
|
1861
|
-
let n = `${
|
|
1882
|
+
let n = `${c}:${r + t}`;
|
|
1862
1883
|
if (y.has(n) || v.has(n)) break;
|
|
1863
|
-
let
|
|
1864
|
-
if (
|
|
1865
|
-
|
|
1884
|
+
let i = g.get(n);
|
|
1885
|
+
if (i && i.value.type !== "empty") break;
|
|
1886
|
+
se -= a[t], ce += a[t], e -= a[t];
|
|
1866
1887
|
}
|
|
1867
1888
|
}
|
|
1868
1889
|
}
|
|
1869
1890
|
}
|
|
1870
|
-
let
|
|
1871
|
-
if (D === "fill" && !E &&
|
|
1872
|
-
let t = Math.max(1, M - 6), n = e.measureText(
|
|
1891
|
+
let W = J, ue = 0;
|
|
1892
|
+
if (D === "fill" && !E && J.length > 0) {
|
|
1893
|
+
let t = Math.max(1, M - 6), n = e.measureText(J).width;
|
|
1873
1894
|
if (n > 0 && n < t) {
|
|
1874
1895
|
let e = Math.max(1, Math.floor(t / n));
|
|
1875
|
-
|
|
1896
|
+
W = J.repeat(e);
|
|
1876
1897
|
}
|
|
1877
1898
|
}
|
|
1878
|
-
if (D === "distributed" || D === "justify" && !z.wrapText && !
|
|
1879
|
-
let t = Math.max(1, M - 6), n = e.measureText(
|
|
1880
|
-
n < t && (
|
|
1899
|
+
if (D === "distributed" || D === "justify" && !z.wrapText && !le) {
|
|
1900
|
+
let t = Math.max(1, M - 6), n = e.measureText(W).width, r = Math.max(1, [...W].length - 1);
|
|
1901
|
+
n < t && (ue = Math.max(0, (t - n) / r));
|
|
1881
1902
|
}
|
|
1882
|
-
let
|
|
1883
|
-
D === "right" ? (
|
|
1884
|
-
let
|
|
1885
|
-
if (B.iconSet && j > 0 && (e.save(), e.beginPath(), e.rect(P, w, M, N), e.clip(), It(e, B.iconSet.name, B.iconSet.index, P + 2, w + (N - j) / 2, j), e.restore()), e.save(), e.beginPath(), e.rect(
|
|
1886
|
-
let t = Math.round(I.size *
|
|
1903
|
+
let G, K;
|
|
1904
|
+
D === "right" ? (G = P + M - 3, K = "right") : D === "center" ? (G = P + M / 2, K = "center") : D === "centerContinuous" ? (G = ee + V / 2, K = "center") : D === "distributed" || D === "justify" && !z.wrapText && !le ? (G = P + 3, K = "left") : (G = P + R, K = "left");
|
|
1905
|
+
let q = z.textRotation ?? 0, de = q === 255, fe = q > 0 && q !== 255;
|
|
1906
|
+
if (B.iconSet && j > 0 && (e.save(), e.beginPath(), e.rect(P, w, M, N), e.clip(), It(e, B.iconSet.name, B.iconSet.index, P + 2, w + (N - j) / 2, j), e.restore()), e.save(), e.beginPath(), e.rect(se, w, ce, N), e.clip(), de) {
|
|
1907
|
+
let t = Math.round(I.size * i * 1.1), n = J.length * t, r = k === "top" ? w + 2 : k === "center" ? w + (N - n) / 2 : w + N - n - 2;
|
|
1887
1908
|
e.textAlign = "center", e.textBaseline = "top";
|
|
1888
|
-
for (let n of
|
|
1909
|
+
for (let n of J) e.fillText(n, P + M / 2, r), r += t;
|
|
1889
1910
|
e.restore();
|
|
1890
1911
|
return;
|
|
1891
1912
|
}
|
|
1892
|
-
if (
|
|
1893
|
-
let t =
|
|
1894
|
-
e.translate(P + M / 2, w + N / 2), e.rotate(t), e.textAlign = "center", e.textBaseline = "middle", e.fillText(
|
|
1913
|
+
if (fe) {
|
|
1914
|
+
let t = q <= 90 ? -(q * Math.PI / 180) : (q - 90) * Math.PI / 180;
|
|
1915
|
+
e.translate(P + M / 2, w + N / 2), e.rotate(t), e.textAlign = "center", e.textBaseline = "middle", e.fillText(J, 0, 0), e.restore();
|
|
1895
1916
|
return;
|
|
1896
1917
|
}
|
|
1897
1918
|
if (z.shrinkToFit) {
|
|
1898
|
-
let t = e.measureText(
|
|
1919
|
+
let t = e.measureText(J).width, n = M - R - 3;
|
|
1899
1920
|
if (t > n && t > 0) {
|
|
1900
1921
|
let r = n / t, i = D === "right" ? P + M - 3 : D === "center" ? P + M / 2 : P + R;
|
|
1901
1922
|
e.transform(r, 0, 0, 1, i * (1 - r), 0);
|
|
1902
1923
|
}
|
|
1903
1924
|
}
|
|
1904
|
-
if (e.textAlign =
|
|
1905
|
-
e.letterSpacing = `${
|
|
1925
|
+
if (e.textAlign = K, ue > 0) try {
|
|
1926
|
+
e.letterSpacing = `${ue}px`;
|
|
1906
1927
|
} catch {}
|
|
1907
1928
|
try {
|
|
1908
|
-
e.direction =
|
|
1929
|
+
e.direction = qe(z.readingOrder, J) ? "rtl" : "ltr";
|
|
1909
1930
|
} catch {}
|
|
1910
|
-
let
|
|
1911
|
-
if (z.wrapText &&
|
|
1912
|
-
let t = jt(e,
|
|
1931
|
+
let Y = F.value.type === "text" ? F.value.runs : void 0, pe = Y && Y.length > 0;
|
|
1932
|
+
if (z.wrapText && pe) {
|
|
1933
|
+
let t = jt(e, Y, _, x, M - R - 3), n = t.reduce((e, t) => e + Math.round(t.maxFontSize * i * 1.2), 0), r;
|
|
1913
1934
|
r = k === "top" ? w + 2 : k === "center" ? w + (N - n) / 2 : w + N - n - 2, e.textAlign = "left", e.textBaseline = "top";
|
|
1914
|
-
let
|
|
1935
|
+
let a = z.readingOrder === 2 || Xe(Y), o = a && qe(z.readingOrder, Y.map((e) => e.text).join("")), s = e;
|
|
1915
1936
|
for (let n of t) {
|
|
1916
|
-
let t = Math.round(n.maxFontSize *
|
|
1917
|
-
|
|
1918
|
-
let
|
|
1937
|
+
let t = Math.round(n.maxFontSize * i * 1.2), c = n.segments.reduce((e, t) => e + t.width, 0), l;
|
|
1938
|
+
l = D === "right" ? P + M - 3 - c : D === "center" ? P + M / 2 - c / 2 : P + R;
|
|
1939
|
+
let u = a ? Qe(n.segments, o) : null;
|
|
1919
1940
|
for (let t = 0; t < n.segments.length; t++) {
|
|
1920
|
-
let
|
|
1921
|
-
if (
|
|
1922
|
-
|
|
1941
|
+
let a = u ? u.order[t] : t, o = n.segments[a];
|
|
1942
|
+
if (u) try {
|
|
1943
|
+
s.direction = u.rtl[a] ? "rtl" : "ltr";
|
|
1923
1944
|
} catch {}
|
|
1924
|
-
e.font = wt(
|
|
1925
|
-
let
|
|
1926
|
-
e.fillStyle =
|
|
1927
|
-
let
|
|
1928
|
-
if (
|
|
1929
|
-
let t =
|
|
1930
|
-
Tt(e,
|
|
1945
|
+
e.font = wt(o.font, x);
|
|
1946
|
+
let c = B.fontColor ?? o.font.color;
|
|
1947
|
+
e.fillStyle = c ? Q(c) : "#000000", e.fillText(o.text, l, r);
|
|
1948
|
+
let d = Math.round(o.font.size * i);
|
|
1949
|
+
if (o.font.underline) {
|
|
1950
|
+
let t = c ? Q(c) : "#000000", n = o.font.underlineStyle === "double" || o.font.underlineStyle === "doubleAccounting";
|
|
1951
|
+
Tt(e, l, l + o.width, r + d + 1, t, n);
|
|
1931
1952
|
}
|
|
1932
|
-
if (
|
|
1933
|
-
e.save(), e.strokeStyle =
|
|
1934
|
-
let t = r + Math.round(
|
|
1935
|
-
e.beginPath(), e.moveTo(
|
|
1953
|
+
if (o.font.strike) {
|
|
1954
|
+
e.save(), e.strokeStyle = c ? Q(c) : "#000000", e.lineWidth = .5;
|
|
1955
|
+
let t = r + Math.round(d * .5);
|
|
1956
|
+
e.beginPath(), e.moveTo(l, t), e.lineTo(l + o.width, t), e.stroke(), e.restore();
|
|
1936
1957
|
}
|
|
1937
|
-
|
|
1958
|
+
l += o.width;
|
|
1938
1959
|
}
|
|
1939
1960
|
r += t;
|
|
1940
1961
|
}
|
|
1941
|
-
if (
|
|
1942
|
-
|
|
1962
|
+
if (a) try {
|
|
1963
|
+
s.direction = "ltr";
|
|
1943
1964
|
} catch {}
|
|
1944
1965
|
} else if (z.wrapText) {
|
|
1945
|
-
let t = Ot(e,
|
|
1946
|
-
k === "top" ? (
|
|
1947
|
-
for (let r = 0; r < t.length; r++) e.fillText(t[r],
|
|
1948
|
-
} else if (
|
|
1949
|
-
let t =
|
|
1966
|
+
let t = Ot(e, J, M - R - 3), n = Math.round(I.size * i * 1.2), r = t.length * n, a;
|
|
1967
|
+
k === "top" ? (a = w + 2, e.textBaseline = "top") : k === "center" ? (a = w + (N - r) / 2, e.textBaseline = "top") : (a = w + N - r - 2, e.textBaseline = "top");
|
|
1968
|
+
for (let r = 0; r < t.length; r++) e.fillText(t[r], G, a + r * n);
|
|
1969
|
+
} else if (pe) {
|
|
1970
|
+
let t = Y.map((e) => Et(_, e)), n = Y.map((e) => e.font?.vertAlign), r = t.map((e, t) => n[t] === "superscript" || n[t] === "subscript" ? {
|
|
1950
1971
|
...e,
|
|
1951
1972
|
size: e.size * .65
|
|
1952
|
-
} : e),
|
|
1953
|
-
|
|
1954
|
-
let
|
|
1955
|
-
k === "top" ? (e.textBaseline = "top",
|
|
1956
|
-
let
|
|
1957
|
-
for (let
|
|
1958
|
-
let
|
|
1959
|
-
if (
|
|
1960
|
-
|
|
1973
|
+
} : e), a = Y.map((t, n) => (e.font = wt(r[n], x), e.measureText(t.text).width)), o = a.reduce((e, t) => e + t, 0), s;
|
|
1974
|
+
s = D === "right" ? P + M - 3 - o : D === "center" ? P + M / 2 - o / 2 : P + R, e.textAlign = "left";
|
|
1975
|
+
let c;
|
|
1976
|
+
k === "top" ? (e.textBaseline = "top", c = w + 2) : k === "center" ? (e.textBaseline = "middle", c = w + N / 2) : (e.textBaseline = "bottom", c = w + N - 2);
|
|
1977
|
+
let l = z.readingOrder === 2 || Xe(Y) ? Qe(Y, qe(z.readingOrder, Y.map((e) => e.text).join(""))) : null, u = e, d = s;
|
|
1978
|
+
for (let o = 0; o < Y.length; o++) {
|
|
1979
|
+
let s = l ? l.order[o] : o;
|
|
1980
|
+
if (l) try {
|
|
1981
|
+
u.direction = l.rtl[s] ? "rtl" : "ltr";
|
|
1961
1982
|
} catch {}
|
|
1962
|
-
let
|
|
1963
|
-
e.font = wt(
|
|
1964
|
-
let m = B.fontColor ??
|
|
1983
|
+
let f = r[s], p = t[s];
|
|
1984
|
+
e.font = wt(f, x);
|
|
1985
|
+
let m = B.fontColor ?? f.color;
|
|
1965
1986
|
e.fillStyle = m ? Q(m) : "#000000";
|
|
1966
|
-
let h = Math.round(
|
|
1967
|
-
n[
|
|
1968
|
-
let _ = Math.round(
|
|
1969
|
-
if (
|
|
1987
|
+
let h = Math.round(p.size * i), g = 0;
|
|
1988
|
+
n[s] === "superscript" ? g = -Math.round(h * .35) : n[s] === "subscript" && (g = Math.round(h * .1)), e.fillText(Y[s].text, d, c + g);
|
|
1989
|
+
let _ = Math.round(f.size * i);
|
|
1990
|
+
if (f.underline) {
|
|
1970
1991
|
let t = (k === "top" ? w + 2 + _ + 1 : k === "center" ? w + N / 2 + Math.round(_ * .55) : w + N - 2 + 1) + g, n = m ? Q(m) : "#000000";
|
|
1971
|
-
Tt(e,
|
|
1992
|
+
Tt(e, d, d + a[s], t, n, f.underlineStyle === "double" || f.underlineStyle === "doubleAccounting");
|
|
1972
1993
|
}
|
|
1973
|
-
if (
|
|
1994
|
+
if (f.strike) {
|
|
1974
1995
|
let t = (k === "top" ? w + 2 + Math.round(_ * .5) : k === "center" ? w + N / 2 : w + N - 2 - Math.round(_ * .35)) + g;
|
|
1975
|
-
e.save(), e.strokeStyle = m ? Q(m) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(
|
|
1996
|
+
e.save(), e.strokeStyle = m ? Q(m) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(d, t), e.lineTo(d + a[s], t), e.stroke(), e.restore();
|
|
1976
1997
|
}
|
|
1977
|
-
|
|
1998
|
+
d += a[s];
|
|
1978
1999
|
}
|
|
1979
|
-
if (
|
|
1980
|
-
|
|
2000
|
+
if (l) try {
|
|
2001
|
+
u.direction = "ltr";
|
|
1981
2002
|
} catch {}
|
|
1982
2003
|
} else {
|
|
1983
|
-
let t = _.vertAlign, n = Math.round(I.size *
|
|
2004
|
+
let t = _.vertAlign, n = Math.round(I.size * i), r = 0;
|
|
1984
2005
|
t === "superscript" ? r = -Math.round(n * .35) : t === "subscript" && (r = Math.round(n * .1));
|
|
1985
|
-
let
|
|
2006
|
+
let a = t ? {
|
|
1986
2007
|
..._,
|
|
1987
2008
|
size: _.size * .65
|
|
1988
2009
|
} : _;
|
|
1989
|
-
t && (e.font = wt(
|
|
1990
|
-
let
|
|
1991
|
-
let e = Math.min(
|
|
2010
|
+
t && (e.font = wt(a, x));
|
|
2011
|
+
let o = null, s = () => o ??= e.measureText(J), c = () => {
|
|
2012
|
+
let e = Math.min(s().width, ce - R - 3);
|
|
1992
2013
|
return {
|
|
1993
2014
|
x: D === "right" ? P + M - 3 - e : D === "center" ? P + M / 2 - e / 2 : P + R,
|
|
1994
2015
|
width: e
|
|
1995
2016
|
};
|
|
1996
|
-
},
|
|
2017
|
+
}, l = Math.round(a.size * i);
|
|
1997
2018
|
if (_.underline || b) {
|
|
1998
|
-
let { x: t, width: n } =
|
|
2019
|
+
let { x: t, width: n } = c(), i = (k === "top" ? w + 2 + l + 1 : k === "center" ? w + N / 2 + Math.round(l * .55) : w + N - 2 + 1) + r, a = b ? "#0563C1" : T ? Q(T) : "#000000", o = _.underlineStyle === "double" || _.underlineStyle === "doubleAccounting";
|
|
1999
2020
|
Tt(e, t, t + n, i, a, o);
|
|
2000
2021
|
}
|
|
2001
2022
|
if (_.strike) {
|
|
2002
|
-
let { x: t, width: n } =
|
|
2023
|
+
let { x: t, width: n } = c(), i = (k === "top" ? w + 2 + Math.round(l * .5) : k === "center" ? w + N / 2 : w + N - 2 - Math.round(l * .35)) + r;
|
|
2003
2024
|
e.save(), e.strokeStyle = T ? Q(T) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(t, i), e.lineTo(t + n, i), e.stroke(), e.restore();
|
|
2004
2025
|
}
|
|
2005
|
-
if (
|
|
2006
|
-
let t =
|
|
2007
|
-
k === "top" ? (
|
|
2008
|
-
for (let i = 0; i < t.length; i++) e.fillText(t[i],
|
|
2026
|
+
if (J.includes("\n")) {
|
|
2027
|
+
let t = J.split("\n"), n = Math.round(I.size * i * 1.2), a = t.length * n, o;
|
|
2028
|
+
k === "top" ? (o = w + 2, e.textBaseline = "top") : k === "center" ? (o = w + (N - a) / 2, e.textBaseline = "top") : (o = w + N - a - 2, e.textBaseline = "top");
|
|
2029
|
+
for (let i = 0; i < t.length; i++) e.fillText(t[i], G, o + i * n + r);
|
|
2009
2030
|
} else {
|
|
2010
2031
|
let t;
|
|
2011
|
-
k === "top" ? (e.textBaseline = "top", t = w + 2) : k === "center" ? (e.textBaseline = "middle", t = w + N / 2) : (e.textBaseline = "bottom", t = w + N - 2), e.fillText(
|
|
2032
|
+
k === "top" ? (e.textBaseline = "top", t = w + 2) : k === "center" ? (e.textBaseline = "middle", t = w + N / 2) : (e.textBaseline = "bottom", t = w + N - 2), e.fillText(W, G, t + r);
|
|
2012
2033
|
}
|
|
2013
2034
|
}
|
|
2014
|
-
e.restore(),
|
|
2015
|
-
text:
|
|
2035
|
+
e.restore(), J && t.onTextRun && t.onTextRun({
|
|
2036
|
+
text: J,
|
|
2016
2037
|
x: P,
|
|
2017
2038
|
y: w,
|
|
2018
2039
|
width: M,
|
|
2019
2040
|
height: N,
|
|
2020
|
-
row:
|
|
2021
|
-
col:
|
|
2041
|
+
row: c,
|
|
2042
|
+
col: o
|
|
2022
2043
|
});
|
|
2023
2044
|
});
|
|
2024
2045
|
}
|
|
@@ -2048,7 +2069,7 @@ function Wt(e) {
|
|
|
2048
2069
|
}
|
|
2049
2070
|
let s = {
|
|
2050
2071
|
cellMap: n,
|
|
2051
|
-
cfContext:
|
|
2072
|
+
cfContext: ze(e),
|
|
2052
2073
|
mergeSkipSet: r,
|
|
2053
2074
|
autoFilterCells: i,
|
|
2054
2075
|
hyperlinkMap: a,
|
|
@@ -2059,7 +2080,7 @@ function Wt(e) {
|
|
|
2059
2080
|
return Ut.set(e, s), s;
|
|
2060
2081
|
}
|
|
2061
2082
|
function Gt(e, t, n, r, i = {}) {
|
|
2062
|
-
let a = i.dpr ?? 1, o = i.cellScale ?? 1, s =
|
|
2083
|
+
let a = i.dpr ?? 1, o = i.cellScale ?? 1, s = pt(t), c = e.canvas.width / a, l = e.canvas.height / a;
|
|
2063
2084
|
e.clearRect(0, 0, c, l), e.fillStyle = "#ffffff", e.fillRect(0, 0, c, l);
|
|
2064
2085
|
let u = (e) => Math.round(e * o), d = u(50), f = u(22), { row: p, col: m, rows: h, cols: g } = r, _ = (i.scrollOffsetX ?? 0) * o, v = (i.scrollOffsetY ?? 0) * o, y = i.freezeRows ?? 0, b = i.freezeCols ?? 0, x = [];
|
|
2065
2086
|
for (let e = 1; e <= b; e++) x.push(u(X(t.colWidths[e] ?? t.defaultColWidth, s)));
|
|
@@ -2111,14 +2132,14 @@ function Gt(e, t, n, r, i = {}) {
|
|
|
2111
2132
|
}, L = d, R = f, z = L + C, B = R + w, V = Math.max(0, c - z), H = Math.max(0, l - B);
|
|
2112
2133
|
y > 0 && b > 0 && Ht(e, I, 1, 1, x, S, 0, 0, L, R, L, R, C, w), y > 0 && Ht(e, I, 1, m, T, S, _, 0, z, R, z, R, V, w), b > 0 && Ht(e, I, p, 1, x, E, 0, v, L, B, L, B, C, H), Ht(e, I, p, m, T, E, _, v, z, B, z, B, V, H), t.images && t.images.length > 0 && i.loadedImages && Jt(e, t, i.loadedImages, o, p, m, _, v, z, B, V, H), t.shapeGroups && t.shapeGroups.length > 0 && Yt(e, t, o, p, m, _, v, z, B, V, H, i.loadedImages), t.charts && t.charts.length > 0 && _n(e, t, o, p, m, _, v, z, B, V, H), t.slicers && t.slicers.length > 0 && An(e, t, o, p, m, _, v, z, B, V, H), Kt(e, c, l, p, m, h, g, T, E, _, v, x, S, C, w, d, f, o, a, i.selectedRowRange ?? null, i.selectedColRange ?? null, t.rightToLeft === !0);
|
|
2113
2134
|
let ee = t.rightToLeft === !0;
|
|
2114
|
-
if (y > 0 && (e.save(), e.strokeStyle =
|
|
2115
|
-
e.save(), e.strokeStyle =
|
|
2135
|
+
if (y > 0 && (e.save(), e.strokeStyle = lt, e.lineWidth = .5, e.beginPath(), ee ? (e.moveTo(0, B + .5), e.lineTo(c - d, B + .5)) : (e.moveTo(d, B + .5), e.lineTo(c, B + .5)), e.stroke(), e.restore()), b > 0) {
|
|
2136
|
+
e.save(), e.strokeStyle = lt, e.lineWidth = .5, e.beginPath();
|
|
2116
2137
|
let t = ee ? c - z + .5 : z + .5;
|
|
2117
2138
|
e.moveTo(t, f), e.lineTo(t, l), e.stroke(), e.restore();
|
|
2118
2139
|
}
|
|
2119
2140
|
}
|
|
2120
2141
|
function Kt(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x) {
|
|
2121
|
-
let S = "#f8f9fa", C = "#e8eaed", w = "#caddf6", T = "#c8ccd0", E = "#5b9bd5", D = "#444", O = (e) => !b || e < b.start || e > b.end ? S : b.strong ? w : C, k = (e) => !b || e < b.start || e > b.end ? T : b.strong ? E : T, A = (e) => !y || e < y.start || e > y.end ? S : y.strong ? w : C, j = (e) => !y || e < y.start || e > y.end ? T : y.strong ? E : T, M = `${Math.max(1, Math.round(11 * _))}px ${
|
|
2142
|
+
let S = "#f8f9fa", C = "#e8eaed", w = "#caddf6", T = "#c8ccd0", E = "#5b9bd5", D = "#444", O = (e) => !b || e < b.start || e > b.end ? S : b.strong ? w : C, k = (e) => !b || e < b.start || e > b.end ? T : b.strong ? E : T, A = (e) => !y || e < y.start || e > y.end ? S : y.strong ? w : C, j = (e) => !y || e < y.start || e > y.end ? T : y.strong ? E : T, M = `${Math.max(1, Math.round(11 * _))}px ${nt}`, N = h + p, P = g + m, F = .5 / v, I = (e, n) => x ? ct(e, n, t) : e, L = x ? t - h : 0;
|
|
2122
2143
|
e.fillStyle = S, e.fillRect(L, 0, h, g), e.strokeStyle = T, e.lineWidth = .5, e.beginPath(), e.moveTo(L + F, 0), e.lineTo(L + F, g), e.moveTo(L, F), e.lineTo(L + h, F), e.moveTo(L + h - F, 0), e.lineTo(L + h - F, g), e.moveTo(L, g - F), e.lineTo(L + h, g - F), e.stroke(), e.font = M, e.fillStyle = D;
|
|
2123
2144
|
let R = (t, n, r) => {
|
|
2124
2145
|
let i = I(n, r);
|
|
@@ -2156,7 +2177,7 @@ function Kt(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x) {
|
|
|
2156
2177
|
e.restore();
|
|
2157
2178
|
}
|
|
2158
2179
|
function $(e, t, n) {
|
|
2159
|
-
let r =
|
|
2180
|
+
let r = pt(e), i = 0;
|
|
2160
2181
|
for (let a = 1; a < t; a++) i += Math.round(X(e.colWidths[a] ?? e.defaultColWidth, r) * n);
|
|
2161
2182
|
return i;
|
|
2162
2183
|
}
|
|
@@ -2165,97 +2186,97 @@ function qt(e, t, n) {
|
|
|
2165
2186
|
for (let i = 1; i < t; i++) r += Math.round(Z(e.rowHeights[i] ?? e.defaultRowHeight) * n);
|
|
2166
2187
|
return r;
|
|
2167
2188
|
}
|
|
2168
|
-
function Jt(t, n, r, i, a, o, s, c, l, u, d
|
|
2169
|
-
if (
|
|
2170
|
-
let p = $(
|
|
2171
|
-
|
|
2172
|
-
for (let
|
|
2173
|
-
let
|
|
2174
|
-
if (!
|
|
2175
|
-
let h =
|
|
2176
|
-
if (
|
|
2189
|
+
function Jt(e, t, n, r, i, a, o, s, c, l, u, d) {
|
|
2190
|
+
if (u <= 0 || d <= 0) return;
|
|
2191
|
+
let p = $(t, a, r), m = qt(t, i, r);
|
|
2192
|
+
e.save(), e.beginPath(), e.rect(c, l, u, d), e.clip();
|
|
2193
|
+
for (let i of t.images) {
|
|
2194
|
+
let a = n.get(i.dataUrl);
|
|
2195
|
+
if (!a) continue;
|
|
2196
|
+
let h = i.fromCol + 1, g = i.fromRow + 1, _ = $(t, h, r) + i.fromColOff * r / f, v = qt(t, g, r) + i.fromRowOff * r / f, y, b;
|
|
2197
|
+
if (i.editAs === "oneCell" && i.nativeExtCx > 0 && i.nativeExtCy > 0) y = i.nativeExtCx * r / f, b = i.nativeExtCy * r / f;
|
|
2177
2198
|
else {
|
|
2178
|
-
let
|
|
2179
|
-
y =
|
|
2199
|
+
let e = i.toCol + 1, n = i.toRow + 1, a = $(t, e, r) + i.toColOff * r / f, o = qt(t, n, r) + i.toRowOff * r / f;
|
|
2200
|
+
y = a - _, b = o - v;
|
|
2180
2201
|
}
|
|
2181
2202
|
if (y <= 0 || b <= 0) continue;
|
|
2182
|
-
let x =
|
|
2183
|
-
x + y <
|
|
2203
|
+
let x = c + (_ - p) - o, S = l + (v - m) - s;
|
|
2204
|
+
x + y < c || x > c + u || S + b < l || S > l + d || e.drawImage(a, x, S, y, b);
|
|
2184
2205
|
}
|
|
2185
|
-
|
|
2206
|
+
e.restore();
|
|
2186
2207
|
}
|
|
2187
|
-
function Yt(t, n, r, i, a, o, s, c, l, u, d
|
|
2188
|
-
if (
|
|
2189
|
-
let p =
|
|
2208
|
+
function Yt(e, t, n, r, i, a, o, s, c, l, u, d) {
|
|
2209
|
+
if (l <= 0 || u <= 0) return;
|
|
2210
|
+
let p = t.shapeGroups;
|
|
2190
2211
|
if (!p || p.length === 0) return;
|
|
2191
|
-
let m = $(
|
|
2192
|
-
|
|
2193
|
-
for (let
|
|
2194
|
-
let
|
|
2195
|
-
if (
|
|
2212
|
+
let m = $(t, i, n), h = qt(t, r, n);
|
|
2213
|
+
e.save(), e.beginPath(), e.rect(s, c, l, u), e.clip();
|
|
2214
|
+
for (let r of p) {
|
|
2215
|
+
let i = r.fromCol + 1, p = r.fromRow + 1, g = $(t, i, n) + r.fromColOff * n / f, _ = qt(t, p, n) + r.fromRowOff * n / f, v, y;
|
|
2216
|
+
if (r.editAs === "oneCell" && r.nativeExtCx > 0 && r.nativeExtCy > 0) v = r.nativeExtCx * n / f, y = r.nativeExtCy * n / f;
|
|
2196
2217
|
else {
|
|
2197
|
-
let
|
|
2198
|
-
v =
|
|
2218
|
+
let e = r.toCol + 1, i = r.toRow + 1, a = $(t, e, n) + r.toColOff * n / f, o = qt(t, i, n) + r.toRowOff * n / f;
|
|
2219
|
+
v = a - g, y = o - _;
|
|
2199
2220
|
}
|
|
2200
2221
|
if (v <= 0 || y <= 0) continue;
|
|
2201
|
-
let b =
|
|
2202
|
-
if (!(b + v <
|
|
2203
|
-
let
|
|
2204
|
-
a <= 0 || o <= 0 || Xt(
|
|
2222
|
+
let b = s + (g - m) - a, x = c + (_ - h) - o;
|
|
2223
|
+
if (!(b + v < s || b > s + l) && !(x + y < c || x > c + u)) for (let t of r.shapes) {
|
|
2224
|
+
let r = b + t.x * v, i = x + t.y * y, a = t.w * v, o = t.h * y;
|
|
2225
|
+
a <= 0 || o <= 0 || Xt(e, t, r, i, a, o, n, d);
|
|
2205
2226
|
}
|
|
2206
2227
|
}
|
|
2207
|
-
|
|
2228
|
+
e.restore();
|
|
2208
2229
|
}
|
|
2209
|
-
function Xt(t, n, r, i, a, o, s
|
|
2210
|
-
if (
|
|
2211
|
-
if (
|
|
2212
|
-
let r =
|
|
2213
|
-
|
|
2230
|
+
function Xt(e, t, n, r, i, a, o, s) {
|
|
2231
|
+
if (e.save(), t.rot === 0 ? e.translate(n, r) : (e.translate(n + i / 2, r + a / 2), e.rotate(t.rot * Math.PI / 180), e.translate(-i / 2, -a / 2)), t.geom.type === "custom") for (let n of t.geom.paths) {
|
|
2232
|
+
if (n.w <= 0 || n.h <= 0) continue;
|
|
2233
|
+
let r = i / n.w, o = a / n.h;
|
|
2234
|
+
e.beginPath();
|
|
2214
2235
|
let s = 0, c = 0, l = 0, u = 0;
|
|
2215
|
-
for (let
|
|
2236
|
+
for (let t of n.commands) switch (t.op) {
|
|
2216
2237
|
case "moveTo": {
|
|
2217
|
-
let
|
|
2218
|
-
|
|
2238
|
+
let n = t.x * r, i = t.y * o;
|
|
2239
|
+
e.moveTo(n, i), s = l = n, c = u = i;
|
|
2219
2240
|
break;
|
|
2220
2241
|
}
|
|
2221
2242
|
case "lineTo": {
|
|
2222
|
-
let
|
|
2223
|
-
|
|
2243
|
+
let n = t.x * r, i = t.y * o;
|
|
2244
|
+
e.lineTo(n, i), s = n, c = i;
|
|
2224
2245
|
break;
|
|
2225
2246
|
}
|
|
2226
2247
|
case "cubicBezTo": {
|
|
2227
|
-
let
|
|
2228
|
-
|
|
2248
|
+
let n = t.x3 * r, i = t.y3 * o;
|
|
2249
|
+
e.bezierCurveTo(t.x1 * r, t.y1 * o, t.x2 * r, t.y2 * o, n, i), s = n, c = i;
|
|
2229
2250
|
break;
|
|
2230
2251
|
}
|
|
2231
2252
|
case "quadBezTo": {
|
|
2232
|
-
let
|
|
2233
|
-
|
|
2253
|
+
let n = t.x2 * r, i = t.y2 * o;
|
|
2254
|
+
e.quadraticCurveTo(t.x1 * r, t.y1 * o, n, i), s = n, c = i;
|
|
2234
2255
|
break;
|
|
2235
2256
|
}
|
|
2236
2257
|
case "arcTo": {
|
|
2237
|
-
let
|
|
2238
|
-
if (
|
|
2239
|
-
let
|
|
2240
|
-
|
|
2258
|
+
let n = t.wr * r, i = t.hr * o;
|
|
2259
|
+
if (n <= 0 || i <= 0) break;
|
|
2260
|
+
let a = t.stAng / 6e4 * (Math.PI / 180), l = t.swAng / 6e4 * (Math.PI / 180), u = s - Math.cos(a) * n, d = c - Math.sin(a) * i, f = a + l;
|
|
2261
|
+
e.ellipse(u, d, n, i, 0, a, f, l < 0), s = u + Math.cos(f) * n, c = d + Math.sin(f) * i;
|
|
2241
2262
|
break;
|
|
2242
2263
|
}
|
|
2243
2264
|
case "close":
|
|
2244
|
-
|
|
2265
|
+
e.closePath(), s = l, c = u;
|
|
2245
2266
|
break;
|
|
2246
2267
|
}
|
|
2247
|
-
sn(
|
|
2268
|
+
sn(e, t);
|
|
2248
2269
|
}
|
|
2249
|
-
else if (
|
|
2250
|
-
let
|
|
2251
|
-
|
|
2270
|
+
else if (t.geom.type === "preset") {
|
|
2271
|
+
let n = t.fillColor ?? null, r = t.strokeColor && t.strokeWidth > 0 ? () => {
|
|
2272
|
+
e.strokeStyle = t.strokeColor, e.lineWidth = Math.max(.5, t.strokeWidth / f), e.stroke();
|
|
2252
2273
|
} : null;
|
|
2253
|
-
y(
|
|
2254
|
-
} else if (
|
|
2255
|
-
let
|
|
2256
|
-
|
|
2274
|
+
y(e, t.geom.name, 0, 0, i, a, t.geom.adj ?? [], n, r, () => {}) || (e.beginPath(), e.rect(0, 0, i, a), sn(e, t));
|
|
2275
|
+
} else if (t.geom.type === "image") {
|
|
2276
|
+
let n = s?.get(t.geom.dataUrl);
|
|
2277
|
+
n && e.drawImage(n, 0, 0, i, a);
|
|
2257
2278
|
}
|
|
2258
|
-
|
|
2279
|
+
t.text && on(e, t.text, i, a, o), e.restore();
|
|
2259
2280
|
}
|
|
2260
2281
|
var Zt = /* @__PURE__ */ new WeakMap();
|
|
2261
2282
|
function Qt(e, t) {
|
|
@@ -2305,26 +2326,26 @@ async function an(e, t) {
|
|
|
2305
2326
|
} catch {}
|
|
2306
2327
|
}
|
|
2307
2328
|
}
|
|
2308
|
-
function on(e, t, n, r,
|
|
2329
|
+
function on(e, t, n, r, a) {
|
|
2309
2330
|
if (n <= 0 || r <= 0 || t.paragraphs.length === 0) return;
|
|
2310
|
-
let
|
|
2311
|
-
if (
|
|
2312
|
-
let
|
|
2313
|
-
let t = (e.size > 0 ? e.size :
|
|
2331
|
+
let o = 7 * a, s = 4 * a, c = Math.max(0, n - o * 2), l = Math.max(0, r - s * 2);
|
|
2332
|
+
if (c <= 0 || l <= 0) return;
|
|
2333
|
+
let u = (e) => {
|
|
2334
|
+
let t = (e.size > 0 ? e.size : ot) * i * a, n = at(e.fontFace);
|
|
2314
2335
|
return {
|
|
2315
2336
|
font: `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${t}px ${n}`,
|
|
2316
2337
|
px: t
|
|
2317
2338
|
};
|
|
2318
|
-
},
|
|
2339
|
+
}, d = t.wrap !== "none", f = [];
|
|
2319
2340
|
for (let n of t.paragraphs) {
|
|
2320
|
-
let t = n.align || "l", r = [],
|
|
2321
|
-
|
|
2341
|
+
let t = n.align || "l", r = [], o = 0, s = 0, l = 0, p = !1, m = () => {
|
|
2342
|
+
f.push({
|
|
2322
2343
|
segs: r,
|
|
2323
2344
|
align: t,
|
|
2324
|
-
height:
|
|
2325
|
-
ascent:
|
|
2326
|
-
hasMath:
|
|
2327
|
-
}), r = [],
|
|
2345
|
+
height: s,
|
|
2346
|
+
ascent: l,
|
|
2347
|
+
hasMath: p
|
|
2348
|
+
}), r = [], o = 0, s = 0, l = 0, p = !1;
|
|
2328
2349
|
}, h = 0;
|
|
2329
2350
|
for (let g of n.runs) {
|
|
2330
2351
|
if (g.type === "break") {
|
|
@@ -2334,14 +2355,14 @@ function on(e, t, n, r, i) {
|
|
|
2334
2355
|
if (g.type === "math") {
|
|
2335
2356
|
let e = Zt.get(g.nodes);
|
|
2336
2357
|
if (!e) continue;
|
|
2337
|
-
let n = (g.fontSize ?? (h ||
|
|
2358
|
+
let n = (g.fontSize ?? (h || ot)) * i * a, u = e.widthEm * n, _ = e.ascentEm * n, v = e.descentEm * n, y = g.color ?? "#000000";
|
|
2338
2359
|
if (g.display) {
|
|
2339
|
-
m(),
|
|
2360
|
+
m(), f.push({
|
|
2340
2361
|
segs: [{
|
|
2341
2362
|
kind: "math",
|
|
2342
2363
|
render: e,
|
|
2343
2364
|
color: y,
|
|
2344
|
-
w:
|
|
2365
|
+
w: u,
|
|
2345
2366
|
ascent: _,
|
|
2346
2367
|
descent: v
|
|
2347
2368
|
}],
|
|
@@ -2352,25 +2373,25 @@ function on(e, t, n, r, i) {
|
|
|
2352
2373
|
});
|
|
2353
2374
|
continue;
|
|
2354
2375
|
}
|
|
2355
|
-
|
|
2376
|
+
d && o + u > c && r.length > 0 && m(), r.push({
|
|
2356
2377
|
kind: "math",
|
|
2357
2378
|
render: e,
|
|
2358
2379
|
color: y,
|
|
2359
|
-
w:
|
|
2380
|
+
w: u,
|
|
2360
2381
|
ascent: _,
|
|
2361
2382
|
descent: v
|
|
2362
|
-
}),
|
|
2383
|
+
}), o += u, s = Math.max(s, _ + v), l = Math.max(l, _), p = !0;
|
|
2363
2384
|
continue;
|
|
2364
2385
|
}
|
|
2365
|
-
h = g.size > 0 ? g.size :
|
|
2366
|
-
let { font: n, px: _ } =
|
|
2367
|
-
|
|
2386
|
+
h = g.size > 0 ? g.size : ot;
|
|
2387
|
+
let { font: n, px: _ } = u(g), v = g.color ?? "#000000";
|
|
2388
|
+
s = Math.max(s, _ * 1.2), l = Math.max(l, _ * .85), e.font = n;
|
|
2368
2389
|
let y = g.text.split("\n");
|
|
2369
2390
|
for (let t = 0; t < y.length; t++) {
|
|
2370
2391
|
t > 0 && m();
|
|
2371
2392
|
let i = y[t];
|
|
2372
2393
|
if (!i) continue;
|
|
2373
|
-
if (!
|
|
2394
|
+
if (!d) {
|
|
2374
2395
|
let t = e.measureText(i).width;
|
|
2375
2396
|
r.push({
|
|
2376
2397
|
kind: "text",
|
|
@@ -2378,46 +2399,46 @@ function on(e, t, n, r, i) {
|
|
|
2378
2399
|
font: n,
|
|
2379
2400
|
color: v,
|
|
2380
2401
|
w: t
|
|
2381
|
-
}),
|
|
2402
|
+
}), o += t;
|
|
2382
2403
|
continue;
|
|
2383
2404
|
}
|
|
2384
|
-
let
|
|
2405
|
+
let a = "";
|
|
2385
2406
|
for (let t of i) {
|
|
2386
|
-
let i =
|
|
2387
|
-
if (
|
|
2388
|
-
if (
|
|
2389
|
-
let t = e.measureText(
|
|
2407
|
+
let i = a + t, u = e.measureText(i).width;
|
|
2408
|
+
if (o + u > c && (a.length > 0 || r.length > 0)) {
|
|
2409
|
+
if (a) {
|
|
2410
|
+
let t = e.measureText(a).width;
|
|
2390
2411
|
r.push({
|
|
2391
2412
|
kind: "text",
|
|
2392
|
-
text:
|
|
2413
|
+
text: a,
|
|
2393
2414
|
font: n,
|
|
2394
2415
|
color: v,
|
|
2395
2416
|
w: t
|
|
2396
|
-
}),
|
|
2417
|
+
}), o += t;
|
|
2397
2418
|
}
|
|
2398
|
-
m(),
|
|
2399
|
-
} else
|
|
2419
|
+
m(), a = t, e.font = n, s = Math.max(s, _ * 1.2), l = Math.max(l, _ * .85);
|
|
2420
|
+
} else a = i;
|
|
2400
2421
|
}
|
|
2401
|
-
if (
|
|
2402
|
-
let t = e.measureText(
|
|
2422
|
+
if (a) {
|
|
2423
|
+
let t = e.measureText(a).width;
|
|
2403
2424
|
r.push({
|
|
2404
2425
|
kind: "text",
|
|
2405
|
-
text:
|
|
2426
|
+
text: a,
|
|
2406
2427
|
font: n,
|
|
2407
2428
|
color: v,
|
|
2408
2429
|
w: t
|
|
2409
|
-
}),
|
|
2430
|
+
}), o += t;
|
|
2410
2431
|
}
|
|
2411
2432
|
}
|
|
2412
2433
|
}
|
|
2413
2434
|
m();
|
|
2414
2435
|
}
|
|
2415
|
-
let
|
|
2416
|
-
t.anchor === "ctr" ? m =
|
|
2436
|
+
let p = f.reduce((e, t) => e + t.height, 0), m = s;
|
|
2437
|
+
t.anchor === "ctr" ? m = s + (l - p) / 2 : t.anchor === "b" && (m = s + Math.max(0, l - p));
|
|
2417
2438
|
let h = m;
|
|
2418
|
-
for (let t of
|
|
2419
|
-
let n = t.segs.reduce((e, t) => e + t.w, 0), r =
|
|
2420
|
-
if (t.align === "ctr" ? r =
|
|
2439
|
+
for (let t of f) {
|
|
2440
|
+
let n = t.segs.reduce((e, t) => e + t.w, 0), r = o;
|
|
2441
|
+
if (t.align === "ctr" ? r = o + Math.max(0, (c - n) / 2) : t.align === "r" && (r = o + Math.max(0, c - n)), t.hasMath) {
|
|
2421
2442
|
e.textBaseline = "alphabetic";
|
|
2422
2443
|
let n = h + t.ascent;
|
|
2423
2444
|
for (let i of t.segs) {
|
|
@@ -2436,8 +2457,8 @@ function on(e, t, n, r, i) {
|
|
|
2436
2457
|
h += t.height;
|
|
2437
2458
|
}
|
|
2438
2459
|
}
|
|
2439
|
-
function sn(
|
|
2440
|
-
|
|
2460
|
+
function sn(e, t) {
|
|
2461
|
+
t.fillColor && (e.fillStyle = t.fillColor, e.fill()), t.strokeColor && t.strokeWidth > 0 && (e.strokeStyle = t.strokeColor, e.lineWidth = Math.max(.5, t.strokeWidth / f), e.stroke());
|
|
2441
2462
|
}
|
|
2442
2463
|
function cn(e, t, n, r, i, a, o) {
|
|
2443
2464
|
if (r === n && i === t) return e;
|
|
@@ -2694,35 +2715,35 @@ function gn(e) {
|
|
|
2694
2715
|
radarStyle: e.radarStyle ?? null
|
|
2695
2716
|
};
|
|
2696
2717
|
}
|
|
2697
|
-
function _n(t, n, r,
|
|
2698
|
-
if (
|
|
2699
|
-
let m = $(
|
|
2700
|
-
for (let
|
|
2701
|
-
let a =
|
|
2718
|
+
function _n(e, t, n, r, a, o, s, c, l, u, d) {
|
|
2719
|
+
if (u <= 0 || d <= 0) return;
|
|
2720
|
+
let m = $(t, a, n), h = qt(t, r, n);
|
|
2721
|
+
for (let r of t.charts) {
|
|
2722
|
+
let a = r.fromCol + 1, g = r.fromRow + 1, _ = r.toCol + 1, v = r.toRow + 1, y = $(t, a, n) + r.fromColOff * n / f, b = qt(t, g, n) + r.fromRowOff * n / f, x = $(t, _, n) + r.toColOff * n / f, S = qt(t, v, n) + r.toRowOff * n / f, C = x - y, w = S - b;
|
|
2702
2723
|
if (C <= 0 || w <= 0) continue;
|
|
2703
|
-
let T =
|
|
2704
|
-
if (T + C <
|
|
2705
|
-
|
|
2706
|
-
let D =
|
|
2707
|
-
|
|
2724
|
+
let T = c + (y - m) - o, E = l + (b - h) - s;
|
|
2725
|
+
if (T + C < c || T > c + u || E + w < l || E > l + d) continue;
|
|
2726
|
+
e.save(), e.beginPath(), e.rect(c, l, u, d), e.clip();
|
|
2727
|
+
let D = i * n;
|
|
2728
|
+
p(e, gn(r.chart), {
|
|
2708
2729
|
x: T,
|
|
2709
2730
|
y: E,
|
|
2710
2731
|
w: C,
|
|
2711
2732
|
h: w
|
|
2712
|
-
}, D),
|
|
2733
|
+
}, D), e.restore();
|
|
2713
2734
|
}
|
|
2714
2735
|
}
|
|
2715
2736
|
var vn = "600 12px \"Meiryo UI\", \"Segoe UI\", sans-serif", yn = "11px \"Meiryo UI\", \"Segoe UI\", sans-serif", bn = "#FFFFFF", xn = "#BFBFBF", Sn = "#F2F2F2", Cn = "#404040", wn = "#FFFFFF", Tn = "#000000", En = "#A5A5A5", Dn = "#E7E6E6", On = "#A6A6A6", kn = "#C6C6C6";
|
|
2716
|
-
function An(t, n, r, i, a, o, s, c, l, u
|
|
2717
|
-
if (
|
|
2718
|
-
let
|
|
2719
|
-
if (!
|
|
2720
|
-
let p = $(
|
|
2721
|
-
for (let
|
|
2722
|
-
let
|
|
2737
|
+
function An(e, t, n, r, i, a, o, s, c, l, u) {
|
|
2738
|
+
if (l <= 0 || u <= 0) return;
|
|
2739
|
+
let d = t.slicers;
|
|
2740
|
+
if (!d) return;
|
|
2741
|
+
let p = $(t, i, n), m = qt(t, r, n);
|
|
2742
|
+
for (let r of d) {
|
|
2743
|
+
let i = r.fromCol + 1, d = r.fromRow + 1, h = r.toCol + 1, g = r.toRow + 1, _ = $(t, i, n) + r.fromColOff * n / f, v = qt(t, d, n) + r.fromRowOff * n / f, y = $(t, h, n) + r.toColOff * n / f, b = qt(t, g, n) + r.toRowOff * n / f, x = y - _, S = b - v;
|
|
2723
2744
|
if (x <= 0 || S <= 0) continue;
|
|
2724
|
-
let C =
|
|
2725
|
-
C + x <
|
|
2745
|
+
let C = s + (_ - p) - a, w = c + (v - m) - o;
|
|
2746
|
+
C + x < s || C > s + l || w + S < c || w > c + u || (e.save(), e.beginPath(), e.rect(s, c, l, u), e.clip(), jn(e, r.caption, r.items, C, w, x, S, n), e.restore());
|
|
2726
2747
|
}
|
|
2727
2748
|
}
|
|
2728
2749
|
function jn(e, t, n, r, i, a, o, s) {
|
|
@@ -2764,8 +2785,8 @@ async function Pn(e, t, n, r = {}) {
|
|
|
2764
2785
|
let t = await (await fetch(e)).blob(), n = await createImageBitmap(t);
|
|
2765
2786
|
o.set(e, n);
|
|
2766
2787
|
})).catch(() => {}), e.math && rn(i) && await an(i, e.math);
|
|
2767
|
-
let c = r.dpr ??
|
|
2768
|
-
t.width = Math.round(p * c), t.height = Math.round(m * c),
|
|
2788
|
+
let c = r.dpr ?? d(), u = l(t) ? t.clientWidth || 800 : t.width, f = l(t) ? t.clientHeight || 600 : t.height, p = r.width ?? u, m = r.height ?? f;
|
|
2789
|
+
t.width = Math.round(p * c), t.height = Math.round(m * c), l(t) && (t.style.width = `${p}px`, t.style.height = `${m}px`);
|
|
2769
2790
|
let h = t.getContext("2d");
|
|
2770
2791
|
h.scale(c, c), Gt(h, i, a, n, {
|
|
2771
2792
|
...r,
|
|
@@ -2818,10 +2839,10 @@ function* Rn(e) {
|
|
|
2818
2839
|
for (let t of e?.sharedStrings ?? []) if (t.runs && t.runs.length > 0) for (let e of t.runs) yield e.text;
|
|
2819
2840
|
else yield t.text;
|
|
2820
2841
|
}
|
|
2821
|
-
function zn(
|
|
2842
|
+
function zn(t) {
|
|
2822
2843
|
let n = /* @__PURE__ */ new Set(), r = null;
|
|
2823
|
-
for (let
|
|
2824
|
-
for (let
|
|
2844
|
+
for (let i of t?.styles?.fonts ?? []) i.name && (n.add(i.name), r ??= e(i.name));
|
|
2845
|
+
for (let e of c(Rn(t), r)) n.add(e);
|
|
2825
2846
|
return n;
|
|
2826
2847
|
}
|
|
2827
2848
|
function Bn(e) {
|
|
@@ -2839,9 +2860,9 @@ function Bn(e) {
|
|
|
2839
2860
|
let e = t.slice(0, i);
|
|
2840
2861
|
e.startsWith("'") && e.endsWith("'") && e.length >= 2 && (e = e.slice(1, -1).replace(/''/g, "'")), n = e, r = t.slice(i + 1);
|
|
2841
2862
|
}
|
|
2842
|
-
let [a, o] = r.split(":"), s =
|
|
2863
|
+
let [a, o] = r.split(":"), s = $e(a ?? "");
|
|
2843
2864
|
if (s) {
|
|
2844
|
-
let e = o ?
|
|
2865
|
+
let e = o ? $e(o) : s;
|
|
2845
2866
|
if (e) {
|
|
2846
2867
|
let t = {
|
|
2847
2868
|
row: Math.min(s.row, e.row),
|
|
@@ -2917,28 +2938,28 @@ var Un = class e {
|
|
|
2917
2938
|
static async load(t, n = {}) {
|
|
2918
2939
|
let r = n.mode ?? "main";
|
|
2919
2940
|
if (r === "worker" && (typeof Worker > "u" || typeof OffscreenCanvas > "u")) throw Error("mode: 'worker' requires Worker and OffscreenCanvas support");
|
|
2920
|
-
let i = new e(r === "worker" ? (await import("./render-worker-host-
|
|
2941
|
+
let i = new e(r === "worker" ? (await import("./render-worker-host-CI4BVZcT.js")).createRenderWorker() : new w(), r);
|
|
2921
2942
|
return await i._load(t, n), i;
|
|
2922
2943
|
}
|
|
2923
|
-
async _load(e,
|
|
2924
|
-
let
|
|
2944
|
+
async _load(e, n = {}) {
|
|
2945
|
+
let r;
|
|
2925
2946
|
if (typeof e == "string") {
|
|
2926
2947
|
let t = await fetch(e);
|
|
2927
2948
|
if (!t.ok) throw Error(`Failed to fetch: ${t.status} ${t.statusText}`);
|
|
2928
|
-
|
|
2929
|
-
} else
|
|
2930
|
-
this.rawData =
|
|
2949
|
+
r = await t.arrayBuffer();
|
|
2950
|
+
} else r = e;
|
|
2951
|
+
this.rawData = r, this.maxZipEntryBytes = n.maxZipEntryBytes, this.math = n.math, n.math && this._mode === "worker" && console.warn("[ooxml] the math engine is unavailable in mode: 'worker'; equations will be skipped. Use mode: 'main' for workbooks with equations."), this.parsedWorkbook = (await this.bridge.request((e) => this._mode === "worker" ? {
|
|
2931
2952
|
type: "parse",
|
|
2932
2953
|
id: e,
|
|
2933
|
-
data:
|
|
2954
|
+
data: r.slice(0),
|
|
2934
2955
|
maxZipEntryBytes: this.maxZipEntryBytes,
|
|
2935
|
-
useGoogleFonts: !!
|
|
2956
|
+
useGoogleFonts: !!n.useGoogleFonts
|
|
2936
2957
|
} : {
|
|
2937
2958
|
type: "parse",
|
|
2938
2959
|
id: e,
|
|
2939
|
-
data:
|
|
2960
|
+
data: r.slice(0),
|
|
2940
2961
|
maxZipEntryBytes: this.maxZipEntryBytes
|
|
2941
|
-
})).workbook, this._mode === "main" &&
|
|
2962
|
+
})).workbook, this._mode === "main" && n.useGoogleFonts && await t(zn(this.parsedWorkbook), Ln);
|
|
2942
2963
|
}
|
|
2943
2964
|
get sheetNames() {
|
|
2944
2965
|
return this.parsedWorkbook?.workbook.sheets.map((e) => e.name) ?? [];
|
|
@@ -2982,7 +3003,7 @@ var Un = class e {
|
|
|
2982
3003
|
for (let e of i.rows) for (let t of e.cells) o.set(`${t.row}:${t.col}`, t);
|
|
2983
3004
|
return Vn(n, (e, t) => {
|
|
2984
3005
|
let n = o.get(`${e}:${t}`);
|
|
2985
|
-
return n ?
|
|
3006
|
+
return n ? he(n, a) : null;
|
|
2986
3007
|
});
|
|
2987
3008
|
}
|
|
2988
3009
|
async renderViewport(e, t, n, r = {}) {
|
|
@@ -2998,7 +3019,7 @@ var Un = class e {
|
|
|
2998
3019
|
async renderViewportToBitmap(e, t, n) {
|
|
2999
3020
|
let r = {
|
|
3000
3021
|
...n,
|
|
3001
|
-
dpr: n.dpr ??
|
|
3022
|
+
dpr: n.dpr ?? d()
|
|
3002
3023
|
};
|
|
3003
3024
|
if (this._mode === "worker") {
|
|
3004
3025
|
if (!Number.isInteger(e) || e < 0 || e >= this.sheetCount) throw Error(`Sheet index ${e} out of range (count: ${this.sheetCount})`);
|
|
@@ -3023,13 +3044,13 @@ function Wn(e, t, n) {
|
|
|
3023
3044
|
if (!e) return !1;
|
|
3024
3045
|
for (let r of e.split(/\s+/)) {
|
|
3025
3046
|
if (!r) continue;
|
|
3026
|
-
let [e, i] = r.split(":"), a =
|
|
3047
|
+
let [e, i] = r.split(":"), a = $e(e);
|
|
3027
3048
|
if (!a) continue;
|
|
3028
3049
|
if (!i) {
|
|
3029
3050
|
if (a.row === t && a.col === n) return !0;
|
|
3030
3051
|
continue;
|
|
3031
3052
|
}
|
|
3032
|
-
let o =
|
|
3053
|
+
let o = $e(i);
|
|
3033
3054
|
if (!o) continue;
|
|
3034
3055
|
let s = Math.min(a.row, o.row), c = Math.max(a.row, o.row), l = Math.min(a.col, o.col), u = Math.max(a.col, o.col);
|
|
3035
3056
|
if (t >= s && t <= c && n >= l && n <= u) return !0;
|
|
@@ -3183,7 +3204,7 @@ var rr = class {
|
|
|
3183
3204
|
return this.isRtl ? this.maxScrollLeft - e : e;
|
|
3184
3205
|
}
|
|
3185
3206
|
screenX(e, t) {
|
|
3186
|
-
return this.isRtl ?
|
|
3207
|
+
return this.isRtl ? ct(e, t, this.canvasArea.clientWidth) : e;
|
|
3187
3208
|
}
|
|
3188
3209
|
resetHorizontalScroll() {
|
|
3189
3210
|
this.effectiveH = 0, this.scrollHost.scrollLeft = this.isRtl ? this.maxScrollLeft : 0;
|
|
@@ -3220,7 +3241,7 @@ var rr = class {
|
|
|
3220
3241
|
}
|
|
3221
3242
|
let p = 0, m = [];
|
|
3222
3243
|
for (let e = 1; e <= u; e++) {
|
|
3223
|
-
let t = X(n.colWidths[e] ?? n.defaultColWidth,
|
|
3244
|
+
let t = X(n.colWidths[e] ?? n.defaultColWidth, pt(n));
|
|
3224
3245
|
m.push(t), p += t;
|
|
3225
3246
|
}
|
|
3226
3247
|
let h;
|
|
@@ -3255,7 +3276,7 @@ var rr = class {
|
|
|
3255
3276
|
let e = s - p + this.effectiveScrollLeft / r;
|
|
3256
3277
|
g = -1;
|
|
3257
3278
|
let t = 0;
|
|
3258
|
-
for (let r = u + 1; r <= 16384; r++) if (t += X(n.colWidths[r] ?? n.defaultColWidth,
|
|
3279
|
+
for (let r = u + 1; r <= 16384; r++) if (t += X(n.colWidths[r] ?? n.defaultColWidth, pt(n)), e < t) {
|
|
3259
3280
|
g = r;
|
|
3260
3281
|
break;
|
|
3261
3282
|
}
|
|
@@ -3269,7 +3290,7 @@ var rr = class {
|
|
|
3269
3290
|
getCellRect(e, t) {
|
|
3270
3291
|
let n = this.currentWorksheet;
|
|
3271
3292
|
if (!n) return null;
|
|
3272
|
-
let r = this.opts.cellScale ?? 1, i =
|
|
3293
|
+
let r = this.opts.cellScale ?? 1, i = pt(n), a = (e) => Math.round(e * r), o = (e) => a(X(n.colWidths[e] ?? n.defaultColWidth, i)), s = (e) => a(Z(n.rowHeights[e] ?? n.defaultRowHeight)), c = n.freezeRows ?? 0, l = n.freezeCols ?? 0, u;
|
|
3273
3294
|
if (t <= l) {
|
|
3274
3295
|
let e = a(50);
|
|
3275
3296
|
for (let n = 1; n < t; n++) e += o(n);
|
|
@@ -3310,7 +3331,7 @@ var rr = class {
|
|
|
3310
3331
|
};
|
|
3311
3332
|
}
|
|
3312
3333
|
select(e) {
|
|
3313
|
-
let t =
|
|
3334
|
+
let t = $e(e);
|
|
3314
3335
|
t && (this.hideValidationPanel(), this.selectionMode = "cells", this.anchorCell = {
|
|
3315
3336
|
row: t.row,
|
|
3316
3337
|
col: t.col
|
|
@@ -3353,7 +3374,7 @@ var rr = class {
|
|
|
3353
3374
|
if (d < 0) return { kind: "corner" };
|
|
3354
3375
|
let f = 0, p = [];
|
|
3355
3376
|
for (let e = 1; e <= u; e++) {
|
|
3356
|
-
let t = X(n.colWidths[e] ?? n.defaultColWidth,
|
|
3377
|
+
let t = X(n.colWidths[e] ?? n.defaultColWidth, pt(n));
|
|
3357
3378
|
p.push(t), f += t;
|
|
3358
3379
|
}
|
|
3359
3380
|
if (d < f) {
|
|
@@ -3365,7 +3386,7 @@ var rr = class {
|
|
|
3365
3386
|
return null;
|
|
3366
3387
|
}
|
|
3367
3388
|
let m = d - f + this.effectiveScrollLeft / r, h = 0;
|
|
3368
|
-
for (let e = u + 1; e <= 16384; e++) if (h += X(n.colWidths[e] ?? n.defaultColWidth,
|
|
3389
|
+
for (let e = u + 1; e <= 16384; e++) if (h += X(n.colWidths[e] ?? n.defaultColWidth, pt(n)), m < h) return {
|
|
3369
3390
|
kind: "col",
|
|
3370
3391
|
col: e
|
|
3371
3392
|
};
|
|
@@ -3400,7 +3421,7 @@ var rr = class {
|
|
|
3400
3421
|
let e = this.opts.cellScale ?? 1, t = this.currentWorksheet, n = t?.freezeRows ?? 0, r = t?.freezeCols ?? 0, i = (t) => Math.round(t * e), a = i(50), o = i(22), s = 0;
|
|
3401
3422
|
if (t) for (let e = 1; e <= n; e++) s += i(Z(t.rowHeights[e] ?? t.defaultRowHeight));
|
|
3402
3423
|
let c = 0;
|
|
3403
|
-
if (t) for (let e = 1; e <= r; e++) c += i(X(t.colWidths[e] ?? t.defaultColWidth,
|
|
3424
|
+
if (t) for (let e = 1; e <= r; e++) c += i(X(t.colWidths[e] ?? t.defaultColWidth, pt(t)));
|
|
3404
3425
|
let l, u, d, f, p = 1, m = 1;
|
|
3405
3426
|
if (this.selectionMode === "all") l = a, u = o, d = this.canvasArea.clientWidth - a, f = this.canvasArea.clientHeight - o;
|
|
3406
3427
|
else if (this.selectionMode === "rows") {
|
|
@@ -3525,7 +3546,7 @@ var rr = class {
|
|
|
3525
3546
|
buildCommentMap(e) {
|
|
3526
3547
|
this.commentMap = /* @__PURE__ */ new Map();
|
|
3527
3548
|
for (let t of e.comments ?? []) {
|
|
3528
|
-
let e =
|
|
3549
|
+
let e = $e(t.cellRef);
|
|
3529
3550
|
e && this.commentMap.set(`${e.row}:${e.col}`, t);
|
|
3530
3551
|
}
|
|
3531
3552
|
}
|
|
@@ -3754,7 +3775,7 @@ var rr = class {
|
|
|
3754
3775
|
}
|
|
3755
3776
|
}
|
|
3756
3777
|
updateSpacerSize(e) {
|
|
3757
|
-
let t = this.opts.cellScale ?? 1, n =
|
|
3778
|
+
let t = this.opts.cellScale ?? 1, n = pt(e), r = (e) => Math.round(e * t), i = e.freezeRows ?? 0, a = e.freezeCols ?? 0, o = Math.max(50, i), s = Math.max(26, a);
|
|
3758
3779
|
for (let t of e.rows) {
|
|
3759
3780
|
t.index > o && (o = t.index);
|
|
3760
3781
|
for (let e of t.cells) e.col > s && (s = e.col);
|
|
@@ -3771,13 +3792,13 @@ var rr = class {
|
|
|
3771
3792
|
let e = this.currentWorksheet, t = this.canvasArea.clientWidth, n = this.canvasArea.clientHeight;
|
|
3772
3793
|
if (t <= 0 || n <= 0) return;
|
|
3773
3794
|
let r = this.opts.cellScale ?? 1, i = window.devicePixelRatio ?? 1, a = e.freezeRows ?? 0, o = e.freezeCols ?? 0, s = 0;
|
|
3774
|
-
for (let t = 1; t <= o; t++) s += X(e.colWidths[t] ?? e.defaultColWidth,
|
|
3795
|
+
for (let t = 1; t <= o; t++) s += X(e.colWidths[t] ?? e.defaultColWidth, pt(e));
|
|
3775
3796
|
let c = 0;
|
|
3776
3797
|
for (let t = 1; t <= a; t++) c += Z(e.rowHeights[t] ?? e.defaultRowHeight);
|
|
3777
|
-
let l = this.effectiveScrollLeft / r, u = this.scrollHost.scrollTop / r, d = nr(e,
|
|
3798
|
+
let l = this.effectiveScrollLeft / r, u = this.scrollHost.scrollTop / r, d = nr(e, pt(e)), { index: f, partial: p } = d.col.indexAt(l + d.col.offsetOf(o + 1)), { index: m, partial: h } = d.row.indexAt(u + d.row.offsetOf(a + 1)), g = t / r - 50 - s, _ = n / r - 22 - c, v = 0;
|
|
3778
3799
|
{
|
|
3779
3800
|
let t = -p, n = f;
|
|
3780
|
-
for (; t < g + p && n <= 16384;) t += X(e.colWidths[n] ?? e.defaultColWidth,
|
|
3801
|
+
for (; t < g + p && n <= 16384;) t += X(e.colWidths[n] ?? e.defaultColWidth, pt(e)), v++, n++;
|
|
3781
3802
|
v += 2;
|
|
3782
3803
|
}
|
|
3783
3804
|
let y = 0;
|
|
@@ -3874,10 +3895,10 @@ var rr = class {
|
|
|
3874
3895
|
destroy() {
|
|
3875
3896
|
this.resizeObserver?.disconnect(), this.hideCommentPopup(), this.hideValidationPanel(), this.keydownHandler && document.removeEventListener("keydown", this.keydownHandler), this.wb?.destroy();
|
|
3876
3897
|
}
|
|
3877
|
-
}, ir = /* @__PURE__ */
|
|
3898
|
+
}, ir = /* @__PURE__ */ s({
|
|
3878
3899
|
XlsxViewer: () => rr,
|
|
3879
3900
|
XlsxWorkbook: () => Un,
|
|
3880
|
-
autoResize: () =>
|
|
3901
|
+
autoResize: () => a
|
|
3881
3902
|
});
|
|
3882
3903
|
//#endregion
|
|
3883
3904
|
export { rr as n, Un as r, ir as t };
|