@nylas/react 1.3.5 → 1.4.0

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 (221) hide show
  1. package/dist/add-circle-icon_2.entry-6e8e4e1e.cjs +1 -0
  2. package/dist/add-circle-icon_2.entry-dbad9a3b.js +26 -0
  3. package/dist/archive-icon.entry-21f532af.cjs +1 -0
  4. package/dist/archive-icon.entry-802f7877.js +16 -0
  5. package/dist/{arrow-icon.entry-fa9584cf.js → arrow-icon.entry-e3dec626.js} +3 -2
  6. package/dist/arrow-icon.entry-e9af732a.cjs +1 -0
  7. package/dist/{bold-icon.entry-ac6a4956.js → bold-icon.entry-0492ff02.js} +3 -2
  8. package/dist/bold-icon.entry-1a2be28a.cjs +1 -0
  9. package/dist/button-component_2.entry-f0c7f894.cjs +1 -0
  10. package/dist/{button-component_2.entry-caf33abf.js → button-component_2.entry-fea9bd3d.js} +10 -9
  11. package/dist/calendar-agenda-fill-icon_36.entry-70681da2.cjs +6 -0
  12. package/dist/calendar-agenda-fill-icon_36.entry-c85d6a79.js +4642 -0
  13. package/dist/calendar-cancel-icon.entry-237b8c9e.cjs +1 -0
  14. package/dist/{calendar-cancel-icon.entry-02015d74.js → calendar-cancel-icon.entry-e7dd5b8f.js} +6 -5
  15. package/dist/calendar-check-icon_2.entry-a868e0bc.cjs +1 -0
  16. package/dist/{calendar-check-icon_2.entry-2f7dc236.js → calendar-check-icon_2.entry-c7f47fc8.js} +10 -9
  17. package/dist/calendar-icon.entry-071eb30d.cjs +1 -0
  18. package/dist/{calendar-icon.entry-70ac9bd6.js → calendar-icon.entry-324de624.js} +6 -5
  19. package/dist/checkbox-component.entry-0f9970cc.js +43 -0
  20. package/dist/checkbox-component.entry-5bcf4b08.cjs +1 -0
  21. package/dist/checkmark-icon_15.entry-7776e533.cjs +5 -0
  22. package/dist/checkmark-icon_15.entry-98377585.js +1337 -0
  23. package/dist/chevron-icon_3.entry-526b4b85.cjs +1 -0
  24. package/dist/chevron-icon_3.entry-ec66260c.js +148 -0
  25. package/dist/{clock-icon_4.entry-af5301d7.js → clock-icon_4.entry-4fa47996.js} +19 -18
  26. package/dist/clock-icon_4.entry-66d15f7c.cjs +1 -0
  27. package/dist/{constants-f6e79ab7-24392f9e.js → constants-f5ba52b9-40ab2ded.js} +121 -30
  28. package/dist/constants-f5ba52b9-a0866d2f.cjs +1 -0
  29. package/dist/customParseFormat-39eacb44-45ade322.cjs +1 -0
  30. package/dist/customParseFormat-39eacb44-eeffe2bb.js +135 -0
  31. package/dist/delete-icon.entry-540aa2bb.cjs +1 -0
  32. package/dist/{delete-icon.entry-00cb3ee8.js → delete-icon.entry-95d01eb8.js} +7 -6
  33. package/dist/document-refresh-icon.entry-b82d5da8.js +16 -0
  34. package/dist/document-refresh-icon.entry-c467f082.cjs +1 -0
  35. package/dist/elements/index.d.ts +11 -0
  36. package/dist/{feedbackSync-547e51ee-bcaf691c.js → feedbackSync-47d13bb0-5608d680.js} +1 -1
  37. package/dist/{feedbackSync-547e51ee-9b572309.cjs → feedbackSync-47d13bb0-9f249f33.cjs} +1 -1
  38. package/dist/folder-icon.entry-4d48c2ee.cjs +1 -0
  39. package/dist/{folder-icon.entry-60b3eda5.js → folder-icon.entry-cb0dc63d.js} +5 -4
  40. package/dist/forward-icon.entry-5aa01f53.js +16 -0
  41. package/dist/forward-icon.entry-d04aaf6d.cjs +1 -0
  42. package/dist/globe-icon_2.entry-87e29cdf.cjs +1 -0
  43. package/dist/globe-icon_2.entry-c7ae78cc.js +200 -0
  44. package/dist/google-logo-icon_6.entry-80a6bfa3.js +1457 -0
  45. package/dist/google-logo-icon_6.entry-a8b6efc0.cjs +2 -0
  46. package/dist/google-meet-icon_5.entry-26d667b6.cjs +1 -0
  47. package/dist/google-meet-icon_5.entry-4e71c83b.js +56 -0
  48. package/dist/inbox-icon.entry-60a82bfc.cjs +1 -0
  49. package/dist/inbox-icon.entry-77e4e17b.js +16 -0
  50. package/dist/index-04630615.js +17580 -0
  51. package/dist/index-3d1f13d6.cjs +57 -0
  52. package/dist/index.d.ts +1 -3
  53. package/dist/{index.es-2d849a15-2d84f7a5.cjs → index.es-1fdb1e36-830a422f.cjs} +6 -6
  54. package/dist/{index.es-2d849a15-4eb8e180.js → index.es-1fdb1e36-fbdb04fa.js} +818 -804
  55. package/dist/info-icon_2.entry-34800b66.cjs +1 -0
  56. package/dist/info-icon_2.entry-3c483f61.js +35 -0
  57. package/dist/input-component.entry-ea4016fe.js +84 -0
  58. package/dist/input-component.entry-f7ccf3d6.cjs +1 -0
  59. package/dist/input-dropdown_2.entry-c7730cf8.js +231 -0
  60. package/dist/input-dropdown_2.entry-d4024d2f.cjs +1 -0
  61. package/dist/italic-icon.entry-6e0805ab.js +16 -0
  62. package/dist/italic-icon.entry-8127c2ee.cjs +1 -0
  63. package/dist/multi-select-dropdown_2.entry-49d6f0e7.cjs +1 -0
  64. package/dist/multi-select-dropdown_2.entry-d749999d.js +187 -0
  65. package/dist/notebook-store-b61693cd-7a5576e7.js +14 -0
  66. package/dist/notebook-store-b61693cd-84de36d2.cjs +5 -0
  67. package/dist/nylas-booked-event-card_12.entry-29337b10.cjs +1 -0
  68. package/dist/nylas-booked-event-card_12.entry-3fcfd6f9.js +1418 -0
  69. package/dist/nylas-call-summary.entry-38aed89a.js +16 -0
  70. package/dist/nylas-call-summary.entry-e9adcb93.cjs +1 -0
  71. package/dist/nylas-event-calendar_3.entry-48f656e5.cjs +6 -0
  72. package/dist/nylas-event-calendar_3.entry-62d1f1f5.js +9693 -0
  73. package/dist/nylas-form-card.entry-3828ccb1.js +58 -0
  74. package/dist/nylas-form-card.entry-b900b46e.cjs +1 -0
  75. package/dist/{nylas-if-state.entry-beef8af6.js → nylas-if-state.entry-2810dcf5.js} +4 -3
  76. package/dist/nylas-if-state.entry-92af0a51.cjs +1 -0
  77. package/dist/nylas-key-points.entry-977a6fae.js +29 -0
  78. package/dist/nylas-key-points.entry-de658637.cjs +1 -0
  79. package/dist/nylas-login.entry-4a6c11e6.cjs +1 -0
  80. package/dist/{nylas-login.entry-1661cbd4.js → nylas-login.entry-8101d3d0.js} +4 -3
  81. package/dist/nylas-provider.entry-b7ac25f5.cjs +1 -0
  82. package/dist/{nylas-provider.entry-1f140378.js → nylas-provider.entry-c054d68a.js} +6 -5
  83. package/dist/nylas-scheduler-editor.entry-1538950d.cjs +2 -0
  84. package/dist/{nylas-scheduler-editor.entry-f184f72e.js → nylas-scheduler-editor.entry-e35fad5c.js} +530 -272
  85. package/dist/nylas-scheduling.entry-360b978c.js +439 -0
  86. package/dist/nylas-scheduling.entry-92351cd2.cjs +1 -0
  87. package/dist/nylas-transcript.entry-4d973027.cjs +6 -0
  88. package/dist/nylas-transcript.entry-81e2c821.js +128 -0
  89. package/dist/nylas-video-player.entry-60268c07.js +39 -0
  90. package/dist/nylas-video-player.entry-f3c2b073.cjs +1 -0
  91. package/dist/nylas-video-preview.entry-12e05e4d.cjs +1 -0
  92. package/dist/nylas-video-preview.entry-320421b6.js +16 -0
  93. package/dist/{person-icon.entry-f9ca9147.js → person-icon.entry-8533209c.js} +8 -7
  94. package/dist/person-icon.entry-967ad730.cjs +1 -0
  95. package/dist/play-icon.entry-15ee8568.js +16 -0
  96. package/dist/play-icon.entry-7b1fd79d.cjs +1 -0
  97. package/dist/radio-button-group.entry-24cb342f.cjs +1 -0
  98. package/dist/radio-button-group.entry-53dcf16c.js +47 -0
  99. package/dist/react.cjs +1 -1
  100. package/dist/react.js +133 -123
  101. package/dist/refresh-icon.entry-0486ae54.cjs +1 -0
  102. package/dist/{refresh-icon.entry-7886041f.js → refresh-icon.entry-f3320971.js} +7 -6
  103. package/dist/{register-component-677d8d2b-0113766e.js → register-component-504a1cbb-5f986d7f.js} +1 -1
  104. package/dist/{register-component-677d8d2b-4738af1d.cjs → register-component-504a1cbb-89124fd8.cjs} +1 -1
  105. package/dist/{reply-all-icon.entry-fdd0058e.js → reply-all-icon.entry-006fd1fb.js} +6 -5
  106. package/dist/reply-all-icon.entry-2cea1a40.cjs +1 -0
  107. package/dist/reply-icon.entry-bd252aed.cjs +1 -0
  108. package/dist/reply-icon.entry-d27166a1.js +16 -0
  109. package/dist/scheduler-config-store-d6729d8d-4a2defea.cjs +1 -0
  110. package/dist/{scheduler-config-store-ed4a8dfd-012dcf85.js → scheduler-config-store-d6729d8d-63e34849.js} +4 -1
  111. package/dist/scheduler-store-baf100ed-5c5d3aa5.cjs +1 -0
  112. package/dist/scheduler-store-baf100ed-81b183dc.js +533 -0
  113. package/dist/sent-icon.entry-bf101068.js +16 -0
  114. package/dist/sent-icon.entry-ee434395.cjs +1 -0
  115. package/dist/spam-icon.entry-11016b63.cjs +1 -0
  116. package/dist/spam-icon.entry-5193f9c6.js +16 -0
  117. package/dist/star-icon.entry-0e269252.cjs +1 -0
  118. package/dist/{star-icon.entry-501083c1.js → star-icon.entry-9c7449f3.js} +6 -5
  119. package/dist/stop-icon.entry-2ac11166.js +16 -0
  120. package/dist/stop-icon.entry-86412c9f.cjs +1 -0
  121. package/dist/textarea-component.entry-27717409.cjs +1 -0
  122. package/dist/textarea-component.entry-9df3fa96.js +39 -0
  123. package/dist/toggle-switch.entry-9623e2b2.cjs +1 -0
  124. package/dist/toggle-switch.entry-a5ddfad9.js +34 -0
  125. package/dist/translate-icon.entry-e0617680.cjs +1 -0
  126. package/dist/{translate-icon.entry-676a4150.js → translate-icon.entry-f22293e6.js} +5 -4
  127. package/dist/trash-fill-icon.entry-0275f657.cjs +1 -0
  128. package/dist/trash-fill-icon.entry-2616c5df.js +16 -0
  129. package/dist/{underline-icon.entry-3513c5ef.js → underline-icon.entry-1110dcb1.js} +5 -4
  130. package/dist/underline-icon.entry-d54b06ab.cjs +1 -0
  131. package/dist/warning-icon.entry-6d390ab7.cjs +1 -0
  132. package/dist/{warning-icon.entry-6e723597.js → warning-icon.entry-9a6e7913.js} +8 -7
  133. package/package.json +11 -3
  134. package/dist/add-circle-icon.entry-00c87903.js +0 -15
  135. package/dist/add-circle-icon.entry-640d2b46.cjs +0 -1
  136. package/dist/archive-icon.entry-5b209336.cjs +0 -1
  137. package/dist/archive-icon.entry-e8a39eda.js +0 -15
  138. package/dist/arrow-icon.entry-a25b7b7e.cjs +0 -1
  139. package/dist/bold-icon.entry-d837c73d.cjs +0 -1
  140. package/dist/button-component_2.entry-1471422a.cjs +0 -1
  141. package/dist/calendar-agenda-fill-icon_53.entry-094bd4b9.cjs +0 -6
  142. package/dist/calendar-agenda-fill-icon_53.entry-6d7f9c79.js +0 -5757
  143. package/dist/calendar-cancel-icon.entry-42d3d226.cjs +0 -1
  144. package/dist/calendar-check-icon_2.entry-45aacd91.cjs +0 -1
  145. package/dist/calendar-icon.entry-90d67b03.cjs +0 -1
  146. package/dist/checkbox-component_3.entry-231b2254.cjs +0 -1
  147. package/dist/checkbox-component_3.entry-7270533c.js +0 -153
  148. package/dist/chevron-icon_3.entry-3c95cc88.js +0 -147
  149. package/dist/chevron-icon_3.entry-ead3d4c8.cjs +0 -1
  150. package/dist/clock-icon_4.entry-b50cce70.cjs +0 -1
  151. package/dist/close-icon.entry-04008446.cjs +0 -1
  152. package/dist/close-icon.entry-0a4105c9.js +0 -15
  153. package/dist/constants-f6e79ab7-23d7236b.cjs +0 -1
  154. package/dist/copy-icon.entry-312ff230.js +0 -15
  155. package/dist/copy-icon.entry-74f8ebcd.cjs +0 -1
  156. package/dist/core-js-38e53e34.cjs +0 -4
  157. package/dist/core-js-a9d3b6e1.js +0 -3297
  158. package/dist/delete-icon.entry-b61a6706.cjs +0 -1
  159. package/dist/document-refresh-icon.entry-1c985b1e.js +0 -15
  160. package/dist/document-refresh-icon.entry-27ff5cb2.cjs +0 -1
  161. package/dist/dom-68f08be9.cjs +0 -15
  162. package/dist/dom-86e17616.js +0 -664
  163. package/dist/folder-icon.entry-c32a6e15.cjs +0 -1
  164. package/dist/forward-icon.entry-5f9a7639.js +0 -15
  165. package/dist/forward-icon.entry-8cd805dc.cjs +0 -1
  166. package/dist/globe-icon.entry-21a80591.cjs +0 -1
  167. package/dist/globe-icon.entry-397727e1.js +0 -15
  168. package/dist/google-logo-icon_4.entry-42e87368.cjs +0 -1
  169. package/dist/google-logo-icon_4.entry-6ccf8379.js +0 -778
  170. package/dist/inbox-icon.entry-1e448b4b.js +0 -15
  171. package/dist/inbox-icon.entry-50605b1d.cjs +0 -1
  172. package/dist/index-594c8e7b.js +0 -16763
  173. package/dist/index-cfb93df6.cjs +0 -81
  174. package/dist/info-icon_2.entry-65e0023f.js +0 -34
  175. package/dist/info-icon_2.entry-e7b86847.cjs +0 -1
  176. package/dist/input-color-picker.entry-37d2fb66.js +0 -48
  177. package/dist/input-color-picker.entry-aabfe638.cjs +0 -1
  178. package/dist/input-component.entry-51f6da14.cjs +0 -1
  179. package/dist/input-component.entry-c07d92b1.js +0 -70
  180. package/dist/input-dropdown_2.entry-20fb0552.cjs +0 -1
  181. package/dist/input-dropdown_2.entry-90c08f10.js +0 -228
  182. package/dist/italic-icon.entry-8e5599ff.js +0 -15
  183. package/dist/italic-icon.entry-ee10a040.cjs +0 -1
  184. package/dist/multi-select-dropdown.entry-656d2791.cjs +0 -1
  185. package/dist/multi-select-dropdown.entry-c143becc.js +0 -116
  186. package/dist/nylas-booked-event-card_12.entry-4974ffe6.js +0 -1332
  187. package/dist/nylas-booked-event-card_12.entry-669bb872.cjs +0 -1
  188. package/dist/nylas-form-card.entry-42e718e2.js +0 -57
  189. package/dist/nylas-form-card.entry-55d3909c.cjs +0 -1
  190. package/dist/nylas-if-state.entry-4de782b7.cjs +0 -1
  191. package/dist/nylas-login.entry-d6b80abe.cjs +0 -1
  192. package/dist/nylas-provider.entry-d5495e1a.cjs +0 -1
  193. package/dist/nylas-scheduler-editor.entry-bebe4e7d.cjs +0 -2
  194. package/dist/nylas-scheduling.entry-21c04831.cjs +0 -1
  195. package/dist/nylas-scheduling.entry-c335ad21.js +0 -415
  196. package/dist/nylas-time-window-picker_2.entry-9e0dd470.js +0 -336
  197. package/dist/nylas-time-window-picker_2.entry-a2651ee7.cjs +0 -1
  198. package/dist/person-icon.entry-21946944.cjs +0 -1
  199. package/dist/play-icon.entry-b27fcb18.cjs +0 -1
  200. package/dist/play-icon.entry-dbfed5e8.js +0 -15
  201. package/dist/refresh-icon.entry-9d94a60b.cjs +0 -1
  202. package/dist/reply-all-icon.entry-f0e0a5c4.cjs +0 -1
  203. package/dist/reply-icon.entry-0a42fb2c.cjs +0 -1
  204. package/dist/reply-icon.entry-a8d2b0f8.js +0 -15
  205. package/dist/scheduler-config-store-ed4a8dfd-a16d5c62.cjs +0 -1
  206. package/dist/scheduler-store-92eb8804-bc68a43a.js +0 -487
  207. package/dist/scheduler-store-92eb8804-c3deee73.cjs +0 -1
  208. package/dist/sent-icon.entry-c3f84a59.cjs +0 -1
  209. package/dist/sent-icon.entry-e047f087.js +0 -15
  210. package/dist/spam-icon.entry-55d01416.js +0 -15
  211. package/dist/spam-icon.entry-671eb165.cjs +0 -1
  212. package/dist/star-icon.entry-4dcae472.cjs +0 -1
  213. package/dist/stop-icon.entry-130a28b2.js +0 -15
  214. package/dist/stop-icon.entry-ed949255.cjs +0 -1
  215. package/dist/textarea-component.entry-65dd740a.cjs +0 -1
  216. package/dist/textarea-component.entry-efae9031.js +0 -37
  217. package/dist/translate-icon.entry-2591baf8.cjs +0 -1
  218. package/dist/trash-fill-icon.entry-5b373be7.js +0 -15
  219. package/dist/trash-fill-icon.entry-c411d0e0.cjs +0 -1
  220. package/dist/underline-icon.entry-6bf14476.cjs +0 -1
  221. package/dist/warning-icon.entry-719a094d.cjs +0 -1
