@nylas/react 2.0.3 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{abstract-provider-bdb7d9b4-12a95387.cjs → abstract-provider-45ada3b4-31e3ed72.cjs} +1 -1
- package/dist/{abstract-provider-bdb7d9b4-22cf4a74.js → abstract-provider-45ada3b4-abd3105d.js} +1 -1
- package/dist/{add-circle-icon_2.entry-d56f519c.cjs → add-circle-icon_2.entry-48953f9c.cjs} +1 -1
- package/dist/{add-circle-icon_2.entry-0ff79148.js → add-circle-icon_2.entry-f6f8b5e5.js} +1 -1
- package/dist/{archive-icon.entry-aaff46ec.js → archive-icon.entry-b3a76711.js} +1 -1
- package/dist/{archive-icon.entry-6ab120ff.cjs → archive-icon.entry-e2880dc7.cjs} +1 -1
- package/dist/{arrow-icon.entry-d57cf44f.cjs → arrow-icon.entry-84d1e26c.cjs} +1 -1
- package/dist/{arrow-icon.entry-d8fcbc1f.js → arrow-icon.entry-9b3441aa.js} +1 -1
- package/dist/{bold-icon.entry-e48075a4.js → bold-icon.entry-0749a116.js} +1 -1
- package/dist/{bold-icon.entry-0f23543d.cjs → bold-icon.entry-e1d8ab5e.cjs} +1 -1
- package/dist/{button-component_2.entry-3d622397.cjs → button-component_2.entry-1a817230.cjs} +1 -1
- package/dist/{button-component_2.entry-5db80bec.js → button-component_2.entry-6eb55e97.js} +1 -1
- package/dist/calendar-agenda-fill-icon_37.entry-0ca8b9f4.cjs +6 -0
- package/dist/calendar-agenda-fill-icon_37.entry-4adf73a2.js +5231 -0
- package/dist/{calendar-cancel-icon.entry-8b43441c.js → calendar-cancel-icon.entry-2a29cb3f.js} +1 -1
- package/dist/{calendar-cancel-icon.entry-9546c7c3.cjs → calendar-cancel-icon.entry-e0dee585.cjs} +1 -1
- package/dist/{calendar-check-icon.entry-a03b249a.cjs → calendar-check-icon.entry-7f96d456.cjs} +1 -1
- package/dist/{calendar-check-icon.entry-4e6abda7.js → calendar-check-icon.entry-c12b63ea.js} +1 -1
- package/dist/{calendar-icon.entry-cd4b0ec4.cjs → calendar-icon.entry-a2d19ff2.cjs} +1 -1
- package/dist/{calendar-icon.entry-5b622c12.js → calendar-icon.entry-e82a5169.js} +1 -1
- package/dist/checkbox-component.entry-59612a67.js +52 -0
- package/dist/checkbox-component.entry-ddce70bc.cjs +1 -0
- package/dist/checkbox-group_4.entry-3311da64.cjs +28 -0
- package/dist/{checkbox-group_4.entry-b2a5b2b2.js → checkbox-group_4.entry-7df47ad4.js} +287 -246
- package/dist/{checkmark-circle-icon.entry-30582af4.js → checkmark-circle-icon.entry-677b0def.js} +1 -1
- package/dist/{checkmark-circle-icon.entry-9617301c.cjs → checkmark-circle-icon.entry-67df713b.cjs} +1 -1
- package/dist/checkmark-icon_15.entry-2121e1b7.cjs +5 -0
- package/dist/checkmark-icon_15.entry-9fd0ec58.js +1412 -0
- package/dist/chevron-icon_3.entry-1a42235c.cjs +1 -0
- package/dist/{chevron-icon_3.entry-517447a6.js → chevron-icon_3.entry-f0ad71d9.js} +19 -10
- package/dist/{clock-icon_4.entry-5351318c.cjs → clock-icon_4.entry-88822a84.cjs} +1 -1
- package/dist/{clock-icon_4.entry-7ea1274d.js → clock-icon_4.entry-e7472d5f.js} +1 -1
- package/dist/{customParseFormat-f0d21eb3-904f1e57.js → customParseFormat-eeec04f5-3ad26beb.js} +1 -1
- package/dist/{customParseFormat-f0d21eb3-769d6bf2.cjs → customParseFormat-eeec04f5-d5957784.cjs} +1 -1
- package/dist/{delete-icon.entry-64b61f5c.cjs → delete-icon.entry-3cb58910.cjs} +1 -1
- package/dist/{delete-icon.entry-02e44ba1.js → delete-icon.entry-813429d7.js} +1 -1
- package/dist/{document-refresh-icon.entry-2f599a22.cjs → document-refresh-icon.entry-ae361b0b.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-fcaa84ad.js → document-refresh-icon.entry-c224c778.js} +1 -1
- package/dist/{feedbackSync-b9c9e719-b54b3268.js → feedbackSync-0ebd0eda-803c3ebe.js} +1 -1
- package/dist/{feedbackSync-b9c9e719-bee3fea1.cjs → feedbackSync-0ebd0eda-e12b00d5.cjs} +1 -1
- package/dist/{folder-icon.entry-55c123dc.cjs → folder-icon.entry-107841af.cjs} +1 -1
- package/dist/{folder-icon.entry-f4862c1b.js → folder-icon.entry-9c1f7c41.js} +1 -1
- package/dist/{forward-icon.entry-4a41e94f.js → forward-icon.entry-4ac22c16.js} +1 -1
- package/dist/{forward-icon.entry-82719382.cjs → forward-icon.entry-6cec1f94.cjs} +1 -1
- package/dist/globe-icon.entry-7798c93b.js +16 -0
- package/dist/globe-icon.entry-909c1382.cjs +1 -0
- package/dist/google-logo-icon_6.entry-1f4ad364.cjs +2 -0
- package/dist/{google-logo-icon_6.entry-b331ab60.js → google-logo-icon_6.entry-b198c90a.js} +332 -282
- package/dist/{google-meet-icon_5.entry-e3d44d56.cjs → google-meet-icon_5.entry-82d87e77.cjs} +1 -1
- package/dist/{google-meet-icon_5.entry-eb9f7d93.js → google-meet-icon_5.entry-fa6dc1dc.js} +1 -1
- package/dist/{inbox-icon.entry-a385095d.js → inbox-icon.entry-1b123e64.js} +1 -1
- package/dist/{inbox-icon.entry-fa9085cd.cjs → inbox-icon.entry-84f96d31.cjs} +1 -1
- package/dist/{index-ad781fbc.js → index-140eb219.js} +6753 -6439
- package/dist/index-d8a42c15.cjs +118 -0
- package/dist/{index.es-ccb2a286-dfa2bfbe.js → index.es-57d4a08f-184cbc01.js} +1 -1
- package/dist/{index.es-ccb2a286-9a2c0934.cjs → index.es-57d4a08f-b0a2ca19.cjs} +1 -1
- package/dist/info-icon_2.entry-f09e7dae.cjs +1 -0
- package/dist/info-icon_2.entry-f8b72d08.js +35 -0
- package/dist/input-component.entry-44607977.js +93 -0
- package/dist/input-component.entry-fd38953d.cjs +1 -0
- package/dist/input-dropdown_2.entry-4c2e5e1a.cjs +1 -0
- package/dist/{input-dropdown_2.entry-1b55ef0c.js → input-dropdown_2.entry-6898b420.js} +30 -9
- package/dist/{italic-icon.entry-4266a817.js → italic-icon.entry-16aa1ada.js} +1 -1
- package/dist/{italic-icon.entry-843feb2b.cjs → italic-icon.entry-beef2254.cjs} +1 -1
- package/dist/lib/elements/index.d.ts +1 -0
- package/dist/lib/notetaker/SendNotetaker/SendNotetaker.d.ts +3 -2
- package/dist/lib/notetaker/VideoPlayer/VideoPlayer.d.ts +2 -0
- package/dist/lib/notetaker/lib/store.d.ts +1 -2
- package/dist/multi-select-dropdown.entry-50133d29.js +130 -0
- package/dist/multi-select-dropdown.entry-c82cd6d4.cjs +1 -0
- package/dist/{nylas-booked-event-card_11.entry-ccf30d91.js → nylas-booked-event-card_11.entry-56768a09.js} +69 -69
- package/dist/nylas-booked-event-card_11.entry-eb4b3c5c.cjs +1 -0
- package/dist/nylas-date-component_2.entry-93f2f352.cjs +1 -0
- package/dist/nylas-date-component_2.entry-df957150.js +307 -0
- package/dist/nylas-form-card.entry-4d95a4ad.cjs +1 -0
- package/dist/nylas-form-card.entry-7724e61f.js +72 -0
- package/dist/nylas-notification_2.entry-448c2cb8.cjs +1 -0
- package/dist/nylas-notification_2.entry-af763b6c.js +85 -0
- package/dist/{nylas-scheduler-editor.entry-aa079dff.js → nylas-scheduler-editor.entry-0e4ba46d.js} +45 -34
- package/dist/{nylas-scheduler-editor.entry-9744694a.cjs → nylas-scheduler-editor.entry-e36cdd9d.cjs} +2 -2
- package/dist/{nylas-scheduling.entry-7441979c.js → nylas-scheduling.entry-1b207e91.js} +196 -185
- package/dist/nylas-scheduling.entry-904dd10e.cjs +1 -0
- package/dist/{person-icon.entry-acf4d22b.cjs → person-icon.entry-70d46ca6.cjs} +1 -1
- package/dist/{person-icon.entry-23a69633.js → person-icon.entry-f2979577.js} +1 -1
- package/dist/{play-icon.entry-aa088180.cjs → play-icon.entry-c2cf0b12.cjs} +1 -1
- package/dist/{play-icon.entry-4e7884d4.js → play-icon.entry-d387df5d.js} +1 -1
- package/dist/radio-button-group.entry-45dbd2df.js +56 -0
- package/dist/radio-button-group.entry-94e06176.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +41 -40
- package/dist/{refresh-icon.entry-96cb008f.cjs → refresh-icon.entry-5ab20f26.cjs} +1 -1
- package/dist/{refresh-icon.entry-d1603555.js → refresh-icon.entry-777cff27.js} +1 -1
- package/dist/{register-component-9d4ceee5-46f58baf.js → register-component-0aad9e3d-b395364a.js} +1 -1
- package/dist/{register-component-9d4ceee5-6fabc42c.cjs → register-component-0aad9e3d-d2f2e543.cjs} +1 -1
- package/dist/{reply-all-icon.entry-537f7718.cjs → reply-all-icon.entry-3c90510e.cjs} +1 -1
- package/dist/{reply-all-icon.entry-6fae7288.js → reply-all-icon.entry-e2dd6da9.js} +1 -1
- package/dist/{reply-icon.entry-ae114e35.js → reply-icon.entry-00a97d9f.js} +1 -1
- package/dist/{reply-icon.entry-72fa6e4c.cjs → reply-icon.entry-d96478be.cjs} +1 -1
- package/dist/{sent-icon.entry-30a6ac17.cjs → sent-icon.entry-2d16da4e.cjs} +1 -1
- package/dist/{sent-icon.entry-b10d5e26.js → sent-icon.entry-949cf214.js} +1 -1
- package/dist/{spam-icon.entry-bed45849.js → spam-icon.entry-3baf9e79.js} +1 -1
- package/dist/{spam-icon.entry-357aa525.cjs → spam-icon.entry-7ee61730.cjs} +1 -1
- package/dist/{star-icon.entry-010349a5.js → star-icon.entry-9fdb278b.js} +1 -1
- package/dist/{star-icon.entry-53c85ebb.cjs → star-icon.entry-dc702d73.cjs} +1 -1
- package/dist/{stop-icon.entry-20af3bf5.cjs → stop-icon.entry-b5ae7e55.cjs} +1 -1
- package/dist/{stop-icon.entry-18f650bf.js → stop-icon.entry-efa1ea66.js} +1 -1
- package/dist/textarea-component.entry-247aca42.cjs +1 -0
- package/dist/textarea-component.entry-7c6fc4d8.js +55 -0
- package/dist/toggle-switch.entry-a0295d17.js +49 -0
- package/dist/toggle-switch.entry-d52b0338.cjs +1 -0
- package/dist/{translate-icon.entry-2308a8e4.js → translate-icon.entry-219cab17.js} +1 -1
- package/dist/{translate-icon.entry-7cb7a479.cjs → translate-icon.entry-985b3b29.cjs} +1 -1
- package/dist/{trash-fill-icon.entry-7f410c82.js → trash-fill-icon.entry-03c90559.js} +1 -1
- package/dist/{trash-fill-icon.entry-c70b9326.cjs → trash-fill-icon.entry-4dfd7d24.cjs} +1 -1
- package/dist/{underline-icon.entry-58ef1a9f.js → underline-icon.entry-58fa18b5.js} +1 -1
- package/dist/{underline-icon.entry-23f478f3.cjs → underline-icon.entry-c60b77a6.cjs} +1 -1
- package/package.json +3 -3
- package/dist/calendar-agenda-fill-icon_36.entry-75d7cd5b.cjs +0 -6
- package/dist/calendar-agenda-fill-icon_36.entry-78fc2e0d.js +0 -4708
- package/dist/checkbox-component_2.entry-82f4b1f2.js +0 -115
- package/dist/checkbox-component_2.entry-c9c8a87d.cjs +0 -1
- package/dist/checkbox-group_4.entry-5a4f0ed2.cjs +0 -28
- package/dist/checkmark-icon_15.entry-01536ed2.js +0 -1339
- package/dist/checkmark-icon_15.entry-c5eaad9b.cjs +0 -5
- package/dist/chevron-icon_3.entry-26f14744.cjs +0 -1
- package/dist/globe-icon_2.entry-3f0e408e.cjs +0 -1
- package/dist/globe-icon_2.entry-8f5c79b2.js +0 -210
- package/dist/google-logo-icon_6.entry-9c91c3d4.cjs +0 -2
- package/dist/index-dc6efb5e.cjs +0 -118
- package/dist/info-icon_2.entry-9f32753b.cjs +0 -1
- package/dist/info-icon_2.entry-c18a111e.js +0 -35
- package/dist/input-component.entry-eae64f46.js +0 -84
- package/dist/input-component.entry-ff9e04c9.cjs +0 -1
- package/dist/input-dropdown_2.entry-67d6d292.cjs +0 -1
- package/dist/multi-select-dropdown.entry-854265ef.js +0 -121
- package/dist/multi-select-dropdown.entry-ca9acf75.cjs +0 -1
- package/dist/nylas-booked-event-card_11.entry-8d3e2019.cjs +0 -1
- package/dist/nylas-form-card.entry-481ede48.js +0 -58
- package/dist/nylas-form-card.entry-58162c72.cjs +0 -1
- package/dist/nylas-notification_2.entry-7d3ed3b0.js +0 -85
- package/dist/nylas-notification_2.entry-dffa3ff6.cjs +0 -1
- package/dist/nylas-scheduling.entry-b1fcb48f.cjs +0 -1
- package/dist/radio-button-group.entry-243d7988.js +0 -47
- package/dist/radio-button-group.entry-cea225c8.cjs +0 -1
- package/dist/textarea-component.entry-b19642f1.cjs +0 -1
- package/dist/textarea-component.entry-e6120440.js +0 -39
- package/dist/toggle-switch.entry-32b0e964.js +0 -34
- package/dist/toggle-switch.entry-becdda2c.cjs +0 -1
|
@@ -0,0 +1,1412 @@
|
|
|
1
|
+
import { r as b, h as l, a as m, g as x, b as d, S as q, H as C, i as c, y as R, T as S, P as V, U as M } from "./index-140eb219.js";
|
|
2
|
+
import { R as w } from "./register-component-0aad9e3d-b395364a.js";
|
|
3
|
+
import { E as k, P as E, f as J } from "./constants-f51538ef-e0a5f026.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react/jsx-runtime";
|
|
6
|
+
import "react-dom";
|
|
7
|
+
const G = ".sc-checkmark-icon-h{display:flex}", X = G, Q = class {
|
|
8
|
+
constructor(e) {
|
|
9
|
+
b(this, e), this.width = "18", this.height = "14";
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return l("svg", { key: "a739b30f83d6510e6644045ba736860eb524c838", width: this.width, height: this.height, viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, l("path", { key: "9621004de9b8789eab6f4d0616ae0ff25124fd44", d: "M1.53033 7.46967C1.23744 7.17678 0.762563 7.17678 0.46967 7.46967C0.176777 7.76256 0.176777 8.23744 0.46967 8.53033L4.96967 13.0303C5.26256 13.3232 5.73744 13.3232 6.03033 13.0303L17.0303 2.03033C17.3232 1.73744 17.3232 1.26256 17.0303 0.96967C16.7374 0.676777 16.2626 0.676777 15.9697 0.96967L5.5 11.4393L1.53033 7.46967Z", fill: "#293056" }));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
Q.style = X;
|
|
16
|
+
const Y = ".sc-copy-icon-h{display:flex}", ee = Y, te = class {
|
|
17
|
+
constructor(e) {
|
|
18
|
+
b(this, e), this.width = "16", this.height = "16";
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return l("svg", { key: "af5249494e43163c59f43f0e21ff4a9063566023", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, l("path", { key: "d1b78a39d0dd7ce2a3823d54e2e0dbd5f260c188", d: "M4 0.75C2.89543 0.75 2 1.64543 2 2.75V12.75C2 13.8546 2.89543 14.75 4 14.75H10C11.1046 14.75 12 13.8546 12 12.75V2.75C12 1.64543 11.1046 0.75 10 0.75H4ZM3 2.75C3 2.19772 3.44772 1.75 4 1.75H10C10.5523 1.75 11 2.19772 11 2.75V12.75C11 13.3023 10.5523 13.75 10 13.75H4C3.44772 13.75 3 13.3023 3 12.75V2.75ZM0 4.75001C0 4.00973 0.402199 3.36339 1 3.01758V13.25C1 14.6307 2.11929 15.75 3.5 15.75H9.73244C9.38663 16.3478 8.74028 16.75 8 16.75H3.5C1.567 16.75 0 15.183 0 13.25V4.75001Z", fill: "currentColor" }));
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
te.style = ee;
|
|
25
|
+
const ne = ".sc-dragable-icon-h{display:flex}", ae = ne, oe = class {
|
|
26
|
+
constructor(e) {
|
|
27
|
+
b(this, e), this.width = "20", this.height = "20";
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
return l("svg", { key: "e4d3ba685832139b22eb5b024479e22f2ddfc811", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, l("path", { key: "68f15598ca1251c3926a3b88adb0947f1a5b6b4a", d: "M15.5 18C16.3284 18 17 18.6716 17 19.5C17 20.3284 16.3284 21 15.5 21C14.6716 21 14 20.3284 14 19.5C14 18.6716 14.6716 18 15.5 18ZM8.5 18C9.32843 18 10 18.6716 10 19.5C10 20.3284 9.32843 21 8.5 21C7.67157 21 7 20.3284 7 19.5C7 18.6716 7.67157 18 8.5 18ZM15.5 11C16.3284 11 17 11.6716 17 12.5C17 13.3284 16.3284 14 15.5 14C14.6716 14 14 13.3284 14 12.5C14 11.6716 14.6716 11 15.5 11ZM8.5 11C9.32843 11 10 11.6716 10 12.5C10 13.3284 9.32843 14 8.5 14C7.67157 14 7 13.3284 7 12.5C7 11.6716 7.67157 11 8.5 11ZM15.5 4C16.3284 4 17 4.67157 17 5.5C17 6.32843 16.3284 7 15.5 7C14.6716 7 14 6.32843 14 5.5C14 4.67157 14.6716 4 15.5 4ZM8.5 4C9.32843 4 10 4.67157 10 5.5C10 6.32843 9.32843 7 8.5 7C7.67157 7 7 6.32843 7 5.5C7 4.67157 7.67157 4 8.5 4Z", fill: "currentColor" }));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
oe.style = ae;
|
|
34
|
+
const se = ".sc-eye-icon-h{display:flex}", le = se, ie = class {
|
|
35
|
+
constructor(e) {
|
|
36
|
+
b(this, e), this.width = "17", this.height = "10";
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return l("svg", { key: "2b2a63f9602d85c9661986eb2dd8e220a02e5570", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, l("path", { key: "8609bab91f97b282d80282736ce38f895e7b6fc1", d: "M1.75909 6.60214C2.44254 3.32689 5.29437 1 8.50002 1C11.7057 1 14.5574 3.32688 15.2409 6.60215C15.2974 6.87246 15.5622 7.04587 15.8325 6.98946C16.1029 6.93304 16.2763 6.66817 16.2199 6.39785C15.4425 2.67312 12.1934 0 8.50002 0C4.8066 0 1.55742 2.67311 0.780175 6.39786C0.723767 6.66818 0.897177 6.93305 1.1675 6.98946C1.43782 7.04587 1.70268 6.87246 1.75909 6.60214ZM8.5 3C6.567 3 5 4.567 5 6.5C5 8.433 6.567 10 8.5 10C10.433 10 12 8.433 12 6.5C12 4.567 10.433 3 8.5 3ZM6 6.5C6 5.11929 7.11929 4 8.5 4C9.88071 4 11 5.11929 11 6.5C11 7.88071 9.88071 9 8.5 9C7.11929 9 6 7.88071 6 6.5Z", fill: "currentColor" }));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
ie.style = le;
|
|
43
|
+
const re = ".sc-feedback-icon-h{display:flex}", ce = re, de = class {
|
|
44
|
+
constructor(e) {
|
|
45
|
+
b(this, e), this.width = "11", this.height = "14";
|
|
46
|
+
}
|
|
47
|
+
render() {
|
|
48
|
+
return l("svg", { key: "0cef0443a3b22ffa2bd9be587f55175bef8557cf", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, l("path", { key: "20631452d3f3bc031b79d3337eda08143db490e4", d: "M0.5 8.875C0.5 8.875 1.125 8.25 3 8.25C4.875 8.25 6.125 9.5 8 9.5C9.875 9.5 10.5 8.875 10.5 8.875V1.375C10.5 1.375 9.875 2 8 2C6.125 2 4.875 0.75 3 0.75C1.125 0.75 0.5 1.375 0.5 1.375V8.875ZM0.5 8.875V13.25", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round" }));
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
de.style = ce;
|
|
52
|
+
const fe = ':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:100%}@media screen and (max-width: 768px){:host{position:unset}}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}.color-picker-container{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;width:-moz-available;width:-webkit-fill-available;padding-left:0;gap:0;overflow:hidden}.color-picker-container:focus{outline-color:var(--nylas-primary)}.color-picker-container.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}.color-picker-container.error::placeholder{font-weight:400}.color-picker-container::placeholder{color:var(--nylas-base-300)}.color-picker-container input{display:flex;align-items:center;height:100%;appearance:none;border:none;border-right:1px solid var(--nylas-base-200);background:transparent}.color-picker-container input::-webkit-color-swatch{min-width:30px;border-radius:0.25rem;border:1px solid var(--nylas-base-200);margin:0.25rem}.color-picker-container input::-moz-color-swatch{min-width:30px;border-radius:0.25rem;border:1px solid var(--nylas-base-200);margin:0.25rem}.color-picker-container.error{border:1px solid var(--nylas-error)}.color-picker-container:hover,.color-picker-container:active{outline:1px solid var(--nylas-primary)}.color-picker-container:active{outline:2px solid var(--nylas-primary)}.color-picker-container label{width:100%}.labelBtn{color:var(--nylas-base-800);padding:14px;font-size:16px;font-family:var(--nylas-font-family);cursor:pointer;display:flex;flex-direction:row;justify-content:space-between;width:100%;gap:0.5rem;background:transparent;border:none}.labelBtn.error{border:1px solid var(--nylas-error)}.labelBtn.focus{background:transparent}.labelBtn:hover,.labelBtn:active{outline:1px solid var(--nylas-primary)}.labelBtn span.chevron{display:flex;align-self:center}.labelBtn span.open{transform:rotate(90deg)}.labelBtn span.closed{transform:rotate(270deg)}.labelBtn span.selected-option{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:144px;font-size:14px;line-height:20px}@media screen and (max-width: 768px){.labelBtn span.selected-option{max-width:124px;font-size:16px}}', pe = fe, ye = class {
|
|
53
|
+
constructor(e) {
|
|
54
|
+
b(this, e), this.nylasFormDropdownChanged = m(this, "nylasFormDropdownChanged", 7), this.componentType = "color-picker", this.name = void 0, this.defaultSelectedColor = void 0, this.selectedColor = this.defaultSelectedColor, this.isOpen = !1, this.ariaActivedescendant = "", this.errorMessage = "";
|
|
55
|
+
}
|
|
56
|
+
componentWillLoad() {
|
|
57
|
+
this.selectedColor = this.defaultSelectedColor, this.el.setAttribute("component-type", this.componentType);
|
|
58
|
+
}
|
|
59
|
+
handleFocus() {
|
|
60
|
+
this.isOpen = !0;
|
|
61
|
+
}
|
|
62
|
+
handleBlur() {
|
|
63
|
+
this.isOpen = !1;
|
|
64
|
+
}
|
|
65
|
+
handleInput(e) {
|
|
66
|
+
this.selectedColor = e.target.value;
|
|
67
|
+
}
|
|
68
|
+
handleChange(e) {
|
|
69
|
+
this.selectedColor = e.target.value, this.nylasFormDropdownChanged.emit({
|
|
70
|
+
value: this.selectedColor,
|
|
71
|
+
name: this.name,
|
|
72
|
+
error: this.errorMessage
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
handleKeyDown(e) {
|
|
76
|
+
var t;
|
|
77
|
+
(e.code === "Enter" || e.code === "Space") && (e.preventDefault(), (t = this.inputRef) == null || t.click());
|
|
78
|
+
}
|
|
79
|
+
handleOutsideClick(e) {
|
|
80
|
+
!e.composedPath().includes(this.el) && this.isOpen && (this.isOpen = !1);
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
return l("div", { key: "354f7c502fadd2c6a30619365b9939523d9cd770", class: "color-picker-container", part: "icp_color-picker", tabindex: "0", onKeyDown: (e) => this.handleKeyDown(e) }, l("input", { key: "cc5803d2e90064b15137717043581f24cf80fda3", type: "color", ref: (e) => this.inputRef = e, id: this.name, name: this.name, value: this.selectedColor, tabindex: "-1", onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur(), onInput: (e) => this.handleInput(e), onChange: (e) => this.handleChange(e), onKeyDown: (e) => this.handleKeyDown(e) }), l("label", { key: "75e26e605a36d5a3505f41dbdad576484b14ac43", part: "icp_color-picker-button", htmlFor: this.name, class: { labelBtn: !0, open: this.isOpen, error: !!this.errorMessage }, "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? "true" : "false", "aria-label": this.name }, l("span", { key: "9a321653073ef9aa8a9372e291bd04244b6dfe46", class: "selected-option", part: "icp_color-picker-button-selected-label" }, this.selectedColor || "Select a color"), l("span", { key: "62ed4fb1337b47735c823b8e164bb8bb57325ffd", class: {
|
|
84
|
+
open: this.isOpen,
|
|
85
|
+
closed: !this.isOpen,
|
|
86
|
+
chevron: !0
|
|
87
|
+
}, "aria-hidden": "true" }, l("chevron-icon", { key: "5c304ff53cfc6d3632f4fbbd8415c318301b4e38", width: "16", height: "16" })), this.errorMessage && l("span", { class: "error help-text" }, this.errorMessage)));
|
|
88
|
+
}
|
|
89
|
+
get el() {
|
|
90
|
+
return x(this);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
ye.style = pe;
|
|
94
|
+
const he = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:inherit}.logo-container{display:flex;flex-direction:row;gap:2rem}.logo-container .input-container{flex:1}.logo-container .input-container span.error-message{color:var(--nylas-error)}.logo-container .logo{display:flex;justify-content:center;align-items:center;width:200px;height:100px;border:var(--nylas-base-200) solid 1px;border-radius:var(--nylas-border-radius-2x);overflow:hidden;padding:10px}.logo-container .logo img{max-height:100%;max-width:100%;object-fit:contain;object-position:center}', ue = he;
|
|
95
|
+
var be = function(e, t, n, o) {
|
|
96
|
+
var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
|
|
97
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
98
|
+
s = Reflect.decorate(e, t, n, o);
|
|
99
|
+
else
|
|
100
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
101
|
+
(a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
|
|
102
|
+
return r > 3 && s && Object.defineProperty(t, n, s), s;
|
|
103
|
+
}, O = function(e, t) {
|
|
104
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
105
|
+
return Reflect.metadata(e, t);
|
|
106
|
+
};
|
|
107
|
+
const N = class {
|
|
108
|
+
constructor(e) {
|
|
109
|
+
b(this, e), this.nylasFormInputImageUrlInvalid = m(this, "nylasFormInputImageUrlInvalid", 7), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.componentType = "image-url", this.imageUrl = "", this.themeConfig = void 0, this.errorMessage = "", this.name = "input-image-url", this.currentImageUrl = this.imageUrl, this.error = "";
|
|
110
|
+
}
|
|
111
|
+
connectedCallback() {
|
|
112
|
+
d("nylas-image-input", "connectedCallback");
|
|
113
|
+
}
|
|
114
|
+
disconnectedCallback() {
|
|
115
|
+
d("nylas-image-input", "disconnectedCallback");
|
|
116
|
+
}
|
|
117
|
+
componentWillLoad() {
|
|
118
|
+
d("nylas-image-input", "componentWillLoad"), this.host.setAttribute("name", this.name), this.host.setAttribute("component-type", this.componentType);
|
|
119
|
+
}
|
|
120
|
+
componentDidLoad() {
|
|
121
|
+
d("nylas-image-input", "componentDidLoad"), this.currentImageUrl = this.imageUrl, this.setImage(this.imageUrl, !1), this.applyThemeConfig(this.themeConfig);
|
|
122
|
+
}
|
|
123
|
+
componentWillUpdate() {
|
|
124
|
+
d("nylas-image-input", "componentWillUpdate");
|
|
125
|
+
}
|
|
126
|
+
componentDidUpdate() {
|
|
127
|
+
d("nylas-image-input", "componentDidUpdate");
|
|
128
|
+
}
|
|
129
|
+
componentWillRender() {
|
|
130
|
+
d("nylas-image-input", "componentWillRender");
|
|
131
|
+
}
|
|
132
|
+
componentDidRender() {
|
|
133
|
+
d("nylas-image-input", "componentDidRender");
|
|
134
|
+
}
|
|
135
|
+
elementNameChangedHandler(e) {
|
|
136
|
+
d("nylas-image-input", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
137
|
+
}
|
|
138
|
+
errorMessageChangedHandler(e) {
|
|
139
|
+
d("nylas-image-input", "errorMessageChangedHandler", e), this.error && (this.error = e);
|
|
140
|
+
}
|
|
141
|
+
themeConfigChangedHandler(e, t) {
|
|
142
|
+
e !== t && this.applyThemeConfig(e);
|
|
143
|
+
}
|
|
144
|
+
applyThemeConfig(e) {
|
|
145
|
+
if (e)
|
|
146
|
+
for (const [t, n] of Object.entries(e))
|
|
147
|
+
this.host.style.setProperty(`${t}`, n);
|
|
148
|
+
}
|
|
149
|
+
async nylasFormInputChangedHandler(e) {
|
|
150
|
+
const { name: t, value: n } = e.detail;
|
|
151
|
+
t === this.name && this.setImage(n);
|
|
152
|
+
}
|
|
153
|
+
async nylasFormInputBlurHandler(e) {
|
|
154
|
+
const { name: t, value: n } = e.detail;
|
|
155
|
+
t === this.name && this.setImage(n);
|
|
156
|
+
}
|
|
157
|
+
setImage(e, t = !0) {
|
|
158
|
+
this.error = "", q(e).then(() => {
|
|
159
|
+
this.currentImageUrl = e, this.internals.setValidity({}), this.internals.setFormValue(this.currentImageUrl, this.name), t && this.valueChanged.emit({ value: this.currentImageUrl, name: this.name });
|
|
160
|
+
}).catch(() => {
|
|
161
|
+
this.error = this.errorMessage || "Invalid image URL.", this.nylasFormInputImageUrlInvalid.emit({ value: this.error, name: this.name }), typeof this.internals.setValidity == "function" && this.internals.setValidity({ customError: !0 }, this.error);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
render() {
|
|
165
|
+
return l(C, { key: "3ba309394a934b49e5fe958b2b35689db17ed25a" }, l("div", { key: "35364f7a937b885e295814931619162caf41b849", class: "logo-container" }, l("div", { key: "7b4714a223160fb8700f9ea240c96a86370360dd", class: "input-container" }, l("input-component", { key: "443b31dfa78de24cf3720bc985a0d8a723ea0f85", name: this.name, id: this.name, type: "text", required: !1, themeConfig: this.themeConfig, exportparts: "ic_input: iiu__logo-input-textfield", defaultValue: this.imageUrl ?? "" }), this.error && l("span", { class: "error-message" }, this.error)), this.currentImageUrl && !this.error && l("div", { class: "logo" }, l("img", { src: this.currentImageUrl, alt: "Logo" }))));
|
|
166
|
+
}
|
|
167
|
+
static get formAssociated() {
|
|
168
|
+
return !0;
|
|
169
|
+
}
|
|
170
|
+
get host() {
|
|
171
|
+
return x(this);
|
|
172
|
+
}
|
|
173
|
+
static get watchers() {
|
|
174
|
+
return {
|
|
175
|
+
name: ["elementNameChangedHandler"],
|
|
176
|
+
errorMessage: ["errorMessageChangedHandler"],
|
|
177
|
+
themeConfig: ["themeConfigChangedHandler"]
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
be([
|
|
182
|
+
w({
|
|
183
|
+
name: "nylas-image-input",
|
|
184
|
+
eventToProps: {
|
|
185
|
+
valueChanged: async (e, t) => {
|
|
186
|
+
const { valueChanged: n } = e.detail;
|
|
187
|
+
n && n(e);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}),
|
|
191
|
+
O("design:type", Function),
|
|
192
|
+
O("design:paramtypes", []),
|
|
193
|
+
O("design:returntype", void 0)
|
|
194
|
+
], N.prototype, "render", null);
|
|
195
|
+
N.style = ue;
|
|
196
|
+
const ge = ':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-additional-participants__title{color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-additional-participants__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-additional-participants__content{padding:1rem;display:flex;flex-direction:column;gap:1rem;background-color:var(--nylas-base-25)}.nylas-additional-participants__input_group{padding-top:8px;display:flex;flex-direction:column;gap:4px}.nylas-additional-participants__input_group label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%}.nylas-additional-participants__input_group label span.org-as-participant{width:max-content}.nylas-additional-participants__error{color:var(--nylas-error);font-size:14px;font-family:var(--nylas-font-family);font-weight:400;line-height:16px;margin:0;text-align:left}.nylas-additional-participants__input_wrapper{display:flex;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-300)}.nylas-additional-participants__input_wrapper.error{border-color:var(--nylas-error)}.nylas-additional-participants__input_wrapper button{padding:12px;border:none;border-left:1px solid var(--nylas-base-300);background:none;cursor:pointer;color:var(--nylas-base-800)}.nylas-additional-participants__input_wrapper button:hover,.nylas-additional-participants__input_wrapper button:active{color:var(--nylas-primary)}.nylas-additional-participants__input_wrapper_organizer{border:none}.nylas-additional-participants__input{flex:1;display:flex;justify-content:space-between}.nylas-additional-participants__input input{border:none;outline:none;background:none;width:100%}.nylas-additional-participants__input input-dropdown{width:100%}.nylas-additional-participants__input input-dropdown::part(id_dropdown){width:100%;height:100%}.nylas-additional-participants__input input-dropdown::part(id_dropdown-input){height:100%;border-radius:var(--nylas-border-radius-2x);border:none;border-top-right-radius:initial;border-bottom-right-radius:initial;padding-left:16px}.nylas-additional-participants__input input-component::part(ic__input){background:var(--nylas-base-50)}.nylas-additional-participants__input input-component::part(ic__label){font-size:14px}.nylas-additional-participants__input input-component div.required-input{display:flex;gap:4px}.nylas-additional-participants__input input-component div.required-input label{display:flex;gap:4px;align-items:center}.nylas-additional-participants__input input-component div.required-input label tooltip-component#organizer_participant_tooltip::part(tc__content){left:-84px}.nylas-additional-participants__add{padding:12px;display:flex;align-items:center;border:none;background:none;cursor:pointer;color:var(--nylas-base-800)}.nylas-additional-participants__add span{padding:0 8px;font-size:16px;font-style:normal;font-weight:500}.nylas-additional-participants__add:hover,.nylas-additional-participants__add:active{color:var(--nylas-primary)}', me = ge;
|
|
197
|
+
var ve = function(e, t, n, o) {
|
|
198
|
+
var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
|
|
199
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
200
|
+
s = Reflect.decorate(e, t, n, o);
|
|
201
|
+
else
|
|
202
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
203
|
+
(a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
|
|
204
|
+
return r > 3 && s && Object.defineProperty(t, n, s), s;
|
|
205
|
+
}, I = function(e, t) {
|
|
206
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
207
|
+
return Reflect.metadata(e, t);
|
|
208
|
+
};
|
|
209
|
+
const z = class {
|
|
210
|
+
constructor(e) {
|
|
211
|
+
b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "participants", this.selectedConfiguration = void 0, this.currentUser = void 0, this.currentUserCalendars = void 0, this.participantOptions = void 0, this.eventParticipants = void 0, this.roundRobinConfig = void 0, this.selectedLanguage = void 0, this.themeConfig = void 0, this.participants = this.eventParticipants ?? [], this.participantErrors = {}, this.includeOrganizerAsParticipant = !0, this.isRoundRobinConfig = !1, this.error = "", this.requiredError = "", this.patternError = "";
|
|
212
|
+
}
|
|
213
|
+
elementNameChangedHandler(e) {
|
|
214
|
+
d("nylas-additional-participants", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
215
|
+
}
|
|
216
|
+
selectedConfigurationAndCurrentUserChangedHandler(e, t, n) {
|
|
217
|
+
d("nylas-additional-participants", "selectedConfigurationAndCurrentUserChangedHandler", e, this.currentUser), n === "selectedConfiguration" ? this.updateState(e, this.currentUser, !1) : n === "currentUser" && this.updateState(this.selectedConfiguration, e, !1);
|
|
218
|
+
}
|
|
219
|
+
selectedLanguageChangedHandler(e, t) {
|
|
220
|
+
e !== t && (c.changeLanguage(e), this.requiredError = c.t("fieldRequired", { field: c.t("email") }), this.patternError = c.t("invalidInputFormat", { field: c.t("email") }), this.error && (this.error = c.t("nylasAdditionalParticipants.error")));
|
|
221
|
+
}
|
|
222
|
+
themeConfigChangedHandler(e, t) {
|
|
223
|
+
e !== t && this.applyThemeConfig(e);
|
|
224
|
+
}
|
|
225
|
+
connectedCallback() {
|
|
226
|
+
d("nylas-additional-participants", "connectedCallback");
|
|
227
|
+
}
|
|
228
|
+
componentWillLoad() {
|
|
229
|
+
d("nylas-additional-participants", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
230
|
+
}
|
|
231
|
+
componentDidLoad() {
|
|
232
|
+
d("nylas-additional-participants", "componentDidLoad"), this.selectedConfiguration ? this.updateState(this.selectedConfiguration, this.currentUser, !1) : this.eventParticipants && (this.participants = this.eventParticipants || [], this.isRoundRobinConfig = this.roundRobinConfig || !1, this.updateFormValue(!0));
|
|
233
|
+
}
|
|
234
|
+
disconnectedCallback() {
|
|
235
|
+
d("nylas-additional-participants", "disconnectedCallback");
|
|
236
|
+
}
|
|
237
|
+
updateState(e, t, n = !0) {
|
|
238
|
+
var o, r, s, a;
|
|
239
|
+
this.isRoundRobinConfig = (r = (o = e == null ? void 0 : e.availability) == null ? void 0 : o.availability_rules) != null && r.availability_method ? ((a = (s = e == null ? void 0 : e.availability) == null ? void 0 : s.availability_rules) == null ? void 0 : a.availability_method) !== "collective" : !1, this.participants = (e == null ? void 0 : e.participants) || this.eventParticipants || [], this.includeOrganizerAsParticipant = !!(this.isRoundRobinConfig && this.participants.find((i) => i.email === (t == null ? void 0 : t.email))), this.updateOrganizerAsParticipant(n);
|
|
240
|
+
}
|
|
241
|
+
get isInternalsAvailable() {
|
|
242
|
+
return this.internals !== void 0 && typeof this.internals.setFormValue == "function" && typeof this.internals.setValidity == "function";
|
|
243
|
+
}
|
|
244
|
+
onInputOptionChanged(e) {
|
|
245
|
+
var s, a, i, f;
|
|
246
|
+
d("nylas-additional-participants", "onInputOptionChanged");
|
|
247
|
+
const t = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, n = e.detail.name, o = (s = this.participantOptions) == null ? void 0 : s.find((p) => p.email === e.detail.value);
|
|
248
|
+
if (!o && this.isRoundRobinConfig) {
|
|
249
|
+
this.isInternalsAvailable && this.internals.setValidity({ customError: !0 }, "For round robin configuration, participant should be selected from the dropdown."), this.participantErrors[n] = "For round robin page, participant should be selected from the dropdown.", this.participants[n].is_valid = !1, this.participants = [...this.participants];
|
|
250
|
+
return;
|
|
251
|
+
} else if (!o && !t.test(e.detail.value)) {
|
|
252
|
+
this.isInternalsAvailable && this.internals.setValidity({ customError: !0 }, c.t("nylasAdditionalParticipants.error_email")), this.participantErrors[n] = c.t("nylasAdditionalParticipants.error_email"), this.participants[n].is_valid = !1, this.participants = [...this.participants];
|
|
253
|
+
return;
|
|
254
|
+
} else
|
|
255
|
+
this.participantErrors[n] = "", this.participants[n].is_valid = !0, this.isInternalsAvailable && this.internals.setValidity({});
|
|
256
|
+
this.participants[n].email = e.detail.value;
|
|
257
|
+
const r = (a = o == null ? void 0 : o.calendars) == null ? void 0 : a.find((p) => p.is_primary);
|
|
258
|
+
this.participants[n].availability = o && (r != null && r.id) ? { calendar_ids: [r.id] } : (i = o == null ? void 0 : o.calendars[0]) != null && i.id ? { calendar_ids: [o.calendars[0].id] } : void 0, this.participants[n].booking = o && this.isRoundRobinConfig && (r != null && r.id) ? { calendar_id: r.id } : this.isRoundRobinConfig && ((f = o == null ? void 0 : o.calendars[0]) != null && f.id) ? { calendar_id: o.calendars[0].id } : void 0, this.participants[n].name = (o == null ? void 0 : o.name) || e.detail.value, this.participants = [...this.participants], this.updateFormValue();
|
|
259
|
+
}
|
|
260
|
+
updateOrganizerAsParticipant(e = !0) {
|
|
261
|
+
var n, o, r, s, a, i, f;
|
|
262
|
+
const t = this.participants.find((p) => {
|
|
263
|
+
var h;
|
|
264
|
+
return p.email === ((h = this.currentUser) == null ? void 0 : h.email);
|
|
265
|
+
});
|
|
266
|
+
if (this.isRoundRobinConfig && !t && ((n = this.currentUser) != null && n.email)) {
|
|
267
|
+
const p = ((r = (o = this.currentUserCalendars) == null ? void 0 : o.find((h) => h.is_primary)) == null ? void 0 : r.id) || ((a = (s = this.currentUserCalendars) == null ? void 0 : s[0]) == null ? void 0 : a.id) || "primary";
|
|
268
|
+
this.participants = [
|
|
269
|
+
{
|
|
270
|
+
name: (i = this.currentUser) == null ? void 0 : i.name,
|
|
271
|
+
email: (f = this.currentUser) == null ? void 0 : f.email,
|
|
272
|
+
is_organizer: !0,
|
|
273
|
+
availability: {
|
|
274
|
+
calendar_ids: [p]
|
|
275
|
+
},
|
|
276
|
+
booking: {
|
|
277
|
+
calendar_id: p
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
...this.participants
|
|
281
|
+
];
|
|
282
|
+
}
|
|
283
|
+
this.updateFormValue(e);
|
|
284
|
+
}
|
|
285
|
+
addParticipant() {
|
|
286
|
+
d("nylas-additional-participants", "addParticipant"), this.participants = [...this.participants, { name: "", email: "", is_organizer: !1 }], this.updateFormValue();
|
|
287
|
+
}
|
|
288
|
+
removeParticipant(e) {
|
|
289
|
+
d("nylas-additional-participants", "removeParticipant"), this.participants = this.participants.filter((t, n) => n !== e), this.updateFormValue();
|
|
290
|
+
}
|
|
291
|
+
updateFormValue(e = !0) {
|
|
292
|
+
d("nylas-additional-participants", "updateFormValue");
|
|
293
|
+
const t = this.isRoundRobinConfig ? this.includeOrganizerAsParticipant ? this.participants : this.participants.filter((n) => !n.is_organizer) : this.participants;
|
|
294
|
+
t.length === 0 ? (this.error = c.t("nylasAdditionalParticipants.error"), this.isInternalsAvailable && this.internals.setValidity({ customError: !0 }, this.error)) : (this.isInternalsAvailable && this.internals.setValidity({}), this.error = "", this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(t), this.name), e && this.valueChanged.emit({ value: JSON.stringify(t), name: this.name }));
|
|
295
|
+
}
|
|
296
|
+
getArrayDifference(e, t) {
|
|
297
|
+
return e.filter((o) => !t.some((r) => o.email === r.email)).map((o) => ({ value: o.email, label: o.email }));
|
|
298
|
+
}
|
|
299
|
+
applyThemeConfig(e) {
|
|
300
|
+
if (e)
|
|
301
|
+
for (const [t, n] of Object.entries(e))
|
|
302
|
+
this.host.style.setProperty(`${t}`, n);
|
|
303
|
+
}
|
|
304
|
+
render() {
|
|
305
|
+
return l(C, { key: "8f567ae6775e709c0d2046cb0e072039e6aa22f6", part: "nadtnlpart" }, l("nylas-form-card", { key: "9797400fad8fc093f6a909270ddfa7baf192ac8d", exportparts: "nfc, nfc__header", themeConfig: this.themeConfig }, l("h3", { key: "e4a4a618db2fb686a0f307727eafb15fc67e464f", slot: "header-title", class: "nylas-additional-participants__title", part: "nadtnlpart__title" }, c.t("nylasAdditionalParticipants.headerTitle")), l("p", { key: "30fe99e55ec458a1772492d39652072b4df893c6", slot: "header-subtitle", class: "nylas-additional-participants__subtitle", part: "nadtnlpart__subtitle" }, c.t("nylasAdditionalParticipants.headerSubTitle")), l("div", { key: "f5fcde3ccb7493850b02ef17cbfc73e54560c045", slot: "content", class: "nylas-additional-participants__content", part: "nadtnlpart__content" }, l("div", { key: "25f5adaf1b9e1f4c2d4cc3a98e4becba334a34b0" }, this.participants.map((e, t) => l("div", { class: "nylas-additional-participants__input_group", part: "nadtnlpart__input_group" }, !e.is_organizer && l("label", null, `${c.t("nylasAdditionalParticipants.participant")} ${t}`), l("div", { part: "nadtnlpart__input_wrapper", class: {
|
|
306
|
+
"nylas-additional-participants__input_wrapper": !0,
|
|
307
|
+
"nylas-additional-participants__input_wrapper_organizer": (e == null ? void 0 : e.is_organizer) === !0,
|
|
308
|
+
"nylas-additional-participants__input_wrapper_invalid": e.is_valid === !1,
|
|
309
|
+
error: e.is_valid === !1
|
|
310
|
+
} }, l("div", { class: { "nylas-additional-participants__input": !0, organizer: (e == null ? void 0 : e.is_organizer) === !0 }, part: "nadtnlpart__input" }, e.is_organizer ? l("input-component", { class: "label-input", name: `${t}`, key: t, label: c.t("nylasAdditionalParticipants.organizer"), required: !1, requiredError: this.requiredError, patternError: this.patternError, readOnly: e.is_organizer, defaultValue: e.email, themeConfig: this.themeConfig }, this.isRoundRobinConfig && l("div", { class: "required-input", slot: "additional-input" }, l("input", { type: "checkbox", name: "organizer_participant", id: "organizer_participant", onClick: () => {
|
|
311
|
+
this.includeOrganizerAsParticipant = !this.includeOrganizerAsParticipant, this.updateFormValue();
|
|
312
|
+
}, checked: this.includeOrganizerAsParticipant }), l("label", { htmlFor: "organizer_participant", "aria-label": "Include as participant" }, l("span", { class: "org-as-participant", part: "nadtnlpart__org-as-participant" }, c.t("nylasAdditionalParticipants.organizerAsParticipant")), l("tooltip-component", { id: "organizer_participant_tooltip" }, l("info-icon", { slot: "tooltip-icon" }), l("span", { slot: "tooltip-content" }, l("strong", null, c.t("nylasAdditionalParticipants.tooltip.includeOrganizer"), ":"), " ", c.t("nylasAdditionalParticipants.tooltip.includeOrganizerDesc"), " ", l("br", null), l("strong", null, c.t("nylasAdditionalParticipants.tooltip.excludeOrganizer"), ":"), " ", c.t("nylasAdditionalParticipants.tooltip.excludeOrganizerDesc")))))) : l("input-dropdown", { id: `${t}`, name: `${t}`, filterable: !0, inputValue: e.email, options: this.getArrayDifference(this.participantOptions || [], this.participants), themeConfig: this.themeConfig }), !e.is_organizer && l("button", { onClick: () => this.removeParticipant(t), part: "nadtnlpart__remove-participant" }, l("close-icon", null)))), !e.is_valid && l("p", { class: "nylas-additional-participants__error", part: "nadtnlpart__error" }, this.participantErrors[t]))), l("p", { key: "8878a1424302cbf36cf0a3a3a945c9a2ab63f1cd", class: "nylas-additional-participants__error", part: "nadtnlpart__error" }, this.error)), l("button", { key: "ffc743095240b2b14cedab52178fcec10a5f9d40", class: "nylas-additional-participants__add", part: "nadtnlpart__add-participant", onClick: () => this.addParticipant() }, l("add-circle-icon", { key: "b7c9581fd3aa18b846ae908ca49bbfaebf3f86e0" }), " ", l("span", { key: "9ae4f72925cd53c2fef4600dd6ec806ff513e211" }, this.participants.length > 1 ? c.t("nylasAdditionalParticipants.addParticipant", { context: "next" }) : c.t("nylasAdditionalParticipants.addParticipant", { context: "first" }))))));
|
|
313
|
+
}
|
|
314
|
+
static get formAssociated() {
|
|
315
|
+
return !0;
|
|
316
|
+
}
|
|
317
|
+
get host() {
|
|
318
|
+
return x(this);
|
|
319
|
+
}
|
|
320
|
+
static get watchers() {
|
|
321
|
+
return {
|
|
322
|
+
name: ["elementNameChangedHandler"],
|
|
323
|
+
currentUser: ["selectedConfigurationAndCurrentUserChangedHandler"],
|
|
324
|
+
selectedConfiguration: ["selectedConfigurationAndCurrentUserChangedHandler"],
|
|
325
|
+
selectedLanguage: ["selectedLanguageChangedHandler"],
|
|
326
|
+
themeConfig: ["themeConfigChangedHandler"]
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
ve([
|
|
331
|
+
w({
|
|
332
|
+
name: "nylas-additional-participants",
|
|
333
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
334
|
+
["schedulerConfig.additionalParticipants", "participantOptions"],
|
|
335
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
336
|
+
["schedulerConfig.currentUser", "currentUser"],
|
|
337
|
+
["schedulerConfig.calendars", "currentUserCalendars"],
|
|
338
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"],
|
|
339
|
+
["schedulerConfig.themeConfig", "themeConfig"]
|
|
340
|
+
]),
|
|
341
|
+
eventToProps: {},
|
|
342
|
+
fireRegisterEvent: !0
|
|
343
|
+
}),
|
|
344
|
+
I("design:type", Function),
|
|
345
|
+
I("design:paramtypes", []),
|
|
346
|
+
I("design:returntype", void 0)
|
|
347
|
+
], z.prototype, "render", null);
|
|
348
|
+
z.style = me;
|
|
349
|
+
const xe = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-event-description{display:flex;flex-direction:column;gap:4px;position:relative}.nylas-event-description label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-description label span.label-icon{margin-left:4px}.nylas-event-description label span.label-icon tooltip-component{display:flex}.nylas-event-description textarea{padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px;border:1px solid var(--nylas-base-200)}.nylas-event-description textarea::-webkit-resizer{display:none}.nylas-event-description div.event-description{padding:12px 16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);white-space:nowrap;scrollbar-width:thin;min-height:50px;overflow-y:auto;white-space:pre-wrap;line-height:1.5;background-color:var(--nylas-base-0);}.nylas-event-description div.event-description::-webkit-scrollbar{width:6px;height:6px}.nylas-event-description div.event-description.error{border-color:var(--nylas-error);border-width:2px;outline:none}.nylas-event-description span.add-additional-fields{display:flex;align-items:center;gap:8px}.nylas-event-description span.add-additional-fields button-component button{height:35px;background-color:var(--nylas-base-0)}.nylas-event-description span.help-text{display:inline-block;gap:4px;align-items:center;color:var(--nylas-base-500);font-size:14px;font-style:normal;font-weight:400;line-height:21px;position:relative}.nylas-event-description span.help-text span.label-icon{display:inline-block}.nylas-event-description span.help-text span.label-icon tooltip-component::part(tc__container){position:unset}.nylas-event-description span.help-text span.label-icon tooltip-component::part(tc__content){position:absolute;top:4px;left:50%;transform:translateX(-50%)}.nylas-event-description .highlighted-tag{background-color:var(--nylas-base-200);border-radius:var(--nylas-border-radius);padding:2px 5px;margin-left:4px;margin-bottom:4px;display:inline-block;vertical-align:baseline}.nylas-event-description .token-options{display:block;background-color:var(--nylas-base-0);width:100%;max-height:336px;margin-top:28px;overflow:auto;z-index:1;border-radius:4px;position:absolute;bottom:108px;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}@media screen and (max-width: 768px){.nylas-event-description .token-options{right:0;width:325px;max-width:unset}}.nylas-event-description .token-options ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px;margin:0}.nylas-event-description .token-options ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.nylas-event-description .token-options ul li .token-label{display:flex;flex-direction:column;font-weight:400}.nylas-event-description .token-options ul li .token-label .token{color:var(--nylas-abse-900);font-size:16px;line-height:24px}.nylas-event-description .token-options ul li .token-label .description{color:var(--nylas-base-600);font-size:14px;line-height:21px}.nylas-event-description .token-options ul li:hover,.nylas-event-description .token-options ul li:focus,.nylas-event-description .token-options ul li:active,.nylas-event-description .token-options ul li.active{background-color:var(--nylas-base-100)}.nylas-event-description .token-options ul li:hover .token-label .token,.nylas-event-description .token-options ul li:focus .token-label .token,.nylas-event-description .token-options ul li:active .token-label .token,.nylas-event-description .token-options ul li.active .token-label .token{color:var(--nylas-primary)}.nylas-event-description .token-options .selected{background-color:var(--nylas-base-100)}', ke = xe;
|
|
350
|
+
var Ce = function(e, t, n, o) {
|
|
351
|
+
var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
|
|
352
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
353
|
+
s = Reflect.decorate(e, t, n, o);
|
|
354
|
+
else
|
|
355
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
356
|
+
(a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
|
|
357
|
+
return r > 3 && s && Object.defineProperty(t, n, s), s;
|
|
358
|
+
}, P = function(e, t) {
|
|
359
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
360
|
+
return Reflect.metadata(e, t);
|
|
361
|
+
};
|
|
362
|
+
const B = class {
|
|
363
|
+
constructor(e) {
|
|
364
|
+
var t, n, o, r;
|
|
365
|
+
b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.eventDescription = (n = (t = this.selectedConfiguration) == null ? void 0 : t.event_booking) == null ? void 0 : n.description, this.name = "description", this.selectedLanguage = void 0, this.hideAutoPopulateButton = !1, this.noTemplates = !1, this.themeConfig = void 0, this.description = this.eventDescription || ((r = (o = this.selectedConfiguration) == null ? void 0 : o.event_booking) == null ? void 0 : r.description) || "", this.showTokens = !1, this.availableTokens = k.map((s) => ({
|
|
366
|
+
label: s.token,
|
|
367
|
+
value: s.value,
|
|
368
|
+
labelHTML: s
|
|
369
|
+
})), this.filteredTokens = this.availableTokens, this.ariaActivedescendant = "", this.currentWord = { $value: "", fullText: "", index: -1, focusOffset: -1 }, this.validationError = "", this.additionalFieldTokens = [];
|
|
370
|
+
}
|
|
371
|
+
elementNameChangedHandler(e) {
|
|
372
|
+
d("nylas-event-description", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
373
|
+
}
|
|
374
|
+
selectedConfigurationChangedHandler(e) {
|
|
375
|
+
var s, a;
|
|
376
|
+
d("nylas-custom-booking-flow", "selectedConfigurationChangedHandler", e);
|
|
377
|
+
const t = ((s = e == null ? void 0 : e.event_booking) == null ? void 0 : s.description) || this.eventDescription || "", n = ((a = e == null ? void 0 : e.scheduler) == null ? void 0 : a.additional_fields) || {}, r = (Object.keys(n) || []).map((i) => ({
|
|
378
|
+
token: `$${i}`,
|
|
379
|
+
value: `\${${i}}`,
|
|
380
|
+
description: n[i].label || ""
|
|
381
|
+
}));
|
|
382
|
+
this.additionalFieldTokens = [...r], this.availableTokens = [...k, ...r].map((i) => ({
|
|
383
|
+
label: i.token,
|
|
384
|
+
value: i.value,
|
|
385
|
+
labelHTML: i
|
|
386
|
+
})), this.filteredTokens = [...this.availableTokens], this.description = t, t && this.updateEventDescriptionFromProp(t);
|
|
387
|
+
}
|
|
388
|
+
selectedLanguageChangedHandler(e, t) {
|
|
389
|
+
if (e === t)
|
|
390
|
+
return;
|
|
391
|
+
c.changeLanguage(e);
|
|
392
|
+
const n = {
|
|
393
|
+
$invitee: "invitee",
|
|
394
|
+
$invitee_email: "inviteeEmail",
|
|
395
|
+
$duration: "duration"
|
|
396
|
+
};
|
|
397
|
+
this.availableTokens = this.availableTokens.map((o) => (n[o.label] && (o.labelHTML.description = c.t(`nylasEventTitle.eventTitleTokenDescription.${n[o.label]}`)), o)), this.filteredTokens = [...this.availableTokens];
|
|
398
|
+
}
|
|
399
|
+
themeConfigChangedHandler(e, t) {
|
|
400
|
+
e !== t && this.applyThemeConfig(e);
|
|
401
|
+
}
|
|
402
|
+
applyThemeConfig(e) {
|
|
403
|
+
if (e)
|
|
404
|
+
for (const [t, n] of Object.entries(e))
|
|
405
|
+
this.host.style.setProperty(`${t}`, n);
|
|
406
|
+
}
|
|
407
|
+
connectedCallback() {
|
|
408
|
+
d("nylas-event-description", "connectedCallback");
|
|
409
|
+
}
|
|
410
|
+
componentWillLoad() {
|
|
411
|
+
d("nylas-event-description", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
412
|
+
}
|
|
413
|
+
componentDidLoad() {
|
|
414
|
+
d("nylas-event-description", "componentDidLoad"), this.selectedConfiguration ? this.selectedConfigurationChangedHandler(this.selectedConfiguration) : (this.description = this.eventDescription || "", this.updateEventDescriptionFromProp(this.description));
|
|
415
|
+
}
|
|
416
|
+
disconnectedCallback() {
|
|
417
|
+
d("nylas-event-description", "disconnectedCallback");
|
|
418
|
+
}
|
|
419
|
+
valueChangedHandler(e) {
|
|
420
|
+
const { name: t, value: n } = e.detail;
|
|
421
|
+
if (t === "additional-fields") {
|
|
422
|
+
const o = JSON.parse(n.toString()), s = (Object.keys(o) || []).map((a) => ({
|
|
423
|
+
token: `$${a}`,
|
|
424
|
+
value: `\${${a}}`,
|
|
425
|
+
description: o[a].label || ""
|
|
426
|
+
}));
|
|
427
|
+
this.additionalFieldTokens = [...s], this.availableTokens = [...k, ...s].map((a) => ({
|
|
428
|
+
label: a.token,
|
|
429
|
+
value: a.value,
|
|
430
|
+
labelHTML: a
|
|
431
|
+
})), this.filteredTokens = [...this.availableTokens];
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
updateEventDescriptionFromProp(e) {
|
|
435
|
+
d("nylas-event-description", "updateEventDescriptionFromProp", e);
|
|
436
|
+
const t = e || this.description;
|
|
437
|
+
this.descriptionRef && (this.descriptionRef.innerHTML = this.highlightTokens(t));
|
|
438
|
+
}
|
|
439
|
+
highlightTokens(e) {
|
|
440
|
+
let t = e;
|
|
441
|
+
return [...k, ...this.additionalFieldTokens].forEach((n) => {
|
|
442
|
+
const o = n.value, r = new RegExp(`(\\${o})(?!\\w)`, "g");
|
|
443
|
+
t = (t == null ? void 0 : t.replace(r, '<span class="highlighted-tag">$1</span>')) || "";
|
|
444
|
+
}), t;
|
|
445
|
+
}
|
|
446
|
+
getCurrentSelectionForBrowser() {
|
|
447
|
+
var o, r, s;
|
|
448
|
+
const e = (a, i, f, p) => {
|
|
449
|
+
const h = a.replace(/[\u200B-\u200D\uFEFF]/g, ""), y = h.lastIndexOf("$"), u = h.substring(y).split(" ")[0];
|
|
450
|
+
return {
|
|
451
|
+
focusOffset: i,
|
|
452
|
+
dollarIndex: y,
|
|
453
|
+
lastWord: u,
|
|
454
|
+
currentText: h,
|
|
455
|
+
node: f,
|
|
456
|
+
allSelected: p
|
|
457
|
+
};
|
|
458
|
+
}, t = (a) => {
|
|
459
|
+
var i, f;
|
|
460
|
+
return a.anchorOffset === 0 && a.focusOffset === ((f = (i = a.focusNode) == null ? void 0 : i.nodeValue) == null ? void 0 : f.length);
|
|
461
|
+
};
|
|
462
|
+
switch (M()) {
|
|
463
|
+
case "Chrome": {
|
|
464
|
+
const a = (o = this.host.shadowRoot) == null ? void 0 : o.getSelection(), i = a == null ? void 0 : a.focusNode, f = (i == null ? void 0 : i.nodeValue) || "", p = a && t(a);
|
|
465
|
+
return e(f, (a == null ? void 0 : a.focusOffset) || -1, i, p);
|
|
466
|
+
}
|
|
467
|
+
case "Firefox": {
|
|
468
|
+
const a = document.getSelection(), i = ((r = a == null ? void 0 : a.anchorNode) == null ? void 0 : r.nodeValue) || "", f = a && t(a);
|
|
469
|
+
return e(i, (a == null ? void 0 : a.focusOffset) || -1, a == null ? void 0 : a.anchorNode, f);
|
|
470
|
+
}
|
|
471
|
+
case "Safari": {
|
|
472
|
+
const a = window.getSelection(), i = a == null ? void 0 : a.getComposedRanges(this.host.shadowRoot)[0], f = ((s = i == null ? void 0 : i.startContainer) == null ? void 0 : s.nodeValue) || "", p = a && t(a);
|
|
473
|
+
return e(f, (i == null ? void 0 : i.endOffset) || -1, i == null ? void 0 : i.startContainer, p);
|
|
474
|
+
}
|
|
475
|
+
default:
|
|
476
|
+
return console.warn("Browser not supported"), null;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
handleChange(e) {
|
|
480
|
+
let t = e.target.textContent || "";
|
|
481
|
+
t = R(t);
|
|
482
|
+
const n = this.getCurrentSelectionForBrowser();
|
|
483
|
+
if (!n) {
|
|
484
|
+
this.updateEventDescription(t), this.resetDropdown();
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
const { focusOffset: o, dollarIndex: r, lastWord: s, currentText: a } = n;
|
|
488
|
+
if (r === -1 || o < r) {
|
|
489
|
+
this.updateEventDescription(t), this.resetDropdown();
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
s.startsWith("$") ? (this.showTokens = !0, this.currentWord = {
|
|
493
|
+
$value: s,
|
|
494
|
+
fullText: a,
|
|
495
|
+
index: r,
|
|
496
|
+
focusOffset: o
|
|
497
|
+
}, this.populateSuggestionsDropdown(s)) : this.resetDropdown(), this.updateEventDescription(t);
|
|
498
|
+
}
|
|
499
|
+
handleInputKeyDown(e) {
|
|
500
|
+
var n, o, r, s;
|
|
501
|
+
const t = this.getCurrentSelectionForBrowser();
|
|
502
|
+
if (t != null && t.allSelected && !S(e) && (this.descriptionRef.innerHTML = ""), e.key === "Enter") {
|
|
503
|
+
e.preventDefault();
|
|
504
|
+
const a = (n = this.host.shadowRoot) == null ? void 0 : n.getElementById(this.ariaActivedescendant);
|
|
505
|
+
if (a)
|
|
506
|
+
a.click(), this.ariaActivedescendant = "";
|
|
507
|
+
else {
|
|
508
|
+
const i = t == null ? void 0 : t.node, f = (t == null ? void 0 : t.focusOffset) || 0;
|
|
509
|
+
if (!i || f === -1 || this.descriptionRef.childNodes.length === 0) {
|
|
510
|
+
const p = document.createTextNode(`
|
|
511
|
+
`);
|
|
512
|
+
this.descriptionRef.insertBefore(p, this.descriptionRef.firstChild);
|
|
513
|
+
const h = document.createRange();
|
|
514
|
+
h.setStart(p, 1), h.collapse(!0);
|
|
515
|
+
const y = window.getSelection();
|
|
516
|
+
y == null || y.removeAllRanges(), y == null || y.addRange(h);
|
|
517
|
+
} else if (i.nodeType === Node.TEXT_NODE) {
|
|
518
|
+
const p = i.nodeValue || "", h = p.slice(0, f) + `
|
|
519
|
+
` + p.slice(f);
|
|
520
|
+
i.nodeValue = h;
|
|
521
|
+
const y = document.createRange();
|
|
522
|
+
y.setStart(i, f + 1), y.collapse(!0);
|
|
523
|
+
const u = window.getSelection();
|
|
524
|
+
u == null || u.removeAllRanges(), u == null || u.addRange(y);
|
|
525
|
+
}
|
|
526
|
+
this.descriptionRef.focus();
|
|
527
|
+
}
|
|
528
|
+
} else if (e.key === "ArrowDown") {
|
|
529
|
+
this.showTokens && e.preventDefault();
|
|
530
|
+
const a = (o = this.host.shadowRoot) == null ? void 0 : o.getElementById(this.ariaActivedescendant);
|
|
531
|
+
if (a) {
|
|
532
|
+
const i = a.nextElementSibling;
|
|
533
|
+
i ? this.ariaActivedescendant = i.id : this.ariaActivedescendant = this.filteredTokens[0].label;
|
|
534
|
+
} else
|
|
535
|
+
this.ariaActivedescendant = this.filteredTokens[0].label;
|
|
536
|
+
} else if (e.key === "ArrowUp") {
|
|
537
|
+
this.showTokens && e.preventDefault();
|
|
538
|
+
const a = (r = this.host.shadowRoot) == null ? void 0 : r.getElementById(this.ariaActivedescendant);
|
|
539
|
+
if (a) {
|
|
540
|
+
const i = a.previousElementSibling;
|
|
541
|
+
i ? this.ariaActivedescendant = i.id : this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
|
|
542
|
+
} else
|
|
543
|
+
this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
|
|
544
|
+
} else if (e.key === "Escape")
|
|
545
|
+
e.preventDefault(), this.resetDropdown();
|
|
546
|
+
else if (e.key === "Backspace" || e.key === "Delete") {
|
|
547
|
+
const a = (s = t == null ? void 0 : t.node) == null ? void 0 : s.parentNode;
|
|
548
|
+
t != null && t.currentText.startsWith("${") && a && a.nodeName === "SPAN" && (e.preventDefault(), a.removeChild(t.node), a.remove(), this.resetDropdown()), (this.descriptionRef.textContent === "" || t != null && t.allSelected) && (this.descriptionRef.innerHTML = "", this.updateEventDescription(""));
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
selectOption(e, t) {
|
|
552
|
+
var T;
|
|
553
|
+
e.preventDefault();
|
|
554
|
+
const n = this.currentWord.fullText, o = this.currentWord.$value;
|
|
555
|
+
let r = this.descriptionRef.firstChild, s = null;
|
|
556
|
+
for (; r; ) {
|
|
557
|
+
if (r.nodeType === 3) {
|
|
558
|
+
const v = ((T = r.textContent) == null ? void 0 : T.replace(/[\u200B-\u200D\uFEFF]/g, "")) || "", L = n.replace(/[\u200B-\u200D\uFEFF]/g, "");
|
|
559
|
+
if (v.includes(L)) {
|
|
560
|
+
s = r;
|
|
561
|
+
break;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
r = r.nextSibling;
|
|
565
|
+
}
|
|
566
|
+
if (!s)
|
|
567
|
+
return;
|
|
568
|
+
const a = s.textContent || "", i = a.indexOf(o), f = a.substring(0, i), p = a.substring(i + o.length), h = document.createTextNode(f), y = document.createRange(), u = document.createElement("span");
|
|
569
|
+
u.classList.add("highlighted-tag"), u.textContent = `${t.value}`;
|
|
570
|
+
const _ = document.createTextNode(p);
|
|
571
|
+
if (p !== "")
|
|
572
|
+
s.replaceWith(h, u, _), y.setStart(_, 1);
|
|
573
|
+
else {
|
|
574
|
+
const v = document.createTextNode("");
|
|
575
|
+
s.replaceWith(h, u, v), y.setStart(v, 1);
|
|
576
|
+
}
|
|
577
|
+
this.resetDropdown(), this.descriptionRef.focus();
|
|
578
|
+
const g = window.getSelection();
|
|
579
|
+
y.collapse(!0), g == null || g.removeAllRanges(), g == null || g.addRange(y), this.updateEventDescription(this.descriptionRef.textContent || "");
|
|
580
|
+
}
|
|
581
|
+
populateSuggestionsDropdown(e = "") {
|
|
582
|
+
this.filteredTokens = this.availableTokens.filter((t) => t.label.startsWith(e.toString()) || t.value.startsWith(e.toString())), this.filteredTokens.length > 0 && (this.ariaActivedescendant = this.filteredTokens[0].label);
|
|
583
|
+
}
|
|
584
|
+
get isInternalsAvailable() {
|
|
585
|
+
return typeof this.internals < "u" && typeof this.internals.setValidity == "function" && typeof this.internals.setFormValue == "function";
|
|
586
|
+
}
|
|
587
|
+
updateEventDescription(e) {
|
|
588
|
+
var n;
|
|
589
|
+
const t = e.replace(/ +/g, " ");
|
|
590
|
+
this.isInternalsAvailable && ((n = this.internals) == null || n.setFormValue(t, this.name)), this.valueChanged.emit({ value: t, name: this.name });
|
|
591
|
+
}
|
|
592
|
+
resetDropdown() {
|
|
593
|
+
this.showTokens = !1, this.ariaActivedescendant = "";
|
|
594
|
+
}
|
|
595
|
+
getLabelHTML(e) {
|
|
596
|
+
return l("div", { class: "token-label" }, l("span", { class: "token" }, e.token), l("span", { class: "description" }, e.description));
|
|
597
|
+
}
|
|
598
|
+
handleAddAdditionalFields() {
|
|
599
|
+
if (this.additionalFieldTokens.length === 0)
|
|
600
|
+
return;
|
|
601
|
+
const e = this.descriptionRef.innerHTML, t = "--- Additional Fields ---", n = "--- End Additional Fields ---", o = e.indexOf(t), r = e.indexOf(n);
|
|
602
|
+
let s = t + `
|
|
603
|
+
`;
|
|
604
|
+
this.additionalFieldTokens.forEach((i) => {
|
|
605
|
+
s += `${i.description}: ${i.value}
|
|
606
|
+
`;
|
|
607
|
+
}), s += n;
|
|
608
|
+
let a;
|
|
609
|
+
o !== -1 && r !== -1 ? a = e.substring(0, o) + s + e.substring(r + n.length) : a = e + s, this.updateEventDescriptionFromProp(a), this.updateEventDescription(a);
|
|
610
|
+
}
|
|
611
|
+
render() {
|
|
612
|
+
var e;
|
|
613
|
+
return l(C, { key: "9ccddd8582abc61f2dddd757a4c0b421ca75718b" }, l("div", { key: "06234e9529c43410161c40ac752fa6f0413daa6b", class: "nylas-event-description", part: "nedesc" }, l("label", { key: "c908c2dbd967208f92e72fab292b32527d645d0f", htmlFor: "description" }, c.t("nylasEventDescription.headerTitle"), l("span", { key: "90f417361636dc3d35d36be47e96b9cb2075294c", class: "label-icon" }, l("tooltip-component", { key: "d1bd3235457855d341c07be94a1d865995b21dac" }, l("info-icon", { key: "0ddd3a4af6dad47dec07fb5d6e490de8b174c4c3", slot: "tooltip-icon" }), l("span", { key: "b80a0cf4324dd728e32afc689327b5fb29a59fe8", slot: "tooltip-content" }, c.t("nylasEventDescription.tooltip.desc"))))), l("div", { key: "cf413dda764a5c41faafb1d95aecd1725e40eea3", id: "event-description", class: { "event-description": !0 }, part: "nedesc__textarea", contentEditable: "true", onInput: (t) => this.handleChange(t), onKeyDown: (t) => this.handleInputKeyDown(t), ref: (t) => this.descriptionRef = t }), !this.noTemplates && this.showTokens && ((e = this.filteredTokens) == null ? void 0 : e.length) > 0 && l("div", { class: "token-options", part: "nedesc__dropdown-content" }, l("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map((t) => l("li", { tabindex: "0", key: t.label, id: t.label, class: { active: this.ariaActivedescendant === t.label }, onClick: (n) => this.selectOption(n, t), role: "option" }, this.getLabelHTML(t.labelHTML))))), !this.noTemplates && l("span", { class: "help-text" }, c.t("nylasEventTitle.helpText", { context: "start", field: c.t("nylasEventTitle.description") }), " ", l("code", null, "$"), " ", c.t("nylasEventTitle.helpText", { context: "end" }), l("span", { class: "label-icon" }, l("tooltip-component", null, l("info-icon", { slot: "tooltip-icon", width: "13", height: "13" }), l("span", { slot: "tooltip-content" }, c.t("nylasEventTitle.tooltip.desc"), " ", l("code", null, "${invitee}"))))), !this.noTemplates && !this.hideAutoPopulateButton && l("span", { class: "add-additional-fields" }, l("button-component", { variant: "basic", onClick: () => this.handleAddAdditionalFields() }, c.t("nylasEventDescription.addAdditionalFields.buttonText")), l("span", { class: "label-icon" }, l("tooltip-component", null, l("info-icon", { slot: "tooltip-icon" }), l("span", { slot: "tooltip-content" }, c.t("nylasEventDescription.addAdditionalFields.tooltip.desc"), " ", l("code", null, "${invitee}")))))));
|
|
614
|
+
}
|
|
615
|
+
static get formAssociated() {
|
|
616
|
+
return !0;
|
|
617
|
+
}
|
|
618
|
+
get host() {
|
|
619
|
+
return x(this);
|
|
620
|
+
}
|
|
621
|
+
static get watchers() {
|
|
622
|
+
return {
|
|
623
|
+
name: ["elementNameChangedHandler"],
|
|
624
|
+
selectedConfiguration: ["selectedConfigurationChangedHandler"],
|
|
625
|
+
selectedLanguage: ["selectedLanguageChangedHandler"],
|
|
626
|
+
themeConfig: ["themeConfigChangedHandler"]
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
};
|
|
630
|
+
Ce([
|
|
631
|
+
w({
|
|
632
|
+
name: "nylas-event-description",
|
|
633
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
634
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
635
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"],
|
|
636
|
+
["schedulerConfig.themeConfig", "themeConfig"]
|
|
637
|
+
]),
|
|
638
|
+
eventToProps: {},
|
|
639
|
+
fireRegisterEvent: !0
|
|
640
|
+
}),
|
|
641
|
+
P("design:type", Function),
|
|
642
|
+
P("design:paramtypes", []),
|
|
643
|
+
P("design:returntype", void 0)
|
|
644
|
+
], B.prototype, "render", null);
|
|
645
|
+
B.style = ke;
|
|
646
|
+
const we = ':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-event-info__title{color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-event-info__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-event-info__content{padding:1rem;display:flex;flex-direction:column;gap:1rem;background-color:var(--nylas-base-25)}.nylas-event-info__block{display:flex;justify-content:space-between;gap:0.5rem}', _e = we;
|
|
647
|
+
var Te = function(e, t, n, o) {
|
|
648
|
+
var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
|
|
649
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
650
|
+
s = Reflect.decorate(e, t, n, o);
|
|
651
|
+
else
|
|
652
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
653
|
+
(a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
|
|
654
|
+
return r > 3 && s && Object.defineProperty(t, n, s), s;
|
|
655
|
+
}, A = function(e, t) {
|
|
656
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
657
|
+
return Reflect.metadata(e, t);
|
|
658
|
+
};
|
|
659
|
+
const j = class {
|
|
660
|
+
constructor(e) {
|
|
661
|
+
b(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedLanguage = void 0, this.themeConfig = void 0;
|
|
662
|
+
}
|
|
663
|
+
selectedLanguageChangedHandler(e, t) {
|
|
664
|
+
e !== t && c.changeLanguage(e);
|
|
665
|
+
}
|
|
666
|
+
themeConfigChangedHandler(e, t) {
|
|
667
|
+
e !== t && this.applyThemeConfig(e);
|
|
668
|
+
}
|
|
669
|
+
applyThemeConfig(e) {
|
|
670
|
+
if (e)
|
|
671
|
+
for (const [t, n] of Object.entries(e))
|
|
672
|
+
this.el.style.setProperty(`${t}`, n);
|
|
673
|
+
}
|
|
674
|
+
connectedCallback() {
|
|
675
|
+
d("nylas-event-info", "connectedCallback");
|
|
676
|
+
}
|
|
677
|
+
componentWillLoad() {
|
|
678
|
+
d("nylas-event-info", "componentWillLoad");
|
|
679
|
+
}
|
|
680
|
+
componentDidLoad() {
|
|
681
|
+
d("nylas-event-info", "componentDidLoad"), V(["inputs"], this.el);
|
|
682
|
+
}
|
|
683
|
+
disconnectedCallback() {
|
|
684
|
+
d("nylas-event-info", "disconnectedCallback");
|
|
685
|
+
}
|
|
686
|
+
render() {
|
|
687
|
+
return l(C, { key: "a62edaabd2210706d4ef9f671973a40fcbcb8d52" }, l("nylas-form-card", { key: "6bfbb55c126393559f7f00587fd7b009c0c42422", exportparts: "nfc__header: nei__header" }, l("h1", { key: "b05d0fa0528248fee82584e1ac594c68d17b1b8f", slot: "header-title", class: "nylas-event-info__title", part: "nei__title" }, c.t("nylasEventInfo.headerTitle")), l("div", { key: "5a589ed5c86d6fb4327110618af4fe320840a062", slot: "content", class: "nylas-event-info__content" }, l("slot", { key: "74c8f5de152d7efce914f8968342b84b3b4d5d35", name: "inputs" }))));
|
|
688
|
+
}
|
|
689
|
+
static get formAssociated() {
|
|
690
|
+
return !0;
|
|
691
|
+
}
|
|
692
|
+
get el() {
|
|
693
|
+
return x(this);
|
|
694
|
+
}
|
|
695
|
+
static get watchers() {
|
|
696
|
+
return {
|
|
697
|
+
selectedLanguage: ["selectedLanguageChangedHandler"],
|
|
698
|
+
themeConfig: ["themeConfigChangedHandler"]
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
Te([
|
|
703
|
+
w({
|
|
704
|
+
name: "nylas-event-info",
|
|
705
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
706
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"],
|
|
707
|
+
["schedulerConfig.themeConfig", "themeConfig"]
|
|
708
|
+
]),
|
|
709
|
+
eventToProps: {},
|
|
710
|
+
fireRegisterEvent: !0
|
|
711
|
+
}),
|
|
712
|
+
A("design:type", Function),
|
|
713
|
+
A("design:paramtypes", []),
|
|
714
|
+
A("design:returntype", void 0)
|
|
715
|
+
], j.prototype, "render", null);
|
|
716
|
+
j.style = _e;
|
|
717
|
+
const Ee = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-event-location{display:flex;flex-direction:column;gap:4px;font-family:var(--nylas-font-family)}.nylas-event-location label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-location label span.label-icon{margin-left:4px}.nylas-event-location label span.label-icon tooltip-component{display:flex}.nylas-event-location span[slot=select-icon]{border-right:1px solid var(--nylas-base-200);padding:16px 0.75rem 16px 0.5rem;border-radius:var(--nylas-border-radius-2x);border-bottom-right-radius:0;border-top-right-radius:0;height:20px}.nylas-event-location div.location-input{display:grid;grid-template-columns:auto 1fr;width:100%;gap:0.5rem}@media screen and (max-width: 768px){.nylas-event-location div.location-input{grid-template-columns:1fr}}.nylas-event-location div.location-input input{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:12px 16px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px;background-color:var(--nylas-base-0);color:var(--nylas-base-900)}.nylas-event-location select-dropdown{width:208px}@media screen and (max-width: 768px){.nylas-event-location select-dropdown{width:100%}}.nylas-event-location select-dropdown::part(sd_dropdown){width:100%}.nylas-event-location select-dropdown::part(sd_dropdown-content){left:calc(35px + 0.5rem)}.nylas-event-location select-dropdown::part(sd_dropdown-button){display:flex;justify-content:space-between;width:100%;border:1px solid var(--nylas-base-200);padding:0 0.5rem}.nylas-event-location select-dropdown::part(sd_dropdown-button-selected-label){display:inline-flex;align-self:center;padding:14px 0;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', Le = Ee;
|
|
718
|
+
var Oe = function(e, t, n, o) {
|
|
719
|
+
var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
|
|
720
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
721
|
+
s = Reflect.decorate(e, t, n, o);
|
|
722
|
+
else
|
|
723
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
724
|
+
(a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
|
|
725
|
+
return r > 3 && s && Object.defineProperty(t, n, s), s;
|
|
726
|
+
}, $ = function(e, t) {
|
|
727
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
728
|
+
return Reflect.metadata(e, t);
|
|
729
|
+
};
|
|
730
|
+
const U = class {
|
|
731
|
+
constructor(e) {
|
|
732
|
+
var t;
|
|
733
|
+
b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "location", this.currentUser = void 0, this.userProvider = void 0, this.eventConferencing = void 0, this.conferenceProviders = void 0, this.selectedConfiguration = void 0, this.eventLocation = void 0, this.selectedLanguage = void 0, this.themeConfig = void 0, this.location = this.eventLocation ?? "", this.grantId = this.eventConferencing ? this.setDefaultGrantID(this.eventConferencing) : "", this.selectedLocationOption = void 0, this.userProviderState = this.userProvider ?? ((t = this.currentUser) == null ? void 0 : t.provider) ?? "", this.locationOptions = [
|
|
734
|
+
{ value: "none", label: c.t("nylasEventLocation.conferenceOptions.none"), labelHTML: this.getLabelHTML("none") },
|
|
735
|
+
{ value: "custom", label: c.t("nylasEventLocation.conferenceOptions.custom"), labelHTML: this.getLabelHTML("custom") }
|
|
736
|
+
];
|
|
737
|
+
}
|
|
738
|
+
elementNameChangedHandler(e) {
|
|
739
|
+
d("nylas-event-location", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
740
|
+
}
|
|
741
|
+
selectedConfigurationChangedHandler(e) {
|
|
742
|
+
var o, r;
|
|
743
|
+
d("nylas-custom-booking-flow", "selectedConfigurationChangedHandler", e);
|
|
744
|
+
const t = ((o = e == null ? void 0 : e.event_booking) == null ? void 0 : o.location) || this.eventLocation, n = ((r = e == null ? void 0 : e.event_booking) == null ? void 0 : r.conferencing) || this.eventConferencing;
|
|
745
|
+
n != null && n.provider ? (this.selectedLocationOption = this.setDefaultLocationOption(n, t ?? ""), this.grantId = this.setDefaultGrantID(n), this.location = t || "") : t ? (this.selectedLocationOption = t ? "custom" : "none", this.location = t) : (this.selectedLocationOption = "none", this.location = "");
|
|
746
|
+
}
|
|
747
|
+
currentUserChangedHandler(e) {
|
|
748
|
+
d("nylas-custom-booking-flow", "currentUserChangedHandler", e), e != null && e.provider && (this.userProviderState = e == null ? void 0 : e.provider, this.setLocationOptionsForProvider(this.userProviderState));
|
|
749
|
+
}
|
|
750
|
+
conferenceProvidersChanged(e) {
|
|
751
|
+
e != null && e.zoom && !this.locationOptions.some((t) => t.value === "zoom") && this.locationOptions.push({ value: "zoom", label: c.t("nylasEventLocation.conferenceOptions.zoom"), labelHTML: this.getLabelHTML("zoom") });
|
|
752
|
+
}
|
|
753
|
+
selectedLanguageChangedHandler(e, t) {
|
|
754
|
+
if (e === t)
|
|
755
|
+
return;
|
|
756
|
+
c.changeLanguage(e), this.locationOptions.map((o) => o.value).forEach((o) => {
|
|
757
|
+
const r = this.locationOptions.findIndex((s) => s.value === o);
|
|
758
|
+
this.locationOptions[r].label = c.t(`nylasEventLocation.conferenceOptions.${o}`), this.locationOptions[r].labelHTML = this.getLabelHTML(o);
|
|
759
|
+
}), this.locationOptions = [...this.locationOptions];
|
|
760
|
+
}
|
|
761
|
+
themeConfigChangedHandler(e, t) {
|
|
762
|
+
e !== t && this.applyThemeConfig(e);
|
|
763
|
+
}
|
|
764
|
+
applyThemeConfig(e) {
|
|
765
|
+
if (e)
|
|
766
|
+
for (const [t, n] of Object.entries(e))
|
|
767
|
+
this.host.style.setProperty(`${t}`, n);
|
|
768
|
+
}
|
|
769
|
+
connectedCallback() {
|
|
770
|
+
d("nylas-event-location", "connectedCallback");
|
|
771
|
+
}
|
|
772
|
+
componentWillLoad() {
|
|
773
|
+
d("nylas-event-location", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
774
|
+
}
|
|
775
|
+
componentDidLoad() {
|
|
776
|
+
var t, n, o, r;
|
|
777
|
+
d("nylas-event-location", "componentDidLoad"), (t = this.selectedConfiguration) != null && t.event_booking ? this.selectedConfigurationChangedHandler(this.selectedConfiguration) : (this.selectedLocationOption = this.setDefaultLocationOption(this.eventConferencing || null, this.eventLocation ?? ""), this.location = this.eventLocation ?? ""), this.userProviderState = this.userProvider ?? ((n = this.currentUser) == null ? void 0 : n.provider) ?? "", this.setLocationOptionsForProvider(this.userProviderState);
|
|
778
|
+
const e = (o = this.internals) == null ? void 0 : o.form;
|
|
779
|
+
if (e) {
|
|
780
|
+
const s = new FormData(e);
|
|
781
|
+
s.set("conference", this.getConferencePayload()), s.set(this.name, this.location);
|
|
782
|
+
}
|
|
783
|
+
(r = this.conferenceProviders) != null && r.zoom && !this.locationOptions.some((s) => s.value === "zoom") && this.locationOptions.push({ value: "zoom", label: c.t("nylasEventLocation.conferenceOptions.zoom"), labelHTML: this.getLabelHTML("zoom") });
|
|
784
|
+
}
|
|
785
|
+
disconnectedCallback() {
|
|
786
|
+
d("nylas-event-location", "disconnectedCallback");
|
|
787
|
+
}
|
|
788
|
+
getConferencePayload() {
|
|
789
|
+
var n;
|
|
790
|
+
if (this.selectedLocationOption === "custom" || this.selectedLocationOption === "none")
|
|
791
|
+
return JSON.stringify(null);
|
|
792
|
+
const e = (n = this.conferenceProviders) == null ? void 0 : n[this.selectedLocationOption], t = {
|
|
793
|
+
provider: E[this.selectedLocationOption],
|
|
794
|
+
autocreate: e ? {
|
|
795
|
+
conf_grant_id: e
|
|
796
|
+
} : {}
|
|
797
|
+
};
|
|
798
|
+
return JSON.stringify(t);
|
|
799
|
+
}
|
|
800
|
+
nylasFormDropdownChangedHandler(e) {
|
|
801
|
+
var n, o, r;
|
|
802
|
+
this.selectedLocationOption = e.detail.value;
|
|
803
|
+
let t;
|
|
804
|
+
switch (this.selectedLocationOption) {
|
|
805
|
+
case "none": {
|
|
806
|
+
this.location = "", this.setFormValue("", this.name), this.valueChanged.emit({ value: "", name: this.name }), this.valueChanged.emit({ value: JSON.stringify(null), name: "conference" });
|
|
807
|
+
break;
|
|
808
|
+
}
|
|
809
|
+
case "custom": {
|
|
810
|
+
this.valueChanged.emit({ value: JSON.stringify(null), name: "conference" });
|
|
811
|
+
break;
|
|
812
|
+
}
|
|
813
|
+
case "google": {
|
|
814
|
+
this.location = "", this.setFormValue("", this.name);
|
|
815
|
+
const s = (n = this.conferenceProviders) == null ? void 0 : n.google;
|
|
816
|
+
t = {
|
|
817
|
+
provider: E.google,
|
|
818
|
+
autocreate: s ? {
|
|
819
|
+
conf_grant_id: s
|
|
820
|
+
} : {}
|
|
821
|
+
}, this.valueChanged.emit({ value: JSON.stringify(t), name: "conference" }), this.valueChanged.emit({ value: "", name: this.name });
|
|
822
|
+
break;
|
|
823
|
+
}
|
|
824
|
+
case "microsoft": {
|
|
825
|
+
this.location = "", this.setFormValue("", this.name);
|
|
826
|
+
const s = (o = this.conferenceProviders) == null ? void 0 : o.microsoft;
|
|
827
|
+
t = {
|
|
828
|
+
provider: E.microsoft,
|
|
829
|
+
autocreate: s ? {
|
|
830
|
+
conf_grant_id: s
|
|
831
|
+
} : {}
|
|
832
|
+
}, this.valueChanged.emit({ value: JSON.stringify(t), name: "conference" }), this.valueChanged.emit({ value: "", name: this.name });
|
|
833
|
+
break;
|
|
834
|
+
}
|
|
835
|
+
case "zoom": {
|
|
836
|
+
this.location = "", this.setFormValue("", this.name);
|
|
837
|
+
const s = (r = this.conferenceProviders) == null ? void 0 : r.zoom;
|
|
838
|
+
t = {
|
|
839
|
+
provider: E.zoom,
|
|
840
|
+
autocreate: s ? {
|
|
841
|
+
conf_grant_id: s
|
|
842
|
+
} : {}
|
|
843
|
+
}, this.valueChanged.emit({ value: JSON.stringify(t), name: "conference" }), this.valueChanged.emit({ value: "", name: this.name });
|
|
844
|
+
break;
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
setLocationOptionsForProvider(e) {
|
|
849
|
+
switch (e) {
|
|
850
|
+
case "google":
|
|
851
|
+
this.locationOptions.some((t) => t.value === "google") || this.locationOptions.push({ value: "google", label: c.t("nylasEventLocation.conferenceOptions.google"), labelHTML: this.getLabelHTML("google") });
|
|
852
|
+
break;
|
|
853
|
+
case "microsoft":
|
|
854
|
+
this.locationOptions.some((t) => t.value === "microsoft") || this.locationOptions.push({ value: "microsoft", label: c.t("nylasEventLocation.conferenceOptions.google"), labelHTML: this.getLabelHTML("microsoft") });
|
|
855
|
+
break;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
setDefaultLocationOption(e, t) {
|
|
859
|
+
return e != null && (e == null ? void 0 : e.provider) != null ? J[e == null ? void 0 : e.provider] : t ? "custom" : "none";
|
|
860
|
+
}
|
|
861
|
+
setDefaultGrantID(e) {
|
|
862
|
+
var t;
|
|
863
|
+
return e != null && (e == null ? void 0 : e.autocreate) != null ? (t = e == null ? void 0 : e.autocreate) == null ? void 0 : t.conf_grant_id : "";
|
|
864
|
+
}
|
|
865
|
+
setFormValue(e, t) {
|
|
866
|
+
typeof this.internals.setFormValue == "function" && this.internals.setFormValue(e, t);
|
|
867
|
+
}
|
|
868
|
+
handleChange(e) {
|
|
869
|
+
const t = R(e.target.value);
|
|
870
|
+
this.location = t, this.setFormValue(t, this.name), this.valueChanged.emit({ value: t, name: this.name });
|
|
871
|
+
}
|
|
872
|
+
getIcon(e) {
|
|
873
|
+
switch (e) {
|
|
874
|
+
case "none":
|
|
875
|
+
return l("location-off-icon", null);
|
|
876
|
+
case "custom":
|
|
877
|
+
return l("location-icon", null);
|
|
878
|
+
case "google":
|
|
879
|
+
return l("google-meet-icon", null);
|
|
880
|
+
case "microsoft":
|
|
881
|
+
return l("microsoft-teams-icon", null);
|
|
882
|
+
case "zoom":
|
|
883
|
+
return l("zoom-icon", null);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
getLabelHTML(e) {
|
|
887
|
+
return l("span", { class: "location-label", style: {
|
|
888
|
+
display: "flex",
|
|
889
|
+
alignItems: "center",
|
|
890
|
+
gap: "16px",
|
|
891
|
+
width: "-webkit-fill-available"
|
|
892
|
+
} }, this.getIcon(e), l("span", { class: "location-text", style: {
|
|
893
|
+
fontSize: "14px",
|
|
894
|
+
fontWeight: "400"
|
|
895
|
+
} }, c.t(`nylasEventLocation.conferenceOptions.${e}`)));
|
|
896
|
+
}
|
|
897
|
+
render() {
|
|
898
|
+
const e = typeof this.selectedLocationOption < "u" ? this.locationOptions.find((t) => t.value == this.selectedLocationOption) : null;
|
|
899
|
+
return l(C, { key: "40dea8ec89029dc596695a8725987a8630087938" }, l("div", { key: "dad47c8d7121d1944db1b4aaecfc3f49acb8b55d", class: "nylas-event-location", part: "nel" }, l("label", { key: "ccae6484ae7b506fab9f302463a10a3bfc85b28b", htmlFor: "location" }, c.t("nylasEventLocation.headerTitle"), l("span", { key: "15e158e30f2d7e4734b651ebc1a0499447c3cc5e", class: "label-icon" }, l("tooltip-component", { key: "2a27de9e4ce28a3de891cfa83b3fd41e3d7aa604" }, l("info-icon", { key: "9c6b96cb3923a779453e9f272221b8bed6d2a29e", slot: "tooltip-icon" }), l("span", { key: "a5447aca3cc65264f59601d6617d45ceb57aebb1", slot: "tooltip-content" }, c.t("nylasEventLocation.tooltip.desc"))))), l("div", { key: "b35c29edd2bdf321c01ffb9c34216d2200ab3b13", class: "location-input" }, l("select-dropdown", { key: "0c303b54cf2ff2f3df72b540a640fcaa5cf33784", withSearch: !1, name: "location", options: this.locationOptions, defaultSelectedOption: e, themeConfig: this.themeConfig, exportparts: "sd_dropdown: nel__dropdown, sd_dropdown-button: nel__dropdown-button, sd_dropdown-content: nel__dropdown-content" }, l("span", { key: "1174247972b83c97d09a6c9621bd049294a0aaaf", slot: "select-icon" }, this.getIcon(this.selectedLocationOption))), this.selectedLocationOption === "custom" && l("input", { type: "text", part: "nel__location", id: "location", name: "location", maxlength: "1024", value: this.location, onInput: (t) => this.handleChange(t) }))));
|
|
900
|
+
}
|
|
901
|
+
static get formAssociated() {
|
|
902
|
+
return !0;
|
|
903
|
+
}
|
|
904
|
+
get host() {
|
|
905
|
+
return x(this);
|
|
906
|
+
}
|
|
907
|
+
static get watchers() {
|
|
908
|
+
return {
|
|
909
|
+
name: ["elementNameChangedHandler"],
|
|
910
|
+
selectedConfiguration: ["selectedConfigurationChangedHandler"],
|
|
911
|
+
currentUser: ["currentUserChangedHandler"],
|
|
912
|
+
conferenceProviders: ["conferenceProvidersChanged"],
|
|
913
|
+
selectedLanguage: ["selectedLanguageChangedHandler"],
|
|
914
|
+
themeConfig: ["themeConfigChangedHandler"]
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
Oe([
|
|
919
|
+
w({
|
|
920
|
+
name: "nylas-event-location",
|
|
921
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
922
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
923
|
+
["schedulerConfig.conferenceProviders", "conferenceProviders"],
|
|
924
|
+
["schedulerConfig.currentUser", "currentUser"],
|
|
925
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"],
|
|
926
|
+
["schedulerConfig.themeConfig", "themeConfig"]
|
|
927
|
+
]),
|
|
928
|
+
eventToProps: {},
|
|
929
|
+
fireRegisterEvent: !0
|
|
930
|
+
}),
|
|
931
|
+
$("design:type", Function),
|
|
932
|
+
$("design:paramtypes", []),
|
|
933
|
+
$("design:returntype", void 0)
|
|
934
|
+
], U.prototype, "render", null);
|
|
935
|
+
U.style = Le;
|
|
936
|
+
const Ie = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-event-title{display:flex;flex-direction:column;gap:4px;position:relative;text-align:left;color:var(--nylas-base-900)}.nylas-event-title div.title{padding:12px 16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);overflow:auto;white-space:nowrap;scrollbar-width:thin;background-color:var(--nylas-base-0)}.nylas-event-title div.title::-webkit-scrollbar{width:6px;height:6px}.nylas-event-title div.title.error{border-color:var(--nylas-error);border-width:2px;outline:none}.nylas-event-title input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-event-title span.help-text{display:inline-block;gap:4px;align-items:center;color:var(--nylas-base-500);font-size:14px;font-style:normal;font-weight:400;line-height:21px;position:relative}.nylas-event-title span.help-text span.label-icon{display:inline-block}.nylas-event-title span.help-text span.label-icon tooltip-component::part(tc__container){position:unset}.nylas-event-title span.help-text span.label-icon tooltip-component::part(tc__content){position:absolute;top:4px;left:50%;transform:translateX(-50%)}.nylas-event-title span.error-message{color:var(--nylas-error)}.nylas-event-title label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-title label span.required{color:var(--nylas-error, #cc4841)}.nylas-event-title label span.label-icon{margin-left:4px}.nylas-event-title label span.label-icon tooltip-component{display:flex}.highlighted-tag{background-color:var(--nylas-base-200);border-radius:var(--nylas-border-radius);padding:5px;margin-left:4px}.token-options{display:block;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;top:80px;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}@media screen and (max-width: 768px){.token-options{right:0;width:325px;max-width:unset}}.token-options ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px;margin:0}.token-options ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.token-options ul li .token-label{display:flex;flex-direction:column;font-weight:400}.token-options ul li .token-label .token{color:var(--nylas-abse-900);font-size:16px;line-height:24px}.token-options ul li .token-label .description{color:var(--nylas-base-600);font-size:14px;line-height:21px}.token-options ul li:hover,.token-options ul li:focus,.token-options ul li:active,.token-options ul li.active{background-color:var(--nylas-base-100)}.token-options ul li:hover .token-label .token,.token-options ul li:focus .token-label .token,.token-options ul li:active .token-label .token,.token-options ul li.active .token-label .token{color:var(--nylas-primary)}.token-options .selected{background-color:var(--nylas-base-100)}', Pe = Ie;
|
|
937
|
+
var Ae = function(e, t, n, o) {
|
|
938
|
+
var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
|
|
939
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
940
|
+
s = Reflect.decorate(e, t, n, o);
|
|
941
|
+
else
|
|
942
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
943
|
+
(a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
|
|
944
|
+
return r > 3 && s && Object.defineProperty(t, n, s), s;
|
|
945
|
+
}, D = function(e, t) {
|
|
946
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
947
|
+
return Reflect.metadata(e, t);
|
|
948
|
+
};
|
|
949
|
+
const W = class {
|
|
950
|
+
constructor(e) {
|
|
951
|
+
var t, n;
|
|
952
|
+
b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.selectedConfiguration = void 0, this.eventTitle = (n = (t = this.selectedConfiguration) == null ? void 0 : t.event_booking) == null ? void 0 : n.title, this.name = "title", this.selectedLanguage = void 0, this.noTemplates = !1, this.themeConfig = void 0, this.showTokens = !1, this.availableTokens = k.map((o) => ({
|
|
953
|
+
label: o.token,
|
|
954
|
+
value: o.value,
|
|
955
|
+
labelHTML: o
|
|
956
|
+
})), this.filteredTokens = this.availableTokens, this.ariaActivedescendant = "", this.currentWord = { $value: "", fullText: "", index: -1, focusOffset: -1 }, this.validationError = "", this.configEventTitle = "", this.additionalFieldTokens = [];
|
|
957
|
+
}
|
|
958
|
+
elementNameChangedHandler(e) {
|
|
959
|
+
d("[nylas-event-title]", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
960
|
+
}
|
|
961
|
+
ariaActivedescendantChangedHandler(e) {
|
|
962
|
+
var t, n;
|
|
963
|
+
if (d("[nylas-event-title]", "ariaActivedescendantChangedHandler", e), e !== "") {
|
|
964
|
+
const o = (t = this.host.shadowRoot) == null ? void 0 : t.getElementById(e);
|
|
965
|
+
o == null || o.classList.add("active");
|
|
966
|
+
} else {
|
|
967
|
+
const o = (n = this.host.shadowRoot) == null ? void 0 : n.querySelectorAll(".token-options li.active");
|
|
968
|
+
o == null || o.forEach((r) => r.classList.remove("active"));
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
configChangedHandler(e) {
|
|
972
|
+
var s, a;
|
|
973
|
+
const t = (s = e == null ? void 0 : e.event_booking) == null ? void 0 : s.title, n = ((a = e == null ? void 0 : e.scheduler) == null ? void 0 : a.additional_fields) || {}, r = (Object.keys(n) || []).map((i) => ({
|
|
974
|
+
token: `$${i}`,
|
|
975
|
+
value: `\${${i}}`,
|
|
976
|
+
description: n[i].label || ""
|
|
977
|
+
}));
|
|
978
|
+
this.additionalFieldTokens = [...r], this.availableTokens = [...k, ...r].map((i) => ({
|
|
979
|
+
label: i.token,
|
|
980
|
+
value: i.value,
|
|
981
|
+
labelHTML: i
|
|
982
|
+
})), this.filteredTokens = [...this.availableTokens], t && (this.configEventTitle = t, this.updateEventTitleFromProp(t));
|
|
983
|
+
}
|
|
984
|
+
selectedLanguageChangedHandler(e, t) {
|
|
985
|
+
if (e === t)
|
|
986
|
+
return;
|
|
987
|
+
c.changeLanguage(e);
|
|
988
|
+
const n = {
|
|
989
|
+
$invitee: "invitee",
|
|
990
|
+
$invitee_email: "inviteeEmail",
|
|
991
|
+
$duration: "duration"
|
|
992
|
+
};
|
|
993
|
+
this.availableTokens = this.availableTokens.map((o) => (n[o.label] && (o.labelHTML.description = c.t(`nylasEventTitle.eventTitleTokenDescription.${n[o.label]}`)), o)), this.filteredTokens = [...this.availableTokens];
|
|
994
|
+
}
|
|
995
|
+
themeConfigChangedHandler(e, t) {
|
|
996
|
+
e !== t && this.applyThemeConfig(e);
|
|
997
|
+
}
|
|
998
|
+
applyThemeConfig(e) {
|
|
999
|
+
if (e)
|
|
1000
|
+
for (const [t, n] of Object.entries(e))
|
|
1001
|
+
this.host.style.setProperty(`${t}`, n);
|
|
1002
|
+
}
|
|
1003
|
+
connectedCallback() {
|
|
1004
|
+
d("[nylas-event-title]", "connectedCallback");
|
|
1005
|
+
}
|
|
1006
|
+
componentWillLoad() {
|
|
1007
|
+
d("[nylas-event-title]", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
1008
|
+
}
|
|
1009
|
+
componentDidLoad() {
|
|
1010
|
+
var t, n, o, r;
|
|
1011
|
+
d("[nylas-event-title]", "componentDidLoad");
|
|
1012
|
+
let e = this.eventTitle || this.configEventTitle;
|
|
1013
|
+
(n = (t = this.selectedConfiguration) == null ? void 0 : t.event_booking) != null && n.title && (e = (r = (o = this.selectedConfiguration) == null ? void 0 : o.event_booking) == null ? void 0 : r.title), e && (this.updateEventTitleFromProp(e), this.updateEventTitle(e, !0));
|
|
1014
|
+
}
|
|
1015
|
+
disconnectedCallback() {
|
|
1016
|
+
d("[nylas-event-title]", "disconnectedCallback");
|
|
1017
|
+
}
|
|
1018
|
+
formSubmittedHandler(e) {
|
|
1019
|
+
var t, n;
|
|
1020
|
+
d("[nylas-event-title]", "formSubmittedHandler", e), (n = (t = this.internals) == null ? void 0 : t.validity) != null && n.valid ? this.validationError = "" : this.validationError = "eventTitleRequired";
|
|
1021
|
+
}
|
|
1022
|
+
valueChangedHandler(e) {
|
|
1023
|
+
const { name: t, value: n } = e.detail;
|
|
1024
|
+
if (t === "additional-fields") {
|
|
1025
|
+
const o = JSON.parse(n.toString()), s = (Object.keys(o) || []).map((a) => ({
|
|
1026
|
+
token: `$${a}`,
|
|
1027
|
+
value: `\${${a}}`,
|
|
1028
|
+
description: o[a].label || ""
|
|
1029
|
+
}));
|
|
1030
|
+
this.additionalFieldTokens = [...s], this.availableTokens = [...k, ...s].map((a) => ({
|
|
1031
|
+
label: a.token,
|
|
1032
|
+
value: a.value,
|
|
1033
|
+
labelHTML: a
|
|
1034
|
+
})), this.filteredTokens = [...this.availableTokens];
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
updateEventTitleFromProp(e) {
|
|
1038
|
+
var n, o, r;
|
|
1039
|
+
d("[nylas-event-title]", "eventTitleChangedHandler", e);
|
|
1040
|
+
const t = e || this.configEventTitle;
|
|
1041
|
+
this.titleRef && (this.titleRef.innerHTML = this.highlightTokens(t), typeof this.internals.setValidity == "function" && (!t || t === "" ? (this.titleRef.focus(), (n = this.internals) == null || n.setValidity({ customError: !0 }, "Event title is required", this.titleRef)) : ((o = this.internals) == null || o.setValidity({ customError: !1 }), this.isInternalsAvailable && ((r = this.internals) == null || r.setFormValue(t, this.name)))));
|
|
1042
|
+
}
|
|
1043
|
+
highlightTokens(e) {
|
|
1044
|
+
let t = e;
|
|
1045
|
+
return [...k, ...this.additionalFieldTokens].forEach((n) => {
|
|
1046
|
+
const o = n.value, r = new RegExp(`(\\${o})(?!\\w)`, "g");
|
|
1047
|
+
t = (t == null ? void 0 : t.replace(r, '<span class="highlighted-tag">$1</span>')) || "";
|
|
1048
|
+
}), t;
|
|
1049
|
+
}
|
|
1050
|
+
getCurrentSelectionForBrowser() {
|
|
1051
|
+
var o, r, s;
|
|
1052
|
+
const e = (a, i, f, p) => {
|
|
1053
|
+
const h = a.replace(/[\u200B-\u200D\uFEFF]/g, ""), y = h.lastIndexOf("$"), u = h.substring(y).split(" ")[0];
|
|
1054
|
+
return {
|
|
1055
|
+
focusOffset: i,
|
|
1056
|
+
dollarIndex: y,
|
|
1057
|
+
lastWord: u,
|
|
1058
|
+
currentText: h,
|
|
1059
|
+
node: f,
|
|
1060
|
+
allSelected: p
|
|
1061
|
+
};
|
|
1062
|
+
}, t = (a) => {
|
|
1063
|
+
var i, f;
|
|
1064
|
+
return a.anchorOffset === 0 && a.focusOffset === ((f = (i = a.focusNode) == null ? void 0 : i.nodeValue) == null ? void 0 : f.length);
|
|
1065
|
+
};
|
|
1066
|
+
switch (M()) {
|
|
1067
|
+
case "Chrome": {
|
|
1068
|
+
const a = (o = this.host.shadowRoot) == null ? void 0 : o.getSelection(), i = a == null ? void 0 : a.focusNode, f = (i == null ? void 0 : i.nodeValue) || "", p = a && t(a);
|
|
1069
|
+
return e(f, (a == null ? void 0 : a.focusOffset) || -1, i, p);
|
|
1070
|
+
}
|
|
1071
|
+
case "Firefox": {
|
|
1072
|
+
const a = document.getSelection(), i = ((r = a == null ? void 0 : a.anchorNode) == null ? void 0 : r.nodeValue) || "", f = a && t(a);
|
|
1073
|
+
return e(i, (a == null ? void 0 : a.focusOffset) || -1, a == null ? void 0 : a.anchorNode, f);
|
|
1074
|
+
}
|
|
1075
|
+
case "Safari": {
|
|
1076
|
+
const a = window.getSelection(), i = a == null ? void 0 : a.getComposedRanges(this.host.shadowRoot)[0], f = ((s = i == null ? void 0 : i.startContainer) == null ? void 0 : s.nodeValue) || "", p = a && t(a);
|
|
1077
|
+
return e(f, (i == null ? void 0 : i.endOffset) || -1, i == null ? void 0 : i.startContainer, p);
|
|
1078
|
+
}
|
|
1079
|
+
default:
|
|
1080
|
+
return console.warn("Browser not supported"), null;
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
handleChange(e) {
|
|
1084
|
+
let t = e.target.textContent || "";
|
|
1085
|
+
t = R(t);
|
|
1086
|
+
const n = this.getCurrentSelectionForBrowser();
|
|
1087
|
+
if (!n) {
|
|
1088
|
+
this.updateEventTitle(t), this.resetDropdown();
|
|
1089
|
+
return;
|
|
1090
|
+
}
|
|
1091
|
+
const { focusOffset: o, dollarIndex: r, lastWord: s, currentText: a } = n;
|
|
1092
|
+
if (r === -1 || o < r) {
|
|
1093
|
+
this.updateEventTitle(t), this.resetDropdown();
|
|
1094
|
+
return;
|
|
1095
|
+
}
|
|
1096
|
+
s.startsWith("$") ? (this.showTokens = !0, this.currentWord = {
|
|
1097
|
+
$value: s,
|
|
1098
|
+
fullText: a,
|
|
1099
|
+
index: r,
|
|
1100
|
+
focusOffset: o
|
|
1101
|
+
}, this.populateSuggestionsDropdown(s)) : this.resetDropdown(), this.updateEventTitle(t);
|
|
1102
|
+
}
|
|
1103
|
+
handleInputKeyDown(e) {
|
|
1104
|
+
var n, o, r, s, a;
|
|
1105
|
+
const t = this.getCurrentSelectionForBrowser();
|
|
1106
|
+
if (t != null && t.allSelected && !S(e) && (this.titleRef.innerHTML = ""), e.key === "Enter") {
|
|
1107
|
+
e.preventDefault();
|
|
1108
|
+
const i = (n = this.host.shadowRoot) == null ? void 0 : n.getElementById(this.ariaActivedescendant);
|
|
1109
|
+
i && (i.click(), this.ariaActivedescendant = "");
|
|
1110
|
+
} else if (e.key === "ArrowDown") {
|
|
1111
|
+
e.preventDefault();
|
|
1112
|
+
const i = (o = this.host.shadowRoot) == null ? void 0 : o.getElementById(this.ariaActivedescendant);
|
|
1113
|
+
if (i) {
|
|
1114
|
+
const f = i.nextElementSibling;
|
|
1115
|
+
f ? this.ariaActivedescendant = f.id : this.ariaActivedescendant = this.filteredTokens[0].label;
|
|
1116
|
+
} else
|
|
1117
|
+
this.ariaActivedescendant = this.filteredTokens[0].label;
|
|
1118
|
+
} else if (e.key === "ArrowUp") {
|
|
1119
|
+
e.preventDefault();
|
|
1120
|
+
const i = (r = this.host.shadowRoot) == null ? void 0 : r.getElementById(this.ariaActivedescendant);
|
|
1121
|
+
if (i) {
|
|
1122
|
+
const f = i.previousElementSibling;
|
|
1123
|
+
f ? this.ariaActivedescendant = f.id : this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
|
|
1124
|
+
} else
|
|
1125
|
+
this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
|
|
1126
|
+
} else if (e.key === "Escape")
|
|
1127
|
+
e.preventDefault(), this.resetDropdown();
|
|
1128
|
+
else if (e.key === "Backspace" || e.key === "Delete") {
|
|
1129
|
+
const i = (s = t == null ? void 0 : t.node) == null ? void 0 : s.parentNode;
|
|
1130
|
+
t != null && t.currentText.startsWith("${") && i && i.nodeName === "SPAN" && (e.preventDefault(), i.removeChild(t.node), i.remove(), this.resetDropdown(), this.updateEventTitle(((a = this.titleRef) == null ? void 0 : a.textContent) || "")), (this.titleRef.textContent === "" || t != null && t.allSelected) && (this.titleRef.innerHTML = "", this.updateEventTitle(""));
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
selectOption(e, t) {
|
|
1134
|
+
var T;
|
|
1135
|
+
e.preventDefault();
|
|
1136
|
+
const n = this.currentWord.fullText, o = this.currentWord.$value;
|
|
1137
|
+
let r = this.titleRef.firstChild, s = null;
|
|
1138
|
+
for (; r; ) {
|
|
1139
|
+
if (r.nodeType === 3) {
|
|
1140
|
+
const v = ((T = r.textContent) == null ? void 0 : T.replace(/[\u200B-\u200D\uFEFF]/g, "")) || "", L = n.replace(/[\u200B-\u200D\uFEFF]/g, "");
|
|
1141
|
+
if (v.includes(L)) {
|
|
1142
|
+
s = r;
|
|
1143
|
+
break;
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
r = r.nextSibling;
|
|
1147
|
+
}
|
|
1148
|
+
if (!s)
|
|
1149
|
+
return;
|
|
1150
|
+
const a = s.textContent || "", i = a.indexOf(o), f = a.substring(0, i), p = a.substring(i + o.length), h = document.createTextNode(f), y = document.createRange(), u = document.createElement("span");
|
|
1151
|
+
u.classList.add("highlighted-tag"), u.textContent = `${t.value}`;
|
|
1152
|
+
const _ = document.createTextNode(p);
|
|
1153
|
+
if (p !== "")
|
|
1154
|
+
s.replaceWith(h, u, _), y.setStart(_, 1);
|
|
1155
|
+
else {
|
|
1156
|
+
const v = document.createTextNode("");
|
|
1157
|
+
s.replaceWith(h, u, v), y.setStart(v, 1);
|
|
1158
|
+
}
|
|
1159
|
+
this.resetDropdown(), this.titleRef.focus();
|
|
1160
|
+
const g = window.getSelection();
|
|
1161
|
+
y.collapse(!0), g == null || g.removeAllRanges(), g == null || g.addRange(y), this.updateEventTitle(this.titleRef.textContent || "");
|
|
1162
|
+
}
|
|
1163
|
+
populateSuggestionsDropdown(e = "") {
|
|
1164
|
+
this.filteredTokens = this.availableTokens.filter((t) => t.label.startsWith(e.toString()) || t.value.startsWith(e.toString())), this.filteredTokens.length > 0 && (this.ariaActivedescendant = this.filteredTokens[0].label);
|
|
1165
|
+
}
|
|
1166
|
+
get isInternalsAvailable() {
|
|
1167
|
+
return typeof this.internals < "u" && typeof this.internals.setValidity == "function" && typeof this.internals.setFormValue == "function";
|
|
1168
|
+
}
|
|
1169
|
+
updateEventTitle(e, t = !1) {
|
|
1170
|
+
var o, r, s;
|
|
1171
|
+
const n = e.replace(/ +/g, " ");
|
|
1172
|
+
n === "" || /^[\s]*$/.test(n) ? (this.validationError = "eventTitleRequired", this.isInternalsAvailable && ((o = this.internals) == null || o.setValidity({ customError: !0 }, "Event title is required", this.titleRef))) : (this.validationError = "", this.isInternalsAvailable && ((r = this.internals) == null || r.setValidity({ customError: !1 }))), this.isInternalsAvailable && ((s = this.internals) == null || s.setFormValue(n, this.name)), t || this.valueChanged.emit({ value: n, name: this.name });
|
|
1173
|
+
}
|
|
1174
|
+
resetDropdown() {
|
|
1175
|
+
this.showTokens = !1, this.ariaActivedescendant = "";
|
|
1176
|
+
}
|
|
1177
|
+
getLabelHTML(e) {
|
|
1178
|
+
return l("div", { class: "token-label" }, l("span", { class: "token" }, e.token), l("span", { class: "description" }, e.description));
|
|
1179
|
+
}
|
|
1180
|
+
render() {
|
|
1181
|
+
var e;
|
|
1182
|
+
return l(C, { key: "c6da12f405f1743fad3fcdebc253943e82849e1a" }, l("div", { key: "d66fa4c93ba12409991bc981ec6e7171113872f4", class: "nylas-event-title", part: "net" }, l("label", { key: "3c77424914867eaae8e71e5d3c13f459074b8256", htmlFor: "title" }, c.t("nylasEventTitle.headerTitle"), l("span", { key: "09f56d087b243ee8832331d9bc3c83073e1d9adb", class: "required" }, "*")), l("div", { key: "ec015f8e45422cb8f6593d7bab2db7e34caf69da", class: {
|
|
1183
|
+
title: !0,
|
|
1184
|
+
error: this.validationError !== ""
|
|
1185
|
+
}, part: "net__title", ref: (t) => this.titleRef = t, contentEditable: "true", onInput: (t) => this.handleChange(t), onKeyDown: (t) => this.handleInputKeyDown(t) }), !this.noTemplates && this.showTokens && ((e = this.filteredTokens) == null ? void 0 : e.length) > 0 && l("div", { class: "token-options", part: "net__dropdown-content" }, l("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map((t) => l("li", { tabindex: "0", key: t.label, id: t.label, class: { active: this.ariaActivedescendant === t.label }, onClick: (n) => this.selectOption(n, t), role: "option" }, this.getLabelHTML(t.labelHTML))))), !this.noTemplates && l("span", { class: "help-text" }, c.t("nylasEventTitle.helpText", { context: "start", field: c.t("nylasEventTitle.title") }), " ", l("code", null, "$"), " ", c.t("nylasEventTitle.helpText", { context: "end" }), l("span", { class: "label-icon" }, l("tooltip-component", null, l("info-icon", { slot: "tooltip-icon" }), l("span", { slot: "tooltip-content" }, c.t("nylasEventTitle.tooltip.desc"), " ", l("code", null, "${invitee}"))))), this.validationError != "" && l("span", { class: "error-message" }, c.t(`nylasEventTitle.${this.validationError}`))));
|
|
1186
|
+
}
|
|
1187
|
+
static get formAssociated() {
|
|
1188
|
+
return !0;
|
|
1189
|
+
}
|
|
1190
|
+
get host() {
|
|
1191
|
+
return x(this);
|
|
1192
|
+
}
|
|
1193
|
+
static get watchers() {
|
|
1194
|
+
return {
|
|
1195
|
+
name: ["elementNameChangedHandler"],
|
|
1196
|
+
ariaActivedescendant: ["ariaActivedescendantChangedHandler"],
|
|
1197
|
+
selectedConfiguration: ["configChangedHandler"],
|
|
1198
|
+
selectedLanguage: ["selectedLanguageChangedHandler"],
|
|
1199
|
+
themeConfig: ["themeConfigChangedHandler"]
|
|
1200
|
+
};
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
Ae([
|
|
1204
|
+
w({
|
|
1205
|
+
name: "nylas-event-title",
|
|
1206
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
1207
|
+
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
1208
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"],
|
|
1209
|
+
["schedulerConfig.themeConfig", "themeConfig"]
|
|
1210
|
+
]),
|
|
1211
|
+
eventToProps: {},
|
|
1212
|
+
fireRegisterEvent: !0
|
|
1213
|
+
}),
|
|
1214
|
+
D("design:type", Function),
|
|
1215
|
+
D("design:paramtypes", []),
|
|
1216
|
+
D("design:returntype", void 0)
|
|
1217
|
+
], W.prototype, "render", null);
|
|
1218
|
+
W.style = Pe;
|
|
1219
|
+
const $e = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.card-wrapper{background:var(--nylas-base-0);display:flex;flex-direction:column;font-family:var(--nylas-font-family);background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;padding:32px;width:562px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.card-wrapper{width:100%;border-radius:0px}}.header{overflow-wrap:anywhere;display:flex;flex-direction:column;font-size:16px;font-weight:400}.header h2{color:var(--nylas-base-900);font-size:24px;font-weight:600;text-align:left;margin:0}.description.title-desc{margin-bottom:2rem}.description.footer-desc{margin-top:2rem}.description.footer-desc a{color:var(--nylas-primary);text-decoration:none}.description p{margin:0;font-size:18px;color:var(--nylas-base-600)}.footer{margin-top:1rem;padding-top:1rem;display:flex;justify-content:flex-end;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.close-button{width:100%;display:flex;justify-content:flex-end}.close-button button-component button{padding:0;height:auto}.close-button button-component button:hover{background-color:transparent !important}button-component{--dot-color:var(--nylas-base-700)}', De = $e;
|
|
1220
|
+
var Fe = function(e, t, n, o) {
|
|
1221
|
+
var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
|
|
1222
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1223
|
+
s = Reflect.decorate(e, t, n, o);
|
|
1224
|
+
else
|
|
1225
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
1226
|
+
(a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
|
|
1227
|
+
return r > 3 && s && Object.defineProperty(t, n, s), s;
|
|
1228
|
+
}, F = function(e, t) {
|
|
1229
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1230
|
+
return Reflect.metadata(e, t);
|
|
1231
|
+
};
|
|
1232
|
+
const Z = class {
|
|
1233
|
+
constructor(e) {
|
|
1234
|
+
b(this, e), this.feedbackModalClosed = m(this, "feedbackModalClosed", 7), this.feedbackSubmitted = m(this, "feedbackSubmitted", 7), this.triggerValidation = m(this, "triggerValidation", 7), this.handleConfirmBookingButtonClicked = () => {
|
|
1235
|
+
this.triggerValidation.emit().defaultPrevented || this.feedbackSubmitted.emit({ feedback: this.feedbackMessage });
|
|
1236
|
+
}, this.themeConfig = void 0, this.feedbackMessage = "";
|
|
1237
|
+
}
|
|
1238
|
+
connectedCallback() {
|
|
1239
|
+
}
|
|
1240
|
+
disconnectedCallback() {
|
|
1241
|
+
}
|
|
1242
|
+
async componentWillLoad() {
|
|
1243
|
+
d("[nylas-feedback-form] Component will load");
|
|
1244
|
+
}
|
|
1245
|
+
async componentDidLoad() {
|
|
1246
|
+
d("[nylas-feedback-form] Component did load"), this.applyThemeConfig(this.themeConfig);
|
|
1247
|
+
}
|
|
1248
|
+
applyThemeConfig(e) {
|
|
1249
|
+
if (e)
|
|
1250
|
+
for (const [t, n] of Object.entries(e))
|
|
1251
|
+
this.host.style.setProperty(`${t}`, n);
|
|
1252
|
+
}
|
|
1253
|
+
handleFormInputChanged(e) {
|
|
1254
|
+
d("[nylas-feedback-form] Form input changed"), e.detail.value && (this.triggerValidation.emit(), e.detail.name === "feedback" && (this.feedbackMessage = e.detail.value));
|
|
1255
|
+
}
|
|
1256
|
+
closeModal(e) {
|
|
1257
|
+
e.preventDefault(), e.stopImmediatePropagation(), this.feedbackModalClosed.emit();
|
|
1258
|
+
}
|
|
1259
|
+
render() {
|
|
1260
|
+
return l(C, { key: "3dfba1b006f09a9ac9ccdd03a659784b86df25d4", part: "nfbf" }, l("div", { key: "f548f82b9689115b254815c0a6b940d1450ada04", class: "card-wrapper", part: "nfbfc__card" }, l("div", { key: "3e1be6b2ff7d6818b677f09772cde78edb4c7ef1", class: "close-button" }, l("button-component", { key: "dd98523ad84cc745f24daa400bb41753d103c3c6", tooltip: "Close", id: "close", variant: "invisible", onClick: (e) => this.closeModal(e), part: "nfbf__close-button" }, l("close-icon", { key: "0b919c2be114e231ff8eb7121536b6c24dfb7158" }))), l("div", { key: "2c62e429a6871d1dc6a34df4fc37440e61e9e041", class: "header" }, l("h2", { key: "8c1009dc5a853bb0cbc21b64958353c95a0ca140", slot: "card-title", part: "nfbf__title" }, c.t("feedbackFormTitle"))), l("div", { key: "b16e5a7c0e3b299d6ee9a74d154aa3628e9d4d25", class: "description title-desc" }, l("p", { key: "00675ebd52e88ed101df5710b3bded1f6424c274" }, c.t("feedbackFormDescription"))), l("textarea-component", { key: "7b021701b44eb5b3ba02ee3191d3866489f4ec8a", label: c.t("feedbackMessageLabel"), required: !0, maxLength: 500, part: "nfbf__description", name: "feedback", placeholder: c.t("feedbackMessagePlaceholder") }), l("div", { key: "def91af529f167b1fac0cc078f79cec67b961a1a", class: "description footer-desc" }, l("p", { key: "ad346ef93ae4a25fd5478284ff5415eb62b54f26" }, "By sending this report, you agree to Nylas’ access to the data necessary to respond to this issue, subject to Nylas’", " ", l("a", { key: "cd6a79cf548346d92d04264c4ff7244a032c3977", href: "https://www.nylas.com/privacy-policy/", target: "_blank", rel: "nofollow noreferrer noopener" }, "Privacy Policy"), ".")), l("div", { key: "5dfee1045b6711f5cf7d15009c86c0fd9b76b137", class: {
|
|
1261
|
+
footer: !0
|
|
1262
|
+
} }, l("button-component", { key: "45894bd04b89365c83d7e2a07e8a62ee7c94b6c0", variant: "invisible", onClick: (e) => this.closeModal(e), part: "nfbf__button-outline nfbf__cancel-cta" }, `${c.t("feedbackModalCloseButton")}`), l("button-component", { key: "ac586974014c3e3b6b454a8b830585b76bc1f290", variant: "primary", onClick: this.handleConfirmBookingButtonClicked, part: "nfbf__button-outline nfbf__reschedule-cta" }, `${c.t("feedbackModalSubmitButton")}`))));
|
|
1263
|
+
}
|
|
1264
|
+
get host() {
|
|
1265
|
+
return x(this);
|
|
1266
|
+
}
|
|
1267
|
+
};
|
|
1268
|
+
Fe([
|
|
1269
|
+
w({
|
|
1270
|
+
name: "nylas-feedback-form",
|
|
1271
|
+
stateToProps: /* @__PURE__ */ new Map([]),
|
|
1272
|
+
eventToProps: {
|
|
1273
|
+
feedbackSubmitted: async (e, t) => {
|
|
1274
|
+
}
|
|
1275
|
+
},
|
|
1276
|
+
localPropsToProp: /* @__PURE__ */ new Map([["themeConfig", "themeConfig"]]),
|
|
1277
|
+
fireRegisterEvent: !0
|
|
1278
|
+
}),
|
|
1279
|
+
F("design:type", Function),
|
|
1280
|
+
F("design:paramtypes", []),
|
|
1281
|
+
F("design:returntype", void 0)
|
|
1282
|
+
], Z.prototype, "render", null);
|
|
1283
|
+
Z.style = De;
|
|
1284
|
+
const He = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-reminder-time{display:flex;flex-direction:column;gap:4px}.nylas-reminder-time label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-reminder-time label span.required{color:var(--nylas-error, #cc4841)}.nylas-reminder-time label span.label-icon{margin-left:4px}.nylas-reminder-time label span.label-icon tooltip-component{display:flex}.nylas-reminder-time__wrapper{display:flex;align-items:center;justify-content:flex-end;gap:0.5rem}.nylas-reminder-time__wrapper input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family);font-size:16px;line-height:24px;width:48px}.nylas-reminder-time__wrapper input-dropdown{width:80px}.nylas-reminder-time__wrapper input-dropdown::part(id_dropdown-input){border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:14px 16px}.nylas-reminder-time__wrapper input-dropdown::part(id_dropdown-content){width:100%;min-width:unset;height:160px}.nylas-reminder-time__wrapper select-dropdown{width:120px}@media screen and (max-width: 768px){.nylas-reminder-time__wrapper select-dropdown{width:100%}}.nylas-reminder-time__wrapper select-dropdown::part(sd_dropdown-button){border:1px solid var(--nylas-base-200)}', Re = He;
|
|
1285
|
+
var Se = function(e, t, n, o) {
|
|
1286
|
+
var r = arguments.length, s = r < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, a;
|
|
1287
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1288
|
+
s = Reflect.decorate(e, t, n, o);
|
|
1289
|
+
else
|
|
1290
|
+
for (var i = e.length - 1; i >= 0; i--)
|
|
1291
|
+
(a = e[i]) && (s = (r < 3 ? a(s) : r > 3 ? a(t, n, s) : a(t, n)) || s);
|
|
1292
|
+
return r > 3 && s && Object.defineProperty(t, n, s), s;
|
|
1293
|
+
}, H = function(e, t) {
|
|
1294
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1295
|
+
return Reflect.metadata(e, t);
|
|
1296
|
+
};
|
|
1297
|
+
const K = class {
|
|
1298
|
+
constructor(e) {
|
|
1299
|
+
b(this, e), this.valueChanged = m(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "reminder-time", this.eventReminderTimeMinutes = void 0, this.selectedLanguage = void 0, this.themeConfig = void 0, this.selectedNumber = void 0, this.selectedPeriod = void 0, this.errorState = !1;
|
|
1300
|
+
}
|
|
1301
|
+
elementNameChangedHandler(e) {
|
|
1302
|
+
d("nylas-reminder-time", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
1303
|
+
}
|
|
1304
|
+
eventReminderTimeMinutesChangedHandler(e, t) {
|
|
1305
|
+
d("nylas-reminder-time", "eventReminderTimeMinutesChangedHandler", e), this.updateNumberAndPeriodFromMinutes(e), this.isInternalsAvailable && this.internals.setFormValue(e == null ? void 0 : e.toString(), this.name);
|
|
1306
|
+
}
|
|
1307
|
+
selectedLanguageChangedHandler(e, t) {
|
|
1308
|
+
e !== t && c.changeLanguage(e);
|
|
1309
|
+
}
|
|
1310
|
+
themeConfigChangedHandler(e, t) {
|
|
1311
|
+
e !== t && this.applyThemeConfig(e);
|
|
1312
|
+
}
|
|
1313
|
+
connectedCallback() {
|
|
1314
|
+
d("nylas-reminder-time", "connectedCallback");
|
|
1315
|
+
}
|
|
1316
|
+
componentWillLoad() {
|
|
1317
|
+
d("nylas-reminder-time", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
1318
|
+
}
|
|
1319
|
+
componentDidLoad() {
|
|
1320
|
+
d("nylas-reminder-time", "componentDidLoad"), this.updateNumberAndPeriodFromMinutes(this.eventReminderTimeMinutes || 30);
|
|
1321
|
+
}
|
|
1322
|
+
disconnectedCallback() {
|
|
1323
|
+
d("nylas-reminder-time", "disconnectedCallback");
|
|
1324
|
+
}
|
|
1325
|
+
applyThemeConfig(e) {
|
|
1326
|
+
if (e)
|
|
1327
|
+
for (const [t, n] of Object.entries(e))
|
|
1328
|
+
this.host.style.setProperty(`${t}`, n);
|
|
1329
|
+
}
|
|
1330
|
+
nylasSuggestReminderMinutesHandler(e) {
|
|
1331
|
+
const { minutes: t } = e.detail;
|
|
1332
|
+
this.errorState = !1, this.valueChanged.emit({ value: t.toString(), name: this.name }), this.isInternalsAvailable && this.internals.setFormValue(t.toString(), this.name), this.updateNumberAndPeriodFromMinutes(t + 7), setTimeout(() => {
|
|
1333
|
+
this.updateNumberAndPeriodFromMinutes(t);
|
|
1334
|
+
}, 10);
|
|
1335
|
+
}
|
|
1336
|
+
timePeriodChangedHandler(e) {
|
|
1337
|
+
const { number: t, period: n } = e.detail;
|
|
1338
|
+
let o;
|
|
1339
|
+
const r = 60, s = r * 24, a = s * 7, i = s * 30;
|
|
1340
|
+
n === "minute" ? o = t : n === "hour" ? o = t * r : n === "day" ? o = t * s : n === "week" ? o = t * a : n === "month" ? o = t * i : o = 0, this.errorState = o % 5 !== 0, this.valueChanged.emit({ value: o, name: this.name }), this.isInternalsAvailable && this.internals.setFormValue(o.toString(), this.name);
|
|
1341
|
+
}
|
|
1342
|
+
updateNumberAndPeriodFromMinutes(e) {
|
|
1343
|
+
let s, a;
|
|
1344
|
+
e === 0 ? (s = 0, a = "minute") : e >= 43200 && e % 43200 === 0 ? (s = Math.floor(e / 43200), a = "month") : e >= 10080 && e % 10080 === 0 ? (s = Math.floor(e / 10080), a = "week") : e >= 1440 && e % 1440 === 0 ? (s = Math.floor(e / 1440), a = "day") : e >= 60 && e % 60 === 0 ? (s = Math.floor(e / 60), a = "hour") : (s = e, a = "minute"), this.selectedNumber = s, this.selectedPeriod = a;
|
|
1345
|
+
}
|
|
1346
|
+
get isInternalsAvailable() {
|
|
1347
|
+
return this.internals !== void 0 && typeof this.internals.setFormValue == "function" && typeof this.internals.setValidity == "function";
|
|
1348
|
+
}
|
|
1349
|
+
render() {
|
|
1350
|
+
const e = typeof this.selectedNumber == "number" && typeof this.selectedPeriod == "string";
|
|
1351
|
+
return l(C, { key: "8496d67f55d981e506f577ad20197af8438bd408" }, l("div", { key: "d92c02476f1db6fe56d3045884dd381ed899af8c", class: "nylas-reminder-time", part: "nrt" }, l("div", { key: "79b615876498bcf00f51eaf22779fb54b4c398dc", class: "nylas-reminder-time__wrapper" }, e && l("time-period-selector", { id: "limit-future-bookings", part: "nrt__time-period-selector", hasError: this.errorState, timePeriods: [
|
|
1352
|
+
{ value: "minute", label: c.t("timeDuration", { context: "minute" }) },
|
|
1353
|
+
{ value: "hour", label: c.t("timeDuration", { context: "hour" }) },
|
|
1354
|
+
{ value: "day", label: c.t("timePeriod", { context: "day" }) }
|
|
1355
|
+
], exportparts: "tps__number-dropdown: nrt__number-dropdown, tps__number-dropdown-button: nrt__number-dropdown-button, tps__number-dropdown-content: nrt__number-dropdown-content, tps__period-dropdown: nrt__period-dropdown, tps__period-dropdown-button: nrt__period-dropdown-button, tps__period-dropdown-content: nrt__period-dropdown-content", defaultSelectedNumber: this.selectedNumber, defaultSelectedPeriod: this.selectedPeriod, themeConfig: this.themeConfig }))));
|
|
1356
|
+
}
|
|
1357
|
+
static get formAssociated() {
|
|
1358
|
+
return !0;
|
|
1359
|
+
}
|
|
1360
|
+
get host() {
|
|
1361
|
+
return x(this);
|
|
1362
|
+
}
|
|
1363
|
+
static get watchers() {
|
|
1364
|
+
return {
|
|
1365
|
+
name: ["elementNameChangedHandler"],
|
|
1366
|
+
eventReminderTimeMinutes: ["eventReminderTimeMinutesChangedHandler"],
|
|
1367
|
+
selectedLanguage: ["selectedLanguageChangedHandler"],
|
|
1368
|
+
themeConfig: ["themeConfigChangedHandler"]
|
|
1369
|
+
};
|
|
1370
|
+
}
|
|
1371
|
+
};
|
|
1372
|
+
Se([
|
|
1373
|
+
w({
|
|
1374
|
+
name: "nylas-reminder-time",
|
|
1375
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
1376
|
+
["schedulerConfig.selectedLanguage", "selectedLanguage"],
|
|
1377
|
+
["schedulerConfig.themeConfig", "themeConfig"]
|
|
1378
|
+
]),
|
|
1379
|
+
eventToProps: {},
|
|
1380
|
+
fireRegisterEvent: !0
|
|
1381
|
+
}),
|
|
1382
|
+
H("design:type", Function),
|
|
1383
|
+
H("design:paramtypes", []),
|
|
1384
|
+
H("design:returntype", void 0)
|
|
1385
|
+
], K.prototype, "render", null);
|
|
1386
|
+
K.style = Re;
|
|
1387
|
+
const Me = ".sc-trash-icon-h{display:flex}", Ne = Me, ze = class {
|
|
1388
|
+
constructor(e) {
|
|
1389
|
+
b(this, e), this.width = "20", this.height = "21";
|
|
1390
|
+
}
|
|
1391
|
+
render() {
|
|
1392
|
+
return l("svg", { key: "cd43bcf8a91abf12501571439a02652afeff0b0f", width: this.width, height: this.height, viewBox: "0 0 20 21", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, l("path", { key: "2870e48a14d2a84175298a75d47e3224a10385a4", d: "M10 0.25C11.733 0.25 13.1492 1.60645 13.2449 3.31558L13.25 3.5H18.5C18.9142 3.5 19.25 3.83579 19.25 4.25C19.25 4.6297 18.9678 4.94349 18.6018 4.99315L18.5 5H17.704L16.4239 18.0192C16.2912 19.3683 15.1984 20.41 13.8626 20.4945L13.6871 20.5H6.31293C4.95734 20.5 3.81365 19.5145 3.59883 18.1934L3.57614 18.0192L2.295 5H1.5C1.1203 5 0.806509 4.71785 0.756847 4.35177L0.75 4.25C0.75 3.8703 1.03215 3.55651 1.39823 3.50685L1.5 3.5H6.75C6.75 1.70507 8.20507 0.25 10 0.25ZM16.197 5H3.802L5.06893 17.8724C5.12768 18.4696 5.60033 18.9343 6.18585 18.9936L6.31293 19H13.6871C14.2872 19 14.7959 18.5751 14.9123 17.9982L14.9311 17.8724L16.197 5ZM11.75 7.75C12.1297 7.75 12.4435 8.03215 12.4932 8.39823L12.5 8.5V15.5C12.5 15.9142 12.1642 16.25 11.75 16.25C11.3703 16.25 11.0565 15.9678 11.0068 15.6018L11 15.5V8.5C11 8.08579 11.3358 7.75 11.75 7.75ZM8.25 7.75C8.6297 7.75 8.94349 8.03215 8.99315 8.39823L9 8.5V15.5C9 15.9142 8.66421 16.25 8.25 16.25C7.8703 16.25 7.55651 15.9678 7.50685 15.6018L7.5 15.5V8.5C7.5 8.08579 7.83579 7.75 8.25 7.75ZM10 1.75C9.08183 1.75 8.32881 2.45711 8.2558 3.35647L8.25 3.5H11.75C11.75 2.5335 10.9665 1.75 10 1.75Z", fill: "currentColor" }));
|
|
1393
|
+
}
|
|
1394
|
+
};
|
|
1395
|
+
ze.style = Ne;
|
|
1396
|
+
export {
|
|
1397
|
+
Q as checkmark_icon,
|
|
1398
|
+
te as copy_icon,
|
|
1399
|
+
oe as dragable_icon,
|
|
1400
|
+
ie as eye_icon,
|
|
1401
|
+
de as feedback_icon,
|
|
1402
|
+
ye as input_color_picker,
|
|
1403
|
+
N as input_image_url,
|
|
1404
|
+
z as nylas_additional_participants,
|
|
1405
|
+
B as nylas_event_description,
|
|
1406
|
+
j as nylas_event_info,
|
|
1407
|
+
U as nylas_event_location,
|
|
1408
|
+
W as nylas_event_title,
|
|
1409
|
+
Z as nylas_feedback_form,
|
|
1410
|
+
K as nylas_reminder_time,
|
|
1411
|
+
ze as trash_icon
|
|
1412
|
+
};
|