@silurus/ooxml 0.64.0 → 0.64.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/dist/{docx-bm_nejFi.js → docx-CYWZ0ngf.js} +368 -372
- package/dist/docx.mjs +2 -2
- package/dist/index.mjs +3 -3
- package/dist/{pptx-BMkeLNP-.js → pptx-N97zm9pT.js} +455 -432
- package/dist/pptx.mjs +2 -2
- package/dist/{render-worker-host-j-N9SY-5.js → render-worker-host-Cle0Hnjr.js} +1 -1
- package/dist/{render-worker-host-CpdJg0Em.js → render-worker-host-DCQ7z8jC.js} +1 -1
- package/dist/{src-DaB2HHXH.js → src-D-GPkjc_.js} +14 -1
- package/dist/{xlsx-D8CS3kbR.js → xlsx-C89e1hC-.js} +203 -203
- package/dist/xlsx.mjs +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as e,
|
|
1
|
+
import { $ as e, B as t, H as n, J as r, M as i, N as a, O as o, P as s, Q as c, U as l, X as u, Y as d, Z as f, d as p, et as m, f as h, h as g, i as _, l as v, m as y, o as b, p as x, q as S, s as C, u as w, z as T } from "./src-D-GPkjc_.js";
|
|
2
2
|
import { t as E } from "./mathjax-CNh-4Cw1.js";
|
|
3
3
|
//#region packages/xlsx/src/worker.ts?worker&inline
|
|
4
4
|
var D = "function e(e,t,n){let r=d(e,y.__wbindgen_malloc),a=v,o=f(t,y.__wbindgen_malloc,y.__wbindgen_realloc),s=v,c=y.extract_image(r,a,o,s,!u(n),u(n)?BigInt(0):n);if(c[3])throw p(c[2]);var l=i(c[0],c[1]).slice();return y.__wbindgen_free(c[0],c[1]*1,1),l}function t(e,t,n,r){let i,a;try{let l=d(e,y.__wbindgen_malloc),m=v,h=f(n,y.__wbindgen_malloc,y.__wbindgen_realloc),g=v,_=y.parse_sheet(l,m,t,h,g,!u(r),u(r)?BigInt(0):r);var o=_[0],c=_[1];if(_[3])throw o=0,c=0,p(_[2]);return i=o,a=c,s(o,c)}finally{y.__wbindgen_free(i,a,1)}}function n(e,t){let n,r;try{let o=d(e,y.__wbindgen_malloc),c=v,l=y.parse_xlsx(o,c,!u(t),u(t)?BigInt(0):t);var i=l[0],a=l[1];if(l[3])throw i=0,a=0,p(l[2]);return n=i,r=a,s(i,a)}finally{y.__wbindgen_free(n,r,1)}}function r(){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(s(e,t))}finally{y.__wbindgen_free(n,r,1)}},__wbg_new_227d7c05414eb861:function(){return Error()},__wbg_stack_3b0d974bbf31e44f:function(e,t){let n=t.stack,r=f(n,y.__wbindgen_malloc,y.__wbindgen_realloc),i=v;o().setInt32(e+4,i,!0),o().setInt32(e+0,r,!0)},__wbindgen_cast_0000000000000001:function(e,t){return s(e,t)},__wbindgen_init_externref_table:function(){let e=y.__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)}}}}function i(e,t){return e>>>=0,l().subarray(e/1,e/1+t)}let a=null;function o(){return(a===null||a.buffer.detached===!0||a.buffer.detached===void 0&&a.buffer!==y.memory.buffer)&&(a=new DataView(y.memory.buffer)),a}function s(e,t){return e>>>=0,g(e,t)}let c=null;function l(){return(c===null||c.byteLength===0)&&(c=new Uint8Array(y.memory.buffer)),c}function u(e){return e==null}function d(e,t){let n=t(e.length*1,1)>>>0;return l().set(e,n/1),v=e.length,n}function f(e,t,n){if(n===void 0){let n=_.encode(e),r=t(n.length,1)>>>0;return l().subarray(r,r+n.length).set(n),v=n.length,r}let r=e.length,i=t(r,1)>>>0,a=l(),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=l().subarray(i+o,i+r),a=_.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return v=o,i}function p(e){let t=y.__wbindgen_externrefs.get(e);return y.__externref_table_dealloc(e),t}let m=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0});m.decode();let h=0;function g(e,t){return h+=t,h>=2146435072&&(m=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}),m.decode(),h=t),m.decode(l().subarray(e,e+t))}const _=new TextEncoder;`encodeInto`in _||(_.encodeInto=function(e,t){let n=_.encode(e);return t.set(n),{read:e.length,written:n.length}});let v=0,y;function b(e,t){return y=e.exports,a=null,c=null,y.__wbindgen_start(),y}async function x(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 S(e){if(y!==void 0)return y;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=r();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:i}=await x(await e,t);return b(n,i)}const C=e=>`https://fonts.googleapis.com/css2?family=${e}:wght@400;700&display=swap`;C(`Noto+Sans+KR`),C(`Noto+Sans+SC`),C(`Noto+Sans+TC`),C(`Noto+Sans+JP`),C(`Noto+Serif+KR`),C(`Noto+Serif+SC`),C(`Noto+Serif+TC`),C(`Noto+Serif+JP`),C(`Noto+Sans`),C(`Noto+Serif`),C(`Noto+Sans+Devanagari`),C(`Noto+Sans+Thai`),C(`Noto+Sans+Hebrew`),C(`Noto+Serif+Hebrew`),Math.PI*2/216e5,Math.PI*2/216e5,35*Math.PI/180,12*Math.PI/180;function w(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 T=[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],E=[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<T.length;t+=2)e.set(T[t],T[t+1]);return e})(),(()=>{let e=new Map;for(let t=0;t<E.length;t+=3)e.set(E[t],{pair:E[t+1],type:E[t+2]===0?`o`:`c`});return e})();function D(e){let t=new Set;for(let n of e)t.add(n.codePointAt(0));return t}function O(e){return{enabled:e?.kinsoku!==!1,lineStartForbidden:D(e?.noLineBreaksBefore??`”’)〕]}〉》」』】〙〗〟⦆»、。,.・:;/?!‐ー゠–〜~ぁぃぅぇぉっゃゅょゎゕゖァィゥェォッャュョヮヵヶㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ゝゞヽヾ゛゜%‰℃°′″。」、・ー゙゚!),.:;?]}⦆`),lineEndForbidden:D(e?.noLineBreaksAfter??`“‘(〔[{〈《「『【〘〖〝⦅«$¥#£¢([{⦅`)}}O();let k=null,A=null,j;self.onmessage=async r=>{let i=r.data;if(i.type===`init`){k=S(w(i.wasmUrl)??i.wasmUrl);return}let a=i.id;try{if(await k,i.type===`parse`){j=typeof i.maxZipEntryBytes==`number`&&i.maxZipEntryBytes>0?BigInt(i.maxZipEntryBytes):void 0,A=new Uint8Array(i.data);let e=n(A,j),t={type:`parsed`,id:a,workbook:JSON.parse(e)};self.postMessage(t)}else if(i.type===`parseSheet`){let e=typeof i.maxZipEntryBytes==`number`&&i.maxZipEntryBytes>0?BigInt(i.maxZipEntryBytes):void 0,n=t(new Uint8Array(i.data),i.sheetIndex,i.sheetName,e),r={type:`parsedSheet`,id:a,worksheet:JSON.parse(n)};self.postMessage(r)}else if(i.type===`extractImage`){if(!A)throw Error(`No xlsx loaded`);let t=e(A,i.path,j),n=new Uint8Array(t).slice().buffer,r={type:`imageExtracted`,id:a,bytes:n};self.postMessage(r,[n])}}catch(e){let t={type:`error`,id:a,message:String(e)};self.postMessage(t)}};", O = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", D], { type: "text/javascript;charset=utf-8" });
|
|
@@ -1065,7 +1065,7 @@ function Ze(e, t, n, r, i) {
|
|
|
1065
1065
|
//#endregion
|
|
1066
1066
|
//#region packages/xlsx/src/bidi-line.ts
|
|
1067
1067
|
function Qe(e, t) {
|
|
1068
|
-
return e === 2 ? !0 : e === 1 ? !1 :
|
|
1068
|
+
return e === 2 ? !0 : e === 1 ? !1 : v(void 0, t) === "rtl";
|
|
1069
1069
|
}
|
|
1070
1070
|
var $e = /[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF\u200F\u202B\u202E\u2067]|[\u{10800}-\u{10FFF}\u{1E800}-\u{1EFFF}]/u, et = (e) => {
|
|
1071
1071
|
let t = e.text;
|
|
@@ -1091,7 +1091,7 @@ function rt(e, t) {
|
|
|
1091
1091
|
let n = et(e[t]) ?? "";
|
|
1092
1092
|
r += n.length > 0 ? n : nt;
|
|
1093
1093
|
}
|
|
1094
|
-
let a =
|
|
1094
|
+
let a = w(), { levels: o, paragraphLevel: s } = a.computeLevels(r, t ? "rtl" : "ltr"), c = new Uint8Array(n);
|
|
1095
1095
|
for (let e = 0; e < n; e++) {
|
|
1096
1096
|
let t = o[i[e]];
|
|
1097
1097
|
c[e] = t === 255 ? s : t;
|
|
@@ -1117,15 +1117,15 @@ function it(e) {
|
|
|
1117
1117
|
}
|
|
1118
1118
|
//#endregion
|
|
1119
1119
|
//#region packages/xlsx/src/renderer.ts
|
|
1120
|
-
var at =
|
|
1120
|
+
var at = S.map((e) => `"${e}"`).join(", "), ot = r.map((e) => `"${e}"`).join(", "), st = `"Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${at}, sans-serif`;
|
|
1121
1121
|
function ct(e) {
|
|
1122
1122
|
return /song|sung|simsun|nsimsun|batang|gungsuh|mincho|mingliu|pmingliu|fangsong|kaiti|simkai|simfang|stsong|stkaiti|新細明|細明|宋体|明朝|楷体|楷體|仿宋|標楷|游明朝/.test(e);
|
|
1123
1123
|
}
|
|
1124
1124
|
function lt(e) {
|
|
1125
|
-
let t = e ?
|
|
1125
|
+
let t = e ? f(e) : null;
|
|
1126
1126
|
if (!t) return st;
|
|
1127
1127
|
let n = ct((e ?? "").toLowerCase());
|
|
1128
|
-
return `${
|
|
1128
|
+
return `${u(t, n ? "serif" : "sans").map((e) => `"${e}"`).join(", ")}, "Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${n ? ot : at}, ${n ? "serif" : "sans-serif"}`;
|
|
1129
1129
|
}
|
|
1130
1130
|
function ut(e) {
|
|
1131
1131
|
return e ? `"${e}", ${lt(e)}` : st;
|
|
@@ -1145,22 +1145,22 @@ var mt = "#7a7a7a", ht = /* @__PURE__ */ new Map(), gt = {
|
|
|
1145
1145
|
}
|
|
1146
1146
|
};
|
|
1147
1147
|
function _t(e, t) {
|
|
1148
|
-
let
|
|
1149
|
-
if (
|
|
1150
|
-
let
|
|
1151
|
-
if (
|
|
1152
|
-
let
|
|
1148
|
+
let n = `${e}:${t}`, r = ht.get(n);
|
|
1149
|
+
if (r !== void 0) return r;
|
|
1150
|
+
let i = gt[e.toLowerCase()]?.[Math.round(t)];
|
|
1151
|
+
if (i !== void 0) return ht.set(n, i), i;
|
|
1152
|
+
let a = t * l, o = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1) : typeof document < "u" ? document.createElement("canvas") : null;
|
|
1153
|
+
if (!o) return ft;
|
|
1154
|
+
let s = o.getContext("2d");
|
|
1153
1155
|
if (!s) return ft;
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
c.font = `${o}px ${ut(e)}`;
|
|
1157
|
-
let l = 0;
|
|
1156
|
+
s.font = `${a}px ${ut(e)}`;
|
|
1157
|
+
let c = 0;
|
|
1158
1158
|
for (let e of "0123456789") {
|
|
1159
|
-
let t =
|
|
1160
|
-
t >
|
|
1159
|
+
let t = s.measureText(e).width;
|
|
1160
|
+
t > c && (c = t);
|
|
1161
1161
|
}
|
|
1162
|
-
let u = Math.round(
|
|
1163
|
-
return ht.set(
|
|
1162
|
+
let u = Math.round(c) || ft;
|
|
1163
|
+
return ht.set(n, u), u;
|
|
1164
1164
|
}
|
|
1165
1165
|
function vt(e) {
|
|
1166
1166
|
return !e.defaultFontFamily || !e.defaultFontSize ? ft : _t(e.defaultFontFamily, e.defaultFontSize);
|
|
@@ -1169,7 +1169,7 @@ function X(e, t = ft) {
|
|
|
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 * l);
|
|
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);
|
|
@@ -1369,24 +1369,24 @@ var xt = /* @__PURE__ */ new Map(), St = {
|
|
|
1369
1369
|
153
|
|
1370
1370
|
]
|
|
1371
1371
|
};
|
|
1372
|
-
function Ct(e, n, r
|
|
1373
|
-
let
|
|
1372
|
+
function Ct(e, t, n, r) {
|
|
1373
|
+
let i = e.getTransform(), a = Math.max(1, Math.round(Math.hypot(i.a, i.b))), s = Math.max(1, Math.round(Math.hypot(i.c, i.d))), c = `${t}|${n}|${r}|${a}|${s}`;
|
|
1374
1374
|
if (xt.has(c)) return xt.get(c);
|
|
1375
|
-
let l = St[
|
|
1375
|
+
let l = St[t];
|
|
1376
1376
|
if (!l) return xt.set(c, null), null;
|
|
1377
|
-
let u = l.length, d =
|
|
1377
|
+
let u = l.length, d = o(u, u);
|
|
1378
1378
|
if (!d) return xt.set(c, null), null;
|
|
1379
1379
|
let f = d.getContext("2d");
|
|
1380
1380
|
if (!f) return xt.set(c, null), null;
|
|
1381
|
-
f.fillStyle = Q(
|
|
1381
|
+
f.fillStyle = Q(r), f.fillRect(0, 0, u, u), f.fillStyle = Q(n);
|
|
1382
1382
|
for (let e = 0; e < u; e++) {
|
|
1383
1383
|
let t = l[e];
|
|
1384
1384
|
for (let n = 0; n < u; n++) t & 1 << u - 1 - n && f.fillRect(n, e, 1, 1);
|
|
1385
1385
|
}
|
|
1386
1386
|
let p = e.createPattern(d, "repeat");
|
|
1387
|
-
if (p && typeof DOMMatrix < "u" && (
|
|
1387
|
+
if (p && typeof DOMMatrix < "u" && (a >= 2 || s >= 2)) {
|
|
1388
1388
|
let e = new DOMMatrix();
|
|
1389
|
-
e.scaleSelf(1 /
|
|
1389
|
+
e.scaleSelf(1 / a, 1 / s), p.setTransform(e);
|
|
1390
1390
|
}
|
|
1391
1391
|
return xt.set(c, p), p;
|
|
1392
1392
|
}
|
|
@@ -1428,11 +1428,11 @@ function Ot(e, t, n) {
|
|
|
1428
1428
|
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.min(1, Math.max(0, 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
|
-
function $(e, t,
|
|
1432
|
-
return Math.round(e *
|
|
1431
|
+
function $(e, t, n = 1) {
|
|
1432
|
+
return Math.round(e * l * n * t);
|
|
1433
1433
|
}
|
|
1434
1434
|
function kt(e, t = 1) {
|
|
1435
|
-
return `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${Math.max(1, Math.round(e.size *
|
|
1435
|
+
return `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${Math.max(1, Math.round(e.size * l * t))}px ${ut(e.name)}`;
|
|
1436
1436
|
}
|
|
1437
1437
|
function At(e, t, n, r, i, a) {
|
|
1438
1438
|
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();
|
|
@@ -1493,13 +1493,13 @@ function Nt(e, t, n) {
|
|
|
1493
1493
|
function Pt(e, t) {
|
|
1494
1494
|
if (e.length === 0 || t.length === 0) return 0;
|
|
1495
1495
|
let n = [...e, ...t], r = e.length;
|
|
1496
|
-
return r -
|
|
1496
|
+
return r - b(n, r, C, 1);
|
|
1497
1497
|
}
|
|
1498
1498
|
function Ft(e, t, n) {
|
|
1499
1499
|
let r = [], i = [], a = 0;
|
|
1500
1500
|
for (; a < t.length;) {
|
|
1501
1501
|
let e = t[a], n = e.codePointAt(0) ?? 0;
|
|
1502
|
-
if (
|
|
1502
|
+
if (_(n)) i.push(e), a += n > 65535 ? 2 : 1;
|
|
1503
1503
|
else if (e === " ") {
|
|
1504
1504
|
let e = a;
|
|
1505
1505
|
for (; e < t.length && t[e] === " ";) e++;
|
|
@@ -1508,7 +1508,7 @@ function Ft(e, t, n) {
|
|
|
1508
1508
|
let e = a;
|
|
1509
1509
|
for (; e < t.length;) {
|
|
1510
1510
|
let n = t[e], r = n.codePointAt(0) ?? 0;
|
|
1511
|
-
if (n === " " ||
|
|
1511
|
+
if (n === " " || _(r)) break;
|
|
1512
1512
|
e += r > 65535 ? 2 : 1;
|
|
1513
1513
|
}
|
|
1514
1514
|
i.push(t.slice(a, e)), a = e;
|
|
@@ -1575,7 +1575,7 @@ function It(e, t, n, r, i) {
|
|
|
1575
1575
|
for (; i < e.text.length;) {
|
|
1576
1576
|
let t = e.text[i], n = t.codePointAt(0) ?? 0;
|
|
1577
1577
|
if (n === 10) r.push("\n"), i += 1;
|
|
1578
|
-
else if (
|
|
1578
|
+
else if (_(n)) r.push(t), i += n > 65535 ? 2 : 1;
|
|
1579
1579
|
else if (t === " ") {
|
|
1580
1580
|
let t = i;
|
|
1581
1581
|
for (; t < e.text.length && e.text[t] === " ";) t++;
|
|
@@ -1584,7 +1584,7 @@ function It(e, t, n, r, i) {
|
|
|
1584
1584
|
let t = i;
|
|
1585
1585
|
for (; t < e.text.length;) {
|
|
1586
1586
|
let n = e.text[t], r = n.codePointAt(0) ?? 0;
|
|
1587
|
-
if (n === " " || n === "\n" ||
|
|
1587
|
+
if (n === " " || n === "\n" || _(r)) break;
|
|
1588
1588
|
t += r > 65535 ? 2 : 1;
|
|
1589
1589
|
}
|
|
1590
1590
|
r.push(e.text.slice(i, t)), i = t;
|
|
@@ -1727,7 +1727,7 @@ function Kt(e) {
|
|
|
1727
1727
|
}
|
|
1728
1728
|
function qt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
1729
1729
|
if (f <= 0 || p <= 0) return;
|
|
1730
|
-
let { styles: m, cellMap: h, mergeAnchorMap:
|
|
1730
|
+
let { styles: m, cellMap: h, mergeAnchorMap: _, mergeSkipSet: v, cfContext: y, cs: b, dpr: x } = t, S = i.length, C = a.length, w = (e, n) => t.rtl ? pt(e, n, t.canvasW) : e, T = [], E = -o;
|
|
1731
1731
|
for (let e = 0; e < S; e++) T.push(E), E += i[e];
|
|
1732
1732
|
let D = [], O = -s;
|
|
1733
1733
|
for (let e = 0; e < C; e++) D.push(O), O += a[e];
|
|
@@ -1754,13 +1754,13 @@ function qt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
1754
1754
|
}
|
|
1755
1755
|
let h = d.totalW, g = d.totalH;
|
|
1756
1756
|
f = w(f, h);
|
|
1757
|
-
let _ = `${a}:${u}`,
|
|
1757
|
+
let _ = `${a}:${u}`, v = t.cellMap.get(_), { font: x, fill: E, border: O, xf: k } = Mt(m, v?.styleIndex ?? 0), A = Ze(v, a, u, y, m.dxfs ?? []);
|
|
1758
1758
|
if (wt(e, A.fill ?? E, f, p, h, g), A.dataBar && A.dataBar.ratio > 0) {
|
|
1759
1759
|
let t = Math.max(0, (h - 4) * A.dataBar.ratio);
|
|
1760
1760
|
yt(e, A.dataBar.color, f + 2, p + 2, t, g - 4, A.dataBar.gradient);
|
|
1761
1761
|
}
|
|
1762
|
-
if (gn(e, hn(mn(O, a, u, d.right, d.bottom, t.cellMap, m), A.border), f, p, h, g), !
|
|
1763
|
-
let j = be(
|
|
1762
|
+
if (gn(e, hn(mn(O, a, u, d.right, d.bottom, t.cellMap, m), A.border), f, p, h, g), !v) continue;
|
|
1763
|
+
let j = be(v, m, A.numFmt);
|
|
1764
1764
|
if (!j || j === "0" && t.worksheet.showZeros === !1) continue;
|
|
1765
1765
|
let M = x.bold || !!A.fontBold, N = x.italic || !!A.fontItalic, P = x.underline || !!A.fontUnderline, F = x.strike || !!A.fontStrike, I = M !== x.bold || N !== x.italic || P !== x.underline || F !== x.strike ? {
|
|
1766
1766
|
...x,
|
|
@@ -1772,11 +1772,11 @@ function qt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
1772
1772
|
e.font = kt(I, b);
|
|
1773
1773
|
let L = t.hyperlinkMap.get(_) ? "#0563C1" : A.fontColor ?? x.color;
|
|
1774
1774
|
e.fillStyle = L ? Q(L) : "#000000";
|
|
1775
|
-
let R =
|
|
1775
|
+
let R = v.value.type === "number", z = k.alignH ?? (R ? "right" : "left"), B = k.alignV ?? "bottom", V = k.indent ? Math.round(k.indent * 3 * t.mdw) : 0, H = 3 + (z === "left" || !k.alignH ? V : 0);
|
|
1776
1776
|
e.save(), e.beginPath(), e.rect(f, p, h, g), e.clip();
|
|
1777
1777
|
let U;
|
|
1778
1778
|
z === "right" ? (U = f + h - 3, e.textAlign = "right") : z === "center" ? (U = f + h / 2, e.textAlign = "center") : (U = f + H, e.textAlign = "left");
|
|
1779
|
-
let W =
|
|
1779
|
+
let W = v.value.type === "text" ? v.value.runs : void 0, G = W && W.length > 0;
|
|
1780
1780
|
if (k.wrapText && G) {
|
|
1781
1781
|
let t = It(e, W, I, b, h - H - 3), n = t.reduce((e, t) => e + $(t.maxFontSize, b, 1.2), 0), r;
|
|
1782
1782
|
r = B === "top" ? p + 2 : B === "center" ? p + (g - n) / 2 : p + g - n - 2, e.textAlign = "left", e.textBaseline = "top";
|
|
@@ -1814,7 +1814,7 @@ function qt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
1814
1814
|
let t = !1, n = !1;
|
|
1815
1815
|
if (e < S) {
|
|
1816
1816
|
let i = `${s}:${r + e}`;
|
|
1817
|
-
if (!
|
|
1817
|
+
if (!v.has(i) && !_.has(i)) {
|
|
1818
1818
|
let e = h.get(i);
|
|
1819
1819
|
t = Mt(m, e?.styleIndex ?? 0).xf.alignH === "centerContinuous", n = !!(e && e.value && e.value.type !== "empty");
|
|
1820
1820
|
}
|
|
@@ -1825,14 +1825,14 @@ function qt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
1825
1825
|
let a = r + n, l = c + T[n], d = i[n];
|
|
1826
1826
|
if (l + d <= u || l >= u + f) continue;
|
|
1827
1827
|
let p = `${s}:${a}`;
|
|
1828
|
-
if (
|
|
1829
|
-
let D =
|
|
1828
|
+
if (v.has(p)) continue;
|
|
1829
|
+
let D = _.get(p), j = D ? D.totalW : d, M = D ? D.totalH : E, N = w(l, j), P = h.get(p), { font: F, fill: I, border: L, xf: R } = Mt(m, P?.styleIndex ?? 0), z = Ze(P, s, a, y, m.dxfs ?? []), B = z.fill ?? I, V = t.tableStyleMap.get(p), H = m.dxfs ?? [], U = (e) => e == null ? void 0 : H[e], W = U(V?.wholeTableDxf), G = U(V?.headerRowDxf), ee = U(V?.totalRowDxf), te = U(V?.firstColumnDxf), ne = U(V?.lastColumnDxf), re = U(V?.stripeDxf), ie = V?.isHeader && G?.fill?.fgColor ? G : V?.isTotals && ee?.fill?.fgColor ? ee : V?.isLastCol && ne?.fill?.fgColor ? ne : V?.isFirstCol && te?.fill?.fgColor ? te : re?.fill?.fgColor ? re : !V?.isHeader && !V?.isTotals && W?.fill?.fgColor ? W : void 0, ae = !1;
|
|
1830
1830
|
if (wt(e, B, N, C, j, M) ? ae = !0 : V && ie?.fill?.fgColor ? (e.fillStyle = Q(ie.fill.fgColor), e.fillRect(N, C, j, M), ae = !0) : V && !V.isCustom && V.isBanded && (e.fillStyle = Kt(V.accent), e.fillRect(N, C, j, M), ae = !0), t.commentCells.has(p) && Dt(e, N, C, j, M), z.dataBar && z.dataBar.ratio > 0) {
|
|
1831
1831
|
let t = Math.max(0, (j - 4) * z.dataBar.ratio);
|
|
1832
1832
|
yt(e, z.dataBar.color, N + 2, C + 2, t, M - 4, z.dataBar.gradient);
|
|
1833
1833
|
}
|
|
1834
1834
|
let oe = t.sparklineMap.get(p);
|
|
1835
|
-
if (oe &&
|
|
1835
|
+
if (oe && g(e, {
|
|
1836
1836
|
x: N,
|
|
1837
1837
|
y: C,
|
|
1838
1838
|
w: j,
|
|
@@ -1877,20 +1877,20 @@ function qt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
1877
1877
|
if (t.autoFilterCells.has(p) && Ht(e, N, C, d, M), !P) continue;
|
|
1878
1878
|
let J = be(P, m, z.numFmt);
|
|
1879
1879
|
!J || J === "0" && t.worksheet.showZeros === !1 || k.push(() => {
|
|
1880
|
-
let o = V?.isHeader ? G : V?.isTotals ? ee : V?.isLastCol && ne ? ne : V?.isFirstCol && te ? te : re || (V ? W : void 0), c = V ? V.isCustom ? !!o?.font?.bold : V.isHeader || V.isTotals : !1, l = F.bold || !!z.fontBold || c, u = F.italic || !!z.fontItalic, d = F.underline || !!z.fontUnderline, f = F.strike || !!z.fontStrike,
|
|
1880
|
+
let o = V?.isHeader ? G : V?.isTotals ? ee : V?.isLastCol && ne ? ne : V?.isFirstCol && te ? te : re || (V ? W : void 0), c = V ? V.isCustom ? !!o?.font?.bold : V.isHeader || V.isTotals : !1, l = F.bold || !!z.fontBold || c, u = F.italic || !!z.fontItalic, d = F.underline || !!z.fontUnderline, f = F.strike || !!z.fontStrike, g = l !== F.bold || u !== F.italic || d !== F.underline || f !== F.strike ? {
|
|
1881
1881
|
...F,
|
|
1882
1882
|
bold: l,
|
|
1883
1883
|
italic: u,
|
|
1884
1884
|
underline: d,
|
|
1885
1885
|
strike: f
|
|
1886
1886
|
} : F;
|
|
1887
|
-
e.font = kt(
|
|
1887
|
+
e.font = kt(g, b);
|
|
1888
1888
|
let y = t.hyperlinkMap.get(p), x = o?.font?.color ?? null, w = y ? "#0563C1" : z.fontColor ?? x ?? F.color;
|
|
1889
1889
|
e.fillStyle = w ? Q(w) : "#000000";
|
|
1890
1890
|
let T = P.value.type === "number", E = R.alignH ?? (T ? "right" : "left"), O = R.alignV ?? "bottom", k = R.indent ? Math.round(R.indent * 3 * t.mdw) : 0, A = z.iconSet ? Math.max(8, Math.round(Math.min(j, M) * .55)) : 0, I = A > 0 ? A + 4 : 0, L = 3 + (E === "left" || !R.alignH ? k : 0) + I, B = j, H = N, U = n;
|
|
1891
1891
|
if (E === "centerContinuous" && !D) for (let e = n + 1; e < S; e++) {
|
|
1892
1892
|
let t = `${s}:${r + e}`;
|
|
1893
|
-
if (
|
|
1893
|
+
if (v.has(t) || _.has(t)) break;
|
|
1894
1894
|
let n = h.get(t);
|
|
1895
1895
|
if (n && n.value.type !== "empty" || Mt(m, n?.styleIndex ?? 0).xf.alignH !== "centerContinuous") break;
|
|
1896
1896
|
B += i[e], U = e;
|
|
@@ -1904,7 +1904,7 @@ function qt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
1904
1904
|
let e = t, o = a ? U + 1 : n + 1;
|
|
1905
1905
|
for (let t = o; t < S && e > 0; t++) {
|
|
1906
1906
|
let n = `${s}:${r + t}`;
|
|
1907
|
-
if (
|
|
1907
|
+
if (v.has(n) || _.has(n)) break;
|
|
1908
1908
|
let a = h.get(n);
|
|
1909
1909
|
if (a && a.value.type !== "empty") break;
|
|
1910
1910
|
ae += i[t], e -= i[t];
|
|
@@ -1914,7 +1914,7 @@ function qt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
1914
1914
|
let e = l;
|
|
1915
1915
|
for (let t = n - 1; t >= 0 && e > 0; t--) {
|
|
1916
1916
|
let n = `${s}:${r + t}`;
|
|
1917
|
-
if (
|
|
1917
|
+
if (v.has(n) || _.has(n)) break;
|
|
1918
1918
|
let a = h.get(n);
|
|
1919
1919
|
if (a && a.value.type !== "empty") break;
|
|
1920
1920
|
ie -= i[t], ae += i[t], e -= i[t];
|
|
@@ -1964,7 +1964,7 @@ function qt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
1964
1964
|
} catch {}
|
|
1965
1965
|
let Y = P.value.type === "text" ? P.value.runs : void 0, fe = Y && Y.length > 0;
|
|
1966
1966
|
if (R.wrapText && fe) {
|
|
1967
|
-
let t = It(e, Y,
|
|
1967
|
+
let t = It(e, Y, g, b, j - L - 3), n = t.reduce((e, t) => e + $(t.maxFontSize, b, 1.2), 0), r;
|
|
1968
1968
|
r = O === "top" ? C + 2 : O === "center" ? C + (M - n) / 2 : C + M - n - 2, e.textAlign = "left", e.textBaseline = "top";
|
|
1969
1969
|
let i = R.readingOrder === 2 || tt(Y), a = i && Qe(R.readingOrder, Y.map((e) => e.text).join("")), o = e;
|
|
1970
1970
|
for (let n of t) {
|
|
@@ -2001,7 +2001,7 @@ function qt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2001
2001
|
O === "top" ? (i = C + 2, e.textBaseline = "top") : O === "center" ? (i = C + (M - r) / 2, e.textBaseline = "top") : (i = C + M - r - 2, e.textBaseline = "top");
|
|
2002
2002
|
for (let r = 0; r < t.length; r++) e.fillText(t[r], q, i + r * n);
|
|
2003
2003
|
} else if (fe) {
|
|
2004
|
-
let t = Y.map((e) => jt(
|
|
2004
|
+
let t = Y.map((e) => jt(g, e)), n = Y.map((e) => e.font?.vertAlign), r = t.map((e, t) => n[t] === "superscript" || n[t] === "subscript" ? {
|
|
2005
2005
|
...e,
|
|
2006
2006
|
size: e.size * .65
|
|
2007
2007
|
} : e), i = Y.map((t, n) => (e.font = kt(r[n], b), e.measureText(t.text).width)), a = i.reduce((e, t) => e + t, 0), o;
|
|
@@ -2035,12 +2035,12 @@ function qt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2035
2035
|
l.direction = "ltr";
|
|
2036
2036
|
} catch {}
|
|
2037
2037
|
} else {
|
|
2038
|
-
let t =
|
|
2038
|
+
let t = g.vertAlign, n = $(F.size, b), r = 0;
|
|
2039
2039
|
t === "superscript" ? r = -Math.round(n * .35) : t === "subscript" && (r = Math.round(n * .1));
|
|
2040
2040
|
let i = t ? {
|
|
2041
|
-
...
|
|
2042
|
-
size:
|
|
2043
|
-
} :
|
|
2041
|
+
...g,
|
|
2042
|
+
size: g.size * .65
|
|
2043
|
+
} : g;
|
|
2044
2044
|
t && (e.font = kt(i, b));
|
|
2045
2045
|
let a = null, o = () => a ??= e.measureText(J), s = () => {
|
|
2046
2046
|
let e = Math.min(o().width, ae - L - 3);
|
|
@@ -2049,11 +2049,11 @@ function qt(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
|
|
|
2049
2049
|
width: e
|
|
2050
2050
|
};
|
|
2051
2051
|
}, c = $(i.size, b);
|
|
2052
|
-
if (
|
|
2053
|
-
let { x: t, width: n } = s(), i = (O === "top" ? C + 2 + c + 1 : O === "center" ? C + M / 2 + Math.round(c * .55) : C + M - 2 + 1) + r, a = y ? "#0563C1" : w ? Q(w) : "#000000", o =
|
|
2052
|
+
if (g.underline || y) {
|
|
2053
|
+
let { x: t, width: n } = s(), i = (O === "top" ? C + 2 + c + 1 : O === "center" ? C + M / 2 + Math.round(c * .55) : C + M - 2 + 1) + r, a = y ? "#0563C1" : w ? Q(w) : "#000000", o = g.underlineStyle === "double" || g.underlineStyle === "doubleAccounting";
|
|
2054
2054
|
At(e, t, t + n, i, a, o);
|
|
2055
2055
|
}
|
|
2056
|
-
if (
|
|
2056
|
+
if (g.strike) {
|
|
2057
2057
|
let { x: t, width: n } = s(), i = (O === "top" ? C + 2 + Math.round(c * .5) : O === "center" ? C + M / 2 : C + M - 2 - Math.round(c * .35)) + r;
|
|
2058
2058
|
e.save(), e.strokeStyle = w ? Q(w) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(t, i), e.lineTo(t + n, i), e.stroke(), e.restore();
|
|
2059
2059
|
}
|
|
@@ -2220,97 +2220,97 @@ function $t(e, t, n) {
|
|
|
2220
2220
|
for (let i = 1; i < t; i++) r += Math.round(Z(e.rowHeights[i] ?? e.defaultRowHeight) * n);
|
|
2221
2221
|
return r;
|
|
2222
2222
|
}
|
|
2223
|
-
function en(e, t,
|
|
2223
|
+
function en(e, t, r, i, a, o, s, c, l, u, d, f) {
|
|
2224
2224
|
if (d <= 0 || f <= 0) return;
|
|
2225
|
-
let p = Qt(t,
|
|
2226
|
-
e.save(), e.beginPath(), e.rect(
|
|
2227
|
-
for (let
|
|
2228
|
-
let
|
|
2229
|
-
if (!
|
|
2230
|
-
let h =
|
|
2231
|
-
if (
|
|
2225
|
+
let p = Qt(t, o, i), m = $t(t, a, i);
|
|
2226
|
+
e.save(), e.beginPath(), e.rect(l, u, d, f), e.clip();
|
|
2227
|
+
for (let a of t.images) {
|
|
2228
|
+
let o = r.get(a.imagePath);
|
|
2229
|
+
if (!o) continue;
|
|
2230
|
+
let h = a.fromCol + 1, g = a.fromRow + 1, _ = Qt(t, h, i) + a.fromColOff * i / n, v = $t(t, g, i) + a.fromRowOff * i / n, y, b;
|
|
2231
|
+
if (a.editAs === "oneCell" && a.nativeExtCx > 0 && a.nativeExtCy > 0) y = a.nativeExtCx * i / n, b = a.nativeExtCy * i / n;
|
|
2232
2232
|
else {
|
|
2233
|
-
let e =
|
|
2234
|
-
y =
|
|
2233
|
+
let e = a.toCol + 1, r = a.toRow + 1, o = Qt(t, e, i) + a.toColOff * i / n, s = $t(t, r, i) + a.toRowOff * i / n;
|
|
2234
|
+
y = o - _, b = s - v;
|
|
2235
2235
|
}
|
|
2236
2236
|
if (y <= 0 || b <= 0) continue;
|
|
2237
|
-
let x =
|
|
2238
|
-
x + y <
|
|
2237
|
+
let x = l + (_ - p) - s, S = u + (v - m) - c;
|
|
2238
|
+
x + y < l || x > l + d || S + b < u || S > u + f || e.drawImage(o, x, S, y, b);
|
|
2239
2239
|
}
|
|
2240
2240
|
e.restore();
|
|
2241
2241
|
}
|
|
2242
|
-
function tn(e, t,
|
|
2242
|
+
function tn(e, t, r, i, a, o, s, c, l, u, d, f) {
|
|
2243
2243
|
if (u <= 0 || d <= 0) return;
|
|
2244
2244
|
let p = t.shapeGroups;
|
|
2245
2245
|
if (!p || p.length === 0) return;
|
|
2246
|
-
let m = Qt(t,
|
|
2247
|
-
e.save(), e.beginPath(), e.rect(
|
|
2248
|
-
for (let
|
|
2249
|
-
let
|
|
2250
|
-
if (
|
|
2246
|
+
let m = Qt(t, a, r), h = $t(t, i, r);
|
|
2247
|
+
e.save(), e.beginPath(), e.rect(c, l, u, d), e.clip();
|
|
2248
|
+
for (let i of p) {
|
|
2249
|
+
let a = i.fromCol + 1, p = i.fromRow + 1, g = Qt(t, a, r) + i.fromColOff * r / n, _ = $t(t, p, r) + i.fromRowOff * r / n, v, y;
|
|
2250
|
+
if (i.editAs === "oneCell" && i.nativeExtCx > 0 && i.nativeExtCy > 0) v = i.nativeExtCx * r / n, y = i.nativeExtCy * r / n;
|
|
2251
2251
|
else {
|
|
2252
|
-
let e =
|
|
2253
|
-
v =
|
|
2252
|
+
let e = i.toCol + 1, a = i.toRow + 1, o = Qt(t, e, r) + i.toColOff * r / n, s = $t(t, a, r) + i.toRowOff * r / n;
|
|
2253
|
+
v = o - g, y = s - _;
|
|
2254
2254
|
}
|
|
2255
2255
|
if (v <= 0 || y <= 0) continue;
|
|
2256
|
-
let b =
|
|
2257
|
-
if (!(b + v <
|
|
2258
|
-
let
|
|
2259
|
-
a <= 0 || o <= 0 || nn(e, t,
|
|
2256
|
+
let b = c + (g - m) - o, x = l + (_ - h) - s;
|
|
2257
|
+
if (!(b + v < c || b > c + u) && !(x + y < l || x > l + d)) for (let t of i.shapes) {
|
|
2258
|
+
let n = b + t.x * v, i = x + t.y * y, a = t.w * v, o = t.h * y;
|
|
2259
|
+
a <= 0 || o <= 0 || nn(e, t, n, i, a, o, r, f);
|
|
2260
2260
|
}
|
|
2261
2261
|
}
|
|
2262
2262
|
e.restore();
|
|
2263
2263
|
}
|
|
2264
|
-
function nn(e, t,
|
|
2265
|
-
if (e.save(), t.rot === 0 ? e.translate(
|
|
2264
|
+
function nn(e, t, r, a, o, s, c, l) {
|
|
2265
|
+
if (e.save(), t.rot === 0 ? e.translate(r, a) : (e.translate(r + o / 2, a + s / 2), e.rotate(t.rot * Math.PI / 180), e.translate(-o / 2, -s / 2)), t.geom.type === "custom") for (let n of t.geom.paths) {
|
|
2266
2266
|
if (n.w <= 0 || n.h <= 0) continue;
|
|
2267
|
-
let r =
|
|
2267
|
+
let r = o / n.w, i = s / n.h;
|
|
2268
2268
|
e.beginPath();
|
|
2269
|
-
let
|
|
2269
|
+
let a = 0, c = 0, l = 0, u = 0;
|
|
2270
2270
|
for (let t of n.commands) switch (t.op) {
|
|
2271
2271
|
case "moveTo": {
|
|
2272
|
-
let n = t.x * r,
|
|
2273
|
-
e.moveTo(n,
|
|
2272
|
+
let n = t.x * r, o = t.y * i;
|
|
2273
|
+
e.moveTo(n, o), a = l = n, c = u = o;
|
|
2274
2274
|
break;
|
|
2275
2275
|
}
|
|
2276
2276
|
case "lineTo": {
|
|
2277
|
-
let n = t.x * r,
|
|
2278
|
-
e.lineTo(n,
|
|
2277
|
+
let n = t.x * r, o = t.y * i;
|
|
2278
|
+
e.lineTo(n, o), a = n, c = o;
|
|
2279
2279
|
break;
|
|
2280
2280
|
}
|
|
2281
2281
|
case "cubicBezTo": {
|
|
2282
|
-
let n = t.x3 * r,
|
|
2283
|
-
e.bezierCurveTo(t.x1 * r, t.y1 *
|
|
2282
|
+
let n = t.x3 * r, o = t.y3 * i;
|
|
2283
|
+
e.bezierCurveTo(t.x1 * r, t.y1 * i, t.x2 * r, t.y2 * i, n, o), a = n, c = o;
|
|
2284
2284
|
break;
|
|
2285
2285
|
}
|
|
2286
2286
|
case "quadBezTo": {
|
|
2287
|
-
let n = t.x2 * r,
|
|
2288
|
-
e.quadraticCurveTo(t.x1 * r, t.y1 *
|
|
2287
|
+
let n = t.x2 * r, o = t.y2 * i;
|
|
2288
|
+
e.quadraticCurveTo(t.x1 * r, t.y1 * i, n, o), a = n, c = o;
|
|
2289
2289
|
break;
|
|
2290
2290
|
}
|
|
2291
2291
|
case "arcTo": {
|
|
2292
|
-
let n = t.wr * r,
|
|
2293
|
-
if (n <= 0 ||
|
|
2294
|
-
let
|
|
2295
|
-
e.ellipse(u, d, n,
|
|
2292
|
+
let n = t.wr * r, o = t.hr * i;
|
|
2293
|
+
if (n <= 0 || o <= 0) break;
|
|
2294
|
+
let s = t.stAng / 6e4 * (Math.PI / 180), l = t.swAng / 6e4 * (Math.PI / 180), u = a - Math.cos(s) * n, d = c - Math.sin(s) * o, f = s + l;
|
|
2295
|
+
e.ellipse(u, d, n, o, 0, s, f, l < 0), a = u + Math.cos(f) * n, c = d + Math.sin(f) * o;
|
|
2296
2296
|
break;
|
|
2297
2297
|
}
|
|
2298
2298
|
case "close":
|
|
2299
|
-
e.closePath(),
|
|
2299
|
+
e.closePath(), a = l, c = u;
|
|
2300
2300
|
break;
|
|
2301
2301
|
}
|
|
2302
2302
|
pn(e, t);
|
|
2303
2303
|
}
|
|
2304
2304
|
else if (t.geom.type === "preset") {
|
|
2305
|
-
let
|
|
2306
|
-
e.strokeStyle = t.strokeColor, e.lineWidth = Math.max(.5, t.strokeWidth /
|
|
2305
|
+
let r = t.fillColor ?? null, a = t.strokeColor && t.strokeWidth > 0 ? () => {
|
|
2306
|
+
e.strokeStyle = t.strokeColor, e.lineWidth = Math.max(.5, t.strokeWidth / n), e.stroke();
|
|
2307
2307
|
} : null;
|
|
2308
|
-
|
|
2308
|
+
i(e, t.geom.name, 0, 0, o, s, t.geom.adj ?? [], r, a, () => {}) || (e.beginPath(), e.rect(0, 0, o, s), pn(e, t));
|
|
2309
2309
|
} else if (t.geom.type === "image") {
|
|
2310
|
-
let n =
|
|
2311
|
-
n && e.drawImage(n, 0, 0,
|
|
2310
|
+
let n = l?.get(t.geom.imagePath);
|
|
2311
|
+
n && e.drawImage(n, 0, 0, o, s);
|
|
2312
2312
|
}
|
|
2313
|
-
t.text && fn(e, t.text,
|
|
2313
|
+
t.text && fn(e, t.text, o, s, c), e.restore();
|
|
2314
2314
|
}
|
|
2315
2315
|
var rn = /* @__PURE__ */ new WeakMap();
|
|
2316
2316
|
function an(e, t) {
|
|
@@ -2349,7 +2349,7 @@ async function dn(e, t) {
|
|
|
2349
2349
|
if (n.length !== 0) {
|
|
2350
2350
|
await t.loadMathJax();
|
|
2351
2351
|
for (let e of n) if (!rn.has(e.nodes)) try {
|
|
2352
|
-
let n = await t.mathMLToSvg(
|
|
2352
|
+
let n = await t.mathMLToSvg(y(e.nodes, e.display)), r = await on(cn(E(n.svg, "#000000"), n.widthEm, n.ascentEm + n.descentEm));
|
|
2353
2353
|
rn.set(e.nodes, {
|
|
2354
2354
|
img: r,
|
|
2355
2355
|
widthEm: n.widthEm,
|
|
@@ -2360,28 +2360,28 @@ async function dn(e, t) {
|
|
|
2360
2360
|
} catch {}
|
|
2361
2361
|
}
|
|
2362
2362
|
}
|
|
2363
|
-
function fn(e, t, r, i
|
|
2364
|
-
if (
|
|
2365
|
-
let
|
|
2366
|
-
if (
|
|
2363
|
+
function fn(e, t, n, r, i) {
|
|
2364
|
+
if (n <= 0 || r <= 0 || t.paragraphs.length === 0) return;
|
|
2365
|
+
let a = 7 * i, o = 4 * i, s = Math.max(0, n - a * 2), c = Math.max(0, r - o * 2);
|
|
2366
|
+
if (s <= 0 || c <= 0) return;
|
|
2367
2367
|
let u = (e) => {
|
|
2368
|
-
let t = (e.size > 0 ? e.size : dt) *
|
|
2368
|
+
let t = (e.size > 0 ? e.size : dt) * l * i, n = ut(e.fontFace);
|
|
2369
2369
|
return {
|
|
2370
|
-
font: `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${t}px ${
|
|
2370
|
+
font: `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${t}px ${n}`,
|
|
2371
2371
|
px: t
|
|
2372
2372
|
};
|
|
2373
2373
|
}, d = t.wrap !== "none", f = [];
|
|
2374
|
-
for (let
|
|
2375
|
-
let t =
|
|
2374
|
+
for (let n of t.paragraphs) {
|
|
2375
|
+
let t = n.align || "l", r = [], a = 0, o = 0, c = 0, p = !1, m = () => {
|
|
2376
2376
|
f.push({
|
|
2377
|
-
segs:
|
|
2377
|
+
segs: r,
|
|
2378
2378
|
align: t,
|
|
2379
|
-
height:
|
|
2380
|
-
ascent:
|
|
2379
|
+
height: o,
|
|
2380
|
+
ascent: c,
|
|
2381
2381
|
hasMath: p
|
|
2382
|
-
}),
|
|
2382
|
+
}), r = [], a = 0, o = 0, c = 0, p = !1;
|
|
2383
2383
|
}, h = 0;
|
|
2384
|
-
for (let g of
|
|
2384
|
+
for (let g of n.runs) {
|
|
2385
2385
|
if (g.type === "break") {
|
|
2386
2386
|
m();
|
|
2387
2387
|
continue;
|
|
@@ -2389,7 +2389,7 @@ function fn(e, t, r, i, a) {
|
|
|
2389
2389
|
if (g.type === "math") {
|
|
2390
2390
|
let e = rn.get(g.nodes);
|
|
2391
2391
|
if (!e) continue;
|
|
2392
|
-
let
|
|
2392
|
+
let n = (g.fontSize ?? (h || dt)) * l * i, u = e.widthEm * n, _ = e.ascentEm * n, v = e.descentEm * n, y = g.color ?? "#000000";
|
|
2393
2393
|
if (g.display) {
|
|
2394
2394
|
m(), f.push({
|
|
2395
2395
|
segs: [{
|
|
@@ -2407,72 +2407,72 @@ function fn(e, t, r, i, a) {
|
|
|
2407
2407
|
});
|
|
2408
2408
|
continue;
|
|
2409
2409
|
}
|
|
2410
|
-
d &&
|
|
2410
|
+
d && a + u > s && r.length > 0 && m(), r.push({
|
|
2411
2411
|
kind: "math",
|
|
2412
2412
|
render: e,
|
|
2413
2413
|
color: y,
|
|
2414
2414
|
w: u,
|
|
2415
2415
|
ascent: _,
|
|
2416
2416
|
descent: v
|
|
2417
|
-
}),
|
|
2417
|
+
}), a += u, o = Math.max(o, _ + v), c = Math.max(c, _), p = !0;
|
|
2418
2418
|
continue;
|
|
2419
2419
|
}
|
|
2420
2420
|
h = g.size > 0 ? g.size : dt;
|
|
2421
|
-
let { font:
|
|
2422
|
-
|
|
2421
|
+
let { font: n, px: _ } = u(g), v = g.color ?? "#000000";
|
|
2422
|
+
o = Math.max(o, _ * 1.2), c = Math.max(c, _ * .85), e.font = n;
|
|
2423
2423
|
let y = g.text.split("\n");
|
|
2424
2424
|
for (let t = 0; t < y.length; t++) {
|
|
2425
2425
|
t > 0 && m();
|
|
2426
|
-
let
|
|
2427
|
-
if (!
|
|
2426
|
+
let i = y[t];
|
|
2427
|
+
if (!i) continue;
|
|
2428
2428
|
if (!d) {
|
|
2429
|
-
let t = e.measureText(
|
|
2430
|
-
|
|
2429
|
+
let t = e.measureText(i).width;
|
|
2430
|
+
r.push({
|
|
2431
2431
|
kind: "text",
|
|
2432
|
-
text:
|
|
2433
|
-
font:
|
|
2432
|
+
text: i,
|
|
2433
|
+
font: n,
|
|
2434
2434
|
color: v,
|
|
2435
2435
|
w: t
|
|
2436
|
-
}),
|
|
2436
|
+
}), a += t;
|
|
2437
2437
|
continue;
|
|
2438
2438
|
}
|
|
2439
|
-
let
|
|
2440
|
-
for (let t of
|
|
2441
|
-
let
|
|
2442
|
-
if (
|
|
2443
|
-
if (
|
|
2444
|
-
let t = e.measureText(
|
|
2445
|
-
|
|
2439
|
+
let l = "";
|
|
2440
|
+
for (let t of i) {
|
|
2441
|
+
let i = l + t, u = e.measureText(i).width;
|
|
2442
|
+
if (a + u > s && (l.length > 0 || r.length > 0)) {
|
|
2443
|
+
if (l) {
|
|
2444
|
+
let t = e.measureText(l).width;
|
|
2445
|
+
r.push({
|
|
2446
2446
|
kind: "text",
|
|
2447
|
-
text:
|
|
2448
|
-
font:
|
|
2447
|
+
text: l,
|
|
2448
|
+
font: n,
|
|
2449
2449
|
color: v,
|
|
2450
2450
|
w: t
|
|
2451
|
-
}),
|
|
2451
|
+
}), a += t;
|
|
2452
2452
|
}
|
|
2453
|
-
m(),
|
|
2454
|
-
} else
|
|
2453
|
+
m(), l = t, e.font = n, o = Math.max(o, _ * 1.2), c = Math.max(c, _ * .85);
|
|
2454
|
+
} else l = i;
|
|
2455
2455
|
}
|
|
2456
|
-
if (
|
|
2457
|
-
let t = e.measureText(
|
|
2458
|
-
|
|
2456
|
+
if (l) {
|
|
2457
|
+
let t = e.measureText(l).width;
|
|
2458
|
+
r.push({
|
|
2459
2459
|
kind: "text",
|
|
2460
|
-
text:
|
|
2461
|
-
font:
|
|
2460
|
+
text: l,
|
|
2461
|
+
font: n,
|
|
2462
2462
|
color: v,
|
|
2463
2463
|
w: t
|
|
2464
|
-
}),
|
|
2464
|
+
}), a += t;
|
|
2465
2465
|
}
|
|
2466
2466
|
}
|
|
2467
2467
|
}
|
|
2468
2468
|
m();
|
|
2469
2469
|
}
|
|
2470
|
-
let p = f.reduce((e, t) => e + t.height, 0), m =
|
|
2471
|
-
t.anchor === "ctr" ? m =
|
|
2470
|
+
let p = f.reduce((e, t) => e + t.height, 0), m = o;
|
|
2471
|
+
t.anchor === "ctr" ? m = o + (c - p) / 2 : t.anchor === "b" && (m = o + Math.max(0, c - p));
|
|
2472
2472
|
let h = m;
|
|
2473
2473
|
for (let t of f) {
|
|
2474
|
-
let n = t.segs.reduce((e, t) => e + t.w, 0), r =
|
|
2475
|
-
if (t.align === "ctr" ? r =
|
|
2474
|
+
let n = t.segs.reduce((e, t) => e + t.w, 0), r = a;
|
|
2475
|
+
if (t.align === "ctr" ? r = a + Math.max(0, (s - n) / 2) : t.align === "r" && (r = a + Math.max(0, s - n)), t.hasMath) {
|
|
2476
2476
|
e.textBaseline = "alphabetic";
|
|
2477
2477
|
let n = h + t.ascent;
|
|
2478
2478
|
for (let i of t.segs) {
|
|
@@ -2492,7 +2492,7 @@ function fn(e, t, r, i, a) {
|
|
|
2492
2492
|
}
|
|
2493
2493
|
}
|
|
2494
2494
|
function pn(e, t) {
|
|
2495
|
-
t.fillColor && (e.fillStyle = t.fillColor, e.fill()), t.strokeColor && t.strokeWidth > 0 && (e.strokeStyle = t.strokeColor, e.lineWidth = Math.max(.5, t.strokeWidth /
|
|
2495
|
+
t.fillColor && (e.fillStyle = t.fillColor, e.fill()), t.strokeColor && t.strokeWidth > 0 && (e.strokeStyle = t.strokeColor, e.lineWidth = Math.max(.5, t.strokeWidth / n), e.stroke());
|
|
2496
2496
|
}
|
|
2497
2497
|
function mn(e, t, n, r, i, a, o) {
|
|
2498
2498
|
if (r === n && i === t) return e;
|
|
@@ -2757,35 +2757,35 @@ function Sn(e) {
|
|
|
2757
2757
|
chartBorderWidthEmu: e.chartBorderWidthEmu ?? null
|
|
2758
2758
|
};
|
|
2759
2759
|
}
|
|
2760
|
-
function Cn(e,
|
|
2761
|
-
if (
|
|
2762
|
-
let
|
|
2763
|
-
for (let
|
|
2764
|
-
let
|
|
2765
|
-
if (
|
|
2766
|
-
let
|
|
2767
|
-
if (
|
|
2768
|
-
e.save(), e.beginPath(), e.rect(
|
|
2769
|
-
let D =
|
|
2770
|
-
|
|
2771
|
-
x:
|
|
2760
|
+
function Cn(e, r, i, a, o, s, c, u, d, f, p) {
|
|
2761
|
+
if (f <= 0 || p <= 0) return;
|
|
2762
|
+
let m = Qt(r, o, i), h = $t(r, a, i);
|
|
2763
|
+
for (let a of r.charts) {
|
|
2764
|
+
let o = a.fromCol + 1, g = a.fromRow + 1, _ = a.toCol + 1, v = a.toRow + 1, y = Qt(r, o, i) + a.fromColOff * i / n, b = $t(r, g, i) + a.fromRowOff * i / n, x = Qt(r, _, i) + a.toColOff * i / n, S = $t(r, v, i) + a.toRowOff * i / n, C = x - y, w = S - b;
|
|
2765
|
+
if (C <= 0 || w <= 0) continue;
|
|
2766
|
+
let T = u + (y - m) - s, E = d + (b - h) - c;
|
|
2767
|
+
if (T + C < u || T > u + f || E + w < d || E > d + p) continue;
|
|
2768
|
+
e.save(), e.beginPath(), e.rect(u, d, f, p), e.clip();
|
|
2769
|
+
let D = l * i;
|
|
2770
|
+
t(e, Sn(a.chart), {
|
|
2771
|
+
x: T,
|
|
2772
2772
|
y: E,
|
|
2773
|
-
w:
|
|
2774
|
-
h:
|
|
2773
|
+
w: C,
|
|
2774
|
+
h: w
|
|
2775
2775
|
}, D), e.restore();
|
|
2776
2776
|
}
|
|
2777
2777
|
}
|
|
2778
2778
|
var wn = "600 12px \"Meiryo UI\", \"Segoe UI\", sans-serif", Tn = "11px \"Meiryo UI\", \"Segoe UI\", sans-serif", En = "#FFFFFF", Dn = "#BFBFBF", On = "#F2F2F2", kn = "#404040", An = "#FFFFFF", jn = "#000000", Mn = "#A5A5A5", Nn = "#E7E6E6", Pn = "#A6A6A6", Fn = "#C6C6C6";
|
|
2779
|
-
function In(e, t,
|
|
2779
|
+
function In(e, t, r, i, a, o, s, c, l, u, d) {
|
|
2780
2780
|
if (u <= 0 || d <= 0) return;
|
|
2781
2781
|
let f = t.slicers;
|
|
2782
2782
|
if (!f) return;
|
|
2783
|
-
let p = Qt(t,
|
|
2784
|
-
for (let
|
|
2785
|
-
let
|
|
2783
|
+
let p = Qt(t, a, r), m = $t(t, i, r);
|
|
2784
|
+
for (let i of f) {
|
|
2785
|
+
let a = i.fromCol + 1, f = i.fromRow + 1, h = i.toCol + 1, g = i.toRow + 1, _ = Qt(t, a, r) + i.fromColOff * r / n, v = $t(t, f, r) + i.fromRowOff * r / n, y = Qt(t, h, r) + i.toColOff * r / n, b = $t(t, g, r) + i.toRowOff * r / n, x = y - _, S = b - v;
|
|
2786
2786
|
if (x <= 0 || S <= 0) continue;
|
|
2787
|
-
let C =
|
|
2788
|
-
C + x <
|
|
2787
|
+
let C = c + (_ - p) - o, w = l + (v - m) - s;
|
|
2788
|
+
C + x < c || C > c + u || w + S < l || w > l + d || (e.save(), e.beginPath(), e.rect(c, l, u, d), e.clip(), Ln(e, i.caption, i.items, C, w, x, S, r), e.restore());
|
|
2789
2789
|
}
|
|
2790
2790
|
}
|
|
2791
2791
|
function Ln(e, t, n, r, i, a, o, s) {
|
|
@@ -2822,11 +2822,11 @@ function zn(e, t, n, r, i) {
|
|
|
2822
2822
|
async function Bn(e, t, n, r) {
|
|
2823
2823
|
let i = async (e, t) => createImageBitmap(await r(e, t)), a = t === "image/svg+xml";
|
|
2824
2824
|
if (n != null) try {
|
|
2825
|
-
return await
|
|
2825
|
+
return await s(n, r);
|
|
2826
2826
|
} catch {
|
|
2827
|
-
return a ?
|
|
2827
|
+
return a ? s(e, r) : i(e, t);
|
|
2828
2828
|
}
|
|
2829
|
-
return a ?
|
|
2829
|
+
return a ? s(e, r) : i(e, t);
|
|
2830
2830
|
}
|
|
2831
2831
|
async function Vn(e, t, n) {
|
|
2832
2832
|
if (!n) return;
|
|
@@ -2850,8 +2850,8 @@ async function Vn(e, t, n) {
|
|
|
2850
2850
|
async function Hn(e, t, n, r = {}) {
|
|
2851
2851
|
let { ws: i, styles: a, imageCache: o } = e;
|
|
2852
2852
|
await Vn(i, o, r.fetchImage), e.math && un(i) && await dn(i, e.math);
|
|
2853
|
-
let s = r.dpr ?? h(), c =
|
|
2854
|
-
t.width = Math.round(u * s), t.height = Math.round(d * s),
|
|
2853
|
+
let s = r.dpr ?? h(), c = x(t) ? t.clientWidth || 800 : t.width, l = x(t) ? t.clientHeight || 600 : t.height, u = r.width ?? c, d = r.height ?? l;
|
|
2854
|
+
t.width = Math.round(u * s), t.height = Math.round(d * s), x(t) && (t.style.width = `${u}px`, t.style.height = `${d}px`);
|
|
2855
2855
|
let f = t.getContext("2d");
|
|
2856
2856
|
f.scale(s, s), Xt(f, i, a, n, {
|
|
2857
2857
|
...r,
|
|
@@ -2898,7 +2898,7 @@ var Un = "https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;70
|
|
|
2898
2898
|
url: Wn,
|
|
2899
2899
|
loadFamily: "Noto Sans Arabic"
|
|
2900
2900
|
},
|
|
2901
|
-
...
|
|
2901
|
+
...d
|
|
2902
2902
|
};
|
|
2903
2903
|
function* Kn(e) {
|
|
2904
2904
|
for (let t of e?.sharedStrings ?? []) if (t.runs && t.runs.length > 0) for (let e of t.runs) yield e.text;
|
|
@@ -2906,8 +2906,8 @@ function* Kn(e) {
|
|
|
2906
2906
|
}
|
|
2907
2907
|
function qn(e) {
|
|
2908
2908
|
let t = /* @__PURE__ */ new Set(), n = null;
|
|
2909
|
-
for (let r of e?.styles?.fonts ?? []) r.name && (t.add(r.name), n ??=
|
|
2910
|
-
for (let r of
|
|
2909
|
+
for (let r of e?.styles?.fonts ?? []) r.name && (t.add(r.name), n ??= f(r.name));
|
|
2910
|
+
for (let r of c(Kn(e), n)) t.add(r);
|
|
2911
2911
|
return t;
|
|
2912
2912
|
}
|
|
2913
2913
|
function Jn(e) {
|
|
@@ -2979,7 +2979,7 @@ function Xn(e) {
|
|
|
2979
2979
|
}
|
|
2980
2980
|
//#endregion
|
|
2981
2981
|
//#region packages/xlsx/src/workbook.ts
|
|
2982
|
-
var Zn = class
|
|
2982
|
+
var Zn = class t {
|
|
2983
2983
|
worker;
|
|
2984
2984
|
bridge;
|
|
2985
2985
|
parsedWorkbook = null;
|
|
@@ -2992,7 +2992,7 @@ var Zn = class e {
|
|
|
2992
2992
|
math;
|
|
2993
2993
|
_mode = "main";
|
|
2994
2994
|
constructor(e, t) {
|
|
2995
|
-
this.worker = e, this._mode = t, this.bridge = new
|
|
2995
|
+
this.worker = e, this._mode = t, this.bridge = new p(this.worker, {
|
|
2996
2996
|
correlate: (e) => e.id,
|
|
2997
2997
|
toError: (e) => e.type === "error" ? e.message : void 0
|
|
2998
2998
|
});
|
|
@@ -3002,31 +3002,31 @@ var Zn = class e {
|
|
|
3002
3002
|
wasmUrl: n
|
|
3003
3003
|
});
|
|
3004
3004
|
}
|
|
3005
|
-
static async load(
|
|
3005
|
+
static async load(e, n = {}) {
|
|
3006
3006
|
let r = n.mode ?? "main";
|
|
3007
3007
|
if (r === "worker" && (typeof Worker > "u" || typeof OffscreenCanvas > "u")) throw Error("mode: 'worker' requires Worker and OffscreenCanvas support");
|
|
3008
|
-
let i = new
|
|
3009
|
-
return await i._load(
|
|
3010
|
-
}
|
|
3011
|
-
async _load(
|
|
3012
|
-
let
|
|
3013
|
-
if (typeof
|
|
3014
|
-
let
|
|
3015
|
-
if (!
|
|
3016
|
-
|
|
3017
|
-
} else
|
|
3018
|
-
this.rawData =
|
|
3008
|
+
let i = new t(r === "worker" ? (await import("./render-worker-host-4w5qj_dW.js")).createRenderWorker() : new k(), r);
|
|
3009
|
+
return await i._load(e, n), i;
|
|
3010
|
+
}
|
|
3011
|
+
async _load(t, n = {}) {
|
|
3012
|
+
let r;
|
|
3013
|
+
if (typeof t == "string") {
|
|
3014
|
+
let e = await fetch(t);
|
|
3015
|
+
if (!e.ok) throw Error(`Failed to fetch: ${e.status} ${e.statusText}`);
|
|
3016
|
+
r = await e.arrayBuffer();
|
|
3017
|
+
} else r = t;
|
|
3018
|
+
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" ? {
|
|
3019
3019
|
type: "parse",
|
|
3020
3020
|
id: e,
|
|
3021
|
-
data:
|
|
3021
|
+
data: r.slice(0),
|
|
3022
3022
|
maxZipEntryBytes: this.maxZipEntryBytes,
|
|
3023
|
-
useGoogleFonts: !!
|
|
3023
|
+
useGoogleFonts: !!n.useGoogleFonts
|
|
3024
3024
|
} : {
|
|
3025
3025
|
type: "parse",
|
|
3026
3026
|
id: e,
|
|
3027
|
-
data:
|
|
3027
|
+
data: r.slice(0),
|
|
3028
3028
|
maxZipEntryBytes: this.maxZipEntryBytes
|
|
3029
|
-
})).workbook, this._mode === "main" &&
|
|
3029
|
+
})).workbook, this._mode === "main" && n.useGoogleFonts && await e(qn(this.parsedWorkbook), Gn);
|
|
3030
3030
|
}
|
|
3031
3031
|
get sheetNames() {
|
|
3032
3032
|
return this.parsedWorkbook?.workbook.sheets.map((e) => e.name) ?? [];
|
|
@@ -3978,10 +3978,10 @@ var dr = class {
|
|
|
3978
3978
|
destroy() {
|
|
3979
3979
|
this.resizeObserver?.disconnect(), this.hideCommentPopup(), this.hideValidationPanel(), this.keydownHandler && document.removeEventListener("keydown", this.keydownHandler), this.wb?.destroy();
|
|
3980
3980
|
}
|
|
3981
|
-
}, fr = /* @__PURE__ */
|
|
3981
|
+
}, fr = /* @__PURE__ */ m({
|
|
3982
3982
|
XlsxViewer: () => dr,
|
|
3983
3983
|
XlsxWorkbook: () => Zn,
|
|
3984
|
-
autoResize: () =>
|
|
3984
|
+
autoResize: () => T
|
|
3985
3985
|
});
|
|
3986
3986
|
//#endregion
|
|
3987
3987
|
export { dr as n, Zn as r, fr as t };
|