@nylas/react 1.1.0-canary.8 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +110 -2
- package/dist/add-circle-icon_2.entry-7165bd0e.js +25 -0
- package/dist/add-circle-icon_2.entry-f1ddca18.cjs +1 -0
- package/dist/{archive-icon_7.entry-e2954750.js → archive-icon_7.entry-7411c224.js} +16 -16
- package/dist/archive-icon_7.entry-e3df60ed.cjs +1 -0
- package/dist/{arrow-icon.entry-548b027e.cjs → arrow-icon.entry-280e18b0.cjs} +1 -1
- package/dist/{arrow-icon.entry-03a85113.js → arrow-icon.entry-38949317.js} +4 -4
- package/dist/{bold-icon_3.entry-70ffa7f0.js → bold-icon_3.entry-5963945c.js} +4 -4
- package/dist/{bold-icon_3.entry-9a7b1869.cjs → bold-icon_3.entry-5dffbedd.cjs} +1 -1
- package/dist/button-component_2.entry-237733b4.js +26 -0
- package/dist/button-component_2.entry-b29d2873.cjs +1 -0
- package/dist/calendar-agenda-fill-icon_48.entry-9afba869.js +5105 -0
- package/dist/calendar-agenda-fill-icon_48.entry-d3830dbb.cjs +7 -0
- package/dist/{calendar-cancel-icon.entry-45388fdc.cjs → calendar-cancel-icon.entry-77ccf227.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-6bbc119f.js → calendar-cancel-icon.entry-780723a6.js} +5 -5
- package/dist/{calendar-check-icon_2.entry-f633f7a6.js → calendar-check-icon_2.entry-2c89c230.js} +7 -7
- package/dist/{calendar-check-icon_2.entry-6628456c.cjs → calendar-check-icon_2.entry-b37ac7f0.cjs} +1 -1
- package/dist/{calendar-icon.entry-62b82c27.js → calendar-icon.entry-02dd3990.js} +4 -4
- package/dist/{calendar-icon.entry-379b1fa1.cjs → calendar-icon.entry-ffc93569.cjs} +1 -1
- package/dist/checkbox-component_2.entry-00b6a1e9.cjs +1 -0
- package/dist/checkbox-component_2.entry-ee9d0e6c.js +56 -0
- package/dist/chevron-icon_3.entry-468abc26.cjs +1 -0
- package/dist/chevron-icon_3.entry-f62e9ef1.js +129 -0
- package/dist/clock-icon_4.entry-766a1b23.js +45 -0
- package/dist/clock-icon_4.entry-7dc2cc4a.cjs +1 -0
- package/dist/{constants-f34b9c6e-95a17764.js → constants-50c3e067-8a40a5fe.js} +885 -751
- package/dist/{constants-f34b9c6e-e7137e51.cjs → constants-50c3e067-9f2a6372.cjs} +5 -5
- package/dist/copy-icon.entry-2a841508.js +15 -0
- package/dist/copy-icon.entry-e5251410.cjs +1 -0
- package/dist/delete-icon_2.entry-1a5c39dc.cjs +1 -0
- package/dist/delete-icon_2.entry-64555a2f.js +25 -0
- package/dist/{document-refresh-icon.entry-32c75418.js → document-refresh-icon.entry-4bf6398b.js} +4 -4
- package/dist/document-refresh-icon.entry-fdc7ddda.cjs +1 -0
- package/dist/elements/index.d.ts +47 -1
- package/dist/{elements-dc5b338e-62fe1cf3.js → elements-dc5b338e-2da1fe61.js} +1 -1
- package/dist/{elements-dc5b338e-1f23530f.cjs → elements-dc5b338e-c8016c3d.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-f0f05815.cjs → focus-visible-e8093c16-0a38a184.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-1f664070.js → focus-visible-e8093c16-9d0c98c0.js} +1 -1
- package/dist/{forward-icon_6.entry-7fab04d7.js → forward-icon_6.entry-390ef70a.js} +9 -9
- package/dist/{forward-icon_6.entry-ef5e2e0f.cjs → forward-icon_6.entry-7238ef38.cjs} +3 -3
- package/dist/{globe-icon.entry-398a9826.cjs → globe-icon.entry-81f42f89.cjs} +1 -1
- package/dist/{globe-icon.entry-b8e1efae.js → globe-icon.entry-8d106260.js} +5 -5
- package/dist/google-logo-icon_4.entry-aabd3886.js +680 -0
- package/dist/google-logo-icon_4.entry-fa2b8999.cjs +1 -0
- package/dist/index-53420959-5fc8ad2b.js +5 -0
- package/dist/index-53420959-fcf45780.cjs +1 -0
- package/dist/index-5ccfd9df.js +7859 -0
- package/dist/index-6d9eeb53-58c8980a.js +4971 -0
- package/dist/index-6d9eeb53-b2a6d09f.cjs +41 -0
- package/dist/index-eb33703c.cjs +42 -0
- package/dist/{index.es-df564f87-b773d34f.js → index.es-c9454237-00ccd1e6.js} +6 -8
- package/dist/{index.es-df564f87-e4a4092a.cjs → index.es-c9454237-b64161d1.cjs} +6 -6
- package/dist/{info-icon_2.entry-2eb70f49.cjs → info-icon_2.entry-b2e11336.cjs} +1 -1
- package/dist/{info-icon_2.entry-6bbfa6dc.js → info-icon_2.entry-bb8ed71c.js} +3 -3
- package/dist/input-component.entry-378b1ccc.cjs +1 -0
- package/dist/input-component.entry-cb86170f.js +65 -0
- package/dist/input-dropdown.entry-98954c93.cjs +1 -0
- package/dist/input-dropdown.entry-a76c339e.js +134 -0
- package/dist/{mailbox-store-69c5c5f6-631eddb5.cjs → mailbox-store-edc386fc-156b7236.cjs} +1 -1
- package/dist/{mailbox-store-69c5c5f6-8ab4670b.js → mailbox-store-edc386fc-8bc7558b.js} +2 -2
- package/dist/multi-select-dropdown.entry-40b855e1.cjs +1 -0
- package/dist/multi-select-dropdown.entry-6b686695.js +91 -0
- package/dist/nylas-booked-event-card_12.entry-9d693125.cjs +1 -0
- package/dist/nylas-booked-event-card_12.entry-e861bb16.js +1134 -0
- package/dist/nylas-form-card.entry-b158d789.js +57 -0
- package/dist/nylas-form-card.entry-ca4a8746.cjs +1 -0
- package/dist/{nylas-if-state.entry-f8abd025.js → nylas-if-state.entry-8e4d922c.js} +8 -8
- package/dist/{nylas-if-state.entry-276d61ad.cjs → nylas-if-state.entry-95fac42d.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-78cc680e.js → nylas-list-folders.entry-83c39684.js} +8 -8
- package/dist/{nylas-list-folders.entry-afe02f0e.cjs → nylas-list-folders.entry-8a22e0c8.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-6395c12f.cjs → nylas-list-threads.entry-54c582af.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-217088de.js → nylas-list-threads.entry-7ea370e1.js} +4 -4
- package/dist/{nylas-login.entry-e4d57589.js → nylas-login.entry-9115fd81.js} +7 -7
- package/dist/{nylas-login.entry-ec81e21b.cjs → nylas-login.entry-fb627e40.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-d4d929f1.cjs → nylas-mailbox-pagination.entry-04626d27.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-069673aa.js → nylas-mailbox-pagination.entry-3ff02cf9.js} +2 -2
- package/dist/{nylas-mailbox-toolbar-button.entry-2b9e4431.cjs → nylas-mailbox-toolbar-button.entry-8d00c789.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-03c5f5c8.js → nylas-mailbox-toolbar-button.entry-f752e925.js} +4 -4
- package/dist/{nylas-mailbox.entry-7e6b4791.js → nylas-mailbox.entry-99c27b6c.js} +4 -4
- package/dist/{nylas-mailbox.entry-1342178d.cjs → nylas-mailbox.entry-b3974f4e.cjs} +1 -1
- package/dist/{nylas-provider.entry-0ae8e70a.cjs → nylas-provider.entry-a3ad02a5.cjs} +1 -1
- package/dist/{nylas-provider.entry-498a7be9.js → nylas-provider.entry-c206aa32.js} +39 -39
- package/dist/nylas-reminder-emails.entry-414ce6fe.js +129 -0
- package/dist/nylas-reminder-emails.entry-59c07bfe.cjs +4 -0
- package/dist/nylas-reminder-time_2.entry-197d83a0.js +105 -0
- package/dist/nylas-reminder-time_2.entry-d79dcd85.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-7f389982.js +1447 -0
- package/dist/nylas-scheduler-editor.entry-f1c6964a.cjs +2 -0
- package/dist/nylas-scheduling.entry-1a8bd6fc.cjs +1 -0
- package/dist/nylas-scheduling.entry-4fa5381d.js +345 -0
- package/dist/{nylas-threads-refresh.entry-fc2d8028.js → nylas-threads-refresh.entry-20602e7b.js} +4 -4
- package/dist/{nylas-threads-refresh.entry-d020c89e.cjs → nylas-threads-refresh.entry-56b53449.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-f92f7e30.js → nylas-threads-search.entry-8872473c.js} +12 -12
- package/dist/{nylas-threads-search.entry-0abcbc10.cjs → nylas-threads-search.entry-8e0ec3ae.cjs} +1 -1
- package/dist/nylas-time-window-picker.entry-9ac542b7.js +316 -0
- package/dist/nylas-time-window-picker.entry-ca47f721.cjs +1 -0
- package/dist/{nylas-view-thread.entry-56080c89.cjs → nylas-view-thread.entry-1f758e43.cjs} +1 -1
- package/dist/{nylas-view-thread.entry-2f1474cf.js → nylas-view-thread.entry-dcd3d5be.js} +6 -6
- package/dist/person-icon.entry-63b28ace.cjs +1 -0
- package/dist/person-icon.entry-93130c05.js +15 -0
- package/dist/{play-icon_2.entry-24ffa01f.js → play-icon_2.entry-6a99c32d.js} +6 -6
- package/dist/play-icon_2.entry-b67fb649.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +136 -90
- package/dist/{refresh-icon.entry-8395104b.js → refresh-icon.entry-84783c91.js} +4 -4
- package/dist/{refresh-icon.entry-cf4416b8.cjs → refresh-icon.entry-b49792fc.cjs} +1 -1
- package/dist/{register-component-b9cfcbaf-d40e1f3c.cjs → register-component-887199a9-003f96c5.cjs} +1 -1
- package/dist/{register-component-b9cfcbaf-c0147194.js → register-component-887199a9-b41dfa7a.js} +1 -1
- package/dist/scheduler-config-store-2a3b403d-73610089.js +27 -0
- package/dist/scheduler-config-store-2a3b403d-a5e3433a.cjs +1 -0
- package/dist/scheduler-store-fe281404-bddb1b6a.js +469 -0
- package/dist/scheduler-store-fe281404-c3e477f6.cjs +1 -0
- package/dist/textarea-component.entry-28c4bc05.cjs +1 -0
- package/dist/textarea-component.entry-40e959e5.js +36 -0
- package/dist/time-period-selector.entry-af71523a.cjs +1 -0
- package/dist/time-period-selector.entry-da5d8652.js +93 -0
- package/dist/{translate-icon.entry-d847f706.js → translate-icon.entry-92b83635.js} +5 -5
- package/dist/{translate-icon.entry-66533238.cjs → translate-icon.entry-a2ed4f76.cjs} +1 -1
- package/dist/warning-icon.entry-19f721c3.js +15 -0
- package/dist/warning-icon.entry-3ab9a59e.cjs +1 -0
- package/package.json +3 -3
- package/dist/add-circle-icon_22.entry-080abc71.cjs +0 -1
- package/dist/add-circle-icon_22.entry-bda9be31.js +0 -1818
- package/dist/archive-icon_7.entry-ca20da59.cjs +0 -1
- package/dist/chevron-icon_3.entry-74425e1f.js +0 -117
- package/dist/chevron-icon_3.entry-7ff803ad.cjs +0 -1
- package/dist/close-icon.entry-18e140ed.cjs +0 -1
- package/dist/close-icon.entry-6a8ea4a7.js +0 -15
- package/dist/document-refresh-icon.entry-f15f795a.cjs +0 -1
- package/dist/google-logo-icon_4.entry-38d5c2f2.cjs +0 -1
- package/dist/google-logo-icon_4.entry-5eca9538.js +0 -381
- package/dist/index-93c50de4.cjs +0 -37
- package/dist/index-f93f6948.js +0 -4006
- package/dist/loading-icon.entry-b563b2e6.js +0 -15
- package/dist/loading-icon.entry-fb04b893.cjs +0 -1
- package/dist/nylas-additional-participants.entry-33a45477.cjs +0 -1
- package/dist/nylas-additional-participants.entry-4b214308.js +0 -81
- package/dist/nylas-booked-event-card_10.entry-3e225025.cjs +0 -1
- package/dist/nylas-booked-event-card_10.entry-e93bc290.js +0 -782
- package/dist/nylas-form-card.entry-0748fdd5.js +0 -54
- package/dist/nylas-form-card.entry-eb3607bc.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-4de2bb97.js +0 -2275
- package/dist/nylas-scheduler-editor.entry-72c91b7d.cjs +0 -7
- package/dist/nylas-scheduling.entry-1a004916.cjs +0 -1
- package/dist/nylas-scheduling.entry-4e18ab43.js +0 -235
- package/dist/people-icon.entry-431e5044.cjs +0 -1
- package/dist/people-icon.entry-b4778e15.js +0 -15
- package/dist/play-icon_2.entry-f97db395.cjs +0 -1
- package/dist/scheduler-config-store-07d98279-0610e42f.cjs +0 -1
- package/dist/scheduler-config-store-07d98279-3b70606c.js +0 -24
- package/dist/scheduler-store-24fd0e91-2dba20c2.cjs +0 -1
- package/dist/scheduler-store-24fd0e91-47098841.js +0 -302
- package/dist/time-period-selector.entry-1e849c2e.js +0 -76
- package/dist/time-period-selector.entry-d8f3462f.cjs +0 -1
- package/dist/warning-icon.entry-1f0f00ed.cjs +0 -1
- package/dist/warning-icon.entry-b5db0151.js +0 -15
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
import { d as w, e as D } from "./index-f93f6948.js";
|
|
2
|
-
var v;
|
|
3
|
-
(function(r) {
|
|
4
|
-
r.Component = "component", r.Api = "api", r.Auth = "auth";
|
|
5
|
-
})(v || (v = {}));
|
|
6
|
-
var P;
|
|
7
|
-
(function(r) {
|
|
8
|
-
r.endtime_not_in_future = "endtime_not_in_future", r.no_booking_info = "no_booking_info", r.no_timeslot_selected = "no_timeslot_selected", r.no_timezone_selected = "no_timezone_selected", r.no_booking_id = "no_booking_id", r.invalid_start_time = "invalid_start_time", r.invalid_end_time = "invalid_end_time", r.invalid_timezone = "invalid_timezone";
|
|
9
|
-
})(P || (P = {}));
|
|
10
|
-
var b;
|
|
11
|
-
(function(r) {
|
|
12
|
-
r.invalid_session = "invalid_session", r.general_error = "general_error", r.internal_error = "internal_error", r.invalid_request_error = "invalid_request_error", r.timeslot_not_available = "timeslot_not_available";
|
|
13
|
-
})(b || (b = {}));
|
|
14
|
-
class R {
|
|
15
|
-
constructor() {
|
|
16
|
-
this.component = (t) => {
|
|
17
|
-
const e = v.Component, s = `${t} error`;
|
|
18
|
-
return {
|
|
19
|
-
endtime_not_in_future: (i = '"endtime" can not be in the future') => ({
|
|
20
|
-
title: s,
|
|
21
|
-
message: i,
|
|
22
|
-
category: e
|
|
23
|
-
}),
|
|
24
|
-
no_booking_info: (i = "No booking info provided") => ({
|
|
25
|
-
title: s,
|
|
26
|
-
message: i,
|
|
27
|
-
category: e
|
|
28
|
-
}),
|
|
29
|
-
no_timeslot_selected: (i = "No timeslot selected") => ({
|
|
30
|
-
title: s,
|
|
31
|
-
message: i,
|
|
32
|
-
category: e
|
|
33
|
-
}),
|
|
34
|
-
no_timezone_selected: (i = "No timezone selected") => ({
|
|
35
|
-
title: s,
|
|
36
|
-
message: i,
|
|
37
|
-
category: e
|
|
38
|
-
}),
|
|
39
|
-
no_booking_id: (i = "No booking id provided") => ({
|
|
40
|
-
title: s,
|
|
41
|
-
message: i,
|
|
42
|
-
category: e
|
|
43
|
-
}),
|
|
44
|
-
invalid_start_time: (i = "Invalid start time") => ({
|
|
45
|
-
title: s,
|
|
46
|
-
message: i,
|
|
47
|
-
category: e
|
|
48
|
-
}),
|
|
49
|
-
invalid_end_time: (i = "Invalid end time") => ({
|
|
50
|
-
title: s,
|
|
51
|
-
message: i,
|
|
52
|
-
category: e
|
|
53
|
-
}),
|
|
54
|
-
invalid_timezone: (i = "Invalid timezone") => ({
|
|
55
|
-
title: s,
|
|
56
|
-
message: i,
|
|
57
|
-
category: e
|
|
58
|
-
})
|
|
59
|
-
};
|
|
60
|
-
}, this.api = (t) => {
|
|
61
|
-
const e = v.Api, s = `${t} error`;
|
|
62
|
-
return {
|
|
63
|
-
invalid_session: (i) => ({
|
|
64
|
-
title: s,
|
|
65
|
-
message: i,
|
|
66
|
-
category: e
|
|
67
|
-
}),
|
|
68
|
-
general_error: (i) => ({
|
|
69
|
-
title: s,
|
|
70
|
-
message: i,
|
|
71
|
-
category: e
|
|
72
|
-
}),
|
|
73
|
-
internal_error: (i) => ({
|
|
74
|
-
title: s,
|
|
75
|
-
message: i,
|
|
76
|
-
category: e
|
|
77
|
-
}),
|
|
78
|
-
invalid_request_error: (i) => ({
|
|
79
|
-
title: s,
|
|
80
|
-
message: i,
|
|
81
|
-
category: e
|
|
82
|
-
}),
|
|
83
|
-
timeslot_not_available: (i) => ({
|
|
84
|
-
title: s,
|
|
85
|
-
message: i,
|
|
86
|
-
category: e
|
|
87
|
-
})
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
class B {
|
|
93
|
-
constructor({ schedulerAPIURL: t, schedulerStore: e, sessionId: s, configId: i }) {
|
|
94
|
-
this.errors = new R(), this.schedulerStore = e, this.schedulerAPIURL = t, this.sessionId = s, this.configId = i;
|
|
95
|
-
}
|
|
96
|
-
getHeaders() {
|
|
97
|
-
return this.configId ? {} : {
|
|
98
|
-
Authorization: `Bearer ${this.sessionId}`
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
async makeAPIRequest(t, e, s, i = {}) {
|
|
102
|
-
try {
|
|
103
|
-
const n = new URL(this.schedulerAPIURL);
|
|
104
|
-
return n.pathname = t, await (await fetch(decodeURIComponent(n.toString()), {
|
|
105
|
-
method: e,
|
|
106
|
-
headers: {
|
|
107
|
-
"Content-Type": "application/json",
|
|
108
|
-
...i
|
|
109
|
-
},
|
|
110
|
-
body: s
|
|
111
|
-
})).json();
|
|
112
|
-
} catch (n) {
|
|
113
|
-
return {
|
|
114
|
-
error: {
|
|
115
|
-
message: n.message,
|
|
116
|
-
title: "API request failed",
|
|
117
|
-
type: "api"
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
selectDate(t) {
|
|
123
|
-
this.schedulerStore.set("selectedDate", t), this.schedulerStore.set("selectedTimeslot", null);
|
|
124
|
-
}
|
|
125
|
-
selectTime(t) {
|
|
126
|
-
this.schedulerStore.set("selectedTimeslot", t);
|
|
127
|
-
}
|
|
128
|
-
selectTimezone(t) {
|
|
129
|
-
this.schedulerStore.set("selectedTimezone", t);
|
|
130
|
-
}
|
|
131
|
-
toggleAdditionalData(t) {
|
|
132
|
-
this.schedulerStore.set("showBookingForm", t);
|
|
133
|
-
}
|
|
134
|
-
setParticipantName(t) {
|
|
135
|
-
const { bookingInfo: e } = this.schedulerStore.state;
|
|
136
|
-
this.schedulerStore.set("bookingInfo", {
|
|
137
|
-
...e,
|
|
138
|
-
primaryParticipant: {
|
|
139
|
-
...e == null ? void 0 : e.primaryParticipant,
|
|
140
|
-
name: t
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
setParticipantEmail(t) {
|
|
145
|
-
const { bookingInfo: e } = this.schedulerStore.state;
|
|
146
|
-
this.schedulerStore.set("bookingInfo", {
|
|
147
|
-
...e,
|
|
148
|
-
primaryParticipant: {
|
|
149
|
-
...e == null ? void 0 : e.primaryParticipant,
|
|
150
|
-
email: t
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
async setReschedule(t) {
|
|
155
|
-
const e = /* @__PURE__ */ new Date();
|
|
156
|
-
this.schedulerStore.set("rescheduleBookingId", t), this.schedulerStore.set("selectedTimeslot", null), this.schedulerStore.set("eventInfo", null), this.schedulerStore.set("showBookingForm", !1);
|
|
157
|
-
const s = new Date(e.getFullYear(), e.getMonth(), 1).getTime() / 1e3, i = new Date(e.getFullYear(), e.getMonth() + 1, 1).getTime() / 1e3, n = await this.getAvailability(s, i), l = this.schedulerStore.get("availability").find((a) => new Date(a.start_time) > /* @__PURE__ */ new Date());
|
|
158
|
-
let d = e;
|
|
159
|
-
return l && (d = l.start_time), this.schedulerStore.set("selectedDate", d), n;
|
|
160
|
-
}
|
|
161
|
-
async setCancel(t) {
|
|
162
|
-
this.schedulerStore.set("cancelBookingId", t);
|
|
163
|
-
}
|
|
164
|
-
async bookTimeslot(t) {
|
|
165
|
-
var c;
|
|
166
|
-
this.schedulerStore.set("isLoading", !0);
|
|
167
|
-
const { selectedTimeslot: e, selectedTimezone: s, bookingInfo: i } = this.schedulerStore.state;
|
|
168
|
-
if (!t && !i)
|
|
169
|
-
return { error: this.errors.component("Booking").no_booking_info() };
|
|
170
|
-
const n = (t == null ? void 0 : t.timeslot) || e;
|
|
171
|
-
if (!n)
|
|
172
|
-
return { error: this.errors.component("Create Booking").no_timeslot_selected() };
|
|
173
|
-
const l = t && (t != null && t.timezone) ? t == null ? void 0 : t.timezone : s;
|
|
174
|
-
if (!l)
|
|
175
|
-
return { error: this.errors.component("Create Booking").no_timezone_selected() };
|
|
176
|
-
const d = t ? t == null ? void 0 : t.primaryParticipant : i == null ? void 0 : i.primaryParticipant, a = t ? (t == null ? void 0 : t.guests) || [] : (i == null ? void 0 : i.guests) || [], h = t ? { ...t == null ? void 0 : t.additionalFields, guests: a } : { ...i == null ? void 0 : i.additionalFields, guests: a }, p = this.getHeaders(), _ = `/v3/scheduling/bookings${this.configId ? `?configuration_id=${this.configId}` : ""}`, o = await this.makeAPIRequest(decodeURIComponent(_), "POST", JSON.stringify({
|
|
177
|
-
additional_fields: h,
|
|
178
|
-
guest: { ...d },
|
|
179
|
-
start_time: n.start_time.getTime() / 1e3,
|
|
180
|
-
end_time: n.end_time.getTime() / 1e3,
|
|
181
|
-
timezone: l
|
|
182
|
-
}), p);
|
|
183
|
-
if ("error" in o) {
|
|
184
|
-
this.schedulerStore.set("isLoading", !1);
|
|
185
|
-
const u = (c = o.error) == null ? void 0 : c.type;
|
|
186
|
-
let m = o.error;
|
|
187
|
-
return u && u in this.errors.api("Create Booking") && (m = this.errors.api("Create Booking")[u]((m == null ? void 0 : m.message) || (m == null ? void 0 : m.title) || "Something went wrong")), { error: m };
|
|
188
|
-
}
|
|
189
|
-
return "data" in o && this.schedulerStore.set("eventInfo", o == null ? void 0 : o.data), this.schedulerStore.set("isLoading", !1), o;
|
|
190
|
-
}
|
|
191
|
-
async getAvailability(t = 0, e = 0) {
|
|
192
|
-
var p, S, _;
|
|
193
|
-
this.schedulerStore.set("isLoading", !0);
|
|
194
|
-
const s = new URLSearchParams(), i = /* @__PURE__ */ new Date(), n = i.getTime();
|
|
195
|
-
if (e && e < n / 1e3)
|
|
196
|
-
return this.schedulerStore.set("isLoading", !1), { error: this.errors.component("Get Availability").endtime_not_in_future() };
|
|
197
|
-
if (!t) {
|
|
198
|
-
const o = new Date(i.getFullYear(), i.getMonth(), 1);
|
|
199
|
-
t = Math.floor(o.getTime() / 1e3);
|
|
200
|
-
}
|
|
201
|
-
if (!e) {
|
|
202
|
-
const o = new Date(i.getFullYear(), i.getMonth() + 1, 0);
|
|
203
|
-
e = Math.floor(o.getTime() / 1e3);
|
|
204
|
-
}
|
|
205
|
-
s.append("start_time", encodeURIComponent(t.toString())), s.append("end_time", encodeURIComponent(e.toString())), this.configId && s.append("configuration_id", encodeURIComponent(this.configId));
|
|
206
|
-
const l = s.toString(), d = `/v3/scheduling/availability${l ? `?${l}` : ""}`, a = this.getHeaders(), h = await this.makeAPIRequest(decodeURIComponent(d), "GET", void 0, a);
|
|
207
|
-
if ("error" in h) {
|
|
208
|
-
this.schedulerStore.set("availability", []), this.schedulerStore.set("isLoading", !1);
|
|
209
|
-
const o = (p = h.error) == null ? void 0 : p.type;
|
|
210
|
-
let c = h.error;
|
|
211
|
-
return o && o in this.errors.api("Get Availability") && (c = this.errors.api("Get Availability")[o]((c == null ? void 0 : c.message) || (c == null ? void 0 : c.title) || "Something went wrong")), { error: c };
|
|
212
|
-
}
|
|
213
|
-
if ("data" in h) {
|
|
214
|
-
const c = (((_ = (S = h.data) == null ? void 0 : S.time_slots) == null ? void 0 : _.map((u) => ({
|
|
215
|
-
...u,
|
|
216
|
-
start_time: new Date(u.start_time * 1e3),
|
|
217
|
-
end_time: new Date(u.end_time * 1e3)
|
|
218
|
-
}))) || []).filter((u) => u.start_time.getTime() > n);
|
|
219
|
-
this.schedulerStore.set("availability", c);
|
|
220
|
-
}
|
|
221
|
-
return this.schedulerStore.set("isLoading", !1), h;
|
|
222
|
-
}
|
|
223
|
-
async cancelBooking(t) {
|
|
224
|
-
var l;
|
|
225
|
-
if (this.schedulerStore.set("isLoading", !0), !t)
|
|
226
|
-
return { error: this.errors.component("Cancel Booking").no_booking_id() };
|
|
227
|
-
const e = this.configId ? `?configuration_id=${this.configId}` : "", s = `/v3/scheduling/bookings/${t}${e}`, i = this.getHeaders(), n = await this.makeAPIRequest(decodeURIComponent(s), "DELETE", JSON.stringify({
|
|
228
|
-
action: "cancel"
|
|
229
|
-
}), i);
|
|
230
|
-
if ("error" in n) {
|
|
231
|
-
this.schedulerStore.set("isLoading", !1);
|
|
232
|
-
const d = (l = n.error) == null ? void 0 : l.type;
|
|
233
|
-
let a = n.error;
|
|
234
|
-
return d && d in this.errors.api("Cancel Booking") && (a = this.errors.api("Cancel Booking")[d]((a == null ? void 0 : a.message) || (a == null ? void 0 : a.title) || "Something went wrong")), { error: a };
|
|
235
|
-
}
|
|
236
|
-
return this.schedulerStore.set("cancelledEventInfo", {
|
|
237
|
-
booking_id: t
|
|
238
|
-
}), this.schedulerStore.set("isLoading", !1), n;
|
|
239
|
-
}
|
|
240
|
-
async rescheduleBooking(t, e) {
|
|
241
|
-
var I;
|
|
242
|
-
if (this.schedulerStore.set("isLoading", !0), !t)
|
|
243
|
-
return { error: this.errors.component("Reschedule Booking").no_booking_id() };
|
|
244
|
-
const s = this.errors.api("Reschedule Booking"), i = this.errors.component("Reschedule Booking"), { bookingInfo: n, selectedTimeslot: l, selectedTimezone: d } = this.schedulerStore.state, { startTime: a, endTime: h, timezone: p } = e, S = a || (l == null ? void 0 : l.start_time);
|
|
245
|
-
if (!S)
|
|
246
|
-
return { error: i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
|
|
247
|
-
const _ = h || (l == null ? void 0 : l.end_time);
|
|
248
|
-
if (!_)
|
|
249
|
-
return { error: i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
|
|
250
|
-
const o = p || d;
|
|
251
|
-
if (!o)
|
|
252
|
-
return { error: i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.') };
|
|
253
|
-
const c = e ? e == null ? void 0 : e.primaryParticipant : n == null ? void 0 : n.primaryParticipant, u = e ? (e == null ? void 0 : e.guests) || [] : (n == null ? void 0 : n.guests) || [], m = e ? { ...e == null ? void 0 : e.additionalFields, guests: u } : { ...n == null ? void 0 : n.additionalFields, guests: u }, k = this.configId ? `?configuration_id=${this.configId}` : "", T = `/v3/scheduling/bookings/${t}${k}`, z = this.getHeaders(), g = await this.makeAPIRequest(decodeURIComponent(T), "PATCH", JSON.stringify({
|
|
254
|
-
start_time: S.getTime() / 1e3,
|
|
255
|
-
end_time: _.getTime() / 1e3,
|
|
256
|
-
time_zone: o,
|
|
257
|
-
additional_fields: m,
|
|
258
|
-
guest: { ...c }
|
|
259
|
-
}), z);
|
|
260
|
-
if ("error" in g) {
|
|
261
|
-
this.schedulerStore.set("isLoading", !1);
|
|
262
|
-
const y = (I = g.error) == null ? void 0 : I.type;
|
|
263
|
-
let f = g.error;
|
|
264
|
-
y && y in s && (f = s[y]((f == null ? void 0 : f.message) || (f == null ? void 0 : f.title) || "Something went wrong"));
|
|
265
|
-
}
|
|
266
|
-
return "data" in g && this.schedulerStore.set("eventInfo", g == null ? void 0 : g.data), this.schedulerStore.set("isLoading", !1), g;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
function A(r = {}) {
|
|
270
|
-
const t = {
|
|
271
|
-
selectedDate: null,
|
|
272
|
-
selectedLanguage: navigator.language,
|
|
273
|
-
selectedTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
274
|
-
selectedTimeslot: null,
|
|
275
|
-
showBookingForm: !1,
|
|
276
|
-
selectableDates: null,
|
|
277
|
-
availability: [],
|
|
278
|
-
state: "ready",
|
|
279
|
-
eventInfo: null,
|
|
280
|
-
cancelledEventInfo: null,
|
|
281
|
-
isLoading: !1,
|
|
282
|
-
nylasBranding: !0,
|
|
283
|
-
...r
|
|
284
|
-
};
|
|
285
|
-
w("[defaultNylasStoreState]: ", t);
|
|
286
|
-
const e = D(t);
|
|
287
|
-
return e.onChange("availability", (s) => {
|
|
288
|
-
w("[availability]: ", s);
|
|
289
|
-
const i = s.map((n) => n.start_time);
|
|
290
|
-
w("[selectableDates]: ", i), e.set("selectableDates", i);
|
|
291
|
-
}), e.reset = () => {
|
|
292
|
-
for (const s in t) {
|
|
293
|
-
const i = t[s];
|
|
294
|
-
e.set(s, i);
|
|
295
|
-
}
|
|
296
|
-
}, e;
|
|
297
|
-
}
|
|
298
|
-
export {
|
|
299
|
-
A as C,
|
|
300
|
-
v as E,
|
|
301
|
-
B as N
|
|
302
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { r as i, c as s, d as n, h as d, g as l } from "./index-f93f6948.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
const a = ".time-period-selector.sc-time-period-selector{display:flex;gap:0.5rem}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.time-period-selector.sc-time-period-selector select-dropdown#time-period.sc-time-period-selector::part(sd_dropdown-button){min-width:108px}.time-period-selector.sc-time-period-selector select-dropdown#time-number.sc-time-period-selector::part(sd_dropdown-button){min-width:84px}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-button){padding:1rem;gap:1rem}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-content){width:100%;max-height:200px}", c = a, p = class {
|
|
5
|
-
constructor(e) {
|
|
6
|
-
i(this, e), this.timePeriodChanged = s(this, "timePeriodChanged", 7), this.timePeriods = ["hour", "day", "week", "month"], this.defaultSelectedPeriod = "hour", this.defaultSelectedNumber = 1, this.selectedPeriod = this.defaultSelectedPeriod, this.selectedNumber = this.defaultSelectedNumber, this.numberOptions = this.calculateOptions("hour").map((t) => ({
|
|
7
|
-
label: t.toString(),
|
|
8
|
-
value: t.toString()
|
|
9
|
-
})), this.timePeriodOptions = this.timePeriods.map((t) => ({
|
|
10
|
-
label: t,
|
|
11
|
-
value: t
|
|
12
|
-
}));
|
|
13
|
-
}
|
|
14
|
-
defaultSelectedPeriodChangedHandler(e) {
|
|
15
|
-
this.selectedPeriod = e, this.updateNumberOptionsAndSelectedNumber(e);
|
|
16
|
-
}
|
|
17
|
-
defaultSelectedNumberChangedHandler(e) {
|
|
18
|
-
this.selectedNumber = e;
|
|
19
|
-
}
|
|
20
|
-
timePeriodsChangedHandler(e) {
|
|
21
|
-
this.timePeriodOptions = e.map((t) => ({
|
|
22
|
-
label: t,
|
|
23
|
-
value: t
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
calculateOptions(e) {
|
|
27
|
-
switch (e) {
|
|
28
|
-
case "hour":
|
|
29
|
-
return Array.from({ length: 23 }, (t, r) => r + 1);
|
|
30
|
-
case "minute":
|
|
31
|
-
return Array.from({ length: 60 }, (t, r) => r);
|
|
32
|
-
case "day":
|
|
33
|
-
return Array.from({ length: 30 }, (t, r) => r + 1);
|
|
34
|
-
case "week":
|
|
35
|
-
return Array.from({ length: 4 }, (t, r) => r + 1);
|
|
36
|
-
case "month":
|
|
37
|
-
return Array.from({ length: 12 }, (t, r) => r + 1);
|
|
38
|
-
default:
|
|
39
|
-
return [];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
selectedOptionChangedHandler(e) {
|
|
43
|
-
n("time-period-selector", "selectedOptionChangedHandler", e.detail);
|
|
44
|
-
const { value: t, name: r } = e.detail;
|
|
45
|
-
r === "time-period" ? (this.selectedPeriod = t, this.updateNumberOptionsAndSelectedNumber(t)) : r === "time-number" && (this.selectedNumber = parseInt(t));
|
|
46
|
-
const o = {
|
|
47
|
-
number: this.selectedNumber,
|
|
48
|
-
period: this.selectedPeriod
|
|
49
|
-
};
|
|
50
|
-
this.timePeriodChanged.emit(o);
|
|
51
|
-
}
|
|
52
|
-
updateNumberOptionsAndSelectedNumber(e) {
|
|
53
|
-
const t = this.calculateOptions(e);
|
|
54
|
-
this.numberOptions = t.map((r) => ({
|
|
55
|
-
label: r.toString(),
|
|
56
|
-
value: r.toString()
|
|
57
|
-
})), this.selectedNumber = parseInt(this.numberOptions[0].value);
|
|
58
|
-
}
|
|
59
|
-
render() {
|
|
60
|
-
return d("div", { key: "eaec00db41b0c2410fc4a9ccc341fc4ec4012e10", class: "time-period-selector" }, d("select-dropdown", { key: "0d53efe90429a05d4f52a8f1b92bf46b14b1e6ad", id: "time-number", name: "time-number", exportparts: "sd__dropdown: tps__number-dropdown, sd__dropdown-button: tps__number-dropdown-button, sd__dropdown-content: tps__number-dropdown-content", options: this.numberOptions, defaultSelectedOption: this.numberOptions.find((e) => e.value == this.selectedNumber.toString()) ?? this.numberOptions[0], withSearch: !1 }), d("select-dropdown", { key: "bce764e3e959eb4fad73d1e410173d584f243ee5", id: "time-period", name: "time-period", options: this.timePeriodOptions, exportparts: "sd__dropdown: tps__period-dropdown, sd__dropdown-button: tps__period-dropdown-button, sd__dropdown-content: tps__period-dropdown-content", pluralizedLabel: this.selectedNumber > 1 ? "s" : "", defaultSelectedOption: this.timePeriodOptions.find((e) => e.value == this.selectedPeriod) ?? this.timePeriodOptions[0], withSearch: !1 }));
|
|
61
|
-
}
|
|
62
|
-
get host() {
|
|
63
|
-
return l(this);
|
|
64
|
-
}
|
|
65
|
-
static get watchers() {
|
|
66
|
-
return {
|
|
67
|
-
defaultSelectedPeriod: ["defaultSelectedPeriodChangedHandler"],
|
|
68
|
-
defaultSelectedNumber: ["defaultSelectedNumberChangedHandler"],
|
|
69
|
-
timePeriods: ["timePeriodsChangedHandler"]
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
p.style = c;
|
|
74
|
-
export {
|
|
75
|
-
p as time_period_selector
|
|
76
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-93c50de4.cjs");require("react");require("react-dom");const s=".time-period-selector.sc-time-period-selector{display:flex;gap:0.5rem}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.time-period-selector.sc-time-period-selector select-dropdown#time-period.sc-time-period-selector::part(sd_dropdown-button){min-width:108px}.time-period-selector.sc-time-period-selector select-dropdown#time-number.sc-time-period-selector::part(sd_dropdown-button){min-width:84px}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-button){padding:1rem;gap:1rem}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-content){width:100%;max-height:200px}",n=s,i=class{constructor(e){d.registerInstance(this,e),this.timePeriodChanged=d.createEvent(this,"timePeriodChanged",7),this.timePeriods=["hour","day","week","month"],this.defaultSelectedPeriod="hour",this.defaultSelectedNumber=1,this.selectedPeriod=this.defaultSelectedPeriod,this.selectedNumber=this.defaultSelectedNumber,this.numberOptions=this.calculateOptions("hour").map(t=>({label:t.toString(),value:t.toString()})),this.timePeriodOptions=this.timePeriods.map(t=>({label:t,value:t}))}defaultSelectedPeriodChangedHandler(e){this.selectedPeriod=e,this.updateNumberOptionsAndSelectedNumber(e)}defaultSelectedNumberChangedHandler(e){this.selectedNumber=e}timePeriodsChangedHandler(e){this.timePeriodOptions=e.map(t=>({label:t,value:t}))}calculateOptions(e){switch(e){case"hour":return Array.from({length:23},(t,r)=>r+1);case"minute":return Array.from({length:60},(t,r)=>r);case"day":return Array.from({length:30},(t,r)=>r+1);case"week":return Array.from({length:4},(t,r)=>r+1);case"month":return Array.from({length:12},(t,r)=>r+1);default:return[]}}selectedOptionChangedHandler(e){d.debug("time-period-selector","selectedOptionChangedHandler",e.detail);const{value:t,name:r}=e.detail;r==="time-period"?(this.selectedPeriod=t,this.updateNumberOptionsAndSelectedNumber(t)):r==="time-number"&&(this.selectedNumber=parseInt(t));const o={number:this.selectedNumber,period:this.selectedPeriod};this.timePeriodChanged.emit(o)}updateNumberOptionsAndSelectedNumber(e){const t=this.calculateOptions(e);this.numberOptions=t.map(r=>({label:r.toString(),value:r.toString()})),this.selectedNumber=parseInt(this.numberOptions[0].value)}render(){return d.h("div",{key:"eaec00db41b0c2410fc4a9ccc341fc4ec4012e10",class:"time-period-selector"},d.h("select-dropdown",{key:"0d53efe90429a05d4f52a8f1b92bf46b14b1e6ad",id:"time-number",name:"time-number",exportparts:"sd__dropdown: tps__number-dropdown, sd__dropdown-button: tps__number-dropdown-button, sd__dropdown-content: tps__number-dropdown-content",options:this.numberOptions,defaultSelectedOption:this.numberOptions.find(e=>e.value==this.selectedNumber.toString())??this.numberOptions[0],withSearch:!1}),d.h("select-dropdown",{key:"bce764e3e959eb4fad73d1e410173d584f243ee5",id:"time-period",name:"time-period",options:this.timePeriodOptions,exportparts:"sd__dropdown: tps__period-dropdown, sd__dropdown-button: tps__period-dropdown-button, sd__dropdown-content: tps__period-dropdown-content",pluralizedLabel:this.selectedNumber>1?"s":"",defaultSelectedOption:this.timePeriodOptions.find(e=>e.value==this.selectedPeriod)??this.timePeriodOptions[0],withSearch:!1}))}get host(){return d.getElement(this)}static get watchers(){return{defaultSelectedPeriod:["defaultSelectedPeriodChangedHandler"],defaultSelectedNumber:["defaultSelectedNumberChangedHandler"],timePeriods:["timePeriodsChangedHandler"]}}};i.style=n;exports.time_period_selector=i;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-93c50de4.cjs");require("react");require("react-dom");const r=".sc-warning-icon-h{display:flex}",i=r,n=class{constructor(t){e.registerInstance(this,t),this.width="16",this.height="16"}render(){return e.h("svg",{key:"5a655b4440d40d0e22c0e8bb3d9e3f08a947eb32",width:"21",height:"21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"c3de0f39d8816fcc092f0a4bc6231e9cb91283de",d:"M10.149 7.054a.5.5 0 0 1 .5.5v4a.5.5 0 1 1-1 0v-4a.5.5 0 0 1 .5-.5Zm0 7.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM8.834 2.906a1.5 1.5 0 0 1 2.63 0l6.558 11.925a1.5 1.5 0 0 1-1.314 2.223H3.59a1.5 1.5 0 0 1-1.314-2.223L8.834 2.906Zm1.753.482a.5.5 0 0 0-.876 0L3.15 15.313a.5.5 0 0 0 .439.741h13.117a.5.5 0 0 0 .439-.741l-6.56-11.925Z",fill:"currentColor"}))}};n.style=i;exports.warning_icon=n;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { r as a, h as n } from "./index-f93f6948.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
const e = ".sc-warning-icon-h{display:flex}", r = e, i = class {
|
|
5
|
-
constructor(t) {
|
|
6
|
-
a(this, t), this.width = "16", this.height = "16";
|
|
7
|
-
}
|
|
8
|
-
render() {
|
|
9
|
-
return n("svg", { key: "5a655b4440d40d0e22c0e8bb3d9e3f08a947eb32", width: "21", height: "21", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("path", { key: "c3de0f39d8816fcc092f0a4bc6231e9cb91283de", d: "M10.149 7.054a.5.5 0 0 1 .5.5v4a.5.5 0 1 1-1 0v-4a.5.5 0 0 1 .5-.5Zm0 7.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM8.834 2.906a1.5 1.5 0 0 1 2.63 0l6.558 11.925a1.5 1.5 0 0 1-1.314 2.223H3.59a1.5 1.5 0 0 1-1.314-2.223L8.834 2.906Zm1.753.482a.5.5 0 0 0-.876 0L3.15 15.313a.5.5 0 0 0 .439.741h13.117a.5.5 0 0 0 .439-.741l-6.56-11.925Z", fill: "currentColor" }));
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
i.style = r;
|
|
13
|
-
export {
|
|
14
|
-
i as warning_icon
|
|
15
|
-
};
|