@caipira/tamandua 0.0.55 → 0.0.58
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/dist/Form.js +2 -2
- package/dist/{Form.vue_vue_type_script_setup_true_lang-DfBtuwm7.js → Form.vue_vue_type_script_setup_true_lang-CNGNCak7.js} +1 -1
- package/dist/InputDate.js +2 -2
- package/dist/{InputDate.vue_vue_type_script_setup_true_lang-BAgG9zPV.js → InputDate.vue_vue_type_script_setup_true_lang-mrB_0-J7.js} +7 -7
- package/dist/InputPassword.js +2 -2
- package/dist/{InputPassword.vue_vue_type_script_setup_true_lang-BghMiF8B.js → InputPassword.vue_vue_type_script_setup_true_lang-CPDcQb5I.js} +1 -1
- package/dist/components.js +3 -3
- package/dist/date.js +440 -138
- package/dist/form2.js +1 -1
- package/dist/format-BZx-8XXc.js +1217 -0
- package/dist/{plugin-BT2ef1QG.js → plugin-B-YDK-TW.js} +1 -1
- package/dist/{plugin-BtF6kCcf.js → plugin-BQPL19WY.js} +1 -1
- package/dist/{plugin-BJJ1-Os1.js → plugin-BuU0zOfE.js} +1 -1
- package/dist/{plugins-Bp5IKWid.js → plugins-UNYdIrpm.js} +4 -4
- package/dist/plugins.js +4 -4
- package/dist/subMonths-XOke808J.js +38 -0
- package/dist/tamandua.js +1 -1
- package/dist/{transformers-DLw_G6c6.js → transformers-DowKEH_9.js} +1 -1
- package/dist/types/services/date.d.ts +3 -2
- package/package.json +4 -3
- package/dist/index-CjvqeRf7.js +0 -1280
- package/dist/index-CuyePt3m.js +0 -40
package/dist/date.js
CHANGED
|
@@ -1,155 +1,457 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as
|
|
3
|
-
import { b as
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return
|
|
14
|
-
}
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var S = {
|
|
34
|
-
ceil: Math.ceil,
|
|
35
|
-
round: Math.round,
|
|
36
|
-
floor: Math.floor,
|
|
37
|
-
trunc: function(t) {
|
|
38
|
-
return t < 0 ? Math.ceil(t) : Math.floor(t);
|
|
39
|
-
}
|
|
40
|
-
// Math.trunc is not supported by IE
|
|
41
|
-
}, y = "trunc";
|
|
42
|
-
function F(e) {
|
|
43
|
-
return e ? S[e] : S[y];
|
|
1
|
+
import { c as O, t as D, m as X, n as N, s as H, e as P, g as C, a as U, b as T, d as j } from "./format-BZx-8XXc.js";
|
|
2
|
+
import { f as Se } from "./format-BZx-8XXc.js";
|
|
3
|
+
import { b as $e, g as Ae, c as Le, a as ze, s as Ze } from "./subMonths-XOke808J.js";
|
|
4
|
+
function we(e, t, n) {
|
|
5
|
+
return O(n?.in || e, +D(e) + t);
|
|
6
|
+
}
|
|
7
|
+
function xe(e, t, n) {
|
|
8
|
+
const r = D(e, n?.in);
|
|
9
|
+
return r.setTime(r.getTime() + t * X), r;
|
|
10
|
+
}
|
|
11
|
+
function h(e, t) {
|
|
12
|
+
const n = +D(e) - +D(t);
|
|
13
|
+
return n < 0 ? -1 : n > 0 ? 1 : n;
|
|
14
|
+
}
|
|
15
|
+
function E(e) {
|
|
16
|
+
return O(e, Date.now());
|
|
17
|
+
}
|
|
18
|
+
function R(e, t, n) {
|
|
19
|
+
const [r, s] = N(
|
|
20
|
+
n?.in,
|
|
21
|
+
e,
|
|
22
|
+
t
|
|
23
|
+
);
|
|
24
|
+
return +H(r) == +H(s);
|
|
25
|
+
}
|
|
26
|
+
function G(e, t, n) {
|
|
27
|
+
const [r, s] = N(
|
|
28
|
+
n?.in,
|
|
29
|
+
e,
|
|
30
|
+
t
|
|
31
|
+
), a = r.getFullYear() - s.getFullYear(), i = r.getMonth() - s.getMonth();
|
|
32
|
+
return a * 12 + i;
|
|
44
33
|
}
|
|
45
34
|
function q(e) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
function z(e) {
|
|
51
|
-
i(1, arguments);
|
|
52
|
-
var t = s(e), r = t.getMonth();
|
|
53
|
-
return t.setFullYear(t.getFullYear(), r + 1, 0), t.setHours(23, 59, 59, 999), t;
|
|
54
|
-
}
|
|
55
|
-
function C(e) {
|
|
56
|
-
i(1, arguments);
|
|
57
|
-
var t = s(e);
|
|
58
|
-
return q(t).getTime() === z(t).getTime();
|
|
59
|
-
}
|
|
60
|
-
function W(e, t) {
|
|
61
|
-
i(2, arguments);
|
|
62
|
-
var r = s(e), o = s(t), f = M(r, o), l = Math.abs(A(r, o)), n;
|
|
63
|
-
if (l < 1)
|
|
64
|
-
n = 0;
|
|
65
|
-
else {
|
|
66
|
-
r.getMonth() === 1 && r.getDate() > 27 && r.setDate(30), r.setMonth(r.getMonth() - f * l);
|
|
67
|
-
var c = M(r, o) === -f;
|
|
68
|
-
C(s(e)) && l === 1 && M(e, o) === 1 && (c = !1), n = f * (l - Number(c));
|
|
69
|
-
}
|
|
70
|
-
return n === 0 ? 0 : n;
|
|
35
|
+
return (t) => {
|
|
36
|
+
const r = (e ? Math[e] : Math.trunc)(t);
|
|
37
|
+
return r === 0 ? 0 : r;
|
|
38
|
+
};
|
|
71
39
|
}
|
|
72
|
-
function
|
|
73
|
-
|
|
74
|
-
var o = U(e, t) / 1e3;
|
|
75
|
-
return F(r?.roundingMethod)(o);
|
|
40
|
+
function J(e, t) {
|
|
41
|
+
return +D(e) - +D(t);
|
|
76
42
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
for (var r in t)
|
|
81
|
-
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
|
|
82
|
-
return e;
|
|
43
|
+
function V(e, t) {
|
|
44
|
+
const n = D(e, t?.in);
|
|
45
|
+
return n.setHours(23, 59, 59, 999), n;
|
|
83
46
|
}
|
|
84
|
-
function
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
47
|
+
function B(e, t) {
|
|
48
|
+
const n = D(e, t?.in), r = n.getMonth();
|
|
49
|
+
return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n;
|
|
50
|
+
}
|
|
51
|
+
function K(e, t) {
|
|
52
|
+
const n = D(e, t?.in);
|
|
53
|
+
return +V(n, t) == +B(n, t);
|
|
54
|
+
}
|
|
55
|
+
function Q(e, t, n) {
|
|
56
|
+
const [r, s, a] = N(
|
|
57
|
+
n?.in,
|
|
58
|
+
e,
|
|
59
|
+
e,
|
|
60
|
+
t
|
|
61
|
+
), i = h(s, a), o = Math.abs(
|
|
62
|
+
G(s, a)
|
|
63
|
+
);
|
|
64
|
+
if (o < 1)
|
|
65
|
+
return 0;
|
|
66
|
+
s.getMonth() === 1 && s.getDate() > 27 && s.setDate(30), s.setMonth(s.getMonth() - i * o);
|
|
67
|
+
let u = h(s, a) === -i;
|
|
68
|
+
K(r) && o === 1 && h(r, a) === 1 && (u = !1);
|
|
69
|
+
const l = i * (o - +u);
|
|
70
|
+
return l === 0 ? 0 : l;
|
|
71
|
+
}
|
|
72
|
+
function ee(e, t, n) {
|
|
73
|
+
const r = J(e, t) / 1e3;
|
|
74
|
+
return q(n?.roundingMethod)(r);
|
|
75
|
+
}
|
|
76
|
+
function te(e, t, n) {
|
|
77
|
+
const r = j(), s = n?.locale ?? r.locale ?? P, a = 2520, i = h(e, t);
|
|
78
|
+
if (isNaN(i))
|
|
96
79
|
throw new RangeError("Invalid time value");
|
|
97
|
-
|
|
98
|
-
addSuffix:
|
|
99
|
-
comparison:
|
|
100
|
-
}),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (
|
|
106
|
-
return n.formatDistance("xMinutes",
|
|
107
|
-
if (
|
|
108
|
-
return
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
|
|
80
|
+
const o = Object.assign({}, n, {
|
|
81
|
+
addSuffix: n?.addSuffix,
|
|
82
|
+
comparison: i
|
|
83
|
+
}), [u, l] = N(
|
|
84
|
+
n?.in,
|
|
85
|
+
...i > 0 ? [t, e] : [e, t]
|
|
86
|
+
), m = ee(l, u), W = (C(l) - C(u)) / 1e3, f = Math.round((m - W) / 60);
|
|
87
|
+
let M;
|
|
88
|
+
if (f < 2)
|
|
89
|
+
return n?.includeSeconds ? m < 5 ? s.formatDistance("lessThanXSeconds", 5, o) : m < 10 ? s.formatDistance("lessThanXSeconds", 10, o) : m < 20 ? s.formatDistance("lessThanXSeconds", 20, o) : m < 40 ? s.formatDistance("halfAMinute", 0, o) : m < 60 ? s.formatDistance("lessThanXMinutes", 1, o) : s.formatDistance("xMinutes", 1, o) : f === 0 ? s.formatDistance("lessThanXMinutes", 1, o) : s.formatDistance("xMinutes", f, o);
|
|
90
|
+
if (f < 45)
|
|
91
|
+
return s.formatDistance("xMinutes", f, o);
|
|
92
|
+
if (f < 90)
|
|
93
|
+
return s.formatDistance("aboutXHours", 1, o);
|
|
94
|
+
if (f < U) {
|
|
95
|
+
const d = Math.round(f / 60);
|
|
96
|
+
return s.formatDistance("aboutXHours", d, o);
|
|
112
97
|
} else {
|
|
113
|
-
if (
|
|
114
|
-
return
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
return
|
|
118
|
-
} else if (
|
|
119
|
-
return
|
|
98
|
+
if (f < a)
|
|
99
|
+
return s.formatDistance("xDays", 1, o);
|
|
100
|
+
if (f < T) {
|
|
101
|
+
const d = Math.round(f / U);
|
|
102
|
+
return s.formatDistance("xDays", d, o);
|
|
103
|
+
} else if (f < T * 2)
|
|
104
|
+
return M = Math.round(f / T), s.formatDistance("aboutXMonths", M, o);
|
|
120
105
|
}
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
return
|
|
106
|
+
if (M = Q(l, u), M < 12) {
|
|
107
|
+
const d = Math.round(f / T);
|
|
108
|
+
return s.formatDistance("xMonths", d, o);
|
|
124
109
|
} else {
|
|
125
|
-
|
|
126
|
-
return
|
|
110
|
+
const d = M % 12, Y = Math.trunc(M / 12);
|
|
111
|
+
return d < 3 ? s.formatDistance("aboutXYears", Y, o) : d < 9 ? s.formatDistance("overXYears", Y, o) : s.formatDistance("almostXYears", Y + 1, o);
|
|
127
112
|
}
|
|
128
113
|
}
|
|
129
|
-
function
|
|
130
|
-
return
|
|
114
|
+
function Oe(e, t) {
|
|
115
|
+
return te(e, E(e), t);
|
|
116
|
+
}
|
|
117
|
+
function ye(e) {
|
|
118
|
+
return Math.trunc(+D(e) / 1e3);
|
|
119
|
+
}
|
|
120
|
+
function He(e, t) {
|
|
121
|
+
return R(
|
|
122
|
+
O(t?.in || e, e),
|
|
123
|
+
E(t?.in || e)
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
function ne(e, t) {
|
|
127
|
+
const n = ie(t);
|
|
128
|
+
return "formatToParts" in n ? se(n, e) : ae(n, e);
|
|
129
|
+
}
|
|
130
|
+
const re = {
|
|
131
|
+
year: 0,
|
|
132
|
+
month: 1,
|
|
133
|
+
day: 2,
|
|
134
|
+
hour: 3,
|
|
135
|
+
minute: 4,
|
|
136
|
+
second: 5
|
|
137
|
+
};
|
|
138
|
+
function se(e, t) {
|
|
139
|
+
try {
|
|
140
|
+
const n = e.formatToParts(t), r = [];
|
|
141
|
+
for (let s = 0; s < n.length; s++) {
|
|
142
|
+
const a = re[n[s].type];
|
|
143
|
+
a !== void 0 && (r[a] = parseInt(n[s].value, 10));
|
|
144
|
+
}
|
|
145
|
+
return r;
|
|
146
|
+
} catch (n) {
|
|
147
|
+
if (n instanceof RangeError)
|
|
148
|
+
return [NaN];
|
|
149
|
+
throw n;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function ae(e, t) {
|
|
153
|
+
const n = e.format(t), r = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);
|
|
154
|
+
return [
|
|
155
|
+
parseInt(r[3], 10),
|
|
156
|
+
parseInt(r[1], 10),
|
|
157
|
+
parseInt(r[2], 10),
|
|
158
|
+
parseInt(r[4], 10),
|
|
159
|
+
parseInt(r[5], 10),
|
|
160
|
+
parseInt(r[6], 10)
|
|
161
|
+
];
|
|
162
|
+
}
|
|
163
|
+
const g = {}, _ = new Intl.DateTimeFormat("en-US", {
|
|
164
|
+
hourCycle: "h23",
|
|
165
|
+
timeZone: "America/New_York",
|
|
166
|
+
year: "numeric",
|
|
167
|
+
month: "2-digit",
|
|
168
|
+
day: "2-digit",
|
|
169
|
+
hour: "2-digit",
|
|
170
|
+
minute: "2-digit",
|
|
171
|
+
second: "2-digit"
|
|
172
|
+
}).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), oe = _ === "06/25/2014, 00:00:00" || _ === "06/25/2014 00:00:00";
|
|
173
|
+
function ie(e) {
|
|
174
|
+
return g[e] || (g[e] = oe ? new Intl.DateTimeFormat("en-US", {
|
|
175
|
+
hourCycle: "h23",
|
|
176
|
+
timeZone: e,
|
|
177
|
+
year: "numeric",
|
|
178
|
+
month: "numeric",
|
|
179
|
+
day: "2-digit",
|
|
180
|
+
hour: "2-digit",
|
|
181
|
+
minute: "2-digit",
|
|
182
|
+
second: "2-digit"
|
|
183
|
+
}) : new Intl.DateTimeFormat("en-US", {
|
|
184
|
+
hour12: !1,
|
|
185
|
+
timeZone: e,
|
|
186
|
+
year: "numeric",
|
|
187
|
+
month: "numeric",
|
|
188
|
+
day: "2-digit",
|
|
189
|
+
hour: "2-digit",
|
|
190
|
+
minute: "2-digit",
|
|
191
|
+
second: "2-digit"
|
|
192
|
+
})), g[e];
|
|
193
|
+
}
|
|
194
|
+
function k(e, t, n, r, s, a, i) {
|
|
195
|
+
const o = /* @__PURE__ */ new Date(0);
|
|
196
|
+
return o.setUTCFullYear(e, t, n), o.setUTCHours(r, s, a, i), o;
|
|
197
|
+
}
|
|
198
|
+
const F = 36e5, ue = 6e4, I = {
|
|
199
|
+
timezone: /([Z+-].*)$/,
|
|
200
|
+
timezoneZ: /^(Z)$/,
|
|
201
|
+
timezoneHH: /^([+-]\d{2})$/,
|
|
202
|
+
timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
|
|
203
|
+
};
|
|
204
|
+
function y(e, t, n) {
|
|
205
|
+
if (!e)
|
|
206
|
+
return 0;
|
|
207
|
+
let r = I.timezoneZ.exec(e);
|
|
208
|
+
if (r)
|
|
209
|
+
return 0;
|
|
210
|
+
let s, a;
|
|
211
|
+
if (r = I.timezoneHH.exec(e), r)
|
|
212
|
+
return s = parseInt(r[1], 10), S(s) ? -(s * F) : NaN;
|
|
213
|
+
if (r = I.timezoneHHMM.exec(e), r) {
|
|
214
|
+
s = parseInt(r[2], 10);
|
|
215
|
+
const i = parseInt(r[3], 10);
|
|
216
|
+
return S(s, i) ? (a = Math.abs(s) * F + i * ue, r[1] === "+" ? -a : a) : NaN;
|
|
217
|
+
}
|
|
218
|
+
if (le(e)) {
|
|
219
|
+
t = new Date(t || Date.now());
|
|
220
|
+
const i = n ? t : ce(t), o = x(i, e);
|
|
221
|
+
return -(n ? o : fe(t, o, e));
|
|
222
|
+
}
|
|
223
|
+
return NaN;
|
|
224
|
+
}
|
|
225
|
+
function ce(e) {
|
|
226
|
+
return k(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
|
|
227
|
+
}
|
|
228
|
+
function x(e, t) {
|
|
229
|
+
const n = ne(e, t), r = k(n[0], n[1] - 1, n[2], n[3] % 24, n[4], n[5], 0).getTime();
|
|
230
|
+
let s = e.getTime();
|
|
231
|
+
const a = s % 1e3;
|
|
232
|
+
return s -= a >= 0 ? a : 1e3 + a, r - s;
|
|
233
|
+
}
|
|
234
|
+
function fe(e, t, n) {
|
|
235
|
+
let s = e.getTime() - t;
|
|
236
|
+
const a = x(new Date(s), n);
|
|
237
|
+
if (t === a)
|
|
238
|
+
return t;
|
|
239
|
+
s -= a - t;
|
|
240
|
+
const i = x(new Date(s), n);
|
|
241
|
+
return a === i ? a : Math.max(a, i);
|
|
242
|
+
}
|
|
243
|
+
function S(e, t) {
|
|
244
|
+
return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
|
|
245
|
+
}
|
|
246
|
+
const b = {};
|
|
247
|
+
function le(e) {
|
|
248
|
+
if (b[e])
|
|
249
|
+
return !0;
|
|
250
|
+
try {
|
|
251
|
+
return new Intl.DateTimeFormat(void 0, { timeZone: e }), b[e] = !0, !0;
|
|
252
|
+
} catch {
|
|
253
|
+
return !1;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
function $(e) {
|
|
257
|
+
const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
|
|
258
|
+
return t.setUTCFullYear(e.getFullYear()), +e - +t;
|
|
259
|
+
}
|
|
260
|
+
const De = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, p = 36e5, A = 6e4, de = 2, c = {
|
|
261
|
+
dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
|
|
262
|
+
datePattern: /^([0-9W+-]+)(.*)/,
|
|
263
|
+
plainTime: /:/,
|
|
264
|
+
// year tokens
|
|
265
|
+
YY: /^(\d{2})$/,
|
|
266
|
+
YYY: [
|
|
267
|
+
/^([+-]\d{2})$/,
|
|
268
|
+
// 0 additional digits
|
|
269
|
+
/^([+-]\d{3})$/,
|
|
270
|
+
// 1 additional digit
|
|
271
|
+
/^([+-]\d{4})$/
|
|
272
|
+
// 2 additional digits
|
|
273
|
+
],
|
|
274
|
+
YYYY: /^(\d{4})/,
|
|
275
|
+
YYYYY: [
|
|
276
|
+
/^([+-]\d{4})/,
|
|
277
|
+
// 0 additional digits
|
|
278
|
+
/^([+-]\d{5})/,
|
|
279
|
+
// 1 additional digit
|
|
280
|
+
/^([+-]\d{6})/
|
|
281
|
+
// 2 additional digits
|
|
282
|
+
],
|
|
283
|
+
// date tokens
|
|
284
|
+
MM: /^-(\d{2})$/,
|
|
285
|
+
DDD: /^-?(\d{3})$/,
|
|
286
|
+
MMDD: /^-?(\d{2})-?(\d{2})$/,
|
|
287
|
+
Www: /^-?W(\d{2})$/,
|
|
288
|
+
WwwD: /^-?W(\d{2})-?(\d{1})$/,
|
|
289
|
+
HH: /^(\d{2}([.,]\d*)?)$/,
|
|
290
|
+
HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
|
|
291
|
+
HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
|
|
292
|
+
// time zone tokens (to identify the presence of a tz)
|
|
293
|
+
timeZone: De
|
|
294
|
+
};
|
|
295
|
+
function me(e, t = {}) {
|
|
296
|
+
if (arguments.length < 1)
|
|
297
|
+
throw new TypeError("1 argument required, but only " + arguments.length + " present");
|
|
298
|
+
if (e === null)
|
|
299
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
300
|
+
const n = t.additionalDigits == null ? de : Number(t.additionalDigits);
|
|
301
|
+
if (n !== 2 && n !== 1 && n !== 0)
|
|
302
|
+
throw new RangeError("additionalDigits must be 0, 1 or 2");
|
|
303
|
+
if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
|
|
304
|
+
return new Date(e.getTime());
|
|
305
|
+
if (typeof e == "number" || Object.prototype.toString.call(e) === "[object Number]")
|
|
306
|
+
return new Date(e);
|
|
307
|
+
if (Object.prototype.toString.call(e) !== "[object String]")
|
|
308
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
309
|
+
const r = Me(e), { year: s, restDateString: a } = Te(r.date, n), i = he(a, s);
|
|
310
|
+
if (i === null || isNaN(i.getTime()))
|
|
311
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
312
|
+
if (i) {
|
|
313
|
+
const o = i.getTime();
|
|
314
|
+
let u = 0, l;
|
|
315
|
+
if (r.time && (u = Ne(r.time), u === null || isNaN(u)))
|
|
316
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
317
|
+
if (r.timeZone || t.timeZone) {
|
|
318
|
+
if (l = y(r.timeZone || t.timeZone, new Date(o + u)), isNaN(l))
|
|
319
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
320
|
+
} else
|
|
321
|
+
l = $(new Date(o + u)), l = $(new Date(o + u + l));
|
|
322
|
+
return new Date(o + u + l);
|
|
323
|
+
} else
|
|
324
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
325
|
+
}
|
|
326
|
+
function Me(e) {
|
|
327
|
+
const t = {};
|
|
328
|
+
let n = c.dateTimePattern.exec(e), r;
|
|
329
|
+
if (n ? (t.date = n[1], r = n[3]) : (n = c.datePattern.exec(e), n ? (t.date = n[1], r = n[2]) : (t.date = null, r = e)), r) {
|
|
330
|
+
const s = c.timeZone.exec(r);
|
|
331
|
+
s ? (t.time = r.replace(s[1], ""), t.timeZone = s[1].trim()) : t.time = r;
|
|
332
|
+
}
|
|
333
|
+
return t;
|
|
334
|
+
}
|
|
335
|
+
function Te(e, t) {
|
|
336
|
+
if (e) {
|
|
337
|
+
const n = c.YYY[t], r = c.YYYYY[t];
|
|
338
|
+
let s = c.YYYY.exec(e) || r.exec(e);
|
|
339
|
+
if (s) {
|
|
340
|
+
const a = s[1];
|
|
341
|
+
return {
|
|
342
|
+
year: parseInt(a, 10),
|
|
343
|
+
restDateString: e.slice(a.length)
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
if (s = c.YY.exec(e) || n.exec(e), s) {
|
|
347
|
+
const a = s[1];
|
|
348
|
+
return {
|
|
349
|
+
year: parseInt(a, 10) * 100,
|
|
350
|
+
restDateString: e.slice(a.length)
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return {
|
|
355
|
+
year: null
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
function he(e, t) {
|
|
359
|
+
if (t === null)
|
|
360
|
+
return null;
|
|
361
|
+
let n, r, s;
|
|
362
|
+
if (!e || !e.length)
|
|
363
|
+
return n = /* @__PURE__ */ new Date(0), n.setUTCFullYear(t), n;
|
|
364
|
+
let a = c.MM.exec(e);
|
|
365
|
+
if (a)
|
|
366
|
+
return n = /* @__PURE__ */ new Date(0), r = parseInt(a[1], 10) - 1, z(t, r) ? (n.setUTCFullYear(t, r), n) : /* @__PURE__ */ new Date(NaN);
|
|
367
|
+
if (a = c.DDD.exec(e), a) {
|
|
368
|
+
n = /* @__PURE__ */ new Date(0);
|
|
369
|
+
const i = parseInt(a[1], 10);
|
|
370
|
+
return Ie(t, i) ? (n.setUTCFullYear(t, 0, i), n) : /* @__PURE__ */ new Date(NaN);
|
|
371
|
+
}
|
|
372
|
+
if (a = c.MMDD.exec(e), a) {
|
|
373
|
+
n = /* @__PURE__ */ new Date(0), r = parseInt(a[1], 10) - 1;
|
|
374
|
+
const i = parseInt(a[2], 10);
|
|
375
|
+
return z(t, r, i) ? (n.setUTCFullYear(t, r, i), n) : /* @__PURE__ */ new Date(NaN);
|
|
376
|
+
}
|
|
377
|
+
if (a = c.Www.exec(e), a)
|
|
378
|
+
return s = parseInt(a[1], 10) - 1, Z(s) ? L(t, s) : /* @__PURE__ */ new Date(NaN);
|
|
379
|
+
if (a = c.WwwD.exec(e), a) {
|
|
380
|
+
s = parseInt(a[1], 10) - 1;
|
|
381
|
+
const i = parseInt(a[2], 10) - 1;
|
|
382
|
+
return Z(s, i) ? L(t, s, i) : /* @__PURE__ */ new Date(NaN);
|
|
383
|
+
}
|
|
384
|
+
return null;
|
|
385
|
+
}
|
|
386
|
+
function Ne(e) {
|
|
387
|
+
let t, n, r = c.HH.exec(e);
|
|
388
|
+
if (r)
|
|
389
|
+
return t = parseFloat(r[1].replace(",", ".")), w(t) ? t % 24 * p : NaN;
|
|
390
|
+
if (r = c.HHMM.exec(e), r)
|
|
391
|
+
return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), w(t, n) ? t % 24 * p + n * A : NaN;
|
|
392
|
+
if (r = c.HHMMSS.exec(e), r) {
|
|
393
|
+
t = parseInt(r[1], 10), n = parseInt(r[2], 10);
|
|
394
|
+
const s = parseFloat(r[3].replace(",", "."));
|
|
395
|
+
return w(t, n, s) ? t % 24 * p + n * A + s * 1e3 : NaN;
|
|
396
|
+
}
|
|
397
|
+
return null;
|
|
398
|
+
}
|
|
399
|
+
function L(e, t, n) {
|
|
400
|
+
t = t || 0, n = n || 0;
|
|
401
|
+
const r = /* @__PURE__ */ new Date(0);
|
|
402
|
+
r.setUTCFullYear(e, 0, 4);
|
|
403
|
+
const s = r.getUTCDay() || 7, a = t * 7 + n + 1 - s;
|
|
404
|
+
return r.setUTCDate(r.getUTCDate() + a), r;
|
|
405
|
+
}
|
|
406
|
+
const Ye = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], ge = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
407
|
+
function v(e) {
|
|
408
|
+
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
409
|
+
}
|
|
410
|
+
function z(e, t, n) {
|
|
411
|
+
if (t < 0 || t > 11)
|
|
412
|
+
return !1;
|
|
413
|
+
if (n != null) {
|
|
414
|
+
if (n < 1)
|
|
415
|
+
return !1;
|
|
416
|
+
const r = v(e);
|
|
417
|
+
if (r && n > ge[t] || !r && n > Ye[t])
|
|
418
|
+
return !1;
|
|
419
|
+
}
|
|
420
|
+
return !0;
|
|
421
|
+
}
|
|
422
|
+
function Ie(e, t) {
|
|
423
|
+
if (t < 1)
|
|
424
|
+
return !1;
|
|
425
|
+
const n = v(e);
|
|
426
|
+
return !(n && t > 366 || !n && t > 365);
|
|
427
|
+
}
|
|
428
|
+
function Z(e, t) {
|
|
429
|
+
return !(e < 0 || e > 52 || t != null && (t < 0 || t > 6));
|
|
131
430
|
}
|
|
132
|
-
function
|
|
133
|
-
|
|
134
|
-
var t = s(e), r = t.getTime();
|
|
135
|
-
return r;
|
|
431
|
+
function w(e, t, n) {
|
|
432
|
+
return !(e < 0 || e >= 25 || t != null && (t < 0 || t >= 60) || n != null && (n < 0 || n >= 60));
|
|
136
433
|
}
|
|
137
|
-
function
|
|
138
|
-
|
|
434
|
+
function Ce(e, t, n) {
|
|
435
|
+
e = me(e, n);
|
|
436
|
+
const r = y(t, e, !0), s = new Date(e.getTime() - r), a = /* @__PURE__ */ new Date(0);
|
|
437
|
+
return a.setFullYear(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate()), a.setHours(s.getUTCHours(), s.getUTCMinutes(), s.getUTCSeconds(), s.getUTCMilliseconds()), a;
|
|
139
438
|
}
|
|
140
|
-
function
|
|
141
|
-
return
|
|
439
|
+
function Ue(e, t) {
|
|
440
|
+
return -y(e, t);
|
|
142
441
|
}
|
|
143
442
|
export {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
443
|
+
we as addMilliseconds,
|
|
444
|
+
xe as addMinutes,
|
|
445
|
+
$e as addMonths,
|
|
446
|
+
Se as format,
|
|
447
|
+
te as formatDistance,
|
|
448
|
+
Oe as formatDistanceToNow,
|
|
449
|
+
Ae as getDaysInMonth,
|
|
450
|
+
Ue as getTimezoneOffset,
|
|
451
|
+
ye as getUnixTime,
|
|
452
|
+
He as isToday,
|
|
453
|
+
Le as setDate,
|
|
454
|
+
ze as setYear,
|
|
455
|
+
Ze as subMonths,
|
|
456
|
+
Ce as toZonedTime
|
|
155
457
|
};
|
package/dist/form2.js
CHANGED