@nylas/react 1.0.2-prealpha1 → 1.1.0-canary.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-circle-icon_21.entry-71e60262.js +1755 -0
- package/dist/add-circle-icon_21.entry-95dda099.cjs +1 -0
- package/dist/{archive-icon_7.entry-84d70dbf.cjs → archive-icon_7.entry-24f31e46.cjs} +1 -1
- package/dist/{archive-icon_7.entry-91aaa1aa.js → archive-icon_7.entry-3c5e3ccf.js} +19 -19
- package/dist/{arrow-icon.entry-400a08fa.cjs → arrow-icon.entry-562eb541.cjs} +1 -1
- package/dist/{arrow-icon.entry-8b2e96a6.js → arrow-icon.entry-813bffe9.js} +2 -2
- package/dist/{bold-icon_3.entry-4b2798a8.js → bold-icon_3.entry-c0e7d524.js} +4 -4
- package/dist/{bold-icon_3.entry-9ad35153.cjs → bold-icon_3.entry-e8b034fe.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-83ba884a.js → calendar-cancel-icon.entry-0b0219cb.js} +5 -5
- package/dist/{calendar-cancel-icon.entry-fcb66929.cjs → calendar-cancel-icon.entry-7d4fdb1b.cjs} +1 -1
- package/dist/calendar-check-icon_2.entry-6ecd2faa.js +25 -0
- package/dist/calendar-check-icon_2.entry-88025f63.cjs +1 -0
- package/dist/{calendar-icon.entry-8f38af4a.js → calendar-icon.entry-34d8ef69.js} +5 -5
- package/dist/{calendar-icon.entry-7bae38d7.cjs → calendar-icon.entry-b753520f.cjs} +1 -1
- package/dist/chevron-icon_3.entry-0aeb4cfa.cjs +1 -0
- package/dist/chevron-icon_3.entry-ae55fd65.js +117 -0
- package/dist/close-icon.entry-ae66c827.js +15 -0
- package/dist/close-icon.entry-c80da833.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-ed515326.cjs → constants-f34b9c6e-b9f975af.cjs} +6 -6
- package/dist/{nylas-booked-event-card_10.entry-7e66a648.js → constants-f34b9c6e-d0f5cd19.js} +1665 -2374
- package/dist/document-refresh-icon.entry-36405467.cjs +1 -0
- package/dist/{document-refresh-icon.entry-9083a2e9.js → document-refresh-icon.entry-7d370f85.js} +5 -5
- package/dist/elements/index.d.ts +32 -2
- package/dist/{elements-dc5b338e-81a0319c.cjs → elements-dc5b338e-0dbb4f67.cjs} +1 -1
- package/dist/{elements-dc5b338e-fb5dbfb5.js → elements-dc5b338e-524cb111.js} +1 -1
- package/dist/{focus-visible-e8093c16-28fc08a0.js → focus-visible-e8093c16-17ab1557.js} +5 -3
- package/dist/focus-visible-e8093c16-7e94a4f3.cjs +1 -0
- package/dist/{forward-icon_6.entry-b60fcb35.js → forward-icon_6.entry-384cc3c5.js} +83 -85
- package/dist/forward-icon_6.entry-a479b39e.cjs +3 -0
- package/dist/{globe-icon.entry-8325e73e.cjs → globe-icon.entry-0c848856.cjs} +1 -1
- package/dist/{globe-icon.entry-e3fd373f.js → globe-icon.entry-58b9f3fc.js} +4 -4
- package/dist/google-logo-icon_4.entry-3dce1b83.js +388 -0
- package/dist/google-logo-icon_4.entry-e1e63fd0.cjs +1 -0
- package/dist/index-20ea5b0c.js +4042 -0
- package/dist/index-33f74306.cjs +37 -0
- package/dist/index.d.ts +3 -1
- package/dist/{index-b30d446a-a90f84b2.js → index.es-be19d2df-c2fdca63.js} +945 -1041
- package/dist/index.es-be19d2df-f732308a.cjs +7 -0
- package/dist/info-icon_2.entry-98965833.js +34 -0
- package/dist/info-icon_2.entry-dd0a0633.cjs +1 -0
- package/dist/{loading-icon.entry-b2096d2b.cjs → loading-icon.entry-46821f18.cjs} +1 -1
- package/dist/{loading-icon.entry-27410cf8.js → loading-icon.entry-abd81cea.js} +2 -2
- package/dist/mailbox-store-76540d24-7bf14e45.cjs +1 -0
- package/dist/{mailbox-store-19f0c6c9-e3e8b4e5.js → mailbox-store-76540d24-dfb53045.js} +2 -2
- package/dist/nylas-additional-participants.entry-d35d7af5.cjs +1 -0
- package/dist/nylas-additional-participants.entry-f6ed34d6.js +81 -0
- package/dist/nylas-booked-event-card_10.entry-534e587c.cjs +1 -0
- package/dist/nylas-booked-event-card_10.entry-8efe8335.js +805 -0
- package/dist/nylas-custom-booking-flow.entry-0e7b605d.js +106 -0
- package/dist/nylas-custom-booking-flow.entry-12d09496.cjs +1 -0
- package/dist/nylas-form-card.entry-7dd86dde.js +54 -0
- package/dist/nylas-form-card.entry-94579d1d.cjs +1 -0
- package/dist/nylas-if-state.entry-32ea90ea.cjs +1 -0
- package/dist/nylas-if-state.entry-92cbc0b9.js +94 -0
- package/dist/nylas-list-folders.entry-8595a9b7.cjs +1 -0
- package/dist/{nylas-list-folders.entry-a5437201.js → nylas-list-folders.entry-cab222c9.js} +10 -11
- package/dist/nylas-list-threads.entry-3fef6316.cjs +1 -0
- package/dist/{nylas-list-threads.entry-fd6cda61.js → nylas-list-threads.entry-8e9294a3.js} +5 -6
- package/dist/nylas-login.entry-bc885e04.cjs +1 -0
- package/dist/nylas-login.entry-bd1d5b6f.js +73 -0
- package/dist/{nylas-mailbox-pagination.entry-988214bc.js → nylas-mailbox-pagination.entry-58657a09.js} +7 -8
- package/dist/nylas-mailbox-pagination.entry-74d3b376.cjs +1 -0
- package/dist/nylas-mailbox-toolbar-button.entry-8b73b9f4.cjs +1 -0
- package/dist/{nylas-mailbox-toolbar-button.entry-c720e22a.js → nylas-mailbox-toolbar-button.entry-d7817b46.js} +15 -16
- package/dist/nylas-mailbox.entry-0bddc2fd.js +134 -0
- package/dist/nylas-mailbox.entry-762f5062.cjs +1 -0
- package/dist/{nylas-provider.entry-70721009.js → nylas-provider.entry-2e24192d.js} +40 -29
- package/dist/nylas-provider.entry-f8ba7a6e.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-8189b099.js +2269 -0
- package/dist/nylas-scheduler-editor.entry-a642f833.cjs +7 -0
- package/dist/nylas-scheduling.entry-13087b5f.cjs +1 -0
- package/dist/nylas-scheduling.entry-3f170361.js +248 -0
- package/dist/nylas-threads-refresh.entry-3b9f57c3.cjs +1 -0
- package/dist/{nylas-threads-refresh.entry-b7f9e93f.js → nylas-threads-refresh.entry-f2967405.js} +4 -5
- package/dist/nylas-threads-search.entry-3e0b4fdc.cjs +1 -0
- package/dist/{nylas-threads-search.entry-95afea9c.js → nylas-threads-search.entry-e70bbf70.js} +4 -5
- package/dist/{nylas-view-thread.entry-165173b1.js → nylas-view-thread.entry-4f39f045.js} +10 -11
- package/dist/nylas-view-thread.entry-b23080b7.cjs +1 -0
- package/dist/people-icon.entry-15cd7d77.cjs +1 -0
- package/dist/people-icon.entry-7f3b95e9.js +15 -0
- package/dist/play-icon_2.entry-13065065.js +25 -0
- package/dist/play-icon_2.entry-2172886a.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +94 -62
- package/dist/{refresh-icon.entry-601cac89.cjs → refresh-icon.entry-61067a7f.cjs} +1 -1
- package/dist/{refresh-icon.entry-e48a338f.js → refresh-icon.entry-fbfa185e.js} +5 -5
- package/dist/register-component-83e24412-445c6ad9.cjs +1 -0
- package/dist/{register-component-152c6ad2-a06f58c2.js → register-component-83e24412-b666e56b.js} +37 -33
- package/dist/scheduler-config-store-ec3b6190-8bde49c6.cjs +1 -0
- package/dist/scheduler-config-store-ec3b6190-fa81c492.js +23 -0
- package/dist/scheduler-store-8ca9003d-57b3f7a7.cjs +1 -0
- package/dist/scheduler-store-8ca9003d-8da2c12d.js +321 -0
- package/dist/time-period-selector.entry-5e083fd3.js +76 -0
- package/dist/time-period-selector.entry-febf55eb.cjs +1 -0
- package/dist/translate-icon.entry-10db7d36.js +15 -0
- package/dist/translate-icon.entry-8ce0a713.cjs +1 -0
- package/dist/warning-icon.entry-470e449d.js +15 -0
- package/dist/warning-icon.entry-b8217553.cjs +1 -0
- package/package.json +7 -4
- package/dist/_commonjsHelpers-57e89916-4a3ae7d8.cjs +0 -1
- package/dist/_commonjsHelpers-57e89916-af061c86.js +0 -19
- package/dist/add-circle-icon.entry-2ccb238b.cjs +0 -1
- package/dist/add-circle-icon.entry-35d6aa07.js +0 -15
- package/dist/calendar-check-icon_3.entry-903e2d82.js +0 -35
- package/dist/calendar-check-icon_3.entry-a16ce05e.cjs +0 -1
- package/dist/chevron-icon.entry-58366662.cjs +0 -1
- package/dist/chevron-icon.entry-5e11cef5.js +0 -15
- package/dist/close-icon_2.entry-011d9cf4.js +0 -25
- package/dist/close-icon_2.entry-83088b9a.cjs +0 -1
- package/dist/document-refresh-icon.entry-071ffd66.cjs +0 -1
- package/dist/duration-bddc4a13-05d3e3e2.cjs +0 -1
- package/dist/duration-bddc4a13-179ce826.js +0 -41
- package/dist/focus-visible-e8093c16-f380b705.cjs +0 -1
- package/dist/forward-icon_6.entry-3345af84.cjs +0 -3
- package/dist/index-3b6f5cd5.cjs +0 -30
- package/dist/index-630f4e87.js +0 -1498
- package/dist/index-b30d446a-cbbef925.cjs +0 -7
- package/dist/mailbox-store-19f0c6c9-a0cbfa97.cjs +0 -1
- package/dist/nylas-if-state_3.entry-504be976.cjs +0 -1
- package/dist/nylas-if-state_3.entry-e96d01f1.js +0 -291
- package/dist/nylas-list-folders.entry-866361cc.cjs +0 -1
- package/dist/nylas-list-threads.entry-04989295.cjs +0 -1
- package/dist/nylas-mailbox-pagination.entry-e0bd4aef.cjs +0 -1
- package/dist/nylas-mailbox-toolbar-button.entry-3d772b26.cjs +0 -1
- package/dist/nylas-open-hours-picker.entry-6bdc7c73.js +0 -186
- package/dist/nylas-open-hours-picker.entry-881b6db7.cjs +0 -1
- package/dist/nylas-provider.entry-8d9a844b.cjs +0 -1
- package/dist/nylas-scheduler.entry-7321e18f.js +0 -230
- package/dist/nylas-scheduler.entry-e82977fb.cjs +0 -1
- package/dist/nylas-threads-refresh.entry-477e68e4.cjs +0 -1
- package/dist/nylas-threads-search.entry-c5854641.cjs +0 -1
- package/dist/nylas-view-thread.entry-8b72cbdb.cjs +0 -1
- package/dist/play-icon_2.entry-ed5877e3.js +0 -25
- package/dist/play-icon_2.entry-f23ed6c1.cjs +0 -1
- package/dist/register-component-152c6ad2-0df7215b.cjs +0 -1
- package/dist/scheduler-store-7d48e682-0c0c3991.js +0 -289
- package/dist/scheduler-store-7d48e682-674705ef.cjs +0 -1
- package/dist/search-icon_3.entry-292138c3.js +0 -101
- package/dist/search-icon_3.entry-8e555357.cjs +0 -1
- package/dist/utils-5074a070-ce33ee6b.js +0 -119
- package/dist/utils-5074a070-d5ba6add.cjs +0 -2
|
@@ -0,0 +1,1755 @@
|
|
|
1
|
+
import { r as y, h as i, c as w, d, H as k, g as _, C as W, D as F, E as ge, G as Be, i as je, I as Z, J as ae, K as ie, L as ve, M as xe, O as U, P as We } from "./index-20ea5b0c.js";
|
|
2
|
+
import { R as C } from "./register-component-83e24412-b666e56b.js";
|
|
3
|
+
import { T as ke, E as we } from "./constants-f34b9c6e-d0f5cd19.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
const Ue = ".sc-add-circle-icon-h{display:flex}", Ze = Ue, Ye = class {
|
|
7
|
+
constructor(e) {
|
|
8
|
+
y(this, e), this.width = "24", this.height = "25";
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
return i("svg", { key: "58ce81214aeed7ddc1ce5f76d674aba576422d48", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "2a47ed74601a5370f0300da06295a2b5969d7e5f", d: "M12 2.5c5.523 0 10 4.477 10 10s-4.477 10-10 10-10-4.477-10-10 4.477-10 10-10ZM12 4a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17Zm0 3.5a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 12 7.5Z", fill: "currentColor" }));
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
Ye.style = Ze;
|
|
15
|
+
const Ke = "button.sc-button-component{height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer;font-family:var(--nylas-font-family);font-weight:600}@media screen and (max-width: 768px){button.sc-button-component{width:100%}}button.button-primary.sc-button-component{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer}button.button-primary.sc-button-component:hover{background:var(--nylas-base-600)}button.button-primary.sc-button-component:active{background:var(--nylas-base-800)}button.button-primary.sc-button-component:disabled{background:var(--nylas-base-300);cursor:not-allowed}button.button-basic.sc-button-component{border:1px solid var(--nylas-base-300);color:var(--nylas-base-700);background:transparent}button.button-basic.sc-button-component:hover{background:transparent;border-color:var(--nylas-primary)}button.button-basic.sc-button-component:active{background:transparent;border-color:var(--nylas-base-600);border-width:2px}button.button-basic.sc-button-component:disabled{background:transparent;border-color:var(--nylas-base-300);color:var(--nylas-base-300);cursor:not-allowed}button.button-destructive.sc-button-component{border:1px solid var(--nylas-base-300);color:var(--nylas-error);background:transparent}button.button-destructive.sc-button-component:hover{background:transparent;border-color:var(--nylas-error)}button.button-destructive.sc-button-component:active{background:transparent;border-color:var(--nylas-error-pressed);border-width:2px;color:var(--nylas-error-pressed)}button.button-destructive.sc-button-component:disabled{background:transparent;border-color:var(--nylas-base-300);color:var(--nylas-base-300);cursor:not-allowed}", Ve = Ke, qe = class {
|
|
16
|
+
constructor(e) {
|
|
17
|
+
y(this, e), this.variant = "primary", this.disabled = !1, this.type = "button", this.clickHandler = void 0, this.mouseOverHandler = void 0, this.mouseOutHandler = void 0, this.focusHandler = void 0, this.blurHandler = void 0;
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
const e = `button-${this.variant}` + (this.disabled ? " disabled" : "");
|
|
21
|
+
return i("button", { key: "3ac840e8b65854c2e4bdabe93b21b5bcda99e4db", class: e, disabled: this.disabled, type: "type", onClick: this.clickHandler, onMouseOver: this.mouseOverHandler, onMouseOut: this.mouseOutHandler, onFocus: this.focusHandler, onBlur: this.blurHandler }, i("slot", { key: "110df0711566be0df89f2e04aed008dcaf91e9f3" }));
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
qe.style = Ve;
|
|
25
|
+
const Je = ".sc-calendar-info-icon-h{display:flex}", Ge = Je, Xe = class {
|
|
26
|
+
constructor(e) {
|
|
27
|
+
y(this, e), this.width = "20", this.height = "20";
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
return i("svg", { key: "4c290eae1d55ec9df96cbe6d9ba85d5d8b7ee102", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "a2a76a5d0183952d59f1d2f448dc7c460694e410", d: "M12 0C13.3807 0 14.5 1.11929 14.5 2.5V6.59971C14.1832 6.43777 13.8486 6.30564 13.5 6.20703V4H1.5V11.5C1.5 12.3284 2.17157 13 3 13H6.70703C6.80564 13.3486 6.93777 13.6832 7.09971 14H3C1.61929 14 0.5 12.8807 0.5 11.5V2.5C0.5 1.11929 1.61929 0 3 0H12ZM12 1H3C2.17157 1 1.5 1.67157 1.5 2.5V3H13.5V2.5C13.5 1.67157 12.8284 1 12 1ZM11.375 9.5C11.375 9.15482 11.6548 8.875 12 8.875C12.3452 8.875 12.625 9.15482 12.625 9.5C12.625 9.84518 12.3452 10.125 12 10.125C11.6548 10.125 11.375 9.84518 11.375 9.5ZM12.5 13.5C12.5 13.7761 12.2761 14 12 14C11.7239 14 11.5 13.7761 11.5 13.5V11.5C11.5 11.2239 11.7239 11 12 11C12.2761 11 12.5 11.2239 12.5 11.5V13.5ZM7.5 11.5C7.5 9.01472 9.51472 7 12 7C14.4853 7 16.5 9.01472 16.5 11.5C16.5 13.9853 14.4853 16 12 16C9.51472 16 7.5 13.9853 7.5 11.5ZM8.5 11.5C8.5 13.433 10.067 15 12 15C13.933 15 15.5 13.433 15.5 11.5C15.5 9.567 13.933 8 12 8C10.067 8 8.5 9.567 8.5 11.5Z", fill: "currentColor" }));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
Xe.style = Ge;
|
|
34
|
+
const Qe = ".sc-calendar-patterns-icon-h{display:flex}", et = Qe, tt = class {
|
|
35
|
+
constructor(e) {
|
|
36
|
+
y(this, e), this.width = "20", this.height = "20";
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return i("svg", { key: "cf8071f578ad04793f5bd5b446dccaa1f6d4c1a3", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "8e8a3c7d87bc41c6d6973a34863d05d996155c1d", d: "M3.25 0H11.75C13.2688 0 14.5 1.23122 14.5 2.75V11.25C14.5 12.7688 13.2688 14 11.75 14H3.25C1.73122 14 0.5 12.7688 0.5 11.25V2.75C0.5 1.23122 1.73122 0 3.25 0ZM2 2.75V4H13V2.75C13 2.05964 12.4404 1.5 11.75 1.5H3.25C2.55964 1.5 2 2.05964 2 2.75ZM12.2071 5L8.20711 9H10.7929L13 6.79289V5H12.2071ZM10.7929 5H8.20711L4.20711 9H6.79289L10.7929 5ZM2.79289 9L6.79289 5H4.20711L2 7.20711V9H2.79289ZM2 5.79289L2.79289 5H2V5.79289ZM12.2071 9H13V8.20711L12.2071 9Z", fill: "currentColor" }));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
tt.style = et;
|
|
43
|
+
const nt = ".sc-flow-icon-h{display:flex}", at = nt, it = class {
|
|
44
|
+
constructor(e) {
|
|
45
|
+
y(this, e), this.width = "16", this.height = "12";
|
|
46
|
+
}
|
|
47
|
+
render() {
|
|
48
|
+
return i("svg", { key: "e0f4da46b751754406e8b0551890a1bffb1100e4", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "21997cb261d91c8589c3e87a01036dc8f91a8d9b", d: "M13 1.66211C11.8954 1.66211 11 2.55754 11 3.66211C11 4.76668 11.8954 5.66211 13 5.66211C14.1046 5.66211 15 4.76668 15 3.66211C15 2.55754 14.1046 1.66211 13 1.66211ZM10.0407 3.16678C10.2768 1.74563 11.5119 0.662109 13 0.662109C14.6569 0.662109 16 2.00526 16 3.66211C16 5.31896 14.6569 6.66211 13 6.66211C11.5162 6.66211 10.2839 5.58482 10.0428 4.16971C9.37629 4.23688 8.82682 4.7426 8.71466 5.41551L8.27173 8.07311C8.07929 9.22776 7.11428 10.087 5.9593 10.1574C5.72319 11.5786 4.48813 12.6621 3 12.6621C1.34315 12.6621 0 11.319 0 9.66211C0 8.00526 1.34315 6.66211 3 6.66211C4.48384 6.66211 5.71607 7.73939 5.95724 9.15451C6.62371 9.08734 7.17318 8.58162 7.28534 7.90871L7.72827 5.25111C7.92071 4.09646 8.88571 3.23718 10.0407 3.16678ZM3 7.66211C1.89543 7.66211 1 8.55754 1 9.66211C1 10.7667 1.89543 11.6621 3 11.6621C4.10457 11.6621 5 10.7667 5 9.66211C5 8.55754 4.10457 7.66211 3 7.66211Z", fill: "currentColor" }));
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
it.style = at;
|
|
52
|
+
const st = ".sc-location-icon-h{display:flex}", ot = st, lt = class {
|
|
53
|
+
constructor(e) {
|
|
54
|
+
y(this, e), this.width = "16", this.height = "18";
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
return i("svg", { key: "4888ed340800392ac9bb38eb4b868fca595db537", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "20cfaacf5cb828569e0b4ec6d2e83fe3b5264b32", d: "M10 7.66211C10 9.31896 8.65685 10.6621 7 10.6621C5.34315 10.6621 4 9.31896 4 7.66211C4 6.00526 5.34315 4.66211 7 4.66211C8.65685 4.66211 10 6.00526 10 7.66211ZM9 7.66211C9 6.55754 8.10457 5.66211 7 5.66211C5.89543 5.66211 5 6.55754 5 7.66211C5 8.76668 5.89543 9.66211 7 9.66211C8.10457 9.66211 9 8.76668 9 7.66211ZM11.9497 12.6171C14.6834 9.88221 14.6834 5.44812 11.9497 2.71326C9.21608 -0.0216067 4.78392 -0.0216067 2.05025 2.71326C-0.683418 5.44812 -0.683418 9.88221 2.05025 12.6171L3.57128 14.1159L5.61408 16.101L5.74691 16.2188C6.52168 16.8468 7.65623 16.8076 8.38611 16.1012L10.8223 13.7312L11.9497 12.6171ZM2.75499 3.4183C5.09944 1.07282 8.90055 1.07282 11.245 3.4183C13.5294 5.70364 13.5879 9.3725 11.4207 11.7288L11.245 11.912L9.92371 13.216L7.69315 15.3846L7.60016 15.4642C7.24594 15.732 6.7543 15.732 6.40012 15.4642L6.30713 15.3845L3.3263 12.4791L2.75499 11.912L2.57927 11.7288C0.412077 9.3725 0.47065 5.70364 2.75499 3.4183Z", fill: "currentColor" }));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
lt.style = ot;
|
|
61
|
+
const rt = ".sc-location-off-icon-h{display:flex}", dt = rt, ct = class {
|
|
62
|
+
constructor(e) {
|
|
63
|
+
y(this, e), this.width = "16", this.height = "18";
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return i("svg", { key: "b61c56b0a012359592a4c2575f130ece6fd412c6", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "6be791c9a59fa3634f65881dfbca7adc5e3355d3", d: "M0.146447 0.808556C0.341709 0.613294 0.658291 0.613294 0.853553 0.808556L15.8536 15.8086C16.0488 16.0038 16.0488 16.3204 15.8536 16.5157C15.6583 16.7109 15.3417 16.7109 15.1464 16.5157L12.0938 13.463L11.8223 13.7312L9.38611 16.1012C8.65623 16.8076 7.52168 16.8468 6.74691 16.2188L6.61408 16.101L4.57128 14.1159L3.05025 12.6171C0.607421 10.1732 0.347525 6.37239 2.27056 3.63976L0.146447 1.51566C-0.0488155 1.3204 -0.0488155 1.00382 0.146447 0.808556ZM9.07768 10.4469C8.74346 10.576 8.38024 10.6468 8.0005 10.6468C6.34839 10.6468 5.00909 9.30689 5.00909 7.65406C5.00909 7.27461 5.07967 6.91166 5.20843 6.57763L2.98793 4.35713C1.49206 6.62038 1.68917 9.67377 3.57927 11.7288L3.75499 11.912L4.3263 12.4791L7.30713 15.3845L7.40012 15.4642C7.7543 15.732 8.24594 15.732 8.60016 15.4642L8.69315 15.3846L10.9237 13.216L11.3883 12.7575L9.07768 10.4469ZM9.85409 8.39486L10.5983 9.13904C10.8487 8.70143 10.9919 8.19447 10.9919 7.65406C10.9919 6.00122 9.65261 4.66134 8.0005 4.66134C7.45986 4.66134 6.95271 4.80482 6.51504 5.05581L7.25921 5.79998C7.48839 5.70819 7.73855 5.6577 8.0005 5.6577C9.10258 5.6577 9.99599 6.5515 9.99599 7.65406C9.99599 7.91581 9.94564 8.16581 9.85409 8.39486ZM4.35291 2.89368C6.70671 1.08827 10.0908 1.26314 12.245 3.4183C14.3986 5.57283 14.5739 8.95702 12.771 11.3118L13.4812 12.022C15.6702 9.27273 15.493 5.25762 12.9497 2.71326C10.4058 0.168159 6.39081 -0.00843871 3.64269 2.18347L4.35291 2.89368Z", fill: "currentColor" }));
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
ct.style = dt;
|
|
70
|
+
const ft = ':host{display:block;width:inherit;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.dropdown{display:inline-block;width:100%;position:relative}.dropdown .dropdown-label{display:flex;align-items:center;gap:0.25rem;color:var(--nylas-base-800)}.dropbtn{width:inherit;height:48px;color:black;padding:0.5rem;font-size:1rem;cursor:pointer;display:flex;gap:0.5rem;justify-content:space-between;align-items:center;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.dropbtn.focus{background:transparent}.dropbtn:hover,.dropbtn:active{border:1px solid var(--nylas-primary)}.dropbtn:active{outline:2px solid var(--nylas-primary)}.dropbtn span.open{transform:rotate(90deg)}.dropbtn span.closed{transform:rotate(270deg)}.dropdown-content{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.dropdown-content ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.dropdown-content ul li{padding:16px, 12px, 16px, 12px;color:black;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}.dropdown-content ul li:hover,.dropdown-content ul li:focus{background-color:var(--nylas-base-100)}.dropdown-content ul li label{display:flex;align-items:center;gap:0.5rem}.dropdown-content ul li label input{margin:0}.selected-options{display:flex;flex-wrap:wrap;gap:0.5rem;padding:0.5rem 0;margin-top:0.25rem;background:var(--nylas-base-0)}.selected-options .selected-option{display:flex;align-items:center;gap:0.5rem;padding:4px 8px;border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-100);color:var(--nylas-base-800);font-size:16px;font-weight:500;line-height:1.5rem;letter-spacing:0.5px}.selected-options .selected-option button{background:transparent;border:none;cursor:pointer;padding:0}.selected-options .selected-option button:hover{color:var(--nylas-primary)}', pt = ft, ut = class {
|
|
71
|
+
constructor(e) {
|
|
72
|
+
y(this, e), this.selectedOptionsChanged = w(this, "selectedOptionsChanged", 7), this.name = void 0, this.label = void 0, this.options = [], this.availableOptions = this.options, this.isOpen = !1, this.ariaActivedescendant = "", this.shouldFocusFirstOption = !1;
|
|
73
|
+
}
|
|
74
|
+
componentDidRender() {
|
|
75
|
+
d("multi-select-dropdown", "componentDidRender"), this.isOpen && this.shouldFocusFirstOption && (this.ariaActivedescendant = this.availableOptions[0].value, this.focusOption(0), this.shouldFocusFirstOption = !1);
|
|
76
|
+
}
|
|
77
|
+
handleOutsideClick(e) {
|
|
78
|
+
!e.composedPath().includes(this.el) && this.isOpen && (this.isOpen = !1);
|
|
79
|
+
}
|
|
80
|
+
selectOption(e) {
|
|
81
|
+
this.availableOptions = this.availableOptions.map((n) => (n.value === e.value && (n.selected = !e.selected), n));
|
|
82
|
+
const t = this.availableOptions.filter((n) => n.selected).map((n) => n.value);
|
|
83
|
+
this.selectedOptionsChanged.emit({
|
|
84
|
+
value: t,
|
|
85
|
+
name: this.name
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
toggleDropdown() {
|
|
89
|
+
this.isOpen = !this.isOpen, this.isOpen ? this.shouldFocusFirstOption = !0 : this.ariaActivedescendant = "";
|
|
90
|
+
}
|
|
91
|
+
handleSelectButtonKeyDown(e) {
|
|
92
|
+
switch (e.key) {
|
|
93
|
+
case "ArrowDown":
|
|
94
|
+
case "Enter":
|
|
95
|
+
e.preventDefault(), this.isOpen || this.toggleDropdown();
|
|
96
|
+
break;
|
|
97
|
+
case "Escape":
|
|
98
|
+
this.isOpen = !1;
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
handleListboxKeydown(e) {
|
|
103
|
+
const t = this.availableOptions, n = t.findIndex((a) => a.value === this.ariaActivedescendant);
|
|
104
|
+
switch (e.key) {
|
|
105
|
+
case "ArrowDown":
|
|
106
|
+
case "Tab":
|
|
107
|
+
if (e.shiftKey) {
|
|
108
|
+
e.preventDefault();
|
|
109
|
+
const o = n - 1 >= 0 ? n - 1 : t.length - 1;
|
|
110
|
+
this.ariaActivedescendant = t[o].value, this.focusOption(o);
|
|
111
|
+
} else {
|
|
112
|
+
e.preventDefault();
|
|
113
|
+
const o = n + 1 < t.length ? n + 1 : 0;
|
|
114
|
+
this.ariaActivedescendant = t[o].value, this.focusOption(o);
|
|
115
|
+
}
|
|
116
|
+
break;
|
|
117
|
+
case "ArrowUp":
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
const a = n - 1 >= 0 ? n - 1 : t.length - 1;
|
|
120
|
+
this.ariaActivedescendant = t[a].value, this.focusOption(a);
|
|
121
|
+
break;
|
|
122
|
+
case "Enter":
|
|
123
|
+
e.preventDefault(), this.ariaActivedescendant && this.selectOption(t[n]);
|
|
124
|
+
break;
|
|
125
|
+
case "Escape":
|
|
126
|
+
this.isOpen = !1;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
focusOption(e) {
|
|
131
|
+
var o;
|
|
132
|
+
const t = this.availableOptions[e];
|
|
133
|
+
if (!t)
|
|
134
|
+
return;
|
|
135
|
+
const n = t.value, a = (o = this.el.shadowRoot) == null ? void 0 : o.getElementById(n);
|
|
136
|
+
a && (a.focus(), a.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
137
|
+
}
|
|
138
|
+
getSelectedOptions() {
|
|
139
|
+
return this.availableOptions.filter((e) => e.selected);
|
|
140
|
+
}
|
|
141
|
+
renderOption(e) {
|
|
142
|
+
return i("li", { key: e.value, id: e.value, role: "option", tabindex: "0", "aria-selected": e.selected ? "true" : "false", onClick: (t) => {
|
|
143
|
+
t.stopImmediatePropagation(), this.selectOption(e);
|
|
144
|
+
}, class: { selected: !!e.selected } }, i("label", { htmlFor: e.value }, i("input", { "aria-hidden": "true", id: e.value, type: "checkbox", checked: e.selected }), i("span", null, e.label)));
|
|
145
|
+
}
|
|
146
|
+
render() {
|
|
147
|
+
var e, t;
|
|
148
|
+
return i(k, { key: "4ef13670e3dfbf55e023ac7532d93c48d21f3004" }, i("div", { key: "8626f138f5be677421697067460ef76d0a7cc697", class: "dropdown", part: "msd_dropdown" }, i("label", { key: "b723c488dac91c39f285aae1a3f7928844753bf1", class: "dropdown-label" }, this.label, i("slot", { key: "5bdec320647a41de57671c75523a453ccb07af2a", name: "label-icon", "aria-hidden": "true" })), i("button", { key: "f7d7cf144ac2fec93171b5ac6cd42be4be6b5c93", part: "msd_dropdown-button", class: { dropbtn: !0, open: this.isOpen }, onClick: () => this.toggleDropdown(), "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? "true" : "false", "aria-label": this.name, onKeyDown: (n) => this.handleSelectButtonKeyDown(n) }, i("slot", { key: "021e59628b8da260b308819614297c177a666334", name: "select-icon", "aria-hidden": "true" }), i("span", { key: "4a8c921538a23abe4c7efbeb176fb806587092c9", class: "selected-option", part: "msd_dropdown-button-selected-label" }, this.getSelectedOptions().length > 1 ? `Multiple ${this.name}s selected` : ((e = this.availableOptions.filter((n) => n.selected)[0]) == null ? void 0 : e.label) ?? ((t = this.availableOptions[0]) == null ? void 0 : t.label)), i("span", { key: "fc771549d102fb27e33d128504d09fa6151154e9", class: this.isOpen ? "open" : "closed", "aria-hidden": "true" }, i("chevron-icon", { key: "bd8282695d11bcfb617da05a75d0a2335650f705", width: "16", height: "16" }))), this.isOpen ? null : i("div", { class: "selected-options" }, this.getSelectedOptions().map((n) => i("span", { class: "selected-option" }, n.label, i("button", { key: n.label, onClick: () => this.selectOption(n) }, i("close-icon", null))))), this.isOpen ? i("div", { class: "dropdown-content", part: "msd_dropdown-content" }, i("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-multiselectable": !0, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (n) => this.handleListboxKeydown(n) }, this.availableOptions.map((n) => this.renderOption(n)))) : null));
|
|
149
|
+
}
|
|
150
|
+
get el() {
|
|
151
|
+
return _(this);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
ut.style = pt;
|
|
155
|
+
const ht = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:inherit}.nylas-availability-picker{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-availability-picker .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-availability-picker .header h3{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-availability-picker .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-availability-picker .content{padding:1rem;color:var(--nylas-base-900);font-size:16px;font-family:var(--nylas-font-family)}@media screen and (max-width: 504px){.nylas-availability-picker .content{font-size:15px}}.nylas-availability-picker .content .select-timezone{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--nylas-base-200);padding-bottom:1rem;gap:1rem}.nylas-availability-picker .content .select-timezone h4{display:flex;gap:0.5rem;align-items:center;margin:0;font-size:16px;font-weight:500;line-height:20px}@media screen and (max-width: 504px){.nylas-availability-picker .content .select-timezone h4{font-size:15px}}.nylas-availability-picker .content .select-timezone select-dropdown{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.nylas-availability-picker .content .availability{display:flex;flex-direction:column;gap:1rem;padding:0 0.5rem;margin:1rem 0}@media screen and (max-width: 504px){.nylas-availability-picker .content .availability{gap:0.5rem;padding:0}}.nylas-availability-picker .content .availability .availability-day{display:grid;grid-template-columns:minmax(auto, 65px) 1fr minmax(auto, 40px);gap:1rem;align-items:baseline}@media screen and (max-width: 768px){.nylas-availability-picker .content .availability .availability-day{grid-template-columns:78px 1fr auto}}@media screen and (max-width: 504px){.nylas-availability-picker .content .availability .availability-day{display:inline-grid;gap:8px;grid-template-columns:60px 1fr auto}}.nylas-availability-picker .content .availability .availability-day .day{display:flex;gap:0.5rem;align-items:center}@media screen and (max-width: 504px){.nylas-availability-picker .content .availability .availability-day .day{gap:0.25rem}}.nylas-availability-picker .content .availability .availability-day .day input[type=checkbox]{transform:scale(1.3)}.nylas-availability-picker .content .availability .availability-day .time-ranges span.unavailable{height:48px;display:flex;align-items:center;justify-content:center}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range{display:flex;gap:1.5rem;justify-content:space-between;align-items:baseline}@media screen and (max-width: 504px){.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range{justify-content:unset;gap:0.5rem}}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range .pickers{display:flex;gap:1rem}@media screen and (max-width: 504px){.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range .pickers{gap:0.5rem}}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range .pickers span{margin-top:0.75rem}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range:not(:last-of-type){margin-bottom:1rem}.nylas-availability-picker .content .availability .availability-day .time-ranges p.error{color:var(--nylas-error)}.nylas-availability-picker .content .availability .availability-day button{border:none;background:transparent;height:40px;cursor:pointer;color:var(--nylas-base-800)}.nylas-availability-picker .content .availability .availability-day button:hover,.nylas-availability-picker .content .availability .availability-day button:active{color:var(--nylas-primary)}', bt = ht;
|
|
156
|
+
var mt = function(e, t, n, a) {
|
|
157
|
+
var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
|
|
158
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
159
|
+
s = Reflect.decorate(e, t, n, a);
|
|
160
|
+
else
|
|
161
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
162
|
+
(l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
|
|
163
|
+
return o > 3 && s && Object.defineProperty(t, n, s), s;
|
|
164
|
+
}, se = function(e, t) {
|
|
165
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
166
|
+
return Reflect.metadata(e, t);
|
|
167
|
+
};
|
|
168
|
+
const _e = class {
|
|
169
|
+
constructor(e) {
|
|
170
|
+
y(this, e), this.valueChanged = w(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.openHours = void 0, this.name = "availability", this.defaultTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.schedule = {
|
|
171
|
+
SUN: [],
|
|
172
|
+
MON: [{ start: "09:00am", end: "05:00pm" }],
|
|
173
|
+
TUE: [{ start: "09:00am", end: "05:00pm" }],
|
|
174
|
+
WED: [{ start: "09:00am", end: "05:00pm" }],
|
|
175
|
+
THU: [{ start: "09:00am", end: "05:00pm" }],
|
|
176
|
+
FRI: [{ start: "09:00am", end: "05:00pm" }],
|
|
177
|
+
SAT: []
|
|
178
|
+
}, this.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.overlapDays = {};
|
|
179
|
+
}
|
|
180
|
+
elementNameChangedHandler(e) {
|
|
181
|
+
d("nylas-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
182
|
+
}
|
|
183
|
+
configChangedHandler(e) {
|
|
184
|
+
var n, a, o;
|
|
185
|
+
const t = (n = e == null ? void 0 : e.participants) == null ? void 0 : n.find((s) => s.is_organizer);
|
|
186
|
+
t && ((a = t == null ? void 0 : t.availability) != null && a.open_hours) && this.openHoursToSchedule((o = t == null ? void 0 : t.availability) == null ? void 0 : o.open_hours);
|
|
187
|
+
}
|
|
188
|
+
scheduleChanged(e, t) {
|
|
189
|
+
var n;
|
|
190
|
+
if (e !== t) {
|
|
191
|
+
this.valueChanged.emit({
|
|
192
|
+
value: {
|
|
193
|
+
openHours: this.scheduleToOpenHours(e),
|
|
194
|
+
timezone: this.timezone
|
|
195
|
+
},
|
|
196
|
+
name: this.name
|
|
197
|
+
});
|
|
198
|
+
let a = {};
|
|
199
|
+
if (Object.keys(e).forEach((o) => {
|
|
200
|
+
const s = e[o];
|
|
201
|
+
if (s.length > 0) {
|
|
202
|
+
const l = this.getOverlaps(s);
|
|
203
|
+
l.length > 0 && (a[o] = l);
|
|
204
|
+
}
|
|
205
|
+
}), this.overlapDays = a, typeof this.internals.setFormValue != "function")
|
|
206
|
+
return;
|
|
207
|
+
if (Object.keys(a).length > 0) {
|
|
208
|
+
const o = (n = this.host.shadowRoot) == null ? void 0 : n.getElementById(Object.keys(a)[0]);
|
|
209
|
+
o && this.internals.setValidity({ customError: !0 }, "Overlapping time ranges found", o);
|
|
210
|
+
} else
|
|
211
|
+
this.internals.setValidity({ customError: !1 }), this.internals.setFormValue(JSON.stringify({
|
|
212
|
+
openHours: this.scheduleToOpenHours(this.schedule),
|
|
213
|
+
timezone: this.timezone
|
|
214
|
+
}));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
selectedOptionChangedHandler(e) {
|
|
218
|
+
const { name: t, value: n } = e.detail;
|
|
219
|
+
if (t === "timezone") {
|
|
220
|
+
if (this.timezone = n, typeof this.internals.setFormValue != "function")
|
|
221
|
+
return;
|
|
222
|
+
this.internals.setFormValue(JSON.stringify({
|
|
223
|
+
openHours: this.scheduleToOpenHours(this.schedule),
|
|
224
|
+
timezone: this.timezone
|
|
225
|
+
}));
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
connectedCallback() {
|
|
229
|
+
d("nylas-availability-picker", "connectedCallback");
|
|
230
|
+
}
|
|
231
|
+
disconnectedCallback() {
|
|
232
|
+
d("nylas-availability-picker", "disconnectedCallback");
|
|
233
|
+
}
|
|
234
|
+
componentWillLoad() {
|
|
235
|
+
d("nylas-availability-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
236
|
+
}
|
|
237
|
+
componentDidLoad() {
|
|
238
|
+
d("nylas-availability-picker", "componentDidLoad"), this.openHours && this.openHours.length > 0 && this.openHoursToSchedule(this.openHours), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(JSON.stringify({
|
|
239
|
+
openHours: this.scheduleToOpenHours(this.schedule),
|
|
240
|
+
timezone: this.timezone
|
|
241
|
+
}));
|
|
242
|
+
}
|
|
243
|
+
getOverlaps(e) {
|
|
244
|
+
let t = e.map((a, o) => ({
|
|
245
|
+
start: W(a.start),
|
|
246
|
+
end: W(a.end),
|
|
247
|
+
originalIndex: o
|
|
248
|
+
}));
|
|
249
|
+
t.sort((a, o) => a.start - o.start);
|
|
250
|
+
let n = [];
|
|
251
|
+
for (let a = 1; a < t.length; a++)
|
|
252
|
+
t[a].start < t[a - 1].end && (n.includes(t[a].originalIndex) || n.push(t[a].originalIndex), n.includes(t[a - 1].originalIndex) || n.push(t[a - 1].originalIndex));
|
|
253
|
+
return n.sort((a, o) => a - o);
|
|
254
|
+
}
|
|
255
|
+
addTimeRange(e) {
|
|
256
|
+
const t = this.schedule[e], n = 0, a = 1425;
|
|
257
|
+
if (t.length === 0)
|
|
258
|
+
this.schedule[e] = [{ start: "09:00am", end: "05:00pm" }];
|
|
259
|
+
else {
|
|
260
|
+
const o = t.map((l) => ({
|
|
261
|
+
start: W(l.start),
|
|
262
|
+
end: W(l.end)
|
|
263
|
+
})).sort((l, r) => l.start - r.start), s = o[o.length - 1].end;
|
|
264
|
+
if (s + 60 <= a)
|
|
265
|
+
this.schedule[e].push({
|
|
266
|
+
start: F(U(s)),
|
|
267
|
+
end: F(U(s + 60))
|
|
268
|
+
});
|
|
269
|
+
else {
|
|
270
|
+
let l = !1;
|
|
271
|
+
if (o[0].start > n + 60 && (this.schedule[e].push({
|
|
272
|
+
start: F(U(n)),
|
|
273
|
+
end: F(U(n + 60))
|
|
274
|
+
}), l = !0), !l)
|
|
275
|
+
for (let r = 0; r < o.length - 1; r++) {
|
|
276
|
+
const h = o[r].end;
|
|
277
|
+
if (o[r + 1].start - h >= 60) {
|
|
278
|
+
this.schedule[e].push({
|
|
279
|
+
start: F(U(h)),
|
|
280
|
+
end: F(U(h + 60))
|
|
281
|
+
});
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
this.schedule[e].sort((o, s) => W(o.start) - W(s.start)), this.schedule = { ...this.schedule };
|
|
288
|
+
}
|
|
289
|
+
removeTimeRange(e, t) {
|
|
290
|
+
this.schedule[e].splice(t, 1), this.schedule = { ...this.schedule };
|
|
291
|
+
}
|
|
292
|
+
setTime(e) {
|
|
293
|
+
console.log("timeChanged", e);
|
|
294
|
+
const { key: t, value: n } = e.detail;
|
|
295
|
+
console.log({
|
|
296
|
+
key: t,
|
|
297
|
+
value: n
|
|
298
|
+
});
|
|
299
|
+
const [a, o] = t.split("_"), [s, l] = a.split(":");
|
|
300
|
+
o === "start" ? this.schedule[s][l].start = n : o === "end" && (this.schedule[s][l].end = n), this.internals.setValidity({ customError: !1 }), this.schedule = { ...this.schedule };
|
|
301
|
+
}
|
|
302
|
+
setFormError(e) {
|
|
303
|
+
var s;
|
|
304
|
+
const { key: t } = e.detail, [n, a] = t.split("_"), o = (s = this.host.shadowRoot) == null ? void 0 : s.getElementById(t);
|
|
305
|
+
o && this.internals.setValidity({ customError: !0 }, `Invalid ${a} time`, o);
|
|
306
|
+
}
|
|
307
|
+
openHoursToSchedule(e) {
|
|
308
|
+
const t = {
|
|
309
|
+
SUN: [],
|
|
310
|
+
MON: [],
|
|
311
|
+
TUE: [],
|
|
312
|
+
WED: [],
|
|
313
|
+
THU: [],
|
|
314
|
+
FRI: [],
|
|
315
|
+
SAT: []
|
|
316
|
+
};
|
|
317
|
+
e.forEach((n) => {
|
|
318
|
+
n.days.forEach((a) => {
|
|
319
|
+
const o = this.getDayKey(a), s = F(n.start), l = F(n.end), r = { start: s, end: l };
|
|
320
|
+
let h = !1;
|
|
321
|
+
t[o] && (h = t[o].some((f) => f.start === r.start && f.end === r.end)), h || (t[o] ? t[o].push(r) : t[o] = [r]);
|
|
322
|
+
});
|
|
323
|
+
}), this.timezone = this.defaultTimezone, this.schedule = t;
|
|
324
|
+
}
|
|
325
|
+
getDayKey(e) {
|
|
326
|
+
return ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"][e];
|
|
327
|
+
}
|
|
328
|
+
scheduleToOpenHours(e) {
|
|
329
|
+
const t = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
|
|
330
|
+
let n = /* @__PURE__ */ new Map();
|
|
331
|
+
t.forEach((o, s) => {
|
|
332
|
+
e[o] && e[o].forEach((l) => {
|
|
333
|
+
const r = ge(l.start), h = ge(l.end), f = `${r}-${h}`;
|
|
334
|
+
if (!n.has(f))
|
|
335
|
+
n.set(f, { days: [s], start: r, end: h });
|
|
336
|
+
else {
|
|
337
|
+
let u = n.get(f);
|
|
338
|
+
u && (u.days.push(s), n.set(f, u));
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
let a = [];
|
|
343
|
+
return n.forEach((o, s) => {
|
|
344
|
+
a.push({
|
|
345
|
+
days: o.days,
|
|
346
|
+
start: o.start,
|
|
347
|
+
end: o.end,
|
|
348
|
+
timezone: this.timezone
|
|
349
|
+
});
|
|
350
|
+
}), a;
|
|
351
|
+
}
|
|
352
|
+
render() {
|
|
353
|
+
const e = Object.keys(ke).map((t) => ({
|
|
354
|
+
label: ke[t],
|
|
355
|
+
value: t
|
|
356
|
+
}));
|
|
357
|
+
return i(k, { key: "ebdf308b5d2e38cbbe9c01915a8704cdc137b56f" }, i("div", { key: "81557accec232465b3e86d5d0bdc1ae25aa8d6de", class: "nylas-availability-picker" }, i("div", { key: "f5c2a5ef92fc59568672b536a9e604547561b8d6", class: "header", part: "nap__header" }, i("h3", { key: "cbccae32847e68a5fe47f9f1f901e55546621c36" }, "General availability"), i("p", { key: "34600ddd459b5d681574458f4f4acdb5ed26f7ac" }, "Set your availability for scheduling meetings.")), i("div", { key: "65785316b94376cf4d79de9c875e39060226ca31", class: "content" }, i("div", { key: "5c30c0bd916460f668dc3f881b4b01a1792e59b0", class: "select-timezone", part: "nap__select-timezone" }, i("h4", { key: "0638898cae070a5d9eae8cd1dca83e39e5bb735f", class: "sub-header" }, "Select timezone", i("span", { key: "d6746b3329ba92bf5c759895444d08924ba7769c", class: "icon" }, i("tooltip-component", { key: "76dbc460bd91fa0f33a65c65ce092ad966ce6535" }, i("info-icon", { key: "5778fb41c006172a125a4430186ad85d4cdbaf3c", slot: "tooltip-icon" }), i("span", { key: "76132f33db5dce9d7d7e5e111065ad9d1ec64d3f", slot: "tooltip-content" }, "Select your timezone for displaying availability.")))), i("select-dropdown", { key: "9a0a3702b4868109ccc8f77e1143727de1e3f1fa", name: "timezone", exportparts: "sd_dropdown: nap__timezone-container, sd_dropdown-button: nap__timezone-button, sd_dropdown-content: nap__timezone-dropdown-content", options: e, defaultSelectedOption: e.find((t) => t.value === this.defaultTimezone) }, i("span", { key: "ed0756090602c8a52ffdae493f09cfa7d61dd1e9", slot: "select-icon" }, i("globe-icon", { key: "6e5e5234210ba8cc50ef57338a2f4e926521cb70", width: "20", height: "20" })))), i("div", { key: "eac4322bf2aa8f5ea84e4d7ccee293803c70b2ac", class: "availability", part: "nap__availability" }, Object.keys(this.schedule).map((t) => {
|
|
358
|
+
const n = t, a = this.schedule[t];
|
|
359
|
+
return i("div", { class: "availability-day" }, i("div", { class: "day", part: "nap__day" }, i("input", { type: "checkbox", name: n, id: n, checked: a.length > 0, onClick: () => {
|
|
360
|
+
a.length > 0 ? this.schedule[n] = [] : this.schedule[n] = [{ start: "09:00am", end: "05:00pm" }], this.schedule = { ...this.schedule };
|
|
361
|
+
} }), i("label", { htmlFor: n, "aria-label": "Select day" }, n)), i("div", { class: "time-ranges", part: "nap__time-ranges" }, a.length ? null : i("span", { class: "unavailable" }, "Unavailable"), a.length > 0 && a.map((o, s) => {
|
|
362
|
+
var h, f;
|
|
363
|
+
const l = `${t}:${s}_start`, r = `${t}:${s}_end`;
|
|
364
|
+
return i("div", { class: "time-range", part: "nap__time-range" }, i("div", { class: "pickers" }, i("nylas-time-window-picker", { id: l, hasError: (h = this.overlapDays[n]) == null ? void 0 : h.includes(s), time: o.start, name: l, key: l, exportparts: "time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times" }), i("span", null, " - "), i("nylas-time-window-picker", { id: r, hasError: (f = this.overlapDays[n]) == null ? void 0 : f.includes(s), time: o.end, name: r, key: r, minimumStartTime: o.start, exportparts: "time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times" })), i("button", { onClick: () => this.removeTimeRange(n, s) }, i("close-icon", null)));
|
|
365
|
+
}), i("p", { class: "error" }, this.overlapDays[n] ? "Overlapping time ranges" : "")), i("div", null, a.length > 0 ? i("button", { onClick: () => this.addTimeRange(n), part: "nap__add-time-range" }, i("add-circle-icon", null)) : null));
|
|
366
|
+
})))));
|
|
367
|
+
}
|
|
368
|
+
static get formAssociated() {
|
|
369
|
+
return !0;
|
|
370
|
+
}
|
|
371
|
+
get host() {
|
|
372
|
+
return _(this);
|
|
373
|
+
}
|
|
374
|
+
static get watchers() {
|
|
375
|
+
return {
|
|
376
|
+
name: ["elementNameChangedHandler"],
|
|
377
|
+
selectedConfiguration: ["configChangedHandler"],
|
|
378
|
+
schedule: ["scheduleChanged"]
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
mt([
|
|
383
|
+
C({
|
|
384
|
+
name: "nylas-availability-picker",
|
|
385
|
+
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
|
|
386
|
+
fireRegisterEvent: !0
|
|
387
|
+
}),
|
|
388
|
+
se("design:type", Function),
|
|
389
|
+
se("design:paramtypes", []),
|
|
390
|
+
se("design:returntype", void 0)
|
|
391
|
+
], _e.prototype, "render", null);
|
|
392
|
+
_e.style = bt;
|
|
393
|
+
const yt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:inherit}.nylas-booking-calendar-picker{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-booking-calendar-picker .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-booking-calendar-picker .header h3{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-booking-calendar-picker .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__loading{padding-bottom:1rem;display:flex;flex-direction:column;gap:4px}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__loading .label{display:flex;align-items:center;gap:0.5rem;margin:1rem 1rem 0;color:var(--nylas-base-800)}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__loading .loading-button{margin:0 1rem;padding:0;width:inherit;height:48px;color:black;font-size:1rem;cursor:not-allowed;display:flex;gap:0.5rem;justify-content:space-between;align-items:center;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__loading .loading-button span{padding:0 1rem}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown{padding:1rem;display:flex;flex-direction:column;gap:4px}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown span.label{display:flex;align-items:center;gap:4px;color:var(--nylas-base-800)}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown span.label tooltip-component{display:flex}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown select-dropdown::part(sd_dropdown){width:100%}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown select-dropdown::part(sd_dropdown-content){width:100%;max-width:unset}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown select-dropdown::part(sd_dropdown-button){width:100%;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:1rem}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown select-dropdown::part(sd_dropdown-button-selected-label){max-width:calc(100% - 2rem);font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', gt = yt;
|
|
394
|
+
var vt = function(e, t, n, a) {
|
|
395
|
+
var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
|
|
396
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
397
|
+
s = Reflect.decorate(e, t, n, a);
|
|
398
|
+
else
|
|
399
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
400
|
+
(l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
|
|
401
|
+
return o > 3 && s && Object.defineProperty(t, n, s), s;
|
|
402
|
+
}, oe = function(e, t) {
|
|
403
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
404
|
+
return Reflect.metadata(e, t);
|
|
405
|
+
};
|
|
406
|
+
const Ce = class {
|
|
407
|
+
constructor(e) {
|
|
408
|
+
y(this, e), this.valueChanged = w(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.calendars = void 0, this.currentUser = void 0, this.name = "booking-calendar", this.defaultBookingCalendar = "", this.selectedCalendar = "";
|
|
409
|
+
}
|
|
410
|
+
connectedCallback() {
|
|
411
|
+
d("nylas-booking-calendar-picker", "connectedCallback");
|
|
412
|
+
}
|
|
413
|
+
disconnectedCallback() {
|
|
414
|
+
d("nylas-booking-calendar-picker", "disconnectedCallback");
|
|
415
|
+
}
|
|
416
|
+
componentWillLoad() {
|
|
417
|
+
d("nylas-booking-calendar-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
418
|
+
}
|
|
419
|
+
componentDidLoad() {
|
|
420
|
+
var e, t;
|
|
421
|
+
d("nylas-booking-calendar-picker", "componentDidLoad"), this.defaultBookingCalendar = this.defaultBookingCalendar || ((e = this.currentUser) == null ? void 0 : e.email) || "", typeof this.internals.setFormValue == "function" && this.internals.setFormValue(this.defaultBookingCalendar.toString(), "booking-calendar"), this.selectedCalendar = this.defaultBookingCalendar || ((t = this.currentUser) == null ? void 0 : t.email) || "";
|
|
422
|
+
}
|
|
423
|
+
componentWillUpdate() {
|
|
424
|
+
d("nylas-booking-calendar-picker", "componentWillUpdate");
|
|
425
|
+
}
|
|
426
|
+
componentDidUpdate() {
|
|
427
|
+
d("nylas-booking-calendar-picker", "componentDidUpdate");
|
|
428
|
+
}
|
|
429
|
+
componentWillRender() {
|
|
430
|
+
d("nylas-booking-calendar-picker", "componentWillRender");
|
|
431
|
+
}
|
|
432
|
+
componentDidRender() {
|
|
433
|
+
d("nylas-booking-calendar-picker", "componentDidRender");
|
|
434
|
+
}
|
|
435
|
+
elementNameChangedHandler(e) {
|
|
436
|
+
d("nylas-booking-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
437
|
+
}
|
|
438
|
+
selectedOptionChangedHandler(e) {
|
|
439
|
+
d("nylas-booking-calendar-picker", "selectedOptionChangedHandler", e.detail);
|
|
440
|
+
const t = (n) => {
|
|
441
|
+
const { value: a } = n.detail;
|
|
442
|
+
this.selectedCalendar = a, this.internals.setFormValue(a.toString(), this.name);
|
|
443
|
+
};
|
|
444
|
+
this.valueChanged.emit({ value: e.detail.value, name: this.name, valueChanged: t });
|
|
445
|
+
}
|
|
446
|
+
render() {
|
|
447
|
+
var t;
|
|
448
|
+
const e = ((t = this.calendars) == null ? void 0 : t.map((n) => ({
|
|
449
|
+
value: n.id,
|
|
450
|
+
label: n.name
|
|
451
|
+
}))) ?? [];
|
|
452
|
+
return i(k, null, i("div", { class: "nylas-booking-calendar-picker", part: "nbcp" }, i("div", { class: "header", part: "nbcp__header" }, i("h3", null, "Calendar booking"), i("p", null, "Choose calendar where you’d like the event bookings to show up.")), e.length > 0 ? i("div", { class: "nylas-booking-calendar-picker__dropdown" }, i("span", { class: "label", part: "nbcp__input-label" }, "Select a calendar to book meetings on", i("tooltip-component", null, i("info-icon", { slot: "tooltip-icon" }), i("span", { slot: "tooltip-content" }, "Check availability across one or multiple calendars. If multiple calendars are selected, you must be available across all of them to be considered available."))), i("select-dropdown", { name: "booking-calendar", options: e, withSearch: !1, exportparts: "sd_dropdown: nbcp__dropdown, sd_dropdown-button: nbcp__dropdown-button, sd_dropdown-content: nbcp__dropdown-content", defaultSelectedOption: e.find((n) => n.value == this.defaultBookingCalendar) ?? e[0] })) : i("div", { class: "nylas-booking-calendar-picker__loading" }, i("span", { class: "label" }, "Select a calendar to book meetings on ", i("info-icon", null)), i("div", { class: "loading-button" }, i("span", null, "Loading...")))));
|
|
453
|
+
}
|
|
454
|
+
static get formAssociated() {
|
|
455
|
+
return !0;
|
|
456
|
+
}
|
|
457
|
+
get host() {
|
|
458
|
+
return _(this);
|
|
459
|
+
}
|
|
460
|
+
static get watchers() {
|
|
461
|
+
return {
|
|
462
|
+
name: ["elementNameChangedHandler"]
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
vt([
|
|
467
|
+
C({
|
|
468
|
+
name: "nylas-booking-calendar-picker",
|
|
469
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
470
|
+
["schedulerConfig.calendars", "calendars"],
|
|
471
|
+
["schedulerConfig.currentUser", "currentUser"]
|
|
472
|
+
]),
|
|
473
|
+
eventToProps: {
|
|
474
|
+
valueChanged: async (e, t) => {
|
|
475
|
+
const { valueChanged: n } = e.detail;
|
|
476
|
+
n && n(e);
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
fireRegisterEvent: !0
|
|
480
|
+
}),
|
|
481
|
+
oe("design:type", Function),
|
|
482
|
+
oe("design:paramtypes", []),
|
|
483
|
+
oe("design:returntype", void 0)
|
|
484
|
+
], Ce.prototype, "render", null);
|
|
485
|
+
Ce.style = gt;
|
|
486
|
+
const xt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:inherit}.nylas-buffer-time{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200);text-align:left}.nylas-buffer-time .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-buffer-time .header h3{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-buffer-time .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-buffer-time .nylas-buffer-time__body{display:grid;grid-template-columns:1fr auto}@media screen and (max-width: 768px){.nylas-buffer-time .nylas-buffer-time__body{grid-template-columns:1fr}}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__dropdown{padding:1rem;display:flex;flex-direction:column;gap:1rem;border-right:1px solid var(--nylas-base-200);color:var(--nylas-base-800)}@media screen and (max-width: 768px){.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__dropdown{border:none}}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__dropdown .nylas-buffer-time__row{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:1rem}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__dropdown .nylas-buffer-time__row label{width:200px}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__dropdown .nylas-buffer-time__row .dropdown-container{display:flex;gap:1rem;align-items:center;justify-content:flex-end}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview{width:208px;background:var(--nylas-base-25);border-bottom-right-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview{width:inherit;border-bottom-left-radius:var(--nylas-border-radius-2x)}}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview h4{font-size:14px;line-height:24px;color:var(--nylas-base-600);font-family:var(--nylas-font-family);font-weight:500;text-align:center;margin:0.75rem 0}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview .preview-container{padding:0 2rem 1rem}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview .preview-container .slot{background-color:transparent;border-top:1px solid var(--nylas-base-300)}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview .preview-container .slot.active{background-color:var(--nylas-base-100)}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview .preview-container .slot:last-of-type{border-bottom:1px solid var(--nylas-base-300)}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview .preview-container .event-slot{background-color:var(--nylas-base-600);border-top:1px solid var(--nylas-base-300)}.nylas-buffer-time .nylas-buffer-time__dropdown select-dropdown::part(sd_dropdown-button){width:104px;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:1rem}.nylas-buffer-time .nylas-buffer-time__dropdown select-dropdown::part(sd_dropdown-content){width:100%}.nylas-buffer-time .nylas-buffer-time__dropdown select-dropdown::part(sd_dropdown-button-selected-label){max-width:calc(100% - 2rem);font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', kt = xt;
|
|
487
|
+
var wt = function(e, t, n, a) {
|
|
488
|
+
var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
|
|
489
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
490
|
+
s = Reflect.decorate(e, t, n, a);
|
|
491
|
+
else
|
|
492
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
493
|
+
(l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
|
|
494
|
+
return o > 3 && s && Object.defineProperty(t, n, s), s;
|
|
495
|
+
}, le = function(e, t) {
|
|
496
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
497
|
+
return Reflect.metadata(e, t);
|
|
498
|
+
};
|
|
499
|
+
const Te = class {
|
|
500
|
+
constructor(e) {
|
|
501
|
+
y(this, e), this.valueChanged = w(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 = "buffer-time", this.buffer = { before: 0, after: 0 }, this.selectedBeforeBufferTime = this.buffer.before, this.selectedAfterBufferTime = this.buffer.after;
|
|
502
|
+
}
|
|
503
|
+
connectedCallback() {
|
|
504
|
+
d("nylas-buffer-time", "connectedCallback");
|
|
505
|
+
}
|
|
506
|
+
disconnectedCallback() {
|
|
507
|
+
d("nylas-buffer-time", "disconnectedCallback");
|
|
508
|
+
}
|
|
509
|
+
componentWillLoad() {
|
|
510
|
+
d("nylas-buffer-time", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
511
|
+
}
|
|
512
|
+
componentDidLoad() {
|
|
513
|
+
if (d("nylas-buffer-time", "componentDidLoad"), typeof this.internals.setFormValue == "function") {
|
|
514
|
+
const e = {
|
|
515
|
+
before: this.selectedBeforeBufferTime,
|
|
516
|
+
after: this.selectedAfterBufferTime
|
|
517
|
+
};
|
|
518
|
+
this.internals.setFormValue(JSON.stringify(e), this.name);
|
|
519
|
+
}
|
|
520
|
+
this.selectedAfterBufferTime = this.buffer.after, this.selectedBeforeBufferTime = this.buffer.before;
|
|
521
|
+
}
|
|
522
|
+
componentWillUpdate() {
|
|
523
|
+
d("nylas-buffer-time", "componentWillUpdate");
|
|
524
|
+
}
|
|
525
|
+
componentDidUpdate() {
|
|
526
|
+
d("nylas-buffer-time", "componentDidUpdate");
|
|
527
|
+
}
|
|
528
|
+
componentWillRender() {
|
|
529
|
+
d("nylas-buffer-time", "componentWillRender");
|
|
530
|
+
}
|
|
531
|
+
componentDidRender() {
|
|
532
|
+
d("nylas-buffer-time", "componentDidRender");
|
|
533
|
+
}
|
|
534
|
+
elementNameChangedHandler(e) {
|
|
535
|
+
d("nylas-buffer-time", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
536
|
+
}
|
|
537
|
+
selectedOptionChangedHandler(e) {
|
|
538
|
+
d("nylas-buffer-time", "selectedOptionChangedHandler", e.detail);
|
|
539
|
+
const t = (n) => {
|
|
540
|
+
const { value: a, name: o } = n.detail;
|
|
541
|
+
o === "before-buffer-time" ? this.selectedBeforeBufferTime = parseInt(a) : o === "after-buffer-time" && (this.selectedAfterBufferTime = parseInt(a));
|
|
542
|
+
const s = {
|
|
543
|
+
before: this.selectedBeforeBufferTime,
|
|
544
|
+
after: this.selectedAfterBufferTime
|
|
545
|
+
};
|
|
546
|
+
this.internals.setFormValue(JSON.stringify(s), "booking-calendar");
|
|
547
|
+
};
|
|
548
|
+
this.valueChanged.emit({ ...e.detail, valueChanged: t });
|
|
549
|
+
}
|
|
550
|
+
renderPreview() {
|
|
551
|
+
const a = (l) => {
|
|
552
|
+
const r = Math.floor(l / 30), h = l % 30 / 30 * 10;
|
|
553
|
+
return {
|
|
554
|
+
fullSlots: r,
|
|
555
|
+
partialFillHeight: h
|
|
556
|
+
};
|
|
557
|
+
}, o = () => {
|
|
558
|
+
const { fullSlots: l, partialFillHeight: r } = a(this.selectedBeforeBufferTime);
|
|
559
|
+
return Array.from({ length: 4 }, (h, f) => {
|
|
560
|
+
const u = this.selectedBeforeBufferTime > 0 && f > 4 - l - 1, g = this.selectedBeforeBufferTime > 0 && f === 4 - l - 1 && r > 0;
|
|
561
|
+
let v = {};
|
|
562
|
+
return u && !g ? v.backgroundColor = "var(--nylas-base-100)" : g && (v.background = `linear-gradient(to top, var(--nylas-base-100) ${r}px, transparent 0)`), i("div", { key: f, class: `slot ${u ? "active" : ""}`, style: {
|
|
563
|
+
height: "10px",
|
|
564
|
+
...v
|
|
565
|
+
} });
|
|
566
|
+
});
|
|
567
|
+
}, s = () => {
|
|
568
|
+
const { fullSlots: l, partialFillHeight: r } = a(this.selectedAfterBufferTime);
|
|
569
|
+
return Array.from({ length: 4 }, (h, f) => {
|
|
570
|
+
const u = this.selectedAfterBufferTime > 0 && f < l, g = f === l && r > 0;
|
|
571
|
+
let v = {};
|
|
572
|
+
return u && !g ? v.backgroundColor = "var(--nylas-base-100)" : g && (v.background = `linear-gradient(to bottom, var(--nylas-base-100) ${r}px, transparent 0)`), i("div", { key: f, class: `slot ${u ? "active" : ""}`, style: {
|
|
573
|
+
height: "10px",
|
|
574
|
+
...v
|
|
575
|
+
} });
|
|
576
|
+
});
|
|
577
|
+
};
|
|
578
|
+
return i("div", { class: "preview-container" }, o(), i("div", { class: "event-slot", style: { height: "20px" } }), s());
|
|
579
|
+
}
|
|
580
|
+
render() {
|
|
581
|
+
const e = Array.from({ length: 24 }, (t, n) => {
|
|
582
|
+
const a = (n + 1) * 5;
|
|
583
|
+
return {
|
|
584
|
+
label: a.toString(),
|
|
585
|
+
value: a
|
|
586
|
+
};
|
|
587
|
+
});
|
|
588
|
+
return i(k, null, i("div", { class: "nylas-buffer-time", part: "nbt" }, i("div", { class: "header", part: "nbt__header" }, i("h3", null, "Buffer time"), i("p", null, "Add buffer time before and after the event.")), i("div", { class: "nylas-buffer-time__body", part: "nbt__body" }, i("div", { class: "nylas-buffer-time__dropdown" }, i("div", { class: "nylas-buffer-time__row" }, i("label", null, "Before the event"), i("div", { class: "dropdown-container" }, i("select-dropdown", { id: "before-buffer-time", withSearch: !1, name: "before-buffer-time", exportparts: "sd_dropdown: nbt__dropdown-before, sd_dropdown-button: nbt__dropdown-button-before, sd_dropdown-content: nbt__dropdown-content-before", options: e, defaultSelectedOption: e.find((t) => t.value == this.selectedBeforeBufferTime) ?? e[0] }), i("span", null, "mins"))), i("div", { class: "nylas-buffer-time__row" }, i("label", null, "After the event"), i("div", { class: "dropdown-container" }, i("select-dropdown", { id: "after-buffer-time", withSearch: !1, name: "after-buffer-time", exportparts: "sd_dropdown: nbt__dropdown-after, sd_dropdown-button: nbt__dropdown-button-after, sd_dropdown-content: nbt__dropdown-content-after", options: e, defaultSelectedOption: e.find((t) => t.value == this.selectedAfterBufferTime) ?? e[0] }), i("span", null, "mins")))), i("div", { class: "nylas-buffer-time__preview", part: "nbt__preview" }, i("h4", null, "PREVIEW"), this.renderPreview()))));
|
|
589
|
+
}
|
|
590
|
+
static get formAssociated() {
|
|
591
|
+
return !0;
|
|
592
|
+
}
|
|
593
|
+
get host() {
|
|
594
|
+
return _(this);
|
|
595
|
+
}
|
|
596
|
+
static get watchers() {
|
|
597
|
+
return {
|
|
598
|
+
name: ["elementNameChangedHandler"]
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
wt([
|
|
603
|
+
C({
|
|
604
|
+
name: "nylas-buffer-time",
|
|
605
|
+
eventToProps: {
|
|
606
|
+
valueChanged: async (e, t) => {
|
|
607
|
+
const { valueChanged: n } = e.detail;
|
|
608
|
+
n && n(e);
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
fireRegisterEvent: !0
|
|
612
|
+
}),
|
|
613
|
+
le("design:type", Function),
|
|
614
|
+
le("design:paramtypes", []),
|
|
615
|
+
le("design:returntype", void 0)
|
|
616
|
+
], Te.prototype, "render", null);
|
|
617
|
+
Te.style = kt;
|
|
618
|
+
const _t = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:inherit}.nylas-calendar-picker{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-calendar-picker .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-calendar-picker .header h3{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-calendar-picker .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-calendar-picker .nylas-calendar-picker__loading{padding-bottom:1rem;display:flex;flex-direction:column;gap:4px}.nylas-calendar-picker .nylas-calendar-picker__loading .label{display:flex;align-items:center;gap:0.5rem;margin:1rem 1rem 0;color:var(--nylas-base-800)}.nylas-calendar-picker .nylas-calendar-picker__loading .label tooltip-component{display:flex}.nylas-calendar-picker .nylas-calendar-picker__loading .loading-button{margin:0 1rem;padding:0;width:inherit;height:48px;color:black;font-size:1rem;cursor:not-allowed;display:flex;gap:0.5rem;justify-content:space-between;align-items:center;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.nylas-calendar-picker .nylas-calendar-picker__loading .loading-button span{padding:0 1rem}.nylas-calendar-picker .nylas-calendar-picker__dropdown{padding:1rem}.nylas-calendar-picker .nylas-calendar-picker__dropdown multi-select-dropdown::part(msd_dropdown){width:100%;display:flex;flex-direction:column;gap:4px}.nylas-calendar-picker .nylas-calendar-picker__dropdown multi-select-dropdown::part(msd_dropdown-button){width:100%;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:1rem}.nylas-calendar-picker .nylas-calendar-picker__dropdown multi-select-dropdown::part(msd_dropdown-content){width:100%;max-width:unset}.nylas-calendar-picker .nylas-calendar-picker__dropdown multi-select-dropdown::part(msd_dropdown-button-selected-label){max-width:calc(100% - 2rem);font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', Ct = _t;
|
|
619
|
+
var Tt = function(e, t, n, a) {
|
|
620
|
+
var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
|
|
621
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
622
|
+
s = Reflect.decorate(e, t, n, a);
|
|
623
|
+
else
|
|
624
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
625
|
+
(l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
|
|
626
|
+
return o > 3 && s && Object.defineProperty(t, n, s), s;
|
|
627
|
+
}, re = function(e, t) {
|
|
628
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
629
|
+
return Reflect.metadata(e, t);
|
|
630
|
+
};
|
|
631
|
+
const Ee = class {
|
|
632
|
+
constructor(e) {
|
|
633
|
+
y(this, e), this.valueChanged = w(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.calendars = void 0, this.currentUser = void 0, this.name = "calendar", this.defaultSelectedCalendars = [], this.selectedCalendars = [];
|
|
634
|
+
}
|
|
635
|
+
elementNameChangedHandler(e) {
|
|
636
|
+
d("nylas-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
637
|
+
}
|
|
638
|
+
connectedCallback() {
|
|
639
|
+
d("nylas-calendar-picker", "connectedCallback");
|
|
640
|
+
}
|
|
641
|
+
disconnectedCallback() {
|
|
642
|
+
d("nylas-calendar-picker", "disconnectedCallback");
|
|
643
|
+
}
|
|
644
|
+
componentWillLoad() {
|
|
645
|
+
d("nylas-calendar-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
646
|
+
}
|
|
647
|
+
componentDidLoad() {
|
|
648
|
+
d("nylas-calendar-picker", "componentDidLoad"), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(this.defaultSelectedCalendars.toString(), "calendar");
|
|
649
|
+
}
|
|
650
|
+
componentWillUpdate() {
|
|
651
|
+
d("nylas-calendar-picker", "componentWillUpdate");
|
|
652
|
+
}
|
|
653
|
+
componentDidUpdate() {
|
|
654
|
+
d("nylas-calendar-picker", "componentDidUpdate");
|
|
655
|
+
}
|
|
656
|
+
componentWillRender() {
|
|
657
|
+
d("nylas-calendar-picker", "componentWillRender");
|
|
658
|
+
}
|
|
659
|
+
componentDidRender() {
|
|
660
|
+
d("nylas-calendar-picker", "componentDidRender");
|
|
661
|
+
}
|
|
662
|
+
selectedOptionsChangedHandler(e) {
|
|
663
|
+
d("nylas-calendar-picker", "selectedOptionChangedHandler", e.detail);
|
|
664
|
+
const t = (n) => {
|
|
665
|
+
const { value: a } = n.detail;
|
|
666
|
+
this.selectedCalendars = [...a], this.internals.setFormValue(a.toString(), "calendar");
|
|
667
|
+
};
|
|
668
|
+
this.valueChanged.emit({ ...e.detail, name: this.name, valueChangedHandler: t });
|
|
669
|
+
}
|
|
670
|
+
render() {
|
|
671
|
+
var t;
|
|
672
|
+
const e = ((t = this.calendars) == null ? void 0 : t.map((n) => {
|
|
673
|
+
var a, o, s, l;
|
|
674
|
+
return {
|
|
675
|
+
value: n.id,
|
|
676
|
+
label: n.name,
|
|
677
|
+
selected: ((a = this.defaultSelectedCalendars) == null ? void 0 : a.includes(n.id)) || ((o = this.defaultSelectedCalendars) != null && o.includes("primary") || ((s = this.defaultSelectedCalendars) == null ? void 0 : s.length) === 0 ? n.id === ((l = this.currentUser) == null ? void 0 : l.email) : !1)
|
|
678
|
+
};
|
|
679
|
+
})) ?? [];
|
|
680
|
+
return i(k, null, i("div", { class: "nylas-calendar-picker", part: "ncp" }, i("div", { class: "header", part: "ncp__header" }, i("h3", null, "Calendar availability"), i("p", null, "Select calendars that you’d like to use for checking your availability.")), e.length > 0 ? i("div", { class: "nylas-calendar-picker__dropdown" }, i("multi-select-dropdown", { name: "calendar", label: "Select calendars that will be checked for availability", options: e, exportparts: "msd__dropdown: ncp__dropdown, msd__dropdown-button: ncp__dropdown-button, msd__dropdown-content: ncp__dropdown-content" }, i("span", { slot: "label-icon" }, i("tooltip-component", null, i("info-icon", { slot: "tooltip-icon" }), i("span", { slot: "tooltip-content" }, "Check availability across one or multiple calendars. If multiple calendars are selected, you must be available across all of them to be considered available. The default is your primary calendar if none are selected."))))) : i("div", { class: "nylas-calendar-picker__loading" }, i("span", { class: "label" }, "Select calendars that will be checked for availability ", i("info-icon", null)), i("div", { class: "loading-button" }, i("span", null, "Loading...")))));
|
|
681
|
+
}
|
|
682
|
+
static get formAssociated() {
|
|
683
|
+
return !0;
|
|
684
|
+
}
|
|
685
|
+
get host() {
|
|
686
|
+
return _(this);
|
|
687
|
+
}
|
|
688
|
+
static get watchers() {
|
|
689
|
+
return {
|
|
690
|
+
name: ["elementNameChangedHandler"]
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
Tt([
|
|
695
|
+
C({
|
|
696
|
+
name: "nylas-calendar-picker",
|
|
697
|
+
stateToProps: /* @__PURE__ */ new Map([
|
|
698
|
+
["schedulerConfig.calendars", "calendars"],
|
|
699
|
+
["schedulerConfig.currentUser", "currentUser"]
|
|
700
|
+
]),
|
|
701
|
+
eventToProps: {
|
|
702
|
+
valueChanged: async (e, t) => {
|
|
703
|
+
const { valueChangedHandler: n } = e.detail;
|
|
704
|
+
n && n(e);
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
fireRegisterEvent: !0
|
|
708
|
+
}),
|
|
709
|
+
re("design:type", Function),
|
|
710
|
+
re("design:paramtypes", []),
|
|
711
|
+
re("design:returntype", void 0)
|
|
712
|
+
], Ee.prototype, "render", null);
|
|
713
|
+
Ee.style = Ct;
|
|
714
|
+
const Et = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-description{display:flex;flex-direction:column;gap:4px}.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}', Ot = Et;
|
|
715
|
+
var St = function(e, t, n, a) {
|
|
716
|
+
var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
|
|
717
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
718
|
+
s = Reflect.decorate(e, t, n, a);
|
|
719
|
+
else
|
|
720
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
721
|
+
(l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
|
|
722
|
+
return o > 3 && s && Object.defineProperty(t, n, s), s;
|
|
723
|
+
}, de = function(e, t) {
|
|
724
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
725
|
+
return Reflect.metadata(e, t);
|
|
726
|
+
};
|
|
727
|
+
const Oe = class {
|
|
728
|
+
constructor(e) {
|
|
729
|
+
var t, n;
|
|
730
|
+
y(this, e), this.valueChanged = w(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 = void 0, this.name = "description", this.description = this.eventDescription || ((n = (t = this.selectedConfiguration) == null ? void 0 : t.event_booking) == null ? void 0 : n.description) || "";
|
|
731
|
+
}
|
|
732
|
+
elementNameChangedHandler(e) {
|
|
733
|
+
d("nylas-event-description", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
734
|
+
}
|
|
735
|
+
selectedConfigurationChangedHandler(e, t) {
|
|
736
|
+
var n, a;
|
|
737
|
+
d("nylas-custom-booking-flow", "selectedConfigurationChangedHandler", e, t), (n = e == null ? void 0 : e.event_booking) != null && n.description && (this.description = (a = e == null ? void 0 : e.event_booking) == null ? void 0 : a.description);
|
|
738
|
+
}
|
|
739
|
+
connectedCallback() {
|
|
740
|
+
d("nylas-event-description", "connectedCallback");
|
|
741
|
+
}
|
|
742
|
+
componentWillLoad() {
|
|
743
|
+
d("nylas-event-description", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
744
|
+
}
|
|
745
|
+
componentDidLoad() {
|
|
746
|
+
d("nylas-event-description", "componentDidLoad");
|
|
747
|
+
}
|
|
748
|
+
disconnectedCallback() {
|
|
749
|
+
d("nylas-event-description", "disconnectedCallback");
|
|
750
|
+
}
|
|
751
|
+
handleChange(e) {
|
|
752
|
+
this.description = e.target.value, this.internals.setFormValue(e.target.value, "description"), this.valueChanged.emit({ value: e.target.value, name: this.name });
|
|
753
|
+
}
|
|
754
|
+
render() {
|
|
755
|
+
return i(k, { key: "0a1db83797453d80a3fe368c46c7c0419751ae96" }, i("div", { key: "cb041dfd5f60a1d6969f9dd3b66bf07a30ead95d", class: "nylas-event-description", part: "nedesc" }, i("label", { key: "f038f2c325d054408d1c4ba2ec046d811abc1b28", htmlFor: "description" }, "Event description", i("span", { key: "b458c9fc9a283455065612b23888cf4257f7d163", class: "label-icon" }, i("tooltip-component", { key: "556fe837419cb336758136e93b91485a7900ed43" }, i("info-icon", { key: "ac64baf6ce1f98d924a30f5fda5457f2553201a6", slot: "tooltip-icon" }), i("span", { key: "f7c463ba89a295e3791d1c7eadc0050b925eeeb4", slot: "tooltip-content" }, "Provide any additional details for your event.")))), i("textarea", { key: "254cca296ff7e4b92626348945834a97d0d593fd", id: "description", part: "nedesc__textarea", name: "description", value: this.description, maxlength: "8192", onInput: (e) => this.handleChange(e) })));
|
|
756
|
+
}
|
|
757
|
+
static get formAssociated() {
|
|
758
|
+
return !0;
|
|
759
|
+
}
|
|
760
|
+
get host() {
|
|
761
|
+
return _(this);
|
|
762
|
+
}
|
|
763
|
+
static get watchers() {
|
|
764
|
+
return {
|
|
765
|
+
name: ["elementNameChangedHandler"],
|
|
766
|
+
selectedConfiguration: ["selectedConfigurationChangedHandler"]
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
St([
|
|
771
|
+
C({
|
|
772
|
+
name: "nylas-event-description",
|
|
773
|
+
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
|
|
774
|
+
eventToProps: {},
|
|
775
|
+
fireRegisterEvent: !0
|
|
776
|
+
}),
|
|
777
|
+
de("design:type", Function),
|
|
778
|
+
de("design:paramtypes", []),
|
|
779
|
+
de("design:returntype", void 0)
|
|
780
|
+
], Oe.prototype, "render", null);
|
|
781
|
+
Oe.style = Ot;
|
|
782
|
+
const Dt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-duration{display:flex;flex-direction:column;gap:4px}.nylas-event-duration 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-duration label span.required{color:var(--nylas-error, #cc4841)}.nylas-event-duration label span.label-icon{margin-left:4px}.nylas-event-duration label span.label-icon tooltip-component{display:flex}.nylas-event-duration__wrapper{display:flex;align-items:center;gap:0.5rem}.nylas-event-duration__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-event-duration__wrapper select-dropdown::part(sd_dropdown-button){border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:12px 16px}.nylas-event-duration__wrapper select-dropdown::part(sd_dropdown-button-selected-label){font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', It = Dt;
|
|
783
|
+
var Lt = function(e, t, n, a) {
|
|
784
|
+
var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
|
|
785
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
786
|
+
s = Reflect.decorate(e, t, n, a);
|
|
787
|
+
else
|
|
788
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
789
|
+
(l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
|
|
790
|
+
return o > 3 && s && Object.defineProperty(t, n, s), s;
|
|
791
|
+
}, ce = function(e, t) {
|
|
792
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
793
|
+
return Reflect.metadata(e, t);
|
|
794
|
+
};
|
|
795
|
+
const Se = class {
|
|
796
|
+
constructor(e) {
|
|
797
|
+
y(this, e), this.valueChanged = w(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.name = "duration", this.eventDurationMinutes = void 0, this.duration = this.eventDurationMinutes ? this.eventDurationMinutes >= 60 ? this.eventDurationMinutes / 60 : this.eventDurationMinutes : 5, this.durationMinutes = this.eventDurationMinutes ?? 5, this.durationIncrement = this.eventDurationMinutes && this.eventDurationMinutes >= 60 ? 60 : 1;
|
|
798
|
+
}
|
|
799
|
+
elementNameChangedHandler(e) {
|
|
800
|
+
d("nylas-event-duration", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
801
|
+
}
|
|
802
|
+
selectedConfigurationChangedHandler(e) {
|
|
803
|
+
var n;
|
|
804
|
+
const t = (n = e == null ? void 0 : e.availability) == null ? void 0 : n.duration_minutes;
|
|
805
|
+
t && (this.duration = t >= 60 ? t / 60 : t, this.durationMinutes = t ?? 5, this.durationIncrement = t >= 60 ? 60 : 1);
|
|
806
|
+
}
|
|
807
|
+
durationMinutesChangedHandler(e, t) {
|
|
808
|
+
d("nylas-event-duration", "durationMinutesChangedHandler", e), e !== t && this.valueChanged.emit({ value: e.toString(), name: this.name });
|
|
809
|
+
}
|
|
810
|
+
connectedCallback() {
|
|
811
|
+
d("nylas-event-duration", "connectedCallback");
|
|
812
|
+
}
|
|
813
|
+
componentWillLoad() {
|
|
814
|
+
d("nylas-event-duration", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
815
|
+
}
|
|
816
|
+
componentDidLoad() {
|
|
817
|
+
d("nylas-event-duration", "componentDidLoad"), this.internals.setFormValue(this.durationMinutes.toString(), "duration");
|
|
818
|
+
}
|
|
819
|
+
disconnectedCallback() {
|
|
820
|
+
d("nylas-event-duration", "disconnectedCallback");
|
|
821
|
+
}
|
|
822
|
+
handleChange(e) {
|
|
823
|
+
this.duration = e.target.value, this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), this.name);
|
|
824
|
+
}
|
|
825
|
+
handleBlur() {
|
|
826
|
+
(this.duration === null || this.duration === void 0) && this.durationIncrement === 1 && (this.duration = 5), (this.duration <= 0 || this.duration === null || this.duration === void 0) && this.durationIncrement === 60 && (this.duration = 1), this.duration < 5 && this.durationIncrement === 1 && (this.duration = 5), this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), "duration");
|
|
827
|
+
}
|
|
828
|
+
selectedOptionChangedHandler(e) {
|
|
829
|
+
d("nylas-calendar-picker", "selectedOptionChangedHandler", e.detail);
|
|
830
|
+
const { value: t } = e.detail;
|
|
831
|
+
this.durationIncrement = parseInt(t), this.durationIncrement === 1 ? this.duration = 5 : this.duration = 1, this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), "duration");
|
|
832
|
+
}
|
|
833
|
+
render() {
|
|
834
|
+
const e = [
|
|
835
|
+
{ value: 1, label: "minutes" },
|
|
836
|
+
{ value: 60, label: "hours" }
|
|
837
|
+
];
|
|
838
|
+
return i(k, { key: "222965e76af408c0b06183e8e888b73578adb158" }, i("div", { key: "decd15dbfd386cebc4efc880a0a8fb7fc8fc4a1a", class: "nylas-event-duration", part: "ned" }, i("label", { key: "655d4bd8aad28138573516d1a409ff4ad7f90527", htmlFor: "duration" }, "Event duration", i("span", { key: "f53fc2692fa1b4d3265e946ddf313a8e432897d8", class: "required" }, "*"), i("span", { key: "04f0110989f72e20a836ec8552801b87fc8cc6f8", class: "label-icon" }, i("tooltip-component", { key: "cead8ac1aa4ca82db690a38306a8987e3b5759e0" }, i("info-icon", { key: "0105ced6a6b7227b7ac39f68869e6f9fed5fc386", slot: "tooltip-icon" }), i("span", { key: "3a1a73f76723e6f0ba4b4c45a08a839f26b8c25d", slot: "tooltip-content" }, "Set the duration of your event.")))), i("div", { key: "7c85aebc13daa31d440d6b7ec4f2104f64ac4407", class: "nylas-event-duration__wrapper" }, i("input", { key: "255e4574db650850cf3396509be0dfdac65175bb", type: "number", part: "ned_input", id: "duration", name: "duration", value: this.duration, onBlur: () => this.handleBlur(), onInput: (t) => this.handleChange(t), min: 5 }), i("select-dropdown", { key: "a19d552e5e537d9ebeffa1890f2ccafa61a1f761", name: "event-duration", options: e, exportparts: "sd__dropdown: ned__dropdown, sd__dropdown-button: ned__dropdown-button, sd__dropdown-content: ned__dropdown-content", defaultSelectedOption: e.find((t) => t.value == this.durationIncrement) ?? e[0], withSearch: !1 }))));
|
|
839
|
+
}
|
|
840
|
+
static get formAssociated() {
|
|
841
|
+
return !0;
|
|
842
|
+
}
|
|
843
|
+
get host() {
|
|
844
|
+
return _(this);
|
|
845
|
+
}
|
|
846
|
+
static get watchers() {
|
|
847
|
+
return {
|
|
848
|
+
name: ["elementNameChangedHandler"],
|
|
849
|
+
selectedConfiguration: ["selectedConfigurationChangedHandler"],
|
|
850
|
+
durationMinutes: ["durationMinutesChangedHandler"]
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
};
|
|
854
|
+
Lt([
|
|
855
|
+
C({
|
|
856
|
+
name: "nylas-event-duration",
|
|
857
|
+
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
|
|
858
|
+
eventToProps: {},
|
|
859
|
+
fireRegisterEvent: !0
|
|
860
|
+
}),
|
|
861
|
+
ce("design:type", Function),
|
|
862
|
+
ce("design:paramtypes", []),
|
|
863
|
+
ce("design:returntype", void 0)
|
|
864
|
+
], Se.prototype, "render", null);
|
|
865
|
+
Se.style = It;
|
|
866
|
+
const $t = ':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-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}.nylas-event-info__block{display:flex;justify-content:space-between;gap:0.5rem}', Ht = $t;
|
|
867
|
+
var At = function(e, t, n, a) {
|
|
868
|
+
var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
|
|
869
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
870
|
+
s = Reflect.decorate(e, t, n, a);
|
|
871
|
+
else
|
|
872
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
873
|
+
(l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
|
|
874
|
+
return o > 3 && s && Object.defineProperty(t, n, s), s;
|
|
875
|
+
}, fe = function(e, t) {
|
|
876
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
877
|
+
return Reflect.metadata(e, t);
|
|
878
|
+
};
|
|
879
|
+
const De = class {
|
|
880
|
+
constructor(e) {
|
|
881
|
+
y(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals);
|
|
882
|
+
}
|
|
883
|
+
connectedCallback() {
|
|
884
|
+
d("nylas-event-info", "connectedCallback");
|
|
885
|
+
}
|
|
886
|
+
componentWillLoad() {
|
|
887
|
+
d("nylas-event-info", "componentWillLoad");
|
|
888
|
+
}
|
|
889
|
+
componentDidLoad() {
|
|
890
|
+
d("nylas-event-info", "componentDidLoad");
|
|
891
|
+
}
|
|
892
|
+
disconnectedCallback() {
|
|
893
|
+
d("nylas-event-info", "disconnectedCallback");
|
|
894
|
+
}
|
|
895
|
+
render() {
|
|
896
|
+
return i(k, { key: "e606a689e2b20dcddcbdbf42c44933953cb0c9c7" }, i("nylas-form-card", { key: "f3827f8c8756d131ea0eeca39d8dcae783b58629" }, i("h1", { key: "6deb1da623b3c6ede66653201476647d30b8f7e5", slot: "header-title", class: "nylas-event-info__title" }, "Event information"), i("h3", { key: "f027a8e56e59fba0e8ec3e4bfcbfda6419c5a6dc", slot: "header-subtitle", class: "nylas-event-info__subtitle" }, "Enter all event information."), i("div", { key: "0124599b210dc4e9395cdc75dd964132e98736b9", slot: "content", class: "nylas-event-info__content" }, i("slot", { key: "a227128a7e6f7f8b8c52bd0bd24ce672979fef30", name: "inputs" }))));
|
|
897
|
+
}
|
|
898
|
+
static get formAssociated() {
|
|
899
|
+
return !0;
|
|
900
|
+
}
|
|
901
|
+
};
|
|
902
|
+
At([
|
|
903
|
+
C({
|
|
904
|
+
name: "nylas-event-info",
|
|
905
|
+
eventToProps: {},
|
|
906
|
+
fireRegisterEvent: !0
|
|
907
|
+
}),
|
|
908
|
+
fe("design:type", Function),
|
|
909
|
+
fe("design:paramtypes", []),
|
|
910
|
+
fe("design:returntype", void 0)
|
|
911
|
+
], De.prototype, "render", null);
|
|
912
|
+
De.style = Ht;
|
|
913
|
+
const Mt = ':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-limits__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-limits__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-limits__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-event-limits__block{display:flex;justify-content:space-between;gap:0.5rem}', Ft = Mt;
|
|
914
|
+
var Nt = function(e, t, n, a) {
|
|
915
|
+
var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
|
|
916
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
917
|
+
s = Reflect.decorate(e, t, n, a);
|
|
918
|
+
else
|
|
919
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
920
|
+
(l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
|
|
921
|
+
return o > 3 && s && Object.defineProperty(t, n, s), s;
|
|
922
|
+
}, pe = function(e, t) {
|
|
923
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
924
|
+
return Reflect.metadata(e, t);
|
|
925
|
+
};
|
|
926
|
+
const Ie = class {
|
|
927
|
+
constructor(e) {
|
|
928
|
+
y(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals);
|
|
929
|
+
}
|
|
930
|
+
connectedCallback() {
|
|
931
|
+
d("nylas-event-limits", "connectedCallback");
|
|
932
|
+
}
|
|
933
|
+
componentWillLoad() {
|
|
934
|
+
d("nylas-event-limits", "componentWillLoad");
|
|
935
|
+
}
|
|
936
|
+
componentDidLoad() {
|
|
937
|
+
d("nylas-event-limits", "componentDidLoad");
|
|
938
|
+
}
|
|
939
|
+
disconnectedCallback() {
|
|
940
|
+
d("nylas-event-limits", "disconnectedCallback");
|
|
941
|
+
}
|
|
942
|
+
render() {
|
|
943
|
+
return i(k, { key: "56a1396f87f4d81f1a3912ec810e23a9dbed965b" }, i("nylas-form-card", { key: "2007e2fe058e39bb8c276d2995b4b8075d9ed82f" }, i("h1", { key: "e57bc40b4b369d64cdb2b6c97009dea3f141716f", slot: "header-title", class: "nylas-event-limits__title" }, "Set event limits"), i("h3", { key: "beb61ca97cfd3dca960e78e5f64abca4ace7777b", slot: "header-subtitle", class: "nylas-event-limits__subtitle" }, "Customize event limits for the event."), i("div", { key: "3912501d3e927fcbc6e8663f9149c66ce54fbd0e", slot: "content", class: "nylas-event-limits__content" }, i("slot", { key: "a0902c2edc5ef540547452d5f1448ba26547af17", name: "inputs" }))));
|
|
944
|
+
}
|
|
945
|
+
static get formAssociated() {
|
|
946
|
+
return !0;
|
|
947
|
+
}
|
|
948
|
+
};
|
|
949
|
+
Nt([
|
|
950
|
+
C({
|
|
951
|
+
name: "nylas-event-limits",
|
|
952
|
+
eventToProps: {},
|
|
953
|
+
fireRegisterEvent: !0
|
|
954
|
+
}),
|
|
955
|
+
pe("design:type", Function),
|
|
956
|
+
pe("design:paramtypes", []),
|
|
957
|
+
pe("design:returntype", void 0)
|
|
958
|
+
], Ie.prototype, "render", null);
|
|
959
|
+
Ie.style = Ft;
|
|
960
|
+
const Pt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-title{display:flex;flex-direction:column;gap:4px;position:relative;text-align:left}.nylas-event-title div.title{padding:12px 16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);overflow:scroll;white-space:nowrap;scrollbar-width:thin}.nylas-event-title div.title::-webkit-scrollbar{width:6px;height:6px}.nylas-event-title div.title.error{border-color:var(--nylas-error);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{color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:21px}.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:black;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)}', Rt = Pt;
|
|
961
|
+
var zt = function(e, t, n, a) {
|
|
962
|
+
var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
|
|
963
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
964
|
+
s = Reflect.decorate(e, t, n, a);
|
|
965
|
+
else
|
|
966
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
967
|
+
(l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
|
|
968
|
+
return o > 3 && s && Object.defineProperty(t, n, s), s;
|
|
969
|
+
}, ue = function(e, t) {
|
|
970
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
971
|
+
return Reflect.metadata(e, t);
|
|
972
|
+
};
|
|
973
|
+
const Le = class {
|
|
974
|
+
constructor(e) {
|
|
975
|
+
var t, n;
|
|
976
|
+
y(this, e), this.valueChanged = w(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.showTokens = !1, this.availableTokens = we.map((a) => ({
|
|
977
|
+
label: a.token,
|
|
978
|
+
value: a.value,
|
|
979
|
+
labelHTML: a
|
|
980
|
+
})), this.filteredTokens = this.availableTokens, this.ariaActivedescendant = "", this.currentWord = { $value: "", fullText: "", index: -1, focusOffset: -1 }, this.validationError = "";
|
|
981
|
+
}
|
|
982
|
+
elementNameChangedHandler(e) {
|
|
983
|
+
d("nylas-event-title", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
984
|
+
}
|
|
985
|
+
ariaActivedescendantChangedHandler(e) {
|
|
986
|
+
var t, n;
|
|
987
|
+
if (d("nylas-event-title", "ariaActivedescendantChangedHandler", e), e !== "") {
|
|
988
|
+
const a = (t = this.host.shadowRoot) == null ? void 0 : t.getElementById(e);
|
|
989
|
+
a == null || a.classList.add("active");
|
|
990
|
+
} else {
|
|
991
|
+
const a = (n = this.host.shadowRoot) == null ? void 0 : n.querySelectorAll(".token-options li.active");
|
|
992
|
+
a == null || a.forEach((o) => o.classList.remove("active"));
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
configChangedHandler(e) {
|
|
996
|
+
var n;
|
|
997
|
+
const t = (n = e == null ? void 0 : e.event_booking) == null ? void 0 : n.title;
|
|
998
|
+
t && this.updateEventTitleFromProp(t);
|
|
999
|
+
}
|
|
1000
|
+
connectedCallback() {
|
|
1001
|
+
d("nylas-event-title", "connectedCallback");
|
|
1002
|
+
}
|
|
1003
|
+
componentWillLoad() {
|
|
1004
|
+
d("nylas-event-title", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
1005
|
+
}
|
|
1006
|
+
componentDidLoad() {
|
|
1007
|
+
d("nylas-event-title", "componentDidLoad"), this.updateEventTitleFromProp(this.eventTitle || "");
|
|
1008
|
+
}
|
|
1009
|
+
disconnectedCallback() {
|
|
1010
|
+
d("nylas-event-title", "disconnectedCallback");
|
|
1011
|
+
}
|
|
1012
|
+
formSubmittedHandler(e) {
|
|
1013
|
+
var t, n;
|
|
1014
|
+
d("nylas-event-title", "formSubmittedHandler", e), (n = (t = this.internals) == null ? void 0 : t.validity) != null && n.valid ? this.validationError = "" : this.validationError = "Event title is required";
|
|
1015
|
+
}
|
|
1016
|
+
updateEventTitleFromProp(e) {
|
|
1017
|
+
var t, n;
|
|
1018
|
+
d("nylas-event-title", "eventTitleChangedHandler", e), this.titleRef && (this.titleRef.innerHTML = this.highlightTokens(e), this.titleRef.focus(), typeof this.internals.setValidity == "function" && (e === "" ? (t = this.internals) == null || t.setValidity({ customError: !0 }, "Event title is required", this.titleRef) : (n = this.internals) == null || n.setValidity({ customError: !1 })));
|
|
1019
|
+
}
|
|
1020
|
+
highlightTokens(e) {
|
|
1021
|
+
let t = e;
|
|
1022
|
+
return we.forEach((n) => {
|
|
1023
|
+
const a = n.value, o = new RegExp(`(\\${a})(?!\\w)`, "g");
|
|
1024
|
+
t = t.replace(o, '<span class="highlighted-tag">$1</span>');
|
|
1025
|
+
}), t;
|
|
1026
|
+
}
|
|
1027
|
+
getCurrentSelectionForBrowser() {
|
|
1028
|
+
var a, o, s;
|
|
1029
|
+
const e = (l, r, h, f) => {
|
|
1030
|
+
const u = l.replace(/[\u200B-\u200D\uFEFF]/g, ""), g = u.lastIndexOf("$"), v = u.substring(g).split(" ")[0];
|
|
1031
|
+
return {
|
|
1032
|
+
focusOffset: r,
|
|
1033
|
+
dollarIndex: g,
|
|
1034
|
+
lastWord: v,
|
|
1035
|
+
currentText: u,
|
|
1036
|
+
node: h,
|
|
1037
|
+
allSelected: f
|
|
1038
|
+
};
|
|
1039
|
+
}, t = (l) => {
|
|
1040
|
+
var r, h;
|
|
1041
|
+
return l.anchorOffset === 0 && l.focusOffset === ((h = (r = l.focusNode) == null ? void 0 : r.nodeValue) == null ? void 0 : h.length);
|
|
1042
|
+
};
|
|
1043
|
+
switch (We()) {
|
|
1044
|
+
case "Chrome":
|
|
1045
|
+
const l = (a = this.host.shadowRoot) == null ? void 0 : a.getSelection(), r = l == null ? void 0 : l.focusNode, h = (r == null ? void 0 : r.nodeValue) || "", f = l && t(l);
|
|
1046
|
+
return e(h, (l == null ? void 0 : l.focusOffset) || -1, r, f);
|
|
1047
|
+
case "Firefox":
|
|
1048
|
+
const u = document.getSelection(), g = ((o = u == null ? void 0 : u.anchorNode) == null ? void 0 : o.nodeValue) || "", v = u && t(u);
|
|
1049
|
+
return e(g, (u == null ? void 0 : u.focusOffset) || -1, u == null ? void 0 : u.anchorNode, v);
|
|
1050
|
+
case "Safari":
|
|
1051
|
+
const O = window.getSelection(), x = O == null ? void 0 : O.getComposedRanges(this.host.shadowRoot)[0], c = ((s = x == null ? void 0 : x.startContainer) == null ? void 0 : s.nodeValue) || "", p = O && t(O);
|
|
1052
|
+
return e(c, (x == null ? void 0 : x.endOffset) || -1, x == null ? void 0 : x.startContainer, p);
|
|
1053
|
+
default:
|
|
1054
|
+
return console.warn("Browser not supported"), null;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
handleChange(e) {
|
|
1058
|
+
const t = e.target.textContent || "", n = this.getCurrentSelectionForBrowser();
|
|
1059
|
+
if (!n) {
|
|
1060
|
+
this.updateEventTitle(t), this.resetDropdown();
|
|
1061
|
+
return;
|
|
1062
|
+
}
|
|
1063
|
+
const { focusOffset: a, dollarIndex: o, lastWord: s, currentText: l } = n;
|
|
1064
|
+
if (o === -1 || a < o) {
|
|
1065
|
+
this.updateEventTitle(t), this.resetDropdown();
|
|
1066
|
+
return;
|
|
1067
|
+
}
|
|
1068
|
+
s.startsWith("$") ? (this.showTokens = !0, this.currentWord = {
|
|
1069
|
+
$value: s,
|
|
1070
|
+
fullText: l,
|
|
1071
|
+
index: o,
|
|
1072
|
+
focusOffset: a
|
|
1073
|
+
}, this.populateSuggestionsDropdown(s)) : this.resetDropdown(), this.updateEventTitle(t);
|
|
1074
|
+
}
|
|
1075
|
+
handleInputKeyDown(e) {
|
|
1076
|
+
var n, a, o, s;
|
|
1077
|
+
const t = this.getCurrentSelectionForBrowser();
|
|
1078
|
+
if (t != null && t.allSelected && !Be(e) && (this.titleRef.innerHTML = ""), e.key === "Enter") {
|
|
1079
|
+
e.preventDefault();
|
|
1080
|
+
const l = (n = this.host.shadowRoot) == null ? void 0 : n.getElementById(this.ariaActivedescendant);
|
|
1081
|
+
l && (l.click(), this.ariaActivedescendant = "");
|
|
1082
|
+
} else if (e.key === "ArrowDown") {
|
|
1083
|
+
e.preventDefault();
|
|
1084
|
+
const l = (a = this.host.shadowRoot) == null ? void 0 : a.getElementById(this.ariaActivedescendant);
|
|
1085
|
+
if (l) {
|
|
1086
|
+
const r = l.nextElementSibling;
|
|
1087
|
+
r ? this.ariaActivedescendant = r.id : this.ariaActivedescendant = this.filteredTokens[0].label;
|
|
1088
|
+
} else
|
|
1089
|
+
this.ariaActivedescendant = this.filteredTokens[0].label;
|
|
1090
|
+
} else if (e.key === "ArrowUp") {
|
|
1091
|
+
e.preventDefault();
|
|
1092
|
+
const l = (o = this.host.shadowRoot) == null ? void 0 : o.getElementById(this.ariaActivedescendant);
|
|
1093
|
+
if (l) {
|
|
1094
|
+
const r = l.previousElementSibling;
|
|
1095
|
+
r ? this.ariaActivedescendant = r.id : this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
|
|
1096
|
+
} else
|
|
1097
|
+
this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
|
|
1098
|
+
} else
|
|
1099
|
+
e.key === "Escape" ? (e.preventDefault(), this.resetDropdown()) : (e.key === "Backspace" || e.key === "Delete") && (t != null && t.currentText.startsWith("${") && (s = t == null ? void 0 : t.node) != null && s.parentNode && t.node.parentNode.removeChild(t.node), (this.titleRef.textContent === "" || (t == null ? void 0 : t.currentText) === "" || t != null && t.allSelected) && (this.titleRef.innerHTML = ""));
|
|
1100
|
+
}
|
|
1101
|
+
selectOption(e, t) {
|
|
1102
|
+
var c;
|
|
1103
|
+
e.preventDefault();
|
|
1104
|
+
const n = this.currentWord.fullText, a = this.currentWord.$value;
|
|
1105
|
+
let o = this.titleRef.firstChild, s = null;
|
|
1106
|
+
for (; o; ) {
|
|
1107
|
+
if (o.nodeType === 3) {
|
|
1108
|
+
const p = ((c = o.textContent) == null ? void 0 : c.replace(/[\u200B-\u200D\uFEFF]/g, "")) || "", b = n.replace(/[\u200B-\u200D\uFEFF]/g, "");
|
|
1109
|
+
if (p.includes(b)) {
|
|
1110
|
+
s = o;
|
|
1111
|
+
break;
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
o = o.nextSibling;
|
|
1115
|
+
}
|
|
1116
|
+
if (!s)
|
|
1117
|
+
return;
|
|
1118
|
+
const l = s.textContent || "", r = l.indexOf(a), h = l.substring(0, r), f = l.substring(r + a.length), u = document.createTextNode(h), g = document.createRange(), v = document.createElement("span");
|
|
1119
|
+
v.classList.add("highlighted-tag"), v.textContent = `${t.value}`;
|
|
1120
|
+
const O = document.createTextNode(f);
|
|
1121
|
+
if (f !== "")
|
|
1122
|
+
s.replaceWith(u, v, O), g.setStart(O, 1);
|
|
1123
|
+
else {
|
|
1124
|
+
const p = document.createTextNode("");
|
|
1125
|
+
s.replaceWith(u, v, p), g.setStart(p, 1);
|
|
1126
|
+
}
|
|
1127
|
+
this.resetDropdown(), this.titleRef.focus();
|
|
1128
|
+
const x = window.getSelection();
|
|
1129
|
+
g.collapse(!0), x == null || x.removeAllRanges(), x == null || x.addRange(g), this.updateEventTitle(this.titleRef.textContent || "");
|
|
1130
|
+
}
|
|
1131
|
+
populateSuggestionsDropdown(e = "") {
|
|
1132
|
+
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);
|
|
1133
|
+
}
|
|
1134
|
+
updateEventTitle(e) {
|
|
1135
|
+
var n, a, o;
|
|
1136
|
+
const t = e.replace(/ +/g, " ");
|
|
1137
|
+
t === "" ? ((n = this.internals) == null || n.setValidity({ customError: !0 }, "Event title is required", this.titleRef), this.validationError = "Event title is required") : ((a = this.internals) == null || a.setValidity({ customError: !1 }), this.validationError = ""), (o = this.internals) == null || o.setFormValue(t, this.name), this.valueChanged.emit({ value: t, name: this.name });
|
|
1138
|
+
}
|
|
1139
|
+
resetDropdown() {
|
|
1140
|
+
this.showTokens = !1, this.ariaActivedescendant = "";
|
|
1141
|
+
}
|
|
1142
|
+
getLabelHTML(e) {
|
|
1143
|
+
return i("div", { class: "token-label" }, i("span", { class: "token" }, e.token), i("span", { class: "description" }, e.description));
|
|
1144
|
+
}
|
|
1145
|
+
render() {
|
|
1146
|
+
var e;
|
|
1147
|
+
return i(k, { key: "28ef0be3f64aafdaabb6bed562f5c89b92f2510e" }, i("div", { key: "42cc820bd4ca2343ebe09108a7ce5fca37c02165", class: "nylas-event-title", part: "net" }, i("label", { key: "748c85b9ef6a656b43137864c49282abfa0b78b9", htmlFor: "title" }, "Event title", i("span", { key: "29e8a26acfc6795ee511457c1f052bcc831757c3", class: "required" }, "*"), i("span", { key: "a555e59986cb55543c108d82c9e7120e8f78cd2a", class: "label-icon" }, i("tooltip-component", { key: "29e6f432f02f6cb10bee3a3c61374688a23c9a9a" }, i("info-icon", { key: "af9821938dc7f3175d8fdfb3426631111242483b", slot: "tooltip-icon" }), i("span", { key: "b1027c6b32fab643f94c4233f3c60e1462f69945", slot: "tooltip-content" }, "Enter a title for your event.")))), i("div", { key: "387e621aa40cef2857b00eae8da13be376296178", class: {
|
|
1148
|
+
title: !0,
|
|
1149
|
+
error: this.validationError !== ""
|
|
1150
|
+
}, part: "net__title", ref: (t) => this.titleRef = t, contentEditable: "true", onInput: (t) => this.handleChange(t), onKeyDown: (t) => this.handleInputKeyDown(t) }), this.showTokens && ((e = this.filteredTokens) == null ? void 0 : e.length) > 0 && i("div", { class: "token-options", part: "net__dropdown-content" }, i("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map((t) => i("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))))), i("span", { key: "c1a3f0602920e0799322aef007e738ec3fd2c478", class: "help-text" }, "Create a dynamic templated event title by typing $. Learn more"), this.validationError != "" && i("span", { class: "error-message" }, this.validationError)));
|
|
1151
|
+
}
|
|
1152
|
+
static get formAssociated() {
|
|
1153
|
+
return !0;
|
|
1154
|
+
}
|
|
1155
|
+
get host() {
|
|
1156
|
+
return _(this);
|
|
1157
|
+
}
|
|
1158
|
+
static get watchers() {
|
|
1159
|
+
return {
|
|
1160
|
+
name: ["elementNameChangedHandler"],
|
|
1161
|
+
ariaActivedescendant: ["ariaActivedescendantChangedHandler"],
|
|
1162
|
+
selectedConfiguration: ["configChangedHandler"]
|
|
1163
|
+
};
|
|
1164
|
+
}
|
|
1165
|
+
};
|
|
1166
|
+
zt([
|
|
1167
|
+
C({
|
|
1168
|
+
name: "nylas-event-title",
|
|
1169
|
+
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
|
|
1170
|
+
eventToProps: {},
|
|
1171
|
+
fireRegisterEvent: !0
|
|
1172
|
+
}),
|
|
1173
|
+
ue("design:type", Function),
|
|
1174
|
+
ue("design:paramtypes", []),
|
|
1175
|
+
ue("design:returntype", void 0)
|
|
1176
|
+
], Le.prototype, "render", null);
|
|
1177
|
+
Le.style = Rt;
|
|
1178
|
+
const Bt = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-limit-future-bookings{display:flex;justify-content:space-between;font-family:var(--nylas-font-family)}@media screen and (max-width: 768px){.nylas-limit-future-bookings{flex-direction:column;gap:0.5rem}}.nylas-limit-future-bookings label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-limit-future-bookings label span.label-icon{margin-left:4px}.nylas-limit-future-bookings label span.label-icon tooltip-component{display:flex}', jt = Bt;
|
|
1179
|
+
var Wt = function(e, t, n, a) {
|
|
1180
|
+
var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
|
|
1181
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1182
|
+
s = Reflect.decorate(e, t, n, a);
|
|
1183
|
+
else
|
|
1184
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
1185
|
+
(l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
|
|
1186
|
+
return o > 3 && s && Object.defineProperty(t, n, s), s;
|
|
1187
|
+
}, he = function(e, t) {
|
|
1188
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1189
|
+
return Reflect.metadata(e, t);
|
|
1190
|
+
};
|
|
1191
|
+
const $e = class {
|
|
1192
|
+
constructor(e) {
|
|
1193
|
+
y(this, e), this.valueChanged = w(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.availableDaysInFuture = void 0, this.name = "limit-future-bookings", this.selectedNumber = 1, this.selectedPeriod = "day";
|
|
1194
|
+
}
|
|
1195
|
+
elementNameChangedHandler(e) {
|
|
1196
|
+
d("nylas-limit-future-bookings", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
1197
|
+
}
|
|
1198
|
+
selectedConfigurationChangedHandler(e) {
|
|
1199
|
+
var n;
|
|
1200
|
+
const t = (n = e == null ? void 0 : e.scheduler) == null ? void 0 : n.available_days_in_future;
|
|
1201
|
+
t && this.updateNumberAndPeriodFromDays(t);
|
|
1202
|
+
}
|
|
1203
|
+
availableDaysInFutureChanged(e) {
|
|
1204
|
+
this.updateNumberAndPeriodFromDays(e);
|
|
1205
|
+
}
|
|
1206
|
+
connectedCallback() {
|
|
1207
|
+
d("nylas-limit-future-bookings", "connectedCallback");
|
|
1208
|
+
}
|
|
1209
|
+
componentWillLoad() {
|
|
1210
|
+
d("nylas-limit-future-bookings", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
1211
|
+
}
|
|
1212
|
+
componentDidLoad() {
|
|
1213
|
+
var e;
|
|
1214
|
+
d("nylas-limit-future-bookings", "componentDidLoad"), this.availableDaysInFutureChanged(this.availableDaysInFuture ?? 1), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(((e = this.availableDaysInFuture) == null ? void 0 : e.toString()) ?? "1", this.name);
|
|
1215
|
+
}
|
|
1216
|
+
disconnectedCallback() {
|
|
1217
|
+
d("nylas-limit-future-bookings", "disconnectedCallback");
|
|
1218
|
+
}
|
|
1219
|
+
timePeriodChangedHandler(e) {
|
|
1220
|
+
const { number: t, period: n } = e.detail;
|
|
1221
|
+
let a;
|
|
1222
|
+
n === "day" ? a = t : n === "week" ? a = t * 7 : a = t * 30, this.valueChanged.emit({ value: a, name: "availableDaysInFuture" }), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(a.toString(), this.name);
|
|
1223
|
+
}
|
|
1224
|
+
updateNumberAndPeriodFromDays(e) {
|
|
1225
|
+
let t, n;
|
|
1226
|
+
e >= 30 && e % 30 === 0 ? (t = e / 30, n = "month") : e >= 7 && e % 7 === 0 ? (t = e / 7, n = "week") : (t = e, n = "day"), this.selectedNumber = t, this.selectedPeriod = n;
|
|
1227
|
+
}
|
|
1228
|
+
render() {
|
|
1229
|
+
return i(k, { key: "633f17f3c8a36aaf1b48653a471fce7a67c2e6bc" }, i("div", { key: "5685213b7d7d44a54cecda52d553fc49f0b45cf6", class: "nylas-limit-future-bookings", part: "nlfb" }, i("label", { key: "9c3f51639f92585b04cb6c358783ddb240fcd217" }, "Limit future bookings", i("span", { key: "f234e3ff93652121e54d1aa77cbd77c2e93252c5", class: "label-icon" }, i("tooltip-component", { key: "4a1a059e553f52b856b220c37a9721ed8d890171" }, i("info-icon", { key: "f6daa7aae8aefe95871744a22d71a1bb743a797c", slot: "tooltip-icon" }), i("span", { key: "ef99e06e91e3f76e640d8209d0f9ad1831c9fdeb", slot: "tooltip-content" }, "Set a limit on how far in the future bookings can be made.")))), i("time-period-selector", { key: "02215f1ea27a251917bf8ad3cb10f9d36bd870ba", id: "limit-future-bookings", timePeriods: ["day", "week", "month"], exportparts: "tps__number-dropdown: nlfb__number-dropdown, tps__number-dropdown-button: nlfb__number-dropdown-button, tps__number-dropdown-content: nlfb__number-dropdown-content, tps__period-dropdown: nlfb__period-dropdown, tps__period-dropdown-button: nlfb__period-dropdown-button, tps__period-dropdown-content: nlfb__period-dropdown-content", defaultSelectedNumber: this.selectedNumber, defaultSelectedPeriod: this.selectedPeriod })));
|
|
1230
|
+
}
|
|
1231
|
+
static get formAssociated() {
|
|
1232
|
+
return !0;
|
|
1233
|
+
}
|
|
1234
|
+
get host() {
|
|
1235
|
+
return _(this);
|
|
1236
|
+
}
|
|
1237
|
+
static get watchers() {
|
|
1238
|
+
return {
|
|
1239
|
+
name: ["elementNameChangedHandler"],
|
|
1240
|
+
selectedConfiguration: ["selectedConfigurationChangedHandler"],
|
|
1241
|
+
availableDaysInFuture: ["availableDaysInFutureChanged"]
|
|
1242
|
+
};
|
|
1243
|
+
}
|
|
1244
|
+
};
|
|
1245
|
+
Wt([
|
|
1246
|
+
C({
|
|
1247
|
+
name: "nylas-limit-future-bookings",
|
|
1248
|
+
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
|
|
1249
|
+
eventToProps: {},
|
|
1250
|
+
fireRegisterEvent: !0
|
|
1251
|
+
}),
|
|
1252
|
+
he("design:type", Function),
|
|
1253
|
+
he("design:paramtypes", []),
|
|
1254
|
+
he("design:returntype", void 0)
|
|
1255
|
+
], $e.prototype, "render", null);
|
|
1256
|
+
$e.style = jt;
|
|
1257
|
+
const Ut = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-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}.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}', Zt = Ut;
|
|
1258
|
+
var Yt = function(e, t, n, a) {
|
|
1259
|
+
var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
|
|
1260
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1261
|
+
s = Reflect.decorate(e, t, n, a);
|
|
1262
|
+
else
|
|
1263
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
1264
|
+
(l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
|
|
1265
|
+
return o > 3 && s && Object.defineProperty(t, n, s), s;
|
|
1266
|
+
}, be = function(e, t) {
|
|
1267
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1268
|
+
return Reflect.metadata(e, t);
|
|
1269
|
+
};
|
|
1270
|
+
const He = class {
|
|
1271
|
+
constructor(e) {
|
|
1272
|
+
y(this, e), this.valueChanged = w(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.selectedConfiguration = void 0, this.eventLocation = void 0, this.location = this.eventLocation ?? "", this.selectedLocationOption = this.eventLocation ? "custom" : "none";
|
|
1273
|
+
}
|
|
1274
|
+
elementNameChangedHandler(e) {
|
|
1275
|
+
d("nylas-location-component", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
1276
|
+
}
|
|
1277
|
+
selectedConfigurationChangedHandler(e, t) {
|
|
1278
|
+
var a;
|
|
1279
|
+
d("nylas-custom-booking-flow", "selectedConfigurationChangedHandler", e, t);
|
|
1280
|
+
const n = (a = e == null ? void 0 : e.event_booking) == null ? void 0 : a.location;
|
|
1281
|
+
n && (this.selectedLocationOption = n ? "custom" : "none", this.location = n);
|
|
1282
|
+
}
|
|
1283
|
+
eventLocationChangedHandler(e, t) {
|
|
1284
|
+
d("nylas-location-component", "eventLocationChangedHandler", e), e !== t && (this.selectedLocationOption = e ? "custom" : "none");
|
|
1285
|
+
}
|
|
1286
|
+
connectedCallback() {
|
|
1287
|
+
d("nylas-location-component", "connectedCallback");
|
|
1288
|
+
}
|
|
1289
|
+
componentWillLoad() {
|
|
1290
|
+
d("nylas-location-component", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
1291
|
+
}
|
|
1292
|
+
componentDidLoad() {
|
|
1293
|
+
d("nylas-location-component", "componentDidLoad");
|
|
1294
|
+
}
|
|
1295
|
+
disconnectedCallback() {
|
|
1296
|
+
d("nylas-location-component", "disconnectedCallback");
|
|
1297
|
+
}
|
|
1298
|
+
selectedOptionChangedHandler(e) {
|
|
1299
|
+
this.selectedLocationOption = e.detail.value, this.selectedLocationOption === "none" && (this.location = "", this.setFormValue("", "location"), this.valueChanged.emit({ value: "", name: this.name }));
|
|
1300
|
+
}
|
|
1301
|
+
setFormValue(e, t) {
|
|
1302
|
+
typeof this.internals.setFormValue == "function" && this.internals.setFormValue(e, t);
|
|
1303
|
+
}
|
|
1304
|
+
handleChange(e) {
|
|
1305
|
+
this.location = e.target.value, this.setFormValue(e.target.value, "location"), this.valueChanged.emit({ value: e.target.value, name: this.name });
|
|
1306
|
+
}
|
|
1307
|
+
render() {
|
|
1308
|
+
const e = [
|
|
1309
|
+
{ value: "none", label: "None" },
|
|
1310
|
+
{ value: "custom", label: "Custom location" }
|
|
1311
|
+
], t = {
|
|
1312
|
+
none: i("location-off-icon", { key: "575c799ee8e373f1fa305166312f3192cbb1195e" }),
|
|
1313
|
+
custom: i("location-icon", { key: "3e9a108a256313289846487fdb5a2c8f93bf06ea" })
|
|
1314
|
+
};
|
|
1315
|
+
return i(k, { key: "8038cd624df0d63608bb23d0b52ee73d62939ba6" }, i("div", { key: "3047dfeacda102f18f0413213a86676eb1c5f901", class: "nylas-event-location", part: "nel" }, i("label", { key: "8cbf08ad544cc6dbfa21f8eca510fe7700756cbb", htmlFor: "location" }, "Location type", i("span", { key: "b806d2ab1087c5d82674d2ba1f697ab650dfff64", class: "label-icon" }, i("tooltip-component", { key: "3a67a7eb1eed2315d46d6e81fe62314bf92226d7" }, i("info-icon", { key: "4e787698acb0d0d272c13a226747c1252741cbe9", slot: "tooltip-icon" }), i("span", { key: "85eb8db37cef3482e59124b21c968dfe4ea38fec", slot: "tooltip-content" }, "Choose how you’ll meet with the participants at the scheduled time. Pick from available conferencing options or add a custom location.")))), i("div", { key: "5970b85d96f9430504846d7ff66a259b639a17d7", class: "location-input" }, i("select-dropdown", { key: "b848b8a01563c1640a0552c385ed268e15431453", withSearch: !1, name: "location", options: e, defaultSelectedOption: e.find((n) => n.value == this.selectedLocationOption), exportparts: "sd__dropdown: nel__dropdown, sd__dropdown-button: nel__dropdown-button, sd__dropdown-content: nel__dropdown-content" }, i("span", { key: "c3bf4e65c37357b12892f333a3a2a22803400e46", slot: "select-icon" }, t[this.selectedLocationOption])), this.selectedLocationOption === "custom" && i("input", { type: "text", part: "nel__location", id: "location", name: "location", maxlength: "1024", value: this.location, onInput: (n) => this.handleChange(n) }))));
|
|
1316
|
+
}
|
|
1317
|
+
static get formAssociated() {
|
|
1318
|
+
return !0;
|
|
1319
|
+
}
|
|
1320
|
+
get host() {
|
|
1321
|
+
return _(this);
|
|
1322
|
+
}
|
|
1323
|
+
static get watchers() {
|
|
1324
|
+
return {
|
|
1325
|
+
name: ["elementNameChangedHandler"],
|
|
1326
|
+
selectedConfiguration: ["selectedConfigurationChangedHandler"],
|
|
1327
|
+
eventLocation: ["eventLocationChangedHandler"]
|
|
1328
|
+
};
|
|
1329
|
+
}
|
|
1330
|
+
};
|
|
1331
|
+
Yt([
|
|
1332
|
+
C({
|
|
1333
|
+
name: "nylas-location-component",
|
|
1334
|
+
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
|
|
1335
|
+
eventToProps: {},
|
|
1336
|
+
fireRegisterEvent: !0
|
|
1337
|
+
}),
|
|
1338
|
+
be("design:type", Function),
|
|
1339
|
+
be("design:paramtypes", []),
|
|
1340
|
+
be("design:returntype", void 0)
|
|
1341
|
+
], He.prototype, "render", null);
|
|
1342
|
+
He.style = Zt;
|
|
1343
|
+
const Kt = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-min-cancellation-notice{display:flex;justify-content:space-between;font-family:var(--nylas-font-family)}@media screen and (max-width: 768px){.nylas-min-cancellation-notice{flex-direction:column;gap:0.5rem}}.nylas-min-cancellation-notice label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-min-cancellation-notice label span.label-icon{margin-left:4px}.nylas-min-cancellation-notice label span.label-icon tooltip-component{display:flex}', Vt = Kt;
|
|
1344
|
+
var qt = function(e, t, n, a) {
|
|
1345
|
+
var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
|
|
1346
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
1347
|
+
s = Reflect.decorate(e, t, n, a);
|
|
1348
|
+
else
|
|
1349
|
+
for (var r = e.length - 1; r >= 0; r--)
|
|
1350
|
+
(l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
|
|
1351
|
+
return o > 3 && s && Object.defineProperty(t, n, s), s;
|
|
1352
|
+
}, me = function(e, t) {
|
|
1353
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
1354
|
+
return Reflect.metadata(e, t);
|
|
1355
|
+
};
|
|
1356
|
+
const Ae = class {
|
|
1357
|
+
constructor(e) {
|
|
1358
|
+
y(this, e), this.valueChanged = w(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.minCancellationNotice = void 0, this.name = "min-cancellation-notice", this.selectedNumber = 1, this.selectedPeriod = "day";
|
|
1359
|
+
}
|
|
1360
|
+
elementNameChangedHandler(e) {
|
|
1361
|
+
d("nylas-min-cancellation-notice", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
1362
|
+
}
|
|
1363
|
+
selectedConfigurationChangedHandler(e) {
|
|
1364
|
+
var n;
|
|
1365
|
+
const t = (n = e == null ? void 0 : e.scheduler) == null ? void 0 : n.min_cancellation_notice;
|
|
1366
|
+
t && this.updateNumberAndPeriodFromMinutes(t);
|
|
1367
|
+
}
|
|
1368
|
+
availableDaysInFutureChanged(e) {
|
|
1369
|
+
this.updateNumberAndPeriodFromMinutes(e);
|
|
1370
|
+
}
|
|
1371
|
+
connectedCallback() {
|
|
1372
|
+
d("nylas-min-cancellation-notice", "connectedCallback");
|
|
1373
|
+
}
|
|
1374
|
+
componentWillLoad() {
|
|
1375
|
+
d("nylas-min-cancellation-notice", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
1376
|
+
}
|
|
1377
|
+
componentDidLoad() {
|
|
1378
|
+
var e;
|
|
1379
|
+
d("nylas-min-cancellation-notice", "componentDidLoad"), this.availableDaysInFutureChanged(this.minCancellationNotice ?? 1), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(((e = this.minCancellationNotice) == null ? void 0 : e.toString()) ?? "1", this.name);
|
|
1380
|
+
}
|
|
1381
|
+
disconnectedCallback() {
|
|
1382
|
+
d("nylas-min-cancellation-notice", "disconnectedCallback");
|
|
1383
|
+
}
|
|
1384
|
+
timePeriodChangedHandler(e) {
|
|
1385
|
+
const { number: t, period: n } = e.detail;
|
|
1386
|
+
let a;
|
|
1387
|
+
const o = 60, s = o * 24, l = s * 7, r = s * 30;
|
|
1388
|
+
n === "minute" ? a = t : n === "hour" ? a = t * o : n === "day" ? a = t * s : n === "week" ? a = t * l : n === "month" ? a = t * r : a = 0, this.valueChanged.emit({ value: a, name: "minCancellationNotice" }), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(a.toString(), this.name);
|
|
1389
|
+
}
|
|
1390
|
+
updateNumberAndPeriodFromMinutes(e) {
|
|
1391
|
+
let s, l;
|
|
1392
|
+
e >= 43200 ? (s = Math.floor(e / 43200), l = "month") : e >= 10080 ? (s = Math.floor(e / 10080), l = "week") : e >= 1440 ? (s = Math.floor(e / 1440), l = "day") : e >= 60 ? (s = Math.floor(e / 60), l = "hour") : (s = e, l = "minute"), this.selectedNumber = s, this.selectedPeriod = l;
|
|
1393
|
+
}
|
|
1394
|
+
render() {
|
|
1395
|
+
return i(k, { key: "473f79ba357832c63d5af02f6123d5d8a4bbee61" }, i("div", { key: "657c38462f01c79f7e830e7758859398e776ccdb", class: "nylas-min-cancellation-notice", part: "nmcn" }, i("label", { key: "9a29a3b348cf93c9de3b7f28d05c319d64ed37c6" }, "Minimum cancellation notice", i("span", { key: "a618468ede4da9c28ec941ab4b76551cff980d8a", class: "label-icon" }, i("tooltip-component", { key: "a44b3a7327721e17884840a9124f7c27249f050c" }, i("info-icon", { key: "177c2db8b4f868e23f5e59a08a335a1bbf4e5316", slot: "tooltip-icon" }), i("span", { key: "843ca3f89854fb398717e8fab9c54b124ef93a46", slot: "tooltip-content" }, "Set the minimum amount of time required to cancel an event.")))), i("time-period-selector", { key: "74b22ae97313a1a096d1c5ef6c791507e98da099", id: "min-cancellation-notice", exportparts: "tps__number-dropdown: nmcn__number-dropdown, tps__number-dropdown-button: nmcn__number-dropdown-button, tps__number-dropdown-content: nmcn__number-dropdown-content, tps__period-dropdown: nmcn__period-dropdown, tps__period-dropdown-button: nmcn__period-dropdown-button, tps__period-dropdown-content: nmcn__period-dropdown-content", timePeriods: ["minute", "hour", "day", "week"], defaultSelectedNumber: this.selectedNumber, defaultSelectedPeriod: this.selectedPeriod })));
|
|
1396
|
+
}
|
|
1397
|
+
static get formAssociated() {
|
|
1398
|
+
return !0;
|
|
1399
|
+
}
|
|
1400
|
+
get host() {
|
|
1401
|
+
return _(this);
|
|
1402
|
+
}
|
|
1403
|
+
static get watchers() {
|
|
1404
|
+
return {
|
|
1405
|
+
name: ["elementNameChangedHandler"],
|
|
1406
|
+
selectedConfiguration: ["selectedConfigurationChangedHandler"],
|
|
1407
|
+
availableDaysInFuture: ["availableDaysInFutureChanged"]
|
|
1408
|
+
};
|
|
1409
|
+
}
|
|
1410
|
+
};
|
|
1411
|
+
qt([
|
|
1412
|
+
C({
|
|
1413
|
+
name: "nylas-min-cancellation-notice",
|
|
1414
|
+
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
|
|
1415
|
+
eventToProps: {},
|
|
1416
|
+
fireRegisterEvent: !0
|
|
1417
|
+
}),
|
|
1418
|
+
me("design:type", Function),
|
|
1419
|
+
me("design:paramtypes", []),
|
|
1420
|
+
me("design:returntype", void 0)
|
|
1421
|
+
], Ae.prototype, "render", null);
|
|
1422
|
+
Ae.style = Vt;
|
|
1423
|
+
var Me = { exports: {} };
|
|
1424
|
+
(function(e, t) {
|
|
1425
|
+
(function(n, a) {
|
|
1426
|
+
e.exports = a();
|
|
1427
|
+
})(je, function() {
|
|
1428
|
+
var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, a = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, o = /\d\d/, s = /\d\d?/, l = /\d*[^-_:/,()\s\d]+/, r = {}, h = function(c) {
|
|
1429
|
+
return (c = +c) + (c > 68 ? 1900 : 2e3);
|
|
1430
|
+
}, f = function(c) {
|
|
1431
|
+
return function(p) {
|
|
1432
|
+
this[c] = +p;
|
|
1433
|
+
};
|
|
1434
|
+
}, u = [/[+-]\d\d:?(\d\d)?|Z/, function(c) {
|
|
1435
|
+
(this.zone || (this.zone = {})).offset = function(p) {
|
|
1436
|
+
if (!p || p === "Z")
|
|
1437
|
+
return 0;
|
|
1438
|
+
var b = p.match(/([+-]|\d\d)/g), m = 60 * b[1] + (+b[2] || 0);
|
|
1439
|
+
return m === 0 ? 0 : b[0] === "+" ? -m : m;
|
|
1440
|
+
}(c);
|
|
1441
|
+
}], g = function(c) {
|
|
1442
|
+
var p = r[c];
|
|
1443
|
+
return p && (p.indexOf ? p : p.s.concat(p.f));
|
|
1444
|
+
}, v = function(c, p) {
|
|
1445
|
+
var b, m = r.meridiem;
|
|
1446
|
+
if (m) {
|
|
1447
|
+
for (var D = 1; D <= 24; D += 1)
|
|
1448
|
+
if (c.indexOf(m(D, 0, p)) > -1) {
|
|
1449
|
+
b = D > 12;
|
|
1450
|
+
break;
|
|
1451
|
+
}
|
|
1452
|
+
} else
|
|
1453
|
+
b = c === (p ? "pm" : "PM");
|
|
1454
|
+
return b;
|
|
1455
|
+
}, O = { A: [l, function(c) {
|
|
1456
|
+
this.afternoon = v(c, !1);
|
|
1457
|
+
}], a: [l, function(c) {
|
|
1458
|
+
this.afternoon = v(c, !0);
|
|
1459
|
+
}], S: [/\d/, function(c) {
|
|
1460
|
+
this.milliseconds = 100 * +c;
|
|
1461
|
+
}], SS: [o, function(c) {
|
|
1462
|
+
this.milliseconds = 10 * +c;
|
|
1463
|
+
}], SSS: [/\d{3}/, function(c) {
|
|
1464
|
+
this.milliseconds = +c;
|
|
1465
|
+
}], s: [s, f("seconds")], ss: [s, f("seconds")], m: [s, f("minutes")], mm: [s, f("minutes")], H: [s, f("hours")], h: [s, f("hours")], HH: [s, f("hours")], hh: [s, f("hours")], D: [s, f("day")], DD: [o, f("day")], Do: [l, function(c) {
|
|
1466
|
+
var p = r.ordinal, b = c.match(/\d+/);
|
|
1467
|
+
if (this.day = b[0], p)
|
|
1468
|
+
for (var m = 1; m <= 31; m += 1)
|
|
1469
|
+
p(m).replace(/\[|\]/g, "") === c && (this.day = m);
|
|
1470
|
+
}], M: [s, f("month")], MM: [o, f("month")], MMM: [l, function(c) {
|
|
1471
|
+
var p = g("months"), b = (g("monthsShort") || p.map(function(m) {
|
|
1472
|
+
return m.slice(0, 3);
|
|
1473
|
+
})).indexOf(c) + 1;
|
|
1474
|
+
if (b < 1)
|
|
1475
|
+
throw new Error();
|
|
1476
|
+
this.month = b % 12 || b;
|
|
1477
|
+
}], MMMM: [l, function(c) {
|
|
1478
|
+
var p = g("months").indexOf(c) + 1;
|
|
1479
|
+
if (p < 1)
|
|
1480
|
+
throw new Error();
|
|
1481
|
+
this.month = p % 12 || p;
|
|
1482
|
+
}], Y: [/[+-]?\d+/, f("year")], YY: [o, function(c) {
|
|
1483
|
+
this.year = h(c);
|
|
1484
|
+
}], YYYY: [/\d{4}/, f("year")], Z: u, ZZ: u };
|
|
1485
|
+
function x(c) {
|
|
1486
|
+
var p, b;
|
|
1487
|
+
p = c, b = r && r.formats;
|
|
1488
|
+
for (var m = (c = p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(P, H, S) {
|
|
1489
|
+
var T = S && S.toUpperCase();
|
|
1490
|
+
return H || b[S] || n[S] || b[T].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(A, M, R) {
|
|
1491
|
+
return M || R.slice(1);
|
|
1492
|
+
});
|
|
1493
|
+
})).match(a), D = m.length, I = 0; I < D; I += 1) {
|
|
1494
|
+
var Y = m[I], N = O[Y], L = N && N[0], $ = N && N[1];
|
|
1495
|
+
m[I] = $ ? { regex: L, parser: $ } : Y.replace(/^\[|\]$/g, "");
|
|
1496
|
+
}
|
|
1497
|
+
return function(P) {
|
|
1498
|
+
for (var H = {}, S = 0, T = 0; S < D; S += 1) {
|
|
1499
|
+
var A = m[S];
|
|
1500
|
+
if (typeof A == "string")
|
|
1501
|
+
T += A.length;
|
|
1502
|
+
else {
|
|
1503
|
+
var M = A.regex, R = A.parser, K = P.slice(T), B = M.exec(K)[0];
|
|
1504
|
+
R.call(H, B), P = P.replace(B, "");
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
return function(z) {
|
|
1508
|
+
var E = z.afternoon;
|
|
1509
|
+
if (E !== void 0) {
|
|
1510
|
+
var j = z.hours;
|
|
1511
|
+
E ? j < 12 && (z.hours += 12) : j === 12 && (z.hours = 0), delete z.afternoon;
|
|
1512
|
+
}
|
|
1513
|
+
}(H), H;
|
|
1514
|
+
};
|
|
1515
|
+
}
|
|
1516
|
+
return function(c, p, b) {
|
|
1517
|
+
b.p.customParseFormat = !0, c && c.parseTwoDigitYear && (h = c.parseTwoDigitYear);
|
|
1518
|
+
var m = p.prototype, D = m.parse;
|
|
1519
|
+
m.parse = function(I) {
|
|
1520
|
+
var Y = I.date, N = I.utc, L = I.args;
|
|
1521
|
+
this.$u = N;
|
|
1522
|
+
var $ = L[1];
|
|
1523
|
+
if (typeof $ == "string") {
|
|
1524
|
+
var P = L[2] === !0, H = L[3] === !0, S = P || H, T = L[2];
|
|
1525
|
+
H && (T = L[2]), r = this.$locale(), !P && T && (r = b.Ls[T]), this.$d = function(K, B, z) {
|
|
1526
|
+
try {
|
|
1527
|
+
if (["x", "X"].indexOf(B) > -1)
|
|
1528
|
+
return new Date((B === "X" ? 1e3 : 1) * K);
|
|
1529
|
+
var E = x(B)(K), j = E.year, V = E.month, Fe = E.day, Ne = E.hours, Pe = E.minutes, Re = E.seconds, ze = E.milliseconds, ye = E.zone, J = /* @__PURE__ */ new Date(), G = Fe || (j || V ? 1 : J.getDate()), X = j || J.getFullYear(), q = 0;
|
|
1530
|
+
j && !V || (q = V > 0 ? V - 1 : J.getMonth());
|
|
1531
|
+
var Q = Ne || 0, ee = Pe || 0, te = Re || 0, ne = ze || 0;
|
|
1532
|
+
return ye ? new Date(Date.UTC(X, q, G, Q, ee, te, ne + 60 * ye.offset * 1e3)) : z ? new Date(Date.UTC(X, q, G, Q, ee, te, ne)) : new Date(X, q, G, Q, ee, te, ne);
|
|
1533
|
+
} catch {
|
|
1534
|
+
return /* @__PURE__ */ new Date("");
|
|
1535
|
+
}
|
|
1536
|
+
}(Y, $, N), this.init(), T && T !== !0 && (this.$L = this.locale(T).$L), S && Y != this.format($) && (this.$d = /* @__PURE__ */ new Date("")), r = {};
|
|
1537
|
+
} else if ($ instanceof Array)
|
|
1538
|
+
for (var A = $.length, M = 1; M <= A; M += 1) {
|
|
1539
|
+
L[1] = $[M - 1];
|
|
1540
|
+
var R = b.apply(this, L);
|
|
1541
|
+
if (R.isValid()) {
|
|
1542
|
+
this.$d = R.$d, this.$L = R.$L, this.init();
|
|
1543
|
+
break;
|
|
1544
|
+
}
|
|
1545
|
+
M === A && (this.$d = /* @__PURE__ */ new Date(""));
|
|
1546
|
+
}
|
|
1547
|
+
else
|
|
1548
|
+
D.call(this, I);
|
|
1549
|
+
};
|
|
1550
|
+
};
|
|
1551
|
+
});
|
|
1552
|
+
})(Me);
|
|
1553
|
+
const Jt = Me.exports, Gt = ':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.time-picker{display:inline-block;width:150px;font-family:var(--nylas-font-family);position:relative}@media screen and (max-width: 768px){.time-picker{width:auto}}.time-picker input{width:150px;height:48px;text-align:center;font-size:16px;font-family:inherit;cursor:pointer;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.time-picker input{width:88px}}@media screen and (max-width: 504px){.time-picker input{width:68px;font-size:15px}}.time-picker input.focus{background:transparent}.time-picker input:hover,.time-picker input:active{border:1px solid var(--nylas-primary)}.time-picker input:active{outline:2px solid var(--nylas-primary)}.time-picker input span.open{transform:rotate(90deg)}.time-picker input span.closed{transform:rotate(270deg)}.time-picker input.error{border:1px solid var(--nylas-error)}.time-picker p.error{color:var(--nylas-error);font-size:0.875rem;margin:0}.times{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.times ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.times ul li{padding:16px, 12px, 16px, 12px;color:black;padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:center;cursor:pointer}.times ul li.focused{background-color:var(--nylas-base-100)}.times ul li:hover,.times ul li:focus{background-color:var(--nylas-base-100)}.times ul li label{display:flex;align-items:center;gap:0.5rem}.times ul li label input{margin:0}', Xt = Gt;
|
|
1554
|
+
Z.extend(Jt);
|
|
1555
|
+
const Qt = class {
|
|
1556
|
+
constructor(e) {
|
|
1557
|
+
y(this, e), this.timeChange = w(this, "timeChange", 7), this.formError = w(this, "formError", 7), this.time = void 0, this.minimumStartTime = null, this.placeholder = "hh:mmam/pm", this.name = void 0, this.hasError = !1, this.err = "", this.showTimes = !1, this.ariaActivedescendant = "", this.times = this.generateTimes(), this.shouldAutoScroll = !1;
|
|
1558
|
+
}
|
|
1559
|
+
handleOutsideClick(e) {
|
|
1560
|
+
!e.composedPath().includes(this.el) && this.showTimes && (this.showTimes = !1);
|
|
1561
|
+
}
|
|
1562
|
+
minimumStartTimeChangedHandler() {
|
|
1563
|
+
if (this.minimumStartTime) {
|
|
1564
|
+
let e = Z().hour(parseInt(this.minimumStartTime)).minute(parseInt(this.minimumStartTime.slice(-4, -2)));
|
|
1565
|
+
this.minimumStartTime.slice(-2).toLowerCase() === "pm" && parseInt(this.minimumStartTime) !== 12 ? e = e.add(12, "hour") : this.minimumStartTime.slice(-2).toLowerCase() === "am" && parseInt(this.minimumStartTime) === 12 && (e = e.subtract(12, "hour")), this.times = this.generateTimes();
|
|
1566
|
+
const t = Z(this.times[0].value, "hh:mma");
|
|
1567
|
+
Z(this.time, "hh:mma").isBefore(t) && (this.err = "Invalid", this.formError.emit({
|
|
1568
|
+
key: this.el.id,
|
|
1569
|
+
message: "Invalid"
|
|
1570
|
+
}));
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
componentDidRender() {
|
|
1574
|
+
if (this.showTimes && this.shouldAutoScroll) {
|
|
1575
|
+
const e = ae(this.time), t = this.times.findIndex((n) => n.value === e);
|
|
1576
|
+
t > -1 && (this.shouldAutoScroll = !1, this.scrollToViewWithinParent(t));
|
|
1577
|
+
return;
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
handleTimeChange(e, t) {
|
|
1581
|
+
const n = t.split(":");
|
|
1582
|
+
n[0] === "00" && n[1].slice(-2) == "pm" && (this.err = "Invalid", this.formError.emit({
|
|
1583
|
+
key: this.el.id,
|
|
1584
|
+
message: "Invalid"
|
|
1585
|
+
})), ie(t) ? (this.err = "", this.formError.emit({
|
|
1586
|
+
key: this.el.id,
|
|
1587
|
+
message: ""
|
|
1588
|
+
})) : (this.err = "Invalid", this.formError.emit({
|
|
1589
|
+
key: this.el.id,
|
|
1590
|
+
message: "Invalid"
|
|
1591
|
+
})), this.timeChange.emit({
|
|
1592
|
+
key: this.el.id,
|
|
1593
|
+
value: t
|
|
1594
|
+
});
|
|
1595
|
+
}
|
|
1596
|
+
handleTimeAutocomplete(e) {
|
|
1597
|
+
var n;
|
|
1598
|
+
const t = (n = e.target) == null ? void 0 : n.value;
|
|
1599
|
+
if (!ie(t)) {
|
|
1600
|
+
this.err = "Invalid", this.formError.emit({
|
|
1601
|
+
key: this.el.id,
|
|
1602
|
+
message: "Invalid"
|
|
1603
|
+
});
|
|
1604
|
+
return;
|
|
1605
|
+
}
|
|
1606
|
+
if (t === "") {
|
|
1607
|
+
const a = ve().format("hh:mma");
|
|
1608
|
+
this.timeChange.emit({
|
|
1609
|
+
key: this.el.id,
|
|
1610
|
+
value: a
|
|
1611
|
+
});
|
|
1612
|
+
return;
|
|
1613
|
+
}
|
|
1614
|
+
if (!xe(t)) {
|
|
1615
|
+
const a = ae(t);
|
|
1616
|
+
this.timeChange.emit({
|
|
1617
|
+
key: this.el.id,
|
|
1618
|
+
value: a
|
|
1619
|
+
});
|
|
1620
|
+
return;
|
|
1621
|
+
}
|
|
1622
|
+
this.timeChange.emit({
|
|
1623
|
+
key: this.el.id,
|
|
1624
|
+
value: t
|
|
1625
|
+
});
|
|
1626
|
+
}
|
|
1627
|
+
handleOnInput(e) {
|
|
1628
|
+
var n;
|
|
1629
|
+
const t = (n = e.target) == null ? void 0 : n.value;
|
|
1630
|
+
if (ie(t)) {
|
|
1631
|
+
if (t === "") {
|
|
1632
|
+
const a = ve().format("hh:mma"), o = this.times.findIndex((s) => s.value === a);
|
|
1633
|
+
o > -1 && this.scrollToViewWithinParent(o);
|
|
1634
|
+
return;
|
|
1635
|
+
}
|
|
1636
|
+
if (!xe(t)) {
|
|
1637
|
+
const a = ae(t), o = this.times.findIndex((s) => s.value === a);
|
|
1638
|
+
o > -1 && this.scrollToViewWithinParent(o);
|
|
1639
|
+
return;
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
generateTimes() {
|
|
1644
|
+
const e = [];
|
|
1645
|
+
let t = Z().set("hour", 0).set("minute", 0).set("second", 0);
|
|
1646
|
+
this.minimumStartTime && (t = Z(this.minimumStartTime, "hh:mma"));
|
|
1647
|
+
const n = t.endOf("day").diff(t, "minutes"), a = Math.round(n / 15);
|
|
1648
|
+
for (let o = 0; o < a + 1; o++) {
|
|
1649
|
+
const s = t.add(o * 15, "minute");
|
|
1650
|
+
if (o == a && s.format("hh:mma").includes("am"))
|
|
1651
|
+
break;
|
|
1652
|
+
e.push({ id: o, value: s.format("hh:mma") });
|
|
1653
|
+
}
|
|
1654
|
+
return e;
|
|
1655
|
+
}
|
|
1656
|
+
handleComboboxKeyDown(e) {
|
|
1657
|
+
if (e.key === "ArrowDown") {
|
|
1658
|
+
if (e.preventDefault(), !this.showTimes) {
|
|
1659
|
+
this.showTimes = !0, this.shouldAutoScroll = !0;
|
|
1660
|
+
return;
|
|
1661
|
+
}
|
|
1662
|
+
if (this.ariaActivedescendant === "")
|
|
1663
|
+
this.ariaActivedescendant = this.times[0].id.toString(), this.focusOption(0);
|
|
1664
|
+
else {
|
|
1665
|
+
const t = this.times.findIndex((a) => a.id.toString() === this.ariaActivedescendant), n = t + 1 < this.times.length ? t + 1 : 0;
|
|
1666
|
+
this.ariaActivedescendant = this.times[n].id.toString(), this.focusOption(n);
|
|
1667
|
+
}
|
|
1668
|
+
} else if (e.key === "ArrowUp")
|
|
1669
|
+
if (e.preventDefault(), this.ariaActivedescendant === "")
|
|
1670
|
+
this.ariaActivedescendant = this.times[this.times.length - 1].id.toString(), this.focusOption(this.times.length - 1);
|
|
1671
|
+
else {
|
|
1672
|
+
const t = this.times.findIndex((a) => a.id.toString() === this.ariaActivedescendant), n = t - 1 >= 0 ? t - 1 : this.times.length - 1;
|
|
1673
|
+
this.ariaActivedescendant = this.times[n].id.toString(), this.focusOption(n);
|
|
1674
|
+
}
|
|
1675
|
+
else
|
|
1676
|
+
e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
|
|
1677
|
+
}
|
|
1678
|
+
handleListboxKeydown(e) {
|
|
1679
|
+
const t = this.times, n = t.findIndex((a) => a.id.toString() === this.ariaActivedescendant);
|
|
1680
|
+
if (e.key === "ArrowDown" || e.key === "Tab" && !e.shiftKey) {
|
|
1681
|
+
e.preventDefault();
|
|
1682
|
+
const a = n + 1 < t.length ? n + 1 : 0;
|
|
1683
|
+
this.ariaActivedescendant = t[a].id.toString(), this.focusOption(a);
|
|
1684
|
+
} else if (e.key === "ArrowUp" || e.key === "Tab" && e.shiftKey) {
|
|
1685
|
+
e.preventDefault();
|
|
1686
|
+
const a = n - 1 >= 0 ? n - 1 : t.length - 1;
|
|
1687
|
+
this.ariaActivedescendant = t[a].id.toString(), this.focusOption(a);
|
|
1688
|
+
} else if (e.key === "Enter") {
|
|
1689
|
+
if (e.preventDefault(), this.ariaActivedescendant) {
|
|
1690
|
+
const a = t[n];
|
|
1691
|
+
this.handleTimeChange(e, a.value), this.showTimes = !1, this.ariaActivedescendant = "", this.timeInput.focus();
|
|
1692
|
+
}
|
|
1693
|
+
} else
|
|
1694
|
+
e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
|
|
1695
|
+
}
|
|
1696
|
+
scrollToViewWithinParent(e) {
|
|
1697
|
+
var l;
|
|
1698
|
+
const t = this.times[e], n = (l = this.el.shadowRoot) == null ? void 0 : l.getElementById(t.id.toString()), a = this.timeMenu;
|
|
1699
|
+
this.ariaActivedescendant = t.id.toString();
|
|
1700
|
+
const o = n.getBoundingClientRect(), s = a.getBoundingClientRect();
|
|
1701
|
+
o.top < s.top ? a.scrollTop -= s.top - o.top : o.bottom > s.bottom && (a.scrollTop += o.bottom - s.bottom), o.left < s.left ? a.scrollLeft -= s.left - o.left : o.right > s.right && (a.scrollLeft += o.right - s.right);
|
|
1702
|
+
}
|
|
1703
|
+
focusOption(e) {
|
|
1704
|
+
var o;
|
|
1705
|
+
const t = this.times[e];
|
|
1706
|
+
if (!t)
|
|
1707
|
+
return;
|
|
1708
|
+
const n = t.id.toString(), a = (o = this.el.shadowRoot) == null ? void 0 : o.getElementById(n);
|
|
1709
|
+
a && (a.focus(), a.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
1710
|
+
}
|
|
1711
|
+
render() {
|
|
1712
|
+
return i(k, { key: "4a03bc9829bace5ed02129d99e12b6042f49386c" }, i("div", { key: "ccc660e6cd8727226b7418ee20fe700812f7c70b", class: "time-picker", part: "time-picker" }, i("input", { key: "24be2b42322194545575045f5624ac78bf8c643e", type: "text", name: this.name, id: this.name, part: "time-input", class: {
|
|
1713
|
+
"time-input": !0,
|
|
1714
|
+
error: !!this.err || this.hasError
|
|
1715
|
+
}, ref: (e) => this.timeInput = e, value: this.time, onClick: () => {
|
|
1716
|
+
this.showTimes = !0, this.shouldAutoScroll = !0;
|
|
1717
|
+
}, "aria-haspopup": "listbox", "aria-label": this.name, "aria-expanded": this.showTimes ? "true" : "false", placeholder: this.placeholder, onKeyDown: (e) => this.handleComboboxKeyDown(e), onInput: (e) => this.handleOnInput(e), onBlur: (e) => this.handleTimeAutocomplete(e) }), this.err && i("div", { class: "invalid-time-icon" }), this.showTimes && i("div", { class: "times", part: "times", ref: (e) => this.timeMenu = e }, i("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (e) => this.handleListboxKeydown(e) }, this.times.map((e) => i("li", { tabindex: "0", key: e.id, id: e.id.toString(), class: {
|
|
1718
|
+
focused: this.ariaActivedescendant === e.id.toString()
|
|
1719
|
+
}, onClick: (t) => {
|
|
1720
|
+
this.handleTimeChange(t, e.value), this.showTimes = !1, this.timeInput.focus();
|
|
1721
|
+
}, role: "option" }, `${e.value}`)))), !this.showTimes && this.err && i("p", { class: "error", id: "email-error" }, this.err)));
|
|
1722
|
+
}
|
|
1723
|
+
get el() {
|
|
1724
|
+
return _(this);
|
|
1725
|
+
}
|
|
1726
|
+
static get watchers() {
|
|
1727
|
+
return {
|
|
1728
|
+
minimumStartTime: ["minimumStartTimeChangedHandler"]
|
|
1729
|
+
};
|
|
1730
|
+
}
|
|
1731
|
+
};
|
|
1732
|
+
Qt.style = Xt;
|
|
1733
|
+
export {
|
|
1734
|
+
Ye as add_circle_icon,
|
|
1735
|
+
qe as button_component,
|
|
1736
|
+
Xe as calendar_info_icon,
|
|
1737
|
+
tt as calendar_patterns_icon,
|
|
1738
|
+
it as flow_icon,
|
|
1739
|
+
lt as location_icon,
|
|
1740
|
+
ct as location_off_icon,
|
|
1741
|
+
ut as multi_select_dropdown,
|
|
1742
|
+
_e as nylas_availability_picker,
|
|
1743
|
+
Ce as nylas_booking_calendar_picker,
|
|
1744
|
+
Te as nylas_buffer_time,
|
|
1745
|
+
Ee as nylas_calendar_picker,
|
|
1746
|
+
Oe as nylas_event_description,
|
|
1747
|
+
Se as nylas_event_duration,
|
|
1748
|
+
De as nylas_event_info,
|
|
1749
|
+
Ie as nylas_event_limits,
|
|
1750
|
+
Le as nylas_event_title,
|
|
1751
|
+
$e as nylas_limit_future_bookings,
|
|
1752
|
+
He as nylas_location_component,
|
|
1753
|
+
Ae as nylas_min_cancellation_notice,
|
|
1754
|
+
Qt as nylas_time_window_picker
|
|
1755
|
+
};
|