@redi.run/redi-components 0.0.42 → 0.0.45

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.
@@ -1474,8 +1474,8 @@ var CRC32 = /* @__PURE__ */ (function() {
1474
1474
  return c ||= {};
1475
1475
  }
1476
1476
  function u(e, t) {
1477
- if (e[0] == 80 && e[1] == 75) return rg(e, t);
1478
- if ((e[0] | 32) == 109 && (e[1] | 32) == 105) return fg(e, t);
1477
+ if (e[0] == 80 && e[1] == 75) return sg(e, t);
1478
+ if ((e[0] | 32) == 109 && (e[1] | 32) == 105) return hg(e, t);
1479
1479
  if (e.length < 512) throw Error("CFB file size " + e.length + " < 512");
1480
1480
  var n = 3, i = 512, a = 0, o = 0, s = 0, c = 0, l = 0, u = [], h = e.slice(0, 512);
1481
1481
  prep_blob(h, 0);
@@ -1487,7 +1487,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1487
1487
  case 4:
1488
1488
  i = 4096;
1489
1489
  break;
1490
- case 0: if (_[1] == 0) return rg(e, t);
1490
+ case 0: if (_[1] == 0) return sg(e, t);
1491
1491
  default: throw Error("Major Version: Expected 3 or 4 saw " + n);
1492
1492
  }
1493
1493
  i !== 512 && (h = e.slice(0, i), prep_blob(h, 28));
@@ -1701,9 +1701,9 @@ var CRC32 = /* @__PURE__ */ (function() {
1701
1701
  }
1702
1702
  function E(e, t) {
1703
1703
  var n = t || {};
1704
- if (n.fileType == "mad") return pg(e, n);
1704
+ if (n.fileType == "mad") return gg(e, n);
1705
1705
  switch (T(e), n.fileType) {
1706
- case "zip": return ag(e, n);
1706
+ case "zip": return lg(e, n);
1707
1707
  }
1708
1708
  var i = (function(e) {
1709
1709
  for (var t = 0, n = 0, i = 0; i < e.FileIndex.length; ++i) {
@@ -1825,7 +1825,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1825
1825
  for (var t = Array(e.length), n = 0; n < e.length; ++n) t[n] = String.fromCharCode(e[n]);
1826
1826
  return t.join("");
1827
1827
  }
1828
- function I(e, t) {
1828
+ function Dh(e, t) {
1829
1829
  var n = E(e, t);
1830
1830
  switch (t && t.type || "buffer") {
1831
1831
  case "file": return l(), c.writeFileSync(t.filename, n), n;
@@ -1836,25 +1836,25 @@ var CRC32 = /* @__PURE__ */ (function() {
1836
1836
  }
1837
1837
  return n;
1838
1838
  }
1839
- var L;
1840
- function R(e) {
1839
+ var I;
1840
+ function Oh(e) {
1841
1841
  try {
1842
1842
  var t = e.InflateRaw, n = new t();
1843
- if (n._processChunk(new Uint8Array([3, 0]), n._finishFlushFlag), n.bytesRead) L = e;
1843
+ if (n._processChunk(new Uint8Array([3, 0]), n._finishFlushFlag), n.bytesRead) I = e;
1844
1844
  else throw Error("zlib does not expose bytesRead");
1845
1845
  } catch (e) {
1846
1846
  console.error("cannot use native zlib: " + (e.message || e));
1847
1847
  }
1848
1848
  }
1849
- function B(e, t) {
1850
- if (!L) return tg(e, t);
1851
- var n = L.InflateRaw, i = new n(), a = i._processChunk(e.slice(e.l), i._finishFlushFlag);
1849
+ function Ph(e, t) {
1850
+ if (!I) return ag(e, t);
1851
+ var n = I.InflateRaw, i = new n(), a = i._processChunk(e.slice(e.l), i._finishFlushFlag);
1852
1852
  return e.l += i.bytesRead, a;
1853
1853
  }
1854
- function Ah(e) {
1855
- return L ? L.deflateRawSync(e) : Yh(e);
1854
+ function Fh(e) {
1855
+ return I ? I.deflateRawSync(e) : Qh(e);
1856
1856
  }
1857
- var jh = [
1857
+ var Ih = [
1858
1858
  16,
1859
1859
  17,
1860
1860
  18,
@@ -1874,7 +1874,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1874
1874
  14,
1875
1875
  1,
1876
1876
  15
1877
- ], Nh = [
1877
+ ], z = [
1878
1878
  3,
1879
1879
  4,
1880
1880
  5,
@@ -1904,7 +1904,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1904
1904
  195,
1905
1905
  227,
1906
1906
  258
1907
- ], V = [
1907
+ ], B = [
1908
1908
  1,
1909
1909
  2,
1910
1910
  3,
@@ -1936,16 +1936,16 @@ var CRC32 = /* @__PURE__ */ (function() {
1936
1936
  16385,
1937
1937
  24577
1938
1938
  ];
1939
- function Ih(e) {
1939
+ function Bh(e) {
1940
1940
  var t = (e << 1 | e << 11) & 139536 | (e << 5 | e << 15) & 558144;
1941
1941
  return (t >> 16 | t >> 8 | t) & 255;
1942
1942
  }
1943
- for (var H = typeof Uint8Array < "u", U = H ? new Uint8Array(256) : [], Lh = 0; Lh < 256; ++Lh) U[Lh] = Ih(Lh);
1944
- function Rh(e, t) {
1945
- var n = U[e & 255];
1946
- return t <= 8 ? n >>> 8 - t : (n = n << 8 | U[e >> 8 & 255], t <= 16 ? n >>> 16 - t : (n = n << 8 | U[e >> 16 & 255], n >>> 24 - t));
1943
+ for (var V = typeof Uint8Array < "u", H = V ? new Uint8Array(256) : [], U = 0; U < 256; ++U) H[U] = Bh(U);
1944
+ function Vh(e, t) {
1945
+ var n = H[e & 255];
1946
+ return t <= 8 ? n >>> 8 - t : (n = n << 8 | H[e >> 8 & 255], t <= 16 ? n >>> 16 - t : (n = n << 8 | H[e >> 16 & 255], n >>> 24 - t));
1947
1947
  }
1948
- function zh(e, t) {
1948
+ function Hh(e, t) {
1949
1949
  var n = t & 7, i = t >>> 3;
1950
1950
  return (e[i] | (n <= 6 ? 0 : e[i + 1] << 8)) >>> n & 3;
1951
1951
  }
@@ -1953,39 +1953,39 @@ var CRC32 = /* @__PURE__ */ (function() {
1953
1953
  var n = t & 7, i = t >>> 3;
1954
1954
  return (e[i] | (n <= 5 ? 0 : e[i + 1] << 8)) >>> n & 7;
1955
1955
  }
1956
- function G(e, t) {
1956
+ function Uh(e, t) {
1957
1957
  var n = t & 7, i = t >>> 3;
1958
1958
  return (e[i] | (n <= 4 ? 0 : e[i + 1] << 8)) >>> n & 15;
1959
1959
  }
1960
- function K(e, t) {
1960
+ function Wh(e, t) {
1961
1961
  var n = t & 7, i = t >>> 3;
1962
1962
  return (e[i] | (n <= 3 ? 0 : e[i + 1] << 8)) >>> n & 31;
1963
1963
  }
1964
- function Bh(e, t) {
1964
+ function Gh(e, t) {
1965
1965
  var n = t & 7, i = t >>> 3;
1966
1966
  return (e[i] | (n <= 1 ? 0 : e[i + 1] << 8)) >>> n & 127;
1967
1967
  }
1968
- function q(e, t, n) {
1968
+ function Kh(e, t, n) {
1969
1969
  var i = t & 7, a = t >>> 3, o = (1 << n) - 1, s = e[a] >>> i;
1970
1970
  return n < 8 - i || (s |= e[a + 1] << 8 - i, n < 16 - i) || (s |= e[a + 2] << 16 - i, n < 24 - i) || (s |= e[a + 3] << 24 - i), s & o;
1971
1971
  }
1972
- function Vh(e, t, n) {
1972
+ function qh(e, t, n) {
1973
1973
  var i = t & 7, a = t >>> 3;
1974
1974
  return i <= 5 ? e[a] |= (n & 7) << i : (e[a] |= n << i & 255, e[a + 1] = (n & 7) >> 8 - i), t + 3;
1975
1975
  }
1976
- function Hh(e, t, n) {
1976
+ function Jh(e, t, n) {
1977
1977
  var i = t & 7, a = t >>> 3;
1978
1978
  return n = (n & 1) << i, e[a] |= n, t + 1;
1979
1979
  }
1980
- function J(e, t, n) {
1980
+ function G(e, t, n) {
1981
1981
  var i = t & 7, a = t >>> 3;
1982
1982
  return n <<= i, e[a] |= n & 255, n >>>= 8, e[a + 1] = n, t + 8;
1983
1983
  }
1984
- function Uh(e, t, n) {
1984
+ function Yh(e, t, n) {
1985
1985
  var i = t & 7, a = t >>> 3;
1986
1986
  return n <<= i, e[a] |= n & 255, n >>>= 8, e[a + 1] = n & 255, e[a + 2] = n >>> 8, t + 16;
1987
1987
  }
1988
- function Wh(e, t) {
1988
+ function K(e, t) {
1989
1989
  var n = e.length, i = 2 * n > t ? 2 * n : t + 5, a = 0;
1990
1990
  if (n >= t) return e;
1991
1991
  if (has_buf) {
@@ -1993,7 +1993,7 @@ var CRC32 = /* @__PURE__ */ (function() {
1993
1993
  if (e.copy) e.copy(o);
1994
1994
  else for (; a < e.length; ++a) o[a] = e[a];
1995
1995
  return o;
1996
- } else if (H) {
1996
+ } else if (V) {
1997
1997
  var s = new Uint8Array(i);
1998
1998
  if (s.set) s.set(e);
1999
1999
  else for (; a < n; ++a) s[a] = e[a];
@@ -2001,43 +2001,43 @@ var CRC32 = /* @__PURE__ */ (function() {
2001
2001
  }
2002
2002
  return e.length = i, e;
2003
2003
  }
2004
- function Y(e) {
2004
+ function q(e) {
2005
2005
  for (var t = Array(e), n = 0; n < e; ++n) t[n] = 0;
2006
2006
  return t;
2007
2007
  }
2008
- function Gh(e, t, n) {
2009
- var i = 1, a = 0, o = 0, s = 0, c = 0, l = e.length, u = H ? new Uint16Array(32) : Y(32);
2008
+ function J(e, t, n) {
2009
+ var i = 1, a = 0, o = 0, s = 0, c = 0, l = e.length, u = V ? new Uint16Array(32) : q(32);
2010
2010
  for (o = 0; o < 32; ++o) u[o] = 0;
2011
2011
  for (o = l; o < n; ++o) e[o] = 0;
2012
2012
  l = e.length;
2013
- var d = H ? new Uint16Array(l) : Y(l);
2013
+ var d = V ? new Uint16Array(l) : q(l);
2014
2014
  for (o = 0; o < l; ++o) u[a = e[o]]++, i < a && (i = a), d[o] = 0;
2015
2015
  for (u[0] = 0, o = 1; o <= i; ++o) u[o + 16] = c = c + u[o - 1] << 1;
2016
2016
  for (o = 0; o < l; ++o) c = e[o], c != 0 && (d[o] = u[c + 16]++);
2017
2017
  var f = 0;
2018
- for (o = 0; o < l; ++o) if (f = e[o], f != 0) for (c = Rh(d[o], i) >> i - f, s = (1 << i + 4 - f) - 1; s >= 0; --s) t[c | s << f] = f & 15 | o << 4;
2018
+ for (o = 0; o < l; ++o) if (f = e[o], f != 0) for (c = Vh(d[o], i) >> i - f, s = (1 << i + 4 - f) - 1; s >= 0; --s) t[c | s << f] = f & 15 | o << 4;
2019
2019
  return i;
2020
2020
  }
2021
- var Kh = H ? new Uint16Array(512) : Y(512), qh = H ? new Uint16Array(32) : Y(32);
2022
- if (!H) {
2023
- for (var X = 0; X < 512; ++X) Kh[X] = 0;
2024
- for (X = 0; X < 32; ++X) qh[X] = 0;
2021
+ var Y = V ? new Uint16Array(512) : q(512), Xh = V ? new Uint16Array(32) : q(32);
2022
+ if (!V) {
2023
+ for (var X = 0; X < 512; ++X) Y[X] = 0;
2024
+ for (X = 0; X < 32; ++X) Xh[X] = 0;
2025
2025
  }
2026
2026
  (function() {
2027
2027
  for (var e = [], t = 0; t < 32; t++) e.push(5);
2028
- Gh(e, qh, 32);
2028
+ J(e, Xh, 32);
2029
2029
  var n = [];
2030
2030
  for (t = 0; t <= 143; t++) n.push(8);
2031
2031
  for (; t <= 255; t++) n.push(9);
2032
2032
  for (; t <= 279; t++) n.push(7);
2033
2033
  for (; t <= 287; t++) n.push(8);
2034
- Gh(n, Kh, 288);
2034
+ J(n, Y, 288);
2035
2035
  })();
2036
- var Jh = /* @__PURE__ */ (function() {
2037
- for (var e = H ? new Uint8Array(32768) : [], t = 0, n = 0; t < V.length - 1; ++t) for (; n < V[t + 1]; ++n) e[n] = t;
2036
+ var Zh = /* @__PURE__ */ (function() {
2037
+ for (var e = V ? new Uint8Array(32768) : [], t = 0, n = 0; t < B.length - 1; ++t) for (; n < B[t + 1]; ++n) e[n] = t;
2038
2038
  for (; n < 32768; ++n) e[n] = 29;
2039
- var i = H ? new Uint8Array(259) : [];
2040
- for (t = 0, n = 0; t < Nh.length - 1; ++t) for (; n < Nh[t + 1]; ++n) i[n] = t;
2039
+ var i = V ? new Uint8Array(259) : [];
2040
+ for (t = 0, n = 0; t < z.length - 1; ++t) for (; n < z[t + 1]; ++n) i[n] = t;
2041
2041
  function a(e, t) {
2042
2042
  for (var n = 0; n < e.length;) {
2043
2043
  var i = Math.min(65535, e.length - n), a = n + i == e.length;
@@ -2046,30 +2046,30 @@ var CRC32 = /* @__PURE__ */ (function() {
2046
2046
  return t.l;
2047
2047
  }
2048
2048
  function o(t, n) {
2049
- for (var a = 0, o = 0, s = H ? new Uint16Array(32768) : []; o < t.length;) {
2049
+ for (var a = 0, o = 0, s = V ? new Uint16Array(32768) : []; o < t.length;) {
2050
2050
  var c = Math.min(65535, t.length - o);
2051
2051
  if (c < 10) {
2052
- for (a = Vh(n, a, +(o + c == t.length)), a & 7 && (a += 8 - (a & 7)), n.l = a / 8 | 0, n.write_shift(2, c), n.write_shift(2, ~c & 65535); c-- > 0;) n[n.l++] = t[o++];
2052
+ for (a = qh(n, a, +(o + c == t.length)), a & 7 && (a += 8 - (a & 7)), n.l = a / 8 | 0, n.write_shift(2, c), n.write_shift(2, ~c & 65535); c-- > 0;) n[n.l++] = t[o++];
2053
2053
  a = n.l * 8;
2054
2054
  continue;
2055
2055
  }
2056
- a = Vh(n, a, +(o + c == t.length) + 2);
2056
+ a = qh(n, a, +(o + c == t.length) + 2);
2057
2057
  for (var l = 0; c-- > 0;) {
2058
2058
  var u = t[o];
2059
2059
  l = (l << 5 ^ u) & 32767;
2060
2060
  var d = -1, f = 0;
2061
2061
  if ((d = s[l]) && (d |= o & -32768, d > o && (d -= 32768), d < o)) for (; t[d + f] == t[o + f] && f < 250;) ++f;
2062
2062
  if (f > 2) {
2063
- u = i[f], u <= 22 ? a = J(n, a, U[u + 1] >> 1) - 1 : (J(n, a, 3), a += 5, J(n, a, U[u - 23] >> 5), a += 3);
2063
+ u = i[f], u <= 22 ? a = G(n, a, H[u + 1] >> 1) - 1 : (G(n, a, 3), a += 5, G(n, a, H[u - 23] >> 5), a += 3);
2064
2064
  var p = u < 8 ? 0 : u - 4 >> 2;
2065
- p > 0 && (Uh(n, a, f - Nh[u]), a += p), u = e[o - d], a = J(n, a, U[u] >> 3), a -= 3;
2065
+ p > 0 && (Yh(n, a, f - z[u]), a += p), u = e[o - d], a = G(n, a, H[u] >> 3), a -= 3;
2066
2066
  var m = u < 4 ? 0 : u - 2 >> 1;
2067
- m > 0 && (Uh(n, a, o - d - V[u]), a += m);
2067
+ m > 0 && (Yh(n, a, o - d - B[u]), a += m);
2068
2068
  for (var h = 0; h < f; ++h) s[l] = o & 32767, l = (l << 5 ^ t[o]) & 32767, ++o;
2069
2069
  c -= f - 1;
2070
- } else u <= 143 ? u += 48 : a = Hh(n, a, 1), a = J(n, a, U[u]), s[l] = o & 32767, ++o;
2070
+ } else u <= 143 ? u += 48 : a = Jh(n, a, 1), a = G(n, a, H[u]), s[l] = o & 32767, ++o;
2071
2071
  }
2072
- a = J(n, a, 0) - 1;
2072
+ a = G(n, a, 0) - 1;
2073
2073
  }
2074
2074
  return n.l = (a + 7) / 8 | 0, n.l;
2075
2075
  }
@@ -2077,19 +2077,19 @@ var CRC32 = /* @__PURE__ */ (function() {
2077
2077
  return e.length < 8 ? a(e, t) : o(e, t);
2078
2078
  };
2079
2079
  })();
2080
- function Yh(e) {
2081
- var t = new_buf(50 + Math.floor(e.length * 1.1)), n = Jh(e, t);
2080
+ function Qh(e) {
2081
+ var t = new_buf(50 + Math.floor(e.length * 1.1)), n = Zh(e, t);
2082
2082
  return t.slice(0, n);
2083
2083
  }
2084
- var Z = H ? new Uint16Array(32768) : Y(32768), Q = H ? new Uint16Array(32768) : Y(32768), Xh = H ? new Uint16Array(128) : Y(128), Zh = 1, Qh = 1;
2085
- function $h(e, t) {
2086
- var n = K(e, t) + 257;
2084
+ var $h = V ? new Uint16Array(32768) : q(32768), eg = V ? new Uint16Array(32768) : q(32768), Z = V ? new Uint16Array(128) : q(128), tg = 1, ng = 1;
2085
+ function rg(e, t) {
2086
+ var n = Wh(e, t) + 257;
2087
2087
  t += 5;
2088
- var i = K(e, t) + 1;
2088
+ var i = Wh(e, t) + 1;
2089
2089
  t += 5;
2090
- var a = G(e, t) + 4;
2090
+ var a = Uh(e, t) + 4;
2091
2091
  t += 4;
2092
- for (var o = 0, s = H ? new Uint8Array(19) : Y(19), c = [
2092
+ for (var o = 0, s = V ? new Uint8Array(19) : q(19), c = [
2093
2093
  0,
2094
2094
  0,
2095
2095
  0,
@@ -2109,25 +2109,25 @@ var CRC32 = /* @__PURE__ */ (function() {
2109
2109
  0,
2110
2110
  0,
2111
2111
  0
2112
- ], l = 1, u = H ? new Uint8Array(8) : Y(8), d = H ? new Uint8Array(8) : Y(8), f = s.length, p = 0; p < a; ++p) s[jh[p]] = o = W(e, t), l < o && (l = o), u[o]++, t += 3;
2112
+ ], l = 1, u = V ? new Uint8Array(8) : q(8), d = V ? new Uint8Array(8) : q(8), f = s.length, p = 0; p < a; ++p) s[Ih[p]] = o = W(e, t), l < o && (l = o), u[o]++, t += 3;
2113
2113
  var m = 0;
2114
2114
  for (u[0] = 0, p = 1; p <= l; ++p) d[p] = m = m + u[p - 1] << 1;
2115
2115
  for (p = 0; p < f; ++p) (m = s[p]) != 0 && (c[p] = d[m]++);
2116
2116
  var h = 0;
2117
2117
  for (p = 0; p < f; ++p) if (h = s[p], h != 0) {
2118
- m = U[c[p]] >> 8 - h;
2119
- for (var g = (1 << 7 - h) - 1; g >= 0; --g) Xh[m | g << h] = h & 7 | p << 3;
2118
+ m = H[c[p]] >> 8 - h;
2119
+ for (var g = (1 << 7 - h) - 1; g >= 0; --g) Z[m | g << h] = h & 7 | p << 3;
2120
2120
  }
2121
2121
  var _ = [];
2122
- for (l = 1; _.length < n + i;) switch (m = Xh[Bh(e, t)], t += m & 7, m >>>= 3) {
2122
+ for (l = 1; _.length < n + i;) switch (m = Z[Gh(e, t)], t += m & 7, m >>>= 3) {
2123
2123
  case 16:
2124
- for (o = 3 + zh(e, t), t += 2, m = _[_.length - 1]; o-- > 0;) _.push(m);
2124
+ for (o = 3 + Hh(e, t), t += 2, m = _[_.length - 1]; o-- > 0;) _.push(m);
2125
2125
  break;
2126
2126
  case 17:
2127
2127
  for (o = 3 + W(e, t), t += 3; o-- > 0;) _.push(0);
2128
2128
  break;
2129
2129
  case 18:
2130
- for (o = 11 + Bh(e, t), t += 7; o-- > 0;) _.push(0);
2130
+ for (o = 11 + Gh(e, t), t += 7; o-- > 0;) _.push(0);
2131
2131
  break;
2132
2132
  default:
2133
2133
  _.push(m), l < m && (l = m);
@@ -2136,45 +2136,45 @@ var CRC32 = /* @__PURE__ */ (function() {
2136
2136
  var v = _.slice(0, n), y = _.slice(n);
2137
2137
  for (p = n; p < 286; ++p) v[p] = 0;
2138
2138
  for (p = i; p < 30; ++p) y[p] = 0;
2139
- return Zh = Gh(v, Z, 286), Qh = Gh(y, Q, 30), t;
2139
+ return tg = J(v, $h, 286), ng = J(y, eg, 30), t;
2140
2140
  }
2141
- function eg(e, t) {
2141
+ function ig(e, t) {
2142
2142
  if (e[0] == 3 && !(e[1] & 3)) return [new_raw_buf(t), 2];
2143
2143
  for (var n = 0, i = 0, a = new_unsafe_buf(t || 1 << 18), o = 0, s = a.length >>> 0, c = 0, l = 0; !(i & 1);) {
2144
- if (i = W(e, n), n += 3, i >>> 1) i >> 1 == 1 ? (c = 9, l = 5) : (n = $h(e, n), c = Zh, l = Qh);
2144
+ if (i = W(e, n), n += 3, i >>> 1) i >> 1 == 1 ? (c = 9, l = 5) : (n = rg(e, n), c = tg, l = ng);
2145
2145
  else {
2146
2146
  n & 7 && (n += 8 - (n & 7));
2147
2147
  var u = e[n >>> 3] | e[(n >>> 3) + 1] << 8;
2148
- if (n += 32, u > 0) for (!t && s < o + u && (a = Wh(a, o + u), s = a.length); u-- > 0;) a[o++] = e[n >>> 3], n += 8;
2148
+ if (n += 32, u > 0) for (!t && s < o + u && (a = K(a, o + u), s = a.length); u-- > 0;) a[o++] = e[n >>> 3], n += 8;
2149
2149
  continue;
2150
2150
  }
2151
2151
  for (;;) {
2152
- !t && s < o + 32767 && (a = Wh(a, o + 32767), s = a.length);
2153
- var d = q(e, n, c), f = i >>> 1 == 1 ? Kh[d] : Z[d];
2152
+ !t && s < o + 32767 && (a = K(a, o + 32767), s = a.length);
2153
+ var d = Kh(e, n, c), f = i >>> 1 == 1 ? Y[d] : $h[d];
2154
2154
  if (n += f & 15, f >>>= 4, !(f >>> 8 & 255)) a[o++] = f;
2155
2155
  else if (f == 256) break;
2156
2156
  else {
2157
2157
  f -= 257;
2158
2158
  var p = f < 8 ? 0 : f - 4 >> 2;
2159
2159
  p > 5 && (p = 0);
2160
- var m = o + Nh[f];
2161
- p > 0 && (m += q(e, n, p), n += p), d = q(e, n, l), f = i >>> 1 == 1 ? qh[d] : Q[d], n += f & 15, f >>>= 4;
2162
- var h = f < 4 ? 0 : f - 2 >> 1, g = V[f];
2163
- for (h > 0 && (g += q(e, n, h), n += h), !t && s < m && (a = Wh(a, m + 100), s = a.length); o < m;) a[o] = a[o - g], ++o;
2160
+ var m = o + z[f];
2161
+ p > 0 && (m += Kh(e, n, p), n += p), d = Kh(e, n, l), f = i >>> 1 == 1 ? Xh[d] : eg[d], n += f & 15, f >>>= 4;
2162
+ var h = f < 4 ? 0 : f - 2 >> 1, g = B[f];
2163
+ for (h > 0 && (g += Kh(e, n, h), n += h), !t && s < m && (a = K(a, m + 100), s = a.length); o < m;) a[o] = a[o - g], ++o;
2164
2164
  }
2165
2165
  }
2166
2166
  }
2167
2167
  return t ? [a, n + 7 >>> 3] : [a.slice(0, o), n + 7 >>> 3];
2168
2168
  }
2169
- function tg(e, t) {
2170
- var n = e.slice(e.l || 0), i = eg(n, t);
2169
+ function ag(e, t) {
2170
+ var n = e.slice(e.l || 0), i = ig(n, t);
2171
2171
  return e.l += i[1], i[0];
2172
2172
  }
2173
- function ng(e, t) {
2173
+ function og(e, t) {
2174
2174
  if (e) typeof console < "u" && console.error(t);
2175
2175
  else throw Error(t);
2176
2176
  }
2177
- function rg(e, t) {
2177
+ function sg(e, t) {
2178
2178
  var n = e;
2179
2179
  prep_blob(n, 0);
2180
2180
  var i = {
@@ -2192,11 +2192,11 @@ var CRC32 = /* @__PURE__ */ (function() {
2192
2192
  var p = n.read_shift(4), m = s(n.slice(n.l + u, n.l + u + d));
2193
2193
  n.l += u + d + f;
2194
2194
  var h = n.l;
2195
- n.l = p + 4, ig(n, c, l, i, m), n.l = h;
2195
+ n.l = p + 4, cg(n, c, l, i, m), n.l = h;
2196
2196
  }
2197
2197
  return i;
2198
2198
  }
2199
- function ig(e, t, n, i, a) {
2199
+ function cg(e, t, n, i, a) {
2200
2200
  e.l += 2;
2201
2201
  var c = e.read_shift(2), l = e.read_shift(2), u = o(e);
2202
2202
  if (c & 8257) throw Error("Unsupported ZIP encryption");
@@ -2209,25 +2209,25 @@ var CRC32 = /* @__PURE__ */ (function() {
2209
2209
  var y = e.slice(e.l, e.l + f);
2210
2210
  switch (l) {
2211
2211
  case 8:
2212
- y = B(e, p);
2212
+ y = Ph(e, p);
2213
2213
  break;
2214
2214
  case 0: break;
2215
2215
  default: throw Error("Unsupported ZIP Compression method " + l);
2216
2216
  }
2217
2217
  var b = !1;
2218
- c & 8 && (d = e.read_shift(4), d == 134695760 && (d = e.read_shift(4), b = !0), f = e.read_shift(4), p = e.read_shift(4)), f != t && ng(b, "Bad compressed size: " + t + " != " + f), p != n && ng(b, "Bad uncompressed size: " + n + " != " + p), hg(i, g, y, {
2218
+ c & 8 && (d = e.read_shift(4), d == 134695760 && (d = e.read_shift(4), b = !0), f = e.read_shift(4), p = e.read_shift(4)), f != t && og(b, "Bad compressed size: " + t + " != " + f), p != n && og(b, "Bad uncompressed size: " + n + " != " + p), vg(i, g, y, {
2219
2219
  unsafe: !0,
2220
2220
  mt: u
2221
2221
  });
2222
2222
  }
2223
- function ag(e, t) {
2223
+ function lg(e, t) {
2224
2224
  var n = t || {}, i = [], o = [], s = new_buf(1), c = n.compression ? 8 : 0, l = 0, u = 0, d = 0, f = 0, p = 0, m = e.FullPaths[0], h = m, g = e.FileIndex[0], _ = [], v = 0;
2225
2225
  for (u = 1; u < e.FullPaths.length; ++u) if (h = e.FullPaths[u].slice(m.length), g = e.FileIndex[u], !(!g.size || !g.content || h == "Sh33tJ5")) {
2226
2226
  var y = f, b = new_buf(h.length);
2227
2227
  for (d = 0; d < h.length; ++d) b.write_shift(1, h.charCodeAt(d) & 127);
2228
2228
  b = b.slice(0, b.l), _[p] = CRC32.buf(g.content, 0);
2229
2229
  var x = g.content;
2230
- c == 8 && (x = Ah(x)), s = new_buf(30), s.write_shift(4, 67324752), s.write_shift(2, 20), s.write_shift(2, l), s.write_shift(2, c), g.mt ? a(s, g.mt) : s.write_shift(4, 0), s.write_shift(-4, l & 8 ? 0 : _[p]), s.write_shift(4, l & 8 ? 0 : x.length), s.write_shift(4, l & 8 ? 0 : g.content.length), s.write_shift(2, b.length), s.write_shift(2, 0), f += s.length, i.push(s), f += b.length, i.push(b), f += x.length, i.push(x), l & 8 && (s = new_buf(12), s.write_shift(-4, _[p]), s.write_shift(4, x.length), s.write_shift(4, g.content.length), f += s.l, i.push(s)), s = new_buf(46), s.write_shift(4, 33639248), s.write_shift(2, 0), s.write_shift(2, 20), s.write_shift(2, l), s.write_shift(2, c), s.write_shift(4, 0), s.write_shift(-4, _[p]), s.write_shift(4, x.length), s.write_shift(4, g.content.length), s.write_shift(2, b.length), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(4, 0), s.write_shift(4, y), v += s.l, o.push(s), v += b.length, o.push(b), ++p;
2230
+ c == 8 && (x = Fh(x)), s = new_buf(30), s.write_shift(4, 67324752), s.write_shift(2, 20), s.write_shift(2, l), s.write_shift(2, c), g.mt ? a(s, g.mt) : s.write_shift(4, 0), s.write_shift(-4, l & 8 ? 0 : _[p]), s.write_shift(4, l & 8 ? 0 : x.length), s.write_shift(4, l & 8 ? 0 : g.content.length), s.write_shift(2, b.length), s.write_shift(2, 0), f += s.length, i.push(s), f += b.length, i.push(b), f += x.length, i.push(x), l & 8 && (s = new_buf(12), s.write_shift(-4, _[p]), s.write_shift(4, x.length), s.write_shift(4, g.content.length), f += s.l, i.push(s)), s = new_buf(46), s.write_shift(4, 33639248), s.write_shift(2, 0), s.write_shift(2, 20), s.write_shift(2, l), s.write_shift(2, c), s.write_shift(4, 0), s.write_shift(-4, _[p]), s.write_shift(4, x.length), s.write_shift(4, g.content.length), s.write_shift(2, b.length), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(4, 0), s.write_shift(4, y), v += s.l, o.push(s), v += b.length, o.push(b), ++p;
2231
2231
  }
2232
2232
  return s = new_buf(22), s.write_shift(4, 101010256), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, p), s.write_shift(2, p), s.write_shift(4, v), s.write_shift(4, f), s.write_shift(2, 0), bconcat([
2233
2233
  bconcat(i),
@@ -2235,7 +2235,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2235
2235
  s
2236
2236
  ]);
2237
2237
  }
2238
- var og = {
2238
+ var ug = {
2239
2239
  htm: "text/html",
2240
2240
  xml: "text/xml",
2241
2241
  gif: "image/gif",
@@ -2245,16 +2245,16 @@ var CRC32 = /* @__PURE__ */ (function() {
2245
2245
  thmx: "application/vnd.ms-officetheme",
2246
2246
  sh33tj5: "application/octet-stream"
2247
2247
  };
2248
- function sg(e, t) {
2248
+ function dg(e, t) {
2249
2249
  if (e.ctype) return e.ctype;
2250
2250
  var n = e.name || "", i = n.match(/\.([^\.]+)$/);
2251
- return i && og[i[1]] || t && (i = (n = t).match(/[\.\\]([^\.\\])+$/), i && og[i[1]]) ? og[i[1]] : "application/octet-stream";
2251
+ return i && ug[i[1]] || t && (i = (n = t).match(/[\.\\]([^\.\\])+$/), i && ug[i[1]]) ? ug[i[1]] : "application/octet-stream";
2252
2252
  }
2253
- function cg(e) {
2253
+ function Q(e) {
2254
2254
  for (var t = Base64_encode(e), n = [], i = 0; i < t.length; i += 76) n.push(t.slice(i, i + 76));
2255
2255
  return n.join("\r\n") + "\r\n";
2256
2256
  }
2257
- function lg(e) {
2257
+ function fg(e) {
2258
2258
  var t = e.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g, function(e) {
2259
2259
  var t = e.charCodeAt(0).toString(16).toUpperCase();
2260
2260
  return "=" + (t.length == 1 ? "0" + t : t);
@@ -2273,7 +2273,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2273
2273
  }
2274
2274
  return n.join("\r\n");
2275
2275
  }
2276
- function ug(e) {
2276
+ function pg(e) {
2277
2277
  for (var t = [], n = 0; n < e.length; ++n) {
2278
2278
  for (var i = e[n]; n <= e.length && i.charAt(i.length - 1) == "=";) i = i.slice(0, i.length - 1) + e[++n];
2279
2279
  t.push(i);
@@ -2283,7 +2283,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2283
2283
  });
2284
2284
  return s2a(t.join("\r\n"));
2285
2285
  }
2286
- function dg(e, t, n) {
2286
+ function mg(e, t, n) {
2287
2287
  for (var i = "", a = "", o = "", s, c = 0; c < 10; ++c) {
2288
2288
  var l = t[c];
2289
2289
  if (!l || l.match(/^\s*$/)) break;
@@ -2305,14 +2305,14 @@ var CRC32 = /* @__PURE__ */ (function() {
2305
2305
  s = s2a(Base64_decode(t.slice(c).join("")));
2306
2306
  break;
2307
2307
  case "quoted-printable":
2308
- s = ug(t.slice(c));
2308
+ s = pg(t.slice(c));
2309
2309
  break;
2310
2310
  default: throw Error("Unsupported Content-Transfer-Encoding " + a);
2311
2311
  }
2312
- var d = hg(e, i.slice(n.length), s, { unsafe: !0 });
2312
+ var d = vg(e, i.slice(n.length), s, { unsafe: !0 });
2313
2313
  o && (d.ctype = o);
2314
2314
  }
2315
- function fg(e, t) {
2315
+ function hg(e, t) {
2316
2316
  if (F(e.slice(0, 13)).toLowerCase() != "mime-version:") throw Error("Unsupported MAD header");
2317
2317
  var n = t && t.root || "", i = (has_buf && Buffer.isBuffer(e) ? e.toString("binary") : F(e)).split("\r\n"), a = 0, o = "";
2318
2318
  for (a = 0; a < i.length; ++a) if (o = i[a], /^Content-Location:/i.test(o) && (o = o.slice(o.indexOf("file")), n ||= o.slice(0, o.lastIndexOf("/") + 1), o.slice(0, n.length) != n)) for (; n.length > 0 && (n = n.slice(0, n.length - 1), n = n.slice(0, n.lastIndexOf("/") + 1), o.slice(0, n.length) != n););
@@ -2326,11 +2326,11 @@ var CRC32 = /* @__PURE__ */ (function() {
2326
2326
  var u, d = 0;
2327
2327
  for (a = 0; a < i.length; ++a) {
2328
2328
  var f = i[a];
2329
- f !== c && f !== c + "--" || (d++ && dg(l, i.slice(u, a), n), u = a);
2329
+ f !== c && f !== c + "--" || (d++ && mg(l, i.slice(u, a), n), u = a);
2330
2330
  }
2331
2331
  return l;
2332
2332
  }
2333
- function pg(e, t) {
2333
+ function gg(e, t) {
2334
2334
  var n = t || {}, i = n.boundary || "SheetJS";
2335
2335
  i = "------=" + i;
2336
2336
  for (var a = [
@@ -2347,15 +2347,15 @@ var CRC32 = /* @__PURE__ */ (function() {
2347
2347
  });
2348
2348
  for (var u = c.content, d = has_buf && Buffer.isBuffer(u) ? u.toString("binary") : F(u), f = 0, p = Math.min(1024, d.length), m = 0, h = 0; h <= p; ++h) (m = d.charCodeAt(h)) >= 32 && m < 128 && ++f;
2349
2349
  var g = f >= p * 4 / 5;
2350
- a.push(i), a.push("Content-Location: " + (n.root || "file:///C:/SheetJS/") + s), a.push("Content-Transfer-Encoding: " + (g ? "quoted-printable" : "base64")), a.push("Content-Type: " + sg(c, s)), a.push(""), a.push(g ? lg(d) : cg(d));
2350
+ a.push(i), a.push("Content-Location: " + (n.root || "file:///C:/SheetJS/") + s), a.push("Content-Transfer-Encoding: " + (g ? "quoted-printable" : "base64")), a.push("Content-Type: " + dg(c, s)), a.push(""), a.push(g ? fg(d) : Q(d));
2351
2351
  }
2352
2352
  return a.push(i + "--\r\n"), a.join("\r\n");
2353
2353
  }
2354
- function mg(e) {
2354
+ function _g(e) {
2355
2355
  var t = {};
2356
2356
  return C(t, e), t;
2357
2357
  }
2358
- function hg(e, t, n, a) {
2358
+ function vg(e, t, n, a) {
2359
2359
  var o = a && a.unsafe;
2360
2360
  o || C(e);
2361
2361
  var s = !o && CFB.find(e, t);
@@ -2368,7 +2368,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2368
2368
  }
2369
2369
  return s.content = n, s.size = n ? n.length : 0, a && (a.CLSID && (s.clsid = a.CLSID), a.mt && (s.mt = a.mt), a.ct && (s.ct = a.ct)), s;
2370
2370
  }
2371
- function gg(e, t) {
2371
+ function yg(e, t) {
2372
2372
  C(e);
2373
2373
  var n = CFB.find(e, t);
2374
2374
  if (n) {
@@ -2376,7 +2376,7 @@ var CRC32 = /* @__PURE__ */ (function() {
2376
2376
  }
2377
2377
  return !1;
2378
2378
  }
2379
- function _g(e, t, n) {
2379
+ function bg(e, t, n) {
2380
2380
  C(e);
2381
2381
  var a = CFB.find(e, t);
2382
2382
  if (a) {
@@ -2384,22 +2384,22 @@ var CRC32 = /* @__PURE__ */ (function() {
2384
2384
  }
2385
2385
  return !1;
2386
2386
  }
2387
- function vg(e) {
2387
+ function xg(e) {
2388
2388
  T(e, !0);
2389
2389
  }
2390
- return e.find = D, e.read = S, e.parse = u, e.write = I, e.writeFile = P, e.utils = {
2391
- cfb_new: mg,
2392
- cfb_add: hg,
2393
- cfb_del: gg,
2394
- cfb_mov: _g,
2395
- cfb_gc: vg,
2390
+ return e.find = D, e.read = S, e.parse = u, e.write = Dh, e.writeFile = P, e.utils = {
2391
+ cfb_new: _g,
2392
+ cfb_add: vg,
2393
+ cfb_del: yg,
2394
+ cfb_mov: bg,
2395
+ cfb_gc: xg,
2396
2396
  ReadShift,
2397
2397
  CheckField,
2398
2398
  prep_blob,
2399
2399
  bconcat,
2400
- use_zlib: R,
2401
- _deflateRaw: Yh,
2402
- _inflateRaw: tg,
2400
+ use_zlib: Oh,
2401
+ _deflateRaw: Qh,
2402
+ _inflateRaw: ag,
2403
2403
  consts: N
2404
2404
  }, e;
2405
2405
  })(), _fs = void 0;
@@ -5531,7 +5531,7 @@ var DBF = /* @__PURE__ */ (function() {
5531
5531
  function e(e, t, n) {
5532
5532
  if (e) {
5533
5533
  prep_blob(e, e.l || 0);
5534
- for (var i = n.Enum || wh; e.l < e.length;) {
5534
+ for (var i = n.Enum || kh; e.l < e.length;) {
5535
5535
  var a = e.read_shift(2), o = i[a] || i[65535], s = e.read_shift(2), c = e.l + s, l = o.f && o.f(e, s, n);
5536
5536
  if (e.l = c, t(l, o, a)) return;
5537
5537
  }
@@ -5561,7 +5561,7 @@ var DBF = /* @__PURE__ */ (function() {
5561
5561
  }
5562
5562
  }, p = i.sheetRows || 0;
5563
5563
  if (t[2] == 0 && (t[3] == 8 || t[3] == 9) && t.length >= 16 && t[14] == 5 && t[15] === 108) throw Error("Unsupported Works 3 for Mac file");
5564
- if (t[2] == 2) i.Enum = wh, e(t, function(e, t, n) {
5564
+ if (t[2] == 2) i.Enum = kh, e(t, function(e, t, n) {
5565
5565
  switch (n) {
5566
5566
  case 0:
5567
5567
  i.vers = e, e >= 4096 && (i.qpro = !0);
@@ -5600,7 +5600,7 @@ var DBF = /* @__PURE__ */ (function() {
5600
5600
  default:
5601
5601
  }
5602
5602
  }, i);
5603
- else if (t[2] == 26 || t[2] == 14) i.Enum = Th, t[2] == 14 && (i.qpro = !0, t.l = 0), e(t, function(e, t, n) {
5603
+ else if (t[2] == 26 || t[2] == 14) i.Enum = jh, t[2] == 14 && (i.qpro = !0, t.l = 0), e(t, function(e, t, n) {
5604
5604
  switch (n) {
5605
5605
  case 204:
5606
5606
  o = e;
@@ -5665,7 +5665,7 @@ var DBF = /* @__PURE__ */ (function() {
5665
5665
  if (+n.codepage >= 0 && set_cp(+n.codepage), n.type == "string") throw Error("Cannot write WK3 to JS string");
5666
5666
  var i = buf_array();
5667
5667
  write_biff_rec(i, 0, s(e));
5668
- for (var a = 0, o = 0; a < e.SheetNames.length; ++a) (e.Sheets[e.SheetNames[a]] || {})["!ref"] && write_biff_rec(i, 27, R(e.SheetNames[a], o++));
5668
+ for (var a = 0, o = 0; a < e.SheetNames.length; ++a) (e.Sheets[e.SheetNames[a]] || {})["!ref"] && write_biff_rec(i, 27, Oh(e.SheetNames[a], o++));
5669
5669
  var c = 0;
5670
5670
  for (a = 0; a < e.SheetNames.length; ++a) {
5671
5671
  var l = e.Sheets[e.SheetNames[a]];
@@ -5956,7 +5956,7 @@ var DBF = /* @__PURE__ */ (function() {
5956
5956
  return [i, a];
5957
5957
  }
5958
5958
  }
5959
- function L(e, t) {
5959
+ function I(e, t) {
5960
5960
  for (var n = {}, i = e.l + t; e.l < i;) {
5961
5961
  var a = e.read_shift(2);
5962
5962
  if (a == 14e3) {
@@ -5966,7 +5966,7 @@ var DBF = /* @__PURE__ */ (function() {
5966
5966
  }
5967
5967
  return n;
5968
5968
  }
5969
- function R(e, t) {
5969
+ function Oh(e, t) {
5970
5970
  var n = new_buf(5 + e.length);
5971
5971
  n.write_shift(2, 14e3), n.write_shift(2, t);
5972
5972
  for (var i = 0; i < e.length; ++i) {
@@ -5975,7 +5975,7 @@ var DBF = /* @__PURE__ */ (function() {
5975
5975
  }
5976
5976
  return n[n.l++] = 0, n;
5977
5977
  }
5978
- var wh = {
5978
+ var kh = {
5979
5979
  0: {
5980
5980
  n: "BOF",
5981
5981
  f: parseuint16
@@ -6067,7 +6067,7 @@ var DBF = /* @__PURE__ */ (function() {
6067
6067
  f: P
6068
6068
  },
6069
6069
  65535: { n: "" }
6070
- }, Th = {
6070
+ }, jh = {
6071
6071
  0: { n: "BOF" },
6072
6072
  1: { n: "EOF" },
6073
6073
  2: { n: "PASSWORD" },
@@ -6109,7 +6109,7 @@ var DBF = /* @__PURE__ */ (function() {
6109
6109
  26: { n: "FORMULA1A" },
6110
6110
  27: {
6111
6111
  n: "XFORMAT",
6112
- f: L
6112
+ f: I
6113
6113
  },
6114
6114
  28: { n: "DTLABELMISC" },
6115
6115
  29: { n: "DTLABELCELL" },
@@ -12020,11 +12020,11 @@ function write_numbers_iwa(e, t) {
12020
12020
  })();
12021
12021
  var P = parse_shallow(D[3][0].data), F = P[1][0];
12022
12022
  delete P[2];
12023
- var I = parse_shallow(F.data), L = parse_TSP_Reference(I[2][0].data);
12023
+ var Dh = parse_shallow(F.data), I = parse_TSP_Reference(Dh[2][0].data);
12024
12024
  (function() {
12025
- for (var e = CFB.find(u, c[L].location), t = parse_iwa_file(decompress_iwa_file(e.content)), n, a = 0; a < t.length; ++a) {
12025
+ for (var e = CFB.find(u, c[I].location), t = parse_iwa_file(decompress_iwa_file(e.content)), n, a = 0; a < t.length; ++a) {
12026
12026
  var l = t[a];
12027
- l.id == L && (n = l);
12027
+ l.id == I && (n = l);
12028
12028
  }
12029
12029
  var d = parse_shallow(n.messages[0].data);
12030
12030
  delete d[6], delete P[7];
@@ -12052,9 +12052,9 @@ function write_numbers_iwa(e, t) {
12052
12052
  }], n.messages[0].data = write_shallow(d);
12053
12053
  var g = write_iwa_file(t);
12054
12054
  e.content = compress_iwa_file(g), e.size = e.content.length;
12055
- })(), F.data = write_shallow(I), D[3][0].data = write_shallow(P), v[4][0].data = write_shallow(D), m.messages[0].data = write_shallow(v);
12056
- var R = write_iwa_file(p);
12057
- return f.content = compress_iwa_file(R), f.size = f.content.length, u;
12055
+ })(), F.data = write_shallow(Dh), D[3][0].data = write_shallow(P), v[4][0].data = write_shallow(D), m.messages[0].data = write_shallow(v);
12056
+ var Oh = write_iwa_file(p);
12057
+ return f.content = compress_iwa_file(Oh), f.size = f.content.length, u;
12058
12058
  }
12059
12059
  function fix_opts_func(e) {
12060
12060
  return function(t) {
@@ -13122,58 +13122,58 @@ const useAdvancedTable = (e) => {
13122
13122
  300,
13123
13123
  400,
13124
13124
  500
13125
- ], initialConfig: f, onConfigChange: p, fetchData: m } = e, [h, g] = useState(f?.sort || a || void 0), [_, v] = useState(f?.filters || c), [y, b] = useState(f?.columnOrder || n.map((e) => e.id)), [x, S] = useState(f?.hiddenColumns || []), [C, w] = useState(f?.pinnedColumns || []), [T, E] = useState({
13125
+ ], initialConfig: f, onConfigChange: p, onPaginationChange: m, onFiltersChange: h, fetchData: g, rowKey: _ = "id", onRowSelectionChange: v } = e, [y, b] = useState(f?.sort || a || void 0), [x, S] = useState(f?.filters || c), [C, w] = useState(f?.columnOrder || n.map((e) => e.id)), [T, E] = useState(f?.hiddenColumns || []), [D, O] = useState(f?.pinnedColumns || []), [k, A] = useState([]), [j, M] = useState({}), [N, P] = useState({
13126
13126
  page: 1,
13127
13127
  pageSize: f?.pagination?.pageSize || u,
13128
- total: t.length
13129
- }), [D, O] = useState([]), [k, A] = useState(0), [j, M] = useState(!1), [N, P] = useState(0), F = useCallback(async () => {
13130
- if (m) {
13131
- M(!0);
13128
+ total: f?.pagination?.total || t.length
13129
+ }), [F, Dh] = useState([]), [I, Oh] = useState(0), [kh, Ah] = useState(!1), [jh, Mh] = useState(0), Nh = useCallback(async () => {
13130
+ if (g) {
13131
+ Ah(!0);
13132
13132
  try {
13133
13133
  let e = {
13134
- page_number: T.page,
13135
- page_size: T.pageSize
13134
+ page_number: N.page,
13135
+ page_size: N.pageSize
13136
13136
  };
13137
- h && (e.order_by = `${h.direction === "desc" ? "-" : ""}${h.column}`), Object.entries(_).forEach(([t, n]) => {
13137
+ y && (e.order_by = `${y.direction === "desc" ? "-" : ""}${y.column}`), Object.entries(x).forEach(([t, n]) => {
13138
13138
  n.value && (e[t] = n.value);
13139
13139
  });
13140
- let t = await m(e);
13141
- O(t.items), A(t.total_items);
13140
+ let t = await g(e);
13141
+ Dh(t.items), Oh(t.total_items);
13142
13142
  } catch (e) {
13143
13143
  console.error("Failed to fetch data:", e);
13144
13144
  } finally {
13145
- M(!1);
13145
+ Ah(!1);
13146
13146
  }
13147
13147
  }
13148
13148
  }, [
13149
- m,
13150
- T.page,
13151
- T.pageSize,
13152
- h,
13153
- _
13149
+ g,
13150
+ N.page,
13151
+ N.pageSize,
13152
+ y,
13153
+ x
13154
13154
  ]);
13155
13155
  useEffect(() => {
13156
- m && F();
13156
+ g && Nh();
13157
13157
  }, [
13158
- F,
13159
- N,
13160
- m
13158
+ Nh,
13159
+ jh,
13160
+ g
13161
13161
  ]), useEffect(() => {
13162
- m && E((e) => ({
13162
+ g && P((e) => ({
13163
13163
  ...e,
13164
- total: k
13164
+ total: I
13165
13165
  }));
13166
- }, [k, m]), useEffect(() => {
13166
+ }, [I, g]), useEffect(() => {
13167
13167
  let e = n.map((e) => e.id);
13168
- b((t) => {
13168
+ w((t) => {
13169
13169
  let n = t.filter((t) => e.includes(t)), i = e.filter((e) => !n.includes(e));
13170
13170
  return [...n, ...i];
13171
- }), S((t) => t.filter((t) => e.includes(t))), w((t) => t.filter((t) => e.includes(t)));
13171
+ }), E((t) => t.filter((t) => e.includes(t))), O((t) => t.filter((t) => e.includes(t)));
13172
13172
  }, [n]);
13173
- let I = useMemo(() => {
13174
- if (m) return D;
13173
+ let L = useMemo(() => {
13174
+ if (g) return F;
13175
13175
  let e = [...t];
13176
- return Object.entries(_).forEach(([t, i]) => {
13176
+ return Object.entries(x).forEach(([t, i]) => {
13177
13177
  let a = n.find((e) => e.id === t);
13178
13178
  a && (e = e.filter((e) => {
13179
13179
  let t = typeof a.accessor == "function" ? a.accessor(e) : e[a.accessor], n = String(t || "").toLowerCase(), o = !0;
@@ -13182,14 +13182,14 @@ const useAdvancedTable = (e) => {
13182
13182
  }), e;
13183
13183
  }, [
13184
13184
  t,
13185
- _,
13185
+ x,
13186
13186
  n,
13187
- m,
13188
- D
13189
- ]), L = useMemo(() => {
13190
- if (m || !h) return I;
13191
- let e = n.find((e) => e.id === h.column);
13192
- return e ? [...I].sort((t, n) => {
13187
+ g,
13188
+ F
13189
+ ]), R = useMemo(() => {
13190
+ if (g || !y) return L;
13191
+ let e = n.find((e) => e.id === y.column);
13192
+ return e ? [...L].sort((t, n) => {
13193
13193
  let i = typeof e.accessor == "function" ? e.accessor(t) : t[e.accessor], a = typeof e.accessor == "function" ? e.accessor(n) : n[e.accessor];
13194
13194
  if (i == null) return 1;
13195
13195
  if (a == null) return -1;
@@ -13201,130 +13201,159 @@ const useAdvancedTable = (e) => {
13201
13201
  let e = String(i).toLowerCase(), t = String(a).toLowerCase();
13202
13202
  o = e.localeCompare(t);
13203
13203
  }
13204
- return h.direction === "desc" ? o * -1 : o;
13205
- }) : I;
13204
+ return y.direction === "desc" ? o * -1 : o;
13205
+ }) : L;
13206
13206
  }, [
13207
- I,
13208
- h,
13207
+ L,
13208
+ y,
13209
13209
  n,
13210
- m
13211
- ]), R = useMemo(() => {
13212
- if (m) return L;
13213
- let e = (T.page - 1) * T.pageSize, t = e + T.pageSize;
13214
- return L.slice(e, t);
13210
+ g
13211
+ ]), Ph = useMemo(() => {
13212
+ if (g) return R;
13213
+ let e = (N.page - 1) * N.pageSize, t = e + N.pageSize;
13214
+ return R.slice(e, t);
13215
13215
  }, [
13216
- L,
13217
- T.page,
13218
- T.pageSize,
13219
- m
13216
+ R,
13217
+ N.page,
13218
+ N.pageSize,
13219
+ g
13220
13220
  ]);
13221
13221
  useEffect(() => {
13222
- m || E((e) => ({
13222
+ g || P((e) => ({
13223
13223
  ...e,
13224
- total: I.length,
13225
- page: Math.min(e.page, Math.ceil(I.length / e.pageSize) || 1)
13224
+ total: L.length,
13225
+ page: Math.min(e.page, Math.ceil(L.length / e.pageSize) || 1)
13226
13226
  }));
13227
- }, [I.length, m]), useEffect(() => {
13227
+ }, [L.length, g]), useEffect(() => {
13228
13228
  p?.({
13229
13229
  columns: n,
13230
- sort: h,
13231
- filters: _,
13232
- pagination: T,
13233
- columnOrder: y,
13234
- hiddenColumns: x,
13235
- pinnedColumns: C
13230
+ sort: y,
13231
+ filters: x,
13232
+ pagination: N,
13233
+ columnOrder: C,
13234
+ hiddenColumns: T,
13235
+ pinnedColumns: D
13236
13236
  });
13237
13237
  }, [
13238
- h,
13239
- _,
13240
13238
  y,
13241
13239
  x,
13242
13240
  C,
13243
- T.pageSize,
13244
- p,
13245
13241
  T,
13242
+ D,
13243
+ N.pageSize,
13244
+ p,
13245
+ N,
13246
13246
  n
13247
- ]);
13248
- let wh = useCallback((e) => {
13249
- g((t) => t?.column === e ? t.direction === "asc" ? {
13247
+ ]), useEffect(() => {
13248
+ m?.(N);
13249
+ }, [N, m]), useEffect(() => {
13250
+ h?.(x);
13251
+ }, [x, h]);
13252
+ let Fh = useCallback((e) => {
13253
+ b((t) => t?.column === e ? t.direction === "asc" ? {
13250
13254
  column: e,
13251
13255
  direction: "desc"
13252
13256
  } : void 0 : {
13253
13257
  column: e,
13254
13258
  direction: "asc"
13255
13259
  });
13256
- }, []), z = useCallback((e, t, n = "text") => {
13257
- v((i) => ({
13260
+ }, []), Ih = useCallback((e, t, n = "text") => {
13261
+ S((i) => ({
13258
13262
  ...i,
13259
13263
  [e]: {
13260
13264
  type: n,
13261
13265
  value: t,
13262
13266
  options: i[e]?.options
13263
13267
  }
13264
- })), E((e) => ({
13268
+ })), P((e) => ({
13265
13269
  ...e,
13266
13270
  page: 1
13267
13271
  }));
13268
- }, []), Th = useCallback((e) => {
13269
- v((t) => {
13272
+ }, []), Lh = useCallback((e) => {
13273
+ S((t) => {
13270
13274
  let n = { ...t };
13271
13275
  return delete n[e], n;
13272
13276
  });
13273
- }, []), Eh = useCallback(() => {
13274
- v({});
13275
- }, []), Dh = useCallback((e) => {
13276
- E((t) => ({
13277
+ }, []), z = useCallback(() => {
13278
+ S({});
13279
+ }, []), Rh = useCallback((e) => {
13280
+ P((t) => ({
13277
13281
  ...t,
13278
13282
  page: e
13279
13283
  }));
13280
- }, []), Oh = useCallback((e) => {
13281
- E((t) => ({
13284
+ }, []), zh = useCallback((e) => {
13285
+ P((t) => ({
13282
13286
  ...t,
13283
13287
  pageSize: e,
13284
13288
  page: 1
13285
13289
  }));
13286
- }, []), kh = useCallback((e) => {
13287
- b(e);
13288
13290
  }, []), B = useCallback((e) => {
13289
- S((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
13290
- }, []), Ah = useCallback((e) => {
13291
- w((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
13292
- }, []), jh = useMemo(() => {
13293
- let e = new Map(n.map((e) => [e.id, e])), t = y.map((t) => e.get(t)).filter(Boolean), i = new Set(t.map((e) => e.id)), a = n.filter((e) => !i.has(e.id));
13294
- return [...t, ...a].filter((e) => !x.includes(e.id));
13291
+ w(e);
13292
+ }, []), Bh = useCallback((e) => {
13293
+ E((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
13294
+ }, []), V = useCallback((e) => {
13295
+ O((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
13296
+ }, []), H = useCallback((e) => {
13297
+ A((t) => {
13298
+ let n = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
13299
+ return v?.(n), n;
13300
+ });
13301
+ }, [v]), U = useCallback((e) => {
13302
+ A((t) => {
13303
+ let n = e.map((e) => typeof _ == "function" ? _(e) : e[_]), i = n.every((e) => t.includes(e)), a;
13304
+ if (i) a = t.filter((e) => !n.includes(e));
13305
+ else {
13306
+ let e = n.filter((e) => !t.includes(e));
13307
+ a = [...t, ...e];
13308
+ }
13309
+ return v?.(a), a;
13310
+ });
13311
+ }, [_, v]), Vh = useCallback((e, t) => {
13312
+ M((n) => ({
13313
+ ...n,
13314
+ [e]: Math.max(50, t)
13315
+ }));
13316
+ }, []), Hh = useMemo(() => {
13317
+ let e = new Map(n.map((e) => [e.id, e])), t = C.map((t) => e.get(t)).filter(Boolean), i = new Set(t.map((e) => e.id)), a = n.filter((e) => !i.has(e.id));
13318
+ return [...t, ...a].filter((e) => !T.includes(e.id));
13295
13319
  }, [
13296
- y,
13320
+ C,
13297
13321
  n,
13298
- x
13299
- ]), Mh = useCallback(() => {
13300
- P((e) => e + 1);
13322
+ T
13323
+ ]), W = useCallback(() => {
13324
+ Mh((e) => e + 1);
13301
13325
  }, []);
13302
13326
  return {
13303
13327
  state: {
13304
13328
  data: t,
13305
- filteredData: I,
13306
- paginatedData: R,
13307
- sortConfig: h,
13308
- filters: _,
13309
- pagination: T,
13310
- columnOrder: y,
13311
- hiddenColumns: x,
13312
- pinnedColumns: C,
13313
- loading: j
13329
+ filteredData: L,
13330
+ paginatedData: Ph,
13331
+ sortConfig: y,
13332
+ filters: x,
13333
+ pagination: N,
13334
+ columnOrder: C,
13335
+ hiddenColumns: T,
13336
+ pinnedColumns: D,
13337
+ selectedRows: k,
13338
+ columnWidths: j,
13339
+ loading: kh
13314
13340
  },
13315
- orderedColumns: jh,
13341
+ orderedColumns: Hh,
13316
13342
  pageSizeOptions: d,
13317
- handleSort: wh,
13318
- handleFilter: z,
13319
- clearFilter: Th,
13320
- clearAllFilters: Eh,
13321
- handlePageChange: Dh,
13322
- handlePageSizeChange: Oh,
13323
- handleColumnReorder: kh,
13324
- handleToggleColumn: B,
13325
- handleTogglePin: Ah,
13343
+ handleSort: Fh,
13344
+ handleFilter: Ih,
13345
+ clearFilter: Lh,
13346
+ clearAllFilters: z,
13347
+ handlePageChange: Rh,
13348
+ handlePageSizeChange: zh,
13349
+ handleColumnReorder: B,
13350
+ handleToggleColumn: Bh,
13351
+ handleTogglePin: V,
13352
+ handleRowSelect: H,
13353
+ handleSelectAll: U,
13354
+ handleColumnResize: Vh,
13326
13355
  allColumns: n,
13327
- refresh: Mh
13356
+ refresh: W
13328
13357
  };
13329
13358
  };
13330
13359
  var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilters: i = {}, defaultPageSize: a = 10, pageSizeOptions: u = [
@@ -13349,8 +13378,8 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13349
13378
  },
13350
13379
  clearAllFilters: "Limpiar todos los filtros",
13351
13380
  noData: "No hay datos disponibles"
13352
- }, enableColumnReordering: A = !0, enableColumnPinning: j = !1, renderActions: M, actionsColumnLabel: N, loading: P = !1, fetchData: F, onRefresh: I }) => {
13353
- let [L, R] = useState(null), [wh, z] = useState(null), [Th, Eh] = useState(!1), [Dh, Oh] = useState(null), kh = useRef(null), [B, Ah] = useState(t), { state: jh, orderedColumns: Mh, handleSort: Nh, handleFilter: Ph, clearAllFilters: Fh, handlePageChange: V, handlePageSizeChange: Ih, handleColumnReorder: H, handleToggleColumn: U, handleTogglePin: Lh, refresh: Rh } = useAdvancedTable({
13381
+ }, enableColumnReordering: A = !0, enableColumnPinning: j = !1, enableColumnResizing: M = !1, enableRowSelection: N = !1, stickyActionsColumn: P = !1, rowKey: F = "id", onRowSelectionChange: Dh, renderActions: I, actionsColumnLabel: Oh, loading: kh = !1, fetchData: Ah, onRefresh: jh, onPaginationChange: Mh, onFiltersChange: Nh }) => {
13382
+ let [L, R] = useState(null), [Ph, Fh] = useState(null), [Ih, Lh] = useState(!1), [z, Rh] = useState(null), zh = useRef(null), [B, Bh] = useState(t), { state: V, orderedColumns: H, handleSort: U, handleFilter: Vh, clearAllFilters: Hh, handlePageChange: W, handlePageSizeChange: Uh, handleColumnReorder: Wh, handleToggleColumn: Gh, handleTogglePin: Kh, handleRowSelect: qh, handleSelectAll: Jh, handleColumnResize: G, refresh: Yh } = useAdvancedTable({
13354
13383
  data: e,
13355
13384
  columns: B,
13356
13385
  defaultSort: n,
@@ -13359,16 +13388,42 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13359
13388
  pageSizeOptions: u,
13360
13389
  initialConfig: E,
13361
13390
  onConfigChange: D,
13362
- fetchData: F
13363
- }), { paginatedData: zh, sortConfig: W, filters: G, pagination: K, hiddenColumns: Bh, pinnedColumns: q, loading: Vh } = jh, Hh = P || Vh;
13364
- useEffect(() => Ah(t), [t]);
13365
- let J = useMemo(() => {
13366
- let e = [...Mh], t = e.filter((e) => e.isAction), n = [...e.filter((e) => !e.isAction), ...t];
13367
- return M && n.push({
13391
+ fetchData: Ah,
13392
+ onPaginationChange: Mh,
13393
+ onFiltersChange: Nh,
13394
+ rowKey: F,
13395
+ onRowSelectionChange: Dh
13396
+ }), { paginatedData: K, sortConfig: q, filters: J, pagination: Y, hiddenColumns: Xh, pinnedColumns: X, selectedRows: Zh, columnWidths: Qh, loading: $h } = V, eg = kh || $h;
13397
+ useEffect(() => Bh(t), [t]);
13398
+ let Z = useMemo(() => {
13399
+ let e = [...H], t = e.filter((e) => e.isAction), n = [...e.filter((e) => !e.isAction), ...t];
13400
+ return N && n.unshift({
13401
+ id: "selection-synthetic",
13402
+ label: "",
13403
+ accessor: (e) => e,
13404
+ width: 50,
13405
+ minWidth: 50,
13406
+ render: ({ row: e }) => {
13407
+ let t = typeof F == "function" ? F(e) : e[F];
13408
+ return /* @__PURE__ */ jsx("input", {
13409
+ type: "checkbox",
13410
+ className: "w-4 h-4 accent-redi-primary cursor-pointer",
13411
+ checked: Zh.includes(t),
13412
+ onChange: (e) => {
13413
+ e.stopPropagation(), qh(t);
13414
+ },
13415
+ onClick: (e) => e.stopPropagation()
13416
+ });
13417
+ },
13418
+ isAction: !1,
13419
+ filterable: !1,
13420
+ sortable: !1,
13421
+ draggable: !1
13422
+ }), I && n.push({
13368
13423
  id: "actions-synthetic",
13369
- label: N || "",
13424
+ label: Oh || "",
13370
13425
  accessor: (e) => e,
13371
- render: ({ row: e, column: t, index: n }) => M({
13426
+ render: ({ row: e, column: t, index: n }) => I({
13372
13427
  row: e,
13373
13428
  index: n,
13374
13429
  column: t
@@ -13380,33 +13435,56 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13380
13435
  draggable: !1
13381
13436
  }), n;
13382
13437
  }, [
13383
- Mh,
13384
- M,
13385
- N
13386
- ]), Uh = (e, t) => {
13438
+ H,
13439
+ I,
13440
+ Oh,
13441
+ N,
13442
+ Zh,
13443
+ F,
13444
+ qh
13445
+ ]), tg = useRef(null);
13446
+ useEffect(() => {
13447
+ let e = (e) => {
13448
+ if (!tg.current) return;
13449
+ let { columnId: t, startX: n, startWidth: i } = tg.current, a = e.clientX - n;
13450
+ G(t, i + a);
13451
+ }, t = () => {
13452
+ tg.current = null, document.body.style.cursor = "default", document.body.style.userSelect = "auto";
13453
+ };
13454
+ if (M) return document.addEventListener("mousemove", e), document.addEventListener("mouseup", t), () => {
13455
+ document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", t);
13456
+ };
13457
+ }, [M, G]);
13458
+ let ng = (e, t, n) => {
13459
+ e.preventDefault(), e.stopPropagation(), tg.current = {
13460
+ columnId: t,
13461
+ startX: e.clientX,
13462
+ startWidth: n
13463
+ }, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
13464
+ }, rg = (e, t) => {
13387
13465
  R(t), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/html", "");
13388
- }, Wh = (e, t) => {
13389
- e.preventDefault(), e.dataTransfer.dropEffect = "move", z(t);
13390
- }, Y = () => {
13391
- z(null);
13392
- }, Gh = (e, t) => {
13466
+ }, ig = (e, t) => {
13467
+ e.preventDefault(), e.dataTransfer.dropEffect = "move", Fh(t);
13468
+ }, ag = () => {
13469
+ Fh(null);
13470
+ }, og = (e, t) => {
13393
13471
  if (e.preventDefault(), L === null) return;
13394
- let n = J[L].id, i = J[t].id;
13472
+ let n = Z[L].id, i = Z[t].id;
13395
13473
  if (n === i) {
13396
- R(null), z(null);
13474
+ R(null), Fh(null);
13397
13475
  return;
13398
13476
  }
13399
- let a = e.currentTarget.getBoundingClientRect(), o = e.clientX - a.left > a.width / 2, s = [...jh.columnOrder], c = s.indexOf(n), l = s.indexOf(i);
13400
- c === -1 || l === -1 || (s.splice(c, 1), l = s.indexOf(i), o ? s.splice(l + 1, 0, n) : s.splice(l, 0, n), H(s), R(null), z(null));
13401
- }, Kh = () => {
13402
- R(null), z(null);
13403
- }, qh = () => {
13477
+ let a = e.currentTarget.getBoundingClientRect(), o = e.clientX - a.left > a.width / 2, s = [...V.columnOrder], c = s.indexOf(n), l = s.indexOf(i);
13478
+ c === -1 || l === -1 || (s.splice(c, 1), l = s.indexOf(i), o ? s.splice(l + 1, 0, n) : s.splice(l, 0, n), Wh(s), R(null), Fh(null));
13479
+ }, sg = () => {
13480
+ R(null), Fh(null);
13481
+ }, cg = () => {
13404
13482
  if (!T) return;
13405
- let e = J.filter((e) => !e.isAction);
13406
- exportToExcel(jh.filteredData, e, "table-data.xlsx");
13407
- }, X = (e) => {
13408
- Oh(Dh === e ? null : e);
13409
- }, Jh = (t) => {
13483
+ let e = Z.filter((e) => !e.isAction);
13484
+ exportToExcel(V.filteredData, e, "table-data.xlsx");
13485
+ }, lg = (e) => {
13486
+ Rh(z === e ? null : e);
13487
+ }, ug = (t) => {
13410
13488
  let n = B.find((e) => e.id === t);
13411
13489
  if (!n) return [];
13412
13490
  let i = /* @__PURE__ */ new Map();
@@ -13418,16 +13496,16 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13418
13496
  count: t,
13419
13497
  label: `${e} (${t})`
13420
13498
  })).sort((e, t) => e.value.localeCompare(t.value));
13421
- }, Yh = Object.values(G).some((e) => e.type === "text" && e.value || e.type === "select" && e.value || e.type === "multiselect" && Array.isArray(e.value) && e.value.length > 0);
13499
+ }, dg = Object.values(J).some((e) => e.type === "text" && e.value || e.type === "select" && e.value || e.type === "multiselect" && Array.isArray(e.value) && e.value.length > 0);
13422
13500
  useEffect(() => {
13423
13501
  let e = (e) => {
13424
- kh.current && !kh.current.contains(e.target) && Eh(!1);
13502
+ zh.current && !zh.current.contains(e.target) && Lh(!1);
13425
13503
  };
13426
- return Th && document.addEventListener("mousedown", e), () => {
13504
+ return Ih && document.addEventListener("mousedown", e), () => {
13427
13505
  document.removeEventListener("mousedown", e);
13428
13506
  };
13429
- }, [Th]);
13430
- let Z = Math.ceil(K.total / K.pageSize), Q = (e) => e.width ? e.width : e.isAction ? 100 : 150 + (e.filterable ? 50 : 0);
13507
+ }, [Ih]);
13508
+ let Q = Math.ceil(Y.total / Y.pageSize), fg = (e) => Qh[e.id] ? Qh[e.id] : e.width ? e.width : e.isAction ? 100 : 150 + (e.filterable ? 50 : 0);
13431
13509
  return /* @__PURE__ */ jsxs("div", {
13432
13510
  className: `w-full bg-redi-background border border-solid border-gray-500 rounded-xl overflow-hidden font-family-base shadow ${O}`,
13433
13511
  children: [
@@ -13436,26 +13514,26 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13436
13514
  children: [/* @__PURE__ */ jsxs("div", {
13437
13515
  className: "flex items-center gap-2",
13438
13516
  children: [
13439
- (F || I) && /* @__PURE__ */ jsx(Button_default, {
13517
+ (Ah || jh) && /* @__PURE__ */ jsx(Button_default, {
13440
13518
  level: "secondary",
13441
13519
  onClick: () => {
13442
- Rh(), I?.();
13520
+ Yh(), jh?.();
13443
13521
  },
13444
- loading: Hh,
13522
+ loading: eg,
13445
13523
  children: /* @__PURE__ */ jsx(RefreshIcon, { size: 18 })
13446
13524
  }),
13447
13525
  /* @__PURE__ */ jsxs("div", {
13448
13526
  className: "relative",
13449
13527
  children: [/* @__PURE__ */ jsxs(Button_default, {
13450
13528
  level: "secondary",
13451
- onClick: () => Eh(!Th),
13529
+ onClick: () => Lh(!Ih),
13452
13530
  children: [/* @__PURE__ */ jsx(EyeIcon, {}), /* @__PURE__ */ jsx("span", {
13453
13531
  className: "hidden md:block",
13454
13532
  children: k.configuration
13455
13533
  })]
13456
- }), Th && /* @__PURE__ */ jsx("div", {
13534
+ }), Ih && /* @__PURE__ */ jsx("div", {
13457
13535
  className: "absolute top-full left-0 bg-white border border-solid border-gray-300 rounded-md shadow-lg z-1000 mt-2 min-w-2xs max-w-xs opacity-100 visible p-4",
13458
- ref: kh,
13536
+ ref: zh,
13459
13537
  children: /* @__PURE__ */ jsxs("div", {
13460
13538
  className: "mb-4 last:mb-0",
13461
13539
  children: [/* @__PURE__ */ jsx("div", {
@@ -13464,7 +13542,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13464
13542
  }), /* @__PURE__ */ jsx("div", {
13465
13543
  className: "flex flex-col gap-2",
13466
13544
  children: B.filter((e) => !e.isAction).map((e) => {
13467
- let t = !Bh.includes(e.id);
13545
+ let t = !Xh.includes(e.id);
13468
13546
  return /* @__PURE__ */ jsxs("div", {
13469
13547
  className: "flex items-center justify-between gap-2 hover:bg-gray-50 p-1 rounded",
13470
13548
  children: [/* @__PURE__ */ jsxs("div", {
@@ -13473,7 +13551,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13473
13551
  type: "checkbox",
13474
13552
  className: "w-4 h-4 accent-redi-primary cursor-pointer",
13475
13553
  checked: t,
13476
- onChange: () => U(e.id),
13554
+ onChange: () => Gh(e.id),
13477
13555
  id: `col-visibility-${e.id}`
13478
13556
  }), /* @__PURE__ */ jsx("label", {
13479
13557
  htmlFor: `col-visibility-${e.id}`,
@@ -13486,11 +13564,11 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13486
13564
  j && /* @__PURE__ */ jsx(Button_default, {
13487
13565
  level: "icon",
13488
13566
  onClick: (t) => {
13489
- t.stopPropagation(), Lh(e.id);
13567
+ t.stopPropagation(), Kh(e.id);
13490
13568
  },
13491
- "aria-label": q.includes(e.id) ? "Unpin column" : "Pin column",
13569
+ "aria-label": X.includes(e.id) ? "Unpin column" : "Pin column",
13492
13570
  className: "p-1 hover:bg-gray-200 rounded-full",
13493
- children: q.includes(e.id) ? /* @__PURE__ */ jsx(PinIcon, {
13571
+ children: X.includes(e.id) ? /* @__PURE__ */ jsx(PinIcon, {
13494
13572
  size: 14,
13495
13573
  className: "text-redi-primary"
13496
13574
  }) : /* @__PURE__ */ jsx(PinOffIcon, {
@@ -13506,7 +13584,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13506
13584
  ...t,
13507
13585
  draggable: !t.draggable
13508
13586
  } : t);
13509
- Ah(n);
13587
+ Bh(n);
13510
13588
  },
13511
13589
  "aria-label": e.draggable ? "Disable drag" : "Enable drag",
13512
13590
  className: "p-1 hover:bg-gray-200 rounded-full",
@@ -13524,7 +13602,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13524
13602
  ...t,
13525
13603
  filterable: !t.filterable
13526
13604
  } : t);
13527
- Ah(n);
13605
+ Bh(n);
13528
13606
  },
13529
13607
  "aria-label": e.filterable ? "Disable filter" : "Enable filter",
13530
13608
  className: "p-1 hover:bg-gray-200 rounded-full",
@@ -13544,9 +13622,9 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13544
13622
  })
13545
13623
  })]
13546
13624
  }),
13547
- C && Yh && /* @__PURE__ */ jsx(Button_default, {
13625
+ C && dg && /* @__PURE__ */ jsx(Button_default, {
13548
13626
  level: "icon",
13549
- onClick: Fh,
13627
+ onClick: Hh,
13550
13628
  label: k.clearAllFilters,
13551
13629
  children: /* @__PURE__ */ jsx(CloseIcon, { color: "white" })
13552
13630
  })
@@ -13555,7 +13633,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13555
13633
  className: "flex items-center gap-2",
13556
13634
  children: T && /* @__PURE__ */ jsx(Button_default, {
13557
13635
  level: "secondary",
13558
- onClick: qh,
13636
+ onClick: cg,
13559
13637
  children: /* @__PURE__ */ jsx(DownloadIcon, { size: 18 })
13560
13638
  })
13561
13639
  })]
@@ -13565,9 +13643,9 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13565
13643
  children: /* @__PURE__ */ jsxs("table", {
13566
13644
  className: "w-full border-separate border-spacing-0 table-auto text-sm relative",
13567
13645
  "aria-label": "Data Table",
13568
- children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: J.map((e, t) => {
13569
- let n = Q(e), i = q.includes(e.id), a = 0;
13570
- if (i) for (let e = 0; e < t; e++) q.includes(J[e].id) && (a += Q(J[e]));
13646
+ children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: Z.map((e, t) => {
13647
+ let n = fg(e), i = X.includes(e.id), a = 0;
13648
+ if (i) for (let e = 0; e < t; e++) X.includes(Z[e].id) && (a += fg(Z[e]));
13571
13649
  let o = {
13572
13650
  width: n,
13573
13651
  minWidth: n,
@@ -13582,71 +13660,89 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13582
13660
  return /* @__PURE__ */ jsx("th", {
13583
13661
  className: `bg-gray-50 border-b border-solid border-gray-200 text-left font-semibold text-redi-text p-0 sticky top-0 z-10 select-none hover:bg-gray-200
13584
13662
  ${L === t ? "opacity-50 bg-gray-300" : ""}
13585
- ${wh === t ? "bg-redi-primary-bg border-l border-solid border-redi-primary" : ""}
13586
- ${wh === t ? "bg-redi-primary-bg border-l border-solid border-redi-primary" : ""}
13663
+ ${Ph === t ? "bg-redi-primary-bg border-l border-solid border-redi-primary" : ""}
13664
+ ${Ph === t ? "bg-redi-primary-bg border-l border-solid border-redi-primary" : ""}
13587
13665
  ${i ? "shadow-[2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
13588
13666
  `,
13589
13667
  style: o,
13590
13668
  draggable: !e.isAction && A && (e.draggable ?? !1),
13591
- onDragStart: (n) => !e.isAction && A && (e.draggable ?? !1) && Uh(n, t),
13592
- onDragOver: (n) => !e.isAction && A && Wh(n, t),
13593
- onDragLeave: Y,
13594
- onDrop: (n) => !e.isAction && A && Gh(n, t),
13595
- onDragEnd: Kh,
13596
- "aria-sort": W?.column === e.id ? W.direction === "asc" ? "ascending" : "descending" : "none",
13669
+ onDragStart: (n) => !e.isAction && A && (e.draggable ?? !1) && rg(n, t),
13670
+ onDragOver: (n) => !e.isAction && A && ig(n, t),
13671
+ onDragLeave: ag,
13672
+ onDrop: (n) => !e.isAction && A && og(n, t),
13673
+ onDragEnd: sg,
13674
+ "aria-sort": q?.column === e.id ? q.direction === "asc" ? "ascending" : "descending" : "none",
13597
13675
  children: /* @__PURE__ */ jsxs("div", {
13598
13676
  className: "flex items-center py-3 px-4 gap-2 min-h-12",
13599
- children: [!e.isAction && A && (e.draggable ?? !1) && /* @__PURE__ */ jsx("div", {
13600
- className: "text-gray-600 cursor-grab opacity-70 hover:opacity-100 text-base",
13601
- "aria-hidden": "true",
13602
- children: "⋮⋮"
13603
- }), /* @__PURE__ */ jsxs("div", {
13604
- className: "flex flex-1 items-center gap-2",
13605
- children: [/* @__PURE__ */ jsxs("span", {
13606
- className: h ? "cursor-pointer py-1 px-1.5 rounded-sm flex items-center gap-1.5 text-sm font-semibold text-redi-text uppercase hover:bg-redi-background hover:text-redi-link-text" : "",
13607
- onClick: (t) => {
13608
- t.stopPropagation(), e.sortable && Nh(e.id);
13609
- },
13610
- role: "button",
13611
- tabIndex: 0,
13612
- onKeyDown: (t) => {
13613
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), e.sortable && Nh(e.id));
13614
- },
13615
- children: [e.label, e.sortable && W?.column === e.id && /* @__PURE__ */ jsx("span", {
13616
- className: "font-bold text-redi-link-text text-base",
13617
- children: W.direction === "asc" ? " " : " ↓"
13618
- })]
13619
- }), /* @__PURE__ */ jsx("div", {
13620
- className: "flex items-center gap-1",
13621
- children: e.filterable && /* @__PURE__ */ jsxs("div", {
13622
- className: "relative",
13623
- children: [/* @__PURE__ */ jsx(Button_default, {
13624
- level: "icon",
13625
- onClick: (t) => {
13626
- t.stopPropagation(), X(e.id);
13627
- },
13628
- "aria-label": `Filter by ${e.label}`,
13629
- children: /* @__PURE__ */ jsx(FilterIcon, { size: 16 })
13630
- }), Dh === e.id && /* @__PURE__ */ jsx(AdvancedFilter_default, {
13631
- columnId: e.id,
13632
- label: e.label,
13633
- options: Jh(e.id),
13634
- textValue: G[e.id]?.type === "text" ? String(G[e.id].value || "") : "",
13635
- selectedValues: G[e.id]?.type === "multiselect" && Array.isArray(G[e.id]?.value) ? G[e.id].value : [],
13636
- onTextChange: (t) => Ph(e.id, t, "text"),
13637
- onSelectionChange: (t) => Ph(e.id, t, "multiselect"),
13638
- onClose: () => Oh(null)
13677
+ children: [
13678
+ !e.isAction && A && (e.draggable ?? !1) && /* @__PURE__ */ jsx("div", {
13679
+ className: "text-gray-600 cursor-grab opacity-70 hover:opacity-100 text-base",
13680
+ "aria-hidden": "true",
13681
+ children: "⋮⋮"
13682
+ }),
13683
+ e.id === "selection-synthetic" && /* @__PURE__ */ jsx("input", {
13684
+ type: "checkbox",
13685
+ className: "w-4 h-4 accent-redi-primary cursor-pointer mr-2",
13686
+ checked: K.length > 0 && K.every((e) => {
13687
+ let t = typeof F == "function" ? F(e) : e[F];
13688
+ return Zh.includes(t);
13689
+ }),
13690
+ onChange: (e) => {
13691
+ e.stopPropagation(), Jh(K);
13692
+ }
13693
+ }),
13694
+ /* @__PURE__ */ jsxs("div", {
13695
+ className: "flex flex-1 items-center gap-2",
13696
+ children: [/* @__PURE__ */ jsxs("span", {
13697
+ className: h ? "cursor-pointer py-1 px-1.5 rounded-sm flex items-center gap-1.5 text-sm font-semibold text-redi-text uppercase hover:bg-redi-background hover:text-redi-link-text" : "",
13698
+ onClick: (t) => {
13699
+ t.stopPropagation(), e.sortable && U(e.id);
13700
+ },
13701
+ role: "button",
13702
+ tabIndex: 0,
13703
+ onKeyDown: (t) => {
13704
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), e.sortable && U(e.id));
13705
+ },
13706
+ children: [e.label, e.sortable && q?.column === e.id && /* @__PURE__ */ jsx("span", {
13707
+ className: "font-bold text-redi-link-text text-base",
13708
+ children: q.direction === "asc" ? " ↑" : " ↓"
13639
13709
  })]
13640
- })
13641
- })]
13642
- })]
13710
+ }), /* @__PURE__ */ jsx("div", {
13711
+ className: "flex items-center gap-1",
13712
+ children: e.filterable && /* @__PURE__ */ jsxs("div", {
13713
+ className: "relative",
13714
+ children: [/* @__PURE__ */ jsx(Button_default, {
13715
+ level: "icon",
13716
+ onClick: (t) => {
13717
+ t.stopPropagation(), lg(e.id);
13718
+ },
13719
+ "aria-label": `Filter by ${e.label}`,
13720
+ children: /* @__PURE__ */ jsx(FilterIcon, { size: 16 })
13721
+ }), z === e.id && /* @__PURE__ */ jsx(AdvancedFilter_default, {
13722
+ columnId: e.id,
13723
+ label: e.label,
13724
+ options: ug(e.id),
13725
+ textValue: J[e.id]?.type === "text" ? String(J[e.id].value || "") : "",
13726
+ selectedValues: J[e.id]?.type === "multiselect" && Array.isArray(J[e.id]?.value) ? J[e.id].value : [],
13727
+ onTextChange: (t) => Vh(e.id, t, "text"),
13728
+ onSelectionChange: (t) => Vh(e.id, t, "multiselect"),
13729
+ onClose: () => Rh(null)
13730
+ })]
13731
+ })
13732
+ })]
13733
+ }),
13734
+ M && !e.isAction && e.id !== "selection-synthetic" && /* @__PURE__ */ jsx("div", {
13735
+ className: "absolute right-0 top-0 bottom-0 w-1 cursor-col-resize hover:bg-redi-primary z-20",
13736
+ onMouseDown: (t) => ng(t, e.id, n)
13737
+ })
13738
+ ]
13643
13739
  })
13644
13740
  }, e.id);
13645
- }) }) }), /* @__PURE__ */ jsx("tbody", { children: P ? Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ jsx("tr", {
13741
+ }) }) }), /* @__PURE__ */ jsx("tbody", { children: kh ? Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ jsx("tr", {
13646
13742
  className: "border-b border-solid border-gray-100",
13647
- children: J.map((e, t) => {
13648
- let n = Q(e), i = q.includes(e.id), a = 0;
13649
- if (i) for (let e = 0; e < t; e++) q.includes(J[e].id) && (a += Q(J[e]));
13743
+ children: Z.map((e, t) => {
13744
+ let n = fg(e), i = X.includes(e.id), a = 0;
13745
+ if (i) for (let e = 0; e < t; e++) X.includes(Z[e].id) && (a += fg(Z[e]));
13650
13746
  let o = {
13651
13747
  width: n,
13652
13748
  minWidth: n,
@@ -13664,29 +13760,36 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13664
13760
  children: /* @__PURE__ */ jsx("div", { className: "h-4 bg-gray-200 rounded animate-pulse w-3/4" })
13665
13761
  }, `skeleton-cell-${t}`);
13666
13762
  })
13667
- }, `skeleton-${t}`)) : zh.length > 0 ? zh.map((e, t) => /* @__PURE__ */ jsx("tr", {
13763
+ }, `skeleton-${t}`)) : K.length > 0 ? K.map((e, t) => /* @__PURE__ */ jsx("tr", {
13668
13764
  className: "even:bg-gray-50 hover:bg-gray-100 border-b border-solid border-b-gray-100 odd:bg-white",
13669
- children: J.map((n, i) => {
13670
- let a = typeof n.accessor == "function" ? n.accessor(e) : e[n.accessor], o = n.isAction, s = Q(n), c = q.includes(n.id), l = 0;
13671
- if (c) for (let e = 0; e < i; e++) q.includes(J[e].id) && (l += Q(J[e]));
13672
- let u = `py-3 px-4 text-redi-text font-normal leading-6 align-middle border-r border-solid border-r-gray-300 static table-cell last:border-r-0 first:font-medium
13673
- ${o ? "border-l border-gray-300 shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.05)]" : ""}
13765
+ children: Z.map((n, i) => {
13766
+ let a = typeof n.accessor == "function" ? n.accessor(e) : e[n.accessor], o = n.isAction, s = fg(n), c = X.includes(n.id), l = o && P, u = 0;
13767
+ if (c) for (let e = 0; e < i; e++) X.includes(Z[e].id) && (u += fg(Z[e]));
13768
+ let f = `py-3 px-4 text-redi-text font-normal leading-6 align-middle border-r border-solid border-r-gray-300 static table-cell last:border-r-0 first:font-medium
13769
+ ${o ? "border-l border-gray-300" : ""}
13674
13770
  ${c ? "shadow-[2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
13675
- `, f = {
13771
+ `, p = {
13676
13772
  width: s,
13677
13773
  minWidth: s,
13678
13774
  maxWidth: s,
13679
13775
  overflowWrap: "break-word",
13680
13776
  ...c ? {
13681
13777
  position: "sticky",
13682
- left: l,
13778
+ left: u,
13683
13779
  zIndex: 10,
13684
13780
  backgroundColor: "inherit"
13781
+ } : {},
13782
+ ...l ? {
13783
+ position: "sticky",
13784
+ right: 0,
13785
+ zIndex: 15,
13786
+ backgroundColor: "inherit",
13787
+ boxShadow: "-2px 0 5px -2px rgba(0,0,0,0.1)"
13685
13788
  } : {}
13686
13789
  };
13687
13790
  return n.render ? /* @__PURE__ */ jsx("td", {
13688
- className: u,
13689
- style: f,
13791
+ className: f,
13792
+ style: p,
13690
13793
  children: n.render({
13691
13794
  value: a,
13692
13795
  row: e,
@@ -13694,13 +13797,13 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13694
13797
  index: t
13695
13798
  })
13696
13799
  }, n.id) : /* @__PURE__ */ jsx("td", {
13697
- className: u,
13698
- style: f,
13800
+ className: f,
13801
+ style: p,
13699
13802
  children: formatCellValue(a)
13700
13803
  }, n.id);
13701
13804
  })
13702
13805
  }, t)) : /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
13703
- colSpan: J.length,
13806
+ colSpan: Z.length,
13704
13807
  className: "py-12 text-center text-gray-500",
13705
13808
  children: /* @__PURE__ */ jsxs("div", {
13706
13809
  className: "flex flex-col items-center justify-center gap-2",
@@ -13730,15 +13833,15 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13730
13833
  children: /* @__PURE__ */ jsxs("span", { children: [
13731
13834
  k.pagination?.showingItems,
13732
13835
  " ",
13733
- (K.page - 1) * K.pageSize + 1,
13836
+ (Y.page - 1) * Y.pageSize + 1,
13734
13837
  " ",
13735
13838
  k.pagination?.to,
13736
13839
  " ",
13737
- Math.min(K.page * K.pageSize, K.total),
13840
+ Math.min(Y.page * Y.pageSize, Y.total),
13738
13841
  " ",
13739
13842
  k.pagination?.of,
13740
13843
  " ",
13741
- K.total,
13844
+ Y.total,
13742
13845
  " ",
13743
13846
  k.pagination?.items
13744
13847
  ] })
@@ -13749,8 +13852,8 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13749
13852
  children: [
13750
13853
  k.pagination?.showPerPage,
13751
13854
  /* @__PURE__ */ jsx("select", {
13752
- value: K.pageSize,
13753
- onChange: (e) => Ih(Number(e.target.value)),
13855
+ value: Y.pageSize,
13856
+ onChange: (e) => Uh(Number(e.target.value)),
13754
13857
  className: "py-1.5 px-2.5 border border-solid border-gray-300 rounded-md bg-white text-redi-text focus:outline-none focus:ring-2 focus:ring-redi-primary",
13755
13858
  children: u.map((e) => /* @__PURE__ */ jsx("option", {
13756
13859
  value: e,
@@ -13764,34 +13867,34 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13764
13867
  children: [
13765
13868
  /* @__PURE__ */ jsx(Button_default, {
13766
13869
  level: "icon",
13767
- onClick: () => V(1),
13768
- disabled: K.page === 1,
13870
+ onClick: () => W(1),
13871
+ disabled: Y.page === 1,
13769
13872
  children: "<<"
13770
13873
  }),
13771
13874
  /* @__PURE__ */ jsx(Button_default, {
13772
13875
  level: "icon",
13773
- onClick: () => V(K.page - 1),
13774
- disabled: K.page === 1,
13876
+ onClick: () => W(Y.page - 1),
13877
+ disabled: Y.page === 1,
13775
13878
  children: "<"
13776
13879
  }),
13777
- Array.from({ length: Math.min(3, Z) }, (e, t) => {
13880
+ Array.from({ length: Math.min(3, Q) }, (e, t) => {
13778
13881
  let n;
13779
- return n = Z <= 3 || K.page <= 2 ? t + 1 : K.page > Z - 2 ? Z - 2 + t : K.page - 1 + t, /* @__PURE__ */ jsx(Button_default, {
13780
- level: K.page === n ? "primary" : "secondary",
13781
- onClick: () => V(n),
13882
+ return n = Q <= 3 || Y.page <= 2 ? t + 1 : Y.page > Q - 2 ? Q - 2 + t : Y.page - 1 + t, /* @__PURE__ */ jsx(Button_default, {
13883
+ level: Y.page === n ? "primary" : "secondary",
13884
+ onClick: () => W(n),
13782
13885
  children: n
13783
13886
  }, n);
13784
13887
  }),
13785
13888
  /* @__PURE__ */ jsx(Button_default, {
13786
13889
  level: "icon",
13787
- onClick: () => V(K.page + 1),
13788
- disabled: K.page === Z,
13890
+ onClick: () => W(Y.page + 1),
13891
+ disabled: Y.page === Q,
13789
13892
  children: ">"
13790
13893
  }),
13791
13894
  /* @__PURE__ */ jsx(Button_default, {
13792
13895
  level: "icon",
13793
- onClick: () => V(Z),
13794
- disabled: K.page === Z,
13896
+ onClick: () => W(Q),
13897
+ disabled: Y.page === Q,
13795
13898
  children: ">>"
13796
13899
  })
13797
13900
  ]
@@ -13800,6 +13903,284 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
13800
13903
  })
13801
13904
  ]
13802
13905
  });
13906
+ }, Sparkline = ({ data: e, color: t = "currentColor", height: n = 40 }) => {
13907
+ if (!e || e.length < 2) return null;
13908
+ let i = Math.max(...e), a = Math.min(...e), o = i - a || 1, s = e.map((t, i) => {
13909
+ let s = i / (e.length - 1) * 100, c = n - (t - a) / o * n;
13910
+ return `${s},${c}`;
13911
+ }).join(" "), c = `0,${n} ${s} 100,${n}`;
13912
+ return /* @__PURE__ */ jsxs("svg", {
13913
+ viewBox: `0 0 100 ${n}`,
13914
+ className: "w-full h-full overflow-visible",
13915
+ preserveAspectRatio: "none",
13916
+ children: [
13917
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", {
13918
+ id: `gradient-${t}`,
13919
+ x1: "0",
13920
+ x2: "0",
13921
+ y1: "0",
13922
+ y2: "1",
13923
+ children: [/* @__PURE__ */ jsx("stop", {
13924
+ offset: "0%",
13925
+ stopColor: t,
13926
+ stopOpacity: "0.2"
13927
+ }), /* @__PURE__ */ jsx("stop", {
13928
+ offset: "100%",
13929
+ stopColor: t,
13930
+ stopOpacity: "0"
13931
+ })]
13932
+ }) }),
13933
+ /* @__PURE__ */ jsx("polygon", {
13934
+ points: c,
13935
+ fill: `url(#gradient-${t})`
13936
+ }),
13937
+ /* @__PURE__ */ jsx("polyline", {
13938
+ points: s,
13939
+ fill: "none",
13940
+ stroke: t,
13941
+ strokeWidth: "2",
13942
+ vectorEffect: "non-scaling-stroke",
13943
+ strokeLinecap: "round",
13944
+ strokeLinejoin: "round"
13945
+ })
13946
+ ]
13947
+ });
13948
+ }, CircularProgress = ({ progress: e, color: t = "currentColor", size: n = 60 }) => {
13949
+ let i = 2 * Math.PI * 26, a = i - e / 100 * i;
13950
+ return /* @__PURE__ */ jsxs("svg", {
13951
+ width: n,
13952
+ height: n,
13953
+ viewBox: "0 0 60 60",
13954
+ className: "transform -rotate-90",
13955
+ children: [/* @__PURE__ */ jsx("circle", {
13956
+ cx: "30",
13957
+ cy: "30",
13958
+ r: 26,
13959
+ stroke: "#e5e7eb",
13960
+ strokeWidth: "6",
13961
+ fill: "transparent"
13962
+ }), /* @__PURE__ */ jsx("circle", {
13963
+ cx: "30",
13964
+ cy: "30",
13965
+ r: 26,
13966
+ stroke: t,
13967
+ strokeWidth: "6",
13968
+ fill: "transparent",
13969
+ strokeDasharray: i,
13970
+ strokeDashoffset: a,
13971
+ strokeLinecap: "round"
13972
+ })]
13973
+ });
13974
+ }, KPI_default = ({ variant: e = "simple", title: t, value: n, progress: i = 0, trendValue: a, trendDirection: o = "neutral", icon: c, chartData: l, color: u, footer: p, subtitle: m, className: h = "" }) => {
13975
+ let g = useMemo(() => o === "up" ? "text-green-500" : o === "down" ? "text-red-500" : "text-gray-500", [o]), _ = useMemo(() => o === "up" ? "↑" : o === "down" ? "↓" : "−", [o]), v = "rounded-lg border border-redi-border bg-white p-4 shadow-sm relative overflow-hidden transition-all duration-200 hover:shadow-md", y = u || "#1890ff";
13976
+ return e === "simple" ? /* @__PURE__ */ jsxs("div", {
13977
+ className: `${v} ${h}`,
13978
+ children: [/* @__PURE__ */ jsx("p", {
13979
+ className: "text-sm text-gray-500 font-medium mb-1",
13980
+ children: t
13981
+ }), /* @__PURE__ */ jsx("h3", {
13982
+ className: "text-2xl font-bold text-gray-900",
13983
+ children: n
13984
+ })]
13985
+ }) : e === "chart" ? /* @__PURE__ */ jsxs("div", {
13986
+ className: `${v} ${h}`,
13987
+ children: [/* @__PURE__ */ jsxs("div", {
13988
+ className: "relative z-10",
13989
+ children: [/* @__PURE__ */ jsx("p", {
13990
+ className: "text-sm text-gray-500 font-medium mb-1",
13991
+ children: t
13992
+ }), /* @__PURE__ */ jsx("h3", {
13993
+ className: "text-2xl font-bold text-gray-900",
13994
+ children: n
13995
+ })]
13996
+ }), /* @__PURE__ */ jsx("div", {
13997
+ className: "absolute bottom-0 left-0 right-0 h-12 opacity-50",
13998
+ children: l && /* @__PURE__ */ jsx(Sparkline, {
13999
+ data: l,
14000
+ color: y
14001
+ })
14002
+ })]
14003
+ }) : e === "trend" ? /* @__PURE__ */ jsxs("div", {
14004
+ className: `${v} ${h}`,
14005
+ children: [/* @__PURE__ */ jsx("p", {
14006
+ className: "text-sm text-gray-500 font-medium mb-1",
14007
+ children: t
14008
+ }), /* @__PURE__ */ jsxs("div", {
14009
+ className: "flex items-baseline justify-between",
14010
+ children: [/* @__PURE__ */ jsx("h3", {
14011
+ className: "text-2xl font-bold text-gray-900",
14012
+ children: n
14013
+ }), a && /* @__PURE__ */ jsxs("span", {
14014
+ className: `flex items-center text-sm font-medium ${g} bg-opacity-10 px-2 py-0.5 rounded-full`,
14015
+ children: [/* @__PURE__ */ jsx("span", {
14016
+ className: "mr-1",
14017
+ children: _
14018
+ }), a]
14019
+ })]
14020
+ })]
14021
+ }) : e === "progress" ? /* @__PURE__ */ jsxs("div", {
14022
+ className: `${v} ${h}`,
14023
+ children: [/* @__PURE__ */ jsxs("div", {
14024
+ className: "flex justify-between items-end mb-2",
14025
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
14026
+ className: "text-sm text-gray-500 font-medium mb-1",
14027
+ children: t
14028
+ }), /* @__PURE__ */ jsx("h3", {
14029
+ className: "text-2xl font-bold text-gray-900",
14030
+ children: n
14031
+ })] }), /* @__PURE__ */ jsxs("span", {
14032
+ className: "text-sm font-medium text-gray-500",
14033
+ children: [i, "%"]
14034
+ })]
14035
+ }), /* @__PURE__ */ jsx("div", {
14036
+ className: "w-full bg-gray-100 rounded-full h-2 overflow-hidden",
14037
+ children: /* @__PURE__ */ jsx("div", {
14038
+ className: "h-2 rounded-full transition-all duration-500",
14039
+ style: {
14040
+ width: `${Math.min(100, Math.max(0, i))}%`,
14041
+ backgroundColor: y
14042
+ }
14043
+ })
14044
+ })]
14045
+ }) : e === "icon-bg" ? /* @__PURE__ */ jsxs("div", {
14046
+ className: `${v} ${h}`,
14047
+ children: [/* @__PURE__ */ jsxs("div", {
14048
+ className: "relative z-10",
14049
+ children: [/* @__PURE__ */ jsx("p", {
14050
+ className: "text-sm text-gray-500 font-medium mb-1",
14051
+ children: t
14052
+ }), /* @__PURE__ */ jsx("h3", {
14053
+ className: "text-2xl font-bold text-gray-900",
14054
+ children: n
14055
+ })]
14056
+ }), c && /* @__PURE__ */ jsx("div", {
14057
+ className: "absolute right-[-10px] bottom-[-10px] opacity-10 text-[80px] pointer-events-none",
14058
+ style: { color: y },
14059
+ children: c
14060
+ })]
14061
+ }) : e === "side-icon" ? /* @__PURE__ */ jsxs("div", {
14062
+ className: `${v} flex items-center ${h}`,
14063
+ children: [c && /* @__PURE__ */ jsx("div", {
14064
+ className: "p-3 rounded-full mr-4 bg-opacity-10",
14065
+ style: {
14066
+ backgroundColor: `${y}20`,
14067
+ color: y
14068
+ },
14069
+ children: /* @__PURE__ */ jsx("div", {
14070
+ className: "text-2xl",
14071
+ children: c
14072
+ })
14073
+ }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
14074
+ className: "text-sm text-gray-500 font-medium",
14075
+ children: t
14076
+ }), /* @__PURE__ */ jsx("h3", {
14077
+ className: "text-2xl font-bold text-gray-900",
14078
+ children: n
14079
+ })] })]
14080
+ }) : e === "card-footer" ? /* @__PURE__ */ jsxs("div", {
14081
+ className: `rounded-lg border border-redi-border bg-white shadow-sm overflow-hidden ${h}`,
14082
+ children: [/* @__PURE__ */ jsxs("div", {
14083
+ className: "p-4",
14084
+ children: [/* @__PURE__ */ jsx("p", {
14085
+ className: "text-sm text-gray-500 font-medium mb-1",
14086
+ children: t
14087
+ }), /* @__PURE__ */ jsx("h3", {
14088
+ className: "text-2xl font-bold text-gray-900",
14089
+ children: n
14090
+ })]
14091
+ }), p && /* @__PURE__ */ jsx("div", {
14092
+ className: "bg-gray-50 px-4 py-2 border-t border-gray-100 text-xs text-gray-500",
14093
+ children: p
14094
+ })]
14095
+ }) : e === "circular" ? /* @__PURE__ */ jsxs("div", {
14096
+ className: `${v} flex items-center justify-between ${h}`,
14097
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
14098
+ className: "text-sm text-gray-500 font-medium mb-1",
14099
+ children: t
14100
+ }), /* @__PURE__ */ jsx("h3", {
14101
+ className: "text-2xl font-bold text-gray-900",
14102
+ children: n
14103
+ })] }), /* @__PURE__ */ jsx("div", {
14104
+ className: "flex-shrink-0 ml-4",
14105
+ children: /* @__PURE__ */ jsx(CircularProgress, {
14106
+ progress: i,
14107
+ color: y
14108
+ })
14109
+ })]
14110
+ }) : e === "sparkline-row" ? /* @__PURE__ */ jsxs("div", {
14111
+ className: `${v} flex items-center justify-between py-3 ${h}`,
14112
+ children: [/* @__PURE__ */ jsxs("div", {
14113
+ className: "mr-4",
14114
+ children: [/* @__PURE__ */ jsx("p", {
14115
+ className: "text-xs text-gray-500 font-medium",
14116
+ children: t
14117
+ }), /* @__PURE__ */ jsx("h3", {
14118
+ className: "text-xl font-bold text-gray-900",
14119
+ children: n
14120
+ })]
14121
+ }), /* @__PURE__ */ jsx("div", {
14122
+ className: "w-24 h-8",
14123
+ children: l && /* @__PURE__ */ jsx(Sparkline, {
14124
+ data: l,
14125
+ color: y,
14126
+ height: 30
14127
+ })
14128
+ })]
14129
+ }) : e === "solid" ? /* @__PURE__ */ jsxs("div", {
14130
+ className: `rounded-lg shadow-sm p-4 text-white ${h}`,
14131
+ style: { backgroundColor: y },
14132
+ children: [/* @__PURE__ */ jsx("p", {
14133
+ className: "text-sm font-medium opacity-90 mb-1",
14134
+ children: t
14135
+ }), /* @__PURE__ */ jsxs("div", {
14136
+ className: "flex justify-between items-end",
14137
+ children: [/* @__PURE__ */ jsx("h3", {
14138
+ className: "text-2xl font-bold",
14139
+ children: n
14140
+ }), c && /* @__PURE__ */ jsx("div", {
14141
+ className: "text-2xl opacity-80",
14142
+ children: c
14143
+ })]
14144
+ })]
14145
+ }) : e === "bordered" ? /* @__PURE__ */ jsxs("div", {
14146
+ className: `${v} border-l-4 ${h}`,
14147
+ style: { borderLeftColor: y },
14148
+ children: [
14149
+ /* @__PURE__ */ jsx("p", {
14150
+ className: "text-sm text-gray-500 font-medium mb-1",
14151
+ children: t
14152
+ }),
14153
+ /* @__PURE__ */ jsx("h3", {
14154
+ className: "text-2xl font-bold text-gray-900",
14155
+ children: n
14156
+ }),
14157
+ p && /* @__PURE__ */ jsx("p", {
14158
+ className: "text-xs text-gray-400 mt-2",
14159
+ children: p
14160
+ })
14161
+ ]
14162
+ }) : e === "stacked" ? /* @__PURE__ */ jsxs("div", {
14163
+ className: `${v} flex flex-col items-center justify-center text-center ${h}`,
14164
+ children: [
14165
+ c && /* @__PURE__ */ jsx("div", {
14166
+ className: "mb-2 text-2xl",
14167
+ style: { color: y },
14168
+ children: c
14169
+ }),
14170
+ /* @__PURE__ */ jsx("p", {
14171
+ className: "text-sm text-gray-500 font-medium",
14172
+ children: t
14173
+ }),
14174
+ /* @__PURE__ */ jsx("h3", {
14175
+ className: "text-3xl font-bold text-gray-900 my-1",
14176
+ children: n
14177
+ }),
14178
+ m && /* @__PURE__ */ jsx("p", {
14179
+ className: "text-xs text-gray-400",
14180
+ children: m
14181
+ })
14182
+ ]
14183
+ }) : null;
13803
14184
  }, Context_default = /* @__PURE__ */ createContext({});
13804
14185
  function r(e) {
13805
14186
  var t, n, i = "";
@@ -15906,4 +16287,4 @@ var Select_default = ({ options: e, value: t, onChange: n, disabled: i = !1, pla
15906
16287
  children: e.find((e) => e.id === i)?.content
15907
16288
  })] });
15908
16289
  };
15909
- export { AdvancedTable_default as AdvancedTable, Alert_default as Alert, AlertViewport, Badge_default as Badge, Breadcrumbs_default as Breadcrumbs, Button_default as Button, Card_default as Card, Checkbox_default as Checkbox, Container_default as Container, DateInput_default as DateInput, Divider_default as Divider, FileInput_default as FileInput, Grid_default as Grid, Link_default as Link, Modal_default as Modal, Pagination_default as Pagination, RadioGroup_default as RadioGroup, Select_default as Select, Slider_default as Slider, Stack_default as Stack, Switch_default as Switch, Tabs_default as Tabs, TextArea_default as TextArea };
16290
+ export { AdvancedTable_default as AdvancedTable, Alert_default as Alert, AlertViewport, Badge_default as Badge, Breadcrumbs_default as Breadcrumbs, Button_default as Button, Card_default as Card, Checkbox_default as Checkbox, Container_default as Container, DateInput_default as DateInput, Divider_default as Divider, FileInput_default as FileInput, Grid_default as Grid, KPI_default as KPI, Link_default as Link, Modal_default as Modal, Pagination_default as Pagination, RadioGroup_default as RadioGroup, Select_default as Select, Slider_default as Slider, Stack_default as Stack, Switch_default as Switch, Tabs_default as Tabs, TextArea_default as TextArea };