@nylas/react 1.1.0-canary.14 → 1.1.0-canary.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-circle-icon_2.entry-00dc2c13.cjs +1 -0
- package/dist/add-circle-icon_2.entry-3f834b47.js +26 -0
- package/dist/{archive-icon_7.entry-60311199.cjs → archive-icon_7.entry-25d8b2f0.cjs} +1 -1
- package/dist/{archive-icon_7.entry-0dfc9782.js → archive-icon_7.entry-ca8262ff.js} +15 -15
- package/dist/{arrow-icon.entry-eb53c4cb.cjs → arrow-icon.entry-01192ecf.cjs} +1 -1
- package/dist/{arrow-icon.entry-f38f3014.js → arrow-icon.entry-991ba7cd.js} +2 -2
- package/dist/{bold-icon_3.entry-20e74265.js → bold-icon_3.entry-81a3ff1e.js} +10 -10
- package/dist/{bold-icon_3.entry-d5100ffa.cjs → bold-icon_3.entry-e94dcf5b.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-e5d1bc0a.cjs → calendar-cancel-icon.entry-9088fa8b.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-0bdee178.js → calendar-cancel-icon.entry-f646c147.js} +5 -5
- package/dist/{calendar-check-icon_2.entry-10af2017.cjs → calendar-check-icon_2.entry-4dc1391a.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-f18a2ddb.js → calendar-check-icon_2.entry-a7e4d0e6.js} +7 -7
- package/dist/{calendar-icon.entry-12ca0ae4.js → calendar-icon.entry-1658930c.js} +2 -2
- package/dist/{calendar-icon.entry-bc6f0808.cjs → calendar-icon.entry-1e2acd5c.cjs} +1 -1
- package/dist/{add-circle-icon_22.entry-ab0d5ede.js → calendar-info-icon_25.entry-493c5547.js} +966 -704
- package/dist/calendar-info-icon_25.entry-7513d798.cjs +1 -0
- package/dist/chevron-icon_3.entry-52b97043.cjs +1 -0
- package/dist/chevron-icon_3.entry-b3c7eb44.js +126 -0
- package/dist/{clock-icon_2.entry-ffc9e057.js → clock-icon_2.entry-58f07042.js} +3 -3
- package/dist/{clock-icon_2.entry-7cddf901.cjs → clock-icon_2.entry-882249ee.cjs} +1 -1
- package/dist/close-icon.entry-4a39816a.js +15 -0
- package/dist/close-icon.entry-f1166251.cjs +1 -0
- package/dist/{constants-f34b9c6e-108993e8.cjs → constants-f34b9c6e-1da5094b.cjs} +1 -1
- package/dist/{constants-f34b9c6e-37cabe82.js → constants-f34b9c6e-628beaa8.js} +1 -1
- package/dist/{document-refresh-icon.entry-d1f6259a.cjs → document-refresh-icon.entry-4f581bf4.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-e4636c8e.js → document-refresh-icon.entry-b53316b4.js} +2 -2
- package/dist/elements/index.d.ts +9 -0
- package/dist/{elements-dc5b338e-a37a0510.cjs → elements-dc5b338e-3284591d.cjs} +1 -1
- package/dist/{elements-dc5b338e-c6f2806c.js → elements-dc5b338e-7abe37c6.js} +1 -1
- package/dist/{focus-visible-e8093c16-b62197ad.cjs → focus-visible-e8093c16-cb6c97b1.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-b0821d89.js → focus-visible-e8093c16-d6612604.js} +1 -1
- package/dist/{forward-icon_6.entry-2a694e7c.js → forward-icon_6.entry-d54244f7.js} +9 -9
- package/dist/{forward-icon_6.entry-b81b22f6.cjs → forward-icon_6.entry-e402ad1e.cjs} +2 -2
- package/dist/{globe-icon.entry-c037589b.cjs → globe-icon.entry-db7377d9.cjs} +1 -1
- package/dist/{globe-icon.entry-e794eb52.js → globe-icon.entry-e83c79c2.js} +4 -4
- package/dist/google-logo-icon_4.entry-8818686b.js +429 -0
- package/dist/google-logo-icon_4.entry-fa65ae29.cjs +1 -0
- package/dist/{index-d61429c6.js → index-2d032bec.js} +1288 -1265
- package/dist/index-53420959-41ed02ae.js +5 -0
- package/dist/index-53420959-a76f0327.cjs +1 -0
- package/dist/{index-ef01c714-1e2feefc.js → index-6d9eeb53-91d36348.js} +2 -2
- package/dist/{index-ef01c714-54e17405.cjs → index-6d9eeb53-f478270c.cjs} +1 -1
- package/dist/index-9c04361d.cjs +42 -0
- package/dist/{index.es-74f70f7d-a22eba35.cjs → index.es-9cc0eb3c-2242baf6.cjs} +1 -1
- package/dist/{index.es-74f70f7d-da0e7fcf.js → index.es-9cc0eb3c-ee2ebbe1.js} +1 -1
- package/dist/{info-icon_2.entry-23e3fa8a.cjs → info-icon_2.entry-4b257e73.cjs} +1 -1
- package/dist/{info-icon_2.entry-647915bb.js → info-icon_2.entry-74eb7415.js} +5 -5
- package/dist/input-component.entry-3ef7ce2c.cjs +1 -0
- package/dist/input-component.entry-6bb4a5e8.js +45 -0
- package/dist/input-dropdown_2.entry-a87714fc.cjs +1 -0
- package/dist/input-dropdown_2.entry-f71e4c01.js +209 -0
- package/dist/{loading-icon.entry-1ddd0244.js → loading-icon.entry-30724cb0.js} +2 -2
- package/dist/{loading-icon.entry-98d65a5d.cjs → loading-icon.entry-bb250f1c.cjs} +1 -1
- package/dist/{mailbox-store-050a2914-6fef25fb.js → mailbox-store-64b4ef7c-202f1afd.js} +2 -2
- package/dist/{mailbox-store-050a2914-bd0a86bb.cjs → mailbox-store-64b4ef7c-74f959be.cjs} +1 -1
- package/dist/{nylas-additional-participants.entry-3c598863.cjs → nylas-additional-participants.entry-567c7c2a.cjs} +1 -1
- package/dist/{nylas-additional-participants.entry-0f93e24e.js → nylas-additional-participants.entry-7961be04.js} +5 -5
- package/dist/nylas-booked-event-card_10.entry-c2f889ba.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-9f7869af.js → nylas-booked-event-card_10.entry-ddfcff5e.js} +371 -299
- package/dist/{nylas-custom-booking-flow.entry-877cac85.cjs → nylas-custom-booking-flow.entry-63ed387e.cjs} +1 -1
- package/dist/{nylas-custom-booking-flow.entry-69638c50.js → nylas-custom-booking-flow.entry-a1f66d05.js} +10 -10
- package/dist/{nylas-form-card.entry-4349d07d.cjs → nylas-form-card.entry-6fece0ff.cjs} +1 -1
- package/dist/{nylas-form-card.entry-b2da5266.js → nylas-form-card.entry-ea1153b9.js} +11 -11
- package/dist/{nylas-if-state.entry-62474acb.js → nylas-if-state.entry-05f8f66f.js} +3 -3
- package/dist/{nylas-if-state.entry-9eade180.cjs → nylas-if-state.entry-b75320f0.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-348a784b.js → nylas-list-folders.entry-bd5a1b1d.js} +7 -7
- package/dist/{nylas-list-folders.entry-b32ec92a.cjs → nylas-list-folders.entry-edc61b97.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-7e8044b2.cjs → nylas-list-threads.entry-79ad0944.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-ec1c5fb6.js → nylas-list-threads.entry-f3cd80de.js} +3 -3
- package/dist/{nylas-login.entry-0495d0b5.cjs → nylas-login.entry-68873357.cjs} +1 -1
- package/dist/{nylas-login.entry-f6f1e306.js → nylas-login.entry-b3207e82.js} +7 -7
- package/dist/{nylas-mailbox-pagination.entry-24c82c53.js → nylas-mailbox-pagination.entry-22c5b9ca.js} +2 -2
- package/dist/{nylas-mailbox-pagination.entry-22385ead.cjs → nylas-mailbox-pagination.entry-2ef5b88a.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-b13b2a58.js → nylas-mailbox-toolbar-button.entry-95bb58b5.js} +9 -9
- package/dist/{nylas-mailbox-toolbar-button.entry-e8e52474.cjs → nylas-mailbox-toolbar-button.entry-f2fa3a8e.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-77f4c37e.cjs → nylas-mailbox.entry-4b1d320f.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-0365fbb0.js → nylas-mailbox.entry-4ef7d18d.js} +6 -6
- package/dist/{nylas-provider.entry-11239372.js → nylas-provider.entry-7f7e098a.js} +6 -6
- package/dist/{nylas-provider.entry-d454a4d1.cjs → nylas-provider.entry-b629340a.cjs} +1 -1
- package/dist/{nylas-scheduler-editor.entry-16473950.cjs → nylas-scheduler-editor.entry-19a29c4c.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-c4d38853.js → nylas-scheduler-editor.entry-2d19593f.js} +13 -7
- package/dist/nylas-scheduling.entry-70454242.cjs +1 -0
- package/dist/{nylas-scheduling.entry-cc2535a9.js → nylas-scheduling.entry-753cb746.js} +61 -61
- package/dist/{nylas-threads-refresh.entry-725ef87d.cjs → nylas-threads-refresh.entry-0a832631.cjs} +1 -1
- package/dist/{nylas-threads-refresh.entry-5a6378fe.js → nylas-threads-refresh.entry-5a774ad7.js} +4 -4
- package/dist/{nylas-threads-search.entry-5e7b6a03.js → nylas-threads-search.entry-451c6d5c.js} +9 -9
- package/dist/nylas-threads-search.entry-5b57688b.cjs +1 -0
- package/dist/{nylas-view-thread.entry-98f8e35b.cjs → nylas-view-thread.entry-7b273955.cjs} +1 -1
- package/dist/{nylas-view-thread.entry-249f0b65.js → nylas-view-thread.entry-e0af8998.js} +3 -3
- package/dist/{people-icon.entry-0ab4b752.cjs → people-icon.entry-c7fb7f6c.cjs} +1 -1
- package/dist/{people-icon.entry-0ed95db0.js → people-icon.entry-de3fada0.js} +6 -6
- package/dist/{play-icon_2.entry-433a8722.js → play-icon_2.entry-58592b64.js} +5 -5
- package/dist/play-icon_2.entry-5b22a7ca.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +98 -89
- package/dist/{refresh-icon.entry-508a246d.cjs → refresh-icon.entry-876b8aea.cjs} +1 -1
- package/dist/{refresh-icon.entry-b5bee0f4.js → refresh-icon.entry-90756bc6.js} +4 -4
- package/dist/{register-component-e4dc8778-7812a275.cjs → register-component-a5a9ca5d-1fbb27d2.cjs} +1 -1
- package/dist/{register-component-e4dc8778-53fe0729.js → register-component-a5a9ca5d-8bede801.js} +1 -1
- package/dist/{scheduler-config-store-ec3b6190-435c84ca.cjs → scheduler-config-store-ec3b6190-104df545.cjs} +1 -1
- package/dist/{scheduler-config-store-ec3b6190-01892765.js → scheduler-config-store-ec3b6190-cbc40d60.js} +1 -1
- package/dist/scheduler-store-f02ce045-1d93c571.js +390 -0
- package/dist/scheduler-store-f02ce045-712c600c.cjs +1 -0
- package/dist/textarea-component.entry-3ea161d6.js +35 -0
- package/dist/textarea-component.entry-9d6b5cdc.cjs +1 -0
- package/dist/toggle-switch.entry-10aa0c1a.cjs +1 -0
- package/dist/toggle-switch.entry-a08c1027.js +25 -0
- package/dist/{translate-icon.entry-f77cfd3d.cjs → translate-icon.entry-04dde6b1.cjs} +1 -1
- package/dist/{translate-icon.entry-c34bad94.js → translate-icon.entry-be9c3401.js} +6 -6
- package/dist/{warning-icon.entry-f781a623.js → warning-icon.entry-347d77af.js} +5 -5
- package/dist/{warning-icon.entry-f73b31bf.cjs → warning-icon.entry-84121a43.cjs} +1 -1
- package/package.json +3 -3
- package/dist/add-circle-icon_22.entry-c165f0de.cjs +0 -1
- package/dist/chevron-icon_3.entry-55eb864f.js +0 -117
- package/dist/chevron-icon_3.entry-a18c373d.cjs +0 -1
- package/dist/close-icon.entry-7c67181c.js +0 -15
- package/dist/close-icon.entry-918dd254.cjs +0 -1
- package/dist/google-logo-icon_4.entry-748af8c3.cjs +0 -1
- package/dist/google-logo-icon_4.entry-b4464873.js +0 -393
- package/dist/index-53420959-31867ccf.js +0 -5
- package/dist/index-53420959-535906ce.cjs +0 -1
- package/dist/index-6a4ee4f8.cjs +0 -42
- package/dist/nylas-booked-event-card_10.entry-912e4a89.cjs +0 -1
- package/dist/nylas-scheduling.entry-5b156a28.cjs +0 -1
- package/dist/nylas-threads-search.entry-a2553cbe.cjs +0 -1
- package/dist/play-icon_2.entry-f9c0b647.cjs +0 -1
- package/dist/scheduler-store-04e15f8a-5d06eaf3.cjs +0 -1
- package/dist/scheduler-store-04e15f8a-69eb8d7a.js +0 -376
- package/dist/time-period-selector.entry-77a6debf.cjs +0 -1
- package/dist/time-period-selector.entry-a29c8ffa.js +0 -76
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-9c04361d.cjs");require("react");require("react-dom");const i=".sc-globe-icon-h{display:flex}",c=i,C=class{constructor(t){e.registerInstance(this,t),this.width="16",this.height="16"}render(){return e.h("svg",{key:"f491775c5d5c635be9dcfec23fff61ec0093844e",xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height,viewBox:"0 0 16 16",fill:"none"},e.h("path",{key:"ed8e2b4295a1db6ded29520c94b1ac3d6d81efba",d:"M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM8 3C8.37372 3 8.87543 3.35608 9.31258 4.31781C9.4073 4.52619 9.49448 4.75446 9.57265 5H6.42735C6.50552 4.75446 6.5927 4.52619 6.68742 4.31781C7.12457 3.35608 7.62628 3 8 3ZM5.77705 3.90401C5.62614 4.23601 5.49428 4.6038 5.38411 5H3.99963C4.52341 4.30269 5.22525 3.74677 6.03766 3.39978C5.94287 3.56117 5.85596 3.7304 5.77705 3.90401ZM5.16299 6C5.05694 6.6275 5 7.30146 5 8C5 8.69854 5.05694 9.3725 5.16299 10H3.41604C3.14845 9.38754 3 8.7111 3 8C3 7.2889 3.14845 6.61246 3.41604 6H5.16299ZM5.38411 11C5.49428 11.3962 5.62614 11.764 5.77705 12.096C5.85596 12.2696 5.94287 12.4388 6.03766 12.6002C5.22525 12.2532 4.52341 11.6973 3.99963 11H5.38411ZM6.42735 11H9.57265C9.49448 11.2455 9.4073 11.4738 9.31258 11.6822C8.87543 12.6439 8.37372 13 8 13C7.62628 13 7.12457 12.6439 6.68742 11.6822C6.5927 11.4738 6.50552 11.2455 6.42735 11ZM9.82134 10H6.17866C6.06438 9.3892 6 8.71396 6 8C6 7.28604 6.06438 6.6108 6.17866 6H9.82134C9.93562 6.6108 10 7.28604 10 8C10 8.71396 9.93562 9.3892 9.82134 10ZM10.6159 11H12.0004C11.4766 11.6973 10.7747 12.2532 9.96234 12.6002C10.0571 12.4388 10.144 12.2696 10.2229 12.096C10.3739 11.764 10.5057 11.3962 10.6159 11ZM12.584 10H10.837C10.9431 9.3725 11 8.69854 11 8C11 7.30146 10.9431 6.6275 10.837 6H12.584C12.8516 6.61246 13 7.2889 13 8C13 8.7111 12.8516 9.38754 12.584 10ZM9.96234 3.39978C10.7747 3.74677 11.4766 4.30269 12.0004 5H10.6159C10.5057 4.6038 10.3739 4.23601 10.2229 3.90401C10.144 3.7304 10.0571 3.56117 9.96234 3.39978Z",fill:"currentColor"}))}};C.style=c;exports.globe_icon=C;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { r as
|
|
1
|
+
import { r as t, h as C } from "./index-2d032bec.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
const o = ".sc-globe-icon-h{display:flex}", s = o, i = class {
|
|
5
|
-
constructor(
|
|
6
|
-
|
|
5
|
+
constructor(e) {
|
|
6
|
+
t(this, e), this.width = "16", this.height = "16";
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return C("svg", { key: "
|
|
9
|
+
return C("svg", { key: "f491775c5d5c635be9dcfec23fff61ec0093844e", xmlns: "http://www.w3.org/2000/svg", width: this.width, height: this.height, viewBox: "0 0 16 16", fill: "none" }, C("path", { key: "ed8e2b4295a1db6ded29520c94b1ac3d6d81efba", d: "M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM8 3C8.37372 3 8.87543 3.35608 9.31258 4.31781C9.4073 4.52619 9.49448 4.75446 9.57265 5H6.42735C6.50552 4.75446 6.5927 4.52619 6.68742 4.31781C7.12457 3.35608 7.62628 3 8 3ZM5.77705 3.90401C5.62614 4.23601 5.49428 4.6038 5.38411 5H3.99963C4.52341 4.30269 5.22525 3.74677 6.03766 3.39978C5.94287 3.56117 5.85596 3.7304 5.77705 3.90401ZM5.16299 6C5.05694 6.6275 5 7.30146 5 8C5 8.69854 5.05694 9.3725 5.16299 10H3.41604C3.14845 9.38754 3 8.7111 3 8C3 7.2889 3.14845 6.61246 3.41604 6H5.16299ZM5.38411 11C5.49428 11.3962 5.62614 11.764 5.77705 12.096C5.85596 12.2696 5.94287 12.4388 6.03766 12.6002C5.22525 12.2532 4.52341 11.6973 3.99963 11H5.38411ZM6.42735 11H9.57265C9.49448 11.2455 9.4073 11.4738 9.31258 11.6822C8.87543 12.6439 8.37372 13 8 13C7.62628 13 7.12457 12.6439 6.68742 11.6822C6.5927 11.4738 6.50552 11.2455 6.42735 11ZM9.82134 10H6.17866C6.06438 9.3892 6 8.71396 6 8C6 7.28604 6.06438 6.6108 6.17866 6H9.82134C9.93562 6.6108 10 7.28604 10 8C10 8.71396 9.93562 9.3892 9.82134 10ZM10.6159 11H12.0004C11.4766 11.6973 10.7747 12.2532 9.96234 12.6002C10.0571 12.4388 10.144 12.2696 10.2229 12.096C10.3739 11.764 10.5057 11.3962 10.6159 11ZM12.584 10H10.837C10.9431 9.3725 11 8.69854 11 8C11 7.30146 10.9431 6.6275 10.837 6H12.584C12.8516 6.61246 13 7.2889 13 8C13 8.7111 12.8516 9.38754 12.584 10ZM9.96234 3.39978C10.7747 3.74677 11.4766 4.30269 12.0004 5H10.6159C10.5057 4.6038 10.3739 4.23601 10.2229 3.90401C10.144 3.7304 10.0571 3.56117 9.96234 3.39978Z", fill: "currentColor" }));
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
i.style = s;
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import { r as D, h as n, c as y, x as nt, d, y as q, H as K, g as Q } from "./index-2d032bec.js";
|
|
2
|
+
import { R as X } from "./register-component-a5a9ca5d-8bede801.js";
|
|
3
|
+
import { D as at } from "./constants-f34b9c6e-628beaa8.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
const it = ".sc-google-logo-icon-h{display:flex}", st = it, ot = class {
|
|
7
|
+
constructor(t) {
|
|
8
|
+
D(this, t), this.width = "24", this.height = "24";
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
return n("svg", { key: "48ccae649f280d48621dfb214a08b980155680a1", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("g", { key: "10196951caa0fa0b94b57c57a62d8bcb31d92d91", "clip-path": "url(#clip0_959_12452)" }, n("path", { key: "0d2358cd1dcbd7f9ef2dfa17a5075a341210a43c", 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" }), n("path", { key: "8540c5619b64996b6b158fe50609aa378dfd468f", 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" }), n("path", { key: "b683a33b6068de0793ef4426e6404d438dbdf73e", 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" }), n("path", { key: "916d663bbb04c8267e595adf9125068232414ed7", 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" })), n("defs", { key: "a941f8ccb1711f648dc3e2db750496a2491b4b55" }, n("clipPath", { key: "caef3b6e814ed957bcee43a794130dce6760702d", id: "clip0_959_12452" }, n("rect", { key: "df7c24b60402fd2e9d248f4e5ccfbaa640d549ae", width: 24, height: 24, fill: "white" }))));
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
ot.style = st;
|
|
15
|
+
const rt = ".sc-microsoft-logo-icon-h{display:flex}", lt = rt, dt = class {
|
|
16
|
+
constructor(t) {
|
|
17
|
+
D(this, t), this.width = "22", this.height = "22";
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return n("svg", { key: "4aa3482048f90ecbcb46d539716464bdf2c20e47", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("path", { key: "27924938927bdc57e665d91623f07684aea3a6ee", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), n("path", { key: "91decf0bfe7ef26f93ea724fa9738d1ffa1ae4a6", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), n("path", { key: "0f455cec58fd99a755157ab9ca950242a634d541", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), n("path", { key: "80c930047e54c708d5f7cde3d88f33f2a0d0dbd5", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
dt.style = lt;
|
|
24
|
+
function ct({ id: t, formState: e, activeTab: a, calendars: s }) {
|
|
25
|
+
var o;
|
|
26
|
+
switch (a) {
|
|
27
|
+
case "eventInfo":
|
|
28
|
+
const i = e.title, l = e.description, r = parseInt(e.duration), b = e.location;
|
|
29
|
+
return n(
|
|
30
|
+
"div",
|
|
31
|
+
{ key: t },
|
|
32
|
+
n(
|
|
33
|
+
"nylas-event-info",
|
|
34
|
+
null,
|
|
35
|
+
n(
|
|
36
|
+
"div",
|
|
37
|
+
{ slot: "inputs" },
|
|
38
|
+
n("nylas-event-title", { name: "title", eventTitle: i, exportparts: "net, net__title, net__dropdown-content" }),
|
|
39
|
+
n("nylas-event-duration", { name: "duration", eventDurationMinutes: r, exportparts: "ned, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content" }),
|
|
40
|
+
n("nylas-event-location", { name: "location", eventLocation: b, exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
|
|
41
|
+
n("nylas-event-description", { name: "description", eventDescription: l, exportparts: "nedesc, nedesc__textarea" })
|
|
42
|
+
)
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
case "availability":
|
|
46
|
+
const u = e.availability.openHours, f = e.availability.timezone ? e.availability.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone, h = (o = e.participants) == null ? void 0 : o.find((v) => v.is_organizer), m = (h == null ? void 0 : h.email) ?? "primary", g = e.calendarIds.length > 0 ? e.calendarIds : [m], _ = e.bookingCalendar == "primary" ? m : e.bookingCalendar;
|
|
47
|
+
return n(
|
|
48
|
+
"div",
|
|
49
|
+
{ key: t },
|
|
50
|
+
n("nylas-booking-calendar-picker", { name: "booking-calendar", calendars: s ?? [], defaultBookingCalendar: _, exportparts: "nbcp, nbcp__header, nbcp__input-label, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content" }),
|
|
51
|
+
n("nylas-calendar-picker", { name: "calendars", calendars: s ?? [], defaultSelectedCalendars: g, exportparts: "ncp ncp__header, ncp__dropdown, ncp__dropdown-button, ncp__dropdown-content" }),
|
|
52
|
+
n("nylas-availability-picker", { name: "availability", openHours: u, defaultTimezone: f, 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 n(
|
|
56
|
+
"div",
|
|
57
|
+
{ key: t },
|
|
58
|
+
n("nylas-buffer-time", { name: "buffer-time", buffer: e.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
|
+
n(
|
|
60
|
+
"nylas-event-limits",
|
|
61
|
+
null,
|
|
62
|
+
n(
|
|
63
|
+
"div",
|
|
64
|
+
{ slot: "inputs" },
|
|
65
|
+
n("nylas-min-booking-notice", { name: "min-booking-notice", minBookingNotice: e.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
|
+
n("nylas-limit-future-bookings", { name: "limit-future-bookings", availableDaysInFuture: e.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
|
+
n("nylas-min-cancellation-notice", { name: "min-cancellation-notice", minCancellationNotice: e.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
|
+
n("nylas-cancellation-policy", { name: "cancellation-policy", cancellationPolicy: e.cancellationPolicy, exportparts: "ncpolicy, ncpolicy__textarea" })
|
|
69
|
+
)
|
|
70
|
+
),
|
|
71
|
+
n("nylas-timeslot-interval", { name: "timeslot-interval", eventDurationMinutes: parseInt(e.duration), exportparts: "nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content" }),
|
|
72
|
+
n("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
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const bt = '.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 .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}.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}', ut = bt;
|
|
77
|
+
var ht = function(t, e, a, s) {
|
|
78
|
+
var o = arguments.length, i = o < 3 ? e : s === null ? s = Object.getOwnPropertyDescriptor(e, a) : s, l;
|
|
79
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
80
|
+
i = Reflect.decorate(t, e, a, s);
|
|
81
|
+
else
|
|
82
|
+
for (var r = t.length - 1; r >= 0; r--)
|
|
83
|
+
(l = t[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(e, a, i) : l(e, a)) || i);
|
|
84
|
+
return o > 3 && i && Object.defineProperty(e, a, i), i;
|
|
85
|
+
}, T = function(t, e) {
|
|
86
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
87
|
+
return Reflect.metadata(t, e);
|
|
88
|
+
};
|
|
89
|
+
const Y = class {
|
|
90
|
+
constructor(t) {
|
|
91
|
+
D(this, t), this.schedulerConfigChanged = y(this, "schedulerConfigChanged", 7), this.cancelButtonClick = y(this, "cancelButtonClick", 7), this.formSubmitted = y(this, "formSubmitted", 7), this.previewButtonClicked = y(this, "previewButtonClicked", 7), this.setError = (e) => {
|
|
92
|
+
this.error = e.message;
|
|
93
|
+
}, this.formSubmissionHandler = async (e) => {
|
|
94
|
+
var O, F, P, E, R, N, j, M, V, U, z, A, $, Z, G, J;
|
|
95
|
+
if (e.preventDefault(), this.formSubmitted.emit(), !this.formRef.checkValidity())
|
|
96
|
+
return;
|
|
97
|
+
this.isLoading = !0, this.hasUnsavedChanges = !1;
|
|
98
|
+
const s = this.updateFormState(), { title: o, description: i, duration: l, availability: r, calendarIds: b, bookingCalendar: u, location: f, bookingType: h, buffer: m, availableDaysInFuture: g, minCancellationNotice: _, minBookingNotice: v, cancellationPolicy: C, timeslotInterval: p, additionalGuestsHidden: x, hideCancellationOptions: S, hideReschedulingOptions: L } = s, c = (F = (O = this.selectedConfiguration) == null ? void 0 : O.participants) == null ? void 0 : F.find((W) => W.is_organizer), w = l ? parseInt(l) : 30, k = {
|
|
99
|
+
...((P = this.selectedConfiguration) == null ? void 0 : P.id) && { id: this.selectedConfiguration.id },
|
|
100
|
+
version: ((E = this.selectedConfiguration) == null ? void 0 : E.version) ?? "1.0.0",
|
|
101
|
+
availability: {
|
|
102
|
+
duration_minutes: w,
|
|
103
|
+
interval_minutes: (p == null ? void 0 : p.interval) ?? w,
|
|
104
|
+
round_to: p == null ? void 0 : p.roundTo,
|
|
105
|
+
availability_rules: {
|
|
106
|
+
availability_method: ((j = (N = (R = this.selectedConfiguration) == null ? void 0 : R.availability) == null ? void 0 : N.availability_rules) == null ? void 0 : j.availability_method) ?? "collective",
|
|
107
|
+
buffer: m || { before: 0, after: 0 },
|
|
108
|
+
default_open_hours: ((U = (V = (M = this.selectedConfiguration) == null ? void 0 : M.availability) == null ? void 0 : V.availability_rules) == null ? void 0 : U.default_open_hours) ?? at,
|
|
109
|
+
round_robin_group_id: (($ = (A = (z = this.selectedConfiguration) == null ? void 0 : z.availability) == null ? void 0 : A.availability_rules) == null ? void 0 : $.round_robin_group_id) ?? ""
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
participants: [
|
|
113
|
+
{
|
|
114
|
+
name: (c == null ? void 0 : c.name) ?? (c == null ? void 0 : c.email) ?? ((Z = this.currentUser) == null ? void 0 : Z.name) ?? ((G = this.currentUser) == null ? void 0 : G.email) ?? "",
|
|
115
|
+
email: (c == null ? void 0 : c.email) ?? ((J = this.currentUser) == null ? void 0 : J.email) ?? "",
|
|
116
|
+
is_organizer: !0,
|
|
117
|
+
availability: {
|
|
118
|
+
calendar_ids: b != null && b.length ? b : ["primary"],
|
|
119
|
+
open_hours: (r == null ? void 0 : r.openHours) ?? []
|
|
120
|
+
},
|
|
121
|
+
booking: {
|
|
122
|
+
calendar_id: u && u !== "" ? u : "primary"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
event_booking: {
|
|
127
|
+
title: (o == null ? void 0 : o.toString()) ?? "",
|
|
128
|
+
description: (i == null ? void 0 : i.toString()) ?? "",
|
|
129
|
+
location: (f == null ? void 0 : f.toString()) ?? "",
|
|
130
|
+
booking_type: (h == null ? void 0 : h.toString()) ?? "booking",
|
|
131
|
+
timezone: (r == null ? void 0 : r.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
132
|
+
},
|
|
133
|
+
scheduler: {
|
|
134
|
+
cancellation_policy: C ?? "",
|
|
135
|
+
available_days_in_future: g ?? 30,
|
|
136
|
+
min_cancellation_notice: _ ?? 0,
|
|
137
|
+
min_booking_notice: v ?? 60,
|
|
138
|
+
additional_guests_hidden: x ?? !1,
|
|
139
|
+
hide_cancellation_options: S ?? !1,
|
|
140
|
+
hide_rescheduling_options: L ?? !1
|
|
141
|
+
}
|
|
142
|
+
}, B = nt(k, this.selectedConfiguration), H = this.action === "create" ? B : k, et = (W) => {
|
|
143
|
+
this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
|
|
144
|
+
this.changesSaved = !1;
|
|
145
|
+
}, 5e3);
|
|
146
|
+
};
|
|
147
|
+
this.schedulerConfigChanged.emit({ config: H, resetLoadingState: et, setError: this.setError, action: this.action });
|
|
148
|
+
}, this.calendars = void 0, this.selectedConfiguration = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.action = "create", this.activeTab = "eventInfo", this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
|
|
149
|
+
}
|
|
150
|
+
configChangedHandler(t) {
|
|
151
|
+
d("[nylas-editor-tabs]", "configChangedHandler", t, this.selectedConfiguration), this.formState = {
|
|
152
|
+
...this.getFormStateFromConfig(t)
|
|
153
|
+
}, t.id ? this.action = "edit" : this.action = "create";
|
|
154
|
+
}
|
|
155
|
+
connectedCallback() {
|
|
156
|
+
d("[nylas-editor-tabs]", "connectedCallback");
|
|
157
|
+
}
|
|
158
|
+
componentWillLoad() {
|
|
159
|
+
d("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
|
|
160
|
+
}
|
|
161
|
+
componentDidLoad() {
|
|
162
|
+
d("[nylas-editor-tabs]", "componentDidLoad");
|
|
163
|
+
}
|
|
164
|
+
disconnectedCallback() {
|
|
165
|
+
d("[nylas-editor-tabs]", "disconnectedCallback");
|
|
166
|
+
}
|
|
167
|
+
handleValueChanged(t) {
|
|
168
|
+
d("[nylas-editor-tabs]", "handleValueChanged", t);
|
|
169
|
+
const { name: e, value: a } = t.detail;
|
|
170
|
+
this.formState = { ...this.formState, [e]: a }, this.hasUnsavedChanges = !0, this.error = "";
|
|
171
|
+
}
|
|
172
|
+
getFormStateFromConfig(t) {
|
|
173
|
+
var a, s, o, i, l, r, b, u, f, h, m, g, _, v, C, p, x, S, L, c, w, k, B;
|
|
174
|
+
const e = (a = t == null ? void 0 : t.participants) == null ? void 0 : a.find((H) => H.is_organizer);
|
|
175
|
+
return {
|
|
176
|
+
title: ((s = t == null ? void 0 : t.event_booking) == null ? void 0 : s.title) ?? "",
|
|
177
|
+
description: ((o = t == null ? void 0 : t.event_booking) == null ? void 0 : o.description) ?? "",
|
|
178
|
+
duration: ((l = (i = t == null ? void 0 : t.availability) == null ? void 0 : i.duration_minutes) == null ? void 0 : l.toString()) ?? "30",
|
|
179
|
+
availability: {
|
|
180
|
+
timezone: ((r = t == null ? void 0 : t.event_booking) == null ? void 0 : r.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
181
|
+
openHours: (b = e == null ? void 0 : e.availability) == null ? void 0 : b.open_hours
|
|
182
|
+
},
|
|
183
|
+
calendarIds: ((u = e == null ? void 0 : e.availability) == null ? void 0 : u.calendar_ids) ?? [],
|
|
184
|
+
participants: (t == null ? void 0 : t.participants) ?? [],
|
|
185
|
+
bookingCalendar: ((f = e == null ? void 0 : e.booking) == null ? void 0 : f.calendar_id) ?? (e == null ? void 0 : e.email) ?? "",
|
|
186
|
+
location: ((h = t == null ? void 0 : t.event_booking) == null ? void 0 : h.location) ?? "",
|
|
187
|
+
bookingType: ((m = t == null ? void 0 : t.event_booking) == null ? void 0 : m.booking_type) ?? "booking",
|
|
188
|
+
buffer: ((_ = (g = t == null ? void 0 : t.availability) == null ? void 0 : g.availability_rules) == null ? void 0 : _.buffer) ?? { before: 0, after: 0 },
|
|
189
|
+
cancellationPolicy: ((v = t == null ? void 0 : t.scheduler) == null ? void 0 : v.cancellation_policy) ?? "",
|
|
190
|
+
availableDaysInFuture: ((C = t == null ? void 0 : t.scheduler) == null ? void 0 : C.available_days_in_future) ?? 30,
|
|
191
|
+
minCancellationNotice: ((p = t == null ? void 0 : t.scheduler) == null ? void 0 : p.min_cancellation_notice) ?? 0,
|
|
192
|
+
minBookingNotice: ((x = t == null ? void 0 : t.scheduler) == null ? void 0 : x.min_booking_notice) ?? 60,
|
|
193
|
+
timeslotInterval: {
|
|
194
|
+
interval: ((S = t == null ? void 0 : t.availability) == null ? void 0 : S.interval_minutes) ?? ((L = t == null ? void 0 : t.availability) == null ? void 0 : L.duration_minutes) ?? 10,
|
|
195
|
+
roundTo: (c = t == null ? void 0 : t.availability) == null ? void 0 : c.round_to
|
|
196
|
+
},
|
|
197
|
+
additionalGuestsHidden: ((w = t == null ? void 0 : t.scheduler) == null ? void 0 : w.additional_guests_hidden) ?? !1,
|
|
198
|
+
hideCancellationOptions: ((k = t == null ? void 0 : t.scheduler) == null ? void 0 : k.hide_cancellation_options) ?? !1,
|
|
199
|
+
hideReschedulingOptions: ((B = t == null ? void 0 : t.scheduler) == null ? void 0 : B.hide_rescheduling_options) ?? !1
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
updateFormState() {
|
|
203
|
+
return new FormData(this.formRef).forEach((e, a) => {
|
|
204
|
+
switch (a) {
|
|
205
|
+
case "title":
|
|
206
|
+
this.formState.title = e.toString();
|
|
207
|
+
break;
|
|
208
|
+
case "description":
|
|
209
|
+
this.formState.description = e.toString();
|
|
210
|
+
break;
|
|
211
|
+
case "duration":
|
|
212
|
+
this.formState.duration = e.toString();
|
|
213
|
+
break;
|
|
214
|
+
case "availability":
|
|
215
|
+
this.formState.availability = JSON.parse(e.toString());
|
|
216
|
+
break;
|
|
217
|
+
case "participants":
|
|
218
|
+
this.formState.participants = JSON.parse(e.toString());
|
|
219
|
+
break;
|
|
220
|
+
case "calendars":
|
|
221
|
+
this.formState.calendarIds = e.toString().split(",");
|
|
222
|
+
break;
|
|
223
|
+
case "booking-calendar":
|
|
224
|
+
this.formState.bookingCalendar = e.toString();
|
|
225
|
+
break;
|
|
226
|
+
case "location":
|
|
227
|
+
this.formState.location = e.toString();
|
|
228
|
+
break;
|
|
229
|
+
case "booking-type":
|
|
230
|
+
this.formState.bookingType = e.toString();
|
|
231
|
+
break;
|
|
232
|
+
case "buffer-time":
|
|
233
|
+
this.formState.buffer = JSON.parse(e.toString());
|
|
234
|
+
break;
|
|
235
|
+
case "limit-future-bookings":
|
|
236
|
+
this.formState.availableDaysInFuture = parseInt(e.toString());
|
|
237
|
+
break;
|
|
238
|
+
case "min-cancellation-notice":
|
|
239
|
+
this.formState.minCancellationNotice = parseInt(e.toString());
|
|
240
|
+
break;
|
|
241
|
+
case "min-booking-notice":
|
|
242
|
+
this.formState.minBookingNotice = parseInt(e.toString());
|
|
243
|
+
break;
|
|
244
|
+
case "cancellation-policy":
|
|
245
|
+
this.formState.cancellationPolicy = e.toString();
|
|
246
|
+
break;
|
|
247
|
+
case "timeslot-interval":
|
|
248
|
+
this.formState.timeslotInterval = JSON.parse(e.toString());
|
|
249
|
+
break;
|
|
250
|
+
case "customize-booking-settings":
|
|
251
|
+
const s = JSON.parse(e.toString());
|
|
252
|
+
this.formState.additionalGuestsHidden = s.additionalGuestsHidden, this.formState.hideCancellationOptions = s.hideCancellationOptions, this.formState.hideReschedulingOptions = s.hideReschedulingOptions;
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
}), this.formState = { ...this.formState }, this.formState;
|
|
256
|
+
}
|
|
257
|
+
setActiveTab(t, e) {
|
|
258
|
+
t.preventDefault(), this.updateFormState(), this.activeTab = e;
|
|
259
|
+
}
|
|
260
|
+
render() {
|
|
261
|
+
var t;
|
|
262
|
+
return d("[nylas-editor-tabs]", "render", this.formState), n(K, { key: "de54edb776a03cca0c170f3e1d5f6201cd520172" }, n("form", { key: "013ba8fa3d09938c1cdb686884a035967e5dd5c5", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (e) => this.formRef = e, noValidate: !0 }, this.mode === "app" ? n("div", { class: "form-contents" }, n("div", { class: "tabs" }, n("button", { class: { tab: !0, active: this.activeTab == "eventInfo" }, onClick: (e) => this.setActiveTab(e, "eventInfo") }, n("calendar-info-icon", { width: "16", height: "16" }), "Event Info"), n("button", { class: { tab: !0, active: this.activeTab == "availability" }, onClick: (e) => this.setActiveTab(e, "availability") }, n("calendar-patterns-icon", { width: "16", height: "16" }), "Availability"), n("button", { class: { tab: !0, active: this.activeTab == "bookingOptions" }, onClick: (e) => this.setActiveTab(e, "bookingOptions") }, n("flow-icon", { width: "16", height: "16" }), "Booking Options")), n("div", { class: "tab-content" }, n(ct, { formState: this.formState, activeTab: this.activeTab, calendars: this.calendars, id: ((t = this.selectedConfiguration) == null ? void 0 : t.id) ?? "new" }))) : n("slot", null), n("div", { key: "d16cd84ad1d7fc69b700519851da428a2f15bdd3", class: "footer" }, n("div", { key: "91ac1d799dd53725041d6e12577e7186f8ddad95", class: "preview" }, this.schedulerPreviewLink !== "" && this.action === "edit" && n("button-component", { type: "button", disabled: this.isLoading, clickHandler: (e) => {
|
|
263
|
+
e.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(q(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
|
|
264
|
+
}, variant: "basic" }, "Preview")), n("div", { key: "975c3e7ebf2a11ac457785d4824d7b174a24e643", class: "buttons" }, n("p", { key: "6311d2d31ab503238a5ff98131423167aa794733", class: {
|
|
265
|
+
"unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
|
|
266
|
+
"saved-changes": this.changesSaved,
|
|
267
|
+
error: this.error !== "",
|
|
268
|
+
"error-full-width": this.error !== "" && this.action === "create"
|
|
269
|
+
} }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.error == "" && this.changesSaved ? "Changes saved!" : ""), n("button-component", { key: "83e0a53f373b0fe78c80bcbce98b631fd105001d", type: "button", disabled: this.isLoading, clickHandler: (e) => {
|
|
270
|
+
e.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
|
|
271
|
+
}, variant: "basic" }, "Cancel"), n("button-component", { key: "35c347a3e9bd1f9b54d3919e9d09135fa1ad5c70", type: "submit", disabled: this.isLoading }, this.isLoading ? n("span", null, "Saving", n("loading-icon", null), " ") : this.action == "create" ? "Create" : "Save changes")))));
|
|
272
|
+
}
|
|
273
|
+
get host() {
|
|
274
|
+
return Q(this);
|
|
275
|
+
}
|
|
276
|
+
static get watchers() {
|
|
277
|
+
return {
|
|
278
|
+
selectedConfiguration: ["configChangedHandler"]
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
ht([
|
|
283
|
+
X({
|
|
284
|
+
name: "nylas-editor-tabs",
|
|
285
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
286
|
+
["schedulerConfig.calendars", "calendars"],
|
|
287
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
288
|
+
["schedulerConfig.currentUser", "currentUser"]
|
|
289
|
+
]),
|
|
290
|
+
eventToProps: {
|
|
291
|
+
schedulerConfigChanged: async (t, e) => {
|
|
292
|
+
const { resetLoadingState: a, setError: s, action: o, config: i } = t.detail, l = (r) => {
|
|
293
|
+
const [b, u] = r;
|
|
294
|
+
!b && u && s && s(u), a && a(t);
|
|
295
|
+
};
|
|
296
|
+
if (o === "edit") {
|
|
297
|
+
const r = await e.schedulerConfig.updateConfiguration(i);
|
|
298
|
+
l(r);
|
|
299
|
+
} else {
|
|
300
|
+
const r = await e.schedulerConfig.createConfiguration(i);
|
|
301
|
+
l(r);
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
cancelButtonClick: async (t, e) => {
|
|
305
|
+
e.schedulerConfigStore.state.action = null;
|
|
306
|
+
},
|
|
307
|
+
previewButtonClicked: async (t, e) => {
|
|
308
|
+
d("[nylas-editor-tabs]", "previewButtonClicked", e);
|
|
309
|
+
},
|
|
310
|
+
formSubmitted: async (t, e) => {
|
|
311
|
+
d("[nylas-editor-tabs]", "formSubmitted", e);
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
315
|
+
fireRegisterEvent: !0
|
|
316
|
+
}),
|
|
317
|
+
T("design:type", Function),
|
|
318
|
+
T("design:paramtypes", []),
|
|
319
|
+
T("design:returntype", void 0)
|
|
320
|
+
], Y.prototype, "render", null);
|
|
321
|
+
Y.style = ut;
|
|
322
|
+
const pt = ':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;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:last-of-type{border-bottom:0}.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{display:flex;flex-direction:column}.configurations table .title .config-event-title{font-weight:600}.configurations table .title .config-event-description{font-size:0.75rem}.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}', ft = pt;
|
|
323
|
+
var yt = function(t, e, a, s) {
|
|
324
|
+
var o = arguments.length, i = o < 3 ? e : s === null ? s = Object.getOwnPropertyDescriptor(e, a) : s, l;
|
|
325
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
326
|
+
i = Reflect.decorate(t, e, a, s);
|
|
327
|
+
else
|
|
328
|
+
for (var r = t.length - 1; r >= 0; r--)
|
|
329
|
+
(l = t[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(e, a, i) : l(e, a)) || i);
|
|
330
|
+
return o > 3 && i && Object.defineProperty(e, a, i), i;
|
|
331
|
+
}, I = function(t, e) {
|
|
332
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
333
|
+
return Reflect.metadata(t, e);
|
|
334
|
+
};
|
|
335
|
+
const tt = class {
|
|
336
|
+
constructor(t) {
|
|
337
|
+
D(this, t), this.initListConfigurations = y(this, "initListConfigurations", 7), this.createButtonClick = y(this, "createButtonClick", 7), this.editButtonClick = y(this, "editButtonClick", 7), this.deleteButtonClick = y(this, "deleteButtonClick", 7), this.configurations = [], this.schedulerPreviewLink = "", this.state = "loading", this.error = "", this.copiedButtonIndex = -1;
|
|
338
|
+
}
|
|
339
|
+
connectedCallback() {
|
|
340
|
+
d("[nylas-list-configurations]", "connectedCallback");
|
|
341
|
+
}
|
|
342
|
+
componentWillLoad() {
|
|
343
|
+
d("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
|
|
344
|
+
}
|
|
345
|
+
componentDidLoad() {
|
|
346
|
+
d("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit(this.host);
|
|
347
|
+
}
|
|
348
|
+
disconnectedCallback() {
|
|
349
|
+
d("[nylas-list-configurations]", "disconnectedCallback");
|
|
350
|
+
}
|
|
351
|
+
async getState() {
|
|
352
|
+
return this.state;
|
|
353
|
+
}
|
|
354
|
+
async setState(t) {
|
|
355
|
+
this.state = t;
|
|
356
|
+
}
|
|
357
|
+
async setError(t) {
|
|
358
|
+
this.error = t;
|
|
359
|
+
}
|
|
360
|
+
getDurationString(t) {
|
|
361
|
+
const e = Math.floor(t / 60), a = t % 60;
|
|
362
|
+
return `${e || ""} ${e ? `${e > 1 ? "hours" : "hour"}` : ""} ${a || ""} ${a ? `${a > 1 ? "mins" : "min"}` : ""}`;
|
|
363
|
+
}
|
|
364
|
+
render() {
|
|
365
|
+
return n(K, null, n("div", { class: "header" }, n("div", { class: "description" }, n("h2", null, "All scheduling pages"), n("p", null, "Create, edit and manage all your scheduling pages.")), this.configurations && this.configurations.length > 0 && n("div", { class: "actions" }, n("button-component", { clickHandler: () => {
|
|
366
|
+
this.createButtonClick.emit(this.host);
|
|
367
|
+
} }, "Create new"))), n("div", { class: "configurations" }, n("table", { class: {
|
|
368
|
+
"no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
|
|
369
|
+
} }, n("tr", { class: {
|
|
370
|
+
hide: this.state === "loading" || this.configurations && this.configurations.length === 0
|
|
371
|
+
} }, n("th", null, "Scheduling page title"), n("th", null, "Duration"), n("th", { class: "actions-header" }, "Actions")), this.state === "loading" && n("tr", { class: "no-configurations" }, n("td", { colSpan: 3 }, n("div", null, n("h3", null, "Loading..."), n("p", null, "Please wait while we fetch the scheduling pages")))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && n("tr", { class: "no-configurations" }, n("td", { colSpan: 3 }, n("div", null, n("calendar-icon", { width: "48", height: "48" }), n("h3", null, "No scheduling pages found"), n("p", null, "Get started with creating your first scheduling page"), n("button-component", { clickHandler: () => {
|
|
372
|
+
this.createButtonClick.emit(this.host);
|
|
373
|
+
} }, "Create new")))), this.state !== "loading" && this.configurations.map((t, e) => n("tr", { key: t.id }, n("td", null, n("div", { class: "title" }, n("span", { class: "config-event-title" }, t.event_booking.title), n("span", { class: "config-event-description" }, t.event_booking.description))), n("td", null, n("div", null, this.getDurationString(t.availability.duration_minutes))), n("td", null, n("div", { class: "actions" }, n("button-component", { variant: "basic", id: "copy", key: `copy-${e}`, clickHandler: async (a) => {
|
|
374
|
+
a.preventDefault();
|
|
375
|
+
const s = q(this.schedulerPreviewLink, t);
|
|
376
|
+
await navigator.clipboard.writeText(s), this.copiedButtonIndex = e, setTimeout(() => {
|
|
377
|
+
this.copiedButtonIndex = -1;
|
|
378
|
+
}, 3e3);
|
|
379
|
+
} }, this.copiedButtonIndex === e ? "Copied!" : "Copy link"), n("button-component", { variant: "basic", key: `edit-${e}`, clickHandler: (a) => {
|
|
380
|
+
a.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: t });
|
|
381
|
+
} }, "Edit"), n("button-component", { variant: "basic", key: `delete-${e}`, clickHandler: (a) => {
|
|
382
|
+
a.preventDefault(), this.deleteButtonClick.emit({ host: this.host, configuration: t });
|
|
383
|
+
} }, "Delete"))))))), this.state === "error" && n("div", { class: "error-container" }, n("p", { class: "error" }, this.error)));
|
|
384
|
+
}
|
|
385
|
+
get host() {
|
|
386
|
+
return Q(this);
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
yt([
|
|
390
|
+
X({
|
|
391
|
+
name: "nylas-list-configurations",
|
|
392
|
+
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.configurations", "configurations"]]),
|
|
393
|
+
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
394
|
+
eventToProps: {
|
|
395
|
+
initListConfigurations: async (t, e) => {
|
|
396
|
+
const a = t.detail;
|
|
397
|
+
await a.setState("loading");
|
|
398
|
+
const [s, o] = await e.schedulerConfig.getConfigurations();
|
|
399
|
+
if (!s && o && o.message) {
|
|
400
|
+
await a.setState("error"), await a.setError(o.message);
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
await a.setState("loaded");
|
|
404
|
+
},
|
|
405
|
+
createButtonClick: async (t, e) => {
|
|
406
|
+
e.schedulerConfigStore.resetSelectedConfiguration(), e.schedulerConfigStore.state.action = "create";
|
|
407
|
+
},
|
|
408
|
+
deleteButtonClick: async (t, e) => {
|
|
409
|
+
const { host: a, configuration: s } = t.detail, [o, i] = await e.schedulerConfig.deleteConfiguration(s.id);
|
|
410
|
+
!o && i && i.message && (await a.setState("error"), await a.setError(i.message));
|
|
411
|
+
},
|
|
412
|
+
editButtonClick: async (t, e) => {
|
|
413
|
+
const { configuration: a } = t.detail;
|
|
414
|
+
e.schedulerConfigStore.state.selectedConfiguration = a, e.schedulerConfigStore.state.action = "edit";
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
fireRegisterEvent: !0
|
|
418
|
+
}),
|
|
419
|
+
I("design:type", Function),
|
|
420
|
+
I("design:paramtypes", []),
|
|
421
|
+
I("design:returntype", void 0)
|
|
422
|
+
], tt.prototype, "render", null);
|
|
423
|
+
tt.style = ft;
|
|
424
|
+
export {
|
|
425
|
+
ot as google_logo_icon,
|
|
426
|
+
dt as microsoft_logo_icon,
|
|
427
|
+
Y as nylas_editor_tabs,
|
|
428
|
+
tt as nylas_list_configurations
|
|
429
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-9c04361d.cjs"),J=require("./register-component-a5a9ca5d-1fbb27d2.cjs"),X=require("./constants-f34b9c6e-1da5094b.cjs");require("react");require("react-dom");const Y=".sc-google-logo-icon-h{display:flex}",tt=Y,W=class{constructor(e){t.registerInstance(this,e),this.width="24",this.height="24"}render(){return t.h("svg",{key:"48ccae649f280d48621dfb214a08b980155680a1",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.h("g",{key:"10196951caa0fa0b94b57c57a62d8bcb31d92d91","clip-path":"url(#clip0_959_12452)"},t.h("path",{key:"0d2358cd1dcbd7f9ef2dfa17a5075a341210a43c",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"}),t.h("path",{key:"8540c5619b64996b6b158fe50609aa378dfd468f",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"}),t.h("path",{key:"b683a33b6068de0793ef4426e6404d438dbdf73e",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"}),t.h("path",{key:"916d663bbb04c8267e595adf9125068232414ed7",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"})),t.h("defs",{key:"a941f8ccb1711f648dc3e2db750496a2491b4b55"},t.h("clipPath",{key:"caef3b6e814ed957bcee43a794130dce6760702d",id:"clip0_959_12452"},t.h("rect",{key:"df7c24b60402fd2e9d248f4e5ccfbaa640d549ae",width:24,height:24,fill:"white"}))))}};W.style=tt;const et=".sc-microsoft-logo-icon-h{display:flex}",nt=et,K=class{constructor(e){t.registerInstance(this,e),this.width="22",this.height="22"}render(){return t.h("svg",{key:"4aa3482048f90ecbcb46d539716464bdf2c20e47",width:this.width,height:this.height,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"27924938927bdc57e665d91623f07684aea3a6ee",d:"M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z",fill:"#F35325"}),t.h("path",{key:"91decf0bfe7ef26f93ea724fa9738d1ffa1ae4a6",d:"M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z",fill:"#81BC06"}),t.h("path",{key:"0f455cec58fd99a755157ab9ca950242a634d541",d:"M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z",fill:"#05A6F0"}),t.h("path",{key:"80c930047e54c708d5f7cde3d88f33f2a0d0dbd5",d:"M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z",fill:"#FFBA08"}))}};K.style=nt;function at({id:e,formState:n,activeTab:a,calendars:s}){var o;switch(a){case"eventInfo":const i=n.title,l=n.description,r=parseInt(n.duration),c=n.location;return t.h("div",{key:e},t.h("nylas-event-info",null,t.h("div",{slot:"inputs"},t.h("nylas-event-title",{name:"title",eventTitle:i,exportparts:"net, net__title, net__dropdown-content"}),t.h("nylas-event-duration",{name:"duration",eventDurationMinutes:r,exportparts:"ned, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content"}),t.h("nylas-event-location",{name:"location",eventLocation:c,exportparts:"nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content"}),t.h("nylas-event-description",{name:"description",eventDescription:l,exportparts:"nedesc, nedesc__textarea"}))));case"availability":const h=n.availability.openHours,p=n.availability.timezone?n.availability.timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,b=(o=n.participants)==null?void 0:o.find(g=>g.is_organizer),f=(b==null?void 0:b.email)??"primary",y=n.calendarIds.length>0?n.calendarIds:[f],m=n.bookingCalendar=="primary"?f:n.bookingCalendar;return t.h("div",{key:e},t.h("nylas-booking-calendar-picker",{name:"booking-calendar",calendars:s??[],defaultBookingCalendar:m,exportparts:"nbcp, nbcp__header, nbcp__input-label, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content"}),t.h("nylas-calendar-picker",{name:"calendars",calendars:s??[],defaultSelectedCalendars:y,exportparts:"ncp ncp__header, ncp__dropdown, ncp__dropdown-button, ncp__dropdown-content"}),t.h("nylas-availability-picker",{name:"availability",openHours:h,defaultTimezone:p,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"}));case"bookingOptions":return t.h("div",{key:e},t.h("nylas-buffer-time",{name:"buffer-time",buffer:n.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"}),t.h("nylas-event-limits",null,t.h("div",{slot:"inputs"},t.h("nylas-min-booking-notice",{name:"min-booking-notice",minBookingNotice:n.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"}),t.h("nylas-limit-future-bookings",{name:"limit-future-bookings",availableDaysInFuture:n.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"}),t.h("nylas-min-cancellation-notice",{name:"min-cancellation-notice",minCancellationNotice:n.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"}),t.h("nylas-cancellation-policy",{name:"cancellation-policy",cancellationPolicy:n.cancellationPolicy,exportparts:"ncpolicy, ncpolicy__textarea"}))),t.h("nylas-timeslot-interval",{name:"timeslot-interval",eventDurationMinutes:parseInt(n.duration),exportparts:"nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content"}),t.h("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"}))}}const it='.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 .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}.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}',st=it;var ot=function(e,n,a,s){var o=arguments.length,i=o<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,a):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,n,a,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(i=(o<3?l(i):o>3?l(n,a,i):l(n,a))||i);return o>3&&i&&Object.defineProperty(n,a,i),i},B=function(e,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,n)};const D=class{constructor(e){t.registerInstance(this,e),this.schedulerConfigChanged=t.createEvent(this,"schedulerConfigChanged",7),this.cancelButtonClick=t.createEvent(this,"cancelButtonClick",7),this.formSubmitted=t.createEvent(this,"formSubmitted",7),this.previewButtonClicked=t.createEvent(this,"previewButtonClicked",7),this.setError=n=>{this.error=n.message},this.formSubmissionHandler=async n=>{var T,E,O,F,P,R,N,j,M,V,U,z,A,$,Z,G;if(n.preventDefault(),this.formSubmitted.emit(),!this.formRef.checkValidity())return;this.isLoading=!0,this.hasUnsavedChanges=!1;const s=this.updateFormState(),{title:o,description:i,duration:l,availability:r,calendarIds:c,bookingCalendar:h,location:p,bookingType:b,buffer:f,availableDaysInFuture:y,minCancellationNotice:m,minBookingNotice:g,cancellationPolicy:w,timeslotInterval:u,additionalGuestsHidden:k,hideCancellationOptions:C,hideReschedulingOptions:x}=s,d=(E=(T=this.selectedConfiguration)==null?void 0:T.participants)==null?void 0:E.find(q=>q.is_organizer),_=l?parseInt(l):30,v={...((O=this.selectedConfiguration)==null?void 0:O.id)&&{id:this.selectedConfiguration.id},version:((F=this.selectedConfiguration)==null?void 0:F.version)??"1.0.0",availability:{duration_minutes:_,interval_minutes:(u==null?void 0:u.interval)??_,round_to:u==null?void 0:u.roundTo,availability_rules:{availability_method:((N=(R=(P=this.selectedConfiguration)==null?void 0:P.availability)==null?void 0:R.availability_rules)==null?void 0:N.availability_method)??"collective",buffer:f||{before:0,after:0},default_open_hours:((V=(M=(j=this.selectedConfiguration)==null?void 0:j.availability)==null?void 0:M.availability_rules)==null?void 0:V.default_open_hours)??X.DEFAULT_OPEN_HOURS,round_robin_group_id:((A=(z=(U=this.selectedConfiguration)==null?void 0:U.availability)==null?void 0:z.availability_rules)==null?void 0:A.round_robin_group_id)??""}},participants:[{name:(d==null?void 0:d.name)??(d==null?void 0:d.email)??(($=this.currentUser)==null?void 0:$.name)??((Z=this.currentUser)==null?void 0:Z.email)??"",email:(d==null?void 0:d.email)??((G=this.currentUser)==null?void 0:G.email)??"",is_organizer:!0,availability:{calendar_ids:c!=null&&c.length?c:["primary"],open_hours:(r==null?void 0:r.openHours)??[]},booking:{calendar_id:h&&h!==""?h:"primary"}}],event_booking:{title:(o==null?void 0:o.toString())??"",description:(i==null?void 0:i.toString())??"",location:(p==null?void 0:p.toString())??"",booking_type:(b==null?void 0:b.toString())??"booking",timezone:(r==null?void 0:r.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone},scheduler:{cancellation_policy:w??"",available_days_in_future:y??30,min_cancellation_notice:m??0,min_booking_notice:g??60,additional_guests_hidden:k??!1,hide_cancellation_options:C??!1,hide_rescheduling_options:x??!1}},S=t.mergeDeep(v,this.selectedConfiguration),L=this.action==="create"?S:v,Q=q=>{this.isLoading=!1,this.changesSaved=!0,setTimeout(()=>{this.changesSaved=!1},5e3)};this.schedulerConfigChanged.emit({config:L,resetLoadingState:Q,setError:this.setError,action:this.action})},this.calendars=void 0,this.selectedConfiguration=void 0,this.currentUser=void 0,this.schedulerPreviewLink="",this.mode="app",this.action="create",this.activeTab="eventInfo",this.isLoading=!1,this.hasUnsavedChanges=!1,this.changesSaved=!1,this.formState={},this.error=""}configChangedHandler(e){t.debug("[nylas-editor-tabs]","configChangedHandler",e,this.selectedConfiguration),this.formState={...this.getFormStateFromConfig(e)},e.id?this.action="edit":this.action="create"}connectedCallback(){t.debug("[nylas-editor-tabs]","connectedCallback")}componentWillLoad(){t.debug("[nylas-editor-tabs]","componentWillLoad"),this.formState=this.getFormStateFromConfig(this.selectedConfiguration)}componentDidLoad(){t.debug("[nylas-editor-tabs]","componentDidLoad")}disconnectedCallback(){t.debug("[nylas-editor-tabs]","disconnectedCallback")}handleValueChanged(e){t.debug("[nylas-editor-tabs]","handleValueChanged",e);const{name:n,value:a}=e.detail;this.formState={...this.formState,[n]:a},this.hasUnsavedChanges=!0,this.error=""}getFormStateFromConfig(e){var a,s,o,i,l,r,c,h,p,b,f,y,m,g,w,u,k,C,x,d,_,v,S;const n=(a=e==null?void 0:e.participants)==null?void 0:a.find(L=>L.is_organizer);return{title:((s=e==null?void 0:e.event_booking)==null?void 0:s.title)??"",description:((o=e==null?void 0:e.event_booking)==null?void 0:o.description)??"",duration:((l=(i=e==null?void 0:e.availability)==null?void 0:i.duration_minutes)==null?void 0:l.toString())??"30",availability:{timezone:((r=e==null?void 0:e.event_booking)==null?void 0:r.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone,openHours:(c=n==null?void 0:n.availability)==null?void 0:c.open_hours},calendarIds:((h=n==null?void 0:n.availability)==null?void 0:h.calendar_ids)??[],participants:(e==null?void 0:e.participants)??[],bookingCalendar:((p=n==null?void 0:n.booking)==null?void 0:p.calendar_id)??(n==null?void 0:n.email)??"",location:((b=e==null?void 0:e.event_booking)==null?void 0:b.location)??"",bookingType:((f=e==null?void 0:e.event_booking)==null?void 0:f.booking_type)??"booking",buffer:((m=(y=e==null?void 0:e.availability)==null?void 0:y.availability_rules)==null?void 0:m.buffer)??{before:0,after:0},cancellationPolicy:((g=e==null?void 0:e.scheduler)==null?void 0:g.cancellation_policy)??"",availableDaysInFuture:((w=e==null?void 0:e.scheduler)==null?void 0:w.available_days_in_future)??30,minCancellationNotice:((u=e==null?void 0:e.scheduler)==null?void 0:u.min_cancellation_notice)??0,minBookingNotice:((k=e==null?void 0:e.scheduler)==null?void 0:k.min_booking_notice)??60,timeslotInterval:{interval:((C=e==null?void 0:e.availability)==null?void 0:C.interval_minutes)??((x=e==null?void 0:e.availability)==null?void 0:x.duration_minutes)??10,roundTo:(d=e==null?void 0:e.availability)==null?void 0:d.round_to},additionalGuestsHidden:((_=e==null?void 0:e.scheduler)==null?void 0:_.additional_guests_hidden)??!1,hideCancellationOptions:((v=e==null?void 0:e.scheduler)==null?void 0:v.hide_cancellation_options)??!1,hideReschedulingOptions:((S=e==null?void 0:e.scheduler)==null?void 0:S.hide_rescheduling_options)??!1}}updateFormState(){return new FormData(this.formRef).forEach((n,a)=>{switch(a){case"title":this.formState.title=n.toString();break;case"description":this.formState.description=n.toString();break;case"duration":this.formState.duration=n.toString();break;case"availability":this.formState.availability=JSON.parse(n.toString());break;case"participants":this.formState.participants=JSON.parse(n.toString());break;case"calendars":this.formState.calendarIds=n.toString().split(",");break;case"booking-calendar":this.formState.bookingCalendar=n.toString();break;case"location":this.formState.location=n.toString();break;case"booking-type":this.formState.bookingType=n.toString();break;case"buffer-time":this.formState.buffer=JSON.parse(n.toString());break;case"limit-future-bookings":this.formState.availableDaysInFuture=parseInt(n.toString());break;case"min-cancellation-notice":this.formState.minCancellationNotice=parseInt(n.toString());break;case"min-booking-notice":this.formState.minBookingNotice=parseInt(n.toString());break;case"cancellation-policy":this.formState.cancellationPolicy=n.toString();break;case"timeslot-interval":this.formState.timeslotInterval=JSON.parse(n.toString());break;case"customize-booking-settings":const s=JSON.parse(n.toString());this.formState.additionalGuestsHidden=s.additionalGuestsHidden,this.formState.hideCancellationOptions=s.hideCancellationOptions,this.formState.hideReschedulingOptions=s.hideReschedulingOptions;break}}),this.formState={...this.formState},this.formState}setActiveTab(e,n){e.preventDefault(),this.updateFormState(),this.activeTab=n}render(){var e;return t.debug("[nylas-editor-tabs]","render",this.formState),t.h(t.Host,{key:"de54edb776a03cca0c170f3e1d5f6201cd520172"},t.h("form",{key:"013ba8fa3d09938c1cdb686884a035967e5dd5c5",onSubmit:this.formSubmissionHandler,class:"scheduler-editor",ref:n=>this.formRef=n,noValidate:!0},this.mode==="app"?t.h("div",{class:"form-contents"},t.h("div",{class:"tabs"},t.h("button",{class:{tab:!0,active:this.activeTab=="eventInfo"},onClick:n=>this.setActiveTab(n,"eventInfo")},t.h("calendar-info-icon",{width:"16",height:"16"}),"Event Info"),t.h("button",{class:{tab:!0,active:this.activeTab=="availability"},onClick:n=>this.setActiveTab(n,"availability")},t.h("calendar-patterns-icon",{width:"16",height:"16"}),"Availability"),t.h("button",{class:{tab:!0,active:this.activeTab=="bookingOptions"},onClick:n=>this.setActiveTab(n,"bookingOptions")},t.h("flow-icon",{width:"16",height:"16"}),"Booking Options")),t.h("div",{class:"tab-content"},t.h(at,{formState:this.formState,activeTab:this.activeTab,calendars:this.calendars,id:((e=this.selectedConfiguration)==null?void 0:e.id)??"new"}))):t.h("slot",null),t.h("div",{key:"d16cd84ad1d7fc69b700519851da428a2f15bdd3",class:"footer"},t.h("div",{key:"91ac1d799dd53725041d6e12577e7186f8ddad95",class:"preview"},this.schedulerPreviewLink!==""&&this.action==="edit"&&t.h("button-component",{type:"button",disabled:this.isLoading,clickHandler:n=>{n.preventDefault(),this.previewButtonClicked.emit(this.host).defaultPrevented||window.open(t.parsePreviewLink(this.schedulerPreviewLink,this.selectedConfiguration),"_blank")},variant:"basic"},"Preview")),t.h("div",{key:"975c3e7ebf2a11ac457785d4824d7b174a24e643",class:"buttons"},t.h("p",{key:"6311d2d31ab503238a5ff98131423167aa794733",class:{"unsaved-changes":this.hasUnsavedChanges&&!this.changesSaved,"saved-changes":this.changesSaved,error:this.error!=="","error-full-width":this.error!==""&&this.action==="create"}},this.error!==""?this.error:"",this.error==""&&this.hasUnsavedChanges&&!this.changesSaved?"Unsaved changes":this.error==""&&this.changesSaved?"Changes saved!":""),t.h("button-component",{key:"83e0a53f373b0fe78c80bcbce98b631fd105001d",type:"button",disabled:this.isLoading,clickHandler:n=>{n.preventDefault(),this.cancelButtonClick.emit(),this.error=""},variant:"basic"},"Cancel"),t.h("button-component",{key:"35c347a3e9bd1f9b54d3919e9d09135fa1ad5c70",type:"submit",disabled:this.isLoading},this.isLoading?t.h("span",null,"Saving",t.h("loading-icon",null)," "):this.action=="create"?"Create":"Save changes")))))}get host(){return t.getElement(this)}static get watchers(){return{selectedConfiguration:["configChangedHandler"]}}};ot([J.RegisterComponent({name:"nylas-editor-tabs",stateToProps:new Map([["schedulerConfig.calendars","calendars"],["schedulerConfig.selectedConfiguration","selectedConfiguration"],["schedulerConfig.currentUser","currentUser"]]),eventToProps:{schedulerConfigChanged:async(e,n)=>{const{resetLoadingState:a,setError:s,action:o,config:i}=e.detail,l=r=>{const[c,h]=r;!c&&h&&s&&s(h),a&&a(e)};if(o==="edit"){const r=await n.schedulerConfig.updateConfiguration(i);l(r)}else{const r=await n.schedulerConfig.createConfiguration(i);l(r)}},cancelButtonClick:async(e,n)=>{n.schedulerConfigStore.state.action=null},previewButtonClicked:async(e,n)=>{t.debug("[nylas-editor-tabs]","previewButtonClicked",n)},formSubmitted:async(e,n)=>{t.debug("[nylas-editor-tabs]","formSubmitted",n)}},localPropsToProp:new Map([["schedulerPreviewLink","schedulerPreviewLink"]]),fireRegisterEvent:!0}),B("design:type",Function),B("design:paramtypes",[]),B("design:returntype",void 0)],D.prototype,"render",null);D.style=st;const rt=':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;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:last-of-type{border-bottom:0}.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{display:flex;flex-direction:column}.configurations table .title .config-event-title{font-weight:600}.configurations table .title .config-event-description{font-size:0.75rem}.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}',lt=rt;var dt=function(e,n,a,s){var o=arguments.length,i=o<3?n:s===null?s=Object.getOwnPropertyDescriptor(n,a):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,n,a,s);else for(var r=e.length-1;r>=0;r--)(l=e[r])&&(i=(o<3?l(i):o>3?l(n,a,i):l(n,a))||i);return o>3&&i&&Object.defineProperty(n,a,i),i},H=function(e,n){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,n)};const I=class{constructor(e){t.registerInstance(this,e),this.initListConfigurations=t.createEvent(this,"initListConfigurations",7),this.createButtonClick=t.createEvent(this,"createButtonClick",7),this.editButtonClick=t.createEvent(this,"editButtonClick",7),this.deleteButtonClick=t.createEvent(this,"deleteButtonClick",7),this.configurations=[],this.schedulerPreviewLink="",this.state="loading",this.error="",this.copiedButtonIndex=-1}connectedCallback(){t.debug("[nylas-list-configurations]","connectedCallback")}componentWillLoad(){t.debug("[nylas-list-configurations]","componentWillLoad"),this.configurations&&this.configurations.length>0&&(this.state="loaded")}componentDidLoad(){t.debug("[nylas-list-configurations]","componentDidLoad"),this.initListConfigurations.emit(this.host)}disconnectedCallback(){t.debug("[nylas-list-configurations]","disconnectedCallback")}async getState(){return this.state}async setState(e){this.state=e}async setError(e){this.error=e}getDurationString(e){const n=Math.floor(e/60),a=e%60;return`${n||""} ${n?`${n>1?"hours":"hour"}`:""} ${a||""} ${a?`${a>1?"mins":"min"}`:""}`}render(){return t.h(t.Host,null,t.h("div",{class:"header"},t.h("div",{class:"description"},t.h("h2",null,"All scheduling pages"),t.h("p",null,"Create, edit and manage all your scheduling pages.")),this.configurations&&this.configurations.length>0&&t.h("div",{class:"actions"},t.h("button-component",{clickHandler:()=>{this.createButtonClick.emit(this.host)}},"Create new"))),t.h("div",{class:"configurations"},t.h("table",{class:{"no-configurations":this.state!=="loading"&&(!this.configurations||this.configurations.length===0)}},t.h("tr",{class:{hide:this.state==="loading"||this.configurations&&this.configurations.length===0}},t.h("th",null,"Scheduling page title"),t.h("th",null,"Duration"),t.h("th",{class:"actions-header"},"Actions")),this.state==="loading"&&t.h("tr",{class:"no-configurations"},t.h("td",{colSpan:3},t.h("div",null,t.h("h3",null,"Loading..."),t.h("p",null,"Please wait while we fetch the scheduling pages")))),this.state!=="loading"&&(!this.configurations||this.configurations.length===0)&&t.h("tr",{class:"no-configurations"},t.h("td",{colSpan:3},t.h("div",null,t.h("calendar-icon",{width:"48",height:"48"}),t.h("h3",null,"No scheduling pages found"),t.h("p",null,"Get started with creating your first scheduling page"),t.h("button-component",{clickHandler:()=>{this.createButtonClick.emit(this.host)}},"Create new")))),this.state!=="loading"&&this.configurations.map((e,n)=>t.h("tr",{key:e.id},t.h("td",null,t.h("div",{class:"title"},t.h("span",{class:"config-event-title"},e.event_booking.title),t.h("span",{class:"config-event-description"},e.event_booking.description))),t.h("td",null,t.h("div",null,this.getDurationString(e.availability.duration_minutes))),t.h("td",null,t.h("div",{class:"actions"},t.h("button-component",{variant:"basic",id:"copy",key:`copy-${n}`,clickHandler:async a=>{a.preventDefault();const s=t.parsePreviewLink(this.schedulerPreviewLink,e);await navigator.clipboard.writeText(s),this.copiedButtonIndex=n,setTimeout(()=>{this.copiedButtonIndex=-1},3e3)}},this.copiedButtonIndex===n?"Copied!":"Copy link"),t.h("button-component",{variant:"basic",key:`edit-${n}`,clickHandler:a=>{a.preventDefault(),this.editButtonClick.emit({host:this.host,configuration:e})}},"Edit"),t.h("button-component",{variant:"basic",key:`delete-${n}`,clickHandler:a=>{a.preventDefault(),this.deleteButtonClick.emit({host:this.host,configuration:e})}},"Delete"))))))),this.state==="error"&&t.h("div",{class:"error-container"},t.h("p",{class:"error"},this.error)))}get host(){return t.getElement(this)}};dt([J.RegisterComponent({name:"nylas-list-configurations",stateToProps:new Map([["schedulerConfig.configurations","configurations"]]),localPropsToProp:new Map([["schedulerPreviewLink","schedulerPreviewLink"]]),eventToProps:{initListConfigurations:async(e,n)=>{const a=e.detail;await a.setState("loading");const[s,o]=await n.schedulerConfig.getConfigurations();if(!s&&o&&o.message){await a.setState("error"),await a.setError(o.message);return}await a.setState("loaded")},createButtonClick:async(e,n)=>{n.schedulerConfigStore.resetSelectedConfiguration(),n.schedulerConfigStore.state.action="create"},deleteButtonClick:async(e,n)=>{const{host:a,configuration:s}=e.detail,[o,i]=await n.schedulerConfig.deleteConfiguration(s.id);!o&&i&&i.message&&(await a.setState("error"),await a.setError(i.message))},editButtonClick:async(e,n)=>{const{configuration:a}=e.detail;n.schedulerConfigStore.state.selectedConfiguration=a,n.schedulerConfigStore.state.action="edit"}},fireRegisterEvent:!0}),H("design:type",Function),H("design:paramtypes",[]),H("design:returntype",void 0)],I.prototype,"render",null);I.style=lt;exports.google_logo_icon=W;exports.microsoft_logo_icon=K;exports.nylas_editor_tabs=D;exports.nylas_list_configurations=I;
|