@nylas/react 1.1.0-canary.12 → 1.1.0-canary.13

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.
Files changed (129) hide show
  1. package/dist/add-circle-icon_22.entry-26980c9f.cjs +1 -0
  2. package/dist/add-circle-icon_22.entry-a63de90d.js +1895 -0
  3. package/dist/{archive-icon_7.entry-e892a458.js → archive-icon_7.entry-561a5deb.js} +13 -13
  4. package/dist/{archive-icon_7.entry-59d9e24f.cjs → archive-icon_7.entry-97628ff8.cjs} +1 -1
  5. package/dist/{arrow-icon.entry-834b8066.cjs → arrow-icon.entry-68a3ba5b.cjs} +1 -1
  6. package/dist/arrow-icon.entry-c9b46bbc.js +15 -0
  7. package/dist/{bold-icon_3.entry-0f038db3.js → bold-icon_3.entry-e5a6fea9.js} +4 -4
  8. package/dist/{bold-icon_3.entry-eb0fcdaa.cjs → bold-icon_3.entry-f8473940.cjs} +1 -1
  9. package/dist/{calendar-cancel-icon.entry-27a6f628.cjs → calendar-cancel-icon.entry-1fd6b27a.cjs} +1 -1
  10. package/dist/{calendar-cancel-icon.entry-96156441.js → calendar-cancel-icon.entry-4bc3ceb1.js} +2 -2
  11. package/dist/{calendar-check-icon_2.entry-b6d6d220.cjs → calendar-check-icon_2.entry-3f734e43.cjs} +1 -1
  12. package/dist/{calendar-check-icon_2.entry-c7c13e3e.js → calendar-check-icon_2.entry-a7033bf7.js} +11 -11
  13. package/dist/{calendar-icon.entry-e7f6a9a8.cjs → calendar-icon.entry-2943ea63.cjs} +1 -1
  14. package/dist/{calendar-icon.entry-f088fb14.js → calendar-icon.entry-2f963a7d.js} +4 -4
  15. package/dist/{chevron-icon_3.entry-8c6e6f74.cjs → chevron-icon_3.entry-ac1be504.cjs} +1 -1
  16. package/dist/{chevron-icon_3.entry-90a3e89c.js → chevron-icon_3.entry-d10c854b.js} +5 -5
  17. package/dist/clock-icon_2.entry-7c576457.cjs +1 -0
  18. package/dist/clock-icon_2.entry-c8b0693e.js +25 -0
  19. package/dist/close-icon.entry-5cc5ae00.cjs +1 -0
  20. package/dist/close-icon.entry-e01b32cc.js +15 -0
  21. package/dist/{constants-f34b9c6e-593e21cc.cjs → constants-f34b9c6e-0e1cb070.cjs} +1 -1
  22. package/dist/{constants-f34b9c6e-91f6ad05.js → constants-f34b9c6e-ada541f4.js} +1 -1
  23. package/dist/{document-refresh-icon.entry-ca98d879.js → document-refresh-icon.entry-a18e5222.js} +5 -5
  24. package/dist/document-refresh-icon.entry-b0927573.cjs +1 -0
  25. package/dist/elements/index.d.ts +4 -1
  26. package/dist/{elements-dc5b338e-60f95088.cjs → elements-dc5b338e-272b5dff.cjs} +1 -1
  27. package/dist/{elements-dc5b338e-68eab1e5.js → elements-dc5b338e-d6cbe948.js} +1 -1
  28. package/dist/{focus-visible-e8093c16-a0869441.cjs → focus-visible-e8093c16-6991ac1b.cjs} +1 -1
  29. package/dist/{focus-visible-e8093c16-b5d785fc.js → focus-visible-e8093c16-d239362e.js} +1 -1
  30. package/dist/{forward-icon_6.entry-84ac76ac.js → forward-icon_6.entry-230c7ab2.js} +9 -9
  31. package/dist/{forward-icon_6.entry-4b321b9a.cjs → forward-icon_6.entry-ee238c52.cjs} +3 -3
  32. package/dist/{globe-icon.entry-ef04c8bf.cjs → globe-icon.entry-539f0052.cjs} +1 -1
  33. package/dist/{globe-icon.entry-14a60f32.js → globe-icon.entry-e8c272c0.js} +2 -2
  34. package/dist/{google-logo-icon_4.entry-4fa3cb8e.js → google-logo-icon_4.entry-0c46cddd.js} +103 -93
  35. package/dist/google-logo-icon_4.entry-a5add4b4.cjs +1 -0
  36. package/dist/index-53420959-71fdd6ef.js +5 -0
  37. package/dist/index-53420959-f15601a9.cjs +1 -0
  38. package/dist/index-553c0327.cjs +42 -0
  39. package/dist/index-cd0e2d77.js +4977 -0
  40. package/dist/index-ef01c714-839c3029.cjs +41 -0
  41. package/dist/index-ef01c714-d85134a4.js +4971 -0
  42. package/dist/{index.es-9190f785-60475c4c.cjs → index.es-74f70f7d-1d137fdb.cjs} +5 -5
  43. package/dist/{index.es-9190f785-69269065.js → index.es-74f70f7d-960f947f.js} +11 -12
  44. package/dist/{info-icon_2.entry-fb099090.cjs → info-icon_2.entry-00ea6504.cjs} +1 -1
  45. package/dist/{info-icon_2.entry-45f6f01f.js → info-icon_2.entry-42f77d4b.js} +5 -5
  46. package/dist/{loading-icon.entry-67c8b1fa.js → loading-icon.entry-0692e093.js} +4 -4
  47. package/dist/{loading-icon.entry-eaabff41.cjs → loading-icon.entry-fb7464c3.cjs} +1 -1
  48. package/dist/{mailbox-store-29139d89-dd9d3d1b.cjs → mailbox-store-050a2914-9c975586.cjs} +1 -1
  49. package/dist/{mailbox-store-29139d89-e3513416.js → mailbox-store-050a2914-cfb1b1c0.js} +2 -2
  50. package/dist/{nylas-additional-participants.entry-a1fb4ef4.js → nylas-additional-participants.entry-1d7bda06.js} +12 -12
  51. package/dist/{nylas-additional-participants.entry-6413fc87.cjs → nylas-additional-participants.entry-d97b8bb4.cjs} +1 -1
  52. package/dist/{nylas-booked-event-card_10.entry-e435ff63.js → nylas-booked-event-card_10.entry-041a10c7.js} +255 -252
  53. package/dist/nylas-booked-event-card_10.entry-dfec7c8d.cjs +1 -0
  54. package/dist/{nylas-custom-booking-flow.entry-3e690bb7.cjs → nylas-custom-booking-flow.entry-3ec838df.cjs} +1 -1
  55. package/dist/{nylas-custom-booking-flow.entry-56075ecd.js → nylas-custom-booking-flow.entry-ced72cc5.js} +3 -3
  56. package/dist/nylas-form-card.entry-8d594514.cjs +1 -0
  57. package/dist/nylas-form-card.entry-9b8176ad.js +57 -0
  58. package/dist/{nylas-if-state.entry-1e4b0a58.cjs → nylas-if-state.entry-445ec109.cjs} +1 -1
  59. package/dist/{nylas-if-state.entry-3d22bca7.js → nylas-if-state.entry-eb11630d.js} +3 -3
  60. package/dist/{nylas-list-folders.entry-3da37b1c.cjs → nylas-list-folders.entry-32a1e254.cjs} +1 -1
  61. package/dist/{nylas-list-folders.entry-e634780d.js → nylas-list-folders.entry-822436d4.js} +3 -3
  62. package/dist/{nylas-list-threads.entry-26dbb8ff.js → nylas-list-threads.entry-0186e9e7.js} +4 -4
  63. package/dist/{nylas-list-threads.entry-ef4743af.cjs → nylas-list-threads.entry-181872dd.cjs} +1 -1
  64. package/dist/{nylas-login.entry-a76e4aae.cjs → nylas-login.entry-0261e74e.cjs} +1 -1
  65. package/dist/{nylas-login.entry-ff7d9db5.js → nylas-login.entry-7460c1d4.js} +3 -3
  66. package/dist/{nylas-mailbox-pagination.entry-fcb3cc47.js → nylas-mailbox-pagination.entry-107b3fbc.js} +2 -2
  67. package/dist/{nylas-mailbox-pagination.entry-565ee29b.cjs → nylas-mailbox-pagination.entry-eaf08163.cjs} +1 -1
  68. package/dist/{nylas-mailbox-toolbar-button.entry-3a94b1e9.cjs → nylas-mailbox-toolbar-button.entry-23fc08a6.cjs} +1 -1
  69. package/dist/{nylas-mailbox-toolbar-button.entry-ae13c538.js → nylas-mailbox-toolbar-button.entry-40e8d9ad.js} +8 -8
  70. package/dist/{nylas-mailbox.entry-6d86abe9.js → nylas-mailbox.entry-2199a6b4.js} +9 -10
  71. package/dist/nylas-mailbox.entry-de8618eb.cjs +1 -0
  72. package/dist/nylas-provider.entry-11a95d86.cjs +1 -0
  73. package/dist/{nylas-provider.entry-01e0944e.js → nylas-provider.entry-a8f8bad2.js} +9 -10
  74. package/dist/nylas-scheduler-editor.entry-73794266.cjs +2 -0
  75. package/dist/{nylas-scheduler-editor.entry-8f62880a.js → nylas-scheduler-editor.entry-c58c813c.js} +28 -14
  76. package/dist/nylas-scheduling.entry-b449ab24.cjs +1 -0
  77. package/dist/{nylas-scheduling.entry-f15b3106.js → nylas-scheduling.entry-fe9d6b69.js} +91 -68
  78. package/dist/{nylas-threads-refresh.entry-d62d0574.cjs → nylas-threads-refresh.entry-4f17fa6c.cjs} +1 -1
  79. package/dist/{nylas-threads-refresh.entry-d7727ccb.js → nylas-threads-refresh.entry-c8438752.js} +4 -4
  80. package/dist/{nylas-threads-search.entry-eec50b1b.cjs → nylas-threads-search.entry-0ed36372.cjs} +1 -1
  81. package/dist/{nylas-threads-search.entry-4803d20b.js → nylas-threads-search.entry-b1f88916.js} +4 -4
  82. package/dist/{nylas-view-thread.entry-2b85f8e2.js → nylas-view-thread.entry-8dfe1352.js} +3 -3
  83. package/dist/{nylas-view-thread.entry-5da789da.cjs → nylas-view-thread.entry-c50bea78.cjs} +1 -1
  84. package/dist/{people-icon.entry-b6426fe6.cjs → people-icon.entry-0875cac0.cjs} +1 -1
  85. package/dist/{people-icon.entry-63f63064.js → people-icon.entry-8392a21c.js} +6 -6
  86. package/dist/{play-icon_2.entry-a3262db3.js → play-icon_2.entry-4a15f215.js} +8 -8
  87. package/dist/play-icon_2.entry-d6ff1cc3.cjs +1 -0
  88. package/dist/react.cjs +1 -1
  89. package/dist/react.js +87 -84
  90. package/dist/{refresh-icon.entry-542f680c.cjs → refresh-icon.entry-1ebb9376.cjs} +1 -1
  91. package/dist/{refresh-icon.entry-64679ef7.js → refresh-icon.entry-76b2d888.js} +4 -4
  92. package/dist/{register-component-83e24412-51af5293.js → register-component-e4dc8778-408dc241.js} +1 -1
  93. package/dist/{register-component-83e24412-d76a2962.cjs → register-component-e4dc8778-99eb91ca.cjs} +1 -1
  94. package/dist/{scheduler-config-store-ec3b6190-2710b76a.cjs → scheduler-config-store-ec3b6190-4abd56df.cjs} +1 -1
  95. package/dist/{scheduler-config-store-ec3b6190-df09ddc0.js → scheduler-config-store-ec3b6190-f292fe19.js} +1 -1
  96. package/dist/scheduler-store-3afbcda0-166e84ff.cjs +1 -0
  97. package/dist/{scheduler-store-dabdbc4f-6f6096d6.js → scheduler-store-3afbcda0-53680387.js} +130 -89
  98. package/dist/time-period-selector.entry-846b64bd.cjs +1 -0
  99. package/dist/{time-period-selector.entry-8e6954f5.js → time-period-selector.entry-f6128367.js} +3 -3
  100. package/dist/{translate-icon.entry-57dedacf.js → translate-icon.entry-84778350.js} +6 -6
  101. package/dist/{translate-icon.entry-49a653f0.cjs → translate-icon.entry-f3060124.cjs} +1 -1
  102. package/dist/warning-icon.entry-246eb6fb.cjs +1 -0
  103. package/dist/warning-icon.entry-eeaae1a7.js +15 -0
  104. package/package.json +2 -2
  105. package/dist/add-circle-icon_21.entry-172d31c3.js +0 -6726
  106. package/dist/add-circle-icon_21.entry-71af48f1.cjs +0 -41
  107. package/dist/arrow-icon.entry-060b9b4f.js +0 -15
  108. package/dist/close-icon.entry-175b9674.cjs +0 -1
  109. package/dist/close-icon.entry-e694948f.js +0 -15
  110. package/dist/document-refresh-icon.entry-a54c74b9.cjs +0 -1
  111. package/dist/global-37eeb0cd-6c5934cf.cjs +0 -1
  112. package/dist/global-37eeb0cd-b42e0abc.js +0 -4
  113. package/dist/google-logo-icon_4.entry-ffeec491.cjs +0 -1
  114. package/dist/index-3a004ec1.cjs +0 -37
  115. package/dist/index-4c7e8f2f.js +0 -4045
  116. package/dist/index-92989ac4-69175657.js +0 -902
  117. package/dist/index-92989ac4-6f32ff2a.cjs +0 -6
  118. package/dist/nylas-booked-event-card_10.entry-ce660783.cjs +0 -1
  119. package/dist/nylas-form-card.entry-33ff95e1.js +0 -54
  120. package/dist/nylas-form-card.entry-64d7be4d.cjs +0 -1
  121. package/dist/nylas-mailbox.entry-8f41c35a.cjs +0 -1
  122. package/dist/nylas-provider.entry-65f0f8da.cjs +0 -1
  123. package/dist/nylas-scheduler-editor.entry-7dc20e4d.cjs +0 -2
  124. package/dist/nylas-scheduling.entry-1b6628a3.cjs +0 -1
  125. package/dist/play-icon_2.entry-2b8094d7.cjs +0 -1
  126. package/dist/scheduler-store-dabdbc4f-404dc261.cjs +0 -1
  127. package/dist/time-period-selector.entry-c5faae46.cjs +0 -1
  128. package/dist/warning-icon.entry-a7977526.js +0 -15
  129. package/dist/warning-icon.entry-bce861bd.cjs +0 -1
