react-semaphor 0.1.514 → 0.1.515

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.
Files changed (65) hide show
  1. package/dist/brand-studio/index.cjs +1 -1
  2. package/dist/brand-studio/index.js +1 -1
  3. package/dist/briefings/index.cjs +1 -1
  4. package/dist/briefings/index.js +3 -3
  5. package/dist/chunks/{dashboard-briefing-launcher-BzPD50QD.cjs → dashboard-briefing-launcher-B7zqm8P1.cjs} +1 -1
  6. package/dist/chunks/{dashboard-briefing-launcher-e3s3MuSs.js → dashboard-briefing-launcher-BA_bl05p.js} +5 -5
  7. package/dist/chunks/{dashboard-controls-DAOABnks.js → dashboard-controls-QMW17RKx.js} +6 -6
  8. package/dist/chunks/{dashboard-controls-DQBfOqmC.cjs → dashboard-controls-x_v9wLOU.cjs} +1 -1
  9. package/dist/chunks/{dashboard-json-1jZycd5h.cjs → dashboard-json-0ZLLBlHj.cjs} +1 -1
  10. package/dist/chunks/{dashboard-json-S5Eq2GAg.js → dashboard-json-DRnpkNwO.js} +3 -3
  11. package/dist/chunks/{edit-dashboard-visual-Bkm0ciHG.js → edit-dashboard-visual-1ISjhwry.js} +1377 -1380
  12. package/dist/chunks/{edit-dashboard-visual-BwJ2Eljw.cjs → edit-dashboard-visual-CI0EqzKj.cjs} +2 -2
  13. package/dist/chunks/{editor-action-buttons-Bvv16QA-.js → editor-action-buttons-BTCKZERI.js} +3 -3
  14. package/dist/chunks/{editor-action-buttons-B2NCSsDw.cjs → editor-action-buttons-Czq5SnA9.cjs} +1 -1
  15. package/dist/chunks/{index-DhlVxvyI.cjs → index-BMMXKK3G.cjs} +1 -1
  16. package/dist/chunks/{index-DrOFJOCq.cjs → index-C6_xef4P.cjs} +147 -147
  17. package/dist/chunks/{index-CACdoqu3.js → index-C8w91oj4.js} +61 -51
  18. package/dist/chunks/index-Cw2ypaFl.cjs +1 -0
  19. package/dist/chunks/{index-nhUr9xBz.js → index-Dlic9KZs.js} +31494 -31379
  20. package/dist/chunks/{index-CnGVjyF8.js → index-v1OE4-eA.js} +2 -2
  21. package/dist/chunks/matrix-formatter-BdIsE7Qu.js +341 -0
  22. package/dist/chunks/matrix-formatter-Dajj91Ni.cjs +1 -0
  23. package/dist/chunks/{pivot-header-presentation-Dm9dUQsl.js → pivot-header-presentation-BIf4HW3L.js} +35 -36
  24. package/dist/chunks/{pivot-header-presentation-Cxz8-06f.cjs → pivot-header-presentation-B_N11CgN.cjs} +3 -3
  25. package/dist/chunks/{pivot-result-lifecycle-BeOpjAhg.js → pivot-result-lifecycle-CEmyU2At.js} +207 -148
  26. package/dist/chunks/pivot-result-lifecycle-vg_suUNb.cjs +1 -0
  27. package/dist/chunks/{raw-temporal-DrmCX9Wq.js → raw-temporal-Bj6_w9cG.js} +471 -361
  28. package/dist/chunks/raw-temporal-CeblVJbu.cjs +1 -0
  29. package/dist/chunks/{report-preferences-dialog-DcLkVqni.cjs → report-preferences-dialog-Dr1BYwuf.cjs} +1 -1
  30. package/dist/chunks/{report-preferences-dialog-B2fzQH1T.js → report-preferences-dialog-b8J6KjSy.js} +2 -2
  31. package/dist/chunks/semantic-format-DFI1iszk.cjs +1 -0
  32. package/dist/chunks/{semantic-format-BZxJLKvw.js → semantic-format-Dt-nUxFB.js} +23 -29
  33. package/dist/chunks/switch-Ced9ZZwI.cjs +134 -0
  34. package/dist/chunks/{switch-QfKb0Iwe.js → switch-D5_tjsIS.js} +3139 -3087
  35. package/dist/dashboard/index.cjs +1 -1
  36. package/dist/dashboard/index.js +1 -1
  37. package/dist/data-app-builder/index.cjs +1 -1
  38. package/dist/data-app-builder/index.js +2 -2
  39. package/dist/data-app-sdk/index.cjs +1 -1
  40. package/dist/data-app-sdk/index.js +1 -1
  41. package/dist/format-utils/index.cjs +3 -3
  42. package/dist/format-utils/index.js +131 -126
  43. package/dist/index.cjs +1 -1
  44. package/dist/index.js +7 -7
  45. package/dist/surfboard/index.cjs +1 -1
  46. package/dist/surfboard/index.js +2 -2
  47. package/dist/types/components/visual/aggregated-table/utils/metric-format-resolver.d.ts +3 -3
  48. package/dist/types/components/visual/data-table/types/data-table.d.ts +4 -1
  49. package/dist/types/components/visual/pivot-table/utils/pivot-metric-formatting.d.ts +2 -2
  50. package/dist/types/lib/formatters/metric-formatting.d.ts +3 -3
  51. package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +1 -0
  52. package/dist/types/lib/utils/date-timezone-utils.d.ts +26 -4
  53. package/dist/types/shared/format-utils/formatters/duration-formatter.d.ts +4 -1
  54. package/dist/types/shared/format-utils/formatters/index.d.ts +2 -2
  55. package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +8 -2
  56. package/dist/types/shared/format-utils/presentation-execution.d.ts +17 -2
  57. package/dist/types/shared/format-utils/types/format-types.d.ts +16 -1
  58. package/package.json +1 -1
  59. package/dist/chunks/index-F25jnH0p.cjs +0 -1
  60. package/dist/chunks/matrix-formatter-BLunke3R.js +0 -424
  61. package/dist/chunks/matrix-formatter-CveLJo6S.cjs +0 -1
  62. package/dist/chunks/pivot-result-lifecycle-BiERyXnS.cjs +0 -1
  63. package/dist/chunks/raw-temporal-BUeTpG76.cjs +0 -1
  64. package/dist/chunks/semantic-format-BzH69TRq.cjs +0 -1
  65. package/dist/chunks/switch--Re1K566.cjs +0 -134
