@sheetxl/grid-react 0.7.28-beta.4 → 0.8.0-beta.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,19 +1,20 @@
1
1
  /**
2
- * @license @sheetxl/grid-react - Grid React - Advanced grid component for React - v0.7.28-beta.4
2
+ * @license @sheetxl/grid-react - Grid React - Advanced grid component for React - v0.8.0-beta.1
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import e, { cloneElement as t, createContext as n, createElement as o, forwardRef as r, isValidElement as l, memo as i, useCallback as s, useContext as a, useEffect as c, useId as d, useLayoutEffect as u, useMemo as g, useReducer as h, useRef as f, useState as p, useSyncExternalStore as m } from "react";
7
+ import e, { cloneElement as t, createContext as n, createElement as o, forwardRef as r, isValidElement as l, memo as i, useCallback as a, useContext as s, useEffect as c, useId as d, useLayoutEffect as u, useMemo as g, useReducer as h, useRef as f, useState as p, useSyncExternalStore as m } from "react";
8
8
  import { Fragment as w, jsx as x, jsxs as v } from "react/jsx-runtime";
9
- import { KeyCodes as y, KeyModifiers as b, ReactUtils as S, SERIES_COUNT as E, ScrollPane as I, THEME_MODE_ATTR as C, THEME_SURFACE_ATTR as R, Viewport as M, buildThemeCSS as P, defaultTheme as k, themeVars as D, useBoundSyncExternalStore as T, useCallbackRef as z, useFloatSurface as O, useFullscreenPortal as $, useImperativeElement as L, useOptionalBoundSyncExternalStore as B, useSynchronizedPointerHandler as A, useTokenThemeContext as N } from "@sheetxl/utils-react";
9
+ import { KeyCodes as y, KeyModifiers as b, ReactUtils as S, SERIES_COUNT as E, ScrollPane as I, THEME_MODE_ATTR as C, THEME_SURFACE_ATTR as R, Viewport as M, buildThemeCSS as P, defaultTheme as k, themeVars as D, useBoundSyncExternalStore as T, useCallbackRef as O, useFloatSurface as z, useFullscreenPortal as $, useImperativeElement as L, useOptionalBoundSyncExternalStore as B, useSynchronizedPointerHandler as A, useTokenThemeContext as N } from "@sheetxl/utils-react";
10
10
  import F from "tiny-invariant";
11
11
  import V, { clsx as H } from "clsx";
12
12
  import { AnchorLocation as _, CommonUtils as W, CoordUtils as U, DOMUtils as K, Direction as j, RangeAxis as G, SelectionTraversalUtils as X } from "@sheetxl/utils";
13
13
  import { createPortal as Y } from "react-dom";
14
14
  import { autoUpdate as q, flip as Z, offset as J, shift as Q, useFloating as ee } from "@floating-ui/react-dom";
15
15
  import { useMeasure as te } from "react-use";
16
- var ne = (e, t) => {
16
+ import { mergeRefs as ne } from "react-merge-refs";
17
+ var oe = (e, t) => {
17
18
  if ("number" == typeof t) {
18
19
  const n = t;
19
20
  return {
@@ -40,20 +41,20 @@ var ne = (e, t) => {
40
41
  getIndex: (t) => {
41
42
  if (t <= 0 || e <= 0) return 0;
42
43
  if ((r > 0 ? o[r] : 0) > t) return i(0, r, t);
43
- let s = r > 0 ? r : 0, a = 1;
44
- for (; s < e && l(s) <= t;) s += a, a *= 2;
45
- if (s >= e) {
44
+ let a = r > 0 ? r : 0, s = 1;
45
+ for (; a < e && l(a) <= t;) a += s, s *= 2;
46
+ if (a >= e) {
46
47
  const o = e - 1;
47
48
  if (t >= l(o) + n(o)) return e;
48
49
  }
49
- return i(Math.floor(s / 2), Math.min(s, e - 1), t);
50
+ return i(Math.floor(a / 2), Math.min(a, e - 1), t);
50
51
  }
51
52
  };
52
- }, oe = (e) => {
53
+ }, re = (e) => {
53
54
  const t = null != e, n = e?.rowCount ?? 0, o = e?.columnCount ?? 0, r = e?.getRowHeight, l = e?.getColumnWidth;
54
55
  return g(() => {
55
56
  if (!t) return null;
56
- const e = ne(n, r ?? 20), i = ne(o, l ?? 75);
57
+ const e = oe(n, r ?? 20), i = oe(o, l ?? 75);
57
58
  return {
58
59
  getColOffset: i.getOffset,
59
60
  getColIndex: i.getIndex,
@@ -67,7 +68,7 @@ var ne = (e, t) => {
67
68
  r,
68
69
  l
69
70
  ]);
70
- }, re = n(null), le = () => a(re), ie = (e) => {
71
+ }, le = n(null), ie = () => s(le), ae = (e) => {
71
72
  const { linePoints: t, bounds: n, propsPath: o, style: r, ...l } = e;
72
73
  return n ? x("svg", {
73
74
  width: `${n.width}`,
@@ -96,25 +97,25 @@ var ne = (e, t) => {
96
97
  })
97
98
  }) : null;
98
99
  }, se = i((e) => {
99
- const { bounds: t, fill: n, stroke: o, alignWidth: r = 1, disableAlign: l = !1, disableEdgeAware: i = !1, inset: s = 0, hole: a, animatedStroke: d, animatedTransition: u, strokeDasharray: g, strokeDashoffset: h, propsFillPath: f, propsStrokePath: p, className: m, style: y, propsRoot: b } = e, E = le(), I = t ?? E;
100
+ const { bounds: t, fill: n, stroke: o, alignWidth: r = 1, disableAlign: l = !1, disableEdgeAware: i = !1, inset: a = 0, hole: s, animatedStroke: d, animatedTransition: u, strokeDasharray: g, strokeDashoffset: h, propsFillPath: f, propsStrokePath: p, className: m, style: y, propsRoot: b } = e, E = ie(), I = t ?? E;
100
101
  if (c(() => {
101
- d && ue();
102
+ d && ge();
102
103
  }, [d]), !I) return null;
103
104
  const C = S.getDevicePixelRatio(), R = l ? r : r / C;
104
- let M, P, k, D, T, z, O;
105
+ let M, P, k, D, T, O, z;
105
106
  if (l) M = I.x, P = I.y, k = I.x + I.width, D = I.y + I.height;
106
107
  else {
107
- const e = (e) => i ? S.snapLineCenter(e, R, C) : S.edgeCenter(e, "leading", r, C), t = (e) => i ? S.snapLineCenter(e, R, C) : S.edgeCenter(e, "trailing", r, C), n = s / C;
108
+ const e = (e) => i ? S.snapLineCenter(e, R, C) : S.edgeCenter(e, "leading", r, C), t = (e) => i ? S.snapLineCenter(e, R, C) : S.edgeCenter(e, "trailing", r, C), n = a / C;
108
109
  M = e(I.x + n), P = e(I.y + n), k = t(I.x + I.width - n), D = t(I.y + I.height - n);
109
110
  }
110
- if (a) if (l) T = a;
111
+ if (s) if (l) T = s;
111
112
  else {
112
- const e = S.snapDeviceEdge(a.x, C), t = S.snapDeviceEdge(a.y, C);
113
+ const e = S.snapDeviceEdge(s.x, C), t = S.snapDeviceEdge(s.y, C);
113
114
  T = {
114
115
  x: e,
115
116
  y: t,
116
- width: S.snapDeviceEdge(a.x + a.width, C) - e,
117
- height: S.snapDeviceEdge(a.y + a.height, C) - t
117
+ width: S.snapDeviceEdge(s.x + s.width, C) - e,
118
+ height: S.snapDeviceEdge(s.y + s.height, C) - t
118
119
  };
119
120
  }
120
121
  if (d) {
@@ -125,23 +126,23 @@ var ne = (e, t) => {
125
126
  gapColor: "var(--sxl-color-base-100, #fff)",
126
127
  ..."object" == typeof d ? d : void 0
127
128
  }, t = e.dashGap + e.dashLength;
128
- z = {
129
+ O = {
129
130
  strokeDasharray: `${e.dashLength}px ${e.dashGap}px`,
130
131
  strokeDashoffset: `${t}px`,
131
- animation: `${ce} ${e.speed * t}ms linear infinite`,
132
+ animation: `${de} ${e.speed * t}ms linear infinite`,
132
133
  willChange: "stroke-dashoffset"
133
- }, O = e.gapColor;
134
+ }, z = e.gapColor;
134
135
  }
135
136
  const $ = u ? "d 60ms ease-in-out" : "none";
136
137
  let L = null;
137
138
  if (n) {
138
- let e = ae({
139
+ let e = ce({
139
140
  top: P,
140
141
  left: M,
141
142
  bottom: D,
142
143
  right: k
143
144
  });
144
- T && (e += " " + ae({
145
+ T && (e += " " + ce({
145
146
  top: T.y,
146
147
  left: T.x,
147
148
  bottom: T.y + T.height,
@@ -159,20 +160,20 @@ var ne = (e, t) => {
159
160
  }
160
161
  let B = null;
161
162
  if (o && r) {
162
- const e = ae({
163
+ const e = ce({
163
164
  top: P,
164
165
  left: M,
165
166
  right: k,
166
167
  bottom: D
167
168
  });
168
- B = v(w, { children: [O && x("path", {
169
+ B = v(w, { children: [z && x("path", {
169
170
  fill: "none",
170
171
  vectorEffect: "non-scaling-stroke",
171
172
  strokeWidth: R,
172
173
  style: {
173
174
  d: `path("${e}")`,
174
175
  transition: $,
175
- stroke: O
176
+ stroke: z
176
177
  }
177
178
  }, "stroke-under"), x("path", {
178
179
  fill: "none",
@@ -185,7 +186,7 @@ var ne = (e, t) => {
185
186
  d: `path("${e}")`,
186
187
  transition: $,
187
188
  stroke: o,
188
- ...z,
189
+ ...O,
189
190
  ...p?.style
190
191
  }
191
192
  }, "stroke")] });
@@ -208,12 +209,12 @@ var ne = (e, t) => {
208
209
  });
209
210
  });
210
211
  se.displayName = "RectangleSVG";
211
- var ae = (e, t = !0) => `M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right} ${e.bottom} L ${e.left} ${e.bottom} L ${e.left} ${e.top} ${t ? "Z" : ""}`, ce = "sxl-marching-ants", de = !1, ue = () => {
212
- if (de || "undefined" == typeof document) return;
213
- de = !0;
212
+ var ce = (e, t = !0) => `M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right} ${e.bottom} L ${e.left} ${e.bottom} L ${e.left} ${e.top} ${t ? "Z" : ""}`, de = "sxl-marching-ants", ue = !1, ge = () => {
213
+ if (ue || "undefined" == typeof document) return;
214
+ ue = !0;
214
215
  const e = document.createElement("style");
215
- e.appendChild(document.createTextNode(`@keyframes ${ce} { to { stroke-dashoffset: 0; } }`)), document.head.appendChild(e);
216
- }, ge = (e, t, n) => Math.min(n, Math.max(t, e)), he = (e, t, n) => {
216
+ e.appendChild(document.createTextNode(`@keyframes ${de} { to { stroke-dashoffset: 0; } }`)), document.head.appendChild(e);
217
+ }, he = (e, t, n) => Math.min(n, Math.max(t, e)), fe = (e, t, n) => {
217
218
  const o = [];
218
219
  let r = t;
219
220
  for (; r <= n;) {
@@ -221,26 +222,26 @@ var ae = (e, t = !0) => `M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right}
221
222
  0 === t ? (o.push(r), r++) : r += t;
222
223
  }
223
224
  return o;
224
- }, fe = (e, t, n, o, r, l) => {
225
+ }, pe = (e, t, n, o, r, l) => {
225
226
  if (n - t >= r - o) return o;
226
227
  let i = o;
227
228
  return "nearest" === e && (o - t > 0 ? e = "start" : n - r > 0 && (e = "end")), "start" === e ? i = t : "end" === e ? i = n - (r - o) : "center" === e && (i = t + (n - t) / 2 - (r - o) / 2), i < o ? Math.max(0, i) : i > o ? Math.min(i, l - (r - o)) : void 0;
228
- }, pe = (e, t = !1, n, o) => {
229
+ }, me = (e, t = !1, n, o) => {
229
230
  if (!n) return 0;
230
231
  const r = !t, l = r ? 1 : -1;
231
- let i = n(r ? e : e + 1), s = n(r ? e + 1 : e), a = e + (r ? 2 : -1), c = 0;
232
- for (; (s - i) * l <= 0;) {
233
- if (r && a - 1 > o + 1 || !r && a + 1 < o) return c;
234
- i = s, s = n(a), a += l, c++;
232
+ let i = n(r ? e : e + 1), a = n(r ? e + 1 : e), s = e + (r ? 2 : -1), c = 0;
233
+ for (; (a - i) * l <= 0;) {
234
+ if (r && s - 1 > o + 1 || !r && s + 1 < o) return c;
235
+ i = a, a = n(s), s += l, c++;
235
236
  }
236
237
  return c;
237
- }, me = (e, t, n) => {
238
+ }, we = (e, t, n) => {
238
239
  if (!n) return !1;
239
240
  const o = n.x;
240
241
  if (e < o || e > o + n.width) return !1;
241
242
  const r = n.y;
242
243
  return !(t < r || t > r + n.height);
243
- }, we = "_grid-stage_rzp9d_1", xe = {
244
+ }, xe = "_grid-stage_rzp9d_1", ve = {
244
245
  pointerdown: "onPointerDown",
245
246
  pointermove: "onPointerMove",
246
247
  pointerup: "onPointerUp",
@@ -251,18 +252,18 @@ var ae = (e, t = !0) => `M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right}
251
252
  mouseout: "onMouseOut",
252
253
  dblclick: "onDoubleClick",
253
254
  contextmenu: "onContextMenu"
254
- }, ve = Object.values(xe), ye = [
255
- ...Object.keys(xe),
255
+ }, ye = Object.values(ve), be = [
256
+ ...Object.keys(ve),
256
257
  "keydown",
257
258
  "keypress",
258
259
  "keyup"
259
- ], be = new Set(ye), Se = (e) => {
260
+ ], Se = new Set(be), Ee = (e) => {
260
261
  const t = e?.getElement();
261
262
  return t && "function" == typeof t.isStage && t.isStage() ? t : null;
262
- }, Ee = i(r((e, t) => {
263
- const { className: n, onFocus: o, onBlur: r, children: l, ...i } = e, a = qe(), d = f(a);
264
- d.current = a;
265
- const u = f(/* @__PURE__ */ new Set()), g = f(0), h = s((e) => {
263
+ }, Ie = i(r((e, t) => {
264
+ const { className: n, onFocus: o, onBlur: r, children: l, ...i } = e, s = Ze(), d = f(s);
265
+ d.current = s;
266
+ const u = f(/* @__PURE__ */ new Set()), g = f(0), h = a((e) => {
266
267
  const t = {
267
268
  responder: e,
268
269
  seq: g.current++
@@ -270,9 +271,9 @@ var ae = (e, t = !0) => `M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right}
270
271
  return u.current.add(t), () => {
271
272
  u.current.delete(t);
272
273
  };
273
- }, []), p = f(/* @__PURE__ */ new Set()), m = f(0), w = s((e) => (p.current.add(e), e.hasHandlers && m.current++, () => {
274
+ }, []), p = f(/* @__PURE__ */ new Set()), m = f(0), w = a((e) => (p.current.add(e), e.hasHandlers && m.current++, () => {
274
275
  p.current.delete(e), e.hasHandlers && m.current--;
275
- }), []), v = f(null), y = f(0), b = s((e, t) => {
276
+ }), []), v = f(null), y = f(0), b = a((e, t) => {
276
277
  const n = v.current;
277
278
  if (n && n.x === e && n.y === t) return n.stack;
278
279
  const o = document.elementsFromPoint(e, t);
@@ -287,13 +288,13 @@ var ae = (e, t = !0) => `M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right}
287
288
  c(() => () => {
288
289
  y.current && "function" == typeof cancelAnimationFrame && cancelAnimationFrame(y.current);
289
290
  }, []);
290
- const S = s((e, t, n) => {
291
+ const S = a((e, t, n) => {
291
292
  if (!t && !n) return () => {};
292
293
  const o = (e, o) => {
293
294
  t?.(e), n?.(e, o);
294
295
  };
295
296
  return h({ getHandler: (t) => t === e ? o : void 0 });
296
- }, [h]), E = s((e) => {
297
+ }, [h]), E = a((e) => {
297
298
  if (!e || e === G.current) return Number.NEGATIVE_INFINITY;
298
299
  const t = /* @__PURE__ */ new Map();
299
300
  if (u.current.forEach((e) => {
@@ -308,17 +309,17 @@ var ae = (e, t = !0) => `M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right}
308
309
  n = n.parentElement;
309
310
  }
310
311
  return Number.NEGATIVE_INFINITY;
311
- }, []), I = s((e, t, n) => {
312
- if (void 0 === xe[e]) return Ie;
313
- if (0 === m.current) return Ie;
312
+ }, []), I = a((e, t, n) => {
313
+ if (void 0 === ve[e]) return Ce;
314
+ if (0 === m.current) return Ce;
314
315
  const o = t.nativeEvent;
315
- if ("number" != typeof o?.clientX || "number" != typeof o?.clientY) return Ie;
316
+ if ("number" != typeof o?.clientX || "number" != typeof o?.clientY) return Ce;
316
317
  const r = /* @__PURE__ */ new Map();
317
318
  if (p.current.forEach((e) => {
318
319
  if (!e.hasHandlers || !e.getHandler) return;
319
320
  const t = e.getElement();
320
321
  t && r.set(t, e);
321
- }), 0 === r.size) return Ie;
322
+ }), 0 === r.size) return Ce;
322
323
  const l = (e) => {
323
324
  let t = e;
324
325
  for (; t;) {
@@ -327,24 +328,24 @@ var ae = (e, t = !0) => `M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right}
327
328
  t = t.parentElement;
328
329
  }
329
330
  return null;
330
- }, i = l(t.target), s = "pointermove" === e || "mousemove" === e, a = s ? b(o.clientX, o.clientY) : document.elementsFromPoint(o.clientX, o.clientY), c = [], d = /* @__PURE__ */ new Set();
331
- for (let e = 0; e < a.length; e++) {
332
- const t = l(a[e]);
331
+ }, i = l(t.target), a = "pointermove" === e || "mousemove" === e, s = a ? b(o.clientX, o.clientY) : document.elementsFromPoint(o.clientX, o.clientY), c = [], d = /* @__PURE__ */ new Set();
332
+ for (let e = 0; e < s.length; e++) {
333
+ const t = l(s[e]);
333
334
  if (!t || d.has(t)) continue;
334
335
  if (d.add(t), t === i) continue;
335
- const o = r.get(t), s = o.zIndex ?? 0;
336
- s >= n || c.push({
337
- slot: s,
336
+ const o = r.get(t), a = o.zIndex ?? 0;
337
+ a >= n || c.push({
338
+ slot: a,
338
339
  box: !0,
339
340
  ord: e,
340
341
  getHandler: o.getHandler
341
342
  });
342
343
  }
343
- return i && !d.has(i) && s ? Ie : c;
344
- }, [b]), C = s((e, t, n) => {
344
+ return i && !d.has(i) && a ? Ce : c;
345
+ }, [b]), C = a((e, t, n) => {
345
346
  const o = G.current;
346
347
  if (o && t.target instanceof Node && !o.contains(t.target)) return;
347
- const r = be.has(e) ? E(t.target) : Number.POSITIVE_INFINITY, l = [...I(e, t, r)];
348
+ const r = Se.has(e) ? E(t.target) : Number.POSITIVE_INFINITY, l = [...I(e, t, r)];
348
349
  if (u.current.forEach((e) => {
349
350
  const t = e.responder.zIndex ?? 0;
350
351
  t >= r || l.push({
@@ -367,49 +368,49 @@ var ae = (e, t = !0) => `M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right}
367
368
  (e.responder.zIndex ?? 0) > o && r.push(e);
368
369
  }), 0 === r.length) return;
369
370
  r.sort((e, t) => (t.responder.zIndex ?? 0) - (e.responder.zIndex ?? 0) || t.seq - e.seq);
370
- const l = Ce(t, e);
371
+ const l = Re(t, e);
371
372
  for (let e = 0; e < r.length && !l.isPropagationStopped(); e++) r[e].responder.getHandler(n)?.(l, d.current);
372
373
  };
373
- for (let n = 0; n < ye.length; n++) e.addEventListener(ye[n], t, !0);
374
+ for (let n = 0; n < be.length; n++) e.addEventListener(be[n], t, !0);
374
375
  return () => {
375
- for (let n = 0; n < ye.length; n++) e.removeEventListener(ye[n], t, !0);
376
+ for (let n = 0; n < be.length; n++) e.removeEventListener(be[n], t, !0);
376
377
  };
377
378
  }, [E]);
378
- const R = z((e) => {
379
+ const R = O((e) => {
379
380
  C("pointerdown", e, d.current);
380
- }, []), M = z((e) => {
381
+ }, []), M = O((e) => {
381
382
  C("pointermove", e, d.current);
382
- }, []), P = z((e) => {
383
+ }, []), P = O((e) => {
383
384
  C("pointerup", e, d.current);
384
- }, []), k = z((e) => {
385
+ }, []), k = O((e) => {
385
386
  C("pointerleave", e, d.current);
386
- }, []), D = z((e) => {
387
+ }, []), D = O((e) => {
387
388
  C("mousedown", e, d.current);
388
- }, []), T = z((e) => {
389
+ }, []), T = O((e) => {
389
390
  C("mouseenter", e, d.current);
390
- }, []), O = z((e) => {
391
+ }, []), z = O((e) => {
391
392
  C("mouseleave", e, d.current);
392
- }, []), $ = z((e) => {
393
+ }, []), $ = O((e) => {
393
394
  C("mousemove", e, d.current);
394
- }, []), B = z((e) => {
395
+ }, []), B = O((e) => {
395
396
  C("mouseout", e, d.current);
396
- }, []), A = z((e) => {
397
+ }, []), A = O((e) => {
397
398
  C("mouseover", e, d.current);
398
- }, []), N = z((e) => {
399
+ }, []), N = O((e) => {
399
400
  C("mouseup", e, d.current);
400
- }, []), F = z((e) => {
401
+ }, []), F = O((e) => {
401
402
  C("dblclick", e, d.current);
402
- }, []), H = z((e) => {
403
+ }, []), H = O((e) => {
403
404
  C("keydown", e, d.current);
404
- }, []), _ = z((e) => {
405
+ }, []), _ = O((e) => {
405
406
  C("keypress", e, d.current);
406
- }, []), W = z((e) => {
407
+ }, []), W = O((e) => {
407
408
  C("keyup", e, d.current);
408
- }, []), U = z((e) => {
409
+ }, []), U = O((e) => {
409
410
  o?.(e), C("focus", e, d.current);
410
- }, [o]), K = z((e) => {
411
+ }, [o]), K = O((e) => {
411
412
  r?.(e), C("blur", e, d.current);
412
- }, [r]), j = z((e) => {
413
+ }, [r]), j = O((e) => {
413
414
  C("contextmenu", e, d.current);
414
415
  }, []), G = L(t, () => ({
415
416
  isStage: () => !0,
@@ -418,7 +419,7 @@ var ae = (e, t = !0) => `M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right}
418
419
  registerLayer: w
419
420
  }), []);
420
421
  return c(() => w({ getElement: () => G.current }), [w]), x("div", {
421
- className: V(n, "stage", we),
422
+ className: V(n, "stage", xe),
422
423
  ref: G,
423
424
  tabIndex: 0,
424
425
  ...i,
@@ -428,7 +429,7 @@ var ae = (e, t = !0) => `M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right}
428
429
  onPointerLeave: k,
429
430
  onMouseDown: D,
430
431
  onMouseEnter: T,
431
- onMouseLeave: O,
432
+ onMouseLeave: z,
432
433
  onMouseMove: $,
433
434
  onMouseOut: B,
434
435
  onMouseOver: A,
@@ -443,8 +444,8 @@ var ae = (e, t = !0) => `M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right}
443
444
  children: l
444
445
  });
445
446
  }));
446
- Ee.displayName = "Stage";
447
- var Ie = Object.freeze([]), Ce = (e, t) => {
447
+ Ie.displayName = "Stage";
448
+ var Ce = Object.freeze([]), Re = (e, t) => {
448
449
  let n = !1;
449
450
  return new Proxy(e, { get(o, r) {
450
451
  switch (r) {
@@ -463,8 +464,8 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
463
464
  }
464
465
  }
465
466
  } });
466
- }, Re = (e) => `${e.rowStart},${e.colStart},${e.rowEnd},${e.colEnd}`, Me = n(0), Pe = n(!1), ke = (e, t) => {
467
- const { rowDims: n, columnDims: o, computeRowDims: r, computeColumnDims: l, viewport: i, zoom: s, containerWidth: a, containerHeight: c, getRangeFromCell: d, invalidate: u, totalRange: g, getSurfacePointFromPointer: h, scrollTo: f, scrollCellCoordsIntoView: p, getAllPanes: m } = t, w = e.anchor, x = n[e.rowIndex], v = o[e.columnIndex];
467
+ }, Me = (e) => `${e.rowStart},${e.colStart},${e.rowEnd},${e.colEnd}`, Pe = n(0), ke = n(!1), De = (e, t) => {
468
+ const { rowDims: n, columnDims: o, computeRowDims: r, computeColumnDims: l, viewport: i, zoom: a, containerWidth: s, containerHeight: c, getRangeFromCell: d, invalidate: u, totalRange: g, getSurfacePointFromPointer: h, scrollTo: f, scrollCellCoordsIntoView: p, getAllPanes: m } = t, w = e.anchor, x = n[e.rowIndex], v = o[e.columnIndex];
468
469
  if (x.minIndex > x.maxIndex || v.minIndex > v.maxIndex) return null;
469
470
  const y = e.scrollOrientation, b = Object.freeze({
470
471
  x: v.minBounds,
@@ -483,21 +484,21 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
483
484
  left: v.freezeOffset,
484
485
  top: x.freezeOffset
485
486
  }, C = {
486
- width: a,
487
+ width: s,
487
488
  height: c
488
489
  };
489
490
  let R = null, M = null;
490
491
  const P = () => {
491
492
  const t = i.getSnapshot();
492
493
  if (M && R === t) return M;
493
- const n = l(t.left)[e.columnIndex], o = r(t.top)[e.rowIndex], a = n.metrics, c = o.metrics, d = Object.freeze({
494
+ const n = l(t.left)[e.columnIndex], o = r(t.top)[e.rowIndex], s = n.metrics, c = o.metrics, d = Object.freeze({
494
495
  rowStart: o.minIndex,
495
496
  colStart: n.minIndex,
496
497
  rowEnd: o.maxIndex,
497
498
  colEnd: n.maxIndex
498
499
  }), u = Object.freeze({
499
- getColIndex: (e) => a.getColIndex(e),
500
- getColOffset: (e) => a.getColOffset(e),
500
+ getColIndex: (e) => s.getColIndex(e),
501
+ getColOffset: (e) => s.getColOffset(e),
501
502
  getRowIndex: (e) => c.getRowIndex(e),
502
503
  getRowOffset: (e) => c.getRowOffset(e)
503
504
  }), g = {
@@ -509,8 +510,8 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
509
510
  metrics: u,
510
511
  scrollTopLeft: g,
511
512
  topLeft: {
512
- top: (I.top + (y.vertical ? g.top : 0)) / s,
513
- left: (I.left + (y.horizontal ? g.left : 0)) / s
513
+ top: (I.top + (y.vertical ? g.top : 0)) / a,
514
+ left: (I.left + (y.horizontal ? g.left : 0)) / a
514
515
  },
515
516
  colDims: n,
516
517
  rowDims: o
@@ -542,7 +543,7 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
542
543
  offset: n,
543
544
  size: t.getRowOffset(e + 1) - n
544
545
  };
545
- }, z = (e, t) => {
546
+ }, O = (e, t) => {
546
547
  const n = new Array(e.length);
547
548
  for (let o = 0; o < e.length; o++) n[o] = t(e[o]);
548
549
  return n;
@@ -582,18 +583,18 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
582
583
  top: t.y + n,
583
584
  bottom: t.height - 2 * n + t.y,
584
585
  right: t.width - 2 * n + t.x
585
- }, s = {
586
+ }, a = {
586
587
  left: Math.max(l.left, i.left),
587
588
  top: Math.max(l.top, i.top),
588
589
  bottom: Math.min(l.bottom, i.bottom),
589
590
  right: Math.min(l.right, i.right)
590
- }, a = {
591
- x: s.left,
592
- y: s.top,
593
- width: s.right - s.left,
594
- height: s.bottom - s.top
591
+ }, s = {
592
+ x: a.left,
593
+ y: a.top,
594
+ width: a.right - a.left,
595
+ height: a.bottom - a.top
595
596
  };
596
- return a.height < 0 || a.width < 0 ? null : a;
597
+ return s.height < 0 || s.width < 0 ? null : s;
597
598
  })(e ?? {
598
599
  x: 0,
599
600
  y: 0,
@@ -603,20 +604,20 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
603
604
  },
604
605
  toPaneBounds: (e) => {
605
606
  const t = P().topLeft;
606
- return 0 === t.left && 0 === t.top && 1 === s ? e : {
607
- x: (e.x - t.left) * s,
608
- y: (e.y - t.top) * s,
609
- width: e.width * s,
610
- height: e.height * s
607
+ return 0 === t.left && 0 === t.top && 1 === a ? e : {
608
+ x: (e.x - t.left) * a,
609
+ y: (e.y - t.top) * a,
610
+ width: e.width * a,
611
+ height: e.height * a
611
612
  };
612
613
  },
613
614
  toAbsoluteBounds: (e) => {
614
615
  const t = P().topLeft;
615
- return 0 === t.left && 0 === t.top && 1 === s ? e : {
616
- x: e.x / s + t.left,
617
- y: e.y / s + t.top,
618
- width: e.width / s,
619
- height: e.height / s
616
+ return 0 === t.left && 0 === t.top && 1 === a ? e : {
617
+ x: e.x / a + t.left,
618
+ y: e.y / a + t.top,
619
+ width: e.width / a,
620
+ height: e.height / a
620
621
  };
621
622
  },
622
623
  getPanePointFromPointer: (e, t) => {
@@ -628,8 +629,8 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
628
629
  },
629
630
  getMetrics: () => P().metrics,
630
631
  getRangeFromCell: d,
631
- getVisibleColumns: (e, t) => z(P().colDims.visibleIndices(e, t), D),
632
- getVisibleRows: (e, t) => z(P().rowDims.visibleIndices(e, t), T),
632
+ getVisibleColumns: (e, t) => O(P().colDims.visibleIndices(e, t), D),
633
+ getVisibleRows: (e, t) => O(P().rowDims.visibleIndices(e, t), T),
633
634
  getColumnSize: D,
634
635
  getRowSize: T,
635
636
  getTotalRange: () => g,
@@ -642,23 +643,23 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
642
643
  colIndex: l
643
644
  };
644
645
  if (n) return i;
645
- const s = d(i);
646
+ const a = d(i);
646
647
  return {
647
- rowIndex: s.rowStart,
648
- colIndex: s.colStart
648
+ rowIndex: a.rowStart,
649
+ colIndex: a.colStart
649
650
  };
650
651
  },
651
652
  getPaneFromPointer: (e, t) => {
652
653
  const n = h(e, t);
653
654
  if (!n) return null;
654
655
  const o = m();
655
- for (let e = 0; e < De.length; e++) {
656
- const t = o[De[e]];
657
- if (t && me(n.x, n.y, t.getPaneBounds())) return t;
656
+ for (let e = 0; e < Te.length; e++) {
657
+ const t = o[Te[e]];
658
+ if (t && we(n.x, n.y, t.getPaneBounds())) return t;
658
659
  }
659
660
  return null;
660
661
  },
661
- getZoom: () => s,
662
+ getZoom: () => a,
662
663
  getAnchor: () => w,
663
664
  getPaneRange: () => S,
664
665
  getPaneBounds: () => b,
@@ -679,12 +680,12 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
679
680
  scrollTo: (e) => f(e),
680
681
  getAllPanes: m
681
682
  };
682
- }, De = [
683
+ }, Te = [
683
684
  _.TopLeft,
684
685
  _.Top,
685
686
  _.Left,
686
687
  _.Center
687
- ], Te = (e, t, n) => {
688
+ ], Oe = (e, t, n) => {
688
689
  const o = (t?.left ?? 0) + (n?.x ?? 0), r = (t?.top ?? 0) + (n?.y ?? 0);
689
690
  return {
690
691
  getColOffset: (t) => e.getColOffset(t) - o,
@@ -709,13 +710,13 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
709
710
  maxVirtualBounds: 0,
710
711
  scrollOffset: 0,
711
712
  freezeOffset: 0
712
- }]), Oe = n(null), $e = ({ pane: e, viewport: t, children: n }) => {
713
+ }]), $e = n(null), Le = ({ pane: e, viewport: t, children: n }) => {
713
714
  const o = g(() => ({ pane: e }), [e, B(t, (e) => e.getSnapshot())]);
714
- return x(Oe.Provider, {
715
+ return x($e.Provider, {
715
716
  value: o,
716
717
  children: n
717
718
  });
718
- }, Le = () => {
719
+ }, Be = () => {
719
720
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
720
721
  return {
721
722
  has: (t) => e.has(t),
@@ -733,15 +734,15 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
733
734
  };
734
735
  }
735
736
  };
736
- }, Be = n(null), Ae = ({ store: e, children: t }) => {
737
- const n = a(Be), o = f(null);
737
+ }, Ae = n(null), Ne = ({ store: e, children: t }) => {
738
+ const n = s(Ae), o = f(null);
738
739
  let r = e ?? n;
739
- return r || (o.current || (o.current = Le()), r = o.current), x(Be.Provider, {
740
+ return r || (o.current || (o.current = Be()), r = o.current), x(Ae.Provider, {
740
741
  value: r,
741
742
  children: t
742
743
  });
743
- }, Ne = { "sheetxl-grid": "_sheetxl-grid_5yo0n_7" }, Fe = i(r((e, n) => {
744
- const { rowCount: r = 1, columnCount: i = 1, viewport: a, metrics: d, getRangeFromCell: u = U.cellToRange, hiddenRowsAt: m, hiddenColumnsAt: y, freezeLeft: b = 0, freezeTop: S = 0, propsFreezeLeft: E, propsFreezeTop: I, onFirstRender: C, children: R, wrapPane: P, onFocus: k, onBlur: D, className: T, style: O, ...$ } = e, B = z(k, [k]), A = z(D, [D]), N = z(C, [C]), [H, W] = p(_.Center), [j, G] = h((e) => e + 1, 0), X = g(() => new M({}), []), Y = a ?? X, [q, Z] = p(() => {
744
+ }, Fe = { "sheetxl-grid": "_sheetxl-grid_5yo0n_7" }, Ve = i(r((e, n) => {
745
+ const { rowCount: r = 1, columnCount: i = 1, viewport: s, metrics: d, getRangeFromCell: u = U.cellToRange, hiddenRowsAt: m, hiddenColumnsAt: y, freezeLeft: b = 0, freezeTop: S = 0, propsFreezeLeft: E, propsFreezeTop: I, onFirstRender: C, children: R, wrapPane: P, onFocus: k, onBlur: D, className: T, style: z, ...$ } = e, B = O(k, [k]), A = O(D, [D]), N = O(C, [C]), [H, W] = p(_.Center), [j, G] = h((e) => e + 1, 0), X = g(() => new M({}), []), Y = s ?? X, [q, Z] = p(() => {
745
746
  const e = Y.getClient();
746
747
  return {
747
748
  zoom: Y.getZoom(),
@@ -763,60 +764,60 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
763
764
  return e(), Y.subscribe(e);
764
765
  }, [Y]);
765
766
  const J = q.zoom, Q = g(() => {
766
- const e = d ?? Ve;
767
+ const e = d ?? He;
767
768
  return {
768
769
  getColOffset: (t) => e.getColOffset(t) * J,
769
770
  getColIndex: (t) => e.getColIndex(t / J),
770
771
  getRowOffset: (t) => e.getRowOffset(t) * J,
771
772
  getRowIndex: (t) => e.getRowIndex(t / J)
772
773
  };
773
- }, [d, J]), ee = z((e, t = !1) => pe(e, t, Q.getRowOffset, t ? 0 : r), [r, Q?.getRowOffset]), te = z(m ?? ee, [m]), ne = z((e, t = !1) => pe(e, t, Q.getColOffset, t ? i : 0), [i, Q?.getColOffset]), oe = z(y ?? ne, [y]), re = s(() => {
774
+ }, [d, J]), ee = O((e, t = !1) => me(e, t, Q.getRowOffset, t ? 0 : r), [r, Q?.getRowOffset]), te = O(m ?? ee, [m]), ne = O((e, t = !1) => me(e, t, Q.getColOffset, t ? i : 0), [i, Q?.getColOffset]), oe = O(y ?? ne, [y]), re = a(() => {
774
775
  G();
775
776
  }, []), le = g(() => Math.min(q.w, Q.getColOffset(i)), [
776
777
  j,
777
778
  Q.getColOffset,
778
779
  i,
779
780
  q.w
780
- ]), se = g(() => Math.min(q.h, Q.getRowOffset(r)), [
781
+ ]), ie = g(() => Math.min(q.h, Q.getRowOffset(r)), [
781
782
  j,
782
783
  Q.getRowOffset,
783
784
  r,
784
785
  q.h
785
- ]), ae = g(() => {
786
+ ]), se = g(() => {
786
787
  let e = NaN, t = null;
787
788
  return (n) => (n === e && t || (e = n, t = ((e) => {
788
- if (0 === se) return ze;
789
+ if (0 === ie) return ze;
789
790
  const t = [];
790
791
  let n = 0, o = 0;
791
792
  "number" == typeof S ? n = S : (n = S.index ?? 0, o = (S.offset ?? 0) * J);
792
- const l = o, i = Q.getRowOffset(n), s = i - l;
793
+ const l = o, i = Q.getRowOffset(n), a = i - l;
793
794
  if (n > 0) {
794
- const e = Te(Q, { top: o + Q.getRowOffset(0) }), r = Q.getRowIndex(l), a = Q.getRowIndex(i - 1);
795
+ const e = Oe(Q, { top: o + Q.getRowOffset(0) }), r = Q.getRowIndex(l), s = Q.getRowIndex(i - 1);
795
796
  let c;
796
797
  t[1] = {
797
798
  minIndex: r,
798
- maxIndex: a,
799
+ maxIndex: s,
799
800
  minCoord: 0,
800
801
  maxCoord: n - 1,
801
802
  minBounds: 0,
802
- maxBounds: s,
803
- visibleIndices: (e, t) => void 0 !== e && void 0 !== t ? he(te, e, t) : c || (c = Object.freeze(he(te, r, a)), c),
803
+ maxBounds: a,
804
+ visibleIndices: (e, t) => void 0 !== e && void 0 !== t ? fe(te, e, t) : c || (c = Object.freeze(fe(te, r, s)), c),
804
805
  metrics: e,
805
806
  maxVirtualBounds: i,
806
807
  scrollOffset: o,
807
808
  freezeOffset: o
808
809
  };
809
810
  }
810
- const a = Math.max(0, se - s), c = Te(Q, { top: e + s }), d = c.getRowIndex(0), u = c.getRowIndex(a - 1);
811
+ const s = Math.max(0, ie - a), c = Oe(Q, { top: e + a }), d = c.getRowIndex(0), u = c.getRowIndex(s - 1);
811
812
  let g;
812
813
  return t[0] = {
813
814
  minIndex: d,
814
815
  maxIndex: u,
815
816
  minCoord: n,
816
817
  maxCoord: r - 1,
817
- minBounds: s,
818
- maxBounds: a,
819
- visibleIndices: (e, t) => void 0 !== e && void 0 !== t ? he(te, e, t) : g || (g = Object.freeze(he(te, d, u)), g),
818
+ minBounds: a,
819
+ maxBounds: s,
820
+ visibleIndices: (e, t) => void 0 !== e && void 0 !== t ? fe(te, e, t) : g || (g = Object.freeze(fe(te, d, u)), g),
820
821
  metrics: c,
821
822
  maxVirtualBounds: Q.getRowOffset(r),
822
823
  scrollOffset: e,
@@ -828,45 +829,45 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
828
829
  Q.getRowIndex,
829
830
  Q.getRowOffset,
830
831
  te,
831
- se,
832
+ ie,
832
833
  r,
833
834
  S,
834
835
  J
835
- ]), ce = g(() => ae(0), [ae]), de = g(() => {
836
+ ]), ce = g(() => se(0), [se]), de = g(() => {
836
837
  let e = NaN, t = null;
837
838
  return (n) => (n === e && t || (e = n, t = ((e) => {
838
839
  if (0 === le) return ze;
839
840
  const t = [];
840
841
  let n = 0, o = 0;
841
842
  "number" == typeof b ? n = b : (n = b.index ?? 0, o = (b.offset ?? 0) * J);
842
- const r = o, l = Q.getColOffset(n), s = l - r;
843
+ const r = o, l = Q.getColOffset(n), a = l - r;
843
844
  if (n > 0) {
844
- const e = Te(Q, { left: o + Q.getColOffset(0) }), i = Q.getColIndex(r), a = Q.getColIndex(l - 1);
845
+ const e = Oe(Q, { left: o + Q.getColOffset(0) }), i = Q.getColIndex(r), s = Q.getColIndex(l - 1);
845
846
  let c;
846
847
  t[1] = {
847
848
  minIndex: i,
848
- maxIndex: a,
849
+ maxIndex: s,
849
850
  minCoord: 0,
850
851
  maxCoord: n - 1,
851
852
  minBounds: 0,
852
- maxBounds: s,
853
- visibleIndices: (e, t) => void 0 !== e && void 0 !== t ? he(oe, e, t) : c || (c = Object.freeze(he(oe, i, a)), c),
853
+ maxBounds: a,
854
+ visibleIndices: (e, t) => void 0 !== e && void 0 !== t ? fe(oe, e, t) : c || (c = Object.freeze(fe(oe, i, s)), c),
854
855
  metrics: e,
855
856
  maxVirtualBounds: l,
856
857
  scrollOffset: o,
857
858
  freezeOffset: o
858
859
  };
859
860
  }
860
- const a = Math.max(0, le - s), c = Te(Q, { left: e + s }), d = c.getColIndex(0), u = c.getColIndex(a - 1);
861
+ const s = Math.max(0, le - a), c = Oe(Q, { left: e + a }), d = c.getColIndex(0), u = c.getColIndex(s - 1);
861
862
  let g;
862
863
  return t[0] = {
863
864
  minIndex: d,
864
865
  maxIndex: u,
865
866
  minCoord: n,
866
867
  maxCoord: i - 1,
867
- minBounds: s,
868
- maxBounds: a,
869
- visibleIndices: (e, t) => void 0 !== e && void 0 !== t ? he(oe, e, t) : g || (g = Object.freeze(he(oe, d, u)), g),
868
+ minBounds: a,
869
+ maxBounds: s,
870
+ visibleIndices: (e, t) => void 0 !== e && void 0 !== t ? fe(oe, e, t) : g || (g = Object.freeze(fe(oe, d, u)), g),
870
871
  metrics: c,
871
872
  maxVirtualBounds: Q.getColOffset(i),
872
873
  scrollOffset: e,
@@ -882,7 +883,7 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
882
883
  i,
883
884
  b,
884
885
  J
885
- ]), ue = g(() => de(0), [de]), ge = f([]), [we, xe] = h((e) => e + 1, 0), ve = ce.length, ye = ue.length, be = g(() => {
886
+ ]), ue = g(() => de(0), [de]), ge = f([]), [he, xe] = h((e) => e + 1, 0), ve = ce.length, ye = ue.length, be = g(() => {
886
887
  const e = [], t = (t, n, o, r, l) => {
887
888
  if (t >= ye || n >= ve) return null;
888
889
  const i = {
@@ -902,7 +903,7 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
902
903
  bottom: l?.bottom ?? 0
903
904
  })
904
905
  };
905
- i.elemStage = x(Ee, {
906
+ i.elemStage = x(Ie, {
906
907
  ref: (e) => {
907
908
  e ? (i.refStage = e, xe()) : i.refStage = null;
908
909
  },
@@ -915,7 +916,7 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
915
916
  }
916
917
  }), e.push(i);
917
918
  };
918
- return t(0, 0, _.Center, Ke, Ue), t(0, 1, _.Top, je), t(1, 0, _.Left, Ge), t(1, 1, _.TopLeft, Xe), e;
919
+ return t(0, 0, _.Center, je, Ke), t(0, 1, _.Top, Ge), t(1, 0, _.Left, Xe), t(1, 1, _.TopLeft, Ye), e;
919
920
  }, [ve, ye]), Se = g(() => {
920
921
  let e = {};
921
922
  const t = {
@@ -923,21 +924,21 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
923
924
  rowStart: 0,
924
925
  colEnd: i - 1,
925
926
  rowEnd: r - 1
926
- }, n = (n) => ke(n, {
927
+ }, n = (n) => De(n, {
927
928
  rowDims: ce,
928
929
  columnDims: ue,
929
- computeRowDims: ae,
930
+ computeRowDims: se,
930
931
  computeColumnDims: de,
931
932
  viewport: Y,
932
933
  zoom: J,
933
934
  containerWidth: le,
934
- containerHeight: se,
935
+ containerHeight: ie,
935
936
  getRangeFromCell: u,
936
937
  invalidate: re,
937
938
  totalRange: t,
938
- getSurfacePointFromPointer: (e, t) => Oe(e, t),
939
- scrollTo: (e) => Je(e),
940
- scrollCellCoordsIntoView: (e, t, n) => Ze(e, t, n),
939
+ getSurfacePointFromPointer: (e, t) => $e(e, t),
940
+ scrollTo: (e) => Qe(e),
941
+ scrollCellCoordsIntoView: (e, t, n) => Je(e, t, n),
941
942
  getAllPanes: () => e
942
943
  }), o = be.length;
943
944
  for (let t = 0; t < o; t++) {
@@ -949,18 +950,18 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
949
950
  be,
950
951
  ce,
951
952
  ue,
952
- ae,
953
+ se,
953
954
  de,
954
955
  Y,
955
956
  u,
956
- we
957
- ]), Ie = ue[0]?.maxVirtualBounds ?? 0, Ce = ce[0]?.maxVirtualBounds ?? 0, Re = q.ready, Pe = g(() => {
957
+ he
958
+ ]), Ee = ue[0]?.maxVirtualBounds ?? 0, Ce = ce[0]?.maxVirtualBounds ?? 0, Re = q.ready, Me = g(() => {
958
959
  const e = ue[1], t = ce[1];
959
960
  return {
960
961
  left: e ? e.metrics.getColOffset(e.maxIndex + 1) : 0,
961
962
  top: t ? t.metrics.getRowOffset(t.maxIndex + 1) : 0
962
963
  };
963
- }, [ce, ue]), De = z((e) => {
964
+ }, [ce, ue]), Te = O((e) => {
964
965
  K.canUseDOM && setTimeout(() => {
965
966
  (Se[H]?.getElement() ?? Se[_.Center]?.getElement())?.focus({
966
967
  preventScroll: !0,
@@ -975,9 +976,9 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
975
976
  ge.current = [];
976
977
  }
977
978
  }, [Se]);
978
- const Oe = s((e, t) => {
979
+ const $e = a((e, t) => {
979
980
  F("number" == typeof e && "number" == typeof t, "Top and left should be a number.");
980
- const n = Qe.current?.getBoundingClientRect();
981
+ const n = et.current?.getBoundingClientRect();
981
982
  return n ? {
982
983
  x: e - n.x,
983
984
  y: t - n.y
@@ -985,44 +986,44 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
985
986
  x: e,
986
987
  y: t
987
988
  };
988
- }, []), Le = z((e, t) => {
989
+ }, []), Be = O((e, t) => {
989
990
  if (1 === Object.keys(Se).length) return Se[_.Center];
990
- const n = Oe(e, t);
991
+ const n = $e(e, t);
991
992
  if (!n) return Se[_.Center];
992
993
  const { x: o, y: r } = n;
993
994
  let l = null;
994
- const i = Ye, s = i.length;
995
- for (let e = 0; !l && e < s; e++) {
995
+ const i = qe, a = i.length;
996
+ for (let e = 0; !l && e < a; e++) {
996
997
  const t = Se[i[e]];
997
- t && me(o, r, t.getPaneBounds()) && (l = t);
998
+ t && we(o, r, t.getPaneBounds()) && (l = t);
998
999
  }
999
1000
  return l || (l = Se[_.Center]), l;
1000
1001
  }, [Se, u]);
1001
1002
  c(() => {
1002
1003
  const e = ue?.[1]?.scrollOffset ?? 0, t = ce?.[1]?.scrollOffset ?? 0;
1003
- Y.setContent(Ie, Ce, e, t);
1004
+ Y.setContent(Ee, Ce, e, t);
1004
1005
  }, [
1005
1006
  Y,
1006
- Ie,
1007
+ Ee,
1007
1008
  Ce,
1008
1009
  ue,
1009
1010
  ce
1010
1011
  ]);
1011
- const Be = z((e) => {
1012
+ const Ae = O((e) => {
1012
1013
  let t = e?.left ?? e?.[0], n = e?.top ?? e?.[1];
1013
1014
  if (void 0 === t && void 0 === n) return;
1014
1015
  const o = e?.behavior ?? "auto", r = Y.getTarget();
1015
- void 0 !== t && (t = r.left + (t ?? 0)), void 0 !== n && (n = r.top + (n ?? 0)), r.left === t && r.top === n || Je({
1016
+ void 0 !== t && (t = r.left + (t ?? 0)), void 0 !== n && (n = r.top + (n ?? 0)), r.left === t && r.top === n || Qe({
1016
1017
  left: t,
1017
1018
  top: n,
1018
1019
  behavior: o
1019
1020
  });
1020
- }, []), Fe = z((e) => void 0 !== e ? Se[e] ?? null : Se[H] ?? Se[_.Center] ?? null, [Se, H]), qe = z((e) => {
1021
+ }, []), Ve = O((e) => void 0 !== e ? Se[e] ?? null : Se[H] ?? Se[_.Center] ?? null, [Se, H]), Ze = O((e) => {
1021
1022
  const t = Se[H];
1022
1023
  if (!t) return Se[_.Center];
1023
1024
  const n = t.getScrollOrientation(), o = { ...t.getVisibleRange() };
1024
1025
  return n.vertical && (o.rowStart = ce[0].minCoord, o.rowEnd = ce[0].maxCoord), n.horizontal && (o.colStart = ue[0].minCoord, o.colEnd = ue[0].maxCoord), n && U.isCellWithinRange(e, o) ? t : Se[_.Center];
1025
- }, [Se, H]), Ze = z((e, t = {
1026
+ }, [Se, H]), Je = O((e, t = {
1026
1027
  inline: "nearest",
1027
1028
  block: "nearest"
1028
1029
  }, n = null) => {
@@ -1036,8 +1037,8 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
1036
1037
  if (r = Se[n], !r) return new Promise((e, t) => {
1037
1038
  t("Invalid view");
1038
1039
  });
1039
- } else r = qe(o);
1040
- const l = u(o), i = r.getMetrics(), s = i.getColOffset(l.colStart), a = i.getRowOffset(l.rowStart), c = i.getColOffset(l.colEnd + 1), d = i.getRowOffset(l.rowEnd + 1), g = r.getPaneBounds(), h = r.getTotalSize(), f = r.getScrollTopLeft(), p = ((e, t, n = !0) => {
1040
+ } else r = Ze(o);
1041
+ const l = u(o), i = r.getMetrics(), a = i.getColOffset(l.colStart), s = i.getRowOffset(l.rowStart), c = i.getColOffset(l.colEnd + 1), d = i.getRowOffset(l.rowEnd + 1), g = r.getPaneBounds(), h = r.getTotalSize(), f = r.getScrollTopLeft(), p = ((e, t, n = !0) => {
1041
1042
  n = !0 === n ? {
1042
1043
  block: "start",
1043
1044
  inline: "end"
@@ -1049,16 +1050,16 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
1049
1050
  inline: "end",
1050
1051
  ...n
1051
1052
  };
1052
- const o = fe(n.inline ?? "end", e.x, e.x + e.width, t.left, t.left + t.width, t.totalWidth), r = fe(n.block ?? "end", e.y, e.y + e.height, t.top, t.top + t.height, t.totalHeight);
1053
+ const o = pe(n.inline ?? "end", e.x, e.x + e.width, t.left, t.left + t.width, t.totalWidth), r = pe(n.block ?? "end", e.y, e.y + e.height, t.top, t.top + t.height, t.totalHeight);
1053
1054
  if (void 0 !== o || void 0 !== r) return {
1054
1055
  left: o ?? t.left,
1055
1056
  top: r ?? t.top
1056
1057
  };
1057
1058
  })({
1058
- x: s + f.left,
1059
- y: a + f.top,
1060
- width: c - s,
1061
- height: d - a
1059
+ x: a + f.left,
1060
+ y: s + f.top,
1061
+ width: c - a,
1062
+ height: d - s
1062
1063
  }, {
1063
1064
  left: f.left,
1064
1065
  top: f.top,
@@ -1069,13 +1070,13 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
1069
1070
  }, t);
1070
1071
  if (!p) return Promise.resolve({ ...f });
1071
1072
  const m = { ...p }, { left: w, top: x } = Y.getScroll();
1072
- void 0 !== m.left && (m.left > w ? m.left += _e : m.left < w && (m.left -= He)), void 0 !== m.top && (m.top > x ? m.top += _e : m.top < x && (m.top -= He));
1073
+ void 0 !== m.left && (m.left > w ? m.left += We : m.left < w && (m.left -= _e)), void 0 !== m.top && (m.top > x ? m.top += We : m.top < x && (m.top -= _e));
1073
1074
  const v = r.getScrollOrientation();
1074
1075
  v.horizontal && void 0 !== e.colIndex || delete m.left, v.vertical && void 0 !== e.rowIndex || delete m.top;
1075
- const y = void 0 !== m.left ? Math.abs(m.left - w) : 0, b = void 0 !== m.top ? Math.abs(m.top - x) : 0, S = ("object" == typeof t ? t?.behavior : void 0) ?? (Math.max(y, b) < We || !Y.isSettled() ? "instant" : "smooth");
1076
+ const y = void 0 !== m.left ? Math.abs(m.left - w) : 0, b = void 0 !== m.top ? Math.abs(m.top - x) : 0, S = ("object" == typeof t ? t?.behavior : void 0) ?? (Math.max(y, b) < Ue || !Y.isSettled() ? "instant" : "smooth");
1076
1077
  return new Promise((e, t) => {
1077
1078
  try {
1078
- Je({
1079
+ Qe({
1079
1080
  ...m,
1080
1081
  behavior: S
1081
1082
  }), e(m);
@@ -1084,47 +1085,50 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
1084
1085
  }
1085
1086
  });
1086
1087
  }, [
1087
- Ie,
1088
+ Ee,
1088
1089
  Ce,
1089
1090
  Se,
1090
1091
  u
1091
- ]), Je = z((e) => {
1092
+ ]), Qe = O((e) => {
1092
1093
  const t = e?.left ?? e?.[0], n = e?.top ?? e?.[1], o = Y.getTarget(), r = t ?? o.left, l = n ?? o.top, i = "smooth" === e?.behavior;
1093
1094
  Y.setTarget(r, l, i);
1094
- }, []), Qe = L(n, () => ({
1095
- focus: De,
1095
+ }, []), et = L(n, () => ({
1096
+ focus: Te,
1096
1097
  invalidate: re,
1097
- scrollTo: Je,
1098
- scrollBy: Be,
1099
- scrollCellCoordsIntoView: Ze,
1100
- getPaneFromClient: Le,
1101
- getPaneFromCell: qe,
1102
- getPane: Fe,
1098
+ scrollTo: Qe,
1099
+ scrollBy: Ae,
1100
+ scrollCellCoordsIntoView: Je,
1101
+ getPaneFromClient: Be,
1102
+ getPaneFromCell: Ze,
1103
+ getPane: Ve,
1103
1104
  onPaneChangeOnce: (e) => {
1104
1105
  ge.current.push(e);
1105
1106
  }
1106
1107
  }), [Se]);
1107
- c(() => Y.observe(Qe.current), [Y]);
1108
- const et = (e, t) => {
1108
+ c(() => Y.observe(et.current), [Y]);
1109
+ const tt = (e, t) => {
1109
1110
  const n = ((e) => {
1110
1111
  if (!e) return null;
1111
1112
  if (!Array.isArray(e)) return e;
1112
1113
  const t = (e) => l(e) && null != e.props?.zIndex ? e.props.zIndex : 0;
1113
- return [...e].sort((e, n) => t(e) - t(n)).map((e, t) => l(e) ? o(Me.Provider, {
1114
+ return [...e].sort((e, n) => t(e) - t(n)).map((e, t) => l(e) ? o(Pe.Provider, {
1114
1115
  key: e.key ?? `layer-${t}`,
1115
1116
  value: t
1116
1117
  }, e) : e);
1117
1118
  })(t);
1118
- return n ? x($e, {
1119
- pane: e,
1120
- viewport: Y,
1121
- children: P ? P(e, n) : n
1119
+ return n ? x(ke.Provider, {
1120
+ value: !1,
1121
+ children: x(Le, {
1122
+ pane: e,
1123
+ viewport: Y,
1124
+ children: P ? P(e, n) : n
1125
+ })
1122
1126
  }) : null;
1123
- }, tt = g(() => {
1127
+ }, nt = g(() => {
1124
1128
  const e = {}, t = Object.keys(Se), n = t.length;
1125
1129
  for (let o = 0; o < n; o++) {
1126
1130
  const n = t[o];
1127
- e[n] = et(Se[n], R);
1131
+ e[n] = tt(Se[n], R);
1128
1132
  }
1129
1133
  return e;
1130
1134
  }, [
@@ -1134,26 +1138,26 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
1134
1138
  P,
1135
1139
  r,
1136
1140
  i
1137
- ]), nt = g(() => 0 === Pe.left ? null : x(ie, {
1141
+ ]), ot = g(() => 0 === Me.left ? null : x(ae, {
1138
1142
  linePoints: [
1139
1143
  0,
1140
1144
  0,
1141
1145
  0,
1142
- se + 1
1146
+ ie + 1
1143
1147
  ],
1144
1148
  bounds: {
1145
- x: Pe.left,
1149
+ x: Me.left,
1146
1150
  y: 0,
1147
1151
  width: 1,
1148
- height: se + 1
1152
+ height: ie + 1
1149
1153
  },
1150
1154
  ...E
1151
1155
  }), [
1152
1156
  j,
1153
- Pe.left,
1154
- se,
1157
+ Me.left,
1158
+ ie,
1155
1159
  E
1156
- ]), ot = g(() => 0 === Pe.top ? null : x(ie, {
1160
+ ]), rt = g(() => 0 === Me.top ? null : x(ae, {
1157
1161
  linePoints: [
1158
1162
  0,
1159
1163
  0,
@@ -1162,20 +1166,20 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
1162
1166
  ],
1163
1167
  bounds: {
1164
1168
  x: 0,
1165
- y: Pe.top,
1169
+ y: Me.top,
1166
1170
  width: le + 1,
1167
1171
  height: 1
1168
1172
  },
1169
1173
  ...I
1170
1174
  }), [
1171
1175
  j,
1172
- Pe.top,
1176
+ Me.top,
1173
1177
  le,
1174
1178
  I
1175
- ]), rt = f(!1), lt = g(() => {
1179
+ ]), lt = f(!1), it = g(() => {
1176
1180
  if (!Re) return null;
1177
1181
  const e = (e, n) => {
1178
- const o = e.anchor, r = n.getPaneBounds(), l = Pe.left > 0, i = Pe.top > 0, s = i && (o === _.Center || o === _.Left), a = i && (o === _.Top || o === _.TopLeft), c = l && (o === _.Center || o === _.Top), d = l && (o === _.Left || o === _.TopLeft), u = 1e6, g = s ? -1 : -1e6, h = c ? -1 : -1e6, f = d ? r.width + 2 : u, p = a ? r.height + 2 : u, m = s || a || c || d, w = {
1182
+ const o = e.anchor, r = n.getPaneBounds(), l = Me.left > 0, i = Me.top > 0, a = i && (o === _.Center || o === _.Left), s = i && (o === _.Top || o === _.TopLeft), c = l && (o === _.Center || o === _.Top), d = l && (o === _.Left || o === _.TopLeft), u = 1e6, g = a ? -1 : -1e6, h = c ? -1 : -1e6, f = d ? r.width + 2 : u, p = s ? r.height + 2 : u, m = a || s || c || d, w = {
1179
1183
  position: "absolute",
1180
1184
  left: r.x,
1181
1185
  top: r.y,
@@ -1183,10 +1187,10 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
1183
1187
  height: r.height,
1184
1188
  clip: m ? `rect(${g}px, ${f}px, ${p}px, ${h}px)` : void 0
1185
1189
  };
1186
- return x($e, {
1190
+ return x(Le, {
1187
1191
  pane: n,
1188
1192
  viewport: Y,
1189
- children: e.elemStage ? t(e.elemStage, { style: w }, tt?.[o]) : null
1193
+ children: e.elemStage ? t(e.elemStage, { style: w }, nt?.[o]) : null
1190
1194
  }, `pane:${o}`);
1191
1195
  }, n = be.length, o = new Array(n);
1192
1196
  for (let t = 0; t < n; t++) {
@@ -1195,105 +1199,105 @@ var Ie = Object.freeze([]), Ce = (e, t) => {
1195
1199
  }
1196
1200
  return v(w, { children: [
1197
1201
  o,
1198
- nt,
1199
- ot
1202
+ ot,
1203
+ rt
1200
1204
  ] });
1201
1205
  }, [
1202
1206
  Se,
1203
1207
  be,
1204
- tt,
1208
+ nt,
1205
1209
  le,
1206
- se,
1210
+ ie,
1207
1211
  Re,
1208
- Pe
1212
+ Me
1209
1213
  ]);
1210
1214
  return c(() => {
1211
- !rt.current && lt && Re && (rt.current = !0, N?.(Qe.current));
1212
- }, [lt, Re]), x("div", {
1213
- ref: Qe,
1214
- className: V(T, "grid-surface", Ne["sheetxl-grid"]),
1215
+ !lt.current && it && Re && (lt.current = !0, N?.(et.current));
1216
+ }, [it, Re]), x("div", {
1217
+ ref: et,
1218
+ className: V(T, "grid-surface", Fe["sheetxl-grid"]),
1215
1219
  style: {
1216
1220
  overflow: "hidden",
1217
- ...O
1221
+ ...z
1218
1222
  },
1219
1223
  ...$,
1220
- children: x(Ae, { children: lt })
1224
+ children: x(Ne, { children: it })
1221
1225
  });
1222
1226
  }));
1223
- Fe.displayName = "GridSurface";
1224
- var Ve = Object.freeze({
1227
+ Ve.displayName = "GridSurface";
1228
+ var He = Object.freeze({
1225
1229
  getColOffset: (e) => 75 * e,
1226
1230
  getColIndex: (e) => Math.floor(e / 75),
1227
1231
  getRowOffset: (e) => 20 * e,
1228
1232
  getRowIndex: (e) => Math.floor(e / 20)
1229
- }), He = 0, _e = 20, We = 150, Ue = Object.freeze({
1233
+ }), _e = 0, We = 20, Ue = 150, Ke = Object.freeze({
1230
1234
  bottom: -4,
1231
1235
  right: -4
1232
- }), Ke = Object.freeze({
1236
+ }), je = Object.freeze({
1233
1237
  horizontal: !0,
1234
1238
  vertical: !0
1235
- }), je = Object.freeze({
1239
+ }), Ge = Object.freeze({
1236
1240
  horizontal: !0,
1237
1241
  vertical: !1
1238
- }), Ge = Object.freeze({
1242
+ }), Xe = Object.freeze({
1239
1243
  horizontal: !1,
1240
1244
  vertical: !0
1241
- }), Xe = Object.freeze({
1245
+ }), Ye = Object.freeze({
1242
1246
  horizontal: !1,
1243
1247
  vertical: !1
1244
- }), Ye = [
1248
+ }), qe = [
1245
1249
  _.TopLeft,
1246
1250
  _.Top,
1247
1251
  _.Left,
1248
1252
  _.Center
1249
1253
  ];
1250
- function qe() {
1251
- const e = a(Oe);
1254
+ function Ze() {
1255
+ const e = s($e);
1252
1256
  if (!e) throw new Error("useGridPane must be used within a GridPaneProvider");
1253
1257
  return e.pane;
1254
1258
  }
1255
- function Ze() {
1256
- return a(Oe)?.pane ?? null;
1259
+ function Je() {
1260
+ return s($e)?.pane ?? null;
1257
1261
  }
1258
- function Je(e, t) {
1259
- const n = a(Be), o = f(null);
1260
- o.current || (o.current = Le());
1262
+ function Qe(e, t) {
1263
+ const n = s(Ae), o = f(null);
1264
+ o.current || (o.current = Be());
1261
1265
  const r = n ?? o.current, l = `k:${e}`, i = f(null);
1262
1266
  null === i.current && (i.current = { v: "function" == typeof t ? t() : t });
1263
- const c = s(() => r.has(l) ? r.get(l) : i.current.v, [r, l]);
1264
- return [m(s((e) => r.subscribe(l, e), [r, l]), c, c), s((e) => {
1267
+ const c = a(() => r.has(l) ? r.get(l) : i.current.v, [r, l]);
1268
+ return [m(a((e) => r.subscribe(l, e), [r, l]), c, c), a((e) => {
1265
1269
  const t = r.has(l) ? r.get(l) : i.current.v;
1266
1270
  r.set(l, "function" == typeof e ? e(t) : e);
1267
1271
  }, [r, l])];
1268
1272
  }
1269
- var Qe = () => ({
1270
- zIndex: a(Me),
1271
- pane: Ze()
1272
- }), et = i((e) => {
1273
- const { onPointerDown: t, onPointerMove: n, onPointerUp: o, onPointerLeave: r, onMouseDown: l, onMouseEnter: i, onMouseLeave: s, onMouseMove: d, onMouseOut: u, onMouseOver: g, onMouseUp: h, onDoubleClick: p, onKeyDown: m, onKeyPress: w, onKeyUp: v, onFocus: y, onBlur: b, onContextMenu: S, zIndex: E, className: I, children: C } = e, R = a(Pe);
1273
+ var et = () => ({
1274
+ zIndex: s(Pe),
1275
+ pane: Je()
1276
+ }), tt = i((e) => {
1277
+ const { onPointerDown: t, onPointerMove: n, onPointerUp: o, onPointerLeave: r, onMouseDown: l, onMouseEnter: i, onMouseLeave: a, onMouseMove: d, onMouseOut: u, onMouseOver: g, onMouseUp: h, onDoubleClick: p, onKeyDown: m, onKeyPress: w, onKeyUp: v, onFocus: y, onBlur: b, onContextMenu: S, zIndex: E, className: I, children: C } = e, R = s(ke);
1274
1278
  c(() => {
1275
- R && !nt && (nt = !0, console.error("<Layer> nested inside another <Layer>. Layers exist only as direct children of the grid (law 4: the stack is flat) — a composite renders exactly one Layer at its root. For a full-view container inside a layer, use <VirtualDiv fill>. This error fires once."));
1279
+ R && !ot && (ot = !0, console.error("<Layer> nested inside another <Layer>. Layers exist only as direct children of the grid (law 4: the stack is flat) — a composite renders exactly one Layer at its root. For a full-view container inside a layer, use <VirtualDiv fill>. This error fires once."));
1276
1280
  }, [R]);
1277
- const M = Se(Ze()), P = a(Me), k = f({});
1281
+ const M = Ee(Je()), P = s(Pe), k = f({});
1278
1282
  k.current = {
1279
- pointerdown: tt(t),
1280
- pointermove: tt(n),
1281
- pointerup: tt(o),
1282
- pointerleave: tt(r),
1283
- mousedown: tt(l),
1284
- mouseenter: tt(i),
1285
- mouseleave: tt(s),
1286
- mousemove: tt(d),
1287
- mouseout: tt(u),
1288
- mouseover: tt(g),
1289
- mouseup: tt(h),
1290
- dblclick: tt(p),
1291
- keydown: tt(m),
1292
- keypress: tt(w),
1293
- keyup: tt(v),
1294
- focus: tt(y),
1295
- blur: tt(b),
1296
- contextmenu: tt(S)
1283
+ pointerdown: nt(t),
1284
+ pointermove: nt(n),
1285
+ pointerup: nt(o),
1286
+ pointerleave: nt(r),
1287
+ mousedown: nt(l),
1288
+ mouseenter: nt(i),
1289
+ mouseleave: nt(a),
1290
+ mousemove: nt(d),
1291
+ mouseout: nt(u),
1292
+ mouseover: nt(g),
1293
+ mouseup: nt(h),
1294
+ dblclick: nt(p),
1295
+ keydown: nt(m),
1296
+ keypress: nt(w),
1297
+ keyup: nt(v),
1298
+ focus: nt(y),
1299
+ blur: nt(b),
1300
+ contextmenu: nt(S)
1297
1301
  };
1298
1302
  const D = f(null);
1299
1303
  return c(() => {
@@ -1318,24 +1322,24 @@ var Qe = () => ({
1318
1322
  onKeyPress: w,
1319
1323
  onKeyUp: v,
1320
1324
  onContextMenu: S,
1321
- children: null == C ? null : x(Pe.Provider, {
1325
+ children: null == C ? null : x(ke.Provider, {
1322
1326
  value: !0,
1323
1327
  children: C
1324
1328
  })
1325
1329
  });
1326
1330
  });
1327
- et.displayName = "Layer";
1328
- var tt = (e) => e ? (t) => e(t) : void 0, nt = !1, ot = !1, rt = "_virtual-div_16eab_1", lt = i(r((e, t) => {
1331
+ tt.displayName = "Layer";
1332
+ var nt = (e) => e ? (t) => e(t) : void 0, ot = !1, rt = !1, lt = "_virtual-div_16eab_1", it = i(r((e, t) => {
1329
1333
  const { range: n, bounds: o, fill: r = !1, clipInsets: l, disableAlign: i = !1, coverGridlines: d = !1, alignWidth: u, keepMounted: g = !1, className: h, style: p, children: m, ...w } = e;
1330
- a(Pe) || it || (it = !0, console.warn("VirtualDiv rendered outside a <Layer>. The grid's children are Layers; place VirtualDivs inside one (law 4: the stack is flat). This warning fires once."));
1331
- const v = f(null), y = s((e) => {
1334
+ s(ke) || at || (at = !0, console.warn("VirtualDiv rendered outside a <Layer>. The grid's children are Layers; place VirtualDivs inside one (law 4: the stack is flat). This warning fires once."));
1335
+ const v = f(null), y = a((e) => {
1332
1336
  v.current = e, "function" == typeof t ? t(e) : t && (t.current = e);
1333
1337
  }, [t]);
1334
1338
  (({ getElement: e, handlerProps: t }) => {
1335
- const n = Se(Ze()), o = a(Me);
1339
+ const n = Ee(Je()), o = s(Pe);
1336
1340
  let r = !1;
1337
1341
  if (t) {
1338
- for (let e = 0; e < ve.length; e++) if ("function" == typeof t[ve[e]]) {
1342
+ for (let e = 0; e < ye.length; e++) if ("function" == typeof t[ye[e]]) {
1339
1343
  r = !0;
1340
1344
  break;
1341
1345
  }
@@ -1353,7 +1357,7 @@ var tt = (e) => e ? (t) => e(t) : void 0, nt = !1, ot = !1, rt = "_virtual-div_1
1353
1357
  getElement: () => l.current.getElement(),
1354
1358
  hasHandlers: r,
1355
1359
  getHandler: r ? (e) => {
1356
- const t = xe[e];
1360
+ const t = ve[e];
1357
1361
  if (void 0 === t) return;
1358
1362
  const n = l.current.handlerProps?.[t];
1359
1363
  return "function" == typeof n ? (e) => n(e) : void 0;
@@ -1369,13 +1373,13 @@ var tt = (e) => e ? (t) => e(t) : void 0, nt = !1, ot = !1, rt = "_virtual-div_1
1369
1373
  handlerProps: w
1370
1374
  });
1371
1375
  const b = (({ range: e, bounds: t, fill: n, clipInsets: o }) => {
1372
- const r = qe();
1376
+ const r = Ze();
1373
1377
  if (!r) return null;
1374
1378
  let l = null, i = !1;
1375
1379
  if (e) l = r.getBoundsFromRange(e), i = null === r.toClipBounds(l, o);
1376
1380
  else if (t) i = null === r.toClipBounds(t, o), l = t;
1377
1381
  else {
1378
- if (!n) return ot || (ot = !0, console.warn("VirtualDiv: provide exactly one of 'range' | 'bounds' | 'fill'. (The implicit \"no placement = pane-sized\" fallback was removed — use 'fill'.) This warning fires once.")), null;
1382
+ if (!n) return rt || (rt = !0, console.warn("VirtualDiv: provide exactly one of 'range' | 'bounds' | 'fill'. (The implicit \"no placement = pane-sized\" fallback was removed — use 'fill'.) This warning fires once.")), null;
1379
1383
  {
1380
1384
  const e = r.getPaneBounds();
1381
1385
  l = {
@@ -1410,14 +1414,14 @@ var tt = (e) => e ? (t) => e(t) : void 0, nt = !1, ot = !1, rt = "_virtual-div_1
1410
1414
  const e = d ? 1 / C : 0;
1411
1415
  P = S.snapDeviceEdge(E.x, C), k = S.snapDeviceEdge(E.y, C), D = S.snapDeviceEdge(E.x + E.width, C) + e - P, T = S.snapDeviceEdge(E.y + E.height, C) + e - k;
1412
1416
  }
1413
- const { transform: z, ...O } = p ?? {}, $ = {
1417
+ const { transform: O, ...z } = p ?? {}, $ = {
1414
1418
  x: E.x - P,
1415
1419
  y: E.y - k,
1416
1420
  width: E.width,
1417
1421
  height: E.height
1418
1422
  };
1419
1423
  return x("div", {
1420
- className: H(h, rt),
1424
+ className: H(h, lt),
1421
1425
  style: {
1422
1426
  width: `${D}px`,
1423
1427
  height: `${T}px`,
@@ -1426,19 +1430,19 @@ var tt = (e) => e ? (t) => e(t) : void 0, nt = !1, ot = !1, rt = "_virtual-div_1
1426
1430
  borderWidth: `${M}px`,
1427
1431
  borderStyle: "solid"
1428
1432
  } : void 0,
1429
- ...O,
1430
- transform: `translate(${P}px, ${k}px)${z ? ` ${z}` : ""}`
1433
+ ...z,
1434
+ transform: `translate(${P}px, ${k}px)${O ? ` ${O}` : ""}`
1431
1435
  },
1432
1436
  ...w,
1433
1437
  ref: y,
1434
- children: null == m ? null : x(re.Provider, {
1438
+ children: null == m ? null : x(le.Provider, {
1435
1439
  value: $,
1436
1440
  children: m
1437
1441
  })
1438
1442
  });
1439
1443
  }));
1440
- lt.displayName = "VirtualDiv";
1441
- var it = !1, st = (e, t, n, o) => ({
1444
+ it.displayName = "VirtualDiv";
1445
+ var at = !1, st = (e, t, n, o) => ({
1442
1446
  x: e,
1443
1447
  y: t,
1444
1448
  width: n,
@@ -1447,52 +1451,52 @@ var it = !1, st = (e, t, n, o) => ({
1447
1451
  left: e,
1448
1452
  right: e + n,
1449
1453
  bottom: t + o
1450
- }), at = st(0, 0, 0, 0), ct = (e) => {
1454
+ }), ct = st(0, 0, 0, 0), dt = (e) => {
1451
1455
  const t = e.getElement()?.getBoundingClientRect?.();
1452
1456
  return {
1453
1457
  x: t?.left ?? 0,
1454
1458
  y: t?.top ?? 0
1455
1459
  };
1456
- }, dt = (e) => {
1460
+ }, ut = (e) => {
1457
1461
  const t = e.getElement()?.getBoundingClientRect?.();
1458
- return t ? st(t.left, t.top, t.width, t.height) : at;
1459
- }, ut = {
1462
+ return t ? st(t.left, t.top, t.width, t.height) : ct;
1463
+ }, gt = {
1460
1464
  side: "t",
1461
1465
  align: "center"
1462
- }, gt = [
1466
+ }, ht = [
1463
1467
  _.TopLeft,
1464
1468
  _.Top,
1465
1469
  _.Left,
1466
1470
  _.Center
1467
- ], ht = /* @__PURE__ */ new Set([_.Top, _.TopLeft]), ft = /* @__PURE__ */ new Set([_.Left, _.TopLeft]), pt = (e, t, n, o, r) => {
1468
- let l = null, i = null, s = Infinity, a = !1;
1469
- for (let c = 0; c < gt.length; c++) {
1470
- const d = e[gt[c]];
1471
+ ], ft = /* @__PURE__ */ new Set([_.Top, _.TopLeft]), pt = /* @__PURE__ */ new Set([_.Left, _.TopLeft]), mt = (e, t, n, o, r) => {
1472
+ let l = null, i = null, a = Infinity, s = !1;
1473
+ for (let c = 0; c < ht.length; c++) {
1474
+ const d = e[ht[c]];
1471
1475
  if (!d) continue;
1472
1476
  const u = d.getVisibleRange(), g = "row" === t ? u.rowStart : u.colStart, h = "row" === t ? u.rowEnd : u.colEnd;
1473
1477
  if (n > h || o < g) continue;
1474
- a = !0, !l && r >= g && r <= h && (l = d);
1478
+ s = !0, !l && r >= g && r <= h && (l = d);
1475
1479
  const f = r < g ? g - r : r > h ? r - h : 0;
1476
- f < s && (s = f, i = d);
1480
+ f < a && (a = f, i = d);
1477
1481
  }
1478
1482
  return {
1479
1483
  pane: l ?? i,
1480
- visible: a
1484
+ visible: s
1481
1485
  };
1482
- }, mt = (e, t) => {
1483
- const n = ht.has(e.getAnchor()), o = ft.has(t.getAnchor());
1484
- return n && o ? _.TopLeft : n ? _.Top : o ? _.Left : _.Center;
1485
1486
  }, wt = (e, t) => {
1486
- const n = dt(e), o = e.getBoundsFromRange(t);
1487
- return st(n.left + o.x, n.top + o.y, o.width, o.height);
1487
+ const n = ft.has(e.getAnchor()), o = pt.has(t.getAnchor());
1488
+ return n && o ? _.TopLeft : n ? _.Top : o ? _.Left : _.Center;
1488
1489
  }, xt = (e, t) => {
1490
+ const n = ut(e), o = e.getBoundsFromRange(t);
1491
+ return st(n.left + o.x, n.top + o.y, o.width, o.height);
1492
+ }, vt = (e, t) => {
1489
1493
  const n = (t.left + t.right) / 2, o = (t.top + t.bottom) / 2;
1490
1494
  return o < e.top ? "t" : o > e.bottom ? "b" : n < e.left ? "l" : n > e.right ? "r" : null;
1491
- }, vt = (e, t, n = "data", o = 0, r = ut, l = "hide") => {
1495
+ }, yt = (e, t, n = "data", o = 0, r = gt, l = "hide") => {
1492
1496
  if (!e) return {
1493
- rect: at,
1497
+ rect: ct,
1494
1498
  clipped: !0,
1495
- boundaryRect: at,
1499
+ boundaryRect: ct,
1496
1500
  clampedTo: null,
1497
1501
  anchorPoint: {
1498
1502
  x: 0,
@@ -1507,8 +1511,12 @@ var it = !1, st = (e, t, n, o) => ({
1507
1511
  const e = t;
1508
1512
  return st(e.x, e.y, e.width, e.height);
1509
1513
  }
1514
+ if ("viewport" === t) {
1515
+ const t = e.getElement()?.ownerDocument?.documentElement;
1516
+ if (t) return st(0, 0, t.clientWidth, t.clientHeight);
1517
+ }
1510
1518
  if ("pane" === t) {
1511
- const t = ct(e), n = e.getPaneBounds();
1519
+ const t = dt(e), n = e.getPaneBounds();
1512
1520
  return st(t.x, t.y, n.width, n.height);
1513
1521
  }
1514
1522
  const n = e.getAllPanes();
@@ -1518,11 +1526,11 @@ var it = !1, st = (e, t, n, o) => ({
1518
1526
  t && (o = Math.min(o, t.left), r = Math.min(r, t.top), l = Math.max(l, t.right), i = Math.max(i, t.bottom));
1519
1527
  }
1520
1528
  if (o === Infinity) {
1521
- const t = ct(e), n = e.getPaneBounds();
1529
+ const t = dt(e), n = e.getPaneBounds();
1522
1530
  return st(t.x, t.y, n.width, n.height);
1523
1531
  }
1524
1532
  return st(o, r, l - o, i - r);
1525
- })(e, n), s = (e) => {
1533
+ })(e, n), a = (e) => {
1526
1534
  if (o <= 0) return !1;
1527
1535
  const t = (n = e, r = i, {
1528
1536
  w: Math.min(n.right, r.right) - Math.max(n.left, r.left),
@@ -1532,7 +1540,7 @@ var it = !1, st = (e, t, n, o) => ({
1532
1540
  return t.w <= o || t.h <= o;
1533
1541
  };
1534
1542
  if ("point" in t) {
1535
- const n = st(t.point.x, t.point.y, 0, 0), o = xt(i, n), r = e.getPaneFromPointer(t.point.x, t.point.y);
1543
+ const n = st(t.point.x, t.point.y, 0, 0), o = vt(i, n), r = e.getPaneFromPointer(t.point.x, t.point.y);
1536
1544
  return {
1537
1545
  rect: n,
1538
1546
  clipped: null !== o,
@@ -1545,10 +1553,10 @@ var it = !1, st = (e, t, n, o) => ({
1545
1553
  };
1546
1554
  }
1547
1555
  if ("edge" in t) {
1548
- const n = ct(e), o = e.getPaneBounds();
1556
+ const n = dt(e), o = e.getPaneBounds();
1549
1557
  let r = n.x + o.width / 2, l = n.y + o.height / 2;
1550
1558
  "t" === t.edge ? l = n.y : "b" === t.edge ? l = n.y + o.height : "l" === t.edge ? r = n.x : "r" === t.edge && (r = n.x + o.width);
1551
- const s = e.getPaneFromPointer(r, l) ?? e;
1559
+ const a = e.getPaneFromPointer(r, l) ?? e;
1552
1560
  return {
1553
1561
  rect: st(r, l, 0, 0),
1554
1562
  clipped: !1,
@@ -1558,13 +1566,13 @@ var it = !1, st = (e, t, n, o) => ({
1558
1566
  x: r,
1559
1567
  y: l
1560
1568
  },
1561
- owner: s.getAnchor(),
1569
+ owner: a.getAnchor(),
1562
1570
  slid: null,
1563
1571
  outOfView: !1
1564
1572
  };
1565
1573
  }
1566
1574
  if ("bounds" in t) {
1567
- const n = ct(e), o = t.bounds, l = e.toClipBounds(o, 0), c = st(n.x + o.x, n.y + o.y, o.width, o.height), d = null === l || s(c), u = ((e, t) => {
1575
+ const n = dt(e), o = t.bounds, l = e.toClipBounds(o, 0), c = st(n.x + o.x, n.y + o.y, o.width, o.height), d = null === l || a(c), u = ((e, t) => {
1568
1576
  const { side: n, align: o = "center" } = t;
1569
1577
  if ("t" === n || "b" === n) {
1570
1578
  const t = "t" === n ? e.top : e.bottom;
@@ -1582,14 +1590,14 @@ var it = !1, st = (e, t, n, o) => ({
1582
1590
  rect: c,
1583
1591
  clipped: d,
1584
1592
  boundaryRect: i,
1585
- clampedTo: xt(i, (a = u, st(a.x, a.y, 0, 0))),
1593
+ clampedTo: vt(i, (s = u, st(s.x, s.y, 0, 0))),
1586
1594
  anchorPoint: u,
1587
1595
  owner: e.getAnchor(),
1588
1596
  slid: null,
1589
1597
  outOfView: d
1590
1598
  };
1591
1599
  }
1592
- var a;
1600
+ var s;
1593
1601
  const c = ((e) => {
1594
1602
  if ("range" in e) return e.range;
1595
1603
  if ("cell" in e) {
@@ -1613,29 +1621,29 @@ var it = !1, st = (e, t, n, o) => ({
1613
1621
  rowIndex: "start" === o ? e.rowStart : "end" === o ? e.rowEnd : r,
1614
1622
  colIndex: i
1615
1623
  };
1616
- })(c, r), g = pt(d, "row", c.rowStart, c.rowEnd, u.rowIndex), h = pt(d, "col", c.colStart, c.colEnd, u.colIndex), f = g.visible && h.visible, p = g.pane ?? d[_.Center] ?? e, m = h.pane ?? d[_.Center] ?? e, w = wt(p, c), x = wt(m, c), { side: v, align: y = "center" } = r;
1624
+ })(c, r), g = mt(d, "row", c.rowStart, c.rowEnd, u.rowIndex), h = mt(d, "col", c.colStart, c.colEnd, u.colIndex), f = g.visible && h.visible, p = g.pane ?? d[_.Center] ?? e, m = h.pane ?? d[_.Center] ?? e, w = xt(p, c), x = xt(m, c), { side: v, align: y = "center" } = r;
1617
1625
  let b, S;
1618
1626
  "t" === v || "b" === v ? (S = "t" === v ? w.top : w.bottom, b = "start" === y ? x.left : "end" === y ? x.right : (x.left + x.right) / 2) : (b = "l" === v ? x.left : x.right, S = "start" === y ? w.top : "end" === y ? w.bottom : (w.top + w.bottom) / 2);
1619
- const E = dt(m), I = dt(p), C = (e) => Math.max(E.left, Math.min(E.right, e)), R = (e) => Math.max(I.top, Math.min(I.bottom, e)), M = C(b), P = R(S), k = {
1627
+ const E = ut(m), I = ut(p), C = (e) => Math.max(E.left, Math.min(E.right, e)), R = (e) => Math.max(I.top, Math.min(I.bottom, e)), M = C(b), P = R(S), k = {
1620
1628
  x: M,
1621
1629
  y: P
1622
- }, D = C(x.left), T = R(w.top), z = st(D, T, C(x.right) - D, R(w.bottom) - T), O = M - b, $ = P - S, L = Math.abs($) >= Math.abs(O) ? $ < 0 ? "b" : $ > 0 ? "t" : O < 0 ? "r" : O > 0 ? "l" : null : O < 0 ? "r" : O > 0 ? "l" : $ < 0 ? "b" : $ > 0 ? "t" : null, B = O || $ ? {
1623
- dx: O,
1630
+ }, D = C(x.left), T = R(w.top), O = st(D, T, C(x.right) - D, R(w.bottom) - T), z = M - b, $ = P - S, L = Math.abs($) >= Math.abs(z) ? $ < 0 ? "b" : $ > 0 ? "t" : z < 0 ? "r" : z > 0 ? "l" : null : z < 0 ? "r" : z > 0 ? "l" : $ < 0 ? "b" : $ > 0 ? "t" : null, B = z || $ ? {
1631
+ dx: z,
1624
1632
  dy: $,
1625
- distance: Math.hypot(O, $),
1633
+ distance: Math.hypot(z, $),
1626
1634
  direction: L ?? "t"
1627
1635
  } : null;
1628
1636
  return f || "hide" !== l ? {
1629
- rect: z,
1637
+ rect: O,
1630
1638
  clipped: !1,
1631
1639
  boundaryRect: i,
1632
1640
  clampedTo: L,
1633
1641
  anchorPoint: k,
1634
- owner: mt(p, m),
1642
+ owner: wt(p, m),
1635
1643
  slid: B,
1636
1644
  outOfView: !f
1637
1645
  } : {
1638
- rect: z,
1646
+ rect: O,
1639
1647
  clipped: !0,
1640
1648
  boundaryRect: i,
1641
1649
  clampedTo: L,
@@ -1644,38 +1652,43 @@ var it = !1, st = (e, t, n, o) => ({
1644
1652
  slid: null,
1645
1653
  outOfView: !0
1646
1654
  };
1647
- }, yt = n(null), bt = () => {
1648
- const e = a(yt);
1655
+ }, bt = n(null), St = () => {
1656
+ const e = s(bt);
1649
1657
  if (!e) throw new Error("useSticky must be used within a <StickyAnchor>");
1650
1658
  return e;
1651
- }, St = () => a(yt), Et = (e) => {
1652
- const { anchor: t, placement: n = ut, boundary: o = "data", whenOff: r = "hide", minVisible: l = 0, children: i } = e, { reference: a, getBoundaryRect: c, anchorPoint: d, owner: h, clipped: p, slid: m, outOfView: w, pane: v } = ((e, t) => {
1653
- const n = Ze(), o = t?.pane ?? n, r = t?.boundary ?? "data", l = t?.minVisible ?? 0, i = t?.placement ?? ut, s = t?.whenOff ?? "hide", a = f({
1659
+ }, Et = () => s(bt), It = (e) => {
1660
+ const { anchor: t, placement: n = gt, boundary: o = "data", whenOff: r = "hide", minVisible: l = 0, children: i } = e, { reference: s, getBoundaryRect: c, anchorPoint: d, owner: h, clipped: p, slid: m, outOfView: w, pane: v } = ((e, t) => {
1661
+ const n = Je(), o = t?.pane ?? n, r = t?.boundary ?? "data", l = t?.minVisible ?? 0, i = t?.placement ?? gt, a = t?.whenOff ?? "hide", s = f({
1654
1662
  pane: o,
1655
1663
  anchor: e,
1656
1664
  boundary: r,
1657
1665
  minVisible: l,
1658
1666
  placement: i,
1659
- whenOff: s
1667
+ whenOff: a
1660
1668
  });
1661
- a.current = {
1669
+ s.current = {
1662
1670
  pane: o,
1663
1671
  anchor: e,
1664
1672
  boundary: r,
1665
1673
  minVisible: l,
1666
1674
  placement: i,
1667
- whenOff: s
1675
+ whenOff: a
1668
1676
  };
1669
1677
  const c = g(() => ({
1670
- reference: { getBoundingClientRect: () => {
1671
- const e = a.current;
1672
- return vt(e.pane, e.anchor, e.boundary, e.minVisible, e.placement, e.whenOff).rect;
1673
- } },
1678
+ reference: {
1679
+ get contextElement() {
1680
+ return s.current.pane?.getElement() ?? void 0;
1681
+ },
1682
+ getBoundingClientRect: () => {
1683
+ const e = s.current;
1684
+ return yt(e.pane, e.anchor, e.boundary, e.minVisible, e.placement, e.whenOff).rect;
1685
+ }
1686
+ },
1674
1687
  getBoundaryRect: () => {
1675
- const e = a.current;
1676
- return vt(e.pane, e.anchor, e.boundary, e.minVisible, e.placement, e.whenOff).boundaryRect;
1688
+ const e = s.current;
1689
+ return yt(e.pane, e.anchor, e.boundary, e.minVisible, e.placement, e.whenOff).boundaryRect;
1677
1690
  }
1678
- }), []), d = vt(o, e, r, l, i, s);
1691
+ }), []), d = yt(o, e, r, l, i, a);
1679
1692
  return {
1680
1693
  reference: c.reference,
1681
1694
  getBoundaryRect: c.getBoundaryRect,
@@ -1704,11 +1717,11 @@ var it = !1, st = (e, t, n, o) => ({
1704
1717
  S.current = t;
1705
1718
  const E = f(v);
1706
1719
  E.current = v;
1707
- const I = s((e) => {
1708
- const t = It(S.current), n = E.current;
1720
+ const I = a((e) => {
1721
+ const t = Ct(S.current), n = E.current;
1709
1722
  return n && t ? n.scrollCellCoordsIntoView(t, e) : Promise.resolve(void 0);
1710
1723
  }, []), C = g(() => ({
1711
- reference: a,
1724
+ reference: s,
1712
1725
  getBoundaryRect: c,
1713
1726
  anchorPoint: d,
1714
1727
  bounds: b,
@@ -1721,7 +1734,7 @@ var it = !1, st = (e, t, n, o) => ({
1721
1734
  pane: v,
1722
1735
  scrollIntoView: I
1723
1736
  }), [
1724
- a,
1737
+ s,
1725
1738
  c,
1726
1739
  d.x,
1727
1740
  d.y,
@@ -1750,7 +1763,7 @@ var it = !1, st = (e, t, n, o) => ({
1750
1763
  position: "absolute",
1751
1764
  left: 0,
1752
1765
  top: 0,
1753
- transform: `translate3d(${d.x - (e?.left ?? 0)}px, ${d.y - (e?.top ?? 0)}px, 0) ${Ct(n)}`,
1766
+ transform: `translate3d(${d.x - (e?.left ?? 0)}px, ${d.y - (e?.top ?? 0)}px, 0) ${Rt(n)}`,
1754
1767
  willChange: "transform"
1755
1768
  },
1756
1769
  children: x("div", {
@@ -1766,76 +1779,85 @@ var it = !1, st = (e, t, n, o) => ({
1766
1779
  if (!o) return;
1767
1780
  let r = 0, l = 0;
1768
1781
  n.left < o.left ? r = o.left - n.left : n.right > o.right && (r = Math.min(0, o.right - n.right)), n.top < o.top ? l = o.top - n.top : n.bottom > o.bottom && (l = Math.min(0, o.bottom - n.bottom)), t.style.transform = r || l ? `translate(${r}px, ${l}px)` : "";
1769
- }), x(yt.Provider, {
1782
+ }), x(bt.Provider, {
1770
1783
  value: C,
1771
1784
  children: D
1772
1785
  });
1773
- }, It = (e) => "range" in e ? {
1786
+ }, Ct = (e) => "range" in e ? {
1774
1787
  rowIndex: e.range.rowStart,
1775
1788
  colIndex: e.range.colStart
1776
1789
  } : "cell" in e ? {
1777
1790
  rowIndex: e.cell.rowIndex,
1778
1791
  colIndex: e.cell.colIndex
1779
- } : null, Ct = (e) => {
1792
+ } : null, Rt = (e) => {
1780
1793
  const { side: t, align: n = "center" } = e;
1781
1794
  let o = "-50%", r = "-50%";
1782
1795
  "t" === t ? r = "-100%" : "b" === t ? r = "0%" : "l" === t ? o = "-100%" : "r" === t && (o = "0%");
1783
1796
  const l = "start" === n ? "0%" : "end" === n ? "-100%" : "-50%";
1784
1797
  return "t" === t || "b" === t ? o = l : r = l, `translate(${o}, ${r})`;
1785
1798
  };
1786
- Et.displayName = "StickyAnchor";
1787
- var Rt = (e) => {
1788
- const t = O(), n = N(), o = e?.getElement(), r = {}, l = o?.closest(`[${C}]`)?.getAttribute(C), i = o?.closest(`[${R}]`)?.getAttribute(R);
1799
+ It.displayName = "StickyAnchor";
1800
+ var Mt = (e) => {
1801
+ const t = z(), n = N(), o = e?.getElement(), r = {}, l = o?.closest(`[${C}]`)?.getAttribute(C), i = o?.closest(`[${R}]`)?.getAttribute(R);
1789
1802
  l && (r[C] = l), i && (r[R] = i);
1790
- const s = [...t?.themeScope?.classes ?? [], n?.scopeClass].filter(Boolean);
1803
+ const a = [...t?.themeScope?.classes ?? [], n?.scopeClass].filter(Boolean);
1791
1804
  return {
1792
- className: s.length ? s.join(" ") : void 0,
1805
+ className: a.length ? a.join(" ") : void 0,
1793
1806
  attrs: r
1794
1807
  };
1795
- }, Mt = (e) => {
1808
+ }, Pt = (e) => {
1796
1809
  const { side: t, align: n = "center" } = e;
1797
1810
  return ("t" === t ? "top" : "b" === t ? "bottom" : "l" === t ? "left" : "right") + ("start" === n ? "-start" : "end" === n ? "-end" : "");
1798
- }, Pt = (e) => {
1799
- const { state: t, offset: n, alignOffset: o, open: r, container: l, className: i, style: s, zIndex: a, children: c } = e, { getPortalContainer: d } = $(), { className: u, attrs: g } = Rt(t.pane), { refs: h, floatingStyles: f } = ee({
1800
- placement: Mt(t.placement),
1811
+ }, kt = (e) => {
1812
+ const { state: t, offset: n, alignOffset: o, open: r, container: l, className: i, style: a, zIndex: s, children: c } = e, { getPortalContainer: d } = $(), { className: h, attrs: f } = Mt(t.pane), { getBoundaryRect: p } = t, m = g(() => [
1813
+ J({
1814
+ mainAxis: n,
1815
+ alignmentAxis: o
1816
+ }),
1817
+ Z(() => ({ boundary: p() })),
1818
+ Q(() => ({
1819
+ boundary: p(),
1820
+ padding: 4
1821
+ }))
1822
+ ], [
1823
+ n,
1824
+ o,
1825
+ p
1826
+ ]), { refs: w, floatingStyles: v, update: y } = ee({
1827
+ placement: Pt(t.placement),
1801
1828
  strategy: "fixed",
1802
1829
  elements: { reference: t.reference },
1803
- whileElementsMounted: (e, t, n) => q(e, t, n, { animationFrame: !0 }),
1804
- middleware: [
1805
- J({
1806
- mainAxis: n,
1807
- alignmentAxis: o
1808
- }),
1809
- Z(),
1810
- Q({ padding: 4 })
1811
- ]
1830
+ whileElementsMounted: q,
1831
+ middleware: m
1812
1832
  });
1813
- if (!r) return null;
1814
- const p = "function" == typeof c ? c(t) : c;
1833
+ if (u(() => {
1834
+ y();
1835
+ }, [t, y]), !r) return null;
1836
+ const b = "function" == typeof c ? c(t) : c;
1815
1837
  return Y(x("div", {
1816
- ref: h.setFloating,
1817
- className: [i, u].filter(Boolean).join(" ") || void 0,
1818
- ...g,
1838
+ ref: w.setFloating,
1839
+ className: [i, h].filter(Boolean).join(" ") || void 0,
1840
+ ...f,
1819
1841
  style: {
1820
- ...f,
1821
- zIndex: a,
1822
- ...s
1842
+ ...v,
1843
+ zIndex: s,
1844
+ ...a
1823
1845
  },
1824
- children: p
1846
+ children: b
1825
1847
  }), l ?? d());
1826
- }, kt = (e) => {
1827
- const { anchor: t, placement: n, whenOff: o, boundary: r, minVisible: l, offset: i = 4, alignOffset: s = 0, open: a = !0, container: c, className: d, style: u, zIndex: g = 1250, children: h } = e;
1828
- return x(Et, {
1848
+ }, Dt = (e) => {
1849
+ const { anchor: t, placement: n, whenOff: o, boundary: r, minVisible: l, offset: i = 4, alignOffset: a = 0, open: s = !0, container: c, className: d, style: u, zIndex: g = 1250, children: h } = e;
1850
+ return x(It, {
1829
1851
  anchor: t,
1830
1852
  placement: n,
1831
1853
  whenOff: o,
1832
1854
  boundary: r,
1833
1855
  minVisible: l,
1834
- children: (e) => x(Pt, {
1856
+ children: (e) => x(kt, {
1835
1857
  state: e,
1836
1858
  offset: i,
1837
- alignOffset: s,
1838
- open: a,
1859
+ alignOffset: a,
1860
+ open: s,
1839
1861
  container: c,
1840
1862
  className: d,
1841
1863
  style: u,
@@ -1844,35 +1866,35 @@ var Rt = (e) => {
1844
1866
  })
1845
1867
  });
1846
1868
  };
1847
- kt.displayName = "StickyFloat";
1848
- var Dt = { pointerEvents: "auto" }, Tt = (e = {}) => {
1849
- const { openDelay: t = 300, closeDelay: n = 150 } = e, [o, r] = p(!1), l = f(!1), i = f(null), a = f(!1), d = f(null), u = f(null), h = (e) => {
1869
+ Dt.displayName = "StickyFloat";
1870
+ var Tt = { pointerEvents: "auto" }, Ot = (e = {}) => {
1871
+ const { openDelay: t = 300, closeDelay: n = 150 } = e, [o, r] = p(!1), l = f(!1), i = f(null), s = f(!1), d = f(null), u = f(null), h = (e) => {
1850
1872
  l.current = e, r(e);
1851
1873
  }, m = () => {
1852
1874
  d.current && (clearTimeout(d.current), d.current = null);
1853
1875
  }, w = () => {
1854
1876
  u.current && (clearTimeout(u.current), u.current = null);
1855
- }, x = s(() => {
1877
+ }, x = a(() => {
1856
1878
  m(), w(), u.current = setTimeout(() => {
1857
- u.current = null, a.current || null !== i.current || h(!1);
1879
+ u.current = null, s.current || null !== i.current || h(!1);
1858
1880
  }, n);
1859
- }, [n]), v = s((e) => {
1881
+ }, [n]), v = a((e) => {
1860
1882
  if (e !== i.current) if (i.current = e, null !== e) {
1861
1883
  if (w(), l.current) return;
1862
1884
  m(), d.current = setTimeout(() => {
1863
1885
  d.current = null, null !== i.current && h(!0);
1864
1886
  }, t);
1865
1887
  } else x();
1866
- }, [t, x]), y = s(() => {
1867
- m(), w(), i.current = null, a.current = !1, h(!1);
1888
+ }, [t, x]), y = a(() => {
1889
+ m(), w(), i.current = null, s.current = !1, h(!1);
1868
1890
  }, []), b = g(() => ({
1869
1891
  onPointerEnter: () => {
1870
- a.current = !0, w();
1892
+ s.current = !0, w();
1871
1893
  },
1872
1894
  onPointerLeave: () => {
1873
- a.current = !1, x();
1895
+ s.current = !1, x();
1874
1896
  },
1875
- style: Dt
1897
+ style: Tt
1876
1898
  }), [x]);
1877
1899
  return c(() => () => {
1878
1900
  m(), w();
@@ -1883,89 +1905,127 @@ var Dt = { pointerEvents: "auto" }, Tt = (e = {}) => {
1883
1905
  close: y
1884
1906
  };
1885
1907
  }, zt = (e, t = {}) => {
1886
- const { open: n, setTarget: o, tipProps: r } = Tt(t), l = Ze(), i = Se(l), s = a(Me), d = f({}), u = Re(e);
1887
- return d.current = {
1908
+ const { open: n, setTarget: o, tipProps: r } = Ot(t), l = Je(), i = Ee(l), a = s(Pe), d = Me(e), [u, g] = Qe(`range-hover:${a}:${d}`, null), h = f({});
1909
+ return h.current = {
1888
1910
  pointermove: (t, n) => {
1889
- const r = t, i = (n ?? l)?.getCellFromPointer(r.clientX, r.clientY);
1890
- o(i && U.isCellWithinRange(i, e) ? u : null);
1911
+ const o = t, r = (n ?? l)?.getCellFromPointer(o.clientX, o.clientY);
1912
+ g(r && U.isCellWithinRange(r, e) ? d : null);
1891
1913
  },
1892
- pointerleave: () => o(null)
1914
+ pointerleave: () => g(null)
1893
1915
  }, c(() => {
1916
+ o(u);
1917
+ }, [u, o]), c(() => {
1894
1918
  if (i) return i.registerResponder({
1895
- zIndex: s,
1896
- getHandler: (e) => d.current[e]
1919
+ zIndex: a,
1920
+ getHandler: (e) => h.current[e]
1897
1921
  });
1898
- }, [i, s]), {
1922
+ }, [i, a]), {
1899
1923
  open: n,
1900
1924
  tipProps: r
1901
1925
  };
1902
- }, Ot = (e) => {
1903
- const { probe: t, placement: n, offset: o = 6, alignOffset: r = 0, openDelay: l = 300, closeDelay: i = 150, whenOff: s = "hide", boundary: a, zIndex: d, dismiss: u, children: g, className: h, style: m } = e, w = qe(), { open: v, setTarget: y, tipProps: b, close: S } = Tt({
1904
- openDelay: l,
1905
- closeDelay: i
1906
- }), [E, I] = p(null), C = f(null), R = z((e) => {
1907
- const n = w.getCellFromPointer(e.clientX, e.clientY);
1908
- if (n) {
1909
- const e = t(n, w);
1910
- if (e && e.range) {
1911
- const t = e.key ?? Re(e.range);
1912
- t !== C.current && (C.current = t, I({
1913
- key: t,
1914
- range: e.range,
1915
- data: e.data
1916
- })), y(t);
1917
- return;
1918
- }
1919
- }
1920
- C.current = null, y(null);
1926
+ }, $t = {
1927
+ target: null,
1928
+ aimed: null
1929
+ }, Lt = (e) => ({
1930
+ key: e.key ?? Me(e.range),
1931
+ range: e.range,
1932
+ data: e.data
1933
+ }), Bt = (e, t) => Array.isArray(e) ? e.includes(t) : e === t, At = (e) => {
1934
+ const t = e.getCoords();
1935
+ return t ? `${t.rowIndex},${t.colIndex}` : null;
1936
+ }, Nt = (e) => {
1937
+ const { activateOn: t, name: n, probe: o, selection: r, target: l, dismiss: i, placement: a, offset: d = 6, alignOffset: u = 0, openDelay: g = 300, closeDelay: h = 150, whenOff: f = "hide", boundary: p, zIndex: m, children: w, className: v, style: y } = e, b = Ze(), S = s(Pe), E = Bt(t, "hover"), I = Bt(t, "selection"), C = void 0 !== l, { open: R, setTarget: M, tipProps: P, close: k } = Ot({
1938
+ openDelay: g,
1939
+ closeDelay: h
1940
+ }), [D, T] = Qe(`range-float:${n ?? S}`, $t), z = O(() => {
1941
+ T((e) => null === e.aimed ? e : {
1942
+ target: e.target,
1943
+ aimed: null
1944
+ });
1945
+ }, [T]), $ = O((e) => {
1946
+ const t = b.getCellFromPointer(e.clientX, e.clientY), n = t ? o?.(t, b) : null;
1947
+ if (!n?.range) return void z();
1948
+ const r = Lt(n);
1949
+ T((e) => e.aimed === r.key && e.target?.key === r.key ? e : {
1950
+ target: r,
1951
+ aimed: r.key
1952
+ });
1921
1953
  }, [
1922
- w,
1923
- t,
1924
- y
1925
- ]), M = z(() => {
1926
- C.current = null, y(null);
1927
- }, [y]);
1928
- return c(() => {
1929
- u && (C.current = null, S(), I(null));
1930
- }, [u, S]), x(et, {
1931
- className: V(h, "hover-tip"),
1932
- onPointerMove: R,
1933
- onPointerLeave: M,
1934
- children: E && x(kt, {
1935
- anchor: { range: E.range },
1936
- placement: n,
1937
- offset: o,
1938
- alignOffset: r,
1939
- boundary: a,
1940
- zIndex: d,
1941
- open: v,
1942
- whenOff: s,
1943
- style: m,
1944
- children: (e) => g({
1945
- range: E.range,
1946
- data: E.data,
1947
- tipProps: b,
1954
+ b,
1955
+ o,
1956
+ T,
1957
+ z
1958
+ ]), L = E ? D.aimed : null;
1959
+ c(() => {
1960
+ M(L);
1961
+ }, [L, M]), c(() => {
1962
+ i && (k(), T($t));
1963
+ }, [
1964
+ i,
1965
+ k,
1966
+ T
1967
+ ]);
1968
+ const A = B(I ? r : void 0, At);
1969
+ let N = null;
1970
+ if (I && !i && r && null !== A) {
1971
+ const e = o?.(r.getCoords(), b);
1972
+ e && e.range && (N = Lt(e));
1973
+ }
1974
+ const F = E ? D.target : null, H = R && null !== F, _ = C ? null === l ? null : Lt(l) : H ? F : N ?? F, W = C ? null !== _ : H || null !== N;
1975
+ return x(tt, {
1976
+ className: V(v, "range-float"),
1977
+ onPointerMove: E ? $ : void 0,
1978
+ onPointerLeave: E ? z : void 0,
1979
+ children: _ && x(Dt, {
1980
+ anchor: { range: _.range },
1981
+ placement: a,
1982
+ offset: d,
1983
+ alignOffset: u,
1984
+ boundary: p,
1985
+ zIndex: m,
1986
+ open: W,
1987
+ whenOff: f,
1988
+ style: y,
1989
+ children: (e) => w({
1990
+ range: _.range,
1991
+ data: _.data,
1992
+ floatProps: P,
1948
1993
  state: e
1949
1994
  })
1950
1995
  })
1951
1996
  });
1952
1997
  };
1953
- Ot.displayName = "HoverTipLayer";
1954
- var $t = {
1998
+ Nt.displayName = "RangeFloatLayer";
1999
+ var Ft = (e) => {
2000
+ const { children: t, className: n, ...o } = e;
2001
+ return x(Nt, {
2002
+ ...o,
2003
+ activateOn: "hover",
2004
+ className: V(n, "hover-tip"),
2005
+ children: ({ range: e, data: n, floatProps: o, state: r }) => t({
2006
+ range: e,
2007
+ data: n,
2008
+ tipProps: o,
2009
+ state: r
2010
+ })
2011
+ });
2012
+ };
2013
+ Ft.displayName = "HoverTipLayer";
2014
+ var Vt = {
1955
2015
  t: "↑",
1956
2016
  b: "↓",
1957
2017
  l: "←",
1958
2018
  r: "→"
1959
- }, Lt = (e) => {
2019
+ }, Ht = (e) => {
1960
2020
  let t = "", n = e;
1961
2021
  do
1962
2022
  t = String.fromCharCode(65 + n % 26) + t, n = Math.floor(n / 26) - 1;
1963
2023
  while (n >= 0);
1964
2024
  return t;
1965
- }, Bt = (e) => {
1966
- const t = `${Lt(e.colStart)}${e.rowStart + 1}`, n = `${Lt(e.colEnd)}${e.rowEnd + 1}`;
2025
+ }, _t = (e) => {
2026
+ const t = `${Ht(e.colStart)}${e.rowStart + 1}`, n = `${Ht(e.colEnd)}${e.rowEnd + 1}`;
1967
2027
  return t === n ? t : `${t}:${n}`;
1968
- }, At = {
2028
+ }, Wt = {
1969
2029
  border: "none",
1970
2030
  background: "transparent",
1971
2031
  color: "inherit",
@@ -1976,7 +2036,7 @@ var $t = {
1976
2036
  height: 18,
1977
2037
  borderRadius: 4,
1978
2038
  opacity: .6
1979
- }, Nt = {
2039
+ }, Ut = {
1980
2040
  position: "relative",
1981
2041
  background: "var(--sxl-color-base-100, white)",
1982
2042
  color: "var(--sxl-color-base-content, #222)",
@@ -1986,7 +2046,7 @@ var $t = {
1986
2046
  boxShadow: "0 6px 24px var(--sxl-color-shadow, rgba(0,0,0,0.2))",
1987
2047
  pointerEvents: "auto",
1988
2048
  maxWidth: 320
1989
- }, Ft = {
2049
+ }, Kt = {
1990
2050
  display: "inline-flex",
1991
2051
  alignItems: "center",
1992
2052
  gap: 8,
@@ -1996,8 +2056,8 @@ var $t = {
1996
2056
  padding: "4px 6px 4px 12px",
1997
2057
  boxShadow: "0 2px 10px var(--sxl-color-shadow, rgba(0,0,0,0.3))",
1998
2058
  pointerEvents: "auto"
1999
- }, Vt = ({ direction: e, label: t, onGoto: n, onCancel: o }) => v("div", {
2000
- style: Ft,
2059
+ }, jt = ({ direction: e, label: t, onGoto: n, onCancel: o }) => v("div", {
2060
+ style: Kt,
2001
2061
  children: [v("button", {
2002
2062
  onClick: n,
2003
2063
  style: {
@@ -2008,7 +2068,7 @@ var $t = {
2008
2068
  font: "12px system-ui"
2009
2069
  },
2010
2070
  children: [
2011
- $t[e],
2071
+ Vt[e],
2012
2072
  " ",
2013
2073
  t
2014
2074
  ]
@@ -2016,43 +2076,43 @@ var $t = {
2016
2076
  "aria-label": "Cancel",
2017
2077
  onClick: o,
2018
2078
  style: {
2019
- ...At,
2079
+ ...Wt,
2020
2080
  opacity: .8
2021
2081
  },
2022
2082
  children: "×"
2023
2083
  })]
2024
- }), Ht = (e) => {
2084
+ }), Gt = (e) => {
2025
2085
  const { range: t, placement: n = {
2026
2086
  side: "t",
2027
2087
  align: "start"
2028
- }, offset: o = 8, alignOffset: r = 0, address: l, onGoto: i, onCancel: s, zIndex: a, className: c, style: d, children: u } = e;
2029
- return x(kt, {
2088
+ }, offset: o = 8, alignOffset: r = 0, address: l, onGoto: i, onCancel: a, zIndex: s, className: c, style: d, children: u } = e;
2089
+ return x(Dt, {
2030
2090
  anchor: { range: t },
2031
2091
  placement: n,
2032
2092
  offset: o,
2033
2093
  alignOffset: r,
2034
2094
  whenOff: "clamp",
2035
- zIndex: a,
2095
+ zIndex: s,
2036
2096
  open: !0,
2037
2097
  children: (e) => {
2038
- if (e.outOfView) return x(Vt, {
2098
+ if (e.outOfView) return x(jt, {
2039
2099
  direction: e.slid?.direction ?? n.side,
2040
- label: l ?? Bt(t),
2100
+ label: l ?? _t(t),
2041
2101
  onGoto: () => i ? i(e) : e.scrollIntoView(),
2042
- onCancel: s
2102
+ onCancel: a
2043
2103
  });
2044
2104
  const o = "function" == typeof u ? u(e) : u;
2045
2105
  return v("div", {
2046
2106
  className: c,
2047
2107
  style: {
2048
- ...Nt,
2108
+ ...Ut,
2049
2109
  ...d
2050
2110
  },
2051
- children: [s && x("button", {
2111
+ children: [a && x("button", {
2052
2112
  "aria-label": "Cancel",
2053
- onClick: s,
2113
+ onClick: a,
2054
2114
  style: {
2055
- ...At,
2115
+ ...Wt,
2056
2116
  position: "absolute",
2057
2117
  top: 4,
2058
2118
  right: 4
@@ -2063,20 +2123,20 @@ var $t = {
2063
2123
  }
2064
2124
  });
2065
2125
  };
2066
- Ht.displayName = "RangePrompt";
2067
- var _t = {
2126
+ Gt.displayName = "RangePrompt";
2127
+ var Xt = {
2068
2128
  stroke: "var(--sxl-color-primary, rgb(33, 115, 70))",
2069
2129
  alignWidth: 2,
2070
2130
  fill: "color-mix(in srgb, var(--sxl-color-primary, rgb(33, 115, 70)) 10%, transparent)"
2071
- }, Wt = i((e) => {
2072
- const { range: t, hole: n, clipInsets: o, alignWidth: r = 1, animatedTransition: l, className: i, ...s } = e, a = S.getDevicePixelRatio(), c = r / a, d = o ?? -c / 2, u = Ze(), g = u ? u.getBoundsFromRange(t) : null, h = c + 4;
2131
+ }, Yt = i((e) => {
2132
+ const { range: t, hole: n, clipInsets: o, alignWidth: r = 1, animatedTransition: l, className: i, ...a } = e, s = S.getDevicePixelRatio(), c = r / s, d = o ?? -c / 2, u = Je(), g = u ? u.getBoundsFromRange(t) : null, h = c + 4;
2073
2133
  if (u && g && !u.toClipBounds(g, d)) return null;
2074
2134
  const f = u ? u.getPaneBounds() : null, p = f ? {
2075
2135
  x: -h,
2076
2136
  y: -h,
2077
2137
  width: f.width + 2 * h,
2078
2138
  height: f.height + 2 * h
2079
- } : g, m = p ? S.snapDeviceEdge(p.x, a) : 0, w = p ? S.snapDeviceEdge(p.y, a) : 0;
2139
+ } : g, m = p ? S.snapDeviceEdge(p.x, s) : 0, w = p ? S.snapDeviceEdge(p.y, s) : 0;
2080
2140
  let v;
2081
2141
  if (g && p) {
2082
2142
  const e = c + 2, t = Math.max(g.x, p.x - e), n = Math.max(g.y, p.y - e);
@@ -2093,7 +2153,7 @@ var _t = {
2093
2153
  width: y.width,
2094
2154
  height: y.height
2095
2155
  } : void 0;
2096
- return x(lt, {
2156
+ return x(it, {
2097
2157
  className: V(i),
2098
2158
  bounds: p ?? void 0,
2099
2159
  clipInsets: d,
@@ -2103,12 +2163,12 @@ var _t = {
2103
2163
  alignWidth: r,
2104
2164
  hole: b,
2105
2165
  animatedTransition: l,
2106
- ...s
2166
+ ...a
2107
2167
  })
2108
2168
  });
2109
2169
  });
2110
- Wt.displayName = "RangeRect";
2111
- var Ut = () => "undefined" != typeof window ? window : null, Kt = 60, jt = 24, Gt = (e, t, n = {
2170
+ Yt.displayName = "RangeRect";
2171
+ var qt = () => "undefined" != typeof window ? window : null, Zt = 60, Jt = 24, Qt = (e, t, n = {
2112
2172
  x: !0,
2113
2173
  y: !0
2114
2174
  }) => {
@@ -2116,19 +2176,19 @@ var Ut = () => "undefined" != typeof window ? window : null, Kt = 60, jt = 24, G
2116
2176
  if (!o) return !1;
2117
2177
  const r = !1 === n.x ? 0 : t.x <= o.left + 24 ? -1 : t.x >= o.right - 24 ? 1 : 0, l = !1 === n.y ? 0 : t.y <= o.top + 24 ? -1 : t.y >= o.bottom - 24 ? 1 : 0;
2118
2178
  if (!r && !l) return !1;
2119
- const i = e.getVisibleRange(), s = e.getTotalRange(), a = e.getCellFromPointer(t.x, t.y), c = {};
2120
- return r > 0 && i.colEnd < s.colEnd ? c.colIndex = Math.min(s.colEnd, Math.max(i.colEnd + 1, a?.colIndex ?? 0)) : r < 0 && i.colStart > s.colStart && (c.colIndex = Math.max(s.colStart, Math.min(i.colStart - 1, a?.colIndex ?? Number.MAX_SAFE_INTEGER))), l > 0 && i.rowEnd < s.rowEnd ? c.rowIndex = Math.min(s.rowEnd, Math.max(i.rowEnd + 1, a?.rowIndex ?? 0)) : l < 0 && i.rowStart > s.rowStart && (c.rowIndex = Math.max(s.rowStart, Math.min(i.rowStart - 1, a?.rowIndex ?? Number.MAX_SAFE_INTEGER))), (void 0 !== c.colIndex || void 0 !== c.rowIndex) && ((e.getAllPanes()[_.Center] ?? e).scrollCellCoordsIntoView(c), !0);
2121
- }, Xt = (e, t, n, o) => {
2179
+ const i = e.getVisibleRange(), a = e.getTotalRange(), s = e.getCellFromPointer(t.x, t.y), c = {};
2180
+ return r > 0 && i.colEnd < a.colEnd ? c.colIndex = Math.min(a.colEnd, Math.max(i.colEnd + 1, s?.colIndex ?? 0)) : r < 0 && i.colStart > a.colStart && (c.colIndex = Math.max(a.colStart, Math.min(i.colStart - 1, s?.colIndex ?? Number.MAX_SAFE_INTEGER))), l > 0 && i.rowEnd < a.rowEnd ? c.rowIndex = Math.min(a.rowEnd, Math.max(i.rowEnd + 1, s?.rowIndex ?? 0)) : l < 0 && i.rowStart > a.rowStart && (c.rowIndex = Math.max(a.rowStart, Math.min(i.rowStart - 1, s?.rowIndex ?? Number.MAX_SAFE_INTEGER))), (void 0 !== c.colIndex || void 0 !== c.rowIndex) && ((e.getAllPanes()[_.Center] ?? e).scrollCellCoordsIntoView(c), !0);
2181
+ }, en = (e, t, n, o) => {
2122
2182
  const r = o ?? ((t, n) => e.getCellFromPointer(t, n));
2123
- let l = null, i = null, s = null, a = null, c = null;
2183
+ let l = null, i = null, a = null, s = null, c = null;
2124
2184
  const d = () => {
2125
2185
  c && (document.removeEventListener("touchstart", c, { capture: !0 }), document.removeEventListener("touchmove", c, { capture: !0 }), c = null);
2126
2186
  }, u = () => {
2127
- a && clearTimeout(a), a = null;
2187
+ s && clearTimeout(s), s = null;
2128
2188
  }, g = (t, n, o) => {
2129
2189
  if (!l) return !1;
2130
- const s = r(t, n);
2131
- return s && !U.isEqualCells(s, i) && (i = s, l.drag(s, o)), (l.edgeScroll ?? ((t) => Gt(e, t)))({
2190
+ const a = r(t, n);
2191
+ return a && !U.isEqualCells(a, i) && (i = a, l.drag(a, o)), (l.edgeScroll ?? ((t) => Qt(e, t)))({
2132
2192
  x: t,
2133
2193
  y: n
2134
2194
  });
@@ -2139,8 +2199,8 @@ var Ut = () => "undefined" != typeof window ? window : null, Kt = 60, jt = 24, G
2139
2199
  begin: (e) => {
2140
2200
  const o = r(e.clientX, e.clientY);
2141
2201
  if (!o) return null;
2142
- const a = t(o, e);
2143
- return a ? (l = a, i = o, s = null, "touch" === e.pointerType && !1 !== a.capture && (() => {
2202
+ const s = t(o, e);
2203
+ return s ? (l = s, i = o, a = null, "touch" === e.pointerType && !1 !== s.capture && (() => {
2144
2204
  if (c) return;
2145
2205
  const e = (e) => {
2146
2206
  e.stopImmediatePropagation(), e.preventDefault();
@@ -2152,31 +2212,31 @@ var Ut = () => "undefined" != typeof window ? window : null, Kt = 60, jt = 24, G
2152
2212
  capture: !0,
2153
2213
  passive: !1
2154
2214
  });
2155
- })(), n?.(a.dragMode ?? null), a) : null;
2215
+ })(), n?.(s.dragMode ?? null), s) : null;
2156
2216
  },
2157
2217
  move: (e, t, n) => {
2158
- l && (s = {
2218
+ l && (a = {
2159
2219
  x: e,
2160
2220
  y: t
2161
- }, g(e, t, n) ? (u(), a = setTimeout(function e() {
2162
- a = l && s && g(s.x, s.y) ? setTimeout(e, 60) : null;
2221
+ }, g(e, t, n) ? (u(), s = setTimeout(function e() {
2222
+ s = l && a && g(a.x, a.y) ? setTimeout(e, 60) : null;
2163
2223
  }, 60)) : u());
2164
2224
  },
2165
2225
  reset: () => {
2166
2226
  const e = l;
2167
- return l = null, i = null, s = null, u(), d(), e && n?.(null), e;
2227
+ return l = null, i = null, a = null, u(), d(), e && n?.(null), e;
2168
2228
  },
2169
2229
  dispose: () => {
2170
2230
  u(), d();
2171
2231
  }
2172
2232
  };
2173
- }, Yt = (e, t, n) => {
2174
- const o = Xt(e, t, n);
2175
- let r = !1, l = null, i = null, s = null, a = null, c = null;
2233
+ }, tn = (e, t, n) => {
2234
+ const o = en(e, t, n);
2235
+ let r = !1, l = null, i = null, a = null, s = null, c = null;
2176
2236
  const d = () => {
2177
- s && l && l.removeEventListener?.("pointercancel", s), s = null, a && Ut()?.removeEventListener("keydown", a, !0), a = null;
2237
+ a && l && l.removeEventListener?.("pointercancel", a), a = null, s && qt()?.removeEventListener("keydown", s, !0), s = null;
2178
2238
  }, u = () => {
2179
- c && (Ut()?.removeEventListener("pointerup", c), Ut()?.removeEventListener("pointercancel", c), c = null);
2239
+ c && (qt()?.removeEventListener("pointerup", c), qt()?.removeEventListener("pointercancel", c), c = null);
2180
2240
  }, g = () => {
2181
2241
  l && null !== i && l.hasPointerCapture?.(i) && l.releasePointerCapture(i), l = null, i = null;
2182
2242
  }, h = (e, t) => {
@@ -2188,10 +2248,10 @@ var Ut = () => "undefined" != typeof window ? window : null, Kt = 60, jt = 24, G
2188
2248
  const t = o.begin(e);
2189
2249
  if (t) if (!1 !== t.capture) {
2190
2250
  const t = e.currentTarget;
2191
- t.setPointerCapture?.(e.pointerId), l = t, i = e.pointerId, r = !0, s = (e) => h(!0, e), t.addEventListener?.("pointercancel", s), a = (e) => {
2251
+ t.setPointerCapture?.(e.pointerId), l = t, i = e.pointerId, r = !0, a = (e) => h(!0, e), t.addEventListener?.("pointercancel", a), s = (e) => {
2192
2252
  "Escape" === e.key && (e.preventDefault(), e.stopPropagation(), h(!0));
2193
- }, Ut()?.addEventListener("keydown", a, !0);
2194
- } else r = !1, c = (e) => h("pointercancel" === e.type, e), Ut()?.addEventListener("pointerup", c), Ut()?.addEventListener("pointercancel", c);
2253
+ }, qt()?.addEventListener("keydown", s, !0);
2254
+ } else r = !1, c = (e) => h("pointercancel" === e.type, e), qt()?.addEventListener("pointerup", c), qt()?.addEventListener("pointercancel", c);
2195
2255
  },
2196
2256
  onPointerMove: (e) => {
2197
2257
  o.hasSession() && r && (!1 !== o.captureEvents() && e.stopPropagation(), o.move(e.clientX, e.clientY, e));
@@ -2203,25 +2263,25 @@ var Ut = () => "undefined" != typeof window ? window : null, Kt = 60, jt = 24, G
2203
2263
  }
2204
2264
  };
2205
2265
  };
2206
- function qt(e, t, n, o) {
2207
- const r = Xt(e, t, n, o);
2208
- let l = null, i = null, s = null;
2209
- const a = () => {
2266
+ function nn(e, t, n, o) {
2267
+ const r = en(e, t, n, o);
2268
+ let l = null, i = null, a = null;
2269
+ const s = () => {
2210
2270
  l?.(), l = null;
2211
2271
  }, c = () => {
2212
- i && null !== s && i.hasPointerCapture?.(s) && i.releasePointerCapture(s), i = null, s = null;
2272
+ i && null !== a && i.hasPointerCapture?.(a) && i.releasePointerCapture(a), i = null, a = null;
2213
2273
  };
2214
2274
  return {
2215
2275
  start: (e, t) => {
2216
- a(), c();
2276
+ s(), c();
2217
2277
  const n = r.begin(e);
2218
2278
  if (!n) return;
2219
2279
  if (!1 !== n.capture) {
2220
2280
  const n = t ?? e.currentTarget;
2221
- n && (n.setPointerCapture?.(e.pointerId), i = n, s = e.pointerId);
2281
+ n && (n.setPointerCapture?.(e.pointerId), i = n, a = e.pointerId);
2222
2282
  }
2223
2283
  const o = (e) => r.move(e.clientX, e.clientY, e), d = (e, t) => {
2224
- a();
2284
+ s();
2225
2285
  const n = r.reset();
2226
2286
  c(), n && (e ? n.cancel?.(t) : n.end?.(t));
2227
2287
  }, u = (e) => d(!1, e), g = (e) => d(!0, e), h = (e) => {
@@ -2232,14 +2292,14 @@ function qt(e, t, n, o) {
2232
2292
  };
2233
2293
  },
2234
2294
  dispose: () => {
2235
- a(), c(), r.dispose();
2295
+ s(), c(), r.dispose();
2236
2296
  }
2237
2297
  };
2238
2298
  }
2239
- var Zt = (e) => {
2240
- const t = qe(), [n, o] = p(null), r = f(e);
2299
+ var on = (e) => {
2300
+ const t = Ze(), [n, o] = p(null), r = f(e);
2241
2301
  r.current = e;
2242
- const l = g(() => Yt(t, (e, t) => r.current(e, t), o), [t]);
2302
+ const l = g(() => tn(t, (e, t) => r.current(e, t), o), [t]);
2243
2303
  return c(() => () => l.dispose(), [l]), {
2244
2304
  onPointerDown: l.onPointerDown,
2245
2305
  onPointerMove: l.onPointerMove,
@@ -2247,15 +2307,15 @@ var Zt = (e) => {
2247
2307
  onPointerCancel: l.onPointerCancel,
2248
2308
  dragMode: n
2249
2309
  };
2250
- }, Jt = (e) => {
2251
- const t = qe(), [n, o] = p(null), r = f(e);
2310
+ }, rn = (e) => {
2311
+ const t = Ze(), [n, o] = p(null), r = f(e);
2252
2312
  r.current = e;
2253
- const l = g(() => qt(t, (e, t) => r.current(e, t), o), [t]);
2313
+ const l = g(() => nn(t, (e, t) => r.current(e, t), o), [t]);
2254
2314
  return c(() => () => l.dispose(), [l]), {
2255
2315
  start: l.start,
2256
2316
  dragMode: n
2257
2317
  };
2258
- }, Qt = (e) => {
2318
+ }, ln = (e) => {
2259
2319
  const t = f(null), n = f(!1);
2260
2320
  return c(() => {
2261
2321
  const e = (e) => {
@@ -2273,16 +2333,16 @@ var Zt = (e) => {
2273
2333
  n.current = !1;
2274
2334
  }, 500), !0);
2275
2335
  };
2276
- }, en = (e) => {
2277
- const { range: t, anchor: n, size: o = 8, cursor: r, dragCursor: l, background: i = "var(--sxl-color-primary, rgb(33, 115, 70))", onDragStart: s, onDragMove: a, onDragEnd: c, onDragCancel: d, onDoubleClick: u, onHoverChange: g, hoverStyle: h, animatedTransition: f, renderHandle: m, children: v, className: y, style: b, preserveFocus: E, clampToView: I } = e, C = qe(), [R, M] = p(!1), P = Qt(!!u), { start: k, dragMode: D } = Jt((e, t) => {
2336
+ }, an = (e) => {
2337
+ const { range: t, anchor: n, size: o = 8, cursor: r, dragCursor: l, background: i = "var(--sxl-color-primary, rgb(33, 115, 70))", onDragStart: a, onDragMove: s, onDragEnd: c, onDragCancel: d, onDoubleClick: u, onHoverChange: g, hoverStyle: h, animatedTransition: f, renderHandle: m, children: v, className: y, style: b, preserveFocus: E, clampToView: I } = e, C = Ze(), [R, M] = p(!1), P = ln(!!u), { start: k, dragMode: D } = rn((e, t) => {
2278
2338
  if (0 !== t.button) return null;
2279
2339
  t.stopPropagation(), E && t.preventDefault();
2280
2340
  const n = e;
2281
2341
  let o = e;
2282
- return s?.(n, t), {
2342
+ return a?.(n, t), {
2283
2343
  dragMode: "handle",
2284
2344
  drag: (e, r) => {
2285
- o = e, a?.(n, e, r ?? t);
2345
+ o = e, s?.(n, e, r ?? t);
2286
2346
  },
2287
2347
  end: (e) => {
2288
2348
  c?.(n, o, e);
@@ -2291,10 +2351,10 @@ var Zt = (e) => {
2291
2351
  d?.();
2292
2352
  }
2293
2353
  };
2294
- }), T = null !== D && l ? l : r ?? rn[n], z = C.getBoundsFromRange(t);
2295
- if (!z) return null;
2296
- const O = S.getDevicePixelRatio();
2297
- let $ = on(z.x, z.x + z.width, tn[n], O), L = on(z.y, z.y + z.height, nn[n], O);
2354
+ }), T = null !== D && l ? l : r ?? un[n], O = C.getBoundsFromRange(t);
2355
+ if (!O) return null;
2356
+ const z = S.getDevicePixelRatio();
2357
+ let $ = dn(O.x, O.x + O.width, sn[n], z), L = dn(O.y, O.y + O.height, cn[n], z);
2298
2358
  if (I) {
2299
2359
  if (!C.toClipBounds(C.getBoundsFromRange(t))) return null;
2300
2360
  const e = C.getPaneBounds(), n = o / 2 + 1;
@@ -2350,8 +2410,8 @@ var Zt = (e) => {
2350
2410
  children: v
2351
2411
  });
2352
2412
  };
2353
- en.displayName = "DragHandle";
2354
- var tn = {
2413
+ an.displayName = "DragHandle";
2414
+ var sn = {
2355
2415
  tl: "leading",
2356
2416
  l: "leading",
2357
2417
  bl: "leading",
@@ -2360,7 +2420,7 @@ var tn = {
2360
2420
  tr: "trailing",
2361
2421
  r: "trailing",
2362
2422
  br: "trailing"
2363
- }, nn = {
2423
+ }, cn = {
2364
2424
  tl: "leading",
2365
2425
  t: "leading",
2366
2426
  tr: "leading",
@@ -2369,7 +2429,7 @@ var tn = {
2369
2429
  bl: "trailing",
2370
2430
  b: "trailing",
2371
2431
  br: "trailing"
2372
- }, on = (e, t, n, o) => "center" === n ? S.snapDeviceEdge((e + t) / 2, o) : S.edgeCenter("leading" === n ? e : t, n, 2, o), rn = {
2432
+ }, dn = (e, t, n, o) => "center" === n ? S.snapDeviceEdge((e + t) / 2, o) : S.edgeCenter("leading" === n ? e : t, n, 2, o), un = {
2373
2433
  tl: "nwse-resize",
2374
2434
  br: "nwse-resize",
2375
2435
  tr: "nesw-resize",
@@ -2378,18 +2438,18 @@ var tn = {
2378
2438
  b: "ns-resize",
2379
2439
  l: "ew-resize",
2380
2440
  r: "ew-resize"
2381
- }, ln = (e) => {
2382
- const { range: t, children: n, grip: o = "entire", hitSize: r = 10, onHoverChange: l, onDragStateChange: i, onDragStart: s, onDragMove: a, onDragEnd: c, renderMove: d, preserveFocus: u, onEdgeDoubleClick: g } = e, h = qe(), p = t ? `range-move:${t.rowStart}:${t.colStart}:${t.rowEnd}:${t.colEnd}` : "range-move", m = f(null), [y, b] = Je(p, null), { start: E, dragMode: I } = Jt((e, n) => {
2441
+ }, gn = (e) => {
2442
+ const { range: t, children: n, grip: o = "entire", hitSize: r = 10, onHoverChange: l, onDragStateChange: i, onDragStart: a, onDragMove: s, onDragEnd: c, renderMove: d, preserveFocus: u, onEdgeDoubleClick: g } = e, h = Ze(), p = t ? `range-move:${t.rowStart}:${t.colStart}:${t.rowEnd}:${t.colEnd}` : "range-move", m = f(null), [y, b] = Qe(p, null), { start: E, dragMode: I } = rn((e, n) => {
2383
2443
  if (0 !== n.button) return null;
2384
2444
  if (!t) return null;
2385
2445
  n.stopPropagation(), u && n.preventDefault();
2386
2446
  const o = e, r = t;
2387
2447
  let l = r;
2388
- i?.(!0), s?.(r, n);
2448
+ i?.(!0), a?.(r, n);
2389
2449
  return {
2390
2450
  dragMode: "move",
2391
2451
  drag: (e, t) => {
2392
- l = ((e) => sn(r, e.rowIndex - o.rowIndex, e.colIndex - o.colIndex, h.getTotalRange()))(e), d && b(l), a?.(l, t ?? n);
2452
+ l = ((e) => hn(r, e.rowIndex - o.rowIndex, e.colIndex - o.colIndex, h.getTotalRange()))(e), d && b(l), s?.(l, t ?? n);
2393
2453
  },
2394
2454
  end: (e) => {
2395
2455
  i?.(!1), d && b(null), U.isEqualRanges(l, r) || c?.(l, e);
@@ -2398,15 +2458,15 @@ var tn = {
2398
2458
  i?.(!1), d && b(null);
2399
2459
  }
2400
2460
  };
2401
- }), C = Qt(!!g), R = null !== I ? "grabbing" : "move";
2461
+ }), C = ln(!!g), R = null !== I ? "grabbing" : "move";
2402
2462
  if (!t) return null;
2403
2463
  const M = { onPointerDown: (e) => {
2404
2464
  if (C(e)) {
2405
2465
  const n = ((e) => {
2406
2466
  const n = h?.getPanePointFromPointer(e.clientX, e.clientY), o = h?.getBoundsFromRange(t);
2407
2467
  if (!n || !o) return null;
2408
- const r = Math.abs(n.y - o.y), l = Math.abs(n.y - (o.y + o.height)), i = Math.abs(n.x - o.x), s = Math.abs(n.x - (o.x + o.width)), a = Math.min(r, l, i, s);
2409
- return a === r ? "top" : a === l ? "bottom" : a === i ? "left" : "right";
2468
+ const r = Math.abs(n.y - o.y), l = Math.abs(n.y - (o.y + o.height)), i = Math.abs(n.x - o.x), a = Math.abs(n.x - (o.x + o.width)), s = Math.min(r, l, i, a);
2469
+ return s === r ? "top" : s === l ? "bottom" : s === i ? "left" : "right";
2410
2470
  })(e);
2411
2471
  n && g(t, n, e);
2412
2472
  return;
@@ -2422,7 +2482,7 @@ var tn = {
2422
2482
  height: D.height + 2 * k
2423
2483
  } : void 0;
2424
2484
  return v(w, { children: [
2425
- x(lt, "entire" === o ? {
2485
+ x(it, "entire" === o ? {
2426
2486
  ref: m,
2427
2487
  ...T ? { bounds: T } : { range: t },
2428
2488
  style: { cursor: R },
@@ -2451,21 +2511,21 @@ var tn = {
2451
2511
  y && d?.(y)
2452
2512
  ] });
2453
2513
  };
2454
- ln.displayName = "Draggable";
2455
- var sn = (e, t, n, o) => {
2456
- const r = e.rowEnd - e.rowStart, l = e.colEnd - e.colStart, i = ge(e.rowStart + t, o.rowStart, o.rowEnd - r), s = ge(e.colStart + n, o.colStart, o.colEnd - l);
2514
+ gn.displayName = "Draggable";
2515
+ var hn = (e, t, n, o) => {
2516
+ const r = e.rowEnd - e.rowStart, l = e.colEnd - e.colStart, i = he(e.rowStart + t, o.rowStart, o.rowEnd - r), a = he(e.colStart + n, o.colStart, o.colEnd - l);
2457
2517
  return {
2458
2518
  rowStart: i,
2459
- colStart: s,
2519
+ colStart: a,
2460
2520
  rowEnd: i + r,
2461
- colEnd: s + l
2521
+ colEnd: a + l
2462
2522
  };
2463
- }, an = [
2523
+ }, fn = [
2464
2524
  "tl",
2465
2525
  "tr",
2466
2526
  "br",
2467
2527
  "bl"
2468
- ], cn = [
2528
+ ], pn = [
2469
2529
  "tl",
2470
2530
  "t",
2471
2531
  "tr",
@@ -2474,25 +2534,25 @@ var sn = (e, t, n, o) => {
2474
2534
  "b",
2475
2535
  "bl",
2476
2536
  "l"
2477
- ], dn = (e) => {
2478
- const { range: t, anchors: n = cn, onDragStart: o, onDragMove: r, onDragEnd: l, onDragCancel: i, onHandleHoverChange: s, size: a = 8, renderHandle: c, preserveFocus: d, ...u } = e, g = {
2479
- ..._t,
2537
+ ], mn = (e) => {
2538
+ const { range: t, anchors: n = pn, onDragStart: o, onDragMove: r, onDragEnd: l, onDragCancel: i, onHandleHoverChange: a, size: s = 8, renderHandle: c, preserveFocus: d, ...u } = e, g = {
2539
+ ...Xt,
2480
2540
  ...u
2481
- }, h = g.stroke ?? "rgb(33, 115, 70)", m = qe(), [y, b] = p(null), S = f(null);
2541
+ }, h = g.stroke ?? "rgb(33, 115, 70)", m = Ze(), [y, b] = p(null), S = f(null);
2482
2542
  if (!t) return null;
2483
2543
  const E = y ?? t;
2484
- return v(w, { children: [x(Wt, {
2544
+ return v(w, { children: [x(Yt, {
2485
2545
  range: E,
2486
2546
  ...g
2487
- }), n.map((e) => x(en, {
2547
+ }), n.map((e) => x(an, {
2488
2548
  range: E,
2489
2549
  anchor: e,
2490
- size: a,
2550
+ size: s,
2491
2551
  animatedTransition: g.animatedTransition,
2492
2552
  dragCursor: "grabbing",
2493
2553
  renderHandle: c,
2494
2554
  preserveFocus: d,
2495
- onHoverChange: s,
2555
+ onHoverChange: a,
2496
2556
  style: {
2497
2557
  background: h,
2498
2558
  border: "1.5px solid var(--sxl-color-base-100, white)",
@@ -2503,11 +2563,11 @@ var sn = (e, t, n, o) => {
2503
2563
  S.current = t, o?.(t, n);
2504
2564
  },
2505
2565
  onDragMove: (n, o, l) => {
2506
- const i = un(S.current ?? t, e, o, m.getTotalRange());
2566
+ const i = wn(S.current ?? t, e, o, m.getTotalRange());
2507
2567
  b(i), r?.(i, l);
2508
2568
  },
2509
2569
  onDragEnd: (n, o, r) => {
2510
- const i = un(S.current ?? t, e, o, m.getTotalRange());
2570
+ const i = wn(S.current ?? t, e, o, m.getTotalRange());
2511
2571
  S.current = null, b(null), l?.(i, r);
2512
2572
  },
2513
2573
  onDragCancel: () => {
@@ -2515,24 +2575,24 @@ var sn = (e, t, n, o) => {
2515
2575
  }
2516
2576
  }, e))] });
2517
2577
  };
2518
- dn.displayName = "RangeResizer";
2519
- var un = (e, t, n, o) => {
2520
- let { rowStart: r, colStart: l, rowEnd: i, colEnd: s } = e;
2521
- return t.includes("t") && (r = ge(n.rowIndex, o.rowStart, o.rowEnd)), t.includes("b") && (i = ge(n.rowIndex, o.rowStart, o.rowEnd)), t.includes("l") && (l = ge(n.colIndex, o.colStart, o.colEnd)), t.includes("r") && (s = ge(n.colIndex, o.colStart, o.colEnd)), {
2578
+ mn.displayName = "RangeResizer";
2579
+ var wn = (e, t, n, o) => {
2580
+ let { rowStart: r, colStart: l, rowEnd: i, colEnd: a } = e;
2581
+ return t.includes("t") && (r = he(n.rowIndex, o.rowStart, o.rowEnd)), t.includes("b") && (i = he(n.rowIndex, o.rowStart, o.rowEnd)), t.includes("l") && (l = he(n.colIndex, o.colStart, o.colEnd)), t.includes("r") && (a = he(n.colIndex, o.colStart, o.colEnd)), {
2522
2582
  rowStart: Math.min(r, i),
2523
- colStart: Math.min(l, s),
2583
+ colStart: Math.min(l, a),
2524
2584
  rowEnd: Math.max(r, i),
2525
- colEnd: Math.max(l, s)
2585
+ colEnd: Math.max(l, a)
2526
2586
  };
2527
- }, gn = (e) => {
2528
- const { range: t, snapDestination: n, onDragStart: o, onDragMove: r, onDragEnd: l, onDragDone: i, onDoubleClick: s, renderHandle: a, ...c } = e, d = {
2529
- ..._t,
2587
+ }, xn = (e) => {
2588
+ const { range: t, snapDestination: n, onDragStart: o, onDragMove: r, onDragEnd: l, onDragDone: i, onDoubleClick: a, renderHandle: s, ...c } = e, d = {
2589
+ ...Xt,
2530
2590
  fill: void 0,
2531
2591
  ...c
2532
2592
  }, u = d.stroke, g = {
2533
2593
  ...d,
2534
2594
  strokeDasharray: "3 2"
2535
- }, h = qe(), p = f(null), [m, y] = Je("range-fill", null);
2595
+ }, h = Ze(), p = f(null), [m, y] = Qe("range-fill", null);
2536
2596
  if (!t) return null;
2537
2597
  const b = h.getTotalRange(), S = t.rowStart === b.rowStart && t.rowEnd === b.rowEnd, E = t.colStart === b.colStart && t.colEnd === b.colEnd;
2538
2598
  if (S && E) return null;
@@ -2540,16 +2600,16 @@ var un = (e, t, n, o) => {
2540
2600
  return D && !((e, t, n, o) => {
2541
2601
  const r = e.getAllPanes();
2542
2602
  if (Object.keys(r).length <= 1) return !0;
2543
- const l = e.getAnchor(), i = !!r[_.TopLeft], s = !!r[_.Top], a = !!r[_.Left], c = e.getVisibleRange();
2603
+ const l = e.getAnchor(), i = !!r[_.TopLeft], a = !!r[_.Top], s = !!r[_.Left], c = e.getVisibleRange();
2544
2604
  if (o) {
2545
- if (l === _.Top && i || l === _.Center && a || !U.isCellWithinRange({
2605
+ if (l === _.Top && i || l === _.Center && s || !U.isCellWithinRange({
2546
2606
  colIndex: t.colStart,
2547
2607
  rowIndex: t.rowEnd
2548
2608
  }, c) && !U.isCellWithinRange({
2549
2609
  colIndex: t.colStart,
2550
2610
  rowIndex: t.rowEnd + 1
2551
2611
  }, c)) return !1;
2552
- } else if (n && (l === _.Left && i || l === _.Center && s || !U.isCellWithinRange({
2612
+ } else if (n && (l === _.Left && i || l === _.Center && a || !U.isCellWithinRange({
2553
2613
  colIndex: t.colEnd,
2554
2614
  rowIndex: t.rowStart
2555
2615
  }, c) && !U.isCellWithinRange({
@@ -2557,21 +2617,21 @@ var un = (e, t, n, o) => {
2557
2617
  rowIndex: t.rowStart
2558
2618
  }, c))) return !1;
2559
2619
  return !0;
2560
- })(h, t, S, E) ? null : v(w, { children: [x(en, {
2620
+ })(h, t, S, E) ? null : v(w, { children: [x(an, {
2561
2621
  range: t,
2562
2622
  anchor: k,
2563
2623
  clampToView: D,
2564
2624
  cursor: "crosshair",
2565
2625
  background: u,
2566
- renderHandle: a,
2567
- onDoubleClick: s ? (e) => s(t, e) : void 0,
2626
+ renderHandle: s,
2627
+ onDoubleClick: a ? (e) => a(t, e) : void 0,
2568
2628
  onDragStart: (e, n) => {
2569
2629
  p.current = null, y(null), o?.(t, n);
2570
2630
  },
2571
2631
  onDragMove: (e, o, l) => {
2572
2632
  let i = ((e, t, n) => {
2573
- const o = t.rowIndex - e.rowEnd, r = e.rowStart - t.rowIndex, l = t.colIndex - e.colEnd, i = e.colStart - t.colIndex, s = Math.max(o, r, 0), a = Math.max(l, i, 0);
2574
- return 0 === s && 0 === a ? null : s >= a ? o > 0 ? {
2633
+ const o = t.rowIndex - e.rowEnd, r = e.rowStart - t.rowIndex, l = t.colIndex - e.colEnd, i = e.colStart - t.colIndex, a = Math.max(o, r, 0), s = Math.max(l, i, 0);
2634
+ return 0 === a && 0 === s ? null : a >= s ? o > 0 ? {
2575
2635
  ...e,
2576
2636
  rowEnd: Math.min(n.rowEnd, t.rowIndex)
2577
2637
  } : {
@@ -2594,46 +2654,46 @@ var un = (e, t, n, o) => {
2594
2654
  onDragCancel: () => {
2595
2655
  p.current = null, y(null), i?.();
2596
2656
  }
2597
- }), m && x(Wt, {
2657
+ }), m && x(Yt, {
2598
2658
  range: m,
2599
2659
  ...g
2600
2660
  })] });
2601
2661
  };
2602
- gn.displayName = "FillHandle";
2603
- var hn = i((e) => {
2604
- const { value: t, pane: n, bounds: o, cell: r, range: l, children: i, className: s, ...a } = e;
2662
+ xn.displayName = "FillHandle";
2663
+ var vn = i((e) => {
2664
+ const { value: t, pane: n, bounds: o, cell: r, range: l, children: i, className: a, ...s } = e;
2605
2665
  return x("div", {
2606
- className: V(s, "cell"),
2607
- ...a,
2666
+ className: V(a, "cell"),
2667
+ ...s,
2608
2668
  children: t
2609
2669
  });
2610
- }), fn = Object.freeze({
2670
+ }), yn = Object.freeze({
2611
2671
  cells: [],
2612
2672
  rangesH: [],
2613
2673
  rangesV: []
2614
- }), pn = !1, mn = /* @__PURE__ */ new WeakMap(), wn = (e, t = {}) => {
2615
- const n = e.getVisibleRange(), o = e.getScrollTopLeft(), r = t.bufferRange, l = !!r, i = r ? r.rowStart : 0, s = r ? r.colStart : 0, a = r ? r.rowEnd : 0, c = r ? r.colEnd : 0, d = mn.get(e);
2616
- if (d && d.rowStart === n.rowStart && d.colStart === n.colStart && d.rowEnd === n.rowEnd && d.colEnd === n.colEnd && d.scrollLeft === o.left && d.scrollTop === o.top && d.hasBuffer === l && d.bRowStart === i && d.bColStart === s && d.bRowEnd === a && d.bColEnd === c && d.options.cacheToken === t.cacheToken && d.options.getVisibleCells === t.getVisibleCells && d.options.hiddenCellAt === t.hiddenCellAt) return d.model;
2674
+ }), bn = !1, Sn = /* @__PURE__ */ new WeakMap(), En = (e, t = {}) => {
2675
+ const n = e.getVisibleRange(), o = e.getScrollTopLeft(), r = t.bufferRange, l = !!r, i = r ? r.rowStart : 0, a = r ? r.colStart : 0, s = r ? r.rowEnd : 0, c = r ? r.colEnd : 0, d = Sn.get(e);
2676
+ if (d && d.rowStart === n.rowStart && d.colStart === n.colStart && d.rowEnd === n.rowEnd && d.colEnd === n.colEnd && d.scrollLeft === o.left && d.scrollTop === o.top && d.hasBuffer === l && d.bRowStart === i && d.bColStart === a && d.bRowEnd === s && d.bColEnd === c && d.options.cacheToken === t.cacheToken && d.options.getVisibleCells === t.getVisibleCells && d.options.hiddenCellAt === t.hiddenCellAt) return d.model;
2617
2677
  const u = ((e, t = {}) => {
2618
2678
  const { getVisibleCells: n, hiddenCellAt: o, bufferRange: r } = t, l = e.getTotalRange(), i = r ? {
2619
2679
  rowStart: Math.max(r.rowStart, l.rowStart),
2620
2680
  rowEnd: Math.min(r.rowEnd, l.rowEnd),
2621
2681
  colStart: Math.max(r.colStart, l.colStart),
2622
2682
  colEnd: Math.min(r.colEnd, l.colEnd)
2623
- } : null, s = i ? e.getVisibleColumns(i.colStart, i.colEnd) : e.getVisibleColumns(), a = i ? e.getVisibleRows(i.rowStart, i.rowEnd) : e.getVisibleRows();
2624
- if (0 === s.length || 0 === a.length) return fn;
2683
+ } : null, a = i ? e.getVisibleColumns(i.colStart, i.colEnd) : e.getVisibleColumns(), s = i ? e.getVisibleRows(i.rowStart, i.rowEnd) : e.getVisibleRows();
2684
+ if (0 === a.length || 0 === s.length) return yn;
2625
2685
  const c = (t) => e.getRangeFromCell(t);
2626
2686
  let d;
2627
2687
  if (n) d = n(e, r);
2628
2688
  else {
2629
2689
  d = [];
2630
- const e = a.length, t = s.length;
2690
+ const e = s.length, t = a.length;
2631
2691
  for (let n = 0; n < e; n++) {
2632
- const e = a[n].index;
2692
+ const e = s[n].index;
2633
2693
  for (let n = 0; n < t; n++) {
2634
2694
  const t = {
2635
2695
  rowIndex: e,
2636
- colIndex: s[n].index
2696
+ colIndex: a[n].index
2637
2697
  }, r = c(t);
2638
2698
  U.isSingleCell(r) && o?.(t) || d.push({
2639
2699
  cell: t,
@@ -2643,7 +2703,7 @@ var hn = i((e) => {
2643
2703
  }
2644
2704
  }
2645
2705
  const u = d ? d.length : 0;
2646
- if (0 === u) return fn;
2706
+ if (0 === u) return yn;
2647
2707
  const g = e.getVisibleRange(), h = r ?? g, f = [], p = [], m = [], w = /* @__PURE__ */ new Set();
2648
2708
  for (let t = 0; t < u; t++) {
2649
2709
  const n = d[t];
@@ -2658,31 +2718,31 @@ var hn = i((e) => {
2658
2718
  if (!U.isRangesIntersect(l, h) && !U.isRangeWithinRange(l, h)) continue;
2659
2719
  const i = l && !U.isSingleCell(l);
2660
2720
  if (!i && o?.(r)) continue;
2661
- let s = null;
2721
+ let a = null;
2662
2722
  if (i) {
2663
2723
  const t = c(r);
2664
2724
  U.isSingleCell(t) || r.rowIndex === t.rowStart && r.colIndex === t.colStart || (r = {
2665
2725
  rowIndex: t.rowStart,
2666
2726
  colIndex: t.colStart
2667
2727
  });
2668
- const n = bn(l.rowStart, l.colStart);
2728
+ const n = Mn(l.rowStart, l.colStart);
2669
2729
  if (w.has(n)) continue;
2670
- w.add(n), l.rowEnd - l.rowStart > 0 && p.push(l), l.colEnd - l.colStart > 0 && m.push(l), s = e.getBoundsFromRange(l);
2730
+ w.add(n), l.rowEnd - l.rowStart > 0 && p.push(l), l.colEnd - l.colStart > 0 && m.push(l), a = e.getBoundsFromRange(l);
2671
2731
  } else {
2672
2732
  const t = e.getRowSize(r.rowIndex), n = e.getColumnSize(r.colIndex);
2673
- t && n && (s = {
2733
+ t && n && (a = {
2674
2734
  x: n.offset,
2675
2735
  y: t.offset,
2676
2736
  width: n.size,
2677
2737
  height: t.size
2678
2738
  });
2679
2739
  }
2680
- s || (s = e.getBoundsFromRange(l)), s ? f.push({
2740
+ a || (a = e.getBoundsFromRange(l)), a ? f.push({
2681
2741
  cell: r,
2682
2742
  range: l,
2683
- bounds: s,
2743
+ bounds: a,
2684
2744
  value: n?.value
2685
- }) : pn || (pn = !0, console.warn("grid-react: no bounds for cell", bn(l.rowStart, l.colStart)));
2745
+ }) : bn || (bn = !0, console.warn("grid-react: no bounds for cell", Mn(l.rowStart, l.colStart)));
2686
2746
  }
2687
2747
  return {
2688
2748
  cells: f,
@@ -2690,7 +2750,7 @@ var hn = i((e) => {
2690
2750
  rangesV: m
2691
2751
  };
2692
2752
  })(e, t);
2693
- return mn.set(e, {
2753
+ return Sn.set(e, {
2694
2754
  rowStart: n.rowStart,
2695
2755
  colStart: n.colStart,
2696
2756
  rowEnd: n.rowEnd,
@@ -2699,47 +2759,47 @@ var hn = i((e) => {
2699
2759
  scrollTop: o.top,
2700
2760
  hasBuffer: l,
2701
2761
  bRowStart: i,
2702
- bColStart: s,
2703
- bRowEnd: a,
2762
+ bColStart: a,
2763
+ bRowEnd: s,
2704
2764
  bColEnd: c,
2705
2765
  options: t,
2706
2766
  model: u
2707
2767
  }), u;
2708
- }, xn = Object.freeze({
2768
+ }, In = Object.freeze({
2709
2769
  rangesH: [],
2710
2770
  rangesV: []
2711
- }), vn = /* @__PURE__ */ new WeakMap(), yn = (e, t = {}) => {
2712
- const n = e.getVisibleRange(), o = vn.get(e);
2771
+ }), Cn = /* @__PURE__ */ new WeakMap(), Rn = (e, t = {}) => {
2772
+ const n = e.getVisibleRange(), o = Cn.get(e);
2713
2773
  if (o && o.rowStart === n.rowStart && o.colStart === n.colStart && o.rowEnd === n.rowEnd && o.colEnd === n.colEnd && o.cacheToken === t.cacheToken && o.getVisibleCells === t.getVisibleCells) return o.ranges;
2714
2774
  const r = ((e, t = {}) => {
2715
- const { getVisibleCells: n } = t, o = e.getVisibleRange(), r = [], l = [], i = /* @__PURE__ */ new Set(), s = (e) => {
2775
+ const { getVisibleCells: n } = t, o = e.getVisibleRange(), r = [], l = [], i = /* @__PURE__ */ new Set(), a = (e) => {
2716
2776
  if (U.isSingleCell(e)) return;
2717
2777
  if (!U.isRangesIntersect(e, o) && !U.isRangeWithinRange(e, o)) return;
2718
- const t = bn(e.rowStart, e.colStart);
2778
+ const t = Mn(e.rowStart, e.colStart);
2719
2779
  i.has(t) || (i.add(t), e.rowEnd - e.rowStart > 0 && r.push(e), e.colEnd - e.colStart > 0 && l.push(e));
2720
2780
  };
2721
2781
  if (n) {
2722
2782
  const t = n(e), o = t ? t.length : 0;
2723
2783
  for (let e = 0; e < o; e++) {
2724
2784
  const n = t[e]?.range;
2725
- n && s(n);
2785
+ n && a(n);
2726
2786
  }
2727
2787
  } else {
2728
2788
  const t = e.getVisibleColumns(), n = e.getVisibleRows(), o = n.length, r = t.length;
2729
2789
  for (let l = 0; l < o; l++) {
2730
2790
  const o = n[l].index;
2731
- for (let n = 0; n < r; n++) s(e.getRangeFromCell({
2791
+ for (let n = 0; n < r; n++) a(e.getRangeFromCell({
2732
2792
  rowIndex: o,
2733
2793
  colIndex: t[n].index
2734
2794
  }));
2735
2795
  }
2736
2796
  }
2737
- return 0 === r.length && 0 === l.length ? xn : {
2797
+ return 0 === r.length && 0 === l.length ? In : {
2738
2798
  rangesH: r,
2739
2799
  rangesV: l
2740
2800
  };
2741
2801
  })(e, t);
2742
- return vn.set(e, {
2802
+ return Cn.set(e, {
2743
2803
  rowStart: n.rowStart,
2744
2804
  colStart: n.colStart,
2745
2805
  rowEnd: n.rowEnd,
@@ -2748,11 +2808,11 @@ var hn = i((e) => {
2748
2808
  cacheToken: t.cacheToken,
2749
2809
  ranges: r
2750
2810
  }), r;
2751
- }, bn = (e, t) => `${e}:${t}`, Sn = {
2811
+ }, Mn = (e, t) => `${e}:${t}`, Pn = {
2752
2812
  tiles: "_tiles_ikr1b_7",
2753
2813
  gridlines: "_gridlines_ikr1b_26"
2754
- }, En = i((e) => {
2755
- const { renderCell: t, cacheToken: n, getVisibleCells: o, hiddenCellAt: r, suppressCell: l, className: i, style: s } = e, a = qe(), c = a.getAnchor(), u = d(), h = g(() => `sxl-cl-${u.replace(/[^a-zA-Z0-9_-]/g, "")}`, [u]), p = f({
2814
+ }, kn = i((e) => {
2815
+ const { renderCell: t, cacheToken: n, getVisibleCells: o, hiddenCellAt: r, suppressCell: l, className: i, style: a } = e, s = Ze(), c = s.getAnchor(), u = d(), h = g(() => `sxl-cl-${u.replace(/[^a-zA-Z0-9_-]/g, "")}`, [u]), p = f({
2756
2816
  token: void 0,
2757
2817
  renderCell: void 0,
2758
2818
  getVisibleCells: void 0,
@@ -2761,43 +2821,43 @@ var hn = i((e) => {
2761
2821
  rebaseLeft: 0,
2762
2822
  rebaseTop: 0,
2763
2823
  map: /* @__PURE__ */ new Map()
2764
- }), m = a.getScrollTopLeft(), y = a.getFreezeTopLeft(), b = m.left + y.left, S = m.top + y.top, E = Math.floor(b / Rn) * Rn, I = Math.floor(S / Rn) * Rn, C = a.getVisibleRange();
2824
+ }), m = s.getScrollTopLeft(), y = s.getFreezeTopLeft(), b = m.left + y.left, S = m.top + y.top, E = Math.floor(b / On) * On, I = Math.floor(S / On) * On, C = s.getVisibleRange();
2765
2825
  let R = 0, M = -1, P = 0, k = -1;
2766
- C && (R = Math.max(0, Math.floor(C.rowStart / Cn) - Mn), M = Math.floor(C.rowEnd / Cn) + Mn, P = Math.max(0, Math.floor(C.colStart / Cn) - Mn), k = Math.floor(C.colEnd / Cn) + Mn);
2826
+ C && (R = Math.max(0, Math.floor(C.rowStart / Tn) - zn), M = Math.floor(C.rowEnd / Tn) + zn, P = Math.max(0, Math.floor(C.colStart / Tn) - zn), k = Math.floor(C.colEnd / Tn) + zn);
2767
2827
  const D = g(() => {
2768
2828
  if (!C || M < R) return null;
2769
2829
  const e = p.current;
2770
- e.token === n && e.pane === a && e.renderCell === t && e.getVisibleCells === o && e.hiddenCellAt === r && e.rebaseLeft === E && e.rebaseTop === I || (e.map = /* @__PURE__ */ new Map(), e.token = n, e.pane = a, e.renderCell = t, e.getVisibleCells = o, e.hiddenCellAt = r, e.rebaseLeft = E, e.rebaseTop = I);
2771
- const l = e.map, i = a.getTotalRange(), s = {
2772
- rowStart: Math.max(i.rowStart, R * Cn),
2773
- colStart: Math.max(i.colStart, P * Cn),
2774
- rowEnd: Math.min(i.rowEnd, (M + 1) * Cn - 1),
2775
- colEnd: Math.min(i.colEnd, (k + 1) * Cn - 1)
2776
- }, { cells: d } = wn(a, {
2830
+ e.token === n && e.pane === s && e.renderCell === t && e.getVisibleCells === o && e.hiddenCellAt === r && e.rebaseLeft === E && e.rebaseTop === I || (e.map = /* @__PURE__ */ new Map(), e.token = n, e.pane = s, e.renderCell = t, e.getVisibleCells = o, e.hiddenCellAt = r, e.rebaseLeft = E, e.rebaseTop = I);
2831
+ const l = e.map, i = s.getTotalRange(), a = {
2832
+ rowStart: Math.max(i.rowStart, R * Tn),
2833
+ colStart: Math.max(i.colStart, P * Tn),
2834
+ rowEnd: Math.min(i.rowEnd, (M + 1) * Tn - 1),
2835
+ colEnd: Math.min(i.colEnd, (k + 1) * Tn - 1)
2836
+ }, { cells: d } = En(s, {
2777
2837
  getVisibleCells: o,
2778
2838
  hiddenCellAt: r,
2779
- bufferRange: s,
2839
+ bufferRange: a,
2780
2840
  cacheToken: n
2781
2841
  }), u = /* @__PURE__ */ new Map();
2782
2842
  for (let e = 0; e < d.length; e++) {
2783
- const t = d[e], n = `${Math.floor(t.cell.rowIndex / Cn)}:${Math.floor(t.cell.colIndex / Cn)}`;
2843
+ const t = d[e], n = `${Math.floor(t.cell.rowIndex / Tn)}:${Math.floor(t.cell.colIndex / Tn)}`;
2784
2844
  let o = u.get(n);
2785
2845
  o || (o = [], u.set(n, o)), o.push(t);
2786
2846
  }
2787
2847
  const g = [], h = (e, n) => {
2788
- if (e * Cn > i.rowEnd || n * Cn > i.colEnd) return;
2848
+ if (e * Tn > i.rowEnd || n * Tn > i.colEnd) return;
2789
2849
  const o = e >= R && e <= M && n >= P && n <= k, r = `${e}:${n}`;
2790
- let s = l.get(r);
2791
- if (void 0 === s) {
2850
+ let a = l.get(r);
2851
+ if (void 0 === a) {
2792
2852
  const d = u.get(r);
2793
- if (!d && !kn) return;
2794
- const g = a.getBoundsFromRange({
2795
- rowStart: e * Cn,
2796
- colStart: n * Cn,
2797
- rowEnd: Math.min(i.rowEnd, e * Cn + Cn - 1),
2798
- colEnd: Math.min(i.colEnd, n * Cn + Cn - 1)
2853
+ if (!d && !Ln) return;
2854
+ const g = s.getBoundsFromRange({
2855
+ rowStart: e * Tn,
2856
+ colStart: n * Tn,
2857
+ rowEnd: Math.min(i.rowEnd, e * Tn + Tn - 1),
2858
+ colEnd: Math.min(i.colEnd, n * Tn + Tn - 1)
2799
2859
  }), h = b + g.x - E, f = S + g.y - I, p = [];
2800
- if (kn && p.push(x("div", { style: {
2860
+ if (Ln && p.push(x("div", { style: {
2801
2861
  position: "absolute",
2802
2862
  left: 0,
2803
2863
  top: 0,
@@ -2808,13 +2868,13 @@ var hn = i((e) => {
2808
2868
  } }, "__bg")), d) for (let e = 0; e < d.length; e++) {
2809
2869
  const { cell: n, range: o, bounds: r, value: l } = d[e];
2810
2870
  r && p.push(t({
2811
- key: `pane:${c}:cell:${bn(n.rowIndex, n.colIndex)}`,
2871
+ key: `pane:${c}:cell:${Mn(n.rowIndex, n.colIndex)}`,
2812
2872
  cell: n,
2813
2873
  bounds: r,
2814
2874
  range: o,
2815
- pane: a,
2875
+ pane: s,
2816
2876
  value: l,
2817
- "data-rc": bn(n.rowIndex, n.colIndex),
2877
+ "data-rc": Mn(n.rowIndex, n.colIndex),
2818
2878
  style: {
2819
2879
  left: r.x - g.x,
2820
2880
  top: r.y - g.y,
@@ -2823,19 +2883,19 @@ var hn = i((e) => {
2823
2883
  }
2824
2884
  }));
2825
2885
  }
2826
- if (s = x("div", {
2886
+ if (a = x("div", {
2827
2887
  className: "tile",
2828
2888
  style: { transform: `translate(${h}px, ${f}px)` },
2829
2889
  children: p
2830
- }, `pane:${c}:tile:${e}:${n}`), o && (l.set(r, s), l.size > Pn)) {
2890
+ }, `pane:${c}:tile:${e}:${n}`), o && (l.set(r, a), l.size > $n)) {
2831
2891
  const e = l.keys().next().value;
2832
2892
  void 0 !== e && l.delete(e);
2833
2893
  }
2834
2894
  }
2835
- s && g.push(s);
2895
+ a && g.push(a);
2836
2896
  };
2837
- if (kn) {
2838
- for (let e = R; e <= M && !(e * Cn > i.rowEnd); e++) for (let t = P; t <= k && !(t * Cn > i.colEnd); t++) h(e, t);
2897
+ if (Ln) {
2898
+ for (let e = R; e <= M && !(e * Tn > i.rowEnd); e++) for (let t = P; t <= k && !(t * Tn > i.colEnd); t++) h(e, t);
2839
2899
  for (const e of u.keys()) {
2840
2900
  const t = e.indexOf(":"), n = Number(e.slice(0, t)), o = Number(e.slice(t + 1));
2841
2901
  (n < R || n > M || o < P || o > k) && h(n, o);
@@ -2851,60 +2911,60 @@ var hn = i((e) => {
2851
2911
  t,
2852
2912
  o,
2853
2913
  r,
2854
- a,
2914
+ s,
2855
2915
  c,
2856
2916
  E,
2857
2917
  I
2858
2918
  ]);
2859
- return v(w, { children: [x(lt, {
2919
+ return v(w, { children: [x(it, {
2860
2920
  fill: !0,
2861
- className: V(Sn.tiles, h, i),
2921
+ className: V(Pn.tiles, h, i),
2862
2922
  style: {
2863
2923
  pointerEvents: "none",
2864
- ...s,
2924
+ ...a,
2865
2925
  transform: `translate3d(${E - b}px, ${I - S}px, 0)`,
2866
2926
  willChange: "transform"
2867
2927
  },
2868
2928
  children: D
2869
- }), l ? x("style", { children: `.${h} [data-rc="${bn(l.rowIndex, l.colIndex)}"]{visibility:hidden !important;}` }) : null] });
2929
+ }), l ? x("style", { children: `.${h} [data-rc="${Mn(l.rowIndex, l.colIndex)}"]{visibility:hidden !important;}` }) : null] });
2870
2930
  });
2871
- En.displayName = "CellTileDiv";
2872
- var In = i((e) => {
2873
- const { renderCell: t, cacheToken: n, getVisibleCells: o, hiddenCellAt: r, suppressCell: l, className: i, style: s, ...a } = e;
2874
- return x(et, {
2931
+ kn.displayName = "CellTileDiv";
2932
+ var Dn = i((e) => {
2933
+ const { renderCell: t, cacheToken: n, getVisibleCells: o, hiddenCellAt: r, suppressCell: l, className: i, style: a, ...s } = e;
2934
+ return x(tt, {
2875
2935
  className: V(i, "tiles"),
2876
- ...a,
2877
- children: x(En, {
2936
+ ...s,
2937
+ children: x(kn, {
2878
2938
  renderCell: t,
2879
2939
  cacheToken: n,
2880
2940
  getVisibleCells: o,
2881
2941
  hiddenCellAt: r,
2882
2942
  suppressCell: l,
2883
- style: s
2943
+ style: a
2884
2944
  })
2885
2945
  });
2886
2946
  });
2887
- In.displayName = "CellLayer";
2888
- var Cn = 8, Rn = 1 << 19, Mn = 1, Pn = 512, kn = !1, Dn = (e, t, n) => {
2889
- const o = S.getDevicePixelRatio(), r = $n / o, l = e.getVisibleRange(), i = (t) => e.getColumnSize(t).offset, s = (t) => {
2947
+ Dn.displayName = "CellLayer";
2948
+ var Tn = 8, On = 1 << 19, zn = 1, $n = 512, Ln = !1, Bn = (e, t, n) => {
2949
+ const o = S.getDevicePixelRatio(), r = Vn / o, l = e.getVisibleRange(), i = (t) => e.getColumnSize(t).offset, a = (t) => {
2890
2950
  const n = e.getColumnSize(t);
2891
2951
  return n.offset + n.size;
2892
- }, a = (t) => e.getRowSize(t).offset, c = (t) => {
2952
+ }, s = (t) => e.getRowSize(t).offset, c = (t) => {
2893
2953
  const n = e.getRowSize(t);
2894
2954
  return n.offset + n.size;
2895
2955
  }, d = [], u = [];
2896
2956
  let g = !1, h = "";
2897
2957
  if (t) {
2898
- const t = e.getVisibleRows(), a = t ? t.length : 0;
2899
- if (0 === a) return h;
2900
- const f = [...n].sort(U.rowFirstRangeComparator), p = S.snapDeviceEdge(0, o), m = Math.min(e.getPaneBounds().width, s(l.colEnd)), w = S.snapDeviceEdge(m, o);
2901
- for (let e = 0; e < a && t[e].index <= l.rowEnd; e++) {
2902
- const n = t[e], a = n.index;
2903
- if (a < l.rowStart) continue;
2958
+ const t = e.getVisibleRows(), s = t ? t.length : 0;
2959
+ if (0 === s) return h;
2960
+ const f = [...n].sort(U.rowFirstRangeComparator), p = S.snapDeviceEdge(0, o), m = Math.min(e.getPaneBounds().width, a(l.colEnd)), w = S.snapDeviceEdge(m, o);
2961
+ for (let e = 0; e < s && t[e].index <= l.rowEnd; e++) {
2962
+ const n = t[e], s = n.index;
2963
+ if (s < l.rowStart) continue;
2904
2964
  const x = n.offset + n.size;
2905
2965
  for (let e = d.length - 1; e >= 0; e--) c(d[e].rowEnd) <= x && (d.splice(e, 1), g = !1);
2906
2966
  let v = !1;
2907
- for (; f.length > 0 && f[0].rowStart <= a;) {
2967
+ for (; f.length > 0 && f[0].rowStart <= s;) {
2908
2968
  const e = f.shift();
2909
2969
  c(e.rowEnd) > x && (d.push(e), v = !0, g = !1);
2910
2970
  }
@@ -2912,7 +2972,7 @@ var Cn = 8, Rn = 1 << 19, Mn = 1, Pn = 512, kn = !1, Dn = (e, t, n) => {
2912
2972
  u.length = 0;
2913
2973
  for (let e = 0; e < d.length; e++) {
2914
2974
  const t = d[e];
2915
- u.push(S.snapDeviceEdge(Math.min(m, i(t.colStart)), o), S.snapDeviceEdge(Math.min(m, s(t.colEnd)), o));
2975
+ u.push(S.snapDeviceEdge(Math.min(m, i(t.colStart)), o), S.snapDeviceEdge(Math.min(m, a(t.colEnd)), o));
2916
2976
  }
2917
2977
  g = !0;
2918
2978
  }
@@ -2933,17 +2993,17 @@ var Cn = 8, Rn = 1 << 19, Mn = 1, Pn = 512, kn = !1, Dn = (e, t, n) => {
2933
2993
  const n = t[e], i = n.index;
2934
2994
  if (i < l.colStart) continue;
2935
2995
  const x = n.offset + n.size;
2936
- for (let e = d.length - 1; e >= 0; e--) s(d[e].colEnd) <= x && (d.splice(e, 1), g = !1);
2996
+ for (let e = d.length - 1; e >= 0; e--) a(d[e].colEnd) <= x && (d.splice(e, 1), g = !1);
2937
2997
  let v = !1;
2938
2998
  for (; f.length > 0 && f[0].colStart <= i;) {
2939
2999
  const e = f.shift();
2940
- s(e.colEnd) > x && (d.push(e), v = !0, g = !1);
3000
+ a(e.colEnd) > x && (d.push(e), v = !0, g = !1);
2941
3001
  }
2942
3002
  if (v && d.sort(U.rowFirstRangeComparator), !g) {
2943
3003
  u.length = 0;
2944
3004
  for (let e = 0; e < d.length; e++) {
2945
3005
  const t = d[e];
2946
- u.push(S.snapDeviceEdge(Math.min(m, a(t.rowStart)), o), S.snapDeviceEdge(Math.min(m, c(t.rowEnd)), o));
3006
+ u.push(S.snapDeviceEdge(Math.min(m, s(t.rowStart)), o), S.snapDeviceEdge(Math.min(m, c(t.rowEnd)), o));
2947
3007
  }
2948
3008
  g = !0;
2949
3009
  }
@@ -2958,60 +3018,60 @@ var Cn = 8, Rn = 1 << 19, Mn = 1, Pn = 512, kn = !1, Dn = (e, t, n) => {
2958
3018
  }
2959
3019
  }
2960
3020
  return h;
2961
- }, Tn = (e) => {
3021
+ }, An = (e) => {
2962
3022
  let t = "";
2963
3023
  for (let n = 0; n < e.length; n++) {
2964
3024
  const o = e[n];
2965
3025
  t += `${o.rowStart},${o.colStart},${o.rowEnd},${o.colEnd};`;
2966
3026
  }
2967
3027
  return t;
2968
- }, zn = (e, t, n, o, r) => {
3028
+ }, Nn = (e, t, n, o, r) => {
2969
3029
  if (!n) return null;
2970
- const l = e.getPaneBounds(), i = Math.ceil(l.width), s = Math.ceil(l.height), a = String($n / S.getDevicePixelRatio());
3030
+ const l = e.getPaneBounds(), i = Math.ceil(l.width), a = Math.ceil(l.height), s = String(Vn / S.getDevicePixelRatio());
2971
3031
  return x("svg", {
2972
3032
  className: V(t ? "horizontal" : "vertical"),
2973
3033
  width: `${i}`,
2974
- height: `${s}`,
2975
- viewBox: `0 0 ${i} ${s}`,
3034
+ height: `${a}`,
3035
+ viewBox: `0 0 ${i} ${a}`,
2976
3036
  preserveAspectRatio: "none",
2977
3037
  children: x("path", {
2978
3038
  d: n,
2979
3039
  fill: "none",
2980
3040
  stroke: o,
2981
- strokeWidth: a,
3041
+ strokeWidth: s,
2982
3042
  vectorEffect: "non-scaling-stroke",
2983
3043
  ...r
2984
3044
  })
2985
3045
  });
2986
- }, On = i((e) => {
2987
- const { showGridLines: t = !0, gridLineColor: n = "var(--sxl-color-base-300, rgb(224, 224, 224))", propsRows: o, propsColumns: r, getVisibleCells: l, hiddenCellAt: i, cacheToken: s, bufferRange: a, className: c, style: d, ...u } = e, h = qe(), f = t, p = !0 === t || !0 === f?.horizontal, m = !0 === t || !0 === f?.vertical, { rangesH: w, rangesV: y } = yn(h, {
3046
+ }, Fn = i((e) => {
3047
+ const { showGridLines: t = !0, gridLineColor: n = "var(--sxl-color-base-300, rgb(224, 224, 224))", propsRows: o, propsColumns: r, getVisibleCells: l, hiddenCellAt: i, cacheToken: a, bufferRange: s, className: c, style: d, ...u } = e, h = Ze(), f = t, p = !0 === t || !0 === f?.horizontal, m = !0 === t || !0 === f?.vertical, { rangesH: w, rangesV: y } = Rn(h, {
2988
3048
  getVisibleCells: l,
2989
- cacheToken: s
2990
- }), b = S.getDevicePixelRatio(), { top: E, left: I } = h.getScrollTopLeft(), C = h.getPaneBounds(), R = h.getVisibleRange(), M = h.getColumnSize(R.colEnd), P = h.getRowSize(R.rowEnd), k = Math.min(C.width, M ? M.offset + M.size : C.width), D = Math.min(C.height, P ? P.offset + P.size : C.height), T = 0 === w.length ? `${E}|${k}|${b}` : `${E}|${I}|${k}|${b}|${Tn(w)}`, z = 0 === y.length ? `${I}|${D}|${b}` : `${I}|${E}|${D}|${b}|${Tn(y)}`, O = g(() => p ? Dn(h, !0, w) : null, [
3049
+ cacheToken: a
3050
+ }), b = S.getDevicePixelRatio(), { top: E, left: I } = h.getScrollTopLeft(), C = h.getPaneBounds(), R = h.getVisibleRange(), M = h.getColumnSize(R.colEnd), P = h.getRowSize(R.rowEnd), k = Math.min(C.width, M ? M.offset + M.size : C.width), D = Math.min(C.height, P ? P.offset + P.size : C.height), T = 0 === w.length ? `${E}|${k}|${b}` : `${E}|${I}|${k}|${b}|${An(w)}`, O = 0 === y.length ? `${I}|${D}|${b}` : `${I}|${E}|${D}|${b}|${An(y)}`, z = g(() => p ? Bn(h, !0, w) : null, [
2991
3051
  h,
2992
3052
  p,
2993
3053
  T
2994
- ]), $ = g(() => m ? Dn(h, !1, y) : null, [
3054
+ ]), $ = g(() => m ? Bn(h, !1, y) : null, [
2995
3055
  h,
2996
3056
  m,
2997
- z
3057
+ O
2998
3058
  ]);
2999
- return p || m ? x(et, {
3059
+ return p || m ? x(tt, {
3000
3060
  ...u,
3001
3061
  className: V(c, "gridlines"),
3002
- children: v(lt, {
3062
+ children: v(it, {
3003
3063
  fill: !0,
3004
- className: Sn.gridlines,
3064
+ className: Pn.gridlines,
3005
3065
  style: {
3006
3066
  pointerEvents: "none",
3007
3067
  ...d
3008
3068
  },
3009
- children: [p && O ? zn(h, !0, O, n, o) : null, m && $ ? zn(h, !1, $, n, r) : null]
3069
+ children: [p && z ? Nn(h, !0, z, n, o) : null, m && $ ? Nn(h, !1, $, n, r) : null]
3010
3070
  })
3011
3071
  }) : null;
3012
3072
  });
3013
- On.displayName = "GridlineLayer";
3014
- var $n = 1, Ln = -10, Bn = class {
3073
+ Fn.displayName = "GridlineLayer";
3074
+ var Vn = 1, Hn = -10, _n = class {
3015
3075
  constructor(e = {}) {
3016
3076
  this.listeners = /* @__PURE__ */ new Set(), this._coords = e.initial ?? {
3017
3077
  cell: {
@@ -3020,7 +3080,7 @@ var $n = 1, Ln = -10, Bn = class {
3020
3080
  },
3021
3081
  ranges: U.EmptyRanges,
3022
3082
  rangeIndex: -1
3023
- }, this._getBounds = e.getBounds ?? (() => Fn);
3083
+ }, this._getBounds = e.getBounds ?? (() => Kn);
3024
3084
  }
3025
3085
  getSelection() {
3026
3086
  return this._coords;
@@ -3029,7 +3089,7 @@ var $n = 1, Ln = -10, Bn = class {
3029
3089
  U.isEqualSelectionCoords(this._coords, e) || (this._coords = e, this.listeners.forEach((e) => e()));
3030
3090
  }
3031
3091
  navigate(e, t = !1, n = !1, o = 1) {
3032
- const r = this._getBounds(), { cell: l } = this._coords, i = e === j.Down ? 1 : e === j.Up ? -1 : 0, s = e === j.Right ? 1 : e === j.Left ? -1 : 0, a = (e) => 0 === e ? 0 : n ? e > 0 ? Infinity : -Infinity : e * Math.max(1, o), c = this._activeRange(), d = t ? l.rowIndex === c.rowStart ? c.rowEnd : c.rowStart : l.rowIndex, u = t ? l.colIndex === c.colStart ? c.colEnd : c.colStart : l.colIndex, g = ge(d + a(i), r.rowStart, r.rowEnd), h = ge(u + a(s), r.colStart, r.colEnd);
3092
+ const r = this._getBounds(), { cell: l } = this._coords, i = e === j.Down ? 1 : e === j.Up ? -1 : 0, a = e === j.Right ? 1 : e === j.Left ? -1 : 0, s = (e) => 0 === e ? 0 : n ? e > 0 ? Infinity : -Infinity : e * Math.max(1, o), c = this._activeRange(), d = t ? l.rowIndex === c.rowStart ? c.rowEnd : c.rowStart : l.rowIndex, u = t ? l.colIndex === c.colStart ? c.colEnd : c.colStart : l.colIndex, g = he(d + s(i), r.rowStart, r.rowEnd), h = he(u + s(a), r.colStart, r.colEnd);
3033
3093
  if (!t) return void this.setSelection({
3034
3094
  cell: {
3035
3095
  rowIndex: g,
@@ -3081,20 +3141,20 @@ var $n = 1, Ln = -10, Bn = class {
3081
3141
  return e >= 0 ? this._coords.ranges[e] : U.cellToRange(this._coords.cell);
3082
3142
  }
3083
3143
  modify(e, t = this._coords.cell) {
3084
- const n = this._activeRange(), r = An({
3144
+ const n = this._activeRange(), r = Wn({
3085
3145
  rowStart: Math.min(e.rowIndex ?? n.rowStart, t.rowIndex ?? n.rowStart),
3086
3146
  colStart: Math.min(e.colIndex ?? n.colStart, t.colIndex ?? n.colStart),
3087
3147
  rowEnd: Math.max(e.rowIndex ?? n.rowEnd, t.rowIndex ?? n.rowEnd),
3088
3148
  colEnd: Math.max(e.colIndex ?? n.colEnd, t.colIndex ?? n.colEnd)
3089
- }, this._getBounds()), l = this._coords, i = this._activeIndex(), s = i >= 0 ? l.ranges.map((e, t) => t === i ? r : e) : [r], a = Nn(l.cell, r);
3149
+ }, this._getBounds()), l = this._coords, i = this._activeIndex(), a = i >= 0 ? l.ranges.map((e, t) => t === i ? r : e) : [r], s = Un(l.cell, r);
3090
3150
  this.setSelection({
3091
- cell: a,
3092
- ranges: s,
3151
+ cell: s,
3152
+ ranges: a,
3093
3153
  rangeIndex: i >= 0 ? i : 0
3094
3154
  });
3095
3155
  }
3096
3156
  append(e, t = e) {
3097
- const n = An({
3157
+ const n = Wn({
3098
3158
  rowStart: Math.min(e.rowIndex, t.rowIndex),
3099
3159
  colStart: Math.min(e.colIndex, t.colIndex),
3100
3160
  rowEnd: Math.max(e.rowIndex, t.rowIndex),
@@ -3119,7 +3179,7 @@ var $n = 1, Ln = -10, Bn = class {
3119
3179
  n.push(l), -1 === o && U.isCellWithinRange(t.cell, l) && (o = n.length - 1);
3120
3180
  continue;
3121
3181
  }
3122
- const i = n.length, s = W.subtractRect({
3182
+ const i = n.length, a = W.subtractRect({
3123
3183
  top: l.rowStart,
3124
3184
  left: l.colStart,
3125
3185
  bottom: l.rowEnd + 1,
@@ -3130,7 +3190,7 @@ var $n = 1, Ln = -10, Bn = class {
3130
3190
  bottom: e.rowEnd + 1,
3131
3191
  right: e.colEnd + 1
3132
3192
  });
3133
- for (const e of s) {
3193
+ for (const e of a) {
3134
3194
  const r = {
3135
3195
  rowStart: e.top,
3136
3196
  colStart: e.left,
@@ -3170,56 +3230,56 @@ var $n = 1, Ln = -10, Bn = class {
3170
3230
  this.listeners.delete(e);
3171
3231
  };
3172
3232
  }
3173
- }, An = (e, t) => ({
3174
- rowStart: ge(e.rowStart, t.rowStart, t.rowEnd),
3175
- colStart: ge(e.colStart, t.colStart, t.colEnd),
3176
- rowEnd: ge(e.rowEnd, t.rowStart, t.rowEnd),
3177
- colEnd: ge(e.colEnd, t.colStart, t.colEnd)
3178
- }), Nn = (e, t) => ({
3179
- rowIndex: ge(e.rowIndex, t.rowStart, t.rowEnd),
3180
- colIndex: ge(e.colIndex, t.colStart, t.colEnd)
3181
- }), Fn = {
3233
+ }, Wn = (e, t) => ({
3234
+ rowStart: he(e.rowStart, t.rowStart, t.rowEnd),
3235
+ colStart: he(e.colStart, t.colStart, t.colEnd),
3236
+ rowEnd: he(e.rowEnd, t.rowStart, t.rowEnd),
3237
+ colEnd: he(e.colEnd, t.colStart, t.colEnd)
3238
+ }), Un = (e, t) => ({
3239
+ rowIndex: he(e.rowIndex, t.rowStart, t.rowEnd),
3240
+ colIndex: he(e.colIndex, t.colStart, t.colEnd)
3241
+ }), Kn = {
3182
3242
  rowStart: 0,
3183
3243
  colStart: 0,
3184
3244
  rowEnd: Number.MAX_SAFE_INTEGER,
3185
3245
  colEnd: Number.MAX_SAFE_INTEGER
3186
- }, Vn = "var(--sxl-color-primary, rgb(33, 115, 70))", Hn = "var(--sxl-color-base-100, rgb(255, 255, 255))", _n = "var(--sxl-color-warning, rgb(255, 0, 0))", Wn = (e) => `color-mix(in srgb, var(--sxl-color-primary, rgb(33, 115, 70)) ${e}%, transparent)`, Un = {
3187
- fill: { fill: Wn(10) },
3246
+ }, jn = "var(--sxl-color-primary, rgb(33, 115, 70))", Gn = "var(--sxl-color-base-100, rgb(255, 255, 255))", Xn = "var(--sxl-color-warning, rgb(255, 0, 0))", Yn = (e) => `color-mix(in srgb, var(--sxl-color-primary, rgb(33, 115, 70)) ${e}%, transparent)`, qn = {
3247
+ fill: { fill: Yn(10) },
3188
3248
  border: {
3189
- stroke: Vn,
3249
+ stroke: jn,
3190
3250
  alignWidth: 2,
3191
3251
  style: { filter: "drop-shadow(1px 1px 0.3px var(--sxl-color-shadow, rgba(0, 0, 0, 0.24)))" }
3192
3252
  },
3193
3253
  inner: {
3194
- stroke: Hn,
3254
+ stroke: Gn,
3195
3255
  alignWidth: 2,
3196
3256
  inset: 1
3197
3257
  }
3198
- }, Kn = {
3199
- fill: { fill: Wn(6) },
3258
+ }, Zn = {
3259
+ fill: { fill: Yn(6) },
3200
3260
  border: {
3201
- stroke: Vn,
3261
+ stroke: jn,
3202
3262
  alignWidth: 1
3203
3263
  },
3204
3264
  inner: {
3205
- stroke: Hn,
3265
+ stroke: Gn,
3206
3266
  alignWidth: 1,
3207
3267
  inset: 1
3208
3268
  }
3209
- }, jn = {
3210
- stroke: Vn,
3269
+ }, Jn = {
3270
+ stroke: jn,
3211
3271
  alignWidth: 1,
3212
3272
  inset: 2
3213
- }, Gn = {
3214
- fill: { fill: `color-mix(in srgb, ${_n} 10%, transparent)` },
3273
+ }, Qn = {
3274
+ fill: { fill: `color-mix(in srgb, ${Xn} 10%, transparent)` },
3215
3275
  border: {
3216
- stroke: _n,
3276
+ stroke: Xn,
3217
3277
  alignWidth: 2
3218
3278
  }
3219
- }, Xn = (e, t) => {
3220
- const n = qe(), o = t?.allowDeselect ?? !0, r = t?.allowMulti ?? !0, l = f(null), [i, s] = p(null), a = f(t?.onSelectionEnd);
3221
- a.current = t?.onSelectionEnd;
3222
- const c = Zt((t, i) => {
3279
+ }, eo = (e, t) => {
3280
+ const n = Ze(), o = t?.allowDeselect ?? !0, r = t?.allowMulti ?? !0, l = f(null), [i, a] = p(null), s = f(t?.onSelectionEnd);
3281
+ s.current = t?.onSelectionEnd;
3282
+ const c = on((t, i) => {
3223
3283
  if ("touch" === i.pointerType) {
3224
3284
  const t = n.getScrollTopLeft(), o = {
3225
3285
  x: i.clientX,
@@ -3238,7 +3298,7 @@ var $n = 1, Ln = -10, Bn = class {
3238
3298
  rangeIndex: -1
3239
3299
  });
3240
3300
  }
3241
- a.current?.(r);
3301
+ s.current?.(r);
3242
3302
  }
3243
3303
  };
3244
3304
  }
@@ -3252,7 +3312,7 @@ var $n = 1, Ln = -10, Bn = class {
3252
3312
  }
3253
3313
  if (0 !== i.button) return null;
3254
3314
  i.stopPropagation();
3255
- const c = (e) => a.current?.(e), d = e.getSelection(), u = () => e.setSelection(d);
3315
+ const c = (e) => s.current?.(e), d = e.getSelection(), u = () => e.setSelection(d);
3256
3316
  if (i.shiftKey) return e.modify(t), {
3257
3317
  dragMode: "extend",
3258
3318
  drag: (t) => e.modify(t),
@@ -3261,7 +3321,7 @@ var $n = 1, Ln = -10, Bn = class {
3261
3321
  };
3262
3322
  if ((i.ctrlKey || i.metaKey) && r) {
3263
3323
  const r = e.getSelection().ranges, i = !!r && r.some((e) => U.isCellWithinRange(t, e));
3264
- return o && i ? (l.current = U.cellToRange(t), s(l.current), {
3324
+ return o && i ? (l.current = U.cellToRange(t), a(l.current), {
3265
3325
  dragMode: "remove",
3266
3326
  drag: (e) => {
3267
3327
  l.current = ((e, t) => {
@@ -3272,14 +3332,14 @@ var $n = 1, Ln = -10, Bn = class {
3272
3332
  rowEnd: Math.min(o.rowEnd, Math.max(e.rowIndex, t.rowIndex)),
3273
3333
  colEnd: Math.min(o.colEnd, Math.max(e.colIndex, t.colIndex))
3274
3334
  };
3275
- })(t, e), s(l.current);
3335
+ })(t, e), a(l.current);
3276
3336
  },
3277
3337
  end: (t) => {
3278
3338
  const n = l.current;
3279
- l.current = null, s(null), n && e.deselect(n), c(t);
3339
+ l.current = null, a(null), n && e.deselect(n), c(t);
3280
3340
  },
3281
3341
  cancel: () => {
3282
- l.current = null, s(null);
3342
+ l.current = null, a(null);
3283
3343
  }
3284
3344
  }) : (e.append(t), {
3285
3345
  dragMode: "extend",
@@ -3306,8 +3366,8 @@ var $n = 1, Ln = -10, Bn = class {
3306
3366
  removePreview: i,
3307
3367
  dragMode: c.dragMode
3308
3368
  };
3309
- }, Yn = (e) => {
3310
- const { selection: t, color: n = "var(--sxl-color-primary, rgb(33, 115, 70))", size: o = 22 } = e, r = Ze(), i = Jn(T(t, (e) => e.getSelection())), s = r ? r.getAllPanes()[_.Center] ?? r : void 0, a = ((e, t, n) => {
3369
+ }, to = (e) => {
3370
+ const { selection: t, color: n = "var(--sxl-color-primary, rgb(33, 115, 70))", size: o = 22 } = e, r = Je(), i = ro(T(t, (e) => e.getSelection())), a = r ? r.getAllPanes()[_.Center] ?? r : void 0, s = ((e, t, n) => {
3311
3371
  const o = !!t && e.rowStart === t.rowStart && e.rowEnd === t.rowEnd, r = !!t && e.colStart === t.colStart && e.colEnd === t.colEnd;
3312
3372
  if (o && r) return [];
3313
3373
  if (o) {
@@ -3401,7 +3461,7 @@ var $n = 1, Ln = -10, Bn = class {
3401
3461
  },
3402
3462
  axis: "both"
3403
3463
  }];
3404
- })(i, r?.getTotalRange(), s?.getVisibleRange()), [d, u] = p(!1), g = f(null);
3464
+ })(i, r?.getTotalRange(), a?.getVisibleRange()), [d, u] = p(!1), g = f(null);
3405
3465
  c(() => () => g.current?.dispose(), []);
3406
3466
  const h = (e, n, o, r) => {
3407
3467
  g.current?.dispose();
@@ -3414,21 +3474,21 @@ var $n = 1, Ln = -10, Bn = class {
3414
3474
  } : {
3415
3475
  x: !0,
3416
3476
  y: !0
3417
- }, i = t.getSelection(), s = qt(e, () => (u(!0), {
3477
+ }, i = t.getSelection(), a = nn(e, () => (u(!0), {
3418
3478
  dragMode: "grip",
3419
3479
  drag: (e) => {
3420
3480
  const r = "col" === o ? { colIndex: e.colIndex } : "row" === o ? { rowIndex: e.rowIndex } : e;
3421
3481
  t.modify(r, n);
3422
3482
  },
3423
- edgeScroll: (t) => Gt(e, t, l),
3483
+ edgeScroll: (t) => Qt(e, t, l),
3424
3484
  end: () => u(!1),
3425
3485
  cancel: () => {
3426
3486
  t.setSelection(i), u(!1);
3427
3487
  }
3428
3488
  }), void 0, (t, n) => (e.getPaneFromPointer(t, n) ?? e).getCellFromPointer(t, n));
3429
- g.current = s, s.start(r, r.currentTarget);
3489
+ g.current = a, a.start(r, r.currentTarget);
3430
3490
  };
3431
- return x(w, { children: a.map((e) => x(qn, {
3491
+ return x(w, { children: s.map((e) => x(no, {
3432
3492
  spec: e,
3433
3493
  size: o,
3434
3494
  color: n,
@@ -3436,14 +3496,14 @@ var $n = 1, Ln = -10, Bn = class {
3436
3496
  onBeginDrag: h
3437
3497
  }, e.key)) });
3438
3498
  };
3439
- Yn.displayName = "SelectionTouchGrips";
3440
- var qn = (e) => {
3499
+ to.displayName = "SelectionTouchGrips";
3500
+ var no = (e) => {
3441
3501
  const { spec: t, size: n, color: o, dragging: r, onBeginDrag: l } = e;
3442
- return x(Et, {
3502
+ return x(It, {
3443
3503
  anchor: { cell: t.cell },
3444
3504
  placement: t.placement,
3445
3505
  whenOff: "hide",
3446
- children: (e) => e.slid ? null : x(Zn, {
3506
+ children: (e) => e.slid ? null : x(oo, {
3447
3507
  state: e,
3448
3508
  size: n,
3449
3509
  color: o,
@@ -3454,15 +3514,15 @@ var qn = (e) => {
3454
3514
  }
3455
3515
  })
3456
3516
  });
3457
- }, Zn = (e) => {
3458
- const { state: t, size: n, color: o, dragging: r, pin: l, onBeginDrag: i } = e, { getPortalContainer: s } = $(), { className: a, attrs: c } = Rt(t.pane);
3517
+ }, oo = (e) => {
3518
+ const { state: t, size: n, color: o, dragging: r, pin: l, onBeginDrag: i } = e, { getPortalContainer: a } = $(), { className: s, attrs: c } = Mt(t.pane);
3459
3519
  let { x: d, y: u } = t.anchorPoint;
3460
3520
  if (l) {
3461
3521
  const e = t.pane?.getElement()?.getBoundingClientRect();
3462
3522
  e && ("v" === l ? u = e.top + e.height / 2 : d = e.left + e.width / 2);
3463
3523
  }
3464
3524
  return Y(x("div", {
3465
- className: ["touch-select-grip", a].filter(Boolean).join(" "),
3525
+ className: ["touch-select-grip", s].filter(Boolean).join(" "),
3466
3526
  ...c,
3467
3527
  style: {
3468
3528
  position: "fixed",
@@ -3485,42 +3545,42 @@ var qn = (e) => {
3485
3545
  onPointerDown: (e) => {
3486
3546
  0 !== e.button && "touch" !== e.pointerType || t.pane && (e.preventDefault(), e.stopPropagation(), i(e));
3487
3547
  }
3488
- }), s());
3489
- }, Jn = (e) => {
3548
+ }), a());
3549
+ }, ro = (e) => {
3490
3550
  const { ranges: t, rangeIndex: n, cell: o } = e;
3491
3551
  if (t && t.length > 0) {
3492
3552
  const e = n ?? -1;
3493
3553
  return t[e >= 0 ? e : t.length - 1];
3494
3554
  }
3495
3555
  return U.cellToRange(o);
3496
- }, Qn = [
3556
+ }, lo = [
3497
3557
  j.Left,
3498
3558
  j.Right,
3499
3559
  j.Up,
3500
3560
  j.Down
3501
- ], eo = {
3561
+ ], io = {
3502
3562
  [j.Left]: "ArrowLeft",
3503
3563
  [j.Right]: "ArrowRight",
3504
3564
  [j.Up]: "ArrowUp",
3505
3565
  [j.Down]: "ArrowDown"
3506
- }, to = {
3566
+ }, ao = {
3507
3567
  [j.Left]: "Left",
3508
3568
  [j.Right]: "Right",
3509
3569
  [j.Up]: "Up",
3510
3570
  [j.Down]: "Down"
3511
3571
  };
3512
- var no = (e, t) => void 0 === t ? e : null === t ? null : {
3572
+ var so = (e, t) => void 0 === t ? e : null === t ? null : {
3513
3573
  ...e,
3514
3574
  ...t
3515
- }, oo = (e, t) => t ? {
3516
- fill: no(e.fill, t.fill),
3517
- border: no(e.border, t.border),
3518
- inner: no(e.inner, t.inner)
3519
- } : e, ro = {
3575
+ }, co = (e, t) => t ? {
3576
+ fill: so(e.fill, t.fill),
3577
+ border: so(e.border, t.border),
3578
+ inner: so(e.inner, t.inner)
3579
+ } : e, uo = {
3520
3580
  side: "b",
3521
3581
  align: "end"
3522
- }, lo = e.forwardRef((t, n) => {
3523
- const { selection: o, getContentBounds: r, getRegionBounds: l, scrollIntoView: i, singleStyle: s, multiStyle: a, multiAnchorStyle: c, singleAnchorStyle: d, removePreviewStyle: u, singleLayer: g, multiLayer: h, enabledMove: f, onMove: p, onMoveStart: m, onMoveUpdate: y, onMoveEnd: S, enableFill: E, snapFillDestination: I, onFill: C, onFillStart: R, onFillPreview: M, onFillEnd: P, resolveFillExtent: k, onEdgeDoubleClick: D, onSelectionEnd: z, renderTip: O, tipPlacement: $, disableKeyboard: L, anchorHole: B = !0, ...A } = t, N = T(o, (e) => e.getSelection()), F = Xn(o, { onSelectionEnd: z }), [V, H] = e.useState(null), _ = qe(), K = e.useRef(o);
3582
+ }, go = e.forwardRef((t, n) => {
3583
+ const { selection: o, getContentBounds: r, getRegionBounds: l, scrollIntoView: i, singleStyle: a, multiStyle: s, multiAnchorStyle: c, singleAnchorStyle: d, removePreviewStyle: u, singleLayer: g, multiLayer: h, enabledMove: f, onMove: p, onMoveStart: m, onMoveUpdate: y, onMoveEnd: S, enableFill: E, snapFillDestination: I, onFill: C, onFillStart: R, onFillPreview: M, onFillEnd: P, resolveFillExtent: k, onEdgeDoubleClick: D, onSelectionEnd: O, renderTip: z, tipPlacement: $, disableKeyboard: L, anchorHole: B = !0, ...A } = t, N = T(o, (e) => e.getSelection()), F = eo(o, { onSelectionEnd: O }), [V, H] = e.useState(null), _ = Ze(), K = e.useRef(o);
3524
3584
  K.current = o;
3525
3585
  const X = e.useRef(_);
3526
3586
  X.current = _;
@@ -3531,9 +3591,9 @@ var no = (e, t) => void 0 === t ? e : null === t ? null : {
3531
3591
  const Z = e.useRef(i);
3532
3592
  Z.current = i;
3533
3593
  const J = e.useMemo(() => function(e) {
3534
- const { getSelection: t, getPane: n, getContentBounds: o, getScrollIntoView: r = () => {}, getRegionBounds: l = () => null } = e, i = () => t(), s = () => n(), a = () => s().getTotalRange(), c = o ?? a, d = (e) => l(e), u = (e) => {
3594
+ const { getSelection: t, getPane: n, getContentBounds: o, getScrollIntoView: r = () => {}, getRegionBounds: l = () => null } = e, i = () => t(), a = () => n(), s = () => a().getTotalRange(), c = o ?? s, d = (e) => l(e), u = (e) => {
3535
3595
  const t = r();
3536
- t ? t(e) : s().scrollCellCoordsIntoView(e);
3596
+ t ? t(e) : a().scrollCellCoordsIntoView(e);
3537
3597
  }, g = () => u(i().getSelection().cell), h = () => {
3538
3598
  const e = i().getSelection();
3539
3599
  return e.ranges && e.ranges.length > 0 && void 0 !== e.rangeIndex && e.rangeIndex >= 0 ? e.ranges[e.rangeIndex] : U.cellToRange(e.cell);
@@ -3541,14 +3601,14 @@ var no = (e, t) => void 0 === t ? e : null === t ? null : {
3541
3601
  if (i().navigate(e, t, n), r()) return;
3542
3602
  const o = i().getSelection(), l = e === j.Left || e === j.Right;
3543
3603
  if (t) {
3544
- const t = a(), n = h(), r = o.cell.colIndex === n.colStart ? n.colEnd : n.colStart, i = o.cell.rowIndex === n.rowStart ? n.rowEnd : n.rowStart;
3604
+ const t = s(), n = h(), r = o.cell.colIndex === n.colStart ? n.colEnd : n.colStart, i = o.cell.rowIndex === n.rowStart ? n.rowEnd : n.rowStart;
3545
3605
  if (e === j.Right && r === t.colEnd || e === j.Left && r === t.colStart || e === j.Up && i === t.rowStart || e === j.Down && i === t.rowEnd) return;
3546
3606
  u(l ? { colIndex: r } : { rowIndex: i });
3547
3607
  return;
3548
3608
  }
3549
3609
  u(l ? { colIndex: o.cell.colIndex } : { rowIndex: o.cell.rowIndex });
3550
3610
  }, p = (e, t) => {
3551
- const n = s(), o = n.getMetrics(), r = a(), l = n.getSurfaceSize(), c = n.getScrollTopLeft(), d = n.getScrollTarget?.() ?? c, u = h(), g = i().getSelection().cell, f = t ? g.rowIndex === u.rowStart ? u.rowEnd : u.rowStart : g.rowIndex, p = t ? g.colIndex === u.colStart ? u.colEnd : u.colStart : g.colIndex;
3611
+ const n = a(), o = n.getMetrics(), r = s(), l = n.getSurfaceSize(), c = n.getScrollTopLeft(), d = n.getScrollTarget?.() ?? c, u = h(), g = i().getSelection().cell, f = t ? g.rowIndex === u.rowStart ? u.rowEnd : u.rowStart : g.rowIndex, p = t ? g.colIndex === u.colStart ? u.colEnd : u.colStart : g.colIndex;
3552
3612
  let m = f, w = p, x = null;
3553
3613
  switch (e) {
3554
3614
  case j.Up: {
@@ -3621,8 +3681,8 @@ var no = (e, t) => void 0 === t ? e : null === t ? null : {
3621
3681
  run: n
3622
3682
  });
3623
3683
  }, S = b.Shift, E = b.Ctrl, I = b.Alt;
3624
- for (const e of Qn) {
3625
- const t = to[e], n = eo[e];
3684
+ for (const e of lo) {
3685
+ const t = ao[e], n = io[e];
3626
3686
  y(`move${t}`, { key: n }, () => f(e, !1)), y(`select${t}`, {
3627
3687
  key: n,
3628
3688
  modifiers: [S]
@@ -3667,28 +3727,28 @@ var no = (e, t) => void 0 === t ? e : null === t ? null : {
3667
3727
  }, () => x(!1)), y("traverseSelectionPreviousRange", {
3668
3728
  key: "ArrowLeft",
3669
3729
  modifiers: [E, I]
3670
- }, () => x(!0)), y("moveToRowStart", { key: "Home" }, () => m({ colIndex: a().colStart }, !1)), y("moveToGridStart", {
3730
+ }, () => x(!0)), y("moveToRowStart", { key: "Home" }, () => m({ colIndex: s().colStart }, !1)), y("moveToGridStart", {
3671
3731
  key: "Home",
3672
3732
  modifiers: [E]
3673
3733
  }, () => m({
3674
- rowIndex: a().rowStart,
3675
- colIndex: a().colStart
3734
+ rowIndex: s().rowStart,
3735
+ colIndex: s().colStart
3676
3736
  }, !1)), y("selectToRowStart", {
3677
3737
  key: "Home",
3678
3738
  modifiers: [S]
3679
- }, () => m({ colIndex: a().colStart }, !0)), y("selectToColumnStart", void 0, () => m({ rowIndex: a().rowStart }, !0)), y("selectToGridStart", {
3739
+ }, () => m({ colIndex: s().colStart }, !0)), y("selectToColumnStart", void 0, () => m({ rowIndex: s().rowStart }, !0)), y("selectToGridStart", {
3680
3740
  key: "Home",
3681
3741
  modifiers: [E, S]
3682
3742
  }, () => m({
3683
- rowIndex: a().rowStart,
3684
- colIndex: a().colStart
3743
+ rowIndex: s().rowStart,
3744
+ colIndex: s().colStart
3685
3745
  }, !0)), y("moveToRowEnd", { key: "End" }, () => m({ colIndex: c().colEnd }, !1)), y("moveToGridEnd", {
3686
3746
  key: "End",
3687
3747
  modifiers: [E]
3688
3748
  }, () => m({
3689
3749
  rowIndex: c().rowEnd,
3690
3750
  colIndex: c().colEnd
3691
- }, !1)), y("selectToColumnEnd", void 0, () => m({ rowIndex: a().rowEnd }, !0)), y("selectToRowEnd", {
3751
+ }, !1)), y("selectToColumnEnd", void 0, () => m({ rowIndex: s().rowEnd }, !0)), y("selectToRowEnd", {
3692
3752
  key: "End",
3693
3753
  modifiers: [S]
3694
3754
  }, () => m({ colIndex: c().colEnd }, !0)), y("selectToGridEnd", {
@@ -3701,13 +3761,13 @@ var no = (e, t) => void 0 === t ? e : null === t ? null : {
3701
3761
  key: "Space",
3702
3762
  modifiers: [E]
3703
3763
  }, () => {
3704
- const e = d(i().getSelection().cell) ?? a();
3764
+ const e = d(i().getSelection().cell) ?? s();
3705
3765
  i().modify({ rowIndex: e.rowStart }, { rowIndex: e.rowEnd }), g();
3706
3766
  }), y("selectRow", {
3707
3767
  key: "Space",
3708
3768
  modifiers: [S]
3709
3769
  }, () => {
3710
- const e = d(i().getSelection().cell) ?? a();
3770
+ const e = d(i().getSelection().cell) ?? s();
3711
3771
  i().modify({ colIndex: e.colStart }, { colIndex: e.colEnd }), g();
3712
3772
  }), y("scrollToActiveCoords", {
3713
3773
  key: "Backspace",
@@ -3747,23 +3807,23 @@ var no = (e, t) => void 0 === t ? e : null === t ? null : {
3747
3807
  getRegionBounds: (e) => q.current?.(e) ?? null
3748
3808
  }), []);
3749
3809
  e.useImperativeHandle(n, () => J, [J]);
3750
- const Q = !!N.ranges && N.ranges.length > 0, ee = Q ? [...N.ranges] : [U.cellToRange(N.cell)], te = ee.length > 1, ne = N.rangeIndex ?? -1, oe = Q ? ne >= 0 ? ne : ee.length - 1 : 0, re = _.getRangeFromCell(N.cell), le = U.unionRanges(ee[oe] ?? U.cellToRange(N.cell), re), ie = ee.filter((e, t) => t !== oe), se = te ? oo(Kn, a) : oo(Un, s), ae = {
3751
- ...jn,
3810
+ const Q = !!N.ranges && N.ranges.length > 0, ee = Q ? [...N.ranges] : [U.cellToRange(N.cell)], te = ee.length > 1, ne = N.rangeIndex ?? -1, oe = Q ? ne >= 0 ? ne : ee.length - 1 : 0, re = _.getRangeFromCell(N.cell), le = U.unionRanges(ee[oe] ?? U.cellToRange(N.cell), re), ie = ee.filter((e, t) => t !== oe), ae = te ? co(Zn, s) : co(qn, a), se = {
3811
+ ...Jn,
3752
3812
  ...c
3753
- }, ce = oo(Gn, u), de = (e) => {
3754
- const t = o.getSelection(), n = t.ranges, r = !!n && n.length > 0, l = r ? void 0 !== t.rangeIndex && t.rangeIndex >= 0 && t.rangeIndex < n.length ? t.rangeIndex : n.length - 1 : 0, i = r ? n.map((t, n) => n === l ? e : t) : [e], s = U.isCellWithinRange(t.cell, e) ? t.cell : {
3813
+ }, ce = co(Qn, u), de = (e) => {
3814
+ const t = o.getSelection(), n = t.ranges, r = !!n && n.length > 0, l = r ? void 0 !== t.rangeIndex && t.rangeIndex >= 0 && t.rangeIndex < n.length ? t.rangeIndex : n.length - 1 : 0, i = r ? n.map((t, n) => n === l ? e : t) : [e], a = U.isCellWithinRange(t.cell, e) ? t.cell : {
3755
3815
  rowIndex: e.rowStart,
3756
3816
  colIndex: e.colStart
3757
3817
  };
3758
3818
  o.setSelection({
3759
- cell: s,
3819
+ cell: a,
3760
3820
  ranges: i,
3761
3821
  rangeIndex: l
3762
3822
  });
3763
3823
  }, ue = V ?? ("extend" === F.dragMode ? {
3764
3824
  kind: "select",
3765
3825
  range: le
3766
- } : null), ge = ue && O ? O(ue) : null, he = e.Children.map(te ? h : g, (t) => {
3826
+ } : null), ge = ue && z ? z(ue) : null, he = e.Children.map(te ? h : g, (t) => {
3767
3827
  if (!e.isValidElement(t)) return t;
3768
3828
  const n = t.props;
3769
3829
  return e.cloneElement(t, {
@@ -3773,7 +3833,7 @@ var no = (e, t) => void 0 === t ? e : null === t ? null : {
3773
3833
  }
3774
3834
  });
3775
3835
  });
3776
- return v(et, {
3836
+ return v(tt, {
3777
3837
  ...A,
3778
3838
  onPointerDown: F.onPointerDown,
3779
3839
  onPointerMove: F.onPointerMove,
@@ -3783,22 +3843,22 @@ var no = (e, t) => void 0 === t ? e : null === t ? null : {
3783
3843
  },
3784
3844
  children: [
3785
3845
  v(w, te ? { children: [
3786
- ie.map((t, n) => x(e.Fragment, { children: io(se, t) }, `other-${n}`)),
3787
- io(se, le, B ? re : void 0),
3788
- x(Wt, {
3846
+ ie.map((t, n) => x(e.Fragment, { children: ho(ae, t) }, `other-${n}`)),
3847
+ ho(ae, le, B ? re : void 0),
3848
+ x(Yt, {
3789
3849
  range: re,
3790
- ...ae
3850
+ ...se
3791
3851
  })
3792
- ] } : { children: [io(se, le, B ? re : void 0), d && x(Wt, {
3852
+ ] } : { children: [ho(ae, le, B ? re : void 0), d && x(Yt, {
3793
3853
  range: re,
3794
3854
  ...d
3795
3855
  })] }),
3796
- !te && f && x(ln, {
3856
+ !te && f && x(gn, {
3797
3857
  range: le,
3798
3858
  grip: "edges",
3799
- renderMove: (e) => se.border && x(Wt, {
3859
+ renderMove: (e) => ae.border && x(Yt, {
3800
3860
  range: e,
3801
- ...se.border,
3861
+ ...ae.border,
3802
3862
  animatedTransition: !0,
3803
3863
  style: { opacity: .6 }
3804
3864
  }),
@@ -3830,10 +3890,10 @@ var no = (e, t) => void 0 === t ? e : null === t ? null : {
3830
3890
  });
3831
3891
  }
3832
3892
  }),
3833
- !te && E && x(gn, {
3893
+ !te && E && x(xn, {
3834
3894
  range: le,
3835
3895
  snapDestination: I,
3836
- ...se.border,
3896
+ ...ae.border,
3837
3897
  onDragStart: (e, t) => {
3838
3898
  R?.(e, t), H({
3839
3899
  kind: "fill",
@@ -3859,11 +3919,11 @@ var no = (e, t) => void 0 === t ? e : null === t ? null : {
3859
3919
  n && !U.isEqualRanges(n, e) && (C?.(e, n, t), de(n));
3860
3920
  } : void 0
3861
3921
  }),
3862
- F.removePreview && io(ce, F.removePreview),
3922
+ F.removePreview && ho(ce, F.removePreview),
3863
3923
  he,
3864
- null != ge && ue && x(kt, {
3924
+ null != ge && ue && x(Dt, {
3865
3925
  anchor: { range: (fe = ue, "move" === fe.kind ? fe.to : "fill" === fe.kind ? fe.destination : fe.range) },
3866
- placement: $ ?? ro,
3926
+ placement: $ ?? uo,
3867
3927
  offset: 8,
3868
3928
  whenOff: "clamp",
3869
3929
  open: !0,
@@ -3874,28 +3934,28 @@ var no = (e, t) => void 0 === t ? e : null === t ? null : {
3874
3934
  });
3875
3935
  var fe;
3876
3936
  });
3877
- lo.displayName = "SelectionLayer";
3878
- var io = (e, t, n, o = !1) => v(w, { children: [
3879
- e.fill && x(Wt, {
3937
+ go.displayName = "SelectionLayer";
3938
+ var ho = (e, t, n, o = !1) => v(w, { children: [
3939
+ e.fill && x(Yt, {
3880
3940
  className: "fill",
3881
3941
  animatedTransition: o,
3882
3942
  range: t,
3883
3943
  hole: n,
3884
3944
  ...e.fill
3885
3945
  }),
3886
- e.inner && x(Wt, {
3946
+ e.inner && x(Yt, {
3887
3947
  className: "inner",
3888
3948
  animatedTransition: o,
3889
3949
  range: t,
3890
3950
  ...e.inner
3891
3951
  }),
3892
- e.border && x(Wt, {
3952
+ e.border && x(Yt, {
3893
3953
  className: "border",
3894
3954
  animatedTransition: o,
3895
3955
  range: t,
3896
3956
  ...e.border
3897
3957
  })
3898
- ] }), so = [
3958
+ ] }), fo = [
3899
3959
  "#1a73e8",
3900
3960
  "#d93025",
3901
3961
  "#1e8e3e",
@@ -3903,19 +3963,19 @@ var io = (e, t, n, o = !1) => v(w, { children: [
3903
3963
  "#e37400",
3904
3964
  "#12a4af",
3905
3965
  "#d01884"
3906
- ], ao = Array.from({ length: E }, (e, t) => `var(--sxl-color-series-${t + 1}, ${so[t]})`), co = "var(--sxl-color-primary, rgb(0, 120, 215))", uo = (e, t, n) => ({
3966
+ ], po = Array.from({ length: E }, (e, t) => `var(--sxl-color-series-${t + 1}, ${fo[t]})`), mo = "var(--sxl-color-primary, rgb(0, 120, 215))", wo = (e, t, n) => ({
3907
3967
  rowStart: Math.max(n.rowStart, Math.min(e.rowIndex, t.rowIndex)),
3908
3968
  colStart: Math.max(n.colStart, Math.min(e.colIndex, t.colIndex)),
3909
3969
  rowEnd: Math.min(n.rowEnd, Math.max(e.rowIndex, t.rowIndex)),
3910
3970
  colEnd: Math.min(n.colEnd, Math.max(e.colIndex, t.colIndex))
3911
- }), go = (e) => ({ stroke: ao.length ? ao[e % ao.length] : co }), ho = (e) => {
3912
- const { selection: t, getRangeStyle: n = go, anchors: o = an, enabledMove: r, disableDraw: l, allowMulti: i = !0, size: s, animated: a, renderHandle: d, preserveFocus: u = !0, onDragActiveChange: g, rangeStyle: h = W.EmptyObject, className: m, ...w } = e, y = qe(), b = T(t, (e) => e.getSelection()), S = b.ranges ?? U.EmptyRanges, E = Math.min(Math.max(0, b.rangeIndex ?? S.length - 1), Math.max(0, S.length - 1)), [I, C] = p(null), [R, M] = p(null), [P, k] = p(!1), D = null !== R || P, z = f(g);
3913
- z.current = g, c(() => {
3914
- z.current?.(D, R);
3971
+ }), xo = (e) => ({ stroke: po.length ? po[e % po.length] : mo }), vo = (e) => {
3972
+ const { selection: t, getRangeStyle: n = xo, anchors: o = fn, enabledMove: r, disableDraw: l, allowMulti: i = !0, size: a, animated: s, renderHandle: d, preserveFocus: u = !0, onDragActiveChange: g, rangeStyle: h = W.EmptyObject, className: m, ...w } = e, y = Ze(), b = T(t, (e) => e.getSelection()), S = b.ranges ?? U.EmptyRanges, E = Math.min(Math.max(0, b.rangeIndex ?? S.length - 1), Math.max(0, S.length - 1)), [I, C] = p(null), [R, M] = p(null), [P, k] = p(!1), D = null !== R || P, O = f(g);
3973
+ O.current = g, c(() => {
3974
+ O.current?.(D, R);
3915
3975
  }, [D, R]), c(() => () => {
3916
- z.current?.(!1, null);
3976
+ O.current?.(!1, null);
3917
3977
  }, []);
3918
- const O = R ?? I, $ = (e, t) => C((n) => t ? e : n === e ? null : n), L = (e, n) => {
3978
+ const z = R ?? I, $ = (e, t) => C((n) => t ? e : n === e ? null : n), L = (e, n) => {
3919
3979
  const o = t.getSelection(), r = o.ranges ?? U.EmptyRanges, l = e < r.length ? r.map((t, o) => o === e ? {
3920
3980
  ...t,
3921
3981
  ...n
@@ -3935,7 +3995,7 @@ var io = (e, t, n, o = !1) => v(w, { children: [
3935
3995
  ...n,
3936
3996
  rangeIndex: e
3937
3997
  });
3938
- }, A = Zt((e, t) => {
3998
+ }, A = on((e, t) => {
3939
3999
  if (0 !== t.button) return null;
3940
4000
  const n = (b.rangeIndex ?? -1) >= 0 ? b.rangeIndex : -1;
3941
4001
  if (t.shiftKey && n >= 0 && S[n]) {
@@ -3943,24 +4003,24 @@ var io = (e, t, n, o = !1) => v(w, { children: [
3943
4003
  rowIndex: S[n].rowStart,
3944
4004
  colIndex: S[n].colStart
3945
4005
  };
3946
- return k(!0), L(n, uo(t, e, y.getTotalRange())), {
3947
- drag: (e) => L(n, uo(t, e, y.getTotalRange())),
4006
+ return k(!0), L(n, wo(t, e, y.getTotalRange())), {
4007
+ drag: (e) => L(n, wo(t, e, y.getTotalRange())),
3948
4008
  end: () => k(!1),
3949
4009
  captureEvents: !1
3950
4010
  };
3951
4011
  }
3952
4012
  const o = (!t.ctrlKey && !t.metaKey || !i) && n >= 0 ? n : S.length;
3953
4013
  return k(!0), L(o, U.cellToRange(e)), {
3954
- drag: (t) => L(o, uo(e, t, y.getTotalRange())),
4014
+ drag: (t) => L(o, wo(e, t, y.getTotalRange())),
3955
4015
  end: () => k(!1),
3956
4016
  captureEvents: !1
3957
4017
  };
3958
4018
  }), N = S.map((e, t) => n(t, t === E)), F = [];
3959
4019
  for (let e = 0; e < N.length; e++) N[e] && F.push(e);
3960
- return v(et, {
4020
+ return v(tt, {
3961
4021
  ...w,
3962
4022
  children: [
3963
- (!l || P) && x(lt, {
4023
+ (!l || P) && x(it, {
3964
4024
  fill: !0,
3965
4025
  className: V(m, "ranges-picker-draw"),
3966
4026
  onPointerDown: (e) => {
@@ -3971,7 +4031,7 @@ var io = (e, t, n, o = !1) => v(w, { children: [
3971
4031
  e.stopPropagation(), A.onPointerUp(e);
3972
4032
  }
3973
4033
  }),
3974
- r && F.map((e) => x(ln, {
4034
+ r && F.map((e) => x(gn, {
3975
4035
  range: S[e],
3976
4036
  grip: "edges",
3977
4037
  preserveFocus: u,
@@ -3983,21 +4043,21 @@ var io = (e, t, n, o = !1) => v(w, { children: [
3983
4043
  onDragEnd: (t) => L(e, t)
3984
4044
  }, `move-${e}`)),
3985
4045
  F.map((e) => {
3986
- const t = e === E, n = e === O, r = ((e, t, n) => {
3987
- const o = e.stroke ?? h.stroke ?? co;
4046
+ const t = e === E, n = e === z, r = ((e, t, n) => {
4047
+ const o = e.stroke ?? h.stroke ?? mo;
3988
4048
  return {
3989
4049
  ...h,
3990
4050
  ...e,
3991
4051
  stroke: o,
3992
4052
  fill: e.fill ?? h.fill ?? `color-mix(in srgb, ${o} 12%, transparent)`,
3993
4053
  alignWidth: n ? 3 : e.alignWidth ?? h.alignWidth ?? 2,
3994
- ...a && t ? { animatedStroke: !0 } : void 0
4054
+ ...s && t ? { animatedStroke: !0 } : void 0
3995
4055
  };
3996
4056
  })(N[e], t, n);
3997
- return x(dn, {
4057
+ return x(mn, {
3998
4058
  range: S[e],
3999
4059
  anchors: o,
4000
- size: s,
4060
+ size: a,
4001
4061
  ...r,
4002
4062
  renderHandle: d,
4003
4063
  preserveFocus: u,
@@ -4014,8 +4074,8 @@ var io = (e, t, n, o = !1) => v(w, { children: [
4014
4074
  ]
4015
4075
  });
4016
4076
  };
4017
- ho.displayName = "RangesPickerLayer";
4018
- var fo = 0, po = class {
4077
+ vo.displayName = "RangesPickerLayer";
4078
+ var yo = 0, bo = class {
4019
4079
  constructor(e, t = {}) {
4020
4080
  this.listeners = /* @__PURE__ */ new Set(), this.commitListeners = /* @__PURE__ */ new Set(), this.cancelListeners = /* @__PURE__ */ new Set(), this.editors = /* @__PURE__ */ new Set(), this.activeEditor = null, this.activeEditorId = null, this.auxState = null, this.commitFn = e.commit, this.state = {
4021
4081
  mode: t.mode ?? "enter",
@@ -4024,7 +4084,7 @@ var fo = 0, po = class {
4024
4084
  dirty: t.dirty,
4025
4085
  initialSelection: t.initialSelection ?? null,
4026
4086
  autoFocus: t.autoFocus ?? !0,
4027
- token: ++fo
4087
+ token: ++yo
4028
4088
  };
4029
4089
  }
4030
4090
  getState() {
@@ -4129,7 +4189,7 @@ var fo = 0, po = class {
4129
4189
  notify() {
4130
4190
  this.listeners.forEach((e) => e());
4131
4191
  }
4132
- }, mo = (e) => e.ctrlKey || e.metaKey || e.altKey || e.isComposing ? null : "Process" === e.key || 229 === e.keyCode ? {
4192
+ }, So = (e) => e.ctrlKey || e.metaKey || e.altKey || e.isComposing ? null : "Process" === e.key || 229 === e.keyCode ? {
4133
4193
  mode: "enter",
4134
4194
  dirty: ""
4135
4195
  } : 1 === e.key.length ? " " === e.key && e.shiftKey ? null : {
@@ -4138,17 +4198,17 @@ var fo = 0, po = class {
4138
4198
  } : e.shiftKey ? null : "F2" === e.key ? { mode: "edit" } : "Backspace" === e.key ? {
4139
4199
  mode: "enter",
4140
4200
  dirty: ""
4141
- } : null, wo = (e, t) => {
4201
+ } : null, Eo = (e, t) => {
4142
4202
  const n = f(null);
4143
4203
  return u(() => {
4144
4204
  const t = n.current;
4145
4205
  null !== t && (n.current = null, e.current?.setSelectionRange(t, t));
4146
- }, [t]), z((e) => {
4206
+ }, [t]), O((e) => {
4147
4207
  n.current = e;
4148
4208
  }, []);
4149
- }, xo = (e) => {
4150
- const { mode: t, value: n, onDirtyChange: o, onModeChange: r, onCommit: l, onCancel: i, onNavigate: s, onTraverse: a, setCaret: c } = e;
4151
- return z((e) => {
4209
+ }, Io = (e) => {
4210
+ const { mode: t, value: n, onDirtyChange: o, onModeChange: r, onCommit: l, onCancel: i, onNavigate: a, onTraverse: s, setCaret: c } = e;
4211
+ return O((e) => {
4152
4212
  const d = e.nativeEvent;
4153
4213
  if (d.isComposing) return void e.stopPropagation();
4154
4214
  if (e.which === y.Escape) return e.preventDefault(), e.stopPropagation(), void i();
@@ -4167,7 +4227,7 @@ var fo = 0, po = class {
4167
4227
  if (!l(t ? { broadcast: !0 } : void 0)) return void e.stopPropagation();
4168
4228
  if (t) return void e.stopPropagation();
4169
4229
  const n = e.which === y.Enter || e.which === y.Tab;
4170
- n && a ? (e.stopPropagation(), a(e.which === y.Tab ? G.Row : G.Column, e.shiftKey)) : !n && s && (e.stopPropagation(), s(((e) => {
4230
+ n && s ? (e.stopPropagation(), s(e.which === y.Tab ? G.Row : G.Column, e.shiftKey)) : !n && a && (e.stopPropagation(), a(((e) => {
4171
4231
  switch (e.which) {
4172
4232
  case y.Enter: return e.shiftKey ? j.Up : j.Down;
4173
4233
  case y.Tab: return e.shiftKey ? j.Left : j.Right;
@@ -4188,11 +4248,11 @@ var fo = 0, po = class {
4188
4248
  i,
4189
4249
  r,
4190
4250
  o,
4191
- s,
4192
4251
  a,
4252
+ s,
4193
4253
  c
4194
4254
  ]);
4195
- }, vo = class {
4255
+ }, Co = class {
4196
4256
  constructor(e, t, n) {
4197
4257
  this.current = null, this.listeners = /* @__PURE__ */ new Set(), this.anchor = e, this.createEdit = t, this.revertAnchor = n?.revertAnchor, this.unsubscribeAnchor = e.subscribe(() => this.onAnchorChange());
4198
4258
  }
@@ -4214,7 +4274,7 @@ var fo = 0, po = class {
4214
4274
  }
4215
4275
  startEdit(e, t = {}) {
4216
4276
  const n = this.createEdit(e);
4217
- return !!n && (this.current = new po({
4277
+ return !!n && (this.current = new bo({
4218
4278
  coords: e,
4219
4279
  ...n
4220
4280
  }, t), this.notify(), !0);
@@ -4233,16 +4293,16 @@ var fo = 0, po = class {
4233
4293
  notify() {
4234
4294
  this.listeners.forEach((e) => e());
4235
4295
  }
4236
- }, yo = (e, t, n, o = "left", r = 0) => {
4296
+ }, Ro = (e, t, n, o = "left", r = 0) => {
4237
4297
  if (!t) return null;
4238
4298
  const l = e.getRangeFromCell(t), i = e.getBoundsFromRange(l);
4239
4299
  if (!i) return null;
4240
- const s = null !== e.toClipBounds(e.getBoundsFromRange(l)), a = e.getZoom(), c = n?.width ? n.width * a : void 0, d = n?.height ? n.height * a : void 0;
4300
+ const a = null !== e.toClipBounds(e.getBoundsFromRange(l)), s = e.getZoom(), c = n?.width ? n.width * s : void 0, d = n?.height ? n.height * s : void 0;
4241
4301
  let u = { ...i };
4242
4302
  if (void 0 !== c) {
4243
4303
  const t = e.getPaneRange(), n = e.getMetrics(), r = { ...l };
4244
- let i = !1, s = 0;
4245
- for (; !i && u.width <= c && s < 20;) s++, "left" === o ? r.colEnd + 1 < t.colEnd ? r.colEnd = n.getColIndex(u.x + c) : i = !0 : "right" === o ? r.colStart - 1 >= 0 ? r.colStart = n.getColIndex(u.x - (c - u.width)) : i = !0 : r.colEnd + 1 < t.colEnd && r.colStart - 1 >= 0 ? (r.colStart = n.getColIndex(u.x - (c - u.width) / 2), r.colEnd = n.getColIndex(u.x + u.width + (c - u.width) / 2)) : i = !0, i || (u = e.getBoundsFromRange(r));
4304
+ let i = !1, a = 0;
4305
+ for (; !i && u.width <= c && a < 20;) a++, "left" === o ? r.colEnd + 1 < t.colEnd ? r.colEnd = n.getColIndex(u.x + c) : i = !0 : "right" === o ? r.colStart - 1 >= 0 ? r.colStart = n.getColIndex(u.x - (c - u.width)) : i = !0 : r.colEnd + 1 < t.colEnd && r.colStart - 1 >= 0 ? (r.colStart = n.getColIndex(u.x - (c - u.width) / 2), r.colEnd = n.getColIndex(u.x + u.width + (c - u.width) / 2)) : i = !0, i || (u = e.getBoundsFromRange(r));
4246
4306
  }
4247
4307
  u.height = i.height, void 0 !== d && (u.height = Math.max(d + 1, i.height));
4248
4308
  const g = e.getSurfaceSize(), h = Math.max(i.width, g.width - u.x - r);
@@ -4253,17 +4313,17 @@ var fo = 0, po = class {
4253
4313
  width: Math.min(h, u.width),
4254
4314
  height: Math.min(g.height - u.y, u.height)
4255
4315
  },
4256
- inView: s
4316
+ inView: a
4257
4317
  };
4258
- }, bo = 96 / 72 * 11, So = "Calibri, sans-serif", Eo = (e) => {
4259
- const { open: t, mode: n, clean: o, dirty: r, token: l, autoFocus: i, initialSelection: s, zoom: a, readOnly: c, onDirtyChange: d, onModeChange: g, onCommit: h, onCancel: p, onNaturalSize: m } = e, y = r ?? o ?? "", b = f(null), S = f(null), E = f(0);
4318
+ }, Mo = 96 / 72 * 11, Po = "Calibri, sans-serif", ko = (e) => {
4319
+ const { open: t, mode: n, clean: o, dirty: r, token: l, autoFocus: i, initialSelection: a, zoom: s, readOnly: c, onDirtyChange: d, onModeChange: g, onCommit: h, onCancel: p, onNaturalSize: m } = e, y = r ?? o ?? "", b = f(null), S = f(null), E = f(0);
4260
4320
  u(() => {
4261
4321
  if (!t || !i) return;
4262
4322
  const e = b.current;
4263
4323
  if (!e) return;
4264
4324
  if (e.focus(), E.current === l) return;
4265
4325
  E.current = l;
4266
- const n = e.value.length, o = s ?? {
4326
+ const n = e.value.length, o = a ?? {
4267
4327
  start: n,
4268
4328
  end: n,
4269
4329
  direction: "forward"
@@ -4280,14 +4340,14 @@ var fo = 0, po = class {
4280
4340
  height: e.offsetHeight
4281
4341
  });
4282
4342
  }, [y, m]);
4283
- const I = xo({
4343
+ const I = Io({
4284
4344
  mode: n,
4285
4345
  value: y,
4286
4346
  onDirtyChange: d,
4287
4347
  onModeChange: g,
4288
4348
  onCommit: h,
4289
4349
  onCancel: p,
4290
- setCaret: wo(b, y)
4350
+ setCaret: Eo(b, y)
4291
4351
  });
4292
4352
  return v(w, { children: [x("textarea", {
4293
4353
  ref: b,
@@ -4307,8 +4367,8 @@ var fo = 0, po = class {
4307
4367
  resize: "none",
4308
4368
  overflow: "hidden",
4309
4369
  background: "transparent",
4310
- fontFamily: So,
4311
- fontSize: bo * a + "px",
4370
+ fontFamily: Po,
4371
+ fontSize: Mo * s + "px",
4312
4372
  lineHeight: 1.2,
4313
4373
  whiteSpace: "pre",
4314
4374
  userSelect: "text"
@@ -4328,30 +4388,30 @@ var fo = 0, po = class {
4328
4388
  visibility: "hidden",
4329
4389
  pointerEvents: "none",
4330
4390
  whiteSpace: "pre",
4331
- fontFamily: So,
4332
- fontSize: `${bo}px`,
4391
+ fontFamily: Po,
4392
+ fontSize: `${Mo}px`,
4333
4393
  lineHeight: 1.2
4334
4394
  },
4335
4395
  children: 0 === y.length ? " " : y
4336
4396
  })] });
4337
4397
  };
4338
- function Io(e) {
4339
- const { editable: t, renderEditor: n, alignment: o = "left", background: r = "var(--sxl-color-base-100, rgb(255, 255, 255))", borderColor: l = "var(--sxl-color-primary, rgb(33, 115, 70))", borderWidth: i = 2, zIndex: s, className: a, style: d, ...u } = e, g = Ze(), h = T(t, (e) => e.getSession()), f = B(h, (e) => e.getState()), [m, w] = p(null), v = z((e) => {
4398
+ function Do(e) {
4399
+ const { editable: t, renderEditor: n, alignment: o = "left", background: r = "var(--sxl-color-base-100, rgb(255, 255, 255))", borderColor: l = "var(--sxl-color-primary, rgb(33, 115, 70))", borderWidth: i = 2, zIndex: a, className: s, style: d, ...u } = e, g = Je(), h = T(t, (e) => e.getSession()), f = B(h, (e) => e.getState()), [m, w] = p(null), v = O((e) => {
4340
4400
  w((t) => t && t.width === e.width && t.height === e.height ? t : e);
4341
- }, []), y = z((e) => {
4401
+ }, []), y = O((e) => {
4342
4402
  if (t.getSession()) return;
4343
4403
  const n = t.getAnchor().getCoords();
4344
4404
  if (!n) return;
4345
- const o = mo(e.nativeEvent);
4405
+ const o = So(e.nativeEvent);
4346
4406
  o && ("Process" !== e.nativeEvent.key && 229 !== e.nativeEvent.keyCode && e.preventDefault(), e.stopPropagation(), t.startEdit(n, o));
4347
- }, [t]), b = z((e) => {
4407
+ }, [t]), b = O((e) => {
4348
4408
  if (t.getSession()) return;
4349
4409
  const n = g?.getCellFromPointer(e.clientX, e.clientY) ?? t.getAnchor().getCoords();
4350
4410
  n && t.startEdit(n, { mode: "edit" });
4351
- }, [g, t]), S = z((e) => {
4411
+ }, [g, t]), S = O((e) => {
4352
4412
  const n = t.commit(e);
4353
4413
  return n && g?.focus(), n;
4354
- }, [t, g]), E = z(() => {
4414
+ }, [t, g]), E = O(() => {
4355
4415
  t.cancel(), g?.focus();
4356
4416
  }, [t, g]);
4357
4417
  c(() => {
@@ -4367,7 +4427,7 @@ function Io(e) {
4367
4427
  rowEnd: e.rowStart,
4368
4428
  colEnd: e.colStart
4369
4429
  })), f) {
4370
- const e = yo(g, I, m, o, i);
4430
+ const e = Ro(g, I, m, o, i);
4371
4431
  C = e?.bounds ?? null, R = e?.inView ?? !1;
4372
4432
  } else C = g.getBoundsFromRange(e);
4373
4433
  }
@@ -4395,13 +4455,13 @@ function Io(e) {
4395
4455
  onCommit: S,
4396
4456
  onCancel: E,
4397
4457
  onNaturalSize: v
4398
- }, O = "function" == typeof r ? (I ? r(I) : void 0) ?? "transparent" : r;
4399
- return x(et, {
4458
+ }, z = "function" == typeof r ? (I ? r(I) : void 0) ?? "transparent" : r;
4459
+ return x(tt, {
4400
4460
  onKeyDown: y,
4401
4461
  onDoubleClick: b,
4402
- children: C ? x(lt, {
4462
+ children: C ? x(it, {
4403
4463
  ...u,
4404
- className: V(a, "editor"),
4464
+ className: V(s, "editor"),
4405
4465
  bounds: C,
4406
4466
  alignWidth: i,
4407
4467
  keepMounted: !0,
@@ -4409,18 +4469,18 @@ function Io(e) {
4409
4469
  ...d,
4410
4470
  display: "flex",
4411
4471
  overflow: "hidden",
4412
- background: O,
4472
+ background: z,
4413
4473
  borderColor: l,
4414
4474
  boxShadow: k ? "rgba(60,64,67,.35) 2px 2px 6px 3px" : "none",
4415
4475
  opacity: k ? 1 : 0,
4416
4476
  pointerEvents: k ? "auto" : "none"
4417
4477
  },
4418
- children: n ? n(D) : x(Eo, { ...D })
4478
+ children: n ? n(D) : x(ko, { ...D })
4419
4479
  }) : null
4420
4480
  });
4421
4481
  }
4422
- function Co(e) {
4423
- const { editable: t, renderEditor: n, idleClean: o = null, mapClean: r, editorId: l, readOnly: i, className: s, style: a } = e, c = T(t, (e) => e.getSession()), d = B(c, (e) => e.getState()), u = d?.clean ?? o, g = r ? r(u) : u, h = z((e) => t.commit(e), [t]), f = z(() => t.cancel(), [t]), p = z(() => {
4482
+ function To(e) {
4483
+ const { editable: t, renderEditor: n, idleClean: o = null, mapClean: r, editorId: l, readOnly: i, className: a, style: s } = e, c = T(t, (e) => e.getSession()), d = B(c, (e) => e.getState()), u = d?.clean ?? o, g = r ? r(u) : u, h = O((e) => t.commit(e), [t]), f = O(() => t.cancel(), [t]), p = O(() => {
4424
4484
  i || (t.getSession() || t.startEdit(t.getAnchor().getCoords(), {
4425
4485
  mode: "edit",
4426
4486
  autoFocus: !1
@@ -4446,20 +4506,20 @@ function Co(e) {
4446
4506
  onCancel: f
4447
4507
  };
4448
4508
  return x("div", {
4449
- className: s,
4450
- style: a,
4509
+ className: a,
4510
+ style: s,
4451
4511
  onFocus: p,
4452
- children: n ? n(m) : x(Eo, { ...m })
4512
+ children: n ? n(m) : x(ko, { ...m })
4453
4513
  });
4454
4514
  }
4455
- Eo.displayName = "DefaultEditorInput", Co.displayName = "EditorDiv";
4456
- var Ro = "ew-resize", Mo = "ns-resize", Po = i(r((e, t) => {
4457
- const { axis: n, index: o, className: r, style: l, disabled: i = !1, disabledResize: s = !1, isNextHidden: a, isHidden: c, isSelected: d, isSelectedAll: u, showTouchDivider: g, bounds: h, onPointerDown: f, onAutoFit: p, ...m } = e, w = qe(), y = n === G.Column, b = 1 / S.getDevicePixelRatio(), E = d || u, I = E ? "color-mix(in srgb, var(--sxl-color-primary, rgb(33, 115, 70)) 35%, var(--sxl-color-base-300, rgb(171, 171, 171)))" : "var(--sxl-color-base-300, rgb(171, 171, 171))", C = "var(--sxl-color-base-100, #f5f5f5)", R = "touch" === S.detectIt().primaryInput;
4515
+ ko.displayName = "DefaultEditorInput", To.displayName = "EditorDiv";
4516
+ var Oo = "ew-resize", zo = "ns-resize", $o = i(r((e, t) => {
4517
+ const { axis: n, index: o, className: r, style: l, disabled: i = !1, disabledResize: a = !1, isNextHidden: s, isHidden: c, isSelected: d, isSelectedAll: u, showTouchDivider: g, bounds: h, onPointerDown: f, onAutoFit: p, ...m } = e, w = Ze(), y = n === G.Column, b = 1 / S.getDevicePixelRatio(), E = d || u, I = E ? "color-mix(in srgb, var(--sxl-color-primary, rgb(33, 115, 70)) 35%, var(--sxl-color-base-300, rgb(171, 171, 171)))" : "var(--sxl-color-base-300, rgb(171, 171, 171))", C = "var(--sxl-color-base-100, #f5f5f5)", R = "touch" === S.detectIt().primaryInput;
4458
4518
  let M = y ? 14 : 8;
4459
4519
  const P = w.getZoom();
4460
4520
  P < 1 && (M = Math.max(2, M * P * .8));
4461
4521
  let k = M / 2, D = 0;
4462
- a && (D = -2), c && (D = 2), c && (M = M / 2 + D, k = 2 * D);
4522
+ s && (D = -2), c && (D = 2), c && (M = M / 2 + D, k = 2 * D);
4463
4523
  let T = I;
4464
4524
  return E || 0 !== D || (T = `linear-gradient(${y ? 180 : 90}deg, ${C}, ${I} 55%, ${I} 100%)`), v("div", {
4465
4525
  className: V("header-divider", { disabled: i }, r, `index-${o}`),
@@ -4474,7 +4534,7 @@ var Ro = "ew-resize", Mo = "ns-resize", Po = i(r((e, t) => {
4474
4534
  position: "absolute",
4475
4535
  overflow: "visible",
4476
4536
  pointerEvents: "auto",
4477
- cursor: i || s || R ? void 0 : y ? Ro : Mo,
4537
+ cursor: i || a || R ? void 0 : y ? Oo : zo,
4478
4538
  ...l
4479
4539
  },
4480
4540
  ...m,
@@ -4518,8 +4578,8 @@ var Ro = "ew-resize", Mo = "ns-resize", Po = i(r((e, t) => {
4518
4578
  } })
4519
4579
  }) : null]
4520
4580
  });
4521
- })), ko = (e) => x(Po, { ...e }), Do = i(r((e, t) => {
4522
- const { axis: n, index: o, disabled: r = !1, disabledResize: l = !1, resizeThreshold: i = 1, renderDivider: s = ko, onDividerMouseDown: a, onDividerResizeStart: c, onDividerResize: d, onDividerResizeEnd: u, onDividerMouseUp: g, onDividerAutoFit: h, onPointerDown: m, ...y } = e, b = qe(), E = z(m, [m]), I = z(h, [h]), C = n === G.Column;
4581
+ })), Lo = (e) => x($o, { ...e }), Bo = i(r((e, t) => {
4582
+ const { axis: n, index: o, disabled: r = !1, disabledResize: l = !1, resizeThreshold: i = 1, renderDivider: a = Lo, onDividerMouseDown: s, onDividerResizeStart: c, onDividerResize: d, onDividerResizeEnd: u, onDividerMouseUp: g, onDividerAutoFit: h, onPointerDown: m, ...y } = e, b = Ze(), E = O(m, [m]), I = O(h, [h]), C = n === G.Column;
4523
4583
  let R = C ? b.getVisibleColumns() : b.getVisibleRows(), M = null;
4524
4584
  R.length > 0 && (M = C ? b.getBoundsFromRange({
4525
4585
  rowStart: 0,
@@ -4532,23 +4592,23 @@ var Ro = "ew-resize", Mo = "ns-resize", Po = i(r((e, t) => {
4532
4592
  colStart: 0,
4533
4593
  colEnd: 0
4534
4594
  }), M = b.toClipBounds(M, -10));
4535
- const P = f(null), [k, D] = p(null), T = (e, t) => C ? e.clientX - t.clientX : e.clientY - t.clientY, O = b.getMetrics(), L = C ? O.getColOffset(o + 1) : O.getRowOffset(o + 1), B = S.getDevicePixelRatio(), N = 1 / B, F = S.snapLineCenter(L, N, B) - N / 2, H = A({
4595
+ const P = f(null), [k, D] = p(null), T = (e, t) => C ? e.clientX - t.clientX : e.clientY - t.clientY, z = b.getMetrics(), L = C ? z.getColOffset(o + 1) : z.getRowOffset(o + 1), B = S.getDevicePixelRatio(), N = 1 / B, F = S.snapLineCenter(L, N, B) - N / 2, H = A({
4536
4596
  processTouch: !0,
4537
4597
  onPointerDown: (e) => {
4538
4598
  if (E?.(e), !r && !l) {
4539
- const e = C ? O.getColOffset(o) : O.getRowOffset(o), t = L - e;
4599
+ const e = C ? z.getColOffset(o) : z.getRowOffset(o), t = L - e;
4540
4600
  P.current = {
4541
4601
  isResizing: !1,
4542
4602
  startSize: t,
4543
4603
  index: o,
4544
4604
  pane: b,
4545
4605
  axis: n,
4546
- onDividerMouseDown: a,
4606
+ onDividerMouseDown: s,
4547
4607
  onDividerResizeStart: c,
4548
4608
  onDividerResize: d,
4549
4609
  onDividerResizeEnd: u,
4550
4610
  onDividerMouseUp: g
4551
- }, D(P.current), a?.(o, t);
4611
+ }, D(P.current), s?.(o, t);
4552
4612
  }
4553
4613
  e.stopPropagation(), e.preventDefault();
4554
4614
  },
@@ -4566,11 +4626,11 @@ var Ro = "ew-resize", Mo = "ns-resize", Po = i(r((e, t) => {
4566
4626
  isResizing: !0
4567
4627
  }, D(P.current), P.current.onDividerResizeStart?.(P.current.index, Math.max(0, P.current.startSize + o))), e.stopPropagation(), e.preventDefault();
4568
4628
  }
4569
- }), _ = z(() => {
4629
+ }), _ = O(() => {
4570
4630
  I?.(o);
4571
4631
  }, [o]), { getPortalContainer: W } = $();
4572
4632
  if (!M) return;
4573
- const U = s({
4633
+ const U = a({
4574
4634
  bounds: M,
4575
4635
  axis: n,
4576
4636
  index: o,
@@ -4585,7 +4645,7 @@ var Ro = "ew-resize", Mo = "ns-resize", Po = i(r((e, t) => {
4585
4645
  let K = null;
4586
4646
  return k && k.isResizing && k.index === o && (K = Y(x("div", { style: {
4587
4647
  position: "absolute",
4588
- cursor: C ? Ro : Mo,
4648
+ cursor: C ? Oo : zo,
4589
4649
  left: 0,
4590
4650
  top: 0,
4591
4651
  width: "100%",
@@ -4605,26 +4665,26 @@ var Ro = "ew-resize", Mo = "ns-resize", Po = i(r((e, t) => {
4605
4665
  children: U
4606
4666
  })] });
4607
4667
  }));
4608
- Do.displayName = "HeaderDividerAnchor";
4609
- var To = (e, t, n) => t === G.Column ? {
4668
+ Bo.displayName = "HeaderDividerAnchor";
4669
+ var Ao = (e, t, n) => t === G.Column ? {
4610
4670
  rowIndex: n.rowStart,
4611
4671
  colIndex: e.colIndex
4612
4672
  } : {
4613
4673
  rowIndex: e.rowIndex,
4614
4674
  colIndex: n.colStart
4615
- }, zo = (e, t, n) => t === G.Column ? {
4675
+ }, No = (e, t, n) => t === G.Column ? {
4616
4676
  rowIndex: n.rowEnd,
4617
4677
  colIndex: e.colIndex
4618
4678
  } : {
4619
4679
  rowIndex: e.rowIndex,
4620
4680
  colIndex: n.colEnd
4621
- }, Oo = (e, t, n) => t === G.Column ? {
4681
+ }, Fo = (e, t, n) => t === G.Column ? {
4622
4682
  rowIndex: n.rowStart,
4623
4683
  colIndex: e.colIndex
4624
4684
  } : {
4625
4685
  rowIndex: e.rowIndex,
4626
4686
  colIndex: n.colStart
4627
- }, $o = (e, t, n, o) => n === G.Column ? {
4687
+ }, Vo = (e, t, n, o) => n === G.Column ? {
4628
4688
  rowStart: o.rowStart,
4629
4689
  rowEnd: o.rowEnd,
4630
4690
  colStart: Math.min(e.colIndex, t.colIndex),
@@ -4634,9 +4694,9 @@ var To = (e, t, n) => t === G.Column ? {
4634
4694
  colEnd: o.colEnd,
4635
4695
  rowStart: Math.min(e.rowIndex, t.rowIndex),
4636
4696
  rowEnd: Math.max(e.rowIndex, t.rowIndex)
4637
- }, Lo = (e, t, n) => {
4697
+ }, Ho = (e, t, n) => {
4638
4698
  let o = null, r = null, l = 0;
4639
- const i = () => t.getAllPanes()[_.Center] ?? t, s = (t, n, o) => {
4699
+ const i = () => t.getAllPanes()[_.Center] ?? t, a = (t, n, o) => {
4640
4700
  if (!e) return;
4641
4701
  const r = e.getSelection(), l = !!r.ranges && r.ranges.length > 0;
4642
4702
  if ("clear" === o) return void e.setSelection({
@@ -4653,13 +4713,13 @@ var To = (e, t, n) => t === G.Column ? {
4653
4713
  });
4654
4714
  return;
4655
4715
  }
4656
- const i = r.rangeIndex ?? -1, s = l ? i >= 0 ? i : r.ranges.length - 1 : 0, a = l ? r.ranges.map((e, n) => n === s ? t : e) : [t];
4716
+ const i = r.rangeIndex ?? -1, a = l ? i >= 0 ? i : r.ranges.length - 1 : 0, s = l ? r.ranges.map((e, n) => n === a ? t : e) : [t];
4657
4717
  e.setSelection({
4658
4718
  cell: n,
4659
- ranges: a,
4660
- rangeIndex: l ? s : 0
4719
+ ranges: s,
4720
+ rangeIndex: l ? a : 0
4661
4721
  });
4662
- }, a = (t, n, o) => {
4722
+ }, s = (t, n, o) => {
4663
4723
  if (!e) return;
4664
4724
  const r = e.getSelection(), l = r.ranges && r.ranges.length > 0 ? r.ranges : [], i = t < l.length ? l.map((e, o) => o === t ? n : e) : [...l, n];
4665
4725
  e.setSelection({
@@ -4674,24 +4734,24 @@ var To = (e, t, n) => t === G.Column ? {
4674
4734
  const { axis: t, entireRange: o } = n(), r = i().getElement()?.getBoundingClientRect();
4675
4735
  if (!r) return !1;
4676
4736
  const l = i().getVisibleRange();
4677
- let s = null;
4678
- return t === G.Column ? e.x >= r.right - 24 && l.colEnd < o.colEnd ? s = { colIndex: l.colEnd + 1 } : e.x <= r.left + 24 && l.colStart > o.colStart && (s = { colIndex: l.colStart - 1 }) : e.y >= r.bottom - 24 && l.rowEnd < o.rowEnd ? s = { rowIndex: l.rowEnd + 1 } : e.y <= r.top + 24 && l.rowStart > o.rowStart && (s = { rowIndex: l.rowStart - 1 }), !!s && (c(s), !0);
4737
+ let a = null;
4738
+ return t === G.Column ? e.x >= r.right - 24 && l.colEnd < o.colEnd ? a = { colIndex: l.colEnd + 1 } : e.x <= r.left + 24 && l.colStart > o.colStart && (a = { colIndex: l.colStart - 1 }) : e.y >= r.bottom - 24 && l.rowEnd < o.rowEnd ? a = { rowIndex: l.rowEnd + 1 } : e.y <= r.top + 24 && l.rowStart > o.rowStart && (a = { rowIndex: l.rowStart - 1 }), !!a && (c(a), !0);
4679
4739
  }, u = (e) => {
4680
- const { axis: t, entireRange: c, replaceActive: d = !1 } = n(), u = $o(o ?? e, e, t, c), g = r ?? Oo(e, t, i().getVisibleRange());
4681
- d ? a(l, u, g) : s(u, g, "replace");
4740
+ const { axis: t, entireRange: c, replaceActive: d = !1 } = n(), u = Vo(o ?? e, e, t, c), g = r ?? Fo(e, t, i().getVisibleRange());
4741
+ d ? s(l, u, g) : a(u, g, "replace");
4682
4742
  };
4683
- return Yt(t, (t, g) => {
4743
+ return tn(t, (t, g) => {
4684
4744
  if (!e) return null;
4685
4745
  const h = 0 === g.button, f = 2 === g.button;
4686
4746
  if (!h && !f) return null;
4687
4747
  const { axis: p, entireRange: m, allowMulti: w = !0, replaceActive: x = !1, preserveFocus: v = !1, onPointerDownInterceptor: y, onDragStart: b, onDragEnd: S, onPointerUp: E } = n();
4688
4748
  if (!1 === y?.(g, t)) return null;
4689
4749
  x && g.stopPropagation(), v && h && g.preventDefault(), b?.();
4690
- const I = Oo(t, p, i().getVisibleRange()), C = g.shiftKey, R = (g.ctrlKey || g.metaKey) && w;
4750
+ const I = Fo(t, p, i().getVisibleRange()), C = g.shiftKey, R = (g.ctrlKey || g.metaKey) && w;
4691
4751
  if (x) {
4692
- const n = e.getSelection(), i = n.ranges ?? [], s = n.rangeIndex ?? -1;
4693
- C && o ? (l = s >= 0 ? s : Math.max(0, i.length - 1), a(l, $o(o, t, p, m), r ?? I)) : (o = t, r = I, l = R || s < 0 ? i.length : s, a(l, $o(t, t, p, m), I));
4694
- } else C && o ? s($o(o, t, p, m), r ?? I, "replace") : R ? (o = t, r = I, s($o(t, t, p, m), I, "append")) : (o = t, r = I, s($o(t, t, p, m), I, "clear"));
4752
+ const n = e.getSelection(), i = n.ranges ?? [], a = n.rangeIndex ?? -1;
4753
+ C && o ? (l = a >= 0 ? a : Math.max(0, i.length - 1), s(l, Vo(o, t, p, m), r ?? I)) : (o = t, r = I, l = R || a < 0 ? i.length : a, s(l, Vo(t, t, p, m), I));
4754
+ } else C && o ? a(Vo(o, t, p, m), r ?? I, "replace") : R ? (o = t, r = I, a(Vo(t, t, p, m), I, "append")) : (o = t, r = I, a(Vo(t, t, p, m), I, "clear"));
4695
4755
  return ((e) => {
4696
4756
  c(n().axis === G.Column ? { colIndex: e.colIndex } : { rowIndex: e.rowIndex });
4697
4757
  })(t), {
@@ -4704,38 +4764,38 @@ var To = (e, t, n) => t === G.Column ? {
4704
4764
  captureEvents: x
4705
4765
  };
4706
4766
  });
4707
- }, Bo = (e, t) => {
4708
- const n = qe(), o = f(t);
4767
+ }, _o = (e, t) => {
4768
+ const n = Ze(), o = f(t);
4709
4769
  o.current = t;
4710
- const r = g(() => Lo(e, n, () => o.current), [e, n]);
4770
+ const r = g(() => Ho(e, n, () => o.current), [e, n]);
4711
4771
  return c(() => () => r.dispose(), [r]), {
4712
4772
  onPointerDown: r.onPointerDown,
4713
4773
  onPointerMove: r.onPointerMove,
4714
4774
  onPointerUp: r.onPointerUp
4715
4775
  };
4716
- }, Ao = (e) => null == e ? [] : Array.isArray(e) ? e : [e], No = i(r((e, t) => {
4717
- const { rowCount: n = 1, columnCount: o = 1, getRowHeight: r, getColumnWidth: l, metrics: i, renderCells: a, renderBorders: c, showGridLines: d = !0, gridLineColor: u, propsGridLineRows: f, propsGridLineColumns: p, getVisibleCells: m, hiddenCellAt: w, renderBelow: v, children: y, ...b } = e, S = oe({
4776
+ }, Wo = (e) => null == e ? [] : Array.isArray(e) ? e : [e], Uo = i(r((e, t) => {
4777
+ const { rowCount: n = 1, columnCount: o = 1, getRowHeight: r, getColumnWidth: l, metrics: i, renderCells: s, renderBorders: c, showGridLines: d = !0, gridLineColor: u, propsGridLineRows: f, propsGridLineColumns: p, getVisibleCells: m, hiddenCellAt: w, renderBelow: v, children: y, ...b } = e, S = re({
4718
4778
  rowCount: n,
4719
4779
  columnCount: o,
4720
4780
  getRowHeight: r,
4721
4781
  getColumnWidth: l
4722
- }), E = i ?? S, [I, C] = h((e) => e + 1, 0), R = g(() => ({}), [I]), M = s((e) => {
4782
+ }), E = i ?? S, [I, C] = h((e) => e + 1, 0), R = g(() => ({}), [I]), M = a((e) => {
4723
4783
  C();
4724
4784
  }, []), P = L(t, () => ({ invalidate: M }), [M]), k = g(() => {
4725
4785
  const e = [];
4726
- return !1 !== d && e.push(x(On, {
4786
+ return !1 !== d && e.push(x(Fn, {
4727
4787
  showGridLines: d,
4728
4788
  gridLineColor: u,
4729
4789
  propsRows: f,
4730
4790
  propsColumns: p,
4731
4791
  getVisibleCells: m,
4732
4792
  hiddenCellAt: w
4733
- }, "__gridlines")), e.push(...Ao(v)), e.push(...Ao(c)), a && e.push(x(In, {
4734
- renderCell: a,
4793
+ }, "__gridlines")), e.push(...Wo(v)), e.push(...Wo(c)), s && e.push(x(Dn, {
4794
+ renderCell: s,
4735
4795
  getVisibleCells: m,
4736
4796
  hiddenCellAt: w,
4737
4797
  cacheToken: R
4738
- }, "__cells")), e.push(...Ao(y)), e;
4798
+ }, "__cells")), e.push(...Wo(y)), e;
4739
4799
  }, [
4740
4800
  d,
4741
4801
  u,
@@ -4745,11 +4805,11 @@ var To = (e, t, n) => t === G.Column ? {
4745
4805
  w,
4746
4806
  v,
4747
4807
  c,
4748
- a,
4808
+ s,
4749
4809
  R,
4750
4810
  y
4751
4811
  ]);
4752
- return x(Fe, {
4812
+ return x(Ve, {
4753
4813
  ref: P,
4754
4814
  ...b,
4755
4815
  rowCount: n,
@@ -4758,56 +4818,46 @@ var To = (e, t, n) => t === G.Column ? {
4758
4818
  children: k
4759
4819
  });
4760
4820
  }));
4761
- No.displayName = "Grid";
4762
- var Fo = {
4821
+ Uo.displayName = "Grid";
4822
+ var Ko = {
4763
4823
  fill: { fill: "color-mix(in srgb, var(--sxl-color-primary, rgb(0, 120, 215)) 14%, transparent)" },
4764
4824
  border: null,
4765
4825
  inner: null
4766
- }, Vo = {
4826
+ }, jo = {
4767
4827
  stroke: "var(--sxl-color-primary, rgb(0, 120, 215))",
4768
4828
  alignWidth: 1,
4769
4829
  inset: 1
4770
- }, Ho = r(function(e, t) {
4771
- const { itemCount: n, renderItem: o, itemHeight: r = 24, selection: l, onKeyDown: i, cacheToken: a, className: c, style: d, children: u, ...h } = e, f = L(t, () => ({ isList: () => !0 }), []), p = g(() => new M(), []), m = g(() => new Bn({ getBounds: () => ({
4830
+ }, Go = r(function(e, t) {
4831
+ const { itemCount: n, renderCell: o, getVisibleCells: r, itemHeight: l = 24, contentWidth: i, selection: a, propsLayer: s, autoFocus: d, cacheToken: u, className: h, style: p, children: m, ...w } = e, y = g(() => new M(), []), b = f(null);
4832
+ c(() => {
4833
+ d && b.current?.focus();
4834
+ }, [d]);
4835
+ const S = g(() => new _n({ getBounds: () => ({
4772
4836
  rowStart: 0,
4773
4837
  colStart: 0,
4774
4838
  rowEnd: Math.max(0, n - 1),
4775
4839
  colEnd: 0
4776
- }) }), [n]), w = l ?? m, [y, { width: b }] = te(), S = oe({
4840
+ }) }), [n]), E = a ?? S, [C, { width: R }] = te(), [P, { width: k }] = te(), D = k > 0 && R > 0 ? Math.max(0, k - R) : 0, T = g(() => ne([P, t]), [P, t]), O = re({
4777
4841
  rowCount: n,
4778
4842
  columnCount: 1,
4779
- getRowHeight: r,
4780
- getColumnWidth: b
4781
- }), E = s((e) => {
4782
- const { key: t, style: n, range: r, cell: l } = e, i = r?.rowStart ?? l.rowIndex;
4783
- return x("div", {
4784
- style: {
4785
- ...n,
4786
- position: "absolute",
4787
- display: "flex",
4788
- alignItems: "center",
4789
- boxSizing: "border-box",
4790
- padding: "0 8px",
4791
- overflow: "hidden",
4792
- whiteSpace: "nowrap",
4793
- userSelect: "none",
4794
- pointerEvents: "none",
4795
- background: "transparent"
4796
- },
4797
- children: o(i)
4798
- }, t);
4799
- }, [o]);
4843
+ getRowHeight: l,
4844
+ getColumnWidth: R
4845
+ });
4800
4846
  return x("div", {
4801
- ref: f,
4802
- className: V("list", c),
4847
+ ref: T,
4848
+ className: V("list-surface", h),
4803
4849
  style: {
4804
4850
  position: "relative",
4805
4851
  overflow: "hidden",
4806
- ...d
4852
+ height: n * l,
4853
+ maxWidth: "100%",
4854
+ maxHeight: "100%",
4855
+ ...p,
4856
+ ...null != i ? { width: i + D } : null
4807
4857
  },
4808
- ...h,
4858
+ ...w,
4809
4859
  children: x(I, {
4810
- viewport: p,
4860
+ viewport: y,
4811
4861
  showVerticalScrollbar: !0,
4812
4862
  showHorizontalScrollbar: !1,
4813
4863
  style: {
@@ -4815,39 +4865,73 @@ var Fo = {
4815
4865
  height: "100%"
4816
4866
  },
4817
4867
  children: x("div", {
4818
- ref: y,
4868
+ ref: C,
4819
4869
  style: {
4820
4870
  width: "100%",
4821
4871
  height: "100%"
4822
4872
  },
4823
- children: v(Fe, {
4824
- viewport: p,
4873
+ children: v(Ve, {
4874
+ ref: b,
4875
+ viewport: y,
4825
4876
  style: {
4826
4877
  width: "100%",
4827
4878
  height: "100%"
4828
4879
  },
4829
4880
  rowCount: n,
4830
4881
  columnCount: 1,
4831
- metrics: S,
4882
+ metrics: O,
4832
4883
  children: [
4833
- x(lo, {
4834
- selection: w,
4884
+ x(go, {
4885
+ selection: E,
4835
4886
  anchorHole: !1,
4836
- singleStyle: Fo,
4837
- singleAnchorStyle: Vo,
4838
- multiAnchorStyle: Vo
4887
+ singleStyle: Ko,
4888
+ singleAnchorStyle: jo,
4889
+ multiAnchorStyle: jo
4839
4890
  }, "__selection"),
4840
- x(In, {
4841
- renderCell: E,
4842
- cacheToken: a
4891
+ x(Dn, {
4892
+ renderCell: o,
4893
+ getVisibleCells: r,
4894
+ cacheToken: u
4843
4895
  }, "__cells"),
4844
- i ? x(et, { onKeyDown: i }, "__keys") : null
4896
+ s ? x(tt, { ...s }, "__taps") : null
4845
4897
  ]
4846
4898
  })
4847
4899
  })
4848
4900
  })
4849
4901
  });
4850
- }), _o = (e, t) => x("input", {
4902
+ }), Xo = r(function(e, t) {
4903
+ const { itemCount: n, renderItem: o, itemHeight: r, selection: l, onKeyDown: i, cacheToken: s, className: c, style: d, children: u, ...h } = e, f = L(t, () => ({ isList: () => !0 }), []), p = a((e) => {
4904
+ const { key: t, style: n, range: r, cell: l } = e, i = r?.rowStart ?? l.rowIndex;
4905
+ return x("div", {
4906
+ style: {
4907
+ ...n,
4908
+ position: "absolute",
4909
+ display: "flex",
4910
+ alignItems: "center",
4911
+ boxSizing: "border-box",
4912
+ padding: "0 8px",
4913
+ overflow: "hidden",
4914
+ whiteSpace: "nowrap",
4915
+ userSelect: "none",
4916
+ pointerEvents: "none",
4917
+ background: "transparent"
4918
+ },
4919
+ children: o(i)
4920
+ }, t);
4921
+ }, [o]), m = g(() => i ? { onKeyDown: i } : void 0, [i]);
4922
+ return x(Go, {
4923
+ ref: f,
4924
+ className: V("list", c),
4925
+ style: d,
4926
+ itemCount: n,
4927
+ itemHeight: r,
4928
+ selection: l,
4929
+ renderCell: p,
4930
+ propsLayer: m,
4931
+ cacheToken: s,
4932
+ ...h
4933
+ });
4934
+ }), Yo = (e, t) => x("input", {
4851
4935
  type: "checkbox",
4852
4936
  checked: e,
4853
4937
  ref: (e) => {
@@ -4856,13 +4940,13 @@ var Fo = {
4856
4940
  readOnly: !0,
4857
4941
  tabIndex: -1,
4858
4942
  style: { margin: 0 }
4859
- }), Wo = r(function(e, t) {
4860
- const { itemCount: n, isChecked: o, onCheckedChange: r, renderValue: l, renderCheckbox: i = _o, renderDivider: a, selectAllLabel: c, itemHeight: d, selection: u, cacheToken: h, className: f, style: p, children: m, ...y } = e, b = L(t, () => ({ isCheckboxList: () => !0 }), []), S = g(() => new Bn({ getBounds: () => ({
4943
+ }), qo = r(function(e, t) {
4944
+ const { itemCount: n, isChecked: o, onCheckedChange: r, renderValue: l, renderCheckbox: i = Yo, renderDivider: s, selectAllLabel: c, itemHeight: d, selection: u, cacheToken: h, className: f, style: p, children: m, ...y } = e, b = L(t, () => ({ isCheckboxList: () => !0 }), []), S = g(() => new _n({ getBounds: () => ({
4861
4945
  rowStart: 0,
4862
4946
  colStart: 0,
4863
4947
  rowEnd: Math.max(0, n - 1),
4864
4948
  colEnd: 0
4865
- }) }), [n]), E = u ?? S, I = s((e) => v("div", {
4949
+ }) }), [n]), E = u ?? S, I = a((e) => v("div", {
4866
4950
  style: {
4867
4951
  display: "flex",
4868
4952
  alignItems: "center",
@@ -4893,7 +4977,7 @@ var Fo = {
4893
4977
  r,
4894
4978
  l,
4895
4979
  i
4896
- ]), C = s((e) => {
4980
+ ]), C = a((e) => {
4897
4981
  if (" " !== e.key && "Enter" !== e.key) return;
4898
4982
  e.preventDefault(), e.stopPropagation();
4899
4983
  const t = !o(E.getSelection().cell.rowIndex);
@@ -4951,7 +5035,7 @@ var Fo = {
4951
5035
  },
4952
5036
  children: i(R, M)
4953
5037
  }), c]
4954
- }), a?.()] }), x(Ho, {
5038
+ }), s?.()] }), x(Xo, {
4955
5039
  itemCount: n,
4956
5040
  itemHeight: d,
4957
5041
  selection: E,
@@ -4964,13 +5048,13 @@ var Fo = {
4964
5048
  }
4965
5049
  })]
4966
5050
  });
4967
- }), Uo = {
5051
+ }), Zo = {
4968
5052
  light: {},
4969
5053
  dark: {
4970
5054
  "color-base-100": "#1e1e1e",
4971
5055
  "color-base-300": "#3a3a3a"
4972
5056
  }
4973
- }, Ko = {
5057
+ }, Jo = {
4974
5058
  light: {
4975
5059
  "color-base-100": "#f2f2f2",
4976
5060
  "color-base-hover": "#ececec",
@@ -4981,7 +5065,7 @@ var Fo = {
4981
5065
  "color-base-hover": "#2e2e2e",
4982
5066
  "color-base-300": "#4a4a4a"
4983
5067
  }
4984
- }, jo = (e, ...t) => D(e, Uo[e], ...t), Go = (e, ...t) => D(e, Ko[e], ...t), Xo = ({ app: e, grid: t = Uo, header: n = Ko, layer: o = "sxl-defaults", scope: r } = {}) => {
5068
+ }, Qo = (e, ...t) => D(e, Zo[e], ...t), er = (e, ...t) => D(e, Jo[e], ...t), tr = ({ app: e, grid: t = Zo, header: n = Jo, layer: o = "sxl-defaults", scope: r } = {}) => {
4985
5069
  const l = e ?? k, i = Object.fromEntries(Object.keys(n).map((e) => [e, {
4986
5070
  "color-base-100": l[e]?.["color-base-200"],
4987
5071
  ...n[e]
@@ -4996,4 +5080,4 @@ var Fo = {
4996
5080
  scope: r
4997
5081
  });
4998
5082
  };
4999
- export { Kt as AUTO_SCROLL_INTERVAL_MS, In as CellLayer, En as CellTileDiv, Wo as CheckboxList, jn as DEFAULT_ANCHOR_STYLE, _t as DEFAULT_HANDLE_STYLE, Kn as DEFAULT_MULTI_STYLE, Gn as DEFAULT_REMOVE_PREVIEW_STYLE, Un as DEFAULT_SINGLE_STYLE, hn as DefaultCellRenderer, vo as DefaultEditable, Eo as DefaultEditorInput, Po as DefaultHeaderDivider, Bn as DefaultSelection, en as DragHandle, ln as Draggable, jt as EDGE_AUTO_SCROLL_MARGIN_PX, po as EditSession, Co as EditorDiv, Io as EditorLayer, gn as FillHandle, Uo as GRID_SURFACE, No as Grid, Fe as GridSurface, On as GridlineLayer, Ko as HEADER_SURFACE, Do as HeaderDividerAnchor, Ot as HoverTipLayer, et as Layer, ie as LineSVG, Ho as List, ao as PICKER_COLORS, an as RESIZE_ANCHORS_4, cn as RESIZE_ANCHORS_8, Ht as RangePrompt, Wt as RangeRect, dn as RangeResizer, ho as RangesPickerLayer, se as RectangleSVG, Ln as SELECTION_CLIP_INSETS, lo as SelectionLayer, Yn as SelectionTouchGrips, re as ShapeBoundsContext, Et as StickyAnchor, kt as StickyFloat, Be as SurfaceStateContext, Ae as SurfaceStateProvider, lt as VirtualDiv, Xo as buildGridThemeCSS, ne as createAxis, Yt as createDragCells, Lo as createHeaderSelectionPointer, Le as createSurfaceStateStore, qt as createWindowDragCells, go as defaultRangeStyle, Gt as edgeScrollPane, yo as expandEditorBounds, jo as gridThemeVars, Oo as headerAnchorCell, zo as headerEntireEnd, To as headerEntireStart, $o as headerRange, Go as headerThemeVars, mo as startEventFromKey, Zt as useDragCells, xo as useEditorKeymap, Rt as useGridFloatTheme, oe as useGridMetrics, qe as useGridPane, Ze as useGridPaneOptional, Bo as useHeaderSelectionPointer, Tt as useHoverIntent, Qe as useLayer, wo as usePendingCaret, zt as useRangeHover, Xn as useSelectionPointer, le as useShapeBounds, bt as useSticky, St as useStickyOptional, Je as useSurfaceState, Jt as useWindowDragCells };
5083
+ export { Zt as AUTO_SCROLL_INTERVAL_MS, Dn as CellLayer, kn as CellTileDiv, qo as CheckboxList, Jn as DEFAULT_ANCHOR_STYLE, Xt as DEFAULT_HANDLE_STYLE, Zn as DEFAULT_MULTI_STYLE, Qn as DEFAULT_REMOVE_PREVIEW_STYLE, qn as DEFAULT_SINGLE_STYLE, vn as DefaultCellRenderer, Co as DefaultEditable, ko as DefaultEditorInput, $o as DefaultHeaderDivider, _n as DefaultSelection, an as DragHandle, gn as Draggable, Jt as EDGE_AUTO_SCROLL_MARGIN_PX, bo as EditSession, To as EditorDiv, Do as EditorLayer, xn as FillHandle, Zo as GRID_SURFACE, Uo as Grid, Ve as GridSurface, Fn as GridlineLayer, Jo as HEADER_SURFACE, Bo as HeaderDividerAnchor, Ft as HoverTipLayer, tt as Layer, ae as LineSVG, Xo as List, Go as ListSurface, po as PICKER_COLORS, fn as RESIZE_ANCHORS_4, pn as RESIZE_ANCHORS_8, Nt as RangeFloatLayer, Gt as RangePrompt, Yt as RangeRect, mn as RangeResizer, vo as RangesPickerLayer, se as RectangleSVG, Hn as SELECTION_CLIP_INSETS, go as SelectionLayer, to as SelectionTouchGrips, le as ShapeBoundsContext, It as StickyAnchor, Dt as StickyFloat, Ae as SurfaceStateContext, Ne as SurfaceStateProvider, it as VirtualDiv, tr as buildGridThemeCSS, oe as createAxis, tn as createDragCells, Ho as createHeaderSelectionPointer, Be as createSurfaceStateStore, nn as createWindowDragCells, xo as defaultRangeStyle, Qt as edgeScrollPane, Ro as expandEditorBounds, Qo as gridThemeVars, Fo as headerAnchorCell, No as headerEntireEnd, Ao as headerEntireStart, Vo as headerRange, er as headerThemeVars, So as startEventFromKey, on as useDragCells, Io as useEditorKeymap, Mt as useGridFloatTheme, re as useGridMetrics, Ze as useGridPane, Je as useGridPaneOptional, _o as useHeaderSelectionPointer, Ot as useHoverIntent, et as useLayer, Eo as usePendingCaret, zt as useRangeHover, eo as useSelectionPointer, ie as useShapeBounds, St as useSticky, Et as useStickyOptional, Qe as useSurfaceState, rn as useWindowDragCells };