@nylas/react 1.0.2-prealpha1 → 1.1.0-canary.4
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/add-circle-icon_22.entry-077661c3.cjs +1 -0
- package/dist/add-circle-icon_22.entry-f699d91e.js +1733 -0
- package/dist/{archive-icon_7.entry-91aaa1aa.js → archive-icon_7.entry-40b7ef3b.js} +20 -20
- package/dist/{archive-icon_7.entry-84d70dbf.cjs → archive-icon_7.entry-e8630de9.cjs} +1 -1
- package/dist/arrow-icon.entry-58246303.js +15 -0
- package/dist/{arrow-icon.entry-400a08fa.cjs → arrow-icon.entry-ffa53114.cjs} +1 -1
- package/dist/{bold-icon_3.entry-9ad35153.cjs → bold-icon_3.entry-106a4e77.cjs} +1 -1
- package/dist/{bold-icon_3.entry-4b2798a8.js → bold-icon_3.entry-f5f1643d.js} +4 -4
- package/dist/{calendar-cancel-icon.entry-fcb66929.cjs → calendar-cancel-icon.entry-6ae0fd0f.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-83ba884a.js → calendar-cancel-icon.entry-75b15b19.js} +4 -4
- package/dist/calendar-check-icon_2.entry-57339318.js +25 -0
- package/dist/calendar-check-icon_2.entry-c57f83f3.cjs +1 -0
- package/dist/{calendar-icon.entry-8f38af4a.js → calendar-icon.entry-2069fec6.js} +2 -2
- package/dist/{calendar-icon.entry-7bae38d7.cjs → calendar-icon.entry-492c2630.cjs} +1 -1
- package/dist/chevron-icon_3.entry-83df50c3.js +117 -0
- package/dist/chevron-icon_3.entry-878ff6df.cjs +1 -0
- package/dist/close-icon.entry-480c199d.js +15 -0
- package/dist/close-icon.entry-8015ca05.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-7e66a648.js → constants-6ee60d6d-4cd16450.js} +1656 -2374
- package/dist/{nylas-booked-event-card_10.entry-ed515326.cjs → constants-6ee60d6d-6c0540db.cjs} +6 -6
- package/dist/document-refresh-icon.entry-06f7972b.cjs +1 -0
- package/dist/document-refresh-icon.entry-09870b14.js +15 -0
- package/dist/elements/index.d.ts +31 -2
- package/dist/{forward-icon_6.entry-b60fcb35.js → forward-icon_6.entry-8bb201eb.js} +127 -127
- package/dist/{forward-icon_6.entry-3345af84.cjs → forward-icon_6.entry-eeecf2a2.cjs} +3 -3
- package/dist/{globe-icon.entry-8325e73e.cjs → globe-icon.entry-a690028c.cjs} +1 -1
- package/dist/{globe-icon.entry-e3fd373f.js → globe-icon.entry-d515cbfa.js} +4 -4
- package/dist/google-logo-icon_3.entry-2164cec1.js +258 -0
- package/dist/google-logo-icon_3.entry-b2b85284.cjs +1 -0
- package/dist/index-2b8437d6.cjs +30 -0
- package/dist/index-db0c5017.js +1824 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.es-2578c6a5-098d48d0.cjs +7 -0
- package/dist/{index-b30d446a-a90f84b2.js → index.es-2578c6a5-71441142.js} +833 -933
- package/dist/info-icon_2.entry-300ef196.js +34 -0
- package/dist/info-icon_2.entry-e286aaa5.cjs +1 -0
- package/dist/{loading-icon.entry-27410cf8.js → loading-icon.entry-6d8adaa4.js} +4 -4
- package/dist/{loading-icon.entry-b2096d2b.cjs → loading-icon.entry-dc40e97d.cjs} +1 -1
- package/dist/{mailbox-store-19f0c6c9-e3e8b4e5.js → mailbox-store-bb21512c-649a374c.js} +17 -16
- package/dist/mailbox-store-bb21512c-fc3c8c03.cjs +1 -0
- package/dist/nylas-additional-participants.entry-4afba192.js +83 -0
- package/dist/nylas-additional-participants.entry-db05e510.cjs +1 -0
- package/dist/nylas-booked-event-card_10.entry-1ebbe0c0.js +784 -0
- package/dist/nylas-booked-event-card_10.entry-6b6fdfae.cjs +1 -0
- package/dist/nylas-form-card.entry-70b20571.cjs +1 -0
- package/dist/nylas-form-card.entry-7bc23695.js +56 -0
- package/dist/nylas-if-state.entry-3829cb3d.js +96 -0
- package/dist/nylas-if-state.entry-ebeffe22.cjs +1 -0
- package/dist/nylas-list-folders.entry-191688f2.cjs +1 -0
- package/dist/{nylas-list-folders.entry-a5437201.js → nylas-list-folders.entry-7347e78d.js} +9 -8
- package/dist/{nylas-list-threads.entry-fd6cda61.js → nylas-list-threads.entry-432a8d8c.js} +5 -4
- package/dist/nylas-list-threads.entry-44658578.cjs +1 -0
- package/dist/nylas-login.entry-5311f0a7.js +75 -0
- package/dist/nylas-login.entry-db17a3d2.cjs +1 -0
- package/dist/{nylas-mailbox-pagination.entry-988214bc.js → nylas-mailbox-pagination.entry-20150fb2.js} +4 -3
- package/dist/nylas-mailbox-pagination.entry-9d3f5baa.cjs +1 -0
- package/dist/nylas-mailbox-toolbar-button.entry-6c0f7299.cjs +1 -0
- package/dist/{nylas-mailbox-toolbar-button.entry-c720e22a.js → nylas-mailbox-toolbar-button.entry-eec426d5.js} +11 -10
- package/dist/nylas-mailbox.entry-b6c758b9.js +136 -0
- package/dist/nylas-mailbox.entry-d41401e0.cjs +1 -0
- package/dist/{nylas-provider.entry-70721009.js → nylas-provider.entry-271cafd2.js} +46 -33
- package/dist/nylas-provider.entry-6173b721.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-0c75d39e.cjs +7 -0
- package/dist/nylas-scheduler-editor.entry-b51ad4b1.js +2192 -0
- package/dist/nylas-scheduling.entry-081c8825.cjs +1 -0
- package/dist/nylas-scheduling.entry-0a8d1da8.js +237 -0
- package/dist/{nylas-threads-refresh.entry-b7f9e93f.js → nylas-threads-refresh.entry-72dd854e.js} +6 -5
- package/dist/nylas-threads-refresh.entry-c3509e6a.cjs +1 -0
- package/dist/nylas-threads-search.entry-16a59ef6.cjs +1 -0
- package/dist/{nylas-threads-search.entry-95afea9c.js → nylas-threads-search.entry-4750a187.js} +15 -14
- package/dist/nylas-view-thread.entry-27df3349.cjs +1 -0
- package/dist/{nylas-view-thread.entry-165173b1.js → nylas-view-thread.entry-c6adce43.js} +5 -4
- package/dist/people-icon.entry-342be0c8.js +15 -0
- package/dist/people-icon.entry-35252ca9.cjs +1 -0
- package/dist/play-icon_2.entry-0787352c.js +25 -0
- package/dist/play-icon_2.entry-f83fa92a.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +92 -61
- package/dist/{refresh-icon.entry-e48a338f.js → refresh-icon.entry-8fbabfe7.js} +2 -2
- package/dist/{refresh-icon.entry-601cac89.cjs → refresh-icon.entry-ddbc5446.cjs} +1 -1
- package/dist/{register-component-152c6ad2-a06f58c2.js → register-component-dc659dc3-e43e8fae.js} +2 -2
- package/dist/{register-component-152c6ad2-0df7215b.cjs → register-component-dc659dc3-fb85ee68.cjs} +1 -1
- package/dist/scheduler-config-store-51ee4f42-66f8c2ac.js +14 -0
- package/dist/scheduler-config-store-51ee4f42-d7d9c25d.cjs +1 -0
- package/dist/scheduler-store-72116723-ce4c7a69.cjs +1 -0
- package/dist/{scheduler-store-7d48e682-0c0c3991.js → scheduler-store-72116723-e5f87122.js} +100 -95
- package/dist/time-period-selector.entry-333942a8.js +78 -0
- package/dist/time-period-selector.entry-78d5b3c2.cjs +1 -0
- package/dist/translate-icon.entry-87a62108.js +15 -0
- package/dist/translate-icon.entry-cb19864c.cjs +1 -0
- package/dist/utils-c00bdc3c-89ab163d.js +2111 -0
- package/dist/utils-c00bdc3c-94b9c3b6.cjs +8 -0
- package/dist/warning-icon.entry-50755d91.cjs +1 -0
- package/dist/warning-icon.entry-7a72e24a.js +15 -0
- package/package.json +7 -4
- package/dist/add-circle-icon.entry-2ccb238b.cjs +0 -1
- package/dist/add-circle-icon.entry-35d6aa07.js +0 -15
- package/dist/arrow-icon.entry-8b2e96a6.js +0 -15
- package/dist/calendar-check-icon_3.entry-903e2d82.js +0 -35
- package/dist/calendar-check-icon_3.entry-a16ce05e.cjs +0 -1
- package/dist/chevron-icon.entry-58366662.cjs +0 -1
- package/dist/chevron-icon.entry-5e11cef5.js +0 -15
- package/dist/close-icon_2.entry-011d9cf4.js +0 -25
- package/dist/close-icon_2.entry-83088b9a.cjs +0 -1
- package/dist/document-refresh-icon.entry-071ffd66.cjs +0 -1
- package/dist/document-refresh-icon.entry-9083a2e9.js +0 -15
- package/dist/duration-bddc4a13-05d3e3e2.cjs +0 -1
- package/dist/duration-bddc4a13-179ce826.js +0 -41
- package/dist/index-3b6f5cd5.cjs +0 -30
- package/dist/index-630f4e87.js +0 -1498
- package/dist/index-b30d446a-cbbef925.cjs +0 -7
- package/dist/mailbox-store-19f0c6c9-a0cbfa97.cjs +0 -1
- package/dist/nylas-if-state_3.entry-504be976.cjs +0 -1
- package/dist/nylas-if-state_3.entry-e96d01f1.js +0 -291
- package/dist/nylas-list-folders.entry-866361cc.cjs +0 -1
- package/dist/nylas-list-threads.entry-04989295.cjs +0 -1
- package/dist/nylas-mailbox-pagination.entry-e0bd4aef.cjs +0 -1
- package/dist/nylas-mailbox-toolbar-button.entry-3d772b26.cjs +0 -1
- package/dist/nylas-open-hours-picker.entry-6bdc7c73.js +0 -186
- package/dist/nylas-open-hours-picker.entry-881b6db7.cjs +0 -1
- package/dist/nylas-provider.entry-8d9a844b.cjs +0 -1
- package/dist/nylas-scheduler.entry-7321e18f.js +0 -230
- package/dist/nylas-scheduler.entry-e82977fb.cjs +0 -1
- package/dist/nylas-threads-refresh.entry-477e68e4.cjs +0 -1
- package/dist/nylas-threads-search.entry-c5854641.cjs +0 -1
- package/dist/nylas-view-thread.entry-8b72cbdb.cjs +0 -1
- package/dist/play-icon_2.entry-ed5877e3.js +0 -25
- package/dist/play-icon_2.entry-f23ed6c1.cjs +0 -1
- package/dist/scheduler-store-7d48e682-674705ef.cjs +0 -1
- package/dist/search-icon_3.entry-292138c3.js +0 -101
- package/dist/search-icon_3.entry-8e555357.cjs +0 -1
- package/dist/utils-5074a070-ce33ee6b.js +0 -119
- package/dist/utils-5074a070-d5ba6add.cjs +0 -2
package/dist/react.js
CHANGED
|
@@ -1,66 +1,97 @@
|
|
|
1
|
+
import { A as n, e as l, f as c, B as i, i as t, C as r, j as y, k as N, l as I, m as d, n as C, o as m, p, D as f, q as h, t as u, v as k, G as g, w as S, I as E, x as P, y as T, L as v, z as L, E as B, M as w, J as b, K as F, O as M, P as x, Q as A, R as D, S as R, T as G, U as W, V as q, W as z, X as V, Y as j, Z as O, _ as U, $ as H, a0 as J, a1 as K, a2 as Q, a3 as X, N as Y, a4 as Z, a5 as _, a6 as $, a7 as aa, a8 as sa, a9 as oa, aa as ea, ab as na, ac as la, ad as ca, ae as ia, af as ta, ag as ra, ah as ya, ai as Na, aj as Ia, ak as da, al as Ca, am as ma, an as pa, ao as fa, ap as ha, aq as ua, ar as ka, as as ga, at as Sa, au as Ea, av as Pa, aw as Ta, ax as va, ay as La, az as Ba, aA as wa, aB as ba, aC as Fa, aD as Ma, aE as xa, aF as Aa, aG as Da, aH as Ra, aI as Ga, b as Wa, d as qa, s as za, u as Va } from "./index-db0c5017.js";
|
|
1
2
|
import "react";
|
|
2
|
-
import { A as l, e as n, i as c, B as r, C as i, j as I, k as y, l as t, m as N, n as d, D as C, o as m, p as h, G as p, I as S, q as k, L as b, N as u, s as P, t as T, v as f, w as g, x as v, y as w, z as x, E as B, J as E, K as L, M, O as R, P as A, Q as F, R as D, S as V, T as z, U as G, V as O, W as U, X as W, Y as j, Z as q, _ as H, $ as J, a0 as K, a1 as Q, a2 as X, a3 as Y, a4 as Z, a5 as _, a6 as $, a7 as aa, a8 as sa, a9 as oa, aa as ea, ab as la, ac as na, ad as ca, ae as ra, b as ia, d as Ia, u as ya } from "./index-630f4e87.js";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
n as AddCircleIcon,
|
|
6
|
+
l as ArchiveIcon,
|
|
7
7
|
c as ArrowIcon,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
y as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
d as
|
|
15
|
-
C as
|
|
16
|
-
m as
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
v as
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
M as
|
|
34
|
-
|
|
35
|
-
A as
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
H as
|
|
47
|
-
J as
|
|
48
|
-
K as
|
|
49
|
-
Q as
|
|
50
|
-
X as
|
|
51
|
-
Y as
|
|
52
|
-
Z as
|
|
53
|
-
_ as
|
|
54
|
-
$ as
|
|
55
|
-
aa as
|
|
56
|
-
sa as
|
|
57
|
-
oa as
|
|
58
|
-
ea as
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
ca as
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
ya as
|
|
8
|
+
i as BoldIcon,
|
|
9
|
+
t as ButtonComponent,
|
|
10
|
+
r as CalendarCancelIcon,
|
|
11
|
+
y as CalendarCheckIcon,
|
|
12
|
+
N as CalendarIcon,
|
|
13
|
+
I as CalendarInfoIcon,
|
|
14
|
+
d as CalendarPatternsIcon,
|
|
15
|
+
C as CheckmarkCircleIcon,
|
|
16
|
+
m as ChevronIcon,
|
|
17
|
+
p as CloseIcon,
|
|
18
|
+
f as DocumentRefreshIcon,
|
|
19
|
+
h as FlowIcon,
|
|
20
|
+
u as FolderIcon,
|
|
21
|
+
k as ForwardIcon,
|
|
22
|
+
g as GlobeIcon,
|
|
23
|
+
S as GoogleLogoIcon,
|
|
24
|
+
E as InboxIcon,
|
|
25
|
+
P as InfoIcon,
|
|
26
|
+
T as ItalicIcon,
|
|
27
|
+
v as LoadingIcon,
|
|
28
|
+
L as LocationIcon,
|
|
29
|
+
B as LocationOffIcon,
|
|
30
|
+
w as MicrosoftLogoIcon,
|
|
31
|
+
b as MultiSelectDropdown,
|
|
32
|
+
F as NylasAdditionalParticipants,
|
|
33
|
+
M as NylasAvailabilityPicker,
|
|
34
|
+
x as NylasBookedEventCard,
|
|
35
|
+
A as NylasBookingCalendarPicker,
|
|
36
|
+
D as NylasBookingForm,
|
|
37
|
+
R as NylasBufferTime,
|
|
38
|
+
G as NylasCalendarPicker,
|
|
39
|
+
W as NylasCancelBookingForm,
|
|
40
|
+
q as NylasCancelledEventCard,
|
|
41
|
+
z as NylasComposer,
|
|
42
|
+
V as NylasCustomBookingFlow,
|
|
43
|
+
j as NylasDatePicker,
|
|
44
|
+
O as NylasEditorTabs,
|
|
45
|
+
U as NylasEventDescription,
|
|
46
|
+
H as NylasEventDuration,
|
|
47
|
+
J as NylasEventInfo,
|
|
48
|
+
K as NylasEventLimits,
|
|
49
|
+
Q as NylasEventTitle,
|
|
50
|
+
X as NylasFormCard,
|
|
51
|
+
Y as NylasIdentityRequestWrapper,
|
|
52
|
+
Z as NylasIfState,
|
|
53
|
+
_ as NylasLimitFutureBookings,
|
|
54
|
+
$ as NylasListFolders,
|
|
55
|
+
aa as NylasListThreads,
|
|
56
|
+
sa as NylasLocaleSwitch,
|
|
57
|
+
oa as NylasLocationComponent,
|
|
58
|
+
ea as NylasLogin,
|
|
59
|
+
na as NylasLogo,
|
|
60
|
+
la as NylasMailbox,
|
|
61
|
+
ca as NylasMailboxPagination,
|
|
62
|
+
ia as NylasMailboxToolbarButton,
|
|
63
|
+
ta as NylasMinCancellationNotice,
|
|
64
|
+
ra as NylasNotification,
|
|
65
|
+
ya as NylasProvider,
|
|
66
|
+
Na as NylasSchedulerEditor,
|
|
67
|
+
Ia as NylasScheduling,
|
|
68
|
+
da as NylasSelectedEventCard,
|
|
69
|
+
Ca as NylasSummarizeMessageButton,
|
|
70
|
+
ma as NylasThreadsRefresh,
|
|
71
|
+
pa as NylasThreadsSearch,
|
|
72
|
+
fa as NylasTimeWindowPicker,
|
|
73
|
+
ha as NylasTimeslotPicker,
|
|
74
|
+
ua as NylasViewEmail,
|
|
75
|
+
ka as NylasViewThread,
|
|
76
|
+
ga as PeopleIcon,
|
|
77
|
+
Sa as PlayIcon,
|
|
78
|
+
Ea as RefreshIcon,
|
|
79
|
+
Pa as ReplyAllIcon,
|
|
80
|
+
Ta as ReplyIcon,
|
|
81
|
+
va as SearchIcon,
|
|
82
|
+
La as SelectDropdown,
|
|
83
|
+
Ba as SentIcon,
|
|
84
|
+
wa as SpamIcon,
|
|
85
|
+
ba as StarIcon,
|
|
86
|
+
Fa as StopIcon,
|
|
87
|
+
Ma as TimePeriodSelector,
|
|
88
|
+
xa as TooltipComponent,
|
|
89
|
+
Aa as TranslateIcon,
|
|
90
|
+
Da as TrashIcon,
|
|
91
|
+
Ra as UnderlineIcon,
|
|
92
|
+
Ga as WarningIcon,
|
|
93
|
+
Wa as applyPolyfills,
|
|
94
|
+
qa as defineCustomElements,
|
|
95
|
+
za as setNonce,
|
|
96
|
+
Va as useNylasMailboxElement
|
|
66
97
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as t, h as c } from "./index-
|
|
1
|
+
import { r as t, h as c } from "./index-db0c5017.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
const e = ".sc-refresh-icon-h{display:flex}", l = e, h = class {
|
|
@@ -6,7 +6,7 @@ const e = ".sc-refresh-icon-h{display:flex}", l = e, h = class {
|
|
|
6
6
|
t(this, s), this.width = "15", this.height = "15";
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return c("svg", { key: "
|
|
9
|
+
return c("svg", { key: "6f08ec538071d37d3ff537182375dd582350bb8e", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 32 32", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, c("path", { key: "dbaaf840fa4825f6df0b9fd8f5f9d81ef1b6c7ad", d: "M15.544 28.080c-0.002-0.006-0.008-0.010-0.012-0.015l-2.873-4.489c-0.204-0.335-0.646-0.454-0.992-0.266l-0.256 0.157c-0.344 0.188-0.337 0.673-0.133 1.008l1.841 2.857c-0.157-0.035-0.316-0.063-0.471-0.103-3.224-0.843-5.953-3.026-7.485-5.988-1.448-2.797-1.72-5.99-0.766-8.992s3.118-5.452 5.915-6.899c0.476-0.247 0.662-0.832 0.416-1.308-0.246-0.477-0.832-0.663-1.308-0.416-3.258 1.686-5.763 4.54-6.874 8.036s-0.794 7.215 0.892 10.473c1.786 3.448 4.963 5.989 8.72 6.973 0.043 0.011 0.087 0.017 0.13 0.028l-2.541 1.288c-0.344 0.189-0.458 0.613-0.254 0.948l0.098 0.256c0.205 0.335 0.557 0.454 0.9 0.266l4.651-2.381c0.006-0.004 0.012-0.003 0.018-0.007l0.312-0.171c0.172-0.095 0.287-0.249 0.332-0.422 0.047-0.172 0.025-0.364-0.076-0.531zM28.559 10.025c-1.783-3.447-4.862-5.988-8.618-6.972-0.267-0.070-0.541-0.124-0.814-0.179l2.494-1.265c0.344-0.189 0.549-0.614 0.345-0.949l-0.099-0.255c-0.205-0.336-0.648-0.454-0.991-0.267l-4.651 2.381c-0.006 0.003-0.012 0.002-0.018 0.006l-0.312 0.171c-0.173 0.095-0.287 0.249-0.332 0.422-0.047 0.172-0.025 0.364 0.077 0.53l0.185 0.304c0.003 0.006 0.008 0.010 0.012 0.016l2.873 4.489c0.203 0.335 0.646 0.454 0.991 0.266l0.226-0.157c0.344-0.188 0.366-0.673 0.163-1.008l-1.85-2.87c0.407 0.063 0.811 0.138 1.207 0.242 3.226 0.845 5.856 3.027 7.387 5.986 1.448 2.797 1.72 5.99 0.765 8.991s-3.020 5.451-5.818 6.901c-0.476 0.247-0.662 0.831-0.415 1.308 0.172 0.332 0.511 0.524 0.863 0.524 0.15 0 0.302-0.035 0.446-0.109 3.259-1.686 5.664-4.54 6.776-8.035 1.111-3.497 0.794-7.217-0.893-10.473z" }));
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
h.style = l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-2b8437d6.cjs");require("react");require("react-dom");const t=".sc-refresh-icon-h{display:flex}",i=t,c=class{constructor(s){e.registerInstance(this,s),this.width="15",this.height="15"}render(){return e.h("svg",{key:"6f08ec538071d37d3ff537182375dd582350bb8e",fill:"auto",width:this.width,height:this.height,viewBox:"0 0 32 32",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"dbaaf840fa4825f6df0b9fd8f5f9d81ef1b6c7ad",d:"M15.544 28.080c-0.002-0.006-0.008-0.010-0.012-0.015l-2.873-4.489c-0.204-0.335-0.646-0.454-0.992-0.266l-0.256 0.157c-0.344 0.188-0.337 0.673-0.133 1.008l1.841 2.857c-0.157-0.035-0.316-0.063-0.471-0.103-3.224-0.843-5.953-3.026-7.485-5.988-1.448-2.797-1.72-5.99-0.766-8.992s3.118-5.452 5.915-6.899c0.476-0.247 0.662-0.832 0.416-1.308-0.246-0.477-0.832-0.663-1.308-0.416-3.258 1.686-5.763 4.54-6.874 8.036s-0.794 7.215 0.892 10.473c1.786 3.448 4.963 5.989 8.72 6.973 0.043 0.011 0.087 0.017 0.13 0.028l-2.541 1.288c-0.344 0.189-0.458 0.613-0.254 0.948l0.098 0.256c0.205 0.335 0.557 0.454 0.9 0.266l4.651-2.381c0.006-0.004 0.012-0.003 0.018-0.007l0.312-0.171c0.172-0.095 0.287-0.249 0.332-0.422 0.047-0.172 0.025-0.364-0.076-0.531zM28.559 10.025c-1.783-3.447-4.862-5.988-8.618-6.972-0.267-0.070-0.541-0.124-0.814-0.179l2.494-1.265c0.344-0.189 0.549-0.614 0.345-0.949l-0.099-0.255c-0.205-0.336-0.648-0.454-0.991-0.267l-4.651 2.381c-0.006 0.003-0.012 0.002-0.018 0.006l-0.312 0.171c-0.173 0.095-0.287 0.249-0.332 0.422-0.047 0.172-0.025 0.364 0.077 0.53l0.185 0.304c0.003 0.006 0.008 0.010 0.012 0.016l2.873 4.489c0.203 0.335 0.646 0.454 0.991 0.266l0.226-0.157c0.344-0.188 0.366-0.673 0.163-1.008l-1.85-2.87c0.407 0.063 0.811 0.138 1.207 0.242 3.226 0.845 5.856 3.027 7.387 5.986 1.448 2.797 1.72 5.99 0.765 8.991s-3.020 5.451-5.818 6.901c-0.476 0.247-0.662 0.831-0.415 1.308 0.172 0.332 0.511 0.524 0.863 0.524 0.15 0 0.302-0.035 0.446-0.109 3.259-1.686 5.664-4.54 6.776-8.035 1.111-3.497 0.794-7.217-0.893-10.473z"}))}};c.style=i;exports.refresh_icon=c;
|
package/dist/{register-component-152c6ad2-a06f58c2.js → register-component-dc659dc3-e43e8fae.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d,
|
|
2
|
-
import { g as P } from "./index-
|
|
1
|
+
import { d, B as m } from "./utils-c00bdc3c-89ab163d.js";
|
|
2
|
+
import { g as P } from "./index-db0c5017.js";
|
|
3
3
|
function b(e, r, i = "registerComponent") {
|
|
4
4
|
return new CustomEvent(i, {
|
|
5
5
|
bubbles: !0,
|
package/dist/{register-component-152c6ad2-0df7215b.cjs → register-component-dc659dc3-fb85ee68.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("./utils-
|
|
1
|
+
"use strict";const s=require("./utils-c00bdc3c-94b9c3b6.cjs"),m=require("./index-2b8437d6.cjs");function P(e,o,u="registerComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function b(e,o,u="unregisterComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function T(e){return(o,u)=>{const r=e.name;s.debug(`[${r}] Registering component ${r} being called on ${u}`);const l=o.componentWillLoad;if(!l){s.error(`[${r}] componentWillLoad lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const p=o.connectedCallback;if(!p){s.error(`[${r}] connectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const a=o.disconnectedCallback;if(!a){s.error(`[${r}] disconnectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}if(e.storeToProps&&e.stateToProps){const n=Array.from(e.storeToProps.values()),t=Array.from(e.stateToProps.values()),i=n.filter(c=>t.includes(c));if(i.length>0){s.error(`[${r}] Overlapping prop keys detected in ${r} for storeToProps and stateToProps. Make sure to only define them once. Overlapping keys: ${i.join(", ")}`);return}}const d=new Map;e.eventToProps&&Object.keys(e.eventToProps).forEach(n=>{var t;d.set(n,(t=e.eventToProps)==null?void 0:t[n])}),o.connectedCallback=function(){s.debug(`[~${r}] connectedCallback called`);const n=p==null?void 0:p.call(this),t=m.getElement(this);return t.dataset.nylasId||(Object.defineProperty(t,"registerNylasComponent",{get(){return!0},enumerable:!0}),Object.defineProperty(t,"stateToProps",{get(){return e.stateToProps},enumerable:!0}),Object.defineProperty(t,"getStoresToProp",{get(){return e.getStoresToProp},enumerable:!0}),Object.defineProperty(t,"storeToProps",{get(){return e.storeToProps},enumerable:!0}),Object.defineProperty(t,"eventToProps",{get(){return d},enumerable:!0}),Object.defineProperty(t,"authToProp",{get(){return e.authToProp},enumerable:!0}),Object.defineProperty(t,"connectorToProp",{get(){return e.connectorToProp},enumerable:!0})),n},e.fireRegisterEvent&&(o.componentWillLoad=function(){const n=l==null?void 0:l.call(this),t=m.getElement(this),i={element:t,...e,eventToProps:d},c=P(o,i,e.registrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired registration event`),n},o.disconnectedCallback=function(){const n=a==null?void 0:a.call(this),t=m.getElement(this),i={element:t,...e,eventToProps:d},c=b(o,i,e.unregistrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired unregistration event`),n})}}exports.RegisterComponent=T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("./index-2b8437d6.cjs");function n(e={}){const r={config:{},configurations:[],calendars:[],currentUser:null,...e};return t.createStore(r)}exports.CreateNylasSchedulerConfigStore=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const v=require("./utils-c00bdc3c-94b9c3b6.cjs"),C=require("./index-2b8437d6.cjs");exports.ErrorCategory=void 0;(function(n){n.Component="component",n.Api="api",n.Auth="auth"})(exports.ErrorCategory||(exports.ErrorCategory={}));var w;(function(n){n.endtime_not_in_future="endtime_not_in_future",n.no_booking_info="no_booking_info",n.no_timeslot_selected="no_timeslot_selected",n.no_booking_id="no_booking_id",n.invalid_start_time="invalid_start_time",n.invalid_end_time="invalid_end_time",n.invalid_timezone="invalid_timezone"})(w||(w={}));var b;(function(n){n.invalid_session="invalid_session",n.general_error="general_error",n.internal_error="internal_error",n.invalid_request_error="invalid_request_error",n.timeslot_not_available="timeslot_not_available"})(b||(b={}));class D{constructor(){this.component=t=>{const e=exports.ErrorCategory.Component,s=`${t} error`;return{endtime_not_in_future:(i='"endtime" can not be in the future')=>({title:s,message:i,category:e}),no_booking_info:(i="No booking info provided")=>({title:s,message:i,category:e}),no_timeslot_selected:(i="No timeslot selected")=>({title:s,message:i,category:e}),no_booking_id:(i="No booking id provided")=>({title:s,message:i,category:e}),invalid_start_time:(i="Invalid start time")=>({title:s,message:i,category:e}),invalid_end_time:(i="Invalid end time")=>({title:s,message:i,category:e}),invalid_timezone:(i="Invalid timezone")=>({title:s,message:i,category:e})}},this.api=t=>{const e=exports.ErrorCategory.Api,s=`${t} error`;return{invalid_session:i=>({title:s,message:i,category:e}),general_error:i=>({title:s,message:i,category:e}),internal_error:i=>({title:s,message:i,category:e}),invalid_request_error:i=>({title:s,message:i,category:e}),timeslot_not_available:i=>({title:s,message:i,category:e})}}}}class R{constructor({schedulerAPIURL:t,schedulerStore:e,sessionId:s,configId:i}){this.errors=new D,this.schedulerStore=e,this.schedulerAPIURL=t,this.sessionId=s,this.configId=i}getHeaders(){return this.configId?{}:{Authorization:`Bearer ${this.sessionId}`}}async makeAPIRequest(t,e,s,i={}){try{const r=new URL(this.schedulerAPIURL);return r.pathname=t,await(await fetch(decodeURIComponent(r.toString()),{method:e,headers:{"Content-Type":"application/json",...i},body:s})).json()}catch(r){return{error:{message:r.message,title:"API request failed",type:"api"}}}}selectDate(t){this.schedulerStore.set("selectedDate",t),this.schedulerStore.set("selectedTimeslot",null)}selectTime(t){this.schedulerStore.set("selectedTimeslot",t)}selectTimezone(t){this.schedulerStore.set("selectedTimezone",t)}toggleAdditionalData(t){this.schedulerStore.set("showBookingForm",t)}setParticipantName(t){const{bookingInfo:e}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...e,primaryParticipant:{...e==null?void 0:e.primaryParticipant,name:t}})}setParticipantEmail(t){const{bookingInfo:e}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...e,primaryParticipant:{...e==null?void 0:e.primaryParticipant,email:t}})}async setReschedule(t){const e=new Date;this.schedulerStore.set("rescheduleBookingId",t),this.schedulerStore.set("selectedTimeslot",null),this.schedulerStore.set("eventInfo",null),this.schedulerStore.set("showBookingForm",!1);const s=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3,i=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3,r=await this.getAvailability(s,i),a=this.schedulerStore.get("availability").find(l=>new Date(l.start_time)>new Date);let u=e;return a&&(u=a.start_time),this.schedulerStore.set("selectedDate",u),r}async setCancel(t){this.schedulerStore.set("cancelBookingId",t)}async bookTimeslot(t){var g;this.schedulerStore.set("isLoading",!0);const{selectedTimeslot:e,bookingInfo:s}=this.schedulerStore.state;if(!t&&!s)return{error:this.errors.component("Booking").no_booking_info()};const i=(t==null?void 0:t.timeslot)||e;if(!i)return{error:this.errors.component("Create Booking").no_timeslot_selected()};const r=t?t==null?void 0:t.primaryParticipant:s==null?void 0:s.primaryParticipant,a=t?(t==null?void 0:t.guests)||[]:(s==null?void 0:s.guests)||[],u=t?{...t==null?void 0:t.additionalFields,guests:a}:{...s==null?void 0:s.additionalFields,guests:a},l=this.getHeaders(),p=`/v3/scheduling/bookings${this.configId?`?configuration_id=${this.configId}`:""}`,d=await this.makeAPIRequest(decodeURIComponent(p),"POST",JSON.stringify({additional_fields:u,guest:{...r},start_time:i.start_time.getTime()/1e3,end_time:i.end_time.getTime()/1e3}),l);if("error"in d){this.schedulerStore.set("isLoading",!1);const c=(g=d.error)==null?void 0:g.type;let o=d.error;return c&&c in this.errors.api("Create Booking")&&(o=this.errors.api("Create Booking")[c]((o==null?void 0:o.message)||(o==null?void 0:o.title)||"Something went wrong")),{error:o}}return"data"in d&&this.schedulerStore.set("eventInfo",d==null?void 0:d.data),this.schedulerStore.set("isLoading",!1),d}async getAvailability(t=0,e=0){var p,d,g;this.schedulerStore.set("isLoading",!0);const s=new URLSearchParams,i=new Date,r=i.getTime();if(e&&e<r/1e3)return this.schedulerStore.set("isLoading",!1),{error:this.errors.component("Get Availability").endtime_not_in_future()};if(!t){const c=new Date(i.getFullYear(),i.getMonth(),1);t=Math.floor(c.getTime()/1e3)}if(!e){const c=new Date(i.getFullYear(),i.getMonth()+1,0);e=Math.floor(c.getTime()/1e3)}s.append("start_time",encodeURIComponent(t.toString())),s.append("end_time",encodeURIComponent(e.toString())),this.configId&&s.append("configuration_id",encodeURIComponent(this.configId));const a=s.toString(),u=`/v3/scheduling/availability${a?`?${a}`:""}`,l=this.getHeaders(),h=await this.makeAPIRequest(decodeURIComponent(u),"GET",void 0,l);if("error"in h){this.schedulerStore.set("availability",[]),this.schedulerStore.set("isLoading",!1);const c=(p=h.error)==null?void 0:p.type;let o=h.error;return c&&c in this.errors.api("Get Availability")&&(o=this.errors.api("Get Availability")[c]((o==null?void 0:o.message)||(o==null?void 0:o.title)||"Something went wrong")),{error:o}}if("data"in h){const o=(((g=(d=h.data)==null?void 0:d.time_slots)==null?void 0:g.map(m=>({...m,start_time:new Date(m.start_time*1e3),end_time:new Date(m.end_time*1e3)})))||[]).filter(m=>m.start_time.getTime()>r);this.schedulerStore.set("availability",o)}return this.schedulerStore.set("isLoading",!1),h}async cancelBooking(t){var a;if(this.schedulerStore.set("isLoading",!0),!t)return{error:this.errors.component("Cancel Booking").no_booking_id()};const e=this.configId?`?configuration_id=${this.configId}`:"",s=`/v3/scheduling/bookings/${t}${e}`,i=this.getHeaders(),r=await this.makeAPIRequest(decodeURIComponent(s),"DELETE",JSON.stringify({action:"cancel"}),i);if("error"in r){this.schedulerStore.set("isLoading",!1);const u=(a=r.error)==null?void 0:a.type;let l=r.error;return u&&u in this.errors.api("Cancel Booking")&&(l=this.errors.api("Cancel Booking")[u]((l==null?void 0:l.message)||(l==null?void 0:l.title)||"Something went wrong")),{error:l}}return this.schedulerStore.set("cancelledEventInfo",{booking_id:t}),this.schedulerStore.set("isLoading",!1),r}async rescheduleBooking(t,e){var y;if(this.schedulerStore.set("isLoading",!0),!t)return{error:this.errors.component("Reschedule Booking").no_booking_id()};const s=this.errors.api("Reschedule Booking"),i=this.errors.component("Reschedule Booking"),{bookingInfo:r,selectedTimeslot:a,selectedTimezone:u}=this.schedulerStore.state,{startTime:l,endTime:h,timezone:p}=e,d=l||(a==null?void 0:a.start_time);if(!d)return{error:i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const g=h||(a==null?void 0:a.end_time);if(!g)return{error:i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const c=p||u;if(!c)return{error:i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')};const o=e?e==null?void 0:e.primaryParticipant:r==null?void 0:r.primaryParticipant,m=e?(e==null?void 0:e.guests)||[]:(r==null?void 0:r.guests)||[],I=e?{...e==null?void 0:e.additionalFields,guests:m}:{...r==null?void 0:r.additionalFields,guests:m},P=this.configId?`?configuration_id=${this.configId}`:"",k=`/v3/scheduling/bookings/${t}${P}`,T=this.getHeaders(),_=await this.makeAPIRequest(decodeURIComponent(k),"PATCH",JSON.stringify({start_time:d.getTime()/1e3,end_time:g.getTime()/1e3,time_zone:c,additional_fields:I,guest:{...o}}),T);if("error"in _){this.schedulerStore.set("isLoading",!1);const S=(y=_.error)==null?void 0:y.type;let f=_.error;S&&S in s&&(f=s[S]((f==null?void 0:f.message)||(f==null?void 0:f.title)||"Something went wrong"))}return"data"in _&&this.schedulerStore.set("eventInfo",_==null?void 0:_.data),this.schedulerStore.set("isLoading",!1),_}}function L(n={}){const t={selectedDate:null,selectedLanguage:navigator.language,selectedTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,selectedTimeslot:null,showBookingForm:!1,selectableDates:null,availability:[],state:"ready",eventInfo:null,cancelledEventInfo:null,isLoading:!1,nylasBranding:!0,...n};v.debug("[defaultNylasStoreState]: ",t);const e=C.createStore(t);return e.onChange("availability",s=>{v.debug("[availability]: ",s);const i=s.map(r=>r.start_time);v.debug("[selectableDates]: ",i),e.set("selectableDates",i)}),e.reset=()=>{for(const s in t){const i=t[s];e.set(s,i)}},e}exports.CreateNylasSchedulerStore=L;exports.NylaSchedulerAPIConnector=R;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { d as y } from "./utils-
|
|
2
|
-
import {
|
|
3
|
-
var
|
|
4
|
-
(function(
|
|
5
|
-
|
|
6
|
-
})(
|
|
7
|
-
var
|
|
8
|
-
(function(
|
|
9
|
-
|
|
10
|
-
})(
|
|
11
|
-
var
|
|
12
|
-
(function(
|
|
13
|
-
|
|
14
|
-
})(
|
|
15
|
-
class
|
|
1
|
+
import { d as y } from "./utils-c00bdc3c-89ab163d.js";
|
|
2
|
+
import { a as R } from "./index-db0c5017.js";
|
|
3
|
+
var S;
|
|
4
|
+
(function(r) {
|
|
5
|
+
r.Component = "component", r.Api = "api", r.Auth = "auth";
|
|
6
|
+
})(S || (S = {}));
|
|
7
|
+
var I;
|
|
8
|
+
(function(r) {
|
|
9
|
+
r.endtime_not_in_future = "endtime_not_in_future", r.no_booking_info = "no_booking_info", r.no_timeslot_selected = "no_timeslot_selected", r.no_booking_id = "no_booking_id", r.invalid_start_time = "invalid_start_time", r.invalid_end_time = "invalid_end_time", r.invalid_timezone = "invalid_timezone";
|
|
10
|
+
})(I || (I = {}));
|
|
11
|
+
var P;
|
|
12
|
+
(function(r) {
|
|
13
|
+
r.invalid_session = "invalid_session", r.general_error = "general_error", r.internal_error = "internal_error", r.invalid_request_error = "invalid_request_error", r.timeslot_not_available = "timeslot_not_available";
|
|
14
|
+
})(P || (P = {}));
|
|
15
|
+
class L {
|
|
16
16
|
constructor() {
|
|
17
17
|
this.component = (t) => {
|
|
18
|
-
const e =
|
|
18
|
+
const e = S.Component, s = `${t} error`;
|
|
19
19
|
return {
|
|
20
20
|
endtime_not_in_future: (i = '"endtime" can not be in the future') => ({
|
|
21
21
|
title: s,
|
|
@@ -54,7 +54,7 @@ class R {
|
|
|
54
54
|
})
|
|
55
55
|
};
|
|
56
56
|
}, this.api = (t) => {
|
|
57
|
-
const e =
|
|
57
|
+
const e = S.Api, s = `${t} error`;
|
|
58
58
|
return {
|
|
59
59
|
invalid_session: (i) => ({
|
|
60
60
|
title: s,
|
|
@@ -85,14 +85,19 @@ class R {
|
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
class
|
|
89
|
-
constructor({ schedulerAPIURL: t, schedulerStore: e, sessionId: s }) {
|
|
90
|
-
this.errors = new
|
|
88
|
+
class C {
|
|
89
|
+
constructor({ schedulerAPIURL: t, schedulerStore: e, sessionId: s, configId: i }) {
|
|
90
|
+
this.errors = new L(), this.schedulerStore = e, this.schedulerAPIURL = t, this.sessionId = s, this.configId = i;
|
|
91
|
+
}
|
|
92
|
+
getHeaders() {
|
|
93
|
+
return this.configId ? {} : {
|
|
94
|
+
Authorization: `Bearer ${this.sessionId}`
|
|
95
|
+
};
|
|
91
96
|
}
|
|
92
97
|
async makeAPIRequest(t, e, s, i = {}) {
|
|
93
98
|
try {
|
|
94
|
-
const
|
|
95
|
-
return
|
|
99
|
+
const n = new URL(this.schedulerAPIURL);
|
|
100
|
+
return n.pathname = t, await (await fetch(decodeURIComponent(n.toString()), {
|
|
96
101
|
method: e,
|
|
97
102
|
headers: {
|
|
98
103
|
"Content-Type": "application/json",
|
|
@@ -100,10 +105,10 @@ class z {
|
|
|
100
105
|
},
|
|
101
106
|
body: s
|
|
102
107
|
})).json();
|
|
103
|
-
} catch (
|
|
108
|
+
} catch (n) {
|
|
104
109
|
return {
|
|
105
110
|
error: {
|
|
106
|
-
message:
|
|
111
|
+
message: n.message,
|
|
107
112
|
title: "API request failed",
|
|
108
113
|
type: "api"
|
|
109
114
|
}
|
|
@@ -144,10 +149,10 @@ class z {
|
|
|
144
149
|
}
|
|
145
150
|
async setReschedule(t) {
|
|
146
151
|
const e = /* @__PURE__ */ new Date();
|
|
147
|
-
this.schedulerStore.set("rescheduleBookingId", t), this.schedulerStore.set("selectedTimeslot", null), this.schedulerStore.set("
|
|
148
|
-
const s = new Date(e.getFullYear(), e.getMonth(), 1).getTime() / 1e3, i = new Date(e.getFullYear(), e.getMonth() + 1, 1).getTime() / 1e3,
|
|
149
|
-
let
|
|
150
|
-
return
|
|
152
|
+
this.schedulerStore.set("rescheduleBookingId", t), this.schedulerStore.set("selectedTimeslot", null), this.schedulerStore.set("eventInfo", null), this.schedulerStore.set("showBookingForm", !1);
|
|
153
|
+
const s = new Date(e.getFullYear(), e.getMonth(), 1).getTime() / 1e3, i = new Date(e.getFullYear(), e.getMonth() + 1, 1).getTime() / 1e3, n = await this.getAvailability(s, i), a = this.schedulerStore.get("availability").find((l) => new Date(l.start_time) > /* @__PURE__ */ new Date());
|
|
154
|
+
let h = e;
|
|
155
|
+
return a && (h = a.start_time), this.schedulerStore.set("selectedDate", h), n;
|
|
151
156
|
}
|
|
152
157
|
async setCancel(t) {
|
|
153
158
|
this.schedulerStore.set("cancelBookingId", t);
|
|
@@ -161,120 +166,120 @@ class z {
|
|
|
161
166
|
const i = (t == null ? void 0 : t.timeslot) || e;
|
|
162
167
|
if (!i)
|
|
163
168
|
return { error: this.errors.component("Create Booking").no_timeslot_selected() };
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
participants: [r, ...o],
|
|
168
|
-
additional_fields: a,
|
|
169
|
+
const n = t ? t == null ? void 0 : t.primaryParticipant : s == null ? void 0 : s.primaryParticipant, a = t ? (t == null ? void 0 : t.guests) || [] : (s == null ? void 0 : s.guests) || [], h = t ? { ...t == null ? void 0 : t.additionalFields, guests: a } : { ...s == null ? void 0 : s.additionalFields, guests: a }, l = this.getHeaders(), p = `/v3/scheduling/bookings${this.configId ? `?configuration_id=${this.configId}` : ""}`, d = await this.makeAPIRequest(decodeURIComponent(p), "POST", JSON.stringify({
|
|
170
|
+
additional_fields: h,
|
|
171
|
+
guest: { ...n },
|
|
169
172
|
start_time: i.start_time.getTime() / 1e3,
|
|
170
173
|
end_time: i.end_time.getTime() / 1e3
|
|
171
|
-
}),
|
|
172
|
-
if ("error" in
|
|
174
|
+
}), l);
|
|
175
|
+
if ("error" in d) {
|
|
173
176
|
this.schedulerStore.set("isLoading", !1);
|
|
174
|
-
const
|
|
175
|
-
let
|
|
176
|
-
return
|
|
177
|
+
const c = (m = d.error) == null ? void 0 : m.type;
|
|
178
|
+
let o = d.error;
|
|
179
|
+
return c && c in this.errors.api("Create Booking") && (o = this.errors.api("Create Booking")[c]((o == null ? void 0 : o.message) || (o == null ? void 0 : o.title) || "Something went wrong")), { error: o };
|
|
177
180
|
}
|
|
178
|
-
return "data" in
|
|
181
|
+
return "data" in d && this.schedulerStore.set("eventInfo", d == null ? void 0 : d.data), this.schedulerStore.set("isLoading", !1), d;
|
|
179
182
|
}
|
|
180
183
|
async getAvailability(t = 0, e = 0) {
|
|
181
|
-
var
|
|
184
|
+
var p, d, m;
|
|
182
185
|
this.schedulerStore.set("isLoading", !0);
|
|
183
|
-
const s = new URLSearchParams(),
|
|
184
|
-
if (e && e <
|
|
186
|
+
const s = new URLSearchParams(), i = /* @__PURE__ */ new Date(), n = i.getTime();
|
|
187
|
+
if (e && e < n / 1e3)
|
|
185
188
|
return this.schedulerStore.set("isLoading", !1), { error: this.errors.component("Get Availability").endtime_not_in_future() };
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
189
|
+
if (!t) {
|
|
190
|
+
const c = new Date(i.getFullYear(), i.getMonth(), 1);
|
|
191
|
+
t = Math.floor(c.getTime() / 1e3);
|
|
192
|
+
}
|
|
193
|
+
if (!e) {
|
|
194
|
+
const c = new Date(i.getFullYear(), i.getMonth() + 1, 0);
|
|
195
|
+
e = Math.floor(c.getTime() / 1e3);
|
|
196
|
+
}
|
|
197
|
+
s.append("start_time", encodeURIComponent(t.toString())), s.append("end_time", encodeURIComponent(e.toString())), this.configId && s.append("configuration_id", encodeURIComponent(this.configId));
|
|
198
|
+
const a = s.toString(), h = `/v3/scheduling/availability${a ? `?${a}` : ""}`, l = this.getHeaders(), u = await this.makeAPIRequest(decodeURIComponent(h), "GET", void 0, l);
|
|
190
199
|
if ("error" in u) {
|
|
191
200
|
this.schedulerStore.set("availability", []), this.schedulerStore.set("isLoading", !1);
|
|
192
|
-
const
|
|
193
|
-
let
|
|
194
|
-
return
|
|
201
|
+
const c = (p = u.error) == null ? void 0 : p.type;
|
|
202
|
+
let o = u.error;
|
|
203
|
+
return c && c in this.errors.api("Get Availability") && (o = this.errors.api("Get Availability")[c]((o == null ? void 0 : o.message) || (o == null ? void 0 : o.title) || "Something went wrong")), { error: o };
|
|
195
204
|
}
|
|
196
205
|
if ("data" in u) {
|
|
197
|
-
const
|
|
198
|
-
...
|
|
199
|
-
start_time: new Date(
|
|
200
|
-
end_time: new Date(
|
|
201
|
-
}))) || []).filter((
|
|
202
|
-
this.schedulerStore.set("availability",
|
|
206
|
+
const o = (((m = (d = u.data) == null ? void 0 : d.time_slots) == null ? void 0 : m.map((g) => ({
|
|
207
|
+
...g,
|
|
208
|
+
start_time: new Date(g.start_time * 1e3),
|
|
209
|
+
end_time: new Date(g.end_time * 1e3)
|
|
210
|
+
}))) || []).filter((g) => g.start_time.getTime() > n);
|
|
211
|
+
this.schedulerStore.set("availability", o);
|
|
203
212
|
}
|
|
204
213
|
return this.schedulerStore.set("isLoading", !1), u;
|
|
205
214
|
}
|
|
206
215
|
async cancelBooking(t) {
|
|
207
|
-
var
|
|
216
|
+
var a;
|
|
208
217
|
if (this.schedulerStore.set("isLoading", !0), !t)
|
|
209
218
|
return { error: this.errors.component("Cancel Booking").no_booking_id() };
|
|
210
|
-
const e = `/
|
|
211
|
-
Authorization: `Bearer ${this.sessionId}`
|
|
212
|
-
}, i = await this.makeAPIRequest(decodeURIComponent(e), "PUT", JSON.stringify({
|
|
219
|
+
const e = this.configId ? `?configuration_id=${this.configId}` : "", s = `/v3/scheduling/bookings/${t}${e}`, i = this.getHeaders(), n = await this.makeAPIRequest(decodeURIComponent(s), "DELETE", JSON.stringify({
|
|
213
220
|
action: "cancel"
|
|
214
|
-
}),
|
|
215
|
-
if ("error" in
|
|
221
|
+
}), i);
|
|
222
|
+
if ("error" in n) {
|
|
216
223
|
this.schedulerStore.set("isLoading", !1);
|
|
217
|
-
const
|
|
218
|
-
let
|
|
219
|
-
return
|
|
224
|
+
const h = (a = n.error) == null ? void 0 : a.type;
|
|
225
|
+
let l = n.error;
|
|
226
|
+
return h && h in this.errors.api("Cancel Booking") && (l = this.errors.api("Cancel Booking")[h]((l == null ? void 0 : l.message) || (l == null ? void 0 : l.title) || "Something went wrong")), { error: l };
|
|
220
227
|
}
|
|
221
|
-
return
|
|
228
|
+
return this.schedulerStore.set("cancelledEventInfo", {
|
|
229
|
+
booking_id: t
|
|
230
|
+
}), this.schedulerStore.set("isLoading", !1), n;
|
|
222
231
|
}
|
|
223
232
|
async rescheduleBooking(t, e) {
|
|
224
233
|
var w;
|
|
225
234
|
if (this.schedulerStore.set("isLoading", !0), !t)
|
|
226
235
|
return { error: this.errors.component("Reschedule Booking").no_booking_id() };
|
|
227
|
-
const s = this.errors.api("Reschedule Booking"), i = this.errors.component("Reschedule Booking"), { bookingInfo:
|
|
236
|
+
const s = this.errors.api("Reschedule Booking"), i = this.errors.component("Reschedule Booking"), { bookingInfo: n, selectedTimeslot: a, selectedTimezone: h } = this.schedulerStore.state, { startTime: l, endTime: u, timezone: p } = e, d = l || (a == null ? void 0 : a.start_time);
|
|
237
|
+
if (!d)
|
|
238
|
+
return { error: i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
|
|
239
|
+
const m = u || (a == null ? void 0 : a.end_time);
|
|
228
240
|
if (!m)
|
|
229
|
-
return { error: i.
|
|
230
|
-
const
|
|
231
|
-
if (!
|
|
232
|
-
return { error: i.
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
end_time: h.getTime() / 1e3,
|
|
241
|
-
time_zone: l,
|
|
242
|
-
participants: [d, ...p],
|
|
243
|
-
additional_fields: T
|
|
244
|
-
}), B);
|
|
241
|
+
return { error: i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
|
|
242
|
+
const c = p || h;
|
|
243
|
+
if (!c)
|
|
244
|
+
return { error: i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.') };
|
|
245
|
+
const o = e ? e == null ? void 0 : e.primaryParticipant : n == null ? void 0 : n.primaryParticipant, g = e ? (e == null ? void 0 : e.guests) || [] : (n == null ? void 0 : n.guests) || [], b = e ? { ...e == null ? void 0 : e.additionalFields, guests: g } : { ...n == null ? void 0 : n.additionalFields, guests: g }, k = this.configId ? `?configuration_id=${this.configId}` : "", T = `/v3/scheduling/bookings/${t}${k}`, D = this.getHeaders(), _ = await this.makeAPIRequest(decodeURIComponent(T), "PATCH", JSON.stringify({
|
|
246
|
+
start_time: d.getTime() / 1e3,
|
|
247
|
+
end_time: m.getTime() / 1e3,
|
|
248
|
+
time_zone: c,
|
|
249
|
+
additional_fields: b,
|
|
250
|
+
guest: { ...o }
|
|
251
|
+
}), D);
|
|
245
252
|
if ("error" in _) {
|
|
246
253
|
this.schedulerStore.set("isLoading", !1);
|
|
247
254
|
const v = (w = _.error) == null ? void 0 : w.type;
|
|
248
|
-
let
|
|
249
|
-
v && v in s && (
|
|
255
|
+
let f = _.error;
|
|
256
|
+
v && v in s && (f = s[v]((f == null ? void 0 : f.message) || (f == null ? void 0 : f.title) || "Something went wrong"));
|
|
250
257
|
}
|
|
251
258
|
return "data" in _ && this.schedulerStore.set("eventInfo", _ == null ? void 0 : _.data), this.schedulerStore.set("isLoading", !1), _;
|
|
252
259
|
}
|
|
253
260
|
}
|
|
254
|
-
function
|
|
261
|
+
function z(r = {}) {
|
|
255
262
|
const t = {
|
|
256
263
|
selectedDate: null,
|
|
257
264
|
selectedLanguage: navigator.language,
|
|
258
265
|
selectedTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
259
266
|
selectedTimeslot: null,
|
|
260
267
|
showBookingForm: !1,
|
|
261
|
-
showThankYouMessage: !1,
|
|
262
268
|
selectableDates: null,
|
|
263
269
|
availability: [],
|
|
264
270
|
state: "ready",
|
|
265
271
|
eventInfo: null,
|
|
266
|
-
|
|
272
|
+
cancelledEventInfo: null,
|
|
267
273
|
isLoading: !1,
|
|
268
|
-
|
|
274
|
+
nylasBranding: !0,
|
|
275
|
+
...r
|
|
269
276
|
};
|
|
270
277
|
y("[defaultNylasStoreState]: ", t);
|
|
271
|
-
const e =
|
|
278
|
+
const e = R(t);
|
|
272
279
|
return e.onChange("availability", (s) => {
|
|
273
280
|
y("[availability]: ", s);
|
|
274
|
-
const i = s.map((
|
|
281
|
+
const i = s.map((n) => n.start_time);
|
|
275
282
|
y("[selectableDates]: ", i), e.set("selectableDates", i);
|
|
276
|
-
}), e.onChange("rescheduleBookingId", (s) => {
|
|
277
|
-
s ? e.set("bookingFlow", "rescheduling") : e.set("bookingFlow", "booking");
|
|
278
283
|
}), e.reset = () => {
|
|
279
284
|
for (const s in t) {
|
|
280
285
|
const i = t[s];
|
|
@@ -283,7 +288,7 @@ function C(n = {}) {
|
|
|
283
288
|
}, e;
|
|
284
289
|
}
|
|
285
290
|
export {
|
|
286
|
-
C,
|
|
287
|
-
|
|
288
|
-
|
|
291
|
+
z as C,
|
|
292
|
+
S as E,
|
|
293
|
+
C as N
|
|
289
294
|
};
|