@@ -0,0 +1,1895 @@
1
+ import { r as m, h as i, c as w, g as k, d, H as _, I as W, J as F, K as ve, L as Ce, M as We, i as Ue, O as K, P as ae, Q as ie, R as xe, S as ke, T as U, U as Ke } from "./index-cd0e2d77.js";
2
+ import { R as C } from "./register-component-e4dc8778-408dc241.js";
3
+ import { T as we, E as _e } from "./constants-f34b9c6e-ada541f4.js";
4
+ import { s as ye } from "./index-ef01c714-d85134a4.js";
5
+ import "./index-53420959-71fdd6ef.js";
6
+ import "react";
7
+ import "react-dom";
8
+ const Ze = ".sc-add-circle-icon-h{display:flex}", Ye = Ze, Ve = class {
9
+ constructor(e) {
10
+ m(this, e), this.width = "24", this.height = "25";
11
+ }
12
+ render() {
13
+ return i("svg", { key: "4406ac2509a17d4887dd8dcb9ff8e9001e18643b", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "b08da8f266b5abfd1c43d61ed427bd34c92d0d5b", 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" }));
14
+ }
15
+ };
16
+ Ve.style = Ye;
17
+ const qe = "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}", Je = qe, Ge = class {
18
+ constructor(e) {
19
+ m(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;
20
+ }
21
+ render() {
22
+ const e = `button-${this.variant}` + (this.disabled ? " disabled" : "");
23
+ return i("button", { key: "b5d5ab5f387a6159524e0981e0b15f2594096130", 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: "d3d7ec151854d1164f8699b57fee9998eb9e2039" }));
24
+ }
25
+ };
26
+ Ge.style = Je;
27
+ const Xe = ".sc-calendar-info-icon-h{display:flex}", Qe = Xe, et = class {
28
+ constructor(e) {
29
+ m(this, e), this.width = "20", this.height = "20";
30
+ }
31
+ render() {
32
+ return i("svg", { key: "70a80808372e537f9e317ba568922f503d2fa358", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "f06b4115c72ac00183bfd9b7d9610608790ad051", 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" }));
33
+ }
34
+ };
35
+ et.style = Qe;
36
+ const tt = ".sc-calendar-patterns-icon-h{display:flex}", nt = tt, at = class {
37
+ constructor(e) {
38
+ m(this, e), this.width = "20", this.height = "20";
39
+ }
40
+ render() {
41
+ return i("svg", { key: "34186e64e6fa5e330d4c3cc027451c9aab4c4330", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "4f3c46e550436f3e9723af7f1bf96302cbe3d052", 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" }));
42
+ }
43
+ };
44
+ at.style = nt;
45
+ const it = ".sc-flow-icon-h{display:flex}", st = it, ot = class {
46
+ constructor(e) {
47
+ m(this, e), this.width = "16", this.height = "12";
48
+ }
49
+ render() {
50
+ return i("svg", { key: "02b7fda4b7e68b9339a18d0538388300b6eb0a81", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "c65115a97b68ef89e18ee6f47dbcab45da4ae3ff", 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" }));
51
+ }
52
+ };
53
+ ot.style = st;
54
+ const lt = ':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}@media screen and (max-width: 768px){:host{position:unset}}.dropdown{display:inline-block}.dropbtn{color:var(--nylas-base-800);padding:10px;font-size:1rem;font-family:var(--nylas-font-family);cursor:pointer;display:flex;gap:0.5rem;background:transparent;border:none;border-radius:var(--nylas-border-radius-2x);width:50px;padding:14px 16px;border-radius:var(--nylas-border-radius-2x)}.dropbtn.focus{background:transparent}.dropbtn:hover,.dropbtn:active{outline:1px solid var(--nylas-primary)}.dropbtn:active{outline:2px solid var(--nylas-primary)}.dropbtn span.chevron{display:flex;align-self:center}.dropbtn span.open{transform:rotate(90deg)}.dropbtn span.closed{transform:rotate(270deg)}.dropbtn span.selected-option{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:144px;font-size:14px;line-height:20px}@media screen and (max-width: 768px){.dropbtn span.selected-option{max-width:124px;font-size:16px}}.dropdown-content{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);max-width:306px;width:max-content;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1)}@media screen and (max-width: 768px){.dropdown-content{right:0;width:325px;max-width:unset}}.search-box{border-bottom:1px solid var(--nylas-base-200);padding:10px;position:sticky;top:0;background:var(--nylas-base-0)}.search-box .icon{position:absolute;top:1.25rem;left:1.25rem;color:var(--nylas-base-300)}.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 .selected{background-color:#e7e7e7}input[type=text]{width:-webkit-fill-available;padding:inherit;border:1px solid #ccc;border-radius:4px;position:sticky;background:no-repeat scroll 7px 7px;padding-left:30px;background-size:16px 16px}', rt = lt, dt = class {
55
+ constructor(e) {
56
+ m(this, e), this.inputOptionChanged = w(this, "inputOptionChanged", 7), this.name = void 0, this.options = [], this.defaultInputOption = void 0, this.inputValue = void 0, this.pluralizedLabel = "", this.selectedOption = this.defaultInputOption || null, this.isOpen = !1, this.filteredOptions = [...this.options], this.ariaActivedescendant = "", this.shouldAutoScroll = !1;
57
+ }
58
+ optionsChangedHandler(e, t) {
59
+ e !== t && (this.filteredOptions = e);
60
+ }
61
+ defaultSelectedOptionChangedHandler(e, t) {
62
+ e.label !== t.label && (this.selectedOption = e);
63
+ }
64
+ componentWillLoad() {
65
+ this.filteredOptions = this.options, !this.selectedOption && this.defaultInputOption && (this.selectedOption = this.defaultInputOption), !this.selectedOption && this.options.length > 0 && (this.selectedOption = this.options[0]);
66
+ }
67
+ toggleDropdown() {
68
+ this.isOpen = !this.isOpen;
69
+ }
70
+ selectOption(e) {
71
+ this.selectedOption = e, this.toggleDropdown(), this.inputOptionChanged.emit({
72
+ value: e.value,
73
+ name: this.name
74
+ });
75
+ }
76
+ handleOnInput(e) {
77
+ const t = e.target.value, n = this.options.findIndex((a) => a.label.toLowerCase().includes(t.toLowerCase()));
78
+ n > -1 && this.scrollToViewWithinParent(n), this.inputOptionChanged.emit({
79
+ value: t,
80
+ name: this.name
81
+ });
82
+ }
83
+ scrollToViewWithinParent(e) {
84
+ var l;
85
+ const t = this.options[e], n = (l = this.el.shadowRoot) == null ? void 0 : l.getElementById(t.value.toString()), a = this.optionsRef;
86
+ this.ariaActivedescendant = t.value.toString();
87
+ const o = n.getBoundingClientRect(), s = a.getBoundingClientRect();
88
+ o.top < s.top ? a.scrollTop -= s.top - o.top : o.bottom > s.bottom && (a.scrollTop += o.bottom - s.bottom);
89
+ }
90
+ handleSelectButtonKeyDown(e) {
91
+ var t;
92
+ switch (e.key) {
93
+ case "ArrowDown":
94
+ case "Enter":
95
+ e.preventDefault(), this.isOpen || this.toggleDropdown(), (t = this.inputRef) == null || t.focus();
96
+ break;
97
+ case "Escape":
98
+ this.isOpen = !1;
99
+ break;
100
+ }
101
+ }
102
+ handleClick(e) {
103
+ if (this.isOpen) {
104
+ const t = e.target.value, n = this.options.findIndex((a) => a.label.toLowerCase().includes(t.toLowerCase()));
105
+ n > -1 && setTimeout(() => {
106
+ this.scrollToViewWithinParent(n);
107
+ }, 10);
108
+ }
109
+ }
110
+ handleListboxKeydown(e) {
111
+ var a, o;
112
+ const t = this.filteredOptions, n = t.findIndex((s) => s.value === this.ariaActivedescendant);
113
+ if (e.key === "ArrowDown" || e.key === "Tab" && !e.shiftKey) {
114
+ if (e.preventDefault(), n === t.length - 1) {
115
+ this.ariaActivedescendant = "", (a = this.inputRef) == null || a.focus();
116
+ return;
117
+ }
118
+ const s = n + 1 < t.length ? n + 1 : 0;
119
+ this.ariaActivedescendant = t[s].value, this.focusOption(s);
120
+ } else if (e.key === "ArrowUp" || e.key === "Tab" && e.shiftKey) {
121
+ if (e.preventDefault(), n === 0) {
122
+ this.ariaActivedescendant = "", (o = this.inputRef) == null || o.focus();
123
+ return;
124
+ }
125
+ const s = n - 1 >= 0 ? n - 1 : t.length - 1;
126
+ this.ariaActivedescendant = t[s].value, this.focusOption(s);
127
+ } else
128
+ e.key === "Enter" ? (e.preventDefault(), this.ariaActivedescendant && this.selectOption(t[n])) : e.key === "Escape" && (this.isOpen = !1);
129
+ }
130
+ focusOption(e) {
131
+ var o;
132
+ const t = this.filteredOptions[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
+ handleComboboxKeyDown(e) {
139
+ if (e.key === "ArrowDown" || e.key == "Tab" && !e.shiftKey) {
140
+ if (e.preventDefault(), !this.isOpen) {
141
+ this.isOpen = !0, this.shouldAutoScroll = !0;
142
+ return;
143
+ }
144
+ this.ariaActivedescendant = this.filteredOptions[0].value, this.focusOption(0);
145
+ } else
146
+ e.key === "ArrowUp" || e.key === "Tab" && e.shiftKey ? (e.preventDefault(), this.ariaActivedescendant = this.filteredOptions[this.filteredOptions.length - 1].value, this.focusOption(this.filteredOptions.length - 1)) : e.key === "Escape" && (this.isOpen = !1);
147
+ }
148
+ handleOutsideClick(e) {
149
+ !e.composedPath().includes(this.el) && this.isOpen && (this.isOpen = !1);
150
+ }
151
+ render() {
152
+ return i("div", { key: "477367bf59c43e635a242508ee854ba785ea6232", class: "dropdown", part: "id_dropdown" }, i("input", { key: "39878fbabaec31690981124d85e3a2267b9cde4b", type: "text", name: this.name, id: this.name, part: "id_dropdown-input", class: { dropbtn: !0, open: this.isOpen }, value: this.inputValue, onClick: (e) => {
153
+ this.toggleDropdown(), this.shouldAutoScroll = !0, this.handleClick(e);
154
+ }, "aria-haspopup": "listbox", "aria-label": this.name, "aria-expanded": this.isOpen ? "true" : "false", onKeyDown: (e) => this.handleComboboxKeyDown(e), onInput: (e) => this.handleOnInput(e) }), this.isOpen ? i("div", { class: "dropdown-content", part: "id_dropdown-content", ref: (e) => this.optionsRef = e }, i("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (e) => this.handleListboxKeydown(e) }, this.filteredOptions.map((e) => i("li", { tabindex: "0", key: e.value, id: e.value, onClick: () => this.selectOption(e), role: "option", class: {
155
+ focused: this.ariaActivedescendant === e.value.toString()
156
+ } }, e.labelHTML ? e.labelHTML : e.label)))) : null);
157
+ }
158
+ get el() {
159
+ return k(this);
160
+ }
161
+ static get watchers() {
162
+ return {
163
+ options: ["optionsChangedHandler"],
164
+ defaultInputOption: ["defaultSelectedOptionChangedHandler"]
165
+ };
166
+ }
167
+ };
168
+ dt.style = rt;
169
+ const ct = ".sc-location-icon-h{display:flex}", pt = ct, ft = class {
170
+ constructor(e) {
171
+ m(this, e), this.width = "16", this.height = "18";
172
+ }
173
+ render() {
174
+ return i("svg", { key: "cfcb8d9cf76acec56ed63112cf9d9fa6cfcea52b", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "321a83e5d78176ac944316764d7a636b2a16a8a3", 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" }));
175
+ }
176
+ };
177
+ ft.style = pt;
178
+ const ut = ".sc-location-off-icon-h{display:flex}", ht = ut, bt = class {
179
+ constructor(e) {
180
+ m(this, e), this.width = "16", this.height = "18";
181
+ }
182
+ render() {
183
+ return i("svg", { key: "67b1b71715d064a7e4cba955a6f2408c60852393", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "0ee75a47b27780c9a6bb82dd53de377d7a163870", 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" }));
184
+ }
185
+ };
186
+ bt.style = ht;
187
+ const mt = ':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)}', yt = mt, gt = class {
188
+ constructor(e) {
189
+ m(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;
190
+ }
191
+ componentDidRender() {
192
+ d("multi-select-dropdown", "componentDidRender"), this.isOpen && this.shouldFocusFirstOption && (this.ariaActivedescendant = this.availableOptions[0].value, this.focusOption(0), this.shouldFocusFirstOption = !1);
193
+ }
194
+ handleOutsideClick(e) {
195
+ !e.composedPath().includes(this.el) && this.isOpen && (this.isOpen = !1);
196
+ }
197
+ selectOption(e) {
198
+ this.availableOptions = this.availableOptions.map((n) => (n.value === e.value && (n.selected = !e.selected), n));
199
+ const t = this.availableOptions.filter((n) => n.selected).map((n) => n.value);
200
+ this.selectedOptionsChanged.emit({
201
+ value: t,
202
+ name: this.name
203
+ });
204
+ }
205
+ toggleDropdown() {
206
+ this.isOpen = !this.isOpen, this.isOpen ? this.shouldFocusFirstOption = !0 : this.ariaActivedescendant = "";
207
+ }
208
+ handleSelectButtonKeyDown(e) {
209
+ switch (e.key) {
210
+ case "ArrowDown":
211
+ case "Enter":
212
+ e.preventDefault(), this.isOpen || this.toggleDropdown();
213
+ break;
214
+ case "Escape":
215
+ this.isOpen = !1;
216
+ break;
217
+ }
218
+ }
219
+ handleListboxKeydown(e) {
220
+ const t = this.availableOptions, n = t.findIndex((a) => a.value === this.ariaActivedescendant);
221
+ switch (e.key) {
222
+ case "ArrowDown":
223
+ case "Tab":
224
+ if (e.shiftKey) {
225
+ e.preventDefault();
226
+ const o = n - 1 >= 0 ? n - 1 : t.length - 1;
227
+ this.ariaActivedescendant = t[o].value, this.focusOption(o);
228
+ } else {
229
+ e.preventDefault();
230
+ const o = n + 1 < t.length ? n + 1 : 0;
231
+ this.ariaActivedescendant = t[o].value, this.focusOption(o);
232
+ }
233
+ break;
234
+ case "ArrowUp":
235
+ e.preventDefault();
236
+ const a = n - 1 >= 0 ? n - 1 : t.length - 1;
237
+ this.ariaActivedescendant = t[a].value, this.focusOption(a);
238
+ break;
239
+ case "Enter":
240
+ e.preventDefault(), this.ariaActivedescendant && this.selectOption(t[n]);
241
+ break;
242
+ case "Escape":
243
+ this.isOpen = !1;
244
+ break;
245
+ }
246
+ }
247
+ focusOption(e) {
248
+ var o;
249
+ const t = this.availableOptions[e];
250
+ if (!t)
251
+ return;
252
+ const n = t.value, a = (o = this.el.shadowRoot) == null ? void 0 : o.getElementById(n);
253
+ a && (a.focus(), a.scrollIntoView({ behavior: "smooth", block: "nearest" }));
254
+ }
255
+ getSelectedOptions() {
256
+ return this.availableOptions.filter((e) => e.selected);
257
+ }
258
+ renderOption(e) {
259
+ return i("li", { key: e.value, id: e.value, role: "option", tabindex: "0", "aria-selected": e.selected ? "true" : "false", onClick: (t) => {
260
+ t.stopImmediatePropagation(), this.selectOption(e);
261
+ }, 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)));
262
+ }
263
+ render() {
264
+ var e, t;
265
+ return i(_, { key: "a0411f59ebf50d71a4d9b396ad1a6c2725ee2975" }, i("div", { key: "7b093446e0cf5a3a4f0028245f6d122d0800fec0", class: "dropdown", part: "msd_dropdown" }, i("label", { key: "b49fe2b3d2abf8842c19dbe043f76c6584d8d0b9", class: "dropdown-label" }, this.label, i("slot", { key: "2ade01a138047872fd4123467a0f269d0355c2f9", name: "label-icon", "aria-hidden": "true" })), i("button", { key: "2f457812f885eec9b61b37dbb84e3914d8987606", 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: "292fac636c3a262dd513760bf8056b59e0a257fe", name: "select-icon", "aria-hidden": "true" }), i("span", { key: "c63e21f5bd68a699d446138193b2cb83e763e4a8", 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: "11b35ef316881fcab1ae7d3c4921cf5e2be915c1", class: this.isOpen ? "open" : "closed", "aria-hidden": "true" }, i("chevron-icon", { key: "715469190dbdb8a9cbed4985117dff1345a29804", 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));
266
+ }
267
+ get el() {
268
+ return k(this);
269
+ }
270
+ };
271
+ gt.style = yt;
272
+ const vt = ':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)}', xt = vt;
273
+ var kt = function(e, t, n, a) {
274
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
275
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
276
+ s = Reflect.decorate(e, t, n, a);
277
+ else
278
+ for (var r = e.length - 1; r >= 0; r--)
279
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
280
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
281
+ }, se = function(e, t) {
282
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
283
+ return Reflect.metadata(e, t);
284
+ };
285
+ const Oe = class {
286
+ constructor(e) {
287
+ m(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 = {
288
+ SUN: [],
289
+ MON: [{ start: "09:00am", end: "05:00pm" }],
290
+ TUE: [{ start: "09:00am", end: "05:00pm" }],
291
+ WED: [{ start: "09:00am", end: "05:00pm" }],
292
+ THU: [{ start: "09:00am", end: "05:00pm" }],
293
+ FRI: [{ start: "09:00am", end: "05:00pm" }],
294
+ SAT: []
295
+ }, this.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.overlapDays = {};
296
+ }
297
+ elementNameChangedHandler(e) {
298
+ d("nylas-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
299
+ }
300
+ configChangedHandler(e) {
301
+ var n, a, o;
302
+ const t = (n = e == null ? void 0 : e.participants) == null ? void 0 : n.find((s) => s.is_organizer);
303
+ 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);
304
+ }
305
+ scheduleChanged(e, t) {
306
+ var n;
307
+ if (e !== t) {
308
+ this.valueChanged.emit({
309
+ value: {
310
+ openHours: this.scheduleToOpenHours(e),
311
+ timezone: this.timezone
312
+ },
313
+ name: this.name
314
+ });
315
+ let a = {};
316
+ if (Object.keys(e).forEach((o) => {
317
+ const s = e[o];
318
+ if (s.length > 0) {
319
+ const l = this.getOverlaps(s);
320
+ l.length > 0 && (a[o] = l);
321
+ }
322
+ }), this.overlapDays = a, typeof this.internals.setFormValue != "function")
323
+ return;
324
+ if (Object.keys(a).length > 0) {
325
+ const o = (n = this.host.shadowRoot) == null ? void 0 : n.getElementById(Object.keys(a)[0]);
326
+ o && (d("nylas-availability-picker", "The time ranges are overlapping. Overlap: ", a), this.internals.setValidity({ customError: !0 }, "Overlapping time ranges found", o));
327
+ } else
328
+ this.internals.setValidity({ customError: !1 }), this.internals.setFormValue(JSON.stringify({
329
+ openHours: this.scheduleToOpenHours(this.schedule),
330
+ timezone: this.timezone
331
+ }));
332
+ }
333
+ }
334
+ selectedOptionChangedHandler(e) {
335
+ const { name: t, value: n } = e.detail;
336
+ if (t === "timezone") {
337
+ if (this.timezone = n, typeof this.internals.setFormValue != "function")
338
+ return;
339
+ this.internals.setFormValue(JSON.stringify({
340
+ openHours: this.scheduleToOpenHours(this.schedule),
341
+ timezone: this.timezone
342
+ }));
343
+ }
344
+ }
345
+ connectedCallback() {
346
+ d("nylas-availability-picker", "connectedCallback");
347
+ }
348
+ disconnectedCallback() {
349
+ d("nylas-availability-picker", "disconnectedCallback");
350
+ }
351
+ componentWillLoad() {
352
+ d("nylas-availability-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
353
+ }
354
+ componentDidLoad() {
355
+ 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({
356
+ openHours: this.scheduleToOpenHours(this.schedule),
357
+ timezone: this.timezone
358
+ }));
359
+ }
360
+ getOverlaps(e) {
361
+ let t = e.map((a, o) => ({
362
+ start: W(a.start),
363
+ end: W(a.end),
364
+ originalIndex: o
365
+ }));
366
+ t.sort((a, o) => a.start - o.start);
367
+ let n = [];
368
+ for (let a = 1; a < t.length; a++)
369
+ 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));
370
+ return n.sort((a, o) => a - o);
371
+ }
372
+ addTimeRange(e) {
373
+ const t = this.schedule[e], n = 0, a = 1425;
374
+ if (t.length === 0)
375
+ this.schedule[e] = [{ start: "09:00am", end: "05:00pm" }];
376
+ else {
377
+ const o = t.map((l) => ({
378
+ start: W(l.start),
379
+ end: W(l.end)
380
+ })).sort((l, r) => l.start - r.start), s = o[o.length - 1].end;
381
+ if (s + 60 <= a)
382
+ this.schedule[e].push({
383
+ start: F(U(s)),
384
+ end: F(U(s + 60))
385
+ });
386
+ else {
387
+ let l = !1;
388
+ if (o[0].start > n + 60 && (this.schedule[e].push({
389
+ start: F(U(n)),
390
+ end: F(U(n + 60))
391
+ }), l = !0), !l)
392
+ for (let r = 0; r < o.length - 1; r++) {
393
+ const h = o[r].end;
394
+ if (o[r + 1].start - h >= 60) {
395
+ this.schedule[e].push({
396
+ start: F(U(h)),
397
+ end: F(U(h + 60))
398
+ });
399
+ break;
400
+ }
401
+ }
402
+ }
403
+ }
404
+ this.schedule[e].sort((o, s) => W(o.start) - W(s.start)), this.schedule = { ...this.schedule };
405
+ }
406
+ removeTimeRange(e, t) {
407
+ this.schedule[e].splice(t, 1), this.schedule = { ...this.schedule };
408
+ }
409
+ setTime(e) {
410
+ const { key: t, value: n } = e.detail, [a, o] = t.split("_"), [s, l] = a.split(":");
411
+ 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 };
412
+ }
413
+ setFormError(e) {
414
+ var s;
415
+ const { key: t } = e.detail, [n, a] = t.split("_"), o = (s = this.host.shadowRoot) == null ? void 0 : s.getElementById(t);
416
+ o && this.internals.setValidity({ customError: !0 }, `Invalid ${a} time`, o);
417
+ }
418
+ openHoursToSchedule(e) {
419
+ const t = {
420
+ SUN: [],
421
+ MON: [],
422
+ TUE: [],
423
+ WED: [],
424
+ THU: [],
425
+ FRI: [],
426
+ SAT: []
427
+ };
428
+ e.forEach((n) => {
429
+ n.days.forEach((a) => {
430
+ const o = this.getDayKey(a), s = F(n.start), l = F(n.end), r = { start: s, end: l };
431
+ let h = !1;
432
+ t[o] && (h = t[o].some((p) => p.start === r.start && p.end === r.end)), h || (t[o] ? t[o].push(r) : t[o] = [r]);
433
+ });
434
+ }), this.timezone = this.defaultTimezone, this.schedule = t;
435
+ }
436
+ getDayKey(e) {
437
+ return ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"][e];
438
+ }
439
+ scheduleToOpenHours(e) {
440
+ const t = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
441
+ let n = /* @__PURE__ */ new Map();
442
+ t.forEach((o, s) => {
443
+ e[o] && e[o].forEach((l) => {
444
+ const r = ve(l.start), h = ve(l.end), p = `${r}-${h}`;
445
+ if (!n.has(p))
446
+ n.set(p, { days: [s], start: r, end: h });
447
+ else {
448
+ let u = n.get(p);
449
+ u && (u.days.push(s), n.set(p, u));
450
+ }
451
+ });
452
+ });
453
+ let a = [];
454
+ return n.forEach((o, s) => {
455
+ a.push({
456
+ days: o.days,
457
+ start: o.start,
458
+ end: o.end,
459
+ timezone: this.timezone
460
+ });
461
+ }), a;
462
+ }
463
+ render() {
464
+ const e = Object.keys(we).map((t) => ({
465
+ label: we[t],
466
+ value: t
467
+ }));
468
+ return i(_, { key: "31a09de392c342f1958a8902e4fe14520f3e8456" }, i("div", { key: "5b54b628bcb882aa24ec22b930701d235a08632b", class: "nylas-availability-picker" }, i("div", { key: "5b3e816afde7359c996bafb2ad98cc9432ea4b25", class: "header", part: "nap__header" }, i("h3", { key: "e0110aa3f8474c17acb48bfea19951c304261cd8" }, "General availability"), i("p", { key: "9a75a45b67bd070f7a9b3ab8334f189b11f7663a" }, "Set your availability for scheduling meetings.")), i("div", { key: "4bb3c1bef9b889c8c2e8d4f14a552ca4e2790194", class: "content" }, i("div", { key: "5e7e66c5efa4de3ed8200185892ab41622174b10", class: "select-timezone", part: "nap__select-timezone" }, i("h4", { key: "a5ea58a9bf26d568a37943054e92bab6100746fc", class: "sub-header" }, "Select timezone", i("span", { key: "1ad6f96e6565d7cfea5b69550aed6f0e81b473fa", class: "icon" }, i("tooltip-component", { key: "99cf87bc40b0ef6a81fbf00e5900df45893cb746" }, i("info-icon", { key: "3e7ec881948c07e4874967a3c21a7a091a5f9004", slot: "tooltip-icon" }), i("span", { key: "587a86479c784bf7c158e2f32c0a400c0ac81c9d", slot: "tooltip-content" }, "Select your timezone for displaying availability.")))), i("select-dropdown", { key: "efcd0485aa4fc975b0cab24b9db94b3de1141281", 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: "734e759c7f5888d6622ddac4fc6a1ed0fd1088e3", slot: "select-icon" }, i("globe-icon", { key: "f5fb31381fce113687b5a0a9aae68d95e4bb9d13", width: "20", height: "20" })))), i("div", { key: "1c3b5fb0a01ce5e5b987bfdf237e0484a4fda118", class: "availability", part: "nap__availability" }, Object.keys(this.schedule).map((t) => {
469
+ const n = t, a = this.schedule[t];
470
+ 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: () => {
471
+ a.length > 0 ? this.schedule[n] = [] : this.schedule[n] = [{ start: "09:00am", end: "05:00pm" }], this.schedule = { ...this.schedule };
472
+ } }), 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) => {
473
+ var h, p;
474
+ const l = `${t}:${s}_start`, r = `${t}:${s}_end`;
475
+ 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: (p = this.overlapDays[n]) == null ? void 0 : p.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)));
476
+ }), 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));
477
+ })))));
478
+ }
479
+ static get formAssociated() {
480
+ return !0;
481
+ }
482
+ get host() {
483
+ return k(this);
484
+ }
485
+ static get watchers() {
486
+ return {
487
+ name: ["elementNameChangedHandler"],
488
+ selectedConfiguration: ["configChangedHandler"],
489
+ schedule: ["scheduleChanged"]
490
+ };
491
+ }
492
+ };
493
+ kt([
494
+ C({
495
+ name: "nylas-availability-picker",
496
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
497
+ fireRegisterEvent: !0
498
+ }),
499
+ se("design:type", Function),
500
+ se("design:paramtypes", []),
501
+ se("design:returntype", void 0)
502
+ ], Oe.prototype, "render", null);
503
+ Oe.style = xt;
504
+ const wt = ':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}', _t = wt;
505
+ var Ct = function(e, t, n, a) {
506
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
507
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
508
+ s = Reflect.decorate(e, t, n, a);
509
+ else
510
+ for (var r = e.length - 1; r >= 0; r--)
511
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
512
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
513
+ }, oe = function(e, t) {
514
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
515
+ return Reflect.metadata(e, t);
516
+ };
517
+ const Te = class {
518
+ constructor(e) {
519
+ m(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 = "";
520
+ }
521
+ connectedCallback() {
522
+ d("nylas-booking-calendar-picker", "connectedCallback");
523
+ }
524
+ disconnectedCallback() {
525
+ d("nylas-booking-calendar-picker", "disconnectedCallback");
526
+ }
527
+ componentWillLoad() {
528
+ d("nylas-booking-calendar-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
529
+ }
530
+ componentDidLoad() {
531
+ var e, t;
532
+ 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) || "";
533
+ }
534
+ componentWillUpdate() {
535
+ d("nylas-booking-calendar-picker", "componentWillUpdate");
536
+ }
537
+ componentDidUpdate() {
538
+ d("nylas-booking-calendar-picker", "componentDidUpdate");
539
+ }
540
+ componentWillRender() {
541
+ d("nylas-booking-calendar-picker", "componentWillRender");
542
+ }
543
+ componentDidRender() {
544
+ d("nylas-booking-calendar-picker", "componentDidRender");
545
+ }
546
+ elementNameChangedHandler(e) {
547
+ d("nylas-booking-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
548
+ }
549
+ selectedOptionChangedHandler(e) {
550
+ d("nylas-booking-calendar-picker", "selectedOptionChangedHandler", e.detail);
551
+ const t = (n) => {
552
+ const { value: a } = n.detail;
553
+ this.selectedCalendar = a, this.internals.setFormValue(a.toString(), this.name);
554
+ };
555
+ this.valueChanged.emit({ value: e.detail.value, name: this.name, valueChanged: t });
556
+ }
557
+ render() {
558
+ var t;
559
+ const e = ((t = this.calendars) == null ? void 0 : t.map((n) => ({
560
+ value: n.id,
561
+ label: n.name
562
+ }))) ?? [];
563
+ return i(_, 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...")))));
564
+ }
565
+ static get formAssociated() {
566
+ return !0;
567
+ }
568
+ get host() {
569
+ return k(this);
570
+ }
571
+ static get watchers() {
572
+ return {
573
+ name: ["elementNameChangedHandler"]
574
+ };
575
+ }
576
+ };
577
+ Ct([
578
+ C({
579
+ name: "nylas-booking-calendar-picker",
580
+ stateToProps: /* @__PURE__ */ new Map([
581
+ ["schedulerConfig.calendars", "calendars"],
582
+ ["schedulerConfig.currentUser", "currentUser"]
583
+ ]),
584
+ eventToProps: {
585
+ valueChanged: async (e, t) => {
586
+ const { valueChanged: n } = e.detail;
587
+ n && n(e);
588
+ }
589
+ },
590
+ fireRegisterEvent: !0
591
+ }),
592
+ oe("design:type", Function),
593
+ oe("design:paramtypes", []),
594
+ oe("design:returntype", void 0)
595
+ ], Te.prototype, "render", null);
596
+ Te.style = _t;
597
+ const Ot = ':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}', Tt = Ot;
598
+ var It = function(e, t, n, a) {
599
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
600
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
601
+ s = Reflect.decorate(e, t, n, a);
602
+ else
603
+ for (var r = e.length - 1; r >= 0; r--)
604
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
605
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
606
+ }, le = function(e, t) {
607
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
608
+ return Reflect.metadata(e, t);
609
+ };
610
+ const Ie = class {
611
+ constructor(e) {
612
+ m(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;
613
+ }
614
+ connectedCallback() {
615
+ d("nylas-buffer-time", "connectedCallback");
616
+ }
617
+ disconnectedCallback() {
618
+ d("nylas-buffer-time", "disconnectedCallback");
619
+ }
620
+ componentWillLoad() {
621
+ d("nylas-buffer-time", "componentWillLoad"), this.host.setAttribute("name", this.name);
622
+ }
623
+ componentDidLoad() {
624
+ if (d("nylas-buffer-time", "componentDidLoad"), typeof this.internals.setFormValue == "function") {
625
+ const e = {
626
+ before: this.selectedBeforeBufferTime,
627
+ after: this.selectedAfterBufferTime
628
+ };
629
+ this.internals.setFormValue(JSON.stringify(e), this.name);
630
+ }
631
+ this.selectedAfterBufferTime = this.buffer.after, this.selectedBeforeBufferTime = this.buffer.before;
632
+ }
633
+ componentWillUpdate() {
634
+ d("nylas-buffer-time", "componentWillUpdate");
635
+ }
636
+ componentDidUpdate() {
637
+ d("nylas-buffer-time", "componentDidUpdate");
638
+ }
639
+ componentWillRender() {
640
+ d("nylas-buffer-time", "componentWillRender");
641
+ }
642
+ componentDidRender() {
643
+ d("nylas-buffer-time", "componentDidRender");
644
+ }
645
+ elementNameChangedHandler(e) {
646
+ d("nylas-buffer-time", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
647
+ }
648
+ selectedOptionChangedHandler(e) {
649
+ d("nylas-buffer-time", "selectedOptionChangedHandler", e.detail);
650
+ const t = (n) => {
651
+ const { value: a, name: o } = n.detail;
652
+ o === "before-buffer-time" ? this.selectedBeforeBufferTime = parseInt(a) : o === "after-buffer-time" && (this.selectedAfterBufferTime = parseInt(a));
653
+ const s = {
654
+ before: this.selectedBeforeBufferTime,
655
+ after: this.selectedAfterBufferTime
656
+ };
657
+ this.internals.setFormValue(JSON.stringify(s), "booking-calendar");
658
+ };
659
+ this.valueChanged.emit({ ...e.detail, valueChanged: t });
660
+ }
661
+ renderPreview() {
662
+ const a = (l) => {
663
+ const r = Math.floor(l / 30), h = l % 30 / 30 * 10;
664
+ return {
665
+ fullSlots: r,
666
+ partialFillHeight: h
667
+ };
668
+ }, o = () => {
669
+ const { fullSlots: l, partialFillHeight: r } = a(this.selectedBeforeBufferTime);
670
+ return Array.from({ length: 4 }, (h, p) => {
671
+ const u = this.selectedBeforeBufferTime > 0 && p > 4 - l - 1, g = this.selectedBeforeBufferTime > 0 && p === 4 - l - 1 && r > 0;
672
+ let v = {};
673
+ 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: p, class: `slot ${u ? "active" : ""}`, style: {
674
+ height: "10px",
675
+ ...v
676
+ } });
677
+ });
678
+ }, s = () => {
679
+ const { fullSlots: l, partialFillHeight: r } = a(this.selectedAfterBufferTime);
680
+ return Array.from({ length: 4 }, (h, p) => {
681
+ const u = this.selectedAfterBufferTime > 0 && p < l, g = p === l && r > 0;
682
+ let v = {};
683
+ 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: p, class: `slot ${u ? "active" : ""}`, style: {
684
+ height: "10px",
685
+ ...v
686
+ } });
687
+ });
688
+ };
689
+ return i("div", { class: "preview-container" }, o(), i("div", { class: "event-slot", style: { height: "20px" } }), s());
690
+ }
691
+ render() {
692
+ const e = Array.from({ length: 25 }, (t, n) => {
693
+ const a = n * 5;
694
+ return {
695
+ label: a.toString(),
696
+ value: a
697
+ };
698
+ });
699
+ return i(_, 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()))));
700
+ }
701
+ static get formAssociated() {
702
+ return !0;
703
+ }
704
+ get host() {
705
+ return k(this);
706
+ }
707
+ static get watchers() {
708
+ return {
709
+ name: ["elementNameChangedHandler"]
710
+ };
711
+ }
712
+ };
713
+ It([
714
+ C({
715
+ name: "nylas-buffer-time",
716
+ eventToProps: {
717
+ valueChanged: async (e, t) => {
718
+ const { valueChanged: n } = e.detail;
719
+ n && n(e);
720
+ }
721
+ },
722
+ fireRegisterEvent: !0
723
+ }),
724
+ le("design:type", Function),
725
+ le("design:paramtypes", []),
726
+ le("design:returntype", void 0)
727
+ ], Ie.prototype, "render", null);
728
+ Ie.style = Tt;
729
+ 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;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}', St = Dt;
730
+ var Et = function(e, t, n, a) {
731
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
732
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
733
+ s = Reflect.decorate(e, t, n, a);
734
+ else
735
+ for (var r = e.length - 1; r >= 0; r--)
736
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
737
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
738
+ }, re = function(e, t) {
739
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
740
+ return Reflect.metadata(e, t);
741
+ };
742
+ const De = class {
743
+ constructor(e) {
744
+ m(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 = [];
745
+ }
746
+ elementNameChangedHandler(e) {
747
+ d("nylas-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
748
+ }
749
+ connectedCallback() {
750
+ d("nylas-calendar-picker", "connectedCallback");
751
+ }
752
+ disconnectedCallback() {
753
+ d("nylas-calendar-picker", "disconnectedCallback");
754
+ }
755
+ componentWillLoad() {
756
+ d("nylas-calendar-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
757
+ }
758
+ componentDidLoad() {
759
+ d("nylas-calendar-picker", "componentDidLoad"), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(this.defaultSelectedCalendars.toString(), "calendar");
760
+ }
761
+ componentWillUpdate() {
762
+ d("nylas-calendar-picker", "componentWillUpdate");
763
+ }
764
+ componentDidUpdate() {
765
+ d("nylas-calendar-picker", "componentDidUpdate");
766
+ }
767
+ componentWillRender() {
768
+ d("nylas-calendar-picker", "componentWillRender");
769
+ }
770
+ componentDidRender() {
771
+ d("nylas-calendar-picker", "componentDidRender");
772
+ }
773
+ selectedOptionsChangedHandler(e) {
774
+ d("nylas-calendar-picker", "selectedOptionChangedHandler", e.detail);
775
+ const t = (n) => {
776
+ const { value: a } = n.detail;
777
+ this.selectedCalendars = [...a], this.internals.setFormValue(a.toString(), "calendar");
778
+ };
779
+ this.valueChanged.emit({ ...e.detail, name: this.name, valueChangedHandler: t });
780
+ }
781
+ render() {
782
+ var t;
783
+ const e = ((t = this.calendars) == null ? void 0 : t.map((n) => {
784
+ var a, o, s, l;
785
+ return {
786
+ value: n.id,
787
+ label: n.name,
788
+ 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)
789
+ };
790
+ })) ?? [];
791
+ return i(_, 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...")))));
792
+ }
793
+ static get formAssociated() {
794
+ return !0;
795
+ }
796
+ get host() {
797
+ return k(this);
798
+ }
799
+ static get watchers() {
800
+ return {
801
+ name: ["elementNameChangedHandler"]
802
+ };
803
+ }
804
+ };
805
+ Et([
806
+ C({
807
+ name: "nylas-calendar-picker",
808
+ stateToProps: /* @__PURE__ */ new Map([
809
+ ["schedulerConfig.calendars", "calendars"],
810
+ ["schedulerConfig.currentUser", "currentUser"]
811
+ ]),
812
+ eventToProps: {
813
+ valueChanged: async (e, t) => {
814
+ const { valueChangedHandler: n } = e.detail;
815
+ n && n(e);
816
+ }
817
+ },
818
+ fireRegisterEvent: !0
819
+ }),
820
+ re("design:type", Function),
821
+ re("design:paramtypes", []),
822
+ re("design:returntype", void 0)
823
+ ], De.prototype, "render", null);
824
+ De.style = St;
825
+ const Lt = ':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}', $t = Lt;
826
+ var Ht = function(e, t, n, a) {
827
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
828
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
829
+ s = Reflect.decorate(e, t, n, a);
830
+ else
831
+ for (var r = e.length - 1; r >= 0; r--)
832
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
833
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
834
+ }, de = function(e, t) {
835
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
836
+ return Reflect.metadata(e, t);
837
+ };
838
+ const Se = class {
839
+ constructor(e) {
840
+ var t, n;
841
+ m(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) || "";
842
+ }
843
+ elementNameChangedHandler(e) {
844
+ d("nylas-event-description", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
845
+ }
846
+ selectedConfigurationChangedHandler(e, t) {
847
+ var n, a;
848
+ 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);
849
+ }
850
+ connectedCallback() {
851
+ d("nylas-event-description", "connectedCallback");
852
+ }
853
+ componentWillLoad() {
854
+ d("nylas-event-description", "componentWillLoad"), this.host.setAttribute("name", this.name);
855
+ }
856
+ componentDidLoad() {
857
+ d("nylas-event-description", "componentDidLoad");
858
+ }
859
+ disconnectedCallback() {
860
+ d("nylas-event-description", "disconnectedCallback");
861
+ }
862
+ handleChange(e) {
863
+ const t = ye(e.target.value);
864
+ this.description = t, this.internals.setFormValue(t, "description"), this.valueChanged.emit({ value: t, name: this.name });
865
+ }
866
+ render() {
867
+ return i(_, { key: "66d2eae749fd438176c41cc4cb73e76025d1f224" }, i("div", { key: "aa8302861fb0c900b290aafcee5d07d1a04af7f5", class: "nylas-event-description", part: "nedesc" }, i("label", { key: "c0f2b80af2ae8219b8cf977e4145d3a58c1ae38d", htmlFor: "description" }, "Event description", i("span", { key: "e7ec771fc84b256a3511cb6e4238fd4fb13e9c37", class: "label-icon" }, i("tooltip-component", { key: "5b1a43fd9ba2a50f37f5b4c36233fbc14873ed02" }, i("info-icon", { key: "5ff39c03142fbd56e842298fb268bcf3b157fb70", slot: "tooltip-icon" }), i("span", { key: "3e5d6cd7e616f84fb58bacfcd4bf68da52798010", slot: "tooltip-content" }, "Provide any additional details for your event.")))), i("textarea", { key: "19f0e318d74d28a9ddc0a4401b05f49650fffd2b", id: "description", part: "nedesc__textarea", name: "description", value: this.description, maxlength: "8192", onInput: (e) => this.handleChange(e) })));
868
+ }
869
+ static get formAssociated() {
870
+ return !0;
871
+ }
872
+ get host() {
873
+ return k(this);
874
+ }
875
+ static get watchers() {
876
+ return {
877
+ name: ["elementNameChangedHandler"],
878
+ selectedConfiguration: ["selectedConfigurationChangedHandler"]
879
+ };
880
+ }
881
+ };
882
+ Ht([
883
+ C({
884
+ name: "nylas-event-description",
885
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
886
+ eventToProps: {},
887
+ fireRegisterEvent: !0
888
+ }),
889
+ de("design:type", Function),
890
+ de("design:paramtypes", []),
891
+ de("design:returntype", void 0)
892
+ ], Se.prototype, "render", null);
893
+ Se.style = $t;
894
+ const At = ':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 input-dropdown::part(id_dropdown-input){border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:12px 16px;width:50px}.nylas-event-duration__wrapper input-dropdown::part(id_dropdown-content){width:100%;min-width:unset;height:200px}', Mt = At;
895
+ var Ft = function(e, t, n, a) {
896
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
897
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
898
+ s = Reflect.decorate(e, t, n, a);
899
+ else
900
+ for (var r = e.length - 1; r >= 0; r--)
901
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
902
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
903
+ }, ce = function(e, t) {
904
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
905
+ return Reflect.metadata(e, t);
906
+ };
907
+ const Ee = class {
908
+ constructor(e) {
909
+ m(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, this.durationMinutesOptions = [
910
+ { value: 15, label: "15" },
911
+ { value: 30, label: "30" },
912
+ { value: 45, label: "45" },
913
+ { value: 60, label: "60" }
914
+ ];
915
+ }
916
+ elementNameChangedHandler(e) {
917
+ d("nylas-event-duration", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
918
+ }
919
+ selectedConfigurationChangedHandler(e) {
920
+ var n;
921
+ const t = (n = e == null ? void 0 : e.availability) == null ? void 0 : n.duration_minutes;
922
+ t && (this.duration = t >= 60 ? t / 60 : t, this.durationMinutes = t ?? 5, this.durationIncrement = t >= 60 ? 60 : 1);
923
+ }
924
+ durationMinutesChangedHandler(e, t) {
925
+ d("nylas-event-duration", "durationMinutesChangedHandler", e), e !== t && this.valueChanged.emit({ value: e.toString(), name: this.name });
926
+ }
927
+ connectedCallback() {
928
+ d("nylas-event-duration", "connectedCallback");
929
+ }
930
+ componentWillLoad() {
931
+ d("nylas-event-duration", "componentWillLoad"), this.host.setAttribute("name", this.name), this.setDurationMintueOptions();
932
+ }
933
+ componentDidLoad() {
934
+ d("nylas-event-duration", "componentDidLoad"), this.internals.setFormValue(this.durationMinutes.toString(), "duration");
935
+ }
936
+ disconnectedCallback() {
937
+ d("nylas-event-duration", "disconnectedCallback");
938
+ }
939
+ setDurationMintueOptions() {
940
+ return this.durationIncrement === 1 ? this.durationMinutesOptions = [
941
+ { value: 15, label: "15" },
942
+ { value: 30, label: "30" },
943
+ { value: 45, label: "45" },
944
+ { value: 60, label: "60" }
945
+ ] : this.durationMinutesOptions = Array.from({ length: 23 }, (e, t) => ({ value: t + 1, label: (t + 1).toString() })), this.durationMinutesOptions;
946
+ }
947
+ handleChange(e) {
948
+ this.duration = e.target.value, this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), this.name);
949
+ }
950
+ handleBlur() {
951
+ (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");
952
+ }
953
+ selectedOptionChangedHandler(e) {
954
+ d("nylas-calendar-picker", "selectedOptionChangedHandler", e.detail);
955
+ const { value: t } = e.detail;
956
+ this.durationIncrement = parseInt(t), this.durationIncrement === 1 ? this.duration = 60 : this.duration = 1, this.setDurationMintueOptions(), this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), "duration");
957
+ }
958
+ inputOptionChangedHandler(e) {
959
+ d("nylas-calendar-picker", "selectedOptionChangedHandler", e.detail);
960
+ const { value: t } = e.detail;
961
+ this.duration = t, this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), this.name);
962
+ }
963
+ render() {
964
+ const e = [
965
+ { value: 1, label: "minute" },
966
+ { value: 60, label: "hour" }
967
+ ];
968
+ return i(_, { key: "cd39f094761b20d6a016000f634fec1ba3f446be" }, i("div", { key: "52aa0d5d51d18d00604c7598c1ffefc195cbee26", class: "nylas-event-duration", part: "ned" }, i("label", { key: "4e438e990324d88976a13040c871aece2993166d", htmlFor: "duration" }, "Event duration", i("span", { key: "0e96a062a5a5e18f03cd523dce3e18f0c005eb03", class: "required" }, "*"), i("span", { key: "82003caed486495486b5bc56f67801945a9934fb", class: "label-icon" }, i("tooltip-component", { key: "9b4d29ecbc50f8109393ac271d66721dafd50f44" }, i("info-icon", { key: "d7f9af86af78cae824979fb1f03f21288db5b422", slot: "tooltip-icon" }), i("span", { key: "eff1616d15bb219e15c4e0b6f4993cfe9e4e6c05", slot: "tooltip-content" }, "Set the duration of your event.")))), i("div", { key: "1358e1bf2501523f922a029068719265291fec6d", class: "nylas-event-duration__wrapper" }, i("input-dropdown", { key: "8504905b8582540587567751f9376cfb1df98b32", name: "event-duration", options: this.durationMinutesOptions, inputValue: this.duration.toString(), exportparts: "id__dropdown: ned__input_dropdown, id__dropdown-input: ned__input_dropdown-input, id__dropdown-content: ned__input_dropdown-content", defaultInputOption: this.durationMinutesOptions.find((t) => t.value == this.duration) ?? e[0] }), i("select-dropdown", { key: "007a4f7fba5419b4376b55e59e433f2a4a17b482", name: "event-duration", options: e, pluralizedLabel: this.duration > 1 ? "s" : "", 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 }))));
969
+ }
970
+ static get formAssociated() {
971
+ return !0;
972
+ }
973
+ get host() {
974
+ return k(this);
975
+ }
976
+ static get watchers() {
977
+ return {
978
+ name: ["elementNameChangedHandler"],
979
+ selectedConfiguration: ["selectedConfigurationChangedHandler"],
980
+ durationMinutes: ["durationMinutesChangedHandler"]
981
+ };
982
+ }
983
+ };
984
+ Ft([
985
+ C({
986
+ name: "nylas-event-duration",
987
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
988
+ eventToProps: {},
989
+ fireRegisterEvent: !0
990
+ }),
991
+ ce("design:type", Function),
992
+ ce("design:paramtypes", []),
993
+ ce("design:returntype", void 0)
994
+ ], Ee.prototype, "render", null);
995
+ Ee.style = Mt;
996
+ const Nt = ':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}', Rt = Nt;
997
+ var Pt = function(e, t, n, a) {
998
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
999
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1000
+ s = Reflect.decorate(e, t, n, a);
1001
+ else
1002
+ for (var r = e.length - 1; r >= 0; r--)
1003
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
1004
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
1005
+ }, pe = function(e, t) {
1006
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1007
+ return Reflect.metadata(e, t);
1008
+ };
1009
+ const Le = class {
1010
+ constructor(e) {
1011
+ m(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals);
1012
+ }
1013
+ connectedCallback() {
1014
+ d("nylas-event-info", "connectedCallback");
1015
+ }
1016
+ componentWillLoad() {
1017
+ d("nylas-event-info", "componentWillLoad");
1018
+ }
1019
+ componentDidLoad() {
1020
+ d("nylas-event-info", "componentDidLoad"), Ce(["inputs"], this.el);
1021
+ }
1022
+ disconnectedCallback() {
1023
+ d("nylas-event-info", "disconnectedCallback");
1024
+ }
1025
+ render() {
1026
+ return i(_, { key: "3d50d24894f959b4f3934d3a9d0c8f22426bbf52" }, i("nylas-form-card", { key: "b4fe6f96328e630aa619b75cbc0119ae2f108e91" }, i("h1", { key: "7cd07abb0cfd695c073149c22754f3233bc3b9c7", slot: "header-title", class: "nylas-event-info__title" }, "Event information"), i("h3", { key: "bc6e7420df55ba180419716ea0f1fd8f3eeab2b8", slot: "header-subtitle", class: "nylas-event-info__subtitle" }, "Enter all event information."), i("div", { key: "56040379502ac4aa71abcaa9bdfe8424e3097742", slot: "content", class: "nylas-event-info__content" }, i("slot", { key: "b94d1ec6b04e50a78445b7046be9c1f34d4f7c5e", name: "inputs" }))));
1027
+ }
1028
+ static get formAssociated() {
1029
+ return !0;
1030
+ }
1031
+ get el() {
1032
+ return k(this);
1033
+ }
1034
+ };
1035
+ Pt([
1036
+ C({
1037
+ name: "nylas-event-info",
1038
+ eventToProps: {},
1039
+ fireRegisterEvent: !0
1040
+ }),
1041
+ pe("design:type", Function),
1042
+ pe("design:paramtypes", []),
1043
+ pe("design:returntype", void 0)
1044
+ ], Le.prototype, "render", null);
1045
+ Le.style = Rt;
1046
+ const zt = ':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}', Bt = zt;
1047
+ var jt = function(e, t, n, a) {
1048
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
1049
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1050
+ s = Reflect.decorate(e, t, n, a);
1051
+ else
1052
+ for (var r = e.length - 1; r >= 0; r--)
1053
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
1054
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
1055
+ }, fe = function(e, t) {
1056
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1057
+ return Reflect.metadata(e, t);
1058
+ };
1059
+ const $e = class {
1060
+ constructor(e) {
1061
+ m(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals);
1062
+ }
1063
+ connectedCallback() {
1064
+ d("nylas-event-limits", "connectedCallback");
1065
+ }
1066
+ componentWillLoad() {
1067
+ d("nylas-event-limits", "componentWillLoad");
1068
+ }
1069
+ componentDidLoad() {
1070
+ d("nylas-event-limits", "componentDidLoad"), Ce(["inputs"], this.el);
1071
+ }
1072
+ disconnectedCallback() {
1073
+ d("nylas-event-limits", "disconnectedCallback");
1074
+ }
1075
+ render() {
1076
+ return i(_, { key: "30d78f51d8e6e0c358bda5a8721002e19f539987" }, i("nylas-form-card", { key: "708cb09606a7452155d75328fa6b4102edc589f8" }, i("h1", { key: "2bad4fda79ad5721e33c56b023444dde14c24cac", slot: "header-title", class: "nylas-event-limits__title" }, "Set event limits"), i("h3", { key: "b11865bd252ab95e2ee76b1a442ade752f41862b", slot: "header-subtitle", class: "nylas-event-limits__subtitle" }, "Customize event limits for the event."), i("div", { key: "2987c4d4b8de461f61834cae0b21be88364a2183", slot: "content", class: "nylas-event-limits__content" }, i("slot", { key: "b80a2429328f103dfa5546a0266f03e0df3520d5", name: "inputs" }))));
1077
+ }
1078
+ static get formAssociated() {
1079
+ return !0;
1080
+ }
1081
+ get el() {
1082
+ return k(this);
1083
+ }
1084
+ };
1085
+ jt([
1086
+ C({
1087
+ name: "nylas-event-limits",
1088
+ eventToProps: {},
1089
+ fireRegisterEvent: !0
1090
+ }),
1091
+ fe("design:type", Function),
1092
+ fe("design:paramtypes", []),
1093
+ fe("design:returntype", void 0)
1094
+ ], $e.prototype, "render", null);
1095
+ $e.style = Bt;
1096
+ const Wt = ':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}', Ut = Wt;
1097
+ var Kt = function(e, t, n, a) {
1098
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
1099
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1100
+ s = Reflect.decorate(e, t, n, a);
1101
+ else
1102
+ for (var r = e.length - 1; r >= 0; r--)
1103
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
1104
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
1105
+ }, ue = function(e, t) {
1106
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1107
+ return Reflect.metadata(e, t);
1108
+ };
1109
+ const He = class {
1110
+ constructor(e) {
1111
+ m(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";
1112
+ }
1113
+ elementNameChangedHandler(e) {
1114
+ d("nylas-event-location", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1115
+ }
1116
+ selectedConfigurationChangedHandler(e, t) {
1117
+ var a;
1118
+ d("nylas-custom-booking-flow", "selectedConfigurationChangedHandler", e, t);
1119
+ const n = (a = e == null ? void 0 : e.event_booking) == null ? void 0 : a.location;
1120
+ n && (this.selectedLocationOption = n ? "custom" : "none", this.location = n);
1121
+ }
1122
+ eventLocationChangedHandler(e, t) {
1123
+ d("nylas-event-location", "eventLocationChangedHandler", e), e !== t && (this.selectedLocationOption = e ? "custom" : "none");
1124
+ }
1125
+ connectedCallback() {
1126
+ d("nylas-event-location", "connectedCallback");
1127
+ }
1128
+ componentWillLoad() {
1129
+ d("nylas-event-location", "componentWillLoad"), this.host.setAttribute("name", this.name);
1130
+ }
1131
+ componentDidLoad() {
1132
+ d("nylas-event-location", "componentDidLoad");
1133
+ }
1134
+ disconnectedCallback() {
1135
+ d("nylas-event-location", "disconnectedCallback");
1136
+ }
1137
+ selectedOptionChangedHandler(e) {
1138
+ this.selectedLocationOption = e.detail.value, this.selectedLocationOption === "none" && (this.location = "", this.setFormValue("", "location"), this.valueChanged.emit({ value: "", name: this.name }));
1139
+ }
1140
+ setFormValue(e, t) {
1141
+ typeof this.internals.setFormValue == "function" && this.internals.setFormValue(e, t);
1142
+ }
1143
+ handleChange(e) {
1144
+ const t = ye(e.target.value);
1145
+ this.location = t, this.setFormValue(t, "location"), this.valueChanged.emit({ value: t, name: this.name });
1146
+ }
1147
+ render() {
1148
+ const e = [
1149
+ { value: "none", label: "None" },
1150
+ { value: "custom", label: "Custom location" }
1151
+ ], t = {
1152
+ none: i("location-off-icon", { key: "68f24ab2ac9c92610c37e8cb8f7fb675eb34e1c0" }),
1153
+ custom: i("location-icon", { key: "b82dae045728e7e5f3a4d5f681b8100addbd86d1" })
1154
+ };
1155
+ return i(_, { key: "663ce6f8f67b42528ec804c90223eb01a9ac8078" }, i("div", { key: "8df5d3d4259312db798aa8d6729c3607dcedce47", class: "nylas-event-location", part: "nel" }, i("label", { key: "8c7422b7bbf5e69ca105a97c91c6e77cfc2c960a", htmlFor: "location" }, "Location type", i("span", { key: "d4dd5b670091bb4d73b0c8f856a9ef97aa6bbac9", class: "label-icon" }, i("tooltip-component", { key: "f3f8db4880f00b8031d161af989a9f0d8357325e" }, i("info-icon", { key: "c0ebef1e813376a9e90fa2722a6b4f411ce9f60a", slot: "tooltip-icon" }), i("span", { key: "78071f01cfe674c444b65d5115d7b69e213abb02", 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: "1e7fde8848028a53f862ab19d6417f7d756fac9e", class: "location-input" }, i("select-dropdown", { key: "44b0db28ee7c153cdfd918219128cdf569b24e5e", 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: "19010ea6e4ca8981884600373344742569d29d35", 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) }))));
1156
+ }
1157
+ static get formAssociated() {
1158
+ return !0;
1159
+ }
1160
+ get host() {
1161
+ return k(this);
1162
+ }
1163
+ static get watchers() {
1164
+ return {
1165
+ name: ["elementNameChangedHandler"],
1166
+ selectedConfiguration: ["selectedConfigurationChangedHandler"],
1167
+ eventLocation: ["eventLocationChangedHandler"]
1168
+ };
1169
+ }
1170
+ };
1171
+ Kt([
1172
+ C({
1173
+ name: "nylas-event-location",
1174
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
1175
+ eventToProps: {},
1176
+ fireRegisterEvent: !0
1177
+ }),
1178
+ ue("design:type", Function),
1179
+ ue("design:paramtypes", []),
1180
+ ue("design:returntype", void 0)
1181
+ ], He.prototype, "render", null);
1182
+ He.style = Ut;
1183
+ const Zt = ':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)}', Yt = Zt;
1184
+ var Vt = function(e, t, n, a) {
1185
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
1186
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1187
+ s = Reflect.decorate(e, t, n, a);
1188
+ else
1189
+ for (var r = e.length - 1; r >= 0; r--)
1190
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
1191
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
1192
+ }, he = function(e, t) {
1193
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1194
+ return Reflect.metadata(e, t);
1195
+ };
1196
+ const Ae = class {
1197
+ constructor(e) {
1198
+ var t, n;
1199
+ m(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 = _e.map((a) => ({
1200
+ label: a.token,
1201
+ value: a.value,
1202
+ labelHTML: a
1203
+ })), this.filteredTokens = this.availableTokens, this.ariaActivedescendant = "", this.currentWord = { $value: "", fullText: "", index: -1, focusOffset: -1 }, this.validationError = "";
1204
+ }
1205
+ elementNameChangedHandler(e) {
1206
+ d("nylas-event-title", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1207
+ }
1208
+ ariaActivedescendantChangedHandler(e) {
1209
+ var t, n;
1210
+ if (d("nylas-event-title", "ariaActivedescendantChangedHandler", e), e !== "") {
1211
+ const a = (t = this.host.shadowRoot) == null ? void 0 : t.getElementById(e);
1212
+ a == null || a.classList.add("active");
1213
+ } else {
1214
+ const a = (n = this.host.shadowRoot) == null ? void 0 : n.querySelectorAll(".token-options li.active");
1215
+ a == null || a.forEach((o) => o.classList.remove("active"));
1216
+ }
1217
+ }
1218
+ configChangedHandler(e) {
1219
+ var n;
1220
+ const t = (n = e == null ? void 0 : e.event_booking) == null ? void 0 : n.title;
1221
+ t && this.updateEventTitleFromProp(t);
1222
+ }
1223
+ connectedCallback() {
1224
+ d("nylas-event-title", "connectedCallback");
1225
+ }
1226
+ componentWillLoad() {
1227
+ d("nylas-event-title", "componentWillLoad"), this.host.setAttribute("name", this.name);
1228
+ }
1229
+ componentDidLoad() {
1230
+ d("nylas-event-title", "componentDidLoad"), this.updateEventTitleFromProp(this.eventTitle || "");
1231
+ }
1232
+ disconnectedCallback() {
1233
+ d("nylas-event-title", "disconnectedCallback");
1234
+ }
1235
+ formSubmittedHandler(e) {
1236
+ var t, n;
1237
+ 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";
1238
+ }
1239
+ updateEventTitleFromProp(e) {
1240
+ var t, n;
1241
+ 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 })));
1242
+ }
1243
+ highlightTokens(e) {
1244
+ let t = e;
1245
+ return _e.forEach((n) => {
1246
+ const a = n.value, o = new RegExp(`(\\${a})(?!\\w)`, "g");
1247
+ t = t.replace(o, '<span class="highlighted-tag">$1</span>');
1248
+ }), t;
1249
+ }
1250
+ getCurrentSelectionForBrowser() {
1251
+ var a, o, s;
1252
+ const e = (l, r, h, p) => {
1253
+ const u = l.replace(/[\u200B-\u200D\uFEFF]/g, ""), g = u.lastIndexOf("$"), v = u.substring(g).split(" ")[0];
1254
+ return {
1255
+ focusOffset: r,
1256
+ dollarIndex: g,
1257
+ lastWord: v,
1258
+ currentText: u,
1259
+ node: h,
1260
+ allSelected: p
1261
+ };
1262
+ }, t = (l) => {
1263
+ var r, h;
1264
+ return l.anchorOffset === 0 && l.focusOffset === ((h = (r = l.focusNode) == null ? void 0 : r.nodeValue) == null ? void 0 : h.length);
1265
+ };
1266
+ switch (Ke()) {
1267
+ case "Chrome":
1268
+ 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) || "", p = l && t(l);
1269
+ return e(h, (l == null ? void 0 : l.focusOffset) || -1, r, p);
1270
+ case "Firefox":
1271
+ const u = document.getSelection(), g = ((o = u == null ? void 0 : u.anchorNode) == null ? void 0 : o.nodeValue) || "", v = u && t(u);
1272
+ return e(g, (u == null ? void 0 : u.focusOffset) || -1, u == null ? void 0 : u.anchorNode, v);
1273
+ case "Safari":
1274
+ const I = window.getSelection(), x = I == null ? void 0 : I.getComposedRanges(this.host.shadowRoot)[0], c = ((s = x == null ? void 0 : x.startContainer) == null ? void 0 : s.nodeValue) || "", f = I && t(I);
1275
+ return e(c, (x == null ? void 0 : x.endOffset) || -1, x == null ? void 0 : x.startContainer, f);
1276
+ default:
1277
+ return console.warn("Browser not supported"), null;
1278
+ }
1279
+ }
1280
+ handleChange(e) {
1281
+ let t = e.target.textContent || "";
1282
+ t = ye(t);
1283
+ const n = this.getCurrentSelectionForBrowser();
1284
+ if (!n) {
1285
+ this.updateEventTitle(t), this.resetDropdown();
1286
+ return;
1287
+ }
1288
+ const { focusOffset: a, dollarIndex: o, lastWord: s, currentText: l } = n;
1289
+ if (o === -1 || a < o) {
1290
+ this.updateEventTitle(t), this.resetDropdown();
1291
+ return;
1292
+ }
1293
+ s.startsWith("$") ? (this.showTokens = !0, this.currentWord = {
1294
+ $value: s,
1295
+ fullText: l,
1296
+ index: o,
1297
+ focusOffset: a
1298
+ }, this.populateSuggestionsDropdown(s)) : this.resetDropdown(), this.updateEventTitle(t);
1299
+ }
1300
+ handleInputKeyDown(e) {
1301
+ var n, a, o, s;
1302
+ const t = this.getCurrentSelectionForBrowser();
1303
+ if (t != null && t.allSelected && !We(e) && (this.titleRef.innerHTML = ""), e.key === "Enter") {
1304
+ e.preventDefault();
1305
+ const l = (n = this.host.shadowRoot) == null ? void 0 : n.getElementById(this.ariaActivedescendant);
1306
+ l && (l.click(), this.ariaActivedescendant = "");
1307
+ } else if (e.key === "ArrowDown") {
1308
+ e.preventDefault();
1309
+ const l = (a = this.host.shadowRoot) == null ? void 0 : a.getElementById(this.ariaActivedescendant);
1310
+ if (l) {
1311
+ const r = l.nextElementSibling;
1312
+ r ? this.ariaActivedescendant = r.id : this.ariaActivedescendant = this.filteredTokens[0].label;
1313
+ } else
1314
+ this.ariaActivedescendant = this.filteredTokens[0].label;
1315
+ } else if (e.key === "ArrowUp") {
1316
+ e.preventDefault();
1317
+ const l = (o = this.host.shadowRoot) == null ? void 0 : o.getElementById(this.ariaActivedescendant);
1318
+ if (l) {
1319
+ const r = l.previousElementSibling;
1320
+ r ? this.ariaActivedescendant = r.id : this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
1321
+ } else
1322
+ this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
1323
+ } else
1324
+ 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 = ""));
1325
+ }
1326
+ selectOption(e, t) {
1327
+ var c;
1328
+ e.preventDefault();
1329
+ const n = this.currentWord.fullText, a = this.currentWord.$value;
1330
+ let o = this.titleRef.firstChild, s = null;
1331
+ for (; o; ) {
1332
+ if (o.nodeType === 3) {
1333
+ const f = ((c = o.textContent) == null ? void 0 : c.replace(/[\u200B-\u200D\uFEFF]/g, "")) || "", b = n.replace(/[\u200B-\u200D\uFEFF]/g, "");
1334
+ if (f.includes(b)) {
1335
+ s = o;
1336
+ break;
1337
+ }
1338
+ }
1339
+ o = o.nextSibling;
1340
+ }
1341
+ if (!s)
1342
+ return;
1343
+ const l = s.textContent || "", r = l.indexOf(a), h = l.substring(0, r), p = l.substring(r + a.length), u = document.createTextNode(h), g = document.createRange(), v = document.createElement("span");
1344
+ v.classList.add("highlighted-tag"), v.textContent = `${t.value}`;
1345
+ const I = document.createTextNode(p);
1346
+ if (p !== "")
1347
+ s.replaceWith(u, v, I), g.setStart(I, 1);
1348
+ else {
1349
+ const f = document.createTextNode("​");
1350
+ s.replaceWith(u, v, f), g.setStart(f, 1);
1351
+ }
1352
+ this.resetDropdown(), this.titleRef.focus();
1353
+ const x = window.getSelection();
1354
+ g.collapse(!0), x == null || x.removeAllRanges(), x == null || x.addRange(g), this.updateEventTitle(this.titleRef.textContent || "");
1355
+ }
1356
+ populateSuggestionsDropdown(e = "") {
1357
+ 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);
1358
+ }
1359
+ updateEventTitle(e) {
1360
+ var n, a, o;
1361
+ const t = e.replace(/ +/g, " ");
1362
+ 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 });
1363
+ }
1364
+ resetDropdown() {
1365
+ this.showTokens = !1, this.ariaActivedescendant = "";
1366
+ }
1367
+ getLabelHTML(e) {
1368
+ return i("div", { class: "token-label" }, i("span", { class: "token" }, e.token), i("span", { class: "description" }, e.description));
1369
+ }
1370
+ render() {
1371
+ var e;
1372
+ return i(_, { key: "66954aa7afd52271b194a1241b46bf54b26eeb38" }, i("div", { key: "f5aebb6914b94cac9aef99bc5e382ffa60572735", class: "nylas-event-title", part: "net" }, i("label", { key: "b99854a3d225a079b1fa86fc4379f16c9a54645c", htmlFor: "title" }, "Event title", i("span", { key: "4c2910eac57af8118fbd5deef5e70587e48ce02f", class: "required" }, "*"), i("span", { key: "e944e4a6498892a2c5cd4558e90a318aa09d1b5b", class: "label-icon" }, i("tooltip-component", { key: "c483e44bf98e26ff2b36752a2812a04cd66acb9d" }, i("info-icon", { key: "9e6ec872bc60e1bd658fbcc47ffd04068fb95543", slot: "tooltip-icon" }), i("span", { key: "108f13463468b574d4fb0417bfd387461c36f3dd", slot: "tooltip-content" }, "Enter a title for your event.")))), i("div", { key: "478be8206ff1eabb6167a6f257f74f646515cddb", class: {
1373
+ title: !0,
1374
+ error: this.validationError !== ""
1375
+ }, 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: "1ceba0cac2c71119094055f1f064cceacaa27ede", class: "help-text" }, "Create a dynamic templated event title by typing $. Learn more"), this.validationError != "" && i("span", { class: "error-message" }, this.validationError)));
1376
+ }
1377
+ static get formAssociated() {
1378
+ return !0;
1379
+ }
1380
+ get host() {
1381
+ return k(this);
1382
+ }
1383
+ static get watchers() {
1384
+ return {
1385
+ name: ["elementNameChangedHandler"],
1386
+ ariaActivedescendant: ["ariaActivedescendantChangedHandler"],
1387
+ selectedConfiguration: ["configChangedHandler"]
1388
+ };
1389
+ }
1390
+ };
1391
+ Vt([
1392
+ C({
1393
+ name: "nylas-event-title",
1394
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
1395
+ eventToProps: {},
1396
+ fireRegisterEvent: !0
1397
+ }),
1398
+ he("design:type", Function),
1399
+ he("design:paramtypes", []),
1400
+ he("design:returntype", void 0)
1401
+ ], Ae.prototype, "render", null);
1402
+ Ae.style = Yt;
1403
+ const qt = ':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 = qt;
1404
+ var Gt = function(e, t, n, a) {
1405
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
1406
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1407
+ s = Reflect.decorate(e, t, n, a);
1408
+ else
1409
+ for (var r = e.length - 1; r >= 0; r--)
1410
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
1411
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
1412
+ }, be = function(e, t) {
1413
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1414
+ return Reflect.metadata(e, t);
1415
+ };
1416
+ const Me = class {
1417
+ constructor(e) {
1418
+ m(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";
1419
+ }
1420
+ elementNameChangedHandler(e) {
1421
+ d("nylas-limit-future-bookings", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1422
+ }
1423
+ selectedConfigurationChangedHandler(e) {
1424
+ var n;
1425
+ const t = (n = e == null ? void 0 : e.scheduler) == null ? void 0 : n.available_days_in_future;
1426
+ t && this.updateNumberAndPeriodFromDays(t);
1427
+ }
1428
+ availableDaysInFutureChanged(e) {
1429
+ this.updateNumberAndPeriodFromDays(e);
1430
+ }
1431
+ connectedCallback() {
1432
+ d("nylas-limit-future-bookings", "connectedCallback");
1433
+ }
1434
+ componentWillLoad() {
1435
+ d("nylas-limit-future-bookings", "componentWillLoad"), this.host.setAttribute("name", this.name);
1436
+ }
1437
+ componentDidLoad() {
1438
+ var e;
1439
+ 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);
1440
+ }
1441
+ disconnectedCallback() {
1442
+ d("nylas-limit-future-bookings", "disconnectedCallback");
1443
+ }
1444
+ timePeriodChangedHandler(e) {
1445
+ const { number: t, period: n } = e.detail;
1446
+ let a;
1447
+ 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);
1448
+ }
1449
+ updateNumberAndPeriodFromDays(e) {
1450
+ let t, n;
1451
+ 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;
1452
+ }
1453
+ render() {
1454
+ return i(_, { key: "644b6c27b5f42b8434641d4d5fb66b9b999600f3" }, i("div", { key: "5752ad1825c031be60ae17f8b8e0c045b9dd03f2", class: "nylas-limit-future-bookings", part: "nlfb" }, i("label", { key: "20757b46040b546f588186315b930a9deb0e20e2" }, "Limit future bookings", i("span", { key: "5c8da87988a96a02f56a64d7adbcec0d861218b1", class: "label-icon" }, i("tooltip-component", { key: "d7e59094062b2292b59f4dc0e8d553fa33d9a3a1" }, i("info-icon", { key: "2d180ec4e6daecaa44481ea424fca1488273b1c5", slot: "tooltip-icon" }), i("span", { key: "6c968e6da43177276ef8dcf28f4d250f39a28fe2", slot: "tooltip-content" }, "Set a limit on how far in the future bookings can be made.")))), i("time-period-selector", { key: "4776c9bc6447a477103eadee1805e7313352e0ee", 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 })));
1455
+ }
1456
+ static get formAssociated() {
1457
+ return !0;
1458
+ }
1459
+ get host() {
1460
+ return k(this);
1461
+ }
1462
+ static get watchers() {
1463
+ return {
1464
+ name: ["elementNameChangedHandler"],
1465
+ selectedConfiguration: ["selectedConfigurationChangedHandler"],
1466
+ availableDaysInFuture: ["availableDaysInFutureChanged"]
1467
+ };
1468
+ }
1469
+ };
1470
+ Gt([
1471
+ C({
1472
+ name: "nylas-limit-future-bookings",
1473
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
1474
+ eventToProps: {},
1475
+ fireRegisterEvent: !0
1476
+ }),
1477
+ be("design:type", Function),
1478
+ be("design:paramtypes", []),
1479
+ be("design:returntype", void 0)
1480
+ ], Me.prototype, "render", null);
1481
+ Me.style = Jt;
1482
+ const Xt = ':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}', Qt = Xt;
1483
+ var en = function(e, t, n, a) {
1484
+ var o = arguments.length, s = o < 3 ? t : a === null ? a = Object.getOwnPropertyDescriptor(t, n) : a, l;
1485
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1486
+ s = Reflect.decorate(e, t, n, a);
1487
+ else
1488
+ for (var r = e.length - 1; r >= 0; r--)
1489
+ (l = e[r]) && (s = (o < 3 ? l(s) : o > 3 ? l(t, n, s) : l(t, n)) || s);
1490
+ return o > 3 && s && Object.defineProperty(t, n, s), s;
1491
+ }, me = function(e, t) {
1492
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1493
+ return Reflect.metadata(e, t);
1494
+ };
1495
+ const Fe = class {
1496
+ constructor(e) {
1497
+ m(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";
1498
+ }
1499
+ elementNameChangedHandler(e) {
1500
+ d("nylas-min-cancellation-notice", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1501
+ }
1502
+ selectedConfigurationChangedHandler(e) {
1503
+ var n;
1504
+ const t = (n = e == null ? void 0 : e.scheduler) == null ? void 0 : n.min_cancellation_notice;
1505
+ t && this.updateNumberAndPeriodFromMinutes(t);
1506
+ }
1507
+ availableDaysInFutureChanged(e) {
1508
+ this.updateNumberAndPeriodFromMinutes(e);
1509
+ }
1510
+ connectedCallback() {
1511
+ d("nylas-min-cancellation-notice", "connectedCallback");
1512
+ }
1513
+ componentWillLoad() {
1514
+ d("nylas-min-cancellation-notice", "componentWillLoad"), this.host.setAttribute("name", this.name);
1515
+ }
1516
+ componentDidLoad() {
1517
+ var e;
1518
+ 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);
1519
+ }
1520
+ disconnectedCallback() {
1521
+ d("nylas-min-cancellation-notice", "disconnectedCallback");
1522
+ }
1523
+ timePeriodChangedHandler(e) {
1524
+ const { number: t, period: n } = e.detail;
1525
+ let a;
1526
+ const o = 60, s = o * 24, l = s * 7, r = s * 30;
1527
+ 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);
1528
+ }
1529
+ updateNumberAndPeriodFromMinutes(e) {
1530
+ let s, l;
1531
+ 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;
1532
+ }
1533
+ render() {
1534
+ return i(_, { key: "c8aa308100f6883aba1096c18ee4fa4e93f22031" }, i("div", { key: "98a462f85a7aebb65f004d24d990899b87b70ba5", class: "nylas-min-cancellation-notice", part: "nmcn" }, i("label", { key: "f5e00583b2c9bf32d6e6a66c0bf34021a82cff10" }, "Minimum cancellation notice", i("span", { key: "ff572a74cf14935730b04b67040635cc3405607f", class: "label-icon" }, i("tooltip-component", { key: "5fc8718589a679693f5a042d5d4f45cc6a204d9c" }, i("info-icon", { key: "aa132926b3d719db1bfa3489d3083eb834fcddea", slot: "tooltip-icon" }), i("span", { key: "4ae6e92255f4c34bac09d266c12b6d009ff8e915", slot: "tooltip-content" }, "Set the minimum amount of time required to cancel an event.")))), i("time-period-selector", { key: "8d74b2848f6231d2a7accb29385e3d02273eec42", 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 })));
1535
+ }
1536
+ static get formAssociated() {
1537
+ return !0;
1538
+ }
1539
+ get host() {
1540
+ return k(this);
1541
+ }
1542
+ static get watchers() {
1543
+ return {
1544
+ name: ["elementNameChangedHandler"],
1545
+ selectedConfiguration: ["selectedConfigurationChangedHandler"],
1546
+ availableDaysInFuture: ["availableDaysInFutureChanged"]
1547
+ };
1548
+ }
1549
+ };
1550
+ en([
1551
+ C({
1552
+ name: "nylas-min-cancellation-notice",
1553
+ stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.selectedConfiguration", "selectedConfiguration"]]),
1554
+ eventToProps: {},
1555
+ fireRegisterEvent: !0
1556
+ }),
1557
+ me("design:type", Function),
1558
+ me("design:paramtypes", []),
1559
+ me("design:returntype", void 0)
1560
+ ], Fe.prototype, "render", null);
1561
+ Fe.style = Qt;
1562
+ var Ne = { exports: {} };
1563
+ (function(e, t) {
1564
+ (function(n, a) {
1565
+ e.exports = a();
1566
+ })(Ue, function() {
1567
+ 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) {
1568
+ return (c = +c) + (c > 68 ? 1900 : 2e3);
1569
+ }, p = function(c) {
1570
+ return function(f) {
1571
+ this[c] = +f;
1572
+ };
1573
+ }, u = [/[+-]\d\d:?(\d\d)?|Z/, function(c) {
1574
+ (this.zone || (this.zone = {})).offset = function(f) {
1575
+ if (!f || f === "Z")
1576
+ return 0;
1577
+ var b = f.match(/([+-]|\d\d)/g), y = 60 * b[1] + (+b[2] || 0);
1578
+ return y === 0 ? 0 : b[0] === "+" ? -y : y;
1579
+ }(c);
1580
+ }], g = function(c) {
1581
+ var f = r[c];
1582
+ return f && (f.indexOf ? f : f.s.concat(f.f));
1583
+ }, v = function(c, f) {
1584
+ var b, y = r.meridiem;
1585
+ if (y) {
1586
+ for (var S = 1; S <= 24; S += 1)
1587
+ if (c.indexOf(y(S, 0, f)) > -1) {
1588
+ b = S > 12;
1589
+ break;
1590
+ }
1591
+ } else
1592
+ b = c === (f ? "pm" : "PM");
1593
+ return b;
1594
+ }, I = { A: [l, function(c) {
1595
+ this.afternoon = v(c, !1);
1596
+ }], a: [l, function(c) {
1597
+ this.afternoon = v(c, !0);
1598
+ }], S: [/\d/, function(c) {
1599
+ this.milliseconds = 100 * +c;
1600
+ }], SS: [o, function(c) {
1601
+ this.milliseconds = 10 * +c;
1602
+ }], SSS: [/\d{3}/, function(c) {
1603
+ this.milliseconds = +c;
1604
+ }], s: [s, p("seconds")], ss: [s, p("seconds")], m: [s, p("minutes")], mm: [s, p("minutes")], H: [s, p("hours")], h: [s, p("hours")], HH: [s, p("hours")], hh: [s, p("hours")], D: [s, p("day")], DD: [o, p("day")], Do: [l, function(c) {
1605
+ var f = r.ordinal, b = c.match(/\d+/);
1606
+ if (this.day = b[0], f)
1607
+ for (var y = 1; y <= 31; y += 1)
1608
+ f(y).replace(/\[|\]/g, "") === c && (this.day = y);
1609
+ }], M: [s, p("month")], MM: [o, p("month")], MMM: [l, function(c) {
1610
+ var f = g("months"), b = (g("monthsShort") || f.map(function(y) {
1611
+ return y.slice(0, 3);
1612
+ })).indexOf(c) + 1;
1613
+ if (b < 1)
1614
+ throw new Error();
1615
+ this.month = b % 12 || b;
1616
+ }], MMMM: [l, function(c) {
1617
+ var f = g("months").indexOf(c) + 1;
1618
+ if (f < 1)
1619
+ throw new Error();
1620
+ this.month = f % 12 || f;
1621
+ }], Y: [/[+-]?\d+/, p("year")], YY: [o, function(c) {
1622
+ this.year = h(c);
1623
+ }], YYYY: [/\d{4}/, p("year")], Z: u, ZZ: u };
1624
+ function x(c) {
1625
+ var f, b;
1626
+ f = c, b = r && r.formats;
1627
+ for (var y = (c = f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(R, H, D) {
1628
+ var O = D && D.toUpperCase();
1629
+ return H || b[D] || n[D] || b[O].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(A, M, P) {
1630
+ return M || P.slice(1);
1631
+ });
1632
+ })).match(a), S = y.length, E = 0; E < S; E += 1) {
1633
+ var Z = y[E], N = I[Z], L = N && N[0], $ = N && N[1];
1634
+ y[E] = $ ? { regex: L, parser: $ } : Z.replace(/^\[|\]$/g, "");
1635
+ }
1636
+ return function(R) {
1637
+ for (var H = {}, D = 0, O = 0; D < S; D += 1) {
1638
+ var A = y[D];
1639
+ if (typeof A == "string")
1640
+ O += A.length;
1641
+ else {
1642
+ var M = A.regex, P = A.parser, Y = R.slice(O), B = M.exec(Y)[0];
1643
+ P.call(H, B), R = R.replace(B, "");
1644
+ }
1645
+ }
1646
+ return function(z) {
1647
+ var T = z.afternoon;
1648
+ if (T !== void 0) {
1649
+ var j = z.hours;
1650
+ T ? j < 12 && (z.hours += 12) : j === 12 && (z.hours = 0), delete z.afternoon;
1651
+ }
1652
+ }(H), H;
1653
+ };
1654
+ }
1655
+ return function(c, f, b) {
1656
+ b.p.customParseFormat = !0, c && c.parseTwoDigitYear && (h = c.parseTwoDigitYear);
1657
+ var y = f.prototype, S = y.parse;
1658
+ y.parse = function(E) {
1659
+ var Z = E.date, N = E.utc, L = E.args;
1660
+ this.$u = N;
1661
+ var $ = L[1];
1662
+ if (typeof $ == "string") {
1663
+ var R = L[2] === !0, H = L[3] === !0, D = R || H, O = L[2];
1664
+ H && (O = L[2]), r = this.$locale(), !R && O && (r = b.Ls[O]), this.$d = function(Y, B, z) {
1665
+ try {
1666
+ if (["x", "X"].indexOf(B) > -1)
1667
+ return new Date((B === "X" ? 1e3 : 1) * Y);
1668
+ var T = x(B)(Y), j = T.year, V = T.month, Re = T.day, Pe = T.hours, ze = T.minutes, Be = T.seconds, je = T.milliseconds, ge = T.zone, J = /* @__PURE__ */ new Date(), G = Re || (j || V ? 1 : J.getDate()), X = j || J.getFullYear(), q = 0;
1669
+ j && !V || (q = V > 0 ? V - 1 : J.getMonth());
1670
+ var Q = Pe || 0, ee = ze || 0, te = Be || 0, ne = je || 0;
1671
+ return ge ? new Date(Date.UTC(X, q, G, Q, ee, te, ne + 60 * ge.offset * 1e3)) : z ? new Date(Date.UTC(X, q, G, Q, ee, te, ne)) : new Date(X, q, G, Q, ee, te, ne);
1672
+ } catch {
1673
+ return /* @__PURE__ */ new Date("");
1674
+ }
1675
+ }(Z, $, N), this.init(), O && O !== !0 && (this.$L = this.locale(O).$L), D && Z != this.format($) && (this.$d = /* @__PURE__ */ new Date("")), r = {};
1676
+ } else if ($ instanceof Array)
1677
+ for (var A = $.length, M = 1; M <= A; M += 1) {
1678
+ L[1] = $[M - 1];
1679
+ var P = b.apply(this, L);
1680
+ if (P.isValid()) {
1681
+ this.$d = P.$d, this.$L = P.$L, this.init();
1682
+ break;
1683
+ }
1684
+ M === A && (this.$d = /* @__PURE__ */ new Date(""));
1685
+ }
1686
+ else
1687
+ S.call(this, E);
1688
+ };
1689
+ };
1690
+ });
1691
+ })(Ne);
1692
+ const tn = Ne.exports, nn = ':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}', an = nn;
1693
+ K.extend(tn);
1694
+ const sn = class {
1695
+ constructor(e) {
1696
+ m(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;
1697
+ }
1698
+ handleOutsideClick(e) {
1699
+ !e.composedPath().includes(this.el) && this.showTimes && (this.showTimes = !1);
1700
+ }
1701
+ minimumStartTimeChangedHandler() {
1702
+ if (this.minimumStartTime) {
1703
+ let e = K().hour(parseInt(this.minimumStartTime)).minute(parseInt(this.minimumStartTime.slice(-4, -2)));
1704
+ 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();
1705
+ const t = K(this.times[0].value, "hh:mma");
1706
+ K(this.time, "hh:mma").isBefore(t) && (this.err = "Invalid", this.formError.emit({
1707
+ key: this.el.id,
1708
+ message: "Invalid"
1709
+ }));
1710
+ }
1711
+ }
1712
+ componentDidRender() {
1713
+ if (this.showTimes && this.shouldAutoScroll) {
1714
+ const e = ae(this.time), t = this.times.findIndex((n) => n.value === e);
1715
+ t > -1 && (this.shouldAutoScroll = !1, this.scrollToViewWithinParent(t));
1716
+ return;
1717
+ }
1718
+ }
1719
+ handleTimeChange(e, t) {
1720
+ const n = t.split(":");
1721
+ n[0] === "00" && n[1].slice(-2) == "pm" && (this.err = "Invalid", this.formError.emit({
1722
+ key: this.el.id,
1723
+ message: "Invalid"
1724
+ })), ie(t) ? (this.err = "", this.formError.emit({
1725
+ key: this.el.id,
1726
+ message: ""
1727
+ })) : (this.err = "Invalid", this.formError.emit({
1728
+ key: this.el.id,
1729
+ message: "Invalid"
1730
+ })), this.timeChange.emit({
1731
+ key: this.el.id,
1732
+ value: t
1733
+ });
1734
+ }
1735
+ handleTimeAutocomplete(e) {
1736
+ var n;
1737
+ const t = (n = e.target) == null ? void 0 : n.value;
1738
+ if (!ie(t)) {
1739
+ this.err = "Invalid", this.formError.emit({
1740
+ key: this.el.id,
1741
+ message: "Invalid"
1742
+ });
1743
+ return;
1744
+ }
1745
+ if (t === "") {
1746
+ const a = xe().format("hh:mma");
1747
+ this.timeChange.emit({
1748
+ key: this.el.id,
1749
+ value: a
1750
+ });
1751
+ return;
1752
+ }
1753
+ if (!ke(t)) {
1754
+ const a = ae(t);
1755
+ this.timeChange.emit({
1756
+ key: this.el.id,
1757
+ value: a
1758
+ });
1759
+ return;
1760
+ }
1761
+ this.timeChange.emit({
1762
+ key: this.el.id,
1763
+ value: t
1764
+ });
1765
+ }
1766
+ handleOnInput(e) {
1767
+ var n;
1768
+ const t = (n = e.target) == null ? void 0 : n.value;
1769
+ if (ie(t)) {
1770
+ if (t === "") {
1771
+ const a = xe().format("hh:mma"), o = this.times.findIndex((s) => s.value === a);
1772
+ o > -1 && this.scrollToViewWithinParent(o);
1773
+ return;
1774
+ }
1775
+ if (!ke(t)) {
1776
+ const a = ae(t), o = this.times.findIndex((s) => s.value === a);
1777
+ o > -1 && this.scrollToViewWithinParent(o);
1778
+ return;
1779
+ }
1780
+ }
1781
+ }
1782
+ generateTimes() {
1783
+ const e = [];
1784
+ let t = K().set("hour", 0).set("minute", 0).set("second", 0);
1785
+ this.minimumStartTime && (t = K(this.minimumStartTime, "hh:mma"));
1786
+ const n = t.endOf("day").diff(t, "minutes"), a = Math.round(n / 15);
1787
+ for (let o = 0; o < a + 1; o++) {
1788
+ const s = t.add(o * 15, "minute");
1789
+ if (o == a && s.format("hh:mma").includes("am"))
1790
+ break;
1791
+ e.push({ id: o, value: s.format("hh:mma") });
1792
+ }
1793
+ return e;
1794
+ }
1795
+ handleComboboxKeyDown(e) {
1796
+ if (e.key === "ArrowDown") {
1797
+ if (e.preventDefault(), !this.showTimes) {
1798
+ this.showTimes = !0, this.shouldAutoScroll = !0;
1799
+ return;
1800
+ }
1801
+ if (this.ariaActivedescendant === "")
1802
+ this.ariaActivedescendant = this.times[0].id.toString(), this.focusOption(0);
1803
+ else {
1804
+ const t = this.times.findIndex((a) => a.id.toString() === this.ariaActivedescendant), n = t + 1 < this.times.length ? t + 1 : 0;
1805
+ this.ariaActivedescendant = this.times[n].id.toString(), this.focusOption(n);
1806
+ }
1807
+ } else if (e.key === "ArrowUp")
1808
+ if (e.preventDefault(), this.ariaActivedescendant === "")
1809
+ this.ariaActivedescendant = this.times[this.times.length - 1].id.toString(), this.focusOption(this.times.length - 1);
1810
+ else {
1811
+ const t = this.times.findIndex((a) => a.id.toString() === this.ariaActivedescendant), n = t - 1 >= 0 ? t - 1 : this.times.length - 1;
1812
+ this.ariaActivedescendant = this.times[n].id.toString(), this.focusOption(n);
1813
+ }
1814
+ else
1815
+ e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
1816
+ }
1817
+ handleListboxKeydown(e) {
1818
+ const t = this.times, n = t.findIndex((a) => a.id.toString() === this.ariaActivedescendant);
1819
+ if (e.key === "ArrowDown" || e.key === "Tab" && !e.shiftKey) {
1820
+ e.preventDefault();
1821
+ const a = n + 1 < t.length ? n + 1 : 0;
1822
+ this.ariaActivedescendant = t[a].id.toString(), this.focusOption(a);
1823
+ } else if (e.key === "ArrowUp" || e.key === "Tab" && e.shiftKey) {
1824
+ e.preventDefault();
1825
+ const a = n - 1 >= 0 ? n - 1 : t.length - 1;
1826
+ this.ariaActivedescendant = t[a].id.toString(), this.focusOption(a);
1827
+ } else if (e.key === "Enter") {
1828
+ if (e.preventDefault(), this.ariaActivedescendant) {
1829
+ const a = t[n];
1830
+ this.handleTimeChange(e, a.value), this.showTimes = !1, this.ariaActivedescendant = "", this.timeInput.focus();
1831
+ }
1832
+ } else
1833
+ e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
1834
+ }
1835
+ scrollToViewWithinParent(e) {
1836
+ var l;
1837
+ const t = this.times[e], n = (l = this.el.shadowRoot) == null ? void 0 : l.getElementById(t.id.toString()), a = this.timeMenu;
1838
+ this.ariaActivedescendant = t.id.toString();
1839
+ const o = n.getBoundingClientRect(), s = a.getBoundingClientRect();
1840
+ 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);
1841
+ }
1842
+ focusOption(e) {
1843
+ var o;
1844
+ const t = this.times[e];
1845
+ if (!t)
1846
+ return;
1847
+ const n = t.id.toString(), a = (o = this.el.shadowRoot) == null ? void 0 : o.getElementById(n);
1848
+ a && (a.focus(), a.scrollIntoView({ behavior: "smooth", block: "nearest" }));
1849
+ }
1850
+ render() {
1851
+ return i(_, { key: "bb7dc42bbfdbad25bfcd419846582d470a2e9df9" }, i("div", { key: "26df571e17431fb0d27e8a0166334f30f19c3067", class: "time-picker", part: "time-picker" }, i("input", { key: "3391356d69af3205a3427bd791124af6a05d5524", type: "text", name: this.name, id: this.name, part: "time-input", class: {
1852
+ "time-input": !0,
1853
+ error: !!this.err || this.hasError
1854
+ }, ref: (e) => this.timeInput = e, value: this.time, onClick: () => {
1855
+ this.showTimes = !this.showTimes, this.shouldAutoScroll = !0;
1856
+ }, "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: {
1857
+ focused: this.ariaActivedescendant === e.id.toString()
1858
+ }, onClick: (t) => {
1859
+ this.handleTimeChange(t, e.value), this.showTimes = !1, this.timeInput.focus();
1860
+ }, role: "option" }, `${e.value}`)))), !this.showTimes && this.err && i("p", { class: "error", id: "email-error" }, this.err)));
1861
+ }
1862
+ get el() {
1863
+ return k(this);
1864
+ }
1865
+ static get watchers() {
1866
+ return {
1867
+ minimumStartTime: ["minimumStartTimeChangedHandler"]
1868
+ };
1869
+ }
1870
+ };
1871
+ sn.style = an;
1872
+ export {
1873
+ Ve as add_circle_icon,
1874
+ Ge as button_component,
1875
+ et as calendar_info_icon,
1876
+ at as calendar_patterns_icon,
1877
+ ot as flow_icon,
1878
+ dt as input_dropdown,
1879
+ ft as location_icon,
1880
+ bt as location_off_icon,
1881
+ gt as multi_select_dropdown,
1882
+ Oe as nylas_availability_picker,
1883
+ Te as nylas_booking_calendar_picker,
1884
+ Ie as nylas_buffer_time,
1885
+ De as nylas_calendar_picker,
1886
+ Se as nylas_event_description,
1887
+ Ee as nylas_event_duration,
1888
+ Le as nylas_event_info,
1889
+ $e as nylas_event_limits,
1890
+ He as nylas_event_location,
1891
+ Ae as nylas_event_title,
1892
+ Me as nylas_limit_future_bookings,
1893
+ Fe as nylas_min_cancellation_notice,
1894
+ sn as nylas_time_window_picker
1895
+ };