@fileverse-dev/dsheet 3.0.1 → 3.0.2-29July-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
- import { g as Ze } from "./executeStringFunction-C5hEkx9z.js";
2
- import * as Je from "yjs";
3
- import { m as Qe, y as Ke, r as et } from "./index-Enuo_ZOm.js";
1
+ import { g as Je } from "./executeStringFunction-C5hEkx9z.js";
2
+ import * as Ue from "yjs";
3
+ import { m as Qe, y as Ke, r as et } from "./index-B5OjJYA0.js";
4
4
  import { n as tt } from "./xlsx-hyperlink-inline-DzewAypN.js";
5
5
  import { toast as Ie } from "@fileverse/ui";
6
- var ze = { exports: {} };
6
+ var qe = { exports: {} };
7
7
  (function(y) {
8
- var u = {}, g = function(p) {
9
- p.version = "0.11.2";
8
+ var s = {}, g = function(w) {
9
+ w.version = "0.11.2";
10
10
  function v(t) {
11
11
  for (var r = "", n = t.length - 1; n >= 0; ) r += t.charAt(n--);
12
12
  return r;
@@ -23,7 +23,7 @@ var ze = { exports: {} };
23
23
  var n = "" + t;
24
24
  return n.length >= r ? n : $(" ", r - n.length) + n;
25
25
  }
26
- function I(t, r) {
26
+ function U(t, r) {
27
27
  var n = "" + t;
28
28
  return n.length >= r ? n : n + $(" ", r - n.length);
29
29
  }
@@ -36,7 +36,7 @@ var ze = { exports: {} };
36
36
  return n.length >= r ? n : $("0", r - n.length) + n;
37
37
  }
38
38
  var ie = Math.pow(2, 32);
39
- function re(t, r) {
39
+ function ne(t, r) {
40
40
  if (t > ie || t < -ie) return J(t, r);
41
41
  var n = Math.round(t);
42
42
  return F(n, r);
@@ -105,7 +105,7 @@ var ze = { exports: {} };
105
105
  }
106
106
  return f.y = a[0], f.m = a[1], f.d = a[2], f.S = e % 60, e = Math.floor(e / 60), f.M = e % 60, e = Math.floor(e / 60), f.H = e, f.q = d, f;
107
107
  }
108
- p.parse_date_code = ye;
108
+ w.parse_date_code = ye;
109
109
  var Se = new Date(1899, 11, 31, 0, 0, 0), Re = Se.getTime(), Le = new Date(1900, 2, 1, 0, 0, 0);
110
110
  function Ne(t, r) {
111
111
  var n = t.getTime();
@@ -114,7 +114,7 @@ var ze = { exports: {} };
114
114
  function He(t) {
115
115
  return t.toString(10);
116
116
  }
117
- p._general_int = He;
117
+ w._general_int = He;
118
118
  var Te = /* @__PURE__ */ function() {
119
119
  var r = /(?:\.0*|(\.\d*[1-9])0+)$/;
120
120
  function n(l) {
@@ -138,7 +138,7 @@ var ze = { exports: {} };
138
138
  }
139
139
  return C;
140
140
  }();
141
- p._general_num = Te;
141
+ w._general_num = Te;
142
142
  function ge(t, r) {
143
143
  switch (typeof t) {
144
144
  case "string":
@@ -155,7 +155,7 @@ var ze = { exports: {} };
155
155
  }
156
156
  throw new Error("unsupported value in General format: " + t);
157
157
  }
158
- p._general = ge;
158
+ w._general = ge;
159
159
  function Fe(t, r) {
160
160
  r[0] -= 581;
161
161
  var n = t.getDay();
@@ -268,15 +268,15 @@ var ze = { exports: {} };
268
268
  for (var n = t.length % r, m = t.substr(0, n); n != t.length; n += r) m += (m.length > 0 ? "," : "") + t.substr(n, r);
269
269
  return m;
270
270
  }
271
- var ne = /* @__PURE__ */ function() {
271
+ var ae = /* @__PURE__ */ function() {
272
272
  var r = /%/g;
273
273
  function n(h, i, c) {
274
274
  var k = i.replace(r, ""), o = i.length - k.length;
275
- return ne(h, k, c * Math.pow(10, 2 * o)) + $("%", o);
275
+ return ae(h, k, c * Math.pow(10, 2 * o)) + $("%", o);
276
276
  }
277
277
  function m(h, i, c) {
278
278
  for (var k = i.length - 1; i.charCodeAt(k - 1) === 44; ) --k;
279
- return ne(h, i.substr(0, k), c / Math.pow(10, 3 * (i.length - k)));
279
+ return ae(h, i.substr(0, k), c / Math.pow(10, 3 * (i.length - k)));
280
280
  }
281
281
  function e(h, i) {
282
282
  var c, k = h.indexOf("E") - h.indexOf(".") - 1;
@@ -285,23 +285,23 @@ var ze = { exports: {} };
285
285
  if (i < 0) return "-" + e(h, -i);
286
286
  var o = h.indexOf(".");
287
287
  o === -1 && (o = h.indexOf("E"));
288
- var s = Math.floor(Math.log(i) * Math.LOG10E) % o;
289
- if (s < 0 && (s += o), c = (i / Math.pow(10, s)).toPrecision(k + 1 + (o + s) % o), c.indexOf("e") === -1) {
288
+ var u = Math.floor(Math.log(i) * Math.LOG10E) % o;
289
+ if (u < 0 && (u += o), c = (i / Math.pow(10, u)).toPrecision(k + 1 + (o + u) % o), c.indexOf("e") === -1) {
290
290
  var E = Math.floor(Math.log(i) * Math.LOG10E);
291
- for (c.indexOf(".") === -1 ? c = c.charAt(0) + "." + c.substr(1) + "E+" + (E - c.length + s) : c += "E+" + (E - s); c.substr(0, 2) === "0."; )
291
+ for (c.indexOf(".") === -1 ? c = c.charAt(0) + "." + c.substr(1) + "E+" + (E - c.length + u) : c += "E+" + (E - u); c.substr(0, 2) === "0."; )
292
292
  c = c.charAt(0) + c.substr(2, o) + "." + c.substr(2 + o), c = c.replace(/^0+([1-9])/, "$1").replace(/^0+\./, "0.");
293
293
  c = c.replace(/\+-/, "-");
294
294
  }
295
295
  c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(H, j, W, S) {
296
- return j + W + S.substr(0, (o + s) % o) + "." + S.substr(s) + "E";
296
+ return j + W + S.substr(0, (o + u) % o) + "." + S.substr(u) + "E";
297
297
  });
298
298
  } else c = i.toExponential(k);
299
299
  return h.match(/E\+00$/) && c.match(/e[+-]\d$/) && (c = c.substr(0, c.length - 1) + "0" + c.charAt(c.length - 1)), h.match(/E\-/) && c.match(/e\+/) && (c = c.replace(/e\+/, "e")), c.replace("e", "E");
300
300
  }
301
301
  var d = /# (\?+)( ?)\/( ?)(\d+)/;
302
302
  function a(h, i, c) {
303
- var k = parseInt(h[4], 10), o = Math.round(i * k), s = Math.floor(o / k), E = o - s * k, H = k;
304
- return c + (s === 0 ? "" : "" + s) + " " + (E === 0 ? $(" ", h[1].length + 1 + h[4].length) : R(E, h[1].length) + h[2] + "/" + h[3] + N(H, h[4].length));
303
+ var k = parseInt(h[4], 10), o = Math.round(i * k), u = Math.floor(o / k), E = o - u * k, H = k;
304
+ return c + (u === 0 ? "" : "" + u) + " " + (E === 0 ? $(" ", h[1].length + 1 + h[4].length) : R(E, h[1].length) + h[2] + "/" + h[3] + N(H, h[4].length));
305
305
  }
306
306
  function f(h, i, c) {
307
307
  return c + (i === 0 ? "" : "" + i) + $(" ", h[1].length + 2 + h[4].length);
@@ -326,7 +326,7 @@ var ze = { exports: {} };
326
326
  var c = Math.pow(10, i);
327
327
  return "" + Math.round(h * c) / c;
328
328
  }
329
- function U(h, i) {
329
+ function I(h, i) {
330
330
  var c = h - Math.floor(h), k = Math.pow(10, i);
331
331
  return i < ("" + Math.round(c * k)).length ? 0 : Math.round(c * k);
332
332
  }
@@ -345,51 +345,51 @@ var ze = { exports: {} };
345
345
  if (i.indexOf("%") !== -1) return n(h, i, c);
346
346
  if (i.indexOf("E") !== -1) return e(i, c);
347
347
  if (i.charCodeAt(0) === 36) return "$" + O(h, i.substr(i.charAt(1) == " " ? 2 : 1), c);
348
- var o, s, E, H, j = Math.abs(c), W = c < 0 ? "-" : "";
349
- if (i.match(/^00+$/)) return W + re(j, i.length);
348
+ var o, u, E, H, j = Math.abs(c), W = c < 0 ? "-" : "";
349
+ if (i.match(/^00+$/)) return W + ne(j, i.length);
350
350
  if (i.match(/^[#?]+$/))
351
- return o = re(c, 0), o === "0" && (o = ""), o.length > i.length ? o : A(i.substr(0, i.length - o.length)) + o;
352
- if (s = i.match(d)) return a(s, j, W);
353
- if (i.match(/^#+0+$/)) return W + re(j, i.length - i.indexOf("0"));
354
- if (s = i.match(C))
355
- return o = D(c, s[1].length).replace(/^([^\.]+)$/, "$1." + A(s[1])).replace(/\.$/, "." + A(s[1])).replace(/\.(\d*)$/, function(z, pe) {
356
- return "." + pe + $("0", A(s[1]).length - pe.length);
351
+ return o = ne(c, 0), o === "0" && (o = ""), o.length > i.length ? o : A(i.substr(0, i.length - o.length)) + o;
352
+ if (u = i.match(d)) return a(u, j, W);
353
+ if (i.match(/^#+0+$/)) return W + ne(j, i.length - i.indexOf("0"));
354
+ if (u = i.match(C))
355
+ return o = D(c, u[1].length).replace(/^([^\.]+)$/, "$1." + A(u[1])).replace(/\.$/, "." + A(u[1])).replace(/\.(\d*)$/, function(z, pe) {
356
+ return "." + pe + $("0", A(u[1]).length - pe.length);
357
357
  }), i.indexOf("0.") !== -1 ? o : o.replace(/^0\./, ".");
358
- if (i = i.replace(/^#+([0.])/, "$1"), s = i.match(/^(0*)\.(#*)$/))
359
- return W + D(j, s[2].length).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, s[1].length ? "0." : ".");
360
- if (s = i.match(/^#{1,3},##0(\.?)$/)) return W + oe(re(j, 0));
361
- if (s = i.match(/^#,##0\.([#0]*0)$/))
362
- return c < 0 ? "-" + O(h, i, -c) : oe("" + (Math.floor(c) + T(c, s[1].length))) + "." + N(U(c, s[1].length), s[1].length);
363
- if (s = i.match(/^#,#*,#0/)) return O(h, i.replace(/^#,#*,/, ""), c);
364
- if (s = i.match(/^([0#]+)(\\?-([0#]+))+$/))
358
+ if (i = i.replace(/^#+([0.])/, "$1"), u = i.match(/^(0*)\.(#*)$/))
359
+ return W + D(j, u[2].length).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, u[1].length ? "0." : ".");
360
+ if (u = i.match(/^#{1,3},##0(\.?)$/)) return W + oe(ne(j, 0));
361
+ if (u = i.match(/^#,##0\.([#0]*0)$/))
362
+ return c < 0 ? "-" + O(h, i, -c) : oe("" + (Math.floor(c) + T(c, u[1].length))) + "." + N(I(c, u[1].length), u[1].length);
363
+ if (u = i.match(/^#,#*,#0/)) return O(h, i.replace(/^#,#*,/, ""), c);
364
+ if (u = i.match(/^([0#]+)(\\?-([0#]+))+$/))
365
365
  return o = v(O(h, i.replace(/[\\-]/g, ""), c)), E = 0, v(v(i.replace(/\\/g, "")).replace(/[0#]/g, function(z) {
366
366
  return E < o.length ? o.charAt(E++) : z === "0" ? "0" : "";
367
367
  }));
368
368
  if (i.match(_))
369
369
  return o = O(h, "##########", c), "(" + o.substr(0, 3) + ") " + o.substr(3, 3) + "-" + o.substr(6);
370
370
  var S = "";
371
- if (s = i.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
372
- return E = Math.min(s[4].length, 7), H = we(j, Math.pow(10, E) - 1, !1), o = "" + W, S = ne("n", s[1], H[1]), S.charAt(S.length - 1) == " " && (S = S.substr(0, S.length - 1) + "0"), o += S + s[2] + "/" + s[3], S = I(H[2], E), S.length < s[4].length && (S = A(s[4].substr(s[4].length - S.length)) + S), o += S, o;
373
- if (s = i.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
374
- return E = Math.min(Math.max(s[1].length, s[4].length), 7), H = we(j, Math.pow(10, E) - 1, !0), W + (H[0] || (H[1] ? "" : "0")) + " " + (H[1] ? R(H[1], E) + s[2] + "/" + s[3] + I(H[2], E) : $(" ", 2 * E + 1 + s[2].length + s[3].length));
375
- if (s = i.match(/^[#0?]+$/))
376
- return o = re(c, 0), i.length <= o.length ? o : A(i.substr(0, i.length - o.length)) + o;
377
- if (s = i.match(/^([#0?]+)\.([#0]+)$/)) {
378
- o = "" + c.toFixed(Math.min(s[2].length, 10)).replace(/([^0])0+$/, "$1"), E = o.indexOf(".");
371
+ if (u = i.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
372
+ return E = Math.min(u[4].length, 7), H = we(j, Math.pow(10, E) - 1, !1), o = "" + W, S = ae("n", u[1], H[1]), S.charAt(S.length - 1) == " " && (S = S.substr(0, S.length - 1) + "0"), o += S + u[2] + "/" + u[3], S = U(H[2], E), S.length < u[4].length && (S = A(u[4].substr(u[4].length - S.length)) + S), o += S, o;
373
+ if (u = i.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
374
+ return E = Math.min(Math.max(u[1].length, u[4].length), 7), H = we(j, Math.pow(10, E) - 1, !0), W + (H[0] || (H[1] ? "" : "0")) + " " + (H[1] ? R(H[1], E) + u[2] + "/" + u[3] + U(H[2], E) : $(" ", 2 * E + 1 + u[2].length + u[3].length));
375
+ if (u = i.match(/^[#0?]+$/))
376
+ return o = ne(c, 0), i.length <= o.length ? o : A(i.substr(0, i.length - o.length)) + o;
377
+ if (u = i.match(/^([#0?]+)\.([#0]+)$/)) {
378
+ o = "" + c.toFixed(Math.min(u[2].length, 10)).replace(/([^0])0+$/, "$1"), E = o.indexOf(".");
379
379
  var be = i.indexOf(".") - E, ve = i.length - o.length - be;
380
380
  return A(i.substr(0, be) + o + i.substr(i.length - ve));
381
381
  }
382
- if (s = i.match(/^00,000\.([#0]*0)$/))
383
- return E = U(c, s[1].length), c < 0 ? "-" + O(h, i, -c) : oe(L(c)).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function(z) {
382
+ if (u = i.match(/^00,000\.([#0]*0)$/))
383
+ return E = I(c, u[1].length), c < 0 ? "-" + O(h, i, -c) : oe(L(c)).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function(z) {
384
384
  return "00," + (z.length < 3 ? N(0, 3 - z.length) : "") + z;
385
- }) + "." + N(E, s[1].length);
385
+ }) + "." + N(E, u[1].length);
386
386
  switch (i) {
387
387
  case "###,##0.00":
388
388
  return O(h, "#,##0.00", c);
389
389
  case "###,###":
390
390
  case "##,###":
391
391
  case "#,###":
392
- var me = oe(re(j, 0));
392
+ var me = oe(ne(j, 0));
393
393
  return me !== "0" ? W + me : "";
394
394
  case "###,###.00":
395
395
  return O(h, "###,##0.00", c).replace(/^0\./, ".");
@@ -400,11 +400,11 @@ var ze = { exports: {} };
400
400
  }
401
401
  function se(h, i, c) {
402
402
  for (var k = i.length - 1; i.charCodeAt(k - 1) === 44; ) --k;
403
- return ne(h, i.substr(0, k), c / Math.pow(10, 3 * (i.length - k)));
403
+ return ae(h, i.substr(0, k), c / Math.pow(10, 3 * (i.length - k)));
404
404
  }
405
405
  function ue(h, i, c) {
406
406
  var k = i.replace(r, ""), o = i.length - k.length;
407
- return ne(h, k, c * Math.pow(10, 2 * o)) + $("%", o);
407
+ return ae(h, k, c * Math.pow(10, 2 * o)) + $("%", o);
408
408
  }
409
409
  function Z(h, i) {
410
410
  var c, k = h.indexOf("E") - h.indexOf(".") - 1;
@@ -413,13 +413,13 @@ var ze = { exports: {} };
413
413
  if (i < 0) return "-" + Z(h, -i);
414
414
  var o = h.indexOf(".");
415
415
  o === -1 && (o = h.indexOf("E"));
416
- var s = Math.floor(Math.log(i) * Math.LOG10E) % o;
417
- if (s < 0 && (s += o), c = (i / Math.pow(10, s)).toPrecision(k + 1 + (o + s) % o), !c.match(/[Ee]/)) {
416
+ var u = Math.floor(Math.log(i) * Math.LOG10E) % o;
417
+ if (u < 0 && (u += o), c = (i / Math.pow(10, u)).toPrecision(k + 1 + (o + u) % o), !c.match(/[Ee]/)) {
418
418
  var E = Math.floor(Math.log(i) * Math.LOG10E);
419
- c.indexOf(".") === -1 ? c = c.charAt(0) + "." + c.substr(1) + "E+" + (E - c.length + s) : c += "E+" + (E - s), c = c.replace(/\+-/, "-");
419
+ c.indexOf(".") === -1 ? c = c.charAt(0) + "." + c.substr(1) + "E+" + (E - c.length + u) : c += "E+" + (E - u), c = c.replace(/\+-/, "-");
420
420
  }
421
421
  c = c.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function(H, j, W, S) {
422
- return j + W + S.substr(0, (o + s) % o) + "." + S.substr(s) + "E";
422
+ return j + W + S.substr(0, (o + u) % o) + "." + S.substr(u) + "E";
423
423
  });
424
424
  } else c = i.toExponential(k);
425
425
  return h.match(/E\+00$/) && c.match(/e[+-]\d$/) && (c = c.substr(0, c.length - 1) + "0" + c.charAt(c.length - 1)), h.match(/E\-/) && c.match(/e\+/) && (c = c.replace(/e\+/, "e")), c.replace("e", "E");
@@ -433,44 +433,44 @@ var ze = { exports: {} };
433
433
  if (i.indexOf("%") !== -1) return ue(h, i, c);
434
434
  if (i.indexOf("E") !== -1) return Z(i, c);
435
435
  if (i.charCodeAt(0) === 36) return "$" + x(h, i.substr(i.charAt(1) == " " ? 2 : 1), c);
436
- var o, s, E, H, j = Math.abs(c), W = c < 0 ? "-" : "";
436
+ var o, u, E, H, j = Math.abs(c), W = c < 0 ? "-" : "";
437
437
  if (i.match(/^00+$/)) return W + N(j, i.length);
438
438
  if (i.match(/^[#?]+$/))
439
439
  return o = "" + c, c === 0 && (o = ""), o.length > i.length ? o : A(i.substr(0, i.length - o.length)) + o;
440
- if (s = i.match(d)) return f(s, j, W);
440
+ if (u = i.match(d)) return f(u, j, W);
441
441
  if (i.match(/^#+0+$/)) return W + N(j, i.length - i.indexOf("0"));
442
- if (s = i.match(C))
443
- return o = ("" + c).replace(/^([^\.]+)$/, "$1." + A(s[1])).replace(/\.$/, "." + A(s[1])), o = o.replace(/\.(\d*)$/, function(z, pe) {
444
- return "." + pe + $("0", A(s[1]).length - pe.length);
442
+ if (u = i.match(C))
443
+ return o = ("" + c).replace(/^([^\.]+)$/, "$1." + A(u[1])).replace(/\.$/, "." + A(u[1])), o = o.replace(/\.(\d*)$/, function(z, pe) {
444
+ return "." + pe + $("0", A(u[1]).length - pe.length);
445
445
  }), i.indexOf("0.") !== -1 ? o : o.replace(/^0\./, ".");
446
- if (i = i.replace(/^#+([0.])/, "$1"), s = i.match(/^(0*)\.(#*)$/))
447
- return W + ("" + j).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, s[1].length ? "0." : ".");
448
- if (s = i.match(/^#{1,3},##0(\.?)$/)) return W + oe("" + j);
449
- if (s = i.match(/^#,##0\.([#0]*0)$/))
450
- return c < 0 ? "-" + x(h, i, -c) : oe("" + c) + "." + $("0", s[1].length);
451
- if (s = i.match(/^#,#*,#0/)) return x(h, i.replace(/^#,#*,/, ""), c);
452
- if (s = i.match(/^([0#]+)(\\?-([0#]+))+$/))
446
+ if (i = i.replace(/^#+([0.])/, "$1"), u = i.match(/^(0*)\.(#*)$/))
447
+ return W + ("" + j).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, u[1].length ? "0." : ".");
448
+ if (u = i.match(/^#{1,3},##0(\.?)$/)) return W + oe("" + j);
449
+ if (u = i.match(/^#,##0\.([#0]*0)$/))
450
+ return c < 0 ? "-" + x(h, i, -c) : oe("" + c) + "." + $("0", u[1].length);
451
+ if (u = i.match(/^#,#*,#0/)) return x(h, i.replace(/^#,#*,/, ""), c);
452
+ if (u = i.match(/^([0#]+)(\\?-([0#]+))+$/))
453
453
  return o = v(x(h, i.replace(/[\\-]/g, ""), c)), E = 0, v(v(i.replace(/\\/g, "")).replace(/[0#]/g, function(z) {
454
454
  return E < o.length ? o.charAt(E++) : z === "0" ? "0" : "";
455
455
  }));
456
456
  if (i.match(_))
457
457
  return o = x(h, "##########", c), "(" + o.substr(0, 3) + ") " + o.substr(3, 3) + "-" + o.substr(6);
458
458
  var S = "";
459
- if (s = i.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
460
- return E = Math.min(s[4].length, 7), H = we(j, Math.pow(10, E) - 1, !1), o = "" + W, S = ne("n", s[1], H[1]), S.charAt(S.length - 1) == " " && (S = S.substr(0, S.length - 1) + "0"), o += S + s[2] + "/" + s[3], S = I(H[2], E), S.length < s[4].length && (S = A(s[4].substr(s[4].length - S.length)) + S), o += S, o;
461
- if (s = i.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
462
- return E = Math.min(Math.max(s[1].length, s[4].length), 7), H = we(j, Math.pow(10, E) - 1, !0), W + (H[0] || (H[1] ? "" : "0")) + " " + (H[1] ? R(H[1], E) + s[2] + "/" + s[3] + I(H[2], E) : $(" ", 2 * E + 1 + s[2].length + s[3].length));
463
- if (s = i.match(/^[#0?]+$/))
459
+ if (u = i.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))
460
+ return E = Math.min(u[4].length, 7), H = we(j, Math.pow(10, E) - 1, !1), o = "" + W, S = ae("n", u[1], H[1]), S.charAt(S.length - 1) == " " && (S = S.substr(0, S.length - 1) + "0"), o += S + u[2] + "/" + u[3], S = U(H[2], E), S.length < u[4].length && (S = A(u[4].substr(u[4].length - S.length)) + S), o += S, o;
461
+ if (u = i.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))
462
+ return E = Math.min(Math.max(u[1].length, u[4].length), 7), H = we(j, Math.pow(10, E) - 1, !0), W + (H[0] || (H[1] ? "" : "0")) + " " + (H[1] ? R(H[1], E) + u[2] + "/" + u[3] + U(H[2], E) : $(" ", 2 * E + 1 + u[2].length + u[3].length));
463
+ if (u = i.match(/^[#0?]+$/))
464
464
  return o = "" + c, i.length <= o.length ? o : A(i.substr(0, i.length - o.length)) + o;
465
- if (s = i.match(/^([#0]+)\.([#0]+)$/)) {
466
- o = "" + c.toFixed(Math.min(s[2].length, 10)).replace(/([^0])0+$/, "$1"), E = o.indexOf(".");
465
+ if (u = i.match(/^([#0]+)\.([#0]+)$/)) {
466
+ o = "" + c.toFixed(Math.min(u[2].length, 10)).replace(/([^0])0+$/, "$1"), E = o.indexOf(".");
467
467
  var be = i.indexOf(".") - E, ve = i.length - o.length - be;
468
468
  return A(i.substr(0, be) + o + i.substr(i.length - ve));
469
469
  }
470
- if (s = i.match(/^00,000\.([#0]*0)$/))
470
+ if (u = i.match(/^00,000\.([#0]*0)$/))
471
471
  return c < 0 ? "-" + x(h, i, -c) : oe("" + c).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function(z) {
472
472
  return "00," + (z.length < 3 ? N(0, 3 - z.length) : "") + z;
473
- }) + "." + N(0, s[1].length);
473
+ }) + "." + N(0, u[1].length);
474
474
  switch (i) {
475
475
  case "###,###":
476
476
  case "##,###":
@@ -505,7 +505,7 @@ var ze = { exports: {} };
505
505
  if (r[r.length] = t.substr(e), n === !0) throw new Error("Format |" + t + "| unterminated string ");
506
506
  return r;
507
507
  }
508
- p._split = ke;
508
+ w._split = ke;
509
509
  var _e = /\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;
510
510
  function xe(t) {
511
511
  for (var r = 0, n = "", m = ""; r < t.length; )
@@ -596,7 +596,7 @@ var ze = { exports: {} };
596
596
  }
597
597
  return !1;
598
598
  }
599
- p.is_date = xe;
599
+ w.is_date = xe;
600
600
  function $e(t, r, n, m) {
601
601
  for (var e = [], d = "", a = 0, f = "", C = "t", l, _, A, D = "H"; a < t.length; )
602
602
  switch (f = t.charAt(a)) {
@@ -609,8 +609,8 @@ var ze = { exports: {} };
609
609
  e[e.length] = { t: "t", v: d }, ++a;
610
610
  break;
611
611
  case "\\":
612
- var U = t.charAt(++a), T = U === "(" || U === ")" ? U : "t";
613
- e[e.length] = { t: T, v: U }, ++a;
612
+ var I = t.charAt(++a), T = I === "(" || I === ")" ? I : "t";
613
+ e[e.length] = { t: T, v: I }, ++a;
614
614
  break;
615
615
  case "_":
616
616
  e[e.length] = { t: "t", v: " " }, a += 2;
@@ -774,7 +774,7 @@ var ze = { exports: {} };
774
774
  }
775
775
  var h = "", i, c;
776
776
  if (Z.length > 0) {
777
- Z.charCodeAt(0) == 40 ? (i = r < 0 && Z.charCodeAt(0) === 45 ? -r : r, c = ne("n", Z, i)) : (i = r < 0 && m > 1 ? -r : r, c = ne("n", Z, i), i < 0 && e[0] && e[0].t == "t" && (c = c.substr(1), e[0].v = "-" + e[0].v)), x = c.length - 1;
777
+ Z.charCodeAt(0) == 40 ? (i = r < 0 && Z.charCodeAt(0) === 45 ? -r : r, c = ae("n", Z, i)) : (i = r < 0 && m > 1 ? -r : r, c = ae("n", Z, i), i < 0 && e[0] && e[0].t == "t" && (c = c.substr(1), e[0].v = "-" + e[0].v)), x = c.length - 1;
778
778
  var k = e.length;
779
779
  for (a = 0; a < e.length; ++a) if (e[a] != null && e[a].t != "t" && e[a].v.indexOf(".") > -1) {
780
780
  k = a;
@@ -800,14 +800,14 @@ var ze = { exports: {} };
800
800
  }
801
801
  }
802
802
  }
803
- for (a = 0; a < e.length; ++a) e[a] != null && "n?".indexOf(e[a].t) > -1 && (i = m > 1 && r < 0 && a > 0 && e[a - 1].v === "-" ? -r : r, e[a].v = ne(e[a].t, e[a].v, i), e[a].t = "t");
804
- var s = "";
805
- for (a = 0; a !== e.length; ++a) e[a] != null && (s += e[a].v);
806
- return s;
803
+ for (a = 0; a < e.length; ++a) e[a] != null && "n?".indexOf(e[a].t) > -1 && (i = m > 1 && r < 0 && a > 0 && e[a - 1].v === "-" ? -r : r, e[a].v = ae(e[a].t, e[a].v, i), e[a].t = "t");
804
+ var u = "";
805
+ for (a = 0; a !== e.length; ++a) e[a] != null && (u += e[a].v);
806
+ return u;
807
807
  }
808
- p._eval = $e;
808
+ w._eval = $e;
809
809
  var Me = /\[[=<>]/, X = /\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;
810
- function ae(t, r) {
810
+ function ee(t, r) {
811
811
  if (r == null) return !1;
812
812
  var n = parseFloat(r[2]);
813
813
  switch (r[1]) {
@@ -832,7 +832,7 @@ var ze = { exports: {} };
832
832
  }
833
833
  return !1;
834
834
  }
835
- function ee(t, r) {
835
+ function te(t, r) {
836
836
  var n = ke(t), m = n.length, e = n[m - 1].indexOf("@");
837
837
  if (m < 4 && e > -1 && --m, n.length > 4) throw new Error("cannot find right format for |" + n.join("|") + "|");
838
838
  if (typeof r != "number") return [4, n.length === 4 || e > -1 ? n[n.length - 1] : "@"];
@@ -851,7 +851,7 @@ var ze = { exports: {} };
851
851
  if (n[0].indexOf("[") === -1 && n[1].indexOf("[") === -1) return [m, d];
852
852
  if (n[0].match(Me) != null || n[1].match(Me) != null) {
853
853
  var a = n[0].match(X), f = n[1].match(X);
854
- return ae(r, a) ? [m, n[0]] : ae(r, f) ? [m, n[1]] : [m, n[a != null && f != null ? 2 : 1]];
854
+ return ee(r, a) ? [m, n[0]] : ee(r, f) ? [m, n[1]] : [m, n[a != null && f != null ? 2 : 1]];
855
855
  }
856
856
  return [m, d];
857
857
  }
@@ -868,7 +868,7 @@ var ze = { exports: {} };
868
868
  }
869
869
  if (fe(m, 0)) return ge(r, n);
870
870
  r instanceof Date && (r = Ne(r, n.date1904));
871
- var e = ee(m, r);
871
+ var e = te(m, r);
872
872
  if (fe(e[1])) return ge(r, n);
873
873
  if (r === !0) r = "TRUE";
874
874
  else if (r === !1) r = "FALSE";
@@ -892,17 +892,17 @@ var ze = { exports: {} };
892
892
  }
893
893
  return ce[r] = t, r;
894
894
  }
895
- p.load = le, p._table = ce, p.get_table = function() {
895
+ w.load = le, w._table = ce, w.get_table = function() {
896
896
  return ce;
897
- }, p.load_table = function(r) {
897
+ }, w.load_table = function(r) {
898
898
  for (var n = 0; n != 392; ++n)
899
899
  r[n] !== void 0 && le(r[n], n);
900
- }, p.init_table = Ee, p.format = de;
900
+ }, w.init_table = Ee, w.format = de;
901
901
  };
902
- g(u), typeof DO_NOT_EXPORT_SSF > "u" && (y.exports = u);
903
- })(ze);
904
- var rt = ze.exports;
905
- const Pe = /* @__PURE__ */ Ze(rt), Be = [
902
+ g(s), typeof DO_NOT_EXPORT_SSF > "u" && (y.exports = s);
903
+ })(qe);
904
+ var rt = qe.exports;
905
+ const Pe = /* @__PURE__ */ Je(rt), Be = [
906
906
  "228, 232, 237",
907
907
  // Light Gray
908
908
  "219, 233, 236",
@@ -927,100 +927,107 @@ const Pe = /* @__PURE__ */ Ze(rt), Be = [
927
927
  // Cyan
928
928
  "244, 239, 234"
929
929
  // Cream
930
- ], Ue = Be[0], nt = [
930
+ ], Ye = Be[0], nt = [
931
931
  ["true", "false"],
932
932
  ["yes", "no"],
933
933
  ["1", "0"]
934
934
  ];
935
- function at(y, u) {
936
- const g = y.toLowerCase(), w = u.toLowerCase();
937
- return nt.some(([p, v]) => g === p && w === v);
935
+ function at(y, s) {
936
+ const g = y.toLowerCase(), p = s.toLowerCase();
937
+ return nt.some(([w, v]) => g === w && p === v);
938
938
  }
939
939
  const it = 200;
940
940
  function ct() {
941
941
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `sheet-${Date.now()}-${Math.random().toString(36).slice(2)}`;
942
942
  }
943
- function ot(y) {
944
- if (!Array.isArray(y) || y.length === 0) return null;
945
- const u = y.map((w) => String((w == null ? void 0 : w.v) ?? "")).join("");
946
- return u.trim() ? u : null;
943
+ function ot(y, s) {
944
+ if (!s.has(y)) return y;
945
+ let g = 1, p = `${y} (${g})`;
946
+ for (; s.has(p); )
947
+ g += 1, p = `${y} (${g})`;
948
+ return p;
947
949
  }
948
950
  function lt(y) {
949
- return y ? "TRUE" : "FALSE";
951
+ if (!Array.isArray(y) || y.length === 0) return null;
952
+ const s = y.map((p) => String((p == null ? void 0 : p.v) ?? "")).join("");
953
+ return s.trim() ? s : null;
950
954
  }
951
955
  function st(y) {
952
- let u = !1, g = 0;
953
- const w = () => {
954
- if (u) return !0;
956
+ return y ? "TRUE" : "FALSE";
957
+ }
958
+ function ut(y) {
959
+ let s = !1, g = 0;
960
+ const p = () => {
961
+ if (s) return !0;
955
962
  const v = y.current;
956
963
  if (!(v != null && v.getWorkbookContext) || !v.recalculateAllFormulas) return !1;
957
964
  const $ = v.getWorkbookContext(), N = $ == null ? void 0 : $.luckysheetfile;
958
965
  return !(N != null && N.length) || !N.some(
959
- (I) => Array.isArray(I.data) && I.data.length > 0
960
- ) ? !1 : (v.recalculateAllFormulas(), u = !0, !0);
961
- }, p = () => {
966
+ (U) => Array.isArray(U.data) && U.data.length > 0
967
+ ) ? !1 : (v.recalculateAllFormulas(), s = !0, !0);
968
+ }, w = () => {
962
969
  var v, $;
963
- w() || (g += 1, g < it ? requestAnimationFrame(p) : (($ = (v = y.current) == null ? void 0 : v.recalculateAllFormulas) == null || $.call(v), u = !0));
970
+ p() || (g += 1, g < it ? requestAnimationFrame(w) : (($ = (v = y.current) == null ? void 0 : v.recalculateAllFormulas) == null || $.call(v), s = !0));
964
971
  };
965
- requestAnimationFrame(() => requestAnimationFrame(p));
972
+ requestAnimationFrame(() => requestAnimationFrame(w));
966
973
  for (const v of [120, 400, 1200])
967
974
  window.setTimeout(() => {
968
- u || w();
975
+ s || p();
969
976
  }, v);
970
977
  }
971
- function ut(y) {
972
- return y <= 0 ? Ue : y > Be.length ? Array(y).fill(Ue).join(", ") : Be.slice(0, y).join(", ");
978
+ function ht(y) {
979
+ return y <= 0 ? Ye : y > Be.length ? Array(y).fill(Ye).join(", ") : Be.slice(0, y).join(", ");
973
980
  }
974
981
  function je(y) {
975
- const u = y.match(/^([A-Z]+)(\d+)$/i);
976
- if (!u) return null;
977
- const g = u[1].toUpperCase(), w = u[2];
978
- let p = 0;
982
+ const s = y.match(/^([A-Z]+)(\d+)$/i);
983
+ if (!s) return null;
984
+ const g = s[1].toUpperCase(), p = s[2];
985
+ let w = 0;
979
986
  for (let N = 0; N < g.length; N++)
980
- p = p * 26 + (g.charCodeAt(N) - 64);
981
- const v = parseInt(w, 10) - 1, $ = p - 1;
987
+ w = w * 26 + (g.charCodeAt(N) - 64);
988
+ const v = parseInt(p, 10) - 1, $ = w - 1;
982
989
  return { row: v, col: $ };
983
990
  }
984
- function ht(y, u) {
991
+ function ft(y, s) {
985
992
  const g = je(y);
986
993
  if (!g) return null;
987
- const { row: w, col: p } = g, v = `${w}_${p}`, $ = Array.isArray(u.formulae) && u.formulae.length > 0 ? String(u.formulae[0]).replace(/^["']|["']$/g, "").replace(/["']/g, "") : "", N = $.split(",").map((fe) => fe.trim()).filter(Boolean);
988
- let R = u.type === "list" ? "dropdown" : u.type || "dropdown", I = $, J = "";
989
- u.type === "list" && N.length === 2 && at(N[0], N[1]) && (R = "checkbox", I = N[0], J = N[1]);
990
- const F = R === "checkbox" ? 1 : I ? I.split(",").length : 0, ie = ut(F || 1), re = {
994
+ const { row: p, col: w } = g, v = `${p}_${w}`, $ = Array.isArray(s.formulae) && s.formulae.length > 0 ? String(s.formulae[0]).replace(/^["']|["']$/g, "").replace(/["']/g, "") : "", N = $.split(",").map((fe) => fe.trim()).filter(Boolean);
995
+ let R = s.type === "list" ? "dropdown" : s.type || "dropdown", U = $, J = "";
996
+ s.type === "list" && N.length === 2 && at(N[0], N[1]) && (R = "checkbox", U = N[0], J = N[1]);
997
+ const F = R === "checkbox" ? 1 : U ? U.split(",").length : 0, ie = ht(F || 1), ne = {
991
998
  type: R,
992
999
  type2: "",
993
1000
  rangeTxt: y,
994
- value1: I,
1001
+ value1: U,
995
1002
  value2: J,
996
1003
  validity: "",
997
1004
  remote: !1,
998
- prohibitInput: u.type === "list",
999
- hintShow: !!u.showInputMessage,
1000
- hintValue: u.prompt ?? "",
1005
+ prohibitInput: s.type === "list",
1006
+ hintShow: !!s.showInputMessage,
1007
+ hintValue: s.prompt ?? "",
1001
1008
  color: ie,
1002
1009
  checked: !1
1003
1010
  };
1004
- return { rowColKey: v, entry: re };
1011
+ return { rowColKey: v, entry: ne };
1005
1012
  }
1006
- function ft(y) {
1007
- const u = y.split(":"), g = je(u[0].trim());
1013
+ function gt(y) {
1014
+ const s = y.split(":"), g = je(s[0].trim());
1008
1015
  if (!g) return null;
1009
- const w = u.length > 1 ? je(u[1].trim()) : g;
1010
- return w ? {
1011
- row: [Math.min(g.row, w.row), Math.max(g.row, w.row)],
1012
- column: [Math.min(g.col, w.col), Math.max(g.col, w.col)]
1016
+ const p = s.length > 1 ? je(s[1].trim()) : g;
1017
+ return p ? {
1018
+ row: [Math.min(g.row, p.row), Math.max(g.row, p.row)],
1019
+ column: [Math.min(g.col, p.col), Math.max(g.col, p.col)]
1013
1020
  } : null;
1014
1021
  }
1015
- function gt(y) {
1016
- return String(y || "").split(/[,\s]+/).map((u) => u.trim()).filter(Boolean).map((u) => ft(u)).filter(
1017
- (u) => !!u
1022
+ function dt(y) {
1023
+ return String(y || "").split(/[,\s]+/).map((s) => s.trim()).filter(Boolean).map((s) => gt(s)).filter(
1024
+ (s) => !!s
1018
1025
  );
1019
1026
  }
1020
- function Ye(y) {
1021
- const u = gt(y);
1022
- return u.length ? u.map((g) => {
1023
- const [w, p] = g.row, [v, $] = g.column;
1027
+ function Ge(y) {
1028
+ const s = dt(y);
1029
+ return s.length ? s.map((g) => {
1030
+ const [p, w] = g.row, [v, $] = g.column;
1024
1031
  return {
1025
1032
  left: 0,
1026
1033
  width: 104,
@@ -1030,17 +1037,17 @@ function Ye(y) {
1030
1037
  width_move: 104,
1031
1038
  top_move: 0,
1032
1039
  height_move: 11999,
1033
- row: [w, p],
1040
+ row: [p, w],
1034
1041
  column: [v, $],
1035
- row_focus: w,
1042
+ row_focus: p,
1036
1043
  column_focus: v,
1037
1044
  column_select: !0
1038
1045
  };
1039
1046
  }) : null;
1040
1047
  }
1041
- function Ge(y) {
1048
+ function ze(y) {
1042
1049
  var $, N;
1043
- const u = {
1050
+ const s = {
1044
1051
  textColor: "#000000",
1045
1052
  cellColor: "#ffffff",
1046
1053
  bold: !1,
@@ -1048,19 +1055,19 @@ function Ge(y) {
1048
1055
  underline: !1,
1049
1056
  strikethrough: !1
1050
1057
  };
1051
- if (!y) return u;
1052
- const g = y.font, w = y.fill;
1053
- let p = u.textColor, v = u.cellColor;
1058
+ if (!y) return s;
1059
+ const g = y.font, p = y.fill;
1060
+ let w = s.textColor, v = s.cellColor;
1054
1061
  if (($ = g == null ? void 0 : g.color) != null && $.argb) {
1055
1062
  const R = g.color.argb;
1056
- p = "#" + (R.length >= 6 ? R.slice(-6) : R);
1063
+ w = "#" + (R.length >= 6 ? R.slice(-6) : R);
1057
1064
  }
1058
- if ((w == null ? void 0 : w.type) === "pattern" && w.pattern === "solid" && ((N = w.fgColor) != null && N.argb)) {
1059
- const R = w.fgColor.argb;
1065
+ if ((p == null ? void 0 : p.type) === "pattern" && p.pattern === "solid" && ((N = p.fgColor) != null && N.argb)) {
1066
+ const R = p.fgColor.argb;
1060
1067
  v = "#" + (R.length >= 6 ? R.slice(-6) : R);
1061
1068
  }
1062
1069
  return {
1063
- textColor: p,
1070
+ textColor: w,
1064
1071
  cellColor: v,
1065
1072
  bold: !!(g != null && g.bold),
1066
1073
  italic: !!(g != null && g.italic),
@@ -1068,44 +1075,44 @@ function Ge(y) {
1068
1075
  strikethrough: !1
1069
1076
  };
1070
1077
  }
1071
- function qe(y) {
1078
+ function Xe(y) {
1072
1079
  if (!y || typeof y != "string") return "";
1073
- const u = y.trim().replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&amp;/g, "&").replace(/^=/, ""), g = u.match(/(?:^|[^A-Z])SEARCH\s*\([\s(]*"((?:[^"]|"")*)"/i);
1080
+ const s = y.trim().replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&amp;/g, "&").replace(/^=/, ""), g = s.match(/(?:^|[^A-Z])SEARCH\s*\([\s(]*"((?:[^"]|"")*)"/i);
1074
1081
  if (g) return (g[1] ?? "").replace(/""/g, '"');
1075
- const w = u.match(/(?:^|[^A-Z])SEARCH\s*\([\s(]*'([^']*)'/i);
1076
- return w ? w[1] ?? "" : "";
1082
+ const p = s.match(/(?:^|[^A-Z])SEARCH\s*\([\s(]*'([^']*)'/i);
1083
+ return p ? p[1] ?? "" : "";
1077
1084
  }
1078
1085
  function De(y) {
1079
1086
  if (!y || typeof y != "string") return "";
1080
- const u = y.trim().replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/^=/, ""), g = u.match(/"((?:[^"]|"")*)"/);
1087
+ const s = y.trim().replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/^=/, ""), g = s.match(/"((?:[^"]|"")*)"/);
1081
1088
  if (g) return (g[1] ?? "").replace(/""/g, '"');
1082
- const w = u.match(/'([^']*)'/);
1083
- return w ? w[1] ?? "" : "";
1089
+ const p = s.match(/'([^']*)'/);
1090
+ return p ? p[1] ?? "" : "";
1084
1091
  }
1085
- function dt(y) {
1092
+ function bt(y) {
1086
1093
  if (!y || typeof y != "string") return null;
1087
- const u = y.trim().toUpperCase(), g = qe(y) || De(y);
1088
- return g ? u.includes("SEARCH(") ? u.includes("ISERROR(SEARCH(") || u.includes("NOTNUMBER(SEARCH(") ? { conditionName: "textDoesNotContain", conditionValue: [g] } : { conditionName: "textContains", conditionValue: [g] } : u.includes("LEFT(") ? { conditionName: "textStartsWith", conditionValue: [g] } : u.includes("RIGHT(") ? { conditionName: "textEndsWith", conditionValue: [g] } : u.includes("EXACT(") || u.includes('="') ? { conditionName: "textExactly", conditionValue: [g] } : null : null;
1094
+ const s = y.trim().toUpperCase(), g = Xe(y) || De(y);
1095
+ return g ? s.includes("SEARCH(") ? s.includes("ISERROR(SEARCH(") || s.includes("NOTNUMBER(SEARCH(") ? { conditionName: "textDoesNotContain", conditionValue: [g] } : { conditionName: "textContains", conditionValue: [g] } : s.includes("LEFT(") ? { conditionName: "textStartsWith", conditionValue: [g] } : s.includes("RIGHT(") ? { conditionName: "textEndsWith", conditionValue: [g] } : s.includes("EXACT(") || s.includes('="') ? { conditionName: "textExactly", conditionValue: [g] } : null : null;
1089
1096
  }
1090
- function bt(y, u, g) {
1091
- const w = (y || "").toLowerCase();
1092
- if (w === "cellis") {
1093
- const p = (u || "").toLowerCase();
1094
- return p === "greaterthan" ? { conditionName: "greaterThan", conditionValue: [] } : p === "greaterthanorequal" ? { conditionName: "greaterThanOrEqual", conditionValue: [] } : p === "lessthan" ? { conditionName: "lessThan", conditionValue: [] } : p === "lessthanorequal" ? { conditionName: "lessThanOrEqual", conditionValue: [] } : p === "equal" ? { conditionName: "equal", conditionValue: [] } : p === "notequal" ? { conditionName: "notEqual", conditionValue: [] } : p === "between" ? { conditionName: "between", conditionValue: [] } : p === "notbetween" ? { conditionName: "notBetween", conditionValue: [] } : null;
1097
+ function mt(y, s, g) {
1098
+ const p = (y || "").toLowerCase();
1099
+ if (p === "cellis") {
1100
+ const w = (s || "").toLowerCase();
1101
+ return w === "greaterthan" ? { conditionName: "greaterThan", conditionValue: [] } : w === "greaterthanorequal" ? { conditionName: "greaterThanOrEqual", conditionValue: [] } : w === "lessthan" ? { conditionName: "lessThan", conditionValue: [] } : w === "lessthanorequal" ? { conditionName: "lessThanOrEqual", conditionValue: [] } : w === "equal" ? { conditionName: "equal", conditionValue: [] } : w === "notequal" ? { conditionName: "notEqual", conditionValue: [] } : w === "between" ? { conditionName: "between", conditionValue: [] } : w === "notbetween" ? { conditionName: "notBetween", conditionValue: [] } : null;
1095
1102
  }
1096
- if (w === "containstext" || w === "notcontainstext" || w === "beginswith" || w === "endswith" || w === "containsblanks" || w === "notcontainsblanks") {
1097
- const p = (u ?? "").toLowerCase();
1098
- if (w === "containsblanks" || p === "containsblanks")
1103
+ if (p === "containstext" || p === "notcontainstext" || p === "beginswith" || p === "endswith" || p === "containsblanks" || p === "notcontainsblanks") {
1104
+ const w = (s ?? "").toLowerCase();
1105
+ if (p === "containsblanks" || w === "containsblanks")
1099
1106
  return { conditionName: "empty", conditionValue: [""] };
1100
- if (w === "notcontainsblanks" || p === "notcontainsblanks")
1107
+ if (p === "notcontainsblanks" || w === "notcontainsblanks")
1101
1108
  return { conditionName: "notEmpty", conditionValue: [""] };
1102
- if (w === "notcontainstext" || p === "notcontainstext" || p === "notcontains")
1109
+ if (p === "notcontainstext" || w === "notcontainstext" || w === "notcontains")
1103
1110
  return { conditionName: "textDoesNotContain", conditionValue: [] };
1104
- if (w === "beginswith" || p === "beginswith")
1111
+ if (p === "beginswith" || w === "beginswith")
1105
1112
  return { conditionName: "textStartsWith", conditionValue: [] };
1106
- if (w === "endswith" || p === "endswith")
1113
+ if (p === "endswith" || w === "endswith")
1107
1114
  return { conditionName: "textEndsWith", conditionValue: [] };
1108
- if (p === "equal")
1115
+ if (w === "equal")
1109
1116
  return { conditionName: "textExactly", conditionValue: [] };
1110
1117
  const v = (g == null ? void 0 : g.text) ?? "";
1111
1118
  return {
@@ -1113,48 +1120,48 @@ function bt(y, u, g) {
1113
1120
  conditionValue: v ? [v] : []
1114
1121
  };
1115
1122
  }
1116
- if (w === "duplicatevalues")
1123
+ if (p === "duplicatevalues")
1117
1124
  return { conditionName: "duplicateValue", conditionValue: ["0"] };
1118
- if (w === "uniquevalues")
1125
+ if (p === "uniquevalues")
1119
1126
  return { conditionName: "duplicateValue", conditionValue: ["1"] };
1120
- if (w === "top10") {
1121
- const p = (g == null ? void 0 : g.rank) ?? 10;
1127
+ if (p === "top10") {
1128
+ const w = (g == null ? void 0 : g.rank) ?? 10;
1122
1129
  return g != null && g.percent && (g != null && g.bottom) ? {
1123
1130
  conditionName: "last10_percent",
1124
- conditionValue: [String(p)]
1125
- } : g != null && g.percent ? { conditionName: "top10_percent", conditionValue: [String(p)] } : g != null && g.bottom ? { conditionName: "last10", conditionValue: [String(p)] } : { conditionName: "top10", conditionValue: [String(p)] };
1131
+ conditionValue: [String(w)]
1132
+ } : g != null && g.percent ? { conditionName: "top10_percent", conditionValue: [String(w)] } : g != null && g.bottom ? { conditionName: "last10", conditionValue: [String(w)] } : { conditionName: "top10", conditionValue: [String(w)] };
1126
1133
  }
1127
- if (w === "aboveaverage")
1134
+ if (p === "aboveaverage")
1128
1135
  return (g == null ? void 0 : g.aboveAverage) === !1 ? { conditionName: "belowAverage", conditionValue: [] } : { conditionName: "aboveAverage", conditionValue: [] };
1129
- if (w === "timeperiod") {
1130
- const p = ((g == null ? void 0 : g.timePeriod) ?? "").toLowerCase();
1131
- return p === "today" || p === "tomorrow" || p === "yesterday" ? {
1136
+ if (p === "timeperiod") {
1137
+ const w = ((g == null ? void 0 : g.timePeriod) ?? "").toLowerCase();
1138
+ return w === "today" || w === "tomorrow" || w === "yesterday" ? {
1132
1139
  conditionName: "dateIs",
1133
- conditionValue: [`preset:${p}`, "", "DD/MM/YYYY"]
1134
- } : p === "last7days" ? {
1140
+ conditionValue: [`preset:${w}`, "", "DD/MM/YYYY"]
1141
+ } : w === "last7days" ? {
1135
1142
  conditionName: "dateIs",
1136
1143
  conditionValue: ["preset:pastWeek", "", "DD/MM/YYYY"]
1137
- } : p === "lastmonth" ? {
1144
+ } : w === "lastmonth" ? {
1138
1145
  conditionName: "dateIs",
1139
1146
  conditionValue: ["preset:pastMonth", "", "DD/MM/YYYY"]
1140
- } : p === "lastyear" ? {
1147
+ } : w === "lastyear" ? {
1141
1148
  conditionName: "dateIs",
1142
1149
  conditionValue: ["preset:pastYear", "", "DD/MM/YYYY"]
1143
1150
  } : null;
1144
1151
  }
1145
1152
  return null;
1146
1153
  }
1147
- function mt(y, u) {
1148
- if (!u.type) return null;
1149
- let g = (u.text ?? "").trim();
1150
- const w = Array.isArray(u.formulae) && u.formulae[0] ? String(u.formulae[0]) : void 0, p = (u.type.toLowerCase() === "expression" || u.type.toLowerCase() === "customformula") && dt(w);
1151
- if (p) {
1152
- const I = Ye(y);
1153
- if (!I) return null;
1154
- const J = Ge(u.style);
1154
+ function pt(y, s) {
1155
+ if (!s.type) return null;
1156
+ let g = (s.text ?? "").trim();
1157
+ const p = Array.isArray(s.formulae) && s.formulae[0] ? String(s.formulae[0]) : void 0, w = (s.type.toLowerCase() === "expression" || s.type.toLowerCase() === "customformula") && bt(p);
1158
+ if (w) {
1159
+ const U = Ge(y);
1160
+ if (!U) return null;
1161
+ const J = ze(s.style);
1155
1162
  return {
1156
1163
  type: "default",
1157
- cellrange: I,
1164
+ cellrange: U,
1158
1165
  format: {
1159
1166
  textColor: J.textColor,
1160
1167
  cellColor: J.cellColor,
@@ -1163,28 +1170,28 @@ function mt(y, u) {
1163
1170
  underline: J.underline,
1164
1171
  strikethrough: J.strikethrough
1165
1172
  },
1166
- conditionName: p.conditionName,
1173
+ conditionName: w.conditionName,
1167
1174
  conditionRange: [],
1168
- conditionValue: p.conditionValue
1175
+ conditionValue: w.conditionValue
1169
1176
  };
1170
1177
  }
1171
- (u.type === "containsText" || u.type === "notContainsText" || u.type === "beginsWith" || u.type === "endsWith") && !g && (g = qe(w), g || (g = De(w)));
1172
- const v = bt(u.type, u.operator, {
1173
- percent: u.percent,
1174
- bottom: u.bottom,
1175
- rank: u.rank,
1176
- aboveAverage: u.aboveAverage,
1177
- text: g || u.text,
1178
- timePeriod: u.timePeriod
1178
+ (s.type === "containsText" || s.type === "notContainsText" || s.type === "beginsWith" || s.type === "endsWith") && !g && (g = Xe(p), g || (g = De(p)));
1179
+ const v = mt(s.type, s.operator, {
1180
+ percent: s.percent,
1181
+ bottom: s.bottom,
1182
+ rank: s.rank,
1183
+ aboveAverage: s.aboveAverage,
1184
+ text: g || s.text,
1185
+ timePeriod: s.timePeriod
1179
1186
  });
1180
1187
  if (!v) return null;
1181
1188
  let $;
1182
- u.type === "cellIs" && Array.isArray(u.formulae) && u.formulae.length > 0 ? $ = u.formulae.map((I) => String(I ?? "")) : v.conditionName === "empty" || v.conditionName === "notEmpty" ? $ = [""] : u.type === "containsText" || u.type === "notContainsText" || u.type === "beginsWith" || u.type === "endsWith" ? $ = g ? [g] : De(w) ? [De(w)] : [] : $ = v.conditionValue.map(
1183
- (I) => I == null ? "" : String(I)
1189
+ s.type === "cellIs" && Array.isArray(s.formulae) && s.formulae.length > 0 ? $ = s.formulae.map((U) => String(U ?? "")) : v.conditionName === "empty" || v.conditionName === "notEmpty" ? $ = [""] : s.type === "containsText" || s.type === "notContainsText" || s.type === "beginsWith" || s.type === "endsWith" ? $ = g ? [g] : De(p) ? [De(p)] : [] : $ = v.conditionValue.map(
1190
+ (U) => U == null ? "" : String(U)
1184
1191
  );
1185
- const N = Ye(y);
1192
+ const N = Ge(y);
1186
1193
  if (!N) return null;
1187
- const R = Ge(u.style);
1194
+ const R = ze(s.style);
1188
1195
  return {
1189
1196
  type: "default",
1190
1197
  cellrange: N,
@@ -1201,26 +1208,26 @@ function mt(y, u) {
1201
1208
  conditionValue: $
1202
1209
  };
1203
1210
  }
1204
- async function _t({
1211
+ async function At({
1205
1212
  sheetEditorRef: y,
1206
- ydocRef: u,
1213
+ ydocRef: s,
1207
1214
  setForceSheetRender: g,
1208
- dsheetId: w,
1209
- currentDataRef: p,
1215
+ dsheetId: p,
1216
+ currentDataRef: w,
1210
1217
  updateDocumentTitle: v,
1211
1218
  filterToastShown: $,
1212
1219
  setFilterToastShown: N
1213
- }, R, I, J, F) {
1220
+ }, R, U, J, F) {
1214
1221
  var Ee, ce;
1215
1222
  const ie = R == null ? void 0 : R.target;
1216
- if (!((Ee = ie == null ? void 0 : ie.files) != null && Ee.length) && !I)
1223
+ if (!((Ee = ie == null ? void 0 : ie.files) != null && Ee.length) && !U)
1217
1224
  return Promise.resolve();
1218
- const re = ((ce = ie == null ? void 0 : ie.files) == null ? void 0 : ce[0]) || I, fe = {}, Ce = {};
1225
+ const ne = ((ce = ie == null ? void 0 : ie.files) == null ? void 0 : ce[0]) || U, fe = {}, Ce = {};
1219
1226
  let Ae = !1;
1220
1227
  return new Promise((Q, M) => {
1221
1228
  const G = new FileReader();
1222
1229
  G.onerror = () => M(new Error("Failed to read file")), G.onload = async (we) => {
1223
- var Fe, Ve, oe, ne;
1230
+ var Fe, Ve, oe, ae;
1224
1231
  if (!we.target) {
1225
1232
  console.error("FileReader event target is null"), M(new Error("FileReader event target is null"));
1226
1233
  return;
@@ -1233,16 +1240,16 @@ async function _t({
1233
1240
  ]), Ne = Re.default.transformExcelToLucky, { extractImagesFromWorksheet: He, convertRawImagesToFortuneSheet: Te } = Le, ge = new Se();
1234
1241
  try {
1235
1242
  await ge.xlsx.load(ye);
1236
- const ke = (ne = (oe = (Ve = (Fe = ge.model) == null ? void 0 : Fe.styles) == null ? void 0 : Ve.fonts) == null ? void 0 : oe[0]) == null ? void 0 : ne.size, _e = {}, xe = {}, $e = {}, Me = {};
1237
- ge.eachSheet((X, ae) => {
1243
+ const ke = (ae = (oe = (Ve = (Fe = ge.model) == null ? void 0 : Fe.styles) == null ? void 0 : Ve.fonts) == null ? void 0 : oe[0]) == null ? void 0 : ae.size, _e = {}, xe = {}, $e = {}, Me = {};
1244
+ ge.eachSheet((X, ee) => {
1238
1245
  var a, f, C;
1239
- const ee = ae - 1, de = {}, le = X.views;
1246
+ const te = ee - 1, de = {}, le = X.views;
1240
1247
  if (le && le.length > 0) {
1241
1248
  const l = le[0];
1242
1249
  if (l.state === "frozen") {
1243
1250
  const _ = l.xSplit || 0, A = l.ySplit || 0;
1244
1251
  let D = null;
1245
- _ > 0 && A > 0 ? D = "rangeBoth" : A > 0 ? D = "rangeRow" : _ > 0 && (D = "rangeColumn"), D && (xe[ee] = {
1252
+ _ > 0 && A > 0 ? D = "rangeBoth" : A > 0 ? D = "rangeRow" : _ > 0 && (D = "rangeColumn"), D && (xe[te] = {
1246
1253
  type: D,
1247
1254
  range: {
1248
1255
  row_focus: A - 1,
@@ -1255,8 +1262,8 @@ async function _t({
1255
1262
  X.eachRow({ includeEmpty: !1 }, (l, _) => {
1256
1263
  l.eachCell({ includeEmpty: !1 }, (A, D) => {
1257
1264
  var se, ue, Z;
1258
- const U = `${_ - 1}_${D - 1}`;
1259
- A.hyperlink && (de[U] = [
1265
+ const I = `${_ - 1}_${D - 1}`;
1266
+ A.hyperlink && (de[I] = [
1260
1267
  {
1261
1268
  linkType: "webpage",
1262
1269
  linkAddress: A.hyperlink
@@ -1275,11 +1282,11 @@ async function _t({
1275
1282
  const x = L.fgColor.argb, h = "#" + x.substring(x.length - 6);
1276
1283
  O.bg = h;
1277
1284
  }
1278
- Object.keys(O).length > 0 && (t[U] = O);
1285
+ Object.keys(O).length > 0 && (t[I] = O);
1279
1286
  });
1280
- }), Object.keys(de).length > 0 && (_e[ee] = de), Object.keys(t).length > 0 && ($e[ee] = t);
1287
+ }), Object.keys(de).length > 0 && (_e[te] = de), Object.keys(t).length > 0 && ($e[te] = t);
1281
1288
  const r = He(X, ge);
1282
- r.length > 0 && (Me[ee] = r);
1289
+ r.length > 0 && (Me[te] = r);
1283
1290
  const n = X.tables;
1284
1291
  n && Object.keys(n).length > 0 && ((a = F == null ? void 0 : F.onWarning) == null || a.call(
1285
1292
  F,
@@ -1295,18 +1302,18 @@ async function _t({
1295
1302
  if (m && typeof m == "object") {
1296
1303
  const l = {};
1297
1304
  for (const [_, A] of Object.entries(m)) {
1298
- const U = ht(_, A);
1299
- U && (l[U.rowColKey] = U.entry);
1305
+ const I = ft(_, A);
1306
+ I && (l[I.rowColKey] = I.entry);
1300
1307
  }
1301
- Object.keys(l).length > 0 && (fe[ee] = l);
1308
+ Object.keys(l).length > 0 && (fe[te] = l);
1302
1309
  }
1303
1310
  const e = X.conditionalFormattings;
1304
1311
  if (Array.isArray(e) && e.length > 0) {
1305
1312
  const l = [];
1306
1313
  for (const _ of e) {
1307
1314
  const A = _.ref, D = _.rules || [];
1308
- for (const U of D) {
1309
- const T = U;
1315
+ for (const I of D) {
1316
+ const T = I;
1310
1317
  console.log("[XLSX CF RAW]", {
1311
1318
  ref: A,
1312
1319
  type: T.type,
@@ -1319,7 +1326,7 @@ async function _t({
1319
1326
  rank: T.rank,
1320
1327
  aboveAverage: T.aboveAverage
1321
1328
  });
1322
- const L = T.type ? mt(A, T) : null;
1329
+ const L = T.type ? pt(A, T) : null;
1323
1330
  L ? console.log("[XLSX CF MAPPED] accepted", L) : console.log("[XLSX CF MAPPED] skipped", {
1324
1331
  ref: A,
1325
1332
  type: T.type,
@@ -1329,7 +1336,7 @@ async function _t({
1329
1336
  }), L && l.push(L);
1330
1337
  }
1331
1338
  }
1332
- l.length > 0 && (Ce[ee] = l);
1339
+ l.length > 0 && (Ce[te] = l);
1333
1340
  }
1334
1341
  X.autoFilter && (Ae || (Ae = !0, (C = F == null ? void 0 : F.onWarning) == null || C.call(
1335
1342
  F,
@@ -1341,22 +1348,22 @@ async function _t({
1341
1348
  duration: 30 * 1e3
1342
1349
  })));
1343
1350
  }), Ne(
1344
- re,
1351
+ ne,
1345
1352
  function(X) {
1346
1353
  var m;
1347
- let ae = X.sheets;
1348
- if (ae.forEach((e, d) => {
1354
+ let ee = X.sheets;
1355
+ if (ee.forEach((e, d) => {
1349
1356
  const a = fe[d];
1350
1357
  a && Object.keys(a).length > 0 && (e.dataVerification = a);
1351
1358
  const f = Ce[d];
1352
1359
  e.luckysheet_conditionformat_save = Array.isArray(f) && f.length > 0 ? f : [];
1353
- }), !u.current) {
1360
+ }), !s.current) {
1354
1361
  console.error("ydocRef.current is null");
1355
1362
  return;
1356
1363
  }
1357
- const ee = u.current.getArray(w), de = Array.from(ee), le = /* @__PURE__ */ new Map();
1358
- ae = ae.map((e, d) => {
1359
- var T, L, O, se, ue, Z, x, h, i, c, k, o, s, E, H, j, W, S, be, ve, me, z, pe, We;
1364
+ const te = s.current.getArray(p), de = Array.from(te), le = /* @__PURE__ */ new Map();
1365
+ ee = ee.map((e, d) => {
1366
+ var T, L, O, se, ue, Z, x, h, i, c, k, o, u, E, H, j, W, S, be, ve, me, z, pe, We;
1360
1367
  const a = (T = e == null ? void 0 : e.celldata) == null ? void 0 : T[e.celldata.length - 1], f = (a == null ? void 0 : a.r) ?? 0, C = (a == null ? void 0 : a.c) ?? 0;
1361
1368
  if (e.row = Math.max(f, 500), e.column = Math.max(C, 36), e.id || (e.id = ((L = F == null ? void 0 : F.generateSheetId) == null ? void 0 : L.call(F)) ?? ((O = y.current) == null ? void 0 : O.getSettings().generateSheetId()) ?? ct()), xe[d] && (e.frozen = xe[d]), _e[d] && (e.hyperlink = {
1362
1369
  ...e.hyperlink || {},
@@ -1406,11 +1413,11 @@ async function _t({
1406
1413
  D._seen == null && (D._seen = /* @__PURE__ */ new Set());
1407
1414
  const Y = D._seen;
1408
1415
  Y.has(V) || (Y.add(V), A.push({ r: b, c: P, id: e.id }));
1409
- }, U = (s = e.config) != null && s.merge ? /* @__PURE__ */ new Map() : null;
1416
+ }, I = (u = e.config) != null && u.merge ? /* @__PURE__ */ new Map() : null;
1410
1417
  if (e.celldata)
1411
1418
  for (const b of e.celldata) {
1412
1419
  const P = `${b.r}_${b.c}`;
1413
- if (U == null || U.set(
1420
+ if (I == null || I.set(
1414
1421
  P,
1415
1422
  b
1416
1423
  ), b.v) {
@@ -1421,8 +1428,8 @@ async function _t({
1421
1428
  if (b.v.f && ((E = b.v.ct) == null ? void 0 : E.t) !== "d" && (b.v.ct = { ...b.v.ct ?? {}, t: "str" }, D(b.r, b.c)), _ != null && _[P]) {
1422
1429
  const B = _[P];
1423
1430
  if (!!(l != null && l[P])) {
1424
- const { fc: K, un: Oe, ...Xe } = B;
1425
- Object.assign(b.v, Xe);
1431
+ const { fc: K, un: Oe, ...Ze } = B;
1432
+ Object.assign(b.v, Ze);
1426
1433
  } else
1427
1434
  Object.assign(b.v, B);
1428
1435
  }
@@ -1433,7 +1440,7 @@ async function _t({
1433
1440
  B
1434
1441
  );
1435
1442
  }
1436
- const V = (H = b.v.ct) == null ? void 0 : H.fa, Y = typeof V == "string" ? V.trim().toLowerCase() : "", te = Y === "general" || ((j = b.v.ct) == null ? void 0 : j.t) === "g", he = Y === "@" || ((W = b.v.ct) == null ? void 0 : W.t) === "s";
1443
+ const V = (H = b.v.ct) == null ? void 0 : H.fa, Y = typeof V == "string" ? V.trim().toLowerCase() : "", re = Y === "general" || ((j = b.v.ct) == null ? void 0 : j.t) === "g", he = Y === "@" || ((W = b.v.ct) == null ? void 0 : W.t) === "s";
1437
1444
  if (V && !le.has(V) && le.set(V, Pe.is_date(V)), !b.v.f && V && le.get(V)) {
1438
1445
  const B = typeof b.v.v == "string" ? parseFloat(b.v.v) : b.v.v;
1439
1446
  if (typeof B == "number" && !isNaN(B))
@@ -1441,7 +1448,7 @@ async function _t({
1441
1448
  b.v.v = B, b.v.m = Pe.format(V, B), b.v.ct = { ...b.v.ct, t: "d" };
1442
1449
  } catch {
1443
1450
  }
1444
- } else if (!b.v.f && typeof b.v.v == "string" && !he && !te) {
1451
+ } else if (!b.v.f && typeof b.v.v == "string" && !he && !re) {
1445
1452
  const B = b.v.v.trim();
1446
1453
  if (/^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?$/.test(
1447
1454
  B
@@ -1459,12 +1466,12 @@ async function _t({
1459
1466
  }
1460
1467
  } else !b.v.f && typeof b.v.v == "number" && isFinite(b.v.v) && ((S = b.v.ct) == null ? void 0 : S.t) !== "s" && ((be = b.v.ct) == null ? void 0 : be.t) !== "d" && b.v.ht == null && (b.v.ht = 2);
1461
1468
  if (!b.v.f && (b.v.m === void 0 || b.v.m === null) && ((ve = b.v.ct) == null ? void 0 : ve.t) !== "d") {
1462
- const B = ot((me = b.v.ct) == null ? void 0 : me.s), q = b.v.v;
1469
+ const B = lt((me = b.v.ct) == null ? void 0 : me.s), q = b.v.v;
1463
1470
  if (!(q == null || String(q).trim() === ""))
1464
1471
  if (B != null)
1465
1472
  b.v.m = B;
1466
1473
  else if (typeof q == "boolean")
1467
- b.v.m = lt(q);
1474
+ b.v.m = st(q);
1468
1475
  else if (typeof q == "number" && isFinite(q)) {
1469
1476
  const Oe = (z = b.v.ct) == null ? void 0 : z.fa;
1470
1477
  if (typeof Oe == "string" && Oe && le.get(Oe) === !1)
@@ -1485,41 +1492,53 @@ async function _t({
1485
1492
  const V = b[P];
1486
1493
  if (Array.isArray(V))
1487
1494
  for (let Y = 0; Y < V.length; Y++) {
1488
- const te = V[Y];
1489
- if (!te || typeof te != "object" || !te.f) continue;
1490
- const he = String(te.f);
1491
- he.startsWith("=") || (te.f = `=${he}`), ((pe = te.ct) == null ? void 0 : pe.t) !== "d" && (te.ct = { ...te.ct ?? {}, t: "str" }, D(P, Y));
1495
+ const re = V[Y];
1496
+ if (!re || typeof re != "object" || !re.f) continue;
1497
+ const he = String(re.f);
1498
+ he.startsWith("=") || (re.f = `=${he}`), ((pe = re.ct) == null ? void 0 : pe.t) !== "d" && (re.ct = { ...re.ct ?? {}, t: "str" }, D(P, Y));
1492
1499
  }
1493
1500
  }
1494
1501
  }
1495
- if (e.calcChain = A, U && ((We = e.config) != null && We.merge) && e.celldata)
1502
+ if (e.calcChain = A, I && ((We = e.config) != null && We.merge) && e.celldata)
1496
1503
  for (const b of Object.values(e.config.merge)) {
1497
- const { r: P, c: V, rs: Y, cs: te } = b;
1504
+ const { r: P, c: V, rs: Y, cs: re } = b;
1498
1505
  for (let he = 0; he < Y; he++)
1499
- for (let B = 0; B < te; B++) {
1506
+ for (let B = 0; B < re; B++) {
1500
1507
  const q = `${P + he}_${V + B}`;
1501
- let K = U.get(q);
1502
- K || (K = { r: P + he, c: V + B, v: {} }, e.celldata.push(K), U.set(q, K)), K.v || (K.v = {}), K.v.mc = he === 0 && B === 0 ? { r: P, c: V, rs: Y, cs: te } : { r: P, c: V };
1508
+ let K = I.get(q);
1509
+ K || (K = { r: P + he, c: V + B, v: {} }, e.celldata.push(K), I.set(q, K)), K.v || (K.v = {}), K.v.mc = he === 0 && B === 0 ? { r: P, c: V, rs: Y, cs: re } : { r: P, c: V };
1503
1510
  }
1504
1511
  }
1505
1512
  return e;
1506
1513
  }), console.log("[xlsx-import] parsed sheets data", {
1507
- fileName: re.name,
1508
- sheetCount: ae.length,
1509
- sheets: ae
1514
+ fileName: ne.name,
1515
+ sheetCount: ee.length,
1516
+ sheets: ee
1510
1517
  });
1511
1518
  let t;
1512
- if (J === "merge-current-dsheet" ? t = [...de, ...ae] : t = [...ae], t = t.map((e, d) => (e.order = d, e)), u.current.transact(() => {
1513
- J !== "merge-current-dsheet" && ee.delete(0, ee.length), t.forEach((e) => {
1514
- if (e instanceof Je.Map) return;
1519
+ if (J === "merge-current-dsheet") {
1520
+ const e = new Set(
1521
+ de.map(
1522
+ (d) => d instanceof Ue.Map ? d.get("name") : d.name
1523
+ ).filter(Boolean)
1524
+ );
1525
+ ee.forEach((d) => {
1526
+ const a = d.name ?? "", f = ot(a, e);
1527
+ f !== a && (d.name = f), e.add(f);
1528
+ }), t = [...de, ...ee];
1529
+ } else
1530
+ t = [...ee];
1531
+ if (t = t.map((e, d) => (e.order = d, e)), s.current.transact(() => {
1532
+ J !== "merge-current-dsheet" && te.delete(0, te.length), t.forEach((e) => {
1533
+ if (e instanceof Ue.Map) return;
1515
1534
  const d = Qe(e);
1516
- ee.push([d()]);
1535
+ te.push([d()]);
1517
1536
  });
1518
- }), u != null && u.current) {
1519
- const e = u.current.getArray(w), d = Ke(e);
1520
- p.current = d, g((a) => a + 1);
1537
+ }), s != null && s.current) {
1538
+ const e = s.current.getArray(p), d = Ke(e);
1539
+ w.current = d, g((a) => a + 1);
1521
1540
  }
1522
- F != null && F.headless || st(y);
1541
+ F != null && F.headless || ut(y);
1523
1542
  const n = et((m = X == null ? void 0 : X.info) == null ? void 0 : m.name);
1524
1543
  v == null || v(n), Q();
1525
1544
  }
@@ -1529,9 +1548,9 @@ async function _t({
1529
1548
  "Error loading the workbook. Please ensure it is a valid .xlsx file."
1530
1549
  ), M(ke);
1531
1550
  }
1532
- }, G.readAsArrayBuffer(re);
1551
+ }, G.readAsArrayBuffer(ne);
1533
1552
  });
1534
1553
  }
1535
1554
  export {
1536
- _t as runXlsxFileUpload
1555
+ At as runXlsxFileUpload
1537
1556
  };