@featherk/composables 0.10.0 → 0.10.1

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