@abgov/ui-components-common 1.11.0 → 2.0.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,14 +1,14 @@
1
- var S = Object.defineProperty;
2
- var g = (r) => {
3
- throw TypeError(r);
1
+ var Z = Object.defineProperty;
2
+ var q = (n) => {
3
+ throw TypeError(n);
4
4
  };
5
- var M = (r, t, e) => t in r ? S(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
6
- var l = (r, t, e) => M(r, typeof t != "symbol" ? t + "" : t, e), w = (r, t, e) => t.has(r) || g("Cannot " + e);
7
- var y = (r, t, e) => t.has(r) ? g("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e);
8
- var _ = (r, t, e) => (w(r, t, "access private method"), e);
9
- class x {
5
+ var z = (n, t, e) => t in n ? Z(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
6
+ var w = (n, t, e) => z(n, typeof t != "symbol" ? t + "" : t, e), K = (n, t, e) => t.has(n) || q("Cannot " + e);
7
+ var R = (n, t, e) => t.has(n) ? q("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e);
8
+ var V = (n, t, e) => (K(n, t, "access private method"), e);
9
+ class Oe {
10
10
  constructor(t) {
11
- l(this, "validators");
11
+ w(this, "validators");
12
12
  this.validators = t || {};
13
13
  }
14
14
  add(t, ...e) {
@@ -16,16 +16,16 @@ class x {
16
16
  }
17
17
  validate(t) {
18
18
  const e = {};
19
- return Object.entries(this.validators).forEach(([n, i]) => {
20
- const a = i.map((s) => s(t[n])).find((s) => !!s);
21
- a && (e[n] = a);
19
+ return Object.entries(this.validators).forEach(([r, a]) => {
20
+ const i = a.map((s) => s(t[r])).find((s) => !!s);
21
+ i && (e[r] = i);
22
22
  }), e;
23
23
  }
24
24
  }
25
- function I() {
25
+ function Pe() {
26
26
  return [
27
- c("Day is required"),
28
- h({
27
+ F("Day is required"),
28
+ A({
29
29
  min: 1,
30
30
  max: 31,
31
31
  minMsg: "Day must be between 1 and 31",
@@ -33,10 +33,10 @@ function I() {
33
33
  })
34
34
  ];
35
35
  }
36
- function L() {
36
+ function Se() {
37
37
  return [
38
- c("Month is required"),
39
- h({
38
+ F("Month is required"),
39
+ A({
40
40
  min: 0,
41
41
  max: 11,
42
42
  minMsg: "Month must be between Jan and Dec",
@@ -44,105 +44,105 @@ function L() {
44
44
  })
45
45
  ];
46
46
  }
47
- function U() {
48
- const r = (/* @__PURE__ */ new Date()).getFullYear();
47
+ function ve() {
48
+ const n = (/* @__PURE__ */ new Date()).getFullYear();
49
49
  return [
50
- c("Year is required"),
51
- h({
50
+ F("Year is required"),
51
+ A({
52
52
  min: 1900,
53
- max: r,
53
+ max: n,
54
54
  minMsg: "Year must be greater than 1900",
55
- maxMsg: `Year must be less than ${r}`
55
+ maxMsg: `Year must be less than ${n}`
56
56
  })
57
57
  ];
58
58
  }
59
- function c(r) {
60
- return (t) => (r = r || "Required", typeof t == "number" && !isNaN(t) || t ? "" : r);
59
+ function F(n) {
60
+ return (t) => (n = n || "Required", typeof t == "number" && !isNaN(t) || t ? "" : n);
61
61
  }
62
- function T(r) {
62
+ function xe(n) {
63
63
  const t = new RegExp(/^\+?[\d-() ]{10,18}$/);
64
- return m(t, r || "Invalid phone number");
64
+ return C(t, n || "Invalid phone number");
65
65
  }
66
- function q(r) {
66
+ function ke(n) {
67
67
  const t = new RegExp(
68
68
  /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
69
69
  );
70
- return m(t, r || "Invalid email address");
71
- }
72
- function Y() {
73
- return (r) => {
74
- if (!r) return "";
75
- const t = "121212121".split("").map((i) => parseInt(i)), e = r.replace(/\D/g, "");
76
- return e.length !== 9 ? "SIN must contain 9 numbers" : e.split("").map((i) => parseInt(i)).map((i, a) => {
77
- const s = i * t[a];
78
- return s < 10 ? s : `${s}`.split("").map((u) => parseInt(u)).reduce((u, f) => u + f, 0);
79
- }).reduce((i, a) => i + a, 0) % 10 === 0 ? "" : "Invalid SIN";
70
+ return C(t, n || "Invalid email address");
71
+ }
72
+ function Ne() {
73
+ return (n) => {
74
+ if (!n) return "";
75
+ const t = "121212121".split("").map((a) => parseInt(a)), e = n.replace(/\D/g, "");
76
+ return e.length !== 9 ? "SIN must contain 9 numbers" : e.split("").map((a) => parseInt(a)).map((a, i) => {
77
+ const s = a * t[i];
78
+ return s < 10 ? s : `${s}`.split("").map((o) => parseInt(o)).reduce((o, c) => o + c, 0);
79
+ }).reduce((a, i) => a + i, 0) % 10 === 0 ? "" : "Invalid SIN";
80
80
  };
81
81
  }
82
- function J() {
83
- return m(
82
+ function Ye() {
83
+ return C(
84
84
  /^[ABCEGHJ-NPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ -]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,
85
85
  "Invalid postal code"
86
86
  );
87
87
  }
88
- function m(r, t) {
89
- return (e) => !e || e.match(r) ? "" : t;
88
+ function C(n, t) {
89
+ return (e) => !e || e.match(n) ? "" : t;
90
90
  }
91
- function O({
92
- invalidMsg: r,
91
+ function Te({
92
+ invalidMsg: n,
93
93
  minMsg: t,
94
94
  maxMsg: e,
95
- min: n,
96
- max: i
95
+ min: r,
96
+ max: a
97
97
  } = {}) {
98
- return (a) => {
98
+ return (i) => {
99
99
  let s = /* @__PURE__ */ new Date(-1);
100
- return `${a || ""}`.length === 0 ? "" : (typeof a == "string" && (s = new Date(a)), typeof a == "number" && (s = new Date(a)), a.toDateString && (s = a), s.getDate() === -1 ? r || "Invalid date" : n && s < n ? t || `Must be after ${n}` : i && s > i ? e || `Must be before ${i}` : "");
100
+ return `${i || ""}`.length === 0 ? "" : (typeof i == "string" && (s = new Date(i)), typeof i == "number" && (s = new Date(i)), i.toDateString && (s = i), s.getDate() === -1 ? n || "Invalid date" : r && s < r ? t || `Must be after ${r}` : a && s > a ? e || `Must be before ${a}` : "");
101
101
  };
102
102
  }
103
- function h({
104
- invalidTypeMsg: r,
103
+ function A({
104
+ invalidTypeMsg: n,
105
105
  minMsg: t,
106
106
  maxMsg: e,
107
- min: n = -Number.MAX_VALUE,
108
- max: i = Number.MAX_VALUE
107
+ min: r = -Number.MAX_VALUE,
108
+ max: a = Number.MAX_VALUE
109
109
  } = {}) {
110
- return (a) => {
110
+ return (i) => {
111
111
  let s = Number.MAX_VALUE;
112
- return `${a ?? ""}`.length === 0 ? "" : (typeof a == "string" && (s = parseFloat(a)), typeof a == "number" && (s = a), isNaN(s) ? r || "Must be a numeric value" : s > i ? e || `Must be less than or equal to ${i}` : s < n ? t || `Must be greater than or equal to ${n}` : "");
112
+ return `${i ?? ""}`.length === 0 ? "" : (typeof i == "string" && (s = parseFloat(i)), typeof i == "number" && (s = i), isNaN(s) ? n || "Must be a numeric value" : s > a ? e || `Must be less than or equal to ${a}` : s < r ? t || `Must be greater than or equal to ${r}` : "");
113
113
  };
114
114
  }
115
- function X({
116
- invalidTypeMsg: r,
115
+ function We({
116
+ invalidTypeMsg: n,
117
117
  minMsg: t,
118
118
  maxMsg: e,
119
- min: n = -Number.MAX_VALUE,
120
- max: i = Number.MAX_VALUE
119
+ min: r = -Number.MAX_VALUE,
120
+ max: a = Number.MAX_VALUE
121
121
  }) {
122
- return (a) => `${a || ""}`.length === 0 ? "" : typeof a != "string" ? r || "Invalid type" : a.length > i ? e || `Must be less than ${i} characters` : a.length < n ? t || `Must be greater than ${n} characters` : "";
122
+ return (i) => `${i || ""}`.length === 0 ? "" : typeof i != "string" ? n || "Invalid type" : i.length > a ? e || `Must be less than ${a} characters` : i.length < r ? t || `Must be greater than ${r} characters` : "";
123
123
  }
124
- function v(r, t, e, n) {
125
- if (!r) {
124
+ function L(n, t, e, r) {
125
+ if (!n) {
126
126
  console.error("dispatch element is null");
127
127
  return;
128
128
  }
129
- r.dispatchEvent(
129
+ n.dispatchEvent(
130
130
  new CustomEvent(t, {
131
131
  composed: !0,
132
- bubbles: n == null ? void 0 : n.bubbles,
132
+ bubbles: r == null ? void 0 : r.bubbles,
133
133
  detail: e
134
134
  })
135
135
  );
136
136
  }
137
- function o(r, t, e, n) {
138
- if (!r) {
137
+ function M(n, t, e, r) {
138
+ if (!n) {
139
139
  console.error("dispatch element is null");
140
140
  return;
141
141
  }
142
- r.dispatchEvent(
142
+ n.dispatchEvent(
143
143
  new CustomEvent("msg", {
144
144
  composed: !0,
145
- bubbles: n == null ? void 0 : n.bubbles,
145
+ bubbles: r == null ? void 0 : r.bubbles,
146
146
  detail: {
147
147
  action: t,
148
148
  data: e
@@ -150,14 +150,14 @@ function o(r, t, e, n) {
150
150
  })
151
151
  );
152
152
  }
153
- var d, E, A;
154
- class j {
153
+ var N, tt, G;
154
+ class _e {
155
155
  constructor(t) {
156
- y(this, d);
157
- l(this, "state");
158
- l(this, "_formData");
159
- l(this, "_formRef");
160
- l(this, "_isCompleting", !1);
156
+ R(this, N);
157
+ w(this, "state");
158
+ w(this, "_formData");
159
+ w(this, "_formRef");
160
+ w(this, "_isCompleting", !1);
161
161
  this.type = t;
162
162
  }
163
163
  // Obtain reference to the form element
@@ -179,38 +179,38 @@ class j {
179
179
  }
180
180
  // Public method to allow for the initialization of the state
181
181
  initState(t, e) {
182
- o(this._formRef, "external::init:state", t), typeof t == "string" ? this.state = JSON.parse(t) : Array.isArray(t) || (this.state = t), e && setTimeout(e, 200);
182
+ M(this._formRef, "external::init:state", t), typeof t == "string" ? this.state = JSON.parse(t) : Array.isArray(t) || (this.state = t), e && setTimeout(e, 201);
183
183
  }
184
184
  updateListState(t) {
185
185
  const e = t.detail;
186
186
  Array.isArray(e.data) && (this.state = e.data);
187
187
  }
188
188
  updateObjectState(t) {
189
- var n, i;
189
+ var r, a;
190
190
  if (Array.isArray(this.state))
191
191
  return;
192
192
  const e = t.detail;
193
193
  e.type === "list" ? this.state = {
194
194
  ...this.state,
195
- form: { ...((n = this.state) == null ? void 0 : n.form) || {}, [e.id]: e.data }
195
+ form: { ...((r = this.state) == null ? void 0 : r.form) || {}, [e.id]: e.data }
196
196
  } : this.state = {
197
197
  ...this.state,
198
198
  ...e.data,
199
- form: { ...((i = this.state) == null ? void 0 : i.form) || {}, ...e.data.form },
199
+ form: { ...((a = this.state) == null ? void 0 : a.form) || {}, ...e.data.form },
200
200
  history: e.data.history
201
201
  };
202
202
  }
203
203
  getStateList() {
204
204
  return this.state ? Array.isArray(this.state) ? this.state.length === 0 ? [] : this.state.map((t) => Object.values(t.form).filter((e) => {
205
- var n;
206
- return ((n = e == null ? void 0 : e.data) == null ? void 0 : n.type) === "details";
205
+ var r;
206
+ return ((r = e == null ? void 0 : e.data) == null ? void 0 : r.type) === "details";
207
207
  }).map((e) => {
208
- var n;
209
- return e.data.type === "details" && ((n = e.data) == null ? void 0 : n.fieldsets) || {};
208
+ var r;
209
+ return e.data.type === "details" && ((r = e.data) == null ? void 0 : r.fieldsets) || {};
210
210
  }).reduce(
211
- (e, n) => {
212
- for (const [i, a] of Object.entries(n))
213
- e[i] = a.value;
211
+ (e, r) => {
212
+ for (const [a, i] of Object.entries(r))
213
+ e[a] = i.value;
214
214
  return e;
215
215
  },
216
216
  {}
@@ -244,8 +244,8 @@ class j {
244
244
  return console.error("getStateValue: unable to update the state of a multi form type"), "";
245
245
  if (!this.state)
246
246
  return console.error("getStateValue: state has not yet been set"), "";
247
- const n = this.state.form[t].data;
248
- return n.type !== "details" ? "" : n.fieldsets[e].value;
247
+ const r = this.state.form[t].data;
248
+ return r.type !== "details" ? "" : r.fieldsets[e].value;
249
249
  }
250
250
  // Public method to allow for the continuing to the next page
251
251
  continueTo(t) {
@@ -253,20 +253,20 @@ class j {
253
253
  console.error("continueTo [name] is undefined");
254
254
  return;
255
255
  }
256
- o(this._formRef, "external::continue", { next: t });
256
+ M(this._formRef, "external::continue", { next: t });
257
257
  }
258
258
  // Public method to perform validation and send the appropriate messages to the form elements
259
- validate(t, e, n, i) {
260
- var b;
261
- const { el: a, state: s, cancelled: u } = t.detail, f = (b = s == null ? void 0 : s[e]) == null ? void 0 : b.value;
262
- if (window.scrollTo({ top: 0, behavior: "smooth" }), u)
263
- return [!0, f];
264
- for (const V of n) {
265
- const p = V(f);
266
- if (_(this, d, A).call(this, a, e, p, i), p)
259
+ validate(t, e, r, a) {
260
+ var f;
261
+ const { el: i, state: s, cancelled: o } = t.detail, c = (f = s == null ? void 0 : s[e]) == null ? void 0 : f.value;
262
+ if (window.scrollTo({ top: 0, behavior: "smooth" }), o)
263
+ return [!0, c];
264
+ for (const h of r) {
265
+ const g = h(c);
266
+ if (V(this, N, G).call(this, i, e, g, a), g)
267
267
  return [!1, ""];
268
268
  }
269
- return [!0, f];
269
+ return [!0, c];
270
270
  }
271
271
  /**
272
272
  * Validates a group of fields ensuring that at least `minPassCount` of the items within the group
@@ -277,20 +277,20 @@ class j {
277
277
  * @param {FieldValidator[]} validators - An array of validator functions to apply to the fields.
278
278
  * @return {[number, Record<string, boolean>]} - Returns back the number of fields that passed and a record of the fields and their pass status.
279
279
  */
280
- validateGroup(t, e, n) {
281
- let i = 0;
282
- const a = {};
280
+ validateGroup(t, e, r) {
281
+ let a = 0;
282
+ const i = {};
283
283
  for (const s of e) {
284
- const [u] = this.validate(t, s, n, { grouped: !0 });
285
- u && (a[s] = !0, i++);
284
+ const [o] = this.validate(t, s, r, { grouped: !0 });
285
+ o && (i[s] = !0, a++);
286
286
  }
287
- return [i, a];
287
+ return [a, i];
288
288
  }
289
289
  edit(t) {
290
- o(this._formRef, "external::alter:state", { index: t, operation: "edit" });
290
+ M(this._formRef, "external::alter:state", { index: t, operation: "edit" });
291
291
  }
292
292
  remove(t) {
293
- o(this._formRef, "external::alter:state", {
293
+ M(this._formRef, "external::alter:state", {
294
294
  index: t,
295
295
  operation: "remove"
296
296
  });
@@ -320,7 +320,7 @@ class j {
320
320
  console.warn("complete: completion already in progress");
321
321
  return;
322
322
  }
323
- this._isCompleting = !0, o(this._formRef, "fieldset::submit", null, { bubbles: !0 }), this._isCompleting = !1;
323
+ this._isCompleting = !0, M(this._formRef, "fieldset::submit", null, { bubbles: !0 }), this._isCompleting = !1;
324
324
  }
325
325
  /**
326
326
  * Completes a subform and returns control to the parent form.
@@ -349,17 +349,17 @@ class j {
349
349
  }
350
350
  const t = this._formRef;
351
351
  this._isCompleting = !0;
352
- const e = (n) => {
353
- t.removeEventListener("_stateChange", e), v(t, "_complete", {}, { bubbles: !0 }), this._isCompleting = !1;
352
+ const e = (r) => {
353
+ t.removeEventListener("_stateChange", e), L(t, "_complete", {}, { bubbles: !0 }), this._isCompleting = !1;
354
354
  };
355
- t.addEventListener("_stateChange", e), v(t, "_continue", null, { bubbles: !0 });
355
+ t.addEventListener("_stateChange", e), L(t, "_continue", null, { bubbles: !0 });
356
356
  }
357
357
  // removes any data collected that doesn't correspond with the final history path
358
358
  clean(t) {
359
- return t.history.reduce((e, n) => (e[n] = t.form[n], e), {});
359
+ return t.history.reduce((e, r) => (e[r] = t.form[r], e), {});
360
360
  }
361
361
  }
362
- d = new WeakSet(), E = function(t) {
362
+ N = new WeakSet(), tt = function(t) {
363
363
  var e;
364
364
  Array.isArray(t.data) && (Array.isArray(this.state) || (this.state = {
365
365
  ...this.state,
@@ -369,7 +369,7 @@ d = new WeakSet(), E = function(t) {
369
369
  }
370
370
  }));
371
371
  }, // Private method to dispatch the error message to the form element
372
- A = function(t, e, n, i) {
372
+ G = function(t, e, r, a) {
373
373
  t.dispatchEvent(
374
374
  new CustomEvent("msg", {
375
375
  composed: !0,
@@ -377,60 +377,1489 @@ A = function(t, e, n, i) {
377
377
  action: "external::set:error",
378
378
  data: {
379
379
  name: e,
380
- msg: n,
381
- grouped: i == null ? void 0 : i.grouped
380
+ msg: r,
381
+ grouped: a == null ? void 0 : a.grouped
382
382
  }
383
383
  }
384
384
  })
385
385
  );
386
386
  };
387
- const R = ["basic", "success", "failure"];
388
- function C(r, t) {
387
+ const et = ["basic", "success", "failure"];
388
+ function nt(n, t) {
389
389
  const e = crypto.randomUUID();
390
- return t = { uuid: e, type: "basic", ...t || {} }, !t.duration && t.type && R.includes(t.type) && (t.duration = "short"), o(
390
+ return t = { uuid: e, type: "basic", ...t || {} }, !t.duration && t.type && et.includes(t.type) && (t.duration = "short"), M(
391
391
  document.body,
392
392
  "goa:temp-notification",
393
- { message: r, ...t },
393
+ { message: n, ...t },
394
394
  { bubbles: !0 }
395
395
  ), e;
396
396
  }
397
- function N(r) {
398
- o(
397
+ function rt(n) {
398
+ M(
399
399
  document.body,
400
400
  "goa:temp-notification:dismiss",
401
- r,
401
+ n,
402
402
  { bubbles: !0 }
403
403
  );
404
404
  }
405
- function D(r, t) {
406
- o(
405
+ function at(n, t) {
406
+ M(
407
407
  document.body,
408
408
  "goa:temp-notification:progress",
409
- { uuid: r, progress: t },
409
+ { uuid: n, progress: t },
410
410
  { bubbles: !0 }
411
411
  );
412
412
  }
413
- const G = {
414
- show: C,
415
- dismiss: N,
416
- setProgress: D
413
+ const Ee = {
414
+ show: nt,
415
+ dismiss: rt,
416
+ setProgress: at
417
+ };
418
+ function d(n) {
419
+ const t = Object.prototype.toString.call(n);
420
+ return n instanceof Date || typeof n == "object" && t === "[object Date]" ? new n.constructor(+n) : typeof n == "number" || t === "[object Number]" || typeof n == "string" || t === "[object String]" ? new Date(n) : /* @__PURE__ */ new Date(NaN);
421
+ }
422
+ function y(n, t) {
423
+ return n instanceof Date ? new n.constructor(t) : new Date(t);
424
+ }
425
+ function it(n, t) {
426
+ const e = d(n);
427
+ return isNaN(t) ? y(n, NaN) : (t && e.setDate(e.getDate() + t), e);
428
+ }
429
+ function st(n, t) {
430
+ const e = d(n);
431
+ if (isNaN(t)) return y(n, NaN);
432
+ if (!t)
433
+ return e;
434
+ const r = e.getDate(), a = y(n, e.getTime());
435
+ a.setMonth(e.getMonth() + t + 1, 0);
436
+ const i = a.getDate();
437
+ return r >= i ? a : (e.setFullYear(
438
+ a.getFullYear(),
439
+ a.getMonth(),
440
+ r
441
+ ), e);
442
+ }
443
+ const Q = 6048e5, ot = 864e5;
444
+ let ut = {};
445
+ function W() {
446
+ return ut;
447
+ }
448
+ function k(n, t) {
449
+ var o, c, f, h;
450
+ const e = W(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((c = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : c.weekStartsOn) ?? e.weekStartsOn ?? ((h = (f = e.locale) == null ? void 0 : f.options) == null ? void 0 : h.weekStartsOn) ?? 0, a = d(n), i = a.getDay(), s = (i < r ? 7 : 0) + i - r;
451
+ return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
452
+ }
453
+ function Y(n) {
454
+ return k(n, { weekStartsOn: 1 });
455
+ }
456
+ function B(n) {
457
+ const t = d(n), e = t.getFullYear(), r = y(n, 0);
458
+ r.setFullYear(e + 1, 0, 4), r.setHours(0, 0, 0, 0);
459
+ const a = Y(r), i = y(n, 0);
460
+ i.setFullYear(e, 0, 4), i.setHours(0, 0, 0, 0);
461
+ const s = Y(i);
462
+ return t.getTime() >= a.getTime() ? e + 1 : t.getTime() >= s.getTime() ? e : e - 1;
463
+ }
464
+ function T(n) {
465
+ const t = d(n);
466
+ return t.setHours(0, 0, 0, 0), t;
467
+ }
468
+ function H(n) {
469
+ const t = d(n), e = new Date(
470
+ Date.UTC(
471
+ t.getFullYear(),
472
+ t.getMonth(),
473
+ t.getDate(),
474
+ t.getHours(),
475
+ t.getMinutes(),
476
+ t.getSeconds(),
477
+ t.getMilliseconds()
478
+ )
479
+ );
480
+ return e.setUTCFullYear(t.getFullYear()), +n - +e;
481
+ }
482
+ function ct(n, t) {
483
+ const e = T(n), r = T(t), a = +e - H(e), i = +r - H(r);
484
+ return Math.round((a - i) / ot);
485
+ }
486
+ function dt(n) {
487
+ const t = B(n), e = y(n, 0);
488
+ return e.setFullYear(t, 0, 4), e.setHours(0, 0, 0, 0), Y(e);
489
+ }
490
+ function ft(n, t) {
491
+ const e = T(n), r = T(t);
492
+ return +e == +r;
493
+ }
494
+ function ht(n) {
495
+ return n instanceof Date || typeof n == "object" && Object.prototype.toString.call(n) === "[object Date]";
496
+ }
497
+ function lt(n) {
498
+ if (!ht(n) && typeof n != "number")
499
+ return !1;
500
+ const t = d(n);
501
+ return !isNaN(Number(t));
502
+ }
503
+ function mt(n) {
504
+ const t = d(n), e = y(n, 0);
505
+ return e.setFullYear(t.getFullYear(), 0, 1), e.setHours(0, 0, 0, 0), e;
506
+ }
507
+ const gt = {
508
+ lessThanXSeconds: {
509
+ one: "less than a second",
510
+ other: "less than {{count}} seconds"
511
+ },
512
+ xSeconds: {
513
+ one: "1 second",
514
+ other: "{{count}} seconds"
515
+ },
516
+ halfAMinute: "half a minute",
517
+ lessThanXMinutes: {
518
+ one: "less than a minute",
519
+ other: "less than {{count}} minutes"
520
+ },
521
+ xMinutes: {
522
+ one: "1 minute",
523
+ other: "{{count}} minutes"
524
+ },
525
+ aboutXHours: {
526
+ one: "about 1 hour",
527
+ other: "about {{count}} hours"
528
+ },
529
+ xHours: {
530
+ one: "1 hour",
531
+ other: "{{count}} hours"
532
+ },
533
+ xDays: {
534
+ one: "1 day",
535
+ other: "{{count}} days"
536
+ },
537
+ aboutXWeeks: {
538
+ one: "about 1 week",
539
+ other: "about {{count}} weeks"
540
+ },
541
+ xWeeks: {
542
+ one: "1 week",
543
+ other: "{{count}} weeks"
544
+ },
545
+ aboutXMonths: {
546
+ one: "about 1 month",
547
+ other: "about {{count}} months"
548
+ },
549
+ xMonths: {
550
+ one: "1 month",
551
+ other: "{{count}} months"
552
+ },
553
+ aboutXYears: {
554
+ one: "about 1 year",
555
+ other: "about {{count}} years"
556
+ },
557
+ xYears: {
558
+ one: "1 year",
559
+ other: "{{count}} years"
560
+ },
561
+ overXYears: {
562
+ one: "over 1 year",
563
+ other: "over {{count}} years"
564
+ },
565
+ almostXYears: {
566
+ one: "almost 1 year",
567
+ other: "almost {{count}} years"
568
+ }
569
+ }, yt = (n, t, e) => {
570
+ let r;
571
+ const a = gt[n];
572
+ return typeof a == "string" ? r = a : t === 1 ? r = a.one : r = a.other.replace("{{count}}", t.toString()), e != null && e.addSuffix ? e.comparison && e.comparison > 0 ? "in " + r : r + " ago" : r;
573
+ };
574
+ function E(n) {
575
+ return (t = {}) => {
576
+ const e = t.width ? String(t.width) : n.defaultWidth;
577
+ return n.formats[e] || n.formats[n.defaultWidth];
578
+ };
579
+ }
580
+ const bt = {
581
+ full: "EEEE, MMMM do, y",
582
+ long: "MMMM do, y",
583
+ medium: "MMM d, y",
584
+ short: "MM/dd/yyyy"
585
+ }, wt = {
586
+ full: "h:mm:ss a zzzz",
587
+ long: "h:mm:ss a z",
588
+ medium: "h:mm:ss a",
589
+ short: "h:mm a"
590
+ }, pt = {
591
+ full: "{{date}} 'at' {{time}}",
592
+ long: "{{date}} 'at' {{time}}",
593
+ medium: "{{date}}, {{time}}",
594
+ short: "{{date}}, {{time}}"
595
+ }, Mt = {
596
+ date: E({
597
+ formats: bt,
598
+ defaultWidth: "full"
599
+ }),
600
+ time: E({
601
+ formats: wt,
602
+ defaultWidth: "full"
603
+ }),
604
+ dateTime: E({
605
+ formats: pt,
606
+ defaultWidth: "full"
607
+ })
608
+ }, Dt = {
609
+ lastWeek: "'last' eeee 'at' p",
610
+ yesterday: "'yesterday at' p",
611
+ today: "'today at' p",
612
+ tomorrow: "'tomorrow at' p",
613
+ nextWeek: "eeee 'at' p",
614
+ other: "P"
615
+ }, Ot = (n, t, e, r) => Dt[n];
616
+ function v(n) {
617
+ return (t, e) => {
618
+ const r = e != null && e.context ? String(e.context) : "standalone";
619
+ let a;
620
+ if (r === "formatting" && n.formattingValues) {
621
+ const s = n.defaultFormattingWidth || n.defaultWidth, o = e != null && e.width ? String(e.width) : s;
622
+ a = n.formattingValues[o] || n.formattingValues[s];
623
+ } else {
624
+ const s = n.defaultWidth, o = e != null && e.width ? String(e.width) : n.defaultWidth;
625
+ a = n.values[o] || n.values[s];
626
+ }
627
+ const i = n.argumentCallback ? n.argumentCallback(t) : t;
628
+ return a[i];
629
+ };
630
+ }
631
+ const Pt = {
632
+ narrow: ["B", "A"],
633
+ abbreviated: ["BC", "AD"],
634
+ wide: ["Before Christ", "Anno Domini"]
635
+ }, St = {
636
+ narrow: ["1", "2", "3", "4"],
637
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
638
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
639
+ }, vt = {
640
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
641
+ abbreviated: [
642
+ "Jan",
643
+ "Feb",
644
+ "Mar",
645
+ "Apr",
646
+ "May",
647
+ "Jun",
648
+ "Jul",
649
+ "Aug",
650
+ "Sep",
651
+ "Oct",
652
+ "Nov",
653
+ "Dec"
654
+ ],
655
+ wide: [
656
+ "January",
657
+ "February",
658
+ "March",
659
+ "April",
660
+ "May",
661
+ "June",
662
+ "July",
663
+ "August",
664
+ "September",
665
+ "October",
666
+ "November",
667
+ "December"
668
+ ]
669
+ }, xt = {
670
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
671
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
672
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
673
+ wide: [
674
+ "Sunday",
675
+ "Monday",
676
+ "Tuesday",
677
+ "Wednesday",
678
+ "Thursday",
679
+ "Friday",
680
+ "Saturday"
681
+ ]
682
+ }, kt = {
683
+ narrow: {
684
+ am: "a",
685
+ pm: "p",
686
+ midnight: "mi",
687
+ noon: "n",
688
+ morning: "morning",
689
+ afternoon: "afternoon",
690
+ evening: "evening",
691
+ night: "night"
692
+ },
693
+ abbreviated: {
694
+ am: "AM",
695
+ pm: "PM",
696
+ midnight: "midnight",
697
+ noon: "noon",
698
+ morning: "morning",
699
+ afternoon: "afternoon",
700
+ evening: "evening",
701
+ night: "night"
702
+ },
703
+ wide: {
704
+ am: "a.m.",
705
+ pm: "p.m.",
706
+ midnight: "midnight",
707
+ noon: "noon",
708
+ morning: "morning",
709
+ afternoon: "afternoon",
710
+ evening: "evening",
711
+ night: "night"
712
+ }
713
+ }, Nt = {
714
+ narrow: {
715
+ am: "a",
716
+ pm: "p",
717
+ midnight: "mi",
718
+ noon: "n",
719
+ morning: "in the morning",
720
+ afternoon: "in the afternoon",
721
+ evening: "in the evening",
722
+ night: "at night"
723
+ },
724
+ abbreviated: {
725
+ am: "AM",
726
+ pm: "PM",
727
+ midnight: "midnight",
728
+ noon: "noon",
729
+ morning: "in the morning",
730
+ afternoon: "in the afternoon",
731
+ evening: "in the evening",
732
+ night: "at night"
733
+ },
734
+ wide: {
735
+ am: "a.m.",
736
+ pm: "p.m.",
737
+ midnight: "midnight",
738
+ noon: "noon",
739
+ morning: "in the morning",
740
+ afternoon: "in the afternoon",
741
+ evening: "in the evening",
742
+ night: "at night"
743
+ }
744
+ }, Yt = (n, t) => {
745
+ const e = Number(n), r = e % 100;
746
+ if (r > 20 || r < 10)
747
+ switch (r % 10) {
748
+ case 1:
749
+ return e + "st";
750
+ case 2:
751
+ return e + "nd";
752
+ case 3:
753
+ return e + "rd";
754
+ }
755
+ return e + "th";
756
+ }, Tt = {
757
+ ordinalNumber: Yt,
758
+ era: v({
759
+ values: Pt,
760
+ defaultWidth: "wide"
761
+ }),
762
+ quarter: v({
763
+ values: St,
764
+ defaultWidth: "wide",
765
+ argumentCallback: (n) => n - 1
766
+ }),
767
+ month: v({
768
+ values: vt,
769
+ defaultWidth: "wide"
770
+ }),
771
+ day: v({
772
+ values: xt,
773
+ defaultWidth: "wide"
774
+ }),
775
+ dayPeriod: v({
776
+ values: kt,
777
+ defaultWidth: "wide",
778
+ formattingValues: Nt,
779
+ defaultFormattingWidth: "wide"
780
+ })
781
+ };
782
+ function x(n) {
783
+ return (t, e = {}) => {
784
+ const r = e.width, a = r && n.matchPatterns[r] || n.matchPatterns[n.defaultMatchWidth], i = t.match(a);
785
+ if (!i)
786
+ return null;
787
+ const s = i[0], o = r && n.parsePatterns[r] || n.parsePatterns[n.defaultParseWidth], c = Array.isArray(o) ? _t(o, (g) => g.test(s)) : (
788
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
789
+ Wt(o, (g) => g.test(s))
790
+ );
791
+ let f;
792
+ f = n.valueCallback ? n.valueCallback(c) : c, f = e.valueCallback ? (
793
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
794
+ e.valueCallback(f)
795
+ ) : f;
796
+ const h = t.slice(s.length);
797
+ return { value: f, rest: h };
798
+ };
799
+ }
800
+ function Wt(n, t) {
801
+ for (const e in n)
802
+ if (Object.prototype.hasOwnProperty.call(n, e) && t(n[e]))
803
+ return e;
804
+ }
805
+ function _t(n, t) {
806
+ for (let e = 0; e < n.length; e++)
807
+ if (t(n[e]))
808
+ return e;
809
+ }
810
+ function Et(n) {
811
+ return (t, e = {}) => {
812
+ const r = t.match(n.matchPattern);
813
+ if (!r) return null;
814
+ const a = r[0], i = t.match(n.parsePattern);
815
+ if (!i) return null;
816
+ let s = n.valueCallback ? n.valueCallback(i[0]) : i[0];
817
+ s = e.valueCallback ? e.valueCallback(s) : s;
818
+ const o = t.slice(a.length);
819
+ return { value: s, rest: o };
820
+ };
821
+ }
822
+ const Ft = /^(\d+)(th|st|nd|rd)?/i, Ct = /\d+/i, At = {
823
+ narrow: /^(b|a)/i,
824
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
825
+ wide: /^(before christ|before common era|anno domini|common era)/i
826
+ }, qt = {
827
+ any: [/^b/i, /^(a|c)/i]
828
+ }, Rt = {
829
+ narrow: /^[1234]/i,
830
+ abbreviated: /^q[1234]/i,
831
+ wide: /^[1234](th|st|nd|rd)? quarter/i
832
+ }, Vt = {
833
+ any: [/1/i, /2/i, /3/i, /4/i]
834
+ }, Lt = {
835
+ narrow: /^[jfmasond]/i,
836
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
837
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
838
+ }, Ht = {
839
+ narrow: [
840
+ /^j/i,
841
+ /^f/i,
842
+ /^m/i,
843
+ /^a/i,
844
+ /^m/i,
845
+ /^j/i,
846
+ /^j/i,
847
+ /^a/i,
848
+ /^s/i,
849
+ /^o/i,
850
+ /^n/i,
851
+ /^d/i
852
+ ],
853
+ any: [
854
+ /^ja/i,
855
+ /^f/i,
856
+ /^mar/i,
857
+ /^ap/i,
858
+ /^may/i,
859
+ /^jun/i,
860
+ /^jul/i,
861
+ /^au/i,
862
+ /^s/i,
863
+ /^o/i,
864
+ /^n/i,
865
+ /^d/i
866
+ ]
867
+ }, It = {
868
+ narrow: /^[smtwf]/i,
869
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
870
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
871
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
872
+ }, Xt = {
873
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
874
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
875
+ }, jt = {
876
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
877
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
878
+ }, $t = {
879
+ any: {
880
+ am: /^a/i,
881
+ pm: /^p/i,
882
+ midnight: /^mi/i,
883
+ noon: /^no/i,
884
+ morning: /morning/i,
885
+ afternoon: /afternoon/i,
886
+ evening: /evening/i,
887
+ night: /night/i
888
+ }
889
+ }, Gt = {
890
+ ordinalNumber: Et({
891
+ matchPattern: Ft,
892
+ parsePattern: Ct,
893
+ valueCallback: (n) => parseInt(n, 10)
894
+ }),
895
+ era: x({
896
+ matchPatterns: At,
897
+ defaultMatchWidth: "wide",
898
+ parsePatterns: qt,
899
+ defaultParseWidth: "any"
900
+ }),
901
+ quarter: x({
902
+ matchPatterns: Rt,
903
+ defaultMatchWidth: "wide",
904
+ parsePatterns: Vt,
905
+ defaultParseWidth: "any",
906
+ valueCallback: (n) => n + 1
907
+ }),
908
+ month: x({
909
+ matchPatterns: Lt,
910
+ defaultMatchWidth: "wide",
911
+ parsePatterns: Ht,
912
+ defaultParseWidth: "any"
913
+ }),
914
+ day: x({
915
+ matchPatterns: It,
916
+ defaultMatchWidth: "wide",
917
+ parsePatterns: Xt,
918
+ defaultParseWidth: "any"
919
+ }),
920
+ dayPeriod: x({
921
+ matchPatterns: jt,
922
+ defaultMatchWidth: "any",
923
+ parsePatterns: $t,
924
+ defaultParseWidth: "any"
925
+ })
926
+ }, Qt = {
927
+ code: "en-US",
928
+ formatDistance: yt,
929
+ formatLong: Mt,
930
+ formatRelative: Ot,
931
+ localize: Tt,
932
+ match: Gt,
933
+ options: {
934
+ weekStartsOn: 0,
935
+ firstWeekContainsDate: 1
936
+ }
417
937
  };
938
+ function Bt(n) {
939
+ const t = d(n);
940
+ return ct(t, mt(t)) + 1;
941
+ }
942
+ function Jt(n) {
943
+ const t = d(n), e = +Y(t) - +dt(t);
944
+ return Math.round(e / Q) + 1;
945
+ }
946
+ function J(n, t) {
947
+ var h, g, P, S;
948
+ const e = d(n), r = e.getFullYear(), a = W(), i = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((g = (h = t == null ? void 0 : t.locale) == null ? void 0 : h.options) == null ? void 0 : g.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((S = (P = a.locale) == null ? void 0 : P.options) == null ? void 0 : S.firstWeekContainsDate) ?? 1, s = y(n, 0);
949
+ s.setFullYear(r + 1, 0, i), s.setHours(0, 0, 0, 0);
950
+ const o = k(s, t), c = y(n, 0);
951
+ c.setFullYear(r, 0, i), c.setHours(0, 0, 0, 0);
952
+ const f = k(c, t);
953
+ return e.getTime() >= o.getTime() ? r + 1 : e.getTime() >= f.getTime() ? r : r - 1;
954
+ }
955
+ function Ut(n, t) {
956
+ var o, c, f, h;
957
+ const e = W(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((c = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : c.firstWeekContainsDate) ?? e.firstWeekContainsDate ?? ((h = (f = e.locale) == null ? void 0 : f.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, a = J(n, t), i = y(n, 0);
958
+ return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), k(i, t);
959
+ }
960
+ function Zt(n, t) {
961
+ const e = d(n), r = +k(e, t) - +Ut(e, t);
962
+ return Math.round(r / Q) + 1;
963
+ }
964
+ function u(n, t) {
965
+ const e = n < 0 ? "-" : "", r = Math.abs(n).toString().padStart(t, "0");
966
+ return e + r;
967
+ }
968
+ const p = {
969
+ // Year
970
+ y(n, t) {
971
+ const e = n.getFullYear(), r = e > 0 ? e : 1 - e;
972
+ return u(t === "yy" ? r % 100 : r, t.length);
973
+ },
974
+ // Month
975
+ M(n, t) {
976
+ const e = n.getMonth();
977
+ return t === "M" ? String(e + 1) : u(e + 1, 2);
978
+ },
979
+ // Day of the month
980
+ d(n, t) {
981
+ return u(n.getDate(), t.length);
982
+ },
983
+ // AM or PM
984
+ a(n, t) {
985
+ const e = n.getHours() / 12 >= 1 ? "pm" : "am";
986
+ switch (t) {
987
+ case "a":
988
+ case "aa":
989
+ return e.toUpperCase();
990
+ case "aaa":
991
+ return e;
992
+ case "aaaaa":
993
+ return e[0];
994
+ case "aaaa":
995
+ default:
996
+ return e === "am" ? "a.m." : "p.m.";
997
+ }
998
+ },
999
+ // Hour [1-12]
1000
+ h(n, t) {
1001
+ return u(n.getHours() % 12 || 12, t.length);
1002
+ },
1003
+ // Hour [0-23]
1004
+ H(n, t) {
1005
+ return u(n.getHours(), t.length);
1006
+ },
1007
+ // Minute
1008
+ m(n, t) {
1009
+ return u(n.getMinutes(), t.length);
1010
+ },
1011
+ // Second
1012
+ s(n, t) {
1013
+ return u(n.getSeconds(), t.length);
1014
+ },
1015
+ // Fraction of second
1016
+ S(n, t) {
1017
+ const e = t.length, r = n.getMilliseconds(), a = Math.trunc(
1018
+ r * Math.pow(10, e - 3)
1019
+ );
1020
+ return u(a, t.length);
1021
+ }
1022
+ }, O = {
1023
+ midnight: "midnight",
1024
+ noon: "noon",
1025
+ morning: "morning",
1026
+ afternoon: "afternoon",
1027
+ evening: "evening",
1028
+ night: "night"
1029
+ }, I = {
1030
+ // Era
1031
+ G: function(n, t, e) {
1032
+ const r = n.getFullYear() > 0 ? 1 : 0;
1033
+ switch (t) {
1034
+ // AD, BC
1035
+ case "G":
1036
+ case "GG":
1037
+ case "GGG":
1038
+ return e.era(r, { width: "abbreviated" });
1039
+ // A, B
1040
+ case "GGGGG":
1041
+ return e.era(r, { width: "narrow" });
1042
+ // Anno Domini, Before Christ
1043
+ case "GGGG":
1044
+ default:
1045
+ return e.era(r, { width: "wide" });
1046
+ }
1047
+ },
1048
+ // Year
1049
+ y: function(n, t, e) {
1050
+ if (t === "yo") {
1051
+ const r = n.getFullYear(), a = r > 0 ? r : 1 - r;
1052
+ return e.ordinalNumber(a, { unit: "year" });
1053
+ }
1054
+ return p.y(n, t);
1055
+ },
1056
+ // Local week-numbering year
1057
+ Y: function(n, t, e, r) {
1058
+ const a = J(n, r), i = a > 0 ? a : 1 - a;
1059
+ if (t === "YY") {
1060
+ const s = i % 100;
1061
+ return u(s, 2);
1062
+ }
1063
+ return t === "Yo" ? e.ordinalNumber(i, { unit: "year" }) : u(i, t.length);
1064
+ },
1065
+ // ISO week-numbering year
1066
+ R: function(n, t) {
1067
+ const e = B(n);
1068
+ return u(e, t.length);
1069
+ },
1070
+ // Extended year. This is a single number designating the year of this calendar system.
1071
+ // The main difference between `y` and `u` localizers are B.C. years:
1072
+ // | Year | `y` | `u` |
1073
+ // |------|-----|-----|
1074
+ // | AC 1 | 1 | 1 |
1075
+ // | BC 1 | 1 | 0 |
1076
+ // | BC 2 | 2 | -1 |
1077
+ // Also `yy` always returns the last two digits of a year,
1078
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
1079
+ u: function(n, t) {
1080
+ const e = n.getFullYear();
1081
+ return u(e, t.length);
1082
+ },
1083
+ // Quarter
1084
+ Q: function(n, t, e) {
1085
+ const r = Math.ceil((n.getMonth() + 1) / 3);
1086
+ switch (t) {
1087
+ // 1, 2, 3, 4
1088
+ case "Q":
1089
+ return String(r);
1090
+ // 01, 02, 03, 04
1091
+ case "QQ":
1092
+ return u(r, 2);
1093
+ // 1st, 2nd, 3rd, 4th
1094
+ case "Qo":
1095
+ return e.ordinalNumber(r, { unit: "quarter" });
1096
+ // Q1, Q2, Q3, Q4
1097
+ case "QQQ":
1098
+ return e.quarter(r, {
1099
+ width: "abbreviated",
1100
+ context: "formatting"
1101
+ });
1102
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1103
+ case "QQQQQ":
1104
+ return e.quarter(r, {
1105
+ width: "narrow",
1106
+ context: "formatting"
1107
+ });
1108
+ // 1st quarter, 2nd quarter, ...
1109
+ case "QQQQ":
1110
+ default:
1111
+ return e.quarter(r, {
1112
+ width: "wide",
1113
+ context: "formatting"
1114
+ });
1115
+ }
1116
+ },
1117
+ // Stand-alone quarter
1118
+ q: function(n, t, e) {
1119
+ const r = Math.ceil((n.getMonth() + 1) / 3);
1120
+ switch (t) {
1121
+ // 1, 2, 3, 4
1122
+ case "q":
1123
+ return String(r);
1124
+ // 01, 02, 03, 04
1125
+ case "qq":
1126
+ return u(r, 2);
1127
+ // 1st, 2nd, 3rd, 4th
1128
+ case "qo":
1129
+ return e.ordinalNumber(r, { unit: "quarter" });
1130
+ // Q1, Q2, Q3, Q4
1131
+ case "qqq":
1132
+ return e.quarter(r, {
1133
+ width: "abbreviated",
1134
+ context: "standalone"
1135
+ });
1136
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1137
+ case "qqqqq":
1138
+ return e.quarter(r, {
1139
+ width: "narrow",
1140
+ context: "standalone"
1141
+ });
1142
+ // 1st quarter, 2nd quarter, ...
1143
+ case "qqqq":
1144
+ default:
1145
+ return e.quarter(r, {
1146
+ width: "wide",
1147
+ context: "standalone"
1148
+ });
1149
+ }
1150
+ },
1151
+ // Month
1152
+ M: function(n, t, e) {
1153
+ const r = n.getMonth();
1154
+ switch (t) {
1155
+ case "M":
1156
+ case "MM":
1157
+ return p.M(n, t);
1158
+ // 1st, 2nd, ..., 12th
1159
+ case "Mo":
1160
+ return e.ordinalNumber(r + 1, { unit: "month" });
1161
+ // Jan, Feb, ..., Dec
1162
+ case "MMM":
1163
+ return e.month(r, {
1164
+ width: "abbreviated",
1165
+ context: "formatting"
1166
+ });
1167
+ // J, F, ..., D
1168
+ case "MMMMM":
1169
+ return e.month(r, {
1170
+ width: "narrow",
1171
+ context: "formatting"
1172
+ });
1173
+ // January, February, ..., December
1174
+ case "MMMM":
1175
+ default:
1176
+ return e.month(r, { width: "wide", context: "formatting" });
1177
+ }
1178
+ },
1179
+ // Stand-alone month
1180
+ L: function(n, t, e) {
1181
+ const r = n.getMonth();
1182
+ switch (t) {
1183
+ // 1, 2, ..., 12
1184
+ case "L":
1185
+ return String(r + 1);
1186
+ // 01, 02, ..., 12
1187
+ case "LL":
1188
+ return u(r + 1, 2);
1189
+ // 1st, 2nd, ..., 12th
1190
+ case "Lo":
1191
+ return e.ordinalNumber(r + 1, { unit: "month" });
1192
+ // Jan, Feb, ..., Dec
1193
+ case "LLL":
1194
+ return e.month(r, {
1195
+ width: "abbreviated",
1196
+ context: "standalone"
1197
+ });
1198
+ // J, F, ..., D
1199
+ case "LLLLL":
1200
+ return e.month(r, {
1201
+ width: "narrow",
1202
+ context: "standalone"
1203
+ });
1204
+ // January, February, ..., December
1205
+ case "LLLL":
1206
+ default:
1207
+ return e.month(r, { width: "wide", context: "standalone" });
1208
+ }
1209
+ },
1210
+ // Local week of year
1211
+ w: function(n, t, e, r) {
1212
+ const a = Zt(n, r);
1213
+ return t === "wo" ? e.ordinalNumber(a, { unit: "week" }) : u(a, t.length);
1214
+ },
1215
+ // ISO week of year
1216
+ I: function(n, t, e) {
1217
+ const r = Jt(n);
1218
+ return t === "Io" ? e.ordinalNumber(r, { unit: "week" }) : u(r, t.length);
1219
+ },
1220
+ // Day of the month
1221
+ d: function(n, t, e) {
1222
+ return t === "do" ? e.ordinalNumber(n.getDate(), { unit: "date" }) : p.d(n, t);
1223
+ },
1224
+ // Day of year
1225
+ D: function(n, t, e) {
1226
+ const r = Bt(n);
1227
+ return t === "Do" ? e.ordinalNumber(r, { unit: "dayOfYear" }) : u(r, t.length);
1228
+ },
1229
+ // Day of week
1230
+ E: function(n, t, e) {
1231
+ const r = n.getDay();
1232
+ switch (t) {
1233
+ // Tue
1234
+ case "E":
1235
+ case "EE":
1236
+ case "EEE":
1237
+ return e.day(r, {
1238
+ width: "abbreviated",
1239
+ context: "formatting"
1240
+ });
1241
+ // T
1242
+ case "EEEEE":
1243
+ return e.day(r, {
1244
+ width: "narrow",
1245
+ context: "formatting"
1246
+ });
1247
+ // Tu
1248
+ case "EEEEEE":
1249
+ return e.day(r, {
1250
+ width: "short",
1251
+ context: "formatting"
1252
+ });
1253
+ // Tuesday
1254
+ case "EEEE":
1255
+ default:
1256
+ return e.day(r, {
1257
+ width: "wide",
1258
+ context: "formatting"
1259
+ });
1260
+ }
1261
+ },
1262
+ // Local day of week
1263
+ e: function(n, t, e, r) {
1264
+ const a = n.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
1265
+ switch (t) {
1266
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
1267
+ case "e":
1268
+ return String(i);
1269
+ // Padded numerical value
1270
+ case "ee":
1271
+ return u(i, 2);
1272
+ // 1st, 2nd, ..., 7th
1273
+ case "eo":
1274
+ return e.ordinalNumber(i, { unit: "day" });
1275
+ case "eee":
1276
+ return e.day(a, {
1277
+ width: "abbreviated",
1278
+ context: "formatting"
1279
+ });
1280
+ // T
1281
+ case "eeeee":
1282
+ return e.day(a, {
1283
+ width: "narrow",
1284
+ context: "formatting"
1285
+ });
1286
+ // Tu
1287
+ case "eeeeee":
1288
+ return e.day(a, {
1289
+ width: "short",
1290
+ context: "formatting"
1291
+ });
1292
+ // Tuesday
1293
+ case "eeee":
1294
+ default:
1295
+ return e.day(a, {
1296
+ width: "wide",
1297
+ context: "formatting"
1298
+ });
1299
+ }
1300
+ },
1301
+ // Stand-alone local day of week
1302
+ c: function(n, t, e, r) {
1303
+ const a = n.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
1304
+ switch (t) {
1305
+ // Numerical value (same as in `e`)
1306
+ case "c":
1307
+ return String(i);
1308
+ // Padded numerical value
1309
+ case "cc":
1310
+ return u(i, t.length);
1311
+ // 1st, 2nd, ..., 7th
1312
+ case "co":
1313
+ return e.ordinalNumber(i, { unit: "day" });
1314
+ case "ccc":
1315
+ return e.day(a, {
1316
+ width: "abbreviated",
1317
+ context: "standalone"
1318
+ });
1319
+ // T
1320
+ case "ccccc":
1321
+ return e.day(a, {
1322
+ width: "narrow",
1323
+ context: "standalone"
1324
+ });
1325
+ // Tu
1326
+ case "cccccc":
1327
+ return e.day(a, {
1328
+ width: "short",
1329
+ context: "standalone"
1330
+ });
1331
+ // Tuesday
1332
+ case "cccc":
1333
+ default:
1334
+ return e.day(a, {
1335
+ width: "wide",
1336
+ context: "standalone"
1337
+ });
1338
+ }
1339
+ },
1340
+ // ISO day of week
1341
+ i: function(n, t, e) {
1342
+ const r = n.getDay(), a = r === 0 ? 7 : r;
1343
+ switch (t) {
1344
+ // 2
1345
+ case "i":
1346
+ return String(a);
1347
+ // 02
1348
+ case "ii":
1349
+ return u(a, t.length);
1350
+ // 2nd
1351
+ case "io":
1352
+ return e.ordinalNumber(a, { unit: "day" });
1353
+ // Tue
1354
+ case "iii":
1355
+ return e.day(r, {
1356
+ width: "abbreviated",
1357
+ context: "formatting"
1358
+ });
1359
+ // T
1360
+ case "iiiii":
1361
+ return e.day(r, {
1362
+ width: "narrow",
1363
+ context: "formatting"
1364
+ });
1365
+ // Tu
1366
+ case "iiiiii":
1367
+ return e.day(r, {
1368
+ width: "short",
1369
+ context: "formatting"
1370
+ });
1371
+ // Tuesday
1372
+ case "iiii":
1373
+ default:
1374
+ return e.day(r, {
1375
+ width: "wide",
1376
+ context: "formatting"
1377
+ });
1378
+ }
1379
+ },
1380
+ // AM or PM
1381
+ a: function(n, t, e) {
1382
+ const a = n.getHours() / 12 >= 1 ? "pm" : "am";
1383
+ switch (t) {
1384
+ case "a":
1385
+ case "aa":
1386
+ return e.dayPeriod(a, {
1387
+ width: "abbreviated",
1388
+ context: "formatting"
1389
+ });
1390
+ case "aaa":
1391
+ return e.dayPeriod(a, {
1392
+ width: "abbreviated",
1393
+ context: "formatting"
1394
+ }).toLowerCase();
1395
+ case "aaaaa":
1396
+ return e.dayPeriod(a, {
1397
+ width: "narrow",
1398
+ context: "formatting"
1399
+ });
1400
+ case "aaaa":
1401
+ default:
1402
+ return e.dayPeriod(a, {
1403
+ width: "wide",
1404
+ context: "formatting"
1405
+ });
1406
+ }
1407
+ },
1408
+ // AM, PM, midnight, noon
1409
+ b: function(n, t, e) {
1410
+ const r = n.getHours();
1411
+ let a;
1412
+ switch (r === 12 ? a = O.noon : r === 0 ? a = O.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
1413
+ case "b":
1414
+ case "bb":
1415
+ return e.dayPeriod(a, {
1416
+ width: "abbreviated",
1417
+ context: "formatting"
1418
+ });
1419
+ case "bbb":
1420
+ return e.dayPeriod(a, {
1421
+ width: "abbreviated",
1422
+ context: "formatting"
1423
+ }).toLowerCase();
1424
+ case "bbbbb":
1425
+ return e.dayPeriod(a, {
1426
+ width: "narrow",
1427
+ context: "formatting"
1428
+ });
1429
+ case "bbbb":
1430
+ default:
1431
+ return e.dayPeriod(a, {
1432
+ width: "wide",
1433
+ context: "formatting"
1434
+ });
1435
+ }
1436
+ },
1437
+ // in the morning, in the afternoon, in the evening, at night
1438
+ B: function(n, t, e) {
1439
+ const r = n.getHours();
1440
+ let a;
1441
+ switch (r >= 17 ? a = O.evening : r >= 12 ? a = O.afternoon : r >= 4 ? a = O.morning : a = O.night, t) {
1442
+ case "B":
1443
+ case "BB":
1444
+ case "BBB":
1445
+ return e.dayPeriod(a, {
1446
+ width: "abbreviated",
1447
+ context: "formatting"
1448
+ });
1449
+ case "BBBBB":
1450
+ return e.dayPeriod(a, {
1451
+ width: "narrow",
1452
+ context: "formatting"
1453
+ });
1454
+ case "BBBB":
1455
+ default:
1456
+ return e.dayPeriod(a, {
1457
+ width: "wide",
1458
+ context: "formatting"
1459
+ });
1460
+ }
1461
+ },
1462
+ // Hour [1-12]
1463
+ h: function(n, t, e) {
1464
+ if (t === "ho") {
1465
+ let r = n.getHours() % 12;
1466
+ return r === 0 && (r = 12), e.ordinalNumber(r, { unit: "hour" });
1467
+ }
1468
+ return p.h(n, t);
1469
+ },
1470
+ // Hour [0-23]
1471
+ H: function(n, t, e) {
1472
+ return t === "Ho" ? e.ordinalNumber(n.getHours(), { unit: "hour" }) : p.H(n, t);
1473
+ },
1474
+ // Hour [0-11]
1475
+ K: function(n, t, e) {
1476
+ const r = n.getHours() % 12;
1477
+ return t === "Ko" ? e.ordinalNumber(r, { unit: "hour" }) : u(r, t.length);
1478
+ },
1479
+ // Hour [1-24]
1480
+ k: function(n, t, e) {
1481
+ let r = n.getHours();
1482
+ return r === 0 && (r = 24), t === "ko" ? e.ordinalNumber(r, { unit: "hour" }) : u(r, t.length);
1483
+ },
1484
+ // Minute
1485
+ m: function(n, t, e) {
1486
+ return t === "mo" ? e.ordinalNumber(n.getMinutes(), { unit: "minute" }) : p.m(n, t);
1487
+ },
1488
+ // Second
1489
+ s: function(n, t, e) {
1490
+ return t === "so" ? e.ordinalNumber(n.getSeconds(), { unit: "second" }) : p.s(n, t);
1491
+ },
1492
+ // Fraction of second
1493
+ S: function(n, t) {
1494
+ return p.S(n, t);
1495
+ },
1496
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1497
+ X: function(n, t, e) {
1498
+ const r = n.getTimezoneOffset();
1499
+ if (r === 0)
1500
+ return "Z";
1501
+ switch (t) {
1502
+ // Hours and optional minutes
1503
+ case "X":
1504
+ return j(r);
1505
+ // Hours, minutes and optional seconds without `:` delimiter
1506
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1507
+ // so this token always has the same output as `XX`
1508
+ case "XXXX":
1509
+ case "XX":
1510
+ return D(r);
1511
+ // Hours, minutes and optional seconds with `:` delimiter
1512
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1513
+ // so this token always has the same output as `XXX`
1514
+ case "XXXXX":
1515
+ case "XXX":
1516
+ // Hours and minutes with `:` delimiter
1517
+ default:
1518
+ return D(r, ":");
1519
+ }
1520
+ },
1521
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1522
+ x: function(n, t, e) {
1523
+ const r = n.getTimezoneOffset();
1524
+ switch (t) {
1525
+ // Hours and optional minutes
1526
+ case "x":
1527
+ return j(r);
1528
+ // Hours, minutes and optional seconds without `:` delimiter
1529
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1530
+ // so this token always has the same output as `xx`
1531
+ case "xxxx":
1532
+ case "xx":
1533
+ return D(r);
1534
+ // Hours, minutes and optional seconds with `:` delimiter
1535
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1536
+ // so this token always has the same output as `xxx`
1537
+ case "xxxxx":
1538
+ case "xxx":
1539
+ // Hours and minutes with `:` delimiter
1540
+ default:
1541
+ return D(r, ":");
1542
+ }
1543
+ },
1544
+ // Timezone (GMT)
1545
+ O: function(n, t, e) {
1546
+ const r = n.getTimezoneOffset();
1547
+ switch (t) {
1548
+ // Short
1549
+ case "O":
1550
+ case "OO":
1551
+ case "OOO":
1552
+ return "GMT" + X(r, ":");
1553
+ // Long
1554
+ case "OOOO":
1555
+ default:
1556
+ return "GMT" + D(r, ":");
1557
+ }
1558
+ },
1559
+ // Timezone (specific non-location)
1560
+ z: function(n, t, e) {
1561
+ const r = n.getTimezoneOffset();
1562
+ switch (t) {
1563
+ // Short
1564
+ case "z":
1565
+ case "zz":
1566
+ case "zzz":
1567
+ return "GMT" + X(r, ":");
1568
+ // Long
1569
+ case "zzzz":
1570
+ default:
1571
+ return "GMT" + D(r, ":");
1572
+ }
1573
+ },
1574
+ // Seconds timestamp
1575
+ t: function(n, t, e) {
1576
+ const r = Math.trunc(n.getTime() / 1e3);
1577
+ return u(r, t.length);
1578
+ },
1579
+ // Milliseconds timestamp
1580
+ T: function(n, t, e) {
1581
+ const r = n.getTime();
1582
+ return u(r, t.length);
1583
+ }
1584
+ };
1585
+ function X(n, t = "") {
1586
+ const e = n > 0 ? "-" : "+", r = Math.abs(n), a = Math.trunc(r / 60), i = r % 60;
1587
+ return i === 0 ? e + String(a) : e + String(a) + t + u(i, 2);
1588
+ }
1589
+ function j(n, t) {
1590
+ return n % 60 === 0 ? (n > 0 ? "-" : "+") + u(Math.abs(n) / 60, 2) : D(n, t);
1591
+ }
1592
+ function D(n, t = "") {
1593
+ const e = n > 0 ? "-" : "+", r = Math.abs(n), a = u(Math.trunc(r / 60), 2), i = u(r % 60, 2);
1594
+ return e + a + t + i;
1595
+ }
1596
+ const $ = (n, t) => {
1597
+ switch (n) {
1598
+ case "P":
1599
+ return t.date({ width: "short" });
1600
+ case "PP":
1601
+ return t.date({ width: "medium" });
1602
+ case "PPP":
1603
+ return t.date({ width: "long" });
1604
+ case "PPPP":
1605
+ default:
1606
+ return t.date({ width: "full" });
1607
+ }
1608
+ }, U = (n, t) => {
1609
+ switch (n) {
1610
+ case "p":
1611
+ return t.time({ width: "short" });
1612
+ case "pp":
1613
+ return t.time({ width: "medium" });
1614
+ case "ppp":
1615
+ return t.time({ width: "long" });
1616
+ case "pppp":
1617
+ default:
1618
+ return t.time({ width: "full" });
1619
+ }
1620
+ }, zt = (n, t) => {
1621
+ const e = n.match(/(P+)(p+)?/) || [], r = e[1], a = e[2];
1622
+ if (!a)
1623
+ return $(n, t);
1624
+ let i;
1625
+ switch (r) {
1626
+ case "P":
1627
+ i = t.dateTime({ width: "short" });
1628
+ break;
1629
+ case "PP":
1630
+ i = t.dateTime({ width: "medium" });
1631
+ break;
1632
+ case "PPP":
1633
+ i = t.dateTime({ width: "long" });
1634
+ break;
1635
+ case "PPPP":
1636
+ default:
1637
+ i = t.dateTime({ width: "full" });
1638
+ break;
1639
+ }
1640
+ return i.replace("{{date}}", $(r, t)).replace("{{time}}", U(a, t));
1641
+ }, Kt = {
1642
+ p: U,
1643
+ P: zt
1644
+ }, te = /^D+$/, ee = /^Y+$/, ne = ["D", "DD", "YY", "YYYY"];
1645
+ function re(n) {
1646
+ return te.test(n);
1647
+ }
1648
+ function ae(n) {
1649
+ return ee.test(n);
1650
+ }
1651
+ function ie(n, t, e) {
1652
+ const r = se(n, t, e);
1653
+ if (console.warn(r), ne.includes(n)) throw new RangeError(r);
1654
+ }
1655
+ function se(n, t, e) {
1656
+ const r = n[0] === "Y" ? "years" : "days of the month";
1657
+ return `Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${r} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1658
+ }
1659
+ const oe = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, ue = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, ce = /^'([^]*?)'?$/, de = /''/g, fe = /[a-zA-Z]/;
1660
+ function he(n, t, e) {
1661
+ var h, g, P, S;
1662
+ const r = W(), a = r.locale ?? Qt, i = r.firstWeekContainsDate ?? ((g = (h = r.locale) == null ? void 0 : h.options) == null ? void 0 : g.firstWeekContainsDate) ?? 1, s = r.weekStartsOn ?? ((S = (P = r.locale) == null ? void 0 : P.options) == null ? void 0 : S.weekStartsOn) ?? 0, o = d(n);
1663
+ if (!lt(o))
1664
+ throw new RangeError("Invalid time value");
1665
+ let c = t.match(ue).map((m) => {
1666
+ const l = m[0];
1667
+ if (l === "p" || l === "P") {
1668
+ const _ = Kt[l];
1669
+ return _(m, a.formatLong);
1670
+ }
1671
+ return m;
1672
+ }).join("").match(oe).map((m) => {
1673
+ if (m === "''")
1674
+ return { isToken: !1, value: "'" };
1675
+ const l = m[0];
1676
+ if (l === "'")
1677
+ return { isToken: !1, value: le(m) };
1678
+ if (I[l])
1679
+ return { isToken: !0, value: m };
1680
+ if (l.match(fe))
1681
+ throw new RangeError(
1682
+ "Format string contains an unescaped latin alphabet character `" + l + "`"
1683
+ );
1684
+ return { isToken: !1, value: m };
1685
+ });
1686
+ a.localize.preprocessor && (c = a.localize.preprocessor(o, c));
1687
+ const f = {
1688
+ firstWeekContainsDate: i,
1689
+ weekStartsOn: s,
1690
+ locale: a
1691
+ };
1692
+ return c.map((m) => {
1693
+ if (!m.isToken) return m.value;
1694
+ const l = m.value;
1695
+ (ae(l) || re(l)) && ie(l, t, String(n));
1696
+ const _ = I[l[0]];
1697
+ return _(o, l, a.localize, f);
1698
+ }).join("");
1699
+ }
1700
+ function le(n) {
1701
+ const t = n.match(ce);
1702
+ return t ? t[1].replace(de, "'") : n;
1703
+ }
1704
+ function me(n) {
1705
+ const t = d(n), e = t.getFullYear(), r = t.getMonth(), a = y(n, 0);
1706
+ return a.setFullYear(e, r + 1, 0), a.setHours(0, 0, 0, 0), a.getDate();
1707
+ }
1708
+ function ge(n) {
1709
+ const t = d(n), e = t.getMonth();
1710
+ return t.setFullYear(t.getFullYear(), e + 1, 0), t.setHours(0, 0, 0, 0), t;
1711
+ }
1712
+ function ye(n, t) {
1713
+ const e = d(n), r = d(t);
1714
+ return e.getTime() > r.getTime();
1715
+ }
1716
+ function be(n, t) {
1717
+ const e = d(n), r = d(t);
1718
+ return +e < +r;
1719
+ }
1720
+ function we(n, t) {
1721
+ const e = d(n), r = d(t);
1722
+ return e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth();
1723
+ }
1724
+ class b {
1725
+ constructor(t) {
1726
+ w(this, "_dateNums");
1727
+ t || t === 0 ? this._dateNums = b.parse(t) : this._dateNums = b.parse(/* @__PURE__ */ new Date());
1728
+ }
1729
+ static parse(t) {
1730
+ return typeof t == "string" ? (t = t.split("T")[0], t.split("-").map((e) => +e)) : t instanceof Date ? [t.getFullYear(), t.getMonth() + 1, t.getDate()] : t === 0 ? [0, 0, 0] : [t.year, t.month, t.day];
1731
+ }
1732
+ static init() {
1733
+ return new b(0);
1734
+ }
1735
+ // Used internally to get the date value for the date_fns
1736
+ get date() {
1737
+ return new Date(
1738
+ this._dateNums[0],
1739
+ this._dateNums[1] - 1,
1740
+ this._dateNums[2]
1741
+ );
1742
+ }
1743
+ get year() {
1744
+ return this._dateNums[0];
1745
+ }
1746
+ get month() {
1747
+ return this._dateNums[1];
1748
+ }
1749
+ get day() {
1750
+ return this._dateNums[2];
1751
+ }
1752
+ get dayOfWeek() {
1753
+ return this.date.getDay();
1754
+ }
1755
+ get daysInMonth() {
1756
+ return me(this.date);
1757
+ }
1758
+ get firstDayOfMonth() {
1759
+ return new b({ year: this.year, month: this.month, day: 1 });
1760
+ }
1761
+ get lastDayOfMonth() {
1762
+ return new b(ge(this.date));
1763
+ }
1764
+ get previousDay() {
1765
+ return this.clone().addDays(-1);
1766
+ }
1767
+ get nextDay() {
1768
+ return this.clone().addDays(1);
1769
+ }
1770
+ get previousWeek() {
1771
+ return this.clone().addDays(-7);
1772
+ }
1773
+ get nextWeek() {
1774
+ return this.clone().addDays(7);
1775
+ }
1776
+ get previousMonth() {
1777
+ return this.clone().addMonths(-1);
1778
+ }
1779
+ get nextMonth() {
1780
+ return this.clone().addMonths(1);
1781
+ }
1782
+ clone() {
1783
+ return new b(this.toString());
1784
+ }
1785
+ setYear(t) {
1786
+ this._dateNums[0] = t;
1787
+ }
1788
+ setMonth(t) {
1789
+ this._dateNums[1] = t;
1790
+ }
1791
+ setDay(t) {
1792
+ return this._dateNums[2] = t, this;
1793
+ }
1794
+ addYears(t) {
1795
+ return this._dateNums[0] += t, this;
1796
+ }
1797
+ addMonths(t) {
1798
+ return this._dateNums = b.parse(st(this.date, t)), this;
1799
+ }
1800
+ addDays(t) {
1801
+ return this._dateNums = b.parse(it(this.date, t)), this;
1802
+ }
1803
+ isSameDay(t) {
1804
+ return ft(this.date, t.date);
1805
+ }
1806
+ isSameMonth(t) {
1807
+ return we(this.date, t.date);
1808
+ }
1809
+ isBefore(t) {
1810
+ return be(this.date, t.date);
1811
+ }
1812
+ isAfter(t) {
1813
+ return ye(this.date, t.date);
1814
+ }
1815
+ isZero() {
1816
+ return this._dateNums[0] === 0 && this._dateNums[1] === 0 && this._dateNums[2] === 0;
1817
+ }
1818
+ isValid() {
1819
+ const t = new Date(this.toString());
1820
+ return !(isNaN(t.getTime()) || this.toString() !== t.toISOString().split("T")[0]);
1821
+ }
1822
+ format(t) {
1823
+ return this.isZero() ? "" : he(this.date, t);
1824
+ }
1825
+ toString() {
1826
+ return this.isZero() ? "" : this._dateNums.map((t) => `${t}`.length < 2 ? `0${t}` : `${t}`).join("-");
1827
+ }
1828
+ }
1829
+ class pe {
1830
+ constructor() {
1831
+ w(this, "done");
1832
+ this.done = /* @__PURE__ */ new Set();
1833
+ }
1834
+ when(t) {
1835
+ return t ? this : new Me();
1836
+ }
1837
+ do(t, e) {
1838
+ this.done.has(t) || (this.done.add(t), e());
1839
+ }
1840
+ }
1841
+ class Me extends pe {
1842
+ do(t, e) {
1843
+ }
1844
+ }
418
1845
  export {
419
- x as FormValidator,
420
- j as PublicFormController,
421
- Y as SINValidator,
422
- G as TemporaryNotification,
423
- I as birthDayValidator,
424
- L as birthMonthValidator,
425
- U as birthYearValidator,
426
- O as dateValidator,
427
- v as dispatch,
428
- q as emailValidator,
429
- X as lengthValidator,
430
- h as numericValidator,
431
- T as phoneNumberValidator,
432
- J as postalCodeValidator,
433
- m as regexValidator,
434
- o as relay,
435
- c as requiredValidator
1846
+ b as CalendarDate,
1847
+ Oe as FormValidator,
1848
+ pe as Once,
1849
+ _e as PublicFormController,
1850
+ Ne as SINValidator,
1851
+ Ee as TemporaryNotification,
1852
+ Pe as birthDayValidator,
1853
+ Se as birthMonthValidator,
1854
+ ve as birthYearValidator,
1855
+ Te as dateValidator,
1856
+ L as dispatch,
1857
+ ke as emailValidator,
1858
+ We as lengthValidator,
1859
+ A as numericValidator,
1860
+ xe as phoneNumberValidator,
1861
+ Ye as postalCodeValidator,
1862
+ C as regexValidator,
1863
+ M as relay,
1864
+ F as requiredValidator
436
1865
  };