@nylas/react 1.4.5 → 2.0.1
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/abstract-provider-efe136bd-2041bdce.js +187 -0
- package/dist/abstract-provider-efe136bd-b4663c02.cjs +1 -0
- package/dist/add-circle-icon_2.entry-5204c48a.cjs +1 -0
- package/dist/add-circle-icon_2.entry-ea1692a4.js +26 -0
- package/dist/archive-icon.entry-0b585dff.js +16 -0
- package/dist/archive-icon.entry-c2c66bca.cjs +1 -0
- package/dist/{arrow-icon.entry-5bb183c1.js → arrow-icon.entry-2e61394e.js} +5 -5
- package/dist/arrow-icon.entry-9d471162.cjs +1 -0
- package/dist/{bold-icon.entry-c919c71d.cjs → bold-icon.entry-5c37622f.cjs} +1 -1
- package/dist/{bold-icon.entry-e0010c60.js → bold-icon.entry-8ef1b653.js} +2 -2
- package/dist/{button-component_2.entry-078ee06a.cjs → button-component_2.entry-8335ee1e.cjs} +1 -1
- package/dist/{button-component_2.entry-1dd1b8d6.js → button-component_2.entry-c906230f.js} +9 -9
- package/dist/calendar-agenda-fill-icon_36.entry-59c0a997.cjs +6 -0
- package/dist/{calendar-agenda-fill-icon_36.entry-772a70d7.js → calendar-agenda-fill-icon_36.entry-5f184433.js} +900 -881
- package/dist/{calendar-cancel-icon.entry-b791b6b1.cjs → calendar-cancel-icon.entry-65a4a34e.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-7d1a7cea.js → calendar-cancel-icon.entry-dd6ac4db.js} +5 -5
- package/dist/{calendar-check-icon_2.entry-2380a4e6.cjs → calendar-check-icon_2.entry-ded15038.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-2b5711fd.js → calendar-check-icon_2.entry-f9b50bb8.js} +3 -3
- package/dist/{calendar-icon.entry-9b23c994.js → calendar-icon.entry-a2a1ddbc.js} +2 -2
- package/dist/{calendar-icon.entry-f88c8b09.cjs → calendar-icon.entry-ca512dd6.cjs} +1 -1
- package/dist/checkbox-component_2.entry-d6128246.js +115 -0
- package/dist/checkbox-component_2.entry-d79b5d1d.cjs +1 -0
- package/dist/checkbox-group_4.entry-2946c7ef.cjs +28 -0
- package/dist/{nylas-event-calendar_3.entry-cc428f95.js → checkbox-group_4.entry-e5145451.js} +1038 -923
- package/dist/{checkmark-icon_15.entry-3ddf90df.js → checkmark-icon_15.entry-6e92e93e.js} +21 -21
- package/dist/checkmark-icon_15.entry-a75a1825.cjs +5 -0
- package/dist/{chevron-icon_3.entry-af195326.js → chevron-icon_3.entry-6eaa3513.js} +16 -16
- package/dist/{chevron-icon_3.entry-a492d340.cjs → chevron-icon_3.entry-9193a885.cjs} +1 -1
- package/dist/{clock-icon_4.entry-7dc4324b.js → clock-icon_4.entry-2c93270e.js} +8 -8
- package/dist/{clock-icon_4.entry-530cd13b.cjs → clock-icon_4.entry-ae2272f4.cjs} +1 -1
- package/dist/constants-f51538ef-cd2a67c4.cjs +1 -0
- package/dist/{constants-3d8016e3-3c080f00.js → constants-f51538ef-e0a5f026.js} +27 -32
- package/dist/{customParseFormat-129be926-36eabae2.js → customParseFormat-edc38d83-b3722499.js} +1 -1
- package/dist/{customParseFormat-129be926-30b2af24.cjs → customParseFormat-edc38d83-fa9c77d9.cjs} +1 -1
- package/dist/{delete-icon.entry-3328484a.js → delete-icon.entry-6684eba6.js} +2 -2
- package/dist/{delete-icon.entry-9369bf78.cjs → delete-icon.entry-b9e4f2c7.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-f45be1c4.cjs → document-refresh-icon.entry-7afe6163.cjs} +1 -1
- package/dist/document-refresh-icon.entry-fba9f60b.js +16 -0
- package/dist/{feedbackSync-d943ffc7-d1e98ba0.js → feedbackSync-e4378c0b-23289195.js} +811 -798
- package/dist/{feedbackSync-d943ffc7-13f01c1f.cjs → feedbackSync-e4378c0b-7876d067.cjs} +26 -26
- package/dist/{folder-icon.entry-c4ffba45.js → folder-icon.entry-430c6b47.js} +4 -4
- package/dist/{folder-icon.entry-48cfa8d0.cjs → folder-icon.entry-b1632bf3.cjs} +1 -1
- package/dist/{forward-icon.entry-dd036273.js → forward-icon.entry-5e53da76.js} +2 -2
- package/dist/{forward-icon.entry-146f3318.cjs → forward-icon.entry-7626dcca.cjs} +1 -1
- package/dist/{globe-icon_2.entry-d6a95f6e.js → globe-icon_2.entry-646eae41.js} +21 -21
- package/dist/{globe-icon_2.entry-049fbca2.cjs → globe-icon_2.entry-bbb0a6ce.cjs} +1 -1
- package/dist/{google-logo-icon_6.entry-e26385cc.js → google-logo-icon_6.entry-5951a546.js} +665 -455
- package/dist/google-logo-icon_6.entry-e39dd9cb.cjs +2 -0
- package/dist/{google-meet-icon_5.entry-c0129f58.js → google-meet-icon_5.entry-a54c83da.js} +14 -14
- package/dist/{google-meet-icon_5.entry-94112d7e.cjs → google-meet-icon_5.entry-c13e0738.cjs} +1 -1
- package/dist/inbox-icon.entry-7bee82b3.js +16 -0
- package/dist/inbox-icon.entry-911b047a.cjs +1 -0
- package/dist/index-71f61ea9.js +24544 -0
- package/dist/index-f769bc2a.cjs +118 -0
- package/dist/index.d.ts +1 -4
- package/dist/index.es-6a9d55cf-122c27e0.js +2724 -0
- package/dist/index.es-6a9d55cf-458ba0e0.cjs +7 -0
- package/dist/{info-icon_2.entry-8bcd39dc.cjs → info-icon_2.entry-471b836b.cjs} +1 -1
- package/dist/{info-icon_2.entry-ef5dbccc.js → info-icon_2.entry-6ff2f004.js} +3 -3
- package/dist/{input-component.entry-922063d5.js → input-component.entry-781b584c.js} +12 -12
- package/dist/{input-component.entry-cc1fb2fa.cjs → input-component.entry-b6a9b4cb.cjs} +1 -1
- package/dist/{input-dropdown_2.entry-4041c294.js → input-dropdown_2.entry-1feebcba.js} +4 -4
- package/dist/{input-dropdown_2.entry-f3750e99.cjs → input-dropdown_2.entry-c71d14ff.cjs} +1 -1
- package/dist/{italic-icon.entry-63b6943f.cjs → italic-icon.entry-16debde5.cjs} +1 -1
- package/dist/italic-icon.entry-9ef7f4a2.js +16 -0
- package/dist/{elements → lib/elements}/index.d.ts +1 -1
- package/dist/lib/index.d.ts +5 -0
- package/dist/lib/main.d.ts +0 -0
- package/dist/lib/notetaker/CalendarSync/CalendarSync.d.ts +37 -0
- package/dist/lib/notetaker/CalendarSync/CalendarSync.spec.d.ts +0 -0
- package/dist/lib/notetaker/SendNotetaker/SendNotetaker.d.ts +31 -0
- package/dist/lib/notetaker/SendNotetaker/SendNotetaker.spec.d.ts +1 -0
- package/dist/lib/notetaker/Transcript/Transcript.d.ts +23 -0
- package/dist/lib/notetaker/Transcript/Transcript.spec.d.ts +0 -0
- package/dist/lib/notetaker/VideoPlayer/VideoPlayer.d.ts +22 -0
- package/dist/lib/notetaker/VideoPlayer/VideoPlayer.spec.d.ts +1 -0
- package/dist/lib/notetaker/index.d.ts +9 -0
- package/dist/lib/notetaker/lib/constants.d.ts +12 -0
- package/dist/lib/notetaker/lib/http-client.d.ts +2 -0
- package/dist/lib/notetaker/lib/primitives.d.ts +66 -0
- package/dist/lib/notetaker/lib/store.d.ts +7 -0
- package/dist/lib/notetaker/types.d.ts +42 -0
- package/dist/multi-select-dropdown.entry-0a6f9417.cjs +1 -0
- package/dist/multi-select-dropdown.entry-1b27c746.js +121 -0
- package/dist/nylas-booked-event-card_11.entry-74fba802.cjs +1 -0
- package/dist/{nylas-booked-event-card_12.entry-7eceb6b6.js → nylas-booked-event-card_11.entry-802671ee.js} +469 -534
- package/dist/{nylas-form-card.entry-984be5f9.cjs → nylas-form-card.entry-59a837c9.cjs} +1 -1
- package/dist/{nylas-form-card.entry-dd3f240a.js → nylas-form-card.entry-7da9a312.js} +3 -3
- package/dist/nylas-notification_2.entry-8f8bad34.cjs +1 -0
- package/dist/nylas-notification_2.entry-b16bb805.js +85 -0
- package/dist/{nylas-scheduler-editor.entry-623da747.js → nylas-scheduler-editor.entry-cbe3e1e3.js} +201 -168
- package/dist/nylas-scheduler-editor.entry-e33e11fb.cjs +2 -0
- package/dist/nylas-scheduling.entry-4223e50b.cjs +1 -0
- package/dist/{nylas-scheduling.entry-6608aa36.js → nylas-scheduling.entry-6fb094a8.js} +295 -295
- package/dist/{person-icon.entry-9f0233cd.js → person-icon.entry-6232e6fd.js} +7 -7
- package/dist/{person-icon.entry-168ba481.cjs → person-icon.entry-beb26b48.cjs} +1 -1
- package/dist/play-icon.entry-16a1c1ac.js +16 -0
- package/dist/{play-icon.entry-4115845d.cjs → play-icon.entry-9060d0d8.cjs} +1 -1
- package/dist/{radio-button-group.entry-da3f23ac.js → radio-button-group.entry-5a3728cd.js} +2 -2
- package/dist/{radio-button-group.entry-3ae5f246.cjs → radio-button-group.entry-6935c39d.cjs} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +135 -126
- package/dist/{refresh-icon.entry-13742bb5.cjs → refresh-icon.entry-2411b2e1.cjs} +1 -1
- package/dist/{refresh-icon.entry-e1db3ca5.js → refresh-icon.entry-4f56e72b.js} +2 -2
- package/dist/{register-component-083eb961-763c87e9.js → register-component-a1c3d7b4-774feacc.js} +1 -1
- package/dist/{register-component-083eb961-c5c48a1b.cjs → register-component-a1c3d7b4-97d7a6f5.cjs} +1 -1
- package/dist/{reply-all-icon.entry-9446c2d0.cjs → reply-all-icon.entry-b4b6926b.cjs} +1 -1
- package/dist/{reply-all-icon.entry-ded706c7.js → reply-all-icon.entry-b4b917ec.js} +2 -2
- package/dist/{reply-icon.entry-7c5c0fd9.js → reply-icon.entry-24f6f4c6.js} +5 -5
- package/dist/{reply-icon.entry-0d362c63.cjs → reply-icon.entry-454545ed.cjs} +1 -1
- package/dist/sent-icon.entry-d9a79336.cjs +1 -0
- package/dist/sent-icon.entry-fa59ce85.js +16 -0
- package/dist/spam-icon.entry-da39987e.cjs +1 -0
- package/dist/spam-icon.entry-fb18a08b.js +16 -0
- package/dist/{star-icon.entry-3a81207c.js → star-icon.entry-406472c1.js} +4 -4
- package/dist/{star-icon.entry-87823b56.cjs → star-icon.entry-833f35a7.cjs} +1 -1
- package/dist/{stop-icon.entry-472a11dc.js → stop-icon.entry-1b6ae838.js} +2 -2
- package/dist/{stop-icon.entry-ddf9242a.cjs → stop-icon.entry-3258db59.cjs} +1 -1
- package/dist/style.css +1 -0
- package/dist/test/vitest.setup.d.ts +0 -0
- package/dist/{textarea-component.entry-2c6c0c7e.cjs → textarea-component.entry-0ae18897.cjs} +1 -1
- package/dist/{textarea-component.entry-f9797150.js → textarea-component.entry-569a281e.js} +2 -2
- package/dist/{toggle-switch.entry-fbef6918.cjs → toggle-switch.entry-60d75f16.cjs} +1 -1
- package/dist/{toggle-switch.entry-a7cbc256.js → toggle-switch.entry-dc3f796b.js} +4 -4
- package/dist/{translate-icon.entry-0ab604fe.js → translate-icon.entry-297cf20f.js} +4 -4
- package/dist/{translate-icon.entry-2fe4868f.cjs → translate-icon.entry-c183ecb5.cjs} +1 -1
- package/dist/trash-fill-icon.entry-3d8a2e5e.js +16 -0
- package/dist/trash-fill-icon.entry-94d4f66c.cjs +1 -0
- package/dist/{underline-icon.entry-29366789.js → underline-icon.entry-4a9105c7.js} +2 -2
- package/dist/{underline-icon.entry-6a2ca451.cjs → underline-icon.entry-50d1e766.cjs} +1 -1
- package/package.json +41 -17
- package/dist/add-circle-icon_2.entry-55361a03.js +0 -26
- package/dist/add-circle-icon_2.entry-75a3df95.cjs +0 -1
- package/dist/archive-icon.entry-3c4e4b28.js +0 -16
- package/dist/archive-icon.entry-8aa151fd.cjs +0 -1
- package/dist/arrow-icon.entry-2cef5ca1.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_36.entry-9b694a33.cjs +0 -6
- package/dist/checkbox-component.entry-94fd68e7.js +0 -43
- package/dist/checkbox-component.entry-af77c4fa.cjs +0 -1
- package/dist/checkmark-icon_15.entry-de65b967.cjs +0 -5
- package/dist/constants-3d8016e3-fd6c3848.cjs +0 -1
- package/dist/document-refresh-icon.entry-902ead30.js +0 -16
- package/dist/google-logo-icon_6.entry-4d9e06be.cjs +0 -2
- package/dist/inbox-icon.entry-74d7a10d.js +0 -16
- package/dist/inbox-icon.entry-94683ba9.cjs +0 -1
- package/dist/index-3b0366ac.cjs +0 -57
- package/dist/index-6e735f92.js +0 -18483
- package/dist/index.es-4615d47c-9156501b.js +0 -2908
- package/dist/index.es-4615d47c-b7c254fe.cjs +0 -7
- package/dist/italic-icon.entry-6706da64.js +0 -16
- package/dist/multi-select-dropdown_2.entry-1096321d.cjs +0 -1
- package/dist/multi-select-dropdown_2.entry-e10a9439.js +0 -193
- package/dist/nylas-booked-event-card_12.entry-38f37135.cjs +0 -1
- package/dist/nylas-event-calendar_3.entry-7dad0f2f.cjs +0 -11
- package/dist/nylas-scheduler-editor.entry-8fb56081.cjs +0 -2
- package/dist/nylas-scheduling.entry-472ef577.cjs +0 -1
- package/dist/play-icon.entry-5fbfabb5.js +0 -16
- package/dist/sent-icon.entry-92434496.cjs +0 -1
- package/dist/sent-icon.entry-bc9d1b35.js +0 -16
- package/dist/spam-icon.entry-11370b68.js +0 -16
- package/dist/spam-icon.entry-e0313c63.cjs +0 -1
- package/dist/trash-fill-icon.entry-1904e8d6.cjs +0 -1
- package/dist/trash-fill-icon.entry-4bdfb061.js +0 -16
- package/dist/warning-icon.entry-1649ffe7.js +0 -16
- package/dist/warning-icon.entry-3f848ed6.cjs +0 -1
- /package/dist/{elements → lib/elements}/react-component-lib/createComponent.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/createOverlayComponent.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/index.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/interfaces.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/utils/attachProps.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/utils/case.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/utils/dev.d.ts +0 -0
- /package/dist/{elements → lib/elements}/react-component-lib/utils/index.d.ts +0 -0
|
@@ -1,132 +1,121 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { i as d, r as K, a as F, b as A, k as M, l as X, m as Q, h as a, H as P, g as V, e as ee, F as te } from "./index-71f61ea9.js";
|
|
2
|
+
import { N as ie } from "./abstract-provider-efe136bd-2041bdce.js";
|
|
3
|
+
import { E as U, i as ne, a as se, f as oe, c as re, b as ae } from "./feedbackSync-e4378c0b-23289195.js";
|
|
4
|
+
import { n as j } from "./index.es-6a9d55cf-122c27e0.js";
|
|
5
|
+
import { L as le } from "./constants-f51538ef-e0a5f026.js";
|
|
5
6
|
import "react";
|
|
6
7
|
import "react/jsx-runtime";
|
|
7
8
|
import "react-dom";
|
|
8
|
-
|
|
9
|
-
(function(i) {
|
|
10
|
-
i.Error = "error", i.Warning = "warning", i.Info = "info", i.Success = "success";
|
|
11
|
-
})(J || (J = {}));
|
|
12
|
-
var z;
|
|
13
|
-
(function(i) {
|
|
14
|
-
i.Component = "component", i.Api = "api", i.Auth = "auth";
|
|
15
|
-
})(z || (z = {}));
|
|
16
|
-
var Y;
|
|
17
|
-
(function(i) {
|
|
18
|
-
i.endtime_not_in_future = "endtime_not_in_future", i.no_booking_info = "no_booking_info", i.no_timeslot_selected = "no_timeslot_selected", i.no_timezone_selected = "no_timezone_selected", i.no_booking_id = "no_booking_id", i.no_salt = "no_salt", i.invalid_start_time = "invalid_start_time", i.invalid_end_time = "invalid_end_time", i.invalid_timezone = "invalid_timezone", i.no_config_id = "no_config_id";
|
|
19
|
-
})(Y || (Y = {}));
|
|
20
|
-
class he {
|
|
9
|
+
class ce {
|
|
21
10
|
constructor() {
|
|
22
11
|
this.component = (e) => {
|
|
23
|
-
const t =
|
|
12
|
+
const t = U.Component, s = `${e} Error`;
|
|
24
13
|
return {
|
|
25
|
-
endtime_not_in_future: (
|
|
14
|
+
endtime_not_in_future: (i = '"endtime" can not be in the future') => ({
|
|
26
15
|
title: s,
|
|
27
|
-
message:
|
|
16
|
+
message: i,
|
|
28
17
|
category: t
|
|
29
18
|
}),
|
|
30
|
-
no_booking_info: (
|
|
19
|
+
no_booking_info: (i = "No booking info provided") => ({
|
|
31
20
|
title: s,
|
|
32
|
-
message:
|
|
21
|
+
message: i,
|
|
33
22
|
category: t
|
|
34
23
|
}),
|
|
35
|
-
no_timeslot_selected: (
|
|
24
|
+
no_timeslot_selected: (i = "No timeslot selected") => ({
|
|
36
25
|
title: s,
|
|
37
|
-
message:
|
|
26
|
+
message: i,
|
|
38
27
|
category: t
|
|
39
28
|
}),
|
|
40
|
-
no_timezone_selected: (
|
|
29
|
+
no_timezone_selected: (i = "No timezone selected") => ({
|
|
41
30
|
title: s,
|
|
42
|
-
message:
|
|
31
|
+
message: i,
|
|
43
32
|
category: t
|
|
44
33
|
}),
|
|
45
|
-
no_booking_id: (
|
|
34
|
+
no_booking_id: (i = "No booking id provided") => ({
|
|
46
35
|
title: s,
|
|
47
|
-
message:
|
|
36
|
+
message: i,
|
|
48
37
|
category: t
|
|
49
38
|
}),
|
|
50
|
-
no_salt: (
|
|
39
|
+
no_salt: (i = "No salt provided") => ({
|
|
51
40
|
title: s,
|
|
52
|
-
message:
|
|
41
|
+
message: i,
|
|
53
42
|
category: t
|
|
54
43
|
}),
|
|
55
|
-
invalid_start_time: (
|
|
44
|
+
invalid_start_time: (i = "Invalid start time") => ({
|
|
56
45
|
title: s,
|
|
57
|
-
message:
|
|
46
|
+
message: i,
|
|
58
47
|
category: t
|
|
59
48
|
}),
|
|
60
|
-
invalid_end_time: (
|
|
49
|
+
invalid_end_time: (i = "Invalid end time") => ({
|
|
61
50
|
title: s,
|
|
62
|
-
message:
|
|
51
|
+
message: i,
|
|
63
52
|
category: t
|
|
64
53
|
}),
|
|
65
|
-
invalid_timezone: (
|
|
54
|
+
invalid_timezone: (i = "Invalid timezone") => ({
|
|
66
55
|
title: s,
|
|
67
|
-
message:
|
|
56
|
+
message: i,
|
|
68
57
|
category: t
|
|
69
58
|
}),
|
|
70
|
-
no_config_id: (
|
|
59
|
+
no_config_id: (i = "No configuration id provided") => ({
|
|
71
60
|
title: s,
|
|
72
|
-
message:
|
|
61
|
+
message: i,
|
|
73
62
|
category: t
|
|
74
63
|
})
|
|
75
64
|
};
|
|
76
65
|
}, this.api = (e) => {
|
|
77
|
-
const t =
|
|
66
|
+
const t = U.Api, s = `${e} Error`;
|
|
78
67
|
return {
|
|
79
|
-
invalid_session: (
|
|
68
|
+
invalid_session: (i) => ({
|
|
80
69
|
title: s,
|
|
81
|
-
message:
|
|
70
|
+
message: i,
|
|
82
71
|
category: t
|
|
83
72
|
}),
|
|
84
|
-
general_error: (
|
|
73
|
+
general_error: (i) => ({
|
|
85
74
|
title: s,
|
|
86
|
-
message:
|
|
75
|
+
message: i,
|
|
87
76
|
category: t
|
|
88
77
|
}),
|
|
89
|
-
internal_error: (
|
|
78
|
+
internal_error: (i) => ({
|
|
90
79
|
title: s,
|
|
91
|
-
message:
|
|
80
|
+
message: i,
|
|
92
81
|
category: t
|
|
93
82
|
}),
|
|
94
|
-
invalid_request_error: (
|
|
83
|
+
invalid_request_error: (i) => ({
|
|
95
84
|
title: s,
|
|
96
|
-
message:
|
|
85
|
+
message: i,
|
|
97
86
|
category: t
|
|
98
87
|
}),
|
|
99
|
-
timeslot_not_available: (
|
|
88
|
+
timeslot_not_available: (i) => ({
|
|
100
89
|
title: s,
|
|
101
|
-
message:
|
|
90
|
+
message: i,
|
|
102
91
|
category: t
|
|
103
92
|
}),
|
|
104
|
-
provider_error: (
|
|
93
|
+
provider_error: (i) => ({
|
|
105
94
|
title: s,
|
|
106
|
-
message:
|
|
95
|
+
message: i,
|
|
107
96
|
category: t
|
|
108
97
|
}),
|
|
109
|
-
not_found_error: (
|
|
98
|
+
not_found_error: (i) => ({
|
|
110
99
|
title: s,
|
|
111
|
-
message:
|
|
100
|
+
message: i,
|
|
112
101
|
category: t
|
|
113
102
|
})
|
|
114
103
|
};
|
|
115
104
|
};
|
|
116
105
|
}
|
|
117
106
|
}
|
|
118
|
-
class
|
|
119
|
-
constructor({ schedulerAPIURL: e, schedulerStore: t, sessionId: s, configId:
|
|
120
|
-
this.errors = new
|
|
107
|
+
class de {
|
|
108
|
+
constructor({ schedulerAPIURL: e, schedulerStore: t, sessionId: s, configId: i, slug: r, clientId: o }) {
|
|
109
|
+
this.errors = new ce(), this.schedulerStore = t, this.schedulerAPIURL = e, this.sessionId = s, this.configId = i, this.slug = r, this.clientId = o;
|
|
121
110
|
}
|
|
122
111
|
getHeaders() {
|
|
123
112
|
return this.sessionId ? {
|
|
124
113
|
Authorization: `Bearer ${this.sessionId}`
|
|
125
114
|
} : {};
|
|
126
115
|
}
|
|
127
|
-
async makeAPIRequest(e, t, s,
|
|
116
|
+
async makeAPIRequest(e, t, s, i = {}) {
|
|
128
117
|
try {
|
|
129
|
-
const r = new URL(this.schedulerAPIURL), o = "
|
|
118
|
+
const r = new URL(this.schedulerAPIURL), o = "2.0.1";
|
|
130
119
|
return r.pathname = e, await (await fetch(decodeURIComponent(r.toString()), {
|
|
131
120
|
method: t,
|
|
132
121
|
headers: {
|
|
@@ -134,7 +123,7 @@ class ge {
|
|
|
134
123
|
Origin: window.location.origin,
|
|
135
124
|
"X-Source": "nylas-scheduling",
|
|
136
125
|
"X-Nylas-Web-Elements-Version": o,
|
|
137
|
-
...
|
|
126
|
+
...i
|
|
138
127
|
},
|
|
139
128
|
body: s
|
|
140
129
|
})).json();
|
|
@@ -149,9 +138,9 @@ class ge {
|
|
|
149
138
|
}
|
|
150
139
|
}
|
|
151
140
|
getErrorMessage(e) {
|
|
152
|
-
var s,
|
|
141
|
+
var s, i, r, o;
|
|
153
142
|
let t = (e == null ? void 0 : e.message) || (e == null ? void 0 : e.title) || "Something went wrong";
|
|
154
|
-
return (e == null ? void 0 : e.type) === "provider_error" && (t = ((
|
|
143
|
+
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) || ((o = (r = e == null ? void 0 : e.provider_error) == null ? void 0 : r.error) == null ? void 0 : o.title) || "Something went wrong"), t;
|
|
155
144
|
}
|
|
156
145
|
setConfigId(e) {
|
|
157
146
|
this.configId = e;
|
|
@@ -166,7 +155,7 @@ class ge {
|
|
|
166
155
|
this.schedulerStore.set("selectedTimezone", e);
|
|
167
156
|
}
|
|
168
157
|
selectLanguage(e) {
|
|
169
|
-
this.schedulerStore.set("selectedLanguage", e),
|
|
158
|
+
this.schedulerStore.set("selectedLanguage", e), d.changeLanguage(e);
|
|
170
159
|
}
|
|
171
160
|
async toggleAdditionalData(e) {
|
|
172
161
|
e || await this.refetchAvailability(), this.schedulerStore.set("showBookingForm", e);
|
|
@@ -192,13 +181,13 @@ class ge {
|
|
|
192
181
|
});
|
|
193
182
|
}
|
|
194
183
|
async refetchAvailability() {
|
|
195
|
-
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,
|
|
196
|
-
return await this.getAvailability(s,
|
|
184
|
+
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;
|
|
185
|
+
return await this.getAvailability(s, i);
|
|
197
186
|
}
|
|
198
187
|
async resetStoreStateAndFetchAvailability() {
|
|
199
188
|
const e = /* @__PURE__ */ new Date(), t = await this.refetchAvailability(), s = this.schedulerStore.get("availability").find((r) => new Date(r.start_time) > /* @__PURE__ */ new Date());
|
|
200
|
-
let
|
|
201
|
-
return s && (
|
|
189
|
+
let i = e;
|
|
190
|
+
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;
|
|
202
191
|
}
|
|
203
192
|
async setReschedule(e) {
|
|
204
193
|
this.schedulerStore.set("isLoading", !0);
|
|
@@ -227,24 +216,24 @@ class ge {
|
|
|
227
216
|
async bookTimeslot(e) {
|
|
228
217
|
var x, w, L;
|
|
229
218
|
this.schedulerStore.set("isLoading", !0);
|
|
230
|
-
const { selectedTimeslot: t, selectedTimezone: s, bookingInfo:
|
|
231
|
-
if (!e && !
|
|
232
|
-
return { error: this.errors.component(
|
|
219
|
+
const { selectedTimeslot: t, selectedTimezone: s, bookingInfo: i, selectedLanguage: r } = this.schedulerStore.state;
|
|
220
|
+
if (!e && !i)
|
|
221
|
+
return { error: this.errors.component(d.t("createBookingErrorTitle")).no_booking_info() };
|
|
233
222
|
const o = (e == null ? void 0 : e.timeslot) || t;
|
|
234
223
|
if (!o)
|
|
235
|
-
return { error: this.errors.component(
|
|
236
|
-
const l = e && (e != null && e.timezone) ? e == null ? void 0 : e.timezone : s,
|
|
224
|
+
return { error: this.errors.component(d.t("createBookingErrorTitle")).no_timeslot_selected() };
|
|
225
|
+
const l = e && (e != null && e.timezone) ? e == null ? void 0 : e.timezone : s, c = r || "en-US";
|
|
237
226
|
if (!l)
|
|
238
|
-
return { error: this.errors.component(
|
|
227
|
+
return { error: this.errors.component(d.t("createBookingErrorTitle")).no_timezone_selected() };
|
|
239
228
|
const f = [...this.schedulerStore.get("availabilityOrderEmails")];
|
|
240
229
|
let h = "";
|
|
241
230
|
const u = (o == null ? void 0 : o.emails) || [], g = {};
|
|
242
|
-
Object.entries((
|
|
243
|
-
g[
|
|
231
|
+
Object.entries((i == null ? void 0 : i.additionalFields) || {}).forEach(([_, B]) => {
|
|
232
|
+
g[_] = B.value;
|
|
244
233
|
});
|
|
245
|
-
const p = e ? e == null ? void 0 : e.primaryParticipant :
|
|
234
|
+
const p = e ? e == null ? void 0 : e.primaryParticipant : i == null ? void 0 : i.primaryParticipant, b = e ? (e == null ? void 0 : e.guests) || [] : (i == null ? void 0 : i.guests) || [], S = e ? e == null ? void 0 : e.additionalFields : g, m = this.getHeaders(), I = `/v3/scheduling/bookings${!this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : ""}`;
|
|
246
235
|
if (f.length === 0) {
|
|
247
|
-
const
|
|
236
|
+
const _ = await this.makeAPIRequest(decodeURIComponent(I), "POST", JSON.stringify({
|
|
248
237
|
additional_fields: S,
|
|
249
238
|
additional_guests: b,
|
|
250
239
|
guest: { ...p },
|
|
@@ -254,14 +243,14 @@ class ge {
|
|
|
254
243
|
event_id: (o == null ? void 0 : o.event_id) || void 0,
|
|
255
244
|
master_id: (o == null ? void 0 : o.master_id) || void 0,
|
|
256
245
|
calendar_id: (o == null ? void 0 : o.calendar_id) || void 0,
|
|
257
|
-
email_language: this.getTwoLetterLanguageCode(
|
|
246
|
+
email_language: this.getTwoLetterLanguageCode(c)
|
|
258
247
|
}), m);
|
|
259
|
-
return this.schedulerStore.set("isLoading", !1), "data" in
|
|
248
|
+
return this.schedulerStore.set("isLoading", !1), "data" in _ ? (this.schedulerStore.set("eventInfo", _.data), _) : { error: _.error };
|
|
260
249
|
}
|
|
261
250
|
for (; f.length > 0; ) {
|
|
262
251
|
if (h = f.shift(), !u.includes(h))
|
|
263
252
|
continue;
|
|
264
|
-
const
|
|
253
|
+
const _ = await this.makeAPIRequest(decodeURIComponent(I), "POST", JSON.stringify({
|
|
265
254
|
participants: h ? [{ email: h }] : void 0,
|
|
266
255
|
additional_fields: S,
|
|
267
256
|
additional_guests: b,
|
|
@@ -269,25 +258,25 @@ class ge {
|
|
|
269
258
|
start_time: o.start_time.getTime() / 1e3,
|
|
270
259
|
end_time: o.end_time.getTime() / 1e3,
|
|
271
260
|
timezone: l,
|
|
272
|
-
email_language: this.getTwoLetterLanguageCode(
|
|
261
|
+
email_language: this.getTwoLetterLanguageCode(c)
|
|
273
262
|
}), m);
|
|
274
|
-
if ("data" in
|
|
275
|
-
return this.schedulerStore.set("isLoading", !1), this.schedulerStore.set("eventInfo",
|
|
276
|
-
if ((w = (x =
|
|
263
|
+
if ("data" in _)
|
|
264
|
+
return this.schedulerStore.set("isLoading", !1), this.schedulerStore.set("eventInfo", _ == null ? void 0 : _.data), _;
|
|
265
|
+
if ((w = (x = _.error) == null ? void 0 : x.message) != null && w.startsWith("The selected timeslot is unavailable"))
|
|
277
266
|
continue;
|
|
278
267
|
{
|
|
279
268
|
this.schedulerStore.set("isLoading", !1);
|
|
280
|
-
const B = (L =
|
|
281
|
-
let D =
|
|
282
|
-
if (B && B in this.errors.api(
|
|
283
|
-
const
|
|
284
|
-
D = this.errors.api(
|
|
269
|
+
const B = (L = _.error) == null ? void 0 : L.type;
|
|
270
|
+
let D = _.error;
|
|
271
|
+
if (B && B in this.errors.api(d.t("createBookingErrorTitle"))) {
|
|
272
|
+
const O = this.getErrorMessage(D);
|
|
273
|
+
D = this.errors.api(d.t("createBookingErrorTitle"))[B](O);
|
|
285
274
|
}
|
|
286
275
|
return { error: D };
|
|
287
276
|
}
|
|
288
277
|
}
|
|
289
278
|
return this.schedulerStore.set("isLoading", !1), {
|
|
290
|
-
error: this.errors.api(
|
|
279
|
+
error: this.errors.api(d.t("createBookingErrorTitle")).timeslot_not_available("The selected timeslot is unavailable")
|
|
291
280
|
};
|
|
292
281
|
}
|
|
293
282
|
async getUISettings() {
|
|
@@ -296,12 +285,12 @@ class ge {
|
|
|
296
285
|
const e = this.schedulerStore.get("rescheduleBookingId"), t = this.getHeaders();
|
|
297
286
|
let s = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "";
|
|
298
287
|
e && s ? s += `&booking_id=${e}` : e && (s += `?booking_id=${e}`);
|
|
299
|
-
const
|
|
288
|
+
const i = `/v3/scheduling/ui-settings${s}`, r = await this.makeAPIRequest(i, "GET", void 0, t);
|
|
300
289
|
if ("error" in r) {
|
|
301
290
|
this.schedulerStore.set("isLoading", !1);
|
|
302
291
|
const l = (o = r.error) == null ? void 0 : o.type;
|
|
303
|
-
let
|
|
304
|
-
return l && l in this.errors.api(
|
|
292
|
+
let c = r.error;
|
|
293
|
+
return l && l in this.errors.api(d.t("getUISettingErrorTitle")) && (c = this.errors.api(d.t("getUISettingErrorTitle"))[l]((c == null ? void 0 : c.message) || (c == null ? void 0 : c.title) || "Something went wrong")), { error: c };
|
|
305
294
|
}
|
|
306
295
|
return "data" in r && this.schedulerStore.set("configSettings", r.data), this.schedulerStore.set("isLoading", !1), r;
|
|
307
296
|
}
|
|
@@ -313,26 +302,26 @@ class ge {
|
|
|
313
302
|
const t = (r = this.schedulerStore.get("configSettings")) == null ? void 0 : r.scheduler, s = t == null ? void 0 : t.min_booking_notice;
|
|
314
303
|
if (!s)
|
|
315
304
|
return e;
|
|
316
|
-
const
|
|
317
|
-
return e < (
|
|
305
|
+
const i = (/* @__PURE__ */ new Date()).getTime();
|
|
306
|
+
return e < (i + s * 60 * 1e3) / 1e3 ? Math.floor((i + s * 60 * 1e3) / 1e3) : e;
|
|
318
307
|
}
|
|
319
308
|
getEndTimeForAvailableDaysInFuture(e) {
|
|
320
309
|
var o, l;
|
|
321
|
-
const t = /* @__PURE__ */ new Date(), s = (l = (o = this.schedulerStore.get("configSettings")) == null ? void 0 : o.scheduler) == null ? void 0 : l.available_days_in_future,
|
|
322
|
-
return Math.min(
|
|
310
|
+
const t = /* @__PURE__ */ new Date(), s = (l = (o = this.schedulerStore.get("configSettings")) == null ? void 0 : o.scheduler) == null ? void 0 : l.available_days_in_future, i = Math.floor(X(t, s).getTime() / 1e3);
|
|
311
|
+
return Math.min(i, e);
|
|
323
312
|
}
|
|
324
313
|
async getAvailability(e = 0, t = 0) {
|
|
325
314
|
var g, p, b, S;
|
|
326
315
|
this.schedulerStore.set("isLoading", !0);
|
|
327
|
-
const s = new URLSearchParams(),
|
|
316
|
+
const s = new URLSearchParams(), i = /* @__PURE__ */ new Date(), r = i.getTime();
|
|
328
317
|
if (t && t < r / 1e3)
|
|
329
|
-
return this.schedulerStore.set("isLoading", !1), { error: this.errors.component(
|
|
318
|
+
return this.schedulerStore.set("isLoading", !1), { error: this.errors.component(d.t("getAvailabilityErrorTitle")).endtime_not_in_future() };
|
|
330
319
|
if (!e) {
|
|
331
|
-
const m = new Date(
|
|
320
|
+
const m = new Date(i.getFullYear(), i.getMonth(), 1);
|
|
332
321
|
e = Math.floor(m.getTime() / 1e3);
|
|
333
322
|
}
|
|
334
323
|
if (!t) {
|
|
335
|
-
const m = new Date(
|
|
324
|
+
const m = new Date(i.getFullYear(), i.getMonth() + 1, 0);
|
|
336
325
|
t = Math.floor(m.getTime() / 1e3);
|
|
337
326
|
}
|
|
338
327
|
t = this.getEndTimeForAvailableDaysInFuture(t);
|
|
@@ -340,14 +329,14 @@ class ge {
|
|
|
340
329
|
e = o, t = o > t ? o + 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)));
|
|
341
330
|
const l = this.schedulerStore.get("rescheduleBookingId");
|
|
342
331
|
l && s.append("booking_id", encodeURIComponent(l));
|
|
343
|
-
const
|
|
332
|
+
const c = s.toString(), f = `/v3/scheduling/availability${c ? `?${c}` : ""}`, h = this.getHeaders(), u = await this.makeAPIRequest(decodeURIComponent(f), "GET", void 0, h);
|
|
344
333
|
if ("error" in u) {
|
|
345
334
|
this.schedulerStore.set("availability", []), this.schedulerStore.set("isLoading", !1);
|
|
346
335
|
const m = (g = u.error) == null ? void 0 : g.type;
|
|
347
336
|
let k = u.error;
|
|
348
|
-
if (m && m in this.errors.api(
|
|
337
|
+
if (m && m in this.errors.api(d.t("getAvailabilityErrorTitle"))) {
|
|
349
338
|
const I = this.getErrorMessage(k);
|
|
350
|
-
k = this.errors.api(
|
|
339
|
+
k = this.errors.api(d.t("getAvailabilityErrorTitle"))[m](I);
|
|
351
340
|
}
|
|
352
341
|
return { error: k };
|
|
353
342
|
}
|
|
@@ -366,18 +355,18 @@ class ge {
|
|
|
366
355
|
async cancelBooking(e, t) {
|
|
367
356
|
var l;
|
|
368
357
|
if (this.schedulerStore.set("isLoading", !0), !e)
|
|
369
|
-
return { error: this.errors.component(
|
|
370
|
-
const s = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "",
|
|
358
|
+
return { error: this.errors.component(d.t("cancelBookingErrorTitle")).no_booking_id() };
|
|
359
|
+
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}`, r = this.getHeaders(), o = await this.makeAPIRequest(decodeURIComponent(i), "DELETE", JSON.stringify({
|
|
371
360
|
action: "cancel",
|
|
372
361
|
cancellation_reason: t
|
|
373
362
|
}), r);
|
|
374
363
|
if ("error" in o) {
|
|
375
364
|
this.schedulerStore.set("isLoading", !1);
|
|
376
|
-
const
|
|
365
|
+
const c = (l = o.error) == null ? void 0 : l.type;
|
|
377
366
|
let f = o.error;
|
|
378
|
-
if (
|
|
367
|
+
if (c && c in this.errors.api(d.t("cancelBookingErrorTitle"))) {
|
|
379
368
|
const h = this.getErrorMessage(f);
|
|
380
|
-
f = this.errors.api(
|
|
369
|
+
f = this.errors.api(d.t("cancelBookingErrorTitle"))[c](h);
|
|
381
370
|
}
|
|
382
371
|
return { error: f };
|
|
383
372
|
}
|
|
@@ -388,13 +377,13 @@ class ge {
|
|
|
388
377
|
async rescheduleBooking(e, t) {
|
|
389
378
|
var R;
|
|
390
379
|
if (this.schedulerStore.set("isLoading", !0), !e)
|
|
391
|
-
return { error: this.errors.component(
|
|
392
|
-
const s = this.errors.api(
|
|
380
|
+
return { error: this.errors.component(d.t("rescheduleBookingErrorTitle")).no_booking_id() };
|
|
381
|
+
const s = this.errors.api(d.t("rescheduleBookingErrorTitle")), i = this.errors.component(d.t("rescheduleBookingErrorTitle")), { bookingInfo: r, selectedTimeslot: o, selectedTimezone: l, selectedLanguage: c } = this.schedulerStore.state, { startTime: f, endTime: h, timezone: u } = t, g = f || (o == null ? void 0 : o.start_time);
|
|
393
382
|
if (!g)
|
|
394
|
-
return { error:
|
|
383
|
+
return { error: i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
|
|
395
384
|
const p = h || (o == null ? void 0 : o.end_time);
|
|
396
385
|
if (!p)
|
|
397
|
-
return { error:
|
|
386
|
+
return { error: i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
|
|
398
387
|
const b = this.schedulerStore.get("availabilityOrderEmails");
|
|
399
388
|
let S = "";
|
|
400
389
|
if (b.length > 0) {
|
|
@@ -407,24 +396,24 @@ class ge {
|
|
|
407
396
|
}
|
|
408
397
|
const m = u || l;
|
|
409
398
|
if (!m)
|
|
410
|
-
return { error:
|
|
399
|
+
return { error: i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.') };
|
|
411
400
|
const k = (o == null ? void 0 : o.event_id) || void 0, I = (o == null ? void 0 : o.master_id) || void 0, x = (o == null ? void 0 : o.calendar_id) || void 0, w = {};
|
|
412
401
|
Object.entries((r == null ? void 0 : r.additionalFields) || {}).forEach(([v, E]) => {
|
|
413
402
|
w[v] = E.value;
|
|
414
403
|
});
|
|
415
|
-
const L = t ? t == null ? void 0 : t.primaryParticipant : r == null ? void 0 : r.primaryParticipant,
|
|
404
|
+
const L = t ? t == null ? void 0 : t.primaryParticipant : r == null ? void 0 : r.primaryParticipant, _ = t ? (t == null ? void 0 : t.guests) || [] : (r == null ? void 0 : r.guests) || [], B = t ? t == null ? void 0 : t.additionalFields : w, D = !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/${e}${D}`, y = this.getHeaders(), C = await this.makeAPIRequest(decodeURIComponent(O), "PATCH", JSON.stringify({
|
|
416
405
|
start_time: g.getTime() / 1e3,
|
|
417
406
|
end_time: p.getTime() / 1e3,
|
|
418
407
|
timezone: m,
|
|
419
408
|
additional_fields: B,
|
|
420
409
|
guest: { ...L },
|
|
421
|
-
additional_guests:
|
|
410
|
+
additional_guests: _,
|
|
422
411
|
participants: S ? [{ email: S }] : void 0,
|
|
423
|
-
email_language: this.getTwoLetterLanguageCode(
|
|
412
|
+
email_language: this.getTwoLetterLanguageCode(c),
|
|
424
413
|
event_id: k,
|
|
425
414
|
master_id: I,
|
|
426
415
|
calendar_id: x
|
|
427
|
-
}),
|
|
416
|
+
}), y);
|
|
428
417
|
if ("error" in C) {
|
|
429
418
|
this.schedulerStore.set("isLoading", !1);
|
|
430
419
|
const v = (R = C.error) == null ? void 0 : R.type;
|
|
@@ -451,14 +440,14 @@ class ge {
|
|
|
451
440
|
async updateBooking(e) {
|
|
452
441
|
var u;
|
|
453
442
|
this.schedulerStore.set("isLoading", !0);
|
|
454
|
-
const { bookingId: t, status: s, reason:
|
|
443
|
+
const { bookingId: t, status: s, reason: i } = e, r = this.schedulerStore.get("organizerConfirmationSalt"), o = s === "confirmed" ? d.t("confirmBookingErrorTitle") : d.t("rejectBookingErrorTitle");
|
|
455
444
|
if (!t)
|
|
456
445
|
return { error: this.errors.component(o).no_booking_id() };
|
|
457
446
|
if (!r)
|
|
458
447
|
return { error: this.errors.component(o).no_salt() };
|
|
459
|
-
const l = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "",
|
|
448
|
+
const l = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : !this.sessionId && this.slug && this.clientId ? `?slug=${this.slug}&client_id=${this.clientId}` : "", c = `/v3/scheduling/bookings/${t}${l}`, f = this.getHeaders(), h = await this.makeAPIRequest(decodeURIComponent(c), "PUT", JSON.stringify({
|
|
460
449
|
status: s,
|
|
461
|
-
cancellation_reason:
|
|
450
|
+
cancellation_reason: i,
|
|
462
451
|
salt: r
|
|
463
452
|
}), f);
|
|
464
453
|
if ("error" in h) {
|
|
@@ -480,43 +469,43 @@ class ge {
|
|
|
480
469
|
this.schedulerStore.set("isLoading", !0);
|
|
481
470
|
const t = (o = this.schedulerStore.get("configSettings")) == null ? void 0 : o.configuration_id;
|
|
482
471
|
if (!t)
|
|
483
|
-
return { error: this.errors.component(
|
|
484
|
-
const s = this.getHeaders(),
|
|
472
|
+
return { error: this.errors.component(d.t("validateTimeslotErrorTitle")).no_config_id() };
|
|
473
|
+
const s = this.getHeaders(), i = `/v3/scheduling/configurations/${t}/group-events/validate-timeslot`, r = await this.makeAPIRequest(decodeURIComponent(i), "POST", JSON.stringify({
|
|
485
474
|
...e,
|
|
486
475
|
start_time: e.start_time.getTime() / 1e3,
|
|
487
476
|
end_time: e.end_time.getTime() / 1e3
|
|
488
477
|
}), s);
|
|
489
478
|
if ("error" in r) {
|
|
490
479
|
this.schedulerStore.set("isLoading", !1);
|
|
491
|
-
const
|
|
480
|
+
const c = (l = r.error) == null ? void 0 : l.type;
|
|
492
481
|
let f = r.error;
|
|
493
|
-
if (
|
|
482
|
+
if (c && c in this.errors.api(d.t("validateTimeslotErrorTitle"))) {
|
|
494
483
|
const h = this.getErrorMessage(f);
|
|
495
|
-
f = this.errors.api(
|
|
484
|
+
f = this.errors.api(d.t("validateTimeslotErrorTitle"))[c](h);
|
|
496
485
|
}
|
|
497
486
|
return this.refetchAvailability(), { error: f };
|
|
498
487
|
}
|
|
499
488
|
return this.schedulerStore.set("selectedTimeslot", e), this.schedulerStore.set("showBookingForm", !0), this.schedulerStore.set("isLoading", !1), r;
|
|
500
489
|
}
|
|
501
490
|
}
|
|
502
|
-
class
|
|
503
|
-
constructor({ schedulerAPIURL: e, nylasSchedulerStore: t, sessionId: s, configId:
|
|
491
|
+
class he {
|
|
492
|
+
constructor({ schedulerAPIURL: e, nylasSchedulerStore: t, sessionId: s, configId: i, slug: r, clientId: o }) {
|
|
504
493
|
if (!e)
|
|
505
494
|
throw new Error("schedulerAPIURL is required");
|
|
506
495
|
if (!t)
|
|
507
496
|
throw new Error("nylasSchedulerStore is required");
|
|
508
|
-
if (!s && !
|
|
497
|
+
if (!s && !i && !(r || o))
|
|
509
498
|
throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.");
|
|
510
|
-
e === "/" && (e = new URL(window.location.href).origin), this.configId =
|
|
499
|
+
e === "/" && (e = new URL(window.location.href).origin), this.configId = i, this.sessionId = s, this.schedulerAPIURL = e, this.nylasSchedulerStore = t, this.slug = r, this.clientId = o;
|
|
511
500
|
}
|
|
512
501
|
init() {
|
|
513
|
-
|
|
502
|
+
A("NylasConnector init");
|
|
514
503
|
}
|
|
515
504
|
get schedulerStore() {
|
|
516
505
|
return this.nylasSchedulerStore;
|
|
517
506
|
}
|
|
518
507
|
get scheduler() {
|
|
519
|
-
return this._schedulerAPIConnector ? this._schedulerAPIConnector : (this._schedulerAPIConnector = new
|
|
508
|
+
return this._schedulerAPIConnector ? this._schedulerAPIConnector : (this._schedulerAPIConnector = new de({
|
|
520
509
|
schedulerAPIURL: this.schedulerAPIURL,
|
|
521
510
|
schedulerStore: this.schedulerStore,
|
|
522
511
|
sessionId: this.sessionId,
|
|
@@ -529,7 +518,7 @@ class ue {
|
|
|
529
518
|
this.nylasSchedulerStore.reset();
|
|
530
519
|
}
|
|
531
520
|
}
|
|
532
|
-
function
|
|
521
|
+
function ge(n = {}) {
|
|
533
522
|
const e = {
|
|
534
523
|
selectedDate: null,
|
|
535
524
|
selectedLanguage: navigator.language,
|
|
@@ -545,30 +534,30 @@ function fe(i = {}) {
|
|
|
545
534
|
cancelledEventInfo: null,
|
|
546
535
|
isLoading: !1,
|
|
547
536
|
nylasBranding: !0,
|
|
548
|
-
...
|
|
537
|
+
...n
|
|
549
538
|
};
|
|
550
|
-
|
|
551
|
-
const t =
|
|
539
|
+
A("[defaultNylasStoreState]: ", e);
|
|
540
|
+
const t = ee(e);
|
|
552
541
|
return t.onChange("availability", (s) => {
|
|
553
|
-
|
|
554
|
-
const
|
|
555
|
-
|
|
542
|
+
A("[availability]: ", s);
|
|
543
|
+
const i = s.map((l) => l.start_time);
|
|
544
|
+
A("[selectableDates]: ", i), t.set("selectableDates", i);
|
|
556
545
|
const r = s[0];
|
|
557
546
|
if (!r)
|
|
558
547
|
return;
|
|
559
548
|
const o = Math.floor((r.end_time.getTime() - r.start_time.getTime()) / 6e4);
|
|
560
|
-
|
|
549
|
+
A("[durationMinutes]: ", o), t.set("eventDuration", o);
|
|
561
550
|
}), t.reset = () => {
|
|
562
551
|
for (const s in e) {
|
|
563
|
-
const
|
|
564
|
-
t.set(s,
|
|
552
|
+
const i = e[s];
|
|
553
|
+
t.set(s, i);
|
|
565
554
|
}
|
|
566
555
|
}, t;
|
|
567
556
|
}
|
|
568
|
-
const
|
|
569
|
-
const t =
|
|
557
|
+
const z = (n, e) => {
|
|
558
|
+
const t = n.isLoading, s = n.showNotification, i = n.nylasBranding, r = n.version;
|
|
570
559
|
return a(
|
|
571
|
-
|
|
560
|
+
te,
|
|
572
561
|
null,
|
|
573
562
|
s && a("nylas-notification", null),
|
|
574
563
|
t && a(
|
|
@@ -590,29 +579,39 @@ const A = (i, e) => {
|
|
|
590
579
|
)
|
|
591
580
|
),
|
|
592
581
|
!t && e,
|
|
593
|
-
a(
|
|
594
|
-
"
|
|
595
|
-
{
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
582
|
+
a(
|
|
583
|
+
"div",
|
|
584
|
+
{ class: "footer" },
|
|
585
|
+
i && a(
|
|
586
|
+
"a",
|
|
587
|
+
{ href: "https://scheduler.nylas.com?utm_source=powered-by-nylas-logoutm_medium=link&utm_campaign=get-scheduler&utm_id=get-scheduler", class: "powered-by-nylas", target: "_blank", rel: "noreferrer noopener" },
|
|
588
|
+
"Powered by ",
|
|
589
|
+
a("span", { class: "sr-only" }, "Nylas"),
|
|
590
|
+
a("nylas-logo", { "aria-hidden": !0 })
|
|
591
|
+
),
|
|
592
|
+
a(
|
|
593
|
+
"tooltip-component",
|
|
594
|
+
null,
|
|
595
|
+
a("info-icon", { slot: "tooltip-icon" }),
|
|
596
|
+
a("span", { slot: "tooltip-content" }, r)
|
|
597
|
+
)
|
|
598
|
+
)
|
|
600
599
|
);
|
|
601
|
-
},
|
|
602
|
-
constructor(
|
|
603
|
-
|
|
600
|
+
}, J = (n, e) => a("div", { class: "message-banner" }, e), ue = ':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto;border-left:none}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer .powered-by-nylas{display:flex;align-items:center;text-decoration:none;color:var(--nylas-base-500)}.footer .powered-by-nylas:hover{color:var(--nylas-base-800)}.footer svg{fill:var(--nylas-base-500)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}button-component#report-issue{width:auto;position:absolute;bottom:4px;left:16px}nylas-feedback-form{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}', fe = ue, Y = { title: d.t("genericErrorTitle"), type: j.Error, category: U.Component }, me = class {
|
|
601
|
+
constructor(n) {
|
|
602
|
+
K(this, n), this.init = F(this, "init", 7), this.schedulerWillLoad = F(this, "schedulerWillLoad", 7), this.schedulerDidLoad = F(this, "schedulerDidLoad", 7), this.nylasSchedulerError = F(this, "nylasSchedulerError", 7), this.nylasSchedulerInfo = F(this, "nylasSchedulerInfo", 7), this.configSettingsLoaded = F(this, "configSettingsLoaded", 7), this.bookingRefExtracted = F(this, "bookingRefExtracted", 7), this.bookedEventInfo = F(this, "bookedEventInfo", 7), this.mode = "app", this.defaultSchedulerState = void 0, this.sessionId = void 0, this.schedulerApiUrl = "https://api.us.nylas.com", this.bookingInfo = void 0, this.rescheduleBookingRef = void 0, this.cancelBookingRef = void 0, this.organizerConfirmationBookingRef = void 0, this.configurationId = void 0, this.slug = void 0, this.clientId = void 0, this.nylasBranding = !0, this.eventOverrides = {}, this.isLoading = void 0, this.themeConfig = void 0, this.localization = void 0, this.showNotification = !0, this.enableUserFeedback = !0, this.hour12 = void 0, this.automaticComponentRegistration = !0, this.selectedDateLabel = (/* @__PURE__ */ new Date()).toLocaleDateString(navigator.language, { dateStyle: "full" }) || `${d.t("noDateSelected")}`, this.refConfigId = void 0, this.language = navigator.language, this.showFeedbackModal = !1, this.bookingInfoConfirmed = null, this.version = "2.0.1";
|
|
604
603
|
}
|
|
605
604
|
connectedCallback() {
|
|
606
|
-
|
|
605
|
+
A("[nylas-scheduler] connectedCallback");
|
|
607
606
|
}
|
|
608
607
|
async componentWillLoad() {
|
|
609
|
-
var
|
|
610
|
-
|
|
608
|
+
var i, r;
|
|
609
|
+
A("[nylas-scheduler] Component will load"), this.version = "2.0.1", this.enableUserFeedback && !ne() && se({
|
|
611
610
|
dsn: "https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",
|
|
612
|
-
release:
|
|
611
|
+
release: this.version,
|
|
613
612
|
integrations: (o) => [
|
|
614
613
|
...o.filter((l) => !1),
|
|
615
|
-
|
|
614
|
+
oe({
|
|
616
615
|
colorScheme: "system",
|
|
617
616
|
autoInject: !1
|
|
618
617
|
})
|
|
@@ -620,33 +619,33 @@ const A = (i, e) => {
|
|
|
620
619
|
autoSessionTracking: !1,
|
|
621
620
|
beforeSend: () => null
|
|
622
621
|
});
|
|
623
|
-
const
|
|
624
|
-
if ("schedulerWillLoad" in this.eventOverrides && (await this.eventOverrides.schedulerWillLoad(
|
|
622
|
+
const n = this.schedulerWillLoad.emit(this.host);
|
|
623
|
+
if ("schedulerWillLoad" in this.eventOverrides && (await this.eventOverrides.schedulerWillLoad(n, this.nylasSchedulerConnector), n.defaultPrevented))
|
|
625
624
|
return;
|
|
626
625
|
this.stores = {
|
|
627
|
-
scheduler:
|
|
626
|
+
scheduler: ge({
|
|
628
627
|
bookingInfo: this.bookingInfo,
|
|
629
628
|
nylasBranding: this.nylasBranding,
|
|
630
629
|
themeConfig: this.themeConfig,
|
|
631
630
|
hour12: this.hour12,
|
|
632
631
|
...this.defaultSchedulerState
|
|
633
632
|
})
|
|
634
|
-
}, this.baseProvider = new
|
|
633
|
+
}, this.baseProvider = new ie(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides), this.refConfigId = this.configurationId;
|
|
635
634
|
let e;
|
|
636
635
|
if (this.rescheduleBookingRef) {
|
|
637
|
-
const [o, l,
|
|
636
|
+
const [o, l, c] = M(this.rescheduleBookingRef);
|
|
638
637
|
this.refConfigId = o, this.stores.scheduler.set("rescheduleBookingId", l), e = this.bookingRefExtracted.emit({ configurationId: o, bookingId: l });
|
|
639
638
|
} else if (this.cancelBookingRef) {
|
|
640
|
-
const [o, l,
|
|
639
|
+
const [o, l, c] = M(this.cancelBookingRef);
|
|
641
640
|
this.refConfigId = o, this.stores.scheduler.set("cancelBookingId", l), e = this.bookingRefExtracted.emit({ configurationId: o, bookingId: l });
|
|
642
641
|
} else if (this.organizerConfirmationBookingRef) {
|
|
643
|
-
const [o, l,
|
|
644
|
-
this.refConfigId = o, this.stores.scheduler.set("organizerConfirmationBookingId", l), this.stores.scheduler.set("organizerConfirmationSalt",
|
|
642
|
+
const [o, l, c] = M(this.organizerConfirmationBookingRef);
|
|
643
|
+
this.refConfigId = o, this.stores.scheduler.set("organizerConfirmationBookingId", l), this.stores.scheduler.set("organizerConfirmationSalt", c), e = this.bookingRefExtracted.emit({ configurationId: o, bookingId: l, salt: c });
|
|
645
644
|
}
|
|
646
645
|
if ("bookingRefExtracted" in this.eventOverrides && (await this.eventOverrides.bookingRefExtracted(e, this.nylasSchedulerConnector), e.defaultPrevented) || !this.checkIfSessionIdOrConfigIdExists())
|
|
647
646
|
return;
|
|
648
|
-
const t = (
|
|
649
|
-
this.nylasSchedulerConnector = new
|
|
647
|
+
const t = (i = this.baseProvider) == null ? void 0 : i.getStore("scheduler");
|
|
648
|
+
this.nylasSchedulerConnector = new he({
|
|
650
649
|
schedulerAPIURL: this.schedulerApiUrl,
|
|
651
650
|
sessionId: this.sessionId,
|
|
652
651
|
configId: this.refConfigId,
|
|
@@ -658,10 +657,10 @@ const A = (i, e) => {
|
|
|
658
657
|
"init" in this.eventOverrides && (await this.eventOverrides.init(s, this.nylasSchedulerConnector), s.defaultPrevented) || ((r = this.baseProvider) == null || r.componentWillLoad(this.nylasSchedulerConnector), this.applyThemeConfig(this.themeConfig));
|
|
659
658
|
}
|
|
660
659
|
async componentDidLoad() {
|
|
661
|
-
var
|
|
662
|
-
(
|
|
663
|
-
const
|
|
664
|
-
if ("schedulerDidLoad" in this.eventOverrides && (await this.eventOverrides.schedulerDidLoad(
|
|
660
|
+
var c, f, h, u, g, p, b, S;
|
|
661
|
+
(c = this.baseProvider) == null || c.componentDidLoad();
|
|
662
|
+
const n = this.schedulerDidLoad.emit(this.host);
|
|
663
|
+
if ("schedulerDidLoad" in this.eventOverrides && (await this.eventOverrides.schedulerDidLoad(n, this.nylasSchedulerConnector), n.defaultPrevented) || !this.checkIfSessionIdOrConfigIdExists())
|
|
665
664
|
return;
|
|
666
665
|
this.localizationChanged(this.localization);
|
|
667
666
|
const e = await ((f = this.nylasSchedulerConnector) == null ? void 0 : f.scheduler.getUISettings());
|
|
@@ -674,12 +673,12 @@ const A = (i, e) => {
|
|
|
674
673
|
if ("configSettingsLoaded" in this.eventOverrides && (await this.eventOverrides.configSettingsLoaded(m, this.nylasSchedulerConnector), m.defaultPrevented))
|
|
675
674
|
return;
|
|
676
675
|
}
|
|
677
|
-
const t = (u = this.baseProvider) == null ? void 0 : u.getStore("scheduler"), s = (p = (g = t == null ? void 0 : t.get("configSettings")) == null ? void 0 : g.scheduler) == null ? void 0 : p.available_days_in_future,
|
|
678
|
-
if (
|
|
679
|
-
if (!this.isTimeslotValid(
|
|
676
|
+
const t = (u = this.baseProvider) == null ? void 0 : u.getStore("scheduler"), s = (p = (g = t == null ? void 0 : t.get("configSettings")) == null ? void 0 : g.scheduler) == null ? void 0 : p.available_days_in_future, i = t == null ? void 0 : t.get("selectedTimeslot");
|
|
677
|
+
if (i && (i != null && i.start_time)) {
|
|
678
|
+
if (!this.isTimeslotValid(i))
|
|
680
679
|
return;
|
|
681
680
|
if (t != null && t.get("showBookingForm")) {
|
|
682
|
-
t == null || t.set("selectedDate",
|
|
681
|
+
t == null || t.set("selectedDate", i.start_time);
|
|
683
682
|
return;
|
|
684
683
|
}
|
|
685
684
|
}
|
|
@@ -701,87 +700,87 @@ const A = (i, e) => {
|
|
|
701
700
|
}
|
|
702
701
|
}
|
|
703
702
|
componentDisconnected() {
|
|
704
|
-
var
|
|
705
|
-
(
|
|
703
|
+
var n;
|
|
704
|
+
(n = this.baseProvider) == null || n.componentDisconnected();
|
|
706
705
|
}
|
|
707
|
-
bookingInfoChanged(
|
|
706
|
+
bookingInfoChanged(n) {
|
|
708
707
|
var e;
|
|
709
|
-
(e = this.stores) == null || e.scheduler.set("bookingInfo",
|
|
708
|
+
(e = this.stores) == null || e.scheduler.set("bookingInfo", n);
|
|
710
709
|
}
|
|
711
|
-
rescheduleBookingRefChanged(
|
|
710
|
+
rescheduleBookingRefChanged(n) {
|
|
712
711
|
var e, t;
|
|
713
|
-
if (
|
|
714
|
-
const [s,
|
|
715
|
-
(e = this.stores) == null || e.scheduler.set("rescheduleBookingId",
|
|
712
|
+
if (n) {
|
|
713
|
+
const [s, i] = M(n);
|
|
714
|
+
(e = this.stores) == null || e.scheduler.set("rescheduleBookingId", i), this.refConfigId = s, (t = this.nylasSchedulerConnector) == null || t.scheduler.setConfigId(s);
|
|
716
715
|
}
|
|
717
716
|
}
|
|
718
|
-
cancelBookingRefChanged(
|
|
717
|
+
cancelBookingRefChanged(n) {
|
|
719
718
|
var e, t;
|
|
720
|
-
if (
|
|
721
|
-
const [s,
|
|
722
|
-
(e = this.stores) == null || e.scheduler.set("cancelBookingId",
|
|
719
|
+
if (n) {
|
|
720
|
+
const [s, i] = M(n);
|
|
721
|
+
(e = this.stores) == null || e.scheduler.set("cancelBookingId", i), this.refConfigId = s, (t = this.nylasSchedulerConnector) == null || t.scheduler.setConfigId(s);
|
|
723
722
|
}
|
|
724
723
|
}
|
|
725
|
-
organizerConfirmationBookingRefChanged(
|
|
724
|
+
organizerConfirmationBookingRefChanged(n) {
|
|
726
725
|
var e, t;
|
|
727
|
-
if (
|
|
728
|
-
const [s,
|
|
729
|
-
(e = this.stores) == null || e.scheduler.set("organizerConfirmationBookingId",
|
|
726
|
+
if (n) {
|
|
727
|
+
const [s, i] = M(n);
|
|
728
|
+
(e = this.stores) == null || e.scheduler.set("organizerConfirmationBookingId", i), this.refConfigId = s, (t = this.nylasSchedulerConnector) == null || t.scheduler.setConfigId(s);
|
|
730
729
|
}
|
|
731
730
|
}
|
|
732
|
-
localizationChanged(
|
|
733
|
-
|
|
734
|
-
e in
|
|
731
|
+
localizationChanged(n) {
|
|
732
|
+
n && Object.keys(n).forEach((e) => {
|
|
733
|
+
e in le && d.addResourceBundle(e, "translation", n[e], !1, !0);
|
|
735
734
|
});
|
|
736
735
|
}
|
|
737
|
-
themeConfigChanged(
|
|
736
|
+
themeConfigChanged(n) {
|
|
738
737
|
var e, t;
|
|
739
|
-
(t = (e = this.baseProvider) == null ? void 0 : e.getStore("scheduler")) == null || t.set("themeConfig",
|
|
738
|
+
(t = (e = this.baseProvider) == null ? void 0 : e.getStore("scheduler")) == null || t.set("themeConfig", n), this.applyThemeConfig(n);
|
|
740
739
|
}
|
|
741
|
-
languageChanged(
|
|
742
|
-
const e =
|
|
743
|
-
this.language = e,
|
|
740
|
+
languageChanged(n) {
|
|
741
|
+
const e = n.detail;
|
|
742
|
+
this.language = e, d.changeLanguage(e);
|
|
744
743
|
}
|
|
745
|
-
async registerComponentHandler(
|
|
744
|
+
async registerComponentHandler(n) {
|
|
746
745
|
var e;
|
|
747
|
-
(e = this.baseProvider) == null || e.registerComponent(
|
|
746
|
+
(e = this.baseProvider) == null || e.registerComponent(n.detail);
|
|
748
747
|
}
|
|
749
|
-
async unregisterComponentHandler(
|
|
748
|
+
async unregisterComponentHandler(n) {
|
|
750
749
|
var e;
|
|
751
|
-
(e = this.baseProvider) == null || e.unregisterComponent(
|
|
750
|
+
(e = this.baseProvider) == null || e.unregisterComponent(n.detail);
|
|
752
751
|
}
|
|
753
|
-
async monthChangedHandler(
|
|
754
|
-
var o, l,
|
|
755
|
-
const e =
|
|
756
|
-
if (!
|
|
757
|
-
const p = await ((h = this.nylasSchedulerConnector) == null ? void 0 : h.scheduler.getAvailability(s,
|
|
752
|
+
async monthChangedHandler(n) {
|
|
753
|
+
var o, l, c, f, h, u, g;
|
|
754
|
+
const e = n.detail, t = (f = (c = (l = (o = this.nylasSchedulerConnector) == null ? void 0 : o.schedulerStore) == null ? void 0 : l.get("configSettings")) == null ? void 0 : c.scheduler) == null ? void 0 : f.available_days_in_future, { startTime: s, endTime: i, endTimeForAvailableDaysInFuture: r } = this.validateAvailableDaysInFuture(e, t || 30);
|
|
755
|
+
if (!n.defaultPrevented && s < r && e.getTime() < r * 1e3) {
|
|
756
|
+
const p = await ((h = this.nylasSchedulerConnector) == null ? void 0 : h.scheduler.getAvailability(s, i));
|
|
758
757
|
(!p || "error" in p) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(p == null ? void 0 : p.error) }, host: this.host });
|
|
759
758
|
const b = (u = this.stores) == null ? void 0 : u.scheduler.get("selectableDates");
|
|
760
759
|
b && b.length > 0 && ((g = this.stores) == null || g.scheduler.set("selectedDate", b[0]));
|
|
761
760
|
}
|
|
762
761
|
}
|
|
763
|
-
mapToBookingData(
|
|
764
|
-
var o, l,
|
|
765
|
-
const e = (o = this.stores) == null ? void 0 : o.scheduler.get("selectedTimeslot"), t = (l = this.stores) == null ? void 0 : l.scheduler.get("selectedLanguage"), s = (
|
|
762
|
+
mapToBookingData(n) {
|
|
763
|
+
var o, l, c;
|
|
764
|
+
const e = (o = this.stores) == null ? void 0 : o.scheduler.get("selectedTimeslot"), t = (l = this.stores) == null ? void 0 : l.scheduler.get("selectedLanguage"), s = (c = this.stores) == null ? void 0 : c.scheduler.get("selectedTimezone"), i = e != null && e.start_time ? new Date(e == null ? void 0 : e.start_time).getTime() / 1e3 : "", r = e != null && e.end_time ? new Date(e == null ? void 0 : e.end_time).getTime() / 1e3 : "";
|
|
766
765
|
return {
|
|
767
|
-
additional_guests:
|
|
768
|
-
guest: { ...
|
|
769
|
-
additional_fields: { ...
|
|
770
|
-
start_time:
|
|
766
|
+
additional_guests: n.guests,
|
|
767
|
+
guest: { ...n.primaryParticipant },
|
|
768
|
+
additional_fields: { ...n.additionalFields },
|
|
769
|
+
start_time: i,
|
|
771
770
|
end_time: r,
|
|
772
771
|
email_language: t,
|
|
773
772
|
timezone: s
|
|
774
773
|
};
|
|
775
774
|
}
|
|
776
|
-
async bookButtonClickedHandler(
|
|
777
|
-
var
|
|
778
|
-
if (
|
|
775
|
+
async bookButtonClickedHandler(n) {
|
|
776
|
+
var c, f, h, u;
|
|
777
|
+
if (n.defaultPrevented)
|
|
779
778
|
return;
|
|
780
|
-
const e =
|
|
779
|
+
const e = n.detail, t = this.mapToBookingData(e);
|
|
781
780
|
this.bookingInfoConfirmed = e;
|
|
782
|
-
const
|
|
783
|
-
if (
|
|
784
|
-
const g = await ((h = this.nylasSchedulerConnector) == null ? void 0 : h.scheduler.rescheduleBooking(
|
|
781
|
+
const i = (f = (c = this.nylasSchedulerConnector) == null ? void 0 : c.schedulerStore) == null ? void 0 : f.get("rescheduleBookingId");
|
|
782
|
+
if (i) {
|
|
783
|
+
const g = await ((h = this.nylasSchedulerConnector) == null ? void 0 : h.scheduler.rescheduleBooking(i, e));
|
|
785
784
|
(!g || "error" in g) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(g == null ? void 0 : g.error) }, host: this.host });
|
|
786
785
|
const p = g == null ? void 0 : g.data, b = this.bookedEventInfo.emit({ ...g, data: { ...p, ...t } });
|
|
787
786
|
this.bookingInfoConfirmed = { ...this.bookingInfoConfirmed, ...p }, "bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(b, this.nylasSchedulerConnector);
|
|
@@ -792,31 +791,31 @@ const A = (i, e) => {
|
|
|
792
791
|
const o = r == null ? void 0 : r.data, l = this.bookedEventInfo.emit({ ...r, data: { ...o, ...t } });
|
|
793
792
|
this.bookingInfoConfirmed = { ...this.bookingInfoConfirmed, ...o }, "bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(l, this.nylasSchedulerConnector);
|
|
794
793
|
}
|
|
795
|
-
dateSelectedHandler(
|
|
796
|
-
const e =
|
|
797
|
-
this.selectedDateLabel = e ? e.toLocaleDateString(this.language, { dateStyle: "full" }) : `${
|
|
794
|
+
dateSelectedHandler(n) {
|
|
795
|
+
const e = n.detail;
|
|
796
|
+
this.selectedDateLabel = e ? e.toLocaleDateString(this.language, { dateStyle: "full" }) : `${d.t("noDateSelected")}`;
|
|
798
797
|
}
|
|
799
|
-
cancelBookedEventErrorHandler(
|
|
800
|
-
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(
|
|
798
|
+
cancelBookedEventErrorHandler(n) {
|
|
799
|
+
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(n.detail.error) }, host: this.host });
|
|
801
800
|
}
|
|
802
|
-
cancelBookedEventValidationErrorHandler(
|
|
803
|
-
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(
|
|
801
|
+
cancelBookedEventValidationErrorHandler(n) {
|
|
802
|
+
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(n.detail.error) }, host: this.host });
|
|
804
803
|
}
|
|
805
|
-
rescheduleBookedEventErrorHandler(
|
|
806
|
-
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(
|
|
804
|
+
rescheduleBookedEventErrorHandler(n) {
|
|
805
|
+
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(n.detail.error) }, host: this.host });
|
|
807
806
|
}
|
|
808
|
-
confirmBookingErrorHandler(
|
|
809
|
-
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(
|
|
807
|
+
confirmBookingErrorHandler(n) {
|
|
808
|
+
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(n.detail.error) }, host: this.host });
|
|
810
809
|
}
|
|
811
810
|
feedbackModalClosedHandler() {
|
|
812
811
|
this.showFeedbackModal = !1;
|
|
813
812
|
}
|
|
814
|
-
eventIsFullHandler(
|
|
815
|
-
const e =
|
|
816
|
-
|
|
813
|
+
eventIsFullHandler(n) {
|
|
814
|
+
const e = n.detail.error;
|
|
815
|
+
n.detail.type === "error" ? this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject({ message: e }) }, host: this.host }) : this.nylasSchedulerInfo.emit({
|
|
817
816
|
notification: {
|
|
818
817
|
title: "Event is full",
|
|
819
|
-
category:
|
|
818
|
+
category: U.Component,
|
|
820
819
|
type: j.Info,
|
|
821
820
|
description: "The event you selected is full. Please try a different time.",
|
|
822
821
|
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
@@ -825,36 +824,37 @@ const A = (i, e) => {
|
|
|
825
824
|
host: this.host
|
|
826
825
|
});
|
|
827
826
|
}
|
|
828
|
-
feedbackSubmittedHandler(
|
|
827
|
+
feedbackSubmittedHandler(n) {
|
|
829
828
|
const t = {
|
|
830
|
-
eventId:
|
|
829
|
+
eventId: re("Scheduling Page User Feedback", {
|
|
831
830
|
extra: {
|
|
832
831
|
configId: this.configurationId,
|
|
833
832
|
slug: this.slug
|
|
834
833
|
}
|
|
835
834
|
}),
|
|
836
|
-
message:
|
|
835
|
+
message: n.detail.feedback
|
|
837
836
|
};
|
|
838
|
-
|
|
837
|
+
ae(t, {
|
|
839
838
|
includeReplay: !0,
|
|
840
839
|
captureContext: {
|
|
841
840
|
tags: {
|
|
842
841
|
"nylas-web-element": "nylas-scheduling",
|
|
843
|
-
"nylas-web-element-version":
|
|
842
|
+
"nylas-web-element-version": this.version,
|
|
844
843
|
"nylas-config-id": this.configurationId,
|
|
845
844
|
"nylas-slug": this.slug,
|
|
846
845
|
"host-url": window.location.href
|
|
847
846
|
},
|
|
848
847
|
extra: {
|
|
849
848
|
configId: this.configurationId,
|
|
850
|
-
slug: this.slug
|
|
849
|
+
slug: this.slug,
|
|
850
|
+
version: this.version
|
|
851
851
|
}
|
|
852
852
|
}
|
|
853
853
|
}), this.showFeedbackModal = !1;
|
|
854
854
|
}
|
|
855
855
|
async getNylasSchedulerStore() {
|
|
856
|
-
var
|
|
857
|
-
return (
|
|
856
|
+
var n;
|
|
857
|
+
return (n = this.baseProvider) == null ? void 0 : n.getStore("scheduler");
|
|
858
858
|
}
|
|
859
859
|
async getNylasSchedulerConnector() {
|
|
860
860
|
return this.nylasSchedulerConnector;
|
|
@@ -862,25 +862,25 @@ const A = (i, e) => {
|
|
|
862
862
|
async getRef() {
|
|
863
863
|
return this.host;
|
|
864
864
|
}
|
|
865
|
-
getErrorObject(
|
|
865
|
+
getErrorObject(n) {
|
|
866
866
|
return {
|
|
867
|
-
title: (
|
|
868
|
-
category: (
|
|
867
|
+
title: (n == null ? void 0 : n.title) || Y.title,
|
|
868
|
+
category: (n == null ? void 0 : n.category) || Y.category,
|
|
869
869
|
type: j.Error,
|
|
870
|
-
description: (
|
|
870
|
+
description: (n == null ? void 0 : n.message) || "",
|
|
871
871
|
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
872
872
|
ttl: "none"
|
|
873
873
|
};
|
|
874
874
|
}
|
|
875
875
|
checkIfSessionIdOrConfigIdExists() {
|
|
876
876
|
if (!this.sessionId && !this.refConfigId && !(this.slug && this.clientId)) {
|
|
877
|
-
let
|
|
878
|
-
return this.sessionId || (
|
|
877
|
+
let n = "";
|
|
878
|
+
return this.sessionId || (n += d.t("sessionIdRequiredErrorMessage")), !this.sessionId && !this.refConfigId && !(this.slug && this.clientId) && (n = d.t("sessionIdRequiredErrorMessage") + " " + d.t("publicConfigErrorMessage")), this.nylasSchedulerError.emit({
|
|
879
879
|
notification: {
|
|
880
|
-
title:
|
|
881
|
-
category:
|
|
880
|
+
title: d.t("schedulingComponentErrorTitle"),
|
|
881
|
+
category: U.Component,
|
|
882
882
|
type: j.Error,
|
|
883
|
-
description:
|
|
883
|
+
description: n,
|
|
884
884
|
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
885
885
|
ttl: "none"
|
|
886
886
|
},
|
|
@@ -889,67 +889,67 @@ const A = (i, e) => {
|
|
|
889
889
|
}
|
|
890
890
|
return !0;
|
|
891
891
|
}
|
|
892
|
-
isTimeslotValid(
|
|
893
|
-
return new Date(
|
|
892
|
+
isTimeslotValid(n) {
|
|
893
|
+
return new Date(n.start_time) < /* @__PURE__ */ new Date() ? (this.nylasSchedulerError.emit({
|
|
894
894
|
notification: {
|
|
895
|
-
title:
|
|
896
|
-
category:
|
|
895
|
+
title: d.t("invalidTimeslotErrorTitle"),
|
|
896
|
+
category: U.Component,
|
|
897
897
|
type: j.Error,
|
|
898
|
-
description:
|
|
898
|
+
description: d.t("invalidTimeslotErrorMessage"),
|
|
899
899
|
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
900
900
|
ttl: "none"
|
|
901
901
|
},
|
|
902
902
|
host: this.host
|
|
903
903
|
}), !1) : !0;
|
|
904
904
|
}
|
|
905
|
-
validateAvailableDaysInFuture(
|
|
906
|
-
const t = /* @__PURE__ */ new Date(), s = new Date(
|
|
905
|
+
validateAvailableDaysInFuture(n, e) {
|
|
906
|
+
const t = /* @__PURE__ */ new Date(), s = new Date(n.getFullYear(), n.getMonth(), 1).getTime() / 1e3, i = new Date(n.getFullYear(), n.getMonth() + 1, 1).getTime() / 1e3, r = Math.floor(X(t, e).getTime() / 1e3), o = Math.min(r, i);
|
|
907
907
|
return { startTime: s < t.getTime() / 1e3 ? Math.floor(t.getTime() / 1e3) : s, endTime: o, endTimeForAvailableDaysInFuture: r };
|
|
908
908
|
}
|
|
909
|
-
applyThemeConfig(
|
|
910
|
-
if (
|
|
911
|
-
for (const [e, t] of Object.entries(
|
|
909
|
+
applyThemeConfig(n) {
|
|
910
|
+
if (n)
|
|
911
|
+
for (const [e, t] of Object.entries(n))
|
|
912
912
|
this.host.style.setProperty(`${e}`, t);
|
|
913
913
|
}
|
|
914
|
-
onFeedbackClick(
|
|
915
|
-
|
|
914
|
+
onFeedbackClick(n) {
|
|
915
|
+
n.preventDefault(), this.showFeedbackModal = !0;
|
|
916
916
|
}
|
|
917
|
-
redirectToCustomUrl(
|
|
918
|
-
window.location.assign(
|
|
917
|
+
redirectToCustomUrl(n) {
|
|
918
|
+
window.location.assign(n);
|
|
919
919
|
}
|
|
920
920
|
render() {
|
|
921
|
-
var b, S, m, k, I, x, w, L,
|
|
922
|
-
const
|
|
923
|
-
if (this.selectedDateLabel = g && this.language ?
|
|
924
|
-
return a(P, null, a(
|
|
925
|
-
if (
|
|
926
|
-
return a(P, null, a(
|
|
927
|
-
if (
|
|
928
|
-
return a(P, null, a(
|
|
929
|
-
if (
|
|
930
|
-
return a(P, null, a(
|
|
931
|
-
if (
|
|
932
|
-
const
|
|
921
|
+
var b, S, m, k, I, x, w, L, _, B, D, O;
|
|
922
|
+
const n = this.mode === "app", e = (b = this.baseProvider) == null ? void 0 : b.getStore("scheduler"), t = e == null ? void 0 : e.get("eventInfo"), s = e == null ? void 0 : e.get("showBookingForm"), i = e == null ? void 0 : e.get("cancelledEventInfo"), r = e == null ? void 0 : e.get("cancelBookingId"), o = e == null ? void 0 : e.get("selectedTimeslot"), l = e == null ? void 0 : e.get("rescheduleBookingId"), c = e == null ? void 0 : e.get("organizerConfirmationBookingId"), f = e == null ? void 0 : e.get("rejectBookingId"), h = e == null ? void 0 : e.get("confirmedEventInfo"), u = (e == null ? void 0 : e.get("nylasBranding")) || this.nylasBranding, g = e == null ? void 0 : e.get("selectedDate"), p = (m = (S = e == null ? void 0 : e.get("configSettings")) == null ? void 0 : S.scheduler) == null ? void 0 : m.confirmation_redirect_url;
|
|
923
|
+
if (this.selectedDateLabel = g && this.language ? Q(g.toLocaleDateString(this.language, { dateStyle: "full" })) : `${d.t("noDateSelected")}`, n && (r || f) && !i)
|
|
924
|
+
return a(P, null, a(z, { version: this.version, nylasBranding: u, isLoading: this.isLoading, showNotification: this.showNotification }, a("div", { class: "cancel-flow-page", part: "cancel-flow-page" }, a("nylas-cancel-booking-form", { selectedTimeslot: o, cancelBookingId: r, rejectBookingId: f, exportparts: "ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card" }))), this.enableUserFeedback && a("button-component", { id: "report-issue", variant: "basic", onClick: (y) => this.onFeedbackClick(y) }, a("feedback-icon", null)), this.showFeedbackModal && a("nylas-feedback-form", null));
|
|
925
|
+
if (n && c)
|
|
926
|
+
return a(P, null, a(z, null, a("div", { class: "manual-confirmation-page", part: "manual-confirmation-page" }, a("nylas-organizer-confirmation-card", { organizerConfirmationBookingId: c, exportparts: "nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline" }))), this.enableUserFeedback && a("button-component", { id: "report-issue", variant: "basic", onClick: (y) => this.onFeedbackClick(y) }, a("feedback-icon", null)), this.showFeedbackModal && a("nylas-feedback-form", null));
|
|
927
|
+
if (n && i)
|
|
928
|
+
return a(P, null, a(z, { version: this.version, nylasBranding: u, isLoading: this.isLoading, showNotification: this.showNotification }, a("div", { class: "cancelled-event-page", part: "cancelled-event-page" }, a("nylas-cancelled-event-card", { cancelledEventInfo: i, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))), this.enableUserFeedback && a("button-component", { id: "report-issue", variant: "basic", onClick: (y) => this.onFeedbackClick(y) }, a("feedback-icon", null)), this.showFeedbackModal && a("nylas-feedback-form", null));
|
|
929
|
+
if (n && h)
|
|
930
|
+
return a(P, null, a(z, { version: this.version, nylasBranding: u, isLoading: this.isLoading, showNotification: this.showNotification }, a("div", { class: "cancelled-event-page", part: "confirmed-event-page" }, a("nylas-confirmed-event-card", { confirmedEventInfo: h, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))), this.enableUserFeedback && a("button-component", { id: "report-issue", variant: "basic", onClick: (y) => this.onFeedbackClick(y) }, a("feedback-icon", null)), this.showFeedbackModal && a("nylas-feedback-form", null));
|
|
931
|
+
if (n && t && p) {
|
|
932
|
+
const y = (k = this.bookingInfoConfirmed) == null ? void 0 : k.primaryParticipant, C = (I = this.bookingInfoConfirmed) == null ? void 0 : I.location, N = (x = this.bookingInfoConfirmed) == null ? void 0 : x.booking_ref, R = ((w = this.bookingInfoConfirmed) == null ? void 0 : w.additionalFields) || {};
|
|
933
933
|
if (this.bookingInfo && typeof ((L = this.bookingInfo) == null ? void 0 : L.additionalFields) < "u") {
|
|
934
934
|
const $ = this.bookingInfo.additionalFields;
|
|
935
|
-
Object.keys($).forEach((
|
|
936
|
-
!R[
|
|
935
|
+
Object.keys($).forEach((q) => {
|
|
936
|
+
!R[q] && ($ != null && $[q]) && (R[q] = $[q].value);
|
|
937
937
|
});
|
|
938
938
|
}
|
|
939
|
-
const v = (
|
|
940
|
-
T.set("booking_id", t.booking_id),
|
|
939
|
+
const v = (_ = this.stores) == null ? void 0 : _.scheduler.get("selectedTimeslot"), E = (B = this.stores) == null ? void 0 : B.scheduler.get("selectedTimezone"), H = (D = this.stores) == null ? void 0 : D.scheduler.get("selectedLanguage"), W = (O = this.stores) == null ? void 0 : O.scheduler.get("configSettings"), G = this.configurationId ? this.configurationId : W == null ? void 0 : W.configuration_id, Z = window.location.search, T = new URLSearchParams(Z);
|
|
940
|
+
T.set("booking_id", t.booking_id), y != null && y.name && T.set("name", y.name), y != null && y.email && T.set("email", y.email), v != null && v.start_time && T.set("start_time", (new Date(v.start_time).getTime() / 1e3).toString()), v != null && v.end_time && T.set("end_time", (new Date(v.end_time).getTime() / 1e3).toString()), E && T.set("tz", E), H && T.set("language", H), R && T.set("additional_values", JSON.stringify(R)), this.slug && T.set("page_slug", this.slug), G && T.set("config_id", G), C && T.set("location", C), N && T.set("booking_ref", N), this.redirectToCustomUrl(`${p}?${T.toString()}`);
|
|
941
941
|
return;
|
|
942
942
|
}
|
|
943
|
-
if (
|
|
944
|
-
return a(P, null, a(
|
|
945
|
-
if (
|
|
946
|
-
const
|
|
947
|
-
return a(P, null, a(
|
|
943
|
+
if (n && t)
|
|
944
|
+
return a(P, null, a(z, { version: this.version, nylasBranding: u, isLoading: this.isLoading, showNotification: this.showNotification }, a("div", { class: "booked-event-page", part: "booked-event-page ns_booked-event-page" }, a("nylas-booked-event-card", { selectedTimeslot: o, eventInfo: t, exportparts: "nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta" }))), this.enableUserFeedback && a("button-component", { id: "report-issue", variant: "basic", onClick: (y) => this.onFeedbackClick(y) }, a("feedback-icon", null)), this.showFeedbackModal && a("nylas-feedback-form", null));
|
|
945
|
+
if (n && (!t || l) && !s) {
|
|
946
|
+
const y = this.host.querySelector('[slot="timeslot-picker-cta-label"]');
|
|
947
|
+
return a(P, null, a(z, { version: this.version, nylasBranding: u, isLoading: this.isLoading, showNotification: this.showNotification }, l && a(J, null, `${d.t("rescheduleTitle")}`), a("div", { class: "select-date-page", part: "select-date-page ns_select-date-page" }, a("div", { class: "left-panel", part: "ns_left-panel" }, a("nylas-date-picker", { exportparts: "ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month" }), a("nylas-locale-switch", { exportparts: "nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label" })), a("div", { class: `right-panel ${l ? "reschedule" : ""}`, part: `ns_right-panel ${l ? "ns_reschedule" : ""}` }, a("h2", { part: "ns_right-panel__title" }, a("calendar-icon", { part: "ns_right-panel__calendar-icon" }), a("span", { id: "selectedDate", part: "ns_right-panel__selected-date" }, this.selectedDateLabel)), a("nylas-timeslot-picker", { exportparts: "ntp, ntp__time-picker-wrapper, ntp__timeslots, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary" }, y && a("span", { slot: "timeslot-picker-cta-label" }, a("slot", { name: "timeslot-picker-cta-label" })))))), this.enableUserFeedback && a("button-component", { id: "report-issue", variant: "basic", onClick: (C) => this.onFeedbackClick(C) }, a("feedback-icon", null)), this.showFeedbackModal && a("nylas-feedback-form", null));
|
|
948
948
|
}
|
|
949
|
-
return
|
|
949
|
+
return n && !t && s ? a(P, null, a(z, { version: this.version, nylasBranding: u, isLoading: this.isLoading, showNotification: this.showNotification }, l && a(J, null, `${d.t("rescheduleTitle")}`), a("div", { class: "additional-data-page", part: "additional-data-page ns_additional-data-page" }, a("div", { class: "left-panel ns_left-panel", part: "ns_left-panel" }, a("div", { class: "wrapper", part: "ns_left-panel__wrapper" }, a("nylas-selected-event-card", { exportparts: "nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone" }))), a("div", { class: `right-panel ${l ? "reschedule" : ""}`, part: `ns_right-panel ${l ? "ns_reschedule" : ""}` }, a("nylas-booking-form", { exportparts: "nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content" })))), this.enableUserFeedback && a("button-component", { id: "report-issue", variant: "basic", onClick: (y) => this.onFeedbackClick(y) }, a("feedback-icon", null)), this.showFeedbackModal && a("nylas-feedback-form", null)) : a(P, null, a("slot", null));
|
|
950
950
|
}
|
|
951
951
|
get host() {
|
|
952
|
-
return
|
|
952
|
+
return V(this);
|
|
953
953
|
}
|
|
954
954
|
static get watchers() {
|
|
955
955
|
return {
|
|
@@ -962,7 +962,7 @@ const A = (i, e) => {
|
|
|
962
962
|
};
|
|
963
963
|
}
|
|
964
964
|
};
|
|
965
|
-
|
|
965
|
+
me.style = fe;
|
|
966
966
|
export {
|
|
967
|
-
|
|
967
|
+
me as nylas_scheduling
|
|
968
968
|
};
|