@@ -1,8 +1,16 @@
1
- function F(e, t) {
2
- const n = b(t);
3
- return "formatToParts" in n ? $(n, e) : A(n, e);
1
+ function U(e) {
2
+ if (!e || typeof e != "object") return !1;
3
+ const t = e.type;
4
+ return t === "number" || t === "currency" || t === "percent" || t === "scientific";
4
5
  }
5
- const _ = {
6
+ function V(e) {
7
+ return U(e) || !!e && typeof e == "object" && e.type === "duration";
8
+ }
9
+ function _(e, t) {
10
+ const n = L(t);
11
+ return "formatToParts" in n ? b(n, e) : A(n, e);
12
+ }
13
+ const $ = {
6
14
  year: 0,
7
15
  month: 1,
8
16
  day: 2,
@@ -10,11 +18,11 @@ const _ = {
10
18
  minute: 4,
11
19
  second: 5
12
20
  };
13
- function $(e, t) {
21
+ function b(e, t) {
14
22
  try {
15
23
  const n = e.formatToParts(t), r = [];
16
24
  for (let i = 0; i < n.length; i++) {
17
- const a = _[n[i].type];
25
+ const a = $[n[i].type];
18
26
  a !== void 0 && (r[a] = parseInt(n[i].value, 10));
19
27
  }
20
28
  return r;
@@ -45,7 +53,7 @@ const f = {}, m = new Intl.DateTimeFormat("en-US", {
45
53
  minute: "2-digit",
46
54
  second: "2-digit"
47
55
  }).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), S = m === "06/25/2014, 00:00:00" || m === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
48
- function b(e) {
56
+ function L(e) {
49
57
  return f[e] || (f[e] = S ? new Intl.DateTimeFormat("en-US", {
50
58
  hourCycle: "h23",
51
59
  timeZone: e,
@@ -70,12 +78,12 @@ function Y(e, t, n, r, i, a, s) {
70
78
  const u = /* @__PURE__ */ new Date(0);
71
79
  return u.setUTCFullYear(e, t, n), u.setUTCHours(r, i, a, s), u;
72
80
  }
73
- const T = 36e5, L = 6e4, D = {
81
+ const T = 36e5, Z = 6e4, D = {
74
82
  timezoneZ: /^(Z)$/,
75
83
  timezoneHH: /^([+-]\d{2})$/,
76
84
  timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
77
85
  };
78
- function O(e, t, n) {
86
+ function x(e, t, n) {
79
87
  if (!e)
80
88
  return 0;
81
89
  let r = D.timezoneZ.exec(e);
@@ -87,38 +95,38 @@ function O(e, t, n) {
87
95
  if (r = D.timezoneHHMM.exec(e), r) {
88
96
  i = parseInt(r[2], 10);
89
97
  const s = parseInt(r[3], 10);
90
- return I(i, s) ? (a = Math.abs(i) * T + s * L, r[1] === "+" ? -a : a) : NaN;
98
+ return I(i, s) ? (a = Math.abs(i) * T + s * Z, r[1] === "+" ? -a : a) : NaN;
91
99
  }
92
- if (z(e)) {
100
+ if (W(e)) {
93
101
  t = new Date(t || Date.now());
94
- const s = n ? t : Z(t), u = p(s, e);
95
- return -(n ? u : E(t, u, e));
102
+ const s = n ? t : E(t), u = d(s, e);
103
+ return -(n ? u : z(t, u, e));
96
104
  }
97
105
  return NaN;
98
106
  }
99
- function Z(e) {
107
+ function E(e) {
100
108
  return Y(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
101
109
  }
102
- function p(e, t) {
103
- const n = F(e, t), r = Y(n[0], n[1] - 1, n[2], n[3] % 24, n[4], n[5], 0).getTime();
110
+ function d(e, t) {
111
+ const n = _(e, t), r = Y(n[0], n[1] - 1, n[2], n[3] % 24, n[4], n[5], 0).getTime();
104
112
  let i = e.getTime();
105
113
  const a = i % 1e3;
106
114
  return i -= a >= 0 ? a : 1e3 + a, r - i;
107
115
  }
108
- function E(e, t, n) {
116
+ function z(e, t, n) {
109
117
  let i = e.getTime() - t;
110
- const a = p(new Date(i), n);
118
+ const a = d(new Date(i), n);
111
119
  if (t === a)
112
120
  return t;
113
121
  i -= a - t;
114
- const s = p(new Date(i), n);
122
+ const s = d(new Date(i), n);
115
123
  return a === s ? a : Math.max(a, s);
116
124
  }
117
125
  function I(e, t) {
118
126
  return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
119
127
  }
120
128
  const w = {};
121
- function z(e) {
129
+ function W(e) {
122
130
  if (w[e])
123
131
  return !0;
124
132
  try {
@@ -127,11 +135,11 @@ function z(e) {
127
135
  return !1;
128
136
  }
129
137
  }
130
- function g(e) {
138
+ function M(e) {
131
139
  const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
132
140
  return t.setUTCFullYear(e.getFullYear()), +e - +t;
133
141
  }
134
- const U = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, N = 36e5, M = 6e4, W = 2, o = {
142
+ const O = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, p = 36e5, g = 6e4, k = 2, o = {
135
143
  dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
136
144
  datePattern: /^([0-9W+-]+)(.*)/,
137
145
  // year tokens
@@ -163,14 +171,14 @@ const U = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?
163
171
  HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
164
172
  HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
165
173
  // time zone tokens (to identify the presence of a tz)
166
- timeZone: U
174
+ timeZone: O
167
175
  };
168
176
  function h(e, t = {}) {
169
177
  if (arguments.length < 1)
170
178
  throw new TypeError("1 argument required, but only " + arguments.length + " present");
171
179
  if (e === null)
172
180
  return /* @__PURE__ */ new Date(NaN);
173
- const n = t.additionalDigits == null ? W : Number(t.additionalDigits);
181
+ const n = t.additionalDigits == null ? k : Number(t.additionalDigits);
174
182
  if (n !== 2 && n !== 1 && n !== 0)
175
183
  throw new RangeError("additionalDigits must be 0, 1 or 2");
176
184
  if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
@@ -179,24 +187,24 @@ function h(e, t = {}) {
179
187
  return new Date(e);
180
188
  if (Object.prototype.toString.call(e) !== "[object String]")
181
189
  return /* @__PURE__ */ new Date(NaN);
182
- const r = k(e), { year: i, restDateString: a } = P(r.date, n), s = v(a, i);
190
+ const r = P(e), { year: i, restDateString: a } = j(r.date, n), s = v(a, i);
183
191
  if (s === null || isNaN(s.getTime()))
184
192
  return /* @__PURE__ */ new Date(NaN);
185
193
  if (s) {
186
194
  const u = s.getTime();
187
195
  let c = 0, l;
188
- if (r.time && (c = j(r.time), c === null || isNaN(c)))
196
+ if (r.time && (c = R(r.time), c === null || isNaN(c)))
189
197
  return /* @__PURE__ */ new Date(NaN);
190
198
  if (r.timeZone || t.timeZone) {
191
- if (l = O(r.timeZone || t.timeZone, new Date(u + c)), isNaN(l))
199
+ if (l = x(r.timeZone || t.timeZone, new Date(u + c)), isNaN(l))
192
200
  return /* @__PURE__ */ new Date(NaN);
193
201
  } else
194
- l = g(new Date(u + c)), l = g(new Date(u + c + l));
202
+ l = M(new Date(u + c)), l = M(new Date(u + c + l));
195
203
  return new Date(u + c + l);
196
204
  } else
197
205
  return /* @__PURE__ */ new Date(NaN);
198
206
  }
199
- function k(e) {
207
+ function P(e) {
200
208
  const t = {};
201
209
  let n = o.dateTimePattern.exec(e), r;
202
210
  if (n ? (t.date = n[1], r = n[3]) : (n = o.datePattern.exec(e), n ? (t.date = n[1], r = n[2]) : (t.date = null, r = e)), r) {
@@ -205,7 +213,7 @@ function k(e) {
205
213
  }
206
214
  return t;
207
215
  }
208
- function P(e, t) {
216
+ function j(e, t) {
209
217
  if (e) {
210
218
  const n = o.YYY[t], r = o.YYYYY[t];
211
219
  let i = o.YYYY.exec(e) || r.exec(e);
@@ -236,16 +244,16 @@ function v(e, t) {
236
244
  return n = /* @__PURE__ */ new Date(0), n.setUTCFullYear(t), n;
237
245
  let a = o.MM.exec(e);
238
246
  if (a)
239
- return n = /* @__PURE__ */ new Date(0), r = parseInt(a[1], 10) - 1, x(t, r) ? (n.setUTCFullYear(t, r), n) : /* @__PURE__ */ new Date(NaN);
247
+ return n = /* @__PURE__ */ new Date(0), r = parseInt(a[1], 10) - 1, y(t, r) ? (n.setUTCFullYear(t, r), n) : /* @__PURE__ */ new Date(NaN);
240
248
  if (a = o.DDD.exec(e), a) {
241
249
  n = /* @__PURE__ */ new Date(0);
242
250
  const s = parseInt(a[1], 10);
243
- return q(t, s) ? (n.setUTCFullYear(t, 0, s), n) : /* @__PURE__ */ new Date(NaN);
251
+ return J(t, s) ? (n.setUTCFullYear(t, 0, s), n) : /* @__PURE__ */ new Date(NaN);
244
252
  }
245
253
  if (a = o.MMDD.exec(e), a) {
246
254
  n = /* @__PURE__ */ new Date(0), r = parseInt(a[1], 10) - 1;
247
255
  const s = parseInt(a[2], 10);
248
- return x(t, r, s) ? (n.setUTCFullYear(t, r, s), n) : /* @__PURE__ */ new Date(NaN);
256
+ return y(t, r, s) ? (n.setUTCFullYear(t, r, s), n) : /* @__PURE__ */ new Date(NaN);
249
257
  }
250
258
  if (a = o.Www.exec(e), a)
251
259
  return i = parseInt(a[1], 10) - 1, C(i) ? H(t, i) : /* @__PURE__ */ new Date(NaN);
@@ -256,16 +264,16 @@ function v(e, t) {
256
264
  }
257
265
  return null;
258
266
  }
259
- function j(e) {
267
+ function R(e) {
260
268
  let t, n, r = o.HH.exec(e);
261
269
  if (r)
262
- return t = parseFloat(r[1].replace(",", ".")), d(t) ? t % 24 * N : NaN;
270
+ return t = parseFloat(r[1].replace(",", ".")), N(t) ? t % 24 * p : NaN;
263
271
  if (r = o.HHMM.exec(e), r)
264
- return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), d(t, n) ? t % 24 * N + n * M : NaN;
272
+ return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), N(t, n) ? t % 24 * p + n * g : NaN;
265
273
  if (r = o.HHMMSS.exec(e), r) {
266
274
  t = parseInt(r[1], 10), n = parseInt(r[2], 10);
267
275
  const i = parseFloat(r[3].replace(",", "."));
268
- return d(t, n, i) ? t % 24 * N + n * M + i * 1e3 : NaN;
276
+ return N(t, n, i) ? t % 24 * p + n * g + i * 1e3 : NaN;
269
277
  }
270
278
  return null;
271
279
  }
@@ -276,43 +284,45 @@ function H(e, t, n) {
276
284
  const i = r.getUTCDay() || 7, a = t * 7 + n + 1 - i;
277
285
  return r.setUTCDate(r.getUTCDate() + a), r;
278
286
  }
279
- const R = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], G = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
280
- function y(e) {
287
+ const G = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], q = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
288
+ function F(e) {
281
289
  return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
282
290
  }
283
- function x(e, t, n) {
291
+ function y(e, t, n) {
284
292
  if (t < 0 || t > 11)
285
293
  return !1;
286
294
  if (n != null) {
287
295
  if (n < 1)
288
296
  return !1;
289
- const r = y(e);
290
- if (r && n > G[t] || !r && n > R[t])
297
+ const r = F(e);
298
+ if (r && n > q[t] || !r && n > G[t])
291
299
  return !1;
292
300
  }
293
301
  return !0;
294
302
  }
295
- function q(e, t) {
303
+ function J(e, t) {
296
304
  if (t < 1)
297
305
  return !1;
298
- const n = y(e);
306
+ const n = F(e);
299
307
  return !(n && t > 366 || !n && t > 365);
300
308
  }
301
309
  function C(e, t) {
302
310
  return !(e < 0 || e > 52 || t != null && (t < 0 || t > 6));
303
311
  }
304
- function d(e, t, n) {
312
+ function N(e, t, n) {
305
313
  return !(e < 0 || e >= 25 || t != null && (t < 0 || t >= 60) || n != null && (n < 0 || n >= 60));
306
314
  }
307
- function J(e, t, n) {
308
- if (typeof e == "string" && !e.match(U))
315
+ function B(e, t, n) {
316
+ if (typeof e == "string" && !e.match(O))
309
317
  return h(e, { ...n, timeZone: t });
310
318
  e = h(e, n);
311
- const r = Y(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()).getTime(), i = O(t, new Date(r));
319
+ const r = Y(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()).getTime(), i = x(t, new Date(r));
312
320
  return new Date(r + i);
313
321
  }
314
322
  export {
315
- h as a,
316
- J as f,
317
- O as t
323
+ V as a,
324
+ h as b,
325
+ B as f,
326
+ U as i,
327
+ x as t
318
328
  };
@@ -0,0 +1 @@
1
+ "use strict";function x(e){if(!e||typeof e!="object")return!1;const t=e.type;return t==="number"||t==="currency"||t==="percent"||t==="scientific"}function _(e){return x(e)||!!e&&typeof e=="object"&&e.type==="duration"}function $(e,t){const n=Z(t);return"formatToParts"in n?A(n,e):S(n,e)}const b={year:0,month:1,day:2,hour:3,minute:4,second:5};function A(e,t){try{const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const a=b[n[i].type];a!==void 0&&(r[a]=parseInt(n[i].value,10))}return r}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function S(e,t){const n=e.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(r[3],10),parseInt(r[1],10),parseInt(r[2],10),parseInt(r[4],10),parseInt(r[5],10),parseInt(r[6],10)]}const f={},I=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),L=I==="06/25/2014, 00:00:00"||I==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Z(e){return f[e]||(f[e]=L?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),f[e]}function T(e,t,n,r,i,a,o){const u=new Date(0);return u.setUTCFullYear(e,t,n),u.setUTCHours(r,i,a,o),u}const w=36e5,z=6e4,D={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Y(e,t,n){if(!e)return 0;let r=D.timezoneZ.exec(e);if(r)return 0;let i,a;if(r=D.timezoneHH.exec(e),r)return i=parseInt(r[1],10),M(i)?-(i*w):NaN;if(r=D.timezoneHHMM.exec(e),r){i=parseInt(r[2],10);const o=parseInt(r[3],10);return M(i,o)?(a=Math.abs(i)*w+o*z,r[1]==="+"?-a:a):NaN}if(W(e)){t=new Date(t||Date.now());const o=n?t:E(t),u=m(o,e);return-(n?u:P(t,u,e))}return NaN}function E(e){return T(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function m(e,t){const n=$(e,t),r=T(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let i=e.getTime();const a=i%1e3;return i-=a>=0?a:1e3+a,r-i}function P(e,t,n){let i=e.getTime()-t;const a=m(new Date(i),n);if(t===a)return t;i-=a-t;const o=m(new Date(i),n);return a===o?a:Math.max(a,o)}function M(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const g={};function W(e){if(g[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),g[e]=!0,!0}catch{return!1}}function h(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const O=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,N=36e5,C=6e4,k=2,s={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:O};function d(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?k:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const r=j(e),{year:i,restDateString:a}=v(r.date,n),o=R(a,i);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const u=o.getTime();let c=0,l;if(r.time&&(c=G(r.time),c===null||isNaN(c)))return new Date(NaN);if(r.timeZone||t.timeZone){if(l=Y(r.timeZone||t.timeZone,new Date(u+c)),isNaN(l))return new Date(NaN)}else l=h(new Date(u+c)),l=h(new Date(u+c+l));return new Date(u+c+l)}else return new Date(NaN)}function j(e){const t={};let n=s.dateTimePattern.exec(e),r;if(n?(t.date=n[1],r=n[3]):(n=s.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){const i=s.timeZone.exec(r);i?(t.time=r.replace(i[1],""),t.timeZone=i[1].trim()):t.time=r}return t}function v(e,t){if(e){const n=s.YYY[t],r=s.YYYYY[t];let i=s.YYYY.exec(e)||r.exec(e);if(i){const a=i[1];return{year:parseInt(a,10),restDateString:e.slice(a.length)}}if(i=s.YY.exec(e)||n.exec(e),i){const a=i[1];return{year:parseInt(a,10)*100,restDateString:e.slice(a.length)}}}return{year:null}}function R(e,t){if(t===null)return null;let n,r,i;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let a=s.MM.exec(e);if(a)return n=new Date(0),r=parseInt(a[1],10)-1,y(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(a=s.DDD.exec(e),a){n=new Date(0);const o=parseInt(a[1],10);return V(t,o)?(n.setUTCFullYear(t,0,o),n):new Date(NaN)}if(a=s.MMDD.exec(e),a){n=new Date(0),r=parseInt(a[1],10)-1;const o=parseInt(a[2],10);return y(t,r,o)?(n.setUTCFullYear(t,r,o),n):new Date(NaN)}if(a=s.Www.exec(e),a)return i=parseInt(a[1],10)-1,F(i)?H(t,i):new Date(NaN);if(a=s.WwwD.exec(e),a){i=parseInt(a[1],10)-1;const o=parseInt(a[2],10)-1;return F(i,o)?H(t,i,o):new Date(NaN)}return null}function G(e){let t,n,r=s.HH.exec(e);if(r)return t=parseFloat(r[1].replace(",",".")),p(t)?t%24*N:NaN;if(r=s.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")),p(t,n)?t%24*N+n*C:NaN;if(r=s.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);const i=parseFloat(r[3].replace(",","."));return p(t,n,i)?t%24*N+n*C+i*1e3:NaN}return null}function H(e,t,n){t=t||0,n=n||0;const r=new Date(0);r.setUTCFullYear(e,0,4);const i=r.getUTCDay()||7,a=t*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}const q=[31,28,31,30,31,30,31,31,30,31,30,31],J=[31,29,31,30,31,30,31,31,30,31,30,31];function U(e){return e%400===0||e%4===0&&e%100!==0}function y(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const r=U(e);if(r&&n>J[t]||!r&&n>q[t])return!1}return!0}function V(e,t){if(t<1)return!1;const n=U(e);return!(n&&t>366||!n&&t>365)}function F(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function p(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}function B(e,t,n){if(typeof e=="string"&&!e.match(O))return d(e,{...n,timeZone:t});e=d(e,n);const r=T(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=Y(t,new Date(r));return new Date(r+i)}exports.fromZonedTime=B;exports.isMeasureCanonicalFormat=_;exports.isNumericCanonicalFormat=x;exports.toDate=d;exports.tzParseTimezone=Y;