impact-nova 2.5.8 → 2.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,34 +1,50 @@
1
- import { jsx as P } from "react/jsx-runtime";
2
- import { useState as E } from "react";
3
- import { createComponent as x } from "../../../lib/primitives/create-component.js";
4
- import { Input as L } from "../input/input.js";
5
- const le = x("SmartInput", function({
6
- value: M,
7
- type: S = "text",
8
- onChange: v,
9
- onBlur: b,
10
- onFocus: z,
11
- allowNegative: D = !0,
1
+ import { jsx as R } from "react/jsx-runtime";
2
+ import { useState as ee } from "react";
3
+ import { createComponent as te } from "../../../lib/primitives/create-component.js";
4
+ import { Input as re } from "../input/input.js";
5
+ const ne = /* @__PURE__ */ new Set([
6
+ "email",
7
+ "password",
8
+ "url",
9
+ "tel"
10
+ ]);
11
+ function se(d, v) {
12
+ return d !== void 0 ? d : ne.has(v ?? "");
13
+ }
14
+ function ue(d) {
15
+ return d.replace(/[^\p{L}\p{N}\s]/gu, "");
16
+ }
17
+ const he = te("SmartInput", function({
18
+ value: v,
19
+ type: C = "text",
20
+ onChange: I,
21
+ onBlur: T,
22
+ onFocus: _,
23
+ allowNegative: m = !0,
12
24
  min: s,
13
25
  max: u,
14
- minOperator: F,
15
- maxOperator: K,
16
- min_operator: O = ">=",
17
- max_operator: W = "<=",
18
- maxIntegerDigits: V,
19
- decimalPlaces: o,
20
- enforceDecimal: j = !1,
21
- allowDecimal: B = !0,
22
- maxLength: i,
23
- trimLeadingSpaces: y = !0,
24
- customValidator: N,
26
+ minOperator: b,
27
+ maxOperator: E,
28
+ min_operator: F = ">=",
29
+ max_operator: K = "<=",
30
+ maxIntegerDigits: D,
31
+ decimalPlaces: a,
32
+ enforceDecimal: O = !1,
33
+ allowDecimal: N = !0,
34
+ allowSpecialCharacters: U,
35
+ maxLength: c,
36
+ trimLeadingSpaces: P = !0,
37
+ customValidator: B,
25
38
  onValidationError: p,
26
- disabled: h = !1,
27
- ...k
28
- }, T) {
29
- const $ = M !== void 0, [U, m] = E(""), a = $ ? String(M ?? "") : U, c = S === "number", g = F ?? O, w = K ?? W, q = (t) => {
39
+ disabled: S = !1,
40
+ ...W
41
+ }, j) {
42
+ const $ = v !== void 0, [k, g] = ee(""), i = $ ? String(v ?? "") : k, l = C === "number", A = se(
43
+ U,
44
+ C
45
+ ), V = b ?? F, w = E ?? K, z = (t) => {
30
46
  if (s === void 0) return !0;
31
- switch (g) {
47
+ switch (V) {
32
48
  case ">":
33
49
  return t > s;
34
50
  case ">=":
@@ -40,7 +56,7 @@ const le = x("SmartInput", function({
40
56
  default:
41
57
  return !0;
42
58
  }
43
- }, A = (t) => {
59
+ }, G = (t) => {
44
60
  if (u === void 0) return !0;
45
61
  switch (w) {
46
62
  case ">":
@@ -54,10 +70,10 @@ const le = x("SmartInput", function({
54
70
  default:
55
71
  return !0;
56
72
  }
57
- }, G = (t) => {
73
+ }, H = (t) => {
58
74
  let e = t;
59
75
  if (s !== void 0) {
60
- const r = g === ">" ? s + 0.01 : s;
76
+ const r = V === ">" ? s + 0.01 : s;
61
77
  e = Math.max(e, r);
62
78
  }
63
79
  if (u !== void 0) {
@@ -65,124 +81,129 @@ const le = x("SmartInput", function({
65
81
  e = Math.min(e, r);
66
82
  }
67
83
  return e;
68
- }, H = (t) => {
69
- const e = D ? /[^0-9.-]/g : /[^0-9.]/g;
84
+ }, Q = (t) => {
85
+ const e = m ? /[^0-9.-]/g : /[^0-9.]/g;
70
86
  return t.replace(e, "");
71
- }, J = (t) => {
87
+ }, Y = (t) => {
72
88
  const e = t.split(".");
73
89
  return e.length > 2 ? e[0] + "." + e.slice(1).join("") : t;
74
- }, Q = (t, e) => {
75
- if (!D) return t;
90
+ }, q = (t, e) => {
91
+ if (!m) return t;
76
92
  if ((t.match(/-/g) || []).length > 1) {
77
93
  let n = t.replace(/-/g, "");
78
94
  return e.startsWith("-") && (n = "-" + n), n;
79
95
  } else if (t.includes("-") && !t.startsWith("-"))
80
96
  return t.replace("-", "");
81
97
  return t;
82
- }, R = (t) => {
83
- if (o === void 0 || !t.includes(".")) return t;
98
+ }, J = (t) => {
99
+ if (a === void 0 || !t.includes(".")) return t;
84
100
  const [e, r] = t.split(".");
85
- return r && r.length > o ? `${e}.${r.slice(0, o)}` : t;
101
+ return r && r.length > a ? `${e}.${r.slice(0, a)}` : t;
86
102
  }, X = (t) => {
87
- if (V === void 0) return t;
103
+ if (D === void 0) return t;
88
104
  const [e, r] = t.split("."), n = e.replace("-", "");
89
- if (n.length > V) {
90
- const f = n.slice(0, V), d = e.startsWith("-") ? "-" : "";
91
- return r !== void 0 ? `${d}${f}.${r}` : `${d}${f}`;
105
+ if (n.length > D) {
106
+ const o = n.slice(0, D), f = e.startsWith("-") ? "-" : "";
107
+ return r !== void 0 ? `${f}${o}.${r}` : `${f}${o}`;
92
108
  }
93
109
  return t;
94
- }, C = (t) => {
95
- if (!c) return t;
110
+ }, Z = (t) => {
111
+ if (!l) return t;
96
112
  let e = String(t ?? "");
97
- return y && (e = e.replace(/^\s+/, "")), e = H(e), e = J(e), e = Q(e, t), e = R(e), e = X(e), B || (e = e.replace(".", "")), e;
98
- }, Y = (t) => {
99
- if (!c || !t || t === "-") return t;
113
+ return P && (e = e.replace(/^\s+/, "")), e = Q(e), e = Y(e), e = q(e, t), e = J(e), e = X(e), N || (e = e.replace(".", "")), e;
114
+ }, y = (t) => {
115
+ if (l) return Z(t);
116
+ let e = String(t ?? "");
117
+ return P && (e = e.replace(/^\s+/, "")), A || (e = ue(e)), e;
118
+ }, x = (t) => {
119
+ if (!l || !t || t === "-") return t;
100
120
  let e = t;
101
121
  const r = parseFloat(e);
102
122
  if (isNaN(r)) return "";
103
- const n = G(r);
104
- if (j && o !== void 0)
105
- e = n.toFixed(o);
106
- else if (o !== void 0 && e.includes(".")) {
107
- const [f, d = ""] = e.split("."), I = d.padEnd(o, "0");
108
- e = `${f}.${I}`;
123
+ const n = H(r);
124
+ if (O && a !== void 0)
125
+ e = n.toFixed(a);
126
+ else if (a !== void 0 && e.includes(".")) {
127
+ const [o, f = ""] = e.split("."), M = f.padEnd(a, "0");
128
+ e = `${o}.${M}`;
109
129
  } else
110
130
  e = String(n);
111
131
  return e;
112
- }, Z = (t) => {
132
+ }, L = (t) => {
113
133
  if (!t) return !0;
114
- if (N && !N(t))
134
+ if (B && !B(t))
115
135
  return p?.("Custom validation failed"), !1;
116
- if (c) {
136
+ if (l) {
117
137
  const e = parseFloat(t);
118
138
  if (isNaN(e))
119
139
  return p?.("Invalid number"), !1;
120
- if (!q(e))
121
- return p?.(`Value must be ${g} ${s}`), !1;
122
- if (!A(e))
140
+ if (!z(e))
141
+ return p?.(`Value must be ${V} ${s}`), !1;
142
+ if (!G(e))
123
143
  return p?.(`Value must be ${w} ${u}`), !1;
124
144
  }
125
- return i && t.length > i ? (p?.(`Maximum length is ${i}`), !1) : !0;
145
+ return c && t.length > c ? (p?.(`Maximum length is ${c}`), !1) : !0;
126
146
  };
127
- return /* @__PURE__ */ P(
147
+ return /* @__PURE__ */ R(
128
148
  "div",
129
149
  {
130
150
  "data-component": "smart-input",
131
151
  className: "w-full",
132
- "data-numeric": c || void 0,
133
- "data-decimal-places": o,
152
+ "data-numeric": l || void 0,
153
+ "data-allow-special-characters": A || void 0,
154
+ "data-decimal-places": a,
134
155
  "data-min": s,
135
156
  "data-max": u,
136
- children: /* @__PURE__ */ P(
137
- L,
157
+ children: /* @__PURE__ */ R(
158
+ re,
138
159
  {
139
- ...k,
140
- type: S,
141
- value: a,
160
+ ...W,
161
+ type: C,
162
+ value: i,
142
163
  onChange: (t) => {
143
- if (h) return;
144
- let r = t.target.value;
145
- c ? r = C(r) : y && (r = r.replace(/^\s+/, "")), i && r.length > i && (r = r.slice(0, i)), $ || m(r), v?.(r, t);
164
+ if (S) return;
165
+ let e = y(t.target.value);
166
+ c && e.length > c && (e = e.slice(0, c)), $ || g(e), I?.(e, t);
146
167
  },
147
168
  onBlur: (t) => {
148
- let e = a;
149
- c && e && (e = Y(e), Z(e) && ($ || m(e), e !== a && v?.(e))), b?.(t);
169
+ let e = i;
170
+ l && e && (e = x(e), L(e) && ($ || g(e), e !== i && I?.(e))), T?.(t);
150
171
  },
151
- onFocus: z,
172
+ onFocus: _,
152
173
  onKeyDown: (t) => {
153
- if (h || !c) return;
174
+ if (S || !l) return;
154
175
  const e = t.key;
155
176
  if (e === "e" || e === "E") {
156
177
  t.preventDefault();
157
178
  return;
158
179
  }
159
- if (e === "-" && !D) {
180
+ if (e === "-" && !m) {
160
181
  t.preventDefault();
161
182
  return;
162
183
  }
163
- if (e === "-" && a.includes("-")) {
184
+ if (e === "-" && i.includes("-")) {
164
185
  t.preventDefault();
165
186
  return;
166
187
  }
167
- if (e === "." && (!B || a.includes("."))) {
188
+ if (e === "." && (!N || i.includes("."))) {
168
189
  t.preventDefault();
169
190
  return;
170
191
  }
171
192
  },
172
193
  onPaste: (t) => {
173
- if (h) return;
194
+ if (S) return;
174
195
  t.preventDefault();
175
- const e = t.clipboardData.getData("text"), r = c ? C(e) : e, n = t.target, f = n.selectionStart || 0, d = n.selectionEnd || 0, I = a.slice(0, f), _ = a.slice(d);
176
- let l = I + r + _;
177
- c && (l = C(l)), i && l.length > i && (l = l.slice(0, i)), $ || m(l), v?.(l);
196
+ const e = t.clipboardData.getData("text"), r = t.target, n = r.selectionStart || 0, o = r.selectionEnd || 0, f = i.slice(0, n), M = i.slice(o);
197
+ let h = y(f + e + M);
198
+ c && h.length > c && (h = h.slice(0, c)), $ || g(h), I?.(h);
178
199
  },
179
- disabled: h,
180
- ref: T
200
+ disabled: S,
201
+ ref: j
181
202
  }
182
203
  )
183
204
  }
184
205
  );
185
206
  });
186
207
  export {
187
- le as SmartInput
208
+ he as SmartInput
188
209
  };
@@ -21,6 +21,11 @@ export interface SmartInputProps extends Omit<InputProps, "onChange" | "value" |
21
21
  decimalPlaces?: number;
22
22
  enforceDecimal?: boolean;
23
23
  allowDecimal?: boolean;
24
+ /**
25
+ * When false (default), only letters, numbers, and spaces are kept.
26
+ * `email` / `password` / `url` / `tel` default to true.
27
+ */
28
+ allowSpecialCharacters?: boolean;
24
29
  maxLength?: number;
25
30
  trimLeadingSpaces?: boolean;
26
31
  customValidator?: (value: string) => boolean;
@@ -1,4 +1,4 @@
1
- import { jsx as n, jsxs as v } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as v } from "react/jsx-runtime";
2
2
  import * as U from "react";
3
3
  import { createComponent as k } from "../../../lib/primitives/create-component.js";
4
4
  import { useFieldChrome as z } from "../../../lib/primitives/use-field-chrome.js";
@@ -8,11 +8,11 @@ const V = k(
8
8
  "Textarea",
9
9
  ({
10
10
  className: g,
11
- label: s,
12
- helperText: e,
11
+ label: i,
12
+ helperText: a,
13
13
  helperTextPosition: d = "absolute",
14
14
  labelOrientation: u,
15
- characterLimit: a,
15
+ characterLimit: o,
16
16
  required: b,
17
17
  isRequired: p,
18
18
  error: C,
@@ -20,28 +20,28 @@ const V = k(
20
20
  size: N,
21
21
  disabled: w,
22
22
  isDisabled: j,
23
- value: i,
23
+ value: s,
24
24
  onChange: y,
25
25
  defaultValue: l,
26
26
  id: B,
27
27
  ...S
28
28
  }, q) => {
29
- const A = b ?? p, t = C ?? h, o = w ?? j, R = !!(s || e || t || a), c = i !== void 0, [D, E] = U.useState(
29
+ const A = b ?? p, t = C ?? h, e = w ?? j, R = !!(i || a || t || o), c = s !== void 0, [D, E] = U.useState(
30
30
  () => String(l ?? "").length
31
- ), F = c ? String(i ?? "").length : D, I = (f) => {
31
+ ), F = c ? String(s ?? "").length : D, I = (f) => {
32
32
  c || E(f.target.value.length), y?.(f);
33
- }, r = z({
34
- label: s,
35
- helperText: e,
33
+ }, n = z({
34
+ label: i,
35
+ helperText: a,
36
36
  helperTextPosition: d,
37
37
  labelOrientation: u,
38
38
  error: t,
39
39
  required: A,
40
- disabled: o,
40
+ disabled: e,
41
41
  id: B,
42
- footer: e && d === "flow" || a ? /* @__PURE__ */ v("div", { className: "flex items-center justify-between gap-[6px]", children: [
43
- /* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1" }),
44
- a ? /* @__PURE__ */ v(
42
+ footer: a && d === "flow" || o ? /* @__PURE__ */ v("div", { className: "flex items-center justify-between gap-[6px]", children: [
43
+ /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-1" }),
44
+ o ? /* @__PURE__ */ v(
45
45
  "div",
46
46
  {
47
47
  className: "text-[12px] font-medium leading-[18px] text-navigation-muted text-right",
@@ -49,48 +49,49 @@ const V = k(
49
49
  children: [
50
50
  F,
51
51
  "/",
52
- a
52
+ o
53
53
  ]
54
54
  }
55
55
  ) : null
56
56
  ] }) : void 0,
57
57
  rootClassName: "min-w-[240px]"
58
- }), m = /* @__PURE__ */ n(
58
+ }), m = /* @__PURE__ */ r(
59
59
  "div",
60
60
  {
61
61
  className: x(
62
- e && d === "absolute" && "relative"
62
+ a && d === "absolute" && "relative"
63
63
  ),
64
- children: /* @__PURE__ */ n(
64
+ children: /* @__PURE__ */ r(
65
65
  "textarea",
66
66
  {
67
67
  className: x(
68
68
  G({
69
69
  error: !!t,
70
70
  size: N,
71
- disabled: !!o,
71
+ disabled: !!e,
72
72
  className: g
73
73
  }),
74
74
  "bg-canvas",
75
- o && "bg-disabled-surface"
75
+ e && "bg-disabled-surface"
76
76
  ),
77
77
  ref: q,
78
- disabled: !!o,
79
- value: i,
78
+ disabled: !!e,
79
+ value: s,
80
80
  defaultValue: l,
81
81
  onChange: I,
82
- id: r.controlId,
82
+ id: n.controlId,
83
83
  "data-component": "textarea",
84
84
  "data-invalid": t || void 0,
85
- "data-disabled": o || void 0,
86
- "aria-invalid": r.controlAria["aria-invalid"],
87
- "aria-describedby": r.controlAria["aria-describedby"],
88
- ...S
85
+ "data-disabled": e || void 0,
86
+ "aria-invalid": n.controlAria["aria-invalid"],
87
+ "aria-describedby": n.controlAria["aria-describedby"],
88
+ ...S,
89
+ maxLength: o
89
90
  }
90
91
  )
91
92
  }
92
93
  );
93
- return /* @__PURE__ */ n("div", { className: "flex w-full flex-col gap-[6px]", children: R ? r.wrapControl(m) : m });
94
+ return /* @__PURE__ */ r("div", { className: "flex w-full flex-col gap-[6px]", children: R ? n.wrapControl(m) : m });
94
95
  }
95
96
  );
96
97
  export {
@@ -4,6 +4,7 @@ export interface TextareaProps extends FieldControlProps {
4
4
  className?: string;
5
5
  value?: string;
6
6
  onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
7
+ /** Caps input length and shows a live `n/{characterLimit}` counter. */
7
8
  characterLimit?: number;
8
9
  /** @deprecated Use `required` */
9
10
  isRequired?: boolean;
@@ -1,23 +1,23 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
- import { useRef as y, useEffect as b } from "react";
3
- import { useWatch as V, Controller as w } from "react-hook-form";
2
+ import { useRef as w, useEffect as y } from "react";
3
+ import { useWatch as b, Controller as V } from "react-hook-form";
4
4
  import { SmartInput as x } from "../../components/forms/smart-input/smart-input.js";
5
- import { readOptionFlag as d } from "../utils/optionFlag.js";
6
- const T = ({
5
+ import { readOptionFlag as p } from "../utils/optionFlag.js";
6
+ const I = ({
7
7
  field: e,
8
8
  validationRules: u,
9
9
  isDisabled: i,
10
10
  formHelpers: r
11
11
  }) => {
12
- const a = e.fieldType === "text" ? e : null, n = a?.allowNegativeDependency, l = !!n, c = !!a?.nonNegative, p = V({
12
+ const n = e.fieldType === "text" ? e : null, o = n?.allowNegativeDependency, l = !!o, c = !!n?.nonNegative, d = b({
13
13
  control: r.form.control,
14
- name: n?.fieldId ?? "",
14
+ name: o?.fieldId ?? "",
15
15
  disabled: !l
16
- }), f = !c || l && d(
17
- r.form.getValues(n.fieldId),
18
- n.optionFlag
19
- ), s = y(!0);
20
- return b(() => {
16
+ }), f = !c || l && p(
17
+ r.form.getValues(o.fieldId),
18
+ o.optionFlag
19
+ ), s = w(!0);
20
+ return y(() => {
21
21
  if (!l) return;
22
22
  if (s.current) {
23
23
  s.current = !1;
@@ -25,8 +25,8 @@ const T = ({
25
25
  }
26
26
  const t = r.form.getValues(e.id);
27
27
  t != null && String(t).trim() !== "" && r.form.trigger(e.id);
28
- }, [l, p, e.id, r.form]), a ? /* @__PURE__ */ m(
29
- w,
28
+ }, [l, d, e.id, r.form]), n ? /* @__PURE__ */ m(
29
+ V,
30
30
  {
31
31
  name: e.id,
32
32
  control: r.form.control,
@@ -34,26 +34,26 @@ const T = ({
34
34
  ...u,
35
35
  validate: (t) => {
36
36
  if (typeof u.validate == "function") {
37
- const o = u.validate(
37
+ const a = u.validate(
38
38
  t,
39
39
  r.form.getValues()
40
40
  );
41
- if (o !== !0) return o;
41
+ if (a !== !0) return a;
42
42
  }
43
- return c && l && !d(
44
- r.form.getValues(n.fieldId),
45
- n.optionFlag
43
+ return c && l && !p(
44
+ r.form.getValues(o.fieldId),
45
+ o.optionFlag
46
46
  ) && typeof t == "string" && Number(t) < 0 ? `${e.label || "Value"} must be a non-negative number` : !0;
47
47
  }
48
48
  },
49
- render: ({ field: t, fieldState: o }) => {
50
- const g = !!o.error, h = t.value;
49
+ render: ({ field: t, fieldState: a }) => {
50
+ const g = !!a.error, h = t.value;
51
51
  return /* @__PURE__ */ m(
52
52
  x,
53
53
  {
54
54
  name: e.id,
55
55
  label: e.label,
56
- type: a.type,
56
+ type: n.type,
57
57
  value: h ?? void 0,
58
58
  onChange: (v) => t.onChange(v),
59
59
  onBlur: t.onBlur,
@@ -61,9 +61,10 @@ const T = ({
61
61
  required: e.isRequired && !i,
62
62
  disabled: i,
63
63
  error: g,
64
- helperText: g ? o?.error?.message : e?.helpText,
64
+ helperText: g ? a?.error?.message : e?.helpText,
65
65
  allowNegative: f,
66
- allowDecimal: a.allowDecimal ?? !0
66
+ allowDecimal: n.allowDecimal ?? !0,
67
+ allowSpecialCharacters: n.allowSpecialCharacters
67
68
  }
68
69
  );
69
70
  }
@@ -71,5 +72,5 @@ const T = ({
71
72
  ) : null;
72
73
  };
73
74
  export {
74
- T as TextField
75
+ I as TextField
75
76
  };
@@ -287,6 +287,12 @@ export type TextField = BaseField & {
287
287
  defaultValue?: string | number;
288
288
  nonNegative?: boolean;
289
289
  allowDecimal?: boolean;
290
+ /**
291
+ * When false (default), only letters, numbers, and spaces are kept.
292
+ * Set true to allow punctuation and symbols. `email` / `password` /
293
+ * `url` / `tel` types allow special characters unless this is false.
294
+ */
295
+ allowSpecialCharacters?: boolean;
290
296
  /**
291
297
  * Reactively override `nonNegative` based on a flag on the currently
292
298
  * selected option of another (select) field. Only meaningful when
@@ -1,6 +1,6 @@
1
- const h = /^(\d{4})-(\d{2})-(\d{2})$/;
2
- function c(t) {
3
- const n = h.exec(t);
1
+ const m = /^(\d{4})-(\d{2})-(\d{2})$/;
2
+ function e(t) {
3
+ const n = m.exec(t);
4
4
  if (!n)
5
5
  throw new Error(`Invalid civil date: ${t}`);
6
6
  const o = Number(n[1]), r = Number(n[2]), a = Number(n[3]);
@@ -12,19 +12,19 @@ function l(t, n, o) {
12
12
  return `${String(t).padStart(4, "0")}-${String(n).padStart(2, "0")}-${String(o).padStart(2, "0")}`;
13
13
  }
14
14
  function u(t, n, o) {
15
- const r = Math.floor((14 - n) / 12), a = t + 4800 - r, e = n + 12 * r - 3;
16
- return o + Math.floor((153 * e + 2) / 5) + 365 * a + Math.floor(a / 4) - Math.floor(a / 100) + Math.floor(a / 400) - 32045;
15
+ const r = Math.floor((14 - n) / 12), a = t + 4800 - r, c = n + 12 * r - 3;
16
+ return o + Math.floor((153 * c + 2) / 5) + 365 * a + Math.floor(a / 4) - Math.floor(a / 100) + Math.floor(a / 400) - 32045;
17
17
  }
18
18
  function y(t) {
19
- const n = t + 32044, o = Math.floor((4 * n + 3) / 146097), r = n - Math.floor(146097 * o / 4), a = Math.floor((4 * r + 3) / 1461), e = r - Math.floor(1461 * a / 4), f = Math.floor((5 * e + 2) / 153), d = e - Math.floor((153 * f + 2) / 5) + 1, m = f + 3 - 12 * Math.floor(f / 10);
20
- return { y: 100 * o + a - 4800 + Math.floor(f / 10), m, d };
19
+ const n = t + 32044, o = Math.floor((4 * n + 3) / 146097), r = n - Math.floor(146097 * o / 4), a = Math.floor((4 * r + 3) / 1461), c = r - Math.floor(1461 * a / 4), i = Math.floor((5 * c + 2) / 153), d = c - Math.floor((153 * i + 2) / 5) + 1, h = i + 3 - 12 * Math.floor(i / 10);
20
+ return { y: 100 * o + a - 4800 + Math.floor(i / 10), m: h, d };
21
21
  }
22
22
  function M(t, n) {
23
- const { y: o, m: r, d: a } = c(t), e = y(u(o, r, a) + n);
24
- return l(e.y, e.m, e.d);
23
+ const { y: o, m: r, d: a } = e(t), c = y(u(o, r, a) + n);
24
+ return l(c.y, c.m, c.d);
25
25
  }
26
26
  function D(t, n) {
27
- const o = c(t), r = c(n);
27
+ const o = e(t), r = e(n);
28
28
  return u(o.y, o.m, o.d) - u(r.y, r.m, r.d);
29
29
  }
30
30
  function s(t, n) {
@@ -37,8 +37,8 @@ function S(t, n) {
37
37
  return s(t, n) >= 0 ? t : n;
38
38
  }
39
39
  function $(t) {
40
- const { y: n, m: o, d: r } = c(t), a = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4], e = o < 3 ? n - 1 : n;
41
- return (e + Math.floor(e / 4) - Math.floor(e / 100) + Math.floor(e / 400) + a[o - 1] + r) % 7;
40
+ const { y: n, m: o, d: r } = e(t), a = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4], c = o < 3 ? n - 1 : n;
41
+ return (c + Math.floor(c / 4) - Math.floor(c / 100) + Math.floor(c / 400) + a[o - 1] + r) % 7;
42
42
  }
43
43
  function C(t, n) {
44
44
  const r = ($(t) + 7 - n) % 7;
@@ -54,10 +54,10 @@ function I(t) {
54
54
  return l(t.getFullYear(), t.getMonth() + 1, t.getDate());
55
55
  }
56
56
  function J(t) {
57
- const { y: n, m: o, d: r } = c(t);
57
+ const { y: n, m: o, d: r } = e(t);
58
58
  return new Date(n, o - 1, r);
59
59
  }
60
- const i = [
60
+ const f = [
61
61
  "Jan",
62
62
  "Feb",
63
63
  "Mar",
@@ -72,11 +72,11 @@ const i = [
72
72
  "Dec"
73
73
  ];
74
74
  function N(t, n) {
75
- const o = c(t), r = c(n);
76
- return o.y === r.y && o.m === r.m ? `${i[o.m - 1]} ${o.d} – ${r.d}` : o.y === r.y ? `${i[o.m - 1]} ${o.d} – ${i[r.m - 1]} ${r.d}` : `${i[o.m - 1]} ${o.d} ${o.y} – ${i[r.m - 1]} ${r.d} ${r.y}`;
75
+ const o = e(t), r = e(n);
76
+ return o.y === r.y ? `${f[o.m - 1]} ${o.d} – ${f[r.m - 1]} ${r.d}` : `${f[o.m - 1]} ${o.d} ${o.y} – ${f[r.m - 1]} ${r.d} ${r.y}`;
77
77
  }
78
78
  export {
79
- i as MONTH_SHORT,
79
+ f as MONTH_SHORT,
80
80
  M as addDays,
81
81
  I as civilFromLocalDate,
82
82
  s as compareCivil,
@@ -87,7 +87,7 @@ export {
87
87
  J as localDateFromCivil,
88
88
  S as maxCivil,
89
89
  g as minCivil,
90
- c as parseCivilDate,
90
+ e as parseCivilDate,
91
91
  l as toCivilDate,
92
92
  C as weekStart,
93
93
  $ as weekday