@nylas/react 1.1.0-canary.14 → 1.1.0-canary.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-circle-icon_2.entry-00dc2c13.cjs +1 -0
- package/dist/add-circle-icon_2.entry-3f834b47.js +26 -0
- package/dist/{archive-icon_7.entry-60311199.cjs → archive-icon_7.entry-25d8b2f0.cjs} +1 -1
- package/dist/{archive-icon_7.entry-0dfc9782.js → archive-icon_7.entry-ca8262ff.js} +15 -15
- package/dist/{arrow-icon.entry-eb53c4cb.cjs → arrow-icon.entry-01192ecf.cjs} +1 -1
- package/dist/{arrow-icon.entry-f38f3014.js → arrow-icon.entry-991ba7cd.js} +2 -2
- package/dist/{bold-icon_3.entry-20e74265.js → bold-icon_3.entry-81a3ff1e.js} +10 -10
- package/dist/{bold-icon_3.entry-d5100ffa.cjs → bold-icon_3.entry-e94dcf5b.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-e5d1bc0a.cjs → calendar-cancel-icon.entry-9088fa8b.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-0bdee178.js → calendar-cancel-icon.entry-f646c147.js} +5 -5
- package/dist/{calendar-check-icon_2.entry-10af2017.cjs → calendar-check-icon_2.entry-4dc1391a.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-f18a2ddb.js → calendar-check-icon_2.entry-a7e4d0e6.js} +7 -7
- package/dist/{calendar-icon.entry-12ca0ae4.js → calendar-icon.entry-1658930c.js} +2 -2
- package/dist/{calendar-icon.entry-bc6f0808.cjs → calendar-icon.entry-1e2acd5c.cjs} +1 -1
- package/dist/{add-circle-icon_22.entry-ab0d5ede.js → calendar-info-icon_25.entry-493c5547.js} +966 -704
- package/dist/calendar-info-icon_25.entry-7513d798.cjs +1 -0
- package/dist/chevron-icon_3.entry-52b97043.cjs +1 -0
- package/dist/chevron-icon_3.entry-b3c7eb44.js +126 -0
- package/dist/{clock-icon_2.entry-ffc9e057.js → clock-icon_2.entry-58f07042.js} +3 -3
- package/dist/{clock-icon_2.entry-7cddf901.cjs → clock-icon_2.entry-882249ee.cjs} +1 -1
- package/dist/close-icon.entry-4a39816a.js +15 -0
- package/dist/close-icon.entry-f1166251.cjs +1 -0
- package/dist/{constants-f34b9c6e-108993e8.cjs → constants-f34b9c6e-1da5094b.cjs} +1 -1
- package/dist/{constants-f34b9c6e-37cabe82.js → constants-f34b9c6e-628beaa8.js} +1 -1
- package/dist/{document-refresh-icon.entry-d1f6259a.cjs → document-refresh-icon.entry-4f581bf4.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-e4636c8e.js → document-refresh-icon.entry-b53316b4.js} +2 -2
- package/dist/elements/index.d.ts +9 -0
- package/dist/{elements-dc5b338e-a37a0510.cjs → elements-dc5b338e-3284591d.cjs} +1 -1
- package/dist/{elements-dc5b338e-c6f2806c.js → elements-dc5b338e-7abe37c6.js} +1 -1
- package/dist/{focus-visible-e8093c16-b62197ad.cjs → focus-visible-e8093c16-cb6c97b1.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-b0821d89.js → focus-visible-e8093c16-d6612604.js} +1 -1
- package/dist/{forward-icon_6.entry-2a694e7c.js → forward-icon_6.entry-d54244f7.js} +9 -9
- package/dist/{forward-icon_6.entry-b81b22f6.cjs → forward-icon_6.entry-e402ad1e.cjs} +2 -2
- package/dist/{globe-icon.entry-c037589b.cjs → globe-icon.entry-db7377d9.cjs} +1 -1
- package/dist/{globe-icon.entry-e794eb52.js → globe-icon.entry-e83c79c2.js} +4 -4
- package/dist/google-logo-icon_4.entry-8818686b.js +429 -0
- package/dist/google-logo-icon_4.entry-fa65ae29.cjs +1 -0
- package/dist/{index-d61429c6.js → index-2d032bec.js} +1288 -1265
- package/dist/index-53420959-41ed02ae.js +5 -0
- package/dist/index-53420959-a76f0327.cjs +1 -0
- package/dist/{index-ef01c714-1e2feefc.js → index-6d9eeb53-91d36348.js} +2 -2
- package/dist/{index-ef01c714-54e17405.cjs → index-6d9eeb53-f478270c.cjs} +1 -1
- package/dist/index-9c04361d.cjs +42 -0
- package/dist/{index.es-74f70f7d-a22eba35.cjs → index.es-9cc0eb3c-2242baf6.cjs} +1 -1
- package/dist/{index.es-74f70f7d-da0e7fcf.js → index.es-9cc0eb3c-ee2ebbe1.js} +1 -1
- package/dist/{info-icon_2.entry-23e3fa8a.cjs → info-icon_2.entry-4b257e73.cjs} +1 -1
- package/dist/{info-icon_2.entry-647915bb.js → info-icon_2.entry-74eb7415.js} +5 -5
- package/dist/input-component.entry-3ef7ce2c.cjs +1 -0
- package/dist/input-component.entry-6bb4a5e8.js +45 -0
- package/dist/input-dropdown_2.entry-a87714fc.cjs +1 -0
- package/dist/input-dropdown_2.entry-f71e4c01.js +209 -0
- package/dist/{loading-icon.entry-1ddd0244.js → loading-icon.entry-30724cb0.js} +2 -2
- package/dist/{loading-icon.entry-98d65a5d.cjs → loading-icon.entry-bb250f1c.cjs} +1 -1
- package/dist/{mailbox-store-050a2914-6fef25fb.js → mailbox-store-64b4ef7c-202f1afd.js} +2 -2
- package/dist/{mailbox-store-050a2914-bd0a86bb.cjs → mailbox-store-64b4ef7c-74f959be.cjs} +1 -1
- package/dist/{nylas-additional-participants.entry-3c598863.cjs → nylas-additional-participants.entry-567c7c2a.cjs} +1 -1
- package/dist/{nylas-additional-participants.entry-0f93e24e.js → nylas-additional-participants.entry-7961be04.js} +5 -5
- package/dist/nylas-booked-event-card_10.entry-c2f889ba.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-9f7869af.js → nylas-booked-event-card_10.entry-ddfcff5e.js} +371 -299
- package/dist/{nylas-custom-booking-flow.entry-877cac85.cjs → nylas-custom-booking-flow.entry-63ed387e.cjs} +1 -1
- package/dist/{nylas-custom-booking-flow.entry-69638c50.js → nylas-custom-booking-flow.entry-a1f66d05.js} +10 -10
- package/dist/{nylas-form-card.entry-4349d07d.cjs → nylas-form-card.entry-6fece0ff.cjs} +1 -1
- package/dist/{nylas-form-card.entry-b2da5266.js → nylas-form-card.entry-ea1153b9.js} +11 -11
- package/dist/{nylas-if-state.entry-62474acb.js → nylas-if-state.entry-05f8f66f.js} +3 -3
- package/dist/{nylas-if-state.entry-9eade180.cjs → nylas-if-state.entry-b75320f0.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-348a784b.js → nylas-list-folders.entry-bd5a1b1d.js} +7 -7
- package/dist/{nylas-list-folders.entry-b32ec92a.cjs → nylas-list-folders.entry-edc61b97.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-7e8044b2.cjs → nylas-list-threads.entry-79ad0944.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-ec1c5fb6.js → nylas-list-threads.entry-f3cd80de.js} +3 -3
- package/dist/{nylas-login.entry-0495d0b5.cjs → nylas-login.entry-68873357.cjs} +1 -1
- package/dist/{nylas-login.entry-f6f1e306.js → nylas-login.entry-b3207e82.js} +7 -7
- package/dist/{nylas-mailbox-pagination.entry-24c82c53.js → nylas-mailbox-pagination.entry-22c5b9ca.js} +2 -2
- package/dist/{nylas-mailbox-pagination.entry-22385ead.cjs → nylas-mailbox-pagination.entry-2ef5b88a.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-b13b2a58.js → nylas-mailbox-toolbar-button.entry-95bb58b5.js} +9 -9
- package/dist/{nylas-mailbox-toolbar-button.entry-e8e52474.cjs → nylas-mailbox-toolbar-button.entry-f2fa3a8e.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-77f4c37e.cjs → nylas-mailbox.entry-4b1d320f.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-0365fbb0.js → nylas-mailbox.entry-4ef7d18d.js} +6 -6
- package/dist/{nylas-provider.entry-11239372.js → nylas-provider.entry-7f7e098a.js} +6 -6
- package/dist/{nylas-provider.entry-d454a4d1.cjs → nylas-provider.entry-b629340a.cjs} +1 -1
- package/dist/{nylas-scheduler-editor.entry-16473950.cjs → nylas-scheduler-editor.entry-19a29c4c.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-c4d38853.js → nylas-scheduler-editor.entry-2d19593f.js} +13 -7
- package/dist/nylas-scheduling.entry-70454242.cjs +1 -0
- package/dist/{nylas-scheduling.entry-cc2535a9.js → nylas-scheduling.entry-753cb746.js} +61 -61
- package/dist/{nylas-threads-refresh.entry-725ef87d.cjs → nylas-threads-refresh.entry-0a832631.cjs} +1 -1
- package/dist/{nylas-threads-refresh.entry-5a6378fe.js → nylas-threads-refresh.entry-5a774ad7.js} +4 -4
- package/dist/{nylas-threads-search.entry-5e7b6a03.js → nylas-threads-search.entry-451c6d5c.js} +9 -9
- package/dist/nylas-threads-search.entry-5b57688b.cjs +1 -0
- package/dist/{nylas-view-thread.entry-98f8e35b.cjs → nylas-view-thread.entry-7b273955.cjs} +1 -1
- package/dist/{nylas-view-thread.entry-249f0b65.js → nylas-view-thread.entry-e0af8998.js} +3 -3
- package/dist/{people-icon.entry-0ab4b752.cjs → people-icon.entry-c7fb7f6c.cjs} +1 -1
- package/dist/{people-icon.entry-0ed95db0.js → people-icon.entry-de3fada0.js} +6 -6
- package/dist/{play-icon_2.entry-433a8722.js → play-icon_2.entry-58592b64.js} +5 -5
- package/dist/play-icon_2.entry-5b22a7ca.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +98 -89
- package/dist/{refresh-icon.entry-508a246d.cjs → refresh-icon.entry-876b8aea.cjs} +1 -1
- package/dist/{refresh-icon.entry-b5bee0f4.js → refresh-icon.entry-90756bc6.js} +4 -4
- package/dist/{register-component-e4dc8778-7812a275.cjs → register-component-a5a9ca5d-1fbb27d2.cjs} +1 -1
- package/dist/{register-component-e4dc8778-53fe0729.js → register-component-a5a9ca5d-8bede801.js} +1 -1
- package/dist/{scheduler-config-store-ec3b6190-435c84ca.cjs → scheduler-config-store-ec3b6190-104df545.cjs} +1 -1
- package/dist/{scheduler-config-store-ec3b6190-01892765.js → scheduler-config-store-ec3b6190-cbc40d60.js} +1 -1
- package/dist/scheduler-store-f02ce045-1d93c571.js +390 -0
- package/dist/scheduler-store-f02ce045-712c600c.cjs +1 -0
- package/dist/textarea-component.entry-3ea161d6.js +35 -0
- package/dist/textarea-component.entry-9d6b5cdc.cjs +1 -0
- package/dist/toggle-switch.entry-10aa0c1a.cjs +1 -0
- package/dist/toggle-switch.entry-a08c1027.js +25 -0
- package/dist/{translate-icon.entry-f77cfd3d.cjs → translate-icon.entry-04dde6b1.cjs} +1 -1
- package/dist/{translate-icon.entry-c34bad94.js → translate-icon.entry-be9c3401.js} +6 -6
- package/dist/{warning-icon.entry-f781a623.js → warning-icon.entry-347d77af.js} +5 -5
- package/dist/{warning-icon.entry-f73b31bf.cjs → warning-icon.entry-84121a43.cjs} +1 -1
- package/package.json +3 -3
- package/dist/add-circle-icon_22.entry-c165f0de.cjs +0 -1
- package/dist/chevron-icon_3.entry-55eb864f.js +0 -117
- package/dist/chevron-icon_3.entry-a18c373d.cjs +0 -1
- package/dist/close-icon.entry-7c67181c.js +0 -15
- package/dist/close-icon.entry-918dd254.cjs +0 -1
- package/dist/google-logo-icon_4.entry-748af8c3.cjs +0 -1
- package/dist/google-logo-icon_4.entry-b4464873.js +0 -393
- package/dist/index-53420959-31867ccf.js +0 -5
- package/dist/index-53420959-535906ce.cjs +0 -1
- package/dist/index-6a4ee4f8.cjs +0 -42
- package/dist/nylas-booked-event-card_10.entry-912e4a89.cjs +0 -1
- package/dist/nylas-scheduling.entry-5b156a28.cjs +0 -1
- package/dist/nylas-threads-search.entry-a2553cbe.cjs +0 -1
- package/dist/play-icon_2.entry-f9c0b647.cjs +0 -1
- package/dist/scheduler-store-04e15f8a-5d06eaf3.cjs +0 -1
- package/dist/scheduler-store-04e15f8a-69eb8d7a.js +0 -376
- package/dist/time-period-selector.entry-77a6debf.cjs +0 -1
- package/dist/time-period-selector.entry-a29c8ffa.js +0 -76
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import { d as p, e as z, l as L } from "./index-2d032bec.js";
|
|
2
|
+
var y;
|
|
3
|
+
(function(o) {
|
|
4
|
+
o.Component = "component", o.Api = "api", o.Auth = "auth";
|
|
5
|
+
})(y || (y = {}));
|
|
6
|
+
var k;
|
|
7
|
+
(function(o) {
|
|
8
|
+
o.endtime_not_in_future = "endtime_not_in_future", o.no_booking_info = "no_booking_info", o.no_timeslot_selected = "no_timeslot_selected", o.no_timezone_selected = "no_timezone_selected", o.no_booking_id = "no_booking_id", o.invalid_start_time = "invalid_start_time", o.invalid_end_time = "invalid_end_time", o.invalid_timezone = "invalid_timezone";
|
|
9
|
+
})(k || (k = {}));
|
|
10
|
+
var D;
|
|
11
|
+
(function(o) {
|
|
12
|
+
o.invalid_session = "invalid_session", o.general_error = "general_error", o.internal_error = "internal_error", o.invalid_request_error = "invalid_request_error", o.timeslot_not_available = "timeslot_not_available", o.provider_error = "provider_error", o.not_found_error = "not_found_error";
|
|
13
|
+
})(D || (D = {}));
|
|
14
|
+
class B {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.component = (e) => {
|
|
17
|
+
const t = y.Component, s = `${e} Error`;
|
|
18
|
+
return {
|
|
19
|
+
endtime_not_in_future: (i = '"endtime" can not be in the future') => ({
|
|
20
|
+
title: s,
|
|
21
|
+
message: i,
|
|
22
|
+
category: t
|
|
23
|
+
}),
|
|
24
|
+
no_booking_info: (i = "No booking info provided") => ({
|
|
25
|
+
title: s,
|
|
26
|
+
message: i,
|
|
27
|
+
category: t
|
|
28
|
+
}),
|
|
29
|
+
no_timeslot_selected: (i = "No timeslot selected") => ({
|
|
30
|
+
title: s,
|
|
31
|
+
message: i,
|
|
32
|
+
category: t
|
|
33
|
+
}),
|
|
34
|
+
no_timezone_selected: (i = "No timezone selected") => ({
|
|
35
|
+
title: s,
|
|
36
|
+
message: i,
|
|
37
|
+
category: t
|
|
38
|
+
}),
|
|
39
|
+
no_booking_id: (i = "No booking id provided") => ({
|
|
40
|
+
title: s,
|
|
41
|
+
message: i,
|
|
42
|
+
category: t
|
|
43
|
+
}),
|
|
44
|
+
invalid_start_time: (i = "Invalid start time") => ({
|
|
45
|
+
title: s,
|
|
46
|
+
message: i,
|
|
47
|
+
category: t
|
|
48
|
+
}),
|
|
49
|
+
invalid_end_time: (i = "Invalid end time") => ({
|
|
50
|
+
title: s,
|
|
51
|
+
message: i,
|
|
52
|
+
category: t
|
|
53
|
+
}),
|
|
54
|
+
invalid_timezone: (i = "Invalid timezone") => ({
|
|
55
|
+
title: s,
|
|
56
|
+
message: i,
|
|
57
|
+
category: t
|
|
58
|
+
})
|
|
59
|
+
};
|
|
60
|
+
}, this.api = (e) => {
|
|
61
|
+
const t = y.Api, s = `${e} Error`;
|
|
62
|
+
return {
|
|
63
|
+
invalid_session: (i) => ({
|
|
64
|
+
title: s,
|
|
65
|
+
message: i,
|
|
66
|
+
category: t
|
|
67
|
+
}),
|
|
68
|
+
general_error: (i) => ({
|
|
69
|
+
title: s,
|
|
70
|
+
message: i,
|
|
71
|
+
category: t
|
|
72
|
+
}),
|
|
73
|
+
internal_error: (i) => ({
|
|
74
|
+
title: s,
|
|
75
|
+
message: i,
|
|
76
|
+
category: t
|
|
77
|
+
}),
|
|
78
|
+
invalid_request_error: (i) => ({
|
|
79
|
+
title: s,
|
|
80
|
+
message: i,
|
|
81
|
+
category: t
|
|
82
|
+
}),
|
|
83
|
+
timeslot_not_available: (i) => ({
|
|
84
|
+
title: s,
|
|
85
|
+
message: i,
|
|
86
|
+
category: t
|
|
87
|
+
}),
|
|
88
|
+
provider_error: (i) => ({
|
|
89
|
+
title: s,
|
|
90
|
+
message: i,
|
|
91
|
+
category: t
|
|
92
|
+
}),
|
|
93
|
+
not_found_error: (i) => ({
|
|
94
|
+
title: s,
|
|
95
|
+
message: i,
|
|
96
|
+
category: t
|
|
97
|
+
})
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
class R {
|
|
103
|
+
constructor({ schedulerAPIURL: e, schedulerStore: t, sessionId: s, configId: i }) {
|
|
104
|
+
this.errors = new B(), this.schedulerStore = t, this.schedulerAPIURL = e, this.sessionId = s, this.configId = i;
|
|
105
|
+
}
|
|
106
|
+
getHeaders() {
|
|
107
|
+
return this.sessionId ? {
|
|
108
|
+
Authorization: `Bearer ${this.sessionId}`
|
|
109
|
+
} : {};
|
|
110
|
+
}
|
|
111
|
+
async makeAPIRequest(e, t, s, i = {}) {
|
|
112
|
+
try {
|
|
113
|
+
const n = new URL(this.schedulerAPIURL);
|
|
114
|
+
return n.pathname = e, await (await fetch(decodeURIComponent(n.toString()), {
|
|
115
|
+
method: t,
|
|
116
|
+
headers: {
|
|
117
|
+
"Content-Type": "application/json",
|
|
118
|
+
Origin: window.location.origin,
|
|
119
|
+
...i
|
|
120
|
+
},
|
|
121
|
+
body: s
|
|
122
|
+
})).json();
|
|
123
|
+
} catch (n) {
|
|
124
|
+
return {
|
|
125
|
+
error: {
|
|
126
|
+
message: n.message,
|
|
127
|
+
title: "API request failed",
|
|
128
|
+
type: "api"
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
getErrorMessage(e) {
|
|
134
|
+
var s, i, n, r;
|
|
135
|
+
let t = (e == null ? void 0 : e.message) || (e == null ? void 0 : e.title) || "Something went wrong";
|
|
136
|
+
return (e == null ? void 0 : e.type) === "provider_error" && (t = ((i = (s = e == null ? void 0 : e.provider_error) == null ? void 0 : s.error) == null ? void 0 : i.message) || ((r = (n = e == null ? void 0 : e.provider_error) == null ? void 0 : n.error) == null ? void 0 : r.title) || "Something went wrong"), t;
|
|
137
|
+
}
|
|
138
|
+
setConfigId(e) {
|
|
139
|
+
this.configId = e;
|
|
140
|
+
}
|
|
141
|
+
selectDate(e) {
|
|
142
|
+
this.schedulerStore.set("selectedDate", e), this.schedulerStore.set("selectedTimeslot", null);
|
|
143
|
+
}
|
|
144
|
+
selectTime(e) {
|
|
145
|
+
this.schedulerStore.set("selectedTimeslot", e);
|
|
146
|
+
}
|
|
147
|
+
selectTimezone(e) {
|
|
148
|
+
this.schedulerStore.set("selectedTimezone", e);
|
|
149
|
+
}
|
|
150
|
+
async toggleAdditionalData(e) {
|
|
151
|
+
e || await this.refetchAvailability(), this.schedulerStore.set("showBookingForm", e);
|
|
152
|
+
}
|
|
153
|
+
setParticipantName(e) {
|
|
154
|
+
const { bookingInfo: t } = this.schedulerStore.state;
|
|
155
|
+
this.schedulerStore.set("bookingInfo", {
|
|
156
|
+
...t,
|
|
157
|
+
primaryParticipant: {
|
|
158
|
+
...t == null ? void 0 : t.primaryParticipant,
|
|
159
|
+
name: e
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
setParticipantEmail(e) {
|
|
164
|
+
const { bookingInfo: t } = this.schedulerStore.state;
|
|
165
|
+
this.schedulerStore.set("bookingInfo", {
|
|
166
|
+
...t,
|
|
167
|
+
primaryParticipant: {
|
|
168
|
+
...t == null ? void 0 : t.primaryParticipant,
|
|
169
|
+
email: e
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
async refetchAvailability() {
|
|
174
|
+
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;
|
|
175
|
+
return await this.getAvailability(s, i);
|
|
176
|
+
}
|
|
177
|
+
async resetStoreStateAndFetchAvailability() {
|
|
178
|
+
const e = /* @__PURE__ */ new Date(), t = await this.refetchAvailability(), s = this.schedulerStore.get("availability").find((n) => new Date(n.start_time) > /* @__PURE__ */ new Date());
|
|
179
|
+
let i = e;
|
|
180
|
+
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;
|
|
181
|
+
}
|
|
182
|
+
async setReschedule(e) {
|
|
183
|
+
const t = this.schedulerStore.state.eventInfo;
|
|
184
|
+
t && this.schedulerStore.set("reschedulingEventInfo", t);
|
|
185
|
+
const s = await this.resetStoreStateAndFetchAvailability();
|
|
186
|
+
return this.schedulerStore.set("rescheduleBookingId", e), s;
|
|
187
|
+
}
|
|
188
|
+
async setCancel(e) {
|
|
189
|
+
this.schedulerStore.set("cancelBookingId", e);
|
|
190
|
+
}
|
|
191
|
+
async resetCancel() {
|
|
192
|
+
const e = await this.resetStoreStateAndFetchAvailability();
|
|
193
|
+
return this.schedulerStore.set("cancelBookingId", ""), this.schedulerStore.set("cancelledEventInfo", null), e;
|
|
194
|
+
}
|
|
195
|
+
async bookTimeslot(e) {
|
|
196
|
+
var h;
|
|
197
|
+
this.schedulerStore.set("isLoading", !0);
|
|
198
|
+
const { selectedTimeslot: t, selectedTimezone: s, bookingInfo: i } = this.schedulerStore.state;
|
|
199
|
+
if (!e && !i)
|
|
200
|
+
return { error: this.errors.component("Booking").no_booking_info() };
|
|
201
|
+
const n = (e == null ? void 0 : e.timeslot) || t;
|
|
202
|
+
if (!n)
|
|
203
|
+
return { error: this.errors.component("Create Booking").no_timeslot_selected() };
|
|
204
|
+
const r = e && (e != null && e.timezone) ? e == null ? void 0 : e.timezone : s;
|
|
205
|
+
if (!r)
|
|
206
|
+
return { error: this.errors.component("Create Booking").no_timezone_selected() };
|
|
207
|
+
const a = e ? e == null ? void 0 : e.primaryParticipant : i == null ? void 0 : i.primaryParticipant, u = e ? (e == null ? void 0 : e.guests) || [] : (i == null ? void 0 : i.guests) || [], c = e ? e == null ? void 0 : e.additionalFields : i == null ? void 0 : i.additionalFields, g = this.getHeaders(), _ = `/v3/scheduling/bookings${!this.sessionId && this.configId ? `?configuration_id=${this.configId}` : ""}`, l = await this.makeAPIRequest(decodeURIComponent(_), "POST", JSON.stringify({
|
|
208
|
+
additional_fields: c,
|
|
209
|
+
additional_guests: u,
|
|
210
|
+
guest: { ...a },
|
|
211
|
+
start_time: n.start_time.getTime() / 1e3,
|
|
212
|
+
end_time: n.end_time.getTime() / 1e3,
|
|
213
|
+
timezone: r
|
|
214
|
+
}), g);
|
|
215
|
+
if ("error" in l) {
|
|
216
|
+
this.schedulerStore.set("isLoading", !1);
|
|
217
|
+
const d = (h = l.error) == null ? void 0 : h.type;
|
|
218
|
+
let S = l.error;
|
|
219
|
+
if (d && d in this.errors.api("Create Booking")) {
|
|
220
|
+
const I = this.getErrorMessage(S);
|
|
221
|
+
S = this.errors.api("Create Booking")[d](I);
|
|
222
|
+
}
|
|
223
|
+
return { error: S };
|
|
224
|
+
}
|
|
225
|
+
return "data" in l && this.schedulerStore.set("eventInfo", l == null ? void 0 : l.data), this.schedulerStore.set("isLoading", !1), l;
|
|
226
|
+
}
|
|
227
|
+
async getUISettings() {
|
|
228
|
+
var n;
|
|
229
|
+
this.schedulerStore.set("isLoading", !0);
|
|
230
|
+
const e = this.getHeaders(), s = `/v3/scheduling/ui-settings${!this.sessionId && this.configId ? `?configuration_id=${this.configId}` : ""}`, i = await this.makeAPIRequest(s, "GET", void 0, e);
|
|
231
|
+
if ("error" in i) {
|
|
232
|
+
this.schedulerStore.set("isLoading", !1);
|
|
233
|
+
const r = (n = i.error) == null ? void 0 : n.type;
|
|
234
|
+
let a = i.error;
|
|
235
|
+
return r && r in this.errors.api("Get UI Settings") && (a = this.errors.api("Get UI Settings")[r]((a == null ? void 0 : a.message) || (a == null ? void 0 : a.title) || "Something went wrong")), { error: a };
|
|
236
|
+
}
|
|
237
|
+
return "data" in i && this.schedulerStore.set("configSettings", i.data), this.schedulerStore.set("isLoading", !1), i;
|
|
238
|
+
}
|
|
239
|
+
getStartTimeWithMinBookingNotice(e) {
|
|
240
|
+
var i;
|
|
241
|
+
const t = (i = this.schedulerStore.get("configSettings")) == null ? void 0 : i.scheduler, s = t == null ? void 0 : t.min_booking_notice;
|
|
242
|
+
return s ? e + s * 60 : e;
|
|
243
|
+
}
|
|
244
|
+
getEndTimeForAvailableDaysInFuture(e) {
|
|
245
|
+
var r, a;
|
|
246
|
+
const t = /* @__PURE__ */ new Date(), s = (a = (r = this.schedulerStore.get("configSettings")) == null ? void 0 : r.scheduler) == null ? void 0 : a.available_days_in_future, i = Math.floor(L(t, s).getTime() / 1e3);
|
|
247
|
+
return Math.min(i, e);
|
|
248
|
+
}
|
|
249
|
+
async getAvailability(e = 0, t = 0) {
|
|
250
|
+
var g, f, _;
|
|
251
|
+
this.schedulerStore.set("isLoading", !0);
|
|
252
|
+
const s = new URLSearchParams(), i = /* @__PURE__ */ new Date(), n = i.getTime();
|
|
253
|
+
if (t && t < n / 1e3)
|
|
254
|
+
return this.schedulerStore.set("isLoading", !1), { error: this.errors.component("Get Availability").endtime_not_in_future() };
|
|
255
|
+
if (!e) {
|
|
256
|
+
const l = new Date(i.getFullYear(), i.getMonth(), 1);
|
|
257
|
+
e = Math.floor(l.getTime() / 1e3);
|
|
258
|
+
}
|
|
259
|
+
if (e = this.getStartTimeWithMinBookingNotice(e), !t) {
|
|
260
|
+
const l = new Date(i.getFullYear(), i.getMonth() + 1, 0);
|
|
261
|
+
t = Math.floor(l.getTime() / 1e3);
|
|
262
|
+
}
|
|
263
|
+
t = this.getEndTimeForAvailableDaysInFuture(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));
|
|
264
|
+
const r = s.toString(), a = `/v3/scheduling/availability${r ? `?${r}` : ""}`, u = this.getHeaders(), c = await this.makeAPIRequest(decodeURIComponent(a), "GET", void 0, u);
|
|
265
|
+
if ("error" in c) {
|
|
266
|
+
this.schedulerStore.set("availability", []), this.schedulerStore.set("isLoading", !1);
|
|
267
|
+
const l = (g = c.error) == null ? void 0 : g.type;
|
|
268
|
+
let h = c.error;
|
|
269
|
+
if (l && l in this.errors.api("Get Availability")) {
|
|
270
|
+
const d = this.getErrorMessage(h);
|
|
271
|
+
h = this.errors.api("Get Availability")[l](d);
|
|
272
|
+
}
|
|
273
|
+
return { error: h };
|
|
274
|
+
}
|
|
275
|
+
if ("data" in c) {
|
|
276
|
+
const h = (((_ = (f = c.data) == null ? void 0 : f.time_slots) == null ? void 0 : _.map((d) => ({
|
|
277
|
+
...d,
|
|
278
|
+
start_time: new Date(d.start_time * 1e3),
|
|
279
|
+
end_time: new Date(d.end_time * 1e3)
|
|
280
|
+
}))) || []).filter((d) => d.start_time.getTime() > n);
|
|
281
|
+
this.schedulerStore.set("availability", h);
|
|
282
|
+
}
|
|
283
|
+
return this.schedulerStore.set("isLoading", !1), c;
|
|
284
|
+
}
|
|
285
|
+
async cancelBooking(e, t) {
|
|
286
|
+
var a;
|
|
287
|
+
if (this.schedulerStore.set("isLoading", !0), !e)
|
|
288
|
+
return { error: this.errors.component("Cancel Booking").no_booking_id() };
|
|
289
|
+
const s = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : "", i = `/v3/scheduling/bookings/${e}${s}`, n = this.getHeaders(), r = await this.makeAPIRequest(decodeURIComponent(i), "DELETE", JSON.stringify({
|
|
290
|
+
action: "cancel",
|
|
291
|
+
cancellation_reason: t
|
|
292
|
+
}), n);
|
|
293
|
+
if ("error" in r) {
|
|
294
|
+
this.schedulerStore.set("isLoading", !1);
|
|
295
|
+
const u = (a = r.error) == null ? void 0 : a.type;
|
|
296
|
+
let c = r.error;
|
|
297
|
+
if (u && u in this.errors.api("Cancel Booking")) {
|
|
298
|
+
const g = this.getErrorMessage(c);
|
|
299
|
+
c = this.errors.api("Cancel Booking")[u](g);
|
|
300
|
+
}
|
|
301
|
+
return { error: c };
|
|
302
|
+
}
|
|
303
|
+
return this.schedulerStore.set("cancelledEventInfo", {
|
|
304
|
+
booking_id: e
|
|
305
|
+
}), this.schedulerStore.set("isLoading", !1), r;
|
|
306
|
+
}
|
|
307
|
+
async rescheduleBooking(e, t) {
|
|
308
|
+
var T;
|
|
309
|
+
if (this.schedulerStore.set("isLoading", !0), !e)
|
|
310
|
+
return { error: this.errors.component("Reschedule Booking").no_booking_id() };
|
|
311
|
+
const s = this.errors.api("Reschedule Booking"), i = this.errors.component("Reschedule Booking"), { bookingInfo: n, selectedTimeslot: r, selectedTimezone: a } = this.schedulerStore.state, { startTime: u, endTime: c, timezone: g } = t, f = u || (r == null ? void 0 : r.start_time);
|
|
312
|
+
if (!f)
|
|
313
|
+
return { error: i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
|
|
314
|
+
const _ = c || (r == null ? void 0 : r.end_time);
|
|
315
|
+
if (!_)
|
|
316
|
+
return { error: i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
|
|
317
|
+
const l = g || a;
|
|
318
|
+
if (!l)
|
|
319
|
+
return { error: i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.') };
|
|
320
|
+
const h = t ? t == null ? void 0 : t.primaryParticipant : n == null ? void 0 : n.primaryParticipant, d = t ? (t == null ? void 0 : t.guests) || [] : (n == null ? void 0 : n.guests) || [], S = t ? { ...t == null ? void 0 : t.additionalFields, guests: d } : { ...n == null ? void 0 : n.additionalFields, guests: d }, I = !this.sessionId && this.configId ? `?configuration_id=${this.configId}` : "", A = `/v3/scheduling/bookings/${e}${I}`, P = this.getHeaders(), m = await this.makeAPIRequest(decodeURIComponent(A), "PATCH", JSON.stringify({
|
|
321
|
+
start_time: f.getTime() / 1e3,
|
|
322
|
+
end_time: _.getTime() / 1e3,
|
|
323
|
+
time_zone: l,
|
|
324
|
+
additional_fields: S,
|
|
325
|
+
guest: { ...h }
|
|
326
|
+
}), P);
|
|
327
|
+
if ("error" in m) {
|
|
328
|
+
this.schedulerStore.set("isLoading", !1);
|
|
329
|
+
const v = (T = m.error) == null ? void 0 : T.type;
|
|
330
|
+
let w = m.error;
|
|
331
|
+
if (v && v in s) {
|
|
332
|
+
const M = this.getErrorMessage(w);
|
|
333
|
+
w = s[v](M);
|
|
334
|
+
}
|
|
335
|
+
return { error: w };
|
|
336
|
+
}
|
|
337
|
+
const b = this.schedulerStore.get("reschedulingEventInfo");
|
|
338
|
+
if ("data" in m)
|
|
339
|
+
this.schedulerStore.set("eventInfo", m == null ? void 0 : m.data);
|
|
340
|
+
else if (b)
|
|
341
|
+
this.schedulerStore.set("eventInfo", b);
|
|
342
|
+
else {
|
|
343
|
+
const v = {
|
|
344
|
+
booking_id: e
|
|
345
|
+
};
|
|
346
|
+
this.schedulerStore.set("eventInfo", v);
|
|
347
|
+
}
|
|
348
|
+
return this.schedulerStore.set("isLoading", !1), m;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
function C(o = {}) {
|
|
352
|
+
const e = {
|
|
353
|
+
selectedDate: null,
|
|
354
|
+
selectedLanguage: navigator.language,
|
|
355
|
+
selectedTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
356
|
+
selectedTimeslot: null,
|
|
357
|
+
showBookingForm: !1,
|
|
358
|
+
selectableDates: null,
|
|
359
|
+
availability: [],
|
|
360
|
+
eventDuration: 0,
|
|
361
|
+
state: "ready",
|
|
362
|
+
eventInfo: null,
|
|
363
|
+
cancelledEventInfo: null,
|
|
364
|
+
isLoading: !1,
|
|
365
|
+
nylasBranding: !0,
|
|
366
|
+
...o
|
|
367
|
+
};
|
|
368
|
+
p("[defaultNylasStoreState]: ", e);
|
|
369
|
+
const t = z(e);
|
|
370
|
+
return t.onChange("availability", (s) => {
|
|
371
|
+
p("[availability]: ", s);
|
|
372
|
+
const i = s.map((a) => a.start_time);
|
|
373
|
+
p("[selectableDates]: ", i), t.set("selectableDates", i);
|
|
374
|
+
const n = s[0];
|
|
375
|
+
if (!n)
|
|
376
|
+
return;
|
|
377
|
+
const r = Math.floor((n.end_time.getTime() - n.start_time.getTime()) / 6e4);
|
|
378
|
+
p("[durationMinutes]: ", r), t.set("eventDuration", r);
|
|
379
|
+
}), t.reset = () => {
|
|
380
|
+
for (const s in e) {
|
|
381
|
+
const i = e[s];
|
|
382
|
+
t.set(s, i);
|
|
383
|
+
}
|
|
384
|
+
}, t;
|
|
385
|
+
}
|
|
386
|
+
export {
|
|
387
|
+
C,
|
|
388
|
+
y as E,
|
|
389
|
+
R as N
|
|
390
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const S=require("./index-9c04361d.cjs");exports.ErrorCategory=void 0;(function(o){o.Component="component",o.Api="api",o.Auth="auth"})(exports.ErrorCategory||(exports.ErrorCategory={}));var T;(function(o){o.endtime_not_in_future="endtime_not_in_future",o.no_booking_info="no_booking_info",o.no_timeslot_selected="no_timeslot_selected",o.no_timezone_selected="no_timezone_selected",o.no_booking_id="no_booking_id",o.invalid_start_time="invalid_start_time",o.invalid_end_time="invalid_end_time",o.invalid_timezone="invalid_timezone"})(T||(T={}));var k;(function(o){o.invalid_session="invalid_session",o.general_error="general_error",o.internal_error="internal_error",o.invalid_request_error="invalid_request_error",o.timeslot_not_available="timeslot_not_available",o.provider_error="provider_error",o.not_found_error="not_found_error"})(k||(k={}));class M{constructor(){this.component=e=>{const t=exports.ErrorCategory.Component,s=`${e} Error`;return{endtime_not_in_future:(i='"endtime" can not be in the future')=>({title:s,message:i,category:t}),no_booking_info:(i="No booking info provided")=>({title:s,message:i,category:t}),no_timeslot_selected:(i="No timeslot selected")=>({title:s,message:i,category:t}),no_timezone_selected:(i="No timezone selected")=>({title:s,message:i,category:t}),no_booking_id:(i="No booking id provided")=>({title:s,message:i,category:t}),invalid_start_time:(i="Invalid start time")=>({title:s,message:i,category:t}),invalid_end_time:(i="Invalid end time")=>({title:s,message:i,category:t}),invalid_timezone:(i="Invalid timezone")=>({title:s,message:i,category:t})}},this.api=e=>{const t=exports.ErrorCategory.Api,s=`${e} Error`;return{invalid_session:i=>({title:s,message:i,category:t}),general_error:i=>({title:s,message:i,category:t}),internal_error:i=>({title:s,message:i,category:t}),invalid_request_error:i=>({title:s,message:i,category:t}),timeslot_not_available:i=>({title:s,message:i,category:t}),provider_error:i=>({title:s,message:i,category:t}),not_found_error:i=>({title:s,message:i,category:t})}}}}class C{constructor({schedulerAPIURL:e,schedulerStore:t,sessionId:s,configId:i}){this.errors=new M,this.schedulerStore=t,this.schedulerAPIURL=e,this.sessionId=s,this.configId=i}getHeaders(){return this.sessionId?{Authorization:`Bearer ${this.sessionId}`}:{}}async makeAPIRequest(e,t,s,i={}){try{const r=new URL(this.schedulerAPIURL);return r.pathname=e,await(await fetch(decodeURIComponent(r.toString()),{method:t,headers:{"Content-Type":"application/json",Origin:window.location.origin,...i},body:s})).json()}catch(r){return{error:{message:r.message,title:"API request failed",type:"api"}}}}getErrorMessage(e){var s,i,r,n;let t=(e==null?void 0:e.message)||(e==null?void 0:e.title)||"Something went wrong";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)||((n=(r=e==null?void 0:e.provider_error)==null?void 0:r.error)==null?void 0:n.title)||"Something went wrong"),t}setConfigId(e){this.configId=e}selectDate(e){this.schedulerStore.set("selectedDate",e),this.schedulerStore.set("selectedTimeslot",null)}selectTime(e){this.schedulerStore.set("selectedTimeslot",e)}selectTimezone(e){this.schedulerStore.set("selectedTimezone",e)}async toggleAdditionalData(e){e||await this.refetchAvailability(),this.schedulerStore.set("showBookingForm",e)}setParticipantName(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t==null?void 0:t.primaryParticipant,name:e}})}setParticipantEmail(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t==null?void 0:t.primaryParticipant,email:e}})}async refetchAvailability(){const e=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;return await this.getAvailability(s,i)}async resetStoreStateAndFetchAvailability(){const e=new Date,t=await this.refetchAvailability(),s=this.schedulerStore.get("availability").find(r=>new Date(r.start_time)>new Date);let i=e;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}async setReschedule(e){const t=this.schedulerStore.state.eventInfo;t&&this.schedulerStore.set("reschedulingEventInfo",t);const s=await this.resetStoreStateAndFetchAvailability();return this.schedulerStore.set("rescheduleBookingId",e),s}async setCancel(e){this.schedulerStore.set("cancelBookingId",e)}async resetCancel(){const e=await this.resetStoreStateAndFetchAvailability();return this.schedulerStore.set("cancelBookingId",""),this.schedulerStore.set("cancelledEventInfo",null),e}async bookTimeslot(e){var h;this.schedulerStore.set("isLoading",!0);const{selectedTimeslot:t,selectedTimezone:s,bookingInfo:i}=this.schedulerStore.state;if(!e&&!i)return{error:this.errors.component("Booking").no_booking_info()};const r=(e==null?void 0:e.timeslot)||t;if(!r)return{error:this.errors.component("Create Booking").no_timeslot_selected()};const n=e&&(e!=null&&e.timezone)?e==null?void 0:e.timezone:s;if(!n)return{error:this.errors.component("Create Booking").no_timezone_selected()};const a=e?e==null?void 0:e.primaryParticipant:i==null?void 0:i.primaryParticipant,u=e?(e==null?void 0:e.guests)||[]:(i==null?void 0:i.guests)||[],c=e?e==null?void 0:e.additionalFields:i==null?void 0:i.additionalFields,g=this.getHeaders(),_=`/v3/scheduling/bookings${!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:""}`,l=await this.makeAPIRequest(decodeURIComponent(_),"POST",JSON.stringify({additional_fields:c,additional_guests:u,guest:{...a},start_time:r.start_time.getTime()/1e3,end_time:r.end_time.getTime()/1e3,timezone:n}),g);if("error"in l){this.schedulerStore.set("isLoading",!1);const d=(h=l.error)==null?void 0:h.type;let v=l.error;if(d&&d in this.errors.api("Create Booking")){const y=this.getErrorMessage(v);v=this.errors.api("Create Booking")[d](y)}return{error:v}}return"data"in l&&this.schedulerStore.set("eventInfo",l==null?void 0:l.data),this.schedulerStore.set("isLoading",!1),l}async getUISettings(){var r;this.schedulerStore.set("isLoading",!0);const e=this.getHeaders(),s=`/v3/scheduling/ui-settings${!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:""}`,i=await this.makeAPIRequest(s,"GET",void 0,e);if("error"in i){this.schedulerStore.set("isLoading",!1);const n=(r=i.error)==null?void 0:r.type;let a=i.error;return n&&n in this.errors.api("Get UI Settings")&&(a=this.errors.api("Get UI Settings")[n]((a==null?void 0:a.message)||(a==null?void 0:a.title)||"Something went wrong")),{error:a}}return"data"in i&&this.schedulerStore.set("configSettings",i.data),this.schedulerStore.set("isLoading",!1),i}getStartTimeWithMinBookingNotice(e){var i;const t=(i=this.schedulerStore.get("configSettings"))==null?void 0:i.scheduler,s=t==null?void 0:t.min_booking_notice;return s?e+s*60:e}getEndTimeForAvailableDaysInFuture(e){var n,a;const t=new Date,s=(a=(n=this.schedulerStore.get("configSettings"))==null?void 0:n.scheduler)==null?void 0:a.available_days_in_future,i=Math.floor(S.addDaysToCurrentDate(t,s).getTime()/1e3);return Math.min(i,e)}async getAvailability(e=0,t=0){var g,f,_;this.schedulerStore.set("isLoading",!0);const s=new URLSearchParams,i=new Date,r=i.getTime();if(t&&t<r/1e3)return this.schedulerStore.set("isLoading",!1),{error:this.errors.component("Get Availability").endtime_not_in_future()};if(!e){const l=new Date(i.getFullYear(),i.getMonth(),1);e=Math.floor(l.getTime()/1e3)}if(e=this.getStartTimeWithMinBookingNotice(e),!t){const l=new Date(i.getFullYear(),i.getMonth()+1,0);t=Math.floor(l.getTime()/1e3)}t=this.getEndTimeForAvailableDaysInFuture(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));const n=s.toString(),a=`/v3/scheduling/availability${n?`?${n}`:""}`,u=this.getHeaders(),c=await this.makeAPIRequest(decodeURIComponent(a),"GET",void 0,u);if("error"in c){this.schedulerStore.set("availability",[]),this.schedulerStore.set("isLoading",!1);const l=(g=c.error)==null?void 0:g.type;let h=c.error;if(l&&l in this.errors.api("Get Availability")){const d=this.getErrorMessage(h);h=this.errors.api("Get Availability")[l](d)}return{error:h}}if("data"in c){const h=(((_=(f=c.data)==null?void 0:f.time_slots)==null?void 0:_.map(d=>({...d,start_time:new Date(d.start_time*1e3),end_time:new Date(d.end_time*1e3)})))||[]).filter(d=>d.start_time.getTime()>r);this.schedulerStore.set("availability",h)}return this.schedulerStore.set("isLoading",!1),c}async cancelBooking(e,t){var a;if(this.schedulerStore.set("isLoading",!0),!e)return{error:this.errors.component("Cancel Booking").no_booking_id()};const s=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:"",i=`/v3/scheduling/bookings/${e}${s}`,r=this.getHeaders(),n=await this.makeAPIRequest(decodeURIComponent(i),"DELETE",JSON.stringify({action:"cancel",cancellation_reason:t}),r);if("error"in n){this.schedulerStore.set("isLoading",!1);const u=(a=n.error)==null?void 0:a.type;let c=n.error;if(u&&u in this.errors.api("Cancel Booking")){const g=this.getErrorMessage(c);c=this.errors.api("Cancel Booking")[u](g)}return{error:c}}return this.schedulerStore.set("cancelledEventInfo",{booking_id:e}),this.schedulerStore.set("isLoading",!1),n}async rescheduleBooking(e,t){var w;if(this.schedulerStore.set("isLoading",!0),!e)return{error:this.errors.component("Reschedule Booking").no_booking_id()};const s=this.errors.api("Reschedule Booking"),i=this.errors.component("Reschedule Booking"),{bookingInfo:r,selectedTimeslot:n,selectedTimezone:a}=this.schedulerStore.state,{startTime:u,endTime:c,timezone:g}=t,f=u||(n==null?void 0:n.start_time);if(!f)return{error:i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const _=c||(n==null?void 0:n.end_time);if(!_)return{error:i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const l=g||a;if(!l)return{error:i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')};const h=t?t==null?void 0:t.primaryParticipant:r==null?void 0:r.primaryParticipant,d=t?(t==null?void 0:t.guests)||[]:(r==null?void 0:r.guests)||[],v=t?{...t==null?void 0:t.additionalFields,guests:d}:{...r==null?void 0:r.additionalFields,guests:d},y=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:"",D=`/v3/scheduling/bookings/${e}${y}`,A=this.getHeaders(),m=await this.makeAPIRequest(decodeURIComponent(D),"PATCH",JSON.stringify({start_time:f.getTime()/1e3,end_time:_.getTime()/1e3,time_zone:l,additional_fields:v,guest:{...h}}),A);if("error"in m){this.schedulerStore.set("isLoading",!1);const p=(w=m.error)==null?void 0:w.type;let I=m.error;if(p&&p in s){const P=this.getErrorMessage(I);I=s[p](P)}return{error:I}}const b=this.schedulerStore.get("reschedulingEventInfo");if("data"in m)this.schedulerStore.set("eventInfo",m==null?void 0:m.data);else if(b)this.schedulerStore.set("eventInfo",b);else{const p={booking_id:e};this.schedulerStore.set("eventInfo",p)}return this.schedulerStore.set("isLoading",!1),m}}function z(o={}){const e={selectedDate:null,selectedLanguage:navigator.language,selectedTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,selectedTimeslot:null,showBookingForm:!1,selectableDates:null,availability:[],eventDuration:0,state:"ready",eventInfo:null,cancelledEventInfo:null,isLoading:!1,nylasBranding:!0,...o};S.debug("[defaultNylasStoreState]: ",e);const t=S.createStore(e);return t.onChange("availability",s=>{S.debug("[availability]: ",s);const i=s.map(a=>a.start_time);S.debug("[selectableDates]: ",i),t.set("selectableDates",i);const r=s[0];if(!r)return;const n=Math.floor((r.end_time.getTime()-r.start_time.getTime())/6e4);S.debug("[durationMinutes]: ",n),t.set("eventDuration",n)}),t.reset=()=>{for(const s in e){const i=e[s];t.set(s,i)}},t}exports.CreateNylasSchedulerStore=z;exports.NylaSchedulerAPIConnector=C;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { r as t, c as l, h as a } from "./index-2d032bec.js";
|
|
2
|
+
import { s as r } from "./index-6d9eeb53-91d36348.js";
|
|
3
|
+
import "./index-53420959-41ed02ae.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
const n = ':host{display:block;--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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}textarea{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}textarea:focus{outline-color:var(--nylas-primary)}textarea.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}textarea.error::placeholder{font-weight:400}textarea::placeholder{color:var(--nylas-base-300)}textarea::-webkit-resizer{display:none}', i = n, o = class {
|
|
7
|
+
constructor(e) {
|
|
8
|
+
t(this, e), this.nylasFormInputChanged = l(this, "nylasFormInputChanged", 7), this.name = "textarea", this.defaultValue = "", this.label = "", this.placeholder = "", this.required = !1, this.readOnly = !1, this.autoFocus = !1, this.maxLength = 255, this.value = "", this.error = "";
|
|
9
|
+
}
|
|
10
|
+
componentWillLoad() {
|
|
11
|
+
this.value = r(this.defaultValue);
|
|
12
|
+
}
|
|
13
|
+
handleBookingFormSubmitted(e) {
|
|
14
|
+
this.validate(this.value), this.error && e.preventDefault();
|
|
15
|
+
}
|
|
16
|
+
handleInput(e) {
|
|
17
|
+
const s = e.target;
|
|
18
|
+
this.value = r(s.value), this.nylasFormInputChanged.emit({
|
|
19
|
+
value: this.value,
|
|
20
|
+
name: this.name,
|
|
21
|
+
error: this.error,
|
|
22
|
+
label: this.label
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
validate(e) {
|
|
26
|
+
this.required && !e ? this.error = `${this.label} is required.` : e.length > this.maxLength ? this.error = `${this.label} cannot exceed ${this.maxLength} characters.` : this.error = "";
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
return a("label", { key: "53a7c178e2c02573ea764282c4d362ad43c59999", part: "tc__label", class: { error: !!this.error } }, a("p", { key: "9207758aeb7c6df5112baf8d2ec006b782e98f71" }, a("span", { key: "5b0835cb533db40654234682f04ccd67a42dccec", class: "label" }, this.label), this.required && a("span", { class: "required" }, "*")), a("textarea", { key: "1d98854a3ac31203d2abc80e4db7ca39d2fb4263", name: this.name, placeholder: this.placeholder, readOnly: this.readOnly, autoFocus: this.autoFocus, value: this.value, maxLength: this.maxLength, onInput: (e) => this.handleInput(e), class: { error: !!this.error }, part: "tc__textarea" }), this.error && a("span", { class: "error help-text" }, this.error));
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
o.style = i;
|
|
33
|
+
export {
|
|
34
|
+
o as textarea_component
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-9c04361d.cjs"),r=require("./index-6d9eeb53-f478270c.cjs");require("./index-53420959-a76f0327.cjs");require("react");require("react-dom");const l=':host{display:block;--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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}textarea{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}textarea:focus{outline-color:var(--nylas-primary)}textarea.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}textarea.error::placeholder{font-weight:400}textarea::placeholder{color:var(--nylas-base-300)}textarea::-webkit-resizer{display:none}',n=l,s=class{constructor(e){a.registerInstance(this,e),this.nylasFormInputChanged=a.createEvent(this,"nylasFormInputChanged",7),this.name="textarea",this.defaultValue="",this.label="",this.placeholder="",this.required=!1,this.readOnly=!1,this.autoFocus=!1,this.maxLength=255,this.value="",this.error=""}componentWillLoad(){this.value=r.sanitizeHtml$1(this.defaultValue)}handleBookingFormSubmitted(e){this.validate(this.value),this.error&&e.preventDefault()}handleInput(e){const t=e.target;this.value=r.sanitizeHtml$1(t.value),this.nylasFormInputChanged.emit({value:this.value,name:this.name,error:this.error,label:this.label})}validate(e){this.required&&!e?this.error=`${this.label} is required.`:e.length>this.maxLength?this.error=`${this.label} cannot exceed ${this.maxLength} characters.`:this.error=""}render(){return a.h("label",{key:"53a7c178e2c02573ea764282c4d362ad43c59999",part:"tc__label",class:{error:!!this.error}},a.h("p",{key:"9207758aeb7c6df5112baf8d2ec006b782e98f71"},a.h("span",{key:"5b0835cb533db40654234682f04ccd67a42dccec",class:"label"},this.label),this.required&&a.h("span",{class:"required"},"*")),a.h("textarea",{key:"1d98854a3ac31203d2abc80e4db7ca39d2fb4263",name:this.name,placeholder:this.placeholder,readOnly:this.readOnly,autoFocus:this.autoFocus,value:this.value,maxLength:this.maxLength,onInput:e=>this.handleInput(e),class:{error:!!this.error},part:"tc__textarea"}),this.error&&a.h("span",{class:"error help-text"},this.error))}};s.style=n;exports.textarea_component=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-9c04361d.cjs");require("react");require("react-dom");const t='.switch{--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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;display:inline-block;height:34px;position:relative;width:60px}.switch input{display:none}.slider{background-color:var(--nylas-base-400);bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:0.4s}.slider:before{background-color:var(--nylas-base-0);bottom:4px;content:"";height:32px;left:4px;position:absolute;transition:0.4s;width:32px}input:checked+.slider{background-color:var(--nylas-success)}input:checked+.slider:before{transform:translateX(32px)}.slider.round{border-radius:35px;width:72px;height:40px}.slider.round:before{border-radius:50%}',i=t,s=class{constructor(a){e.registerInstance(this,a),this.nylasFormSwitchToggled=e.createEvent(this,"nylasFormSwitchToggled",7),this.name="toggle-switch",this.checked=!1,this.label="",this.isChecked=this.checked}componentWillLoad(){this.isChecked=this.checked}toggleCheck(){this.isChecked=!this.isChecked,this.nylasFormSwitchToggled.emit({checked:this.isChecked,name:this.name,label:this.label})}render(){return e.h("label",{key:"e1666e95609e7e7b8364dc92630b3549786db8cd",class:"switch",htmlFor:"checkbox"},e.h("input",{key:"ed6b39d27fd625e94a8176dc35ac550f73b9aac9",type:"checkbox",id:"checkbox",name:this.name}),e.h("div",{key:"f589add79b5f1941377b590e48627996c90b6730",class:"slider round"}))}};s.style=i;exports.toggle_switch=s;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { r as a, c as t, h as e } from "./index-2d032bec.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
const i = '.switch{--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-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;display:inline-block;height:34px;position:relative;width:60px}.switch input{display:none}.slider{background-color:var(--nylas-base-400);bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:0.4s}.slider:before{background-color:var(--nylas-base-0);bottom:4px;content:"";height:32px;left:4px;position:absolute;transition:0.4s;width:32px}input:checked+.slider{background-color:var(--nylas-success)}input:checked+.slider:before{transform:translateX(32px)}.slider.round{border-radius:35px;width:72px;height:40px}.slider.round:before{border-radius:50%}', r = i, n = class {
|
|
5
|
+
constructor(s) {
|
|
6
|
+
a(this, s), this.nylasFormSwitchToggled = t(this, "nylasFormSwitchToggled", 7), this.name = "toggle-switch", this.checked = !1, this.label = "", this.isChecked = this.checked;
|
|
7
|
+
}
|
|
8
|
+
componentWillLoad() {
|
|
9
|
+
this.isChecked = this.checked;
|
|
10
|
+
}
|
|
11
|
+
toggleCheck() {
|
|
12
|
+
this.isChecked = !this.isChecked, this.nylasFormSwitchToggled.emit({
|
|
13
|
+
checked: this.isChecked,
|
|
14
|
+
name: this.name,
|
|
15
|
+
label: this.label
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return e("label", { key: "e1666e95609e7e7b8364dc92630b3549786db8cd", class: "switch", htmlFor: "checkbox" }, e("input", { key: "ed6b39d27fd625e94a8176dc35ac550f73b9aac9", type: "checkbox", id: "checkbox", name: this.name }), e("div", { key: "f589add79b5f1941377b590e48627996c90b6730", class: "slider round" }));
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
n.style = r;
|
|
23
|
+
export {
|
|
24
|
+
n as toggle_switch
|
|
25
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./index-9c04361d.cjs");require("react");require("react-dom");const s=".sc-translate-icon-h{display:flex}",i=s,e=class{constructor(t){C.registerInstance(this,t),this.width="16",this.height="16"}render(){return C.h("svg",{key:"cc28e003f52beddf264e14de210359dbeab11321",xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height,viewBox:"0 0 20 20",fill:"none"},C.h("path",{key:"887afb698a01900cf408d4db7cd389f3505f8211",fill:"currentColor",d:"M14.1663 4.02867C14.4267 4.12081 14.563 4.40654 14.4709 4.66685C14.3501 5.00788 14.2182 5.4771 14.1178 5.86047C14.6877 5.77587 15.2665 5.65653 15.8867 5.51288C16.1557 5.45058 16.4243 5.61815 16.4866 5.88717C16.5489 6.15619 16.3814 6.42479 16.1123 6.4871C15.339 6.66621 14.6101 6.81289 13.8717 6.90283C13.7759 7.35654 13.7014 7.77084 13.6451 8.15021C14.1202 8.04599 14.5738 8.00553 14.9996 8.02075L14.9996 8C14.9996 7.72386 15.2235 7.5 15.4996 7.5C15.7758 7.5 15.9996 7.72386 15.9996 8C15.9996 8.05657 15.9991 8.11281 15.9979 8.16871C17.1392 8.47838 17.9781 9.23987 18.3435 10.2263C18.9579 11.8853 18.1287 13.8787 15.7027 14.9569C15.4504 15.069 15.1549 14.9554 15.0427 14.7031C14.9306 14.4507 15.0442 14.1552 15.2966 14.0431C17.3705 13.1213 17.7913 11.6147 17.4057 10.5737C17.1874 9.984 16.6776 9.44916 15.9129 9.18633C15.6829 10.7237 15.021 11.9466 14.229 12.7925C14.3126 12.9656 14.3958 13.1436 14.4641 13.3151C14.5662 13.5717 14.441 13.8625 14.1844 13.9646C13.9278 14.0667 13.637 13.9415 13.5349 13.6849C13.5066 13.6137 13.4777 13.5463 13.448 13.4802C13.028 13.7794 12.5905 13.9869 12.1705 14.0835C11.5942 14.2161 10.963 14.1517 10.534 13.6942C9.88917 13.0053 9.84361 11.8611 10.2855 10.8412C10.6652 9.96479 11.4186 9.11781 12.5848 8.54034C12.6387 8.07338 12.7199 7.55894 12.8332 6.98891C12.3926 7.00755 11.9403 7.00326 11.4659 6.97127C11.1904 6.95269 10.9821 6.71428 11.0007 6.43876C11.0192 6.16325 11.2577 5.95496 11.5332 5.97353C12.0633 6.00928 12.5641 6.00772 13.0566 5.97553C13.1605 5.55444 13.3512 4.8331 13.5282 4.33317C13.6203 4.07286 13.906 3.93653 14.1663 4.02867ZM12.501 9.74109C11.8436 10.1821 11.427 10.7219 11.2031 11.2387C10.8542 12.0439 10.9881 12.716 11.2638 13.0105C11.2637 13.0104 11.2639 13.0106 11.2638 13.0105C11.3573 13.11 11.5624 13.1973 11.9463 13.109C12.2578 13.0373 12.6311 12.8571 13.0121 12.5576C12.8658 12.22 12.7272 11.8324 12.6313 11.353C12.5405 10.8996 12.4899 10.3743 12.501 9.74109ZM13.7808 11.7797C14.316 11.0956 14.759 10.1665 14.9271 9.01632C14.539 9.00681 14.1111 9.05601 13.6457 9.17854C13.605 9.19274 13.5647 9.20726 13.525 9.22209C13.4663 10.0545 13.5146 10.671 13.6118 11.1568C13.6578 11.3868 13.7156 11.5913 13.7808 11.7797ZM6.92028 5.2159C5.77942 4.88398 4.78409 5.00841 4.07616 5.21575C3.72264 5.3193 3.439 5.44393 3.24121 5.5443C3.14215 5.59457 3.0641 5.63901 3.00903 5.67212C2.98147 5.68868 2.95962 5.70244 2.9437 5.71271L2.92429 5.72542L2.91797 5.72966L2.91566 5.73123L2.91393 5.73241C2.91384 5.73249 2.91436 5.73325 2.94925 5.78397C3.23698 6.20225 3.1703 6.10548 2.91393 5.73241C2.68634 5.88881 2.62863 6.20009 2.78502 6.42767C2.94134 6.65514 3.25207 6.71313 3.47963 6.55703L3.4788 6.5576L3.48576 6.55305C3.49318 6.54826 3.50608 6.5401 3.52423 6.52919C3.56057 6.50735 3.6177 6.47463 3.69373 6.43605C3.84612 6.35872 4.07228 6.2589 4.35724 6.17544C4.92619 6.0088 5.72242 5.90898 6.64043 6.17595C7.35305 6.38517 7.66747 6.76919 7.82692 7.16112C7.98173 7.54163 8.0026 7.95751 8.00531 8.33243C7.46199 8.18407 6.79336 8.03682 6.08385 8.00744C5.04808 7.96456 3.8874 8.17096 2.87738 9.01102C1.98877 9.75011 1.78345 10.8818 2.07014 11.853C2.35713 12.8252 3.14925 13.692 4.31803 13.9348C5.22351 14.123 6.18016 13.8639 6.9599 13.5212C7.3403 13.354 7.69572 13.1594 8.0057 12.9665V13.5C8.0057 13.7761 8.22956 14 8.5057 14C8.78184 14 9.0057 13.7754 9.0057 13.4993L9.0057 8.44586C9.0058 8.05404 9.00595 7.40554 8.7532 6.78428C8.48142 6.11625 7.93342 5.51313 6.92136 5.21622L6.92028 5.2159ZM6.04249 9.00659C6.76366 9.03645 7.44769 9.209 8.0057 9.37205V11.757C7.65814 12.0182 7.13927 12.35 6.55757 12.6057C5.85264 12.9155 5.12729 13.0816 4.52148 12.9557C3.75127 12.7957 3.22322 12.2271 3.02922 11.5699C2.83491 10.9116 2.98777 10.2199 3.51683 9.77985C4.27958 9.14545 5.16917 8.97043 6.04249 9.00659Z"}))}};e.style=i;exports.translate_icon=e;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { r as
|
|
1
|
+
import { r as e, h as C } from "./index-2d032bec.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
|
-
const
|
|
4
|
+
const s = ".sc-translate-icon-h{display:flex}", i = s, o = class {
|
|
5
5
|
constructor(t) {
|
|
6
|
-
|
|
6
|
+
e(this, t), this.width = "16", this.height = "16";
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return C("svg", { key: "
|
|
9
|
+
return C("svg", { key: "cc28e003f52beddf264e14de210359dbeab11321", xmlns: "http://www.w3.org/2000/svg", width: this.width, height: this.height, viewBox: "0 0 20 20", fill: "none" }, C("path", { key: "887afb698a01900cf408d4db7cd389f3505f8211", fill: "currentColor", d: "M14.1663 4.02867C14.4267 4.12081 14.563 4.40654 14.4709 4.66685C14.3501 5.00788 14.2182 5.4771 14.1178 5.86047C14.6877 5.77587 15.2665 5.65653 15.8867 5.51288C16.1557 5.45058 16.4243 5.61815 16.4866 5.88717C16.5489 6.15619 16.3814 6.42479 16.1123 6.4871C15.339 6.66621 14.6101 6.81289 13.8717 6.90283C13.7759 7.35654 13.7014 7.77084 13.6451 8.15021C14.1202 8.04599 14.5738 8.00553 14.9996 8.02075L14.9996 8C14.9996 7.72386 15.2235 7.5 15.4996 7.5C15.7758 7.5 15.9996 7.72386 15.9996 8C15.9996 8.05657 15.9991 8.11281 15.9979 8.16871C17.1392 8.47838 17.9781 9.23987 18.3435 10.2263C18.9579 11.8853 18.1287 13.8787 15.7027 14.9569C15.4504 15.069 15.1549 14.9554 15.0427 14.7031C14.9306 14.4507 15.0442 14.1552 15.2966 14.0431C17.3705 13.1213 17.7913 11.6147 17.4057 10.5737C17.1874 9.984 16.6776 9.44916 15.9129 9.18633C15.6829 10.7237 15.021 11.9466 14.229 12.7925C14.3126 12.9656 14.3958 13.1436 14.4641 13.3151C14.5662 13.5717 14.441 13.8625 14.1844 13.9646C13.9278 14.0667 13.637 13.9415 13.5349 13.6849C13.5066 13.6137 13.4777 13.5463 13.448 13.4802C13.028 13.7794 12.5905 13.9869 12.1705 14.0835C11.5942 14.2161 10.963 14.1517 10.534 13.6942C9.88917 13.0053 9.84361 11.8611 10.2855 10.8412C10.6652 9.96479 11.4186 9.11781 12.5848 8.54034C12.6387 8.07338 12.7199 7.55894 12.8332 6.98891C12.3926 7.00755 11.9403 7.00326 11.4659 6.97127C11.1904 6.95269 10.9821 6.71428 11.0007 6.43876C11.0192 6.16325 11.2577 5.95496 11.5332 5.97353C12.0633 6.00928 12.5641 6.00772 13.0566 5.97553C13.1605 5.55444 13.3512 4.8331 13.5282 4.33317C13.6203 4.07286 13.906 3.93653 14.1663 4.02867ZM12.501 9.74109C11.8436 10.1821 11.427 10.7219 11.2031 11.2387C10.8542 12.0439 10.9881 12.716 11.2638 13.0105C11.2637 13.0104 11.2639 13.0106 11.2638 13.0105C11.3573 13.11 11.5624 13.1973 11.9463 13.109C12.2578 13.0373 12.6311 12.8571 13.0121 12.5576C12.8658 12.22 12.7272 11.8324 12.6313 11.353C12.5405 10.8996 12.4899 10.3743 12.501 9.74109ZM13.7808 11.7797C14.316 11.0956 14.759 10.1665 14.9271 9.01632C14.539 9.00681 14.1111 9.05601 13.6457 9.17854C13.605 9.19274 13.5647 9.20726 13.525 9.22209C13.4663 10.0545 13.5146 10.671 13.6118 11.1568C13.6578 11.3868 13.7156 11.5913 13.7808 11.7797ZM6.92028 5.2159C5.77942 4.88398 4.78409 5.00841 4.07616 5.21575C3.72264 5.3193 3.439 5.44393 3.24121 5.5443C3.14215 5.59457 3.0641 5.63901 3.00903 5.67212C2.98147 5.68868 2.95962 5.70244 2.9437 5.71271L2.92429 5.72542L2.91797 5.72966L2.91566 5.73123L2.91393 5.73241C2.91384 5.73249 2.91436 5.73325 2.94925 5.78397C3.23698 6.20225 3.1703 6.10548 2.91393 5.73241C2.68634 5.88881 2.62863 6.20009 2.78502 6.42767C2.94134 6.65514 3.25207 6.71313 3.47963 6.55703L3.4788 6.5576L3.48576 6.55305C3.49318 6.54826 3.50608 6.5401 3.52423 6.52919C3.56057 6.50735 3.6177 6.47463 3.69373 6.43605C3.84612 6.35872 4.07228 6.2589 4.35724 6.17544C4.92619 6.0088 5.72242 5.90898 6.64043 6.17595C7.35305 6.38517 7.66747 6.76919 7.82692 7.16112C7.98173 7.54163 8.0026 7.95751 8.00531 8.33243C7.46199 8.18407 6.79336 8.03682 6.08385 8.00744C5.04808 7.96456 3.8874 8.17096 2.87738 9.01102C1.98877 9.75011 1.78345 10.8818 2.07014 11.853C2.35713 12.8252 3.14925 13.692 4.31803 13.9348C5.22351 14.123 6.18016 13.8639 6.9599 13.5212C7.3403 13.354 7.69572 13.1594 8.0057 12.9665V13.5C8.0057 13.7761 8.22956 14 8.5057 14C8.78184 14 9.0057 13.7754 9.0057 13.4993L9.0057 8.44586C9.0058 8.05404 9.00595 7.40554 8.7532 6.78428C8.48142 6.11625 7.93342 5.51313 6.92136 5.21622L6.92028 5.2159ZM6.04249 9.00659C6.76366 9.03645 7.44769 9.209 8.0057 9.37205V11.757C7.65814 12.0182 7.13927 12.35 6.55757 12.6057C5.85264 12.9155 5.12729 13.0816 4.52148 12.9557C3.75127 12.7957 3.22322 12.2271 3.02922 11.5699C2.83491 10.9116 2.98777 10.2199 3.51683 9.77985C4.27958 9.14545 5.16917 8.97043 6.04249 9.00659Z" }));
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
o.style = i;
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
o as translate_icon
|
|
15
15
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { r as
|
|
1
|
+
import { r as n, h as t } from "./index-2d032bec.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
|
-
const
|
|
5
|
-
constructor(
|
|
6
|
-
|
|
4
|
+
const e = ".sc-warning-icon-h{display:flex}", s = e, r = class {
|
|
5
|
+
constructor(i) {
|
|
6
|
+
n(this, i), this.width = "16", this.height = "16";
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return t("svg", { key: "
|
|
9
|
+
return t("svg", { key: "7986181ae6aef9438b547db4de9b19cb6eb91d29", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "6dae655e6e4fa48293722c517c90d03af23bb16c", d: "M7.68551 1.35232L1.12678 13.2773C0.576954 14.277 1.3002 15.5002 2.4411 15.5002H15.5586C16.6995 15.5002 17.4227 14.277 16.8729 13.2773L10.3142 1.35232C9.74426 0.316153 8.2554 0.316157 7.68551 1.35232ZM8.99982 5.25016C9.41403 5.25016 9.74982 5.58595 9.74982 6.00016V10.0002C9.74982 10.4144 9.41403 10.7502 8.99982 10.7502C8.5856 10.7502 8.24982 10.4144 8.24982 10.0002V6.00016C8.24982 5.58595 8.5856 5.25016 8.99982 5.25016ZM9.74982 12.2502C9.74982 12.6644 9.41403 13.0002 8.99982 13.0002C8.5856 13.0002 8.24982 12.6644 8.24982 12.2502C8.24982 11.8359 8.5856 11.5002 8.99982 11.5002C9.41403 11.5002 9.74982 11.8359 9.74982 12.2502Z", fill: "currentColor" }));
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
r.style = s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-9c04361d.cjs");require("react");require("react-dom");const n=".sc-warning-icon-h{display:flex}",r=n,t=class{constructor(i){e.registerInstance(this,i),this.width="16",this.height="16"}render(){return e.h("svg",{key:"7986181ae6aef9438b547db4de9b19cb6eb91d29",width:this.width,height:this.height,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"6dae655e6e4fa48293722c517c90d03af23bb16c",d:"M7.68551 1.35232L1.12678 13.2773C0.576954 14.277 1.3002 15.5002 2.4411 15.5002H15.5586C16.6995 15.5002 17.4227 14.277 16.8729 13.2773L10.3142 1.35232C9.74426 0.316153 8.2554 0.316157 7.68551 1.35232ZM8.99982 5.25016C9.41403 5.25016 9.74982 5.58595 9.74982 6.00016V10.0002C9.74982 10.4144 9.41403 10.7502 8.99982 10.7502C8.5856 10.7502 8.24982 10.4144 8.24982 10.0002V6.00016C8.24982 5.58595 8.5856 5.25016 8.99982 5.25016ZM9.74982 12.2502C9.74982 12.6644 9.41403 13.0002 8.99982 13.0002C8.5856 13.0002 8.24982 12.6644 8.24982 12.2502C8.24982 11.8359 8.5856 11.5002 8.99982 11.5002C9.41403 11.5002 9.74982 11.8359 9.74982 12.2502Z",fill:"currentColor"}))}};t.style=r;exports.warning_icon=t;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nylas/react",
|
|
3
|
-
"version": "1.1.0-canary.
|
|
3
|
+
"version": "1.1.0-canary.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"react": "^18.2.0",
|
|
24
24
|
"react-dom": "^18.2.0",
|
|
25
|
-
"@nylas/web-elements": "^1.1.0-canary.
|
|
26
|
-
"@nylas/core": "^1.1.0-canary.
|
|
25
|
+
"@nylas/web-elements": "^1.1.0-canary.15",
|
|
26
|
+
"@nylas/core": "^1.1.0-canary.4"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^20.8.10",
|