@nylas/react 1.1.0-canary.21 → 1.1.0-canary.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-circle-icon_2.entry-b8d6df60.js → add-circle-icon_3.entry-37a88ff3.js} +23 -13
- package/dist/add-circle-icon_3.entry-4f8f1cbf.cjs +1 -0
- package/dist/{archive-icon_7.entry-afaef817.cjs → archive-icon_7.entry-2ec9b077.cjs} +1 -1
- package/dist/{archive-icon_7.entry-3830776a.js → archive-icon_7.entry-3dcc4a66.js} +16 -16
- package/dist/{arrow-icon.entry-460cdd9f.cjs → arrow-icon.entry-175e8181.cjs} +1 -1
- package/dist/arrow-icon.entry-2cf3e94d.js +15 -0
- package/dist/{bold-icon_3.entry-80abafbb.js → bold-icon_3.entry-9fc74a39.js} +4 -4
- package/dist/{bold-icon_3.entry-1893eeec.cjs → bold-icon_3.entry-a3e61ad8.cjs} +1 -1
- package/dist/{button-component.entry-b78dc39e.cjs → button-component.entry-7fdb3bca.cjs} +1 -1
- package/dist/{button-component.entry-36137536.js → button-component.entry-861637f2.js} +2 -2
- package/dist/calendar-agenda-fill-icon_39.entry-3c21a3ec.cjs +7 -0
- package/dist/{calendar-agenda-fill-icon_40.entry-f19d6ad7.js → calendar-agenda-fill-icon_39.entry-493e91f6.js} +1268 -1300
- package/dist/{calendar-cancel-icon.entry-1fae00c5.js → calendar-cancel-icon.entry-3ca731f9.js} +2 -2
- package/dist/{calendar-cancel-icon.entry-0d83ee82.cjs → calendar-cancel-icon.entry-c9c7e3b3.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-e01c9028.cjs → calendar-check-icon_2.entry-5b8f8a75.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-159c38af.js → calendar-check-icon_2.entry-7c409a91.js} +5 -5
- package/dist/{calendar-icon.entry-3af9cb76.js → calendar-icon.entry-0589697f.js} +4 -4
- package/dist/{calendar-icon.entry-2e701aab.cjs → calendar-icon.entry-acd00f6f.cjs} +1 -1
- package/dist/{checkbox-component_2.entry-9ff2c85b.cjs → checkbox-component_2.entry-0aa252b9.cjs} +1 -1
- package/dist/{checkbox-component_2.entry-5eee51f6.js → checkbox-component_2.entry-538fd8ec.js} +3 -3
- package/dist/{checkmark-icon.entry-f96f1117.cjs → checkmark-icon.entry-0a184b31.cjs} +1 -1
- package/dist/{checkmark-icon.entry-0749b942.js → checkmark-icon.entry-56302db0.js} +4 -4
- package/dist/{chevron-icon_3.entry-c3989df2.cjs → chevron-icon_3.entry-7076e105.cjs} +1 -1
- package/dist/{chevron-icon_3.entry-2e9eebbc.js → chevron-icon_3.entry-80e03257.js} +13 -13
- package/dist/{clock-icon_4.entry-d4563931.cjs → clock-icon_4.entry-d6901afd.cjs} +1 -1
- package/dist/{clock-icon_4.entry-9395d0cb.js → clock-icon_4.entry-db3fbda1.js} +19 -19
- package/dist/{constants-67de2eec-e3b50fc6.cjs → constants-12bd3c98-22fd56f2.cjs} +1 -1
- package/dist/{constants-67de2eec-b17f5b96.js → constants-12bd3c98-26c75011.js} +4 -4
- package/dist/{copy-icon_3.entry-7de3667f.cjs → copy-icon_3.entry-33e89a37.cjs} +1 -1
- package/dist/{copy-icon_3.entry-7b276fa2.js → copy-icon_3.entry-9670b9f9.js} +7 -7
- package/dist/{document-refresh-icon.entry-6dd65cb6.js → document-refresh-icon.entry-149f2a3b.js} +5 -5
- package/dist/document-refresh-icon.entry-a3326831.cjs +1 -0
- package/dist/elements/index.d.ts +3 -0
- package/dist/{elements-dc5b338e-158dce67.cjs → elements-dc5b338e-211879a3.cjs} +1 -1
- package/dist/{elements-dc5b338e-5e8a704b.js → elements-dc5b338e-e07600d4.js} +1 -1
- package/dist/{focus-visible-e8093c16-9d88e8ee.js → focus-visible-e8093c16-284cefe0.js} +1 -1
- package/dist/{focus-visible-e8093c16-5883a317.cjs → focus-visible-e8093c16-cb97634f.cjs} +1 -1
- package/dist/{forward-icon_6.entry-acdf04ad.js → forward-icon_6.entry-554b0722.js} +9 -9
- package/dist/{forward-icon_6.entry-a59dada5.cjs → forward-icon_6.entry-751fdd4e.cjs} +3 -3
- package/dist/{globe-icon.entry-eef27331.cjs → globe-icon.entry-63eb510d.cjs} +1 -1
- package/dist/{globe-icon.entry-389c0391.js → globe-icon.entry-e3dd58bc.js} +2 -2
- package/dist/google-logo-icon_5.entry-bccce7f4.cjs +1 -0
- package/dist/google-logo-icon_5.entry-e462e091.js +748 -0
- package/dist/index-53420959-02fe58ef.js +5 -0
- package/dist/index-53420959-0b9c205e.cjs +1 -0
- package/dist/{index-6d9eeb53-15c69801.cjs → index-6d9eeb53-81e5b798.cjs} +1 -1
- package/dist/{index-6d9eeb53-c70fc8a7.js → index-6d9eeb53-cc42c6f1.js} +2 -2
- package/dist/{index-db48e0b6.cjs → index-8a536089.cjs} +14 -14
- package/dist/{index-f8317a8e.js → index-a15916e5.js} +398 -383
- package/dist/{index.es-b16d0cf5-d7f30c4a.cjs → index.es-5355a265-e701a627.cjs} +1 -1
- package/dist/{index.es-b16d0cf5-386496a9.js → index.es-5355a265-f8853ce4.js} +1 -1
- package/dist/{info-icon_2.entry-97d75550.js → info-icon_2.entry-3b349f01.js} +5 -5
- package/dist/{info-icon_2.entry-63914227.cjs → info-icon_2.entry-9559cf3b.cjs} +1 -1
- package/dist/{input-dropdown.entry-4d29246a.js → input-dropdown.entry-9bc68630.js} +2 -2
- package/dist/{input-dropdown.entry-629d7b54.cjs → input-dropdown.entry-d454f6bc.cjs} +1 -1
- package/dist/loading-icon.entry-1d49e471.js +15 -0
- package/dist/loading-icon.entry-a68da48b.cjs +1 -0
- package/dist/{mailbox-store-f11de360-d781fd36.js → mailbox-store-31d55036-1106efe2.js} +2 -2
- package/dist/{mailbox-store-f11de360-02a6de93.cjs → mailbox-store-31d55036-c8618c0b.cjs} +1 -1
- package/dist/{multi-select-dropdown.entry-8e14e9af.js → multi-select-dropdown.entry-36074a81.js} +2 -2
- package/dist/{multi-select-dropdown.entry-68fcca98.cjs → multi-select-dropdown.entry-e5ed9285.cjs} +1 -1
- package/dist/{nylas-booked-event-card_10.entry-9487941d.js → nylas-booked-event-card_10.entry-38d2fd2e.js} +75 -74
- package/dist/nylas-booked-event-card_10.entry-e530a8db.cjs +1 -0
- package/dist/nylas-booking-confirmation-type.entry-2fea82f9.js +106 -0
- package/dist/nylas-booking-confirmation-type.entry-5857a863.cjs +1 -0
- package/dist/{nylas-form-card.entry-ca669dea.cjs → nylas-form-card.entry-03a31218.cjs} +1 -1
- package/dist/{nylas-form-card.entry-ccfa5692.js → nylas-form-card.entry-6e45c873.js} +19 -19
- package/dist/{nylas-if-state.entry-93935670.js → nylas-if-state.entry-092f4e1a.js} +3 -3
- package/dist/{nylas-if-state.entry-faa11bb6.cjs → nylas-if-state.entry-61d7ebc5.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-e7e179ea.cjs → nylas-list-folders.entry-1abbb401.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-14fc1fe8.js → nylas-list-folders.entry-ab9e1c2c.js} +3 -3
- package/dist/{nylas-list-threads.entry-2118b146.js → nylas-list-threads.entry-2faaa2bb.js} +3 -3
- package/dist/{nylas-list-threads.entry-3f52fc06.cjs → nylas-list-threads.entry-dfc87aca.cjs} +1 -1
- package/dist/{nylas-login.entry-87a902d6.js → nylas-login.entry-243ae09e.js} +7 -7
- package/dist/{nylas-login.entry-915f0284.cjs → nylas-login.entry-d1cac0a1.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-eedbf796.js → nylas-mailbox-pagination.entry-b8225a3e.js} +2 -2
- package/dist/{nylas-mailbox-pagination.entry-9aa8a606.cjs → nylas-mailbox-pagination.entry-c27af71c.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-40b75810.js → nylas-mailbox-toolbar-button.entry-22347d22.js} +7 -7
- package/dist/{nylas-mailbox-toolbar-button.entry-ba5b826e.cjs → nylas-mailbox-toolbar-button.entry-b66d597d.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-179e5a5c.js → nylas-mailbox.entry-9e6e1b4d.js} +4 -4
- package/dist/{nylas-mailbox.entry-31de7f8f.cjs → nylas-mailbox.entry-cb80f58c.cjs} +1 -1
- package/dist/{nylas-provider.entry-7b70bbdc.js → nylas-provider.entry-196dd5da.js} +8 -8
- package/dist/{nylas-provider.entry-46fe01b6.cjs → nylas-provider.entry-28c12448.cjs} +1 -1
- package/dist/nylas-reminder-emails.entry-47ef5a9d.cjs +4 -0
- package/dist/nylas-reminder-emails.entry-b655d888.js +129 -0
- package/dist/nylas-reminder-time_2.entry-0f3747fb.cjs +1 -0
- package/dist/nylas-reminder-time_2.entry-9d8f7436.js +105 -0
- package/dist/{nylas-scheduler-editor.entry-76b68f66.cjs → nylas-scheduler-editor.entry-504e8ed3.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-f1f80de1.js → nylas-scheduler-editor.entry-feb7a7db.js} +12 -11
- package/dist/nylas-scheduling.entry-8c8f8e35.cjs +1 -0
- package/dist/{nylas-scheduling.entry-31d13205.js → nylas-scheduling.entry-d35efa9a.js} +73 -73
- package/dist/{nylas-threads-refresh.entry-a3ea46aa.js → nylas-threads-refresh.entry-91af9af3.js} +4 -4
- package/dist/{nylas-threads-refresh.entry-c9f9db8c.cjs → nylas-threads-refresh.entry-e637161b.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-01482ddf.js → nylas-threads-search.entry-5457dcec.js} +5 -5
- package/dist/{nylas-threads-search.entry-a4ab0d47.cjs → nylas-threads-search.entry-b944f95a.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-5a3bb0b7.cjs → nylas-time-window-picker.entry-134ef726.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-5f063b2b.js → nylas-time-window-picker.entry-a6fd216b.js} +12 -12
- package/dist/{nylas-view-thread.entry-cb057b9e.js → nylas-view-thread.entry-6fdd6cb1.js} +3 -3
- package/dist/{nylas-view-thread.entry-82e78b82.cjs → nylas-view-thread.entry-9296a505.cjs} +1 -1
- package/dist/{person-icon.entry-78cdc7f9.cjs → person-icon.entry-1cdb4dc2.cjs} +1 -1
- package/dist/{person-icon.entry-3e30c63c.js → person-icon.entry-4a695727.js} +4 -4
- package/dist/{play-icon_2.entry-4fb1938c.cjs → play-icon_2.entry-10fd617e.cjs} +1 -1
- package/dist/{play-icon_2.entry-71eaad5c.js → play-icon_2.entry-fb013b17.js} +6 -6
- package/dist/react.cjs +1 -1
- package/dist/react.js +104 -101
- package/dist/{refresh-icon.entry-db85d14d.js → refresh-icon.entry-46c92605.js} +4 -4
- package/dist/{refresh-icon.entry-3570353d.cjs → refresh-icon.entry-9dbb04ba.cjs} +1 -1
- package/dist/{register-component-b2a51b20-9a913603.cjs → register-component-592986c5-5edf5835.cjs} +1 -1
- package/dist/{register-component-b2a51b20-8a262dcf.js → register-component-592986c5-d5d210a8.js} +1 -1
- package/dist/{scheduler-config-store-9ccfba4d-6806e3cb.cjs → scheduler-config-store-9ccfba4d-3ec35859.cjs} +1 -1
- package/dist/{scheduler-config-store-9ccfba4d-a6745ccc.js → scheduler-config-store-9ccfba4d-b08031b5.js} +1 -1
- package/dist/{scheduler-store-db06b30a-1e63b67f.js → scheduler-store-fd0d11a5-313e8592.js} +1 -1
- package/dist/{scheduler-store-db06b30a-d5e6b6c3.cjs → scheduler-store-fd0d11a5-b180b3b7.cjs} +1 -1
- package/dist/{textarea-component.entry-f5f402a1.js → textarea-component.entry-0cd3b57f.js} +4 -4
- package/dist/{textarea-component.entry-be870b8f.cjs → textarea-component.entry-788eb37a.cjs} +1 -1
- package/dist/{time-period-selector.entry-d1a8470b.js → time-period-selector.entry-112c0b64.js} +6 -6
- package/dist/{time-period-selector.entry-fc7d61c6.cjs → time-period-selector.entry-1e0b720b.cjs} +1 -1
- package/dist/{translate-icon.entry-b91a0449.js → translate-icon.entry-a4df3c16.js} +4 -4
- package/dist/{translate-icon.entry-3ae0ddae.cjs → translate-icon.entry-c701b391.cjs} +1 -1
- package/dist/{warning-icon.entry-54127f45.cjs → warning-icon.entry-bda0aafa.cjs} +1 -1
- package/dist/{warning-icon.entry-acdc811b.js → warning-icon.entry-d1703715.js} +7 -7
- package/package.json +3 -3
- package/dist/add-circle-icon_2.entry-29cc2385.cjs +0 -1
- package/dist/arrow-icon.entry-19f00716.js +0 -15
- package/dist/calendar-agenda-fill-icon_40.entry-62c66fce.cjs +0 -10
- package/dist/close-icon.entry-cf9f0a69.js +0 -15
- package/dist/close-icon.entry-e24af309.cjs +0 -1
- package/dist/document-refresh-icon.entry-582ac233.cjs +0 -1
- package/dist/google-logo-icon_4.entry-e9be320c.cjs +0 -1
- package/dist/google-logo-icon_4.entry-eae19fc8.js +0 -637
- package/dist/index-53420959-82a5306f.cjs +0 -1
- package/dist/index-53420959-9b1699ec.js +0 -5
- package/dist/loading-icon.entry-2f15a09f.cjs +0 -1
- package/dist/loading-icon.entry-fc9bc740.js +0 -15
- package/dist/nylas-booked-event-card_10.entry-4da23b61.cjs +0 -1
- package/dist/nylas-custom-booking-flow.entry-0e16973b.js +0 -106
- package/dist/nylas-custom-booking-flow.entry-338b0a8f.cjs +0 -1
- package/dist/nylas-scheduling.entry-3ce8c52f.cjs +0 -1
|
@@ -1,637 +0,0 @@
|
|
|
1
|
-
import { r as $, h as e, c as _, z as Lt, d as b, A as J, H as kt, g as Ct } from "./index-f8317a8e.js";
|
|
2
|
-
import { R as xt } from "./register-component-b2a51b20-8a262dcf.js";
|
|
3
|
-
import { D as wt } from "./constants-67de2eec-b17f5b96.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import "react-dom";
|
|
6
|
-
const Ft = ".sc-google-logo-icon-h{display:flex}", Ht = Ft, Dt = class {
|
|
7
|
-
constructor(t) {
|
|
8
|
-
$(this, t), this.width = "24", this.height = "24";
|
|
9
|
-
}
|
|
10
|
-
render() {
|
|
11
|
-
return e("svg", { key: "3b66b8f8406bb1bb2735eefb8e353f564b148d76", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("g", { key: "e7e6e047f7126a577be5b6e67495e091fe6a4a91", "clip-path": "url(#clip0_959_12452)" }, e("path", { key: "cafb8f5cc31f77a0e964f6809df04080225c0059", d: "M23.745 12.27C23.745 11.48 23.675 10.73 23.555 10H12.255V14.51H18.725C18.435 15.99 17.585 17.24 16.325 18.09V21.09H20.185C22.445 19 23.745 15.92 23.745 12.27Z", fill: "#4285F4" }), e("path", { key: "25d96d59ba32154b37a83bbcfe2114386d462e7f", d: "M12.255 24C15.495 24 18.205 22.92 20.185 21.09L16.325 18.09C15.245 18.81 13.875 19.25 12.255 19.25C9.12504 19.25 6.47505 17.14 5.52505 14.29H1.54504V17.38C3.51504 21.3 7.56504 24 12.255 24Z", fill: "#34A853" }), e("path", { key: "054c72712a95610e75ccefa638bba56cfefb9dc7", d: "M5.52501 14.2901C5.27501 13.5701 5.145 12.8001 5.145 12.0001C5.145 11.2001 5.28501 10.4301 5.52501 9.71012V6.62012H1.545C0.725004 8.24012 0.255005 10.0601 0.255005 12.0001C0.255005 13.9401 0.725004 15.7601 1.545 17.3801L5.52501 14.2901Z", fill: "#FBBC05" }), e("path", { key: "3450a383589adbdde25a2d7c3f528385746d7116", d: "M12.255 4.75C14.025 4.75 15.605 5.36 16.855 6.55L20.275 3.13C18.205 1.19 15.495 0 12.255 0C7.56504 0 3.51504 2.7 1.54504 6.62L5.52505 9.71C6.47505 6.86 9.12504 4.75 12.255 4.75Z", fill: "#EA4335" })), e("defs", { key: "1c29157546a3b7c420398f2b4fa65a17b02e5010" }, e("clipPath", { key: "9e1804395e96faa50fb95a9600cee29c415216a2", id: "clip0_959_12452" }, e("rect", { key: "98fd7d191b71077f96e8b1f2bfe4c3446b01f2fa", width: 24, height: 24, fill: "white" }))));
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
Dt.style = Ht;
|
|
15
|
-
const Et = ".sc-microsoft-logo-icon-h{display:flex}", Bt = Et, Pt = class {
|
|
16
|
-
constructor(t) {
|
|
17
|
-
$(this, t), this.width = "22", this.height = "22";
|
|
18
|
-
}
|
|
19
|
-
render() {
|
|
20
|
-
return e("svg", { key: "b136cb884eb1d99d5673ad39651d6370de1acd32", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("path", { key: "475d51fa261724499d3abb9be21e4aa256b35d7b", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), e("path", { key: "551e2efd56295a498f300a384d8ffc7fd3766188", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), e("path", { key: "d3f07689492b30b3494f5097db79545b5b35d69d", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), e("path", { key: "ba3c56ed418db7603b969795e0f31e32a066fbb4", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
Pt.style = Bt;
|
|
24
|
-
function Nt({ id: t, formState: i, activeTab: a, calendars: s, currentUser: r }) {
|
|
25
|
-
var n, d, o;
|
|
26
|
-
switch (a) {
|
|
27
|
-
case "eventInfo":
|
|
28
|
-
const p = i.title, m = i.description, v = parseInt(i.duration), x = i.location, S = i.conferencing;
|
|
29
|
-
return e(
|
|
30
|
-
"div",
|
|
31
|
-
{ key: t },
|
|
32
|
-
e(
|
|
33
|
-
"nylas-event-info",
|
|
34
|
-
null,
|
|
35
|
-
e(
|
|
36
|
-
"div",
|
|
37
|
-
{ slot: "inputs" },
|
|
38
|
-
e("nylas-event-title", { name: "title", eventTitle: p, exportparts: "net, net__title, net__dropdown-content" }),
|
|
39
|
-
e("nylas-event-duration", { name: "duration", eventDurationMinutes: v, exportparts: "ned, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content" }),
|
|
40
|
-
e("nylas-event-location", { name: "location", eventLocation: x, eventConferencing: S, userProvider: r.provider, exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
|
|
41
|
-
e("nylas-event-description", { name: "description", eventDescription: m, exportparts: "nedesc, nedesc__textarea" })
|
|
42
|
-
)
|
|
43
|
-
)
|
|
44
|
-
);
|
|
45
|
-
case "availability":
|
|
46
|
-
const T = i.availability.openHours, L = i.availability.timezone ? i.availability.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
47
|
-
return e(
|
|
48
|
-
"div",
|
|
49
|
-
{ key: t },
|
|
50
|
-
e("nylas-participant-booking-calendars", { name: "participant-booking-calendars", participants: i.participants, calendars: s }),
|
|
51
|
-
e("nylas-connected-calendars", { name: "connected-calendars", participants: i.participants }),
|
|
52
|
-
e("nylas-availability-picker", { name: "availability", openHours: T, defaultTimezone: L, exportparts: "nap__header, nap__select-timezone, nap__select-timezone-button, nap__select-timezone-dropdown-content, nap__availability, nap__day, nap__time-ranges, nap__time-range, nap__add-time-range, nap__time-picker-container, nap__time-picker-input, nap__time-picker-times" })
|
|
53
|
-
);
|
|
54
|
-
case "bookingOptions":
|
|
55
|
-
return e(
|
|
56
|
-
"div",
|
|
57
|
-
{ key: t },
|
|
58
|
-
e("nylas-buffer-time", { name: "buffer-time", buffer: i.buffer, exportparts: "nbt, nbt__header, nbt__body, nbt__dropdown-before, nbt__dropdown-button-before, nbt__dropdown-content-before, nbt__dropdown-after, nbt__dropdown-button-after, nbt__dropdown-content-after, nbt__preview" }),
|
|
59
|
-
e(
|
|
60
|
-
"nylas-event-limits",
|
|
61
|
-
null,
|
|
62
|
-
e(
|
|
63
|
-
"div",
|
|
64
|
-
{ slot: "inputs" },
|
|
65
|
-
e("nylas-min-booking-notice", { name: "min-booking-notice", minBookingNotice: i.minBookingNotice, exportparts: "nmbn, nmbn__number-dropdown, nmbn__number-dropdown-button, nmbn__number-dropdown-content, nmbn__period-dropdown, nmbn__period-dropdown-button, nmbn__period-dropdown-content" }),
|
|
66
|
-
e("nylas-limit-future-bookings", { name: "limit-future-bookings", availableDaysInFuture: i.availableDaysInFuture, exportparts: "nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content" }),
|
|
67
|
-
e("nylas-min-cancellation-notice", { name: "min-cancellation-notice", minCancellationNotice: i.minCancellationNotice, exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" }),
|
|
68
|
-
e("nylas-cancellation-policy", { name: "cancellation-policy", cancellationPolicy: i.cancellationPolicy, exportparts: "ncpolicy, ncpolicy__textarea" })
|
|
69
|
-
)
|
|
70
|
-
),
|
|
71
|
-
e("nylas-timeslot-interval", { name: "timeslot-interval", eventDurationMinutes: parseInt(i.duration), exportparts: "nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content" }),
|
|
72
|
-
e("nylas-customize-booking-settings", { name: "customize-booking-settings", exportparts: "ncbs, ncbs__header, ncbs__settings, ncbs__settings-div, ncbs__additional_guests, ncbs__cancellation_options, ncbs__rescheduling_options" })
|
|
73
|
-
);
|
|
74
|
-
case "communications":
|
|
75
|
-
return e(
|
|
76
|
-
"div",
|
|
77
|
-
{ key: t },
|
|
78
|
-
e(
|
|
79
|
-
"div",
|
|
80
|
-
{ class: "tab-header" },
|
|
81
|
-
e("h3", null, "Event communications"),
|
|
82
|
-
e("p", null, "Set up automatic communications for your events.")
|
|
83
|
-
),
|
|
84
|
-
e("nylas-confirmation-email", { name: "confirmation-email-template", confirmationEmailTemplate: i.emailTemplate, isOpen: !((d = (n = i.reminders) == null ? void 0 : n.overrides) != null && d.length), participants: i.participants, exportparts: "nce, nce__tab-heading, nce__header, nce__body, nce__confirmation-email-toggle--container, nce__summary, nce__reminder-input_dropdown, nce__reminder-input_dropdown-input, nce__reminder-input_dropdown-content" }),
|
|
85
|
-
e("nylas-reminder-emails", { name: "reminder-emails", eventReminders: ((o = i.reminders) == null ? void 0 : o.overrides) ?? [], participants: i.participants, exportparts: "nre, nre__tab-heading, nre__header, nre__body, nre__confirmation-email-toggle--container, nre__summary, nre__reminder-input_dropdown, nre__reminder-input_dropdown-input, nre__reminder-input_dropdown-content" })
|
|
86
|
-
);
|
|
87
|
-
case "participants":
|
|
88
|
-
return e(
|
|
89
|
-
"div",
|
|
90
|
-
{ key: t },
|
|
91
|
-
e("nylas-additional-participants", { name: "participants", eventParticipants: i.participants, exportparts: "nap__title, nap__subtitle, nap__content, nap__input_group, nap__input_wrapper, nap__input, nap__remove-participant" }),
|
|
92
|
-
e("nylas-participants-custom-availability", { name: "participant-custom-availability", participants: i.participants, exportparts: "npca, npca__header, npca__content, npca__participant-container, npca__participant-title, npca__participant-toggle--container, npca__toggle-label, npca__toggle-input, npca__toggle-slider" })
|
|
93
|
-
);
|
|
94
|
-
case "bookingForm":
|
|
95
|
-
const F = Object.entries(i.additionalFields).map(([f, H]) => ({ key: f, ...H }));
|
|
96
|
-
return e(
|
|
97
|
-
"div",
|
|
98
|
-
{ key: t },
|
|
99
|
-
e("nylas-booking-form-config", { name: "additional-fields", additonalFields: F })
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
const Ot = '.sc-nylas-editor-tabs-h{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}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:554px;display:grid;grid-template-columns:minmax(224px, 25%) 1fr}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{display:table-column-group;height:auto}}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs{display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;color:var(--nylas-base-900);background:var(--nylas-base-0);border:none;height:56px;font-family:var(--nylas-font-family);font-size:16px;font-weight:500;line-height:24px;cursor:pointer}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.active.sc-nylas-editor-tabs{font-weight:600;background:var(--nylas-base-0);color:var(--nylas-primary);border-left:4px solid var(--nylas-primary);box-shadow:0px 1px 2px 0px rgba(0, 0, 0, 0.0588235294);box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1019607843)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.hide.sc-nylas-editor-tabs{display:none}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px;overflow-y:auto}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs{width:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs{display:flex;flex-direction:column;gap:1rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs{display:flex;flex-direction:column;margin:1rem 1rem 0.5rem;row-gap:4px}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs h3.sc-nylas-editor-tabs{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{margin:0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.footer.sc-nylas-editor-tabs{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs{flex-direction:column;height:auto}}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .preview.sc-nylas-editor-tabs{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{max-width:524px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.unsaved-changes.sc-nylas-editor-tabs{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.saved-changes.sc-nylas-editor-tabs{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error.sc-nylas-editor-tabs{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error-full-width.sc-nylas-editor-tabs{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button-component.sc-nylas-editor-tabs{width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs span.sc-nylas-editor-tabs{display:flex;align-items:center;justify-content:center;gap:0.5rem}', It = Ot;
|
|
104
|
-
var Rt = function(t, i, a, s) {
|
|
105
|
-
var r = arguments.length, n = r < 3 ? i : s === null ? s = Object.getOwnPropertyDescriptor(i, a) : s, d;
|
|
106
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
107
|
-
n = Reflect.decorate(t, i, a, s);
|
|
108
|
-
else
|
|
109
|
-
for (var o = t.length - 1; o >= 0; o--)
|
|
110
|
-
(d = t[o]) && (n = (r < 3 ? d(n) : r > 3 ? d(i, a, n) : d(i, a)) || n);
|
|
111
|
-
return r > 3 && n && Object.defineProperty(i, a, n), n;
|
|
112
|
-
}, V = function(t, i) {
|
|
113
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
114
|
-
return Reflect.metadata(t, i);
|
|
115
|
-
};
|
|
116
|
-
const St = class {
|
|
117
|
-
constructor(t) {
|
|
118
|
-
$(this, t), this.schedulerConfigChanged = _(this, "schedulerConfigChanged", 7), this.cancelButtonClick = _(this, "cancelButtonClick", 7), this.formSubmitted = _(this, "formSubmitted", 7), this.previewButtonClicked = _(this, "previewButtonClicked", 7), this.schedulerEditorFormUpdated = _(this, "schedulerEditorFormUpdated", 7), this.setError = (i) => {
|
|
119
|
-
this.error = i.message;
|
|
120
|
-
}, this.formSubmissionHandler = async (i) => {
|
|
121
|
-
var O, G, W, q, K, Q, X, Y, tt, et, it, at, nt, st, ot, rt;
|
|
122
|
-
if (i.preventDefault(), this.formSubmitted.emit(), !this.formRef.checkValidity()) {
|
|
123
|
-
this.error = this.formRef.validationMessage || "Please fix the form errors.";
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
this.isLoading = !0, this.hasUnsavedChanges = !1;
|
|
127
|
-
const s = this.updateFormState(), { title: r, description: n, duration: d, availability: o, bookingCalendar: p, location: m, bookingType: v, buffer: x, availableDaysInFuture: S, minCancellationNotice: T, minBookingNotice: L, cancellationPolicy: F, timeslotInterval: f, additionalGuestsHidden: H, hideCancellationOptions: I, hideReschedulingOptions: R, participants: w, participantOpenHours: h, additionalFields: z, participantCalendars: k, conferencing: M, participantBookingCalendars: g, reminders: j, emailTemplate: U } = s, c = (G = (O = this.selectedConfiguration) == null ? void 0 : O.participants) == null ? void 0 : G.find((l) => l.is_organizer), C = k && (c != null && c.email) ? k[c == null ? void 0 : c.email] : [], B = ((W = c == null ? void 0 : c.booking) == null ? void 0 : W.calendar_id) || p, P = d ? parseInt(d) : 30, D = w && (w == null ? void 0 : w.length) > 0 ? w : [
|
|
128
|
-
{
|
|
129
|
-
name: (c == null ? void 0 : c.name) ?? ((q = this.currentUser) == null ? void 0 : q.name) ?? "",
|
|
130
|
-
email: (c == null ? void 0 : c.email) ?? ((K = this.currentUser) == null ? void 0 : K.email) ?? "",
|
|
131
|
-
is_organizer: !0,
|
|
132
|
-
timezone: (o == null ? void 0 : o.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
133
|
-
availability: {
|
|
134
|
-
calendar_ids: C.length ? C : ["primary"],
|
|
135
|
-
open_hours: []
|
|
136
|
-
},
|
|
137
|
-
booking: {
|
|
138
|
-
calendar_id: p && p !== "" ? p : "primary"
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
], N = {
|
|
142
|
-
...((Q = this.selectedConfiguration) == null ? void 0 : Q.id) && { id: this.selectedConfiguration.id },
|
|
143
|
-
version: ((X = this.selectedConfiguration) == null ? void 0 : X.version) ?? "1.0.0",
|
|
144
|
-
availability: {
|
|
145
|
-
duration_minutes: P,
|
|
146
|
-
interval_minutes: (f == null ? void 0 : f.interval) ?? P,
|
|
147
|
-
round_to: f == null ? void 0 : f.roundTo,
|
|
148
|
-
availability_rules: {
|
|
149
|
-
availability_method: ((et = (tt = (Y = this.selectedConfiguration) == null ? void 0 : Y.availability) == null ? void 0 : tt.availability_rules) == null ? void 0 : et.availability_method) ?? "collective",
|
|
150
|
-
buffer: x || { before: 0, after: 0 },
|
|
151
|
-
default_open_hours: (o == null ? void 0 : o.openHours) ?? ((nt = (at = (it = this.selectedConfiguration) == null ? void 0 : it.availability) == null ? void 0 : at.availability_rules) == null ? void 0 : nt.default_open_hours) ?? wt,
|
|
152
|
-
round_robin_group_id: ((rt = (ot = (st = this.selectedConfiguration) == null ? void 0 : st.availability) == null ? void 0 : ot.availability_rules) == null ? void 0 : rt.round_robin_group_id) ?? ""
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
participants: [
|
|
156
|
-
...D == null ? void 0 : D.map((l) => {
|
|
157
|
-
var lt, dt, ct, bt, ht, ut, pt, mt, ft, yt, gt, _t, vt;
|
|
158
|
-
return l.is_organizer ? {
|
|
159
|
-
name: l.name ?? "",
|
|
160
|
-
email: l.email,
|
|
161
|
-
is_organizer: !0,
|
|
162
|
-
timezone: ((dt = (lt = h == null ? void 0 : h[l.email]) == null ? void 0 : lt[0]) == null ? void 0 : dt.timezone) ?? ((ht = (bt = (ct = l.availability) == null ? void 0 : ct.open_hours) == null ? void 0 : bt[0]) == null ? void 0 : ht.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
163
|
-
availability: {
|
|
164
|
-
calendar_ids: C.length ? C : ["primary"],
|
|
165
|
-
open_hours: (h == null ? void 0 : h[l.email]) ?? ((ut = l.availability) == null ? void 0 : ut.open_hours) ?? []
|
|
166
|
-
},
|
|
167
|
-
booking: {
|
|
168
|
-
calendar_id: B || "primary"
|
|
169
|
-
}
|
|
170
|
-
} : {
|
|
171
|
-
...l,
|
|
172
|
-
timezone: ((mt = (pt = h == null ? void 0 : h[l.email]) == null ? void 0 : pt[0]) == null ? void 0 : mt.timezone) ?? ((gt = (yt = (ft = l.availability) == null ? void 0 : ft.open_hours) == null ? void 0 : yt[0]) == null ? void 0 : gt.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
173
|
-
availability: l.availability ? {
|
|
174
|
-
calendar_ids: (k == null ? void 0 : k[l.email]) ?? ((_t = l.availability) == null ? void 0 : _t.calendar_ids) ?? ["primary"],
|
|
175
|
-
open_hours: (h == null ? void 0 : h[l.email]) ?? ((vt = l.availability) == null ? void 0 : vt.open_hours) ?? []
|
|
176
|
-
} : void 0,
|
|
177
|
-
booking: g != null && g[l.email] ? { calendar_id: g == null ? void 0 : g[l.email] } : (l == null ? void 0 : l.booking) ?? void 0
|
|
178
|
-
};
|
|
179
|
-
})
|
|
180
|
-
],
|
|
181
|
-
event_booking: {
|
|
182
|
-
title: (r == null ? void 0 : r.toString()) ?? "",
|
|
183
|
-
description: (n == null ? void 0 : n.toString()) ?? "",
|
|
184
|
-
location: (m == null ? void 0 : m.toString()) ?? "",
|
|
185
|
-
booking_type: (v == null ? void 0 : v.toString()) ?? "booking",
|
|
186
|
-
timezone: (o == null ? void 0 : o.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
187
|
-
conferencing: M,
|
|
188
|
-
reminders: j
|
|
189
|
-
},
|
|
190
|
-
scheduler: {
|
|
191
|
-
cancellation_policy: F ?? "",
|
|
192
|
-
available_days_in_future: S ?? 30,
|
|
193
|
-
min_cancellation_notice: T ?? 0,
|
|
194
|
-
min_booking_notice: L ?? 60,
|
|
195
|
-
hide_additional_guests: H ?? !1,
|
|
196
|
-
hide_cancellation_options: I ?? !1,
|
|
197
|
-
hide_rescheduling_options: R ?? !1,
|
|
198
|
-
additional_fields: z,
|
|
199
|
-
email_template: U
|
|
200
|
-
}
|
|
201
|
-
}, A = Lt(N, this.selectedConfiguration), u = this.action === "create" ? A : N;
|
|
202
|
-
this.isConfigRoundRobin(u) && (u.participants = u.participants.map((l) => ({ ...l, is_organizer: void 0 })));
|
|
203
|
-
const y = (l) => {
|
|
204
|
-
this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
|
|
205
|
-
this.changesSaved = !1;
|
|
206
|
-
}, 5e3);
|
|
207
|
-
};
|
|
208
|
-
this.checkForClientSideErrors(u) || this.schedulerConfigChanged.emit({ config: u, resetLoadingState: y, setError: this.setError, action: this.action });
|
|
209
|
-
}, this.isConfigRoundRobin = (i) => {
|
|
210
|
-
var a, s, r, n;
|
|
211
|
-
return ((s = (a = i.availability) == null ? void 0 : a.availability_rules) == null ? void 0 : s.availability_method) === "max-availability" || ((n = (r = i.availability) == null ? void 0 : r.availability_rules) == null ? void 0 : n.availability_method) === "max-fairness";
|
|
212
|
-
}, this.checkForClientSideErrors = (i) => {
|
|
213
|
-
var n;
|
|
214
|
-
let a = !1, s = "";
|
|
215
|
-
const r = (n = i.scheduler) == null ? void 0 : n.additional_fields;
|
|
216
|
-
return r && (s = "Booking form error: ", Object.entries(r).forEach((d) => {
|
|
217
|
-
const o = d[1];
|
|
218
|
-
if (o.label === "") {
|
|
219
|
-
s += `Label is required for field of type ${o.type}.`, a = !0;
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
if (o.options) {
|
|
223
|
-
for (const p of o.options)
|
|
224
|
-
if (p === "") {
|
|
225
|
-
s += `Empty option detected inside ${o.label} of type ${o.type}.`, a = !0;
|
|
226
|
-
break;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
})), a && (this.isLoading = !1, this.setError(new Error(s))), a;
|
|
230
|
-
}, this.calendars = void 0, this.selectedConfiguration = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.hideEditorTabs = [], this.action = "create", this.activeTab = "eventInfo", this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
|
|
231
|
-
}
|
|
232
|
-
configChangedHandler(t) {
|
|
233
|
-
b("[nylas-editor-tabs]", "configChangedHandler", t, this.selectedConfiguration), this.formState = {
|
|
234
|
-
...this.getFormStateFromConfig(t)
|
|
235
|
-
}, t.id ? this.action = "edit" : this.action = "create";
|
|
236
|
-
}
|
|
237
|
-
userChangedHandler(t) {
|
|
238
|
-
b("[nylas-editor-tabs]", "userChangedHandler", t), t && (this.formState = {
|
|
239
|
-
...this.getFormStateFromConfig(this.selectedConfiguration)
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
connectedCallback() {
|
|
243
|
-
b("[nylas-editor-tabs]", "connectedCallback");
|
|
244
|
-
}
|
|
245
|
-
componentWillLoad() {
|
|
246
|
-
b("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
|
|
247
|
-
}
|
|
248
|
-
componentDidLoad() {
|
|
249
|
-
var i;
|
|
250
|
-
b("[nylas-editor-tabs]", "componentDidLoad");
|
|
251
|
-
const t = (i = this.host.querySelector("button.tab:not(.hide)")) == null ? void 0 : i.name;
|
|
252
|
-
t && (this.activeTab = t);
|
|
253
|
-
}
|
|
254
|
-
disconnectedCallback() {
|
|
255
|
-
b("[nylas-editor-tabs]", "disconnectedCallback");
|
|
256
|
-
}
|
|
257
|
-
handleValueChanged(t) {
|
|
258
|
-
b("[nylas-editor-tabs]", "handleValueChanged", t);
|
|
259
|
-
const { name: i, value: a } = t.detail;
|
|
260
|
-
this.setFormState(a, i), this.formState = { ...this.formState }, this.hasUnsavedChanges = !0, this.error = "", this.schedulerEditorFormUpdated.emit({
|
|
261
|
-
value: t.detail.value,
|
|
262
|
-
name: t.detail.name
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
getFormStateFromConfig(t) {
|
|
266
|
-
var a, s, r, n, d, o, p, m, v, x, S, T, L, F, f, H, I, R, w, h, z, k, M, g, j, U, c, C, B, P, D, N, A;
|
|
267
|
-
let i = (a = t == null ? void 0 : t.participants) == null ? void 0 : a.find((u) => u.is_organizer);
|
|
268
|
-
return !i && ((r = (s = t == null ? void 0 : t.availability) == null ? void 0 : s.availability_rules) == null ? void 0 : r.availability_method) !== "collective" && (i = (n = t == null ? void 0 : t.participants) == null ? void 0 : n.find((u) => {
|
|
269
|
-
var y;
|
|
270
|
-
return u.email === ((y = this.currentUser) == null ? void 0 : y.email);
|
|
271
|
-
}), i && (i.is_organizer = !0)), {
|
|
272
|
-
title: ((d = t == null ? void 0 : t.event_booking) == null ? void 0 : d.title) ?? "",
|
|
273
|
-
description: ((o = t == null ? void 0 : t.event_booking) == null ? void 0 : o.description) ?? "",
|
|
274
|
-
duration: ((m = (p = t == null ? void 0 : t.availability) == null ? void 0 : p.duration_minutes) == null ? void 0 : m.toString()) ?? "30",
|
|
275
|
-
availability: {
|
|
276
|
-
timezone: ((v = t == null ? void 0 : t.event_booking) == null ? void 0 : v.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
277
|
-
openHours: ((S = (x = t == null ? void 0 : t.availability) == null ? void 0 : x.availability_rules) == null ? void 0 : S.default_open_hours) ?? wt
|
|
278
|
-
},
|
|
279
|
-
additionalFields: ((T = t == null ? void 0 : t.scheduler) == null ? void 0 : T.additional_fields) ?? {},
|
|
280
|
-
conferencing: ((L = t == null ? void 0 : t.event_booking) == null ? void 0 : L.conferencing) ?? {},
|
|
281
|
-
calendarIds: ((F = i == null ? void 0 : i.availability) == null ? void 0 : F.calendar_ids) ?? [],
|
|
282
|
-
participants: (t == null ? void 0 : t.participants) ?? [],
|
|
283
|
-
bookingCalendar: ((f = i == null ? void 0 : i.booking) == null ? void 0 : f.calendar_id) ?? (i == null ? void 0 : i.email) ?? "",
|
|
284
|
-
location: ((H = t == null ? void 0 : t.event_booking) == null ? void 0 : H.location) ?? "",
|
|
285
|
-
bookingType: ((I = t == null ? void 0 : t.event_booking) == null ? void 0 : I.booking_type) ?? "booking",
|
|
286
|
-
buffer: ((w = (R = t == null ? void 0 : t.availability) == null ? void 0 : R.availability_rules) == null ? void 0 : w.buffer) ?? { before: 0, after: 0 },
|
|
287
|
-
cancellationPolicy: ((h = t == null ? void 0 : t.scheduler) == null ? void 0 : h.cancellation_policy) ?? "",
|
|
288
|
-
availableDaysInFuture: ((z = t == null ? void 0 : t.scheduler) == null ? void 0 : z.available_days_in_future) ?? 30,
|
|
289
|
-
minCancellationNotice: ((k = t == null ? void 0 : t.scheduler) == null ? void 0 : k.min_cancellation_notice) ?? 0,
|
|
290
|
-
minBookingNotice: ((M = t == null ? void 0 : t.scheduler) == null ? void 0 : M.min_booking_notice) ?? 60,
|
|
291
|
-
timeslotInterval: {
|
|
292
|
-
interval: ((g = t == null ? void 0 : t.availability) == null ? void 0 : g.interval_minutes) ?? ((j = t == null ? void 0 : t.availability) == null ? void 0 : j.duration_minutes),
|
|
293
|
-
roundTo: (U = t == null ? void 0 : t.availability) == null ? void 0 : U.round_to
|
|
294
|
-
},
|
|
295
|
-
additionalGuestsHidden: ((c = t == null ? void 0 : t.scheduler) == null ? void 0 : c.hide_additional_guests) ?? !1,
|
|
296
|
-
hideCancellationOptions: ((C = t == null ? void 0 : t.scheduler) == null ? void 0 : C.hide_cancellation_options) ?? !1,
|
|
297
|
-
hideReschedulingOptions: ((B = t == null ? void 0 : t.scheduler) == null ? void 0 : B.hide_rescheduling_options) ?? !1,
|
|
298
|
-
participantBookingCalendars: ((P = t == null ? void 0 : t.participants) == null ? void 0 : P.reduce((u, y) => {
|
|
299
|
-
var E, O;
|
|
300
|
-
return (E = y.booking) != null && E.calendar_id && (u[y.email] = (O = y.booking) == null ? void 0 : O.calendar_id), u;
|
|
301
|
-
})) ?? {},
|
|
302
|
-
participantCalendars: ((D = t == null ? void 0 : t.participants) == null ? void 0 : D.reduce((u, y) => {
|
|
303
|
-
var E;
|
|
304
|
-
return u[y.email] = (E = y.availability) == null ? void 0 : E.calendar_ids, u;
|
|
305
|
-
}, {})) ?? {},
|
|
306
|
-
reminders: (N = t == null ? void 0 : t.event_booking) == null ? void 0 : N.reminders,
|
|
307
|
-
emailTemplate: (A = t == null ? void 0 : t.scheduler) == null ? void 0 : A.email_template
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
setFormState(t, i) {
|
|
311
|
-
switch (i) {
|
|
312
|
-
case "title":
|
|
313
|
-
this.formState.title = t.toString();
|
|
314
|
-
break;
|
|
315
|
-
case "description":
|
|
316
|
-
this.formState.description = t.toString();
|
|
317
|
-
break;
|
|
318
|
-
case "duration":
|
|
319
|
-
this.formState.duration = t.toString();
|
|
320
|
-
break;
|
|
321
|
-
case "availability":
|
|
322
|
-
this.formState.availability = JSON.parse(t.toString());
|
|
323
|
-
break;
|
|
324
|
-
case "participants":
|
|
325
|
-
this.formState.participants = JSON.parse(t.toString());
|
|
326
|
-
break;
|
|
327
|
-
case "booking-calendar":
|
|
328
|
-
this.formState.bookingCalendar = t.toString();
|
|
329
|
-
break;
|
|
330
|
-
case "participant-booking-calendars":
|
|
331
|
-
this.formState.participantBookingCalendars = JSON.parse(t.toString());
|
|
332
|
-
break;
|
|
333
|
-
case "location":
|
|
334
|
-
this.formState.location = t.toString();
|
|
335
|
-
break;
|
|
336
|
-
case "conference":
|
|
337
|
-
this.formState.conferencing = JSON.parse(t.toString());
|
|
338
|
-
break;
|
|
339
|
-
case "booking-type":
|
|
340
|
-
this.formState.bookingType = t.toString();
|
|
341
|
-
break;
|
|
342
|
-
case "buffer-time":
|
|
343
|
-
this.formState.buffer = JSON.parse(t.toString());
|
|
344
|
-
break;
|
|
345
|
-
case "limit-future-bookings":
|
|
346
|
-
this.formState.availableDaysInFuture = parseInt(t.toString());
|
|
347
|
-
break;
|
|
348
|
-
case "min-cancellation-notice":
|
|
349
|
-
this.formState.minCancellationNotice = parseInt(t.toString());
|
|
350
|
-
break;
|
|
351
|
-
case "min-booking-notice":
|
|
352
|
-
this.formState.minBookingNotice = parseInt(t.toString());
|
|
353
|
-
break;
|
|
354
|
-
case "cancellation-policy":
|
|
355
|
-
this.formState.cancellationPolicy = t.toString();
|
|
356
|
-
break;
|
|
357
|
-
case "timeslot-interval":
|
|
358
|
-
this.formState.timeslotInterval = JSON.parse(t.toString());
|
|
359
|
-
break;
|
|
360
|
-
case "customize-booking-settings":
|
|
361
|
-
const a = JSON.parse(t.toString());
|
|
362
|
-
this.formState.additionalGuestsHidden = a.additionalGuestsHidden, this.formState.hideCancellationOptions = a.hideCancellationOptions, this.formState.hideReschedulingOptions = a.hideReschedulingOptions;
|
|
363
|
-
break;
|
|
364
|
-
case "participant-custom-availability":
|
|
365
|
-
const s = JSON.parse(t.toString());
|
|
366
|
-
this.formState.participantOpenHours = s;
|
|
367
|
-
break;
|
|
368
|
-
case "additional-fields":
|
|
369
|
-
this.formState.additionalFields = t;
|
|
370
|
-
break;
|
|
371
|
-
case "connected-calendars":
|
|
372
|
-
this.formState.participantCalendars = JSON.parse(t.toString());
|
|
373
|
-
break;
|
|
374
|
-
case "confirmation-email-template":
|
|
375
|
-
this.formState.emailTemplate = JSON.parse(t.toString());
|
|
376
|
-
break;
|
|
377
|
-
case "reminder-overrides":
|
|
378
|
-
this.formState.reminders = { overrides: JSON.parse(t.toString()) };
|
|
379
|
-
break;
|
|
380
|
-
}
|
|
381
|
-
this.schedulerEditorFormUpdated.emit({
|
|
382
|
-
value: t,
|
|
383
|
-
name: i
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
updateFormState() {
|
|
387
|
-
return new FormData(this.formRef).forEach((i, a) => {
|
|
388
|
-
this.setFormState(i, a);
|
|
389
|
-
}), this.formState = { ...this.formState }, this.formState;
|
|
390
|
-
}
|
|
391
|
-
setActiveTab(t, i) {
|
|
392
|
-
t.preventDefault(), this.updateFormState(), this.activeTab = i;
|
|
393
|
-
}
|
|
394
|
-
hideTab(t) {
|
|
395
|
-
var i;
|
|
396
|
-
return ((i = this.hideEditorTabs) == null ? void 0 : i.includes(t)) || !1;
|
|
397
|
-
}
|
|
398
|
-
render() {
|
|
399
|
-
var i;
|
|
400
|
-
b("[nylas-editor-tabs]", "render", this.formState);
|
|
401
|
-
const t = localStorage.getItem("nylas") === "Nylas Developer";
|
|
402
|
-
return e(kt, { key: "5e190ea179c30e38c254ad7ec34e3ffa53da6d2f" }, e("form", { key: "2048843017f86406f676d158f97c42283f44ea9a", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (a) => this.formRef = a, noValidate: !0 }, this.mode === "app" ? e("div", { class: "form-contents" }, e("div", { class: "tabs" }, e("button", { name: "eventInfo", class: { tab: !0, active: this.activeTab == "eventInfo", hide: this.hideTab("eventInfo") }, part: "editortab__event-info", onClick: (a) => this.setActiveTab(a, "eventInfo") }, e("calendar-info-icon", { width: "16", height: "16" }), "Event info"), e("button", { name: "availability", class: { tab: !0, active: this.activeTab == "availability", hide: this.hideTab("availability") }, part: "editortab__availability", onClick: (a) => this.setActiveTab(a, "availability") }, e("calendar-patterns-icon", { width: "16", height: "16" }), "Availability"), e("button", { name: "participants", class: { tab: !0, active: this.activeTab == "participants", hide: this.hideTab("participants") }, part: "editortab__participants", onClick: (a) => this.setActiveTab(a, "participants") }, e("people-icon", { width: "16", height: "16" }), "Participants"), e("button", { name: "bookingOptions", class: { tab: !0, active: this.activeTab == "bookingOptions", hide: this.hideTab("bookingOptions") }, part: "editortab__booking-options", onClick: (a) => this.setActiveTab(a, "bookingOptions") }, e("flow-icon", { width: "16", height: "16" }), "Booking options"), e("button", { name: "bookingForm", class: { tab: !0, active: this.activeTab == "bookingForm", hide: this.hideTab("bookingForm") }, part: "editortab__booking-form", onClick: (a) => this.setActiveTab(a, "bookingForm") }, this.activeTab == "bookingForm" ? e("calendar-agenda-fill-icon", { width: "16", height: "16" }) : e("calendar-agenda-icon", { width: "16", height: "16" }), "Booking form"), t && e("button", { name: "communications", class: { tab: !0, active: this.activeTab == "communications" }, onClick: (a) => this.setActiveTab(a, "communications") }, this.activeTab == "communications" ? e("envelope-fill-icon", { width: "16", height: "16" }) : e("envelope-icon", { width: "16", height: "16" }), "Communications")), e("div", { class: "tab-content" }, e(Nt, { formState: this.formState, activeTab: this.activeTab, currentUser: this.currentUser, calendars: this.calendars, id: ((i = this.selectedConfiguration) == null ? void 0 : i.id) ?? "new" }))) : e("slot", null), e("div", { key: "88a16f2bccf874acaec34b0ad37d42313758cbb9", class: "footer", part: "editor__footer" }, e("div", { key: "17387917bc660e6e691e5d75501d4a13da2632fc", class: "preview", part: "editor__footer-preview" }, this.schedulerPreviewLink !== "" && this.action === "edit" && e("button-component", { type: "button", disabled: this.isLoading, clickHandler: (a) => {
|
|
403
|
-
a.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(J(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
|
|
404
|
-
}, variant: "basic" }, "Preview")), e("div", { key: "a4e8d02452c2ab524dc0fb010ad88f05cd46d244", class: "buttons", part: "editor__footer-buttons" }, e("p", { key: "2a04af9dc978964725eeb787b1a3f31d76e26720", class: {
|
|
405
|
-
"unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
|
|
406
|
-
"saved-changes": this.changesSaved,
|
|
407
|
-
error: this.error !== "",
|
|
408
|
-
"error-full-width": this.error !== "" && this.action === "create"
|
|
409
|
-
} }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.error == "" && this.changesSaved ? "Changes saved!" : ""), e("button-component", { key: "5997accc74ff1f73b2577923a02f50af0f613429", type: "button", disabled: this.isLoading, clickHandler: (a) => {
|
|
410
|
-
a.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
|
|
411
|
-
}, variant: "basic", part: "editor__footer-cancel" }, "Back"), e("button-component", { key: "9aee416653e7648a62a4d95af171b49b9fd35cba", type: "submit", disabled: this.isLoading, part: "editor__footer-cta" }, this.isLoading ? e("span", null, "Saving", e("loading-icon", null), " ") : this.action == "create" ? "Create" : "Save changes")))));
|
|
412
|
-
}
|
|
413
|
-
get host() {
|
|
414
|
-
return Ct(this);
|
|
415
|
-
}
|
|
416
|
-
static get watchers() {
|
|
417
|
-
return {
|
|
418
|
-
selectedConfiguration: ["configChangedHandler"],
|
|
419
|
-
currentUser: ["userChangedHandler"]
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
};
|
|
423
|
-
Rt([
|
|
424
|
-
xt({
|
|
425
|
-
name: "nylas-editor-tabs",
|
|
426
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
427
|
-
["schedulerConfig.calendars", "calendars"],
|
|
428
|
-
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
429
|
-
["schedulerConfig.currentUser", "currentUser"],
|
|
430
|
-
["schedulerConfig.hideEditorTabs", "hideEditorTabs"]
|
|
431
|
-
]),
|
|
432
|
-
eventToProps: {
|
|
433
|
-
schedulerConfigChanged: async (t, i) => {
|
|
434
|
-
const { resetLoadingState: a, setError: s, action: r, config: n } = t.detail, d = (o) => {
|
|
435
|
-
const [p, m] = o;
|
|
436
|
-
!p && m && s && s(m), a && a(t);
|
|
437
|
-
};
|
|
438
|
-
if (r === "edit") {
|
|
439
|
-
const o = await i.schedulerConfig.updateConfiguration(n);
|
|
440
|
-
d(o);
|
|
441
|
-
} else {
|
|
442
|
-
const o = await i.schedulerConfig.createConfiguration(n);
|
|
443
|
-
d(o);
|
|
444
|
-
}
|
|
445
|
-
},
|
|
446
|
-
cancelButtonClick: async (t, i) => {
|
|
447
|
-
i.schedulerConfigStore.state.action = null;
|
|
448
|
-
},
|
|
449
|
-
previewButtonClicked: async (t, i) => {
|
|
450
|
-
b("[nylas-editor-tabs]", "previewButtonClicked", i);
|
|
451
|
-
},
|
|
452
|
-
formSubmitted: async (t, i) => {
|
|
453
|
-
b("[nylas-editor-tabs]", "formSubmitted", i);
|
|
454
|
-
},
|
|
455
|
-
schedulerEditorFormUpdated: async (t, i) => {
|
|
456
|
-
b("[nylas-editor-tabs]", "schedulerEditorFormUpdated", t);
|
|
457
|
-
}
|
|
458
|
-
},
|
|
459
|
-
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
460
|
-
fireRegisterEvent: !0
|
|
461
|
-
}),
|
|
462
|
-
V("design:type", Function),
|
|
463
|
-
V("design:paramtypes", []),
|
|
464
|
-
V("design:returntype", void 0)
|
|
465
|
-
], St.prototype, "render", null);
|
|
466
|
-
St.style = It;
|
|
467
|
-
const zt = ':host{display:grid;grid-auto-flow:row;width:100%;font-family:inherit;font-optical-sizing:auto;--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}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;gap:1rem}@media screen and (max-width: 768px){.header{flex-direction:column;gap:0.5rem;align-items:unset}}.header h2{margin:0;font-size:1.25rem;color:var(--nylas-base-900);font-weight:600}.header p{margin:0;font-size:1rem;color:var(--nylas-base-700)}.header .actions{justify-self:end}@media screen and (max-width: 768px){.header .actions{width:100%}}.configurations{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-0);height:100%;display:flex;flex-direction:column;position:relative;overflow-y:auto}.configurations table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations table.no-configurations{height:100%}.configurations table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations table tr.hide{display:none}.configurations table th{font-weight:600;text-transform:uppercase;font-size:14px;line-height:20px}.configurations table th.actions-header{text-align:right}.configurations table tr.no-configurations td>div{display:flex;height:100%;justify-content:center;align-items:center;flex-direction:column;padding:var(--nylas-border-radius-3x)}.configurations table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations table th,.configurations table td{text-align:left;padding:1rem;font-family:inherit}.configurations table .actions{text-align:right}.configurations table .actions{display:flex;justify-content:flex-end;gap:1rem}@media screen and (max-width: 768px){.configurations table .actions{flex-direction:column;gap:0.5rem}}.configurations table .title{width:100%;max-width:300px}@media screen and (max-width: 768px){.configurations table .title{max-width:96px}}.configurations table .title div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.configurations table .title div.config-event-title{font-weight:600}.configurations table .title div.config-event-description{font-size:0.75rem}.configurations .pagination{padding:1rem;position:sticky;top:100%;display:flex;justify-content:flex-end;gap:0.5rem;background:white;width:calc(100% - 2rem);z-index:2}.configurations .pagination td.arrows{display:flex;justify-content:flex-end;gap:0.5rem}.configurations .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);border:1px solid var(--nylas-base-300);background-color:transparent;color:var(--nylas-base-800);cursor:pointer}.configurations .pagination button:hover:not(:disabled){border:1px solid var(--nylas-primary)}.configurations .pagination button:active{border:1px solid var(--nylas-base-800)}.configurations .pagination button:disabled{border:1px solid var(--nylas-base-100);background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.configurations .pagination button.right{transform:rotate(180deg)}.error-container{margin-top:1.5rem}.error-container .error{color:var(--nylas-error);padding:0.5rem 0;margin:1rem 0 0}button-component#copy button{width:108px}select-dropdown{width:auto}select-dropdown::part(sd_dropdown-button){display:block;height:48px;padding:0px 16px 8px}@media screen and (max-width: 768px){select-dropdown::part(sd_dropdown-button){width:92px}}select-dropdown::part(sd_dropdown-content){width:120px;right:0}select-dropdown::part(sd_dropdown-labelhtml){display:flex;gap:0.5rem;align-items:center;color:var(--nylas-base-900)}select-dropdown::part(sd_dropdown-labelhtml):hover{color:var(--nylas-primary)}', Mt = zt;
|
|
468
|
-
var jt = function(t, i, a, s) {
|
|
469
|
-
var r = arguments.length, n = r < 3 ? i : s === null ? s = Object.getOwnPropertyDescriptor(i, a) : s, d;
|
|
470
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
471
|
-
n = Reflect.decorate(t, i, a, s);
|
|
472
|
-
else
|
|
473
|
-
for (var o = t.length - 1; o >= 0; o--)
|
|
474
|
-
(d = t[o]) && (n = (r < 3 ? d(n) : r > 3 ? d(i, a, n) : d(i, a)) || n);
|
|
475
|
-
return r > 3 && n && Object.defineProperty(i, a, n), n;
|
|
476
|
-
}, Z = function(t, i) {
|
|
477
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
478
|
-
return Reflect.metadata(t, i);
|
|
479
|
-
};
|
|
480
|
-
const Tt = class {
|
|
481
|
-
constructor(t) {
|
|
482
|
-
$(this, t), this.initListConfigurations = _(this, "initListConfigurations", 7), this.createButtonClick = _(this, "createButtonClick", 7), this.editButtonClick = _(this, "editButtonClick", 7), this.deleteButtonClick = _(this, "deleteButtonClick", 7), this.configurations = [], this.schedulerPreviewLink = "", this.listConfigurationsNextCursor = void 0, this.state = "loading", this.error = "", this.currentCursor = null, this.previousCursors = [], this.disableNextPageButton = !1;
|
|
483
|
-
}
|
|
484
|
-
listConfigurationsNextCursorChangedHandler(t, i) {
|
|
485
|
-
if (!t || t === i) {
|
|
486
|
-
t === null && (this.disableNextPageButton = !0);
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
this.disableNextPageButton = !1, this.currentCursor = t;
|
|
490
|
-
}
|
|
491
|
-
connectedCallback() {
|
|
492
|
-
b("[nylas-list-configurations]", "connectedCallback");
|
|
493
|
-
}
|
|
494
|
-
componentWillLoad() {
|
|
495
|
-
b("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
|
|
496
|
-
}
|
|
497
|
-
componentDidLoad() {
|
|
498
|
-
b("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit({
|
|
499
|
-
host: this.host
|
|
500
|
-
});
|
|
501
|
-
}
|
|
502
|
-
disconnectedCallback() {
|
|
503
|
-
b("[nylas-list-configurations]", "disconnectedCallback");
|
|
504
|
-
}
|
|
505
|
-
async handleNylasFormDropdownChanged(t) {
|
|
506
|
-
b("[nylas-list-configurations]", "handleNylasFormDropdownChanged", t.detail);
|
|
507
|
-
const { value: i } = t.detail, [a, s] = i.split("-");
|
|
508
|
-
switch (t.preventDefault(), a) {
|
|
509
|
-
case "delete":
|
|
510
|
-
this.deleteButtonClick.emit({ host: this.host, configuration: this.configurations[s] });
|
|
511
|
-
break;
|
|
512
|
-
case "preview":
|
|
513
|
-
window.open(J(this.schedulerPreviewLink, this.configurations[s]), "_blank");
|
|
514
|
-
break;
|
|
515
|
-
case "copy":
|
|
516
|
-
await navigator.clipboard.writeText(J(this.schedulerPreviewLink, this.configurations[s]));
|
|
517
|
-
break;
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
async getState() {
|
|
521
|
-
return this.state;
|
|
522
|
-
}
|
|
523
|
-
async setState(t) {
|
|
524
|
-
this.state = t;
|
|
525
|
-
}
|
|
526
|
-
async setError(t) {
|
|
527
|
-
this.error = t;
|
|
528
|
-
}
|
|
529
|
-
getDurationString(t) {
|
|
530
|
-
const i = Math.floor(t / 60), a = t % 60;
|
|
531
|
-
return `${i || ""} ${i ? `${i > 1 ? "hours" : "hour"}` : ""} ${a || ""} ${a ? `${a > 1 ? "mins" : "min"}` : ""}`;
|
|
532
|
-
}
|
|
533
|
-
getActionLabelHTML(t) {
|
|
534
|
-
const i = {
|
|
535
|
-
display: "inline-flex",
|
|
536
|
-
alignItems: "center",
|
|
537
|
-
gap: "0.5rem"
|
|
538
|
-
}, a = {
|
|
539
|
-
color: "var(--nylas-error)"
|
|
540
|
-
};
|
|
541
|
-
switch (t) {
|
|
542
|
-
case "preview":
|
|
543
|
-
return e("span", { style: i }, e("eye-icon", { width: "16", height: "16" }), "Preview");
|
|
544
|
-
case "copy":
|
|
545
|
-
return e("span", { style: i }, e("copy-icon", { width: "16", height: "16" }), "Copy");
|
|
546
|
-
case "delete":
|
|
547
|
-
return e("span", { style: { ...i, ...a } }, e("delete-icon", { width: "15", height: "17" }), "Delete");
|
|
548
|
-
default:
|
|
549
|
-
return "";
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
previousPageClickedHandler() {
|
|
553
|
-
if (this.previousCursors.length === 0)
|
|
554
|
-
return;
|
|
555
|
-
this.currentCursor = this.previousCursors.pop() || null;
|
|
556
|
-
const t = this.previousCursors[this.previousCursors.length - 1] || void 0;
|
|
557
|
-
this.initListConfigurations.emit({
|
|
558
|
-
host: this.host,
|
|
559
|
-
cursor: t
|
|
560
|
-
});
|
|
561
|
-
}
|
|
562
|
-
nextPageClickedHandler() {
|
|
563
|
-
this.currentCursor && (this.previousCursors = [...this.previousCursors, this.currentCursor], this.initListConfigurations.emit({
|
|
564
|
-
host: this.host,
|
|
565
|
-
cursor: this.currentCursor
|
|
566
|
-
}));
|
|
567
|
-
}
|
|
568
|
-
render() {
|
|
569
|
-
return e(kt, null, e("div", { class: "header" }, e("div", { class: "description" }, e("h2", null, "All scheduling pages"), e("p", null, "Create, edit and manage all your scheduling pages.")), this.configurations && this.configurations.length > 0 && e("div", { class: "actions" }, e("button-component", { clickHandler: () => {
|
|
570
|
-
this.createButtonClick.emit(this.host);
|
|
571
|
-
} }, "Create new"))), e("div", { class: "configurations" }, e("table", { class: {
|
|
572
|
-
"no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
|
|
573
|
-
} }, e("tr", { class: {
|
|
574
|
-
hide: this.state === "loading" || this.configurations && this.configurations.length === 0
|
|
575
|
-
} }, e("th", null, "Scheduling page title"), e("th", null, "Duration"), e("th", { class: "actions-header" }, "Actions")), this.state === "loading" && e("tr", { class: "no-configurations" }, e("td", { colSpan: 3 }, e("div", null, e("h3", null, "Loading..."), e("p", null, "Please wait while we fetch the scheduling pages")))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && e("tr", { class: "no-configurations" }, e("td", { colSpan: 3 }, e("div", null, e("calendar-icon", { width: "48", height: "48" }), e("h3", null, "No scheduling pages found"), e("p", null, "Get started with creating your first scheduling page"), e("button-component", { clickHandler: () => {
|
|
576
|
-
this.createButtonClick.emit(this.host);
|
|
577
|
-
} }, "Create new")))), this.state !== "loading" && this.configurations.map((t, i) => e("tr", { key: t.id }, e("td", null, e("div", { class: "title" }, e("div", { class: "config-event-title", title: t.event_booking.title }, t.event_booking.title), e("div", { class: "config-event-description" }, t.event_booking.description))), e("td", null, e("div", { class: "duration" }, this.getDurationString(t.availability.duration_minutes))), e("td", null, e("div", { class: "actions" }, e("button-component", { variant: "basic", key: `edit-${i}`, clickHandler: (a) => {
|
|
578
|
-
a.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: t });
|
|
579
|
-
} }, e("edit-icon", { width: "16", height: "16" }), "Edit"), e("select-dropdown", { name: "actions", options: [
|
|
580
|
-
{ value: `preview-${i}`, label: "Preview", labelHTML: this.getActionLabelHTML("preview") },
|
|
581
|
-
{ value: `copy-${i}`, label: "Copy link", labelHTML: this.getActionLabelHTML("copy") },
|
|
582
|
-
{ value: `delete-${i}`, label: "Delete", labelHTML: this.getActionLabelHTML("delete") }
|
|
583
|
-
], defaultSelectedOption: { value: "", label: "" }, dropdownButtonText: "...", withSearch: !1, withChevron: !1, exportparts: "sd_dropdown: actions__dropdown, sd_dropdown-button: actions__dropdown-button, sd_dropdown-content: actions__dropdown-content" })))))), e("div", { class: "pagination" }, e("button", { class: "arrow left", onClick: () => this.previousPageClickedHandler(), disabled: this.previousCursors.length <= 0 }, e("chevron-icon", null)), e("button", { class: "arrow right", onClick: () => this.nextPageClickedHandler(), disabled: this.disableNextPageButton }, e("chevron-icon", null)))), this.state === "error" && e("div", { class: "error-container" }, e("p", { class: "error" }, this.error)));
|
|
584
|
-
}
|
|
585
|
-
get host() {
|
|
586
|
-
return Ct(this);
|
|
587
|
-
}
|
|
588
|
-
static get watchers() {
|
|
589
|
-
return {
|
|
590
|
-
listConfigurationsNextCursor: ["listConfigurationsNextCursorChangedHandler"]
|
|
591
|
-
};
|
|
592
|
-
}
|
|
593
|
-
};
|
|
594
|
-
jt([
|
|
595
|
-
xt({
|
|
596
|
-
name: "nylas-list-configurations",
|
|
597
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
598
|
-
["schedulerConfig.configurations", "configurations"],
|
|
599
|
-
["schedulerConfig.listConfigurationsNextCursor", "listConfigurationsNextCursor"]
|
|
600
|
-
]),
|
|
601
|
-
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
602
|
-
eventToProps: {
|
|
603
|
-
initListConfigurations: async (t, i) => {
|
|
604
|
-
const { host: a, cursor: s } = t.detail;
|
|
605
|
-
await a.setState("loading");
|
|
606
|
-
const [r, n] = await i.schedulerConfig.getConfigurations(s);
|
|
607
|
-
if (!r && n && n.message) {
|
|
608
|
-
await a.setState("error"), await a.setError(n.message);
|
|
609
|
-
return;
|
|
610
|
-
}
|
|
611
|
-
await a.setState("loaded");
|
|
612
|
-
},
|
|
613
|
-
createButtonClick: async (t, i) => {
|
|
614
|
-
i.schedulerConfigStore.resetSelectedConfiguration(), i.schedulerConfigStore.state.action = "create";
|
|
615
|
-
},
|
|
616
|
-
deleteButtonClick: async (t, i) => {
|
|
617
|
-
const { host: a, configuration: s } = t.detail, [r, n] = await i.schedulerConfig.deleteConfiguration(s.id);
|
|
618
|
-
!r && n && n.message && (await a.setState("error"), await a.setError(n.message));
|
|
619
|
-
},
|
|
620
|
-
editButtonClick: async (t, i) => {
|
|
621
|
-
const { configuration: a } = t.detail;
|
|
622
|
-
i.schedulerConfigStore.state.selectedConfiguration = a, i.schedulerConfigStore.state.action = "edit";
|
|
623
|
-
}
|
|
624
|
-
},
|
|
625
|
-
fireRegisterEvent: !0
|
|
626
|
-
}),
|
|
627
|
-
Z("design:type", Function),
|
|
628
|
-
Z("design:paramtypes", []),
|
|
629
|
-
Z("design:returntype", void 0)
|
|
630
|
-
], Tt.prototype, "render", null);
|
|
631
|
-
Tt.style = Mt;
|
|
632
|
-
export {
|
|
633
|
-
Dt as google_logo_icon,
|
|
634
|
-
Pt as microsoft_logo_icon,
|
|
635
|
-
St as nylas_editor_tabs,
|
|
636
|
-
Tt as nylas_list_configurations
|
|
637
|
-
};
|