@guiexpert/table 1.1.104 → 1.1.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- function Sh(n, e = 500) {
1
+ function xh(n, e = 500) {
2
2
  let t = null, s = 0;
3
3
  return function(...o) {
4
4
  const i = Date.now(), r = e - (i - s);
@@ -204,7 +204,7 @@ export class ${t} implements CellRendererIf {
204
204
  `);
205
205
  }
206
206
  }
207
- class Wo {
207
+ class Go {
208
208
  /**
209
209
  *
210
210
  * Fixes an invalid json like this:
@@ -382,7 +382,7 @@ class Ah {
382
382
  json2PropertyType(e, t = "") {
383
383
  let s;
384
384
  if (typeof e == "string") {
385
- const o = new Wo().fixJSON(e);
385
+ const o = new Go().fixJSON(e);
386
386
  s = this.json2Object(o);
387
387
  } else
388
388
  s = e;
@@ -498,7 +498,7 @@ class Ah {
498
498
  json2ValueInfos(e, t = "") {
499
499
  let s;
500
500
  if (typeof e == "string") {
501
- const o = new Wo().fixJSON(e);
501
+ const o = new Go().fixJSON(e);
502
502
  s = this.json2Object(o);
503
503
  } else
504
504
  s = e;
@@ -1288,7 +1288,7 @@ function Hn(n) {
1288
1288
  return Number.isNaN(e) ? void 0 : e;
1289
1289
  }
1290
1290
  }
1291
- function xo(n, e) {
1291
+ function So(n, e) {
1292
1292
  const t = n.sum, s = t + e;
1293
1293
  Number.isFinite(s) && (n.compensation += Math.abs(t) >= Math.abs(e) ? t - s + e : e - s + t), n.sum = s;
1294
1294
  }
@@ -1296,15 +1296,15 @@ function nr(n) {
1296
1296
  return Number.isFinite(n.sum) ? n.sum + n.compensation : n.sum;
1297
1297
  }
1298
1298
  function lr(n, e) {
1299
- xo(n, e.sum), n.compensation += e.compensation;
1299
+ So(n, e.sum), n.compensation += e.compensation;
1300
1300
  }
1301
- const Gn = {
1301
+ const Wn = {
1302
1302
  name: "sum",
1303
1303
  init: () => ({ sum: 0, compensation: 0 }),
1304
- add: (n, e) => (Co(e) && xo(n, e), n),
1304
+ add: (n, e) => (Co(e) && So(n, e), n),
1305
1305
  merge: (n, e) => (lr(n, e), n),
1306
1306
  result: (n) => nr(n)
1307
- }, Wn = {
1307
+ }, Gn = {
1308
1308
  name: "count",
1309
1309
  init: () => 0,
1310
1310
  add: (n) => n + 1,
@@ -1313,7 +1313,7 @@ const Gn = {
1313
1313
  }, Un = {
1314
1314
  name: "avg",
1315
1315
  init: () => ({ sum: 0, compensation: 0, count: 0 }),
1316
- add: (n, e) => (Co(e) && (xo(n, e), n.count++), n),
1316
+ add: (n, e) => (Co(e) && (So(n, e), n.count++), n),
1317
1317
  merge: (n, e) => (lr(n, e), n.count += e.count, n),
1318
1318
  result: (n) => n.count ? nr(n) / n.count : void 0
1319
1319
  };
@@ -1348,8 +1348,8 @@ const Kn = {
1348
1348
  merge: (n, e) => (e.has && (n.has = !0, n.value = e.value), n),
1349
1349
  result: (n) => n.value
1350
1350
  }, _e = Object.freeze({
1351
- sum: Gn,
1352
- count: Wn,
1351
+ sum: Wn,
1352
+ count: Gn,
1353
1353
  avg: Un,
1354
1354
  min: jo("min", (n, e) => n < e),
1355
1355
  max: jo("max", (n, e) => n > e),
@@ -1357,7 +1357,7 @@ const Kn = {
1357
1357
  first: zn,
1358
1358
  last: jn
1359
1359
  });
1360
- function So(n) {
1360
+ function xo(n) {
1361
1361
  if (typeof n != "string")
1362
1362
  return n;
1363
1363
  const e = _e[n];
@@ -1378,8 +1378,8 @@ function Es(n) {
1378
1378
  return s;
1379
1379
  };
1380
1380
  }
1381
- function Gt(n, e) {
1382
- const t = typeof e == "string" || !("aggregator" in e) ? { aggregator: e } : e, s = So(t.aggregator), o = t.value ?? n;
1381
+ function Wt(n, e) {
1382
+ const t = typeof e == "string" || !("aggregator" in e) ? { aggregator: e } : e, s = xo(t.aggregator), o = t.value ?? n;
1383
1383
  return {
1384
1384
  key: n,
1385
1385
  aggregator: s,
@@ -1409,15 +1409,15 @@ function Xn(n, e) {
1409
1409
  return t;
1410
1410
  }
1411
1411
  function Mh(n, e, t) {
1412
- const s = Gt("", { aggregator: t, value: e }), [o] = Ms(n, [s]);
1412
+ const s = Wt("", { aggregator: t, value: e }), [o] = Ms(n, [s]);
1413
1413
  return s.aggregator.result(o);
1414
1414
  }
1415
1415
  function Th(n, e) {
1416
- const t = Object.keys(e).map((i) => Gt(i, e[i])), s = Ms(n, t), o = {};
1416
+ const t = Object.keys(e).map((i) => Wt(i, e[i])), s = Ms(n, t), o = {};
1417
1417
  return t.forEach((i, r) => o[i.key] = i.aggregator.result(s[r])), o;
1418
1418
  }
1419
1419
  const Yn = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 });
1420
- function Wt(n) {
1420
+ function Gt(n) {
1421
1421
  return n == null ? "" : typeof n == "number" ? Number.isFinite(n) ? Yn.format(n) : String(n) : n instanceof Date ? Number.isNaN(n.getTime()) ? "" : n.toLocaleDateString("en-US") : String(n);
1422
1422
  }
1423
1423
  const Jn = /* @__PURE__ */ new Set([
@@ -1460,7 +1460,7 @@ function vo(n, e) {
1460
1460
  const s = Yo(t.fractionDigits);
1461
1461
  return new Intl.NumberFormat("en-US", { minimumFractionDigits: s, maximumFractionDigits: s }).format(n);
1462
1462
  }
1463
- return Wt(n);
1463
+ return Gt(n);
1464
1464
  }
1465
1465
  function Yo(n) {
1466
1466
  return Math.min(10, Math.max(0, Math.trunc(Number(n) || 0)));
@@ -1578,7 +1578,7 @@ class el {
1578
1578
  return new I("#CIRC!", `Circular reference: the column "${e}" uses its own aggregate`);
1579
1579
  const s = this.owner.getAggregationSource();
1580
1580
  (s.signal !== this.aggSignal || s.length !== this.aggLength) && (this.aggregates.clear(), this.aggSignal = s.signal, this.aggLength = s.length);
1581
- const o = So(t), i = `${o.name}\0${e}`;
1581
+ const o = xo(t), i = `${o.name}\0${e}`;
1582
1582
  if (this.aggregates.has(i))
1583
1583
  return this.aggregates.get(i);
1584
1584
  const r = s.rows();
@@ -2659,8 +2659,8 @@ const ws = class ws {
2659
2659
  for (const C of p.columns) {
2660
2660
  if (b.length && b.some((E) => y >= E.r1 && y <= E.r2 && E.columns.includes(C)) || !t.isSelected(y, C)) continue;
2661
2661
  s.count++;
2662
- const x = o.getValueAt(y, C);
2663
- typeof x == "number" && !Number.isNaN(x) && (s.numericCount++, u = c.add(u, x), f = h.add(f, x), g = d.add(g, x));
2662
+ const S = o.getValueAt(y, C);
2663
+ typeof S == "number" && !Number.isNaN(S) && (s.numericCount++, u = c.add(u, S), f = h.add(f, S), g = d.add(g, S));
2664
2664
  }
2665
2665
  }), s.numericCount && (s.sum = c.result(u), s.avg = s.sum / s.numericCount, s.min = h.result(f), s.max = d.result(g)), s;
2666
2666
  }
@@ -3380,17 +3380,17 @@ const Pt = {
3380
3380
  }
3381
3381
  };
3382
3382
  Pt.AVERAGE = Pt.AVG;
3383
- const xl = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]), Sl = (n, e) => Object.prototype.hasOwnProperty.call(n, e);
3383
+ const Sl = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]), xl = (n, e) => Object.prototype.hasOwnProperty.call(n, e);
3384
3384
  function vl(n, e, t, s = e.split(".")) {
3385
3385
  if (t != null && t.isCalculated(e))
3386
3386
  return ns(t.getValue(n, e), e, !0);
3387
- if (s.some((i) => xl.has(i)))
3387
+ if (s.some((i) => Sl.has(i)))
3388
3388
  return new I("#NAME?", `Unknown field [${e}]`);
3389
3389
  let o = n;
3390
3390
  for (let i = 0; i < s.length; i++) {
3391
3391
  if (o == null || typeof o != "object")
3392
3392
  return null;
3393
- if (!Sl(o, s[i]))
3393
+ if (!xl(o, s[i]))
3394
3394
  return i === 0 && !(t != null && t.hasColumn(e)) ? new I("#NAME?", `Unknown field [${e}]`) : null;
3395
3395
  o = o[s[i]];
3396
3396
  }
@@ -3572,7 +3572,7 @@ class Al {
3572
3572
  }
3573
3573
  }
3574
3574
  const Dh = Object.freeze([...Object.keys(Pt), ...Object.keys(mr)].sort());
3575
- function xt(n, e, t, s) {
3575
+ function St(n, e, t, s) {
3576
3576
  switch (n.kind) {
3577
3577
  case "literal":
3578
3578
  return;
@@ -3580,9 +3580,9 @@ function xt(n, e, t, s) {
3580
3580
  t.includes(n.name) || t.push(n.name);
3581
3581
  return;
3582
3582
  case "unary":
3583
- return xt(n.operand, e, t, s);
3583
+ return St(n.operand, e, t, s);
3584
3584
  case "binary":
3585
- return xt(n.left, e, t, s) ?? xt(n.right, e, t, s);
3585
+ return St(n.left, e, t, s) ?? St(n.right, e, t, s);
3586
3586
  case "call": {
3587
3587
  if (!e.has(n.name)) {
3588
3588
  const o = Pt[n.name] ?? mr[n.name];
@@ -3595,7 +3595,7 @@ function xt(n, e, t, s) {
3595
3595
  ["SUM", "AVG", "AVERAGE", "MIN", "MAX", "COUNT"].includes(n.name) && n.args.length === 1 && n.args[0].kind === "field" && (s.aggregates = !0);
3596
3596
  }
3597
3597
  for (const o of n.args) {
3598
- const i = xt(o, e, t, s);
3598
+ const i = St(o, e, t, s);
3599
3599
  if (i) return i;
3600
3600
  }
3601
3601
  return;
@@ -3617,7 +3617,7 @@ function br(n, e) {
3617
3617
  try {
3618
3618
  t = typeof n == "string" ? n : String(n ?? "");
3619
3619
  const c = t.replace(/^\s+/, "");
3620
- o = zt(c.startsWith("=") && !c.startsWith("==") ? c.slice(1) : t), i = xt(o, s, r, l), i || (a = new Al(s).compile(o));
3620
+ o = zt(c.startsWith("=") && !c.startsWith("==") ? c.slice(1) : t), i = St(o, s, r, l), i || (a = new Al(s).compile(o));
3621
3621
  } catch (c) {
3622
3622
  i = c instanceof B ? c.toFormulaError() : new I("#ERROR!", "Invalid formula");
3623
3623
  }
@@ -3823,10 +3823,10 @@ class _t {
3823
3823
  }
3824
3824
  /** @returns {Date} the date (local time) */
3825
3825
  toDate() {
3826
- return xr(this.serial);
3826
+ return Sr(this.serial);
3827
3827
  }
3828
3828
  }
3829
- function W(n) {
3829
+ function G(n) {
3830
3830
  return !!n && typeof n == "object" && n.type === "SheetDate" && typeof n.serial == "number";
3831
3831
  }
3832
3832
  const yr = 864e5, Cr = Date.UTC(1899, 11, 30);
@@ -3845,7 +3845,7 @@ function jt(n) {
3845
3845
  ) - Cr) / yr;
3846
3846
  return s < 61 && (s -= 1), s;
3847
3847
  }
3848
- function xr(n) {
3848
+ function Sr(n) {
3849
3849
  const e = n < 60 ? n + 1 : n >= 60 && n < 61 ? 61 + (n - 60) : n, t = new Date(Cr + Math.round(e * yr));
3850
3850
  return new Date(
3851
3851
  t.getUTCFullYear(),
@@ -3863,7 +3863,7 @@ function Tt(n, e, t) {
3863
3863
  function Ke(n) {
3864
3864
  if (Math.floor(n) === 60)
3865
3865
  return { y: 1900, m: 2, d: 29 };
3866
- const e = xr(Math.floor(n));
3866
+ const e = Sr(Math.floor(n));
3867
3867
  return { y: e.getFullYear(), m: e.getMonth() + 1, d: e.getDate() };
3868
3868
  }
3869
3869
  class ct {
@@ -3903,7 +3903,7 @@ function me(n) {
3903
3903
  const e = Number(n.toPrecision(15));
3904
3904
  return e === 0 ? 0 : e;
3905
3905
  }
3906
- function G(n) {
3906
+ function W(n) {
3907
3907
  return Number.isFinite(n) ? me(n) : new I("#NUM!", "The result is not a finite number");
3908
3908
  }
3909
3909
  const ti = /^[+-]?(\d+\.?\d*|\.\d+)(e[+-]?\d+)?$/i, Dl = /^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?$/;
@@ -3914,7 +3914,7 @@ function ft(n) {
3914
3914
  if (t.getMonth() === +e[2] - 1)
3915
3915
  return jt(t);
3916
3916
  }
3917
- function Sr(n) {
3917
+ function xr(n) {
3918
3918
  if (n == null) return null;
3919
3919
  switch (typeof n) {
3920
3920
  case "number":
@@ -3926,7 +3926,7 @@ function Sr(n) {
3926
3926
  case "bigint":
3927
3927
  return Number(n);
3928
3928
  }
3929
- if (w(n) || W(n)) return n;
3929
+ if (w(n) || G(n)) return n;
3930
3930
  if (n instanceof Date) {
3931
3931
  const e = jt(n);
3932
3932
  return Number.isNaN(e) ? null : new _t(e);
@@ -3941,7 +3941,7 @@ function K(n, e) {
3941
3941
  if (typeof t == "number") return t;
3942
3942
  if (t === null || t === "") return 0;
3943
3943
  if (typeof t == "boolean") return t ? 1 : 0;
3944
- if (W(t)) return t.serial;
3944
+ if (G(t)) return t.serial;
3945
3945
  if (typeof t == "string") {
3946
3946
  const s = t.trim();
3947
3947
  if (ti.test(s)) {
@@ -3964,14 +3964,14 @@ function si(n) {
3964
3964
  }
3965
3965
  function ie(n) {
3966
3966
  const e = _(n);
3967
- return typeof e == "string" ? e : e === null ? "" : typeof e == "number" ? si(e) : typeof e == "boolean" ? e ? "TRUE" : "FALSE" : W(e) ? si(e.serial) : e;
3967
+ return typeof e == "string" ? e : e === null ? "" : typeof e == "number" ? si(e) : typeof e == "boolean" ? e ? "TRUE" : "FALSE" : G(e) ? si(e.serial) : e;
3968
3968
  }
3969
3969
  function ht(n) {
3970
3970
  const e = _(n);
3971
3971
  if (typeof e == "boolean") return e;
3972
3972
  if (e === null || e === "") return !1;
3973
3973
  if (typeof e == "number") return e !== 0;
3974
- if (W(e)) return e.serial !== 0;
3974
+ if (G(e)) return e.serial !== 0;
3975
3975
  if (typeof e == "string") {
3976
3976
  const t = e.trim().toUpperCase();
3977
3977
  return t === "TRUE" ? !0 : t === "FALSE" ? !1 : new I("#VALUE!", `"${e.length > 40 ? e.slice(0, 40) + "…" : e}" is not TRUE or FALSE`);
@@ -3985,7 +3985,7 @@ function Xt(n, e) {
3985
3985
  let t = _(n), s = _(e);
3986
3986
  if (w(t)) return t;
3987
3987
  if (w(s)) return s;
3988
- if (W(t) && (t = t.serial), W(s) && (s = s.serial), t === null && s === null) return 0;
3988
+ if (G(t) && (t = t.serial), G(s) && (s = s.serial), t === null && s === null) return 0;
3989
3989
  t === null && (t = typeof s == "string" ? "" : typeof s == "boolean" ? !1 : 0), s === null && (s = typeof t == "string" ? "" : typeof t == "boolean" ? !1 : 0);
3990
3990
  const o = oi(t), i = oi(s);
3991
3991
  if (o !== i) return o - i;
@@ -4003,7 +4003,7 @@ function Qs(n) {
4003
4003
  return n === null || n === "";
4004
4004
  }
4005
4005
  function ii(n) {
4006
- return W(n) ? n.toDate() : Qe(n) ? _(n) : n;
4006
+ return G(n) ? n.toDate() : Qe(n) ? _(n) : n;
4007
4007
  }
4008
4008
  class $e extends Ts {
4009
4009
  constructor(e, t, s, o, i, r = [], l = 0) {
@@ -5951,14 +5951,14 @@ class be {
5951
5951
  return e === 1 ? "1 column deleted" : `${e} columns deleted`;
5952
5952
  }
5953
5953
  }
5954
- const Gl = {
5954
+ const Wl = {
5955
5955
  insertRows: "Insert rows",
5956
5956
  deleteRows: "Delete rows",
5957
5957
  insertColumns: "Insert columns",
5958
5958
  deleteColumns: "Delete columns"
5959
5959
  };
5960
- function St(n, e, t = {}) {
5961
- var m, b, y, C, x;
5960
+ function xt(n, e, t = {}) {
5961
+ var m, b, y, C, S;
5962
5962
  const s = n.tableModel, o = s.getBodyModel(), i = e.kind === "insertColumns" || e.kind === "deleteColumns", r = o instanceof $e ? o : void 0, l = o instanceof j || o instanceof ee;
5963
5963
  if (!(e.count >= 1) || !(e.at >= 0) || (i ? !r || !Io(s) : !r && !l) || n.isBatchEditActive())
5964
5964
  return !1;
@@ -5967,20 +5967,20 @@ function St(n, e, t = {}) {
5967
5967
  return !1;
5968
5968
  const d = { ...e, count: h }, u = n.tableSheet;
5969
5969
  u == null || u.rowCount();
5970
- const f = u ? u.engine.adjustForStructureChange(d) : [], g = Wl(n, d, t.rows), p = [];
5970
+ const f = u ? u.engine.adjustForStructureChange(d) : [], g = Gl(n, d, t.rows), p = [];
5971
5971
  if (u) {
5972
5972
  const E = u.rowsArray();
5973
- for (const { row: S, col: R, input: F } of f) {
5974
- const v = E ? E[S] : r == null ? void 0 : r.getRowArray(S), D = u.inputAt(S, R);
5973
+ for (const { row: x, col: R, input: F } of f) {
5974
+ const v = E ? E[x] : r == null ? void 0 : r.getRowArray(x), D = u.inputAt(x, R);
5975
5975
  if (v && typeof v == "object") {
5976
5976
  const V = d.kind === "insertColumns" ? R >= d.at + h ? R - h : R : d.kind === "deleteColumns" && R >= d.at ? R + h : R;
5977
5977
  g.inputs.push({ row: v, col: V, old: D });
5978
5978
  }
5979
- u.writeInput(S, R, F);
5979
+ u.writeInput(x, R, F);
5980
5980
  const k = u.modelColumn(R);
5981
5981
  p.push({
5982
5982
  row: v,
5983
- rowIndex: u.displayRow(S),
5983
+ rowIndex: u.displayRow(x),
5984
5984
  columnIndex: k,
5985
5985
  property: ((b = s.getColumnDef(k)) == null ? void 0 : b.property) ?? "",
5986
5986
  oldValue: D,
@@ -5989,9 +5989,9 @@ function St(n, e, t = {}) {
5989
5989
  }
5990
5990
  u.recalculate();
5991
5991
  }
5992
- return n.refreshAfterStructureChange(i), t.record !== !1 && ((y = n.undoService) == null || y.addStep(new zl(d, g))), n.announce(Kl(n, d)), (x = (C = n.getEventListener()).onModelChanged) == null || x.call(C, Ze.createForChanges(p, t.source ?? "structure")), !0;
5992
+ return n.refreshAfterStructureChange(i), t.record !== !1 && ((y = n.undoService) == null || y.addStep(new zl(d, g))), n.announce(Kl(n, d)), (S = (C = n.getEventListener()).onModelChanged) == null || S.call(C, Ze.createForChanges(p, t.source ?? "structure")), !0;
5993
5993
  }
5994
- function Wl(n, e, t) {
5994
+ function Gl(n, e, t) {
5995
5995
  const s = n.tableModel, o = s.getBodyModel(), { at: i, count: r } = e, l = { inputs: [] };
5996
5996
  if (o instanceof $e) {
5997
5997
  if (e.kind === "insertRows") o.insertRows(i, r);
@@ -6039,7 +6039,7 @@ function Kl(n, e) {
6039
6039
  class zl {
6040
6040
  constructor(e, t) {
6041
6041
  var s, o;
6042
- this.edit = e, this.delta = t, this.source = "structure", this.label = Gl[e.kind], this.cellCount = e.count + t.inputs.length + (((s = t.sheetRows) == null ? void 0 : s.reduce((i, [, r]) => i + r.length, 0)) ?? 0) + (((o = t.sheetColumns) == null ? void 0 : o.reduce((i, [, r]) => i + r.length, 0)) ?? 0);
6042
+ this.edit = e, this.delta = t, this.source = "structure", this.label = Wl[e.kind], this.cellCount = e.count + t.inputs.length + (((s = t.sheetRows) == null ? void 0 : s.reduce((i, [, r]) => i + r.length, 0)) ?? 0) + (((o = t.sheetColumns) == null ? void 0 : o.reduce((i, [, r]) => i + r.length, 0)) ?? 0);
6043
6043
  }
6044
6044
  undo(e) {
6045
6045
  var a, c, h, d, u;
@@ -6056,7 +6056,7 @@ class zl {
6056
6056
  return (h = e.tableSheet) == null || h.recalculate(), e.refreshAfterStructureChange(r === "insertColumns" || r === "deleteColumns"), (u = (d = e.getEventListener()).onModelChanged) == null || u.call(d, Ze.createForChanges([], "undo")), { applied: i, skipped: 0 };
6057
6057
  }
6058
6058
  redo(e) {
6059
- return St(e, this.edit, { record: !1, rows: this.edit.kind === "insertRows" ? this.delta.rows : void 0, source: "redo" }), { applied: this.edit.count, skipped: 0 };
6059
+ return xt(e, this.edit, { record: !1, rows: this.edit.kind === "insertRows" ? this.delta.rows : void 0, source: "redo" }), { applied: this.edit.count, skipped: 0 };
6060
6060
  }
6061
6061
  }
6062
6062
  class jl {
@@ -8375,7 +8375,7 @@ class jl {
8375
8375
  * @since 1.1.99
8376
8376
  */
8377
8377
  insertRows(e, t = 1) {
8378
- return St(this.tableScope, { kind: "insertRows", at: e, count: t });
8378
+ return xt(this.tableScope, { kind: "insertRows", at: e, count: t });
8379
8379
  }
8380
8380
  /**
8381
8381
  * Deletes rows of the sheet (`at` = row number − 1) and adjusts the cell formulas (a deleted reference becomes
@@ -8391,7 +8391,7 @@ class jl {
8391
8391
  * @since 1.1.99
8392
8392
  */
8393
8393
  deleteRows(e, t = 1) {
8394
- return St(this.tableScope, { kind: "deleteRows", at: e, count: t });
8394
+ return xt(this.tableScope, { kind: "deleteRows", at: e, count: t });
8395
8395
  }
8396
8396
  /**
8397
8397
  * Inserts empty columns before a column of a spreadsheet ({@link SpreadsheetFactory}; `at` = letter index, A = 0)
@@ -8407,7 +8407,7 @@ class jl {
8407
8407
  * @since 1.1.99
8408
8408
  */
8409
8409
  insertColumns(e, t = 1) {
8410
- return St(this.tableScope, { kind: "insertColumns", at: e, count: t });
8410
+ return xt(this.tableScope, { kind: "insertColumns", at: e, count: t });
8411
8411
  }
8412
8412
  /**
8413
8413
  * Deletes columns of a spreadsheet (`at` = letter index, A = 0) and adjusts the cell formulas. One undo step.
@@ -8422,7 +8422,7 @@ class jl {
8422
8422
  * @since 1.1.99
8423
8423
  */
8424
8424
  deleteColumns(e, t = 1) {
8425
- return St(this.tableScope, { kind: "deleteColumns", at: e, count: t });
8425
+ return xt(this.tableScope, { kind: "deleteColumns", at: e, count: t });
8426
8426
  }
8427
8427
  /**
8428
8428
  * The inputs of a spreadsheet ({@link SpreadsheetFactory}) as rows × columns – formulas as text, up to the last
@@ -9173,7 +9173,7 @@ class Xl {
9173
9173
  }
9174
9174
  const Cs = class Cs {
9175
9175
  constructor(e, t, s, o) {
9176
- this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = o, this.scrollTop = 0, this.areaBodyWestGeo = new Te(), this.areaBodyCenterGeo = new Te(), this.areaBodyEastGeo = new Te(), this.hostAttributesBefore = /* @__PURE__ */ new Map();
9176
+ this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = o, this.scrollTop = 0, this.horizontalScrollBarHeight = 0, this.verticalScrollBarWidth = 0, this.areaBodyWestGeo = new Te(), this.areaBodyCenterGeo = new Te(), this.areaBodyEastGeo = new Te(), this.hostAttributesBefore = /* @__PURE__ */ new Map();
9177
9177
  const i = this.hostElement;
9178
9178
  i.innerText = "", this.direction = On(o == null ? void 0 : o.direction, i), this.dom.setDirection(this.direction), this.dom.setAttribute(i, "tabindex", "0"), this.ariaIds = new cs(cs.createPrefix(i.id)), this.initHostAria(), this.setHostAriaAttribute("dir", this.direction), this.dom.setStyle(
9179
9179
  this.dom.addClass("ge-table", i),
@@ -9380,27 +9380,29 @@ const Cs = class Cs {
9380
9380
  height: `${s - e.top}px`,
9381
9381
  top: `${e.top}px`,
9382
9382
  left: `${e.left}px`
9383
- }), this.scrollTop = this.scrollViewport.scrollTop, this.dom.applyStyle(this.contentDiv, {
9383
+ }), this.horizontalScrollBarHeight = this.measureHorizontalScrollBarHeight(), this.verticalScrollBarWidth = this.measureVerticalScrollBarWidth();
9384
+ const o = this.getLayoutWidth(), i = this.getLayoutHeight();
9385
+ this.scrollTop = this.scrollViewport.scrollTop, this.dom.applyStyle(this.contentDiv, {
9384
9386
  width: `${this.scrollViewport.clientWidth}px`,
9385
9387
  height: `${this.scrollViewport.clientHeight}px`,
9386
9388
  top: `${this.scrollTop}px`,
9387
9389
  left: `${this.getViewportScrollLeft()}px`
9388
- }), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height = s - e.top - e.bottom, this.areaBodyWestGeo.top = e.top, this.areaBodyWestGeo.left = 0, this.dom.applyStyleInPx(this.areaBodyWest.parent, this.areaBodyWestGeo), this.borderFixedWest && this.tableModel.getFixedLeftColumnCount() ? this.dom.applyDisplayBlockStyle(
9390
+ }), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height = i - e.top - e.bottom, this.areaBodyWestGeo.top = e.top, this.areaBodyWestGeo.left = 0, this.dom.applyStyleInPx(this.areaBodyWest.parent, this.areaBodyWestGeo), this.borderFixedWest && this.tableModel.getFixedLeftColumnCount() ? this.dom.applyDisplayBlockStyle(
9389
9391
  this.dom.applyStyle(this.borderFixedWest, {
9390
9392
  width: "1px",
9391
9393
  height: `${this.areaBodyWestGeo.height}px`,
9392
9394
  top: `${this.areaBodyWestGeo.top}px`,
9393
9395
  left: `${this.areaBodyWestGeo.width}px`
9394
9396
  })
9395
- ) : this.borderFixedWest && this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height = s - e.top - e.bottom, this.areaBodyEastGeo.top = e.top, this.areaBodyEastGeo.left = t - e.right, this.dom.applyStyleInPx(this.areaBodyEast.parent, this.areaBodyEastGeo), this.borderFixedEast && this.tableModel.getFixedRightColumnCount() ? this.dom.applyDisplayBlockStyle(
9397
+ ) : this.borderFixedWest && this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height = i - e.top - e.bottom, this.areaBodyEastGeo.top = e.top, this.areaBodyEastGeo.left = o - e.right, this.dom.applyStyleInPx(this.areaBodyEast.parent, this.areaBodyEastGeo), this.borderFixedEast && this.tableModel.getFixedRightColumnCount() ? this.dom.applyDisplayBlockStyle(
9396
9398
  this.dom.applyStyle(this.borderFixedEast, {
9397
9399
  width: "1px",
9398
9400
  height: `${this.areaBodyEastGeo.height}px`,
9399
9401
  top: `${this.areaBodyEastGeo.top}px`,
9400
9402
  left: `${this.areaBodyEastGeo.left}px`
9401
9403
  })
9402
- ) : this.borderFixedEast && this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = t - e.left - e.right, this.areaBodyCenterGeo.height = s - e.top - e.bottom, this.areaBodyCenterGeo.top = 0, this.areaBodyCenterGeo.left = 0, this.dom.applyStyleInPx(this.areaBodyCenter.parent, this.areaBodyCenterGeo), this.dom.applyStyle(this.areaHeaderCenter.parent, {
9403
- width: `${t - e.left - e.right}px`,
9404
+ ) : this.borderFixedEast && this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = o - e.left - e.right, this.areaBodyCenterGeo.height = i - e.top - e.bottom, this.areaBodyCenterGeo.top = 0, this.areaBodyCenterGeo.left = 0, this.dom.applyStyleInPx(this.areaBodyCenter.parent, this.areaBodyCenterGeo), this.dom.applyStyle(this.areaHeaderCenter.parent, {
9405
+ width: `${o - e.left - e.right}px`,
9404
9406
  height: `${e.top}px`,
9405
9407
  top: "0",
9406
9408
  left: `${e.left}px`
@@ -9413,10 +9415,10 @@ const Cs = class Cs {
9413
9415
  width: `${e.right}px`,
9414
9416
  height: `${e.top}px`,
9415
9417
  top: "0",
9416
- left: `${t - e.right}px`
9418
+ left: `${o - e.right}px`
9417
9419
  }), this.borderHeaderBottom && this.tableModel.isHeaderVisibe() ? this.dom.applyDisplayBlockStyle(
9418
9420
  this.dom.applyStyle(this.borderHeaderBottom, {
9419
- width: `${t}px`,
9421
+ width: `${o}px`,
9420
9422
  height: "1px",
9421
9423
  top: `${e.top}px`,
9422
9424
  left: "0px"
@@ -9424,37 +9426,70 @@ const Cs = class Cs {
9424
9426
  ) : this.borderHeaderBottom && this.dom.applyDisplayNoneStyle(this.borderHeaderBottom), this.dom.applyStyle(this.areaFooterWest.parent, {
9425
9427
  width: `${e.left}px`,
9426
9428
  height: `${e.bottom}px`,
9427
- top: `${s - e.bottom}px`,
9429
+ top: `${i - e.bottom}px`,
9428
9430
  left: "0"
9429
9431
  }), this.dom.applyStyle(this.areaFooterCenter.parent, {
9430
- width: `${t - e.left - e.right}px`,
9432
+ width: `${o - e.left - e.right}px`,
9431
9433
  height: `${e.bottom}px`,
9432
- top: `${s - e.bottom}px`,
9434
+ top: `${i - e.bottom}px`,
9433
9435
  left: `${e.left}px`
9434
9436
  }), this.dom.applyStyle(this.areaFooterEast.parent, {
9435
9437
  width: `${e.right}px`,
9436
9438
  height: `${e.bottom}px`,
9437
- top: `${s - e.bottom}px`,
9438
- left: `${t - e.right}px`
9439
+ top: `${i - e.bottom}px`,
9440
+ left: `${o - e.right}px`
9439
9441
  }), this.borderFooterTop && this.tableModel.isFooterVisibe() ? this.dom.applyDisplayBlockStyle(
9440
9442
  this.dom.applyStyle(this.borderFooterTop, {
9441
- width: `${t}px`,
9443
+ width: `${o}px`,
9442
9444
  height: "1px",
9443
- top: `${s - e.bottom}px`,
9445
+ top: `${i - e.bottom}px`,
9444
9446
  left: "0px"
9445
9447
  })
9446
9448
  ) : this.borderFooterTop && this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.tableOverlay.setBounds(
9447
9449
  0,
9448
9450
  e.top,
9449
- Math.min(t, e.left + this.scrollViewport.clientWidth),
9450
- s - e.top - e.bottom
9451
+ Math.min(o, e.left + this.scrollViewport.clientWidth),
9452
+ i - e.top - e.bottom
9451
9453
  ), this.adjustDetailLayerBounds(
9452
9454
  0,
9453
9455
  e.top,
9454
- Math.min(t, e.left + this.scrollViewport.clientWidth),
9455
- Math.max(0, Math.min(s - e.top - e.bottom, this.scrollViewport.clientHeight))
9456
+ Math.min(o, e.left + this.scrollViewport.clientWidth),
9457
+ Math.max(0, Math.min(i - e.top - e.bottom, this.scrollViewport.clientHeight))
9456
9458
  ), this.adjustAfterScrolling();
9457
9459
  }
9460
+ /**
9461
+ * The height the table lays out header, body and footer in: the host height minus a horizontal scroll bar that
9462
+ * takes space (see {@link horizontalScrollBarHeight}).
9463
+ *
9464
+ * @returns {number} px
9465
+ * @since 1.1.104
9466
+ */
9467
+ getLayoutHeight() {
9468
+ return Math.max(0, this.hostElement.clientHeight - this.horizontalScrollBarHeight);
9469
+ }
9470
+ /**
9471
+ * The width the table lays out header, body and footer in: the host width minus a vertical scroll bar that takes
9472
+ * space (see {@link verticalScrollBarWidth}). A logical width – in right-to-left the bar is on the left.
9473
+ *
9474
+ * @returns {number} px
9475
+ * @since 1.1.104
9476
+ */
9477
+ getLayoutWidth() {
9478
+ return Math.max(0, this.hostElement.clientWidth - this.verticalScrollBarWidth);
9479
+ }
9480
+ /**
9481
+ * Height of the horizontal scroll bar of the scroll viewport: offsetHeight − clientHeight (the viewport has no
9482
+ * border, see the constructor).
9483
+ */
9484
+ measureHorizontalScrollBarHeight() {
9485
+ const e = this.scrollViewport;
9486
+ return Math.max(0, e.offsetHeight - e.clientHeight);
9487
+ }
9488
+ /** Width of the vertical scroll bar of the scroll viewport: offsetWidth − clientWidth. */
9489
+ measureVerticalScrollBarWidth() {
9490
+ const e = this.scrollViewport;
9491
+ return Math.max(0, e.offsetWidth - e.clientWidth);
9492
+ }
9458
9493
  /**
9459
9494
  * Position and size of the detail layer (master/detail) in the host – overwritten in {@link RenderScope}.
9460
9495
  *
@@ -9837,7 +9872,7 @@ class Zl extends hs {
9837
9872
  header: [],
9838
9873
  body: [],
9839
9874
  footer: []
9840
- }, this.tree = !1, this.colAndRowspanModels = new se(), this.draggingTargetColumnIndex = -1, this.contentScrollTop = 0, this.removables = [], this.treeAriaInfo = new Jl(), this.ariaSelectionKind = "none", this.renderedSpanCells = /* @__PURE__ */ new Set(), this.bodyRowLayout = new ql(), this.bodyRowLayoutDirty = !0, this.adjustingRowNumberWidth = !1, this.rowNumberRemeasureScheduled = !1, this.ariaTexts = be.create(o == null ? void 0 : o.ariaTexts), (l = (r = this.tableModel).getSelectionModel) != null && l.call(r))
9875
+ }, this.tree = !1, this.colAndRowspanModels = new se(), this.draggingTargetColumnIndex = -1, this.contentScrollTop = 0, this.removables = [], this.treeAriaInfo = new Jl(), this.ariaSelectionKind = "none", this.renderedSpanCells = /* @__PURE__ */ new Set(), this.bodyRowLayout = new ql(), this.bodyRowLayoutDirty = !0, this.adjustingRowNumberWidth = !1, this.adjustingRelativeWidths = !1, this.relativeWidthsBase = -1, this.rowNumberRemeasureScheduled = !1, this.ariaTexts = be.create(o == null ? void 0 : o.ariaTexts), (l = (r = this.tableModel).getSelectionModel) != null && l.call(r))
9841
9876
  this.getSelectionModel = () => this.tableModel.getSelectionModel();
9842
9877
  else if ((a = this.tableOptions) != null && a.getSelectionModel)
9843
9878
  this.getSelectionModel = this.tableOptions.getSelectionModel;
@@ -9895,7 +9930,7 @@ class Zl extends hs {
9895
9930
  * @since 1.1.96
9896
9931
  */
9897
9932
  getBodyCellRectInHost(e, t) {
9898
- const s = this.tableModel, o = s.getBodyModel(), i = s.getPadding(), r = this.hostElement.clientWidth, l = this.hostElement.clientHeight, a = i.top + this.getBodyRowTop(e) - this.contentScrollTop, c = this.getColumnLeftInHost(t, s.getXPosByColumnIndex(t)), h = s.getColumnCount(), d = s.getFixedLeftColumnCount(), u = s.getFixedRightColumnCount();
9933
+ const s = this.tableModel, o = s.getBodyModel(), i = s.getPadding(), r = this.getLayoutWidth(), l = this.getLayoutHeight(), a = i.top + this.getBodyRowTop(e) - this.contentScrollTop, c = this.getColumnLeftInHost(t, s.getXPosByColumnIndex(t)), h = s.getColumnCount(), d = s.getFixedLeftColumnCount(), u = s.getFixedRightColumnCount();
9899
9934
  let f = i.left, g = r - i.right;
9900
9935
  return t < d ? (f = 0, g = i.left) : u > 0 && t >= h - u && (f = r - i.right, g = r), {
9901
9936
  left: c,
@@ -9921,7 +9956,7 @@ class Zl extends hs {
9921
9956
  const s = this.tableModel, i = s.getBodyModel().getRowCount(), r = s.getColumnCount();
9922
9957
  if (i < 1 || r < 1)
9923
9958
  return [-1, -1];
9924
- const l = s.getPadding(), a = this.hostElement.clientWidth, c = this.hostElement.clientHeight - l.top - l.bottom, h = Math.min(Math.max(t - l.top, 0), Math.max(0, c - 1)) + this.contentScrollTop, d = this.getBodyRowIndexAtY(h), u = s.getFixedLeftColumnCount(), f = s.getFixedRightColumnCount();
9959
+ const l = s.getPadding(), a = this.getLayoutWidth(), c = this.getLayoutHeight() - l.top - l.bottom, h = Math.min(Math.max(t - l.top, 0), Math.max(0, c - 1)) + this.contentScrollTop, d = this.getBodyRowIndexAtY(h), u = s.getFixedLeftColumnCount(), f = s.getFixedRightColumnCount();
9925
9960
  let g, p, m;
9926
9961
  if (u > 0 && e < l.left)
9927
9962
  [g, p, m] = [0, u - 1, e];
@@ -10139,7 +10174,41 @@ class Zl extends hs {
10139
10174
  */
10140
10175
  recalcColumnWidths(e) {
10141
10176
  const t = this.getAvailableColumnWidth(e);
10142
- t > 0 && this.tableModel.setParentWidth(t), this.tableModel.init(), this.repaintHard();
10177
+ t > 0 && this.setParentWidth(t), this.tableModel.init(), this.repaintHard();
10178
+ }
10179
+ /** `TableModelIf.setParentWidth` – remembers the width for {@link adjustRelativeColumnWidthsToScrollBar}. */
10180
+ setParentWidth(e) {
10181
+ this.relativeWidthsBase = e, this.tableModel.setParentWidth(e);
10182
+ }
10183
+ /** True if a column has a % or weight width (it depends on the width of the host). */
10184
+ hasRelativeColumnWidths() {
10185
+ var e, t, s;
10186
+ return !!((s = (t = (e = this.tableModel).getColumnDefs) == null ? void 0 : t.call(e)) != null && s.some((o) => {
10187
+ var i, r;
10188
+ return ((i = o.width) == null ? void 0 : i.unit) === "weight" || ((r = o.width) == null ? void 0 : r.unit) === "%";
10189
+ }));
10190
+ }
10191
+ adjustContainersAndRows() {
10192
+ super.adjustContainersAndRows(), this.adjustRelativeColumnWidthsToScrollBar();
10193
+ }
10194
+ /**
10195
+ * % and weight columns share the width next to the vertical scroll bar. The bar appears (or disappears) only after
10196
+ * the rows are laid out – the first layout, rows added or removed, a filter: then the columns were computed for the
10197
+ * wrong width – too wide by the width of the bar, so a horizontal scroll bar appeared and covered the last row. Here
10198
+ * they are computed again (once – the flag stops a second pass) with the width that is available now.
10199
+ */
10200
+ adjustRelativeColumnWidthsToScrollBar() {
10201
+ if (this.adjustingRelativeWidths || !this.hasRelativeColumnWidths())
10202
+ return;
10203
+ const e = this.getAvailableColumnWidth();
10204
+ if (!(e <= 0 || e === this.relativeWidthsBase)) {
10205
+ this.adjustingRelativeWidths = !0;
10206
+ try {
10207
+ this.setParentWidth(e), this.tableModel.init(), this.tableModel.recalcPadding(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows();
10208
+ } finally {
10209
+ this.adjustingRelativeWidths = !1;
10210
+ }
10211
+ }
10143
10212
  }
10144
10213
  /**
10145
10214
  * The width that % and weight columns share: host width minus the fixed west columns and a vertical scroll bar.
@@ -10166,7 +10235,7 @@ class Zl extends hs {
10166
10235
  })) {
10167
10236
  this.tableModel.recalcPadding();
10168
10237
  const c = this.getAvailableColumnWidth();
10169
- c > 0 && (this.tableModel.setParentWidth(c), this.tableModel.init());
10238
+ c > 0 && (this.setParentWidth(c), this.tableModel.init());
10170
10239
  }
10171
10240
  this.tableModel.recalcPadding(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows();
10172
10241
  } finally {
@@ -10558,8 +10627,8 @@ class Zl extends hs {
10558
10627
  * @protected
10559
10628
  */
10560
10629
  adjustArea(e, t = 0) {
10561
- var x, E, S, R, F;
10562
- const s = this.getArea(e, "west"), o = this.getArea(e, "center"), i = this.getArea(e, "east"), r = ((x = this.areaHeightsOfRenderPass) == null ? void 0 : x[e]) ?? o.child.clientHeight;
10630
+ var S, E, x, R, F;
10631
+ const s = this.getArea(e, "west"), o = this.getArea(e, "center"), i = this.getArea(e, "east"), r = ((S = this.areaHeightsOfRenderPass) == null ? void 0 : S[e]) ?? o.child.clientHeight;
10563
10632
  s.child.innerText = "", o.child.innerText = "", i.child.innerText = "";
10564
10633
  const l = 0, a = this.areaBodyCenterGeo.width, c = this.tableModel.getPadding(), h = this.tableModel.getAreaModel(e), d = h.getRowCount();
10565
10634
  for (; this.cleanupFunctions[e].length; ) {
@@ -10578,7 +10647,7 @@ class Zl extends hs {
10578
10647
  if (b)
10579
10648
  (E = this.masterDetailService) == null || E.startRenderPass(), u < 0 && d > 0 && (m = b.findIndexAt(-u), u = u + b.getTop(m));
10580
10649
  else {
10581
- const v = (S = h.getConstantRowHeight) == null ? void 0 : S.call(h);
10650
+ const v = (x = h.getConstantRowHeight) == null ? void 0 : x.call(h);
10582
10651
  if (v !== void 0 && v > 0 && u < 0) {
10583
10652
  for (m = Math.min(d, Math.floor(-u / v)); m > 0 && u + m * v > 0; )
10584
10653
  m--;
@@ -10950,17 +11019,17 @@ render scope: this.lastFullVisibleRowIndex <- ` + this.lastFullVisibleRowIndex),
10950
11019
  const b = g, y = this.tableModel.getColumnWidth(m);
10951
11020
  if (y > 0 && b + y > 0) {
10952
11021
  let C = o.height;
10953
- const x = s.getRowspanAt(r, m), E = s.getColspanAt(r, m);
10954
- x > 1 && (C = this.getRowHeights(r, r + x - 1, s).reduce((F, v) => F + v, 0));
10955
- let S = y;
10956
- E > 1 && (S = this.getColumnWidths(m, m + E - 1).reduce((F, v) => F + v, 0));
11022
+ const S = s.getRowspanAt(r, m), E = s.getColspanAt(r, m);
11023
+ S > 1 && (C = this.getRowHeights(r, r + S - 1, s).reduce((F, v) => F + v, 0));
11024
+ let x = y;
11025
+ E > 1 && (x = this.getColumnWidths(m, m + E - 1).reduce((F, v) => F + v, 0));
10957
11026
  let R = !1;
10958
11027
  if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (p = this.colAndRowspanModels[e]) != null && p.isInRange(r, m) && (R = !0), this.draggingTargetColumnIndex === m && e !== "header") {
10959
- this.renderDragTargetDiv(i, b, u, S, C);
10960
- const F = { left: b, top: u, width: S, height: C };
11028
+ this.renderDragTargetDiv(i, b, u, x, C);
11029
+ const F = { left: b, top: u, width: x, height: C };
10961
11030
  this.dom.addColumnBorderDivs(this.tableOptions, i, F, e, t);
10962
11031
  } else {
10963
- const F = this.renderSelectedBackgroundDiv(R, f, t, s, r, m, i, b, u, S, C);
11032
+ const F = this.renderSelectedBackgroundDiv(R, f, t, s, r, m, i, b, u, x, C);
10964
11033
  "gammaCells" in s && s.getValueAt(r, m) && (R = !1), R || this.renderCell({
10965
11034
  areaModel: s,
10966
11035
  areaIdent: e,
@@ -10969,7 +11038,7 @@ render scope: this.lastFullVisibleRowIndex <- ` + this.lastFullVisibleRowIndex),
10969
11038
  columnIndex: m,
10970
11039
  left: b,
10971
11040
  top: u,
10972
- width: S,
11041
+ width: x,
10973
11042
  height: C,
10974
11043
  parent: i,
10975
11044
  cellSelected: F,
@@ -10980,7 +11049,7 @@ render scope: this.lastFullVisibleRowIndex <- ` + this.lastFullVisibleRowIndex),
10980
11049
  columnIndex: m,
10981
11050
  cellLeft: b,
10982
11051
  cellTop: u,
10983
- cellWidth: S,
11052
+ cellWidth: x,
10984
11053
  cellHeight: C,
10985
11054
  parent: i
10986
11055
  });
@@ -11078,9 +11147,9 @@ render scope: this.lastFullVisibleRowIndex <- ` + this.lastFullVisibleRowIndex),
11078
11147
  const L = b;
11079
11148
  ("hasDisplayedChildren" in e && typeof e.hasDisplayedChildren == "function" ? e.hasDisplayedChildren(L) : !!((N = L.children) != null && N.length)) ? L.expanded ? y = "expanded" : y = "collapsed" : y = "hidden";
11080
11149
  }
11081
- let x;
11082
- t === "header" && (!(f != null && f.sortIconVisible) || f != null && f.sortIconVisible()) && (x = f == null ? void 0 : f.sortState);
11083
- const E = t === "body" && ((ue = this.batchEditService) != null && ue.hasPending()) ? this.batchEditService.getPendingAt(o, i) : void 0, S = E ? E.newValue : e.getValueAt(o, i), R = p || g && t === "footer" ? "" : `${S ?? ""}`, F = e.isRowChecked(o), v = this.getFirstDataColumnIndex(), D = this.tableOptions.showCheckboxWihoutExtraColumn && i === v && F ? this.getCheckboxAriaLabel(t, o) : void 0, k = this.dom.addColumnDiv(
11150
+ let S;
11151
+ t === "header" && (!(f != null && f.sortIconVisible) || f != null && f.sortIconVisible()) && (S = f == null ? void 0 : f.sortState);
11152
+ const E = t === "body" && ((ue = this.batchEditService) != null && ue.hasPending()) ? this.batchEditService.getPendingAt(o, i) : void 0, x = E ? E.newValue : e.getValueAt(o, i), R = p || g && t === "footer" ? "" : `${x ?? ""}`, F = e.isRowChecked(o), v = this.getFirstDataColumnIndex(), D = this.tableOptions.showCheckboxWihoutExtraColumn && i === v && F ? this.getCheckboxAriaLabel(t, o) : void 0, k = this.dom.addColumnDiv(
11084
11153
  {
11085
11154
  parent: h,
11086
11155
  geo: m,
@@ -11092,7 +11161,7 @@ render scope: this.lastFullVisibleRowIndex <- ` + this.lastFullVisibleRowIndex),
11092
11161
  treeArrow: y,
11093
11162
  tableOptions: this.tableOptions,
11094
11163
  checkedType: F,
11095
- sortState: x,
11164
+ sortState: S,
11096
11165
  checkboxAriaLabel: D,
11097
11166
  firstDataColumnIndex: v
11098
11167
  }
@@ -11100,7 +11169,7 @@ render scope: this.lastFullVisibleRowIndex <- ` + this.lastFullVisibleRowIndex),
11100
11169
  $ && this.dom.setAttribute(k, "title", $), E && (this.dom.addClass("ge-table-cell-pending", k), E.error && (this.dom.addClass("ge-table-cell-invalid", k), this.dom.setAttribute(k, "aria-invalid", "true"))), f && f.classes[t] && this.dom.addClasses(f.classes[t], k);
11101
11170
  let z;
11102
11171
  if (p)
11103
- if (z = p.render(k, o, i, t, e, S, this.dom.domService), u) {
11172
+ if (z = p.render(k, o, i, t, e, x, this.dom.domService), u) {
11104
11173
  const L = k.querySelector("input, select");
11105
11174
  if (L) {
11106
11175
  this.labelControl(L, this.getColumnAriaLabel(i));
@@ -11356,12 +11425,12 @@ render scope: this.lastFullVisibleRowIndex <- ` + this.lastFullVisibleRowIndex),
11356
11425
  sideIdent: r,
