yummies 5.10.0 → 5.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/date-time.js CHANGED
@@ -1,594 +1,314 @@
1
- import { N as ht } from "./~number-baxVnzrJ.js";
2
- import "./~number-EWff2XI6.js";
3
- import { c as mt, a as lt } from "./~index-C3wKHvHr.js";
4
- import { unitsToMs as E } from "./ms.js";
5
- import { declension as X } from "./text.js";
6
- function st(u) {
7
- return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
1
+ import S from "dayjs";
2
+ import { unitsToMs as k } from "./ms.js";
3
+ import { declension as O } from "./text.js";
4
+ import { c as J, a as Z } from "./~index-C3wKHvHr.js";
5
+ import { N as G } from "./~constants-CFexlSUS.js";
6
+ function U(r) {
7
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
8
8
  }
9
- var tt = { exports: {} }, $t = tt.exports, it;
10
- function ct() {
11
- return it || (it = 1, function(u, $) {
12
- (function(p, c) {
13
- u.exports = c();
14
- })($t, function() {
15
- var p = 1e3, c = 6e4, v = 36e5, y = "millisecond", S = "second", D = "minute", j = "hour", M = "day", Y = "week", w = "month", N = "quarter", O = "year", m = "date", H = "Invalid Date", I = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, b = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, A = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(s) {
16
- var n = ["th", "st", "nd", "rd"], t = s % 100;
17
- return "[" + s + (n[(t - 20) % 10] || n[t] || n[0]) + "]";
18
- } }, C = function(s, n, t) {
19
- var i = String(s);
20
- return !i || i.length >= n ? s : "" + Array(n + 1 - i.length).join(t) + s;
21
- }, R = { s: C, z: function(s) {
22
- var n = -s.utcOffset(), t = Math.abs(n), i = Math.floor(t / 60), e = t % 60;
23
- return (n <= 0 ? "+" : "-") + C(i, 2, "0") + ":" + C(e, 2, "0");
24
- }, m: function s(n, t) {
25
- if (n.date() < t.date()) return -s(t, n);
26
- var i = 12 * (t.year() - n.year()) + (t.month() - n.month()), e = n.clone().add(i, w), d = t - e < 0, f = n.clone().add(i + (d ? -1 : 1), w);
27
- return +(-(i + (t - e) / (d ? e - f : f - e)) || 0);
28
- }, a: function(s) {
29
- return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
30
- }, p: function(s) {
31
- return { M: w, y: O, w: Y, d: M, D: m, h: j, m: D, s: S, ms: y, Q: N }[s] || String(s || "").toLowerCase().replace(/s$/, "");
32
- }, u: function(s) {
33
- return s === void 0;
34
- } }, L = "en", h = {};
35
- h[L] = A;
36
- var o = "$isDayjsObject", r = function(s) {
37
- return s instanceof T || !(!s || !s[o]);
38
- }, _ = function s(n, t, i) {
39
- var e;
40
- if (!n) return L;
41
- if (typeof n == "string") {
42
- var d = n.toLowerCase();
43
- h[d] && (e = d), t && (h[d] = t, e = d);
44
- var f = n.split("-");
45
- if (!e && f.length > 1) return s(f[0]);
46
- } else {
47
- var g = n.name;
48
- h[g] = n, e = g;
49
- }
50
- return !i && e && (L = e), e || !i && L;
51
- }, l = function(s, n) {
52
- if (r(s)) return s.clone();
53
- var t = typeof n == "object" ? n : {};
54
- return t.date = s, t.args = arguments, new T(t);
55
- }, a = R;
56
- a.l = _, a.i = r, a.w = function(s, n) {
57
- return l(s, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset });
58
- };
59
- var T = function() {
60
- function s(t) {
61
- this.$L = _(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[o] = !0;
62
- }
63
- var n = s.prototype;
64
- return n.parse = function(t) {
65
- this.$d = function(i) {
66
- var e = i.date, d = i.utc;
67
- if (e === null) return /* @__PURE__ */ new Date(NaN);
68
- if (a.u(e)) return /* @__PURE__ */ new Date();
69
- if (e instanceof Date) return new Date(e);
70
- if (typeof e == "string" && !/Z$/i.test(e)) {
71
- var f = e.match(I);
72
- if (f) {
73
- var g = f[2] - 1 || 0, x = (f[7] || "0").substring(0, 3);
74
- return d ? new Date(Date.UTC(f[1], g, f[3] || 1, f[4] || 0, f[5] || 0, f[6] || 0, x)) : new Date(f[1], g, f[3] || 1, f[4] || 0, f[5] || 0, f[6] || 0, x);
75
- }
76
- }
77
- return new Date(e);
78
- }(t), this.init();
79
- }, n.init = function() {
80
- var t = this.$d;
81
- this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
82
- }, n.$utils = function() {
83
- return a;
84
- }, n.isValid = function() {
85
- return this.$d.toString() !== H;
86
- }, n.isSame = function(t, i) {
87
- var e = l(t);
88
- return this.startOf(i) <= e && e <= this.endOf(i);
89
- }, n.isAfter = function(t, i) {
90
- return l(t) < this.startOf(i);
91
- }, n.isBefore = function(t, i) {
92
- return this.endOf(i) < l(t);
93
- }, n.$g = function(t, i, e) {
94
- return a.u(t) ? this[i] : this.set(e, t);
95
- }, n.unix = function() {
96
- return Math.floor(this.valueOf() / 1e3);
97
- }, n.valueOf = function() {
98
- return this.$d.getTime();
99
- }, n.startOf = function(t, i) {
100
- var e = this, d = !!a.u(i) || i, f = a.p(t), g = function(z, q) {
101
- var J = a.w(e.$u ? Date.UTC(e.$y, q, z) : new Date(e.$y, q, z), e);
102
- return d ? J : J.endOf(M);
103
- }, x = function(z, q) {
104
- return a.w(e.toDate()[z].apply(e.toDate("s"), (d ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(q)), e);
105
- }, k = this.$W, W = this.$M, P = this.$D, B = "set" + (this.$u ? "UTC" : "");
106
- switch (f) {
107
- case O:
108
- return d ? g(1, 0) : g(31, 11);
109
- case w:
110
- return d ? g(1, W) : g(0, W + 1);
111
- case Y:
112
- var Z = this.$locale().weekStart || 0, Q = (k < Z ? k + 7 : k) - Z;
113
- return g(d ? P - Q : P + (6 - Q), W);
114
- case M:
115
- case m:
116
- return x(B + "Hours", 0);
117
- case j:
118
- return x(B + "Minutes", 1);
119
- case D:
120
- return x(B + "Seconds", 2);
121
- case S:
122
- return x(B + "Milliseconds", 3);
123
- default:
124
- return this.clone();
125
- }
126
- }, n.endOf = function(t) {
127
- return this.startOf(t, !1);
128
- }, n.$set = function(t, i) {
129
- var e, d = a.p(t), f = "set" + (this.$u ? "UTC" : ""), g = (e = {}, e[M] = f + "Date", e[m] = f + "Date", e[w] = f + "Month", e[O] = f + "FullYear", e[j] = f + "Hours", e[D] = f + "Minutes", e[S] = f + "Seconds", e[y] = f + "Milliseconds", e)[d], x = d === M ? this.$D + (i - this.$W) : i;
130
- if (d === w || d === O) {
131
- var k = this.clone().set(m, 1);
132
- k.$d[g](x), k.init(), this.$d = k.set(m, Math.min(this.$D, k.daysInMonth())).$d;
133
- } else g && this.$d[g](x);
134
- return this.init(), this;
135
- }, n.set = function(t, i) {
136
- return this.clone().$set(t, i);
137
- }, n.get = function(t) {
138
- return this[a.p(t)]();
139
- }, n.add = function(t, i) {
140
- var e, d = this;
141
- t = Number(t);
142
- var f = a.p(i), g = function(W) {
143
- var P = l(d);
144
- return a.w(P.date(P.date() + Math.round(W * t)), d);
145
- };
146
- if (f === w) return this.set(w, this.$M + t);
147
- if (f === O) return this.set(O, this.$y + t);
148
- if (f === M) return g(1);
149
- if (f === Y) return g(7);
150
- var x = (e = {}, e[D] = c, e[j] = v, e[S] = p, e)[f] || 1, k = this.$d.getTime() + t * x;
151
- return a.w(k, this);
152
- }, n.subtract = function(t, i) {
153
- return this.add(-1 * t, i);
154
- }, n.format = function(t) {
155
- var i = this, e = this.$locale();
156
- if (!this.isValid()) return e.invalidDate || H;
157
- var d = t || "YYYY-MM-DDTHH:mm:ssZ", f = a.z(this), g = this.$H, x = this.$m, k = this.$M, W = e.weekdays, P = e.months, B = e.meridiem, Z = function(q, J, G, K) {
158
- return q && (q[J] || q(i, d)) || G[J].slice(0, K);
159
- }, Q = function(q) {
160
- return a.s(g % 12 || 12, q, "0");
161
- }, z = B || function(q, J, G) {
162
- var K = q < 12 ? "AM" : "PM";
163
- return G ? K.toLowerCase() : K;
164
- };
165
- return d.replace(b, function(q, J) {
166
- return J || function(G) {
167
- switch (G) {
168
- case "YY":
169
- return String(i.$y).slice(-2);
170
- case "YYYY":
171
- return a.s(i.$y, 4, "0");
172
- case "M":
173
- return k + 1;
174
- case "MM":
175
- return a.s(k + 1, 2, "0");
176
- case "MMM":
177
- return Z(e.monthsShort, k, P, 3);
178
- case "MMMM":
179
- return Z(P, k);
180
- case "D":
181
- return i.$D;
182
- case "DD":
183
- return a.s(i.$D, 2, "0");
184
- case "d":
185
- return String(i.$W);
186
- case "dd":
187
- return Z(e.weekdaysMin, i.$W, W, 2);
188
- case "ddd":
189
- return Z(e.weekdaysShort, i.$W, W, 3);
190
- case "dddd":
191
- return W[i.$W];
192
- case "H":
193
- return String(g);
194
- case "HH":
195
- return a.s(g, 2, "0");
196
- case "h":
197
- return Q(1);
198
- case "hh":
199
- return Q(2);
200
- case "a":
201
- return z(g, x, !0);
202
- case "A":
203
- return z(g, x, !1);
204
- case "m":
205
- return String(x);
206
- case "mm":
207
- return a.s(x, 2, "0");
208
- case "s":
209
- return String(i.$s);
210
- case "ss":
211
- return a.s(i.$s, 2, "0");
212
- case "SSS":
213
- return a.s(i.$ms, 3, "0");
214
- case "Z":
215
- return f;
216
- }
217
- return null;
218
- }(q) || f.replace(":", "");
219
- });
220
- }, n.utcOffset = function() {
221
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
222
- }, n.diff = function(t, i, e) {
223
- var d, f = this, g = a.p(i), x = l(t), k = (x.utcOffset() - this.utcOffset()) * c, W = this - x, P = function() {
224
- return a.m(f, x);
225
- };
226
- switch (g) {
227
- case O:
228
- d = P() / 12;
229
- break;
230
- case w:
231
- d = P();
232
- break;
233
- case N:
234
- d = P() / 3;
235
- break;
236
- case Y:
237
- d = (W - k) / 6048e5;
238
- break;
239
- case M:
240
- d = (W - k) / 864e5;
241
- break;
242
- case j:
243
- d = W / v;
244
- break;
245
- case D:
246
- d = W / c;
247
- break;
248
- case S:
249
- d = W / p;
250
- break;
251
- default:
252
- d = W;
253
- }
254
- return e ? d : a.a(d);
255
- }, n.daysInMonth = function() {
256
- return this.endOf(w).$D;
257
- }, n.$locale = function() {
258
- return h[this.$L];
259
- }, n.locale = function(t, i) {
260
- if (!t) return this.$L;
261
- var e = this.clone(), d = _(t, i, !0);
262
- return d && (e.$L = d), e;
263
- }, n.clone = function() {
264
- return a.w(this.$d, this);
265
- }, n.toDate = function() {
266
- return new Date(this.valueOf());
267
- }, n.toJSON = function() {
268
- return this.isValid() ? this.toISOString() : null;
269
- }, n.toISOString = function() {
270
- return this.$d.toISOString();
271
- }, n.toString = function() {
272
- return this.$d.toUTCString();
273
- }, s;
274
- }(), F = T.prototype;
275
- return l.prototype = F, [["$ms", y], ["$s", S], ["$m", D], ["$H", j], ["$W", M], ["$M", w], ["$y", O], ["$D", m]].forEach(function(s) {
276
- F[s[1]] = function(n) {
277
- return this.$g(n, s[0], s[1]);
278
- };
279
- }), l.extend = function(s, n) {
280
- return s.$i || (s(n, T, l), s.$i = !0), l;
281
- }, l.locale = _, l.isDayjs = r, l.unix = function(s) {
282
- return l(1e3 * s);
283
- }, l.en = h[L], l.Ls = h, l.p = {}, l;
284
- });
285
- }(tt)), tt.exports;
286
- }
287
- var Mt = ct();
288
- const U = /* @__PURE__ */ st(Mt);
289
- var et = { exports: {} }, pt = et.exports, ot;
290
- function yt() {
291
- return ot || (ot = 1, function(u, $) {
292
- (function(p, c) {
293
- u.exports = c();
294
- })(pt, function() {
295
- var p, c, v = 1e3, y = 6e4, S = 36e5, D = 864e5, j = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = 31536e6, Y = 2628e6, w = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, N = { years: M, months: Y, days: D, hours: S, minutes: y, seconds: v, milliseconds: 1, weeks: 6048e5 }, O = function(h) {
296
- return h instanceof R;
297
- }, m = function(h, o, r) {
298
- return new R(h, r, o.$l);
299
- }, H = function(h) {
300
- return c.p(h) + "s";
301
- }, I = function(h) {
302
- return h < 0;
303
- }, b = function(h) {
304
- return I(h) ? Math.ceil(h) : Math.floor(h);
305
- }, A = function(h) {
306
- return Math.abs(h);
307
- }, C = function(h, o) {
308
- return h ? I(h) ? { negative: !0, format: "" + A(h) + o } : { negative: !1, format: "" + h + o } : { negative: !1, format: "" };
309
- }, R = function() {
310
- function h(r, _, l) {
311
- var a = this;
312
- if (this.$d = {}, this.$l = l, r === void 0 && (this.$ms = 0, this.parseFromMilliseconds()), _) return m(r * N[H(_)], this);
313
- if (typeof r == "number") return this.$ms = r, this.parseFromMilliseconds(), this;
314
- if (typeof r == "object") return Object.keys(r).forEach(function(s) {
315
- a.$d[H(s)] = r[s];
9
+ var F = { exports: {} }, K = F.exports, A;
10
+ function Q() {
11
+ return A || (A = 1, function(r, n) {
12
+ (function(u, e) {
13
+ r.exports = e();
14
+ })(K, function() {
15
+ var u, e, c = 1e3, a = 6e4, _ = 36e5, f = 864e5, T = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, m = 31536e6, h = 2628e6, v = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, Y = { years: m, months: h, days: f, hours: _, minutes: a, seconds: c, milliseconds: 1, weeks: 6048e5 }, w = function(i) {
16
+ return i instanceof N;
17
+ }, o = function(i, s, t) {
18
+ return new N(i, t, s.$l);
19
+ }, M = function(i) {
20
+ return e.p(i) + "s";
21
+ }, b = function(i) {
22
+ return i < 0;
23
+ }, l = function(i) {
24
+ return b(i) ? Math.ceil(i) : Math.floor(i);
25
+ }, x = function(i) {
26
+ return Math.abs(i);
27
+ }, L = function(i, s) {
28
+ return i ? b(i) ? { negative: !0, format: "" + x(i) + s } : { negative: !1, format: "" + i + s } : { negative: !1, format: "" };
29
+ }, N = function() {
30
+ function i(t, d, p) {
31
+ var $ = this;
32
+ if (this.$d = {}, this.$l = p, t === void 0 && (this.$ms = 0, this.parseFromMilliseconds()), d) return o(t * Y[M(d)], this);
33
+ if (typeof t == "number") return this.$ms = t, this.parseFromMilliseconds(), this;
34
+ if (typeof t == "object") return Object.keys(t).forEach(function(H) {
35
+ $.$d[M(H)] = t[H];
316
36
  }), this.calMilliseconds(), this;
317
- if (typeof r == "string") {
318
- var T = r.match(w);
319
- if (T) {
320
- var F = T.slice(2).map(function(s) {
321
- return s != null ? Number(s) : 0;
37
+ if (typeof t == "string") {
38
+ var y = t.match(v);
39
+ if (y) {
40
+ var D = y.slice(2).map(function(H) {
41
+ return H != null ? Number(H) : 0;
322
42
  });
323
- return this.$d.years = F[0], this.$d.months = F[1], this.$d.weeks = F[2], this.$d.days = F[3], this.$d.hours = F[4], this.$d.minutes = F[5], this.$d.seconds = F[6], this.calMilliseconds(), this;
43
+ return this.$d.years = D[0], this.$d.months = D[1], this.$d.weeks = D[2], this.$d.days = D[3], this.$d.hours = D[4], this.$d.minutes = D[5], this.$d.seconds = D[6], this.calMilliseconds(), this;
324
44
  }
325
45
  }
326
46
  return this;
327
47
  }
328
- var o = h.prototype;
329
- return o.calMilliseconds = function() {
330
- var r = this;
331
- this.$ms = Object.keys(this.$d).reduce(function(_, l) {
332
- return _ + (r.$d[l] || 0) * N[l];
48
+ var s = i.prototype;
49
+ return s.calMilliseconds = function() {
50
+ var t = this;
51
+ this.$ms = Object.keys(this.$d).reduce(function(d, p) {
52
+ return d + (t.$d[p] || 0) * Y[p];
333
53
  }, 0);
334
- }, o.parseFromMilliseconds = function() {
335
- var r = this.$ms;
336
- this.$d.years = b(r / M), r %= M, this.$d.months = b(r / Y), r %= Y, this.$d.days = b(r / D), r %= D, this.$d.hours = b(r / S), r %= S, this.$d.minutes = b(r / y), r %= y, this.$d.seconds = b(r / v), r %= v, this.$d.milliseconds = r;
337
- }, o.toISOString = function() {
338
- var r = C(this.$d.years, "Y"), _ = C(this.$d.months, "M"), l = +this.$d.days || 0;
339
- this.$d.weeks && (l += 7 * this.$d.weeks);
340
- var a = C(l, "D"), T = C(this.$d.hours, "H"), F = C(this.$d.minutes, "M"), s = this.$d.seconds || 0;
341
- this.$d.milliseconds && (s += this.$d.milliseconds / 1e3, s = Math.round(1e3 * s) / 1e3);
342
- var n = C(s, "S"), t = r.negative || _.negative || a.negative || T.negative || F.negative || n.negative, i = T.format || F.format || n.format ? "T" : "", e = (t ? "-" : "") + "P" + r.format + _.format + a.format + i + T.format + F.format + n.format;
343
- return e === "P" || e === "-P" ? "P0D" : e;
344
- }, o.toJSON = function() {
54
+ }, s.parseFromMilliseconds = function() {
55
+ var t = this.$ms;
56
+ this.$d.years = l(t / m), t %= m, this.$d.months = l(t / h), t %= h, this.$d.days = l(t / f), t %= f, this.$d.hours = l(t / _), t %= _, this.$d.minutes = l(t / a), t %= a, this.$d.seconds = l(t / c), t %= c, this.$d.milliseconds = t;
57
+ }, s.toISOString = function() {
58
+ var t = L(this.$d.years, "Y"), d = L(this.$d.months, "M"), p = +this.$d.days || 0;
59
+ this.$d.weeks && (p += 7 * this.$d.weeks);
60
+ var $ = L(p, "D"), y = L(this.$d.hours, "H"), D = L(this.$d.minutes, "M"), H = this.$d.seconds || 0;
61
+ this.$d.milliseconds && (H += this.$d.milliseconds / 1e3, H = Math.round(1e3 * H) / 1e3);
62
+ var q = L(H, "S"), z = t.negative || d.negative || $.negative || y.negative || D.negative || q.negative, C = y.format || D.format || q.format ? "T" : "", E = (z ? "-" : "") + "P" + t.format + d.format + $.format + C + y.format + D.format + q.format;
63
+ return E === "P" || E === "-P" ? "P0D" : E;
64
+ }, s.toJSON = function() {
345
65
  return this.toISOString();
346
- }, o.format = function(r) {
347
- var _ = r || "YYYY-MM-DDTHH:mm:ss", l = { Y: this.$d.years, YY: c.s(this.$d.years, 2, "0"), YYYY: c.s(this.$d.years, 4, "0"), M: this.$d.months, MM: c.s(this.$d.months, 2, "0"), D: this.$d.days, DD: c.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: c.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: c.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: c.s(this.$d.seconds, 2, "0"), SSS: c.s(this.$d.milliseconds, 3, "0") };
348
- return _.replace(j, function(a, T) {
349
- return T || String(l[a]);
66
+ }, s.format = function(t) {
67
+ var d = t || "YYYY-MM-DDTHH:mm:ss", p = { Y: this.$d.years, YY: e.s(this.$d.years, 2, "0"), YYYY: e.s(this.$d.years, 4, "0"), M: this.$d.months, MM: e.s(this.$d.months, 2, "0"), D: this.$d.days, DD: e.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: e.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: e.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: e.s(this.$d.seconds, 2, "0"), SSS: e.s(this.$d.milliseconds, 3, "0") };
68
+ return d.replace(T, function($, y) {
69
+ return y || String(p[$]);
350
70
  });
351
- }, o.as = function(r) {
352
- return this.$ms / N[H(r)];
353
- }, o.get = function(r) {
354
- var _ = this.$ms, l = H(r);
355
- return l === "milliseconds" ? _ %= 1e3 : _ = l === "weeks" ? b(_ / N[l]) : this.$d[l], _ || 0;
356
- }, o.add = function(r, _, l) {
357
- var a;
358
- return a = _ ? r * N[H(_)] : O(r) ? r.$ms : m(r, this).$ms, m(this.$ms + a * (l ? -1 : 1), this);
359
- }, o.subtract = function(r, _) {
360
- return this.add(r, _, !0);
361
- }, o.locale = function(r) {
362
- var _ = this.clone();
363
- return _.$l = r, _;
364
- }, o.clone = function() {
365
- return m(this.$ms, this);
366
- }, o.humanize = function(r) {
367
- return p().add(this.$ms, "ms").locale(this.$l).fromNow(!r);
368
- }, o.valueOf = function() {
71
+ }, s.as = function(t) {
72
+ return this.$ms / Y[M(t)];
73
+ }, s.get = function(t) {
74
+ var d = this.$ms, p = M(t);
75
+ return p === "milliseconds" ? d %= 1e3 : d = p === "weeks" ? l(d / Y[p]) : this.$d[p], d || 0;
76
+ }, s.add = function(t, d, p) {
77
+ var $;
78
+ return $ = d ? t * Y[M(d)] : w(t) ? t.$ms : o(t, this).$ms, o(this.$ms + $ * (p ? -1 : 1), this);
79
+ }, s.subtract = function(t, d) {
80
+ return this.add(t, d, !0);
81
+ }, s.locale = function(t) {
82
+ var d = this.clone();
83
+ return d.$l = t, d;
84
+ }, s.clone = function() {
85
+ return o(this.$ms, this);
86
+ }, s.humanize = function(t) {
87
+ return u().add(this.$ms, "ms").locale(this.$l).fromNow(!t);
88
+ }, s.valueOf = function() {
369
89
  return this.asMilliseconds();
370
- }, o.milliseconds = function() {
90
+ }, s.milliseconds = function() {
371
91
  return this.get("milliseconds");
372
- }, o.asMilliseconds = function() {
92
+ }, s.asMilliseconds = function() {
373
93
  return this.as("milliseconds");
374
- }, o.seconds = function() {
94
+ }, s.seconds = function() {
375
95
  return this.get("seconds");
376
- }, o.asSeconds = function() {
96
+ }, s.asSeconds = function() {
377
97
  return this.as("seconds");
378
- }, o.minutes = function() {
98
+ }, s.minutes = function() {
379
99
  return this.get("minutes");
380
- }, o.asMinutes = function() {
100
+ }, s.asMinutes = function() {
381
101
  return this.as("minutes");
382
- }, o.hours = function() {
102
+ }, s.hours = function() {
383
103
  return this.get("hours");
384
- }, o.asHours = function() {
104
+ }, s.asHours = function() {
385
105
  return this.as("hours");
386
- }, o.days = function() {
106
+ }, s.days = function() {
387
107
  return this.get("days");
388
- }, o.asDays = function() {
108
+ }, s.asDays = function() {
389
109
  return this.as("days");
390
- }, o.weeks = function() {
110
+ }, s.weeks = function() {
391
111
  return this.get("weeks");
392
- }, o.asWeeks = function() {
112
+ }, s.asWeeks = function() {
393
113
  return this.as("weeks");
394
- }, o.months = function() {
114
+ }, s.months = function() {
395
115
  return this.get("months");
396
- }, o.asMonths = function() {
116
+ }, s.asMonths = function() {
397
117
  return this.as("months");
398
- }, o.years = function() {
118
+ }, s.years = function() {
399
119
  return this.get("years");
400
- }, o.asYears = function() {
120
+ }, s.asYears = function() {
401
121
  return this.as("years");
402
- }, h;
403
- }(), L = function(h, o, r) {
404
- return h.add(o.years() * r, "y").add(o.months() * r, "M").add(o.days() * r, "d").add(o.hours() * r, "h").add(o.minutes() * r, "m").add(o.seconds() * r, "s").add(o.milliseconds() * r, "ms");
122
+ }, i;
123
+ }(), g = function(i, s, t) {
124
+ return i.add(s.years() * t, "y").add(s.months() * t, "M").add(s.days() * t, "d").add(s.hours() * t, "h").add(s.minutes() * t, "m").add(s.seconds() * t, "s").add(s.milliseconds() * t, "ms");
405
125
  };
406
- return function(h, o, r) {
407
- p = r, c = r().$utils(), r.duration = function(a, T) {
408
- var F = r.locale();
409
- return m(a, { $l: F }, T);
410
- }, r.isDuration = O;
411
- var _ = o.prototype.add, l = o.prototype.subtract;
412
- o.prototype.add = function(a, T) {
413
- return O(a) ? L(this, a, 1) : _.bind(this)(a, T);
414
- }, o.prototype.subtract = function(a, T) {
415
- return O(a) ? L(this, a, -1) : l.bind(this)(a, T);
126
+ return function(i, s, t) {
127
+ u = t, e = t().$utils(), t.duration = function($, y) {
128
+ var D = t.locale();
129
+ return o($, { $l: D }, y);
130
+ }, t.isDuration = w;
131
+ var d = s.prototype.add, p = s.prototype.subtract;
132
+ s.prototype.add = function($, y) {
133
+ return w($) ? g(this, $, 1) : d.bind(this)($, y);
134
+ }, s.prototype.subtract = function($, y) {
135
+ return w($) ? g(this, $, -1) : p.bind(this)($, y);
416
136
  };
417
137
  };
418
138
  });
419
- }(et)), et.exports;
139
+ }(F)), F.exports;
420
140
  }
421
- var _t = yt();
422
- const vt = /* @__PURE__ */ st(_t);
423
- var rt = { exports: {} }, Dt = rt.exports, ut;
424
- function gt() {
425
- return ut || (ut = 1, function(u, $) {
426
- (function(p, c) {
427
- u.exports = c();
428
- })(Dt, function() {
429
- return function(p, c, v) {
430
- p = p || {};
431
- var y = c.prototype, S = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
432
- function D(M, Y, w, N) {
433
- return y.fromToBase(M, Y, w, N);
141
+ var X = Q();
142
+ const tt = /* @__PURE__ */ U(X);
143
+ var P = { exports: {} }, st = P.exports, B;
144
+ function rt() {
145
+ return B || (B = 1, function(r, n) {
146
+ (function(u, e) {
147
+ r.exports = e();
148
+ })(st, function() {
149
+ return function(u, e, c) {
150
+ u = u || {};
151
+ var a = e.prototype, _ = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
152
+ function f(m, h, v, Y) {
153
+ return a.fromToBase(m, h, v, Y);
434
154
  }
435
- v.en.relativeTime = S, y.fromToBase = function(M, Y, w, N, O) {
436
- for (var m, H, I, b = w.$locale().relativeTime || S, A = p.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], C = A.length, R = 0; R < C; R += 1) {
437
- var L = A[R];
438
- L.d && (m = N ? v(M).diff(w, L.d, !0) : w.diff(M, L.d, !0));
439
- var h = (p.rounding || Math.round)(Math.abs(m));
440
- if (I = m > 0, h <= L.r || !L.r) {
441
- h <= 1 && R > 0 && (L = A[R - 1]);
442
- var o = b[L.l];
443
- O && (h = O("" + h)), H = typeof o == "string" ? o.replace("%d", h) : o(h, Y, L.l, I);
155
+ c.en.relativeTime = _, a.fromToBase = function(m, h, v, Y, w) {
156
+ for (var o, M, b, l = v.$locale().relativeTime || _, x = u.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], L = x.length, N = 0; N < L; N += 1) {
157
+ var g = x[N];
158
+ g.d && (o = Y ? c(m).diff(v, g.d, !0) : v.diff(m, g.d, !0));
159
+ var i = (u.rounding || Math.round)(Math.abs(o));
160
+ if (b = o > 0, i <= g.r || !g.r) {
161
+ i <= 1 && N > 0 && (g = x[N - 1]);
162
+ var s = l[g.l];
163
+ w && (i = w("" + i)), M = typeof s == "string" ? s.replace("%d", i) : s(i, h, g.l, b);
444
164
  break;
445
165
  }
446
166
  }
447
- if (Y) return H;
448
- var r = I ? b.future : b.past;
449
- return typeof r == "function" ? r(H) : r.replace("%s", H);
450
- }, y.to = function(M, Y) {
451
- return D(M, Y, this, !0);
452
- }, y.from = function(M, Y) {
453
- return D(M, Y, this);
167
+ if (h) return M;
168
+ var t = b ? l.future : l.past;
169
+ return typeof t == "function" ? t(M) : t.replace("%s", M);
170
+ }, a.to = function(m, h) {
171
+ return f(m, h, this, !0);
172
+ }, a.from = function(m, h) {
173
+ return f(m, h, this);
454
174
  };
455
- var j = function(M) {
456
- return M.$u ? v.utc() : v();
175
+ var T = function(m) {
176
+ return m.$u ? c.utc() : c();
457
177
  };
458
- y.toNow = function(M) {
459
- return this.to(j(this), M);
460
- }, y.fromNow = function(M) {
461
- return this.from(j(this), M);
178
+ a.toNow = function(m) {
179
+ return this.to(T(this), m);
180
+ }, a.fromNow = function(m) {
181
+ return this.from(T(this), m);
462
182
  };
463
183
  };
464
184
  });
465
- }(rt)), rt.exports;
185
+ }(P)), P.exports;
466
186
  }
467
- var Yt = gt();
468
- const St = /* @__PURE__ */ st(Yt);
469
- var nt = { exports: {} }, wt = nt.exports, at;
470
- function bt() {
471
- return at || (at = 1, function(u, $) {
472
- (function(p, c) {
473
- u.exports = c(ct());
474
- })(wt, function(p) {
475
- function c(m) {
476
- return m && typeof m == "object" && "default" in m ? m : { default: m };
187
+ var et = rt();
188
+ const nt = /* @__PURE__ */ U(et);
189
+ var R = { exports: {} }, it = R.exports, I;
190
+ function ot() {
191
+ return I || (I = 1, function(r, n) {
192
+ (function(u, e) {
193
+ r.exports = e(S);
194
+ })(it, function(u) {
195
+ function e(o) {
196
+ return o && typeof o == "object" && "default" in o ? o : { default: o };
477
197
  }
478
- var v = c(p), y = "января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"), S = "январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"), D = "янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"), j = "янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_"), M = /D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;
479
- function Y(m, H, I) {
480
- var b, A;
481
- return I === "m" ? H ? "минута" : "минуту" : m + " " + (b = +m, A = { mm: H ? "минута_минуты_минут" : "минуту_минуты_минут", hh: "час_часа_часов", dd: "день_дня_дней", MM: "месяц_месяца_месяцев", yy: "год_года_лет" }[I].split("_"), b % 10 == 1 && b % 100 != 11 ? A[0] : b % 10 >= 2 && b % 10 <= 4 && (b % 100 < 10 || b % 100 >= 20) ? A[1] : A[2]);
198
+ var c = e(u), a = "января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"), _ = "январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"), f = "янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"), T = "янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_"), m = /D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;
199
+ function h(o, M, b) {
200
+ var l, x;
201
+ return b === "m" ? M ? "минута" : "минуту" : o + " " + (l = +o, x = { mm: M ? "минута_минуты_минут" : "минуту_минуты_минут", hh: "час_часа_часов", dd: "день_дня_дней", MM: "месяц_месяца_месяцев", yy: "год_года_лет" }[b].split("_"), l % 10 == 1 && l % 100 != 11 ? x[0] : l % 10 >= 2 && l % 10 <= 4 && (l % 100 < 10 || l % 100 >= 20) ? x[1] : x[2]);
482
202
  }
483
- var w = function(m, H) {
484
- return M.test(H) ? y[m.month()] : S[m.month()];
203
+ var v = function(o, M) {
204
+ return m.test(M) ? a[o.month()] : _[o.month()];
485
205
  };
486
- w.s = S, w.f = y;
487
- var N = function(m, H) {
488
- return M.test(H) ? D[m.month()] : j[m.month()];
206
+ v.s = _, v.f = a;
207
+ var Y = function(o, M) {
208
+ return m.test(M) ? f[o.month()] : T[o.month()];
489
209
  };
490
- N.s = j, N.f = D;
491
- var O = { name: "ru", weekdays: "воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"), weekdaysShort: "вск_пнд_втр_срд_чтв_птн_сбт".split("_"), weekdaysMin: "вс_пн_вт_ср_чт_пт_сб".split("_"), months: w, monthsShort: N, weekStart: 1, yearStart: 4, formats: { LT: "H:mm", LTS: "H:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY г.", LLL: "D MMMM YYYY г., H:mm", LLLL: "dddd, D MMMM YYYY г., H:mm" }, relativeTime: { future: "через %s", past: "%s назад", s: "несколько секунд", m: Y, mm: Y, h: "час", hh: Y, d: "день", dd: Y, M: "месяц", MM: Y, y: "год", yy: Y }, ordinal: function(m) {
492
- return m;
493
- }, meridiem: function(m) {
494
- return m < 4 ? "ночи" : m < 12 ? "утра" : m < 17 ? "дня" : "вечера";
210
+ Y.s = T, Y.f = f;
211
+ var w = { name: "ru", weekdays: "воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"), weekdaysShort: "вск_пнд_втр_срд_чтв_птн_сбт".split("_"), weekdaysMin: "вс_пн_вт_ср_чт_пт_сб".split("_"), months: v, monthsShort: Y, weekStart: 1, yearStart: 4, formats: { LT: "H:mm", LTS: "H:mm:ss", L: "DD.MM.YYYY", LL: "D MMMM YYYY г.", LLL: "D MMMM YYYY г., H:mm", LLLL: "dddd, D MMMM YYYY г., H:mm" }, relativeTime: { future: "через %s", past: "%s назад", s: "несколько секунд", m: h, mm: h, h: "час", hh: h, d: "день", dd: h, M: "месяц", MM: h, y: "год", yy: h }, ordinal: function(o) {
212
+ return o;
213
+ }, meridiem: function(o) {
214
+ return o < 4 ? "ночи" : o < 12 ? "утра" : o < 17 ? "дня" : "вечера";
495
215
  } };
496
- return v.default.locale(O, null, !0), O;
216
+ return c.default.locale(w, null, !0), w;
497
217
  });
498
- }(nt)), nt.exports;
218
+ }(R)), R.exports;
499
219
  }
500
- bt();
501
- U.extend(St);
502
- U.extend(vt);
503
- U.locale("ru");
504
- const dt = (u, $) => lt(u) ? $ ? U.duration(u) : U(u) : U.isDayjs(u) ? u : U(u), Lt = (u, $) => {
505
- const p = $?.format, c = $?.pattern, v = $?.asTime;
506
- if (u = dt(u, v), mt(u) || !u.isValid())
507
- return ht;
508
- if (c)
509
- return u.format(c);
510
- switch (p) {
220
+ ot();
221
+ S.extend(nt);
222
+ S.extend(tt);
223
+ S.locale("ru");
224
+ const V = (r, n) => Z(r) ? n ? S.duration(r) : S(r) : S.isDayjs(r) ? r : S(r), ft = (r, n) => {
225
+ const u = n?.format, e = n?.pattern, c = n?.asTime;
226
+ if (r = V(r, c), J(r) || !r.isValid())
227
+ return G;
228
+ if (e)
229
+ return r.format(e);
230
+ switch (u) {
511
231
  case "human":
512
- return u.fromNow();
232
+ return r.fromNow();
513
233
  case "spent-time":
514
- return u.fromNow(!0);
234
+ return r.fromNow(!0);
515
235
  case "full":
516
- return u.format("DD MMM YYYY HH:mm:ss");
236
+ return r.format("DD MMM YYYY HH:mm:ss");
517
237
  case "short":
518
- return u.format("DD MMM HH:mm");
238
+ return r.format("DD MMM HH:mm");
519
239
  case "time":
520
- return u.format("HH:mm:ss");
240
+ return r.format("HH:mm:ss");
521
241
  case "time-short":
522
- return u.format("HH:mm");
242
+ return r.format("HH:mm");
523
243
  case "day":
524
- return u.format("DD MMM YYYY");
244
+ return r.format("DD MMM YYYY");
525
245
  case "month":
526
- return u.format("MMMM YYYY");
246
+ return r.format("MMMM YYYY");
527
247
  default:
528
- return u.format("DD.MM.YYYY");
248
+ return r.format("DD.MM.YYYY");
529
249
  }
530
- }, ft = (u) => {
531
- let $ = Math.max(u, 0);
532
- const p = Math.floor($ / E.day);
533
- $ = $ % E.day;
534
- const c = Math.floor($ / E.hour);
535
- $ = $ % E.hour;
536
- const v = Math.floor($ / E.min);
537
- $ = $ % E.min;
538
- const y = Math.floor($ / E.sec);
539
- $ = $ % E.sec;
540
- const S = Math.floor($);
250
+ }, W = (r) => {
251
+ let n = Math.max(r, 0);
252
+ const u = Math.floor(n / k.day);
253
+ n = n % k.day;
254
+ const e = Math.floor(n / k.hour);
255
+ n = n % k.hour;
256
+ const c = Math.floor(n / k.min);
257
+ n = n % k.min;
258
+ const a = Math.floor(n / k.sec);
259
+ n = n % k.sec;
260
+ const _ = Math.floor(n);
541
261
  return {
542
- days: p,
543
- hours: c,
544
- minutes: v,
545
- seconds: y,
546
- milliseconds: S
262
+ days: u,
263
+ hours: e,
264
+ minutes: c,
265
+ seconds: a,
266
+ milliseconds: _
547
267
  };
548
- }, jt = (u, ...$) => {
549
- let p = dt(u);
550
- for (let c = 0; c < $.length; c += 2) {
551
- const v = $[c], y = $[c + 1];
552
- y != null && (p = p.add(v, y));
268
+ }, ht = (r, ...n) => {
269
+ let u = V(r);
270
+ for (let e = 0; e < n.length; e += 2) {
271
+ const c = n[e], a = n[e + 1];
272
+ a != null && (u = u.add(c, a));
553
273
  }
554
- return p.toDate();
555
- }, Nt = (u) => {
556
- const { days: $, hours: p, milliseconds: c, minutes: v, seconds: y } = ft(u);
274
+ return u.toDate();
275
+ }, lt = (r) => {
276
+ const { days: n, hours: u, milliseconds: e, minutes: c, seconds: a } = W(r);
557
277
  return {
558
- hours: p + E.day * $,
559
- milliseconds: c,
560
- minutes: v,
561
- seconds: y
278
+ hours: u + k.day * n,
279
+ milliseconds: e,
280
+ minutes: c,
281
+ seconds: a
562
282
  };
563
- }, V = {
283
+ }, j = {
564
284
  days: { compact: "д", full: ["день", "дня", "дней"] },
565
285
  hours: { compact: "ч", full: ["час", "часа", "часов"] },
566
286
  minutes: { compact: "мин", full: ["минута", "минуты", "минут"] },
567
287
  seconds: { compact: "сек", full: ["секунда", "секунды", "секунд"] }
568
288
  };
569
- function Ft(...u) {
570
- let $ = !1, p = 0;
571
- if (u[0] instanceof Date) {
572
- const j = U(u[0]);
573
- p = U(u[1]).diff(j, "ms"), $ = u[2] === !0;
289
+ function $t(...r) {
290
+ let n = !1, u = 0;
291
+ if (r[0] instanceof Date) {
292
+ const T = S(r[0]);
293
+ u = S(r[1]).diff(T, "ms"), n = r[2] === !0;
574
294
  } else
575
- p = u[0], $ = u[1] === !0;
576
- const { days: c, hours: v, minutes: y, seconds: S } = ft(p), D = [];
577
- return c && ($ ? D.push(`${c} ${V.days.compact}`) : D.push(
578
- `${c} ${X(c, V.days.full)}`
579
- )), v && ($ ? D.push(`${v} ${V.hours.compact}`) : D.push(
580
- `${v} ${X(v, V.hours.full)}`
581
- )), y && ($ ? D.push(`${y} ${V.minutes.compact}`) : D.push(
582
- `${y} ${X(y, V.minutes.full)}`
583
- )), S && ($ ? D.push(`${S} ${V.seconds.compact}`) : D.push(
584
- `${S} ${X(S, V.seconds.full)}`
585
- )), D.join(" ");
295
+ u = r[0], n = r[1] === !0;
296
+ const { days: e, hours: c, minutes: a, seconds: _ } = W(u), f = [];
297
+ return e && (n ? f.push(`${e} ${j.days.compact}`) : f.push(
298
+ `${e} ${O(e, j.days.full)}`
299
+ )), c && (n ? f.push(`${c} ${j.hours.compact}`) : f.push(
300
+ `${c} ${O(c, j.hours.full)}`
301
+ )), a && (n ? f.push(`${a} ${j.minutes.compact}`) : f.push(
302
+ `${a} ${O(a, j.minutes.full)}`
303
+ )), _ && (n ? f.push(`${_} ${j.seconds.compact}`) : f.push(
304
+ `${_} ${O(_, j.seconds.full)}`
305
+ )), f.join(" ");
586
306
  }
587
307
  export {
588
- jt as changeDate,
589
- ft as dayTimeDuration,
590
- Lt as formatDate,
591
- Ft as getFormatDuration,
592
- Nt as timeDuration
308
+ ht as changeDate,
309
+ W as dayTimeDuration,
310
+ ft as formatDate,
311
+ $t as getFormatDuration,
312
+ lt as timeDuration
593
313
  };
594
314
  //# sourceMappingURL=date-time.js.map