@nylas/react 1.4.3 → 1.4.5
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/README.md +7 -0
- package/dist/{add-circle-icon_2.entry-12cddf69.js → add-circle-icon_2.entry-55361a03.js} +3 -3
- package/dist/add-circle-icon_2.entry-75a3df95.cjs +1 -0
- package/dist/archive-icon.entry-3c4e4b28.js +16 -0
- package/dist/archive-icon.entry-8aa151fd.cjs +1 -0
- package/dist/arrow-icon.entry-2cef5ca1.cjs +1 -0
- package/dist/{arrow-icon.entry-66125a01.js → arrow-icon.entry-5bb183c1.js} +5 -5
- package/dist/{bold-icon.entry-4e0f124a.cjs → bold-icon.entry-c919c71d.cjs} +1 -1
- package/dist/{bold-icon.entry-96b5c7c9.js → bold-icon.entry-e0010c60.js} +4 -4
- package/dist/{button-component_2.entry-537ef8cf.cjs → button-component_2.entry-078ee06a.cjs} +1 -1
- package/dist/{button-component_2.entry-02ec97e5.js → button-component_2.entry-1dd1b8d6.js} +9 -9
- package/dist/{calendar-agenda-fill-icon_36.entry-a134ce8f.js → calendar-agenda-fill-icon_36.entry-772a70d7.js} +99 -99
- package/dist/calendar-agenda-fill-icon_36.entry-9b694a33.cjs +6 -0
- package/dist/{calendar-cancel-icon.entry-d4a5aa8d.js → calendar-cancel-icon.entry-7d1a7cea.js} +4 -4
- package/dist/{calendar-cancel-icon.entry-64d8a8f7.cjs → calendar-cancel-icon.entry-b791b6b1.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-620c2161.cjs → calendar-check-icon_2.entry-2380a4e6.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-d7d417b1.js → calendar-check-icon_2.entry-2b5711fd.js} +3 -3
- package/dist/{calendar-icon.entry-994e0116.js → calendar-icon.entry-9b23c994.js} +2 -2
- package/dist/{calendar-icon.entry-b1ba99b6.cjs → calendar-icon.entry-f88c8b09.cjs} +1 -1
- package/dist/{checkbox-component.entry-b43f7dcb.js → checkbox-component.entry-94fd68e7.js} +4 -4
- package/dist/{checkbox-component.entry-286cf4b6.cjs → checkbox-component.entry-af77c4fa.cjs} +1 -1
- package/dist/{checkmark-icon_15.entry-c20a861e.js → checkmark-icon_15.entry-3ddf90df.js} +224 -222
- package/dist/checkmark-icon_15.entry-de65b967.cjs +5 -0
- package/dist/chevron-icon_3.entry-a492d340.cjs +1 -0
- package/dist/{chevron-icon_3.entry-5e8c6975.js → chevron-icon_3.entry-af195326.js} +6 -6
- package/dist/{clock-icon_4.entry-ea55f4c7.cjs → clock-icon_4.entry-530cd13b.cjs} +1 -1
- package/dist/{clock-icon_4.entry-4ba6118a.js → clock-icon_4.entry-7dc4324b.js} +8 -8
- package/dist/{customParseFormat-6c652dbb-905f5f24.cjs → customParseFormat-129be926-30b2af24.cjs} +1 -1
- package/dist/{customParseFormat-6c652dbb-bafc6567.js → customParseFormat-129be926-36eabae2.js} +1 -1
- package/dist/{delete-icon.entry-6f8bb1a4.js → delete-icon.entry-3328484a.js} +4 -4
- package/dist/{delete-icon.entry-d5cc7ec2.cjs → delete-icon.entry-9369bf78.cjs} +1 -1
- package/dist/document-refresh-icon.entry-902ead30.js +16 -0
- package/dist/{document-refresh-icon.entry-59bcbf3e.cjs → document-refresh-icon.entry-f45be1c4.cjs} +1 -1
- package/dist/elements/index.d.ts +0 -8
- package/dist/{feedbackSync-de135b5b-1bb1eed1.cjs → feedbackSync-d943ffc7-13f01c1f.cjs} +1 -1
- package/dist/{feedbackSync-de135b5b-125921e6.js → feedbackSync-d943ffc7-d1e98ba0.js} +1 -1
- package/dist/{folder-icon.entry-a4b426f1.cjs → folder-icon.entry-48cfa8d0.cjs} +1 -1
- package/dist/{folder-icon.entry-c99aefa7.js → folder-icon.entry-c4ffba45.js} +2 -2
- package/dist/{forward-icon.entry-d5f444e4.cjs → forward-icon.entry-146f3318.cjs} +1 -1
- package/dist/{forward-icon.entry-c03a667b.js → forward-icon.entry-dd036273.js} +5 -5
- package/dist/{globe-icon_2.entry-5d4462c6.cjs → globe-icon_2.entry-049fbca2.cjs} +1 -1
- package/dist/{globe-icon_2.entry-b4bd2a2e.js → globe-icon_2.entry-d6a95f6e.js} +90 -80
- package/dist/{google-logo-icon_6.entry-b525183b.cjs → google-logo-icon_6.entry-4d9e06be.cjs} +2 -2
- package/dist/{google-logo-icon_6.entry-bbca3ca0.js → google-logo-icon_6.entry-e26385cc.js} +398 -380
- package/dist/{google-meet-icon_5.entry-29131db6.cjs → google-meet-icon_5.entry-94112d7e.cjs} +1 -1
- package/dist/{google-meet-icon_5.entry-070a3973.js → google-meet-icon_5.entry-c0129f58.js} +12 -12
- package/dist/inbox-icon.entry-74d7a10d.js +16 -0
- package/dist/inbox-icon.entry-94683ba9.cjs +1 -0
- package/dist/index-3b0366ac.cjs +57 -0
- package/dist/{index-5179ba9a.js → index-6e735f92.js} +5678 -4802
- package/dist/{index.es-19a10e83-9591824a.js → index.es-4615d47c-9156501b.js} +827 -1065
- package/dist/{index.es-19a10e83-89045449.cjs → index.es-4615d47c-b7c254fe.cjs} +6 -6
- package/dist/{info-icon_2.entry-327fa47f.cjs → info-icon_2.entry-8bcd39dc.cjs} +1 -1
- package/dist/{info-icon_2.entry-3066c0ae.js → info-icon_2.entry-ef5dbccc.js} +3 -3
- package/dist/{input-component.entry-9ec938d5.js → input-component.entry-922063d5.js} +9 -9
- package/dist/{input-component.entry-6a046128.cjs → input-component.entry-cc1fb2fa.cjs} +1 -1
- package/dist/{input-dropdown_2.entry-886a91a0.js → input-dropdown_2.entry-4041c294.js} +5 -5
- package/dist/input-dropdown_2.entry-f3750e99.cjs +1 -0
- package/dist/italic-icon.entry-63b6943f.cjs +1 -0
- package/dist/italic-icon.entry-6706da64.js +16 -0
- package/dist/{multi-select-dropdown_2.entry-6d631e1a.cjs → multi-select-dropdown_2.entry-1096321d.cjs} +1 -1
- package/dist/{multi-select-dropdown_2.entry-065aa4e8.js → multi-select-dropdown_2.entry-e10a9439.js} +22 -16
- package/dist/nylas-booked-event-card_12.entry-38f37135.cjs +1 -0
- package/dist/{nylas-booked-event-card_12.entry-c7c98fe2.js → nylas-booked-event-card_12.entry-7eceb6b6.js} +226 -224
- package/dist/nylas-event-calendar_3.entry-7dad0f2f.cjs +11 -0
- package/dist/{nylas-event-calendar_3.entry-36866347.js → nylas-event-calendar_3.entry-cc428f95.js} +2360 -2238
- package/dist/{nylas-form-card.entry-6adcea46.cjs → nylas-form-card.entry-984be5f9.cjs} +1 -1
- package/dist/{nylas-form-card.entry-cf5b0151.js → nylas-form-card.entry-dd3f240a.js} +3 -3
- package/dist/{nylas-scheduler-editor.entry-7a4190b0.js → nylas-scheduler-editor.entry-623da747.js} +39 -15
- package/dist/nylas-scheduler-editor.entry-8fb56081.cjs +2 -0
- package/dist/nylas-scheduling.entry-472ef577.cjs +1 -0
- package/dist/nylas-scheduling.entry-6608aa36.js +968 -0
- package/dist/{person-icon.entry-08d6cab1.cjs → person-icon.entry-168ba481.cjs} +1 -1
- package/dist/{person-icon.entry-0919d562.js → person-icon.entry-9f0233cd.js} +4 -4
- package/dist/{play-icon.entry-6a6c0b09.cjs → play-icon.entry-4115845d.cjs} +1 -1
- package/dist/play-icon.entry-5fbfabb5.js +16 -0
- package/dist/{radio-button-group.entry-3e9eb18a.cjs → radio-button-group.entry-3ae5f246.cjs} +1 -1
- package/dist/{radio-button-group.entry-82316913.js → radio-button-group.entry-da3f23ac.js} +2 -2
- package/dist/react.cjs +1 -1
- package/dist/react.js +96 -104
- package/dist/{refresh-icon.entry-c4f5caf0.cjs → refresh-icon.entry-13742bb5.cjs} +1 -1
- package/dist/{refresh-icon.entry-f19b8dbf.js → refresh-icon.entry-e1db3ca5.js} +2 -2
- package/dist/{register-component-139bea5f-38016ef2.js → register-component-083eb961-763c87e9.js} +1 -1
- package/dist/{register-component-139bea5f-93ebfbd3.cjs → register-component-083eb961-c5c48a1b.cjs} +1 -1
- package/dist/{reply-all-icon.entry-53a19ae0.cjs → reply-all-icon.entry-9446c2d0.cjs} +1 -1
- package/dist/{reply-all-icon.entry-3cf08a4a.js → reply-all-icon.entry-ded706c7.js} +2 -2
- package/dist/{reply-icon.entry-b1a1cda3.cjs → reply-icon.entry-0d362c63.cjs} +1 -1
- package/dist/{reply-icon.entry-78dc0e18.js → reply-icon.entry-7c5c0fd9.js} +5 -5
- package/dist/sent-icon.entry-92434496.cjs +1 -0
- package/dist/sent-icon.entry-bc9d1b35.js +16 -0
- package/dist/spam-icon.entry-11370b68.js +16 -0
- package/dist/spam-icon.entry-e0313c63.cjs +1 -0
- package/dist/{star-icon.entry-3f29c8bc.js → star-icon.entry-3a81207c.js} +6 -6
- package/dist/{star-icon.entry-262f813c.cjs → star-icon.entry-87823b56.cjs} +1 -1
- package/dist/{stop-icon.entry-0d3c0894.js → stop-icon.entry-472a11dc.js} +2 -2
- package/dist/{stop-icon.entry-00c3656b.cjs → stop-icon.entry-ddf9242a.cjs} +1 -1
- package/dist/{textarea-component.entry-cb4f5468.cjs → textarea-component.entry-2c6c0c7e.cjs} +1 -1
- package/dist/{textarea-component.entry-b03727b2.js → textarea-component.entry-f9797150.js} +2 -2
- package/dist/{toggle-switch.entry-eaadad98.js → toggle-switch.entry-a7cbc256.js} +2 -2
- package/dist/{toggle-switch.entry-4ba825d1.cjs → toggle-switch.entry-fbef6918.cjs} +1 -1
- package/dist/{translate-icon.entry-b964caca.js → translate-icon.entry-0ab604fe.js} +4 -4
- package/dist/{translate-icon.entry-e468fb5f.cjs → translate-icon.entry-2fe4868f.cjs} +1 -1
- package/dist/trash-fill-icon.entry-1904e8d6.cjs +1 -0
- package/dist/trash-fill-icon.entry-4bdfb061.js +16 -0
- package/dist/{underline-icon.entry-8a52f2c5.js → underline-icon.entry-29366789.js} +2 -2
- package/dist/{underline-icon.entry-fb2fe007.cjs → underline-icon.entry-6a2ca451.cjs} +1 -1
- package/dist/{warning-icon.entry-ba862018.js → warning-icon.entry-1649ffe7.js} +2 -2
- package/dist/{warning-icon.entry-e113397f.cjs → warning-icon.entry-3f848ed6.cjs} +1 -1
- package/package.json +2 -2
- package/dist/add-circle-icon_2.entry-fd842279.cjs +0 -1
- package/dist/archive-icon.entry-318baea1.cjs +0 -1
- package/dist/archive-icon.entry-f71155e0.js +0 -16
- package/dist/arrow-icon.entry-25e08042.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_36.entry-97747463.cjs +0 -6
- package/dist/checkmark-icon_15.entry-6fa7dd5d.cjs +0 -5
- package/dist/chevron-icon_3.entry-bb5b71da.cjs +0 -1
- package/dist/document-refresh-icon.entry-15f6a5ce.js +0 -16
- package/dist/inbox-icon.entry-fae322d8.cjs +0 -1
- package/dist/inbox-icon.entry-feed5692.js +0 -16
- package/dist/index-22f83f6f.cjs +0 -57
- package/dist/input-dropdown_2.entry-33bd12b2.cjs +0 -1
- package/dist/italic-icon.entry-63976e0c.cjs +0 -1
- package/dist/italic-icon.entry-8b41cd6d.js +0 -16
- package/dist/notebook-store-b61693cd-0cdf1255.js +0 -14
- package/dist/notebook-store-b61693cd-c1314935.cjs +0 -5
- package/dist/nylas-booked-event-card_12.entry-35442a83.cjs +0 -1
- package/dist/nylas-call-summary.entry-c7482276.js +0 -16
- package/dist/nylas-call-summary.entry-e457f7dc.cjs +0 -1
- package/dist/nylas-event-calendar_3.entry-207500c1.cjs +0 -6
- package/dist/nylas-if-state.entry-ac37023b.cjs +0 -1
- package/dist/nylas-if-state.entry-f786a0c4.js +0 -95
- package/dist/nylas-key-points.entry-4eedc560.js +0 -29
- package/dist/nylas-key-points.entry-70648aaa.cjs +0 -1
- package/dist/nylas-login.entry-1f979b45.cjs +0 -1
- package/dist/nylas-login.entry-3c9d81eb.js +0 -74
- package/dist/nylas-provider.entry-6d72e728.js +0 -265
- package/dist/nylas-provider.entry-850dd082.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-f76b5368.cjs +0 -2
- package/dist/nylas-scheduling.entry-735334de.cjs +0 -1
- package/dist/nylas-scheduling.entry-c2426f53.js +0 -439
- package/dist/nylas-transcript.entry-b9707df7.js +0 -128
- package/dist/nylas-transcript.entry-f42910e3.cjs +0 -6
- package/dist/nylas-video-player.entry-4da5451f.js +0 -39
- package/dist/nylas-video-player.entry-61772b8a.cjs +0 -1
- package/dist/nylas-video-preview.entry-7e5f92da.cjs +0 -1
- package/dist/nylas-video-preview.entry-a43997ba.js +0 -16
- package/dist/play-icon.entry-07ce821c.js +0 -16
- package/dist/scheduler-config-store-d6729d8d-05905fa5.js +0 -29
- package/dist/scheduler-config-store-d6729d8d-416ec549.cjs +0 -1
- package/dist/scheduler-store-d97ec8e0-34c7a845.cjs +0 -1
- package/dist/scheduler-store-d97ec8e0-7c59bd89.js +0 -533
- package/dist/sent-icon.entry-8d9ffe9f.cjs +0 -1
- package/dist/sent-icon.entry-f7680a13.js +0 -16
- package/dist/spam-icon.entry-28e67f64.cjs +0 -1
- package/dist/spam-icon.entry-56089211.js +0 -16
- package/dist/trash-fill-icon.entry-6d7624a8.cjs +0 -1
- package/dist/trash-fill-icon.entry-742bcd40.js +0 -16
|
@@ -1,533 +0,0 @@
|
|
|
1
|
-
import { d as A, a as z, i as c, l as F } from "./index-5179ba9a.js";
|
|
2
|
-
var M;
|
|
3
|
-
(function(l) {
|
|
4
|
-
l.Error = "error", l.Warning = "warning", l.Info = "info", l.Success = "success";
|
|
5
|
-
})(M || (M = {}));
|
|
6
|
-
var P;
|
|
7
|
-
(function(l) {
|
|
8
|
-
l.Component = "component", l.Api = "api", l.Auth = "auth";
|
|
9
|
-
})(P || (P = {}));
|
|
10
|
-
var $;
|
|
11
|
-
(function(l) {
|
|
12
|
-
l.endtime_not_in_future = "endtime_not_in_future", l.no_booking_info = "no_booking_info", l.no_timeslot_selected = "no_timeslot_selected", l.no_timezone_selected = "no_timezone_selected", l.no_booking_id = "no_booking_id", l.no_salt = "no_salt", l.invalid_start_time = "invalid_start_time", l.invalid_end_time = "invalid_end_time", l.invalid_timezone = "invalid_timezone", l.no_config_id = "no_config_id";
|
|
13
|
-
})($ || ($ = {}));
|
|
14
|
-
class C {
|
|
15
|
-
constructor() {
|
|
16
|
-
this.component = (e) => {
|
|
17
|
-
const t = P.Component, s = `${e} Error`;
|
|
18
|
-
return {
|
|
19
|
-
endtime_not_in_future: (i = '"endtime" can not be in the future') => ({
|
|
20
|
-
title: s,
|
|
21
|
-
message: i,
|
|
22
|
-
category: t
|
|
23
|
-
}),
|
|
24
|
-
no_booking_info: (i = "No booking info provided") => ({
|
|
25
|
-
title: s,
|
|
26
|
-
message: i,
|
|
27
|
-
category: t
|
|
28
|
-
}),
|
|
29
|
-
no_timeslot_selected: (i = "No timeslot selected") => ({
|
|
30
|
-
title: s,
|
|
31
|
-
message: i,
|
|
32
|
-
category: t
|
|
33
|
-
}),
|
|
34
|
-
no_timezone_selected: (i = "No timezone selected") => ({
|
|
35
|
-
title: s,
|
|
36
|
-
message: i,
|
|
37
|
-
category: t
|
|
38
|
-
}),
|
|
39
|
-
no_booking_id: (i = "No booking id provided") => ({
|
|
40
|
-
title: s,
|
|
41
|
-
message: i,
|
|
42
|
-
category: t
|
|
43
|
-
}),
|
|
44
|
-
no_salt: (i = "No salt provided") => ({
|
|
45
|
-
title: s,
|
|
46
|
-
message: i,
|
|
47
|
-
category: t
|
|
48
|
-
}),
|
|
49
|
-
invalid_start_time: (i = "Invalid start time") => ({
|
|
50
|
-
title: s,
|
|
51
|
-
message: i,
|
|
52
|
-
category: t
|
|
53
|
-
}),
|
|
54
|
-
invalid_end_time: (i = "Invalid end time") => ({
|
|
55
|
-
title: s,
|
|
56
|
-
message: i,
|
|
57
|
-
category: t
|
|
58
|
-
}),
|
|
59
|
-
invalid_timezone: (i = "Invalid timezone") => ({
|
|
60
|
-
title: s,
|
|
61
|
-
message: i,
|
|
62
|
-
category: t
|
|
63
|
-
}),
|
|
64
|
-
no_config_id: (i = "No configuration id provided") => ({
|
|
65
|
-
title: s,
|
|
66
|
-
message: i,
|
|
67
|
-
category: t
|
|
68
|
-
})
|
|
69
|
-
};
|
|
70
|
-
}, this.api = (e) => {
|
|
71
|
-
const t = P.Api, s = `${e} Error`;
|
|
72
|
-
return {
|
|
73
|
-
invalid_session: (i) => ({
|
|
74
|
-
title: s,
|
|
75
|
-
message: i,
|
|
76
|
-
category: t
|
|
77
|
-
}),
|
|
78
|
-
general_error: (i) => ({
|
|
79
|
-
title: s,
|
|
80
|
-
message: i,
|
|
81
|
-
category: t
|
|
82
|
-
}),
|
|
83
|
-
internal_error: (i) => ({
|
|
84
|
-
title: s,
|
|
85
|
-
message: i,
|
|
86
|
-
category: t
|
|
87
|
-
}),
|
|
88
|
-
invalid_request_error: (i) => ({
|
|
89
|
-
title: s,
|
|
90
|
-
message: i,
|
|
91
|
-
category: t
|
|
92
|
-
}),
|
|
93
|
-
timeslot_not_available: (i) => ({
|
|
94
|
-
title: s,
|
|
95
|
-
message: i,
|
|
96
|
-
category: t
|
|
97
|
-
}),
|
|
98
|
-
provider_error: (i) => ({
|
|
99
|
-
title: s,
|
|
100
|
-
message: i,
|
|
101
|
-
category: t
|
|
102
|
-
}),
|
|
103
|
-
not_found_error: (i) => ({
|
|
104
|
-
title: s,
|
|
105
|
-
message: i,
|
|
106
|
-
category: t
|
|
107
|
-
})
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
class O {
|
|
113
|
-
constructor({ schedulerAPIURL: e, schedulerStore: t, sessionId: s, configId: i, slug: n, clientId: r }) {
|
|
114
|
-
this.errors = new C(), this.schedulerStore = t, this.schedulerAPIURL = e, this.sessionId = s, this.configId = i, this.slug = n, this.clientId = r;
|
|
115
|
-
}
|
|
116
|
-
getHeaders() {
|
|
117
|
-
return this.sessionId ? {
|
|
118
|
-
Authorization: `Bearer ${this.sessionId}`
|
|
119
|
-
} : {};
|
|
120
|
-
}
|
|
121
|
-
async makeAPIRequest(e, t, s, i = {}) {
|
|
122
|
-
try {
|
|
123
|
-
const n = new URL(this.schedulerAPIURL), r = "1.4.3";
|
|
124
|
-
return n.pathname = e, await (await fetch(decodeURIComponent(n.toString()), {
|
|
125
|
-
method: t,
|
|
126
|
-
headers: {
|
|
127
|
-
"Content-Type": "application/json",
|
|
128
|
-
Origin: window.location.origin,
|
|
129
|
-
"X-Source": "nylas-scheduling",
|
|
130
|
-
"X-Nylas-Web-Elements-Version": r,
|
|
131
|
-
...i
|
|
132
|
-
},
|
|
133
|
-
body: s
|
|
134
|
-
})).json();
|
|
135
|
-
} catch (n) {
|
|
136
|
-
return {
|
|
137
|
-
error: {
|
|
138
|
-
message: n.message,
|
|
139
|
-
title: "API request failed",
|
|
140
|
-
type: "api"
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
getErrorMessage(e) {
|
|
146
|
-
var s, i, n, r;
|
|
147
|
-
let t = (e == null ? void 0 : e.message) || (e == null ? void 0 : e.title) || "Something went wrong";
|
|
148
|
-
return (e == null ? void 0 : e.type) === "provider_error" && (t = ((i = (s = e == null ? void 0 : e.provider_error) == null ? void 0 : s.error) == null ? void 0 : i.message) || ((r = (n = e == null ? void 0 : e.provider_error) == null ? void 0 : n.error) == null ? void 0 : r.title) || "Something went wrong"), t;
|
|
149
|
-
}
|
|
150
|
-
setConfigId(e) {
|
|
151
|
-
this.configId = e;
|
|
152
|
-
}
|
|
153
|
-
selectDate(e) {
|
|
154
|
-
this.schedulerStore.set("selectedDate", e), this.schedulerStore.set("selectedTimeslot", null);
|
|
155
|
-
}
|
|
156
|
-
selectTime(e) {
|
|
157
|
-
this.schedulerStore.set("selectedTimeslot", e);
|
|
158
|
-
}
|
|
159
|
-
selectTimezone(e) {
|
|
160
|
-
this.schedulerStore.set("selectedTimezone", e);
|
|
161
|
-
}
|
|
162
|
-
selectLanguage(e) {
|
|
163
|
-
this.schedulerStore.set("selectedLanguage", e), c.changeLanguage(e);
|
|
164
|
-
}
|
|
165
|
-
async toggleAdditionalData(e) {
|
|
166
|
-
e || await this.refetchAvailability(), this.schedulerStore.set("showBookingForm", e);
|
|
167
|
-
}
|
|
168
|
-
setParticipantName(e) {
|
|
169
|
-
const { bookingInfo: t } = this.schedulerStore.state;
|
|
170
|
-
this.schedulerStore.set("bookingInfo", {
|
|
171
|
-
...t,
|
|
172
|
-
primaryParticipant: {
|
|
173
|
-
...t == null ? void 0 : t.primaryParticipant,
|
|
174
|
-
name: e
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
setParticipantEmail(e) {
|
|
179
|
-
const { bookingInfo: t } = this.schedulerStore.state;
|
|
180
|
-
this.schedulerStore.set("bookingInfo", {
|
|
181
|
-
...t,
|
|
182
|
-
primaryParticipant: {
|
|
183
|
-
...t == null ? void 0 : t.primaryParticipant,
|
|
184
|
-
email: e
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
async refetchAvailability() {
|
|
189
|
-
const e = /* @__PURE__ */ new Date(), t = new Date(e.getFullYear(), e.getMonth(), 1).getTime() / 1e3, s = t < e.getTime() / 1e3 ? Math.floor(e.getTime() / 1e3) : t, i = new Date(e.getFullYear(), e.getMonth() + 1, 1).getTime() / 1e3;
|
|
190
|
-
return await this.getAvailability(s, i);
|
|
191
|
-
}
|
|
192
|
-
async resetStoreStateAndFetchAvailability() {
|
|
193
|
-
const e = /* @__PURE__ */ new Date(), t = await this.refetchAvailability(), s = this.schedulerStore.get("availability").find((n) => new Date(n.start_time) > /* @__PURE__ */ new Date());
|
|
194
|
-
let i = e;
|
|
195
|
-
return s && (i = s.start_time), this.schedulerStore.set("selectedDate", i), this.schedulerStore.set("eventInfo", null), this.schedulerStore.set("showBookingForm", !1), this.schedulerStore.set("selectedTimeslot", null), t;
|
|
196
|
-
}
|
|
197
|
-
async setReschedule(e) {
|
|
198
|
-
this.schedulerStore.set("isLoading", !0);
|
|
199
|
-
const t = this.schedulerStore.state.eventInfo;
|
|
200
|
-
return t && this.schedulerStore.set("reschedulingEventInfo", t), this.schedulerStore.set("rescheduleBookingId", e), await this.getUISettings(), await this.resetStoreStateAndFetchAvailability().finally(() => {
|
|
201
|
-
this.schedulerStore.set("isLoading", !1);
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
async setCancel(e) {
|
|
205
|
-
this.schedulerStore.set("cancelBookingId", e);
|
|
206
|
-
}
|
|
207
|
-
async setReject(e) {
|
|
208
|
-
this.schedulerStore.set("rejectBookingId", e);
|
|
209
|
-
}
|
|
210
|
-
async resetCancel() {
|
|
211
|
-
const e = await this.resetStoreStateAndFetchAvailability();
|
|
212
|
-
return this.schedulerStore.set("cancelBookingId", ""), this.schedulerStore.set("rejectBookingId", ""), this.schedulerStore.set("cancelledEventInfo", null), e;
|
|
213
|
-
}
|
|
214
|
-
async goBack() {
|
|
215
|
-
this.schedulerStore.set("cancelBookingId", "");
|
|
216
|
-
}
|
|
217
|
-
async resetConfirm() {
|
|
218
|
-
const e = await this.resetStoreStateAndFetchAvailability();
|
|
219
|
-
return this.schedulerStore.set("organizerConfirmationBookingId", ""), this.schedulerStore.set("confirmedEventInfo", void 0), e;
|
|
220
|
-
}
|
|
221
|
-
async bookTimeslot(e) {
|
|
222
|
-
var E, p, L;
|
|
223
|
-
this.schedulerStore.set("isLoading", !0);
|
|
224
|
-
const { selectedTimeslot: t, selectedTimezone: s, bookingInfo: i, selectedLanguage: n } = this.schedulerStore.state;
|
|
225
|
-
if (!e && !i)
|
|
226
|
-
return { error: this.errors.component(c.t("createBookingErrorTitle")).no_booking_info() };
|
|
227
|
-
const r = (e == null ? void 0 : e.timeslot) || t;
|
|
228
|
-
if (!r)
|
|
229
|
-
return { error: this.errors.component(c.t("createBookingErrorTitle")).no_timeslot_selected() };
|
|
230
|
-
const a = e && (e != null && e.timezone) ? e == null ? void 0 : e.timezone : s, o = n || "en-US";
|
|
231
|
-
if (!a)
|
|
232
|
-
return { error: this.errors.component(c.t("createBookingErrorTitle")).no_timezone_selected() };
|
|
233
|
-
const h = [...this.schedulerStore.get("availabilityOrderEmails")];
|
|
234
|
-
let d = "";
|
|
235
|
-
const m = (r == null ? void 0 : r.emails) || [], f = {};
|
|
236
|
-
Object.entries((i == null ? void 0 : i.additionalFields) || {}).forEach(([u, w]) => {
|
|
237
|
-
f[u] = w.value;
|
|
238
|
-
});
|
|
239
|
-
const _ = e ? e == null ? void 0 : e.primaryParticipant : i == null ? void 0 : i.primaryParticipant, S = e ? (e == null ? void 0 : e.guests) || [] : (i == null ? void 0 : i.guests) || [], y = e ? e == null ? void 0 : e.additionalFields : f, g = this.getHeaders(), b = `/v3/scheduling/bookings${!this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : ""}`;
|
|
240
|
-
if (h.length === 0) {
|
|
241
|
-
const u = await this.makeAPIRequest(decodeURIComponent(b), "POST", JSON.stringify({
|
|
242
|
-
additional_fields: y,
|
|
243
|
-
additional_guests: S,
|
|
244
|
-
guest: { ..._ },
|
|
245
|
-
start_time: r.start_time.getTime() / 1e3,
|
|
246
|
-
end_time: r.end_time.getTime() / 1e3,
|
|
247
|
-
timezone: a,
|
|
248
|
-
event_id: (r == null ? void 0 : r.event_id) || void 0,
|
|
249
|
-
master_id: (r == null ? void 0 : r.master_id) || void 0,
|
|
250
|
-
calendar_id: (r == null ? void 0 : r.calendar_id) || void 0,
|
|
251
|
-
email_language: this.getTwoLetterLanguageCode(o)
|
|
252
|
-
}), g);
|
|
253
|
-
return this.schedulerStore.set("isLoading", !1), "data" in u ? (this.schedulerStore.set("eventInfo", u.data), u) : { error: u.error };
|
|
254
|
-
}
|
|
255
|
-
for (; h.length > 0; ) {
|
|
256
|
-
if (d = h.shift(), !m.includes(d))
|
|
257
|
-
continue;
|
|
258
|
-
const u = await this.makeAPIRequest(decodeURIComponent(b), "POST", JSON.stringify({
|
|
259
|
-
participants: d ? [{ email: d }] : void 0,
|
|
260
|
-
additional_fields: y,
|
|
261
|
-
additional_guests: S,
|
|
262
|
-
guest: { ..._ },
|
|
263
|
-
start_time: r.start_time.getTime() / 1e3,
|
|
264
|
-
end_time: r.end_time.getTime() / 1e3,
|
|
265
|
-
timezone: a,
|
|
266
|
-
email_language: this.getTwoLetterLanguageCode(o)
|
|
267
|
-
}), g);
|
|
268
|
-
if ("data" in u)
|
|
269
|
-
return this.schedulerStore.set("isLoading", !1), this.schedulerStore.set("eventInfo", u == null ? void 0 : u.data), u;
|
|
270
|
-
if ((p = (E = u.error) == null ? void 0 : E.message) != null && p.startsWith("The selected timeslot is unavailable"))
|
|
271
|
-
continue;
|
|
272
|
-
{
|
|
273
|
-
this.schedulerStore.set("isLoading", !1);
|
|
274
|
-
const w = (L = u.error) == null ? void 0 : L.type;
|
|
275
|
-
let I = u.error;
|
|
276
|
-
if (w && w in this.errors.api(c.t("createBookingErrorTitle"))) {
|
|
277
|
-
const B = this.getErrorMessage(I);
|
|
278
|
-
I = this.errors.api(c.t("createBookingErrorTitle"))[w](B);
|
|
279
|
-
}
|
|
280
|
-
return { error: I };
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return this.schedulerStore.set("isLoading", !1), {
|
|
284
|
-
error: this.errors.api(c.t("createBookingErrorTitle")).timeslot_not_available("The selected timeslot is unavailable")
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
async getUISettings() {
|
|
288
|
-
var r;
|
|
289
|
-
this.schedulerStore.set("isLoading", !0);
|
|
290
|
-
const e = this.schedulerStore.get("rescheduleBookingId"), t = this.getHeaders();
|
|
291
|
-
let s = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "";
|
|
292
|
-
e && s ? s += `&booking_id=${e}` : e && (s += `?booking_id=${e}`);
|
|
293
|
-
const i = `/v3/scheduling/ui-settings${s}`, n = await this.makeAPIRequest(i, "GET", void 0, t);
|
|
294
|
-
if ("error" in n) {
|
|
295
|
-
this.schedulerStore.set("isLoading", !1);
|
|
296
|
-
const a = (r = n.error) == null ? void 0 : r.type;
|
|
297
|
-
let o = n.error;
|
|
298
|
-
return a && a in this.errors.api(c.t("getUISettingErrorTitle")) && (o = this.errors.api(c.t("getUISettingErrorTitle"))[a]((o == null ? void 0 : o.message) || (o == null ? void 0 : o.title) || "Something went wrong")), { error: o };
|
|
299
|
-
}
|
|
300
|
-
return "data" in n && this.schedulerStore.set("configSettings", n.data), this.schedulerStore.set("isLoading", !1), n;
|
|
301
|
-
}
|
|
302
|
-
getTwoLetterLanguageCode(e) {
|
|
303
|
-
return e.split("-")[0];
|
|
304
|
-
}
|
|
305
|
-
getStartTimeWithMinBookingNotice(e) {
|
|
306
|
-
var n;
|
|
307
|
-
const t = (n = this.schedulerStore.get("configSettings")) == null ? void 0 : n.scheduler, s = t == null ? void 0 : t.min_booking_notice;
|
|
308
|
-
if (!s)
|
|
309
|
-
return e;
|
|
310
|
-
const i = (/* @__PURE__ */ new Date()).getTime();
|
|
311
|
-
return e < (i + s * 60 * 1e3) / 1e3 ? Math.floor((i + s * 60 * 1e3) / 1e3) : e;
|
|
312
|
-
}
|
|
313
|
-
getEndTimeForAvailableDaysInFuture(e) {
|
|
314
|
-
var r, a;
|
|
315
|
-
const t = /* @__PURE__ */ new Date(), s = (a = (r = this.schedulerStore.get("configSettings")) == null ? void 0 : r.scheduler) == null ? void 0 : a.available_days_in_future, i = Math.floor(F(t, s).getTime() / 1e3);
|
|
316
|
-
return Math.min(i, e);
|
|
317
|
-
}
|
|
318
|
-
async getAvailability(e = 0, t = 0) {
|
|
319
|
-
var f, _, S, y;
|
|
320
|
-
this.schedulerStore.set("isLoading", !0);
|
|
321
|
-
const s = new URLSearchParams(), i = /* @__PURE__ */ new Date(), n = i.getTime();
|
|
322
|
-
if (t && t < n / 1e3)
|
|
323
|
-
return this.schedulerStore.set("isLoading", !1), { error: this.errors.component(c.t("getAvailabilityErrorTitle")).endtime_not_in_future() };
|
|
324
|
-
if (!e) {
|
|
325
|
-
const g = new Date(i.getFullYear(), i.getMonth(), 1);
|
|
326
|
-
e = Math.floor(g.getTime() / 1e3);
|
|
327
|
-
}
|
|
328
|
-
if (!t) {
|
|
329
|
-
const g = new Date(i.getFullYear(), i.getMonth() + 1, 0);
|
|
330
|
-
t = Math.floor(g.getTime() / 1e3);
|
|
331
|
-
}
|
|
332
|
-
t = this.getEndTimeForAvailableDaysInFuture(t);
|
|
333
|
-
const r = this.getStartTimeWithMinBookingNotice(e);
|
|
334
|
-
e = r, t = r > t ? r + 1 : t, s.append("start_time", encodeURIComponent(e.toString())), s.append("end_time", encodeURIComponent(t.toString())), this.configId && !this.sessionId ? s.append("configuration_id", encodeURIComponent(this.configId)) : this.slug && this.clientId && !this.sessionId && (s.append("slug", encodeURIComponent(this.slug)), s.append("client_id", encodeURIComponent(this.clientId)));
|
|
335
|
-
const a = this.schedulerStore.get("rescheduleBookingId");
|
|
336
|
-
a && s.append("booking_id", encodeURIComponent(a));
|
|
337
|
-
const o = s.toString(), h = `/v3/scheduling/availability${o ? `?${o}` : ""}`, d = this.getHeaders(), m = await this.makeAPIRequest(decodeURIComponent(h), "GET", void 0, d);
|
|
338
|
-
if ("error" in m) {
|
|
339
|
-
this.schedulerStore.set("availability", []), this.schedulerStore.set("isLoading", !1);
|
|
340
|
-
const g = (f = m.error) == null ? void 0 : f.type;
|
|
341
|
-
let k = m.error;
|
|
342
|
-
if (g && g in this.errors.api(c.t("getAvailabilityErrorTitle"))) {
|
|
343
|
-
const b = this.getErrorMessage(k);
|
|
344
|
-
k = this.errors.api(c.t("getAvailabilityErrorTitle"))[g](b);
|
|
345
|
-
}
|
|
346
|
-
return { error: k };
|
|
347
|
-
}
|
|
348
|
-
if ("data" in m) {
|
|
349
|
-
const b = (((S = (_ = m.data) == null ? void 0 : _.time_slots) == null ? void 0 : S.map((p) => ({
|
|
350
|
-
...p,
|
|
351
|
-
start_time: new Date(p.start_time * 1e3),
|
|
352
|
-
end_time: new Date(p.end_time * 1e3)
|
|
353
|
-
}))) || []).filter((p) => p.start_time.getTime() > n).sort((p, L) => p.start_time.getTime() - L.start_time.getTime());
|
|
354
|
-
this.schedulerStore.set("availability", b);
|
|
355
|
-
const E = ((y = m.data) == null ? void 0 : y.order) || [];
|
|
356
|
-
this.schedulerStore.set("availabilityOrderEmails", E);
|
|
357
|
-
}
|
|
358
|
-
return this.schedulerStore.set("isLoading", !1), m;
|
|
359
|
-
}
|
|
360
|
-
async cancelBooking(e, t) {
|
|
361
|
-
var a;
|
|
362
|
-
if (this.schedulerStore.set("isLoading", !0), !e)
|
|
363
|
-
return { error: this.errors.component(c.t("cancelBookingErrorTitle")).no_booking_id() };
|
|
364
|
-
const s = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "", i = `/v3/scheduling/bookings/${e}${s}`, n = this.getHeaders(), r = await this.makeAPIRequest(decodeURIComponent(i), "DELETE", JSON.stringify({
|
|
365
|
-
action: "cancel",
|
|
366
|
-
cancellation_reason: t
|
|
367
|
-
}), n);
|
|
368
|
-
if ("error" in r) {
|
|
369
|
-
this.schedulerStore.set("isLoading", !1);
|
|
370
|
-
const o = (a = r.error) == null ? void 0 : a.type;
|
|
371
|
-
let h = r.error;
|
|
372
|
-
if (o && o in this.errors.api(c.t("cancelBookingErrorTitle"))) {
|
|
373
|
-
const d = this.getErrorMessage(h);
|
|
374
|
-
h = this.errors.api(c.t("cancelBookingErrorTitle"))[o](d);
|
|
375
|
-
}
|
|
376
|
-
return { error: h };
|
|
377
|
-
}
|
|
378
|
-
return this.schedulerStore.set("cancelledEventInfo", {
|
|
379
|
-
booking_id: e
|
|
380
|
-
}), this.schedulerStore.set("rescheduleBookingId", ""), this.schedulerStore.set("isLoading", !1), r;
|
|
381
|
-
}
|
|
382
|
-
async rescheduleBooking(e, t) {
|
|
383
|
-
var D;
|
|
384
|
-
if (this.schedulerStore.set("isLoading", !0), !e)
|
|
385
|
-
return { error: this.errors.component(c.t("rescheduleBookingErrorTitle")).no_booking_id() };
|
|
386
|
-
const s = this.errors.api(c.t("rescheduleBookingErrorTitle")), i = this.errors.component(c.t("rescheduleBookingErrorTitle")), { bookingInfo: n, selectedTimeslot: r, selectedTimezone: a, selectedLanguage: o } = this.schedulerStore.state, { startTime: h, endTime: d, timezone: m } = t, f = h || (r == null ? void 0 : r.start_time);
|
|
387
|
-
if (!f)
|
|
388
|
-
return { error: i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
|
|
389
|
-
const _ = d || (r == null ? void 0 : r.end_time);
|
|
390
|
-
if (!_)
|
|
391
|
-
return { error: i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
|
|
392
|
-
const S = this.schedulerStore.get("availabilityOrderEmails");
|
|
393
|
-
let y = "";
|
|
394
|
-
if (S.length > 0) {
|
|
395
|
-
const T = (r == null ? void 0 : r.emails) || [];
|
|
396
|
-
for (let v = 0; v < S.length; v++)
|
|
397
|
-
if (T.includes(S[v])) {
|
|
398
|
-
y = S[v];
|
|
399
|
-
break;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
const g = m || a;
|
|
403
|
-
if (!g)
|
|
404
|
-
return { error: i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.') };
|
|
405
|
-
const k = {};
|
|
406
|
-
Object.entries((n == null ? void 0 : n.additionalFields) || {}).forEach(([T, v]) => {
|
|
407
|
-
k[T] = v.value;
|
|
408
|
-
});
|
|
409
|
-
const b = t ? t == null ? void 0 : t.primaryParticipant : n == null ? void 0 : n.primaryParticipant, E = t ? (t == null ? void 0 : t.guests) || [] : (n == null ? void 0 : n.guests) || [], p = t ? t == null ? void 0 : t.additionalFields : k, L = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "", u = `/v3/scheduling/bookings/${e}${L}`, w = this.getHeaders(), I = await this.makeAPIRequest(decodeURIComponent(u), "PATCH", JSON.stringify({
|
|
410
|
-
start_time: f.getTime() / 1e3,
|
|
411
|
-
end_time: _.getTime() / 1e3,
|
|
412
|
-
timezone: g,
|
|
413
|
-
additional_fields: p,
|
|
414
|
-
guest: { ...b },
|
|
415
|
-
additional_guests: E,
|
|
416
|
-
participants: y ? [{ email: y }] : void 0,
|
|
417
|
-
email_language: this.getTwoLetterLanguageCode(o)
|
|
418
|
-
}), w);
|
|
419
|
-
if ("error" in I) {
|
|
420
|
-
this.schedulerStore.set("isLoading", !1);
|
|
421
|
-
const T = (D = I.error) == null ? void 0 : D.type;
|
|
422
|
-
let v = I.error;
|
|
423
|
-
if (T && T in s) {
|
|
424
|
-
const R = this.getErrorMessage(v);
|
|
425
|
-
v = s[T](R);
|
|
426
|
-
}
|
|
427
|
-
return { error: v };
|
|
428
|
-
}
|
|
429
|
-
const B = this.schedulerStore.get("reschedulingEventInfo");
|
|
430
|
-
if ("data" in I)
|
|
431
|
-
this.schedulerStore.set("eventInfo", I == null ? void 0 : I.data);
|
|
432
|
-
else if (B)
|
|
433
|
-
this.schedulerStore.set("eventInfo", B);
|
|
434
|
-
else {
|
|
435
|
-
const T = {
|
|
436
|
-
booking_id: e
|
|
437
|
-
};
|
|
438
|
-
this.schedulerStore.set("eventInfo", T);
|
|
439
|
-
}
|
|
440
|
-
return this.schedulerStore.set("isLoading", !1), I;
|
|
441
|
-
}
|
|
442
|
-
async updateBooking(e) {
|
|
443
|
-
var m;
|
|
444
|
-
this.schedulerStore.set("isLoading", !0);
|
|
445
|
-
const { bookingId: t, status: s, reason: i } = e, n = this.schedulerStore.get("organizerConfirmationSalt"), r = s === "confirmed" ? c.t("confirmBookingErrorTitle") : c.t("rejectBookingErrorTitle");
|
|
446
|
-
if (!t)
|
|
447
|
-
return { error: this.errors.component(r).no_booking_id() };
|
|
448
|
-
if (!n)
|
|
449
|
-
return { error: this.errors.component(r).no_salt() };
|
|
450
|
-
const a = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "", o = `/v3/scheduling/bookings/${t}${a}`, h = this.getHeaders(), d = await this.makeAPIRequest(decodeURIComponent(o), "PUT", JSON.stringify({
|
|
451
|
-
status: s,
|
|
452
|
-
cancellation_reason: i,
|
|
453
|
-
salt: n
|
|
454
|
-
}), h);
|
|
455
|
-
if ("error" in d) {
|
|
456
|
-
this.schedulerStore.set("isLoading", !1);
|
|
457
|
-
const f = (m = d.error) == null ? void 0 : m.type;
|
|
458
|
-
let _ = d.error;
|
|
459
|
-
if (f && f in this.errors.api(r)) {
|
|
460
|
-
const S = this.getErrorMessage(_);
|
|
461
|
-
_ = this.errors.api(r)[f](S);
|
|
462
|
-
}
|
|
463
|
-
return { error: _ };
|
|
464
|
-
}
|
|
465
|
-
return "data" in d && s === "confirmed" ? this.schedulerStore.set("confirmedEventInfo", d == null ? void 0 : d.data) : "request_id" in d && s === "cancelled" && this.schedulerStore.set("cancelledEventInfo", {
|
|
466
|
-
booking_id: t
|
|
467
|
-
}), this.schedulerStore.set("organizerConfirmationBookingId", ""), this.schedulerStore.set("isLoading", !1), d;
|
|
468
|
-
}
|
|
469
|
-
async validateGroupEventTimeslot(e) {
|
|
470
|
-
var r, a;
|
|
471
|
-
this.schedulerStore.set("isLoading", !0);
|
|
472
|
-
const t = (r = this.schedulerStore.get("configSettings")) == null ? void 0 : r.configuration_id;
|
|
473
|
-
if (!t)
|
|
474
|
-
return { error: this.errors.component(c.t("validateTimeslotErrorTitle")).no_config_id() };
|
|
475
|
-
const s = this.getHeaders(), i = `/v3/scheduling/configurations/${t}/group-events/validate-timeslot`, n = await this.makeAPIRequest(decodeURIComponent(i), "POST", JSON.stringify({
|
|
476
|
-
...e,
|
|
477
|
-
start_time: e.start_time.getTime() / 1e3,
|
|
478
|
-
end_time: e.end_time.getTime() / 1e3
|
|
479
|
-
}), s);
|
|
480
|
-
if ("error" in n) {
|
|
481
|
-
this.schedulerStore.set("isLoading", !1);
|
|
482
|
-
const o = (a = n.error) == null ? void 0 : a.type;
|
|
483
|
-
let h = n.error;
|
|
484
|
-
if (o && o in this.errors.api(c.t("validateTimeslotErrorTitle"))) {
|
|
485
|
-
const d = this.getErrorMessage(h);
|
|
486
|
-
h = this.errors.api(c.t("validateTimeslotErrorTitle"))[o](d);
|
|
487
|
-
}
|
|
488
|
-
return this.refetchAvailability(), { error: h };
|
|
489
|
-
}
|
|
490
|
-
return this.schedulerStore.set("selectedTimeslot", e), this.schedulerStore.set("showBookingForm", !0), this.schedulerStore.set("isLoading", !1), n;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
function N(l = {}) {
|
|
494
|
-
const e = {
|
|
495
|
-
selectedDate: null,
|
|
496
|
-
selectedLanguage: navigator.language,
|
|
497
|
-
selectedTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
498
|
-
selectedTimeslot: null,
|
|
499
|
-
showBookingForm: !1,
|
|
500
|
-
availabilityOrderEmails: [],
|
|
501
|
-
selectableDates: null,
|
|
502
|
-
availability: [],
|
|
503
|
-
eventDuration: 0,
|
|
504
|
-
state: "ready",
|
|
505
|
-
eventInfo: null,
|
|
506
|
-
cancelledEventInfo: null,
|
|
507
|
-
isLoading: !1,
|
|
508
|
-
nylasBranding: !0,
|
|
509
|
-
...l
|
|
510
|
-
};
|
|
511
|
-
A("[defaultNylasStoreState]: ", e);
|
|
512
|
-
const t = z(e);
|
|
513
|
-
return t.onChange("availability", (s) => {
|
|
514
|
-
A("[availability]: ", s);
|
|
515
|
-
const i = s.map((a) => a.start_time);
|
|
516
|
-
A("[selectableDates]: ", i), t.set("selectableDates", i);
|
|
517
|
-
const n = s[0];
|
|
518
|
-
if (!n)
|
|
519
|
-
return;
|
|
520
|
-
const r = Math.floor((n.end_time.getTime() - n.start_time.getTime()) / 6e4);
|
|
521
|
-
A("[durationMinutes]: ", r), t.set("eventDuration", r);
|
|
522
|
-
}), t.reset = () => {
|
|
523
|
-
for (const s in e) {
|
|
524
|
-
const i = e[s];
|
|
525
|
-
t.set(s, i);
|
|
526
|
-
}
|
|
527
|
-
}, t;
|
|
528
|
-
}
|
|
529
|
-
export {
|
|
530
|
-
N as C,
|
|
531
|
-
P as E,
|
|
532
|
-
O as N
|
|
533
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-22f83f6f.cjs");require("react");require("react/jsx-runtime");require("react-dom");const c=".sc-sent-icon-h{display:flex}",i=c,t=class{constructor(s){e.registerInstance(this,s),this.width="15",this.height="15"}render(){return e.h("svg",{key:"fe1f3a8dccc7ed5b4b008b3e7ba2b6aa32bf75df",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"319aeb3c8bdce5002c624d4926ec3cb0525d396c",d:"M21.5 12L3.5 3.5L3.5 20.5L21.5 12Z",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"d05924ef434bb7976571e3f9fe2b00ffaac6c770",d:"M3.5 3.5L12 10.5",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"0268790deda555924f82a772dcd49783aec96c82",d:"M3.5 20.5L12 13.5",stroke:"auto","stroke-width":"1.5"}))}};t.style=i;exports.sent_icon=t;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { r as s, h as t } from "./index-5179ba9a.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react/jsx-runtime";
|
|
4
|
-
import "react-dom";
|
|
5
|
-
const o = ".sc-sent-icon-h{display:flex}", c = o, i = class {
|
|
6
|
-
constructor(e) {
|
|
7
|
-
s(this, e), this.width = "15", this.height = "15";
|
|
8
|
-
}
|
|
9
|
-
render() {
|
|
10
|
-
return t("svg", { key: "fe1f3a8dccc7ed5b4b008b3e7ba2b6aa32bf75df", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "319aeb3c8bdce5002c624d4926ec3cb0525d396c", d: "M21.5 12L3.5 3.5L3.5 20.5L21.5 12Z", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "d05924ef434bb7976571e3f9fe2b00ffaac6c770", d: "M3.5 3.5L12 10.5", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "0268790deda555924f82a772dcd49783aec96c82", d: "M3.5 20.5L12 13.5", stroke: "auto", "stroke-width": "1.5" }));
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
i.style = c;
|
|
14
|
-
export {
|
|
15
|
-
i as sent_icon
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-22f83f6f.cjs");require("react");require("react/jsx-runtime");require("react-dom");const i=".sc-spam-icon-h{display:flex}",c=i,t=class{constructor(s){e.registerInstance(this,s),this.width="15",this.height="15"}render(){return e.h("svg",{key:"84d7e0e5235fe887cc3d239ce69e0986a1d3014d",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"b0b2350a1cf0d3ba1fdc3d099c9882ca095e1369",d:"M20 3H4C2.89543 3 2 3.89543 2 5V19C2 20.1046 2.89543 21 4 21H20C21.1046 21 22 20.1046 22 19V5C22 3.89543 21.1046 3 20 3Z",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"a2b5344063a37dc44ff52d46354443f774bc7c86",d:"M2 5L12 12.5L22 5",stroke:"auto","stroke-width":"1.5"}))}};t.style=c;exports.spam_icon=t;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { r as e, h as t } from "./index-5179ba9a.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react/jsx-runtime";
|
|
4
|
-
import "react-dom";
|
|
5
|
-
const o = ".sc-spam-icon-h{display:flex}", i = o, c = class {
|
|
6
|
-
constructor(s) {
|
|
7
|
-
e(this, s), this.width = "15", this.height = "15";
|
|
8
|
-
}
|
|
9
|
-
render() {
|
|
10
|
-
return t("svg", { key: "84d7e0e5235fe887cc3d239ce69e0986a1d3014d", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "b0b2350a1cf0d3ba1fdc3d099c9882ca095e1369", d: "M20 3H4C2.89543 3 2 3.89543 2 5V19C2 20.1046 2.89543 21 4 21H20C21.1046 21 22 20.1046 22 19V5C22 3.89543 21.1046 3 20 3Z", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "a2b5344063a37dc44ff52d46354443f774bc7c86", d: "M2 5L12 12.5L22 5", stroke: "auto", "stroke-width": "1.5" }));
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
c.style = i;
|
|
14
|
-
export {
|
|
15
|
-
c as spam_icon
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-22f83f6f.cjs");require("react");require("react/jsx-runtime");require("react-dom");const a=".sc-trash-fill-icon-h{display:flex}",i=a,t=class{constructor(s){e.registerInstance(this,s),this.width="15",this.height="15"}render(){return e.h("svg",{key:"8a7e9df694b6cb8ad4ffdac16eda2f6f8c90913f",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"c4f9f76f3deed708c969f7c2784647196414c6c8",d:"M3 6H5H21",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"a5561ec74252af4054839f86642f85ac191f7edb",d:"M8 6V4C8 3.46957 8.21071 2.96086 8.58579 2.58579C8.96086 2.21071 9.46957 2 10 2H14C14.5304 2 15.0391 2.21071 15.4142 2.58579C15.7893 2.96086 16 3.46957 16 4V6M19 6V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V6H19Z",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"2eaaba52f039b93e5a65e8a7d5d97a9265e77f55",d:"M10 11V17",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"536c90ff05cc5e11b8e4c3c1a7b6656ea8acf8c8",d:"M14 11V17",stroke:"auto","stroke-width":"1.5"}))}};t.style=i;exports.trash_fill_icon=t;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { r as s, h as t } from "./index-5179ba9a.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react/jsx-runtime";
|
|
4
|
-
import "react-dom";
|
|
5
|
-
const a = ".sc-trash-fill-icon-h{display:flex}", o = a, c = class {
|
|
6
|
-
constructor(e) {
|
|
7
|
-
s(this, e), this.width = "15", this.height = "15";
|
|
8
|
-
}
|
|
9
|
-
render() {
|
|
10
|
-
return t("svg", { key: "8a7e9df694b6cb8ad4ffdac16eda2f6f8c90913f", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "c4f9f76f3deed708c969f7c2784647196414c6c8", d: "M3 6H5H21", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "a5561ec74252af4054839f86642f85ac191f7edb", d: "M8 6V4C8 3.46957 8.21071 2.96086 8.58579 2.58579C8.96086 2.21071 9.46957 2 10 2H14C14.5304 2 15.0391 2.21071 15.4142 2.58579C15.7893 2.96086 16 3.46957 16 4V6M19 6V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V6H19Z", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "2eaaba52f039b93e5a65e8a7d5d97a9265e77f55", d: "M10 11V17", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "536c90ff05cc5e11b8e4c3c1a7b6656ea8acf8c8", d: "M14 11V17", stroke: "auto", "stroke-width": "1.5" }));
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
c.style = o;
|
|
14
|
-
export {
|
|
15
|
-
c as trash_fill_icon
|
|
16
|
-
};
|