@nylas/react 1.3.5 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-circle-icon.entry-25aecb13.js +15 -0
- package/dist/{add-circle-icon.entry-640d2b46.cjs → add-circle-icon.entry-5c49ba96.cjs} +1 -1
- package/dist/{archive-icon.entry-5b209336.cjs → archive-icon.entry-0a9e8ec3.cjs} +1 -1
- package/dist/{archive-icon.entry-e8a39eda.js → archive-icon.entry-89e31121.js} +2 -2
- package/dist/{arrow-icon.entry-a25b7b7e.cjs → arrow-icon.entry-19e5237c.cjs} +1 -1
- package/dist/{arrow-icon.entry-fa9584cf.js → arrow-icon.entry-9cfd86a1.js} +2 -2
- package/dist/bold-icon.entry-d591e701.cjs +1 -0
- package/dist/{bold-icon.entry-ac6a4956.js → bold-icon.entry-eab3420d.js} +6 -6
- package/dist/{button-component_2.entry-caf33abf.js → button-component_2.entry-7cd5f9c0.js} +6 -6
- package/dist/{button-component_2.entry-1471422a.cjs → button-component_2.entry-ce4314bf.cjs} +1 -1
- package/dist/{calendar-agenda-fill-icon_53.entry-6d7f9c79.js → calendar-agenda-fill-icon_54.entry-7099138a.js} +786 -678
- package/dist/calendar-agenda-fill-icon_54.entry-9228dbe7.cjs +8 -0
- package/dist/{calendar-cancel-icon.entry-02015d74.js → calendar-cancel-icon.entry-299d6fba.js} +4 -4
- package/dist/{calendar-cancel-icon.entry-42d3d226.cjs → calendar-cancel-icon.entry-6e3d20f1.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-45aacd91.cjs → calendar-check-icon_2.entry-087dd913.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-2f7dc236.js → calendar-check-icon_2.entry-08ef8d2f.js} +5 -5
- package/dist/{calendar-icon.entry-70ac9bd6.js → calendar-icon.entry-53b54115.js} +5 -5
- package/dist/{calendar-icon.entry-90d67b03.cjs → calendar-icon.entry-73f9d05b.cjs} +1 -1
- package/dist/checkbox-component_3.entry-bc9768dd.cjs +1 -0
- package/dist/checkbox-component_3.entry-d828eb1d.js +149 -0
- package/dist/{chevron-icon_3.entry-3c95cc88.js → chevron-icon_3.entry-783588a9.js} +8 -8
- package/dist/chevron-icon_3.entry-e956d78c.cjs +1 -0
- package/dist/{clock-icon_4.entry-af5301d7.js → clock-icon_4.entry-0e809dcb.js} +18 -18
- package/dist/{clock-icon_4.entry-b50cce70.cjs → clock-icon_4.entry-60d41dfd.cjs} +1 -1
- package/dist/close-icon.entry-1b5d25c5.cjs +1 -0
- package/dist/close-icon.entry-fef4f624.js +15 -0
- package/dist/constants-6da0ede7-151395ad.cjs +1 -0
- package/dist/{constants-f6e79ab7-24392f9e.js → constants-6da0ede7-49c32ba7.js} +24 -13
- package/dist/{copy-icon.entry-312ff230.js → copy-icon.entry-25699ab8.js} +7 -7
- package/dist/{copy-icon.entry-74f8ebcd.cjs → copy-icon.entry-ab6530e0.cjs} +1 -1
- package/dist/{delete-icon.entry-00cb3ee8.js → delete-icon.entry-802084f6.js} +5 -5
- package/dist/{delete-icon.entry-b61a6706.cjs → delete-icon.entry-e99e1f82.cjs} +1 -1
- package/dist/document-refresh-icon.entry-065a59f5.cjs +1 -0
- package/dist/document-refresh-icon.entry-d1604f53.js +15 -0
- package/dist/elements/index.d.ts +1 -0
- package/dist/{feedbackSync-547e51ee-bcaf691c.js → feedbackSync-c040f483-2b6476c4.js} +1 -1
- package/dist/{feedbackSync-547e51ee-9b572309.cjs → feedbackSync-c040f483-d6dd0560.cjs} +1 -1
- package/dist/{folder-icon.entry-c32a6e15.cjs → folder-icon.entry-351e61fc.cjs} +1 -1
- package/dist/{folder-icon.entry-60b3eda5.js → folder-icon.entry-6c0c09ed.js} +4 -4
- package/dist/forward-icon.entry-0ccfb600.js +15 -0
- package/dist/forward-icon.entry-6b7af9cd.cjs +1 -0
- package/dist/{globe-icon.entry-21a80591.cjs → globe-icon.entry-2b75b66b.cjs} +1 -1
- package/dist/{globe-icon.entry-397727e1.js → globe-icon.entry-5ddcd2cb.js} +4 -4
- package/dist/{google-logo-icon_4.entry-6ccf8379.js → google-logo-icon_4.entry-04174684.js} +354 -342
- package/dist/google-logo-icon_4.entry-a685ff91.cjs +1 -0
- package/dist/inbox-icon.entry-0ad18b3f.js +15 -0
- package/dist/inbox-icon.entry-425d1ded.cjs +1 -0
- package/dist/{index-594c8e7b.js → index-7e7c24f1.js} +1486 -1412
- package/dist/index-81719cc6.cjs +81 -0
- package/dist/{index.es-2d849a15-2d84f7a5.cjs → index.es-2b014ec7-0589e68a.cjs} +1 -1
- package/dist/{index.es-2d849a15-4eb8e180.js → index.es-2b014ec7-72557487.js} +1 -1
- package/dist/{info-icon_2.entry-e7b86847.cjs → info-icon_2.entry-7ec02802.cjs} +1 -1
- package/dist/{info-icon_2.entry-65e0023f.js → info-icon_2.entry-a6d0e842.js} +6 -6
- package/dist/{input-color-picker.entry-37d2fb66.js → input-color-picker.entry-d98d06ca.js} +3 -3
- package/dist/{input-color-picker.entry-aabfe638.cjs → input-color-picker.entry-ed9a1c07.cjs} +1 -1
- package/dist/input-component.entry-2e57b00e.cjs +1 -0
- package/dist/{input-component.entry-c07d92b1.js → input-component.entry-f3aa3419.js} +7 -7
- package/dist/{input-dropdown_2.entry-90c08f10.js → input-dropdown_2.entry-0d9c8475.js} +15 -15
- package/dist/input-dropdown_2.entry-6fc7df16.cjs +1 -0
- package/dist/italic-icon.entry-7a8712f2.cjs +1 -0
- package/dist/italic-icon.entry-d610e66f.js +15 -0
- package/dist/{multi-select-dropdown.entry-c143becc.js → multi-select-dropdown.entry-b31d9f11.js} +4 -4
- package/dist/multi-select-dropdown.entry-eaa268b4.cjs +1 -0
- package/dist/{nylas-booked-event-card_12.entry-4974ffe6.js → nylas-booked-event-card_12.entry-45514813.js} +395 -349
- package/dist/nylas-booked-event-card_12.entry-498de30a.cjs +1 -0
- package/dist/{nylas-form-card.entry-42e718e2.js → nylas-form-card.entry-67aec298.js} +3 -3
- package/dist/{nylas-form-card.entry-55d3909c.cjs → nylas-form-card.entry-fdb3c114.cjs} +1 -1
- package/dist/{nylas-if-state.entry-4de782b7.cjs → nylas-if-state.entry-76b38c9c.cjs} +1 -1
- package/dist/{nylas-if-state.entry-beef8af6.js → nylas-if-state.entry-ee7d92b0.js} +3 -3
- package/dist/{nylas-login.entry-1661cbd4.js → nylas-login.entry-265f9d0f.js} +3 -3
- package/dist/{nylas-login.entry-d6b80abe.cjs → nylas-login.entry-589e45d0.cjs} +1 -1
- package/dist/{nylas-provider.entry-1f140378.js → nylas-provider.entry-5605a3e0.js} +5 -5
- package/dist/{nylas-provider.entry-d5495e1a.cjs → nylas-provider.entry-cfb9627c.cjs} +1 -1
- package/dist/{nylas-scheduler-editor.entry-bebe4e7d.cjs → nylas-scheduler-editor.entry-6fdfb9b5.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-f184f72e.js → nylas-scheduler-editor.entry-b3e085b3.js} +30 -30
- package/dist/nylas-scheduling.entry-8cc5c353.cjs +1 -0
- package/dist/{nylas-scheduling.entry-c335ad21.js → nylas-scheduling.entry-bc00beba.js} +88 -79
- package/dist/nylas-time-window-picker.entry-a77c1d67.cjs +1 -0
- package/dist/nylas-time-window-picker.entry-c421303e.js +316 -0
- package/dist/{person-icon.entry-21946944.cjs → person-icon.entry-36b21e95.cjs} +1 -1
- package/dist/{person-icon.entry-f9ca9147.js → person-icon.entry-85660f98.js} +2 -2
- package/dist/{play-icon.entry-dbfed5e8.js → play-icon.entry-953b1bc8.js} +4 -4
- package/dist/{play-icon.entry-b27fcb18.cjs → play-icon.entry-c35ade8a.cjs} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +71 -70
- package/dist/{refresh-icon.entry-9d94a60b.cjs → refresh-icon.entry-038501ca.cjs} +1 -1
- package/dist/{refresh-icon.entry-7886041f.js → refresh-icon.entry-d8644f5d.js} +4 -4
- package/dist/{register-component-677d8d2b-0113766e.js → register-component-e9c10e19-099fb50f.js} +1 -1
- package/dist/{register-component-677d8d2b-4738af1d.cjs → register-component-e9c10e19-80bbc4dd.cjs} +1 -1
- package/dist/{reply-all-icon.entry-f0e0a5c4.cjs → reply-all-icon.entry-ead9d0ba.cjs} +1 -1
- package/dist/{reply-all-icon.entry-fdd0058e.js → reply-all-icon.entry-f209daeb.js} +5 -5
- package/dist/reply-icon.entry-b7f35ecd.cjs +1 -0
- package/dist/reply-icon.entry-d37a129b.js +15 -0
- package/dist/{scheduler-config-store-ed4a8dfd-a16d5c62.cjs → scheduler-config-store-ed4a8dfd-0d4408cf.cjs} +1 -1
- package/dist/{scheduler-config-store-ed4a8dfd-012dcf85.js → scheduler-config-store-ed4a8dfd-35ec90c6.js} +1 -1
- package/dist/{scheduler-store-92eb8804-bc68a43a.js → scheduler-store-dc3a7958-7c73f5e2.js} +2 -2
- package/dist/{scheduler-store-92eb8804-c3deee73.cjs → scheduler-store-dc3a7958-99c6bdf6.cjs} +1 -1
- package/dist/sent-icon.entry-b662ef5b.cjs +1 -0
- package/dist/sent-icon.entry-ec433cec.js +15 -0
- package/dist/spam-icon.entry-3a553ae4.js +15 -0
- package/dist/spam-icon.entry-a79819fd.cjs +1 -0
- package/dist/{star-icon.entry-4dcae472.cjs → star-icon.entry-47ea44e7.cjs} +1 -1
- package/dist/{star-icon.entry-501083c1.js → star-icon.entry-9b22bb32.js} +4 -4
- package/dist/stop-icon.entry-1f7918b2.js +15 -0
- package/dist/{stop-icon.entry-ed949255.cjs → stop-icon.entry-26e2e633.cjs} +1 -1
- package/dist/{textarea-component.entry-efae9031.js → textarea-component.entry-6939d0fc.js} +5 -4
- package/dist/textarea-component.entry-da0a861e.cjs +1 -0
- package/dist/toggle-switch.entry-5ae5ba46.js +33 -0
- package/dist/toggle-switch.entry-c5fd3e33.cjs +1 -0
- package/dist/{translate-icon.entry-2591baf8.cjs → translate-icon.entry-72e0369e.cjs} +1 -1
- package/dist/{translate-icon.entry-676a4150.js → translate-icon.entry-8cffa646.js} +2 -2
- package/dist/trash-fill-icon.entry-815859c6.js +15 -0
- package/dist/trash-fill-icon.entry-8620c28f.cjs +1 -0
- package/dist/{underline-icon.entry-3513c5ef.js → underline-icon.entry-afd9c78b.js} +2 -2
- package/dist/{underline-icon.entry-6bf14476.cjs → underline-icon.entry-ba1a9e87.cjs} +1 -1
- package/dist/{warning-icon.entry-6e723597.js → warning-icon.entry-53441175.js} +7 -7
- package/dist/{warning-icon.entry-719a094d.cjs → warning-icon.entry-7cbede6b.cjs} +1 -1
- package/package.json +3 -3
- package/dist/add-circle-icon.entry-00c87903.js +0 -15
- package/dist/bold-icon.entry-d837c73d.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_53.entry-094bd4b9.cjs +0 -6
- package/dist/checkbox-component_3.entry-231b2254.cjs +0 -1
- package/dist/checkbox-component_3.entry-7270533c.js +0 -153
- package/dist/chevron-icon_3.entry-ead3d4c8.cjs +0 -1
- package/dist/close-icon.entry-04008446.cjs +0 -1
- package/dist/close-icon.entry-0a4105c9.js +0 -15
- package/dist/constants-f6e79ab7-23d7236b.cjs +0 -1
- package/dist/document-refresh-icon.entry-1c985b1e.js +0 -15
- package/dist/document-refresh-icon.entry-27ff5cb2.cjs +0 -1
- package/dist/forward-icon.entry-5f9a7639.js +0 -15
- package/dist/forward-icon.entry-8cd805dc.cjs +0 -1
- package/dist/google-logo-icon_4.entry-42e87368.cjs +0 -1
- package/dist/inbox-icon.entry-1e448b4b.js +0 -15
- package/dist/inbox-icon.entry-50605b1d.cjs +0 -1
- package/dist/index-cfb93df6.cjs +0 -81
- package/dist/input-component.entry-51f6da14.cjs +0 -1
- package/dist/input-dropdown_2.entry-20fb0552.cjs +0 -1
- package/dist/italic-icon.entry-8e5599ff.js +0 -15
- package/dist/italic-icon.entry-ee10a040.cjs +0 -1
- package/dist/multi-select-dropdown.entry-656d2791.cjs +0 -1
- package/dist/nylas-booked-event-card_12.entry-669bb872.cjs +0 -1
- package/dist/nylas-scheduling.entry-21c04831.cjs +0 -1
- package/dist/nylas-time-window-picker_2.entry-9e0dd470.js +0 -336
- package/dist/nylas-time-window-picker_2.entry-a2651ee7.cjs +0 -1
- package/dist/reply-icon.entry-0a42fb2c.cjs +0 -1
- package/dist/reply-icon.entry-a8d2b0f8.js +0 -15
- package/dist/sent-icon.entry-c3f84a59.cjs +0 -1
- package/dist/sent-icon.entry-e047f087.js +0 -15
- package/dist/spam-icon.entry-55d01416.js +0 -15
- package/dist/spam-icon.entry-671eb165.cjs +0 -1
- package/dist/stop-icon.entry-130a28b2.js +0 -15
- package/dist/textarea-component.entry-65dd740a.cjs +0 -1
- package/dist/trash-fill-icon.entry-5b373be7.js +0 -15
- package/dist/trash-fill-icon.entry-c411d0e0.cjs +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
import { n as
|
|
3
|
-
import { E as
|
|
4
|
-
import { L as
|
|
5
|
-
import { i as
|
|
1
|
+
import { i as u, r as Q, c as C, d as S, f as E, j as X, k as Z, h as n, H as w, g as V, F as ee } from "./index-7e7c24f1.js";
|
|
2
|
+
import { n as R, N as te } from "./index.es-2b014ec7-72557487.js";
|
|
3
|
+
import { E as P, C as ne, N as ie } from "./scheduler-store-dc3a7958-7c73f5e2.js";
|
|
4
|
+
import { L as oe, b as se } from "./constants-6da0ede7-49c32ba7.js";
|
|
5
|
+
import { i as ae, a as re, c as de, b as le, f as ce } from "./feedbackSync-c040f483-2b6476c4.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "react-dom";
|
|
8
|
-
class
|
|
8
|
+
class he {
|
|
9
9
|
constructor({ schedulerAPIURL: e, nylasSchedulerStore: i, sessionId: a, configId: o, slug: r, clientId: d }) {
|
|
10
10
|
if (!e)
|
|
11
11
|
throw new Error("schedulerAPIURL is required");
|
|
@@ -16,13 +16,13 @@ class re {
|
|
|
16
16
|
e === "/" && (e = new URL(window.location.href).origin), this.configId = o, this.sessionId = a, this.schedulerAPIURL = e, this.nylasSchedulerStore = i, this.slug = r, this.clientId = d;
|
|
17
17
|
}
|
|
18
18
|
init() {
|
|
19
|
-
|
|
19
|
+
S("NylasConnector init");
|
|
20
20
|
}
|
|
21
21
|
get schedulerStore() {
|
|
22
22
|
return this.nylasSchedulerStore;
|
|
23
23
|
}
|
|
24
24
|
get scheduler() {
|
|
25
|
-
return this._schedulerAPIConnector ? this._schedulerAPIConnector : (this._schedulerAPIConnector = new
|
|
25
|
+
return this._schedulerAPIConnector ? this._schedulerAPIConnector : (this._schedulerAPIConnector = new ie({
|
|
26
26
|
schedulerAPIURL: this.schedulerAPIURL,
|
|
27
27
|
schedulerStore: this.schedulerStore,
|
|
28
28
|
sessionId: this.sessionId,
|
|
@@ -38,7 +38,7 @@ class re {
|
|
|
38
38
|
const x = (t, e) => {
|
|
39
39
|
const i = t.isLoading, a = t.showNotification, o = t.nylasBranding;
|
|
40
40
|
return n(
|
|
41
|
-
|
|
41
|
+
ee,
|
|
42
42
|
null,
|
|
43
43
|
a && n("nylas-notification", null),
|
|
44
44
|
i && n(
|
|
@@ -68,21 +68,21 @@ const x = (t, e) => {
|
|
|
68
68
|
n("nylas-logo", { "aria-hidden": !0 })
|
|
69
69
|
))
|
|
70
70
|
);
|
|
71
|
-
},
|
|
71
|
+
}, Y = (t, e) => n("div", { class: "message-banner" }, e), ge = ':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto;border-left:none}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer .powered-by-nylas{display:flex;align-items:center;text-decoration:none;color:var(--nylas-base-500)}.footer .powered-by-nylas:hover{color:var(--nylas-base-800)}.footer svg{fill:var(--nylas-base-500)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}button-component#report-issue{width:auto;position:absolute;bottom:4px;left:16px}nylas-feedback-form{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}', fe = ge, J = { title: u.t("genericErrorTitle"), type: R.Error, category: P.Component }, ue = class {
|
|
72
72
|
constructor(t) {
|
|
73
|
-
|
|
73
|
+
Q(this, t), this.init = C(this, "init", 7), this.schedulerWillLoad = C(this, "schedulerWillLoad", 7), this.schedulerDidLoad = C(this, "schedulerDidLoad", 7), this.nylasSchedulerError = C(this, "nylasSchedulerError", 7), this.configSettingsLoaded = C(this, "configSettingsLoaded", 7), this.bookingRefExtracted = C(this, "bookingRefExtracted", 7), this.bookedEventInfo = C(this, "bookedEventInfo", 7), this.mode = "app", this.defaultSchedulerState = void 0, this.sessionId = void 0, this.schedulerApiUrl = "https://api.us.nylas.com", this.bookingInfo = void 0, this.rescheduleBookingRef = void 0, this.cancelBookingRef = void 0, this.organizerConfirmationBookingRef = void 0, this.configurationId = void 0, this.slug = void 0, this.clientId = void 0, this.nylasBranding = !0, this.eventOverrides = {}, this.isLoading = void 0, this.themeConfig = void 0, this.localization = void 0, this.showNotification = !0, this.enableUserFeedback = !0, this.hour12 = void 0, this.automaticComponentRegistration = !0, this.selectedDateLabel = (/* @__PURE__ */ new Date()).toLocaleDateString(void 0, { dateStyle: "full" }) || `${u.t("noDateSelected")}`, this.refConfigId = void 0, this.language = navigator.language, this.showFeedbackModal = !1, this.bookingInfoConfirmed = null;
|
|
74
74
|
}
|
|
75
75
|
connectedCallback() {
|
|
76
|
-
|
|
76
|
+
S("[nylas-scheduler] connectedCallback");
|
|
77
77
|
}
|
|
78
78
|
async componentWillLoad() {
|
|
79
79
|
var o, r;
|
|
80
|
-
|
|
80
|
+
S("[nylas-scheduler] Component will load"), this.enableUserFeedback && !ae() && re({
|
|
81
81
|
dsn: "https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",
|
|
82
|
-
release: "1.3.
|
|
82
|
+
release: "1.3.6",
|
|
83
83
|
integrations: (d) => [
|
|
84
84
|
...d.filter((s) => !1),
|
|
85
|
-
|
|
85
|
+
ce({
|
|
86
86
|
colorScheme: "system",
|
|
87
87
|
autoInject: !1
|
|
88
88
|
})
|
|
@@ -94,28 +94,29 @@ const x = (t, e) => {
|
|
|
94
94
|
if ("schedulerWillLoad" in this.eventOverrides && (await this.eventOverrides.schedulerWillLoad(t, this.nylasSchedulerConnector), t.defaultPrevented))
|
|
95
95
|
return;
|
|
96
96
|
this.stores = {
|
|
97
|
-
scheduler:
|
|
97
|
+
scheduler: ne({
|
|
98
98
|
bookingInfo: this.bookingInfo,
|
|
99
99
|
nylasBranding: this.nylasBranding,
|
|
100
100
|
themeConfig: this.themeConfig,
|
|
101
|
+
hour12: this.hour12,
|
|
101
102
|
...this.defaultSchedulerState
|
|
102
103
|
})
|
|
103
|
-
}, this.baseProvider = new
|
|
104
|
+
}, this.baseProvider = new te(this.host, this.stores, this.automaticComponentRegistration, this.eventOverrides), this.refConfigId = this.configurationId;
|
|
104
105
|
let e;
|
|
105
106
|
if (this.rescheduleBookingRef) {
|
|
106
|
-
const [d, s, c] =
|
|
107
|
+
const [d, s, c] = E(this.rescheduleBookingRef);
|
|
107
108
|
this.refConfigId = d, this.stores.scheduler.set("rescheduleBookingId", s), e = this.bookingRefExtracted.emit({ configurationId: d, bookingId: s });
|
|
108
109
|
} else if (this.cancelBookingRef) {
|
|
109
|
-
const [d, s, c] =
|
|
110
|
+
const [d, s, c] = E(this.cancelBookingRef);
|
|
110
111
|
this.refConfigId = d, this.stores.scheduler.set("cancelBookingId", s), e = this.bookingRefExtracted.emit({ configurationId: d, bookingId: s });
|
|
111
112
|
} else if (this.organizerConfirmationBookingRef) {
|
|
112
|
-
const [d, s, c] =
|
|
113
|
+
const [d, s, c] = E(this.organizerConfirmationBookingRef);
|
|
113
114
|
this.refConfigId = d, this.stores.scheduler.set("organizerConfirmationBookingId", s), this.stores.scheduler.set("organizerConfirmationSalt", c), e = this.bookingRefExtracted.emit({ configurationId: d, bookingId: s, salt: c });
|
|
114
115
|
}
|
|
115
116
|
if ("bookingRefExtracted" in this.eventOverrides && (await this.eventOverrides.bookingRefExtracted(e, this.nylasSchedulerConnector), e.defaultPrevented) || !this.checkIfSessionIdOrConfigIdExists())
|
|
116
117
|
return;
|
|
117
118
|
const i = (o = this.baseProvider) == null ? void 0 : o.getStore("scheduler");
|
|
118
|
-
this.nylasSchedulerConnector = new
|
|
119
|
+
this.nylasSchedulerConnector = new he({
|
|
119
120
|
schedulerAPIURL: this.schedulerApiUrl,
|
|
120
121
|
sessionId: this.sessionId,
|
|
121
122
|
configId: this.refConfigId,
|
|
@@ -127,23 +128,23 @@ const x = (t, e) => {
|
|
|
127
128
|
"init" in this.eventOverrides && (await this.eventOverrides.init(a, this.nylasSchedulerConnector), a.defaultPrevented) || ((r = this.baseProvider) == null || r.componentWillLoad(this.nylasSchedulerConnector), this.applyThemeConfig(this.themeConfig));
|
|
128
129
|
}
|
|
129
130
|
async componentDidLoad() {
|
|
130
|
-
var c,
|
|
131
|
+
var c, p, k, g, h, f, y, D;
|
|
131
132
|
(c = this.baseProvider) == null || c.componentDidLoad();
|
|
132
133
|
const t = this.schedulerDidLoad.emit(this.host);
|
|
133
134
|
if ("schedulerDidLoad" in this.eventOverrides && (await this.eventOverrides.schedulerDidLoad(t, this.nylasSchedulerConnector), t.defaultPrevented) || !this.checkIfSessionIdOrConfigIdExists())
|
|
134
135
|
return;
|
|
135
136
|
this.localizationChanged(this.localization);
|
|
136
|
-
const e = await ((
|
|
137
|
+
const e = await ((p = this.nylasSchedulerConnector) == null ? void 0 : p.scheduler.getUISettings());
|
|
137
138
|
if (!e || "error" in e) {
|
|
138
139
|
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(e == null ? void 0 : e.error) }, host: this.host });
|
|
139
140
|
return;
|
|
140
141
|
} else {
|
|
141
|
-
"data" in e && ((
|
|
142
|
+
"data" in e && ((k = e.data) != null && k.appearance) && console.info("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.");
|
|
142
143
|
const b = this.configSettingsLoaded.emit({ settings: e });
|
|
143
144
|
if ("configSettingsLoaded" in this.eventOverrides && (await this.eventOverrides.configSettingsLoaded(b, this.nylasSchedulerConnector), b.defaultPrevented))
|
|
144
145
|
return;
|
|
145
146
|
}
|
|
146
|
-
const i = (g = this.baseProvider) == null ? void 0 : g.getStore("scheduler"), a = (
|
|
147
|
+
const i = (g = this.baseProvider) == null ? void 0 : g.getStore("scheduler"), a = (f = (h = i == null ? void 0 : i.get("configSettings")) == null ? void 0 : h.scheduler) == null ? void 0 : f.available_days_in_future, o = i == null ? void 0 : i.get("selectedTimeslot");
|
|
147
148
|
if (o && (o != null && o.start_time)) {
|
|
148
149
|
if (!this.isTimeslotValid(o))
|
|
149
150
|
return;
|
|
@@ -157,10 +158,10 @@ const x = (t, e) => {
|
|
|
157
158
|
if (!(d && d.length > 0)) {
|
|
158
159
|
if (r) {
|
|
159
160
|
const { startTime: b, endTime: v, endTimeForAvailableDaysInFuture: _ } = this.validateAvailableDaysInFuture(r, a || 30);
|
|
160
|
-
r.getTime() < _ * 1e3 && (s = await ((
|
|
161
|
+
r.getTime() < _ * 1e3 && (s = await ((D = this.nylasSchedulerConnector) == null ? void 0 : D.scheduler.getAvailability(b, v)));
|
|
161
162
|
} else {
|
|
162
|
-
const b = /* @__PURE__ */ new Date(), { startTime: v, endTime: _, endTimeForAvailableDaysInFuture:
|
|
163
|
-
b.getTime() <
|
|
163
|
+
const b = /* @__PURE__ */ new Date(), { startTime: v, endTime: _, endTimeForAvailableDaysInFuture: T } = this.validateAvailableDaysInFuture(b, a || 30);
|
|
164
|
+
b.getTime() < T * 1e3 && (s = await ((y = this.nylasSchedulerConnector) == null ? void 0 : y.scheduler.getAvailability(v, _)));
|
|
164
165
|
}
|
|
165
166
|
if ((!s || "error" in s) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(s == null ? void 0 : s.error) }, host: this.host }), !r) {
|
|
166
167
|
let b = /* @__PURE__ */ new Date();
|
|
@@ -180,27 +181,27 @@ const x = (t, e) => {
|
|
|
180
181
|
rescheduleBookingRefChanged(t) {
|
|
181
182
|
var e, i;
|
|
182
183
|
if (t) {
|
|
183
|
-
const [a, o] =
|
|
184
|
+
const [a, o] = E(t);
|
|
184
185
|
(e = this.stores) == null || e.scheduler.set("rescheduleBookingId", o), this.refConfigId = a, (i = this.nylasSchedulerConnector) == null || i.scheduler.setConfigId(a);
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
188
|
cancelBookingRefChanged(t) {
|
|
188
189
|
var e, i;
|
|
189
190
|
if (t) {
|
|
190
|
-
const [a, o] =
|
|
191
|
+
const [a, o] = E(t);
|
|
191
192
|
(e = this.stores) == null || e.scheduler.set("cancelBookingId", o), this.refConfigId = a, (i = this.nylasSchedulerConnector) == null || i.scheduler.setConfigId(a);
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
organizerConfirmationBookingRefChanged(t) {
|
|
195
196
|
var e, i;
|
|
196
197
|
if (t) {
|
|
197
|
-
const [a, o] =
|
|
198
|
+
const [a, o] = E(t);
|
|
198
199
|
(e = this.stores) == null || e.scheduler.set("organizerConfirmationBookingId", o), this.refConfigId = a, (i = this.nylasSchedulerConnector) == null || i.scheduler.setConfigId(a);
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
202
|
localizationChanged(t) {
|
|
202
203
|
t && Object.keys(t).forEach((e) => {
|
|
203
|
-
e in
|
|
204
|
+
e in oe && u.addResourceBundle(e, "translation", t[e], !1, !0);
|
|
204
205
|
});
|
|
205
206
|
}
|
|
206
207
|
themeConfigChanged(t) {
|
|
@@ -209,7 +210,7 @@ const x = (t, e) => {
|
|
|
209
210
|
}
|
|
210
211
|
languageChanged(t) {
|
|
211
212
|
const e = t.detail;
|
|
212
|
-
this.language = e,
|
|
213
|
+
this.language = e, u.changeLanguage(e);
|
|
213
214
|
}
|
|
214
215
|
async registerComponentHandler(t) {
|
|
215
216
|
var e;
|
|
@@ -220,11 +221,11 @@ const x = (t, e) => {
|
|
|
220
221
|
(e = this.baseProvider) == null || e.unregisterComponent(t.detail);
|
|
221
222
|
}
|
|
222
223
|
async monthChangedHandler(t) {
|
|
223
|
-
var d, s, c,
|
|
224
|
-
const e = t.detail, i = (
|
|
224
|
+
var d, s, c, p, k, g, h;
|
|
225
|
+
const e = t.detail, i = (p = (c = (s = (d = this.nylasSchedulerConnector) == null ? void 0 : d.schedulerStore) == null ? void 0 : s.get("configSettings")) == null ? void 0 : c.scheduler) == null ? void 0 : p.available_days_in_future, { startTime: a, endTime: o, endTimeForAvailableDaysInFuture: r } = this.validateAvailableDaysInFuture(e, i || 30);
|
|
225
226
|
if (!t.defaultPrevented && a < r && e.getTime() < r * 1e3) {
|
|
226
|
-
const
|
|
227
|
-
(!
|
|
227
|
+
const f = await ((k = this.nylasSchedulerConnector) == null ? void 0 : k.scheduler.getAvailability(a, o));
|
|
228
|
+
(!f || "error" in f) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(f == null ? void 0 : f.error) }, host: this.host });
|
|
228
229
|
const y = (g = this.stores) == null ? void 0 : g.scheduler.get("selectableDates");
|
|
229
230
|
y && y.length > 0 && ((h = this.stores) == null || h.scheduler.set("selectedDate", y[0]));
|
|
230
231
|
}
|
|
@@ -243,27 +244,27 @@ const x = (t, e) => {
|
|
|
243
244
|
};
|
|
244
245
|
}
|
|
245
246
|
async bookButtonClickedHandler(t) {
|
|
246
|
-
var c,
|
|
247
|
+
var c, p, k, g;
|
|
247
248
|
if (t.defaultPrevented)
|
|
248
249
|
return;
|
|
249
250
|
const e = t.detail, i = this.mapToBookingData(e);
|
|
250
251
|
this.bookingInfoConfirmed = e;
|
|
251
|
-
const o = (
|
|
252
|
+
const o = (p = (c = this.nylasSchedulerConnector) == null ? void 0 : c.schedulerStore) == null ? void 0 : p.get("rescheduleBookingId");
|
|
252
253
|
if (o) {
|
|
253
|
-
const h = await ((
|
|
254
|
+
const h = await ((k = this.nylasSchedulerConnector) == null ? void 0 : k.scheduler.rescheduleBooking(o, e));
|
|
254
255
|
(!h || "error" in h) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(h == null ? void 0 : h.error) }, host: this.host });
|
|
255
|
-
const
|
|
256
|
-
"bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(y, this.nylasSchedulerConnector);
|
|
256
|
+
const f = h == null ? void 0 : h.data, y = this.bookedEventInfo.emit({ ...h, data: { ...f, ...i } });
|
|
257
|
+
this.bookingInfoConfirmed = { ...this.bookingInfoConfirmed, ...f }, "bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(y, this.nylasSchedulerConnector);
|
|
257
258
|
return;
|
|
258
259
|
}
|
|
259
260
|
const r = await ((g = this.nylasSchedulerConnector) == null ? void 0 : g.scheduler.bookTimeslot(e));
|
|
260
261
|
(!r || "error" in r) && this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(r == null ? void 0 : r.error) }, host: this.host });
|
|
261
262
|
const d = r == null ? void 0 : r.data, s = this.bookedEventInfo.emit({ ...r, data: { ...d, ...i } });
|
|
262
|
-
"bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(s, this.nylasSchedulerConnector);
|
|
263
|
+
this.bookingInfoConfirmed = { ...this.bookingInfoConfirmed, ...d }, "bookedEventInfo" in this.eventOverrides && await this.eventOverrides.bookedEventInfo(s, this.nylasSchedulerConnector);
|
|
263
264
|
}
|
|
264
265
|
dateSelectedHandler(t) {
|
|
265
266
|
const e = t.detail;
|
|
266
|
-
this.selectedDateLabel = e ? e.toLocaleDateString(void 0, { dateStyle: "full" }) : `${
|
|
267
|
+
this.selectedDateLabel = e ? e.toLocaleDateString(void 0, { dateStyle: "full" }) : `${u.t("noDateSelected")}`;
|
|
267
268
|
}
|
|
268
269
|
cancelBookedEventErrorHandler(t) {
|
|
269
270
|
this.nylasSchedulerError.emit({ notification: { ...this.getErrorObject(t.detail.error) }, host: this.host });
|
|
@@ -282,15 +283,23 @@ const x = (t, e) => {
|
|
|
282
283
|
}
|
|
283
284
|
feedbackSubmittedHandler(t) {
|
|
284
285
|
const i = {
|
|
285
|
-
eventId:
|
|
286
|
+
eventId: de("Scheduling Page User Feedback", {
|
|
287
|
+
extra: {
|
|
288
|
+
configId: this.configurationId,
|
|
289
|
+
slug: this.slug
|
|
290
|
+
}
|
|
291
|
+
}),
|
|
286
292
|
message: t.detail.feedback
|
|
287
293
|
};
|
|
288
|
-
|
|
294
|
+
le(i, {
|
|
289
295
|
includeReplay: !0,
|
|
290
296
|
captureContext: {
|
|
291
297
|
tags: {
|
|
292
|
-
"nylas-web-element": "nylas-
|
|
293
|
-
"nylas-web-element-version": "1.3.
|
|
298
|
+
"nylas-web-element": "nylas-scheduling",
|
|
299
|
+
"nylas-web-element-version": "1.3.6",
|
|
300
|
+
"nylas-config-id": this.configurationId,
|
|
301
|
+
"nylas-slug": this.slug,
|
|
302
|
+
"host-url": window.location.href
|
|
294
303
|
},
|
|
295
304
|
extra: {
|
|
296
305
|
configId: this.configurationId,
|
|
@@ -311,9 +320,9 @@ const x = (t, e) => {
|
|
|
311
320
|
}
|
|
312
321
|
getErrorObject(t) {
|
|
313
322
|
return {
|
|
314
|
-
title: (t == null ? void 0 : t.title) ||
|
|
315
|
-
category: (t == null ? void 0 : t.category) ||
|
|
316
|
-
type:
|
|
323
|
+
title: (t == null ? void 0 : t.title) || J.title,
|
|
324
|
+
category: (t == null ? void 0 : t.category) || J.category,
|
|
325
|
+
type: R.Error,
|
|
317
326
|
description: (t == null ? void 0 : t.message) || "",
|
|
318
327
|
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
319
328
|
ttl: "none"
|
|
@@ -322,11 +331,11 @@ const x = (t, e) => {
|
|
|
322
331
|
checkIfSessionIdOrConfigIdExists() {
|
|
323
332
|
if (!this.sessionId && !this.refConfigId && !(this.slug && this.clientId)) {
|
|
324
333
|
let t = "";
|
|
325
|
-
return this.sessionId || (t +=
|
|
334
|
+
return this.sessionId || (t += u.t("sessionIdRequiredErrorMessage")), !this.sessionId && !this.refConfigId && !(this.slug && this.clientId) && (t = u.t("sessionIdRequiredErrorMessage") + " " + u.t("publicConfigErrorMessage")), this.nylasSchedulerError.emit({
|
|
326
335
|
notification: {
|
|
327
|
-
title:
|
|
328
|
-
category:
|
|
329
|
-
type:
|
|
336
|
+
title: u.t("schedulingComponentErrorTitle"),
|
|
337
|
+
category: P.Component,
|
|
338
|
+
type: R.Error,
|
|
330
339
|
description: t,
|
|
331
340
|
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
332
341
|
ttl: "none"
|
|
@@ -339,10 +348,10 @@ const x = (t, e) => {
|
|
|
339
348
|
isTimeslotValid(t) {
|
|
340
349
|
return new Date(t.start_time) < /* @__PURE__ */ new Date() ? (this.nylasSchedulerError.emit({
|
|
341
350
|
notification: {
|
|
342
|
-
title:
|
|
343
|
-
category:
|
|
344
|
-
type:
|
|
345
|
-
description:
|
|
351
|
+
title: u.t("invalidTimeslotErrorTitle"),
|
|
352
|
+
category: P.Component,
|
|
353
|
+
type: R.Error,
|
|
354
|
+
description: u.t("invalidTimeslotErrorMessage"),
|
|
346
355
|
id: (/* @__PURE__ */ new Date()).getTime().toString(),
|
|
347
356
|
ttl: "none"
|
|
348
357
|
},
|
|
@@ -350,7 +359,7 @@ const x = (t, e) => {
|
|
|
350
359
|
}), !1) : !0;
|
|
351
360
|
}
|
|
352
361
|
validateAvailableDaysInFuture(t, e) {
|
|
353
|
-
const i = /* @__PURE__ */ new Date(), a = new Date(t.getFullYear(), t.getMonth(), 1).getTime() / 1e3, o = new Date(t.getFullYear(), t.getMonth() + 1, 1).getTime() / 1e3, r = Math.floor(
|
|
362
|
+
const i = /* @__PURE__ */ new Date(), a = new Date(t.getFullYear(), t.getMonth(), 1).getTime() / 1e3, o = new Date(t.getFullYear(), t.getMonth() + 1, 1).getTime() / 1e3, r = Math.floor(X(i, e).getTime() / 1e3), d = Math.min(r, o);
|
|
354
363
|
return { startTime: a < i.getTime() / 1e3 ? Math.floor(i.getTime() / 1e3) : a, endTime: d, endTimeForAvailableDaysInFuture: r };
|
|
355
364
|
}
|
|
356
365
|
applyThemeConfig(t) {
|
|
@@ -365,38 +374,38 @@ const x = (t, e) => {
|
|
|
365
374
|
window.location.assign(t);
|
|
366
375
|
}
|
|
367
376
|
render() {
|
|
368
|
-
var y,
|
|
369
|
-
const t = this.mode === "app", e = (y = this.baseProvider) == null ? void 0 : y.getStore("scheduler"), i = e == null ? void 0 : e.get("eventInfo"), a = e == null ? void 0 : e.get("showBookingForm"), o = e == null ? void 0 : e.get("cancelledEventInfo"), r = e == null ? void 0 : e.get("cancelBookingId"), d = e == null ? void 0 : e.get("selectedTimeslot"), s = e == null ? void 0 : e.get("rescheduleBookingId"), c = e == null ? void 0 : e.get("organizerConfirmationBookingId"),
|
|
370
|
-
if (this.selectedDateLabel = h && this.language ?
|
|
371
|
-
return n(w, null, n(x, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancel-flow-page", part: "cancel-flow-page" }, n("nylas-cancel-booking-form", { selectedTimeslot: d, cancelBookingId: r, rejectBookingId:
|
|
377
|
+
var y, D, b, v, _, T, N, A, M, U, j, H;
|
|
378
|
+
const t = this.mode === "app", e = (y = this.baseProvider) == null ? void 0 : y.getStore("scheduler"), i = e == null ? void 0 : e.get("eventInfo"), a = e == null ? void 0 : e.get("showBookingForm"), o = e == null ? void 0 : e.get("cancelledEventInfo"), r = e == null ? void 0 : e.get("cancelBookingId"), d = e == null ? void 0 : e.get("selectedTimeslot"), s = e == null ? void 0 : e.get("rescheduleBookingId"), c = e == null ? void 0 : e.get("organizerConfirmationBookingId"), p = e == null ? void 0 : e.get("rejectBookingId"), k = e == null ? void 0 : e.get("confirmedEventInfo"), g = (e == null ? void 0 : e.get("nylasBranding")) || this.nylasBranding, h = e == null ? void 0 : e.get("selectedDate"), f = (b = (D = e == null ? void 0 : e.get("configSettings")) == null ? void 0 : D.scheduler) == null ? void 0 : b.confirmation_redirect_url;
|
|
379
|
+
if (this.selectedDateLabel = h && this.language ? Z(h.toLocaleDateString(se[this.language], { dateStyle: "full" })) : `${u.t("noDateSelected")}`, t && (r || p) && !o)
|
|
380
|
+
return n(w, null, n(x, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancel-flow-page", part: "cancel-flow-page" }, n("nylas-cancel-booking-form", { selectedTimeslot: d, cancelBookingId: r, rejectBookingId: p, exportparts: "ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card" }))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: (l) => this.onFeedbackClick(l) }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
|
|
372
381
|
if (t && c)
|
|
373
382
|
return n(w, null, n(x, null, n("div", { class: "manual-confirmation-page", part: "manual-confirmation-page" }, n("nylas-organizer-confirmation-card", { organizerConfirmationBookingId: c, exportparts: "nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline" }))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: (l) => this.onFeedbackClick(l) }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
|
|
374
383
|
if (t && o)
|
|
375
384
|
return n(w, null, n(x, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancelled-event-page", part: "cancelled-event-page" }, n("nylas-cancelled-event-card", { cancelledEventInfo: o, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: (l) => this.onFeedbackClick(l) }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
|
|
376
|
-
if (t &&
|
|
377
|
-
return n(w, null, n(x, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancelled-event-page", part: "confirmed-event-page" }, n("nylas-confirmed-event-card", { confirmedEventInfo:
|
|
378
|
-
if (t && i &&
|
|
379
|
-
const l = (v = this.bookingInfoConfirmed) == null ? void 0 : v.primaryParticipant,
|
|
380
|
-
if (this.bookingInfo && typeof ((
|
|
381
|
-
const
|
|
382
|
-
Object.keys(
|
|
383
|
-
!
|
|
385
|
+
if (t && k)
|
|
386
|
+
return n(w, null, n(x, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "cancelled-event-page", part: "confirmed-event-page" }, n("nylas-confirmed-event-card", { confirmedEventInfo: k, exportparts: "ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card" }))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: (l) => this.onFeedbackClick(l) }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
|
|
387
|
+
if (t && i && f) {
|
|
388
|
+
const l = (v = this.bookingInfoConfirmed) == null ? void 0 : v.primaryParticipant, L = (_ = this.bookingInfoConfirmed) == null ? void 0 : _.location, W = (T = this.bookingInfoConfirmed) == null ? void 0 : T.booking_ref, F = ((N = this.bookingInfoConfirmed) == null ? void 0 : N.additionalFields) || {};
|
|
389
|
+
if (this.bookingInfo && typeof ((A = this.bookingInfo) == null ? void 0 : A.additionalFields) < "u") {
|
|
390
|
+
const B = this.bookingInfo.additionalFields;
|
|
391
|
+
Object.keys(B).forEach((z) => {
|
|
392
|
+
!F[z] && (B != null && B[z]) && (F[z] = B[z].value);
|
|
384
393
|
});
|
|
385
394
|
}
|
|
386
|
-
const I = (
|
|
387
|
-
|
|
395
|
+
const I = (M = this.stores) == null ? void 0 : M.scheduler.get("selectedTimeslot"), $ = (U = this.stores) == null ? void 0 : U.scheduler.get("selectedTimezone"), q = (j = this.stores) == null ? void 0 : j.scheduler.get("selectedLanguage"), O = (H = this.stores) == null ? void 0 : H.scheduler.get("configSettings"), G = this.configurationId ? this.configurationId : O == null ? void 0 : O.configuration_id, K = window.location.search, m = new URLSearchParams(K);
|
|
396
|
+
m.set("booking_id", i.booking_id), l != null && l.name && m.set("name", l.name), l != null && l.email && m.set("email", l.email), I != null && I.start_time && m.set("start_time", (new Date(I.start_time).getTime() / 1e3).toString()), I != null && I.end_time && m.set("end_time", (new Date(I.end_time).getTime() / 1e3).toString()), $ && m.set("tz", $), q && m.set("language", q), F && m.set("additional_values", JSON.stringify(F)), this.slug && m.set("page_slug", this.slug), G && m.set("config_id", G), L && m.set("location", L), W && m.set("booking_ref", W), this.redirectToCustomUrl(`${f}?${m.toString()}`);
|
|
388
397
|
return;
|
|
389
398
|
}
|
|
390
399
|
if (t && i)
|
|
391
400
|
return n(w, null, n(x, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, n("div", { class: "booked-event-page", part: "booked-event-page" }, n("nylas-booked-event-card", { selectedTimeslot: d, eventInfo: i, exportparts: "nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta" }))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: (l) => this.onFeedbackClick(l) }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
|
|
392
401
|
if (t && (!i || s) && !a) {
|
|
393
402
|
const l = this.host.querySelector('[slot="timeslot-picker-cta-label"]');
|
|
394
|
-
return n(w, null, n(x, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, s && n(
|
|
403
|
+
return n(w, null, n(x, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, s && n(Y, null, `${u.t("rescheduleTitle")}`), n("div", { class: "select-date-page", part: "select-date-page" }, n("div", { class: "left-panel" }, n("nylas-date-picker", { exportparts: "ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month" }), n("nylas-locale-switch", { exportparts: "nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label" })), n("div", { class: `right-panel ${s ? "reschedule" : ""}` }, n("h2", null, n("calendar-icon", null), n("span", { id: "selectedDate" }, this.selectedDateLabel)), n("nylas-timeslot-picker", { exportparts: "ntp, ntp__time-picker-wrapper, ntp__timeslots, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary" }, l && n("span", { slot: "timeslot-picker-cta-label" }, n("slot", { name: "timeslot-picker-cta-label" })))))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: (L) => this.onFeedbackClick(L) }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null));
|
|
395
404
|
}
|
|
396
|
-
return t && !i && a ? n(w, null, n(x, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, s && n(
|
|
405
|
+
return t && !i && a ? n(w, null, n(x, { nylasBranding: g, isLoading: this.isLoading, showNotification: this.showNotification }, s && n(Y, null, `${u.t("rescheduleTitle")}`), n("div", { class: "additional-data-page", part: "additional-data-page" }, n("div", { class: "left-panel" }, n("div", { class: "wrapper" }, n("nylas-selected-event-card", { exportparts: "nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone" }))), n("div", { class: `right-panel ${s ? "reschedule" : ""}` }, n("nylas-booking-form", { exportparts: "nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content" })))), this.enableUserFeedback && n("button-component", { id: "report-issue", variant: "basic", onClick: (l) => this.onFeedbackClick(l) }, n("feedback-icon", null)), this.showFeedbackModal && n("nylas-feedback-form", null)) : n(w, null, n("slot", null));
|
|
397
406
|
}
|
|
398
407
|
get host() {
|
|
399
|
-
return
|
|
408
|
+
return V(this);
|
|
400
409
|
}
|
|
401
410
|
static get watchers() {
|
|
402
411
|
return {
|
|
@@ -409,7 +418,7 @@ const x = (t, e) => {
|
|
|
409
418
|
};
|
|
410
419
|
}
|
|
411
420
|
};
|
|
412
|
-
|
|
421
|
+
ue.style = fe;
|
|
413
422
|
export {
|
|
414
|
-
|
|
423
|
+
ue as nylas_scheduling
|
|
415
424
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-81719cc6.cjs");require("react");require("react-dom");var _={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(r.commonjsGlobal,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,a=/\d\d/,h=/\d\d?/,x=/\d*[^-_:/,()\s\d]+/,b={},Z=function(s){return(s=+s)+(s>68?1900:2e3)},d=function(s){return function(o){this[s]=+o}},B=[/[+-]\d\d:?(\d\d)?|Z/,function(s){(this.zone||(this.zone={})).offset=function(o){if(!o||o==="Z")return 0;var m=o.match(/([+-]|\d\d)/g),l=60*m[1]+(+m[2]||0);return l===0?0:m[0]==="+"?-l:l}(s)}],F=function(s){var o=b[s];return o&&(o.indexOf?o:o.s.concat(o.f))},V=function(s,o){var m,l=b.meridiem;if(l){for(var p=1;p<=24;p+=1)if(s.indexOf(l(p,0,o))>-1){m=p>12;break}}else m=s===(o?"pm":"PM");return m},q={A:[x,function(s){this.afternoon=V(s,!1)}],a:[x,function(s){this.afternoon=V(s,!0)}],S:[/\d/,function(s){this.milliseconds=100*+s}],SS:[a,function(s){this.milliseconds=10*+s}],SSS:[/\d{3}/,function(s){this.milliseconds=+s}],s:[h,d("seconds")],ss:[h,d("seconds")],m:[h,d("minutes")],mm:[h,d("minutes")],H:[h,d("hours")],h:[h,d("hours")],HH:[h,d("hours")],hh:[h,d("hours")],D:[h,d("day")],DD:[a,d("day")],Do:[x,function(s){var o=b.ordinal,m=s.match(/\d+/);if(this.day=m[0],o)for(var l=1;l<=31;l+=1)o(l).replace(/\[|\]/g,"")===s&&(this.day=l)}],M:[h,d("month")],MM:[a,d("month")],MMM:[x,function(s){var o=F("months"),m=(F("monthsShort")||o.map(function(l){return l.slice(0,3)})).indexOf(s)+1;if(m<1)throw new Error;this.month=m%12||m}],MMMM:[x,function(s){var o=F("months").indexOf(s)+1;if(o<1)throw new Error;this.month=o%12||o}],Y:[/[+-]?\d+/,d("year")],YY:[a,function(s){this.year=Z(s)}],YYYY:[/\d{4}/,d("year")],Z:B,ZZ:B};function N(s){var o,m;o=s,m=b&&b.formats;for(var l=(s=o.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(S,T,f){var c=f&&f.toUpperCase();return T||m[f]||n[f]||m[c].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(w,k,M){return k||M.slice(1)})})).match(i),p=l.length,y=0;y<p;y+=1){var C=l[y],I=q[C],v=I&&I[0],g=I&&I[1];l[y]=g?{regex:v,parser:g}:C.replace(/^\[|\]$/g,"")}return function(S){for(var T={},f=0,c=0;f<p;f+=1){var w=l[f];if(typeof w=="string")c+=w.length;else{var k=w.regex,M=w.parser,L=S.slice(c),A=k.exec(L)[0];M.call(T,A),S=S.replace(A,"")}}return function(D){var u=D.afternoon;if(u!==void 0){var Y=D.hours;u?Y<12&&(D.hours+=12):Y===12&&(D.hours=0),delete D.afternoon}}(T),T}}return function(s,o,m){m.p.customParseFormat=!0,s&&s.parseTwoDigitYear&&(Z=s.parseTwoDigitYear);var l=o.prototype,p=l.parse;l.parse=function(y){var C=y.date,I=y.utc,v=y.args;this.$u=I;var g=v[1];if(typeof g=="string"){var S=v[2]===!0,T=v[3]===!0,f=S||T,c=v[2];T&&(c=v[2]),b=this.$locale(),!S&&c&&(b=m.Ls[c]),this.$d=function(L,A,D){try{if(["x","X"].indexOf(A)>-1)return new Date((A==="X"?1e3:1)*L);var u=N(A)(L),Y=u.year,E=u.month,X=u.day,G=u.hours,J=u.minutes,Q=u.seconds,ee=u.milliseconds,W=u.zone,$=new Date,P=X||(Y||E?1:$.getDate()),z=Y||$.getFullYear(),O=0;Y&&!E||(O=E>0?E-1:$.getMonth());var j=G||0,H=J||0,K=Q||0,R=ee||0;return W?new Date(Date.UTC(z,O,P,j,H,K,R+60*W.offset*1e3)):D?new Date(Date.UTC(z,O,P,j,H,K,R)):new Date(z,O,P,j,H,K,R)}catch{return new Date("")}}(C,g,I),this.init(),c&&c!==!0&&(this.$L=this.locale(c).$L),f&&C!=this.format(g)&&(this.$d=new Date("")),b={}}else if(g instanceof Array)for(var w=g.length,k=1;k<=w;k+=1){v[1]=g[k-1];var M=m.apply(this,v);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}k===w&&(this.$d=new Date(""))}else p.call(this,y)}}})})(_);const te=_.exports,ie=':host{display:block;position:relative;--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}.time-picker{display:inline-block;width:150px;font-family:var(--nylas-font-family);position:relative}@media screen and (max-width: 768px){.time-picker{width:auto}}.time-picker input{width:150px;height:48px;text-align:center;font-size:16px;font-family:inherit;cursor:pointer;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.time-picker input{width:88px}}@media screen and (max-width: 504px){.time-picker input{width:68px;font-size:15px}}.time-picker input.focus{background:transparent}.time-picker input:hover,.time-picker input:active{border:1px solid var(--nylas-primary)}.time-picker input:active{outline:2px solid var(--nylas-primary)}.time-picker input span.open{transform:rotate(90deg)}.time-picker input span.closed{transform:rotate(270deg)}.time-picker input.error{border:1px solid var(--nylas-error)}.time-picker p.error{color:var(--nylas-error);font-size:0.875rem;margin:0}.times{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.times ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.times ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:center;cursor:pointer}.times ul li.focused{background-color:var(--nylas-base-100)}.times ul li:hover,.times ul li:focus{background-color:var(--nylas-base-100)}.times ul li label{display:flex;align-items:center;gap:0.5rem}.times ul li label input{margin:0}',se=ie;r.dayjs.extend(te);const U=class{constructor(e){r.registerInstance(this,e),this.timeChange=r.createEvent(this,"timeChange",7),this.formError=r.createEvent(this,"formError",7),this.time=void 0,this.minimumStartTime=null,this.placeholder="hh:mmam/pm",this.name=void 0,this.hasError=!1,this.err="",this.showTimes=!1,this.ariaActivedescendant="",this.times=this.generateTimes(),this.shouldAutoScroll=!1}handleOutsideClick(e){!e.composedPath().includes(this.el)&&this.showTimes&&(this.showTimes=!1)}minimumStartTimeChangedHandler(){if(this.minimumStartTime){let e=r.dayjs().hour(parseInt(this.minimumStartTime)).minute(parseInt(this.minimumStartTime.slice(-4,-2)));this.minimumStartTime.slice(-2).toLowerCase()==="pm"&&parseInt(this.minimumStartTime)!==12?e=e.add(12,"hour"):this.minimumStartTime.slice(-2).toLowerCase()==="am"&&parseInt(this.minimumStartTime)===12&&(e=e.subtract(12,"hour")),this.times=this.generateTimes();const t=r.dayjs(this.times[0].value,"hh:mma");r.dayjs(this.time,"hh:mma").isBefore(t)&&(this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"}))}}componentDidRender(){if(this.showTimes&&this.shouldAutoScroll){const e=r.autocompleteTimeFormat(this.time),t=this.times.findIndex(n=>n.value===e);t>-1&&(this.shouldAutoScroll=!1,this.scrollToViewWithinParent(t));return}}handleTimeChange(e,t){const n=t.split(":");n[0]==="00"&&n[1].slice(-2)=="pm"&&(this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"})),r.validateTimeFormatInput(t)?(this.err="",this.formError.emit({key:this.el.id,message:""})):(this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"})),this.timeChange.emit({key:this.el.id,value:t})}handleTimeAutocomplete(e){var n;const t=(n=e.target)==null?void 0:n.value;if(!r.validateTimeFormatInput(t)){this.err="Invalid",this.formError.emit({key:this.el.id,message:"Invalid"});return}if(t===""){const i=r.roundToNearest15Minutes().format("hh:mma");this.timeChange.emit({key:this.el.id,value:i});return}if(!r.validateExactTimeFormat(t)){const i=r.autocompleteTimeFormat(t);this.timeChange.emit({key:this.el.id,value:i});return}this.timeChange.emit({key:this.el.id,value:t})}handleOnInput(e){var n;const t=(n=e.target)==null?void 0:n.value;if(r.validateTimeFormatInput(t)){if(t===""){const i=r.roundToNearest15Minutes().format("hh:mma"),a=this.times.findIndex(h=>h.value===i);a>-1&&this.scrollToViewWithinParent(a);return}if(!r.validateExactTimeFormat(t)){const i=r.autocompleteTimeFormat(t),a=this.times.findIndex(h=>h.value===i);a>-1&&this.scrollToViewWithinParent(a);return}}}generateTimes(){const e=[];let t=r.dayjs().set("hour",0).set("minute",0).set("second",0);this.minimumStartTime&&(t=r.dayjs(this.minimumStartTime,"hh:mma"));const n=t.endOf("day").diff(t,"minutes"),i=Math.round(n/15);for(let a=0;a<i+1;a++){const h=t.add(a*15,"minute");if(a==i&&h.format("hh:mma").includes("am"))break;e.push({id:a,value:h.format("hh:mma")})}return e}handleComboboxKeyDown(e){if(e.key==="ArrowDown"){if(e.preventDefault(),!this.showTimes){this.showTimes=!0,this.shouldAutoScroll=!0;return}if(this.ariaActivedescendant==="")this.ariaActivedescendant=this.times[0].id.toString(),this.focusOption(0);else{const t=this.times.findIndex(i=>i.id.toString()===this.ariaActivedescendant),n=t+1<this.times.length?t+1:0;this.ariaActivedescendant=this.times[n].id.toString(),this.focusOption(n)}}else if(e.key==="ArrowUp")if(e.preventDefault(),this.ariaActivedescendant==="")this.ariaActivedescendant=this.times[this.times.length-1].id.toString(),this.focusOption(this.times.length-1);else{const t=this.times.findIndex(i=>i.id.toString()===this.ariaActivedescendant),n=t-1>=0?t-1:this.times.length-1;this.ariaActivedescendant=this.times[n].id.toString(),this.focusOption(n)}else e.key==="Escape"&&(this.showTimes=!1,this.timeInput.focus())}handleListboxKeydown(e){const t=this.times,n=t.findIndex(i=>i.id.toString()===this.ariaActivedescendant);if(e.key==="ArrowDown"||e.key==="Tab"&&!e.shiftKey){e.preventDefault();const i=n+1<t.length?n+1:0;this.ariaActivedescendant=t[i].id.toString(),this.focusOption(i)}else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey){e.preventDefault();const i=n-1>=0?n-1:t.length-1;this.ariaActivedescendant=t[i].id.toString(),this.focusOption(i)}else if(e.key==="Enter"){if(e.preventDefault(),this.ariaActivedescendant){const i=t[n];this.handleTimeChange(e,i.value),this.showTimes=!1,this.ariaActivedescendant="",this.timeInput.focus()}}else e.key==="Escape"&&(this.showTimes=!1,this.timeInput.focus())}scrollToViewWithinParent(e){var x;const t=this.times[e],n=(x=this.el.shadowRoot)==null?void 0:x.getElementById(t.id.toString()),i=this.timeMenu;this.ariaActivedescendant=t.id.toString();const a=n.getBoundingClientRect(),h=i.getBoundingClientRect();a.top<h.top?i.scrollTop-=h.top-a.top:a.bottom>h.bottom&&(i.scrollTop+=a.bottom-h.bottom),a.left<h.left?i.scrollLeft-=h.left-a.left:a.right>h.right&&(i.scrollLeft+=a.right-h.right)}focusOption(e){var a;const t=this.times[e];if(!t)return;const n=t.id.toString(),i=(a=this.el.shadowRoot)==null?void 0:a.getElementById(n);i&&(i.focus(),i.scrollIntoView({behavior:"smooth",block:"nearest"}))}render(){return r.h(r.Host,{key:"877080483e0ada0d0b696406c87d77e425302c57"},r.h("div",{key:"4823aac7d1c66aed3fb05b662033b240807d836a",class:"time-picker",part:"time-picker"},r.h("input",{key:"90f29f4d489d5acc6f468e851ee309356134a5ab",type:"text",name:this.name,id:this.name,part:"time-input",class:{"time-input":!0,error:!!this.err||this.hasError},ref:e=>this.timeInput=e,value:this.time,onClick:()=>{this.showTimes=!this.showTimes,this.shouldAutoScroll=!0},"aria-haspopup":"listbox","aria-label":this.name,"aria-expanded":this.showTimes?"true":"false",placeholder:this.placeholder,onKeyDown:e=>this.handleComboboxKeyDown(e),onInput:e=>this.handleOnInput(e),onBlur:e=>this.handleTimeAutocomplete(e)}),this.err&&r.h("div",{class:"invalid-time-icon"}),this.showTimes&&r.h("div",{class:"times",part:"times",ref:e=>this.timeMenu=e},r.h("ul",{tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant,onKeyDown:e=>this.handleListboxKeydown(e)},this.times.map(e=>r.h("li",{tabindex:"0",key:e.id,id:e.id.toString(),class:{focused:this.ariaActivedescendant===e.id.toString()},onClick:t=>{this.handleTimeChange(t,e.value),this.showTimes=!1,this.timeInput.focus()},role:"option"},`${e.value}`)))),!this.showTimes&&this.err&&r.h("p",{class:"error",id:"email-error"},this.err)))}get el(){return r.getElement(this)}static get watchers(){return{minimumStartTime:["minimumStartTimeChangedHandler"]}}};U.style=se;exports.nylas_time_window_picker=U;
|