@silurus/ooxml 0.72.2 → 0.73.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.
@@ -1,9 +1,9 @@
1
- import { $ as e, At as t, B as n, Bt as r, C as i, Dt as a, E as o, Et as s, Ft as c, G as l, H as u, Ht as d, I as f, It as p, J as m, Jt as h, K as g, L as _, Lt as v, M as y, Mt as b, N as x, Nt as S, O as C, Ot as w, P as T, Pt as E, S as D, T as O, Tt as k, U as A, Ut as j, V as M, W as N, Xt as P, Yt as F, _ as ee, _t as I, b as L, bt as R, ct as z, d as B, f as V, gt as H, h as U, i as te, it as W, j as ne, jt as G, kt as re, l as ie, lt as ae, m as oe, n as se, nt as ce, o as le, p as ue, pt as K, q as de, qt as fe, r as q, t as pe, tt as me, v as he, w as J, wt as ge, x as _e, y as ve, z as ye, zt as be } from "./find-cursor-DBifiZop.js";
2
- import { a as xe, i as Se, n as Ce, r as we, t as Te } from "./visible-index-DSN5XPnm.js";
3
- import { t as Ee } from "./mathjax-Dk_JzbFj.js";
4
- import { t as De } from "./segments--0hIQLXB.js";
1
+ import { t as e } from "./chunk-DmhlhrBa.js";
2
+ import { At as t, B as n, Bt as r, C as i, D as a, Dt as o, E as s, Et as c, F as l, Ft as u, G as d, H as f, Ht as p, It as m, J as h, Jt as g, K as _, L as v, Lt as y, M as b, Mt as x, N as S, Nt as C, Ot as w, P as T, Pt as E, R as D, Rt as O, S as ee, T as k, Tt as A, U as j, Ut as te, V as M, W as N, Y as P, Yt as F, _ as I, _t as L, at as R, b as z, d as B, et as V, f as H, h as U, i as ne, jt as W, k as re, kt as ie, l as ae, lt as oe, m as se, mt as ce, n as le, nt as ue, o as G, p as de, q as fe, qt as K, r as pe, rt as me, t as he, ut as q, v as ge, vt as _e, w as ve, x as ye, xt as J, zt as be } from "./find-cursor-CaGrVs7z.js";
3
+ import { a as xe, i as Se, n as Ce, r as we, t as Te } from "./visible-index-CyuaF_ZP.js";
4
+ import { t as Ee } from "./mathjax-BPjQ2C_j.js";
5
5
  //#region packages/core/src/sparkline/renderer.ts
