time-runner 1.1.3 → 1.1.5

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,401 +1,472 @@
1
- import { jsx as o, Fragment as rt, jsxs as A } from "react/jsx-runtime";
2
- import { memo as ft, useState as ct, useRef as lt, useMemo as ht, useEffect as K } from "react";
3
- import './index.css';function mt($) {
4
- return $ && $.__esModule && Object.prototype.hasOwnProperty.call($, "default") ? $.default : $;
1
+ import { jsx as l, Fragment as rt, jsxs as L } from "react/jsx-runtime";
2
+ import { memo as mt, useState as ht, useRef as st, useMemo as ot, useEffect as tt } from "react";
3
+ import './index.css';function $t(d) {
4
+ return d && d.__esModule && Object.prototype.hasOwnProperty.call(d, "default") ? d.default : d;
5
5
  }
6
- var G = { exports: {} }, $t = G.exports, it;
7
- function pt() {
8
- return it || (it = 1, (function($, l) {
9
- (function(d, h) {
10
- $.exports = h();
11
- })($t, (function() {
12
- var d = 1e3, h = 6e4, Y = 36e5, g = "millisecond", _ = "second", S = "minute", O = "hour", b = "day", p = "week", f = "month", Z = "quarter", H = "year", M = "date", k = "Invalid Date", E = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, 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, tt = { 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) {
13
- var r = ["th", "st", "nd", "rd"], t = s % 100;
14
- return "[" + s + (r[(t - 20) % 10] || r[t] || r[0]) + "]";
15
- } }, w = function(s, r, t) {
16
- var n = String(s);
17
- return !n || n.length >= r ? s : "" + Array(r + 1 - n.length).join(t) + s;
18
- }, q = { s: w, z: function(s) {
19
- var r = -s.utcOffset(), t = Math.abs(r), n = Math.floor(t / 60), e = t % 60;
20
- return (r <= 0 ? "+" : "-") + w(n, 2, "0") + ":" + w(e, 2, "0");
21
- }, m: function s(r, t) {
22
- if (r.date() < t.date()) return -s(t, r);
23
- var n = 12 * (t.year() - r.year()) + (t.month() - r.month()), e = r.clone().add(n, f), i = t - e < 0, a = r.clone().add(n + (i ? -1 : 1), f);
24
- return +(-(n + (t - e) / (i ? e - a : a - e)) || 0);
6
+ var K = { exports: {} }, pt = K.exports, ct;
7
+ function Mt() {
8
+ return ct || (ct = 1, (function(d, c) {
9
+ (function(u, o) {
10
+ d.exports = o();
11
+ })(pt, (function() {
12
+ var u = 1e3, o = 6e4, v = 36e5, $ = "millisecond", D = "second", S = "minute", x = "hour", w = "day", g = "week", f = "month", p = "quarter", m = "year", M = "date", b = "Invalid Date", V = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, U = /\[([^\]]+)]|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, et = { 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) {
13
+ var n = ["th", "st", "nd", "rd"], t = s % 100;
14
+ return "[" + s + (n[(t - 20) % 10] || n[t] || n[0]) + "]";
15
+ } }, H = function(s, n, t) {
16
+ var r = String(s);
17
+ return !r || r.length >= n ? s : "" + Array(n + 1 - r.length).join(t) + s;
18
+ }, Z = { s: H, z: function(s) {
19
+ var n = -s.utcOffset(), t = Math.abs(n), r = Math.floor(t / 60), e = t % 60;
20
+ return (n <= 0 ? "+" : "-") + H(r, 2, "0") + ":" + H(e, 2, "0");
21
+ }, m: function s(n, t) {
22
+ if (n.date() < t.date()) return -s(t, n);
23
+ var r = 12 * (t.year() - n.year()) + (t.month() - n.month()), e = n.clone().add(r, f), i = t - e < 0, a = n.clone().add(r + (i ? -1 : 1), f);
24
+ return +(-(r + (t - e) / (i ? e - a : a - e)) || 0);
25
25
  }, a: function(s) {
26
26
  return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
27
27
  }, p: function(s) {
28
- return { M: f, y: H, w: p, d: b, D: M, h: O, m: S, s: _, ms: g, Q: Z }[s] || String(s || "").toLowerCase().replace(/s$/, "");
28
+ return { M: f, y: m, w: g, d: w, D: M, h: x, m: S, s: D, ms: $, Q: p }[s] || String(s || "").toLowerCase().replace(/s$/, "");
29
29
  }, u: function(s) {
30
30
  return s === void 0;
31
- } }, C = "en", j = {};
32
- j[C] = tt;
33
- var P = "$isDayjsObject", et = function(s) {
34
- return s instanceof B || !(!s || !s[P]);
35
- }, X = function s(r, t, n) {
31
+ } }, N = "en", j = {};
32
+ j[N] = et;
33
+ var E = "$isDayjsObject", nt = function(s) {
34
+ return s instanceof B || !(!s || !s[E]);
35
+ }, J = function s(n, t, r) {
36
36
  var e;
37
- if (!r) return C;
38
- if (typeof r == "string") {
39
- var i = r.toLowerCase();
37
+ if (!n) return N;
38
+ if (typeof n == "string") {
39
+ var i = n.toLowerCase();
40
40
  j[i] && (e = i), t && (j[i] = t, e = i);
41
- var a = r.split("-");
41
+ var a = n.split("-");
42
42
  if (!e && a.length > 1) return s(a[0]);
43
43
  } else {
44
- var c = r.name;
45
- j[c] = r, e = c;
44
+ var y = n.name;
45
+ j[y] = n, e = y;
46
46
  }
47
- return !n && e && (C = e), e || !n && C;
48
- }, D = function(s, r) {
49
- if (et(s)) return s.clone();
50
- var t = typeof r == "object" ? r : {};
47
+ return !r && e && (N = e), e || !r && N;
48
+ }, T = function(s, n) {
49
+ if (nt(s)) return s.clone();
50
+ var t = typeof n == "object" ? n : {};
51
51
  return t.date = s, t.args = arguments, new B(t);
52
- }, u = q;
53
- u.l = X, u.i = et, u.w = function(s, r) {
54
- return D(s, { locale: r.$L, utc: r.$u, x: r.$x, $offset: r.$offset });
52
+ }, h = Z;
53
+ h.l = J, h.i = nt, h.w = function(s, n) {
54
+ return T(s, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset });
55
55
  };
56
56
  var B = (function() {
57
57
  function s(t) {
58
- this.$L = X(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[P] = !0;
58
+ this.$L = J(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[E] = !0;
59
59
  }
60
- var r = s.prototype;
61
- return r.parse = function(t) {
62
- this.$d = (function(n) {
63
- var e = n.date, i = n.utc;
60
+ var n = s.prototype;
61
+ return n.parse = function(t) {
62
+ this.$d = (function(r) {
63
+ var e = r.date, i = r.utc;
64
64
  if (e === null) return /* @__PURE__ */ new Date(NaN);
65
- if (u.u(e)) return /* @__PURE__ */ new Date();
65
+ if (h.u(e)) return /* @__PURE__ */ new Date();
66
66
  if (e instanceof Date) return new Date(e);
67
67
  if (typeof e == "string" && !/Z$/i.test(e)) {
68
- var a = e.match(E);
68
+ var a = e.match(V);
69
69
  if (a) {
70
- var c = a[2] - 1 || 0, m = (a[7] || "0").substring(0, 3);
71
- return i ? new Date(Date.UTC(a[1], c, a[3] || 1, a[4] || 0, a[5] || 0, a[6] || 0, m)) : new Date(a[1], c, a[3] || 1, a[4] || 0, a[5] || 0, a[6] || 0, m);
70
+ var y = a[2] - 1 || 0, Y = (a[7] || "0").substring(0, 3);
71
+ return i ? new Date(Date.UTC(a[1], y, a[3] || 1, a[4] || 0, a[5] || 0, a[6] || 0, Y)) : new Date(a[1], y, a[3] || 1, a[4] || 0, a[5] || 0, a[6] || 0, Y);
72
72
  }
73
73
  }
74
74
  return new Date(e);
75
75
  })(t), this.init();
76
- }, r.init = function() {
76
+ }, n.init = function() {
77
77
  var t = this.$d;
78
78
  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();
79
- }, r.$utils = function() {
80
- return u;
81
- }, r.isValid = function() {
82
- return this.$d.toString() !== k;
83
- }, r.isSame = function(t, n) {
84
- var e = D(t);
85
- return this.startOf(n) <= e && e <= this.endOf(n);
86
- }, r.isAfter = function(t, n) {
87
- return D(t) < this.startOf(n);
88
- }, r.isBefore = function(t, n) {
89
- return this.endOf(n) < D(t);
90
- }, r.$g = function(t, n, e) {
91
- return u.u(t) ? this[n] : this.set(e, t);
92
- }, r.unix = function() {
79
+ }, n.$utils = function() {
80
+ return h;
81
+ }, n.isValid = function() {
82
+ return this.$d.toString() !== b;
83
+ }, n.isSame = function(t, r) {
84
+ var e = T(t);
85
+ return this.startOf(r) <= e && e <= this.endOf(r);
86
+ }, n.isAfter = function(t, r) {
87
+ return T(t) < this.startOf(r);
88
+ }, n.isBefore = function(t, r) {
89
+ return this.endOf(r) < T(t);
90
+ }, n.$g = function(t, r, e) {
91
+ return h.u(t) ? this[r] : this.set(e, t);
92
+ }, n.unix = function() {
93
93
  return Math.floor(this.valueOf() / 1e3);
94
- }, r.valueOf = function() {
94
+ }, n.valueOf = function() {
95
95
  return this.$d.getTime();
96
- }, r.startOf = function(t, n) {
97
- var e = this, i = !!u.u(n) || n, a = u.p(t), c = function(I, x) {
98
- var N = u.w(e.$u ? Date.UTC(e.$y, x, I) : new Date(e.$y, x, I), e);
99
- return i ? N : N.endOf(b);
100
- }, m = function(I, x) {
101
- return u.w(e.toDate()[I].apply(e.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(x)), e);
102
- }, v = this.$W, y = this.$M, T = this.$D, F = "set" + (this.$u ? "UTC" : "");
96
+ }, n.startOf = function(t, r) {
97
+ var e = this, i = !!h.u(r) || r, a = h.p(t), y = function(W, k) {
98
+ var I = h.w(e.$u ? Date.UTC(e.$y, k, W) : new Date(e.$y, k, W), e);
99
+ return i ? I : I.endOf(w);
100
+ }, Y = function(W, k) {
101
+ return h.w(e.toDate()[W].apply(e.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(k)), e);
102
+ }, _ = this.$W, O = this.$M, C = this.$D, F = "set" + (this.$u ? "UTC" : "");
103
103
  switch (a) {
104
- case H:
105
- return i ? c(1, 0) : c(31, 11);
104
+ case m:
105
+ return i ? y(1, 0) : y(31, 11);
106
106
  case f:
107
- return i ? c(1, y) : c(0, y + 1);
108
- case p:
109
- var L = this.$locale().weekStart || 0, R = (v < L ? v + 7 : v) - L;
110
- return c(i ? T - R : T + (6 - R), y);
111
- case b:
107
+ return i ? y(1, O) : y(0, O + 1);
108
+ case g:
109
+ var R = this.$locale().weekStart || 0, X = (_ < R ? _ + 7 : _) - R;
110
+ return y(i ? C - X : C + (6 - X), O);
111
+ case w:
112
112
  case M:
113
- return m(F + "Hours", 0);
114
- case O:
115
- return m(F + "Minutes", 1);
113
+ return Y(F + "Hours", 0);
114
+ case x:
115
+ return Y(F + "Minutes", 1);
116
116
  case S:
117
- return m(F + "Seconds", 2);
118
- case _:
119
- return m(F + "Milliseconds", 3);
117
+ return Y(F + "Seconds", 2);
118
+ case D:
119
+ return Y(F + "Milliseconds", 3);
120
120
  default:
121
121
  return this.clone();
122
122
  }
123
- }, r.endOf = function(t) {
123
+ }, n.endOf = function(t) {
124
124
  return this.startOf(t, !1);
125
- }, r.$set = function(t, n) {
126
- var e, i = u.p(t), a = "set" + (this.$u ? "UTC" : ""), c = (e = {}, e[b] = a + "Date", e[M] = a + "Date", e[f] = a + "Month", e[H] = a + "FullYear", e[O] = a + "Hours", e[S] = a + "Minutes", e[_] = a + "Seconds", e[g] = a + "Milliseconds", e)[i], m = i === b ? this.$D + (n - this.$W) : n;
127
- if (i === f || i === H) {
128
- var v = this.clone().set(M, 1);
129
- v.$d[c](m), v.init(), this.$d = v.set(M, Math.min(this.$D, v.daysInMonth())).$d;
130
- } else c && this.$d[c](m);
125
+ }, n.$set = function(t, r) {
126
+ var e, i = h.p(t), a = "set" + (this.$u ? "UTC" : ""), y = (e = {}, e[w] = a + "Date", e[M] = a + "Date", e[f] = a + "Month", e[m] = a + "FullYear", e[x] = a + "Hours", e[S] = a + "Minutes", e[D] = a + "Seconds", e[$] = a + "Milliseconds", e)[i], Y = i === w ? this.$D + (r - this.$W) : r;
127
+ if (i === f || i === m) {
128
+ var _ = this.clone().set(M, 1);
129
+ _.$d[y](Y), _.init(), this.$d = _.set(M, Math.min(this.$D, _.daysInMonth())).$d;
130
+ } else y && this.$d[y](Y);
131
131
  return this.init(), this;
132
- }, r.set = function(t, n) {
133
- return this.clone().$set(t, n);
134
- }, r.get = function(t) {
135
- return this[u.p(t)]();
136
- }, r.add = function(t, n) {
132
+ }, n.set = function(t, r) {
133
+ return this.clone().$set(t, r);
134
+ }, n.get = function(t) {
135
+ return this[h.p(t)]();
136
+ }, n.add = function(t, r) {
137
137
  var e, i = this;
138
138
  t = Number(t);
139
- var a = u.p(n), c = function(y) {
140
- var T = D(i);
141
- return u.w(T.date(T.date() + Math.round(y * t)), i);
139
+ var a = h.p(r), y = function(O) {
140
+ var C = T(i);
141
+ return h.w(C.date(C.date() + Math.round(O * t)), i);
142
142
  };
143
143
  if (a === f) return this.set(f, this.$M + t);
144
- if (a === H) return this.set(H, this.$y + t);
145
- if (a === b) return c(1);
146
- if (a === p) return c(7);
147
- var m = (e = {}, e[S] = h, e[O] = Y, e[_] = d, e)[a] || 1, v = this.$d.getTime() + t * m;
148
- return u.w(v, this);
149
- }, r.subtract = function(t, n) {
150
- return this.add(-1 * t, n);
151
- }, r.format = function(t) {
152
- var n = this, e = this.$locale();
153
- if (!this.isValid()) return e.invalidDate || k;
154
- var i = t || "YYYY-MM-DDTHH:mm:ssZ", a = u.z(this), c = this.$H, m = this.$m, v = this.$M, y = e.weekdays, T = e.months, F = e.meridiem, L = function(x, N, z, Q) {
155
- return x && (x[N] || x(n, i)) || z[N].slice(0, Q);
156
- }, R = function(x) {
157
- return u.s(c % 12 || 12, x, "0");
158
- }, I = F || function(x, N, z) {
159
- var Q = x < 12 ? "AM" : "PM";
160
- return z ? Q.toLowerCase() : Q;
144
+ if (a === m) return this.set(m, this.$y + t);
145
+ if (a === w) return y(1);
146
+ if (a === g) return y(7);
147
+ var Y = (e = {}, e[S] = o, e[x] = v, e[D] = u, e)[a] || 1, _ = this.$d.getTime() + t * Y;
148
+ return h.w(_, this);
149
+ }, n.subtract = function(t, r) {
150
+ return this.add(-1 * t, r);
151
+ }, n.format = function(t) {
152
+ var r = this, e = this.$locale();
153
+ if (!this.isValid()) return e.invalidDate || b;
154
+ var i = t || "YYYY-MM-DDTHH:mm:ssZ", a = h.z(this), y = this.$H, Y = this.$m, _ = this.$M, O = e.weekdays, C = e.months, F = e.meridiem, R = function(k, I, A, Q) {
155
+ return k && (k[I] || k(r, i)) || A[I].slice(0, Q);
156
+ }, X = function(k) {
157
+ return h.s(y % 12 || 12, k, "0");
158
+ }, W = F || function(k, I, A) {
159
+ var Q = k < 12 ? "AM" : "PM";
160
+ return A ? Q.toLowerCase() : Q;
161
161
  };
162
- return i.replace(J, (function(x, N) {
163
- return N || (function(z) {
164
- switch (z) {
162
+ return i.replace(U, (function(k, I) {
163
+ return I || (function(A) {
164
+ switch (A) {
165
165
  case "YY":
166
- return String(n.$y).slice(-2);
166
+ return String(r.$y).slice(-2);
167
167
  case "YYYY":
168
- return u.s(n.$y, 4, "0");
168
+ return h.s(r.$y, 4, "0");
169
169
  case "M":
170
- return v + 1;
170
+ return _ + 1;
171
171
  case "MM":
172
- return u.s(v + 1, 2, "0");
172
+ return h.s(_ + 1, 2, "0");
173
173
  case "MMM":
174
- return L(e.monthsShort, v, T, 3);
174
+ return R(e.monthsShort, _, C, 3);
175
175
  case "MMMM":
176
- return L(T, v);
176
+ return R(C, _);
177
177
  case "D":
178
- return n.$D;
178
+ return r.$D;
179
179
  case "DD":
180
- return u.s(n.$D, 2, "0");
180
+ return h.s(r.$D, 2, "0");
181
181
  case "d":
182
- return String(n.$W);
182
+ return String(r.$W);
183
183
  case "dd":
184
- return L(e.weekdaysMin, n.$W, y, 2);
184
+ return R(e.weekdaysMin, r.$W, O, 2);
185
185
  case "ddd":
186
- return L(e.weekdaysShort, n.$W, y, 3);
186
+ return R(e.weekdaysShort, r.$W, O, 3);
187
187
  case "dddd":
188
- return y[n.$W];
188
+ return O[r.$W];
189
189
  case "H":
190
- return String(c);
190
+ return String(y);
191
191
  case "HH":
192
- return u.s(c, 2, "0");
192
+ return h.s(y, 2, "0");
193
193
  case "h":
194
- return R(1);
194
+ return X(1);
195
195
  case "hh":
196
- return R(2);
196
+ return X(2);
197
197
  case "a":
198
- return I(c, m, !0);
198
+ return W(y, Y, !0);
199
199
  case "A":
200
- return I(c, m, !1);
200
+ return W(y, Y, !1);
201
201
  case "m":
202
- return String(m);
202
+ return String(Y);
203
203
  case "mm":
204
- return u.s(m, 2, "0");
204
+ return h.s(Y, 2, "0");
205
205
  case "s":
206
- return String(n.$s);
206
+ return String(r.$s);
207
207
  case "ss":
208
- return u.s(n.$s, 2, "0");
208
+ return h.s(r.$s, 2, "0");
209
209
  case "SSS":
210
- return u.s(n.$ms, 3, "0");
210
+ return h.s(r.$ms, 3, "0");
211
211
  case "Z":
212
212
  return a;
213
213
  }
214
214
  return null;
215
- })(x) || a.replace(":", "");
215
+ })(k) || a.replace(":", "");
216
216
  }));
217
- }, r.utcOffset = function() {
217
+ }, n.utcOffset = function() {
218
218
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
219
- }, r.diff = function(t, n, e) {
220
- var i, a = this, c = u.p(n), m = D(t), v = (m.utcOffset() - this.utcOffset()) * h, y = this - m, T = function() {
221
- return u.m(a, m);
219
+ }, n.diff = function(t, r, e) {
220
+ var i, a = this, y = h.p(r), Y = T(t), _ = (Y.utcOffset() - this.utcOffset()) * o, O = this - Y, C = function() {
221
+ return h.m(a, Y);
222
222
  };
223
- switch (c) {
224
- case H:
225
- i = T() / 12;
223
+ switch (y) {
224
+ case m:
225
+ i = C() / 12;
226
226
  break;
227
227
  case f:
228
- i = T();
229
- break;
230
- case Z:
231
- i = T() / 3;
228
+ i = C();
232
229
  break;
233
230
  case p:
234
- i = (y - v) / 6048e5;
231
+ i = C() / 3;
232
+ break;
233
+ case g:
234
+ i = (O - _) / 6048e5;
235
235
  break;
236
- case b:
237
- i = (y - v) / 864e5;
236
+ case w:
237
+ i = (O - _) / 864e5;
238
238
  break;
239
- case O:
240
- i = y / Y;
239
+ case x:
240
+ i = O / v;
241
241
  break;
242
242
  case S:
243
- i = y / h;
243
+ i = O / o;
244
244
  break;
245
- case _:
246
- i = y / d;
245
+ case D:
246
+ i = O / u;
247
247
  break;
248
248
  default:
249
- i = y;
249
+ i = O;
250
250
  }
251
- return e ? i : u.a(i);
252
- }, r.daysInMonth = function() {
251
+ return e ? i : h.a(i);
252
+ }, n.daysInMonth = function() {
253
253
  return this.endOf(f).$D;
254
- }, r.$locale = function() {
254
+ }, n.$locale = function() {
255
255
  return j[this.$L];
256
- }, r.locale = function(t, n) {
256
+ }, n.locale = function(t, r) {
257
257
  if (!t) return this.$L;
258
- var e = this.clone(), i = X(t, n, !0);
258
+ var e = this.clone(), i = J(t, r, !0);
259
259
  return i && (e.$L = i), e;
260
- }, r.clone = function() {
261
- return u.w(this.$d, this);
262
- }, r.toDate = function() {
260
+ }, n.clone = function() {
261
+ return h.w(this.$d, this);
262
+ }, n.toDate = function() {
263
263
  return new Date(this.valueOf());
264
- }, r.toJSON = function() {
264
+ }, n.toJSON = function() {
265
265
  return this.isValid() ? this.toISOString() : null;
266
- }, r.toISOString = function() {
266
+ }, n.toISOString = function() {
267
267
  return this.$d.toISOString();
268
- }, r.toString = function() {
268
+ }, n.toString = function() {
269
269
  return this.$d.toUTCString();
270
270
  }, s;
271
- })(), st = B.prototype;
272
- return D.prototype = st, [["$ms", g], ["$s", _], ["$m", S], ["$H", O], ["$W", b], ["$M", f], ["$y", H], ["$D", M]].forEach((function(s) {
273
- st[s[1]] = function(r) {
274
- return this.$g(r, s[0], s[1]);
271
+ })(), at = B.prototype;
272
+ return T.prototype = at, [["$ms", $], ["$s", D], ["$m", S], ["$H", x], ["$W", w], ["$M", f], ["$y", m], ["$D", M]].forEach((function(s) {
273
+ at[s[1]] = function(n) {
274
+ return this.$g(n, s[0], s[1]);
275
275
  };
276
- })), D.extend = function(s, r) {
277
- return s.$i || (s(r, B, D), s.$i = !0), D;
278
- }, D.locale = X, D.isDayjs = et, D.unix = function(s) {
279
- return D(1e3 * s);
280
- }, D.en = j[C], D.Ls = j, D.p = {}, D;
276
+ })), T.extend = function(s, n) {
277
+ return s.$i || (s(n, B, T), s.$i = !0), T;
278
+ }, T.locale = J, T.isDayjs = nt, T.unix = function(s) {
279
+ return T(1e3 * s);
280
+ }, T.en = j[N], T.Ls = j, T.p = {}, T;
281
281
  }));
282
- })(G)), G.exports;
282
+ })(K)), K.exports;
283
283
  }
284
- var Mt = pt();
285
- const U = /* @__PURE__ */ mt(Mt), V = 60, Dt = [
284
+ var yt = Mt();
285
+ const z = /* @__PURE__ */ $t(yt), q = 60, gt = [
286
286
  "YYYY-MM-DD",
287
287
  "YYYY/MM/DD",
288
288
  "YYYY-MM-DD HH:mm",
289
289
  "YYYY/MM/DD HH:mm",
290
290
  "YYYY-MM-DD HH:mm:ss",
291
291
  "YYYY/MM/DD HH:mm:ss"
292
- ], at = ($) => {
293
- if (!nt($))
292
+ ], ut = (d) => {
293
+ if (!it(d))
294
294
  return "00:00:00";
295
- const l = U($).diff(U());
296
- if (l <= 0)
295
+ const c = z(d).diff(z());
296
+ if (c <= 0)
297
297
  return "00:00:00";
298
- const d = Math.floor(l / 1e3), h = Math.floor(d / 86400), Y = Math.floor(d % 86400 / 3600), g = Math.floor(d % 3600 / 60), _ = d % 60;
299
- return `${h ? `${h}:` : ""}${`${Y}`.padStart(2, "0")}:${`${g}`.padStart(2, "0")}:${`${_}`.padStart(2, "0")}`;
300
- }, ut = ($) => {
301
- const l = (d) => `${d}`.padStart(2, "0");
302
- return `${l(Math.floor($ / V / V))}:${l(Math.floor($ / V) % V)}:${l($ % V)}`;
303
- }, nt = ($) => Dt.some((l) => U($, l, !0).isValid()), ot = "HH:mm:ss", dt = 900, St = ($) => {
304
- const { mode: l, showType: d = "default", size: h = 40, className: Y, bgColor: g, borderColor: _, textShadowColor: S, finishCountFn: O } = $, [b, p] = ct(
305
- d === "count" ? ut(0) : d === "default" ? U().format(ot) : at(d)
306
- ), f = lt({
298
+ const u = Math.floor(c / 1e3), o = Math.floor(u / 86400), v = Math.floor(u % 86400 / 3600), $ = Math.floor(u % 3600 / 60), D = u % 60;
299
+ return `${o ? `${o}:` : ""}${`${v}`.padStart(2, "0")}:${`${$}`.padStart(2, "0")}:${`${D}`.padStart(2, "0")}`;
300
+ }, lt = (d) => {
301
+ const c = (u) => `${u}`.padStart(2, "0");
302
+ return `${c(Math.floor(d / q / q))}:${c(Math.floor(d / q) % q)}:${c(d % q)}`;
303
+ }, it = (d) => gt.some((c) => z(d, c, !0).isValid()), G = (d, c, u, o, v) => {
304
+ const $ = o - c, D = v - u, S = Math.sqrt($ * $ + D * D).toFixed(2), x = Math.atan2(D, $) * 180 / Math.PI, w = (c + o) / 2, g = (u + v) / 2;
305
+ d.style.left = `${w}px`, d.style.top = `${g}px`, d.style.height = `${S}px`, d.style.transform = `translate(-50%, -50%) rotate(${x + 90}deg)`;
306
+ }, vt = (d) => {
307
+ const c = d.clientWidth, u = d.clientHeight, o = Math.floor(Math.random() * 2);
308
+ let v = "", $ = "", D = 0, S = 0;
309
+ const x = d.querySelector(".l-line"), w = d.querySelector(".r-line");
310
+ if (o === 0) {
311
+ const g = 5 + Math.random() * 90, f = 100 - g;
312
+ D = Math.max(g, f), v = `
313
+ polygon(
314
+ 0% 0%,
315
+ ${g}% 0%,
316
+ ${f}% 100%,
317
+ 0% 100%
318
+ )`, $ = `
319
+ polygon(
320
+ ${g}% 0%,
321
+ 100% 0%,
322
+ 100% 100%,
323
+ ${f}% 100%
324
+ )`;
325
+ const p = c * g / 100, m = 0, M = c * f / 100, b = u;
326
+ G(x, p, m, M, b), G(w, p, m, M, b);
327
+ } else {
328
+ const g = 5 + Math.random() * 90, f = 100 - g;
329
+ S = Math.max(g, f), v = `
330
+ polygon(
331
+ 0% 0%,
332
+ 100% 0%,
333
+ 100% ${f}%,
334
+ 0% ${g}%
335
+ )`, $ = `
336
+ polygon(
337
+ 0% ${g}%,
338
+ 100% ${f}%,
339
+ 100% 100%,
340
+ 0% 100%
341
+ )`;
342
+ const p = 0, m = u * g / 100, M = c, b = u * f / 100;
343
+ G(x, p, m, M, b), G(w, p, m, M, b);
344
+ }
345
+ return {
346
+ lPath: v,
347
+ rPath: $,
348
+ lTranslate: o === 0 ? `translateX(-${D}%)` : `translateY(-${S}%)`,
349
+ rTranslate: o === 0 ? `translateX(${D}%)` : `translateY(${S}%)`
350
+ };
351
+ }, dt = "HH:mm:ss", ft = 900, wt = (d) => {
352
+ const { mode: c, showType: u = "default", size: o = 40, className: v, bgColor: $, borderColor: D, textShadowColor: S, finishCountFn: x } = d, [w, g] = ht(
353
+ u === "count" ? lt(0) : u === "default" ? z().format(dt) : ut(u)
354
+ ), f = st({
307
355
  t: null
308
- }), Z = {
309
- "--card-size": `${h}px`,
310
- "--card-w": `${h * 1.25}px`,
311
- "--card-h": `${h * 2}px`,
356
+ }), p = {
357
+ "--card-size": `${o}px`,
358
+ "--card-w": `${o * 1.25}px`,
359
+ "--card-h": `${o * 2}px`,
312
360
  // 下面两个必须是一个确定的数字,不能是表达式
313
- "--transx": `${-h * 1.25 / 2}px`,
314
- "--transy": `${-h}px`,
315
- "--delay": `${dt / 1e3}s`,
316
- "--bgColor": g,
317
- "--borderColor": _,
361
+ "--transx": `${-o * 1.25 / 2}px`,
362
+ "--transy": `${-o}px`,
363
+ "--delay": `${ft / 1e3}s`,
364
+ "--bgColor": $,
365
+ "--borderColor": D,
318
366
  "--textShadow": S ? `1px 2px 3px ${S}` : "none"
319
367
  };
320
- K(() => {
368
+ tt(() => {
321
369
  let M = Date.now();
322
370
  f.current.t && (clearInterval(f.current.t), f.current.t = null, M = Date.now()), f.current.t = setInterval(() => {
323
- let k = () => "";
324
- d === "count" ? k = () => ut(Math.floor((Date.now() - M) / 1e3)) : d === "default" ? k = () => U().format(ot) : k = () => at(d), p(k());
371
+ let b = () => "";
372
+ u === "count" ? b = () => lt(Math.floor((Date.now() - M) / 1e3)) : u === "default" ? b = () => z().format(dt) : b = () => ut(u), g(b());
325
373
  }, 1e3);
326
- }, [d]), K(() => {
327
- nt(d) && b === "00:00:00" && O && setTimeout(() => {
328
- O();
374
+ }, [u]), tt(() => {
375
+ it(u) && w === "00:00:00" && x && setTimeout(() => {
376
+ x();
329
377
  }, 1e3);
330
- }, [b, d, O]);
331
- const H = () => {
332
- if (!b)
378
+ }, [w, u, x]);
379
+ const m = () => {
380
+ if (!w)
333
381
  return null;
334
- const M = b.split(":"), k = M[M.length - 3].split(""), E = M[M.length - 2].split(""), J = M[M.length - 1].split(""), tt = M.length === 4 ? M[0].split("") : [], w = nt(d), q = tt.map((j, P) => /* @__PURE__ */ o(W, { mode: l, time: +j, limit: w ? -9 : 9, size: h }, P)), C = /* @__PURE__ */ o("span", { children: ":" });
335
- return /* @__PURE__ */ A(rt, { children: [
336
- q.length ? /* @__PURE__ */ A(rt, { children: [
337
- q,
338
- w ? /* @__PURE__ */ o("p", { children: "天" }) : C
382
+ const M = w.split(":"), b = M[M.length - 3].split(""), V = M[M.length - 2].split(""), U = M[M.length - 1].split(""), et = M.length === 4 ? M[0].split("") : [], H = it(u), Z = et.map((j, E) => /* @__PURE__ */ l(P, { mode: c, time: +j, limit: H ? -9 : 9, size: o }, E)), N = /* @__PURE__ */ l("span", { children: ":" });
383
+ return /* @__PURE__ */ L(rt, { children: [
384
+ Z.length ? /* @__PURE__ */ L(rt, { children: [
385
+ Z,
386
+ H ? /* @__PURE__ */ l("p", { children: "天" }) : N
339
387
  ] }) : null,
340
- /* @__PURE__ */ o(W, { mode: l, time: +k[0], limit: w ? -2 : 2, size: h }),
341
- /* @__PURE__ */ o(W, { mode: l, time: +k[1], limit: w ? -9 : 9, size: h }),
342
- w ? /* @__PURE__ */ o("p", { children: "小时" }) : C,
343
- /* @__PURE__ */ o(W, { mode: l, time: +E[0], limit: w ? -5 : 5, size: h }),
344
- /* @__PURE__ */ o(W, { mode: l, time: +E[1], limit: w ? -9 : 9, size: h }),
345
- w ? /* @__PURE__ */ o("p", { children: "分" }) : C,
346
- /* @__PURE__ */ o(W, { mode: l, time: +J[0], limit: w ? -5 : 5, size: h }),
347
- /* @__PURE__ */ o(W, { mode: l, time: +J[1], limit: w ? -9 : 9, size: h }),
348
- w && /* @__PURE__ */ o("p", { children: "秒" })
388
+ /* @__PURE__ */ l(P, { mode: c, time: +b[0], limit: H ? -2 : 2, size: o }),
389
+ /* @__PURE__ */ l(P, { mode: c, time: +b[1], limit: H ? -9 : 9, size: o }),
390
+ H ? /* @__PURE__ */ l("p", { children: "小时" }) : N,
391
+ /* @__PURE__ */ l(P, { mode: c, time: +V[0], limit: H ? -5 : 5, size: o }),
392
+ /* @__PURE__ */ l(P, { mode: c, time: +V[1], limit: H ? -9 : 9, size: o }),
393
+ H ? /* @__PURE__ */ l("p", { children: "分" }) : N,
394
+ /* @__PURE__ */ l(P, { mode: c, time: +U[0], limit: H ? -5 : 5, size: o }),
395
+ /* @__PURE__ */ l(P, { mode: c, time: +U[1], limit: H ? -9 : 9, size: o }),
396
+ H && /* @__PURE__ */ l("p", { children: "秒" })
349
397
  ] });
350
398
  };
351
- return /* @__PURE__ */ o("div", { className: `time-runner ${Y || ""}`, style: Z, children: H() });
352
- }, vt = ($) => {
353
- const { time: l, limit: d, mode: h, size: Y } = $, [g, _] = ct(!1), S = lt({
354
- t: l
355
- }), O = ht(() => l !== S.current.t ? {
356
- "--driftX": `${Math.floor(Math.random() * (-Y - Y + 1)) + Y}px`,
357
- "--driftY": `${Math.floor(Math.random() * (-Y * 2 - Y * 2 + 1)) + Y * 2}px`,
399
+ return /* @__PURE__ */ l("div", { className: `time-runner ${v || ""}`, style: p, children: m() });
400
+ }, Dt = (d) => {
401
+ const { time: c, limit: u, mode: o, size: v } = d, [$, D] = ht(!1), S = st({
402
+ t: c
403
+ }), x = st(null), w = ot(() => c !== S.current.t && o === "drift" ? {
404
+ "--driftX": `${Math.floor(Math.random() * (-v - v + 1)) + v}px`,
405
+ "--driftY": `${Math.floor(Math.random() * (-v * 2 - v * 2 + 1)) + v * 2}px`,
358
406
  "--driftRZ": `${Math.floor(Math.random() * 151) + 50}deg`,
359
407
  "--driftRX": `${Math.floor(Math.random() * 151) + 50}deg`
360
- } : null, [l, Y]);
361
- return K(() => {
362
- l !== S.current.t && _(!0);
363
- }, [l]), K(() => {
364
- g && setTimeout(() => {
365
- S.current.t = l, _(!1);
366
- }, dt);
367
- }, [g, l]), /* @__PURE__ */ o(rt, { children: (() => {
408
+ } : null, [c, v, o]), g = ot(() => {
409
+ if ($ && o === "cut") {
410
+ const { lPath: p, rPath: m, lTranslate: M, rTranslate: b } = vt(x.current);
411
+ return {
412
+ "--lPolygon": p,
413
+ "--rPolygon": m,
414
+ "--cutLTranslate": M,
415
+ "--cutRTranslate": b
416
+ };
417
+ }
418
+ return null;
419
+ }, [$, o]);
420
+ return tt(() => {
421
+ c !== S.current.t && D(!0);
422
+ }, [c]), tt(() => {
423
+ $ && setTimeout(() => {
424
+ S.current.t = c, D(!1);
425
+ }, ft);
426
+ }, [$, c]), /* @__PURE__ */ l(rt, { children: (() => {
368
427
  const { t: p } = S.current;
369
- let f = p;
370
- switch (d > 0 ? f = p >= d ? 0 : p + 1 : f = p <= 0 ? Math.abs(d) : p - 1, h) {
428
+ let m = p;
429
+ switch (u > 0 ? m = p >= u ? 0 : p + 1 : m = p <= 0 ? Math.abs(u) : p - 1, o) {
371
430
  case "card":
372
- return /* @__PURE__ */ A("div", { className: "clock-card font-num", children: [
373
- /* @__PURE__ */ A("div", { className: `clock-b ${g ? "run" : ""}`, children: [
374
- /* @__PURE__ */ o("p", { children: f }),
375
- /* @__PURE__ */ o("p", { children: f })
431
+ return /* @__PURE__ */ L("div", { className: "clock-card font-num", children: [
432
+ /* @__PURE__ */ L("div", { className: `clock-b ${$ ? "run" : ""}`, children: [
433
+ /* @__PURE__ */ l("p", { children: m }),
434
+ /* @__PURE__ */ l("p", { children: m })
376
435
  ] }),
377
- /* @__PURE__ */ A("div", { className: `clock-f ${g ? "run" : ""}`, children: [
378
- /* @__PURE__ */ o("p", { children: p }),
379
- /* @__PURE__ */ o("p", { children: p })
436
+ /* @__PURE__ */ L("div", { className: `clock-f ${$ ? "run" : ""}`, children: [
437
+ /* @__PURE__ */ l("p", { children: p }),
438
+ /* @__PURE__ */ l("p", { children: p })
380
439
  ] })
381
440
  ] });
382
441
  case "cube-v":
383
- return /* @__PURE__ */ o("div", { className: `cube-v font-num ${g ? "run" : ""}`, children: /* @__PURE__ */ A("div", { children: [
384
- /* @__PURE__ */ o("p", { children: f }),
385
- /* @__PURE__ */ o("p", { children: p })
442
+ return /* @__PURE__ */ l("div", { className: `cube-v font-num ${$ ? "run" : ""}`, children: /* @__PURE__ */ L("div", { children: [
443
+ /* @__PURE__ */ l("p", { children: m }),
444
+ /* @__PURE__ */ l("p", { children: p })
386
445
  ] }) });
387
446
  case "cube-h":
388
- return /* @__PURE__ */ o("div", { className: `cube-h font-num ${g ? "run" : ""}`, children: /* @__PURE__ */ A("div", { children: [
389
- /* @__PURE__ */ o("p", { children: f }),
390
- /* @__PURE__ */ o("p", { children: p })
447
+ return /* @__PURE__ */ l("div", { className: `cube-h font-num ${$ ? "run" : ""}`, children: /* @__PURE__ */ L("div", { children: [
448
+ /* @__PURE__ */ l("p", { children: m }),
449
+ /* @__PURE__ */ l("p", { children: p })
391
450
  ] }) });
392
451
  case "drift":
393
- return /* @__PURE__ */ o("div", { className: `drift font-num ${g ? "run" : ""}`, "data-digit": p, style: O, children: f });
452
+ return /* @__PURE__ */ l("div", { className: `drift font-num ${$ ? "run" : ""}`, "data-digit": p, style: w, children: m });
453
+ case "cut":
454
+ return /* @__PURE__ */ L("div", { ref: x, className: `cut font-num ${$ ? "run" : ""}`, style: g, children: [
455
+ /* @__PURE__ */ L("div", { children: [
456
+ /* @__PURE__ */ l("p", { children: p }),
457
+ /* @__PURE__ */ l("div", { className: "l-line" })
458
+ ] }),
459
+ /* @__PURE__ */ L("div", { children: [
460
+ /* @__PURE__ */ l("p", { children: p }),
461
+ /* @__PURE__ */ l("div", { className: "r-line" })
462
+ ] }),
463
+ /* @__PURE__ */ l("p", { children: m })
464
+ ] });
394
465
  default:
395
- return /* @__PURE__ */ o("div", { className: "font-num", children: /* @__PURE__ */ o("p", { children: p }) });
466
+ return /* @__PURE__ */ l("div", { className: "font-num", children: /* @__PURE__ */ l("p", { children: p }) });
396
467
  }
397
468
  })() });
398
- }, W = ft(vt);
469
+ }, P = mt(Dt);
399
470
  export {
400
- St as TimeRunner
471
+ wt as TimeRunner
401
472
  };