@nylas/react 1.1.4 → 1.1.6
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-40ff1ddc.js +25 -0
- package/dist/add-circle-icon_2.entry-c9aa21bb.cjs +1 -0
- package/dist/archive-icon.entry-253f4253.js +15 -0
- package/dist/archive-icon.entry-f27eb10c.cjs +1 -0
- package/dist/{arrow-icon.entry-20b50784.js → arrow-icon.entry-ac939154.js} +2 -2
- package/dist/{arrow-icon.entry-83c3105b.cjs → arrow-icon.entry-b1ca875a.cjs} +1 -1
- package/dist/{bold-icon.entry-34b18d0d.js → bold-icon.entry-3594774b.js} +2 -2
- package/dist/{bold-icon.entry-0e3d84e1.cjs → bold-icon.entry-e815017f.cjs} +1 -1
- package/dist/{button-component_2.entry-54101987.cjs → button-component_2.entry-a2d998c4.cjs} +1 -1
- package/dist/{button-component_2.entry-8a5e99da.js → button-component_2.entry-fdca89a8.js} +6 -6
- package/dist/{calendar-agenda-fill-icon_51.entry-a351dca5.js → calendar-agenda-fill-icon_54.entry-40b74a1d.js} +1947 -1636
- package/dist/calendar-agenda-fill-icon_54.entry-d47f77af.cjs +10 -0
- package/dist/{calendar-cancel-icon.entry-f83e9b41.js → calendar-cancel-icon.entry-90a529f9.js} +4 -4
- package/dist/{calendar-cancel-icon.entry-00756264.cjs → calendar-cancel-icon.entry-98e56632.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-1817540c.js → calendar-check-icon_2.entry-09e247b0.js} +7 -7
- package/dist/{calendar-check-icon_2.entry-6ac948fc.cjs → calendar-check-icon_2.entry-305d0f9f.cjs} +1 -1
- package/dist/{calendar-icon.entry-68e53f52.cjs → calendar-icon.entry-7570a82f.cjs} +1 -1
- package/dist/{calendar-icon.entry-362428bf.js → calendar-icon.entry-ff7dfc9b.js} +2 -2
- package/dist/{checkbox-component_2.entry-5ce9807d.cjs → checkbox-component_2.entry-2b5a2721.cjs} +1 -1
- package/dist/{checkbox-component_2.entry-0d7c1916.js → checkbox-component_2.entry-2d8bf66e.js} +3 -3
- package/dist/{chevron-icon_3.entry-89c52603.cjs → chevron-icon_3.entry-35130198.cjs} +1 -1
- package/dist/{chevron-icon_3.entry-37c087a7.js → chevron-icon_3.entry-e6539933.js} +6 -6
- package/dist/{clock-icon_4.entry-496058ef.cjs → clock-icon_4.entry-623c482d.cjs} +1 -1
- package/dist/{clock-icon_4.entry-2e78febe.js → clock-icon_4.entry-797aa1f7.js} +8 -8
- package/dist/constants-c549b12b-7ea4c7f5.js +763 -0
- package/dist/constants-c549b12b-c85413b1.cjs +1 -0
- package/dist/copy-icon.entry-7dd1cd70.cjs +1 -0
- package/dist/{copy-icon.entry-6d4e05b0.js → copy-icon.entry-9b8eb24d.js} +7 -7
- package/dist/{delete-icon.entry-ea06b42a.js → delete-icon.entry-3d05884f.js} +7 -7
- package/dist/{delete-icon.entry-e98b336e.cjs → delete-icon.entry-506ee04f.cjs} +1 -1
- package/dist/document-refresh-icon.entry-09b959f4.js +15 -0
- package/dist/document-refresh-icon.entry-1ff1f7ca.cjs +1 -0
- package/dist/{feedbackSync-ab657d65-e8b7c001.js → feedbackSync-b56b29ed-6a2388f3.js} +1 -1
- package/dist/{feedbackSync-ab657d65-e650e46d.cjs → feedbackSync-b56b29ed-cf8c7876.cjs} +1 -1
- package/dist/{folder-icon.entry-5c3f4e8f.cjs → folder-icon.entry-2788257d.cjs} +1 -1
- package/dist/{folder-icon.entry-6096fbf4.js → folder-icon.entry-6f9875f7.js} +2 -2
- package/dist/{forward-icon.entry-4089e3bb.cjs → forward-icon.entry-49f6a480.cjs} +1 -1
- package/dist/forward-icon.entry-a0de0be0.js +15 -0
- package/dist/{globe-icon.entry-e8ca972e.cjs → globe-icon.entry-04c890dd.cjs} +1 -1
- package/dist/{globe-icon.entry-59f4c2f9.js → globe-icon.entry-b7f1e5b8.js} +4 -4
- package/dist/google-logo-icon_4.entry-66d8a50d.cjs +1 -0
- package/dist/{google-logo-icon_4.entry-d4b8926f.js → google-logo-icon_4.entry-b2463218.js} +254 -240
- package/dist/inbox-icon.entry-11813535.cjs +1 -0
- package/dist/{inbox-icon.entry-70dae5ec.js → inbox-icon.entry-c5cb64d8.js} +2 -2
- package/dist/{index-e475e0c0.js → index-600718a1.js} +3236 -3090
- package/dist/index-8755dd64.cjs +81 -0
- package/dist/{index.es-b475d61f-68a74a28.cjs → index.es-c7ca1bad-1c8a9213.cjs} +1 -1
- package/dist/{index.es-b475d61f-bfa2cba2.js → index.es-c7ca1bad-73894e2f.js} +1 -1
- package/dist/{info-icon_2.entry-f1b1dfba.cjs → info-icon_2.entry-08125285.cjs} +1 -1
- package/dist/{info-icon_2.entry-2bb60213.js → info-icon_2.entry-e48e3cda.js} +5 -5
- package/dist/{input-color-picker.entry-5ae45a9e.js → input-color-picker.entry-54e61165.js} +3 -3
- package/dist/{input-color-picker.entry-b669f7fb.cjs → input-color-picker.entry-acfa5da8.cjs} +1 -1
- package/dist/{input-component.entry-cb958501.js → input-component.entry-54df3f66.js} +3 -3
- package/dist/{input-component.entry-eeb95361.cjs → input-component.entry-e2fbcde0.cjs} +1 -1
- package/dist/{input-dropdown.entry-0b458f68.cjs → input-dropdown.entry-1509d5c4.cjs} +1 -1
- package/dist/{input-dropdown.entry-962605f8.js → input-dropdown.entry-8dec00e3.js} +4 -4
- package/dist/italic-icon.entry-79eafb05.cjs +1 -0
- package/dist/italic-icon.entry-c9028583.js +15 -0
- package/dist/{multi-select-dropdown.entry-a66408a2.cjs → multi-select-dropdown.entry-221212e3.cjs} +1 -1
- package/dist/{multi-select-dropdown.entry-3084e1fc.js → multi-select-dropdown.entry-2ed02a88.js} +2 -2
- package/dist/nylas-booked-event-card_12.entry-5125b535.cjs +1 -0
- package/dist/{nylas-booked-event-card_12.entry-29e2a4b1.js → nylas-booked-event-card_12.entry-fa2b2630.js} +421 -323
- package/dist/{nylas-form-card.entry-8465eccf.cjs → nylas-form-card.entry-2019c383.cjs} +1 -1
- package/dist/{nylas-form-card.entry-33b4c295.js → nylas-form-card.entry-a114052f.js} +16 -16
- package/dist/{nylas-if-state.entry-adb6103a.cjs → nylas-if-state.entry-480c45d1.cjs} +1 -1
- package/dist/{nylas-if-state.entry-9d96fc87.js → nylas-if-state.entry-de891ced.js} +3 -3
- package/dist/{nylas-login.entry-3f7c195e.js → nylas-login.entry-9ad74f40.js} +7 -7
- package/dist/{nylas-login.entry-78b968d1.cjs → nylas-login.entry-c99a7b37.cjs} +1 -1
- package/dist/{nylas-provider.entry-b918d0f6.cjs → nylas-provider.entry-d9c4e3d2.cjs} +1 -1
- package/dist/{nylas-provider.entry-19635620.js → nylas-provider.entry-faf7ef23.js} +5 -5
- package/dist/{nylas-scheduler-editor.entry-cfed7ae2.cjs → nylas-scheduler-editor.entry-8c5543bd.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-e848771f.js → nylas-scheduler-editor.entry-9af09bc2.js} +25 -25
- package/dist/{nylas-scheduling.entry-da987c02.js → nylas-scheduling.entry-8f5718ac.js} +142 -130
- package/dist/nylas-scheduling.entry-e778f5f6.cjs +1 -0
- package/dist/{nylas-time-window-picker.entry-1f76b577.cjs → nylas-time-window-picker.entry-0f396304.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-3c6b29d9.js → nylas-time-window-picker.entry-690e753e.js} +13 -13
- package/dist/{person-icon.entry-82bbb87c.cjs → person-icon.entry-049ebaaa.cjs} +1 -1
- package/dist/{person-icon.entry-79fcd9fb.js → person-icon.entry-9c82640f.js} +2 -2
- package/dist/{play-icon.entry-3f357ea4.cjs → play-icon.entry-4b931766.cjs} +1 -1
- package/dist/play-icon.entry-5e77c87c.js +15 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +9 -9
- package/dist/{refresh-icon.entry-7ce5ec90.cjs → refresh-icon.entry-1c42e8df.cjs} +1 -1
- package/dist/{refresh-icon.entry-1427a5e6.js → refresh-icon.entry-f9d37dda.js} +2 -2
- package/dist/{register-component-679c1308-b5a96acf.cjs → register-component-3444af44-38748cf2.cjs} +1 -1
- package/dist/{register-component-679c1308-de697ecb.js → register-component-3444af44-a9df7506.js} +1 -1
- package/dist/{reply-all-icon.entry-f1165660.js → reply-all-icon.entry-c4c94341.js} +2 -2
- package/dist/{reply-all-icon.entry-cf8114db.cjs → reply-all-icon.entry-d090c34a.cjs} +1 -1
- package/dist/reply-icon.entry-69438565.js +15 -0
- package/dist/reply-icon.entry-6a5377ae.cjs +1 -0
- package/dist/scheduler-config-store-ed4a8dfd-82b439de.cjs +1 -0
- package/dist/{scheduler-config-store-2a3b403d-e5210f72.js → scheduler-config-store-ed4a8dfd-9126610f.js} +1 -2
- package/dist/scheduler-store-d4784b24-32e6da1e.cjs +1 -0
- package/dist/{scheduler-store-908886c8-b0f43cb9.js → scheduler-store-d4784b24-4558c7eb.js} +134 -126
- package/dist/sent-icon.entry-36964458.cjs +1 -0
- package/dist/sent-icon.entry-eae2a5f1.js +15 -0
- package/dist/spam-icon.entry-1f47e1cf.js +15 -0
- package/dist/spam-icon.entry-ec0b7f17.cjs +1 -0
- package/dist/{star-icon.entry-88501c8b.cjs → star-icon.entry-5fb1fdfe.cjs} +1 -1
- package/dist/{star-icon.entry-b15601ca.js → star-icon.entry-f2ba5cf7.js} +5 -5
- package/dist/{stop-icon.entry-3475e257.cjs → stop-icon.entry-c9b1f0a1.cjs} +1 -1
- package/dist/stop-icon.entry-e9c53f8f.js +15 -0
- package/dist/{textarea-component.entry-d1f4dd9a.js → textarea-component.entry-43938bc5.js} +2 -2
- package/dist/{textarea-component.entry-683c2959.cjs → textarea-component.entry-f7a089d4.cjs} +1 -1
- package/dist/{time-period-selector.entry-8cfdf750.cjs → time-period-selector.entry-9151a673.cjs} +1 -1
- package/dist/{time-period-selector.entry-e97f86fd.js → time-period-selector.entry-dcef9d6a.js} +2 -2
- package/dist/{translate-icon.entry-09c5574f.js → translate-icon.entry-5b47ef85.js} +4 -4
- package/dist/{translate-icon.entry-5757c37c.cjs → translate-icon.entry-d563b357.cjs} +1 -1
- package/dist/trash-fill-icon.entry-7d201791.cjs +1 -0
- package/dist/{trash-fill-icon.entry-470ec1ff.js → trash-fill-icon.entry-e316b456.js} +3 -3
- package/dist/{underline-icon.entry-9fe74ba7.js → underline-icon.entry-03cae3b3.js} +2 -2
- package/dist/{underline-icon.entry-6d729068.cjs → underline-icon.entry-a6751a31.cjs} +1 -1
- package/dist/{warning-icon.entry-d924f8f9.js → warning-icon.entry-b3c9b687.js} +5 -5
- package/dist/{warning-icon.entry-c1d48318.cjs → warning-icon.entry-f4936405.cjs} +1 -1
- package/package.json +3 -3
- package/dist/add-circle-icon_2.entry-6753bd65.js +0 -25
- package/dist/add-circle-icon_2.entry-cd9a7f37.cjs +0 -1
- package/dist/archive-icon.entry-434d1696.js +0 -15
- package/dist/archive-icon.entry-7cb1c265.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_51.entry-1920adc2.cjs +0 -7
- package/dist/constants-c31dccfe-04b9cd8a.js +0 -3883
- package/dist/constants-c31dccfe-1a739653.cjs +0 -15
- package/dist/copy-icon.entry-a1baee33.cjs +0 -1
- package/dist/document-refresh-icon.entry-09750b52.cjs +0 -1
- package/dist/document-refresh-icon.entry-afae6621.js +0 -15
- package/dist/forward-icon.entry-da319c05.js +0 -15
- package/dist/google-logo-icon_4.entry-e2001f83.cjs +0 -1
- package/dist/inbox-icon.entry-80ee9082.cjs +0 -1
- package/dist/index-6b9d4b01.cjs +0 -81
- package/dist/italic-icon.entry-4a89e289.cjs +0 -1
- package/dist/italic-icon.entry-5be07509.js +0 -15
- package/dist/nylas-booked-event-card_12.entry-227ccf31.cjs +0 -1
- package/dist/nylas-reminder-emails.entry-ec79b757.js +0 -168
- package/dist/nylas-reminder-emails.entry-ee76db24.cjs +0 -4
- package/dist/nylas-reminder-time_2.entry-105de2d0.js +0 -108
- package/dist/nylas-reminder-time_2.entry-83ecc1d4.cjs +0 -1
- package/dist/nylas-scheduling.entry-e989cf9e.cjs +0 -1
- package/dist/play-icon.entry-97b40470.js +0 -15
- package/dist/reply-icon.entry-3a601cff.js +0 -15
- package/dist/reply-icon.entry-3db337c9.cjs +0 -1
- package/dist/scheduler-config-store-2a3b403d-e6f5bcab.cjs +0 -1
- package/dist/scheduler-store-908886c8-62d14677.cjs +0 -1
- package/dist/sent-icon.entry-2c7bd48e.js +0 -15
- package/dist/sent-icon.entry-708b9a2b.cjs +0 -1
- package/dist/spam-icon.entry-3106ed3d.js +0 -15
- package/dist/spam-icon.entry-fa8b80c6.cjs +0 -1
- package/dist/stop-icon.entry-f926a8db.js +0 -15
- package/dist/trash-fill-icon.entry-4bbfabcc.cjs +0 -1
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
import { R as x } from "./register-component-
|
|
3
|
-
import { T as L, a as
|
|
1
|
+
import { r as k, c as h, d, q as U, h as i, i as c, k as K, H as b, g as _, s as X, t as fe, j as Y, v as he, w as me, x as E, y as pe, z as ue, A as P, C as ge, F as be } from "./index-600718a1.js";
|
|
2
|
+
import { R as x } from "./register-component-3444af44-a9df7506.js";
|
|
3
|
+
import { T as L, a as Q, b as J } from "./constants-c549b12b-7ea4c7f5.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-dom";
|
|
6
|
-
const
|
|
7
|
-
var
|
|
8
|
-
var o = arguments.length,
|
|
6
|
+
const ye = ":host{display:block}.nylas-booked-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.event-card-wrapper{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;margin-bottom:2rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 0;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400;border-bottom:1px solid var(--nylas-base-200);width:inherit;padding:0 0 1.5rem}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booked-event-header .card-description{text-align:center}.booking-date-time,.booking-participants{padding:0 1rem;margin-top:1.5rem;margin-left:3rem;display:flex;flex-direction:column;justify-content:space-between;align-self:flex-start;position:relative}.booking-date-time svg,.booking-participants svg{color:var(--nylas-base-700);position:absolute;left:-10px}.booking-date-time .block,.booking-participants .block{display:block}.booking-date-time h3,.booking-participants h3{color:var(--nylas-base-600);margin:0;font-size:16px;font-weight:600;line-height:1.25rem;text-align:justify;margin-bottom:4px}.booking-date-time p,.booking-participants p{font-size:16px;margin:0;font-weight:400;text-align:justify;color:var(--nylas-base-800)}.booking-participants{margin-bottom:1.5rem}.booked-event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:1.5rem;gap:4px;margin:2rem;align-items:center;align-self:flex-end}.button-container{width:inherit}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);border-top:1px solid var(--nylas-base-200);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}", ve = ye;
|
|
7
|
+
var ke = function(e, t, n, r) {
|
|
8
|
+
var o = arguments.length, a = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, s;
|
|
9
9
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
10
|
-
|
|
10
|
+
a = Reflect.decorate(e, t, n, r);
|
|
11
11
|
else
|
|
12
12
|
for (var l = e.length - 1; l >= 0; l--)
|
|
13
|
-
(s = e[l]) && (
|
|
14
|
-
return o > 3 &&
|
|
13
|
+
(s = e[l]) && (a = (o < 3 ? s(a) : o > 3 ? s(t, n, a) : s(t, n)) || a);
|
|
14
|
+
return o > 3 && a && Object.defineProperty(t, n, a), a;
|
|
15
15
|
}, j = function(e, t) {
|
|
16
16
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
17
17
|
return Reflect.metadata(e, t);
|
|
18
18
|
};
|
|
19
|
-
const
|
|
19
|
+
const ee = class {
|
|
20
20
|
constructor(e) {
|
|
21
|
-
|
|
22
|
-
var o,
|
|
23
|
-
const t = new Date(this.selectedTimeslot.start_time),
|
|
24
|
-
t.getTime() -
|
|
21
|
+
k(this, e), this.cancelBookingButtonClicked = h(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = h(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = h(this, "rescheduleBookedEventError", 7), this.cancelBookedEventValidationError = h(this, "cancelBookedEventValidationError", 7), this.handleCancelBookingButtonClicked = () => {
|
|
22
|
+
var o, a;
|
|
23
|
+
const t = new Date(this.selectedTimeslot.start_time), n = (a = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : a.min_cancellation_notice;
|
|
24
|
+
t.getTime() - n * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime() ? this.cancelBookedEventValidationError.emit({
|
|
25
25
|
error: {
|
|
26
26
|
title: "Cancellation Error",
|
|
27
|
-
message: `You cannot cancel the booking within ${
|
|
27
|
+
message: `You cannot cancel the booking within ${n} minutes of the event.`
|
|
28
28
|
}
|
|
29
29
|
}) : this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
|
|
30
30
|
}, this.handleRescheduleButtonClicked = () => {
|
|
31
|
-
const t = (
|
|
32
|
-
this.rescheduleBookedEventError.emit(
|
|
31
|
+
const t = (n) => {
|
|
32
|
+
this.rescheduleBookedEventError.emit(n);
|
|
33
33
|
};
|
|
34
34
|
this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: t });
|
|
35
35
|
}, this.getPaticipantType = (t) => {
|
|
@@ -41,7 +41,7 @@ const Q = class {
|
|
|
41
41
|
default:
|
|
42
42
|
return "";
|
|
43
43
|
}
|
|
44
|
-
}, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0, this.
|
|
44
|
+
}, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.configSettings = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0, this.selectedLanguage = navigator.language, this.startTime = "", this.endTime = "";
|
|
45
45
|
}
|
|
46
46
|
connectedCallback() {
|
|
47
47
|
}
|
|
@@ -51,19 +51,28 @@ const Q = class {
|
|
|
51
51
|
d("[nylas-booked-event-card] Component will load");
|
|
52
52
|
}
|
|
53
53
|
async componentDidLoad() {
|
|
54
|
-
|
|
54
|
+
var e, t;
|
|
55
|
+
d("[nylas-booked-event-card] Component did load"), this.eventInfo || console.warn('[nylas-booked-event-card] "eventInfo" prop missing. Please provide the event info to display the event details in the booked event card component.'), this.bookingInfo || console.warn('[nylas-booked-event-card] "bookingInfo" prop missing. Please provide the booking info to display the guest details in the booked event card component.'), this.applyThemeConfig(this.themeConfig), this.startTime = U((e = this.selectedTimeslot) == null ? void 0 : e.start_time, this.selectedTimezone), this.endTime = U((t = this.selectedTimeslot) == null ? void 0 : t.end_time, this.selectedTimezone);
|
|
56
|
+
}
|
|
57
|
+
applyThemeConfig(e) {
|
|
58
|
+
if (e)
|
|
59
|
+
for (const [t, n] of Object.entries(e))
|
|
60
|
+
this.host.style.setProperty(`${t}`, n);
|
|
55
61
|
}
|
|
56
62
|
render() {
|
|
57
|
-
var
|
|
58
|
-
const e = (
|
|
59
|
-
return
|
|
63
|
+
var n, r, o, a, s, l, g, m, f, u, p, v, w, T, C, y;
|
|
64
|
+
const e = (n = this.configSettings) == null ? void 0 : n.booking_type, t = e && e !== "booking";
|
|
65
|
+
return i(b, { key: "448f4b09ce4624c71dbff719acb7a67ecbc913e8", part: "nbec" }, i("div", { key: "83186cea10465372dece0a270725407ea74a0e1c", class: "nylas-booked-event-card" }, i("div", { key: "26d0cae03f426336f59c9459109d6c55beedb505", class: "booked-event-timezone" }, i("globe-icon", { key: "87fe3f6a6c6e8a0aad7c0250358d387b70d6a634" }), L[this.selectedTimezone]), i("div", { key: "9c445dce0c157cb67cb92a7a713e1dada1be47a7", class: "event-card-wrapper", part: "nbec__card" }, i("div", { key: "8bcfae606e9f99ba9a268b2dbb19e755143f2842", class: "calendar-icon" }, i("calendar-check-icon", { key: "7abab211fd0f1a04a087e2bd15ee112db8616e6a" })), i("div", { key: "7c40924ba6736cfc379ed828c5359c1b4e79d98e", class: "booked-event-header" }, i("h2", { key: "497f50d74143788b9d9920ba2ad57564abf7844a", slot: "card-title", part: "nbec__title" }, this.rescheduleBookingId && !this.isLoading ? `${c.t("bookingRescheduled")}` : t && !this.isLoading ? `${c.t("bookingSent")}` : `${c.t("bookingConfirmed")}`, "!"), i("div", { key: "efaf8dda6da9da0e3d181ecedd579cb1648beec2", class: "card-description", part: "nbec__description" }, t ? c.t("bookingSentDescription") : i("span", null, c.t("bookingConfirmedDescription")))), i("div", { key: "4a4566f77af068b139525a13b84fd658fd9b8d02", class: "booking-date-time" }, i("checkmark-circle-icon", { key: "8526a636990d6f1bd3631a77fc4c11587bb1c966" }), i("h3", { key: "f2286f630eb03a961276b149b7f556be715c0dc3" }, c.t("bookingDateAndTimeHeader")), i("p", { key: "ad07de11395666123ccf0022f0da372c9c3f8425" }, (r = this.selectedTimeslot) != null && r.start_time ? K(new Date((o = this.selectedTimeslot) == null ? void 0 : o.start_time).toLocaleDateString(Q[this.selectedLanguage], { dateStyle: "full" })) : "-", " ", i("br", { key: "70397806f6fbed27a981f23a4ae3c57309fffbbf" }), this.startTime, " - ", this.endTime)), i("div", { key: "5fe7e31e10847e8e701dcd192c39350bec71291f", class: "booking-participants" }), !t && i("div", { class: "button-container" }, i("div", { class: {
|
|
60
66
|
footer: !0,
|
|
61
|
-
"no-footer": ((
|
|
62
|
-
"no-template-cols": ((
|
|
63
|
-
} }, !((
|
|
67
|
+
"no-footer": ((s = (a = this.configSettings) == null ? void 0 : a.scheduler) == null ? void 0 : s.hide_cancellation_options) && ((g = (l = this.configSettings) == null ? void 0 : l.scheduler) == null ? void 0 : g.hide_rescheduling_options) || ((m = this.configSettings) == null ? void 0 : m.booking_type) === "organizer-confirmation",
|
|
68
|
+
"no-template-cols": ((u = (f = this.configSettings) == null ? void 0 : f.scheduler) == null ? void 0 : u.hide_cancellation_options) || ((v = (p = this.configSettings) == null ? void 0 : p.scheduler) == null ? void 0 : v.hide_rescheduling_options)
|
|
69
|
+
} }, !((T = (w = this.configSettings) == null ? void 0 : w.scheduler) != null && T.hide_cancellation_options) && i("button-component", { variant: "destructive", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, `${c.t("cancelBookingButton")}`), !((y = (C = this.configSettings) == null ? void 0 : C.scheduler) != null && y.hide_rescheduling_options) && i("button-component", { variant: "basic", onClick: this.handleRescheduleButtonClicked, part: "nbec__button-outline nbec__reschedule-cta" }, `${c.t("rescheduleBookingButton")}`))))));
|
|
70
|
+
}
|
|
71
|
+
get host() {
|
|
72
|
+
return _(this);
|
|
64
73
|
}
|
|
65
74
|
};
|
|
66
|
-
|
|
75
|
+
ke([
|
|
67
76
|
x({
|
|
68
77
|
name: "nylas-booked-event-card",
|
|
69
78
|
stateToProps: /* @__PURE__ */ new Map([
|
|
@@ -80,8 +89,8 @@ ve([
|
|
|
80
89
|
t.scheduler.setCancel(e.detail.bookingId);
|
|
81
90
|
},
|
|
82
91
|
rescheduleButtonClicked: async (e, t) => {
|
|
83
|
-
const
|
|
84
|
-
r && (!
|
|
92
|
+
const n = await t.scheduler.setReschedule(e.detail.bookingId), { errorHandler: r } = e.detail;
|
|
93
|
+
r && (!n || "error" in n) && r(n);
|
|
85
94
|
},
|
|
86
95
|
rescheduleBookedEventError: async (e, t) => {
|
|
87
96
|
d("nylas-booked-event-card", "rescheduleBookedEventError", e.detail);
|
|
@@ -90,56 +99,57 @@ ve([
|
|
|
90
99
|
d("nylas-booked-event-card", "cancelBookedEventValidationError", e.detail);
|
|
91
100
|
}
|
|
92
101
|
},
|
|
102
|
+
localPropsToProp: /* @__PURE__ */ new Map([["themeConfig", "themeConfig"]]),
|
|
93
103
|
fireRegisterEvent: !0
|
|
94
104
|
}),
|
|
95
105
|
j("design:type", Function),
|
|
96
106
|
j("design:paramtypes", []),
|
|
97
107
|
j("design:returntype", void 0)
|
|
98
|
-
],
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
var
|
|
102
|
-
var o = arguments.length,
|
|
108
|
+
], ee.prototype, "render", null);
|
|
109
|
+
ee.style = ve;
|
|
110
|
+
const Ce = ":host{display:block;height:100%}.nylas-booking-form{width:100%;padding:1.5rem;box-sizing:border-box;height:450px;overflow-y:auto;height:100%}form{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center}sp-textfield{--spectrum-corner-radius-100:var(--nylas-border-radius-2x);--spectrum-textfield-border-color:var(--nylas-base-300);position:relative;width:100%;height:48px;margin-bottom:16px;color:var(--nylas-base-500)}.cta{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{grid-template-columns:1fr}}.input-wrapper{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-bottom:1rem}.input-wrapper input::placeholder{color:var(--nylas-base-300)}.input-wrapper label,.input-wrapper input{font-family:var(--nylas-font-family);font-size:16px}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}.button-content{display:flex;gap:4px;align-items:center}sp-infield-button{--spectrum-infield-button-background-color:transparent;--spectrum-infield-button-background-color-hover:transparent;--spectrum-infield-button-background-color-active:transparent;--spectrum-infield-button-border-color:transparent;--spectrum-infield-button-border-width:1px;--spectrum-infield-button-border-radius:0;color:var(--nylas-base-600);background:transparent;border:none;outline:1px solid var(--nylas-base-300);border-radius:0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x) 0;height:52px;width:52px;display:flex;position:absolute;right:0;align-items:center;justify-content:center;cursor:pointer}sp-infield-button sp-icon-cross300{color:var(--nylas-base-600)}sp-infield-button.error{border-width:2px;border-color:var(--nylas-error)}input[type=text],input[type=email]{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%}input[type=text]:focus,input[type=email]:focus{outline-color:var(--nylas-primary)}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text]::placeholder,input[type=email]::placeholder{color:var(--nylas-base-300)}input[type=text].guest-email,input[type=email].guest-email{color:var(--nylas-base-900);padding-right:52px}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}button-component.remove-guest{position:absolute;height:51px;right:0}button-component.remove-guest.error button{border-color:var(--nylas-error)}button-component.remove-guest button{height:inherit;border-top-left-radius:initial;border-bottom-left-radius:initial;border:none !important;border-left:1px solid var(--nylas-base-300) !important}button-component.remove-guest button:hover,button-component.remove-guest button:focus{outline:1px solid var(--nylas-primary) !important;color:var(--nylas-primary)}button-component.back button{--dot-color:var(--nylas-base-800)}.guest-email-input{position:relative;display:flex;width:100%}", _e = Ce;
|
|
111
|
+
var xe = function(e, t, n, r) {
|
|
112
|
+
var o = arguments.length, a = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, s;
|
|
103
113
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
104
|
-
|
|
114
|
+
a = Reflect.decorate(e, t, n, r);
|
|
105
115
|
else
|
|
106
116
|
for (var l = e.length - 1; l >= 0; l--)
|
|
107
|
-
(s = e[l]) && (
|
|
108
|
-
return o > 3 &&
|
|
109
|
-
},
|
|
117
|
+
(s = e[l]) && (a = (o < 3 ? s(a) : o > 3 ? s(t, n, a) : s(t, n)) || a);
|
|
118
|
+
return o > 3 && a && Object.defineProperty(t, n, a), a;
|
|
119
|
+
}, R = function(e, t) {
|
|
110
120
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
111
121
|
return Reflect.metadata(e, t);
|
|
112
122
|
};
|
|
113
|
-
const S = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,
|
|
123
|
+
const S = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, te = class {
|
|
114
124
|
constructor(e) {
|
|
115
|
-
|
|
125
|
+
k(this, e), this.nameChanged = h(this, "nameChanged", 7), this.emailChanged = h(this, "emailChanged", 7), this.backButtonClicked = h(this, "backButtonClicked", 7), this.detailsConfirmed = h(this, "detailsConfirmed", 7), this.bookingFormError = h(this, "bookingFormError", 7), this.bookingFormSubmitted = h(this, "bookingFormSubmitted", 7), this.handleGuestChange = (t, n) => {
|
|
116
126
|
this.resetGuestEmailError(t);
|
|
117
127
|
const r = [...this.guestEmails];
|
|
118
|
-
r[t] =
|
|
119
|
-
}, this.handleGuestBlur = (t,
|
|
120
|
-
if (this.resetGuestEmailError(t),
|
|
128
|
+
r[t] = X(n), this.guestEmails = [...r];
|
|
129
|
+
}, this.handleGuestBlur = (t, n) => {
|
|
130
|
+
if (this.resetGuestEmailError(t), n === "") {
|
|
121
131
|
this.guestEmailErrors[t] = c.t("fieldRequired", { field: c.t("email") });
|
|
122
132
|
return;
|
|
123
133
|
}
|
|
124
|
-
if (!S.test(
|
|
134
|
+
if (!S.test(n)) {
|
|
125
135
|
this.guestEmailErrors[t] = c.t("invalidInputFormat", { field: c.t("email") });
|
|
126
136
|
return;
|
|
127
137
|
}
|
|
128
|
-
this.handleGuestChange(t,
|
|
138
|
+
this.handleGuestChange(t, n);
|
|
129
139
|
}, this.addGuestButtonClickedHandler = (t) => {
|
|
130
140
|
t.preventDefault(), this.guestEmails = [...this.guestEmails, ""];
|
|
131
|
-
}, this.removeGuestButtonClickHandler = (t,
|
|
132
|
-
t.preventDefault(), this.resetGuestEmailError(
|
|
141
|
+
}, this.removeGuestButtonClickHandler = (t, n) => {
|
|
142
|
+
t.preventDefault(), this.resetGuestEmailError(n);
|
|
133
143
|
const r = [...this.guestEmails];
|
|
134
|
-
r.splice(
|
|
144
|
+
r.splice(n, 1), this.guestEmails = [...r];
|
|
135
145
|
}, this.handleBackButtonClicked = (t) => {
|
|
136
146
|
t.preventDefault(), this.backButtonLoading = !0, this.backButtonClicked.emit();
|
|
137
147
|
}, this.bookButtonClickedHandler = async (t) => {
|
|
138
|
-
var l,
|
|
148
|
+
var l, g, m, f, u, p, v, w, T;
|
|
139
149
|
if (t.preventDefault(), this.bookingFormSubmitted.emit().defaultPrevented)
|
|
140
150
|
return;
|
|
141
151
|
d("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
|
|
142
|
-
const r = this.name || ((
|
|
152
|
+
const r = this.name || ((g = (l = this.bookingInfo) == null ? void 0 : l.primaryParticipant) == null ? void 0 : g.name), o = this.email || ((f = (m = this.bookingInfo) == null ? void 0 : m.primaryParticipant) == null ? void 0 : f.email);
|
|
143
153
|
if (!r || r === "") {
|
|
144
154
|
this.isNameValid = !1, this.validationError.name = c.t("fieldRequired", { field: c.t("name") }) || "Name is required", this.bookingFormError.emit({
|
|
145
155
|
title: "Booking form error",
|
|
@@ -161,53 +171,64 @@ const S = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
161
171
|
});
|
|
162
172
|
return;
|
|
163
173
|
}
|
|
164
|
-
let
|
|
174
|
+
let a = [];
|
|
165
175
|
if (this.guestEmails.length > 0) {
|
|
166
|
-
let
|
|
167
|
-
if (this.guestEmails.forEach((
|
|
168
|
-
|
|
169
|
-
}),
|
|
176
|
+
let C = !1;
|
|
177
|
+
if (this.guestEmails.forEach((y, B) => {
|
|
178
|
+
y === "" ? (C = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [B]: c.t("fieldRequired", { field: c.t("email") }) }) : S.test(y) || (C = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [B]: c.t("invalidInputFormat", { field: c.t("email") }) });
|
|
179
|
+
}), C) {
|
|
170
180
|
this.bookingFormError.emit({
|
|
171
181
|
title: "Booking form error",
|
|
172
182
|
description: c.t("invalidInputFormat", { field: c.t("guestEmail") }) || "Invalid guest email"
|
|
173
183
|
});
|
|
174
184
|
return;
|
|
175
185
|
}
|
|
176
|
-
|
|
186
|
+
a = this.guestEmails.map((y) => ({ name: y.trim(), email: y.trim() }));
|
|
177
187
|
} else
|
|
178
|
-
(
|
|
188
|
+
(u = this.bookingInfo) != null && u.guests && (a = (p = this.bookingInfo) == null ? void 0 : p.guests);
|
|
179
189
|
const s = {};
|
|
180
|
-
(
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
190
|
+
if ((v = this.bookingInfo) != null && v.additionalFields) {
|
|
191
|
+
const C = ((T = (w = this.configSettings) == null ? void 0 : w.scheduler) == null ? void 0 : T.additional_fields) || {};
|
|
192
|
+
Object.entries(this.bookingInfo.additionalFields).forEach(([y, B]) => {
|
|
193
|
+
y in C && (s[y] = B.value);
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
this.detailsConfirmed.emit({
|
|
184
197
|
primaryParticipant: {
|
|
185
198
|
name: r,
|
|
186
199
|
email: o
|
|
187
200
|
},
|
|
188
|
-
guests:
|
|
201
|
+
guests: a,
|
|
189
202
|
additionalFields: { ...s, ...this.additionalFields }
|
|
190
203
|
});
|
|
191
|
-
}, this.updateAdditionalFields = (t,
|
|
192
|
-
this.additionalFields && (this.additionalFields[t] =
|
|
193
|
-
}, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.configSettings = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.additionalFields = {}, this.validationError = { name: "", email: "" }, this.backButtonLoading = !1;
|
|
204
|
+
}, this.updateAdditionalFields = (t, n) => {
|
|
205
|
+
this.additionalFields && (this.additionalFields[t] = n);
|
|
206
|
+
}, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.configSettings = void 0, this.themeConfig = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.additionalFields = {}, this.validationError = { name: "", email: "" }, this.backButtonLoading = !1;
|
|
194
207
|
}
|
|
195
208
|
connectedCallback() {
|
|
196
209
|
}
|
|
197
210
|
disconnectedCallback() {
|
|
198
211
|
}
|
|
199
212
|
componentWillLoad() {
|
|
200
|
-
|
|
201
|
-
|
|
213
|
+
d("nylas-booking-form", "componentWillLoad", this.bookingInfo);
|
|
214
|
+
}
|
|
215
|
+
componentDidLoad() {
|
|
216
|
+
var e, t, n;
|
|
217
|
+
d("nylas-booking-form", "componentDidLoad", this.bookingInfo), this.bookingInfo && ((e = this.bookingInfo) != null && e.primaryParticipant) && (this.name = (t = this.bookingInfo.primaryParticipant) == null ? void 0 : t.name, this.email = (n = this.bookingInfo.primaryParticipant) == null ? void 0 : n.email), this.applyThemeConfig(this.themeConfig);
|
|
202
218
|
}
|
|
203
219
|
bookingInfoChangedHandler(e) {
|
|
204
220
|
e && e.primaryParticipant && (this.name = e.primaryParticipant.name, this.email = e.primaryParticipant.email);
|
|
205
221
|
}
|
|
222
|
+
applyThemeConfig(e) {
|
|
223
|
+
if (e)
|
|
224
|
+
for (const [t, n] of Object.entries(e))
|
|
225
|
+
this.host.style.setProperty(`${t}`, n);
|
|
226
|
+
}
|
|
206
227
|
changeName(e) {
|
|
207
|
-
this.isNameValid = !0, this.validationError.name = "", this.name =
|
|
228
|
+
this.isNameValid = !0, this.validationError.name = "", this.name = fe(e), this.nameChanged.emit(e);
|
|
208
229
|
}
|
|
209
230
|
changeEmail(e) {
|
|
210
|
-
this.isEmailValid = !0, this.validationError.email = "", this.email =
|
|
231
|
+
this.isEmailValid = !0, this.validationError.email = "", this.email = X(e), this.emailChanged.emit(e);
|
|
211
232
|
}
|
|
212
233
|
resetGuestEmailError(e) {
|
|
213
234
|
const t = { ...this.guestEmailErrors };
|
|
@@ -256,40 +277,40 @@ const S = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
256
277
|
this.updateAdditionalFields(e.detail.name, e.detail.value);
|
|
257
278
|
}
|
|
258
279
|
render() {
|
|
259
|
-
var e, t,
|
|
260
|
-
return
|
|
280
|
+
var e, t, n, r, o, a, s, l, g;
|
|
281
|
+
return i(b, { key: "9a442ac154e4e8ab9d8e8ec08b2005bb9bda476c" }, i("form", { key: "63feaa1eb0688e4019e1af96d48a3e71cafe2d3a", onSubmit: (m) => this.bookButtonClickedHandler(m), noValidate: !0 }, i("div", { key: "95f92c677613fcddd743467c30e6b097a575fa40", class: "nylas-booking-form", part: "nbf" }, i("div", { key: "b37fc60cddc9172fbb65edaf45e77c3d999f6aa4", class: "input-wrapper", part: "nbf__input-wrapper" }, i("input-component", { key: "5545f58ce4fc92b0ab185087dfbeb5de6a25aca0", label: c.t("name"), name: "name", id: "name", defaultValue: ((t = (e = this.bookingInfo) == null ? void 0 : e.primaryParticipant) == null ? void 0 : t.name) || this.name, placeholder: c.t("namePlaceholder"), type: "text", required: !0, requiredError: c.t("fieldRequired", { field: c.t("name") }), patternError: c.t("invalidInputFormat", { field: c.t("name") }), part: "nbf__input-textfield" })), i("div", { key: "6ddd5a68d0966e1fa79998d757a47b2df8c2b6e6", class: "input-wrapper", part: "nbf__input-wrapper" }, i("input-component", { key: "20a13472d671c968a2f20c79992a04aca4b50f54", label: c.t("email"), name: "email", id: "email", pattern: S, defaultValue: ((r = (n = this.bookingInfo) == null ? void 0 : n.primaryParticipant) == null ? void 0 : r.email) || this.email, placeholder: c.t("emailPlaceholder"), type: "email", required: !0, requiredError: c.t("fieldRequired", { field: c.t("email") }), patternError: c.t("invalidInputFormat", { field: c.t("email") }), part: "nbf__input-textfield" })), ((a = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : a.hide_additional_guests) !== !0 && i("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, this.guestEmails.map((m, f) => i("div", { class: "input-wrapper button-wrapper" }, i("label", { class: {
|
|
261
282
|
error: !!this.guestEmailErrors[f]
|
|
262
|
-
} }, c.t("guestEmail")),
|
|
283
|
+
} }, c.t("guestEmail")), i("div", { class: "guest-email-input" }, i("input", { type: "email", id: `guest-email-${f}`, maxLength: 100, class: {
|
|
263
284
|
"guest-email": !0,
|
|
264
285
|
error: !!this.guestEmailErrors[f]
|
|
265
|
-
}, placeholder: c.t("guestEmailPlaceholder"), value: m, "data-index": f, part: "nbf__input-textfield", onBlur: (
|
|
286
|
+
}, placeholder: c.t("guestEmailPlaceholder"), value: m, "data-index": f, part: "nbf__input-textfield", onBlur: (u) => {
|
|
266
287
|
var p;
|
|
267
|
-
return this.handleGuestBlur(f, (p =
|
|
268
|
-
}, onInput: (
|
|
288
|
+
return this.handleGuestBlur(f, (p = u.target) == null ? void 0 : p.value);
|
|
289
|
+
}, onInput: (u) => {
|
|
269
290
|
var p;
|
|
270
|
-
return this.handleGuestChange(f, (p =
|
|
271
|
-
} }),
|
|
291
|
+
return this.handleGuestChange(f, (p = u.target) == null ? void 0 : p.value);
|
|
292
|
+
} }), i("button-component", { variant: "basic", tooltip: "Remove guest", onClick: (u) => this.removeGuestButtonClickHandler(u, f), class: {
|
|
272
293
|
"remove-guest": !0,
|
|
273
294
|
error: !!this.guestEmailErrors[f]
|
|
274
|
-
} },
|
|
275
|
-
var
|
|
276
|
-
const f = m[1],
|
|
295
|
+
} }, i("close-icon", null))), i("p", { class: "help-text" }, this.guestEmailErrors[f]))), i("button-component", { class: "add-guest", variant: "invisible", part: "nbf__button-ghost", onClick: (m) => this.addGuestButtonClickedHandler(m) }, i("div", { class: "button-content" }, i("add-circle-icon", { slot: "icon" }), this.guestEmails.length > 0 ? `${c.t("addAnotherGuest")}` : `${c.t("addGuest")}`))), (g = Object.entries(((l = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : l.additional_fields) || {})) == null ? void 0 : g.sort((m, f) => m[1].order - f[1].order).map((m) => {
|
|
296
|
+
var w, T, C, y, B, W;
|
|
297
|
+
const f = m[1], u = f.label, p = m[0], v = ((C = (T = (w = this.bookingInfo) == null ? void 0 : w.additionalFields) == null ? void 0 : T[p]) == null ? void 0 : C.value) || "";
|
|
277
298
|
switch (f.type) {
|
|
278
299
|
case "dropdown":
|
|
279
|
-
return
|
|
300
|
+
return i("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, i("select-dropdown", { label: u, name: p, id: p, withSearch: !1, defaultSelectedOption: v ? { value: v, label: v } : void 0, options: (y = f.options) == null ? void 0 : y.map((D) => ({ value: D, label: D })), required: f.required, exportparts: "sd_dropdown: nbf__dropdown, sd_dropdown-button: nbf__dropdown-button, sd_dropdown-content: nbf__dropdown-content" }));
|
|
280
301
|
case "checkbox":
|
|
281
|
-
return
|
|
302
|
+
return i("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, i("checkbox-component", { label: u, name: p, id: p, checked: v === "true", required: f.required, part: "nbf__checkbox-component" }));
|
|
282
303
|
case "radio_button":
|
|
283
|
-
return
|
|
304
|
+
return i("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, i("radio-button-group", { label: u, name: p, id: p, defaultSelectedValue: v || ((B = f.options) == null ? void 0 : B[0]) || "", options: (W = f.options) == null ? void 0 : W.map((D) => ({ value: D, label: D })), required: f.required, part: "nbf__radio-button-group" }));
|
|
284
305
|
case "multi_line_text":
|
|
285
|
-
return
|
|
306
|
+
return i("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, i("textarea-component", { label: u, defaultValue: v, name: p, id: p, required: f.required, part: "nbf__textarea-component" }));
|
|
286
307
|
default:
|
|
287
|
-
return
|
|
308
|
+
return i("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, i("input-component", { label: u, name: p, id: p, type: f.type, defaultValue: v || "", requiredError: c.t("fieldRequired", { field: u }), required: f.required, part: "nbf__input-textfield" }));
|
|
288
309
|
}
|
|
289
|
-
})),
|
|
310
|
+
})), i("div", { key: "9229b464ad25565982e59b7d01fe5f2204e1d10e", class: "cta" }, i("button-component", { key: "877d574a7a39f960c5cddff0f84d3d0454bfc96c", variant: "basic", class: "back", part: "nbf__button-outline", isLoading: this.backButtonLoading && this.isLoading, onClick: this.handleBackButtonClicked }, i("slot", { key: "9436fe8276b9da6baa608695b1d0dceb03c865ae", name: "booking-form-back-label" }, `${c.t("backButton")}`)), i("button-component", { key: "48814874005b24b2f21a8cdbd863194a563f171f", variant: "primary", isLoading: !this.backButtonLoading && this.isLoading, disabled: this.isLoading, part: "nbf__button-primary", type: "submit" }, i("slot", { key: "975aba7f10d24850113f7fcfe1e11abbb15ac401", name: "booking-form-book-label" }, `${c.t("bookNowButton")}`)))));
|
|
290
311
|
}
|
|
291
312
|
get host() {
|
|
292
|
-
return
|
|
313
|
+
return _(this);
|
|
293
314
|
}
|
|
294
315
|
static get watchers() {
|
|
295
316
|
return {
|
|
@@ -297,7 +318,7 @@ const S = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
297
318
|
};
|
|
298
319
|
}
|
|
299
320
|
};
|
|
300
|
-
|
|
321
|
+
xe([
|
|
301
322
|
x({
|
|
302
323
|
name: "nylas-booking-form",
|
|
303
324
|
stateToProps: /* @__PURE__ */ new Map([
|
|
@@ -326,39 +347,40 @@ _e([
|
|
|
326
347
|
d("nylas-booking-form", "bookingFormError", e.detail);
|
|
327
348
|
}
|
|
328
349
|
},
|
|
350
|
+
localPropsToProp: /* @__PURE__ */ new Map([["themeConfig", "themeConfig"]]),
|
|
329
351
|
fireRegisterEvent: !0
|
|
330
352
|
}),
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
],
|
|
335
|
-
|
|
336
|
-
const
|
|
337
|
-
var Ee = function(e, t,
|
|
338
|
-
var o = arguments.length,
|
|
353
|
+
R("design:type", Function),
|
|
354
|
+
R("design:paramtypes", []),
|
|
355
|
+
R("design:returntype", void 0)
|
|
356
|
+
], te.prototype, "render", null);
|
|
357
|
+
te.style = _e;
|
|
358
|
+
const we = ":host{display:block;width:400px;font-family:var(--nylas-font-family)}.nylas-cancel-booking-form{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}.nylas-cancel-booking-form form{width:100%}.nylas-cancel-booking-form__title{font-size:18px;font-weight:600;margin-bottom:0;color:var(--nylas-base-900)}.nylas-cancel-booking-form__description{font-size:1rem;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600);padding-bottom:1.25rem}.nylas-cancel-booking-form__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}.footer{display:grid;grid-template-columns:1fr 1fr;width:100%;padding-top:1.25rem;gap:1rem;border-top:1px solid var(--nylas-base-200);margin-top:1.25rem}", Te = we;
|
|
359
|
+
var Ee = function(e, t, n, r) {
|
|
360
|
+
var o = arguments.length, a = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, s;
|
|
339
361
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
340
|
-
|
|
362
|
+
a = Reflect.decorate(e, t, n, r);
|
|
341
363
|
else
|
|
342
364
|
for (var l = e.length - 1; l >= 0; l--)
|
|
343
|
-
(s = e[l]) && (
|
|
344
|
-
return o > 3 &&
|
|
345
|
-
},
|
|
365
|
+
(s = e[l]) && (a = (o < 3 ? s(a) : o > 3 ? s(t, n, a) : s(t, n)) || a);
|
|
366
|
+
return o > 3 && a && Object.defineProperty(t, n, a), a;
|
|
367
|
+
}, F = function(e, t) {
|
|
346
368
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
347
369
|
return Reflect.metadata(e, t);
|
|
348
370
|
};
|
|
349
|
-
const
|
|
371
|
+
const ne = class {
|
|
350
372
|
constructor(e) {
|
|
351
|
-
var t,
|
|
352
|
-
|
|
373
|
+
var t, n;
|
|
374
|
+
k(this, e), this.goBackButtonClicked = h(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = h(this, "cancelBookingFormSubmitted", 7), this.triggerValidation = h(this, "triggerValidation", 7), this.cancelBookedEventError = h(this, "cancelBookedEventError", 7), this.cancelBookingFormError = h(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
|
|
353
375
|
this.goBackButtonClicked.emit();
|
|
354
376
|
}, this.handleSubmitCancelBooking = (r) => {
|
|
355
|
-
var s, l,
|
|
377
|
+
var s, l, g;
|
|
356
378
|
if (this.triggerValidation.emit({}), r.preventDefault(), !this.cancellationReason) {
|
|
357
379
|
this.cancellationError = c.t("cancellationErrorMessage"), this.cancelBookingFormError.emit({ title: c.t("cancelBokingFormError"), description: c.t("cancellationErrorMessage") });
|
|
358
380
|
return;
|
|
359
381
|
}
|
|
360
382
|
const o = (l = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : l.min_cancellation_notice;
|
|
361
|
-
if (this.selectedTimeslot && o && new Date((
|
|
383
|
+
if (this.selectedTimeslot && o && new Date((g = this.selectedTimeslot) == null ? void 0 : g.start_time).getTime() - o * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime()) {
|
|
362
384
|
this.cancelBookedEventError.emit({
|
|
363
385
|
error: {
|
|
364
386
|
title: c.t("cancellationErrorTitle"),
|
|
@@ -368,11 +390,11 @@ const te = class {
|
|
|
368
390
|
return;
|
|
369
391
|
}
|
|
370
392
|
d(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
|
|
371
|
-
const
|
|
393
|
+
const a = (m) => {
|
|
372
394
|
this.cancelBookedEventError.emit(m);
|
|
373
395
|
};
|
|
374
|
-
this.cancelBookingId ? this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, action: "cancel", reason: this.cancellationReason, errorHandler:
|
|
375
|
-
}, this.cancelBookingId = void 0, this.rejectBookingId = void 0, this.configSettings = void 0, this.eventInfo = void 0, this.
|
|
396
|
+
this.cancelBookingId ? this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, action: "cancel", reason: this.cancellationReason, errorHandler: a }) : this.rejectBookingId && this.cancelBookingFormSubmitted.emit({ bookingId: this.rejectBookingId, action: "reject", reason: this.cancellationReason, errorHandler: a });
|
|
397
|
+
}, this.cancelBookingId = void 0, this.rejectBookingId = void 0, this.selectedTimeslot = void 0, this.configSettings = void 0, this.eventInfo = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.cancellationReason = "", this.cancellationError = "", this.cancellationPolicy = ((n = (t = this.configSettings) == null ? void 0 : t.scheduler) == null ? void 0 : n.cancellation_policy) || "Your current timeslot will become available to others.";
|
|
376
398
|
}
|
|
377
399
|
configSettingsChangedHandler(e) {
|
|
378
400
|
var t;
|
|
@@ -385,17 +407,25 @@ const te = class {
|
|
|
385
407
|
d("[nylas-cancel-booking-form] Component will load");
|
|
386
408
|
}
|
|
387
409
|
async componentDidLoad() {
|
|
388
|
-
d("[nylas-cancel-booking-form] Component did load"), this.cancelBookingId || console.warn('[nylas-cancel-booking-form] No booking ID provided, "cancelBookingId" prop is required.');
|
|
410
|
+
d("[nylas-cancel-booking-form] Component did load"), this.cancelBookingId || console.warn('[nylas-cancel-booking-form] No booking ID provided, "cancelBookingId" prop is required.'), this.applyThemeConfig(this.themeConfig);
|
|
389
411
|
}
|
|
390
412
|
disconnectedCallback() {
|
|
391
413
|
d("[nylas-cancel-booking-form] Component disconnected");
|
|
392
414
|
}
|
|
415
|
+
applyThemeConfig(e) {
|
|
416
|
+
if (e)
|
|
417
|
+
for (const [t, n] of Object.entries(e))
|
|
418
|
+
this.host.style.setProperty(`${t}`, n);
|
|
419
|
+
}
|
|
393
420
|
handleNylasFormInputChanged(e) {
|
|
394
421
|
this.triggerValidation.emit({}), e.detail.name === "cancel-reason" && (this.cancellationReason = e.detail.value, this.cancellationError = e.detail.error);
|
|
395
422
|
}
|
|
396
423
|
render() {
|
|
397
424
|
var e, t;
|
|
398
|
-
return
|
|
425
|
+
return i(b, { key: "4e09c3c77a5a4a5138366431c50db2731ce08921", part: "ncbf" }, i("div", { key: "3cc3f35b457f947d6f368b7857d6529e640800e4", class: "nylas-cancel-booking-form", part: "ncbf__card" }, i("div", { key: "41001fcfa02096c97a909c1a2172349d5c77ceba", class: "nylas-cancel-booking-form__calendar-icon", part: "ncbf__icon" }, i("calendar-cancel-icon", { key: "328274c7fe7351574cb43565b4ee1d8500d0cdcf" })), i("h3", { key: "4a702b5a6b7712336370b82f993a5c36655a4de2", class: "nylas-cancel-booking-form__title", part: "ncbf__title" }, c.t("cancelBookingTitle")), i("div", { key: "3d28b48ce8f84a843cfd96b57340d624e7cc0efc", class: "nylas-cancel-booking-form__description", part: "ncbf__description" }, (t = (e = this.configSettings) == null ? void 0 : e.scheduler) != null && t.cancellation_policy ? this.cancellationPolicy : `${c.t("cancelBookingMessage")}`), i("form", { key: "d1363507571afe0b46f47697830ca603dd206abe", onSubmit: this.handleSubmitCancelBooking }, i("textarea-component", { key: "4256de3a9d7b2cf05a45388c9916f9bc38e82b80", id: "cancel-reason", name: "cancel-reason", required: !0, label: c.t("reasonForCancellation"), class: this.cancellationError ? "error" : "", part: "ncbf__reason-textarea", defaultValue: this.cancellationReason }), i("div", { key: "fc0169e6090700c9ac26db55b6b10f8614bf408e", class: "footer" }, i("button-component", { key: "e348ccaabd354669178d4c5def1ac9c545b8b5ac", variant: "destructive", class: "cancel", type: "submit", part: "ncbf__button-cta", disabled: this.isLoading }, c.t("cancelBookingButton")), !!this.eventInfo && i("button-component", { variant: "basic", class: "back", part: "ncbf__button-outline", onClick: this.handleGoBackClicked }, c.t("goBackButton"))))));
|
|
426
|
+
}
|
|
427
|
+
get host() {
|
|
428
|
+
return _(this);
|
|
399
429
|
}
|
|
400
430
|
static get watchers() {
|
|
401
431
|
return {
|
|
@@ -416,11 +446,11 @@ Ee([
|
|
|
416
446
|
]),
|
|
417
447
|
eventToProps: {
|
|
418
448
|
cancelBookingFormSubmitted: async (e, t) => {
|
|
419
|
-
const { action:
|
|
420
|
-
if (
|
|
449
|
+
const { action: n, errorHandler: r } = e.detail;
|
|
450
|
+
if (n === "cancel") {
|
|
421
451
|
const o = await t.scheduler.cancelBooking(e.detail.bookingId, e.detail.reason);
|
|
422
452
|
r && (!o || "error" in o) && r(o);
|
|
423
|
-
} else if (
|
|
453
|
+
} else if (n === "reject") {
|
|
424
454
|
const o = await t.scheduler.updateBooking({
|
|
425
455
|
bookingId: e.detail.bookingId,
|
|
426
456
|
status: "cancelled",
|
|
@@ -439,35 +469,36 @@ Ee([
|
|
|
439
469
|
d("nylas-cancel-booking-form", "cancelBookingFormError", e.detail);
|
|
440
470
|
}
|
|
441
471
|
},
|
|
472
|
+
localPropsToProp: /* @__PURE__ */ new Map([["themeConfig", "themeConfig"]]),
|
|
442
473
|
fireRegisterEvent: !0
|
|
443
474
|
}),
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
],
|
|
448
|
-
|
|
449
|
-
const Be = ":host{display:block}.nylas-cancelled-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{width:100%}",
|
|
450
|
-
var
|
|
451
|
-
var o = arguments.length,
|
|
475
|
+
F("design:type", Function),
|
|
476
|
+
F("design:paramtypes", []),
|
|
477
|
+
F("design:returntype", void 0)
|
|
478
|
+
], ne.prototype, "render", null);
|
|
479
|
+
ne.style = Te;
|
|
480
|
+
const Be = ":host{display:block}.nylas-cancelled-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{width:100%}", De = Be;
|
|
481
|
+
var Le = function(e, t, n, r) {
|
|
482
|
+
var o = arguments.length, a = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, s;
|
|
452
483
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
453
|
-
|
|
484
|
+
a = Reflect.decorate(e, t, n, r);
|
|
454
485
|
else
|
|
455
486
|
for (var l = e.length - 1; l >= 0; l--)
|
|
456
|
-
(s = e[l]) && (
|
|
457
|
-
return o > 3 &&
|
|
487
|
+
(s = e[l]) && (a = (o < 3 ? s(a) : o > 3 ? s(t, n, a) : s(t, n)) || a);
|
|
488
|
+
return o > 3 && a && Object.defineProperty(t, n, a), a;
|
|
458
489
|
}, M = function(e, t) {
|
|
459
490
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
460
491
|
return Reflect.metadata(e, t);
|
|
461
492
|
};
|
|
462
|
-
const
|
|
493
|
+
const ie = class {
|
|
463
494
|
constructor(e) {
|
|
464
|
-
|
|
495
|
+
k(this, e), this.closeCancelEventCardClicked = h(this, "closeCancelEventCardClicked", 7), this.cancelledEventCardError = h(this, "cancelledEventCardError", 7), this.handleCloseClicked = () => {
|
|
465
496
|
this.isClosing = !0;
|
|
466
|
-
const t = (
|
|
467
|
-
this.cancelledEventCardError.emit(
|
|
497
|
+
const t = (n) => {
|
|
498
|
+
this.cancelledEventCardError.emit(n), this.isClosing = !1;
|
|
468
499
|
};
|
|
469
500
|
this.closeCancelEventCardClicked.emit({ errorHandler: t });
|
|
470
|
-
}, this.
|
|
501
|
+
}, this.configSettings = void 0, this.themeConfig = void 0, this.cancelledEventInfo = void 0, this.isClosing = !1;
|
|
471
502
|
}
|
|
472
503
|
connectedCallback() {
|
|
473
504
|
d("[nylas-cancelled-event-card] Component connected");
|
|
@@ -476,58 +507,67 @@ const ne = class {
|
|
|
476
507
|
d("[nylas-cancelled-event-card] Component will load");
|
|
477
508
|
}
|
|
478
509
|
async componentDidLoad() {
|
|
479
|
-
d("[nylas-cancelled-event-card] Component did load"), this.cancelledEventInfo || console.warn('[nylas-cancelled-event-card] No cancelled event info provided, "cancelledEventInfo" prop is required.');
|
|
510
|
+
d("[nylas-cancelled-event-card] Component did load"), this.cancelledEventInfo || console.warn('[nylas-cancelled-event-card] No cancelled event info provided, "cancelledEventInfo" prop is required.'), this.applyThemeConfig(this.themeConfig);
|
|
480
511
|
}
|
|
481
512
|
disconnectedCallback() {
|
|
482
513
|
d("[nylas-cancelled-event-card] Component disconnected");
|
|
483
514
|
}
|
|
515
|
+
applyThemeConfig(e) {
|
|
516
|
+
if (e)
|
|
517
|
+
for (const [t, n] of Object.entries(e))
|
|
518
|
+
this.host.style.setProperty(`${t}`, n);
|
|
519
|
+
}
|
|
484
520
|
render() {
|
|
485
521
|
var e, t;
|
|
486
|
-
return
|
|
522
|
+
return i(b, { key: "4f1f7bf3b9d6376f5112b5f71b33bdce9bf59a19", part: "ncec" }, i("div", { key: "f485f11c84c501c1d56cac844ccc39fe09b758fb", class: "nylas-cancelled-event-card", part: "ncec__card" }, i("div", { key: "3ac26f67a660d1075b3d5f674b745db0c59125a2", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, i("calendar-cancel-icon", { key: "4dc83661715f1525b3a5a45d69e336d7f0f9dbf1" })), i("h3", { key: "59446c3be2e213ca71124be2d33cae8c077b451d", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, c.t("bookingCancelledTitle"), "!"), i("div", { key: "6486085d435d558816573e6d2aa3840030707af2", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, c.t("bookingCancelledMessage"), " ", ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || "the participants", "."), i("div", { key: "e7ebffeb313b39f860df4776fe802beddc9eb86b", class: "nylas-cancelled-event-card__cta" }, i("button-component", { key: "35593203c58b837db2b7ce98d8cf214658b2e8a0", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${c.t("closingButton")}...` : `${c.t("closeButton")}`))));
|
|
523
|
+
}
|
|
524
|
+
get host() {
|
|
525
|
+
return _(this);
|
|
487
526
|
}
|
|
488
527
|
};
|
|
489
|
-
|
|
528
|
+
Le([
|
|
490
529
|
x({
|
|
491
530
|
name: "nylas-cancelled-event-card",
|
|
492
531
|
stateToProps: /* @__PURE__ */ new Map([["scheduler.configSettings", "configSettings"]]),
|
|
493
532
|
eventToProps: {
|
|
494
533
|
closeCancelEventCardClicked: async (e, t) => {
|
|
495
|
-
const
|
|
496
|
-
r && (!
|
|
534
|
+
const n = await t.scheduler.resetCancel(), { errorHandler: r } = e.detail;
|
|
535
|
+
r && (!n || "error" in n) && r(n);
|
|
497
536
|
},
|
|
498
537
|
cancelledEventCardError: async (e, t) => {
|
|
499
538
|
d("nylas-cancelled-event-card", "cancelledEventCardError", e.detail);
|
|
500
539
|
}
|
|
501
540
|
},
|
|
541
|
+
localPropsToProp: /* @__PURE__ */ new Map([["themeConfig", "themeConfig"]]),
|
|
502
542
|
fireRegisterEvent: !0
|
|
503
543
|
}),
|
|
504
544
|
M("design:type", Function),
|
|
505
545
|
M("design:paramtypes", []),
|
|
506
546
|
M("design:returntype", void 0)
|
|
507
|
-
],
|
|
508
|
-
|
|
509
|
-
const
|
|
510
|
-
var
|
|
511
|
-
var o = arguments.length,
|
|
547
|
+
], ie.prototype, "render", null);
|
|
548
|
+
ie.style = De;
|
|
549
|
+
const Se = ":host{display:block}.nylas-confirmed-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-confirmed-event-card{width:inherit}}.nylas-confirmed-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-confirmed-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-confirmed-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-confirmed-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{width:100%}", ze = Se;
|
|
550
|
+
var Ie = function(e, t, n, r) {
|
|
551
|
+
var o = arguments.length, a = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, s;
|
|
512
552
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
513
|
-
|
|
553
|
+
a = Reflect.decorate(e, t, n, r);
|
|
514
554
|
else
|
|
515
555
|
for (var l = e.length - 1; l >= 0; l--)
|
|
516
|
-
(s = e[l]) && (
|
|
517
|
-
return o > 3 &&
|
|
518
|
-
},
|
|
556
|
+
(s = e[l]) && (a = (o < 3 ? s(a) : o > 3 ? s(t, n, a) : s(t, n)) || a);
|
|
557
|
+
return o > 3 && a && Object.defineProperty(t, n, a), a;
|
|
558
|
+
}, O = function(e, t) {
|
|
519
559
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
520
560
|
return Reflect.metadata(e, t);
|
|
521
561
|
};
|
|
522
562
|
const ae = class {
|
|
523
563
|
constructor(e) {
|
|
524
|
-
|
|
564
|
+
k(this, e), this.closeConfirmEventCardClicked = h(this, "closeConfirmEventCardClicked", 7), this.confirmedEventCardError = h(this, "confirmedEventCardError", 7), this.handleCloseClicked = () => {
|
|
525
565
|
this.isClosing = !0;
|
|
526
|
-
const t = (
|
|
527
|
-
this.confirmedEventCardError.emit(
|
|
566
|
+
const t = (n) => {
|
|
567
|
+
this.confirmedEventCardError.emit(n), this.isClosing = !1;
|
|
528
568
|
};
|
|
529
569
|
this.closeConfirmEventCardClicked.emit({ errorHandler: t });
|
|
530
|
-
}, this.
|
|
570
|
+
}, this.configSettings = void 0, this.themeConfig = void 0, this.confirmedEventInfo = void 0, this.isClosing = !1;
|
|
531
571
|
}
|
|
532
572
|
connectedCallback() {
|
|
533
573
|
d("[nylas-confirmed-event-card] Component connected");
|
|
@@ -536,70 +576,79 @@ const ae = class {
|
|
|
536
576
|
d("[nylas-confirmed-event-card] Component will load");
|
|
537
577
|
}
|
|
538
578
|
async componentDidLoad() {
|
|
539
|
-
d("[nylas-confirmed-event-card] Component did load"), this.confirmedEventInfo || console.warn('[nylas-confirmed-event-card] No confirmed event info provided, "confirmedEventInfo" prop is required.');
|
|
579
|
+
d("[nylas-confirmed-event-card] Component did load"), this.confirmedEventInfo || console.warn('[nylas-confirmed-event-card] No confirmed event info provided, "confirmedEventInfo" prop is required.'), this.applyThemeConfig(this.themeConfig);
|
|
540
580
|
}
|
|
541
581
|
disconnectedCallback() {
|
|
542
582
|
d("[nylas-confirmed-event-card] Component disconnected");
|
|
543
583
|
}
|
|
584
|
+
applyThemeConfig(e) {
|
|
585
|
+
if (e)
|
|
586
|
+
for (const [t, n] of Object.entries(e))
|
|
587
|
+
this.host.style.setProperty(`${t}`, n);
|
|
588
|
+
}
|
|
544
589
|
render() {
|
|
545
590
|
var e, t;
|
|
546
|
-
return
|
|
591
|
+
return i(b, { key: "089de1c1ba1b2319674b97aad4946fb8306ab4fe", part: "ncec" }, i("div", { key: "83c9b3f7904b7b74d38202c7d62891813754be93", class: "nylas-confirmed-event-card", part: "ncec__card" }, i("div", { key: "e6ebbc07f8ea697f4e1f794bb8ddddc5166db33d", class: "nylas-confirmed-event-card__calendar-icon", part: "ncec__icon" }, i("calendar-cancel-icon", { key: "eb0eb353b63bc5a8b55644a17f16c8566f3a7b36" })), i("h3", { key: "c05937028fd84a55b3b0b1de4cd36fb0b0c6b563", class: "nylas-confirmed-event-card__title", part: "ncec__title" }, c.t("confirmedEventCardTitle"), "!"), i("div", { key: "e9ca9f67f46785d40e769ff96695001d56386dad", class: "nylas-confirmed-event-card__description", part: "ncec__description" }, c.t("confirmedEventCardDescription"), " ", ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || "the participants", "."), i("div", { key: "bea8adea56d3dcdb2ce578ad25f08bc562b67ede", class: "nylas-confirmed-event-card__cta" }, i("button-component", { key: "6bed94150369d92e129fe62c4b6c292e37e26a34", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${c.t("closingButton")}...` : `${c.t("closeButton")}`))));
|
|
592
|
+
}
|
|
593
|
+
get host() {
|
|
594
|
+
return _(this);
|
|
547
595
|
}
|
|
548
596
|
};
|
|
549
|
-
|
|
597
|
+
Ie([
|
|
550
598
|
x({
|
|
551
599
|
name: "nylas-confirmed-event-card",
|
|
552
600
|
stateToProps: /* @__PURE__ */ new Map([["scheduler.configSettings", "configSettings"]]),
|
|
553
601
|
eventToProps: {
|
|
554
602
|
closeConfirmEventCardClicked: async (e, t) => {
|
|
555
|
-
const
|
|
556
|
-
r && (!
|
|
603
|
+
const n = await t.scheduler.resetConfirm(), { errorHandler: r } = e.detail;
|
|
604
|
+
r && (!n || "error" in n) && r(n);
|
|
557
605
|
}
|
|
558
606
|
},
|
|
607
|
+
localPropsToProp: /* @__PURE__ */ new Map([["themeConfig", "themeConfig"]]),
|
|
559
608
|
fireRegisterEvent: !0
|
|
560
609
|
}),
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
610
|
+
O("design:type", Function),
|
|
611
|
+
O("design:paramtypes", []),
|
|
612
|
+
O("design:returntype", void 0)
|
|
564
613
|
], ae.prototype, "render", null);
|
|
565
|
-
ae.style =
|
|
566
|
-
const
|
|
567
|
-
function I(e, t,
|
|
568
|
-
function o(
|
|
569
|
-
return e(
|
|
570
|
-
}
|
|
571
|
-
return o.floor = (
|
|
572
|
-
const s = o(
|
|
573
|
-
return
|
|
574
|
-
}, o.offset = (
|
|
575
|
-
const
|
|
576
|
-
if (
|
|
577
|
-
return
|
|
614
|
+
ae.style = ze;
|
|
615
|
+
const $ = /* @__PURE__ */ new Date(), N = /* @__PURE__ */ new Date();
|
|
616
|
+
function I(e, t, n, r) {
|
|
617
|
+
function o(a) {
|
|
618
|
+
return e(a = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+a)), a;
|
|
619
|
+
}
|
|
620
|
+
return o.floor = (a) => (e(a = /* @__PURE__ */ new Date(+a)), a), o.ceil = (a) => (e(a = new Date(a - 1)), t(a, 1), e(a), a), o.round = (a) => {
|
|
621
|
+
const s = o(a), l = o.ceil(a);
|
|
622
|
+
return a - s < l - a ? s : l;
|
|
623
|
+
}, o.offset = (a, s) => (t(a = /* @__PURE__ */ new Date(+a), s == null ? 1 : Math.floor(s)), a), o.range = (a, s, l) => {
|
|
624
|
+
const g = [];
|
|
625
|
+
if (a = o.ceil(a), l = l == null ? 1 : Math.floor(l), !(a < s) || !(l > 0))
|
|
626
|
+
return g;
|
|
578
627
|
let m;
|
|
579
628
|
do
|
|
580
|
-
|
|
581
|
-
while (m <
|
|
582
|
-
return
|
|
583
|
-
}, o.filter = (
|
|
629
|
+
g.push(m = /* @__PURE__ */ new Date(+a)), t(a, l), e(a);
|
|
630
|
+
while (m < a && a < s);
|
|
631
|
+
return g;
|
|
632
|
+
}, o.filter = (a) => I((s) => {
|
|
584
633
|
if (s >= s)
|
|
585
|
-
for (; e(s), !
|
|
634
|
+
for (; e(s), !a(s); )
|
|
586
635
|
s.setTime(s - 1);
|
|
587
636
|
}, (s, l) => {
|
|
588
637
|
if (s >= s)
|
|
589
638
|
if (l < 0)
|
|
590
639
|
for (; ++l <= 0; )
|
|
591
|
-
for (; t(s, -1), !
|
|
640
|
+
for (; t(s, -1), !a(s); )
|
|
592
641
|
;
|
|
593
642
|
else
|
|
594
643
|
for (; --l >= 0; )
|
|
595
|
-
for (; t(s, 1), !
|
|
644
|
+
for (; t(s, 1), !a(s); )
|
|
596
645
|
;
|
|
597
|
-
}),
|
|
646
|
+
}), n && (o.count = (a, s) => ($.setTime(+a), N.setTime(+s), e($), e(N), Math.floor(n($, N))), o.every = (a) => (a = Math.floor(a), !isFinite(a) || !(a > 0) ? null : a > 1 ? o.filter(r ? (s) => r(s) % a === 0 : (s) => o.count(0, s) % a === 0) : o)), o;
|
|
598
647
|
}
|
|
599
|
-
const
|
|
648
|
+
const Pe = 1e3, oe = Pe * 60, je = oe * 60, z = je * 24, H = I(
|
|
600
649
|
(e) => e.setHours(0, 0, 0, 0),
|
|
601
650
|
(e, t) => e.setDate(e.getDate() + t),
|
|
602
|
-
(e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) *
|
|
651
|
+
(e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * oe) / z,
|
|
603
652
|
(e) => e.getDate() - 1
|
|
604
653
|
);
|
|
605
654
|
I((e) => {
|
|
@@ -612,29 +661,29 @@ I((e) => {
|
|
|
612
661
|
}, (e, t) => {
|
|
613
662
|
e.setUTCDate(e.getUTCDate() + t);
|
|
614
663
|
}, (e, t) => (t - e) / z, (e) => Math.floor(e / z));
|
|
615
|
-
const
|
|
616
|
-
var
|
|
617
|
-
var o = arguments.length,
|
|
664
|
+
const Re = ':host{display:block;min-height:444px}@media screen and (max-width: 768px){:host{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}.title{margin:0 -1.25rem;display:flex;flex-direction:column;padding:0 1.5rem;gap:0.5rem;border-bottom:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family)}.title h1{margin-bottom:0;font-size:18px;line-height:20px;font-weight:600;display:flex;gap:0.5rem;align-items:center}.title p{margin-top:0;font-size:16px;display:flex;gap:0.5rem;align-items:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.dates{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:0.5rem;margin-bottom:24px}.dates .date{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:48px;width:48px;min-width:2rem;min-height:2rem;cursor:pointer;border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;font-family:inherit;color:var(--nylas-base-text);background-color:var(--nylas-base-100);cursor:pointer;border:none}@media screen and (max-width: 412px){.dates .date{width:38px;height:38px;min-width:none}}.dates .date:hover:not(:disabled){box-shadow:0 0 0 2px var(--nylas-base-500) inset}.dates .date.date.current-month{color:var(--nylas-base-800)}.dates .date.date.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0);font-weight:700}.dates .date.date.day-skeleton{color:var(--nylas-base-300)}.dates .date:disabled{color:var(--nylas-base-300);background-color:transparent;font-weight:400;cursor:not-allowed}.dates .day{font-size:12px;color:var(--nylas-base-800);font-weight:600;letter-spacing:0.5px;height:32px;display:flex;align-items:center}@media screen and (max-width: 768px){.dates .day{font-size:14px}}.dates .date.day-skeleton{height:48px;width:48px;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out;background-color:var(--nylas-base-50)}@media screen and (max-width: 412px){.dates .date.day-skeleton{width:38px;height:38px;min-width:none}}.dates .date.current-day::after{content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background-color:var(--nylas-base-500)}.dates .date.current-day.selected::after{background-color:var(--nylas-base-100)}.pagination{display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:92px}.pagination .chevron-right{transform:rotate(180deg)}.pagination .button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);background-color:transparent;color:var(--nylas-base-800);cursor:pointer;border:none}.pagination .button:hover{background-color:var(--nylas-base-50)}.pagination .button:active{background-color:var(--nylas-base-100)}.pagination .button:disabled{background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.flex-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;color:var(--nylas-base-500)}', Fe = Re;
|
|
665
|
+
var Me = function(e, t, n, r) {
|
|
666
|
+
var o = arguments.length, a = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, s;
|
|
618
667
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
619
|
-
|
|
668
|
+
a = Reflect.decorate(e, t, n, r);
|
|
620
669
|
else
|
|
621
670
|
for (var l = e.length - 1; l >= 0; l--)
|
|
622
|
-
(s = e[l]) && (
|
|
623
|
-
return o > 3 &&
|
|
624
|
-
},
|
|
671
|
+
(s = e[l]) && (a = (o < 3 ? s(a) : o > 3 ? s(t, n, a) : s(t, n)) || a);
|
|
672
|
+
return o > 3 && a && Object.defineProperty(t, n, a), a;
|
|
673
|
+
}, A = function(e, t) {
|
|
625
674
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
626
675
|
return Reflect.metadata(e, t);
|
|
627
676
|
};
|
|
628
|
-
const
|
|
677
|
+
const re = class {
|
|
629
678
|
constructor(e) {
|
|
630
|
-
|
|
679
|
+
k(this, e), this.dateSelected = h(this, "dateSelected", 7), this.monthChanged = h(this, "monthChanged", 7), this.selectableDates = void 0, this.configSettings = void 0, this.themeConfig = void 0, this.selectedDate = void 0, this.selectedLanguage = void 0, this.isLoading = void 0, this.eventDuration = void 0, this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates(), this.disableNextMonthButton = !1;
|
|
631
680
|
}
|
|
632
681
|
configSettingsChanged(e) {
|
|
633
682
|
var o;
|
|
634
|
-
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1),
|
|
635
|
-
if (
|
|
683
|
+
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), n = (o = e == null ? void 0 : e.scheduler) == null ? void 0 : o.available_days_in_future;
|
|
684
|
+
if (n === void 0)
|
|
636
685
|
return;
|
|
637
|
-
|
|
686
|
+
Y(/* @__PURE__ */ new Date(), n).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1;
|
|
638
687
|
}
|
|
639
688
|
selectedLanguageChanged(e) {
|
|
640
689
|
c.changeLanguage(e);
|
|
@@ -645,28 +694,36 @@ const oe = class {
|
|
|
645
694
|
}
|
|
646
695
|
componentWillLoad() {
|
|
647
696
|
}
|
|
697
|
+
componentDidLoad() {
|
|
698
|
+
d("[nylas-date-picker] Component did load"), this.applyThemeConfig(this.themeConfig);
|
|
699
|
+
}
|
|
700
|
+
applyThemeConfig(e) {
|
|
701
|
+
if (e)
|
|
702
|
+
for (const [t, n] of Object.entries(e))
|
|
703
|
+
this.host.style.setProperty(`${t}`, n);
|
|
704
|
+
}
|
|
648
705
|
getDates() {
|
|
649
|
-
const e =
|
|
706
|
+
const e = he(this.month), t = me(this.month);
|
|
650
707
|
return H.range(H.offset(t, -t.getDay()), H.offset(e, 7 - e.getDay()));
|
|
651
708
|
}
|
|
652
709
|
selectDate(e) {
|
|
653
710
|
this.dateSelected.emit(e);
|
|
654
711
|
}
|
|
655
712
|
changeMonth(e) {
|
|
656
|
-
var o,
|
|
713
|
+
var o, a;
|
|
657
714
|
this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1);
|
|
658
|
-
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1),
|
|
659
|
-
|
|
715
|
+
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), n = (a = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : a.available_days_in_future;
|
|
716
|
+
Y(/* @__PURE__ */ new Date(), n).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1, this.dates = this.getDates(), this.monthChanged.emit(this.month);
|
|
660
717
|
}
|
|
661
|
-
isSelected(e, t,
|
|
662
|
-
return e && t && E(e, t) &&
|
|
718
|
+
isSelected(e, t, n) {
|
|
719
|
+
return e && t && E(e, t) && n && (n == null ? void 0 : n.length) > 0;
|
|
663
720
|
}
|
|
664
721
|
isDisabled(e, t) {
|
|
665
|
-
return e && (t == null ? void 0 : t.find((
|
|
722
|
+
return e && (t == null ? void 0 : t.find((n) => E(n, e))) === void 0;
|
|
666
723
|
}
|
|
667
724
|
render() {
|
|
668
|
-
var e, t,
|
|
669
|
-
return
|
|
725
|
+
var e, t, n, r, o, a, s;
|
|
726
|
+
return i(b, { key: "ffb13b5ab2b96a23232a0e4fce0166cc4e471bc3", part: "ndp" }, i("div", { key: "d617e1e85082cda56f123b915460161003fba8ad", class: "nylas-date-picker" }, i("div", { key: "8b966e5cfa60ec08da307e7537170adcfc04944b", class: "title", part: "ndp__title" }, (e = this.configSettings) != null && e.name ? i("h1", null, (t = this.configSettings) == null ? void 0 : t.name) : ((r = (n = this.configSettings) == null ? void 0 : n.organizer) == null ? void 0 : r.name) && i("h1", null, i("person-icon", null), ((a = (o = this.configSettings) == null ? void 0 : o.organizer) == null ? void 0 : a.name) || "Organizer"), i("p", { key: "ec8dd18ff022b61ac574c1a0bb4c94c4bd51b643" }, i("clock-icon", { key: "8c0685800081b17f4b118938b106af1e291ded09" }), this.eventDuration ? pe(this.eventDuration) : `- ${c.t("time.minutes")}`)), i("div", { key: "9c4e5f5aed7d3350f149115236b1be17ee1b77e7", class: "header flex-row" }, i("h2", { key: "b30d034da321b0e34e93f41fdeddcd5c6890fc9c", part: "ndp__month-header" }, i("strong", { key: "2c45a29ba2d99856262c706e626c7dc43b05380b" }, ue(this.month.toLocaleDateString(void 0, { month: "long" }).toLocaleLowerCase())), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), i("div", { key: "eb086cc81c029c3f2dc12a5c796f4e20e60fef2e", class: "pagination" }, i("button", { key: "aefca223118d1e0c4f908ab325743730a5633d0f", title: "Previous month", onClick: () => this.changeMonth(-1), class: { "chevron-left": !0, button: !0 }, disabled: !((s = this.selectableDates) != null && s.length) || this.month <= /* @__PURE__ */ new Date(), part: "ndp__month-button" }, i("chevron-icon", { key: "04e6c8e8dd6fa33805e19a97cc56aff0355bacd1" })), i("button", { key: "912568ecbc76504f9e917042edc7dd41ccfb51fa", title: "Next month", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: this.disableNextMonthButton, part: "ndp__month-button" }, i("chevron-icon", { key: "25efda159f4cd761012ee2143690c37cf9247f66" })))), i("div", { key: "4c0d4d94cce9d758e8dd52d4e29ec27f21410772", class: "dates" }, [
|
|
670
727
|
c.t("days.sunday"),
|
|
671
728
|
c.t("days.monday"),
|
|
672
729
|
c.t("days.tuesday"),
|
|
@@ -674,20 +731,23 @@ const oe = class {
|
|
|
674
731
|
c.t("days.thursday"),
|
|
675
732
|
c.t("days.friday"),
|
|
676
733
|
c.t("days.saturday")
|
|
677
|
-
].map((l) =>
|
|
734
|
+
].map((l) => i("div", { class: "day", part: "ndp__day" }, l)), this.dates.map((l, g) => {
|
|
678
735
|
var f;
|
|
679
736
|
const m = this.isDisabled(l, this.selectableDates);
|
|
680
|
-
return this.isLoading ?
|
|
737
|
+
return this.isLoading ? i("button", { disabled: !0, class: {
|
|
681
738
|
"date day-skeleton": !0,
|
|
682
|
-
"current-month":
|
|
683
|
-
}, style: { animationDelay: `${
|
|
739
|
+
"current-month": P(l, this.month)
|
|
740
|
+
}, style: { animationDelay: `${g * 20}ms` }, part: "ndp__date ndp__date--disabled" }, l.getDate()) : i("button", { class: {
|
|
684
741
|
date: !0,
|
|
685
742
|
selected: !!(this.selectedDate && E(l, this.selectedDate) && this.selectableDates && ((f = this.selectableDates) == null ? void 0 : f.length) > 0),
|
|
686
743
|
"current-day": E(l, /* @__PURE__ */ new Date()),
|
|
687
|
-
"current-month":
|
|
688
|
-
}, "aria-lang": l.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: m, onClick: () => this.selectDate(l), part: `ndp__date ${this.isSelected(l, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${E(l, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${
|
|
744
|
+
"current-month": P(l, this.month)
|
|
745
|
+
}, "aria-lang": l.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: m, onClick: () => this.selectDate(l), part: `ndp__date ${this.isSelected(l, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${E(l, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${P(l, this.month) ? "ndp__date--current-month" : ""}` }, l.getDate());
|
|
689
746
|
}))));
|
|
690
747
|
}
|
|
748
|
+
get host() {
|
|
749
|
+
return _(this);
|
|
750
|
+
}
|
|
691
751
|
static get watchers() {
|
|
692
752
|
return {
|
|
693
753
|
configSettings: ["configSettingsChanged"],
|
|
@@ -695,7 +755,7 @@ const oe = class {
|
|
|
695
755
|
};
|
|
696
756
|
}
|
|
697
757
|
};
|
|
698
|
-
|
|
758
|
+
Me([
|
|
699
759
|
x({
|
|
700
760
|
name: "nylas-date-picker",
|
|
701
761
|
stateToProps: /* @__PURE__ */ new Map([
|
|
@@ -714,29 +774,30 @@ Pe([
|
|
|
714
774
|
d("nylas-date-picker", "monthChanged", e.detail);
|
|
715
775
|
}
|
|
716
776
|
},
|
|
777
|
+
localPropsToProp: /* @__PURE__ */ new Map([["themeConfig", "themeConfig"]]),
|
|
717
778
|
fireRegisterEvent: !0
|
|
718
779
|
}),
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
],
|
|
723
|
-
|
|
724
|
-
const
|
|
725
|
-
var
|
|
726
|
-
var o = arguments.length,
|
|
780
|
+
A("design:type", Function),
|
|
781
|
+
A("design:paramtypes", []),
|
|
782
|
+
A("design:returntype", void 0)
|
|
783
|
+
], re.prototype, "render", null);
|
|
784
|
+
re.style = Fe;
|
|
785
|
+
const Oe = ":host{display:block}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;border-left:none;border-right:none;color:var(--nylas-base-50);font-size:14px;font-weight:600;cursor:pointer;transition:all 0.2s ease-in-out;font-family:inherit}@media screen and (max-width: 768px){.nylas-locale-switch{font-size:16px}}.select-wrapper{display:flex;align-items:center;gap:0.5rem}select{border:none;background:transparent;cursor:pointer;outline:none;background-color:transparent;margin:0 0 1px;padding:4px;vertical-align:middle}select#timezone{width:140px}select#language{width:80px}span.timezone-label{display:flex;width:-webkit-fill-available;justify-content:space-between}select-dropdown{width:auto}select-dropdown::part(sd_dropdown-button){border:none;padding:10px}select-dropdown::part(sd_dropdown-content){max-width:306px}", $e = Oe;
|
|
786
|
+
var Ne = function(e, t, n, r) {
|
|
787
|
+
var o = arguments.length, a = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, s;
|
|
727
788
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
728
|
-
|
|
789
|
+
a = Reflect.decorate(e, t, n, r);
|
|
729
790
|
else
|
|
730
791
|
for (var l = e.length - 1; l >= 0; l--)
|
|
731
|
-
(s = e[l]) && (
|
|
732
|
-
return o > 3 &&
|
|
733
|
-
},
|
|
792
|
+
(s = e[l]) && (a = (o < 3 ? s(a) : o > 3 ? s(t, n, a) : s(t, n)) || a);
|
|
793
|
+
return o > 3 && a && Object.defineProperty(t, n, a), a;
|
|
794
|
+
}, q = function(e, t) {
|
|
734
795
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
735
796
|
return Reflect.metadata(e, t);
|
|
736
797
|
};
|
|
737
|
-
const
|
|
798
|
+
const se = class {
|
|
738
799
|
constructor(e) {
|
|
739
|
-
|
|
800
|
+
k(this, e), this.timezoneChanged = h(this, "timezoneChanged", 7), this.languageChanged = h(this, "languageChanged", 7), this.themeConfig = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = navigator.language;
|
|
740
801
|
}
|
|
741
802
|
connectedCallback() {
|
|
742
803
|
}
|
|
@@ -744,6 +805,14 @@ const re = class {
|
|
|
744
805
|
}
|
|
745
806
|
componentWillLoad() {
|
|
746
807
|
}
|
|
808
|
+
componentDidLoad() {
|
|
809
|
+
d("[nylas-locale-switch] Component did load"), this.applyThemeConfig(this.themeConfig);
|
|
810
|
+
}
|
|
811
|
+
applyThemeConfig(e) {
|
|
812
|
+
if (e)
|
|
813
|
+
for (const [t, n] of Object.entries(e))
|
|
814
|
+
this.host.style.setProperty(`${t}`, n);
|
|
815
|
+
}
|
|
747
816
|
changeTimezone(e) {
|
|
748
817
|
this.selectedTimezone = e, this.timezoneChanged.emit(e);
|
|
749
818
|
}
|
|
@@ -751,41 +820,44 @@ const re = class {
|
|
|
751
820
|
this.selectedLanguage = e, this.languageChanged.emit(e);
|
|
752
821
|
}
|
|
753
822
|
nylasFormDropdownChangedHandler(e) {
|
|
754
|
-
const { name: t, value:
|
|
755
|
-
t === "timezone" ? this.changeTimezone(
|
|
823
|
+
const { name: t, value: n } = e.detail;
|
|
824
|
+
t === "timezone" ? this.changeTimezone(n) : t === "language" && this.changeLanguage(n);
|
|
756
825
|
}
|
|
757
826
|
getTimezoneLabelHTML(e) {
|
|
758
|
-
const t =
|
|
759
|
-
return
|
|
827
|
+
const t = ge(e);
|
|
828
|
+
return i("span", { class: "timezone-label", style: {
|
|
760
829
|
display: "flex",
|
|
761
830
|
alignItems: "center",
|
|
762
831
|
justifyContent: "space-between",
|
|
763
832
|
width: "-webkit-fill-available"
|
|
764
|
-
} }, L[e], " ",
|
|
833
|
+
} }, L[e], " ", i("span", { class: "timezone-offset", style: {
|
|
765
834
|
fontSize: "14px",
|
|
766
835
|
fontWeight: "400",
|
|
767
836
|
color: "var(--nylas-base-500)"
|
|
768
837
|
} }, t));
|
|
769
838
|
}
|
|
770
839
|
render() {
|
|
771
|
-
const e = Object.keys(L).map((
|
|
772
|
-
labelHTML: this.getTimezoneLabelHTML(
|
|
773
|
-
label: L[
|
|
774
|
-
value:
|
|
775
|
-
})), t = Object.keys(
|
|
776
|
-
label:
|
|
777
|
-
value:
|
|
840
|
+
const e = Object.keys(L).map((n) => ({
|
|
841
|
+
labelHTML: this.getTimezoneLabelHTML(n),
|
|
842
|
+
label: L[n],
|
|
843
|
+
value: n
|
|
844
|
+
})), t = Object.keys(J).map((n) => ({
|
|
845
|
+
label: J[n],
|
|
846
|
+
value: n
|
|
778
847
|
}));
|
|
779
|
-
return
|
|
848
|
+
return i(b, { key: "b964a342758e2cc1194249965483843a2f0fd4e8" }, i("div", { key: "3594ab03d8f88d1e073fc20118f424accaf0edfe", class: "nylas-locale-switch", part: "nls" }, i("div", { key: "33d4ea2773393f7ff9f3c1db27f280f7291e840b", class: {
|
|
780
849
|
"select-wrapper": !0,
|
|
781
850
|
timezone: !0
|
|
782
|
-
}, part: "nls__timezone" },
|
|
851
|
+
}, part: "nls__timezone" }, i("select-dropdown", { key: "0b1d65ece722a490eb1dcfc5918e6b88405ec448", name: "timezone", options: e, defaultSelectedOption: e.find((n) => n.value == this.selectedTimezone), exportparts: "sd_dropdown: nls__timezone-dropdown, sd_dropdown-button: nls__timezone-drop-button, sd_dropdown-button-selected-label: nls__timezone-drop-button-selected-label, sd_dropdown-content: nls__timezone-drop-content, sd_dropdown_label: nls__timezone-drop-label" }, i("span", { key: "639c77c9556d6fba35369fcdb1defb7992e56204", slot: "select-icon" }, i("globe-icon", { key: "c6e230b1c1641079f41491a009103ddd2b460dd9", width: "20", height: "20" })))), i("div", { key: "01c9781c4b5f1af16a9bbfa213f13e716eb4fea9", class: {
|
|
783
852
|
"select-wrapper": !0,
|
|
784
853
|
language: !0
|
|
785
|
-
}, part: "nls__language" },
|
|
854
|
+
}, part: "nls__language" }, i("select-dropdown", { key: "fbff35839698dafd06e2cd1b50db27e354c4b9af", name: "language", options: t, defaultSelectedOption: t.find((n) => n.value == this.selectedLanguage), exportparts: "sd_dropdown: nls__language-dropdown, sd_dropdown-button: nls__language-drop-button, sd_dropdown-content: nls__language-drop-content, sd_dropdown_label: nls__language-drop-label" }, i("span", { key: "34ac931dac3ef169b0a6cd778a8a4d6566e8d012", slot: "select-icon" }, i("translate-icon", { key: "d51f2d743bb8ab718f7a7c6b45d62d96fe11f666", width: "20", height: "20" }))))));
|
|
855
|
+
}
|
|
856
|
+
get host() {
|
|
857
|
+
return _(this);
|
|
786
858
|
}
|
|
787
859
|
};
|
|
788
|
-
|
|
860
|
+
Ne([
|
|
789
861
|
x({
|
|
790
862
|
name: "nylas-locale-switch",
|
|
791
863
|
stateToProps: /* @__PURE__ */ new Map([
|
|
@@ -800,25 +872,26 @@ Oe([
|
|
|
800
872
|
d("nylas-locale-switch", "languageChanged", e.detail), t.scheduler.selectLanguage(e.detail);
|
|
801
873
|
}
|
|
802
874
|
},
|
|
875
|
+
localPropsToProp: /* @__PURE__ */ new Map([["themeConfig", "themeConfig"]]),
|
|
803
876
|
fireRegisterEvent: !0
|
|
804
877
|
}),
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
],
|
|
809
|
-
|
|
810
|
-
const
|
|
878
|
+
q("design:type", Function),
|
|
879
|
+
q("design:paramtypes", []),
|
|
880
|
+
q("design:returntype", void 0)
|
|
881
|
+
], se.prototype, "render", null);
|
|
882
|
+
se.style = $e;
|
|
883
|
+
const He = ".sc-nylas-logo-h{display:flex}", Ae = He, qe = class {
|
|
811
884
|
constructor(e) {
|
|
812
|
-
|
|
885
|
+
k(this, e), this.width = "69", this.height = "24";
|
|
813
886
|
}
|
|
814
887
|
render() {
|
|
815
|
-
return
|
|
888
|
+
return i("svg", { key: "12dffc0c444183dfd3bb8593076a6b022de4654b", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("g", { key: "89545db6a2731faffdf62b9f0826211c9827af35", "clip-path": "url(#clip0_455_3543)" }, i("path", { key: "bc169c74819239b2c40b3730a445f45d1a16f445", d: "M15.8092 3.03248C14.6497 1.86996 13.1076 1.23047 11.4646 1.23047C9.82156 1.23047 8.27753 1.86996 7.11999 3.03248L0.835347 9.33381C0.686846 9.4827 0.60498 9.68123 0.60498 9.89312C0.60498 10.105 0.686846 10.3035 0.835347 10.4524C0.983848 10.6013 1.18185 10.6834 1.39318 10.6834C1.60451 10.6834 1.80251 10.6013 1.95101 10.4524L8.23374 4.15111C10.0139 2.36627 12.9134 2.36627 14.6935 4.15111C16.4736 5.93785 16.4756 8.84322 14.6935 10.6281L8.4108 16.9275C8.10428 17.2348 8.10428 17.7368 8.4108 18.0461C8.5593 18.195 8.75731 18.2771 8.96863 18.2771C9.17996 18.2771 9.37796 18.195 9.52646 18.0461L15.8092 11.7467C16.9687 10.5841 17.6064 9.03793 17.6064 7.39053C17.6064 5.74314 16.9687 4.19501 15.8092 3.03439V3.03248Z", fill: "currentColor" }), i("path", { key: "456cd298652217764f8486bca01860c4f1132e58", d: "M14.9296 7.39038C14.9296 6.46074 14.5698 5.58837 13.9148 4.93361C12.5631 3.57828 10.3641 3.57828 9.01239 4.93361L0.663961 13.3023C0.51546 13.4512 0.433594 13.6497 0.433594 13.8616C0.433594 14.0735 0.51546 14.272 0.663961 14.4209C0.812462 14.5698 1.01046 14.6519 1.22179 14.6519C1.43312 14.6519 1.63112 14.5698 1.77962 14.4209L10.0367 6.1515L10.05 6.13623C10.0747 6.10759 10.1014 6.07705 10.128 6.05033C10.1585 6.01978 10.1928 5.99115 10.2251 5.96252L10.2442 5.94534C10.9886 5.31349 12.1119 5.3593 12.8011 6.05033C13.4903 6.74135 13.536 7.78171 12.9705 8.53192L12.9648 8.53955C12.9058 8.61591 12.8544 8.67699 12.8011 8.73044C12.7497 8.78198 12.6906 8.83352 12.6069 8.90033L4.45264 17.0991C4.30414 17.248 4.22227 17.4465 4.22227 17.6584C4.22227 17.8703 4.30414 18.0689 4.45264 18.2177C4.60114 18.3666 4.79914 18.4487 5.01047 18.4487C5.2218 18.4487 5.4198 18.3666 5.5683 18.2177L13.9167 9.84716C14.5698 9.1924 14.9315 8.31812 14.9315 7.39038H14.9296Z", fill: "currentColor" }), i("path", { key: "99e86fdeed7fd4e6440e749884432df26dfe1d37", d: "M10.6821 9.11238C10.4727 9.01694 10.2861 8.88904 10.1281 8.7306C9.97008 8.57216 9.84252 8.38508 9.74733 8.1751L9.69021 8.05103L0.467916 17.2978C0.287049 17.4792 0.174721 17.7082 0.149971 17.9411C0.125221 18.1778 0.19376 18.3897 0.344165 18.5405C0.471724 18.6684 0.65259 18.739 0.850592 18.739C1.11142 18.739 1.37796 18.6207 1.58358 18.4145L10.8059 9.16774L10.6821 9.11047V9.11238Z", fill: "currentColor" }), i("path", { key: "68231e9e8a5f86804d3590ca240bcaf362df1fa6", d: "M68.401 10.6185C68.2126 10.2692 67.9593 9.97334 67.6433 9.73854C67.3235 9.49993 66.956 9.31094 66.5486 9.17541C66.1316 9.03606 65.7033 8.91771 65.2749 8.81844C64.7951 8.70582 64.3039 8.57983 63.8165 8.44811C63.3196 8.31258 62.9065 8.14269 62.5905 7.94225C62.4743 7.88689 62.3391 7.76663 62.3391 7.50129C62.3391 7.39821 62.3639 7.29704 62.4153 7.19587L62.4248 7.18059C62.5352 7.02216 62.7142 6.8828 62.975 6.75109C63.234 6.62128 63.609 6.55829 64.1231 6.55829C64.5286 6.55829 64.877 6.61365 65.1569 6.72436C65.4348 6.83508 65.6652 6.96871 65.8442 7.12524C66.0212 7.27986 66.1659 7.45357 66.2782 7.63873C66.3563 7.76854 66.4267 7.89262 66.4858 8.00525L68.2754 6.84081C68.1669 6.59456 68.0146 6.33495 67.8204 6.0677C67.6033 5.768 67.3254 5.4893 66.9922 5.23732C66.659 4.98534 66.2516 4.77345 65.7813 4.60929C65.3111 4.44512 64.7532 4.36304 64.1231 4.36304C63.3844 4.36304 62.7599 4.46421 62.2706 4.66083C61.7813 4.85935 61.3815 5.09988 61.0845 5.37667C60.7875 5.65346 60.5628 5.95125 60.4143 6.2605C60.2639 6.57547 60.1611 6.85799 60.1078 7.10233C60.0945 7.18059 60.0812 7.27031 60.0678 7.36767C60.0545 7.4593 60.0469 7.5452 60.0469 7.62537C60.0469 8.13314 60.1745 8.56074 60.4239 8.89671C60.679 9.24222 61.0045 9.53429 61.391 9.76336C61.7813 9.99624 62.2116 10.1852 62.6704 10.3227C63.1388 10.462 63.5862 10.5823 64.0012 10.6796C64.4067 10.777 64.7932 10.8782 65.1531 10.9774C65.5224 11.0786 65.8289 11.2122 66.0631 11.3745C66.2801 11.5425 66.3887 11.7448 66.3887 11.9777C66.3887 12.2278 66.2916 12.4263 66.0993 12.5695C65.9279 12.6954 65.7261 12.7985 65.4958 12.8711C65.273 12.9436 65.0407 12.9913 64.8066 13.0142C64.58 13.0352 64.3915 13.0467 64.2468 13.0467C63.8032 13.0467 63.4224 13.0028 63.1197 12.915C62.8151 12.8272 62.5638 12.7241 62.3734 12.6057C62.1811 12.4874 62.0288 12.3614 61.9222 12.2316C61.8213 12.1094 61.747 12.0082 61.7014 11.9319L61.4957 11.6303L59.708 12.7928C59.8508 13.0161 60.0298 13.2643 60.2392 13.5296C60.4772 13.8293 60.7837 14.1138 61.153 14.3734C61.5224 14.633 61.966 14.8525 62.4724 15.0243C62.9788 15.1961 63.5748 15.282 64.2468 15.282C64.797 15.282 65.2901 15.2324 65.7166 15.137C66.1412 15.0396 66.5162 14.9117 66.8285 14.7552C67.1388 14.6005 67.4015 14.4192 67.6109 14.2149C67.8223 14.0107 67.9974 13.8026 68.1326 13.6003C68.4563 13.1135 68.6409 12.5504 68.6828 11.9262C68.6828 11.4069 68.5876 10.9641 68.401 10.6166V10.6185Z", fill: "currentColor" }), i("path", { key: "80b2550211f60e218c5f52f975a060e3ac4ea84a", d: "M26.3585 4.27905C23.7901 4.27905 21.6997 6.37504 21.6997 8.95017V15.0701H23.9291V8.95017C23.9291 7.6082 25.0181 6.5163 26.3565 6.5163C27.695 6.5163 28.784 7.6082 28.784 8.95017V15.0701H31.0134V8.95017C31.0134 6.37504 28.9229 4.27905 26.3546 4.27905H26.3585Z", fill: "currentColor" }), i("path", { key: "b5db41daab85f0ffd7738f492ede6189237b7d5f", d: "M53.4522 4.27905C50.4251 4.27905 47.9634 6.74728 47.9634 9.78245C47.9634 12.8176 50.427 15.2859 53.4522 15.2859C54.5545 15.2859 55.6188 14.9594 56.5288 14.3409L56.7116 14.2169V15.0682H58.941V9.78245C58.941 6.74728 56.4793 4.27905 53.4522 4.27905ZM53.4522 13.0505C51.655 13.0505 50.1928 11.5845 50.1928 9.78245C50.1928 7.98044 51.655 6.51439 53.4522 6.51439C55.2494 6.51439 56.7116 7.98044 56.7116 9.78245C56.7116 11.5845 55.2494 13.0505 53.4522 13.0505Z", fill: "currentColor" }), i("path", { key: "9fc6c3fe5eb5f86e4e53126c98958f36a128030f", d: "M45.5795 10.6166V0.356201H43.3501V10.6166C43.3501 13.1517 45.3758 15.2228 47.8908 15.2858V13.0486C46.6057 12.9875 45.5795 11.9204 45.5795 10.6166Z", fill: "currentColor" }), i("path", { key: "dcbcc1f9ad3d20c137644553a90ec0afc7f6bdf9", d: "M39.5428 4.4967V10.63C39.5428 11.6761 38.8669 12.621 37.9016 12.9284C37.1249 13.1746 36.3157 13.0486 35.6817 12.5829C35.0592 12.1247 34.6879 11.3917 34.6879 10.6186V4.4967H32.4585V10.5995C32.4585 12.7165 33.8388 14.57 35.8131 15.1084C37.0354 15.4424 38.2995 15.2973 39.3695 14.7037L39.5428 14.6063V14.9747C39.5428 16.2766 38.5166 17.3437 37.2315 17.4067V19.6439C39.7465 19.5809 41.7722 17.5117 41.7722 14.9747V4.4967H39.5428Z", fill: "currentColor" })), i("defs", { key: "569df0349b4a24ea2d0a0bee9788b0b8911dcf39" }, i("clipPath", { key: "7a24bd2f656eba24c53b46b1b65b6ae5ea11c378", id: "clip0_455_3543" }, i("rect", { key: "60a57936d17acf21b9c58a177f17f3ce3fede7f1", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
|
|
816
889
|
}
|
|
817
890
|
};
|
|
818
|
-
qe.style =
|
|
819
|
-
const
|
|
891
|
+
qe.style = Ae;
|
|
892
|
+
const Ve = ':host{display:block;margin-bottom:-12px;width:100%;z-index:1;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.notif{display:flex;padding:17px;align-items:flex-start;justify-content:space-between;gap:16px;border-radius:var(--nylas-border-radius-2x);border:1.5px solid var(--nylas-error);background:var(--nylas-base-0)}@media screen and (max-width: 768px){.notif{width:auto}}.notif .content{display:flex;flex-direction:row;gap:8px}.notif .content .message{font-size:14px;font-weight:400;color:var(--nylas-base-800)}.notif .content .message .title{font-size:16px;font-weight:600;color:var(--nylas-base-950);display:block}.notif .content .message .description{font-size:14px;font-weight:400;color:var(--nylas-base-800);display:block}.notif .content .icon.error{color:var(--nylas-error)}.notif.error{border-color:var(--nylas-error);background:rgb(255, 248, 248)}.notif.warning{border-color:var(--nylas-warning)}.notif.info{border-color:var(--nylas-info)}.notif.success{border-color:var(--nylas-success)}.notif .dismiss-btn{background:none;border:none;color:var(--nylas-base-950);cursor:pointer}', Ze = Ve, Ge = class {
|
|
820
893
|
constructor(e) {
|
|
821
|
-
|
|
894
|
+
k(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
|
|
822
895
|
}
|
|
823
896
|
onError(e) {
|
|
824
897
|
d(`[nylas-notification] Error: ${e.detail.notification.title}`), this.handleNotification(e);
|
|
@@ -860,47 +933,47 @@ const Ae = ':host{display:block;margin-bottom:-12px;width:100%;z-index:1;--nylas
|
|
|
860
933
|
return;
|
|
861
934
|
}
|
|
862
935
|
if (this.notifications = [...this.notifications, { ...e.detail.notification }], e.detail.notification.ttl !== "none") {
|
|
863
|
-
const
|
|
936
|
+
const n = e.detail.notification.ttl ? e.detail.notification.ttl : this.ttl;
|
|
864
937
|
window.setTimeout(() => {
|
|
865
938
|
this.notifications = this.notifications.filter((r) => r.id !== e.detail.notification.id);
|
|
866
|
-
},
|
|
939
|
+
}, n);
|
|
867
940
|
}
|
|
868
941
|
}
|
|
869
942
|
dismissNotification(e) {
|
|
870
943
|
this.notifications = this.notifications.filter((t) => t.id !== e);
|
|
871
944
|
}
|
|
872
945
|
render() {
|
|
873
|
-
return
|
|
946
|
+
return i(b, { key: "03f95b47c77afb69a2696473c2bf8c3f1e1ed44a" }, i(be, { key: "990afe9475e36dbae84a70266ef0b5188d2011de" }, this.notifications.map((e) => i("div", { class: `notif ${e.type}`, key: e.id }, i("div", { class: "content" }, i("span", { class: `icon ${e.type}` }, (e.type === "error" || e.type === "warning") && i("warning-icon", null)), i("span", { class: "message" }, i("span", { class: "title" }, e.title), e.description && i("span", { class: "description" }, e.description))), i("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(e.id) }, i("close-icon", null)))), i("slot", { key: "49a5c13a306626b5bba79c443bb8501fe50c7ea3" })));
|
|
874
947
|
}
|
|
875
948
|
get host() {
|
|
876
|
-
return
|
|
949
|
+
return _(this);
|
|
877
950
|
}
|
|
878
951
|
};
|
|
879
|
-
|
|
880
|
-
const
|
|
881
|
-
var
|
|
882
|
-
var o = arguments.length,
|
|
952
|
+
Ge.style = Ze;
|
|
953
|
+
const We = ":host{display:block}.event-card-wrapper{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 4rem;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.manage-booking-description{border-top:1px solid var(--nylas-base-200)}.manage-booking-description p{font-size:16px;margin:1rem;padding:0.5rem 1rem;font-weight:400;color:var(--nylas-base-800)}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{--dot-color:var(--nylas-base-700)}", Ue = We;
|
|
954
|
+
var Xe = function(e, t, n, r) {
|
|
955
|
+
var o = arguments.length, a = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, s;
|
|
883
956
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
884
|
-
|
|
957
|
+
a = Reflect.decorate(e, t, n, r);
|
|
885
958
|
else
|
|
886
959
|
for (var l = e.length - 1; l >= 0; l--)
|
|
887
|
-
(s = e[l]) && (
|
|
888
|
-
return o > 3 &&
|
|
960
|
+
(s = e[l]) && (a = (o < 3 ? s(a) : o > 3 ? s(t, n, a) : s(t, n)) || a);
|
|
961
|
+
return o > 3 && a && Object.defineProperty(t, n, a), a;
|
|
889
962
|
}, V = function(e, t) {
|
|
890
963
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
891
964
|
return Reflect.metadata(e, t);
|
|
892
965
|
};
|
|
893
|
-
const
|
|
966
|
+
const le = class {
|
|
894
967
|
constructor(e) {
|
|
895
|
-
|
|
968
|
+
k(this, e), this.rejectBookingButtonClicked = h(this, "rejectBookingButtonClicked", 7), this.confirmBookingButtonClicked = h(this, "confirmBookingButtonClicked", 7), this.confirmBookingError = h(this, "confirmBookingError", 7), this.handleConfirmBookingButtonClicked = () => {
|
|
896
969
|
this.action = "confirm";
|
|
897
|
-
const t = (
|
|
898
|
-
this.confirmBookingError.emit(
|
|
970
|
+
const t = (n) => {
|
|
971
|
+
this.confirmBookingError.emit(n);
|
|
899
972
|
};
|
|
900
973
|
this.organizerConfirmationBookingId && !this.isLoading && this.confirmBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host, errorHandler: t });
|
|
901
974
|
}, this.handleRejectBookingButtonClicked = () => {
|
|
902
975
|
this.action = "reject", this.organizerConfirmationBookingId && !this.isLoading && this.rejectBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host });
|
|
903
|
-
}, this.
|
|
976
|
+
}, this.configSettings = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.organizerConfirmationBookingId = void 0, this.selectedLanguage = navigator.language, this.action = null;
|
|
904
977
|
}
|
|
905
978
|
connectedCallback() {
|
|
906
979
|
}
|
|
@@ -910,24 +983,29 @@ const se = class {
|
|
|
910
983
|
d("[nylas-organizer-confirmation-card] Component will load");
|
|
911
984
|
}
|
|
912
985
|
async componentDidLoad() {
|
|
913
|
-
d("[nylas-organizer-confirmation-card] Component did load");
|
|
986
|
+
d("[nylas-organizer-confirmation-card] Component did load"), this.applyThemeConfig(this.themeConfig);
|
|
987
|
+
}
|
|
988
|
+
applyThemeConfig(e) {
|
|
989
|
+
if (e)
|
|
990
|
+
for (const [t, n] of Object.entries(e))
|
|
991
|
+
this.host.style.setProperty(`${t}`, n);
|
|
914
992
|
}
|
|
915
993
|
async resetAction() {
|
|
916
994
|
this.action = null;
|
|
917
995
|
}
|
|
918
996
|
render() {
|
|
919
|
-
var e, t,
|
|
920
|
-
return
|
|
997
|
+
var e, t, n, r, o, a, s, l, g, m, f, u;
|
|
998
|
+
return i(b, { key: "d9ca934419385dcf0917c80e70c3efb3d7b18a02", part: "nmcc" }, i("div", { key: "b5b0a918984758dbf80f3218610537bfbec693e4", class: "event-card-wrapper", part: "nmccc__card" }, i("div", { key: "cd26edd3af7815576337f88b5a76ee1cc9335ec0", class: "calendar-icon" }, i("calendar-check-icon", { key: "3cf29fd30584c2fac6a4e1eecce9e55b8c4beb55" })), i("div", { key: "ecc73f4ceff1887502714daa5034b42754ca1f46", class: "booked-event-header" }, i("h2", { key: "2b3233840408bba3fcb29b631e6329148fdeaeaf", slot: "card-title", part: "nmcc__title" }, !!this.organizerConfirmationBookingId && `${c.t("bookingPendingTitle")}!`)), i("div", { key: "7e85b7a9d30895a2bf319185cb3b5b6856894638", class: "manage-booking-description" }, i("p", { key: "644084700e961abcd2b910dcb0631ebfcfbc2a1c" }, c.t("bookingPendingnDescription"))), i("div", { key: "67a549c866b7ba2137bed4ab4af2da4a9c989f0b", class: {
|
|
921
999
|
footer: !0,
|
|
922
|
-
"no-footer": ((t = (e = this.configSettings) == null ? void 0 : e.scheduler) == null ? void 0 : t.hide_cancellation_options) && ((r = (
|
|
923
|
-
"no-template-cols": ((
|
|
924
|
-
} }, !((m = (
|
|
1000
|
+
"no-footer": ((t = (e = this.configSettings) == null ? void 0 : e.scheduler) == null ? void 0 : t.hide_cancellation_options) && ((r = (n = this.configSettings) == null ? void 0 : n.scheduler) == null ? void 0 : r.hide_rescheduling_options),
|
|
1001
|
+
"no-template-cols": ((a = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : a.hide_cancellation_options) || ((l = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : l.hide_rescheduling_options)
|
|
1002
|
+
} }, !((m = (g = this.configSettings) == null ? void 0 : g.scheduler) != null && m.hide_cancellation_options) && i("button-component", { variant: "destructive", onClick: this.handleRejectBookingButtonClicked, isLoading: this.isLoading && this.action === "reject", part: "nmcc__button-outline nmcc__cancel-cta" }, `${c.t("rejectBookingButton")}`), !((u = (f = this.configSettings) == null ? void 0 : f.scheduler) != null && u.hide_rescheduling_options) && i("button-component", { variant: "basic", onClick: this.handleConfirmBookingButtonClicked, isLoading: this.isLoading && this.action === "confirm", part: "nmcc__button-outline nmcc__reschedule-cta" }, `${c.t("confirmBookingButton")}`))));
|
|
925
1003
|
}
|
|
926
1004
|
get host() {
|
|
927
|
-
return
|
|
1005
|
+
return _(this);
|
|
928
1006
|
}
|
|
929
1007
|
};
|
|
930
|
-
|
|
1008
|
+
Xe([
|
|
931
1009
|
x({
|
|
932
1010
|
name: "nylas-organizer-confirmation-card",
|
|
933
1011
|
stateToProps: /* @__PURE__ */ new Map([
|
|
@@ -941,36 +1019,37 @@ Ue([
|
|
|
941
1019
|
t.scheduler.setReject(e.detail.bookingId);
|
|
942
1020
|
},
|
|
943
1021
|
confirmBookingButtonClicked: async (e, t) => {
|
|
944
|
-
const { host:
|
|
1022
|
+
const { host: n } = e.detail, r = await t.scheduler.updateBooking({
|
|
945
1023
|
bookingId: e.detail.bookingId,
|
|
946
1024
|
status: "confirmed"
|
|
947
1025
|
}), { errorHandler: o } = e.detail;
|
|
948
|
-
o && (!r || "error" in r) && o(r), await
|
|
1026
|
+
o && (!r || "error" in r) && o(r), await n.resetAction();
|
|
949
1027
|
}
|
|
950
1028
|
},
|
|
1029
|
+
localPropsToProp: /* @__PURE__ */ new Map([["themeConfig", "themeConfig"]]),
|
|
951
1030
|
fireRegisterEvent: !0
|
|
952
1031
|
}),
|
|
953
1032
|
V("design:type", Function),
|
|
954
1033
|
V("design:paramtypes", []),
|
|
955
1034
|
V("design:returntype", void 0)
|
|
956
|
-
],
|
|
957
|
-
|
|
958
|
-
const
|
|
959
|
-
var
|
|
960
|
-
var o = arguments.length,
|
|
1035
|
+
], le.prototype, "render", null);
|
|
1036
|
+
le.style = Ue;
|
|
1037
|
+
const Ye = ":host{display:block;position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:16px;font-weight:500}.calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-icon{display:flex;align-items:center;justify-content:center;height:100%}.event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:8px;gap:4px;align-items:center}@media screen and (max-width: 768px){.event-timezone{margin-bottom:16px}}", Je = Ye;
|
|
1038
|
+
var Ke = function(e, t, n, r) {
|
|
1039
|
+
var o = arguments.length, a = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, s;
|
|
961
1040
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
962
|
-
|
|
1041
|
+
a = Reflect.decorate(e, t, n, r);
|
|
963
1042
|
else
|
|
964
1043
|
for (var l = e.length - 1; l >= 0; l--)
|
|
965
|
-
(s = e[l]) && (
|
|
966
|
-
return o > 3 &&
|
|
1044
|
+
(s = e[l]) && (a = (o < 3 ? s(a) : o > 3 ? s(t, n, a) : s(t, n)) || a);
|
|
1045
|
+
return o > 3 && a && Object.defineProperty(t, n, a), a;
|
|
967
1046
|
}, Z = function(e, t) {
|
|
968
1047
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
969
1048
|
return Reflect.metadata(e, t);
|
|
970
1049
|
};
|
|
971
|
-
const
|
|
1050
|
+
const ce = class {
|
|
972
1051
|
constructor(e) {
|
|
973
|
-
|
|
1052
|
+
k(this, e), this.themeConfig = void 0, this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = void 0, this.startTime = "", this.endTime = "";
|
|
974
1053
|
}
|
|
975
1054
|
connectedCallback() {
|
|
976
1055
|
}
|
|
@@ -980,21 +1059,29 @@ const le = class {
|
|
|
980
1059
|
d("[nylas-selected-event-card] Component will load");
|
|
981
1060
|
}
|
|
982
1061
|
async componentDidLoad() {
|
|
983
|
-
var t,
|
|
984
|
-
d("[nylas-selected-event-card] Component did load"), this.selectedDate || console.warn('[nylas-selected-event-card] "selectedDate" prop is not provided.'), this.selectedTimeslot || console.warn('[nylas-selected-event-card] "selectedTimeslot" prop is not provided.');
|
|
1062
|
+
var t, n;
|
|
1063
|
+
d("[nylas-selected-event-card] Component did load"), this.selectedDate || console.warn('[nylas-selected-event-card] "selectedDate" prop is not provided.'), this.selectedTimeslot || console.warn('[nylas-selected-event-card] "selectedTimeslot" prop is not provided.'), this.applyThemeConfig(this.themeConfig);
|
|
985
1064
|
const e = new Intl.DateTimeFormat("en-US", {
|
|
986
1065
|
hour: "2-digit",
|
|
987
1066
|
minute: "2-digit",
|
|
988
1067
|
timeZone: this.selectedTimezone
|
|
989
1068
|
});
|
|
990
|
-
this.startTime = e.format(new Date((t = this.selectedTimeslot) == null ? void 0 : t.start_time)), this.endTime = e.format(new Date((
|
|
1069
|
+
this.startTime = e.format(new Date((t = this.selectedTimeslot) == null ? void 0 : t.start_time)), this.endTime = e.format(new Date((n = this.selectedTimeslot) == null ? void 0 : n.end_time));
|
|
1070
|
+
}
|
|
1071
|
+
applyThemeConfig(e) {
|
|
1072
|
+
if (e)
|
|
1073
|
+
for (const [t, n] of Object.entries(e))
|
|
1074
|
+
this.host.style.setProperty(`${t}`, n);
|
|
991
1075
|
}
|
|
992
1076
|
render() {
|
|
993
1077
|
var e;
|
|
994
|
-
return
|
|
1078
|
+
return i(b, { key: "c4b2a1e10365e172dd1d57516964ead204d7d325", part: "nsec" }, i("div", { key: "9d767e80cdd60e35dc26323e57b32e67b1e45a9d", class: "event-card", part: "nsec__card" }, i("div", { key: "78a16259f9607a95d97b62ece2aebc7807073e43", class: "calendar-icon", part: "nsec__icon" }, i("calendar-icon", { key: "5565b2a4da846fb2e162f773fd06203790487183" })), i("div", { key: "fea99fd65e43b57f6a4e327d65eeb03c787c6a86", class: "nylas-selected-event-card__date", part: "nsec__date" }, this.selectedDate ? K((e = this.selectedDate) == null ? void 0 : e.toLocaleDateString(Q[this.selectedLanguage || navigator.language], { dateStyle: "full", timeZone: this.selectedTimezone })) : "-"), i("div", { key: "25a8f9548d85e37266f146482ec151801829cf4a", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), i("div", { key: "669460a8c5f3f764509c35af5b02e4d678d003e3", class: "event-timezone", part: "nsec__timezone" }, i("globe-icon", { key: "4a0ea54690d4b6cf67bacb86bd8c5c17e8d8f473" }), L[this.selectedTimezone]));
|
|
1079
|
+
}
|
|
1080
|
+
get host() {
|
|
1081
|
+
return _(this);
|
|
995
1082
|
}
|
|
996
1083
|
};
|
|
997
|
-
|
|
1084
|
+
Ke([
|
|
998
1085
|
x({
|
|
999
1086
|
name: "nylas-selected-event-card",
|
|
1000
1087
|
stateToProps: /* @__PURE__ */ new Map([
|
|
@@ -1004,35 +1091,36 @@ Je([
|
|
|
1004
1091
|
["scheduler.selectedLanguage", "selectedLanguage"]
|
|
1005
1092
|
]),
|
|
1006
1093
|
eventToProps: {},
|
|
1094
|
+
localPropsToProp: /* @__PURE__ */ new Map([["themeConfig", "themeConfig"]]),
|
|
1007
1095
|
fireRegisterEvent: !0
|
|
1008
1096
|
}),
|
|
1009
1097
|
Z("design:type", Function),
|
|
1010
1098
|
Z("design:paramtypes", []),
|
|
1011
1099
|
Z("design:returntype", void 0)
|
|
1012
|
-
],
|
|
1013
|
-
|
|
1014
|
-
const
|
|
1015
|
-
var
|
|
1016
|
-
var o = arguments.length,
|
|
1100
|
+
], ce.prototype, "render", null);
|
|
1101
|
+
ce.style = Je;
|
|
1102
|
+
const Qe = ":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.timeslots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .timeslot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}", et = Qe;
|
|
1103
|
+
var tt = function(e, t, n, r) {
|
|
1104
|
+
var o = arguments.length, a = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, s;
|
|
1017
1105
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1018
|
-
|
|
1106
|
+
a = Reflect.decorate(e, t, n, r);
|
|
1019
1107
|
else
|
|
1020
1108
|
for (var l = e.length - 1; l >= 0; l--)
|
|
1021
|
-
(s = e[l]) && (
|
|
1022
|
-
return o > 3 &&
|
|
1109
|
+
(s = e[l]) && (a = (o < 3 ? s(a) : o > 3 ? s(t, n, a) : s(t, n)) || a);
|
|
1110
|
+
return o > 3 && a && Object.defineProperty(t, n, a), a;
|
|
1023
1111
|
}, G = function(e, t) {
|
|
1024
1112
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1025
1113
|
return Reflect.metadata(e, t);
|
|
1026
1114
|
};
|
|
1027
|
-
const
|
|
1115
|
+
const de = class {
|
|
1028
1116
|
constructor(e) {
|
|
1029
|
-
|
|
1030
|
-
t.preventDefault(), d("[nylas-timeslot-picker] Confirm timeslot",
|
|
1117
|
+
k(this, e), this.timeslotSelected = h(this, "timeslotSelected", 7), this.timeslotConfirmed = h(this, "timeslotConfirmed", 7), this.handleConfirmedTimeslot = async (t, n) => {
|
|
1118
|
+
t.preventDefault(), d("[nylas-timeslot-picker] Confirm timeslot", n), this.timeslotConfirmed.emit(n);
|
|
1031
1119
|
}, this.handleMouseEnter = (t) => {
|
|
1032
1120
|
this.hoveredTimeslotIndex = t;
|
|
1033
1121
|
}, this.handleMouseLeave = () => {
|
|
1034
1122
|
this.hoveredTimeslotIndex = -1;
|
|
1035
|
-
}, this.
|
|
1123
|
+
}, this.availability = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedDate = /* @__PURE__ */ new Date(), this.selectedLanguage = void 0, this.times = [], this.hoveredTimeslotIndex = void 0, this.selectedTimeslotIndex = void 0;
|
|
1036
1124
|
}
|
|
1037
1125
|
selectedLanguageChanged(e) {
|
|
1038
1126
|
c.changeLanguage(e);
|
|
@@ -1040,13 +1128,13 @@ const ce = class {
|
|
|
1040
1128
|
selectedDateChanged(e) {
|
|
1041
1129
|
var t;
|
|
1042
1130
|
if (d("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
|
|
1043
|
-
const
|
|
1044
|
-
this.times =
|
|
1131
|
+
const n = (t = this.availability) == null ? void 0 : t.filter((r) => E(r.start_time, e)).map((r) => r);
|
|
1132
|
+
this.times = n || [];
|
|
1045
1133
|
}
|
|
1046
1134
|
}
|
|
1047
1135
|
availabilityChanged(e) {
|
|
1048
1136
|
if (d("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
|
|
1049
|
-
const t = e == null ? void 0 : e.filter((
|
|
1137
|
+
const t = e == null ? void 0 : e.filter((n) => this.selectedDate && E(n.start_time, this.selectedDate)).map((n) => n);
|
|
1050
1138
|
this.times = t || [];
|
|
1051
1139
|
}
|
|
1052
1140
|
}
|
|
@@ -1055,12 +1143,18 @@ const ce = class {
|
|
|
1055
1143
|
disconnectedCallback() {
|
|
1056
1144
|
}
|
|
1057
1145
|
async componentWillLoad() {
|
|
1058
|
-
|
|
1059
|
-
const e = (t = this.availability) == null ? void 0 : t.filter((a) => this.selectedDate && E(a.start_time, this.selectedDate)).map((a) => a);
|
|
1060
|
-
this.times = e || [], d("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
|
|
1146
|
+
d("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
|
|
1061
1147
|
}
|
|
1062
1148
|
async componentDidLoad() {
|
|
1149
|
+
var t;
|
|
1063
1150
|
d("[nylas-timeslot-picker] Component did load");
|
|
1151
|
+
const e = (t = this.availability) == null ? void 0 : t.filter((n) => this.selectedDate && E(n.start_time, this.selectedDate)).map((n) => n);
|
|
1152
|
+
this.times = e || [], this.applyThemeConfig(this.themeConfig);
|
|
1153
|
+
}
|
|
1154
|
+
applyThemeConfig(e) {
|
|
1155
|
+
if (e)
|
|
1156
|
+
for (const [t, n] of Object.entries(e))
|
|
1157
|
+
this.host.style.setProperty(`${t}`, n);
|
|
1064
1158
|
}
|
|
1065
1159
|
getTimeslotId(e, t) {
|
|
1066
1160
|
return `${e.toLocaleDateString()}-${t}`;
|
|
@@ -1081,13 +1175,16 @@ const ce = class {
|
|
|
1081
1175
|
return `${t.format(e.start_time)} - ${t.format(e.end_time)}`;
|
|
1082
1176
|
}
|
|
1083
1177
|
render() {
|
|
1084
|
-
return this.isLoading ?
|
|
1085
|
-
var
|
|
1086
|
-
return
|
|
1178
|
+
return this.isLoading ? i(b, null, i("div", { class: "loading" }, new Array(6).fill(0).map((e, t) => i("div", { class: "timeslot-skeleton", style: { animationDelay: `${t * 20}ms` } })))) : this.availability && this.availability.length === 0 ? i(b, null, i("div", { class: "empty" }, i("span", null, "No dates available"))) : (!this.times || this.times.length === 0) && this.selectedDate ? i(b, null, i("div", { class: "empty" }, i("span", null, "No time slots available for selected date"))) : this.selectedDate ? i(b, { part: "ntp" }, i("div", { class: "time-picker-wrapper" }, i("div", { class: "timeslots" }, this.times.map((e, t) => {
|
|
1179
|
+
var n, r, o, a;
|
|
1180
|
+
return i("button", { part: `ntp__timeslot ${((r = (n = this.selectedTimeslot) == null ? void 0 : n.start_time) == null ? void 0 : r.getTime()) === e.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, "aria-role": "button", class: {
|
|
1087
1181
|
time: !0,
|
|
1088
|
-
selected: typeof this.selectedTimeslot < "u" && ((
|
|
1182
|
+
selected: typeof this.selectedTimeslot < "u" && ((a = (o = this.selectedTimeslot) == null ? void 0 : o.start_time) == null ? void 0 : a.getTime()) === e.start_time.getTime()
|
|
1089
1183
|
}, onClick: () => this.onClickSelectTime(e, t), onMouseEnter: () => this.handleMouseEnter(t), onMouseLeave: () => this.handleMouseLeave() }, this.hoveredTimeslotIndex == t || this.selectedTimeslotIndex == this.getTimeslotId(e.start_time, t) ? this.getTimeSlotLabel(e) : e.start_time.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", timeZone: this.selectedTimezone }));
|
|
1090
|
-
})), this.selectedTimeslot &&
|
|
1184
|
+
})), this.selectedTimeslot && i("div", { class: "footer" }, i("button-component", { variant: "primary", onClick: (e) => this.handleConfirmedTimeslot(e, this.selectedTimeslot), part: "ntp__button-primary" }, i("slot", { name: "timeslot-picker-cta-label" }, c.t("nextButton")))))) : i(b, null);
|
|
1185
|
+
}
|
|
1186
|
+
get host() {
|
|
1187
|
+
return _(this);
|
|
1091
1188
|
}
|
|
1092
1189
|
static get watchers() {
|
|
1093
1190
|
return {
|
|
@@ -1097,7 +1194,7 @@ const ce = class {
|
|
|
1097
1194
|
};
|
|
1098
1195
|
}
|
|
1099
1196
|
};
|
|
1100
|
-
|
|
1197
|
+
tt([
|
|
1101
1198
|
x({
|
|
1102
1199
|
name: "nylas-timeslot-picker",
|
|
1103
1200
|
stateToProps: /* @__PURE__ */ new Map([
|
|
@@ -1116,24 +1213,25 @@ et([
|
|
|
1116
1213
|
d("nylas-timeslot-picker", "timeslotConfirmed", e.detail), e.detail && t.scheduler.toggleAdditionalData(!0);
|
|
1117
1214
|
}
|
|
1118
1215
|
},
|
|
1216
|
+
localPropsToProp: /* @__PURE__ */ new Map([["themeConfig", "themeConfig"]]),
|
|
1119
1217
|
fireRegisterEvent: !0
|
|
1120
1218
|
}),
|
|
1121
1219
|
G("design:type", Function),
|
|
1122
1220
|
G("design:paramtypes", []),
|
|
1123
1221
|
G("design:returntype", void 0)
|
|
1124
|
-
],
|
|
1125
|
-
|
|
1222
|
+
], de.prototype, "render", null);
|
|
1223
|
+
de.style = et;
|
|
1126
1224
|
export {
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1225
|
+
ee as nylas_booked_event_card,
|
|
1226
|
+
te as nylas_booking_form,
|
|
1227
|
+
ne as nylas_cancel_booking_form,
|
|
1228
|
+
ie as nylas_cancelled_event_card,
|
|
1131
1229
|
ae as nylas_confirmed_event_card,
|
|
1132
|
-
|
|
1133
|
-
|
|
1230
|
+
re as nylas_date_picker,
|
|
1231
|
+
se as nylas_locale_switch,
|
|
1134
1232
|
qe as nylas_logo,
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1233
|
+
Ge as nylas_notification,
|
|
1234
|
+
le as nylas_organizer_confirmation_card,
|
|
1235
|
+
ce as nylas_selected_event_card,
|
|
1236
|
+
de as nylas_timeslot_picker
|
|
1139
1237
|
};
|