@@ -0,0 +1,1418 @@
1
+ import { r as w, c as f, d, h as o, i, m as ue, w as ke, H as k, g as T, x as ge, y as ze, l as pe, z as Se, A as Re, C as P, D as $, E as je, G as Fe, I as H, J as Pe, F as Oe } from "./index-04630615.js";
2
+ import { R as B } from "./register-component-504a1cbb-5f986d7f.js";
3
+ import { d as S, T as F, a as me } from "./constants-f5ba52b9-40ab2ded.js";
4
+ import "react";
5
+ import "react/jsx-runtime";
6
+ import "react-dom";
7
+ const $e = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-booked-event-card{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 0;overflow-wrap:anywhere;display:flex;align-items:center;flex-direction:column;font-size:16px;font-weight:400;border-bottom:1px solid var(--nylas-base-200);width:inherit;padding:0 0 1.5rem}.booked-event-header h2{color:var(--nylas-base-600);margin-top:1.5rem;margin-bottom:0.25rem;font-size:1.125rem;font-weight:600}.booked-event-header .card-description{text-align:center}.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:16px;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}.button-container{width:inherit}.footer{padding:0.5rem;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;box-sizing:border-box;background-color:var(--nylas-base-25);border-top:1px solid var(--nylas-base-200);width:100%;border-radius:0 0 var(--nylas-border-radius-2x) var(--nylas-border-radius-2x)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}', Me = $e;
8
+ var Ne = function(e, a, n, l) {
9
+ var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
10
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
11
+ t = Reflect.decorate(e, a, n, l);
12
+ else
13
+ for (var c = e.length - 1; c >= 0; c--)
14
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
15
+ return r > 3 && t && Object.defineProperty(a, n, t), t;
16
+ }, A = function(e, a) {
17
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
18
+ return Reflect.metadata(e, a);
19
+ };
20
+ const ve = class {
21
+ constructor(e) {
22
+ w(this, e), this.cancelBookingButtonClicked = f(this, "cancelBookingButtonClicked", 7), this.rescheduleButtonClicked = f(this, "rescheduleButtonClicked", 7), this.rescheduleBookedEventError = f(this, "rescheduleBookedEventError", 7), this.cancelBookedEventValidationError = f(this, "cancelBookedEventValidationError", 7), this.handleCancelBookingButtonClicked = () => {
23
+ var r, t;
24
+ const a = new Date(this.selectedTimeslot.start_time), n = (t = (r = this.configSettings) == null ? void 0 : r.scheduler) == null ? void 0 : t.min_cancellation_notice;
25
+ a.getTime() - n * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime() ? this.cancelBookedEventValidationError.emit({
26
+ error: {
27
+ title: "Cancellation Error",
28
+ message: `You cannot cancel the booking within ${n} minutes of the event.`
29
+ }
30
+ }) : this.cancelBookingButtonClicked.emit({ bookingId: this.eventInfo.booking_id });
31
+ }, this.handleRescheduleButtonClicked = () => {
32
+ const a = (n) => {
33
+ this.rescheduleBookedEventError.emit(n);
34
+ };
35
+ this.rescheduleButtonClicked.emit({ bookingId: this.eventInfo.booking_id, errorHandler: a });
36
+ }, this.getPaticipantType = (a) => {
37
+ switch (a) {
38
+ case "host":
39
+ return "Host";
40
+ case "you":
41
+ return "You";
42
+ default:
43
+ return "";
44
+ }
45
+ }, this.eventInfo = void 0, this.rescheduleBookingId = void 0, this.bookingInfo = void 0, this.configSettings = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedTimeslot = void 0, this.selectedLanguage = navigator.language, this.hour12 = void 0, this.startTime = "", this.endTime = "";
46
+ }
47
+ themeConfigChanged(e) {
48
+ this.applyThemeConfig(e);
49
+ }
50
+ connectedCallback() {
51
+ }
52
+ disconnectedCallback() {
53
+ }
54
+ async componentWillLoad() {
55
+ d("[nylas-booked-event-card] Component will load");
56
+ }
57
+ async componentDidLoad() {
58
+ var n, l;
59
+ d("[nylas-booked-event-card] Component did load"), this.eventInfo || console.warn('[nylas-booked-event-card] "eventInfo" prop missing. Please provide the event info to display the event details in the booked event card component.'), this.bookingInfo || console.warn('[nylas-booked-event-card] "bookingInfo" prop missing. Please provide the booking info to display the guest details in the booked event card component.'), this.applyThemeConfig(this.themeConfig);
60
+ const e = S[this.selectedLanguage || "en"], a = new Intl.DateTimeFormat(e, {
61
+ hour: "2-digit",
62
+ minute: "2-digit",
63
+ timeZone: this.selectedTimezone,
64
+ hour12: this.hour12
65
+ });
66
+ this.startTime = a.format((n = this.selectedTimeslot) == null ? void 0 : n.start_time), this.endTime = a.format((l = this.selectedTimeslot) == null ? void 0 : l.end_time);
67
+ }
68
+ applyThemeConfig(e) {
69
+ if (e)
70
+ for (const [a, n] of Object.entries(e))
71
+ this.host.style.setProperty(`${a}`, n);
72
+ }
73
+ render() {
74
+ var n, l, r, t, s, c, b, h, u, C, D, L, p, m, E, R;
75
+ const e = (n = this.configSettings) == null ? void 0 : n.booking_type, a = e && e !== "booking";
76
+ return o(k, { key: "7db019b852ab70270adb7dc9e958e6e7381a26b3", part: "nbec" }, o("div", { key: "f309b22194e70799fd0333c899e3ef6dc2cadda2", class: "nylas-booked-event-card" }, o("div", { key: "fda9f6f52eb02449553e3a77f02a9bd9ccc1ffb1", class: "booked-event-timezone" }, o("globe-icon", { key: "86e8540c01d68d6b661f1146bbe24849023ce1bd" }), F[this.selectedTimezone]), o("div", { key: "1038dc03151ab6a2b961d5f4ded96ba7445d1a54", class: "event-card-wrapper", part: "nbec__card" }, o("div", { key: "62143a2984318fb91ac9e8211901dddc99481ca2", class: "calendar-icon" }, o("calendar-check-icon", { key: "8c2b99dcc14a65e556648d11fd36fbabda5c6e60" })), o("div", { key: "ceea5100d690b09d4819486a305d639f483522f6", class: "booked-event-header" }, o("h2", { key: "af360b0c2fd115edd22e6fd4977819c77c83aa64", slot: "card-title", part: "nbec__title" }, this.rescheduleBookingId && !this.isLoading ? `${i.t("bookingRescheduled")}` : a && !this.isLoading ? `${i.t("bookingSent")}` : `${i.t("bookingConfirmed")}`, "!"), o("div", { key: "afad927b2a1e56191d73705c93c6b285305810f8", class: "card-description", part: "nbec__description" }, a ? i.t("bookingSentDescription") : o("span", null, i.t("bookingConfirmedDescription")))), o("div", { key: "3a2fcc44ec16291970f5a043fea3c4e0e76cd961", class: "booking-date-time" }, o("checkmark-circle-icon", { key: "9e09cc4a564378d2a57eb26a20d051ff5783959f" }), o("h3", { key: "43751ff57685368a9ff566e042c8ac874a2b972d" }, i.t("bookingDateAndTimeHeader")), o("p", { key: "aa873b56137af390655ff8c2eed3baaab44b287a" }, (l = this.selectedTimeslot) != null && l.start_time ? ue(ke((r = this.selectedTimeslot) == null ? void 0 : r.start_time, this.selectedTimezone, S[this.selectedLanguage])) : "-", " ", o("br", { key: "b11b0651c07fa3a160511489e623054a0fc6b95a" }), this.startTime, " - ", this.endTime)), o("div", { key: "b1945df2b3816cf9e012903910f913fab002f911", class: "booking-participants" }), !a && o("div", { class: "button-container" }, o("div", { class: {
77
+ footer: !0,
78
+ "no-footer": ((s = (t = this.configSettings) == null ? void 0 : t.scheduler) == null ? void 0 : s.hide_cancellation_options) && ((b = (c = this.configSettings) == null ? void 0 : c.scheduler) == null ? void 0 : b.hide_rescheduling_options) || ((h = this.configSettings) == null ? void 0 : h.booking_type) === "organizer-confirmation",
79
+ "no-template-cols": ((C = (u = this.configSettings) == null ? void 0 : u.scheduler) == null ? void 0 : C.hide_cancellation_options) || ((L = (D = this.configSettings) == null ? void 0 : D.scheduler) == null ? void 0 : L.hide_rescheduling_options)
80
+ } }, !((m = (p = this.configSettings) == null ? void 0 : p.scheduler) != null && m.hide_cancellation_options) && o("button-component", { variant: "destructive", onClick: this.handleCancelBookingButtonClicked, part: "nbec__button-outline nbec__cancel-cta" }, `${i.t("cancelBookingButton")}`), !((R = (E = this.configSettings) == null ? void 0 : E.scheduler) != null && R.hide_rescheduling_options) && o("button-component", { variant: "basic", onClick: this.handleRescheduleButtonClicked, disabled: this.isLoading, part: "nbec__button-outline nbec__reschedule-cta" }, `${i.t("rescheduleBookingButton")}`))))));
81
+ }
82
+ get host() {
83
+ return T(this);
84
+ }
85
+ static get watchers() {
86
+ return {
87
+ themeConfig: ["themeConfigChanged"]
88
+ };
89
+ }
90
+ };
91
+ Ne([
92
+ B({
93
+ name: "nylas-booked-event-card",
94
+ stateToProps: /* @__PURE__ */ new Map([
95
+ ["scheduler.bookingInfo", "bookingInfo"],
96
+ ["scheduler.rescheduleBookingId", "rescheduleBookingId"],
97
+ ["scheduler.selectedTimezone", "selectedTimezone"],
98
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
99
+ ["scheduler.isLoading", "isLoading"],
100
+ ["scheduler.selectedLanguage", "selectedLanguage"],
101
+ ["scheduler.configSettings", "configSettings"],
102
+ ["scheduler.themeConfig", "themeConfig"],
103
+ ["scheduler.hour12", "hour12"]
104
+ ]),
105
+ eventToProps: {
106
+ cancelBookingButtonClicked: async (e, a) => {
107
+ a.scheduler.setCancel(e.detail.bookingId);
108
+ },
109
+ rescheduleButtonClicked: async (e, a) => {
110
+ const n = await a.scheduler.setReschedule(e.detail.bookingId), { errorHandler: l } = e.detail;
111
+ l && (!n || "error" in n) && l(n);
112
+ },
113
+ rescheduleBookedEventError: async (e, a) => {
114
+ d("nylas-booked-event-card", "rescheduleBookedEventError", e.detail);
115
+ },
116
+ cancelBookedEventValidationError: async (e, a) => {
117
+ d("nylas-booked-event-card", "cancelBookedEventValidationError", e.detail);
118
+ }
119
+ },
120
+ fireRegisterEvent: !0
121
+ }),
122
+ A("design:type", Function),
123
+ A("design:paramtypes", []),
124
+ A("design:returntype", void 0)
125
+ ], ve.prototype, "render", null);
126
+ ve.style = Me;
127
+ const He = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-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}.cta{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:0.5rem;align-items:flex-start;justify-content:space-between;gap:0.5rem;padding:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.cta{grid-template-columns:1fr}}.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);font-size:16px}.input-wrapper .help-text{margin:0;color:var(--nylas-error)}.button-wrapper{width:100%;align-items:flex-start;height:max-content;position:relative}.button-content{display:flex;gap:4px;align-items:center}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]:focus,input[type=email]:focus{outline-color:var(--nylas-primary)}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]::placeholder,input[type=email]::placeholder{color:var(--nylas-base-300)}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}button-component.remove-guest{position:absolute;height:51px;right:0}button-component.remove-guest.error button{border-color:var(--nylas-error)}button-component.remove-guest button{height:inherit;border-top-left-radius:initial;border-bottom-left-radius:initial;border:none !important;border-left:1px solid var(--nylas-base-300) !important}button-component.remove-guest button:hover,button-component.remove-guest button:focus{outline:1px solid var(--nylas-primary) !important;color:var(--nylas-primary)}button-component.back button{--dot-color:var(--nylas-base-800)}.guest-email-input{position:relative;display:flex;width:100%}multi-select-dropdown::part(msd_dropdown-label){margin-bottom:4px}multi-select-dropdown::part(msd_dropdown_error){font-size:16px}multi-select-dropdown::part(msd_dropdown-button){height:52px;border-color:var(--nylas-base-300)}multi-select-dropdown::part(msd_dropdown-button--error){border-width:2px;border-color:var(--nylas-error)}', Ae = He;
128
+ var qe = function(e, a, n, l) {
129
+ var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
130
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
131
+ t = Reflect.decorate(e, a, n, l);
132
+ else
133
+ for (var c = e.length - 1; c >= 0; c--)
134
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
135
+ return r > 3 && t && Object.defineProperty(a, n, t), t;
136
+ }, q = function(e, a) {
137
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
138
+ return Reflect.metadata(e, a);
139
+ };
140
+ const O = /^[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])?)*$/, Ce = class {
141
+ constructor(e) {
142
+ w(this, e), this.nameChanged = f(this, "nameChanged", 7), this.emailChanged = f(this, "emailChanged", 7), this.backButtonClicked = f(this, "backButtonClicked", 7), this.detailsConfirmed = f(this, "detailsConfirmed", 7), this.bookingFormError = f(this, "bookingFormError", 7), this.bookingFormSubmitted = f(this, "bookingFormSubmitted", 7), this.handleGuestChange = (a, n) => {
143
+ this.resetGuestEmailError(a);
144
+ const l = [...this.guestEmails];
145
+ l[a] = ge(n), this.guestEmails = [...l];
146
+ }, this.handleGuestBlur = (a, n) => {
147
+ if (this.resetGuestEmailError(a), n === "") {
148
+ this.guestEmailErrors[a] = i.t("fieldRequired", { field: i.t("email") });
149
+ return;
150
+ }
151
+ if (!O.test(n)) {
152
+ this.guestEmailErrors[a] = i.t("invalidInputFormat", { field: i.t("email") });
153
+ return;
154
+ }
155
+ this.handleGuestChange(a, n);
156
+ }, this.addGuestButtonClickedHandler = (a) => {
157
+ a.preventDefault(), this.guestEmails = [...this.guestEmails, ""];
158
+ }, this.removeGuestButtonClickHandler = (a, n) => {
159
+ a.preventDefault(), this.resetGuestEmailError(n);
160
+ const l = [...this.guestEmails];
161
+ l.splice(n, 1), this.guestEmails = [...l];
162
+ }, this.handleBackButtonClicked = (a) => {
163
+ a.preventDefault(), this.backButtonLoading = !0, this.backButtonClicked.emit();
164
+ }, this.bookButtonClickedHandler = async (a) => {
165
+ var h, u, C, D, L;
166
+ if (a.preventDefault(), this.bookingFormSubmitted.emit().defaultPrevented)
167
+ return;
168
+ d("nylas-booking-form", "bookButtonClickedHandler", this.bookingInfo);
169
+ const l = this.name, r = this.email;
170
+ if (!l || l === "") {
171
+ this.isNameValid = !1, this.validationError.name = i.t("fieldRequired", { field: i.t("name") }) || "Name is required", this.bookingFormError.emit({
172
+ title: "Booking form error",
173
+ description: "Name is required"
174
+ });
175
+ return;
176
+ }
177
+ if (!r || r === "") {
178
+ this.isEmailValid = !1, this.validationError.email = i.t("fieldRequired", { field: i.t("email") }) || "Email is required", this.bookingFormError.emit({
179
+ title: "Booking form error",
180
+ description: "Email is required"
181
+ });
182
+ return;
183
+ }
184
+ if (!O.test(r)) {
185
+ this.isEmailValid = !1, this.validationError.email = i.t("invalidInputFormat", { field: i.t("email") }), this.bookingFormError.emit({
186
+ title: "Booking form error",
187
+ description: i.t("invalidInputFormat", { field: i.t("email") }) || "Invalid email"
188
+ });
189
+ return;
190
+ }
191
+ let t = [];
192
+ if (this.guestEmails.length > 0) {
193
+ let p = !1;
194
+ if (this.guestEmails.forEach((m, E) => {
195
+ m === "" ? (p = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [E]: i.t("fieldRequired", { field: i.t("email") }) }) : O.test(m) || (p = !0, this.guestEmailErrors = { ...this.guestEmailErrors, [E]: i.t("invalidInputFormat", { field: i.t("email") }) });
196
+ }), p) {
197
+ this.bookingFormError.emit({
198
+ title: "Booking form error",
199
+ description: i.t("invalidInputFormat", { field: i.t("guestEmail") }) || "Invalid guest email"
200
+ });
201
+ return;
202
+ }
203
+ t = this.guestEmails.map((m) => ({ name: m.trim(), email: m.trim() }));
204
+ }
205
+ const s = {}, c = ((u = (h = this.configSettings) == null ? void 0 : h.scheduler) == null ? void 0 : u.additional_fields) || {}, b = ((D = (C = this.configSettings) == null ? void 0 : C.booking) == null ? void 0 : D.additional_fields) || {};
206
+ (L = this.bookingInfo) != null && L.additionalFields && Object.entries(this.bookingInfo.additionalFields).forEach(([p, m]) => {
207
+ p in c && typeof m.value < "u" && (s[p] = m.value);
208
+ }), Object.entries(c).forEach(([p, m]) => {
209
+ if (!(p in s)) {
210
+ const E = b[p] || m.default || "";
211
+ s[p] = E;
212
+ }
213
+ }), this.detailsConfirmed.emit({
214
+ primaryParticipant: {
215
+ name: l,
216
+ email: r
217
+ },
218
+ guests: t,
219
+ additionalFields: { ...s, ...this.additionalFields }
220
+ });
221
+ }, this.updateAdditionalFields = (a, n) => {
222
+ this.additionalFields && (this.additionalFields[a] = n);
223
+ }, this.isLoading = void 0, this.bookingInfo = void 0, this.eventInfo = void 0, this.configSettings = void 0, this.themeConfig = void 0, this.name = "", this.email = "", this.guestEmails = [], this.guestEmailErrors = {}, this.isNameValid = !0, this.isEmailValid = !0, this.additionalFields = {}, this.validationError = { name: "", email: "" }, this.backButtonLoading = !1, this.firstRender = !0;
224
+ }
225
+ connectedCallback() {
226
+ }
227
+ disconnectedCallback() {
228
+ }
229
+ componentWillLoad() {
230
+ d("nylas-booking-form", "componentWillLoad", this.bookingInfo);
231
+ }
232
+ componentDidLoad() {
233
+ var e;
234
+ d("nylas-booking-form", "componentDidLoad", this.bookingInfo), (e = this.configSettings) != null && e.booking ? this.configSettingsChangedHandler(this.configSettings) : this.bookingInfo && this.bookingInfoChangedHandler(this.bookingInfo), this.applyThemeConfig(this.themeConfig);
235
+ }
236
+ componentDidRender() {
237
+ this.firstRender && this.applyThemeConfig(this.themeConfig);
238
+ }
239
+ bookingInfoChangedHandler(e) {
240
+ e && e.primaryParticipant && (this.name = e.primaryParticipant.name || this.name, this.email = e.primaryParticipant.email || this.email), e != null && e.guests && Array.isArray(e.guests) && (this.guestEmails = e.guests.map((a) => a.email));
241
+ }
242
+ configSettingsChangedHandler(e) {
243
+ var a, n, l, r, t, s, c, b, h, u;
244
+ !((n = (a = this.bookingInfo) == null ? void 0 : a.primaryParticipant) != null && n.name) && e && ((r = (l = e.booking) == null ? void 0 : l.guest) != null && r.name) && (this.name = e.booking.guest.name || this.name), !((s = (t = this.bookingInfo) == null ? void 0 : t.primaryParticipant) != null && s.email) && e && ((b = (c = e.booking) == null ? void 0 : c.guest) != null && b.email) && (this.email = e.booking.guest.email || this.email), !((h = this.bookingInfo) != null && h.guests) && ((u = e == null ? void 0 : e.booking) != null && u.additional_guests) && Array.isArray(e.booking.additional_guests) && (this.guestEmails = e.booking.additional_guests.map((C) => C.email));
245
+ }
246
+ themeConfigChanged(e) {
247
+ this.applyThemeConfig(e);
248
+ }
249
+ iterateFormComponents() {
250
+ const e = this.formRef, a = [
251
+ "input-component",
252
+ "button-component",
253
+ "select-dropdown",
254
+ "checkbox-component",
255
+ "radio-button-group",
256
+ "textarea-component",
257
+ "nylas-date-component",
258
+ "multi-select-dropdown"
259
+ ], n = [];
260
+ if (e) {
261
+ const l = (r) => {
262
+ Array.from(r.children).forEach((t) => {
263
+ const s = t.tagName.toLowerCase();
264
+ a.includes(s) && n.push(t), l(t);
265
+ });
266
+ };
267
+ l(e);
268
+ }
269
+ return n;
270
+ }
271
+ applyThemeConfig(e) {
272
+ if (e)
273
+ for (const [a, n] of Object.entries(e))
274
+ this.host.style.setProperty(`${a}`, n), this.iterateFormComponents().forEach((r) => {
275
+ var t;
276
+ r.style.setProperty(`${a}`, n), (t = r.shadowRoot) == null || t.host.style.setProperty(`${a}`, n);
277
+ });
278
+ }
279
+ changeName(e) {
280
+ this.isNameValid = !0, this.validationError.name = "", this.name = ze(e), this.nameChanged.emit(e);
281
+ }
282
+ changeEmail(e) {
283
+ this.isEmailValid = !0, this.validationError.email = "", this.email = ge(e), this.emailChanged.emit(e);
284
+ }
285
+ resetGuestEmailError(e) {
286
+ const a = { ...this.guestEmailErrors };
287
+ delete a[e], this.guestEmailErrors = { ...a };
288
+ }
289
+ nylasFormInputChangedHandler(e) {
290
+ switch (e.detail.name) {
291
+ case "name":
292
+ this.changeName(e.detail.value);
293
+ break;
294
+ case "email":
295
+ this.changeEmail(e.detail.value);
296
+ break;
297
+ default:
298
+ if (e.detail.error) {
299
+ this.bookingFormError.emit({
300
+ title: "Booking form error",
301
+ description: e.detail.error
302
+ });
303
+ return;
304
+ }
305
+ this.updateAdditionalFields(e.detail.name, e.detail.value);
306
+ break;
307
+ }
308
+ }
309
+ selectOptionChangedHandler(e) {
310
+ if (e.detail.error) {
311
+ this.bookingFormError.emit({
312
+ title: "Booking form error",
313
+ description: e.detail.error
314
+ });
315
+ return;
316
+ }
317
+ this.updateAdditionalFields(e.detail.name, e.detail.value);
318
+ }
319
+ selecedOptionsChangedHandler(e) {
320
+ if (e.detail.error) {
321
+ this.bookingFormError.emit({
322
+ title: "Booking form error",
323
+ description: e.detail.error
324
+ });
325
+ return;
326
+ }
327
+ const a = e.detail.value.toString();
328
+ this.updateAdditionalFields(e.detail.name, a);
329
+ }
330
+ switchToggledHandler(e) {
331
+ this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
332
+ }
333
+ checkboxToggledHandler(e) {
334
+ this.updateAdditionalFields(e.detail.name, e.detail.checked ? "true" : "false");
335
+ }
336
+ radioChangedHandler(e) {
337
+ this.updateAdditionalFields(e.detail.name, e.detail.value);
338
+ }
339
+ dropdownDefaultSelectedHandler(e) {
340
+ this.updateAdditionalFields(e.detail.name, e.detail.value);
341
+ }
342
+ render() {
343
+ var e, a, n, l, r, t, s, c, b, h, u, C, D, L, p, m, E, R, ae;
344
+ return o(k, { key: "d1a22c96134f6b621cd51de89a334cbfd333e60d" }, o("form", { key: "d69adbd943fc3b7a5c7f0cf53dbb9217f7334c32", onSubmit: (_) => this.bookButtonClickedHandler(_), ref: (_) => this.formRef = _, noValidate: !0 }, o("div", { key: "21afe8342d7d3656a425d57b0b63ddc336961ab2", class: "nylas-booking-form", part: "nbf" }, o("div", { key: "c8fb40d0bdfe56db0e88bba9e50ccf1b94ab446a", class: "input-wrapper", part: "nbf__input-wrapper" }, o("input-component", { key: "0d3560610674cff9b3aa8c6bd91ed2ebcaf6036e", label: i.t("name"), name: "name", id: "name", defaultValue: ((a = (e = this.bookingInfo) == null ? void 0 : e.primaryParticipant) == null ? void 0 : a.name) || ((r = (l = (n = this.configSettings) == null ? void 0 : n.booking) == null ? void 0 : l.guest) == null ? void 0 : r.name) || this.name, placeholder: i.t("namePlaceholder"), type: "text", readOnly: ((s = (t = this.bookingInfo) == null ? void 0 : t.primaryParticipant) == null ? void 0 : s.nameReadOnly) || !1, required: !0, requiredError: i.t("fieldRequired", { field: i.t("name") }), patternError: i.t("invalidInputFormat", { field: i.t("name") }), part: "nbf__input-textfield" })), o("div", { key: "2abb2740328b4b999ba4d2b1e7345c592d50d27e", class: "input-wrapper", part: "nbf__input-wrapper" }, o("input-component", { key: "cb5ab32f071f33f7374f9d4488fd4663963040bb", label: i.t("email"), name: "email", id: "email", pattern: O, defaultValue: ((b = (c = this.bookingInfo) == null ? void 0 : c.primaryParticipant) == null ? void 0 : b.email) || ((C = (u = (h = this.configSettings) == null ? void 0 : h.booking) == null ? void 0 : u.guest) == null ? void 0 : C.email) || this.email, placeholder: i.t("emailPlaceholder"), type: "email", readOnly: ((L = (D = this.bookingInfo) == null ? void 0 : D.primaryParticipant) == null ? void 0 : L.emailReadOnly) || !1, required: !0, requiredError: i.t("fieldRequired", { field: i.t("email") }), patternError: i.t("invalidInputFormat", { field: i.t("email") }), part: "nbf__input-textfield" })), ((m = (p = this.configSettings) == null ? void 0 : p.scheduler) == null ? void 0 : m.hide_additional_guests) !== !0 && o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, this.guestEmails.map((_, y) => o("div", { class: "input-wrapper button-wrapper" }, o("label", { class: {
345
+ error: !!this.guestEmailErrors[y]
346
+ } }, i.t("guestEmail")), o("div", { class: "guest-email-input" }, o("input", { type: "email", id: `guest-email-${y}`, maxLength: 100, class: {
347
+ "guest-email": !0,
348
+ error: !!this.guestEmailErrors[y]
349
+ }, placeholder: i.t("guestEmailPlaceholder"), value: _, "data-index": y, part: "nbf__input-textfield", onBlur: (v) => {
350
+ var g;
351
+ return this.handleGuestBlur(y, (g = v.target) == null ? void 0 : g.value);
352
+ }, onInput: (v) => {
353
+ var g;
354
+ return this.handleGuestChange(y, (g = v.target) == null ? void 0 : g.value);
355
+ } }), o("button-component", { variant: "basic", tooltip: "Remove guest", onClick: (v) => this.removeGuestButtonClickHandler(v, y), class: {
356
+ "remove-guest": !0,
357
+ error: !!this.guestEmailErrors[y]
358
+ } }, o("close-icon", null))), o("p", { class: "help-text" }, this.guestEmailErrors[y]))), o("button-component", { class: "add-guest", variant: "invisible", part: "nbf__button-ghost", onClick: (_) => this.addGuestButtonClickedHandler(_) }, o("div", { class: "button-content" }, o("add-circle-icon", { slot: "icon" }), this.guestEmails.length > 0 ? `${i.t("addAnotherGuest")}` : `${i.t("addGuest")}`))), (ae = Object.entries(((R = (E = this.configSettings) == null ? void 0 : E.scheduler) == null ? void 0 : R.additional_fields) || {})) == null ? void 0 : ae.sort((_, y) => _[1].order - y[1].order).map((_) => {
359
+ var ne, oe, te, le, re, se, ie, ce, de, fe, ye, be, he;
360
+ const y = _[1], v = y.label, g = _[0], x = ((te = (oe = (ne = this.bookingInfo) == null ? void 0 : ne.additionalFields) == null ? void 0 : oe[g]) == null ? void 0 : te.value) || ((se = (re = (le = this.configSettings) == null ? void 0 : le.booking) == null ? void 0 : re.additional_fields) == null ? void 0 : se[g]) || y.default || "", I = ((de = (ce = (ie = this.bookingInfo) == null ? void 0 : ie.additionalFields) == null ? void 0 : ce[g]) == null ? void 0 : de.readOnly) || !1;
361
+ switch (y.type) {
362
+ case "dropdown":
363
+ return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("select-dropdown", { label: v, name: g, id: g, readOnly: I, withSearch: !1, emptyValue: i.t("nylasBookingCalendarPicker.selectOptionLabel"), defaultSelectedOption: x ? { value: x, label: x } : void 0, options: [
364
+ { value: "", label: i.t("nylasBookingCalendarPicker.selectOptionLabel") },
365
+ ...((fe = y.options) == null ? void 0 : fe.map((z) => ({ value: z, label: z }))) || []
366
+ ], required: y.required, exportparts: "sd_dropdown: nbf__dropdown, sd_dropdown-button: nbf__dropdown-button, sd_dropdown-content: nbf__dropdown-content" }));
367
+ case "checkbox":
368
+ return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("checkbox-component", { readOnly: I, label: v, name: g, id: g, checked: x === "true", required: y.required, part: "nbf__checkbox-component" }));
369
+ case "radio_button":
370
+ return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("radio-button-group", { label: v, name: g, id: g, readOnly: I, defaultSelectedValue: x || ((ye = y.options) == null ? void 0 : ye[0]) || "", options: (be = y.options) == null ? void 0 : be.map((z) => ({ value: z, label: z })), required: y.required, part: "nbf__radio-button-group" }));
371
+ case "multi_line_text":
372
+ return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("textarea-component", { readOnly: I, label: v, defaultValue: x, name: g, id: g, required: y.required, part: "nbf__textarea-component" }));
373
+ case "date":
374
+ return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("nylas-date-component", { readOnly: I, label: v, defaultValue: x, name: g, id: g, required: y.required, part: "nbf__date-component" }));
375
+ case "multi_select": {
376
+ const z = (x == null ? void 0 : x.split(",").map((j) => j.trim())) || [];
377
+ return o("div", null, o("multi-select-dropdown", { label: v, name: g, id: g, readOnly: I, options: (he = y.options) == null ? void 0 : he.map((j) => ({ value: j, label: j, selected: z.includes(j) })), required: y.required, exportparts: "msd_dropdown: nbf__ms_dropdown, msd_dropdown-label: nbf__ms_dropdown-label, msd_dropdown-button: nbf__ms_dropdown-button, msd_dropdown-content: nbf__ms_dropdown-content, msd_dropdown_error: nbf__ms_dropdown_error, msd_dropdown-button--error: nbf__ms_dropdown-button--error" }));
378
+ }
379
+ case "metadata":
380
+ return null;
381
+ default:
382
+ return o("div", { class: "input-wrapper", part: "nbf__input-wrapper" }, o("input-component", { label: v, name: g, id: g, type: y.type, readOnly: I, defaultValue: x || "", requiredError: i.t("fieldRequired", { field: v }), required: y.required, part: "nbf__input-textfield" }));
383
+ }
384
+ })), o("div", { key: "1bc3a6c8cf879b03e39e58e9db2371d675a4e27a", class: "cta" }, o("button-component", { key: "5b38a653d10dc75faea9eaa2384985acd50f420a", variant: "basic", class: "back", part: "nbf__button-outline", isLoading: this.backButtonLoading && this.isLoading, onClick: this.handleBackButtonClicked }, o("slot", { key: "b69945ab562eca8770f3bbc39558a1b9bffdd168", name: "booking-form-back-label" }, `${i.t("backButton")}`)), o("button-component", { key: "97761d73e97c6d39fe7671f649c7f114c912efd3", variant: "primary", isLoading: !this.backButtonLoading && this.isLoading, disabled: this.isLoading, part: "nbf__button-primary", type: "submit" }, o("slot", { key: "5c0f6a7eb055463f288d8644073a00ddfbbbbc26", name: "booking-form-book-label" }, `${i.t("bookNowButton")}`)))));
385
+ }
386
+ get host() {
387
+ return T(this);
388
+ }
389
+ static get watchers() {
390
+ return {
391
+ bookingInfo: ["bookingInfoChangedHandler"],
392
+ configSettings: ["configSettingsChangedHandler"],
393
+ themeConfig: ["themeConfigChanged"]
394
+ };
395
+ }
396
+ };
397
+ qe([
398
+ B({
399
+ name: "nylas-booking-form",
400
+ stateToProps: /* @__PURE__ */ new Map([
401
+ ["scheduler.isLoading", "isLoading"],
402
+ ["scheduler.bookingInfo", "bookingInfo"],
403
+ ["scheduler.eventInfo", "eventInfo"],
404
+ ["scheduler.configSettings", "configSettings"],
405
+ ["scheduler.themeConfig", "themeConfig"]
406
+ ]),
407
+ eventToProps: {
408
+ backButtonClicked: async (e, a) => {
409
+ a.scheduler.toggleAdditionalData(!1);
410
+ },
411
+ nameChanged: async (e, a) => {
412
+ a.scheduler.setParticipantName(e.detail);
413
+ },
414
+ emailChanged: async (e, a) => {
415
+ a.scheduler.setParticipantEmail(e.detail);
416
+ },
417
+ detailsConfirmed: async (e, a) => {
418
+ d("nylas-booking-form", "detailsConfirmed", e.detail);
419
+ },
420
+ bookingFormSubmitted: async (e, a) => {
421
+ d("nylas-booking-form", "bookingFormSubmitted", e.detail);
422
+ },
423
+ bookingFormError: async (e, a) => {
424
+ d("nylas-booking-form", "bookingFormError", e.detail);
425
+ }
426
+ },
427
+ fireRegisterEvent: !0
428
+ }),
429
+ q("design:type", Function),
430
+ q("design:paramtypes", []),
431
+ q("design:returntype", void 0)
432
+ ], Ce.prototype, "render", null);
433
+ Ce.style = Ae;
434
+ const Ze = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;display:block;width:400px;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 form{width:100%}.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:16px;font-style:normal;font-weight:400;line-height:140%;color:var(--nylas-base-600);padding-bottom:1.25rem}.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%}.footer{display:grid;grid-template-columns:1fr 1fr;width:100%;padding-top:1.25rem;gap:1rem;border-top:1px solid var(--nylas-base-200);margin-top:1.25rem}', Ge = Ze;
435
+ var We = function(e, a, n, l) {
436
+ var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
437
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
438
+ t = Reflect.decorate(e, a, n, l);
439
+ else
440
+ for (var c = e.length - 1; c >= 0; c--)
441
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
442
+ return r > 3 && t && Object.defineProperty(a, n, t), t;
443
+ }, Z = function(e, a) {
444
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
445
+ return Reflect.metadata(e, a);
446
+ };
447
+ const _e = class {
448
+ constructor(e) {
449
+ var a, n;
450
+ w(this, e), this.goBackButtonClicked = f(this, "goBackButtonClicked", 7), this.cancelBookingFormSubmitted = f(this, "cancelBookingFormSubmitted", 7), this.triggerValidation = f(this, "triggerValidation", 7), this.cancelBookedEventError = f(this, "cancelBookedEventError", 7), this.cancelBookingFormError = f(this, "cancelBookingFormError", 7), this.handleGoBackClicked = () => {
451
+ this.goBackButtonClicked.emit();
452
+ }, this.handleSubmitCancelBooking = (l) => {
453
+ var s, c, b;
454
+ if (this.triggerValidation.emit({}), l.preventDefault(), !this.cancellationReason) {
455
+ this.cancellationError = i.t("cancellationErrorMessage"), this.cancelBookingFormError.emit({ title: i.t("cancelBokingFormError"), description: i.t("cancellationErrorMessage") });
456
+ return;
457
+ }
458
+ const r = (c = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : c.min_cancellation_notice;
459
+ if (this.selectedTimeslot && r && new Date((b = this.selectedTimeslot) == null ? void 0 : b.start_time).getTime() - r * 60 * 1e3 < (/* @__PURE__ */ new Date()).getTime()) {
460
+ this.cancelBookedEventError.emit({
461
+ error: {
462
+ title: i.t("cancellationErrorTitle"),
463
+ message: i.t("minimumCancellationNoticeErrorMessage", { minCancellationNotice: r })
464
+ }
465
+ });
466
+ return;
467
+ }
468
+ d(`[nylas-cancel-booking-form] Cancel booking form submitted with reason: ${this.cancellationReason}`);
469
+ const t = (h) => {
470
+ this.cancelBookedEventError.emit(h);
471
+ };
472
+ this.cancelBookingId ? this.cancelBookingFormSubmitted.emit({ bookingId: this.cancelBookingId, action: "cancel", reason: this.cancellationReason, errorHandler: t }) : this.rejectBookingId && this.cancelBookingFormSubmitted.emit({ bookingId: this.rejectBookingId, action: "reject", reason: this.cancellationReason, errorHandler: t });
473
+ }, this.cancelBookingId = void 0, this.rejectBookingId = void 0, this.selectedTimeslot = void 0, this.configSettings = void 0, this.eventInfo = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.cancellationReason = "", this.cancellationError = "", this.cancellationPolicy = ((n = (a = this.configSettings) == null ? void 0 : a.scheduler) == null ? void 0 : n.cancellation_policy) || "Your current timeslot will become available to others.";
474
+ }
475
+ configSettingsChangedHandler(e) {
476
+ var a;
477
+ this.cancellationPolicy = ((a = e == null ? void 0 : e.scheduler) == null ? void 0 : a.cancellation_policy) || "Your current timeslot will become available to others.";
478
+ }
479
+ themeConfigChanged(e) {
480
+ this.applyThemeConfig(e);
481
+ }
482
+ connectedCallback() {
483
+ d("[nylas-cancel-booking-form] Component connected");
484
+ }
485
+ async componentWillLoad() {
486
+ d("[nylas-cancel-booking-form] Component will load");
487
+ }
488
+ async componentDidLoad() {
489
+ d("[nylas-cancel-booking-form] Component did load"), this.cancelBookingId || console.warn('[nylas-cancel-booking-form] No booking ID provided, "cancelBookingId" prop is required.'), this.applyThemeConfig(this.themeConfig);
490
+ }
491
+ disconnectedCallback() {
492
+ d("[nylas-cancel-booking-form] Component disconnected");
493
+ }
494
+ applyThemeConfig(e) {
495
+ var a;
496
+ if (e)
497
+ for (const [n, l] of Object.entries(e))
498
+ this.host.style.setProperty(`${n}`, l), (a = this.textareaRef) == null || a.style.setProperty(`${n}`, l);
499
+ }
500
+ handleNylasFormInputChanged(e) {
501
+ this.triggerValidation.emit({}), e.detail.name === "cancel-reason" && (this.cancellationReason = e.detail.value, this.cancellationError = e.detail.error);
502
+ }
503
+ render() {
504
+ var e, a;
505
+ return o(k, { key: "733c136e4a80782ac18c8d52e053d26cdcceaa67", part: "ncbf" }, o("div", { key: "108279e83820f644da85d6c89edf09b9bcea3700", class: "nylas-cancel-booking-form", part: "ncbf__card" }, o("div", { key: "ffc95389f08a71b9892eaf27505700ff03331bc9", class: "nylas-cancel-booking-form__calendar-icon", part: "ncbf__icon" }, o("calendar-cancel-icon", { key: "5993111a1f702bc24d15d10e3b1fb40017820e4a" })), o("h3", { key: "24ce0017beeb98abebef2276d2d1b8642cc31a7a", class: "nylas-cancel-booking-form__title", part: "ncbf__title" }, i.t("cancelBookingTitle")), o("div", { key: "8708735caa18b7f16da87d8403dba66f9cccf80f", class: "nylas-cancel-booking-form__description", part: "ncbf__description" }, (a = (e = this.configSettings) == null ? void 0 : e.scheduler) != null && a.cancellation_policy ? this.cancellationPolicy : `${i.t("cancelBookingMessage")}`), o("form", { key: "917b25ea4259080e48d1bca6f889d9749cab8684", onSubmit: this.handleSubmitCancelBooking }, o("textarea-component", { key: "b0242c5184c55413249cc9b3fc834c145725aa58", id: "cancel-reason", name: "cancel-reason", ref: (n) => this.textareaRef = n, required: !0, label: i.t("reasonForCancellation"), class: this.cancellationError ? "error" : "", part: "ncbf__reason-textarea", defaultValue: this.cancellationReason }), o("div", { key: "dbfd4caad12ab130460efaf266a5c8ae52da0f83", class: "footer" }, o("button-component", { key: "6ddab785c067eaa9eed443a14aaf42240a01f4c3", variant: "destructive", class: "cancel", type: "submit", part: "ncbf__button-cta", disabled: this.isLoading }, i.t("cancelBookingButton")), !!this.eventInfo && o("button-component", { variant: "basic", class: "back", part: "ncbf__button-outline", onClick: this.handleGoBackClicked }, i.t("goBackButton"))))));
506
+ }
507
+ get host() {
508
+ return T(this);
509
+ }
510
+ static get watchers() {
511
+ return {
512
+ configSettings: ["configSettingsChangedHandler"],
513
+ themeConfig: ["themeConfigChanged"]
514
+ };
515
+ }
516
+ };
517
+ We([
518
+ B({
519
+ name: "nylas-cancel-booking-form",
520
+ stateToProps: /* @__PURE__ */ new Map([
521
+ ["scheduler.configSettings", "configSettings"],
522
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
523
+ ["scheduler.eventInfo", "eventInfo"],
524
+ ["scheduler.isLoading", "isLoading"],
525
+ ["scheduler.cancelBookingId", "cancelBookingId"],
526
+ ["scheduler.rejectBookingId", "rejectBookingId"],
527
+ ["scheduler.themeConfig", "themeConfig"]
528
+ ]),
529
+ eventToProps: {
530
+ cancelBookingFormSubmitted: async (e, a) => {
531
+ const { action: n, errorHandler: l } = e.detail;
532
+ if (n === "cancel") {
533
+ const r = await a.scheduler.cancelBooking(e.detail.bookingId, e.detail.reason);
534
+ l && (!r || "error" in r) && l(r);
535
+ } else if (n === "reject") {
536
+ const r = await a.scheduler.updateBooking({
537
+ bookingId: e.detail.bookingId,
538
+ status: "cancelled",
539
+ reason: e.detail.reason
540
+ });
541
+ l && (!r || "error" in r) && l(r);
542
+ }
543
+ },
544
+ goBackButtonClicked: async (e, a) => {
545
+ d("nylas-cancel-booking-form", "goBackButtonClicked", e.detail), a.scheduler.goBack();
546
+ },
547
+ cancelBookedEventError: async (e, a) => {
548
+ d("nylas-cancel-booking-form", "cancelBookedEventError", e.detail);
549
+ },
550
+ cancelBookingFormError: async (e, a) => {
551
+ d("nylas-cancel-booking-form", "cancelBookingFormError", e.detail);
552
+ }
553
+ },
554
+ fireRegisterEvent: !0
555
+ }),
556
+ Z("design:type", Function),
557
+ Z("design:paramtypes", []),
558
+ Z("design:returntype", void 0)
559
+ ], _e.prototype, "render", null);
560
+ _e.style = Ge;
561
+ const Ue = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-cancelled-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);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%}button-component{width:100%}', Xe = Ue;
562
+ var Ye = function(e, a, n, l) {
563
+ var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
564
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
565
+ t = Reflect.decorate(e, a, n, l);
566
+ else
567
+ for (var c = e.length - 1; c >= 0; c--)
568
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
569
+ return r > 3 && t && Object.defineProperty(a, n, t), t;
570
+ }, G = function(e, a) {
571
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
572
+ return Reflect.metadata(e, a);
573
+ };
574
+ const we = class {
575
+ constructor(e) {
576
+ w(this, e), this.closeCancelEventCardClicked = f(this, "closeCancelEventCardClicked", 7), this.cancelledEventCardError = f(this, "cancelledEventCardError", 7), this.handleCloseClicked = () => {
577
+ this.isClosing = !0;
578
+ const a = (n) => {
579
+ this.cancelledEventCardError.emit(n), this.isClosing = !1;
580
+ };
581
+ this.closeCancelEventCardClicked.emit({ errorHandler: a });
582
+ }, this.configSettings = void 0, this.themeConfig = void 0, this.cancelledEventInfo = void 0, this.isClosing = !1;
583
+ }
584
+ themeConfigChanged(e) {
585
+ this.applyThemeConfig(e);
586
+ }
587
+ connectedCallback() {
588
+ d("[nylas-cancelled-event-card] Component connected");
589
+ }
590
+ async componentWillLoad() {
591
+ d("[nylas-cancelled-event-card] Component will load");
592
+ }
593
+ async componentDidLoad() {
594
+ d("[nylas-cancelled-event-card] Component did load"), this.cancelledEventInfo || console.warn('[nylas-cancelled-event-card] No cancelled event info provided, "cancelledEventInfo" prop is required.'), this.applyThemeConfig(this.themeConfig);
595
+ }
596
+ disconnectedCallback() {
597
+ d("[nylas-cancelled-event-card] Component disconnected");
598
+ }
599
+ applyThemeConfig(e) {
600
+ if (e)
601
+ for (const [a, n] of Object.entries(e))
602
+ this.host.style.setProperty(`${a}`, n);
603
+ }
604
+ render() {
605
+ var e, a;
606
+ return o(k, { key: "d835492ddff51ad8cad3fa73b5dc88a82f6cfdd9", part: "ncec" }, o("div", { key: "b1cd60f3aad0acaa5c75e1e3fd83dd227fe20dfc", class: "nylas-cancelled-event-card", part: "ncec__card" }, o("div", { key: "3b9bc0d52e4b34421f76f8daec0ba64704d0c783", class: "nylas-cancelled-event-card__calendar-icon", part: "ncec__icon" }, o("calendar-cancel-icon", { key: "abffc9703f1b417f7da3ed106cf88e917988ff89" })), o("h3", { key: "21d104aa9c67cd040b86fa01d5666e69f9335178", class: "nylas-cancelled-event-card__title", part: "ncec__title" }, i.t("bookingCancelledTitle"), "!"), o("div", { key: "532eb9d62db4ae34c64b3d64c7a003b6842865be", class: "nylas-cancelled-event-card__description", part: "ncec__description" }, i.t("bookingCancelledMessage"), " ", ((a = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : a.name) || "the participants", "."), o("div", { key: "b34aa321c0b1e485153a2dfa2ae38cca504be0b7", class: "nylas-cancelled-event-card__cta" }, o("button-component", { key: "519aa668e2397f1a32637590797aa9052e24a5ff", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${i.t("closingButton")}...` : `${i.t("closeButton")}`))));
607
+ }
608
+ get host() {
609
+ return T(this);
610
+ }
611
+ static get watchers() {
612
+ return {
613
+ themeConfig: ["themeConfigChanged"]
614
+ };
615
+ }
616
+ };
617
+ Ye([
618
+ B({
619
+ name: "nylas-cancelled-event-card",
620
+ stateToProps: /* @__PURE__ */ new Map([
621
+ ["scheduler.configSettings", "configSettings"],
622
+ ["scheduler.themeConfig", "themeConfig"],
623
+ ["scheduler.themeConfig", "themeConfig"]
624
+ ]),
625
+ eventToProps: {
626
+ closeCancelEventCardClicked: async (e, a) => {
627
+ const n = await a.scheduler.resetCancel(), { errorHandler: l } = e.detail;
628
+ l && (!n || "error" in n) && l(n);
629
+ },
630
+ cancelledEventCardError: async (e, a) => {
631
+ d("nylas-cancelled-event-card", "cancelledEventCardError", e.detail);
632
+ }
633
+ },
634
+ fireRegisterEvent: !0
635
+ }),
636
+ G("design:type", Function),
637
+ G("design:paramtypes", []),
638
+ G("design:returntype", void 0)
639
+ ], we.prototype, "render", null);
640
+ we.style = Xe;
641
+ const Je = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-confirmed-event-card{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);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-confirmed-event-card{width:inherit}}.nylas-confirmed-event-card__title{font-size:18px;font-weight:600;line-height:24px;color:var(--nylas-base-900);text-align:center}.nylas-confirmed-event-description{font-size:16px;font-weight:500;color:var(--nylas-base-600)}.nylas-confirmed-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-confirmed-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%}button-component{width:100%}', Ke = Je;
642
+ var Qe = function(e, a, n, l) {
643
+ var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
644
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
645
+ t = Reflect.decorate(e, a, n, l);
646
+ else
647
+ for (var c = e.length - 1; c >= 0; c--)
648
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
649
+ return r > 3 && t && Object.defineProperty(a, n, t), t;
650
+ }, W = function(e, a) {
651
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
652
+ return Reflect.metadata(e, a);
653
+ };
654
+ const xe = class {
655
+ constructor(e) {
656
+ w(this, e), this.closeConfirmEventCardClicked = f(this, "closeConfirmEventCardClicked", 7), this.confirmedEventCardError = f(this, "confirmedEventCardError", 7), this.handleCloseClicked = () => {
657
+ this.isClosing = !0;
658
+ const a = (n) => {
659
+ this.confirmedEventCardError.emit(n), this.isClosing = !1;
660
+ };
661
+ this.closeConfirmEventCardClicked.emit({ errorHandler: a });
662
+ }, this.configSettings = void 0, this.themeConfig = void 0, this.confirmedEventInfo = void 0, this.isClosing = !1;
663
+ }
664
+ themeConfigChanged(e) {
665
+ this.applyThemeConfig(e);
666
+ }
667
+ connectedCallback() {
668
+ d("[nylas-confirmed-event-card] Component connected");
669
+ }
670
+ async componentWillLoad() {
671
+ d("[nylas-confirmed-event-card] Component will load");
672
+ }
673
+ async componentDidLoad() {
674
+ d("[nylas-confirmed-event-card] Component did load"), this.confirmedEventInfo || console.warn('[nylas-confirmed-event-card] No confirmed event info provided, "confirmedEventInfo" prop is required.'), this.applyThemeConfig(this.themeConfig);
675
+ }
676
+ disconnectedCallback() {
677
+ d("[nylas-confirmed-event-card] Component disconnected");
678
+ }
679
+ applyThemeConfig(e) {
680
+ if (e)
681
+ for (const [a, n] of Object.entries(e))
682
+ this.host.style.setProperty(`${a}`, n);
683
+ }
684
+ render() {
685
+ var e, a;
686
+ return o(k, { key: "7d9b6138eeb5bf8f3e2d9552a609e0e92f4218c9", part: "ncec" }, o("div", { key: "3f310f8e06ce5b069ef9021890e4588adcd856e6", class: "nylas-confirmed-event-card", part: "ncec__card" }, o("div", { key: "0ab27b860a9160d6d6cf8b0e1ff0ba7a866c8102", class: "nylas-confirmed-event-card__calendar-icon", part: "ncec__icon" }, o("calendar-cancel-icon", { key: "f0b93912e1787c2f2d882590e8cae9a05a4ee577" })), o("h3", { key: "33f170e8c6a9db989b7f0b05702743c024bec621", class: "nylas-confirmed-event-card__title", part: "ncec__title" }, i.t("confirmedEventCardTitle"), "!"), o("div", { key: "7c4d191a266c9a2f748707ae1bd176c217a676e9", class: "nylas-confirmed-event-card__description", part: "ncec__description" }, i.t("confirmedEventCardDescription"), " ", ((a = (e = this.configSettings) == null ? void 0 : e.organizer) == null ? void 0 : a.name) || "the participants", "."), o("div", { key: "fb313a8a7cc9b7eb901e10f3cbc12e5b2faba00d", class: "nylas-confirmed-event-card__cta" }, o("button-component", { key: "c31d8980fdc428bc0c2950397eda010572c0e72f", variant: "basic", disabled: this.isClosing, part: "ncec__button-outline", onClick: this.handleCloseClicked }, this.isClosing ? `${i.t("closingButton")}...` : `${i.t("closeButton")}`))));
687
+ }
688
+ get host() {
689
+ return T(this);
690
+ }
691
+ static get watchers() {
692
+ return {
693
+ themeConfig: ["themeConfigChanged"]
694
+ };
695
+ }
696
+ };
697
+ Qe([
698
+ B({
699
+ name: "nylas-confirmed-event-card",
700
+ stateToProps: /* @__PURE__ */ new Map([
701
+ ["scheduler.configSettings", "configSettings"],
702
+ ["scheduler.themeConfig", "themeConfig"]
703
+ ]),
704
+ eventToProps: {
705
+ closeConfirmEventCardClicked: async (e, a) => {
706
+ const n = await a.scheduler.resetConfirm(), { errorHandler: l } = e.detail;
707
+ l && (!n || "error" in n) && l(n);
708
+ }
709
+ },
710
+ fireRegisterEvent: !0
711
+ }),
712
+ W("design:type", Function),
713
+ W("design:paramtypes", []),
714
+ W("design:returntype", void 0)
715
+ ], xe.prototype, "render", null);
716
+ xe.style = Ke;
717
+ const U = /* @__PURE__ */ new Date(), X = /* @__PURE__ */ new Date();
718
+ function N(e, a, n, l) {
719
+ function r(t) {
720
+ return e(t = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+t)), t;
721
+ }
722
+ return r.floor = (t) => (e(t = /* @__PURE__ */ new Date(+t)), t), r.ceil = (t) => (e(t = new Date(t - 1)), a(t, 1), e(t), t), r.round = (t) => {
723
+ const s = r(t), c = r.ceil(t);
724
+ return t - s < c - t ? s : c;
725
+ }, r.offset = (t, s) => (a(t = /* @__PURE__ */ new Date(+t), s == null ? 1 : Math.floor(s)), t), r.range = (t, s, c) => {
726
+ const b = [];
727
+ if (t = r.ceil(t), c = c == null ? 1 : Math.floor(c), !(t < s) || !(c > 0))
728
+ return b;
729
+ let h;
730
+ do
731
+ b.push(h = /* @__PURE__ */ new Date(+t)), a(t, c), e(t);
732
+ while (h < t && t < s);
733
+ return b;
734
+ }, r.filter = (t) => N((s) => {
735
+ if (s >= s)
736
+ for (; e(s), !t(s); )
737
+ s.setTime(s - 1);
738
+ }, (s, c) => {
739
+ if (s >= s)
740
+ if (c < 0)
741
+ for (; ++c <= 0; )
742
+ for (; a(s, -1), !t(s); )
743
+ ;
744
+ else
745
+ for (; --c >= 0; )
746
+ for (; a(s, 1), !t(s); )
747
+ ;
748
+ }), n && (r.count = (t, s) => (U.setTime(+t), X.setTime(+s), e(U), e(X), Math.floor(n(U, X))), r.every = (t) => (t = Math.floor(t), !isFinite(t) || !(t > 0) ? null : t > 1 ? r.filter(l ? (s) => l(s) % t === 0 : (s) => r.count(0, s) % t === 0) : r)), r;
749
+ }
750
+ const Ve = 1e3, Te = Ve * 60, ea = Te * 60, M = ea * 24, Y = N(
751
+ (e) => e.setHours(0, 0, 0, 0),
752
+ (e, a) => e.setDate(e.getDate() + a),
753
+ (e, a) => (a - e - (a.getTimezoneOffset() - e.getTimezoneOffset()) * Te) / M,
754
+ (e) => e.getDate() - 1
755
+ );
756
+ N((e) => {
757
+ e.setUTCHours(0, 0, 0, 0);
758
+ }, (e, a) => {
759
+ e.setUTCDate(e.getUTCDate() + a);
760
+ }, (e, a) => (a - e) / M, (e) => e.getUTCDate() - 1);
761
+ N((e) => {
762
+ e.setUTCHours(0, 0, 0, 0);
763
+ }, (e, a) => {
764
+ e.setUTCDate(e.getUTCDate() + a);
765
+ }, (e, a) => (a - e) / M, (e) => Math.floor(e / M));
766
+ const aa = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}@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}.title{margin:0 -1.25rem;display:flex;flex-direction:column;padding:0 1.5rem;gap:0.5rem;border-bottom:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family);color:var(--nylas-base-800)}.title h1{max-width:376px;margin-bottom:0;font-size:18px;line-height:20px;font-weight:600;display:flex;gap:0.5rem;align-items:center}.title p{margin-top:0;font-size:16px;display:flex;gap:0.5rem;align-items:center}@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:24px}.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: 768px){.dates .date{width:-webkit-fill-available;width:-moz-available;width:fill-available}}@media screen and (max-width: 412px){.dates .date{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)}', na = aa;
767
+ var oa = function(e, a, n, l) {
768
+ var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
769
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
770
+ t = Reflect.decorate(e, a, n, l);
771
+ else
772
+ for (var c = e.length - 1; c >= 0; c--)
773
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
774
+ return r > 3 && t && Object.defineProperty(a, n, t), t;
775
+ }, J = function(e, a) {
776
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
777
+ return Reflect.metadata(e, a);
778
+ };
779
+ const Ee = class {
780
+ constructor(e) {
781
+ w(this, e), this.dateSelected = f(this, "dateSelected", 7), this.monthChanged = f(this, "monthChanged", 7), this.selectableDates = void 0, this.configSettings = void 0, this.themeConfig = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedDate = void 0, this.selectedLanguage = void 0, this.isLoading = void 0, this.eventDuration = void 0, this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates(), this.disableNextMonthButton = !1;
782
+ }
783
+ configSettingsChanged(e) {
784
+ var r;
785
+ const a = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), n = (r = e == null ? void 0 : e.scheduler) == null ? void 0 : r.available_days_in_future;
786
+ if (n === void 0)
787
+ return;
788
+ pe(/* @__PURE__ */ new Date(), n).getTime() < a.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1;
789
+ }
790
+ selectedLanguageChanged(e) {
791
+ i.changeLanguage(e);
792
+ }
793
+ themeConfigChanged(e) {
794
+ this.applyThemeConfig(e);
795
+ }
796
+ selectedDateChanged(e) {
797
+ this.month = e || /* @__PURE__ */ new Date(), this.dates = this.getDates();
798
+ }
799
+ connectedCallback() {
800
+ }
801
+ disconnectedCallback() {
802
+ }
803
+ componentWillLoad() {
804
+ }
805
+ componentDidLoad() {
806
+ d("[nylas-date-picker] Component did load"), this.applyThemeConfig(this.themeConfig), this.month = this.selectedDate || /* @__PURE__ */ new Date(), this.dates = this.getDates();
807
+ }
808
+ applyThemeConfig(e) {
809
+ if (e)
810
+ for (const [a, n] of Object.entries(e))
811
+ this.host.style.setProperty(`${a}`, n);
812
+ }
813
+ getDates() {
814
+ const e = Se(this.month), a = Re(this.month);
815
+ return Y.range(Y.offset(a, -a.getDay()), Y.offset(e, 7 - e.getDay()));
816
+ }
817
+ selectDate(e) {
818
+ this.dateSelected.emit(e);
819
+ }
820
+ changeMonth(e) {
821
+ var r, t;
822
+ this.month = new Date(this.month.getFullYear(), this.month.getMonth() + e, 1);
823
+ const a = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1), n = (t = (r = this.configSettings) == null ? void 0 : r.scheduler) == null ? void 0 : t.available_days_in_future;
824
+ pe(/* @__PURE__ */ new Date(), n).getTime() < a.getTime() ? this.disableNextMonthButton = !0 : this.disableNextMonthButton = !1, this.dates = this.getDates(), this.monthChanged.emit(this.month);
825
+ }
826
+ isSelected(e, a, n) {
827
+ return e && a && P(e, a) && n && (n == null ? void 0 : n.length) > 0;
828
+ }
829
+ isDisabled(e, a) {
830
+ return e && (a == null ? void 0 : a.find((n) => $(n, e, this.selectedTimezone))) === void 0;
831
+ }
832
+ render() {
833
+ var e, a, n, l, r, t;
834
+ return o(k, { key: "37e0b4d3910695936d1cb3e80757bc0757c2b101", part: "ndp" }, o("div", { key: "3e16a5cf66119fb5ffbf9f2b488d5181437a04cb", class: "nylas-date-picker" }, o("div", { key: "5a92a40f21e68774cdea39d328ae9fb0aa8538f5", class: "title", part: "ndp__title" }, (e = this.configSettings) != null && e.name ? o("h1", null, (a = this.configSettings) == null ? void 0 : a.name) : ((l = (n = this.configSettings) == null ? void 0 : n.organizer) == null ? void 0 : l.name) && o("h1", null, o("person-icon", null), ((t = (r = this.configSettings) == null ? void 0 : r.organizer) == null ? void 0 : t.name) || "Organizer"), o("p", { key: "8f3f84fc2cd17811c19e4c2d8b96cf639667bc77" }, o("clock-icon", { key: "9d57753e040d73a89ee1555924d047f052cb4ade" }), this.eventDuration ? je(this.eventDuration) : `- ${i.t("time.minutes")}`)), o("div", { key: "3559ca6682bf25eef73347ef9189a6a0d0932625", class: "header flex-row" }, o("h2", { key: "687ac4f43dc845db21b5c2a320d186dc83d85a4c", part: "ndp__month-header" }, o("strong", { key: "26305cb6e556b732e132d8f89a76d8b76aa6a2d1" }, Fe(this.month.toLocaleDateString(void 0, { month: "long" }).toLocaleLowerCase())), " ", this.month.toLocaleDateString(void 0, { year: "numeric" })), o("div", { key: "9447c15ecf0d41fd7d481cb73513a99aca7262a9", class: "pagination" }, o("button", { key: "1c9c7aece6dc5dbd595b542a5fffed7a503d3ab4", title: "Previous month", onClick: () => this.changeMonth(-1), class: { "chevron-left": !0, button: !0 }, disabled: this.month <= /* @__PURE__ */ new Date(), part: "ndp__month-button" }, o("chevron-icon", { key: "904a32272ea470318ea6540484a5bbf98269e288" })), o("button", { key: "f7a18e2daf96c2585a8aea924a855459b68981cc", title: "Next month", onClick: () => this.changeMonth(1), class: { "chevron-right": !0, button: !0 }, disabled: this.disableNextMonthButton, part: "ndp__month-button" }, o("chevron-icon", { key: "b96d72fad19df4fc35d22419232273e4e9be2cf4" })))), o("div", { key: "e072b3f48c5ba7477d96172d2f91f4db5a0cb2e5", class: "dates" }, [
835
+ i.t("days.sunday"),
836
+ i.t("days.monday"),
837
+ i.t("days.tuesday"),
838
+ i.t("days.wednesday"),
839
+ i.t("days.thursday"),
840
+ i.t("days.friday"),
841
+ i.t("days.saturday")
842
+ ].map((s) => o("div", { class: "day", part: "ndp__day" }, s)), this.dates.map((s, c) => {
843
+ var h;
844
+ const b = this.isDisabled(s, this.selectableDates);
845
+ return this.isLoading ? o("button", { disabled: !0, class: {
846
+ "date day-skeleton": !0,
847
+ "current-month": H(s, this.month)
848
+ }, style: { animationDelay: `${c * 20}ms` }, part: "ndp__date ndp__date--disabled" }, s.getDate()) : o("button", { class: {
849
+ date: !0,
850
+ selected: !!(this.selectedDate && P(s, this.selectedDate) && this.selectableDates && ((h = this.selectableDates) == null ? void 0 : h.length) > 0),
851
+ "current-day": P(s, /* @__PURE__ */ new Date()),
852
+ "current-month": H(s, this.month)
853
+ }, "aria-label": s.toLocaleDateString(void 0, { dateStyle: "full" }), disabled: b, onClick: () => this.selectDate(s), part: `ndp__date ${this.isSelected(s, this.selectedDate, this.selectableDates) ? "ndp__date--selected" : ""} ${P(s, /* @__PURE__ */ new Date()) ? "ndp__date--current-day" : ""} ${H(s, this.month) ? "ndp__date--current-month" : ""}` }, s.getDate());
854
+ }))));
855
+ }
856
+ get host() {
857
+ return T(this);
858
+ }
859
+ static get watchers() {
860
+ return {
861
+ configSettings: ["configSettingsChanged"],
862
+ selectedLanguage: ["selectedLanguageChanged"],
863
+ themeConfig: ["themeConfigChanged"],
864
+ selectedDate: ["selectedDateChanged"]
865
+ };
866
+ }
867
+ };
868
+ oa([
869
+ B({
870
+ name: "nylas-date-picker",
871
+ stateToProps: /* @__PURE__ */ new Map([
872
+ ["scheduler.selectableDates", "selectableDates"],
873
+ ["scheduler.selectedDate", "selectedDate"],
874
+ ["scheduler.isLoading", "isLoading"],
875
+ ["scheduler.configSettings", "configSettings"],
876
+ ["scheduler.eventDuration", "eventDuration"],
877
+ ["scheduler.selectedLanguage", "selectedLanguage"],
878
+ ["scheduler.themeConfig", "themeConfig"],
879
+ ["scheduler.selectedTimezone", "selectedTimezone"]
880
+ ]),
881
+ eventToProps: {
882
+ dateSelected: async (e, a) => {
883
+ d("nylas-date-picker", "dateSelected", e.detail), a.scheduler.selectDate(e.detail);
884
+ },
885
+ monthChanged: async (e, a) => {
886
+ d("nylas-date-picker", "monthChanged", e.detail);
887
+ }
888
+ },
889
+ fireRegisterEvent: !0
890
+ }),
891
+ J("design:type", Function),
892
+ J("design:paramtypes", []),
893
+ J("design:returntype", void 0)
894
+ ], Ee.prototype, "render", null);
895
+ Ee.style = na;
896
+ const ta = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.nylas-locale-switch{display:flex;flex-direction:row;justify-content:space-between;align-items:center;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}select-dropdown{width:auto}select-dropdown::part(sd_dropdown-button){border:none;padding:10px}select-dropdown::part(sd_dropdown-content){max-width:306px}@media screen and (max-width: 768px){select-dropdown::part(sd_dropdown-button-selected-label){max-width:80px}select-dropdown::part(sd_dropdown-content){width:100%;max-width:none}}', la = ta;
897
+ var ra = function(e, a, n, l) {
898
+ var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
899
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
900
+ t = Reflect.decorate(e, a, n, l);
901
+ else
902
+ for (var c = e.length - 1; c >= 0; c--)
903
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
904
+ return r > 3 && t && Object.defineProperty(a, n, t), t;
905
+ }, K = function(e, a) {
906
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
907
+ return Reflect.metadata(e, a);
908
+ };
909
+ const Be = class {
910
+ constructor(e) {
911
+ var a, n;
912
+ w(this, e), this.timezoneChanged = f(this, "timezoneChanged", 7), this.languageChanged = f(this, "languageChanged", 7), this.themeConfig = void 0, this.bookingInfo = void 0, this.selectedTimezone = ((a = this.bookingInfo) == null ? void 0 : a.timezone) || Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = ((n = this.bookingInfo) == null ? void 0 : n.language) || navigator.language;
913
+ }
914
+ themeConfigChanged(e) {
915
+ this.applyThemeConfig(e);
916
+ }
917
+ bookingInfoChangedHandler(e) {
918
+ e && (e != null && e.timezone) && this.changeTimezone(e.timezone), e && (e != null && e.language) && this.changeLanguage(e.language);
919
+ }
920
+ connectedCallback() {
921
+ }
922
+ disconnectedCallback() {
923
+ }
924
+ componentWillLoad() {
925
+ }
926
+ componentDidLoad() {
927
+ var e, a;
928
+ d("[nylas-locale-switch] Component did load"), this.applyThemeConfig(this.themeConfig), this.bookingInfo && ((e = this.bookingInfo) != null && e.timezone) && this.changeTimezone(this.bookingInfo.timezone), this.bookingInfo && ((a = this.bookingInfo) != null && a.language) && this.changeLanguage(this.bookingInfo.language);
929
+ }
930
+ applyThemeConfig(e) {
931
+ var a, n;
932
+ if (e)
933
+ for (const [l, r] of Object.entries(e))
934
+ this.host.style.setProperty(`${l}`, r), (a = this.timezoneRef) == null || a.style.setProperty(`${l}`, r), (n = this.languageRef) == null || n.style.setProperty(`${l}`, r);
935
+ }
936
+ changeTimezone(e) {
937
+ this.selectedTimezone = e, this.timezoneChanged.emit(e);
938
+ }
939
+ changeLanguage(e) {
940
+ this.selectedLanguage = e, this.languageChanged.emit(e);
941
+ }
942
+ nylasFormDropdownChangedHandler(e) {
943
+ const { name: a, value: n } = e.detail;
944
+ a === "timezone" ? this.changeTimezone(n) : a === "language" && this.changeLanguage(n);
945
+ }
946
+ getTimezoneLabelHTML(e) {
947
+ const a = Pe(e);
948
+ return o("span", { class: "timezone-label", style: {
949
+ display: "flex",
950
+ alignItems: "center",
951
+ justifyContent: "space-between",
952
+ width: "-webkit-fill-available"
953
+ } }, F[e], " ", o("span", { class: "timezone-offset", style: {
954
+ fontSize: "14px",
955
+ fontWeight: "400",
956
+ color: "var(--nylas-base-500)"
957
+ } }, a));
958
+ }
959
+ render() {
960
+ const e = Object.keys(F).map((n) => ({
961
+ labelHTML: this.getTimezoneLabelHTML(n),
962
+ label: F[n],
963
+ value: n
964
+ })), a = Object.keys(me).map((n) => ({
965
+ label: me[n],
966
+ value: n
967
+ }));
968
+ return o(k, { key: "1a324cb66322d9dd8cb552a36bd3990a592ee7e9" }, o("div", { key: "18e91795ed822ed59f22c72207ea53ea9766d887", class: "nylas-locale-switch", part: "nls" }, o("div", { key: "7eb5e5ed990f5816e9dd17b1c4d06db3f36191da", class: {
969
+ "select-wrapper": !0,
970
+ timezone: !0
971
+ }, part: "nls__timezone" }, o("select-dropdown", { key: "32323279c21ad428b38d80ad0e4a484f845f135e", name: "timezone", options: e, ref: (n) => this.timezoneRef = n, defaultSelectedOption: e.find((n) => n.value == this.selectedTimezone), exportparts: "sd_dropdown: nls__timezone-dropdown, sd_dropdown-button: nls__timezone-drop-button, sd_dropdown-button-selected-label: nls__timezone-drop-button-selected-label, sd_dropdown-content: nls__timezone-drop-content, sd_dropdown_label: nls__timezone-drop-label" }, o("span", { key: "8c8364acc7d8e52ba170fd1de2a85cae15461e03", slot: "select-icon" }, o("globe-icon", { key: "cd491eef36d00660976120510449e2d2f3e46781", width: "20", height: "20" })))), o("div", { key: "80fcd6d80efd4f69cd8b0cec376ac105f45cb5a1", class: {
972
+ "select-wrapper": !0,
973
+ language: !0
974
+ }, part: "nls__language" }, o("select-dropdown", { key: "578f4a7ddf488cac7eea767c4346167d7bb912ac", name: "language", options: a, ref: (n) => this.languageRef = n, defaultSelectedOption: a.find((n) => n.value == this.selectedLanguage), exportparts: "sd_dropdown: nls__language-dropdown, sd_dropdown-button: nls__language-drop-button, sd_dropdown-content: nls__language-drop-content, sd_dropdown_label: nls__language-drop-label" }, o("span", { key: "e35c2a746e10701f434aaaa3194b4656fc525404", slot: "select-icon" }, o("translate-icon", { key: "7981ceb4834167c19ba6655d558a9a3ae28e5829", width: "20", height: "20" }))))));
975
+ }
976
+ get host() {
977
+ return T(this);
978
+ }
979
+ static get watchers() {
980
+ return {
981
+ themeConfig: ["themeConfigChanged"],
982
+ bookingInfo: ["bookingInfoChangedHandler"]
983
+ };
984
+ }
985
+ };
986
+ ra([
987
+ B({
988
+ name: "nylas-locale-switch",
989
+ stateToProps: /* @__PURE__ */ new Map([
990
+ ["scheduler.selectedLanguage", "selectedLanguage"],
991
+ ["scheduler.selectedTimezone", "selectedTimezone"],
992
+ ["scheduler.bookingInfo", "bookingInfo"],
993
+ ["scheduler.themeConfig", "themeConfig"]
994
+ ]),
995
+ eventToProps: {
996
+ timezoneChanged: async (e, a) => {
997
+ d("nylas-locale-switch", "timezoneChanged", e.detail), a.scheduler.selectTimezone(e.detail);
998
+ },
999
+ languageChanged: async (e, a) => {
1000
+ d("nylas-locale-switch", "languageChanged", e.detail), a.scheduler.selectLanguage(e.detail);
1001
+ }
1002
+ },
1003
+ fireRegisterEvent: !0
1004
+ }),
1005
+ K("design:type", Function),
1006
+ K("design:paramtypes", []),
1007
+ K("design:returntype", void 0)
1008
+ ], Be.prototype, "render", null);
1009
+ Be.style = la;
1010
+ const sa = ".sc-nylas-logo-h{display:flex}", ia = sa, ca = class {
1011
+ constructor(e) {
1012
+ w(this, e), this.width = "69", this.height = "24";
1013
+ }
1014
+ render() {
1015
+ return o("svg", { key: "2754c1399a5b051918a35626bcc7ef8c4469bdf6", width: this.width, height: this.height, viewBox: "0 0 69 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, o("g", { key: "305275b038021ca3f3e6dcc0fe2ae5b52386799b", "clip-path": "url(#clip0_455_3543)" }, o("path", { key: "522a651226ea7a0d10bb4cdb3cb81b4a73181313", 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" }), o("path", { key: "ddbac2352d168bd3f351a2cef55c63afe7cfa5c8", 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" }), o("path", { key: "3c6a6c66f1c3aace9405ebd584ca2ed5a0ded524", 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" }), o("path", { key: "a7d53e8a5700b0fbdb0852e1986196e1201d6e29", 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" }), o("path", { key: "39f69581e0ce463af015016ea0616cfb0d22cd5a", 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" }), o("path", { key: "a915b2d3150d9d27eb2d94afdc9c525145efa54b", 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" }), o("path", { key: "8f55641ad378bc25cdfa0de84eead63106874fee", 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" }), o("path", { key: "aaaf906bb3dd324c7819b7551943abc5070bdf6b", 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" })), o("defs", { key: "19edd2e50594677dee4a329eaa785a97c069a328" }, o("clipPath", { key: "8150c454a41dae533856dbf1458e1758f3816c71", id: "clip0_455_3543" }, o("rect", { key: "6f59a86c801dfcd1a4e7db6f151f479ad76a2a7b", width: "68.7123", height: "19.2877", fill: "white", transform: "translate(0.144043 0.356201)" }))));
1016
+ }
1017
+ };
1018
+ ca.style = ia;
1019
+ const da = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.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);background:rgb(255, 248, 248)}.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}', fa = da, ya = class {
1020
+ constructor(e) {
1021
+ w(this, e), this.ttl = 5e3, this.allowedCategories = ["component", "api", "validation", "invalid_session"], this.notifications = [];
1022
+ }
1023
+ onError(e) {
1024
+ d(`[nylas-notification] Error: ${e.detail.notification.title}`), this.handleNotification(e);
1025
+ }
1026
+ onWarning(e) {
1027
+ d(`[nylas-notification] Warning: ${e.detail.notification.title}`), this.handleNotification(e);
1028
+ }
1029
+ onInfo(e) {
1030
+ d(`[nylas-notification] Info: ${e.detail.notification.title}`), this.handleNotification(e);
1031
+ }
1032
+ onSuccess(e) {
1033
+ d(`[nylas-notification] Success: ${e.detail.notification.title}`), this.handleNotification(e);
1034
+ }
1035
+ isChildOf(e) {
1036
+ let a = this.host.parentNode;
1037
+ for (; a; ) {
1038
+ if (a === e)
1039
+ return !0;
1040
+ a instanceof ShadowRoot ? a = a.host : a = a.parentNode;
1041
+ }
1042
+ return !1;
1043
+ }
1044
+ handleNotification(e) {
1045
+ const a = e.detail.host;
1046
+ if (e.defaultPrevented) {
1047
+ d("[nylas-notification] Event default prevented");
1048
+ return;
1049
+ }
1050
+ if (a && !this.isChildOf(a)) {
1051
+ d("[nylas-notification] Host not a parent");
1052
+ return;
1053
+ }
1054
+ if (this.ttl === 0) {
1055
+ d("[nylas-notification] TTL is 0");
1056
+ return;
1057
+ }
1058
+ if (this.allowedCategories.length > 0 && !this.allowedCategories.includes(e.detail.notification.category)) {
1059
+ d("[nylas-notification] Category not allowed");
1060
+ return;
1061
+ }
1062
+ if (this.notifications = [...this.notifications, { ...e.detail.notification }], e.detail.notification.ttl !== "none") {
1063
+ const n = e.detail.notification.ttl ? e.detail.notification.ttl : this.ttl;
1064
+ window.setTimeout(() => {
1065
+ this.notifications = this.notifications.filter((l) => l.id !== e.detail.notification.id);
1066
+ }, n);
1067
+ }
1068
+ }
1069
+ dismissNotification(e) {
1070
+ this.notifications = this.notifications.filter((a) => a.id !== e);
1071
+ }
1072
+ render() {
1073
+ return o(k, { key: "14bd95afa19f56ee11c7fd0da40569ce7db03b8b" }, o(Oe, { key: "7d235408e948e21554c9438b578c9f8dc6cbc00e" }, this.notifications.map((e) => o("div", { class: `notif ${e.type}`, key: e.id }, o("div", { class: "content" }, o("span", { class: `icon ${e.type}` }, (e.type === "error" || e.type === "warning") && o("warning-icon", null)), o("span", { class: "message" }, o("span", { class: "title" }, e.title), e.description && o("span", { class: "description" }, e.description))), o("button", { class: "dismiss-btn", onClick: () => this.dismissNotification(e.id) }, o("close-icon", null)))), o("slot", { key: "fda76c22b0e752e2c6bcd84bc8d92d8f8e94ce88" })));
1074
+ }
1075
+ get host() {
1076
+ return T(this);
1077
+ }
1078
+ };
1079
+ ya.style = fa;
1080
+ const ba = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.event-card-wrapper{height:inherit;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-family:var(--nylas-font-family);background-color:var(--nylas-base-0);color:var(--nylas-base-900);border-radius:var(--nylas-border-radius-3x);position:relative;margin-top:1rem;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:16px;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}.manage-booking-description{border-top:1px solid var(--nylas-base-200)}.manage-booking-description p{font-size:16px;margin:1rem;padding:0.5rem 1rem;font-weight:400;color:var(--nylas-base-800)}.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)}.footer.no-template-cols{grid-template-columns:1fr}.footer.no-footer{display:none}sp-divider{background-color:var(--nylas-base-200);height:1px}calendar-check-icon{display:flex;align-items:center;justify-content:center;height:100%}button-component{--dot-color:var(--nylas-base-700)}', ha = ba;
1081
+ var ga = function(e, a, n, l) {
1082
+ var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
1083
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1084
+ t = Reflect.decorate(e, a, n, l);
1085
+ else
1086
+ for (var c = e.length - 1; c >= 0; c--)
1087
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
1088
+ return r > 3 && t && Object.defineProperty(a, n, t), t;
1089
+ }, Q = function(e, a) {
1090
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1091
+ return Reflect.metadata(e, a);
1092
+ };
1093
+ const De = class {
1094
+ constructor(e) {
1095
+ w(this, e), this.rejectBookingButtonClicked = f(this, "rejectBookingButtonClicked", 7), this.confirmBookingButtonClicked = f(this, "confirmBookingButtonClicked", 7), this.confirmBookingError = f(this, "confirmBookingError", 7), this.handleConfirmBookingButtonClicked = () => {
1096
+ this.action = "confirm";
1097
+ const a = (n) => {
1098
+ this.confirmBookingError.emit(n);
1099
+ };
1100
+ this.organizerConfirmationBookingId && !this.isLoading && this.confirmBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host, errorHandler: a });
1101
+ }, this.handleRejectBookingButtonClicked = () => {
1102
+ this.action = "reject", this.organizerConfirmationBookingId && !this.isLoading && this.rejectBookingButtonClicked.emit({ bookingId: this.organizerConfirmationBookingId, host: this.host });
1103
+ }, this.configSettings = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.organizerConfirmationBookingId = void 0, this.selectedLanguage = navigator.language, this.action = null;
1104
+ }
1105
+ themeConfigChanged(e) {
1106
+ this.applyThemeConfig(e);
1107
+ }
1108
+ connectedCallback() {
1109
+ }
1110
+ disconnectedCallback() {
1111
+ }
1112
+ async componentWillLoad() {
1113
+ d("[nylas-organizer-confirmation-card] Component will load");
1114
+ }
1115
+ async componentDidLoad() {
1116
+ d("[nylas-organizer-confirmation-card] Component did load"), this.applyThemeConfig(this.themeConfig);
1117
+ }
1118
+ applyThemeConfig(e) {
1119
+ if (e)
1120
+ for (const [a, n] of Object.entries(e))
1121
+ this.host.style.setProperty(`${a}`, n);
1122
+ }
1123
+ async resetAction() {
1124
+ this.action = null;
1125
+ }
1126
+ render() {
1127
+ var e, a, n, l, r, t, s, c, b, h, u, C;
1128
+ return o(k, { key: "b72cdf56a652927b8bdc97bd1aca688190fae0c8", part: "nmcc" }, o("div", { key: "af1403167427309c434934b2fd62d01121575fc3", class: "event-card-wrapper", part: "nmccc__card" }, o("div", { key: "421f5f62e390dd3631ee053ff55fbd9c45b3ca94", class: "calendar-icon" }, o("calendar-check-icon", { key: "b1494af046b7c5e06f050ba267ff54ee21e70e5d" })), o("div", { key: "d6ae4056fe5e195c9ac81107afbfcaeaeca32e18", class: "booked-event-header" }, o("h2", { key: "f4d2b1c4b6c0304c7e25bd850d1c437bca9f4fd3", slot: "card-title", part: "nmcc__title" }, !!this.organizerConfirmationBookingId && `${i.t("bookingPendingTitle")}!`)), o("div", { key: "e5ce4a9667fb170d72332481f623e2283b71d5d9", class: "manage-booking-description" }, o("p", { key: "86a9992bd9e3c652736b8b89d5535db140ee1910" }, i.t("bookingPendingnDescription"))), o("div", { key: "736f19da65dd1e8e782b6b12f534eaaf85d0acbb", class: {
1129
+ footer: !0,
1130
+ "no-footer": ((a = (e = this.configSettings) == null ? void 0 : e.scheduler) == null ? void 0 : a.hide_cancellation_options) && ((l = (n = this.configSettings) == null ? void 0 : n.scheduler) == null ? void 0 : l.hide_rescheduling_options),
1131
+ "no-template-cols": ((t = (r = this.configSettings) == null ? void 0 : r.scheduler) == null ? void 0 : t.hide_cancellation_options) || ((c = (s = this.configSettings) == null ? void 0 : s.scheduler) == null ? void 0 : c.hide_rescheduling_options)
1132
+ } }, !((h = (b = this.configSettings) == null ? void 0 : b.scheduler) != null && h.hide_cancellation_options) && o("button-component", { variant: "destructive", onClick: this.handleRejectBookingButtonClicked, isLoading: this.isLoading && this.action === "reject", part: "nmcc__button-outline nmcc__cancel-cta" }, `${i.t("rejectBookingButton")}`), !((C = (u = this.configSettings) == null ? void 0 : u.scheduler) != null && C.hide_rescheduling_options) && o("button-component", { variant: "basic", onClick: this.handleConfirmBookingButtonClicked, isLoading: this.isLoading && this.action === "confirm", part: "nmcc__button-outline nmcc__reschedule-cta" }, `${i.t("confirmBookingButton")}`))));
1133
+ }
1134
+ get host() {
1135
+ return T(this);
1136
+ }
1137
+ static get watchers() {
1138
+ return {
1139
+ themeConfig: ["themeConfigChanged"]
1140
+ };
1141
+ }
1142
+ };
1143
+ ga([
1144
+ B({
1145
+ name: "nylas-organizer-confirmation-card",
1146
+ stateToProps: /* @__PURE__ */ new Map([
1147
+ ["scheduler.organizerConfirmationBookingId", "organizerConfirmationBookingId"],
1148
+ ["scheduler.configSettings", "configSettings"],
1149
+ ["scheduler.isLoading", "isLoading"],
1150
+ ["scheduler.selectedLanguage", "selectedLanguage"],
1151
+ ["scheduler.themeConfig", "themeConfig"]
1152
+ ]),
1153
+ eventToProps: {
1154
+ rejectBookingButtonClicked: async (e, a) => {
1155
+ a.scheduler.setReject(e.detail.bookingId);
1156
+ },
1157
+ confirmBookingButtonClicked: async (e, a) => {
1158
+ const { host: n } = e.detail, l = await a.scheduler.updateBooking({
1159
+ bookingId: e.detail.bookingId,
1160
+ status: "confirmed"
1161
+ }), { errorHandler: r } = e.detail;
1162
+ r && (!l || "error" in l) && r(l), await n.resetAction();
1163
+ }
1164
+ },
1165
+ fireRegisterEvent: !0
1166
+ }),
1167
+ Q("design:type", Function),
1168
+ Q("design:paramtypes", []),
1169
+ Q("design:returntype", void 0)
1170
+ ], De.prototype, "render", null);
1171
+ De.style = ha;
1172
+ const pa = ':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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;display:block;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: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}}', ma = pa;
1173
+ var ua = function(e, a, n, l) {
1174
+ var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
1175
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1176
+ t = Reflect.decorate(e, a, n, l);
1177
+ else
1178
+ for (var c = e.length - 1; c >= 0; c--)
1179
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
1180
+ return r > 3 && t && Object.defineProperty(a, n, t), t;
1181
+ }, V = function(e, a) {
1182
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1183
+ return Reflect.metadata(e, a);
1184
+ };
1185
+ const Le = class {
1186
+ constructor(e) {
1187
+ w(this, e), this.themeConfig = void 0, this.selectedDate = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedLanguage = void 0, this.hour12 = void 0, this.startTime = "", this.endTime = "";
1188
+ }
1189
+ themeConfigChanged(e) {
1190
+ this.applyThemeConfig(e);
1191
+ }
1192
+ connectedCallback() {
1193
+ }
1194
+ disconnectedCallback() {
1195
+ }
1196
+ async componentWillLoad() {
1197
+ d("[nylas-selected-event-card] Component will load");
1198
+ }
1199
+ async componentDidLoad() {
1200
+ var n, l;
1201
+ d("[nylas-selected-event-card] Component did load"), this.selectedDate || console.warn('[nylas-selected-event-card] "selectedDate" prop is not provided.'), this.selectedTimeslot || console.warn('[nylas-selected-event-card] "selectedTimeslot" prop is not provided.'), this.applyThemeConfig(this.themeConfig);
1202
+ const e = S[this.selectedLanguage || "en"], a = new Intl.DateTimeFormat(e, {
1203
+ hour: "2-digit",
1204
+ minute: "2-digit",
1205
+ timeZone: this.selectedTimezone,
1206
+ hour12: this.hour12
1207
+ });
1208
+ this.startTime = a.format(new Date((n = this.selectedTimeslot) == null ? void 0 : n.start_time)), this.endTime = a.format(new Date((l = this.selectedTimeslot) == null ? void 0 : l.end_time));
1209
+ }
1210
+ applyThemeConfig(e) {
1211
+ if (e)
1212
+ for (const [a, n] of Object.entries(e))
1213
+ this.host.style.setProperty(`${a}`, n);
1214
+ }
1215
+ render() {
1216
+ var e;
1217
+ return o(k, { key: "22b7e4f0f55d7a75188ebd3e8cc009497ad5a598", part: "nsec" }, o("div", { key: "0082bd129fe4704e4bf9bcc82ab401f7c50237fe", class: "event-card", part: "nsec__card" }, o("div", { key: "37093be5b192f8a8a533cb677b432df2cec80d14", class: "calendar-icon", part: "nsec__icon" }, o("calendar-icon", { key: "253a63fa567065c7a12f6fc8b82333568b52b777" })), o("div", { key: "a2d5218bd85c6f94652b0f24a11e68f53a8920d3", class: "nylas-selected-event-card__date", part: "nsec__date" }, this.selectedDate ? ue(ke((e = this.selectedTimeslot) == null ? void 0 : e.start_time, this.selectedTimezone, S[this.selectedLanguage || "en"])) : "-"), o("div", { key: "2f11d6deedb50cb0d7b3e9791088266e06cdca1e", class: "nylas-selected-event-card__time", part: "nsec__time" }, this.startTime, " - ", this.endTime)), o("div", { key: "634bd96488b5b1a51064c9bf015b054648f43011", class: "event-timezone", part: "nsec__timezone" }, o("globe-icon", { key: "b327dfa7747116da0ab29ddebcb6d20c82a0a80b" }), F[this.selectedTimezone]));
1218
+ }
1219
+ get host() {
1220
+ return T(this);
1221
+ }
1222
+ static get watchers() {
1223
+ return {
1224
+ themeConfig: ["themeConfigChanged"]
1225
+ };
1226
+ }
1227
+ };
1228
+ ua([
1229
+ B({
1230
+ name: "nylas-selected-event-card",
1231
+ stateToProps: /* @__PURE__ */ new Map([
1232
+ ["scheduler.selectedDate", "selectedDate"],
1233
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
1234
+ ["scheduler.selectedTimezone", "selectedTimezone"],
1235
+ ["scheduler.selectedLanguage", "selectedLanguage"],
1236
+ ["scheduler.themeConfig", "themeConfig"],
1237
+ ["scheduler.hour12", "hour12"]
1238
+ ]),
1239
+ eventToProps: {},
1240
+ fireRegisterEvent: !0
1241
+ }),
1242
+ V("design:type", Function),
1243
+ V("design:paramtypes", []),
1244
+ V("design:returntype", void 0)
1245
+ ], Le.prototype, "render", null);
1246
+ Le.style = ma;
1247
+ const ka = ':host{display:block;height:calc(100% - 48px);--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-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.time-picker-wrapper{display:flex;flex-direction:column;height:100%}.timeslots{position:relative;display:flex;flex-direction:column;gap:0.75rem;align-items:center;overflow-y:scroll;padding:0.5rem 1.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)}.time .time-label{display:flex;flex-direction:column;align-items:center;gap:4px}.time .time-label span.spots{font-size:14px;font-family:var(--nylas-font-family);font-weight:400;color:var(--nylas-base-600)}.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 .timeslot-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:14px;box-sizing:border-box;border-top:1px solid var(--nylas-base-200)}', va = ka;
1248
+ var Ca = function(e, a, n, l) {
1249
+ var r = arguments.length, t = r < 3 ? a : l === null ? l = Object.getOwnPropertyDescriptor(a, n) : l, s;
1250
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1251
+ t = Reflect.decorate(e, a, n, l);
1252
+ else
1253
+ for (var c = e.length - 1; c >= 0; c--)
1254
+ (s = e[c]) && (t = (r < 3 ? s(t) : r > 3 ? s(a, n, t) : s(a, n)) || t);
1255
+ return r > 3 && t && Object.defineProperty(a, n, t), t;
1256
+ }, ee = function(e, a) {
1257
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1258
+ return Reflect.metadata(e, a);
1259
+ };
1260
+ const Ie = class {
1261
+ constructor(e) {
1262
+ w(this, e), this.timeslotSelected = f(this, "timeslotSelected", 7), this.timeslotConfirmed = f(this, "timeslotConfirmed", 7), this.validateTimeslotError = f(this, "validateTimeslotError", 7), this.handleConfirmedTimeslot = async (a, n) => {
1263
+ a.preventDefault(), d("[nylas-timeslot-picker] Confirm timeslot", n), n && this.timeslotConfirmed.emit({ timeslot: n, host: this.host });
1264
+ }, this.handleMouseEnter = (a) => {
1265
+ this.hoveredTimeslotIndex = a;
1266
+ }, this.handleMouseLeave = () => {
1267
+ this.hoveredTimeslotIndex = -1;
1268
+ }, this.availability = void 0, this.isLoading = void 0, this.themeConfig = void 0, this.selectedTimeslot = void 0, this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.selectedDate = /* @__PURE__ */ new Date(), this.selectedLanguage = void 0, this.hour12 = void 0, this.times = [], this.hoveredTimeslotIndex = void 0, this.selectedTimeslotIndex = void 0;
1269
+ }
1270
+ selectedLanguageChanged(e) {
1271
+ i.changeLanguage(e);
1272
+ }
1273
+ selectedDateChanged(e) {
1274
+ var a;
1275
+ if (d("[nylas-timeslot-picker] Selected date changed", { newVal: e }), e && (this.selectedTimeslotIndex = "", typeof e < "u")) {
1276
+ const n = (a = this.availability) == null ? void 0 : a.filter((l) => $(l.start_time, e, this.selectedTimezone)).map((l) => l);
1277
+ this.times = n || [];
1278
+ }
1279
+ }
1280
+ availabilityChanged(e) {
1281
+ if (d("[nylas-timeslot-picker] Available times changed", { newVal: e, selectedDate: this.selectedDate }), typeof e < "u") {
1282
+ const a = e == null ? void 0 : e.filter((n) => this.selectedDate && $(n.start_time, this.selectedDate, this.selectedTimezone)).map((n) => n);
1283
+ this.times = a || [];
1284
+ }
1285
+ }
1286
+ themeConfigChanged(e) {
1287
+ this.applyThemeConfig(e);
1288
+ }
1289
+ connectedCallback() {
1290
+ }
1291
+ disconnectedCallback() {
1292
+ }
1293
+ async componentWillLoad() {
1294
+ d("[nylas-timeslot-picker] Component will load", { selectedDate: this.selectedDate, availability: this.availability, times: this.times });
1295
+ }
1296
+ async componentDidLoad() {
1297
+ var a;
1298
+ d("[nylas-timeslot-picker] Component did load");
1299
+ const e = (a = this.availability) == null ? void 0 : a.filter((n) => this.selectedDate && $(n.start_time, this.selectedDate, this.selectedTimezone)).map((n) => n);
1300
+ this.times = e || [], this.applyThemeConfig(this.themeConfig);
1301
+ }
1302
+ applyThemeConfig(e) {
1303
+ if (e)
1304
+ for (const [a, n] of Object.entries(e))
1305
+ this.host.style.setProperty(`${a}`, n);
1306
+ }
1307
+ getTimeslotId(e, a) {
1308
+ return `${e.toLocaleDateString()}-${a}`;
1309
+ }
1310
+ onClickSelectTime(e, a) {
1311
+ d("[nylas-timeslot-picker] Time selected", e, a), this.selectedTimeslotIndex = this.getTimeslotId(e.start_time, a), this.timeslotSelected.emit({
1312
+ start_time: e.start_time,
1313
+ end_time: e.end_time,
1314
+ emails: e.emails,
1315
+ capacity: e == null ? void 0 : e.capacity,
1316
+ event_id: e == null ? void 0 : e.event_id,
1317
+ master_id: e == null ? void 0 : e.master_id,
1318
+ calendar_id: e == null ? void 0 : e.calendar_id
1319
+ });
1320
+ }
1321
+ async emitValidateTimeslotError(e, a) {
1322
+ this.validateTimeslotError.emit({ error: e, type: a });
1323
+ }
1324
+ getTimeSlotLabel(e) {
1325
+ const a = S[this.selectedLanguage || "en"], n = new Intl.DateTimeFormat(a, {
1326
+ hour: "2-digit",
1327
+ minute: "2-digit",
1328
+ timeZone: this.selectedTimezone,
1329
+ hour12: this.hour12
1330
+ });
1331
+ return `${n.format(e.start_time)} - ${n.format(e.end_time)}`;
1332
+ }
1333
+ render() {
1334
+ const e = S[this.selectedLanguage || "en"];
1335
+ if (this.isLoading)
1336
+ return o(k, null, o("div", { class: "loading" }, new Array(6).fill(0).map((n, l) => o("div", { class: "timeslot-skeleton", style: { animationDelay: `${l * 20}ms` } }))));
1337
+ if (this.availability && this.availability.length === 0)
1338
+ return o(k, null, o("div", { class: "empty" }, o("span", null, "No dates available")));
1339
+ const a = this.times.filter((n) => {
1340
+ const l = (n == null ? void 0 : n.event_id) || (n == null ? void 0 : n.master_id), r = typeof (n == null ? void 0 : n.capacity) == "number" && (n == null ? void 0 : n.capacity) > 0;
1341
+ return !(l && !r);
1342
+ });
1343
+ return (!this.times || this.times.length === 0 || a.length === 0) && this.selectedDate ? o(k, null, o("div", { class: "empty" }, o("span", null, "No time slots available for selected date"))) : this.selectedDate ? o(k, { part: "ntp" }, o("div", { class: "time-picker-wrapper", part: "ntp__time-picker-wrapper" }, o("div", { class: "timeslots", part: "ntp__timeslots" }, a.map((n, l) => {
1344
+ var t, s, c, b;
1345
+ const r = typeof (n == null ? void 0 : n.capacity) == "number" && (n == null ? void 0 : n.capacity) > 0;
1346
+ return o("button", { part: `ntp__timeslot ${((s = (t = this.selectedTimeslot) == null ? void 0 : t.start_time) == null ? void 0 : s.getTime()) === n.start_time.getTime() ? "ntp__timeslot--selected" : ""}`, class: {
1347
+ time: !0,
1348
+ selected: typeof this.selectedTimeslot < "u" && ((b = (c = this.selectedTimeslot) == null ? void 0 : c.start_time) == null ? void 0 : b.getTime()) === n.start_time.getTime()
1349
+ }, onClick: () => this.onClickSelectTime(n, l), onMouseEnter: () => this.handleMouseEnter(l), onMouseLeave: () => this.handleMouseLeave() }, o("div", { class: "time-label", part: "ntp__time-label" }, this.hoveredTimeslotIndex == l || this.selectedTimeslotIndex == this.getTimeslotId(n.start_time, l) ? this.getTimeSlotLabel(n) : n.start_time.toLocaleTimeString(e, { hour: "2-digit", minute: "2-digit", timeZone: this.selectedTimezone, hour12: this.hour12 }), o("span", { class: "spots" }, r ? `${n == null ? void 0 : n.capacity} spots left` : null)));
1350
+ })), this.selectedTimeslot && o("div", { class: "footer" }, o("button-component", { variant: "primary", onClick: (n) => this.handleConfirmedTimeslot(n, this.selectedTimeslot), part: "ntp__button-primary" }, o("slot", { name: "timeslot-picker-cta-label" }, i.t("nextButton")))))) : o(k, null);
1351
+ }
1352
+ get host() {
1353
+ return T(this);
1354
+ }
1355
+ static get watchers() {
1356
+ return {
1357
+ selectedLanguage: ["selectedLanguageChanged"],
1358
+ selectedDate: ["selectedDateChanged"],
1359
+ availability: ["availabilityChanged"],
1360
+ themeConfig: ["themeConfigChanged"]
1361
+ };
1362
+ }
1363
+ };
1364
+ Ca([
1365
+ B({
1366
+ name: "nylas-timeslot-picker",
1367
+ stateToProps: /* @__PURE__ */ new Map([
1368
+ ["scheduler.selectedDate", "selectedDate"],
1369
+ ["scheduler.availability", "availability"],
1370
+ ["scheduler.selectedTimeslot", "selectedTimeslot"],
1371
+ ["scheduler.selectedTimezone", "selectedTimezone"],
1372
+ ["scheduler.selectedLanguage", "selectedLanguage"],
1373
+ ["scheduler.isLoading", "isLoading"],
1374
+ ["scheduler.themeConfig", "themeConfig"],
1375
+ ["scheduler.hour12", "hour12"]
1376
+ ]),
1377
+ eventToProps: {
1378
+ timeslotSelected: async (e, a) => {
1379
+ d("nylas-timeslot-picker", "timeslotSelected", e.detail), a.scheduler.selectTime(e.detail);
1380
+ },
1381
+ timeslotConfirmed: async (e, a) => {
1382
+ var r;
1383
+ d("nylas-timeslot-picker", "timeslotConfirmed", e.detail);
1384
+ const { timeslot: n, host: l } = e.detail;
1385
+ if (n && (n != null && n.event_id) && (n != null && n.capacity)) {
1386
+ const t = await a.scheduler.validateGroupEventTimeslot(n);
1387
+ if (t && "error" in t) {
1388
+ const s = ((r = t.error) == null ? void 0 : r.message) || "An error occurred while validating the timeslot";
1389
+ s === "Event is full" ? l.emitValidateTimeslotError(s, "info") : l.emitValidateTimeslotError(s, "error");
1390
+ }
1391
+ } else
1392
+ a.scheduler.toggleAdditionalData(!0);
1393
+ },
1394
+ validateTimeslotError: async (e, a) => {
1395
+ d("nylas-timeslot-picker", "validateTimeslotError", e.detail);
1396
+ }
1397
+ },
1398
+ fireRegisterEvent: !0
1399
+ }),
1400
+ ee("design:type", Function),
1401
+ ee("design:paramtypes", []),
1402
+ ee("design:returntype", void 0)
1403
+ ], Ie.prototype, "render", null);
1404
+ Ie.style = va;
1405
+ export {
1406
+ ve as nylas_booked_event_card,
1407
+ Ce as nylas_booking_form,
1408
+ _e as nylas_cancel_booking_form,
1409
+ we as nylas_cancelled_event_card,
1410
+ xe as nylas_confirmed_event_card,
1411
+ Ee as nylas_date_picker,
1412
+ Be as nylas_locale_switch,
1413
+ ca as nylas_logo,
1414
+ ya as nylas_notification,
1415
+ De as nylas_organizer_confirmation_card,
1416
+ Le as nylas_selected_event_card,
1417
+ Ie as nylas_timeslot_picker
1418
+ };