11357
11426
  text: b
11358
11427
  }, C = this.dom.addColumnDiv(y);
11359
- let x;
11360
- m && (x = m.render(C, d, c, t, l, p, this.dom.domService), x && this.cleanupFunctions[t].push(x));
11428
+ let S;
11429
+ m && (S = m.render(C, d, c, t, l, p, this.dom.domService), S && this.cleanupFunctions[t].push(S));
11361
11430
  const E = l.getCustomClassesAt(d, c);
11362
11431
  E.length && this.dom.addClasses(E, C);
11363
- const S = this.tableModel.getColumnDef(c);
11364
- S && S.classes[t] && this.dom.addClasses(S.classes[t], C), this.dom.addColumnBorderDivs(this.tableOptions, h, g, t, r);
11432
+ const x = this.tableModel.getColumnDef(c);
11433
+ x && x.classes[t] && this.dom.addClasses(x.classes[t], C), this.dom.addColumnBorderDivs(this.tableOptions, h, g, t, r);
11365
11434
  const R = l.getCustomStyleAt(d, c);
11366
11435
  if (R)
11367
11436
  for (const F in R)
@@ -11563,7 +11632,7 @@ const oa = {
11563
11632
  scroll: "autoRestoreScrollPosition",
11564
11633
  custom: "autoRestoreCustomState",
11565
11634
  details: "autoRestoreDetailState"
11566
- }, Ge = (n) => n === "checked" ? "checkedRowIds" : n === "details" ? "detailRowIds" : n, Ae = Number.MAX_SAFE_INTEGER, Ee = class Ee {
11635
+ }, We = (n) => n === "checked" ? "checkedRowIds" : n === "details" ? "detailRowIds" : n, Ae = Number.MAX_SAFE_INTEGER, Ee = class Ee {
11567
11636
  constructor(e) {
11568
11637
  this.scope = e, this.restoring = !1, this.started = !1, this.destroyed = !1, this.dirty = /* @__PURE__ */ new Set(), this.lastReported = /* @__PURE__ */ new Map(), this.reported = { version: 1 }, this.legacyRemoved = !1, this.sortPriority = [], this.initialWidths = /* @__PURE__ */ new Map(), this.startState = {}, this.custom = void 0, this.warnedNoRowObject = !1, this.warnedNoId = !1, this.warnWithoutStorageKey();
11569
11638
  }
@@ -11582,7 +11651,7 @@ const oa = {
11582
11651
  for (const s of this.columnDefs())
11583
11652
  this.initialWidths.set(s, s.width);
11584
11653
  this.sortPriority = this.columnDefs().filter((s) => s.sortState && s.property).map((s) => s.property);
11585
- const e = (s) => this.persistedParts().includes(s) || this.startState[Ge(s)] !== void 0, t = this.getState(He.filter((s) => s !== "headerGroups" && s !== "scroll" && s !== "custom" && (!Ee.EXPENSIVE.includes(s) || e(s))));
11654
+ const e = (s) => this.persistedParts().includes(s) || this.startState[We(s)] !== void 0, t = this.getState(He.filter((s) => s !== "headerGroups" && s !== "scroll" && s !== "custom" && (!Ee.EXPENSIVE.includes(s) || e(s))));
11586
11655
  this.defaultState = { ...this.defaultState, ...t, scroll: { left: 0, top: 0 } }, this.startState.columns && this.applyColumns(this.startState.columns, !1);
11587
11656
  }
11588
11657
  /** After the external filter: tree, sorting, checked rows, selection. */
@@ -11620,7 +11689,7 @@ const oa = {
11620
11689
  applyState(e, t = He) {
11621
11690
  if (!e || typeof e != "object")
11622
11691
  return;
11623
- const s = (r) => t.includes(r) && e[Ge(r)] !== void 0, o = [];
11692
+ const s = (r) => t.includes(r) && e[We(r)] !== void 0, o = [];
11624
11693
  let i = !1;
11625
11694
  s("headerGroups") && this.applyHeaderGroups(e.headerGroups) && o.push("headerGroups"), s("columns") && (i = this.applyColumns(e.columns, !0), o.push("columns")), s("tree") && (this.applyTree(e.tree), o.push("tree")), s("sort") && (this.applySort(e.sort), o.push("sort")), s("checked") && (this.applyChecked(e.checkedRowIds), o.push("checked")), s("selection") && (this.applySelection(e.selection), o.push("selection")), s("details") && (this.applyDetails(e.detailRowIds), o.push("details")), t.includes("custom") && "custom" in e && (this.custom = e.custom, o.push("custom")), o.includes("headerGroups") ? this.scope.headerGroupsChanged() : i ? this.scope.recalcColumnWidths() : o.length && (this.scope.tableModel.recalcHeightAndPadding(), this.scope.recalcWrappers(), this.scope.repaintHard()), s("scroll") && (this.applyScroll(e.scroll), o.push("scroll")), o.forEach((r) => this.markDirty(r));
11626
11695
  }
@@ -11680,7 +11749,7 @@ const oa = {
11680
11749
  return;
11681
11750
  const o = { ...this.reported };
11682
11751
  for (const i of e) {
11683
- const r = Ge(i);
11752
+ const r = We(i);
11684
11753
  t[r] === void 0 ? delete o[r] : o[r] = t[r], this.lastReported.set(i, this.partJson(t, i));
11685
11754
  }
11686
11755
  this.reported = o, t.scroll && (this.reportedScroll = { left: t.scroll.left, top: t.scroll.top }), this.persist(o), this.scope.stateChanged(new ea(JSON.parse(JSON.stringify(o)), s));
@@ -11742,7 +11811,7 @@ const oa = {
11742
11811
  const r = { ...e };
11743
11812
  if (i)
11744
11813
  for (const l of t) {
11745
- const a = Ge(l);
11814
+ const a = We(l);
11746
11815
  a in i && (r[a] = i[a]);
11747
11816
  }
11748
11817
  return r;
@@ -11753,7 +11822,7 @@ const oa = {
11753
11822
  return;
11754
11823
  const i = { version: 1 };
11755
11824
  for (const l of t) {
11756
- const a = Ge(l);
11825
+ const a = We(l);
11757
11826
  e[a] !== void 0 && (i[a] = e[a]);
11758
11827
  }
11759
11828
  const r = JSON.stringify(i);
@@ -11766,10 +11835,10 @@ const oa = {
11766
11835
  rememberAsReported(e) {
11767
11836
  this.reported = e, e.scroll && (this.reportedScroll = { left: e.scroll.left, top: e.scroll.top });
11768
11837
  for (const t of He)
11769
- Ge(t) in e && this.lastReported.set(t, this.partJson(e, t));
11838
+ We(t) in e && this.lastReported.set(t, this.partJson(e, t));
11770
11839
  }
11771
11840
  partJson(e, t) {
11772
- const s = e[Ge(t)];
11841
+ const s = e[We(t)];
11773
11842
  return s === void 0 ? "" : JSON.stringify(s);
11774
11843
  }
11775
11844
  // ------------------------------------------------------------------ compute
@@ -13203,7 +13272,7 @@ class wa {
13203
13272
  return a;
13204
13273
  }
13205
13274
  }
13206
- const xs = class xs {
13275
+ const Ss = class Ss {
13207
13276
  constructor(e, t, s) {
13208
13277
  this.document = e, this.id = t, this.domService = s;
13209
13278
  }
@@ -13213,7 +13282,7 @@ const xs = class xs {
13213
13282
  * @param {string} text - plain text
13214
13283
  * @param {number} [delayInMs=LiveAnnouncer.defaultDelayInMs] - wait this long before the text is written
13215
13284
  */
13216
- announce(e, t = xs.defaultDelayInMs) {
13285
+ announce(e, t = Ss.defaultDelayInMs) {
13217
13286
  const s = this.getOrCreateElement();
13218
13287
  s && (this.timeout && clearTimeout(this.timeout), s.textContent = "", this.pendingText = e, this.timeout = setTimeout(() => {
13219
13288
  this.timeout = void 0, this.pendingText = void 0, s.textContent = e;
@@ -13269,8 +13338,8 @@ const xs = class xs {
13269
13338
  return t.appendChild(e, s), this.element = s, s;
13270
13339
  }
13271
13340
  };
13272
- xs.defaultDelayInMs = 150;
13273
- let ro = xs;
13341
+ Ss.defaultDelayInMs = 150;
13342
+ let ro = Ss;
13274
13343
  class Lo {
13275
13344
  constructor() {
13276
13345
  this.managed = !0, this.multiRow = !0, this.treeDropInside = !0, this.dragThresholdInPx = 4, this.autoScrollZoneInPx = 40, this.autoScrollMaxSpeedInPx = 24, this.ghostText = void 0;
@@ -13445,7 +13514,7 @@ class Ca {
13445
13514
  t.lastEvent = e;
13446
13515
  const { target: s, outside: o } = this.computeTarget(e.clientX, e.clientY);
13447
13516
  let i = s && this.isValidTarget(t.rowIndices, s) ? s : void 0;
13448
- if (!xa(i, t.target) || o !== t.outside) {
13517
+ if (!Sa(i, t.target) || o !== t.outside) {
13449
13518
  const c = this.createEvent("move", "pointer", t.rows, t.rowIndices, i, o, e);
13450
13519
  if ((a = (l = this.tableScope.getEventListener()).onRowDragMove) == null || a.call(l, c), this.session !== t)
13451
13520
  return;
@@ -13615,7 +13684,7 @@ class Ca {
13615
13684
  * @returns {boolean} true if the key was used (a row with a drag handle has the focus)
13616
13685
  */
13617
13686
  moveByKeyboard(e) {
13618
- var p, m, b, y, C, x;
13687
+ var p, m, b, y, C, S;
13619
13688
  const t = this.tableScope;
13620
13689
  if (this.session || t.isEditing())
13621
13690
  return !1;
@@ -13637,7 +13706,7 @@ class Ca {
13637
13706
  const E = this.moveRows(a, c, !0);
13638
13707
  g.moved = E > -1, g.moved && (g.toIndex = E);
13639
13708
  }
13640
- return (x = (C = t.getEventListener()).onRowDragEnd) == null || x.call(C, g), !0;
13709
+ return (S = (C = t.getEventListener()).onRowDragEnd) == null || S.call(C, g), !0;
13641
13710
  }
13642
13711
  getFlatKeyboardTarget(e, t, s) {
13643
13712
  if (t < 0) {
@@ -13726,7 +13795,7 @@ class Ca {
13726
13795
  };
13727
13796
  }
13728
13797
  }
13729
- function xa(n, e) {
13798
+ function Sa(n, e) {
13730
13799
  return n === e || !!n && !!e && n.rowIndex === e.rowIndex && n.position === e.position;
13731
13800
  }
13732
13801
  class Fo {
@@ -13750,7 +13819,7 @@ function $t(n, e) {
13750
13819
  const t = (s) => s == null || s === "";
13751
13820
  return t(n) || t(e) ? t(n) && t(e) : n instanceof Date && e instanceof Date ? n.getTime() === e.getTime() || isNaN(n.getTime()) && isNaN(e.getTime()) : typeof n == "number" && typeof e == "string" || typeof n == "string" && typeof e == "number" ? String(n) === String(e) : !1;
13752
13821
  }
13753
- class Sa {
13822
+ class xa {
13754
13823
  constructor() {
13755
13824
  this.rows = /* @__PURE__ */ new Map(), this.count = 0;
13756
13825
  }
@@ -13859,7 +13928,7 @@ function Br(n, e, t, s) {
13859
13928
  }
13860
13929
  class Ra {
13861
13930
  constructor(e) {
13862
- this.tableScope = e, this.pending = new Sa(), this.started = !1;
13931
+ this.tableScope = e, this.pending = new xa(), this.started = !1;
13863
13932
  }
13864
13933
  /** The options of this table ({@link TableOptionsIf.batchEdit} + defaults). */
13865
13934
  get options() {
@@ -14112,17 +14181,17 @@ function Ma(n, e, t = !1, s = "auto") {
14112
14181
  const i = Array.from({ length: e }, (a, c) => t ? -(c + 1) : c + 1), r = () => i.map((a) => Ia(n, a));
14113
14182
  if (s === "copy")
14114
14183
  return r();
14115
- const l = Gr(n, s === "alternate");
14184
+ const l = Wr(n, s === "alternate");
14116
14185
  return l ? i.map(l) : r();
14117
14186
  }
14118
14187
  function Ta(n, e = "auto") {
14119
- return e !== "copy" && n.length > 0 && !!Gr(n, e === "alternate");
14188
+ return e !== "copy" && n.length > 0 && !!Wr(n, e === "alternate");
14120
14189
  }
14121
14190
  function Ia(n, e) {
14122
14191
  const t = n.length;
14123
14192
  return e > 0 ? n[(e - 1) % t] : n[t - 1 - (-e - 1) % t];
14124
14193
  }
14125
- function Gr(n, e) {
14194
+ function Wr(n, e) {
14126
14195
  const s = n.length === 1 ? e : !e, o = !e;
14127
14196
  if (n.every(Da))
14128
14197
  return s ? Ci(n, (i) => i) : void 0;
@@ -14157,17 +14226,17 @@ function Da(n) {
14157
14226
  function yi(n) {
14158
14227
  return n instanceof Date && !isNaN(n.getTime());
14159
14228
  }
14160
- function Gs(n) {
14229
+ function Ws(n) {
14161
14230
  const e = Number(n.toPrecision(15));
14162
14231
  return e === 0 ? 0 : e;
14163
14232
  }
14164
14233
  function Ci(n, e) {
14165
14234
  const t = n.length, s = n[t - 1];
14166
14235
  if (t === 1)
14167
- return (u) => e(Gs(s + u));
14236
+ return (u) => e(Ws(s + u));
14168
14237
  const o = n[1] - n[0];
14169
14238
  if (n.every((u, f) => f === 0 || Math.abs(u - n[f - 1] - o) <= 1e-9 * Math.max(1, Math.abs(o))))
14170
- return (u) => e(Gs(u > 0 ? s + o * u : n[0] + o * u));
14239
+ return (u) => e(Ws(u > 0 ? s + o * u : n[0] + o * u));
14171
14240
  const r = (t - 1) / 2, l = n.reduce((u, f) => u + f, 0) / t;
14172
14241
  let a = 0, c = 0;
14173
14242
  n.forEach((u, f) => {
@@ -14176,13 +14245,13 @@ function Ci(n, e) {
14176
14245
  const h = a / c, d = l - h * r;
14177
14246
  return (u) => {
14178
14247
  const f = u > 0 ? t - 1 + u : u;
14179
- return e(Gs(d + h * f));
14248
+ return e(Ws(d + h * f));
14180
14249
  };
14181
14250
  }
14182
14251
  function ka(n) {
14183
- return n.d === Wr(n.y, n.m);
14252
+ return n.d === Gr(n.y, n.m);
14184
14253
  }
14185
- function Wr(n, e) {
14254
+ function Gr(n, e) {
14186
14255
  return Ds(n, e + 1, 0).getUTCDate();
14187
14256
  }
14188
14257
  function Ds(n, e, t) {
@@ -14192,7 +14261,7 @@ function Ds(n, e, t) {
14192
14261
  function vt(n) {
14193
14262
  return n.y * 12 + n.m;
14194
14263
  }
14195
- function xi(n) {
14264
+ function Si(n) {
14196
14265
  return Math.round(Ds(n.y, n.m, n.d).getTime() / Ea);
14197
14266
  }
14198
14267
  function Ur(n) {
@@ -14202,13 +14271,13 @@ function Ur(n) {
14202
14271
  const t = n.every(ka), s = n.every((r) => r.d === n[0].d), o = vt(n[1]) - vt(n[0]);
14203
14272
  if ((s || t) && o !== 0 && n.every((r, l) => l === 0 || vt(r) - vt(n[l - 1]) === o))
14204
14273
  return { months: o, days: 0, monthEnd: t && !s };
14205
- const i = xi(n[e - 1]) - xi(n[0]);
14274
+ const i = Si(n[e - 1]) - Si(n[0]);
14206
14275
  return { months: 0, days: Math.round(i / (e - 1)), monthEnd: !1 };
14207
14276
  }
14208
14277
  function Kr(n, e, t) {
14209
14278
  const s = e > 0 ? n[n.length - 1] : n[0];
14210
14279
  if (t.months) {
14211
- const i = vt(s) + t.months * e, r = Math.floor(i / 12), l = i - r * 12, a = Wr(r, l);
14280
+ const i = vt(s) + t.months * e, r = Math.floor(i / 12), l = i - r * 12, a = Gr(r, l);
14212
14281
  return { y: r, m: l, d: t.monthEnd ? a : Math.min(s.d, a) };
14213
14282
  }
14214
14283
  const o = Ds(s.y, s.m, s.d + t.days * e);
@@ -14276,17 +14345,17 @@ function Na(n) {
14276
14345
  m.push(o(...p(C)));
14277
14346
  const b = Ma(m, s, l, i), y = Ta(m, i);
14278
14347
  for (let C = 0; C < s; C++) {
14279
- const x = l ? d - 1 - C : u + 1 + C, [E, S] = p(x);
14280
- if (n.isFillable && !n.isFillable(E, S))
14348
+ const S = l ? d - 1 - C : u + 1 + C, [E, x] = p(S);
14349
+ if (n.isFillable && !n.isFillable(E, x))
14281
14350
  continue;
14282
14351
  let R = b[C];
14283
14352
  if (n.fillValue) {
14284
- const F = ((f = n.getCellInfo) == null ? void 0 : f.call(n, E, S)) ?? { row: void 0, property: "" }, v = n.fillValue({
14353
+ const F = ((f = n.getCellInfo) == null ? void 0 : f.call(n, E, x)) ?? { row: void 0, property: "" }, v = n.fillValue({
14285
14354
  sourceValues: m,
14286
14355
  step: l ? -(C + 1) : C + 1,
14287
14356
  direction: t,
14288
14357
  rowIndex: E,
14289
- columnIndex: S,
14358
+ columnIndex: x,
14290
14359
  property: F.property,
14291
14360
  row: F.row,
14292
14361
  defaultValue: R,
@@ -14294,12 +14363,12 @@ function Na(n) {
14294
14363
  });
14295
14364
  v !== void 0 && (R = v);
14296
14365
  }
14297
- a.push({ rowIndex: E, column: S, value: R });
14366
+ a.push({ rowIndex: E, column: x, value: R });
14298
14367
  }
14299
14368
  }
14300
14369
  return a;
14301
14370
  }
14302
- const Si = "fill-handle";
14371
+ const xi = "fill-handle";
14303
14372
  class Va {
14304
14373
  constructor(e) {
14305
14374
  this.tableScope = e, this.autoScrollFrame = 0, this.suppressClick = !1, this.shortcutsSet = !1;
@@ -14353,7 +14422,7 @@ class Va {
14353
14422
  ensureHandle() {
14354
14423
  if (!this.handle || !this.handle.isConnected) {
14355
14424
  const e = this.tableScope.getDomService();
14356
- this.handle = e.setAriaHidden(e.createDivWithClass("ge-table-fill-handle", this.tableScope.hostElement)), e.domService.setAttribute(this.handle, "data-ge-action", Si);
14425
+ this.handle = e.setAriaHidden(e.createDivWithClass("ge-table-fill-handle", this.tableScope.hostElement)), e.domService.setAttribute(this.handle, "data-ge-action", xi);
14357
14426
  }
14358
14427
  return this.handle;
14359
14428
  }
@@ -14368,7 +14437,7 @@ class Va {
14368
14437
  }
14369
14438
  // ---------------------------------------------------------------- pointer
14370
14439
  isHandle(e) {
14371
- return e instanceof Element && !!e.closest(`[data-ge-action="${Si}"]`) && this.tableScope.hostElement.contains(e);
14440
+ return e instanceof Element && !!e.closest(`[data-ge-action="${xi}"]`) && this.tableScope.hostElement.contains(e);
14372
14441
  }
14373
14442
  onPointerDown(e) {
14374
14443
  if (this.session || this.pending || e.pointerType === "mouse" && e.button !== 0 || !this.isHandle(e.target))
@@ -14455,8 +14524,8 @@ class Va {
14455
14524
  }
14456
14525
  // ---------------------------------------------------------------- auto-scroll
14457
14526
  updateAutoScroll(e, t) {
14458
- const s = this.session, { autoScrollZoneInPx: o, autoScrollMaxSpeedInPx: i } = s.options, r = this.tableScope, l = r.tableModel.getPadding(), a = r.hostElement, c = (g) => Math.max(1, Math.round(i * Math.min(1, g / o) ** 2)), h = l.top, d = a.clientHeight - l.bottom, u = l.left, f = a.clientWidth - l.right;
14459
- s.speedY = o <= 0 || i <= 0 ? 0 : t < h + o ? -c(h + o - t) : t > d - o ? c(t - (d - o)) : 0, s.speedX = o <= 0 || i <= 0 ? 0 : e < u + o && e >= u - o ? -c(u + o - e) : e > f - o ? c(e - (f - o)) : 0, (s.speedX || s.speedY) && !this.autoScrollFrame ? this.autoScrollFrame = requestAnimationFrame(() => this.autoScrollStep()) : !s.speedX && !s.speedY && (s.lastFrameTime = void 0, s.remainderX = 0, s.remainderY = 0);
14527
+ const s = this.session, { autoScrollZoneInPx: o, autoScrollMaxSpeedInPx: i } = s.options, r = this.tableScope, l = r.tableModel.getPadding(), a = (f) => Math.max(1, Math.round(i * Math.min(1, f / o) ** 2)), c = l.top, h = r.getLayoutHeight() - l.bottom, d = l.left, u = r.getLayoutWidth() - l.right;
14528
+ s.speedY = o <= 0 || i <= 0 ? 0 : t < c + o ? -a(c + o - t) : t > h - o ? a(t - (h - o)) : 0, s.speedX = o <= 0 || i <= 0 ? 0 : e < d + o && e >= d - o ? -a(d + o - e) : e > u - o ? a(e - (u - o)) : 0, (s.speedX || s.speedY) && !this.autoScrollFrame ? this.autoScrollFrame = requestAnimationFrame(() => this.autoScrollStep()) : !s.speedX && !s.speedY && (s.lastFrameTime = void 0, s.remainderX = 0, s.remainderY = 0);
14460
14529
  }
14461
14530
  autoScrollStep() {
14462
14531
  this.autoScrollFrame = 0;
@@ -15211,9 +15280,9 @@ class It {
15211
15280
  this.type = e, this.rowIndex = t, this.columnIndex = s, this.mode = o, this.input = i;
15212
15281
  }
15213
15282
  }
15214
- const Ga = function(n, e, t) {
15283
+ const Wa = function(n, e, t) {
15215
15284
  return n === "" || n === null || n === void 0 ? "" : Number(n);
15216
- }, A = (n, e, t, s) => Object.freeze({ name: e, signature: `${e}(${t})`, description: s, group: n }), Wa = Object.freeze([
15285
+ }, A = (n, e, t, s) => Object.freeze({ name: e, signature: `${e}(${t})`, description: s, group: n }), Ga = Object.freeze([
15217
15286
  A("Math", "ABS", "number", "The absolute value"),
15218
15287
  A("Logic", "AND", "logical1, [logical2], …", "TRUE if all arguments are TRUE"),
15219
15288
  A("Math", "AVERAGE", "number1, [number2], …", "The average of the numbers"),
@@ -15386,13 +15455,13 @@ function Xa(n, e) {
15386
15455
  const o = n[s];
15387
15456
  if (o === '"') {
15388
15457
  const i = Po(n, s);
15389
- if (i > e) return Ws(t);
15458
+ if (i > e) return Gs(t);
15390
15459
  s = i;
15391
15460
  continue;
15392
15461
  }
15393
15462
  if (o === "[") {
15394
15463
  const i = n.indexOf("]", s);
15395
- if (i < 0 || i >= e) return Ws(t);
15464
+ if (i < 0 || i >= e) return Gs(t);
15396
15465
  s = i + 1;
15397
15466
  continue;
15398
15467
  }
@@ -15403,9 +15472,9 @@ function Xa(n, e) {
15403
15472
  } else o === ")" ? t.pop() : (o === "," || o === ";") && t.length && t[t.length - 1].argument++;
15404
15473
  s++;
15405
15474
  }
15406
- return Ws(t);
15475
+ return Gs(t);
15407
15476
  }
15408
- function Ws(n) {
15477
+ function Gs(n) {
15409
15478
  for (let e = n.length - 1; e >= 0; e--)
15410
15479
  if (n[e].name) return n[e];
15411
15480
  }
@@ -15419,7 +15488,7 @@ class Za {
15419
15488
  this.scope = e, this.sheet = t, this.input = s, this.editedCell = i, this.changed = r, this.frames = [], this.suggestions = [], this.active = 0, this.listClosed = !1, this.composing = !1, this.abort = new AbortController(), this.ids = { list: `${l}-functions`, hint: `${l}-hint`, option: (d) => `${l}-fn-${d.replace(/[^A-Za-z0-9_-]/g, "_")}` };
15420
15489
  const a = Object.keys(t.options.functions ?? {}).map((d) => d.toUpperCase());
15421
15490
  this.functions = [
15422
- ...Wa.filter((d) => !a.includes(d.name)),
15491
+ ...Ga.filter((d) => !a.includes(d.name)),
15423
15492
  ...a.map((d) => ({ name: d, signature: `${d}(…)`, description: "", group: "Math" }))
15424
15493
  ].sort((d, u) => d.name.localeCompare(u.name));
15425
15494
  const c = e.getDomService().domService;
@@ -15940,7 +16009,7 @@ class ec {
15940
16009
  const t = (r = e.columnDef) == null ? void 0 : r.editor;
15941
16010
  if (typeof t == "function")
15942
16011
  return t(e);
15943
- const s = this.tableScope.getTypedCellValue(e.rowIndex, e.columnIndex), o = s !== e.value, i = t ?? (s instanceof Date && !o ? "date" : typeof s == "number" || ((l = e.columnDef) == null ? void 0 : l.editInputPipe) === Ga ? "number" : "text");
16012
+ const s = this.tableScope.getTypedCellValue(e.rowIndex, e.columnIndex), o = s !== e.value, i = t ?? (s instanceof Date && !o ? "date" : typeof s == "number" || ((l = e.columnDef) == null ? void 0 : l.editInputPipe) === Wa ? "number" : "text");
15944
16013
  return i === "number" ? new $a() : i === "date" ? new Ha() : new Vo();
15945
16014
  }
15946
16015
  /** The row moved (sorting, filter, inserted rows): the editor follows it; `false` if it is gone. */
@@ -16204,7 +16273,7 @@ function yt(n, e) {
16204
16273
  if (typeof r == "number") t.push(r);
16205
16274
  else if (r !== null && typeof r == "object") {
16206
16275
  if (w(r)) return r;
16207
- W(r) && t.push(r.serial);
16276
+ G(r) && t.push(r.serial);
16208
16277
  }
16209
16278
  }
16210
16279
  else {
@@ -16212,7 +16281,7 @@ function yt(n, e) {
16212
16281
  return s;
16213
16282
  if (typeof s == "number")
16214
16283
  t.push(s);
16215
- else if (W(s))
16284
+ else if (G(s))
16216
16285
  t.push(s.serial);
16217
16286
  else if (s !== null) {
16218
16287
  const o = K(s, e);
@@ -16246,14 +16315,14 @@ function rc(n, e) {
16246
16315
  if (w(t)) return () => !1;
16247
16316
  const s = (h) => {
16248
16317
  if (typeof h == "number") return h;
16249
- if (W(h)) return h.serial;
16318
+ if (G(h)) return h.serial;
16250
16319
  if (typeof h == "string" && h.trim() !== "") {
16251
16320
  const d = K(h, e);
16252
16321
  return w(d) ? void 0 : d;
16253
16322
  }
16254
16323
  };
16255
- if (typeof t == "number" || W(t)) {
16256
- const h = W(t) ? t.serial : t;
16324
+ if (typeof t == "number" || G(t)) {
16325
+ const h = G(t) ? t.serial : t;
16257
16326
  return (d) => s(d) === h;
16258
16327
  }
16259
16328
  if (typeof t == "boolean")
@@ -16468,7 +16537,7 @@ const Us = (n) => ({
16468
16537
  const s = oc(e[0], t);
16469
16538
  if (w(s)) return s;
16470
16539
  const o = n(s);
16471
- return w(o) ? o : G(o);
16540
+ return w(o) ? o : W(o);
16472
16541
  }
16473
16542
  }), Qt = (n) => ({
16474
16543
  min: 1,
@@ -16481,18 +16550,18 @@ const Us = (n) => ({
16481
16550
  // ------------------------------------------------------------------------------------------------ math
16482
16551
  SUM: { min: 1, max: 255, fn: (n, e) => {
16483
16552
  const t = yt(n, e);
16484
- return w(t) ? t : G(t.reduce((s, o) => s + o, 0));
16553
+ return w(t) ? t : W(t.reduce((s, o) => s + o, 0));
16485
16554
  } },
16486
16555
  PRODUCT: { min: 1, max: 255, fn: (n, e) => {
16487
16556
  const t = yt(n, e);
16488
- return w(t) ? t : G(t.length ? t.reduce((s, o) => s * o, 1) : 0);
16557
+ return w(t) ? t : W(t.length ? t.reduce((s, o) => s * o, 1) : 0);
16489
16558
  } },
16490
16559
  AVERAGE: {
16491
16560
  min: 1,
16492
16561
  max: 255,
16493
16562
  fn: (n, e) => {
16494
16563
  const t = yt(n, e);
16495
- return w(t) ? t : t.length ? G(t.reduce((s, o) => s + o, 0) / t.length) : et("AVERAGE of no numbers");
16564
+ return w(t) ? t : t.length ? W(t.reduce((s, o) => s + o, 0) / t.length) : et("AVERAGE of no numbers");
16496
16565
  }
16497
16566
  },
16498
16567
  MIN: { min: 1, max: 255, fn: (n, e) => {
@@ -16509,7 +16578,7 @@ const Us = (n) => ({
16509
16578
  fn: (n, e) => {
16510
16579
  let t = 0;
16511
16580
  return rt(n, (s, o) => {
16512
- (typeof s == "number" || W(s) || !o && (typeof s == "boolean" || typeof s == "string" && !w(K(s, e)))) && t++;
16581
+ (typeof s == "number" || G(s) || !o && (typeof s == "boolean" || typeof s == "string" && !w(K(s, e)))) && t++;
16513
16582
  }), t;
16514
16583
  }
16515
16584
  },
@@ -16542,24 +16611,24 @@ const Us = (n) => ({
16542
16611
  for (const l of e) {
16543
16612
  const a = l.get(o, i);
16544
16613
  if (w(a)) return a;
16545
- r *= typeof a == "number" ? a : W(a) ? a.serial : 0;
16614
+ r *= typeof a == "number" ? a : G(a) ? a.serial : 0;
16546
16615
  }
16547
16616
  s += r;
16548
16617
  }
16549
- return G(s);
16618
+ return W(s);
16550
16619
  }
16551
16620
  },
16552
16621
  ROUND: { min: 2, max: 2, fn: (n, e) => {
16553
16622
  const t = Ce(n, e);
16554
- return w(t) ? t : G(Mo(t[0], t[1]));
16623
+ return w(t) ? t : W(Mo(t[0], t[1]));
16555
16624
  } },
16556
16625
  ROUNDUP: { min: 2, max: 2, fn: (n, e) => {
16557
16626
  const t = Ce(n, e);
16558
- return w(t) ? t : G(Mi(t[0], t[1], !0));
16627
+ return w(t) ? t : W(Mi(t[0], t[1], !0));
16559
16628
  } },
16560
16629
  ROUNDDOWN: { min: 2, max: 2, fn: (n, e) => {
16561
16630
  const t = Ce(n, e);
16562
- return w(t) ? t : G(Mi(t[0], t[1], !1));
16631
+ return w(t) ? t : W(Mi(t[0], t[1], !1));
16563
16632
  } },
16564
16633
  INT: Us((n) => Math.floor(me(n))),
16565
16634
  ABS: Us(Math.abs),
@@ -16569,7 +16638,7 @@ const Us = (n) => ({
16569
16638
  max: 2,
16570
16639
  fn: (n, e) => {
16571
16640
  const t = Ce(n, e);
16572
- return w(t) ? t : t[1] === 0 ? et("MOD by zero") : G(t[0] - t[1] * Math.floor(me(t[0] / t[1])));
16641
+ return w(t) ? t : t[1] === 0 ? et("MOD by zero") : W(t[0] - t[1] * Math.floor(me(t[0] / t[1])));
16573
16642
  }
16574
16643
  },
16575
16644
  POWER: {
@@ -16577,7 +16646,7 @@ const Us = (n) => ({
16577
16646
  max: 2,
16578
16647
  fn: (n, e) => {
16579
16648
  const t = Ce(n, e);
16580
- return w(t) ? t : t[0] === 0 && t[1] === 0 ? pe("0^0") : t[0] === 0 && t[1] < 0 ? et("0 to a negative power") : G(Math.pow(t[0], t[1]));
16649
+ return w(t) ? t : t[0] === 0 && t[1] === 0 ? pe("0^0") : t[0] === 0 && t[1] < 0 ? et("0 to a negative power") : W(Math.pow(t[0], t[1]));
16581
16650
  }
16582
16651
  },
16583
16652
  FLOOR: {
@@ -16587,7 +16656,7 @@ const Us = (n) => ({
16587
16656
  const t = Ce(n, e);
16588
16657
  if (w(t)) return t;
16589
16658
  const [s, o] = t;
16590
- return o === 0 ? s === 0 ? 0 : et("FLOOR with significance 0") : s > 0 && o < 0 ? pe("FLOOR: a positive number with a negative significance") : G(Math.floor(me(s / o)) * o);
16659
+ return o === 0 ? s === 0 ? 0 : et("FLOOR with significance 0") : s > 0 && o < 0 ? pe("FLOOR: a positive number with a negative significance") : W(Math.floor(me(s / o)) * o);
16591
16660
  }
16592
16661
  },
16593
16662
  CEILING: {
@@ -16597,7 +16666,7 @@ const Us = (n) => ({
16597
16666
  const t = Ce(n, e);
16598
16667
  if (w(t)) return t;
16599
16668
  const [s, o] = t;
16600
- return o === 0 ? 0 : s > 0 && o < 0 ? pe("CEILING: a positive number with a negative significance") : G(Math.ceil(me(s / o)) * o);
16669
+ return o === 0 ? 0 : s > 0 && o < 0 ? pe("CEILING: a positive number with a negative significance") : W(Math.ceil(me(s / o)) * o);
16601
16670
  }
16602
16671
  },
16603
16672
  RAND: { min: 0, max: 0, volatile: !0, fn: (n, e) => e.random() },
@@ -16620,8 +16689,8 @@ const Us = (n) => ({
16620
16689
  let t = 0;
16621
16690
  return tt([[n[0], n[1]]], n[2] !== void 0 ? fe(n[2]) : void 0, e, (o) => {
16622
16691
  if (w(o)) return o;
16623
- typeof o == "number" ? t += o : W(o) && (t += o.serial);
16624
- }) ?? G(t);
16692
+ typeof o == "number" ? t += o : G(o) && (t += o.serial);
16693
+ }) ?? W(t);
16625
16694
  }
16626
16695
  },
16627
16696
  SUMIFS: {
@@ -16634,8 +16703,8 @@ const Us = (n) => ({
16634
16703
  let s = 0;
16635
16704
  return tt(t, fe(n[0]), e, (i) => {
16636
16705
  if (w(i)) return i;
16637
- typeof i == "number" ? s += i : W(i) && (s += i.serial);
16638
- }) ?? G(s);
16706
+ typeof i == "number" ? s += i : G(i) && (s += i.serial);
16707
+ }) ?? W(s);
16639
16708
  }
16640
16709
  },
16641
16710
  COUNTIF: {
@@ -16668,8 +16737,8 @@ const Us = (n) => ({
16668
16737
  let t = 0, s = 0;
16669
16738
  return tt([[n[0], n[1]]], n[2] !== void 0 ? fe(n[2]) : void 0, e, (i) => {
16670
16739
  if (w(i)) return i;
16671
- (typeof i == "number" || W(i)) && (t += typeof i == "number" ? i : i.serial, s++);
16672
- }) ?? (s ? G(t / s) : et("AVERAGEIF: no matching numbers"));
16740
+ (typeof i == "number" || G(i)) && (t += typeof i == "number" ? i : i.serial, s++);
16741
+ }) ?? (s ? W(t / s) : et("AVERAGEIF: no matching numbers"));
16673
16742
  }
16674
16743
  },
16675
16744
  AVERAGEIFS: {
@@ -16682,8 +16751,8 @@ const Us = (n) => ({
16682
16751
  let s = 0, o = 0;
16683
16752
  return tt(t, fe(n[0]), e, (r) => {
16684
16753
  if (w(r)) return r;
16685
- (typeof r == "number" || W(r)) && (s += typeof r == "number" ? r : r.serial, o++);
16686
- }) ?? (o ? G(s / o) : et("AVERAGEIFS: no matching numbers"));
16754
+ (typeof r == "number" || G(r)) && (s += typeof r == "number" ? r : r.serial, o++);
16755
+ }) ?? (o ? W(s / o) : et("AVERAGEIFS: no matching numbers"));
16687
16756
  }
16688
16757
  },
16689
16758
  // ------------------------------------------------------------------------------------------------ logic
@@ -16861,7 +16930,7 @@ const Us = (n) => ({
16861
16930
  if (o !== void 0) return o;
16862
16931
  }
16863
16932
  const s = K(t, { isoDatesAsDates: e.isoDatesAsDates });
16864
- return w(s) ? s : G(s);
16933
+ return w(s) ? s : W(s);
16865
16934
  }
16866
16935
  },
16867
16936
  TEXT: {
@@ -16937,7 +17006,7 @@ const Us = (n) => ({
16937
17006
  ISBLANK: { min: 1, max: 1, acceptsErrors: !0, fn: (n) => _(n[0]) === null },
16938
17007
  ISNUMBER: { min: 1, max: 1, acceptsErrors: !0, fn: (n) => {
16939
17008
  const e = _(n[0]);
16940
- return typeof e == "number" || W(e);
17009
+ return typeof e == "number" || G(e);
16941
17010
  } },
16942
17011
  ISTEXT: { min: 1, max: 1, acceptsErrors: !0, fn: (n) => typeof _(n[0]) == "string" },
16943
17012
  ISERROR: { min: 1, max: 1, acceptsErrors: !0, fn: (n) => w(_(n[0])) },
@@ -16952,7 +17021,7 @@ function Ks(n, e) {
16952
17021
  if (w(o)) return o;
16953
17022
  if (typeof o == "boolean") t.push(o);
16954
17023
  else if (typeof o == "number") t.push(o !== 0);
16955
- else if (W(o)) t.push(o.serial !== 0);
17024
+ else if (G(o)) t.push(o.serial !== 0);
16956
17025
  else if (!i && typeof o == "string") {
16957
17026
  const r = ht(o);
16958
17027
  if (w(r)) return r;
@@ -17020,7 +17089,7 @@ function hc(n, e, t) {
17020
17089
  return -1;
17021
17090
  }
17022
17091
  const dc = /* @__PURE__ */ new Set(["#ERROR!", "#NAME?", "#VALUE!", "#DIV/0!", "#NUM!", "#CIRC!", "#REF!", "#N/A"]), uc = /* @__PURE__ */ new Set(["SUM", "AVERAGE", "AVG", "MIN", "MAX", "COUNT"]);
17023
- function xe(n, e) {
17092
+ function Se(n, e) {
17024
17093
  return n * q + e;
17025
17094
  }
17026
17095
  function fc(n) {
@@ -17045,14 +17114,14 @@ class gc {
17045
17114
  return { evaluate: () => {
17046
17115
  try {
17047
17116
  const o = t(), i = Qe(o) ? _(o) : o;
17048
- return i === null ? 0 : typeof i == "number" ? G(i) : i;
17117
+ return i === null ? 0 : typeof i == "number" ? W(i) : i;
17049
17118
  } catch (o) {
17050
17119
  return new I("#VALUE!", o instanceof Error ? o.message.slice(0, 200) : "Evaluation failed");
17051
17120
  }
17052
17121
  }, singles: Array.from(this.singles), ranges: this.ranges, volatile: this.volatile };
17053
17122
  }
17054
17123
  ref(e, t) {
17055
- this.singles.add(xe(e, t));
17124
+ this.singles.add(Se(e, t));
17056
17125
  const s = this.env;
17057
17126
  return () => s.read(e, t);
17058
17127
  }
@@ -17078,10 +17147,10 @@ class gc {
17078
17147
  const t = this.node(e.operand), s = this.env;
17079
17148
  return e.op === "%" ? () => {
17080
17149
  const o = K(t(), s.fn);
17081
- return w(o) ? o : G(o / 100);
17150
+ return w(o) ? o : W(o / 100);
17082
17151
  } : e.op === "+" ? () => _(t()) : () => {
17083
17152
  const o = _(t()), i = K(o, s.fn);
17084
- return w(i) ? i : G(-i);
17153
+ return w(i) ? i : W(-i);
17085
17154
  };
17086
17155
  }
17087
17156
  case "binary":
@@ -17141,19 +17210,19 @@ class gc {
17141
17210
  switch (e) {
17142
17211
  case "+":
17143
17212
  case "-": {
17144
- const c = e === "+" ? l + a : l - a, h = W(i) || o.fn.isoDatesAsDates && typeof i == "string" && ft(i.trim()) !== void 0, d = W(r) || o.fn.isoDatesAsDates && typeof r == "string" && ft(r.trim()) !== void 0;
17213
+ const c = e === "+" ? l + a : l - a, h = G(i) || o.fn.isoDatesAsDates && typeof i == "string" && ft(i.trim()) !== void 0, d = G(r) || o.fn.isoDatesAsDates && typeof r == "string" && ft(r.trim()) !== void 0;
17145
17214
  if (h && !d || e === "+" && d && !h) {
17146
- const u = G(c);
17215
+ const u = W(c);
17147
17216
  return w(u) ? u : new _t(u);
17148
17217
  }
17149
- return G(c);
17218
+ return W(c);
17150
17219
  }
17151
17220
  case "*":
17152
- return G(l * a);
17221
+ return W(l * a);
17153
17222
  case "/":
17154
- return a === 0 ? new I("#DIV/0!", "Division by zero") : G(l / a);
17223
+ return a === 0 ? new I("#DIV/0!", "Division by zero") : W(l / a);
17155
17224
  default:
17156
- return l === 0 && a === 0 ? new I("#NUM!", "0^0") : l === 0 && a < 0 ? new I("#DIV/0!", "0 to a negative power") : G(Math.pow(l, a));
17225
+ return l === 0 && a === 0 ? new I("#NUM!", "0^0") : l === 0 && a < 0 ? new I("#DIV/0!", "0 to a negative power") : W(Math.pow(l, a));
17157
17226
  }
17158
17227
  };
17159
17228
  }
@@ -17170,7 +17239,7 @@ class gc {
17170
17239
  for (const d of c) {
17171
17240
  const u = d();
17172
17241
  if (w(u)) return u;
17173
- h.push(W(u) ? u.serial : u);
17242
+ h.push(G(u) ? u.serial : u);
17174
17243
  }
17175
17244
  try {
17176
17245
  return mc(s(...h), e);
@@ -17214,7 +17283,7 @@ function mc(n, e) {
17214
17283
  if (n === void 0) return null;
17215
17284
  if (typeof n == "number") return Number.isNaN(n) ? new I("#NUM!", `${e} returned NaN`) : n;
17216
17285
  if (Qe(n)) return n;
17217
- const t = Sr(n);
17286
+ const t = xr(n);
17218
17287
  return w(t) && !w(n) ? new I("#VALUE!", `${e} returned no number, text or boolean`) : t;
17219
17288
  }
17220
17289
  function At(n, e) {
@@ -17401,13 +17470,13 @@ class _o {
17401
17470
  const e = Math.min(this.source.getRowCount(), re), t = Math.min(this.source.getColumnCount(), q), s = [], o = this.source;
17402
17471
  if (o.forEachInput)
17403
17472
  return o.forEachInput((i, r, l) => {
17404
- i < e && r < t && Dt(l) && (!o.isFormulaColumn || o.isFormulaColumn(r)) && (this.add(i, r, l, null), s.push(xe(i, r)));
17473
+ i < e && r < t && Dt(l) && (!o.isFormulaColumn || o.isFormulaColumn(r)) && (this.add(i, r, l, null), s.push(Se(i, r)));
17405
17474
  }), this.recalc(s, !0);
17406
17475
  for (let i = 0; i < t; i++)
17407
17476
  if (!(o.isFormulaColumn && !o.isFormulaColumn(i)))
17408
17477
  for (let r = 0; r < e; r++) {
17409
17478
  const l = o.getInput(r, i);
17410
- Dt(l) && (this.add(r, i, l, null), s.push(xe(r, i)));
17479
+ Dt(l) && (this.add(r, i, l, null), s.push(Se(r, i)));
17411
17480
  }
17412
17481
  return this.recalc(s, !0);
17413
17482
  }
@@ -17420,7 +17489,7 @@ class _o {
17420
17489
  inputsChanged(e) {
17421
17490
  const t = [];
17422
17491
  for (const [s, o] of e) {
17423
- const i = xe(s, o), r = this.formulas.get(i), l = this.source.getInput(s, o), a = Dt(l) && (!this.source.isFormulaColumn || this.source.isFormulaColumn(o));
17492
+ const i = Se(s, o), r = this.formulas.get(i), l = this.source.getInput(s, o), a = Dt(l) && (!this.source.isFormulaColumn || this.source.isFormulaColumn(o));
17424
17493
  if (r && a && r.source === l) {
17425
17494
  t.push(i);
17426
17495
  continue;
@@ -17456,7 +17525,7 @@ class _o {
17456
17525
  * @returns {boolean} true for a formula cell
17457
17526
  */
17458
17527
  isFormula(e, t) {
17459
- return this.formulas.has(xe(e, t));
17528
+ return this.formulas.has(Se(e, t));
17460
17529
  }
17461
17530
  /** @returns {number} the number of formula cells */
17462
17531
  getFormulaCount() {
@@ -17484,7 +17553,7 @@ class _o {
17484
17553
  * @returns {CellRange[]} its precedents (empty for a value cell)
17485
17554
  */
17486
17555
  getPrecedents(e, t) {
17487
- const s = this.formulas.get(xe(e, t));
17556
+ const s = this.formulas.get(Se(e, t));
17488
17557
  if (!s) return [];
17489
17558
  const o = s.compiled.singles.map((i) => M.singleCell(Math.floor(i / q), i % q));
17490
17559
  for (const i of s.compiled.ranges) o.push(new M(i.r1, i.c1, i.r2, i.c2));
@@ -17499,7 +17568,7 @@ class _o {
17499
17568
  */
17500
17569
  getDependents(e, t) {
17501
17570
  const s = /* @__PURE__ */ new Set();
17502
- return this.forEachDependent(xe(e, t), e, t, (o) => s.add(o)), Array.from(s, (o) => [Math.floor(o / q), o % q]);
17571
+ return this.forEachDependent(Se(e, t), e, t, (o) => s.add(o)), Array.from(s, (o) => [Math.floor(o / q), o % q]);
17503
17572
  }
17504
17573
  /**
17505
17574
  * The new formula texts after rows or columns were inserted or deleted (or cells moved) – the caller writes them
@@ -17511,7 +17580,7 @@ class _o {
17511
17580
  adjustForStructureChange(e) {
17512
17581
  const t = [];
17513
17582
  for (const s of Array.from(this.formulas.values())) {
17514
- const o = xc(s.row, s.col, e);
17583
+ const o = Sc(s.row, s.col, e);
17515
17584
  if (!o) continue;
17516
17585
  const i = "=" + Cc(s.source.slice(1), e);
17517
17586
  i !== s.source && t.push({ row: o[0], col: o[1], input: i });
@@ -17521,7 +17590,7 @@ class _o {
17521
17590
  // ------------------------------------------------------------------------------------------------ internals
17522
17591
  read(e, t) {
17523
17592
  if (this.formulaColumns.has(t)) {
17524
- const s = this.formulas.get(xe(e, t));
17593
+ const s = this.formulas.get(Se(e, t));
17525
17594
  if (s) return s.value;
17526
17595
  }
17527
17596
  return this.dataValue(e, t);
@@ -17530,7 +17599,7 @@ class _o {
17530
17599
  dataValue(e, t) {
17531
17600
  if (e >= this.source.getRowCount()) return null;
17532
17601
  const s = this.source.getInput(e, t);
17533
- return s === "" ? null : typeof s == "string" && s.startsWith("'=") ? s.slice(1) : Sr(s);
17602
+ return s === "" ? null : typeof s == "string" && s.startsWith("'=") ? s.slice(1) : xr(s);
17534
17603
  }
17535
17604
  fieldColumn(e) {
17536
17605
  var s, o;
@@ -17538,7 +17607,7 @@ class _o {
17538
17607
  return t === void 0 && (t = ((o = (s = this.source).getFieldColumn) == null ? void 0 : o.call(s, e)) ?? -1, this.fieldColumns.set(e, t)), t;
17539
17608
  }
17540
17609
  add(e, t, s, o) {
17541
- const i = xe(e, t), r = Oi(s, e, this.env), l = { row: e, col: t, source: s, compiled: r, value: o, rangeKeys: [] };
17610
+ const i = Se(e, t), r = Oi(s, e, this.env), l = { row: e, col: t, source: s, compiled: r, value: o, rangeKeys: [] };
17542
17611
  this.formulas.set(i, l), this.formulaColumns.set(t, (this.formulaColumns.get(t) ?? 0) + 1);
17543
17612
  for (const a of r.singles) {
17544
17613
  let c = this.singleDependents.get(a);
@@ -17553,14 +17622,14 @@ class _o {
17553
17622
  else
17554
17623
  for (let d = a.c1; d <= a.c2; d++) {
17555
17624
  let u = this.rangesByColumn.get(d);
17556
- u || (u = [], this.rangesByColumn.set(d, u)), Sc(u, h);
17625
+ u || (u = [], this.rangesByColumn.set(d, u)), xc(u, h);
17557
17626
  }
17558
17627
  h.dependents.add(i), l.rangeKeys.push(c);
17559
17628
  }
17560
17629
  r.volatile && this.volatileCells.add(i);
17561
17630
  }
17562
17631
  remove(e) {
17563
- const t = xe(e.row, e.col);
17632
+ const t = Se(e.row, e.col);
17564
17633
  this.formulas.delete(t);
17565
17634
  const s = this.formulaColumns.get(e.col) - 1;
17566
17635
  s ? this.formulaColumns.set(e.col, s) : this.formulaColumns.delete(e.col), this.volatileCells.delete(t);
@@ -17689,9 +17758,9 @@ class _o {
17689
17758
  }
17690
17759
  }
17691
17760
  function Vi(n, e) {
17692
- return Object.is(n, e) ? !0 : w(n) && w(e) ? n.code === e.code && n.message === e.message : W(n) && W(e) ? n.serial === e.serial : !1;
17761
+ return Object.is(n, e) ? !0 : w(n) && w(e) ? n.code === e.code && n.message === e.message : G(n) && G(e) ? n.serial === e.serial : !1;
17693
17762
  }
17694
- function xc(n, e, t) {
17763
+ function Sc(n, e, t) {
17695
17764
  switch (t.kind) {
17696
17765
  case "insertRows":
17697
17766
  return [n >= t.at ? n + t.count : n, e];
@@ -17707,7 +17776,7 @@ function xc(n, e, t) {
17707
17776
  }
17708
17777
  }
17709
17778
  }
17710
- function Sc(n, e) {
17779
+ function xc(n, e) {
17711
17780
  let t = 0, s = n.length;
17712
17781
  for (; t < s; ) {
17713
17782
  const o = t + s >> 1;
@@ -18198,7 +18267,7 @@ function Mc(n) {
18198
18267
  return s;
18199
18268
  }
18200
18269
  function Tc(n) {
18201
- const { matrix: e, anchorRow: t, shownColumns: s, rowCount: o } = n, i = e.length, r = e.reduce((C, x) => Math.max(C, x.length), 0), l = s.indexOf(n.anchorColumn), a = {
18270
+ const { matrix: e, anchorRow: t, shownColumns: s, rowCount: o } = n, i = e.length, r = e.reduce((C, S) => Math.max(C, S.length), 0), l = s.indexOf(n.anchorColumn), a = {
18202
18271
  cells: [],
18203
18272
  range: new M(t, n.anchorColumn, t, n.anchorColumn),
18204
18273
  skipped: 0,
@@ -18215,15 +18284,15 @@ function Tc(n) {
18215
18284
  const b = [];
18216
18285
  let y = 0;
18217
18286
  for (let C = 0; C < p; C++) {
18218
- const x = t + C, E = e[C % i];
18219
- for (let S = 0; S < u; S++) {
18220
- const R = s[l + S];
18221
- if (x < o && n.isWritable && !n.isWritable(x, R)) {
18287
+ const S = t + C, E = e[C % i];
18288
+ for (let x = 0; x < u; x++) {
18289
+ const R = s[l + x];
18290
+ if (S < o && n.isWritable && !n.isWritable(S, R)) {
18222
18291
  y++;
18223
18292
  continue;
18224
18293
  }
18225
- const F = E[S % r] ?? "";
18226
- b.push({ rowIndex: x, columnIndex: R, value: F });
18294
+ const F = E[x % r] ?? "";
18295
+ b.push({ rowIndex: S, columnIndex: R, value: F });
18227
18296
  }
18228
18297
  }
18229
18298
  return !p || !u ? { ...a, clipped: f } : {
@@ -18353,7 +18422,7 @@ class _i {
18353
18422
  let C = r && !y ? r.values : r ? i.map((H, N) => H.map((ue, Q) => {
18354
18423
  var L;
18355
18424
  return ((L = r.values[N]) == null ? void 0 : L[Q]) instanceof kt ? r.values[N][Q] : ue;
18356
- })) : i, x = !!r && !y;
18425
+ })) : i, S = !!r && !y;
18357
18426
  const E = this.options.processPaste;
18358
18427
  if (E) {
18359
18428
  const H = {
@@ -18365,11 +18434,11 @@ class _i {
18365
18434
  }, N = E(H);
18366
18435
  if (N === !1)
18367
18436
  return [];
18368
- Array.isArray(N) && (C = N, x = !1);
18437
+ Array.isArray(N) && (C = N, S = !1);
18369
18438
  }
18370
- const S = this.options.maxPasteCells, R = sn(C.length, C.reduce((H, N) => Math.max(H, N.length), 0), g);
18371
- if (R.rows * R.columns > S)
18372
- return o.announce(o.getSheetTexts().pasteTooLarge(S)), [];
18439
+ const x = this.options.maxPasteCells, R = sn(C.length, C.reduce((H, N) => Math.max(H, N.length), 0), g);
18440
+ if (R.rows * R.columns > x)
18441
+ return o.announce(o.getSheetTexts().pasteTooLarge(x)), [];
18373
18442
  const F = this.options.pasteAddsRows && !!this.options.createRow && !y && this.canAppendRows(), v = ((Fe = (z = o.tableModel).getColumnDefs) == null ? void 0 : Fe.call(z)) ?? [], D = Tc({
18374
18443
  matrix: C,
18375
18444
  anchorRow: u,
@@ -18389,15 +18458,15 @@ class _i {
18389
18458
  V = "cut";
18390
18459
  const H = new Map(h.map((Q, L) => [Q, L])), N = [], ue = /* @__PURE__ */ new Set();
18391
18460
  for (const { rowIndex: Q, columnIndex: L, value: X } of D.cells) {
18392
- const bt = x ? X : this.convertPastedText(X, Q, L);
18393
- o.checkPastedValue(Q, L, bt, x) || (k.push({ rowIndex: Q, column: L, value: bt }), N.push([Q - u, H.get(L) - m]), ue.add(`${Q}:${L}`));
18461
+ const bt = S ? X : this.convertPastedText(X, Q, L);
18462
+ o.checkPastedValue(Q, L, bt, S) || (k.push({ rowIndex: Q, column: L, value: bt }), N.push([Q - u, H.get(L) - m]), ue.add(`${Q}:${L}`));
18394
18463
  }
18395
18464
  for (const Q of this.cutSourceChanges(l, N, ue))
18396
18465
  k.push(Q);
18397
18466
  } else
18398
18467
  for (const { rowIndex: H, columnIndex: N, value: ue } of D.cells)
18399
- k.push({ rowIndex: H, column: N, value: x ? ue : this.convertPastedText(ue, H, N) });
18400
- const P = k.length ? o.writePastedCells(k, V, x) : [];
18468
+ k.push({ rowIndex: H, column: N, value: S ? ue : this.convertPastedText(ue, H, N) });
18469
+ const P = k.length ? o.writePastedCells(k, V, S) : [];
18401
18470
  l && (this.memory = void 0, this.removeCutFrame()), D.addRows && o.repaintHard();
18402
18471
  let $ = P.length;
18403
18472
  if (l) {
@@ -18495,23 +18564,23 @@ class _i {
18495
18564
  if (l != null && l.isAllSelected())
18496
18565
  a = new M(0, 0, i - 1, r - 1);
18497
18566
  else if (l != null && l.hasSelection() && l.getRanges().length) {
18498
- const S = l.getRanges(), R = S[S.length - 1];
18499
- c = S.length > 1, a = new M(
18567
+ const x = l.getRanges(), R = x[x.length - 1];
18568
+ c = x.length > 1, a = new M(
18500
18569
  Math.max(0, R.r1),
18501
18570
  Math.max(0, R.c1),
18502
18571
  Math.min(i - 1, R.r2),
18503
18572
  Math.min(r - 1, R.c2)
18504
18573
  );
18505
18574
  } else {
18506
- const S = t.getActiveBodyCell();
18507
- a = S ? M.singleCell(S[0], S[1]) : void 0;
18575
+ const x = t.getActiveBodyCell();
18576
+ a = x ? M.singleCell(x[0], x[1]) : void 0;
18508
18577
  }
18509
18578
  if (!a || a.r2 < a.r1 || a.c2 < a.c1)
18510
18579
  return;
18511
18580
  const h = [];
18512
- for (let S = a.c1; S <= a.c2; S++) {
18513
- const R = s.getColumnDef(S);
18514
- ((E = R == null ? void 0 : R.isVisible) == null ? void 0 : E.call(R)) === !1 || s.getColumnWidth(S) <= 0 || O(R) && !R.options.exported || h.push(S);
18581
+ for (let x = a.c1; x <= a.c2; x++) {
18582
+ const R = s.getColumnDef(x);
18583
+ ((E = R == null ? void 0 : R.isVisible) == null ? void 0 : E.call(R)) === !1 || s.getColumnWidth(x) <= 0 || O(R) && !R.options.exported || h.push(x);
18515
18584
  }
18516
18585
  const d = (a.r2 - a.r1 + 1) * h.length;
18517
18586
  if (!h.length)
@@ -18522,22 +18591,22 @@ class _i {
18522
18591
  }
18523
18592
  const u = this.options.copyValue === "raw", f = !!(l != null && l.hasSelection()) && !l.isAllSelected(), g = [], p = [], m = [];
18524
18593
  if (this.options.copyHeaders && !e) {
18525
- const S = h.map((R) => t.getColumnAriaLabel(R));
18526
- g.push(S), p.push(S), m.push(S.map((R) => ({ text: R })));
18594
+ const x = h.map((R) => t.getColumnAriaLabel(R));
18595
+ g.push(x), p.push(x), m.push(x.map((R) => ({ text: R })));
18527
18596
  }
18528
- for (let S = a.r1; S <= a.r2; S++) {
18597
+ for (let x = a.r1; x <= a.r2; x++) {
18529
18598
  const R = [], F = [], v = [];
18530
18599
  for (const D of h) {
18531
18600
  const k = s.getColumnDef(D);
18532
18601
  let V, P;
18533
- if (f && !l.isSelected(S, D))
18602
+ if (f && !l.isSelected(x, D))
18534
18603
  V = "", P = "";
18535
18604
  else if (O(k))
18536
- V = k.getRowNumberText(S, o), P = V;
18605
+ V = k.getRowNumberText(x, o), P = V;
18537
18606
  else {
18538
- P = t.getCopyValue(S, D);
18607
+ P = t.getCopyValue(x, D);
18539
18608
  const z = P instanceof kt ? P.value : P;
18540
- V = u || z === null || z === void 0 || z instanceof Date ? Ic(z) : o.getTextValueAt(S, D);
18609
+ V = u || z === null || z === void 0 || z instanceof Date ? Ic(z) : o.getTextValueAt(x, D);
18541
18610
  }
18542
18611
  R.push(V), F.push(P);
18543
18612
  const $ = P instanceof kt ? P.value : P;
@@ -18547,11 +18616,11 @@ class _i {
18547
18616
  }
18548
18617
  let b = g, y = !1;
18549
18618
  if (this.options.processCopy) {
18550
- const S = this.options.processCopy({ ranges: [a], matrix: g, cut: e });
18551
- Array.isArray(S) && (b = S, y = !0);
18619
+ const x = this.options.processCopy({ ranges: [a], matrix: g, cut: e });
18620
+ Array.isArray(x) && (b = x, y = !0);
18552
18621
  }
18553
- const C = vc(b), x = this.options.html ? Ec(y ? b.map((S) => S.map((R) => ({ text: R }))) : m) : void 0;
18554
- return { text: C, html: x, values: p, range: a, columns: h, cellCount: d, lastRangeOnly: c, processed: y };
18622
+ const C = vc(b), S = this.options.html ? Ec(y ? b.map((x) => x.map((R) => ({ text: R }))) : m) : void 0;
18623
+ return { text: C, html: S, values: p, range: a, columns: h, cellCount: d, lastRangeOnly: c, processed: y };
18555
18624
  }
18556
18625
  /** The visible data columns in display order (hidden and row number columns are skipped). */
18557
18626
  getPasteColumns() {
@@ -18853,53 +18922,53 @@ class $i {
18853
18922
  }
18854
18923
  apply(e, t) {
18855
18924
  var C;
18856
- const s = e.tableModel, o = s.getBodyModel(), i = o.getRowCount(), r = ((C = e.getUndoOptions()) == null ? void 0 : C.onConflict) === "overwrite", l = (x) => {
18857
- const E = o.getRowByIndex(x);
18925
+ const s = e.tableModel, o = s.getBodyModel(), i = o.getRowCount(), r = ((C = e.getUndoOptions()) == null ? void 0 : C.onConflict) === "overwrite", l = (S) => {
18926
+ const E = o.getRowByIndex(S);
18858
18927
  return U(E) ? E.data : E;
18859
18928
  };
18860
18929
  let a, c;
18861
- const h = (x) => {
18862
- if (x.row === void 0 || x.row === null || typeof x.row != "object")
18863
- return x.rowIndex >= 0 && x.rowIndex < i ? x.rowIndex : -1;
18864
- if (x.rowIndex >= 0 && x.rowIndex < i && l(x.rowIndex) === x.row)
18865
- return x.rowIndex;
18930
+ const h = (S) => {
18931
+ if (S.row === void 0 || S.row === null || typeof S.row != "object")
18932
+ return S.rowIndex >= 0 && S.rowIndex < i ? S.rowIndex : -1;
18933
+ if (S.rowIndex >= 0 && S.rowIndex < i && l(S.rowIndex) === S.row)
18934
+ return S.rowIndex;
18866
18935
  if (!a) {
18867
18936
  a = /* @__PURE__ */ new Map();
18868
18937
  for (let E = 0; E < i; E++) a.set(l(E), E);
18869
18938
  }
18870
- return a.get(x.row) ?? -1;
18871
- }, d = (x) => (c === void 0 && (c = Lc(o)), !!c && c.has(x)), u = (x) => {
18939
+ return a.get(S.row) ?? -1;
18940
+ }, d = (S) => (c === void 0 && (c = Lc(o)), !!c && c.has(S)), u = (S) => {
18872
18941
  var E;
18873
- return !!x && (rr(x) ? !!o.defaultEditable : !!((E = x.editable) != null && E.call(x)));
18942
+ return !!S && (rr(S) ? !!o.defaultEditable : !!((E = S.editable) != null && E.call(S)));
18874
18943
  }, f = [], g = [];
18875
18944
  let p = 0;
18876
18945
  const m = t === "undo" ? [...this.entries].reverse() : this.entries;
18877
- for (const x of m) {
18878
- const E = t === "undo" ? x.newValue : x.oldValue, S = t === "undo" ? x.oldValue : x.newValue, R = Fc(e, x);
18946
+ for (const S of m) {
18947
+ const E = t === "undo" ? S.newValue : S.oldValue, x = t === "undo" ? S.oldValue : S.newValue, R = Fc(e, S);
18879
18948
  if (R < 0) {
18880
18949
  p++;
18881
18950
  continue;
18882
18951
  }
18883
- const F = h(x);
18952
+ const F = h(S);
18884
18953
  if (F >= 0) {
18885
18954
  if (!o.isEditable(F, R) || !r && !$t(e.getCellInput(F, R), E)) {
18886
18955
  p++;
18887
18956
  continue;
18888
18957
  }
18889
- f.push({ rowIndex: F, columnIndex: R, value: S });
18958
+ f.push({ rowIndex: F, columnIndex: R, value: x });
18890
18959
  continue;
18891
18960
  }
18892
- const v = s.getColumnDef(R), D = d(x.row) ? Oc(x.row, v, R, E) : void 0;
18893
- if (!d(x.row) || !u(v) || !r && !$t(D, E) || !Br(x.row, v, R, S)) {
18961
+ const v = s.getColumnDef(R), D = d(S.row) ? Oc(S.row, v, R, E) : void 0;
18962
+ if (!d(S.row) || !u(v) || !r && !$t(D, E) || !Br(S.row, v, R, x)) {
18894
18963
  p++;
18895
18964
  continue;
18896
18965
  }
18897
- g.push({ row: x.row, rowIndex: -1, columnIndex: R, property: x.property, oldValue: D, newValue: S });
18966
+ g.push({ row: S.row, rowIndex: -1, columnIndex: R, property: S.property, oldValue: D, newValue: x });
18898
18967
  }
18899
18968
  const b = e.writeUndoCells(f, g, t);
18900
18969
  let y;
18901
- for (const x of b)
18902
- x.rowIndex < 0 || (y ? (y.r1 = Math.min(y.r1, x.rowIndex), y.r2 = Math.max(y.r2, x.rowIndex), y.c1 = Math.min(y.c1, x.columnIndex), y.c2 = Math.max(y.c2, x.columnIndex)) : y = new M(x.rowIndex, x.columnIndex, x.rowIndex, x.columnIndex));
18970
+ for (const S of b)
18971
+ S.rowIndex < 0 || (y ? (y.r1 = Math.min(y.r1, S.rowIndex), y.r2 = Math.max(y.r2, S.rowIndex), y.c1 = Math.min(y.c1, S.columnIndex), y.c2 = Math.max(y.c2, S.columnIndex)) : y = new M(S.rowIndex, S.columnIndex, S.rowIndex, S.columnIndex));
18903
18972
  return { applied: b.length, skipped: p + f.length + g.length - b.length, range: y };
18904
18973
  }
18905
18974
  }
@@ -18995,13 +19064,13 @@ class Pc {
18995
19064
  return this.steps.reduce((e, t) => e + t.cellCount, 0);
18996
19065
  }
18997
19066
  undo(e) {
18998
- return Gi([...this.steps].reverse().map((t) => t.undo(e)));
19067
+ return Wi([...this.steps].reverse().map((t) => t.undo(e)));
18999
19068
  }
19000
19069
  redo(e) {
19001
- return Gi(this.steps.map((t) => t.redo(e)));
19070
+ return Wi(this.steps.map((t) => t.redo(e)));
19002
19071
  }
19003
19072
  }
19004
- function Gi(n) {
19073
+ function Wi(n) {
19005
19074
  let e;
19006
19075
  for (const t of n)
19007
19076
  t.range && (e = e ? new M(
@@ -20075,7 +20144,7 @@ const Ne = class Ne extends Zl {
20075
20144
  return this.writeCellsInternal(e, t, s).changes;
20076
20145
  }
20077
20146
  writeCellsInternal(e, t, s) {
20078
- var p, m, b, y, C, x, E, S, R, F;
20147
+ var p, m, b, y, C, S, E, x, R, F;
20079
20148
  const o = this.tableModel.getBodyModel(), i = o.getRowCount(), r = ne(o) ? o.getBuildCount() : 0, l = [];
20080
20149
  let a = 0, c = "";
20081
20150
  const h = this.tableSheet, d = () => {
@@ -20109,9 +20178,9 @@ const Ne = class Ne extends Zl {
20109
20178
  try {
20110
20179
  if (t === "edit" && u.length === 1) {
20111
20180
  const v = Ze.createSingle(u[0].rowIndex, u[0].columnIndex);
20112
- v.changes = u, v.source = t, (E = (x = this.eventListener).onModelChanged) == null || E.call(x, v);
20181
+ v.changes = u, v.source = t, (E = (S = this.eventListener).onModelChanged) == null || E.call(S, v);
20113
20182
  } else
20114
- (R = (S = this.eventListener).onModelChanged) == null || R.call(S, Ze.createForChanges(u, t));
20183
+ (R = (x = this.eventListener).onModelChanged) == null || R.call(x, Ze.createForChanges(u, t));
20115
20184
  } finally {
20116
20185
  (F = this.undoService) == null || F.endFold();
20117
20186
  }
@@ -20403,8 +20472,8 @@ const Ne = class Ne extends Zl {
20403
20472
  isFillable: (y, C) => this.tableModel.getColumnWidth(C) > 0 && l.isEditable(y, C),
20404
20473
  fillValue: r.fillValue,
20405
20474
  getCellInfo: (y, C) => {
20406
- var x;
20407
- return { row: this.rowObjectOf(y), property: ((x = this.tableModel.getColumnDef(C)) == null ? void 0 : x.property) ?? "" };
20475
+ var S;
20476
+ return { row: this.rowObjectOf(y), property: ((S = this.tableModel.getColumnDef(C)) == null ? void 0 : S.property) ?? "" };
20408
20477
  }
20409
20478
  });
20410
20479
  this.tableSheet && this.moveFilledFormulas(p, h, t);
@@ -20516,7 +20585,7 @@ const Ne = class Ne extends Zl {
20516
20585
  firstInit() {
20517
20586
  var t;
20518
20587
  const e = this.getAvailableColumnWidth();
20519
- return e > 0 && this.tableModel.setParentWidth(e), this.stateService.initBeforeModel(), this.tableModel.init(), this.stateService.initAfterModel(), (t = this.tableOptions) != null && t.externalFilterFunction && this.externalFilterChanged(!1), this.stateService.initAfterFilter(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.stateService.initAfterLayout(), this.liveAnnouncer.getElement(), this.initialized = !0, this;
20588
+ return e > 0 && this.setParentWidth(e), this.stateService.initBeforeModel(), this.tableModel.init(), this.stateService.initAfterModel(), (t = this.tableOptions) != null && t.externalFilterFunction && this.externalFilterChanged(!1), this.stateService.initAfterFilter(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.stateService.initAfterLayout(), this.liveAnnouncer.getElement(), this.initialized = !0, this;
20520
20589
  }
20521
20590
  /**
20522
20591
  * Releases the table: removes all DOM listeners (host element, scroll viewport, window resize),
@@ -21165,10 +21234,10 @@ const Ne = class Ne extends Zl {
21165
21234
  const f = this.tableModel.getAreaModel(u), g = (f == null ? void 0 : f.getRowCount()) ?? 0;
21166
21235
  for (let b = 0; b < g; b++)
21167
21236
  for (let y = 0; y < t; y++) {
21168
- const C = ((p = f.getTextValueAt) == null ? void 0 : p.call(f, b, y)) || (((m = f.getValueAt(b, y)) == null ? void 0 : m.toString()) ?? ""), x = C.length;
21169
- x > i[y] && (i[y] = x, o[y].forEach((E) => {
21170
- E.length < x - 2 && o[y].delete(E);
21171
- })), x >= i[y] - 2 && o[y].size < s && o[y].add(C);
21237
+ const C = ((p = f.getTextValueAt) == null ? void 0 : p.call(f, b, y)) || (((m = f.getValueAt(b, y)) == null ? void 0 : m.toString()) ?? ""), S = C.length;
21238
+ S > i[y] && (i[y] = S, o[y].forEach((E) => {
21239
+ E.length < S - 2 && o[y].delete(E);
21240
+ })), S >= i[y] - 2 && o[y].size < s && o[y].add(C);
21172
21241
  }
21173
21242
  };
21174
21243
  r("header"), r("body"), r("footer");
@@ -21340,7 +21409,7 @@ const Ne = class Ne extends Zl {
21340
21409
  }
21341
21410
  };
21342
21411
  Ne.actionsBlockedWhileLoading = ["START_EDITING", "TOGGLE_SELECTION", "ACTIVATE_CELL", "MOVE_ROW_UP", "MOVE_ROW_DOWN", "FILL_DOWN", "FILL_RIGHT", "CLEAR_CELLS", "CLEAR_AND_EDIT", "CUT_2_CLIPBOARD", "PASTE_FROM_CLIPBOARD", "UNDO", "REDO"], Ne.filterAnnouncementDelayInMs = 400;
21343
- let Wi = Ne;
21412
+ let Gi = Ne;
21344
21413
  class Ph extends ss {
21345
21414
  constructor(e) {
21346
21415
  super(), this.onCheckboxChangedCallback = e, super.onCheckboxChanged = (t) => {
@@ -21348,9 +21417,9 @@ class Ph extends ss {
21348
21417
  };
21349
21418
  }
21350
21419
  }
21351
- const Ss = class Ss {
21420
+ const xs = class xs {
21352
21421
  };
21353
- Ss.themes = ["light", "combat", "paper", "blackboard"], Ss.vars = {
21422
+ xs.themes = ["light", "combat", "paper", "blackboard"], xs.vars = {
21354
21423
  light: `html[data-theme="light"] {
21355
21424
  --ge-table-bg: rgba(255,255,255, 0.5);
21356
21425
  --ge-table-header-west-bg: rgba(233, 233, 233, 0.5);
@@ -21616,7 +21685,7 @@ Ss.themes = ["light", "combat", "paper", "blackboard"], Ss.vars = {
21616
21685
  --ge-table-row-number-color: #c9c86f;
21617
21686
  }`
21618
21687
  };
21619
- let Ui = Ss;
21688
+ let Ui = xs;
21620
21689
  class Je {
21621
21690
  constructor(e, t = !0, s, o, i = 0, r = !1, l = !1) {
21622
21691
  this.data = e, this.expanded = t, this.children = s, this.parent = o, this.deep = i, this.checked = r, this.keep = l, this.type = "TreeRow";
@@ -21675,8 +21744,8 @@ class Et {
21675
21744
  return typeof e == "function" ? e : () => e;
21676
21745
  }
21677
21746
  }
21678
- const _h = new T(500, "px"), Bh = new T(400, "px"), Hc = new T(300, "px"), $h = new T(290, "px"), Hh = new T(280, "px"), Gh = new T(270, "px"), Wh = new T(260, "px"), Uh = new T(250, "px"), Kh = new T(240, "px"), zh = new T(230, "px"), jh = new T(220, "px"), Xh = new T(210, "px"), ho = new T(200, "px"), Yh = new T(190, "px"), Jh = new T(180, "px"), qh = new T(170, "px"), Zh = new T(160, "px"), Qh = new T(150, "px"), ed = new T(140, "px"), td = new T(130, "px"), sd = new T(120, "px"), od = new T(110, "px"), id = new T(100, "px"), rd = new T(90, "px"), nd = new T(80, "px"), ld = new T(70, "px"), ad = new T(60, "px"), cd = new T(50, "px"), hd = new T(40, "px"), dd = new T(30, "px"), ud = new T(20, "px"), fd = new T(10, "px"), gd = new T(0, "px");
21679
- class Gc {
21747
+ const _h = new T(500, "px"), Bh = new T(400, "px"), Hc = new T(300, "px"), $h = new T(290, "px"), Hh = new T(280, "px"), Wh = new T(270, "px"), Gh = new T(260, "px"), Uh = new T(250, "px"), Kh = new T(240, "px"), zh = new T(230, "px"), jh = new T(220, "px"), Xh = new T(210, "px"), ho = new T(200, "px"), Yh = new T(190, "px"), Jh = new T(180, "px"), qh = new T(170, "px"), Zh = new T(160, "px"), Qh = new T(150, "px"), ed = new T(140, "px"), td = new T(130, "px"), sd = new T(120, "px"), od = new T(110, "px"), id = new T(100, "px"), rd = new T(90, "px"), nd = new T(80, "px"), ld = new T(70, "px"), ad = new T(60, "px"), cd = new T(50, "px"), hd = new T(40, "px"), dd = new T(30, "px"), ud = new T(20, "px"), fd = new T(10, "px"), gd = new T(0, "px");
21748
+ class Wc {
21680
21749
  flattenTree(e, t = []) {
21681
21750
  var s;
21682
21751
  for (const o of e)
@@ -21696,7 +21765,7 @@ class Gc {
21696
21765
  }
21697
21766
  class mt extends Ts {
21698
21767
  constructor(e, t, s, o = []) {
21699
- super(e, o, s), this.areaIdent = e, this.rows = t, this.defaultRowHeight = s, this.columnDefs = o, this.type = "AreaModelTree", this.sorterService = new Ao(), this.service = new Gc(), this.filteredFlattenRows = [], this.flattenRows = [], this.keepMarked = !1, this.showValuesCache = /* @__PURE__ */ new Map(), this.properties = o.map((i) => i.property), this.refreshDisplayedRows();
21768
+ super(e, o, s), this.areaIdent = e, this.rows = t, this.defaultRowHeight = s, this.columnDefs = o, this.type = "AreaModelTree", this.sorterService = new Ao(), this.service = new Wc(), this.filteredFlattenRows = [], this.flattenRows = [], this.keepMarked = !1, this.showValuesCache = /* @__PURE__ */ new Map(), this.properties = o.map((i) => i.property), this.refreshDisplayedRows();
21700
21769
  }
21701
21770
  changeColumnOrder(e, t) {
21702
21771
  this.arrayMove(this.properties, e, t), super.changeColumnOrder(e, t);
@@ -22793,7 +22862,7 @@ class rn {
22793
22862
  return !1;
22794
22863
  }
22795
22864
  }
22796
- const Wc = {
22865
+ const Gc = {
22797
22866
  sum: "Sum",
22798
22867
  count: "Count",
22799
22868
  avg: "Average",
@@ -22813,7 +22882,7 @@ class ps extends rn {
22813
22882
  */
22814
22883
  constructor(e, t, s) {
22815
22884
  super(), this.columnDefs = t, this.type = "AreaModelAggregateFooter", this.textRenderer = new Kt(), this.areaIdent = "footer", this.getBody = typeof e == "function" ? e : () => e, this.options = ps.toOptions(s), this.defaultRowHeight = this.options.rowHeight ?? 34, this.footerRows = this.options.rows.map((o) => {
22816
- const i = Object.keys(o.aggregates).map((r) => Gt(r, o.aggregates[r]));
22885
+ const i = Object.keys(o.aggregates).map((r) => Wt(r, o.aggregates[r]));
22817
22886
  return { row: o, specs: i, byKey: new Map(i.map((r) => [r.key, r])) };
22818
22887
  });
22819
22888
  }
@@ -22888,7 +22957,7 @@ class ps extends rn {
22888
22957
  const i = s.byKey.get(o);
22889
22958
  if (i) {
22890
22959
  const l = this.getResults(e)[o];
22891
- return i.format ? i.format(l) : Wt(l);
22960
+ return i.format ? i.format(l) : Gt(l);
22892
22961
  }
22893
22962
  return this.isLabelCell(e, t) ? this.getLabel(e) : "";
22894
22963
  }
@@ -22928,7 +22997,7 @@ class ps extends rn {
22928
22997
  if (typeof t.label == "function")
22929
22998
  return t.label(o, this.getResults(e));
22930
22999
  if (this.footerRows.length > 1 && s.length) {
22931
- const i = s[0].aggregator.name, r = Wc[i];
23000
+ const i = s[0].aggregator.name, r = Gc[i];
22932
23001
  if (r && s.every((l) => l.aggregator === _e[i]))
22933
23002
  return r;
22934
23003
  }
@@ -23003,7 +23072,7 @@ class ps extends rn {
23003
23072
  return this.cache = { signal: e.signal, length: e.length, rowCount: a, results: l }, this.cache;
23004
23073
  }
23005
23074
  }
23006
- class Se {
23075
+ class xe {
23007
23076
  /**
23008
23077
  * Creates a table model from any subset of {@link CreateTableModelPara}.
23009
23078
  * Missing parts are derived (see {@link CreateTableModelPara}).
@@ -23038,8 +23107,8 @@ class Se {
23038
23107
  C > -1 && (e.defaultRowHeights.footer = C);
23039
23108
  }
23040
23109
  }
23041
- if (e.columnDefs === void 0 && ((o = e.properties) != null && o.length ? e.columnDefs = e.properties.map((C) => new ye(C, C.toUpperCase(), ho)) : (i = e.rows) != null && i.length ? e.columnDefs = Object.keys(e.rows[0]).map((C) => new ye(C, C.toUpperCase(), ho)) : e.columnDefs = []), Se.addRowNumberColumn(e), e.rowDrag) {
23042
- const C = (r = e.columnDefs) == null ? void 0 : r.find((x) => !O(x) && !we(x));
23110
+ if (e.columnDefs === void 0 && ((o = e.properties) != null && o.length ? e.columnDefs = e.properties.map((C) => new ye(C, C.toUpperCase(), ho)) : (i = e.rows) != null && i.length ? e.columnDefs = Object.keys(e.rows[0]).map((C) => new ye(C, C.toUpperCase(), ho)) : e.columnDefs = []), xe.addRowNumberColumn(e), e.rowDrag) {
23111
+ const C = (r = e.columnDefs) == null ? void 0 : r.find((S) => !O(S) && !we(S));
23043
23112
  C && (C.rowDrag = C.rowDrag || !0);
23044
23113
  }
23045
23114
  if (e.columnCount === void 0 && ((l = e.columnDefs) != null && l.length ? e.columnCount = e.columnDefs.length : (a = e.headerData) != null && a.length ? e.columnCount = e.headerData[0].length : (c = e.columnSizes) != null && c.length ? e.columnCount = (h = e.columnSizes) == null ? void 0 : h.length : console.warn('Property "columnCount" is missing and cannot be derived from other properties.')), e.headerAreaModel)
@@ -23056,15 +23125,15 @@ class Se {
23056
23125
  e.columnDefs
23057
23126
  ) : e.headerAreaModel = new ae("header"), e.columnLetters && e.headerAreaModel instanceof ee) {
23058
23127
  let C = 0;
23059
- const x = (e.columnDefs ?? []).map((E) => O(E) || we(E) ? "" : Be(C++));
23128
+ const S = (e.columnDefs ?? []).map((E) => O(E) || we(E) ? "" : Be(C++));
23060
23129
  e.headerAreaModel = new kr(
23061
23130
  "header",
23062
- [x, ...e.headerAreaModel.arr],
23131
+ [S, ...e.headerAreaModel.arr],
23063
23132
  e.defaultRowHeights.header,
23064
23133
  e.columnDefs
23065
23134
  );
23066
23135
  }
23067
- const t = Se.checkFooterAggregates(e);
23136
+ const t = xe.checkFooterAggregates(e);
23068
23137
  if (!e.footerAreaModel && !t && ((f = e.footerData) != null && f.length ? e.footerAreaModel = new ee(
23069
23138
  "footer",
23070
23139
  e.footerData,
@@ -23172,7 +23241,7 @@ class Se {
23172
23241
  * @method
23173
23242
  */
23174
23243
  static buildByTypedRowsParam(e) {
23175
- return Se.buildByTypedRows(
23244
+ return xe.buildByTypedRows(
23176
23245
  e.rows ?? [],
23177
23246
  e.columnDefs,
23178
23247
  e.tableOptions ?? new qe(),
@@ -23226,7 +23295,7 @@ class Se {
23226
23295
  r.body,
23227
23296
  t
23228
23297
  );
23229
- return (l || s.showCheckboxWihoutExtraColumn) && (d.rowSelectionModel = new Bt(h)), Se.createByAreaModelsParam({
23298
+ return (l || s.showCheckboxWihoutExtraColumn) && (d.rowSelectionModel = new Bt(h)), xe.createByAreaModelsParam({
23230
23299
  headerAreaModel: new ee("header", [t.map((u) => u.headerLabel)], r.header),
23231
23300
  bodyAreaModel: d,
23232
23301
  footerAreaModel: new ee("footer", [], r.footer),
@@ -23240,7 +23309,7 @@ class Se {
23240
23309
  overridingColumnWidth: -1
23241
23310
  });
23242
23311
  }
23243
- return Se.createByObjectArrayParam({
23312
+ return xe.createByObjectArrayParam({
23244
23313
  rows: e,
23245
23314
  columnDefs: t,
23246
23315
  fixedLeftColumnCount: o,
@@ -23286,7 +23355,7 @@ class Se {
23286
23355
  */
23287
23356
  static createByObjectArrayParam(e) {
23288
23357
  const t = e.rowCheckboxVisible !== void 0 ? e.rowCheckboxVisible : !1;
23289
- return Se.createByObjectArray(
23358
+ return xe.createByObjectArray(
23290
23359
  e.rows,
23291
23360
  e.header ?? [],
23292
23361
  e.footer ?? [],
@@ -23391,7 +23460,7 @@ class Se {
23391
23460
  * });
23392
23461
  */
23393
23462
  static createByAreaModelsParam(e) {
23394
- return Se.createByAreaModels(
23463
+ return xe.createByAreaModels(
23395
23464
  e.headerAreaModel ?? new ae(),
23396
23465
  e.bodyAreaModel,
23397
23466
  e.footerAreaModel ?? new ae(),
@@ -23846,7 +23915,7 @@ class wd {
23846
23915
  this.index = e, this.px = t;
23847
23916
  }
23848
23917
  }
23849
- const yd = { body: ["ge-table-text-align-left"] }, Cd = { body: ["ge-table-text-align-center"] }, xd = { body: ["ge-table-text-align-right"] }, Sd = {
23918
+ const yd = { body: ["ge-table-text-align-left"] }, Cd = { body: ["ge-table-text-align-center"] }, Sd = { body: ["ge-table-text-align-right"] }, xd = {
23850
23919
  header: ["ge-table-text-align-left"],
23851
23920
  body: ["ge-table-text-align-left"],
23852
23921
  footer: ["ge-table-text-align-left"]
@@ -24659,7 +24728,7 @@ class Hd {
24659
24728
  }
24660
24729
  }
24661
24730
  }
24662
- class Gd {
24731
+ class Wd {
24663
24732
  constructor(e = Number.MIN_SAFE_INTEGER, t = Number.MAX_SAFE_INTEGER) {
24664
24733
  this.min = e, this.max = t;
24665
24734
  }
@@ -24670,7 +24739,7 @@ class Gd {
24670
24739
  </div>`, (typeof r == "string" || isNaN(r) || r < this.min || r > this.max) && l.addClass(e, "ge-cell-error"));
24671
24740
  }
24672
24741
  }
24673
- class Wd {
24742
+ class Gd {
24674
24743
  constructor(e, t = (s) => s === 1 ? "1 star" : `${s} stars`) {
24675
24744
  this.property = e, this.ariaLabel = t;
24676
24745
  }
@@ -25188,7 +25257,7 @@ class Jd {
25188
25257
  ), g.push(y);
25189
25258
  }
25190
25259
  const p = 0, m = e.calcFixedRightColumnCount(g.length);
25191
- this.tableModel = Se.buildByTypedRowsParam({
25260
+ this.tableModel = xe.buildByTypedRowsParam({
25192
25261
  rows: i,
25193
25262
  columnDefs: g,
25194
25263
  tableOptions: this.tableOptions,
@@ -25469,7 +25538,7 @@ function Zd(n, e, t = {}) {
25469
25538
  return ms(n, Le(e), t.emptyLabel ?? lh);
25470
25539
  }
25471
25540
  function Qd(n, e, t) {
25472
- const s = Object.keys(e ?? {}).map((o) => Gt(o, e[o]));
25541
+ const s = Object.keys(e ?? {}).map((o) => Wt(o, e[o]));
25473
25542
  return cn(n, s, t);
25474
25543
  }
25475
25544
  const Rs = class Rs extends ye {
@@ -25494,7 +25563,7 @@ const Rs = class Rs extends ye {
25494
25563
  };
25495
25564
  Rs.PROPERTY = "RowGroupColumn";
25496
25565
  let J = Rs;
25497
- class We extends Je {
25566
+ class Ge extends Je {
25498
25567
  constructor(e, t, s, o) {
25499
25568
  super(e, !1, void 0, t, s), this.sourceIndex = o;
25500
25569
  }
@@ -25510,7 +25579,7 @@ class ch extends mt {
25510
25579
  constructor(e, t, s, o = 34) {
25511
25580
  super("body", [], o, t), this.kind = "AreaModelRowGroups", this.hiddenColumnProperties = [], this.fields = [], this.groups = [], this.textRenderer = new Kt(), this.groupRowById = /* @__PURE__ */ new Map(), this.detailRows = [], this.allDirty = !0, this.dirtyLeaves = /* @__PURE__ */ new Set(), this.totals = {}, this.batchDepth = 0, this.regroupPending = !1, this.builds = 0, this.sourceRows = e ?? [], this.options = { ...s, groupBy: [...s.groupBy ?? []] };
25512
25581
  const i = s.aggregations ?? {};
25513
- this.specs = Object.keys(i).map((r) => this.withCalculatedValue(Gt(r, i[r]))), this.specByKey = new Map(this.specs.map((r) => [r.key, r])), this.fields = this.withCalculatedKeys(Le(this.options.groupBy)), this.build(!1);
25582
+ this.specs = Object.keys(i).map((r) => this.withCalculatedValue(Wt(r, i[r]))), this.specByKey = new Map(this.specs.map((r) => [r.key, r])), this.fields = this.withCalculatedKeys(Le(this.options.groupBy)), this.build(!1);
25514
25583
  }
25515
25584
  // ---------------------------------------------------------------- data and grouping
25516
25585
  /**
@@ -25757,7 +25826,7 @@ class ch extends mt {
25757
25826
  const r = o !== void 0 ? this.specByKey.get(o) : void 0;
25758
25827
  if (!r) return "";
25759
25828
  const l = this.getValueAt(e, t);
25760
- return r.format ? r.format(l) : Wt(l);
25829
+ return r.format ? r.format(l) : Gt(l);
25761
25830
  }
25762
25831
  const i = this.getValueAt(e, t);
25763
25832
  return i == null ? "" : `${i}`;
@@ -25794,7 +25863,7 @@ class ch extends mt {
25794
25863
  */
25795
25864
  setValue(e, t, s) {
25796
25865
  const o = this.getRowByIndex(e);
25797
- if (!(o instanceof We) || this.properties[t] === J.PROPERTY)
25866
+ if (!(o instanceof Ge) || this.properties[t] === J.PROPERTY)
25798
25867
  return !1;
25799
25868
  const i = this.keysOf(o.data);
25800
25869
  if (!super.setValue(e, t, s))
@@ -25819,7 +25888,7 @@ class ch extends mt {
25819
25888
  const t = this.sourceRows, s = new Uint8Array(t.length);
25820
25889
  for (let o = 0; o < t.length; o++)
25821
25890
  s[o] = e(t[o], o, t) ? 1 : 0;
25822
- this.accepted = s, this.allDirty = !0, super.externalFilterChanged((o) => o instanceof We && s[o.sourceIndex] === 1);
25891
+ this.accepted = s, this.allDirty = !0, super.externalFilterChanged((o) => o instanceof Ge && s[o.sourceIndex] === 1);
25823
25892
  }
25824
25893
  /**
25825
25894
  * Sorts groups and rows (see the class description); the order is applied again after regrouping.
@@ -25857,7 +25926,7 @@ class ch extends mt {
25857
25926
  * tableApi.sort((a: Sale, b: Sale) => b.umsatz - a.umsatz);
25858
25927
  */
25859
25928
  sort(e) {
25860
- this.lastSort = { compareFn: e }, super.sort((t, s) => t instanceof We && s instanceof We ? e(t.data, s.data) : 0), this.syncGroupOrder(), this.allDirty = !0;
25929
+ this.lastSort = { compareFn: e }, super.sort((t, s) => t instanceof Ge && s instanceof Ge ? e(t.data, s.data) : 0), this.syncGroupOrder(), this.allDirty = !0;
25861
25930
  }
25862
25931
  /**
25863
25932
  * Drops the computed aggregates; with `change` (an edit or `updateCells`) only those of the groups of the changed rows.
@@ -25873,7 +25942,7 @@ class ch extends mt {
25873
25942
  if (super.invalidateDerivedValues(e), (e == null ? void 0 : e.area) === "body" && Array.isArray(e.rowIndices)) {
25874
25943
  for (const t of e.rowIndices) {
25875
25944
  const s = this.getRowByIndex(t);
25876
- s instanceof We ? this.markRowDirty(s) : this.allDirty = !0;
25945
+ s instanceof Ge ? this.markRowDirty(s) : this.allDirty = !0;
25877
25946
  }
25878
25947
  return;
25879
25948
  }
@@ -25981,7 +26050,7 @@ class ch extends mt {
25981
26050
  i.push(this.createGroupRow(l, void 0, t));
25982
26051
  else
25983
26052
  for (let l = 0; l < this.sourceRows.length; l++)
25984
- i.push(this.detailRows[l] = new We(this.sourceRows[l], void 0, 0, l));
26053
+ i.push(this.detailRows[l] = new Ge(this.sourceRows[l], void 0, 0, l));
25985
26054
  this.rows.length = 0;
25986
26055
  for (const l of i) this.rows.push(l);
25987
26056
  s.size && (this.detailRows.forEach((l) => l.checked = s.has(l.data)), this.rows.forEach((l) => pn(l))), this.allDirty = !0, this.dirtyLeaves.clear(), this.userFilter ? this.externalFilterChanged(this.userFilter) : this.recalcVisibleTreeRows(!1);
@@ -25993,7 +26062,7 @@ class ch extends mt {
25993
26062
  if (this.groupRowById.set(o, r), e.isLeaf()) {
25994
26063
  const l = e.level + 1;
25995
26064
  for (const a of e.sourceIndices) {
25996
- const c = new We(this.sourceRows[a], r, l, a);
26065
+ const c = new Ge(this.sourceRows[a], r, l, a);
25997
26066
  this.detailRows[a] = c, r.children.push(c);
25998
26067
  }
25999
26068
  } else
@@ -26050,7 +26119,7 @@ class mn {
26050
26119
  hideGroupedColumns: e.hideGroupedColumns
26051
26120
  }, o.body);
26052
26121
  (l || (u = e.tableOptions) != null && u.showCheckboxWihoutExtraColumn) && (c.rowSelectionModel = new Bt(c.rows));
26053
- const h = Se.createTableModel({
26122
+ const h = xe.createTableModel({
26054
26123
  columnDefs: s,
26055
26124
  bodyAreaModel: c,
26056
26125
  footerAggregates: mn.footerConfig(e),
@@ -26106,7 +26175,7 @@ class hh extends ye {
26106
26175
  ), this.pivot = s, this.type = "PivotColumnDef";
26107
26176
  }
26108
26177
  }
26109
- const dh = 1e3, Go = "Total";
26178
+ const dh = 1e3, Wo = "Total";
26110
26179
  function uh(n) {
26111
26180
  const e = n ?? [];
26112
26181
  if (!e.length)
@@ -26116,7 +26185,7 @@ function uh(n) {
26116
26185
  const i = typeof s == "string" || typeof s == "function" ? { value: s } : s;
26117
26186
  if (!i || typeof i.value != "string" && typeof i.value != "function")
26118
26187
  throw new Error(`Pivot: value ${o} has no value (a property path or a function).`);
26119
- const r = So(i.aggregator ?? "sum"), l = typeof i.value == "string" ? i.value : `value${o}`;
26188
+ const r = xo(i.aggregator ?? "sum"), l = typeof i.value == "string" ? i.value : `value${o}`;
26120
26189
  let a = i.name ?? `${r.name}(${l})`;
26121
26190
  if (t.has(a)) {
26122
26191
  let c = 2;
@@ -26357,25 +26426,25 @@ function ph(n) {
26357
26426
  }
26358
26427
  function Cn(n, e, t, s = {}) {
26359
26428
  var m;
26360
- const o = n.values, i = o.length > 1, r = e.totalLabel ?? Go, l = ph(e), a = (((m = e.columnFields) == null ? void 0 : m.length) ?? 0) > 0, c = s.valueWidth ?? new T(100, "px"), h = [...t], d = t.map((b) => ({ data: b.headerLabel, property: b.property })), u = (b, y, C) => {
26361
- var x;
26362
- return h.push(new hh(b, y, C, ((x = s.widths) == null ? void 0 : x.get(b)) ?? c)), { data: y, property: b };
26363
- }, f = (b, y, C, x, E) => i ? {
26429
+ const o = n.values, i = o.length > 1, r = e.totalLabel ?? Wo, l = ph(e), a = (((m = e.columnFields) == null ? void 0 : m.length) ?? 0) > 0, c = s.valueWidth ?? new T(100, "px"), h = [...t], d = t.map((b) => ({ data: b.headerLabel, property: b.property })), u = (b, y, C) => {
26430
+ var S;
26431
+ return h.push(new hh(b, y, C, ((S = s.widths) == null ? void 0 : S.get(b)) ?? c)), { data: y, property: b };
26432
+ }, f = (b, y, C, S, E) => i ? {
26364
26433
  data: b,
26365
26434
  visibility: E,
26366
- children: o.map((S, R) => u(x(S), S.label, { kind: y, column: C, value: S, valueIndex: R }))
26367
- } : { ...u(x(o[0]), b, { kind: y, column: C, value: o[0], valueIndex: 0 }), visibility: E }, g = (b) => {
26435
+ children: o.map((x, R) => u(S(x), x.label, { kind: y, column: C, value: x, valueIndex: R }))
26436
+ } : { ...u(S(o[0]), b, { kind: y, column: C, value: o[0], valueIndex: 0 }), visibility: E }, g = (b) => {
26368
26437
  var C;
26369
26438
  if (!n.isColumnShown(b))
26370
26439
  return;
26371
26440
  if (b.isLeaf())
26372
- return f(b.label, "value", b, (x) => bn(b, x));
26373
- const y = b.children.map(g).filter((x) => !!x);
26441
+ return f(b.label, "value", b, (S) => bn(b, S));
26442
+ const y = b.children.map(g).filter((S) => !!S);
26374
26443
  return l && y.push(f(
26375
26444
  `${b.label} ${r}`,
26376
26445
  "subtotal",
26377
26446
  b,
26378
- (x) => wn(b, x),
26447
+ (S) => wn(b, S),
26379
26448
  "always"
26380
26449
  )), {
26381
26450
  id: b.id,
@@ -26668,7 +26737,7 @@ class wh extends mt {
26668
26737
  return "";
26669
26738
  const o = this.properties[t], i = this.getRowGroup(e);
26670
26739
  if (o === J.PROPERTY)
26671
- return i ? this.getGroupLabel(i) : this.config.totalLabel ?? Go;
26740
+ return i ? this.getGroupLabel(i) : this.config.totalLabel ?? Wo;
26672
26741
  const r = o === void 0 ? void 0 : this.infoByProperty.get(o);
26673
26742
  if (!r)
26674
26743
  return "";
@@ -26735,7 +26804,7 @@ class wh extends mt {
26735
26804
  }
26736
26805
  getTextValueAt(e, t) {
26737
26806
  const s = this.properties[t], o = s === void 0 ? void 0 : this.infoByProperty.get(s), i = this.getValueAt(e, t);
26738
- return o ? i === void 0 ? this.isSubtotalSuppressed(e) ? "" : this.config.emptyText ?? "" : o.value.showValuesAs ? vo(i, o.value.showValuesAs) : o.value.format ? o.value.format(i) : Wt(i) : i == null ? "" : `${i}`;
26807
+ return o ? i === void 0 ? this.isSubtotalSuppressed(e) ? "" : this.config.emptyText ?? "" : o.value.showValuesAs ? vo(i, o.value.showValuesAs) : o.value.format ? o.value.format(i) : Gt(i) : i == null ? "" : `${i}`;
26739
26808
  }
26740
26809
  /** Value columns: the {@link AggregateCellRenderer} (text node); the group column: none (label as text). */
26741
26810
  getCellRenderer(e, t) {
@@ -26935,13 +27004,13 @@ class yh extends rn {
26935
27004
  if (e !== 0)
26936
27005
  return "";
26937
27006
  if (this.isRowHeaderCell(e, t))
26938
- return this.body.getConfig().totalLabel ?? Go;
27007
+ return this.body.getConfig().totalLabel ?? Wo;
26939
27008
  const s = this.body.getColumnInfo(t);
26940
27009
  return s ? this.body.getShownValue(void 0, s) : "";
26941
27010
  }
26942
27011
  getTextValueAt(e, t) {
26943
27012
  const s = this.body.getColumnInfo(t), o = this.getValueAt(e, t);
26944
- return s ? o === void 0 ? this.body.getConfig().emptyText ?? "" : s.value.showValuesAs ? vo(o, s.value.showValuesAs) : s.value.format ? s.value.format(o) : Wt(o) : o == null ? "" : `${o}`;
27013
+ return s ? o === void 0 ? this.body.getConfig().emptyText ?? "" : s.value.showValuesAs ? vo(o, s.value.showValuesAs) : s.value.format ? s.value.format(o) : Gt(o) : o == null ? "" : `${o}`;
26945
27014
  }
26946
27015
  getCellRenderer(e, t) {
26947
27016
  return this.body.getColumnInfo(t) || this.isLabelColumn(t) ? this.textRenderer : void 0;
@@ -26974,7 +27043,7 @@ class Ch extends Qc {
26974
27043
  return s ? s.ownColumn() ? ["ge-table-pivot-header-column"] : ["ge-table-pivot-header-group"] : [];
26975
27044
  }
26976
27045
  }
26977
- class xn {
27046
+ class Sn {
26978
27047
  /**
26979
27048
  * Creates the table model of a pivot table (see the class description).
26980
27049
  *
@@ -26990,7 +27059,7 @@ class xn {
26990
27059
  */
26991
27060
  static createTableModel(e) {
26992
27061
  var f, g, p;
26993
- const t = e.defaultRowHeights ?? ((f = e.tableOptions) == null ? void 0 : f.defaultRowHeights) ?? new Pe(), s = xn.toConfig(e), o = [];
27062
+ const t = e.defaultRowHeights ?? ((f = e.tableOptions) == null ? void 0 : f.defaultRowHeights) ?? new Pe(), s = Sn.toConfig(e), o = [];
26994
27063
  e.rowNumbersVisible && o.push(new Is(e.rowNumbersVisible === !0 ? {} : e.rowNumbersVisible));
26995
27064
  const i = { showCount: !1, ...e.groupColumn ?? {} }, r = new J(i);
26996
27065
  r.autoHeaderLabel && (r.headerLabel = yn(s.rowFields ?? [])), o.push(r);
@@ -27035,7 +27104,7 @@ class xn {
27035
27104
  };
27036
27105
  }
27037
27106
  }
27038
- class Sn {
27107
+ class xn {
27039
27108
  constructor(e) {
27040
27109
  this.options = e, this.abort = new AbortController();
27041
27110
  }
@@ -27046,7 +27115,7 @@ class Sn {
27046
27115
  * @returns {SelectCellEditor} the editor
27047
27116
  */
27048
27117
  static create(e) {
27049
- return new Sn(e.map((t) => ({ value: t, label: t })));
27118
+ return new xn(e.map((t) => ({ value: t, label: t })));
27050
27119
  }
27051
27120
  open(e, t) {
27052
27121
  var l;
@@ -27109,7 +27178,7 @@ class tu {
27109
27178
  if (e.activeElement === this.input && this.cell)
27110
27179
  return;
27111
27180
  const t = this.api.getActiveCell(), s = t ? this.api.getCellAddress(t[0], t[1]) : void 0;
27112
- e.activeElement !== this.addressInput && (this.addressInput.value = s ?? ""), this.input.value = t ? xh(this.api.getCellInput(t[0], t[1])) : "", this.input.disabled = !t;
27181
+ e.activeElement !== this.addressInput && (this.addressInput.value = s ?? ""), this.input.value = t ? Sh(this.api.getCellInput(t[0], t[1])) : "", this.input.disabled = !t;
27113
27182
  }
27114
27183
  // ------------------------------------------------------------------------------------------------ internals
27115
27184
  onEditing(e) {
@@ -27149,7 +27218,7 @@ class tu {
27149
27218
  this.api.getTableScope().hostElement.focus({ preventScroll: !0 }), this.show();
27150
27219
  }
27151
27220
  }
27152
- function xh(n) {
27221
+ function Sh(n) {
27153
27222
  if (n == null) return "";
27154
27223
  if (n instanceof Date) {
27155
27224
  if (Number.isNaN(n.getTime())) return "";
@@ -27234,7 +27303,7 @@ export {
27234
27303
  ss as EventAdapter,
27235
27304
  Ph as EventCheckboxChangedHandler,
27236
27305
  wa as ExcelService,
27237
- Wa as FORMULA_FUNCTION_INFO,
27306
+ Ga as FORMULA_FUNCTION_INFO,
27238
27307
  Dh as FORMULA_FUNCTION_NAMES,
27239
27308
  Fl as FalseFn,
27240
27309
  us as FillHandleOptions,
@@ -27263,7 +27332,7 @@ export {
27263
27332
  wd as IndexAndPx,
27264
27333
  Vl as InputCellRenderer,
27265
27334
  ia as InputHandler,
27266
- Wo as JsonService,
27335
+ Go as JsonService,
27267
27336
  lt as LicenseManager,
27268
27337
  ro as LiveAnnouncer,
27269
27338
  _d as MaleFemaleToIconCellRenderer,
@@ -27275,7 +27344,7 @@ export {
27275
27344
  An as NullPropertyType,
27276
27345
  $a as NumberCellEditor,
27277
27346
  Bd as NumberCellProgressBarCellRenderer,
27278
- Gd as NumberCellRenderer,
27347
+ Wd as NumberCellRenderer,
27279
27348
  Mn as NumberPropertyType,
27280
27349
  ve as ObjectPropertyType,
27281
27350
  la as OsxShortcutActionIdMapping,
@@ -27289,10 +27358,10 @@ export {
27289
27358
  qi as PROPERTY_TYPE_KEY_STRING,
27290
27359
  Ot as PROPERTY_TYPE_KEY_UNDEFINED,
27291
27360
  eo as Padding,
27292
- Sa as PendingCellChanges,
27361
+ xa as PendingCellChanges,
27293
27362
  Nc as PendingChangesUndoable,
27294
27363
  hh as PivotColumnDef,
27295
- xn as PivotFactory,
27364
+ Sn as PivotFactory,
27296
27365
  fo as PivotResult,
27297
27366
  mh as PivotTableModel,
27298
27367
  zd as PositiveAndNegativeNumberRenderer,
@@ -27316,7 +27385,7 @@ export {
27316
27385
  re as SHEET_MAX_ROWS,
27317
27386
  Zn as SHOW_VALUES_AS_MODES,
27318
27387
  Eh as SchemeGenerator,
27319
- Sn as SelectCellEditor,
27388
+ xn as SelectCellEditor,
27320
27389
  ln as SelectCellRenderer,
27321
27390
  qs as SelectionAggregator,
27322
27391
  ke as SelectionModel,
@@ -27331,19 +27400,19 @@ export {
27331
27400
  or as SortedOptions,
27332
27401
  Oh as SpreadsheetFactory,
27333
27402
  Lr as SpreadsheetTableModel,
27334
- Wd as StarRatingCellRenderer,
27403
+ Gd as StarRatingCellRenderer,
27335
27404
  Dd as StoreStateCollapsedExpandService,
27336
27405
  Id as StoreStateScrollPosService,
27337
27406
  kd as StoreStateSortingService,
27338
27407
  En as StringPropertyType,
27339
27408
  jl as TableApi,
27340
27409
  Td as TableCellUpdateEvent,
27341
- Se as TableFactory,
27410
+ xe as TableFactory,
27342
27411
  Ye as TableModel,
27343
27412
  Xc as TableModelAndOptions,
27344
27413
  qe as TableOptions,
27345
27414
  Xl as TableOverlay,
27346
- Wi as TableScope,
27415
+ Gi as TableScope,
27347
27416
  Bo as TableSheet,
27348
27417
  oo as TableStateService,
27349
27418
  Vo as TextCellEditor,
@@ -27353,7 +27422,7 @@ export {
27353
27422
  Et as TreeFactory,
27354
27423
  sr as TreeOptions,
27355
27424
  Je as TreeRow,
27356
- Gc as TreeRowService,
27425
+ Wc as TreeRowService,
27357
27426
  $d as TrueFalseCellRenderer,
27358
27427
  Yt as TrueFn,
27359
27428
  ji as TwoColorGradientArg,
@@ -27372,13 +27441,13 @@ export {
27372
27441
  Th as aggregateColumns,
27373
27442
  Qd as aggregateRowGroups,
27374
27443
  vd as allCenter,
27375
- Sd as allLeft,
27444
+ xd as allLeft,
27376
27445
  Rd as allRight,
27377
27446
  Vh as applySpreadsheetPreset,
27378
- St as applyStructureEdit,
27447
+ xt as applyStructureEdit,
27379
27448
  Cd as bodyCenter,
27380
27449
  yd as bodyLeft,
27381
- xd as bodyRight,
27450
+ Sd as bodyRight,
27382
27451
  Fh as booleanInputPipe,
27383
27452
  Jo as calcMoveToIndex,
27384
27453
  hi as calcOverlayKind,
@@ -27400,17 +27469,17 @@ export {
27400
27469
  Es as createValueGetter,
27401
27470
  jt as dateToSerial,
27402
27471
  vn as debounce,
27403
- Ga as editInputPipeForNumber,
27472
+ Wa as editInputPipeForNumber,
27404
27473
  tc as editingShortcutLayer,
27405
27474
  Uo as entitySuffix,
27406
27475
  Y as escapeHtml,
27407
27476
  Bc as findDataEdge,
27408
27477
  Ih as findRowIndexAtY,
27409
27478
  Ln as firstLetterUppercase,
27410
- Wt as formatAggregateValue,
27479
+ Gt as formatAggregateValue,
27411
27480
  es as formatFormula,
27412
27481
  vo as formatShowValuesAs,
27413
- So as getAggregator,
27482
+ xo as getAggregator,
27414
27483
  As as getAreaIdentByString,
27415
27484
  Dn as getEntityName,
27416
27485
  jr as getFillRange,
@@ -27441,7 +27510,7 @@ export {
27441
27510
  dt as isRowGroupColumnDef,
27442
27511
  O as isRowNumberColumnDef,
27443
27512
  $t as isSameCellValue,
27444
- W as isSheetDate,
27513
+ G as isSheetDate,
27445
27514
  Io as isSpreadsheetTableModel,
27446
27515
  U as isTreeRow,
27447
27516
  Bn as mirrorArrowKeys,
@@ -27474,8 +27543,8 @@ export {
27474
27543
  zh as px230,
27475
27544
  Kh as px240,
27476
27545
  Uh as px250,
27477
- Wh as px260,
27478
- Gh as px270,
27546
+ Gh as px260,
27547
+ Wh as px270,
27479
27548
  Hh as px280,
27480
27549
  $h as px290,
27481
27550
  dd as px30,
@@ -27492,13 +27561,13 @@ export {
27492
27561
  ui as removeLegacyState,
27493
27562
  Ut as resolveShowValuesAs,
27494
27563
  On as resolveTableDirection,
27495
- xr as serialToDate,
27564
+ Sr as serialToDate,
27496
27565
  Vn as setLogicalScrollLeft,
27497
27566
  Dr as sheetInputPipe,
27498
27567
  wc as shiftFormula,
27499
27568
  nt as spreadsheetOption,
27500
27569
  Ro as sumOfNumbers,
27501
- Sh as throttle,
27570
+ xh as throttle,
27502
27571
  Mt as toCellAddress,
27503
27572
  Ec as toHtmlTable,
27504
27573
  _n as toLogicalX,