@scrippsproduct/networks-ui-library 2.0.8 → 2.0.9

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.
Files changed (98) hide show
  1. package/dist/components/ActionButton/ActionButton.test.js +3 -3
  2. package/dist/components/AdBlock/AdBlock.test.js +2 -2
  3. package/dist/components/AdjustableTwoColumnGrid/AdjustableTwoColumnGrid.test.js +2 -2
  4. package/dist/components/AirDateFormatter/AirDateFormatter.test.js +2 -2
  5. package/dist/components/AnchorTag/AnchorTag.test.js +3 -3
  6. package/dist/components/BCVideoPlayer/BCVideoPlayer.test.js +2 -2
  7. package/dist/components/BasicGridModule/BasicGridModule.test.js +2 -2
  8. package/dist/components/Button/Button.test.js +3 -3
  9. package/dist/components/ButtonAnchor/ButtonAnchor.test.js +3 -3
  10. package/dist/components/Carousel/Carousel.suspense-regression.test.js +2 -2
  11. package/dist/components/Carousel/Carousel.test.js +2 -2
  12. package/dist/components/Carousel/navigations/Pagination.test.js +2 -2
  13. package/dist/components/CarouselSlide/CarouselSlide.test.js +2 -2
  14. package/dist/components/CarouselSlide/slide-layouts/TwoColumn/TwoColumnSlide.js +1 -1
  15. package/dist/components/CastInfoLayout/CastInfoLayout.test.js +2 -2
  16. package/dist/components/ChannelSearch/ChannelSearch.test.js +2 -2
  17. package/dist/components/ChoicesItem/ChoicesItem.test.js +2 -2
  18. package/dist/components/Concat/Concat.js +1 -1
  19. package/dist/components/Concat/Concat.test.js +2 -2
  20. package/dist/components/CtaBlock/CtaBlock.js +1 -1
  21. package/dist/components/CtaBlock/CtaBlock.test.js +3 -3
  22. package/dist/components/CustomSelect/CustomSelect.test.js +3 -3
  23. package/dist/components/DateNavigation/DateNavigation.test.js +3 -3
  24. package/dist/components/DatePicker/DatePicker.js +2309 -2324
  25. package/dist/components/DeviceAndPlatformLists/DeviceAndPlatformLists.test.js +2 -2
  26. package/dist/components/DrawerNavigation/DrawerNavigation.test.js +3 -3
  27. package/dist/components/EqualSizeFlexRow/EqualSizeFlexRow.test.js +2 -2
  28. package/dist/components/EqualSizeGrid/EqualSizeGrid.test.js +2 -2
  29. package/dist/components/ErrorHandler/ErrorHandler.js +1 -1
  30. package/dist/components/ErrorHandler/ErrorHandler.test.js +2 -2
  31. package/dist/components/FeaturedList/FeaturedList.test.js +3 -3
  32. package/dist/components/Figure/Figure.js +1 -1
  33. package/dist/components/Figure/Figure.test.js +2 -2
  34. package/dist/components/FindUs/FindUs.test.js +2 -2
  35. package/dist/components/FooterNavigation/FooterNavigation.test.js +2 -2
  36. package/dist/components/GenericList/GenericList.js +1 -1
  37. package/dist/components/GenericList/GenericList.test.js +2 -2
  38. package/dist/components/GetAirdateWrapper/GetAirdateWrapper.test.js +2 -2
  39. package/dist/components/GradientButton/GradientButton.test.js +2 -2
  40. package/dist/components/GridList/GridList.test.js +1 -1
  41. package/dist/components/ImageCard/ImageCard.test.js +2 -2
  42. package/dist/components/ImageCard/ImageCardCore.js +1 -1
  43. package/dist/components/ImageCard/ImageCardCore.test.js +2 -2
  44. package/dist/components/ImageReplacementAnchor/ImageReplacementAnchor.test.js +1 -1
  45. package/dist/components/InlineNavigation/InlineNavigation.test.js +1 -1
  46. package/dist/components/Input/Input.test.js +2 -2
  47. package/dist/components/InstructionsList/InstructionsList.js +1 -1
  48. package/dist/components/InstructionsList/InstructionsList.test.js +1 -1
  49. package/dist/components/LogoListItem/LogoListItem.test.js +1 -1
  50. package/dist/components/LogoNavigation/LogoNavigation.test.js +1 -1
  51. package/dist/components/ModalContainer/ModalContainer.js +1 -1
  52. package/dist/components/NavList/NavList.test.js +2 -2
  53. package/dist/components/Overlay/Overlay.js +1 -1
  54. package/dist/components/Overlay/Overlay.test.js +1 -1
  55. package/dist/components/PageHero/PageHero.test.js +1 -1
  56. package/dist/components/PageHero/page-hero-layouts/IONShow/IONShowHero.js +1 -1
  57. package/dist/components/ProgramAirdate/ProgramAirdate.js +1 -1
  58. package/dist/components/ProgramAirdate/ProgramAirdate.test.js +1 -1
  59. package/dist/components/PromotionsRowBlock/PromotionsRowBlock.test.js +2 -2
  60. package/dist/components/PromotionsRowModule/PromotionsRowModule.js +1 -1
  61. package/dist/components/PromotionsRowModule/PromotionsRowModule.test.js +2 -2
  62. package/dist/components/RescanInstructions/RescanInstructions.test.js +1 -1
  63. package/dist/components/ResponsiveImage/ResponsiveImage.test.js +2 -2
  64. package/dist/components/ResultsTable/ResultsTable.test.js +1 -1
  65. package/dist/components/ResultsTableBody/ResultsTableBody.test.js +1 -1
  66. package/dist/components/ResultsTableHeader/ResultsTableHeader.test.js +1 -1
  67. package/dist/components/ScheduleLayout/ScheduleContext.js +1893 -1123
  68. package/dist/components/SectionedContent/SectionedContent.js +1 -1
  69. package/dist/components/SectionedContent/SectionedContent.test.js +2 -2
  70. package/dist/components/Select/Select.test.js +2 -2
  71. package/dist/components/ShowAboutContent/ShowAboutContent.js +1 -1
  72. package/dist/components/ShowAboutContent/ShowAboutContent.test.js +2 -2
  73. package/dist/components/ShowAboutLayout/ShowAboutLayout.test.js +2 -2
  74. package/dist/components/StringList/StringList.js +1 -1
  75. package/dist/components/StringList/StringList.test.js +1 -1
  76. package/dist/components/TabContent/TabContent.js +1 -1
  77. package/dist/components/TabContent/TabContent.test.js +1 -1
  78. package/dist/components/TabNavigation/TabNavigation.test.js +1 -1
  79. package/dist/components/TabbedContent/TabbedContent.test.js +1 -1
  80. package/dist/components/UpcomingList/UpcomingList.test.js +2 -2
  81. package/dist/index-BCErBUQT.mjs +3 -0
  82. package/dist/{index-sxnwPHiC.mjs → index-CHzqLQze.mjs} +181 -166
  83. package/dist/index-DnEp_Vsr.mjs +3085 -0
  84. package/dist/{index-5kXULIVv.mjs → index-DrfkaNHX.mjs} +16 -16
  85. package/dist/{magic-string.es-uPKorP4O.mjs → magic-string.es-DDAFx1CP.mjs} +93 -93
  86. package/dist/matchers-35e4d3bd-CfhTZpyY.mjs +2572 -0
  87. package/dist/react.esm-CX7MGXBg.mjs +52738 -0
  88. package/dist/src/icons/Facebook.d.ts +2 -1
  89. package/dist/src/icons/Tiktok.d.ts +2 -1
  90. package/dist/src/icons/Twitter.d.ts +2 -1
  91. package/dist/src/utils/analytics.d.ts +24 -5
  92. package/dist/test/setupTests.js +2 -2
  93. package/dist/utils/analytics.js +247 -446
  94. package/package.json +3 -3
  95. package/dist/index-B03xsUba.mjs +0 -3
  96. package/dist/index-C-uizG4-.mjs +0 -3098
  97. package/dist/matchers-35e4d3bd-BckKR3wh.mjs +0 -2404
  98. package/dist/react.esm-CUNRDkfQ.mjs +0 -49632
