stimulus_plumbers 0.4.15 → 0.4.17

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 (34) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/app/assets/javascripts/stimulus-plumbers/controllers.manifest.json +378 -1
  4. data/app/assets/javascripts/stimulus-plumbers/index.es.js +196 -163
  5. data/app/assets/javascripts/stimulus-plumbers/index.es.js.map +1 -1
  6. data/app/assets/javascripts/stimulus-plumbers/index.umd.js +1 -1
  7. data/app/assets/javascripts/stimulus-plumbers/index.umd.js.map +1 -1
  8. data/docs/component/combobox.md +3 -3
  9. data/docs/component/form.md +49 -14
  10. data/docs/component/indicator.md +1 -1
  11. data/docs/component/progress.md +24 -9
  12. data/docs/guide.md +63 -4
  13. data/lib/stimulus_plumbers/components/combobox/dropdown.rb +1 -1
  14. data/lib/stimulus_plumbers/components/combobox/time.rb +1 -1
  15. data/lib/stimulus_plumbers/components/combobox.rb +1 -1
  16. data/lib/stimulus_plumbers/components/progress/shared.rb +46 -3
  17. data/lib/stimulus_plumbers/components/progress_bar.rb +100 -22
  18. data/lib/stimulus_plumbers/components/progress_ring.rb +3 -2
  19. data/lib/stimulus_plumbers/form/builder.rb +20 -4
  20. data/lib/stimulus_plumbers/form/field.rb +34 -6
  21. data/lib/stimulus_plumbers/form/fields/inputs/progress.rb +30 -0
  22. data/lib/stimulus_plumbers/form/fields/inputs/range.rb +81 -0
  23. data/lib/stimulus_plumbers/form/fields/inputs/text.rb +1 -1
  24. data/lib/stimulus_plumbers/form/fields/renderer.rb +41 -0
  25. data/lib/stimulus_plumbers/helpers/progress_helper.rb +4 -2
  26. data/lib/stimulus_plumbers/themes/schema/progress/ranges.rb +13 -0
  27. data/lib/stimulus_plumbers/themes/schema.rb +17 -6
  28. data/lib/stimulus_plumbers/version.rb +1 -1
  29. data/vendor/ARIA.md +10 -0
  30. data/vendor/component/manifest.json +18 -6
  31. data/vendor/controller/docs/progress.md +69 -9
  32. data/vendor/controller/guide.md +61 -7
  33. data/vendor/controller/manifest.json +378 -1
  34. metadata +4 -1
@@ -20,7 +20,7 @@ function r(e) {
20
20
  }
21
21
  function i(e) {
22
22
  let t = n(e);
23
- return t.length > 0 ? (t[0].focus(), !0) : !1;
23
+ return t.length > 0 && (t[0].focus(), !0);
24
24
  }
25
25
  var a = class {
26
26
  constructor(e, t = {}) {
@@ -125,9 +125,7 @@ var u = {
125
125
  case "Home":
126
126
  a = 0;
127
127
  break;
128
- case "End":
129
- a = this.items.length - 1;
130
- break;
128
+ case "End": a = this.items.length - 1;
131
129
  }
132
130
  this.setCurrentIndex(a);
133
131
  }
@@ -178,9 +176,7 @@ var u = {
178
176
  r.length && this._selectItem(r[r.length - 1]);
179
177
  break;
180
178
  case "Enter":
181
- case " ":
182
- this.listbox.querySelector(`${this.itemSelector}[aria-selected="true"]`)?.click();
183
- break;
179
+ case " ": this.listbox.querySelector(`${this.itemSelector}[aria-selected="true"]`)?.click();
184
180
  }
185
181
  }
