@featherk/composables 0.11.2 → 0.12.0

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