@openstage/glyph-element 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/THIRD-PARTY-NOTICES.md +1505 -0
  2. package/dist/chunks/bash-Dw1nAEst.js +171 -0
  3. package/dist/chunks/bash-Dw1nAEst.js.map +1 -0
  4. package/dist/chunks/csharp-D8ELXkGi.js +262 -0
  5. package/dist/chunks/csharp-D8ELXkGi.js.map +1 -0
  6. package/dist/chunks/css-DQEU4whB.js +142 -0
  7. package/dist/chunks/css-DQEU4whB.js.map +1 -0
  8. package/dist/chunks/fsharp-D4SqCnMZ.js +242 -0
  9. package/dist/chunks/fsharp-D4SqCnMZ.js.map +1 -0
  10. package/dist/chunks/go-BJIB22rX.js +142 -0
  11. package/dist/chunks/go-BJIB22rX.js.map +1 -0
  12. package/dist/chunks/haskell-eGGgAkgA.js +140 -0
  13. package/dist/chunks/haskell-eGGgAkgA.js.map +1 -0
  14. package/dist/chunks/highlight-core-C0K6BIzZ.js +967 -0
  15. package/dist/chunks/highlight-core-C0K6BIzZ.js.map +1 -0
  16. package/dist/chunks/java-DHPUyZsV.js +171 -0
  17. package/dist/chunks/java-DHPUyZsV.js.map +1 -0
  18. package/dist/chunks/javascript-D_CG8suQ.js +438 -0
  19. package/dist/chunks/javascript-D_CG8suQ.js.map +1 -0
  20. package/dist/chunks/json-BD6qkh12.js +38 -0
  21. package/dist/chunks/json-BD6qkh12.js.map +1 -0
  22. package/dist/chunks/kotlin-C75rnxi-.js +203 -0
  23. package/dist/chunks/kotlin-C75rnxi-.js.map +1 -0
  24. package/dist/chunks/markdown-B6LMDWi1.js +183 -0
  25. package/dist/chunks/markdown-B6LMDWi1.js.map +1 -0
  26. package/dist/chunks/ocaml-CMtC1T-S.js +54 -0
  27. package/dist/chunks/ocaml-CMtC1T-S.js.map +1 -0
  28. package/dist/chunks/prosemirror-dAj0dboi.js +7790 -0
  29. package/dist/chunks/prosemirror-dAj0dboi.js.map +1 -0
  30. package/dist/chunks/python-ny4cvzzX.js +240 -0
  31. package/dist/chunks/python-ny4cvzzX.js.map +1 -0
  32. package/dist/chunks/rolldown-runtime-BE9Pkid1.js +13 -0
  33. package/dist/chunks/rust-8OMNiTht.js +171 -0
  34. package/dist/chunks/rust-8OMNiTht.js.map +1 -0
  35. package/dist/chunks/scala-BB851ZJZ.js +164 -0
  36. package/dist/chunks/scala-BB851ZJZ.js.map +1 -0
  37. package/dist/chunks/sql-CoOMeU5k.js +120 -0
  38. package/dist/chunks/sql-CoOMeU5k.js.map +1 -0
  39. package/dist/chunks/tiptap-Cb4W88fy.js +8527 -0
  40. package/dist/chunks/tiptap-Cb4W88fy.js.map +1 -0
  41. package/dist/chunks/typescript-Dh7IycF2.js +523 -0
  42. package/dist/chunks/typescript-Dh7IycF2.js.map +1 -0
  43. package/dist/chunks/vendor-B82PcruV.js +1799 -0
  44. package/dist/chunks/vendor-B82PcruV.js.map +1 -0
  45. package/dist/chunks/xml-BpsgObpu.js +168 -0
  46. package/dist/chunks/xml-BpsgObpu.js.map +1 -0
  47. package/dist/codeblock-backspace.d.ts +3 -0
  48. package/dist/codeblock-backspace.d.ts.map +1 -0
  49. package/dist/document-conversion.d.ts +29 -0
  50. package/dist/document-conversion.d.ts.map +1 -0
  51. package/dist/editor-element.d.ts +93 -0
  52. package/dist/editor-element.d.ts.map +1 -0
  53. package/dist/glyph-editor-element.js +783 -0
  54. package/dist/glyph-editor-element.js.map +1 -0
  55. package/dist/header.d.ts +18 -0
  56. package/dist/header.d.ts.map +1 -0
  57. package/dist/index.d.ts +62 -0
  58. package/dist/index.d.ts.map +1 -0
  59. package/dist/link-dialog.d.ts +29 -0
  60. package/dist/link-dialog.d.ts.map +1 -0
  61. package/dist/safe-href.d.ts +2 -0
  62. package/dist/safe-href.d.ts.map +1 -0
  63. package/dist/slash-menu.d.ts +22 -0
  64. package/dist/slash-menu.d.ts.map +1 -0
  65. package/dist/styles.d.ts +2 -0
  66. package/dist/styles.d.ts.map +1 -0
  67. package/package.json +52 -0