186
182
  }, p = (e, t, n) => {
@@ -195,45 +191,45 @@ function m(e, t = {}) {
195
191
  }
196
192
  var h = (e = "a11y") => `${e}-${Math.random().toString(36).substr(2, 9)}`, ee = (e, t = "element") => e.id ||= h(t), g = (e, t, n) => {
197
193
  e.setAttribute(t, n.toString());
198
- }, _ = (e, t) => g(e, "aria-expanded", t), te = (e) => e.getAttribute("aria-expanded") === "true", ne = (e, t) => g(e, "aria-pressed", t), re = (e, t) => g(e, "aria-checked", t), v = (e, t) => g(e, "aria-selected", t), y = (e, t) => t ? e.setAttribute("aria-current", t) : e.removeAttribute("aria-current"), b = (e, t) => t ? e.setAttribute("hidden", "") : e.removeAttribute("hidden"), x = (e, t) => g(e, "aria-hidden", t), S = (e, t) => g(e, "aria-disabled", t), C = (e) => e.getAttribute("aria-disabled") === "true";
199
- function w(e, t) {
194
+ }, _ = (e, t) => g(e, "aria-expanded", t), te = (e) => e.getAttribute("aria-expanded") === "true", ne = (e, t) => g(e, "aria-pressed", t), re = (e, t) => g(e, "aria-checked", t), v = (e, t) => g(e, "aria-selected", t), y = (e, t) => t ? e.setAttribute("aria-current", t) : e.removeAttribute("aria-current"), b = (e, t) => t ? e.setAttribute("hidden", "") : e.removeAttribute("hidden"), x = (e, t) => g(e, "aria-hidden", t), S = (e, t) => g(e, "aria-disabled", t), ie = (e) => e.getAttribute("aria-disabled") === "true";
195
+ function ae(e, t) {
200
196
  g(e, "aria-disabled", t), t ? e.setAttribute("tabindex", "-1") : e.removeAttribute("tabindex");
201
197
  }
202
- var T = (e, t) => g(e, "aria-valuemin", t), E = (e, t) => g(e, "aria-valuemax", t), ie = (e, t) => t == null ? e.removeAttribute("aria-valuenow") : g(e, "aria-valuenow", t), ae = {
198
+ var oe = (e, t) => g(e, "aria-valuemin", t), se = (e, t) => g(e, "aria-valuemax", t), ce = (e, t) => t == null ? e.removeAttribute("aria-valuenow") : g(e, "aria-valuenow", t), C = (e, t) => t == null ? e.removeAttribute("aria-valuetext") : g(e, "aria-valuetext", t), le = {
203
199
  menu: "menu",
204
200
  listbox: "listbox",
205
201
  tree: "tree",
206
202
  grid: "grid",
207
203
  dialog: "dialog"
208
- }, oe = (e, t, n) => {
204
+ }, w = (e, t, n) => {
209
205
  Object.entries(t).forEach(([t, r]) => {
210
206
  e.setAttribute(t, r), n[t] = r;
211
207
  });
212
- }, D = (e, t, n) => n || !e.hasAttribute(t);
213
- function se({ trigger: e, target: t, role: n = null, override: r = !1 }) {
208
+ }, T = (e, t, n) => n || !e.hasAttribute(t);
209
+ function E({ trigger: e, target: t, role: n = null, override: r = !1 }) {
214
210
  let i = {
215
211
  trigger: {},
216
212
  target: {}
217
213
  };
218
214
  if (!e || !t) return i;
219
215
  let a = {}, o = {};
220
- if (n && D(t, "role", r) && (o.role = n), t.id && (D(e, "aria-controls", r) && (a["aria-controls"] = t.id), n === "tooltip" && D(e, "aria-describedby", r) && (a["aria-describedby"] = t.id)), n && D(e, "aria-haspopup", r)) {
221
- let e = ae[n] || "true";
216
+ if (n && T(t, "role", r) && (o.role = n), t.id && (T(e, "aria-controls", r) && (a["aria-controls"] = t.id), n === "tooltip" && T(e, "aria-describedby", r) && (a["aria-describedby"] = t.id)), n && T(e, "aria-haspopup", r)) {
217
+ let e = le[n] || "true";
222
218
  e && (a["aria-haspopup"] = e);
223
219
  }
224
- return oe(t, o, i.target), oe(e, a, i.trigger), i;
220
+ return w(t, o, i.target), w(e, a, i.trigger), i;
225
221
  }
226
- var ce = (e, t) => {
222
+ var D = (e, t) => {
227
223
  t.forEach((t) => {
228
224
  e.hasAttribute(t) && e.removeAttribute(t);
229
225
  });
230
226
  };
231
- function le({ trigger: e, target: t, attributes: n = null }) {
232
- !e || !t || (ce(e, n || [
227
+ function ue({ trigger: e, target: t, attributes: n = null }) {
228
+ !e || !t || (D(e, n || [
233
229
  "aria-controls",
234
230
  "aria-haspopup",
235
231
  "aria-describedby"
236
- ]), (!n || n.includes("role")) && ce(t, ["role"]));
232
+ ]), (!n || n.includes("role")) && D(t, ["role"]));
237
233
  }
238
234
  //#endregion
239
235
  //#region src/requestor.js
@@ -259,33 +255,33 @@ var O = class {
259
255
  };
260
256
  //#endregion
261
257
  //#region src/researcher.js
262
- function ue(e, t) {
258
+ function de(e, t) {
263
259
  let n = 0;
264
260
  for (let r = 0; r < t.length && n < e.length; r++) t[r] === e[n] && n++;
265
261
  return n === e.length;
266
262
  }
267
- function de(e, t) {
263
+ function fe(e, t) {
268
264
  return t.includes(e);
269
265
  }
270
- function fe(e, t) {
266
+ function pe(e, t) {
271
267
  return t.startsWith(e);
272
268
  }
273
- function pe(e) {
274
- return e === "contains" ? de : e === "prefix" ? fe : ue;
269
+ function me(e) {
270
+ return e === "contains" ? fe : e === "prefix" ? pe : de;
275
271
  }
276
- function me(e, t) {
272
+ function he(e, t) {
277
273
  return t === "textContent" ? e.textContent?.trim().toLowerCase() ?? "" : (e.getAttribute(t) ?? "").toLowerCase();
278
274
  }
279
- function he(e, t, n = {}) {
280
- let { strategy: r = "fuzzy", matcher: i, fields: a = ["textContent"] } = n, o = typeof i == "function" ? i : pe(r), s = t.toLowerCase(), c = 0;
275
+ function ge(e, t, n = {}) {
276
+ let { strategy: r = "fuzzy", matcher: i, fields: a = ["textContent"] } = n, o = typeof i == "function" ? i : me(r), s = t.toLowerCase(), c = 0;
281
277
  return e.querySelectorAll("[role=\"option\"]").forEach((e) => {
282
- let t = a.some((t) => o(s, me(e, t)));
278
+ let t = a.some((t) => o(s, he(e, t)));
283
279
  b(e, !t), t && c++;
284
280
  }), c;
285
281
  }
286
282
  //#endregion
287
283
  //#region src/plumbers/plumber/geometry.js
288
- var ge = {
284
+ var _e = {
289
285
  get top() {
290
286
  return "bottom";
291
287
  },
@@ -311,7 +307,7 @@ function k({ x: e, y: t, width: n, height: r }) {
311
307
  bottom: t + r
312
308
  };
313
309
  }
314
- function _e(e, t = "vertical") {
310
+ function ve(e, t = "vertical") {
315
311
  return t === "horizontal" ? e.left + e.width / 2 : e.top + e.height / 2;
316
312
  }
317
313
  function A() {
@@ -322,7 +318,7 @@ function A() {
322
318
  height: window.innerHeight || document.documentElement.clientHeight
323
319
  });
324
320
  }
325
- function ve(e) {
321
+ function ye(e) {
326
322
  if (!(e instanceof HTMLElement)) return !1;
327
323
  let t = A(), n = e.getBoundingClientRect(), r = n.top <= t.height && n.top + n.height > 0, i = n.left <= t.width && n.left + n.width > 0;
328
324
  return r && i;
@@ -334,7 +330,7 @@ var j = {
334
330
  return !0;
335
331
  },
336
332
  hiddenClass: null
337
- }, ye = {
333
+ }, be = {
338
334
  element: null,
339
335
  visible: null,
340
336
  dispatch: !0,
@@ -342,11 +338,11 @@ var j = {
342
338
  }, M = class {
343
339
  constructor(e, t = {}) {
344
340
  this.controller = e;
345
- let { element: n, visible: r, dispatch: i, prefix: a } = Object.assign({}, ye, t);
341
+ let { element: n, visible: r, dispatch: i, prefix: a } = Object.assign({}, be, t);
346
342
  this.element = n || e.element, this.visibleOnly = typeof r == "boolean" ? r : j.visibleOnly, this.visibleCallback = typeof r == "string" ? r : null, this.notify = !!i, this.prefix = typeof a == "string" && a ? a : e.identifier;
347
343
  }
348
344
  get visible() {
349
- return this.element instanceof HTMLElement ? !this.visibleOnly || ve(this.element) && this.isVisible(this.element) : !1;
345
+ return this.element instanceof HTMLElement ? !this.visibleOnly || ye(this.element) && this.isVisible(this.element) : !1;
350
346
  }
351
347
  isVisible(e) {
352
348
  if (this.visibleCallback) {
@@ -375,7 +371,7 @@ var j = {
375
371
  return n instanceof Promise ? await n : n;
376
372
  }
377
373
  }
378
- }, be = {
374
+ }, xe = {
379
375
  normalize(e) {
380
376
  return typeof e == "string" ? e : "";
381
377
  },
@@ -385,7 +381,7 @@ var j = {
385
381
  };
386
382
  //#endregion
387
383
  //#region src/plumbers/formatters/credit_card.js
388
- function xe(e) {
384
+ function Se(e) {
389
385
  let t = 0, n = !1;
390
386
  for (let r = e.length - 1; r >= 0; r--) {
391
387
  let i = parseInt(e[r], 10);
@@ -393,15 +389,15 @@ function xe(e) {
393
389
  }
394
390
  return t % 10 == 0;
395
391
  }
396
- var Se = /\D/g, Ce = /^\d{13,19}$/, we = /(.{4})(?=.)/g, Te = {
392
+ var Ce = /\D/g, we = /^\d{13,19}$/, Te = /(.{4})(?=.)/g, Ee = {
397
393
  normalize(e) {
398
- return typeof e == "string" ? e.replace(Se, "") : "";
394
+ return typeof e == "string" ? e.replace(Ce, "") : "";
399
395
  },
400
396
  validate(e) {
401
- return typeof e != "string" || !Ce.test(e) ? !1 : xe(e);
397
+ return typeof e != "string" || !we.test(e) ? !1 : Se(e);
402
398
  },
403
399
  format(e) {
404
- return typeof e == "string" ? e.replace(we, "$1 ") : "";
400
+ return typeof e == "string" ? e.replace(Te, "$1 ") : "";
405
401
  },
406
402
  cells() {
407
403
  return {
@@ -414,7 +410,7 @@ var Se = /\D/g, Ce = /^\d{13,19}$/, we = /(.{4})(?=.)/g, Te = {
414
410
  length: 0
415
411
  };
416
412
  }
417
- }, N = { 1: 10 }, P = /\D/g, Ee = /^\+\d{7,15}$/, De = {
413
+ }, N = { 1: 10 }, P = /\D/g, De = /^\+\d{7,15}$/, Oe = {
418
414
  normalize(e) {
419
415
  if (typeof e != "string") return "";
420
416
  let t = e.trimStart().startsWith("+"), n = e.replace(P, "");
@@ -422,7 +418,7 @@ var Se = /\D/g, Ce = /^\d{13,19}$/, we = /(.{4})(?=.)/g, Te = {
422
418
  },
423
419
  validate(e) {
424
420
  if (typeof e != "string") return !1;
425
- if (Ee.test(e)) return !0;
421
+ if (De.test(e)) return !0;
426
422
  let t = e.replace(P, "");
427
423
  return Object.values(N).includes(t.length);
428
424
  },
@@ -439,16 +435,16 @@ var Se = /\D/g, Ce = /^\d{13,19}$/, we = /(.{4})(?=.)/g, Te = {
439
435
  }
440
436
  return e;
441
437
  }
442
- }, Oe = /[^\d.,-]/g, ke = /^-?\d+(\.\d+)?$/, Ae = {
438
+ }, ke = /[^\d.,-]/g, Ae = /^-?\d+(\.\d+)?$/, je = {
443
439
  normalize(e) {
444
440
  if (typeof e != "string") return "";
445
- let t = e.replace(Oe, "");
441
+ let t = e.replace(ke, "");
446
442
  if (!t) return "";
447
443
  let n = t.lastIndexOf(","), r = t.lastIndexOf(".");
448
444
  return n > -1 && r > -1 ? n > r ? t.replace(/\./g, "").replace(",", ".") : t.replace(/,/g, "") : n > -1 ? t.slice(n + 1).length <= 2 ? t.replace(",", ".") : t.replace(/,/g, "") : t;
449
445
  },
450
446
  validate(e) {
451
- return typeof e == "string" && ke.test(e);
447
+ return typeof e == "string" && Ae.test(e);
452
448
  },
453
449
  format(e, t = {}) {
454
450
  if (typeof e != "string") return "";
@@ -468,18 +464,18 @@ var Se = /\D/g, Ce = /^\d{13,19}$/, we = /(.{4})(?=.)/g, Te = {
468
464
  return e;
469
465
  }
470
466
  }
471
- }, F = /^\d{4}-\d{2}-\d{2}$/, je = /^(\d{1,4})[/\-.](\d{1,2})[/\-.](\d{1,4})$/, Me = /\D/g, I = {
467
+ }, F = /^\d{4}-\d{2}-\d{2}$/, Me = /^(\d{1,4})[/\-.](\d{1,2})[/\-.](\d{1,4})$/, Ne = /\D/g, I = {
472
468
  normalize(e) {
473
469
  if (typeof e != "string") return "";
474
470
  let t = e.trim();
475
471
  if (F.test(t)) return t;
476
- let n = t.match(je);
472
+ let n = t.match(Me);
477
473
  if (n) {
478
474
  let [, e, t, r] = n;
479
475
  if (e.length === 4) return `${e}-${t.padStart(2, "0")}-${r.padStart(2, "0")}`;
480
476
  if (r.length === 4) return `${r}-${e.padStart(2, "0")}-${t.padStart(2, "0")}`;
481
477
  }
482
- let r = t.replace(Me, "");
478
+ let r = t.replace(Ne, "");
483
479
  if (r.length === 8) {
484
480
  let e = parseInt(r.slice(0, 4), 10);
485
481
  return e >= 1e3 && e <= 9999 ? `${r.slice(0, 4)}-${r.slice(4, 6)}-${r.slice(6, 8)}` : `${r.slice(4, 8)}-${r.slice(0, 2)}-${r.slice(2, 4)}`;
@@ -509,11 +505,11 @@ var Se = /\D/g, Ce = /^\d{13,19}$/, we = /(.{4})(?=.)/g, Te = {
509
505
  return e;
510
506
  }
511
507
  }
512
- }, Ne = /^([01]?\d|2[0-3]):([0-5]\d)$/, L = {
508
+ }, Pe = /^([01]?\d|2[0-3]):([0-5]\d)$/, L = {
513
509
  normalize(e) {
514
510
  if (typeof e != "string") return "";
515
511
  let t = e.trim();
516
- if (Ne.test(t)) {
512
+ if (Pe.test(t)) {
517
513
  let [e, n] = t.split(":");
518
514
  return `${String(parseInt(e, 10)).padStart(2, "0")}:${n}`;
519
515
  }
@@ -536,14 +532,14 @@ var Se = /\D/g, Ce = /^\d{13,19}$/, we = /(.{4})(?=.)/g, Te = {
536
532
  let a = r < 12 ? "AM" : "PM";
537
533
  return `${r % 12 || 12}:${i} ${a}`;
538
534
  }
539
- }, Pe = {
535
+ }, R = {
540
536
  digits: /[^0-9]/g,
541
537
  letters: /[^a-zA-Z]/g,
542
538
  alphanumeric: /[^0-9a-zA-Z]/g
543
539
  }, Fe = {
544
540
  normalize(e, t = {}) {
545
541
  if (typeof e != "string") return "";
546
- let n = Pe[t.charset] ?? Pe.alphanumeric, r = e.replace(n, "").toUpperCase(), i = t.length ?? 0;
542
+ let n = R[t.charset] ?? R.alphanumeric, r = e.replace(n, "").toUpperCase(), i = t.length ?? 0;
547
543
  return i > 0 ? r.slice(0, i) : r;
548
544
  },
549
545
  validate(e, t = {}) {
@@ -560,7 +556,7 @@ var Se = /\D/g, Ce = /^\d{13,19}$/, we = /(.{4})(?=.)/g, Te = {
560
556
  length: e.length ?? 0
561
557
  };
562
558
  }
563
- }, R = {
559
+ }, z = {
564
560
  PLAIN: "plain",
565
561
  CREDIT_CARD: "creditCard",
566
562
  PHONE: "phone",
@@ -568,26 +564,26 @@ var Se = /\D/g, Ce = /^\d{13,19}$/, we = /(.{4})(?=.)/g, Te = {
568
564
  DATE: "date",
569
565
  TIME: "time",
570
566
  CODE: "code"
571
- }, z = /* @__PURE__ */ new Map([
572
- [R.PLAIN, be],
573
- [R.CREDIT_CARD, Te],
574
- [R.PHONE, De],
575
- [R.CURRENCY, Ae],
576
- [R.DATE, I],
577
- [R.TIME, L],
578
- [R.CODE, Fe]
567
+ }, B = /* @__PURE__ */ new Map([
568
+ [z.PLAIN, xe],
569
+ [z.CREDIT_CARD, Ee],
570
+ [z.PHONE, Oe],
571
+ [z.CURRENCY, je],
572
+ [z.DATE, I],
573
+ [z.TIME, L],
574
+ [z.CODE, Fe]
579
575
  ]), Ie = {
580
- type: R.PLAIN,
576
+ type: z.PLAIN,
581
577
  options: {}
582
578
  }, Le = class extends M {
583
579
  static register(e, t) {
584
- z.set(e, t);
580
+ B.set(e, t);
585
581
  }
586
582
  constructor(e, t = {}) {
587
583
  super(e, t), this.type = t.type ?? Ie.type, this.options = t.options ?? Ie.options, this.enhance();
588
584
  }
589
585
  enhance() {
590
- let e = this, t = z.get(e.type) ?? z.get(R.PLAIN), n = {
586
+ let e = this, t = B.get(e.type) ?? B.get(z.PLAIN), n = {
591
587
  normalize: (n) => t.normalize?.(n, e.options) ?? (typeof n == "string" ? n : ""),
592
588
  validate: (n) => t.validate?.(n, e.options) ?? !0,
593
589
  format: (n) => t.format?.(n, e.options) ?? (typeof n == "string" ? n : ""),
@@ -600,7 +596,7 @@ var Se = /\D/g, Ce = /^\d{13,19}$/, we = /(.{4})(?=.)/g, Te = {
600
596
  configurable: !0
601
597
  });
602
598
  }
603
- }, B = (e, t) => new Le(e, t), Re = {
599
+ }, V = (e, t) => new Le(e, t), Re = {
604
600
  groups: [],
605
601
  length: 0
606
602
  }, ze = (e) => {
@@ -682,7 +678,7 @@ var Se = /\D/g, Ce = /^\d{13,19}$/, we = /(.{4})(?=.)/g, Te = {
682
678
  e.textContent = r[n] ?? "", e.toggleAttribute("data-filled", r[n] != null), e.toggleAttribute("data-caret", t && n === r.length);
683
679
  });
684
680
  }
685
- }, Ve = (e, t) => new Be(e, t), V = { RULES: "rules" }, H = {
681
+ }, Ve = (e, t) => new Be(e, t), H = { RULES: "rules" }, U = {
686
682
  WEAK: "weak",
687
683
  FINE: "fine",
688
684
  STRONG: "strong"
@@ -692,22 +688,22 @@ var Se = /\D/g, Ce = /^\d{13,19}$/, we = /(.{4})(?=.)/g, Te = {
692
688
  }, We = (e, t) => {
693
689
  let n = e.pattern == null ? t.length : Ue(e.pattern, t), r = e.min ?? 0, i = e.max ?? Infinity;
694
690
  return n >= r && n <= i;
695
- }, Ge = (e, t, n) => t > 0 && e === t ? H.STRONG : (t === 0 ? 0 : Math.round(e / t * 100)) < (n.low ?? He.low) ? H.WEAK : H.FINE, U = /* @__PURE__ */ new Map([[V.RULES, { score(e, t = [], n = {}) {
691
+ }, Ge = (e, t, n) => t > 0 && e === t ? U.STRONG : (t === 0 ? 0 : Math.round(e / t * 100)) < (n.low ?? He.low) ? U.WEAK : U.FINE, W = /* @__PURE__ */ new Map([[H.RULES, { score(e, t = [], n = {}) {
696
692
  let r = typeof e == "string" ? e : "", i = t.reduce((e, t) => (e[t.key] = We(t, r), e), {}), a = t.filter((e) => i[e.key]).length;
697
693
  return {
698
694
  value: t.length === 0 ? 0 : Math.round(a / t.length * 100),
699
695
  level: Ge(a, t.length, n),
700
696
  rules: i
701
697
  };
702
- } }]]), W = class extends M {
698
+ } }]]), Ke = class extends M {
703
699
  static register(e, t) {
704
- U.set(e, t);
700
+ W.set(e, t);
705
701
  }
706
702
  constructor(e, t = {}) {
707
- super(e, t), this.type = t.type ?? V.RULES, this.enhance();
703
+ super(e, t), this.type = t.type ?? H.RULES, this.enhance();
708
704
  }
709
705
  enhance() {
710
- let e = U.get(this.type) ?? U.get(V.RULES), t = { score: (t, n, r) => e.score(t, n ?? [], r ?? {}) };
706
+ let e = W.get(this.type) ?? W.get(H.RULES), t = { score: (t, n, r) => e.score(t, n ?? [], r ?? {}) };
711
707
  Object.defineProperty(this.controller, "strength", {
712
708
  get() {
713
709
  return t;
@@ -715,7 +711,7 @@ var Se = /\D/g, Ce = /^\d{13,19}$/, we = /(.{4})(?=.)/g, Te = {
715
711
  configurable: !0
716
712
  });
717
713
  }
718
- }, Ke = (e, t) => new W(e, t), qe = /^\d{4}-\d{2}-\d{2}$/;
714
+ }, qe = (e, t) => new Ke(e, t), Je = /^\d{4}-\d{2}-\d{2}$/;
719
715
  function G(e) {
720
716
  return e instanceof Date && !isNaN(e);
721
717
  }
@@ -724,7 +720,7 @@ function K(...e) {
724
720
  if (e.length === 1) {
725
721
  let t = e[0];
726
722
  if (!t) return;
727
- if (typeof t == "string" && qe.test(t)) {
723
+ if (typeof t == "string" && Je.test(t)) {
728
724
  let [e, n, r] = t.split("-").map(Number), i = new Date(e, n - 1, r);
729
725
  if (G(i)) return i;
730
726
  } else {
@@ -738,7 +734,7 @@ function K(...e) {
738
734
  }
739
735
  //#endregion
740
736
  //#region src/plumbers/calendar.js
741
- var Je = 7, Ye = 12, q = 10, Xe = {
737
+ var Ye = 7, Xe = 12, q = 10, Ze = {
742
738
  locales: ["default"],
743
739
  today: "",
744
740
  day: null,
@@ -753,15 +749,15 @@ var Je = 7, Ye = 12, q = 10, Xe = {
753
749
  disabledYears: [],
754
750
  firstDayOfWeek: 0,
755
751
  onNavigated: "navigated"
756
- }, Ze = class extends M {
752
+ }, Qe = class extends M {
757
753
  constructor(e, t = {}) {
758
754
  super(e, t);
759
- let n = Object.assign({}, Xe, t), { onNavigated: r, since: i, till: a, firstDayOfWeek: o } = n;
760
- this.onNavigated = r, this.since = K(i), this.till = K(a), this.firstDayOfWeek = 0 <= o && o < 7 ? o : Xe.firstDayOfWeek;
755
+ let n = Object.assign({}, Ze, t), { onNavigated: r, since: i, till: a, firstDayOfWeek: o } = n;
756
+ this.onNavigated = r, this.since = K(i), this.till = K(a), this.firstDayOfWeek = 0 <= o && o < 7 ? o : Ze.firstDayOfWeek;
761
757
  let { disabledDates: s, disabledWeekdays: c, disabledDays: l, disabledMonths: u, disabledYears: d } = n;
762
758
  this.disabledDates = Array.isArray(s) ? s : [], this.disabledWeekdays = Array.isArray(c) ? c : [], this.disabledDays = Array.isArray(l) ? l : [], this.disabledMonths = Array.isArray(u) ? u : [], this.disabledYears = Array.isArray(d) ? d : [];
763
759
  let { today: f, day: p, month: m, year: h } = n;
764
- this.now = K(f) || /* @__PURE__ */ new Date(), typeof h == "number" && typeof m == "number" && typeof p == "number" ? this.current = K(h, m, p) : this.current = this.now, this.build(), this.enhance();
760
+ this.now = K(f) || /* @__PURE__ */ new Date(), this.current = typeof h == "number" && typeof m == "number" && typeof p == "number" ? K(h, m, p) : this.now, this.build(), this.enhance();
765
761
  }
766
762
  build() {
767
763
  this.daysOfWeek = this.buildDaysOfWeek(), this.daysOfMonth = this.buildDaysOfMonth(), this.monthsOfYear = this.buildMonthsOfYear(), this.yearsOfDecade = this.buildYearsOfDecade();
@@ -797,7 +793,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
797
793
  let a = new Date(t, e, i);
798
794
  n.push(r(a));
799
795
  }
800
- let s = n.length % Je, c = s === 0 ? 0 : Je - s;
796
+ let s = n.length % Ye, c = s === 0 ? 0 : Ye - s;
801
797
  for (let i = 1; i <= c; i++) {
802
798
  let a = new Date(t, e + 1, i);
803
799
  n.push(r(a));
@@ -806,7 +802,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
806
802
  }
807
803
  buildMonthsOfYear() {
808
804
  let e = new Intl.DateTimeFormat(this.localesValue, { month: "long" }), t = new Intl.DateTimeFormat(this.localesValue, { month: "short" }), n = new Intl.DateTimeFormat(this.localesValue, { month: "numeric" }), r = [];
809
- for (let i = 0; i < Ye; i++) {
805
+ for (let i = 0; i < Xe; i++) {
810
806
  let a = new Date(this.year, i), o = new Date(this.year, i, 1), s = new Date(this.year, i + 1, 0), c = t.format(a), l = e.format(a), u = this.since && s < this.since || this.till && o > this.till, d = this.disabledMonths.some((e) => i == e || c === e || l === e);
811
807
  r.push({
812
808
  date: a,
@@ -973,7 +969,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
973
969
  };
974
970
  } });
975
971
  }
976
- }, J = (e, t) => new Ze(e, t), Qe = class extends M {
972
+ }, J = (e, t) => new Qe(e, t), $e = class extends M {
977
973
  constructor(e, t = {}) {
978
974
  super(e, t), this.handle = this.handle.bind(this), this.onSelect = t.onSelect || null;
979
975
  }
@@ -999,7 +995,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
999
995
  iso: i
1000
996
  } });
1001
997
  }
1002
- }, $e = class extends M {
998
+ }, et = class extends M {
1003
999
  constructor(e, t = {}) {
1004
1000
  super(e, t), this.handle = this.handle.bind(this);
1005
1001
  }
@@ -1016,7 +1012,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1016
1012
  let n = parseInt(t.dataset.month, 10);
1017
1013
  isNaN(n) || this.dispatch("selected", { detail: { month: n } });
1018
1014
  }
1019
- }, et = class extends M {
1015
+ }, tt = class extends M {
1020
1016
  constructor(e, t = {}) {
1021
1017
  super(e, t), this.handle = this.handle.bind(this);
1022
1018
  }
@@ -1033,14 +1029,14 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1033
1029
  let n = parseInt(t.dataset.year, 10);
1034
1030
  isNaN(n) || this.dispatch("selected", { detail: { year: n } });
1035
1031
  }
1036
- }, tt = (e, t) => new Qe(e, t), nt = (e, t) => new $e(e, t), rt = (e, t) => new et(e, t), Y = {
1032
+ }, nt = (e, t) => new $e(e, t), rt = (e, t) => new et(e, t), it = (e, t) => new tt(e, t), Y = {
1037
1033
  content: null,
1038
1034
  url: "",
1039
1035
  reload: "never",
1040
1036
  stale: 3600,
1041
1037
  onLoad: "canLoad",
1042
1038
  onLoaded: "contentLoaded"
1043
- }, it = class extends M {
1039
+ }, at = class extends M {
1044
1040
  constructor(e, t = {}) {
1045
1041
  super(e, t);
1046
1042
  let n = Object.assign({}, Y, t), { content: r, url: i, reload: a, stale: o } = n;
@@ -1079,7 +1075,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1079
1075
  let e = this;
1080
1076
  Object.assign(this.controller, { load: e.load.bind(e) });
1081
1077
  }
1082
- }, at = (e, t) => new it(e, t), X = class extends M {
1078
+ }, ot = (e, t) => new at(e, t), X = class extends M {
1083
1079
  observe(e) {
1084
1080
  this._handler = e, this.events.forEach((t) => window.addEventListener(t, e, !0));
1085
1081
  }
@@ -1092,21 +1088,21 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1092
1088
  e.unobserve(), t();
1093
1089
  };
1094
1090
  }
1095
- }, ot = {
1091
+ }, st = {
1096
1092
  trigger: null,
1097
1093
  events: ["click"],
1098
1094
  onDismissed: "dismissed"
1099
- }, st = class extends X {
1095
+ }, ct = class extends X {
1100
1096
  constructor(e, t = {}) {
1101
1097
  super(e, t);
1102
- let { trigger: n, events: r, onDismissed: i } = Object.assign({}, ot, t);
1098
+ let { trigger: n, events: r, onDismissed: i } = Object.assign({}, st, t);
1103
1099
  this.onDismissed = i, this.trigger = n || this.element, this.events = r, this.enhance(), this.observe(this.dismiss);
1104
1100
  }
1105
1101
  dismiss = async (e) => {
1106
1102
  let { target: t } = e;
1107
1103
  t instanceof HTMLElement && (this.element.contains(t) || this.visible && (this.dispatch("dismiss"), await this.awaitCallback(this.onDismissed, { target: this.trigger }), this.dispatch("dismissed")));
1108
1104
  };
1109
- }, Z = (e, t) => new st(e, t), ct = {
1105
+ }, Z = (e, t) => new ct(e, t), lt = {
1110
1106
  anchor: null,
1111
1107
  events: ["click"],
1112
1108
  placement: "bottom",
@@ -1114,11 +1110,11 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1114
1110
  onFlipped: "flipped",
1115
1111
  ariaRole: null,
1116
1112
  respectMotion: !0
1117
- }, lt = class extends X {
1113
+ }, ut = class extends X {
1118
1114
  constructor(e, t = {}) {
1119
1115
  super(e, t);
1120
- let { anchor: n, events: r, placement: i, alignment: a, onFlipped: o, ariaRole: s, respectMotion: c } = Object.assign({}, ct, t);
1121
- this.anchor = n, this.events = r, this.placement = i, this.alignment = a, this.onFlipped = o, this.ariaRole = s, this.respectMotion = c, this.prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches, this.anchor && this.element && se({
1116
+ let { anchor: n, events: r, placement: i, alignment: a, onFlipped: o, ariaRole: s, respectMotion: c } = Object.assign({}, lt, t);
1117
+ this.anchor = n, this.events = r, this.placement = i, this.alignment = a, this.onFlipped = o, this.ariaRole = s, this.respectMotion = c, this.prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches, this.anchor && this.element && E({
1122
1118
  trigger: this.anchor,
1123
1119
  target: this.element,
1124
1120
  role: this.ariaRole
@@ -1136,7 +1132,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1136
1132
  }), this.dispatch("flipped", { detail: { placement: e } });
1137
1133
  };
1138
1134
  flippedRect(e, t) {
1139
- let n = this.quadrumRect(e, A()), r = [this.placement, ge[this.placement]], i = {};
1135
+ let n = this.quadrumRect(e, A()), r = [this.placement, _e[this.placement]], i = {};
1140
1136
  for (; !Object.keys(i).length && r.length > 0;) {
1141
1137
  let a = r.shift();
1142
1138
  if (!this.biggerRectThan(n[a], t)) continue;
@@ -1233,11 +1229,11 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1233
1229
  enhance() {
1234
1230
  super.enhance(), this.controller.flip = this.flip;
1235
1231
  }
1236
- }, ut = (e, t) => new lt(e, t), dt = {
1232
+ }, dt = (e, t) => new ut(e, t), ft = {
1237
1233
  moveKey: "Alt",
1238
1234
  onMoved: null,
1239
1235
  orientation: "vertical"
1240
- }, ft = {
1236
+ }, pt = {
1241
1237
  vertical: {
1242
1238
  back: "ArrowUp",
1243
1239
  forward: "ArrowDown"
@@ -1246,11 +1242,11 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1246
1242
  back: "ArrowLeft",
1247
1243
  forward: "ArrowRight"
1248
1244
  }
1249
- }, pt = class extends M {
1245
+ }, mt = class extends M {
1250
1246
  constructor(e, t = {}) {
1251
1247
  super(e, t);
1252
- let { moveKey: n, onMoved: r, orientation: i } = Object.assign({}, dt, t);
1253
- this.moveKey = u[n] ? n : dt.moveKey, this.onMoved = r, this.orientation = i, this.draggingItem = null, this.onKeydown = this.onKeydown.bind(this);
1248
+ let { moveKey: n, onMoved: r, orientation: i } = Object.assign({}, ft, t);
1249
+ this.moveKey = u[n] ? n : ft.moveKey, this.onMoved = r, this.orientation = i, this.draggingItem = null, this.onKeydown = this.onKeydown.bind(this);
1254
1250
  }
1255
1251
  get items() {
1256
1252
  return this.controller.itemTargets;
@@ -1268,7 +1264,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1268
1264
  e.forEach((e) => this.detachItem(e));
1269
1265
  }
1270
1266
  resolveMoveKeys(e) {
1271
- let { back: t, forward: n } = ft[this.orientation];
1267
+ let { back: t, forward: n } = pt[this.orientation];
1272
1268
  return this.orientation === "horizontal" && getComputedStyle(e).direction === "rtl" ? {
1273
1269
  back: n,
1274
1270
  forward: t
@@ -1307,9 +1303,9 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1307
1303
  return this.draggingItem = null, this.dispatch("reordered", { detail: { itemIds: this.orderedIds() } }), n;
1308
1304
  }
1309
1305
  midpointOf(e) {
1310
- return _e(e.getBoundingClientRect(), this.orientation);
1306
+ return ve(e.getBoundingClientRect(), this.orientation);
1311
1307
  }
1312
- }, mt = (e, t) => new pt(e, t), ht = {
1308
+ }, ht = (e, t) => new mt(e, t), gt = {
1313
1309
  events: ["resize"],
1314
1310
  boundaries: [
1315
1311
  "top",
@@ -1318,10 +1314,10 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1318
1314
  ],
1319
1315
  onShifted: "shifted",
1320
1316
  respectMotion: !0
1321
- }, gt = class extends X {
1317
+ }, _t = class extends X {
1322
1318
  constructor(e, t = {}) {
1323
1319
  super(e, t);
1324
- let { onShifted: n, events: r, boundaries: i, respectMotion: a } = Object.assign({}, ht, t);
1320
+ let { onShifted: n, events: r, boundaries: i, respectMotion: a } = Object.assign({}, gt, t);
1325
1321
  this.onShifted = n, this.events = r, this.boundaries = i, this.respectMotion = a, this.prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches, this.enhance(), this.observe(this.shift);
1326
1322
  }
1327
1323
  shift = async () => {
@@ -1338,7 +1334,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1338
1334
  height: e.height
1339
1335
  });
1340
1336
  for (let e of this.boundaries) {
1341
- let t = this.directionDistance(i, e, r), a = ge[e];
1337
+ let t = this.directionDistance(i, e, r), a = _e[e];
1342
1338
  t < 0 ? i[a] + t >= r[a] && !n[a] && (n[e] = t) : n[e] = "";
1343
1339
  }
1344
1340
  return n;
@@ -1370,13 +1366,13 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1370
1366
  enhance() {
1371
1367
  super.enhance(), this.controller.shift = this.shift;
1372
1368
  }
1373
- }, _t = (e, t) => new gt(e, t), vt = {
1369
+ }, vt = (e, t) => new _t(e, t), yt = {
1374
1370
  visibility: "visibility",
1375
1371
  onShown: "shown",
1376
1372
  onHidden: "hidden"
1377
- }, yt = class extends M {
1373
+ }, bt = class extends M {
1378
1374
  constructor(e, t = {}) {
1379
- let { visibility: n, onShown: r, onHidden: i, activator: a } = Object.assign({}, vt, t), o = typeof n == "string" ? n : vt.namespace, s = typeof t.visible == "string" ? t.visible : "isVisible";
1375
+ let { visibility: n, onShown: r, onHidden: i, activator: a } = Object.assign({}, yt, t), o = typeof n == "string" ? n : yt.namespace, s = typeof t.visible == "string" ? t.visible : "isVisible";
1380
1376
  (typeof t.visible != "boolean" || t.visible) && (t.visible = `${o}.${s}`), super(e, t), this.visibility = o, this.visibilityResolver = s, this.onShown = r, this.onHidden = i, this.activator = a instanceof HTMLElement ? a : null, this.enhance(), this.element instanceof HTMLElement && this.activate(this.isVisible(this.element));
1381
1377
  }
1382
1378
  isVisible(e) {
@@ -1409,7 +1405,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1409
1405
  return t;
1410
1406
  } });
1411
1407
  }
1412
- }, Q = (e, t) => new yt(e, t), bt = 4, xt = class extends e {
1408
+ }, Q = (e, t) => new bt(e, t), xt = 4, St = class extends e {
1413
1409
  static targets = ["grid"];
1414
1410
  static values = {
1415
1411
  current: Number,
@@ -1431,7 +1427,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1431
1427
  }
1432
1428
  };
1433
1429
  initialize() {
1434
- this.selector = rt(this), J(this, {
1430
+ this.selector = it(this), J(this, {
1435
1431
  today: this.todayValue,
1436
1432
  year: this.currentValue || void 0,
1437
1433
  since: this.sinceValue || null,
@@ -1475,17 +1471,17 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1475
1471
  }
1476
1472
  let a = document.createElement("div");
1477
1473
  a.setAttribute("role", "rowgroup");
1478
- for (let e = 0; e < i.length; e += bt) {
1474
+ for (let e = 0; e < i.length; e += xt) {
1479
1475
  let t = document.createElement("div");
1480
1476
  t.setAttribute("role", "row");
1481
- for (let n of i.slice(e, e + bt)) t.appendChild(n);
1477
+ for (let n of i.slice(e, e + xt)) t.appendChild(n);
1482
1478
  a.appendChild(t);
1483
1479
  }
1484
1480
  this.gridTarget.replaceChildren(a);
1485
1481
  }
1486
- }, St = class extends e {
1482
+ }, Ct = class extends e {
1487
1483
  initialize() {
1488
- this.selector = rt(this);
1484
+ this.selector = it(this);
1489
1485
  }
1490
1486
  connect() {
1491
1487
  this.selector.attach();
@@ -1493,7 +1489,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1493
1489
  disconnect() {
1494
1490
  this.selector.detach();
1495
1491
  }
1496
- }, Ct = class extends e {
1492
+ }, wt = class extends e {
1497
1493
  static targets = ["daysOfWeek", "daysOfMonth"];
1498
1494
  static classes = [
1499
1495
  "dayOfWeek",
@@ -1538,7 +1534,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1538
1534
  }
1539
1535
  };
1540
1536
  initialize() {
1541
- this.selector = tt(this, { onSelect: "select" }), J(this, {
1537
+ this.selector = nt(this, { onSelect: "select" }), J(this, {
1542
1538
  today: this.todayValue,
1543
1539
  since: this.sinceValue || null,
1544
1540
  till: this.tillValue || null
@@ -1627,9 +1623,9 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1627
1623
  }
1628
1624
  this.daysOfMonthTarget.replaceChildren(...r);
1629
1625
  }
1630
- }, wt = class extends e {
1626
+ }, Tt = class extends e {
1631
1627
  initialize() {
1632
- this.selector = tt(this);
1628
+ this.selector = nt(this);
1633
1629
  }
1634
1630
  connect() {
1635
1631
  this.selector.attach();
@@ -1637,7 +1633,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1637
1633
  disconnect() {
1638
1634
  this.selector.detach();
1639
1635
  }
1640
- }, Tt = 4, Et = class extends e {
1636
+ }, Et = 4, Dt = class extends e {
1641
1637
  static targets = ["grid"];
1642
1638
  static values = {
1643
1639
  current: Number,
@@ -1667,7 +1663,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1667
1663
  }
1668
1664
  };
1669
1665
  initialize() {
1670
- this.selector = nt(this), J(this, {
1666
+ this.selector = rt(this), J(this, {
1671
1667
  today: this.todayValue,
1672
1668
  year: this.currentValue || void 0,
1673
1669
  since: this.sinceValue || null,
@@ -1712,17 +1708,17 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1712
1708
  }
1713
1709
  let o = document.createElement("div");
1714
1710
  o.setAttribute("role", "rowgroup");
1715
- for (let e = 0; e < i.length; e += Tt) {
1711
+ for (let e = 0; e < i.length; e += Et) {
1716
1712
  let t = document.createElement("div");
1717
1713
  t.setAttribute("role", "row");
1718
- for (let n of i.slice(e, e + Tt)) t.appendChild(n);
1714
+ for (let n of i.slice(e, e + Et)) t.appendChild(n);
1719
1715
  o.appendChild(t);
1720
1716
  }
1721
1717
  this.gridTarget.replaceChildren(o);
1722
1718
  }
1723
- }, Dt = class extends e {
1719
+ }, Ot = class extends e {
1724
1720
  initialize() {
1725
- this.selector = nt(this);
1721
+ this.selector = rt(this);
1726
1722
  }
1727
1723
  connect() {
1728
1724
  this.selector.attach();
@@ -1730,7 +1726,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1730
1726
  disconnect() {
1731
1727
  this.selector.detach();
1732
1728
  }
1733
- }, Ot = class extends e {
1729
+ }, kt = class extends e {
1734
1730
  static targets = ["master", "item"];
1735
1731
  connect() {
1736
1732
  this.recompute();
@@ -1750,7 +1746,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1750
1746
  enabledItems() {
1751
1747
  return this.itemTargets.filter((e) => !e.disabled);
1752
1748
  }
1753
- }, kt = class extends e {
1749
+ }, At = class extends e {
1754
1750
  static targets = ["source"];
1755
1751
  static values = { contentType: {
1756
1752
  type: String,
@@ -1784,7 +1780,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1784
1780
  "month",
1785
1781
  "year",
1786
1782
  "decade"
1787
- ], At = class extends e {
1783
+ ], jt = class extends e {
1788
1784
  static targets = [
1789
1785
  "previous",
1790
1786
  "next",
@@ -1921,7 +1917,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1921
1917
  }
1922
1918
  this.hasCalendarYearOutlet && b(this.calendarYearOutletElement, !t), this.hasCalendarDecadeOutlet && b(this.calendarDecadeOutletElement, !n);
1923
1919
  }
1924
- }, jt = class extends e {
1920
+ }, Mt = class extends e {
1925
1921
  static targets = [
1926
1922
  "listbox",
1927
1923
  "loading",
@@ -1952,7 +1948,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1952
1948
  }
1953
1949
  onSelect(e) {
1954
1950
  let t = e.target.closest("[role=\"option\"]");
1955
- !t || C(t) || this.select(t.dataset.value ?? "");
1951
+ !t || ie(t) || this.select(t.dataset.value ?? "");
1956
1952
  }
1957
1953
  select(e) {
1958
1954
  let t = this.listboxTarget.querySelectorAll("[role=\"option\"]");
@@ -1975,7 +1971,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1975
1971
  e.name !== "AbortError" && console.error("[combobox-dropdown] fetch failed", e);
1976
1972
  }).finally(() => this.setLoading(!1)), this.delayValue);
1977
1973
  } else {
1978
- let t = he(this.listboxTarget, e);
1974
+ let t = ge(this.listboxTarget, e);
1979
1975
  this.setEmpty(t === 0);
1980
1976
  }
1981
1977
  }
@@ -1988,7 +1984,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
1988
1984
  setEmpty(e) {
1989
1985
  this.hasEmptyTarget && b(this.emptyTarget, !e);
1990
1986
  }
1991
- }, Mt = class extends e {
1987
+ }, Nt = class extends e {
1992
1988
  static targets = [
1993
1989
  "hour",
1994
1990
  "minute",
@@ -2024,12 +2020,12 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2024
2020
  selectedValue(e) {
2025
2021
  return e?.querySelector("[aria-selected=\"true\"]")?.dataset.value ?? null;
2026
2022
  }
2027
- }, Nt = class extends e {
2023
+ }, Pt = class extends e {
2028
2024
  static targets = ["trigger"];
2029
2025
  connect() {
2030
2026
  Z(this, { trigger: this.hasTriggerTarget ? this.triggerTarget : null });
2031
2027
  }
2032
- }, Pt = class extends e {
2028
+ }, Ft = class extends e {
2033
2029
  static targets = ["anchor", "reference"];
2034
2030
  static values = {
2035
2031
  placement: {
@@ -2054,7 +2050,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2054
2050
  console.error("FlipperController requires an anchor target. Add data-flipper-target=\"anchor\" to your element.");
2055
2051
  return;
2056
2052
  }
2057
- ut(this, {
2053
+ dt(this, {
2058
2054
  element: this.referenceTarget,
2059
2055
  anchor: this.anchorTarget,
2060
2056
  placement: this.placementValue,
@@ -2062,7 +2058,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2062
2058
  ariaRole: this.roleValue
2063
2059
  });
2064
2060
  }
2065
- }, Ft = class extends e {
2061
+ }, It = class extends e {
2066
2062
  static targets = ["trigger", "input"];
2067
2063
  static values = {
2068
2064
  value: String,
@@ -2087,7 +2083,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2087
2083
  valueValueChanged(e) {
2088
2084
  this.hasInputTarget && (this.inputTarget.value = e), this.dispatch("changed", { detail: { value: e } });
2089
2085
  }
2090
- }, It = class extends e {
2086
+ }, Lt = class extends e {
2091
2087
  static targets = ["input", "cell"];
2092
2088
  static values = {
2093
2089
  format: {
@@ -2104,19 +2100,19 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2104
2100
  }
2105
2101
  };
2106
2102
  connect() {
2107
- B(this, {
2103
+ V(this, {
2108
2104
  type: this.formatValue,
2109
2105
  options: this.optionsValue
2110
2106
  }), this.attachCells(), this.primeFilledState(), this.format(this.readValue());
2111
2107
  }
2112
2108
  formatValueChanged() {
2113
- this.formatter && (B(this, {
2109
+ this.formatter && (V(this, {
2114
2110
  type: this.formatValue,
2115
2111
  options: this.optionsValue
2116
2112
  }), this.attachCells(), this.primeFilledState(), this.format(this.readValue()));
2117
2113
  }
2118
2114
  optionsValueChanged() {
2119
- this.formatter && (B(this, {
2115
+ this.formatter && (V(this, {
2120
2116
  type: this.formatValue,
2121
2117
  options: this.optionsValue
2122
2118
  }), this.attachCells(), this.primeFilledState(), this.format(this.readValue()));
@@ -2188,7 +2184,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2188
2184
  primeFilledState() {
2189
2185
  this.wasFull = this.isFull(this.formatter.normalize(this.readValue()));
2190
2186
  }
2191
- }, Lt = class extends e {
2187
+ }, Rt = class extends e {
2192
2188
  static targets = ["input", "clear"];
2193
2189
  initialize() {
2194
2190
  this.onInput = this.draw.bind(this), this.onEscape = this.handleEscape.bind(this);
@@ -2211,7 +2207,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2211
2207
  handleEscape(e) {
2212
2208
  e.key === "Escape" && this.inputTarget.value !== "" && (e.preventDefault(), this.clear());
2213
2209
  }
2214
- }, Rt = class extends e {
2210
+ }, zt = class extends e {
2215
2211
  static targets = [
2216
2212
  "input",
2217
2213
  "toggle",
@@ -2244,7 +2240,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2244
2240
  let e = this.revealedValue ? this.concealLabelValue : this.revealLabelValue;
2245
2241
  e && this.toggleTarget.setAttribute("aria-label", e);
2246
2242
  }
2247
- }, zt = class extends e {
2243
+ }, Bt = class extends e {
2248
2244
  static targets = ["modal", "overlay"];
2249
2245
  initialize() {
2250
2246
  this.onCancel = this.close.bind(this);
@@ -2276,12 +2272,12 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2276
2272
  let t = this.modalTarget.getBoundingClientRect();
2277
2273
  (e.clientY < t.top || e.clientY > t.bottom || e.clientX < t.left || e.clientX > t.right) && this.close();
2278
2274
  };
2279
- }, Bt = class extends e {
2275
+ }, Vt = class extends e {
2280
2276
  static targets = ["content"];
2281
2277
  connect() {
2282
- _t(this, { element: this.hasContentTarget ? this.contentTarget : null });
2278
+ vt(this, { element: this.hasContentTarget ? this.contentTarget : null });
2283
2279
  }
2284
- }, Vt = class extends e {
2280
+ }, Ht = class extends e {
2285
2281
  static targets = [
2286
2282
  "input",
2287
2283
  "rule",
@@ -2313,7 +2309,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2313
2309
  }
2314
2310
  };
2315
2311
  connect() {
2316
- this._requestor = new O(), this._level = null, Ke(this, { type: this.scorerValue }), this.score();
2312
+ this._requestor = new O(), this._level = null, qe(this, { type: this.scorerValue }), this.score();
2317
2313
  }
2318
2314
  disconnect() {
2319
2315
  this._requestor?.cancel();
@@ -2342,7 +2338,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2342
2338
  this.levelTarget.textContent = t;
2343
2339
  }, this.announceDelayValue);
2344
2340
  }
2345
- }, Ht = class extends e {
2341
+ }, Ut = class extends e {
2346
2342
  static targets = [
2347
2343
  "trigger",
2348
2344
  "panel",
@@ -2374,7 +2370,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2374
2370
  }
2375
2371
  };
2376
2372
  connect() {
2377
- at(this, {
2373
+ ot(this, {
2378
2374
  element: this.hasPanelTarget ? this.panelTarget : null,
2379
2375
  url: this.hasUrlValue ? this.urlValue : null
2380
2376
  }), this.hasPanelTarget && (Q(this, {
@@ -2425,8 +2421,17 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2425
2421
  contentLoader() {
2426
2422
  if (this.hasTemplateTarget) return this.templateTarget instanceof HTMLTemplateElement ? this.templateTarget.content : this.templateTarget.innerHTML;
2427
2423
  }
2428
- }, Ut = class extends e {
2429
- static targets = ["fill", "meter"];
2424
+ }, Wt = [
2425
+ "percent",
2426
+ "value",
2427
+ "value_max"
2428
+ ], Gt = class extends e {
2429
+ static targets = [
2430
+ "fill",
2431
+ "input",
2432
+ "meter",
2433
+ "value"
2434
+ ];
2430
2435
  static values = {
2431
2436
  variant: {
2432
2437
  type: String,
@@ -2458,13 +2463,17 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2458
2463
  segmentMode: {
2459
2464
  type: String,
2460
2465
  default: "discrete"
2466
+ },
2467
+ format: {
2468
+ type: String,
2469
+ default: ""
2461
2470
  }
2462
2471
  };
2463
2472
  connect() {
2464
- this.variantValue === "ring" && this.hasFillTarget && this.setCircumference(this.fillTarget), this.render();
2473
+ this.variantValue === "ring" && this.hasFillTarget && this.setCircumference(this.fillTarget), this.variantValue === "range" && (this.currentValue = Number(this.rangeInput.value)), this.render();
2465
2474
  }
2466
2475
  setValue(e) {
2467
- this.currentValue = this.clamp(e), this.render(), this.dispatch("changed", { detail: {
2476
+ this.currentValue = this.clamp(e), this.variantValue === "range" && (this.rangeInput.value = `${this.currentValue}`), this.render(), this.dispatch("changed", { detail: {
2468
2477
  value: this.currentValue,
2469
2478
  min: this.minValue,
2470
2479
  max: this.maxValue
@@ -2479,15 +2488,39 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2479
2488
  render() {
2480
2489
  switch (this.variantValue) {
2481
2490
  case "meter": return this.renderMeter();
2491
+ case "range": return this.renderRange();
2482
2492
  case "ring":
2483
2493
  case "bar":
2484
- case "segmented": return T(this.element, this.minValue), E(this.element, this.maxValue), ie(this.element, this.indeterminateValue ? null : this.currentValue), this.element.classList.toggle("sp-progress-indeterminate", this.indeterminateValue), this.variantValue === "ring" ? this.renderRing() : this.variantValue === "segmented" ? this.renderSegmented() : this.renderBar();
2494
+ case "segmented": return oe(this.element, this.minValue), se(this.element, this.maxValue), ce(this.element, this.indeterminateValue ? null : this.clamp(this.currentValue)), this.element.classList.toggle("sp-progress-indeterminate", this.indeterminateValue), this.renderValueText(), this.variantValue === "ring" ? this.renderRing() : this.variantValue === "segmented" ? this.renderSegmented() : this.renderBar();
2485
2495
  default: return;
2486
2496
  }
2487
2497
  }
2488
2498
  percent() {
2489
2499
  let e = this.maxValue - this.minValue;
2490
- return e <= 0 ? 0 : (this.currentValue - this.minValue) / e * 100;
2500
+ return e <= 0 ? 0 : (this.clamp(this.currentValue) - this.minValue) / e * 100;
2501
+ }
2502
+ formattedValue() {
2503
+ let e = this.clamp(this.currentValue);
2504
+ switch (this.formatValue) {
2505
+ case "percent": return `${Math.round(this.percent())}%`;
2506
+ case "value": return `${e}`;
2507
+ case "value_max": return `${e} / ${this.maxValue}`;
2508
+ default: return "";
2509
+ }
2510
+ }
2511
+ renderValueText() {
2512
+ if (!this.hasValueTarget || !Wt.includes(this.formatValue)) return;
2513
+ let e = this.indeterminateValue ? "" : this.formattedValue();
2514
+ this.valueTarget.textContent = e, this.formatValue !== "percent" && this.variantValue !== "range" && C(this.element, e || null);
2515
+ }
2516
+ get rangeInput() {
2517
+ return this.hasInputTarget ? this.inputTarget : this.element;
2518
+ }
2519
+ refresh() {
2520
+ this.setValue(Number(this.rangeInput.value));
2521
+ }
2522
+ renderRange() {
2523
+ this.rangeInput.style.setProperty("--sp-progress-percent", `${this.percent()}`), this.renderValueText();
2491
2524
  }
2492
2525
  renderBar() {
2493
2526
  if (this.hasFillTarget) {
@@ -2495,7 +2528,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2495
2528
  this.fillTarget.style.width = `${this.indeterminateFractionValue * 100}%`;
2496
2529
  return;
2497
2530
  }
2498
- this.fillTarget.style.width = `${this.percent()}%`;
2531
+ this.fillTarget.style.width = `${this.percent()}%`, this.element.style.setProperty("--sp-progress-percent", `${this.percent()}`);
2499
2532
  }
2500
2533
  }
2501
2534
  renderSegmented() {
@@ -2532,7 +2565,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2532
2565
  let e = this.meterTarget;
2533
2566
  e.value = this.currentValue, e.min = this.minValue, e.max = this.maxValue, this.hasLowValue && (e.low = this.lowValue), this.hasHighValue && (e.high = this.highValue), this.hasOptimumValue && (e.optimum = this.optimumValue);
2534
2567
  }
2535
- }, Wt = class extends e {
2568
+ }, Kt = class extends e {
2536
2569
  static targets = [
2537
2570
  "item",
2538
2571
  "handle",
@@ -2553,7 +2586,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2553
2586
  }
2554
2587
  };
2555
2588
  connect() {
2556
- this.reorderable = mt(this, {
2589
+ this.reorderable = ht(this, {
2557
2590
  moveKey: this.moveKeyValue,
2558
2591
  orientation: this.orientationValue,
2559
2592
  onMoved: "moved"
@@ -2569,7 +2602,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2569
2602
  this.reorderable?.detachItem(e), this.rovingTabIndex?.updateItems(this.itemTargets);
2570
2603
  }
2571
2604
  editingValueChanged(e) {
2572
- this.triggerTargets.forEach((t) => w(t, e));
2605
+ this.triggerTargets.forEach((t) => ae(t, e));
2573
2606
  }
2574
2607
  toggleEditing() {
2575
2608
  this.editingValue = !this.editingValue;
@@ -2594,7 +2627,7 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2594
2627
  moved(e) {
2595
2628
  this.rovingTabIndex?.updateItems(this.itemTargets), this.rovingTabIndex.setCurrentIndex(this.itemTargets.indexOf(e));
2596
2629
  }
2597
- }, Gt = class extends e {
2630
+ }, qt = class extends e {
2598
2631
  static targets = [
2599
2632
  "trigger",
2600
2633
  "detail",
@@ -2651,13 +2684,13 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2651
2684
  let t = I.format(e.getAttribute("datetime"), this.dateFormatValue);
2652
2685
  t && (e.textContent = t);
2653
2686
  }
2654
- }, Kt = class extends e {
2687
+ }, Jt = class extends e {
2655
2688
  static targets = ["content"];
2656
2689
  connect() {
2657
2690
  Z(this);
2658
2691
  }
2659
2692
  contentTargetConnected(e) {
2660
- _t(this, { element: e }), Q(this, { element: e });
2693
+ vt(this, { element: e }), Q(this, { element: e });
2661
2694
  }
2662
2695
  async dismissed() {
2663
2696
  this.hasContentTarget && await this.visibility.hide();
@@ -2667,6 +2700,6 @@ var Je = 7, Ye = 12, q = 10, Xe = {
2667
2700
  }
2668
2701
  };
2669
2702
  //#endregion
2670
- export { ae as ARIA_HASPOPUP_VALUES, xt as CalendarDecadeController, St as CalendarDecadeSelectorController, Ct as CalendarMonthController, wt as CalendarMonthSelectorController, Et as CalendarYearController, Dt as CalendarYearSelectorController, Be as CharacterCells, Ot as ChecklistController, kt as ClipboardController, At as ComboboxDateController, jt as ComboboxDropdownController, Mt as ComboboxTimeController, Nt as DismisserController, t as FOCUSABLE_SELECTOR, R as FORMATTER_TYPES, Pt as FlipperController, a as FocusTrap, Le as Formatter, Lt as InputClearableController, Ft as InputComboboxController, It as InputFormatterController, Rt as InputRevealableController, f as ListboxNavigation, u as MODIFIER_KEYS, zt as ModalController, Bt as PannerController, W as PasswordStrength, Vt as PasswordStrengthController, Ht as PopoverController, Ut as ProgressController, Wt as ReorderableController, O as Requestor, d as RovingTabIndex, V as STRENGTH_TYPES, Gt as TimelineController, Kt as VisibilityController, m as announce, Ve as attachCharacterCells, Ke as attachPasswordStrength, se as connectTriggerToTarget, le as disconnectTriggerFromTarget, ee as ensureId, he as filterOptions, i as focusFirst, ue as fuzzyMatcher, h as generateId, n as getFocusableElements, s as isActivationKey, C as isAriaDisabled, c as isArrowKey, te as isExpanded, o as isKey, r as isVisible, l as preventDefault, S as setAriaDisabled, x as setAriaHidden, g as setAriaState, re as setChecked, y as setCurrent, w as setDisabled, _ as setExpanded, b as setHidden, ne as setPressed, v as setSelected, E as setValueMax, T as setValueMin, ie as setValueNow };
2703
+ export { le as ARIA_HASPOPUP_VALUES, St as CalendarDecadeController, Ct as CalendarDecadeSelectorController, wt as CalendarMonthController, Tt as CalendarMonthSelectorController, Dt as CalendarYearController, Ot as CalendarYearSelectorController, Be as CharacterCells, kt as ChecklistController, At as ClipboardController, jt as ComboboxDateController, Mt as ComboboxDropdownController, Nt as ComboboxTimeController, Pt as DismisserController, t as FOCUSABLE_SELECTOR, z as FORMATTER_TYPES, Ft as FlipperController, a as FocusTrap, Le as Formatter, Rt as InputClearableController, It as InputComboboxController, Lt as InputFormatterController, zt as InputRevealableController, f as ListboxNavigation, u as MODIFIER_KEYS, Bt as ModalController, Vt as PannerController, Ke as PasswordStrength, Ht as PasswordStrengthController, Ut as PopoverController, Gt as ProgressController, Kt as ReorderableController, O as Requestor, d as RovingTabIndex, H as STRENGTH_TYPES, qt as TimelineController, Jt as VisibilityController, m as announce, Ve as attachCharacterCells, qe as attachPasswordStrength, E as connectTriggerToTarget, ue as disconnectTriggerFromTarget, ee as ensureId, ge as filterOptions, i as focusFirst, de as fuzzyMatcher, h as generateId, n as getFocusableElements, s as isActivationKey, ie as isAriaDisabled, c as isArrowKey, te as isExpanded, o as isKey, r as isVisible, l as preventDefault, S as setAriaDisabled, x as setAriaHidden, g as setAriaState, re as setChecked, y as setCurrent, ae as setDisabled, _ as setExpanded, b as setHidden, ne as setPressed, v as setSelected, se as setValueMax, oe as setValueMin, ce as setValueNow, C as setValueText };
2671
2704
 
2672
2705
  //# sourceMappingURL=index.es.js.map