@@ -0,0 +1,3085 @@
1
+ import { j as V } from "./react.esm-CX7MGXBg.mjs";
2
+ function d(e, t, n) {
3
+ return e.namespaceURI && e.namespaceURI !== "http://www.w3.org/1999/xhtml" || (t = Array.isArray(t) ? t : [
4
+ t
5
+ ], !t.includes(e.tagName.toLowerCase())) ? !1 : n ? Object.entries(n).every(([o, i]) => e[o] === i) : !0;
6
+ }
7
+ function E(e) {
8
+ var t;
9
+ if (Jt(e) && e.defaultView)
10
+ return e.defaultView;
11
+ if (!((t = e.ownerDocument) === null || t === void 0) && t.defaultView)
12
+ return e.ownerDocument.defaultView;
13
+ throw new Error(`Could not determine window of node. Node was ${Zt(e)}`);
14
+ }
15
+ function Jt(e) {
16
+ return e.nodeType === 9;
17
+ }
18
+ function Zt(e) {
19
+ return typeof e == "function" ? `function ${e.name}` : e === null ? "null" : String(e);
20
+ }
21
+ function at(e, t) {
22
+ return new Promise((n, o) => {
23
+ const i = new t();
24
+ i.onerror = o, i.onabort = o, i.onload = () => {
25
+ n(String(i.result));
26
+ }, i.readAsText(e);
27
+ });
28
+ }
29
+ function Me(e, t) {
30
+ const n = {
31
+ ...t,
32
+ length: t.length,
33
+ item: (o) => n[o],
34
+ [Symbol.iterator]: function* () {
35
+ for (let i = 0; i < n.length; i++)
36
+ yield n[i];
37
+ }
38
+ };
39
+ return n.constructor = e.FileList, e.FileList && Object.setPrototypeOf(n, e.FileList.prototype), Object.freeze(n), n;
40
+ }
41
+ function O(e, t, n) {
42
+ return t in e ? Object.defineProperty(e, t, {
43
+ value: n,
44
+ enumerable: !0,
45
+ configurable: !0,
46
+ writable: !0
47
+ }) : e[t] = n, e;
48
+ }
49
+ class Ue {
50
+ getAsFile() {
51
+ return this.file;
52
+ }
53
+ getAsString(t) {
54
+ typeof this.data == "string" && t(this.data);
55
+ }
56
+ /* istanbul ignore next */
57
+ webkitGetAsEntry() {
58
+ throw new Error("not implemented");
59
+ }
60
+ constructor(t, n) {
61
+ O(this, "kind", void 0), O(this, "type", void 0), O(this, "file", null), O(this, "data", void 0), typeof t == "string" ? (this.kind = "string", this.type = String(n), this.data = t) : (this.kind = "file", this.type = t.type, this.file = t);
62
+ }
63
+ }
64
+ function dt(e) {
65
+ return e.replace(/[A-Z]/g, (t) => t.toLowerCase());
66
+ }
67
+ class Qt extends Array {
68
+ add(...t) {
69
+ const n = typeof t[0] == "string" ? new Ue(t[0], dt(t[1])) : new Ue(t[0]);
70
+ return this.push(n), n;
71
+ }
72
+ clear() {
73
+ this.splice(0, this.length);
74
+ }
75
+ remove(t) {
76
+ this.splice(t, 1);
77
+ }
78
+ }
79
+ function _e(e) {
80
+ const t = dt(e);
81
+ return t === "text" ? "text/plain" : t === "url" ? "text/uri-list" : t;
82
+ }
83
+ function pe(e, t) {
84
+ const [n, o] = e.split("/"), i = !o || o === "*";
85
+ return (r) => t ? r.type === (i ? n : e) : i ? r.type.startsWith(`${n}/`) : r.type === n;
86
+ }
87
+ function en(e) {
88
+ return new class {
89
+ getData(n) {
90
+ var o;
91
+ const i = _e(n), r = (o = this.items.find(pe(i, !0))) !== null && o !== void 0 ? o : this.items.find(pe(i, !1));
92
+ let s = "";
93
+ return r == null || r.getAsString((u) => {
94
+ s = u;
95
+ }), s;
96
+ }
97
+ setData(n, o) {
98
+ const i = _e(n), r = this.items.findIndex(pe(i, !0)), s = new Ue(o, i);
99
+ r >= 0 ? this.items.splice(r, 1, s) : this.items.push(s);
100
+ }
101
+ clearData(n) {
102
+ if (n) {
103
+ const o = _e(n), i = this.items.findIndex(pe(o, !0));
104
+ i >= 0 && this.items.remove(i);
105
+ } else
106
+ this.items.clear();
107
+ }
108
+ get types() {
109
+ const n = [];
110
+ return this.files.length && n.push("Files"), this.items.forEach((o) => n.push(o.type)), Object.freeze(n), n;
111
+ }
112
+ /* istanbul ignore next */
113
+ setDragImage() {
114
+ }
115
+ constructor() {
116
+ O(this, "dropEffect", "none"), O(this, "effectAllowed", "uninitialized"), O(this, "items", new Qt()), O(this, "files", Me(e, []));
117
+ }
118
+ }();
119
+ }
120
+ function Le(e, t = []) {
121
+ const n = typeof e.DataTransfer > "u" ? en(e) : (
122
+ /* istanbul ignore next */
123
+ new e.DataTransfer()
124
+ );
125
+ return Object.defineProperty(n, "files", {
126
+ get: () => Me(e, t)
127
+ }), n;
128
+ }
129
+ async function tn(e, t) {
130
+ return t.kind === "file" ? t.getAsFile() : new e.Blob([
131
+ await new Promise((n) => t.getAsString(n))
132
+ ], {
133
+ type: t.type
134
+ });
135
+ }
136
+ function ft(e, t, n) {
137
+ return t in e ? Object.defineProperty(e, t, {
138
+ value: n,
139
+ enumerable: !0,
140
+ configurable: !0,
141
+ writable: !0
142
+ }) : e[t] = n, e;
143
+ }
144
+ function pt(e, ...t) {
145
+ const n = Object.fromEntries(t.map((o) => [
146
+ typeof o == "string" ? "text/plain" : o.type,
147
+ Promise.resolve(o)
148
+ ]));
149
+ return typeof e.ClipboardItem < "u" ? new e.ClipboardItem(n) : new class {
150
+ get types() {
151
+ return Array.from(Object.keys(this.data));
152
+ }
153
+ async getType(i) {
154
+ const r = await this.data[i];
155
+ if (!r)
156
+ throw new Error(`${i} is not one of the available MIME types on this item.`);
157
+ return r instanceof e.Blob ? r : new e.Blob([
158
+ r
159
+ ], {
160
+ type: i
161
+ });
162
+ }
163
+ constructor(i) {
164
+ ft(this, "data", void 0), this.data = i;
165
+ }
166
+ }(n);
167
+ }
168
+ const j = Symbol("Manage ClipboardSub");
169
+ function Re(e, t) {
170
+ return Object.assign(new class extends e.EventTarget {
171
+ async read() {
172
+ return Array.from(this.items);
173
+ }
174
+ async readText() {
175
+ let o = "";
176
+ for (const i of this.items) {
177
+ const r = i.types.includes("text/plain") ? "text/plain" : i.types.find((s) => s.startsWith("text/"));
178
+ r && (o += await i.getType(r).then((s) => at(s, e.FileReader)));
179
+ }
180
+ return o;
181
+ }
182
+ async write(o) {
183
+ this.items = o;
184
+ }
185
+ async writeText(o) {
186
+ this.items = [
187
+ pt(e, o)
188
+ ];
189
+ }
190
+ constructor(...o) {
191
+ super(...o), ft(this, "items", []);
192
+ }
193
+ }(), {
194
+ [j]: t
195
+ });
196
+ }
197
+ function $e(e) {
198
+ return !!(e != null && e[j]);
199
+ }
200
+ function nn(e) {
201
+ if ($e(e.navigator.clipboard))
202
+ return e.navigator.clipboard[j];
203
+ const t = Object.getOwnPropertyDescriptor(e.navigator, "clipboard");
204
+ let n;
205
+ const o = {
206
+ resetClipboardStub: () => {
207
+ n = Re(e, o);
208
+ },
209
+ detachClipboardStub: () => {
210
+ t ? Object.defineProperty(e.navigator, "clipboard", t) : Object.defineProperty(e.navigator, "clipboard", {
211
+ value: void 0,
212
+ configurable: !0
213
+ });
214
+ }
215
+ };
216
+ return n = Re(e, o), Object.defineProperty(e.navigator, "clipboard", {
217
+ get: () => n,
218
+ configurable: !0
219
+ }), n[j];
220
+ }
221
+ function on(e) {
222
+ $e(e.navigator.clipboard) && e.navigator.clipboard[j].resetClipboardStub();
223
+ }
224
+ function rn(e) {
225
+ $e(e.navigator.clipboard) && e.navigator.clipboard[j].detachClipboardStub();
226
+ }
227
+ async function sn(e) {
228
+ const t = e.defaultView, n = t == null ? void 0 : t.navigator.clipboard, o = n && await n.read();
229
+ if (!o)
230
+ throw new Error("The Clipboard API is unavailable.");
231
+ const i = Le(t);
232
+ for (const r of o)
233
+ for (const s of r.types)
234
+ i.setData(s, await r.getType(s).then((u) => at(u, t.FileReader)));
235
+ return i;
236
+ }
237
+ async function ht(e, t) {
238
+ const n = E(e), o = n.navigator.clipboard, i = [];
239
+ for (let s = 0; s < t.items.length; s++) {
240
+ const u = t.items[s], c = await tn(n, u);
241
+ i.push(pt(n, c));
242
+ }
243
+ if (!(o && await o.write(i).then(
244
+ () => !0,
245
+ // Can happen with other implementations that e.g. require permissions
246
+ /* istanbul ignore next */
247
+ () => !1
248
+ )))
249
+ throw new Error("The Clipboard API is unavailable.");
250
+ }
251
+ const ke = globalThis;
252
+ typeof ke.afterEach == "function" && ke.afterEach(() => {
253
+ typeof globalThis.window < "u" && on(globalThis.window);
254
+ });
255
+ typeof ke.afterAll == "function" && ke.afterAll(() => {
256
+ typeof globalThis.window < "u" && rn(globalThis.window);
257
+ });
258
+ const vt = [
259
+ "input:not([type=hidden]):not([disabled])",
260
+ "button:not([disabled])",
261
+ "select:not([disabled])",
262
+ "textarea:not([disabled])",
263
+ '[contenteditable=""]',
264
+ '[contenteditable="true"]',
265
+ "a[href]",
266
+ "[tabindex]:not([disabled])",
267
+ "details > summary"
268
+ ].join(", ");
269
+ function Fe(e) {
270
+ return e.matches(vt);
271
+ }
272
+ function un(e) {
273
+ return new e.constructor(e.type, e);
274
+ }
275
+ function P(e) {
276
+ for (let n = e; n; n = n.parentElement)
277
+ if (d(n, [
278
+ "button",
279
+ "input",
280
+ "select",
281
+ "textarea",
282
+ "optgroup",
283
+ "option"
284
+ ])) {
285
+ if (n.hasAttribute("disabled"))
286
+ return !0;
287
+ } else if (d(n, "fieldset")) {
288
+ var t;
289
+ if (n.hasAttribute("disabled") && !(!((t = n.querySelector(":scope > legend")) === null || t === void 0) && t.contains(e)))
290
+ return !0;
291
+ } else if (n.tagName.includes("-") && n.constructor.formAssociated && n.hasAttribute("disabled"))
292
+ return !0;
293
+ return !1;
294
+ }
295
+ function H(e) {
296
+ const t = e.activeElement;
297
+ if (t != null && t.shadowRoot) {
298
+ const n = H(t.shadowRoot);
299
+ if (n)
300
+ return n;
301
+ } else if (t && d(t, "iframe")) {
302
+ const n = t.contentDocument;
303
+ if (n)
304
+ return H(n);
305
+ }
306
+ return P(t) ? e.ownerDocument ? (
307
+ /* istanbul ignore next */
308
+ e.ownerDocument.body
309
+ ) : e.body : t;
310
+ }
311
+ function ye(e) {
312
+ var t;
313
+ return (t = H(e)) !== null && t !== void 0 ? t : (
314
+ /* istanbul ignore next */
315
+ e.body
316
+ );
317
+ }
318
+ function cn(e, t) {
319
+ let n = e;
320
+ do {
321
+ if (t(n))
322
+ return n;
323
+ n = n.parentElement;
324
+ } while (n && n !== e.ownerDocument.body);
325
+ }
326
+ function F(e) {
327
+ return e.hasAttribute("contenteditable") && (e.getAttribute("contenteditable") == "true" || e.getAttribute("contenteditable") == "");
328
+ }
329
+ function ae(e) {
330
+ const t = ln(e);
331
+ return t && (t.closest('[contenteditable=""]') || t.closest('[contenteditable="true"]'));
332
+ }
333
+ function ln(e) {
334
+ return e.nodeType === 1 ? e : e.parentElement;
335
+ }
336
+ var bt = /* @__PURE__ */ (function(e) {
337
+ return e.button = "button", e.color = "color", e.file = "file", e.image = "image", e.reset = "reset", e.submit = "submit", e.checkbox = "checkbox", e.radio = "radio", e;
338
+ })(bt || {});
339
+ function gt(e) {
340
+ return d(e, "button") || d(e, "input") && e.type in bt;
341
+ }
342
+ function G(e) {
343
+ return mt(e) && !e.readOnly || F(e);
344
+ }
345
+ var yt = /* @__PURE__ */ (function(e) {
346
+ return e.text = "text", e.date = "date", e["datetime-local"] = "datetime-local", e.email = "email", e.month = "month", e.number = "number", e.password = "password", e.search = "search", e.tel = "tel", e.time = "time", e.url = "url", e.week = "week", e;
347
+ })(yt || {});
348
+ function mt(e) {
349
+ return d(e, "textarea") || d(e, "input") && e.type in yt;
350
+ }
351
+ function C(e) {
352
+ return Et(e) && mt(e);
353
+ }
354
+ function an(e) {
355
+ return Et(e) && gt(e);
356
+ }
357
+ function Et(e) {
358
+ return e.nodeType === 1;
359
+ }
360
+ function dn(e) {
361
+ const t = e.ownerDocument.getSelection();
362
+ if (t != null && t.focusNode && C(e)) {
363
+ const o = ae(t.focusNode);
364
+ if (o) {
365
+ if (!t.isCollapsed) {
366
+ var n;
367
+ const i = ((n = o.firstChild) === null || n === void 0 ? void 0 : n.nodeType) === 3 ? o.firstChild : o;
368
+ t.setBaseAndExtent(i, 0, i, 0);
369
+ }
370
+ } else
371
+ t.setBaseAndExtent(e, 0, e, 0);
372
+ }
373
+ }
374
+ function X(e, t) {
375
+ return V().eventWrapper(e);
376
+ }
377
+ function U(e) {
378
+ const t = cn(e, Fe), n = H(e.ownerDocument);
379
+ (t ?? e.ownerDocument.body) !== n && (X(t ? () => t.focus() : () => n == null ? void 0 : n.blur()), dn(t ?? e.ownerDocument.body));
380
+ }
381
+ function fn(e) {
382
+ !Fe(e) || !(H(e.ownerDocument) === e) || X(() => e.blur());
383
+ }
384
+ const D = {};
385
+ D.click = (e, t, n) => {
386
+ const o = t.closest("button,input,label,select,textarea"), i = o && d(o, "label") && o.control;
387
+ if (i && i !== t)
388
+ return () => {
389
+ Fe(i) && (U(i), n.dispatchEvent(i, un(e)));
390
+ };
391
+ if (d(t, "input", {
392
+ type: "file"
393
+ }))
394
+ return () => {
395
+ fn(t), t.dispatchEvent(new (E(t)).Event("fileDialog")), U(t);
396
+ };
397
+ };
398
+ const z = Symbol("Displayed value in UI"), _ = Symbol("Displayed selection in UI"), Te = Symbol("Initial value to compare on blur");
399
+ function pn(e) {
400
+ return typeof e == "object" && z in e;
401
+ }
402
+ function hn(e) {
403
+ return !!e && typeof e == "object" && _ in e;
404
+ }
405
+ function vn(e, t) {
406
+ e[Te] === void 0 && (e[Te] = e.value), e[z] = t, e.value = Object.assign(new String(t), {
407
+ [z]: !0
408
+ });
409
+ }
410
+ function I(e) {
411
+ return e[z] === void 0 ? e.value : String(e[z]);
412
+ }
413
+ function Be(e) {
414
+ e[z] = void 0;
415
+ }
416
+ function wt(e) {
417
+ e[Te] = void 0;
418
+ }
419
+ function bn(e) {
420
+ return e[Te];
421
+ }
422
+ function gn(e, t) {
423
+ e[_] = t;
424
+ }
425
+ function q(e, { focusOffset: t, anchorOffset: n = t }, o = "replace") {
426
+ const i = I(e).length, r = (f) => Math.max(0, Math.min(i, f)), s = o === "replace" || e[_] === void 0 ? r(n) : e[_].anchorOffset, u = r(t), c = Math.min(s, u), l = Math.max(s, u);
427
+ if (e[_] = {
428
+ anchorOffset: s,
429
+ focusOffset: u
430
+ }, e.selectionStart === c && e.selectionEnd === l)
431
+ return;
432
+ const a = Object.assign(new Number(c), {
433
+ [_]: !0
434
+ });
435
+ try {
436
+ e.setSelectionRange(a, l);
437
+ } catch {
438
+ }
439
+ }
440
+ function de(e) {
441
+ var t, n, o;
442
+ const i = (t = e[_]) !== null && t !== void 0 ? t : {
443
+ anchorOffset: (n = e.selectionStart) !== null && n !== void 0 ? n : 0,
444
+ focusOffset: (o = e.selectionEnd) !== null && o !== void 0 ? o : 0
445
+ };
446
+ return {
447
+ ...i,
448
+ startOffset: Math.min(i.anchorOffset, i.focusOffset),
449
+ endOffset: Math.max(i.anchorOffset, i.focusOffset)
450
+ };
451
+ }
452
+ function yn(e) {
453
+ return !!e[_];
454
+ }
455
+ function me(e) {
456
+ e[_] = void 0;
457
+ }
458
+ const Ce = globalThis.parseInt;
459
+ function mn(e) {
460
+ const t = e.replace(/\D/g, "");
461
+ if (t.length < 2)
462
+ return e;
463
+ const n = Ce(t[0], 10), o = Ce(t[1], 10);
464
+ if (n >= 3 || n === 2 && o >= 4) {
465
+ let i;
466
+ return n >= 3 ? i = 1 : i = 2, je(t, i);
467
+ }
468
+ return e.length === 2 ? e : je(t, 2);
469
+ }
470
+ function je(e, t) {
471
+ const n = e.slice(0, t), o = Math.min(Ce(n, 10), 23), i = e.slice(t), r = Ce(i, 10), s = Math.min(r, 59);
472
+ return `${o.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}`;
473
+ }
474
+ function kt(e, t) {
475
+ const n = e.cloneNode();
476
+ return n.value = t, n.value === t;
477
+ }
478
+ var Tt = /* @__PURE__ */ (function(e) {
479
+ return e.email = "email", e.password = "password", e.search = "search", e.telephone = "telephone", e.text = "text", e.url = "url", e;
480
+ })(Tt || {});
481
+ function En(e) {
482
+ var t;
483
+ const n = (t = e.getAttribute("maxlength")) !== null && t !== void 0 ? t : "";
484
+ return /^\d+$/.test(n) && Number(n) >= 0 ? Number(n) : void 0;
485
+ }
486
+ function wn(e) {
487
+ return d(e, "textarea") || d(e, "input") && e.type in Tt;
488
+ }
489
+ function Ct(e, t, n, o) {
490
+ if (Ee(e) && t + n >= 0 && t + n <= e.nodeValue.length)
491
+ return {
492
+ node: e,
493
+ offset: t + n
494
+ };
495
+ const i = He(e, t, n);
496
+ if (i) {
497
+ if (Ee(i))
498
+ return {
499
+ node: i,
500
+ offset: n > 0 ? Math.min(1, i.nodeValue.length) : Math.max(i.nodeValue.length - 1, 0)
501
+ };
502
+ if (d(i, "br")) {
503
+ const r = He(i, void 0, n);
504
+ return r ? Ee(r) ? {
505
+ node: r,
506
+ offset: n > 0 ? 0 : r.nodeValue.length
507
+ } : n < 0 && d(r, "br") ? {
508
+ node: i.parentNode,
509
+ offset: he(i)
510
+ } : {
511
+ node: r.parentNode,
512
+ offset: he(r) + (n > 0 ? 0 : 1)
513
+ } : n < 0 && o === "deleteContentBackward" ? {
514
+ node: i.parentNode,
515
+ offset: he(i)
516
+ } : void 0;
517
+ } else
518
+ return {
519
+ node: i.parentNode,
520
+ offset: he(i) + (n > 0 ? 1 : 0)
521
+ };
522
+ }
523
+ }
524
+ function He(e, t, n) {
525
+ const o = Number(t) + (n < 0 ? -1 : 0);
526
+ return t !== void 0 && Ve(e) && o >= 0 && o < e.children.length && (e = e.children[o]), Tn(e, n === 1 ? "next" : "previous", kn);
527
+ }
528
+ function kn(e) {
529
+ if (Ee(e))
530
+ return !0;
531
+ if (Ve(e)) {
532
+ if (d(e, [
533
+ "input",
534
+ "textarea"
535
+ ]))
536
+ return e.type !== "hidden";
537
+ if (d(e, "br"))
538
+ return !0;
539
+ }
540
+ return !1;
541
+ }
542
+ function he(e) {
543
+ let t = 0;
544
+ for (; e.previousSibling; )
545
+ t++, e = e.previousSibling;
546
+ return t;
547
+ }
548
+ function Ve(e) {
549
+ return e.nodeType === 1;
550
+ }
551
+ function Ee(e) {
552
+ return e.nodeType === 3;
553
+ }
554
+ function Tn(e, t, n) {
555
+ for (; ; ) {
556
+ var o;
557
+ const i = e[`${t}Sibling`];
558
+ if (i) {
559
+ if (e = Cn(i, t === "next" ? "first" : "last"), n(e))
560
+ return e;
561
+ } else if (e.parentNode && (!Ve(e.parentNode) || !F(e.parentNode) && e.parentNode !== ((o = e.ownerDocument) === null || o === void 0 ? void 0 : o.body)))
562
+ e = e.parentNode;
563
+ else
564
+ break;
565
+ }
566
+ }
567
+ function Cn(e, t) {
568
+ for (; e.hasChildNodes(); )
569
+ e = e[`${t}Child`];
570
+ return e;
571
+ }
572
+ const fe = Symbol("Track programmatic changes for React workaround");
573
+ function In(e) {
574
+ return Object.getOwnPropertyNames(e).some((t) => t.startsWith("__react")) && E(e).REACT_VERSION === 17;
575
+ }
576
+ function Sn(e) {
577
+ In(e) && (e[fe] = {
578
+ previousValue: String(e.value),
579
+ tracked: []
580
+ });
581
+ }
582
+ function _n(e, t) {
583
+ var n, o;
584
+ (o = e[fe]) === null || o === void 0 || (n = o.tracked) === null || n === void 0 || n.push(t), e[fe] || (Be(e), q(e, {
585
+ focusOffset: t.length
586
+ }));
587
+ }
588
+ function Pn(e, t) {
589
+ var n;
590
+ const o = e[fe];
591
+ if (e[fe] = void 0, !(!(o == null || (n = o.tracked) === null || n === void 0) && n.length))
592
+ return;
593
+ const i = o.tracked.length === 2 && o.tracked[0] === o.previousValue && o.tracked[1] === e.value;
594
+ i || Be(e), yn(e) && q(e, {
595
+ focusOffset: i ? t : e.value.length
596
+ });
597
+ }
598
+ function It(e) {
599
+ const t = An(e);
600
+ if (t && C(t))
601
+ return {
602
+ type: "input",
603
+ selection: de(t)
604
+ };
605
+ const n = t == null ? void 0 : t.ownerDocument.getSelection();
606
+ return {
607
+ type: ae(e) && (n == null ? void 0 : n.anchorNode) && ae(n.anchorNode) ? "contenteditable" : "default",
608
+ selection: n
609
+ };
610
+ }
611
+ function An(e) {
612
+ return e.nodeType === 1 ? e : e.parentElement;
613
+ }
614
+ function On(e) {
615
+ const t = It(e);
616
+ if (t.type === "input")
617
+ return t.selection;
618
+ if (t.type === "contenteditable") {
619
+ var n;
620
+ return (n = t.selection) === null || n === void 0 ? void 0 : n.getRangeAt(0);
621
+ }
622
+ }
623
+ function B({ focusNode: e, focusOffset: t, anchorNode: n = e, anchorOffset: o = t }) {
624
+ var i, r;
625
+ if (It(e).type === "input")
626
+ return q(e, {
627
+ anchorOffset: o,
628
+ focusOffset: t
629
+ });
630
+ (r = n.ownerDocument) === null || r === void 0 || (i = r.getSelection()) === null || i === void 0 || i.setBaseAndExtent(n, o, e, t);
631
+ }
632
+ function St(e) {
633
+ return d(e, "input") && [
634
+ "date",
635
+ "time"
636
+ ].includes(e.type);
637
+ }
638
+ function W(e, t, n, o = "insertText") {
639
+ const i = On(t);
640
+ i && (!St(t) && !e.dispatchUIEvent(t, "beforeinput", {
641
+ inputType: o,
642
+ data: n
643
+ }) || ("startContainer" in i ? Un(e, t, i, n, o) : Dn(e, t, i, n, o)));
644
+ }
645
+ function Un(e, t, n, o, i) {
646
+ let r = !1;
647
+ if (!n.collapsed)
648
+ r = !0, n.deleteContents();
649
+ else if ([
650
+ "deleteContentBackward",
651
+ "deleteContentForward"
652
+ ].includes(i)) {
653
+ const s = Ct(n.startContainer, n.startOffset, i === "deleteContentBackward" ? -1 : 1, i);
654
+ if (s) {
655
+ r = !0;
656
+ const u = n.cloneRange();
657
+ u.comparePoint(s.node, s.offset) < 0 ? u.setStart(s.node, s.offset) : u.setEnd(s.node, s.offset), u.deleteContents();
658
+ }
659
+ }
660
+ if (o)
661
+ if (n.endContainer.nodeType === 3) {
662
+ const s = n.endOffset;
663
+ n.endContainer.insertData(s, o), n.setStart(n.endContainer, s + o.length), n.setEnd(n.endContainer, s + o.length);
664
+ } else {
665
+ const s = t.ownerDocument.createTextNode(o);
666
+ n.insertNode(s), n.setStart(s, o.length), n.setEnd(s, o.length);
667
+ }
668
+ (r || o) && e.dispatchUIEvent(t, "input", {
669
+ inputType: i
670
+ });
671
+ }
672
+ function Dn(e, t, n, o, i) {
673
+ let r = o;
674
+ if (wn(t)) {
675
+ const l = En(t);
676
+ if (l !== void 0 && o.length > 0) {
677
+ const a = n.endOffset - n.startOffset, f = l - t.value.length + a;
678
+ if (f > 0)
679
+ r = o.substring(0, f);
680
+ else
681
+ return;
682
+ }
683
+ }
684
+ const { newValue: s, newOffset: u, oldValue: c } = xn(r, t, n, i);
685
+ s === c && u === n.startOffset && u === n.endOffset || d(t, "input", {
686
+ type: "number"
687
+ }) && !Nn(s) || (vn(t, s), B({
688
+ focusNode: t,
689
+ anchorOffset: u,
690
+ focusOffset: u
691
+ }), St(t) ? kt(t, s) && (Ge(e, t, u, {}), e.dispatchUIEvent(t, "change"), wt(t)) : Ge(e, t, u, {
692
+ data: o,
693
+ inputType: i
694
+ }));
695
+ }
696
+ function xn(e, t, { startOffset: n, endOffset: o }, i) {
697
+ const r = I(t), s = Math.max(0, n === o && i === "deleteContentBackward" ? n - 1 : n), u = r.substring(0, s), c = Math.min(r.length, n === o && i === "deleteContentForward" ? n + 1 : o), l = r.substring(c, r.length);
698
+ let a = `${u}${e}${l}`, f = s + e.length;
699
+ if (d(t, "input", {
700
+ type: "time"
701
+ })) {
702
+ const p = mn(a);
703
+ p !== "" && kt(t, p) && (a = p, f = p.length);
704
+ }
705
+ return {
706
+ oldValue: r,
707
+ newValue: a,
708
+ newOffset: f
709
+ };
710
+ }
711
+ function Ge(e, t, n, o) {
712
+ e.dispatchUIEvent(t, "input", o), Pn(t, n);
713
+ }
714
+ function Nn(e) {
715
+ var t, n;
716
+ const o = e.split("e", 2);
717
+ return !(/[^\d.\-e]/.test(e) || Number((t = e.match(/-/g)) === null || t === void 0 ? void 0 : t.length) > 2 || Number((n = e.match(/\./g)) === null || n === void 0 ? void 0 : n.length) > 1 || o[1] && !/^-?\d*$/.test(o[1]));
718
+ }
719
+ D.cut = (e, t, n) => () => {
720
+ G(t) && W(n, t, "", "deleteByCut");
721
+ };
722
+ function Mn(e) {
723
+ return e ? F(e) ? e.textContent : I(e) : null;
724
+ }
725
+ function Ln(e) {
726
+ const t = E(e);
727
+ for (let n = e; n != null && n.ownerDocument; n = n.parentElement) {
728
+ const { display: o, visibility: i } = t.getComputedStyle(n);
729
+ if (o === "none" || i === "hidden")
730
+ return !1;
731
+ }
732
+ return !0;
733
+ }
734
+ function $n(e, t) {
735
+ const n = e.ownerDocument, o = n.querySelectorAll(vt), i = Array.from(o).filter((c) => c === e || !(Number(c.getAttribute("tabindex")) < 0 || P(c)));
736
+ Number(e.getAttribute("tabindex")) >= 0 && i.sort((c, l) => {
737
+ const a = Number(c.getAttribute("tabindex")), f = Number(l.getAttribute("tabindex"));
738
+ return a === f ? 0 : a === 0 ? 1 : f === 0 ? -1 : a - f;
739
+ });
740
+ const r = {};
741
+ let s = [
742
+ n.body
743
+ ];
744
+ const u = d(e, "input", {
745
+ type: "radio"
746
+ }) ? e.name : void 0;
747
+ i.forEach((c) => {
748
+ const l = c;
749
+ if (d(l, "input", {
750
+ type: "radio"
751
+ }) && l.name) {
752
+ if (l === e) {
753
+ s.push(l);
754
+ return;
755
+ } else if (l.name === u)
756
+ return;
757
+ if (l.checked) {
758
+ s = s.filter((a) => !d(a, "input", {
759
+ type: "radio",
760
+ name: l.name
761
+ })), s.push(l), r[l.name] = l;
762
+ return;
763
+ }
764
+ if (typeof r[l.name] < "u")
765
+ return;
766
+ }
767
+ s.push(l);
768
+ });
769
+ for (let c = s.findIndex((l) => l === e); ; )
770
+ if (c += t ? -1 : 1, c === s.length ? c = 0 : c === -1 && (c = s.length - 1), s[c] === e || s[c] === n.body || Ln(s[c]))
771
+ return s[c];
772
+ }
773
+ function Xe(e, t) {
774
+ if (C(e)) {
775
+ const n = de(e);
776
+ B({
777
+ focusNode: e,
778
+ focusOffset: n.startOffset === n.endOffset ? n.focusOffset + t : t < 0 ? n.startOffset : n.endOffset
779
+ });
780
+ } else {
781
+ const n = e.ownerDocument.getSelection();
782
+ if (!(n != null && n.focusNode))
783
+ return;
784
+ if (n.isCollapsed) {
785
+ const o = Ct(n.focusNode, n.focusOffset, t);
786
+ o && B({
787
+ focusNode: o.node,
788
+ focusOffset: o.offset
789
+ });
790
+ } else
791
+ n[t < 0 ? "collapseToStart" : "collapseToEnd"]();
792
+ }
793
+ }
794
+ function _t(e) {
795
+ var t;
796
+ if (C(e))
797
+ return B({
798
+ focusNode: e,
799
+ anchorOffset: 0,
800
+ focusOffset: I(e).length
801
+ });
802
+ const n = (t = ae(e)) !== null && t !== void 0 ? t : e.ownerDocument.body;
803
+ B({
804
+ focusNode: n,
805
+ anchorOffset: 0,
806
+ focusOffset: n.childNodes.length
807
+ });
808
+ }
809
+ function Fn(e) {
810
+ var t;
811
+ if (C(e))
812
+ return de(e).startOffset === 0 && de(e).endOffset === I(e).length;
813
+ const n = (t = ae(e)) !== null && t !== void 0 ? t : e.ownerDocument.body, o = e.ownerDocument.getSelection();
814
+ return (o == null ? void 0 : o.anchorNode) === n && o.focusNode === n && o.anchorOffset === 0 && o.focusOffset === n.childNodes.length;
815
+ }
816
+ function se(e, t, n) {
817
+ var o;
818
+ if (C(e))
819
+ return B({
820
+ focusNode: e,
821
+ anchorOffset: t,
822
+ focusOffset: n
823
+ });
824
+ if (F(e) && ((o = e.firstChild) === null || o === void 0 ? void 0 : o.nodeType) === 3)
825
+ return B({
826
+ focusNode: e.firstChild,
827
+ anchorOffset: t,
828
+ focusOffset: n
829
+ });
830
+ throw new Error("Not implemented. The result of this interaction is unreliable.");
831
+ }
832
+ function ve(e, t, n) {
833
+ const o = E(t), i = Array.from(t.ownerDocument.querySelectorAll(t.name ? `input[type="radio"][name="${o.CSS.escape(t.name)}"]` : 'input[type="radio"][name=""], input[type="radio"]:not([name])'));
834
+ for (let r = i.findIndex((s) => s === t) + n; ; r += n) {
835
+ if (i[r] || (r = n > 0 ? 0 : i.length - 1), i[r] === t)
836
+ return;
837
+ if (!P(i[r])) {
838
+ U(i[r]), e.dispatchUIEvent(i[r], "click");
839
+ return;
840
+ }
841
+ }
842
+ }
843
+ D.keydown = (e, t, n) => {
844
+ var o, i;
845
+ return (o = (i = ze[e.key]) === null || i === void 0 ? void 0 : i.call(ze, e, t, n)) !== null && o !== void 0 ? o : Bn(e, t, n);
846
+ };
847
+ const ze = {
848
+ ArrowDown: (e, t, n) => {
849
+ if (d(t, "input", {
850
+ type: "radio"
851
+ }))
852
+ return () => ve(n, t, 1);
853
+ },
854
+ ArrowLeft: (e, t, n) => d(t, "input", {
855
+ type: "radio"
856
+ }) ? () => ve(n, t, -1) : () => Xe(t, -1),
857
+ ArrowRight: (e, t, n) => d(t, "input", {
858
+ type: "radio"
859
+ }) ? () => ve(n, t, 1) : () => Xe(t, 1),
860
+ ArrowUp: (e, t, n) => {
861
+ if (d(t, "input", {
862
+ type: "radio"
863
+ }))
864
+ return () => ve(n, t, -1);
865
+ },
866
+ Backspace: (e, t, n) => {
867
+ if (G(t))
868
+ return () => {
869
+ W(n, t, "", "deleteContentBackward");
870
+ };
871
+ },
872
+ Delete: (e, t, n) => {
873
+ if (G(t))
874
+ return () => {
875
+ W(n, t, "", "deleteContentForward");
876
+ };
877
+ },
878
+ End: (e, t) => {
879
+ if (d(t, [
880
+ "input",
881
+ "textarea"
882
+ ]) || F(t))
883
+ return () => {
884
+ var n, o;
885
+ const i = (n = (o = Mn(t)) === null || o === void 0 ? void 0 : o.length) !== null && n !== void 0 ? n : (
886
+ /* istanbul ignore next */
887
+ 0
888
+ );
889
+ se(t, i, i);
890
+ };
891
+ },
892
+ Home: (e, t) => {
893
+ if (d(t, [
894
+ "input",
895
+ "textarea"
896
+ ]) || F(t))
897
+ return () => {
898
+ se(t, 0, 0);
899
+ };
900
+ },
901
+ PageDown: (e, t) => {
902
+ if (d(t, [
903
+ "input"
904
+ ]))
905
+ return () => {
906
+ const n = I(t).length;
907
+ se(t, n, n);
908
+ };
909
+ },
910
+ PageUp: (e, t) => {
911
+ if (d(t, [
912
+ "input"
913
+ ]))
914
+ return () => {
915
+ se(t, 0, 0);
916
+ };
917
+ },
918
+ Tab: (e, t, n) => () => {
919
+ const o = $n(
920
+ // get target here because target would be stale, it's the element that keydown happened on, but
921
+ // focus may have been moved to another element so that browser tab behaviour picks up from there
922
+ ye(n.config.document),
923
+ n.system.keyboard.modifiers.Shift
924
+ );
925
+ U(o), C(o) && q(o, {
926
+ anchorOffset: 0,
927
+ focusOffset: o.value.length
928
+ });
929
+ }
930
+ }, Bn = (e, t, n) => {
931
+ if (e.code === "KeyA" && n.system.keyboard.modifiers.Control)
932
+ return () => _t(t);
933
+ };
934
+ D.keypress = (e, t, n) => {
935
+ if (e.key === "Enter") {
936
+ if (d(t, "button") || d(t, "input") && Vn.includes(t.type) || d(t, "a") && t.href)
937
+ return () => {
938
+ n.dispatchUIEvent(t, "click");
939
+ };
940
+ if (d(t, "input")) {
941
+ const o = t.form, i = o == null ? void 0 : o.querySelector('input[type="submit"], button:not([type]), button[type="submit"]');
942
+ return i ? () => n.dispatchUIEvent(i, "click") : o && Kn.includes(t.type) && o.querySelectorAll("input").length === 1 ? () => n.dispatchUIEvent(o, "submit") : void 0;
943
+ }
944
+ }
945
+ if (G(t)) {
946
+ const o = e.key === "Enter" ? F(t) && !n.system.keyboard.modifiers.Shift ? "insertParagraph" : "insertLineBreak" : "insertText", i = e.key === "Enter" ? `
947
+ ` : e.key;
948
+ return () => W(n, t, i, o);
949
+ }
950
+ };
951
+ const Vn = [
952
+ "button",
953
+ "color",
954
+ "file",
955
+ "image",
956
+ "reset",
957
+ "submit"
958
+ ], Kn = [
959
+ "email",
960
+ "month",
961
+ "password",
962
+ "search",
963
+ "tel",
964
+ "text",
965
+ "url",
966
+ "week"
967
+ ];
968
+ D.keyup = (e, t, n) => {
969
+ var o;
970
+ return (o = We[e.key]) === null || o === void 0 ? void 0 : o.call(We, e, t, n);
971
+ };
972
+ const We = {
973
+ " ": (e, t, n) => {
974
+ if (gt(t))
975
+ return () => n.dispatchUIEvent(t, "click");
976
+ }
977
+ };
978
+ D.paste = (e, t, n) => {
979
+ if (G(t))
980
+ return () => {
981
+ var o;
982
+ const i = (o = e.clipboardData) === null || o === void 0 ? void 0 : o.getData("text");
983
+ i && W(n, t, i, "insertFromPaste");
984
+ };
985
+ };
986
+ const Pt = {
987
+ auxclick: {
988
+ EventType: "PointerEvent",
989
+ defaultInit: {
990
+ bubbles: !0,
991
+ cancelable: !0,
992
+ composed: !0
993
+ }
994
+ },
995
+ beforeinput: {
996
+ EventType: "InputEvent",
997
+ defaultInit: {
998
+ bubbles: !0,
999
+ cancelable: !0,
1000
+ composed: !0
1001
+ }
1002
+ },
1003
+ blur: {
1004
+ EventType: "FocusEvent",
1005
+ defaultInit: {
1006
+ bubbles: !1,
1007
+ cancelable: !1,
1008
+ composed: !0
1009
+ }
1010
+ },
1011
+ click: {
1012
+ EventType: "PointerEvent",
1013
+ defaultInit: {
1014
+ bubbles: !0,
1015
+ cancelable: !0,
1016
+ composed: !0
1017
+ }
1018
+ },
1019
+ contextmenu: {
1020
+ EventType: "PointerEvent",
1021
+ defaultInit: {
1022
+ bubbles: !0,
1023
+ cancelable: !0,
1024
+ composed: !0
1025
+ }
1026
+ },
1027
+ copy: {
1028
+ EventType: "ClipboardEvent",
1029
+ defaultInit: {
1030
+ bubbles: !0,
1031
+ cancelable: !0,
1032
+ composed: !0
1033
+ }
1034
+ },
1035
+ change: {
1036
+ EventType: "Event",
1037
+ defaultInit: {
1038
+ bubbles: !0,
1039
+ cancelable: !1
1040
+ }
1041
+ },
1042
+ cut: {
1043
+ EventType: "ClipboardEvent",
1044
+ defaultInit: {
1045
+ bubbles: !0,
1046
+ cancelable: !0,
1047
+ composed: !0
1048
+ }
1049
+ },
1050
+ dblclick: {
1051
+ EventType: "MouseEvent",
1052
+ defaultInit: {
1053
+ bubbles: !0,
1054
+ cancelable: !0,
1055
+ composed: !0
1056
+ }
1057
+ },
1058
+ focus: {
1059
+ EventType: "FocusEvent",
1060
+ defaultInit: {
1061
+ bubbles: !1,
1062
+ cancelable: !1,
1063
+ composed: !0
1064
+ }
1065
+ },
1066
+ focusin: {
1067
+ EventType: "FocusEvent",
1068
+ defaultInit: {
1069
+ bubbles: !0,
1070
+ cancelable: !1,
1071
+ composed: !0
1072
+ }
1073
+ },
1074
+ focusout: {
1075
+ EventType: "FocusEvent",
1076
+ defaultInit: {
1077
+ bubbles: !0,
1078
+ cancelable: !1,
1079
+ composed: !0
1080
+ }
1081
+ },
1082
+ keydown: {
1083
+ EventType: "KeyboardEvent",
1084
+ defaultInit: {
1085
+ bubbles: !0,
1086
+ cancelable: !0,
1087
+ composed: !0
1088
+ }
1089
+ },
1090
+ keypress: {
1091
+ EventType: "KeyboardEvent",
1092
+ defaultInit: {
1093
+ bubbles: !0,
1094
+ cancelable: !0,
1095
+ composed: !0
1096
+ }
1097
+ },
1098
+ keyup: {
1099
+ EventType: "KeyboardEvent",
1100
+ defaultInit: {
1101
+ bubbles: !0,
1102
+ cancelable: !0,
1103
+ composed: !0
1104
+ }
1105
+ },
1106
+ paste: {
1107
+ EventType: "ClipboardEvent",
1108
+ defaultInit: {
1109
+ bubbles: !0,
1110
+ cancelable: !0,
1111
+ composed: !0
1112
+ }
1113
+ },
1114
+ input: {
1115
+ EventType: "InputEvent",
1116
+ defaultInit: {
1117
+ bubbles: !0,
1118
+ cancelable: !1,
1119
+ composed: !0
1120
+ }
1121
+ },
1122
+ mousedown: {
1123
+ EventType: "MouseEvent",
1124
+ defaultInit: {
1125
+ bubbles: !0,
1126
+ cancelable: !0,
1127
+ composed: !0
1128
+ }
1129
+ },
1130
+ mouseenter: {
1131
+ EventType: "MouseEvent",
1132
+ defaultInit: {
1133
+ bubbles: !1,
1134
+ cancelable: !1,
1135
+ composed: !0
1136
+ }
1137
+ },
1138
+ mouseleave: {
1139
+ EventType: "MouseEvent",
1140
+ defaultInit: {
1141
+ bubbles: !1,
1142
+ cancelable: !1,
1143
+ composed: !0
1144
+ }
1145
+ },
1146
+ mousemove: {
1147
+ EventType: "MouseEvent",
1148
+ defaultInit: {
1149
+ bubbles: !0,
1150
+ cancelable: !0,
1151
+ composed: !0
1152
+ }
1153
+ },
1154
+ mouseout: {
1155
+ EventType: "MouseEvent",
1156
+ defaultInit: {
1157
+ bubbles: !0,
1158
+ cancelable: !0,
1159
+ composed: !0
1160
+ }
1161
+ },
1162
+ mouseover: {
1163
+ EventType: "MouseEvent",
1164
+ defaultInit: {
1165
+ bubbles: !0,
1166
+ cancelable: !0,
1167
+ composed: !0
1168
+ }
1169
+ },
1170
+ mouseup: {
1171
+ EventType: "MouseEvent",
1172
+ defaultInit: {
1173
+ bubbles: !0,
1174
+ cancelable: !0,
1175
+ composed: !0
1176
+ }
1177
+ },
1178
+ pointerover: {
1179
+ EventType: "PointerEvent",
1180
+ defaultInit: {
1181
+ bubbles: !0,
1182
+ cancelable: !0,
1183
+ composed: !0
1184
+ }
1185
+ },
1186
+ pointerenter: {
1187
+ EventType: "PointerEvent",
1188
+ defaultInit: {
1189
+ bubbles: !1,
1190
+ cancelable: !1
1191
+ }
1192
+ },
1193
+ pointerdown: {
1194
+ EventType: "PointerEvent",
1195
+ defaultInit: {
1196
+ bubbles: !0,
1197
+ cancelable: !0,
1198
+ composed: !0
1199
+ }
1200
+ },
1201
+ pointermove: {
1202
+ EventType: "PointerEvent",
1203
+ defaultInit: {
1204
+ bubbles: !0,
1205
+ cancelable: !0,
1206
+ composed: !0
1207
+ }
1208
+ },
1209
+ pointerup: {
1210
+ EventType: "PointerEvent",
1211
+ defaultInit: {
1212
+ bubbles: !0,
1213
+ cancelable: !0,
1214
+ composed: !0
1215
+ }
1216
+ },
1217
+ pointercancel: {
1218
+ EventType: "PointerEvent",
1219
+ defaultInit: {
1220
+ bubbles: !0,
1221
+ cancelable: !1,
1222
+ composed: !0
1223
+ }
1224
+ },
1225
+ pointerout: {
1226
+ EventType: "PointerEvent",
1227
+ defaultInit: {
1228
+ bubbles: !0,
1229
+ cancelable: !0,
1230
+ composed: !0
1231
+ }
1232
+ },
1233
+ pointerleave: {
1234
+ EventType: "PointerEvent",
1235
+ defaultInit: {
1236
+ bubbles: !1,
1237
+ cancelable: !1
1238
+ }
1239
+ },
1240
+ submit: {
1241
+ EventType: "Event",
1242
+ defaultInit: {
1243
+ bubbles: !0,
1244
+ cancelable: !0
1245
+ }
1246
+ }
1247
+ };
1248
+ function At(e) {
1249
+ return Pt[e].EventType;
1250
+ }
1251
+ const Rn = [
1252
+ "MouseEvent",
1253
+ "PointerEvent"
1254
+ ];
1255
+ function jn(e) {
1256
+ return Rn.includes(At(e));
1257
+ }
1258
+ function Hn(e) {
1259
+ return At(e) === "KeyboardEvent";
1260
+ }
1261
+ const Gn = {
1262
+ ClipboardEvent: [
1263
+ zn
1264
+ ],
1265
+ Event: [],
1266
+ FocusEvent: [
1267
+ re,
1268
+ Wn
1269
+ ],
1270
+ InputEvent: [
1271
+ re,
1272
+ Yn
1273
+ ],
1274
+ MouseEvent: [
1275
+ re,
1276
+ Pe,
1277
+ Ye
1278
+ ],
1279
+ PointerEvent: [
1280
+ re,
1281
+ Pe,
1282
+ Ye,
1283
+ Jn
1284
+ ],
1285
+ KeyboardEvent: [
1286
+ re,
1287
+ Pe,
1288
+ qn
1289
+ ]
1290
+ };
1291
+ function Ot(e, t, n) {
1292
+ const o = E(t), { EventType: i, defaultInit: r } = Pt[e], s = new (Xn(o))[i](e, r);
1293
+ return Gn[i].forEach((u) => u(s, n ?? {})), s;
1294
+ }
1295
+ function Xn(e) {
1296
+ var t, n, o, i, r, s, u, c, l, a, f, p, h, g, N;
1297
+ const w = (t = e.Event) !== null && t !== void 0 ? t : class {
1298
+ }, J = (n = e.AnimationEvent) !== null && n !== void 0 ? n : class extends w {
1299
+ }, Z = (o = e.ClipboardEvent) !== null && o !== void 0 ? o : class extends w {
1300
+ }, Q = (i = e.PopStateEvent) !== null && i !== void 0 ? i : class extends w {
1301
+ }, ee = (r = e.ProgressEvent) !== null && r !== void 0 ? r : class extends w {
1302
+ }, te = (s = e.TransitionEvent) !== null && s !== void 0 ? s : class extends w {
1303
+ }, k = (u = e.UIEvent) !== null && u !== void 0 ? u : class extends w {
1304
+ }, ne = (c = e.CompositionEvent) !== null && c !== void 0 ? c : class extends k {
1305
+ }, oe = (l = e.FocusEvent) !== null && l !== void 0 ? l : class extends k {
1306
+ }, ie = (a = e.InputEvent) !== null && a !== void 0 ? a : class extends k {
1307
+ }, zt = (f = e.KeyboardEvent) !== null && f !== void 0 ? f : class extends k {
1308
+ }, Se = (p = e.MouseEvent) !== null && p !== void 0 ? p : class extends k {
1309
+ }, Wt = (h = e.DragEvent) !== null && h !== void 0 ? h : class extends Se {
1310
+ }, Yt = (g = e.PointerEvent) !== null && g !== void 0 ? g : class extends Se {
1311
+ }, qt = (N = e.TouchEvent) !== null && N !== void 0 ? N : class extends k {
1312
+ };
1313
+ return {
1314
+ Event: w,
1315
+ AnimationEvent: J,
1316
+ ClipboardEvent: Z,
1317
+ PopStateEvent: Q,
1318
+ ProgressEvent: ee,
1319
+ TransitionEvent: te,
1320
+ UIEvent: k,
1321
+ CompositionEvent: ne,
1322
+ FocusEvent: oe,
1323
+ InputEvent: ie,
1324
+ KeyboardEvent: zt,
1325
+ MouseEvent: Se,
1326
+ DragEvent: Wt,
1327
+ PointerEvent: Yt,
1328
+ TouchEvent: qt
1329
+ };
1330
+ }
1331
+ function x(e, t) {
1332
+ for (const [n, o] of Object.entries(t))
1333
+ Object.defineProperty(e, n, {
1334
+ get: () => o ?? null
1335
+ });
1336
+ }
1337
+ function v(e) {
1338
+ return Number(e ?? 0);
1339
+ }
1340
+ function zn(e, { clipboardData: t }) {
1341
+ x(e, {
1342
+ clipboardData: t
1343
+ });
1344
+ }
1345
+ function Wn(e, { relatedTarget: t }) {
1346
+ x(e, {
1347
+ relatedTarget: t
1348
+ });
1349
+ }
1350
+ function Yn(e, { data: t, inputType: n, isComposing: o }) {
1351
+ x(e, {
1352
+ data: t,
1353
+ isComposing: !!o,
1354
+ inputType: String(n)
1355
+ });
1356
+ }
1357
+ function re(e, { view: t, detail: n }) {
1358
+ x(e, {
1359
+ view: t,
1360
+ detail: v(n ?? 0)
1361
+ });
1362
+ }
1363
+ function Pe(e, { altKey: t, ctrlKey: n, metaKey: o, shiftKey: i, modifierAltGraph: r, modifierCapsLock: s, modifierFn: u, modifierFnLock: c, modifierNumLock: l, modifierScrollLock: a, modifierSymbol: f, modifierSymbolLock: p }) {
1364
+ x(e, {
1365
+ altKey: !!t,
1366
+ ctrlKey: !!n,
1367
+ metaKey: !!o,
1368
+ shiftKey: !!i,
1369
+ getModifierState(h) {
1370
+ return !!{
1371
+ Alt: t,
1372
+ AltGraph: r,
1373
+ CapsLock: s,
1374
+ Control: n,
1375
+ Fn: u,
1376
+ FnLock: c,
1377
+ Meta: o,
1378
+ NumLock: l,
1379
+ ScrollLock: a,
1380
+ Shift: i,
1381
+ Symbol: f,
1382
+ SymbolLock: p
1383
+ }[h];
1384
+ }
1385
+ });
1386
+ }
1387
+ function qn(e, { key: t, code: n, location: o, repeat: i, isComposing: r, charCode: s }) {
1388
+ x(e, {
1389
+ key: String(t),
1390
+ code: String(n),
1391
+ location: v(o),
1392
+ repeat: !!i,
1393
+ isComposing: !!r,
1394
+ charCode: s
1395
+ });
1396
+ }
1397
+ function Ye(e, { x: t, y: n, screenX: o, screenY: i, clientX: r = t, clientY: s = n, button: u, buttons: c, relatedTarget: l, offsetX: a, offsetY: f, pageX: p, pageY: h }) {
1398
+ x(e, {
1399
+ screenX: v(o),
1400
+ screenY: v(i),
1401
+ clientX: v(r),
1402
+ x: v(r),
1403
+ clientY: v(s),
1404
+ y: v(s),
1405
+ button: v(u),
1406
+ buttons: v(c),
1407
+ relatedTarget: l,
1408
+ offsetX: v(a),
1409
+ offsetY: v(f),
1410
+ pageX: v(p),
1411
+ pageY: v(h)
1412
+ });
1413
+ }
1414
+ function Jn(e, { pointerId: t, width: n, height: o, pressure: i, tangentialPressure: r, tiltX: s, tiltY: u, twist: c, pointerType: l, isPrimary: a, buttons: f }) {
1415
+ x(e, {
1416
+ pointerId: v(t),
1417
+ width: v(n ?? 1),
1418
+ height: v(o ?? 1),
1419
+ pressure: v(i ?? (f ? 0.5 : 0)),
1420
+ tangentialPressure: v(r),
1421
+ tiltX: v(s),
1422
+ tiltY: v(u),
1423
+ twist: v(c),
1424
+ pointerType: String(l ?? ""),
1425
+ isPrimary: !!a
1426
+ });
1427
+ }
1428
+ function Zn(e, t, n, o = !1) {
1429
+ (jn(t) || Hn(t)) && (n = {
1430
+ ...n,
1431
+ ...this.system.getUIEventModifiers()
1432
+ });
1433
+ const i = Ot(t, e, n);
1434
+ return Ut.call(this, e, i, o);
1435
+ }
1436
+ function Ut(e, t, n = !1) {
1437
+ var o;
1438
+ const i = t.type, r = n ? () => {
1439
+ } : (o = D[i]) === null || o === void 0 ? void 0 : o.call(D, t, e, this);
1440
+ if (r) {
1441
+ t.preventDefault();
1442
+ let s = !1;
1443
+ return Object.defineProperty(t, "defaultPrevented", {
1444
+ get: () => s
1445
+ }), Object.defineProperty(t, "preventDefault", {
1446
+ value: () => {
1447
+ s = t.cancelable;
1448
+ }
1449
+ }), X(() => e.dispatchEvent(t)), s || r(), !s;
1450
+ }
1451
+ return X(() => e.dispatchEvent(t));
1452
+ }
1453
+ function $(e, t, n) {
1454
+ const o = Ot(t, e, n);
1455
+ X(() => e.dispatchEvent(o));
1456
+ }
1457
+ const qe = Symbol("patched focus/blur methods");
1458
+ function Dt(e) {
1459
+ if (e.prototype[qe])
1460
+ return;
1461
+ const { focus: t, blur: n } = e.prototype;
1462
+ Object.defineProperties(e.prototype, {
1463
+ focus: {
1464
+ configurable: !0,
1465
+ value: i,
1466
+ writable: !0
1467
+ },
1468
+ blur: {
1469
+ configurable: !0,
1470
+ value: r,
1471
+ writable: !0
1472
+ },
1473
+ [qe]: {
1474
+ configurable: !0,
1475
+ get: () => ({
1476
+ focus: t,
1477
+ blur: n
1478
+ })
1479
+ }
1480
+ });
1481
+ let o;
1482
+ function i(s) {
1483
+ if (this.ownerDocument.visibilityState !== "hidden")
1484
+ return t.call(this, s);
1485
+ const u = Je(this.ownerDocument);
1486
+ if (u === this)
1487
+ return;
1488
+ const c = Symbol("focus call");
1489
+ o = c, u && (n.call(u), $(u, "blur", {
1490
+ relatedTarget: this
1491
+ }), $(u, "focusout", {
1492
+ relatedTarget: o === c ? this : null
1493
+ })), o === c && (t.call(this, s), $(this, "focus", {
1494
+ relatedTarget: u
1495
+ })), o === c && $(this, "focusin", {
1496
+ relatedTarget: u
1497
+ });
1498
+ }
1499
+ function r() {
1500
+ if (this.ownerDocument.visibilityState !== "hidden")
1501
+ return n.call(this);
1502
+ const s = Je(this.ownerDocument);
1503
+ if (s !== this)
1504
+ return;
1505
+ o = Symbol("blur call"), n.call(this), $(s, "blur", {
1506
+ relatedTarget: null
1507
+ }), $(s, "focusout", {
1508
+ relatedTarget: null
1509
+ });
1510
+ }
1511
+ }
1512
+ function Je(e) {
1513
+ const t = H(e);
1514
+ return (t == null ? void 0 : t.tagName) === "BODY" ? null : t;
1515
+ }
1516
+ const Ae = Symbol("Interceptor for programmatical calls");
1517
+ function K(e, t, n) {
1518
+ const o = Object.getOwnPropertyDescriptor(e.constructor.prototype, t), i = Object.getOwnPropertyDescriptor(e, t), r = o != null && o.set ? "set" : "value";
1519
+ if (typeof (o == null ? void 0 : o[r]) != "function" || o[r][Ae])
1520
+ throw new Error(`Element ${e.tagName} does not implement "${String(t)}".`);
1521
+ function s(...u) {
1522
+ const { applyNative: c = !1, realArgs: l, then: a } = n.call(this, ...u), f = (!c && i || o)[r];
1523
+ r === "set" ? f.call(this, l) : f.call(this, ...l), a == null || a();
1524
+ }
1525
+ s[Ae] = Ae, Object.defineProperty(e, t, {
1526
+ ...i ?? o,
1527
+ [r]: s
1528
+ });
1529
+ }
1530
+ function Qn(e) {
1531
+ K(e, "value", function(n) {
1532
+ const o = pn(n);
1533
+ return o && Sn(this), {
1534
+ applyNative: !!o,
1535
+ realArgs: eo(this, n),
1536
+ then: o ? void 0 : () => _n(this, String(n))
1537
+ };
1538
+ });
1539
+ }
1540
+ function eo(e, t) {
1541
+ return d(e, "input", {
1542
+ type: "number"
1543
+ }) && String(t) !== "" && !Number.isNaN(Number(t)) ? String(Number(t)) : String(t);
1544
+ }
1545
+ function to(e) {
1546
+ K(e, "setSelectionRange", function(n, ...o) {
1547
+ const i = hn(n);
1548
+ return {
1549
+ applyNative: !!i,
1550
+ realArgs: [
1551
+ Number(n),
1552
+ ...o
1553
+ ],
1554
+ then: () => i ? void 0 : me(e)
1555
+ };
1556
+ }), K(e, "selectionStart", function(n) {
1557
+ return {
1558
+ realArgs: n,
1559
+ then: () => me(e)
1560
+ };
1561
+ }), K(e, "selectionEnd", function(n) {
1562
+ return {
1563
+ realArgs: n,
1564
+ then: () => me(e)
1565
+ };
1566
+ }), K(e, "select", function() {
1567
+ return {
1568
+ realArgs: [],
1569
+ then: () => gn(e, {
1570
+ anchorOffset: 0,
1571
+ focusOffset: I(e).length
1572
+ })
1573
+ };
1574
+ });
1575
+ }
1576
+ function no(e) {
1577
+ K(e, "setRangeText", function(...n) {
1578
+ return {
1579
+ realArgs: n,
1580
+ then: () => {
1581
+ Be(e), me(e);
1582
+ }
1583
+ };
1584
+ });
1585
+ }
1586
+ const R = Symbol("Node prepared with document state workarounds");
1587
+ function xt(e) {
1588
+ e[R] || (e.addEventListener("focus", (t) => {
1589
+ const n = t.target;
1590
+ Ze(n);
1591
+ }, {
1592
+ capture: !0,
1593
+ passive: !0
1594
+ }), e.activeElement && Ze(e.activeElement), e.addEventListener("blur", (t) => {
1595
+ const n = t.target, o = bn(n);
1596
+ o !== void 0 && (n.value !== o && $(n, "change"), wt(n));
1597
+ }, {
1598
+ capture: !0,
1599
+ passive: !0
1600
+ }), e[R] = R);
1601
+ }
1602
+ function Ze(e) {
1603
+ e[R] || (d(e, [
1604
+ "input",
1605
+ "textarea"
1606
+ ]) && (Qn(e), to(e), no(e)), e[R] = R);
1607
+ }
1608
+ function oo(e) {
1609
+ return io(e) ? e : e.ownerDocument;
1610
+ }
1611
+ function io(e) {
1612
+ return e.nodeType === 9;
1613
+ }
1614
+ var m = /* @__PURE__ */ (function(e) {
1615
+ return e[e.Trigger = 2] = "Trigger", e[e.Call = 1] = "Call", e;
1616
+ })({});
1617
+ function ue(e, t) {
1618
+ e.levelRefs[t] = {};
1619
+ }
1620
+ function be(e, t) {
1621
+ return e.levelRefs[t];
1622
+ }
1623
+ function Y(e) {
1624
+ const t = e.delay;
1625
+ if (typeof t == "number")
1626
+ return Promise.all([
1627
+ new Promise((n) => globalThis.setTimeout(() => n(), t)),
1628
+ e.advanceTimers(t)
1629
+ ]);
1630
+ }
1631
+ var we = /* @__PURE__ */ (function(e) {
1632
+ return e[e.EachTrigger = 4] = "EachTrigger", e[e.EachApiCall = 2] = "EachApiCall", e[e.EachTarget = 1] = "EachTarget", e[e.Never = 0] = "Never", e;
1633
+ })({});
1634
+ function M(e, t, n) {
1635
+ return t in e ? Object.defineProperty(e, t, {
1636
+ value: n,
1637
+ enumerable: !0,
1638
+ configurable: !0,
1639
+ writable: !0
1640
+ }) : e[t] = n, e;
1641
+ }
1642
+ var T = /* @__PURE__ */ (function(e) {
1643
+ return e[e.STANDARD = 0] = "STANDARD", e[e.LEFT = 1] = "LEFT", e[e.RIGHT = 2] = "RIGHT", e[e.NUMPAD = 3] = "NUMPAD", e;
1644
+ })({});
1645
+ const ro = [
1646
+ "Alt",
1647
+ "AltGraph",
1648
+ "Control",
1649
+ "Fn",
1650
+ "Meta",
1651
+ "Shift",
1652
+ "Symbol"
1653
+ ];
1654
+ function Qe(e) {
1655
+ return ro.includes(e);
1656
+ }
1657
+ const so = [
1658
+ "CapsLock",
1659
+ "FnLock",
1660
+ "NumLock",
1661
+ "ScrollLock",
1662
+ "SymbolLock"
1663
+ ];
1664
+ function et(e) {
1665
+ return so.includes(e);
1666
+ }
1667
+ class uo {
1668
+ isKeyPressed(t) {
1669
+ return this.pressed.has(String(t.code));
1670
+ }
1671
+ getPressedKeys() {
1672
+ return this.pressed.values().map((t) => t.keyDef);
1673
+ }
1674
+ /** Press a key */
1675
+ async keydown(t, n, o = !1) {
1676
+ const i = String(n.key), r = String(n.code), s = ye(t.config.document);
1677
+ this.setKeydownTarget(s), this.pressed.add(r, n), Qe(i) && (this.modifiers[i] = !0);
1678
+ const u = t.dispatchUIEvent(s, "keydown", {
1679
+ key: i,
1680
+ code: r,
1681
+ repeat: o
1682
+ });
1683
+ et(i) && !this.modifiers[i] && (this.modifiers[i] = !0, this.modifierLockStart[i] = !0), u && this.pressed.setUnprevented(r), u && this.hasKeyPress(i) && t.dispatchUIEvent(ye(t.config.document), "keypress", {
1684
+ key: i,
1685
+ code: r,
1686
+ charCode: n.key === "Enter" ? 13 : String(n.key).charCodeAt(0)
1687
+ });
1688
+ }
1689
+ /** Release a key */
1690
+ async keyup(t, n) {
1691
+ const o = String(n.key), i = String(n.code), r = this.pressed.isUnprevented(i);
1692
+ this.pressed.delete(i), Qe(o) && !this.pressed.values().find((s) => s.keyDef.key === o) && (this.modifiers[o] = !1), t.dispatchUIEvent(ye(t.config.document), "keyup", {
1693
+ key: o,
1694
+ code: i
1695
+ }, !r), et(o) && this.modifiers[o] && (this.modifierLockStart[o] ? this.modifierLockStart[o] = !1 : this.modifiers[o] = !1);
1696
+ }
1697
+ setKeydownTarget(t) {
1698
+ t !== this.lastKeydownTarget && (this.carryChar = ""), this.lastKeydownTarget = t;
1699
+ }
1700
+ hasKeyPress(t) {
1701
+ return (t.length === 1 || t === "Enter") && !this.modifiers.Control && !this.modifiers.Alt;
1702
+ }
1703
+ constructor(t) {
1704
+ M(this, "system", void 0), M(this, "modifiers", {
1705
+ Alt: !1,
1706
+ AltGraph: !1,
1707
+ CapsLock: !1,
1708
+ Control: !1,
1709
+ Fn: !1,
1710
+ FnLock: !1,
1711
+ Meta: !1,
1712
+ NumLock: !1,
1713
+ ScrollLock: !1,
1714
+ Shift: !1,
1715
+ Symbol: !1,
1716
+ SymbolLock: !1
1717
+ }), M(this, "pressed", new class {
1718
+ add(n, o) {
1719
+ var i, r, s;
1720
+ (s = (i = this.registry)[r = n]) !== null && s !== void 0 || (i[r] = {
1721
+ keyDef: o,
1722
+ unpreventedDefault: !1
1723
+ });
1724
+ }
1725
+ has(n) {
1726
+ return !!this.registry[n];
1727
+ }
1728
+ setUnprevented(n) {
1729
+ const o = this.registry[n];
1730
+ o && (o.unpreventedDefault = !0);
1731
+ }
1732
+ isUnprevented(n) {
1733
+ var o;
1734
+ return !!(!((o = this.registry[n]) === null || o === void 0) && o.unpreventedDefault);
1735
+ }
1736
+ delete(n) {
1737
+ delete this.registry[n];
1738
+ }
1739
+ values() {
1740
+ return Object.values(this.registry);
1741
+ }
1742
+ constructor() {
1743
+ M(this, "registry", {});
1744
+ }
1745
+ }()), M(this, "carryChar", ""), M(this, "lastKeydownTarget", void 0), M(this, "modifierLockStart", {}), this.system = t;
1746
+ }
1747
+ }
1748
+ const co = [
1749
+ // alphanumeric block - writing system
1750
+ ..."0123456789".split("").map((e) => ({
1751
+ code: `Digit${e}`,
1752
+ key: e
1753
+ })),
1754
+ ...")!@#$%^&*(".split("").map((e, t) => ({
1755
+ code: `Digit${t}`,
1756
+ key: e,
1757
+ shiftKey: !0
1758
+ })),
1759
+ ..."abcdefghijklmnopqrstuvwxyz".split("").map((e) => ({
1760
+ code: `Key${e.toUpperCase()}`,
1761
+ key: e
1762
+ })),
1763
+ ..."ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").map((e) => ({
1764
+ code: `Key${e}`,
1765
+ key: e,
1766
+ shiftKey: !0
1767
+ })),
1768
+ {
1769
+ code: "BracketLeft",
1770
+ key: "["
1771
+ },
1772
+ {
1773
+ code: "BracketLeft",
1774
+ key: "{",
1775
+ shiftKey: !0
1776
+ },
1777
+ {
1778
+ code: "BracketRight",
1779
+ key: "]"
1780
+ },
1781
+ {
1782
+ code: "BracketRight",
1783
+ key: "}",
1784
+ shiftKey: !0
1785
+ },
1786
+ // alphanumeric block - functional
1787
+ {
1788
+ code: "Space",
1789
+ key: " "
1790
+ },
1791
+ {
1792
+ code: "AltLeft",
1793
+ key: "Alt",
1794
+ location: T.LEFT
1795
+ },
1796
+ {
1797
+ code: "AltRight",
1798
+ key: "Alt",
1799
+ location: T.RIGHT
1800
+ },
1801
+ {
1802
+ code: "ShiftLeft",
1803
+ key: "Shift",
1804
+ location: T.LEFT
1805
+ },
1806
+ {
1807
+ code: "ShiftRight",
1808
+ key: "Shift",
1809
+ location: T.RIGHT
1810
+ },
1811
+ {
1812
+ code: "ControlLeft",
1813
+ key: "Control",
1814
+ location: T.LEFT
1815
+ },
1816
+ {
1817
+ code: "ControlRight",
1818
+ key: "Control",
1819
+ location: T.RIGHT
1820
+ },
1821
+ {
1822
+ code: "MetaLeft",
1823
+ key: "Meta",
1824
+ location: T.LEFT
1825
+ },
1826
+ {
1827
+ code: "MetaRight",
1828
+ key: "Meta",
1829
+ location: T.RIGHT
1830
+ },
1831
+ {
1832
+ code: "OSLeft",
1833
+ key: "OS",
1834
+ location: T.LEFT
1835
+ },
1836
+ {
1837
+ code: "OSRight",
1838
+ key: "OS",
1839
+ location: T.RIGHT
1840
+ },
1841
+ {
1842
+ code: "ContextMenu",
1843
+ key: "ContextMenu"
1844
+ },
1845
+ {
1846
+ code: "Tab",
1847
+ key: "Tab"
1848
+ },
1849
+ {
1850
+ code: "CapsLock",
1851
+ key: "CapsLock"
1852
+ },
1853
+ {
1854
+ code: "Backspace",
1855
+ key: "Backspace"
1856
+ },
1857
+ {
1858
+ code: "Enter",
1859
+ key: "Enter"
1860
+ },
1861
+ // function
1862
+ {
1863
+ code: "Escape",
1864
+ key: "Escape"
1865
+ },
1866
+ // arrows
1867
+ {
1868
+ code: "ArrowUp",
1869
+ key: "ArrowUp"
1870
+ },
1871
+ {
1872
+ code: "ArrowDown",
1873
+ key: "ArrowDown"
1874
+ },
1875
+ {
1876
+ code: "ArrowLeft",
1877
+ key: "ArrowLeft"
1878
+ },
1879
+ {
1880
+ code: "ArrowRight",
1881
+ key: "ArrowRight"
1882
+ },
1883
+ // control pad
1884
+ {
1885
+ code: "Home",
1886
+ key: "Home"
1887
+ },
1888
+ {
1889
+ code: "End",
1890
+ key: "End"
1891
+ },
1892
+ {
1893
+ code: "Delete",
1894
+ key: "Delete"
1895
+ },
1896
+ {
1897
+ code: "PageUp",
1898
+ key: "PageUp"
1899
+ },
1900
+ {
1901
+ code: "PageDown",
1902
+ key: "PageDown"
1903
+ },
1904
+ // Special keys that are not part of a default US-layout but included for specific behavior
1905
+ {
1906
+ code: "Fn",
1907
+ key: "Fn"
1908
+ },
1909
+ {
1910
+ code: "Symbol",
1911
+ key: "Symbol"
1912
+ },
1913
+ {
1914
+ code: "AltRight",
1915
+ key: "AltGraph"
1916
+ }
1917
+ ], lo = [
1918
+ {
1919
+ name: "MouseLeft",
1920
+ pointerType: "mouse",
1921
+ button: "primary"
1922
+ },
1923
+ {
1924
+ name: "MouseRight",
1925
+ pointerType: "mouse",
1926
+ button: "secondary"
1927
+ },
1928
+ {
1929
+ name: "MouseMiddle",
1930
+ pointerType: "mouse",
1931
+ button: "auxiliary"
1932
+ },
1933
+ {
1934
+ name: "TouchA",
1935
+ pointerType: "touch"
1936
+ },
1937
+ {
1938
+ name: "TouchB",
1939
+ pointerType: "touch"
1940
+ },
1941
+ {
1942
+ name: "TouchC",
1943
+ pointerType: "touch"
1944
+ }
1945
+ ];
1946
+ function ao(e, t, n) {
1947
+ return t in e ? Object.defineProperty(e, t, {
1948
+ value: n,
1949
+ enumerable: !0,
1950
+ configurable: !0,
1951
+ writable: !0
1952
+ }) : e[t] = n, e;
1953
+ }
1954
+ class Nt {
1955
+ getButtons() {
1956
+ let t = 0;
1957
+ for (const n of Object.keys(this.pressed))
1958
+ t |= 2 ** Number(n);
1959
+ return t;
1960
+ }
1961
+ down(t) {
1962
+ const n = De(t.button);
1963
+ if (n in this.pressed) {
1964
+ this.pressed[n].push(t);
1965
+ return;
1966
+ }
1967
+ return this.pressed[n] = [
1968
+ t
1969
+ ], n;
1970
+ }
1971
+ up(t) {
1972
+ const n = De(t.button);
1973
+ if (n in this.pressed && (this.pressed[n] = this.pressed[n].filter((o) => o.name !== t.name), this.pressed[n].length === 0))
1974
+ return delete this.pressed[n], n;
1975
+ }
1976
+ constructor() {
1977
+ ao(this, "pressed", {});
1978
+ }
1979
+ }
1980
+ const tt = {
1981
+ primary: 0,
1982
+ secondary: 1,
1983
+ auxiliary: 2,
1984
+ back: 3,
1985
+ X1: 3,
1986
+ forward: 4,
1987
+ X2: 4
1988
+ };
1989
+ function De(e = 0) {
1990
+ return e in tt ? tt[e] : Number(e);
1991
+ }
1992
+ const nt = {
1993
+ 1: 2,
1994
+ 2: 1
1995
+ };
1996
+ function xe(e) {
1997
+ return e = De(e), e in nt ? nt[e] : e;
1998
+ }
1999
+ function fo(e, t, n) {
2000
+ return t in e ? Object.defineProperty(e, t, {
2001
+ value: n,
2002
+ enumerable: !0,
2003
+ configurable: !0,
2004
+ writable: !0
2005
+ }) : e[t] = n, e;
2006
+ }
2007
+ class po {
2008
+ get countPressed() {
2009
+ return this.pressedKeys.size;
2010
+ }
2011
+ isPressed(t) {
2012
+ return this.pressedKeys.has(t.name);
2013
+ }
2014
+ addPressed(t) {
2015
+ return this.pressedKeys.add(t.name);
2016
+ }
2017
+ removePressed(t) {
2018
+ return this.pressedKeys.delete(t.name);
2019
+ }
2020
+ constructor() {
2021
+ fo(this, "pressedKeys", /* @__PURE__ */ new Set());
2022
+ }
2023
+ }
2024
+ function le(e, t) {
2025
+ const n = [];
2026
+ for (let r = e; r; r = r.parentElement)
2027
+ n.push(r);
2028
+ const o = [];
2029
+ for (let r = t; r; r = r.parentElement)
2030
+ o.push(r);
2031
+ let i = 0;
2032
+ for (; !(i >= n.length || i >= o.length || n[n.length - 1 - i] !== o[o.length - 1 - i]); i++)
2033
+ ;
2034
+ return [
2035
+ n.slice(0, n.length - i),
2036
+ o.slice(0, o.length - i),
2037
+ o.slice(o.length - i)
2038
+ ];
2039
+ }
2040
+ function Ne({ target: e, node: t, offset: n }) {
2041
+ return C(e) ? {
2042
+ node: e,
2043
+ offset: n ?? I(e).length
2044
+ } : t ? {
2045
+ node: t,
2046
+ offset: n ?? (t.nodeType === 3 ? t.nodeValue.length : t.childNodes.length)
2047
+ } : Mt(e, n);
2048
+ }
2049
+ function Mt(e, t, n = !0) {
2050
+ let o = t === void 0 ? e.childNodes.length - 1 : 0;
2051
+ const i = t === void 0 ? -1 : 1;
2052
+ for (; t === void 0 ? o >= (n ? Math.max(e.childNodes.length - 1, 0) : 0) : o <= e.childNodes.length; ) {
2053
+ if (t && o === e.childNodes.length)
2054
+ throw new Error("The given offset is out of bounds.");
2055
+ const r = e.childNodes.item(o), s = String(r.textContent);
2056
+ if (s.length)
2057
+ if (t !== void 0 && s.length < t)
2058
+ t -= s.length;
2059
+ else {
2060
+ if (r.nodeType === 1)
2061
+ return Mt(r, t, !1);
2062
+ if (r.nodeType === 3)
2063
+ return {
2064
+ node: r,
2065
+ offset: t ?? r.nodeValue.length
2066
+ };
2067
+ }
2068
+ o += i;
2069
+ }
2070
+ return {
2071
+ node: e,
2072
+ offset: e.childNodes.length
2073
+ };
2074
+ }
2075
+ function ho({ document: e, target: t, clickCount: n, node: o, offset: i }) {
2076
+ if (an(t))
2077
+ return;
2078
+ const r = C(t), s = String(r ? I(t) : t.textContent), [u, c] = o ? [
2079
+ i,
2080
+ i
2081
+ ] : vo(s, i, n);
2082
+ if (r)
2083
+ return q(t, {
2084
+ anchorOffset: u ?? s.length,
2085
+ focusOffset: c ?? s.length
2086
+ }), {
2087
+ node: t,
2088
+ start: u ?? 0,
2089
+ end: c ?? s.length
2090
+ };
2091
+ {
2092
+ const { node: l, offset: a } = Ne({
2093
+ target: t,
2094
+ node: o,
2095
+ offset: u
2096
+ }), { node: f, offset: p } = Ne({
2097
+ target: t,
2098
+ node: o,
2099
+ offset: c
2100
+ }), h = t.ownerDocument.createRange();
2101
+ try {
2102
+ h.setStart(l, a), h.setEnd(f, p);
2103
+ } catch {
2104
+ throw new Error("The given offset is out of bounds.");
2105
+ }
2106
+ const g = e.getSelection();
2107
+ return g == null || g.removeAllRanges(), g == null || g.addRange(h.cloneRange()), h;
2108
+ }
2109
+ }
2110
+ function vo(e, t, n) {
2111
+ if (n % 3 === 1 || e.length === 0)
2112
+ return [
2113
+ t,
2114
+ t
2115
+ ];
2116
+ const o = t ?? e.length;
2117
+ return n % 3 === 2 ? [
2118
+ o - e.substr(0, t).match(/(\w+|\s+|\W)?$/)[0].length,
2119
+ t === void 0 ? t : t + e.substr(t).match(/^(\w+|\s+|\W)?/)[0].length
2120
+ ] : [
2121
+ o - e.substr(0, t).match(/[^\r\n]*$/)[0].length,
2122
+ t === void 0 ? t : t + e.substr(t).match(/^[^\r\n]*/)[0].length
2123
+ ];
2124
+ }
2125
+ function bo(e, { document: t, target: n, node: o, offset: i }) {
2126
+ const r = Ne({
2127
+ target: n,
2128
+ node: o,
2129
+ offset: i
2130
+ });
2131
+ if ("node" in e) {
2132
+ if (r.node === e.node) {
2133
+ const s = r.offset < e.start ? e.end : e.start, u = r.offset > e.end || r.offset < e.start ? r.offset : e.end;
2134
+ q(e.node, {
2135
+ anchorOffset: s,
2136
+ focusOffset: u
2137
+ });
2138
+ }
2139
+ } else {
2140
+ const s = e.cloneRange(), u = s.comparePoint(r.node, r.offset);
2141
+ u < 0 ? s.setStart(r.node, r.offset) : u > 0 && s.setEnd(r.node, r.offset);
2142
+ const c = t.getSelection();
2143
+ c == null || c.removeAllRanges(), c == null || c.addRange(s.cloneRange());
2144
+ }
2145
+ }
2146
+ function Lt(e, t) {
2147
+ var n, o, i, r, s, u, c, l, a, f, p, h, g, N, w, J, Z, Q, ee, te, k, ne, oe, ie;
2148
+ return e.target !== t.target || ((n = e.coords) === null || n === void 0 ? void 0 : n.x) !== ((o = t.coords) === null || o === void 0 ? void 0 : o.x) || ((i = e.coords) === null || i === void 0 ? void 0 : i.y) !== ((r = t.coords) === null || r === void 0 ? void 0 : r.y) || ((s = e.coords) === null || s === void 0 ? void 0 : s.clientX) !== ((u = t.coords) === null || u === void 0 ? void 0 : u.clientX) || ((c = e.coords) === null || c === void 0 ? void 0 : c.clientY) !== ((l = t.coords) === null || l === void 0 ? void 0 : l.clientY) || ((a = e.coords) === null || a === void 0 ? void 0 : a.offsetX) !== ((f = t.coords) === null || f === void 0 ? void 0 : f.offsetX) || ((p = e.coords) === null || p === void 0 ? void 0 : p.offsetY) !== ((h = t.coords) === null || h === void 0 ? void 0 : h.offsetY) || ((g = e.coords) === null || g === void 0 ? void 0 : g.pageX) !== ((N = t.coords) === null || N === void 0 ? void 0 : N.pageX) || ((w = e.coords) === null || w === void 0 ? void 0 : w.pageY) !== ((J = t.coords) === null || J === void 0 ? void 0 : J.pageY) || ((Z = e.coords) === null || Z === void 0 ? void 0 : Z.screenX) !== ((Q = t.coords) === null || Q === void 0 ? void 0 : Q.screenX) || ((ee = e.coords) === null || ee === void 0 ? void 0 : ee.screenY) !== ((te = t.coords) === null || te === void 0 ? void 0 : te.screenY) || ((k = e.caret) === null || k === void 0 ? void 0 : k.node) !== ((ne = t.caret) === null || ne === void 0 ? void 0 : ne.node) || ((oe = e.caret) === null || oe === void 0 ? void 0 : oe.offset) !== ((ie = t.caret) === null || ie === void 0 ? void 0 : ie.offset);
2149
+ }
2150
+ function L(e, t, n) {
2151
+ return t in e ? Object.defineProperty(e, t, {
2152
+ value: n,
2153
+ enumerable: !0,
2154
+ configurable: !0,
2155
+ writable: !0
2156
+ }) : e[t] = n, e;
2157
+ }
2158
+ class go {
2159
+ move(t, n, o) {
2160
+ const i = this.position, r = this.getTarget(t);
2161
+ if (this.position = n, !Lt(i, n))
2162
+ return;
2163
+ const s = this.getTarget(t), u = this.getEventInit("mousemove"), [c, l] = le(r, s);
2164
+ return {
2165
+ leave: () => {
2166
+ r !== s && (t.dispatchUIEvent(r, "mouseout", u), c.forEach((a) => t.dispatchUIEvent(a, "mouseleave", u)));
2167
+ },
2168
+ enter: () => {
2169
+ r !== s && (t.dispatchUIEvent(s, "mouseover", u), l.forEach((a) => t.dispatchUIEvent(a, "mouseenter", u)));
2170
+ },
2171
+ move: () => {
2172
+ o || (t.dispatchUIEvent(s, "mousemove", u), this.modifySelecting(t));
2173
+ }
2174
+ };
2175
+ }
2176
+ down(t, n, o) {
2177
+ const i = this.buttons.down(n);
2178
+ if (i === void 0)
2179
+ return;
2180
+ const r = this.getTarget(t);
2181
+ this.buttonDownTarget[i] = r;
2182
+ const s = this.getEventInit("mousedown", n.button), u = P(r);
2183
+ !o && (u || t.dispatchUIEvent(r, "mousedown", s)) && (this.startSelecting(t, s.detail), U(r)), !u && xe(n.button) === 2 && t.dispatchUIEvent(r, "contextmenu", this.getEventInit("contextmenu", n.button));
2184
+ }
2185
+ up(t, n, o) {
2186
+ const i = this.buttons.up(n);
2187
+ if (i === void 0)
2188
+ return;
2189
+ const r = this.getTarget(t);
2190
+ if (!P(r)) {
2191
+ if (!o) {
2192
+ const u = this.getEventInit("mouseup", n.button);
2193
+ t.dispatchUIEvent(r, "mouseup", u), this.endSelecting();
2194
+ }
2195
+ const s = le(this.buttonDownTarget[i], r)[2][0];
2196
+ if (s) {
2197
+ const u = this.getEventInit("click", n.button);
2198
+ u.detail && (t.dispatchUIEvent(s, u.button === 0 ? "click" : "auxclick", u), u.button === 0 && u.detail === 2 && t.dispatchUIEvent(s, "dblclick", {
2199
+ ...this.getEventInit("dblclick", n.button),
2200
+ detail: u.detail
2201
+ }));
2202
+ }
2203
+ }
2204
+ }
2205
+ resetClickCount() {
2206
+ this.clickCount.reset();
2207
+ }
2208
+ getEventInit(t, n) {
2209
+ const o = {
2210
+ ...this.position.coords
2211
+ };
2212
+ return o.button = xe(n), o.buttons = this.buttons.getButtons(), t === "mousedown" ? o.detail = this.clickCount.getOnDown(o.button) : t === "mouseup" ? o.detail = this.clickCount.getOnUp(o.button) : (t === "click" || t === "auxclick") && (o.detail = this.clickCount.incOnClick(o.button)), o;
2213
+ }
2214
+ getTarget(t) {
2215
+ var n;
2216
+ return (n = this.position.target) !== null && n !== void 0 ? n : t.config.document.body;
2217
+ }
2218
+ startSelecting(t, n) {
2219
+ var o, i;
2220
+ this.selecting = ho({
2221
+ document: t.config.document,
2222
+ target: this.getTarget(t),
2223
+ node: (o = this.position.caret) === null || o === void 0 ? void 0 : o.node,
2224
+ offset: (i = this.position.caret) === null || i === void 0 ? void 0 : i.offset,
2225
+ clickCount: n
2226
+ });
2227
+ }
2228
+ modifySelecting(t) {
2229
+ var n, o;
2230
+ this.selecting && bo(this.selecting, {
2231
+ document: t.config.document,
2232
+ target: this.getTarget(t),
2233
+ node: (n = this.position.caret) === null || n === void 0 ? void 0 : n.node,
2234
+ offset: (o = this.position.caret) === null || o === void 0 ? void 0 : o.offset
2235
+ });
2236
+ }
2237
+ endSelecting() {
2238
+ this.selecting = void 0;
2239
+ }
2240
+ constructor() {
2241
+ L(this, "position", {}), L(this, "buttons", new Nt()), L(this, "selecting", void 0), L(this, "buttonDownTarget", {}), L(this, "clickCount", new class {
2242
+ incOnClick(t) {
2243
+ const n = this.down[t] === void 0 ? void 0 : Number(this.down[t]) + 1;
2244
+ return this.count = this.count[t] === void 0 ? {} : {
2245
+ [t]: Number(this.count[t]) + 1
2246
+ }, n;
2247
+ }
2248
+ getOnDown(t) {
2249
+ var n, o;
2250
+ return this.down = {
2251
+ [t]: (n = this.count[t]) !== null && n !== void 0 ? n : 0
2252
+ }, this.count = {
2253
+ [t]: (o = this.count[t]) !== null && o !== void 0 ? o : 0
2254
+ }, Number(this.count[t]) + 1;
2255
+ }
2256
+ getOnUp(t) {
2257
+ return this.down[t] === void 0 ? void 0 : Number(this.down[t]) + 1;
2258
+ }
2259
+ reset() {
2260
+ this.count = {};
2261
+ }
2262
+ constructor() {
2263
+ L(this, "down", {}), L(this, "count", {});
2264
+ }
2265
+ }());
2266
+ }
2267
+ }
2268
+ function Ie(e, t) {
2269
+ var n;
2270
+ return ((n = $t(e, t)) === null || n === void 0 ? void 0 : n.pointerEvents) !== "none";
2271
+ }
2272
+ function yo(e) {
2273
+ const t = E(e);
2274
+ for (let n = e, o = []; n != null && n.ownerDocument; n = n.parentElement) {
2275
+ o.push(n);
2276
+ const i = t.getComputedStyle(n).pointerEvents;
2277
+ if (i && ![
2278
+ "inherit",
2279
+ "unset"
2280
+ ].includes(i))
2281
+ return {
2282
+ pointerEvents: i,
2283
+ tree: o
2284
+ };
2285
+ }
2286
+ }
2287
+ const ot = Symbol("Last check for pointer-events");
2288
+ function $t(e, t) {
2289
+ const n = t[ot];
2290
+ if (!(e.config.pointerEventsCheck !== we.Never && (!n || it(e.config.pointerEventsCheck, we.EachApiCall) && n[m.Call] !== be(e, m.Call) || it(e.config.pointerEventsCheck, we.EachTrigger) && n[m.Trigger] !== be(e, m.Trigger))))
2291
+ return n == null ? void 0 : n.result;
2292
+ const i = yo(t);
2293
+ return t[ot] = {
2294
+ [m.Call]: be(e, m.Call),
2295
+ [m.Trigger]: be(e, m.Trigger),
2296
+ result: i
2297
+ }, i;
2298
+ }
2299
+ function ce(e, t) {
2300
+ const n = $t(e, t);
2301
+ if ((n == null ? void 0 : n.pointerEvents) === "none")
2302
+ throw new Error([
2303
+ `Unable to perform pointer interaction as the element ${n.tree.length > 1 ? "inherits" : "has"} \`pointer-events: none\`:`,
2304
+ "",
2305
+ mo(n.tree)
2306
+ ].join(`
2307
+ `));
2308
+ }
2309
+ function mo(e) {
2310
+ return e.reverse().map((t, n) => [
2311
+ "".padEnd(n),
2312
+ t.tagName,
2313
+ t.id && `#${t.id}`,
2314
+ t.hasAttribute("data-testid") && `(testId=${t.getAttribute("data-testid")})`,
2315
+ Eo(t),
2316
+ e.length > 1 && n === 0 && " <-- This element declared `pointer-events: none`",
2317
+ e.length > 1 && n === e.length - 1 && " <-- Asserted pointer events here"
2318
+ ].filter(Boolean).join("")).join(`
2319
+ `);
2320
+ }
2321
+ function Eo(e) {
2322
+ var t;
2323
+ let n;
2324
+ if (e.hasAttribute("aria-label"))
2325
+ n = e.getAttribute("aria-label");
2326
+ else if (e.hasAttribute("aria-labelledby")) {
2327
+ var o, i;
2328
+ n = (i = e.ownerDocument.getElementById(e.getAttribute("aria-labelledby"))) === null || i === void 0 || (o = i.textContent) === null || o === void 0 ? void 0 : o.trim();
2329
+ } else if (d(e, [
2330
+ "button",
2331
+ "input",
2332
+ "meter",
2333
+ "output",
2334
+ "progress",
2335
+ "select",
2336
+ "textarea"
2337
+ ]) && (!((t = e.labels) === null || t === void 0) && t.length))
2338
+ n = Array.from(e.labels).map((s) => {
2339
+ var u;
2340
+ return (u = s.textContent) === null || u === void 0 ? void 0 : u.trim();
2341
+ }).join("|");
2342
+ else if (d(e, "button")) {
2343
+ var r;
2344
+ n = (r = e.textContent) === null || r === void 0 ? void 0 : r.trim();
2345
+ }
2346
+ return n = n == null ? void 0 : n.replace(/\n/g, " "), Number(n == null ? void 0 : n.length) > 30 && (n = `${n == null ? void 0 : n.substring(0, 29)}…`), n ? `(label=${n})` : "";
2347
+ }
2348
+ function it(e, t) {
2349
+ return (e & t) > 0;
2350
+ }
2351
+ function S(e, t, n) {
2352
+ return t in e ? Object.defineProperty(e, t, {
2353
+ value: n,
2354
+ enumerable: !0,
2355
+ configurable: !0,
2356
+ writable: !0
2357
+ }) : e[t] = n, e;
2358
+ }
2359
+ class wo {
2360
+ init(t) {
2361
+ const n = this.getTarget(t), [, o] = le(null, n), i = this.getEventInit();
2362
+ return ce(t, n), t.dispatchUIEvent(n, "pointerover", i), o.forEach((r) => t.dispatchUIEvent(r, "pointerenter", i)), this;
2363
+ }
2364
+ move(t, n) {
2365
+ const o = this.position, i = this.getTarget(t);
2366
+ if (this.position = n, !Lt(o, n))
2367
+ return;
2368
+ const r = this.getTarget(t), s = this.getEventInit(-1), [u, c] = le(i, r);
2369
+ return {
2370
+ leave: () => {
2371
+ Ie(t, i) && i !== r && (t.dispatchUIEvent(i, "pointerout", s), u.forEach((l) => t.dispatchUIEvent(l, "pointerleave", s)));
2372
+ },
2373
+ enter: () => {
2374
+ ce(t, r), i !== r && (t.dispatchUIEvent(r, "pointerover", s), c.forEach((l) => t.dispatchUIEvent(l, "pointerenter", s)));
2375
+ },
2376
+ move: () => {
2377
+ t.dispatchUIEvent(r, "pointermove", s);
2378
+ }
2379
+ };
2380
+ }
2381
+ down(t, n = 0) {
2382
+ if (this.isDown)
2383
+ return;
2384
+ const o = this.getTarget(t);
2385
+ ce(t, o), this.isDown = !0, this.isPrevented = !t.dispatchUIEvent(o, "pointerdown", this.getEventInit(n));
2386
+ }
2387
+ up(t, n = 0) {
2388
+ if (!this.isDown)
2389
+ return;
2390
+ const o = this.getTarget(t);
2391
+ ce(t, o), this.isPrevented = !1, this.isDown = !1, t.dispatchUIEvent(o, "pointerup", this.getEventInit(n));
2392
+ }
2393
+ release(t) {
2394
+ const n = this.getTarget(t), [o] = le(n, null), i = this.getEventInit();
2395
+ Ie(t, n) && (t.dispatchUIEvent(n, "pointerout", i), o.forEach((r) => t.dispatchUIEvent(r, "pointerleave", i))), this.isCancelled = !0;
2396
+ }
2397
+ getTarget(t) {
2398
+ var n;
2399
+ return (n = this.position.target) !== null && n !== void 0 ? n : t.config.document.body;
2400
+ }
2401
+ getEventInit(t) {
2402
+ return {
2403
+ ...this.position.coords,
2404
+ pointerId: this.pointerId,
2405
+ pointerType: this.pointerType,
2406
+ isPrimary: this.isPrimary,
2407
+ button: xe(t),
2408
+ buttons: this.buttons.getButtons()
2409
+ };
2410
+ }
2411
+ constructor({ pointerId: t, pointerType: n, isPrimary: o }, i) {
2412
+ S(this, "pointerId", void 0), S(this, "pointerType", void 0), S(this, "isPrimary", void 0), S(this, "buttons", void 0), S(this, "isMultitouch", !1), S(this, "isCancelled", !1), S(this, "isDown", !1), S(this, "isPrevented", !1), S(this, "position", {}), this.pointerId = t, this.pointerType = n, this.isPrimary = o, this.isMultitouch = !o, this.buttons = i;
2413
+ }
2414
+ }
2415
+ function A(e, t, n) {
2416
+ return t in e ? Object.defineProperty(e, t, {
2417
+ value: n,
2418
+ enumerable: !0,
2419
+ configurable: !0,
2420
+ writable: !0
2421
+ }) : e[t] = n, e;
2422
+ }
2423
+ class ko {
2424
+ isKeyPressed(t) {
2425
+ return this.devices.get(t.pointerType).isPressed(t);
2426
+ }
2427
+ async press(t, n, o) {
2428
+ this.devices.get(n.pointerType).addPressed(n), this.buttons.down(n);
2429
+ const i = this.getPointerName(n), r = n.pointerType === "touch" ? this.pointers.new(i, n.pointerType, this.buttons) : this.pointers.get(i);
2430
+ r.position = o, r.pointerType !== "touch" && (this.mouse.position = o), r.pointerType === "touch" && r.init(t), r.down(t, n.button), r.pointerType !== "touch" && this.mouse.down(t, n, r.isPrevented);
2431
+ }
2432
+ async move(t, n, o) {
2433
+ const i = this.pointers.get(n), r = i.move(t, o), s = i.pointerType === "touch" ? void 0 : this.mouse.move(t, o, i.isPrevented);
2434
+ r == null || r.leave(), s == null || s.leave(), r == null || r.enter(), s == null || s.enter(), r == null || r.move(), s == null || s.move();
2435
+ }
2436
+ async release(t, n, o) {
2437
+ const i = this.devices.get(n.pointerType);
2438
+ i.removePressed(n), this.buttons.up(n);
2439
+ const r = this.pointers.get(this.getPointerName(n)), s = r.isPrevented;
2440
+ if (r.position = o, r.pointerType !== "touch" && (this.mouse.position = o), i.countPressed === 0 && r.up(t, n.button), r.pointerType === "touch" && r.release(t), r.pointerType === "touch" && !r.isMultitouch) {
2441
+ const u = this.mouse.move(t, o, s);
2442
+ u == null || u.leave(), u == null || u.enter(), u == null || u.move(), this.mouse.down(t, n, s);
2443
+ }
2444
+ if (!r.isMultitouch) {
2445
+ const u = this.mouse.move(t, o, s);
2446
+ u == null || u.leave(), u == null || u.enter(), u == null || u.move(), this.mouse.up(t, n, s);
2447
+ }
2448
+ }
2449
+ getPointerName(t) {
2450
+ return t.pointerType === "touch" ? t.name : t.pointerType;
2451
+ }
2452
+ getPreviousPosition(t) {
2453
+ return this.pointers.has(t) ? this.pointers.get(t).position : void 0;
2454
+ }
2455
+ resetClickCount() {
2456
+ this.mouse.resetClickCount();
2457
+ }
2458
+ getMouseTarget(t) {
2459
+ var n;
2460
+ return (n = this.mouse.position.target) !== null && n !== void 0 ? n : t.config.document.body;
2461
+ }
2462
+ setMousePosition(t) {
2463
+ this.mouse.position = t, this.pointers.get("mouse").position = t;
2464
+ }
2465
+ constructor(t) {
2466
+ A(this, "system", void 0), A(this, "mouse", void 0), A(this, "buttons", void 0), A(this, "devices", new class {
2467
+ get(n) {
2468
+ var o, i, r;
2469
+ return (r = (o = this.registry)[i = n]) !== null && r !== void 0 ? r : o[i] = new po();
2470
+ }
2471
+ constructor() {
2472
+ A(this, "registry", {});
2473
+ }
2474
+ }()), A(this, "pointers", new class {
2475
+ new(n, o, i) {
2476
+ const r = o !== "touch" || !Object.values(this.registry).some((s) => s.pointerType === "touch" && !s.isCancelled);
2477
+ return r || Object.values(this.registry).forEach((s) => {
2478
+ s.pointerType === o && !s.isCancelled && (s.isMultitouch = !0);
2479
+ }), this.registry[n] = new wo({
2480
+ pointerId: this.nextId++,
2481
+ pointerType: o,
2482
+ isPrimary: r
2483
+ }, i), this.registry[n];
2484
+ }
2485
+ get(n) {
2486
+ if (!this.has(n))
2487
+ throw new Error(`Trying to access pointer "${n}" which does not exist.`);
2488
+ return this.registry[n];
2489
+ }
2490
+ has(n) {
2491
+ return n in this.registry;
2492
+ }
2493
+ constructor() {
2494
+ A(this, "registry", {}), A(this, "nextId", 1);
2495
+ }
2496
+ }()), this.system = t, this.buttons = new Nt(), this.mouse = new go(), this.pointers.new("mouse", "mouse", this.buttons);
2497
+ }
2498
+ }
2499
+ function rt(e, t, n) {
2500
+ return t in e ? Object.defineProperty(e, t, {
2501
+ value: n,
2502
+ enumerable: !0,
2503
+ configurable: !0,
2504
+ writable: !0
2505
+ }) : e[t] = n, e;
2506
+ }
2507
+ class Ft {
2508
+ getUIEventModifiers() {
2509
+ return {
2510
+ altKey: this.keyboard.modifiers.Alt,
2511
+ ctrlKey: this.keyboard.modifiers.Control,
2512
+ metaKey: this.keyboard.modifiers.Meta,
2513
+ shiftKey: this.keyboard.modifiers.Shift,
2514
+ modifierAltGraph: this.keyboard.modifiers.AltGraph,
2515
+ modifierCapsLock: this.keyboard.modifiers.CapsLock,
2516
+ modifierFn: this.keyboard.modifiers.Fn,
2517
+ modifierFnLock: this.keyboard.modifiers.FnLock,
2518
+ modifierNumLock: this.keyboard.modifiers.NumLock,
2519
+ modifierScrollLock: this.keyboard.modifiers.ScrollLock,
2520
+ modifierSymbol: this.keyboard.modifiers.Symbol,
2521
+ modifierSymbolLock: this.keyboard.modifiers.SymbolLock
2522
+ };
2523
+ }
2524
+ constructor() {
2525
+ rt(this, "keyboard", new uo(this)), rt(this, "pointer", new ko(this));
2526
+ }
2527
+ }
2528
+ async function To(e) {
2529
+ const t = [];
2530
+ return this.config.skipHover || t.push({
2531
+ target: e
2532
+ }), t.push({
2533
+ keys: "[MouseLeft]",
2534
+ target: e
2535
+ }), this.pointer(t);
2536
+ }
2537
+ async function Co(e) {
2538
+ return this.pointer([
2539
+ {
2540
+ target: e
2541
+ },
2542
+ "[MouseLeft][MouseLeft]"
2543
+ ]);
2544
+ }
2545
+ async function Io(e) {
2546
+ return this.pointer([
2547
+ {
2548
+ target: e
2549
+ },
2550
+ "[MouseLeft][MouseLeft][MouseLeft]"
2551
+ ]);
2552
+ }
2553
+ async function So(e) {
2554
+ return this.pointer({
2555
+ target: e
2556
+ });
2557
+ }
2558
+ async function _o(e) {
2559
+ return ce(this, this.system.pointer.getMouseTarget(this)), this.pointer({
2560
+ target: e.ownerDocument.body
2561
+ });
2562
+ }
2563
+ async function Po({ shift: e } = {}) {
2564
+ return this.keyboard(e === !0 ? "{Shift>}{Tab}{/Shift}" : e === !1 ? "[/ShiftLeft][/ShiftRight]{Tab}" : "{Tab}");
2565
+ }
2566
+ const Bt = {
2567
+ "{": "}",
2568
+ "[": "]"
2569
+ };
2570
+ function Vt(e, t) {
2571
+ let n = 0;
2572
+ const o = e[n] in Bt ? e[n] : "";
2573
+ n += o.length;
2574
+ const r = new RegExp(`^\\${o}{2}`).test(e) ? "" : o;
2575
+ return {
2576
+ type: r,
2577
+ ...r === "" ? Ao(e, n, t) : Oo(e, n, r, t)
2578
+ };
2579
+ }
2580
+ function Ao(e, t, n) {
2581
+ const o = e[t];
2582
+ return Kt(o, e, t, n), t += o.length, {
2583
+ consumedLength: t,
2584
+ descriptor: o,
2585
+ releasePrevious: !1,
2586
+ releaseSelf: !0,
2587
+ repeat: 1
2588
+ };
2589
+ }
2590
+ function Oo(e, t, n, o) {
2591
+ var i, r, s;
2592
+ const u = e[t] === "/" ? "/" : "";
2593
+ t += u.length;
2594
+ const c = n === "{" && e[t] === "\\";
2595
+ t += Number(c);
2596
+ const l = c ? e[t] : (r = e.slice(t).match(n === "{" ? /^\w+|^[^}>/]/ : /^\w+/)) === null || r === void 0 ? void 0 : r[0];
2597
+ Kt(l, e, t, o), t += l.length;
2598
+ const a = (i = (s = e.slice(t).match(/^>\d+/)) === null || s === void 0 ? void 0 : s[0]) !== null && i !== void 0 ? i : "";
2599
+ t += a.length;
2600
+ const f = e[t] === "/" || !a && e[t] === ">" ? e[t] : "";
2601
+ t += f.length;
2602
+ const p = Bt[n], h = e[t] === p ? p : "";
2603
+ if (!h)
2604
+ throw new Error(Rt([
2605
+ !a && "repeat modifier",
2606
+ !f && "release modifier",
2607
+ `"${p}"`
2608
+ ].filter(Boolean).join(" or "), e[t], e, o));
2609
+ return t += h.length, {
2610
+ consumedLength: t,
2611
+ descriptor: l,
2612
+ releasePrevious: !!u,
2613
+ repeat: a ? Math.max(Number(a.substr(1)), 1) : 1,
2614
+ releaseSelf: Uo(f, a)
2615
+ };
2616
+ }
2617
+ function Kt(e, t, n, o) {
2618
+ if (!e)
2619
+ throw new Error(Rt("key descriptor", t[n], t, o));
2620
+ }
2621
+ function Uo(e, t) {
2622
+ if (e)
2623
+ return e === "/";
2624
+ if (t)
2625
+ return !1;
2626
+ }
2627
+ function Rt(e, t, n, o) {
2628
+ return `Expected ${e} but found "${t ?? ""}" in "${n}"
2629
+ See ${o === "pointer" ? "https://testing-library.com/docs/user-event/pointer#pressing-a-button-or-touching-the-screen" : "https://testing-library.com/docs/user-event/keyboard"}
2630
+ for more information about how userEvent parses your input.`;
2631
+ }
2632
+ function Do(e, t) {
2633
+ const n = [];
2634
+ do {
2635
+ var o;
2636
+ const { type: i, descriptor: r, consumedLength: s, releasePrevious: u, releaseSelf: c = !0, repeat: l } = Vt(t, "keyboard"), a = (o = e.find((f) => {
2637
+ if (i === "[") {
2638
+ var p;
2639
+ return ((p = f.code) === null || p === void 0 ? void 0 : p.toLowerCase()) === r.toLowerCase();
2640
+ } else if (i === "{") {
2641
+ var h;
2642
+ return ((h = f.key) === null || h === void 0 ? void 0 : h.toLowerCase()) === r.toLowerCase();
2643
+ }
2644
+ return f.key === r;
2645
+ })) !== null && o !== void 0 ? o : {
2646
+ key: "Unknown",
2647
+ code: "Unknown",
2648
+ [i === "[" ? "code" : "key"]: r
2649
+ };
2650
+ n.push({
2651
+ keyDef: a,
2652
+ releasePrevious: u,
2653
+ releaseSelf: c,
2654
+ repeat: l
2655
+ }), t = t.slice(s);
2656
+ } while (t);
2657
+ return n;
2658
+ }
2659
+ async function xo(e) {
2660
+ const t = Do(this.config.keyboardMap, e);
2661
+ for (let n = 0; n < t.length; n++)
2662
+ await Y(this.config), await No(this, t[n]);
2663
+ }
2664
+ async function No(e, { keyDef: t, releasePrevious: n, releaseSelf: o, repeat: i }) {
2665
+ const { system: r } = e;
2666
+ if (r.keyboard.isKeyPressed(t) && await r.keyboard.keyup(e, t), !n) {
2667
+ for (let s = 1; s <= i; s++)
2668
+ await r.keyboard.keydown(e, t, s > 1), s < i && await Y(e.config);
2669
+ o && await r.keyboard.keyup(e, t);
2670
+ }
2671
+ }
2672
+ async function Mo(e) {
2673
+ for (const t of e.system.keyboard.getPressedKeys())
2674
+ await e.system.keyboard.keyup(e, t);
2675
+ }
2676
+ function jt(e) {
2677
+ const t = C(e) ? {
2678
+ "text/plain": Lo(e)
2679
+ } : {
2680
+ "text/plain": String(e.ownerDocument.getSelection())
2681
+ }, n = Le(E(e));
2682
+ for (const o in t)
2683
+ t[o] && n.setData(o, t[o]);
2684
+ return n;
2685
+ }
2686
+ function Lo(e) {
2687
+ const t = de(e);
2688
+ return I(e).substring(t.startOffset, t.endOffset);
2689
+ }
2690
+ async function $o() {
2691
+ var e;
2692
+ const t = this.config.document, n = (e = t.activeElement) !== null && e !== void 0 ? e : (
2693
+ /* istanbul ignore next */
2694
+ t.body
2695
+ ), o = jt(n);
2696
+ if (o.items.length !== 0)
2697
+ return this.dispatchUIEvent(n, "copy", {
2698
+ clipboardData: o
2699
+ }) && this.config.writeToClipboard && await ht(t, o), o;
2700
+ }
2701
+ async function Fo() {
2702
+ var e;
2703
+ const t = this.config.document, n = (e = t.activeElement) !== null && e !== void 0 ? e : (
2704
+ /* istanbul ignore next */
2705
+ t.body
2706
+ ), o = jt(n);
2707
+ if (o.items.length !== 0)
2708
+ return this.dispatchUIEvent(n, "cut", {
2709
+ clipboardData: o
2710
+ }) && this.config.writeToClipboard && await ht(n.ownerDocument, o), o;
2711
+ }
2712
+ async function Bo(e) {
2713
+ var t, n;
2714
+ const o = this.config.document, i = (t = o.activeElement) !== null && t !== void 0 ? t : (
2715
+ /* istanbul ignore next */
2716
+ o.body
2717
+ ), r = (n = typeof e == "string" ? Vo(o, e) : e) !== null && n !== void 0 ? n : await sn(o).catch(() => {
2718
+ throw new Error("`userEvent.paste()` without `clipboardData` requires the `ClipboardAPI` to be available.");
2719
+ });
2720
+ this.dispatchUIEvent(i, "paste", {
2721
+ clipboardData: r
2722
+ });
2723
+ }
2724
+ function Vo(e, t) {
2725
+ const n = Le(E(e));
2726
+ return n.setData("text", t), n;
2727
+ }
2728
+ function st(e, t) {
2729
+ const n = [];
2730
+ do {
2731
+ const { descriptor: o, consumedLength: i, releasePrevious: r, releaseSelf: s = !0 } = Vt(t, "pointer"), u = e.find((c) => c.name === o);
2732
+ u && n.push({
2733
+ keyDef: u,
2734
+ releasePrevious: r,
2735
+ releaseSelf: s
2736
+ }), t = t.slice(i);
2737
+ } while (t);
2738
+ return n;
2739
+ }
2740
+ async function Ko(e) {
2741
+ const { pointerMap: t } = this.config, n = [];
2742
+ (Array.isArray(e) ? e : [
2743
+ e
2744
+ ]).forEach((o) => {
2745
+ typeof o == "string" ? n.push(...st(t, o)) : "keys" in o ? n.push(...st(t, o.keys).map((i) => ({
2746
+ ...o,
2747
+ ...i
2748
+ }))) : n.push(o);
2749
+ });
2750
+ for (let o = 0; o < n.length; o++)
2751
+ await Y(this.config), await Ro(this, n[o]);
2752
+ this.system.pointer.resetClickCount();
2753
+ }
2754
+ async function Ro(e, t) {
2755
+ var n, o, i, r, s, u;
2756
+ const c = "pointerName" in t && t.pointerName ? t.pointerName : "keyDef" in t ? e.system.pointer.getPointerName(t.keyDef) : "mouse", l = e.system.pointer.getPreviousPosition(c), a = {
2757
+ target: (n = t.target) !== null && n !== void 0 ? n : jo(e, l),
2758
+ coords: (o = t.coords) !== null && o !== void 0 ? o : l == null ? void 0 : l.coords,
2759
+ caret: {
2760
+ node: (i = t.node) !== null && i !== void 0 ? i : ut(t) || l == null || (s = l.caret) === null || s === void 0 ? void 0 : s.node,
2761
+ offset: (r = t.offset) !== null && r !== void 0 ? r : ut(t) || l == null || (u = l.caret) === null || u === void 0 ? void 0 : u.offset
2762
+ }
2763
+ };
2764
+ "keyDef" in t ? (e.system.pointer.isKeyPressed(t.keyDef) && (ue(e, m.Trigger), await e.system.pointer.release(e, t.keyDef, a)), t.releasePrevious || (ue(e, m.Trigger), await e.system.pointer.press(e, t.keyDef, a), t.releaseSelf && (ue(e, m.Trigger), await e.system.pointer.release(e, t.keyDef, a)))) : (ue(e, m.Trigger), await e.system.pointer.move(e, c, a));
2765
+ }
2766
+ function ut(e) {
2767
+ var t, n;
2768
+ return !!((t = (n = e.target) !== null && n !== void 0 ? n : e.node) !== null && t !== void 0 ? t : e.offset !== void 0);
2769
+ }
2770
+ function jo(e, t) {
2771
+ var n;
2772
+ if (!t)
2773
+ throw new Error("This pointer has no previous position. Provide a target property!");
2774
+ return (n = t.target) !== null && n !== void 0 ? n : e.config.document.body;
2775
+ }
2776
+ async function Ho(e) {
2777
+ if (!G(e) || P(e))
2778
+ throw new Error("clear()` is only supported on editable elements.");
2779
+ if (U(e), e.ownerDocument.activeElement !== e)
2780
+ throw new Error("The element to be cleared could not be focused.");
2781
+ if (_t(e), !Fn(e))
2782
+ throw new Error("The element content to be cleared could not be selected.");
2783
+ W(this, e, "", "deleteContentBackward");
2784
+ }
2785
+ async function Go(e, t) {
2786
+ return Ht.call(this, !0, e, t);
2787
+ }
2788
+ async function Xo(e, t) {
2789
+ return Ht.call(this, !1, e, t);
2790
+ }
2791
+ async function Ht(e, t, n) {
2792
+ if (!e && !t.multiple)
2793
+ throw V().getElementError("Unable to deselect an option in a non-multiple select. Use selectOptions to change the selection instead.", t);
2794
+ const o = Array.isArray(n) ? n : [
2795
+ n
2796
+ ], i = Array.from(t.querySelectorAll('option, [role="option"]')), r = o.map((u) => {
2797
+ if (typeof u != "string" && i.includes(u))
2798
+ return u;
2799
+ {
2800
+ const c = i.find((l) => l.value === u || l.innerHTML === u);
2801
+ if (c)
2802
+ return c;
2803
+ throw V().getElementError(`Value "${String(u)}" not found in options`, t);
2804
+ }
2805
+ }).filter((u) => !P(u));
2806
+ if (P(t) || !r.length) return;
2807
+ const s = (u) => {
2808
+ u.selected = e, this.dispatchUIEvent(t, "input", {
2809
+ bubbles: !0,
2810
+ cancelable: !1,
2811
+ composed: !0
2812
+ }), this.dispatchUIEvent(t, "change");
2813
+ };
2814
+ if (d(t, "select"))
2815
+ if (t.multiple)
2816
+ for (const u of r) {
2817
+ const c = this.config.pointerEventsCheck === 0 ? !0 : Ie(this, u);
2818
+ c && (this.dispatchUIEvent(u, "pointerover"), this.dispatchUIEvent(t, "pointerenter"), this.dispatchUIEvent(u, "mouseover"), this.dispatchUIEvent(t, "mouseenter"), this.dispatchUIEvent(u, "pointermove"), this.dispatchUIEvent(u, "mousemove"), this.dispatchUIEvent(u, "pointerdown"), this.dispatchUIEvent(u, "mousedown")), U(t), c && (this.dispatchUIEvent(u, "pointerup"), this.dispatchUIEvent(u, "mouseup")), s(u), c && this.dispatchUIEvent(u, "click"), await Y(this.config);
2819
+ }
2820
+ else if (r.length === 1) {
2821
+ const u = this.config.pointerEventsCheck === 0 ? !0 : Ie(this, t);
2822
+ u ? await this.click(t) : U(t), s(r[0]), u && (this.dispatchUIEvent(t, "pointerover"), this.dispatchUIEvent(t, "pointerenter"), this.dispatchUIEvent(t, "mouseover"), this.dispatchUIEvent(t, "mouseenter"), this.dispatchUIEvent(t, "pointerup"), this.dispatchUIEvent(t, "mouseup"), this.dispatchUIEvent(t, "click")), await Y(this.config);
2823
+ } else
2824
+ throw V().getElementError("Cannot select multiple options on a non-multiple select", t);
2825
+ else if (t.getAttribute("role") === "listbox")
2826
+ for (const u of r)
2827
+ await this.click(u), await this.unhover(u);
2828
+ else
2829
+ throw V().getElementError("Cannot select options on elements that are neither select nor listbox elements", t);
2830
+ }
2831
+ async function zo(e, t, { skipClick: n = this.config.skipClick, skipAutoClose: o = this.config.skipAutoClose, initialSelectionStart: i, initialSelectionEnd: r } = {}) {
2832
+ e.disabled || (n || await this.click(e), i !== void 0 && se(e, i, r ?? i), await this.keyboard(t), o || await Mo(this));
2833
+ }
2834
+ const ct = Symbol("files and value properties are mocked");
2835
+ function Oe(e, t, n) {
2836
+ n ? Object.defineProperty(e, t, n) : delete e[t];
2837
+ }
2838
+ function Wo(e, t) {
2839
+ var n;
2840
+ (n = e[ct]) === null || n === void 0 || n.restore();
2841
+ const o = Object.getOwnPropertyDescriptor(e, "type"), i = Object.getOwnPropertyDescriptor(e, "value"), r = Object.getOwnPropertyDescriptor(e, "files");
2842
+ function s() {
2843
+ Oe(e, "type", o), Oe(e, "value", i), Oe(e, "files", r);
2844
+ }
2845
+ e[ct] = {
2846
+ restore: s
2847
+ }, Object.defineProperties(e, {
2848
+ files: {
2849
+ configurable: !0,
2850
+ get: () => t
2851
+ },
2852
+ value: {
2853
+ configurable: !0,
2854
+ get: () => t.length ? `C:\\fakepath\\${t[0].name}` : "",
2855
+ set(u) {
2856
+ if (u === "")
2857
+ s();
2858
+ else {
2859
+ var c;
2860
+ i == null || (c = i.set) === null || c === void 0 || c.call(e, u);
2861
+ }
2862
+ }
2863
+ },
2864
+ type: {
2865
+ configurable: !0,
2866
+ get: () => "file",
2867
+ set(u) {
2868
+ u !== "file" && (s(), e.type = u);
2869
+ }
2870
+ }
2871
+ });
2872
+ }
2873
+ async function Yo(e, t) {
2874
+ const n = d(e, "label") ? e.control : e;
2875
+ if (!n || !d(n, "input", {
2876
+ type: "file"
2877
+ }))
2878
+ throw new TypeError(`The ${n === e ? "given" : "associated"} ${n == null ? void 0 : n.tagName} element does not accept file uploads`);
2879
+ if (P(e)) return;
2880
+ const o = (Array.isArray(t) ? t : [
2881
+ t
2882
+ ]).filter((r) => !this.config.applyAccept || qo(r, n.accept)).slice(0, n.multiple ? void 0 : 1), i = () => {
2883
+ var r;
2884
+ o.length === ((r = n.files) === null || r === void 0 ? void 0 : r.length) && o.every((s, u) => {
2885
+ var c;
2886
+ return s === ((c = n.files) === null || c === void 0 ? void 0 : c.item(u));
2887
+ }) || (Wo(n, Me(E(e), o)), this.dispatchUIEvent(n, "input"), this.dispatchUIEvent(n, "change"));
2888
+ };
2889
+ n.addEventListener("fileDialog", i), await this.click(e), n.removeEventListener("fileDialog", i);
2890
+ }
2891
+ function ge(e) {
2892
+ return e.toLowerCase().replace(/(\.|\/)jpg\b/g, "$1jpeg");
2893
+ }
2894
+ function qo(e, t) {
2895
+ if (!t)
2896
+ return !0;
2897
+ const n = [
2898
+ "audio/*",
2899
+ "image/*",
2900
+ "video/*"
2901
+ ];
2902
+ return ge(t).trim().split(/\s*,\s*/).some((o) => o.startsWith(".") ? ge(e.name).endsWith(o) : n.includes(o) ? ge(e.type).startsWith(o.replace("*", "")) : ge(e.type) === o);
2903
+ }
2904
+ const lt = {
2905
+ click: To,
2906
+ dblClick: Co,
2907
+ tripleClick: Io,
2908
+ hover: So,
2909
+ unhover: _o,
2910
+ tab: Po,
2911
+ keyboard: xo,
2912
+ copy: $o,
2913
+ cut: Fo,
2914
+ paste: Bo,
2915
+ pointer: Ko,
2916
+ clear: Ho,
2917
+ deselectOptions: Xo,
2918
+ selectOptions: Go,
2919
+ type: zo,
2920
+ upload: Yo
2921
+ };
2922
+ function Jo(e) {
2923
+ return V().asyncWrapper(e);
2924
+ }
2925
+ const Gt = {
2926
+ applyAccept: !0,
2927
+ autoModify: !0,
2928
+ delay: 0,
2929
+ document: globalThis.document,
2930
+ keyboardMap: co,
2931
+ pointerMap: lo,
2932
+ pointerEventsCheck: we.EachApiCall,
2933
+ skipAutoClose: !1,
2934
+ skipClick: !1,
2935
+ skipHover: !1,
2936
+ writeToClipboard: !1,
2937
+ advanceTimers: () => Promise.resolve()
2938
+ }, Zo = {
2939
+ ...Gt,
2940
+ writeToClipboard: !0
2941
+ };
2942
+ function Xt(e = {}, t = Zo, n) {
2943
+ const o = ni(e, n, t);
2944
+ return {
2945
+ ...t,
2946
+ ...e,
2947
+ document: o
2948
+ };
2949
+ }
2950
+ function Qo(e = {}) {
2951
+ var t;
2952
+ const n = Xt(e);
2953
+ xt(n.document), Dt(E(n.document).HTMLElement);
2954
+ const o = (t = n.document.defaultView) !== null && t !== void 0 ? t : (
2955
+ /* istanbul ignore next */
2956
+ globalThis.window
2957
+ );
2958
+ return nn(o), Ke(n).api;
2959
+ }
2960
+ function b({ keyboardState: e, pointerState: t, ...n } = {}, o) {
2961
+ var i;
2962
+ const r = Xt(n, Gt, o);
2963
+ xt(r.document), Dt(E(r.document).HTMLElement);
2964
+ const s = (i = t ?? e) !== null && i !== void 0 ? i : new Ft();
2965
+ return {
2966
+ api: Ke(r, s).api,
2967
+ system: s
2968
+ };
2969
+ }
2970
+ function ei(e) {
2971
+ return Ke({
2972
+ ...this.config,
2973
+ ...e
2974
+ }, this.system).api;
2975
+ }
2976
+ function ti(e, t) {
2977
+ function n(...o) {
2978
+ return ue(e, m.Call), Jo(() => t.apply(e, o).then(async (i) => (await Y(e.config), i)));
2979
+ }
2980
+ return Object.defineProperty(n, "name", {
2981
+ get: () => t.name
2982
+ }), n;
2983
+ }
2984
+ function Ke(e, t = new Ft()) {
2985
+ const n = {};
2986
+ return Object.assign(n, {
2987
+ config: e,
2988
+ dispatchEvent: Ut.bind(n),
2989
+ dispatchUIEvent: Zn.bind(n),
2990
+ system: t,
2991
+ levelRefs: {},
2992
+ ...lt
2993
+ }), {
2994
+ instance: n,
2995
+ api: {
2996
+ ...Object.fromEntries(Object.entries(lt).map(([o, i]) => [
2997
+ o,
2998
+ ti(n, i)
2999
+ ])),
3000
+ setup: ei.bind(n)
3001
+ }
3002
+ };
3003
+ }
3004
+ function ni(e, t, n) {
3005
+ var o, i;
3006
+ return (o = (i = e.document) !== null && i !== void 0 ? i : t && oo(t)) !== null && o !== void 0 ? o : n.document;
3007
+ }
3008
+ function oi(e) {
3009
+ return b().api.clear(e);
3010
+ }
3011
+ function ii(e, t = {}) {
3012
+ return b(t, e).api.click(e);
3013
+ }
3014
+ function ri(e = {}) {
3015
+ return b(e).api.copy();
3016
+ }
3017
+ function si(e = {}) {
3018
+ return b(e).api.cut();
3019
+ }
3020
+ function ui(e, t = {}) {
3021
+ return b(t).api.dblClick(e);
3022
+ }
3023
+ function ci(e, t, n = {}) {
3024
+ return b(n).api.deselectOptions(e, t);
3025
+ }
3026
+ function li(e, t = {}) {
3027
+ return b(t).api.hover(e);
3028
+ }
3029
+ async function ai(e, t = {}) {
3030
+ const { api: n, system: o } = b(t);
3031
+ return n.keyboard(e).then(() => o);
3032
+ }
3033
+ async function di(e, t = {}) {
3034
+ const { api: n, system: o } = b(t);
3035
+ return n.pointer(e).then(() => o);
3036
+ }
3037
+ function fi(e, t) {
3038
+ return b(t).api.paste(e);
3039
+ }
3040
+ function pi(e, t, n = {}) {
3041
+ return b(n).api.selectOptions(e, t);
3042
+ }
3043
+ function hi(e, t = {}) {
3044
+ return b(t).api.tripleClick(e);
3045
+ }
3046
+ function vi(e, t, n = {}) {
3047
+ return b(n, e).api.type(e, t, n);
3048
+ }
3049
+ function bi(e, t = {}) {
3050
+ const { api: n, system: o } = b(t);
3051
+ return o.pointer.setMousePosition({
3052
+ target: e
3053
+ }), n.unhover(e);
3054
+ }
3055
+ function gi(e, t, n = {}) {
3056
+ return b(n).api.upload(e, t);
3057
+ }
3058
+ function yi(e = {}) {
3059
+ return b().api.tab(e);
3060
+ }
3061
+ const mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3062
+ __proto__: null,
3063
+ clear: oi,
3064
+ click: ii,
3065
+ copy: ri,
3066
+ cut: si,
3067
+ dblClick: ui,
3068
+ deselectOptions: ci,
3069
+ hover: li,
3070
+ keyboard: ai,
3071
+ paste: fi,
3072
+ pointer: di,
3073
+ selectOptions: pi,
3074
+ tab: yi,
3075
+ tripleClick: hi,
3076
+ type: vi,
3077
+ unhover: bi,
3078
+ upload: gi
3079
+ }, Symbol.toStringTag, { value: "Module" })), Bi = {
3080
+ ...mi,
3081
+ setup: Qo
3082
+ };
3083
+ export {
3084
+ Bi as u
3085
+ };