@nylas/react 1.0.2-canary.2 → 1.1.0-canary.10
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_21.entry-125b87a0.js +1719 -0
- package/dist/add-circle-icon_21.entry-1a699a29.cjs +1 -0
- package/dist/{archive-icon_7.entry-0e34d6e7.js → archive-icon_7.entry-70efea56.js} +13 -13
- package/dist/{archive-icon_7.entry-052ac074.cjs → archive-icon_7.entry-a69d3d98.cjs} +1 -1
- package/dist/{arrow-icon.entry-93f21385.cjs → arrow-icon.entry-0a07d7cc.cjs} +1 -1
- package/dist/{arrow-icon.entry-2afd9ea9.js → arrow-icon.entry-c9230436.js} +1 -1
- package/dist/{bold-icon_3.entry-88ce1d25.js → bold-icon_3.entry-54ff7799.js} +7 -7
- package/dist/bold-icon_3.entry-f7df4331.cjs +1 -0
- package/dist/{calendar-cancel-icon.entry-574c8aa4.cjs → calendar-cancel-icon.entry-71cc68e2.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-e9c692fa.js → calendar-cancel-icon.entry-e5157332.js} +1 -1
- package/dist/{calendar-check-icon_2.entry-b0476bca.cjs → calendar-check-icon_2.entry-f02bf0fe.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-d461c713.js → calendar-check-icon_2.entry-f75ef95e.js} +1 -1
- package/dist/{calendar-icon.entry-1ca202a4.js → calendar-icon.entry-67aa69f5.js} +1 -1
- package/dist/{calendar-icon.entry-98936e6d.cjs → calendar-icon.entry-a164e957.cjs} +1 -1
- package/dist/chevron-icon_3.entry-7687ca7a.cjs +1 -0
- package/dist/chevron-icon_3.entry-81c68946.js +117 -0
- package/dist/{close-icon.entry-8d6e9816.cjs → close-icon.entry-147b4d47.cjs} +1 -1
- package/dist/{close-icon.entry-37e8361f.js → close-icon.entry-3325a08e.js} +1 -1
- package/dist/{constants-b6bf6671-49a0f1f2.js → constants-f34b9c6e-21ac1910.js} +11 -2
- package/dist/{constants-b6bf6671-27e2557d.cjs → constants-f34b9c6e-99030371.cjs} +2 -2
- package/dist/{document-refresh-icon.entry-faea08ce.js → document-refresh-icon.entry-1b076630.js} +1 -1
- package/dist/{document-refresh-icon.entry-fcb33921.cjs → document-refresh-icon.entry-dea23e07.cjs} +1 -1
- package/dist/elements/index.d.ts +8 -0
- package/dist/{elements-dc5b338e-81a0319c.cjs → elements-dc5b338e-83c23e9b.cjs} +1 -1
- package/dist/{elements-dc5b338e-fb5dbfb5.js → elements-dc5b338e-c69d1f8a.js} +1 -1
- package/dist/focus-visible-e8093c16-3082af2c.cjs +1 -0
- package/dist/{focus-visible-e8093c16-28fc08a0.js → focus-visible-e8093c16-a6aff071.js} +5 -3
- package/dist/{forward-icon_6.entry-8da1f65d.js → forward-icon_6.entry-55fce1ca.js} +9 -11
- package/dist/forward-icon_6.entry-59c7a975.cjs +3 -0
- package/dist/{globe-icon.entry-4720304b.js → globe-icon.entry-25145785.js} +1 -1
- package/dist/{globe-icon.entry-90a0b9c9.cjs → globe-icon.entry-904f180f.cjs} +1 -1
- package/dist/google-logo-icon_4.entry-1f7b9522.js +387 -0
- package/dist/google-logo-icon_4.entry-feb7a561.cjs +1 -0
- package/dist/index-5f0940e0.cjs +37 -0
- package/dist/index-fd39ea9d.js +4042 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.es-be19d2df-9ba9a7a6.cjs +7 -0
- package/dist/{index-10914bc1-346f04fa.js → index.es-be19d2df-ff4f0a10.js} +945 -1041
- package/dist/{info-icon_2.entry-9307db18.js → info-icon_2.entry-0e2105da.js} +3 -3
- package/dist/{info-icon_2.entry-81e95048.cjs → info-icon_2.entry-808e6516.cjs} +1 -1
- package/dist/loading-icon.entry-17efa7ca.cjs +1 -0
- package/dist/loading-icon.entry-a3b845bf.js +15 -0
- package/dist/{mailbox-store-e721b17c-cf9a43dd.js → mailbox-store-76540d24-5f0d1dff.js} +121 -59
- package/dist/mailbox-store-76540d24-ad0e366a.cjs +1 -0
- package/dist/{nylas-additional-participants.entry-1653dec7.js → nylas-additional-participants.entry-4120ea2e.js} +13 -15
- package/dist/nylas-additional-participants.entry-7e2446cb.cjs +1 -0
- package/dist/nylas-booked-event-card_10.entry-44812e35.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-aa971e8a.js → nylas-booked-event-card_10.entry-5e87b199.js} +294 -273
- package/dist/nylas-custom-booking-flow.entry-cbff44c8.js +106 -0
- package/dist/nylas-custom-booking-flow.entry-da5e66bb.cjs +1 -0
- package/dist/{nylas-form-card.entry-c4e78f88.js → nylas-form-card.entry-1c608edd.js} +13 -15
- package/dist/nylas-form-card.entry-2e629e36.cjs +1 -0
- package/dist/nylas-if-state.entry-2c0d8724.js +94 -0
- package/dist/nylas-if-state.entry-61771f3d.cjs +1 -0
- package/dist/{nylas-list-folders.entry-995fa819.js → nylas-list-folders.entry-d6e085b0.js} +6 -8
- package/dist/nylas-list-folders.entry-fa8e8ce9.cjs +1 -0
- package/dist/{nylas-list-threads.entry-21466eb3.js → nylas-list-threads.entry-4dd2de0a.js} +5 -7
- package/dist/nylas-list-threads.entry-99fc0baa.cjs +1 -0
- package/dist/nylas-login.entry-0ec0813c.cjs +1 -0
- package/dist/nylas-login.entry-6730e226.js +73 -0
- package/dist/{nylas-mailbox-pagination.entry-02d40186.js → nylas-mailbox-pagination.entry-5310880c.js} +7 -9
- package/dist/nylas-mailbox-pagination.entry-e3e52f42.cjs +1 -0
- package/dist/{nylas-mailbox-toolbar-button.entry-dbad44b4.js → nylas-mailbox-toolbar-button.entry-028075db.js} +15 -17
- package/dist/nylas-mailbox-toolbar-button.entry-4c377337.cjs +1 -0
- package/dist/nylas-mailbox.entry-87304850.cjs +1 -0
- package/dist/nylas-mailbox.entry-ab92780c.js +134 -0
- package/dist/nylas-provider.entry-3fb60fe4.cjs +1 -0
- package/dist/{nylas-provider.entry-bbee8c99.js → nylas-provider.entry-678a9fe7.js} +48 -58
- package/dist/nylas-scheduler-editor.entry-a0de0ae6.js +2269 -0
- package/dist/nylas-scheduler-editor.entry-cf19391e.cjs +7 -0
- package/dist/nylas-scheduling.entry-d8bb2648.cjs +1 -0
- package/dist/nylas-scheduling.entry-e38c3870.js +248 -0
- package/dist/nylas-threads-refresh.entry-79c8a061.cjs +1 -0
- package/dist/{nylas-threads-refresh.entry-414d8740.js → nylas-threads-refresh.entry-fcb2175f.js} +2 -4
- package/dist/{nylas-threads-search.entry-a19dc90f.js → nylas-threads-search.entry-7565bdf8.js} +13 -15
- package/dist/nylas-threads-search.entry-f2d5d0fb.cjs +1 -0
- package/dist/{nylas-view-thread.entry-38149162.js → nylas-view-thread.entry-1772e0c4.js} +10 -12
- package/dist/nylas-view-thread.entry-6a2ccece.cjs +1 -0
- package/dist/{people-icon.entry-4b682757.cjs → people-icon.entry-3218a267.cjs} +1 -1
- package/dist/{people-icon.entry-5c244c8d.js → people-icon.entry-bc2c70cf.js} +5 -5
- package/dist/play-icon_2.entry-450a7fa6.cjs +1 -0
- package/dist/play-icon_2.entry-b4dc4e6d.js +25 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +88 -78
- package/dist/{refresh-icon.entry-59fff3d4.cjs → refresh-icon.entry-030dda82.cjs} +1 -1
- package/dist/{refresh-icon.entry-63456c9a.js → refresh-icon.entry-d30c7264.js} +5 -5
- package/dist/register-component-83e24412-0b25de7f.cjs +1 -0
- package/dist/{register-component-d056a880-f3003d6c.js → register-component-83e24412-35c484c4.js} +37 -33
- package/dist/scheduler-config-store-ec3b6190-6d8cef0f.cjs +1 -0
- package/dist/scheduler-config-store-ec3b6190-d5edbae5.js +23 -0
- package/dist/scheduler-store-8ca9003d-38cca5ba.js +321 -0
- package/dist/scheduler-store-8ca9003d-c2aa3522.cjs +1 -0
- package/dist/time-period-selector.entry-b366ba86.js +76 -0
- package/dist/time-period-selector.entry-b3d04e93.cjs +1 -0
- package/dist/{translate-icon.entry-1784c18e.cjs → translate-icon.entry-03ab2513.cjs} +1 -1
- package/dist/{translate-icon.entry-35999e70.js → translate-icon.entry-b3c21ae9.js} +5 -5
- package/dist/warning-icon.entry-602d459b.js +15 -0
- package/dist/{warning-icon.entry-3a702d1d.cjs → warning-icon.entry-65ecfdf0.cjs} +1 -1
- package/package.json +3 -3
- package/dist/_commonjsHelpers-57e89916-4a3ae7d8.cjs +0 -1
- package/dist/_commonjsHelpers-57e89916-af061c86.js +0 -19
- package/dist/add-circle-icon_18.entry-b66b6343.cjs +0 -1
- package/dist/add-circle-icon_18.entry-f86ae88d.js +0 -1527
- package/dist/auth-store-69ac49c7-5a0bbb90.cjs +0 -1
- package/dist/auth-store-69ac49c7-cbfda055.js +0 -66
- package/dist/bold-icon_3.entry-8f55a9e7.cjs +0 -1
- package/dist/chevron-icon_3.entry-830f52c2.js +0 -105
- package/dist/chevron-icon_3.entry-f7801467.cjs +0 -1
- package/dist/focus-visible-e8093c16-f380b705.cjs +0 -1
- package/dist/forward-icon_6.entry-c4b37cb1.cjs +0 -3
- package/dist/index-10914bc1-c8c3a2f3.cjs +0 -7
- package/dist/index-457dcf0b.cjs +0 -30
- package/dist/index-ce40ad47.js +0 -1570
- package/dist/loading-icon.entry-06d37ef0.cjs +0 -1
- package/dist/loading-icon.entry-dc518df4.js +0 -15
- package/dist/mailbox-store-e721b17c-4e97e07d.cjs +0 -1
- package/dist/nylas-additional-participants.entry-ff8bf378.cjs +0 -1
- package/dist/nylas-booked-event-card_10.entry-06bc3c51.cjs +0 -1
- package/dist/nylas-editor-tabs.entry-49b5a3ab.cjs +0 -1
- package/dist/nylas-editor-tabs.entry-9d0959bf.js +0 -181
- package/dist/nylas-form-card.entry-69d2095b.cjs +0 -1
- package/dist/nylas-if-state_3.entry-2eb3f385.js +0 -293
- package/dist/nylas-if-state_3.entry-5baf6d6f.cjs +0 -1
- package/dist/nylas-list-folders.entry-3b24d92d.cjs +0 -1
- package/dist/nylas-list-threads.entry-fda42ded.cjs +0 -1
- package/dist/nylas-mailbox-pagination.entry-9dcd4901.cjs +0 -1
- package/dist/nylas-mailbox-toolbar-button.entry-d1099fab.cjs +0 -1
- package/dist/nylas-provider.entry-78e2fa30.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-550d3c59.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-8f7ecf3b.js +0 -111
- package/dist/nylas-scheduling.entry-22b5ad07.js +0 -236
- package/dist/nylas-scheduling.entry-30a63738.cjs +0 -1
- package/dist/nylas-threads-refresh.entry-05258b36.cjs +0 -1
- package/dist/nylas-threads-search.entry-ff21fc65.cjs +0 -1
- package/dist/nylas-view-thread.entry-5da81e99.cjs +0 -1
- package/dist/play-icon_2.entry-ccdc6b9c.cjs +0 -1
- package/dist/play-icon_2.entry-f36d6d55.js +0 -25
- package/dist/register-component-d056a880-2be11c56.cjs +0 -1
- package/dist/scheduler-config-store-4d035001-0256b40c.cjs +0 -1
- package/dist/scheduler-config-store-4d035001-db9dc78a.js +0 -33
- package/dist/scheduler-store-0fbe642c-14466305.js +0 -293
- package/dist/scheduler-store-0fbe642c-410fdbf4.cjs +0 -1
- package/dist/utils-0cd66d04-89ab163d.js +0 -2111
- package/dist/utils-0cd66d04-94b9c3b6.cjs +0 -8
- package/dist/warning-icon.entry-73de08c3.js +0 -15
|
@@ -1,34 +1,39 @@
|
|
|
1
|
-
import { r as f, c as d, h as
|
|
2
|
-
import { R as
|
|
3
|
-
import {
|
|
4
|
-
import { T as u, g as K, L as F } from "./constants-b6bf6671-49a0f1f2.js";
|
|
1
|
+
import { r as f, c as d, x as q, d as c, h as n, H as b, g as Y, y as X, z as J, k as K, A as m, B as C, F as Q } from "./index-fd39ea9d.js";
|
|
2
|
+
import { R as p } from "./register-component-83e24412-35c484c4.js";
|
|
3
|
+
import { T as u, g as ee, L as O } from "./constants-f34b9c6e-21ac1910.js";
|
|
5
4
|
import "react";
|
|
6
5
|
import "react-dom";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
var o = arguments.length, i = o < 3 ? a : s === null ? s = Object.getOwnPropertyDescriptor(a, n) : s, r;
|
|
6
|
+
const te = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{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 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}.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:1rem;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}.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)}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;padding:8px;font-family:var(--nylas-font-family);font-weight:600;height:48px;line-height:24px}sp-button.cancel{color:var(--nylas-error)}sp-button.cancel:hover,sp-button.cancel:focus{border-color:var(--nylas-error)}sp-button.cancel:active{color:var(--nylas-error-pressed);border-color:var(--nylas-error-pressed)}sp-button.reschedule:hover,sp-button.reschedule:focus{border-color:var(--nylas-primary)}sp-button.reschedule:active{border-color:var(--nylas-base-600)}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}', ae = te;
|
|
7
|
+
var ne = function(e, t, a, s) {
|
|
8
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
|
|
11
9
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
12
|
-
i = Reflect.decorate(e,
|
|
10
|
+
i = Reflect.decorate(e, t, a, s);
|
|
13
11
|
else
|
|
14
12
|
for (var l = e.length - 1; l >= 0; l--)
|
|
15
|
-
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(
|
|
16
|
-
return o > 3 && i && Object.defineProperty(
|
|
17
|
-
}, w = function(e,
|
|
13
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
|
|
14
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
15
|
+
}, w = function(e, t) {
|
|
18
16
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
19
|
-
return Reflect.metadata(e,
|
|
17
|
+
return Reflect.metadata(e, t);
|
|
20
18
|
};
|
|
21
|
-
const
|
|
19
|
+
const F = class {
|
|
22
20
|
constructor(e) {
|
|
23
|
-
f(this, e), this.cancelBookingButtonClicked = d(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = d(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = d(this, "rescheduleBookedEventError", 7), this.handleCancelBookingButtonClicked = () => {
|
|
24
|
-
|
|
21
|
+
f(this, e), this.cancelBookingButtonClicked = d(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = d(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = d(this, "rescheduleBookedEventError", 7), this.cancelBookedEventValidationError = d(this, "cancelBookedEventValidationError", 7), this.handleCancelBookingButtonClicked = () => {
|
|
22
|
+
var o;
|
|
23
|
+
const t = /* @__PURE__ */ new Date(), a = (o = this.configSettings) == null ? void 0 : o.scheduler.min_cancellation_notice, s = q(t, a);
|
|
24
|
+
t.getTime() < s.getTime() ? this.cancelBookedEventValidationError.emit({
|
|
25
|
+
error: {
|
|
26
|
+
title: "Cancellation Error",
|
|
27
|
+
message: `You cannot cancel the booking within ${a} minutes of the event.`
|
|
28
|
+
}
|
|
29
|
+
}) : this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
|
|
25
30
|
}, this.handleRescheduleButtonClicked = () => {
|
|
26
|
-
const
|
|
27
|
-
this.rescheduleBookedEventError.emit(
|
|
31
|
+
const t = (a) => {
|
|
32
|
+
this.rescheduleBookedEventError.emit(a);
|
|
28
33
|
};
|
|
29
|
-
this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler:
|
|
30
|
-
}, this.getOrganizer = (
|
|
31
|
-
switch (
|
|
34
|
+
this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: t });
|
|
35
|
+
}, this.getOrganizer = (t) => t == null ? void 0 : t.organizer, this.getPaticipantType = (t) => {
|
|
36
|
+
switch (t) {
|
|
32
37
|
case "host":
|
|
33
38
|
return "Host";
|
|
34
39
|
case "you":
|
|
@@ -36,7 +41,7 @@ const M = class {
|
|
|
36
41
|
default:
|
|
37
42
|
return "";
|
|
38
43
|
}
|
|
39
|
-
}, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0;
|
|
44
|
+
}, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0, this.configSettings = void 0;
|
|
40
45
|
}
|
|
41
46
|
connectedCallback() {
|
|
42
47
|
}
|
|
@@ -49,26 +54,27 @@ const M = class {
|
|
|
49
54
|
c("[nylas-booked-event-card] Component did load");
|
|
50
55
|
}
|
|
51
56
|
render() {
|
|
52
|
-
var e,
|
|
53
|
-
return
|
|
57
|
+
var e, t, a, s, o, i, r, l, h;
|
|
58
|
+
return n(b, { key: "fd31424392865287d5a696d2ea4a0840974324c1", part: "nbec" }, n("sp-theme", { key: "5e4fab19061fd773200fc8856355d2efc6c7f767", theme: "spectrum", color: "dark", scale: "medium" }, n("div", { key: "5effb33fcc0492a2f968e5b29229a974fb1bf2a3", class: "booked-event-timezone" }, n("globe-icon", { key: "7be37ec8323f0c36112e4a8c5903c2078fe0ae0e" }), u[this.selectedTimezone]), n("div", { key: "594e1cffea71361c2a52f5ed3f480b7fc7a6c0f4", class: "event-card-wrapper", part: "nbec__card" }, n("div", { key: "e2bcea8c2cd100f6291846d29524ee08a2c6d6ad", class: "calendar-icon" }, n("calendar-check-icon", { key: "412d634ebd082474581d8ceba417bcefb45d10eb" })), n("div", { key: "97f9f06776a64a9ceed5f8b7c84ed9d03983e083", class: "booked-event-header" }, n("h2", { key: "7453ad8f16ca9e477a5c6f7791dbf2aa89514394", slot: "card-title", part: "nbec__title" }, "Booking ", this.rescheduleBookingId ? "rescheduled" : "confirmed", "!"), n("div", { key: "5877c31296ad8821c822b8447a9adb495eea9756", part: "nbec__description" }, ((e = this.getOrganizer(this.eventInfo)) == null ? void 0 : e.name) || ((t = this.getOrganizer(this.eventInfo)) == null ? void 0 : t.email), " & ", ((s = (a = this.bookingInfo) == null ? void 0 : a.primaryParticipant) == null ? void 0 : s.name) || ((i = (o = this.bookingInfo) == null ? void 0 : o.primaryParticipant) == null ? void 0 : i.email))), n("sp-divider", { key: "3845e25500160ac43e0c19af3c3c3c446caca39e" }), n("div", { key: "349d849d49be4e71264436c6add7039b889f8933", class: "booking-date-time" }, n("checkmark-circle-icon", { key: "bccea293108ed90eece51494c79c8e5ae2db1411" }), n("h3", { key: "ee98cd2b9c877a7e8342940892ff08be4ee647e0" }, "Booking date and time"), n("p", { key: "1efd072abb08a6606299911e594a07b2de396113" }, new Date((r = this.selectedTimeslot) == null ? void 0 : r.start_time).toLocaleDateString(void 0, { dateStyle: "full" }), " ", n("br", { key: "e014d22678d84c7541854985d945672efde047e9" }), new Date((l = this.selectedTimeslot) == null ? void 0 : l.start_time).toLocaleTimeString(void 0, { timeStyle: "short" }), " -", " ", new Date((h = this.selectedTimeslot) == null ? void 0 : h.end_time).toLocaleTimeString(void 0, { timeStyle: "short" }))), n("div", { key: "0870d9969b572bf688c4c12de934066ed36f421a", class: "booking-participants" }), n("sp-divider", { key: "85674fadb92fc69826e738545a9f9bd1c478d522" }), n("div", { key: "c60007a3d63af3cca707736386f7cbc1d2963626", class: "footer" }, n("sp-button", { key: "f1295268e7f3341e37e7d66d460eabc28ad56482", variant: "secondary", treatment: "outline", class: "cancel", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, "Cancel booking"), n("sp-button", { key: "276674ce1eb225cfb7ea95936e1cb05056b921cc", variant: "secondary", treatment: "outline", class: "reschedule", onClick: this.handleRescheduleButtonClicked, part: "nbec__button-outline nbec__reschedule-cta" }, "Reschedule")))));
|
|
54
59
|
}
|
|
55
60
|
};
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
ne([
|
|
62
|
+
p({
|
|
58
63
|
name: "nylas-booked-event-card",
|
|
59
64
|
stateToProps: /* @__PURE__ */ new Map([
|
|
60
65
|
["scheduler.bookingInfo", "bookingInfo"],
|
|
61
66
|
["scheduler.rescheduleBookingId", "rescheduleBookingId"],
|
|
62
67
|
["scheduler.selectedTimezone", "selectedTimezone"],
|
|
63
|
-
["scheduler.selectedTimeslot", "selectedTimeslot"]
|
|
68
|
+
["scheduler.selectedTimeslot", "selectedTimeslot"],
|
|
69
|
+
["scheduler.configSettings", "configSettings"]
|
|
64
70
|
]),
|
|
65
71
|
eventToProps: {
|
|
66
|
-
cancelBookingButtonClicked: async (e,
|
|
67
|
-
|
|
72
|
+
cancelBookingButtonClicked: async (e, t) => {
|
|
73
|
+
t.scheduler.setCancel(e.detail.bookingId);
|
|
68
74
|
},
|
|
69
|
-
rescheduleButtonClicked: async (e,
|
|
70
|
-
const
|
|
71
|
-
s && (!
|
|
75
|
+
rescheduleButtonClicked: async (e, t) => {
|
|
76
|
+
const a = await t.scheduler.setReschedule(e.detail.bookingId), { errorHandler: s } = e.detail;
|
|
77
|
+
s && (!a || "error" in a) && s(a);
|
|
72
78
|
}
|
|
73
79
|
},
|
|
74
80
|
fireRegisterEvent: !0
|
|
@@ -76,50 +82,50 @@ ae([
|
|
|
76
82
|
w("design:type", Function),
|
|
77
83
|
w("design:paramtypes", []),
|
|
78
84
|
w("design:returntype", void 0)
|
|
79
|
-
],
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
var
|
|
83
|
-
var o = arguments.length, i = o < 3 ?
|
|
85
|
+
], F.prototype, "render", null);
|
|
86
|
+
F.style = ae;
|
|
87
|
+
const ie = ':host{display:block;height:100%;--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}.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:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:10px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{flex-direction:column-reverse}}sp-button{background-color:transparent;color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);--button-width:50%;font-family:var(--nylas-font-family);font-size:16px;font-weight:600;border:none;height:48px;padding:14px}@media screen and (max-width: 768px){sp-button{--button-width:100%}}sp-button:hover,sp-button:focus{background-color:var(--nylas-base-100);color:var(--nylas-primary);border-radius:var(--nylas-border-radius-2x)}sp-button:active{background-color:var(--nylas-base-200);color:var(--nylas-base-800)}sp-button.back{width:var(--button-width);background-color:transparent;color:var(--nylas-base-700);outline:1px solid var(--nylas-base-300)}sp-button.back:hover,sp-button.back:focus{outline-color:var(--nylas-primary)}sp-button.back:active{outline:2px solid var(--nylas-base-600)}sp-button.book{width:var(--button-width);background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.book:hover,sp-button.book:focus{background-color:var(--nylas-base-600)}sp-button.book:active{background-color:var(--nylas-base-800)}.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)}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}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].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].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}', se = ie;
|
|
88
|
+
var re = function(e, t, a, s) {
|
|
89
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
|
|
84
90
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
85
|
-
i = Reflect.decorate(e,
|
|
91
|
+
i = Reflect.decorate(e, t, a, s);
|
|
86
92
|
else
|
|
87
93
|
for (var l = e.length - 1; l >= 0; l--)
|
|
88
|
-
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(
|
|
89
|
-
return o > 3 && i && Object.defineProperty(
|
|
90
|
-
}, _ = function(e,
|
|
94
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
|
|
95
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
96
|
+
}, _ = function(e, t) {
|
|
91
97
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
92
|
-
return Reflect.metadata(e,
|
|
98
|
+
return Reflect.metadata(e, t);
|
|
93
99
|
};
|
|
94
100
|
const E = /^[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])?)*$/, $ = class {
|
|
95
101
|
constructor(e) {
|
|
96
|
-
f(this, e), this.nameChanged = d(this, "nameChanged", 7), this.emailChanged = d(this, "emailChanged", 7), this.backButtonClicked = d(this, "backButtonClicked", 7), this.detailsConfirmed = d(this, "detailsConfirmed", 7), this.bookingFormError = d(this, "bookingFormError", 7), this.handleGuestChange = (
|
|
97
|
-
this.resetGuestEmailError(
|
|
102
|
+
f(this, e), this.nameChanged = d(this, "nameChanged", 7), this.emailChanged = d(this, "emailChanged", 7), this.backButtonClicked = d(this, "backButtonClicked", 7), this.detailsConfirmed = d(this, "detailsConfirmed", 7), this.bookingFormError = d(this, "bookingFormError", 7), this.handleGuestChange = (t, a) => {
|
|
103
|
+
this.resetGuestEmailError(t);
|
|
98
104
|
const s = [...this.guestEmails];
|
|
99
|
-
s[
|
|
100
|
-
}, this.handleGuestBlur = (
|
|
101
|
-
if (this.resetGuestEmailError(
|
|
102
|
-
this.guestEmailErrors[
|
|
105
|
+
s[t] = a, this.guestEmails = [...s];
|
|
106
|
+
}, this.handleGuestBlur = (t, a) => {
|
|
107
|
+
if (this.resetGuestEmailError(t), a === "") {
|
|
108
|
+
this.guestEmailErrors[t] = "Email is required";
|
|
103
109
|
return;
|
|
104
110
|
}
|
|
105
|
-
if (!E.test(
|
|
106
|
-
this.guestEmailErrors[
|
|
111
|
+
if (!E.test(a)) {
|
|
112
|
+
this.guestEmailErrors[t] = "Enter a valid email address";
|
|
107
113
|
return;
|
|
108
114
|
}
|
|
109
|
-
this.handleGuestChange(
|
|
115
|
+
this.handleGuestChange(t, a);
|
|
110
116
|
}, this.addGuestButtonClickedHandler = () => {
|
|
111
117
|
this.guestEmails = [...this.guestEmails, ""];
|
|
112
|
-
}, this.removeGuestButtonClickHandler = (
|
|
113
|
-
|
|
118
|
+
}, this.removeGuestButtonClickHandler = (t, a) => {
|
|
119
|
+
t.preventDefault(), this.resetGuestEmailError(a);
|
|
114
120
|
const s = [...this.guestEmails];
|
|
115
|
-
s.splice(
|
|
121
|
+
s.splice(a, 1), this.guestEmails = [...s];
|
|
116
122
|
}, this.handleBackButtonClicked = () => {
|
|
117
123
|
this.backButtonClicked.emit();
|
|
118
|
-
}, this.bookButtonClickedHandler = async (
|
|
119
|
-
var i, r, l,
|
|
120
|
-
|
|
121
|
-
const
|
|
122
|
-
if (!
|
|
124
|
+
}, this.bookButtonClickedHandler = async (t) => {
|
|
125
|
+
var i, r, l, h, y, P, N;
|
|
126
|
+
t.preventDefault(), c("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
|
|
127
|
+
const a = this.name || ((r = (i = this.bookingInfo) == null ? void 0 : i.primaryParticipant) == null ? void 0 : r.name), s = this.email || ((h = (l = this.bookingInfo) == null ? void 0 : l.primaryParticipant) == null ? void 0 : h.email);
|
|
128
|
+
if (!a || a === "") {
|
|
123
129
|
this.isNameValid = !1, this.validationError.name = "Name is required", this.bookingFormError.emit({
|
|
124
130
|
title: "Booking form error",
|
|
125
131
|
description: "Name is required"
|
|
@@ -143,8 +149,8 @@ const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
143
149
|
let o = [];
|
|
144
150
|
if (this.guestEmails.length > 0) {
|
|
145
151
|
let x = !1;
|
|
146
|
-
if (this.guestEmails.forEach((g,
|
|
147
|
-
g === "" ? (x = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [
|
|
152
|
+
if (this.guestEmails.forEach((g, M) => {
|
|
153
|
+
g === "" ? (x = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [M]: "Email is required" }) : E.test(g) || (x = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [M]: "Enter a valid email address" });
|
|
148
154
|
}), x) {
|
|
149
155
|
this.bookingFormError.emit({
|
|
150
156
|
title: "Booking form error",
|
|
@@ -154,15 +160,15 @@ const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
154
160
|
}
|
|
155
161
|
o = this.guestEmails.map((g) => ({ name: "", email: g.trim() }));
|
|
156
162
|
} else
|
|
157
|
-
(
|
|
163
|
+
(y = this.bookingInfo) != null && y.guests && (o = (P = this.bookingInfo) == null ? void 0 : P.guests);
|
|
158
164
|
this.detailsConfirmed.emit({
|
|
159
165
|
primaryParticipant: {
|
|
160
|
-
name:
|
|
166
|
+
name: a,
|
|
161
167
|
email: s
|
|
162
168
|
},
|
|
163
169
|
guests: o,
|
|
164
170
|
additionalFields: {
|
|
165
|
-
...(
|
|
171
|
+
...(N = this.bookingInfo) == null ? void 0 : N.additionalFields
|
|
166
172
|
}
|
|
167
173
|
});
|
|
168
174
|
}, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.validationError = { name: "", email: "" };
|
|
@@ -172,8 +178,8 @@ const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
172
178
|
disconnectedCallback() {
|
|
173
179
|
}
|
|
174
180
|
componentWillLoad() {
|
|
175
|
-
var e,
|
|
176
|
-
c("nylas-booking-form", "componentWillLoad", this.bookingInfo), this.bookingInfo && (this.name = (e = this.bookingInfo.primaryParticipant) == null ? void 0 : e.name, this.email = (
|
|
181
|
+
var e, t;
|
|
182
|
+
c("nylas-booking-form", "componentWillLoad", this.bookingInfo), this.bookingInfo && (this.name = (e = this.bookingInfo.primaryParticipant) == null ? void 0 : e.name, this.email = (t = this.bookingInfo.primaryParticipant) == null ? void 0 : t.email);
|
|
177
183
|
}
|
|
178
184
|
bookingInfoChangedHandler(e) {
|
|
179
185
|
e && e.primaryParticipant && (this.name = e.primaryParticipant.name, this.email = e.primaryParticipant.email);
|
|
@@ -185,26 +191,26 @@ const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
185
191
|
this.isEmailValid = !0, this.validationError.email = "", this.email = e, this.emailChanged.emit(e);
|
|
186
192
|
}
|
|
187
193
|
resetGuestEmailError(e) {
|
|
188
|
-
const
|
|
189
|
-
delete
|
|
194
|
+
const t = { ...this.guestEmailErrors };
|
|
195
|
+
delete t[e], this.guestEmailErrors = { ...t };
|
|
190
196
|
}
|
|
191
197
|
render() {
|
|
192
|
-
return
|
|
198
|
+
return n(b, { key: "5a255277a21fa84d100bb53d13bb9dce0ce58e24" }, n("form", { key: "19b7aecb9223557f0ff9d4c062968c3242026f0c", onSubmit: (e) => this.bookButtonClickedHandler(e), noValidate: !0 }, n("div", { key: "49276b2a59934eeaeb38c06db6968f957b7b9bee", class: "nylas-booking-form" }, n("slot", { key: "ee0a8c29c1fb6b7273d6a2d3c8cb88180f0e9dbf", name: "custom-booking-form" }, n("div", { key: "662e46f3a7925282f824547a069f52584b94d564", class: "input-wrapper" }, n("label", { key: "a01c1903ee983e1555006ad14e75cd1b2c3036ff", htmlFor: "name", class: { "input-label": !0, error: !this.isNameValid }, part: "nbf__input-label" }, "Name ", n("span", { key: "4729d580bbf9d851c2ac8b686dc826c4e3e4616f", class: "required" }, "*")), n("input", { key: "51754a63345f1d0332a38f646dde6a8a998c8dee", id: "name", type: "text", placeholder: "Enter your name", value: this.name, class: {
|
|
193
199
|
input: !0,
|
|
194
200
|
error: !this.isNameValid
|
|
195
201
|
}, part: "nbf__input-textfield", onInput: (e) => {
|
|
196
|
-
var
|
|
197
|
-
return this.changeName((
|
|
198
|
-
} }),
|
|
202
|
+
var t;
|
|
203
|
+
return this.changeName((t = e.target) == null ? void 0 : t.value);
|
|
204
|
+
} }), n("p", { key: "b8a6660e959a877421bdfffdb87279d8f09123b8", class: "help-text" }, this.validationError.name)), n("div", { key: "e78a74e67abde7e61c1d3c555c234817770a4040", class: "input-wrapper" }, n("label", { key: "d5507037f5c668f58e14031dba4276900ef5ed09", htmlFor: "email", class: { "input-label": !0, error: !this.isEmailValid }, part: "nbf__input-label" }, "Email ", n("span", { key: "514f00587069ac1cfc6d16bfd30750d6d501817d", class: "required" }, "*")), n("input", { key: "0b80ded98b2174f783fa9e7c951a47661aa894f6", id: "email", type: "email", placeholder: "Enter your email", value: this.email, class: {
|
|
199
205
|
input: !0,
|
|
200
206
|
error: !this.isEmailValid
|
|
201
207
|
}, part: "nbf__input-textfield", onInput: (e) => {
|
|
202
|
-
var
|
|
203
|
-
return this.changeEmail((
|
|
204
|
-
} }),
|
|
208
|
+
var t;
|
|
209
|
+
return this.changeEmail((t = e.target) == null ? void 0 : t.value);
|
|
210
|
+
} }), n("p", { key: "ba185ccb2bec87049e94d8c5f8d211a838de0025", class: "help-text" }, this.validationError.email)))), n("div", { key: "56e2cce79371533ad66cccad95a79dd8935fe3eb", class: "cta" }, n("sp-button", { key: "2b6410b3cf2b7634737aa858396290ad065dfcfc", treatment: "outline", variant: "secondary", class: "back", part: "nbf__button-outline", onClick: this.handleBackButtonClicked }, n("slot", { key: "4ba60a2fb3542434ede16ea382ec4ca80cb8d422", name: "booking-form-back-label" }, "Back")), n("sp-button", { key: "49dd32531d7b55529bb73bc82eb0b91820c6ea33", variant: "primary", class: "book", part: "nbf__button-primary", type: "submit" }, this.isLoading && n("loading-icon", { slot: "icon" }), n("slot", { key: "a57ae44c1c3a1b020a110f0156435f27897410c6", name: "booking-form-book-label" }, "Book now")))));
|
|
205
211
|
}
|
|
206
212
|
get host() {
|
|
207
|
-
return
|
|
213
|
+
return Y(this);
|
|
208
214
|
}
|
|
209
215
|
static get watchers() {
|
|
210
216
|
return {
|
|
@@ -212,8 +218,8 @@ const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-
|
|
|
212
218
|
};
|
|
213
219
|
}
|
|
214
220
|
};
|
|
215
|
-
|
|
216
|
-
|
|
221
|
+
re([
|
|
222
|
+
p({
|
|
217
223
|
name: "nylas-booking-form",
|
|
218
224
|
stateToProps: /* @__PURE__ */ new Map([
|
|
219
225
|
["scheduler.isLoading", "isLoading"],
|
|
@@ -221,14 +227,14 @@ ie([
|
|
|
221
227
|
["scheduler.eventInfo", "eventInfo"]
|
|
222
228
|
]),
|
|
223
229
|
eventToProps: {
|
|
224
|
-
backButtonClicked: async (e,
|
|
225
|
-
|
|
230
|
+
backButtonClicked: async (e, t) => {
|
|
231
|
+
t.scheduler.toggleAdditionalData(!1);
|
|
226
232
|
},
|
|
227
|
-
nameChanged: async (e,
|
|
228
|
-
|
|
233
|
+
nameChanged: async (e, t) => {
|
|
234
|
+
t.scheduler.setParticipantName(e.detail);
|
|
229
235
|
},
|
|
230
|
-
emailChanged: async (e,
|
|
231
|
-
|
|
236
|
+
emailChanged: async (e, t) => {
|
|
237
|
+
t.scheduler.setParticipantEmail(e.detail);
|
|
232
238
|
}
|
|
233
239
|
},
|
|
234
240
|
fireRegisterEvent: !0
|
|
@@ -237,36 +243,36 @@ ie([
|
|
|
237
243
|
_("design:paramtypes", []),
|
|
238
244
|
_("design:returntype", void 0)
|
|
239
245
|
], $.prototype, "render", null);
|
|
240
|
-
$.style =
|
|
241
|
-
const
|
|
242
|
-
var
|
|
243
|
-
var o = arguments.length, i = o < 3 ?
|
|
246
|
+
$.style = se;
|
|
247
|
+
const oe = ':host{display:block;width:400px;--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}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;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__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)}.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%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;width:100%;height:48px;padding:8px;line-height:24px;font-family:var(--nylas-font-family)}sp-button.cancel{margin-top:1.25rem;background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.cancel:hover,sp-button.cancel:focus{background-color:var(--nylas-base-600)}sp-button.cancel:active{background-color:var(--nylas-base-800)}sp-button.back{margin-top:0.5rem}sp-button.back:hover,sp-button.back:focus{border-color:var(--nylas-primary)}sp-button.back:active{border-color:var(--nylas-base-600)}sp-field-label{margin-top:1rem;display:flex;color:var(--nylas-base-800);font-size:14px}sp-field-label.error{color:var(--nylas-error)}sp-field-label span.required{color:var(--nylas-error)}sp-textfield{--spectrum-textfield-border-color:var(--nylas-base-300);--spectrum-textfield-icon-color-invalid:var(--nylas-error);position:relative;width:100%;height:48px;margin-bottom:16px;background-color:var(--nylas-base-0);color:var(--nylas-base-500)}sp-textfield.error{--spectrum-textfield-border-color:var(--nylas-error)}sp-help-text{margin:0.25rem 0 1rem 0;color:var(--nylas-error)}', le = oe;
|
|
248
|
+
var ce = function(e, t, a, s) {
|
|
249
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
|
|
244
250
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
245
|
-
i = Reflect.decorate(e,
|
|
251
|
+
i = Reflect.decorate(e, t, a, s);
|
|
246
252
|
else
|
|
247
253
|
for (var l = e.length - 1; l >= 0; l--)
|
|
248
|
-
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(
|
|
249
|
-
return o > 3 && i && Object.defineProperty(
|
|
250
|
-
}, T = function(e,
|
|
254
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
|
|
255
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
256
|
+
}, T = function(e, t) {
|
|
251
257
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
252
|
-
return Reflect.metadata(e,
|
|
258
|
+
return Reflect.metadata(e, t);
|
|
253
259
|
};
|
|
254
260
|
const H = class {
|
|
255
261
|
constructor(e) {
|
|
256
262
|
f(this, e), this.goBackButtonClicked = d(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = d(this, "cancelBookingFormSubmitted", 7), this.cancelBookedEventError = d(this, "cancelBookedEventError", 7), this.cancelBookingFormError = d(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
|
|
257
263
|
this.goBackButtonClicked.emit();
|
|
258
|
-
}, this.handleSubmitCancelBooking = (
|
|
259
|
-
if (
|
|
264
|
+
}, this.handleSubmitCancelBooking = (t) => {
|
|
265
|
+
if (t.preventDefault(), !this.cancellationReason) {
|
|
260
266
|
this.cancellationError = "Please provide a reason for cancellation.", this.cancelBookingFormError.emit({ title: "Cancel booking form error", description: "Please provide a reason for cancellation." });
|
|
261
267
|
return;
|
|
262
268
|
}
|
|
263
269
|
c(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
|
|
264
|
-
const
|
|
270
|
+
const a = (s) => {
|
|
265
271
|
this.cancelBookedEventError.emit(s);
|
|
266
272
|
};
|
|
267
|
-
this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, reason: this.cancellationReason, errorHandler:
|
|
268
|
-
}, this.handleOnChangeCancellationReason = (
|
|
269
|
-
this.cancellationError = "", this.cancellationReason =
|
|
273
|
+
this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, reason: this.cancellationReason, errorHandler: a });
|
|
274
|
+
}, this.handleOnChangeCancellationReason = (t) => {
|
|
275
|
+
this.cancellationError = "", this.cancellationReason = t.target.value;
|
|
270
276
|
}, this.cancelBookingId = void 0, this.cancellationReason = "", this.cancellationError = "";
|
|
271
277
|
}
|
|
272
278
|
connectedCallback() {
|
|
@@ -282,16 +288,16 @@ const H = class {
|
|
|
282
288
|
c("[nylas-cancel-booking-form] Component disconnected");
|
|
283
289
|
}
|
|
284
290
|
render() {
|
|
285
|
-
return
|
|
291
|
+
return n(b, { key: "98dc29d53d8a05beb16dea271cab5c574df4dfd0", part: "ncec" }, n("sp-theme", { key: "04feb774090fb57270a3d3c05576687ec78c230d", theme: "spectrum", scale: "medium" }, n("div", { key: "024a947c805b9f2ab6204a8548e9c775078fa969", class: "nylas-cancel-booking-form", part: "ncec__card" }, n("div", { key: "93295919797719199fbbe6eccdef4e42045c330d", class: "nylas-cancel-booking-form__calendar-icon", part: "ncec__icon" }, n("calendar-cancel-icon", { key: "b8da092aa626ebdef64dd3f2f54ca2df5082d1f3" })), n("h3", { key: "8e33cc23c5bc26aa8e5c979814fa5a398c798237", class: "nylas-cancel-booking-form__title", part: "ncec__title" }, "Cancel booking?"), n("div", { key: "2c8cd37241e6cfe38bb012be4d700ae03c33876e", class: "nylas-cancel-booking-form__description", part: "ncec__description" }, "Your current timeslot will become available to others."), n("form", { key: "be720382bd84086cd8a25279dd4ec58dbfc113e6", onSubmit: this.handleSubmitCancelBooking }, n("sp-field-label", { key: "fadd2793a898975b8ba8da0549bcbb37879a68bf", for: "cancel-reason", class: this.cancellationError ? "error" : "" }, "Reason for cancellation ", n("span", { key: "0748781625ea7ec8332b4ca20eae8986ad9e8efb", class: "required" }, "*")), n("sp-textfield", { key: "e8daf40a5c26b1e6b9b59ab42bbe613da72c987a", id: "cancel-reason", class: this.cancellationError ? "error" : "", part: "ncec__reason-textarea", multiline: !0, value: this.cancellationReason, onInput: this.handleOnChangeCancellationReason, onFocus: this.handleOnChangeCancellationReason, invalid: !!this.cancellationError }, n("sp-help-text", { key: "f876e2f41098845a235fe2b563e85891843d5351", slot: "negative-help-text" }, this.cancellationError)), n("sp-button", { key: "a05211715fda7fa75935c974bd20ce6c6ef4206a", variant: "primary", class: "cancel", type: "submit", part: "ncec__button-cta" }, "Cancel booking"), n("sp-button", { key: "3dd7832e698181eaca4df52835d64c09b664f5f9", variant: "secondary", class: "back", treatment: "outline", part: "ncec__button-outline", onClick: this.handleGoBackClicked }, "Go back")))));
|
|
286
292
|
}
|
|
287
293
|
};
|
|
288
|
-
|
|
289
|
-
|
|
294
|
+
ce([
|
|
295
|
+
p({
|
|
290
296
|
name: "nylas-cancel-booking-form",
|
|
291
297
|
eventToProps: {
|
|
292
|
-
cancelBookingFormSubmitted: async (e,
|
|
293
|
-
const
|
|
294
|
-
s && (!
|
|
298
|
+
cancelBookingFormSubmitted: async (e, t) => {
|
|
299
|
+
const a = await t.scheduler.cancelBooking(e.detail.bookingId), { errorHandler: s } = e.detail;
|
|
300
|
+
s && (!a || "error" in a) && s(a);
|
|
295
301
|
}
|
|
296
302
|
},
|
|
297
303
|
fireRegisterEvent: !0
|
|
@@ -300,25 +306,29 @@ oe([
|
|
|
300
306
|
T("design:paramtypes", []),
|
|
301
307
|
T("design:returntype", void 0)
|
|
302
308
|
], H.prototype, "render", null);
|
|
303
|
-
H.style =
|
|
304
|
-
const
|
|
305
|
-
var
|
|
306
|
-
var o = arguments.length, i = o < 3 ?
|
|
309
|
+
H.style = le;
|
|
310
|
+
const de = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancelled-event-card{display:flex;align-items:center;flex-direction:column;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%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:1rem;height:48px;padding:8px;line-height:24px;width:100%}sp-button:hover,sp-button:focus{border-color:var(--nylas-primary)}sp-button:active{border-color:var(--nylas-base-600)}', be = de;
|
|
311
|
+
var fe = function(e, t, a, s) {
|
|
312
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
|
|
307
313
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
308
|
-
i = Reflect.decorate(e,
|
|
314
|
+
i = Reflect.decorate(e, t, a, s);
|
|
309
315
|
else
|
|
310
316
|
for (var l = e.length - 1; l >= 0; l--)
|
|
311
|
-
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(
|
|
312
|
-
return o > 3 && i && Object.defineProperty(
|
|
313
|
-
}, D = function(e,
|
|
317
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
|
|
318
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
319
|
+
}, D = function(e, t) {
|
|
314
320
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
315
|
-
return Reflect.metadata(e,
|
|
321
|
+
return Reflect.metadata(e, t);
|
|
316
322
|
};
|
|
317
323
|
const Z = class {
|
|
318
324
|
constructor(e) {
|
|
319
|
-
f(this, e), this.closeCancelEventCardClicked = d(this, "closeCancelEventCardClicked", 7), this.handleCloseClicked = () => {
|
|
320
|
-
this.
|
|
321
|
-
|
|
325
|
+
f(this, e), this.closeCancelEventCardClicked = d(this, "closeCancelEventCardClicked", 7), this.cancelledEventCardError = d(this, "cancelledEventCardError", 7), this.handleCloseClicked = () => {
|
|
326
|
+
this.isClosing = !0;
|
|
327
|
+
const t = (a) => {
|
|
328
|
+
this.cancelledEventCardError.emit(a), this.isClosing = !1;
|
|
329
|
+
};
|
|
330
|
+
this.closeCancelEventCardClicked.emit({ errorHandler: t });
|
|
331
|
+
}, this.cancelledEventInfo = void 0, this.isClosing = !1, this.configSettings = void 0;
|
|
322
332
|
}
|
|
323
333
|
connectedCallback() {
|
|
324
334
|
c("[nylas-cancelled-event-card] Component connected");
|
|
@@ -333,37 +343,44 @@ const Z = class {
|
|
|
333
343
|
c("[nylas-cancelled-event-card] Component disconnected");
|
|
334
344
|
}
|
|
335
345
|
render() {
|
|
336
|
-
|
|
346
|
+
var e, t;
|
|
347
|
+
return n(b, { key: "105954b6497f7a8cf45faedb592896629e90c6d0", part: "ncec" }, n("sp-theme", { key: "d248975c2139a611ab60c5c585d87e8701327a4b", theme: "spectrum", color: "dark", scale: "medium" }, n("div", { key: "090b767111679ca9968ac0b128c6685fed6e39db", class: "nylas-cancelled-event-card", part: "ncec__card" }, n("div", { key: "ae1e57f0f2a39f5ad7f4b7b9ed493f3e93ccdeba", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, n("calendar-cancel-icon", { key: "06250b1c0f330957f0f691d0f7724c608dffa28b" })), n("h3", { key: "1826c12ca770476cfd206d9d1a3b80f0d890da56", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, "Your booking has been cancelled successfully!"), n("div", { key: "93c4c7e4ed245372e736c61c30b23e9be11453ec", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, "A cancellation email has been sent to ", ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || "the participants", "."), n("div", { key: "21162d4c4e2ee6c2f95038b0e25e9ad0aed63742", class: "nylas-cancelled-event-card__cta" }, n("sp-button", { key: "ab6cb1da324717c3b375c9280f307a2590224f27", variant: "secondary", treatment: "outline", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? "Closing..." : "Close")))));
|
|
337
348
|
}
|
|
338
349
|
};
|
|
339
|
-
|
|
340
|
-
|
|
350
|
+
fe([
|
|
351
|
+
p({
|
|
341
352
|
name: "nylas-cancelled-event-card",
|
|
342
|
-
|
|
353
|
+
stateToProps: /* @__PURE__ */ new Map([["scheduler.configSettings", "configSettings"]]),
|
|
354
|
+
eventToProps: {
|
|
355
|
+
closeCancelEventCardClicked: async (e, t) => {
|
|
356
|
+
const a = await t.scheduler.resetCancel(), { errorHandler: s } = e.detail;
|
|
357
|
+
s && (!a || "error" in a) && s(a);
|
|
358
|
+
}
|
|
359
|
+
},
|
|
343
360
|
fireRegisterEvent: !0
|
|
344
361
|
}),
|
|
345
362
|
D("design:type", Function),
|
|
346
363
|
D("design:paramtypes", []),
|
|
347
364
|
D("design:returntype", void 0)
|
|
348
365
|
], Z.prototype, "render", null);
|
|
349
|
-
Z.style =
|
|
350
|
-
const z = /* @__PURE__ */ new Date(),
|
|
351
|
-
function k(e,
|
|
366
|
+
Z.style = be;
|
|
367
|
+
const z = /* @__PURE__ */ new Date(), B = /* @__PURE__ */ new Date();
|
|
368
|
+
function k(e, t, a, s) {
|
|
352
369
|
function o(i) {
|
|
353
370
|
return e(i = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+i)), i;
|
|
354
371
|
}
|
|
355
|
-
return o.floor = (i) => (e(i = /* @__PURE__ */ new Date(+i)), i), o.ceil = (i) => (e(i = new Date(i - 1)),
|
|
372
|
+
return o.floor = (i) => (e(i = /* @__PURE__ */ new Date(+i)), i), o.ceil = (i) => (e(i = new Date(i - 1)), t(i, 1), e(i), i), o.round = (i) => {
|
|
356
373
|
const r = o(i), l = o.ceil(i);
|
|
357
374
|
return i - r < l - i ? r : l;
|
|
358
|
-
}, o.offset = (i, r) => (
|
|
359
|
-
const
|
|
375
|
+
}, o.offset = (i, r) => (t(i = /* @__PURE__ */ new Date(+i), r == null ? 1 : Math.floor(r)), i), o.range = (i, r, l) => {
|
|
376
|
+
const h = [];
|
|
360
377
|
if (i = o.ceil(i), l = l == null ? 1 : Math.floor(l), !(i < r) || !(l > 0))
|
|
361
|
-
return
|
|
362
|
-
let
|
|
378
|
+
return h;
|
|
379
|
+
let y;
|
|
363
380
|
do
|
|
364
|
-
|
|
365
|
-
while (
|
|
366
|
-
return
|
|
381
|
+
h.push(y = /* @__PURE__ */ new Date(+i)), t(i, l), e(i);
|
|
382
|
+
while (y < i && i < r);
|
|
383
|
+
return h;
|
|
367
384
|
}, o.filter = (i) => k((r) => {
|
|
368
385
|
if (r >= r)
|
|
369
386
|
for (; e(r), !i(r); )
|
|
@@ -372,46 +389,46 @@ function k(e, a, n, s) {
|
|
|
372
389
|
if (r >= r)
|
|
373
390
|
if (l < 0)
|
|
374
391
|
for (; ++l <= 0; )
|
|
375
|
-
for (;
|
|
392
|
+
for (; t(r, -1), !i(r); )
|
|
376
393
|
;
|
|
377
394
|
else
|
|
378
395
|
for (; --l >= 0; )
|
|
379
|
-
for (;
|
|
396
|
+
for (; t(r, 1), !i(r); )
|
|
380
397
|
;
|
|
381
|
-
}),
|
|
398
|
+
}), a && (o.count = (i, r) => (z.setTime(+i), B.setTime(+r), e(z), e(B), Math.floor(a(z, B))), o.every = (i) => (i = Math.floor(i), !isFinite(i) || !(i > 0) ? null : i > 1 ? o.filter(s ? (r) => s(r) % i === 0 : (r) => o.count(0, r) % i === 0) : o)), o;
|
|
382
399
|
}
|
|
383
|
-
const
|
|
400
|
+
const he = 1e3, A = he * 60, me = A * 60, v = me * 24, L = k(
|
|
384
401
|
(e) => e.setHours(0, 0, 0, 0),
|
|
385
|
-
(e,
|
|
386
|
-
(e,
|
|
402
|
+
(e, t) => e.setDate(e.getDate() + t),
|
|
403
|
+
(e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * A) / v,
|
|
387
404
|
(e) => e.getDate() - 1
|
|
388
405
|
);
|
|
389
406
|
k((e) => {
|
|
390
407
|
e.setUTCHours(0, 0, 0, 0);
|
|
391
|
-
}, (e,
|
|
392
|
-
e.setUTCDate(e.getUTCDate() +
|
|
393
|
-
}, (e,
|
|
408
|
+
}, (e, t) => {
|
|
409
|
+
e.setUTCDate(e.getUTCDate() + t);
|
|
410
|
+
}, (e, t) => (t - e) / v, (e) => e.getUTCDate() - 1);
|
|
394
411
|
k((e) => {
|
|
395
412
|
e.setUTCHours(0, 0, 0, 0);
|
|
396
|
-
}, (e,
|
|
397
|
-
e.setUTCDate(e.getUTCDate() +
|
|
398
|
-
}, (e,
|
|
399
|
-
const
|
|
400
|
-
var
|
|
401
|
-
var o = arguments.length, i = o < 3 ?
|
|
413
|
+
}, (e, t) => {
|
|
414
|
+
e.setUTCDate(e.getUTCDate() + t);
|
|
415
|
+
}, (e, t) => (t - e) / v, (e) => Math.floor(e / v));
|
|
416
|
+
const pe = ':host{display:block;min-height:444px;--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}@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}@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:1rem}.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)}', ye = pe;
|
|
417
|
+
var ue = function(e, t, a, s) {
|
|
418
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
|
|
402
419
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
403
|
-
i = Reflect.decorate(e,
|
|
420
|
+
i = Reflect.decorate(e, t, a, s);
|
|
404
421
|
else
|
|
405
422
|
for (var l = e.length - 1; l >= 0; l--)
|
|
406
|
-
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(
|
|
407
|
-
return o > 3 && i && Object.defineProperty(
|
|
408
|
-
},
|
|
423
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
|
|
424
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
425
|
+
}, S = function(e, t) {
|
|
409
426
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
410
|
-
return Reflect.metadata(e,
|
|
427
|
+
return Reflect.metadata(e, t);
|
|
411
428
|
};
|
|
412
429
|
const V = class {
|
|
413
430
|
constructor(e) {
|
|
414
|
-
f(this, e), this.dateSelected = d(this, "dateSelected", 7), this.monthChanged = d(this, "monthChanged", 7), this.selectableDates = void 0, this.selectedDate = void 0, this.isLoading = void 0, this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates();
|
|
431
|
+
f(this, e), this.dateSelected = d(this, "dateSelected", 7), this.monthChanged = d(this, "monthChanged", 7), this.selectableDates = void 0, this.selectedDate = void 0, this.configSettings = void 0, this.isLoading = void 0, this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates(), this.disableNextMonthButton = !1;
|
|
415
432
|
}
|
|
416
433
|
connectedCallback() {
|
|
417
434
|
}
|
|
@@ -420,70 +437,74 @@ const V = class {
|
|
|
420
437
|
componentWillLoad() {
|
|
421
438
|
}
|
|
422
439
|
getDates() {
|
|
423
|
-
const e =
|
|
424
|
-
return
|
|
440
|
+
const e = X(this.month), t = J(this.month);
|
|
441
|
+
return L.range(L.offset(t, -t.getDay()), L.offset(e, 7 - e.getDay()));
|
|
425
442
|
}
|
|
426
443
|
selectDate(e) {
|
|
427
444
|
this.dateSelected.emit(e);
|
|
428
445
|
}
|
|
429
446
|
changeMonth(e) {
|
|
430
|
-
|
|
447
|
+
var o, i;
|
|
448
|
+
this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1);
|
|
449
|
+
const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), a = (i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.available_days_in_future;
|
|
450
|
+
K(/* @__PURE__ */ new Date(), a).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1, this.dates = this.getDates(), this.monthChanged.emit(this.month), this.selectDate();
|
|
431
451
|
}
|
|
432
|
-
isSelected(e,
|
|
433
|
-
return e &&
|
|
452
|
+
isSelected(e, t, a) {
|
|
453
|
+
return e && t && m(e, t) && a && (a == null ? void 0 : a.length) > 0;
|
|
434
454
|
}
|
|
435
|
-
isDisabled(e,
|
|
436
|
-
return e && (
|
|
455
|
+
isDisabled(e, t) {
|
|
456
|
+
return e && (t == null ? void 0 : t.find((a) => m(a, e))) === void 0;
|
|
437
457
|
}
|
|
438
458
|
render() {
|
|
439
|
-
var e,
|
|
440
|
-
return
|
|
459
|
+
var e, t;
|
|
460
|
+
return n(b, { key: "fd7de67053417b11844a66e5b978f7feb80efe18", part: "ndp" }, n("div", { key: "a08943851e2239ad12121b90f35760d73a085441", class: "nylas-date-picker" }, n("div", { key: "832ad38012c55eb04ab2c5b0ceb50052ab3edd42", class: "header flex-row" }, n("h2", { key: "2df451227e57dfee081c1d4435443e479cf8871c", part: "ndp__month-header" }, n("strong", { key: "63421dca4b9bf36207ba05e9eff795c7c198287c" }, this.month.toLocaleDateString(void 0, { month: "long" })), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), n("div", { key: "ca982a82d87baf5658674624c1153f14e77470aa", class: "pagination" }, n("button", { key: "d2a41582014f92c23784c71fe1df9834d77fd355", onClick: () => this.changeMonth(-1), class: { "chevron-left": !0, button: !0 }, disabled: !((e = this.selectableDates) != null && e.length) || this.month <= /* @__PURE__ */ new Date(), part: "ndp__month-button" }, n("chevron-icon", { key: "4f319da7e440236edb9bfa711fb0b05cd046dc8e" })), n("button", { key: "ff00426293e1857592ebae58557ea46e5db9858d", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: !((t = this.selectableDates) != null && t.length) || this.disableNextMonthButton, part: "ndp__month-button" }, n("chevron-icon", { key: "7075f5e8da61c9d91fb612771a3d7672f1521b6f" })))), n("div", { key: "3ad884077d163de5182731c03bf856c9e204f411", class: "dates" }, ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"].map((a) => n("div", { class: "day", part: "ndp__day" }, a)), this.dates.map((a, s) => {
|
|
441
461
|
var i;
|
|
442
|
-
const o = this.isDisabled(
|
|
443
|
-
return this.isLoading ?
|
|
462
|
+
const o = this.isDisabled(a, this.selectableDates);
|
|
463
|
+
return this.isLoading ? n("button", { disabled: !0, class: {
|
|
444
464
|
"date day-skeleton": !0,
|
|
445
|
-
"current-month": C(
|
|
446
|
-
}, style: { animationDelay: `${s * 20}ms` }, part: "ndp__date" },
|
|
465
|
+
"current-month": C(a, this.month)
|
|
466
|
+
}, style: { animationDelay: `${s * 20}ms` }, part: "ndp__date" }, a.getDate()) : n("button", { class: {
|
|
447
467
|
date: !0,
|
|
448
|
-
selected: !!(this.selectedDate && m(
|
|
449
|
-
"current-day": m(
|
|
450
|
-
"current-month": C(
|
|
451
|
-
}, "aria-lang":
|
|
468
|
+
selected: !!(this.selectedDate && m(a, this.selectedDate) && this.selectableDates && ((i = this.selectableDates) == null ? void 0 : i.length) > 0),
|
|
469
|
+
"current-day": m(a, /* @__PURE__ */ new Date()),
|
|
470
|
+
"current-month": C(a, this.month)
|
|
471
|
+
}, "aria-lang": a.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: o, onClick: () => this.selectDate(a), part: `ndp__date ${this.isSelected(a, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${m(a, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${C(a, this.month) ? "ndp__date--current-month" : ""}` }, a.getDate());
|
|
452
472
|
}))));
|
|
453
473
|
}
|
|
454
474
|
};
|
|
455
|
-
|
|
456
|
-
|
|
475
|
+
ue([
|
|
476
|
+
p({
|
|
457
477
|
name: "nylas-date-picker",
|
|
458
478
|
stateToProps: /* @__PURE__ */ new Map([
|
|
459
479
|
["scheduler.selectableDates", "selectableDates"],
|
|
460
480
|
["scheduler.selectedDate", "selectedDate"],
|
|
461
|
-
["scheduler.isLoading", "isLoading"]
|
|
481
|
+
["scheduler.isLoading", "isLoading"],
|
|
482
|
+
["scheduler.configSettings", "configSettings"]
|
|
462
483
|
]),
|
|
463
484
|
eventToProps: {
|
|
464
|
-
dateSelected: async (e,
|
|
465
|
-
|
|
485
|
+
dateSelected: async (e, t) => {
|
|
486
|
+
t.scheduler.selectDate(e.detail);
|
|
466
487
|
}
|
|
467
488
|
},
|
|
468
489
|
fireRegisterEvent: !0
|
|
469
490
|
}),
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
491
|
+
S("design:type", Function),
|
|
492
|
+
S("design:paramtypes", []),
|
|
493
|
+
S("design:returntype", void 0)
|
|
473
494
|
], V.prototype, "render", null);
|
|
474
|
-
V.style =
|
|
475
|
-
const
|
|
476
|
-
var
|
|
477
|
-
var o = arguments.length, i = o < 3 ?
|
|
495
|
+
V.style = ye;
|
|
496
|
+
const ge = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;height:68px;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}', ve = ge;
|
|
497
|
+
var ke = function(e, t, a, s) {
|
|
498
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
|
|
478
499
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
479
|
-
i = Reflect.decorate(e,
|
|
500
|
+
i = Reflect.decorate(e, t, a, s);
|
|
480
501
|
else
|
|
481
502
|
for (var l = e.length - 1; l >= 0; l--)
|
|
482
|
-
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(
|
|
483
|
-
return o > 3 && i && Object.defineProperty(
|
|
484
|
-
},
|
|
503
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
|
|
504
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
505
|
+
}, R = function(e, t) {
|
|
485
506
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
486
|
-
return Reflect.metadata(e,
|
|
507
|
+
return Reflect.metadata(e, t);
|
|
487
508
|
};
|
|
488
509
|
const G = class {
|
|
489
510
|
constructor(e) {
|
|
@@ -502,69 +523,69 @@ const G = class {
|
|
|
502
523
|
this.selectedLanguage = e, this.languageChanged.emit(e);
|
|
503
524
|
}
|
|
504
525
|
selectedOptionChangedHandler(e) {
|
|
505
|
-
const { name:
|
|
506
|
-
|
|
526
|
+
const { name: t, value: a } = e.detail;
|
|
527
|
+
t === "timezone" ? this.changeTimezone(a) : t === "language" && this.changeLanguage(a);
|
|
507
528
|
}
|
|
508
529
|
getTimezoneLabelHTML(e) {
|
|
509
|
-
const
|
|
510
|
-
return
|
|
530
|
+
const t = ee(e);
|
|
531
|
+
return n("span", { class: "timezone-label", style: {
|
|
511
532
|
display: "flex",
|
|
512
533
|
alignItems: "center",
|
|
513
534
|
justifyContent: "space-between",
|
|
514
535
|
width: "-webkit-fill-available"
|
|
515
|
-
} }, u[e], " ",
|
|
536
|
+
} }, u[e], " ", n("span", { class: "timezone-offset", style: {
|
|
516
537
|
fontSize: "14px",
|
|
517
538
|
fontWeight: "400",
|
|
518
539
|
color: "var(--nylas-base-500)"
|
|
519
|
-
} },
|
|
540
|
+
} }, t));
|
|
520
541
|
}
|
|
521
542
|
render() {
|
|
522
|
-
const e = Object.keys(u).map((
|
|
523
|
-
labelHTML: this.getTimezoneLabelHTML(
|
|
524
|
-
label: u[
|
|
525
|
-
value:
|
|
526
|
-
})),
|
|
527
|
-
label:
|
|
528
|
-
value:
|
|
543
|
+
const e = Object.keys(u).map((a) => ({
|
|
544
|
+
labelHTML: this.getTimezoneLabelHTML(a),
|
|
545
|
+
label: u[a],
|
|
546
|
+
value: a
|
|
547
|
+
})), t = Object.keys(O).map((a) => ({
|
|
548
|
+
label: O[a],
|
|
549
|
+
value: a
|
|
529
550
|
}));
|
|
530
|
-
return
|
|
551
|
+
return n(b, { key: "688b90cbd1410a8025a8becfd3f979fc854c60a2" }, n("div", { key: "a4f485ce6204d89e16336c93809dbcf5ebf862ef", class: "nylas-locale-switch" }, n("div", { key: "5525e493d2f8e3258a2fe8b4c739db49d7ef1a35", class: {
|
|
531
552
|
"select-wrapper": !0,
|
|
532
553
|
timezone: !0
|
|
533
|
-
} },
|
|
554
|
+
} }, n("select-dropdown", { key: "68f7f48a2cada4cc0c7327431f15384d17ebc261", name: "timezone", options: e, defaultSelectedOption: e.find((a) => a.value == this.selectedTimezone) }, n("span", { key: "d1213a8cba28b2163997cdb4bce7e13d7485e869", slot: "select-icon" }, n("globe-icon", { key: "f11285b20c93a42a0f195f89966bc7ff7b2d7322", width: "20", height: "20" })))), n("div", { key: "0287627954a80ef5092ded694e61ec2a19606667", class: {
|
|
534
555
|
"select-wrapper": !0,
|
|
535
556
|
language: !0
|
|
536
|
-
} },
|
|
557
|
+
} }, n("select-dropdown", { key: "1bd58884de605b22cb6a5631b8e9f960cfa058d4", name: "language", options: t, defaultSelectedOption: t.find((a) => a.value == this.selectedLanguage) }, n("span", { key: "0681b6c8296d60c258c2df3bcb60d895c0e0c533", slot: "select-icon" }, n("translate-icon", { key: "bd3f346f56da2a139c5050799c9e2774d311d72c", width: "20", height: "20" }))))));
|
|
537
558
|
}
|
|
538
559
|
};
|
|
539
|
-
|
|
540
|
-
|
|
560
|
+
ke([
|
|
561
|
+
p({
|
|
541
562
|
name: "nylas-locale-switch",
|
|
542
563
|
stateToProps: /* @__PURE__ */ new Map([
|
|
543
564
|
["scheduler.selectedLanguage", "selectedLanguage"],
|
|
544
565
|
["scheduler.selectedTimezone", "selectedTimezone"]
|
|
545
566
|
]),
|
|
546
567
|
eventToProps: {
|
|
547
|
-
timezoneChanged: async (e,
|
|
548
|
-
|
|
568
|
+
timezoneChanged: async (e, t) => {
|
|
569
|
+
t.scheduler.selectTimezone(e.detail);
|
|
549
570
|
}
|
|
550
571
|
},
|
|
551
572
|
fireRegisterEvent: !0
|
|
552
573
|
}),
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
574
|
+
R("design:type", Function),
|
|
575
|
+
R("design:paramtypes", []),
|
|
576
|
+
R("design:returntype", void 0)
|
|
556
577
|
], G.prototype, "render", null);
|
|
557
|
-
G.style =
|
|
558
|
-
const
|
|
578
|
+
G.style = ve;
|
|
579
|
+
const xe = ".sc-nylas-logo-h{display:flex}", Ce = xe, we = class {
|
|
559
580
|
constructor(e) {
|
|
560
581
|
f(this, e), this.width = "69", this.height = "24";
|
|
561
582
|
}
|
|
562
583
|
render() {
|
|
563
|
-
return
|
|
584
|
+
return n("svg", { key: "5aea87a70e3fd0d4db9231f986662a0e51d5225e", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("g", { key: "635ee7b2cff95d3949dc8a7aba5d7897ac42bec8", "clip-path": "url(#clip0_455_3543)" }, n("path", { key: "818b4ab1d5087f3dbd4b65ec92c46da729b7b034", 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" }), n("path", { key: "0519037016d40d4c264b929f042bffde6fcb4095", 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" }), n("path", { key: "10efd16fe4864b407bed8c54611001c6a0f5098f", 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" }), n("path", { key: "0282ae1035c07bd0f8af5c3530ce7ce799dc2dc1", 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" }), n("path", { key: "16e1d732c5e6eee5f772d45085103b099c3130bf", 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" }), n("path", { key: "495550fe08ebeba1c89726b7009112e89088472a", 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" }), n("path", { key: "effe06423b66ff0a533bfb8ec6d9a0cbbf19f765", 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" }), n("path", { key: "785098f3a2ac3a19e79056e355365fd8ccc81cd9", 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" })), n("defs", { key: "9466fc6ad025006936d16136c6f4be4b79282759" }, n("clipPath", { key: "901a3ef6048680de4ddbdd8e3fd8edfbb7afc0f3", id: "clip0_455_3543" }, n("rect", { key: "aee5f90208b83c446e4ac3877ce788d0dcad0de3", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
|
|
564
585
|
}
|
|
565
586
|
};
|
|
566
|
-
|
|
567
|
-
const
|
|
587
|
+
we.style = Ce;
|
|
588
|
+
const _e = ':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)}.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}', Ee = _e, Te = class {
|
|
568
589
|
constructor(e) {
|
|
569
590
|
f(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
|
|
570
591
|
}
|
|
@@ -594,32 +615,32 @@ const Ce = ':host{display:block;margin-bottom:-12px;width:100%;z-index:1;--nylas
|
|
|
594
615
|
return;
|
|
595
616
|
}
|
|
596
617
|
if (this.notifications = [...this.notifications, { ...e.detail }], e.detail.ttl !== "none") {
|
|
597
|
-
const
|
|
618
|
+
const t = e.detail.ttl ? e.detail.ttl : this.ttl;
|
|
598
619
|
window.setTimeout(() => {
|
|
599
|
-
this.notifications = this.notifications.filter((
|
|
600
|
-
},
|
|
620
|
+
this.notifications = this.notifications.filter((a) => a.id !== e.detail.id);
|
|
621
|
+
}, t);
|
|
601
622
|
}
|
|
602
623
|
}
|
|
603
624
|
dismissNotification(e) {
|
|
604
|
-
this.notifications = this.notifications.filter((
|
|
625
|
+
this.notifications = this.notifications.filter((t) => t.id !== e);
|
|
605
626
|
}
|
|
606
627
|
render() {
|
|
607
|
-
return
|
|
628
|
+
return n(b, { key: "16bd673245819e3ed76ba5689c3292be510e3cd7" }, n(Q, { key: "d88e8ea863d00a8c982c7e26007c975526c7457f" }, this.notifications.map((e) => n("div", { class: `notif ${e.type}`, key: e.id }, n("div", { class: "content" }, n("span", { class: `icon ${e.type}` }, (e.type === "error" || e.type === "warning") && n("warning-icon", null)), n("span", { class: "message" }, n("span", { class: "title" }, e.title), e.description && n("span", { class: "description" }, e.description))), n("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(e.id) }, n("close-icon", null)))), n("slot", { key: "c40cb61ce0a1dbd3416824b7c26e08e3aea01eae" })));
|
|
608
629
|
}
|
|
609
630
|
};
|
|
610
|
-
|
|
611
|
-
const
|
|
612
|
-
var
|
|
613
|
-
var o = arguments.length, i = o < 3 ?
|
|
631
|
+
Te.style = Ee;
|
|
632
|
+
const De = ":host{display:block}sp-theme{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:min(max(14px, 3vw), 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}}", ze = De;
|
|
633
|
+
var Be = function(e, t, a, s) {
|
|
634
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
|
|
614
635
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
615
|
-
i = Reflect.decorate(e,
|
|
636
|
+
i = Reflect.decorate(e, t, a, s);
|
|
616
637
|
else
|
|
617
638
|
for (var l = e.length - 1; l >= 0; l--)
|
|
618
|
-
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(
|
|
619
|
-
return o > 3 && i && Object.defineProperty(
|
|
620
|
-
}, I = function(e,
|
|
639
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
|
|
640
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
641
|
+
}, I = function(e, t) {
|
|
621
642
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
622
|
-
return Reflect.metadata(e,
|
|
643
|
+
return Reflect.metadata(e, t);
|
|
623
644
|
};
|
|
624
645
|
const W = class {
|
|
625
646
|
constructor(e) {
|
|
@@ -640,7 +661,7 @@ const W = class {
|
|
|
640
661
|
}
|
|
641
662
|
render() {
|
|
642
663
|
var e;
|
|
643
|
-
return
|
|
664
|
+
return n(b, { key: "1104fd2969ab03bb794c17bbf08f1600a200448c", part: "nsec" }, n("sp-theme", { key: "674934ecb54519d9e8c227a9946b9725518b77e5", theme: "spectrum", color: "dark", scale: "medium" }, n("div", { key: "4d492e825e93b93ff96af4970812178656de4ab8", class: "event-card", part: "nsec__card" }, n("div", { key: "239131412dab45da5b1f7bfe3b4a2eda45a2978b", class: "calendar-icon", part: "nsec__icon" }, n("calendar-icon", { key: "a2fa2f47b94a2c331d4cac88ef736faef3e30dae" })), n("div", { key: "81c873d5c2019b6ae1d8b746685dbe5efc2d7d0b", class: "nylas-selected-event-card__date", part: "nsec__date" }, (e = this.selectedDate) == null ? void 0 : e.toLocaleDateString(void 0, { dateStyle: "full" })), n("div", { key: "67348e66fd879ead10594b216a2d66cf7da272aa", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), n("div", { key: "0fc6452dae7c5998a70d116c9bdfe25ab109661c", class: "event-timezone", part: "nsec__timezone" }, n("globe-icon", { key: "86c4a1e2728a30e34805a7c286378fe9adef110e" }), u[this.selectedTimezone])));
|
|
644
665
|
}
|
|
645
666
|
static get watchers() {
|
|
646
667
|
return {
|
|
@@ -648,8 +669,8 @@ const W = class {
|
|
|
648
669
|
};
|
|
649
670
|
}
|
|
650
671
|
};
|
|
651
|
-
|
|
652
|
-
|
|
672
|
+
Be([
|
|
673
|
+
p({
|
|
653
674
|
name: "nylas-selected-event-card",
|
|
654
675
|
stateToProps: /* @__PURE__ */ new Map([
|
|
655
676
|
["scheduler.selectedDate", "selectedDate"],
|
|
@@ -663,26 +684,26 @@ De([
|
|
|
663
684
|
I("design:paramtypes", []),
|
|
664
685
|
I("design:returntype", void 0)
|
|
665
686
|
], W.prototype, "render", null);
|
|
666
|
-
W.style =
|
|
667
|
-
const
|
|
668
|
-
var
|
|
669
|
-
var o = arguments.length, i = o < 3 ?
|
|
687
|
+
W.style = ze;
|
|
688
|
+
const Le = ":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.time-slots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.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 .time-slot-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:10px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}.footer sp-button{padding:14px;color:var(--nylas-base-100);border-radius:var(--nylas-border-radius-2x);width:100%;height:48px;font-weight:600;font-size:16px;background-color:var(--nylas-primary);border:none}.footer sp-button:hover,.footer sp-button:focus{background-color:var(--nylas-base-600)}.footer sp-button:active{background-color:var(--nylas-base-800)}", Se = Le;
|
|
689
|
+
var Re = function(e, t, a, s) {
|
|
690
|
+
var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
|
|
670
691
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
671
|
-
i = Reflect.decorate(e,
|
|
692
|
+
i = Reflect.decorate(e, t, a, s);
|
|
672
693
|
else
|
|
673
694
|
for (var l = e.length - 1; l >= 0; l--)
|
|
674
|
-
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(
|
|
675
|
-
return o > 3 && i && Object.defineProperty(
|
|
676
|
-
}, j = function(e,
|
|
695
|
+
(r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
|
|
696
|
+
return o > 3 && i && Object.defineProperty(t, a, i), i;
|
|
697
|
+
}, j = function(e, t) {
|
|
677
698
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
678
|
-
return Reflect.metadata(e,
|
|
699
|
+
return Reflect.metadata(e, t);
|
|
679
700
|
};
|
|
680
701
|
const U = class {
|
|
681
702
|
constructor(e) {
|
|
682
|
-
f(this, e), this.timeslotSelected = d(this, "timeslotSelected", 7), this.timeslotConfirmed = d(this, "timeslotConfirmed", 7), this.handleConfirmedTimeslot = async (
|
|
683
|
-
|
|
684
|
-
}, this.handleMouseEnter = (
|
|
685
|
-
this.hoveredTimeslotIndex =
|
|
703
|
+
f(this, e), this.timeslotSelected = d(this, "timeslotSelected", 7), this.timeslotConfirmed = d(this, "timeslotConfirmed", 7), this.handleConfirmedTimeslot = async (t, a) => {
|
|
704
|
+
t.preventDefault(), c("[nylas-timeslot-picker] Confirm timeslot", a), this.timeslotConfirmed.emit(a);
|
|
705
|
+
}, this.handleMouseEnter = (t) => {
|
|
706
|
+
this.hoveredTimeslotIndex = t;
|
|
686
707
|
}, this.handleMouseLeave = () => {
|
|
687
708
|
this.hoveredTimeslotIndex = -1;
|
|
688
709
|
}, this.selectedDate = /* @__PURE__ */ new Date(), this.availability = void 0, this.selectedTimeslot = void 0, this.isLoading = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.times = [], this.hoveredTimeslotIndex = void 0, this.selectedTimeslotIndex = void 0;
|
|
@@ -692,51 +713,51 @@ const U = class {
|
|
|
692
713
|
disconnectedCallback() {
|
|
693
714
|
}
|
|
694
715
|
async componentWillLoad() {
|
|
695
|
-
var
|
|
696
|
-
const e = (
|
|
716
|
+
var t;
|
|
717
|
+
const e = (t = this.availability) == null ? void 0 : t.filter((a) => this.selectedDate && m(a.start_time, this.selectedDate)).map((a) => a);
|
|
697
718
|
this.times = e || [], c("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
|
|
698
719
|
}
|
|
699
720
|
async componentDidLoad() {
|
|
700
721
|
c("[nylas-timeslot-picker] Component did load");
|
|
701
722
|
}
|
|
702
|
-
getTimeslotId(e,
|
|
703
|
-
return `${e.toLocaleDateString()}-${
|
|
723
|
+
getTimeslotId(e, t) {
|
|
724
|
+
return `${e.toLocaleDateString()}-${t}`;
|
|
704
725
|
}
|
|
705
|
-
onClickSelectTime(e,
|
|
706
|
-
c("[nylas-timeslot-picker] Time selected", e,
|
|
726
|
+
onClickSelectTime(e, t) {
|
|
727
|
+
c("[nylas-timeslot-picker] Time selected", e, t), this.selectedTimeslotIndex = this.getTimeslotId(e.start_time, t), this.timeslotSelected.emit({
|
|
707
728
|
start_time: e.start_time,
|
|
708
729
|
end_time: e.end_time
|
|
709
730
|
});
|
|
710
731
|
}
|
|
711
732
|
getTimeSlotLabel(e) {
|
|
712
|
-
const
|
|
733
|
+
const t = new Intl.DateTimeFormat("en-US", {
|
|
713
734
|
hour: "numeric",
|
|
714
735
|
minute: "numeric",
|
|
715
736
|
timeZone: this.selectedTimezone
|
|
716
737
|
});
|
|
717
|
-
return `${
|
|
738
|
+
return `${t.format(e.start_time)} - ${t.format(e.end_time)}`;
|
|
718
739
|
}
|
|
719
740
|
selectedDateChanged(e) {
|
|
720
|
-
var
|
|
741
|
+
var t;
|
|
721
742
|
if (c("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
|
|
722
|
-
const
|
|
723
|
-
this.times =
|
|
743
|
+
const a = (t = this.availability) == null ? void 0 : t.filter((s) => m(s.start_time, e)).map((s) => s);
|
|
744
|
+
this.times = a || [];
|
|
724
745
|
}
|
|
725
746
|
}
|
|
726
747
|
availabilityChanged(e) {
|
|
727
748
|
if (c("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
|
|
728
|
-
const
|
|
729
|
-
this.times =
|
|
749
|
+
const t = e == null ? void 0 : e.filter((a) => this.selectedDate && m(a.start_time, this.selectedDate)).map((a) => a);
|
|
750
|
+
this.times = t || [];
|
|
730
751
|
}
|
|
731
752
|
}
|
|
732
753
|
render() {
|
|
733
|
-
return this.isLoading ?
|
|
734
|
-
var
|
|
735
|
-
return
|
|
754
|
+
return this.isLoading ? n(b, null, n("div", { class: "loading" }, new Array(6).fill(0).map((e, t) => n("div", { class: "time-slot-skeleton", style: { animationDelay: `${t * 20}ms` } })))) : this.availability && this.availability.length === 0 ? n(b, null, n("div", { class: "empty" }, n("span", null, "No dates available"))) : (!this.times || this.times.length === 0) && this.selectedDate ? n(b, null, n("div", { class: "empty" }, n("span", null, "No time slots available for selected date"))) : this.selectedDate ? n(b, { part: "ntp" }, n("div", { class: "time-picker-wrapper" }, n("div", { class: "time-slots" }, this.times.map((e, t) => {
|
|
755
|
+
var a, s, o, i;
|
|
756
|
+
return n("button", { part: `ntp__timeslot ${((s = (a = this.selectedTimeslot) == null ? void 0 : a.start_time) == null ? void 0 : s.getTime()) === e.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, "aria-role": "button", class: {
|
|
736
757
|
time: !0,
|
|
737
758
|
selected: typeof this.selectedTimeslot < "u" && ((i = (o = this.selectedTimeslot) == null ? void 0 : o.start_time) == null ? void 0 : i.getTime()) === e.start_time.getTime()
|
|
738
|
-
}, onClick: () => this.onClickSelectTime(e,
|
|
739
|
-
})), this.selectedTimeslot &&
|
|
759
|
+
}, 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 }));
|
|
760
|
+
})), this.selectedTimeslot && n("div", { class: "footer" }, n("sp-button", { variant: "primary", onClick: (e) => this.handleConfirmedTimeslot(e, this.selectedTimeslot), part: "ntp__button-primary" }, n("slot", { name: "timeslot-picker-cta-label" }, "Next"))))) : n(b, null);
|
|
740
761
|
}
|
|
741
762
|
static get watchers() {
|
|
742
763
|
return {
|
|
@@ -745,8 +766,8 @@ const U = class {
|
|
|
745
766
|
};
|
|
746
767
|
}
|
|
747
768
|
};
|
|
748
|
-
|
|
749
|
-
|
|
769
|
+
Re([
|
|
770
|
+
p({
|
|
750
771
|
name: "nylas-timeslot-picker",
|
|
751
772
|
stateToProps: /* @__PURE__ */ new Map([
|
|
752
773
|
["scheduler.selectedDate", "selectedDate"],
|
|
@@ -756,11 +777,11 @@ Be([
|
|
|
756
777
|
["scheduler.isLoading", "isLoading"]
|
|
757
778
|
]),
|
|
758
779
|
eventToProps: {
|
|
759
|
-
timeslotSelected: async (e,
|
|
760
|
-
|
|
780
|
+
timeslotSelected: async (e, t) => {
|
|
781
|
+
t.scheduler.selectTime(e.detail);
|
|
761
782
|
},
|
|
762
|
-
timeslotConfirmed: async (e,
|
|
763
|
-
e.detail &&
|
|
783
|
+
timeslotConfirmed: async (e, t) => {
|
|
784
|
+
e.detail && t.scheduler.toggleAdditionalData(!0);
|
|
764
785
|
}
|
|
765
786
|
},
|
|
766
787
|
fireRegisterEvent: !0
|
|
@@ -769,16 +790,16 @@ Be([
|
|
|
769
790
|
j("design:paramtypes", []),
|
|
770
791
|
j("design:returntype", void 0)
|
|
771
792
|
], U.prototype, "render", null);
|
|
772
|
-
U.style =
|
|
793
|
+
U.style = Se;
|
|
773
794
|
export {
|
|
774
|
-
|
|
795
|
+
F as nylas_booked_event_card,
|
|
775
796
|
$ as nylas_booking_form,
|
|
776
797
|
H as nylas_cancel_booking_form,
|
|
777
798
|
Z as nylas_cancelled_event_card,
|
|
778
799
|
V as nylas_date_picker,
|
|
779
800
|
G as nylas_locale_switch,
|
|
780
|
-
|
|
781
|
-
|
|
801
|
+
we as nylas_logo,
|
|
802
|
+
Te as nylas_notification,
|
|
782
803
|
W as nylas_selected_event_card,
|
|
783
804
|
U as nylas_timeslot_picker
|
|
784
805
|
};
|