@nylas/react 1.0.2-prealpha1 → 1.1.0-canary.10

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