@featherk/composables 0.13.3 → 0.13.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,40 +1,40 @@
1
- import { ref as X, onBeforeUnmount as qe, nextTick as j, computed as y, watchEffect as Oe, toValue as ne, reactive as Ke, watch as le, useId as ze, unref as Ue, onUnmounted as Te, shallowRef as ye, shallowReactive as Be, readonly as ee, onMounted as Re } from "vue";
2
- import { useFocusTrap as Ye } from "@vueuse/integrations/useFocusTrap";
3
- const bt = (e, t) => {
4
- const n = X(null);
5
- let p = !1, a = null, d = null;
6
- const b = [], D = ".k-table-row[data-grid-row-index] [tabindex]", O = () => {
7
- const c = e?.value?.$el;
8
- return c ? c.closest(".k-grid") : null;
9
- }, K = (c) => {
10
- const A = O();
11
- if (!A) return !1;
12
- const g = c.closest(".k-grid-aria-root");
13
- if (g)
14
- return A.contains(g);
15
- const w = c.closest(
1
+ import { ref as H, onBeforeUnmount as Ue, nextTick as G, computed as h, watchEffect as Ne, toValue as re, reactive as Be, watch as ae, useId as Ye, unref as He, onUnmounted as Te, shallowRef as ve, shallowReactive as We, readonly as te, isRef as Fe, onScopeDispose as Xe, onMounted as Re } from "vue";
2
+ import { useFocusTrap as Ze } from "@vueuse/integrations/useFocusTrap";
3
+ const Et = (e, t) => {
4
+ const n = H(null);
5
+ let u = !1, a = null, c = null;
6
+ const w = [], S = ".k-table-row[data-grid-row-index] [tabindex]", L = () => {
7
+ const s = e?.value?.$el;
8
+ return s ? s.closest(".k-grid") : null;
9
+ }, z = (s) => {
10
+ const x = L();
11
+ if (!x) return !1;
12
+ const v = s.closest(".k-grid-aria-root");
13
+ if (v)
14
+ return x.contains(v);
15
+ const D = s.closest(
16
16
  ".k-grid-header, .k-grid-content, .k-grid-content-locked"
17
17
  );
18
- return w ? A.contains(w) : !1;
19
- }, M = (c) => c.key === "Enter" || c.code === "Enter" || c.code === "NumpadEnter", R = () => e?.value?.columns, k = (c) => {
20
- const A = c.key || c.code;
21
- ([" ", "Spacebar", "Space"].includes(A) || M(c)) && (c.preventDefault(), c.stopPropagation(), n.value = c.target, c.target.click());
22
- }, x = (c) => {
18
+ return D ? x.contains(D) : !1;
19
+ }, I = (s) => s.key === "Enter" || s.code === "Enter" || s.code === "NumpadEnter", F = () => e?.value?.columns, M = (s) => {
20
+ const x = s.key || s.code;
21
+ ([" ", "Spacebar", "Space"].includes(x) || I(s)) && (s.preventDefault(), s.stopPropagation(), n.value = s.target, s.target.click());
22
+ }, E = (s) => {
23
23
  if (!n.value) return;
24
- if (c.code === "Escape") {
25
- c.stopPropagation(), n.value && n.value.focus();
24
+ if (s.code === "Escape") {
25
+ s.stopPropagation(), n.value && n.value.focus();
26
26
  return;
27
27
  }
28
- const A = Array.from(
28
+ const x = Array.from(
29
29
  document.querySelectorAll(
30
30
  ".k-animation-container .k-popup .k-column-menu .k-columnmenu-item-wrapper .k-columnmenu-item"
31
31
  )
32
- ), g = document.querySelector(
32
+ ), v = document.querySelector(
33
33
  ".k-animation-container .k-popup .k-column-menu .k-filter-menu-container"
34
34
  );
35
- if (g) {
36
- if (c.code === "Tab") {
37
- const w = [
35
+ if (v) {
36
+ if (s.code === "Tab") {
37
+ const D = [
38
38
  // ".k-filter-menu-container .k-dropdownlist[tabindex='0']",
39
39
  // ".k-filter-menu-container input.k-input-inner:not([tabindex='-1']):not([disabled])",
40
40
  // ".k-filter-menu-container button:not([tabindex='-1']):not([disabled])",
@@ -43,88 +43,88 @@ const bt = (e, t) => {
43
43
  "input.k-input-inner:not([tabindex='-1']):not([disabled])",
44
44
  "button:not([tabindex='-1']):not([disabled])",
45
45
  ".k-checkbox"
46
- ], C = t?.focusableMenuSelectors ?? w, E = Array.from(
47
- g.querySelectorAll(C.join(","))
46
+ ], T = t?.focusableMenuSelectors ?? D, k = Array.from(
47
+ v.querySelectorAll(T.join(","))
48
48
  );
49
- if (E.length === 0) return;
50
- const F = E.findIndex(
49
+ if (k.length === 0) return;
50
+ const O = k.findIndex(
51
51
  (_) => _ === document.activeElement
52
52
  );
53
- let U;
54
- F === -1 ? U = 0 : c.shiftKey ? U = (F - 1 + E.length) % E.length : U = (F + 1) % E.length, c.preventDefault(), c.stopPropagation(), E[U]?.focus();
53
+ let W;
54
+ O === -1 ? W = 0 : s.shiftKey ? W = (O - 1 + k.length) % k.length : W = (O + 1) % k.length, s.preventDefault(), s.stopPropagation(), k[W]?.focus();
55
55
  }
56
- } else if (c.code === "ArrowUp" || c.code === "ArrowDown") {
57
- c.preventDefault(), c.stopPropagation();
58
- const w = A.findIndex(
59
- (E) => E === document.activeElement
56
+ } else if (s.code === "ArrowUp" || s.code === "ArrowDown") {
57
+ s.preventDefault(), s.stopPropagation();
58
+ const D = x.findIndex(
59
+ (k) => k === document.activeElement
60
60
  );
61
- let C = w;
62
- c.code === "ArrowUp" ? C = w > 0 ? w - 1 : A.length - 1 : c.code === "ArrowDown" && (C = w < A.length - 1 ? w + 1 : 0), A[C]?.focus();
61
+ let T = D;
62
+ s.code === "ArrowUp" ? T = D > 0 ? D - 1 : x.length - 1 : s.code === "ArrowDown" && (T = D < x.length - 1 ? D + 1 : 0), x[T]?.focus();
63
63
  return;
64
64
  }
65
- if (c.code === "Tab") {
66
- c.preventDefault(), c.stopPropagation();
67
- const w = n.value?.parentElement;
68
- (c.shiftKey ? w?.previousElementSibling : w?.nextElementSibling)?.querySelector(
65
+ if (s.code === "Tab") {
66
+ s.preventDefault(), s.stopPropagation();
67
+ const D = n.value?.parentElement;
68
+ (s.shiftKey ? D?.previousElementSibling : D?.nextElementSibling)?.querySelector(
69
69
  "button, [role='button'], .k-link"
70
70
  )?.focus();
71
71
  }
72
- }, $ = () => {
73
- a = new MutationObserver((c) => {
74
- c.forEach((A) => {
75
- A.addedNodes.forEach((g) => {
76
- if (g.nodeType === Node.ELEMENT_NODE) {
77
- const w = g;
78
- if (w.classList.contains("k-animation-container")) {
79
- const E = n.value;
80
- E && (E.dataset.featherKSortable === "true" || j(() => {
81
- w.querySelectorAll(
72
+ }, N = () => {
73
+ a = new MutationObserver((s) => {
74
+ s.forEach((x) => {
75
+ x.addedNodes.forEach((v) => {
76
+ if (v.nodeType === Node.ELEMENT_NODE) {
77
+ const D = v;
78
+ if (D.classList.contains("k-animation-container")) {
79
+ const k = n.value;
80
+ k && (k.dataset.featherKSortable === "true" || G(() => {
81
+ D.querySelectorAll(
82
82
  ".k-columnmenu-item-wrapper"
83
83
  ).forEach((_) => {
84
84
  _.textContent?.toLowerCase().includes("sort") && _.remove();
85
85
  });
86
- })), w.addEventListener(
86
+ })), D.addEventListener(
87
87
  "keydown",
88
- x
89
- ), j(() => {
90
- const F = () => {
91
- const U = Array.from(
92
- w.querySelectorAll(
88
+ E
89
+ ), G(() => {
90
+ const O = () => {
91
+ const W = Array.from(
92
+ D.querySelectorAll(
93
93
  ".k-animation-container .k-popup .k-column-menu .k-columnmenu-item-wrapper .k-columnmenu-item"
94
94
  )
95
95
  );
96
- if (U.length === 1)
97
- U[0].focus(), U[0].click(), F.attempts = 0;
98
- else if (U.length > 1) {
99
- F.attempts = 0;
96
+ if (W.length === 1)
97
+ W[0].focus(), W[0].click(), O.attempts = 0;
98
+ else if (W.length > 1) {
99
+ O.attempts = 0;
100
100
  return;
101
101
  } else
102
- F.attempts === void 0 && (F.attempts = 0), F.attempts++ < 3 && setTimeout(F, 200);
102
+ O.attempts === void 0 && (O.attempts = 0), O.attempts++ < 3 && setTimeout(O, 200);
103
103
  };
104
- F();
104
+ O();
105
105
  });
106
106
  }
107
- w.querySelectorAll(
107
+ D.querySelectorAll(
108
108
  ".k-animation-container"
109
- ).forEach((E) => {
110
- E.addEventListener(
109
+ ).forEach((k) => {
110
+ k.addEventListener(
111
111
  "keydown",
112
- x
112
+ E
113
113
  );
114
114
  });
115
115
  }
116
- }), A.removedNodes.forEach((g) => {
117
- if (g.nodeType === Node.ELEMENT_NODE) {
118
- const w = g;
119
- w.classList.contains("k-animation-container") && w.removeEventListener(
116
+ }), x.removedNodes.forEach((v) => {
117
+ if (v.nodeType === Node.ELEMENT_NODE) {
118
+ const D = v;
119
+ D.classList.contains("k-animation-container") && D.removeEventListener(
120
120
  "keydown",
121
- x
122
- ), w.querySelectorAll(
121
+ E
122
+ ), D.querySelectorAll(
123
123
  ".k-animation-container"
124
- ).forEach((E) => {
125
- E.removeEventListener(
124
+ ).forEach((k) => {
125
+ k.removeEventListener(
126
126
  "keydown",
127
- x
127
+ E
128
128
  );
129
129
  });
130
130
  }
@@ -134,38 +134,38 @@ const bt = (e, t) => {
134
134
  childList: !0,
135
135
  subtree: !0
136
136
  });
137
- }, f = (c) => {
138
- const A = c.tagName.toLowerCase();
139
- return !!(["input", "textarea", "select", "button"].includes(A) || c.closest(
137
+ }, f = (s) => {
138
+ const x = s.tagName.toLowerCase();
139
+ return !!(["input", "textarea", "select", "button"].includes(x) || s.closest(
140
140
  '.k-picker-wrap, .k-input-inner, .k-textbox, [role="combobox"]'
141
141
  ));
142
- }, u = (c) => {
143
- if (!c.type || !c)
142
+ }, i = (s) => {
143
+ if (!s.type || !s)
144
144
  return;
145
- const A = c.target;
146
- if (!A) return;
147
- const g = A.closest(
145
+ const x = s.target;
146
+ if (!x) return;
147
+ const v = x.closest(
148
148
  ".k-table-row[data-grid-row-index]"
149
149
  );
150
- if (!K(A))
150
+ if (!z(x))
151
151
  return;
152
- const w = ["ArrowLeft", "ArrowRight"].includes(
153
- c.code
152
+ const D = ["ArrowLeft", "ArrowRight"].includes(
153
+ s.code
154
154
  );
155
- if (!(f(A) && !(g && w))) {
156
- if (c.code === "Escape") {
157
- const C = document.activeElement?.closest(".k-table-row[data-grid-row-index]");
158
- if (C) {
159
- c.preventDefault(), c.stopPropagation();
155
+ if (!(f(x) && !(v && D))) {
156
+ if (s.code === "Escape") {
157
+ const T = document.activeElement?.closest(".k-table-row[data-grid-row-index]");
158
+ if (T) {
159
+ s.preventDefault(), s.stopPropagation();
160
160
  try {
161
161
  Array.from(
162
162
  e?.value.$el.querySelectorAll(
163
163
  ".k-table-row[data-grid-row-index]"
164
164
  )
165
- ).forEach((F) => F.setAttribute("tabindex", "-1"));
165
+ ).forEach((O) => O.setAttribute("tabindex", "-1"));
166
166
  } catch {
167
167
  }
168
- C.setAttribute("tabindex", "0"), C.focus();
168
+ T.setAttribute("tabindex", "0"), T.focus();
169
169
  return;
170
170
  }
171
171
  }
@@ -177,221 +177,221 @@ const bt = (e, t) => {
177
177
  "Enter",
178
178
  "NumpadEnter",
179
179
  "Space"
180
- ].includes(c.code)) {
181
- if (A.classList.contains("k-grid-header-menu") && A.classList.contains("k-grid-column-menu")) {
182
- n.value = A;
180
+ ].includes(s.code)) {
181
+ if (x.classList.contains("k-grid-header-menu") && x.classList.contains("k-grid-column-menu")) {
182
+ n.value = x;
183
183
  return;
184
184
  }
185
- if (g) {
186
- if (["ArrowDown", "ArrowUp"].includes(c.code)) {
187
- c.preventDefault(), c.stopPropagation();
188
- const C = (F, U) => {
189
- let _ = U === "next" ? F.nextElementSibling : F.previousElementSibling;
185
+ if (v) {
186
+ if (["ArrowDown", "ArrowUp"].includes(s.code)) {
187
+ s.preventDefault(), s.stopPropagation();
188
+ const T = (O, W) => {
189
+ let _ = W === "next" ? O.nextElementSibling : O.previousElementSibling;
190
190
  for (; _; ) {
191
- const re = _;
191
+ const ne = _;
192
192
  try {
193
- if (re.classList.contains("k-table-row"))
194
- return re;
193
+ if (ne.classList.contains("k-table-row"))
194
+ return ne;
195
195
  } catch {
196
196
  }
197
- _ = U === "next" ? _.nextElementSibling : _.previousElementSibling;
197
+ _ = W === "next" ? _.nextElementSibling : _.previousElementSibling;
198
198
  }
199
199
  return null;
200
- }, E = c.code === "ArrowDown" ? C(g, "next") : C(g, "previous");
201
- E && (g.setAttribute("tabindex", "-1"), E.setAttribute("tabindex", "0"), E.focus());
200
+ }, k = s.code === "ArrowDown" ? T(v, "next") : T(v, "previous");
201
+ k && (v.setAttribute("tabindex", "-1"), k.setAttribute("tabindex", "0"), k.focus());
202
202
  return;
203
203
  }
204
- if (["ArrowLeft", "ArrowRight"].includes(c.code)) {
205
- c.preventDefault(), c.stopPropagation();
206
- const C = g.querySelectorAll(
207
- D
204
+ if (["ArrowLeft", "ArrowRight"].includes(s.code)) {
205
+ s.preventDefault(), s.stopPropagation();
206
+ const T = v.querySelectorAll(
207
+ S
208
208
  );
209
- if (C.length === 0) return;
210
- let E = Array.from(C).findIndex(
211
- (F) => F === document.activeElement
209
+ if (T.length === 0) return;
210
+ let k = Array.from(T).findIndex(
211
+ (O) => O === document.activeElement
212
212
  );
213
- if (E === -1 && document.activeElement === g) {
214
- C[0].focus();
213
+ if (k === -1 && document.activeElement === v) {
214
+ T[0].focus();
215
215
  return;
216
216
  }
217
- c.code === "ArrowRight" ? E = E === C.length - 1 ? 0 : E + 1 : c.code === "ArrowLeft" && (E = E === 0 ? C.length - 1 : E - 1), C[E].focus();
217
+ s.code === "ArrowRight" ? k = k === T.length - 1 ? 0 : k + 1 : s.code === "ArrowLeft" && (k = k === 0 ? T.length - 1 : k - 1), T[k].focus();
218
218
  return;
219
219
  }
220
220
  }
221
221
  }
222
222
  }
223
- }, v = () => {
224
- j(() => {
225
- const c = e.value?.$el;
226
- if (!c || typeof c.closest != "function") return;
227
- const A = c.closest(".k-grid");
228
- A && A.classList.add("fk-grid");
223
+ }, m = () => {
224
+ G(() => {
225
+ const s = e.value?.$el;
226
+ if (!s || typeof s.closest != "function") return;
227
+ const x = s.closest(".k-grid");
228
+ x && x.classList.add("fk-grid");
229
229
  });
230
- }, I = () => {
231
- if (!d)
230
+ }, C = () => {
231
+ if (!c)
232
232
  try {
233
- const c = () => {
233
+ const s = () => {
234
234
  try {
235
- const w = Array.from(
235
+ const D = Array.from(
236
236
  e.value.$el.querySelectorAll(
237
237
  ".k-table-row[data-grid-row-index]"
238
238
  )
239
239
  );
240
- if (!w || w.length === 0 || w.filter(
241
- (F) => F.getAttribute("tabindex") === "0"
240
+ if (!D || D.length === 0 || D.filter(
241
+ (O) => O.getAttribute("tabindex") === "0"
242
242
  ).length === 1) return;
243
- const E = w.find(
244
- (F) => F === document.activeElement || F.contains(document.activeElement)
243
+ const k = D.find(
244
+ (O) => O === document.activeElement || O.contains(document.activeElement)
245
245
  );
246
- if (w.forEach((F) => F.setAttribute("tabindex", "-1")), E) {
247
- E.setAttribute("tabindex", "0");
246
+ if (D.forEach((O) => O.setAttribute("tabindex", "-1")), k) {
247
+ k.setAttribute("tabindex", "0");
248
248
  return;
249
249
  }
250
- w[0].setAttribute("tabindex", "0");
251
- } catch (w) {
252
- console.error("ensureSingleTabindex error:", w);
250
+ D[0].setAttribute("tabindex", "0");
251
+ } catch (D) {
252
+ console.error("ensureSingleTabindex error:", D);
253
253
  }
254
- }, A = Array.from(
254
+ }, x = Array.from(
255
255
  e.value.$el.querySelectorAll(
256
256
  ".k-table-row[data-grid-row-index]"
257
257
  )
258
258
  );
259
- A.length > 0 && A.forEach((w, C) => {
260
- w.setAttribute("tabindex", C === 0 ? "0" : "-1");
259
+ x.length > 0 && x.forEach((D, T) => {
260
+ D.setAttribute("tabindex", T === 0 ? "0" : "-1");
261
261
  });
262
- const g = e.value.$el.querySelector(".k-table-tbody");
263
- g && (d = new MutationObserver(() => {
264
- c();
265
- }), d.observe(g, { childList: !0, subtree: !0 }));
266
- } catch (c) {
267
- console.error("Error setting up row navigation:", c);
262
+ const v = e.value.$el.querySelector(".k-table-tbody");
263
+ v && (c = new MutationObserver(() => {
264
+ s();
265
+ }), c.observe(v, { childList: !0, subtree: !0 }));
266
+ } catch (s) {
267
+ console.error("Error setting up row navigation:", s);
268
268
  }
269
- }, q = () => {
270
- j(() => {
271
- const A = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
272
- A && A.forEach((g) => {
273
- g.setAttribute("role", "button"), g.addEventListener(
269
+ }, K = () => {
270
+ G(() => {
271
+ const x = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
272
+ x && x.forEach((v) => {
273
+ v.setAttribute("role", "button"), v.addEventListener(
274
274
  "keydown",
275
- k
275
+ M
276
276
  );
277
- }), $(), B();
277
+ }), N(), A();
278
278
  });
279
- }, W = () => {
280
- const A = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
281
- A && A.forEach((g) => {
282
- g.removeEventListener(
279
+ }, P = () => {
280
+ const x = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
281
+ x && x.forEach((v) => {
282
+ v.removeEventListener(
283
283
  "keydown",
284
- k
284
+ M
285
285
  );
286
- }), a && (a.disconnect(), a = null), d && (d.disconnect(), d = null), b.forEach((g) => g()), b.length = 0;
287
- }, B = () => {
286
+ }), a && (a.disconnect(), a = null), c && (c.disconnect(), c = null), w.forEach((v) => v()), w.length = 0;
287
+ }, A = () => {
288
288
  document.querySelectorAll(
289
289
  ".k-grid-header .k-table-thead th"
290
- ).forEach((g, w) => {
291
- if (g.dataset.featherKHeaderBound === "true")
290
+ ).forEach((v, D) => {
291
+ if (v.dataset.featherKHeaderBound === "true")
292
292
  return;
293
- const C = g.querySelector(
293
+ const T = v.querySelector(
294
294
  ".k-grid-header-menu.k-grid-column-menu"
295
295
  );
296
- if (!C) return;
297
- const E = R();
298
- if (E && E[w]) {
299
- const o = E[w].field ?? "";
300
- g.setAttribute("data-feather-k-field", o), g.setAttribute(
296
+ if (!T) return;
297
+ const k = F();
298
+ if (k && k[D]) {
299
+ const o = k[D].field ?? "";
300
+ v.setAttribute("data-feather-k-field", o), v.setAttribute(
301
301
  "data-feather-k-filterable",
302
- E[w].filterable === !1 ? "false" : "true"
303
- ), g.setAttribute(
302
+ k[D].filterable === !1 ? "false" : "true"
303
+ ), v.setAttribute(
304
304
  "data-feather-k-sortable",
305
- E[w].sortable === !1 ? "false" : "true"
305
+ k[D].sortable === !1 ? "false" : "true"
306
306
  );
307
307
  }
308
- const F = g.dataset.featherKFilterable !== "false", U = g.dataset.featherKSortable !== "false";
309
- C.setAttribute("tabindex", "-1"), F || U ? g.style.cursor = "pointer" : g.style.cursor = "default", F ? (g.setAttribute("tabindex", "0"), g.setAttribute("role", "button"), g.setAttribute("aria-haspopup", "menu")) : (g.setAttribute("tabindex", "0"), g.setAttribute("role", "columnheader"), g.removeAttribute("aria-haspopup"));
308
+ const O = v.dataset.featherKFilterable !== "false", W = v.dataset.featherKSortable !== "false";
309
+ T.setAttribute("tabindex", "-1"), O || W ? v.style.cursor = "pointer" : v.style.cursor = "default", O ? (v.setAttribute("tabindex", "0"), v.setAttribute("role", "button"), v.setAttribute("aria-haspopup", "menu")) : (v.setAttribute("tabindex", "0"), v.setAttribute("role", "columnheader"), v.removeAttribute("aria-haspopup"));
310
310
  const _ = (o) => {
311
- o.target?.closest(".k-column-resizer") || (n.value = g, C.click());
312
- }, re = (o) => {
313
- if (F)
314
- n.value = g, o.preventDefault(), o.stopPropagation(), _(o);
315
- else if (U) {
316
- n.value = g;
317
- const S = g.querySelector(".k-link");
318
- S && S.click();
311
+ o.target?.closest(".k-column-resizer") || (n.value = v, T.click());
312
+ }, ne = (o) => {
313
+ if (O)
314
+ n.value = v, o.preventDefault(), o.stopPropagation(), _(o);
315
+ else if (W) {
316
+ n.value = v;
317
+ const b = v.querySelector(".k-link");
318
+ b && b.click();
319
319
  }
320
320
  };
321
- g.addEventListener("click", re), b.push(() => {
322
- g.removeEventListener("click", re);
321
+ v.addEventListener("click", ne), w.push(() => {
322
+ v.removeEventListener("click", ne);
323
323
  });
324
324
  const ue = (o) => {
325
- if ((M(o) || o.code === "Space") && (F || U)) {
326
- if (o.preventDefault(), o.stopPropagation(), n.value = g, n.value.focus(), F)
325
+ if ((I(o) || o.code === "Space") && (O || W)) {
326
+ if (o.preventDefault(), o.stopPropagation(), n.value = v, n.value.focus(), O)
327
327
  _(o);
328
- else if (U) {
329
- const S = g.querySelector(".k-link");
330
- S && S.click();
328
+ else if (W) {
329
+ const b = v.querySelector(".k-link");
330
+ b && b.click();
331
331
  }
332
332
  }
333
333
  };
334
- g.addEventListener("keydown", ue, !0), b.push(() => {
335
- g.removeEventListener("keydown", ue, !0);
336
- }), g.dataset.featherKHeaderBound = "true";
334
+ v.addEventListener("keydown", ue, !0), w.push(() => {
335
+ v.removeEventListener("keydown", ue, !0);
336
+ }), v.dataset.featherKHeaderBound = "true";
337
337
  });
338
- const A = document.querySelector(".k-grid-header .k-table-thead");
339
- if (A && A.dataset.featherKHeaderBound !== "true") {
340
- const g = (w) => {
341
- const C = w.target.closest("th");
342
- C && (M(w) || w.code === "Space") && C.dataset.featherKFilterable === "false" && C.dataset.featherKSortable === "false" && (w.preventDefault(), w.stopImmediatePropagation());
338
+ const x = document.querySelector(".k-grid-header .k-table-thead");
339
+ if (x && x.dataset.featherKHeaderBound !== "true") {
340
+ const v = (D) => {
341
+ const T = D.target.closest("th");
342
+ T && (I(D) || D.code === "Space") && T.dataset.featherKFilterable === "false" && T.dataset.featherKSortable === "false" && (D.preventDefault(), D.stopImmediatePropagation());
343
343
  };
344
- A.addEventListener(
344
+ x.addEventListener(
345
345
  "keydown",
346
- g,
346
+ v,
347
347
  !0
348
348
  // NOTE: capture phase
349
- ), b.push(() => {
350
- A.removeEventListener(
349
+ ), w.push(() => {
350
+ x.removeEventListener(
351
351
  "keydown",
352
- g,
352
+ v,
353
353
  !0
354
354
  );
355
- }), A.dataset.featherKHeaderBound = "true";
356
- }
357
- }, Y = function(c, A) {
358
- const g = c?.event?.event.target, w = R();
359
- if (!g || !w) return;
360
- const C = g.classList.contains("k-grid-header-menu"), E = g.classList.contains("k-columnmenu-item"), F = w.find((U) => U.field === c?.event?.field)?.sortable && !0;
361
- if (!C) {
362
- if (E && !F) {
363
- c?.event?.sort?.filter(
364
- (_) => _.field !== c?.event?.field
355
+ }), x.dataset.featherKHeaderBound = "true";
356
+ }
357
+ }, $ = function(s, x) {
358
+ const v = s?.event?.event.target, D = F();
359
+ if (!v || !D) return;
360
+ const T = v.classList.contains("k-grid-header-menu"), k = v.classList.contains("k-columnmenu-item"), O = D.find((W) => W.field === s?.event?.field)?.sortable && !0;
361
+ if (!T) {
362
+ if (k && !O) {
363
+ s?.event?.sort?.filter(
364
+ (_) => _.field !== s?.event?.field
365
365
  );
366
366
  return;
367
367
  }
368
- typeof A == "function" && j(() => {
369
- n.value && n.value.focus(), A(c), j(() => {
370
- B();
368
+ typeof x == "function" && G(() => {
369
+ n.value && n.value.focus(), x(s), G(() => {
370
+ A();
371
371
  });
372
372
  });
373
373
  }
374
- }, J = () => {
375
- if (!p)
374
+ }, Z = () => {
375
+ if (!u)
376
376
  try {
377
- v(), I(), q(), p = !0;
378
- } catch (c) {
379
- console.error("initA11y failed:", c), W();
377
+ m(), C(), K(), u = !0;
378
+ } catch (s) {
379
+ console.error("initA11y failed:", s), P();
380
380
  }
381
381
  };
382
- return qe(() => {
383
- W();
382
+ return Ue(() => {
383
+ P();
384
384
  }), {
385
385
  activeFilterButton: n,
386
- handleGridKeyDown: u,
387
- handleSortChange: Y,
388
- initA11y: J
386
+ handleGridKeyDown: i,
387
+ handleSortChange: $,
388
+ initA11y: Z
389
389
  };
390
- }, He = (e) => !!e && typeof e == "object" && "filters" in e && Array.isArray(e.filters), Xe = (e) => !!e && typeof e == "object" && "field" in e, Le = (e, t) => !e || typeof e != "object" ? !1 : He(e) ? e.filters.some(
391
- (n) => Le(n, t)
392
- ) : Xe(e) ? e.field === t : !1, wt = (e) => (t) => e.value?.filters && e.value.filters.some(
393
- (n) => Le(n, t)
394
- ) ? "active" : "", We = [
390
+ }, _e = (e) => !!e && typeof e == "object" && "filters" in e && Array.isArray(e.filters), je = (e) => !!e && typeof e == "object" && "field" in e, ze = (e, t) => !e || typeof e != "object" ? !1 : _e(e) ? e.filters.some(
391
+ (n) => ze(n, t)
392
+ ) : je(e) ? e.field === t : !1, xt = (e) => (t) => e.value?.filters && e.value.filters.some(
393
+ (n) => ze(n, t)
394
+ ) ? "active" : "", Ge = [
395
395
  "button",
396
396
  "a",
397
397
  "input",
@@ -409,228 +409,228 @@ const bt = (e, t) => {
409
409
  ".k-hierarchy-cell",
410
410
  ".k-grid-header-menu",
411
411
  ".k-column-menu"
412
- ], St = (e) => {
412
+ ], Mt = (e) => {
413
413
  const {
414
414
  onRowAction: t,
415
415
  gridRef: n,
416
- dataItems: p,
416
+ dataItems: u,
417
417
  ignoreSelectors: a = [],
418
- shouldIgnoreTarget: d,
419
- enableKeyboardAction: b = !0
420
- } = e, D = [
421
- ...We,
418
+ shouldIgnoreTarget: c,
419
+ enableKeyboardAction: w = !0
420
+ } = e, S = [
421
+ ...Ge,
422
422
  ...a
423
- ], O = (f, u) => {
423
+ ], L = (f, i) => {
424
424
  if (!f) return !1;
425
- const v = D.join(",");
426
- return f.closest && f.closest(v) ? !0 : d && u ? d(f, u) : !1;
427
- }, K = (f) => {
428
- const v = f?.closest?.(
425
+ const m = S.join(",");
426
+ return f.closest && f.closest(m) ? !0 : c && i ? c(f, i) : !1;
427
+ }, z = (f) => {
428
+ const m = f?.closest?.(
429
429
  ".k-table-row[data-grid-row-index]"
430
430
  )?.getAttribute("data-grid-row-index");
431
- if (v == null) return;
432
- const I = parseInt(v, 10);
433
- return Number.isNaN(I) ? void 0 : I;
434
- }, M = (f) => {
431
+ if (m == null) return;
432
+ const C = parseInt(m, 10);
433
+ return Number.isNaN(C) ? void 0 : C;
434
+ }, I = (f) => {
435
435
  if (!f || typeof f.clientX != "number")
436
436
  return;
437
- const u = typeof window < "u" && window.scrollX || 0, v = typeof window < "u" && window.scrollY || 0, I = typeof window < "u" && window.screenX || 0, q = typeof window < "u" && window.screenY || 0;
437
+ const i = typeof window < "u" && window.scrollX || 0, m = typeof window < "u" && window.scrollY || 0, C = typeof window < "u" && window.screenX || 0, K = typeof window < "u" && window.screenY || 0;
438
438
  return {
439
439
  clientX: f.clientX,
440
440
  clientY: f.clientY,
441
- pageX: typeof f.pageX == "number" ? f.pageX : f.clientX + u,
442
- pageY: typeof f.pageY == "number" ? f.pageY : f.clientY + v,
443
- screenX: typeof f.screenX == "number" ? f.screenX : f.clientX + I,
444
- screenY: typeof f.screenY == "number" ? f.screenY : f.clientY + q
441
+ pageX: typeof f.pageX == "number" ? f.pageX : f.clientX + i,
442
+ pageY: typeof f.pageY == "number" ? f.pageY : f.clientY + m,
443
+ screenX: typeof f.screenX == "number" ? f.screenX : f.clientX + C,
444
+ screenY: typeof f.screenY == "number" ? f.screenY : f.clientY + K
445
445
  };
446
- }, R = (f) => {
446
+ }, F = (f) => {
447
447
  if (!f || typeof f.getBoundingClientRect != "function")
448
448
  return;
449
- const u = f.getBoundingClientRect();
450
- if (!u) return;
451
- const v = u.left, I = u.bottom, q = typeof window < "u" && window.scrollX || 0, W = typeof window < "u" && window.scrollY || 0;
449
+ const i = f.getBoundingClientRect();
450
+ if (!i) return;
451
+ const m = i.left, C = i.bottom, K = typeof window < "u" && window.scrollX || 0, P = typeof window < "u" && window.scrollY || 0;
452
452
  return {
453
- clientX: v,
454
- clientY: I,
455
- pageX: v + q,
456
- pageY: I + W,
457
- screenX: v,
458
- screenY: I
453
+ clientX: m,
454
+ clientY: C,
455
+ pageX: m + K,
456
+ pageY: C + P,
457
+ screenX: m,
458
+ screenY: C
459
459
  };
460
- }, k = (f) => {
460
+ }, M = (f) => {
461
461
  if (typeof window > "u") return !1;
462
- const u = window.getSelection();
463
- if (!u || u.isCollapsed || !u.toString().trim())
462
+ const i = window.getSelection();
463
+ if (!i || i.isCollapsed || !i.toString().trim())
464
464
  return !1;
465
- if (f && u.anchorNode && u.focusNode) {
466
- const v = f.closest(".k-table-row") || f.closest(".k-grid") || f, I = u.anchorNode.nodeType === Node.ELEMENT_NODE ? u.anchorNode : u.anchorNode.parentElement, q = u.focusNode.nodeType === Node.ELEMENT_NODE ? u.focusNode : u.focusNode.parentElement, W = !!(I && v.contains(I)), B = !!(q && v.contains(q));
467
- return W || B;
465
+ if (f && i.anchorNode && i.focusNode) {
466
+ const m = f.closest(".k-table-row") || f.closest(".k-grid") || f, C = i.anchorNode.nodeType === Node.ELEMENT_NODE ? i.anchorNode : i.anchorNode.parentElement, K = i.focusNode.nodeType === Node.ELEMENT_NODE ? i.focusNode : i.focusNode.parentElement, P = !!(C && m.contains(C)), A = !!(K && m.contains(K));
467
+ return P || A;
468
468
  }
469
469
  return !0;
470
470
  };
471
471
  return {
472
472
  handleRowClick: (f) => {
473
- const u = f?.htmlEvent || f?.event || f?.nativeEvent || (f instanceof Event ? f : void 0);
474
- if (u && u.button !== void 0 && u.button !== 0)
473
+ const i = f?.htmlEvent || f?.event || f?.nativeEvent || (f instanceof Event ? f : void 0);
474
+ if (i && i.button !== void 0 && i.button !== 0)
475
475
  return;
476
- const v = u?.target || f?.target;
477
- if (v && O(v, u || f) || k(v))
476
+ const m = i?.target || f?.target;
477
+ if (m && L(m, i || f) || M(m))
478
478
  return;
479
- const I = {
479
+ const C = {
480
480
  dataItem: f.dataItem,
481
- rowIndex: f.rowIndex ?? K(v),
481
+ rowIndex: f.rowIndex ?? z(m),
482
482
  field: f.field,
483
- event: u || f,
483
+ event: i || f,
484
484
  triggerType: "click",
485
- ctrlKey: !!u?.ctrlKey,
486
- shiftKey: !!u?.shiftKey,
487
- metaKey: !!u?.metaKey,
488
- altKey: !!u?.altKey,
489
- coordinates: M(u) ?? R(v)
485
+ ctrlKey: !!i?.ctrlKey,
486
+ shiftKey: !!i?.shiftKey,
487
+ metaKey: !!i?.metaKey,
488
+ altKey: !!i?.altKey,
489
+ coordinates: I(i) ?? F(m)
490
490
  };
491
- t(f.dataItem, I);
491
+ t(f.dataItem, C);
492
492
  },
493
- handleRowKeyDown: (f, u) => {
494
- if (!b) return;
495
- const v = f.key || f.code;
496
- if (!(v === "Enter" || v === "NumpadEnter" || v === " " || v === "Space" || f.code === "Enter" || f.code === "NumpadEnter" || f.code === "Space")) return;
497
- const q = f.target;
498
- if (!q) return;
499
- const W = q.closest(
493
+ handleRowKeyDown: (f, i) => {
494
+ if (!w) return;
495
+ const m = f.key || f.code;
496
+ if (!(m === "Enter" || m === "NumpadEnter" || m === " " || m === "Space" || f.code === "Enter" || f.code === "NumpadEnter" || f.code === "Space")) return;
497
+ const K = f.target;
498
+ if (!K) return;
499
+ const P = K.closest(
500
500
  ".k-table-row[data-grid-row-index], .k-table-row"
501
501
  );
502
- if (!W || O(q, f))
502
+ if (!P || L(K, f))
503
503
  return;
504
504
  f.preventDefault(), f.stopPropagation();
505
- const B = W.getAttribute("data-grid-row-index"), Y = B !== null ? parseInt(B, 10) : void 0;
506
- let J = u;
507
- if (J === void 0) {
508
- const A = (Array.isArray(p) ? p : p?.value) || n?.value?.props?.dataItems || n?.value?.dataItems;
509
- A && Y !== void 0 && Y >= 0 && Y < A.length && (J = A[Y]);
505
+ const A = P.getAttribute("data-grid-row-index"), $ = A !== null ? parseInt(A, 10) : void 0;
506
+ let Z = i;
507
+ if (Z === void 0) {
508
+ const x = (Array.isArray(u) ? u : u?.value) || n?.value?.props?.dataItems || n?.value?.dataItems;
509
+ x && $ !== void 0 && $ >= 0 && $ < x.length && (Z = x[$]);
510
510
  }
511
- if (J === void 0) return;
512
- const c = {
513
- dataItem: J,
514
- rowIndex: Y,
511
+ if (Z === void 0) return;
512
+ const s = {
513
+ dataItem: Z,
514
+ rowIndex: $,
515
515
  event: f,
516
516
  triggerType: "keyboard",
517
517
  ctrlKey: !!f.ctrlKey,
518
518
  shiftKey: !!f.shiftKey,
519
519
  metaKey: !!f.metaKey,
520
520
  altKey: !!f.altKey,
521
- coordinates: R(W)
521
+ coordinates: F(P)
522
522
  };
523
- t(J, c);
523
+ t(Z, s);
524
524
  },
525
- isIgnoredTarget: O
525
+ isIgnoredTarget: L
526
526
  };
527
- }, Ze = "Enter a valid ZIP code with exactly 5 or 9 digits.", Fe = (e) => {
527
+ }, Je = "Enter a valid ZIP code with exactly 5 or 9 digits.", Pe = (e) => {
528
528
  const t = e.replace(/\D/g, "").slice(0, 9);
529
529
  return t.length > 5 ? `${t.slice(0, 5)}-${t.slice(5)}` : t;
530
- }, _e = (e, t) => e.slice(0, Math.max(0, t)).replace(/\D/g, "").length, je = (e) => e <= 5 ? e : Math.min(e + 1, 10), Ge = (e) => {
531
- const t = X(Fe(e.initialValue ?? "")), n = X(!1), p = X(
532
- e.errorMessage?.trim() || Ze
533
- ), a = y(() => t.value.replace(/\D/g, "")), d = y(() => {
534
- const x = a.value.length;
535
- return x === 5 || x === 9;
536
- }), b = y(() => n.value && !d.value), D = y(() => !n.value || d.value), O = y(() => n.value), K = (x, $) => {
537
- const f = je($);
538
- j(() => {
539
- x.isConnected && x.setSelectionRange(f, f);
530
+ }, Qe = (e, t) => e.slice(0, Math.max(0, t)).replace(/\D/g, "").length, et = (e) => e <= 5 ? e : Math.min(e + 1, 10), tt = (e) => {
531
+ const t = H(Pe(e.initialValue ?? "")), n = H(!1), u = H(
532
+ e.errorMessage?.trim() || Je
533
+ ), a = h(() => t.value.replace(/\D/g, "")), c = h(() => {
534
+ const E = a.value.length;
535
+ return E === 5 || E === 9;
536
+ }), w = h(() => n.value && !c.value), S = h(() => !n.value || c.value), L = h(() => n.value), z = (E, N) => {
537
+ const f = et(N);
538
+ G(() => {
539
+ E.isConnected && E.setSelectionRange(f, f);
540
540
  });
541
541
  };
542
542
  return {
543
543
  // writable state
544
544
  zipDisplay: t,
545
545
  submitted: n,
546
- errorMessage: p,
546
+ errorMessage: u,
547
547
  // bindings
548
548
  wrapperClass: "fk-zip-textbox",
549
549
  // derived state
550
550
  zipRaw: a,
551
- isZipValid: d,
552
- showZipError: b,
553
- textBoxValid: D,
554
- textBoxValidate: O,
551
+ isZipValid: c,
552
+ showZipError: w,
553
+ textBoxValid: S,
554
+ textBoxValidate: L,
555
555
  // actions
556
- handleZipInput: (...x) => {
557
- const $ = x[0], u = $?.event?.target, v = $?.value, I = Array.isArray(v) ? v.join("") : String(v ?? ""), q = u?.selectionStart !== void 0 && u.selectionStart !== null ? _e(
558
- u.value,
559
- u.selectionStart
560
- ) : I.replace(/\D/g, "").length;
561
- t.value = Fe(I), u && K(u, q);
556
+ handleZipInput: (...E) => {
557
+ const N = E[0], i = N?.event?.target, m = N?.value, C = Array.isArray(m) ? m.join("") : String(m ?? ""), K = i?.selectionStart !== void 0 && i.selectionStart !== null ? Qe(
558
+ i.value,
559
+ i.selectionStart
560
+ ) : C.replace(/\D/g, "").length;
561
+ t.value = Pe(C), i && z(i, K);
562
562
  },
563
- submitAndValidate: (x) => {
563
+ submitAndValidate: (E) => {
564
564
  n.value = !0;
565
- const $ = d.value;
566
- return !$ && x?.focus && j(() => {
565
+ const N = c.value;
566
+ return !N && E?.focus && G(() => {
567
567
  document.getElementById(
568
568
  e.id
569
569
  )?.focus();
570
- }), $;
570
+ }), N;
571
571
  },
572
572
  buildPayload: () => ({ zip: a.value })
573
573
  };
574
574
  };
575
- function Je(e, t) {
576
- const n = X(!1);
577
- Oe(() => {
575
+ function nt(e, t) {
576
+ const n = H(!1);
577
+ Ne(() => {
578
578
  e.value?.setAttribute("aria-invalid", String(!t.isValid()));
579
579
  });
580
- function p(d) {
581
- const b = e.value ?? d.currentTarget, D = d.relatedTarget;
582
- (!b || !b.contains(D)) && (n.value = !0);
580
+ function u(c) {
581
+ const w = e.value ?? c.currentTarget, S = c.relatedTarget;
582
+ (!w || !w.contains(S)) && (n.value = !0);
583
583
  }
584
584
  function a() {
585
585
  n.value = !1;
586
586
  }
587
- return { touched: n, onFocusout: p, reset: a };
587
+ return { touched: n, onFocusout: u, reset: a };
588
588
  }
589
- function Qe(e, t) {
590
- const n = X(!1), p = X(!1), a = y(
591
- () => ne(t.submitted) || n.value
592
- ), d = y(() => !a.value || t.isValid()), b = Je(e, {
593
- isValid: () => d.value
589
+ function rt(e, t) {
590
+ const n = H(!1), u = H(!1), a = h(
591
+ () => re(t.submitted) || n.value
592
+ ), c = h(() => !a.value || t.isValid()), w = nt(e, {
593
+ isValid: () => c.value
594
594
  });
595
- function D(k) {
596
- return y(() => !a.value || ne(k));
595
+ function S(M) {
596
+ return h(() => !a.value || re(M));
597
597
  }
598
- function O(k) {
598
+ function L(M) {
599
599
  return Object.fromEntries(
600
- Object.entries(k).map(([x, $]) => [
601
- x,
602
- D($)
600
+ Object.entries(M).map(([E, N]) => [
601
+ E,
602
+ S(N)
603
603
  ])
604
604
  );
605
605
  }
606
- function K(k) {
607
- const x = ne(k);
608
- if (!x) return;
609
- x.querySelector(
606
+ function z(M) {
607
+ const E = re(M);
608
+ if (!E) return;
609
+ E.querySelector(
610
610
  '.k-invalid input, .k-invalid[tabindex="0"]'
611
611
  )?.focus();
612
612
  }
613
- function M(k) {
614
- if (p.value) {
615
- p.value = !1;
613
+ function I(M) {
614
+ if (u.value) {
615
+ u.value = !1;
616
616
  return;
617
617
  }
618
- b.onFocusout(k), b.touched.value && (n.value = !0);
618
+ w.onFocusout(M), w.touched.value && (n.value = !0);
619
619
  }
620
- function R() {
621
- n.value = !1, p.value = !0, b.reset();
620
+ function F() {
621
+ n.value = !1, u.value = !0, w.reset();
622
622
  }
623
623
  return {
624
624
  touched: n,
625
625
  fieldsetValidate: a,
626
- onFocusout: M,
627
- reset: R,
628
- createFieldValidity: D,
629
- createFieldValidationsMap: O,
630
- focusFirstInvalidField: K
626
+ onFocusout: I,
627
+ reset: F,
628
+ createFieldValidity: S,
629
+ createFieldValidationsMap: L,
630
+ focusFirstInvalidField: z
631
631
  };
632
632
  }
633
- const et = [
633
+ const at = [
634
634
  { label: "Alabama", value: "AL" },
635
635
  { label: "Alaska", value: "AK" },
636
636
  { label: "Arizona", value: "AZ" },
@@ -689,8 +689,8 @@ function xe(e) {
689
689
  }
690
690
  return "";
691
691
  }
692
- function tt() {
693
- const e = Ke({
692
+ function ot() {
693
+ const e = Be({
694
694
  address1: "",
695
695
  address2: "",
696
696
  city: "",
@@ -699,381 +699,393 @@ function tt() {
699
699
  });
700
700
  return {
701
701
  formData: e,
702
- onAddress1Input: (...b) => {
703
- e.address1 = xe(b[0]);
702
+ onAddress1Input: (...w) => {
703
+ e.address1 = xe(w[0]);
704
704
  },
705
- onAddress2Input: (...b) => {
706
- e.address2 = xe(b[0]);
705
+ onAddress2Input: (...w) => {
706
+ e.address2 = xe(w[0]);
707
707
  },
708
- onCityInput: (...b) => {
709
- e.city = xe(b[0]);
708
+ onCityInput: (...w) => {
709
+ e.city = xe(w[0]);
710
710
  },
711
- onStateChange: (b) => {
712
- e.state = b.value;
711
+ onStateChange: (w) => {
712
+ e.state = w.value;
713
713
  },
714
714
  resetFormData: () => {
715
715
  e.address1 = "", e.address2 = "", e.city = "", e.state = null, e.zip = "";
716
716
  }
717
717
  };
718
718
  }
719
- function nt(e, t = "zip") {
720
- const n = Ge({ id: t }), {
721
- zipDisplay: p,
719
+ function lt(e, t = "zip") {
720
+ const n = tt({ id: t }), {
721
+ zipDisplay: u,
722
722
  zipRaw: a,
723
- isZipValid: d,
724
- wrapperClass: b,
725
- handleZipInput: D
723
+ isZipValid: c,
724
+ wrapperClass: w,
725
+ handleZipInput: S
726
726
  } = n;
727
- return le(a, (K) => {
728
- e.zip = K;
727
+ return ae(a, (z) => {
728
+ e.zip = z;
729
729
  }), {
730
- zipDisplay: p,
731
- isZipValid: d,
732
- zipWrapperClass: b,
733
- onZipInput: D,
730
+ zipDisplay: u,
731
+ isZipValid: c,
732
+ zipWrapperClass: w,
733
+ onZipInput: S,
734
734
  resetZip: () => {
735
- p.value = "", e.zip = "";
735
+ u.value = "", e.zip = "";
736
736
  }
737
737
  };
738
738
  }
739
- function rt(e) {
740
- const t = y(
739
+ function it(e) {
740
+ const t = h(
741
741
  () => e.formData.address1.trim() !== ""
742
- ), n = y(() => e.formData.city.trim() !== ""), p = y(() => !!e.formData.state), a = y(() => ne(e.isZipValid)), d = y(
743
- () => t.value && n.value && p.value && a.value
742
+ ), n = h(() => e.formData.city.trim() !== ""), u = h(() => !!e.formData.state), a = h(() => re(e.isZipValid)), c = h(
743
+ () => t.value && n.value && u.value && a.value
744
744
  );
745
745
  return {
746
746
  strictAddress1Valid: t,
747
747
  strictCityValid: n,
748
- strictStateValid: p,
748
+ strictStateValid: u,
749
749
  strictZipValid: a,
750
- strictAddressValid: d
750
+ strictAddressValid: c
751
751
  };
752
752
  }
753
- function at(e) {
753
+ function st(e) {
754
754
  if (!e) return;
755
755
  e.querySelector(
756
756
  '.k-invalid input, .k-invalid[tabindex="0"]'
757
757
  )?.focus();
758
758
  }
759
- function ot(e, t) {
760
- const n = e ?? t.currentTarget, p = t.relatedTarget;
761
- return !n || !n.contains(p);
759
+ function ut(e, t) {
760
+ const n = e ?? t.currentTarget, u = t.relatedTarget;
761
+ return !n || !n.contains(u);
762
762
  }
763
- function kt(e) {
764
- const t = X(
765
- ne(e.fieldsetRef)
763
+ function It(e) {
764
+ const t = H(
765
+ re(e.fieldsetRef)
766
766
  );
767
- Oe(() => {
768
- t.value = ne(e.fieldsetRef);
767
+ Ne(() => {
768
+ t.value = re(e.fieldsetRef);
769
769
  });
770
- const n = X(!1), p = X(!1), a = y(() => ne(e.required) ?? !0), {
771
- formData: d,
772
- onAddress1Input: b,
773
- onAddress2Input: D,
774
- onCityInput: O,
775
- onStateChange: K,
776
- resetFormData: M
777
- } = tt(), R = `${e.addressId}-zip`, { zipDisplay: k, isZipValid: x, zipWrapperClass: $, onZipInput: f, resetZip: u } = nt(d, R), {
778
- strictAddress1Valid: v,
779
- strictCityValid: I,
780
- strictStateValid: q,
781
- strictZipValid: W,
782
- strictAddressValid: B
783
- } = rt({
784
- formData: d,
785
- isZipValid: x
786
- }), Y = Qe(t, {
770
+ const n = H(!1), u = H(!1), a = h(() => re(e.required) ?? !0), {
771
+ formData: c,
772
+ onAddress1Input: w,
773
+ onAddress2Input: S,
774
+ onCityInput: L,
775
+ onStateChange: z,
776
+ resetFormData: I
777
+ } = ot(), F = `${e.addressId}-zip`, { zipDisplay: M, isZipValid: E, zipWrapperClass: N, onZipInput: f, resetZip: i } = lt(c, F), {
778
+ strictAddress1Valid: m,
779
+ strictCityValid: C,
780
+ strictStateValid: K,
781
+ strictZipValid: P,
782
+ strictAddressValid: A
783
+ } = it({
784
+ formData: c,
785
+ isZipValid: E
786
+ }), $ = rt(t, {
787
787
  submitted: n,
788
- isValid: () => B.value
789
- }), { touched: J, fieldsetValidate: c, onFocusout: A, reset: g } = Y, w = Y.createFieldValidationsMap({
790
- address1: v,
791
- city: I,
792
- state: q,
793
- zip: W,
794
- address: B
788
+ isValid: () => A.value
789
+ }), { touched: Z, fieldsetValidate: s, onFocusout: x, reset: v } = $, D = $.createFieldValidationsMap({
790
+ address1: m,
791
+ city: C,
792
+ state: K,
793
+ zip: P,
794
+ address: A
795
795
  }), {
796
- address1: C,
797
- city: E,
798
- state: F,
799
- zip: U,
796
+ address1: T,
797
+ city: k,
798
+ state: O,
799
+ zip: W,
800
800
  address: _
801
- } = w, re = y(
802
- () => a.value ? c.value : !1
803
- ), ue = y(
804
- () => a.value ? C.value : !0
805
- ), o = y(
806
- () => a.value ? E.value : !0
807
- ), S = y(
808
- () => a.value ? F.value : !0
809
- ), s = y(
810
- () => a.value ? U.value : !0
811
- ), h = y(
801
+ } = D, ne = h(
802
+ () => a.value ? s.value : !1
803
+ ), ue = h(
804
+ () => a.value ? T.value : !0
805
+ ), o = h(
806
+ () => a.value ? k.value : !0
807
+ ), b = h(
808
+ () => a.value ? O.value : !0
809
+ ), U = h(
810
+ () => a.value ? W.value : !0
811
+ ), p = h(
812
812
  () => a.value ? _.value : !0
813
- ), L = { value: null, label: "State" }, V = et.map(({ label: m, value: T }) => ({
814
- label: m,
815
- value: T
816
- })), r = y(() => ({
817
- address1: d.address1.trim(),
818
- address2: d.address2.trim(),
819
- city: d.city.trim(),
820
- state: (d.state ?? "").trim().toUpperCase(),
821
- zip: d.zip.replace(/\D/g, "")
822
- })), i = y(() => d.address1.trim() === "" && d.address2.trim() === "" && d.city.trim() === "" && (d.state ?? "").trim() === "" && d.zip.replace(/\D/g, "") === ""), P = y(() => !i.value), N = y(() => !a.value && P.value && (!v.value || !I.value || !q.value)), H = y(() => {
823
- const m = d.zip.replace(/\D/g, "");
824
- return !a.value && P.value && m.length !== 5 && m.length !== 9;
825
- }), te = y(() => !a.value && P.value && !B.value), Z = y(() => !a.value && te.value && (p.value || n.value));
826
- return le(r, () => {
827
- a.value || (p.value = !1);
828
- }), le(a, (m) => {
829
- m || (n.value = !1, p.value = !1, g());
813
+ ), y = { value: null, label: "State" }, q = at.map(({ label: g, value: V }) => ({
814
+ label: g,
815
+ value: V
816
+ })), r = h(() => ({
817
+ address1: c.address1.trim(),
818
+ address2: c.address2.trim(),
819
+ city: c.city.trim(),
820
+ state: (c.state ?? "").trim().toUpperCase(),
821
+ zip: c.zip.replace(/\D/g, "")
822
+ })), d = h(() => c.address1.trim() === "" && c.address2.trim() === "" && c.city.trim() === "" && (c.state ?? "").trim() === "" && c.zip.replace(/\D/g, "") === ""), R = h(() => !d.value), B = h(() => !a.value && R.value && (!m.value || !C.value || !K.value)), Y = h(() => {
823
+ const g = c.zip.replace(/\D/g, "");
824
+ return !a.value && R.value && g.length !== 5 && g.length !== 9;
825
+ }), Q = h(() => !a.value && R.value && !A.value), j = h(() => !a.value && Q.value && (u.value || n.value));
826
+ return ae(r, () => {
827
+ a.value || (u.value = !1);
828
+ }), ae(a, (g) => {
829
+ g || (n.value = !1, u.value = !1, v());
830
830
  }), {
831
- formData: d,
831
+ formData: c,
832
832
  submitted: n,
833
- touched: J,
834
- addressValidate: re,
833
+ touched: Z,
834
+ addressValidate: ne,
835
835
  address1Valid: ue,
836
836
  cityValid: o,
837
- stateValid: S,
838
- zipValid: s,
839
- addressValid: h,
840
- optionalFeedbackActive: Z,
841
- optionalPartialInvalid: te,
842
- optionalMissingRequiredFields: N,
843
- optionalZipInvalid: H,
844
- stateDefaultItem: L,
845
- stateOptions: V,
846
- zipDisplay: k,
847
- zipWrapperClass: $,
848
- onAddress1Input: b,
849
- onAddress2Input: D,
850
- onCityInput: O,
851
- onStateChange: K,
837
+ stateValid: b,
838
+ zipValid: U,
839
+ addressValid: p,
840
+ optionalFeedbackActive: j,
841
+ optionalPartialInvalid: Q,
842
+ optionalMissingRequiredFields: B,
843
+ optionalZipInvalid: Y,
844
+ stateDefaultItem: y,
845
+ stateOptions: q,
846
+ zipDisplay: M,
847
+ zipWrapperClass: N,
848
+ onAddress1Input: w,
849
+ onAddress2Input: S,
850
+ onCityInput: L,
851
+ onStateChange: z,
852
852
  onZipInput: f,
853
- onFieldsetFocusout: (m) => {
854
- const T = ot(t.value, m);
855
- A(m), !a.value && T && (p.value = !0);
853
+ onFieldsetFocusout: (g) => {
854
+ const V = ut(t.value, g);
855
+ x(g), !a.value && V && (u.value = !0);
856
856
  },
857
857
  normalizedPayload: r,
858
- validateForSubmit: async () => a.value ? (n.value = !0, B.value ? {
858
+ validateForSubmit: async () => a.value ? (n.value = !0, A.value ? {
859
859
  isValid: !0,
860
860
  payload: r.value
861
- } : (await j(), at(t.value), { isValid: !1, payload: null })) : i.value || B.value ? (n.value = !1, {
861
+ } : (await G(), st(t.value), { isValid: !1, payload: null })) : d.value || A.value ? (n.value = !1, {
862
862
  isValid: !0,
863
863
  payload: r.value
864
864
  }) : (n.value = !0, { isValid: !1, payload: null }),
865
865
  reset: () => {
866
- n.value = !1, p.value = !1, g(), M(), u();
866
+ n.value = !1, u.value = !1, v(), I(), i();
867
867
  }
868
868
  };
869
869
  }
870
- const Pe = (e) => e === "left" ? "right" : e === "right" ? "left" : "center", $e = (e) => e === "top" ? "bottom" : e === "bottom" ? "top" : "center", Me = (e, t, n, p) => {
871
- const a = e.left + (n.horizontal === "right" ? e.width : n.horizontal === "center" ? e.width / 2 : 0), d = e.top + (n.vertical === "bottom" ? e.height : n.vertical === "center" ? e.height / 2 : 0), b = t ? p.horizontal === "right" ? t.width : p.horizontal === "center" ? t.width / 2 : 0 : 0, D = t ? p.vertical === "bottom" ? t.height : p.vertical === "center" ? t.height / 2 : 0 : 0;
872
- return { left: a - b, top: d - D };
873
- }, lt = ({
870
+ const Le = (e) => e === "left" ? "right" : e === "right" ? "left" : "center", $e = (e) => e === "top" ? "bottom" : e === "bottom" ? "top" : "center", Me = (e, t, n, u) => {
871
+ const a = e.left + (n.horizontal === "right" ? e.width : n.horizontal === "center" ? e.width / 2 : 0), c = e.top + (n.vertical === "bottom" ? e.height : n.vertical === "center" ? e.height / 2 : 0), w = t ? u.horizontal === "right" ? t.width : u.horizontal === "center" ? t.width / 2 : 0 : 0, S = t ? u.vertical === "bottom" ? t.height : u.vertical === "center" ? t.height / 2 : 0 : 0;
872
+ return { left: a - w, top: c - S };
873
+ }, Oe = (e, t, n, u) => t >= u - n ? n : Math.min(Math.max(e, n), u - t), ct = ({
874
874
  anchor: e,
875
875
  popup: t,
876
876
  anchorAlign: n,
877
- popupAlign: p,
878
- bounds: a
877
+ popupAlign: u,
878
+ bounds: a,
879
+ collision: c
879
880
  }) => {
880
- const d = Me(e, t, n, p);
881
- if (!t) return d;
882
- let { left: b, top: D } = d;
883
- const O = b + t.width - a.right, K = a.left - b;
884
- if (O > 0 || K > 0) {
885
- const k = Me(
886
- e,
887
- t,
888
- {
889
- horizontal: Pe(n.horizontal),
890
- vertical: n.vertical
891
- },
892
- {
893
- horizontal: Pe(p.horizontal),
894
- vertical: p.vertical
895
- }
896
- ), x = Math.max(O, 0) + Math.max(K, 0);
897
- Math.max(k.left + t.width - a.right, 0) + Math.max(a.left - k.left, 0) < x && (b = k.left);
881
+ const w = Me(e, t, n, u);
882
+ if (!t) return w;
883
+ let { left: S, top: L } = w;
884
+ if (c.horizontal === "fit")
885
+ S = Oe(S, t.width, a.left, a.right);
886
+ else {
887
+ const z = S + t.width - a.right, I = a.left - S;
888
+ if (z > 0 || I > 0) {
889
+ const F = Me(
890
+ e,
891
+ t,
892
+ {
893
+ horizontal: Le(n.horizontal),
894
+ vertical: n.vertical
895
+ },
896
+ {
897
+ horizontal: Le(u.horizontal),
898
+ vertical: u.vertical
899
+ }
900
+ ), M = Math.max(z, 0) + Math.max(I, 0);
901
+ Math.max(F.left + t.width - a.right, 0) + Math.max(a.left - F.left, 0) < M && (S = F.left);
902
+ }
898
903
  }
899
- const M = D + t.height - a.bottom, R = a.top - D;
900
- if (M > 0 || R > 0) {
901
- const k = Me(
902
- e,
903
- t,
904
- {
905
- horizontal: n.horizontal,
906
- vertical: $e(n.vertical)
907
- },
908
- {
909
- horizontal: p.horizontal,
910
- vertical: $e(p.vertical)
911
- }
912
- ), x = Math.max(M, 0) + Math.max(R, 0);
913
- Math.max(k.top + t.height - a.bottom, 0) + Math.max(a.top - k.top, 0) < x && (D = k.top);
904
+ if (c.vertical === "fit")
905
+ L = Oe(L, t.height, a.top, a.bottom);
906
+ else {
907
+ const z = L + t.height - a.bottom, I = a.top - L;
908
+ if (z > 0 || I > 0) {
909
+ const F = Me(
910
+ e,
911
+ t,
912
+ {
913
+ horizontal: n.horizontal,
914
+ vertical: $e(n.vertical)
915
+ },
916
+ {
917
+ horizontal: u.horizontal,
918
+ vertical: $e(u.vertical)
919
+ }
920
+ ), M = Math.max(z, 0) + Math.max(I, 0);
921
+ Math.max(F.top + t.height - a.bottom, 0) + Math.max(a.top - F.top, 0) < M && (L = F.top);
922
+ }
914
923
  }
915
- return { left: b, top: D };
916
- }, At = (e = "fkid") => {
917
- const t = `${e}-${ze()}`;
918
- return { instanceId: t, compose: (...p) => [t, ...p].filter((a) => a != null).map(String).join("-") };
919
- }, it = typeof window < "u" && typeof document < "u";
924
+ return { left: S, top: L };
925
+ }, Ct = (e = "fkid") => {
926
+ const t = `${e}-${Ye()}`;
927
+ return { instanceId: t, compose: (...u) => [t, ...u].filter((a) => a != null).map(String).join("-") };
928
+ }, dt = typeof window < "u" && typeof document < "u";
920
929
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
921
- const st = Object.prototype.toString, ut = (e) => st.call(e) === "[object Object]", ke = () => {
930
+ const ft = Object.prototype.toString, pt = (e) => ft.call(e) === "[object Object]", ke = () => {
922
931
  };
923
932
  function Ie(e) {
924
933
  return Array.isArray(e) ? e : [e];
925
934
  }
926
- function ct(e, t, n) {
927
- return le(e, t, {
935
+ function vt(e, t, n) {
936
+ return ae(e, t, {
928
937
  ...n,
929
938
  immediate: !0
930
939
  });
931
940
  }
932
- const Ve = it ? window : void 0;
933
- function we(e) {
941
+ const qe = dt ? window : void 0;
942
+ function be(e) {
934
943
  var t;
935
- const n = ne(e);
944
+ const n = re(e);
936
945
  return (t = n?.$el) !== null && t !== void 0 ? t : n;
937
946
  }
938
947
  function Ce(...e) {
939
- const t = (p, a, d, b) => (p.addEventListener(a, d, b), () => p.removeEventListener(a, d, b)), n = y(() => {
940
- const p = Ie(ne(e[0])).filter((a) => a != null);
941
- return p.every((a) => typeof a != "string") ? p : void 0;
948
+ const t = (u, a, c, w) => (u.addEventListener(a, c, w), () => u.removeEventListener(a, c, w)), n = h(() => {
949
+ const u = Ie(re(e[0])).filter((a) => a != null);
950
+ return u.every((a) => typeof a != "string") ? u : void 0;
942
951
  });
943
- return ct(() => {
944
- var p, a;
952
+ return vt(() => {
953
+ var u, a;
945
954
  return [
946
- (p = (a = n.value) === null || a === void 0 ? void 0 : a.map((d) => we(d))) !== null && p !== void 0 ? p : [Ve].filter((d) => d != null),
947
- Ie(ne(n.value ? e[1] : e[0])),
948
- Ie(Ue(n.value ? e[2] : e[1])),
949
- ne(n.value ? e[3] : e[2])
955
+ (u = (a = n.value) === null || a === void 0 ? void 0 : a.map((c) => be(c))) !== null && u !== void 0 ? u : [qe].filter((c) => c != null),
956
+ Ie(re(n.value ? e[1] : e[0])),
957
+ Ie(He(n.value ? e[2] : e[1])),
958
+ re(n.value ? e[3] : e[2])
950
959
  ];
951
- }, ([p, a, d, b], D, O) => {
952
- if (!p?.length || !a?.length || !d?.length) return;
953
- const K = ut(b) ? { ...b } : b, M = p.flatMap((R) => a.flatMap((k) => d.map((x) => t(R, k, x, K))));
954
- O(() => {
955
- M.forEach((R) => R());
960
+ }, ([u, a, c, w], S, L) => {
961
+ if (!u?.length || !a?.length || !c?.length) return;
962
+ const z = pt(w) ? { ...w } : w, I = u.flatMap((F) => a.flatMap((M) => c.map((E) => t(F, M, E, z))));
963
+ L(() => {
964
+ I.forEach((F) => F());
956
965
  });
957
966
  }, { flush: "post" });
958
967
  }
959
- function Ne(e, t, n = {}) {
960
- const { window: p = Ve, ignore: a = [], capture: d = !0, detectIframe: b = !1, controls: D = !1 } = n;
961
- if (!p) return D ? {
968
+ function Ke(e, t, n = {}) {
969
+ const { window: u = qe, ignore: a = [], capture: c = !0, detectIframe: w = !1, controls: S = !1 } = n;
970
+ if (!u) return S ? {
962
971
  stop: ke,
963
972
  cancel: ke,
964
973
  trigger: ke
965
974
  } : ke;
966
- let O = !0;
967
- const K = (u) => ne(a).some((v) => {
968
- if (typeof v == "string") return Array.from(p.document.querySelectorAll(v)).some((I) => I === u.target || u.composedPath().includes(I));
975
+ let L = !0;
976
+ const z = (i) => re(a).some((m) => {
977
+ if (typeof m == "string") return Array.from(u.document.querySelectorAll(m)).some((C) => C === i.target || i.composedPath().includes(C));
969
978
  {
970
- const I = we(v);
971
- return I && (u.target === I || u.composedPath().includes(I));
979
+ const C = be(m);
980
+ return C && (i.target === C || i.composedPath().includes(C));
972
981
  }
973
982
  });
974
- function M(u) {
975
- const v = ne(u);
976
- return v && v.$.subTree.shapeFlag === 16;
983
+ function I(i) {
984
+ const m = re(i);
985
+ return m && m.$.subTree.shapeFlag === 16;
977
986
  }
978
- function R(u, v) {
979
- const I = ne(u), q = I.$.subTree && I.$.subTree.children;
980
- return q == null || !Array.isArray(q) ? !1 : q.some((W) => W.el === v.target || v.composedPath().includes(W.el));
987
+ function F(i, m) {
988
+ const C = re(i), K = C.$.subTree && C.$.subTree.children;
989
+ return K == null || !Array.isArray(K) ? !1 : K.some((P) => P.el === m.target || m.composedPath().includes(P.el));
981
990
  }
982
- const k = (u) => {
983
- const v = we(e);
984
- if (u.target != null && !(!(v instanceof Element) && M(e) && R(e, u)) && !(!v || v === u.target || u.composedPath().includes(v))) {
985
- if ("detail" in u && u.detail === 0 && (O = !K(u)), !O) {
986
- O = !0;
991
+ const M = (i) => {
992
+ const m = be(e);
993
+ if (i.target != null && !(!(m instanceof Element) && I(e) && F(e, i)) && !(!m || m === i.target || i.composedPath().includes(m))) {
994
+ if ("detail" in i && i.detail === 0 && (L = !z(i)), !L) {
995
+ L = !0;
987
996
  return;
988
997
  }
989
- t(u);
998
+ t(i);
990
999
  }
991
1000
  };
992
- let x = !1;
993
- const $ = [
994
- Ce(p, "click", (u) => {
995
- x || (x = !0, setTimeout(() => {
996
- x = !1;
997
- }, 0), k(u));
1001
+ let E = !1;
1002
+ const N = [
1003
+ Ce(u, "click", (i) => {
1004
+ E || (E = !0, setTimeout(() => {
1005
+ E = !1;
1006
+ }, 0), M(i));
998
1007
  }, {
999
1008
  passive: !0,
1000
- capture: d
1009
+ capture: c
1001
1010
  }),
1002
- Ce(p, "pointerdown", (u) => {
1003
- const v = we(e);
1004
- O = !K(u) && !!(v && !u.composedPath().includes(v));
1011
+ Ce(u, "pointerdown", (i) => {
1012
+ const m = be(e);
1013
+ L = !z(i) && !!(m && !i.composedPath().includes(m));
1005
1014
  }, { passive: !0 }),
1006
- b && Ce(p, "blur", (u) => {
1015
+ w && Ce(u, "blur", (i) => {
1007
1016
  setTimeout(() => {
1008
- const v = we(e);
1009
- let I = p.document.activeElement;
1010
- for (; I?.shadowRoot; ) I = I.shadowRoot.activeElement;
1011
- I?.tagName === "IFRAME" && !v?.contains(p.document.activeElement) && t(u);
1017
+ const m = be(e);
1018
+ let C = u.document.activeElement;
1019
+ for (; C?.shadowRoot; ) C = C.shadowRoot.activeElement;
1020
+ C?.tagName === "IFRAME" && !m?.contains(u.document.activeElement) && t(i);
1012
1021
  }, 0);
1013
1022
  }, { passive: !0 })
1014
- ].filter(Boolean), f = () => $.forEach((u) => u());
1015
- return D ? {
1023
+ ].filter(Boolean), f = () => N.forEach((i) => i());
1024
+ return S ? {
1016
1025
  stop: f,
1017
1026
  cancel: () => {
1018
- O = !1;
1027
+ L = !1;
1019
1028
  },
1020
- trigger: (u) => {
1021
- O = !0, k(u), O = !1;
1029
+ trigger: (i) => {
1030
+ L = !0, M(i), L = !1;
1022
1031
  }
1023
1032
  } : f;
1024
1033
  }
1025
- const dt = (e) => {
1034
+ const mt = (e) => {
1026
1035
  let t = null;
1027
1036
  const n = () => {
1028
1037
  t?.disconnect(), t = null;
1029
1038
  };
1030
- return typeof window < "u" && typeof window.IntersectionObserver == "function" && le(
1039
+ return typeof window < "u" && typeof window.IntersectionObserver == "function" && ae(
1031
1040
  [e.target, () => e.root()],
1032
- ([a, d]) => {
1041
+ ([a, c]) => {
1033
1042
  n(), a && (t = new IntersectionObserver(
1034
- ([b]) => {
1035
- b && e.onChange(b);
1043
+ ([w]) => {
1044
+ w && e.onChange(w);
1036
1045
  },
1037
- { root: d, threshold: e.threshold ?? 1 }
1046
+ { root: c, threshold: e.threshold ?? 1 }
1038
1047
  ), t.observe(a));
1039
1048
  },
1040
1049
  { immediate: !0 }
1041
1050
  ), Te(n), { disconnect: n };
1042
- }, ft = ".k-table-row", he = (e) => {
1051
+ }, gt = ".k-table-row", ye = (e) => {
1043
1052
  if (e instanceof HTMLElement) return e;
1044
1053
  const t = e?.$el;
1045
1054
  return t instanceof HTMLElement ? t : null;
1046
- }, pt = (e, t) => t === "row" ? e.matches("tr.k-table-row") : !e.matches("tr.k-table-row"), mt = (e, t) => {
1055
+ }, ht = (e, t) => t === "row" ? e.matches("tr.k-table-row") : !e.matches("tr.k-table-row"), yt = (e, t) => {
1047
1056
  console.warn(
1048
1057
  `usePopupMenu: triggerMode "${t}" does not match resolved element <${e.tagName.toLowerCase()}${e.className ? `.${e.className.split(" ").join(".")}` : ""}>; ARIA management skipped.`
1049
1058
  );
1050
- }, vt = (e) => {
1059
+ }, wt = (e) => {
1051
1060
  let t = e.parentElement, n = null;
1052
1061
  for (; t; ) {
1053
- const { overflow: p, overflowX: a, overflowY: d } = window.getComputedStyle(t), b = /auto|scroll|overlay/.test(`${p} ${a}`), D = /auto|scroll|overlay/.test(`${p} ${d}`);
1054
- if ((b || D) && (n ??= t), b && t.scrollWidth > t.clientWidth || D && t.scrollHeight > t.clientHeight)
1062
+ const { overflow: u, overflowX: a, overflowY: c } = window.getComputedStyle(t), w = /auto|scroll|overlay/.test(`${u} ${a}`), S = /auto|scroll|overlay/.test(`${u} ${c}`);
1063
+ if ((w || S) && (n ??= t), w && t.scrollWidth > t.clientWidth || S && t.scrollHeight > t.clientHeight)
1055
1064
  return t;
1056
1065
  t = t.parentElement;
1057
1066
  }
1058
1067
  return n;
1059
- }, Dt = (e) => {
1060
- const t = X(null), n = e.menuItemSelector ?? ".k-menu-item:not(.k-disabled)", p = e.triggerMode, a = e.anchor === !0 ? {} : e.anchor, d = a?.activationPoint ? a.activationPoint === !0 ? {} : a.activationPoint : null, b = ye(null), D = ye(null), O = a?.anchorAlign ?? {
1068
+ }, Tt = (e) => {
1069
+ const t = H(null), n = e.menuItemSelector ?? ".k-menu-item:not(.k-disabled)", u = e.triggerMode, a = e.anchor === !0 ? {} : e.anchor, c = a?.activationPoint ? a.activationPoint === !0 ? {} : a.activationPoint : null, w = ve(null), S = ve(null), L = a?.anchorAlign ?? {
1061
1070
  horizontal: "left",
1062
1071
  vertical: "bottom"
1063
- }, K = a?.popupAlign ?? {
1072
+ }, z = a?.popupAlign ?? {
1064
1073
  horizontal: "left",
1065
1074
  vertical: "top"
1066
- }, M = ye(null), R = () => he(e.triggerRef.value), k = y(() => R()), x = y(
1067
- () => a && a.hideWhenAnchorClipped !== !1 ? k.value : null
1068
- ), $ = () => {
1069
- const s = a?.clipRoot ? ne(a.clipRoot) : null;
1070
- if (s) {
1071
- const h = s.getBoundingClientRect();
1075
+ }, I = a?.collision ?? {
1076
+ horizontal: "flip",
1077
+ vertical: "flip"
1078
+ }, F = ve(null), M = () => ye(e.triggerRef.value), E = h(() => M()), N = h(
1079
+ () => a && a.hideWhenAnchorClipped !== !1 ? E.value : null
1080
+ ), f = () => {
1081
+ const p = a?.clipRoot ? re(a.clipRoot) : null;
1082
+ if (p) {
1083
+ const y = p.getBoundingClientRect();
1072
1084
  return {
1073
- left: h.left,
1074
- top: h.top,
1075
- right: h.right,
1076
- bottom: h.bottom
1085
+ left: y.left,
1086
+ top: y.top,
1087
+ right: y.right,
1088
+ bottom: y.bottom
1077
1089
  };
1078
1090
  }
1079
1091
  return {
@@ -1082,229 +1094,235 @@ const dt = (e) => {
1082
1094
  right: window.innerWidth,
1083
1095
  bottom: window.innerHeight
1084
1096
  };
1085
- }, f = y(() => {
1086
- const s = b.value;
1087
- if (!e.isOpen.value || !s) return { left: 0, top: 0 };
1088
- const h = $(), L = lt({
1089
- anchor: s,
1090
- popup: M.value,
1091
- anchorAlign: O,
1092
- popupAlign: K,
1093
- bounds: h
1097
+ }, i = h(() => {
1098
+ const p = w.value;
1099
+ if (!e.isOpen.value || !p) return { left: 0, top: 0 };
1100
+ const y = f(), q = ct({
1101
+ anchor: p,
1102
+ popup: F.value,
1103
+ anchorAlign: L,
1104
+ popupAlign: z,
1105
+ bounds: y,
1106
+ collision: I
1094
1107
  });
1095
1108
  return {
1096
- left: L.left + window.scrollX,
1097
- top: L.top + window.scrollY
1109
+ left: q.left + window.scrollX,
1110
+ top: q.top + window.scrollY
1098
1111
  };
1099
- }), u = () => {
1100
- const s = e.resolveFocusTarget?.() ?? he(e.focusTargetRef?.value);
1101
- return s || (e.focusTargetContainerSelector ? R()?.closest(
1112
+ }), m = () => {
1113
+ const p = e.resolveFocusTarget?.() ?? ye(e.focusTargetRef?.value);
1114
+ return p || (e.focusTargetContainerSelector ? M()?.closest(
1102
1115
  e.focusTargetContainerSelector
1103
1116
  ) ?? null : null);
1104
- }, v = (s, h) => {
1105
- if (!d) return !1;
1106
- const L = he(s);
1107
- if (!L)
1108
- return D.value = null, !1;
1109
- const V = L.getBoundingClientRect();
1110
- if (h.triggerType === "keyboard") {
1111
- const r = d.keyboardPosition, i = r?.y ?? "center", P = typeof i == "number" ? i : i === "top" ? 0 : i === "bottom" ? V.height : V.height / 2;
1112
- return D.value = {
1113
- trigger: L,
1114
- point: { x: r?.x ?? 8, y: P },
1117
+ }, C = (p, y) => {
1118
+ if (!c) return !1;
1119
+ const q = ye(p);
1120
+ if (!q)
1121
+ return S.value = null, !1;
1122
+ const r = q.getBoundingClientRect();
1123
+ if (y.triggerType === "keyboard") {
1124
+ const d = c.keyboardPosition, R = d?.y ?? "center", B = typeof R == "number" ? R : R === "top" ? 0 : R === "bottom" ? r.height : r.height / 2;
1125
+ return S.value = {
1126
+ trigger: q,
1127
+ point: { x: d?.x ?? 8, y: B },
1115
1128
  hasMatchedTrigger: !1
1116
1129
  }, !0;
1117
1130
  }
1118
- return h.coordinates ? (D.value = {
1119
- trigger: L,
1131
+ return y.coordinates ? (S.value = {
1132
+ trigger: q,
1120
1133
  point: {
1121
- x: h.coordinates.clientX - V.left + (d.pointerOffset?.x ?? 0),
1122
- y: h.coordinates.clientY - V.top + (d.pointerOffset?.y ?? 0)
1134
+ x: y.coordinates.clientX - r.left + (c.pointerOffset?.x ?? 0),
1135
+ y: y.coordinates.clientY - r.top + (c.pointerOffset?.y ?? 0)
1123
1136
  },
1124
1137
  hasMatchedTrigger: !1
1125
- }, !0) : (D.value = null, !1);
1126
- }, I = () => {
1127
- if (p !== "button") return null;
1138
+ }, !0) : (S.value = null, !1);
1139
+ }, K = () => {
1140
+ if (u !== "button") return null;
1128
1141
  if (e.escapeFocusTarget) return e.escapeFocusTarget();
1129
- const s = e.escapeFocusContainerSelector ?? ft;
1130
- return (R() ?? document.activeElement)?.closest(s) ?? null;
1131
- }, q = () => {
1132
- const s = u() ?? I();
1133
- if (s)
1134
- return s.focus(), !0;
1135
- const h = R();
1136
- return h?.focus(), !!h;
1137
- }, W = () => {
1138
- he(e.menuRef.value)?.querySelector(n)?.focus({ preventScroll: !0 });
1139
- }, B = ye(null), Y = ye(null);
1140
- let J = !1;
1141
- const c = () => {
1142
- const s = t.value;
1143
- if (s === "keyboard" || s === "escape") {
1144
- const h = B.value ?? Y.value;
1145
- h?.focus(), s === "keyboard" && h && h === Y.value && (J = !0);
1146
- } else t.value === "mouse-selection" && Y.value?.focus();
1147
- t.value = null, B.value = null, Y.value = null;
1148
- }, A = (s) => {
1149
- e.isOpen.value && (t.value = s, B.value = u() ?? (s === "escape" ? I() : null), Y.value = R(), F(!1), e.requestHide(), j(c));
1142
+ const p = e.escapeFocusContainerSelector ?? gt;
1143
+ return (M() ?? document.activeElement)?.closest(p) ?? null;
1144
+ }, P = () => {
1145
+ const p = m() ?? K();
1146
+ if (p)
1147
+ return p.focus(), !0;
1148
+ const y = M();
1149
+ return y?.focus(), !!y;
1150
+ }, A = () => {
1151
+ ye(e.menuRef.value)?.querySelector(n)?.focus({ preventScroll: !0 });
1152
+ }, $ = ve(null), Z = ve(null);
1153
+ let s = !1;
1154
+ const x = () => {
1155
+ const p = t.value;
1156
+ if (p === "keyboard" || p === "escape") {
1157
+ const y = $.value ?? Z.value;
1158
+ y?.focus(), p === "keyboard" && y && y === Z.value && (s = !0);
1159
+ } else t.value === "mouse-selection" && Z.value?.focus();
1160
+ t.value = null, $.value = null, Z.value = null;
1161
+ }, v = (p) => {
1162
+ e.isOpen.value && (t.value = p, $.value = m() ?? (p === "escape" ? K() : null), Z.value = M(), W(!1), e.requestHide(), G(x));
1150
1163
  };
1151
- le(
1152
- [k, D],
1153
- ([s], h, L) => {
1154
- if (!a || !s) {
1155
- b.value = null;
1164
+ ae(
1165
+ [E, S],
1166
+ ([p], y, q) => {
1167
+ if (!a || !p) {
1168
+ w.value = null;
1156
1169
  return;
1157
1170
  }
1158
- let V = null;
1159
- const r = () => {
1160
- V = null;
1161
- const N = D.value;
1162
- if (d) {
1163
- N && N.trigger === s ? N.hasMatchedTrigger = !0 : N?.hasMatchedTrigger && (N.trigger = s);
1164
- const H = s.getBoundingClientRect();
1165
- b.value = N?.trigger === s ? new DOMRect(
1166
- H.left + N.point.x,
1167
- H.top + N.point.y,
1171
+ let r = null;
1172
+ const d = () => {
1173
+ r = null;
1174
+ const Y = S.value;
1175
+ if (c) {
1176
+ Y && Y.trigger === p ? Y.hasMatchedTrigger = !0 : Y?.hasMatchedTrigger && (Y.trigger = p);
1177
+ const Q = p.getBoundingClientRect();
1178
+ w.value = Y?.trigger === p ? new DOMRect(
1179
+ Q.left + Y.point.x,
1180
+ Q.top + Y.point.y,
1168
1181
  0,
1169
1182
  0
1170
1183
  ) : null;
1171
1184
  return;
1172
1185
  }
1173
- b.value = a.getRect?.(s) ?? s.getBoundingClientRect();
1174
- }, i = () => {
1175
- V === null && (V = window.requestAnimationFrame(r));
1176
- }, P = typeof window.ResizeObserver == "function" ? new window.ResizeObserver(i) : null;
1177
- P?.observe(s), window.addEventListener("scroll", i, {
1186
+ w.value = a.getRect?.(p) ?? p.getBoundingClientRect();
1187
+ }, R = () => {
1188
+ r === null && (r = window.requestAnimationFrame(d));
1189
+ }, B = typeof window.ResizeObserver == "function" ? new window.ResizeObserver(R) : null;
1190
+ B?.observe(p), window.addEventListener("scroll", R, {
1178
1191
  capture: !0,
1179
1192
  passive: !0
1180
- }), window.addEventListener("resize", i, { passive: !0 }), i(), L(() => {
1181
- V !== null && window.cancelAnimationFrame(V), P?.disconnect(), window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", i);
1193
+ }), window.addEventListener("resize", R, { passive: !0 }), R(), q(() => {
1194
+ r !== null && window.cancelAnimationFrame(r), B?.disconnect(), window.removeEventListener("scroll", R, !0), window.removeEventListener("resize", R);
1182
1195
  });
1183
1196
  },
1184
1197
  { immediate: !0, flush: "post" }
1185
1198
  );
1186
- const g = () => he(e.popupContentRef?.value ?? e.menuRef.value);
1187
- a && le(
1199
+ const D = () => {
1200
+ const p = ye(
1201
+ e.popupContentRef?.value ?? e.menuRef.value
1202
+ );
1203
+ return p?.closest(".k-popup") ?? p;
1204
+ };
1205
+ a && ae(
1188
1206
  e.isOpen,
1189
- (s, h, L) => {
1190
- if (!s) {
1191
- M.value = null;
1207
+ (p, y, q) => {
1208
+ if (!p) {
1209
+ F.value = null;
1192
1210
  return;
1193
1211
  }
1194
- let V = null;
1195
- const r = () => {
1196
- V = null;
1197
- const H = g();
1198
- M.value = H?.getBoundingClientRect() ?? null;
1199
- }, i = () => {
1200
- V === null && (V = window.requestAnimationFrame(r));
1201
- }, P = g(), N = P && typeof window.ResizeObserver == "function" ? new window.ResizeObserver(i) : null;
1202
- N?.observe(P), i(), L(() => {
1203
- V !== null && window.cancelAnimationFrame(V), N?.disconnect();
1212
+ let r = null;
1213
+ const d = () => {
1214
+ r = null;
1215
+ const Q = D();
1216
+ F.value = Q?.getBoundingClientRect() ?? null;
1217
+ }, R = () => {
1218
+ r === null && (r = window.requestAnimationFrame(d));
1219
+ }, B = D(), Y = B && typeof window.ResizeObserver == "function" ? new window.ResizeObserver(R) : null;
1220
+ Y?.observe(B), R(), q(() => {
1221
+ r !== null && window.cancelAnimationFrame(r), Y?.disconnect();
1204
1222
  });
1205
1223
  },
1206
1224
  { immediate: !0, flush: "post" }
1207
- ), dt({
1208
- target: x,
1209
- root: () => a?.clipRoot ? ne(a.clipRoot) : k.value ? vt(k.value) : null,
1210
- threshold: a?.intersectionThreshold ?? (d ? 0 : 0.5),
1211
- onChange: (s) => {
1212
- s.isIntersecting || A("anchor-hidden");
1213
- }
1214
- }), Ne(e.menuRef, () => A("outside-click"), {
1215
- ignore: [k]
1225
+ ), mt({
1226
+ target: N,
1227
+ root: () => a?.clipRoot ? re(a.clipRoot) : E.value ? wt(E.value) : null,
1228
+ threshold: a?.intersectionThreshold ?? (c ? 0 : 0.5),
1229
+ onChange: (p) => {
1230
+ p.isIntersecting || v("anchor-hidden");
1231
+ }
1232
+ }), Ke(e.menuRef, () => v("outside-click"), {
1233
+ ignore: [E]
1216
1234
  });
1217
- let w = null, C = null;
1218
- const E = () => {
1219
- w?.isConnected && w.setAttribute("aria-expanded", "false"), w = null;
1220
- }, F = (s) => {
1235
+ let T = null, k = null;
1236
+ const O = () => {
1237
+ T?.isConnected && T.setAttribute("aria-expanded", "false"), T = null;
1238
+ }, W = (p) => {
1221
1239
  if (e.manageMenuTriggerAria === !1) return;
1222
- const h = k.value;
1223
- if (!h) {
1224
- w?.isConnected && w.setAttribute("aria-expanded", s ? "true" : "false");
1240
+ const y = E.value;
1241
+ if (!y) {
1242
+ T?.isConnected && T.setAttribute("aria-expanded", p ? "true" : "false");
1225
1243
  return;
1226
1244
  }
1227
- if (!pt(h, p)) {
1228
- mt(h, p), E();
1245
+ if (!ht(y, u)) {
1246
+ yt(y, u), O();
1229
1247
  return;
1230
1248
  }
1231
- w && w !== h && E(), h.setAttribute("aria-expanded", s ? "true" : "false"), w = h;
1232
- }, U = () => {
1233
- const s = he(e.menuRef.value), h = s?.matches('[role="menubar"]') ? s : s?.querySelector('[role="menubar"]'), L = ne(e.menuLabel)?.trim();
1234
- C && C !== h && C.removeAttribute("aria-label"), h && (L ? h.setAttribute("aria-label", L) : h.removeAttribute("aria-label")), C = h ?? null;
1249
+ T && T !== y && O(), y.setAttribute("aria-expanded", p ? "true" : "false"), T = y;
1250
+ }, _ = () => {
1251
+ const p = ye(e.menuRef.value), y = p?.matches('[role="menubar"]') ? p : p?.querySelector('[role="menubar"]'), q = re(e.menuLabel)?.trim();
1252
+ k && k !== y && k.removeAttribute("aria-label"), y && (q ? y.setAttribute("aria-label", q) : y.removeAttribute("aria-label")), k = y ?? null;
1235
1253
  };
1236
- le(
1254
+ ae(
1237
1255
  [e.isOpen, e.triggerRef],
1238
- ([s]) => {
1239
- F(s), !s && d && (D.value = null, b.value = null);
1256
+ ([p]) => {
1257
+ W(p), !p && c && (S.value = null, w.value = null);
1240
1258
  },
1241
1259
  { immediate: !0, flush: "post" }
1242
- ), le(
1243
- [e.isOpen, e.menuRef, () => ne(e.menuLabel)],
1244
- U,
1260
+ ), ae(
1261
+ [e.isOpen, e.menuRef, () => re(e.menuLabel)],
1262
+ _,
1245
1263
  { immediate: !0, flush: "post" }
1246
1264
  ), Te(() => {
1247
- D.value = null, E(), C?.removeAttribute("aria-label");
1248
- }), le(
1265
+ S.value = null, O(), k?.removeAttribute("aria-label");
1266
+ }), ae(
1249
1267
  e.isOpen,
1250
- (s) => {
1251
- s && W();
1268
+ (p) => {
1269
+ p && A();
1252
1270
  },
1253
1271
  { flush: "post" }
1254
1272
  );
1255
- const _ = (...s) => {
1256
- const h = s[0];
1257
- if (J) {
1258
- J = !1;
1273
+ const ne = (...p) => {
1274
+ const y = p[0];
1275
+ if (s) {
1276
+ s = !1;
1259
1277
  return;
1260
1278
  }
1261
1279
  if (e.isOpen.value) {
1262
- A("trigger-click");
1280
+ v("trigger-click");
1263
1281
  return;
1264
1282
  }
1265
- e.requestShow(h);
1283
+ e.requestShow(y);
1266
1284
  };
1267
1285
  return {
1268
1286
  /**
1269
1287
  * Sets the anchor activation state, controlling whether the popup menu
1270
1288
  * should respond to trigger interactions.
1271
1289
  */
1272
- setAnchorActivation: v,
1290
+ setAnchorActivation: C,
1273
1291
  /**
1274
1292
  * Handles Kendo Menu selection: records keyboard or mouse modality,
1275
1293
  * requests popup close, then runs the optional caller-owned action.
1276
1294
  */
1277
- handleMenuSelect: (s, h) => {
1278
- A(
1279
- s.event?.type?.startsWith("key") ? "keyboard" : "mouse-selection"
1280
- ), h?.(s);
1295
+ handleMenuSelect: (p, y) => {
1296
+ v(
1297
+ p.event?.type?.startsWith("key") ? "keyboard" : "mouse-selection"
1298
+ ), y?.(p);
1281
1299
  },
1282
1300
  /**
1283
1301
  * Toggles the action menu. When opening, focuses the first enabled Kendo
1284
1302
  * Menu item after Vue renders the popup.
1285
1303
  */
1286
- handleTriggerClick: _,
1304
+ handleTriggerClick: ne,
1287
1305
  /**
1288
1306
  * Handles trigger keyboard input: Enter and Space toggle the menu; Escape
1289
1307
  * closes an open menu or focuses the configured target when already closed.
1290
1308
  */
1291
- handleTriggerKeydown: (...s) => {
1292
- const h = s[0], L = s[1];
1293
- if (h.key === "Enter" || h.code === "Space") {
1294
- h.preventDefault(), _(L);
1309
+ handleTriggerKeydown: (...p) => {
1310
+ const y = p[0], q = p[1];
1311
+ if (y.key === "Enter" || y.code === "Space") {
1312
+ y.preventDefault(), ne(q);
1295
1313
  return;
1296
1314
  }
1297
- if (h.key === "Escape") {
1298
- if (h.preventDefault(), h.stopPropagation(), e.isOpen.value) {
1299
- A("escape");
1315
+ if (y.key === "Escape") {
1316
+ if (y.preventDefault(), y.stopPropagation(), e.isOpen.value) {
1317
+ v("escape");
1300
1318
  return;
1301
1319
  }
1302
- q();
1320
+ P();
1303
1321
  }
1304
1322
  },
1305
1323
  /** Closes the open menu through the keyboard path when Escape is pressed inside it. */
1306
- handleMenuEscape: (s) => {
1307
- s.preventDefault(), s.stopPropagation(), A("escape");
1324
+ handleMenuEscape: (p) => {
1325
+ p.preventDefault(), p.stopPropagation(), v("escape");
1308
1326
  },
1309
1327
  /**
1310
1328
  * Restores focus after Kendo Popup closes: keyboard menu selection and
@@ -1313,128 +1331,243 @@ const dt = (e) => {
1313
1331
  * outside clicks do not move focus.
1314
1332
  */
1315
1333
  handlePopupClose: () => {
1316
- j(c);
1334
+ G(x);
1317
1335
  },
1318
- offset: f
1336
+ offset: i
1319
1337
  };
1320
- }, Et = () => {
1338
+ }, Rt = () => {
1321
1339
  const e = /* @__PURE__ */ new Set();
1322
1340
  return { register: (a) => {
1323
1341
  e.add(a), Te(() => e.delete(a));
1324
1342
  }, deactivateOthers: (a) => {
1325
- e.forEach((d) => {
1326
- d !== a && d.deactivate();
1343
+ e.forEach((c) => {
1344
+ c !== a && c.deactivate();
1327
1345
  });
1328
1346
  }, deactivateAll: () => {
1329
1347
  e.forEach((a) => a.deactivate());
1330
1348
  } };
1331
- }, gt = (e) => {
1349
+ }, bt = (e) => {
1332
1350
  if (e instanceof HTMLElement) return e;
1333
1351
  const t = e && "$el" in e ? e.$el : null;
1334
1352
  return t instanceof HTMLElement ? t : null;
1335
- }, xt = () => {
1336
- const e = Be(/* @__PURE__ */ new Map()), t = X(null), n = (D, O) => {
1337
- const K = gt(O);
1338
- K ? e.set(D, K) : e.delete(D);
1339
- }, p = (D) => e.get(D) ?? null, a = (D) => {
1340
- t.value = D;
1341
- }, d = () => {
1353
+ }, Ft = () => {
1354
+ const e = We(/* @__PURE__ */ new Map()), t = H(null), n = (S, L) => {
1355
+ const z = bt(L);
1356
+ z ? e.set(S, z) : e.delete(S);
1357
+ }, u = (S) => e.get(S) ?? null, a = (S) => {
1358
+ t.value = S;
1359
+ }, c = () => {
1342
1360
  t.value = null;
1343
- }, b = (D) => t.value === D;
1361
+ }, w = (S) => t.value === S;
1344
1362
  return {
1345
- activeId: ee(t),
1346
- isActive: y(() => t.value !== null),
1347
- activeElement: y(
1348
- () => t.value !== null ? p(t.value) : null
1363
+ activeId: te(t),
1364
+ isActive: h(() => t.value !== null),
1365
+ activeElement: h(
1366
+ () => t.value !== null ? u(t.value) : null
1349
1367
  ),
1350
1368
  register: n,
1351
- resolve: p,
1369
+ resolve: u,
1352
1370
  activate: a,
1353
- deactivate: d,
1354
- isIdActive: b
1371
+ deactivate: c,
1372
+ isIdActive: w
1355
1373
  };
1356
- };
1357
- function Mt(e) {
1358
- const t = X(""), n = X(void 0), p = X(!!e.debug), a = X(e.dateFormat ?? "mm/dd/yyyy"), d = y(() => !!e.required), b = 1e3, D = X(!1), O = ["ArrowUp", "ArrowDown"], K = ["ArrowLeft", "ArrowRight"], M = y(() => (t.value ?? "").replace(/\D/g, "")), R = (o) => o <= 2 ? "mm" : o <= 5 ? "dd" : M.value.length <= 10 ? "yyyy" : "mm", k = y(() => {
1374
+ }, Ve = {
1375
+ title: "My Window",
1376
+ draggable: !0,
1377
+ resizable: !0,
1378
+ closable: !0,
1379
+ fixed: !0,
1380
+ minimizeButton: !0,
1381
+ maximizeButton: !0,
1382
+ initialWidth: 500,
1383
+ initialHeight: 500,
1384
+ width: 500,
1385
+ height: 500,
1386
+ left: void 0,
1387
+ top: void 0
1388
+ }, St = (e) => e === "DEFAULT" || e === "MINIMIZED" || e === "FULLSCREEN", kt = (e, t, n) => Math.max(e - t - n, 0);
1389
+ function Pt(e = {}) {
1390
+ Fe(e.settings) && (e.settings.value = {
1391
+ ...Ve,
1392
+ ...e.settings.value
1393
+ });
1394
+ const t = Fe(e.settings) ? e.settings : H({ ...Ve, ...e.settings }), n = ve(null), u = H(!1), a = H(e.initialStage ?? "DEFAULT"), c = H(!1), w = H(!1), S = H(0), L = H(0), z = async (P) => {
1395
+ const A = t.value.left !== void 0 && t.value.top !== void 0;
1396
+ if (P?.resetPosition || !A) {
1397
+ const $ = Number.parseFloat(
1398
+ window.getComputedStyle(document.documentElement).fontSize
1399
+ ), Z = Number.isFinite($) ? $ : 16, s = t.value.fixed ? 0 : window.scrollX, x = t.value.fixed ? 0 : window.scrollY;
1400
+ t.value.left = void 0, t.value.top = void 0, t.value.width = void 0, t.value.height = void 0, S.value = s + kt(
1401
+ window.innerWidth,
1402
+ t.value.initialWidth,
1403
+ Z
1404
+ ), L.value = x + Z, u.value = !0, await G(), t.value.width = t.value.initialWidth, t.value.height = t.value.initialHeight;
1405
+ } else
1406
+ u.value = !0;
1407
+ e.onOpen?.();
1408
+ }, I = () => {
1409
+ a.value = "DEFAULT", u.value = !1, e.onClose?.();
1410
+ }, F = (...P) => {
1411
+ const A = P[2];
1412
+ if (typeof A != "object" || A === null || !("state" in A) || !St(A.state))
1413
+ return;
1414
+ const $ = A.state;
1415
+ $ !== a.value && (a.value = $, e.onStageChange?.($));
1416
+ }, M = (...P) => {
1417
+ const A = P[0];
1418
+ if (typeof A == "object" && A !== null && "drag" in A && "left" in A && "top" in A && "width" in A && "height" in A && typeof A.left == "number" && typeof A.top == "number" && typeof A.width == "number" && typeof A.height == "number") {
1419
+ const $ = A, Z = n.value?.$el, x = (Z instanceof Element ? Z.querySelector(".k-window-titlebar") : null)?.getBoundingClientRect(), v = x?.width ?? $.width, D = x?.height ?? $.height, T = t.value.fixed ? 0 : window.scrollX, k = t.value.fixed ? 0 : window.scrollY, O = T + document.documentElement.clientWidth, W = k + document.documentElement.clientHeight, _ = Math.max(O - v, T), ne = Math.max(W - D, k);
1420
+ t.value.left = Math.min(
1421
+ Math.max($.left, T),
1422
+ _
1423
+ ), t.value.top = Math.min(
1424
+ Math.max($.top, k),
1425
+ ne
1426
+ ), c.value = $.drag && !$.end, e.onMove?.($);
1427
+ }
1428
+ }, E = (...P) => {
1429
+ const A = P[0];
1430
+ if (typeof A == "object" && A !== null && "drag" in A && "left" in A && "top" in A && "width" in A && "height" in A && typeof A.left == "number" && typeof A.top == "number" && typeof A.width == "number" && typeof A.height == "number") {
1431
+ const $ = A;
1432
+ t.value.left = $.left, t.value.top = $.top, t.value.width = $.width, t.value.height = $.height, w.value = $.drag && !$.end, e.onResize?.($);
1433
+ }
1434
+ }, N = (P) => {
1435
+ P.target instanceof Element && P.target.closest(".k-resize-handle") && P.preventDefault();
1436
+ };
1437
+ let f;
1438
+ const i = () => {
1439
+ f?.(), f = void 0;
1440
+ };
1441
+ ae(
1442
+ n,
1443
+ (P) => {
1444
+ i();
1445
+ const A = P?.$el;
1446
+ A instanceof HTMLElement && (A.addEventListener("pointerdown", N, {
1447
+ capture: !0
1448
+ }), f = () => A.removeEventListener("pointerdown", N, {
1449
+ capture: !0
1450
+ }));
1451
+ },
1452
+ { flush: "post" }
1453
+ ), Xe(i);
1454
+ const m = h(() => {
1455
+ const P = ["fk-window"];
1456
+ return t.value.draggable && a.value !== "FULLSCREEN" && P.push("fk-window-can-drag"), c.value && P.push("fk-window-is-dragging"), w.value && P.push("fk-window-is-resizing"), t.value.fixed && P.push("fk-window-fixed"), t.value.minimizeButton || P.push("fk-window-hide-minimize"), t.value.maximizeButton || P.push("fk-window-hide-maximize"), t.value.closable || P.push("fk-window-hide-close"), P.join(" ");
1457
+ }), C = h(() => ({
1458
+ title: t.value.title,
1459
+ draggable: t.value.draggable,
1460
+ resizable: t.value.resizable,
1461
+ left: t.value.left,
1462
+ top: t.value.top,
1463
+ initialLeft: S.value,
1464
+ initialTop: L.value,
1465
+ initialWidth: t.value.initialWidth,
1466
+ initialHeight: t.value.initialHeight,
1467
+ width: t.value.width,
1468
+ height: t.value.height,
1469
+ stage: a.value,
1470
+ windowClass: m.value
1471
+ }));
1472
+ return {
1473
+ windowRef: n,
1474
+ settings: t,
1475
+ visible: u,
1476
+ stage: a,
1477
+ isDragging: c,
1478
+ isResizing: w,
1479
+ props: C,
1480
+ events: {
1481
+ move: M,
1482
+ resize: E,
1483
+ stagechange: F,
1484
+ close: I
1485
+ },
1486
+ open: z,
1487
+ close: I
1488
+ };
1489
+ }
1490
+ function Lt(e) {
1491
+ const t = H(""), n = H(void 0), u = H(!!e.debug), a = H(e.dateFormat ?? "mm/dd/yyyy"), c = h(() => !!e.required), w = 1e3, S = H(!1), L = ["ArrowUp", "ArrowDown"], z = ["ArrowLeft", "ArrowRight"], I = h(() => (t.value ?? "").replace(/\D/g, "")), F = (o) => o <= 2 ? "mm" : o <= 5 ? "dd" : I.value.length <= 10 ? "yyyy" : "mm", M = h(() => {
1359
1492
  const o = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0";
1360
1493
  return parseInt(o).toString().padStart(2, "0");
1361
- }), x = y(() => {
1494
+ }), E = h(() => {
1362
1495
  const o = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0";
1363
1496
  return parseInt(o).toString().padStart(2, "0");
1364
- }), $ = y(() => {
1497
+ }), N = h(() => {
1365
1498
  const o = t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0";
1366
1499
  return parseInt(o).toString().padStart(4, "0");
1367
1500
  }), f = (o) => {
1368
- if (M.value.length === 0) {
1501
+ if (I.value.length === 0) {
1369
1502
  e.onChange({ value: null, event: o });
1370
1503
  return;
1371
1504
  }
1372
- if (M.value.length < 8) {
1505
+ if (I.value.length < 8) {
1373
1506
  e.onChange({ value: null, event: o });
1374
1507
  return;
1375
1508
  }
1376
- if ((t.value ?? "").length === 10 && M.value.length === 8) {
1377
- const [S, s, h] = t.value.split("/"), L = parseInt(S), V = parseInt(s), r = parseInt(h);
1378
- if (B(r, L, V)) {
1379
- const i = q(r, L, V);
1380
- u(i) ? e.onChange({ value: i, event: o }) : e.onChange({ value: null, event: o });
1509
+ if ((t.value ?? "").length === 10 && I.value.length === 8) {
1510
+ const [b, U, p] = t.value.split("/"), y = parseInt(b), q = parseInt(U), r = parseInt(p);
1511
+ if (A(r, y, q)) {
1512
+ const d = K(r, y, q);
1513
+ i(d) ? e.onChange({ value: d, event: o }) : e.onChange({ value: null, event: o });
1381
1514
  } else
1382
1515
  e.onChange({ value: null, event: o });
1383
1516
  }
1384
- }, u = (o) => {
1385
- const S = e.min ?? void 0, s = e.max ?? void 0;
1386
- return !(S && o < S || s && o > s);
1387
- }, v = y(() => {
1388
- if ((t.value ?? "").length === 10 && M.value.length === 8) {
1389
- const [o, S, s] = (t.value ?? "").split("/"), h = parseInt(o), L = parseInt(S), V = parseInt(s);
1390
- if (B(V, h, L))
1391
- return q(V, h, L);
1517
+ }, i = (o) => {
1518
+ const b = e.min ?? void 0, U = e.max ?? void 0;
1519
+ return !(b && o < b || U && o > U);
1520
+ }, m = h(() => {
1521
+ if ((t.value ?? "").length === 10 && I.value.length === 8) {
1522
+ const [o, b, U] = (t.value ?? "").split("/"), p = parseInt(o), y = parseInt(b), q = parseInt(U);
1523
+ if (A(q, p, y))
1524
+ return K(q, p, y);
1392
1525
  }
1393
1526
  return null;
1394
- }), I = y(() => (t.value ?? "").length === 10 && M.value.length === 8), q = (o, S, s) => {
1395
- const h = /* @__PURE__ */ new Date(0);
1396
- return h.setFullYear(o, S - 1, s), h.setHours(0, 0, 0, 0), h;
1397
- }, W = (o, S) => q(o, S + 1, 0).getDate(), B = (o, S, s) => S >= 1 && S <= 12 && o >= b && s >= 1 && s <= W(o, S), Y = (o) => {
1527
+ }), C = h(() => (t.value ?? "").length === 10 && I.value.length === 8), K = (o, b, U) => {
1528
+ const p = /* @__PURE__ */ new Date(0);
1529
+ return p.setFullYear(o, b - 1, U), p.setHours(0, 0, 0, 0), p;
1530
+ }, P = (o, b) => K(o, b + 1, 0).getDate(), A = (o, b, U) => b >= 1 && b <= 12 && o >= w && U >= 1 && U <= P(o, b), $ = (o) => {
1398
1531
  t.value = o.value;
1399
- const S = o.event?.target;
1400
- n.value = S?.selectionStart ?? 0, f(o);
1401
- }, J = (o) => {
1532
+ const b = o.event?.target;
1533
+ n.value = b?.selectionStart ?? 0, f(o);
1534
+ }, Z = (o) => {
1402
1535
  n.value = o.target.selectionStart ?? 0;
1403
- }, c = (o, S, s) => {
1404
- const h = S?.selectionStart ?? n.value ?? 0;
1405
- n.value = h;
1406
- let L = parseInt(k.value), V = parseInt(x.value), r = parseInt($.value);
1407
- if (!(M.value.length >= 8) || !B(r, L, V)) {
1408
- const G = e.defaultValue ?? /* @__PURE__ */ new Date();
1409
- L = G.getMonth() + 1, V = G.getDate(), r = G.getFullYear(), t.value = `${String(L).padStart(2, "0")}/${String(V).padStart(
1536
+ }, s = (o, b, U) => {
1537
+ const p = b?.selectionStart ?? n.value ?? 0;
1538
+ n.value = p;
1539
+ let y = parseInt(M.value), q = parseInt(E.value), r = parseInt(N.value);
1540
+ if (!(I.value.length >= 8) || !A(r, y, q)) {
1541
+ const J = e.defaultValue ?? /* @__PURE__ */ new Date();
1542
+ y = J.getMonth() + 1, q = J.getDate(), r = J.getFullYear(), t.value = `${String(y).padStart(2, "0")}/${String(q).padStart(
1410
1543
  2,
1411
1544
  "0"
1412
1545
  )}/${String(r)}`;
1413
- const ce = q(r, L, V);
1414
- e.onChange({ value: u(ce) ? ce : null, event: s }), E({ useRAF: !0 });
1546
+ const ce = K(r, y, q);
1547
+ e.onChange({ value: i(ce) ? ce : null, event: U }), k({ useRAF: !0 });
1415
1548
  return;
1416
1549
  }
1417
- const P = R(h);
1418
- if (P === "mm")
1419
- L = o === "ArrowUp" ? L < 12 ? L + 1 : 1 : L > 1 ? L - 1 : 12;
1420
- else if (P === "dd") {
1421
- const G = new Date(r, L, 0).getDate();
1422
- V = o === "ArrowUp" ? V < G ? V + 1 : 1 : V > 1 ? V - 1 : G;
1423
- } else P === "yyyy" && (r = o === "ArrowUp" ? r + 1 : Math.max(1, r - 1));
1424
- t.value = `${String(L).padStart(2, "0")}/${String(V).padStart(
1550
+ const R = F(p);
1551
+ if (R === "mm")
1552
+ y = o === "ArrowUp" ? y < 12 ? y + 1 : 1 : y > 1 ? y - 1 : 12;
1553
+ else if (R === "dd") {
1554
+ const J = new Date(r, y, 0).getDate();
1555
+ q = o === "ArrowUp" ? q < J ? q + 1 : 1 : q > 1 ? q - 1 : J;
1556
+ } else R === "yyyy" && (r = o === "ArrowUp" ? r + 1 : Math.max(1, r - 1));
1557
+ t.value = `${String(y).padStart(2, "0")}/${String(q).padStart(
1425
1558
  2,
1426
1559
  "0"
1427
1560
  )}/${String(r)}`;
1428
- const [N, H, te] = t.value.split("/"), Z = q(
1429
- parseInt(te),
1430
- parseInt(N),
1431
- parseInt(H)
1561
+ const [B, Y, Q] = t.value.split("/"), j = K(
1562
+ parseInt(Q),
1563
+ parseInt(B),
1564
+ parseInt(Y)
1432
1565
  );
1433
- Z.toString() !== "Invalid Date" && parseInt(te) >= 1e3 ? e.onChange({
1434
- value: u(Z) ? Z : null,
1435
- event: s
1436
- }) : e.onChange({ value: null, event: s }), E({ useRAF: !0 });
1437
- }, A = (o) => {
1566
+ j.toString() !== "Invalid Date" && parseInt(Q) >= 1e3 ? e.onChange({
1567
+ value: i(j) ? j : null,
1568
+ event: U
1569
+ }) : e.onChange({ value: null, event: U }), k({ useRAF: !0 });
1570
+ }, x = (o) => {
1438
1571
  if (o.code === "Space" || o.key === " ") {
1439
1572
  o.preventDefault(), o.stopPropagation(), e.onShowCalendar(o);
1440
1573
  return;
@@ -1443,72 +1576,72 @@ function Mt(e) {
1443
1576
  o.preventDefault(), o.stopPropagation(), e.onShowCalendar(o);
1444
1577
  return;
1445
1578
  }
1446
- if (O.includes(o.key)) {
1579
+ if (L.includes(o.key)) {
1447
1580
  if (o.altKey) return;
1448
1581
  o.preventDefault(), o.stopPropagation();
1449
- const S = o.target;
1450
- c(o.key, S, o);
1582
+ const b = o.target;
1583
+ s(o.key, b, o);
1451
1584
  return;
1452
1585
  }
1453
- }, g = (o) => {
1586
+ }, v = (o) => {
1454
1587
  o.preventDefault();
1455
- const S = o.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1456
- c(S, o.target, o);
1457
- }, w = (o) => {
1458
- const S = o.target;
1459
- if (K.includes(o.key)) {
1460
- n.value = S?.selectionStart ?? 0;
1588
+ const b = o.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1589
+ s(b, o.target, o);
1590
+ }, D = (o) => {
1591
+ const b = o.target;
1592
+ if (z.includes(o.key)) {
1593
+ n.value = b?.selectionStart ?? 0;
1461
1594
  return;
1462
1595
  }
1463
- if (O.includes(o.key)) {
1596
+ if (L.includes(o.key)) {
1464
1597
  if (o.altKey) return;
1465
- n.value = S?.selectionStart ?? 0;
1466
- }
1467
- }, C = (o) => {
1468
- D.value = !0, d.value && !e.defaultValue && e.externalValue && e.externalValue.value === void 0 && M.value.length === 0 && (e.externalValue.value = "");
1469
- const S = o.target;
1470
- S && (n.value = S.selectionStart ?? 0);
1471
- }, E = (o) => {
1472
- const S = () => {
1473
- const s = document.getElementById(
1598
+ n.value = b?.selectionStart ?? 0;
1599
+ }
1600
+ }, T = (o) => {
1601
+ S.value = !0, c.value && !e.defaultValue && e.externalValue && e.externalValue.value === void 0 && I.value.length === 0 && (e.externalValue.value = "");
1602
+ const b = o.target;
1603
+ b && (n.value = b.selectionStart ?? 0);
1604
+ }, k = (o) => {
1605
+ const b = () => {
1606
+ const U = document.getElementById(
1474
1607
  e.id
1475
1608
  );
1476
- if (!s) return;
1477
- const h = o?.pos ?? n.value ?? s.value.length;
1609
+ if (!U) return;
1610
+ const p = o?.pos ?? n.value ?? U.value.length;
1478
1611
  try {
1479
- s.focus(), s.setSelectionRange(h, h);
1612
+ U.focus(), U.setSelectionRange(p, p);
1480
1613
  } catch {
1481
1614
  }
1482
1615
  };
1483
- j(() => {
1616
+ G(() => {
1484
1617
  if (o?.delay && o.delay > 0) {
1485
- setTimeout(S, o.delay);
1618
+ setTimeout(b, o.delay);
1486
1619
  return;
1487
1620
  }
1488
1621
  if (o?.useRAF) {
1489
- requestAnimationFrame(S);
1622
+ requestAnimationFrame(b);
1490
1623
  return;
1491
1624
  }
1492
- S();
1625
+ b();
1493
1626
  });
1494
1627
  };
1495
- e.externalValue && le(
1628
+ e.externalValue && ae(
1496
1629
  e.externalValue,
1497
1630
  (o) => {
1498
1631
  if (o) {
1499
- const S = new Date(o);
1500
- if (S.toString() !== "Invalid Date") {
1501
- const s = (S.getMonth() + 1).toString().padStart(2, "0"), h = S.getDate().toString().padStart(2, "0"), L = S.getFullYear().toString();
1502
- t.value = `${s}/${h}/${L}`, E({ delay: 50 });
1632
+ const b = new Date(o);
1633
+ if (b.toString() !== "Invalid Date") {
1634
+ const U = (b.getMonth() + 1).toString().padStart(2, "0"), p = b.getDate().toString().padStart(2, "0"), y = b.getFullYear().toString();
1635
+ t.value = `${U}/${p}/${y}`, k({ delay: 50 });
1503
1636
  return;
1504
1637
  }
1505
1638
  }
1506
1639
  },
1507
1640
  { immediate: !0 }
1508
1641
  );
1509
- const F = y(() => [
1510
- ["Date", `${k.value} / ${x.value} / ${$.value}`],
1511
- ["Digits only", M.value],
1642
+ const O = h(() => [
1643
+ ["Date", `${M.value} / ${E.value} / ${N.value}`],
1644
+ ["Digits only", I.value],
1512
1645
  [
1513
1646
  "min",
1514
1647
  e.min?.toLocaleDateString("en-US", {
@@ -1525,50 +1658,50 @@ function Mt(e) {
1525
1658
  day: "2-digit"
1526
1659
  }) ?? null
1527
1660
  ]
1528
- ]), U = y(() => {
1529
- if (!d.value) {
1530
- if (!I.value) return !0;
1531
- const S = v.value;
1532
- return S ? u(S) : !1;
1533
- }
1534
- if (!D.value) return !0;
1535
- const o = v.value;
1536
- return !I.value || !o ? !1 : u(o);
1537
- }), _ = y(() => {
1538
- if (!d.value) {
1539
- if (!I.value) return;
1540
- const S = v.value;
1541
- return S ? u(S) ? "valid" : "out-of-bounds" : "invalid-date";
1542
- }
1543
- if (!D.value) return;
1544
- if (M.value.length === 0 || !I.value)
1661
+ ]), W = h(() => {
1662
+ if (!c.value) {
1663
+ if (!C.value) return !0;
1664
+ const b = m.value;
1665
+ return b ? i(b) : !1;
1666
+ }
1667
+ if (!S.value) return !0;
1668
+ const o = m.value;
1669
+ return !C.value || !o ? !1 : i(o);
1670
+ }), _ = h(() => {
1671
+ if (!c.value) {
1672
+ if (!C.value) return;
1673
+ const b = m.value;
1674
+ return b ? i(b) ? "valid" : "out-of-bounds" : "invalid-date";
1675
+ }
1676
+ if (!S.value) return;
1677
+ if (I.value.length === 0 || !C.value)
1545
1678
  return "incomplete";
1546
- const o = v.value;
1547
- return o ? u(o) ? "valid" : "out-of-bounds" : "invalid-date";
1548
- }), re = y(() => {
1679
+ const o = m.value;
1680
+ return o ? i(o) ? "valid" : "out-of-bounds" : "invalid-date";
1681
+ }), ne = h(() => {
1549
1682
  const o = _.value;
1550
1683
  if (!o || o === "valid") return "";
1551
1684
  if (o === "incomplete")
1552
1685
  return "Required";
1553
1686
  if (o === "invalid-date")
1554
1687
  return `Must be in ${a.value} format.`;
1555
- const S = e.min ? e.min.toLocaleDateString("en-US", {
1688
+ const b = e.min ? e.min.toLocaleDateString("en-US", {
1556
1689
  year: "numeric",
1557
1690
  month: "2-digit",
1558
1691
  day: "2-digit"
1559
- }) : null, s = e.max ? e.max.toLocaleDateString("en-US", {
1692
+ }) : null, U = e.max ? e.max.toLocaleDateString("en-US", {
1560
1693
  year: "numeric",
1561
1694
  month: "2-digit",
1562
1695
  day: "2-digit"
1563
1696
  }) : null;
1564
1697
  if (o === "out-of-bounds") {
1565
- if (S && s) return `Must be between ${S} and ${s}.`;
1566
- if (S) return `Must be on or after ${S}.`;
1567
- if (s) return `Must be on or before ${s}.`;
1698
+ if (b && U) return `Must be between ${b} and ${U}.`;
1699
+ if (b) return `Must be on or after ${b}.`;
1700
+ if (U) return `Must be on or before ${U}.`;
1568
1701
  }
1569
1702
  return "";
1570
1703
  }), ue = () => {
1571
- j(() => {
1704
+ G(() => {
1572
1705
  const o = document.getElementById(
1573
1706
  e.id
1574
1707
  );
@@ -1576,16 +1709,16 @@ function Mt(e) {
1576
1709
  console.warn(`ID (#${e.id}) not found for styling.`);
1577
1710
  return;
1578
1711
  }
1579
- const S = o.closest(".k-datepicker");
1580
- if (!S) {
1712
+ const b = o.closest(".k-datepicker");
1713
+ if (!b) {
1581
1714
  console.warn(`.k-datepicker parent not found for #${e.id} styling.`);
1582
1715
  return;
1583
1716
  }
1584
- const s = S.parentElement;
1585
- if (s) {
1586
- if (s.classList.contains("fk-datepicker"))
1717
+ const U = b.parentElement;
1718
+ if (U) {
1719
+ if (U.classList.contains("fk-datepicker"))
1587
1720
  return;
1588
- s.classList.add("fk-datepicker");
1721
+ U.classList.add("fk-datepicker");
1589
1722
  } else
1590
1723
  console.warn(
1591
1724
  `Parent of .k-datepicker not found for #${e.id} styling.`
@@ -1597,63 +1730,63 @@ function Mt(e) {
1597
1730
  }), {
1598
1731
  raw: t,
1599
1732
  cursorPos: n,
1600
- debugEnabled: p,
1601
- debugLines: F,
1733
+ debugEnabled: u,
1734
+ debugLines: O,
1602
1735
  placeholder: a,
1603
- isValid: U,
1604
- reason: ee(_),
1605
- validationMessage: re,
1606
- digitsOnly: M,
1607
- month: ee(k),
1608
- day: ee(x),
1609
- year: ee($),
1610
- datePart: R,
1611
- handleChange: Y,
1612
- handleKeyDown: A,
1613
- handleWheel: g,
1614
- handleKeyUp: w,
1615
- handleClick: J,
1616
- handleBlur: C,
1736
+ isValid: W,
1737
+ reason: te(_),
1738
+ validationMessage: ne,
1739
+ digitsOnly: I,
1740
+ month: te(M),
1741
+ day: te(E),
1742
+ year: te(N),
1743
+ datePart: F,
1744
+ handleChange: $,
1745
+ handleKeyDown: x,
1746
+ handleWheel: v,
1747
+ handleKeyUp: D,
1748
+ handleClick: Z,
1749
+ handleBlur: T,
1617
1750
  // Expose so consumers can re-run styling when needed
1618
1751
  initStyling: ue
1619
1752
  };
1620
1753
  }
1621
- function It(e) {
1622
- const t = X(""), n = X(void 0), p = X(!!e.debug), a = X(!1), d = 1440 * 60 * 1e3, b = 365 * d, D = /* @__PURE__ */ new Date(), O = new Date(D.getTime() - b), K = new Date(D.getTime() + b);
1623
- e.min = e.min ?? O, e.max = e.max ?? K;
1624
- const M = y(() => (t.value ?? "").replace(/\D/g, "")), R = (l, m) => new Date(l, m, 0).getDate(), k = (l, m, T) => m >= 1 && m <= 12 && l >= 1e3 && T >= 1 && T <= R(l, m), x = (l) => Date.UTC(l.getFullYear(), l.getMonth(), l.getDate()), $ = (l) => {
1754
+ function $t(e) {
1755
+ const t = H(""), n = H(void 0), u = H(!!e.debug), a = H(!1), c = 1440 * 60 * 1e3, w = 365 * c, S = /* @__PURE__ */ new Date(), L = new Date(S.getTime() - w), z = new Date(S.getTime() + w);
1756
+ e.min = e.min ?? L, e.max = e.max ?? z;
1757
+ const I = h(() => (t.value ?? "").replace(/\D/g, "")), F = (l, g) => new Date(l, g, 0).getDate(), M = (l, g, V) => g >= 1 && g <= 12 && l >= 1e3 && V >= 1 && V <= F(l, g), E = (l) => Date.UTC(l.getFullYear(), l.getMonth(), l.getDate()), N = (l) => {
1625
1758
  if (!l) return null;
1626
- const m = e.min ?? new Date(Date.now() - 90 * d), T = e.max ?? /* @__PURE__ */ new Date(), z = x(l);
1627
- return z < x(m) || z > x(T) ? null : l;
1628
- }, f = (l, m) => e.allowReverse ?? !1 ? !0 : l <= m, u = y(() => (t.value?.length ?? 0) >= 23 && M.value.length >= 16), v = (l) => {
1629
- if ((l ?? "").length < 23 || M.value.length < 16)
1759
+ const g = e.min ?? new Date(Date.now() - 90 * c), V = e.max ?? /* @__PURE__ */ new Date(), X = E(l);
1760
+ return X < E(g) || X > E(V) ? null : l;
1761
+ }, f = (l, g) => e.allowReverse ?? !1 ? !0 : l <= g, i = h(() => (t.value?.length ?? 0) >= 23 && I.value.length >= 16), m = (l) => {
1762
+ if ((l ?? "").length < 23 || I.value.length < 16)
1630
1763
  return { start: null, end: null };
1631
- const m = l.substring(0, 10), T = l.substring(13, 23), [z, ae, oe] = m.split("/").map((pe) => parseInt(pe || "0", 10)), [fe, me, ve] = T.split("/").map((pe) => parseInt(pe || "0", 10)), ge = new Date(oe, z - 1, ae), be = new Date(ve, fe - 1, me), Ae = k(oe, z, ae) && ge.toString() !== "Invalid Date", De = k(ve, fe, me) && be.toString() !== "Invalid Date";
1632
- return { start: Ae ? ge : null, end: De ? be : null };
1633
- }, I = e.externalValid ?? X(!0), q = y(() => v(t.value)), W = y(() => {
1634
- const l = $(q.value.start), m = $(q.value.end);
1635
- return { start: l, end: m };
1636
- }), B = y(() => {
1637
- if (!u.value) return;
1638
- const l = W.value.start, m = W.value.end;
1639
- if (!l || !m) return;
1640
- const T = Math.abs(x(m) - x(l));
1641
- return Math.round(T / 864e5 + 1);
1642
- }), Y = X(!1), J = y(() => {
1643
- if (!Y.value) return;
1644
- const { start: l, end: m } = q.value;
1645
- if (!u.value) return "incomplete";
1646
- if (!l || !m) return "invalid-date";
1647
- if (!W.value.start || !W.value.end) return "out-of-bounds";
1648
- const T = W.value.start, z = W.value.end;
1649
- return f(T, z) ? typeof e.maxSpanDays == "number" && B.value !== void 0 && B.value > e.maxSpanDays ? "span-exceeds-limit" : "valid" : "reversed-range";
1650
- }), c = y(() => {
1651
- const l = J.value;
1764
+ const g = l.substring(0, 10), V = l.substring(13, 23), [X, oe, le] = g.split("/").map((pe) => parseInt(pe || "0", 10)), [fe, me, ge] = V.split("/").map((pe) => parseInt(pe || "0", 10)), he = new Date(le, X - 1, oe), we = new Date(ge, fe - 1, me), Ae = M(le, X, oe) && he.toString() !== "Invalid Date", De = M(ge, fe, me) && we.toString() !== "Invalid Date";
1765
+ return { start: Ae ? he : null, end: De ? we : null };
1766
+ }, C = e.externalValid ?? H(!0), K = h(() => m(t.value)), P = h(() => {
1767
+ const l = N(K.value.start), g = N(K.value.end);
1768
+ return { start: l, end: g };
1769
+ }), A = h(() => {
1770
+ if (!i.value) return;
1771
+ const l = P.value.start, g = P.value.end;
1772
+ if (!l || !g) return;
1773
+ const V = Math.abs(E(g) - E(l));
1774
+ return Math.round(V / 864e5 + 1);
1775
+ }), $ = H(!1), Z = h(() => {
1776
+ if (!$.value) return;
1777
+ const { start: l, end: g } = K.value;
1778
+ if (!i.value) return "incomplete";
1779
+ if (!l || !g) return "invalid-date";
1780
+ if (!P.value.start || !P.value.end) return "out-of-bounds";
1781
+ const V = P.value.start, X = P.value.end;
1782
+ return f(V, X) ? typeof e.maxSpanDays == "number" && A.value !== void 0 && A.value > e.maxSpanDays ? "span-exceeds-limit" : "valid" : "reversed-range";
1783
+ }), s = h(() => {
1784
+ const l = Z.value;
1652
1785
  return l === void 0 || l === "valid";
1653
- }), A = y(() => {
1654
- const { min: l, max: m } = e, T = J.value;
1655
- if (!T) return "";
1656
- switch (T) {
1786
+ }), x = h(() => {
1787
+ const { min: l, max: g } = e, V = Z.value;
1788
+ if (!V) return "";
1789
+ switch (V) {
1657
1790
  case "incomplete":
1658
1791
  return "Required";
1659
1792
  case "invalid-date":
@@ -1661,22 +1794,22 @@ function It(e) {
1661
1794
  case "reversed-range":
1662
1795
  return "End Date must be on or after Start Date.";
1663
1796
  case "out-of-bounds":
1664
- return l && m ? `Dates must be between ${E(l)} and ${E(m)}.` : "Dates must be within the allowed range.";
1797
+ return l && g ? `Dates must be between ${k(l)} and ${k(g)}.` : "Dates must be within the allowed range.";
1665
1798
  case "span-exceeds-limit":
1666
1799
  return typeof e.maxSpanDays == "number" ? `Date range exceeds ${e.maxSpanDays} days.` : "Date range exceeds maximum allowed span.";
1667
1800
  default:
1668
1801
  return "";
1669
1802
  }
1670
- }), g = ["ArrowUp", "ArrowDown"], w = ["ArrowLeft", "ArrowRight"], C = (l, m) => String(l).padStart(m, "0"), E = (l) => `${C(l.getMonth() + 1, 2)}/${C(l.getDate(), 2)}/${C(
1803
+ }), v = ["ArrowUp", "ArrowDown"], D = ["ArrowLeft", "ArrowRight"], T = (l, g) => String(l).padStart(g, "0"), k = (l) => `${T(l.getMonth() + 1, 2)}/${T(l.getDate(), 2)}/${T(
1671
1804
  l.getFullYear(),
1672
1805
  4
1673
- )}`, F = (l) => l <= 2 ? { side: "start", part: "mm" } : l <= 5 ? { side: "start", part: (l <= 3, "dd") } : l <= 11 ? { side: "start", part: "yyyy" } : l <= 15 ? { side: "end", part: "mm" } : l <= 18 ? { side: "end", part: "dd" } : { side: "end", part: "yyyy" }, U = (l, m, T) => {
1674
- const z = m?.selectionStart ?? n.value ?? 0;
1675
- n.value = z;
1676
- const { start: ae, end: oe } = v(t.value);
1677
- if (!ae && !oe) {
1678
- const Q = /* @__PURE__ */ new Date(), de = E(Q);
1679
- t.value = `${de} - ${de}`, e.onChange({ value: { start: Q, end: Q }, event: T }), j(() => {
1806
+ )}`, O = (l) => l <= 2 ? { side: "start", part: "mm" } : l <= 5 ? { side: "start", part: (l <= 3, "dd") } : l <= 11 ? { side: "start", part: "yyyy" } : l <= 15 ? { side: "end", part: "mm" } : l <= 18 ? { side: "end", part: "dd" } : { side: "end", part: "yyyy" }, W = (l, g, V) => {
1807
+ const X = g?.selectionStart ?? n.value ?? 0;
1808
+ n.value = X;
1809
+ const { start: oe, end: le } = m(t.value);
1810
+ if (!oe && !le) {
1811
+ const ee = /* @__PURE__ */ new Date(), de = k(ee);
1812
+ t.value = `${de} - ${de}`, e.onChange({ value: { start: ee, end: ee }, event: V }), G(() => {
1680
1813
  requestAnimationFrame(() => {
1681
1814
  const ie = document.getElementById(
1682
1815
  e.id
@@ -1686,61 +1819,61 @@ function It(e) {
1686
1819
  });
1687
1820
  return;
1688
1821
  }
1689
- const fe = /* @__PURE__ */ new Date(), me = F(z);
1690
- let ve = ae ? new Date(ae) : new Date(fe), ge = oe ? new Date(oe) : new Date(fe);
1691
- const be = (Q, de) => {
1822
+ const fe = /* @__PURE__ */ new Date(), me = O(X);
1823
+ let ge = oe ? new Date(oe) : new Date(fe), he = le ? new Date(le) : new Date(fe);
1824
+ const we = (ee, de) => {
1692
1825
  if (de === "mm") {
1693
- const ie = Q.getMonth() + 1, se = l === "ArrowUp" ? ie < 12 ? ie + 1 : 1 : ie > 1 ? ie - 1 : 12;
1694
- Q.setMonth(se - 1);
1695
- const Se = R(Q.getFullYear(), se);
1696
- Q.getDate() > Se && Q.setDate(Se);
1826
+ const ie = ee.getMonth() + 1, se = l === "ArrowUp" ? ie < 12 ? ie + 1 : 1 : ie > 1 ? ie - 1 : 12;
1827
+ ee.setMonth(se - 1);
1828
+ const Se = F(ee.getFullYear(), se);
1829
+ ee.getDate() > Se && ee.setDate(Se);
1697
1830
  } else if (de === "dd") {
1698
- const ie = R(Q.getFullYear(), Q.getMonth() + 1), se = Q.getDate(), Se = l === "ArrowUp" ? se < ie ? se + 1 : 1 : se > 1 ? se - 1 : ie;
1699
- Q.setDate(Se);
1831
+ const ie = F(ee.getFullYear(), ee.getMonth() + 1), se = ee.getDate(), Se = l === "ArrowUp" ? se < ie ? se + 1 : 1 : se > 1 ? se - 1 : ie;
1832
+ ee.setDate(Se);
1700
1833
  } else if (de === "yyyy") {
1701
- const ie = Q.getFullYear();
1702
- Q.setFullYear(l === "ArrowUp" ? ie + 1 : Math.max(1, ie - 1));
1703
- const se = R(Q.getFullYear(), Q.getMonth() + 1);
1704
- Q.getDate() > se && Q.setDate(se);
1834
+ const ie = ee.getFullYear();
1835
+ ee.setFullYear(l === "ArrowUp" ? ie + 1 : Math.max(1, ie - 1));
1836
+ const se = F(ee.getFullYear(), ee.getMonth() + 1);
1837
+ ee.getDate() > se && ee.setDate(se);
1705
1838
  }
1706
1839
  };
1707
- me.side === "start" ? be(ve, me.part) : be(ge, me.part);
1708
- const Ae = E(ve), De = E(ge);
1840
+ me.side === "start" ? we(ge, me.part) : we(he, me.part);
1841
+ const Ae = k(ge), De = k(he);
1709
1842
  t.value = `${Ae} - ${De}`;
1710
- const pe = $(ve), Ee = $(ge);
1711
- pe && Ee && f(pe, Ee) ? e.onChange({ value: { start: pe, end: Ee }, event: T }) : e.onChange({ value: null, event: T }), j(() => {
1843
+ const pe = N(ge), Ee = N(he);
1844
+ pe && Ee && f(pe, Ee) ? e.onChange({ value: { start: pe, end: Ee }, event: V }) : e.onChange({ value: null, event: V }), G(() => {
1712
1845
  requestAnimationFrame(() => {
1713
- const Q = document.getElementById(
1846
+ const ee = document.getElementById(
1714
1847
  e.id
1715
1848
  ), de = n.value ?? 0;
1716
- Q && (Q.focus(), Q.setSelectionRange(de, de));
1849
+ ee && (ee.focus(), ee.setSelectionRange(de, de));
1717
1850
  });
1718
1851
  });
1719
1852
  }, _ = (l) => {
1720
- const { start: m, end: T } = v(t.value);
1721
- if (!m || !T) {
1853
+ const { start: g, end: V } = m(t.value);
1854
+ if (!g || !V) {
1722
1855
  e.onChange({ value: null, event: l });
1723
1856
  return;
1724
1857
  }
1725
- const z = $(m), ae = $(T);
1726
- if (!z || !ae) {
1858
+ const X = N(g), oe = N(V);
1859
+ if (!X || !oe) {
1727
1860
  e.onChange({ value: null, event: l });
1728
1861
  return;
1729
1862
  }
1730
- if (!f(z, ae)) {
1863
+ if (!f(X, oe)) {
1731
1864
  e.onChange({ value: null, event: l });
1732
1865
  return;
1733
1866
  }
1734
- e.onChange({ value: { start: z, end: ae }, event: l });
1735
- }, re = (l) => {
1736
- const m = l.value ?? "", T = l.event;
1737
- if (!m && T && T.type === "click") {
1738
- V(T);
1867
+ e.onChange({ value: { start: X, end: oe }, event: l });
1868
+ }, ne = (l) => {
1869
+ const g = l.value ?? "", V = l.event;
1870
+ if (!g && V && V.type === "click") {
1871
+ q(V);
1739
1872
  return;
1740
1873
  }
1741
- t.value = m;
1742
- const z = T?.target;
1743
- n.value = z?.selectionStart ?? 0, _(l);
1874
+ t.value = g;
1875
+ const X = V?.target;
1876
+ n.value = X?.selectionStart ?? 0, _(l);
1744
1877
  }, ue = (l) => {
1745
1878
  n.value = l.target.selectionStart ?? 0;
1746
1879
  }, o = (l) => {
@@ -1752,63 +1885,63 @@ function It(e) {
1752
1885
  l.preventDefault(), l.stopPropagation(), e.onShowCalendar(l);
1753
1886
  return;
1754
1887
  }
1755
- if (g.includes(l.key)) {
1888
+ if (v.includes(l.key)) {
1756
1889
  l.preventDefault(), l.stopPropagation();
1757
- const m = l.target;
1758
- U(l.key, m, l);
1890
+ const g = l.target;
1891
+ W(l.key, g, l);
1759
1892
  return;
1760
1893
  }
1761
- }, S = (l) => {
1894
+ }, b = (l) => {
1762
1895
  l.preventDefault();
1763
- const m = l.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1764
- U(m, l.target, l);
1765
- }, s = (l) => {
1766
- if (w.includes(l.key) || g.includes(l.key)) {
1767
- const m = l.target;
1768
- n.value = m?.selectionStart ?? 0;
1769
- }
1770
- }, h = () => {
1771
- Y.value = !0, (e.manageValid ?? !0) && (I.value = c.value);
1772
- }, L = (l) => {
1773
- h();
1774
- }, V = (l) => {
1775
- t.value = "", n.value = 0, e.onChange({ value: null, event: l }), h(), j(() => {
1776
- const m = document.getElementById(
1896
+ const g = l.deltaY < 0 ? "ArrowUp" : "ArrowDown";
1897
+ W(g, l.target, l);
1898
+ }, U = (l) => {
1899
+ if (D.includes(l.key) || v.includes(l.key)) {
1900
+ const g = l.target;
1901
+ n.value = g?.selectionStart ?? 0;
1902
+ }
1903
+ }, p = () => {
1904
+ $.value = !0, (e.manageValid ?? !0) && (C.value = s.value);
1905
+ }, y = (l) => {
1906
+ p();
1907
+ }, q = (l) => {
1908
+ t.value = "", n.value = 0, e.onChange({ value: null, event: l }), p(), G(() => {
1909
+ const g = document.getElementById(
1777
1910
  e.id
1778
1911
  );
1779
- m && (m.focus(), m.setSelectionRange(0, 0));
1912
+ g && (g.focus(), g.setSelectionRange(0, 0));
1780
1913
  });
1781
1914
  };
1782
- e.externalValue && le(
1915
+ e.externalValue && ae(
1783
1916
  e.externalValue,
1784
1917
  (l) => {
1785
- const m = l?.start ?? null, T = l?.end ?? null;
1786
- if (m && T) {
1787
- if (t.value = `${E(m)} - ${E(T)}`, e.isOpen?.value && a.value && e.onRequestClose) {
1788
- const z = typeof e.closeDelay == "number" ? e.closeDelay : e.closeDelay?.value ?? 0;
1918
+ const g = l?.start ?? null, V = l?.end ?? null;
1919
+ if (g && V) {
1920
+ if (t.value = `${k(g)} - ${k(V)}`, e.isOpen?.value && a.value && e.onRequestClose) {
1921
+ const X = typeof e.closeDelay == "number" ? e.closeDelay : e.closeDelay?.value ?? 0;
1789
1922
  setTimeout(() => {
1790
- e.onRequestClose?.(), a.value = !1, h();
1791
- }, z);
1923
+ e.onRequestClose?.(), a.value = !1, p();
1924
+ }, X);
1792
1925
  }
1793
1926
  return;
1794
1927
  }
1795
1928
  },
1796
1929
  { immediate: !0 }
1797
1930
  );
1798
- const r = y(
1931
+ const r = h(
1799
1932
  () => t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0"
1800
- ), i = y(
1933
+ ), d = h(
1801
1934
  () => t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0"
1802
- ), P = y(
1935
+ ), R = h(
1803
1936
  () => t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0"
1804
- ), N = y(
1937
+ ), B = h(
1805
1938
  () => t.value && t.value.substring(13, 15).replace(/\D/g, "0") || "0"
1806
- ), H = y(
1939
+ ), Y = h(
1807
1940
  () => t.value && t.value.substring(16, 18).replace(/\D/g, "0") || "0"
1808
- ), te = y(
1941
+ ), Q = h(
1809
1942
  () => t.value && t.value.substring(19, 23).replace(/\D/g, "0") || "0"
1810
- ), Z = y(() => {
1811
- const { start: l, end: m } = v(t.value);
1943
+ ), j = h(() => {
1944
+ const { start: l, end: g } = m(t.value);
1812
1945
  return [
1813
1946
  {
1814
1947
  label: "Raw",
@@ -1825,80 +1958,80 @@ function It(e) {
1825
1958
  {
1826
1959
  label: "Start",
1827
1960
  value: `${String(r.value).padStart(2, "0")} / ${String(
1828
- i.value
1829
- ).padStart(2, "0")} / ${String(P.value).padStart(4, "0")}`
1961
+ d.value
1962
+ ).padStart(2, "0")} / ${String(R.value).padStart(4, "0")}`
1830
1963
  },
1831
1964
  {
1832
1965
  label: "End",
1833
- value: `${String(N.value).padStart(2, "0")} / ${String(
1834
- H.value
1835
- ).padStart(2, "0")} / ${String(te.value).padStart(4, "0")}`
1966
+ value: `${String(B.value).padStart(2, "0")} / ${String(
1967
+ Y.value
1968
+ ).padStart(2, "0")} / ${String(Q.value).padStart(4, "0")}`
1836
1969
  },
1837
- { label: "Digits only", value: M.value },
1838
- { label: "Mask complete", value: `${u.value}` },
1970
+ { label: "Digits only", value: I.value },
1971
+ { label: "Mask complete", value: `${i.value}` },
1839
1972
  {
1840
1973
  label: "Parsed",
1841
- value: `${l ? l.toDateString() : "-"} | ${m ? m.toDateString() : "-"}`
1974
+ value: `${l ? l.toDateString() : "-"} | ${g ? g.toDateString() : "-"}`
1842
1975
  },
1843
1976
  {
1844
1977
  label: "Valid (managed)",
1845
- value: `${I.value ?? "-"}`
1978
+ value: `${C.value ?? "-"}`
1846
1979
  },
1847
- { label: "Span (days)", value: `${B.value ?? "-"}` },
1980
+ { label: "Span (days)", value: `${A.value ?? "-"}` },
1848
1981
  {
1849
1982
  label: "Reason",
1850
- value: `${J.value ?? "-"}`
1983
+ value: `${Z.value ?? "-"}`
1851
1984
  },
1852
1985
  {
1853
1986
  label: "Cursor in",
1854
1987
  value: `${n.value ?? "-"} (${(() => {
1855
- const T = n.value ?? 0, z = F(T);
1856
- return `${z.side}.${z.part}`;
1988
+ const V = n.value ?? 0, X = O(V);
1989
+ return `${X.side}.${X.part}`;
1857
1990
  })()})`
1858
1991
  }
1859
1992
  ];
1860
- }), G = () => {
1861
- j(() => {
1993
+ }), J = () => {
1994
+ G(() => {
1862
1995
  const l = document.getElementById(e.id);
1863
1996
  if (!l) {
1864
1997
  console.warn(`#${e.id} not found for styling.`);
1865
1998
  return;
1866
1999
  }
1867
- const m = l.closest("div");
1868
- if (!m) {
2000
+ const g = l.closest("div");
2001
+ if (!g) {
1869
2002
  console.warn(`Parent div of #${e.id} not found for styling.`);
1870
2003
  return;
1871
2004
  }
1872
- m.classList.contains("fk-daterangepicker") || m.classList.add("fk-daterangepicker");
2005
+ g.classList.contains("fk-daterangepicker") || g.classList.add("fk-daterangepicker");
1873
2006
  });
1874
2007
  };
1875
2008
  Re(() => {
1876
- G();
2009
+ J();
1877
2010
  });
1878
2011
  const ce = () => {
1879
- j(() => {
2012
+ G(() => {
1880
2013
  try {
1881
2014
  const l = Array.from(
1882
2015
  document.querySelectorAll(".k-animation-container")
1883
2016
  );
1884
2017
  if (!l.length) return;
1885
- const T = [...l].reverse().find((oe) => oe.querySelector(".k-calendar"))?.querySelector(
2018
+ const V = [...l].reverse().find((le) => le.querySelector(".k-calendar"))?.querySelector(
1886
2019
  ".k-calendar"
1887
2020
  );
1888
- if (!T) return;
1889
- const z = T.querySelectorAll(
2021
+ if (!V) return;
2022
+ const X = V.querySelectorAll(
1890
2023
  ".k-calendar-table"
1891
2024
  );
1892
- let ae = !1;
1893
- z.forEach((oe) => {
1894
- oe.tabIndex === 0 && (ae ? oe.tabIndex = -1 : ae = !0);
2025
+ let oe = !1;
2026
+ X.forEach((le) => {
2027
+ le.tabIndex === 0 && (oe ? le.tabIndex = -1 : oe = !0);
1895
2028
  });
1896
2029
  } catch (l) {
1897
2030
  console.warn(l);
1898
2031
  }
1899
2032
  });
1900
2033
  };
1901
- return e.isOpen && le(
2034
+ return e.isOpen && ae(
1902
2035
  e.isOpen,
1903
2036
  (l) => {
1904
2037
  l && setTimeout(() => ce(), 0);
@@ -1907,96 +2040,96 @@ function It(e) {
1907
2040
  ), {
1908
2041
  raw: t,
1909
2042
  cursorPos: n,
1910
- debugEnabled: p,
1911
- debugLines: Z,
1912
- digitsOnly: M,
1913
- valid: I,
1914
- validComputed: ee(c),
1915
- reason: ee(J),
1916
- validationMessage: ee(A),
1917
- spanDays: ee(B),
1918
- month1: ee(r),
1919
- day1: ee(i),
1920
- year1: ee(P),
1921
- month2: ee(N),
1922
- day2: ee(H),
1923
- year2: ee(te),
1924
- handleChange: re,
2043
+ debugEnabled: u,
2044
+ debugLines: j,
2045
+ digitsOnly: I,
2046
+ valid: C,
2047
+ validComputed: te(s),
2048
+ reason: te(Z),
2049
+ validationMessage: te(x),
2050
+ spanDays: te(A),
2051
+ month1: te(r),
2052
+ day1: te(d),
2053
+ year1: te(R),
2054
+ month2: te(B),
2055
+ day2: te(Y),
2056
+ year2: te(Q),
2057
+ handleChange: ne,
1925
2058
  handleKeyDown: o,
1926
- handleWheel: S,
1927
- handleKeyUp: s,
2059
+ handleWheel: b,
2060
+ handleKeyUp: U,
1928
2061
  handleClick: ue,
1929
- handleBlur: L,
1930
- handleClear: V,
2062
+ handleBlur: y,
2063
+ handleClear: q,
1931
2064
  onCalendarChange: () => {
1932
2065
  a.value = !0;
1933
2066
  },
1934
- initStyling: G
2067
+ initStyling: J
1935
2068
  };
1936
2069
  }
1937
- function Ct(e) {
1938
- const t = X(""), n = X(void 0), p = X(!!e.debug), a = X(e.timeFormat ?? "hh:mm AM"), d = y(() => !!e.required), b = X(!1), D = ["ArrowUp", "ArrowDown"], O = ["ArrowLeft", "ArrowRight"], K = y(() => (t.value ?? "").replace(/\D/g, "")), M = {
2070
+ function Ot(e) {
2071
+ const t = H(""), n = H(void 0), u = H(!!e.debug), a = H(e.timeFormat ?? "hh:mm AM"), c = h(() => !!e.required), w = H(!1), S = ["ArrowUp", "ArrowDown"], L = ["ArrowLeft", "ArrowRight"], z = h(() => (t.value ?? "").replace(/\D/g, "")), I = {
1939
2072
  H: /[0-9]/,
1940
2073
  h: /[0-9]/,
1941
2074
  M: /[0-9]/,
1942
2075
  m: /[0-9]/,
1943
2076
  A: /[AaPp]/,
1944
2077
  a: /[Mm]/
1945
- }, R = (r) => r <= 2 ? "hh" : r <= 5 ? "mm" : "ampm", k = y(() => {
1946
- const r = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0", i = parseInt(r);
1947
- return Math.min(Math.max(i, 0), 23);
1948
- }), x = y(() => {
1949
- const r = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0", i = parseInt(r);
1950
- return Math.min(Math.max(i, 0), 59);
1951
- }), $ = y(() => (t.value?.substring(6, 8) || "AM").toUpperCase().startsWith("P") ? "PM" : "AM"), f = y(() => {
1952
- const r = parseInt(t.value?.substring(0, 2).replace(/\D/g, "0") || "0"), i = $.value;
1953
- return r === 12 ? i === "AM" ? 0 : 12 : i === "PM" ? r + 12 : r;
1954
- }), u = y(() => v.value ? `${String(f.value).padStart(2, "0")}:${String(x.value).padStart(2, "0")}:00` : null), v = y(
2078
+ }, F = (r) => r <= 2 ? "hh" : r <= 5 ? "mm" : "ampm", M = h(() => {
2079
+ const r = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0", d = parseInt(r);
2080
+ return Math.min(Math.max(d, 0), 23);
2081
+ }), E = h(() => {
2082
+ const r = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0", d = parseInt(r);
2083
+ return Math.min(Math.max(d, 0), 59);
2084
+ }), N = h(() => (t.value?.substring(6, 8) || "AM").toUpperCase().startsWith("P") ? "PM" : "AM"), f = h(() => {
2085
+ const r = parseInt(t.value?.substring(0, 2).replace(/\D/g, "0") || "0"), d = N.value;
2086
+ return r === 12 ? d === "AM" ? 0 : 12 : d === "PM" ? r + 12 : r;
2087
+ }), i = h(() => m.value ? `${String(f.value).padStart(2, "0")}:${String(E.value).padStart(2, "0")}:00` : null), m = h(
1955
2088
  () => /^(\d{2}):(\d{2})\s([AP]M)$/i.test(t.value ?? "")
1956
- ), I = (r, i, P) => {
1957
- let N = r % 12;
1958
- return N === 0 && (N = 12), `${String(N).padStart(2, "0")}:${String(i).padStart(
2089
+ ), C = (r, d, R) => {
2090
+ let B = r % 12;
2091
+ return B === 0 && (B = 12), `${String(B).padStart(2, "0")}:${String(d).padStart(
1959
2092
  2,
1960
2093
  "0"
1961
- )} ${P}`;
1962
- }, q = (r) => {
1963
- const i = r.match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
1964
- if (!i) return null;
1965
- const P = parseInt(i[1]), N = parseInt(i[2]), H = i[3].toUpperCase();
1966
- if (P < 1 || P > 12 || N < 0 || N > 59) return null;
1967
- let te = P % 12;
1968
- H === "PM" && (te += 12);
1969
- const Z = /* @__PURE__ */ new Date();
1970
- return Z.setSeconds(0, 0), Z.setHours(te), Z.setMinutes(N), Z;
1971
- }, W = (r) => {
1972
- if (K.value.length === 0) {
2094
+ )} ${R}`;
2095
+ }, K = (r) => {
2096
+ const d = r.match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
2097
+ if (!d) return null;
2098
+ const R = parseInt(d[1]), B = parseInt(d[2]), Y = d[3].toUpperCase();
2099
+ if (R < 1 || R > 12 || B < 0 || B > 59) return null;
2100
+ let Q = R % 12;
2101
+ Y === "PM" && (Q += 12);
2102
+ const j = /* @__PURE__ */ new Date();
2103
+ return j.setSeconds(0, 0), j.setHours(Q), j.setMinutes(B), j;
2104
+ }, P = (r) => {
2105
+ if (z.value.length === 0) {
1973
2106
  e.onChange({ value: null, event: r });
1974
2107
  return;
1975
2108
  }
1976
- if (!v.value) {
2109
+ if (!m.value) {
1977
2110
  e.onChange({ value: null, event: r });
1978
2111
  return;
1979
2112
  }
1980
- const i = q(t.value);
1981
- i && Y(i) ? e.onChange({ value: i, event: r }) : e.onChange({ value: null, event: r });
1982
- }, B = (r) => r.getHours() * 60 + r.getMinutes(), Y = (r) => {
1983
- const i = e.min ?? void 0, P = e.max ?? void 0, N = B(r);
1984
- if (i) {
1985
- const H = B(i);
1986
- if (N < H) return !1;
2113
+ const d = K(t.value);
2114
+ d && $(d) ? e.onChange({ value: d, event: r }) : e.onChange({ value: null, event: r });
2115
+ }, A = (r) => r.getHours() * 60 + r.getMinutes(), $ = (r) => {
2116
+ const d = e.min ?? void 0, R = e.max ?? void 0, B = A(r);
2117
+ if (d) {
2118
+ const Y = A(d);
2119
+ if (B < Y) return !1;
1987
2120
  }
1988
- if (P) {
1989
- const H = B(P);
1990
- if (N > H) return !1;
2121
+ if (R) {
2122
+ const Y = A(R);
2123
+ if (B > Y) return !1;
1991
2124
  }
1992
2125
  return !0;
1993
- }, J = (r) => {
1994
- const i = r.getHours(), P = i >= 12 ? "PM" : "AM";
1995
- t.value = I(i, r.getMinutes(), P);
1996
- }, c = (r, i) => {
1997
- e.onChange({ value: r, event: i });
1998
- }, A = () => {
1999
- j(() => {
2126
+ }, Z = (r) => {
2127
+ const d = r.getHours(), R = d >= 12 ? "PM" : "AM";
2128
+ t.value = C(d, r.getMinutes(), R);
2129
+ }, s = (r, d) => {
2130
+ e.onChange({ value: r, event: d });
2131
+ }, x = () => {
2132
+ G(() => {
2000
2133
  requestAnimationFrame(() => {
2001
2134
  requestAnimationFrame(() => {
2002
2135
  const r = document.getElementById(
@@ -2004,114 +2137,114 @@ function Ct(e) {
2004
2137
  );
2005
2138
  if (r) {
2006
2139
  r.focus();
2007
- const i = (r.value ?? "").length;
2008
- r.setSelectionRange(i, i);
2140
+ const d = (r.value ?? "").length;
2141
+ r.setSelectionRange(d, d);
2009
2142
  }
2010
2143
  });
2011
2144
  });
2012
2145
  });
2013
- }, g = (r) => {
2014
- const i = r?.event?.target;
2015
- return i ? i.closest(".k-time-now") ? "now" : i.closest(".k-time-accept") ? "set" : null : null;
2016
- }, w = (r, i) => {
2017
- r && Y(r) ? c(r, i) : c(null, i);
2018
- }, C = (...r) => {
2019
- const i = r[0];
2020
- if (!i) return;
2021
- const P = g(i);
2022
- if (P === "now") {
2023
- const H = /* @__PURE__ */ new Date();
2024
- J(H), w(H, i), A();
2146
+ }, v = (r) => {
2147
+ const d = r?.event?.target;
2148
+ return d ? d.closest(".k-time-now") ? "now" : d.closest(".k-time-accept") ? "set" : null : null;
2149
+ }, D = (r, d) => {
2150
+ r && $(r) ? s(r, d) : s(null, d);
2151
+ }, T = (...r) => {
2152
+ const d = r[0];
2153
+ if (!d) return;
2154
+ const R = v(d);
2155
+ if (R === "now") {
2156
+ const Y = /* @__PURE__ */ new Date();
2157
+ Z(Y), D(Y, d), x();
2025
2158
  return;
2026
2159
  }
2027
- if (i?.value instanceof Date) {
2028
- const H = new Date(i.value);
2029
- J(H), w(H, i), P === "set" && A();
2160
+ if (d?.value instanceof Date) {
2161
+ const Y = new Date(d.value);
2162
+ Z(Y), D(Y, d), R === "set" && x();
2030
2163
  return;
2031
2164
  }
2032
- if (i?.value === null) {
2033
- t.value = "", c(null, i);
2165
+ if (d?.value === null) {
2166
+ t.value = "", s(null, d);
2034
2167
  return;
2035
2168
  }
2036
- t.value = i.value;
2037
- const N = i.event?.target;
2038
- n.value = N?.selectionStart ?? 0;
2169
+ t.value = d.value;
2170
+ const B = d.event?.target;
2171
+ n.value = B?.selectionStart ?? 0;
2039
2172
  try {
2040
- const H = n.value ?? 0;
2041
- if (R(H) === "ampm" && (t.value ?? "").length >= 8) {
2042
- const te = t.value.charAt(6);
2043
- /[Aa]/.test(te) ? (t.value = `${t.value.slice(0, 6)}AM${t.value.slice(8)}`, j(() => {
2173
+ const Y = n.value ?? 0;
2174
+ if (F(Y) === "ampm" && (t.value ?? "").length >= 8) {
2175
+ const Q = t.value.charAt(6);
2176
+ /[Aa]/.test(Q) ? (t.value = `${t.value.slice(0, 6)}AM${t.value.slice(8)}`, G(() => {
2044
2177
  requestAnimationFrame(() => {
2045
- const Z = document.getElementById(
2178
+ const j = document.getElementById(
2046
2179
  e.id
2047
2180
  );
2048
- Z && (Z.focus(), Z.setSelectionRange(8, 8));
2181
+ j && (j.focus(), j.setSelectionRange(8, 8));
2049
2182
  });
2050
- })) : /[Pp]/.test(te) && (t.value = `${t.value.slice(0, 6)}PM${t.value.slice(8)}`, j(() => {
2183
+ })) : /[Pp]/.test(Q) && (t.value = `${t.value.slice(0, 6)}PM${t.value.slice(8)}`, G(() => {
2051
2184
  requestAnimationFrame(() => {
2052
- const Z = document.getElementById(
2185
+ const j = document.getElementById(
2053
2186
  e.id
2054
2187
  );
2055
- Z && (Z.focus(), Z.setSelectionRange(8, 8));
2188
+ j && (j.focus(), j.setSelectionRange(8, 8));
2056
2189
  });
2057
2190
  }));
2058
2191
  }
2059
2192
  } catch {
2060
2193
  }
2061
- W(i);
2062
- }, E = (r) => {
2194
+ P(d);
2195
+ }, k = (r) => {
2063
2196
  n.value = r.target.selectionStart ?? 0;
2064
- }, F = (r, i, P) => {
2065
- const N = i?.selectionStart ?? n.value ?? 0;
2066
- n.value = N;
2067
- const H = R(N), te = (t.value ?? "").match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
2068
- if (!te) {
2069
- if ((t.value ?? "").length === 0 || K.value.length === 0) {
2070
- const m = /* @__PURE__ */ new Date(), T = m.getHours(), z = T >= 12 ? "PM" : "AM";
2071
- t.value = I(T, m.getMinutes(), z);
2072
- const ae = q(t.value);
2073
- w(ae, P), j(() => {
2197
+ }, O = (r, d, R) => {
2198
+ const B = d?.selectionStart ?? n.value ?? 0;
2199
+ n.value = B;
2200
+ const Y = F(B), Q = (t.value ?? "").match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
2201
+ if (!Q) {
2202
+ if ((t.value ?? "").length === 0 || z.value.length === 0) {
2203
+ const g = /* @__PURE__ */ new Date(), V = g.getHours(), X = V >= 12 ? "PM" : "AM";
2204
+ t.value = C(V, g.getMinutes(), X);
2205
+ const oe = K(t.value);
2206
+ D(oe, R), G(() => {
2074
2207
  requestAnimationFrame(() => {
2075
- const oe = document.getElementById(
2208
+ const le = document.getElementById(
2076
2209
  e.id
2077
2210
  ), fe = n.value ?? 0;
2078
- oe && (oe.focus(), oe.setSelectionRange(fe, fe));
2211
+ le && (le.focus(), le.setSelectionRange(fe, fe));
2079
2212
  });
2080
2213
  });
2081
2214
  }
2082
2215
  return;
2083
2216
  }
2084
- let Z = parseInt(te[1]), G = parseInt(te[2]), ce = te[3].toUpperCase();
2085
- if (H === "hh")
2086
- r === "ArrowUp" ? Z = Z < 12 ? Z + 1 : 1 : Z = Z > 1 ? Z - 1 : 12;
2087
- else if (H === "mm") {
2088
- const m = e.minuteStepRef?.value ?? e.minuteStep ?? 1;
2089
- if (m === 1)
2090
- r === "ArrowUp" ? G = G < 59 ? G + 1 : 0 : G = G > 0 ? G - 1 : 59;
2217
+ let j = parseInt(Q[1]), J = parseInt(Q[2]), ce = Q[3].toUpperCase();
2218
+ if (Y === "hh")
2219
+ r === "ArrowUp" ? j = j < 12 ? j + 1 : 1 : j = j > 1 ? j - 1 : 12;
2220
+ else if (Y === "mm") {
2221
+ const g = e.minuteStepRef?.value ?? e.minuteStep ?? 1;
2222
+ if (g === 1)
2223
+ r === "ArrowUp" ? J = J < 59 ? J + 1 : 0 : J = J > 0 ? J - 1 : 59;
2091
2224
  else if (r === "ArrowUp") {
2092
- const T = G % m;
2093
- let z = T === 0 ? G + m : G + (m - T);
2094
- z >= 60 && (z = 0), G = z;
2225
+ const V = J % g;
2226
+ let X = V === 0 ? J + g : J + (g - V);
2227
+ X >= 60 && (X = 0), J = X;
2095
2228
  } else {
2096
- const T = G % m;
2097
- let z = T === 0 ? G - m : G - T;
2098
- z < 0 && (z = 60 - m), G = z;
2229
+ const V = J % g;
2230
+ let X = V === 0 ? J - g : J - V;
2231
+ X < 0 && (X = 60 - g), J = X;
2099
2232
  }
2100
- } else H === "ampm" && (ce = ce === "AM" ? "PM" : "AM");
2101
- t.value = `${String(Z).padStart(2, "0")}:${String(G).padStart(
2233
+ } else Y === "ampm" && (ce = ce === "AM" ? "PM" : "AM");
2234
+ t.value = `${String(j).padStart(2, "0")}:${String(J).padStart(
2102
2235
  2,
2103
2236
  "0"
2104
2237
  )} ${ce}`;
2105
- const l = q(t.value);
2106
- w(l, P), j(() => {
2238
+ const l = K(t.value);
2239
+ D(l, R), G(() => {
2107
2240
  requestAnimationFrame(() => {
2108
- const m = document.getElementById(
2241
+ const g = document.getElementById(
2109
2242
  e.id
2110
- ), T = n.value ?? 0;
2111
- m && (m.focus(), m.setSelectionRange(T, T));
2243
+ ), V = n.value ?? 0;
2244
+ g && (g.focus(), g.setSelectionRange(V, V));
2112
2245
  });
2113
2246
  });
2114
- }, U = (r) => {
2247
+ }, W = (r) => {
2115
2248
  if (r.code === "Space" || r.key === " ") {
2116
2249
  r.preventDefault(), r.stopPropagation(), e.onShowPicker(r);
2117
2250
  return;
@@ -2120,57 +2253,57 @@ function Ct(e) {
2120
2253
  r.preventDefault(), r.stopPropagation(), e.onShowPicker(r);
2121
2254
  return;
2122
2255
  }
2123
- if (D.includes(r.key)) {
2256
+ if (S.includes(r.key)) {
2124
2257
  if (r.altKey) return;
2125
2258
  r.preventDefault(), r.stopPropagation();
2126
- const i = r.target;
2127
- F(r.key, i, r);
2259
+ const d = r.target;
2260
+ O(r.key, d, r);
2128
2261
  return;
2129
2262
  }
2130
2263
  }, _ = (r) => {
2131
2264
  r.preventDefault();
2132
- const i = r.deltaY < 0 ? "ArrowUp" : "ArrowDown";
2133
- F(i, r.target, r);
2134
- }, re = (r) => {
2135
- const i = r.target;
2136
- if (O.includes(r.key)) {
2137
- n.value = i?.selectionStart ?? 0;
2265
+ const d = r.deltaY < 0 ? "ArrowUp" : "ArrowDown";
2266
+ O(d, r.target, r);
2267
+ }, ne = (r) => {
2268
+ const d = r.target;
2269
+ if (L.includes(r.key)) {
2270
+ n.value = d?.selectionStart ?? 0;
2138
2271
  return;
2139
2272
  }
2140
- if (D.includes(r.key)) {
2273
+ if (S.includes(r.key)) {
2141
2274
  if (r.altKey) return;
2142
- n.value = i?.selectionStart ?? 0;
2275
+ n.value = d?.selectionStart ?? 0;
2143
2276
  }
2144
2277
  }, ue = (r) => {
2145
- b.value = !0, d.value && e.externalValue && e.externalValue.value === void 0 && K.value.length === 0 && (e.externalValue.value = "");
2146
- const i = r.target;
2147
- i && (n.value = i.selectionStart ?? 0);
2278
+ w.value = !0, c.value && e.externalValue && e.externalValue.value === void 0 && z.value.length === 0 && (e.externalValue.value = "");
2279
+ const d = r.target;
2280
+ d && (n.value = d.selectionStart ?? 0);
2148
2281
  };
2149
- e.externalValue && le(
2282
+ e.externalValue && ae(
2150
2283
  e.externalValue,
2151
2284
  (r) => {
2152
2285
  if (r) {
2153
- const i = new Date(r);
2154
- if (i.toString() !== "Invalid Date") {
2155
- const P = i.getHours(), N = P >= 12 ? "PM" : "AM";
2156
- t.value = I(P, i.getMinutes(), N);
2286
+ const d = new Date(r);
2287
+ if (d.toString() !== "Invalid Date") {
2288
+ const R = d.getHours(), B = R >= 12 ? "PM" : "AM";
2289
+ t.value = C(R, d.getMinutes(), B);
2157
2290
  return;
2158
2291
  }
2159
2292
  }
2160
2293
  },
2161
2294
  { immediate: !0 }
2162
2295
  );
2163
- const o = y(() => [
2296
+ const o = h(() => [
2164
2297
  ["Time", t.value || "--:-- --"],
2165
- ["Hour (12h)", k.value],
2298
+ ["Hour (12h)", M.value],
2166
2299
  ["Hour (24h)", f.value],
2167
- ["Minute", x.value],
2168
- ["Period", $.value],
2169
- ["Time (24h)", u.value ?? "--:--:--"],
2170
- ["Digits only", K.value],
2300
+ ["Minute", E.value],
2301
+ ["Period", N.value],
2302
+ ["Time (24h)", i.value ?? "--:--:--"],
2303
+ ["Digits only", z.value],
2171
2304
  [
2172
2305
  "Parsed Date",
2173
- S.value?.toLocaleDateString("en-US", {
2306
+ b.value?.toLocaleDateString("en-US", {
2174
2307
  hour: "2-digit",
2175
2308
  minute: "2-digit"
2176
2309
  }) ?? null
@@ -2189,117 +2322,117 @@ function Ct(e) {
2189
2322
  minute: "2-digit"
2190
2323
  }) ?? null
2191
2324
  ],
2192
- ["valid", s.value],
2193
- ["reason", h.value],
2194
- ["validationMessage", L.value]
2195
- ]), S = y(
2196
- () => q(t.value) ?? null
2197
- ), s = y(() => {
2198
- if (!d.value) {
2199
- if (!v.value) return !0;
2200
- const i = S.value;
2201
- return i ? Y(i) : !1;
2202
- }
2203
- if (!b.value) return !0;
2204
- const r = S.value;
2205
- return !v.value || !r ? !1 : Y(r);
2206
- }), h = y(() => {
2207
- if (!d.value) {
2208
- if (!v.value) return;
2209
- const i = S.value;
2210
- return i ? Y(i) ? "valid" : "out-of-bounds" : "invalid-time";
2211
- }
2212
- if (!b.value) return;
2213
- if (K.value.length === 0 || !v.value)
2325
+ ["valid", U.value],
2326
+ ["reason", p.value],
2327
+ ["validationMessage", y.value]
2328
+ ]), b = h(
2329
+ () => K(t.value) ?? null
2330
+ ), U = h(() => {
2331
+ if (!c.value) {
2332
+ if (!m.value) return !0;
2333
+ const d = b.value;
2334
+ return d ? $(d) : !1;
2335
+ }
2336
+ if (!w.value) return !0;
2337
+ const r = b.value;
2338
+ return !m.value || !r ? !1 : $(r);
2339
+ }), p = h(() => {
2340
+ if (!c.value) {
2341
+ if (!m.value) return;
2342
+ const d = b.value;
2343
+ return d ? $(d) ? "valid" : "out-of-bounds" : "invalid-time";
2344
+ }
2345
+ if (!w.value) return;
2346
+ if (z.value.length === 0 || !m.value)
2214
2347
  return "incomplete";
2215
- const r = S.value;
2216
- return r ? Y(r) ? "valid" : "out-of-bounds" : "invalid-time";
2217
- }), L = y(() => {
2218
- const r = h.value;
2348
+ const r = b.value;
2349
+ return r ? $(r) ? "valid" : "out-of-bounds" : "invalid-time";
2350
+ }), y = h(() => {
2351
+ const r = p.value;
2219
2352
  if (!r || r === "valid") return "";
2220
2353
  if (r === "incomplete")
2221
2354
  return "Required";
2222
2355
  if (r === "invalid-time")
2223
2356
  return `Must be in ${a.value} format.`;
2224
- const i = {
2357
+ const d = {
2225
2358
  hour: "2-digit",
2226
2359
  minute: "2-digit"
2227
- }, P = e.min ? e.min.toLocaleTimeString("en-US", i) : null, N = e.max ? e.max.toLocaleTimeString("en-US", i) : null;
2360
+ }, R = e.min ? e.min.toLocaleTimeString("en-US", d) : null, B = e.max ? e.max.toLocaleTimeString("en-US", d) : null;
2228
2361
  if (r === "out-of-bounds") {
2229
- if (P && N) return `Must be between ${P} and ${N}.`;
2230
- if (P) return `Must be ${P} or later.`;
2231
- if (N) return `Must be ${N} or earlier.`;
2362
+ if (R && B) return `Must be between ${R} and ${B}.`;
2363
+ if (R) return `Must be ${R} or later.`;
2364
+ if (B) return `Must be ${B} or earlier.`;
2232
2365
  }
2233
2366
  return "";
2234
- }), V = () => {
2235
- j(() => {
2367
+ }), q = () => {
2368
+ G(() => {
2236
2369
  const r = document.getElementById(e.id);
2237
2370
  if (!r) {
2238
2371
  console.warn(`#${e.id} not found for styling.`);
2239
2372
  return;
2240
2373
  }
2241
- const i = r.closest(".k-timepicker");
2242
- if (!i) {
2374
+ const d = r.closest(".k-timepicker");
2375
+ if (!d) {
2243
2376
  console.warn(
2244
2377
  `.k-timepicker parent of #${e.id} not found for styling.`
2245
2378
  );
2246
2379
  return;
2247
2380
  }
2248
- const P = i.parentElement;
2249
- if (!P) {
2381
+ const R = d.parentElement;
2382
+ if (!R) {
2250
2383
  console.warn(
2251
2384
  `Parent of .k-timepicker not found for #${e.id} styling.`
2252
2385
  );
2253
2386
  return;
2254
2387
  }
2255
- P.classList.contains("fk-timepicker") || P.classList.add("fk-timepicker");
2388
+ R.classList.contains("fk-timepicker") || R.classList.add("fk-timepicker");
2256
2389
  });
2257
2390
  };
2258
2391
  return Re(() => {
2259
- V();
2392
+ q();
2260
2393
  }), {
2261
2394
  raw: t,
2262
- rules: M,
2263
- debugEnabled: p,
2395
+ rules: I,
2396
+ debugEnabled: u,
2264
2397
  debugLines: o,
2265
2398
  placeholder: a,
2266
- isValid: s,
2267
- reason: ee(h),
2268
- validationMessage: L,
2269
- isComplete: v,
2270
- inRangeTime: Y,
2399
+ isValid: U,
2400
+ reason: te(p),
2401
+ validationMessage: y,
2402
+ isComplete: m,
2403
+ inRangeTime: $,
2271
2404
  cursorPos: n,
2272
- hour: ee(k),
2273
- hour24: ee(f),
2274
- minute: ee(x),
2275
- period: ee($),
2276
- time24: ee(u),
2277
- parsedRawTime: ee(S),
2278
- handleChange: C,
2279
- handleKeyDown: U,
2280
- handleKeyUp: re,
2281
- handleClick: E,
2405
+ hour: te(M),
2406
+ hour24: te(f),
2407
+ minute: te(E),
2408
+ period: te(N),
2409
+ time24: te(i),
2410
+ parsedRawTime: te(b),
2411
+ handleChange: T,
2412
+ handleKeyDown: W,
2413
+ handleKeyUp: ne,
2414
+ handleClick: k,
2282
2415
  handleWheel: _,
2283
2416
  handleBlur: ue,
2284
2417
  // Expose so consumers can reapply theming when Kendo updates DOM
2285
- initStyling: V
2418
+ initStyling: q
2286
2419
  };
2287
2420
  }
2288
- const Tt = {
2421
+ const Vt = {
2289
2422
  returnFocusToTrigger: !1,
2290
2423
  focusTrapOptions: {
2291
2424
  returnFocusOnDeactivate: !1
2292
2425
  }
2293
2426
  };
2294
- function Rt(e) {
2295
- const t = ye(null), n = [
2427
+ function Nt(e) {
2428
+ const t = ve(null), n = [
2296
2429
  ".k-animation-container .k-popup",
2297
2430
  ".k-popup",
2298
2431
  ".k-timepicker-popup",
2299
2432
  ".k-menu-popup"
2300
- ], p = Array.isArray(e.popupSelector) ? e.popupSelector : [e.popupSelector ?? n].flat(), a = (M) => M ? typeof e.initialFocus == "string" ? M.querySelector(e.initialFocus) ?? M : typeof e.initialFocus == "function" ? e.initialFocus(M) ?? M : M.querySelector(
2433
+ ], u = Array.isArray(e.popupSelector) ? e.popupSelector : [e.popupSelector ?? n].flat(), a = (I) => I ? typeof e.initialFocus == "string" ? I.querySelector(e.initialFocus) ?? I : typeof e.initialFocus == "function" ? e.initialFocus(I) ?? I : I.querySelector(
2301
2434
  'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
2302
- ) ?? M : null, { activate: d, deactivate: b } = Ye(t, {
2435
+ ) ?? I : null, { activate: c, deactivate: w } = Ze(t, {
2303
2436
  escapeDeactivates: !1,
2304
2437
  clickOutsideDeactivates: !1,
2305
2438
  // Without this, focus-trap's own default (false) preventDefault()s and
@@ -2311,87 +2444,89 @@ function Rt(e) {
2311
2444
  initialFocus: () => a(t.value),
2312
2445
  ...e.focusTrapOptions ?? {}
2313
2446
  });
2314
- let D = null, O = X(null);
2315
- const K = () => {
2447
+ let S = null, L = H(null);
2448
+ const z = () => {
2316
2449
  if (e.resolvePopupEl) return e.resolvePopupEl();
2317
- const M = (k, x) => {
2318
- const $ = Array.from(k.querySelectorAll(x));
2319
- if (!$.length) return null;
2320
- const f = $.filter(
2321
- (u) => u.offsetParent !== null || u.getClientRects().length > 0
2450
+ const I = (M, E) => {
2451
+ const N = Array.from(M.querySelectorAll(E));
2452
+ if (!N.length) return null;
2453
+ const f = N.filter(
2454
+ (i) => i.offsetParent !== null || i.getClientRects().length > 0
2322
2455
  );
2323
- return f[f.length - 1] ?? $[$.length - 1] ?? null;
2324
- }, R = e.triggerEl?.value?.closest?.(".k-animation-container") ?? document.body;
2325
- for (const k of p) {
2326
- const x = M(R, k);
2327
- if (x) return x;
2456
+ return f[f.length - 1] ?? N[N.length - 1] ?? null;
2457
+ }, F = e.triggerEl?.value?.closest?.(".k-animation-container") ?? document.body;
2458
+ for (const M of u) {
2459
+ const E = I(F, M);
2460
+ if (E) return E;
2328
2461
  }
2329
- for (const k of p) {
2330
- const x = M(document, k);
2331
- if (x) return x;
2462
+ for (const M of u) {
2463
+ const E = I(document, M);
2464
+ if (E) return E;
2332
2465
  }
2333
2466
  return null;
2334
2467
  };
2335
- return Ne(t, (M) => {
2336
- O.value = "outside", e.isOpen.value && e.onRequestClose?.("outside", M);
2337
- }), le(
2468
+ return Ke(t, (I) => {
2469
+ L.value = "outside", e.isOpen.value && e.onRequestClose?.("outside", I);
2470
+ }), ae(
2338
2471
  () => e.isOpen.value,
2339
- (M) => {
2340
- M ? (O.value = null, j(() => {
2341
- const R = K();
2342
- R && (R.tabIndex < 0 && (R.tabIndex = -1), t.value = R, setTimeout(() => {
2472
+ (I) => {
2473
+ I ? (L.value = null, G(() => {
2474
+ const F = z();
2475
+ F && (F.tabIndex < 0 && (F.tabIndex = -1), t.value = F, setTimeout(() => {
2343
2476
  try {
2344
- d();
2345
- } catch (k) {
2477
+ c();
2478
+ } catch (M) {
2346
2479
  console.warn(
2347
2480
  "usePopupTrap: focus trap failed to activate",
2348
- k
2481
+ M
2349
2482
  );
2350
2483
  }
2351
- }, 0), D || (D = (k) => {
2352
- k.key === "Escape" && (O.value = "escape", e.isOpen.value && e.onRequestClose?.("escape", k));
2353
- }, document.addEventListener("keydown", D, !0)));
2354
- })) : (b(), D && (document.removeEventListener("keydown", D, !0), D = null), t.value = null, O.value === "outside" && j(() => {
2355
- const R = () => {
2356
- const k = e.triggerEl?.value, x = k?.querySelector("input"), $ = document.activeElement;
2357
- $ && ($ === x || k && k.contains($)) && (x ?? k)?.blur?.();
2484
+ }, 0), S || (S = (M) => {
2485
+ M.key === "Escape" && (L.value = "escape", e.isOpen.value && e.onRequestClose?.("escape", M));
2486
+ }, document.addEventListener("keydown", S, !0)));
2487
+ })) : (w(), S && (document.removeEventListener("keydown", S, !0), S = null), t.value = null, L.value === "outside" && G(() => {
2488
+ const F = () => {
2489
+ const M = e.triggerEl?.value, E = M?.querySelector("input"), N = document.activeElement;
2490
+ N && (N === E || M && M.contains(N)) && (E ?? M)?.blur?.();
2358
2491
  };
2359
- requestAnimationFrame(() => setTimeout(R, 0));
2360
- }), e.returnFocusToTrigger !== !1 && O.value === "escape" && e.triggerEl?.value && j(() => {
2361
- const R = () => {
2362
- const k = e.triggerEl?.value;
2363
- if (!k) return;
2364
- (k.querySelector("input") ?? k)?.focus?.();
2492
+ requestAnimationFrame(() => setTimeout(F, 0));
2493
+ }), e.returnFocusToTrigger !== !1 && L.value === "escape" && e.triggerEl?.value && G(() => {
2494
+ const F = () => {
2495
+ const M = e.triggerEl?.value;
2496
+ if (!M) return;
2497
+ (M.querySelector("input") ?? M)?.focus?.();
2365
2498
  };
2366
- requestAnimationFrame(() => setTimeout(R, 0));
2499
+ requestAnimationFrame(() => setTimeout(F, 0));
2367
2500
  }));
2368
2501
  }
2369
2502
  ), {
2370
2503
  popupRef: t,
2371
- activate: d,
2372
- deactivate: b,
2373
- lastCloseReason: ee(O),
2374
- setPopupEl: (M) => t.value = M
2504
+ activate: c,
2505
+ deactivate: w,
2506
+ lastCloseReason: te(L),
2507
+ setPopupEl: (I) => t.value = I
2375
2508
  };
2376
2509
  }
2377
2510
  export {
2378
- Tt as POPUP_MENU_TRAP_OPTIONS,
2379
- lt as computeFlippedOffset,
2380
- xt as useActiveIdRegistry,
2381
- At as useCompositeId,
2382
- Et as useExclusiveGroup,
2383
- Je as useFieldsetTouchTracker,
2384
- Qe as useFieldsetValidationKit,
2385
- bt as useGridA11y,
2386
- wt as useGridActiveFilter,
2387
- St as useGridRowAction,
2388
- dt as useIntersectionObserver,
2389
- Mt as useMaskedDateInput,
2390
- It as useMaskedDateRangeInput,
2391
- Ct as useMaskedTimeInput,
2392
- Dt as usePopupMenu,
2393
- Rt as usePopupTrap,
2394
- kt as useUSAddress,
2395
- Ge as useZipTextBox
2511
+ Vt as POPUP_MENU_TRAP_OPTIONS,
2512
+ Ve as WINDOW_SETTINGS_DEFAULTS,
2513
+ ct as computeCollisionOffset,
2514
+ Ft as useActiveIdRegistry,
2515
+ Ct as useCompositeId,
2516
+ Rt as useExclusiveGroup,
2517
+ nt as useFieldsetTouchTracker,
2518
+ rt as useFieldsetValidationKit,
2519
+ Et as useGridA11y,
2520
+ xt as useGridActiveFilter,
2521
+ Mt as useGridRowAction,
2522
+ mt as useIntersectionObserver,
2523
+ Lt as useMaskedDateInput,
2524
+ $t as useMaskedDateRangeInput,
2525
+ Ot as useMaskedTimeInput,
2526
+ Tt as usePopupMenu,
2527
+ Nt as usePopupTrap,
2528
+ It as useUSAddress,
2529
+ Pt as useWindow,
2530
+ tt as useZipTextBox
2396
2531
  };
2397
2532
  //# sourceMappingURL=featherk-composables.es.js.map