@dmsi/wedgekit-react 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classNames.js +150 -0
- package/dist/components/AccessCard.js +63 -0
- package/dist/components/AccessCardGroup.js +73 -0
- package/dist/components/AccessChangerTabItem.js +51 -0
- package/dist/components/Accordion.js +99 -0
- package/dist/components/Alert.js +78 -0
- package/dist/components/Breadcrumbs.js +111 -0
- package/dist/components/Button.js +137 -0
- package/dist/components/CalendarRange.d.ts.map +1 -1
- package/dist/components/CalendarRange.js +406 -0
- package/dist/components/Caption.js +99 -0
- package/dist/components/Card.js +50 -0
- package/dist/components/Checkbox.js +108 -0
- package/dist/components/CompactImagesPreview.d.ts.map +1 -1
- package/dist/components/CompactImagesPreview.js +121 -0
- package/dist/components/ContentTab.js +68 -0
- package/dist/components/ContentTabs.js +96 -0
- package/dist/components/DMSiLogo.js +54 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.d.ts.map +1 -1
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +28 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.d.ts.map +1 -1
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +80 -0
- package/dist/components/DataGrid/PinnedColumns.js +165 -0
- package/dist/components/DataGrid/SummaryRow/SummaryCell.js +51 -0
- package/dist/components/DataGrid/SummaryRow/aggregations.js +55 -0
- package/dist/components/DataGrid/SummaryRow/index.js +86 -0
- package/dist/components/DataGrid/TableBody/GroupRow.js +243 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.js +33 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +136 -0
- package/dist/components/DataGrid/TableBody/index.js +161 -0
- package/dist/components/DataGrid/index.js +696 -0
- package/dist/components/DataGrid/utils.js +20 -0
- package/dist/components/DataGridCell.js +412 -0
- package/dist/components/DataTable.js +700 -0
- package/dist/components/DateInput.d.ts.map +1 -1
- package/dist/components/DateInput.js +194 -0
- package/dist/components/DateRangeInput.d.ts.map +1 -1
- package/dist/components/DateRangeInput.js +369 -0
- package/dist/components/DebugJson.js +28 -0
- package/dist/components/Display.js +46 -0
- package/dist/components/EditingContext.js +34 -0
- package/dist/components/EmblaCarousel/ArrowButtons.js +83 -0
- package/dist/components/EmblaCarousel/SelectedSnapDisplay.js +12 -0
- package/dist/components/EmblaCarousel/index.d.ts.map +1 -1
- package/dist/components/EmblaCarousel/index.js +154 -0
- package/dist/components/EmblaCarousel/usePrevNextButtons.d.ts.map +1 -1
- package/dist/components/EmblaCarousel/usePrevNextButtons.js +22 -0
- package/dist/components/EmblaCarousel/useSelectedSnapDisplay.d.ts.map +1 -1
- package/dist/components/EmblaCarousel/useSelectedSnapDisplay.js +16 -0
- package/dist/components/EmptyCartIcon.js +25 -0
- package/dist/components/FilterGroup.js +198 -0
- package/dist/components/FullViewportBox.js +19 -0
- package/dist/components/Grid.js +54 -0
- package/dist/components/Heading.js +50 -0
- package/dist/components/HorizontalDivider.js +20 -0
- package/dist/components/Icon.js +73 -0
- package/dist/components/ImagePlaceholder.d.ts.map +1 -1
- package/dist/components/ImagePlaceholder.js +23 -0
- package/dist/components/Input.js +469 -0
- package/dist/components/InputGroup.js +45 -0
- package/dist/components/Label.js +37 -0
- package/dist/components/Link.js +69 -0
- package/dist/components/List.js +12 -0
- package/dist/components/ListGroup.d.ts.map +1 -1
- package/dist/components/ListGroup.js +55 -0
- package/dist/components/LiveChatComponent.js +25 -0
- package/dist/components/LoadingScrim.js +22 -0
- package/dist/components/LogoAgilityTopBar.js +90 -0
- package/dist/components/LogoDMSiTopBar.js +54 -0
- package/dist/components/LogoMillworkTopBar.js +196 -0
- package/dist/components/MainBar.js +58 -0
- package/dist/components/MaxViewportBox.js +19 -0
- package/dist/components/Menu.js +202 -0
- package/dist/components/MenuOption.js +161 -0
- package/dist/components/MobileDataGrid/ColumnList.js +85 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +101 -0
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.js +6 -0
- package/dist/components/MobileDataGrid/GridContextProvider/index.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/GridContextProvider/index.js +81 -0
- package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.js +12 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +18 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +130 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +67 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +42 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +58 -0
- package/dist/components/MobileDataGrid/dataGridReducer.js +28 -0
- package/dist/components/MobileDataGrid/index.js +78 -0
- package/dist/components/MobileNavMenu.js +173 -0
- package/dist/components/Modal.js +201 -0
- package/dist/components/ModalButtons.js +57 -0
- package/dist/components/ModalContent.js +24 -0
- package/dist/components/ModalHeader.js +74 -0
- package/dist/components/ModalScrim.js +32 -0
- package/dist/components/NavigationTab.js +72 -0
- package/dist/components/NavigationTabs.js +45 -0
- package/dist/components/NestedMenu.js +119 -0
- package/dist/components/Notification.js +91 -0
- package/dist/components/OptionPill.js +103 -0
- package/dist/components/OrderCheckIcon.js +28 -0
- package/dist/components/PDFViewer/DownloadIcon.js +25 -0
- package/dist/components/PDFViewer/PDFElement.js +77 -0
- package/dist/components/PDFViewer/PDFNavigation.js +64 -0
- package/dist/components/PDFViewer/PDFPage.js +28 -0
- package/dist/components/PDFViewer/index.js +124 -0
- package/dist/components/Pagination.js +117 -0
- package/dist/components/Paragraph.js +43 -0
- package/dist/components/Password.js +47 -0
- package/dist/components/ProductImagePreview/CarouselPagination.js +48 -0
- package/dist/components/ProductImagePreview/MobileImageCarousel.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/MobileImageCarousel.js +147 -0
- package/dist/components/ProductImagePreview/ProductPrimaryImage.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/ProductPrimaryImage.js +139 -0
- package/dist/components/ProductImagePreview/Thumbnail.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/Thumbnail.js +47 -0
- package/dist/components/ProductImagePreview/ZoomWindow.js +74 -0
- package/dist/components/ProductImagePreview/index.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/index.js +190 -0
- package/dist/components/ProductImagePreview/useProductImagePreview.d.ts.map +1 -1
- package/dist/components/ProductImagePreview/useProductImagePreview.js +86 -0
- package/dist/components/ProjectBar.js +54 -0
- package/dist/components/Radio.js +113 -0
- package/dist/components/Search.js +89 -0
- package/dist/components/SearchResultImage/index.d.ts.map +1 -1
- package/dist/components/SearchResultImage/index.js +27 -0
- package/dist/components/Select.js +122 -0
- package/dist/components/SideMenu.js +24 -0
- package/dist/components/SideMenuGroup.js +80 -0
- package/dist/components/SideMenuItem.js +79 -0
- package/dist/components/SimpleTable.js +60 -0
- package/dist/components/SkeletonParagraph.js +24 -0
- package/dist/components/Spinner.js +30 -0
- package/dist/components/Stack.js +174 -0
- package/dist/components/StatusPill.js +44 -0
- package/dist/components/Stepper.js +138 -0
- package/dist/components/Subheader.js +41 -0
- package/dist/components/Surface.js +30 -0
- package/dist/components/Swatch.js +1498 -0
- package/dist/components/Textarea.js +106 -0
- package/dist/components/Theme.js +25 -0
- package/dist/components/Time.d.ts.map +1 -1
- package/dist/components/Time.js +226 -0
- package/dist/components/Toast.js +170 -0
- package/dist/components/Tooltip.js +102 -0
- package/dist/components/TopBar.js +119 -0
- package/dist/components/Upload.js +107 -0
- package/dist/components/WorldpayIframe.js +19 -0
- package/dist/hooks/useEditCell.d.ts.map +1 -1
- package/dist/hooks/useEditCell.js +24 -0
- package/dist/hooks/useInfiniteScroll.js +25 -0
- package/dist/hooks/useKeydown.d.ts.map +1 -1
- package/dist/hooks/useKeydown.js +21 -0
- package/dist/hooks/useMatchesMedia.d.ts.map +1 -1
- package/dist/hooks/useMatchesMedia.js +16 -0
- package/dist/hooks/useMenuSystem.js +186 -0
- package/dist/hooks/useMounted.js +9 -0
- package/dist/hooks/useTableLayout/computeColumns.js +59 -0
- package/dist/hooks/useTableLayout/storage.js +64 -0
- package/dist/hooks/useTableLayout/useTableLayout.js +163 -0
- package/dist/index.js +249 -53839
- package/dist/lib/loadFonts.js +11 -0
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +56 -0
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +2299 -0
- package/dist/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +13 -0
- package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +367 -0
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +235 -0
- package/dist/node_modules/@headlessui/react/dist/components/description/description.js +45 -0
- package/dist/node_modules/@headlessui/react/dist/components/keyboard.js +4 -0
- package/dist/node_modules/@headlessui/react/dist/components/label/label.js +62 -0
- package/dist/node_modules/@headlessui/react/dist/components/switch/switch.js +56 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js +33 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-controllable.js +10 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-default-value.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-disposables.js +9 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js +9 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-latest-value.js +11 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js +12 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-slot.js +7 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +16 -0
- package/dist/node_modules/@headlessui/react/dist/internal/disabled.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/internal/form-fields.js +35 -0
- package/dist/node_modules/@headlessui/react/dist/internal/hidden.js +13 -0
- package/dist/node_modules/@headlessui/react/dist/internal/id.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/utils/bugs.js +19 -0
- package/dist/node_modules/@headlessui/react/dist/utils/class-names.js +6 -0
- package/dist/node_modules/@headlessui/react/dist/utils/disposables.js +40 -0
- package/dist/node_modules/@headlessui/react/dist/utils/dom.js +34 -0
- package/dist/node_modules/@headlessui/react/dist/utils/env.js +34 -0
- package/dist/node_modules/@headlessui/react/dist/utils/form.js +32 -0
- package/dist/node_modules/@headlessui/react/dist/utils/match.js +11 -0
- package/dist/node_modules/@headlessui/react/dist/utils/micro-task.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/utils/owner.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/utils/render.js +126 -0
- package/dist/node_modules/@js-temporal/polyfill/dist/index.esm.js +3913 -0
- package/dist/node_modules/@mikecousins/react-pdf/dist/index.js +83 -0
- package/dist/node_modules/@react-aria/focus/dist/useFocusRing.js +38 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocus.js +31 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.js +99 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.js +59 -0
- package/dist/node_modules/@react-aria/interactions/dist/useHover.js +86 -0
- package/dist/node_modules/@react-aria/interactions/dist/utils.js +68 -0
- package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.js +32 -0
- package/dist/node_modules/@react-aria/utils/dist/domHelpers.js +15 -0
- package/dist/node_modules/@react-aria/utils/dist/focusWithoutScrolling.js +45 -0
- package/dist/node_modules/@react-aria/utils/dist/isVirtualEvent.js +7 -0
- package/dist/node_modules/@react-aria/utils/dist/openLink.js +28 -0
- package/dist/node_modules/@react-aria/utils/dist/platform.js +47 -0
- package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.js +34 -0
- package/dist/node_modules/@react-aria/utils/dist/useLayoutEffect.js +6 -0
- package/dist/node_modules/@react-stately/flags/dist/import.js +7 -0
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js +94 -0
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +38 -0
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1954 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +575 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +52 -0
- package/dist/node_modules/clsx/dist/clsx.js +17 -0
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1204 -0
- package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js +126 -0
- package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +24 -0
- package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +35 -0
- package/dist/node_modules/jsbi/dist/jsbi.js +1040 -0
- package/dist/node_modules/react-use/esm/usePrevious.js +10 -0
- package/dist/static/no-results-image.png.js +4 -0
- package/dist/utils/date-patch-dashes.js +28 -0
- package/dist/utils/date.js +95 -0
- package/dist/utils/formatting.js +22 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +4 -0
- package/dist/utils/mergeObjectArrays.js +18 -0
- package/dist/utils.js +20 -0
- package/package.json +1 -1
- /package/dist/{pdf-l6QfMa5e.js → node_modules/pdfjs-dist/build/pdf.js} +0 -0
|
@@ -0,0 +1,3913 @@
|
|
|
1
|
+
import y from "../../../jsbi/dist/jsbi.js";
|
|
2
|
+
const ke = y.BigInt(0), $n = y.BigInt(1), Xr = y.BigInt(2), ai = y.BigInt(10), ii = y.BigInt(24), si = y.BigInt(60), ci = y.BigInt(1e3), Un = y.BigInt(1e6), En = y.BigInt(1e9), Xo = y.multiply(y.BigInt(3600), En), di = y.multiply(si, En), bt = y.multiply(Xo, ii);
|
|
3
|
+
function nt(t) {
|
|
4
|
+
return typeof t == "bigint" ? y.BigInt(t.toString(10)) : t;
|
|
5
|
+
}
|
|
6
|
+
function Qo(t) {
|
|
7
|
+
return y.equal(y.remainder(t, Xr), ke);
|
|
8
|
+
}
|
|
9
|
+
function It(t) {
|
|
10
|
+
return y.lessThan(t, ke) ? y.unaryMinus(t) : t;
|
|
11
|
+
}
|
|
12
|
+
function tr(t, e) {
|
|
13
|
+
return y.lessThan(t, e) ? -1 : y.greaterThan(t, e) ? 1 : 0;
|
|
14
|
+
}
|
|
15
|
+
function mn(t, e) {
|
|
16
|
+
return { quotient: y.divide(t, e), remainder: y.remainder(t, e) };
|
|
17
|
+
}
|
|
18
|
+
var wo, vo;
|
|
19
|
+
const I = "slot-epochNanoSeconds", C = "slot-iso-date", P = "slot-iso-date-time", z = "slot-time", b = "slot-calendar", ea = "slot-date-brand", ta = "slot-year-month-brand", na = "slot-month-day-brand", x = "slot-time-zone", de = "slot-years", he = "slot-months", Te = "slot-weeks", ue = "slot-days", le = "slot-hours", me = "slot-minutes", fe = "slot-seconds", ye = "slot-milliseconds", ge = "slot-microseconds", Ie = "slot-nanoseconds", ra = "date", oa = "ym", aa = "md", ia = "time", sa = "datetime", ca = "instant", xt = "original", At = "timezone-canonical", kr = "timezone-original", fn = "calendar-id", da = "locale", Nr = "options", ha = /* @__PURE__ */ new WeakMap(), jr = /* @__PURE__ */ Symbol.for("@@Temporal__GetSlots");
|
|
20
|
+
(wo = globalThis)[jr] || (wo[jr] = function(t) {
|
|
21
|
+
return ha.get(t);
|
|
22
|
+
});
|
|
23
|
+
const mr = globalThis[jr], xr = /* @__PURE__ */ Symbol.for("@@Temporal__CreateSlots");
|
|
24
|
+
(vo = globalThis)[xr] || (vo[xr] = function(t) {
|
|
25
|
+
ha.set(t, /* @__PURE__ */ Object.create(null));
|
|
26
|
+
});
|
|
27
|
+
const lt = globalThis[xr];
|
|
28
|
+
function Ee(t, ...e) {
|
|
29
|
+
if (!t || typeof t != "object") return !1;
|
|
30
|
+
const n = mr(t);
|
|
31
|
+
return !!n && e.every(((r) => r in n));
|
|
32
|
+
}
|
|
33
|
+
function c(t, e) {
|
|
34
|
+
const n = mr(t)?.[e];
|
|
35
|
+
if (n === void 0) throw new TypeError(`Missing internal slot ${e}`);
|
|
36
|
+
return n;
|
|
37
|
+
}
|
|
38
|
+
function R(t, e, n) {
|
|
39
|
+
const r = mr(t);
|
|
40
|
+
if (r === void 0) throw new TypeError("Missing slots for the given container");
|
|
41
|
+
if (r[e]) throw new TypeError(`${e} already has set`);
|
|
42
|
+
r[e] = n;
|
|
43
|
+
}
|
|
44
|
+
const Lr = {};
|
|
45
|
+
function mt(t, e) {
|
|
46
|
+
Object.defineProperty(t.prototype, Symbol.toStringTag, { value: e, writable: !1, enumerable: !1, configurable: !0 });
|
|
47
|
+
const n = Object.getOwnPropertyNames(t);
|
|
48
|
+
for (let o = 0; o < n.length; o++) {
|
|
49
|
+
const a = n[o], i = Object.getOwnPropertyDescriptor(t, a);
|
|
50
|
+
i.configurable && i.enumerable && (i.enumerable = !1, Object.defineProperty(t, a, i));
|
|
51
|
+
}
|
|
52
|
+
const r = Object.getOwnPropertyNames(t.prototype);
|
|
53
|
+
for (let o = 0; o < r.length; o++) {
|
|
54
|
+
const a = r[o], i = Object.getOwnPropertyDescriptor(t.prototype, a);
|
|
55
|
+
i.configurable && i.enumerable && (i.enumerable = !1, Object.defineProperty(t.prototype, a, i));
|
|
56
|
+
}
|
|
57
|
+
Ur(e, t), Ur(`${e}.prototype`, t.prototype);
|
|
58
|
+
}
|
|
59
|
+
function Ur(t, e) {
|
|
60
|
+
const n = `%${t}%`;
|
|
61
|
+
if (Lr[n] !== void 0) throw new Error(`intrinsic ${t} already exists`);
|
|
62
|
+
Lr[n] = e;
|
|
63
|
+
}
|
|
64
|
+
function te(t) {
|
|
65
|
+
return Lr[t];
|
|
66
|
+
}
|
|
67
|
+
function Wt(t, e) {
|
|
68
|
+
let n = t;
|
|
69
|
+
if (n === 0) return { div: n, mod: n };
|
|
70
|
+
const r = Math.sign(n);
|
|
71
|
+
n = Math.abs(n);
|
|
72
|
+
const o = Math.trunc(1 + Math.log10(n));
|
|
73
|
+
if (e >= o) return { div: 0 * r, mod: r * n };
|
|
74
|
+
if (e === 0) return { div: r * n, mod: 0 * r };
|
|
75
|
+
const a = n.toPrecision(o);
|
|
76
|
+
return { div: r * Number.parseInt(a.slice(0, o - e), 10), mod: r * Number.parseInt(a.slice(o - e), 10) };
|
|
77
|
+
}
|
|
78
|
+
function $r(t, e, n) {
|
|
79
|
+
let r = t, o = n;
|
|
80
|
+
if (r === 0) return o;
|
|
81
|
+
const a = Math.sign(r) || Math.sign(o);
|
|
82
|
+
r = Math.abs(r), o = Math.abs(o);
|
|
83
|
+
const i = r.toPrecision(Math.trunc(1 + Math.log10(r)));
|
|
84
|
+
if (o === 0) return a * Number.parseInt(i + "0".repeat(e), 10);
|
|
85
|
+
const s = i + o.toPrecision(Math.trunc(1 + Math.log10(o))).padStart(e, "0");
|
|
86
|
+
return a * Number.parseInt(s, 10);
|
|
87
|
+
}
|
|
88
|
+
function fr(t, e) {
|
|
89
|
+
const n = e === "negative";
|
|
90
|
+
switch (t) {
|
|
91
|
+
case "ceil":
|
|
92
|
+
return n ? "zero" : "infinity";
|
|
93
|
+
case "floor":
|
|
94
|
+
return n ? "infinity" : "zero";
|
|
95
|
+
case "expand":
|
|
96
|
+
return "infinity";
|
|
97
|
+
case "trunc":
|
|
98
|
+
return "zero";
|
|
99
|
+
case "halfCeil":
|
|
100
|
+
return n ? "half-zero" : "half-infinity";
|
|
101
|
+
case "halfFloor":
|
|
102
|
+
return n ? "half-infinity" : "half-zero";
|
|
103
|
+
case "halfExpand":
|
|
104
|
+
return "half-infinity";
|
|
105
|
+
case "halfTrunc":
|
|
106
|
+
return "half-zero";
|
|
107
|
+
case "halfEven":
|
|
108
|
+
return "half-even";
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function yr(t, e, n, r, o) {
|
|
112
|
+
return o === "zero" ? t : o === "infinity" ? e : n < 0 ? t : n > 0 ? e : o === "half-zero" ? t : o === "half-infinity" ? e : r ? t : e;
|
|
113
|
+
}
|
|
114
|
+
class k {
|
|
115
|
+
constructor(e) {
|
|
116
|
+
this.totalNs = nt(e), this.sec = y.toNumber(y.divide(this.totalNs, En)), this.subsec = y.toNumber(y.remainder(this.totalNs, En));
|
|
117
|
+
}
|
|
118
|
+
static validateNew(e, n) {
|
|
119
|
+
if (y.greaterThan(It(e), k.MAX)) throw new RangeError(`${n} of duration time units cannot exceed ${k.MAX} s`);
|
|
120
|
+
return new k(e);
|
|
121
|
+
}
|
|
122
|
+
static fromEpochNsDiff(e, n) {
|
|
123
|
+
const r = y.subtract(nt(e), nt(n));
|
|
124
|
+
return new k(r);
|
|
125
|
+
}
|
|
126
|
+
static fromComponents(e, n, r, o, a, i) {
|
|
127
|
+
const s = y.add(y.add(y.add(y.add(y.add(y.BigInt(i), y.multiply(y.BigInt(a), ci)), y.multiply(y.BigInt(o), Un)), y.multiply(y.BigInt(r), En)), y.multiply(y.BigInt(n), di)), y.multiply(y.BigInt(e), Xo));
|
|
128
|
+
return k.validateNew(s, "total");
|
|
129
|
+
}
|
|
130
|
+
abs() {
|
|
131
|
+
return new k(It(this.totalNs));
|
|
132
|
+
}
|
|
133
|
+
add(e) {
|
|
134
|
+
return k.validateNew(y.add(this.totalNs, e.totalNs), "sum");
|
|
135
|
+
}
|
|
136
|
+
add24HourDays(e) {
|
|
137
|
+
return k.validateNew(y.add(this.totalNs, y.multiply(y.BigInt(e), bt)), "sum");
|
|
138
|
+
}
|
|
139
|
+
addToEpochNs(e) {
|
|
140
|
+
return y.add(nt(e), this.totalNs);
|
|
141
|
+
}
|
|
142
|
+
cmp(e) {
|
|
143
|
+
return tr(this.totalNs, e.totalNs);
|
|
144
|
+
}
|
|
145
|
+
divmod(e) {
|
|
146
|
+
const { quotient: n, remainder: r } = mn(this.totalNs, y.BigInt(e));
|
|
147
|
+
return { quotient: y.toNumber(n), remainder: new k(r) };
|
|
148
|
+
}
|
|
149
|
+
fdiv(e) {
|
|
150
|
+
const n = nt(e), r = y.BigInt(n);
|
|
151
|
+
let { quotient: o, remainder: a } = mn(this.totalNs, r);
|
|
152
|
+
const i = [];
|
|
153
|
+
let s;
|
|
154
|
+
const h = (y.lessThan(this.totalNs, ke) ? -1 : 1) * Math.sign(y.toNumber(n));
|
|
155
|
+
for (; !y.equal(a, ke) && i.length < 50; ) a = y.multiply(a, ai), { quotient: s, remainder: a } = mn(a, r), i.push(Math.abs(y.toNumber(s)));
|
|
156
|
+
return h * +(It(o).toString() + "." + i.join(""));
|
|
157
|
+
}
|
|
158
|
+
isZero() {
|
|
159
|
+
return y.equal(this.totalNs, ke);
|
|
160
|
+
}
|
|
161
|
+
round(e, n) {
|
|
162
|
+
const r = nt(e);
|
|
163
|
+
if (y.equal(r, $n)) return this;
|
|
164
|
+
const { quotient: o, remainder: a } = mn(this.totalNs, r), i = y.lessThan(this.totalNs, ke) ? "negative" : "positive", s = y.multiply(It(o), r), h = y.add(s, r), d = tr(It(y.multiply(a, Xr)), r), u = fr(n, i), l = y.equal(It(this.totalNs), s) ? s : yr(s, h, d, Qo(o), u), m = i === "positive" ? l : y.unaryMinus(l);
|
|
165
|
+
return k.validateNew(m, "rounding");
|
|
166
|
+
}
|
|
167
|
+
sign() {
|
|
168
|
+
return this.cmp(new k(ke));
|
|
169
|
+
}
|
|
170
|
+
subtract(e) {
|
|
171
|
+
return k.validateNew(y.subtract(this.totalNs, e.totalNs), "difference");
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
k.MAX = y.BigInt("9007199254740991999999999"), k.ZERO = new k(ke);
|
|
175
|
+
const bo = /[A-Za-z._][A-Za-z._0-9+-]*/, Pn = new RegExp(`(?:${/(?:[+-](?:[01][0-9]|2[0-3])(?::?[0-5][0-9])?)/.source}|(?:${bo.source})(?:\\/(?:${bo.source}))*)`), ua = /(?:[+-]\d{6}|\d{4})/, nr = /(?:0[1-9]|1[0-2])/, Pr = /(?:0[1-9]|[12]\d|3[01])/, hi = new RegExp(`(${ua.source})(?:-(${nr.source})-(${Pr.source})|(${nr.source})(${Pr.source}))`), la = /(\d{2})(?::(\d{2})(?::(\d{2})(?:[.,](\d{1,9}))?)?|(\d{2})(?:(\d{2})(?:[.,](\d{1,9}))?)?)?/, ma = /((?:[+-])(?:[01][0-9]|2[0-3])(?::?(?:[0-5][0-9])(?::?(?:[0-5][0-9])(?:[.,](?:\d{1,9}))?)?)?)/, fa = new RegExp(`([zZ])|${ma.source}?`), Gt = /\[(!)?([a-z_][a-z0-9_-]*)=([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)\]/g, ui = new RegExp([`^${hi.source}`, `(?:(?:[tT]|\\s+)${la.source}(?:${fa.source})?)?`, `(?:\\[!?(${Pn.source})\\])?`, `((?:${Gt.source})*)$`].join("")), li = new RegExp([`^[tT]?${la.source}`, `(?:${fa.source})?`, `(?:\\[!?${Pn.source}\\])?`, `((?:${Gt.source})*)$`].join("")), mi = new RegExp(`^(${ua.source})-?(${nr.source})(?:\\[!?${Pn.source}\\])?((?:${Gt.source})*)$`), fi = new RegExp(`^(?:--)?(${nr.source})-?(${Pr.source})(?:\\[!?${Pn.source}\\])?((?:${Gt.source})*)$`), Or = /(\d+)(?:[.,](\d{1,9}))?/, yi = new RegExp(`(?:${Or.source}H)?(?:${Or.source}M)?(?:${Or.source}S)?`), gi = new RegExp(`^([+-])?P${/(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/.source}(?:T(?!$)${yi.source})?$`, "i"), Et = 864e5, rr = 1e6 * Et, pi = 6e10, ya = 1e8 * Et, Kt = Ge(ya), On = y.unaryMinus(Kt), wi = y.add(y.subtract(On, bt), $n), vi = y.subtract(y.add(Kt, bt), $n), bi = 146097 * Et, Eo = -271821, Mo = 275760, Mn = Date.UTC(1847, 0, 1), Ei = ["iso8601", "hebrew", "islamic", "islamic-umalqura", "islamic-tbla", "islamic-civil", "islamic-rgsa", "islamicc", "persian", "ethiopic", "ethioaa", "ethiopic-amete-alem", "coptic", "chinese", "dangi", "roc", "indian", "buddhist", "japanese", "gregory"], Mi = /* @__PURE__ */ new Set(["ACT", "AET", "AGT", "ART", "AST", "BET", "BST", "CAT", "CNT", "CST", "CTT", "EAT", "ECT", "IET", "IST", "JST", "MIT", "NET", "NST", "PLT", "PNT", "PRT", "PST", "SST", "VST"]);
|
|
176
|
+
function A(t) {
|
|
177
|
+
return typeof t == "object" && t !== null || typeof t == "function";
|
|
178
|
+
}
|
|
179
|
+
function gr(t) {
|
|
180
|
+
if (typeof t == "bigint") throw new TypeError("Cannot convert BigInt to number");
|
|
181
|
+
return Number(t);
|
|
182
|
+
}
|
|
183
|
+
function pr(t) {
|
|
184
|
+
if (typeof t == "symbol") throw new TypeError("Cannot convert a Symbol value to a String");
|
|
185
|
+
return String(t);
|
|
186
|
+
}
|
|
187
|
+
function $(t) {
|
|
188
|
+
const e = gr(t);
|
|
189
|
+
if (e === 0) return 0;
|
|
190
|
+
if (Number.isNaN(e) || e === 1 / 0 || e === -1 / 0) throw new RangeError("invalid number value");
|
|
191
|
+
const n = Math.trunc(e);
|
|
192
|
+
return n === 0 ? 0 : n;
|
|
193
|
+
}
|
|
194
|
+
function Do(t, e) {
|
|
195
|
+
const n = $(t);
|
|
196
|
+
if (n <= 0)
|
|
197
|
+
throw e !== void 0 ? new RangeError(`property '${e}' cannot be a a number less than one`) : new RangeError("Cannot convert a number less than one to a positive integer");
|
|
198
|
+
return n;
|
|
199
|
+
}
|
|
200
|
+
function ze(t) {
|
|
201
|
+
const e = gr(t);
|
|
202
|
+
if (Number.isNaN(e)) throw new RangeError("not a number");
|
|
203
|
+
if (e === 1 / 0 || e === -1 / 0) throw new RangeError("infinity is out of range");
|
|
204
|
+
if (!(function(n) {
|
|
205
|
+
if (typeof n != "number" || Number.isNaN(n) || n === 1 / 0 || n === -1 / 0) return !1;
|
|
206
|
+
const r = Math.abs(n);
|
|
207
|
+
return Math.floor(r) === r;
|
|
208
|
+
})(e)) throw new RangeError(`unsupported fractional value ${t}`);
|
|
209
|
+
return e === 0 ? 0 : e;
|
|
210
|
+
}
|
|
211
|
+
function Yn(t, e) {
|
|
212
|
+
return String(t).padStart(e, "0");
|
|
213
|
+
}
|
|
214
|
+
function _(t) {
|
|
215
|
+
if (typeof t != "string") throw new TypeError(`expected a string, not ${String(t)}`);
|
|
216
|
+
return t;
|
|
217
|
+
}
|
|
218
|
+
function Zr(t, e) {
|
|
219
|
+
if (A(t)) {
|
|
220
|
+
const n = t?.toString();
|
|
221
|
+
if (typeof n == "string" || typeof n == "number") return n;
|
|
222
|
+
throw new TypeError("Cannot convert object to primitive value");
|
|
223
|
+
}
|
|
224
|
+
return t;
|
|
225
|
+
}
|
|
226
|
+
const Fr = ["era", "eraYear", "year", "month", "monthCode", "day", "hour", "minute", "second", "millisecond", "microsecond", "nanosecond", "offset", "timeZone"], Di = { era: pr, eraYear: $, year: $, month: Do, monthCode: function(t) {
|
|
227
|
+
const e = _(Zr(t));
|
|
228
|
+
if (e.length < 3 || e.length > 4 || e[0] !== "M" || "0123456789".indexOf(e[1]) === -1 || "0123456789".indexOf(e[2]) === -1 || e[1] + e[2] === "00" && e[3] !== "L" || e[3] !== "L" && e[3] !== void 0) throw new RangeError(`bad month code ${e}; must match M01-M99 or M00L-M99L`);
|
|
229
|
+
return e;
|
|
230
|
+
}, day: Do, hour: $, minute: $, second: $, millisecond: $, microsecond: $, nanosecond: $, offset: function(t) {
|
|
231
|
+
const e = _(Zr(t));
|
|
232
|
+
return sn(e), e;
|
|
233
|
+
}, timeZone: ve }, Ti = { hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 }, Vt = [["years", "year", "date"], ["months", "month", "date"], ["weeks", "week", "date"], ["days", "day", "date"], ["hours", "hour", "time"], ["minutes", "minute", "time"], ["seconds", "second", "time"], ["milliseconds", "millisecond", "time"], ["microseconds", "microsecond", "time"], ["nanoseconds", "nanosecond", "time"]], To = Object.fromEntries(Vt.map(((t) => [t[0], t[1]]))), Ii = Object.fromEntries(Vt.map((([t, e]) => [e, t]))), Dn = Vt.map((([, t]) => t)), Xt = { day: rr, hour: 36e11, minute: 6e10, second: 1e9, millisecond: 1e6, microsecond: 1e3, nanosecond: 1 }, or = ["days", "hours", "microseconds", "milliseconds", "minutes", "months", "nanoseconds", "seconds", "weeks", "years"], Ci = Intl.DateTimeFormat, Io = /* @__PURE__ */ new Map();
|
|
234
|
+
function ga(t) {
|
|
235
|
+
const e = jn(t);
|
|
236
|
+
let n = Io.get(e);
|
|
237
|
+
return n === void 0 && (n = new Ci("en-us", { timeZone: e, hour12: !1, era: "short", year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }), Io.set(e, n)), n;
|
|
238
|
+
}
|
|
239
|
+
function X(t) {
|
|
240
|
+
return Ee(t, I) && !Ee(t, x, b);
|
|
241
|
+
}
|
|
242
|
+
function F(t) {
|
|
243
|
+
return Ee(t, de, he, ue, le, me, fe, ye, ge, Ie);
|
|
244
|
+
}
|
|
245
|
+
function B(t) {
|
|
246
|
+
return Ee(t, ea);
|
|
247
|
+
}
|
|
248
|
+
function q(t) {
|
|
249
|
+
return Ee(t, z);
|
|
250
|
+
}
|
|
251
|
+
function L(t) {
|
|
252
|
+
return Ee(t, P);
|
|
253
|
+
}
|
|
254
|
+
function Q(t) {
|
|
255
|
+
return Ee(t, ta);
|
|
256
|
+
}
|
|
257
|
+
function Se(t) {
|
|
258
|
+
return Ee(t, na);
|
|
259
|
+
}
|
|
260
|
+
function S(t) {
|
|
261
|
+
return Ee(t, I, x, b);
|
|
262
|
+
}
|
|
263
|
+
function g(t, e) {
|
|
264
|
+
if (!e(t)) throw new TypeError("invalid receiver: method called with the wrong type of this-object");
|
|
265
|
+
}
|
|
266
|
+
function rn(t) {
|
|
267
|
+
if (Ee(t, b) || Ee(t, x)) throw new TypeError("with() does not support a calendar or timeZone property");
|
|
268
|
+
if (q(t)) throw new TypeError("with() does not accept Temporal.PlainTime, use withPlainTime() instead");
|
|
269
|
+
if (t.calendar !== void 0) throw new TypeError("with() does not support a calendar property");
|
|
270
|
+
if (t.timeZone !== void 0) throw new TypeError("with() does not support a timeZone property");
|
|
271
|
+
}
|
|
272
|
+
function Zn(t, e) {
|
|
273
|
+
return e === "never" || e === "auto" && t === "iso8601" ? "" : `[${e === "critical" ? "!" : ""}u-ca=${t}]`;
|
|
274
|
+
}
|
|
275
|
+
function wr(t) {
|
|
276
|
+
let e, n, r = !1;
|
|
277
|
+
for (Gt.lastIndex = 0; n = Gt.exec(t); ) {
|
|
278
|
+
const { 1: o, 2: a, 3: i } = n;
|
|
279
|
+
if (a === "u-ca") {
|
|
280
|
+
if (e === void 0) e = i, r = o === "!";
|
|
281
|
+
else if (o === "!" || r) throw new RangeError(`Invalid annotations in ${t}: more than one u-ca present with critical flag`);
|
|
282
|
+
} else if (o === "!") throw new RangeError(`Unrecognized annotation: !${a}=${i}`);
|
|
283
|
+
}
|
|
284
|
+
return e;
|
|
285
|
+
}
|
|
286
|
+
function et(t) {
|
|
287
|
+
const e = ui.exec(t);
|
|
288
|
+
if (!e) throw new RangeError(`invalid RFC 9557 string: ${t}`);
|
|
289
|
+
const n = wr(e[16]);
|
|
290
|
+
let r = e[1];
|
|
291
|
+
if (r === "-000000") throw new RangeError(`invalid RFC 9557 string: ${t}`);
|
|
292
|
+
const o = +r, a = +(e[2] ?? e[4] ?? 1), i = +(e[3] ?? e[5] ?? 1), s = e[6] !== void 0, h = +(e[6] ?? 0), d = +(e[7] ?? e[10] ?? 0);
|
|
293
|
+
let u = +(e[8] ?? e[11] ?? 0);
|
|
294
|
+
u === 60 && (u = 59);
|
|
295
|
+
const l = (e[9] ?? e[12] ?? "") + "000000000", m = +l.slice(0, 3), f = +l.slice(3, 6), p = +l.slice(6, 9);
|
|
296
|
+
let v, w = !1;
|
|
297
|
+
e[13] ? (v = void 0, w = !0) : e[14] && (v = e[14]);
|
|
298
|
+
const E = e[15];
|
|
299
|
+
return oo(o, a, i, h, d, u, m, f, p), { year: o, month: a, day: i, time: s ? { hour: h, minute: d, second: u, millisecond: m, microsecond: f, nanosecond: p } : "start-of-day", tzAnnotation: E, offset: v, z: w, calendar: n };
|
|
300
|
+
}
|
|
301
|
+
function pa(t) {
|
|
302
|
+
const e = li.exec(t);
|
|
303
|
+
let n, r, o, a, i, s, h;
|
|
304
|
+
if (e) {
|
|
305
|
+
h = wr(e[10]), n = +(e[1] ?? 0), r = +(e[2] ?? e[5] ?? 0), o = +(e[3] ?? e[6] ?? 0), o === 60 && (o = 59);
|
|
306
|
+
const d = (e[4] ?? e[7] ?? "") + "000000000";
|
|
307
|
+
if (a = +d.slice(0, 3), i = +d.slice(3, 6), s = +d.slice(6, 9), e[8]) throw new RangeError("Z designator not supported for PlainTime");
|
|
308
|
+
} else {
|
|
309
|
+
let d, u;
|
|
310
|
+
if ({ time: d, z: u, calendar: h } = et(t), d === "start-of-day") throw new RangeError(`time is missing in string: ${t}`);
|
|
311
|
+
if (u) throw new RangeError("Z designator not supported for PlainTime");
|
|
312
|
+
({ hour: n, minute: r, second: o, millisecond: a, microsecond: i, nanosecond: s } = d);
|
|
313
|
+
}
|
|
314
|
+
if (Mr(n, r, o, a, i, s), /[tT ][0-9][0-9]/.test(t)) return { hour: n, minute: r, second: o, millisecond: a, microsecond: i, nanosecond: s, calendar: h };
|
|
315
|
+
try {
|
|
316
|
+
const { month: d, day: u } = eo(t);
|
|
317
|
+
Rt(1972, d, u);
|
|
318
|
+
} catch {
|
|
319
|
+
try {
|
|
320
|
+
const { year: d, month: u } = Qr(t);
|
|
321
|
+
Rt(d, u, 1);
|
|
322
|
+
} catch {
|
|
323
|
+
return { hour: n, minute: r, second: o, millisecond: a, microsecond: i, nanosecond: s, calendar: h };
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
throw new RangeError(`invalid RFC 9557 time-only string ${t}; may need a T prefix`);
|
|
327
|
+
}
|
|
328
|
+
function Qr(t) {
|
|
329
|
+
const e = mi.exec(t);
|
|
330
|
+
let n, r, o, a;
|
|
331
|
+
if (e) {
|
|
332
|
+
o = wr(e[3]);
|
|
333
|
+
let i = e[1];
|
|
334
|
+
if (i === "-000000") throw new RangeError(`invalid RFC 9557 string: ${t}`);
|
|
335
|
+
if (n = +i, r = +e[2], a = 1, o !== void 0 && o !== "iso8601") throw new RangeError("YYYY-MM format is only valid with iso8601 calendar");
|
|
336
|
+
} else {
|
|
337
|
+
let i;
|
|
338
|
+
if ({ year: n, month: r, calendar: o, day: a, z: i } = et(t), i) throw new RangeError("Z designator not supported for PlainYearMonth");
|
|
339
|
+
}
|
|
340
|
+
return { year: n, month: r, calendar: o, referenceISODay: a };
|
|
341
|
+
}
|
|
342
|
+
function eo(t) {
|
|
343
|
+
const e = fi.exec(t);
|
|
344
|
+
let n, r, o, a;
|
|
345
|
+
if (e) {
|
|
346
|
+
if (o = wr(e[3]), n = +e[1], r = +e[2], o !== void 0 && o !== "iso8601") throw new RangeError("MM-DD format is only valid with iso8601 calendar");
|
|
347
|
+
} else {
|
|
348
|
+
let i;
|
|
349
|
+
if ({ month: n, day: r, calendar: o, year: a, z: i } = et(t), i) throw new RangeError("Z designator not supported for PlainMonthDay");
|
|
350
|
+
}
|
|
351
|
+
return { month: n, day: r, calendar: o, referenceISOYear: a };
|
|
352
|
+
}
|
|
353
|
+
const wa = new RegExp(`^${Pn.source}$`, "i"), va = new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])?)?/.source}$`);
|
|
354
|
+
function ba(t) {
|
|
355
|
+
const e = Oi.test(t) ? "Seconds not allowed in offset time zone" : "Invalid time zone";
|
|
356
|
+
throw new RangeError(`${e}: ${t}`);
|
|
357
|
+
}
|
|
358
|
+
function vt(t) {
|
|
359
|
+
return wa.test(t) || ba(t), va.test(t) ? { offsetMinutes: sn(t) / 6e10 } : { tzName: t };
|
|
360
|
+
}
|
|
361
|
+
function Tn(t, e, n, r) {
|
|
362
|
+
let o = t, a = e, i = n;
|
|
363
|
+
switch (r) {
|
|
364
|
+
case "reject":
|
|
365
|
+
Rt(o, a, i);
|
|
366
|
+
break;
|
|
367
|
+
case "constrain":
|
|
368
|
+
({ year: o, month: a, day: i } = Ua(o, a, i));
|
|
369
|
+
}
|
|
370
|
+
return { year: o, month: a, day: i };
|
|
371
|
+
}
|
|
372
|
+
function vr(t, e, n, r, o, a, i) {
|
|
373
|
+
let s = t, h = e, d = n, u = r, l = o, m = a;
|
|
374
|
+
switch (i) {
|
|
375
|
+
case "reject":
|
|
376
|
+
Mr(s, h, d, u, l, m);
|
|
377
|
+
break;
|
|
378
|
+
case "constrain":
|
|
379
|
+
s = pe(s, 0, 23), h = pe(h, 0, 59), d = pe(d, 0, 59), u = pe(u, 0, 999), l = pe(l, 0, 999), m = pe(m, 0, 999);
|
|
380
|
+
}
|
|
381
|
+
return { hour: s, minute: h, second: d, millisecond: u, microsecond: l, nanosecond: m };
|
|
382
|
+
}
|
|
383
|
+
function Ea(t) {
|
|
384
|
+
if (!A(t)) throw new TypeError("invalid duration-like");
|
|
385
|
+
const e = { years: void 0, months: void 0, weeks: void 0, days: void 0, hours: void 0, minutes: void 0, seconds: void 0, milliseconds: void 0, microseconds: void 0, nanoseconds: void 0 };
|
|
386
|
+
let n = !1;
|
|
387
|
+
for (let r = 0; r < or.length; r++) {
|
|
388
|
+
const o = or[r], a = t[o];
|
|
389
|
+
a !== void 0 && (n = !0, e[o] = ze(a));
|
|
390
|
+
}
|
|
391
|
+
if (!n) throw new TypeError("invalid duration-like");
|
|
392
|
+
return e;
|
|
393
|
+
}
|
|
394
|
+
function re({ years: t, months: e, weeks: n, days: r }, o, a, i) {
|
|
395
|
+
return { years: t, months: i ?? e, weeks: a ?? n, days: o ?? r };
|
|
396
|
+
}
|
|
397
|
+
function j(t, e) {
|
|
398
|
+
return { isoDate: t, time: e };
|
|
399
|
+
}
|
|
400
|
+
function N(t) {
|
|
401
|
+
return dt(t, "overflow", ["constrain", "reject"], "constrain");
|
|
402
|
+
}
|
|
403
|
+
function In(t) {
|
|
404
|
+
return dt(t, "disambiguation", ["compatible", "earlier", "later", "reject"], "compatible");
|
|
405
|
+
}
|
|
406
|
+
function Ae(t, e) {
|
|
407
|
+
return dt(t, "roundingMode", ["ceil", "floor", "expand", "trunc", "halfCeil", "halfFloor", "halfExpand", "halfTrunc", "halfEven"], e);
|
|
408
|
+
}
|
|
409
|
+
function er(t, e) {
|
|
410
|
+
return dt(t, "offset", ["prefer", "use", "ignore", "reject"], e);
|
|
411
|
+
}
|
|
412
|
+
function Fn(t) {
|
|
413
|
+
return dt(t, "calendarName", ["auto", "always", "never", "critical"], "auto");
|
|
414
|
+
}
|
|
415
|
+
function on(t) {
|
|
416
|
+
let e = t.roundingIncrement;
|
|
417
|
+
if (e === void 0) return 1;
|
|
418
|
+
const n = $(e);
|
|
419
|
+
if (n < 1 || n > 1e9) throw new RangeError(`roundingIncrement must be at least 1 and at most 1e9, not ${e}`);
|
|
420
|
+
return n;
|
|
421
|
+
}
|
|
422
|
+
function an(t, e, n) {
|
|
423
|
+
const r = n ? e : e - 1;
|
|
424
|
+
if (t > r) throw new RangeError(`roundingIncrement must be at least 1 and less than ${r}, not ${t}`);
|
|
425
|
+
if (e % t != 0) throw new RangeError(`Rounding increment must divide evenly into ${e}`);
|
|
426
|
+
}
|
|
427
|
+
function Bn(t) {
|
|
428
|
+
const e = t.fractionalSecondDigits;
|
|
429
|
+
if (e === void 0) return "auto";
|
|
430
|
+
if (typeof e != "number") {
|
|
431
|
+
if (pr(e) !== "auto") throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${e}`);
|
|
432
|
+
return "auto";
|
|
433
|
+
}
|
|
434
|
+
const n = Math.floor(e);
|
|
435
|
+
if (!Number.isFinite(n) || n < 0 || n > 9) throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${e}`);
|
|
436
|
+
return n;
|
|
437
|
+
}
|
|
438
|
+
function zn(t, e) {
|
|
439
|
+
switch (t) {
|
|
440
|
+
case "minute":
|
|
441
|
+
return { precision: "minute", unit: "minute", increment: 1 };
|
|
442
|
+
case "second":
|
|
443
|
+
return { precision: 0, unit: "second", increment: 1 };
|
|
444
|
+
case "millisecond":
|
|
445
|
+
return { precision: 3, unit: "millisecond", increment: 1 };
|
|
446
|
+
case "microsecond":
|
|
447
|
+
return { precision: 6, unit: "microsecond", increment: 1 };
|
|
448
|
+
case "nanosecond":
|
|
449
|
+
return { precision: 9, unit: "nanosecond", increment: 1 };
|
|
450
|
+
}
|
|
451
|
+
switch (e) {
|
|
452
|
+
case "auto":
|
|
453
|
+
return { precision: e, unit: "nanosecond", increment: 1 };
|
|
454
|
+
case 0:
|
|
455
|
+
return { precision: e, unit: "second", increment: 1 };
|
|
456
|
+
case 1:
|
|
457
|
+
case 2:
|
|
458
|
+
case 3:
|
|
459
|
+
return { precision: e, unit: "millisecond", increment: 10 ** (3 - e) };
|
|
460
|
+
case 4:
|
|
461
|
+
case 5:
|
|
462
|
+
case 6:
|
|
463
|
+
return { precision: e, unit: "microsecond", increment: 10 ** (6 - e) };
|
|
464
|
+
case 7:
|
|
465
|
+
case 8:
|
|
466
|
+
case 9:
|
|
467
|
+
return { precision: e, unit: "nanosecond", increment: 10 ** (9 - e) };
|
|
468
|
+
default:
|
|
469
|
+
throw new RangeError(`fractionalSecondDigits must be 'auto' or 0 through 9, not ${e}`);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
const ut = /* @__PURE__ */ Symbol("~required~");
|
|
473
|
+
function $e(t, e, n, r, o = []) {
|
|
474
|
+
let a = [];
|
|
475
|
+
for (let d = 0; d < Vt.length; d++) {
|
|
476
|
+
const u = Vt[d], l = u[1], m = u[2];
|
|
477
|
+
n !== "datetime" && n !== m || a.push(l);
|
|
478
|
+
}
|
|
479
|
+
a = a.concat(o);
|
|
480
|
+
let i = r;
|
|
481
|
+
i === ut ? i = void 0 : i !== void 0 && a.push(i);
|
|
482
|
+
let s = [];
|
|
483
|
+
s = s.concat(a);
|
|
484
|
+
for (let d = 0; d < a.length; d++) {
|
|
485
|
+
const u = a[d], l = Ii[u];
|
|
486
|
+
l !== void 0 && s.push(l);
|
|
487
|
+
}
|
|
488
|
+
let h = dt(t, e, s, i);
|
|
489
|
+
if (h === void 0 && r === ut) throw new RangeError(`${e} is required`);
|
|
490
|
+
return h && h in To ? To[h] : h;
|
|
491
|
+
}
|
|
492
|
+
function Yr(t) {
|
|
493
|
+
const e = t.relativeTo;
|
|
494
|
+
if (e === void 0) return {};
|
|
495
|
+
let n, r, o, a, i, s = "option", h = !1;
|
|
496
|
+
if (A(e)) {
|
|
497
|
+
if (S(e)) return { zonedRelativeTo: e };
|
|
498
|
+
if (B(e)) return { plainRelativeTo: e };
|
|
499
|
+
if (L(e)) return { plainRelativeTo: we(c(e, P).isoDate, c(e, b)) };
|
|
500
|
+
o = _n(e);
|
|
501
|
+
const d = xe(o, e, ["year", "month", "monthCode", "day"], ["hour", "minute", "second", "millisecond", "microsecond", "nanosecond", "offset", "timeZone"], []);
|
|
502
|
+
({ isoDate: n, time: r } = qn(o, d, "constrain")), { offset: i, timeZone: a } = d, i === void 0 && (s = "wall");
|
|
503
|
+
} else {
|
|
504
|
+
let d, u, l, m, f;
|
|
505
|
+
if ({ year: l, month: m, day: f, time: r, calendar: o, tzAnnotation: d, offset: i, z: u } = et(_(e)), d) a = ve(d), u ? s = "exact" : i || (s = "wall"), h = !0;
|
|
506
|
+
else if (u) throw new RangeError("Z designator not supported for PlainDate relativeTo; either remove the Z or add a bracketed time zone");
|
|
507
|
+
o || (o = "iso8601"), o = Me(o), n = { year: l, month: m, day: f };
|
|
508
|
+
}
|
|
509
|
+
return a === void 0 ? { plainRelativeTo: we(n, o) } : { zonedRelativeTo: ne(ar(n, r, s, s === "option" ? sn(i) : 0, a, "compatible", "reject", h), a, o) };
|
|
510
|
+
}
|
|
511
|
+
function rt(t) {
|
|
512
|
+
return c(t, de) !== 0 ? "year" : c(t, he) !== 0 ? "month" : c(t, Te) !== 0 ? "week" : c(t, ue) !== 0 ? "day" : c(t, le) !== 0 ? "hour" : c(t, me) !== 0 ? "minute" : c(t, fe) !== 0 ? "second" : c(t, ye) !== 0 ? "millisecond" : c(t, ge) !== 0 ? "microsecond" : "nanosecond";
|
|
513
|
+
}
|
|
514
|
+
function st(t, e) {
|
|
515
|
+
return Dn.indexOf(t) > Dn.indexOf(e) ? e : t;
|
|
516
|
+
}
|
|
517
|
+
function We(t) {
|
|
518
|
+
return t === "year" || t === "month" || t === "week";
|
|
519
|
+
}
|
|
520
|
+
function ot(t) {
|
|
521
|
+
return We(t) || t === "day" ? "date" : "time";
|
|
522
|
+
}
|
|
523
|
+
function Dt(t) {
|
|
524
|
+
return te("%calendarImpl%")(t);
|
|
525
|
+
}
|
|
526
|
+
function An(t) {
|
|
527
|
+
return te("%calendarImpl%")(c(t, b));
|
|
528
|
+
}
|
|
529
|
+
function be(t, e, n = "date") {
|
|
530
|
+
const r = /* @__PURE__ */ Object.create(null), o = Dt(t).isoToDate(e, { year: !0, monthCode: !0, day: !0 });
|
|
531
|
+
return r.monthCode = o.monthCode, n !== "month-day" && n !== "date" || (r.day = o.day), n !== "year-month" && n !== "date" || (r.year = o.year), r;
|
|
532
|
+
}
|
|
533
|
+
function xe(t, e, n, r, o) {
|
|
534
|
+
const a = Dt(t).extraFields(n), i = n.concat(r, a), s = /* @__PURE__ */ Object.create(null);
|
|
535
|
+
let h = !1;
|
|
536
|
+
i.sort();
|
|
537
|
+
for (let d = 0; d < i.length; d++) {
|
|
538
|
+
const u = i[d], l = e[u];
|
|
539
|
+
if (l !== void 0) h = !0, s[u] = (0, Di[u])(l);
|
|
540
|
+
else if (o !== "partial") {
|
|
541
|
+
if (o.includes(u)) throw new TypeError(`required property '${u}' missing or undefined`);
|
|
542
|
+
s[u] = Ti[u];
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
if (o === "partial" && !h) throw new TypeError("no supported properties found");
|
|
546
|
+
return s;
|
|
547
|
+
}
|
|
548
|
+
function Br(t, e = "complete") {
|
|
549
|
+
const n = ["hour", "microsecond", "millisecond", "minute", "nanosecond", "second"];
|
|
550
|
+
let r = !1;
|
|
551
|
+
const o = /* @__PURE__ */ Object.create(null);
|
|
552
|
+
for (let a = 0; a < n.length; a++) {
|
|
553
|
+
const i = n[a], s = t[i];
|
|
554
|
+
s !== void 0 ? (o[i] = $(s), r = !0) : e === "complete" && (o[i] = 0);
|
|
555
|
+
}
|
|
556
|
+
if (!r) throw new TypeError("invalid time-like");
|
|
557
|
+
return o;
|
|
558
|
+
}
|
|
559
|
+
function yn(t, e) {
|
|
560
|
+
if (A(t)) {
|
|
561
|
+
if (B(t)) return N(M(e)), we(c(t, C), c(t, b));
|
|
562
|
+
if (S(t)) {
|
|
563
|
+
const h = Fe(c(t, x), c(t, I));
|
|
564
|
+
return N(M(e)), we(h.isoDate, c(t, b));
|
|
565
|
+
}
|
|
566
|
+
if (L(t)) return N(M(e)), we(c(t, P).isoDate, c(t, b));
|
|
567
|
+
const s = _n(t);
|
|
568
|
+
return we(Mt(s, xe(s, t, ["year", "month", "monthCode", "day"], [], []), N(M(e))), s);
|
|
569
|
+
}
|
|
570
|
+
let { year: n, month: r, day: o, calendar: a, z: i } = et(_(t));
|
|
571
|
+
if (i) throw new RangeError("Z designator not supported for PlainDate");
|
|
572
|
+
return a || (a = "iso8601"), a = Me(a), N(M(e)), we({ year: n, month: r, day: o }, a);
|
|
573
|
+
}
|
|
574
|
+
function qn(t, e, n) {
|
|
575
|
+
return j(Mt(t, e, n), vr(e.hour, e.minute, e.second, e.millisecond, e.microsecond, e.nanosecond, n));
|
|
576
|
+
}
|
|
577
|
+
function gn(t, e) {
|
|
578
|
+
let n, r, o;
|
|
579
|
+
if (A(t)) {
|
|
580
|
+
if (L(t)) return N(M(e)), Le(c(t, P), c(t, b));
|
|
581
|
+
if (S(t)) {
|
|
582
|
+
const s = Fe(c(t, x), c(t, I));
|
|
583
|
+
return N(M(e)), Le(s, c(t, b));
|
|
584
|
+
}
|
|
585
|
+
if (B(t)) return N(M(e)), Le(j(c(t, C), { deltaDays: 0, hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 }), c(t, b));
|
|
586
|
+
o = _n(t);
|
|
587
|
+
const a = xe(o, t, ["year", "month", "monthCode", "day"], ["hour", "minute", "second", "millisecond", "microsecond", "nanosecond"], []), i = N(M(e));
|
|
588
|
+
({ isoDate: n, time: r } = qn(o, a, i));
|
|
589
|
+
} else {
|
|
590
|
+
let a, i, s, h;
|
|
591
|
+
if ({ year: i, month: s, day: h, time: r, calendar: o, z: a } = et(_(t)), a) throw new RangeError("Z designator not supported for PlainDateTime");
|
|
592
|
+
r === "start-of-day" && (r = { deltaDays: 0, hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 }), oo(i, s, h, r.hour, r.minute, r.second, r.millisecond, r.microsecond, r.nanosecond), o || (o = "iso8601"), o = Me(o), N(M(e)), n = { year: i, month: s, day: h };
|
|
593
|
+
}
|
|
594
|
+
return Le(j(n, r), o);
|
|
595
|
+
}
|
|
596
|
+
function Ze(t) {
|
|
597
|
+
const e = te("%Temporal.Duration%");
|
|
598
|
+
if (F(t)) return new e(c(t, de), c(t, he), c(t, Te), c(t, ue), c(t, le), c(t, me), c(t, fe), c(t, ye), c(t, ge), c(t, Ie));
|
|
599
|
+
if (!A(t)) return (function(o) {
|
|
600
|
+
const { years: a, months: i, weeks: s, days: h, hours: d, minutes: u, seconds: l, milliseconds: m, microseconds: f, nanoseconds: p } = (function(v) {
|
|
601
|
+
const w = gi.exec(v);
|
|
602
|
+
if (!w) throw new RangeError(`invalid duration: ${v}`);
|
|
603
|
+
if (w.every(((ri, oi) => oi < 2 || ri === void 0))) throw new RangeError(`invalid duration: ${v}`);
|
|
604
|
+
const E = w[1] === "-" ? -1 : 1, T = w[2] === void 0 ? 0 : $(w[2]) * E, D = w[3] === void 0 ? 0 : $(w[3]) * E, Y = w[4] === void 0 ? 0 : $(w[4]) * E, O = w[5] === void 0 ? 0 : $(w[5]) * E, W = w[6] === void 0 ? 0 : $(w[6]) * E, K = w[7], H = w[8], Z = w[9], De = w[10], V = w[11];
|
|
605
|
+
let U = 0, ae = 0, Re = 0;
|
|
606
|
+
if (K !== void 0) {
|
|
607
|
+
if (H ?? Z ?? De ?? V) throw new RangeError("only the smallest unit can be fractional");
|
|
608
|
+
Re = 3600 * $((K + "000000000").slice(0, 9)) * E;
|
|
609
|
+
} else if (U = H === void 0 ? 0 : $(H) * E, Z !== void 0) {
|
|
610
|
+
if (De ?? V) throw new RangeError("only the smallest unit can be fractional");
|
|
611
|
+
Re = 60 * $((Z + "000000000").slice(0, 9)) * E;
|
|
612
|
+
} else ae = De === void 0 ? 0 : $(De) * E, V !== void 0 && (Re = $((V + "000000000").slice(0, 9)) * E);
|
|
613
|
+
const ft = Re % 1e3, Pt = Math.trunc(Re / 1e3) % 1e3, Zt = Math.trunc(Re / 1e6) % 1e3;
|
|
614
|
+
return ae += Math.trunc(Re / 1e9) % 60, U += Math.trunc(Re / 6e10), Dr(T, D, Y, O, W, U, ae, Zt, Pt, ft), { years: T, months: D, weeks: Y, days: O, hours: W, minutes: U, seconds: ae, milliseconds: Zt, microseconds: Pt, nanoseconds: ft };
|
|
615
|
+
})(o);
|
|
616
|
+
return new (te("%Temporal.Duration%"))(a, i, s, h, d, u, l, m, f, p);
|
|
617
|
+
})(_(t));
|
|
618
|
+
const n = { years: 0, months: 0, weeks: 0, days: 0, hours: 0, minutes: 0, seconds: 0, milliseconds: 0, microseconds: 0, nanoseconds: 0 };
|
|
619
|
+
let r = Ea(t);
|
|
620
|
+
for (let o = 0; o < or.length; o++) {
|
|
621
|
+
const a = or[o], i = r[a];
|
|
622
|
+
i !== void 0 && (n[a] = i);
|
|
623
|
+
}
|
|
624
|
+
return new e(n.years, n.months, n.weeks, n.days, n.hours, n.minutes, n.seconds, n.milliseconds, n.microseconds, n.nanoseconds);
|
|
625
|
+
}
|
|
626
|
+
function pn(t) {
|
|
627
|
+
let e;
|
|
628
|
+
if (A(t)) {
|
|
629
|
+
if (X(t) || S(t)) return _e(c(t, I));
|
|
630
|
+
e = Zr(t);
|
|
631
|
+
} else e = t;
|
|
632
|
+
const { year: n, month: r, day: o, time: a, offset: i, z: s } = (function(v) {
|
|
633
|
+
const w = et(v);
|
|
634
|
+
if (!w.z && !w.offset) throw new RangeError("Temporal.Instant requires a time zone offset");
|
|
635
|
+
return w;
|
|
636
|
+
})(_(e)), { hour: h = 0, minute: d = 0, second: u = 0, millisecond: l = 0, microsecond: m = 0, nanosecond: f = 0 } = a === "start-of-day" ? {} : a, p = Nn(n, r, o, h, d, u, l, m, f - (s ? 0 : sn(i)));
|
|
637
|
+
return Jt(p.isoDate), _e(ee(p));
|
|
638
|
+
}
|
|
639
|
+
function Co(t, e) {
|
|
640
|
+
if (A(t)) {
|
|
641
|
+
if (Se(t)) return N(M(e)), Ht(c(t, C), c(t, b));
|
|
642
|
+
let s;
|
|
643
|
+
return Ee(t, b) ? s = c(t, b) : (s = t.calendar, s === void 0 && (s = "iso8601"), s = Hn(s)), Ht(ir(s, xe(s, t, ["year", "month", "monthCode", "day"], [], []), N(M(e))), s);
|
|
644
|
+
}
|
|
645
|
+
let { month: n, day: r, referenceISOYear: o, calendar: a } = eo(_(t));
|
|
646
|
+
if (a === void 0 && (a = "iso8601"), a = Me(a), N(M(e)), a === "iso8601") return Ht({ year: 1972, month: n, day: r }, a);
|
|
647
|
+
let i = { year: o, month: n, day: r };
|
|
648
|
+
return Lt(i), i = ir(a, be(a, i, "month-day"), "constrain"), Ht(i, a);
|
|
649
|
+
}
|
|
650
|
+
function pt(t, e) {
|
|
651
|
+
let n;
|
|
652
|
+
if (A(t)) {
|
|
653
|
+
if (q(t)) return N(M(e)), at(c(t, z));
|
|
654
|
+
if (L(t)) return N(M(e)), at(c(t, P).time);
|
|
655
|
+
if (S(t)) {
|
|
656
|
+
const d = Fe(c(t, x), c(t, I));
|
|
657
|
+
return N(M(e)), at(d.time);
|
|
658
|
+
}
|
|
659
|
+
const { hour: r, minute: o, second: a, millisecond: i, microsecond: s, nanosecond: h } = Br(t);
|
|
660
|
+
n = vr(r, o, a, i, s, h, N(M(e)));
|
|
661
|
+
} else n = pa(_(t)), N(M(e));
|
|
662
|
+
return at(n);
|
|
663
|
+
}
|
|
664
|
+
function Ma(t) {
|
|
665
|
+
return t === void 0 ? { deltaDays: 0, hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 } : c(pt(t), z);
|
|
666
|
+
}
|
|
667
|
+
function wn(t, e) {
|
|
668
|
+
if (A(t)) {
|
|
669
|
+
if (Q(t)) return N(M(e)), _t(c(t, C), c(t, b));
|
|
670
|
+
const s = _n(t);
|
|
671
|
+
return _t(Rn(s, xe(s, t, ["year", "month", "monthCode"], [], []), N(M(e))), s);
|
|
672
|
+
}
|
|
673
|
+
let { year: n, month: r, referenceISODay: o, calendar: a } = Qr(_(t));
|
|
674
|
+
a === void 0 && (a = "iso8601"), a = Me(a), N(M(e));
|
|
675
|
+
let i = { year: n, month: r, day: o };
|
|
676
|
+
return ao(i), i = Rn(a, be(a, i, "year-month"), "constrain"), _t(i, a);
|
|
677
|
+
}
|
|
678
|
+
function ar(t, e, n, r, o, a, i, s) {
|
|
679
|
+
if (e === "start-of-day") return yt(o, t);
|
|
680
|
+
const h = j(t, e);
|
|
681
|
+
if (n === "wall" || i === "ignore") return oe(o, h, a);
|
|
682
|
+
if (n === "exact" || i === "use") {
|
|
683
|
+
const l = Nn(t.year, t.month, t.day, e.hour, e.minute, e.second, e.millisecond, e.microsecond, e.nanosecond - r);
|
|
684
|
+
Jt(l.isoDate);
|
|
685
|
+
const m = ee(l);
|
|
686
|
+
return Xe(m), m;
|
|
687
|
+
}
|
|
688
|
+
Jt(t);
|
|
689
|
+
const d = ee(h), u = Sn(o, h);
|
|
690
|
+
for (let l = 0; l < u.length; l++) {
|
|
691
|
+
const m = u[l], f = y.toNumber(y.subtract(d, m)), p = wt(f, 6e10, "halfExpand");
|
|
692
|
+
if (f === r || s && p === r) return m;
|
|
693
|
+
}
|
|
694
|
+
if (i === "reject") {
|
|
695
|
+
const l = zr(r), m = kn(h, "iso8601", "auto");
|
|
696
|
+
throw new RangeError(`Offset ${l} is invalid for ${m} in ${o}`);
|
|
697
|
+
}
|
|
698
|
+
return Sa(u, o, h, a);
|
|
699
|
+
}
|
|
700
|
+
function vn(t, e) {
|
|
701
|
+
let n, r, o, a, i, s, h, d = !1, u = "option";
|
|
702
|
+
if (A(t)) {
|
|
703
|
+
if (S(t)) {
|
|
704
|
+
const v = M(e);
|
|
705
|
+
return In(v), er(v, "reject"), N(v), ne(c(t, I), c(t, x), c(t, b));
|
|
706
|
+
}
|
|
707
|
+
i = _n(t);
|
|
708
|
+
const m = xe(i, t, ["year", "month", "monthCode", "day"], ["hour", "minute", "second", "millisecond", "microsecond", "nanosecond", "offset", "timeZone"], ["timeZone"]);
|
|
709
|
+
({ offset: a, timeZone: o } = m), a === void 0 && (u = "wall");
|
|
710
|
+
const f = M(e);
|
|
711
|
+
s = In(f), h = er(f, "reject");
|
|
712
|
+
const p = N(f);
|
|
713
|
+
({ isoDate: n, time: r } = qn(i, m, p));
|
|
714
|
+
} else {
|
|
715
|
+
let m, f, p, v, w;
|
|
716
|
+
({ year: p, month: v, day: w, time: r, tzAnnotation: m, offset: a, z: f, calendar: i } = (function(T) {
|
|
717
|
+
const D = et(T);
|
|
718
|
+
if (!D.tzAnnotation) throw new RangeError("Temporal.ZonedDateTime requires a time zone ID in brackets");
|
|
719
|
+
return D;
|
|
720
|
+
})(_(t))), o = ve(m), f ? u = "exact" : a || (u = "wall"), i || (i = "iso8601"), i = Me(i), d = !0;
|
|
721
|
+
const E = M(e);
|
|
722
|
+
s = In(E), h = er(E, "reject"), N(E), n = { year: p, month: v, day: w };
|
|
723
|
+
}
|
|
724
|
+
let l = 0;
|
|
725
|
+
return u === "option" && (l = sn(a)), ne(ar(n, r, u, l, o, s, h, d), o, i);
|
|
726
|
+
}
|
|
727
|
+
function Da(t, e, n) {
|
|
728
|
+
Lt(e), lt(t), R(t, C, e), R(t, b, n), R(t, ea, !0);
|
|
729
|
+
}
|
|
730
|
+
function we(t, e) {
|
|
731
|
+
const n = te("%Temporal.PlainDate%"), r = Object.create(n.prototype);
|
|
732
|
+
return Da(r, t, e), r;
|
|
733
|
+
}
|
|
734
|
+
function Ta(t, e, n) {
|
|
735
|
+
St(e), lt(t), R(t, P, e), R(t, b, n);
|
|
736
|
+
}
|
|
737
|
+
function Le(t, e) {
|
|
738
|
+
const n = te("%Temporal.PlainDateTime%"), r = Object.create(n.prototype);
|
|
739
|
+
return Ta(r, t, e), r;
|
|
740
|
+
}
|
|
741
|
+
function Ia(t, e, n) {
|
|
742
|
+
Lt(e), lt(t), R(t, C, e), R(t, b, n), R(t, na, !0);
|
|
743
|
+
}
|
|
744
|
+
function Ht(t, e) {
|
|
745
|
+
const n = te("%Temporal.PlainMonthDay%"), r = Object.create(n.prototype);
|
|
746
|
+
return Ia(r, t, e), r;
|
|
747
|
+
}
|
|
748
|
+
function Ca(t, e) {
|
|
749
|
+
lt(t), R(t, z, e);
|
|
750
|
+
}
|
|
751
|
+
function at(t) {
|
|
752
|
+
const e = te("%Temporal.PlainTime%"), n = Object.create(e.prototype);
|
|
753
|
+
return Ca(n, t), n;
|
|
754
|
+
}
|
|
755
|
+
function $a(t, e, n) {
|
|
756
|
+
ao(e), lt(t), R(t, C, e), R(t, b, n), R(t, ta, !0);
|
|
757
|
+
}
|
|
758
|
+
function _t(t, e) {
|
|
759
|
+
const n = te("%Temporal.PlainYearMonth%"), r = Object.create(n.prototype);
|
|
760
|
+
return $a(r, t, e), r;
|
|
761
|
+
}
|
|
762
|
+
function Oa(t, e) {
|
|
763
|
+
Xe(e), lt(t), R(t, I, e);
|
|
764
|
+
}
|
|
765
|
+
function _e(t) {
|
|
766
|
+
const e = te("%Temporal.Instant%"), n = Object.create(e.prototype);
|
|
767
|
+
return Oa(n, t), n;
|
|
768
|
+
}
|
|
769
|
+
function Ya(t, e, n, r) {
|
|
770
|
+
Xe(e), lt(t), R(t, I, e), R(t, x, n), R(t, b, r);
|
|
771
|
+
}
|
|
772
|
+
function ne(t, e, n = "iso8601") {
|
|
773
|
+
const r = te("%Temporal.ZonedDateTime%"), o = Object.create(r.prototype);
|
|
774
|
+
return Ya(o, t, e, n), o;
|
|
775
|
+
}
|
|
776
|
+
function $o(t) {
|
|
777
|
+
return Fr.filter(((e) => t[e] !== void 0));
|
|
778
|
+
}
|
|
779
|
+
function Yt(t, e, n) {
|
|
780
|
+
const r = $o(n), o = Dt(t).fieldKeysToIgnore(r), a = /* @__PURE__ */ Object.create(null), i = $o(e);
|
|
781
|
+
for (let s = 0; s < Fr.length; s++) {
|
|
782
|
+
let h;
|
|
783
|
+
const d = Fr[s];
|
|
784
|
+
i.includes(d) && !o.includes(d) && (h = e[d]), r.includes(d) && (h = n[d]), h !== void 0 && (a[d] = h);
|
|
785
|
+
}
|
|
786
|
+
return a;
|
|
787
|
+
}
|
|
788
|
+
function Ne(t, e, n, r) {
|
|
789
|
+
const o = Dt(t).dateAdd(e, n, r);
|
|
790
|
+
return Lt(o), o;
|
|
791
|
+
}
|
|
792
|
+
function Wn(t, e, n, r) {
|
|
793
|
+
return Dt(t).dateUntil(e, n, r);
|
|
794
|
+
}
|
|
795
|
+
function Hn(t) {
|
|
796
|
+
if (A(t) && Ee(t, b)) return c(t, b);
|
|
797
|
+
const e = _(t);
|
|
798
|
+
try {
|
|
799
|
+
return Me(e);
|
|
800
|
+
} catch {
|
|
801
|
+
}
|
|
802
|
+
let n;
|
|
803
|
+
try {
|
|
804
|
+
({ calendar: n } = et(e));
|
|
805
|
+
} catch {
|
|
806
|
+
try {
|
|
807
|
+
({ calendar: n } = pa(e));
|
|
808
|
+
} catch {
|
|
809
|
+
try {
|
|
810
|
+
({ calendar: n } = Qr(e));
|
|
811
|
+
} catch {
|
|
812
|
+
({ calendar: n } = eo(e));
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
return n || (n = "iso8601"), Me(n);
|
|
817
|
+
}
|
|
818
|
+
function _n(t) {
|
|
819
|
+
if (Ee(t, b)) return c(t, b);
|
|
820
|
+
const { calendar: e } = t;
|
|
821
|
+
return e === void 0 ? "iso8601" : Hn(e);
|
|
822
|
+
}
|
|
823
|
+
function Ve(t, e) {
|
|
824
|
+
return Me(t) === Me(e);
|
|
825
|
+
}
|
|
826
|
+
function Mt(t, e, n) {
|
|
827
|
+
const r = Dt(t);
|
|
828
|
+
r.resolveFields(e, "date");
|
|
829
|
+
const o = r.dateToISO(e, n);
|
|
830
|
+
return Lt(o), o;
|
|
831
|
+
}
|
|
832
|
+
function Rn(t, e, n) {
|
|
833
|
+
const r = Dt(t);
|
|
834
|
+
r.resolveFields(e, "year-month"), e.day = 1;
|
|
835
|
+
const o = r.dateToISO(e, n);
|
|
836
|
+
return ao(o), o;
|
|
837
|
+
}
|
|
838
|
+
function ir(t, e, n) {
|
|
839
|
+
const r = Dt(t);
|
|
840
|
+
r.resolveFields(e, "month-day");
|
|
841
|
+
const o = r.monthDayToISOReferenceDate(e, n);
|
|
842
|
+
return Lt(o), o;
|
|
843
|
+
}
|
|
844
|
+
function ve(t) {
|
|
845
|
+
if (A(t) && S(t)) return c(t, x);
|
|
846
|
+
const e = _(t);
|
|
847
|
+
if (e === "UTC") return "UTC";
|
|
848
|
+
const { tzName: n, offsetMinutes: r } = (function(a) {
|
|
849
|
+
const { tzAnnotation: i, offset: s, z: h } = (function(d) {
|
|
850
|
+
if (wa.test(d)) return { tzAnnotation: d, offset: void 0, z: !1 };
|
|
851
|
+
try {
|
|
852
|
+
const { tzAnnotation: u, offset: l, z: m } = et(d);
|
|
853
|
+
if (m || u || l) return { tzAnnotation: u, offset: l, z: m };
|
|
854
|
+
} catch {
|
|
855
|
+
}
|
|
856
|
+
ba(d);
|
|
857
|
+
})(a);
|
|
858
|
+
return i ? vt(i) : h ? vt("UTC") : s ? vt(s) : void 0;
|
|
859
|
+
})(e);
|
|
860
|
+
if (r !== void 0) return to(r);
|
|
861
|
+
const o = sr(n);
|
|
862
|
+
if (!o) throw new RangeError(`Unrecognized time zone ${n}`);
|
|
863
|
+
return o.identifier;
|
|
864
|
+
}
|
|
865
|
+
function Ra(t, e) {
|
|
866
|
+
if (t === e) return !0;
|
|
867
|
+
const n = vt(t).offsetMinutes, r = vt(e).offsetMinutes;
|
|
868
|
+
if (n === void 0 && r === void 0) {
|
|
869
|
+
const o = sr(e);
|
|
870
|
+
if (!o) return !1;
|
|
871
|
+
const a = sr(t);
|
|
872
|
+
return !!a && a.primaryIdentifier === o.primaryIdentifier;
|
|
873
|
+
}
|
|
874
|
+
return n === r;
|
|
875
|
+
}
|
|
876
|
+
function it(t, e) {
|
|
877
|
+
const n = vt(t).offsetMinutes;
|
|
878
|
+
return n !== void 0 ? 6e10 * n : Ar(t, e);
|
|
879
|
+
}
|
|
880
|
+
function zr(t) {
|
|
881
|
+
const e = t < 0 ? "-" : "+", n = Math.abs(t), r = Math.floor(n / 36e11), o = Math.floor(n / 6e10) % 60, a = Math.floor(n / 1e9) % 60, i = n % 1e9;
|
|
882
|
+
return `${e}${br(r, o, a, i, a === 0 && i === 0 ? "minute" : "auto")}`;
|
|
883
|
+
}
|
|
884
|
+
function Fe(t, e) {
|
|
885
|
+
const n = it(t, e);
|
|
886
|
+
let { isoDate: { year: r, month: o, day: a }, time: { hour: i, minute: s, second: h, millisecond: d, microsecond: u, nanosecond: l } } = ja(e);
|
|
887
|
+
return Nn(r, o, a, i, s, h, d, u, l + n);
|
|
888
|
+
}
|
|
889
|
+
function oe(t, e, n) {
|
|
890
|
+
return Sa(Sn(t, e), t, e, n);
|
|
891
|
+
}
|
|
892
|
+
function Sa(t, e, n, r) {
|
|
893
|
+
const o = t.length;
|
|
894
|
+
if (o === 1) return t[0];
|
|
895
|
+
if (o) switch (r) {
|
|
896
|
+
case "compatible":
|
|
897
|
+
case "earlier":
|
|
898
|
+
return t[0];
|
|
899
|
+
case "later":
|
|
900
|
+
return t[o - 1];
|
|
901
|
+
case "reject":
|
|
902
|
+
throw new RangeError("multiple instants found");
|
|
903
|
+
}
|
|
904
|
+
if (r === "reject") throw new RangeError("multiple instants found");
|
|
905
|
+
const a = ee(n), i = y.subtract(a, bt);
|
|
906
|
+
Xe(i);
|
|
907
|
+
const s = it(e, i), h = y.add(a, bt);
|
|
908
|
+
Xe(h);
|
|
909
|
+
const d = it(e, h) - s;
|
|
910
|
+
switch (r) {
|
|
911
|
+
case "earlier": {
|
|
912
|
+
const u = k.fromComponents(0, 0, 0, 0, 0, -d), l = Qt(n.time, u);
|
|
913
|
+
return Sn(e, j(Oe(n.isoDate.year, n.isoDate.month, n.isoDate.day + l.deltaDays), l))[0];
|
|
914
|
+
}
|
|
915
|
+
case "compatible":
|
|
916
|
+
case "later": {
|
|
917
|
+
const u = k.fromComponents(0, 0, 0, 0, 0, d), l = Qt(n.time, u), m = Sn(e, j(Oe(n.isoDate.year, n.isoDate.month, n.isoDate.day + l.deltaDays), l));
|
|
918
|
+
return m[m.length - 1];
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
function Sn(t, e) {
|
|
923
|
+
if (t === "UTC") return Jt(e.isoDate), [ee(e)];
|
|
924
|
+
const n = vt(t).offsetMinutes;
|
|
925
|
+
if (n !== void 0) {
|
|
926
|
+
const r = Nn(e.isoDate.year, e.isoDate.month, e.isoDate.day, e.time.hour, e.time.minute - n, e.time.second, e.time.millisecond, e.time.microsecond, e.time.nanosecond);
|
|
927
|
+
Jt(r.isoDate);
|
|
928
|
+
const o = ee(r);
|
|
929
|
+
return Xe(o), [o];
|
|
930
|
+
}
|
|
931
|
+
return Jt(e.isoDate), (function(r, o) {
|
|
932
|
+
let a = ee(o), i = y.subtract(a, bt);
|
|
933
|
+
y.lessThan(i, On) && (i = a);
|
|
934
|
+
let s = y.add(a, bt);
|
|
935
|
+
y.greaterThan(s, Kt) && (s = a);
|
|
936
|
+
const h = Ar(r, i), d = Ar(r, s);
|
|
937
|
+
return (h === d ? [h] : [h, d]).map(((l) => {
|
|
938
|
+
const m = y.subtract(a, y.BigInt(l)), f = (function(p, v) {
|
|
939
|
+
const { epochMilliseconds: w, time: { millisecond: E, microsecond: T, nanosecond: D } } = ja(v), { year: Y, month: O, day: W, hour: K, minute: H, second: Z } = xa(p, w);
|
|
940
|
+
return Nn(Y, O, W, K, H, Z, E, T, D);
|
|
941
|
+
})(r, m);
|
|
942
|
+
if (en(o, f) === 0) return Xe(m), m;
|
|
943
|
+
})).filter(((l) => l !== void 0));
|
|
944
|
+
})(t, e);
|
|
945
|
+
}
|
|
946
|
+
function yt(t, e) {
|
|
947
|
+
const n = j(e, { deltaDays: 0, hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 }), r = Sn(t, n);
|
|
948
|
+
if (r.length) return r[0];
|
|
949
|
+
const o = ee(n), a = y.subtract(o, bt);
|
|
950
|
+
return Xe(a), ro(t, a);
|
|
951
|
+
}
|
|
952
|
+
function Jn(t) {
|
|
953
|
+
let e;
|
|
954
|
+
return e = t < 0 || t > 9999 ? (t < 0 ? "-" : "+") + Yn(Math.abs(t), 6) : Yn(t, 4), e;
|
|
955
|
+
}
|
|
956
|
+
function je(t) {
|
|
957
|
+
return Yn(t, 2);
|
|
958
|
+
}
|
|
959
|
+
function ka(t, e) {
|
|
960
|
+
let n;
|
|
961
|
+
if (e === "auto") {
|
|
962
|
+
if (t === 0) return "";
|
|
963
|
+
n = Yn(t, 9).replace(/0+$/, "");
|
|
964
|
+
} else {
|
|
965
|
+
if (e === 0) return "";
|
|
966
|
+
n = Yn(t, 9).slice(0, e);
|
|
967
|
+
}
|
|
968
|
+
return `.${n}`;
|
|
969
|
+
}
|
|
970
|
+
function br(t, e, n, r, o) {
|
|
971
|
+
let a = `${je(t)}:${je(e)}`;
|
|
972
|
+
return o === "minute" || (a += `:${je(n)}`, a += ka(r, o)), a;
|
|
973
|
+
}
|
|
974
|
+
function Oo(t, e, n) {
|
|
975
|
+
let r = e;
|
|
976
|
+
r === void 0 && (r = "UTC");
|
|
977
|
+
const o = c(t, I), a = kn(Fe(r, o), "iso8601", n, "never");
|
|
978
|
+
let i = "Z";
|
|
979
|
+
return e !== void 0 && (i = Na(it(r, o))), `${a}${i}`;
|
|
980
|
+
}
|
|
981
|
+
function Qn(t, e) {
|
|
982
|
+
const n = c(t, de), r = c(t, he), o = c(t, Te), a = c(t, ue), i = c(t, le), s = c(t, me), h = dr(t);
|
|
983
|
+
let d = "";
|
|
984
|
+
n !== 0 && (d += `${Math.abs(n)}Y`), r !== 0 && (d += `${Math.abs(r)}M`), o !== 0 && (d += `${Math.abs(o)}W`), a !== 0 && (d += `${Math.abs(a)}D`);
|
|
985
|
+
let u = "";
|
|
986
|
+
i !== 0 && (u += `${Math.abs(i)}H`), s !== 0 && (u += `${Math.abs(s)}M`);
|
|
987
|
+
const l = k.fromComponents(0, 0, c(t, fe), c(t, ye), c(t, ge), c(t, Ie));
|
|
988
|
+
l.isZero() && !["second", "millisecond", "microsecond", "nanosecond"].includes(rt(t)) && e === "auto" || (u += `${Math.abs(l.sec)}${ka(Math.abs(l.subsec), e)}S`);
|
|
989
|
+
let m = `${h < 0 ? "-" : ""}P${d}`;
|
|
990
|
+
return u && (m = `${m}T${u}`), m;
|
|
991
|
+
}
|
|
992
|
+
function Yo(t, e = "auto") {
|
|
993
|
+
const { year: n, month: r, day: o } = c(t, C);
|
|
994
|
+
return `${Jn(n)}-${je(r)}-${je(o)}${Zn(c(t, b), e)}`;
|
|
995
|
+
}
|
|
996
|
+
function Ro({ hour: t, minute: e, second: n, millisecond: r, microsecond: o, nanosecond: a }, i) {
|
|
997
|
+
return br(t, e, n, 1e6 * r + 1e3 * o + a, i);
|
|
998
|
+
}
|
|
999
|
+
function kn(t, e, n, r = "auto") {
|
|
1000
|
+
const { isoDate: { year: o, month: a, day: i }, time: { hour: s, minute: h, second: d, millisecond: u, microsecond: l, nanosecond: m } } = t;
|
|
1001
|
+
return `${Jn(o)}-${je(a)}-${je(i)}T${br(s, h, d, 1e6 * u + 1e3 * l + m, n)}${Zn(e, r)}`;
|
|
1002
|
+
}
|
|
1003
|
+
function So(t, e = "auto") {
|
|
1004
|
+
const { year: n, month: r, day: o } = c(t, C);
|
|
1005
|
+
let a = `${je(r)}-${je(o)}`;
|
|
1006
|
+
const i = c(t, b);
|
|
1007
|
+
e !== "always" && e !== "critical" && i === "iso8601" || (a = `${Jn(n)}-${a}`);
|
|
1008
|
+
const s = Zn(i, e);
|
|
1009
|
+
return s && (a += s), a;
|
|
1010
|
+
}
|
|
1011
|
+
function ko(t, e = "auto") {
|
|
1012
|
+
const { year: n, month: r, day: o } = c(t, C);
|
|
1013
|
+
let a = `${Jn(n)}-${je(r)}`;
|
|
1014
|
+
const i = c(t, b);
|
|
1015
|
+
e !== "always" && e !== "critical" && i === "iso8601" || (a += `-${je(o)}`);
|
|
1016
|
+
const s = Zn(i, e);
|
|
1017
|
+
return s && (a += s), a;
|
|
1018
|
+
}
|
|
1019
|
+
function No(t, e, n = "auto", r = "auto", o = "auto", a = void 0) {
|
|
1020
|
+
let i = c(t, I);
|
|
1021
|
+
if (a) {
|
|
1022
|
+
const { unit: u, increment: l, roundingMode: m } = a;
|
|
1023
|
+
i = _r(i, l, u, m);
|
|
1024
|
+
}
|
|
1025
|
+
const s = c(t, x), h = it(s, i);
|
|
1026
|
+
let d = kn(Fe(s, i), "iso8601", e, "never");
|
|
1027
|
+
return o !== "never" && (d += Na(h)), r !== "never" && (d += `[${r === "critical" ? "!" : ""}${s}]`), d += Zn(c(t, b), n), d;
|
|
1028
|
+
}
|
|
1029
|
+
function jo(t) {
|
|
1030
|
+
return va.test(t);
|
|
1031
|
+
}
|
|
1032
|
+
function sn(t) {
|
|
1033
|
+
const e = Yi.exec(t);
|
|
1034
|
+
if (!e) throw new RangeError(`invalid time zone offset: ${t}; must match ±HH:MM[:SS.SSSSSSSSS]`);
|
|
1035
|
+
return (e[1] === "-" ? -1 : 1) * (1e9 * (60 * (60 * +e[2] + +(e[3] || 0)) + +(e[4] || 0)) + +((e[5] || 0) + "000000000").slice(0, 9));
|
|
1036
|
+
}
|
|
1037
|
+
let hn;
|
|
1038
|
+
const $i = Object.assign(/* @__PURE__ */ Object.create(null), { "/": !0, "-": !0, _: !0 });
|
|
1039
|
+
function sr(t) {
|
|
1040
|
+
if (hn === void 0) {
|
|
1041
|
+
const a = Intl.supportedValuesOf?.("timeZone");
|
|
1042
|
+
if (a) {
|
|
1043
|
+
hn = /* @__PURE__ */ new Map();
|
|
1044
|
+
for (let i = 0; i < a.length; i++) {
|
|
1045
|
+
const s = a[i];
|
|
1046
|
+
hn.set(jn(s), s);
|
|
1047
|
+
}
|
|
1048
|
+
} else hn = null;
|
|
1049
|
+
}
|
|
1050
|
+
const e = jn(t);
|
|
1051
|
+
let n = hn?.get(e);
|
|
1052
|
+
if (n) return { identifier: n, primaryIdentifier: n };
|
|
1053
|
+
try {
|
|
1054
|
+
n = ga(t).resolvedOptions().timeZone;
|
|
1055
|
+
} catch {
|
|
1056
|
+
return;
|
|
1057
|
+
}
|
|
1058
|
+
if (e === "antarctica/south_pole" && (n = "Antarctica/McMurdo"), Mi.has(t)) throw new RangeError(`${t} is a legacy time zone identifier from ICU. Use ${n} instead`);
|
|
1059
|
+
const r = [...e].map(((a, i) => i === 0 || $i[e[i - 1]] ? a.toUpperCase() : a)).join("").split("/");
|
|
1060
|
+
if (r.length === 1) return e === "gb-eire" ? { identifier: "GB-Eire", primaryIdentifier: n } : { identifier: e.length <= 3 || /[-0-9]/.test(e) ? e.toUpperCase() : r[0], primaryIdentifier: n };
|
|
1061
|
+
if (r[0] === "Etc") return { identifier: `Etc/${["Zulu", "Greenwich", "Universal"].includes(r[1]) ? r[1] : r[1].toUpperCase()}`, primaryIdentifier: n };
|
|
1062
|
+
if (r[0] === "Us") return { identifier: `US/${r[1]}`, primaryIdentifier: n };
|
|
1063
|
+
const o = /* @__PURE__ */ new Map([["Act", "ACT"], ["Lhi", "LHI"], ["Nsw", "NSW"], ["Dar_Es_Salaam", "Dar_es_Salaam"], ["Port_Of_Spain", "Port_of_Spain"], ["Port-Au-Prince", "Port-au-Prince"], ["Isle_Of_Man", "Isle_of_Man"], ["Comodrivadavia", "ComodRivadavia"], ["Knox_In", "Knox_IN"], ["Dumontdurville", "DumontDUrville"], ["Mcmurdo", "McMurdo"], ["Denoronha", "DeNoronha"], ["Easterisland", "EasterIsland"], ["Bajanorte", "BajaNorte"], ["Bajasur", "BajaSur"]]);
|
|
1064
|
+
return r[1] = o.get(r[1]) ?? r[1], r.length > 2 && (r[2] = o.get(r[2]) ?? r[2]), { identifier: r.join("/"), primaryIdentifier: n };
|
|
1065
|
+
}
|
|
1066
|
+
function $t(t, e) {
|
|
1067
|
+
const { year: n, month: r, day: o, hour: a, minute: i, second: s } = xa(t, e);
|
|
1068
|
+
let h = e % 1e3;
|
|
1069
|
+
return h < 0 && (h += 1e3), 1e6 * (no({ isoDate: { year: n, month: r, day: o }, time: { hour: a, minute: i, second: s, millisecond: h } }) - e);
|
|
1070
|
+
}
|
|
1071
|
+
function Ar(t, e) {
|
|
1072
|
+
return $t(t, Be(e, "floor"));
|
|
1073
|
+
}
|
|
1074
|
+
function to(t) {
|
|
1075
|
+
const e = t < 0 ? "-" : "+", n = Math.abs(t);
|
|
1076
|
+
return `${e}${br(Math.floor(n / 60), n % 60, 0, 0, "minute")}`;
|
|
1077
|
+
}
|
|
1078
|
+
function Na(t) {
|
|
1079
|
+
return to(wt(t, pi, "halfExpand") / 6e10);
|
|
1080
|
+
}
|
|
1081
|
+
function no({ isoDate: { year: t, month: e, day: n }, time: { hour: r, minute: o, second: a, millisecond: i } }) {
|
|
1082
|
+
const s = t % 400, h = (t - s) / 400, d = /* @__PURE__ */ new Date();
|
|
1083
|
+
return d.setUTCHours(r, o, a, i), d.setUTCFullYear(s, e - 1, n), d.getTime() + bi * h;
|
|
1084
|
+
}
|
|
1085
|
+
function ee(t) {
|
|
1086
|
+
const e = no(t), n = 1e3 * t.time.microsecond + t.time.nanosecond;
|
|
1087
|
+
return y.add(Ge(e), y.BigInt(n));
|
|
1088
|
+
}
|
|
1089
|
+
function ja(t) {
|
|
1090
|
+
let e = Be(t, "trunc"), n = y.toNumber(y.remainder(t, Un));
|
|
1091
|
+
n < 0 && (n += 1e6, e -= 1);
|
|
1092
|
+
const r = Math.floor(n / 1e3) % 1e3, o = n % 1e3, a = new Date(e);
|
|
1093
|
+
return { epochMilliseconds: e, isoDate: { year: a.getUTCFullYear(), month: a.getUTCMonth() + 1, day: a.getUTCDate() }, time: { hour: a.getUTCHours(), minute: a.getUTCMinutes(), second: a.getUTCSeconds(), millisecond: a.getUTCMilliseconds(), microsecond: r, nanosecond: o } };
|
|
1094
|
+
}
|
|
1095
|
+
function ro(t, e) {
|
|
1096
|
+
if (t === "UTC") return null;
|
|
1097
|
+
const n = Be(e, "floor");
|
|
1098
|
+
if (n < Mn) return ro(t, Ge(Mn));
|
|
1099
|
+
const r = Date.now(), o = Math.max(n, r) + 366 * Et * 3;
|
|
1100
|
+
let a = n, i = $t(t, a), s = a, h = i;
|
|
1101
|
+
for (; i === h && a < o; ) {
|
|
1102
|
+
if (s = a + 2 * Et * 7, s > ya) return null;
|
|
1103
|
+
h = $t(t, s), i === h && (a = s);
|
|
1104
|
+
}
|
|
1105
|
+
return i === h ? null : Ge(Wa(((d) => $t(t, d)), a, s, i, h));
|
|
1106
|
+
}
|
|
1107
|
+
function qr(t, e) {
|
|
1108
|
+
if (t === "UTC") return null;
|
|
1109
|
+
const n = Be(e, "ceil"), r = Date.now(), o = r + 366 * Et * 3;
|
|
1110
|
+
if (n > o) {
|
|
1111
|
+
const d = qr(t, Ge(o));
|
|
1112
|
+
if (d === null || y.lessThan(d, Ge(r))) return d;
|
|
1113
|
+
}
|
|
1114
|
+
if (t === "Africa/Casablanca" || t === "Africa/El_Aaiun") {
|
|
1115
|
+
const d = Date.UTC(2088, 0, 1);
|
|
1116
|
+
if (d < n) return qr(t, Ge(d));
|
|
1117
|
+
}
|
|
1118
|
+
let a = n - 1;
|
|
1119
|
+
if (a < Mn) return null;
|
|
1120
|
+
let i = $t(t, a), s = a, h = i;
|
|
1121
|
+
for (; i === h && a > Mn; ) {
|
|
1122
|
+
if (s = a - 2 * Et * 7, s < Mn) return null;
|
|
1123
|
+
h = $t(t, s), i === h && (a = s);
|
|
1124
|
+
}
|
|
1125
|
+
return i === h ? null : Ge(Wa(((d) => $t(t, d)), s, a, h, i));
|
|
1126
|
+
}
|
|
1127
|
+
function xa(t, e) {
|
|
1128
|
+
return (function(n) {
|
|
1129
|
+
const r = n.split(/[^\w]+/);
|
|
1130
|
+
if (r.length !== 7) throw new RangeError(`expected 7 parts in "${n}`);
|
|
1131
|
+
const o = +r[0], a = +r[1];
|
|
1132
|
+
let i = +r[2];
|
|
1133
|
+
const s = r[3];
|
|
1134
|
+
if (s[0] === "b" || s[0] === "B") i = 1 - i;
|
|
1135
|
+
else if (s[0] !== "a" && s[0] !== "A") throw new RangeError(`Unknown era ${s} in "${n}`);
|
|
1136
|
+
const h = r[4] === "24" ? 0 : +r[4], d = +r[5], u = +r[6];
|
|
1137
|
+
if (!(Number.isFinite(i) && Number.isFinite(o) && Number.isFinite(a) && Number.isFinite(h) && Number.isFinite(d) && Number.isFinite(u))) throw new RangeError(`Invalid number in "${n}`);
|
|
1138
|
+
return { year: i, month: o, day: a, hour: h, minute: d, second: u };
|
|
1139
|
+
})(ga(t).format(e));
|
|
1140
|
+
}
|
|
1141
|
+
function cr(t) {
|
|
1142
|
+
return t !== void 0 && !(t % 4 != 0 || t % 100 == 0 && t % 400 != 0);
|
|
1143
|
+
}
|
|
1144
|
+
function Ot(t, e) {
|
|
1145
|
+
return { standard: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], leapyear: [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] }[cr(t) ? "leapyear" : "standard"][e - 1];
|
|
1146
|
+
}
|
|
1147
|
+
function dr(t) {
|
|
1148
|
+
const e = [c(t, de), c(t, he), c(t, Te), c(t, ue), c(t, le), c(t, me), c(t, fe), c(t, ye), c(t, ge), c(t, Ie)];
|
|
1149
|
+
for (let n = 0; n < e.length; n++) {
|
|
1150
|
+
const r = e[n];
|
|
1151
|
+
if (r !== 0) return r < 0 ? -1 : 1;
|
|
1152
|
+
}
|
|
1153
|
+
return 0;
|
|
1154
|
+
}
|
|
1155
|
+
function Er(t) {
|
|
1156
|
+
const e = ["years", "months", "weeks", "days"];
|
|
1157
|
+
for (let n = 0; n < e.length; n++) {
|
|
1158
|
+
const r = t[e[n]];
|
|
1159
|
+
if (r !== 0) return r < 0 ? -1 : 1;
|
|
1160
|
+
}
|
|
1161
|
+
return 0;
|
|
1162
|
+
}
|
|
1163
|
+
function La(t) {
|
|
1164
|
+
const e = Er(t.date);
|
|
1165
|
+
return e !== 0 ? e : t.time.sign();
|
|
1166
|
+
}
|
|
1167
|
+
function Ct(t, e) {
|
|
1168
|
+
let n = t, r = e;
|
|
1169
|
+
if (!Number.isFinite(n) || !Number.isFinite(r)) throw new RangeError("infinity is out of range");
|
|
1170
|
+
return r -= 1, n += Math.floor(r / 12), r %= 12, r < 0 && (r += 12), r += 1, { year: n, month: r };
|
|
1171
|
+
}
|
|
1172
|
+
function Oe(t, e, n) {
|
|
1173
|
+
let r = t, o = e, a = n;
|
|
1174
|
+
if (!Number.isFinite(a)) throw new RangeError("infinity is out of range");
|
|
1175
|
+
({ year: r, month: o } = Ct(r, o));
|
|
1176
|
+
const i = 146097;
|
|
1177
|
+
if (Math.abs(a) > i) {
|
|
1178
|
+
const d = Math.trunc(a / i);
|
|
1179
|
+
r += 400 * d, a -= d * i;
|
|
1180
|
+
}
|
|
1181
|
+
let s = 0, h = o > 2 ? r : r - 1;
|
|
1182
|
+
for (; s = cr(h) ? 366 : 365, a < -s; ) r -= 1, h -= 1, a += s;
|
|
1183
|
+
for (h += 1; s = cr(h) ? 366 : 365, a > s; ) r += 1, h += 1, a -= s;
|
|
1184
|
+
for (; a < 1; ) ({ year: r, month: o } = Ct(r, o - 1)), a += Ot(r, o);
|
|
1185
|
+
for (; a > Ot(r, o); ) a -= Ot(r, o), { year: r, month: o } = Ct(r, o + 1);
|
|
1186
|
+
return { year: r, month: o, day: a };
|
|
1187
|
+
}
|
|
1188
|
+
function Nn(t, e, n, r, o, a, i, s, h) {
|
|
1189
|
+
const d = gt(r, o, a, i, s, h);
|
|
1190
|
+
return j(Oe(t, e, n + d.deltaDays), d);
|
|
1191
|
+
}
|
|
1192
|
+
function gt(t, e, n, r, o, a) {
|
|
1193
|
+
let i, s = t, h = e, d = n, u = r, l = o, m = a;
|
|
1194
|
+
({ div: i, mod: m } = Wt(m, 3)), l += i, m < 0 && (l -= 1, m += 1e3), { div: i, mod: l } = Wt(l, 3), u += i, l < 0 && (u -= 1, l += 1e3), d += Math.trunc(u / 1e3), u %= 1e3, u < 0 && (d -= 1, u += 1e3), h += Math.trunc(d / 60), d %= 60, d < 0 && (h -= 1, d += 60), s += Math.trunc(h / 60), h %= 60, h < 0 && (s -= 1, h += 60);
|
|
1195
|
+
let f = Math.trunc(s / 24);
|
|
1196
|
+
return s %= 24, s < 0 && (f -= 1, s += 24), f += 0, s += 0, h += 0, d += 0, u += 0, l += 0, m += 0, { deltaDays: f, hour: s, minute: h, second: d, millisecond: u, microsecond: l, nanosecond: m };
|
|
1197
|
+
}
|
|
1198
|
+
function xo(t, e) {
|
|
1199
|
+
const n = re(t, 0);
|
|
1200
|
+
if (Er(n) === 0) return t.days;
|
|
1201
|
+
const r = c(e, C), o = Ne(c(e, b), r, n, "constrain"), a = kt(r.year, r.month - 1, r.day), i = kt(o.year, o.month - 1, o.day) - a;
|
|
1202
|
+
return t.days + i;
|
|
1203
|
+
}
|
|
1204
|
+
function Ye(t) {
|
|
1205
|
+
return new (te("%Temporal.Duration%"))(-c(t, de), -c(t, he), -c(t, Te), -c(t, ue), -c(t, le), -c(t, me), -c(t, fe), -c(t, ye), -c(t, ge), -c(t, Ie));
|
|
1206
|
+
}
|
|
1207
|
+
function pe(t, e, n) {
|
|
1208
|
+
return Math.min(n, Math.max(e, t));
|
|
1209
|
+
}
|
|
1210
|
+
function Ua(t, e, n) {
|
|
1211
|
+
const r = pe(e, 1, 12);
|
|
1212
|
+
return { year: t, month: r, day: pe(n, 1, Ot(t, r)) };
|
|
1213
|
+
}
|
|
1214
|
+
function G(t, e, n) {
|
|
1215
|
+
if (t < e || t > n) throw new RangeError(`value out of range: ${e} <= ${t} <= ${n}`);
|
|
1216
|
+
}
|
|
1217
|
+
function Rt(t, e, n) {
|
|
1218
|
+
G(e, 1, 12), G(n, 1, Ot(t, e));
|
|
1219
|
+
}
|
|
1220
|
+
function Lt(t) {
|
|
1221
|
+
St(j(t, { deltaDays: 0, hour: 12, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 }));
|
|
1222
|
+
}
|
|
1223
|
+
function Mr(t, e, n, r, o, a) {
|
|
1224
|
+
G(t, 0, 23), G(e, 0, 59), G(n, 0, 59), G(r, 0, 999), G(o, 0, 999), G(a, 0, 999);
|
|
1225
|
+
}
|
|
1226
|
+
function oo(t, e, n, r, o, a, i, s, h) {
|
|
1227
|
+
Rt(t, e, n), Mr(r, o, a, i, s, h);
|
|
1228
|
+
}
|
|
1229
|
+
function St(t) {
|
|
1230
|
+
const e = ee(t);
|
|
1231
|
+
(y.lessThan(e, wi) || y.greaterThan(e, vi)) && Xe(e);
|
|
1232
|
+
}
|
|
1233
|
+
function Wr(t) {
|
|
1234
|
+
ee(t);
|
|
1235
|
+
}
|
|
1236
|
+
function Xe(t) {
|
|
1237
|
+
if (y.lessThan(t, On) || y.greaterThan(t, Kt)) throw new RangeError("date/time value is outside of supported range");
|
|
1238
|
+
}
|
|
1239
|
+
function ao({ year: t, month: e }) {
|
|
1240
|
+
G(t, Eo, Mo), t === Eo ? G(e, 4, 12) : t === Mo && G(e, 1, 9);
|
|
1241
|
+
}
|
|
1242
|
+
function Dr(t, e, n, r, o, a, i, s, h, d) {
|
|
1243
|
+
let u = 0;
|
|
1244
|
+
const l = [t, e, n, r, o, a, i, s, h, d];
|
|
1245
|
+
for (let E = 0; E < l.length; E++) {
|
|
1246
|
+
const T = l[E];
|
|
1247
|
+
if (T === 1 / 0 || T === -1 / 0) throw new RangeError("infinite values not allowed as duration fields");
|
|
1248
|
+
if (T !== 0) {
|
|
1249
|
+
const D = T < 0 ? -1 : 1;
|
|
1250
|
+
if (u !== 0 && D !== u) throw new RangeError("mixed-sign values not allowed as duration fields");
|
|
1251
|
+
u = D;
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
if (Math.abs(t) >= 2 ** 32 || Math.abs(e) >= 2 ** 32 || Math.abs(n) >= 2 ** 32) throw new RangeError("years, months, and weeks must be < 2³²");
|
|
1255
|
+
const m = Wt(s, 3), f = Wt(h, 6), p = Wt(d, 9), v = Wt(1e6 * m.mod + 1e3 * f.mod + p.mod, 9).div, w = 86400 * r + 3600 * o + 60 * a + i + m.div + f.div + p.div + v;
|
|
1256
|
+
if (!Number.isSafeInteger(w)) throw new RangeError("total of duration time units cannot exceed 9007199254740991.999999999 s");
|
|
1257
|
+
}
|
|
1258
|
+
function qt(t) {
|
|
1259
|
+
return { date: { years: c(t, de), months: c(t, he), weeks: c(t, Te), days: c(t, ue) }, time: k.fromComponents(c(t, le), c(t, me), c(t, fe), c(t, ye), c(t, ge), c(t, Ie)) };
|
|
1260
|
+
}
|
|
1261
|
+
function Je(t) {
|
|
1262
|
+
const e = k.fromComponents(c(t, le), c(t, me), c(t, fe), c(t, ye), c(t, ge), c(t, Ie)).add24HourDays(c(t, ue));
|
|
1263
|
+
return { date: { years: c(t, de), months: c(t, he), weeks: c(t, Te), days: 0 }, time: e };
|
|
1264
|
+
}
|
|
1265
|
+
function Pa(t) {
|
|
1266
|
+
const e = Je(t), n = Math.trunc(e.time.sec / 86400);
|
|
1267
|
+
return Dr(e.date.years, e.date.months, e.date.weeks, n, 0, 0, 0, 0, 0, 0), { ...e.date, days: n };
|
|
1268
|
+
}
|
|
1269
|
+
function Ue(t, e) {
|
|
1270
|
+
const n = t.time.sign();
|
|
1271
|
+
let r = t.time.abs().subsec, o = 0, a = 0, i = t.time.abs().sec, s = 0, h = 0, d = 0;
|
|
1272
|
+
switch (e) {
|
|
1273
|
+
case "year":
|
|
1274
|
+
case "month":
|
|
1275
|
+
case "week":
|
|
1276
|
+
case "day":
|
|
1277
|
+
o = Math.trunc(r / 1e3), r %= 1e3, a = Math.trunc(o / 1e3), o %= 1e3, i += Math.trunc(a / 1e3), a %= 1e3, s = Math.trunc(i / 60), i %= 60, h = Math.trunc(s / 60), s %= 60, d = Math.trunc(h / 24), h %= 24;
|
|
1278
|
+
break;
|
|
1279
|
+
case "hour":
|
|
1280
|
+
o = Math.trunc(r / 1e3), r %= 1e3, a = Math.trunc(o / 1e3), o %= 1e3, i += Math.trunc(a / 1e3), a %= 1e3, s = Math.trunc(i / 60), i %= 60, h = Math.trunc(s / 60), s %= 60;
|
|
1281
|
+
break;
|
|
1282
|
+
case "minute":
|
|
1283
|
+
o = Math.trunc(r / 1e3), r %= 1e3, a = Math.trunc(o / 1e3), o %= 1e3, i += Math.trunc(a / 1e3), a %= 1e3, s = Math.trunc(i / 60), i %= 60;
|
|
1284
|
+
break;
|
|
1285
|
+
case "second":
|
|
1286
|
+
o = Math.trunc(r / 1e3), r %= 1e3, a = Math.trunc(o / 1e3), o %= 1e3, i += Math.trunc(a / 1e3), a %= 1e3;
|
|
1287
|
+
break;
|
|
1288
|
+
case "millisecond":
|
|
1289
|
+
o = Math.trunc(r / 1e3), r %= 1e3, a = $r(i, 3, Math.trunc(o / 1e3)), o %= 1e3, i = 0;
|
|
1290
|
+
break;
|
|
1291
|
+
case "microsecond":
|
|
1292
|
+
o = $r(i, 6, Math.trunc(r / 1e3)), r %= 1e3, i = 0;
|
|
1293
|
+
break;
|
|
1294
|
+
case "nanosecond":
|
|
1295
|
+
r = $r(i, 9, r), i = 0;
|
|
1296
|
+
}
|
|
1297
|
+
return new (te("%Temporal.Duration%"))(t.date.years, t.date.months, t.date.weeks, t.date.days + n * d, n * h, n * s, n * i, n * a, n * o, n * r);
|
|
1298
|
+
}
|
|
1299
|
+
function ct(t, e) {
|
|
1300
|
+
return Er(t), e.sign(), { date: t, time: e };
|
|
1301
|
+
}
|
|
1302
|
+
function kt(t, e, n) {
|
|
1303
|
+
return no({ isoDate: { year: t, month: e + 1, day: n }, time: { hour: 0, minute: 0, second: 0, millisecond: 0 } }) / Et;
|
|
1304
|
+
}
|
|
1305
|
+
function Jt({ year: t, month: e, day: n }) {
|
|
1306
|
+
if (Math.abs(kt(t, e - 1, n)) > 1e8) throw new RangeError("date/time value is outside the supported range");
|
|
1307
|
+
}
|
|
1308
|
+
function io(t, e) {
|
|
1309
|
+
const n = e.hour - t.hour, r = e.minute - t.minute, o = e.second - t.second, a = e.millisecond - t.millisecond, i = e.microsecond - t.microsecond, s = e.nanosecond - t.nanosecond;
|
|
1310
|
+
return k.fromComponents(n, r, o, a, i, s);
|
|
1311
|
+
}
|
|
1312
|
+
function so(t, e, n, r, o) {
|
|
1313
|
+
let a = k.fromEpochNsDiff(e, t);
|
|
1314
|
+
return a = hr(a, n, r, o), ct({ years: 0, months: 0, weeks: 0, days: 0 }, a);
|
|
1315
|
+
}
|
|
1316
|
+
function Za(t, e, n, r) {
|
|
1317
|
+
Wr(t), Wr(e);
|
|
1318
|
+
let o = io(t.time, e.time);
|
|
1319
|
+
const a = o.sign(), i = Qe(t.isoDate, e.isoDate);
|
|
1320
|
+
let s = e.isoDate;
|
|
1321
|
+
i === a && (s = Oe(s.year, s.month, s.day + a), o = o.add24HourDays(-a));
|
|
1322
|
+
const h = st("day", r), d = Wn(n, t.isoDate, s, h);
|
|
1323
|
+
return r !== h && (o = o.add24HourDays(d.days), d.days = 0), ct(d, o);
|
|
1324
|
+
}
|
|
1325
|
+
function Fa(t, e, n, r, o) {
|
|
1326
|
+
const a = y.subtract(e, t);
|
|
1327
|
+
if (y.equal(a, ke)) return { date: { years: 0, months: 0, weeks: 0, days: 0 }, time: k.ZERO };
|
|
1328
|
+
const i = y.lessThan(a, ke) ? -1 : 1, s = Fe(n, t), h = Fe(n, e);
|
|
1329
|
+
let d, u = 0, l = i === 1 ? 2 : 1, m = io(s.time, h.time);
|
|
1330
|
+
for (m.sign() === -i && u++; u <= l; u++) {
|
|
1331
|
+
d = j(Oe(h.isoDate.year, h.isoDate.month, h.isoDate.day - u * i), s.time);
|
|
1332
|
+
const p = oe(n, d, "compatible");
|
|
1333
|
+
if (m = k.fromEpochNsDiff(e, p), m.sign() !== -i) break;
|
|
1334
|
+
}
|
|
1335
|
+
const f = st("day", o);
|
|
1336
|
+
return ct(Wn(r, s.isoDate, d.isoDate, f), m);
|
|
1337
|
+
}
|
|
1338
|
+
function Ba(t, e, n, r, o, a, i, s, h) {
|
|
1339
|
+
let d, u, l, m, f = e;
|
|
1340
|
+
switch (s) {
|
|
1341
|
+
case "year": {
|
|
1342
|
+
const U = wt(f.date.years, i, "trunc");
|
|
1343
|
+
d = U, u = U + i * t, l = { years: d, months: 0, weeks: 0, days: 0 }, m = { ...l, years: u };
|
|
1344
|
+
break;
|
|
1345
|
+
}
|
|
1346
|
+
case "month": {
|
|
1347
|
+
const U = wt(f.date.months, i, "trunc");
|
|
1348
|
+
d = U, u = U + i * t, l = re(f.date, 0, 0, d), m = re(f.date, 0, 0, u);
|
|
1349
|
+
break;
|
|
1350
|
+
}
|
|
1351
|
+
case "week": {
|
|
1352
|
+
const U = re(f.date, 0, 0), ae = Ne(a, r.isoDate, U, "constrain"), Re = Wn(a, ae, Oe(ae.year, ae.month, ae.day + f.date.days), "week"), ft = wt(f.date.weeks + Re.weeks, i, "trunc");
|
|
1353
|
+
d = ft, u = ft + i * t, l = re(f.date, 0, d), m = re(f.date, 0, u);
|
|
1354
|
+
break;
|
|
1355
|
+
}
|
|
1356
|
+
case "day": {
|
|
1357
|
+
const U = wt(f.date.days, i, "trunc");
|
|
1358
|
+
d = U, u = U + i * t, l = re(f.date, d), m = re(f.date, u);
|
|
1359
|
+
break;
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
const p = Ne(a, r.isoDate, l, "constrain"), v = Ne(a, r.isoDate, m, "constrain");
|
|
1363
|
+
let w, E;
|
|
1364
|
+
const T = j(p, r.time), D = j(v, r.time);
|
|
1365
|
+
o ? (w = oe(o, T, "compatible"), E = oe(o, D, "compatible")) : (w = ee(T), E = ee(D));
|
|
1366
|
+
const Y = k.fromEpochNsDiff(n, w), O = k.fromEpochNsDiff(E, w), W = fr(h, t < 0 ? "negative" : "positive"), K = Y.add(Y).abs().subtract(O.abs()).sign(), H = Math.abs(d) / i % 2 == 0, Z = Y.isZero() ? Math.abs(d) : Y.cmp(O) ? yr(Math.abs(d), Math.abs(u), K, H, W) : Math.abs(u), De = new k(y.add(y.multiply(O.totalNs, y.BigInt(d)), y.multiply(Y.totalNs, y.BigInt(i * t)))).fdiv(O.totalNs), V = Z === Math.abs(u);
|
|
1367
|
+
return f = { date: V ? m : l, time: k.ZERO }, { nudgeResult: { duration: f, nudgedEpochNs: V ? E : w, didExpandCalendarUnit: V }, total: De };
|
|
1368
|
+
}
|
|
1369
|
+
function Tr(t, e, n, r, o, a, i, s, h) {
|
|
1370
|
+
let d = t;
|
|
1371
|
+
const u = We(s) || r && s === "day", l = La(d) < 0 ? -1 : 1;
|
|
1372
|
+
let m;
|
|
1373
|
+
return u ? { nudgeResult: m } = Ba(l, d, e, n, r, o, i, s, h) : m = r ? (function(f, p, v, w, E, T, D, Y) {
|
|
1374
|
+
let O = p;
|
|
1375
|
+
const W = Ne(E, v.isoDate, O.date, "constrain"), K = j(W, v.time), H = j(Oe(W.year, W.month, W.day + f), v.time), Z = oe(w, K, "compatible"), De = oe(w, H, "compatible"), V = k.fromEpochNsDiff(De, Z);
|
|
1376
|
+
if (V.sign() !== f) throw new RangeError("time zone returned inconsistent Instants");
|
|
1377
|
+
const U = y.BigInt(Xt[D] * T);
|
|
1378
|
+
let ae = O.time.round(U, Y);
|
|
1379
|
+
const Re = ae.subtract(V), ft = Re.sign() !== -f;
|
|
1380
|
+
let Pt, Zt;
|
|
1381
|
+
return ft ? (Pt = f, ae = Re.round(U, Y), Zt = ae.addToEpochNs(De)) : (Pt = 0, Zt = ae.addToEpochNs(Z)), { duration: ct(re(O.date, O.date.days + Pt), ae), nudgedEpochNs: Zt, didExpandCalendarUnit: ft };
|
|
1382
|
+
})(l, d, n, r, o, i, s, h) : (function(f, p, v, w, E, T) {
|
|
1383
|
+
let D = f;
|
|
1384
|
+
const Y = D.time.add24HourDays(D.date.days), O = Y.round(y.BigInt(w * Xt[E]), T), W = O.subtract(Y), { quotient: K } = Y.divmod(rr), { quotient: H } = O.divmod(rr), Z = Math.sign(H - K) === Y.sign(), De = W.addToEpochNs(p);
|
|
1385
|
+
let V = 0, U = O;
|
|
1386
|
+
return ot(v) === "date" && (V = H, U = O.add(k.fromComponents(24 * -H, 0, 0, 0, 0, 0))), { duration: { date: re(D.date, V), time: U }, nudgedEpochNs: De, didExpandCalendarUnit: Z };
|
|
1387
|
+
})(d, e, a, i, s, h), d = m.duration, m.didExpandCalendarUnit && s !== "week" && (d = (function(f, p, v, w, E, T, D, Y) {
|
|
1388
|
+
let O = p;
|
|
1389
|
+
if (Y === D) return O;
|
|
1390
|
+
const W = Dn.indexOf(D);
|
|
1391
|
+
for (let K = Dn.indexOf(Y) - 1; K >= W; K--) {
|
|
1392
|
+
const H = Dn[K];
|
|
1393
|
+
if (H === "week" && D !== "week") continue;
|
|
1394
|
+
let Z;
|
|
1395
|
+
switch (H) {
|
|
1396
|
+
case "year":
|
|
1397
|
+
Z = { years: O.date.years + f, months: 0, weeks: 0, days: 0 };
|
|
1398
|
+
break;
|
|
1399
|
+
case "month": {
|
|
1400
|
+
const U = O.date.months + f;
|
|
1401
|
+
Z = re(O.date, 0, 0, U);
|
|
1402
|
+
break;
|
|
1403
|
+
}
|
|
1404
|
+
case "week": {
|
|
1405
|
+
const U = O.date.weeks + f;
|
|
1406
|
+
Z = re(O.date, 0, U);
|
|
1407
|
+
break;
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
const De = j(Ne(T, w.isoDate, Z, "constrain"), w.time);
|
|
1411
|
+
let V;
|
|
1412
|
+
if (V = E ? oe(E, De, "compatible") : ee(De), tr(v, V) === -f) break;
|
|
1413
|
+
O = { date: Z, time: k.ZERO };
|
|
1414
|
+
}
|
|
1415
|
+
return O;
|
|
1416
|
+
})(l, d, m.nudgedEpochNs, n, r, o, a, st(s, "day"))), d;
|
|
1417
|
+
}
|
|
1418
|
+
function Lo(t, e, n, r, o, a) {
|
|
1419
|
+
return We(a) || r && a === "day" ? Ba(La(t) < 0 ? -1 : 1, t, e, n, r, o, 1, a, "trunc").total : Cn(t.time.add24HourDays(t.date.days), a);
|
|
1420
|
+
}
|
|
1421
|
+
function za(t, e, n, r, o, a, i) {
|
|
1422
|
+
if (en(t, e) == 0) return { date: { years: 0, months: 0, weeks: 0, days: 0 }, time: k.ZERO };
|
|
1423
|
+
St(t), St(e);
|
|
1424
|
+
const s = Za(t, e, n, r);
|
|
1425
|
+
return a === "nanosecond" && o === 1 ? s : Tr(s, ee(e), t, null, n, r, o, a, i);
|
|
1426
|
+
}
|
|
1427
|
+
function Aa(t, e, n, r, o, a, i, s) {
|
|
1428
|
+
if (ot(o) === "time") return so(t, e, a, i, s);
|
|
1429
|
+
const h = Fa(t, e, n, r, o);
|
|
1430
|
+
return i === "nanosecond" && a === 1 ? h : Tr(h, e, Fe(n, t), n, r, o, a, i, s);
|
|
1431
|
+
}
|
|
1432
|
+
function cn(t, e, n, r, o, a) {
|
|
1433
|
+
const i = Vt.reduce(((f, p) => {
|
|
1434
|
+
const v = p[0], w = p[1], E = p[2];
|
|
1435
|
+
return n !== "datetime" && E !== n || r.includes(w) || f.push(w, v), f;
|
|
1436
|
+
}), []);
|
|
1437
|
+
let s = $e(e, "largestUnit", n, "auto");
|
|
1438
|
+
if (r.includes(s)) throw new RangeError(`largestUnit must be one of ${i.join(", ")}, not ${s}`);
|
|
1439
|
+
const h = on(e);
|
|
1440
|
+
let d = Ae(e, "trunc");
|
|
1441
|
+
t === "since" && (d = (function(f) {
|
|
1442
|
+
switch (f) {
|
|
1443
|
+
case "ceil":
|
|
1444
|
+
return "floor";
|
|
1445
|
+
case "floor":
|
|
1446
|
+
return "ceil";
|
|
1447
|
+
case "halfCeil":
|
|
1448
|
+
return "halfFloor";
|
|
1449
|
+
case "halfFloor":
|
|
1450
|
+
return "halfCeil";
|
|
1451
|
+
default:
|
|
1452
|
+
return f;
|
|
1453
|
+
}
|
|
1454
|
+
})(d));
|
|
1455
|
+
const u = $e(e, "smallestUnit", n, o);
|
|
1456
|
+
if (r.includes(u)) throw new RangeError(`smallestUnit must be one of ${i.join(", ")}, not ${u}`);
|
|
1457
|
+
const l = st(a, u);
|
|
1458
|
+
if (s === "auto" && (s = l), st(s, u) !== s) throw new RangeError(`largestUnit ${s} cannot be smaller than smallestUnit ${u}`);
|
|
1459
|
+
const m = { hour: 24, minute: 60, second: 60, millisecond: 1e3, microsecond: 1e3, nanosecond: 1e3 }[u];
|
|
1460
|
+
return m !== void 0 && an(h, m, !1), { largestUnit: s, roundingIncrement: h, roundingMode: d, smallestUnit: u };
|
|
1461
|
+
}
|
|
1462
|
+
function Uo(t, e, n, r) {
|
|
1463
|
+
const o = pn(n), a = cn(t, M(r), "time", [], "nanosecond", "second");
|
|
1464
|
+
let i = Ue(so(c(e, I), c(o, I), a.roundingIncrement, a.smallestUnit, a.roundingMode), a.largestUnit);
|
|
1465
|
+
return t === "since" && (i = Ye(i)), i;
|
|
1466
|
+
}
|
|
1467
|
+
function Po(t, e, n, r) {
|
|
1468
|
+
const o = yn(n), a = c(e, b), i = c(o, b);
|
|
1469
|
+
if (!Ve(a, i)) throw new RangeError(`cannot compute difference between dates of ${a} and ${i} calendars`);
|
|
1470
|
+
const s = cn(t, M(r), "date", [], "day", "day"), h = te("%Temporal.Duration%"), d = c(e, C), u = c(o, C);
|
|
1471
|
+
if (Qe(d, u) === 0) return new h();
|
|
1472
|
+
let l = { date: Wn(a, d, u, s.largestUnit), time: k.ZERO };
|
|
1473
|
+
if (s.smallestUnit !== "day" || s.roundingIncrement !== 1) {
|
|
1474
|
+
const f = j(d, { deltaDays: 0, hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 });
|
|
1475
|
+
l = Tr(l, ee(j(u, { deltaDays: 0, hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 })), f, null, a, s.largestUnit, s.roundingIncrement, s.smallestUnit, s.roundingMode);
|
|
1476
|
+
}
|
|
1477
|
+
let m = Ue(l, "day");
|
|
1478
|
+
return t === "since" && (m = Ye(m)), m;
|
|
1479
|
+
}
|
|
1480
|
+
function Zo(t, e, n, r) {
|
|
1481
|
+
const o = gn(n), a = c(e, b), i = c(o, b);
|
|
1482
|
+
if (!Ve(a, i)) throw new RangeError(`cannot compute difference between dates of ${a} and ${i} calendars`);
|
|
1483
|
+
const s = cn(t, M(r), "datetime", [], "nanosecond", "day"), h = te("%Temporal.Duration%"), d = c(e, P), u = c(o, P);
|
|
1484
|
+
if (en(d, u) === 0) return new h();
|
|
1485
|
+
let l = Ue(za(d, u, a, s.largestUnit, s.roundingIncrement, s.smallestUnit, s.roundingMode), s.largestUnit);
|
|
1486
|
+
return t === "since" && (l = Ye(l)), l;
|
|
1487
|
+
}
|
|
1488
|
+
function Fo(t, e, n, r) {
|
|
1489
|
+
const o = pt(n), a = cn(t, M(r), "time", [], "nanosecond", "hour");
|
|
1490
|
+
let i = io(c(e, z), c(o, z));
|
|
1491
|
+
i = hr(i, a.roundingIncrement, a.smallestUnit, a.roundingMode);
|
|
1492
|
+
let s = Ue(ct({ years: 0, months: 0, weeks: 0, days: 0 }, i), a.largestUnit);
|
|
1493
|
+
return t === "since" && (s = Ye(s)), s;
|
|
1494
|
+
}
|
|
1495
|
+
function Bo(t, e, n, r) {
|
|
1496
|
+
const o = wn(n), a = c(e, b), i = c(o, b);
|
|
1497
|
+
if (!Ve(a, i)) throw new RangeError(`cannot compute difference between months of ${a} and ${i} calendars`);
|
|
1498
|
+
const s = cn(t, M(r), "date", ["week", "day"], "month", "year"), h = te("%Temporal.Duration%");
|
|
1499
|
+
if (Qe(c(e, C), c(o, C)) == 0) return new h();
|
|
1500
|
+
const d = be(a, c(e, C), "year-month");
|
|
1501
|
+
d.day = 1;
|
|
1502
|
+
const u = Mt(a, d, "constrain"), l = be(a, c(o, C), "year-month");
|
|
1503
|
+
l.day = 1;
|
|
1504
|
+
const m = Mt(a, l, "constrain");
|
|
1505
|
+
let f = { date: re(Wn(a, u, m, s.largestUnit), 0, 0), time: k.ZERO };
|
|
1506
|
+
if (s.smallestUnit !== "month" || s.roundingIncrement !== 1) {
|
|
1507
|
+
const v = j(u, { deltaDays: 0, hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 });
|
|
1508
|
+
f = Tr(f, ee(j(m, { deltaDays: 0, hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 })), v, null, a, s.largestUnit, s.roundingIncrement, s.smallestUnit, s.roundingMode);
|
|
1509
|
+
}
|
|
1510
|
+
let p = Ue(f, "day");
|
|
1511
|
+
return t === "since" && (p = Ye(p)), p;
|
|
1512
|
+
}
|
|
1513
|
+
function zo(t, e, n, r) {
|
|
1514
|
+
const o = vn(n), a = c(e, b), i = c(o, b);
|
|
1515
|
+
if (!Ve(a, i)) throw new RangeError(`cannot compute difference between dates of ${a} and ${i} calendars`);
|
|
1516
|
+
const s = cn(t, M(r), "datetime", [], "nanosecond", "hour"), h = c(e, I), d = c(o, I), u = te("%Temporal.Duration%");
|
|
1517
|
+
let l;
|
|
1518
|
+
if (ot(s.largestUnit) !== "date") l = Ue(so(h, d, s.roundingIncrement, s.smallestUnit, s.roundingMode), s.largestUnit);
|
|
1519
|
+
else {
|
|
1520
|
+
const m = c(e, x);
|
|
1521
|
+
if (!Ra(m, c(o, x))) throw new RangeError("When calculating difference between time zones, largestUnit must be 'hours' or smaller because day lengths can vary between time zones due to DST or time zone offset changes.");
|
|
1522
|
+
if (y.equal(h, d)) return new u();
|
|
1523
|
+
l = Ue(Aa(h, d, m, a, s.largestUnit, s.roundingIncrement, s.smallestUnit, s.roundingMode), "hour");
|
|
1524
|
+
}
|
|
1525
|
+
return t === "since" && (l = Ye(l)), l;
|
|
1526
|
+
}
|
|
1527
|
+
function Qt({ hour: t, minute: e, second: n, millisecond: r, microsecond: o, nanosecond: a }, i) {
|
|
1528
|
+
let s = n, h = a;
|
|
1529
|
+
return s += i.sec, h += i.subsec, gt(t, e, s, r, o, h);
|
|
1530
|
+
}
|
|
1531
|
+
function Hr(t, e) {
|
|
1532
|
+
const n = e.addToEpochNs(t);
|
|
1533
|
+
return Xe(n), n;
|
|
1534
|
+
}
|
|
1535
|
+
function bn(t, e, n, r, o = "constrain") {
|
|
1536
|
+
if (Er(r.date) === 0) return Hr(t, r.time);
|
|
1537
|
+
const a = Fe(e, t);
|
|
1538
|
+
return Hr(oe(e, j(Ne(n, a.isoDate, r.date, o), a.time), "compatible"), r.time);
|
|
1539
|
+
}
|
|
1540
|
+
function Ao(t, e, n) {
|
|
1541
|
+
let r = Ze(n);
|
|
1542
|
+
t === "subtract" && (r = Ye(r));
|
|
1543
|
+
const o = st(rt(e), rt(r));
|
|
1544
|
+
if (We(o)) throw new RangeError("For years, months, or weeks arithmetic, use date arithmetic relative to a starting point");
|
|
1545
|
+
const a = Je(e), i = Je(r);
|
|
1546
|
+
return Ue(ct({ years: 0, months: 0, weeks: 0, days: 0 }, a.time.add(i.time)), o);
|
|
1547
|
+
}
|
|
1548
|
+
function qo(t, e, n) {
|
|
1549
|
+
let r = Ze(n);
|
|
1550
|
+
t === "subtract" && (r = Ye(r));
|
|
1551
|
+
const o = rt(r);
|
|
1552
|
+
if (ot(o) === "date") throw new RangeError(`Duration field ${o} not supported by Temporal.Instant. Try Temporal.ZonedDateTime instead.`);
|
|
1553
|
+
const a = Je(r);
|
|
1554
|
+
return _e(Hr(c(e, I), a.time));
|
|
1555
|
+
}
|
|
1556
|
+
function Wo(t, e, n, r) {
|
|
1557
|
+
const o = c(e, b);
|
|
1558
|
+
let a = Ze(n);
|
|
1559
|
+
t === "subtract" && (a = Ye(a));
|
|
1560
|
+
const i = Pa(a), s = N(M(r));
|
|
1561
|
+
return we(Ne(o, c(e, C), i, s), o);
|
|
1562
|
+
}
|
|
1563
|
+
function Ho(t, e, n, r) {
|
|
1564
|
+
let o = Ze(n);
|
|
1565
|
+
t === "subtract" && (o = Ye(o));
|
|
1566
|
+
const a = N(M(r)), i = c(e, b), s = Je(o), h = c(e, P), d = Qt(h.time, s.time), u = re(s.date, d.deltaDays);
|
|
1567
|
+
return Dr(u.years, u.months, u.weeks, u.days, 0, 0, 0, 0, 0, 0), Le(j(Ne(i, h.isoDate, u, a), d), i);
|
|
1568
|
+
}
|
|
1569
|
+
function _o(t, e, n) {
|
|
1570
|
+
let r = Ze(n);
|
|
1571
|
+
t === "subtract" && (r = Ye(r));
|
|
1572
|
+
const o = Je(r), { hour: a, minute: i, second: s, millisecond: h, microsecond: d, nanosecond: u } = Qt(c(e, z), o.time);
|
|
1573
|
+
return at(vr(a, i, s, h, d, u, "reject"));
|
|
1574
|
+
}
|
|
1575
|
+
function Jo(t, e, n, r) {
|
|
1576
|
+
let o = Ze(n);
|
|
1577
|
+
t === "subtract" && (o = Ye(o));
|
|
1578
|
+
const a = N(M(r)), i = dr(o), s = c(e, b), h = be(s, c(e, C), "year-month");
|
|
1579
|
+
h.day = 1;
|
|
1580
|
+
let d = Mt(s, h, "constrain");
|
|
1581
|
+
if (i < 0) {
|
|
1582
|
+
const l = Ne(s, d, { months: 1 }, "constrain");
|
|
1583
|
+
d = Oe(l.year, l.month, l.day - 1);
|
|
1584
|
+
}
|
|
1585
|
+
const u = Pa(o);
|
|
1586
|
+
return Lt(d), _t(Rn(s, be(s, Ne(s, d, u, a), "year-month"), a), s);
|
|
1587
|
+
}
|
|
1588
|
+
function Go(t, e, n, r) {
|
|
1589
|
+
let o = Ze(n);
|
|
1590
|
+
t === "subtract" && (o = Ye(o));
|
|
1591
|
+
const a = N(M(r)), i = c(e, x), s = c(e, b), h = qt(o);
|
|
1592
|
+
return ne(bn(c(e, I), i, s, h, a), i, s);
|
|
1593
|
+
}
|
|
1594
|
+
function wt(t, e, n) {
|
|
1595
|
+
const r = Math.trunc(t / e), o = t % e, a = t < 0 ? "negative" : "positive", i = Math.abs(r), s = i + 1, h = Ce(Math.abs(2 * o) - e), d = i % 2 == 0, u = fr(n, a), l = o === 0 ? i : yr(i, s, h, d, u);
|
|
1596
|
+
return e * (a === "positive" ? l : -l);
|
|
1597
|
+
}
|
|
1598
|
+
function _r(t, e, n, r) {
|
|
1599
|
+
const o = Xt[n] * e;
|
|
1600
|
+
return (function(a, i, s) {
|
|
1601
|
+
const h = nt(a), d = nt(i), u = y.divide(h, d), l = y.remainder(h, d), m = fr(s, "positive");
|
|
1602
|
+
let f, p;
|
|
1603
|
+
y.lessThan(h, ke) ? (f = y.subtract(u, $n), p = u) : (f = u, p = y.add(u, $n));
|
|
1604
|
+
const v = tr(It(y.multiply(l, Xr)), d) * (y.lessThan(h, ke) ? -1 : 1) + 0, w = y.equal(l, ke) ? u : yr(f, p, v, Qo(f), m);
|
|
1605
|
+
return y.multiply(w, d);
|
|
1606
|
+
})(t, y.BigInt(o), r);
|
|
1607
|
+
}
|
|
1608
|
+
function Jr(t, e, n, r) {
|
|
1609
|
+
Wr(t);
|
|
1610
|
+
const { year: o, month: a, day: i } = t.isoDate, s = Gr(t.time, e, n, r);
|
|
1611
|
+
return j(Oe(o, a, i + s.deltaDays), s);
|
|
1612
|
+
}
|
|
1613
|
+
function Gr({ hour: t, minute: e, second: n, millisecond: r, microsecond: o, nanosecond: a }, i, s, h) {
|
|
1614
|
+
let d;
|
|
1615
|
+
switch (s) {
|
|
1616
|
+
case "day":
|
|
1617
|
+
case "hour":
|
|
1618
|
+
d = 1e3 * (1e3 * (1e3 * (60 * (60 * t + e) + n) + r) + o) + a;
|
|
1619
|
+
break;
|
|
1620
|
+
case "minute":
|
|
1621
|
+
d = 1e3 * (1e3 * (1e3 * (60 * e + n) + r) + o) + a;
|
|
1622
|
+
break;
|
|
1623
|
+
case "second":
|
|
1624
|
+
d = 1e3 * (1e3 * (1e3 * n + r) + o) + a;
|
|
1625
|
+
break;
|
|
1626
|
+
case "millisecond":
|
|
1627
|
+
d = 1e3 * (1e3 * r + o) + a;
|
|
1628
|
+
break;
|
|
1629
|
+
case "microsecond":
|
|
1630
|
+
d = 1e3 * o + a;
|
|
1631
|
+
break;
|
|
1632
|
+
case "nanosecond":
|
|
1633
|
+
d = a;
|
|
1634
|
+
}
|
|
1635
|
+
const u = Xt[s], l = wt(d, u * i, h) / u;
|
|
1636
|
+
switch (s) {
|
|
1637
|
+
case "day":
|
|
1638
|
+
return { deltaDays: l, hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 };
|
|
1639
|
+
case "hour":
|
|
1640
|
+
return gt(l, 0, 0, 0, 0, 0);
|
|
1641
|
+
case "minute":
|
|
1642
|
+
return gt(t, l, 0, 0, 0, 0);
|
|
1643
|
+
case "second":
|
|
1644
|
+
return gt(t, e, l, 0, 0, 0);
|
|
1645
|
+
case "millisecond":
|
|
1646
|
+
return gt(t, e, n, l, 0, 0);
|
|
1647
|
+
case "microsecond":
|
|
1648
|
+
return gt(t, e, n, r, l, 0);
|
|
1649
|
+
case "nanosecond":
|
|
1650
|
+
return gt(t, e, n, r, o, l);
|
|
1651
|
+
default:
|
|
1652
|
+
throw new Error(`Invalid unit ${s}`);
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
function hr(t, e, n, r) {
|
|
1656
|
+
const o = Xt[n];
|
|
1657
|
+
return t.round(y.BigInt(o * e), r);
|
|
1658
|
+
}
|
|
1659
|
+
function Cn(t, e) {
|
|
1660
|
+
const n = Xt[e];
|
|
1661
|
+
return t.fdiv(y.BigInt(n));
|
|
1662
|
+
}
|
|
1663
|
+
function Qe(t, e) {
|
|
1664
|
+
return t.year !== e.year ? Ce(t.year - e.year) : t.month !== e.month ? Ce(t.month - e.month) : t.day !== e.day ? Ce(t.day - e.day) : 0;
|
|
1665
|
+
}
|
|
1666
|
+
function Kr(t, e) {
|
|
1667
|
+
return t.hour !== e.hour ? Ce(t.hour - e.hour) : t.minute !== e.minute ? Ce(t.minute - e.minute) : t.second !== e.second ? Ce(t.second - e.second) : t.millisecond !== e.millisecond ? Ce(t.millisecond - e.millisecond) : t.microsecond !== e.microsecond ? Ce(t.microsecond - e.microsecond) : t.nanosecond !== e.nanosecond ? Ce(t.nanosecond - e.nanosecond) : 0;
|
|
1668
|
+
}
|
|
1669
|
+
function en(t, e) {
|
|
1670
|
+
const n = Qe(t.isoDate, e.isoDate);
|
|
1671
|
+
return n !== 0 ? n : Kr(t.time, e.time);
|
|
1672
|
+
}
|
|
1673
|
+
function qa(t) {
|
|
1674
|
+
const e = ur(t);
|
|
1675
|
+
return globalThis.BigInt !== void 0 ? globalThis.BigInt(e.toString(10)) : e;
|
|
1676
|
+
}
|
|
1677
|
+
function Be(t, e) {
|
|
1678
|
+
const n = nt(t), { quotient: r, remainder: o } = mn(n, Un);
|
|
1679
|
+
let a = y.toNumber(r);
|
|
1680
|
+
return e === "floor" && y.toNumber(o) < 0 && (a -= 1), e === "ceil" && y.toNumber(o) > 0 && (a += 1), a;
|
|
1681
|
+
}
|
|
1682
|
+
function Ge(t) {
|
|
1683
|
+
if (!Number.isInteger(t)) throw new RangeError("epoch milliseconds must be an integer");
|
|
1684
|
+
return y.multiply(y.BigInt(t), Un);
|
|
1685
|
+
}
|
|
1686
|
+
function ur(t) {
|
|
1687
|
+
let e = t;
|
|
1688
|
+
if (typeof t == "object") {
|
|
1689
|
+
const n = t[Symbol.toPrimitive];
|
|
1690
|
+
n && typeof n == "function" && (e = n.call(t, "number"));
|
|
1691
|
+
}
|
|
1692
|
+
if (typeof e == "number") throw new TypeError("cannot convert number to bigint");
|
|
1693
|
+
return typeof e == "bigint" ? y.BigInt(e.toString(10)) : y.BigInt(e);
|
|
1694
|
+
}
|
|
1695
|
+
const Vr = (() => {
|
|
1696
|
+
let t = y.BigInt(Date.now() % 1e6);
|
|
1697
|
+
return () => {
|
|
1698
|
+
const e = Date.now(), n = y.BigInt(e), r = y.add(Ge(e), t);
|
|
1699
|
+
return t = y.remainder(n, Un), y.greaterThan(r, Kt) ? Kt : y.lessThan(r, On) ? On : r;
|
|
1700
|
+
};
|
|
1701
|
+
})();
|
|
1702
|
+
function un() {
|
|
1703
|
+
return new Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1704
|
+
}
|
|
1705
|
+
function Ce(t) {
|
|
1706
|
+
return t < 0 ? -1 : t > 0 ? 1 : t;
|
|
1707
|
+
}
|
|
1708
|
+
function M(t) {
|
|
1709
|
+
if (t === void 0) return /* @__PURE__ */ Object.create(null);
|
|
1710
|
+
if (A(t) && t !== null) return t;
|
|
1711
|
+
throw new TypeError("Options parameter must be an object, not " + (t === null ? "null" : typeof t));
|
|
1712
|
+
}
|
|
1713
|
+
function Nt(t, e) {
|
|
1714
|
+
const n = /* @__PURE__ */ Object.create(null);
|
|
1715
|
+
return n[t] = e, n;
|
|
1716
|
+
}
|
|
1717
|
+
function dt(t, e, n, r) {
|
|
1718
|
+
let o = t[e];
|
|
1719
|
+
if (o !== void 0) {
|
|
1720
|
+
if (o = pr(o), !n.includes(o)) throw new RangeError(`${e} must be one of ${n.join(", ")}, not ${o}`);
|
|
1721
|
+
return o;
|
|
1722
|
+
}
|
|
1723
|
+
if (r === ut) throw new RangeError(`${e} option is required`);
|
|
1724
|
+
return r;
|
|
1725
|
+
}
|
|
1726
|
+
function Me(t) {
|
|
1727
|
+
const e = jn(t);
|
|
1728
|
+
if (!Ei.includes(jn(e))) throw new RangeError(`invalid calendar identifier ${e}`);
|
|
1729
|
+
switch (e) {
|
|
1730
|
+
case "ethiopic-amete-alem":
|
|
1731
|
+
return "ethioaa";
|
|
1732
|
+
case "islamicc":
|
|
1733
|
+
return "islamic-civil";
|
|
1734
|
+
}
|
|
1735
|
+
return e;
|
|
1736
|
+
}
|
|
1737
|
+
function jn(t) {
|
|
1738
|
+
let e = "";
|
|
1739
|
+
for (let n = 0; n < t.length; n++) {
|
|
1740
|
+
const r = t.charCodeAt(n);
|
|
1741
|
+
e += r >= 65 && r <= 90 ? String.fromCharCode(r + 32) : String.fromCharCode(r);
|
|
1742
|
+
}
|
|
1743
|
+
return e;
|
|
1744
|
+
}
|
|
1745
|
+
function Tt(t) {
|
|
1746
|
+
throw new TypeError(`Do not use built-in arithmetic operators with Temporal objects. When comparing, use ${t === "PlainMonthDay" ? "Temporal.PlainDate.compare(obj1.toPlainDate(year), obj2.toPlainDate(year))" : `Temporal.${t}.compare(obj1, obj2)`}, not obj1 > obj2. When coercing to strings, use \`\${obj}\` or String(obj), not '' + obj. When coercing to numbers, use properties or methods of the object, not \`+obj\`. When concatenating with strings, use \`\${str}\${obj}\` or str.concat(obj), not str + obj. In React, coerce to a string before rendering a Temporal object.`);
|
|
1747
|
+
}
|
|
1748
|
+
const Oi = new RegExp(`^${ma.source}$`), Yi = new RegExp(`^${/([+-])([01][0-9]|2[0-3])(?::?([0-5][0-9])(?::?([0-5][0-9])(?:[.,](\d{1,9}))?)?)?/.source}$`);
|
|
1749
|
+
function Wa(t, e, n, r = t(e), o = t(n)) {
|
|
1750
|
+
let a = e, i = n, s = r, h = o;
|
|
1751
|
+
for (; i - a > 1; ) {
|
|
1752
|
+
let d = Math.trunc((a + i) / 2);
|
|
1753
|
+
const u = t(d);
|
|
1754
|
+
u === s ? (a = d, s = u) : u === h && (i = d, h = u);
|
|
1755
|
+
}
|
|
1756
|
+
return i;
|
|
1757
|
+
}
|
|
1758
|
+
function Ha(t) {
|
|
1759
|
+
return [...t];
|
|
1760
|
+
}
|
|
1761
|
+
function _a(t, e) {
|
|
1762
|
+
if (t !== "gregory" && t !== "iso8601") return;
|
|
1763
|
+
const n = Gn[t];
|
|
1764
|
+
let r = e.year;
|
|
1765
|
+
const { dayOfWeek: o, dayOfYear: a, daysInYear: i } = n.isoToDate(e, { dayOfWeek: !0, dayOfYear: !0, daysInYear: !0 }), s = n.getFirstDayOfWeek(), h = n.getMinimalDaysInFirstWeek();
|
|
1766
|
+
let d = (o + 7 - s) % 7, u = (o - a + 7001 - s) % 7, l = Math.floor((a - 1 + u) / 7);
|
|
1767
|
+
if (7 - u >= h && ++l, l == 0) l = (function(m, f, p, v) {
|
|
1768
|
+
let w = (v - m - p + 1) % 7;
|
|
1769
|
+
w < 0 && (w += 7);
|
|
1770
|
+
let E = Math.floor((p + w - 1) / 7);
|
|
1771
|
+
return 7 - w >= f && ++E, E;
|
|
1772
|
+
})(s, h, a + n.isoToDate(n.dateAdd(e, { years: -1 }, "constrain"), { daysInYear: !0 }).daysInYear, o), r--;
|
|
1773
|
+
else if (a >= i - 5) {
|
|
1774
|
+
let m = (d + i - a) % 7;
|
|
1775
|
+
m < 0 && (m += 7), 6 - m >= h && a + 7 - d > i && (l = 1, r++);
|
|
1776
|
+
}
|
|
1777
|
+
return { week: l, year: r };
|
|
1778
|
+
}
|
|
1779
|
+
function Ko(t, e, n, r, o) {
|
|
1780
|
+
if (e !== o.year) {
|
|
1781
|
+
if (t * (e - o.year) > 0) return !0;
|
|
1782
|
+
} else if (n !== o.month) {
|
|
1783
|
+
if (t * (n - o.month) > 0) return !0;
|
|
1784
|
+
} else if (r !== o.day && t * (r - o.day) > 0) return !0;
|
|
1785
|
+
return !1;
|
|
1786
|
+
}
|
|
1787
|
+
const Gn = {};
|
|
1788
|
+
function jt(t) {
|
|
1789
|
+
if (!t.startsWith("M")) throw new RangeError(`Invalid month code: ${t}. Month codes must start with M.`);
|
|
1790
|
+
const e = +t.slice(1);
|
|
1791
|
+
if (Number.isNaN(e)) throw new RangeError(`Invalid month code: ${t}`);
|
|
1792
|
+
return e;
|
|
1793
|
+
}
|
|
1794
|
+
function Ke(t, e = !1) {
|
|
1795
|
+
return `M${`${t}`.padStart(2, "0")}${e ? "L" : ""}`;
|
|
1796
|
+
}
|
|
1797
|
+
function co(t, e = void 0, n = 12) {
|
|
1798
|
+
let { month: r, monthCode: o } = t;
|
|
1799
|
+
if (o === void 0) {
|
|
1800
|
+
if (r === void 0) throw new TypeError("Either month or monthCode are required");
|
|
1801
|
+
e === "reject" && G(r, 1, n), e === "constrain" && (r = pe(r, 1, n)), o = Ke(r);
|
|
1802
|
+
} else {
|
|
1803
|
+
const a = jt(o);
|
|
1804
|
+
if (o !== Ke(a)) throw new RangeError(`Invalid month code: ${o}`);
|
|
1805
|
+
if (r !== void 0 && r !== a) throw new RangeError(`monthCode ${o} and month ${r} must match if both are present`);
|
|
1806
|
+
if (r = a, r < 1 || r > n) throw new RangeError(`Invalid monthCode: ${o}`);
|
|
1807
|
+
}
|
|
1808
|
+
return { ...t, month: r, monthCode: o };
|
|
1809
|
+
}
|
|
1810
|
+
Gn.iso8601 = { resolveFields(t, e) {
|
|
1811
|
+
if ((e === "date" || e === "year-month") && t.year === void 0) throw new TypeError("year is required");
|
|
1812
|
+
if ((e === "date" || e === "month-day") && t.day === void 0) throw new TypeError("day is required");
|
|
1813
|
+
Object.assign(t, co(t));
|
|
1814
|
+
}, dateToISO: (t, e) => Tn(t.year, t.month, t.day, e), monthDayToISOReferenceDate(t, e) {
|
|
1815
|
+
const { month: n, day: r } = Tn(t.year ?? 1972, t.month, t.day, e);
|
|
1816
|
+
return { month: n, day: r, year: 1972 };
|
|
1817
|
+
}, extraFields: () => [], fieldKeysToIgnore(t) {
|
|
1818
|
+
const e = /* @__PURE__ */ new Set();
|
|
1819
|
+
for (let n = 0; n < t.length; n++) {
|
|
1820
|
+
const r = t[n];
|
|
1821
|
+
e.add(r), r === "month" ? e.add("monthCode") : r === "monthCode" && e.add("month");
|
|
1822
|
+
}
|
|
1823
|
+
return Ha(e);
|
|
1824
|
+
}, dateAdd(t, { years: e = 0, months: n = 0, weeks: r = 0, days: o = 0 }, a) {
|
|
1825
|
+
let { year: i, month: s, day: h } = t;
|
|
1826
|
+
return i += e, s += n, { year: i, month: s } = Ct(i, s), { year: i, month: s, day: h } = Tn(i, s, h, a), h += o + 7 * r, Oe(i, s, h);
|
|
1827
|
+
}, dateUntil(t, e, n) {
|
|
1828
|
+
const r = -Qe(t, e);
|
|
1829
|
+
if (r === 0) return { years: 0, months: 0, weeks: 0, days: 0 };
|
|
1830
|
+
let o, a = 0, i = 0;
|
|
1831
|
+
if (n === "year" || n === "month") {
|
|
1832
|
+
let u = e.year - t.year;
|
|
1833
|
+
for (u !== 0 && (u -= r); !Ko(r, t.year + u, t.month, t.day, e); ) a = u, u += r;
|
|
1834
|
+
let l = r;
|
|
1835
|
+
for (o = Ct(t.year + a, t.month + l); !Ko(r, o.year, o.month, t.day, e); ) i = l, l += r, o = Ct(o.year, o.month + r);
|
|
1836
|
+
n === "month" && (i += 12 * a, a = 0);
|
|
1837
|
+
}
|
|
1838
|
+
o = Ct(t.year + a, t.month + i);
|
|
1839
|
+
const s = Ua(o.year, o.month, t.day);
|
|
1840
|
+
let h = 0, d = kt(e.year, e.month - 1, e.day) - kt(s.year, s.month - 1, s.day);
|
|
1841
|
+
return n === "week" && (h = Math.trunc(d / 7), d %= 7), { years: a, months: i, weeks: h, days: d };
|
|
1842
|
+
}, isoToDate({ year: t, month: e, day: n }, r) {
|
|
1843
|
+
const o = { era: void 0, eraYear: void 0, year: t, month: e, day: n, daysInWeek: 7, monthsInYear: 12 };
|
|
1844
|
+
if (r.monthCode && (o.monthCode = Ke(e)), r.dayOfWeek) {
|
|
1845
|
+
const a = e + (e < 3 ? 10 : -2), i = t - (e < 3 ? 1 : 0), s = Math.floor(i / 100), h = i - 100 * s, d = (n + Math.floor(2.6 * a - 0.2) + (h + Math.floor(h / 4)) + (Math.floor(s / 4) - 2 * s)) % 7;
|
|
1846
|
+
o.dayOfWeek = d + (d <= 0 ? 7 : 0);
|
|
1847
|
+
}
|
|
1848
|
+
if (r.dayOfYear) {
|
|
1849
|
+
let a = n;
|
|
1850
|
+
for (let i = e - 1; i > 0; i--) a += Ot(t, i);
|
|
1851
|
+
o.dayOfYear = a;
|
|
1852
|
+
}
|
|
1853
|
+
return r.weekOfYear && (o.weekOfYear = _a("iso8601", { year: t, month: e, day: n })), r.daysInMonth && (o.daysInMonth = Ot(t, e)), (r.daysInYear || r.inLeapYear) && (o.inLeapYear = cr(t), o.daysInYear = o.inLeapYear ? 366 : 365), o;
|
|
1854
|
+
}, getFirstDayOfWeek: () => 1, getMinimalDaysInFirstWeek: () => 4 };
|
|
1855
|
+
class J {
|
|
1856
|
+
constructor(e) {
|
|
1857
|
+
if (this.map = /* @__PURE__ */ new Map(), this.calls = 0, this.hits = 0, this.misses = 0, e !== void 0) {
|
|
1858
|
+
let n = 0;
|
|
1859
|
+
for (const r of e.map.entries()) {
|
|
1860
|
+
if (++n > J.MAX_CACHE_ENTRIES) break;
|
|
1861
|
+
this.map.set(...r);
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
get(e) {
|
|
1866
|
+
const n = this.map.get(e);
|
|
1867
|
+
return n && (this.hits++, this.report()), this.calls++, n;
|
|
1868
|
+
}
|
|
1869
|
+
set(e, n) {
|
|
1870
|
+
this.map.set(e, n), this.misses++, this.report();
|
|
1871
|
+
}
|
|
1872
|
+
report() {
|
|
1873
|
+
}
|
|
1874
|
+
setObject(e) {
|
|
1875
|
+
if (J.objectMap.get(e)) throw new RangeError("object already cached");
|
|
1876
|
+
J.objectMap.set(e, this), this.report();
|
|
1877
|
+
}
|
|
1878
|
+
static getCacheForObject(e) {
|
|
1879
|
+
let n = J.objectMap.get(e);
|
|
1880
|
+
return n || (n = new J(), J.objectMap.set(e, n)), n;
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
function Ja({ isoYear: t, isoMonth: e, isoDay: n }) {
|
|
1884
|
+
return `${Jn(t)}-${je(e)}-${je(n)}T00:00Z`;
|
|
1885
|
+
}
|
|
1886
|
+
function Rr(t, e) {
|
|
1887
|
+
return { years: t.year - e.year, months: t.month - e.month, days: t.day - e.day };
|
|
1888
|
+
}
|
|
1889
|
+
J.objectMap = /* @__PURE__ */ new WeakMap(), J.MAX_CACHE_ENTRIES = 1e3;
|
|
1890
|
+
class Ut {
|
|
1891
|
+
constructor() {
|
|
1892
|
+
this.eras = [], this.hasEra = !1, this.erasBeginMidYear = !1;
|
|
1893
|
+
}
|
|
1894
|
+
getFormatter() {
|
|
1895
|
+
return this.formatter === void 0 && (this.formatter = new Intl.DateTimeFormat(`en-US-u-ca-${this.id}`, { day: "numeric", month: "numeric", year: "numeric", era: "short", timeZone: "UTC" })), this.formatter;
|
|
1896
|
+
}
|
|
1897
|
+
getCalendarParts(e) {
|
|
1898
|
+
let n = this.getFormatter(), r = new Date(e);
|
|
1899
|
+
if (e === "-271821-04-19T00:00Z") {
|
|
1900
|
+
const o = n.resolvedOptions();
|
|
1901
|
+
n = new Intl.DateTimeFormat(o.locale, { ...o, timeZone: "Etc/GMT+1" }), r = /* @__PURE__ */ new Date("-271821-04-20T00:00Z");
|
|
1902
|
+
}
|
|
1903
|
+
try {
|
|
1904
|
+
return n.formatToParts(r);
|
|
1905
|
+
} catch {
|
|
1906
|
+
throw new RangeError(`Invalid ISO date: ${e}`);
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
isoToCalendarDate(e, n) {
|
|
1910
|
+
const { year: r, month: o, day: a } = e, i = JSON.stringify({ func: "isoToCalendarDate", isoYear: r, isoMonth: o, isoDay: a, id: this.id }), s = n.get(i);
|
|
1911
|
+
if (s) return s;
|
|
1912
|
+
const h = Ja({ isoYear: r, isoMonth: o, isoDay: a }), d = this.getCalendarParts(h), u = {};
|
|
1913
|
+
for (let m = 0; m < d.length; m++) {
|
|
1914
|
+
const { type: f, value: p } = d[m];
|
|
1915
|
+
if (f !== "year" && f !== "relatedYear" || (this.hasEra ? u.eraYear = +p : u.year = +p), f === "month") {
|
|
1916
|
+
const v = /^([0-9]*)(.*?)$/.exec(p);
|
|
1917
|
+
if (!v || v.length != 3 || !v[1] && !v[2]) throw new RangeError(`Unexpected month: ${p}`);
|
|
1918
|
+
if (u.month = v[1] ? +v[1] : 1, u.month < 1) throw new RangeError(`Invalid month ${p} from ${h}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10527)`);
|
|
1919
|
+
if (u.month > 13) throw new RangeError(`Invalid month ${p} from ${h}[u-ca-${this.id}] (probably due to https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);
|
|
1920
|
+
v[2] && (u.monthExtra = v[2]);
|
|
1921
|
+
}
|
|
1922
|
+
f === "day" && (u.day = +p), this.hasEra && f === "era" && p != null && p !== "" && (u.era = p.split(" (")[0].normalize("NFD").replace(/[^-0-9 \p{L}]/gu, "").replace(/ /g, "-").toLowerCase());
|
|
1923
|
+
}
|
|
1924
|
+
if (this.hasEra && u.eraYear === void 0) throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);
|
|
1925
|
+
if (this.hasEra) {
|
|
1926
|
+
const m = this.eras.find(((f) => u.era === f.genericName));
|
|
1927
|
+
m && (u.era = m.code);
|
|
1928
|
+
}
|
|
1929
|
+
if (this.reviseIntlEra) {
|
|
1930
|
+
const { era: m, eraYear: f } = this.reviseIntlEra(u, e);
|
|
1931
|
+
u.era = m, u.eraYear = f;
|
|
1932
|
+
}
|
|
1933
|
+
this.checkIcuBugs && this.checkIcuBugs(e);
|
|
1934
|
+
const l = this.adjustCalendarDate(u, n, "constrain", !0);
|
|
1935
|
+
if (l.year === void 0) throw new RangeError(`Missing year converting ${JSON.stringify(e)}`);
|
|
1936
|
+
if (l.month === void 0) throw new RangeError(`Missing month converting ${JSON.stringify(e)}`);
|
|
1937
|
+
if (l.day === void 0) throw new RangeError(`Missing day converting ${JSON.stringify(e)}`);
|
|
1938
|
+
return n.set(i, l), ["constrain", "reject"].forEach(((m) => {
|
|
1939
|
+
const f = JSON.stringify({ func: "calendarToIsoDate", year: l.year, month: l.month, day: l.day, overflow: m, id: this.id });
|
|
1940
|
+
n.set(f, e);
|
|
1941
|
+
})), l;
|
|
1942
|
+
}
|
|
1943
|
+
validateCalendarDate(e) {
|
|
1944
|
+
const { month: n, year: r, day: o, eraYear: a, monthCode: i, monthExtra: s } = e;
|
|
1945
|
+
if (s !== void 0) throw new RangeError("Unexpected `monthExtra` value");
|
|
1946
|
+
if (r === void 0 && a === void 0) throw new TypeError("year or eraYear is required");
|
|
1947
|
+
if (n === void 0 && i === void 0) throw new TypeError("month or monthCode is required");
|
|
1948
|
+
if (o === void 0) throw new RangeError("Missing day");
|
|
1949
|
+
if (i !== void 0) {
|
|
1950
|
+
if (typeof i != "string") throw new RangeError("monthCode must be a string, not " + typeof i);
|
|
1951
|
+
if (!/^M([01]?\d)(L?)$/.test(i)) throw new RangeError(`Invalid monthCode: ${i}`);
|
|
1952
|
+
}
|
|
1953
|
+
if (this.hasEra && e.era === void 0 != (e.eraYear === void 0)) throw new TypeError("properties era and eraYear must be provided together");
|
|
1954
|
+
}
|
|
1955
|
+
adjustCalendarDate(e, n = void 0, r = "constrain", o = !1) {
|
|
1956
|
+
if (this.calendarType === "lunisolar") throw new RangeError("Override required for lunisolar calendars");
|
|
1957
|
+
let a = e;
|
|
1958
|
+
this.validateCalendarDate(a);
|
|
1959
|
+
const i = this.monthsInYear(a, n);
|
|
1960
|
+
let { month: s, monthCode: h } = a;
|
|
1961
|
+
return { month: s, monthCode: h } = co(a, r, i), { ...a, month: s, monthCode: h };
|
|
1962
|
+
}
|
|
1963
|
+
regulateMonthDayNaive(e, n, r) {
|
|
1964
|
+
const o = this.monthsInYear(e, r);
|
|
1965
|
+
let { month: a, day: i } = e;
|
|
1966
|
+
return n === "reject" ? (G(a, 1, o), G(i, 1, this.maximumMonthLength(e))) : (a = pe(a, 1, o), i = pe(i, 1, this.maximumMonthLength({ ...e, month: a }))), { ...e, month: a, day: i };
|
|
1967
|
+
}
|
|
1968
|
+
calendarToIsoDate(e, n = "constrain", r) {
|
|
1969
|
+
const o = e;
|
|
1970
|
+
let a = this.adjustCalendarDate(e, r, n, !1);
|
|
1971
|
+
a = this.regulateMonthDayNaive(a, n, r);
|
|
1972
|
+
const { year: i, month: s, day: h } = a, d = JSON.stringify({ func: "calendarToIsoDate", year: i, month: s, day: h, overflow: n, id: this.id });
|
|
1973
|
+
let u, l = r.get(d);
|
|
1974
|
+
if (l || o.year !== void 0 && o.month !== void 0 && o.day !== void 0 && (o.year !== a.year || o.month !== a.month || o.day !== a.day) && (u = JSON.stringify({ func: "calendarToIsoDate", year: o.year, month: o.month, day: o.day, overflow: n, id: this.id }), l = r.get(u), l)) return l;
|
|
1975
|
+
let m = this.estimateIsoDate({ year: i, month: s, day: h });
|
|
1976
|
+
const f = (T) => {
|
|
1977
|
+
let D = this.addDaysIso(m, T);
|
|
1978
|
+
if (a.day > this.minimumMonthLength(a)) {
|
|
1979
|
+
let Y = this.isoToCalendarDate(D, r);
|
|
1980
|
+
for (; Y.month !== s || Y.year !== i; ) {
|
|
1981
|
+
if (n === "reject") throw new RangeError(`day ${h} does not exist in month ${s} of year ${i}`);
|
|
1982
|
+
D = this.addDaysIso(D, -1), Y = this.isoToCalendarDate(D, r);
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
return D;
|
|
1986
|
+
};
|
|
1987
|
+
let p = 0, v = this.isoToCalendarDate(m, r), w = Rr(a, v);
|
|
1988
|
+
if (w.years !== 0 || w.months !== 0 || w.days !== 0) {
|
|
1989
|
+
const T = 365 * w.years + 30 * w.months + w.days;
|
|
1990
|
+
m = this.addDaysIso(m, T), v = this.isoToCalendarDate(m, r), w = Rr(a, v), w.years === 0 && w.months === 0 ? m = f(w.days) : p = this.compareCalendarDates(a, v);
|
|
1991
|
+
}
|
|
1992
|
+
let E = 8;
|
|
1993
|
+
for (; p; ) {
|
|
1994
|
+
m = this.addDaysIso(m, p * E);
|
|
1995
|
+
const T = v;
|
|
1996
|
+
v = this.isoToCalendarDate(m, r);
|
|
1997
|
+
const D = p;
|
|
1998
|
+
if (p = this.compareCalendarDates(a, v), p) {
|
|
1999
|
+
if (w = Rr(a, v), w.years === 0 && w.months === 0) m = f(w.days), p = 0;
|
|
2000
|
+
else if (D && p !== D) if (E > 1) E /= 2;
|
|
2001
|
+
else {
|
|
2002
|
+
if (n === "reject") throw new RangeError(`Can't find ISO date from calendar date: ${JSON.stringify({ ...o })}`);
|
|
2003
|
+
this.compareCalendarDates(v, T) > 0 && (m = this.addDaysIso(m, -1)), p = 0;
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
if (r.set(d, m), u && r.set(u, m), a.year === void 0 || a.month === void 0 || a.day === void 0 || a.monthCode === void 0 || this.hasEra && (a.era === void 0 || a.eraYear === void 0)) throw new RangeError("Unexpected missing property");
|
|
2008
|
+
return m;
|
|
2009
|
+
}
|
|
2010
|
+
compareCalendarDates(e, n) {
|
|
2011
|
+
return e.year !== n.year ? Ce(e.year - n.year) : e.month !== n.month ? Ce(e.month - n.month) : e.day !== n.day ? Ce(e.day - n.day) : 0;
|
|
2012
|
+
}
|
|
2013
|
+
regulateDate(e, n = "constrain", r) {
|
|
2014
|
+
const o = this.calendarToIsoDate(e, n, r);
|
|
2015
|
+
return this.isoToCalendarDate(o, r);
|
|
2016
|
+
}
|
|
2017
|
+
addDaysIso(e, n) {
|
|
2018
|
+
return Oe(e.year, e.month, e.day + n);
|
|
2019
|
+
}
|
|
2020
|
+
addDaysCalendar(e, n, r) {
|
|
2021
|
+
const o = this.calendarToIsoDate(e, "constrain", r), a = this.addDaysIso(o, n);
|
|
2022
|
+
return this.isoToCalendarDate(a, r);
|
|
2023
|
+
}
|
|
2024
|
+
addMonthsCalendar(e, n, r, o) {
|
|
2025
|
+
let a = e;
|
|
2026
|
+
const { day: i } = a;
|
|
2027
|
+
for (let s = 0, h = Math.abs(n); s < h; s++) {
|
|
2028
|
+
const { month: d } = a, u = a, l = n < 0 ? -Math.max(i, this.daysInPreviousMonth(a, o)) : this.daysInMonth(a, o), m = this.calendarToIsoDate(a, "constrain", o);
|
|
2029
|
+
let f = this.addDaysIso(m, l);
|
|
2030
|
+
if (a = this.isoToCalendarDate(f, o), n > 0) {
|
|
2031
|
+
const p = this.monthsInYear(u, o);
|
|
2032
|
+
for (; a.month - 1 != d % p; ) f = this.addDaysIso(f, -1), a = this.isoToCalendarDate(f, o);
|
|
2033
|
+
}
|
|
2034
|
+
a.day !== i && (a = this.regulateDate({ ...a, day: i }, "constrain", o));
|
|
2035
|
+
}
|
|
2036
|
+
if (r === "reject" && a.day !== i) throw new RangeError(`Day ${i} does not exist in resulting calendar month`);
|
|
2037
|
+
return a;
|
|
2038
|
+
}
|
|
2039
|
+
addCalendar(e, { years: n = 0, months: r = 0, weeks: o = 0, days: a = 0 }, i, s) {
|
|
2040
|
+
const { year: h, day: d, monthCode: u } = e, l = this.adjustCalendarDate({ year: h + n, monthCode: u, day: d }, s), m = this.addMonthsCalendar(l, r, i, s), f = a + 7 * o;
|
|
2041
|
+
return this.addDaysCalendar(m, f, s);
|
|
2042
|
+
}
|
|
2043
|
+
untilCalendar(e, n, r, o) {
|
|
2044
|
+
let a = 0, i = 0, s = 0, h = 0;
|
|
2045
|
+
switch (r) {
|
|
2046
|
+
case "day":
|
|
2047
|
+
a = this.calendarDaysUntil(e, n, o);
|
|
2048
|
+
break;
|
|
2049
|
+
case "week": {
|
|
2050
|
+
const d = this.calendarDaysUntil(e, n, o);
|
|
2051
|
+
a = d % 7, i = (d - a) / 7;
|
|
2052
|
+
break;
|
|
2053
|
+
}
|
|
2054
|
+
case "month":
|
|
2055
|
+
case "year": {
|
|
2056
|
+
const d = this.compareCalendarDates(n, e);
|
|
2057
|
+
if (!d) return { years: 0, months: 0, weeks: 0, days: 0 };
|
|
2058
|
+
const u = n.year - e.year, l = n.day - e.day;
|
|
2059
|
+
if (r === "year" && u) {
|
|
2060
|
+
let p = 0;
|
|
2061
|
+
n.monthCode > e.monthCode && (p = 1), n.monthCode < e.monthCode && (p = -1), p || (p = Math.sign(l)), h = p * d < 0 ? u - d : u;
|
|
2062
|
+
}
|
|
2063
|
+
let m, f = h ? this.addCalendar(e, { years: h }, "constrain", o) : e;
|
|
2064
|
+
do
|
|
2065
|
+
s += d, m = f, f = this.addMonthsCalendar(m, d, "constrain", o), f.day !== e.day && (f = this.regulateDate({ ...f, day: e.day }, "constrain", o));
|
|
2066
|
+
while (this.compareCalendarDates(n, f) * d >= 0);
|
|
2067
|
+
s -= d, a = this.calendarDaysUntil(m, n, o);
|
|
2068
|
+
break;
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
return { years: h, months: s, weeks: i, days: a };
|
|
2072
|
+
}
|
|
2073
|
+
daysInMonth(e, n) {
|
|
2074
|
+
const { day: r } = e, o = this.maximumMonthLength(e), a = this.minimumMonthLength(e);
|
|
2075
|
+
if (a === o) return a;
|
|
2076
|
+
const i = r <= o - a ? o : a, s = this.calendarToIsoDate(e, "constrain", n), h = this.addDaysIso(s, i), d = this.isoToCalendarDate(h, n), u = this.addDaysIso(h, -d.day);
|
|
2077
|
+
return this.isoToCalendarDate(u, n).day;
|
|
2078
|
+
}
|
|
2079
|
+
daysInPreviousMonth(e, n) {
|
|
2080
|
+
const { day: r, month: o, year: a } = e;
|
|
2081
|
+
let i = { year: o > 1 ? a : a - 1, month: o, day: 1 };
|
|
2082
|
+
const s = o > 1 ? o - 1 : this.monthsInYear(i, n);
|
|
2083
|
+
i = { ...i, month: s };
|
|
2084
|
+
const h = this.minimumMonthLength(i), d = this.maximumMonthLength(i);
|
|
2085
|
+
if (h === d) return d;
|
|
2086
|
+
const u = this.calendarToIsoDate(e, "constrain", n), l = this.addDaysIso(u, -r);
|
|
2087
|
+
return this.isoToCalendarDate(l, n).day;
|
|
2088
|
+
}
|
|
2089
|
+
startOfCalendarYear(e) {
|
|
2090
|
+
return { year: e.year, month: 1, monthCode: "M01", day: 1 };
|
|
2091
|
+
}
|
|
2092
|
+
startOfCalendarMonth(e) {
|
|
2093
|
+
return { year: e.year, month: e.month, day: 1 };
|
|
2094
|
+
}
|
|
2095
|
+
calendarDaysUntil(e, n, r) {
|
|
2096
|
+
const o = this.calendarToIsoDate(e, "constrain", r), a = this.calendarToIsoDate(n, "constrain", r);
|
|
2097
|
+
return kt(a.year, a.month - 1, a.day) - kt(o.year, o.month - 1, o.day);
|
|
2098
|
+
}
|
|
2099
|
+
monthDaySearchStartYear(e, n) {
|
|
2100
|
+
return 1972;
|
|
2101
|
+
}
|
|
2102
|
+
monthDayFromFields(e, n, r) {
|
|
2103
|
+
let o, a, i, s, h, { era: d, eraYear: u, year: l, month: m, monthCode: f, day: p } = e;
|
|
2104
|
+
if (m !== void 0 && l === void 0 && (!this.hasEra || d === void 0 || u === void 0)) throw new TypeError("when month is present, year (or era and eraYear) are required");
|
|
2105
|
+
(f === void 0 || l !== void 0 || this.hasEra && u !== void 0) && ({ monthCode: f, day: p } = this.isoToCalendarDate(this.calendarToIsoDate(e, n, r), r));
|
|
2106
|
+
const v = { year: this.monthDaySearchStartYear(f, p), month: 12, day: 31 }, w = this.isoToCalendarDate(v, r), E = w.monthCode > f || w.monthCode === f && w.day >= p ? w.year : w.year - 1;
|
|
2107
|
+
for (let T = 0; T < 20; T++) {
|
|
2108
|
+
const D = this.adjustCalendarDate({ day: p, monthCode: f, year: E - T }, r), Y = this.calendarToIsoDate(D, "constrain", r), O = this.isoToCalendarDate(Y, r);
|
|
2109
|
+
if ({ year: o, month: a, day: i } = Y, O.monthCode === f && O.day === p) return { month: a, day: i, year: o };
|
|
2110
|
+
if (n === "constrain") {
|
|
2111
|
+
const W = this.maxLengthOfMonthCodeInAnyYear(O.monthCode);
|
|
2112
|
+
if (O.monthCode === f && O.day === W && p > W) return { month: a, day: i, year: o };
|
|
2113
|
+
(s === void 0 || O.monthCode === s.monthCode && O.day > s.day) && (s = O, h = Y);
|
|
2114
|
+
}
|
|
2115
|
+
}
|
|
2116
|
+
if (n === "constrain" && h !== void 0) return h;
|
|
2117
|
+
throw new RangeError(`No recent ${this.id} year with monthCode ${f} and day ${p}`);
|
|
2118
|
+
}
|
|
2119
|
+
getFirstDayOfWeek() {
|
|
2120
|
+
}
|
|
2121
|
+
getMinimalDaysInFirstWeek() {
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
class Ri extends Ut {
|
|
2125
|
+
constructor() {
|
|
2126
|
+
super(...arguments), this.id = "hebrew", this.calendarType = "lunisolar", this.months = { Tishri: { leap: 1, regular: 1, monthCode: "M01", days: 30 }, Heshvan: { leap: 2, regular: 2, monthCode: "M02", days: { min: 29, max: 30 } }, Kislev: { leap: 3, regular: 3, monthCode: "M03", days: { min: 29, max: 30 } }, Tevet: { leap: 4, regular: 4, monthCode: "M04", days: 29 }, Shevat: { leap: 5, regular: 5, monthCode: "M05", days: 30 }, Adar: { leap: void 0, regular: 6, monthCode: "M06", days: 29 }, "Adar I": { leap: 6, regular: void 0, monthCode: "M05L", days: 30 }, "Adar II": { leap: 7, regular: void 0, monthCode: "M06", days: 29 }, Nisan: { leap: 8, regular: 7, monthCode: "M07", days: 30 }, Iyar: { leap: 9, regular: 8, monthCode: "M08", days: 29 }, Sivan: { leap: 10, regular: 9, monthCode: "M09", days: 30 }, Tamuz: { leap: 11, regular: 10, monthCode: "M10", days: 29 }, Av: { leap: 12, regular: 11, monthCode: "M11", days: 30 }, Elul: { leap: 13, regular: 12, monthCode: "M12", days: 29 } };
|
|
2127
|
+
}
|
|
2128
|
+
inLeapYear(e) {
|
|
2129
|
+
const { year: n } = e;
|
|
2130
|
+
return (7 * n + 1) % 19 < 7;
|
|
2131
|
+
}
|
|
2132
|
+
monthsInYear(e) {
|
|
2133
|
+
return this.inLeapYear(e) ? 13 : 12;
|
|
2134
|
+
}
|
|
2135
|
+
minimumMonthLength(e) {
|
|
2136
|
+
return this.minMaxMonthLength(e, "min");
|
|
2137
|
+
}
|
|
2138
|
+
maximumMonthLength(e) {
|
|
2139
|
+
return this.minMaxMonthLength(e, "max");
|
|
2140
|
+
}
|
|
2141
|
+
minMaxMonthLength(e, n) {
|
|
2142
|
+
const { month: r, year: o } = e, a = this.getMonthCode(o, r), i = Object.entries(this.months).find(((h) => h[1].monthCode === a));
|
|
2143
|
+
if (i === void 0) throw new RangeError(`unmatched Hebrew month: ${r}`);
|
|
2144
|
+
const s = i[1].days;
|
|
2145
|
+
return typeof s == "number" ? s : s[n];
|
|
2146
|
+
}
|
|
2147
|
+
maxLengthOfMonthCodeInAnyYear(e) {
|
|
2148
|
+
return ["M04", "M06", "M08", "M10", "M12"].includes(e) ? 29 : 30;
|
|
2149
|
+
}
|
|
2150
|
+
estimateIsoDate(e) {
|
|
2151
|
+
const { year: n } = e;
|
|
2152
|
+
return { year: n - 3760, month: 1, day: 1 };
|
|
2153
|
+
}
|
|
2154
|
+
getMonthCode(e, n) {
|
|
2155
|
+
return this.inLeapYear({ year: e }) ? n === 6 ? Ke(5, !0) : Ke(n < 6 ? n : n - 1) : Ke(n);
|
|
2156
|
+
}
|
|
2157
|
+
adjustCalendarDate(e, n, r = "constrain", o = !1) {
|
|
2158
|
+
let { year: a, month: i, monthCode: s, day: h, monthExtra: d } = e;
|
|
2159
|
+
if (a === void 0) throw new TypeError("Missing property: year");
|
|
2160
|
+
if (o) {
|
|
2161
|
+
if (d) {
|
|
2162
|
+
const u = this.months[d];
|
|
2163
|
+
if (!u) throw new RangeError(`Unrecognized month from formatToParts: ${d}`);
|
|
2164
|
+
i = this.inLeapYear({ year: a }) ? u.leap : u.regular;
|
|
2165
|
+
}
|
|
2166
|
+
return s = this.getMonthCode(a, i), { year: a, month: i, day: h, monthCode: s };
|
|
2167
|
+
}
|
|
2168
|
+
if (this.validateCalendarDate(e), i === void 0) if (s.endsWith("L")) {
|
|
2169
|
+
if (s !== "M05L") throw new RangeError(`Hebrew leap month must have monthCode M05L, not ${s}`);
|
|
2170
|
+
if (i = 6, !this.inLeapYear({ year: a })) {
|
|
2171
|
+
if (r === "reject") throw new RangeError(`Hebrew monthCode M05L is invalid in year ${a} which is not a leap year`);
|
|
2172
|
+
i = 6, s = "M06";
|
|
2173
|
+
}
|
|
2174
|
+
} else {
|
|
2175
|
+
i = jt(s), this.inLeapYear({ year: a }) && i >= 6 && i++;
|
|
2176
|
+
const u = this.monthsInYear({ year: a });
|
|
2177
|
+
if (i < 1 || i > u) throw new RangeError(`Invalid monthCode: ${s}`);
|
|
2178
|
+
}
|
|
2179
|
+
else if (r === "reject" ? (G(i, 1, this.monthsInYear({ year: a })), G(h, 1, this.maximumMonthLength({ year: a, month: i }))) : (i = pe(i, 1, this.monthsInYear({ year: a })), h = pe(h, 1, this.maximumMonthLength({ year: a, month: i }))), s === void 0) s = this.getMonthCode(a, i);
|
|
2180
|
+
else if (this.getMonthCode(a, i) !== s) throw new RangeError(`monthCode ${s} doesn't correspond to month ${i} in Hebrew year ${a}`);
|
|
2181
|
+
return { ...e, day: h, month: i, monthCode: s, year: a };
|
|
2182
|
+
}
|
|
2183
|
+
}
|
|
2184
|
+
class dn extends Ut {
|
|
2185
|
+
constructor() {
|
|
2186
|
+
super(...arguments), this.calendarType = "lunar", this.DAYS_PER_ISLAMIC_YEAR = 354 + 11 / 30, this.DAYS_PER_ISO_YEAR = 365.2425;
|
|
2187
|
+
}
|
|
2188
|
+
inLeapYear(e, n) {
|
|
2189
|
+
const r = { year: e.year, month: 1, monthCode: "M01", day: 1 }, o = { year: e.year + 1, month: 1, monthCode: "M01", day: 1 };
|
|
2190
|
+
return this.calendarDaysUntil(r, o, n) === 355;
|
|
2191
|
+
}
|
|
2192
|
+
monthsInYear() {
|
|
2193
|
+
return 12;
|
|
2194
|
+
}
|
|
2195
|
+
minimumMonthLength() {
|
|
2196
|
+
return 29;
|
|
2197
|
+
}
|
|
2198
|
+
maximumMonthLength() {
|
|
2199
|
+
return 30;
|
|
2200
|
+
}
|
|
2201
|
+
maxLengthOfMonthCodeInAnyYear() {
|
|
2202
|
+
return 30;
|
|
2203
|
+
}
|
|
2204
|
+
estimateIsoDate(e) {
|
|
2205
|
+
const { year: n } = this.adjustCalendarDate(e);
|
|
2206
|
+
return { year: Math.floor(n * this.DAYS_PER_ISLAMIC_YEAR / this.DAYS_PER_ISO_YEAR) + 622, month: 1, day: 1 };
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
class Si extends dn {
|
|
2210
|
+
constructor() {
|
|
2211
|
+
super(...arguments), this.id = "islamic";
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
class ki extends dn {
|
|
2215
|
+
constructor() {
|
|
2216
|
+
super(...arguments), this.id = "islamic-umalqura";
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
class Ni extends dn {
|
|
2220
|
+
constructor() {
|
|
2221
|
+
super(...arguments), this.id = "islamic-tbla";
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
class ji extends dn {
|
|
2225
|
+
constructor() {
|
|
2226
|
+
super(...arguments), this.id = "islamic-civil";
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
class xi extends dn {
|
|
2230
|
+
constructor() {
|
|
2231
|
+
super(...arguments), this.id = "islamic-rgsa";
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
class Li extends dn {
|
|
2235
|
+
constructor() {
|
|
2236
|
+
super(...arguments), this.id = "islamicc";
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
class Ui extends Ut {
|
|
2240
|
+
constructor() {
|
|
2241
|
+
super(...arguments), this.id = "persian", this.calendarType = "solar";
|
|
2242
|
+
}
|
|
2243
|
+
inLeapYear(e, n) {
|
|
2244
|
+
return this.daysInMonth({ year: e.year, month: 12, day: 1 }, n) === 30;
|
|
2245
|
+
}
|
|
2246
|
+
monthsInYear() {
|
|
2247
|
+
return 12;
|
|
2248
|
+
}
|
|
2249
|
+
minimumMonthLength(e) {
|
|
2250
|
+
const { month: n } = e;
|
|
2251
|
+
return n === 12 ? 29 : n <= 6 ? 31 : 30;
|
|
2252
|
+
}
|
|
2253
|
+
maximumMonthLength(e) {
|
|
2254
|
+
const { month: n } = e;
|
|
2255
|
+
return n === 12 ? 30 : n <= 6 ? 31 : 30;
|
|
2256
|
+
}
|
|
2257
|
+
maxLengthOfMonthCodeInAnyYear(e) {
|
|
2258
|
+
return jt(e) <= 6 ? 31 : 30;
|
|
2259
|
+
}
|
|
2260
|
+
estimateIsoDate(e) {
|
|
2261
|
+
const { year: n } = this.adjustCalendarDate(e);
|
|
2262
|
+
return { year: n + 621, month: 1, day: 1 };
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
class Pi extends Ut {
|
|
2266
|
+
constructor() {
|
|
2267
|
+
super(...arguments), this.id = "indian", this.calendarType = "solar", this.months = { 1: { length: 30, month: 3, day: 22, leap: { length: 31, month: 3, day: 21 } }, 2: { length: 31, month: 4, day: 21 }, 3: { length: 31, month: 5, day: 22 }, 4: { length: 31, month: 6, day: 22 }, 5: { length: 31, month: 7, day: 23 }, 6: { length: 31, month: 8, day: 23 }, 7: { length: 30, month: 9, day: 23 }, 8: { length: 30, month: 10, day: 23 }, 9: { length: 30, month: 11, day: 22 }, 10: { length: 30, month: 12, day: 22 }, 11: { length: 30, month: 1, nextYear: !0, day: 21 }, 12: { length: 30, month: 2, nextYear: !0, day: 20 } }, this.vulnerableToBceBug = (/* @__PURE__ */ new Date("0000-01-01T00:00Z")).toLocaleDateString("en-US-u-ca-indian", { timeZone: "UTC" }) !== "10/11/-79 Saka";
|
|
2268
|
+
}
|
|
2269
|
+
inLeapYear(e) {
|
|
2270
|
+
return ho(e.year + 78);
|
|
2271
|
+
}
|
|
2272
|
+
monthsInYear() {
|
|
2273
|
+
return 12;
|
|
2274
|
+
}
|
|
2275
|
+
minimumMonthLength(e) {
|
|
2276
|
+
return this.getMonthInfo(e).length;
|
|
2277
|
+
}
|
|
2278
|
+
maximumMonthLength(e) {
|
|
2279
|
+
return this.getMonthInfo(e).length;
|
|
2280
|
+
}
|
|
2281
|
+
maxLengthOfMonthCodeInAnyYear(e) {
|
|
2282
|
+
const n = jt(e);
|
|
2283
|
+
let r = this.months[n];
|
|
2284
|
+
return r = r.leap ?? r, r.length;
|
|
2285
|
+
}
|
|
2286
|
+
getMonthInfo(e) {
|
|
2287
|
+
const { month: n } = e;
|
|
2288
|
+
let r = this.months[n];
|
|
2289
|
+
if (r === void 0) throw new RangeError(`Invalid month: ${n}`);
|
|
2290
|
+
return this.inLeapYear(e) && r.leap && (r = r.leap), r;
|
|
2291
|
+
}
|
|
2292
|
+
estimateIsoDate(e) {
|
|
2293
|
+
const n = this.adjustCalendarDate(e), r = this.getMonthInfo(n);
|
|
2294
|
+
return Oe(n.year + 78 + (r.nextYear ? 1 : 0), r.month, r.day + n.day - 1);
|
|
2295
|
+
}
|
|
2296
|
+
checkIcuBugs(e) {
|
|
2297
|
+
if (this.vulnerableToBceBug && e.year < 1) throw new RangeError(`calendar '${this.id}' is broken for ISO dates before 0001-01-01 (see https://bugs.chromium.org/p/v8/issues/detail?id=10529)`);
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
function ho(t) {
|
|
2301
|
+
return t % 4 == 0 && (t % 100 != 0 || t % 400 == 0);
|
|
2302
|
+
}
|
|
2303
|
+
class Ga extends Ut {
|
|
2304
|
+
constructor(e, n) {
|
|
2305
|
+
super(), this.calendarType = "solar", this.id = e, this.isoEpoch = n;
|
|
2306
|
+
}
|
|
2307
|
+
inLeapYear(e) {
|
|
2308
|
+
const { year: n } = this.estimateIsoDate({ month: 1, day: 1, year: e.year });
|
|
2309
|
+
return ho(n);
|
|
2310
|
+
}
|
|
2311
|
+
monthsInYear() {
|
|
2312
|
+
return 12;
|
|
2313
|
+
}
|
|
2314
|
+
minimumMonthLength(e) {
|
|
2315
|
+
const { month: n } = e;
|
|
2316
|
+
return n === 2 ? this.inLeapYear(e) ? 29 : 28 : [4, 6, 9, 11].indexOf(n) >= 0 ? 30 : 31;
|
|
2317
|
+
}
|
|
2318
|
+
maximumMonthLength(e) {
|
|
2319
|
+
return this.minimumMonthLength(e);
|
|
2320
|
+
}
|
|
2321
|
+
maxLengthOfMonthCodeInAnyYear(e) {
|
|
2322
|
+
return [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][jt(e) - 1];
|
|
2323
|
+
}
|
|
2324
|
+
estimateIsoDate(e) {
|
|
2325
|
+
const n = this.adjustCalendarDate(e);
|
|
2326
|
+
return Tn(n.year + this.isoEpoch.year, n.month + this.isoEpoch.month, n.day + this.isoEpoch.day, "constrain");
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
class Ka extends Ut {
|
|
2330
|
+
constructor(e, n) {
|
|
2331
|
+
super(), this.hasEra = !0, this.calendarType = "solar", this.id = e;
|
|
2332
|
+
const { eras: r, anchorEra: o } = (function(a) {
|
|
2333
|
+
let i, s = a;
|
|
2334
|
+
if (s.length === 0) throw new RangeError("Invalid era data: eras are required");
|
|
2335
|
+
if (s.length === 1 && s[0].reverseOf) throw new RangeError("Invalid era data: anchor era cannot count years backwards");
|
|
2336
|
+
if (s.length === 1 && !s[0].code) throw new RangeError("Invalid era data: at least one named era is required");
|
|
2337
|
+
if (s.filter(((d) => d.reverseOf != null)).length > 1) throw new RangeError("Invalid era data: only one era can count years backwards");
|
|
2338
|
+
s.forEach(((d) => {
|
|
2339
|
+
if (d.isAnchor || !d.anchorEpoch && !d.reverseOf) {
|
|
2340
|
+
if (i) throw new RangeError("Invalid era data: cannot have multiple anchor eras");
|
|
2341
|
+
i = d, d.anchorEpoch = { year: d.hasYearZero ? 0 : 1 };
|
|
2342
|
+
} else if (!d.code) throw new RangeError("If era name is blank, it must be the anchor era");
|
|
2343
|
+
})), s = s.filter(((d) => d.code)), s.forEach(((d) => {
|
|
2344
|
+
const { reverseOf: u } = d;
|
|
2345
|
+
if (u) {
|
|
2346
|
+
const l = s.find(((m) => m.code === u));
|
|
2347
|
+
if (l === void 0) throw new RangeError(`Invalid era data: unmatched reverseOf era: ${u}`);
|
|
2348
|
+
d.reverseOf = l, d.anchorEpoch = l.anchorEpoch, d.isoEpoch = l.isoEpoch;
|
|
2349
|
+
}
|
|
2350
|
+
d.anchorEpoch.month === void 0 && (d.anchorEpoch.month = 1), d.anchorEpoch.day === void 0 && (d.anchorEpoch.day = 1);
|
|
2351
|
+
})), s.sort(((d, u) => {
|
|
2352
|
+
if (d.reverseOf) return 1;
|
|
2353
|
+
if (u.reverseOf) return -1;
|
|
2354
|
+
if (!d.isoEpoch || !u.isoEpoch) throw new RangeError("Invalid era data: missing ISO epoch");
|
|
2355
|
+
return u.isoEpoch.year - d.isoEpoch.year;
|
|
2356
|
+
}));
|
|
2357
|
+
const h = s[s.length - 1].reverseOf;
|
|
2358
|
+
if (h && h !== s[s.length - 2]) throw new RangeError("Invalid era data: invalid reverse-sign era");
|
|
2359
|
+
return s.forEach(((d, u) => {
|
|
2360
|
+
d.genericName = "era" + (s.length - 1 - u);
|
|
2361
|
+
})), { eras: s, anchorEra: i || s[0] };
|
|
2362
|
+
})(n);
|
|
2363
|
+
this.anchorEra = o, this.eras = r;
|
|
2364
|
+
}
|
|
2365
|
+
inLeapYear(e) {
|
|
2366
|
+
const { year: n } = this.estimateIsoDate({ month: 1, day: 1, year: e.year });
|
|
2367
|
+
return ho(n);
|
|
2368
|
+
}
|
|
2369
|
+
monthsInYear() {
|
|
2370
|
+
return 12;
|
|
2371
|
+
}
|
|
2372
|
+
minimumMonthLength(e) {
|
|
2373
|
+
const { month: n } = e;
|
|
2374
|
+
return n === 2 ? this.inLeapYear(e) ? 29 : 28 : [4, 6, 9, 11].indexOf(n) >= 0 ? 30 : 31;
|
|
2375
|
+
}
|
|
2376
|
+
maximumMonthLength(e) {
|
|
2377
|
+
return this.minimumMonthLength(e);
|
|
2378
|
+
}
|
|
2379
|
+
maxLengthOfMonthCodeInAnyYear(e) {
|
|
2380
|
+
return [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][jt(e) - 1];
|
|
2381
|
+
}
|
|
2382
|
+
completeEraYear(e) {
|
|
2383
|
+
const n = (s, h, d) => {
|
|
2384
|
+
const u = e[s];
|
|
2385
|
+
if (u != null && u != h && !(d || []).includes(u)) {
|
|
2386
|
+
const l = d?.[0];
|
|
2387
|
+
throw new RangeError(`Input ${s} ${u} doesn't match calculated value ${l ? `${h} (also called ${l})` : h}`);
|
|
2388
|
+
}
|
|
2389
|
+
}, r = (s) => {
|
|
2390
|
+
let h;
|
|
2391
|
+
const d = { ...e, year: s }, u = this.eras.find(((l, m) => {
|
|
2392
|
+
if (m === this.eras.length - 1) {
|
|
2393
|
+
if (l.reverseOf) {
|
|
2394
|
+
if (s > 0) throw new RangeError(`Signed year ${s} is invalid for era ${l.code}`);
|
|
2395
|
+
return h = l.anchorEpoch.year - s, !0;
|
|
2396
|
+
}
|
|
2397
|
+
return h = s - l.anchorEpoch.year + (l.hasYearZero ? 0 : 1), !0;
|
|
2398
|
+
}
|
|
2399
|
+
return this.compareCalendarDates(d, l.anchorEpoch) >= 0 && (h = s - l.anchorEpoch.year + (l.hasYearZero ? 0 : 1), !0);
|
|
2400
|
+
}));
|
|
2401
|
+
if (!u) throw new RangeError(`Year ${s} was not matched by any era`);
|
|
2402
|
+
return { eraYear: h, era: u.code, eraNames: u.names };
|
|
2403
|
+
};
|
|
2404
|
+
let { year: o, eraYear: a, era: i } = e;
|
|
2405
|
+
if (o != null) {
|
|
2406
|
+
const s = r(o);
|
|
2407
|
+
({ eraYear: a, era: i } = s), n("era", i, s?.eraNames), n("eraYear", a);
|
|
2408
|
+
} else {
|
|
2409
|
+
if (a == null) throw new RangeError("Either year or eraYear and era are required");
|
|
2410
|
+
{
|
|
2411
|
+
if (i === void 0) throw new RangeError("era and eraYear must be provided together");
|
|
2412
|
+
const s = this.eras.find((({ code: h, names: d = [] }) => h === i || d.includes(i)));
|
|
2413
|
+
if (!s) throw new RangeError(`Era ${i} (ISO year ${a}) was not matched by any era`);
|
|
2414
|
+
o = s.reverseOf ? s.anchorEpoch.year - a : a + s.anchorEpoch.year - (s.hasYearZero ? 0 : 1), n("year", o), { eraYear: a, era: i } = r(o);
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
return { ...e, year: o, eraYear: a, era: i };
|
|
2418
|
+
}
|
|
2419
|
+
adjustCalendarDate(e, n, r = "constrain") {
|
|
2420
|
+
let o = e;
|
|
2421
|
+
const { month: a, monthCode: i } = o;
|
|
2422
|
+
return a === void 0 && (o = { ...o, month: jt(i) }), this.validateCalendarDate(o), o = this.completeEraYear(o), super.adjustCalendarDate(o, n, r);
|
|
2423
|
+
}
|
|
2424
|
+
estimateIsoDate(e) {
|
|
2425
|
+
const n = this.adjustCalendarDate(e), { year: r, month: o, day: a } = n, { anchorEra: i } = this;
|
|
2426
|
+
return Tn(r + i.isoEpoch.year - (i.hasYearZero ? 0 : 1), o, a, "constrain");
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
class uo extends Ka {
|
|
2430
|
+
constructor(e, n) {
|
|
2431
|
+
super(e, n);
|
|
2432
|
+
}
|
|
2433
|
+
isoToCalendarDate(e) {
|
|
2434
|
+
const { year: n, month: r, day: o } = e, a = Ke(r), i = n - this.anchorEra.isoEpoch.year + 1;
|
|
2435
|
+
return this.completeEraYear({ year: i, month: r, monthCode: a, day: o });
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
const He = { inLeapYear(t) {
|
|
2439
|
+
const { year: e } = t;
|
|
2440
|
+
return (e + 1) % 4 == 0;
|
|
2441
|
+
}, monthsInYear: () => 13, minimumMonthLength(t) {
|
|
2442
|
+
const { month: e } = t;
|
|
2443
|
+
return e === 13 ? this.inLeapYear(t) ? 6 : 5 : 30;
|
|
2444
|
+
}, maximumMonthLength(t) {
|
|
2445
|
+
return this.minimumMonthLength(t);
|
|
2446
|
+
}, maxLengthOfMonthCodeInAnyYear: (t) => t === "M13" ? 6 : 30 };
|
|
2447
|
+
class Zi extends Ga {
|
|
2448
|
+
constructor(e, n) {
|
|
2449
|
+
super(e, n), this.inLeapYear = He.inLeapYear, this.monthsInYear = He.monthsInYear, this.minimumMonthLength = He.minimumMonthLength, this.maximumMonthLength = He.maximumMonthLength, this.maxLengthOfMonthCodeInAnyYear = He.maxLengthOfMonthCodeInAnyYear;
|
|
2450
|
+
}
|
|
2451
|
+
}
|
|
2452
|
+
class Va extends Ka {
|
|
2453
|
+
constructor(e, n) {
|
|
2454
|
+
super(e, n), this.inLeapYear = He.inLeapYear, this.monthsInYear = He.monthsInYear, this.minimumMonthLength = He.minimumMonthLength, this.maximumMonthLength = He.maximumMonthLength, this.maxLengthOfMonthCodeInAnyYear = He.maxLengthOfMonthCodeInAnyYear;
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
class Fi extends Zi {
|
|
2458
|
+
constructor() {
|
|
2459
|
+
super("ethioaa", { year: -5492, month: 7, day: 17 });
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
class Bi extends Va {
|
|
2463
|
+
constructor() {
|
|
2464
|
+
super("coptic", [{ code: "coptic", isoEpoch: { year: 284, month: 8, day: 29 } }, { code: "coptic-inverse", reverseOf: "coptic" }]);
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
class zi extends Va {
|
|
2468
|
+
constructor() {
|
|
2469
|
+
super("ethiopic", [{ code: "ethioaa", names: ["ethiopic-amete-alem", "mundi"], isoEpoch: { year: -5492, month: 7, day: 17 } }, { code: "ethiopic", names: ["incar"], isoEpoch: { year: 8, month: 8, day: 27 }, anchorEpoch: { year: 5501 } }]);
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
class Ai extends uo {
|
|
2473
|
+
constructor() {
|
|
2474
|
+
super("roc", [{ code: "roc", names: ["minguo"], isoEpoch: { year: 1912, month: 1, day: 1 } }, { code: "roc-inverse", names: ["before-roc"], reverseOf: "roc" }]);
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
class qi extends Ga {
|
|
2478
|
+
constructor() {
|
|
2479
|
+
super("buddhist", { year: -543, month: 1, day: 1 });
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
class Wi extends uo {
|
|
2483
|
+
constructor() {
|
|
2484
|
+
super("gregory", [{ code: "gregory", names: ["ad", "ce"], isoEpoch: { year: 1, month: 1, day: 1 } }, { code: "gregory-inverse", names: ["be", "bce"], reverseOf: "gregory" }]);
|
|
2485
|
+
}
|
|
2486
|
+
reviseIntlEra(e) {
|
|
2487
|
+
let { era: n, eraYear: r } = e;
|
|
2488
|
+
return n === "b" && (n = "gregory-inverse"), n === "a" && (n = "gregory"), { era: n, eraYear: r };
|
|
2489
|
+
}
|
|
2490
|
+
getFirstDayOfWeek() {
|
|
2491
|
+
return 1;
|
|
2492
|
+
}
|
|
2493
|
+
getMinimalDaysInFirstWeek() {
|
|
2494
|
+
return 1;
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
class Hi extends uo {
|
|
2498
|
+
constructor() {
|
|
2499
|
+
super("japanese", [{ code: "reiwa", isoEpoch: { year: 2019, month: 5, day: 1 }, anchorEpoch: { year: 2019, month: 5, day: 1 } }, { code: "heisei", isoEpoch: { year: 1989, month: 1, day: 8 }, anchorEpoch: { year: 1989, month: 1, day: 8 } }, { code: "showa", isoEpoch: { year: 1926, month: 12, day: 25 }, anchorEpoch: { year: 1926, month: 12, day: 25 } }, { code: "taisho", isoEpoch: { year: 1912, month: 7, day: 30 }, anchorEpoch: { year: 1912, month: 7, day: 30 } }, { code: "meiji", isoEpoch: { year: 1868, month: 9, day: 8 }, anchorEpoch: { year: 1868, month: 9, day: 8 } }, { code: "japanese", names: ["japanese", "gregory", "ad", "ce"], isoEpoch: { year: 1, month: 1, day: 1 } }, { code: "japanese-inverse", names: ["japanese-inverse", "gregory-inverse", "bc", "bce"], reverseOf: "japanese" }]), this.erasBeginMidYear = !0;
|
|
2500
|
+
}
|
|
2501
|
+
reviseIntlEra(e, n) {
|
|
2502
|
+
const { era: r, eraYear: o } = e, { year: a } = n;
|
|
2503
|
+
return this.eras.find(((i) => i.code === r)) ? { era: r, eraYear: o } : a < 1 ? { era: "japanese-inverse", eraYear: 1 - a } : { era: "japanese", eraYear: a };
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2506
|
+
class Xa extends Ut {
|
|
2507
|
+
constructor() {
|
|
2508
|
+
super(...arguments), this.calendarType = "lunisolar";
|
|
2509
|
+
}
|
|
2510
|
+
inLeapYear(e, n) {
|
|
2511
|
+
const r = this.getMonthList(e.year, n);
|
|
2512
|
+
return Object.entries(r).length === 13;
|
|
2513
|
+
}
|
|
2514
|
+
monthsInYear(e, n) {
|
|
2515
|
+
return this.inLeapYear(e, n) ? 13 : 12;
|
|
2516
|
+
}
|
|
2517
|
+
minimumMonthLength() {
|
|
2518
|
+
return 29;
|
|
2519
|
+
}
|
|
2520
|
+
maximumMonthLength() {
|
|
2521
|
+
return 30;
|
|
2522
|
+
}
|
|
2523
|
+
maxLengthOfMonthCodeInAnyYear(e) {
|
|
2524
|
+
return ["M01L", "M09L", "M10L", "M11L", "M12L"].includes(e) ? 29 : 30;
|
|
2525
|
+
}
|
|
2526
|
+
monthDaySearchStartYear(e, n) {
|
|
2527
|
+
const r = { M01L: [1651, 1651], M02L: [1947, 1765], M03L: [1966, 1955], M04L: [1963, 1944], M05L: [1971, 1952], M06L: [1960, 1941], M07L: [1968, 1938], M08L: [1957, 1718], M09L: [1832, 1832], M10L: [1870, 1870], M11L: [1814, 1814], M12L: [1890, 1890] }[e] ?? [1972, 1972];
|
|
2528
|
+
return n < 30 ? r[0] : r[1];
|
|
2529
|
+
}
|
|
2530
|
+
getMonthList(e, n) {
|
|
2531
|
+
if (e === void 0) throw new TypeError("Missing year");
|
|
2532
|
+
const r = JSON.stringify({ func: "getMonthList", calendarYear: e, id: this.id }), o = n.get(r);
|
|
2533
|
+
if (o) return o;
|
|
2534
|
+
const a = this.getFormatter(), i = (w, E) => {
|
|
2535
|
+
const T = Ja({ isoYear: w, isoMonth: 2, isoDay: 1 }), D = new Date(T);
|
|
2536
|
+
D.setUTCDate(E + 1);
|
|
2537
|
+
const Y = a.formatToParts(D), O = Y.find(((Z) => Z.type === "month")).value, W = +Y.find(((Z) => Z.type === "day")).value, K = Y.find(((Z) => Z.type === "relatedYear"));
|
|
2538
|
+
let H;
|
|
2539
|
+
if (K === void 0) throw new RangeError(`Intl.DateTimeFormat.formatToParts lacks relatedYear in ${this.id} calendar. Try Node 14+ or modern browsers.`);
|
|
2540
|
+
return H = +K.value, { calendarMonthString: O, calendarDay: W, calendarYearToVerify: H };
|
|
2541
|
+
};
|
|
2542
|
+
let s = 17, { calendarMonthString: h, calendarDay: d, calendarYearToVerify: u } = i(e, s);
|
|
2543
|
+
h !== "1" && (s += 29, { calendarMonthString: h, calendarDay: d } = i(e, s)), s -= d - 5;
|
|
2544
|
+
const l = {};
|
|
2545
|
+
let m, f, p = 1, v = !1;
|
|
2546
|
+
do
|
|
2547
|
+
({ calendarMonthString: h, calendarDay: d, calendarYearToVerify: u } = i(e, s)), m && (l[f].daysInMonth = m + 30 - d), u !== e ? v = !0 : (l[h] = { monthIndex: p++ }, s += 30), m = d, f = h;
|
|
2548
|
+
while (!v);
|
|
2549
|
+
return l[f].daysInMonth = m + 30 - d, n.set(r, l), l;
|
|
2550
|
+
}
|
|
2551
|
+
estimateIsoDate(e) {
|
|
2552
|
+
const { year: n, month: r } = e;
|
|
2553
|
+
return { year: n, month: r >= 12 ? 12 : r + 1, day: 1 };
|
|
2554
|
+
}
|
|
2555
|
+
adjustCalendarDate(e, n, r = "constrain", o = !1) {
|
|
2556
|
+
let { year: a, month: i, monthExtra: s, day: h, monthCode: d } = e;
|
|
2557
|
+
if (a === void 0) throw new TypeError("Missing property: year");
|
|
2558
|
+
if (o) {
|
|
2559
|
+
if (s && s !== "bis") throw new RangeError(`Unexpected leap month suffix: ${s}`);
|
|
2560
|
+
const u = Ke(i, s !== void 0), l = `${i}${s || ""}`, m = this.getMonthList(a, n)[l];
|
|
2561
|
+
if (m === void 0) throw new RangeError(`Unmatched month ${l} in Chinese year ${a}`);
|
|
2562
|
+
return i = m.monthIndex, { year: a, month: i, day: h, monthCode: u };
|
|
2563
|
+
}
|
|
2564
|
+
if (this.validateCalendarDate(e), i === void 0) {
|
|
2565
|
+
const u = this.getMonthList(a, n);
|
|
2566
|
+
let l = d.replace(/^M|L$/g, ((f) => f === "L" ? "bis" : ""));
|
|
2567
|
+
l[0] === "0" && (l = l.slice(1));
|
|
2568
|
+
let m = u[l];
|
|
2569
|
+
if (i = m && m.monthIndex, i === void 0 && d.endsWith("L") && d != "M13L" && r === "constrain") {
|
|
2570
|
+
const f = +d.replace(/^M0?|L$/g, "");
|
|
2571
|
+
m = u[f], m && (i = m.monthIndex, d = Ke(f));
|
|
2572
|
+
}
|
|
2573
|
+
if (i === void 0) throw new RangeError(`Unmatched month ${d} in Chinese year ${a}`);
|
|
2574
|
+
} else if (d === void 0) {
|
|
2575
|
+
const u = this.getMonthList(a, n), l = Object.entries(u), m = l.length;
|
|
2576
|
+
r === "reject" ? (G(i, 1, m), G(h, 1, this.maximumMonthLength())) : (i = pe(i, 1, m), h = pe(h, 1, this.maximumMonthLength()));
|
|
2577
|
+
const f = l.find(((p) => p[1].monthIndex === i));
|
|
2578
|
+
if (f === void 0) throw new RangeError(`Invalid month ${i} in Chinese year ${a}`);
|
|
2579
|
+
d = Ke(+f[0].replace("bis", ""), f[0].indexOf("bis") !== -1);
|
|
2580
|
+
} else {
|
|
2581
|
+
const u = this.getMonthList(a, n);
|
|
2582
|
+
let l = d.replace(/^M|L$/g, ((f) => f === "L" ? "bis" : ""));
|
|
2583
|
+
l[0] === "0" && (l = l.slice(1));
|
|
2584
|
+
const m = u[l];
|
|
2585
|
+
if (!m) throw new RangeError(`Unmatched monthCode ${d} in Chinese year ${a}`);
|
|
2586
|
+
if (i !== m.monthIndex) throw new RangeError(`monthCode ${d} doesn't correspond to month ${i} in Chinese year ${a}`);
|
|
2587
|
+
}
|
|
2588
|
+
return { ...e, year: a, month: i, monthCode: d, day: h };
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
class _i extends Xa {
|
|
2592
|
+
constructor() {
|
|
2593
|
+
super(...arguments), this.id = "chinese";
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
class Ji extends Xa {
|
|
2597
|
+
constructor() {
|
|
2598
|
+
super(...arguments), this.id = "dangi";
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
class Gi {
|
|
2602
|
+
constructor(e) {
|
|
2603
|
+
this.helper = e;
|
|
2604
|
+
}
|
|
2605
|
+
extraFields(e) {
|
|
2606
|
+
return this.helper.hasEra && e.includes("year") ? ["era", "eraYear"] : [];
|
|
2607
|
+
}
|
|
2608
|
+
resolveFields(e) {
|
|
2609
|
+
if (this.helper.calendarType !== "lunisolar") {
|
|
2610
|
+
const n = new J();
|
|
2611
|
+
co(e, void 0, this.helper.monthsInYear({ year: e.year ?? 1972 }, n));
|
|
2612
|
+
}
|
|
2613
|
+
}
|
|
2614
|
+
dateToISO(e, n) {
|
|
2615
|
+
const r = new J(), o = this.helper.calendarToIsoDate(e, n, r);
|
|
2616
|
+
return r.setObject(o), o;
|
|
2617
|
+
}
|
|
2618
|
+
monthDayToISOReferenceDate(e, n) {
|
|
2619
|
+
const r = new J(), o = this.helper.monthDayFromFields(e, n, r);
|
|
2620
|
+
return r.setObject(o), o;
|
|
2621
|
+
}
|
|
2622
|
+
fieldKeysToIgnore(e) {
|
|
2623
|
+
const n = /* @__PURE__ */ new Set();
|
|
2624
|
+
for (let r = 0; r < e.length; r++) {
|
|
2625
|
+
const o = e[r];
|
|
2626
|
+
switch (n.add(o), o) {
|
|
2627
|
+
case "era":
|
|
2628
|
+
n.add("eraYear"), n.add("year");
|
|
2629
|
+
break;
|
|
2630
|
+
case "eraYear":
|
|
2631
|
+
n.add("era"), n.add("year");
|
|
2632
|
+
break;
|
|
2633
|
+
case "year":
|
|
2634
|
+
n.add("era"), n.add("eraYear");
|
|
2635
|
+
break;
|
|
2636
|
+
case "month":
|
|
2637
|
+
n.add("monthCode"), this.helper.erasBeginMidYear && (n.add("era"), n.add("eraYear"));
|
|
2638
|
+
break;
|
|
2639
|
+
case "monthCode":
|
|
2640
|
+
n.add("month"), this.helper.erasBeginMidYear && (n.add("era"), n.add("eraYear"));
|
|
2641
|
+
break;
|
|
2642
|
+
case "day":
|
|
2643
|
+
this.helper.erasBeginMidYear && (n.add("era"), n.add("eraYear"));
|
|
2644
|
+
}
|
|
2645
|
+
}
|
|
2646
|
+
return Ha(n);
|
|
2647
|
+
}
|
|
2648
|
+
dateAdd(e, { years: n, months: r, weeks: o, days: a }, i) {
|
|
2649
|
+
const s = J.getCacheForObject(e), h = this.helper.isoToCalendarDate(e, s), d = this.helper.addCalendar(h, { years: n, months: r, weeks: o, days: a }, i, s), u = this.helper.calendarToIsoDate(d, "constrain", s);
|
|
2650
|
+
return J.getCacheForObject(u) || new J(s).setObject(u), u;
|
|
2651
|
+
}
|
|
2652
|
+
dateUntil(e, n, r) {
|
|
2653
|
+
const o = J.getCacheForObject(e), a = J.getCacheForObject(n), i = this.helper.isoToCalendarDate(e, o), s = this.helper.isoToCalendarDate(n, a);
|
|
2654
|
+
return this.helper.untilCalendar(i, s, r, o);
|
|
2655
|
+
}
|
|
2656
|
+
isoToDate(e, n) {
|
|
2657
|
+
const r = J.getCacheForObject(e), o = this.helper.isoToCalendarDate(e, r);
|
|
2658
|
+
if (n.dayOfWeek && (o.dayOfWeek = Gn.iso8601.isoToDate(e, { dayOfWeek: !0 }).dayOfWeek), n.dayOfYear) {
|
|
2659
|
+
const a = this.helper.startOfCalendarYear(o), i = this.helper.calendarDaysUntil(a, o, r);
|
|
2660
|
+
o.dayOfYear = i + 1;
|
|
2661
|
+
}
|
|
2662
|
+
if (n.weekOfYear && (o.weekOfYear = _a(this.helper.id, e)), o.daysInWeek = 7, n.daysInMonth && (o.daysInMonth = this.helper.daysInMonth(o, r)), n.daysInYear) {
|
|
2663
|
+
const a = this.helper.startOfCalendarYear(o), i = this.helper.addCalendar(a, { years: 1 }, "constrain", r);
|
|
2664
|
+
o.daysInYear = this.helper.calendarDaysUntil(a, i, r);
|
|
2665
|
+
}
|
|
2666
|
+
return n.monthsInYear && (o.monthsInYear = this.helper.monthsInYear(o, r)), n.inLeapYear && (o.inLeapYear = this.helper.inLeapYear(o, r)), o;
|
|
2667
|
+
}
|
|
2668
|
+
getFirstDayOfWeek() {
|
|
2669
|
+
return this.helper.getFirstDayOfWeek();
|
|
2670
|
+
}
|
|
2671
|
+
getMinimalDaysInFirstWeek() {
|
|
2672
|
+
return this.helper.getMinimalDaysInFirstWeek();
|
|
2673
|
+
}
|
|
2674
|
+
}
|
|
2675
|
+
for (const t of [Ri, Ui, zi, Fi, Bi, _i, Ji, Ai, Pi, qi, Wi, Hi, Si, ki, Ni, ji, xi, Li]) {
|
|
2676
|
+
const e = new t();
|
|
2677
|
+
Gn[e.id] = new Gi(e);
|
|
2678
|
+
}
|
|
2679
|
+
Ur("calendarImpl", (function(t) {
|
|
2680
|
+
return Gn[t];
|
|
2681
|
+
}));
|
|
2682
|
+
const xn = Intl.DateTimeFormat;
|
|
2683
|
+
function Ft(t, e) {
|
|
2684
|
+
let n = c(t, e);
|
|
2685
|
+
return typeof n == "function" && (n = new xn(c(t, da), n(c(t, Nr))), (function(r, o, a) {
|
|
2686
|
+
const i = mr(r);
|
|
2687
|
+
if (i === void 0) throw new TypeError("Missing slots for the given container");
|
|
2688
|
+
if (i[o] === void 0) throw new TypeError(`tried to reset ${o} which was not set`);
|
|
2689
|
+
i[o] = a;
|
|
2690
|
+
})(t, e, n)), n;
|
|
2691
|
+
}
|
|
2692
|
+
function ln(t) {
|
|
2693
|
+
return Ee(t, xt);
|
|
2694
|
+
}
|
|
2695
|
+
class Ln {
|
|
2696
|
+
constructor(e = void 0, n = void 0) {
|
|
2697
|
+
(function(r, o, a) {
|
|
2698
|
+
const i = a !== void 0;
|
|
2699
|
+
let s;
|
|
2700
|
+
if (i) {
|
|
2701
|
+
const l = ["localeMatcher", "calendar", "numberingSystem", "hour12", "hourCycle", "timeZone", "weekday", "era", "year", "month", "day", "dayPeriod", "hour", "minute", "second", "fractionalSecondDigits", "timeZoneName", "formatMatcher", "dateStyle", "timeStyle"];
|
|
2702
|
+
s = (function(f) {
|
|
2703
|
+
if (f == null) throw new TypeError(`Expected object not ${f}`);
|
|
2704
|
+
return Object(f);
|
|
2705
|
+
})(a);
|
|
2706
|
+
const m = /* @__PURE__ */ Object.create(null);
|
|
2707
|
+
for (let f = 0; f < l.length; f++) {
|
|
2708
|
+
const p = l[f];
|
|
2709
|
+
Object.prototype.hasOwnProperty.call(s, p) && (m[p] = s[p]);
|
|
2710
|
+
}
|
|
2711
|
+
s = m;
|
|
2712
|
+
} else s = /* @__PURE__ */ Object.create(null);
|
|
2713
|
+
const h = new xn(o, s), d = h.resolvedOptions();
|
|
2714
|
+
if (lt(r), i) {
|
|
2715
|
+
const l = Object.assign(/* @__PURE__ */ Object.create(null), d);
|
|
2716
|
+
for (const m in l) Object.prototype.hasOwnProperty.call(s, m) || delete l[m];
|
|
2717
|
+
l.hour12 = s.hour12, l.hourCycle = s.hourCycle, R(r, Nr, l);
|
|
2718
|
+
} else R(r, Nr, s);
|
|
2719
|
+
R(r, da, d.locale), R(r, xt, h), R(r, At, d.timeZone), R(r, fn, d.calendar), R(r, ra, os), R(r, oa, ns), R(r, aa, rs), R(r, ia, ts), R(r, sa, as), R(r, ca, is);
|
|
2720
|
+
const u = i ? s.timeZone : void 0;
|
|
2721
|
+
if (u === void 0) R(r, kr, d.timeZone);
|
|
2722
|
+
else {
|
|
2723
|
+
const l = pr(u);
|
|
2724
|
+
if (l.startsWith("−")) throw new RangeError("Unicode minus (U+2212) is not supported in time zone offsets");
|
|
2725
|
+
R(r, kr, ve(l));
|
|
2726
|
+
}
|
|
2727
|
+
})(this, e, n);
|
|
2728
|
+
}
|
|
2729
|
+
get format() {
|
|
2730
|
+
g(this, ln);
|
|
2731
|
+
const e = Vi.bind(this);
|
|
2732
|
+
return Object.defineProperties(e, { length: { value: 1, enumerable: !1, writable: !1, configurable: !0 }, name: { value: "", enumerable: !1, writable: !1, configurable: !0 } }), e;
|
|
2733
|
+
}
|
|
2734
|
+
formatRange(e, n) {
|
|
2735
|
+
return g(this, ln), Qi.call(this, e, n);
|
|
2736
|
+
}
|
|
2737
|
+
formatToParts(e, ...n) {
|
|
2738
|
+
return g(this, ln), Xi.call(this, e, ...n);
|
|
2739
|
+
}
|
|
2740
|
+
formatRangeToParts(e, n) {
|
|
2741
|
+
return g(this, ln), es.call(this, e, n);
|
|
2742
|
+
}
|
|
2743
|
+
resolvedOptions() {
|
|
2744
|
+
return g(this, ln), Ki.call(this);
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
"formatToParts" in xn.prototype || delete Ln.prototype.formatToParts, "formatRangeToParts" in xn.prototype || delete Ln.prototype.formatRangeToParts;
|
|
2748
|
+
const Pe = function(t = void 0, e = void 0) {
|
|
2749
|
+
return new Ln(t, e);
|
|
2750
|
+
};
|
|
2751
|
+
function Ki() {
|
|
2752
|
+
const t = c(this, xt).resolvedOptions();
|
|
2753
|
+
return t.timeZone = c(this, kr), t;
|
|
2754
|
+
}
|
|
2755
|
+
function Vi(t, ...e) {
|
|
2756
|
+
let n, r, o = tn(t, this);
|
|
2757
|
+
return o.formatter ? (n = o.formatter, r = [Be(o.epochNs, "floor")]) : (n = c(this, xt), r = [t, ...e]), n.format(...r);
|
|
2758
|
+
}
|
|
2759
|
+
function Xi(t, ...e) {
|
|
2760
|
+
let n, r, o = tn(t, this);
|
|
2761
|
+
return o.formatter ? (n = o.formatter, r = [Be(o.epochNs, "floor")]) : (n = c(this, xt), r = [t, ...e]), n.formatToParts(...r);
|
|
2762
|
+
}
|
|
2763
|
+
function Qi(t, e) {
|
|
2764
|
+
if (t === void 0 || e === void 0) throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");
|
|
2765
|
+
const n = lr(t), r = lr(e);
|
|
2766
|
+
let o, a = [n, r];
|
|
2767
|
+
if (ht(n) !== ht(r)) throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");
|
|
2768
|
+
if (ht(n)) {
|
|
2769
|
+
if (!Qa(n, r)) throw new TypeError("Intl.DateTimeFormat.formatRange accepts two values of the same type");
|
|
2770
|
+
const { epochNs: i, formatter: s } = tn(n, this), { epochNs: h, formatter: d } = tn(r, this);
|
|
2771
|
+
s && (o = s, a = [Be(i, "floor"), Be(h, "floor")]);
|
|
2772
|
+
}
|
|
2773
|
+
return o || (o = c(this, xt)), o.formatRange(...a);
|
|
2774
|
+
}
|
|
2775
|
+
function es(t, e) {
|
|
2776
|
+
if (t === void 0 || e === void 0) throw new TypeError("Intl.DateTimeFormat.formatRange requires two values");
|
|
2777
|
+
const n = lr(t), r = lr(e);
|
|
2778
|
+
let o, a = [n, r];
|
|
2779
|
+
if (ht(n) !== ht(r)) throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");
|
|
2780
|
+
if (ht(n)) {
|
|
2781
|
+
if (!Qa(n, r)) throw new TypeError("Intl.DateTimeFormat.formatRangeToParts accepts two values of the same type");
|
|
2782
|
+
const { epochNs: i, formatter: s } = tn(n, this), { epochNs: h, formatter: d } = tn(r, this);
|
|
2783
|
+
s && (o = s, a = [Be(i, "floor"), Be(h, "floor")]);
|
|
2784
|
+
}
|
|
2785
|
+
return o || (o = c(this, xt)), o.formatRangeToParts(...a);
|
|
2786
|
+
}
|
|
2787
|
+
function Kn(t = {}, e = {}) {
|
|
2788
|
+
const n = Object.assign({}, t), r = ["year", "month", "day", "hour", "minute", "second", "weekday", "dayPeriod", "timeZoneName", "dateStyle", "timeStyle"];
|
|
2789
|
+
for (let o = 0; o < r.length; o++) {
|
|
2790
|
+
const a = r[o];
|
|
2791
|
+
n[a] = a in e ? e[a] : n[a], n[a] !== !1 && n[a] !== void 0 || delete n[a];
|
|
2792
|
+
}
|
|
2793
|
+
return n;
|
|
2794
|
+
}
|
|
2795
|
+
function ts(t) {
|
|
2796
|
+
const e = Kn(t, { year: !1, month: !1, day: !1, weekday: !1, timeZoneName: !1, dateStyle: !1 });
|
|
2797
|
+
if (e.timeStyle !== "long" && e.timeStyle !== "full" || (delete e.timeStyle, Object.assign(e, { hour: "numeric", minute: "2-digit", second: "2-digit" })), !Cr(e)) {
|
|
2798
|
+
if (Vn(t)) throw new TypeError(`cannot format Temporal.PlainTime with options [${Object.keys(t)}]`);
|
|
2799
|
+
Object.assign(e, { hour: "numeric", minute: "numeric", second: "numeric" });
|
|
2800
|
+
}
|
|
2801
|
+
return e;
|
|
2802
|
+
}
|
|
2803
|
+
function ns(t) {
|
|
2804
|
+
const e = { short: { year: "2-digit", month: "numeric" }, medium: { year: "numeric", month: "short" }, long: { year: "numeric", month: "long" }, full: { year: "numeric", month: "long" } }, n = Kn(t, { day: !1, hour: !1, minute: !1, second: !1, weekday: !1, dayPeriod: !1, timeZoneName: !1, timeStyle: !1 });
|
|
2805
|
+
if ("dateStyle" in n && n.dateStyle) {
|
|
2806
|
+
const r = n.dateStyle;
|
|
2807
|
+
delete n.dateStyle, Object.assign(n, e[r]);
|
|
2808
|
+
}
|
|
2809
|
+
if (!("year" in n || "month" in n || "era" in n)) {
|
|
2810
|
+
if (Vn(t)) throw new TypeError(`cannot format PlainYearMonth with options [${Object.keys(t)}]`);
|
|
2811
|
+
Object.assign(n, { year: "numeric", month: "numeric" });
|
|
2812
|
+
}
|
|
2813
|
+
return n;
|
|
2814
|
+
}
|
|
2815
|
+
function rs(t) {
|
|
2816
|
+
const e = { short: { month: "numeric", day: "numeric" }, medium: { month: "short", day: "numeric" }, long: { month: "long", day: "numeric" }, full: { month: "long", day: "numeric" } }, n = Kn(t, { year: !1, hour: !1, minute: !1, second: !1, weekday: !1, dayPeriod: !1, timeZoneName: !1, timeStyle: !1 });
|
|
2817
|
+
if ("dateStyle" in n && n.dateStyle) {
|
|
2818
|
+
const r = n.dateStyle;
|
|
2819
|
+
delete n.dateStyle, Object.assign(n, e[r]);
|
|
2820
|
+
}
|
|
2821
|
+
if (!("month" in n) && !("day" in n)) {
|
|
2822
|
+
if (Vn(t)) throw new TypeError(`cannot format PlainMonthDay with options [${Object.keys(t)}]`);
|
|
2823
|
+
Object.assign(n, { month: "numeric", day: "numeric" });
|
|
2824
|
+
}
|
|
2825
|
+
return n;
|
|
2826
|
+
}
|
|
2827
|
+
function os(t) {
|
|
2828
|
+
const e = Kn(t, { hour: !1, minute: !1, second: !1, dayPeriod: !1, timeZoneName: !1, timeStyle: !1 });
|
|
2829
|
+
if (!Ir(e)) {
|
|
2830
|
+
if (Vn(t)) throw new TypeError(`cannot format PlainDate with options [${Object.keys(t)}]`);
|
|
2831
|
+
Object.assign(e, { year: "numeric", month: "numeric", day: "numeric" });
|
|
2832
|
+
}
|
|
2833
|
+
return e;
|
|
2834
|
+
}
|
|
2835
|
+
function as(t) {
|
|
2836
|
+
const e = Kn(t, { timeZoneName: !1 });
|
|
2837
|
+
if ((e.timeStyle === "long" || e.timeStyle === "full") && (delete e.timeStyle, Object.assign(e, { hour: "numeric", minute: "2-digit", second: "2-digit" }), e.dateStyle) && (Object.assign(e, { short: { year: "numeric", month: "numeric", day: "numeric" }, medium: { year: "numeric", month: "short", day: "numeric" }, long: { year: "numeric", month: "long", day: "numeric" }, full: { year: "numeric", month: "long", day: "numeric", weekday: "long" } }[e.dateStyle]), delete e.dateStyle), !Cr(e) && !Ir(e)) {
|
|
2838
|
+
if (Vn(t)) throw new TypeError(`cannot format PlainDateTime with options [${Object.keys(t)}]`);
|
|
2839
|
+
Object.assign(e, { year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" });
|
|
2840
|
+
}
|
|
2841
|
+
return e;
|
|
2842
|
+
}
|
|
2843
|
+
function is(t) {
|
|
2844
|
+
let e = t;
|
|
2845
|
+
return Cr(e) || Ir(e) || (e = Object.assign({}, e, { year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" })), e;
|
|
2846
|
+
}
|
|
2847
|
+
function Ir(t) {
|
|
2848
|
+
return "year" in t || "month" in t || "day" in t || "weekday" in t || "dateStyle" in t || "era" in t;
|
|
2849
|
+
}
|
|
2850
|
+
function Cr(t) {
|
|
2851
|
+
return "hour" in t || "minute" in t || "second" in t || "timeStyle" in t || "dayPeriod" in t || "fractionalSecondDigits" in t;
|
|
2852
|
+
}
|
|
2853
|
+
function Vn(t) {
|
|
2854
|
+
return Ir(t) || Cr(t) || "dateStyle" in t || "timeStyle" in t || "timeZoneName" in t;
|
|
2855
|
+
}
|
|
2856
|
+
function ht(t) {
|
|
2857
|
+
return B(t) || q(t) || L(t) || S(t) || Q(t) || Se(t) || X(t);
|
|
2858
|
+
}
|
|
2859
|
+
function lr(t) {
|
|
2860
|
+
return ht(t) ? t : gr(t);
|
|
2861
|
+
}
|
|
2862
|
+
function Qa(t, e) {
|
|
2863
|
+
return !(!ht(t) || !ht(e) || q(t) && !q(e) || B(t) && !B(e) || L(t) && !L(e) || S(t) && !S(e) || Q(t) && !Q(e) || Se(t) && !Se(e) || X(t) && !X(e));
|
|
2864
|
+
}
|
|
2865
|
+
function tn(t, e) {
|
|
2866
|
+
if (q(t)) {
|
|
2867
|
+
const n = { isoDate: { year: 1970, month: 1, day: 1 }, time: c(t, z) };
|
|
2868
|
+
return { epochNs: oe(c(e, At), n, "compatible"), formatter: Ft(e, ia) };
|
|
2869
|
+
}
|
|
2870
|
+
if (Q(t)) {
|
|
2871
|
+
const n = c(t, b), r = c(e, fn);
|
|
2872
|
+
if (n !== r) throw new RangeError(`cannot format PlainYearMonth with calendar ${n} in locale with calendar ${r}`);
|
|
2873
|
+
const o = j(c(t, C), { deltaDays: 0, hour: 12, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 });
|
|
2874
|
+
return { epochNs: oe(c(e, At), o, "compatible"), formatter: Ft(e, oa) };
|
|
2875
|
+
}
|
|
2876
|
+
if (Se(t)) {
|
|
2877
|
+
const n = c(t, b), r = c(e, fn);
|
|
2878
|
+
if (n !== r) throw new RangeError(`cannot format PlainMonthDay with calendar ${n} in locale with calendar ${r}`);
|
|
2879
|
+
const o = j(c(t, C), { deltaDays: 0, hour: 12, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 });
|
|
2880
|
+
return { epochNs: oe(c(e, At), o, "compatible"), formatter: Ft(e, aa) };
|
|
2881
|
+
}
|
|
2882
|
+
if (B(t)) {
|
|
2883
|
+
const n = c(t, b), r = c(e, fn);
|
|
2884
|
+
if (n !== "iso8601" && n !== r) throw new RangeError(`cannot format PlainDate with calendar ${n} in locale with calendar ${r}`);
|
|
2885
|
+
const o = j(c(t, C), { deltaDays: 0, hour: 12, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 });
|
|
2886
|
+
return { epochNs: oe(c(e, At), o, "compatible"), formatter: Ft(e, ra) };
|
|
2887
|
+
}
|
|
2888
|
+
if (L(t)) {
|
|
2889
|
+
const n = c(t, b), r = c(e, fn);
|
|
2890
|
+
if (n !== "iso8601" && n !== r) throw new RangeError(`cannot format PlainDateTime with calendar ${n} in locale with calendar ${r}`);
|
|
2891
|
+
const o = c(t, P);
|
|
2892
|
+
return { epochNs: oe(c(e, At), o, "compatible"), formatter: Ft(e, sa) };
|
|
2893
|
+
}
|
|
2894
|
+
if (S(t)) throw new TypeError("Temporal.ZonedDateTime not supported in DateTimeFormat methods. Use toLocaleString() instead.");
|
|
2895
|
+
return X(t) ? { epochNs: c(t, I), formatter: Ft(e, ca) } : {};
|
|
2896
|
+
}
|
|
2897
|
+
function ei(t) {
|
|
2898
|
+
const e = /* @__PURE__ */ Object.create(null);
|
|
2899
|
+
return e.years = c(t, de), e.months = c(t, he), e.weeks = c(t, Te), e.days = c(t, ue), e.hours = c(t, le), e.minutes = c(t, me), e.seconds = c(t, fe), e.milliseconds = c(t, ye), e.microseconds = c(t, ge), e.nanoseconds = c(t, Ie), e;
|
|
2900
|
+
}
|
|
2901
|
+
Ln.prototype.constructor = Pe, Object.defineProperty(Pe, "prototype", { value: Ln.prototype, writable: !1, enumerable: !1, configurable: !1 }), Pe.supportedLocalesOf = xn.supportedLocalesOf, mt(Pe, "Intl.DateTimeFormat");
|
|
2902
|
+
const { format: ss, formatToParts: cs } = Intl.DurationFormat?.prototype ?? /* @__PURE__ */ Object.create(null);
|
|
2903
|
+
function ti(t) {
|
|
2904
|
+
Intl.DurationFormat.prototype.resolvedOptions.call(this);
|
|
2905
|
+
const e = ei(Ze(t));
|
|
2906
|
+
return ss.call(this, e);
|
|
2907
|
+
}
|
|
2908
|
+
Intl.DurationFormat?.prototype && (Intl.DurationFormat.prototype.format = ti, Intl.DurationFormat.prototype.formatToParts = function(t) {
|
|
2909
|
+
Intl.DurationFormat.prototype.resolvedOptions.call(this);
|
|
2910
|
+
const e = ei(Ze(t));
|
|
2911
|
+
return cs.call(this, e);
|
|
2912
|
+
});
|
|
2913
|
+
class lo {
|
|
2914
|
+
constructor(e) {
|
|
2915
|
+
if (arguments.length < 1) throw new TypeError("missing argument: epochNanoseconds is required");
|
|
2916
|
+
Oa(this, ur(e));
|
|
2917
|
+
}
|
|
2918
|
+
get epochMilliseconds() {
|
|
2919
|
+
return g(this, X), Be(c(this, I), "floor");
|
|
2920
|
+
}
|
|
2921
|
+
get epochNanoseconds() {
|
|
2922
|
+
return g(this, X), qa(y.BigInt(c(this, I)));
|
|
2923
|
+
}
|
|
2924
|
+
add(e) {
|
|
2925
|
+
return g(this, X), qo("add", this, e);
|
|
2926
|
+
}
|
|
2927
|
+
subtract(e) {
|
|
2928
|
+
return g(this, X), qo("subtract", this, e);
|
|
2929
|
+
}
|
|
2930
|
+
until(e, n = void 0) {
|
|
2931
|
+
return g(this, X), Uo("until", this, e, n);
|
|
2932
|
+
}
|
|
2933
|
+
since(e, n = void 0) {
|
|
2934
|
+
return g(this, X), Uo("since", this, e, n);
|
|
2935
|
+
}
|
|
2936
|
+
round(e) {
|
|
2937
|
+
if (g(this, X), e === void 0) throw new TypeError("options parameter is required");
|
|
2938
|
+
const n = typeof e == "string" ? Nt("smallestUnit", e) : M(e), r = on(n), o = Ae(n, "halfExpand"), a = $e(n, "smallestUnit", "time", ut);
|
|
2939
|
+
return an(r, { hour: 24, minute: 1440, second: 86400, millisecond: 864e5, microsecond: 864e8, nanosecond: 864e11 }[a], !0), _e(_r(c(this, I), r, a, o));
|
|
2940
|
+
}
|
|
2941
|
+
equals(e) {
|
|
2942
|
+
g(this, X);
|
|
2943
|
+
const n = pn(e), r = c(this, I), o = c(n, I);
|
|
2944
|
+
return y.equal(y.BigInt(r), y.BigInt(o));
|
|
2945
|
+
}
|
|
2946
|
+
toString(e = void 0) {
|
|
2947
|
+
g(this, X);
|
|
2948
|
+
const n = M(e), r = Bn(n), o = Ae(n, "trunc"), a = $e(n, "smallestUnit", "time", void 0);
|
|
2949
|
+
if (a === "hour") throw new RangeError('smallestUnit must be a time unit other than "hour"');
|
|
2950
|
+
let i = n.timeZone;
|
|
2951
|
+
i !== void 0 && (i = ve(i));
|
|
2952
|
+
const { precision: s, unit: h, increment: d } = zn(a, r);
|
|
2953
|
+
return Oo(_e(_r(c(this, I), d, h, o)), i, s);
|
|
2954
|
+
}
|
|
2955
|
+
toJSON() {
|
|
2956
|
+
return g(this, X), Oo(this, void 0, "auto");
|
|
2957
|
+
}
|
|
2958
|
+
toLocaleString(e = void 0, n = void 0) {
|
|
2959
|
+
return g(this, X), new Pe(e, n).format(this);
|
|
2960
|
+
}
|
|
2961
|
+
valueOf() {
|
|
2962
|
+
Tt("Instant");
|
|
2963
|
+
}
|
|
2964
|
+
toZonedDateTimeISO(e) {
|
|
2965
|
+
g(this, X);
|
|
2966
|
+
const n = ve(e);
|
|
2967
|
+
return ne(c(this, I), n, "iso8601");
|
|
2968
|
+
}
|
|
2969
|
+
static fromEpochMilliseconds(e) {
|
|
2970
|
+
return _e(Ge(gr(e)));
|
|
2971
|
+
}
|
|
2972
|
+
static fromEpochNanoseconds(e) {
|
|
2973
|
+
return _e(ur(e));
|
|
2974
|
+
}
|
|
2975
|
+
static from(e) {
|
|
2976
|
+
return pn(e);
|
|
2977
|
+
}
|
|
2978
|
+
static compare(e, n) {
|
|
2979
|
+
const r = pn(e), o = pn(n), a = c(r, I), i = c(o, I);
|
|
2980
|
+
return y.lessThan(a, i) ? -1 : y.greaterThan(a, i) ? 1 : 0;
|
|
2981
|
+
}
|
|
2982
|
+
}
|
|
2983
|
+
mt(lo, "Temporal.Instant");
|
|
2984
|
+
class mo {
|
|
2985
|
+
constructor(e, n, r, o = "iso8601") {
|
|
2986
|
+
const a = $(e), i = $(n), s = $(r), h = Me(o === void 0 ? "iso8601" : _(o));
|
|
2987
|
+
Rt(a, i, s), Da(this, { year: a, month: i, day: s }, h);
|
|
2988
|
+
}
|
|
2989
|
+
get calendarId() {
|
|
2990
|
+
return g(this, B), c(this, b);
|
|
2991
|
+
}
|
|
2992
|
+
get era() {
|
|
2993
|
+
return ie(this, "era");
|
|
2994
|
+
}
|
|
2995
|
+
get eraYear() {
|
|
2996
|
+
return ie(this, "eraYear");
|
|
2997
|
+
}
|
|
2998
|
+
get year() {
|
|
2999
|
+
return ie(this, "year");
|
|
3000
|
+
}
|
|
3001
|
+
get month() {
|
|
3002
|
+
return ie(this, "month");
|
|
3003
|
+
}
|
|
3004
|
+
get monthCode() {
|
|
3005
|
+
return ie(this, "monthCode");
|
|
3006
|
+
}
|
|
3007
|
+
get day() {
|
|
3008
|
+
return ie(this, "day");
|
|
3009
|
+
}
|
|
3010
|
+
get dayOfWeek() {
|
|
3011
|
+
return ie(this, "dayOfWeek");
|
|
3012
|
+
}
|
|
3013
|
+
get dayOfYear() {
|
|
3014
|
+
return ie(this, "dayOfYear");
|
|
3015
|
+
}
|
|
3016
|
+
get weekOfYear() {
|
|
3017
|
+
return ie(this, "weekOfYear")?.week;
|
|
3018
|
+
}
|
|
3019
|
+
get yearOfWeek() {
|
|
3020
|
+
return ie(this, "weekOfYear")?.year;
|
|
3021
|
+
}
|
|
3022
|
+
get daysInWeek() {
|
|
3023
|
+
return ie(this, "daysInWeek");
|
|
3024
|
+
}
|
|
3025
|
+
get daysInMonth() {
|
|
3026
|
+
return ie(this, "daysInMonth");
|
|
3027
|
+
}
|
|
3028
|
+
get daysInYear() {
|
|
3029
|
+
return ie(this, "daysInYear");
|
|
3030
|
+
}
|
|
3031
|
+
get monthsInYear() {
|
|
3032
|
+
return ie(this, "monthsInYear");
|
|
3033
|
+
}
|
|
3034
|
+
get inLeapYear() {
|
|
3035
|
+
return ie(this, "inLeapYear");
|
|
3036
|
+
}
|
|
3037
|
+
with(e, n = void 0) {
|
|
3038
|
+
if (g(this, B), !A(e)) throw new TypeError("invalid argument");
|
|
3039
|
+
rn(e);
|
|
3040
|
+
const r = c(this, b);
|
|
3041
|
+
let o = be(r, c(this, C));
|
|
3042
|
+
return o = Yt(r, o, xe(r, e, ["year", "month", "monthCode", "day"], [], "partial")), we(Mt(r, o, N(M(n))), r);
|
|
3043
|
+
}
|
|
3044
|
+
withCalendar(e) {
|
|
3045
|
+
g(this, B);
|
|
3046
|
+
const n = Hn(e);
|
|
3047
|
+
return we(c(this, C), n);
|
|
3048
|
+
}
|
|
3049
|
+
add(e, n = void 0) {
|
|
3050
|
+
return g(this, B), Wo("add", this, e, n);
|
|
3051
|
+
}
|
|
3052
|
+
subtract(e, n = void 0) {
|
|
3053
|
+
return g(this, B), Wo("subtract", this, e, n);
|
|
3054
|
+
}
|
|
3055
|
+
until(e, n = void 0) {
|
|
3056
|
+
return g(this, B), Po("until", this, e, n);
|
|
3057
|
+
}
|
|
3058
|
+
since(e, n = void 0) {
|
|
3059
|
+
return g(this, B), Po("since", this, e, n);
|
|
3060
|
+
}
|
|
3061
|
+
equals(e) {
|
|
3062
|
+
g(this, B);
|
|
3063
|
+
const n = yn(e);
|
|
3064
|
+
return Qe(c(this, C), c(n, C)) === 0 && Ve(c(this, b), c(n, b));
|
|
3065
|
+
}
|
|
3066
|
+
toString(e = void 0) {
|
|
3067
|
+
return g(this, B), Yo(this, Fn(M(e)));
|
|
3068
|
+
}
|
|
3069
|
+
toJSON() {
|
|
3070
|
+
return g(this, B), Yo(this);
|
|
3071
|
+
}
|
|
3072
|
+
toLocaleString(e = void 0, n = void 0) {
|
|
3073
|
+
return g(this, B), new Pe(e, n).format(this);
|
|
3074
|
+
}
|
|
3075
|
+
valueOf() {
|
|
3076
|
+
Tt("PlainDate");
|
|
3077
|
+
}
|
|
3078
|
+
toPlainDateTime(e = void 0) {
|
|
3079
|
+
g(this, B);
|
|
3080
|
+
const n = Ma(e);
|
|
3081
|
+
return Le(j(c(this, C), n), c(this, b));
|
|
3082
|
+
}
|
|
3083
|
+
toZonedDateTime(e) {
|
|
3084
|
+
let n, r;
|
|
3085
|
+
if (g(this, B), A(e)) {
|
|
3086
|
+
const i = e.timeZone;
|
|
3087
|
+
i === void 0 ? n = ve(e) : (n = ve(i), r = e.plainTime);
|
|
3088
|
+
} else n = ve(e);
|
|
3089
|
+
const o = c(this, C);
|
|
3090
|
+
let a;
|
|
3091
|
+
return r === void 0 ? a = yt(n, o) : (r = pt(r), a = oe(n, j(o, c(r, z)), "compatible")), ne(a, n, c(this, b));
|
|
3092
|
+
}
|
|
3093
|
+
toPlainYearMonth() {
|
|
3094
|
+
g(this, B);
|
|
3095
|
+
const e = c(this, b);
|
|
3096
|
+
return _t(Rn(e, be(e, c(this, C)), "constrain"), e);
|
|
3097
|
+
}
|
|
3098
|
+
toPlainMonthDay() {
|
|
3099
|
+
g(this, B);
|
|
3100
|
+
const e = c(this, b);
|
|
3101
|
+
return Ht(ir(e, be(e, c(this, C)), "constrain"), e);
|
|
3102
|
+
}
|
|
3103
|
+
static from(e, n = void 0) {
|
|
3104
|
+
return yn(e, n);
|
|
3105
|
+
}
|
|
3106
|
+
static compare(e, n) {
|
|
3107
|
+
const r = yn(e), o = yn(n);
|
|
3108
|
+
return Qe(c(r, C), c(o, C));
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
function ie(t, e) {
|
|
3112
|
+
g(t, B);
|
|
3113
|
+
const n = c(t, C);
|
|
3114
|
+
return An(t).isoToDate(n, { [e]: !0 })[e];
|
|
3115
|
+
}
|
|
3116
|
+
mt(mo, "Temporal.PlainDate");
|
|
3117
|
+
class fo {
|
|
3118
|
+
constructor(e, n, r, o = 0, a = 0, i = 0, s = 0, h = 0, d = 0, u = "iso8601") {
|
|
3119
|
+
const l = $(e), m = $(n), f = $(r), p = o === void 0 ? 0 : $(o), v = a === void 0 ? 0 : $(a), w = i === void 0 ? 0 : $(i), E = s === void 0 ? 0 : $(s), T = h === void 0 ? 0 : $(h), D = d === void 0 ? 0 : $(d), Y = Me(u === void 0 ? "iso8601" : _(u));
|
|
3120
|
+
oo(l, m, f, p, v, w, E, T, D), Ta(this, { isoDate: { year: l, month: m, day: f }, time: { hour: p, minute: v, second: w, millisecond: E, microsecond: T, nanosecond: D } }, Y);
|
|
3121
|
+
}
|
|
3122
|
+
get calendarId() {
|
|
3123
|
+
return g(this, L), c(this, b);
|
|
3124
|
+
}
|
|
3125
|
+
get year() {
|
|
3126
|
+
return se(this, "year");
|
|
3127
|
+
}
|
|
3128
|
+
get month() {
|
|
3129
|
+
return se(this, "month");
|
|
3130
|
+
}
|
|
3131
|
+
get monthCode() {
|
|
3132
|
+
return se(this, "monthCode");
|
|
3133
|
+
}
|
|
3134
|
+
get day() {
|
|
3135
|
+
return se(this, "day");
|
|
3136
|
+
}
|
|
3137
|
+
get hour() {
|
|
3138
|
+
return Bt(this, "hour");
|
|
3139
|
+
}
|
|
3140
|
+
get minute() {
|
|
3141
|
+
return Bt(this, "minute");
|
|
3142
|
+
}
|
|
3143
|
+
get second() {
|
|
3144
|
+
return Bt(this, "second");
|
|
3145
|
+
}
|
|
3146
|
+
get millisecond() {
|
|
3147
|
+
return Bt(this, "millisecond");
|
|
3148
|
+
}
|
|
3149
|
+
get microsecond() {
|
|
3150
|
+
return Bt(this, "microsecond");
|
|
3151
|
+
}
|
|
3152
|
+
get nanosecond() {
|
|
3153
|
+
return Bt(this, "nanosecond");
|
|
3154
|
+
}
|
|
3155
|
+
get era() {
|
|
3156
|
+
return se(this, "era");
|
|
3157
|
+
}
|
|
3158
|
+
get eraYear() {
|
|
3159
|
+
return se(this, "eraYear");
|
|
3160
|
+
}
|
|
3161
|
+
get dayOfWeek() {
|
|
3162
|
+
return se(this, "dayOfWeek");
|
|
3163
|
+
}
|
|
3164
|
+
get dayOfYear() {
|
|
3165
|
+
return se(this, "dayOfYear");
|
|
3166
|
+
}
|
|
3167
|
+
get weekOfYear() {
|
|
3168
|
+
return se(this, "weekOfYear")?.week;
|
|
3169
|
+
}
|
|
3170
|
+
get yearOfWeek() {
|
|
3171
|
+
return se(this, "weekOfYear")?.year;
|
|
3172
|
+
}
|
|
3173
|
+
get daysInWeek() {
|
|
3174
|
+
return se(this, "daysInWeek");
|
|
3175
|
+
}
|
|
3176
|
+
get daysInYear() {
|
|
3177
|
+
return se(this, "daysInYear");
|
|
3178
|
+
}
|
|
3179
|
+
get daysInMonth() {
|
|
3180
|
+
return se(this, "daysInMonth");
|
|
3181
|
+
}
|
|
3182
|
+
get monthsInYear() {
|
|
3183
|
+
return se(this, "monthsInYear");
|
|
3184
|
+
}
|
|
3185
|
+
get inLeapYear() {
|
|
3186
|
+
return se(this, "inLeapYear");
|
|
3187
|
+
}
|
|
3188
|
+
with(e, n = void 0) {
|
|
3189
|
+
if (g(this, L), !A(e)) throw new TypeError("invalid argument");
|
|
3190
|
+
rn(e);
|
|
3191
|
+
const r = c(this, b), o = c(this, P);
|
|
3192
|
+
let a = { ...be(r, o.isoDate), ...o.time };
|
|
3193
|
+
return a = Yt(r, a, xe(r, e, ["year", "month", "monthCode", "day"], ["hour", "minute", "second", "millisecond", "microsecond", "nanosecond"], "partial")), Le(qn(r, a, N(M(n))), r);
|
|
3194
|
+
}
|
|
3195
|
+
withPlainTime(e = void 0) {
|
|
3196
|
+
g(this, L);
|
|
3197
|
+
const n = Ma(e);
|
|
3198
|
+
return Le(j(c(this, P).isoDate, n), c(this, b));
|
|
3199
|
+
}
|
|
3200
|
+
withCalendar(e) {
|
|
3201
|
+
g(this, L);
|
|
3202
|
+
const n = Hn(e);
|
|
3203
|
+
return Le(c(this, P), n);
|
|
3204
|
+
}
|
|
3205
|
+
add(e, n = void 0) {
|
|
3206
|
+
return g(this, L), Ho("add", this, e, n);
|
|
3207
|
+
}
|
|
3208
|
+
subtract(e, n = void 0) {
|
|
3209
|
+
return g(this, L), Ho("subtract", this, e, n);
|
|
3210
|
+
}
|
|
3211
|
+
until(e, n = void 0) {
|
|
3212
|
+
return g(this, L), Zo("until", this, e, n);
|
|
3213
|
+
}
|
|
3214
|
+
since(e, n = void 0) {
|
|
3215
|
+
return g(this, L), Zo("since", this, e, n);
|
|
3216
|
+
}
|
|
3217
|
+
round(e) {
|
|
3218
|
+
if (g(this, L), e === void 0) throw new TypeError("options parameter is required");
|
|
3219
|
+
const n = typeof e == "string" ? Nt("smallestUnit", e) : M(e), r = on(n), o = Ae(n, "halfExpand"), a = $e(n, "smallestUnit", "time", ut, ["day"]), i = { day: 1, hour: 24, minute: 60, second: 60, millisecond: 1e3, microsecond: 1e3, nanosecond: 1e3 }[a];
|
|
3220
|
+
an(r, i, i === 1);
|
|
3221
|
+
const s = c(this, P);
|
|
3222
|
+
return Le(r === 1 && a === "nanosecond" ? s : Jr(s, r, a, o), c(this, b));
|
|
3223
|
+
}
|
|
3224
|
+
equals(e) {
|
|
3225
|
+
g(this, L);
|
|
3226
|
+
const n = gn(e);
|
|
3227
|
+
return en(c(this, P), c(n, P)) === 0 && Ve(c(this, b), c(n, b));
|
|
3228
|
+
}
|
|
3229
|
+
toString(e = void 0) {
|
|
3230
|
+
g(this, L);
|
|
3231
|
+
const n = M(e), r = Fn(n), o = Bn(n), a = Ae(n, "trunc"), i = $e(n, "smallestUnit", "time", void 0);
|
|
3232
|
+
if (i === "hour") throw new RangeError('smallestUnit must be a time unit other than "hour"');
|
|
3233
|
+
const { precision: s, unit: h, increment: d } = zn(i, o), u = Jr(c(this, P), d, h, a);
|
|
3234
|
+
return St(u), kn(u, c(this, b), s, r);
|
|
3235
|
+
}
|
|
3236
|
+
toJSON() {
|
|
3237
|
+
return g(this, L), kn(c(this, P), c(this, b), "auto");
|
|
3238
|
+
}
|
|
3239
|
+
toLocaleString(e = void 0, n = void 0) {
|
|
3240
|
+
return g(this, L), new Pe(e, n).format(this);
|
|
3241
|
+
}
|
|
3242
|
+
valueOf() {
|
|
3243
|
+
Tt("PlainDateTime");
|
|
3244
|
+
}
|
|
3245
|
+
toZonedDateTime(e, n = void 0) {
|
|
3246
|
+
g(this, L);
|
|
3247
|
+
const r = ve(e), o = In(M(n));
|
|
3248
|
+
return ne(oe(r, c(this, P), o), r, c(this, b));
|
|
3249
|
+
}
|
|
3250
|
+
toPlainDate() {
|
|
3251
|
+
return g(this, L), we(c(this, P).isoDate, c(this, b));
|
|
3252
|
+
}
|
|
3253
|
+
toPlainTime() {
|
|
3254
|
+
return g(this, L), at(c(this, P).time);
|
|
3255
|
+
}
|
|
3256
|
+
static from(e, n = void 0) {
|
|
3257
|
+
return gn(e, n);
|
|
3258
|
+
}
|
|
3259
|
+
static compare(e, n) {
|
|
3260
|
+
const r = gn(e), o = gn(n);
|
|
3261
|
+
return en(c(r, P), c(o, P));
|
|
3262
|
+
}
|
|
3263
|
+
}
|
|
3264
|
+
function se(t, e) {
|
|
3265
|
+
g(t, L);
|
|
3266
|
+
const n = c(t, P).isoDate;
|
|
3267
|
+
return An(t).isoToDate(n, { [e]: !0 })[e];
|
|
3268
|
+
}
|
|
3269
|
+
function Bt(t, e) {
|
|
3270
|
+
return g(t, L), c(t, P).time[e];
|
|
3271
|
+
}
|
|
3272
|
+
mt(fo, "Temporal.PlainDateTime");
|
|
3273
|
+
class nn {
|
|
3274
|
+
constructor(e = 0, n = 0, r = 0, o = 0, a = 0, i = 0, s = 0, h = 0, d = 0, u = 0) {
|
|
3275
|
+
const l = e === void 0 ? 0 : ze(e), m = n === void 0 ? 0 : ze(n), f = r === void 0 ? 0 : ze(r), p = o === void 0 ? 0 : ze(o), v = a === void 0 ? 0 : ze(a), w = i === void 0 ? 0 : ze(i), E = s === void 0 ? 0 : ze(s), T = h === void 0 ? 0 : ze(h), D = d === void 0 ? 0 : ze(d), Y = u === void 0 ? 0 : ze(u);
|
|
3276
|
+
Dr(l, m, f, p, v, w, E, T, D, Y), lt(this), R(this, de, l), R(this, he, m), R(this, Te, f), R(this, ue, p), R(this, le, v), R(this, me, w), R(this, fe, E), R(this, ye, T), R(this, ge, D), R(this, Ie, Y);
|
|
3277
|
+
}
|
|
3278
|
+
get years() {
|
|
3279
|
+
return g(this, F), c(this, de);
|
|
3280
|
+
}
|
|
3281
|
+
get months() {
|
|
3282
|
+
return g(this, F), c(this, he);
|
|
3283
|
+
}
|
|
3284
|
+
get weeks() {
|
|
3285
|
+
return g(this, F), c(this, Te);
|
|
3286
|
+
}
|
|
3287
|
+
get days() {
|
|
3288
|
+
return g(this, F), c(this, ue);
|
|
3289
|
+
}
|
|
3290
|
+
get hours() {
|
|
3291
|
+
return g(this, F), c(this, le);
|
|
3292
|
+
}
|
|
3293
|
+
get minutes() {
|
|
3294
|
+
return g(this, F), c(this, me);
|
|
3295
|
+
}
|
|
3296
|
+
get seconds() {
|
|
3297
|
+
return g(this, F), c(this, fe);
|
|
3298
|
+
}
|
|
3299
|
+
get milliseconds() {
|
|
3300
|
+
return g(this, F), c(this, ye);
|
|
3301
|
+
}
|
|
3302
|
+
get microseconds() {
|
|
3303
|
+
return g(this, F), c(this, ge);
|
|
3304
|
+
}
|
|
3305
|
+
get nanoseconds() {
|
|
3306
|
+
return g(this, F), c(this, Ie);
|
|
3307
|
+
}
|
|
3308
|
+
get sign() {
|
|
3309
|
+
return g(this, F), dr(this);
|
|
3310
|
+
}
|
|
3311
|
+
get blank() {
|
|
3312
|
+
return g(this, F), dr(this) === 0;
|
|
3313
|
+
}
|
|
3314
|
+
with(e) {
|
|
3315
|
+
g(this, F);
|
|
3316
|
+
const n = Ea(e), { years: r = c(this, de), months: o = c(this, he), weeks: a = c(this, Te), days: i = c(this, ue), hours: s = c(this, le), minutes: h = c(this, me), seconds: d = c(this, fe), milliseconds: u = c(this, ye), microseconds: l = c(this, ge), nanoseconds: m = c(this, Ie) } = n;
|
|
3317
|
+
return new nn(r, o, a, i, s, h, d, u, l, m);
|
|
3318
|
+
}
|
|
3319
|
+
negated() {
|
|
3320
|
+
return g(this, F), Ye(this);
|
|
3321
|
+
}
|
|
3322
|
+
abs() {
|
|
3323
|
+
return g(this, F), new nn(Math.abs(c(this, de)), Math.abs(c(this, he)), Math.abs(c(this, Te)), Math.abs(c(this, ue)), Math.abs(c(this, le)), Math.abs(c(this, me)), Math.abs(c(this, fe)), Math.abs(c(this, ye)), Math.abs(c(this, ge)), Math.abs(c(this, Ie)));
|
|
3324
|
+
}
|
|
3325
|
+
add(e) {
|
|
3326
|
+
return g(this, F), Ao("add", this, e);
|
|
3327
|
+
}
|
|
3328
|
+
subtract(e) {
|
|
3329
|
+
return g(this, F), Ao("subtract", this, e);
|
|
3330
|
+
}
|
|
3331
|
+
round(e) {
|
|
3332
|
+
if (g(this, F), e === void 0) throw new TypeError("options parameter is required");
|
|
3333
|
+
const n = rt(this), r = typeof e == "string" ? Nt("smallestUnit", e) : M(e);
|
|
3334
|
+
let o = $e(r, "largestUnit", "datetime", void 0, ["auto"]), { plainRelativeTo: a, zonedRelativeTo: i } = Yr(r);
|
|
3335
|
+
const s = on(r), h = Ae(r, "halfExpand");
|
|
3336
|
+
let d = $e(r, "smallestUnit", "datetime", void 0), u = !0;
|
|
3337
|
+
d || (u = !1, d = "nanosecond");
|
|
3338
|
+
const l = st(n, d);
|
|
3339
|
+
let m = !0;
|
|
3340
|
+
if (o || (m = !1, o = l), o === "auto" && (o = l), !u && !m) throw new RangeError("at least one of smallestUnit or largestUnit is required");
|
|
3341
|
+
if (st(o, d) !== o) throw new RangeError(`largestUnit ${o} cannot be smaller than smallestUnit ${d}`);
|
|
3342
|
+
const f = { hour: 24, minute: 60, second: 60, millisecond: 1e3, microsecond: 1e3, nanosecond: 1e3 }[d];
|
|
3343
|
+
if (f !== void 0 && an(s, f, !1), s > 1 && ot(d) === "date" && o !== d) throw new RangeError("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit");
|
|
3344
|
+
if (i) {
|
|
3345
|
+
let v = qt(this);
|
|
3346
|
+
const w = c(i, x), E = c(i, b), T = c(i, I);
|
|
3347
|
+
return v = Aa(T, bn(T, w, E, v), w, E, o, s, d, h), ot(o) === "date" && (o = "hour"), Ue(v, o);
|
|
3348
|
+
}
|
|
3349
|
+
if (a) {
|
|
3350
|
+
let v = Je(this);
|
|
3351
|
+
const w = Qt({ hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 }, v.time), E = c(a, C), T = c(a, b), D = Ne(T, E, re(v.date, w.deltaDays), "constrain");
|
|
3352
|
+
return v = za(j(E, { deltaDays: 0, hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 }), j(D, w), T, o, s, d, h), Ue(v, o);
|
|
3353
|
+
}
|
|
3354
|
+
if (We(n)) throw new RangeError(`a starting point is required for ${n}s balancing`);
|
|
3355
|
+
if (We(o)) throw new RangeError(`a starting point is required for ${o}s balancing`);
|
|
3356
|
+
let p = Je(this);
|
|
3357
|
+
if (d === "day") {
|
|
3358
|
+
const { quotient: v, remainder: w } = p.time.divmod(rr);
|
|
3359
|
+
let E = p.date.days + v + Cn(w, "day");
|
|
3360
|
+
E = wt(E, s, h), p = ct({ years: 0, months: 0, weeks: 0, days: E }, k.ZERO);
|
|
3361
|
+
} else p = ct({ years: 0, months: 0, weeks: 0, days: 0 }, hr(p.time, s, d, h));
|
|
3362
|
+
return Ue(p, o);
|
|
3363
|
+
}
|
|
3364
|
+
total(e) {
|
|
3365
|
+
if (g(this, F), e === void 0) throw new TypeError("options argument is required");
|
|
3366
|
+
const n = typeof e == "string" ? Nt("unit", e) : M(e);
|
|
3367
|
+
let { plainRelativeTo: r, zonedRelativeTo: o } = Yr(n);
|
|
3368
|
+
const a = $e(n, "unit", "datetime", ut);
|
|
3369
|
+
if (o) {
|
|
3370
|
+
const s = qt(this), h = c(o, x), d = c(o, b), u = c(o, I);
|
|
3371
|
+
return (function(l, m, f, p, v) {
|
|
3372
|
+
return ot(v) === "time" ? Cn(k.fromEpochNsDiff(m, l), v) : Lo(Fa(l, m, f, p, v), m, Fe(f, l), f, p, v);
|
|
3373
|
+
})(u, bn(u, h, d, s), h, d, a);
|
|
3374
|
+
}
|
|
3375
|
+
if (r) {
|
|
3376
|
+
const s = Je(this);
|
|
3377
|
+
let h = Qt({ hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 }, s.time);
|
|
3378
|
+
const d = c(r, C), u = c(r, b), l = Ne(u, d, re(s.date, h.deltaDays), "constrain");
|
|
3379
|
+
return (function(m, f, p, v) {
|
|
3380
|
+
if (en(m, f) == 0) return 0;
|
|
3381
|
+
St(m), St(f);
|
|
3382
|
+
const w = Za(m, f, p, v);
|
|
3383
|
+
return v === "nanosecond" ? y.toNumber(w.time.totalNs) : Lo(w, ee(f), m, null, p, v);
|
|
3384
|
+
})(j(d, { deltaDays: 0, hour: 0, minute: 0, second: 0, millisecond: 0, microsecond: 0, nanosecond: 0 }), j(l, h), u, a);
|
|
3385
|
+
}
|
|
3386
|
+
const i = rt(this);
|
|
3387
|
+
if (We(i)) throw new RangeError(`a starting point is required for ${i}s total`);
|
|
3388
|
+
if (We(a)) throw new RangeError(`a starting point is required for ${a}s total`);
|
|
3389
|
+
return Cn(Je(this).time, a);
|
|
3390
|
+
}
|
|
3391
|
+
toString(e = void 0) {
|
|
3392
|
+
g(this, F);
|
|
3393
|
+
const n = M(e), r = Bn(n), o = Ae(n, "trunc"), a = $e(n, "smallestUnit", "time", void 0);
|
|
3394
|
+
if (a === "hour" || a === "minute") throw new RangeError('smallestUnit must be a time unit other than "hours" or "minutes"');
|
|
3395
|
+
const { precision: i, unit: s, increment: h } = zn(a, r);
|
|
3396
|
+
if (s === "nanosecond" && h === 1) return Qn(this, i);
|
|
3397
|
+
const d = rt(this);
|
|
3398
|
+
let u = qt(this);
|
|
3399
|
+
const l = hr(u.time, h, s, o);
|
|
3400
|
+
return u = ct(u.date, l), Qn(Ue(u, st(d, "second")), i);
|
|
3401
|
+
}
|
|
3402
|
+
toJSON() {
|
|
3403
|
+
return g(this, F), Qn(this, "auto");
|
|
3404
|
+
}
|
|
3405
|
+
toLocaleString(e = void 0, n = void 0) {
|
|
3406
|
+
if (g(this, F), typeof Intl.DurationFormat == "function") {
|
|
3407
|
+
const r = new Intl.DurationFormat(e, n);
|
|
3408
|
+
return ti.call(r, this);
|
|
3409
|
+
}
|
|
3410
|
+
return console.warn("Temporal.Duration.prototype.toLocaleString() requires Intl.DurationFormat."), Qn(this, "auto");
|
|
3411
|
+
}
|
|
3412
|
+
valueOf() {
|
|
3413
|
+
Tt("Duration");
|
|
3414
|
+
}
|
|
3415
|
+
static from(e) {
|
|
3416
|
+
return Ze(e);
|
|
3417
|
+
}
|
|
3418
|
+
static compare(e, n, r = void 0) {
|
|
3419
|
+
const o = Ze(e), a = Ze(n), i = M(r), { plainRelativeTo: s, zonedRelativeTo: h } = Yr(i);
|
|
3420
|
+
if (c(o, de) === c(a, de) && c(o, he) === c(a, he) && c(o, Te) === c(a, Te) && c(o, ue) === c(a, ue) && c(o, le) === c(a, le) && c(o, me) === c(a, me) && c(o, fe) === c(a, fe) && c(o, ye) === c(a, ye) && c(o, ge) === c(a, ge) && c(o, Ie) === c(a, Ie)) return 0;
|
|
3421
|
+
const d = rt(o), u = rt(a), l = qt(o), m = qt(a);
|
|
3422
|
+
if (h && (ot(d) === "date" || ot(u) === "date")) {
|
|
3423
|
+
const E = c(h, x), T = c(h, b), D = c(h, I), Y = bn(D, E, T, l), O = bn(D, E, T, m);
|
|
3424
|
+
return Ce(y.toNumber(y.subtract(Y, O)));
|
|
3425
|
+
}
|
|
3426
|
+
let f = l.date.days, p = m.date.days;
|
|
3427
|
+
if (We(d) || We(u)) {
|
|
3428
|
+
if (!s) throw new RangeError("A starting point is required for years, months, or weeks comparison");
|
|
3429
|
+
f = xo(l.date, s), p = xo(m.date, s);
|
|
3430
|
+
}
|
|
3431
|
+
const v = l.time.add24HourDays(f), w = m.time.add24HourDays(p);
|
|
3432
|
+
return v.cmp(w);
|
|
3433
|
+
}
|
|
3434
|
+
}
|
|
3435
|
+
mt(nn, "Temporal.Duration");
|
|
3436
|
+
class yo {
|
|
3437
|
+
constructor(e, n, r = "iso8601", o = 1972) {
|
|
3438
|
+
const a = $(e), i = $(n), s = Me(r === void 0 ? "iso8601" : _(r)), h = $(o);
|
|
3439
|
+
Rt(h, a, i), Ia(this, { year: h, month: a, day: i }, s);
|
|
3440
|
+
}
|
|
3441
|
+
get monthCode() {
|
|
3442
|
+
return Vo(this, "monthCode");
|
|
3443
|
+
}
|
|
3444
|
+
get day() {
|
|
3445
|
+
return Vo(this, "day");
|
|
3446
|
+
}
|
|
3447
|
+
get calendarId() {
|
|
3448
|
+
return g(this, Se), c(this, b);
|
|
3449
|
+
}
|
|
3450
|
+
with(e, n = void 0) {
|
|
3451
|
+
if (g(this, Se), !A(e)) throw new TypeError("invalid argument");
|
|
3452
|
+
rn(e);
|
|
3453
|
+
const r = c(this, b);
|
|
3454
|
+
let o = be(r, c(this, C), "month-day");
|
|
3455
|
+
return o = Yt(r, o, xe(r, e, ["year", "month", "monthCode", "day"], [], "partial")), Ht(ir(r, o, N(M(n))), r);
|
|
3456
|
+
}
|
|
3457
|
+
equals(e) {
|
|
3458
|
+
g(this, Se);
|
|
3459
|
+
const n = Co(e);
|
|
3460
|
+
return Qe(c(this, C), c(n, C)) === 0 && Ve(c(this, b), c(n, b));
|
|
3461
|
+
}
|
|
3462
|
+
toString(e = void 0) {
|
|
3463
|
+
return g(this, Se), So(this, Fn(M(e)));
|
|
3464
|
+
}
|
|
3465
|
+
toJSON() {
|
|
3466
|
+
return g(this, Se), So(this);
|
|
3467
|
+
}
|
|
3468
|
+
toLocaleString(e = void 0, n = void 0) {
|
|
3469
|
+
return g(this, Se), new Pe(e, n).format(this);
|
|
3470
|
+
}
|
|
3471
|
+
valueOf() {
|
|
3472
|
+
Tt("PlainMonthDay");
|
|
3473
|
+
}
|
|
3474
|
+
toPlainDate(e) {
|
|
3475
|
+
if (g(this, Se), !A(e)) throw new TypeError("argument should be an object");
|
|
3476
|
+
const n = c(this, b);
|
|
3477
|
+
return we(Mt(n, Yt(n, be(n, c(this, C), "month-day"), xe(n, e, ["year"], [], [])), "constrain"), n);
|
|
3478
|
+
}
|
|
3479
|
+
static from(e, n = void 0) {
|
|
3480
|
+
return Co(e, n);
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
function Vo(t, e) {
|
|
3484
|
+
g(t, Se);
|
|
3485
|
+
const n = c(t, C);
|
|
3486
|
+
return An(t).isoToDate(n, { [e]: !0 })[e];
|
|
3487
|
+
}
|
|
3488
|
+
function Sr(t) {
|
|
3489
|
+
return Fe(t, Vr());
|
|
3490
|
+
}
|
|
3491
|
+
mt(yo, "Temporal.PlainMonthDay");
|
|
3492
|
+
const ni = { instant: () => _e(Vr()), plainDateTimeISO: (t = un()) => Le(Sr(ve(t)), "iso8601"), plainDateISO: (t = un()) => we(Sr(ve(t)).isoDate, "iso8601"), plainTimeISO: (t = un()) => at(Sr(ve(t)).time), timeZoneId: () => un(), zonedDateTimeISO: (t = un()) => {
|
|
3493
|
+
const e = ve(t);
|
|
3494
|
+
return ne(Vr(), e, "iso8601");
|
|
3495
|
+
}, [Symbol.toStringTag]: "Temporal.Now" };
|
|
3496
|
+
Object.defineProperty(ni, Symbol.toStringTag, { value: "Temporal.Now", writable: !1, enumerable: !1, configurable: !0 });
|
|
3497
|
+
class Xn {
|
|
3498
|
+
constructor(e = 0, n = 0, r = 0, o = 0, a = 0, i = 0) {
|
|
3499
|
+
const s = e === void 0 ? 0 : $(e), h = n === void 0 ? 0 : $(n), d = r === void 0 ? 0 : $(r), u = o === void 0 ? 0 : $(o), l = a === void 0 ? 0 : $(a), m = i === void 0 ? 0 : $(i);
|
|
3500
|
+
Mr(s, h, d, u, l, m), Ca(this, { hour: s, minute: h, second: d, millisecond: u, microsecond: l, nanosecond: m });
|
|
3501
|
+
}
|
|
3502
|
+
get hour() {
|
|
3503
|
+
return g(this, q), c(this, z).hour;
|
|
3504
|
+
}
|
|
3505
|
+
get minute() {
|
|
3506
|
+
return g(this, q), c(this, z).minute;
|
|
3507
|
+
}
|
|
3508
|
+
get second() {
|
|
3509
|
+
return g(this, q), c(this, z).second;
|
|
3510
|
+
}
|
|
3511
|
+
get millisecond() {
|
|
3512
|
+
return g(this, q), c(this, z).millisecond;
|
|
3513
|
+
}
|
|
3514
|
+
get microsecond() {
|
|
3515
|
+
return g(this, q), c(this, z).microsecond;
|
|
3516
|
+
}
|
|
3517
|
+
get nanosecond() {
|
|
3518
|
+
return g(this, q), c(this, z).nanosecond;
|
|
3519
|
+
}
|
|
3520
|
+
with(e, n = void 0) {
|
|
3521
|
+
if (g(this, q), !A(e)) throw new TypeError("invalid argument");
|
|
3522
|
+
rn(e);
|
|
3523
|
+
const r = Br(e, "partial"), o = Br(this);
|
|
3524
|
+
let { hour: a, minute: i, second: s, millisecond: h, microsecond: d, nanosecond: u } = Object.assign(o, r);
|
|
3525
|
+
const l = N(M(n));
|
|
3526
|
+
return { hour: a, minute: i, second: s, millisecond: h, microsecond: d, nanosecond: u } = vr(a, i, s, h, d, u, l), new Xn(a, i, s, h, d, u);
|
|
3527
|
+
}
|
|
3528
|
+
add(e) {
|
|
3529
|
+
return g(this, q), _o("add", this, e);
|
|
3530
|
+
}
|
|
3531
|
+
subtract(e) {
|
|
3532
|
+
return g(this, q), _o("subtract", this, e);
|
|
3533
|
+
}
|
|
3534
|
+
until(e, n = void 0) {
|
|
3535
|
+
return g(this, q), Fo("until", this, e, n);
|
|
3536
|
+
}
|
|
3537
|
+
since(e, n = void 0) {
|
|
3538
|
+
return g(this, q), Fo("since", this, e, n);
|
|
3539
|
+
}
|
|
3540
|
+
round(e) {
|
|
3541
|
+
if (g(this, q), e === void 0) throw new TypeError("options parameter is required");
|
|
3542
|
+
const n = typeof e == "string" ? Nt("smallestUnit", e) : M(e), r = on(n), o = Ae(n, "halfExpand"), a = $e(n, "smallestUnit", "time", ut);
|
|
3543
|
+
return an(r, { hour: 24, minute: 60, second: 60, millisecond: 1e3, microsecond: 1e3, nanosecond: 1e3 }[a], !1), at(Gr(c(this, z), r, a, o));
|
|
3544
|
+
}
|
|
3545
|
+
equals(e) {
|
|
3546
|
+
g(this, q);
|
|
3547
|
+
const n = pt(e);
|
|
3548
|
+
return Kr(c(this, z), c(n, z)) === 0;
|
|
3549
|
+
}
|
|
3550
|
+
toString(e = void 0) {
|
|
3551
|
+
g(this, q);
|
|
3552
|
+
const n = M(e), r = Bn(n), o = Ae(n, "trunc"), a = $e(n, "smallestUnit", "time", void 0);
|
|
3553
|
+
if (a === "hour") throw new RangeError('smallestUnit must be a time unit other than "hour"');
|
|
3554
|
+
const { precision: i, unit: s, increment: h } = zn(a, r);
|
|
3555
|
+
return Ro(Gr(c(this, z), h, s, o), i);
|
|
3556
|
+
}
|
|
3557
|
+
toJSON() {
|
|
3558
|
+
return g(this, q), Ro(c(this, z), "auto");
|
|
3559
|
+
}
|
|
3560
|
+
toLocaleString(e = void 0, n = void 0) {
|
|
3561
|
+
return g(this, q), new Pe(e, n).format(this);
|
|
3562
|
+
}
|
|
3563
|
+
valueOf() {
|
|
3564
|
+
Tt("PlainTime");
|
|
3565
|
+
}
|
|
3566
|
+
static from(e, n = void 0) {
|
|
3567
|
+
return pt(e, n);
|
|
3568
|
+
}
|
|
3569
|
+
static compare(e, n) {
|
|
3570
|
+
const r = pt(e), o = pt(n);
|
|
3571
|
+
return Kr(c(r, z), c(o, z));
|
|
3572
|
+
}
|
|
3573
|
+
}
|
|
3574
|
+
mt(Xn, "Temporal.PlainTime");
|
|
3575
|
+
class go {
|
|
3576
|
+
constructor(e, n, r = "iso8601", o = 1) {
|
|
3577
|
+
const a = $(e), i = $(n), s = Me(r === void 0 ? "iso8601" : _(r)), h = $(o);
|
|
3578
|
+
Rt(a, i, h), $a(this, { year: a, month: i, day: h }, s);
|
|
3579
|
+
}
|
|
3580
|
+
get year() {
|
|
3581
|
+
return tt(this, "year");
|
|
3582
|
+
}
|
|
3583
|
+
get month() {
|
|
3584
|
+
return tt(this, "month");
|
|
3585
|
+
}
|
|
3586
|
+
get monthCode() {
|
|
3587
|
+
return tt(this, "monthCode");
|
|
3588
|
+
}
|
|
3589
|
+
get calendarId() {
|
|
3590
|
+
return g(this, Q), c(this, b);
|
|
3591
|
+
}
|
|
3592
|
+
get era() {
|
|
3593
|
+
return tt(this, "era");
|
|
3594
|
+
}
|
|
3595
|
+
get eraYear() {
|
|
3596
|
+
return tt(this, "eraYear");
|
|
3597
|
+
}
|
|
3598
|
+
get daysInMonth() {
|
|
3599
|
+
return tt(this, "daysInMonth");
|
|
3600
|
+
}
|
|
3601
|
+
get daysInYear() {
|
|
3602
|
+
return tt(this, "daysInYear");
|
|
3603
|
+
}
|
|
3604
|
+
get monthsInYear() {
|
|
3605
|
+
return tt(this, "monthsInYear");
|
|
3606
|
+
}
|
|
3607
|
+
get inLeapYear() {
|
|
3608
|
+
return tt(this, "inLeapYear");
|
|
3609
|
+
}
|
|
3610
|
+
with(e, n = void 0) {
|
|
3611
|
+
if (g(this, Q), !A(e)) throw new TypeError("invalid argument");
|
|
3612
|
+
rn(e);
|
|
3613
|
+
const r = c(this, b);
|
|
3614
|
+
let o = be(r, c(this, C), "year-month");
|
|
3615
|
+
return o = Yt(r, o, xe(r, e, ["year", "month", "monthCode"], [], "partial")), _t(Rn(r, o, N(M(n))), r);
|
|
3616
|
+
}
|
|
3617
|
+
add(e, n = void 0) {
|
|
3618
|
+
return g(this, Q), Jo("add", this, e, n);
|
|
3619
|
+
}
|
|
3620
|
+
subtract(e, n = void 0) {
|
|
3621
|
+
return g(this, Q), Jo("subtract", this, e, n);
|
|
3622
|
+
}
|
|
3623
|
+
until(e, n = void 0) {
|
|
3624
|
+
return g(this, Q), Bo("until", this, e, n);
|
|
3625
|
+
}
|
|
3626
|
+
since(e, n = void 0) {
|
|
3627
|
+
return g(this, Q), Bo("since", this, e, n);
|
|
3628
|
+
}
|
|
3629
|
+
equals(e) {
|
|
3630
|
+
g(this, Q);
|
|
3631
|
+
const n = wn(e);
|
|
3632
|
+
return Qe(c(this, C), c(n, C)) === 0 && Ve(c(this, b), c(n, b));
|
|
3633
|
+
}
|
|
3634
|
+
toString(e = void 0) {
|
|
3635
|
+
return g(this, Q), ko(this, Fn(M(e)));
|
|
3636
|
+
}
|
|
3637
|
+
toJSON() {
|
|
3638
|
+
return g(this, Q), ko(this);
|
|
3639
|
+
}
|
|
3640
|
+
toLocaleString(e = void 0, n = void 0) {
|
|
3641
|
+
return g(this, Q), new Pe(e, n).format(this);
|
|
3642
|
+
}
|
|
3643
|
+
valueOf() {
|
|
3644
|
+
Tt("PlainYearMonth");
|
|
3645
|
+
}
|
|
3646
|
+
toPlainDate(e) {
|
|
3647
|
+
if (g(this, Q), !A(e)) throw new TypeError("argument should be an object");
|
|
3648
|
+
const n = c(this, b);
|
|
3649
|
+
return we(Mt(n, Yt(n, be(n, c(this, C), "year-month"), xe(n, e, ["day"], [], [])), "constrain"), n);
|
|
3650
|
+
}
|
|
3651
|
+
static from(e, n = void 0) {
|
|
3652
|
+
return wn(e, n);
|
|
3653
|
+
}
|
|
3654
|
+
static compare(e, n) {
|
|
3655
|
+
const r = wn(e), o = wn(n);
|
|
3656
|
+
return Qe(c(r, C), c(o, C));
|
|
3657
|
+
}
|
|
3658
|
+
}
|
|
3659
|
+
function tt(t, e) {
|
|
3660
|
+
g(t, Q);
|
|
3661
|
+
const n = c(t, C);
|
|
3662
|
+
return An(t).isoToDate(n, { [e]: !0 })[e];
|
|
3663
|
+
}
|
|
3664
|
+
mt(go, "Temporal.PlainYearMonth");
|
|
3665
|
+
const ds = Pe.prototype.resolvedOptions;
|
|
3666
|
+
class po {
|
|
3667
|
+
constructor(e, n, r = "iso8601") {
|
|
3668
|
+
if (arguments.length < 1) throw new TypeError("missing argument: epochNanoseconds is required");
|
|
3669
|
+
const o = ur(e);
|
|
3670
|
+
let a = _(n);
|
|
3671
|
+
const { tzName: i, offsetMinutes: s } = vt(a);
|
|
3672
|
+
if (s === void 0) {
|
|
3673
|
+
const h = sr(i);
|
|
3674
|
+
if (!h) throw new RangeError(`unknown time zone ${i}`);
|
|
3675
|
+
a = h.identifier;
|
|
3676
|
+
} else a = to(s);
|
|
3677
|
+
Ya(this, o, a, Me(r === void 0 ? "iso8601" : _(r)));
|
|
3678
|
+
}
|
|
3679
|
+
get calendarId() {
|
|
3680
|
+
return g(this, S), c(this, b);
|
|
3681
|
+
}
|
|
3682
|
+
get timeZoneId() {
|
|
3683
|
+
return g(this, S), c(this, x);
|
|
3684
|
+
}
|
|
3685
|
+
get year() {
|
|
3686
|
+
return ce(this, "year");
|
|
3687
|
+
}
|
|
3688
|
+
get month() {
|
|
3689
|
+
return ce(this, "month");
|
|
3690
|
+
}
|
|
3691
|
+
get monthCode() {
|
|
3692
|
+
return ce(this, "monthCode");
|
|
3693
|
+
}
|
|
3694
|
+
get day() {
|
|
3695
|
+
return ce(this, "day");
|
|
3696
|
+
}
|
|
3697
|
+
get hour() {
|
|
3698
|
+
return zt(this, "hour");
|
|
3699
|
+
}
|
|
3700
|
+
get minute() {
|
|
3701
|
+
return zt(this, "minute");
|
|
3702
|
+
}
|
|
3703
|
+
get second() {
|
|
3704
|
+
return zt(this, "second");
|
|
3705
|
+
}
|
|
3706
|
+
get millisecond() {
|
|
3707
|
+
return zt(this, "millisecond");
|
|
3708
|
+
}
|
|
3709
|
+
get microsecond() {
|
|
3710
|
+
return zt(this, "microsecond");
|
|
3711
|
+
}
|
|
3712
|
+
get nanosecond() {
|
|
3713
|
+
return zt(this, "nanosecond");
|
|
3714
|
+
}
|
|
3715
|
+
get era() {
|
|
3716
|
+
return ce(this, "era");
|
|
3717
|
+
}
|
|
3718
|
+
get eraYear() {
|
|
3719
|
+
return ce(this, "eraYear");
|
|
3720
|
+
}
|
|
3721
|
+
get epochMilliseconds() {
|
|
3722
|
+
return g(this, S), Be(c(this, I), "floor");
|
|
3723
|
+
}
|
|
3724
|
+
get epochNanoseconds() {
|
|
3725
|
+
return g(this, S), qa(c(this, I));
|
|
3726
|
+
}
|
|
3727
|
+
get dayOfWeek() {
|
|
3728
|
+
return ce(this, "dayOfWeek");
|
|
3729
|
+
}
|
|
3730
|
+
get dayOfYear() {
|
|
3731
|
+
return ce(this, "dayOfYear");
|
|
3732
|
+
}
|
|
3733
|
+
get weekOfYear() {
|
|
3734
|
+
return ce(this, "weekOfYear")?.week;
|
|
3735
|
+
}
|
|
3736
|
+
get yearOfWeek() {
|
|
3737
|
+
return ce(this, "weekOfYear")?.year;
|
|
3738
|
+
}
|
|
3739
|
+
get hoursInDay() {
|
|
3740
|
+
g(this, S);
|
|
3741
|
+
const e = c(this, x), n = qe(this).isoDate, r = Oe(n.year, n.month, n.day + 1), o = yt(e, n), a = yt(e, r);
|
|
3742
|
+
return Cn(k.fromEpochNsDiff(a, o), "hour");
|
|
3743
|
+
}
|
|
3744
|
+
get daysInWeek() {
|
|
3745
|
+
return ce(this, "daysInWeek");
|
|
3746
|
+
}
|
|
3747
|
+
get daysInMonth() {
|
|
3748
|
+
return ce(this, "daysInMonth");
|
|
3749
|
+
}
|
|
3750
|
+
get daysInYear() {
|
|
3751
|
+
return ce(this, "daysInYear");
|
|
3752
|
+
}
|
|
3753
|
+
get monthsInYear() {
|
|
3754
|
+
return ce(this, "monthsInYear");
|
|
3755
|
+
}
|
|
3756
|
+
get inLeapYear() {
|
|
3757
|
+
return ce(this, "inLeapYear");
|
|
3758
|
+
}
|
|
3759
|
+
get offset() {
|
|
3760
|
+
return g(this, S), zr(it(c(this, x), c(this, I)));
|
|
3761
|
+
}
|
|
3762
|
+
get offsetNanoseconds() {
|
|
3763
|
+
return g(this, S), it(c(this, x), c(this, I));
|
|
3764
|
+
}
|
|
3765
|
+
with(e, n = void 0) {
|
|
3766
|
+
if (g(this, S), !A(e)) throw new TypeError("invalid zoned-date-time-like");
|
|
3767
|
+
rn(e);
|
|
3768
|
+
const r = c(this, b), o = c(this, x), a = it(o, c(this, I)), i = qe(this);
|
|
3769
|
+
let s = { ...be(r, i.isoDate), ...i.time, offset: zr(a) };
|
|
3770
|
+
s = Yt(r, s, xe(r, e, ["year", "month", "monthCode", "day"], ["hour", "minute", "second", "millisecond", "microsecond", "nanosecond", "offset"], "partial"));
|
|
3771
|
+
const h = M(n), d = In(h), u = er(h, "prefer"), l = qn(r, s, N(h)), m = sn(s.offset);
|
|
3772
|
+
return ne(ar(l.isoDate, l.time, "option", m, o, d, u, !1), o, r);
|
|
3773
|
+
}
|
|
3774
|
+
withPlainTime(e = void 0) {
|
|
3775
|
+
g(this, S);
|
|
3776
|
+
const n = c(this, x), r = c(this, b), o = qe(this).isoDate;
|
|
3777
|
+
let a;
|
|
3778
|
+
return a = e === void 0 ? yt(n, o) : oe(n, j(o, c(pt(e), z)), "compatible"), ne(a, n, r);
|
|
3779
|
+
}
|
|
3780
|
+
withTimeZone(e) {
|
|
3781
|
+
g(this, S);
|
|
3782
|
+
const n = ve(e);
|
|
3783
|
+
return ne(c(this, I), n, c(this, b));
|
|
3784
|
+
}
|
|
3785
|
+
withCalendar(e) {
|
|
3786
|
+
g(this, S);
|
|
3787
|
+
const n = Hn(e);
|
|
3788
|
+
return ne(c(this, I), c(this, x), n);
|
|
3789
|
+
}
|
|
3790
|
+
add(e, n = void 0) {
|
|
3791
|
+
return g(this, S), Go("add", this, e, n);
|
|
3792
|
+
}
|
|
3793
|
+
subtract(e, n = void 0) {
|
|
3794
|
+
return g(this, S), Go("subtract", this, e, n);
|
|
3795
|
+
}
|
|
3796
|
+
until(e, n = void 0) {
|
|
3797
|
+
return g(this, S), zo("until", this, e, n);
|
|
3798
|
+
}
|
|
3799
|
+
since(e, n = void 0) {
|
|
3800
|
+
return g(this, S), zo("since", this, e, n);
|
|
3801
|
+
}
|
|
3802
|
+
round(e) {
|
|
3803
|
+
if (g(this, S), e === void 0) throw new TypeError("options parameter is required");
|
|
3804
|
+
const n = typeof e == "string" ? Nt("smallestUnit", e) : M(e), r = on(n), o = Ae(n, "halfExpand"), a = $e(n, "smallestUnit", "time", ut, ["day"]), i = { day: 1, hour: 24, minute: 60, second: 60, millisecond: 1e3, microsecond: 1e3, nanosecond: 1e3 }[a];
|
|
3805
|
+
if (an(r, i, i === 1), a === "nanosecond" && r === 1) return ne(c(this, I), c(this, x), c(this, b));
|
|
3806
|
+
const s = c(this, x), h = c(this, I), d = qe(this);
|
|
3807
|
+
let u;
|
|
3808
|
+
if (a === "day") {
|
|
3809
|
+
const l = d.isoDate, m = Oe(l.year, l.month, l.day + 1), f = yt(s, l), p = yt(s, m), v = y.subtract(p, f);
|
|
3810
|
+
u = k.fromEpochNsDiff(h, f).round(v, o).addToEpochNs(f);
|
|
3811
|
+
} else {
|
|
3812
|
+
const l = Jr(d, r, a, o), m = it(s, h);
|
|
3813
|
+
u = ar(l.isoDate, l.time, "option", m, s, "compatible", "prefer", !1);
|
|
3814
|
+
}
|
|
3815
|
+
return ne(u, s, c(this, b));
|
|
3816
|
+
}
|
|
3817
|
+
equals(e) {
|
|
3818
|
+
g(this, S);
|
|
3819
|
+
const n = vn(e), r = c(this, I), o = c(n, I);
|
|
3820
|
+
return !!y.equal(y.BigInt(r), y.BigInt(o)) && !!Ra(c(this, x), c(n, x)) && Ve(c(this, b), c(n, b));
|
|
3821
|
+
}
|
|
3822
|
+
toString(e = void 0) {
|
|
3823
|
+
g(this, S);
|
|
3824
|
+
const n = M(e), r = Fn(n), o = Bn(n), a = (function(m) {
|
|
3825
|
+
return dt(m, "offset", ["auto", "never"], "auto");
|
|
3826
|
+
})(n), i = Ae(n, "trunc"), s = $e(n, "smallestUnit", "time", void 0);
|
|
3827
|
+
if (s === "hour") throw new RangeError('smallestUnit must be a time unit other than "hour"');
|
|
3828
|
+
const h = (function(m) {
|
|
3829
|
+
return dt(m, "timeZoneName", ["auto", "never", "critical"], "auto");
|
|
3830
|
+
})(n), { precision: d, unit: u, increment: l } = zn(s, o);
|
|
3831
|
+
return No(this, d, r, h, a, { unit: u, increment: l, roundingMode: i });
|
|
3832
|
+
}
|
|
3833
|
+
toLocaleString(e = void 0, n = void 0) {
|
|
3834
|
+
g(this, S);
|
|
3835
|
+
const r = M(n), o = /* @__PURE__ */ Object.create(null);
|
|
3836
|
+
if ((function(h, d, u, l) {
|
|
3837
|
+
if (d == null) return;
|
|
3838
|
+
const m = Reflect.ownKeys(d);
|
|
3839
|
+
for (let f = 0; f < m.length; f++) {
|
|
3840
|
+
const p = m[f];
|
|
3841
|
+
if (!u.some(((v) => Object.is(v, p))) && Object.prototype.propertyIsEnumerable.call(d, p)) {
|
|
3842
|
+
const v = d[p];
|
|
3843
|
+
h[p] = v;
|
|
3844
|
+
}
|
|
3845
|
+
}
|
|
3846
|
+
})(o, r, ["timeZone"]), r.timeZone !== void 0) throw new TypeError("ZonedDateTime toLocaleString does not accept a timeZone option");
|
|
3847
|
+
if (o.year === void 0 && o.month === void 0 && o.day === void 0 && o.era === void 0 && o.weekday === void 0 && o.dateStyle === void 0 && o.hour === void 0 && o.minute === void 0 && o.second === void 0 && o.fractionalSecondDigits === void 0 && o.timeStyle === void 0 && o.dayPeriod === void 0 && o.timeZoneName === void 0 && (o.timeZoneName = "short"), o.timeZone = c(this, x), jo(o.timeZone)) throw new RangeError("toLocaleString does not currently support offset time zones");
|
|
3848
|
+
const a = new Pe(e, o), i = ds.call(a).calendar, s = c(this, b);
|
|
3849
|
+
if (s !== "iso8601" && i !== "iso8601" && !Ve(i, s)) throw new RangeError(`cannot format ZonedDateTime with calendar ${s} in locale with calendar ${i}`);
|
|
3850
|
+
return a.format(_e(c(this, I)));
|
|
3851
|
+
}
|
|
3852
|
+
toJSON() {
|
|
3853
|
+
return g(this, S), No(this, "auto");
|
|
3854
|
+
}
|
|
3855
|
+
valueOf() {
|
|
3856
|
+
Tt("ZonedDateTime");
|
|
3857
|
+
}
|
|
3858
|
+
startOfDay() {
|
|
3859
|
+
g(this, S);
|
|
3860
|
+
const e = c(this, x);
|
|
3861
|
+
return ne(yt(e, qe(this).isoDate), e, c(this, b));
|
|
3862
|
+
}
|
|
3863
|
+
getTimeZoneTransition(e) {
|
|
3864
|
+
g(this, S);
|
|
3865
|
+
const n = c(this, x);
|
|
3866
|
+
if (e === void 0) throw new TypeError("options parameter is required");
|
|
3867
|
+
const r = dt(typeof e == "string" ? Nt("direction", e) : M(e), "direction", ["next", "previous"], ut);
|
|
3868
|
+
if (r === void 0) throw new TypeError("direction option is required");
|
|
3869
|
+
if (jo(n) || n === "UTC") return null;
|
|
3870
|
+
const o = c(this, I), a = r === "next" ? ro(n, o) : qr(n, o);
|
|
3871
|
+
return a === null ? null : ne(a, n, c(this, b));
|
|
3872
|
+
}
|
|
3873
|
+
toInstant() {
|
|
3874
|
+
return g(this, S), _e(c(this, I));
|
|
3875
|
+
}
|
|
3876
|
+
toPlainDate() {
|
|
3877
|
+
return g(this, S), we(qe(this).isoDate, c(this, b));
|
|
3878
|
+
}
|
|
3879
|
+
toPlainTime() {
|
|
3880
|
+
return g(this, S), at(qe(this).time);
|
|
3881
|
+
}
|
|
3882
|
+
toPlainDateTime() {
|
|
3883
|
+
return g(this, S), Le(qe(this), c(this, b));
|
|
3884
|
+
}
|
|
3885
|
+
static from(e, n = void 0) {
|
|
3886
|
+
return vn(e, n);
|
|
3887
|
+
}
|
|
3888
|
+
static compare(e, n) {
|
|
3889
|
+
const r = vn(e), o = vn(n), a = c(r, I), i = c(o, I);
|
|
3890
|
+
return y.lessThan(y.BigInt(a), y.BigInt(i)) ? -1 : y.greaterThan(y.BigInt(a), y.BigInt(i)) ? 1 : 0;
|
|
3891
|
+
}
|
|
3892
|
+
}
|
|
3893
|
+
function qe(t) {
|
|
3894
|
+
return Fe(c(t, x), c(t, I));
|
|
3895
|
+
}
|
|
3896
|
+
function ce(t, e) {
|
|
3897
|
+
g(t, S);
|
|
3898
|
+
const n = qe(t).isoDate;
|
|
3899
|
+
return An(t).isoToDate(n, { [e]: !0 })[e];
|
|
3900
|
+
}
|
|
3901
|
+
function zt(t, e) {
|
|
3902
|
+
return g(t, S), qe(t).time[e];
|
|
3903
|
+
}
|
|
3904
|
+
mt(po, "Temporal.ZonedDateTime");
|
|
3905
|
+
var ls = Object.freeze({ __proto__: null, Duration: nn, Instant: lo, Now: ni, PlainDate: mo, PlainDateTime: fo, PlainMonthDay: yo, PlainTime: Xn, PlainYearMonth: go, ZonedDateTime: po });
|
|
3906
|
+
const hs = [lo, mo, fo, nn, yo, Xn, go, po];
|
|
3907
|
+
for (const t of hs) {
|
|
3908
|
+
const e = Object.getOwnPropertyDescriptor(t, "prototype");
|
|
3909
|
+
(e.configurable || e.enumerable || e.writable) && (e.configurable = !1, e.enumerable = !1, e.writable = !1, Object.defineProperty(t, "prototype", e));
|
|
3910
|
+
}
|
|
3911
|
+
export {
|
|
3912
|
+
ls as Temporal
|
|
3913
|
+
};
|