@warkypublic/oranguru 0.0.38 → 0.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib.es.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import * as ye from "react";
2
- import $, { forwardRef as Be, useMemo as yt, useRef as U, useCallback as oe, useEffect as I, useImperativeHandle as Ge, useState as le, createElement as ce, createContext as Dt, useContext as zt } from "react";
3
- import { TextInput as Ve, Loader as $t, ActionIcon as _e, Combobox as te, Checkbox as Nt, useVirtualizedCombobox as Lt, ScrollArea as Bt, rem as We, Group as we, Button as re, Paper as Gt, Text as Ke, Collapse as Vt, Code as qt, Tooltip as Q, ScrollAreaAutosize as Ht, LoadingOverlay as Wt, Drawer as Kt, Modal as Ut, Popover as Re, VisuallyHidden as Jt, NativeSelect as Yt, PasswordInput as Xt, Switch as Qt, Textarea as Zt, Portal as en, Menu as K, Stack as wt, Select as tn, useMantineTheme as nn, useMantineColorScheme as rn, lighten as Ue, darken as on } from "@mantine/core";
2
+ import $, { forwardRef as Be, useMemo as yt, useRef as U, useCallback as oe, useEffect as I, useImperativeHandle as Ge, useState as se, createElement as ce, createContext as zt, useContext as $t } from "react";
3
+ import { TextInput as Ve, Loader as Nt, ActionIcon as _e, Combobox as te, Checkbox as Lt, useVirtualizedCombobox as Bt, ScrollArea as Gt, rem as We, Group as we, Button as re, Paper as Vt, Text as Ke, Collapse as qt, Code as Ht, Switch as wt, Tooltip as Q, ScrollAreaAutosize as Wt, LoadingOverlay as Kt, Drawer as Ut, Modal as Jt, Popover as Re, VisuallyHidden as Yt, NativeSelect as Xt, PasswordInput as Qt, Textarea as Zt, Portal as en, Menu as K, Stack as bt, Select as tn, useMantineTheme as nn, useMantineColorScheme as rn, lighten as Ue, darken as on } from "@mantine/core";
4
4
  import { flushSync as sn } from "react-dom";
5
5
  import { createSyncStore as Ce } from "@warkypublic/zustandsyncstore";
6
6
  import { produce as H } from "immer";
7
7
  import { IconX as qe, IconExclamationCircle as an, IconDeviceFloppy as ln, IconGrid4x4 as Ie, IconSquarePlus as cn, IconEdit as Je, IconTrashX as Ye, IconExclamationMark as un, IconRefresh as dn, IconMenu2 as fn } from "@tabler/icons-react";
8
8
  import { useForm as hn, FormProvider as mn, Controller as he } from "react-hook-form";
9
- import { newUUID as gn, getUUID as bt } from "@warkypublic/artemis-kit";
9
+ import { newUUID as gn, getUUID as xt } from "@warkypublic/artemis-kit";
10
10
  import { get as pn, set as Sn } from "idb-keyval";
11
- import { CompactSelection as ne, GridCellKind as ie, DataEditor as vn } from "@glideapps/glide-data-grid";
12
- import { useDebouncedValue as xt, useDebouncedCallback as yn, useElementSize as wn, useMergedRef as bn } from "@mantine/hooks";
11
+ import { CompactSelection as ne, GridCellKind as ae, DataEditor as vn } from "@glideapps/glide-data-grid";
12
+ import { useDebouncedValue as _t, useDebouncedCallback as yn, useElementSize as wn, useMergedRef as bn } from "@mantine/hooks";
13
13
  function xn(r) {
14
14
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
15
15
  }
@@ -40,230 +40,230 @@ var de = {};
40
40
  var Qe;