6
- function Oe(e, t, n) {
6
+ function De(e, t, n) {
7
7
  let { values: r } = n;
8
8
  if (r.length === 0 || t.w <= 0 || t.h <= 0) return;
9
9
  let i = n.colorSeries ?? "#5B9BD5", a = Math.min(2, t.w * .08), o = Math.max(2, t.h * .2), s = t.x + a, c = t.y + o, l = Math.max(1, t.w - a * 2), u = Math.max(1, t.h - o * 2), d = r.filter((e) => typeof e == "number");
@@ -12,11 +12,11 @@ function Oe(e, t, n) {
12
12
  m === h && (h = m + 1, --m);
13
13
  let g = h - m, _ = (e) => c + u - (e - m) / g * u;
14
14
  if (n.kind === "stem") {
15
- je(e, n, s, c, l, u);
15
+ Ae(e, n, s, c, l, u);
16
16
  return;
17
17
  }
18
18
  if (n.kind === "column") {
19
- Ae(e, n, r, s, c, l, u, m, h);
19
+ ke(e, n, r, s, c, l, u, m, h);
20
20
  return;
21
21
  }
22
22
  if (n.displayXAxis && m < 0 && h > 0) {
@@ -25,30 +25,30 @@ function Oe(e, t, n) {
25
25
  e.moveTo(s, t), e.lineTo(s + l, t), e.stroke(), e.restore();
26
26
  }
27
27
  let v = r.length, y = (e) => v === 1 ? s + l / 2 : s + e / (v - 1) * l;
28
- e.save(), e.strokeStyle = i, e.lineCap = "round", e.lineJoin = "round", e.lineWidth = (n.lineWeight ?? .75) * G, e.beginPath();
29
- let b = !1, x = n.displayEmptyCellsAs ?? "gap";
28
+ e.save(), e.strokeStyle = i, e.lineCap = "round", e.lineJoin = "round", e.lineWidth = (n.lineWeight ?? .75) * x, e.beginPath();
29
+ let b = !1, S = n.displayEmptyCellsAs ?? "gap";
30
30
  for (let t = 0; t < v; t++) {
31
31
  let n = r[t];
32
32
  if (n == null) {
33
- if (x === "zero") {
33
+ if (S === "zero") {
34
34
  let n = y(t), r = _(0);
35
35
  b ? e.lineTo(n, r) : (e.moveTo(n, r), b = !0);
36
- } else x === "gap" && (b = !1);
36
+ } else S === "gap" && (b = !1);
37
37
  continue;
38
38
  }
39
39
  let i = y(t), a = _(n);
40
40
  b ? e.lineTo(i, a) : (e.moveTo(i, a), b = !0);
41
41
  }
42
42
  e.stroke(), e.restore();
43
- let S = Math.max(1, Math.min(2.5, u * .12)), C = ke(r, n);
43
+ let C = Math.max(1, Math.min(2.5, u * .12)), w = Oe(r, n);
44
44
  for (let t = 0; t < v; t++) {
45
45
  let a = r[t];
46
46
  if (a == null) continue;
47
- let o = C[t];
48
- (n.markers || o != null) && (e.save(), e.fillStyle = o ?? n.colorMarkers ?? i, e.beginPath(), e.arc(y(t), _(a), S, 0, Math.PI * 2), e.fill(), e.restore());
47
+ let o = w[t];
48
+ (n.markers || o != null) && (e.save(), e.fillStyle = o ?? n.colorMarkers ?? i, e.beginPath(), e.arc(y(t), _(a), C, 0, Math.PI * 2), e.fill(), e.restore());
49
49
  }
50
50
  }
51
- function ke(e, t) {
51
+ function Oe(e, t) {
52
52
  let n = e.map(() => null), r = e.map((e) => typeof e == "number" ? e : null), i = r.findIndex((e) => e != null), a = -1;
53
53
  for (let e = r.length - 1; e >= 0; e--) if (r[e] != null) {
54
54
  a = e;
@@ -63,10 +63,10 @@ function ke(e, t) {
63
63
  if (t.low && t.colorLow && !Number.isNaN(c)) for (let e = 0; e < r.length; e++) r[e] === c && (n[e] = t.colorLow);
64
64
  return n;
65
65
  }
66
- function Ae(e, t, n, r, i, a, o, s, c) {
66
+ function ke(e, t, n, r, i, a, o, s, c) {
67
67
  let l = n.length;
68
68
  if (l === 0) return;
69
- let u = s < 0 && c > 0 ? 0 : s, d = c - s, f = (e) => i + o - (e - s) / d * o, p = f(u), m = a / l, h = Math.min(1.5, m * .15), g = ke(n, t);
69
+ let u = s < 0 && c > 0 ? 0 : s, d = c - s, f = (e) => i + o - (e - s) / d * o, p = f(u), m = a / l, h = Math.min(1.5, m * .15), g = Oe(n, t);
70
70
  for (let i = 0; i < l; i++) {
71
71
  let a = n[i];
72
72
  if (a == null) continue;
@@ -74,10 +74,10 @@ function Ae(e, t, n, r, i, a, o, s, c) {
74
74
  e.save(), e.fillStyle = o, e.fillRect(c, Math.min(p, s), l, Math.abs(p - s)), e.restore();
75
75
  }
76
76
  }
77
- function je(e, t, n, r, i, a) {
77
+ function Ae(e, t, n, r, i, a) {
78
78
  let o = t.values.length;
79
79
  if (o === 0) return;
80
- let s = r + a / 2, c = a / 2, l = i / o, u = Math.min(1.5, l * .15), d = ke(t.values, t);
80
+ let s = r + a / 2, c = a / 2, l = i / o, u = Math.min(1.5, l * .15), d = Oe(t.values, t);
81
81
  for (let r = 0; r < o; r++) {
82
82
  let i = t.values[r];
83
83
  if (i == null || i === 0) continue;
@@ -86,6 +86,11 @@ function je(e, t, n, r, i, a) {
86
86
  }
87
87
  }
88
88
  //#endregion
89
+ //#region packages/core/src/text/bidi/segments.ts
90
+ function je(e, t) {
91
+ return e === !0 ? "rtl" : e === !1 ? "ltr" : f().computeLevels(t, "auto").paragraphLevel === 1 ? "rtl" : "ltr";
92
+ }
93
+ //#endregion
89
94
  //#region packages/xlsx/src/worker.ts?worker&inline
90
95
  var Me = "var e=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,n.unregister(this),e}free(){let e=this.__destroy_into_raw();y.__wbg_xlsxarchive_free(e,0)}extract_image(e){let t=f(e,y.__wbindgen_malloc,y.__wbindgen_realloc),n=v,r=y.xlsxarchive_extract_image(this.__wbg_ptr,t,n);if(r[3])throw p(r[2]);var a=i(r[0],r[1]).slice();return y.__wbindgen_free(r[0],r[1]*1,1),a}constructor(e,t){let r=d(e,y.__wbindgen_malloc),i=v,a=y.xlsxarchive_new(r,i,!u(t),u(t)?BigInt(0):t);if(a[2])throw p(a[1]);return this.__wbg_ptr=a[0]>>>0,n.register(this,this.__wbg_ptr,this),this}parse(){let e=y.xlsxarchive_parse(this.__wbg_ptr);if(e[3])throw p(e[2]);var t=i(e[0],e[1]).slice();return y.__wbindgen_free(e[0],e[1]*1,1),t}parse_sheet(e,t){let n=f(t,y.__wbindgen_malloc,y.__wbindgen_realloc),r=v,a=y.xlsxarchive_parse_sheet(this.__wbg_ptr,e,n,r);if(a[3])throw p(a[2]);var o=i(a[0],a[1]).slice();return y.__wbindgen_free(a[0],a[1]*1,1),o}to_markdown(){let e,t;try{let i=y.xlsxarchive_to_markdown(this.__wbg_ptr);var n=i[0],r=i[1];if(i[3])throw n=0,r=0,p(i[2]);return e=n,t=r,s(n,r)}finally{y.__wbindgen_free(e,t,1)}}};Symbol.dispose&&(e.prototype[Symbol.dispose]=e.prototype.free);function t(){return{__proto__:null,\"./xlsx_parser_bg.js\":{__proto__:null,__wbg___wbindgen_debug_string_ab4b34d23d6778bd:function(e,t){let n=f(r(t),y.__wbindgen_malloc,y.__wbindgen_realloc),i=v;o().setInt32(e+4,i,!0),o().setInt32(e+0,n,!0)},__wbg___wbindgen_string_get_7ed5322991caaec5:function(e,t){let n=t,r=typeof n==`string`?n:void 0;var i=u(r)?0:f(r,y.__wbindgen_malloc,y.__wbindgen_realloc),a=v;o().setInt32(e+4,a,!0),o().setInt32(e+0,i,!0)},__wbg___wbindgen_throw_6b64449b9b9ed33c:function(e,t){throw Error(s(e,t))},__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)}}}}const n=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>y.__wbg_xlsxarchive_free(e>>>0,1));function r(e){let t=typeof e;if(t==`number`||t==`boolean`||e==null)return`${e}`;if(t==`string`)return`\"${e}\"`;if(t==`symbol`){let t=e.description;return t==null?`Symbol`:`Symbol(${t})`}if(t==`function`){let t=e.name;return typeof t==`string`&&t.length>0?`Function(${t})`:`Function`}if(Array.isArray(e)){let t=e.length,n=`[`;t>0&&(n+=r(e[0]));for(let i=1;i<t;i++)n+=`, `+r(e[i]);return n+=`]`,n}let n=/\\[object ([^\\]]+)\\]/.exec(toString.call(e)),i;if(n&&n.length>1)i=n[1];else return toString.call(e);if(i==`Object`)try{return`Object(`+JSON.stringify(e)+`)`}catch{return`Object`}return e instanceof Error?`${e.name}: ${e.message}\\n${e.stack}`:i}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 n=t();(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:r,module:i}=await x(await e,n);return b(r,i)}async function C(e){return y=void 0,a=null,c=null,S(e)}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}var T=class e extends Error{code=`parser-crashed`;constructor(t){super(t),this.name=`WasmTrapError`,Object.setPrototypeOf(this,e.prototype)}};function E(e){let t=globalThis.WebAssembly?.RuntimeError;if(t&&e instanceof t||e instanceof RangeError)return!0;if(e instanceof Error){let t=e.name;if(t===`RuntimeError`||t===`CompileError`||t===`LinkError`)return!0}return!1}const D=new class{_init;_opts;_wasmInput=null;_initPromise=null;_poisoned=!1;_archive=null;constructor(e,t={}){this._init=e,this._opts=t}setWasmUrl(e){this._wasmInput=e,this._poisoned=!1,this._initPromise=this._init(e)}get archive(){return this._archive}setArchive(e){this._freeArchive(),this._archive=e}disposeArchive(){this._freeArchive()}_freeArchive(){this._archive!=null&&this._opts.freeArchive&&this._opts.freeArchive(this._archive),this._archive=null}get poisoned(){return this._poisoned}async ensureReady(){if(this._poisoned){if(this._wasmInput===null)throw Error(`WasmParserHost: setWasmUrl was never called`);let e=(this._opts.reinit??this._init)(this._wasmInput);this._initPromise=e,await e,this._poisoned=!1;return}if(this._initPromise===null)throw Error(`WasmParserHost: setWasmUrl was never called`);await this._initPromise}run(e){try{return e()}catch(e){throw E(e)?(this._poison(),new T(`WASM parser trapped and was recycled: ${e instanceof Error?e.message:String(e)}`)):e}}poison(){this._poison()}_poison(){if(this._poisoned=!0,this._initPromise=null,this._archive!=null&&this._opts.freeArchive)try{this._opts.freeArchive(this._archive)}catch{}this._archive=null}}(S,{freeArchive:e=>e.free(),reinit:C});self.onmessage=async t=>{let n=t.data;if(n.type===`init`){D.setWasmUrl(w(n.wasmUrl)??n.wasmUrl);return}let r=n.id;try{if(await D.ensureReady(),n.type===`parse`){let t=typeof n.maxZipEntryBytes==`number`&&n.maxZipEntryBytes>0?BigInt(n.maxZipEntryBytes):void 0,i=new Uint8Array(n.data),a=D.run(()=>{let n=new e(i,t);return D.setArchive(n),n.parse()}).buffer,o={type:`parsed`,id:r,workbookJson:a};self.postMessage(o,[a]);return}let t=D.archive;if(n.type===`parseSheet`){if(!t)throw Error(`parseSheet before parse: no archive retained`);let e=D.run(()=>t.parse_sheet(n.sheetIndex,n.sheetName)).buffer,i={type:`parsedSheet`,id:r,worksheetJson:e};self.postMessage(i,[e]);return}if(n.type===`extractImage`){if(!t)throw Error(`No xlsx loaded`);let e=D.run(()=>t.extract_image(n.path).buffer),i={type:`imageExtracted`,id:r,bytes:e};self.postMessage(i,[e]);return}if(n.type===`toMarkdown`){if(!t)throw Error(`No xlsx loaded`);let e={type:`markdownRendered`,id:r,markdown:D.run(()=>t.to_markdown())};self.postMessage(e);return}}catch(e){let t={type:`error`,id:r,message:String(e)};self.postMessage(t)}};", Ne = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", Me], { type: "text/javascript;charset=utf-8" });
91
96
  function Pe(e) {
@@ -633,16 +638,16 @@ function pt(e) {
633
638
  }
634
639
  function mt() {
635
640
  let e = /* @__PURE__ */ new Date();
636
- return w(new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate())), !1);
641
+ return ie(new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate())), !1);
637
642
  }
638
643
  function ht() {
639
- return w(new Date(Date.now()), !1);
644
+ return ie(new Date(Date.now()), !1);
640
645
  }
641
646
  function gt(e, t, n) {
642
- return Math.floor(w(new Date(Date.UTC(e, t - 1, n)), !1));
647
+ return Math.floor(ie(new Date(Date.UTC(e, t - 1, n)), !1));
643
648
  }
644
649
  function _t(e) {
645
- return a(Math.floor(e), !1);
650
+ return w(Math.floor(e), !1);
646
651
  }
647
652
  function vt(e) {
648
653
  let t = _t(e);
@@ -813,69 +818,69 @@ function At(e) {
813
818
  };
814
819
  }
815
820
  function jt(e, t, n = !1) {
816
- let r = a(e, n), i = r.getUTCFullYear(), o = r.getUTCMonth() + 1, s = r.getUTCDate(), c = r.getUTCDay(), l = r.getUTCHours(), u = r.getUTCMinutes(), d = r.getUTCSeconds(), f = t.split(";")[0], p = /am\/pm|a\/p/i.test(f), m = null, h = () => m ??= At(r), g = "", _ = 0, v = !1;
817
- for (; _ < f.length;) {
818
- let t = f[_];
821
+ let r = w(e, n), i = r.getUTCFullYear(), a = r.getUTCMonth() + 1, o = r.getUTCDate(), s = r.getUTCDay(), c = r.getUTCHours(), l = r.getUTCMinutes(), u = r.getUTCSeconds(), d = t.split(";")[0], f = /am\/pm|a\/p/i.test(d), p = null, m = () => p ??= At(r), h = "", g = 0, _ = !1;
822
+ for (; g < d.length;) {
823
+ let t = d[g];
819
824
  if (t === "\"") {
820
- for (_++; _ < f.length && f[_] !== "\"";) g += f[_++];
821
- _ < f.length && _++, v = !1;
825
+ for (g++; g < d.length && d[g] !== "\"";) h += d[g++];
826
+ g < d.length && g++, _ = !1;
822
827
  } else if (t === "[") {
823
- let t = f.indexOf("]", _), n = t > _ ? f.slice(_ + 1, t) : "", r = n.match(/^([hms])\1*$/i);
828
+ let t = d.indexOf("]", g), n = t > g ? d.slice(g + 1, t) : "", r = n.match(/^([hms])\1*$/i);
824
829
  if (r) {
825
830
  let i = r[1].toLowerCase(), a = e < 0 ? "-" : "", o = Math.floor(Math.abs(e) * 86400), s;
826
831
  s = i === "h" ? Math.floor(o / 3600) : i === "m" ? Math.floor(o / 60) : o;
827
832
  let c = n.length >= 2 ? String(s).padStart(n.length, "0") : String(s);
828
- g += a + c, _ = t + 1, v = i === "h";
833
+ h += a + c, g = t + 1, _ = i === "h";
829
834
  } else {
830
- for (; _ < f.length && f[_] !== "]";) _++;
831
- _ < f.length && _++;
835
+ for (; g < d.length && d[g] !== "]";) g++;
836
+ g < d.length && g++;
832
837
  }
833
- } else if (t === "_") _ += 2;
834
- else if (t === "*") _ += 2;
835
- else if (t === "\\") _ + 1 < f.length && (g += f[_ + 1]), _ += 2, v = !1;
838
+ } else if (t === "_") g += 2;
839
+ else if (t === "*") g += 2;
840
+ else if (t === "\\") g + 1 < d.length && (h += d[g + 1]), g += 2, _ = !1;
836
841
  else if (t === "y" || t === "Y") {
837
842
  let e = 0;
838
- for (; _ < f.length && f[_].toLowerCase() === "y";) e++, _++;
839
- g += e <= 2 ? String(i).slice(-2) : String(i).padStart(4, "0"), v = !1;
843
+ for (; g < d.length && d[g].toLowerCase() === "y";) e++, g++;
844
+ h += e <= 2 ? String(i).slice(-2) : String(i).padStart(4, "0"), _ = !1;
840
845
  } else if (t === "m" || t === "M") {
841
846
  let e = 0;
842
- for (; _ < f.length && f[_].toLowerCase() === "m";) e++, _++;
843
- let t = f.slice(_).replace(/\[[^\]]*\]/g, "");
844
- v || /^:s/i.test(t) ? g += e >= 2 ? String(u).padStart(2, "0") : String(u) : e === 1 ? g += String(o) : e === 2 ? g += String(o).padStart(2, "0") : e === 3 ? g += Tt[o - 1].slice(0, 3) : e === 4 ? g += Tt[o - 1] : g += Tt[o - 1][0], v = !1;
847
+ for (; g < d.length && d[g].toLowerCase() === "m";) e++, g++;
848
+ let t = d.slice(g).replace(/\[[^\]]*\]/g, "");
849
+ _ || /^:s/i.test(t) ? h += e >= 2 ? String(l).padStart(2, "0") : String(l) : e === 1 ? h += String(a) : e === 2 ? h += String(a).padStart(2, "0") : e === 3 ? h += Tt[a - 1].slice(0, 3) : e === 4 ? h += Tt[a - 1] : h += Tt[a - 1][0], _ = !1;
845
850
  } else if (t === "d" || t === "D") {
846
851
  let e = 0;
847
- for (; _ < f.length && f[_].toLowerCase() === "d";) e++, _++;
848
- e === 1 ? g += String(s) : e === 2 ? g += String(s).padStart(2, "0") : e === 3 ? g += Et[c].slice(0, 3) : g += Et[c], v = !1;
852
+ for (; g < d.length && d[g].toLowerCase() === "d";) e++, g++;
853
+ e === 1 ? h += String(o) : e === 2 ? h += String(o).padStart(2, "0") : e === 3 ? h += Et[s].slice(0, 3) : h += Et[s], _ = !1;
849
854
  } else if (t === "h" || t === "H") {
850
855
  let e = 0;
851
- for (; _ < f.length && f[_].toLowerCase() === "h";) e++, _++;
852
- let t = p ? l % 12 || 12 : l;
853
- g += e >= 2 ? String(t).padStart(2, "0") : String(t), v = !0;
856
+ for (; g < d.length && d[g].toLowerCase() === "h";) e++, g++;
857
+ let t = f ? c % 12 || 12 : c;
858
+ h += e >= 2 ? String(t).padStart(2, "0") : String(t), _ = !0;
854
859
  } else if (t === "s" || t === "S") {
855
860
  let e = 0;
856
- for (; _ < f.length && f[_].toLowerCase() === "s";) e++, _++;
857
- g += e >= 2 ? String(d).padStart(2, "0") : String(d), v = !1;
861
+ for (; g < d.length && d[g].toLowerCase() === "s";) e++, g++;
862
+ h += e >= 2 ? String(u).padStart(2, "0") : String(u), _ = !1;
858
863
  } else if (t === "g" || t === "G") {
859
864
  let e = 0;
860
- for (; _ < f.length && f[_].toLowerCase() === "g";) e++, _++;
861
- let t = h();
862
- e === 1 ? g += t.abbr : e === 2 ? g += t.short : g += t.long, v = !1;
865
+ for (; g < d.length && d[g].toLowerCase() === "g";) e++, g++;
866
+ let t = m();
867
+ e === 1 ? h += t.abbr : e === 2 ? h += t.short : h += t.long, _ = !1;
863
868
  } else if (t === "e" || t === "E") {
864
869
  let e = 0;
865
- for (; _ < f.length && f[_].toLowerCase() === "e";) e++, _++;
866
- let t = h().year;
867
- g += e >= 2 ? String(t).padStart(2, "0") : String(t), v = !1;
870
+ for (; g < d.length && d[g].toLowerCase() === "e";) e++, g++;
871
+ let t = m().year;
872
+ h += e >= 2 ? String(t).padStart(2, "0") : String(t), _ = !1;
868
873
  } else if (t === "r" || t === "R") {
869
874
  let e = 0;
870
- for (; _ < f.length && f[_].toLowerCase() === "r";) e++, _++;
871
- let t = h().year;
872
- g += e >= 2 ? String(t).padStart(2, "0") : String(t), v = !1;
875
+ for (; g < d.length && d[g].toLowerCase() === "r";) e++, g++;
876
+ let t = m().year;
877
+ h += e >= 2 ? String(t).padStart(2, "0") : String(t), _ = !1;
873
878
  } else if (t === "A" || t === "a") {
874
- let e = f.slice(_).toUpperCase();
875
- e.startsWith("AAAA") ? (g += Ot[c], _ += 4) : e.startsWith("AAA") ? (g += Dt[c], _ += 3) : e.startsWith("AM/PM") ? (g += l < 12 ? "AM" : "PM", _ += 5) : e.startsWith("A/P") ? (g += l < 12 ? "A" : "P", _ += 3) : (g += t, _++), v = !1;
876
- } else g += t, _++, t !== ":" && t !== "/" && t !== "-" && t !== "." && t !== " " && (v = !1);
879
+ let e = d.slice(g).toUpperCase();
880
+ e.startsWith("AAAA") ? (h += Ot[s], g += 4) : e.startsWith("AAA") ? (h += Dt[s], g += 3) : e.startsWith("AM/PM") ? (h += c < 12 ? "AM" : "PM", g += 5) : e.startsWith("A/P") ? (h += c < 12 ? "A" : "P", g += 3) : (h += t, g++), _ = !1;
881
+ } else h += t, g++, t !== ":" && t !== "/" && t !== "-" && t !== "." && t !== " " && (_ = !1);
877
882
  }
878
- return g;
883
+ return h;
879
884
  }
880
885
  function Mt(e) {
881
886
  if (/\[[hms]+\]/i.test(e)) return !0;
@@ -1104,9 +1109,9 @@ function Yt(e, t, n) {
1104
1109
  function Xt(e, t, n) {
1105
1110
  let r = Gt(t), i = n ? Math.abs(e) : e;
1106
1111
  r.hasPercent && (i *= 100), r.commaScale > 0 && (i /= 1e3 ** r.commaScale);
1107
- let a = i < 0 ? "-" : "", o = Math.abs(i);
1112
+ let a = i < 0 ? "-" : "", s = Math.abs(i);
1108
1113
  if (r.fraction) {
1109
- let e = Math.floor(o), t = o - e, { wholeSpec: n, numSpec: i, denSpec: s, fixedDen: c } = r.fraction, l = n.length > 0, [u, d] = Yt(t, s.length, c), f = (e, t) => {
1114
+ let e = Math.floor(s), t = s - e, { wholeSpec: n, numSpec: i, denSpec: o, fixedDen: c } = r.fraction, l = n.length > 0, [u, d] = Yt(t, o.length, c), f = (e, t) => {
1110
1115
  let n = String(e), r = t.includes("0") ? "0" : " ";
1111
1116
  for (; n.length < t.length;) n = r + n;
1112
1117
  return n;
@@ -1118,25 +1123,25 @@ function Xt(e, t, n) {
1118
1123
  if (l) {
1119
1124
  let t = e > 0 ? String(e) : n.includes("0") ? "0" : "";
1120
1125
  if (u === 0) {
1121
- let e = c === null ? s.length || 1 : String(c).length;
1126
+ let e = c === null ? o.length || 1 : String(c).length;
1122
1127
  m += t + " ".repeat(1 + i.length + 1 + e);
1123
1128
  } else {
1124
- let e = c === null ? p(d, s) : String(c);
1129
+ let e = c === null ? p(d, o) : String(c);
1125
1130
  m += t + " " + f(u, i) + "/" + e;
1126
1131
  }
1127
1132
  } else {
1128
- let t = u + e * d, n = c === null ? p(d, s) : String(c);
1133
+ let t = u + e * d, n = c === null ? p(d, o) : String(c);
1129
1134
  m += f(t, i) + "/" + n;
1130
1135
  }
1131
1136
  return m;
1132
1137
  }
1133
1138
  if (r.exp) {
1134
1139
  let e = Math.max(r.intSpec.length, 1), t = r.fracSpec.length, n = 0, i = 0;
1135
- o !== 0 && (i = Math.floor(Math.log10(o)), i = Math.floor(i / e) * e, n = o / 10 ** i, parseFloat(s(n, t)) >= 10 ** e && (i += e, n = o / 10 ** i));
1136
- let [c, l = ""] = s(n, t).split(".");
1140
+ s !== 0 && (i = Math.floor(Math.log10(s)), i = Math.floor(i / e) * e, n = s / 10 ** i, parseFloat(o(n, t)) >= 10 ** e && (i += e, n = s / 10 ** i));
1141
+ let [c, l = ""] = o(n, t).split(".");
1137
1142
  return a + Zt(r, qt(c, r.intSpec, !1), Jt(l, r.fracSpec), "E" + (i < 0 ? "-" : r.exp.plus ? "+" : "") + String(Math.abs(i)).padStart(r.exp.width, "0"));
1138
1143
  }
1139
- let c = r.fracSpec.length, [l, u = ""] = s(o, c).split("."), d = l.replace(/^0+/, ""), f = /[0]/.test(r.intSpec) || r.intSpec === "" && !1;
1144
+ let c = r.fracSpec.length, [l, u = ""] = o(s, c).split("."), d = l.replace(/^0+/, ""), f = /[0]/.test(r.intSpec) || r.intSpec === "" && !1;
1140
1145
  return d === "" && f && (d = "0"), a + Zt(r, qt(d, r.intSpec, r.grouping), Jt(u, r.fracSpec), "");
1141
1146
  }
1142
1147
  function Zt(e, t, n, r) {
@@ -1390,36 +1395,36 @@ function fn(e, t, n, r, i) {
1390
1395
  //#endregion
1391
1396
  //#region packages/xlsx/src/bidi-line.ts
1392
1397
  function pn(e, t) {
1393
- return e === 2 ? !0 : e === 1 ? !1 : De(void 0, t) === "rtl";
1398
+ return e === 2 ? !0 : e === 1 ? !1 : je(void 0, t) === "rtl";
1394
1399
  }
1395
1400
  var mn = (e) => {
1396
1401
  let t = e.text;
1397
1402
  return typeof t == "string" ? t : void 0;
1398
1403
  };
1399
1404
  function hn(e, t) {
1400
- let r = e === 2 || n(t);
1405
+ let n = e === 2 || M(t);
1401
1406
  return {
1402
- needBidi: r,
1403
- baseRtl: r && pn(e, t)
1407
+ needBidi: n,
1408
+ baseRtl: n && pn(e, t)
1404
1409
  };
1405
1410
  }
1406
1411
  function gn(e, t) {
1407
- let n = e.length;
1408
- if (n === 0) return {
1412
+ let r = e.length;
1413
+ if (r === 0) return {
1409
1414
  order: [],
1410
1415
  rtl: []
1411
1416
  };
1412
- let r = "", i = Array(n);
1413
- for (let t = 0; t < n; t++) {
1414
- i[t] = r.length;
1417
+ let i = "", a = Array(r);
1418
+ for (let t = 0; t < r; t++) {
1419
+ a[t] = i.length;
1415
1420
  let n = mn(e[t]) ?? "";
1416
- r += n.length > 0 ? n : "";
1421
+ i += n.length > 0 ? n : "";
1417
1422
  }
1418
- let { levels: a, paragraphLevel: o } = M().computeLevels(r, t ? "rtl" : "ltr"), { order: s, segLevels: c } = ye(a, o, i), l = Array(n);
1419
- for (let e = 0; e < n; e++) l[e] = (c[e] & 1) == 1;
1423
+ let { levels: o, paragraphLevel: s } = f().computeLevels(i, t ? "rtl" : "ltr"), { order: c, segLevels: l } = n(o, s, a), u = Array(r);
1424
+ for (let e = 0; e < r; e++) u[e] = (l[e] & 1) == 1;
1420
1425
  return {
1421
- order: s,
1422
- rtl: l
1426
+ order: c,
1427
+ rtl: u
1423
1428
  };
1424
1429
  }
1425
1430
  //#endregion
@@ -1445,25 +1450,25 @@ function vn(e, t) {
1445
1450
  //#endregion
1446
1451
  //#region packages/xlsx/src/vertical-text.ts
1447
1452
  function yn(e, t, n, r, a, o = !1) {
1448
- let s = t.codePointAt(0) ?? 0, c = _e(s);
1449
- if (o && D(s)) {
1450
- e.save(), e.translate(n, r + a / 2), e.textAlign = "center", e.textBaseline = "middle", he(e, () => e.fillText(t, 0, 0)), e.restore();
1453
+ let s = t.codePointAt(0) ?? 0, c = ee(s);
1454
+ if (o && i(s)) {
1455
+ e.save(), e.translate(n, r + a / 2), e.textAlign = "center", e.textBaseline = "middle", ge(e, () => e.fillText(t, 0, 0)), e.restore();
1451
1456
  return;
1452
1457
  }
1453
1458
  if (c === "Tr") {
1454
- let o = ve(s);
1455
- if (o !== null) {
1456
- e.fillText(String.fromCodePoint(o), n, r);
1459
+ let i = z(s);
1460
+ if (i !== null) {
1461
+ e.fillText(String.fromCodePoint(i), n, r);
1457
1462
  return;
1458
1463
  }
1459
- if (i(s)) {
1464
+ if (ve(s)) {
1460
1465
  e.fillText(t, n, r);
1461
1466
  return;
1462
1467
  }
1463
1468
  e.save(), e.translate(n, r + a / 2), e.rotate(Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", e.fillText(t, 0, 0), e.restore();
1464
1469
  return;
1465
1470
  }
1466
- let l = c === "Tu" ? L(s) : null;
1471
+ let l = c === "Tu" ? ye(s) : null;
1467
1472
  e.fillText(l === null ? t : String.fromCodePoint(l), n, r);
1468
1473
  }
1469
1474
  //#endregion
@@ -1471,12 +1476,12 @@ function yn(e, t, n, r, a, o = !1) {
1471
1476
  function bn(e, t) {
1472
1477
  return t ? `${e}|duo:${t.clr1}:${t.clr2}` : e;
1473
1478
  }
1474
- var xn = b.map((e) => `"${e}"`).join(", "), Sn = S.map((e) => `"${e}"`).join(", "), Cn = `"Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${xn}, sans-serif`, wn = `"Cambria", "Caladea", "Times New Roman", "Liberation Serif", "Noto Naskh Arabic", "Noto Sans Arabic", ${Sn}, serif`, Tn = "\"Courier New\", \"Liberation Mono\", monospace";
1479
+ var xn = C.map((e) => `"${e}"`).join(", "), Sn = E.map((e) => `"${e}"`).join(", "), Cn = `"Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${xn}, sans-serif`, wn = `"Cambria", "Caladea", "Times New Roman", "Liberation Serif", "Noto Naskh Arabic", "Noto Sans Arabic", ${Sn}, serif`, Tn = "\"Courier New\", \"Liberation Mono\", monospace";
1475
1480
  function En(e) {
1476
- let t = e ? p(e) : null, n = v(e);
1481
+ let t = e ? y(e) : null, n = O(e);
1477
1482
  if (!t) return n === "serif" ? wn : n === "mono" ? Tn : Cn;
1478
1483
  let r = n === "serif";
1479
- return `${c(t, r ? "serif" : "sans").map((e) => `"${e}"`).join(", ")}, "Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${r ? Sn : xn}, ${r ? "serif" : "sans-serif"}`;
1484
+ return `${m(t, r ? "serif" : "sans").map((e) => `"${e}"`).join(", ")}, "Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${r ? Sn : xn}, ${r ? "serif" : "sans-serif"}`;
1480
1485
  }
1481
1486
  function Dn(e) {
1482
1487
  return e ? `"${e}", ${En(e)}` : Cn;
@@ -1503,7 +1508,7 @@ function Fn(e, t) {
1503
1508
  if (r !== void 0) return r;
1504
1509
  let i = Pn[e.toLowerCase()]?.[Math.round(t)];
1505
1510
  if (i !== void 0) return Nn.set(n, i), i;
1506
- let a = t * G, o = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1) : typeof document < "u" ? document.createElement("canvas") : null;
1511
+ let a = t * x, o = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1) : typeof document < "u" ? document.createElement("canvas") : null;
1507
1512
  if (!o) return kn;
1508
1513
  let s = o.getContext("2d");
1509
1514
  if (!s) return kn;
@@ -1526,17 +1531,17 @@ function In(e, t = kn) {
1526
1531
  return e / t;
1527
1532
  }
1528
1533
  function $(e) {
1529
- return Math.round(e * G);
1534
+ return Math.round(e * x);
1530
1535
  }
1531
1536
  function Ln(e) {
1532
- return e / G;
1537
+ return e / x;
1533
1538
  }
1534
1539
  function Rn(e, t, n, r, i, a, o) {
1535
1540
  if (!(i <= 0 || a <= 0)) {
1536
1541
  if (o) {
1537
1542
  let a = e.createLinearGradient(n, r, n + i, r);
1538
- a.addColorStop(0, R(t, .85)), a.addColorStop(1, R(t, .15)), e.fillStyle = a;
1539
- } else e.fillStyle = R(t);
1543
+ a.addColorStop(0, J(t, .85)), a.addColorStop(1, J(t, .15)), e.fillStyle = a;
1544
+ } else e.fillStyle = J(t);
1540
1545
  e.fillRect(n, r, i, a);
1541
1546
  }
1542
1547
  }
@@ -1728,35 +1733,35 @@ var Bn = /* @__PURE__ */ new Map(), Vn = {
1728
1733
  function Hn(e, t, n, r) {
1729
1734
  let i = e.getTransform(), a = Math.max(1, Math.round(Math.hypot(i.a, i.b))), o = Math.max(1, Math.round(Math.hypot(i.c, i.d))), s = `${t}|${n}|${r}|${a}|${o}`;
1730
1735
  if (Bn.has(s)) return Bn.get(s);
1731
- let c = Vn[t];
1732
- if (!c) return Bn.set(s, null), null;
1733
- let l = c.length, u = k(l, l);
1734
- if (!u) return Bn.set(s, null), null;
1735
- let d = u.getContext("2d");
1736
+ let l = Vn[t];
1737
+ if (!l) return Bn.set(s, null), null;
1738
+ let u = l.length, d = c(u, u);
1736
1739
  if (!d) return Bn.set(s, null), null;
1737
- d.fillStyle = R(r), d.fillRect(0, 0, l, l), d.fillStyle = R(n);
1738
- for (let e = 0; e < l; e++) {
1739
- let t = c[e];
1740
- for (let n = 0; n < l; n++) t & 1 << l - 1 - n && d.fillRect(n, e, 1, 1);
1741
- }
1742
- let f = e.createPattern(u, "repeat");
1743
- if (f && typeof DOMMatrix < "u" && (a >= 2 || o >= 2)) {
1740
+ let f = d.getContext("2d");
1741
+ if (!f) return Bn.set(s, null), null;
1742
+ f.fillStyle = J(r), f.fillRect(0, 0, u, u), f.fillStyle = J(n);
1743
+ for (let e = 0; e < u; e++) {
1744
+ let t = l[e];
1745
+ for (let n = 0; n < u; n++) t & 1 << u - 1 - n && f.fillRect(n, e, 1, 1);
1746
+ }
1747
+ let p = e.createPattern(d, "repeat");
1748
+ if (p && typeof DOMMatrix < "u" && (a >= 2 || o >= 2)) {
1744
1749
  let e = new DOMMatrix();
1745
- e.scaleSelf(1 / a, 1 / o), f.setTransform(e);
1750
+ e.scaleSelf(1 / a, 1 / o), p.setTransform(e);
1746
1751
  }
1747
- return Bn.set(s, f), f;
1752
+ return Bn.set(s, p), p;
1748
1753
  }
1749
1754
  function Un(e, t, n, r, i, a) {
1750
1755
  if (t.gradient && t.gradient.stops.length > 0) return e.fillStyle = Wn(e, t.gradient, n, r, i, a), e.fillRect(n, r, i, a), !0;
1751
1756
  let o = t.patternType;
1752
1757
  if (!o || o === "none") return !1;
1753
1758
  let s = t.fgColor ?? "000000", c = t.bgColor ?? "FFFFFF";
1754
- if (o === "solid") return e.fillStyle = R(s), e.fillRect(n, r, i, a), !0;
1759
+ if (o === "solid") return e.fillStyle = J(s), e.fillRect(n, r, i, a), !0;
1755
1760
  let l = Hn(e, o, s, c);
1756
1761
  if (l) e.fillStyle = l;
1757
1762
  else {
1758
1763
  let t = zn(o);
1759
- e.fillStyle = t >= 1 ? R(s) : qn(s, c, t);
1764
+ e.fillStyle = t >= 1 ? J(s) : qn(s, c, t);
1760
1765
  }
1761
1766
  return e.fillRect(n, r, i, a), !0;
1762
1767
  }
@@ -1771,7 +1776,7 @@ function Wn(e, t, n, r, i, a) {
1771
1776
  }
1772
1777
  for (let e of t.stops) {
1773
1778
  let t = Math.min(1, Math.max(0, e.position));
1774
- o.addColorStop(t, R(e.color));
1779
+ o.addColorStop(t, J(e.color));
1775
1780
  }
1776
1781
  return o;
1777
1782
  }
@@ -1785,11 +1790,11 @@ function qn(e, t, n) {
1785
1790
  return `rgb(${Math.round(a * d + c * (1 - d))},${Math.round(o * d + l * (1 - d))},${Math.round(s * d + u * (1 - d))})`;
1786
1791
  }
1787
1792
  function Jn(e, t, n = 1, r) {
1788
- let i = Math.round(e * G * n * t);
1789
- return r ? Math.max(i, Math.round(le(r, e * G * t))) : i;
1793
+ let i = Math.round(e * x * n * t);
1794
+ return r ? Math.max(i, Math.round(G(r, e * x * t))) : i;
1790
1795
  }
1791
1796
  function Yn(e, t = 1) {
1792
- return `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${Math.max(1, Math.round(e.size * G * t))}px ${Dn(e.name)}`;
1797
+ return `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${Math.max(1, Math.round(e.size * x * t))}px ${Dn(e.name)}`;
1793
1798
  }
1794
1799
  function Xn(e, t, n, r, i, a, o, s, c, l) {
1795
1800
  if (t.length === 0) return;
@@ -1828,10 +1833,10 @@ function Zn(e, t, n) {
1828
1833
  }
1829
1834
  function Qn(e, t, n, r, i, a, o = 1) {
1830
1835
  if (e.save(), e.strokeStyle = i, e.lineWidth = .5, e.beginPath(), a) {
1831
- let i = r - 1, a = r + 1, s = i + N(i, .5, o), c = a + N(a, .5, o);
1836
+ let i = r - 1, a = r + 1, s = i + d(i, .5, o), c = a + d(a, .5, o);
1832
1837
  e.moveTo(t, s), e.lineTo(n, s), e.moveTo(t, c), e.lineTo(n, c);
1833
1838
  } else {
1834
- let i = r + N(r, .5, o);
1839
+ let i = r + d(r, .5, o);
1835
1840
  e.moveTo(t, i), e.lineTo(n, i);
1836
1841
  }
1837
1842
  e.stroke(), e.restore();
@@ -1892,13 +1897,13 @@ function tr(e, t, n) {
1892
1897
  function nr(e, t) {
1893
1898
  if (e.length === 0 || t.length === 0) return 0;
1894
1899
  let n = [...e, ...t], r = e.length;
1895
- return r - f(n, r, _, 1);
1900
+ return r - v(n, r, D, 1);
1896
1901
  }
1897
1902
  function rr(e, t) {
1898
1903
  let n = t;
1899
1904
  for (; n < e.length;) {
1900
1905
  let t = e[e.length - n - 1], r = e[e.length - n], i = t?.codePointAt(0), a = r?.codePointAt(0);
1901
- if (i !== void 0 && a !== void 0 && T(i) && T(a)) n++;
1906
+ if (i !== void 0 && a !== void 0 && l(i) && l(a)) n++;
1902
1907
  else break;
1903
1908
  }
1904
1909
  return n >= e.length ? t : n;
@@ -1906,10 +1911,10 @@ function rr(e, t) {
1906
1911
  function ir(e, t) {
1907
1912
  if (e.length === 0 || t.length === 0) return 0;
1908
1913
  let n = t[0].codePointAt(0), r = e.length - 1, i = e[r].codePointAt(0);
1909
- if (i === void 0 || n === void 0 || i === 8203 || n === 8203 || !y(i, n)) return 0;
1914
+ if (i === void 0 || n === void 0 || i === 8203 || n === 8203 || !S(i, n)) return 0;
1910
1915
  for (; r > 0;) {
1911
1916
  let t = e[r - 1].codePointAt(0), n = e[r].codePointAt(0);
1912
- if (t === void 0 || n === void 0 || !y(t, n)) break;
1917
+ if (t === void 0 || n === void 0 || !S(t, n)) break;
1913
1918
  r--;
1914
1919
  }
1915
1920
  return r === 0 ? 0 : e.length - r;
@@ -1918,7 +1923,7 @@ function ar(e, t, n) {
1918
1923
  let r = [], i = [], a = 0;
1919
1924
  for (; a < t.length;) {
1920
1925
  let e = t[a], n = e.codePointAt(0) ?? 0;
1921
- if (x(n)) i.push(e), a += n > 65535 ? 2 : 1;
1926
+ if (T(n)) i.push(e), a += n > 65535 ? 2 : 1;
1922
1927
  else if (e === " ") {
1923
1928
  let e = a;
1924
1929
  for (; e < t.length && t[e] === " ";) e++;
@@ -1927,10 +1932,10 @@ function ar(e, t, n) {
1927
1932
  let e = a;
1928
1933
  for (; e < t.length;) {
1929
1934
  let n = t[e], r = n.codePointAt(0) ?? 0;
1930
- if (n === " " || x(r)) break;
1935
+ if (n === " " || T(r)) break;
1931
1936
  e += r > 65535 ? 2 : 1;
1932
1937
  }
1933
- let n = t.slice(a, e), r = J(n) ? ne(n) : null;
1938
+ let n = t.slice(a, e), r = k(n) ? b(n) : null;
1934
1939
  if (r && r.length > 0) {
1935
1940
  let e = 0;
1936
1941
  for (let t of r) i.push(n.slice(e, t)), e = t;
@@ -1960,37 +1965,37 @@ function ar(e, t, n) {
1960
1965
  return r.push(o), r;
1961
1966
  }
1962
1967
  function or(e, t, n, r, i) {
1963
- let a = [], s = [], c = 0, l = 0, u = null, d = n.size, f = n.name, p = 0, m = () => {
1964
- s.length !== 0 && (a.push({
1965
- segments: s,
1966
- maxFontSize: l,
1967
- maxFontFamily: u,
1968
- para: p
1969
- }), s = [], c = 0, l = 0, u = null);
1970
- }, h = () => {
1971
- if (s.length === 0) {
1972
- a.push({
1968
+ let o = [], c = [], l = 0, u = 0, d = null, f = n.size, p = n.name, m = 0, h = () => {
1969
+ c.length !== 0 && (o.push({
1970
+ segments: c,
1971
+ maxFontSize: u,
1972
+ maxFontFamily: d,
1973
+ para: m
1974
+ }), c = [], l = 0, u = 0, d = null);
1975
+ }, g = () => {
1976
+ if (c.length === 0) {
1977
+ o.push({
1973
1978
  segments: [],
1974
- maxFontSize: d || On,
1975
- maxFontFamily: f,
1976
- para: p
1979
+ maxFontSize: f || On,
1980
+ maxFontFamily: p,
1981
+ para: m
1977
1982
  });
1978
1983
  return;
1979
1984
  }
1980
- m();
1981
- }, g = (t, n) => {
1985
+ h();
1986
+ }, _ = (t, n) => {
1982
1987
  if (!t) return;
1983
- d = n.size, f = n.name, e.font = Yn(cr(n), r);
1988
+ f = n.size, p = n.name, e.font = Yn(cr(n), r);
1984
1989
  let a = e.measureText(t).width;
1985
- if (s.length > 0 && c + a > i) {
1986
- let i = s.flatMap((e) => [...e.text]), a = nr(i, [...t]);
1987
- a > 0 ? a = rr(i, a) : !J(t) && !J(s[s.length - 1]?.text ?? "") && !/^\s/u.test(t) && !/\s$/u.test(i.at(-1) ?? "") && (a = ir(i, [...t]));
1988
- let o = s[s.length - 1], d = [...o.text];
1989
- a > d.length && (a = d.length);
1990
+ if (c.length > 0 && l + a > i) {
1991
+ let i = c.flatMap((e) => [...e.text]), a = nr(i, [...t]);
1992
+ a > 0 ? a = rr(i, a) : !k(t) && !k(c[c.length - 1]?.text ?? "") && !/^\s/u.test(t) && !/\s$/u.test(i.at(-1) ?? "") && (a = ir(i, [...t]));
1993
+ let o = c[c.length - 1], s = [...o.text];
1994
+ a > s.length && (a = s.length);
1990
1995
  let f = null;
1991
1996
  if (a > 0) {
1992
- let t = d.slice(0, d.length - a), n = d.slice(d.length - a);
1993
- if (e.font = Yn(cr(o.font), r), t.length === 0) s.pop();
1997
+ let t = s.slice(0, s.length - a), n = s.slice(s.length - a);
1998
+ if (e.font = Yn(cr(o.font), r), t.length === 0) c.pop();
1994
1999
  else {
1995
2000
  let n = t.join("");
1996
2001
  o.text = n, o.width = e.measureText(n).width;
@@ -2002,32 +2007,32 @@ function or(e, t, n, r, i) {
2002
2007
  width: e.measureText(i).width
2003
2008
  };
2004
2009
  }
2005
- m(), f && (s.push(f), c += f.width, f.font.size > l && (l = f.font.size, u = f.font.name)), e.font = Yn(cr(n), r);
2010
+ h(), f && (c.push(f), l += f.width, f.font.size > u && (u = f.font.size, d = f.font.name)), e.font = Yn(cr(n), r);
2006
2011
  }
2007
- s.push({
2012
+ c.push({
2008
2013
  text: t,
2009
2014
  font: n,
2010
2015
  width: a
2011
- }), c += a, n.size > l && (l = n.size, u = n.name);
2012
- }, _ = (t, n) => {
2013
- let a = ne(t);
2014
- if (a.length === 0) {
2015
- g(t, n);
2016
+ }), l += a, n.size > u && (u = n.size, d = n.name);
2017
+ }, v = (t, n) => {
2018
+ let o = b(t);
2019
+ if (o.length === 0) {
2020
+ _(t, n);
2016
2021
  return;
2017
2022
  }
2018
2023
  e.font = Yn(cr(n), r);
2019
- let s = (t) => e.measureText(t).width, l = C(t), u = t.length, d = 0;
2020
- for (; d < u;) {
2021
- let e = i - c, r = O(t, a, d, e, s, l);
2022
- if (r <= d) {
2023
- if (c > 0) {
2024
- m();
2024
+ let c = (t) => e.measureText(t).width, u = re(t), d = t.length, f = 0;
2025
+ for (; f < d;) {
2026
+ let e = i - l, r = s(t, o, f, e, c, u);
2027
+ if (r <= f) {
2028
+ if (l > 0) {
2029
+ h();
2025
2030
  continue;
2026
2031
  }
2027
- let n = a.find((e) => e > d) ?? u, i = t.slice(d, n), f = o(i), p = O(i, f, 0, e, s, l);
2028
- p <= 0 && (p = f.length > 0 ? f[0] : i.length), r = d + p;
2032
+ let n = o.find((e) => e > f) ?? d, i = t.slice(f, n), p = a(i), m = s(i, p, 0, e, c, u);
2033
+ m <= 0 && (m = p.length > 0 ? p[0] : i.length), r = f + m;
2029
2034
  }
2030
- g(t.slice(d, r), n), d = r, d < u && m();
2035
+ _(t.slice(f, r), n), f = r, f < d && h();
2031
2036
  }
2032
2037
  };
2033
2038
  for (let e of t) {
@@ -2035,7 +2040,7 @@ function or(e, t, n, r, i) {
2035
2040
  for (; i < e.text.length;) {
2036
2041
  let t = e.text[i], n = t.codePointAt(0) ?? 0;
2037
2042
  if (n === 10) r.push("\n"), i += 1;
2038
- else if (x(n)) r.push(t), i += n > 65535 ? 2 : 1;
2043
+ else if (T(n)) r.push(t), i += n > 65535 ? 2 : 1;
2039
2044
  else if (t === " ") {
2040
2045
  let t = i;
2041
2046
  for (; t < e.text.length && e.text[t] === " ";) t++;
@@ -2044,15 +2049,15 @@ function or(e, t, n, r, i) {
2044
2049
  let t = i;
2045
2050
  for (; t < e.text.length;) {
2046
2051
  let n = e.text[t], r = n.codePointAt(0) ?? 0;
2047
- if (n === " " || n === "\n" || x(r)) break;
2052
+ if (n === " " || n === "\n" || T(r)) break;
2048
2053
  t += r > 65535 ? 2 : 1;
2049
2054
  }
2050
2055
  r.push(e.text.slice(i, t)), i = t;
2051
2056
  }
2052
2057
  }
2053
- for (let e of r) e === "\n" ? (h(), p++) : J(e) ? _(e, t) : g(e, t);
2058
+ for (let e of r) e === "\n" ? (g(), m++) : k(e) ? v(e, t) : _(e, t);
2054
2059
  }
2055
- return (s.length > 0 || a.length > 0) && h(), a;
2060
+ return (c.length > 0 || o.length > 0) && g(), o;
2056
2061
  }
2057
2062
  function sr(e, t, n) {
2058
2063
  return e === "middle" ? {
@@ -2076,29 +2081,29 @@ function lr(e, t, n, r, i, a, o, s) {
2076
2081
  e.textAlign = "left", e.textBaseline = i;
2077
2082
  let c = s.needBidi ? gn(t, s.baseRtl ?? !1) : null, l = e, u = n;
2078
2083
  for (let n = 0; n < t.length; n++) {
2079
- let d = c ? c.order[n] : n;
2084
+ let f = c ? c.order[n] : n;
2080
2085
  if (c) try {
2081
- l.direction = c.rtl[d] ? "rtl" : "ltr";
2086
+ l.direction = c.rtl[f] ? "rtl" : "ltr";
2082
2087
  } catch {}
2083
- let f = t[d], p = cr(f.font);
2084
- e.font = Yn(p, a);
2085
- let m = s.fontColor ?? f.font.color;
2086
- e.fillStyle = m ? R(m) : "#000000";
2087
- let h = Jn(f.font.size, a), g = 0;
2088
- f.font.vertAlign === "superscript" ? g = -Math.round(h * .35) : f.font.vertAlign === "subscript" && (g = Math.round(h * .1)), e.fillText(f.text, u, r + g);
2089
- let _ = Jn(p.size, a);
2090
- if (f.font.underline || f.font.strike) {
2091
- let t = sr(i, r, _);
2092
- if (f.font.underline) {
2093
- let n = m ? R(m) : "#000000", r = f.font.underlineStyle === "double" || f.font.underlineStyle === "doubleAccounting";
2094
- Qn(e, u, u + f.width, t.underline + g, n, r, o);
2088
+ let p = t[f], m = cr(p.font);
2089
+ e.font = Yn(m, a);
2090
+ let h = s.fontColor ?? p.font.color;
2091
+ e.fillStyle = h ? J(h) : "#000000";
2092
+ let g = Jn(p.font.size, a), _ = 0;
2093
+ p.font.vertAlign === "superscript" ? _ = -Math.round(g * .35) : p.font.vertAlign === "subscript" && (_ = Math.round(g * .1)), e.fillText(p.text, u, r + _);
2094
+ let v = Jn(m.size, a);
2095
+ if (p.font.underline || p.font.strike) {
2096
+ let t = sr(i, r, v);
2097
+ if (p.font.underline) {
2098
+ let n = h ? J(h) : "#000000", r = p.font.underlineStyle === "double" || p.font.underlineStyle === "doubleAccounting";
2099
+ Qn(e, u, u + p.width, t.underline + _, n, r, o);
2095
2100
  }
2096
- if (f.font.strike) {
2097
- let n = t.strike + g, r = n + N(n, .5, o);
2098
- e.save(), e.strokeStyle = m ? R(m) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(u, r), e.lineTo(u + f.width, r), e.stroke(), e.restore();
2101
+ if (p.font.strike) {
2102
+ let n = t.strike + _, r = n + d(n, .5, o);
2103
+ e.save(), e.strokeStyle = h ? J(h) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(u, r), e.lineTo(u + p.width, r), e.stroke(), e.restore();
2099
2104
  }
2100
2105
  }
2101
- u += f.width;
2106
+ u += p.width;
2102
2107
  }
2103
2108
  if (c) try {
2104
2109
  l.direction = "ltr";
@@ -2304,272 +2309,272 @@ function wr(e) {
2304
2309
  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();
2305
2310
  return `#${o(a(n))}${o(a(r))}${o(a(i))}`;
2306
2311
  }
2307
- function Tr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
2308
- if (f <= 0 || p <= 0) return;
2309
- let { styles: m, cellMap: h, mergeAnchorMap: g, mergeSkipSet: _, cfContext: v, cs: y, dpr: b } = t, x = i.length, S = a.length, C = (e, n) => t.rtl ? An(e, n, t.canvasW) : e, w = [], T = -o;
2310
- for (let e = 0; e < x; e++) w.push(T), T += i[e];
2311
- let E = [], O = -s;
2312
- for (let e = 0; e < S; e++) E.push(O), O += a[e];
2313
- e.save(), e.beginPath(), e.rect(C(u, f), d, f, p), e.clip();
2312
+ function Tr(e, t, n, r, a, o, s, c, l, u, f, p, m, h) {
2313
+ if (m <= 0 || h <= 0) return;
2314
+ let { styles: g, cellMap: _, mergeAnchorMap: v, mergeSkipSet: y, cfContext: b, cs: x, dpr: S } = t, C = a.length, w = o.length, T = (e, n) => t.rtl ? An(e, n, t.canvasW) : e, E = [], D = -s;
2315
+ for (let e = 0; e < C; e++) E.push(D), D += a[e];
2316
+ let O = [], ee = -c;
2317
+ for (let e = 0; e < w; e++) O.push(ee), ee += o[e];
2318
+ e.save(), e.beginPath(), e.rect(T(f, m), p, m, h), e.clip();
2314
2319
  let k = [], A = [], j = [];
2315
2320
  for (let i of t.worksheet.mergeCells ?? []) {
2316
- let a = i.top, u = i.left;
2317
- if (a >= n && a < n + S && u >= r && u < r + x || i.bottom < n || i.top >= n + S || i.right < r || i.left >= r + x) continue;
2318
- let d = t.mergeAnchorMap.get(`${a}:${u}`);
2321
+ let a = i.top, o = i.left;
2322
+ if (a >= n && a < n + w && o >= r && o < r + C || i.bottom < n || i.top >= n + w || i.right < r || i.left >= r + C) continue;
2323
+ let d = t.mergeAnchorMap.get(`${a}:${o}`);
2319
2324
  if (!d) continue;
2320
2325
  let f;
2321
- if (u >= r) f = c + w[u - r];
2326
+ if (o >= r) f = l + E[o - r];
2322
2327
  else {
2323
2328
  let e = 0;
2324
- for (let n = u; n < r; n++) e += Math.round(Q(t.worksheet.colWidths[n] ?? t.worksheet.defaultColWidth, t.mdw) * y);
2325
- f = c - o - e;
2329
+ for (let n = o; n < r; n++) e += Math.round(Q(t.worksheet.colWidths[n] ?? t.worksheet.defaultColWidth, t.mdw) * x);
2330
+ f = l - s - e;
2326
2331
  }
2327
2332
  let p;
2328
- if (a >= n) p = l + E[a - n];
2333
+ if (a >= n) p = u + O[a - n];
2329
2334
  else {
2330
2335
  let e = 0;
2331
- for (let r = a; r < n; r++) e += Math.round($(t.worksheet.rowHeights[r] ?? t.worksheet.defaultRowHeight) * y);
2332
- p = l - s - e;
2333
- }
2334
- let h = d.totalW, g = d.totalH;
2335
- f = C(f, h);
2336
- let _ = `${a}:${u}`, T = t.cellMap.get(_), { font: D, fill: O, border: k, xf: j } = er(m, T?.styleIndex ?? 0), M = fn(T, a, u, v, m.dxfs ?? []);
2337
- if (Un(e, M.fill ?? O, f, p, h, g), M.dataBar && M.dataBar.ratio > 0) {
2338
- let t = Math.max(0, (h - 4) * M.dataBar.ratio);
2339
- Rn(e, M.dataBar.color, f + 2, p + 2, t, g - 4, M.dataBar.gradient);
2340
- }
2341
- let N = Kr(Gr(k, a, u, d.right, d.bottom, t.cellMap, m), M.border);
2342
- if (A.push(() => qr(e, N, f, p, h, g, b)), !T) continue;
2343
- let P = xt(T, m, M.numFmt, t.worksheet.date1904), F = P.text;
2344
- if (!F || F === "0" && t.worksheet.showZeros === !1) continue;
2345
- let ee = D.bold || !!M.fontBold, I = D.italic || !!M.fontItalic, L = D.underline || !!M.fontUnderline, z = D.strike || !!M.fontStrike, B = ee !== D.bold || I !== D.italic || L !== D.underline || z !== D.strike ? {
2346
- ...D,
2347
- bold: ee,
2348
- italic: I,
2349
- underline: L,
2350
- strike: z
2351
- } : D;
2352
- e.font = Yn(B, y);
2353
- let V = t.hyperlinkMap.get(_) ? "#0563C1" : M.fontColor ?? P.color ?? D.color;
2354
- e.fillStyle = V ? R(V) : "#000000";
2355
- let H = T.value.type === "number", U = j.alignH ?? (H ? "right" : "left"), te = j.alignV ?? "bottom", W = j.indent ? Math.round(j.indent * 3 * t.mdw) : 0, ne = 3 + (U === "left" || !j.alignH ? W : 0);
2356
- e.save(), e.beginPath(), e.rect(f, p, h, g), e.clip();
2357
- let G;
2358
- U === "right" ? (G = f + h - 3, e.textAlign = "right") : U === "center" ? (G = f + h / 2, e.textAlign = "center") : (G = f + ne, e.textAlign = "left");
2359
- let re = T.value.type === "text" ? T.value.runs : void 0, ie = re && re.length > 0;
2360
- if (j.wrapText && ie) mr(e, re, B, {
2361
- alignH: U,
2362
- alignV: te,
2336
+ for (let r = a; r < n; r++) e += Math.round($(t.worksheet.rowHeights[r] ?? t.worksheet.defaultRowHeight) * x);
2337
+ p = u - c - e;
2338
+ }
2339
+ let m = d.totalW, h = d.totalH;
2340
+ f = T(f, m);
2341
+ let _ = `${a}:${o}`, v = t.cellMap.get(_), { font: y, fill: D, border: ee, xf: k } = er(g, v?.styleIndex ?? 0), j = fn(v, a, o, b, g.dxfs ?? []);
2342
+ if (Un(e, j.fill ?? D, f, p, m, h), j.dataBar && j.dataBar.ratio > 0) {
2343
+ let t = Math.max(0, (m - 4) * j.dataBar.ratio);
2344
+ Rn(e, j.dataBar.color, f + 2, p + 2, t, h - 4, j.dataBar.gradient);
2345
+ }
2346
+ let te = Kr(Gr(ee, a, o, d.right, d.bottom, t.cellMap, g), j.border);
2347
+ if (A.push(() => qr(e, te, f, p, m, h, S)), !v) continue;
2348
+ let M = xt(v, g, j.numFmt, t.worksheet.date1904), N = M.text;
2349
+ if (!N || N === "0" && t.worksheet.showZeros === !1) continue;
2350
+ let P = y.bold || !!j.fontBold, F = y.italic || !!j.fontItalic, I = y.underline || !!j.fontUnderline, L = y.strike || !!j.fontStrike, R = P !== y.bold || F !== y.italic || I !== y.underline || L !== y.strike ? {
2351
+ ...y,
2352
+ bold: P,
2353
+ italic: F,
2354
+ underline: I,
2355
+ strike: L
2356
+ } : y;
2357
+ e.font = Yn(R, x);
2358
+ let z = t.hyperlinkMap.get(_) ? "#0563C1" : j.fontColor ?? M.color ?? y.color;
2359
+ e.fillStyle = z ? J(z) : "#000000";
2360
+ let B = v.value.type === "number", V = k.alignH ?? (B ? "right" : "left"), H = k.alignV ?? "bottom", U = k.indent ? Math.round(k.indent * 3 * t.mdw) : 0, ne = 3 + (V === "left" || !k.alignH ? U : 0);
2361
+ e.save(), e.beginPath(), e.rect(f, p, m, h), e.clip();
2362
+ let W;
2363
+ V === "right" ? (W = f + m - 3, e.textAlign = "right") : V === "center" ? (W = f + m / 2, e.textAlign = "center") : (W = f + ne, e.textAlign = "left");
2364
+ let re = v.value.type === "text" ? v.value.runs : void 0, ie = re && re.length > 0;
2365
+ if (k.wrapText && ie) mr(e, re, R, {
2366
+ alignH: V,
2367
+ alignV: H,
2363
2368
  cx: f,
2364
2369
  cy: p,
2365
- cellW: h,
2366
- cellH: g,
2370
+ cellW: m,
2371
+ cellH: h,
2367
2372
  leftPad: ne,
2368
2373
  paddingX: 3,
2369
2374
  paddingY: 2
2370
- }, y, b, {
2371
- fontColor: M.fontColor,
2372
- readingOrder: j.readingOrder
2375
+ }, x, S, {
2376
+ fontColor: j.fontColor,
2377
+ readingOrder: k.readingOrder
2373
2378
  });
2374
- else if (j.wrapText) {
2375
- let t = tr(e, F, h - ne - 3), n = Jn(D.size, y, 1.2, D.name ?? void 0), r = t.length * n, i;
2376
- i = te === "top" ? p + 2 : te === "center" ? p + (g - r) / 2 : p + g - r - 2, e.textBaseline = "top";
2377
- for (let r = 0; r < t.length; r++) e.fillText(t[r], G, i + r * n);
2378
- } else if (ie) pr(e, re, B, {
2379
- alignH: U,
2380
- alignV: te,
2379
+ else if (k.wrapText) {
2380
+ let t = tr(e, N, m - ne - 3), n = Jn(y.size, x, 1.2, y.name ?? void 0), r = t.length * n, i;
2381
+ i = H === "top" ? p + 2 : H === "center" ? p + (h - r) / 2 : p + h - r - 2, e.textBaseline = "top";
2382
+ for (let r = 0; r < t.length; r++) e.fillText(t[r], W, i + r * n);
2383
+ } else if (ie) pr(e, re, R, {
2384
+ alignH: V,
2385
+ alignV: H,
2381
2386
  cx: f,
2382
2387
  cy: p,
2383
- cellW: h,
2384
- cellH: g,
2388
+ cellW: m,
2389
+ cellH: h,
2385
2390
  leftPad: ne,
2386
2391
  paddingX: 3,
2387
2392
  paddingY: 2
2388
- }, y, b, {
2389
- fontColor: M.fontColor,
2390
- readingOrder: j.readingOrder
2393
+ }, x, S, {
2394
+ fontColor: j.fontColor,
2395
+ readingOrder: k.readingOrder
2391
2396
  });
2392
2397
  else {
2393
2398
  let t;
2394
- te === "top" ? (e.textBaseline = "top", t = p + 2) : te === "center" ? (e.textBaseline = "middle", t = p + g / 2) : (e.textBaseline = "bottom", t = p + g - 2), e.fillText(F, G, t);
2399
+ H === "top" ? (e.textBaseline = "top", t = p + 2) : H === "center" ? (e.textBaseline = "middle", t = p + h / 2) : (e.textBaseline = "bottom", t = p + h - 2), e.fillText(N, W, t);
2395
2400
  }
2396
2401
  e.restore();
2397
2402
  }
2398
- for (let o = 0; o < S; o++) {
2399
- let s = n + o, S = l + E[o], T = a[o];
2400
- if (S + T <= d || S >= d + p) continue;
2401
- let O = /* @__PURE__ */ new Set(), M = /* @__PURE__ */ new Set(), P = -1, F = (e) => {
2402
- if (P >= 0 && e - P >= 2) {
2403
- for (let t = P; t < e - 1; t++) O.add(t);
2404
- for (let t = P + 1; t < e; t++) M.add(t);
2403
+ for (let s = 0; s < w; s++) {
2404
+ let c = n + s, w = u + O[s], D = o[s];
2405
+ if (w + D <= p || w >= p + h) continue;
2406
+ let ee = /* @__PURE__ */ new Set(), te = /* @__PURE__ */ new Set(), M = -1, N = (e) => {
2407
+ if (M >= 0 && e - M >= 2) {
2408
+ for (let t = M; t < e - 1; t++) ee.add(t);
2409
+ for (let t = M + 1; t < e; t++) te.add(t);
2405
2410
  }
2406
- P = -1;
2411
+ M = -1;
2407
2412
  };
2408
- for (let e = 0; e <= x; e++) {
2413
+ for (let e = 0; e <= C; e++) {
2409
2414
  let t = !1, n = !1;
2410
- if (e < x) {
2411
- let i = `${s}:${r + e}`;
2412
- if (!_.has(i) && !g.has(i)) {
2413
- let e = h.get(i);
2414
- t = er(m, e?.styleIndex ?? 0).xf.alignH === "centerContinuous", n = !!(e && e.value && e.value.type !== "empty");
2415
+ if (e < C) {
2416
+ let i = `${c}:${r + e}`;
2417
+ if (!y.has(i) && !v.has(i)) {
2418
+ let e = _.get(i);
2419
+ t = er(g, e?.styleIndex ?? 0).xf.alignH === "centerContinuous", n = !!(e && e.value && e.value.type !== "empty");
2415
2420
  }
2416
2421
  }
2417
- t ? n && P >= 0 && e > P ? (F(e), P = e) : P < 0 && (P = e) : F(e);
2418
- }
2419
- for (let n = 0; n < x; n++) {
2420
- let a = r + n, l = c + w[n], d = i[n];
2421
- if (l + d <= u || l >= u + f) continue;
2422
- let p = `${s}:${a}`;
2423
- if (_.has(p)) continue;
2424
- let E = g.get(p), P = E ? E.totalW : d, F = E ? E.totalH : T, I = C(l, P), L = h.get(p), { font: z, fill: B, border: V, xf: H } = er(m, L?.styleIndex ?? 0), U = fn(L, s, a, v, m.dxfs ?? []), te = U.fill ?? B, W = t.tableStyleMap.get(p), ne = m.dxfs ?? [], G = (e) => e == null ? void 0 : ne[e], re = G(W?.wholeTableDxf), ie = G(W?.headerRowDxf), ae = G(W?.totalRowDxf), oe = G(W?.firstColumnDxf), se = G(W?.lastColumnDxf), ce = G(W?.stripeDxf), le = W?.isHeader && ie?.fill?.fgColor ? ie : W?.isTotals && ae?.fill?.fgColor ? ae : W?.isLastCol && se?.fill?.fgColor ? se : W?.isFirstCol && oe?.fill?.fgColor ? oe : ce?.fill?.fgColor ? ce : !W?.isHeader && !W?.isTotals && re?.fill?.fgColor ? re : void 0;
2425
- if (Un(e, te, I, S, P, F) || (W && le?.fill?.fgColor ? (e.fillStyle = R(le.fill.fgColor), e.fillRect(I, S, P, F)) : W && !W.isCustom && W.isBanded && (e.fillStyle = wr(W.accent), e.fillRect(I, S, P, F))), t.commentCells.has(p) && Kn(e, I, S, P, F), U.dataBar && U.dataBar.ratio > 0) {
2426
- let t = Math.max(0, (P - 4) * U.dataBar.ratio);
2427
- Rn(e, U.dataBar.color, I + 2, S + 2, t, F - 4, U.dataBar.gradient);
2422
+ t ? n && M >= 0 && e > M ? (N(e), M = e) : M < 0 && (M = e) : N(e);
2423
+ }
2424
+ for (let n = 0; n < C; n++) {
2425
+ let o = r + n, u = l + E[n], p = a[n];
2426
+ if (u + p <= f || u >= f + m) continue;
2427
+ let h = `${c}:${o}`;
2428
+ if (y.has(h)) continue;
2429
+ let O = v.get(h), M = O ? O.totalW : p, N = O ? O.totalH : D, P = T(u, M), F = _.get(h), { font: L, fill: R, border: z, xf: B } = er(g, F?.styleIndex ?? 0), V = fn(F, c, o, b, g.dxfs ?? []), H = V.fill ?? R, U = t.tableStyleMap.get(h), ne = g.dxfs ?? [], W = (e) => e == null ? void 0 : ne[e], re = W(U?.wholeTableDxf), ie = W(U?.headerRowDxf), ae = W(U?.totalRowDxf), oe = W(U?.firstColumnDxf), se = W(U?.lastColumnDxf), ce = W(U?.stripeDxf), le = U?.isHeader && ie?.fill?.fgColor ? ie : U?.isTotals && ae?.fill?.fgColor ? ae : U?.isLastCol && se?.fill?.fgColor ? se : U?.isFirstCol && oe?.fill?.fgColor ? oe : ce?.fill?.fgColor ? ce : !U?.isHeader && !U?.isTotals && re?.fill?.fgColor ? re : void 0;
2430
+ if (Un(e, H, P, w, M, N) || (U && le?.fill?.fgColor ? (e.fillStyle = J(le.fill.fgColor), e.fillRect(P, w, M, N)) : U && !U.isCustom && U.isBanded && (e.fillStyle = wr(U.accent), e.fillRect(P, w, M, N))), t.commentCells.has(h) && Kn(e, P, w, M, N), V.dataBar && V.dataBar.ratio > 0) {
2431
+ let t = Math.max(0, (M - 4) * V.dataBar.ratio);
2432
+ Rn(e, V.dataBar.color, P + 2, w + 2, t, N - 4, V.dataBar.gradient);
2428
2433
  }
2429
- let ue = t.sparklineMap.get(p);
2430
- if (ue && Oe(e, {
2431
- x: I,
2432
- y: S,
2433
- w: P,
2434
- h: F
2434
+ let ue = t.sparklineMap.get(h);
2435
+ if (ue && De(e, {
2436
+ x: P,
2437
+ y: w,
2438
+ w: M,
2439
+ h: N
2435
2440
  }, ue), t.worksheet.showGridlines !== !1) {
2436
- if (e.strokeStyle = "#d0d0d0", e.lineWidth = .5, e.beginPath(), !O.has(n)) {
2437
- let t = I + P + N(I + P, .5, b);
2438
- e.moveTo(t, S), e.lineTo(t, S + F);
2441
+ if (e.strokeStyle = "#d0d0d0", e.lineWidth = .5, e.beginPath(), !ee.has(n)) {
2442
+ let t = P + M + d(P + M, .5, S);
2443
+ e.moveTo(t, w), e.lineTo(t, w + N);
2439
2444
  }
2440
- let t = S + F + N(S + F, .5, b);
2441
- if (e.moveTo(I, t), e.lineTo(I + P, t), o === 0) {
2442
- let t = S + N(S, .5, b);
2443
- e.moveTo(I, t), e.lineTo(I + P, t);
2445
+ let t = w + N + d(w + N, .5, S);
2446
+ if (e.moveTo(P, t), e.lineTo(P + M, t), s === 0) {
2447
+ let t = w + d(w, .5, S);
2448
+ e.moveTo(P, t), e.lineTo(P + M, t);
2444
2449
  }
2445
2450
  if (n === 0) {
2446
- let t = I + N(I, .5, b);
2447
- e.moveTo(t, S), e.lineTo(t, S + F);
2451
+ let t = P + d(P, .5, S);
2452
+ e.moveTo(t, w), e.lineTo(t, w + N);
2448
2453
  }
2449
2454
  e.stroke();
2450
2455
  }
2451
- let K = Kr(E ? Gr(V, s, a, E.right, E.bottom, h, m) : V, U.border);
2452
- (O.has(n) || M.has(n)) && (K = {
2453
- ...K,
2454
- left: M.has(n) ? null : K.left,
2455
- right: O.has(n) ? null : K.right
2456
+ let G = Kr(O ? Gr(z, c, o, O.right, O.bottom, _, g) : z, V.border);
2457
+ (ee.has(n) || te.has(n)) && (G = {
2458
+ ...G,
2459
+ left: te.has(n) ? null : G.left,
2460
+ right: ee.has(n) ? null : G.right
2456
2461
  });
2457
- let de = h.get(`${s - 1}:${a}`), fe = de ? er(m, de.styleIndex ?? 0).border.bottom : null;
2458
- if (fe?.style && (o === 0 || K.top?.style) && (K = {
2459
- ...K,
2460
- top: Zr(K.top, fe)
2461
- }), !M.has(n)) {
2462
- let e = h.get(`${s}:${a - 1}`), t = e ? er(m, e.styleIndex ?? 0).border.right : null;
2463
- t?.style && (n === 0 || K.left?.style) && (K = {
2464
- ...K,
2465
- left: Zr(K.left, t)
2462
+ let de = _.get(`${c - 1}:${o}`), fe = de ? er(g, de.styleIndex ?? 0).border.bottom : null;
2463
+ if (fe?.style && (s === 0 || G.top?.style) && (G = {
2464
+ ...G,
2465
+ top: Zr(G.top, fe)
2466
+ }), !te.has(n)) {
2467
+ let e = _.get(`${c}:${o - 1}`), t = e ? er(g, e.styleIndex ?? 0).border.right : null;
2468
+ t?.style && (n === 0 || G.left?.style) && (G = {
2469
+ ...G,
2470
+ left: Zr(G.left, t)
2466
2471
  });
2467
2472
  }
2468
- let q = W ? Sr(W, re, ie, a) : null, pe = t.autoFilterCells.has(p), me = () => {
2469
- if (q) {
2470
- if (q.kind === "dxf") qr(e, q.border, I, S, P, F, b);
2471
- else if (q.kind === "accent") {
2472
- let t = .5 / b;
2473
- if (e.strokeStyle = q.color, e.lineWidth = q.lineWidth, e.beginPath(), e.moveTo(I, S + F - t), e.lineTo(I + P, S + F - t), q.topEdge) {
2474
- let t = S + N(S, q.lineWidth, b);
2475
- e.moveTo(I, t), e.lineTo(I + P, t);
2473
+ let K = U ? Sr(U, re, ie, o) : null, pe = t.autoFilterCells.has(h), me = () => {
2474
+ if (K) {
2475
+ if (K.kind === "dxf") qr(e, K.border, P, w, M, N, S);
2476
+ else if (K.kind === "accent") {
2477
+ let t = .5 / S;
2478
+ if (e.strokeStyle = K.color, e.lineWidth = K.lineWidth, e.beginPath(), e.moveTo(P, w + N - t), e.lineTo(P + M, w + N - t), K.topEdge) {
2479
+ let t = w + d(w, K.lineWidth, S);
2480
+ e.moveTo(P, t), e.lineTo(P + M, t);
2476
2481
  }
2477
2482
  e.stroke();
2478
2483
  }
2479
2484
  }
2480
- pe && br(e, I, S, d, F);
2485
+ pe && br(e, P, w, p, N);
2481
2486
  };
2482
- if (E) {
2483
- let t = K;
2484
- A.push(() => qr(e, t, I, S, P, F, b)), me();
2487
+ if (O) {
2488
+ let t = G;
2489
+ A.push(() => qr(e, t, P, w, M, N, S)), me();
2485
2490
  } else {
2486
- let t = K;
2491
+ let t = G;
2487
2492
  j.push(() => {
2488
- qr(e, t, I, S, P, F, b), me();
2493
+ qr(e, t, P, w, M, N, S), me();
2489
2494
  });
2490
2495
  }
2491
- if (!L) continue;
2492
- let he = xt(L, m, U.numFmt, t.worksheet.date1904), J = he.text;
2493
- !J || J === "0" && t.worksheet.showZeros === !1 || k.push(() => {
2494
- let o = W?.isHeader ? ie : W?.isTotals ? ae : W?.isLastCol && se ? se : W?.isFirstCol && oe ? oe : ce || (W ? re : void 0), c = W ? W.isCustom ? !!o?.font?.bold : W.isHeader || W.isTotals : !1, l = z.bold || !!U.fontBold || c, u = z.italic || !!U.fontItalic, d = z.underline || !!U.fontUnderline, f = z.strike || !!U.fontStrike, v = l !== z.bold || u !== z.italic || d !== z.underline || f !== z.strike ? {
2495
- ...z,
2496
- bold: l,
2497
- italic: u,
2498
- underline: d,
2499
- strike: f
2500
- } : z;
2501
- e.font = Yn(v, y);
2502
- let C = t.hyperlinkMap.get(p), w = o?.font?.color ?? null, T = C ? "#0563C1" : U.fontColor ?? he.color ?? w ?? z.color;
2503
- e.fillStyle = T ? R(T) : "#000000";
2504
- let O = L.value.type === "number", k = H.alignH ?? (O ? "right" : "left"), A = H.alignV ?? "bottom", j = H.indent ? Math.round(H.indent * 3 * t.mdw) : 0, M = U.iconSet ? Math.max(8, Math.round(Math.min(P, F) * .55)) : 0, B = M > 0 ? M + 4 : 0, V = 3 + (k === "left" || !H.alignH ? j : 0) + B, te = P, ne = I, G = n;
2505
- if (k === "centerContinuous" && !E) for (let e = n + 1; e < x; e++) {
2506
- let t = `${s}:${r + e}`;
2507
- if (_.has(t) || g.has(t)) break;
2508
- let n = h.get(t);
2509
- if (n && n.value.type !== "empty" || er(m, n?.styleIndex ?? 0).xf.alignH !== "centerContinuous") break;
2510
- te += i[e], G = e;
2496
+ if (!F) continue;
2497
+ let he = xt(F, g, V.numFmt, t.worksheet.date1904), q = he.text;
2498
+ !q || q === "0" && t.worksheet.showZeros === !1 || k.push(() => {
2499
+ let s = U?.isHeader ? ie : U?.isTotals ? ae : U?.isLastCol && se ? se : U?.isFirstCol && oe ? oe : ce || (U ? re : void 0), l = U ? U.isCustom ? !!s?.font?.bold : U.isHeader || U.isTotals : !1, u = L.bold || !!V.fontBold || l, f = L.italic || !!V.fontItalic, p = L.underline || !!V.fontUnderline, m = L.strike || !!V.fontStrike, b = u !== L.bold || f !== L.italic || p !== L.underline || m !== L.strike ? {
2500
+ ...L,
2501
+ bold: u,
2502
+ italic: f,
2503
+ underline: p,
2504
+ strike: m
2505
+ } : L;
2506
+ e.font = Yn(b, x);
2507
+ let T = t.hyperlinkMap.get(h), E = s?.font?.color ?? null, D = T ? "#0563C1" : V.fontColor ?? he.color ?? E ?? L.color;
2508
+ e.fillStyle = D ? J(D) : "#000000";
2509
+ let ee = F.value.type === "number", k = B.alignH ?? (ee ? "right" : "left"), A = B.alignV ?? "bottom", j = B.indent ? Math.round(B.indent * 3 * t.mdw) : 0, te = V.iconSet ? Math.max(8, Math.round(Math.min(M, N) * .55)) : 0, R = te > 0 ? te + 4 : 0, z = 3 + (k === "left" || !B.alignH ? j : 0) + R, H = M, ne = P, W = n;
2510
+ if (k === "centerContinuous" && !O) for (let e = n + 1; e < C; e++) {
2511
+ let t = `${c}:${r + e}`;
2512
+ if (y.has(t) || v.has(t)) break;
2513
+ let n = _.get(t);
2514
+ if (n && n.value.type !== "empty" || er(g, n?.styleIndex ?? 0).xf.alignH !== "centerContinuous") break;
2515
+ H += a[e], W = e;
2511
2516
  }
2512
- let le = k === "centerContinuous" ? ne : I, ue = k === "centerContinuous" ? te : P, K = J.includes("\n");
2513
- if (!E && !H.wrapText && !H.textRotation && !O && !K) {
2514
- let t = e.measureText(J).width, a = k === "centerContinuous", o = a ? t + 6 : t + V + 3, c = a ? te : P;
2515
- if (o > c) {
2516
- let e = o - c, t = 0, l = 0;
2517
- if (k === "right" ? l = e : k === "center" || a ? (l = e / 2, t = e / 2) : t = e, t > 0) {
2518
- let e = t, o = a ? G + 1 : n + 1;
2519
- for (let t = o; t < x && e > 0; t++) {
2520
- let n = `${s}:${r + t}`;
2521
- if (_.has(n) || g.has(n)) break;
2522
- let a = h.get(n);
2523
- if (a && a.value.type !== "empty") break;
2524
- ue += i[t], e -= i[t];
2517
+ let le = k === "centerContinuous" ? ne : P, ue = k === "centerContinuous" ? H : M, G = q.includes("\n");
2518
+ if (!O && !B.wrapText && !B.textRotation && !ee && !G) {
2519
+ let t = e.measureText(q).width, i = k === "centerContinuous", o = i ? t + 6 : t + z + 3, s = i ? H : M;
2520
+ if (o > s) {
2521
+ let e = o - s, t = 0, l = 0;
2522
+ if (k === "right" ? l = e : k === "center" || i ? (l = e / 2, t = e / 2) : t = e, t > 0) {
2523
+ let e = t, o = i ? W + 1 : n + 1;
2524
+ for (let t = o; t < C && e > 0; t++) {
2525
+ let n = `${c}:${r + t}`;
2526
+ if (y.has(n) || v.has(n)) break;
2527
+ let i = _.get(n);
2528
+ if (i && i.value.type !== "empty") break;
2529
+ ue += a[t], e -= a[t];
2525
2530
  }
2526
2531
  }
2527
2532
  if (l > 0) {
2528
2533
  let e = l;
2529
2534
  for (let t = n - 1; t >= 0 && e > 0; t--) {
2530
- let n = `${s}:${r + t}`;
2531
- if (_.has(n) || g.has(n)) break;
2532
- let a = h.get(n);
2533
- if (a && a.value.type !== "empty") break;
2534
- le -= i[t], ue += i[t], e -= i[t];
2535
+ let n = `${c}:${r + t}`;
2536
+ if (y.has(n) || v.has(n)) break;
2537
+ let i = _.get(n);
2538
+ if (i && i.value.type !== "empty") break;
2539
+ le -= a[t], ue += a[t], e -= a[t];
2535
2540
  }
2536
2541
  }
2537
2542
  }
2538
2543
  }
2539
- let de = J, fe = 0;
2540
- if (k === "fill" && !O && J.length > 0) {
2541
- let t = Math.max(1, P - 6), n = e.measureText(J).width;
2544
+ let de = q, fe = 0;
2545
+ if (k === "fill" && !ee && q.length > 0) {
2546
+ let t = Math.max(1, M - 6), n = e.measureText(q).width;
2542
2547
  if (n > 0 && n < t) {
2543
2548
  let e = Math.max(1, Math.floor(t / n));
2544
- de = J.repeat(e);
2549
+ de = q.repeat(e);
2545
2550
  }
2546
2551
  }
2547
- if (k === "distributed" || k === "justify" && !H.wrapText && !K) {
2548
- let t = Math.max(1, P - 6), n = e.measureText(de).width, r = Math.max(1, [...de].length - 1);
2552
+ if (k === "distributed" || k === "justify" && !B.wrapText && !G) {
2553
+ let t = Math.max(1, M - 6), n = e.measureText(de).width, r = Math.max(1, [...de].length - 1);
2549
2554
  n < t && (fe = Math.max(0, (t - n) / r));
2550
2555
  }
2551
- let q, pe;
2552
- k === "right" ? (q = I + P - 3, pe = "right") : k === "center" ? (q = I + P / 2, pe = "center") : k === "centerContinuous" ? (q = ne + te / 2, pe = "center") : k === "distributed" || k === "justify" && !H.wrapText && !K ? (q = I + 3, pe = "left") : (q = I + V, pe = "left");
2553
- let me = H.textRotation ?? 0, ge = me === 255, _e = me > 0 && me !== 255;
2554
- if (U.iconSet && M > 0 && (e.save(), e.beginPath(), e.rect(I, S, P, F), e.clip(), yr(e, U.iconSet.name, U.iconSet.index, I + 2, S + (F - M) / 2, M), e.restore()), e.save(), e.beginPath(), e.rect(le, S, ue, F), e.clip(), ge) {
2555
- let t = Jn(z.size, y, 1.1), n = [...J].length * t, r = A === "top" ? S + 2 : A === "center" ? S + (F - n) / 2 : S + F - n - 2;
2556
+ let K, pe;
2557
+ k === "right" ? (K = P + M - 3, pe = "right") : k === "center" ? (K = P + M / 2, pe = "center") : k === "centerContinuous" ? (K = ne + H / 2, pe = "center") : k === "distributed" || k === "justify" && !B.wrapText && !G ? (K = P + 3, pe = "left") : (K = P + z, pe = "left");
2558
+ let me = B.textRotation ?? 0, ge = me === 255, _e = me > 0 && me !== 255;
2559
+ if (V.iconSet && te > 0 && (e.save(), e.beginPath(), e.rect(P, w, M, N), e.clip(), yr(e, V.iconSet.name, V.iconSet.index, P + 2, w + (N - te) / 2, te), e.restore()), e.save(), e.beginPath(), e.rect(le, w, ue, N), e.clip(), ge) {
2560
+ let t = Jn(L.size, x, 1.1), n = [...q].length * t, r = A === "top" ? w + 2 : A === "center" ? w + (N - n) / 2 : w + N - n - 2;
2556
2561
  e.textAlign = "center", e.textBaseline = "top";
2557
- for (let n of J) {
2558
- let i = n.codePointAt(0) ?? 0, a = D(i) && ee(e, i);
2559
- yn(e, n, I + P / 2, r, t, a), r += t;
2562
+ for (let n of q) {
2563
+ let a = n.codePointAt(0) ?? 0, o = i(a) && I(e, a);
2564
+ yn(e, n, P + M / 2, r, t, o), r += t;
2560
2565
  }
2561
2566
  e.restore();
2562
2567
  return;
2563
2568
  }
2564
2569
  if (_e) {
2565
2570
  let t = me <= 90 ? -(me * Math.PI / 180) : (me - 90) * Math.PI / 180;
2566
- e.translate(I + P / 2, S + F / 2), e.rotate(t), e.textAlign = "center", e.textBaseline = "middle", e.fillText(J, 0, 0), e.restore();
2571
+ e.translate(P + M / 2, w + N / 2), e.rotate(t), e.textAlign = "center", e.textBaseline = "middle", e.fillText(q, 0, 0), e.restore();
2567
2572
  return;
2568
2573
  }
2569
- if (H.shrinkToFit) {
2570
- let t = e.measureText(J).width, n = P - V - 3;
2574
+ if (B.shrinkToFit) {
2575
+ let t = e.measureText(q).width, n = M - z - 3;
2571
2576
  if (t > n && t > 0) {
2572
- let r = n / t, i = k === "right" ? I + P - 3 : k === "center" ? I + P / 2 : I + V;
2577
+ let r = n / t, i = k === "right" ? P + M - 3 : k === "center" ? P + M / 2 : P + z;
2573
2578
  e.transform(r, 0, 0, 1, i * (1 - r), 0);
2574
2579
  }
2575
2580
  }
@@ -2577,88 +2582,90 @@ function Tr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
2577
2582
  e.letterSpacing = `${fe}px`;
2578
2583
  } catch {}
2579
2584
  try {
2580
- e.direction = pn(H.readingOrder, J) ? "rtl" : "ltr";
2585
+ e.direction = pn(B.readingOrder, q) ? "rtl" : "ltr";
2581
2586
  } catch {}
2582
- let ve = L.value.type === "text" ? L.value.runs : void 0, ye = ve && ve.length > 0;
2583
- if (H.wrapText && ye) mr(e, ve, v, {
2587
+ let ve = F.value.type === "text" ? F.value.runs : void 0, ye = ve && ve.length > 0;
2588
+ if (B.wrapText && ye) mr(e, ve, b, {
2584
2589
  alignH: k,
2585
2590
  alignV: A,
2586
- cx: I,
2587
- cy: S,
2588
- cellW: P,
2589
- cellH: F,
2590
- leftPad: V,
2591
+ cx: P,
2592
+ cy: w,
2593
+ cellW: M,
2594
+ cellH: N,
2595
+ leftPad: z,
2591
2596
  paddingX: 3,
2592
2597
  paddingY: 2
2593
- }, y, b, {
2594
- fontColor: U.fontColor,
2595
- readingOrder: H.readingOrder
2598
+ }, x, S, {
2599
+ fontColor: V.fontColor,
2600
+ readingOrder: B.readingOrder
2596
2601
  });
2597
- else if (H.wrapText) {
2598
- let t = tr(e, J, P - V - 3), n = Jn(z.size, y, 1.2, z.name ?? void 0), r = t.length * n, i;
2599
- A === "top" ? (i = S + 2, e.textBaseline = "top") : A === "center" ? (i = S + (F - r) / 2, e.textBaseline = "top") : (i = S + F - r - 2, e.textBaseline = "top");
2600
- for (let r = 0; r < t.length; r++) e.fillText(t[r], q, i + r * n);
2601
- } else if (ye) pr(e, ve, v, {
2602
+ else if (B.wrapText) {
2603
+ let t = tr(e, q, M - z - 3), n = Jn(L.size, x, 1.2, L.name ?? void 0), r = t.length * n, i;
2604
+ A === "top" ? (i = w + 2, e.textBaseline = "top") : A === "center" ? (i = w + (N - r) / 2, e.textBaseline = "top") : (i = w + N - r - 2, e.textBaseline = "top");
2605
+ for (let r = 0; r < t.length; r++) e.fillText(t[r], K, i + r * n);
2606
+ } else if (ye) pr(e, ve, b, {
2602
2607
  alignH: k,
2603
2608
  alignV: A,
2604
- cx: I,
2605
- cy: S,
2606
- cellW: P,
2607
- cellH: F,
2608
- leftPad: V,
2609
+ cx: P,
2610
+ cy: w,
2611
+ cellW: M,
2612
+ cellH: N,
2613
+ leftPad: z,
2609
2614
  paddingX: 3,
2610
2615
  paddingY: 2
2611
- }, y, b, {
2612
- fontColor: U.fontColor,
2613
- readingOrder: H.readingOrder
2616
+ }, x, S, {
2617
+ fontColor: V.fontColor,
2618
+ readingOrder: B.readingOrder
2614
2619
  });
2615
2620
  else {
2616
- let t = v.vertAlign, n = Jn(z.size, y), r = 0;
2621
+ let t = b.vertAlign, n = Jn(L.size, x), r = 0;
2617
2622
  t === "superscript" ? r = -Math.round(n * .35) : t === "subscript" && (r = Math.round(n * .1));
2618
2623
  let i = t ? {
2619
- ...v,
2620
- size: v.size * .65
2621
- } : v;
2622
- t && (e.font = Yn(i, y));
2623
- let a = null, o = () => a ??= e.measureText(J), s = () => {
2624
- let e = Math.min(o().width, ue - V - 3);
2624
+ ...b,
2625
+ size: b.size * .65
2626
+ } : b;
2627
+ t && (e.font = Yn(i, x));
2628
+ let a = null, o = () => a ??= e.measureText(q), s = () => {
2629
+ let e = Math.min(o().width, ue - z - 3);
2625
2630
  return {
2626
- x: k === "right" ? I + P - 3 - e : k === "center" ? I + P / 2 - e / 2 : I + V,
2631
+ x: k === "right" ? P + M - 3 - e : k === "center" ? P + M / 2 - e / 2 : P + z,
2627
2632
  width: e
2628
2633
  };
2629
- }, c = Jn(i.size, y);
2630
- if (v.underline || C) {
2631
- let { x: t, width: n } = s(), i = (A === "top" ? S + 2 + c + 1 : A === "center" ? S + F / 2 + Math.round(c * .55) : S + F - 2 + 1) + r, a = C ? "#0563C1" : T ? R(T) : "#000000", o = v.underlineStyle === "double" || v.underlineStyle === "doubleAccounting";
2632
- Qn(e, t, t + n, i, a, o, b);
2634
+ }, c = Jn(i.size, x);
2635
+ if (b.underline || T) {
2636
+ let { x: t, width: n } = s(), i = (A === "top" ? w + 2 + c + 1 : A === "center" ? w + N / 2 + Math.round(c * .55) : w + N - 2 + 1) + r, a = T ? "#0563C1" : D ? J(D) : "#000000", o = b.underlineStyle === "double" || b.underlineStyle === "doubleAccounting";
2637
+ Qn(e, t, t + n, i, a, o, S);
2633
2638
  }
2634
- if (v.strike) {
2635
- let { x: t, width: n } = s(), i = (A === "top" ? S + 2 + Math.round(c * .5) : A === "center" ? S + F / 2 : S + F - 2 - Math.round(c * .35)) + r, a = i + N(i, .5, b);
2636
- e.save(), e.strokeStyle = T ? R(T) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(t, a), e.lineTo(t + n, a), e.stroke(), e.restore();
2639
+ if (b.strike) {
2640
+ let { x: t, width: n } = s(), i = (A === "top" ? w + 2 + Math.round(c * .5) : A === "center" ? w + N / 2 : w + N - 2 - Math.round(c * .35)) + r, a = i + d(i, .5, S);
2641
+ e.save(), e.strokeStyle = D ? J(D) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(t, a), e.lineTo(t + n, a), e.stroke(), e.restore();
2637
2642
  }
2638
- if (J.includes("\n")) {
2639
- let t = J.split("\n"), n = Jn(z.size, y, 1.2, z.name ?? void 0), i = t.length * n, a;
2640
- A === "top" ? (a = S + 2, e.textBaseline = "top") : A === "center" ? (a = S + (F - i) / 2, e.textBaseline = "top") : (a = S + F - i - 2, e.textBaseline = "top");
2641
- for (let i = 0; i < t.length; i++) e.fillText(t[i], q, a + i * n + r);
2643
+ if (q.includes("\n")) {
2644
+ let t = q.split("\n"), n = Jn(L.size, x, 1.2, L.name ?? void 0), i = t.length * n, a;
2645
+ A === "top" ? (a = w + 2, e.textBaseline = "top") : A === "center" ? (a = w + (N - i) / 2, e.textBaseline = "top") : (a = w + N - i - 2, e.textBaseline = "top");
2646
+ for (let i = 0; i < t.length; i++) e.fillText(t[i], K, a + i * n + r);
2642
2647
  } else {
2643
2648
  let t;
2644
- A === "top" ? (e.textBaseline = "top", t = S + 2) : A === "center" ? (e.textBaseline = "middle", t = S + F / 2) : (e.textBaseline = "bottom", t = S + F - 2), e.fillText(de, q, t + r);
2649
+ A === "top" ? (e.textBaseline = "top", t = w + 2) : A === "center" ? (e.textBaseline = "middle", t = w + N / 2) : (e.textBaseline = "bottom", t = w + N - 2), e.fillText(de, K, t + r);
2645
2650
  }
2646
2651
  }
2647
- let be = L.value.type === "text" ? L.value.phoneticRuns : void 0;
2648
- if (L.showPhonetic && be && be.length > 0 && !J.includes("\n")) {
2649
- let t = Yn(v, y), n = Zn(e, J, t), r;
2650
- r = k === "right" ? I + P - 3 - n : k === "center" ? I + P / 2 - n / 2 : I + V;
2651
- let i = T ? R(T) : "#000000";
2652
- Xn(e, be, L.value.type === "text" ? L.value.phoneticPr : void 0, J, t, m, r, S, y, i);
2652
+ let be = F.value.type === "text" ? F.value.phoneticRuns : void 0;
2653
+ if (F.showPhonetic && be && be.length > 0 && !q.includes("\n")) {
2654
+ let t = Yn(b, x), n = Zn(e, q, t), r;
2655
+ r = k === "right" ? P + M - 3 - n : k === "center" ? P + M / 2 - n / 2 : P + z;
2656
+ let i = D ? J(D) : "#000000";
2657
+ Xn(e, be, F.value.type === "text" ? F.value.phoneticPr : void 0, q, t, g, r, w, x, i);
2653
2658
  }
2654
- e.restore(), J && t.onTextRun && t.onTextRun({
2655
- text: J,
2656
- x: I,
2657
- y: S,
2658
- width: P,
2659
- height: F,
2660
- row: s,
2661
- col: a
2659
+ e.restore(), q && t.onTextRun && t.onTextRun({
2660
+ sheetName: t.worksheet.name,
2661
+ cellRef: vn(c, o),
2662
+ text: q,
2663
+ x: P,
2664
+ y: w,
2665
+ width: M,
2666
+ height: N,
2667
+ row: c,
2668
+ col: o
2662
2669
  });
2663
2670
  });
2664
2671
  }
@@ -2703,108 +2710,108 @@ function Dr(e) {
2703
2710
  function Or(e, t, n, r, i = {}) {
2704
2711
  let a = i.dpr ?? 1, o = i.cellScale ?? 1, s = Z(t), c = e.canvas.width / a, l = e.canvas.height / a;
2705
2712
  e.clearRect(0, 0, c, l), e.fillStyle = "#ffffff", e.fillRect(0, 0, c, l);
2706
- 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 = [];
2707
- for (let e = 1; e <= b; e++) x.push(u(Q(t.colWidths[e] ?? t.defaultColWidth, s)));
2708
- let S = [];
2709
- for (let e = 1; e <= y; e++) S.push(u($(t.rowHeights[e] ?? t.defaultRowHeight)));
2710
- let C = x.reduce((e, t) => e + t, 0), w = S.reduce((e, t) => e + t, 0), T = [];
2711
- for (let e = m; e < m + g; e++) T.push(u(Q(t.colWidths[e] ?? t.defaultColWidth, s)));
2712
- let E = [];
2713
- for (let e = p; e < p + h; e++) E.push(u($(t.rowHeights[e] ?? t.defaultRowHeight)));
2714
- let { cellMap: D, cfContext: O, mergeSkipSet: k, autoFilterCells: A, hyperlinkMap: j, commentCells: M, tableStyleMap: P, sparklineMap: F } = Dr(t), ee = /* @__PURE__ */ new Map();
2713
+ let u = (e) => Math.round(e * o), f = u(50), p = u(22), { row: m, col: h, rows: g, cols: _ } = r, v = (i.scrollOffsetX ?? 0) * o, y = (i.scrollOffsetY ?? 0) * o, b = i.freezeRows ?? 0, x = i.freezeCols ?? 0, S = [];
2714
+ for (let e = 1; e <= x; e++) S.push(u(Q(t.colWidths[e] ?? t.defaultColWidth, s)));
2715
+ let C = [];
2716
+ for (let e = 1; e <= b; e++) C.push(u($(t.rowHeights[e] ?? t.defaultRowHeight)));
2717
+ let w = S.reduce((e, t) => e + t, 0), T = C.reduce((e, t) => e + t, 0), E = [];
2718
+ for (let e = h; e < h + _; e++) E.push(u(Q(t.colWidths[e] ?? t.defaultColWidth, s)));
2719
+ let D = [];
2720
+ for (let e = m; e < m + g; e++) D.push(u($(t.rowHeights[e] ?? t.defaultRowHeight)));
2721
+ let { cellMap: O, cfContext: ee, mergeSkipSet: k, autoFilterCells: A, hyperlinkMap: j, commentCells: te, tableStyleMap: M, sparklineMap: N } = Dr(t), P = /* @__PURE__ */ new Map();
2715
2722
  for (let e of t.mergeCells ?? []) {
2716
2723
  let n = 0;
2717
2724
  for (let r = e.left; r <= e.right; r++) n += u(Q(t.colWidths[r] ?? t.defaultColWidth, s));
2718
2725
  let r = 0;
2719
2726
  for (let n = e.top; n <= e.bottom; n++) r += u($(t.rowHeights[n] ?? t.defaultRowHeight));
2720
- ee.set(`${e.top}:${e.left}`, {
2727
+ P.set(`${e.top}:${e.left}`, {
2721
2728
  totalW: n,
2722
2729
  totalH: r,
2723
2730
  right: e.right,
2724
2731
  bottom: e.bottom
2725
2732
  });
2726
2733
  }
2727
- let I = {
2734
+ let F = {
2728
2735
  worksheet: t,
2729
2736
  styles: n,
2730
- cellMap: D,
2731
- mergeAnchorMap: ee,
2737
+ cellMap: O,
2738
+ mergeAnchorMap: P,
2732
2739
  mergeSkipSet: k,
2733
- cfContext: O,
2734
- colWidths: T,
2735
- rowHeights: E,
2736
- frozenColWidths: x,
2737
- frozenRowHeights: S,
2738
- frozenW: C,
2739
- frozenH: w,
2740
- startRow: p,
2741
- startCol: m,
2740
+ cfContext: ee,
2741
+ colWidths: E,
2742
+ rowHeights: D,
2743
+ frozenColWidths: S,
2744
+ frozenRowHeights: C,
2745
+ frozenW: w,
2746
+ frozenH: T,
2747
+ startRow: m,
2748
+ startCol: h,
2742
2749
  cs: o,
2743
2750
  dpr: a,
2744
2751
  autoFilterCells: A,
2745
2752
  hyperlinkMap: j,
2746
- commentCells: M,
2747
- tableStyleMap: P,
2748
- sparklineMap: F,
2753
+ commentCells: te,
2754
+ tableStyleMap: M,
2755
+ sparklineMap: N,
2749
2756
  mdw: s,
2750
2757
  onTextRun: i.onTextRun,
2751
2758
  rtl: t.rightToLeft === !0,
2752
2759
  canvasW: c
2753
- }, L = d, R = f, z = L + C, B = R + w, V = Math.max(0, c - z), H = Math.max(0, l - B);
2754
- y > 0 && b > 0 && Tr(e, I, 1, 1, x, S, 0, 0, L, R, L, R, C, w), y > 0 && Tr(e, I, 1, m, T, S, _, 0, z, R, z, R, V, w), b > 0 && Tr(e, I, p, 1, x, E, 0, v, L, B, L, B, C, H), Tr(e, I, p, m, T, E, _, v, z, B, z, B, V, H), t.images && t.images.length > 0 && i.loadedImages && Mr(e, t, i.loadedImages, o, p, m, _, v, z, B, V, H, t.rightToLeft === !0, c), t.shapeGroups && t.shapeGroups.length > 0 && Nr(e, t, o, p, m, _, v, z, B, V, H, i.loadedImages, t.rightToLeft === !0, c), t.charts && t.charts.length > 0 && Qr(e, t, o, p, m, _, v, z, B, V, H, t.rightToLeft === !0, c), t.slicers && t.slicers.length > 0 && di(e, t, o, p, m, _, v, z, B, V, H, t.rightToLeft === !0, c), kr(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);
2755
- let U = t.rightToLeft === !0;
2756
- if (y > 0) {
2760
+ }, I = f, L = p, R = I + w, z = L + T, B = Math.max(0, c - R), V = Math.max(0, l - z);
2761
+ b > 0 && x > 0 && Tr(e, F, 1, 1, S, C, 0, 0, I, L, I, L, w, T), b > 0 && Tr(e, F, 1, h, E, C, v, 0, R, L, R, L, B, T), x > 0 && Tr(e, F, m, 1, S, D, 0, y, I, z, I, z, w, V), Tr(e, F, m, h, E, D, v, y, R, z, R, z, B, V), t.images && t.images.length > 0 && i.loadedImages && Mr(e, t, i.loadedImages, o, m, h, v, y, R, z, B, V, t.rightToLeft === !0, c), t.shapeGroups && t.shapeGroups.length > 0 && Nr(e, t, o, m, h, v, y, R, z, B, V, i.loadedImages, t.rightToLeft === !0, c), t.charts && t.charts.length > 0 && Qr(e, t, o, m, h, v, y, R, z, B, V, t.rightToLeft === !0, c), t.slicers && t.slicers.length > 0 && di(e, t, o, m, h, v, y, R, z, B, V, t.rightToLeft === !0, c), kr(e, c, l, m, h, g, _, E, D, v, y, S, C, w, T, f, p, o, a, i.selectedRowRange ?? null, i.selectedColRange ?? null, t.rightToLeft === !0);
2762
+ let H = t.rightToLeft === !0;
2763
+ if (b > 0) {
2757
2764
  e.save(), e.strokeStyle = Mn, e.lineWidth = .5, e.beginPath();
2758
- let t = B + N(B, .5, a);
2759
- U ? (e.moveTo(0, t), e.lineTo(c - d, t)) : (e.moveTo(d, t), e.lineTo(c, t)), e.stroke(), e.restore();
2765
+ let t = z + d(z, .5, a);
2766
+ H ? (e.moveTo(0, t), e.lineTo(c - f, t)) : (e.moveTo(f, t), e.lineTo(c, t)), e.stroke(), e.restore();
2760
2767
  }
2761
- if (b > 0) {
2768
+ if (x > 0) {
2762
2769
  e.save(), e.strokeStyle = Mn, e.lineWidth = .5, e.beginPath();
2763
- let t = U ? c - z : z, n = t + N(t, .5, a);
2764
- e.moveTo(n, f), e.lineTo(n, l), e.stroke(), e.restore();
2765
- }
2766
- }
2767
- function kr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x) {
2768
- 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 ${Cn}`, P = h + p, F = g + m, ee = .5 / v, I = (e, n) => x ? An(e, n, t) : e, L = x ? t - h : 0;
2769
- e.fillStyle = S, e.fillRect(L, 0, h, g), e.strokeStyle = T, e.lineWidth = .5, e.beginPath();
2770
- let R = L + N(L, .5, v), z = N(0, .5, v);
2771
- e.moveTo(R, 0), e.lineTo(R, g), e.moveTo(L, z), e.lineTo(L + h, z), e.moveTo(L + h - ee, 0), e.lineTo(L + h - ee, g), e.moveTo(L, g - ee), e.lineTo(L + h, g - ee), e.stroke(), e.font = M, e.fillStyle = D;
2772
- let B = (t, n, r) => {
2773
- let i = I(n, r);
2774
- e.fillStyle = O(t), e.fillRect(i, 0, r, g), e.strokeStyle = k(t), e.lineWidth = .5, e.beginPath();
2775
- let a = i + N(i, .5, v), o = N(0, .5, v);
2776
- e.moveTo(a, 0), e.lineTo(a, g), e.moveTo(i, g - ee), e.lineTo(i + r, g - ee), e.moveTo(i, o), e.lineTo(i + r, o), e.stroke(), e.fillStyle = D, e.textAlign = "center", e.textBaseline = "middle", e.fillText(hr(t), i + r / 2, g / 2);
2777
- }, V = (t, n, r) => {
2778
- let i = L;
2779
- e.fillStyle = A(t), e.fillRect(i, n, h, r), e.strokeStyle = j(t), e.lineWidth = .5, e.beginPath();
2780
- let a = n + N(n, .5, v), o = i + N(i, .5, v);
2781
- e.moveTo(i + h - ee, n), e.lineTo(i + h - ee, n + r), e.moveTo(i, a), e.lineTo(i + h, a), e.moveTo(o, n), e.lineTo(o, n + r), e.stroke(), e.fillStyle = D, e.textBaseline = "middle";
2782
- let s = Math.max(2, Math.round(4 * _));
2783
- x ? (e.textAlign = "left", e.fillText(String(t), i + s, n + r / 2)) : (e.textAlign = "right", e.fillText(String(t), i + h - s, n + r / 2));
2770
+ let t = H ? c - R : R, n = t + d(t, .5, a);
2771
+ e.moveTo(n, p), e.lineTo(n, l), e.stroke(), e.restore();
2772
+ }
2773
+ }
2774
+ function kr(e, t, n, r, i, a, o, s, c, l, u, f, p, m, h, g, _, v, y, b, x, S) {
2775
+ let C = "#f8f9fa", w = "#e8eaed", T = "#caddf6", E = "#c8ccd0", D = "#5b9bd5", O = "#444", ee = (e) => !x || e < x.start || e > x.end ? C : x.strong ? T : w, k = (e) => !x || e < x.start || e > x.end ? E : x.strong ? D : E, A = (e) => !b || e < b.start || e > b.end ? C : b.strong ? T : w, j = (e) => !b || e < b.start || e > b.end ? E : b.strong ? D : E, te = `${Math.max(1, Math.round(11 * v))}px ${Cn}`, M = g + m, N = _ + h, P = .5 / y, F = (e, n) => S ? An(e, n, t) : e, I = S ? t - g : 0;
2776
+ e.fillStyle = C, e.fillRect(I, 0, g, _), e.strokeStyle = E, e.lineWidth = .5, e.beginPath();
2777
+ let L = I + d(I, .5, y), R = d(0, .5, y);
2778
+ e.moveTo(L, 0), e.lineTo(L, _), e.moveTo(I, R), e.lineTo(I + g, R), e.moveTo(I + g - P, 0), e.lineTo(I + g - P, _), e.moveTo(I, _ - P), e.lineTo(I + g, _ - P), e.stroke(), e.font = te, e.fillStyle = O;
2779
+ let z = (t, n, r) => {
2780
+ let i = F(n, r);
2781
+ e.fillStyle = ee(t), e.fillRect(i, 0, r, _), e.strokeStyle = k(t), e.lineWidth = .5, e.beginPath();
2782
+ let a = i + d(i, .5, y), o = d(0, .5, y);
2783
+ e.moveTo(a, 0), e.lineTo(a, _), e.moveTo(i, _ - P), e.lineTo(i + r, _ - P), e.moveTo(i, o), e.lineTo(i + r, o), e.stroke(), e.fillStyle = O, e.textAlign = "center", e.textBaseline = "middle", e.fillText(hr(t), i + r / 2, _ / 2);
2784
+ }, B = (t, n, r) => {
2785
+ let i = I;
2786
+ e.fillStyle = A(t), e.fillRect(i, n, g, r), e.strokeStyle = j(t), e.lineWidth = .5, e.beginPath();
2787
+ let a = n + d(n, .5, y), o = i + d(i, .5, y);
2788
+ e.moveTo(i + g - P, n), e.lineTo(i + g - P, n + r), e.moveTo(i, a), e.lineTo(i + g, a), e.moveTo(o, n), e.lineTo(o, n + r), e.stroke(), e.fillStyle = O, e.textBaseline = "middle";
2789
+ let s = Math.max(2, Math.round(4 * v));
2790
+ S ? (e.textAlign = "left", e.fillText(String(t), i + s, n + r / 2)) : (e.textAlign = "right", e.fillText(String(t), i + g - s, n + r / 2));
2784
2791
  };
2785
- if (d.length > 0) {
2786
- e.save(), e.beginPath(), e.rect(I(h, p), 0, p, g), e.clip();
2787
- let t = h;
2788
- for (let e = 0; e < d.length; e++) B(e + 1, t, d[e]), t += d[e];
2792
+ if (f.length > 0) {
2793
+ e.save(), e.beginPath(), e.rect(F(g, m), 0, m, _), e.clip();
2794
+ let t = g;
2795
+ for (let e = 0; e < f.length; e++) z(e + 1, t, f[e]), t += f[e];
2789
2796
  e.restore();
2790
2797
  }
2791
- e.save(), e.beginPath(), e.rect(I(P, t - P), 0, t - P, g), e.clip();
2792
- let H = P - l;
2798
+ e.save(), e.beginPath(), e.rect(F(M, t - M), 0, t - M, _), e.clip();
2799
+ let V = M - l;
2793
2800
  for (let e = 0; e < s.length; e++) {
2794
2801
  let n = s[e];
2795
- H + n > P && H < t && B(i + e, H, n), H += n;
2802
+ V + n > M && V < t && z(i + e, V, n), V += n;
2796
2803
  }
2797
- if (e.restore(), f.length > 0) {
2798
- e.save(), e.beginPath(), e.rect(L, g, h, m), e.clip();
2799
- let t = g;
2800
- for (let e = 0; e < f.length; e++) V(e + 1, t, f[e]), t += f[e];
2804
+ if (e.restore(), p.length > 0) {
2805
+ e.save(), e.beginPath(), e.rect(I, _, g, h), e.clip();
2806
+ let t = _;
2807
+ for (let e = 0; e < p.length; e++) B(e + 1, t, p[e]), t += p[e];
2801
2808
  e.restore();
2802
2809
  }
2803
- e.save(), e.beginPath(), e.rect(L, F, h, n - F), e.clip();
2804
- let U = F - u;
2810
+ e.save(), e.beginPath(), e.rect(I, N, g, n - N), e.clip();
2811
+ let H = N - u;
2805
2812
  for (let e = 0; e < c.length; e++) {
2806
2813
  let t = c[e];
2807
- U + t > F && U < n && V(r + e, U, t), U += t;
2814
+ H + t > N && H < n && B(r + e, H, t), H += t;
2808
2815
  }
2809
2816
  e.restore();
2810
2817
  }
@@ -2818,104 +2825,104 @@ function jr(e, t, n) {
2818
2825
  for (let i = 1; i < t; i++) r += Math.round($(e.rowHeights[i] ?? e.defaultRowHeight) * n);
2819
2826
  return r;
2820
2827
  }
2821
- function Mr(n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
2822
- if (f <= 0 || p <= 0) return;
2823
- let g = Ar(r, s, a), _ = jr(r, o, a);
2824
- n.save(), n.beginPath();
2825
- let v = jn(u, f, h, m);
2826
- n.rect(v, d, f, p), n.clip();
2827
- for (let o of r.images) {
2828
- let s = i.get(bn(o.imagePath, o.duotone));
2829
- if (!s) continue;
2830
- let y = o.fromCol + 1, b = o.fromRow + 1, x = Ar(r, y, a) + o.fromColOff * a / t, S = jr(r, b, a) + o.fromRowOff * a / t, C, w;
2831
- if (o.editAs === "oneCell" && o.nativeExtCx > 0 && o.nativeExtCy > 0) C = o.nativeExtCx * a / t, w = o.nativeExtCy * a / t;
2828
+ function Mr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
2829
+ if (u <= 0 || d <= 0) return;
2830
+ let m = Ar(t, a, r), h = jr(t, i, r);
2831
+ e.save(), e.beginPath();
2832
+ let g = jn(c, u, p, f);
2833
+ e.rect(g, l, u, d), e.clip();
2834
+ for (let i of t.images) {
2835
+ let a = n.get(bn(i.imagePath, i.duotone));
2836
+ if (!a) continue;
2837
+ let _ = i.fromCol + 1, v = i.fromRow + 1, y = Ar(t, _, r) + i.fromColOff * r / W, b = jr(t, v, r) + i.fromRowOff * r / W, x, S;
2838
+ if (i.editAs === "oneCell" && i.nativeExtCx > 0 && i.nativeExtCy > 0) x = i.nativeExtCx * r / W, S = i.nativeExtCy * r / W;
2832
2839
  else {
2833
- let e = o.toCol + 1, n = o.toRow + 1, i = Ar(r, e, a) + o.toColOff * a / t, s = jr(r, n, a) + o.toRowOff * a / t;
2834
- C = i - x, w = s - S;
2840
+ let e = i.toCol + 1, n = i.toRow + 1, a = Ar(t, e, r) + i.toColOff * r / W, o = jr(t, n, r) + i.toRowOff * r / W;
2841
+ x = a - y, S = o - b;
2835
2842
  }
2836
- if (C <= 0 || w <= 0) continue;
2837
- let T = jn(u + (x - g) - c, C, h, m), E = d + (S - _) - l;
2838
- T + C < v || T > v + f || E + w < d || E > d + p || (o.alpha != null && o.alpha < 1 ? (n.save(), n.globalAlpha = o.alpha, e(n, s, o.srcRect, T, E, C, w), n.restore()) : e(n, s, o.srcRect, T, E, C, w));
2843
+ if (x <= 0 || S <= 0) continue;
2844
+ let C = jn(c + (y - m) - o, x, p, f), w = l + (b - h) - s;
2845
+ C + x < g || C > g + u || w + S < l || w > l + d || (i.alpha != null && i.alpha < 1 ? (e.save(), e.globalAlpha = i.alpha, V(e, a, i.srcRect, C, w, x, S), e.restore()) : V(e, a, i.srcRect, C, w, x, S));
2839
2846
  }
2840
- n.restore();
2847
+ e.restore();
2841
2848
  }
2842
- function Nr(e, n, r, i, a, o, s, c, l, u, d, f, p, m) {
2843
- if (u <= 0 || d <= 0) return;
2844
- let h = n.shapeGroups;
2845
- if (!h || h.length === 0) return;
2846
- let g = Ar(n, a, r), _ = jr(n, i, r);
2849
+ function Nr(e, t, n, r, i, a, o, s, c, l, u, d, f, p) {
2850
+ if (l <= 0 || u <= 0) return;
2851
+ let m = t.shapeGroups;
2852
+ if (!m || m.length === 0) return;
2853
+ let h = Ar(t, i, n), g = jr(t, r, n);
2847
2854
  e.save(), e.beginPath();
2848
- let v = jn(c, u, m, p);
2849
- e.rect(v, l, u, d), e.clip();
2850
- for (let i of h) {
2851
- let a = i.fromCol + 1, h = i.fromRow + 1, y = Ar(n, a, r) + i.fromColOff * r / t, b = jr(n, h, r) + i.fromRowOff * r / t, x, S;
2852
- if (i.editAs === "oneCell" && i.nativeExtCx > 0 && i.nativeExtCy > 0) x = i.nativeExtCx * r / t, S = i.nativeExtCy * r / t;
2855
+ let _ = jn(s, l, p, f);
2856
+ e.rect(_, c, l, u), e.clip();
2857
+ for (let r of m) {
2858
+ let i = r.fromCol + 1, m = r.fromRow + 1, v = Ar(t, i, n) + r.fromColOff * n / W, y = jr(t, m, n) + r.fromRowOff * n / W, b, x;
2859
+ if (r.editAs === "oneCell" && r.nativeExtCx > 0 && r.nativeExtCy > 0) b = r.nativeExtCx * n / W, x = r.nativeExtCy * n / W;
2853
2860
  else {
2854
- let e = i.toCol + 1, a = i.toRow + 1, o = Ar(n, e, r) + i.toColOff * r / t, s = jr(n, a, r) + i.toRowOff * r / t;
2855
- x = o - y, S = s - b;
2861
+ let e = r.toCol + 1, i = r.toRow + 1, a = Ar(t, e, n) + r.toColOff * n / W, o = jr(t, i, n) + r.toRowOff * n / W;
2862
+ b = a - v, x = o - y;
2856
2863
  }
2857
- if (x <= 0 || S <= 0) continue;
2858
- let C = jn(c + (y - g) - o, x, m, p), w = l + (b - _) - s;
2859
- if (!(C + x < v || C > v + u) && !(w + S < l || w > l + d)) for (let t of i.shapes) {
2860
- let n = C + t.x * x, i = w + t.y * S, a = t.w * x, o = t.h * S;
2861
- a <= 0 || o <= 0 || Pr(e, t, n, i, a, o, r, f);
2864
+ if (b <= 0 || x <= 0) continue;
2865
+ let S = jn(s + (v - h) - a, b, p, f), C = c + (y - g) - o;
2866
+ if (!(S + b < _ || S > _ + l) && !(C + x < c || C > c + u)) for (let t of r.shapes) {
2867
+ let r = S + t.x * b, i = C + t.y * x, a = t.w * b, o = t.h * x;
2868
+ a <= 0 || o <= 0 || Pr(e, t, r, i, a, o, n, d);
2862
2869
  }
2863
2870
  }
2864
2871
  e.restore();
2865
2872
  }
2866
- function Pr(n, r, i, a, o, s, c, l) {
2867
- if (n.save(), r.rot !== 0 || r.flipH || r.flipV ? (n.translate(i + o / 2, a + s / 2), n.rotate(r.rot * Math.PI / 180), n.scale(r.flipH ? -1 : 1, r.flipV ? -1 : 1), n.translate(-o / 2, -s / 2)) : n.translate(i, a), r.geom.type === "custom") for (let e of r.geom.paths) {
2868
- if (e.w <= 0 || e.h <= 0) continue;
2869
- let t = o / e.w, i = s / e.h;
2870
- n.beginPath();
2871
- let a = 0, c = 0, l = 0, u = 0;
2872
- for (let r of e.commands) switch (r.op) {
2873
+ function Pr(e, t, n, r, i, a, o, s) {
2874
+ if (e.save(), t.rot !== 0 || t.flipH || t.flipV ? (e.translate(n + i / 2, r + a / 2), e.rotate(t.rot * Math.PI / 180), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), e.translate(-i / 2, -a / 2)) : e.translate(n, r), t.geom.type === "custom") for (let n of t.geom.paths) {
2875
+ if (n.w <= 0 || n.h <= 0) continue;
2876
+ let r = i / n.w, o = a / n.h;
2877
+ e.beginPath();
2878
+ let s = 0, c = 0, l = 0, u = 0;
2879
+ for (let t of n.commands) switch (t.op) {
2873
2880
  case "moveTo": {
2874
- let e = r.x * t, o = r.y * i;
2875
- n.moveTo(e, o), a = l = e, c = u = o;
2881
+ let n = t.x * r, i = t.y * o;
2882
+ e.moveTo(n, i), s = l = n, c = u = i;
2876
2883
  break;
2877
2884
  }
2878
2885
  case "lineTo": {
2879
- let e = r.x * t, o = r.y * i;
2880
- n.lineTo(e, o), a = e, c = o;
2886
+ let n = t.x * r, i = t.y * o;
2887
+ e.lineTo(n, i), s = n, c = i;
2881
2888
  break;
2882
2889
  }
2883
2890
  case "cubicBezTo": {
2884
- let e = r.x3 * t, o = r.y3 * i;
2885
- n.bezierCurveTo(r.x1 * t, r.y1 * i, r.x2 * t, r.y2 * i, e, o), a = e, c = o;
2891
+ let n = t.x3 * r, i = t.y3 * o;
2892
+ e.bezierCurveTo(t.x1 * r, t.y1 * o, t.x2 * r, t.y2 * o, n, i), s = n, c = i;
2886
2893
  break;
2887
2894
  }
2888
2895
  case "quadBezTo": {
2889
- let e = r.x2 * t, o = r.y2 * i;
2890
- n.quadraticCurveTo(r.x1 * t, r.y1 * i, e, o), a = e, c = o;
2896
+ let n = t.x2 * r, i = t.y2 * o;
2897
+ e.quadraticCurveTo(t.x1 * r, t.y1 * o, n, i), s = n, c = i;
2891
2898
  break;
2892
2899
  }
2893
2900
  case "arcTo": {
2894
- let e = r.wr * t, o = r.hr * i;
2895
- if (e <= 0 || o <= 0) break;
2896
- let s = r.stAng / 6e4 * (Math.PI / 180), l = r.swAng / 6e4 * (Math.PI / 180), u = a - Math.cos(s) * e, d = c - Math.sin(s) * o, f = s + l;
2897
- n.ellipse(u, d, e, o, 0, s, f, l < 0), a = u + Math.cos(f) * e, c = d + Math.sin(f) * o;
2901
+ let n = t.wr * r, i = t.hr * o;
2902
+ if (n <= 0 || i <= 0) break;
2903
+ 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;
2904
+ e.ellipse(u, d, n, i, 0, a, f, l < 0), s = u + Math.cos(f) * n, c = d + Math.sin(f) * i;
2898
2905
  break;
2899
2906
  }
2900
2907
  case "close":
2901
- n.closePath(), a = l, c = u;
2908
+ e.closePath(), s = l, c = u;
2902
2909
  break;
2903
2910
  }
2904
- Wr(n, r);
2911
+ Wr(e, t);
2905
2912
  }
2906
- else if (r.geom.type === "preset") {
2907
- let e = r.fillColor ?? null, i = r.strokeColor && r.strokeWidth > 0 ? () => {
2908
- n.strokeStyle = r.strokeColor, n.lineWidth = Math.max(.5, r.strokeWidth / t), n.stroke();
2913
+ else if (t.geom.type === "preset") {
2914
+ let n = t.fillColor ?? null, r = t.strokeColor && t.strokeWidth > 0 ? () => {
2915
+ e.strokeStyle = t.strokeColor, e.lineWidth = Math.max(.5, t.strokeWidth / W), e.stroke();
2909
2916
  } : null;
2910
- K(n, r.geom.name, 0, 0, o, s, r.geom.adj ?? [], e, i, () => {}) || (n.beginPath(), n.rect(0, 0, o, s), Wr(n, r));
2911
- } else if (r.geom.type === "image") {
2912
- let t = l?.get(bn(r.geom.imagePath, r.geom.duotone));
2913
- if (t) {
2914
- let i = r.geom.alpha;
2915
- i != null && i < 1 ? (n.save(), n.globalAlpha = i, e(n, t, r.geom.srcRect, 0, 0, o, s), n.restore()) : e(n, t, r.geom.srcRect, 0, 0, o, s);
2917
+ ce(e, t.geom.name, 0, 0, i, a, t.geom.adj ?? [], n, r, () => {}) || (e.beginPath(), e.rect(0, 0, i, a), Wr(e, t));
2918
+ } else if (t.geom.type === "image") {
2919
+ let n = s?.get(bn(t.geom.imagePath, t.geom.duotone));
2920
+ if (n) {
2921
+ let r = t.geom.alpha;
2922
+ r != null && r < 1 ? (e.save(), e.globalAlpha = r, V(e, n, t.geom.srcRect, 0, 0, i, a), e.restore()) : V(e, n, t.geom.srcRect, 0, 0, i, a);
2916
2923
  }
2917
2924
  }
2918
- r.text && Ur(n, r.text, o, s, c), n.restore();
2925
+ t.text && Ur(e, t.text, i, a, o), e.restore();
2919
2926
  }
2920
2927
  var Fr = /* @__PURE__ */ new WeakMap();
2921
2928
  function Ir(e, t) {
@@ -2954,7 +2961,7 @@ async function Hr(e, t) {
2954
2961
  if (n.length !== 0) {
2955
2962
  await t.loadMathJax();
2956
2963
  for (let e of n) if (!Fr.has(e.nodes)) try {
2957
- let n = await t.mathMLToSvg(de(e.nodes, e.display)), r = await Lr(zr(Ee(n.svg, "#000000"), n.widthEm, n.ascentEm + n.descentEm));
2964
+ let n = await t.mathMLToSvg(h(e.nodes, e.display)), r = await Lr(zr(Ee(n.svg, "#000000"), n.widthEm, n.ascentEm + n.descentEm));
2958
2965
  Fr.set(e.nodes, {
2959
2966
  img: r,
2960
2967
  widthEm: n.widthEm,
@@ -2965,42 +2972,42 @@ async function Hr(e, t) {
2965
2972
  } catch {}
2966
2973
  }
2967
2974
  }
2968
- function Ur(e, n, r, i, a) {
2969
- if (r <= 0 || i <= 0 || n.paragraphs.length === 0) return;
2970
- let o = n.lIns / t * a, s = n.rIns / t * a, c = n.tIns / t * a, l = n.bIns / t * a, u = Math.max(0, r - o - s), d = Math.max(0, i - c - l);
2971
- if (u <= 0 || d <= 0) return;
2972
- let f = (e) => {
2973
- let t = (e.size > 0 ? e.size : On) * G * a, n = Dn(e.fontFace);
2975
+ function Ur(e, t, n, r, i) {
2976
+ if (n <= 0 || r <= 0 || t.paragraphs.length === 0) return;
2977
+ let a = t.lIns / W * i, o = t.rIns / W * i, s = t.tIns / W * i, c = t.bIns / W * i, l = Math.max(0, n - a - o), u = Math.max(0, r - s - c);
2978
+ if (l <= 0 || u <= 0) return;
2979
+ let d = (e) => {
2980
+ let t = (e.size > 0 ? e.size : On) * x * i, n = Dn(e.fontFace);
2974
2981
  return {
2975
2982
  font: `${e.italic ? "italic " : ""}${e.bold ? "bold " : ""}${t}px ${n}`,
2976
2983
  px: t
2977
2984
  };
2978
- }, p = (t, n) => {
2985
+ }, f = (t, n) => {
2979
2986
  let r = e.font;
2980
2987
  e.font = t;
2981
2988
  let i = e.measureText("M").actualBoundingBoxAscent;
2982
2989
  return e.font = r, i > 0 ? i : n * .85;
2983
- }, m = n.wrap !== "none", h = [];
2984
- for (let r of n.paragraphs) {
2985
- let i = r.align || "l", o = (r.marL ?? 0) / t * a, s = (r.marR ?? 0) / t * a, c = (r.indent ?? 0) / t * a, l = Math.max(0, c), d = Math.max(0, u - o - s), g = !1, _ = () => g ? o : o + l, v = () => g ? d : d - l, y = [], b = 0, x = 0, S = 0, C = !1, w = (e) => {
2986
- let t = e;
2987
- return r.spaceLine && (r.spaceLine.type === "pct" ? t *= r.spaceLine.val / 1e5 : t = r.spaceLine.val * G * a), n.autoFit === "norm" && n.lnSpcReduction != null && r.spaceLine?.type !== "pts" && (t *= 1 - n.lnSpcReduction), t;
2990
+ }, p = t.wrap !== "none", m = [];
2991
+ for (let n of t.paragraphs) {
2992
+ let r = n.align || "l", a = (n.marL ?? 0) / W * i, o = (n.marR ?? 0) / W * i, s = (n.indent ?? 0) / W * i, c = Math.max(0, s), u = Math.max(0, l - a - o), h = !1, g = () => h ? a : a + c, _ = () => h ? u : u - c, v = [], y = 0, b = 0, S = 0, C = !1, w = (e) => {
2993
+ let r = e;
2994
+ return n.spaceLine && (n.spaceLine.type === "pct" ? r *= n.spaceLine.val / 1e5 : r = n.spaceLine.val * x * i), t.autoFit === "norm" && t.lnSpcReduction != null && n.spaceLine?.type !== "pts" && (r *= 1 - t.lnSpcReduction), r;
2988
2995
  }, T = () => {
2989
- if (x === 0) {
2990
- let e = (E || On) * G * a, t = Math.max(le(D, e), le(O, e));
2991
- x = Math.max(e * 1.2, t), S = p(`${e}px ${Dn(D)}`, e);
2996
+ if (b === 0) {
2997
+ let e = (E || On) * x * i, t = Math.max(G(D, e), G(O, e));
2998
+ b = Math.max(e * 1.2, t), S = f(`${e}px ${Dn(D)}`, e);
2992
2999
  }
2993
- x = w(x), h.push({
2994
- segs: y,
2995
- align: i,
2996
- height: x,
3000
+ b = w(b), m.push({
3001
+ segs: v,
3002
+ align: r,
3003
+ height: b,
2997
3004
  ascent: S,
2998
3005
  hasMath: C,
2999
- leftInset: _(),
3000
- availW: v()
3001
- }), g = !0, y = [], b = 0, x = 0, S = 0, C = !1;
3006
+ leftInset: g(),
3007
+ availW: _()
3008
+ }), h = !0, v = [], y = 0, b = 0, S = 0, C = !1;
3002
3009
  }, E = 0, D, O;
3003
- for (let t of r.runs) {
3010
+ for (let t of n.runs) {
3004
3011
  if (t.type === "break") {
3005
3012
  T();
3006
3013
  continue;
@@ -3008,94 +3015,94 @@ function Ur(e, n, r, i, a) {
3008
3015
  if (t.type === "math") {
3009
3016
  let e = Fr.get(t.nodes);
3010
3017
  if (!e) continue;
3011
- let n = (t.fontSize ?? (E || On)) * G * a, r = e.widthEm * n, s = e.ascentEm * n, c = e.descentEm * n, l = t.color ?? "#000000";
3018
+ let n = (t.fontSize ?? (E || On)) * x * i, o = e.widthEm * n, s = e.ascentEm * n, c = e.descentEm * n, l = t.color ?? "#000000";
3012
3019
  if (t.display) {
3013
- T(), h.push({
3020
+ T(), m.push({
3014
3021
  segs: [{
3015
3022
  kind: "math",
3016
3023
  render: e,
3017
3024
  color: l,
3018
- w: r,
3025
+ w: o,
3019
3026
  ascent: s,
3020
3027
  descent: c
3021
3028
  }],
3022
- align: i,
3029
+ align: r,
3023
3030
  height: w(s + c),
3024
3031
  ascent: s,
3025
3032
  hasMath: !0,
3026
- leftInset: o,
3027
- availW: d
3028
- }), g = !0;
3033
+ leftInset: a,
3034
+ availW: u
3035
+ }), h = !0;
3029
3036
  continue;
3030
3037
  }
3031
- m && b + r > v() && y.length > 0 && T(), y.push({
3038
+ p && y + o > _() && v.length > 0 && T(), v.push({
3032
3039
  kind: "math",
3033
3040
  render: e,
3034
3041
  color: l,
3035
- w: r,
3042
+ w: o,
3036
3043
  ascent: s,
3037
3044
  descent: c
3038
- }), b += r, x = Math.max(x, s + c), S = Math.max(S, s), C = !0;
3045
+ }), y += o, b = Math.max(b, s + c), S = Math.max(S, s), C = !0;
3039
3046
  continue;
3040
3047
  }
3041
3048
  E = t.size > 0 ? t.size : On, D = t.fontFace, O = t.fontFaceEa;
3042
- let { font: n, px: r } = f(t), s = t.color ?? "#000000", c = Math.max(le(t.fontFace, r), le(t.fontFaceEa, r)), l = Math.max(r * 1.2, c);
3043
- x = Math.max(x, l), S = Math.max(S, p(n, r)), e.font = n;
3044
- let u = t.text.split("\n");
3045
- for (let t = 0; t < u.length; t++) {
3049
+ let { font: n, px: o } = d(t), s = t.color ?? "#000000", c = Math.max(G(t.fontFace, o), G(t.fontFaceEa, o)), l = Math.max(o * 1.2, c);
3050
+ b = Math.max(b, l), S = Math.max(S, f(n, o)), e.font = n;
3051
+ let g = t.text.split("\n");
3052
+ for (let t = 0; t < g.length; t++) {
3046
3053
  t > 0 && T();
3047
- let i = u[t];
3048
- if (!i) continue;
3049
- if (!m) {
3050
- let t = e.measureText(i).width;
3051
- y.push({
3054
+ let r = g[t];
3055
+ if (!r) continue;
3056
+ if (!p) {
3057
+ let t = e.measureText(r).width;
3058
+ v.push({
3052
3059
  kind: "text",
3053
- text: i,
3060
+ text: r,
3054
3061
  font: n,
3055
3062
  color: s,
3056
3063
  w: t
3057
- }), b += t;
3064
+ }), y += t;
3058
3065
  continue;
3059
3066
  }
3060
- let a = "";
3061
- for (let t of i) {
3062
- let i = a + t, o = e.measureText(i).width;
3063
- if (b + o > v() && (a.length > 0 || y.length > 0)) {
3064
- if (a) {
3065
- let t = e.measureText(a).width;
3066
- y.push({
3067
+ let i = "";
3068
+ for (let t of r) {
3069
+ let r = i + t, a = e.measureText(r).width;
3070
+ if (y + a > _() && (i.length > 0 || v.length > 0)) {
3071
+ if (i) {
3072
+ let t = e.measureText(i).width;
3073
+ v.push({
3067
3074
  kind: "text",
3068
- text: a,
3075
+ text: i,
3069
3076
  font: n,
3070
3077
  color: s,
3071
3078
  w: t
3072
- }), b += t;
3079
+ }), y += t;
3073
3080
  }
3074
- T(), a = t, e.font = n, x = Math.max(x, l), S = Math.max(S, p(n, r));
3075
- } else a = i;
3081
+ T(), i = t, e.font = n, b = Math.max(b, l), S = Math.max(S, f(n, o));
3082
+ } else i = r;
3076
3083
  }
3077
- if (a) {
3078
- let t = e.measureText(a).width;
3079
- y.push({
3084
+ if (i) {
3085
+ let t = e.measureText(i).width;
3086
+ v.push({
3080
3087
  kind: "text",
3081
- text: a,
3088
+ text: i,
3082
3089
  font: n,
3083
3090
  color: s,
3084
3091
  w: t
3085
- }), b += t;
3092
+ }), y += t;
3086
3093
  }
3087
3094
  }
3088
3095
  }
3089
3096
  T();
3090
3097
  }
3091
- let g = h.reduce((e, t) => e + t.height, 0), _ = c;
3092
- n.anchor === "ctr" ? _ = c + (d - g) / 2 : n.anchor === "b" && (_ = c + Math.max(0, d - g));
3093
- let v = _;
3094
- for (let t of h) {
3095
- let n = t.segs.reduce((e, t) => e + t.w, 0), r = o + t.leftInset, i = r;
3098
+ let h = m.reduce((e, t) => e + t.height, 0), g = s;
3099
+ t.anchor === "ctr" ? g = s + (u - h) / 2 : t.anchor === "b" && (g = s + Math.max(0, u - h));
3100
+ let _ = g;
3101
+ for (let t of m) {
3102
+ let n = t.segs.reduce((e, t) => e + t.w, 0), r = a + t.leftInset, i = r;
3096
3103
  if (t.align === "ctr" ? i = r + Math.max(0, (t.availW - n) / 2) : t.align === "r" && (i = r + Math.max(0, t.availW - n)), t.hasMath) {
3097
3104
  e.textBaseline = "alphabetic";
3098
- let n = v + t.ascent;
3105
+ let n = _ + t.ascent;
3099
3106
  for (let r of t.segs) {
3100
3107
  if (r.kind === "text") e.font = r.font, e.fillStyle = r.color, e.fillText(r.text, i, n);
3101
3108
  else {
@@ -3106,14 +3113,14 @@ function Ur(e, n, r, i, a) {
3106
3113
  }
3107
3114
  } else {
3108
3115
  e.textBaseline = "middle";
3109
- let n = v + t.height / 2;
3116
+ let n = _ + t.height / 2;
3110
3117
  for (let r of t.segs) r.kind === "text" && (e.font = r.font, e.fillStyle = r.color, e.fillText(r.text, i, n)), i += r.w;
3111
3118
  }
3112
- v += t.height;
3119
+ _ += t.height;
3113
3120
  }
3114
3121
  }
3115
- function Wr(e, n) {
3116
- n.fillColor && (e.fillStyle = n.fillColor, e.fill()), n.strokeColor && n.strokeWidth > 0 && (e.strokeStyle = n.strokeColor, e.lineWidth = Math.max(.5, n.strokeWidth / t), e.stroke());
3122
+ function Wr(e, t) {
3123
+ t.fillColor && (e.fillStyle = t.fillColor, e.fill()), t.strokeColor && t.strokeWidth > 0 && (e.strokeStyle = t.strokeColor, e.lineWidth = Math.max(.5, t.strokeWidth / W), e.stroke());
3117
3124
  }
3118
3125
  function Gr(e, t, n, r, i, a, o) {
3119
3126
  if (r === n && i === t) return e;
@@ -3198,17 +3205,17 @@ function qr(e, t, n, r, i, a, o = 1) {
3198
3205
  kind: "d"
3199
3206
  }
3200
3207
  ];
3201
- for (let { edge: t, x1: c, y1: l, x2: u, y2: d, kind: f } of s) {
3208
+ for (let { edge: t, x1: c, y1: l, x2: u, y2: f, kind: p } of s) {
3202
3209
  if (!t || !t.style || t.style === "none") continue;
3203
- let s = t.color ? R(t.color) : "#000000";
3204
- if (t.style === "double" && f === "d") {
3210
+ let s = t.color ? J(t.color) : "#000000";
3211
+ if (t.style === "double" && p === "d") {
3205
3212
  e.strokeStyle = s, e.lineWidth = 1, e.setLineDash([]);
3206
- let t = u - c, n = d - l, r = Math.hypot(t, n), i = -n / r * 1, a = t / r * 1;
3207
- e.beginPath(), e.moveTo(c + i, l + a), e.lineTo(u + i, d + a), e.moveTo(c - i, l - a), e.lineTo(u - i, d - a), e.stroke();
3213
+ let t = u - c, n = f - l, r = Math.hypot(t, n), i = -n / r * 1, a = t / r * 1;
3214
+ e.beginPath(), e.moveTo(c + i, l + a), e.lineTo(u + i, f + a), e.moveTo(c - i, l - a), e.lineTo(u - i, f - a), e.stroke();
3208
3215
  continue;
3209
3216
  }
3210
- if (t.style === "double" && f !== "d") {
3211
- if (e.strokeStyle = s, e.lineWidth = 1, e.setLineDash([]), e.beginPath(), f === "h") {
3217
+ if (t.style === "double" && p !== "d") {
3218
+ if (e.strokeStyle = s, e.lineWidth = 1, e.setLineDash([]), e.beginPath(), p === "h") {
3212
3219
  let t = l === r, o = t ? r - 1 : r + a + 1, s = t ? r + 1 : r + a - 1;
3213
3220
  e.moveTo(n - 1, o), e.lineTo(n + i + 1, o), e.moveTo(n + 1, s), e.lineTo(n + i - 1, s);
3214
3221
  } else {
@@ -3219,12 +3226,12 @@ function qr(e, t, n, r, i, a, o = 1) {
3219
3226
  continue;
3220
3227
  }
3221
3228
  e.beginPath(), e.strokeStyle = s;
3222
- let p = Jr(t.style);
3223
- e.lineWidth = p;
3224
- let m = Yr(t.style);
3225
- e.setLineDash(m);
3226
- let h = f === "v" ? N(c, p, o) : 0, g = f === "h" ? N(l, p, o) : 0;
3227
- e.moveTo(c + h, l + g), e.lineTo(u + h, d + g), e.stroke(), e.setLineDash([]);
3229
+ let m = Jr(t.style);
3230
+ e.lineWidth = m;
3231
+ let h = Yr(t.style);
3232
+ e.setLineDash(h);
3233
+ let g = p === "v" ? d(c, m, o) : 0, _ = p === "h" ? d(l, m, o) : 0;
3234
+ e.moveTo(c + g, l + _), e.lineTo(u + g, f + _), e.stroke(), e.setLineDash([]);
3228
3235
  }
3229
3236
  }
3230
3237
  function Jr(e) {
@@ -3240,7 +3247,7 @@ function Jr(e) {
3240
3247
  }
3241
3248
  }
3242
3249
  function Yr(e) {
3243
- return ge(e);
3250
+ return A(e);
3244
3251
  }
3245
3252
  function Xr(e) {
3246
3253
  switch (e) {
@@ -3264,17 +3271,17 @@ function Zr(e, t) {
3264
3271
  let n = Xr(e?.style), r = Xr(t?.style);
3265
3272
  return n === 0 && r === 0 ? null : n >= r ? e ?? null : t ?? null;
3266
3273
  }
3267
- function Qr(e, n, r, i, a, o, s, c, l, u, d, f, p) {
3268
- if (u <= 0 || d <= 0) return;
3269
- let m = Ar(n, a, r), h = jr(n, i, r), g = jn(c, u, p, f);
3270
- for (let i of n.charts) {
3271
- let a = i.fromCol + 1, _ = i.fromRow + 1, v = i.toCol + 1, y = i.toRow + 1, b = Ar(n, a, r) + i.fromColOff * r / t, x = jr(n, _, r) + i.fromRowOff * r / t, S = Ar(n, v, r) + i.toColOff * r / t, C = jr(n, y, r) + i.toRowOff * r / t, w = S - b, T = C - x;
3274
+ function Qr(e, t, n, r, i, a, o, s, c, l, u, d, f) {
3275
+ if (l <= 0 || u <= 0) return;
3276
+ let p = Ar(t, i, n), m = jr(t, r, n), h = jn(s, l, f, d);
3277
+ for (let r of t.charts) {
3278
+ let i = r.fromCol + 1, g = r.fromRow + 1, _ = r.toCol + 1, v = r.toRow + 1, y = Ar(t, i, n) + r.fromColOff * n / W, b = jr(t, g, n) + r.fromRowOff * n / W, S = Ar(t, _, n) + r.toColOff * n / W, C = jr(t, v, n) + r.toRowOff * n / W, w = S - y, T = C - b;
3272
3279
  if (w <= 0 || T <= 0) continue;
3273
- let E = jn(c + (b - m) - o, w, p, f), D = l + (x - h) - s;
3274
- if (E + w < g || E > g + u || D + T < l || D > l + d) continue;
3275
- e.save(), e.beginPath(), e.rect(g, l, u, d), e.clip();
3276
- let O = G * r;
3277
- I(e, i.chart, {
3280
+ let E = jn(s + (y - p) - a, w, f, d), D = c + (b - m) - o;
3281
+ if (E + w < h || E > h + l || D + T < c || D > c + u) continue;
3282
+ e.save(), e.beginPath(), e.rect(h, c, l, u), e.clip();
3283
+ let O = x * n;
3284
+ _e(e, r.chart, {
3278
3285
  x: E,
3279
3286
  y: D,
3280
3287
  w,
@@ -3283,16 +3290,16 @@ function Qr(e, n, r, i, a, o, s, c, l, u, d, f, p) {
3283
3290
  }
3284
3291
  }
3285
3292
  var $r = "600 12px \"Meiryo UI\", \"Segoe UI\", sans-serif", ei = "11px \"Meiryo UI\", \"Segoe UI\", sans-serif", ti = "#FFFFFF", ni = "#BFBFBF", ri = "#F2F2F2", ii = "#404040", ai = "#FFFFFF", oi = "#000000", si = "#A5A5A5", ci = "#E7E6E6", li = "#A6A6A6", ui = "#C6C6C6";
3286
- function di(e, n, r, i, a, o, s, c, l, u, d, f, p) {
3287
- if (u <= 0 || d <= 0) return;
3288
- let m = n.slicers;
3289
- if (!m) return;
3290
- let h = Ar(n, a, r), g = jr(n, i, r), _ = jn(c, u, p, f);
3291
- for (let i of m) {
3292
- let a = i.fromCol + 1, m = i.fromRow + 1, v = i.toCol + 1, y = i.toRow + 1, b = Ar(n, a, r) + i.fromColOff * r / t, x = jr(n, m, r) + i.fromRowOff * r / t, S = Ar(n, v, r) + i.toColOff * r / t, C = jr(n, y, r) + i.toRowOff * r / t, w = S - b, T = C - x;
3293
- if (w <= 0 || T <= 0) continue;
3294
- let E = jn(c + (b - h) - o, w, p, f), D = l + (x - g) - s;
3295
- E + w < _ || E > _ + u || D + T < l || D > l + d || (e.save(), e.beginPath(), e.rect(_, l, u, d), e.clip(), fi(e, i.caption, i.items, E, D, w, T, r), e.restore());
3293
+ function di(e, t, n, r, i, a, o, s, c, l, u, d, f) {
3294
+ if (l <= 0 || u <= 0) return;
3295
+ let p = t.slicers;
3296
+ if (!p) return;
3297
+ let m = Ar(t, i, n), h = jr(t, r, n), g = jn(s, l, f, d);
3298
+ for (let r of p) {
3299
+ let i = r.fromCol + 1, p = r.fromRow + 1, _ = r.toCol + 1, v = r.toRow + 1, y = Ar(t, i, n) + r.fromColOff * n / W, b = jr(t, p, n) + r.fromRowOff * n / W, x = Ar(t, _, n) + r.toColOff * n / W, S = jr(t, v, n) + r.toRowOff * n / W, C = x - y, w = S - b;
3300
+ if (C <= 0 || w <= 0) continue;
3301
+ let T = jn(s + (y - m) - a, C, f, d), E = c + (b - h) - o;
3302
+ T + C < g || T > g + l || E + w < c || E > c + u || (e.save(), e.beginPath(), e.rect(g, c, l, u), e.clip(), fi(e, r.caption, r.items, T, E, C, w, n), e.restore());
3296
3303
  }
3297
3304
  }
3298
3305
  function fi(e, t, n, r, i, a, o, s) {
@@ -3327,7 +3334,7 @@ function mi(e, t, n, r, i) {
3327
3334
  //#endregion
3328
3335
  //#region packages/xlsx/src/render-orchestrator.ts
3329
3336
  async function hi(e, t, n, r, i = 0, a = 0, o = null, s = null, c) {
3330
- let l = t === "image/svg+xml", u = me(t, o, i, a), d = () => xe(e, t, s, r, {
3337
+ let l = t === "image/svg+xml", u = ue(t, o, i, a), d = () => xe(e, t, s, r, {
3331
3338
  widthPt: u.widthPt,
3332
3339
  heightPt: u.heightPt,
3333
3340
  offscreenFactory: c
@@ -3335,45 +3342,45 @@ async function hi(e, t, n, r, i = 0, a = 0, o = null, s = null, c) {
3335
3342
  svgImagePath: n,
3336
3343
  srcRect: o
3337
3344
  };
3338
- if (m(f)) try {
3339
- return await ae(f.svgImagePath, r);
3345
+ if (P(f)) try {
3346
+ return await q(f.svgImagePath, r);
3340
3347
  } catch {
3341
- return l ? ae(e, r) : d();
3342
- }
3343
- return l ? ae(e, r) : d();
3344
- }
3345
- async function gi(e, t, n, r) {
3346
- if (!n) return;
3347
- let i = n, a = /* @__PURE__ */ new Map();
3348
- if (e.images) for (let t of e.images) a.set(bn(t.imagePath, t.duotone), {
3349
- imagePath: t.imagePath,
3350
- mimeType: t.mimeType,
3351
- svgImagePath: t.svgImagePath,
3352
- widthPt: t.nativeExtCx > 0 ? t.nativeExtCx / re : 0,
3353
- heightPt: t.nativeExtCy > 0 ? t.nativeExtCy / re : 0,
3354
- srcRect: t.srcRect ?? null,
3355
- duotone: t.duotone ?? null
3348
+ return l ? q(e, r) : d();
3349
+ }
3350
+ return l ? q(e, r) : d();
3351
+ }
3352
+ async function gi(e, n, r, i) {
3353
+ if (!r) return;
3354
+ let a = r, o = /* @__PURE__ */ new Map();
3355
+ if (e.images) for (let n of e.images) o.set(bn(n.imagePath, n.duotone), {
3356
+ imagePath: n.imagePath,
3357
+ mimeType: n.mimeType,
3358
+ svgImagePath: n.svgImagePath,
3359
+ widthPt: n.nativeExtCx > 0 ? n.nativeExtCx / t : 0,
3360
+ heightPt: n.nativeExtCy > 0 ? n.nativeExtCy / t : 0,
3361
+ srcRect: n.srcRect ?? null,
3362
+ duotone: n.duotone ?? null
3356
3363
  });
3357
- if (e.shapeGroups) for (let t of e.shapeGroups) for (let e of t.shapes) e.geom.type === "image" && a.set(bn(e.geom.imagePath, e.geom.duotone), {
3364
+ if (e.shapeGroups) for (let n of e.shapeGroups) for (let e of n.shapes) e.geom.type === "image" && o.set(bn(e.geom.imagePath, e.geom.duotone), {
3358
3365
  imagePath: e.geom.imagePath,
3359
3366
  mimeType: e.geom.mimeType,
3360
3367
  svgImagePath: e.geom.svgImagePath,
3361
- widthPt: t.nativeExtCx > 0 ? t.nativeExtCx * e.w / re : 0,
3362
- heightPt: t.nativeExtCy > 0 ? t.nativeExtCy * e.h / re : 0,
3368
+ widthPt: n.nativeExtCx > 0 ? n.nativeExtCx * e.w / t : 0,
3369
+ heightPt: n.nativeExtCy > 0 ? n.nativeExtCy * e.h / t : 0,
3363
3370
  srcRect: e.geom.srcRect ?? null,
3364
3371
  duotone: e.geom.duotone ?? null
3365
3372
  });
3366
- a.size !== 0 && await Promise.all([...a.entries()].map(async ([e, n]) => {
3373
+ o.size !== 0 && await Promise.all([...o.entries()].map(async ([e, t]) => {
3367
3374
  try {
3368
- let a = await hi(n.imagePath, n.mimeType, n.svgImagePath, i, n.widthPt, n.heightPt, n.srcRect, n.duotone, r?.offscreenFactory);
3369
- t.set(e, a);
3375
+ let r = await hi(t.imagePath, t.mimeType, t.svgImagePath, a, t.widthPt, t.heightPt, t.srcRect, t.duotone, i?.offscreenFactory);
3376
+ n.set(e, r);
3370
3377
  } catch {
3371
- t.delete(e);
3378
+ n.delete(e);
3372
3379
  }
3373
3380
  }));
3374
3381
  }
3375
3382
  async function _i(e, t, n, r = {}) {
3376
- let i = r.fetchImage ? ce(r.fetchImage) : void 0;
3383
+ let i = r.fetchImage ? me(r.fetchImage) : void 0;
3377
3384
  try {
3378
3385
  await vi(e, t, n, r);
3379
3386
  } finally {
@@ -3383,19 +3390,19 @@ async function _i(e, t, n, r = {}) {
3383
3390
  async function vi(e, t, n, r = {}) {
3384
3391
  let { ws: i, styles: a, imageCache: o } = e;
3385
3392
  await gi(i, o, r.fetchImage), e.math && Vr(i) && await Hr(i, e.math);
3386
- let s = r.dpr ?? l(), c = g(t) ? t.clientWidth || 800 : t.width, u = g(t) ? t.clientHeight || 600 : t.height, d = r.width ?? c, f = r.height ?? u, p = A(d * s, f * s), m = p.clamped ? s * p.scale : s, h = p.width, _ = p.height;
3387
- if (t.width !== h && (t.width = h), t.height !== _ && (t.height = _), g(t)) {
3388
- let e = `${d}px`, n = `${f}px`;
3393
+ let s = r.dpr ?? _(), c = fe(t) ? t.clientWidth || 800 : t.width, l = fe(t) ? t.clientHeight || 600 : t.height, u = r.width ?? c, d = r.height ?? l, f = N(u * s, d * s), p = f.clamped ? s * f.scale : s, m = f.width, h = f.height;
3394
+ if (t.width !== m && (t.width = m), t.height !== h && (t.height = h), fe(t)) {
3395
+ let e = `${u}px`, n = `${d}px`;
3389
3396
  t.style.width !== e && (t.style.width = e), t.style.height !== n && (t.style.height = n);
3390
3397
  }
3391
- let v = t.getContext("2d");
3392
- if (v.setTransform(m, 0, 0, m, 0, 0), i.parseError) {
3393
- yi(v, d, f, i.name, i.parseError);
3398
+ let g = t.getContext("2d");
3399
+ if (g.setTransform(p, 0, 0, p, 0, 0), i.parseError) {
3400
+ yi(g, u, d, i.name, i.parseError);
3394
3401
  return;
3395
3402
  }
3396
- Or(v, i, a, n, {
3403
+ Or(g, i, a, n, {
3397
3404
  ...r,
3398
- dpr: m,
3405
+ dpr: p,
3399
3406
  loadedImages: o
3400
3407
  });
3401
3408
  }
@@ -3421,7 +3428,7 @@ function yi(e, t, n, r, i) {
3421
3428
  //#region packages/xlsx/src/google-fonts.ts
3422
3429
  var bi = {
3423
3430
  ...r,
3424
- ...E
3431
+ ...u
3425
3432
  };
3426
3433
  function* xi(e) {
3427
3434
  for (let t of e?.sharedStrings ?? []) if (t.runs && t.runs.length > 0) for (let e of t.runs) yield e.text;
@@ -3429,7 +3436,7 @@ function* xi(e) {
3429
3436
  }
3430
3437
  function Si(e) {
3431
3438
  let t = /* @__PURE__ */ new Set(), n = null;
3432
- for (let r of e?.styles?.fonts ?? []) r.name && (t.add(r.name), n ??= p(r.name));
3439
+ for (let r of e?.styles?.fonts ?? []) r.name && (t.add(r.name), n ??= y(r.name));
3433
3440
  for (let r of be(xi(e), n)) t.add(r);
3434
3441
  return t;
3435
3442
  }
@@ -3537,7 +3544,7 @@ var Di = class e {
3537
3544
  googleFontFaces = [];
3538
3545
  _mode = "main";
3539
3546
  constructor(e, t, n) {
3540
- this.worker = e, this._mode = t, this.bridge = new u(this.worker, {
3547
+ this.worker = e, this._mode = t, this.bridge = new j(this.worker, {
3541
3548
  correlate: (e) => e.id,
3542
3549
  toError: (e) => e.type === "error" ? e.message : void 0
3543
3550
  });
@@ -3556,8 +3563,8 @@ var Di = class e {
3556
3563
  if (!e.ok) throw Error(`Failed to fetch: ${e.status} ${e.statusText}`);
3557
3564
  i = await e.arrayBuffer();
3558
3565
  } else i = t;
3559
- i = h(await fe(i, n.password));
3560
- let a = new e(r === "worker" ? (await import("./render-worker-host-Cg60RAG_.js")).createRenderWorker() : new Pe(), r, n.wasmUrl);
3566
+ i = g(await K(i, n.password));
3567
+ let a = new e(r === "worker" ? (await import("./render-worker-host-Custze53.js")).createRenderWorker() : new Pe(), r, n.wasmUrl);
3561
3568
  return await a._load(i, n), a;
3562
3569
  }
3563
3570
  async _load(e, t = {}) {
@@ -3580,7 +3587,7 @@ var Di = class e {
3580
3587
  this.parsedWorkbook = JSON.parse(new TextDecoder().decode(new Uint8Array(e)));
3581
3588
  }
3582
3589
  let r = this.parsedWorkbook?.workbook.parseError;
3583
- r && console.warn(`[ooxml] xlsx opened with a degraded part: ${r}`), this._mode === "main" && t.useGoogleFonts && (this.googleFontFaces = await d(Si(this.parsedWorkbook), bi));
3590
+ r && console.warn(`[ooxml] xlsx opened with a degraded part: ${r}`), this._mode === "main" && t.useGoogleFonts && (this.googleFontFaces = await p(Si(this.parsedWorkbook), bi));
3584
3591
  }
3585
3592
  get sheetNames() {
3586
3593
  return this.parsedWorkbook?.workbook.sheets.map((e) => e.name) ?? [];
@@ -3675,7 +3682,7 @@ var Di = class e {
3675
3682
  async renderViewportToBitmap(e, t, n) {
3676
3683
  let r = {
3677
3684
  ...n,
3678
- dpr: n.dpr ?? l()
3685
+ dpr: n.dpr ?? _()
3679
3686
  };
3680
3687
  if (this._mode === "worker") {
3681
3688
  if (!Number.isInteger(e) || e < 0 || e >= this.sheetCount) throw Error(`Sheet index ${e} out of range (count: ${this.sheetCount})`);
@@ -3691,7 +3698,7 @@ var Di = class e {
3691
3698
  return await this.renderViewport(i, e, t, r), i.transferToImageBitmap();
3692
3699
  }
3693
3700
  destroy() {
3694
- this.bridge.terminate(), this.parsedWorkbook = null, this.sheetCache.clear(), this.googleFontFaces.length > 0 && (j(this.googleFontFaces), this.googleFontFaces = []), this.imageCache.clear(), W(this._fetchImage), Se(this._fetchImage), z(this._fetchImage), this.imageBlobCache.clear(), this.rawData = null;
3701
+ this.bridge.terminate(), this.parsedWorkbook = null, this.sheetCache.clear(), this.googleFontFaces.length > 0 && (te(this.googleFontFaces), this.googleFontFaces = []), this.imageCache.clear(), R(this._fetchImage), Se(this._fetchImage), oe(this._fetchImage), this.imageBlobCache.clear(), this.rawData = null;
3695
3702
  }
3696
3703
  };
3697
3704
  //#endregion
@@ -3770,7 +3777,7 @@ var Ai = class {
3770
3777
  for (let r = 0; r < n; r++) {
3771
3778
  let n = await this._collectSheetCells(r), i = this._sheetName(r);
3772
3779
  for (let a of n) {
3773
- let n = te(q([{ text: a.text }]), e, t);
3780
+ let n = ne(pe([{ text: a.text }]), e, t);
3774
3781
  for (let e of n) {
3775
3782
  let t = e.slices[0], n = a.text.slice(t.start, t.end);
3776
3783
  this._matches.push({
@@ -3786,10 +3793,10 @@ var Ai = class {
3786
3793
  return this.matches();
3787
3794
  }
3788
3795
  next() {
3789
- return this._active = pe(this._active, this._matches.length), this._activePublic();
3796
+ return this._active = he(this._active, this._matches.length), this._activePublic();
3790
3797
  }
3791
3798
  prev() {
3792
- return this._active = se(this._active, this._matches.length), this._activePublic();
3799
+ return this._active = le(this._active, this._matches.length), this._activePublic();
3793
3800
  }
3794
3801
  _activePublic() {
3795
3802
  let e = this._locationAt(this._active);
@@ -4779,7 +4786,7 @@ var oa = class {
4779
4786
  };
4780
4787
  else return !1;
4781
4788
  let r = this.opts.onHyperlinkClick;
4782
- return r ? (r(n), !0) : (n.kind === "external" ? ie(n.url) : this.navigateInternalHyperlink(n.ref), !0);
4789
+ return r ? (r(n), !0) : (n.kind === "external" ? ae(n.url) : this.navigateInternalHyperlink(n.ref), !0);
4783
4790
  }
4784
4791
  navigateInternalHyperlink(e) {
4785
4792
  let t = e.lastIndexOf("!");
@@ -5041,7 +5048,7 @@ var oa = class {
5041
5048
  r.style.cssText = "display:flex;align-items:center;flex-shrink:0;gap:2px;padding:0 10px;height:100%;color:#555;font-size:12px;user-select:none;";
5042
5049
  let i = (e, t, n) => {
5043
5050
  let r = document.createElement("button");
5044
- return r.textContent = e, r.setAttribute("aria-label", t), r.title = t, r.style.cssText = "width:18px;height:18px;padding:0;border:none;background:transparent;color:#555;font-size:14px;line-height:1;cursor:pointer;border-radius:3px;", r.addEventListener("click", n), r;
5051
+ return r.type = "button", r.textContent = e, r.setAttribute("aria-label", t), r.title = t, r.style.cssText = "width:18px;height:18px;padding:0;border:none;background:transparent;color:#555;font-size:14px;line-height:1;cursor:pointer;border-radius:3px;", r.addEventListener("click", n), r;
5045
5052
  }, a = document.createElement("input");
5046
5053
  a.type = "range", a.min = "0", a.max = "100", a.step = "any", a.value = String(this.zoomScaleToPos(n, e, t)), a.setAttribute("aria-label", "Zoom"), a.title = "Zoom", a.classList.add("xlsx-zoom-slider"), a.style.cssText = "width:90px;cursor:pointer;", a.addEventListener("input", () => this.setScale(this.zoomPosToScale(Number(a.value), e, t)));
5047
5054
  let o = document.createElement("span");
@@ -5061,8 +5068,8 @@ var oa = class {
5061
5068
  let e = this.effectiveScrollLeft, t = this.scrollHost.scrollTop;
5062
5069
  if (this.layoutGutters(), this.updateSpacerSize(this.currentWorksheet), o) {
5063
5070
  let n = Math.max(0, this.scrollHost.scrollHeight - this.scrollHost.clientHeight);
5064
- this.scrollHost.scrollTop = oe(t, o.y, a, i, { maxScroll: n });
5065
- let r = this.screenX(o.x, 0), s = this.maxScrollLeft, c = oe(e, r, a, i, { maxScroll: s });
5071
+ this.scrollHost.scrollTop = se(t, o.y, a, i, { maxScroll: n });
5072
+ let r = this.screenX(o.x, 0), s = this.maxScrollLeft, c = se(e, r, a, i, { maxScroll: s });
5066
5073
  this.effectiveH = c, this.scrollHost.scrollLeft = this.isRtl ? Math.max(0, s - c) : c;
5067
5074
  } else this.effectiveH = e, this.isRtl && (this.scrollHost.scrollLeft = Math.max(0, this.maxScrollLeft - e));
5068
5075
  }
@@ -5073,10 +5080,10 @@ var oa = class {
5073
5080
  return this.opts.cellScale ?? 1;
5074
5081
  }
5075
5082
  zoomIn() {
5076
- this.setScale(V(this.getScale()));
5083
+ this.setScale(H(this.getScale()));
5077
5084
  }
5078
5085
  zoomOut() {
5079
- this.setScale(ue(this.getScale()));
5086
+ this.setScale(de(this.getScale()));
5080
5087
  }
5081
5088
  fitWidth() {
5082
5089
  this._fit("width");
@@ -5264,12 +5271,12 @@ var oa = class {
5264
5271
  destroy() {
5265
5272
  this._destroyed = !0, this._loadGen++, this.resizeObserver?.disconnect(), this._rafId !== null && typeof cancelAnimationFrame == "function" && (cancelAnimationFrame(this._rafId), this._rafId = null), this._renderSeq++, this.hideCommentPopup(), this.hideValidationPanel(), this.keydownHandler && document.removeEventListener("keydown", this.keydownHandler), this._find.invalidate(), this.wb?.destroy(), this.wrapper.remove();
5266
5273
  }
5267
- }, sa = /* @__PURE__ */ P({
5274
+ }, sa = /* @__PURE__ */ e({
5268
5275
  OoxmlError: () => F,
5269
5276
  XlsxViewer: () => oa,
5270
5277
  XlsxWorkbook: () => Di,
5271
- autoResize: () => H,
5272
- openExternalHyperlink: () => ie,
5278
+ autoResize: () => L,
5279
+ openExternalHyperlink: () => ae,
5273
5280
  resolveSharedStrings: () => Ci
5274
5281
  });
5275
5282
  //#endregion