@@ -0,0 +1,1799 @@
1
+ //#region ../../node_modules/monadyssey/dist/monadyssey.mjs
2
+ var e = class {
3
+ static catch(e, r) {
4
+ try {
5
+ return n.pure(e());
6
+ } catch (e) {
7
+ return r ? t.pure(r(e)) : t.pure(((e) => typeof e == "string" ? e : e && typeof e.message == "string" ? e.message : String(e))(e));
8
+ }
9
+ }
10
+ }, t = class t extends e {
11
+ type = "Left";
12
+ self = this;
13
+ constructor(e) {
14
+ super(), this.value = e;
15
+ }
16
+ static pure(e) {
17
+ return new t(e);
18
+ }
19
+ map(e) {
20
+ return this;
21
+ }
22
+ mapLeft(e) {
23
+ return new t(e(this.value));
24
+ }
25
+ flatMap(e) {
26
+ return this;
27
+ }
28
+ getOrElse(e) {
29
+ return e(this.value);
30
+ }
31
+ getOrNull() {
32
+ return null;
33
+ }
34
+ swap() {
35
+ return n.pure(this.value);
36
+ }
37
+ fold(e, t) {
38
+ return e(this.value);
39
+ }
40
+ tap(e) {
41
+ return this;
42
+ }
43
+ tapLeft(e) {
44
+ return e(this.value), this;
45
+ }
46
+ }, n = class n extends e {
47
+ type = "Right";
48
+ self = this;
49
+ constructor(e) {
50
+ super(), this.value = e;
51
+ }
52
+ static pure(e) {
53
+ return new n(e);
54
+ }
55
+ map(e) {
56
+ return new n(e(this.value));
57
+ }
58
+ mapLeft(e) {
59
+ return this;
60
+ }
61
+ flatMap(e) {
62
+ return e(this.value);
63
+ }
64
+ getOrElse(e) {
65
+ return this.value;
66
+ }
67
+ getOrNull() {
68
+ return this.value;
69
+ }
70
+ swap() {
71
+ return t.pure(this.value);
72
+ }
73
+ fold(e, t) {
74
+ return t(this.value);
75
+ }
76
+ tap(e) {
77
+ return e(this.value), this;
78
+ }
79
+ tapLeft(e) {
80
+ return this;
81
+ }
82
+ };
83
+ function r(e) {
84
+ return e;
85
+ }
86
+ var i = class {
87
+ static ofNullable(e) {
88
+ return e == null ? a.Instance : o.pure(e);
89
+ }
90
+ map(e) {
91
+ return this.flatMap((t) => {
92
+ let n = e(t);
93
+ return n == null ? a.Instance : o.pure(n);
94
+ });
95
+ }
96
+ getOrNull() {
97
+ return this.fold(() => null, r);
98
+ }
99
+ getOrElse(e) {
100
+ return this.fold(() => e(), r);
101
+ }
102
+ }, a = class e extends i {
103
+ type = "None";
104
+ self = this;
105
+ static instance = new e();
106
+ constructor() {
107
+ super();
108
+ }
109
+ static get Instance() {
110
+ return e.instance;
111
+ }
112
+ flatMap(e) {
113
+ return this;
114
+ }
115
+ filter(e) {
116
+ return this;
117
+ }
118
+ fold(e, t) {
119
+ return e();
120
+ }
121
+ getOrElse(e) {
122
+ return e();
123
+ }
124
+ getOrNull() {
125
+ return null;
126
+ }
127
+ tap(e) {
128
+ return this;
129
+ }
130
+ tapNone(e) {
131
+ return e(), this;
132
+ }
133
+ }, o = class e extends i {
134
+ type = "Some";
135
+ self = this;
136
+ constructor(e) {
137
+ super(), this.value = e;
138
+ }
139
+ static pure(t) {
140
+ return new e(t);
141
+ }
142
+ flatMap(e) {
143
+ return e(this.value);
144
+ }
145
+ filter(e) {
146
+ return e(this.value) ? this : a.Instance;
147
+ }
148
+ fold(e, t) {
149
+ return t(this.value);
150
+ }
151
+ getOrElse(e) {
152
+ return this.value;
153
+ }
154
+ getOrNull() {
155
+ return this.value;
156
+ }
157
+ tap(e) {
158
+ return e(this.value), this;
159
+ }
160
+ tapNone(e) {
161
+ return this;
162
+ }
163
+ }, s = class e {
164
+ constructor(e, t) {
165
+ this.head = e, this.tail = t;
166
+ }
167
+ static pure(t) {
168
+ return new e(t, []);
169
+ }
170
+ static fromArray(t) {
171
+ if (!t || t.length === 0) throw Error("Cannot construct a NonEmptyList from a null or empty array.");
172
+ let [n, ...r] = t;
173
+ return new e(n, r);
174
+ }
175
+ get size() {
176
+ return 1 + this.tail.length;
177
+ }
178
+ toArray() {
179
+ return [this.head, ...this.tail];
180
+ }
181
+ get init() {
182
+ return this.tail.length === 0 ? [] : [this.head, ...this.tail.slice(0, -1)];
183
+ }
184
+ get last() {
185
+ return this.tail.length > 0 ? this.tail[this.tail.length - 1] : this.head;
186
+ }
187
+ get(e) {
188
+ if (e < 0 || e >= this.size) throw Error(`Index ${e} is out of bounds. Must be between 0 and ${this.size - 1}`);
189
+ return e === 0 ? this.head : this.tail[e - 1];
190
+ }
191
+ map(t) {
192
+ return new e(t(this.head), this.tail.map(t));
193
+ }
194
+ flatMap(t) {
195
+ let n = t(this.head), r = this.tail.flatMap((e) => t(e).toArray());
196
+ return new e(n.head, [...n.tail, ...r]);
197
+ }
198
+ async traverse(t) {
199
+ let [n, ...r] = await Promise.all([t(this.head), ...this.tail.map(t)]);
200
+ return new e(n, r);
201
+ }
202
+ foldLeft(e, t) {
203
+ return this.tail.reduce(t, t(e, this.head));
204
+ }
205
+ foldRight(e, t) {
206
+ return this.toArray().reduceRight((e, n) => t(n, e), e);
207
+ }
208
+ reduce(e) {
209
+ return this.tail.reduce(e, this.head);
210
+ }
211
+ exists(e) {
212
+ return e(this.head) || this.tail.some(e);
213
+ }
214
+ forall(e) {
215
+ return e(this.head) && this.tail.every(e);
216
+ }
217
+ filter(e) {
218
+ let t = [];
219
+ e(this.head) && t.push(this.head);
220
+ for (let n of this.tail) e(n) && t.push(n);
221
+ return t;
222
+ }
223
+ sort(t) {
224
+ let n = this.toArray().sort((e, n) => t(e, n).value);
225
+ return new e(n[0], n.slice(1));
226
+ }
227
+ append(t) {
228
+ return new e(this.head, [...this.tail, t]);
229
+ }
230
+ prepend(t) {
231
+ return new e(t, [this.head, ...this.tail]);
232
+ }
233
+ concat(t) {
234
+ return new e(this.head, [
235
+ ...this.tail,
236
+ t.head,
237
+ ...t.tail
238
+ ]);
239
+ }
240
+ reverse() {
241
+ let t = this.toArray().reverse();
242
+ return new e(t[0], t.slice(1));
243
+ }
244
+ find(e) {
245
+ if (e(this.head)) return o.pure(this.head);
246
+ let t = this.tail.findIndex(e);
247
+ return t === -1 ? a.Instance : o.pure(this.tail[t]);
248
+ }
249
+ toString() {
250
+ return `[${this.toArray().join(", ")}]`;
251
+ }
252
+ }, c = (e = 3, t = 1.2, n = 1e3, r, i = 0) => ({
253
+ recurs: e,
254
+ factor: t,
255
+ delay: n,
256
+ timeout: r,
257
+ jitter: i
258
+ }), l = (e, t, n) => new Promise((r, i) => {
259
+ if (t.aborted) {
260
+ i(n(new _("Operation was cancelled")));
261
+ return;
262
+ }
263
+ let a = setTimeout(() => {
264
+ t.removeEventListener("abort", o), r();
265
+ }, e);
266
+ function o() {
267
+ clearTimeout(a), i(n(new _("Operation was cancelled")));
268
+ }
269
+ t.addEventListener("abort", o, { once: !0 });
270
+ }), u = class {
271
+ policy;
272
+ controller = new AbortController();
273
+ constructor(e = c()) {
274
+ if (e.recurs !== Infinity && (!Number.isFinite(e.recurs) || e.recurs < 1)) throw new f("Policy validation error: 'recurs' must be a positive number >= 1 (or Infinity)");
275
+ if (!Number.isFinite(e.factor) || e.factor < 1) throw new f("Policy validation error: 'factor' must be a finite number >= 1");
276
+ if (!Number.isFinite(e.delay) || e.delay < 0) throw new f("Policy validation error: 'delay' must be a finite non-negative number");
277
+ if (e.timeout !== void 0 && (!Number.isFinite(e.timeout) || e.timeout < 0)) throw new f("Policy validation error: 'timeout' must be a finite non-negative number");
278
+ if (e.jitter !== void 0 && (!Number.isFinite(e.jitter) || e.jitter < 0 || e.jitter > 1)) throw new f("Policy validation error: 'jitter' must be a finite number between 0 and 1");
279
+ this.policy = e;
280
+ }
281
+ retryIf(e, t, n) {
282
+ let r = this.policy, i = this.controller.signal;
283
+ return ee.cancellable(async (a) => {
284
+ let o = new AbortController(), s = () => o.abort();
285
+ if (a.aborted || i.aborted) throw n(new _("Operation was cancelled"));
286
+ a.addEventListener("abort", s, { once: !0 }), i.addEventListener("abort", s, { once: !0 });
287
+ try {
288
+ let i = 0, a = r.delay;
289
+ for (; i < r.recurs;) {
290
+ if (o.signal.aborted) throw n(new _("Operation was cancelled"));
291
+ let s = await this.withTimeout(e, n).unsafeRun();
292
+ if (s.type === "Ok") return s.value;
293
+ let c = s.error, u;
294
+ try {
295
+ u = t(c);
296
+ } catch (e) {
297
+ throw n(new m(`Retry condition threw: ${e instanceof Error ? e.message : String(e)}`));
298
+ }
299
+ if (!u) throw n(new m(`Retry condition not met: ${c}`));
300
+ if (i >= r.recurs - 1) throw n(new h(`Retry limit reached without success: ${c}`));
301
+ await l(this.applyJitter(a), o.signal, n), a *= r.factor, i++;
302
+ }
303
+ throw n(new h("Retry limit reached without success"));
304
+ } finally {
305
+ a.removeEventListener("abort", s), i.removeEventListener("abort", s);
306
+ }
307
+ }, (e) => d(e) ? e : n(e instanceof Error ? e : Error(String(e))));
308
+ }
309
+ repeat(e, t) {
310
+ let n = this.policy, r = this.controller.signal;
311
+ return ee.cancellable(async (i) => {
312
+ let a = new AbortController(), o = () => a.abort();
313
+ if (i.aborted || r.aborted) throw t(new _("Operation was cancelled"));
314
+ i.addEventListener("abort", o, { once: !0 }), r.addEventListener("abort", o, { once: !0 });
315
+ try {
316
+ let r = !1, i, o = n.delay;
317
+ for (let s = 0; s < n.recurs; s++) {
318
+ if (a.signal.aborted) throw t(new _("Operation was cancelled"));
319
+ let c = await this.withTimeout(e, t).unsafeRun();
320
+ if (c.type === "Ok") r = !0, i = c.value, s < n.recurs - 1 && (await l(this.applyJitter(o), a.signal, t), o *= n.factor);
321
+ else throw t(new g(`Failed to execute repeat: ${c.error}`));
322
+ }
323
+ if (r) return i;
324
+ throw t(new g("The function provided never succeeded"));
325
+ } finally {
326
+ i.removeEventListener("abort", o), r.removeEventListener("abort", o);
327
+ }
328
+ }, (e) => d(e) ? e : t(e instanceof Error ? e : Error(String(e))));
329
+ }
330
+ withTimeout(e, t) {
331
+ let n = this.policy.timeout;
332
+ return !n || n < 1 ? e : ee.lift(async () => {
333
+ let r = null, i = !1, a = new Promise((e, a) => {
334
+ r = setTimeout(() => {
335
+ i || (i = !0, a(t(new p(`The operation timed out after ${n} milliseconds`))));
336
+ }, n);
337
+ }), o = e.unsafeRun().then((e) => {
338
+ if (i) return e.type === "Ok" ? e.value : Promise.reject(e.error);
339
+ switch (i = !0, r && clearTimeout(r), e.type) {
340
+ case "Ok": return e.value;
341
+ case "Err": return Promise.reject(e.error);
342
+ }
343
+ });
344
+ try {
345
+ return await Promise.race([o, a]);
346
+ } catch (e) {
347
+ return r && clearTimeout(r), Promise.reject(e);
348
+ }
349
+ });
350
+ }
351
+ cancel() {
352
+ this.controller.abort();
353
+ }
354
+ applyJitter(e) {
355
+ if (!this.policy.jitter) return e;
356
+ let t = e * this.policy.jitter, n = (Math.random() * 2 - 1) * t;
357
+ return Math.max(0, e + n);
358
+ }
359
+ }, d = (e) => !(e instanceof _ || e instanceof h || e instanceof g || e instanceof m || e instanceof p || e instanceof f), f = class extends Error {
360
+ constructor(e) {
361
+ super(e), this.name = "PolicyValidationError";
362
+ }
363
+ }, p = class extends Error {
364
+ constructor(e) {
365
+ super(e), this.name = "TimeoutError";
366
+ }
367
+ }, m = class extends Error {
368
+ constructor(e) {
369
+ super(e), this.name = "ConditionalRetryError";
370
+ }
371
+ }, h = class extends Error {
372
+ constructor(e) {
373
+ super(e), this.name = "RetryError";
374
+ }
375
+ }, g = class extends Error {
376
+ constructor(e) {
377
+ super(e), this.name = "RepeatError";
378
+ }
379
+ }, _ = class extends Error {
380
+ constructor(e) {
381
+ super(e), this.name = "CancellationError";
382
+ }
383
+ }, v = Symbol("IO.node"), y = Symbol("IO.escape");
384
+ function b(e) {
385
+ return {
386
+ [y]: !0,
387
+ error: e
388
+ };
389
+ }
390
+ function x(e) {
391
+ return typeof e == "object" && !!e && y in e;
392
+ }
393
+ var S = Symbol("IO.cancelled");
394
+ function C() {
395
+ throw { [S]: !0 };
396
+ }
397
+ function w(e) {
398
+ return typeof e == "object" && !!e && S in e;
399
+ }
400
+ function T(e) {
401
+ return e != null && typeof e.then == "function";
402
+ }
403
+ async function E(e, t) {
404
+ let n = [], r = e;
405
+ for (;;) {
406
+ if (t?.aborted) {
407
+ let e = [];
408
+ for (; n.length > 0;) {
409
+ let t = n.pop();
410
+ t.tag === "OnCancel" && e.push(t.finalizer);
411
+ }
412
+ for (let t of e) try {
413
+ let e = t();
414
+ T(e) && await e;
415
+ } catch {}
416
+ return { type: "Cancelled" };
417
+ }
418
+ switch (r.tag) {
419
+ case "Map":
420
+ n.push({
421
+ tag: "Map",
422
+ f: r.f
423
+ }), r = r.io;
424
+ break;
425
+ case "FlatMap":
426
+ n.push({
427
+ tag: "FlatMap",
428
+ f: r.f
429
+ }), r = r.io;
430
+ break;
431
+ case "MapErr":
432
+ n.push({
433
+ tag: "MapErr",
434
+ f: r.f
435
+ }), r = r.io;
436
+ break;
437
+ case "FlatMapErr":
438
+ n.push({
439
+ tag: "FlatMapErr",
440
+ f: r.f
441
+ }), r = r.io;
442
+ break;
443
+ case "Tap":
444
+ n.push({
445
+ tag: "Tap",
446
+ f: r.f
447
+ }), r = r.io;
448
+ break;
449
+ case "TapErr":
450
+ n.push({
451
+ tag: "TapErr",
452
+ f: r.f
453
+ }), r = r.io;
454
+ break;
455
+ case "FoldM":
456
+ n.push({
457
+ tag: "FoldM",
458
+ onOk: r.onOk,
459
+ onErr: r.onErr
460
+ }), r = r.io;
461
+ break;
462
+ case "Ensure":
463
+ n.push({
464
+ tag: "Ensure",
465
+ predicate: r.predicate,
466
+ liftE: r.liftE
467
+ }), r = r.io;
468
+ break;
469
+ case "OnCancel":
470
+ n.push({
471
+ tag: "OnCancel",
472
+ finalizer: r.finalizer
473
+ }), r = r.io;
474
+ break;
475
+ case "Lift": {
476
+ let { run: e, liftE: n } = r;
477
+ try {
478
+ let n = e(t);
479
+ r = {
480
+ tag: "Pure",
481
+ value: T(n) ? await n : n
482
+ };
483
+ } catch (e) {
484
+ if (w(e)) {
485
+ r = {
486
+ tag: "Pure",
487
+ value: void 0
488
+ };
489
+ break;
490
+ }
491
+ r = {
492
+ tag: "Fail",
493
+ error: n ? n(e) : e
494
+ };
495
+ }
496
+ break;
497
+ }
498
+ case "Pure": {
499
+ if (n.length === 0) return {
500
+ type: "Ok",
501
+ value: r.value
502
+ };
503
+ let e = n.pop();
504
+ switch (e.tag) {
505
+ case "Map":
506
+ try {
507
+ r = {
508
+ tag: "Pure",
509
+ value: e.f(r.value)
510
+ };
511
+ } catch (e) {
512
+ r = {
513
+ tag: "Fail",
514
+ error: e
515
+ };
516
+ }
517
+ break;
518
+ case "FlatMap":
519
+ try {
520
+ r = e.f(r.value)[v];
521
+ } catch (e) {
522
+ r = {
523
+ tag: "Fail",
524
+ error: e
525
+ };
526
+ }
527
+ break;
528
+ case "Tap":
529
+ try {
530
+ let t = e.f(r.value);
531
+ T(t) && await t;
532
+ } catch {}
533
+ break;
534
+ case "Ensure": {
535
+ let t = r.value;
536
+ try {
537
+ e.predicate(t) || (r = {
538
+ tag: "Fail",
539
+ error: e.liftE(t)
540
+ });
541
+ } catch {
542
+ r = {
543
+ tag: "Fail",
544
+ error: e.liftE(t)
545
+ };
546
+ }
547
+ break;
548
+ }
549
+ case "FoldM":
550
+ try {
551
+ r = e.onOk(r.value)[v];
552
+ } catch (e) {
553
+ r = {
554
+ tag: "Fail",
555
+ error: e
556
+ };
557
+ }
558
+ break;
559
+ case "MapErr":
560
+ case "FlatMapErr":
561
+ case "TapErr":
562
+ case "OnCancel": break;
563
+ }
564
+ break;
565
+ }
566
+ case "Fail": {
567
+ if (n.length === 0) return {
568
+ type: "Err",
569
+ error: r.error
570
+ };
571
+ let e = n.pop();
572
+ switch (e.tag) {
573
+ case "MapErr":
574
+ try {
575
+ r = {
576
+ tag: "Fail",
577
+ error: e.f(r.error)
578
+ };
579
+ } catch (e) {
580
+ r = {
581
+ tag: "Fail",
582
+ error: e
583
+ };
584
+ }
585
+ break;
586
+ case "FlatMapErr":
587
+ try {
588
+ r = e.f(r.error)[v];
589
+ } catch (e) {
590
+ r = {
591
+ tag: "Fail",
592
+ error: e
593
+ };
594
+ }
595
+ break;
596
+ case "TapErr":
597
+ try {
598
+ let t = e.f(r.error);
599
+ T(t) && await t;
600
+ } catch {}
601
+ break;
602
+ case "FoldM":
603
+ try {
604
+ r = e.onErr(r.error)[v];
605
+ } catch (e) {
606
+ r = {
607
+ tag: "Fail",
608
+ error: e
609
+ };
610
+ }
611
+ break;
612
+ case "Map":
613
+ case "FlatMap":
614
+ case "Tap":
615
+ case "Ensure":
616
+ case "OnCancel": break;
617
+ }
618
+ break;
619
+ }
620
+ }
621
+ }
622
+ }
623
+ var ee = class e {
624
+ [v];
625
+ constructor(e) {
626
+ this[v] = e;
627
+ }
628
+ static wrap(t) {
629
+ return new e(t);
630
+ }
631
+ static lift(t, n) {
632
+ return new e({
633
+ tag: "Lift",
634
+ run: t,
635
+ liftE: n
636
+ });
637
+ }
638
+ static cancellable(t, n) {
639
+ return new e({
640
+ tag: "Lift",
641
+ run: (e) => t(e ?? new AbortController().signal),
642
+ liftE: n
643
+ });
644
+ }
645
+ static bracket(t, n, r) {
646
+ return e.lift(async (e) => {
647
+ let i = await E(t[v], e);
648
+ if (i.type === "Cancelled" && C(), i.type === "Err") throw b(i.error);
649
+ let a = i.value, o;
650
+ try {
651
+ o = await E(n(a)[v], e);
652
+ } catch (e) {
653
+ throw await E(r(a)[v]).catch(() => {}), e;
654
+ }
655
+ if (await E(r(a)[v]).catch(() => {}), o.type === "Cancelled" && C(), o.type === "Err") throw b(o.error);
656
+ return o.value;
657
+ }, (e) => {
658
+ if (w(e)) throw e;
659
+ return x(e) ? e.error : e;
660
+ });
661
+ }
662
+ static pure(t) {
663
+ return new e({
664
+ tag: "Pure",
665
+ value: t
666
+ });
667
+ }
668
+ static fail(t) {
669
+ return new e({
670
+ tag: "Fail",
671
+ error: t
672
+ });
673
+ }
674
+ static unit = new e({
675
+ tag: "Pure",
676
+ value: void 0
677
+ });
678
+ static ok(e) {
679
+ return {
680
+ type: "Ok",
681
+ value: e
682
+ };
683
+ }
684
+ static err(e) {
685
+ return {
686
+ type: "Err",
687
+ error: e
688
+ };
689
+ }
690
+ map(t) {
691
+ return e.wrap({
692
+ tag: "Map",
693
+ io: this[v],
694
+ f: t
695
+ });
696
+ }
697
+ flatMap(t) {
698
+ return e.wrap({
699
+ tag: "FlatMap",
700
+ io: this[v],
701
+ f: t
702
+ });
703
+ }
704
+ mapErr(t) {
705
+ return e.wrap({
706
+ tag: "MapErr",
707
+ io: this[v],
708
+ f: t
709
+ });
710
+ }
711
+ bimap(e, t) {
712
+ return this.map(t).mapErr(e);
713
+ }
714
+ flatMapErr(t) {
715
+ return e.wrap({
716
+ tag: "FlatMapErr",
717
+ io: this[v],
718
+ f: t
719
+ });
720
+ }
721
+ tap(t) {
722
+ return e.wrap({
723
+ tag: "Tap",
724
+ io: this[v],
725
+ f: t
726
+ });
727
+ }
728
+ tapErr(t) {
729
+ return e.wrap({
730
+ tag: "TapErr",
731
+ io: this[v],
732
+ f: t
733
+ });
734
+ }
735
+ ensure(t, n) {
736
+ return e.wrap({
737
+ tag: "Ensure",
738
+ io: this[v],
739
+ predicate: t,
740
+ liftE: n
741
+ });
742
+ }
743
+ onCancel(t) {
744
+ return e.wrap({
745
+ tag: "OnCancel",
746
+ io: this[v],
747
+ finalizer: t
748
+ });
749
+ }
750
+ foldM(t, n) {
751
+ return e.wrap({
752
+ tag: "FoldM",
753
+ io: this[v],
754
+ onOk: n,
755
+ onErr: t
756
+ });
757
+ }
758
+ attempt() {
759
+ return this.foldM((n) => e.pure(t.pure(n)), (t) => e.pure(n.pure(t)));
760
+ }
761
+ ignore() {
762
+ return this.foldM(() => e.unit, () => e.unit);
763
+ }
764
+ async unsafeRun() {
765
+ return E(this[v]);
766
+ }
767
+ async fold(e, t) {
768
+ let n = await this.unsafeRun();
769
+ return n.type === "Ok" ? t(n.value) : e(n.error);
770
+ }
771
+ async getOrNull() {
772
+ let e = await this.unsafeRun();
773
+ return e.type === "Ok" ? e.value : null;
774
+ }
775
+ async getOrElse(e) {
776
+ let t = await this.unsafeRun();
777
+ return t.type === "Ok" ? t.value : e();
778
+ }
779
+ async getOrHandleErr(e) {
780
+ let t = await this.unsafeRun();
781
+ return t.type === "Ok" ? t.value : e(t.error);
782
+ }
783
+ retryIf(t, n, r = c()) {
784
+ return e.lift(() => new u(r), (e) => n(e instanceof Error ? e : Error(String(e)))).flatMap((e) => e.retryIf(this, t, n));
785
+ }
786
+ timeout(t, n) {
787
+ let r = this[v];
788
+ return e.lift((e) => new Promise((i, a) => {
789
+ let o = new AbortController(), s;
790
+ if (e) if (e.aborted) o.abort();
791
+ else {
792
+ let t = () => o.abort();
793
+ e.addEventListener("abort", t, { once: !0 }), s = () => e.removeEventListener("abort", t);
794
+ }
795
+ let c = !1, l = () => {
796
+ c = !0, s && s();
797
+ }, u = setTimeout(() => {
798
+ c || (l(), o.abort(), a(b(n())));
799
+ }, t);
800
+ E(r, o.signal).then((e) => {
801
+ c || (l(), clearTimeout(u), e.type === "Ok" ? i(e.value) : e.type === "Cancelled" ? a({ [S]: !0 }) : a(b(e.error)));
802
+ }), o.signal.addEventListener("abort", () => {
803
+ clearTimeout(u);
804
+ }, { once: !0 });
805
+ }), (e) => {
806
+ if (w(e)) throw e;
807
+ return x(e) ? e.error : e;
808
+ });
809
+ }
810
+ fork() {
811
+ let t = this[v];
812
+ return e.lift(() => {
813
+ let e = new AbortController(), n = E(t, e.signal);
814
+ return {
815
+ join: () => n,
816
+ cancel: async () => {
817
+ e.abort(), await n.catch(() => {});
818
+ },
819
+ signal: e.signal
820
+ };
821
+ });
822
+ }
823
+ static parMapN(...t) {
824
+ if (t.length < 3) throw Error("IO.parMapN requires at least two IO arguments and a combiner function");
825
+ let n = t.slice(0, -1), r = t[t.length - 1];
826
+ return e.lift(async (e) => {
827
+ let t = await Promise.all(n.map((t) => E(t[v], e)));
828
+ t.some((e) => e.type === "Cancelled") && C();
829
+ let i = t.filter((e) => e.type === "Err").map((e) => e.error);
830
+ if (i.length > 0) throw b(s.fromArray(i));
831
+ return r(...t.filter((e) => e.type === "Ok").map((e) => e.value));
832
+ }, (e) => x(e) ? e.error : s.fromArray([e]));
833
+ }
834
+ static race(...t) {
835
+ if (t.length === 0) throw Error("IO.race requires at least one IO argument");
836
+ return e.lift((e) => new Promise((n, r) => {
837
+ let i = new AbortController(), a;
838
+ if (e) if (e.aborted) i.abort();
839
+ else {
840
+ let t = () => i.abort();
841
+ e.addEventListener("abort", t, { once: !0 }), a = () => e.removeEventListener("abort", t);
842
+ }
843
+ let o = 0, c = !1, l = Array(t.length), u = () => {
844
+ c = !0, a && a();
845
+ };
846
+ t.forEach((e, a) => {
847
+ E(e[v], i.signal).then((e) => {
848
+ if (!c) {
849
+ if (e.type === "Ok") u(), i.abort(), n(e.value);
850
+ else if (e.type === "Err") {
851
+ if (l[a] = e.error, o++, o === t.length) {
852
+ u();
853
+ let e = l.filter((e) => e !== void 0);
854
+ e.length > 0 ? r(b(s.fromArray(e))) : r({ [S]: !0 });
855
+ }
856
+ } else if (o++, o === t.length && !c) {
857
+ u();
858
+ let e = l.filter((e) => e !== void 0);
859
+ e.length > 0 ? r(b(s.fromArray(e))) : r({ [S]: !0 });
860
+ }
861
+ }
862
+ });
863
+ });
864
+ }), (e) => {
865
+ if (w(e)) throw e;
866
+ return x(e) ? e.error : s.fromArray([e]);
867
+ });
868
+ }
869
+ static Do(t, n) {
870
+ let r = n;
871
+ return e.lift(async (e) => await t(async (t) => {
872
+ let n = await E(t[v], e);
873
+ if (n.type === "Ok") return n.value;
874
+ throw n.type === "Cancelled" && C(), b(n.error);
875
+ }), (e) => {
876
+ if (w(e)) throw e;
877
+ return x(e) ? e.error : r ? r(e) : e;
878
+ });
879
+ }
880
+ static traverse(t, n) {
881
+ return e.Do(async (e) => {
882
+ let r = [];
883
+ for (let i of t) r.push(await e(n(i)));
884
+ return r;
885
+ });
886
+ }
887
+ static parTraverse(t, n) {
888
+ return e.lift(async (e) => {
889
+ let r = await Promise.all(t.map((t) => E(n(t)[v], e)));
890
+ r.some((e) => e.type === "Cancelled") && C();
891
+ let i = r.filter((e) => e.type === "Err").map((e) => e.error);
892
+ if (i.length > 0) throw b(s.fromArray(i));
893
+ return r.filter((e) => e.type === "Ok").map((e) => e.value);
894
+ }, (e) => x(e) ? e.error : s.fromArray([e]));
895
+ }
896
+ static sequence(t) {
897
+ return e.traverse(t, (e) => e);
898
+ }
899
+ static parSequence(t) {
900
+ return e.parTraverse(t, (e) => e);
901
+ }
902
+ }, D = class {
903
+ static defer(e) {
904
+ return new ne(e);
905
+ }
906
+ static now(e) {
907
+ return new te(e);
908
+ }
909
+ static lazy(e) {
910
+ return new re(e);
911
+ }
912
+ map(e) {
913
+ return new k(this, e);
914
+ }
915
+ flatMap(e) {
916
+ return new O(this, e);
917
+ }
918
+ evaluate() {
919
+ let e = this, t = [];
920
+ for (;;) if (e instanceof O) {
921
+ let n = e.first;
922
+ n instanceof O || n instanceof k ? (t.push(e.f), e = n) : e = e.f(n.value());
923
+ } else if (e instanceof k) {
924
+ let n = [e.f], r = e.first;
925
+ for (; r instanceof k;) n.push(r.f), r = r.first;
926
+ let i = (e) => {
927
+ for (let t = n.length - 1; t >= 0; t--) e = n[t](e);
928
+ return e;
929
+ };
930
+ if (r instanceof O) t.push((e) => new te(i(e))), e = r;
931
+ else {
932
+ let n = i(r.value());
933
+ if (t.length === 0) return n;
934
+ e = t.pop()(n);
935
+ }
936
+ } else {
937
+ let n = e.value();
938
+ if (t.length === 0) return n;
939
+ e = t.pop()(n);
940
+ }
941
+ }
942
+ }, te = class extends D {
943
+ constructor(e) {
944
+ super(), this._value = e;
945
+ }
946
+ value() {
947
+ return this._value;
948
+ }
949
+ }, ne = class extends D {
950
+ constructor(e) {
951
+ super(), this.f = e;
952
+ }
953
+ value() {
954
+ return this.f();
955
+ }
956
+ }, re = class extends D {
957
+ _value;
958
+ _evaluated = !1;
959
+ constructor(e) {
960
+ super(), this.f = e;
961
+ }
962
+ value() {
963
+ return this._evaluated ||= (this._value = this.f(), !0), this._value;
964
+ }
965
+ }, O = class extends D {
966
+ constructor(e, t) {
967
+ super(), this.first = e, this.f = t;
968
+ }
969
+ value() {
970
+ throw new ie("FlatMap should not be evaluated directly");
971
+ }
972
+ }, k = class extends D {
973
+ constructor(e, t) {
974
+ super(), this.first = e, this.f = t;
975
+ }
976
+ value() {
977
+ throw new ie("Map should not be evaluated directly");
978
+ }
979
+ }, ie = class extends Error {
980
+ constructor(e) {
981
+ super(), this.error = e, this.name = "EvaluationError";
982
+ }
983
+ }, ae = class e {
984
+ constructor(e, t) {
985
+ this.value = e, this.type = t;
986
+ }
987
+ static LessThan = new e(-1, "LessThan");
988
+ static Equal = new e(0, "Equal");
989
+ static GreaterThan = new e(1, "GreaterThan");
990
+ flatMap(e) {
991
+ return this.type === "Equal" ? e() : this;
992
+ }
993
+ match(e, t, n) {
994
+ switch (this.type) {
995
+ case "LessThan": return e();
996
+ case "Equal": return t();
997
+ case "GreaterThan": return n();
998
+ }
999
+ }
1000
+ reverse() {
1001
+ switch (this.type) {
1002
+ case "LessThan": return e.GreaterThan;
1003
+ case "Equal": return e.Equal;
1004
+ case "GreaterThan": return e.LessThan;
1005
+ }
1006
+ }
1007
+ tap(e) {
1008
+ return e(this), this;
1009
+ }
1010
+ concat(e) {
1011
+ return this.type === "Equal" ? e : this;
1012
+ }
1013
+ static from(t) {
1014
+ if (isNaN(t)) throw Error("Cannot convert NaN to Ordering.");
1015
+ return t < 0 ? e.LessThan : t > 0 ? e.GreaterThan : e.Equal;
1016
+ }
1017
+ static comparing(t, n) {
1018
+ return (r, i) => {
1019
+ let a = n(t(r), t(i));
1020
+ if (isNaN(a)) throw Error("Comparator function returned NaN.");
1021
+ return e.from(a);
1022
+ };
1023
+ }
1024
+ static compareBy(...t) {
1025
+ return (n, r) => {
1026
+ for (let e of t) {
1027
+ let t = e(n, r);
1028
+ if (t.type !== "Equal") return t;
1029
+ }
1030
+ return e.Equal;
1031
+ };
1032
+ }
1033
+ };
1034
+ ae.LessThan, ae.Equal, ae.GreaterThan;
1035
+ //#endregion
1036
+ //#region ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
1037
+ var A = Math.min, j = Math.max, M = Math.round, N = Math.floor, P = (e) => ({
1038
+ x: e,
1039
+ y: e
1040
+ }), oe = {
1041
+ left: "right",
1042
+ right: "left",
1043
+ bottom: "top",
1044
+ top: "bottom"
1045
+ };
1046
+ function se(e, t, n) {
1047
+ return j(e, A(t, n));
1048
+ }
1049
+ function ce(e, t) {
1050
+ return typeof e == "function" ? e(t) : e;
1051
+ }
1052
+ function F(e) {
1053
+ return e.split("-")[0];
1054
+ }
1055
+ function le(e) {
1056
+ return e.split("-")[1];
1057
+ }
1058
+ function ue(e) {
1059
+ return e === "x" ? "y" : "x";
1060
+ }
1061
+ function de(e) {
1062
+ return e === "y" ? "height" : "width";
1063
+ }
1064
+ function I(e) {
1065
+ let t = e[0];
1066
+ return t === "t" || t === "b" ? "y" : "x";
1067
+ }
1068
+ function fe(e) {
1069
+ return ue(I(e));
1070
+ }
1071
+ function pe(e, t, n) {
1072
+ n === void 0 && (n = !1);
1073
+ let r = le(e), i = fe(e), a = de(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
1074
+ return t.reference[a] > t.floating[a] && (o = L(o)), [o, L(o)];
1075
+ }
1076
+ function me(e) {
1077
+ let t = L(e);
1078
+ return [
1079
+ he(e),
1080
+ t,
1081
+ he(t)
1082
+ ];
1083
+ }
1084
+ function he(e) {
1085
+ return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
1086
+ }
1087
+ var ge = ["left", "right"], _e = ["right", "left"], ve = ["top", "bottom"], ye = ["bottom", "top"];
1088
+ function be(e, t, n) {
1089
+ switch (e) {
1090
+ case "top":
1091
+ case "bottom": return n ? t ? _e : ge : t ? ge : _e;
1092
+ case "left":
1093
+ case "right": return t ? ve : ye;
1094
+ default: return [];
1095
+ }
1096
+ }
1097
+ function xe(e, t, n, r) {
1098
+ let i = le(e), a = be(F(e), n === "start", r);
1099
+ return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(he)))), a;
1100
+ }
1101
+ function L(e) {
1102
+ let t = F(e);
1103
+ return oe[t] + e.slice(t.length);
1104
+ }
1105
+ function Se(e) {
1106
+ return {
1107
+ top: 0,
1108
+ right: 0,
1109
+ bottom: 0,
1110
+ left: 0,
1111
+ ...e
1112
+ };
1113
+ }
1114
+ function Ce(e) {
1115
+ return typeof e == "number" ? {
1116
+ top: e,
1117
+ right: e,
1118
+ bottom: e,
1119
+ left: e
1120
+ } : Se(e);
1121
+ }
1122
+ function R(e) {
1123
+ let { x: t, y: n, width: r, height: i } = e;
1124
+ return {
1125
+ width: r,
1126
+ height: i,
1127
+ top: n,
1128
+ left: t,
1129
+ right: t + r,
1130
+ bottom: n + i,
1131
+ x: t,
1132
+ y: n
1133
+ };
1134
+ }
1135
+ //#endregion
1136
+ //#region ../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs
1137
+ function we(e, t, n) {
1138
+ let { reference: r, floating: i } = e, a = I(t), o = fe(t), s = de(o), c = F(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
1139
+ switch (c) {
1140
+ case "top":
1141
+ p = {
1142
+ x: u,
1143
+ y: r.y - i.height
1144
+ };
1145
+ break;
1146
+ case "bottom":
1147
+ p = {
1148
+ x: u,
1149
+ y: r.y + r.height
1150
+ };
1151
+ break;
1152
+ case "right":
1153
+ p = {
1154
+ x: r.x + r.width,
1155
+ y: d
1156
+ };
1157
+ break;
1158
+ case "left":
1159
+ p = {
1160
+ x: r.x - i.width,
1161
+ y: d
1162
+ };
1163
+ break;
1164
+ default: p = {
1165
+ x: r.x,
1166
+ y: r.y
1167
+ };
1168
+ }
1169
+ switch (le(t)) {
1170
+ case "start":
1171
+ p[o] -= f * (n && l ? -1 : 1);
1172
+ break;
1173
+ case "end":
1174
+ p[o] += f * (n && l ? -1 : 1);
1175
+ break;
1176
+ }
1177
+ return p;
1178
+ }
1179
+ async function Te(e, t) {
1180
+ t === void 0 && (t = {});
1181
+ let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = ce(t, e), p = Ce(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = R(await i.getClippingRect({
1182
+ element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
1183
+ boundary: c,
1184
+ rootBoundary: l,
1185
+ strategy: s
1186
+ })), g = u === "floating" ? {
1187
+ x: n,
1188
+ y: r,
1189
+ width: a.floating.width,
1190
+ height: a.floating.height
1191
+ } : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
1192
+ x: 1,
1193
+ y: 1
1194
+ }, y = R(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
1195
+ elements: o,
1196
+ rect: g,
1197
+ offsetParent: _,
1198
+ strategy: s
1199
+ }) : g);
1200
+ return {
1201
+ top: (h.top - y.top + p.top) / v.y,
1202
+ bottom: (y.bottom - h.bottom + p.bottom) / v.y,
1203
+ left: (h.left - y.left + p.left) / v.x,
1204
+ right: (y.right - h.right + p.right) / v.x
1205
+ };
1206
+ }
1207
+ var Ee = 50, De = async (e, t, n) => {
1208
+ let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
1209
+ ...o,
1210
+ detectOverflow: Te
1211
+ }, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
1212
+ reference: e,
1213
+ floating: t,
1214
+ strategy: i
1215
+ }), { x: u, y: d } = we(l, r, c), f = r, p = 0, m = {};
1216
+ for (let n = 0; n < a.length; n++) {
1217
+ let h = a[n];
1218
+ if (!h) continue;
1219
+ let { name: g, fn: _ } = h, { x: v, y, data: b, reset: x } = await _({
1220
+ x: u,
1221
+ y: d,
1222
+ initialPlacement: r,
1223
+ placement: f,
1224
+ strategy: i,
1225
+ middlewareData: m,
1226
+ rects: l,
1227
+ platform: s,
1228
+ elements: {
1229
+ reference: e,
1230
+ floating: t
1231
+ }
1232
+ });
1233
+ u = v ?? u, d = y ?? d, m[g] = {
1234
+ ...m[g],
1235
+ ...b
1236
+ }, x && p < Ee && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
1237
+ reference: e,
1238
+ floating: t,
1239
+ strategy: i
1240
+ }) : x.rects), {x: u, y: d} = we(l, f, c)), n = -1);
1241
+ }
1242
+ return {
1243
+ x: u,
1244
+ y: d,
1245
+ placement: f,
1246
+ strategy: i,
1247
+ middlewareData: m
1248
+ };
1249
+ }, Oe = function(e) {
1250
+ return e === void 0 && (e = {}), {
1251
+ name: "flip",
1252
+ options: e,
1253
+ async fn(t) {
1254
+ var n;
1255
+ let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = ce(e, t);
1256
+ if ((n = i.arrow) != null && n.alignmentOffset) return {};
1257
+ let g = F(r), _ = I(o), v = F(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [L(o)] : me(o)), x = p !== "none";
1258
+ !d && x && b.push(...xe(o, m, p, y));
1259
+ let S = [o, ...b], C = await s.detectOverflow(t, h), w = [], T = i.flip?.overflows || [];
1260
+ if (l && w.push(C[g]), u) {
1261
+ let e = pe(r, a, y);
1262
+ w.push(C[e[0]], C[e[1]]);
1263
+ }
1264
+ if (T = [...T, {
1265
+ placement: r,
1266
+ overflows: w
1267
+ }], !w.every((e) => e <= 0)) {
1268
+ let e = (i.flip?.index || 0) + 1, t = S[e];
1269
+ if (t && (!(u === "alignment" && _ !== I(t)) || T.every((e) => I(e.placement) === _ ? e.overflows[0] > 0 : !0))) return {
1270
+ data: {
1271
+ index: e,
1272
+ overflows: T
1273
+ },
1274
+ reset: { placement: t }
1275
+ };
1276
+ let n = T.filter((e) => e.overflows[0] <= 0).sort((e, t) => e.overflows[1] - t.overflows[1])[0]?.placement;
1277
+ if (!n) switch (f) {
1278
+ case "bestFit": {
1279
+ let e = T.filter((e) => {
1280
+ if (x) {
1281
+ let t = I(e.placement);
1282
+ return t === _ || t === "y";
1283
+ }
1284
+ return !0;
1285
+ }).map((e) => [e.placement, e.overflows.filter((e) => e > 0).reduce((e, t) => e + t, 0)]).sort((e, t) => e[1] - t[1])[0]?.[0];
1286
+ e && (n = e);
1287
+ break;
1288
+ }
1289
+ case "initialPlacement":
1290
+ n = o;
1291
+ break;
1292
+ }
1293
+ if (r !== n) return { reset: { placement: n } };
1294
+ }
1295
+ return {};
1296
+ }
1297
+ };
1298
+ }, ke = /* @__PURE__ */ new Set(["left", "top"]);
1299
+ async function Ae(e, t) {
1300
+ let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = F(n), s = le(n), c = I(n) === "y", l = ke.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = ce(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
1301
+ mainAxis: d,
1302
+ crossAxis: 0,
1303
+ alignmentAxis: null
1304
+ } : {
1305
+ mainAxis: d.mainAxis || 0,
1306
+ crossAxis: d.crossAxis || 0,
1307
+ alignmentAxis: d.alignmentAxis
1308
+ };
1309
+ return s && typeof m == "number" && (p = s === "end" ? m * -1 : m), c ? {
1310
+ x: p * u,
1311
+ y: f * l
1312
+ } : {
1313
+ x: f * l,
1314
+ y: p * u
1315
+ };
1316
+ }
1317
+ var je = function(e) {
1318
+ return e === void 0 && (e = 0), {
1319
+ name: "offset",
1320
+ options: e,
1321
+ async fn(t) {
1322
+ var n;
1323
+ let { x: r, y: i, placement: a, middlewareData: o } = t, s = await Ae(t, e);
1324
+ return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
1325
+ x: r + s.x,
1326
+ y: i + s.y,
1327
+ data: {
1328
+ ...s,
1329
+ placement: a
1330
+ }
1331
+ };
1332
+ }
1333
+ };
1334
+ }, Me = function(e) {
1335
+ return e === void 0 && (e = {}), {
1336
+ name: "shift",
1337
+ options: e,
1338
+ async fn(t) {
1339
+ let { x: n, y: r, placement: i, platform: a } = t, { mainAxis: o = !0, crossAxis: s = !1, limiter: c = { fn: (e) => {
1340
+ let { x: t, y: n } = e;
1341
+ return {
1342
+ x: t,
1343
+ y: n
1344
+ };
1345
+ } }, ...l } = ce(e, t), u = {
1346
+ x: n,
1347
+ y: r
1348
+ }, d = await a.detectOverflow(t, l), f = I(F(i)), p = ue(f), m = u[p], h = u[f];
1349
+ if (o) {
1350
+ let e = p === "y" ? "top" : "left", t = p === "y" ? "bottom" : "right", n = m + d[e], r = m - d[t];
1351
+ m = se(n, m, r);
1352
+ }
1353
+ if (s) {
1354
+ let e = f === "y" ? "top" : "left", t = f === "y" ? "bottom" : "right", n = h + d[e], r = h - d[t];
1355
+ h = se(n, h, r);
1356
+ }
1357
+ let g = c.fn({
1358
+ ...t,
1359
+ [p]: m,
1360
+ [f]: h
1361
+ });
1362
+ return {
1363
+ ...g,
1364
+ data: {
1365
+ x: g.x - n,
1366
+ y: g.y - r,
1367
+ enabled: {
1368
+ [p]: o,
1369
+ [f]: s
1370
+ }
1371
+ }
1372
+ };
1373
+ }
1374
+ };
1375
+ };
1376
+ //#endregion
1377
+ //#region ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
1378
+ function z() {
1379
+ return typeof window < "u";
1380
+ }
1381
+ function B(e) {
1382
+ return Ne(e) ? (e.nodeName || "").toLowerCase() : "#document";
1383
+ }
1384
+ function V(e) {
1385
+ var t;
1386
+ return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
1387
+ }
1388
+ function H(e) {
1389
+ return ((Ne(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
1390
+ }
1391
+ function Ne(e) {
1392
+ return z() ? e instanceof Node || e instanceof V(e).Node : !1;
1393
+ }
1394
+ function U(e) {
1395
+ return z() ? e instanceof Element || e instanceof V(e).Element : !1;
1396
+ }
1397
+ function W(e) {
1398
+ return z() ? e instanceof HTMLElement || e instanceof V(e).HTMLElement : !1;
1399
+ }
1400
+ function Pe(e) {
1401
+ return !z() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof V(e).ShadowRoot;
1402
+ }
1403
+ function G(e) {
1404
+ let { overflow: t, overflowX: n, overflowY: r, display: i } = Y(e);
1405
+ return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
1406
+ }
1407
+ function Fe(e) {
1408
+ return /^(table|td|th)$/.test(B(e));
1409
+ }
1410
+ function K(e) {
1411
+ try {
1412
+ if (e.matches(":popover-open")) return !0;
1413
+ } catch {}
1414
+ try {
1415
+ return e.matches(":modal");
1416
+ } catch {
1417
+ return !1;
1418
+ }
1419
+ }
1420
+ var Ie = /transform|translate|scale|rotate|perspective|filter/, Le = /paint|layout|strict|content/, q = (e) => !!e && e !== "none", Re;
1421
+ function ze(e) {
1422
+ let t = U(e) ? Y(e) : e;
1423
+ return q(t.transform) || q(t.translate) || q(t.scale) || q(t.rotate) || q(t.perspective) || !Ve() && (q(t.backdropFilter) || q(t.filter)) || Ie.test(t.willChange || "") || Le.test(t.contain || "");
1424
+ }
1425
+ function Be(e) {
1426
+ let t = X(e);
1427
+ for (; W(t) && !J(t);) {
1428
+ if (ze(t)) return t;
1429
+ if (K(t)) return null;
1430
+ t = X(t);
1431
+ }
1432
+ return null;
1433
+ }
1434
+ function Ve() {
1435
+ return Re ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), Re;
1436
+ }
1437
+ function J(e) {
1438
+ return /^(html|body|#document)$/.test(B(e));
1439
+ }
1440
+ function Y(e) {
1441
+ return V(e).getComputedStyle(e);
1442
+ }
1443
+ function He(e) {
1444
+ return U(e) ? {
1445
+ scrollLeft: e.scrollLeft,
1446
+ scrollTop: e.scrollTop
1447
+ } : {
1448
+ scrollLeft: e.scrollX,
1449
+ scrollTop: e.scrollY
1450
+ };
1451
+ }
1452
+ function X(e) {
1453
+ if (B(e) === "html") return e;
1454
+ let t = e.assignedSlot || e.parentNode || Pe(e) && e.host || H(e);
1455
+ return Pe(t) ? t.host : t;
1456
+ }
1457
+ function Ue(e) {
1458
+ let t = X(e);
1459
+ return J(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : W(t) && G(t) ? t : Ue(t);
1460
+ }
1461
+ function Z(e, t, n) {
1462
+ t === void 0 && (t = []), n === void 0 && (n = !0);
1463
+ let r = Ue(e), i = r === e.ownerDocument?.body, a = V(r);
1464
+ if (i) {
1465
+ let e = We(a);
1466
+ return t.concat(a, a.visualViewport || [], G(r) ? r : [], e && n ? Z(e) : []);
1467
+ } else return t.concat(r, Z(r, [], n));
1468
+ }
1469
+ function We(e) {
1470
+ return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
1471
+ }
1472
+ //#endregion
1473
+ //#region ../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
1474
+ function Ge(e) {
1475
+ let t = Y(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = W(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = M(n) !== a || M(r) !== o;
1476
+ return s && (n = a, r = o), {
1477
+ width: n,
1478
+ height: r,
1479
+ $: s
1480
+ };
1481
+ }
1482
+ function Ke(e) {
1483
+ return U(e) ? e : e.contextElement;
1484
+ }
1485
+ function Q(e) {
1486
+ let t = Ke(e);
1487
+ if (!W(t)) return P(1);
1488
+ let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = Ge(t), o = (a ? M(n.width) : n.width) / r, s = (a ? M(n.height) : n.height) / i;
1489
+ return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
1490
+ x: o,
1491
+ y: s
1492
+ };
1493
+ }
1494
+ var qe = /* @__PURE__ */ P(0);
1495
+ function Je(e) {
1496
+ let t = V(e);
1497
+ return !Ve() || !t.visualViewport ? qe : {
1498
+ x: t.visualViewport.offsetLeft,
1499
+ y: t.visualViewport.offsetTop
1500
+ };
1501
+ }
1502
+ function Ye(e, t, n) {
1503
+ return t === void 0 && (t = !1), !n || t && n !== V(e) ? !1 : t;
1504
+ }
1505
+ function $(e, t, n, r) {
1506
+ t === void 0 && (t = !1), n === void 0 && (n = !1);
1507
+ let i = e.getBoundingClientRect(), a = Ke(e), o = P(1);
1508
+ t && (r ? U(r) && (o = Q(r)) : o = Q(e));
1509
+ let s = Ye(a, n, r) ? Je(a) : P(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
1510
+ if (a) {
1511
+ let e = V(a), t = r && U(r) ? V(r) : r, n = e, i = We(n);
1512
+ for (; i && r && t !== n;) {
1513
+ let e = Q(i), t = i.getBoundingClientRect(), r = Y(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
1514
+ c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = V(i), i = We(n);
1515
+ }
1516
+ }
1517
+ return R({
1518
+ width: u,
1519
+ height: d,
1520
+ x: c,
1521
+ y: l
1522
+ });
1523
+ }
1524
+ function Xe(e, t) {
1525
+ let n = He(e).scrollLeft;
1526
+ return t ? t.left + n : $(H(e)).left + n;
1527
+ }
1528
+ function Ze(e, t) {
1529
+ let n = e.getBoundingClientRect();
1530
+ return {
1531
+ x: n.left + t.scrollLeft - Xe(e, n),
1532
+ y: n.top + t.scrollTop
1533
+ };
1534
+ }
1535
+ function Qe(e) {
1536
+ let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = H(r), s = t ? K(t.floating) : !1;
1537
+ if (r === o || s && a) return n;
1538
+ let c = {
1539
+ scrollLeft: 0,
1540
+ scrollTop: 0
1541
+ }, l = P(1), u = P(0), d = W(r);
1542
+ if ((d || !d && !a) && ((B(r) !== "body" || G(o)) && (c = He(r)), d)) {
1543
+ let e = $(r);
1544
+ l = Q(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
1545
+ }
1546
+ let f = o && !d && !a ? Ze(o, c) : P(0);
1547
+ return {
1548
+ width: n.width * l.x,
1549
+ height: n.height * l.y,
1550
+ x: n.x * l.x - c.scrollLeft * l.x + u.x + f.x,
1551
+ y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
1552
+ };
1553
+ }
1554
+ function $e(e) {
1555
+ return Array.from(e.getClientRects());
1556
+ }
1557
+ function et(e) {
1558
+ let t = H(e), n = He(e), r = e.ownerDocument.body, i = j(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = j(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + Xe(e), s = -n.scrollTop;
1559
+ return Y(r).direction === "rtl" && (o += j(t.clientWidth, r.clientWidth) - i), {
1560
+ width: i,
1561
+ height: a,
1562
+ x: o,
1563
+ y: s
1564
+ };
1565
+ }
1566
+ var tt = 25;
1567
+ function nt(e, t) {
1568
+ let n = V(e), r = H(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
1569
+ if (i) {
1570
+ a = i.width, o = i.height;
1571
+ let e = Ve();
1572
+ (!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
1573
+ }
1574
+ let l = Xe(r);
1575
+ if (l <= 0) {
1576
+ let e = r.ownerDocument, t = e.body, n = getComputedStyle(t), i = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, o = Math.abs(r.clientWidth - t.clientWidth - i);
1577
+ o <= tt && (a -= o);
1578
+ } else l <= tt && (a += l);
1579
+ return {
1580
+ width: a,
1581
+ height: o,
1582
+ x: s,
1583
+ y: c
1584
+ };
1585
+ }
1586
+ function rt(e, t) {
1587
+ let n = $(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = W(e) ? Q(e) : P(1);
1588
+ return {
1589
+ width: e.clientWidth * a.x,
1590
+ height: e.clientHeight * a.y,
1591
+ x: i * a.x,
1592
+ y: r * a.y
1593
+ };
1594
+ }
1595
+ function it(e, t, n) {
1596
+ let r;
1597
+ if (t === "viewport") r = nt(e, n);
1598
+ else if (t === "document") r = et(H(e));
1599
+ else if (U(t)) r = rt(t, n);
1600
+ else {
1601
+ let n = Je(e);
1602
+ r = {
1603
+ x: t.x - n.x,
1604
+ y: t.y - n.y,
1605
+ width: t.width,
1606
+ height: t.height
1607
+ };
1608
+ }
1609
+ return R(r);
1610
+ }
1611
+ function at(e, t) {
1612
+ let n = X(e);
1613
+ return n === t || !U(n) || J(n) ? !1 : Y(n).position === "fixed" || at(n, t);
1614
+ }
1615
+ function ot(e, t) {
1616
+ let n = t.get(e);
1617
+ if (n) return n;
1618
+ let r = Z(e, [], !1).filter((e) => U(e) && B(e) !== "body"), i = null, a = Y(e).position === "fixed", o = a ? X(e) : e;
1619
+ for (; U(o) && !J(o);) {
1620
+ let t = Y(o), n = ze(o);
1621
+ !n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && (i.position === "absolute" || i.position === "fixed") || G(o) && !n && at(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = X(o);
1622
+ }
1623
+ return t.set(e, r), r;
1624
+ }
1625
+ function st(e) {
1626
+ let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? K(t) ? [] : ot(t, this._c) : [].concat(n), r], o = it(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
1627
+ for (let e = 1; e < a.length; e++) {
1628
+ let n = it(t, a[e], i);
1629
+ s = j(n.top, s), c = A(n.right, c), l = A(n.bottom, l), u = j(n.left, u);
1630
+ }
1631
+ return {
1632
+ width: c - u,
1633
+ height: l - s,
1634
+ x: u,
1635
+ y: s
1636
+ };
1637
+ }
1638
+ function ct(e) {
1639
+ let { width: t, height: n } = Ge(e);
1640
+ return {
1641
+ width: t,
1642
+ height: n
1643
+ };
1644
+ }
1645
+ function lt(e, t, n) {
1646
+ let r = W(t), i = H(t), a = n === "fixed", o = $(e, !0, a, t), s = {
1647
+ scrollLeft: 0,
1648
+ scrollTop: 0
1649
+ }, c = P(0);
1650
+ function l() {
1651
+ c.x = Xe(i);
1652
+ }
1653
+ if (r || !r && !a) if ((B(t) !== "body" || G(i)) && (s = He(t)), r) {
1654
+ let e = $(t, !0, a, t);
1655
+ c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
1656
+ } else i && l();
1657
+ a && !r && i && l();
1658
+ let u = i && !r && !a ? Ze(i, s) : P(0);
1659
+ return {
1660
+ x: o.left + s.scrollLeft - c.x - u.x,
1661
+ y: o.top + s.scrollTop - c.y - u.y,
1662
+ width: o.width,
1663
+ height: o.height
1664
+ };
1665
+ }
1666
+ function ut(e) {
1667
+ return Y(e).position === "static";
1668
+ }
1669
+ function dt(e, t) {
1670
+ if (!W(e) || Y(e).position === "fixed") return null;
1671
+ if (t) return t(e);
1672
+ let n = e.offsetParent;
1673
+ return H(e) === n && (n = n.ownerDocument.body), n;
1674
+ }
1675
+ function ft(e, t) {
1676
+ let n = V(e);
1677
+ if (K(e)) return n;
1678
+ if (!W(e)) {
1679
+ let t = X(e);
1680
+ for (; t && !J(t);) {
1681
+ if (U(t) && !ut(t)) return t;
1682
+ t = X(t);
1683
+ }
1684
+ return n;
1685
+ }
1686
+ let r = dt(e, t);
1687
+ for (; r && Fe(r) && ut(r);) r = dt(r, t);
1688
+ return r && J(r) && ut(r) && !ze(r) ? n : r || Be(e) || n;
1689
+ }
1690
+ var pt = async function(e) {
1691
+ let t = this.getOffsetParent || ft, n = this.getDimensions, r = await n(e.floating);
1692
+ return {
1693
+ reference: lt(e.reference, await t(e.floating), e.strategy),
1694
+ floating: {
1695
+ x: 0,
1696
+ y: 0,
1697
+ width: r.width,
1698
+ height: r.height
1699
+ }
1700
+ };
1701
+ };
1702
+ function mt(e) {
1703
+ return Y(e).direction === "rtl";
1704
+ }
1705
+ var ht = {
1706
+ convertOffsetParentRelativeRectToViewportRelativeRect: Qe,
1707
+ getDocumentElement: H,
1708
+ getClippingRect: st,
1709
+ getOffsetParent: ft,
1710
+ getElementRects: pt,
1711
+ getClientRects: $e,
1712
+ getDimensions: ct,
1713
+ getScale: Q,
1714
+ isElement: U,
1715
+ isRTL: mt
1716
+ };
1717
+ function gt(e, t) {
1718
+ return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1719
+ }
1720
+ function _t(e, t) {
1721
+ let n = null, r, i = H(e);
1722
+ function a() {
1723
+ var e;
1724
+ clearTimeout(r), (e = n) == null || e.disconnect(), n = null;
1725
+ }
1726
+ function o(s, c) {
1727
+ s === void 0 && (s = !1), c === void 0 && (c = 1), a();
1728
+ let l = e.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l;
1729
+ if (s || t(), !f || !p) return;
1730
+ let m = N(d), h = N(i.clientWidth - (u + f)), g = N(i.clientHeight - (d + p)), _ = N(u), v = {
1731
+ rootMargin: -m + "px " + -h + "px " + -g + "px " + -_ + "px",
1732
+ threshold: j(0, A(1, c)) || 1
1733
+ }, y = !0;
1734
+ function b(t) {
1735
+ let n = t[0].intersectionRatio;
1736
+ if (n !== c) {
1737
+ if (!y) return o();
1738
+ n ? o(!1, n) : r = setTimeout(() => {
1739
+ o(!1, 1e-7);
1740
+ }, 1e3);
1741
+ }
1742
+ n === 1 && !gt(l, e.getBoundingClientRect()) && o(), y = !1;
1743
+ }
1744
+ try {
1745
+ n = new IntersectionObserver(b, {
1746
+ ...v,
1747
+ root: i.ownerDocument
1748
+ });
1749
+ } catch {
1750
+ n = new IntersectionObserver(b, v);
1751
+ }
1752
+ n.observe(e);
1753
+ }
1754
+ return o(!0), a;
1755
+ }
1756
+ function vt(e, t, n, r) {
1757
+ r === void 0 && (r = {});
1758
+ let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = Ke(e), u = i || a ? [...l ? Z(l) : [], ...t ? Z(t) : []] : [];
1759
+ u.forEach((e) => {
1760
+ i && e.addEventListener("scroll", n, { passive: !0 }), a && e.addEventListener("resize", n);
1761
+ });
1762
+ let d = l && s ? _t(l, n) : null, f = -1, p = null;
1763
+ o && (p = new ResizeObserver((e) => {
1764
+ let [r] = e;
1765
+ r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
1766
+ var e;
1767
+ (e = p) == null || e.observe(t);
1768
+ })), n();
1769
+ }), l && !c && p.observe(l), t && p.observe(t));
1770
+ let m, h = c ? $(e) : null;
1771
+ c && g();
1772
+ function g() {
1773
+ let t = $(e);
1774
+ h && !gt(h, t) && n(), h = t, m = requestAnimationFrame(g);
1775
+ }
1776
+ return n(), () => {
1777
+ var e;
1778
+ u.forEach((e) => {
1779
+ i && e.removeEventListener("scroll", n), a && e.removeEventListener("resize", n);
1780
+ }), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
1781
+ };
1782
+ }
1783
+ var yt = je, bt = Me, xt = Oe, St = (e, t, n) => {
1784
+ let r = /* @__PURE__ */ new Map(), i = {
1785
+ platform: ht,
1786
+ ...n
1787
+ }, a = {
1788
+ ...i.platform,
1789
+ _c: r
1790
+ };
1791
+ return De(e, t, {
1792
+ ...i,
1793
+ platform: a
1794
+ });
1795
+ };
1796
+ //#endregion
1797
+ export { bt as a, yt as i, St as n, n as o, xt as r, t as s, vt as t };
1798
+
1799
+ //# sourceMappingURL=vendor-B82PcruV.js.map