41
41
  function Cn() {
42
42
  return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && (function() {
43
- function r(f) {
44
- if (f == null) return null;
45
- if (typeof f == "function")
46
- return f.$$typeof === F ? null : f.displayName || f.name || null;
47
- if (typeof f == "string") return f;
48
- switch (f) {
43
+ function r(h) {
44
+ if (h == null) return null;
45
+ if (typeof h == "function")
46
+ return h.$$typeof === T ? null : h.displayName || h.name || null;
47
+ if (typeof h == "string") return h;
48
+ switch (h) {
49
49
  case _:
50
50
  return "Fragment";
51
- case C:
52
- return "Profiler";
53
51
  case x:
52
+ return "Profiler";
53
+ case C:
54
54
  return "StrictMode";
55
55
  case w:
56
56
  return "Suspense";
57
- case p:
57
+ case S:
58
58
  return "SuspenseList";
59
59
  case L:
60
60
  return "Activity";
61
61
  }
62
- if (typeof f == "object")
63
- switch (typeof f.tag == "number" && console.error(
62
+ if (typeof h == "object")
63
+ switch (typeof h.tag == "number" && console.error(
64
64
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
65
- ), f.$$typeof) {
65
+ ), h.$$typeof) {
66
66
  case y:
67
67
  return "Portal";
68
68
  case O:
69
- return f.displayName || "Context";
69
+ return h.displayName || "Context";
70
70
  case R:
71
- return (f._context.displayName || "Context") + ".Consumer";
71
+ return (h._context.displayName || "Context") + ".Consumer";
72
72
  case N:
73
- var b = f.render;
74
- return f = f.displayName, f || (f = b.displayName || b.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
73
+ var b = h.render;
74
+ return h = h.displayName, h || (h = b.displayName || b.name || "", h = h !== "" ? "ForwardRef(" + h + ")" : "ForwardRef"), h;
75
75
  case E:
76
- return b = f.displayName || null, b !== null ? b : r(f.type) || "Memo";
76
+ return b = h.displayName || null, b !== null ? b : r(h.type) || "Memo";
77
77
  case D:
78
- b = f._payload, f = f._init;
78
+ b = h._payload, h = h._init;
79
79
  try {
80
- return r(f(b));
80
+ return r(h(b));
81
81
  } catch {
82
82
  }
83
83
  }
84
84
  return null;
85
85
  }
86
- function o(f) {
87
- return "" + f;
86
+ function o(h) {
87
+ return "" + h;
88
88
  }
89
- function e(f) {
89
+ function e(h) {
90
90
  try {
91
- o(f);
91
+ o(h);
92
92
  var b = !1;
93
93
  } catch {
94
94
  b = !0;
95
95
  }
96
96
  if (b) {
97
97
  b = console;
98
- var k = b.error, S = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
98
+ var k = b.error, v = typeof Symbol == "function" && Symbol.toStringTag && h[Symbol.toStringTag] || h.constructor.name || "Object";
99
99
  return k.call(
100
100
  b,
101
101
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
102
- S
103
- ), o(f);
102
+ v
103
+ ), o(h);
104
104
  }
105
105
  }
106
- function t(f) {
107
- if (f === _) return "<>";
108
- if (typeof f == "object" && f !== null && f.$$typeof === D)
106
+ function t(h) {
107
+ if (h === _) return "<>";
108
+ if (typeof h == "object" && h !== null && h.$$typeof === D)
109
109
  return "<...>";
110
110
  try {
111
- var b = r(f);
111
+ var b = r(h);
112
112
  return b ? "<" + b + ">" : "<...>";
113
113
  } catch {
114
114
  return "<...>";
115
115
  }
116
116
  }
117
117
  function n() {
118
- var f = M.A;
119
- return f === null ? null : f.getOwner();
118
+ var h = M.A;
119
+ return h === null ? null : h.getOwner();
120
120
  }
121
121
  function s() {
122
122
  return Error("react-stack-top-frame");
123
123
  }
124
- function i(f) {
125
- if (A.call(f, "key")) {
126
- var b = Object.getOwnPropertyDescriptor(f, "key").get;
124
+ function i(h) {
125
+ if (A.call(h, "key")) {
126
+ var b = Object.getOwnPropertyDescriptor(h, "key").get;
127
127
  if (b && b.isReactWarning) return !1;
128
128
  }
129
- return f.key !== void 0;
129
+ return h.key !== void 0;
130
130
  }
131
- function a(f, b) {
131
+ function a(h, b) {
132
132
  function k() {
133
133
  j || (j = !0, console.error(
134
134
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
135
135
  b
136
136
  ));
137
137
  }
138
- k.isReactWarning = !0, Object.defineProperty(f, "key", {
138
+ k.isReactWarning = !0, Object.defineProperty(h, "key", {
139
139
  get: k,
140
140
  configurable: !0
141
141
  });
142
142
  }
143
143
  function l() {
144
- var f = r(this.type);
145
- return J[f] || (J[f] = !0, console.error(
144
+ var h = r(this.type);
145
+ return J[h] || (J[h] = !0, console.error(
146
146
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
147
- )), f = this.props.ref, f !== void 0 ? f : null;
147
+ )), h = this.props.ref, h !== void 0 ? h : null;
148
148
  }
149
- function h(f, b, k, S, z, P) {
150
- var T = k.ref;
151
- return f = {
152
- $$typeof: v,
153
- type: f,
149
+ function f(h, b, k, v, z, P) {
150
+ var F = k.ref;
151
+ return h = {
152
+ $$typeof: p,
153
+ type: h,
154
154
  key: b,
155
155
  props: k,
156
- _owner: S
157
- }, (T !== void 0 ? T : null) !== null ? Object.defineProperty(f, "ref", {
156
+ _owner: v
157
+ }, (F !== void 0 ? F : null) !== null ? Object.defineProperty(h, "ref", {
158
158
  enumerable: !1,
159
159
  get: l
160
- }) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
160
+ }) : Object.defineProperty(h, "ref", { enumerable: !1, value: null }), h._store = {}, Object.defineProperty(h._store, "validated", {
161
161
  configurable: !1,
162
162
  enumerable: !1,
163
163
  writable: !0,
164
164
  value: 0
165
- }), Object.defineProperty(f, "_debugInfo", {
165
+ }), Object.defineProperty(h, "_debugInfo", {
166
166
  configurable: !1,
167
167
  enumerable: !1,
168
168
  writable: !0,
169
169
  value: null
170
- }), Object.defineProperty(f, "_debugStack", {
170
+ }), Object.defineProperty(h, "_debugStack", {
171
171
  configurable: !1,
172
172
  enumerable: !1,
173
173
  writable: !0,
174
174
  value: z
175
- }), Object.defineProperty(f, "_debugTask", {
175
+ }), Object.defineProperty(h, "_debugTask", {
176
176
  configurable: !1,
177
177
  enumerable: !1,
178
178
  writable: !0,
179
179
  value: P
180
- }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
180
+ }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
181
181
  }
182
- function c(f, b, k, S, z, P) {
183
- var T = b.children;
184
- if (T !== void 0)
185
- if (S)
186
- if (B(T)) {
187
- for (S = 0; S < T.length; S++)
188
- u(T[S]);
189
- Object.freeze && Object.freeze(T);
182
+ function u(h, b, k, v, z, P) {
183
+ var F = b.children;
184
+ if (F !== void 0)
185
+ if (v)
186
+ if (B(F)) {
187
+ for (v = 0; v < F.length; v++)
188
+ c(F[v]);
189
+ Object.freeze && Object.freeze(F);
190
190
  } else
191
191
  console.error(
192
192
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
193
193
  );
194
- else u(T);
194
+ else c(F);
195
195
  if (A.call(b, "key")) {
196
- T = r(f);
196
+ F = r(h);
197
197
  var ee = Object.keys(b).filter(function(Ee) {
198
198
  return Ee !== "key";
199
199
  });
200
- S = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", q[T + S] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
200
+ v = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", q[F + v] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
201
201
  `A props object containing a "key" prop is being spread into JSX:
202
202
  let props = %s;
203
203
  <%s {...props} />
204
204
  React keys must be passed directly to JSX without using spread:
205
205
  let props = %s;
206
206
  <%s key={someKey} {...props} />`,
207
- S,
208
- T,
207
+ v,
208
+ F,
209
209
  ee,
210
- T
211
- ), q[T + S] = !0);
210
+ F
211
+ ), q[F + v] = !0);
212
212
  }
213
- if (T = null, k !== void 0 && (e(k), T = "" + k), i(b) && (e(b.key), T = "" + b.key), "key" in b) {
213
+ if (F = null, k !== void 0 && (e(k), F = "" + k), i(b) && (e(b.key), F = "" + b.key), "key" in b) {
214
214
  k = {};
215
- for (var se in b)
216
- se !== "key" && (k[se] = b[se]);
215
+ for (var ie in b)
216
+ ie !== "key" && (k[ie] = b[ie]);
217
217
  } else k = b;
218
- return T && a(
218
+ return F && a(
219
219
  k,
220
- typeof f == "function" ? f.displayName || f.name || "Unknown" : f
221
- ), h(
222
- f,
223
- T,
220
+ typeof h == "function" ? h.displayName || h.name || "Unknown" : h
221
+ ), f(
222
+ h,
223
+ F,
224
224
  k,
225
225
  n(),
226
226
  z,
227
227
  P
228
228
  );
229
229
  }
230
- function u(f) {
231
- m(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === D && (f._payload.status === "fulfilled" ? m(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
230
+ function c(h) {
231
+ m(h) ? h._store && (h._store.validated = 1) : typeof h == "object" && h !== null && h.$$typeof === D && (h._payload.status === "fulfilled" ? m(h._payload.value) && h._payload.value._store && (h._payload.value._store.validated = 1) : h._store && (h._store.validated = 1));
232
232
  }
233
- function m(f) {
234
- return typeof f == "object" && f !== null && f.$$typeof === v;
233
+ function m(h) {
234
+ return typeof h == "object" && h !== null && h.$$typeof === p;
235
235
  }
236
- var g = $, v = /* @__PURE__ */ Symbol.for("react.transitional.element"), y = /* @__PURE__ */ Symbol.for("react.portal"), _ = /* @__PURE__ */ Symbol.for("react.fragment"), x = /* @__PURE__ */ Symbol.for("react.strict_mode"), C = /* @__PURE__ */ Symbol.for("react.profiler"), R = /* @__PURE__ */ Symbol.for("react.consumer"), O = /* @__PURE__ */ Symbol.for("react.context"), N = /* @__PURE__ */ Symbol.for("react.forward_ref"), w = /* @__PURE__ */ Symbol.for("react.suspense"), p = /* @__PURE__ */ Symbol.for("react.suspense_list"), E = /* @__PURE__ */ Symbol.for("react.memo"), D = /* @__PURE__ */ Symbol.for("react.lazy"), L = /* @__PURE__ */ Symbol.for("react.activity"), F = /* @__PURE__ */ Symbol.for("react.client.reference"), M = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, B = Array.isArray, G = console.createTask ? console.createTask : function() {
236
+ var g = $, p = /* @__PURE__ */ Symbol.for("react.transitional.element"), y = /* @__PURE__ */ Symbol.for("react.portal"), _ = /* @__PURE__ */ Symbol.for("react.fragment"), C = /* @__PURE__ */ Symbol.for("react.strict_mode"), x = /* @__PURE__ */ Symbol.for("react.profiler"), R = /* @__PURE__ */ Symbol.for("react.consumer"), O = /* @__PURE__ */ Symbol.for("react.context"), N = /* @__PURE__ */ Symbol.for("react.forward_ref"), w = /* @__PURE__ */ Symbol.for("react.suspense"), S = /* @__PURE__ */ Symbol.for("react.suspense_list"), E = /* @__PURE__ */ Symbol.for("react.memo"), D = /* @__PURE__ */ Symbol.for("react.lazy"), L = /* @__PURE__ */ Symbol.for("react.activity"), T = /* @__PURE__ */ Symbol.for("react.client.reference"), M = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, B = Array.isArray, G = console.createTask ? console.createTask : function() {
237
237
  return null;
238
238
  };
239
239
  g = {
240
- react_stack_bottom_frame: function(f) {
241
- return f();
240
+ react_stack_bottom_frame: function(h) {
241
+ return h();
242
242
  }
243
243
  };
244
244
  var j, J = {}, Y = g.react_stack_bottom_frame.bind(
245
245
  g,
246
246
  s
247
247
  )(), Z = G(t(s)), q = {};
248
- de.Fragment = _, de.jsx = function(f, b, k) {
249
- var S = 1e4 > M.recentlyCreatedOwnerStacks++;
250
- return c(
251
- f,
248
+ de.Fragment = _, de.jsx = function(h, b, k) {
249
+ var v = 1e4 > M.recentlyCreatedOwnerStacks++;
250
+ return u(
251
+ h,
252
252
  b,
253
253
  k,
254
254
  !1,
255
- S ? Error("react-stack-top-frame") : Y,
256
- S ? G(t(f)) : Z
255
+ v ? Error("react-stack-top-frame") : Y,
256
+ v ? G(t(h)) : Z
257
257
  );
258
- }, de.jsxs = function(f, b, k) {
259
- var S = 1e4 > M.recentlyCreatedOwnerStacks++;
260
- return c(
261
- f,
258
+ }, de.jsxs = function(h, b, k) {
259
+ var v = 1e4 > M.recentlyCreatedOwnerStacks++;
260
+ return u(
261
+ h,
262
262
  b,
263
263
  k,
264
264
  !0,
265
- S ? Error("react-stack-top-frame") : Y,
266
- S ? G(t(f)) : Z
265
+ v ? Error("react-stack-top-frame") : Y,
266
+ v ? G(t(h)) : Z
267
267
  );
268
268
  };
269
269
  })()), de;
@@ -273,25 +273,25 @@ function En() {
273
273
  return Ze || (Ze = 1, process.env.NODE_ENV === "production" ? ge.exports = _n() : ge.exports = Cn()), ge.exports;
274
274
  }
275
275
  var d = En();
276
- function ae(r, o, e) {
276
+ function le(r, o, e) {
277
277
  let t = e.initialDeps ?? [], n, s = !0;
278
278
  function i() {
279
- var a, l, h;
280
- let c;
281
- e.key && ((a = e.debug) != null && a.call(e)) && (c = Date.now());
282
- const u = r();
283
- if (!(u.length !== t.length || u.some((v, y) => t[y] !== v)))
279
+ var a, l, f;
280
+ let u;
281
+ e.key && ((a = e.debug) != null && a.call(e)) && (u = Date.now());
282
+ const c = r();
283
+ if (!(c.length !== t.length || c.some((p, y) => t[y] !== p)))
284
284
  return n;
285
- t = u;
285
+ t = c;
286
286
  let g;
287
- if (e.key && ((l = e.debug) != null && l.call(e)) && (g = Date.now()), n = o(...u), e.key && ((h = e.debug) != null && h.call(e))) {
288
- const v = Math.round((Date.now() - c) * 100) / 100, y = Math.round((Date.now() - g) * 100) / 100, _ = y / 16, x = (C, R) => {
289
- for (C = String(C); C.length < R; )
290
- C = " " + C;
291
- return C;
287
+ if (e.key && ((l = e.debug) != null && l.call(e)) && (g = Date.now()), n = o(...c), e.key && ((f = e.debug) != null && f.call(e))) {
288
+ const p = Math.round((Date.now() - u) * 100) / 100, y = Math.round((Date.now() - g) * 100) / 100, _ = y / 16, C = (x, R) => {
289
+ for (x = String(x); x.length < R; )
290
+ x = " " + x;
291
+ return x;
292
292
  };
293
293
  console.info(
294
- `%c⏱ ${x(y, 5)} /${x(v, 5)} ms`,
294
+ `%c⏱ ${C(y, 5)} /${C(p, 5)} ms`,
295
295
  `
296
296
  font-size: .6rem;
297
297
  font-weight: bold;
@@ -344,9 +344,9 @@ const On = (r, o) => Math.abs(r - o) < 1.01, Rn = (r, o, e) => {
344
344
  const a = () => {
345
345
  const l = i[0];
346
346
  if (l?.borderBoxSize) {
347
- const h = l.borderBoxSize[0];
348
- if (h) {
349
- n({ width: h.inlineSize, height: h.blockSize });
347
+ const f = l.borderBoxSize[0];
348
+ if (f) {
349
+ n({ width: f.inlineSize, height: f.blockSize });
350
350
  return;
351
351
  }
352
352
  }
@@ -374,16 +374,16 @@ const On = (r, o) => Math.abs(r - o) < 1.01, Rn = (r, o, e) => {
374
374
  o(n, !1);
375
375
  },
376
376
  r.options.isScrollingResetDelay
377
- ), i = (c) => () => {
378
- const { horizontal: u, isRtl: m } = r.options;
379
- n = u ? e.scrollLeft * (m && -1 || 1) : e.scrollTop, s(), o(n, c);
377
+ ), i = (u) => () => {
378
+ const { horizontal: c, isRtl: m } = r.options;
379
+ n = c ? e.scrollLeft * (m && -1 || 1) : e.scrollTop, s(), o(n, u);
380
380
  }, a = i(!0), l = i(!1);
381
381
  e.addEventListener("scroll", a, nt);
382
- const h = r.options.useScrollendEvent && rt;
383
- return h && e.addEventListener("scrollend", l, nt), () => {
384
- e.removeEventListener("scroll", a), h && e.removeEventListener("scrollend", l);
382
+ const f = r.options.useScrollendEvent && rt;
383
+ return f && e.addEventListener("scrollend", l, nt), () => {
384
+ e.removeEventListener("scroll", a), f && e.removeEventListener("scrollend", l);
385
385
  };
386
- }, Tn = (r, o, e) => {
386
+ }, Fn = (r, o, e) => {
387
387
  if (o?.borderBoxSize) {
388
388
  const t = o.borderBoxSize[0];
389
389
  if (t)
@@ -392,7 +392,7 @@ const On = (r, o) => Math.abs(r - o) < 1.01, Rn = (r, o, e) => {
392
392
  );
393
393
  }
394
394
  return r[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
395
- }, Fn = (r, {
395
+ }, Tn = (r, {
396
396
  adjustments: o = 0,
397
397
  behavior: e
398
398
  }, t) => {
@@ -445,7 +445,7 @@ class Mn {
445
445
  rangeExtractor: kn,
446
446
  onChange: () => {
447
447
  },
448
- measureElement: Tn,
448
+ measureElement: Fn,
449
449
  initialRect: { width: 0, height: 0 },
450
450
  scrollMargin: 0,
451
451
  gap: 0,
@@ -462,7 +462,7 @@ class Mn {
462
462
  }, this.notify = (e) => {
463
463
  var t, n;
464
464
  (n = (t = this.options).onChange) == null || n.call(t, this, e);
465
- }, this.maybeNotify = ae(
465
+ }, this.maybeNotify = le(
466
466
  () => (this.calculateRange(), [
467
467
  this.isScrolling,
468
468
  this.range ? this.range.startIndex : null,
@@ -520,7 +520,7 @@ class Mn {
520
520
  break;
521
521
  }
522
522
  return s.size === this.options.lanes ? Array.from(s.values()).sort((i, a) => i.end === a.end ? i.index - a.index : i.end - a.end)[0] : void 0;
523
- }, this.getMeasurementOptions = ae(
523
+ }, this.getMeasurementOptions = le(
524
524
  () => [
525
525
  this.options.count,
526
526
  this.options.paddingStart,
@@ -540,7 +540,7 @@ class Mn {
540
540
  {
541
541
  key: !1
542
542
  }
543
- ), this.getMeasurements = ae(
543
+ ), this.getMeasurements = le(
544
544
  () => [this.getMeasurementOptions(), this.itemSizeCache],
545
545
  ({ count: e, paddingStart: t, scrollMargin: n, getItemKey: s, enabled: i, lanes: a }, l) => {
546
546
  if (!i)
@@ -551,43 +551,43 @@ class Mn {
551
551
  this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((m) => {
552
552
  this.itemSizeCache.set(m.key, m.size);
553
553
  }));
554
- const h = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
554
+ const f = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
555
555
  this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === e && (this.lanesSettling = !1);
556
- const c = this.measurementsCache.slice(0, h), u = new Array(a).fill(
556
+ const u = this.measurementsCache.slice(0, f), c = new Array(a).fill(
557
557
  void 0
558
558
  );
559
- for (let m = 0; m < h; m++) {
560
- const g = c[m];
561
- g && (u[g.lane] = m);
559
+ for (let m = 0; m < f; m++) {
560
+ const g = u[m];
561
+ g && (c[g.lane] = m);
562
562
  }
563
- for (let m = h; m < e; m++) {
564
- const g = s(m), v = this.laneAssignments.get(m);
563
+ for (let m = f; m < e; m++) {
564
+ const g = s(m), p = this.laneAssignments.get(m);
565
565
  let y, _;
566
- if (v !== void 0 && this.options.lanes > 1) {
567
- y = v;
568
- const O = u[y], N = O !== void 0 ? c[O] : void 0;
566
+ if (p !== void 0 && this.options.lanes > 1) {
567
+ y = p;
568
+ const O = c[y], N = O !== void 0 ? u[O] : void 0;
569
569
  _ = N ? N.end + this.options.gap : t + n;
570
570
  } else {
571
- const O = this.options.lanes === 1 ? c[m - 1] : this.getFurthestMeasurement(c, m);
571
+ const O = this.options.lanes === 1 ? u[m - 1] : this.getFurthestMeasurement(u, m);
572
572
  _ = O ? O.end + this.options.gap : t + n, y = O ? O.lane : m % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(m, y);
573
573
  }
574
- const x = l.get(g), C = typeof x == "number" ? x : this.options.estimateSize(m), R = _ + C;
575
- c[m] = {
574
+ const C = l.get(g), x = typeof C == "number" ? C : this.options.estimateSize(m), R = _ + x;
575
+ u[m] = {
576
576
  index: m,
577
577
  start: _,
578
- size: C,
578
+ size: x,
579
579
  end: R,
580
580
  key: g,
581
581
  lane: y
582
- }, u[y] = m;
582
+ }, c[y] = m;
583
583
  }
584
- return this.measurementsCache = c, c;
584
+ return this.measurementsCache = u, u;
585
585
  },
586
586
  {
587
587
  key: process.env.NODE_ENV !== "production" && "getMeasurements",
588
588
  debug: () => this.options.debug
589
589
  }
590
- ), this.calculateRange = ae(
590
+ ), this.calculateRange = le(
591
591
  () => [
592
592
  this.getMeasurements(),
593
593
  this.getSize(),
@@ -604,7 +604,7 @@ class Mn {
604
604
  key: process.env.NODE_ENV !== "production" && "calculateRange",
605
605
  debug: () => this.options.debug
606
606
  }
607
- ), this.getVirtualIndexes = ae(
607
+ ), this.getVirtualIndexes = le(
608
608
  () => {
609
609
  let e = null, t = null;
610
610
  const n = this.calculateRange();
@@ -654,7 +654,7 @@ class Mn {
654
654
  return;
655
655
  }
656
656
  this._measureElement(e, void 0);
657
- }, this.getVirtualItems = ae(
657
+ }, this.getVirtualItems = le(
658
658
  () => [this.getVirtualIndexes(), this.getMeasurements()],
659
659
  (e, t) => {
660
660
  const n = [];
@@ -672,7 +672,7 @@ class Mn {
672
672
  const t = this.getMeasurements();
673
673
  if (t.length !== 0)
674
674
  return et(
675
- t[_t(
675
+ t[Ct(
676
676
  0,
677
677
  t.length - 1,
678
678
  (n) => et(t[n]).start,
@@ -725,28 +725,28 @@ class Mn {
725
725
  "The `smooth` scroll behavior is not fully supported with dynamic size."
726
726
  ), e = Math.max(0, Math.min(e, this.options.count - 1)), this.currentScrollToIndex = e;
727
727
  let s = 0;
728
- const i = 10, a = (h) => {
728
+ const i = 10, a = (f) => {
729
729
  if (!this.targetWindow) return;
730
- const c = this.getOffsetForIndex(e, h);
731
- if (!c) {
730
+ const u = this.getOffsetForIndex(e, f);
731
+ if (!u) {
732
732
  console.warn("Failed to get offset for index:", e);
733
733
  return;
734
734
  }
735
- const [u, m] = c;
736
- this._scrollToOffset(u, { adjustments: void 0, behavior: n }), this.targetWindow.requestAnimationFrame(() => {
735
+ const [c, m] = u;
736
+ this._scrollToOffset(c, { adjustments: void 0, behavior: n }), this.targetWindow.requestAnimationFrame(() => {
737
737
  const g = () => {
738
738
  if (this.currentScrollToIndex !== e) return;
739
- const v = this.getScrollOffset(), y = this.getOffsetForIndex(e, m);
739
+ const p = this.getScrollOffset(), y = this.getOffsetForIndex(e, m);
740
740
  if (!y) {
741
741
  console.warn("Failed to get offset for index:", e);
742
742
  return;
743
743
  }
744
- On(y[0], v) || l(m);
744
+ On(y[0], p) || l(m);
745
745
  };
746
746
  this.isDynamicMode() ? this.targetWindow.requestAnimationFrame(g) : g();
747
747
  });
748
- }, l = (h) => {
749
- this.targetWindow && this.currentScrollToIndex === e && (s++, s < i ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", s, i), this.targetWindow.requestAnimationFrame(() => a(h))) : console.warn(
748
+ }, l = (f) => {
749
+ this.targetWindow && this.currentScrollToIndex === e && (s++, s < i ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", s, i), this.targetWindow.requestAnimationFrame(() => a(f))) : console.warn(
750
750
  `Failed to scroll to index ${e} after ${i} attempts.`
751
751
  ));
752
752
  };
@@ -789,7 +789,7 @@ class Mn {
789
789
  }, this.setOptions(o);
790
790
  }
791
791
  }
792
- const _t = (r, o, e, t) => {
792
+ const Ct = (r, o, e, t) => {
793
793
  for (; r <= o; ) {
794
794
  const n = (r + o) / 2 | 0, s = e(n);
795
795
  if (s < t)
@@ -813,7 +813,7 @@ function Pn({
813
813
  startIndex: 0,
814
814
  endIndex: n
815
815
  };
816
- let i = _t(
816
+ let i = Ct(
817
817
  0,
818
818
  n,
819
819
  s,
@@ -824,14 +824,14 @@ function Pn({
824
824
  a++;
825
825
  else if (t > 1) {
826
826
  const l = Array(t).fill(0);
827
- for (; a < n && l.some((c) => c < e + o); ) {
828
- const c = r[a];
829
- l[c.lane] = c.end, a++;
827
+ for (; a < n && l.some((u) => u < e + o); ) {
828
+ const u = r[a];
829
+ l[u.lane] = u.end, a++;
830
830
  }
831
- const h = Array(t).fill(e + o);
832
- for (; i >= 0 && h.some((c) => c >= e); ) {
833
- const c = r[i];
834
- h[c.lane] = c.start, i--;
831
+ const f = Array(t).fill(e + o);
832
+ for (; i >= 0 && f.some((u) => u >= e); ) {
833
+ const u = r[i];
834
+ f[u.lane] = u.start, i--;
835
835
  }
836
836
  i = Math.max(0, i - i % t), a = Math.min(n, a + (t - 1 - a % t));
837
837
  }
@@ -857,7 +857,7 @@ function zn(r) {
857
857
  return Dn({
858
858
  observeElementRect: jn,
859
859
  observeElementOffset: An,
860
- scrollToFn: Fn,
860
+ scrollToFn: Tn,
861
861
  ...r
862
862
  });
863
863
  }
@@ -958,7 +958,7 @@ const { Provider: $n, useStore: Nn } = Ce(
958
958
  pageSize: e,
959
959
  total: r.length
960
960
  })
961
- ), Ct = Be((r, o) => {
961
+ ), Et = Be((r, o) => {
962
962
  const {
963
963
  clearable: e = !0,
964
964
  combobox: t,
@@ -967,16 +967,16 @@ const { Provider: $n, useStore: Nn } = Ce(
967
967
  isFetching: i,
968
968
  label: a,
969
969
  leftSection: l,
970
- onBlur: h,
971
- onClear: c,
972
- onSearch: u,
970
+ onBlur: f,
971
+ onClear: u,
972
+ onSearch: c,
973
973
  placeholder: m,
974
974
  search: g
975
- } = r, v = i ? /* @__PURE__ */ d.jsx($t, { size: "xs" }) : g && e ? /* @__PURE__ */ d.jsx(
975
+ } = r, p = i ? /* @__PURE__ */ d.jsx(Nt, { size: "xs" }) : g && e ? /* @__PURE__ */ d.jsx(
976
976
  _e,
977
977
  {
978
978
  onClick: (y) => {
979
- y.stopPropagation(), c();
979
+ y.stopPropagation(), u();
980
980
  },
981
981
  size: "sm",
982
982
  variant: "subtle",
@@ -990,18 +990,18 @@ const { Provider: $n, useStore: Nn } = Ce(
990
990
  error: s,
991
991
  label: a,
992
992
  leftSection: l,
993
- onBlur: h,
994
- onChange: u,
993
+ onBlur: f,
994
+ onChange: c,
995
995
  onClick: () => t.openDropdown(),
996
996
  onFocus: () => t.openDropdown(),
997
997
  placeholder: m,
998
998
  ref: o,
999
- rightSection: v,
999
+ rightSection: p,
1000
1000
  value: g
1001
1001
  }
1002
1002
  );
1003
1003
  });
1004
- Ct.displayName = "BoxerTarget";
1004
+ Et.displayName = "BoxerTarget";
1005
1005
  const Ln = (r) => {
1006
1006
  const { boxerData: o, multiSelect: e, onOptionSubmit: t, value: n } = r;
1007
1007
  return { options: yt(() => o.map((i, a) => {
@@ -1015,7 +1015,7 @@ const Ln = (r) => {
1015
1015
  },
1016
1016
  value: String(a),
1017
1017
  children: e ? /* @__PURE__ */ d.jsxs("div", { style: { alignItems: "center", display: "flex", gap: "8px" }, children: [
1018
- /* @__PURE__ */ d.jsx(Nt, { checked: l, onChange: () => {
1018
+ /* @__PURE__ */ d.jsx(Lt, { checked: l, onChange: () => {
1019
1019
  }, tabIndex: -1 }),
1020
1020
  /* @__PURE__ */ d.jsx("span", { children: i.label })
1021
1021
  ] }) : i.label
@@ -1023,130 +1023,130 @@ const Ln = (r) => {
1023
1023
  `${i.value}-${a}`
1024
1024
  );
1025
1025
  }), [o, n, e, t]) };
1026
- }, Et = $.forwardRef((r, o) => {
1026
+ }, Ot = $.forwardRef((r, o) => {
1027
1027
  const e = U(null), t = U(null), n = U(null), s = U(null), {
1028
1028
  boxerData: i,
1029
1029
  clearable: a,
1030
1030
  comboBoxProps: l,
1031
- dropDownProps: h,
1032
- error: c,
1033
- fetchData: u,
1031
+ dropDownProps: f,
1032
+ error: u,
1033
+ fetchData: c,
1034
1034
  fetchMoreOnBottomReached: m,
1035
1035
  input: g,
1036
- isFetching: v,
1036
+ isFetching: p,
1037
1037
  label: y,
1038
1038
  mah: _,
1039
- multiSelect: x,
1040
- onBufferChange: C,
1039
+ multiSelect: C,
1040
+ onBufferChange: x,
1041
1041
  onChange: R,
1042
1042
  opened: O,
1043
1043
  openOnClear: N,
1044
1044
  placeholder: w,
1045
- scrollAreaProps: p,
1045
+ scrollAreaProps: S,
1046
1046
  search: E,
1047
1047
  selectedOptionIndex: D,
1048
1048
  selectFirst: L,
1049
- setInput: F,
1049
+ setInput: T,
1050
1050
  setOpened: M,
1051
1051
  setSearch: A,
1052
1052
  setSelectedOptionIndex: B,
1053
1053
  showAll: G,
1054
1054
  value: j
1055
- } = Nn((S) => ({
1056
- boxerData: S.boxerData,
1057
- clearable: S.clearable,
1058
- comboBoxProps: S.comboBoxProps,
1059
- dropDownProps: S.dropDownProps,
1060
- error: S.error,
1061
- fetchData: S.fetchData,
1062
- fetchMoreOnBottomReached: S.fetchMoreOnBottomReached,
1063
- input: S.input,
1064
- isFetching: S.isFetching,
1065
- label: S.label,
1066
- mah: S.mah,
1067
- multiSelect: S.multiSelect,
1068
- onBufferChange: S.onBufferChange,
1069
- onChange: S.onChange,
1070
- opened: S.opened,
1071
- openOnClear: S.openOnClear,
1072
- placeholder: S.placeholder,
1073
- scrollAreaProps: S.scrollAreaProps,
1074
- search: S.search,
1075
- selectedOptionIndex: S.selectedOptionIndex,
1076
- selectFirst: S.selectFirst,
1077
- setInput: S.setInput,
1078
- setOpened: S.setOpened,
1079
- setSearch: S.setSearch,
1080
- setSelectedOptionIndex: S.setSelectedOptionIndex,
1081
- showAll: S.showAll,
1082
- value: S.value
1055
+ } = Nn((v) => ({
1056
+ boxerData: v.boxerData,
1057
+ clearable: v.clearable,
1058
+ comboBoxProps: v.comboBoxProps,
1059
+ dropDownProps: v.dropDownProps,
1060
+ error: v.error,
1061
+ fetchData: v.fetchData,
1062
+ fetchMoreOnBottomReached: v.fetchMoreOnBottomReached,
1063
+ input: v.input,
1064
+ isFetching: v.isFetching,
1065
+ label: v.label,
1066
+ mah: v.mah,
1067
+ multiSelect: v.multiSelect,
1068
+ onBufferChange: v.onBufferChange,
1069
+ onChange: v.onChange,
1070
+ opened: v.opened,
1071
+ openOnClear: v.openOnClear,
1072
+ placeholder: v.placeholder,
1073
+ scrollAreaProps: v.scrollAreaProps,
1074
+ search: v.search,
1075
+ selectedOptionIndex: v.selectedOptionIndex,
1076
+ selectFirst: v.selectFirst,
1077
+ setInput: v.setInput,
1078
+ setOpened: v.setOpened,
1079
+ setSearch: v.setSearch,
1080
+ setSelectedOptionIndex: v.setSelectedOptionIndex,
1081
+ showAll: v.showAll,
1082
+ value: v.value
1083
1083
  })), J = i.length, Y = zn({
1084
1084
  count: J,
1085
1085
  estimateSize: () => 36,
1086
1086
  getScrollElement: () => e.current
1087
1087
  }), Z = Y.getVirtualItems(), q = oe(
1088
- (S) => {
1089
- const z = typeof S == "string" ? parseInt(S, 10) : S, P = i[z];
1088
+ (v) => {
1089
+ const z = typeof v == "string" ? parseInt(v, 10) : v, P = i[z];
1090
1090
  if (P)
1091
- if (x) {
1092
- const T = Array.isArray(j) ? j : [], se = T.includes(P.value) ? T.filter((Oe) => Oe !== P.value) : [...T, P.value];
1093
- R?.(se);
1094
- const Ee = i.filter((Oe) => se.includes(Oe.value));
1095
- C?.(Ee);
1091
+ if (C) {
1092
+ const F = Array.isArray(j) ? j : [], ie = F.includes(P.value) ? F.filter((Oe) => Oe !== P.value) : [...F, P.value];
1093
+ R?.(ie);
1094
+ const Ee = i.filter((Oe) => ie.includes(Oe.value));
1095
+ x?.(Ee);
1096
1096
  } else
1097
- R?.(P.value), A(""), F(P.label), n.current = P.value, M(!1);
1097
+ R?.(P.value), A(""), T(P.label), n.current = P.value, M(!1);
1098
1098
  },
1099
- [i, x, j, R, C, A, F, M]
1100
- ), f = oe(() => {
1101
- G && L ? q(0) : (R?.(x ? [] : null), A(""), F(""), t.current?.focus()), N && M(!0);
1102
- }, [G, L, x, R, A, F, N, M, q]), b = Lt({
1103
- getOptionId: (S) => String(S),
1099
+ [i, C, j, R, x, A, T, M]
1100
+ ), h = oe(() => {
1101
+ G && L ? q(0) : (R?.(C ? [] : null), A(""), T(""), t.current?.focus()), N && M(!0);
1102
+ }, [G, L, C, R, A, T, N, M, q]), b = Bt({
1103
+ getOptionId: (v) => String(v),
1104
1104
  onDropdownClose: () => {
1105
1105
  M(!1);
1106
1106
  },
1107
1107
  onDropdownOpen: () => {
1108
- (!j || x && (!Array.isArray(j) || j.length === 0)) && (A(""), F("")), b.selectFirstOption();
1108
+ (!j || C && (!Array.isArray(j) || j.length === 0)) && (A(""), T("")), b.selectFirstOption();
1109
1109
  },
1110
1110
  onSelectedOptionSubmit: q,
1111
1111
  opened: O,
1112
1112
  selectedOptionIndex: D,
1113
- setSelectedOptionIndex: (S) => {
1114
- B(S), S !== -1 && Y.scrollToIndex(S);
1113
+ setSelectedOptionIndex: (v) => {
1114
+ B(v), v !== -1 && Y.scrollToIndex(v);
1115
1115
  },
1116
1116
  totalOptionsCount: i.length
1117
1117
  }), { options: k } = Ln({
1118
1118
  boxerData: i,
1119
- multiSelect: x,
1119
+ multiSelect: C,
1120
1120
  onOptionSubmit: q,
1121
1121
  value: j
1122
1122
  });
1123
1123
  return I(() => {
1124
- u("", !0);
1124
+ c("", !0);
1125
1125
  }, []), I(() => {
1126
- const S = setTimeout(() => {
1127
- E !== void 0 && O && u(E, !0);
1126
+ const v = setTimeout(() => {
1127
+ E !== void 0 && O && c(E, !0);
1128
1128
  }, 300);
1129
- return () => clearTimeout(S);
1129
+ return () => clearTimeout(v);
1130
1130
  }, [E, O]), I(() => {
1131
- if (x) {
1132
- const S = i.filter((z) => Array.isArray(j) && j.includes(z.value)).map((z) => z.label).join(", ");
1133
- !O && g !== S && (F(S), A(""));
1131
+ if (C) {
1132
+ const v = i.filter((z) => Array.isArray(j) && j.includes(z.value)).map((z) => z.label).join(", ");
1133
+ !O && g !== v && (T(v), A(""));
1134
1134
  } else {
1135
- const S = i.find((z) => z.value === j)?.label;
1136
- g !== S && (E ?? "") === "" && n.current !== j && j ? F(S ?? "") : !j && !n.current && (E ?? "") === "" && (A(""), F(""));
1135
+ const v = i.find((z) => z.value === j)?.label;
1136
+ g !== v && (E ?? "") === "" && n.current !== j && j ? T(v ?? "") : !j && !n.current && (E ?? "") === "" && (A(""), T(""));
1137
1137
  }
1138
- if (x) {
1139
- const S = i.filter((z) => Array.isArray(j) && j.includes(z.value)) ?? [];
1140
- JSON.stringify(s.current) !== JSON.stringify(S) && (C?.(S), s.current = S);
1138
+ if (C) {
1139
+ const v = i.filter((z) => Array.isArray(j) && j.includes(z.value)) ?? [];
1140
+ JSON.stringify(s.current) !== JSON.stringify(v) && (x?.(v), s.current = v);
1141
1141
  } else {
1142
- const S = i?.find((z) => z.value === j) ?? null;
1143
- s.current?.value !== S?.value && (C?.(S), s.current = S);
1142
+ const v = i?.find((z) => z.value === j) ?? null;
1143
+ s.current?.value !== v?.value && (x?.(v), s.current = v);
1144
1144
  }
1145
- }, [j, i, g, E, x, O, C, F, A]), I(() => {
1146
- L && (i?.length ?? 0) > 0 && !x && (j || q?.(0));
1147
- }, [L, i, x]), Ge(o, () => ({
1145
+ }, [j, i, g, E, C, O, x, T, A]), I(() => {
1146
+ L && (i?.length ?? 0) > 0 && !C && (j || q?.(0));
1147
+ }, [L, i, C]), Ge(o, () => ({
1148
1148
  clear: () => {
1149
- f();
1149
+ h();
1150
1150
  },
1151
1151
  close: () => {
1152
1152
  M(!1), b.closeDropdown();
@@ -1158,8 +1158,8 @@ const Ln = (r) => {
1158
1158
  open: () => {
1159
1159
  M(!0), b.openDropdown();
1160
1160
  },
1161
- setValue: (S) => {
1162
- R?.(S);
1161
+ setValue: (v) => {
1162
+ R?.(v);
1163
1163
  }
1164
1164
  })), /* @__PURE__ */ d.jsxs(
1165
1165
  te,
@@ -1170,19 +1170,19 @@ const Ln = (r) => {
1170
1170
  withinPortal: !0,
1171
1171
  children: [
1172
1172
  /* @__PURE__ */ d.jsx(te.Target, { children: /* @__PURE__ */ d.jsx(te.EventsTarget, { children: /* @__PURE__ */ d.jsx(
1173
- Ct,
1173
+ Et,
1174
1174
  {
1175
1175
  clearable: a,
1176
1176
  combobox: b,
1177
- error: c,
1178
- isFetching: v,
1177
+ error: u,
1178
+ isFetching: p,
1179
1179
  label: y,
1180
1180
  onBlur: () => {
1181
- !j && !x && (A(""), F(""), b.closeDropdown(), M(!1));
1181
+ !j && !C && (A(""), T(""), b.closeDropdown(), M(!1));
1182
1182
  },
1183
- onClear: f,
1184
- onSearch: (S) => {
1185
- A(S.currentTarget.value), F(S.currentTarget.value), M(!0);
1183
+ onClear: h,
1184
+ onSearch: (v) => {
1185
+ A(v.currentTarget.value), T(v.currentTarget.value), M(!0);
1186
1186
  },
1187
1187
  placeholder: w,
1188
1188
  ref: t,
@@ -1196,16 +1196,16 @@ const Ln = (r) => {
1196
1196
  t.current && (t.current.value = "", t.current?.focus());
1197
1197
  },
1198
1198
  p: 2,
1199
- ...h,
1199
+ ...f,
1200
1200
  children: O && k.length > 0 ? /* @__PURE__ */ d.jsx(te.Options, { children: /* @__PURE__ */ d.jsx(
1201
- Bt.Autosize,
1201
+ Gt.Autosize,
1202
1202
  {
1203
- ...p,
1203
+ ...S,
1204
1204
  mah: _ ?? 200,
1205
1205
  viewportProps: {
1206
- ...p?.viewportProps,
1207
- onScroll: (S) => {
1208
- m(S.currentTarget);
1206
+ ...S?.viewportProps,
1207
+ onScroll: (v) => {
1208
+ m(v.currentTarget);
1209
1209
  },
1210
1210
  style: { border: "1px solid gray", borderRadius: 4 }
1211
1211
  },
@@ -1228,14 +1228,14 @@ const Ln = (r) => {
1228
1228
  transform: `translateY(${Z[0]?.start ?? 0}px)`,
1229
1229
  width: "100%"
1230
1230
  },
1231
- children: Z.map((S) => /* @__PURE__ */ d.jsx(
1231
+ children: Z.map((v) => /* @__PURE__ */ d.jsx(
1232
1232
  "div",
1233
1233
  {
1234
- "data-index": S.index,
1234
+ "data-index": v.index,
1235
1235
  ref: Y.measureElement,
1236
- children: k[S.index]
1236
+ children: k[v.index]
1237
1237
  },
1238
- S.key
1238
+ v.key
1239
1239
  ))
1240
1240
  }
1241
1241
  )
@@ -1249,8 +1249,8 @@ const Ln = (r) => {
1249
1249
  }
1250
1250
  );
1251
1251
  });
1252
- Et.displayName = "BoxerInner";
1253
- const Bn = $.forwardRef((r, o) => /* @__PURE__ */ d.jsx($n, { ...r, children: /* @__PURE__ */ d.jsx(Et, { ref: o }) }));
1252
+ Ot.displayName = "BoxerInner";
1253
+ const Bn = $.forwardRef((r, o) => /* @__PURE__ */ d.jsx($n, { ...r, children: /* @__PURE__ */ d.jsx(Ot, { ref: o }) }));
1254
1254
  Bn.displayName = "Boxer";
1255
1255
  class Gn {
1256
1256
  config = { enabled: !0 };
@@ -1513,7 +1513,7 @@ class so extends $.Component {
1513
1513
  )
1514
1514
  ] }),
1515
1515
  this.state.error && /* @__PURE__ */ d.jsxs(
1516
- Gt,
1516
+ Vt,
1517
1517
  {
1518
1518
  p: "md",
1519
1519
  shadow: "xs",
@@ -1531,7 +1531,7 @@ class so extends $.Component {
1531
1531
  ]
1532
1532
  }
1533
1533
  ),
1534
- /* @__PURE__ */ d.jsx(Vt, { in: this.state.showDetail, children: /* @__PURE__ */ d.jsx(qt, { block: !0, color: "rgba(235, 86, 5, 0.6)", mah: "100vh", w: "100%", children: this.state.errorInfo.componentStack }) })
1534
+ /* @__PURE__ */ d.jsx(qt, { in: this.state.showDetail, children: /* @__PURE__ */ d.jsx(Ht, { block: !0, color: "rgba(235, 86, 5, 0.6)", mah: "100vh", w: "100%", children: this.state.errorInfo.componentStack }) })
1535
1535
  ] });
1536
1536
  if (this.state.try) {
1537
1537
  if (!this.state.timer) {
@@ -1597,6 +1597,7 @@ class so extends $.Component {
1597
1597
  }
1598
1598
  const { Provider: qn, useStore: me } = Ce(
1599
1599
  (r, o) => ({
1600
+ getAllState: () => o(),
1600
1601
  getState: (e) => o()?.[e],
1601
1602
  load: async (e) => {
1602
1603
  try {
@@ -1609,11 +1610,12 @@ const { Provider: qn, useStore: me } = Ce(
1609
1610
  o().values,
1610
1611
  n
1611
1612
  );
1612
- o().afterGet && (s = await o().afterGet({ ...s })), r({ loading: !1, values: s }), o().onChange?.(s);
1613
+ o().afterGet && (s = await o().afterGet({ ...s }, o())), r({ loading: !1, values: s }), o().onChange?.(s, o());
1613
1614
  }
1614
1615
  e && o().getFormMethods && o().getFormMethods().reset();
1615
1616
  } catch (t) {
1616
- r({ error: t?.message ?? t, loading: !1 });
1617
+ const n = t?.message ?? t;
1618
+ r({ error: n, loading: !1 }), o().onError?.(n, o());
1617
1619
  }
1618
1620
  r({ loading: !1 });
1619
1621
  },
@@ -1631,14 +1633,15 @@ const { Provider: qn, useStore: me } = Ce(
1631
1633
  if (r({ loading: !0 }), o().getFormMethods) {
1632
1634
  const n = o().getFormMethods();
1633
1635
  let s = n.getValues();
1634
- o().beforeSave && (s = await o().beforeSave(s));
1636
+ o().beforeSave && (s = await o().beforeSave(s, o()));
1635
1637
  let i = !1;
1636
1638
  if (await n.handleSubmit(
1637
1639
  (l) => {
1638
1640
  s = l;
1639
1641
  },
1640
1642
  (l) => {
1641
- r({ error: l.root?.message || "Validation errors", loading: !1 }), i = !0;
1643
+ const f = l.root?.message || "Validation errors";
1644
+ r({ error: f, loading: !1 }), o().onError?.(f, o()), i = !0;
1642
1645
  }
1643
1646
  )(e), i) {
1644
1647
  r({ loading: !1 });
@@ -1649,18 +1652,27 @@ const { Provider: qn, useStore: me } = Ce(
1649
1652
  return;
1650
1653
  }
1651
1654
  if (o().onAPICall) {
1652
- const l = o()?.uniqueKeyField || "id", h = o().values?.[l] ?? o().primeData?.[l], c = await o().onAPICall(
1655
+ const l = o()?.uniqueKeyField || "id", f = o().values?.[l] ?? o().primeData?.[l], u = await o().onAPICall(
1653
1656
  "mutate",
1654
1657
  o().request || "insert",
1655
1658
  s,
1656
- h
1657
- );
1658
- return o().afterSave && await o().afterSave(c), r({ loading: !1, values: c }), o().onChange?.(c), n.reset(c), t || o().onClose?.(c), c;
1659
+ f
1660
+ ), c = { ...s, ...u };
1661
+ if (o().afterSave && await o().afterSave(c, o()), t) {
1662
+ const m = o()?.uniqueKeyField || "id", g = { ...c };
1663
+ return delete g[m], r({ loading: !1, values: g }), o().onChange?.(g, o()), n.reset(g), c;
1664
+ }
1665
+ return r({ loading: !1, values: c }), o().onChange?.(c, o()), n.reset(c), o().onClose?.(c), c;
1666
+ }
1667
+ if (t) {
1668
+ const l = o()?.uniqueKeyField || "id", f = { ...s };
1669
+ return delete f[l], r({ loading: !1, values: f }), n.reset(f), o().onChange?.(f, o()), s;
1659
1670
  }
1660
- return r({ loading: !1, values: s }), n.reset(s), o().onChange?.(s), t || o().onClose?.(s), s;
1671
+ return r({ loading: !1, values: s }), n.reset(s), o().onChange?.(s, o()), o().onClose?.(s), s;
1661
1672
  }
1662
1673
  } catch (t) {
1663
- r({ error: t?.message ?? t, loading: !1 });
1674
+ const n = t?.message ?? t;
1675
+ r({ error: n, loading: !1 }), o().onError?.(n, o());
1664
1676
  }
1665
1677
  },
1666
1678
  setRequest: (e) => {
@@ -1690,9 +1702,9 @@ const { Provider: qn, useStore: me } = Ce(
1690
1702
  let a = e;
1691
1703
  return e || (a = async () => confirm("Are you sure you want to delete this item?")), {
1692
1704
  id: r || gn(),
1693
- onClose: () => {
1694
- const l = s.getState().dirty, h = s.getState().setState;
1695
- l ? confirm("You have unsaved changes. Are you sure you want to close?") && (o ? o() : h("opened", !1)) : o ? o() : h("opened", !1);
1705
+ onClose: (l) => {
1706
+ const f = s.getState().dirty, u = s.getState().setState;
1707
+ f ? confirm("You have unsaved changes. Are you sure you want to close?") && (o ? o(l) : u("opened", !1)) : o ? o(l) : u("opened", !1);
1696
1708
  },
1697
1709
  onConfirmDelete: a,
1698
1710
  primeData: t,
@@ -1706,22 +1718,30 @@ const { Provider: qn, useStore: me } = Ce(
1706
1718
  closeButtonProps: o,
1707
1719
  closeButtonTitle: e,
1708
1720
  dirty: t,
1709
- onClose: n,
1710
- request: s,
1711
- save: i,
1712
- saveButtonProps: a,
1713
- saveButtonTitle: l
1714
- } = me((c) => ({
1715
- buttonAreaGroupProps: c.layout?.buttonAreaGroupProps,
1716
- closeButtonProps: c.layout?.closeButtonProps,
1717
- closeButtonTitle: c.layout?.closeButtonTitle,
1718
- dirty: c.dirty,
1719
- onClose: c.onClose,
1720
- request: c.request,
1721
- save: c.save,
1722
- saveButtonProps: c.layout?.saveButtonProps,
1723
- saveButtonTitle: c.layout?.saveButtonTitle
1724
- })), h = ["select", "view"].includes(s || "") || ["update"].includes(s || "") && !t;
1721
+ getState: n,
1722
+ keepOpen: s,
1723
+ onClose: i,
1724
+ request: a,
1725
+ save: l,
1726
+ saveButtonProps: f,
1727
+ saveButtonTitle: u,
1728
+ setState: c,
1729
+ showKeepOpenSwitch: m
1730
+ } = me((p) => ({
1731
+ buttonAreaGroupProps: p.layout?.buttonAreaGroupProps,
1732
+ closeButtonProps: p.layout?.closeButtonProps,
1733
+ closeButtonTitle: p.layout?.closeButtonTitle,
1734
+ dirty: p.dirty,
1735
+ getState: p.getState,
1736
+ keepOpen: p.keepOpen,
1737
+ onClose: p.onClose,
1738
+ request: p.request,
1739
+ save: p.save,
1740
+ saveButtonProps: p.layout?.saveButtonProps,
1741
+ saveButtonTitle: p.layout?.saveButtonTitle,
1742
+ setState: p.setState,
1743
+ showKeepOpenSwitch: p.layout?.showKeepOpenSwitch
1744
+ })), g = ["select", "view"].includes(a || "") || ["update"].includes(a || "") && !t;
1725
1745
  return /* @__PURE__ */ d.jsx(
1726
1746
  we,
1727
1747
  {
@@ -1731,7 +1751,7 @@ const { Provider: qn, useStore: me } = Ce(
1731
1751
  w: "100%",
1732
1752
  ...r,
1733
1753
  children: /* @__PURE__ */ d.jsxs(we, { grow: !0, justify: "space-evenly", children: [
1734
- typeof n == "function" && /* @__PURE__ */ d.jsx(
1754
+ typeof i == "function" && /* @__PURE__ */ d.jsx(
1735
1755
  re,
1736
1756
  {
1737
1757
  color: "orange",
@@ -1741,15 +1761,23 @@ const { Provider: qn, useStore: me } = Ce(
1741
1761
  size: "sm",
1742
1762
  ...o,
1743
1763
  onClick: () => {
1744
- n();
1764
+ i(n("values"));
1745
1765
  },
1746
1766
  children: e || "Close"
1747
1767
  }
1748
1768
  ),
1769
+ m && /* @__PURE__ */ d.jsx(
1770
+ wt,
1771
+ {
1772
+ checked: s,
1773
+ label: "Keep Open",
1774
+ onChange: (p) => c("keepOpen", p.currentTarget.checked)
1775
+ }
1776
+ ),
1749
1777
  /* @__PURE__ */ d.jsx(
1750
1778
  Q,
1751
1779
  {
1752
- label: h ? /* @__PURE__ */ d.jsxs("p", { children: [
1780
+ label: g ? /* @__PURE__ */ d.jsxs("p", { children: [
1753
1781
  "Cannot save in view or select mode, or no changes made. ",
1754
1782
  /* @__PURE__ */ d.jsx("br", {}),
1755
1783
  "Try changing some values."
@@ -1757,16 +1785,16 @@ const { Provider: qn, useStore: me } = Ce(
1757
1785
  children: /* @__PURE__ */ d.jsx(
1758
1786
  re,
1759
1787
  {
1760
- bg: s === "delete" ? "red" : void 0,
1788
+ bg: a === "delete" ? "red" : void 0,
1761
1789
  color: "green",
1762
1790
  leftSection: /* @__PURE__ */ d.jsx(ln, {}),
1763
1791
  miw: "8rem",
1764
1792
  px: "md",
1765
1793
  size: "sm",
1766
- ...a,
1767
- disabled: h,
1768
- onClick: () => i(),
1769
- children: l || "Save"
1794
+ ...f,
1795
+ disabled: g,
1796
+ onClick: () => l(),
1797
+ children: u || "Save"
1770
1798
  }
1771
1799
  )
1772
1800
  }
@@ -1822,9 +1850,9 @@ const { Provider: qn, useStore: me } = Ce(
1822
1850
  loadingOverlayProps: i,
1823
1851
  opened: a,
1824
1852
  request: l,
1825
- reset: h,
1826
- save: c,
1827
- scrollAreaProps: u
1853
+ reset: f,
1854
+ save: u,
1855
+ scrollAreaProps: c
1828
1856
  } = me((m) => ({
1829
1857
  disableHTMlForm: m.disableHTMlForm,
1830
1858
  getFormMethods: m.getFormMethods,
@@ -1843,17 +1871,17 @@ const { Provider: qn, useStore: me } = Ce(
1843
1871
  }, [e, l, a]), /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
1844
1872
  /* @__PURE__ */ d.jsx(Wn, {}),
1845
1873
  /* @__PURE__ */ d.jsxs(
1846
- Ht,
1874
+ Wt,
1847
1875
  {
1848
1876
  offsetScrollbars: !0,
1849
1877
  scrollbarSize: 4,
1850
1878
  type: "auto",
1851
- ...u,
1879
+ ...c,
1852
1880
  style: {
1853
1881
  height: "100%",
1854
1882
  padding: "0.25rem",
1855
1883
  width: "100%",
1856
- ...u?.style
1884
+ ...c?.style
1857
1885
  },
1858
1886
  children: [
1859
1887
  o ? (
@@ -1863,15 +1891,15 @@ const { Provider: qn, useStore: me } = Ce(
1863
1891
  "form",
1864
1892
  {
1865
1893
  id: `former_f${t}`,
1866
- onReset: (m) => h(m),
1867
- onSubmit: (m) => c(m),
1894
+ onReset: (m) => f(m),
1895
+ onSubmit: (m) => u(m),
1868
1896
  "x-data-request": l,
1869
1897
  children: r.children
1870
1898
  },
1871
1899
  `former_${t}`
1872
1900
  ),
1873
1901
  /* @__PURE__ */ d.jsx(
1874
- Wt,
1902
+ Kt,
1875
1903
  {
1876
1904
  loaderProps: { type: "bars" },
1877
1905
  overlayProps: {
@@ -1889,20 +1917,22 @@ const { Provider: qn, useStore: me } = Ce(
1889
1917
  }, Kn = Be(
1890
1918
  function(o, e) {
1891
1919
  const {
1892
- getState: t,
1893
- onChange: n,
1894
- onClose: s,
1895
- onOpen: i,
1896
- opened: a,
1897
- primeData: l,
1898
- reset: h,
1920
+ getAllState: t,
1921
+ getState: n,
1922
+ onChange: s,
1923
+ onClose: i,
1924
+ onOpen: a,
1925
+ opened: l,
1926
+ primeData: f,
1927
+ reset: u,
1899
1928
  save: c,
1900
- setState: u,
1901
- useFormProps: m,
1902
- validate: g,
1903
- values: v,
1904
- wrapper: y
1929
+ setState: m,
1930
+ useFormProps: g,
1931
+ validate: p,
1932
+ values: y,
1933
+ wrapper: _
1905
1934
  } = me((x) => ({
1935
+ getAllState: x.getAllState,
1906
1936
  getState: x.getState,
1907
1937
  onChange: x.onChange,
1908
1938
  onClose: x.onClose,
@@ -1916,45 +1946,51 @@ const { Provider: qn, useStore: me } = Ce(
1916
1946
  validate: x.validate,
1917
1947
  values: x.values,
1918
1948
  wrapper: x.wrapper
1919
- })), _ = hn({
1920
- defaultValues: l,
1949
+ })), C = hn({
1950
+ defaultValues: f,
1921
1951
  mode: "all",
1922
1952
  shouldUseNativeValidation: !0,
1923
- values: v,
1924
- ...m
1953
+ values: y,
1954
+ ...g
1925
1955
  });
1926
1956
  return Ge(
1927
1957
  e,
1928
1958
  () => ({
1929
1959
  close: async () => {
1930
- s?.(), u("opened", !1);
1960
+ i?.(n("values")), m("opened", !1);
1931
1961
  },
1932
- getValue: () => t("values"),
1962
+ getValue: () => n("values"),
1933
1963
  reset: () => {
1934
- h();
1964
+ u();
1935
1965
  },
1936
1966
  save: async () => await c(),
1937
1967
  setValue: (x) => {
1938
- n?.(x);
1968
+ s?.(x, t());
1939
1969
  },
1940
1970
  show: async () => {
1941
- u("opened", !0), i?.();
1971
+ m("opened", !0), a?.();
1942
1972
  },
1943
- validate: async () => await g()
1973
+ validate: async () => await p()
1944
1974
  }),
1945
- [t, n, g, c, h, u, s, i]
1975
+ [n, t, s, p, c, u, m, i, a]
1946
1976
  ), I(() => {
1947
- u("getFormMethods", () => _), _ && _.subscribe({
1977
+ m("getFormMethods", () => C), C && C.subscribe({
1948
1978
  callback: ({ isDirty: x }) => {
1949
- u("dirty", x);
1979
+ m("dirty", x);
1950
1980
  },
1951
1981
  formState: { isDirty: !0 }
1952
1982
  });
1953
- }, [_]), /* @__PURE__ */ d.jsx(mn, { ..._, children: typeof y == "function" ? y(/* @__PURE__ */ d.jsx(st, { children: o.children }), a ?? !1, s ?? (() => {
1954
- u("opened", !1);
1955
- }), i ?? (() => {
1956
- u("opened", !0);
1957
- }), t) : /* @__PURE__ */ d.jsx(st, { children: o.children || null }) });
1983
+ }, [C]), /* @__PURE__ */ d.jsx(mn, { ...C, children: typeof _ == "function" ? _(
1984
+ /* @__PURE__ */ d.jsx(st, { children: o.children }),
1985
+ l ?? !1,
1986
+ i ?? (() => {
1987
+ m("opened", !1);
1988
+ }),
1989
+ a ?? (() => {
1990
+ m("opened", !0);
1991
+ }),
1992
+ n
1993
+ ) : /* @__PURE__ */ d.jsx(st, { children: o.children || null }) });
1958
1994
  }
1959
1995
  ), He = Be(
1960
1996
  function(o, e) {
@@ -1980,10 +2016,12 @@ function io(r) {
1980
2016
  ...r.fetchOptions?.headers
1981
2017
  },
1982
2018
  method: "POST"
1983
- }, h = await fetch(i, l);
1984
- if (!h.ok)
1985
- throw new Error(`API request failed with status ${h.status}`);
1986
- return await h.json();
2019
+ }, f = await fetch(i, l);
2020
+ if (!f.ok) {
2021
+ const c = await f.text();
2022
+ throw c && c.length > 4 ? new Error(`${c}`) : new Error(`API request failed with status ${f.status}`);
2023
+ }
2024
+ return await f.json();
1987
2025
  };
1988
2026
  }
1989
2027
  function ao(r) {
@@ -2004,8 +2042,10 @@ function ao(r) {
2004
2042
  };
2005
2043
  e !== "insert" && (i = `${s}/${n}`);
2006
2044
  const l = await fetch(i, a);
2007
- if (!l.ok)
2008
- throw new Error(`API request failed with status ${l.status}`);
2045
+ if (!l.ok) {
2046
+ const u = await l.text();
2047
+ throw u && u.length > 4 ? new Error(`${u}`) : new Error(`API request failed with status ${l.status}`);
2048
+ }
2009
2049
  return await l.json();
2010
2050
  };
2011
2051
  }
@@ -2017,14 +2057,14 @@ const lo = (r) => {
2017
2057
  ...e,
2018
2058
  onClose: t,
2019
2059
  opened: n,
2020
- wrapper: (i, a, l, h, c) => {
2021
- const u = c("values"), m = c("request"), g = c("uniqueKeyField") ?? "id";
2060
+ wrapper: (i, a, l, f, u) => {
2061
+ const c = u("values"), m = u("request"), g = u("uniqueKeyField") ?? "id";
2022
2062
  return /* @__PURE__ */ d.jsx(
2023
- Kt,
2063
+ Ut,
2024
2064
  {
2025
2065
  closeOnClickOutside: !1,
2026
2066
  h: "100%",
2027
- title: m === "delete" ? `Delete Record - ${u?.[g]}` : m === "insert" ? "New Record" : `Edit Record - ${u?.[g]}`,
2067
+ title: m === "delete" ? `Delete Record - ${c?.[g]}` : m === "insert" ? "New Record" : `Edit Record - ${c?.[g]}`,
2028
2068
  ...s,
2029
2069
  onClose: () => l?.(),
2030
2070
  opened: a ?? !1,
@@ -2043,14 +2083,14 @@ const lo = (r) => {
2043
2083
  ...e,
2044
2084
  onClose: t,
2045
2085
  opened: n,
2046
- wrapper: (i, a, l, h, c) => {
2047
- const u = c("values"), m = c("request"), g = c("uniqueKeyField") ?? "id";
2086
+ wrapper: (i, a, l, f, u) => {
2087
+ const c = u("values"), m = u("request"), g = u("uniqueKeyField") ?? "id";
2048
2088
  return /* @__PURE__ */ d.jsx(
2049
- Ut,
2089
+ Jt,
2050
2090
  {
2051
2091
  closeOnClickOutside: !1,
2052
2092
  h: "100%",
2053
- title: m === "delete" ? `Delete Record - ${u?.[g]}` : m === "insert" ? "New Record" : `Edit Record - ${u?.[g]}`,
2093
+ title: m === "delete" ? `Delete Record - ${c?.[g]}` : m === "insert" ? "New Record" : `Edit Record - ${c?.[g]}`,
2054
2094
  ...s,
2055
2095
  onClose: () => l?.(),
2056
2096
  opened: a ?? !1,
@@ -2069,7 +2109,7 @@ const lo = (r) => {
2069
2109
  ...e,
2070
2110
  onClose: t,
2071
2111
  opened: n,
2072
- wrapper: (a, l, h) => /* @__PURE__ */ d.jsxs(
2112
+ wrapper: (a, l, f) => /* @__PURE__ */ d.jsxs(
2073
2113
  Re,
2074
2114
  {
2075
2115
  closeOnClickOutside: !1,
@@ -2078,7 +2118,7 @@ const lo = (r) => {
2078
2118
  width: 250,
2079
2119
  withArrow: !0,
2080
2120
  ...i,
2081
- onClose: () => h?.(),
2121
+ onClose: () => f?.(),
2082
2122
  opened: l ?? !1,
2083
2123
  children: [
2084
2124
  /* @__PURE__ */ d.jsx(Re.Target, { children: s }),
@@ -2090,7 +2130,26 @@ const lo = (r) => {
2090
2130
  }
2091
2131
  );
2092
2132
  }, fo = (r) => {
2093
- const [o, e] = le(!1);
2133
+ const [o, e] = se({
2134
+ onChange: r?.onChange,
2135
+ onClose: r?.onClose ?? (() => e((l) => ({ ...l, opened: !1 }))),
2136
+ opened: r?.opened ?? !1,
2137
+ primeData: r?.primeData ?? r?.values,
2138
+ request: r?.request ?? "insert",
2139
+ values: r?.values
2140
+ }), t = (l) => {
2141
+ e((f) => ({ ...f, ...l }));
2142
+ }, { onChange: n, onClose: s, opened: i, ...a } = o;
2143
+ return {
2144
+ former: { ...a, onChange: n, onClose: s, opened: i },
2145
+ formerWrapper: { onClose: s, opened: i },
2146
+ open: (l, f) => {
2147
+ e((u) => ({ ...u, opened: !0, primeData: f, request: l, values: f }));
2148
+ },
2149
+ updateState: t
2150
+ };
2151
+ }, ho = (r) => {
2152
+ const [o, e] = se(!1);
2094
2153
  return /* @__PURE__ */ d.jsx(Q, { label: r.tooltip ?? "", withArrow: !0, children: /* @__PURE__ */ d.jsx(
2095
2154
  re,
2096
2155
  {
@@ -2105,8 +2164,8 @@ const lo = (r) => {
2105
2164
  children: r.children
2106
2165
  }
2107
2166
  ) });
2108
- }, ho = (r) => {
2109
- const [o, e] = le(!1);
2167
+ }, mo = (r) => {
2168
+ const [o, e] = se(!1);
2110
2169
  return /* @__PURE__ */ d.jsx(Q, { label: r.tooltip ?? "", withArrow: !0, children: /* @__PURE__ */ d.jsxs(
2111
2170
  _e,
2112
2171
  {
@@ -2120,14 +2179,14 @@ const lo = (r) => {
2120
2179
  },
2121
2180
  children: [
2122
2181
  r.children,
2123
- /* @__PURE__ */ d.jsxs(Jt, { children: [
2182
+ /* @__PURE__ */ d.jsxs(Yt, { children: [
2124
2183
  "Action Button: ",
2125
2184
  r.tooltip ?? r.sid ?? ""
2126
2185
  ] })
2127
2186
  ]
2128
2187
  }
2129
2188
  ) });
2130
- }, mo = (r) => {
2189
+ }, go = (r) => {
2131
2190
  const { control: o, name: e, sid: t, tooltip: n, ...s } = r;
2132
2191
  return /* @__PURE__ */ d.jsx(
2133
2192
  he,
@@ -2135,7 +2194,7 @@ const lo = (r) => {
2135
2194
  control: o,
2136
2195
  name: e,
2137
2196
  render: ({ field: i, formState: a }) => /* @__PURE__ */ d.jsx(Q, { label: n ?? "", withArrow: !0, children: /* @__PURE__ */ ce(
2138
- Yt,
2197
+ Xt,
2139
2198
  {
2140
2199
  ...s,
2141
2200
  ...i,
@@ -2147,7 +2206,7 @@ const lo = (r) => {
2147
2206
  ) })
2148
2207
  }
2149
2208
  );
2150
- }, go = (r) => {
2209
+ }, po = (r) => {
2151
2210
  const { control: o, name: e, sid: t, tooltip: n, ...s } = r;
2152
2211
  return /* @__PURE__ */ d.jsx(
2153
2212
  he,
@@ -2155,7 +2214,7 @@ const lo = (r) => {
2155
2214
  control: o,
2156
2215
  name: e,
2157
2216
  render: ({ field: i, formState: a }) => /* @__PURE__ */ d.jsx(Q, { label: n ?? "", withArrow: !0, children: /* @__PURE__ */ ce(
2158
- Xt,
2217
+ Qt,
2159
2218
  {
2160
2219
  ...s,
2161
2220
  ...i,
@@ -2167,7 +2226,7 @@ const lo = (r) => {
2167
2226
  ) })
2168
2227
  }
2169
2228
  );
2170
- }, po = (r) => {
2229
+ }, So = (r) => {
2171
2230
  const { control: o, name: e, sid: t, tooltip: n, ...s } = r;
2172
2231
  return /* @__PURE__ */ d.jsx(
2173
2232
  he,
@@ -2175,7 +2234,7 @@ const lo = (r) => {
2175
2234
  control: o,
2176
2235
  name: e,
2177
2236
  render: ({ field: i, formState: a }) => /* @__PURE__ */ d.jsx(Q, { label: n ?? "", withArrow: !0, children: /* @__PURE__ */ ce(
2178
- Qt,
2237
+ wt,
2179
2238
  {
2180
2239
  ...s,
2181
2240
  ...i,
@@ -2190,7 +2249,7 @@ const lo = (r) => {
2190
2249
  ) })
2191
2250
  }
2192
2251
  );
2193
- }, So = (r) => {
2252
+ }, vo = (r) => {
2194
2253
  const { control: o, name: e, sid: t, tooltip: n, ...s } = r;
2195
2254
  return /* @__PURE__ */ d.jsx(
2196
2255
  he,
@@ -2211,7 +2270,7 @@ const lo = (r) => {
2211
2270
  ) })
2212
2271
  }
2213
2272
  );
2214
- }, vo = (r) => {
2273
+ }, yo = (r) => {
2215
2274
  const { control: o, name: e, sid: t, tooltip: n, ...s } = r;
2216
2275
  return /* @__PURE__ */ d.jsx(
2217
2276
  he,
@@ -2264,143 +2323,143 @@ function Yn() {
2264
2323
  if (ct) return Ae;
2265
2324
  ct = 1;
2266
2325
  var r = $;
2267
- function o(u, m) {
2268
- return u === m && (u !== 0 || 1 / u === 1 / m) || u !== u && m !== m;
2326
+ function o(c, m) {
2327
+ return c === m && (c !== 0 || 1 / c === 1 / m) || c !== c && m !== m;
2269
2328
  }
2270
2329
  var e = typeof Object.is == "function" ? Object.is : o, t = r.useState, n = r.useEffect, s = r.useLayoutEffect, i = r.useDebugValue;
2271
- function a(u, m) {
2272
- var g = m(), v = t({ inst: { value: g, getSnapshot: m } }), y = v[0].inst, _ = v[1];
2330
+ function a(c, m) {
2331
+ var g = m(), p = t({ inst: { value: g, getSnapshot: m } }), y = p[0].inst, _ = p[1];
2273
2332
  return s(
2274
2333
  function() {
2275
2334
  y.value = g, y.getSnapshot = m, l(y) && _({ inst: y });
2276
2335
  },
2277
- [u, g, m]
2336
+ [c, g, m]
2278
2337
  ), n(
2279
2338
  function() {
2280
- return l(y) && _({ inst: y }), u(function() {
2339
+ return l(y) && _({ inst: y }), c(function() {
2281
2340
  l(y) && _({ inst: y });
2282
2341
  });
2283
2342
  },
2284
- [u]
2343
+ [c]
2285
2344
  ), i(g), g;
2286
2345
  }
2287
- function l(u) {
2288
- var m = u.getSnapshot;
2289
- u = u.value;
2346
+ function l(c) {
2347
+ var m = c.getSnapshot;
2348
+ c = c.value;
2290
2349
  try {
2291
2350
  var g = m();
2292
- return !e(u, g);
2351
+ return !e(c, g);
2293
2352
  } catch {
2294
2353
  return !0;
2295
2354
  }
2296
2355
  }
2297
- function h(u, m) {
2356
+ function f(c, m) {
2298
2357
  return m();
2299
2358
  }
2300
- var c = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? h : a;
2301
- return Ae.useSyncExternalStore = r.useSyncExternalStore !== void 0 ? r.useSyncExternalStore : c, Ae;
2359
+ var u = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? f : a;
2360
+ return Ae.useSyncExternalStore = r.useSyncExternalStore !== void 0 ? r.useSyncExternalStore : u, Ae;
2302
2361
  }
2303
- var Te = {};
2362
+ var Fe = {};
2304
2363
  var ut;
2305
2364
  function Xn() {
2306
2365
  return ut || (ut = 1, process.env.NODE_ENV !== "production" && (function() {
2307
- function r(g, v) {
2308
- return g === v && (g !== 0 || 1 / g === 1 / v) || g !== g && v !== v;
2366
+ function r(g, p) {
2367
+ return g === p && (g !== 0 || 1 / g === 1 / p) || g !== g && p !== p;
2309
2368
  }
2310
- function o(g, v) {
2311
- c || n.startTransition === void 0 || (c = !0, console.error(
2369
+ function o(g, p) {
2370
+ u || n.startTransition === void 0 || (u = !0, console.error(
2312
2371
  "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
2313
2372
  ));
2314
- var y = v();
2315
- if (!u) {
2316
- var _ = v();
2373
+ var y = p();
2374
+ if (!c) {
2375
+ var _ = p();
2317
2376
  s(y, _) || (console.error(
2318
2377
  "The result of getSnapshot should be cached to avoid an infinite loop"
2319
- ), u = !0);
2378
+ ), c = !0);
2320
2379
  }
2321
2380
  _ = i({
2322
- inst: { value: y, getSnapshot: v }
2381
+ inst: { value: y, getSnapshot: p }
2323
2382
  });
2324
- var x = _[0].inst, C = _[1];
2383
+ var C = _[0].inst, x = _[1];
2325
2384
  return l(
2326
2385
  function() {
2327
- x.value = y, x.getSnapshot = v, e(x) && C({ inst: x });
2386
+ C.value = y, C.getSnapshot = p, e(C) && x({ inst: C });
2328
2387
  },
2329
- [g, y, v]
2388
+ [g, y, p]
2330
2389
  ), a(
2331
2390
  function() {
2332
- return e(x) && C({ inst: x }), g(function() {
2333
- e(x) && C({ inst: x });
2391
+ return e(C) && x({ inst: C }), g(function() {
2392
+ e(C) && x({ inst: C });
2334
2393
  });
2335
2394
  },
2336
2395
  [g]
2337
- ), h(y), y;
2396
+ ), f(y), y;
2338
2397
  }
2339
2398
  function e(g) {
2340
- var v = g.getSnapshot;
2399
+ var p = g.getSnapshot;
2341
2400
  g = g.value;
2342
2401
  try {
2343
- var y = v();
2402
+ var y = p();
2344
2403
  return !s(g, y);
2345
2404
  } catch {
2346
2405
  return !0;
2347
2406
  }
2348
2407
  }
2349
- function t(g, v) {
2350
- return v();
2408
+ function t(g, p) {
2409
+ return p();
2351
2410
  }
2352
2411
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
2353
- var n = $, s = typeof Object.is == "function" ? Object.is : r, i = n.useState, a = n.useEffect, l = n.useLayoutEffect, h = n.useDebugValue, c = !1, u = !1, m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? t : o;
2354
- Te.useSyncExternalStore = n.useSyncExternalStore !== void 0 ? n.useSyncExternalStore : m, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2355
- })()), Te;
2412
+ var n = $, s = typeof Object.is == "function" ? Object.is : r, i = n.useState, a = n.useEffect, l = n.useLayoutEffect, f = n.useDebugValue, u = !1, c = !1, m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? t : o;
2413
+ Fe.useSyncExternalStore = n.useSyncExternalStore !== void 0 ? n.useSyncExternalStore : m, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2414
+ })()), Fe;
2356
2415
  }
2357
2416
  var dt;
2358
- function Ot() {
2417
+ function Rt() {
2359
2418
  return dt || (dt = 1, process.env.NODE_ENV === "production" ? Se.exports = Yn() : Se.exports = Xn()), Se.exports;
2360
2419
  }
2361
2420
  var ft;
2362
2421
  function Qn() {
2363
2422
  if (ft) return je;
2364
2423
  ft = 1;
2365
- var r = $, o = Ot();
2366
- function e(h, c) {
2367
- return h === c && (h !== 0 || 1 / h === 1 / c) || h !== h && c !== c;
2424
+ var r = $, o = Rt();
2425
+ function e(f, u) {
2426
+ return f === u && (f !== 0 || 1 / f === 1 / u) || f !== f && u !== u;
2368
2427
  }
2369
2428
  var t = typeof Object.is == "function" ? Object.is : e, n = o.useSyncExternalStore, s = r.useRef, i = r.useEffect, a = r.useMemo, l = r.useDebugValue;
2370
- return je.useSyncExternalStoreWithSelector = function(h, c, u, m, g) {
2371
- var v = s(null);
2372
- if (v.current === null) {
2429
+ return je.useSyncExternalStoreWithSelector = function(f, u, c, m, g) {
2430
+ var p = s(null);
2431
+ if (p.current === null) {
2373
2432
  var y = { hasValue: !1, value: null };
2374
- v.current = y;
2375
- } else y = v.current;
2376
- v = a(
2433
+ p.current = y;
2434
+ } else y = p.current;
2435
+ p = a(
2377
2436
  function() {
2378
- function x(w) {
2379
- if (!C) {
2380
- if (C = !0, R = w, w = m(w), g !== void 0 && y.hasValue) {
2381
- var p = y.value;
2382
- if (g(p, w))
2383
- return O = p;
2437
+ function C(w) {
2438
+ if (!x) {
2439
+ if (x = !0, R = w, w = m(w), g !== void 0 && y.hasValue) {
2440
+ var S = y.value;
2441
+ if (g(S, w))
2442
+ return O = S;
2384
2443
  }
2385
2444
  return O = w;
2386
2445
  }
2387
- if (p = O, t(R, w)) return p;
2446
+ if (S = O, t(R, w)) return S;
2388
2447
  var E = m(w);
2389
- return g !== void 0 && g(p, E) ? (R = w, p) : (R = w, O = E);
2448
+ return g !== void 0 && g(S, E) ? (R = w, S) : (R = w, O = E);
2390
2449
  }
2391
- var C = !1, R, O, N = u === void 0 ? null : u;
2450
+ var x = !1, R, O, N = c === void 0 ? null : c;
2392
2451
  return [
2393
2452
  function() {
2394
- return x(c());
2453
+ return C(u());
2395
2454
  },
2396
2455
  N === null ? void 0 : function() {
2397
- return x(N());
2456
+ return C(N());
2398
2457
  }
2399
2458
  ];
2400
2459
  },
2401
- [c, u, m, g]
2460
+ [u, c, m, g]
2402
2461
  );
2403
- var _ = n(h, v[0], v[1]);
2462
+ var _ = n(f, p[0], p[1]);
2404
2463
  return i(
2405
2464
  function() {
2406
2465
  y.hasValue = !0, y.value = _;
@@ -2409,50 +2468,50 @@ function Qn() {
2409
2468
  ), l(_), _;
2410
2469
  }, je;
2411
2470
  }
2412
- var Fe = {};
2471
+ var Te = {};
2413
2472
  var ht;
2414
2473
  function Zn() {
2415
2474
  return ht || (ht = 1, process.env.NODE_ENV !== "production" && (function() {
2416
- function r(h, c) {
2417
- return h === c && (h !== 0 || 1 / h === 1 / c) || h !== h && c !== c;
2475
+ function r(f, u) {
2476
+ return f === u && (f !== 0 || 1 / f === 1 / u) || f !== f && u !== u;
2418
2477
  }
2419
2478
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
2420
- var o = $, e = Ot(), t = typeof Object.is == "function" ? Object.is : r, n = e.useSyncExternalStore, s = o.useRef, i = o.useEffect, a = o.useMemo, l = o.useDebugValue;
2421
- Fe.useSyncExternalStoreWithSelector = function(h, c, u, m, g) {
2422
- var v = s(null);
2423
- if (v.current === null) {
2479
+ var o = $, e = Rt(), t = typeof Object.is == "function" ? Object.is : r, n = e.useSyncExternalStore, s = o.useRef, i = o.useEffect, a = o.useMemo, l = o.useDebugValue;
2480
+ Te.useSyncExternalStoreWithSelector = function(f, u, c, m, g) {
2481
+ var p = s(null);
2482
+ if (p.current === null) {
2424
2483
  var y = { hasValue: !1, value: null };
2425
- v.current = y;
2426
- } else y = v.current;
2427
- v = a(
2484
+ p.current = y;
2485
+ } else y = p.current;
2486
+ p = a(
2428
2487
  function() {
2429
- function x(w) {
2430
- if (!C) {
2431
- if (C = !0, R = w, w = m(w), g !== void 0 && y.hasValue) {
2432
- var p = y.value;
2433
- if (g(p, w))
2434
- return O = p;
2488
+ function C(w) {
2489
+ if (!x) {
2490
+ if (x = !0, R = w, w = m(w), g !== void 0 && y.hasValue) {
2491
+ var S = y.value;
2492
+ if (g(S, w))
2493
+ return O = S;
2435
2494
  }
2436
2495
  return O = w;
2437
2496
  }
2438
- if (p = O, t(R, w))
2439
- return p;
2497
+ if (S = O, t(R, w))
2498
+ return S;
2440
2499
  var E = m(w);
2441
- return g !== void 0 && g(p, E) ? (R = w, p) : (R = w, O = E);
2500
+ return g !== void 0 && g(S, E) ? (R = w, S) : (R = w, O = E);
2442
2501
  }
2443
- var C = !1, R, O, N = u === void 0 ? null : u;
2502
+ var x = !1, R, O, N = c === void 0 ? null : c;
2444
2503
  return [
2445
2504
  function() {
2446
- return x(c());
2505
+ return C(u());
2447
2506
  },
2448
2507
  N === null ? void 0 : function() {
2449
- return x(N());
2508
+ return C(N());
2450
2509
  }
2451
2510
  ];
2452
2511
  },
2453
- [c, u, m, g]
2512
+ [u, c, m, g]
2454
2513
  );
2455
- var _ = n(h, v[0], v[1]);
2514
+ var _ = n(f, p[0], p[1]);
2456
2515
  return i(
2457
2516
  function() {
2458
2517
  y.hasValue = !0, y.value = _;
@@ -2460,7 +2519,7 @@ function Zn() {
2460
2519
  [_]
2461
2520
  ), l(_), _;
2462
2521
  }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2463
- })()), Fe;
2522
+ })()), Te;
2464
2523
  }
2465
2524
  var mt;
2466
2525
  function er() {
@@ -2469,13 +2528,13 @@ function er() {
2469
2528
  var tr = er();
2470
2529
  const nr = /* @__PURE__ */ xn(tr), gt = (r) => {
2471
2530
  let o;
2472
- const e = /* @__PURE__ */ new Set(), t = (h, c) => {
2473
- const u = typeof h == "function" ? h(o) : h;
2474
- if (!Object.is(u, o)) {
2531
+ const e = /* @__PURE__ */ new Set(), t = (f, u) => {
2532
+ const c = typeof f == "function" ? f(o) : f;
2533
+ if (!Object.is(c, o)) {
2475
2534
  const m = o;
2476
- o = c ?? (typeof u != "object" || u === null) ? u : Object.assign({}, o, u), e.forEach((g) => g(o, m));
2535
+ o = u ?? (typeof c != "object" || c === null) ? c : Object.assign({}, o, c), e.forEach((g) => g(o, m));
2477
2536
  }
2478
- }, n = () => o, a = { setState: t, getState: n, getInitialState: () => l, subscribe: (h) => (e.add(h), () => e.delete(h)) }, l = o = r(t, n, a);
2537
+ }, n = () => o, a = { setState: t, getState: n, getInitialState: () => l, subscribe: (f) => (e.add(f), () => e.delete(f)) }, l = o = r(t, n, a);
2479
2538
  return a;
2480
2539
  }, rr = ((r) => r ? gt(r) : gt), { useSyncExternalStoreWithSelector: or } = nr, sr = (r) => r;
2481
2540
  function ir(r, o = sr, e) {
@@ -2488,7 +2547,7 @@ function ir(r, o = sr, e) {
2488
2547
  );
2489
2548
  return $.useDebugValue(t), t;
2490
2549
  }
2491
- const Rt = "APP_GLO", ar = /* @__PURE__ */ new Set([
2550
+ const It = "APP_GLO", ar = /* @__PURE__ */ new Set([
2492
2551
  "app.controls",
2493
2552
  "initialized",
2494
2553
  "session.connected",
@@ -2511,7 +2570,7 @@ const Rt = "APP_GLO", ar = /* @__PURE__ */ new Set([
2511
2570
  async function cr() {
2512
2571
  const r = {}, o = ["layout", "navigation", "owner", "program", "session", "user"];
2513
2572
  for (const e of o) {
2514
- const t = `${Rt}:${e}`;
2573
+ const t = `${It}:${e}`;
2515
2574
  if (e === "session") {
2516
2575
  try {
2517
2576
  if (typeof localStorage < "u") {
@@ -2548,7 +2607,7 @@ async function cr() {
2548
2607
  async function ur(r) {
2549
2608
  const o = ["layout", "navigation", "owner", "program", "session", "user"];
2550
2609
  for (const e of o) {
2551
- const t = `${Rt}:${e}`, n = ze(r[e], e), s = JSON.stringify(n);
2610
+ const t = `${It}:${e}`, n = ze(r[e], e), s = JSON.stringify(n);
2552
2611
  if (e === "session") {
2553
2612
  try {
2554
2613
  typeof localStorage < "u" && localStorage.setItem(t, s);
@@ -2789,7 +2848,7 @@ const $e = {
2789
2848
  }))
2790
2849
  };
2791
2850
  };
2792
- let It = !1, xe = null, pt = Promise.resolve();
2851
+ let kt = !1, xe = null, pt = Promise.resolve();
2793
2852
  const Me = async () => {
2794
2853
  xe && await xe;
2795
2854
  }, Pe = async (r) => {
@@ -2832,19 +2891,19 @@ xe = cr().then((r) => {
2832
2891
  }).catch((r) => {
2833
2892
  console.error("Error loading storage:", r), V.setState({ initialized: !0 });
2834
2893
  }).finally(() => {
2835
- It = !0, xe = null;
2894
+ kt = !0, xe = null;
2836
2895
  });
2837
2896
  V.subscribe((r) => {
2838
- It && ur(r).catch((o) => {
2897
+ kt && ur(r).catch((o) => {
2839
2898
  console.error("Error saving storage:", o);
2840
2899
  });
2841
2900
  });
2842
- const vr = ((r) => (o) => ir(r, o, Jn)), yo = vr(V), wo = (r) => {
2901
+ const vr = ((r) => (o) => ir(r, o, Jn)), wo = vr(V), bo = (r) => {
2843
2902
  V.getState().setApiURL(r);
2844
- }, bo = () => V.getState().session.apiURL ?? "", xo = () => V.getState().session.authToken ?? "", _o = () => V.getState().isLoggedIn(), Co = (r) => {
2903
+ }, xo = () => V.getState().session.apiURL ?? "", _o = () => V.getState().session.authToken ?? "", Co = () => V.getState().isLoggedIn(), Eo = (r) => {
2845
2904
  V.getState().setAuthToken(r);
2846
- }, yr = () => V.getState(), kt = Dt(null);
2847
- function Eo({
2905
+ }, yr = () => V.getState(), jt = zt(null);
2906
+ function Oo({
2848
2907
  apiURL: r,
2849
2908
  autoFetch: o = !0,
2850
2909
  children: e,
@@ -2855,14 +2914,14 @@ function Eo({
2855
2914
  program: a,
2856
2915
  throttleMs: l = 0
2857
2916
  }) {
2858
- const h = U(0), c = U(!1), u = U(!1), m = oe(
2917
+ const f = U(0), u = U(!1), c = U(!1), m = oe(
2859
2918
  async (y) => {
2860
- const _ = Date.now(), x = _ - h.current;
2861
- if (!c.current && !(l > 0 && x < l))
2919
+ const _ = Date.now(), C = _ - f.current;
2920
+ if (!u.current && !(l > 0 && C < l))
2862
2921
  try {
2863
- c.current = !0, h.current = _, await V.getState().fetchData(y);
2922
+ u.current = !0, f.current = _, await V.getState().fetchData(y);
2864
2923
  } finally {
2865
- c.current = !1;
2924
+ u.current = !1;
2866
2925
  }
2867
2926
  },
2868
2927
  [l]
@@ -2880,19 +2939,19 @@ function Eo({
2880
2939
  }, [s]), I(() => {
2881
2940
  i && V.setState({ onLogout: i });
2882
2941
  }, [i]), I(() => {
2883
- u.current || (u.current = !0, o && t && m(r).catch((y) => {
2942
+ c.current || (c.current = !0, o && t && m(r).catch((y) => {
2884
2943
  console.error("Failed to fetch on mount:", y);
2885
2944
  }));
2886
2945
  }, [r, o, t, m]);
2887
- const v = yt(() => ({
2946
+ const p = yt(() => ({
2888
2947
  fetchData: m,
2889
2948
  getState: yr,
2890
2949
  refetch: g
2891
2950
  }), [m, g]);
2892
- return /* @__PURE__ */ d.jsx(kt.Provider, { value: v, children: e });
2951
+ return /* @__PURE__ */ d.jsx(jt.Provider, { value: p, children: e });
2893
2952
  }
2894
- function Oo() {
2895
- const r = zt(kt);
2953
+ function Ro() {
2954
+ const r = $t(jt);
2896
2955
  if (!r)
2897
2956
  throw new Error("useGlobalStateStoreContext must be used within GlobalStateStoreProvider");
2898
2957
  return r;
@@ -2961,7 +3020,7 @@ function _r(r, o) {
2961
3020
  return t[n];
2962
3021
  }, o);
2963
3022
  }
2964
- const { Provider: Cr, useStore: jt } = Ce(
3023
+ const { Provider: Cr, useStore: At } = Ce(
2965
3024
  (r, o) => ({
2966
3025
  hide: (e) => {
2967
3026
  o().setInstanceState(e, "visible", !1);
@@ -2992,11 +3051,11 @@ const { Provider: Cr, useStore: jt } = Ce(
2992
3051
  }
2993
3052
  }),
2994
3053
  (r) => ({
2995
- providerID: r.providerID ?? `MenuStore-${bt()}`
3054
+ providerID: r.providerID ?? `MenuStore-${xt()}`
2996
3055
  })
2997
3056
  );
2998
3057
  function Er() {
2999
- const { menus: r, providerID: o, setInstanceState: e, width: t } = jt((n) => ({
3058
+ const { menus: r, providerID: o, setInstanceState: e, width: t } = At((n) => ({
3000
3059
  menus: n.menus,
3001
3060
  providerID: n.providerID,
3002
3061
  setInstanceState: n.setInstanceState,
@@ -3025,7 +3084,7 @@ function Er() {
3025
3084
  ) }),
3026
3085
  /* @__PURE__ */ d.jsx(K.Dropdown, { children: n.renderer ? n.renderer : $.Children.toArray(
3027
3086
  n.items?.map((i, a) => /* @__PURE__ */ d.jsx(
3028
- At,
3087
+ Ft,
3029
3088
  {
3030
3089
  ...i
3031
3090
  },
@@ -3035,8 +3094,8 @@ function Er() {
3035
3094
  ))
3036
3095
  ) }, `bmm_portal_${o}`);
3037
3096
  }
3038
- const At = ({ children: r, label: o, ...e }) => {
3039
- const [t, n] = le(!1);
3097
+ const Ft = ({ children: r, label: o, ...e }) => {
3098
+ const [t, n] = se(!1);
3040
3099
  return typeof e.renderer == "function" ? e.renderer({ ...e, loading: t, renderer: void 0, setLoading: n }) : typeof e.renderer == "object" ? e.renderer : e.isDivider ? /* @__PURE__ */ d.jsx(K.Divider, {}) : e.items && e.items.length > 0 ? /* @__PURE__ */ d.jsxs(K.Sub, { children: [
3041
3100
  /* @__PURE__ */ d.jsx(K.Sub.Target, { children: /* @__PURE__ */ d.jsx(
3042
3101
  K.Sub.Item,
@@ -3058,7 +3117,7 @@ const At = ({ children: r, label: o, ...e }) => {
3058
3117
  ) }),
3059
3118
  /* @__PURE__ */ d.jsx(K.Sub.Dropdown, { children: $.Children.toArray(
3060
3119
  e.items.map((s, i) => /* @__PURE__ */ d.jsx(
3061
- At,
3120
+ Ft,
3062
3121
  {
3063
3122
  ...s
3064
3123
  },
@@ -3102,10 +3161,10 @@ const Rr = [
3102
3161
  { label: "Less Than", value: "lt" },
3103
3162
  { label: "Less Than or Equal", value: "lte" }
3104
3163
  ], Ir = (r) => {
3105
- const o = r.storeState?.colFilters?.findIndex((i) => i.id === r.column.id) ?? -1, e = r.storeState?.colFilters?.[o] ?? { id: r.column.id, value: "" }, [t, n] = le(e?.value ?? ""), [s] = xt(t, 900);
3164
+ const o = r.storeState?.colFilters?.findIndex((i) => i.id === r.column.id) ?? -1, e = r.storeState?.colFilters?.[o] ?? { id: r.column.id, value: "" }, [t, n] = se(e?.value ?? ""), [s] = _t(t, 900);
3106
3165
  return I(() => {
3107
3166
  r.storeState.setStateFN("colFilters", (i) => {
3108
- const a = i?.findIndex((h) => h.id === r.column.id) ?? -1, l = i ?? [];
3167
+ const a = i?.findIndex((f) => f.id === r.column.id) ?? -1, l = i ?? [];
3109
3168
  return a >= 0 ? l[a] = {
3110
3169
  ...l[a],
3111
3170
  ...r.options,
@@ -3130,12 +3189,12 @@ const Rr = [
3130
3189
  const o = r.storeState?.colFilters?.findIndex((i) => i.id === r.column.id) ?? -1, e = r.storeState?.colFilters?.[o] ?? {
3131
3190
  id: r.column.id,
3132
3191
  operator: "contains"
3133
- }, [t, n] = le(
3192
+ }, [t, n] = se(
3134
3193
  e?.operator ?? "contains"
3135
- ), [s] = xt(t, 900);
3194
+ ), [s] = _t(t, 900);
3136
3195
  return I(() => {
3137
3196
  r.storeState.setStateFN("colFilters", (i) => {
3138
- const a = i?.findIndex((h) => h.id === r.column.id) ?? -1, l = i ?? [];
3197
+ const a = i?.findIndex((f) => f.id === r.column.id) ?? -1, l = i ?? [];
3139
3198
  return a >= 0 ? l[a] = {
3140
3199
  ...l[a],
3141
3200
  ...r.options,
@@ -3161,7 +3220,7 @@ const Rr = [
3161
3220
  withScrollArea: !0
3162
3221
  }
3163
3222
  );
3164
- }, vt = (r) => /* @__PURE__ */ d.jsxs(wt, { onClick: (o) => o.stopPropagation(), children: [
3223
+ }, vt = (r) => /* @__PURE__ */ d.jsxs(bt, { onClick: (o) => o.stopPropagation(), children: [
3165
3224
  /* @__PURE__ */ d.jsx(kr, { ...r }),
3166
3225
  /* @__PURE__ */ d.jsx(Ir, { ...r })
3167
3226
  ] }), Ne = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="none">
@@ -3201,7 +3260,7 @@ const Rr = [
3201
3260
  const t = o(), [n, s] = e, i = t.getRowBuffer(s);
3202
3261
  return i !== void 0 ? t.toCell(i, n) : {
3203
3262
  allowOverlay: !1,
3204
- kind: ie.Loading
3263
+ kind: ae.Loading
3205
3264
  };
3206
3265
  },
3207
3266
  getCellsForSelection: (e, t) => async () => {
@@ -3222,14 +3281,14 @@ const Rr = [
3222
3281
  for (const i of e._gridSelectionRows) {
3223
3282
  let a;
3224
3283
  for (const l in n)
3225
- for (const h in n[l]) {
3226
- const c = Number(l) * s + Number(h);
3227
- if (!isNaN(c)) {
3228
- if (Number(n[l][h]?._rownumber) === i + 1) {
3229
- a = n[l][h];
3284
+ for (const f in n[l]) {
3285
+ const u = Number(l) * s + Number(f);
3286
+ if (!isNaN(u)) {
3287
+ if (Number(n[l][f]?._rownumber) === i + 1) {
3288
+ a = n[l][f];
3230
3289
  break;
3231
- } else if (c === i + 1) {
3232
- a = n[l][h];
3290
+ } else if (u === i + 1) {
3291
+ a = n[l][f];
3233
3292
  break;
3234
3293
  }
3235
3294
  }
@@ -3243,7 +3302,7 @@ const Rr = [
3243
3302
  if (t.data && t.data.length > 0)
3244
3303
  return t.data[e] === void 0 ? {
3245
3304
  allowOverlay: !1,
3246
- kind: ie.Loading
3305
+ kind: ae.Loading
3247
3306
  } : t.data[e];
3248
3307
  const n = Math.max(0, Math.floor(e / t.pageSize)), s = t.pageSize * n, i = e - s;
3249
3308
  return t._page_data?.[n]?.[i];
@@ -3254,10 +3313,10 @@ const Rr = [
3254
3313
  if (t.ready) {
3255
3314
  const s = t._page_data, i = t.pageSize, a = t.keyField ?? "id";
3256
3315
  for (const l in s) {
3257
- for (const h in s[l]) {
3258
- const c = Number(l) * i + Number(h);
3259
- if (String(s[l][h]?.[a]) === String(e)) {
3260
- n = s[l][h]?._rownumber > 0 ? s[l][h]?._rownumber : c > 0 ? c : -1;
3316
+ for (const f in s[l]) {
3317
+ const u = Number(l) * i + Number(f);
3318
+ if (String(s[l][f]?.[a]) === String(e)) {
3319
+ n = s[l][f]?._rownumber > 0 ? s[l][f]?._rownumber : u > 0 ? u : -1;
3261
3320
  break;
3262
3321
  }
3263
3322
  }
@@ -3284,7 +3343,7 @@ const Rr = [
3284
3343
  const s = e._page_data[Number(n)];
3285
3344
  for (const i of s) {
3286
3345
  const a = e.keyField ?? "id", l = i?.[a];
3287
- if (l !== void 0 && e.values.find((c) => String(c?.[a]) === String(l))) {
3346
+ if (l !== void 0 && e.values.find((u) => String(u?.[a]) === String(l))) {
3288
3347
  t = !0;
3289
3348
  break;
3290
3349
  }
@@ -3304,10 +3363,10 @@ const Rr = [
3304
3363
  })
3305
3364
  ))
3306
3365
  return;
3307
- const a = [], l = Object.keys(n.renderColumns ?? [1, 2, 3]).length, h = n.pageSize * s, c = n._page_data?.[s]?.length > 0;
3366
+ const a = [], l = Object.keys(n.renderColumns ?? [1, 2, 3]).length, f = n.pageSize * s, u = n._page_data?.[s]?.length > 0;
3308
3367
  if (t === "all") {
3309
- n._active_requests?.forEach((u) => {
3310
- u.controller?.abort?.();
3368
+ n._active_requests?.forEach((c) => {
3369
+ c.controller?.abort?.();
3311
3370
  }), n.setState("_page_data", {}), n.setState("_active_requests", []), n.loadPage(s);
3312
3371
  return;
3313
3372
  }
@@ -3315,22 +3374,22 @@ const Rr = [
3315
3374
  console.warn("No useAPIQuery function defined, cannot load page", s);
3316
3375
  return;
3317
3376
  }
3318
- !c && t !== "page" && n.useAPIQuery?.(s).then((u) => {
3319
- n.setStateFN("_page_data", (m) => ({ ...m, [s]: u }));
3320
- for (let m = s; m <= h + n.pageSize; m++)
3377
+ !u && t !== "page" && n.useAPIQuery?.(s).then((c) => {
3378
+ n.setStateFN("_page_data", (m) => ({ ...m, [s]: c }));
3379
+ for (let m = s; m <= f + n.pageSize; m++)
3321
3380
  for (let g = 0; g <= l; g++)
3322
3381
  a.push({
3323
3382
  cell: [g, m]
3324
3383
  });
3325
3384
  n._glideref?.updateCells(a), n._events.dispatchEvent(
3326
3385
  new CustomEvent("loadPage", {
3327
- detail: { clearMode: t, data: u, page: e, state: n }
3386
+ detail: { clearMode: t, data: c, page: e, state: n }
3328
3387
  })
3329
3388
  );
3330
- }).catch((u) => {
3331
- console.error("loadPage Error: ", s, u), n._events.dispatchEvent(
3389
+ }).catch((c) => {
3390
+ console.error("loadPage Error: ", s, c), n._events.dispatchEvent(
3332
3391
  new CustomEvent("loadPage_error", {
3333
- detail: { clearMode: t, error: u, page: e, state: n }
3392
+ detail: { clearMode: t, error: c, page: e, state: n }
3334
3393
  })
3335
3394
  );
3336
3395
  });
@@ -3364,7 +3423,7 @@ const Rr = [
3364
3423
  onColumnMoved: (e, t) => {
3365
3424
  const n = o(), s = n.renderColumns?.[e], i = n.renderColumns?.[t];
3366
3425
  s?.disableMove || i?.disableMove || n.setStateFN("colOrder", (a) => {
3367
- const l = a ?? n.renderColumns?.map((h, c) => [h.id, c]).reduce((h, [c, u]) => ({ ...h, [c]: u }), {});
3426
+ const l = a ?? n.renderColumns?.map((f, u) => [f.id, u]).reduce((f, [u, c]) => ({ ...f, [u]: c }), {});
3368
3427
  return !s?.id || !i?.id ? l : { ...l, [s?.id]: t, [i?.id]: e };
3369
3428
  });
3370
3429
  },
@@ -3385,17 +3444,17 @@ const Rr = [
3385
3444
  label: "Sort Ascending",
3386
3445
  leftSection: /* @__PURE__ */ d.jsx(ve, { sprite: Le }),
3387
3446
  onClick: () => {
3388
- i.setStateFN("colSort", (h) => {
3389
- const c = [...h ?? []], u = c.findIndex((g) => g.id === a.id), m = "asc";
3390
- if (u < 0) {
3447
+ i.setStateFN("colSort", (f) => {
3448
+ const u = [...f ?? []], c = u.findIndex((g) => g.id === a.id), m = "asc";
3449
+ if (c < 0) {
3391
3450
  const g = {
3392
3451
  direction: m,
3393
3452
  id: a.id,
3394
- order: c?.length
3453
+ order: u?.length
3395
3454
  };
3396
- c.push(g);
3397
- } else u >= 0 && (c[u].direction = m);
3398
- return c;
3455
+ u.push(g);
3456
+ } else c >= 0 && (u[c].direction = m);
3457
+ return u;
3399
3458
  });
3400
3459
  }
3401
3460
  },
@@ -3403,17 +3462,17 @@ const Rr = [
3403
3462
  label: "Sort Descending",
3404
3463
  leftSection: /* @__PURE__ */ d.jsx(ve, { sprite: Ne }),
3405
3464
  onClick: () => {
3406
- i.setStateFN("colSort", (h) => {
3407
- const c = [...h ?? []], u = c.findIndex((g) => g.id === a.id), m = "desc";
3408
- if (u < 0) {
3465
+ i.setStateFN("colSort", (f) => {
3466
+ const u = [...f ?? []], c = u.findIndex((g) => g.id === a.id), m = "desc";
3467
+ if (c < 0) {
3409
3468
  const g = {
3410
3469
  direction: m,
3411
3470
  id: a.id,
3412
- order: c?.length
3471
+ order: u?.length
3413
3472
  };
3414
- c.push(g);
3415
- } else u >= 0 && (c[u].direction = m);
3416
- return c;
3473
+ u.push(g);
3474
+ } else c >= 0 && (u[c].direction = m);
3475
+ return u;
3417
3476
  });
3418
3477
  }
3419
3478
  },
@@ -3447,10 +3506,10 @@ const Rr = [
3447
3506
  t.preventDefault();
3448
3507
  const s = n.renderColumns?.[e];
3449
3508
  s && (s.disableSort || n.setStateFN("colSort", (i) => {
3450
- const a = [...i ?? []], l = a.findIndex((h) => h.id === s.id);
3509
+ const a = [...i ?? []], l = a.findIndex((f) => f.id === s.id);
3451
3510
  if (l < 0) {
3452
- const h = { direction: "asc", id: s.id, order: a?.length };
3453
- a.push(h);
3511
+ const f = { direction: "asc", id: s.id, order: a?.length };
3512
+ a.push(f);
3454
3513
  } else l >= 0 && a[l].direction === "asc" ? a[l].direction = "desc" : l >= 0 && a[l].direction === "desc" && a.splice(l, 1);
3455
3514
  return a;
3456
3515
  }));
@@ -3468,12 +3527,12 @@ const Rr = [
3468
3527
  leftSection: /* @__PURE__ */ d.jsx(ve, { sprite: Le }),
3469
3528
  onClick: () => {
3470
3529
  n.setStateFN("colSort", (l) => {
3471
- const h = [...l ?? []], c = h.findIndex((m) => m.id === s.id), u = "asc";
3472
- if (c < 0) {
3473
- const m = { direction: u, id: s.id, order: h?.length };
3474
- h.push(m);
3475
- } else c >= 0 && (h[c].direction = u);
3476
- return h;
3530
+ const f = [...l ?? []], u = f.findIndex((m) => m.id === s.id), c = "asc";
3531
+ if (u < 0) {
3532
+ const m = { direction: c, id: s.id, order: f?.length };
3533
+ f.push(m);
3534
+ } else u >= 0 && (f[u].direction = c);
3535
+ return f;
3477
3536
  });
3478
3537
  }
3479
3538
  },
@@ -3482,12 +3541,12 @@ const Rr = [
3482
3541
  leftSection: /* @__PURE__ */ d.jsx(ve, { sprite: Ne }),
3483
3542
  onClick: () => {
3484
3543
  n.setStateFN("colSort", (l) => {
3485
- const h = [...l ?? []], c = h.findIndex((m) => m.id === s.id), u = "desc";
3486
- if (c < 0) {
3487
- const m = { direction: u, id: s.id, order: h?.length };
3488
- h.push(m);
3489
- } else c >= 0 && (h[c].direction = u);
3490
- return h;
3544
+ const f = [...l ?? []], u = f.findIndex((m) => m.id === s.id), c = "desc";
3545
+ if (u < 0) {
3546
+ const m = { direction: c, id: s.id, order: f?.length };
3547
+ f.push(m);
3548
+ } else u >= 0 && (f[u].direction = c);
3549
+ return f;
3491
3550
  });
3492
3551
  }
3493
3552
  },
@@ -3535,9 +3594,9 @@ const Rr = [
3535
3594
  const i = o();
3536
3595
  i._scrollTimeout && clearTimeout(i._scrollTimeout);
3537
3596
  const a = () => {
3538
- const l = o(), h = Math.max(0, Math.floor(e.y / l.pageSize)), c = Math.max(0, Math.floor(l._visiblePages.y / l.pageSize)), u = h - c;
3539
- if (l.progressiveScroll && u > 1) {
3540
- const m = o(), g = (c + 2) * m.pageSize * (m.rowHeight ?? 22);
3597
+ const l = o(), f = Math.max(0, Math.floor(e.y / l.pageSize)), u = Math.max(0, Math.floor(l._visiblePages.y / l.pageSize)), c = f - u;
3598
+ if (l.progressiveScroll && c > 1) {
3599
+ const m = o(), g = (u + 2) * m.pageSize * (m.rowHeight ?? 22);
3541
3600
  m._glideref?.scrollTo(
3542
3601
  0,
3543
3602
  {
@@ -3560,16 +3619,16 @@ const Rr = [
3560
3619
  pageSize: 50,
3561
3620
  ready: !1,
3562
3621
  refreshCells: (e, t, n) => {
3563
- const s = o(), i = [], a = Object.keys(s.renderColumns ?? [1, 2, 3]).length, l = e && e > 0 ? e : 0, h = t && t >= l ? t : l + s.pageSize;
3564
- for (let c = l; c <= h; c++)
3622
+ const s = o(), i = [], a = Object.keys(s.renderColumns ?? [1, 2, 3]).length, l = e && e > 0 ? e : 0, f = t && t >= l ? t : l + s.pageSize;
3623
+ for (let u = l; u <= f; u++)
3565
3624
  if (n && n > 0)
3566
3625
  i.push({
3567
- cell: [n, c]
3626
+ cell: [n, u]
3568
3627
  });
3569
3628
  else
3570
- for (let u = 0; u <= a; u++)
3629
+ for (let c = 0; c <= a; c++)
3571
3630
  i.push({
3572
- cell: [u, c]
3631
+ cell: [c, u]
3573
3632
  });
3574
3633
  s._glideref?.updateCells(i);
3575
3634
  },
@@ -3595,29 +3654,29 @@ const Rr = [
3595
3654
  if (a == null || e === void 0 || e === null)
3596
3655
  return i?.Cell ? i?.Cell(e, t, a, void 0, n) : n.RenderCell ? n.RenderCell(e, t, a, void 0, n) : {
3597
3656
  allowOverlay: !1,
3598
- kind: ie.Loading
3657
+ kind: ae.Loading
3599
3658
  };
3600
3659
  try {
3601
3660
  const l = String(a).includes(".") ? _r(a, e) ?? "" : e?.[a];
3602
- return i?.Cell ? { kind: ie.Text, ...i?.Cell(e, t, a, l, n) } : n.RenderCell ? n.RenderCell(e, t, a, l, n) : {
3661
+ return i?.Cell ? { kind: ae.Text, ...i?.Cell(e, t, a, l, n) } : n.RenderCell ? n.RenderCell(e, t, a, l, n) : {
3603
3662
  allowOverlay: !0,
3604
3663
  data: l ?? "",
3605
3664
  displayData: String(l ?? ""),
3606
- kind: ie.Text
3665
+ kind: ae.Text
3607
3666
  };
3608
3667
  } catch {
3609
3668
  return n.RenderCell ? n.RenderCell(e, t, a, e?.[a ?? ""], n) : {
3610
3669
  allowOverlay: !1,
3611
- kind: ie.Loading,
3670
+ kind: ae.Loading,
3612
3671
  skeletonWidthVariability: 50
3613
3672
  };
3614
3673
  }
3615
3674
  },
3616
3675
  total_rows: 1e3,
3617
- uniqueid: bt()
3676
+ uniqueid: xt()
3618
3677
  }),
3619
3678
  (r) => {
3620
- const [o, e] = r.useStore((n) => [n.setState, n.getState]), t = jt();
3679
+ const [o, e] = r.useStore((n) => [n.setState, n.getState]), t = At();
3621
3680
  return I(() => {
3622
3681
  const n = e("onMounted");
3623
3682
  if (typeof n == "function" && n(e, o), o("mounted", !0), window && window.document && !window.document.getElementById("portal")) {
@@ -3657,77 +3716,77 @@ function Ar(r) {
3657
3716
  l.mounted
3658
3717
  ]), i = oe(
3659
3718
  async (l) => {
3660
- const h = t("columns"), c = t("colSort"), u = t("pageSize"), m = t("colFilters"), g = t("searchStr"), v = t("searchFields"), y = t("_active_requests"), _ = t("keyField");
3719
+ const f = t("columns"), u = t("colSort"), c = t("pageSize"), m = t("colFilters"), g = t("searchStr"), p = t("searchFields"), y = t("_active_requests"), _ = t("keyField");
3661
3720
  e("loadingData", !0);
3662
3721
  try {
3663
3722
  if (r && r.url) {
3664
- const x = new Headers();
3665
- x.set("Authorization", `Token ${r.authtoken}`);
3666
- const C = [
3667
- { type: "limit", value: String(u ?? 50) },
3668
- { type: "offset", value: String((u ?? 50) * l) }
3723
+ const C = new Headers();
3724
+ C.set("Authorization", `Token ${r.authtoken}`);
3725
+ const x = [
3726
+ { type: "limit", value: String(c ?? 50) },
3727
+ { type: "offset", value: String((c ?? 50) * l) }
3669
3728
  ];
3670
- c?.length && c.length > 0 && C.push({
3729
+ u?.length && u.length > 0 && x.push({
3671
3730
  type: "sort",
3672
- value: c?.map((p) => `${p.id} ${p.direction}`).reduce((p, E) => `${p},${E}`)
3673
- }), m?.filter((p) => p.value?.length > 0)?.forEach((p) => {
3674
- p.value && p.value !== "" && C.push({
3675
- name: `${p.id}`,
3676
- op: p.operator,
3731
+ value: u?.map((S) => `${S.id} ${S.direction}`).reduce((S, E) => `${S},${E}`)
3732
+ }), m?.filter((S) => S.value?.length > 0)?.forEach((S) => {
3733
+ S.value && S.value !== "" && x.push({
3734
+ name: `${S.id}`,
3735
+ op: S.operator,
3677
3736
  type: "searchop",
3678
- value: p.value
3737
+ value: S.value
3679
3738
  });
3680
- }), g && g !== "" && h?.filter(
3681
- (p) => !p.disableFilter && !p.disableSearch && !p.virtual && p.id && ((v ?? []).length == 0 || v?.includes(p.id))
3682
- )?.forEach((p) => {
3683
- C.push({
3684
- name: `${p.id ?? ""}`,
3739
+ }), g && g !== "" && f?.filter(
3740
+ (S) => !S.disableFilter && !S.disableSearch && !S.virtual && S.id && ((p ?? []).length == 0 || p?.includes(S.id))
3741
+ )?.forEach((S) => {
3742
+ x.push({
3743
+ name: `${S.id ?? ""}`,
3685
3744
  op: "contains",
3686
3745
  type: "searchor",
3687
3746
  value: g
3688
3747
  });
3689
- }), r.filter && r.filter !== "" && C.push({
3748
+ }), r.filter && r.filter !== "" && x.push({
3690
3749
  name: "sql_filter",
3691
3750
  type: "custom-sql-w",
3692
3751
  value: r.filter
3693
- }), (r.options ?? []).length > 0 && C.push(...r.options ?? []);
3694
- const R = h?.filter((p) => !p.virtual)?.map((p) => p.id) ?? [];
3695
- if (r.hotfields && r.hotfields.length > 0 && R?.push(r.hotfields.join(",")), _ && (R.includes(_) || R.push(_)), R && R.length > 0 && C.push({
3752
+ }), (r.options ?? []).length > 0 && x.push(...r.options ?? []);
3753
+ const R = f?.filter((S) => !S.virtual)?.map((S) => S.id) ?? [];
3754
+ if (r.hotfields && r.hotfields.length > 0 && R?.push(r.hotfields.join(",")), _ && (R.includes(_) || R.push(_)), R && R.length > 0 && x.push({
3696
3755
  type: "select-fields",
3697
3756
  value: R.join(",")
3698
- }), C && C.length > 0) {
3699
- const p = fe(C);
3700
- for (const E in fe(C))
3701
- x.set(E, p[E]);
3757
+ }), x && x.length > 0) {
3758
+ const S = fe(x);
3759
+ for (const E in fe(x))
3760
+ C.set(E, S[E]);
3702
3761
  }
3703
- const O = y?.findIndex((p) => p.page === l) ?? -1;
3704
- if (y?.forEach((p) => {
3705
- (p.page >= 0 && p.page < l - 2 || l >= 0 && p.page > l + 2) && p.controller?.abort?.();
3762
+ const O = y?.findIndex((S) => S.page === l) ?? -1;
3763
+ if (y?.forEach((S) => {
3764
+ (S.page >= 0 && S.page < l - 2 || l >= 0 && S.page > l + 2) && S.controller?.abort?.();
3706
3765
  }), y && O >= 0 && y[O]) {
3707
3766
  e("loadingData", !1);
3708
3767
  return;
3709
3768
  }
3710
3769
  const N = new AbortController();
3711
- await o("_active_requests", (p) => [
3712
- ...p ?? [],
3770
+ await o("_active_requests", (S) => [
3771
+ ...S ?? [],
3713
3772
  { controller: N, page: l }
3714
3773
  ]);
3715
3774
  const w = await fetch(
3716
- `${r.url}?x-limit=${String(u ?? 50)}&x-offset=${String((u ?? 50) * l)}`,
3775
+ `${r.url}?x-limit=${String(c ?? 50)}&x-offset=${String((c ?? 50) * l)}`,
3717
3776
  {
3718
- headers: x,
3777
+ headers: C,
3719
3778
  method: "GET",
3720
3779
  signal: N?.signal
3721
3780
  }
3722
3781
  );
3723
3782
  if (w.ok) {
3724
- const p = w.headers.get("Content-Range")?.split("/");
3725
- p?.[1] && parseInt(p[1], 10) > 0 && e("total_rows", parseInt(p[1], 10));
3783
+ const S = w.headers.get("Content-Range")?.split("/");
3784
+ S?.[1] && parseInt(S[1], 10) > 0 && e("total_rows", parseInt(S[1], 10));
3726
3785
  const E = await w.json();
3727
3786
  return e("loadingData", !1), E ?? [];
3728
3787
  }
3729
- n(`${w.status} ${w.statusText}`, "api", r.url), await o("_active_requests", (p) => [
3730
- ...(p ?? []).filter((E) => E.page !== l)
3788
+ n(`${w.status} ${w.statusText}`, "api", r.url), await o("_active_requests", (S) => [
3789
+ ...(S ?? []).filter((E) => E.page !== l)
3731
3790
  ]);
3732
3791
  }
3733
3792
  } catch {
@@ -3746,36 +3805,36 @@ function Ar(r) {
3746
3805
  ]
3747
3806
  ), a = oe(
3748
3807
  async (l) => {
3749
- const h = t("colFilters");
3808
+ const f = t("colFilters");
3750
3809
  if (r && r.url) {
3751
- const c = new Headers(), u = [
3810
+ const u = new Headers(), c = [
3752
3811
  { type: "limit", value: String(10) },
3753
3812
  { type: "fetch-rownumber", value: l }
3754
3813
  ];
3755
- if (c.set("Authorization", `Token ${r.authtoken}`), h?.length && h.length > 0 && h?.filter((v) => v.value?.length > 0)?.forEach((v) => {
3756
- v.value && v.value !== "" && c.set(`x-searchop-${v.operator}-${v.id}`, `${v.value}`);
3757
- }), r.filter && r.filter !== "" && u.push({
3814
+ if (u.set("Authorization", `Token ${r.authtoken}`), f?.length && f.length > 0 && f?.filter((p) => p.value?.length > 0)?.forEach((p) => {
3815
+ p.value && p.value !== "" && u.set(`x-searchop-${p.operator}-${p.id}`, `${p.value}`);
3816
+ }), r.filter && r.filter !== "" && c.push({
3758
3817
  name: "sql_filter",
3759
3818
  type: "custom-sql-w",
3760
3819
  value: `(${r.filter})`
3761
3820
  }), r.options && r.options.length > 0) {
3762
- const v = fe(r.options);
3763
- for (const y in v)
3764
- c.set(y, v[y]);
3821
+ const p = fe(r.options);
3822
+ for (const y in p)
3823
+ u.set(y, p[y]);
3765
3824
  }
3766
- if (u && u.length > 0) {
3767
- const v = fe(u);
3768
- for (const y in fe(u))
3769
- c.set(y, v[y]);
3825
+ if (c && c.length > 0) {
3826
+ const p = fe(c);
3827
+ for (const y in fe(c))
3828
+ u.set(y, p[y]);
3770
3829
  }
3771
3830
  const m = new AbortController(), g = await fetch(`${r.url}?x-fetch-rownumber=${l}}`, {
3772
- headers: c,
3831
+ headers: u,
3773
3832
  method: "GET",
3774
3833
  signal: m?.signal
3775
3834
  });
3776
3835
  if (g.ok) {
3777
- const v = await g.json();
3778
- return v?.[0]?._rownumber ?? v?._rownumber ?? 0;
3836
+ const p = await g.json();
3837
+ return p?.[0]?._rownumber ?? p?._rownumber ?? 0;
3779
3838
  }
3780
3839
  n(`${g.status} ${g.statusText}`, "api", r.url);
3781
3840
  }
@@ -3785,19 +3844,19 @@ function Ar(r) {
3785
3844
  );
3786
3845
  return I(() => {
3787
3846
  e("useAPIQuery", i), e("askAPIRowNumber", a);
3788
- const l = t("isValuesInPages"), h = t("_refresh");
3789
- l || e("values", []), h?.().then(() => {
3790
- const c = t("onChange"), u = t("getGridSelectedRows");
3791
- if (c && typeof c == "function") {
3792
- const m = u?.();
3793
- c(m);
3847
+ const l = t("isValuesInPages"), f = t("_refresh");
3848
+ l || e("values", []), f?.().then(() => {
3849
+ const u = t("onChange"), c = t("getGridSelectedRows");
3850
+ if (u && typeof u == "function") {
3851
+ const m = c?.();
3852
+ u(m);
3794
3853
  }
3795
3854
  });
3796
3855
  }, [r.url, r.authtoken, r.filter, JSON.stringify(r.options), s, e]), /* @__PURE__ */ d.jsx(d.Fragment, {});
3797
3856
  }
3798
- const Tr = $.memo(Ar);
3799
- Tr.displayName = "Gridler-GlidlerAPIAdaptorForGoLangv2";
3800
- function Fr(r) {
3857
+ const Fr = $.memo(Ar);
3858
+ Fr.displayName = "Gridler-GlidlerAPIAdaptorForGoLangv2";
3859
+ function Tr(r) {
3801
3860
  const [o, e, t, n] = W((i) => [
3802
3861
  i.getState,
3803
3862
  i.mounted,
@@ -3807,12 +3866,12 @@ function Fr(r) {
3807
3866
  I(() => {
3808
3867
  if (e && r.changeOnActiveClick) {
3809
3868
  const i = (a) => {
3810
- const { row: l, state: h } = a.detail, c = h.getRowBuffer;
3811
- if (c) {
3812
- const u = c(l);
3813
- if (!u)
3869
+ const { row: l, state: f } = a.detail, u = f.getRowBuffer;
3870
+ if (u) {
3871
+ const c = u(l);
3872
+ if (!c)
3814
3873
  return;
3815
- r.onRequestForm("change", u);
3874
+ r.onRequestForm("change", c);
3816
3875
  }
3817
3876
  };
3818
3877
  return n?.addEventListener("onCellActivated", i), () => {
@@ -3821,31 +3880,31 @@ function Fr(r) {
3821
3880
  }
3822
3881
  }, [r.changeOnActiveClick, e, n]);
3823
3882
  const s = oe(
3824
- (i, a, l, h, c) => {
3883
+ (i, a, l, f, u) => {
3825
3884
  if (i === "header-menu")
3826
- return c || [];
3827
- const u = [];
3828
- u.push(...c);
3885
+ return u || [];
3886
+ const c = [];
3887
+ c.push(...u);
3829
3888
  const m = o("_gridSelection")?.rows.toArray() ?? [], g = m.length > 1;
3830
3889
  if (!l) {
3831
3890
  const _ = m[0];
3832
3891
  _ !== void 0 && (l = a.getRowBuffer(_));
3833
3892
  }
3834
- const v = typeof r.descriptionField == "string" ? l?.[r.descriptionField] : typeof r.descriptionField == "function" && l ? r.descriptionField(l) : void 0;
3835
- i === "other" && u.push({
3893
+ const p = typeof r.descriptionField == "string" ? l?.[r.descriptionField] : typeof r.descriptionField == "function" && l ? r.descriptionField(l) : void 0;
3894
+ i === "other" && c.push({
3836
3895
  c: "blue",
3837
3896
  label: "Add",
3838
3897
  onClick: () => {
3839
3898
  r.onRequestForm("insert", l);
3840
3899
  }
3841
- }), i === "cell" && l || i === "menu" && l ? (u.push({
3900
+ }), i === "cell" && l || i === "menu" && l ? (c.push({
3842
3901
  c: "teal",
3843
3902
  label: "Add",
3844
3903
  leftSection: /* @__PURE__ */ d.jsx(cn, { color: "teal", size: 16 }),
3845
3904
  onClick: () => {
3846
3905
  r.onRequestForm("insert", l);
3847
3906
  }
3848
- }), g ? (u.push({
3907
+ }), g ? (c.push({
3849
3908
  c: "green",
3850
3909
  label: `Modify All Selected (${m.length})`,
3851
3910
  leftSection: /* @__PURE__ */ d.jsx(Je, { color: "green", size: 16 }),
@@ -3855,7 +3914,7 @@ function Fr(r) {
3855
3914
  m.map((_) => a.getRowBuffer(_))
3856
3915
  );
3857
3916
  }
3858
- }), u.push({
3917
+ }), c.push({
3859
3918
  c: "red",
3860
3919
  label: `Remove All Selected (${m.length})`,
3861
3920
  leftSection: /* @__PURE__ */ d.jsx(Ye, { color: "maroon", size: 16 }),
@@ -3865,27 +3924,27 @@ function Fr(r) {
3865
3924
  m.map((_) => a.getRowBuffer(_))
3866
3925
  );
3867
3926
  }
3868
- })) : (u.push({
3927
+ })) : (c.push({
3869
3928
  c: "green",
3870
- label: `Modify${v && r.showDescriptionInMenu ? ` (${v})` : ""}`,
3929
+ label: `Modify${p && r.showDescriptionInMenu ? ` (${p})` : ""}`,
3871
3930
  leftSection: /* @__PURE__ */ d.jsx(Je, { color: "green", size: 16 }),
3872
3931
  onClick: () => {
3873
3932
  r.onRequestForm("change", l);
3874
3933
  }
3875
- }), u.push({
3934
+ }), c.push({
3876
3935
  c: "red",
3877
- label: `Remove${v && r.showDescriptionInMenu ? ` (${v})` : ""}`,
3936
+ label: `Remove${p && r.showDescriptionInMenu ? ` (${p})` : ""}`,
3878
3937
  leftSection: /* @__PURE__ */ d.jsx(Ye, { color: "maroon", size: 16 }),
3879
3938
  onClick: () => {
3880
3939
  r.onRequestForm("delete", l);
3881
3940
  }
3882
- })), u.push({
3941
+ })), c.push({
3883
3942
  isDivider: !0
3884
- })) : (i === "cell" && !l || i === "menu" && !l) && u.push({
3943
+ })) : (i === "cell" && !l || i === "menu" && !l) && c.push({
3885
3944
  c: "red",
3886
3945
  label: "Nothing Selected",
3887
3946
  leftSection: /* @__PURE__ */ d.jsx(un, { color: "yellow", size: 16 })
3888
- }), u.push({
3947
+ }), c.push({
3889
3948
  c: "orange",
3890
3949
  label: "Refresh",
3891
3950
  leftSection: /* @__PURE__ */ d.jsx(dn, { color: "orange", size: 16 }),
@@ -3893,8 +3952,8 @@ function Fr(r) {
3893
3952
  await o("_refresh")?.();
3894
3953
  }
3895
3954
  });
3896
- const y = r.getMenuItems ? r.getMenuItems(i, a, l, h, u) : u;
3897
- return !u || u.length === 0 ? c || [] : y;
3955
+ const y = r.getMenuItems ? r.getMenuItems(i, a, l, f, c) : c;
3956
+ return !c || c.length === 0 ? u || [] : y;
3898
3957
  },
3899
3958
  [r.onRequestForm, o]
3900
3959
  );
@@ -3902,37 +3961,37 @@ function Fr(r) {
3902
3961
  }), [r.getMenuItems, e]), /* @__PURE__ */ d.jsx(d.Fragment, {});
3903
3962
  }
3904
3963
  function Mr(r) {
3905
- const [o, e, t] = W((c) => [c.setState, c.getState, c.mounted]), { colFilters: n, colSort: s, columns: i, searchStr: a } = W((c) => ({
3906
- colFilters: c.colFilters,
3907
- colOrder: c.colOrder,
3908
- colSize: c.colSize,
3909
- colSort: c.colSort,
3910
- columns: c.columns,
3911
- searchStr: c.searchStr
3964
+ const [o, e, t] = W((u) => [u.setState, u.getState, u.mounted]), { colFilters: n, colSort: s, columns: i, searchStr: a } = W((u) => ({
3965
+ colFilters: u.colFilters,
3966
+ colOrder: u.colOrder,
3967
+ colSize: u.colSize,
3968
+ colSort: u.colSort,
3969
+ columns: u.columns,
3970
+ searchStr: u.searchStr
3912
3971
  })), l = $.useRef({
3913
3972
  colFilters: n,
3914
3973
  colSort: s,
3915
3974
  searchStr: a
3916
- }), h = async (c) => {
3917
- const u = e("pageSize");
3918
- return r.data && Array.isArray(r.data) ? (o("total_rows", r.data.length), r.data.slice(c * (u ?? 50), (c + 1) * (u ?? 50))) : [];
3975
+ }), f = async (u) => {
3976
+ const c = e("pageSize");
3977
+ return r.data && Array.isArray(r.data) ? (o("total_rows", r.data.length), r.data.slice(u * (c ?? 50), (u + 1) * (c ?? 50))) : [];
3919
3978
  };
3920
3979
  return I(() => {
3921
- o("useAPIQuery", h);
3980
+ o("useAPIQuery", f);
3922
3981
  }, [t, o]), I(() => {
3923
3982
  if (r.onColumnSort && s !== l?.current?.colSort) {
3924
- const c = r.onColumnSort(s, i, r.data);
3925
- o("total_rows", c.length), o("data", c), l.current.colSort = s, e("refreshCells")?.();
3983
+ const u = r.onColumnSort(s, i, r.data);
3984
+ o("total_rows", u.length), o("data", u), l.current.colSort = s, e("refreshCells")?.();
3926
3985
  }
3927
3986
  }, [s, r.onColumnSort]), I(() => {
3928
3987
  if (r.onColumnFilter && n !== l?.current?.colFilters) {
3929
- const c = r.onColumnFilter(n, i, r.data);
3930
- o("total_rows", c.length), o("data", c), l.current.colFilters = n, e("refreshCells")?.();
3988
+ const u = r.onColumnFilter(n, i, r.data);
3989
+ o("total_rows", u.length), o("data", u), l.current.colFilters = n, e("refreshCells")?.();
3931
3990
  }
3932
3991
  }, [n, r.onColumnFilter]), I(() => {
3933
3992
  if (r.onSearch && a !== l?.current?.searchStr) {
3934
- const c = r.onSearch(a, i, r.data);
3935
- o("total_rows", c.length), o("data", c), l.current.colFilters = n, e("refreshCells")?.();
3993
+ const u = r.onSearch(a, i, r.data);
3994
+ o("total_rows", u.length), o("data", u), l.current.colFilters = n, e("refreshCells")?.();
3936
3995
  }
3937
3996
  }, [a, r.onSearch]), /* @__PURE__ */ d.jsx(d.Fragment, {});
3938
3997
  }
@@ -3994,7 +4053,7 @@ function $r() {
3994
4053
  }));
3995
4054
  return /* @__PURE__ */ d.jsx("div", { "data-tooltip-bar": !0, style: { minHeight: "24px" }, ...o, children: r });
3996
4055
  }
3997
- const Ft = $.memo(() => {
4056
+ const Mt = $.memo(() => {
3998
4057
  const r = U(0), o = U(""), e = U(null), {
3999
4058
  _glideref: t,
4000
4059
  _gridSelectionRows: n,
@@ -4002,16 +4061,16 @@ const Ft = $.memo(() => {
4002
4061
  colOrder: i,
4003
4062
  colSize: a,
4004
4063
  colSort: l,
4005
- columns: h,
4006
- getRowIndexByKey: c,
4007
- getState: u,
4064
+ columns: f,
4065
+ getRowIndexByKey: u,
4066
+ getState: c,
4008
4067
  loadPage: m,
4009
4068
  ready: g,
4010
- scrollToRowKey: v,
4069
+ scrollToRowKey: p,
4011
4070
  searchStr: y,
4012
4071
  selectedRowKey: _,
4013
- selectFirstRowOnMount: x,
4014
- setState: C,
4072
+ selectFirstRowOnMount: C,
4073
+ setState: x,
4015
4074
  setStateFN: R,
4016
4075
  values: O
4017
4076
  } = W((w) => ({
@@ -4037,7 +4096,7 @@ const Ft = $.memo(() => {
4037
4096
  })), N = yn(
4038
4097
  (w) => {
4039
4098
  m(0, "all").then(() => {
4040
- u("refreshCells")?.(), u("_events")?.dispatchEvent?.(
4099
+ c("refreshCells")?.(), c("_events")?.dispatchEvent?.(
4041
4100
  new CustomEvent("onSearched", {
4042
4101
  detail: { search: w }
4043
4102
  })
@@ -4051,16 +4110,16 @@ const Ft = $.memo(() => {
4051
4110
  );
4052
4111
  return I(() => {
4053
4112
  O && (async () => {
4054
- const p = u("_page_data"), E = u("pageSize"), D = u("keyField") ?? "id", L = [];
4055
- for (const F in O) {
4113
+ const S = c("_page_data"), E = c("pageSize"), D = c("keyField") ?? "id", L = [];
4114
+ for (const T in O) {
4056
4115
  let M = -1;
4057
4116
  const A = String(
4058
- typeof O?.[F] == "object" ? O?.[F]?.[D] : typeof O?.[F] == "string" ? O?.[F] : void 0
4117
+ typeof O?.[T] == "object" ? O?.[T]?.[D] : typeof O?.[T] == "string" ? O?.[T] : void 0
4059
4118
  );
4060
- for (const B in p) {
4061
- for (const G in p[B]) {
4119
+ for (const B in S) {
4120
+ for (const G in S[B]) {
4062
4121
  const j = Number(B) * E + Number(G);
4063
- if (String(p[B][G]?.[D]) === A) {
4122
+ if (String(S[B][G]?.[D]) === A) {
4064
4123
  M = j;
4065
4124
  break;
4066
4125
  }
@@ -4071,14 +4130,14 @@ const Ft = $.memo(() => {
4071
4130
  }
4072
4131
  }
4073
4132
  if (!(M >= 0)) {
4074
- const B = await c(A);
4133
+ const B = await u(A);
4075
4134
  B && L.push(B);
4076
4135
  }
4077
4136
  }
4078
4137
  return L;
4079
- })().then((p) => {
4138
+ })().then((S) => {
4080
4139
  let E = ne.empty();
4081
- p.forEach((D) => {
4140
+ S.forEach((D) => {
4082
4141
  E = E.add(D);
4083
4142
  }), R("_gridSelectionRows", () => E), R("_gridSelection", (D) => ({
4084
4143
  columns: D?.columns ?? ne.empty(),
@@ -4087,37 +4146,37 @@ const Ft = $.memo(() => {
4087
4146
  }));
4088
4147
  });
4089
4148
  }, [O]), I(() => {
4090
- const w = u("onChange");
4149
+ const w = c("onChange");
4091
4150
  if (w && typeof w == "function") {
4092
- const E = u("getGridSelectedRows")(), D = u("values");
4151
+ const E = c("getGridSelectedRows")(), D = c("values");
4093
4152
  JSON.stringify(D) !== JSON.stringify(E) && w(E);
4094
4153
  }
4095
- }, [n, n?.length, u]), I(() => {
4096
- C(
4154
+ }, [n, n?.length, c]), I(() => {
4155
+ x(
4097
4156
  "renderColumns",
4098
- h?.map((w) => ({
4157
+ f?.map((w) => ({
4099
4158
  ...w,
4100
4159
  hasMenu: w?.hasMenu ?? !0,
4101
4160
  icon: "sort"
4102
4161
  }))
4103
4162
  );
4104
- }, [h]), I(() => {
4163
+ }, [f]), I(() => {
4105
4164
  if (y == null) {
4106
4165
  o.current = "";
4107
4166
  return;
4108
4167
  }
4109
4168
  o.current !== y && (N(y), o.current = y);
4110
4169
  }, [y]), I(() => {
4111
- l && (C("_gridSelection", {
4170
+ l && (x("_gridSelection", {
4112
4171
  columns: ne.empty(),
4113
4172
  current: void 0,
4114
4173
  rows: ne.empty()
4115
- }), C("_gridSelectionRows", ne.empty()), R("renderColumns", (w) => w?.map((p) => ({
4116
- ...p,
4117
- icon: p.id && l?.find((E) => E.id === p.id)?.direction ? l?.find((E) => E.id === p.id)?.direction === "asc" ? "sortup" : "sortdown" : p.defaultIcon ?? "sort"
4174
+ }), x("_gridSelectionRows", ne.empty()), R("renderColumns", (w) => w?.map((S) => ({
4175
+ ...S,
4176
+ icon: S.id && l?.find((E) => E.id === S.id)?.direction ? l?.find((E) => E.id === S.id)?.direction === "asc" ? "sortup" : "sortdown" : S.defaultIcon ?? "sort"
4118
4177
  }))).then(() => {
4119
4178
  m(0, "all").then(() => {
4120
- u("refreshCells")?.(), u("_events")?.dispatchEvent?.(
4179
+ c("refreshCells")?.(), c("_events")?.dispatchEvent?.(
4121
4180
  new CustomEvent("onColumnSorted", {
4122
4181
  detail: { cols: l }
4123
4182
  })
@@ -4126,66 +4185,66 @@ const Ft = $.memo(() => {
4126
4185
  }));
4127
4186
  }, [l]), I(() => {
4128
4187
  s && JSON.stringify(e.current) !== JSON.stringify(s) && (m(0, "all").then(() => {
4129
- u("refreshCells")?.(), u("_events")?.dispatchEvent?.(
4188
+ c("refreshCells")?.(), c("_events")?.dispatchEvent?.(
4130
4189
  new CustomEvent("onColumnFiltered", {
4131
4190
  detail: { filters: s }
4132
4191
  })
4133
4192
  );
4134
4193
  }), e.current = s);
4135
4194
  }, [s]), I(() => {
4136
- a && R("renderColumns", (w) => w?.map((p) => ({
4137
- ...p,
4138
- width: p.id && a?.[p.id] ? a?.[p.id] : p.width
4195
+ a && R("renderColumns", (w) => w?.map((S) => ({
4196
+ ...S,
4197
+ width: S.id && a?.[S.id] ? a?.[S.id] : S.width
4139
4198
  }))).then(() => {
4140
- u("refreshCells")?.();
4199
+ c("refreshCells")?.();
4141
4200
  });
4142
4201
  }, [a]), I(() => {
4143
4202
  i && R("renderColumns", (w) => w?.sort((E, D) => i[E.id] > i[D.id] ? 1 : -1)).then(() => {
4144
- u("refreshCells")?.();
4203
+ c("refreshCells")?.();
4145
4204
  });
4146
4205
  }, [i]), I(() => {
4147
4206
  t && (r.current > 0 || (r.current = 1, m(0).then(() => {
4148
- u("refreshCells")?.();
4207
+ c("refreshCells")?.();
4149
4208
  })));
4150
4209
  }, [g, m]), I(() => {
4151
- const w = u("_events"), p = () => {
4152
- const E = u("selectFirstRowOnMount");
4153
- if (u("ready") && E) {
4154
- const L = u("scrollToRowKey");
4210
+ const w = c("_events"), S = () => {
4211
+ const E = c("selectFirstRowOnMount");
4212
+ if (c("ready") && E) {
4213
+ const L = c("scrollToRowKey");
4155
4214
  if (L && L >= 0)
4156
4215
  return;
4157
- const F = u("keyField") ?? "id", A = u("_page_data")?.[0]?.[0], B = A?.[F] ?? -1, G = u("values") ?? [];
4216
+ const T = c("keyField") ?? "id", A = c("_page_data")?.[0]?.[0], B = A?.[T] ?? -1, G = c("values") ?? [];
4158
4217
  if (!(O && O.length > 0) && B && B > 0 && (G.length ?? 0) === 0) {
4159
- const j = [A, ...G], J = u("onChange");
4160
- J ? J(j) : C("values", j), C("scrollToRowKey", B);
4218
+ const j = [A, ...G], J = c("onChange");
4219
+ J ? J(j) : x("values", j), x("scrollToRowKey", B);
4161
4220
  }
4162
4221
  }
4163
4222
  };
4164
- return w?.addEventListener("loadPage", p), () => {
4165
- w?.removeEventListener("loadPage", p);
4223
+ return w?.addEventListener("loadPage", S), () => {
4224
+ w?.removeEventListener("loadPage", S);
4166
4225
  };
4167
- }, [g, x]), I(() => {
4168
- const w = u("ready"), p = u("_glideref"), E = u("getRowIndexByKey"), D = _ ?? v;
4169
- D && p && w && E?.(D).then((L) => {
4226
+ }, [g, C]), I(() => {
4227
+ const w = c("ready"), S = c("_glideref"), E = c("getRowIndexByKey"), D = _ ?? p;
4228
+ D && S && w && E?.(D).then((L) => {
4170
4229
  if (L !== void 0) {
4171
4230
  if (_) {
4172
- const F = u("onChange"), M = [{ [u("keyField") ?? "id"]: _ }];
4173
- JSON.stringify(u("values")) !== JSON.stringify(M) && (F ? F(M) : C("values", M));
4231
+ const T = c("onChange"), M = [{ [c("keyField") ?? "id"]: _ }];
4232
+ JSON.stringify(c("values")) !== JSON.stringify(M) && (T ? T(M) : x("values", M));
4174
4233
  }
4175
- p.scrollTo(0, L), u("_events").dispatchEvent(
4234
+ S.scrollTo(0, L), c("_events").dispatchEvent(
4176
4235
  new CustomEvent("scrollToRowKeyFound", {
4177
4236
  detail: {
4178
4237
  rowNumber: L,
4179
- scrollToRowKey: v,
4238
+ scrollToRowKey: p,
4180
4239
  selectedRowKey: _
4181
4240
  }
4182
4241
  })
4183
4242
  );
4184
4243
  }
4185
4244
  });
4186
- }, [v, _]), /* @__PURE__ */ d.jsx(d.Fragment, {});
4245
+ }, [p, _]), /* @__PURE__ */ d.jsx(d.Fragment, {});
4187
4246
  });
4188
- Ft.displayName = "Gridler-Computer";
4247
+ Mt.displayName = "Gridler-Computer";
4189
4248
  function Nr(r, o, e = 1) {
4190
4249
  let t;
4191
4250
  if (o === void 0 ? (t = 0, o = r) : t = r, e === 0)
@@ -4199,7 +4258,7 @@ function Nr(r, o, e = 1) {
4199
4258
  n.push(s);
4200
4259
  return n;
4201
4260
  }
4202
- const Mt = $.memo(() => {
4261
+ const Pt = $.memo(() => {
4203
4262
  const [
4204
4263
  r,
4205
4264
  o,
@@ -4226,15 +4285,15 @@ const Mt = $.memo(() => {
4226
4285
  }, [r]), I(() => {
4227
4286
  if (!e)
4228
4287
  return;
4229
- const l = Math.max(0, Math.floor(t.y / n)), h = Math.floor((t.y + t.height) / n);
4230
- for (const c of Nr(l, h + 1, 1))
4231
- s(c).then(() => {
4232
- const u = o("_page_data")?.[0] ?? {};
4233
- r("isEmpty", u && u.length > 0);
4288
+ const l = Math.max(0, Math.floor(t.y / n)), f = Math.floor((t.y + t.height) / n);
4289
+ for (const u of Nr(l, f + 1, 1))
4290
+ s(u).then(() => {
4291
+ const c = o("_page_data")?.[0] ?? {};
4292
+ r("isEmpty", c && c.length > 0);
4234
4293
  });
4235
4294
  }, [s, n, t, e, i, a]), /* @__PURE__ */ d.jsx(d.Fragment, {});
4236
4295
  });
4237
- Mt.displayName = "Gridler-Pager";
4296
+ Pt.displayName = "Gridler-Pager";
4238
4297
  const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="none">
4239
4298
  <path
4240
4299
  fill="${r.fgColor ?? "currentColor"}"
@@ -4245,9 +4304,9 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4245
4304
  }, Vr = (r) => (o) => o % 2 === 0 ? void 0 : {
4246
4305
  bgCell: r === "dark" ? "#303030" : "#e1effc"
4247
4306
  }, qr = () => {
4248
- const r = nn(), { colorScheme: o } = rn(), { enableOddEvenRowColor: e, focused: t } = W((u) => ({
4249
- enableOddEvenRowColor: u.enableOddEvenRowColor,
4250
- focused: u.focused
4307
+ const r = nn(), { colorScheme: o } = rn(), { enableOddEvenRowColor: e, focused: t } = W((c) => ({
4308
+ enableOddEvenRowColor: c.enableOddEvenRowColor,
4309
+ focused: c.focused
4251
4310
  })), n = {
4252
4311
  auto: t ? Ue(r.colors.blue[4], 0.9) : "#ffffff",
4253
4312
  dark: t ? on("#bacfe0", 0.2) : r.colors.dark[7],
@@ -4281,35 +4340,35 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4281
4340
  }, a = o === "dark" ? s : {
4282
4341
  bgCell: n,
4283
4342
  textGroupHeader: "#2c5491"
4284
- }, [l, h] = le(a);
4343
+ }, [l, f] = se(a);
4285
4344
  return I(() => {
4286
- h(a);
4287
- }, [o, t]), { getRowThemeOverride: (u) => e ? Vr(o)(u) : void 0, gridTheme: l };
4345
+ f(a);
4346
+ }, [o, t]), { getRowThemeOverride: (c) => e ? Vr(o)(c) : void 0, gridTheme: l };
4288
4347
  }, Hr = () => {
4289
4348
  const r = $.useRef(null), o = $.useRef(!1), { height: e, ref: t, width: n } = wn({ box: "content-box" }), {
4290
4349
  _gridSelection: s,
4291
4350
  allowMultiSelect: i,
4292
4351
  focused: a,
4293
4352
  getCellContent: l,
4294
- getCellsForSelection: h,
4295
- getState: c,
4296
- glideProps: u,
4353
+ getCellsForSelection: f,
4354
+ getState: u,
4355
+ glideProps: c,
4297
4356
  hasLocalData: m,
4298
4357
  headerHeight: g,
4299
- heightProp: v,
4358
+ heightProp: p,
4300
4359
  mounted: y,
4301
4360
  onCellActivated: _,
4302
- onCellClicked: x,
4303
- onCellEdited: C,
4361
+ onCellClicked: C,
4362
+ onCellEdited: x,
4304
4363
  onColumnMoved: R,
4305
4364
  onColumnProposeMove: O,
4306
4365
  onColumnResize: N,
4307
4366
  onContextClick: w,
4308
- onHeaderClicked: p,
4367
+ onHeaderClicked: S,
4309
4368
  onHeaderMenuClick: E,
4310
4369
  onItemHovered: D,
4311
4370
  onVisibleRegionChanged: L,
4312
- renderColumns: F,
4371
+ renderColumns: T,
4313
4372
  rowHeight: M,
4314
4373
  sections: A,
4315
4374
  selectMode: B,
@@ -4317,48 +4376,48 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4317
4376
  setStateFN: j,
4318
4377
  total_rows: J,
4319
4378
  widthProp: Y
4320
- } = W((f) => ({
4321
- _gridSelection: f._gridSelection,
4322
- allowMultiSelect: f.allowMultiSelect,
4323
- focused: f.focused,
4324
- getCellContent: f.getCellContent,
4325
- getCellsForSelection: f.getCellsForSelection,
4326
- getState: f.getState,
4327
- glideProps: f.glideProps,
4328
- hasLocalData: f.hasLocalData,
4329
- headerHeight: f.headerHeight,
4330
- heightProp: f.height,
4331
- mounted: f.mounted,
4332
- onCellActivated: f.onCellActivated,
4333
- onCellClicked: f.onCellClicked,
4334
- onCellEdited: f.onCellEdited,
4335
- onColumnMoved: f.onColumnMoved,
4336
- onColumnProposeMove: f.onColumnProposeMove,
4337
- onColumnResize: f.onColumnResize,
4338
- onContextClick: f.onContextClick,
4339
- onHeaderClicked: f.onHeaderClicked,
4340
- onHeaderMenuClick: f.onHeaderMenuClick,
4341
- onItemHovered: f.onItemHovered,
4342
- onVisibleRegionChanged: f.onVisibleRegionChanged,
4343
- renderColumns: f.renderColumns,
4344
- rowHeight: f.rowHeight,
4345
- sections: f.sections,
4346
- selectMode: f.selectMode,
4347
- setState: f.setState,
4348
- setStateFN: f.setStateFN,
4349
- total_rows: f.total_rows,
4350
- widthProp: f.width
4351
- })), Z = bn(r, (f) => {
4352
- j("_glideref", () => f ?? void 0);
4353
- const b = c("ready"), k = !!(f && y);
4379
+ } = W((h) => ({
4380
+ _gridSelection: h._gridSelection,
4381
+ allowMultiSelect: h.allowMultiSelect,
4382
+ focused: h.focused,
4383
+ getCellContent: h.getCellContent,
4384
+ getCellsForSelection: h.getCellsForSelection,
4385
+ getState: h.getState,
4386
+ glideProps: h.glideProps,
4387
+ hasLocalData: h.hasLocalData,
4388
+ headerHeight: h.headerHeight,
4389
+ heightProp: h.height,
4390
+ mounted: h.mounted,
4391
+ onCellActivated: h.onCellActivated,
4392
+ onCellClicked: h.onCellClicked,
4393
+ onCellEdited: h.onCellEdited,
4394
+ onColumnMoved: h.onColumnMoved,
4395
+ onColumnProposeMove: h.onColumnProposeMove,
4396
+ onColumnResize: h.onColumnResize,
4397
+ onContextClick: h.onContextClick,
4398
+ onHeaderClicked: h.onHeaderClicked,
4399
+ onHeaderMenuClick: h.onHeaderMenuClick,
4400
+ onItemHovered: h.onItemHovered,
4401
+ onVisibleRegionChanged: h.onVisibleRegionChanged,
4402
+ renderColumns: h.renderColumns,
4403
+ rowHeight: h.rowHeight,
4404
+ sections: h.sections,
4405
+ selectMode: h.selectMode,
4406
+ setState: h.setState,
4407
+ setStateFN: h.setStateFN,
4408
+ total_rows: h.total_rows,
4409
+ widthProp: h.width
4410
+ })), Z = bn(r, (h) => {
4411
+ j("_glideref", () => h ?? void 0);
4412
+ const b = u("ready"), k = !!(h && y);
4354
4413
  b !== k && G("ready", k);
4355
4414
  }), q = qr();
4356
4415
  return /* @__PURE__ */ d.jsxs(
4357
- wt,
4416
+ bt,
4358
4417
  {
4359
4418
  align: "stretch",
4360
4419
  gap: 0,
4361
- h: v ?? "100%",
4420
+ h: p ?? "100%",
4362
4421
  justify: "stretch",
4363
4422
  w: Y ?? "100%",
4364
4423
  children: [
@@ -4368,8 +4427,8 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4368
4427
  {
4369
4428
  className: Gr.container,
4370
4429
  "data-focused": a,
4371
- onContextMenu: (f) => {
4372
- f.preventDefault(), o.current || (o.current = !0, w("other", f), setTimeout(() => {
4430
+ onContextMenu: (h) => {
4431
+ h.preventDefault(), o.current || (o.current = !0, w("other", h), setTimeout(() => {
4373
4432
  o.current = !1;
4374
4433
  }, 100));
4375
4434
  },
@@ -4387,7 +4446,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4387
4446
  vn,
4388
4447
  {
4389
4448
  cellActivationBehavior: "double-click",
4390
- columns: F ?? [],
4449
+ columns: T ?? [],
4391
4450
  columnSelect: "none",
4392
4451
  drawFocusRing: !0,
4393
4452
  height: e ?? 400,
@@ -4405,40 +4464,40 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4405
4464
  rowSelect: i ? "multi" : "single",
4406
4465
  rowSelectionMode: "auto",
4407
4466
  spanRangeBehavior: "default",
4408
- ...u,
4467
+ ...c,
4409
4468
  getCellContent: l,
4410
- getCellsForSelection: h,
4469
+ getCellsForSelection: f,
4411
4470
  getRowThemeOverride: q.getRowThemeOverride,
4412
4471
  gridSelection: s,
4413
4472
  headerHeight: g ?? 32,
4414
4473
  headerIcons: { sort: Lr, sortdown: Ne, sortup: Le },
4415
4474
  onCellActivated: _,
4416
- onCellClicked: x,
4417
- onCellContextMenu: (f, b) => {
4418
- b.preventDefault(), u?.onCellContextMenu?.(f, b), o.current || (o.current = !0, w("cell", b, f[0], f[1]), setTimeout(() => {
4475
+ onCellClicked: C,
4476
+ onCellContextMenu: (h, b) => {
4477
+ b.preventDefault(), c?.onCellContextMenu?.(h, b), o.current || (o.current = !0, w("cell", b, h[0], h[1]), setTimeout(() => {
4419
4478
  o.current = !1;
4420
4479
  }, 100));
4421
4480
  },
4422
- onCellEdited: C,
4481
+ onCellEdited: x,
4423
4482
  onColumnMoved: R,
4424
4483
  onColumnProposeMove: O,
4425
4484
  onColumnResize: N,
4426
- onGridSelectionChange: (f) => {
4485
+ onGridSelectionChange: (h) => {
4427
4486
  let b = ne.empty();
4428
- const k = c("_gridSelection"), S = c("keyField") ?? "id", z = c("getRowBuffer");
4429
- for (const P of f.rows)
4430
- z && z(P)?.[S] && (b = b.hasIndex(P) ? b : b.add(P));
4431
- if (B === "row" && f.current?.range)
4432
- for (let P = f.current.range.y; P < f.current.range.y + f.current.range.height; P++)
4433
- z && z(P)?.[S] && (b = b.hasIndex(P) ? b : b.add(P));
4487
+ const k = u("_gridSelection"), v = u("keyField") ?? "id", z = u("getRowBuffer");
4488
+ for (const P of h.rows)
4489
+ z && z(P)?.[v] && (b = b.hasIndex(P) ? b : b.add(P));
4490
+ if (B === "row" && h.current?.range)
4491
+ for (let P = h.current.range.y; P < h.current.range.y + h.current.range.height; P++)
4492
+ z && z(P)?.[v] && (b = b.hasIndex(P) ? b : b.add(P));
4434
4493
  if (b.length === 0)
4435
4494
  for (const P of k?.rows ?? [])
4436
- z && z(P)?.[S] && (b = b.hasIndex(P) ? b : b.add(P));
4437
- console.log("Debug:onGridSelectionChange", k, f), (JSON.stringify(k?.columns) !== JSON.stringify(f.columns) || JSON.stringify(k?.rows) !== JSON.stringify(b) || JSON.stringify(k?.current) !== JSON.stringify(f.current)) && (G("_gridSelection", { ...f, rows: b }), G("_gridSelectionRows", b));
4495
+ z && z(P)?.[v] && (b = b.hasIndex(P) ? b : b.add(P));
4496
+ console.log("Debug:onGridSelectionChange", k, h), (JSON.stringify(k?.columns) !== JSON.stringify(h.columns) || JSON.stringify(k?.rows) !== JSON.stringify(b) || JSON.stringify(k?.current) !== JSON.stringify(h.current)) && (G("_gridSelection", { ...h, rows: b }), G("_gridSelectionRows", b));
4438
4497
  },
4439
- onHeaderClicked: p,
4440
- onHeaderContextMenu: (f, b) => {
4441
- b.preventDefault(), o.current || (o.current = !0, w("header", b, f), setTimeout(() => {
4498
+ onHeaderClicked: S,
4499
+ onHeaderContextMenu: (h, b) => {
4500
+ b.preventDefault(), o.current || (o.current = !0, w("header", b, h), setTimeout(() => {
4442
4501
  o.current = !1;
4443
4502
  }, 100));
4444
4503
  },
@@ -4457,8 +4516,8 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4457
4516
  width: n ?? 200
4458
4517
  }
4459
4518
  ),
4460
- /* @__PURE__ */ d.jsx(Ft, {}),
4461
- !m && /* @__PURE__ */ d.jsx(Mt, {}),
4519
+ /* @__PURE__ */ d.jsx(Mt, {}),
4520
+ !m && /* @__PURE__ */ d.jsx(Pt, {}),
4462
4521
  A?.right
4463
4522
  ]
4464
4523
  }
@@ -4485,13 +4544,13 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4485
4544
  r.children
4486
4545
  ]
4487
4546
  }
4488
- ) }), Pt = $.forwardRef(Wr);
4489
- Pt.FormAdaptor = Fr;
4490
- Pt.LocalDataAdaptor = Tt;
4547
+ ) }), Dt = $.forwardRef(Wr);
4548
+ Dt.FormAdaptor = Tr;
4549
+ Dt.LocalDataAdaptor = Tt;
4491
4550
  export {
4492
4551
  Bn as Boxer,
4493
4552
  $n as BoxerProvider,
4494
- fo as ButtonCtrl,
4553
+ ho as ButtonCtrl,
4495
4554
  Ir as ColumnFilterInput,
4496
4555
  kr as ColumnFilterInputOperator,
4497
4556
  vt as ColumnFilterSet,
@@ -4504,33 +4563,34 @@ export {
4504
4563
  io as FormerResolveSpecAPI,
4505
4564
  ao as FormerRestHeadSpecAPI,
4506
4565
  yr as GetGlobalState,
4507
- Tr as GlidlerAPIAdaptorForGoLangv2,
4508
- Fr as GlidlerFormAdaptor,
4566
+ Fr as GlidlerAPIAdaptorForGoLangv2,
4567
+ Tr as GlidlerFormAdaptor,
4509
4568
  Tt as GlidlerLocalDataAdaptor,
4510
4569
  V as GlobalStateStore,
4511
- Eo as GlobalStateStoreProvider,
4570
+ Oo as GlobalStateStoreProvider,
4512
4571
  fe as GoAPIHeaders,
4513
- Pt as Gridler,
4572
+ Dt as Gridler,
4514
4573
  Pr as GridlerRightMenuIcon,
4515
- ho as IconButtonCtrl,
4574
+ mo as IconButtonCtrl,
4516
4575
  Or as MantineBetterMenusProvider,
4517
- mo as NativeSelectCtrl,
4518
- go as PasswordInputCtrl,
4576
+ go as NativeSelectCtrl,
4577
+ po as PasswordInputCtrl,
4519
4578
  oo as ReactBasicErrorBoundary,
4520
4579
  so as ReactErrorBoundary,
4521
- po as SwitchCtrl,
4522
- So as TextAreaCtrl,
4523
- vo as TextInputCtrl,
4580
+ So as SwitchCtrl,
4581
+ vo as TextAreaCtrl,
4582
+ yo as TextInputCtrl,
4524
4583
  De as errorManager,
4525
- bo as getApiURL,
4526
- xo as getAuthToken,
4527
- _o as isLoggedIn,
4528
- wo as setApiURL,
4529
- Co as setAuthToken,
4584
+ xo as getApiURL,
4585
+ _o as getAuthToken,
4586
+ Co as isLoggedIn,
4587
+ bo as setApiURL,
4588
+ Eo as setAuthToken,
4530
4589
  Nn as useBoxerStore,
4531
- yo as useGlobalStateStore,
4532
- Oo as useGlobalStateStoreContext,
4590
+ fo as useFormerState,
4591
+ wo as useGlobalStateStore,
4592
+ Ro as useGlobalStateStoreContext,
4533
4593
  W as useGridlerStore,
4534
- jt as useMantineBetterMenus
4594
+ At as useMantineBetterMenus
4535
4595
  };
4536
4596
  //# sourceMappingURL=lib.es.js.map