@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,805 @@
1
+ import { r as f, c as d, x as q, d as c, h as n, H as b, g as Y, y as X, z as J, k as K, A as m, B as C, F as Q } from "./index-fd39ea9d.js";
2
+ import { R as p } from "./register-component-83e24412-35c484c4.js";
3
+ import { T as u, g as ee, L as O } from "./constants-f34b9c6e-21ac1910.js";
4
+ import "react";
5
+ import "react-dom";
6
+ const te = ':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}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.event-card-wrapper{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;margin-bottom:2rem;width:424px;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card-wrapper{width:100%;border-radius:0px}}.calendar-icon{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200);color:var(--nylas-base-700)}.booked-event-header{margin:1.5rem 4rem;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:1rem;font-weight:400}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booking-date-time,.booking-participants{padding:0 1rem;margin-top:1.5rem;margin-left:3rem;display:flex;flex-direction:column;justify-content:space-between;align-self:flex-start;position:relative}.booking-date-time svg,.booking-participants svg{color:var(--nylas-base-700);position:absolute;left:-10px}.booking-date-time .block,.booking-participants .block{display:block}.booking-date-time h3,.booking-participants h3{color:var(--nylas-base-600);margin:0;font-size:1rem;font-weight:600;line-height:1.25rem;text-align:justify;margin-bottom:4px}.booking-date-time p,.booking-participants p{font-size:16px;margin:0;font-weight:400;text-align:justify;color:var(--nylas-base-800)}.booking-participants{margin-bottom:1.5rem}.booked-event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:1.5rem;gap:4px;margin:2rem;align-items:center;align-self:flex-end}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;padding:8px;font-family:var(--nylas-font-family);font-weight:600;height:48px;line-height:24px}sp-button.cancel{color:var(--nylas-error)}sp-button.cancel:hover,sp-button.cancel:focus{border-color:var(--nylas-error)}sp-button.cancel:active{color:var(--nylas-error-pressed);border-color:var(--nylas-error-pressed)}sp-button.reschedule:hover,sp-button.reschedule:focus{border-color:var(--nylas-primary)}sp-button.reschedule:active{border-color:var(--nylas-base-600)}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}', ae = te;
7
+ var ne = function(e, t, a, s) {
8
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
9
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
10
+ i = Reflect.decorate(e, t, a, s);
11
+ else
12
+ for (var l = e.length - 1; l >= 0; l--)
13
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
14
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
15
+ }, w = function(e, t) {
16
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
17
+ return Reflect.metadata(e, t);
18
+ };
19
+ const F = class {
20
+ constructor(e) {
21
+ f(this, e), this.cancelBookingButtonClicked = d(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = d(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = d(this, "rescheduleBookedEventError", 7), this.cancelBookedEventValidationError = d(this, "cancelBookedEventValidationError", 7), this.handleCancelBookingButtonClicked = () => {
22
+ var o;
23
+ const t = /* @__PURE__ */ new Date(), a = (o = this.configSettings) == null ? void 0 : o.scheduler.min_cancellation_notice, s = q(t, a);
24
+ t.getTime() < s.getTime() ? this.cancelBookedEventValidationError.emit({
25
+ error: {
26
+ title: "Cancellation Error",
27
+ message: `You cannot cancel the booking within ${a} minutes of the event.`
28
+ }
29
+ }) : this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
30
+ }, this.handleRescheduleButtonClicked = () => {
31
+ const t = (a) => {
32
+ this.rescheduleBookedEventError.emit(a);
33
+ };
34
+ this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: t });
35
+ }, this.getOrganizer = (t) => t == null ? void 0 : t.organizer, this.getPaticipantType = (t) => {
36
+ switch (t) {
37
+ case "host":
38
+ return "Host";
39
+ case "you":
40
+ return "You";
41
+ default:
42
+ return "";
43
+ }
44
+ }, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0, this.configSettings = void 0;
45
+ }
46
+ connectedCallback() {
47
+ }
48
+ disconnectedCallback() {
49
+ }
50
+ async componentWillLoad() {
51
+ c("[nylas-booked-event-card] Component will load");
52
+ }
53
+ async componentDidLoad() {
54
+ c("[nylas-booked-event-card] Component did load");
55
+ }
56
+ render() {
57
+ var e, t, a, s, o, i, r, l, h;
58
+ return n(b, { key: "fd31424392865287d5a696d2ea4a0840974324c1", part: "nbec" }, n("sp-theme", { key: "5e4fab19061fd773200fc8856355d2efc6c7f767", theme: "spectrum", color: "dark", scale: "medium" }, n("div", { key: "5effb33fcc0492a2f968e5b29229a974fb1bf2a3", class: "booked-event-timezone" }, n("globe-icon", { key: "7be37ec8323f0c36112e4a8c5903c2078fe0ae0e" }), u[this.selectedTimezone]), n("div", { key: "594e1cffea71361c2a52f5ed3f480b7fc7a6c0f4", class: "event-card-wrapper", part: "nbec__card" }, n("div", { key: "e2bcea8c2cd100f6291846d29524ee08a2c6d6ad", class: "calendar-icon" }, n("calendar-check-icon", { key: "412d634ebd082474581d8ceba417bcefb45d10eb" })), n("div", { key: "97f9f06776a64a9ceed5f8b7c84ed9d03983e083", class: "booked-event-header" }, n("h2", { key: "7453ad8f16ca9e477a5c6f7791dbf2aa89514394", slot: "card-title", part: "nbec__title" }, "Booking ", this.rescheduleBookingId ? "rescheduled" : "confirmed", "!"), n("div", { key: "5877c31296ad8821c822b8447a9adb495eea9756", part: "nbec__description" }, ((e = this.getOrganizer(this.eventInfo)) == null ? void 0 : e.name) || ((t = this.getOrganizer(this.eventInfo)) == null ? void 0 : t.email), " & ", ((s = (a = this.bookingInfo) == null ? void 0 : a.primaryParticipant) == null ? void 0 : s.name) || ((i = (o = this.bookingInfo) == null ? void 0 : o.primaryParticipant) == null ? void 0 : i.email))), n("sp-divider", { key: "3845e25500160ac43e0c19af3c3c3c446caca39e" }), n("div", { key: "349d849d49be4e71264436c6add7039b889f8933", class: "booking-date-time" }, n("checkmark-circle-icon", { key: "bccea293108ed90eece51494c79c8e5ae2db1411" }), n("h3", { key: "ee98cd2b9c877a7e8342940892ff08be4ee647e0" }, "Booking date and time"), n("p", { key: "1efd072abb08a6606299911e594a07b2de396113" }, new Date((r = this.selectedTimeslot) == null ? void 0 : r.start_time).toLocaleDateString(void 0, { dateStyle: "full" }), " ", n("br", { key: "e014d22678d84c7541854985d945672efde047e9" }), new Date((l = this.selectedTimeslot) == null ? void 0 : l.start_time).toLocaleTimeString(void 0, { timeStyle: "short" }), " -", " ", new Date((h = this.selectedTimeslot) == null ? void 0 : h.end_time).toLocaleTimeString(void 0, { timeStyle: "short" }))), n("div", { key: "0870d9969b572bf688c4c12de934066ed36f421a", class: "booking-participants" }), n("sp-divider", { key: "85674fadb92fc69826e738545a9f9bd1c478d522" }), n("div", { key: "c60007a3d63af3cca707736386f7cbc1d2963626", class: "footer" }, n("sp-button", { key: "f1295268e7f3341e37e7d66d460eabc28ad56482", variant: "secondary", treatment: "outline", class: "cancel", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, "Cancel booking"), n("sp-button", { key: "276674ce1eb225cfb7ea95936e1cb05056b921cc", variant: "secondary", treatment: "outline", class: "reschedule", onClick: this.handleRescheduleButtonClicked, part: "nbec__button-outline nbec__reschedule-cta" }, "Reschedule")))));
59
+ }
60
+ };
61
+ ne([
62
+ p({
63
+ name: "nylas-booked-event-card",
64
+ stateToProps: /* @__PURE__ */ new Map([
65
+ ["scheduler.bookingInfo", "bookingInfo"],
66
+ ["scheduler.rescheduleBookingId", "rescheduleBookingId"],
67
+ ["scheduler.selectedTimezone", "selectedTimezone"],
68
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
69
+ ["scheduler.configSettings", "configSettings"]
70
+ ]),
71
+ eventToProps: {
72
+ cancelBookingButtonClicked: async (e, t) => {
73
+ t.scheduler.setCancel(e.detail.bookingId);
74
+ },
75
+ rescheduleButtonClicked: async (e, t) => {
76
+ const a = await t.scheduler.setReschedule(e.detail.bookingId), { errorHandler: s } = e.detail;
77
+ s && (!a || "error" in a) && s(a);
78
+ }
79
+ },
80
+ fireRegisterEvent: !0
81
+ }),
82
+ w("design:type", Function),
83
+ w("design:paramtypes", []),
84
+ w("design:returntype", void 0)
85
+ ], F.prototype, "render", null);
86
+ F.style = ae;
87
+ const ie = ':host{display:block;height:100%;--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-booking-form{width:100%;padding:1.5rem;box-sizing:border-box;height:450px;overflow-y:auto;height:100%}form{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center}sp-textfield{--spectrum-corner-radius-100:var(--nylas-border-radius-2x);--spectrum-textfield-border-color:var(--nylas-base-300);position:relative;width:100%;height:48px;margin-bottom:16px;color:var(--nylas-base-500)}.cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:10px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{flex-direction:column-reverse}}sp-button{background-color:transparent;color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);--button-width:50%;font-family:var(--nylas-font-family);font-size:16px;font-weight:600;border:none;height:48px;padding:14px}@media screen and (max-width: 768px){sp-button{--button-width:100%}}sp-button:hover,sp-button:focus{background-color:var(--nylas-base-100);color:var(--nylas-primary);border-radius:var(--nylas-border-radius-2x)}sp-button:active{background-color:var(--nylas-base-200);color:var(--nylas-base-800)}sp-button.back{width:var(--button-width);background-color:transparent;color:var(--nylas-base-700);outline:1px solid var(--nylas-base-300)}sp-button.back:hover,sp-button.back:focus{outline-color:var(--nylas-primary)}sp-button.back:active{outline:2px solid var(--nylas-base-600)}sp-button.book{width:var(--button-width);background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.book:hover,sp-button.book:focus{background-color:var(--nylas-base-600)}sp-button.book:active{background-color:var(--nylas-base-800)}.input-wrapper{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-bottom:1rem}.input-wrapper input::placeholder{color:var(--nylas-base-300)}.input-wrapper label,.input-wrapper input{font-family:var(--nylas-font-family)}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}sp-infield-button{--spectrum-infield-button-background-color:transparent;--spectrum-infield-button-background-color-hover:transparent;--spectrum-infield-button-background-color-active:transparent;--spectrum-infield-button-border-color:transparent;--spectrum-infield-button-border-width:1px;--spectrum-infield-button-border-radius:0;color:var(--nylas-base-600);background:transparent;border:none;outline:1px solid var(--nylas-base-300);border-radius:0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x) 0;height:52px;width:52px;display:flex;position:absolute;right:0;align-items:center;justify-content:center;cursor:pointer}sp-infield-button sp-icon-cross300{color:var(--nylas-base-600)}sp-infield-button.error{border-width:2px;border-color:var(--nylas-error)}input[type=text],input[type=email]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%}input[type=text].error,input[type=email].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=email].error::placeholder{font-weight:400}input[type=text].guest-email,input[type=email].guest-email{color:var(--nylas-base-900);padding-right:52px}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}', se = ie;
88
+ var re = function(e, t, a, s) {
89
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
90
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
91
+ i = Reflect.decorate(e, t, a, s);
92
+ else
93
+ for (var l = e.length - 1; l >= 0; l--)
94
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
95
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
96
+ }, _ = function(e, t) {
97
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
98
+ return Reflect.metadata(e, t);
99
+ };
100
+ const E = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, $ = class {
101
+ constructor(e) {
102
+ f(this, e), this.nameChanged = d(this, "nameChanged", 7), this.emailChanged = d(this, "emailChanged", 7), this.backButtonClicked = d(this, "backButtonClicked", 7), this.detailsConfirmed = d(this, "detailsConfirmed", 7), this.bookingFormError = d(this, "bookingFormError", 7), this.handleGuestChange = (t, a) => {
103
+ this.resetGuestEmailError(t);
104
+ const s = [...this.guestEmails];
105
+ s[t] = a, this.guestEmails = [...s];
106
+ }, this.handleGuestBlur = (t, a) => {
107
+ if (this.resetGuestEmailError(t), a === "") {
108
+ this.guestEmailErrors[t] = "Email is required";
109
+ return;
110
+ }
111
+ if (!E.test(a)) {
112
+ this.guestEmailErrors[t] = "Enter a valid email address";
113
+ return;
114
+ }
115
+ this.handleGuestChange(t, a);
116
+ }, this.addGuestButtonClickedHandler = () => {
117
+ this.guestEmails = [...this.guestEmails, ""];
118
+ }, this.removeGuestButtonClickHandler = (t, a) => {
119
+ t.preventDefault(), this.resetGuestEmailError(a);
120
+ const s = [...this.guestEmails];
121
+ s.splice(a, 1), this.guestEmails = [...s];
122
+ }, this.handleBackButtonClicked = () => {
123
+ this.backButtonClicked.emit();
124
+ }, this.bookButtonClickedHandler = async (t) => {
125
+ var i, r, l, h, y, P, N;
126
+ t.preventDefault(), c("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
127
+ const a = this.name || ((r = (i = this.bookingInfo) == null ? void 0 : i.primaryParticipant) == null ? void 0 : r.name), s = this.email || ((h = (l = this.bookingInfo) == null ? void 0 : l.primaryParticipant) == null ? void 0 : h.email);
128
+ if (!a || a === "") {
129
+ this.isNameValid = !1, this.validationError.name = "Name is required", this.bookingFormError.emit({
130
+ title: "Booking form error",
131
+ description: "Name is required"
132
+ });
133
+ return;
134
+ }
135
+ if (!s || s === "") {
136
+ this.isEmailValid = !1, this.validationError.email = "Email is required", this.bookingFormError.emit({
137
+ title: "Booking form error",
138
+ description: "Email is required"
139
+ });
140
+ return;
141
+ }
142
+ if (!E.test(s)) {
143
+ this.isEmailValid = !1, this.validationError.email = "Enter a valid email address", this.bookingFormError.emit({
144
+ title: "Booking form error",
145
+ description: "Invalid email"
146
+ });
147
+ return;
148
+ }
149
+ let o = [];
150
+ if (this.guestEmails.length > 0) {
151
+ let x = !1;
152
+ if (this.guestEmails.forEach((g, M) => {
153
+ g === "" ? (x = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [M]: "Email is required" }) : E.test(g) || (x = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [M]: "Enter a valid email address" });
154
+ }), x) {
155
+ this.bookingFormError.emit({
156
+ title: "Booking form error",
157
+ description: "Invalid guest email"
158
+ });
159
+ return;
160
+ }
161
+ o = this.guestEmails.map((g) => ({ name: "", email: g.trim() }));
162
+ } else
163
+ (y = this.bookingInfo) != null && y.guests && (o = (P = this.bookingInfo) == null ? void 0 : P.guests);
164
+ this.detailsConfirmed.emit({
165
+ primaryParticipant: {
166
+ name: a,
167
+ email: s
168
+ },
169
+ guests: o,
170
+ additionalFields: {
171
+ ...(N = this.bookingInfo) == null ? void 0 : N.additionalFields
172
+ }
173
+ });
174
+ }, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.validationError = { name: "", email: "" };
175
+ }
176
+ connectedCallback() {
177
+ }
178
+ disconnectedCallback() {
179
+ }
180
+ componentWillLoad() {
181
+ var e, t;
182
+ c("nylas-booking-form", "componentWillLoad", this.bookingInfo), this.bookingInfo && (this.name = (e = this.bookingInfo.primaryParticipant) == null ? void 0 : e.name, this.email = (t = this.bookingInfo.primaryParticipant) == null ? void 0 : t.email);
183
+ }
184
+ bookingInfoChangedHandler(e) {
185
+ e && e.primaryParticipant && (this.name = e.primaryParticipant.name, this.email = e.primaryParticipant.email);
186
+ }
187
+ changeName(e) {
188
+ this.isNameValid = !0, this.validationError.name = "", this.name = e, this.nameChanged.emit(e);
189
+ }
190
+ changeEmail(e) {
191
+ this.isEmailValid = !0, this.validationError.email = "", this.email = e, this.emailChanged.emit(e);
192
+ }
193
+ resetGuestEmailError(e) {
194
+ const t = { ...this.guestEmailErrors };
195
+ delete t[e], this.guestEmailErrors = { ...t };
196
+ }
197
+ render() {
198
+ return n(b, { key: "5a255277a21fa84d100bb53d13bb9dce0ce58e24" }, n("form", { key: "19b7aecb9223557f0ff9d4c062968c3242026f0c", onSubmit: (e) => this.bookButtonClickedHandler(e), noValidate: !0 }, n("div", { key: "49276b2a59934eeaeb38c06db6968f957b7b9bee", class: "nylas-booking-form" }, n("slot", { key: "ee0a8c29c1fb6b7273d6a2d3c8cb88180f0e9dbf", name: "custom-booking-form" }, n("div", { key: "662e46f3a7925282f824547a069f52584b94d564", class: "input-wrapper" }, n("label", { key: "a01c1903ee983e1555006ad14e75cd1b2c3036ff", htmlFor: "name", class: { "input-label": !0, error: !this.isNameValid }, part: "nbf__input-label" }, "Name ", n("span", { key: "4729d580bbf9d851c2ac8b686dc826c4e3e4616f", class: "required" }, "*")), n("input", { key: "51754a63345f1d0332a38f646dde6a8a998c8dee", id: "name", type: "text", placeholder: "Enter your name", value: this.name, class: {
199
+ input: !0,
200
+ error: !this.isNameValid
201
+ }, part: "nbf__input-textfield", onInput: (e) => {
202
+ var t;
203
+ return this.changeName((t = e.target) == null ? void 0 : t.value);
204
+ } }), n("p", { key: "b8a6660e959a877421bdfffdb87279d8f09123b8", class: "help-text" }, this.validationError.name)), n("div", { key: "e78a74e67abde7e61c1d3c555c234817770a4040", class: "input-wrapper" }, n("label", { key: "d5507037f5c668f58e14031dba4276900ef5ed09", htmlFor: "email", class: { "input-label": !0, error: !this.isEmailValid }, part: "nbf__input-label" }, "Email ", n("span", { key: "514f00587069ac1cfc6d16bfd30750d6d501817d", class: "required" }, "*")), n("input", { key: "0b80ded98b2174f783fa9e7c951a47661aa894f6", id: "email", type: "email", placeholder: "Enter your email", value: this.email, class: {
205
+ input: !0,
206
+ error: !this.isEmailValid
207
+ }, part: "nbf__input-textfield", onInput: (e) => {
208
+ var t;
209
+ return this.changeEmail((t = e.target) == null ? void 0 : t.value);
210
+ } }), n("p", { key: "ba185ccb2bec87049e94d8c5f8d211a838de0025", class: "help-text" }, this.validationError.email)))), n("div", { key: "56e2cce79371533ad66cccad95a79dd8935fe3eb", class: "cta" }, n("sp-button", { key: "2b6410b3cf2b7634737aa858396290ad065dfcfc", treatment: "outline", variant: "secondary", class: "back", part: "nbf__button-outline", onClick: this.handleBackButtonClicked }, n("slot", { key: "4ba60a2fb3542434ede16ea382ec4ca80cb8d422", name: "booking-form-back-label" }, "Back")), n("sp-button", { key: "49dd32531d7b55529bb73bc82eb0b91820c6ea33", variant: "primary", class: "book", part: "nbf__button-primary", type: "submit" }, this.isLoading && n("loading-icon", { slot: "icon" }), n("slot", { key: "a57ae44c1c3a1b020a110f0156435f27897410c6", name: "booking-form-book-label" }, "Book now")))));
211
+ }
212
+ get host() {
213
+ return Y(this);
214
+ }
215
+ static get watchers() {
216
+ return {
217
+ bookingInfo: ["bookingInfoChangedHandler"]
218
+ };
219
+ }
220
+ };
221
+ re([
222
+ p({
223
+ name: "nylas-booking-form",
224
+ stateToProps: /* @__PURE__ */ new Map([
225
+ ["scheduler.isLoading", "isLoading"],
226
+ ["scheduler.bookingInfo", "bookingInfo"],
227
+ ["scheduler.eventInfo", "eventInfo"]
228
+ ]),
229
+ eventToProps: {
230
+ backButtonClicked: async (e, t) => {
231
+ t.scheduler.toggleAdditionalData(!1);
232
+ },
233
+ nameChanged: async (e, t) => {
234
+ t.scheduler.setParticipantName(e.detail);
235
+ },
236
+ emailChanged: async (e, t) => {
237
+ t.scheduler.setParticipantEmail(e.detail);
238
+ }
239
+ },
240
+ fireRegisterEvent: !0
241
+ }),
242
+ _("design:type", Function),
243
+ _("design:paramtypes", []),
244
+ _("design:returntype", void 0)
245
+ ], $.prototype, "render", null);
246
+ $.style = se;
247
+ const oe = ':host{display:block;width:400px;--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}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancel-booking-form{display:flex;align-items:center;flex-direction:column;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}.nylas-cancel-booking-form__title{font-size:18px;font-weight:600;margin-bottom:0;color:var(--nylas-base-900)}.nylas-cancel-booking-form__description{font-size:1rem;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600)}.nylas-cancel-booking-form__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;width:100%;height:48px;padding:8px;line-height:24px;font-family:var(--nylas-font-family)}sp-button.cancel{margin-top:1.25rem;background-color:var(--nylas-primary);color:var(--nylas-base-0)}sp-button.cancel:hover,sp-button.cancel:focus{background-color:var(--nylas-base-600)}sp-button.cancel:active{background-color:var(--nylas-base-800)}sp-button.back{margin-top:0.5rem}sp-button.back:hover,sp-button.back:focus{border-color:var(--nylas-primary)}sp-button.back:active{border-color:var(--nylas-base-600)}sp-field-label{margin-top:1rem;display:flex;color:var(--nylas-base-800);font-size:14px}sp-field-label.error{color:var(--nylas-error)}sp-field-label span.required{color:var(--nylas-error)}sp-textfield{--spectrum-textfield-border-color:var(--nylas-base-300);--spectrum-textfield-icon-color-invalid:var(--nylas-error);position:relative;width:100%;height:48px;margin-bottom:16px;background-color:var(--nylas-base-0);color:var(--nylas-base-500)}sp-textfield.error{--spectrum-textfield-border-color:var(--nylas-error)}sp-help-text{margin:0.25rem 0 1rem 0;color:var(--nylas-error)}', le = oe;
248
+ var ce = function(e, t, a, s) {
249
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
250
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
251
+ i = Reflect.decorate(e, t, a, s);
252
+ else
253
+ for (var l = e.length - 1; l >= 0; l--)
254
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
255
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
256
+ }, T = function(e, t) {
257
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
258
+ return Reflect.metadata(e, t);
259
+ };
260
+ const H = class {
261
+ constructor(e) {
262
+ f(this, e), this.goBackButtonClicked = d(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = d(this, "cancelBookingFormSubmitted", 7), this.cancelBookedEventError = d(this, "cancelBookedEventError", 7), this.cancelBookingFormError = d(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
263
+ this.goBackButtonClicked.emit();
264
+ }, this.handleSubmitCancelBooking = (t) => {
265
+ if (t.preventDefault(), !this.cancellationReason) {
266
+ this.cancellationError = "Please provide a reason for cancellation.", this.cancelBookingFormError.emit({ title: "Cancel booking form error", description: "Please provide a reason for cancellation." });
267
+ return;
268
+ }
269
+ c(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
270
+ const a = (s) => {
271
+ this.cancelBookedEventError.emit(s);
272
+ };
273
+ this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, reason: this.cancellationReason, errorHandler: a });
274
+ }, this.handleOnChangeCancellationReason = (t) => {
275
+ this.cancellationError = "", this.cancellationReason = t.target.value;
276
+ }, this.cancelBookingId = void 0, this.cancellationReason = "", this.cancellationError = "";
277
+ }
278
+ connectedCallback() {
279
+ c("[nylas-cancel-booking-form] Component connected");
280
+ }
281
+ async componentWillLoad() {
282
+ c("[nylas-cancel-booking-form] Component will load");
283
+ }
284
+ async componentDidLoad() {
285
+ c("[nylas-cancel-booking-form] Component did load");
286
+ }
287
+ disconnectedCallback() {
288
+ c("[nylas-cancel-booking-form] Component disconnected");
289
+ }
290
+ render() {
291
+ return n(b, { key: "98dc29d53d8a05beb16dea271cab5c574df4dfd0", part: "ncec" }, n("sp-theme", { key: "04feb774090fb57270a3d3c05576687ec78c230d", theme: "spectrum", scale: "medium" }, n("div", { key: "024a947c805b9f2ab6204a8548e9c775078fa969", class: "nylas-cancel-booking-form", part: "ncec__card" }, n("div", { key: "93295919797719199fbbe6eccdef4e42045c330d", class: "nylas-cancel-booking-form__calendar-icon", part: "ncec__icon" }, n("calendar-cancel-icon", { key: "b8da092aa626ebdef64dd3f2f54ca2df5082d1f3" })), n("h3", { key: "8e33cc23c5bc26aa8e5c979814fa5a398c798237", class: "nylas-cancel-booking-form__title", part: "ncec__title" }, "Cancel booking?"), n("div", { key: "2c8cd37241e6cfe38bb012be4d700ae03c33876e", class: "nylas-cancel-booking-form__description", part: "ncec__description" }, "Your current timeslot will become available to others."), n("form", { key: "be720382bd84086cd8a25279dd4ec58dbfc113e6", onSubmit: this.handleSubmitCancelBooking }, n("sp-field-label", { key: "fadd2793a898975b8ba8da0549bcbb37879a68bf", for: "cancel-reason", class: this.cancellationError ? "error" : "" }, "Reason for cancellation ", n("span", { key: "0748781625ea7ec8332b4ca20eae8986ad9e8efb", class: "required" }, "*")), n("sp-textfield", { key: "e8daf40a5c26b1e6b9b59ab42bbe613da72c987a", id: "cancel-reason", class: this.cancellationError ? "error" : "", part: "ncec__reason-textarea", multiline: !0, value: this.cancellationReason, onInput: this.handleOnChangeCancellationReason, onFocus: this.handleOnChangeCancellationReason, invalid: !!this.cancellationError }, n("sp-help-text", { key: "f876e2f41098845a235fe2b563e85891843d5351", slot: "negative-help-text" }, this.cancellationError)), n("sp-button", { key: "a05211715fda7fa75935c974bd20ce6c6ef4206a", variant: "primary", class: "cancel", type: "submit", part: "ncec__button-cta" }, "Cancel booking"), n("sp-button", { key: "3dd7832e698181eaca4df52835d64c09b664f5f9", variant: "secondary", class: "back", treatment: "outline", part: "ncec__button-outline", onClick: this.handleGoBackClicked }, "Go back")))));
292
+ }
293
+ };
294
+ ce([
295
+ p({
296
+ name: "nylas-cancel-booking-form",
297
+ eventToProps: {
298
+ cancelBookingFormSubmitted: async (e, t) => {
299
+ const a = await t.scheduler.cancelBooking(e.detail.bookingId), { errorHandler: s } = e.detail;
300
+ s && (!a || "error" in a) && s(a);
301
+ }
302
+ },
303
+ fireRegisterEvent: !0
304
+ }),
305
+ T("design:type", Function),
306
+ T("design:paramtypes", []),
307
+ T("design:returntype", void 0)
308
+ ], H.prototype, "render", null);
309
+ H.style = le;
310
+ const de = ':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}sp-theme{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family)}.nylas-cancelled-event-card{display:flex;align-items:center;flex-direction:column;width:400px;background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:1.5rem;position:relative;box-shadow:0px 1px 4px rgba(0, 0, 0, 0.1), 0px 3px 6px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.nylas-cancelled-event-card{width:inherit}}.nylas-cancelled-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-cancelled-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-cancelled-event-card__calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}.nylas-cancelled-event-card__cta{width:100%;display:flex;flex-direction:row;align-items:flex-start;margin-top:1rem}calendar-cancel-icon{display:flex;align-items:center;justify-content:center;height:100%}sp-button{background-color:var(--nylas-base-0);color:var(--nylas-base-700);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);font-size:1rem;height:48px;padding:8px;line-height:24px;width:100%}sp-button:hover,sp-button:focus{border-color:var(--nylas-primary)}sp-button:active{border-color:var(--nylas-base-600)}', be = de;
311
+ var fe = function(e, t, a, s) {
312
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
313
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
314
+ i = Reflect.decorate(e, t, a, s);
315
+ else
316
+ for (var l = e.length - 1; l >= 0; l--)
317
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
318
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
319
+ }, D = function(e, t) {
320
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
321
+ return Reflect.metadata(e, t);
322
+ };
323
+ const Z = class {
324
+ constructor(e) {
325
+ f(this, e), this.closeCancelEventCardClicked = d(this, "closeCancelEventCardClicked", 7), this.cancelledEventCardError = d(this, "cancelledEventCardError", 7), this.handleCloseClicked = () => {
326
+ this.isClosing = !0;
327
+ const t = (a) => {
328
+ this.cancelledEventCardError.emit(a), this.isClosing = !1;
329
+ };
330
+ this.closeCancelEventCardClicked.emit({ errorHandler: t });
331
+ }, this.cancelledEventInfo = void 0, this.isClosing = !1, this.configSettings = void 0;
332
+ }
333
+ connectedCallback() {
334
+ c("[nylas-cancelled-event-card] Component connected");
335
+ }
336
+ async componentWillLoad() {
337
+ c("[nylas-cancelled-event-card] Component will load");
338
+ }
339
+ async componentDidLoad() {
340
+ c("[nylas-cancelled-event-card] Component did load");
341
+ }
342
+ disconnectedCallback() {
343
+ c("[nylas-cancelled-event-card] Component disconnected");
344
+ }
345
+ render() {
346
+ var e, t;
347
+ return n(b, { key: "105954b6497f7a8cf45faedb592896629e90c6d0", part: "ncec" }, n("sp-theme", { key: "d248975c2139a611ab60c5c585d87e8701327a4b", theme: "spectrum", color: "dark", scale: "medium" }, n("div", { key: "090b767111679ca9968ac0b128c6685fed6e39db", class: "nylas-cancelled-event-card", part: "ncec__card" }, n("div", { key: "ae1e57f0f2a39f5ad7f4b7b9ed493f3e93ccdeba", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, n("calendar-cancel-icon", { key: "06250b1c0f330957f0f691d0f7724c608dffa28b" })), n("h3", { key: "1826c12ca770476cfd206d9d1a3b80f0d890da56", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, "Your booking has been cancelled successfully!"), n("div", { key: "93c4c7e4ed245372e736c61c30b23e9be11453ec", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, "A cancellation email has been sent to ", ((t = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : t.name) || "the participants", "."), n("div", { key: "21162d4c4e2ee6c2f95038b0e25e9ad0aed63742", class: "nylas-cancelled-event-card__cta" }, n("sp-button", { key: "ab6cb1da324717c3b375c9280f307a2590224f27", variant: "secondary", treatment: "outline", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? "Closing..." : "Close")))));
348
+ }
349
+ };
350
+ fe([
351
+ p({
352
+ name: "nylas-cancelled-event-card",
353
+ stateToProps: /* @__PURE__ */ new Map([["scheduler.configSettings", "configSettings"]]),
354
+ eventToProps: {
355
+ closeCancelEventCardClicked: async (e, t) => {
356
+ const a = await t.scheduler.resetCancel(), { errorHandler: s } = e.detail;
357
+ s && (!a || "error" in a) && s(a);
358
+ }
359
+ },
360
+ fireRegisterEvent: !0
361
+ }),
362
+ D("design:type", Function),
363
+ D("design:paramtypes", []),
364
+ D("design:returntype", void 0)
365
+ ], Z.prototype, "render", null);
366
+ Z.style = be;
367
+ const z = /* @__PURE__ */ new Date(), B = /* @__PURE__ */ new Date();
368
+ function k(e, t, a, s) {
369
+ function o(i) {
370
+ return e(i = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+i)), i;
371
+ }
372
+ return o.floor = (i) => (e(i = /* @__PURE__ */ new Date(+i)), i), o.ceil = (i) => (e(i = new Date(i - 1)), t(i, 1), e(i), i), o.round = (i) => {
373
+ const r = o(i), l = o.ceil(i);
374
+ return i - r < l - i ? r : l;
375
+ }, o.offset = (i, r) => (t(i = /* @__PURE__ */ new Date(+i), r == null ? 1 : Math.floor(r)), i), o.range = (i, r, l) => {
376
+ const h = [];
377
+ if (i = o.ceil(i), l = l == null ? 1 : Math.floor(l), !(i < r) || !(l > 0))
378
+ return h;
379
+ let y;
380
+ do
381
+ h.push(y = /* @__PURE__ */ new Date(+i)), t(i, l), e(i);
382
+ while (y < i && i < r);
383
+ return h;
384
+ }, o.filter = (i) => k((r) => {
385
+ if (r >= r)
386
+ for (; e(r), !i(r); )
387
+ r.setTime(r - 1);
388
+ }, (r, l) => {
389
+ if (r >= r)
390
+ if (l < 0)
391
+ for (; ++l <= 0; )
392
+ for (; t(r, -1), !i(r); )
393
+ ;
394
+ else
395
+ for (; --l >= 0; )
396
+ for (; t(r, 1), !i(r); )
397
+ ;
398
+ }), a && (o.count = (i, r) => (z.setTime(+i), B.setTime(+r), e(z), e(B), Math.floor(a(z, B))), o.every = (i) => (i = Math.floor(i), !isFinite(i) || !(i > 0) ? null : i > 1 ? o.filter(s ? (r) => s(r) % i === 0 : (r) => o.count(0, r) % i === 0) : o)), o;
399
+ }
400
+ const he = 1e3, A = he * 60, me = A * 60, v = me * 24, L = k(
401
+ (e) => e.setHours(0, 0, 0, 0),
402
+ (e, t) => e.setDate(e.getDate() + t),
403
+ (e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * A) / v,
404
+ (e) => e.getDate() - 1
405
+ );
406
+ k((e) => {
407
+ e.setUTCHours(0, 0, 0, 0);
408
+ }, (e, t) => {
409
+ e.setUTCDate(e.getUTCDate() + t);
410
+ }, (e, t) => (t - e) / v, (e) => e.getUTCDate() - 1);
411
+ k((e) => {
412
+ e.setUTCHours(0, 0, 0, 0);
413
+ }, (e, t) => {
414
+ e.setUTCDate(e.getUTCDate() + t);
415
+ }, (e, t) => (t - e) / v, (e) => Math.floor(e / v));
416
+ const pe = ':host{display:block;min-height:444px;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}@media screen and (max-width: 768px){:host{min-height:auto}}.nylas-date-picker{display:flex;gap:1rem;flex-direction:column}.header{margin:0 0.5rem;height:48px}.header h2{font-size:1.3125rem;font-weight:400;line-height:1rem;color:var(--nylas-base-800)}.header h2 strong{font-weight:600}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.dates{display:grid;justify-items:center;grid-template-columns:repeat(7, 1fr);gap:0.5rem;margin-bottom:1rem}.dates .date{position:relative;display:flex;flex-direction:row;justify-content:center;align-items:center;height:48px;width:48px;min-width:2rem;min-height:2rem;cursor:pointer;border-radius:var(--nylas-border-radius-2x);font-size:16px;font-weight:600;font-family:inherit;color:var(--nylas-base-text);background-color:var(--nylas-base-100);cursor:pointer;border:none}@media screen and (max-width: 412px){.dates .date{width:38px;height:38px;min-width:none}}.dates .date:hover:not(:disabled){box-shadow:0 0 0 2px var(--nylas-base-500) inset}.dates .date.date.current-month{color:var(--nylas-base-800)}.dates .date.date.selected{background-color:var(--nylas-primary);color:var(--nylas-base-0);font-weight:700}.dates .date.date.day-skeleton{color:var(--nylas-base-300)}.dates .date:disabled{color:var(--nylas-base-300);background-color:transparent;font-weight:400;cursor:not-allowed}.dates .day{font-size:12px;color:var(--nylas-base-800);font-weight:600;letter-spacing:0.5px;height:32px;display:flex;align-items:center}@media screen and (max-width: 768px){.dates .day{font-size:14px}}.dates .date.day-skeleton{height:48px;width:48px;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out;background-color:var(--nylas-base-50)}@media screen and (max-width: 412px){.dates .date.day-skeleton{width:38px;height:38px;min-width:none}}.dates .date.current-day::after{content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background-color:var(--nylas-base-500)}.dates .date.current-day.selected::after{background-color:var(--nylas-base-100)}.pagination{display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-width:92px}.pagination .chevron-right{transform:rotate(180deg)}.pagination .button{display:flex;flex-direction:row;justify-content:center;align-items:center;height:3vh;width:3vh;min-width:3em;min-height:3em;cursor:pointer;border-radius:var(--nylas-border-radius-2x);background-color:transparent;color:var(--nylas-base-800);cursor:pointer;border:none}.pagination .button:hover{background-color:var(--nylas-base-50)}.pagination .button:active{background-color:var(--nylas-base-100)}.pagination .button:disabled{background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.flex-row{display:flex;flex-direction:row;justify-content:space-between;align-items:center;color:var(--nylas-base-500)}', ye = pe;
417
+ var ue = function(e, t, a, s) {
418
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
419
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
420
+ i = Reflect.decorate(e, t, a, s);
421
+ else
422
+ for (var l = e.length - 1; l >= 0; l--)
423
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
424
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
425
+ }, S = function(e, t) {
426
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
427
+ return Reflect.metadata(e, t);
428
+ };
429
+ const V = class {
430
+ constructor(e) {
431
+ f(this, e), this.dateSelected = d(this, "dateSelected", 7), this.monthChanged = d(this, "monthChanged", 7), this.selectableDates = void 0, this.selectedDate = void 0, this.configSettings = void 0, this.isLoading = void 0, this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates(), this.disableNextMonthButton = !1;
432
+ }
433
+ connectedCallback() {
434
+ }
435
+ disconnectedCallback() {
436
+ }
437
+ componentWillLoad() {
438
+ }
439
+ getDates() {
440
+ const e = X(this.month), t = J(this.month);
441
+ return L.range(L.offset(t, -t.getDay()), L.offset(e, 7 - e.getDay()));
442
+ }
443
+ selectDate(e) {
444
+ this.dateSelected.emit(e);
445
+ }
446
+ changeMonth(e) {
447
+ var o, i;
448
+ this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1);
449
+ const t = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), a = (i = (o = this.configSettings) == null ? void 0 : o.scheduler) == null ? void 0 : i.available_days_in_future;
450
+ K(/* @__PURE__ */ new Date(), a).getTime() < t.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1, this.dates = this.getDates(), this.monthChanged.emit(this.month), this.selectDate();
451
+ }
452
+ isSelected(e, t, a) {
453
+ return e && t && m(e, t) && a && (a == null ? void 0 : a.length) > 0;
454
+ }
455
+ isDisabled(e, t) {
456
+ return e && (t == null ? void 0 : t.find((a) => m(a, e))) === void 0;
457
+ }
458
+ render() {
459
+ var e, t;
460
+ return n(b, { key: "fd7de67053417b11844a66e5b978f7feb80efe18", part: "ndp" }, n("div", { key: "a08943851e2239ad12121b90f35760d73a085441", class: "nylas-date-picker" }, n("div", { key: "832ad38012c55eb04ab2c5b0ceb50052ab3edd42", class: "header flex-row" }, n("h2", { key: "2df451227e57dfee081c1d4435443e479cf8871c", part: "ndp__month-header" }, n("strong", { key: "63421dca4b9bf36207ba05e9eff795c7c198287c" }, this.month.toLocaleDateString(void 0, { month: "long" })), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), n("div", { key: "ca982a82d87baf5658674624c1153f14e77470aa", class: "pagination" }, n("button", { key: "d2a41582014f92c23784c71fe1df9834d77fd355", onClick: () => this.changeMonth(-1), class: { "chevron-left": !0, button: !0 }, disabled: !((e = this.selectableDates) != null && e.length) || this.month <= /* @__PURE__ */ new Date(), part: "ndp__month-button" }, n("chevron-icon", { key: "4f319da7e440236edb9bfa711fb0b05cd046dc8e" })), n("button", { key: "ff00426293e1857592ebae58557ea46e5db9858d", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: !((t = this.selectableDates) != null && t.length) || this.disableNextMonthButton, part: "ndp__month-button" }, n("chevron-icon", { key: "7075f5e8da61c9d91fb612771a3d7672f1521b6f" })))), n("div", { key: "3ad884077d163de5182731c03bf856c9e204f411", class: "dates" }, ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"].map((a) => n("div", { class: "day", part: "ndp__day" }, a)), this.dates.map((a, s) => {
461
+ var i;
462
+ const o = this.isDisabled(a, this.selectableDates);
463
+ return this.isLoading ? n("button", { disabled: !0, class: {
464
+ "date day-skeleton": !0,
465
+ "current-month": C(a, this.month)
466
+ }, style: { animationDelay: `${s * 20}ms` }, part: "ndp__date" }, a.getDate()) : n("button", { class: {
467
+ date: !0,
468
+ selected: !!(this.selectedDate && m(a, this.selectedDate) && this.selectableDates && ((i = this.selectableDates) == null ? void 0 : i.length) > 0),
469
+ "current-day": m(a, /* @__PURE__ */ new Date()),
470
+ "current-month": C(a, this.month)
471
+ }, "aria-lang": a.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: o, onClick: () => this.selectDate(a), part: `ndp__date ${this.isSelected(a, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${m(a, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${C(a, this.month) ? "ndp__date--current-month" : ""}` }, a.getDate());
472
+ }))));
473
+ }
474
+ };
475
+ ue([
476
+ p({
477
+ name: "nylas-date-picker",
478
+ stateToProps: /* @__PURE__ */ new Map([
479
+ ["scheduler.selectableDates", "selectableDates"],
480
+ ["scheduler.selectedDate", "selectedDate"],
481
+ ["scheduler.isLoading", "isLoading"],
482
+ ["scheduler.configSettings", "configSettings"]
483
+ ]),
484
+ eventToProps: {
485
+ dateSelected: async (e, t) => {
486
+ t.scheduler.selectDate(e.detail);
487
+ }
488
+ },
489
+ fireRegisterEvent: !0
490
+ }),
491
+ S("design:type", Function),
492
+ S("design:paramtypes", []),
493
+ S("design:returntype", void 0)
494
+ ], V.prototype, "render", null);
495
+ V.style = ye;
496
+ const ge = ':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-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;height:68px;border-left:none;border-right:none;color:var(--nylas-base-50);font-size:14px;font-weight:600;cursor:pointer;transition:all 0.2s ease-in-out;font-family:inherit}@media screen and (max-width: 768px){.nylas-locale-switch{font-size:16px}}.select-wrapper{display:flex;align-items:center;gap:0.5rem}select{border:none;background:transparent;cursor:pointer;outline:none;background-color:transparent;margin:0 0 1px;padding:4px;vertical-align:middle}select#timezone{width:140px}select#language{width:80px}span.timezone-label{display:flex;width:-webkit-fill-available;justify-content:space-between}', ve = ge;
497
+ var ke = function(e, t, a, s) {
498
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
499
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
500
+ i = Reflect.decorate(e, t, a, s);
501
+ else
502
+ for (var l = e.length - 1; l >= 0; l--)
503
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
504
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
505
+ }, R = function(e, t) {
506
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
507
+ return Reflect.metadata(e, t);
508
+ };
509
+ const G = class {
510
+ constructor(e) {
511
+ f(this, e), this.timezoneChanged = d(this, "timezoneChanged", 7), this.languageChanged = d(this, "languageChanged", 7), this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = navigator.language;
512
+ }
513
+ connectedCallback() {
514
+ }
515
+ disconnectedCallback() {
516
+ }
517
+ componentWillLoad() {
518
+ }
519
+ changeTimezone(e) {
520
+ this.selectedTimezone = e, this.timezoneChanged.emit(e);
521
+ }
522
+ changeLanguage(e) {
523
+ this.selectedLanguage = e, this.languageChanged.emit(e);
524
+ }
525
+ selectedOptionChangedHandler(e) {
526
+ const { name: t, value: a } = e.detail;
527
+ t === "timezone" ? this.changeTimezone(a) : t === "language" && this.changeLanguage(a);
528
+ }
529
+ getTimezoneLabelHTML(e) {
530
+ const t = ee(e);
531
+ return n("span", { class: "timezone-label", style: {
532
+ display: "flex",
533
+ alignItems: "center",
534
+ justifyContent: "space-between",
535
+ width: "-webkit-fill-available"
536
+ } }, u[e], " ", n("span", { class: "timezone-offset", style: {
537
+ fontSize: "14px",
538
+ fontWeight: "400",
539
+ color: "var(--nylas-base-500)"
540
+ } }, t));
541
+ }
542
+ render() {
543
+ const e = Object.keys(u).map((a) => ({
544
+ labelHTML: this.getTimezoneLabelHTML(a),
545
+ label: u[a],
546
+ value: a
547
+ })), t = Object.keys(O).map((a) => ({
548
+ label: O[a],
549
+ value: a
550
+ }));
551
+ return n(b, { key: "688b90cbd1410a8025a8becfd3f979fc854c60a2" }, n("div", { key: "a4f485ce6204d89e16336c93809dbcf5ebf862ef", class: "nylas-locale-switch" }, n("div", { key: "5525e493d2f8e3258a2fe8b4c739db49d7ef1a35", class: {
552
+ "select-wrapper": !0,
553
+ timezone: !0
554
+ } }, n("select-dropdown", { key: "68f7f48a2cada4cc0c7327431f15384d17ebc261", name: "timezone", options: e, defaultSelectedOption: e.find((a) => a.value == this.selectedTimezone) }, n("span", { key: "d1213a8cba28b2163997cdb4bce7e13d7485e869", slot: "select-icon" }, n("globe-icon", { key: "f11285b20c93a42a0f195f89966bc7ff7b2d7322", width: "20", height: "20" })))), n("div", { key: "0287627954a80ef5092ded694e61ec2a19606667", class: {
555
+ "select-wrapper": !0,
556
+ language: !0
557
+ } }, n("select-dropdown", { key: "1bd58884de605b22cb6a5631b8e9f960cfa058d4", name: "language", options: t, defaultSelectedOption: t.find((a) => a.value == this.selectedLanguage) }, n("span", { key: "0681b6c8296d60c258c2df3bcb60d895c0e0c533", slot: "select-icon" }, n("translate-icon", { key: "bd3f346f56da2a139c5050799c9e2774d311d72c", width: "20", height: "20" }))))));
558
+ }
559
+ };
560
+ ke([
561
+ p({
562
+ name: "nylas-locale-switch",
563
+ stateToProps: /* @__PURE__ */ new Map([
564
+ ["scheduler.selectedLanguage", "selectedLanguage"],
565
+ ["scheduler.selectedTimezone", "selectedTimezone"]
566
+ ]),
567
+ eventToProps: {
568
+ timezoneChanged: async (e, t) => {
569
+ t.scheduler.selectTimezone(e.detail);
570
+ }
571
+ },
572
+ fireRegisterEvent: !0
573
+ }),
574
+ R("design:type", Function),
575
+ R("design:paramtypes", []),
576
+ R("design:returntype", void 0)
577
+ ], G.prototype, "render", null);
578
+ G.style = ve;
579
+ const xe = ".sc-nylas-logo-h{display:flex}", Ce = xe, we = class {
580
+ constructor(e) {
581
+ f(this, e), this.width = "69", this.height = "24";
582
+ }
583
+ render() {
584
+ return n("svg", { key: "5aea87a70e3fd0d4db9231f986662a0e51d5225e", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("g", { key: "635ee7b2cff95d3949dc8a7aba5d7897ac42bec8", "clip-path": "url(#clip0_455_3543)" }, n("path", { key: "818b4ab1d5087f3dbd4b65ec92c46da729b7b034", d: "M15.8092 3.03248C14.6497 1.86996 13.1076 1.23047 11.4646 1.23047C9.82156 1.23047 8.27753 1.86996 7.11999 3.03248L0.835347 9.33381C0.686846 9.4827 0.60498 9.68123 0.60498 9.89312C0.60498 10.105 0.686846 10.3035 0.835347 10.4524C0.983848 10.6013 1.18185 10.6834 1.39318 10.6834C1.60451 10.6834 1.80251 10.6013 1.95101 10.4524L8.23374 4.15111C10.0139 2.36627 12.9134 2.36627 14.6935 4.15111C16.4736 5.93785 16.4756 8.84322 14.6935 10.6281L8.4108 16.9275C8.10428 17.2348 8.10428 17.7368 8.4108 18.0461C8.5593 18.195 8.75731 18.2771 8.96863 18.2771C9.17996 18.2771 9.37796 18.195 9.52646 18.0461L15.8092 11.7467C16.9687 10.5841 17.6064 9.03793 17.6064 7.39053C17.6064 5.74314 16.9687 4.19501 15.8092 3.03439V3.03248Z", fill: "currentColor" }), n("path", { key: "0519037016d40d4c264b929f042bffde6fcb4095", d: "M14.9296 7.39038C14.9296 6.46074 14.5698 5.58837 13.9148 4.93361C12.5631 3.57828 10.3641 3.57828 9.01239 4.93361L0.663961 13.3023C0.51546 13.4512 0.433594 13.6497 0.433594 13.8616C0.433594 14.0735 0.51546 14.272 0.663961 14.4209C0.812462 14.5698 1.01046 14.6519 1.22179 14.6519C1.43312 14.6519 1.63112 14.5698 1.77962 14.4209L10.0367 6.1515L10.05 6.13623C10.0747 6.10759 10.1014 6.07705 10.128 6.05033C10.1585 6.01978 10.1928 5.99115 10.2251 5.96252L10.2442 5.94534C10.9886 5.31349 12.1119 5.3593 12.8011 6.05033C13.4903 6.74135 13.536 7.78171 12.9705 8.53192L12.9648 8.53955C12.9058 8.61591 12.8544 8.67699 12.8011 8.73044C12.7497 8.78198 12.6906 8.83352 12.6069 8.90033L4.45264 17.0991C4.30414 17.248 4.22227 17.4465 4.22227 17.6584C4.22227 17.8703 4.30414 18.0689 4.45264 18.2177C4.60114 18.3666 4.79914 18.4487 5.01047 18.4487C5.2218 18.4487 5.4198 18.3666 5.5683 18.2177L13.9167 9.84716C14.5698 9.1924 14.9315 8.31812 14.9315 7.39038H14.9296Z", fill: "currentColor" }), n("path", { key: "10efd16fe4864b407bed8c54611001c6a0f5098f", d: "M10.6821 9.11238C10.4727 9.01694 10.2861 8.88904 10.1281 8.7306C9.97008 8.57216 9.84252 8.38508 9.74733 8.1751L9.69021 8.05103L0.467916 17.2978C0.287049 17.4792 0.174721 17.7082 0.149971 17.9411C0.125221 18.1778 0.19376 18.3897 0.344165 18.5405C0.471724 18.6684 0.65259 18.739 0.850592 18.739C1.11142 18.739 1.37796 18.6207 1.58358 18.4145L10.8059 9.16774L10.6821 9.11047V9.11238Z", fill: "currentColor" }), n("path", { key: "0282ae1035c07bd0f8af5c3530ce7ce799dc2dc1", d: "M68.401 10.6185C68.2126 10.2692 67.9593 9.97334 67.6433 9.73854C67.3235 9.49993 66.956 9.31094 66.5486 9.17541C66.1316 9.03606 65.7033 8.91771 65.2749 8.81844C64.7951 8.70582 64.3039 8.57983 63.8165 8.44811C63.3196 8.31258 62.9065 8.14269 62.5905 7.94225C62.4743 7.88689 62.3391 7.76663 62.3391 7.50129C62.3391 7.39821 62.3639 7.29704 62.4153 7.19587L62.4248 7.18059C62.5352 7.02216 62.7142 6.8828 62.975 6.75109C63.234 6.62128 63.609 6.55829 64.1231 6.55829C64.5286 6.55829 64.877 6.61365 65.1569 6.72436C65.4348 6.83508 65.6652 6.96871 65.8442 7.12524C66.0212 7.27986 66.1659 7.45357 66.2782 7.63873C66.3563 7.76854 66.4267 7.89262 66.4858 8.00525L68.2754 6.84081C68.1669 6.59456 68.0146 6.33495 67.8204 6.0677C67.6033 5.768 67.3254 5.4893 66.9922 5.23732C66.659 4.98534 66.2516 4.77345 65.7813 4.60929C65.3111 4.44512 64.7532 4.36304 64.1231 4.36304C63.3844 4.36304 62.7599 4.46421 62.2706 4.66083C61.7813 4.85935 61.3815 5.09988 61.0845 5.37667C60.7875 5.65346 60.5628 5.95125 60.4143 6.2605C60.2639 6.57547 60.1611 6.85799 60.1078 7.10233C60.0945 7.18059 60.0812 7.27031 60.0678 7.36767C60.0545 7.4593 60.0469 7.5452 60.0469 7.62537C60.0469 8.13314 60.1745 8.56074 60.4239 8.89671C60.679 9.24222 61.0045 9.53429 61.391 9.76336C61.7813 9.99624 62.2116 10.1852 62.6704 10.3227C63.1388 10.462 63.5862 10.5823 64.0012 10.6796C64.4067 10.777 64.7932 10.8782 65.1531 10.9774C65.5224 11.0786 65.8289 11.2122 66.0631 11.3745C66.2801 11.5425 66.3887 11.7448 66.3887 11.9777C66.3887 12.2278 66.2916 12.4263 66.0993 12.5695C65.9279 12.6954 65.7261 12.7985 65.4958 12.8711C65.273 12.9436 65.0407 12.9913 64.8066 13.0142C64.58 13.0352 64.3915 13.0467 64.2468 13.0467C63.8032 13.0467 63.4224 13.0028 63.1197 12.915C62.8151 12.8272 62.5638 12.7241 62.3734 12.6057C62.1811 12.4874 62.0288 12.3614 61.9222 12.2316C61.8213 12.1094 61.747 12.0082 61.7014 11.9319L61.4957 11.6303L59.708 12.7928C59.8508 13.0161 60.0298 13.2643 60.2392 13.5296C60.4772 13.8293 60.7837 14.1138 61.153 14.3734C61.5224 14.633 61.966 14.8525 62.4724 15.0243C62.9788 15.1961 63.5748 15.282 64.2468 15.282C64.797 15.282 65.2901 15.2324 65.7166 15.137C66.1412 15.0396 66.5162 14.9117 66.8285 14.7552C67.1388 14.6005 67.4015 14.4192 67.6109 14.2149C67.8223 14.0107 67.9974 13.8026 68.1326 13.6003C68.4563 13.1135 68.6409 12.5504 68.6828 11.9262C68.6828 11.4069 68.5876 10.9641 68.401 10.6166V10.6185Z", fill: "currentColor" }), n("path", { key: "16e1d732c5e6eee5f772d45085103b099c3130bf", d: "M26.3585 4.27905C23.7901 4.27905 21.6997 6.37504 21.6997 8.95017V15.0701H23.9291V8.95017C23.9291 7.6082 25.0181 6.5163 26.3565 6.5163C27.695 6.5163 28.784 7.6082 28.784 8.95017V15.0701H31.0134V8.95017C31.0134 6.37504 28.9229 4.27905 26.3546 4.27905H26.3585Z", fill: "currentColor" }), n("path", { key: "495550fe08ebeba1c89726b7009112e89088472a", d: "M53.4522 4.27905C50.4251 4.27905 47.9634 6.74728 47.9634 9.78245C47.9634 12.8176 50.427 15.2859 53.4522 15.2859C54.5545 15.2859 55.6188 14.9594 56.5288 14.3409L56.7116 14.2169V15.0682H58.941V9.78245C58.941 6.74728 56.4793 4.27905 53.4522 4.27905ZM53.4522 13.0505C51.655 13.0505 50.1928 11.5845 50.1928 9.78245C50.1928 7.98044 51.655 6.51439 53.4522 6.51439C55.2494 6.51439 56.7116 7.98044 56.7116 9.78245C56.7116 11.5845 55.2494 13.0505 53.4522 13.0505Z", fill: "currentColor" }), n("path", { key: "effe06423b66ff0a533bfb8ec6d9a0cbbf19f765", d: "M45.5795 10.6166V0.356201H43.3501V10.6166C43.3501 13.1517 45.3758 15.2228 47.8908 15.2858V13.0486C46.6057 12.9875 45.5795 11.9204 45.5795 10.6166Z", fill: "currentColor" }), n("path", { key: "785098f3a2ac3a19e79056e355365fd8ccc81cd9", d: "M39.5428 4.4967V10.63C39.5428 11.6761 38.8669 12.621 37.9016 12.9284C37.1249 13.1746 36.3157 13.0486 35.6817 12.5829C35.0592 12.1247 34.6879 11.3917 34.6879 10.6186V4.4967H32.4585V10.5995C32.4585 12.7165 33.8388 14.57 35.8131 15.1084C37.0354 15.4424 38.2995 15.2973 39.3695 14.7037L39.5428 14.6063V14.9747C39.5428 16.2766 38.5166 17.3437 37.2315 17.4067V19.6439C39.7465 19.5809 41.7722 17.5117 41.7722 14.9747V4.4967H39.5428Z", fill: "currentColor" })), n("defs", { key: "9466fc6ad025006936d16136c6f4be4b79282759" }, n("clipPath", { key: "901a3ef6048680de4ddbdd8e3fd8edfbb7afc0f3", id: "clip0_455_3543" }, n("rect", { key: "aee5f90208b83c446e4ac3877ce788d0dcad0de3", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
585
+ }
586
+ };
587
+ we.style = Ce;
588
+ const _e = ':host{display:block;margin-bottom:-12px;width:100%;z-index:1;--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}.notif{display:flex;padding:17px;align-items:flex-start;justify-content:space-between;gap:16px;border-radius:var(--nylas-border-radius-2x);border:1.5px solid var(--nylas-error);background:var(--nylas-base-0)}@media screen and (max-width: 768px){.notif{width:auto}}.notif .content{display:flex;flex-direction:row;gap:8px}.notif .content .message{font-size:14px;font-weight:400;color:var(--nylas-base-800)}.notif .content .message .title{font-size:16px;font-weight:600;color:var(--nylas-base-950);display:block}.notif .content .message .description{font-size:14px;font-weight:400;color:var(--nylas-base-800);display:block}.notif .content .icon.error{color:var(--nylas-error)}.notif.error{border-color:var(--nylas-error)}.notif.warning{border-color:var(--nylas-warning)}.notif.info{border-color:var(--nylas-info)}.notif.success{border-color:var(--nylas-success)}.notif .dismiss-btn{background:none;border:none;color:var(--nylas-base-950);cursor:pointer}', Ee = _e, Te = class {
589
+ constructor(e) {
590
+ f(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
591
+ }
592
+ onError(e) {
593
+ c(`[nylas-notification] Error: ${e.detail.title}`), this.handleNotification(e);
594
+ }
595
+ onWarning(e) {
596
+ c(`[nylas-notification] Warning: ${e.detail.title}`), this.handleNotification(e);
597
+ }
598
+ onInfo(e) {
599
+ c(`[nylas-notification] Info: ${e.detail.title}`), this.handleNotification(e);
600
+ }
601
+ onSuccess(e) {
602
+ c(`[nylas-notification] Success: ${e.detail.title}`), this.handleNotification(e);
603
+ }
604
+ handleNotification(e) {
605
+ if (e.defaultPrevented) {
606
+ c("[nylas-notification] Event default prevented");
607
+ return;
608
+ }
609
+ if (this.ttl === 0) {
610
+ c("[nylas-notification] TTL is 0");
611
+ return;
612
+ }
613
+ if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(e.detail.category)) {
614
+ c("[nylas-notification] Category not allowed");
615
+ return;
616
+ }
617
+ if (this.notifications = [...this.notifications, { ...e.detail }], e.detail.ttl !== "none") {
618
+ const t = e.detail.ttl ? e.detail.ttl : this.ttl;
619
+ window.setTimeout(() => {
620
+ this.notifications = this.notifications.filter((a) => a.id !== e.detail.id);
621
+ }, t);
622
+ }
623
+ }
624
+ dismissNotification(e) {
625
+ this.notifications = this.notifications.filter((t) => t.id !== e);
626
+ }
627
+ render() {
628
+ return n(b, { key: "16bd673245819e3ed76ba5689c3292be510e3cd7" }, n(Q, { key: "d88e8ea863d00a8c982c7e26007c975526c7457f" }, this.notifications.map((e) => n("div", { class: `notif ${e.type}`, key: e.id }, n("div", { class: "content" }, n("span", { class: `icon ${e.type}` }, (e.type === "error" || e.type === "warning") && n("warning-icon", null)), n("span", { class: "message" }, n("span", { class: "title" }, e.title), e.description && n("span", { class: "description" }, e.description))), n("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(e.id) }, n("close-icon", null)))), n("slot", { key: "c40cb61ce0a1dbd3416824b7c26e08e3aea01eae" })));
629
+ }
630
+ };
631
+ Te.style = Ee;
632
+ const De = ":host{display:block}sp-theme{position:relative;height:inherit;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:var(--nylas-font-family)}.event-card{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3rem);background-color:var(--nylas-base-0);color:var(--nylas-base-800);border-radius:var(--nylas-border-radius-2x);padding:3rem 1.5rem 1.5rem 1.5rem;position:relative;box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)}@media screen and (max-width: 768px){.event-card{margin-bottom:2rem}}.nylas-selected-event-card__date{font-size:min(max(16px, 3vw), 18px);font-weight:600}.nylas-selected-event-card__time{font-size:min(max(14px, 3vw), 16px);font-weight:500}.calendar-icon{width:3rem;height:3rem;border-radius:50%;position:absolute;top:-1.25rem;left:50%;transform:translateX(-50%);background-color:var(--nylas-base-0);border:1px solid var(--nylas-base-200)}calendar-icon{display:flex;align-items:center;justify-content:center;height:100%}.event-timezone{display:flex;color:var(--nylas-base-600);margin-bottom:8px;gap:4px;align-items:center}@media screen and (max-width: 768px){.event-timezone{margin-bottom:16px}}", ze = De;
633
+ var Be = function(e, t, a, s) {
634
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
635
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
636
+ i = Reflect.decorate(e, t, a, s);
637
+ else
638
+ for (var l = e.length - 1; l >= 0; l--)
639
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
640
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
641
+ }, I = function(e, t) {
642
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
643
+ return Reflect.metadata(e, t);
644
+ };
645
+ const W = class {
646
+ constructor(e) {
647
+ f(this, e), this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.startTime = "", this.endTime = "";
648
+ }
649
+ connectedCallback() {
650
+ }
651
+ disconnectedCallback() {
652
+ }
653
+ async componentWillLoad() {
654
+ c("[nylas-selected-event-card] Component will load");
655
+ }
656
+ async componentDidLoad() {
657
+ c("[nylas-selected-event-card] Component did load");
658
+ }
659
+ handleSelectedTimeslotChange(e) {
660
+ this.startTime = new Date(e == null ? void 0 : e.start_time).toLocaleString(void 0, { timeStyle: "short" }), this.endTime = new Date(e == null ? void 0 : e.end_time).toLocaleString(void 0, { timeStyle: "short" });
661
+ }
662
+ render() {
663
+ var e;
664
+ return n(b, { key: "1104fd2969ab03bb794c17bbf08f1600a200448c", part: "nsec" }, n("sp-theme", { key: "674934ecb54519d9e8c227a9946b9725518b77e5", theme: "spectrum", color: "dark", scale: "medium" }, n("div", { key: "4d492e825e93b93ff96af4970812178656de4ab8", class: "event-card", part: "nsec__card" }, n("div", { key: "239131412dab45da5b1f7bfe3b4a2eda45a2978b", class: "calendar-icon", part: "nsec__icon" }, n("calendar-icon", { key: "a2fa2f47b94a2c331d4cac88ef736faef3e30dae" })), n("div", { key: "81c873d5c2019b6ae1d8b746685dbe5efc2d7d0b", class: "nylas-selected-event-card__date", part: "nsec__date" }, (e = this.selectedDate) == null ? void 0 : e.toLocaleDateString(void 0, { dateStyle: "full" })), n("div", { key: "67348e66fd879ead10594b216a2d66cf7da272aa", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), n("div", { key: "0fc6452dae7c5998a70d116c9bdfe25ab109661c", class: "event-timezone", part: "nsec__timezone" }, n("globe-icon", { key: "86c4a1e2728a30e34805a7c286378fe9adef110e" }), u[this.selectedTimezone])));
665
+ }
666
+ static get watchers() {
667
+ return {
668
+ selectedTimeslot: ["handleSelectedTimeslotChange"]
669
+ };
670
+ }
671
+ };
672
+ Be([
673
+ p({
674
+ name: "nylas-selected-event-card",
675
+ stateToProps: /* @__PURE__ */ new Map([
676
+ ["scheduler.selectedDate", "selectedDate"],
677
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
678
+ ["scheduler.selectedTimezone", "selectedTimezone"]
679
+ ]),
680
+ eventToProps: {},
681
+ fireRegisterEvent: !0
682
+ }),
683
+ I("design:type", Function),
684
+ I("design:paramtypes", []),
685
+ I("design:returntype", void 0)
686
+ ], W.prototype, "render", null);
687
+ W.style = ze;
688
+ const Le = ":host{display:block;height:calc(100% - 48px)}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.time-slots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.5rem;flex:1}.time{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:4px 12px;gap:0.5rem;font-size:16px;font-weight:500;font-family:inherit;width:100%;height:48px;color:var(--nylas-base-800);background:var(--nylas-base-0);border:none;outline:1.5px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);flex:none;order:4;align-self:stretch;flex-grow:0;cursor:pointer}.time:hover,.time:focus{color:var(--nylas-primary);outline-color:var(--nylas-primary)}.time.selected{font-weight:600;color:var(--nylas-primary);outline:2px solid var(--nylas-primary);border-color:transparent;box-shadow:0 0 0 2px var(--nylas-primary)}.empty{text-align:center;padding:0 1.5rem;color:var(--nylas-base-600);font-size:min(max(12px, 2vw), 14px);height:450px;display:flex;align-items:center;justify-content:center}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.loading{padding:0 1.5rem}.loading .time-slot-skeleton{width:100%;height:4rem;background-color:var(--nylas-base-50);margin-bottom:0.5rem;border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite ease-in-out}.footer{width:100%;padding:10px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}.footer sp-button{padding:14px;color:var(--nylas-base-100);border-radius:var(--nylas-border-radius-2x);width:100%;height:48px;font-weight:600;font-size:16px;background-color:var(--nylas-primary);border:none}.footer sp-button:hover,.footer sp-button:focus{background-color:var(--nylas-base-600)}.footer sp-button:active{background-color:var(--nylas-base-800)}", Se = Le;
689
+ var Re = function(e, t, a, s) {
690
+ var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, a) : s, r;
691
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
692
+ i = Reflect.decorate(e, t, a, s);
693
+ else
694
+ for (var l = e.length - 1; l >= 0; l--)
695
+ (r = e[l]) && (i = (o < 3 ? r(i) : o > 3 ? r(t, a, i) : r(t, a)) || i);
696
+ return o > 3 && i && Object.defineProperty(t, a, i), i;
697
+ }, j = function(e, t) {
698
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
699
+ return Reflect.metadata(e, t);
700
+ };
701
+ const U = class {
702
+ constructor(e) {
703
+ f(this, e), this.timeslotSelected = d(this, "timeslotSelected", 7), this.timeslotConfirmed = d(this, "timeslotConfirmed", 7), this.handleConfirmedTimeslot = async (t, a) => {
704
+ t.preventDefault(), c("[nylas-timeslot-picker] Confirm timeslot", a), this.timeslotConfirmed.emit(a);
705
+ }, this.handleMouseEnter = (t) => {
706
+ this.hoveredTimeslotIndex = t;
707
+ }, this.handleMouseLeave = () => {
708
+ this.hoveredTimeslotIndex = -1;
709
+ }, this.selectedDate = /* @__PURE__ */ new Date(), this.availability = void 0, this.selectedTimeslot = void 0, this.isLoading = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.times = [], this.hoveredTimeslotIndex = void 0, this.selectedTimeslotIndex = void 0;
710
+ }
711
+ connectedCallback() {
712
+ }
713
+ disconnectedCallback() {
714
+ }
715
+ async componentWillLoad() {
716
+ var t;
717
+ const e = (t = this.availability) == null ? void 0 : t.filter((a) => this.selectedDate && m(a.start_time, this.selectedDate)).map((a) => a);
718
+ this.times = e || [], c("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
719
+ }
720
+ async componentDidLoad() {
721
+ c("[nylas-timeslot-picker] Component did load");
722
+ }
723
+ getTimeslotId(e, t) {
724
+ return `${e.toLocaleDateString()}-${t}`;
725
+ }
726
+ onClickSelectTime(e, t) {
727
+ c("[nylas-timeslot-picker] Time selected", e, t), this.selectedTimeslotIndex = this.getTimeslotId(e.start_time, t), this.timeslotSelected.emit({
728
+ start_time: e.start_time,
729
+ end_time: e.end_time
730
+ });
731
+ }
732
+ getTimeSlotLabel(e) {
733
+ const t = new Intl.DateTimeFormat("en-US", {
734
+ hour: "numeric",
735
+ minute: "numeric",
736
+ timeZone: this.selectedTimezone
737
+ });
738
+ return `${t.format(e.start_time)} - ${t.format(e.end_time)}`;
739
+ }
740
+ selectedDateChanged(e) {
741
+ var t;
742
+ if (c("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
743
+ const a = (t = this.availability) == null ? void 0 : t.filter((s) => m(s.start_time, e)).map((s) => s);
744
+ this.times = a || [];
745
+ }
746
+ }
747
+ availabilityChanged(e) {
748
+ if (c("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
749
+ const t = e == null ? void 0 : e.filter((a) => this.selectedDate && m(a.start_time, this.selectedDate)).map((a) => a);
750
+ this.times = t || [];
751
+ }
752
+ }
753
+ render() {
754
+ return this.isLoading ? n(b, null, n("div", { class: "loading" }, new Array(6).fill(0).map((e, t) => n("div", { class: "time-slot-skeleton", style: { animationDelay: `${t * 20}ms` } })))) : this.availability && this.availability.length === 0 ? n(b, null, n("div", { class: "empty" }, n("span", null, "No dates available"))) : (!this.times || this.times.length === 0) && this.selectedDate ? n(b, null, n("div", { class: "empty" }, n("span", null, "No time slots available for selected date"))) : this.selectedDate ? n(b, { part: "ntp" }, n("div", { class: "time-picker-wrapper" }, n("div", { class: "time-slots" }, this.times.map((e, t) => {
755
+ var a, s, o, i;
756
+ return n("button", { part: `ntp__timeslot ${((s = (a = this.selectedTimeslot) == null ? void 0 : a.start_time) == null ? void 0 : s.getTime()) === e.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, "aria-role": "button", class: {
757
+ time: !0,
758
+ selected: typeof this.selectedTimeslot < "u" && ((i = (o = this.selectedTimeslot) == null ? void 0 : o.start_time) == null ? void 0 : i.getTime()) === e.start_time.getTime()
759
+ }, onClick: () => this.onClickSelectTime(e, t), onMouseEnter: () => this.handleMouseEnter(t), onMouseLeave: () => this.handleMouseLeave() }, this.hoveredTimeslotIndex == t || this.selectedTimeslotIndex == this.getTimeslotId(e.start_time, t) ? this.getTimeSlotLabel(e) : e.start_time.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", timeZone: this.selectedTimezone }));
760
+ })), this.selectedTimeslot && n("div", { class: "footer" }, n("sp-button", { variant: "primary", onClick: (e) => this.handleConfirmedTimeslot(e, this.selectedTimeslot), part: "ntp__button-primary" }, n("slot", { name: "timeslot-picker-cta-label" }, "Next"))))) : n(b, null);
761
+ }
762
+ static get watchers() {
763
+ return {
764
+ selectedDate: ["selectedDateChanged"],
765
+ availability: ["availabilityChanged"]
766
+ };
767
+ }
768
+ };
769
+ Re([
770
+ p({
771
+ name: "nylas-timeslot-picker",
772
+ stateToProps: /* @__PURE__ */ new Map([
773
+ ["scheduler.selectedDate", "selectedDate"],
774
+ ["scheduler.availability", "availability"],
775
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
776
+ ["scheduler.selectedTimezone", "selectedTimezone"],
777
+ ["scheduler.isLoading", "isLoading"]
778
+ ]),
779
+ eventToProps: {
780
+ timeslotSelected: async (e, t) => {
781
+ t.scheduler.selectTime(e.detail);
782
+ },
783
+ timeslotConfirmed: async (e, t) => {
784
+ e.detail && t.scheduler.toggleAdditionalData(!0);
785
+ }
786
+ },
787
+ fireRegisterEvent: !0
788
+ }),
789
+ j("design:type", Function),
790
+ j("design:paramtypes", []),
791
+ j("design:returntype", void 0)
792
+ ], U.prototype, "render", null);
793
+ U.style = Se;
794
+ export {
795
+ F as nylas_booked_event_card,
796
+ $ as nylas_booking_form,
797
+ H as nylas_cancel_booking_form,
798
+ Z as nylas_cancelled_event_card,
799
+ V as nylas_date_picker,
800
+ G as nylas_locale_switch,
801
+ we as nylas_logo,
802
+ Te as nylas_notification,
803
+ W as nylas_selected_event_card,
804
+ U as nylas_timeslot_picker
805
+ };