@phillips/seldon 1.143.2 → 1.145.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/build.js +4 -0
- package/dist/_virtual/defaults.js +4 -0
- package/dist/_virtual/encode-new-lines.js +4 -0
- package/dist/_virtual/encode-param-value.js +4 -0
- package/dist/_virtual/fold-line.js +4 -0
- package/dist/_virtual/format-date.js +4 -0
- package/dist/_virtual/format-duration.js +4 -0
- package/dist/_virtual/format-text.js +4 -0
- package/dist/_virtual/format.js +4 -0
- package/dist/_virtual/index.browser.js +6 -0
- package/dist/_virtual/index.cjs.production.min.js +4 -0
- package/dist/_virtual/index.esm.js +6 -0
- package/dist/_virtual/index10.js +4 -0
- package/dist/_virtual/index11.js +4 -0
- package/dist/_virtual/index12.js +4 -0
- package/dist/_virtual/index7.js +4 -0
- package/dist/_virtual/index8.js +4 -0
- package/dist/_virtual/index9.js +4 -0
- package/dist/_virtual/set-alarm.js +4 -0
- package/dist/_virtual/set-contact.js +4 -0
- package/dist/_virtual/set-description.js +4 -0
- package/dist/_virtual/set-geolocation.js +4 -0
- package/dist/_virtual/set-location.js +4 -0
- package/dist/_virtual/set-organizer.js +4 -0
- package/dist/_virtual/set-summary.js +4 -0
- package/dist/_virtual/validate.js +4 -0
- package/dist/components/AddToCalendar/AddToCalendar.d.ts +10 -0
- package/dist/components/AddToCalendar/AddToCalendar.js +62 -0
- package/dist/components/AddToCalendar/AddToCalendar.stories.d.ts +25 -0
- package/dist/components/AddToCalendar/AddToCalendar.test.d.ts +1 -0
- package/dist/components/AddToCalendar/calendarLinks.d.ts +6 -0
- package/dist/components/AddToCalendar/calendarLinks.js +89 -0
- package/dist/components/AddToCalendar/calendarLinks.test.d.ts +1 -0
- package/dist/components/AddToCalendar/index.d.ts +1 -0
- package/dist/components/AddToCalendar/types.d.ts +8 -0
- package/dist/components/ComboBox/ComboBox.d.ts +69 -0
- package/dist/components/ComboBox/ComboBox.js +221 -0
- package/dist/components/ComboBox/ComboBox.stories.d.ts +18 -0
- package/dist/components/ComboBox/ComboBox.test.d.ts +1 -0
- package/dist/components/ComboBox/index.d.ts +1 -0
- package/dist/components/PhoneNumberPicker/PhoneNumberPicker.d.ts +38 -0
- package/dist/components/PhoneNumberPicker/PhoneNumberPicker.stories.d.ts +14 -0
- package/dist/components/PhoneNumberPicker/PhoneNumberPicker.test.d.ts +1 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.js +116 -112
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +208 -0
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +608 -0
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-collection/dist/index.js +48 -0
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-popper/dist/index.js +218 -0
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-primitive/dist/index.js +36 -0
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-roving-focus/dist/index.js +183 -0
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +18 -17
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-popper/dist/index.js +218 -0
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-primitive/dist/index.js +36 -0
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
- package/dist/node_modules/cmdk/dist/chunk-NZJY6EH4.js +17 -0
- package/dist/node_modules/cmdk/dist/index.js +312 -0
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
- package/dist/node_modules/date-fns/_lib/format/formatters.js +517 -0
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +59 -0
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +52 -0
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +20 -0
- package/dist/node_modules/date-fns/addHours.js +9 -0
- package/dist/node_modules/date-fns/addMilliseconds.js +9 -0
- package/dist/node_modules/date-fns/constants.js +6 -5
- package/dist/node_modules/date-fns/format.js +58 -0
- package/dist/node_modules/date-fns/getDayOfYear.js +11 -0
- package/dist/node_modules/date-fns/getISOWeek.js +12 -0
- package/dist/node_modules/date-fns/getISOWeekYear.js +15 -0
- package/dist/node_modules/date-fns/getWeek.js +12 -0
- package/dist/node_modules/date-fns/getWeekYear.js +16 -0
- package/dist/node_modules/date-fns/isDate.js +7 -0
- package/dist/node_modules/date-fns/isValid.js +9 -0
- package/dist/node_modules/date-fns/startOfISOWeek.js +8 -0
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +11 -0
- package/dist/node_modules/date-fns/startOfWeekYear.js +12 -0
- package/dist/node_modules/date-fns/startOfYear.js +9 -0
- package/dist/node_modules/date-fns-tz/dist/esm/_lib/getTimezoneOffsetInMilliseconds/index.js +7 -0
- package/dist/node_modules/date-fns-tz/dist/esm/_lib/newDateUTC/index.js +7 -0
- package/dist/node_modules/date-fns-tz/dist/esm/_lib/tzParseTimezone/index.js +63 -0
- package/dist/node_modules/date-fns-tz/dist/esm/_lib/tzPattern/index.js +4 -0
- package/dist/node_modules/date-fns-tz/dist/esm/_lib/tzTokenizeDate/index.js +71 -0
- package/dist/node_modules/date-fns-tz/dist/esm/toDate/index.js +180 -0
- package/dist/node_modules/date-fns-tz/dist/esm/toZonedTime/index.js +10 -0
- package/dist/node_modules/ics/dist/defaults.js +23 -0
- package/dist/node_modules/ics/dist/index.js +115 -0
- package/dist/node_modules/ics/dist/pipeline/build.js +50 -0
- package/dist/node_modules/ics/dist/pipeline/format.js +70 -0
- package/dist/node_modules/ics/dist/pipeline/index.js +53 -0
- package/dist/node_modules/ics/dist/pipeline/validate.js +17 -0
- package/dist/node_modules/ics/dist/schema/index.js +211 -0
- package/dist/node_modules/ics/dist/utils/encode-new-lines.js +9 -0
- package/dist/node_modules/ics/dist/utils/encode-param-value.js +9 -0
- package/dist/node_modules/ics/dist/utils/fold-line.js +14 -0
- package/dist/node_modules/ics/dist/utils/format-date.js +68 -0
- package/dist/node_modules/ics/dist/utils/format-duration.js +10 -0
- package/dist/node_modules/ics/dist/utils/format-text.js +9 -0
- package/dist/node_modules/ics/dist/utils/index.js +87 -0
- package/dist/node_modules/ics/dist/utils/set-alarm.js +49 -0
- package/dist/node_modules/ics/dist/utils/set-contact.js +18 -0
- package/dist/node_modules/ics/dist/utils/set-description.js +15 -0
- package/dist/node_modules/ics/dist/utils/set-geolocation.js +10 -0
- package/dist/node_modules/ics/dist/utils/set-location.js +15 -0
- package/dist/node_modules/ics/dist/utils/set-organizer.js +16 -0
- package/dist/node_modules/ics/dist/utils/set-summary.js +15 -0
- package/dist/node_modules/nanoid/index.browser.js +19 -0
- package/dist/node_modules/nanoid/url-alphabet/index.js +4 -0
- package/dist/node_modules/property-expr/index.js +77 -0
- package/dist/node_modules/runes2/dist/index.cjs.development.js +139 -0
- package/dist/node_modules/runes2/dist/index.cjs.production.min.js +86 -0
- package/dist/node_modules/runes2/dist/index.js +8 -0
- package/dist/node_modules/tiny-case/index.js +17 -0
- package/dist/node_modules/toposort/index.js +65 -0
- package/dist/node_modules/yup/index.esm.js +1899 -0
- package/dist/scss/_vars.scss +3 -0
- package/dist/scss/_vars.scss.js +3 -0
- package/dist/scss/componentStyles.scss +2 -0
- package/dist/scss/components/AddToCalendar/_addToCalendar.scss +64 -0
- package/dist/scss/components/ComboBox/_combobox.scss +149 -0
- package/package.json +8 -2
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { getDefaultOptions as k } from "./_lib/defaultOptions.js";
|
|
2
|
+
import { formatters as l } from "./_lib/format/formatters.js";
|
|
3
|
+
import { longFormatters as g } from "./_lib/format/longFormatters.js";
|
|
4
|
+
import { isProtectedWeekYearToken as h, isProtectedDayOfYearToken as d, warnOrThrowProtectedError as w } from "./_lib/protectedTokens.js";
|
|
5
|
+
import { isValid as T } from "./isValid.js";
|
|
6
|
+
import { toDate as D } from "./toDate.js";
|
|
7
|
+
import { enUS as E } from "./locale/en-US.js";
|
|
8
|
+
const v = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, O = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, R = /^'([^]*?)'?$/, x = /''/g, C = /[a-zA-Z]/;
|
|
9
|
+
function j(o, r, f) {
|
|
10
|
+
const a = k(), n = a.locale ?? E, m = a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, p = a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0, i = D(o, f?.in);
|
|
11
|
+
if (!T(i))
|
|
12
|
+
throw new RangeError("Invalid time value");
|
|
13
|
+
let s = r.match(O).map((t) => {
|
|
14
|
+
const e = t[0];
|
|
15
|
+
if (e === "p" || e === "P") {
|
|
16
|
+
const c = g[e];
|
|
17
|
+
return c(t, n.formatLong);
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
}).join("").match(v).map((t) => {
|
|
21
|
+
if (t === "''")
|
|
22
|
+
return { isToken: !1, value: "'" };
|
|
23
|
+
const e = t[0];
|
|
24
|
+
if (e === "'")
|
|
25
|
+
return { isToken: !1, value: P(t) };
|
|
26
|
+
if (l[e])
|
|
27
|
+
return { isToken: !0, value: t };
|
|
28
|
+
if (e.match(C))
|
|
29
|
+
throw new RangeError(
|
|
30
|
+
"Format string contains an unescaped latin alphabet character `" + e + "`"
|
|
31
|
+
);
|
|
32
|
+
return { isToken: !1, value: t };
|
|
33
|
+
});
|
|
34
|
+
n.localize.preprocessor && (s = n.localize.preprocessor(i, s));
|
|
35
|
+
const u = {
|
|
36
|
+
firstWeekContainsDate: m,
|
|
37
|
+
weekStartsOn: p,
|
|
38
|
+
locale: n
|
|
39
|
+
};
|
|
40
|
+
return s.map((t) => {
|
|
41
|
+
if (!t.isToken) return t.value;
|
|
42
|
+
const e = t.value;
|
|
43
|
+
(h(e) || d(e)) && w(e, r, String(o));
|
|
44
|
+
const c = l[e[0]];
|
|
45
|
+
return c(i, e, n.localize, u);
|
|
46
|
+
}).join("");
|
|
47
|
+
}
|
|
48
|
+
function P(o) {
|
|
49
|
+
const r = o.match(R);
|
|
50
|
+
return r ? r[1].replace(x, "'") : o;
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
j as default,
|
|
54
|
+
j as format,
|
|
55
|
+
j as formatDate,
|
|
56
|
+
l as formatters,
|
|
57
|
+
g as longFormatters
|
|
58
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { differenceInCalendarDays as f } from "./differenceInCalendarDays.js";
|
|
2
|
+
import { startOfYear as e } from "./startOfYear.js";
|
|
3
|
+
import { toDate as o } from "./toDate.js";
|
|
4
|
+
function c(t, a) {
|
|
5
|
+
const r = o(t, a?.in);
|
|
6
|
+
return f(r, e(r)) + 1;
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
c as default,
|
|
10
|
+
c as getDayOfYear
|
|
11
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { millisecondsInWeek as f } from "./constants.js";
|
|
2
|
+
import { startOfISOWeek as i } from "./startOfISOWeek.js";
|
|
3
|
+
import { startOfISOWeekYear as m } from "./startOfISOWeekYear.js";
|
|
4
|
+
import { toDate as n } from "./toDate.js";
|
|
5
|
+
function O(e, o) {
|
|
6
|
+
const t = n(e, o?.in), r = +i(t) - +m(t);
|
|
7
|
+
return Math.round(r / f) + 1;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
O as default,
|
|
11
|
+
O as getISOWeek
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { constructFrom as s } from "./constructFrom.js";
|
|
2
|
+
import { startOfISOWeek as a } from "./startOfISOWeek.js";
|
|
3
|
+
import { toDate as m } from "./toDate.js";
|
|
4
|
+
function Y(f, n) {
|
|
5
|
+
const e = m(f, n?.in), t = e.getFullYear(), r = s(e, 0);
|
|
6
|
+
r.setFullYear(t + 1, 0, 4), r.setHours(0, 0, 0, 0);
|
|
7
|
+
const u = a(r), o = s(e, 0);
|
|
8
|
+
o.setFullYear(t, 0, 4), o.setHours(0, 0, 0, 0);
|
|
9
|
+
const i = a(o);
|
|
10
|
+
return e.getTime() >= u.getTime() ? t + 1 : e.getTime() >= i.getTime() ? t : t - 1;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
Y as default,
|
|
14
|
+
Y as getISOWeekYear
|
|
15
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { millisecondsInWeek as f } from "./constants.js";
|
|
2
|
+
import { startOfWeek as m } from "./startOfWeek.js";
|
|
3
|
+
import { startOfWeekYear as a } from "./startOfWeekYear.js";
|
|
4
|
+
import { toDate as i } from "./toDate.js";
|
|
5
|
+
function k(r, t) {
|
|
6
|
+
const e = i(r, t?.in), o = +m(e, t) - +a(e, t);
|
|
7
|
+
return Math.round(o / f) + 1;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
k as default,
|
|
11
|
+
k as getWeek
|
|
12
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getDefaultOptions as k } from "./_lib/defaultOptions.js";
|
|
2
|
+
import { constructFrom as i } from "./constructFrom.js";
|
|
3
|
+
import { startOfWeek as l } from "./startOfWeek.js";
|
|
4
|
+
import { toDate as m } from "./toDate.js";
|
|
5
|
+
function C(r, e) {
|
|
6
|
+
const s = m(r, e?.in), t = s.getFullYear(), o = k(), f = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, a = i(e?.in || r, 0);
|
|
7
|
+
a.setFullYear(t + 1, 0, f), a.setHours(0, 0, 0, 0);
|
|
8
|
+
const c = l(a, e), n = i(e?.in || r, 0);
|
|
9
|
+
n.setFullYear(t, 0, f), n.setHours(0, 0, 0, 0);
|
|
10
|
+
const u = l(n, e);
|
|
11
|
+
return +s >= +c ? t + 1 : +s >= +u ? t : t - 1;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
C as default,
|
|
15
|
+
C as getWeekYear
|
|
16
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { constructFrom as a } from "./constructFrom.js";
|
|
2
|
+
import { getISOWeekYear as f } from "./getISOWeekYear.js";
|
|
3
|
+
import { startOfISOWeek as s } from "./startOfISOWeek.js";
|
|
4
|
+
function O(t, e) {
|
|
5
|
+
const o = f(t, e), r = a(t, 0);
|
|
6
|
+
return r.setFullYear(o, 0, 4), r.setHours(0, 0, 0, 0), s(r);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
O as default,
|
|
10
|
+
O as startOfISOWeekYear
|
|
11
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getDefaultOptions as n } from "./_lib/defaultOptions.js";
|
|
2
|
+
import { constructFrom as i } from "./constructFrom.js";
|
|
3
|
+
import { getWeekYear as f } from "./getWeekYear.js";
|
|
4
|
+
import { startOfWeek as c } from "./startOfWeek.js";
|
|
5
|
+
function D(r, t) {
|
|
6
|
+
const a = n(), o = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, s = f(r, t), e = i(t?.in || r, 0);
|
|
7
|
+
return e.setFullYear(s, 0, o), e.setHours(0, 0, 0, 0), c(e, t);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
D as default,
|
|
11
|
+
D as startOfWeekYear
|
|
12
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
function n(e) {
|
|
2
|
+
const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
|
|
3
|
+
return t.setUTCFullYear(e.getFullYear()), +e - +t;
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
n as getTimezoneOffsetInMilliseconds
|
|
7
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { tzTokenizeDate as N } from "../tzTokenizeDate/index.js";
|
|
2
|
+
import { newDateUTC as I } from "../newDateUTC/index.js";
|
|
3
|
+
const a = 36e5, m = 6e4, u = {
|
|
4
|
+
timezone: /([Z+-].*)$/,
|
|
5
|
+
timezoneZ: /^(Z)$/,
|
|
6
|
+
timezoneHH: /^([+-]\d{2})$/,
|
|
7
|
+
timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
|
|
8
|
+
};
|
|
9
|
+
function z(e, t, o) {
|
|
10
|
+
if (!e)
|
|
11
|
+
return 0;
|
|
12
|
+
let c = u.timezoneZ.exec(e);
|
|
13
|
+
if (c)
|
|
14
|
+
return 0;
|
|
15
|
+
let n, r;
|
|
16
|
+
if (c = u.timezoneHH.exec(e), c)
|
|
17
|
+
return n = parseInt(c[1], 10), l(n) ? -(n * a) : NaN;
|
|
18
|
+
if (c = u.timezoneHHMM.exec(e), c) {
|
|
19
|
+
n = parseInt(c[2], 10);
|
|
20
|
+
const s = parseInt(c[3], 10);
|
|
21
|
+
return l(n, s) ? (r = Math.abs(n) * a + s * m, c[1] === "+" ? -r : r) : NaN;
|
|
22
|
+
}
|
|
23
|
+
if (H(e)) {
|
|
24
|
+
t = new Date(t || Date.now());
|
|
25
|
+
const s = o ? t : M(t), i = f(s, e);
|
|
26
|
+
return -(o ? i : D(t, i, e));
|
|
27
|
+
}
|
|
28
|
+
return NaN;
|
|
29
|
+
}
|
|
30
|
+
function M(e) {
|
|
31
|
+
return I(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
|
|
32
|
+
}
|
|
33
|
+
function f(e, t) {
|
|
34
|
+
const o = N(e, t), c = I(o[0], o[1] - 1, o[2], o[3] % 24, o[4], o[5], 0).getTime();
|
|
35
|
+
let n = e.getTime();
|
|
36
|
+
const r = n % 1e3;
|
|
37
|
+
return n -= r >= 0 ? r : 1e3 + r, c - n;
|
|
38
|
+
}
|
|
39
|
+
function D(e, t, o) {
|
|
40
|
+
let n = e.getTime() - t;
|
|
41
|
+
const r = f(new Date(n), o);
|
|
42
|
+
if (t === r)
|
|
43
|
+
return t;
|
|
44
|
+
n -= r - t;
|
|
45
|
+
const s = f(new Date(n), o);
|
|
46
|
+
return r === s ? r : Math.max(r, s);
|
|
47
|
+
}
|
|
48
|
+
function l(e, t) {
|
|
49
|
+
return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
|
|
50
|
+
}
|
|
51
|
+
const T = {};
|
|
52
|
+
function H(e) {
|
|
53
|
+
if (T[e])
|
|
54
|
+
return !0;
|
|
55
|
+
try {
|
|
56
|
+
return new Intl.DateTimeFormat(void 0, { timeZone: e }), T[e] = !0, !0;
|
|
57
|
+
} catch {
|
|
58
|
+
return !1;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
z as tzParseTimezone
|
|
63
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
function h(t, r) {
|
|
2
|
+
const e = f(r);
|
|
3
|
+
return "formatToParts" in e ? s(e, t) : u(e, t);
|
|
4
|
+
}
|
|
5
|
+
const c = {
|
|
6
|
+
year: 0,
|
|
7
|
+
month: 1,
|
|
8
|
+
day: 2,
|
|
9
|
+
hour: 3,
|
|
10
|
+
minute: 4,
|
|
11
|
+
second: 5
|
|
12
|
+
};
|
|
13
|
+
function s(t, r) {
|
|
14
|
+
try {
|
|
15
|
+
const e = t.formatToParts(r), n = [];
|
|
16
|
+
for (let o = 0; o < e.length; o++) {
|
|
17
|
+
const a = c[e[o].type];
|
|
18
|
+
a !== void 0 && (n[a] = parseInt(e[o].value, 10));
|
|
19
|
+
}
|
|
20
|
+
return n;
|
|
21
|
+
} catch (e) {
|
|
22
|
+
if (e instanceof RangeError)
|
|
23
|
+
return [NaN];
|
|
24
|
+
throw e;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function u(t, r) {
|
|
28
|
+
const e = t.format(r), n = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);
|
|
29
|
+
return [
|
|
30
|
+
parseInt(n[3], 10),
|
|
31
|
+
parseInt(n[1], 10),
|
|
32
|
+
parseInt(n[2], 10),
|
|
33
|
+
parseInt(n[4], 10),
|
|
34
|
+
parseInt(n[5], 10),
|
|
35
|
+
parseInt(n[6], 10)
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
const i = {}, d = new Intl.DateTimeFormat("en-US", {
|
|
39
|
+
hourCycle: "h23",
|
|
40
|
+
timeZone: "America/New_York",
|
|
41
|
+
year: "numeric",
|
|
42
|
+
month: "2-digit",
|
|
43
|
+
day: "2-digit",
|
|
44
|
+
hour: "2-digit",
|
|
45
|
+
minute: "2-digit",
|
|
46
|
+
second: "2-digit"
|
|
47
|
+
}).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), m = d === "06/25/2014, 00:00:00" || d === "06/25/2014 00:00:00";
|
|
48
|
+
function f(t) {
|
|
49
|
+
return i[t] || (i[t] = m ? new Intl.DateTimeFormat("en-US", {
|
|
50
|
+
hourCycle: "h23",
|
|
51
|
+
timeZone: t,
|
|
52
|
+
year: "numeric",
|
|
53
|
+
month: "numeric",
|
|
54
|
+
day: "2-digit",
|
|
55
|
+
hour: "2-digit",
|
|
56
|
+
minute: "2-digit",
|
|
57
|
+
second: "2-digit"
|
|
58
|
+
}) : new Intl.DateTimeFormat("en-US", {
|
|
59
|
+
hour12: !1,
|
|
60
|
+
timeZone: t,
|
|
61
|
+
year: "numeric",
|
|
62
|
+
month: "numeric",
|
|
63
|
+
day: "2-digit",
|
|
64
|
+
hour: "2-digit",
|
|
65
|
+
minute: "2-digit",
|
|
66
|
+
second: "2-digit"
|
|
67
|
+
})), i[t];
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
h as tzTokenizeDate
|
|
71
|
+
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { getTimezoneOffsetInMilliseconds as Y } from "../_lib/getTimezoneOffsetInMilliseconds/index.js";
|
|
2
|
+
import { tzParseTimezone as T } from "../_lib/tzParseTimezone/index.js";
|
|
3
|
+
import { tzPattern as m } from "../_lib/tzPattern/index.js";
|
|
4
|
+
const c = 36e5, N = 6e4, M = 2, l = {
|
|
5
|
+
dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
|
|
6
|
+
datePattern: /^([0-9W+-]+)(.*)/,
|
|
7
|
+
plainTime: /:/,
|
|
8
|
+
// year tokens
|
|
9
|
+
YY: /^(\d{2})$/,
|
|
10
|
+
YYY: [
|
|
11
|
+
/^([+-]\d{2})$/,
|
|
12
|
+
// 0 additional digits
|
|
13
|
+
/^([+-]\d{3})$/,
|
|
14
|
+
// 1 additional digit
|
|
15
|
+
/^([+-]\d{4})$/
|
|
16
|
+
// 2 additional digits
|
|
17
|
+
],
|
|
18
|
+
YYYY: /^(\d{4})/,
|
|
19
|
+
YYYYY: [
|
|
20
|
+
/^([+-]\d{4})/,
|
|
21
|
+
// 0 additional digits
|
|
22
|
+
/^([+-]\d{5})/,
|
|
23
|
+
// 1 additional digit
|
|
24
|
+
/^([+-]\d{6})/
|
|
25
|
+
// 2 additional digits
|
|
26
|
+
],
|
|
27
|
+
// date tokens
|
|
28
|
+
MM: /^-(\d{2})$/,
|
|
29
|
+
DDD: /^-?(\d{3})$/,
|
|
30
|
+
MMDD: /^-?(\d{2})-?(\d{2})$/,
|
|
31
|
+
Www: /^-?W(\d{2})$/,
|
|
32
|
+
WwwD: /^-?W(\d{2})-?(\d{1})$/,
|
|
33
|
+
HH: /^(\d{2}([.,]\d*)?)$/,
|
|
34
|
+
HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
|
|
35
|
+
HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
|
|
36
|
+
// time zone tokens (to identify the presence of a tz)
|
|
37
|
+
timeZone: m
|
|
38
|
+
};
|
|
39
|
+
function F(t, e = {}) {
|
|
40
|
+
if (arguments.length < 1)
|
|
41
|
+
throw new TypeError("1 argument required, but only " + arguments.length + " present");
|
|
42
|
+
if (t === null)
|
|
43
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
44
|
+
const n = e.additionalDigits == null ? M : Number(e.additionalDigits);
|
|
45
|
+
if (n !== 2 && n !== 1 && n !== 0)
|
|
46
|
+
throw new RangeError("additionalDigits must be 0, 1 or 2");
|
|
47
|
+
if (t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]")
|
|
48
|
+
return new Date(t.getTime());
|
|
49
|
+
if (typeof t == "number" || Object.prototype.toString.call(t) === "[object Number]")
|
|
50
|
+
return new Date(t);
|
|
51
|
+
if (Object.prototype.toString.call(t) !== "[object String]")
|
|
52
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
53
|
+
const r = x(t), { year: i, restDateString: a } = H(r.date, n), s = O(a, i);
|
|
54
|
+
if (s === null || isNaN(s.getTime()))
|
|
55
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
56
|
+
if (s) {
|
|
57
|
+
const o = s.getTime();
|
|
58
|
+
let f = 0, u;
|
|
59
|
+
if (r.time && (f = b(r.time), f === null || isNaN(f)))
|
|
60
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
61
|
+
if (r.timeZone || e.timeZone) {
|
|
62
|
+
if (u = T(r.timeZone || e.timeZone, new Date(o + f)), isNaN(u))
|
|
63
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
64
|
+
} else
|
|
65
|
+
u = Y(new Date(o + f)), u = Y(new Date(o + f + u));
|
|
66
|
+
return new Date(o + f + u);
|
|
67
|
+
} else
|
|
68
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
69
|
+
}
|
|
70
|
+
function x(t) {
|
|
71
|
+
const e = {};
|
|
72
|
+
let n = l.dateTimePattern.exec(t), r;
|
|
73
|
+
if (n ? (e.date = n[1], r = n[3]) : (n = l.datePattern.exec(t), n ? (e.date = n[1], r = n[2]) : (e.date = null, r = t)), r) {
|
|
74
|
+
const i = l.timeZone.exec(r);
|
|
75
|
+
i ? (e.time = r.replace(i[1], ""), e.timeZone = i[1].trim()) : e.time = r;
|
|
76
|
+
}
|
|
77
|
+
return e;
|
|
78
|
+
}
|
|
79
|
+
function H(t, e) {
|
|
80
|
+
if (t) {
|
|
81
|
+
const n = l.YYY[e], r = l.YYYYY[e];
|
|
82
|
+
let i = l.YYYY.exec(t) || r.exec(t);
|
|
83
|
+
if (i) {
|
|
84
|
+
const a = i[1];
|
|
85
|
+
return {
|
|
86
|
+
year: parseInt(a, 10),
|
|
87
|
+
restDateString: t.slice(a.length)
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
if (i = l.YY.exec(t) || n.exec(t), i) {
|
|
91
|
+
const a = i[1];
|
|
92
|
+
return {
|
|
93
|
+
year: parseInt(a, 10) * 100,
|
|
94
|
+
restDateString: t.slice(a.length)
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
year: null
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function O(t, e) {
|
|
103
|
+
if (e === null)
|
|
104
|
+
return null;
|
|
105
|
+
let n, r, i;
|
|
106
|
+
if (!t || !t.length)
|
|
107
|
+
return n = /* @__PURE__ */ new Date(0), n.setUTCFullYear(e), n;
|
|
108
|
+
let a = l.MM.exec(t);
|
|
109
|
+
if (a)
|
|
110
|
+
return n = /* @__PURE__ */ new Date(0), r = parseInt(a[1], 10) - 1, w(e, r) ? (n.setUTCFullYear(e, r), n) : /* @__PURE__ */ new Date(NaN);
|
|
111
|
+
if (a = l.DDD.exec(t), a) {
|
|
112
|
+
n = /* @__PURE__ */ new Date(0);
|
|
113
|
+
const s = parseInt(a[1], 10);
|
|
114
|
+
return U(e, s) ? (n.setUTCFullYear(e, 0, s), n) : /* @__PURE__ */ new Date(NaN);
|
|
115
|
+
}
|
|
116
|
+
if (a = l.MMDD.exec(t), a) {
|
|
117
|
+
n = /* @__PURE__ */ new Date(0), r = parseInt(a[1], 10) - 1;
|
|
118
|
+
const s = parseInt(a[2], 10);
|
|
119
|
+
return w(e, r, s) ? (n.setUTCFullYear(e, r, s), n) : /* @__PURE__ */ new Date(NaN);
|
|
120
|
+
}
|
|
121
|
+
if (a = l.Www.exec(t), a)
|
|
122
|
+
return i = parseInt(a[1], 10) - 1, d(i) ? p(e, i) : /* @__PURE__ */ new Date(NaN);
|
|
123
|
+
if (a = l.WwwD.exec(t), a) {
|
|
124
|
+
i = parseInt(a[1], 10) - 1;
|
|
125
|
+
const s = parseInt(a[2], 10) - 1;
|
|
126
|
+
return d(i, s) ? p(e, i, s) : /* @__PURE__ */ new Date(NaN);
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
function b(t) {
|
|
131
|
+
let e, n, r = l.HH.exec(t);
|
|
132
|
+
if (r)
|
|
133
|
+
return e = parseFloat(r[1].replace(",", ".")), D(e) ? e % 24 * c : NaN;
|
|
134
|
+
if (r = l.HHMM.exec(t), r)
|
|
135
|
+
return e = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), D(e, n) ? e % 24 * c + n * N : NaN;
|
|
136
|
+
if (r = l.HHMMSS.exec(t), r) {
|
|
137
|
+
e = parseInt(r[1], 10), n = parseInt(r[2], 10);
|
|
138
|
+
const i = parseFloat(r[3].replace(",", "."));
|
|
139
|
+
return D(e, n, i) ? e % 24 * c + n * N + i * 1e3 : NaN;
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
function p(t, e, n) {
|
|
144
|
+
e = e || 0, n = n || 0;
|
|
145
|
+
const r = /* @__PURE__ */ new Date(0);
|
|
146
|
+
r.setUTCFullYear(t, 0, 4);
|
|
147
|
+
const i = r.getUTCDay() || 7, a = e * 7 + n + 1 - i;
|
|
148
|
+
return r.setUTCDate(r.getUTCDate() + a), r;
|
|
149
|
+
}
|
|
150
|
+
const _ = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], $ = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
151
|
+
function I(t) {
|
|
152
|
+
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
|
|
153
|
+
}
|
|
154
|
+
function w(t, e, n) {
|
|
155
|
+
if (e < 0 || e > 11)
|
|
156
|
+
return !1;
|
|
157
|
+
if (n != null) {
|
|
158
|
+
if (n < 1)
|
|
159
|
+
return !1;
|
|
160
|
+
const r = I(t);
|
|
161
|
+
if (r && n > $[e] || !r && n > _[e])
|
|
162
|
+
return !1;
|
|
163
|
+
}
|
|
164
|
+
return !0;
|
|
165
|
+
}
|
|
166
|
+
function U(t, e) {
|
|
167
|
+
if (e < 1)
|
|
168
|
+
return !1;
|
|
169
|
+
const n = I(t);
|
|
170
|
+
return !(n && e > 366 || !n && e > 365);
|
|
171
|
+
}
|
|
172
|
+
function d(t, e) {
|
|
173
|
+
return !(t < 0 || t > 52 || e != null && (e < 0 || e > 6));
|
|
174
|
+
}
|
|
175
|
+
function D(t, e, n) {
|
|
176
|
+
return !(t < 0 || t >= 25 || e != null && (e < 0 || e >= 60) || n != null && (n < 0 || n >= 60));
|
|
177
|
+
}
|
|
178
|
+
export {
|
|
179
|
+
F as toDate
|
|
180
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { tzParseTimezone as i } from "../_lib/tzParseTimezone/index.js";
|
|
2
|
+
import { toDate as T } from "../toDate/index.js";
|
|
3
|
+
function g(t, s, n) {
|
|
4
|
+
t = T(t, n);
|
|
5
|
+
const r = i(s, t, !0), e = new Date(t.getTime() - r), o = /* @__PURE__ */ new Date(0);
|
|
6
|
+
return o.setFullYear(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate()), o.setHours(e.getUTCHours(), e.getUTCMinutes(), e.getUTCSeconds(), e.getUTCMilliseconds()), o;
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
g as toZonedTime
|
|
10
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __exports as e } from "../../../_virtual/defaults.js";
|
|
2
|
+
import a from "../../../_virtual/index.browser.js";
|
|
3
|
+
Object.defineProperty(e, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
});
|
|
6
|
+
e.headerDefaults = e.eventDefaults = void 0;
|
|
7
|
+
var r = a;
|
|
8
|
+
e.headerDefaults = function() {
|
|
9
|
+
return {
|
|
10
|
+
productId: "adamgibbons/ics",
|
|
11
|
+
method: "PUBLISH"
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
e.eventDefaults = function() {
|
|
15
|
+
return {
|
|
16
|
+
title: "Untitled event",
|
|
17
|
+
uid: (0, r.nanoid)(),
|
|
18
|
+
timestamp: Date.now()
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
e as default
|
|
23
|
+
};
|