temporal-polyfill-lite 0.3.4 → 0.3.6
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/CHANGELOG.md +13 -0
- package/README.md +6 -0
- package/dist/calendars/index.d.ts +4 -4
- package/dist/calendars/index.js +1 -1
- package/dist/calendars/shim.js +1 -1
- package/dist/calendars/{src-BRD2b69b.js → src-B3jme83H.js} +277 -303
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/shim.js +1 -1
- package/dist/{src-D8HHiqs0.js → src-Kt6fkCUU.js} +72 -100
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -591,19 +591,19 @@ export namespace Intl {
|
|
|
591
591
|
}
|
|
592
592
|
}
|
|
593
593
|
|
|
594
|
-
export const Intl: {
|
|
594
|
+
export const Intl: typeof globalThis.Intl & {
|
|
595
595
|
DateTimeFormat: {
|
|
596
596
|
new (
|
|
597
|
-
locales?:
|
|
597
|
+
locales?: globalThis.Intl.LocalesArgument,
|
|
598
598
|
options?: globalThis.Intl.DateTimeFormatOptions,
|
|
599
599
|
): Intl.DateTimeFormat;
|
|
600
600
|
(
|
|
601
|
-
locales?:
|
|
601
|
+
locales?: globalThis.Intl.LocalesArgument,
|
|
602
602
|
options?: globalThis.Intl.DateTimeFormatOptions,
|
|
603
603
|
): Intl.DateTimeFormat;
|
|
604
604
|
|
|
605
605
|
supportedLocalesOf(
|
|
606
|
-
locales:
|
|
606
|
+
locales: globalThis.Intl.LocalesArgument,
|
|
607
607
|
options?: globalThis.Intl.DateTimeFormatOptions,
|
|
608
608
|
): string[];
|
|
609
609
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as a, r as s, t as r } from "./src-
|
|
1
|
+
import { i as a, r as s, t as r } from "./src-Kt6fkCUU.js";
|
|
2
2
|
export { s as Intl, r as Temporal, a as toTemporalInstant };
|
package/dist/shim.js
CHANGED
|
@@ -4,5 +4,5 @@ function install(s) {
|
|
|
4
4
|
function setSystemTimeZoneIdCacheTtl(t) {
|
|
5
5
|
s(t);
|
|
6
6
|
}
|
|
7
|
-
import { a as t, i as a, n as s, r as e, t as l } from "./src-
|
|
7
|
+
import { a as t, i as a, n as s, r as e, t as l } from "./src-Kt6fkCUU.js";
|
|
8
8
|
export { install, setSystemTimeZoneIdCacheTtl };
|
|
@@ -35,9 +35,6 @@ function toPrimitive(e) {
|
|
|
35
35
|
function toString(e) {
|
|
36
36
|
return `${e}`;
|
|
37
37
|
}
|
|
38
|
-
function toBoolean(e) {
|
|
39
|
-
return !!e;
|
|
40
|
-
}
|
|
41
38
|
function toBigInt(e) {
|
|
42
39
|
return isObject(e) || "number" == typeof e ? BigInt.asIntN(2 ** 53 - 1, e) : BigInt(e);
|
|
43
40
|
}
|
|
@@ -53,7 +50,7 @@ function toPositiveIntegerWithTruncation(e) {
|
|
|
53
50
|
const t = toIntegerWithTruncation(e);
|
|
54
51
|
return t <= 0 && throwRangeError(invalidNumber(t)), t;
|
|
55
52
|
}
|
|
56
|
-
function getOptionsObject(e = createNullPrototypeObject(
|
|
53
|
+
function getOptionsObject(e = createNullPrototypeObject()) {
|
|
57
54
|
return isObject(e) || throwTypeError("invalid options object"), e;
|
|
58
55
|
}
|
|
59
56
|
function getOption(e, t, o, n) {
|
|
@@ -232,7 +229,7 @@ function toTemporalZonedDateTime(e, t) {
|
|
|
232
229
|
return createZonedDateTimeSlot(interpretISODateTimeOffset(l, c, m, m === S ? parseDateTimeUtcOffset(n) : 0, o, r, a, d), o, i);
|
|
233
230
|
}
|
|
234
231
|
function createTemporalZonedDateTime(e, t, o, n) {
|
|
235
|
-
return createTemporalZonedDateTimeFromSlot(createZonedDateTimeSlot(e, t, o, ((e, t) =>
|
|
232
|
+
return createTemporalZonedDateTimeFromSlot(createZonedDateTimeSlot(e, t, o, ((e, t) => be[e] && be[e].C(clampEpochSecond(t)))(t, epochSeconds(e))), n);
|
|
236
233
|
}
|
|
237
234
|
function createZonedDateTimeSlot(e, t, o, n) {
|
|
238
235
|
return {
|
|
@@ -315,7 +312,7 @@ function clampEpochSecond(e) {
|
|
|
315
312
|
}
|
|
316
313
|
function getNamedTimeZoneOffsetNanosecondsForEpochSecond(t, o, n) {
|
|
317
314
|
if ("UTC" === t) return 0;
|
|
318
|
-
const r = clampEpochSecond(o), a =
|
|
315
|
+
const r = clampEpochSecond(o), a = be[t] ||= (() => {
|
|
319
316
|
const e = /* @__PURE__ */ new Map();
|
|
320
317
|
return {
|
|
321
318
|
C(t) {
|
|
@@ -341,7 +338,7 @@ function getNamedTimeZoneOffsetNanosecondsForEpochSecond(t, o, n) {
|
|
|
341
338
|
return n || a.q(r, c), c;
|
|
342
339
|
}
|
|
343
340
|
function getFormatterForTimeZone(e) {
|
|
344
|
-
return
|
|
341
|
+
return Re[e] ||= new Ft("en-u-hc-h23", {
|
|
345
342
|
timeZone: e,
|
|
346
343
|
year: "numeric",
|
|
347
344
|
month: "numeric",
|
|
@@ -1099,7 +1096,7 @@ function calendarResolveFields(e, t, o = c) {
|
|
|
1099
1096
|
})(0, t, o);
|
|
1100
1097
|
}
|
|
1101
1098
|
function createEmptyCalendarFieldsRecord() {
|
|
1102
|
-
return createNullPrototypeObject(
|
|
1099
|
+
return createNullPrototypeObject();
|
|
1103
1100
|
}
|
|
1104
1101
|
function zeroDateDuration() {
|
|
1105
1102
|
return createDateDurationRecord(0, 0, 0, 0);
|
|
@@ -1245,18 +1242,18 @@ function computeNudgeWindow(e, t, o, n, r, a, i, l, c) {
|
|
|
1245
1242
|
return {
|
|
1246
1243
|
Te: s,
|
|
1247
1244
|
De: d,
|
|
1248
|
-
|
|
1249
|
-
|
|
1245
|
+
pe: u,
|
|
1246
|
+
he: r ? getEpochNanosecondsFor(r, D, g) : getUtcEpochNanoseconds(D),
|
|
1250
1247
|
ge: m,
|
|
1251
1248
|
fe: T
|
|
1252
1249
|
};
|
|
1253
1250
|
}
|
|
1254
1251
|
function nudgeToCalendarUnit(e, t, o, n, r, a, i, l, c, s) {
|
|
1255
1252
|
let d = !1, m = computeNudgeWindow(e, t, o, r, a, 0, l, c, !1);
|
|
1256
|
-
compareEpochNanoseconds(m.
|
|
1257
|
-
const T = differenceEpochNanoseconds(m.
|
|
1258
|
-
let D = m.ge, p = m.
|
|
1259
|
-
return roundNumberToIncrement(m.Te + ((e, t, o) => signTimeDuration(e) ? ye(e, t) ? ye(addTimeDuration(e, e), t) * o / 5 + .5 : 1 : 0)(T, u, e) * l * e, l, s) === m.De && (d = !0, D = m.fe, p = m.
|
|
1253
|
+
compareEpochNanoseconds(m.pe, n) * compareEpochNanoseconds(m.he, n) > 0 && (m = computeNudgeWindow(e, t, o, r, a, 0, l, c, !0), d = !0);
|
|
1254
|
+
const T = differenceEpochNanoseconds(m.pe, n), u = differenceEpochNanoseconds(m.pe, m.he);
|
|
1255
|
+
let D = m.ge, p = m.pe;
|
|
1256
|
+
return roundNumberToIncrement(m.Te + ((e, t, o) => signTimeDuration(e) ? ye(e, t) ? ye(addTimeDuration(e, e), t) * o / 5 + .5 : 1 : 0)(T, u, e) * l * e, l, s) === m.De && (d = !0, D = m.fe, p = m.he), {
|
|
1260
1257
|
Ie: {
|
|
1261
1258
|
Oe: combineDateAndTimeDuration(D, createTimeDurationFromSeconds(0)),
|
|
1262
1259
|
Se: p,
|
|
@@ -1385,7 +1382,7 @@ function getTemporalDisambiguationOption(e) {
|
|
|
1385
1382
|
], g);
|
|
1386
1383
|
}
|
|
1387
1384
|
function negateRoundingMode(e) {
|
|
1388
|
-
return "ceil" === e ? y : "floor" === e ? v : "halfCeil" === e ?
|
|
1385
|
+
return "ceil" === e ? y : "floor" === e ? v : "halfCeil" === e ? b : "halfFloor" === e ? R : e;
|
|
1389
1386
|
}
|
|
1390
1387
|
function getTemporalOffsetOption(e, t) {
|
|
1391
1388
|
return getOption(e, "offset", [
|
|
@@ -1416,12 +1413,12 @@ function getTemporalFractionalSecondDigitsOption(e) {
|
|
|
1416
1413
|
}
|
|
1417
1414
|
function toSecondsStringPrecisionRecord(e, t) {
|
|
1418
1415
|
return e ? {
|
|
1419
|
-
|
|
1420
|
-
|
|
1416
|
+
ve: e === q ? D : 3 * (e - 6),
|
|
1417
|
+
ye: e,
|
|
1421
1418
|
Ee: 1
|
|
1422
1419
|
} : {
|
|
1423
|
-
|
|
1424
|
-
|
|
1420
|
+
ve: t,
|
|
1421
|
+
ye: divFloor((t ?? 9) - 1, 3) + 7,
|
|
1425
1422
|
Ee: 10 ** ((9 - (t ?? 9)) % 3)
|
|
1426
1423
|
};
|
|
1427
1424
|
}
|
|
@@ -1440,13 +1437,13 @@ function validateTemporalUnitValue(e, t, o = []) {
|
|
|
1440
1437
|
}
|
|
1441
1438
|
function getTemporalRelativeToOption(e) {
|
|
1442
1439
|
const t = e.relativeTo;
|
|
1443
|
-
if (void 0 === t) return createNullPrototypeObject(
|
|
1440
|
+
if (void 0 === t) return createNullPrototypeObject();
|
|
1444
1441
|
let o, n, r, a, i, l = !0, c = S;
|
|
1445
1442
|
if (isObject(t)) {
|
|
1446
1443
|
if (isZonedDateTime(t)) return createNullPrototypeObject({ Pe: getInternalSlotOrThrowForZonedDateTime(t) });
|
|
1447
|
-
if (isPlainDate(t)) return createNullPrototypeObject({
|
|
1444
|
+
if (isPlainDate(t)) return createNullPrototypeObject({ Re: getInternalSlotOrThrowForPlainDate(t) });
|
|
1448
1445
|
const e = getInternalSlotForPlainDateTime(t);
|
|
1449
|
-
if (e) return createNullPrototypeObject({
|
|
1446
|
+
if (e) return createNullPrototypeObject({ Re: getInternalSlotOrThrowForPlainDate(createTemporalDate(e._.o, e.U)) });
|
|
1450
1447
|
r = getTemporalCalendarIdentifierWithIsoDefault(t);
|
|
1451
1448
|
const l = prepareCalendarFields(r, t, [
|
|
1452
1449
|
Dt.t,
|
|
@@ -1468,7 +1465,7 @@ function getTemporalRelativeToOption(e) {
|
|
|
1468
1465
|
const e = parseIsoDateTime(t, [Xe, Qe]);
|
|
1469
1466
|
n = e.Z.$, e.Z.N ? (o = toTemporalTimeZoneIdentifier(e.Z.N), c = e.Z.M ? F : n ? S : w, l = void 0 !== n && hasUtcOffsetSubMinuteParts(n)) : o = void 0, r = canonicalizeCalendar(e.U || "iso8601"), a = createIsoDateRecord(e.t, e.u, e.T), i = e.p;
|
|
1470
1467
|
}
|
|
1471
|
-
return createNullPrototypeObject(o ? { Pe: getInternalSlotOrThrowForZonedDateTime(createTemporalZonedDateTime(interpretISODateTimeOffset(a, i, c, c === S ? parseDateTimeUtcOffset(n) : 0, o, g, O, l), o, r)) } : {
|
|
1468
|
+
return createNullPrototypeObject(o ? { Pe: getInternalSlotOrThrowForZonedDateTime(createTemporalZonedDateTime(interpretISODateTimeOffset(a, i, c, c === S ? parseDateTimeUtcOffset(n) : 0, o, g, O, l), o, r)) } : { Re: getInternalSlotOrThrowForPlainDate(createTemporalDate(a, r)) });
|
|
1472
1469
|
}
|
|
1473
1470
|
function largerOfTwoTemporalUnits(e, t) {
|
|
1474
1471
|
return e < t ? e : t;
|
|
@@ -1505,8 +1502,8 @@ function getRoundingModeOption(e, t) {
|
|
|
1505
1502
|
y,
|
|
1506
1503
|
E,
|
|
1507
1504
|
P,
|
|
1508
|
-
b,
|
|
1509
1505
|
R,
|
|
1506
|
+
b,
|
|
1510
1507
|
Z,
|
|
1511
1508
|
N,
|
|
1512
1509
|
M
|
|
@@ -1557,7 +1554,7 @@ function isoDateTimeToFields(e, t) {
|
|
|
1557
1554
|
});
|
|
1558
1555
|
}
|
|
1559
1556
|
function getInternalSlotOrThrowForDateTimeFormat(e) {
|
|
1560
|
-
const t =
|
|
1557
|
+
const t = wt.get(e);
|
|
1561
1558
|
return t || throwTypeError(pe), t;
|
|
1562
1559
|
}
|
|
1563
1560
|
function formatDateTime(e, t) {
|
|
@@ -1572,19 +1569,19 @@ function dateStyleToMonthStyle(e) {
|
|
|
1572
1569
|
}
|
|
1573
1570
|
function amendOptionsForPlainDate(e) {
|
|
1574
1571
|
const t = createNullPrototypeObject(e);
|
|
1575
|
-
return hasAnyOptions(e,
|
|
1572
|
+
return hasAnyOptions(e, vt) || (hasAnyOptions(e, yt) && throwTypeError(ue), t.year = t.month = t.day = "numeric"), removeDateTimeFormatOptions(t, [...yt, "timeZoneName"]), t.timeZone = "UTC", t;
|
|
1576
1573
|
}
|
|
1577
1574
|
function amendOptionsForPlainTime(e) {
|
|
1578
1575
|
const t = createNullPrototypeObject(e);
|
|
1579
|
-
return hasAnyOptions(e,
|
|
1580
|
-
...
|
|
1576
|
+
return hasAnyOptions(e, yt) || (hasAnyOptions(e, vt) && throwTypeError(ue), t.hour = t.minute = t.second = "numeric"), "long" !== e.timeStyle && "full" !== e.timeStyle || (removeDateTimeFormatOptions(t, ["timeStyle"]), t.hour = t.minute = t.second = "numeric"), removeDateTimeFormatOptions(t, [
|
|
1577
|
+
...vt,
|
|
1581
1578
|
"era",
|
|
1582
1579
|
"timeZoneName"
|
|
1583
1580
|
]), t.timeZone = "UTC", t;
|
|
1584
1581
|
}
|
|
1585
1582
|
function amendOptionsForPlainDateTime(e) {
|
|
1586
1583
|
const t = createNullPrototypeObject(e);
|
|
1587
|
-
return "long" !== e.timeStyle && "full" !== e.timeStyle || (removeDateTimeFormatOptions(t, ["timeStyle"]), t.hour = t.minute = t.second = "numeric", e.dateStyle && (removeDateTimeFormatOptions(t, ["dateStyle"]), t.year = t.day = "numeric", t.month = dateStyleToMonthStyle(e.dateStyle), t.weekday = "full" === e.dateStyle ? "long" : void 0)), hasAnyOptions(e, [...
|
|
1584
|
+
return "long" !== e.timeStyle && "full" !== e.timeStyle || (removeDateTimeFormatOptions(t, ["timeStyle"]), t.hour = t.minute = t.second = "numeric", e.dateStyle && (removeDateTimeFormatOptions(t, ["dateStyle"]), t.year = t.day = "numeric", t.month = dateStyleToMonthStyle(e.dateStyle), t.weekday = "full" === e.dateStyle ? "long" : void 0)), hasAnyOptions(e, [...vt, ...yt]) || (t.year = t.month = t.day = t.hour = t.minute = t.second = "numeric"), removeDateTimeFormatOptions(t, ["timeZoneName"]), t.timeZone = "UTC", t;
|
|
1588
1585
|
}
|
|
1589
1586
|
function amendOptionsForPlainYearMonth(e) {
|
|
1590
1587
|
const t = createNullPrototypeObject(e);
|
|
@@ -1592,8 +1589,8 @@ function amendOptionsForPlainYearMonth(e) {
|
|
|
1592
1589
|
"year",
|
|
1593
1590
|
"month",
|
|
1594
1591
|
"dateStyle"
|
|
1595
|
-
]) || (hasAnyOptions(e, [...
|
|
1596
|
-
...
|
|
1592
|
+
]) || (hasAnyOptions(e, [...vt, ...yt]) && throwTypeError(ue), t.year = t.month = "numeric"), removeDateTimeFormatOptions(t, [
|
|
1593
|
+
...yt,
|
|
1597
1594
|
"day",
|
|
1598
1595
|
"weekday",
|
|
1599
1596
|
"timeZoneName"
|
|
@@ -1605,8 +1602,8 @@ function amendOptionsForPlainMonthDay(e) {
|
|
|
1605
1602
|
"month",
|
|
1606
1603
|
"day",
|
|
1607
1604
|
"dateStyle"
|
|
1608
|
-
]) || (hasAnyOptions(e, [...
|
|
1609
|
-
...
|
|
1605
|
+
]) || (hasAnyOptions(e, [...vt, ...yt]) && throwTypeError(ue), t.month = t.day = "numeric"), removeDateTimeFormatOptions(t, [
|
|
1606
|
+
...yt,
|
|
1610
1607
|
"era",
|
|
1611
1608
|
"year",
|
|
1612
1609
|
"weekday",
|
|
@@ -1615,48 +1612,25 @@ function amendOptionsForPlainMonthDay(e) {
|
|
|
1615
1612
|
}
|
|
1616
1613
|
function amendOptionsForInstant(e) {
|
|
1617
1614
|
const t = createNullPrototypeObject(e);
|
|
1618
|
-
return hasAnyOptions(e, [...
|
|
1615
|
+
return hasAnyOptions(e, [...vt, ...yt]) || (t.year = t.month = t.day = t.hour = t.minute = t.second = "numeric"), t;
|
|
1619
1616
|
}
|
|
1620
1617
|
function hasAnyOptions(e, t) {
|
|
1621
1618
|
return t.some((t) => void 0 !== e[t]);
|
|
1622
1619
|
}
|
|
1623
|
-
function createDateTimeFormat(e, t = createNullPrototypeObject(
|
|
1620
|
+
function createDateTimeFormat(e, t = createNullPrototypeObject(), o, n, r = Object.create(Pt.prototype)) {
|
|
1624
1621
|
null === t && throwTypeError(ue);
|
|
1625
|
-
const a = (
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
return o;
|
|
1629
|
-
})
|
|
1630
|
-
a.
|
|
1631
|
-
|
|
1632
|
-
"hourCycle",
|
|
1633
|
-
"formatMatcher",
|
|
1634
|
-
"era",
|
|
1635
|
-
"year",
|
|
1636
|
-
"month",
|
|
1637
|
-
"day",
|
|
1638
|
-
"weekday"
|
|
1639
|
-
]) mapUnlessUndefined(a[e], toString);
|
|
1640
|
-
void 0 !== n && (void 0 !== a.timeZone && throwTypeError("disallowed field: timeZone"), a.timeZone = n, hasAnyOptions(a, [
|
|
1622
|
+
const a = createNullPrototypeObject();
|
|
1623
|
+
let i = new Ft(e, new Proxy(Object(t), { get(e, t) {
|
|
1624
|
+
const o = e[t];
|
|
1625
|
+
return "timeZone" === t && void 0 !== n ? (void 0 !== o && throwTypeError("disallowed field: timeZone"), a[t] = n) : void 0 === o ? o : a[t] = "hour12" === t ? ((e) => !!e)(o) : "fractionalSecondDigits" === t ? Fe(o) : toString(o);
|
|
1626
|
+
} }));
|
|
1627
|
+
return (o === c && a.timeStyle || o === s && a.dateStyle) && throwTypeError(ue), a.calendar = i.resolvedOptions().calendar, void 0 === n || hasAnyOptions(a, [
|
|
1628
|
+
...vt,
|
|
1641
1629
|
...yt,
|
|
1642
|
-
...Et,
|
|
1643
1630
|
"timeZoneName"
|
|
1644
|
-
]) || (a.timeZoneName = "short"))
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
for (const e of [
|
|
1648
|
-
"hour12",
|
|
1649
|
-
"hourCycle",
|
|
1650
|
-
"formatMatcher",
|
|
1651
|
-
"era",
|
|
1652
|
-
"year",
|
|
1653
|
-
"month",
|
|
1654
|
-
"day",
|
|
1655
|
-
"weekday"
|
|
1656
|
-
]) d[e] = a[e];
|
|
1657
|
-
return d.timeZone = l.timeZone, d.calendar = l.calendar, (o === c && d.timeStyle || o === s && d.dateStyle) && throwTypeError(ue), vt.set(r, createNullPrototypeObject({
|
|
1658
|
-
Re: i,
|
|
1659
|
-
Ze: d,
|
|
1631
|
+
]) || (a.timeZoneName = "short", i = new Ft(i.resolvedOptions().locale, a)), wt.set(r, createNullPrototypeObject({
|
|
1632
|
+
be: i,
|
|
1633
|
+
Ze: a,
|
|
1660
1634
|
Ne: i.resolvedOptions().locale
|
|
1661
1635
|
})), r;
|
|
1662
1636
|
}
|
|
@@ -1676,10 +1650,10 @@ function toDateTimeFormattable(e) {
|
|
|
1676
1650
|
}
|
|
1677
1651
|
function handleDateTimeValue(e, t) {
|
|
1678
1652
|
const o = getInternalSlotForPlainDate(t), n = getInternalSlotForPlainDateTime(t), r = getInternalSlotForPlainYearMonth(t), a = getInternalSlotForPlainMonthDay(t);
|
|
1679
|
-
return isPlainTime(t) ? [e.$e ||= new Ft(e.Ne, amendOptionsForPlainTime(e.Ze)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(createIsoDateRecord(1970, 1, 1), getInternalSlotOrThrowForPlainTime(t))))] : o ? (o.U !== e.Ze.calendar && "iso8601" !== o.U && throwRangeError(De), [e.Me ||= new Ft(e.Ne, amendOptionsForPlainDate(e.Ze)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(o.o, midnightTimeRecord())))]) : n ? (n.U !== e.Ze.calendar && "iso8601" !== n.U && throwRangeError(De), [e.Ue ||= new Ft(e.Ne, amendOptionsForPlainDateTime(e.Ze)), epochMilliseconds(getUtcEpochNanoseconds(n._))]) : r ? (r.U !== e.Ze.calendar && throwRangeError(De), [e.je ||= new Ft(e.Ne, amendOptionsForPlainYearMonth(e.Ze)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(r.o, midnightTimeRecord())))]) : a ? (a.U !== e.Ze.calendar && throwRangeError(De), [e.Ce ||= new Ft(e.Ne, amendOptionsForPlainMonthDay(e.Ze)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(a.o, midnightTimeRecord())))]) : isInstant(t) ? [e.Ye ||= new Ft(e.Ne, amendOptionsForInstant(e.Ze)), epochMilliseconds(getInternalSlotOrThrowForInstant(t).Y)] : (isZonedDateTime(t) && throwTypeError(fe), [e.
|
|
1653
|
+
return isPlainTime(t) ? [e.$e ||= new Ft(e.Ne, amendOptionsForPlainTime(e.Ze)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(createIsoDateRecord(1970, 1, 1), getInternalSlotOrThrowForPlainTime(t))))] : o ? (o.U !== e.Ze.calendar && "iso8601" !== o.U && throwRangeError(De), [e.Me ||= new Ft(e.Ne, amendOptionsForPlainDate(e.Ze)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(o.o, midnightTimeRecord())))]) : n ? (n.U !== e.Ze.calendar && "iso8601" !== n.U && throwRangeError(De), [e.Ue ||= new Ft(e.Ne, amendOptionsForPlainDateTime(e.Ze)), epochMilliseconds(getUtcEpochNanoseconds(n._))]) : r ? (r.U !== e.Ze.calendar && throwRangeError(De), [e.je ||= new Ft(e.Ne, amendOptionsForPlainYearMonth(e.Ze)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(r.o, midnightTimeRecord())))]) : a ? (a.U !== e.Ze.calendar && throwRangeError(De), [e.Ce ||= new Ft(e.Ne, amendOptionsForPlainMonthDay(e.Ze)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(a.o, midnightTimeRecord())))]) : isInstant(t) ? [e.Ye ||= new Ft(e.Ne, amendOptionsForInstant(e.Ze)), epochMilliseconds(getInternalSlotOrThrowForInstant(t).Y)] : (isZonedDateTime(t) && throwTypeError(fe), [e.be, t]);
|
|
1680
1654
|
}
|
|
1681
1655
|
function DateTimeFormat(e, t) {
|
|
1682
|
-
return new
|
|
1656
|
+
return new Pt(e, t);
|
|
1683
1657
|
}
|
|
1684
1658
|
function createTemporalInstant(e, t = Object.create(Nt.prototype)) {
|
|
1685
1659
|
return Zt.set(t, { Y: e }), t;
|
|
@@ -1745,7 +1719,7 @@ function systemUtcEpochNanoseconds() {
|
|
|
1745
1719
|
function systemDateTime(e = systemTimeZoneIdentifier()) {
|
|
1746
1720
|
return getIsoDateTimeForZonedDateTimeSlot(createZonedDateTimeSlot(systemUtcEpochNanoseconds(), toTemporalTimeZoneIdentifier(e), "iso8601"));
|
|
1747
1721
|
}
|
|
1748
|
-
const e = 1e6, t = 6e10, o = 36e11, n = 86400, r = 864e5, a = 864e8, i = 864e11, l = 146097, c = Symbol(), s = Symbol(), d = Symbol(), m = Symbol(), T = Symbol(), u = Symbol(), D = Symbol(), p = "constrain", h = "reject", g = "compatible", f = "later", I = "prefer", O = "reject", S = Symbol(), F = Symbol(), w = Symbol(), v = "ceil", y = "floor", E = "expand", P = "trunc",
|
|
1722
|
+
const e = 1e6, t = 6e10, o = 36e11, n = 86400, r = 864e5, a = 864e8, i = 864e11, l = 146097, c = Symbol(), s = Symbol(), d = Symbol(), m = Symbol(), T = Symbol(), u = Symbol(), D = Symbol(), p = "constrain", h = "reject", g = "compatible", f = "later", I = "prefer", O = "reject", S = Symbol(), F = Symbol(), w = Symbol(), v = "ceil", y = "floor", E = "expand", P = "trunc", R = "halfCeil", b = "halfFloor", Z = "halfExpand", N = "halfTrunc", M = "halfEven", U = "auto", j = "always", $ = "never", C = "critical", Y = "auto", A = "never", W = "auto", z = "never", V = "critical", k = 0, H = 1, x = 2, L = 3, B = 4, q = 5, J = 6, G = 9, _ = 0, K = 1, X = 2, Q = 3, ee = 4, te = 5, oe = 6, ne = 7, re = 8, ae = 9, ie = [
|
|
1749
1723
|
"year",
|
|
1750
1724
|
"month",
|
|
1751
1725
|
"week",
|
|
@@ -1931,7 +1905,7 @@ var Pe = class {
|
|
|
1931
1905
|
], W))(o);
|
|
1932
1906
|
validateTemporalUnitValue(l, s), l === B && throwRangeError(invalidField("smallestUnit"));
|
|
1933
1907
|
const d = toSecondsStringPrecisionRecord(l, r);
|
|
1934
|
-
return temporalZonedDateTimeToString(t, d.
|
|
1908
|
+
return temporalZonedDateTimeToString(t, d.ve, n, c, a, d.Ee, d.ye, i);
|
|
1935
1909
|
}
|
|
1936
1910
|
toLocaleString(e = void 0, t = void 0) {
|
|
1937
1911
|
const o = getInternalSlotOrThrowForZonedDateTime(this), n = createDateTimeFormat(e, t, d, o.Z), r = getInternalSlotOrThrowForDateTimeFormat(n);
|
|
@@ -1973,7 +1947,7 @@ var Pe = class {
|
|
|
1973
1947
|
}
|
|
1974
1948
|
};
|
|
1975
1949
|
defineStringTag(Pe.prototype, "Temporal.ZonedDateTime"), renameFunction(Pe, "ZonedDateTime");
|
|
1976
|
-
const
|
|
1950
|
+
const Re = createNullPrototypeObject(), be = createNullPrototypeObject(), Ze = /* @__PURE__ */ new WeakMap();
|
|
1977
1951
|
var Ne = class {
|
|
1978
1952
|
constructor(e, t, o, n = 0, r = 0, a = 0, i = 0, l = 0, c = 0, s = "iso8601") {
|
|
1979
1953
|
const d = [
|
|
@@ -2127,7 +2101,7 @@ var Ne = class {
|
|
|
2127
2101
|
const t = getInternalSlotOrThrowForPlainDateTime(this), o = getOptionsObject(e), n = getTemporalShowCalendarNameOption(o), r = getTemporalFractionalSecondDigitsOption(o), a = getRoundingModeOption(o, P), i = getTemporalUnitValuedOption(o, "smallestUnit", void 0);
|
|
2128
2102
|
validateTemporalUnitValue(i, s), i === B && throwRangeError(invalidField("smallestUnit"));
|
|
2129
2103
|
const l = toSecondsStringPrecisionRecord(i, r);
|
|
2130
|
-
return isoDateTimeToString(validateIsoDateTime(roundIsoDateTime(t._, l.Ee, l.
|
|
2104
|
+
return isoDateTimeToString(validateIsoDateTime(roundIsoDateTime(t._, l.Ee, l.ye, a)), t.U, l.ve, n);
|
|
2131
2105
|
}
|
|
2132
2106
|
toLocaleString(e = void 0, t = void 0) {
|
|
2133
2107
|
return getInternalSlotOrThrowForPlainDateTime(this), formatDateTime(createDateTimeFormat(e, t, d), this);
|
|
@@ -2223,7 +2197,7 @@ var Ue = class {
|
|
|
2223
2197
|
const t = getInternalSlotOrThrowForPlainTime(this), o = getOptionsObject(e), n = getTemporalFractionalSecondDigitsOption(o), r = getRoundingModeOption(o, P), a = getTemporalUnitValuedOption(o, "smallestUnit", void 0);
|
|
2224
2198
|
validateTemporalUnitValue(a, s), a === B && throwRangeError(invalidField("smallestUnit"));
|
|
2225
2199
|
const i = toSecondsStringPrecisionRecord(a, n);
|
|
2226
|
-
return timeRecordToString(roundTime(t, i.Ee, i.
|
|
2200
|
+
return timeRecordToString(roundTime(t, i.Ee, i.ye, r), i.ve);
|
|
2227
2201
|
}
|
|
2228
2202
|
toLocaleString(e = void 0, t = void 0) {
|
|
2229
2203
|
return getInternalSlotOrThrowForPlainTime(this), formatDateTime(createDateTimeFormat(e, t, s), this);
|
|
@@ -2618,7 +2592,7 @@ var It = class {
|
|
|
2618
2592
|
if (n.every((e, t) => r[t] === e)) return 0;
|
|
2619
2593
|
const i = defaultTemporalLargestUnit(n), l = defaultTemporalLargestUnit(r), c = toInternalDurationRecord(n), s = toInternalDurationRecord(r);
|
|
2620
2594
|
let d, m;
|
|
2621
|
-
return a.Pe && (isDateUnit(i) || isDateUnit(l)) ? compareEpochNanoseconds(addZonedDateTime(a.Pe, c, p), addZonedDateTime(a.Pe, s, p)) : (isCalendarUnit(i) || isCalendarUnit(l) ? (a.
|
|
2595
|
+
return a.Pe && (isDateUnit(i) || isDateUnit(l)) ? compareEpochNanoseconds(addZonedDateTime(a.Pe, c, p), addZonedDateTime(a.Pe, s, p)) : (isCalendarUnit(i) || isCalendarUnit(l) ? (a.Re || throwRangeError(missingField("relativeTo")), d = dateDurationDays(c.W, a.Re), m = dateDurationDays(s.W, a.Re)) : (d = n[Q], m = r[Q]), ye(add24HourDaysToTimeDuration(c.p, d), add24HourDaysToTimeDuration(s.p, m)));
|
|
2622
2596
|
}
|
|
2623
2597
|
get years() {
|
|
2624
2598
|
return getInternalSlotOrThrowForDuration(this)[_];
|
|
@@ -2682,9 +2656,9 @@ var It = class {
|
|
|
2682
2656
|
l ??= G;
|
|
2683
2657
|
const s = defaultTemporalLargestUnit(t), m = largerOfTwoTemporalUnits(s, l), T = void 0 !== n;
|
|
2684
2658
|
if (void 0 !== n && "auto" !== n || (n = m), (!c && !T || n > l) && throwRangeError(he), isDateUnit(l) || validateTemporalRoundingIncrement(a, maximumTemporalDurationRoundingIncrement(l), !1), a > 1 && n !== l && isDateUnit(l) && throwRangeError(he), r.Pe) return createTemporalDuration(temporalDurationFromInternal(differenceZonedDateTimeWithRounding(r.Pe, createZonedDateTimeSlot(addZonedDateTime(r.Pe, toInternalDurationRecord(t), p), r.Pe.Z, r.Pe.U), n, a, l, i), isDateUnit(n) ? B : n));
|
|
2685
|
-
if (r.
|
|
2659
|
+
if (r.Re) {
|
|
2686
2660
|
const e = toInternalDurationRecordWith24HourDays(t), o = addTime(midnightTimeRecord(), e.p);
|
|
2687
|
-
return createTemporalDuration(temporalDurationFromInternal(differencePlainDateTimeWithRounding(combineIsoDateAndTimeRecord(r.
|
|
2661
|
+
return createTemporalDuration(temporalDurationFromInternal(differencePlainDateTimeWithRounding(combineIsoDateAndTimeRecord(r.Re.o, midnightTimeRecord()), combineIsoDateAndTimeRecord(calendarDateAdd(r.Re.U, r.Re.o, adjustDateDurationRecord(e.W, o.K), p), o), r.Re.U, n, a, l, i), n));
|
|
2688
2662
|
}
|
|
2689
2663
|
(isCalendarUnit(s) || isCalendarUnit(n)) && throwRangeError(missingField("relativeTo"));
|
|
2690
2664
|
const u = toInternalDurationRecordWith24HourDays(t);
|
|
@@ -2695,9 +2669,9 @@ var It = class {
|
|
|
2695
2669
|
void 0 === e && throwTypeError(Se);
|
|
2696
2670
|
const o = "string" == typeof e ? createNullPrototypeObject({ unit: e }) : getOptionsObject(e), n = getTemporalRelativeToOption(o), r = getTemporalUnitValuedOption(o, "unit", u);
|
|
2697
2671
|
if (validateTemporalUnitValue(r, d), n.Pe) return ((e, t, o) => isDateUnit(o) ? totalRelativeDuration(differenceZonedDateTime(e, t, o), e.Y, t.Y, getIsoDateTimeForZonedDateTimeSlot(e), e.Z, e.U, o) : totalTimeDuration(timeDurationFromEpochNanosecondsDifference(t.Y, e.Y), o))(n.Pe, createZonedDateTimeSlot(addZonedDateTime(n.Pe, toInternalDurationRecord(t), p), n.Pe.Z, n.Pe.U), r);
|
|
2698
|
-
if (n.
|
|
2672
|
+
if (n.Re) {
|
|
2699
2673
|
const e = toInternalDurationRecordWith24HourDays(t), o = addTime(midnightTimeRecord(), e.p);
|
|
2700
|
-
return ((e, t, o, n) => compareIsoDateTime(e, t) ? (validateIsoDateTime(e), validateIsoDateTime(t), totalRelativeDuration(differenceISODateTime(e, t, o, n), getUtcEpochNanoseconds(e), getUtcEpochNanoseconds(t), e, void 0, 0, n)) : 0)(combineIsoDateAndTimeRecord(n.
|
|
2674
|
+
return ((e, t, o, n) => compareIsoDateTime(e, t) ? (validateIsoDateTime(e), validateIsoDateTime(t), totalRelativeDuration(differenceISODateTime(e, t, o, n), getUtcEpochNanoseconds(e), getUtcEpochNanoseconds(t), e, void 0, 0, n)) : 0)(combineIsoDateAndTimeRecord(n.Re.o, midnightTimeRecord()), combineIsoDateAndTimeRecord(calendarDateAdd(n.Re.U, n.Re.o, adjustDateDurationRecord(e.W, o.K), p), o), n.Re.U, r);
|
|
2701
2675
|
}
|
|
2702
2676
|
return (isCalendarUnit(defaultTemporalLargestUnit(t)) || isCalendarUnit(r)) && throwRangeError(missingField("relativeTo")), totalTimeDuration(toInternalDurationRecordWith24HourDays(t).p, r);
|
|
2703
2677
|
}
|
|
@@ -2705,15 +2679,15 @@ var It = class {
|
|
|
2705
2679
|
const t = getInternalSlotOrThrowForDuration(this), o = getOptionsObject(e), n = getTemporalFractionalSecondDigitsOption(o), r = getRoundingModeOption(o, P), a = getTemporalUnitValuedOption(o, "smallestUnit", void 0);
|
|
2706
2680
|
validateTemporalUnitValue(a, s), a !== B && a !== q || throwRangeError(disallowedUnit(a));
|
|
2707
2681
|
const i = toSecondsStringPrecisionRecord(a, n);
|
|
2708
|
-
if (i.
|
|
2682
|
+
if (i.ye === G && 1 === i.Ee) return temporalDurationToString(t, i.ve);
|
|
2709
2683
|
const l = toInternalDurationRecord(t);
|
|
2710
|
-
return temporalDurationToString(temporalDurationFromInternal(combineDateAndTimeDuration(l.W, roundTimeDuration(l.p, i.Ee, i.
|
|
2684
|
+
return temporalDurationToString(temporalDurationFromInternal(combineDateAndTimeDuration(l.W, roundTimeDuration(l.p, i.Ee, i.ye, r)), largerOfTwoTemporalUnits(defaultTemporalLargestUnit(t), J)), i.ve);
|
|
2711
2685
|
}
|
|
2712
2686
|
toJSON() {
|
|
2713
2687
|
return temporalDurationToString(getInternalSlotOrThrowForDuration(this));
|
|
2714
2688
|
}
|
|
2715
2689
|
toLocaleString(e = void 0, t = void 0) {
|
|
2716
|
-
const o = getInternalSlotOrThrowForDuration(this), n = createNullPrototypeObject(
|
|
2690
|
+
const o = getInternalSlotOrThrowForDuration(this), n = createNullPrototypeObject();
|
|
2717
2691
|
return le.map((e, t) => {
|
|
2718
2692
|
n[e] = o[t];
|
|
2719
2693
|
}), new Intl.DurationFormat(e, t).format(n);
|
|
@@ -2728,8 +2702,8 @@ const Ot = {
|
|
|
2728
2702
|
[y]: Math.floor,
|
|
2729
2703
|
[E]: roundExpand,
|
|
2730
2704
|
[P]: Math.trunc,
|
|
2731
|
-
[
|
|
2732
|
-
[
|
|
2705
|
+
[R]: roundHalfCeil,
|
|
2706
|
+
[b]: roundHalfFloor,
|
|
2733
2707
|
[Z]: (e) => (isIntegerAndHalf(e) ? roundExpand(e) : Math.round(e)) + 0,
|
|
2734
2708
|
[N]: (e) => (isIntegerAndHalf(e) ? Math.trunc(e) : Math.round(e)) + 0,
|
|
2735
2709
|
[M]: roundHalfEven
|
|
@@ -2738,22 +2712,18 @@ const Ot = {
|
|
|
2738
2712
|
[y]: Math.floor,
|
|
2739
2713
|
[E]: Math.ceil,
|
|
2740
2714
|
[P]: Math.floor,
|
|
2741
|
-
[
|
|
2742
|
-
[
|
|
2715
|
+
[R]: roundHalfCeil,
|
|
2716
|
+
[b]: roundHalfFloor,
|
|
2743
2717
|
[Z]: roundHalfCeil,
|
|
2744
2718
|
[N]: roundHalfFloor,
|
|
2745
2719
|
[M]: roundHalfEven
|
|
2746
|
-
}, Ft = globalThis.Intl.DateTimeFormat, wt = [
|
|
2747
|
-
new Ft(void 0, new Proxy({}, { get(e, t) {
|
|
2748
|
-
wt.push(t);
|
|
2749
|
-
} }));
|
|
2750
|
-
const vt = /* @__PURE__ */ new WeakMap(), yt = [
|
|
2720
|
+
}, Ft = globalThis.Intl.DateTimeFormat, wt = /* @__PURE__ */ new WeakMap(), vt = [
|
|
2751
2721
|
"year",
|
|
2752
2722
|
"month",
|
|
2753
2723
|
"day",
|
|
2754
2724
|
"weekday",
|
|
2755
2725
|
"dateStyle"
|
|
2756
|
-
],
|
|
2726
|
+
], yt = [
|
|
2757
2727
|
"hour",
|
|
2758
2728
|
"minute",
|
|
2759
2729
|
"second",
|
|
@@ -2761,16 +2731,16 @@ const vt = /* @__PURE__ */ new WeakMap(), yt = [
|
|
|
2761
2731
|
"dayPeriod",
|
|
2762
2732
|
"timeStyle"
|
|
2763
2733
|
];
|
|
2764
|
-
var
|
|
2734
|
+
var Et = class {
|
|
2765
2735
|
Ae(e) {
|
|
2766
2736
|
return formatDateTime(this, e);
|
|
2767
2737
|
}
|
|
2768
|
-
},
|
|
2738
|
+
}, Pt = class {
|
|
2769
2739
|
constructor(e, t) {
|
|
2770
2740
|
createDateTimeFormat(e, t, d, void 0, this);
|
|
2771
2741
|
}
|
|
2772
2742
|
get format() {
|
|
2773
|
-
return Object.defineProperty(getInternalSlotOrThrowForDateTimeFormat(this).We ||=
|
|
2743
|
+
return Object.defineProperty(getInternalSlotOrThrowForDateTimeFormat(this).We ||= Et.prototype.Ae.bind(this), "name", { value: "" });
|
|
2774
2744
|
}
|
|
2775
2745
|
formatToParts(e) {
|
|
2776
2746
|
return ((e, t) => {
|
|
@@ -2795,11 +2765,13 @@ var Pt = class {
|
|
|
2795
2765
|
})(this, toDateTimeFormattable(e), toDateTimeFormattable(t));
|
|
2796
2766
|
}
|
|
2797
2767
|
resolvedOptions() {
|
|
2798
|
-
return getInternalSlotOrThrowForDateTimeFormat(this).
|
|
2768
|
+
return getInternalSlotOrThrowForDateTimeFormat(this).be.resolvedOptions();
|
|
2799
2769
|
}
|
|
2800
2770
|
};
|
|
2801
|
-
const Rt = Object.getOwnPropertyDescriptors(
|
|
2802
|
-
Rt.prototype.value = bt
|
|
2771
|
+
const Rt = Object.getOwnPropertyDescriptors(Ft), bt = Pt.prototype;
|
|
2772
|
+
Rt.prototype.value = bt;
|
|
2773
|
+
for (const e of ["formatRange", "formatRangeToParts"]) Ft.prototype[e] || delete bt[e];
|
|
2774
|
+
Object.defineProperties(DateTimeFormat, Rt), DateTimeFormat.prototype.constructor = DateTimeFormat, defineStringTag(DateTimeFormat.prototype, "Intl.DateTimeFormat");
|
|
2803
2775
|
const Zt = /* @__PURE__ */ new WeakMap();
|
|
2804
2776
|
var Nt = class {
|
|
2805
2777
|
constructor(e) {
|
|
@@ -2846,7 +2818,7 @@ var Nt = class {
|
|
|
2846
2818
|
const t = getInternalSlotOrThrowForInstant(this), o = getOptionsObject(e), n = getTemporalFractionalSecondDigitsOption(o), r = getRoundingModeOption(o, P), a = getTemporalUnitValuedOption(o, "smallestUnit", void 0), i = o.timeZone;
|
|
2847
2819
|
validateTemporalUnitValue(a, s), a === B && throwRangeError(invalidField("smallestUnit"));
|
|
2848
2820
|
const l = mapUnlessUndefined(i, toTemporalTimeZoneIdentifier), c = toSecondsStringPrecisionRecord(a, n);
|
|
2849
|
-
return temporalInstantToString(roundTemporalInstant(t.Y, c.Ee, c.
|
|
2821
|
+
return temporalInstantToString(roundTemporalInstant(t.Y, c.Ee, c.ye, r), l, c.ve);
|
|
2850
2822
|
}
|
|
2851
2823
|
toLocaleString(e = void 0, t = void 0) {
|
|
2852
2824
|
return getInternalSlotOrThrowForInstant(this), formatDateTime(createDateTimeFormat(e, t, d), this);
|