@nylas/react 1.1.0-canary.21 → 1.1.0-canary.23

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 (138) hide show
  1. package/dist/{add-circle-icon_2.entry-b8d6df60.js → add-circle-icon_3.entry-37a88ff3.js} +23 -13
  2. package/dist/add-circle-icon_3.entry-4f8f1cbf.cjs +1 -0
  3. package/dist/{archive-icon_7.entry-afaef817.cjs → archive-icon_7.entry-2ec9b077.cjs} +1 -1
  4. package/dist/{archive-icon_7.entry-3830776a.js → archive-icon_7.entry-3dcc4a66.js} +16 -16
  5. package/dist/{arrow-icon.entry-460cdd9f.cjs → arrow-icon.entry-175e8181.cjs} +1 -1
  6. package/dist/arrow-icon.entry-2cf3e94d.js +15 -0
  7. package/dist/{bold-icon_3.entry-80abafbb.js → bold-icon_3.entry-9fc74a39.js} +4 -4
  8. package/dist/{bold-icon_3.entry-1893eeec.cjs → bold-icon_3.entry-a3e61ad8.cjs} +1 -1
  9. package/dist/{button-component.entry-b78dc39e.cjs → button-component.entry-7fdb3bca.cjs} +1 -1
  10. package/dist/{button-component.entry-36137536.js → button-component.entry-861637f2.js} +2 -2
  11. package/dist/calendar-agenda-fill-icon_39.entry-3c21a3ec.cjs +7 -0
  12. package/dist/{calendar-agenda-fill-icon_40.entry-f19d6ad7.js → calendar-agenda-fill-icon_39.entry-493e91f6.js} +1268 -1300
  13. package/dist/{calendar-cancel-icon.entry-1fae00c5.js → calendar-cancel-icon.entry-3ca731f9.js} +2 -2
  14. package/dist/{calendar-cancel-icon.entry-0d83ee82.cjs → calendar-cancel-icon.entry-c9c7e3b3.cjs} +1 -1
  15. package/dist/{calendar-check-icon_2.entry-e01c9028.cjs → calendar-check-icon_2.entry-5b8f8a75.cjs} +1 -1
  16. package/dist/{calendar-check-icon_2.entry-159c38af.js → calendar-check-icon_2.entry-7c409a91.js} +5 -5
  17. package/dist/{calendar-icon.entry-3af9cb76.js → calendar-icon.entry-0589697f.js} +4 -4
  18. package/dist/{calendar-icon.entry-2e701aab.cjs → calendar-icon.entry-acd00f6f.cjs} +1 -1
  19. package/dist/{checkbox-component_2.entry-9ff2c85b.cjs → checkbox-component_2.entry-0aa252b9.cjs} +1 -1
  20. package/dist/{checkbox-component_2.entry-5eee51f6.js → checkbox-component_2.entry-538fd8ec.js} +3 -3
  21. package/dist/{checkmark-icon.entry-f96f1117.cjs → checkmark-icon.entry-0a184b31.cjs} +1 -1
  22. package/dist/{checkmark-icon.entry-0749b942.js → checkmark-icon.entry-56302db0.js} +4 -4
  23. package/dist/{chevron-icon_3.entry-c3989df2.cjs → chevron-icon_3.entry-7076e105.cjs} +1 -1
  24. package/dist/{chevron-icon_3.entry-2e9eebbc.js → chevron-icon_3.entry-80e03257.js} +13 -13
  25. package/dist/{clock-icon_4.entry-d4563931.cjs → clock-icon_4.entry-d6901afd.cjs} +1 -1
  26. package/dist/{clock-icon_4.entry-9395d0cb.js → clock-icon_4.entry-db3fbda1.js} +19 -19
  27. package/dist/{constants-67de2eec-e3b50fc6.cjs → constants-12bd3c98-22fd56f2.cjs} +1 -1
  28. package/dist/{constants-67de2eec-b17f5b96.js → constants-12bd3c98-26c75011.js} +4 -4
  29. package/dist/{copy-icon_3.entry-7de3667f.cjs → copy-icon_3.entry-33e89a37.cjs} +1 -1
  30. package/dist/{copy-icon_3.entry-7b276fa2.js → copy-icon_3.entry-9670b9f9.js} +7 -7
  31. package/dist/{document-refresh-icon.entry-6dd65cb6.js → document-refresh-icon.entry-149f2a3b.js} +5 -5
  32. package/dist/document-refresh-icon.entry-a3326831.cjs +1 -0
  33. package/dist/elements/index.d.ts +3 -0
  34. package/dist/{elements-dc5b338e-158dce67.cjs → elements-dc5b338e-211879a3.cjs} +1 -1
  35. package/dist/{elements-dc5b338e-5e8a704b.js → elements-dc5b338e-e07600d4.js} +1 -1
  36. package/dist/{focus-visible-e8093c16-9d88e8ee.js → focus-visible-e8093c16-284cefe0.js} +1 -1
  37. package/dist/{focus-visible-e8093c16-5883a317.cjs → focus-visible-e8093c16-cb97634f.cjs} +1 -1
  38. package/dist/{forward-icon_6.entry-acdf04ad.js → forward-icon_6.entry-554b0722.js} +9 -9
  39. package/dist/{forward-icon_6.entry-a59dada5.cjs → forward-icon_6.entry-751fdd4e.cjs} +3 -3
  40. package/dist/{globe-icon.entry-eef27331.cjs → globe-icon.entry-63eb510d.cjs} +1 -1
  41. package/dist/{globe-icon.entry-389c0391.js → globe-icon.entry-e3dd58bc.js} +2 -2
  42. package/dist/google-logo-icon_5.entry-bccce7f4.cjs +1 -0
  43. package/dist/google-logo-icon_5.entry-e462e091.js +748 -0
  44. package/dist/index-53420959-02fe58ef.js +5 -0
  45. package/dist/index-53420959-0b9c205e.cjs +1 -0
  46. package/dist/{index-6d9eeb53-15c69801.cjs → index-6d9eeb53-81e5b798.cjs} +1 -1
  47. package/dist/{index-6d9eeb53-c70fc8a7.js → index-6d9eeb53-cc42c6f1.js} +2 -2
  48. package/dist/{index-db48e0b6.cjs → index-8a536089.cjs} +14 -14
  49. package/dist/{index-f8317a8e.js → index-a15916e5.js} +398 -383
  50. package/dist/{index.es-b16d0cf5-d7f30c4a.cjs → index.es-5355a265-e701a627.cjs} +1 -1
  51. package/dist/{index.es-b16d0cf5-386496a9.js → index.es-5355a265-f8853ce4.js} +1 -1
  52. package/dist/{info-icon_2.entry-97d75550.js → info-icon_2.entry-3b349f01.js} +5 -5
  53. package/dist/{info-icon_2.entry-63914227.cjs → info-icon_2.entry-9559cf3b.cjs} +1 -1
  54. package/dist/{input-dropdown.entry-4d29246a.js → input-dropdown.entry-9bc68630.js} +2 -2
  55. package/dist/{input-dropdown.entry-629d7b54.cjs → input-dropdown.entry-d454f6bc.cjs} +1 -1
  56. package/dist/loading-icon.entry-1d49e471.js +15 -0
  57. package/dist/loading-icon.entry-a68da48b.cjs +1 -0
  58. package/dist/{mailbox-store-f11de360-d781fd36.js → mailbox-store-31d55036-1106efe2.js} +2 -2
  59. package/dist/{mailbox-store-f11de360-02a6de93.cjs → mailbox-store-31d55036-c8618c0b.cjs} +1 -1
  60. package/dist/{multi-select-dropdown.entry-8e14e9af.js → multi-select-dropdown.entry-36074a81.js} +2 -2
  61. package/dist/{multi-select-dropdown.entry-68fcca98.cjs → multi-select-dropdown.entry-e5ed9285.cjs} +1 -1
  62. package/dist/{nylas-booked-event-card_10.entry-9487941d.js → nylas-booked-event-card_10.entry-38d2fd2e.js} +75 -74
  63. package/dist/nylas-booked-event-card_10.entry-e530a8db.cjs +1 -0
  64. package/dist/nylas-booking-confirmation-type.entry-2fea82f9.js +106 -0
  65. package/dist/nylas-booking-confirmation-type.entry-5857a863.cjs +1 -0
  66. package/dist/{nylas-form-card.entry-ca669dea.cjs → nylas-form-card.entry-03a31218.cjs} +1 -1
  67. package/dist/{nylas-form-card.entry-ccfa5692.js → nylas-form-card.entry-6e45c873.js} +19 -19
  68. package/dist/{nylas-if-state.entry-93935670.js → nylas-if-state.entry-092f4e1a.js} +3 -3
  69. package/dist/{nylas-if-state.entry-faa11bb6.cjs → nylas-if-state.entry-61d7ebc5.cjs} +1 -1
  70. package/dist/{nylas-list-folders.entry-e7e179ea.cjs → nylas-list-folders.entry-1abbb401.cjs} +1 -1
  71. package/dist/{nylas-list-folders.entry-14fc1fe8.js → nylas-list-folders.entry-ab9e1c2c.js} +3 -3
  72. package/dist/{nylas-list-threads.entry-2118b146.js → nylas-list-threads.entry-2faaa2bb.js} +3 -3
  73. package/dist/{nylas-list-threads.entry-3f52fc06.cjs → nylas-list-threads.entry-dfc87aca.cjs} +1 -1
  74. package/dist/{nylas-login.entry-87a902d6.js → nylas-login.entry-243ae09e.js} +7 -7
  75. package/dist/{nylas-login.entry-915f0284.cjs → nylas-login.entry-d1cac0a1.cjs} +1 -1
  76. package/dist/{nylas-mailbox-pagination.entry-eedbf796.js → nylas-mailbox-pagination.entry-b8225a3e.js} +2 -2
  77. package/dist/{nylas-mailbox-pagination.entry-9aa8a606.cjs → nylas-mailbox-pagination.entry-c27af71c.cjs} +1 -1
  78. package/dist/{nylas-mailbox-toolbar-button.entry-40b75810.js → nylas-mailbox-toolbar-button.entry-22347d22.js} +7 -7
  79. package/dist/{nylas-mailbox-toolbar-button.entry-ba5b826e.cjs → nylas-mailbox-toolbar-button.entry-b66d597d.cjs} +1 -1
  80. package/dist/{nylas-mailbox.entry-179e5a5c.js → nylas-mailbox.entry-9e6e1b4d.js} +4 -4
  81. package/dist/{nylas-mailbox.entry-31de7f8f.cjs → nylas-mailbox.entry-cb80f58c.cjs} +1 -1
  82. package/dist/{nylas-provider.entry-7b70bbdc.js → nylas-provider.entry-196dd5da.js} +8 -8
  83. package/dist/{nylas-provider.entry-46fe01b6.cjs → nylas-provider.entry-28c12448.cjs} +1 -1
  84. package/dist/nylas-reminder-emails.entry-47ef5a9d.cjs +4 -0
  85. package/dist/nylas-reminder-emails.entry-b655d888.js +129 -0
  86. package/dist/nylas-reminder-time_2.entry-0f3747fb.cjs +1 -0
  87. package/dist/nylas-reminder-time_2.entry-9d8f7436.js +105 -0
  88. package/dist/{nylas-scheduler-editor.entry-76b68f66.cjs → nylas-scheduler-editor.entry-504e8ed3.cjs} +2 -2
  89. package/dist/{nylas-scheduler-editor.entry-f1f80de1.js → nylas-scheduler-editor.entry-feb7a7db.js} +12 -11
  90. package/dist/nylas-scheduling.entry-8c8f8e35.cjs +1 -0
  91. package/dist/{nylas-scheduling.entry-31d13205.js → nylas-scheduling.entry-d35efa9a.js} +73 -73
  92. package/dist/{nylas-threads-refresh.entry-a3ea46aa.js → nylas-threads-refresh.entry-91af9af3.js} +4 -4
  93. package/dist/{nylas-threads-refresh.entry-c9f9db8c.cjs → nylas-threads-refresh.entry-e637161b.cjs} +1 -1
  94. package/dist/{nylas-threads-search.entry-01482ddf.js → nylas-threads-search.entry-5457dcec.js} +5 -5
  95. package/dist/{nylas-threads-search.entry-a4ab0d47.cjs → nylas-threads-search.entry-b944f95a.cjs} +1 -1
  96. package/dist/{nylas-time-window-picker.entry-5a3bb0b7.cjs → nylas-time-window-picker.entry-134ef726.cjs} +1 -1
  97. package/dist/{nylas-time-window-picker.entry-5f063b2b.js → nylas-time-window-picker.entry-a6fd216b.js} +12 -12
  98. package/dist/{nylas-view-thread.entry-cb057b9e.js → nylas-view-thread.entry-6fdd6cb1.js} +3 -3
  99. package/dist/{nylas-view-thread.entry-82e78b82.cjs → nylas-view-thread.entry-9296a505.cjs} +1 -1
  100. package/dist/{person-icon.entry-78cdc7f9.cjs → person-icon.entry-1cdb4dc2.cjs} +1 -1
  101. package/dist/{person-icon.entry-3e30c63c.js → person-icon.entry-4a695727.js} +4 -4
  102. package/dist/{play-icon_2.entry-4fb1938c.cjs → play-icon_2.entry-10fd617e.cjs} +1 -1
  103. package/dist/{play-icon_2.entry-71eaad5c.js → play-icon_2.entry-fb013b17.js} +6 -6
  104. package/dist/react.cjs +1 -1
  105. package/dist/react.js +104 -101
  106. package/dist/{refresh-icon.entry-db85d14d.js → refresh-icon.entry-46c92605.js} +4 -4
  107. package/dist/{refresh-icon.entry-3570353d.cjs → refresh-icon.entry-9dbb04ba.cjs} +1 -1
  108. package/dist/{register-component-b2a51b20-9a913603.cjs → register-component-592986c5-5edf5835.cjs} +1 -1
  109. package/dist/{register-component-b2a51b20-8a262dcf.js → register-component-592986c5-d5d210a8.js} +1 -1
  110. package/dist/{scheduler-config-store-9ccfba4d-6806e3cb.cjs → scheduler-config-store-9ccfba4d-3ec35859.cjs} +1 -1
  111. package/dist/{scheduler-config-store-9ccfba4d-a6745ccc.js → scheduler-config-store-9ccfba4d-b08031b5.js} +1 -1
  112. package/dist/{scheduler-store-db06b30a-1e63b67f.js → scheduler-store-fd0d11a5-313e8592.js} +1 -1
  113. package/dist/{scheduler-store-db06b30a-d5e6b6c3.cjs → scheduler-store-fd0d11a5-b180b3b7.cjs} +1 -1
  114. package/dist/{textarea-component.entry-f5f402a1.js → textarea-component.entry-0cd3b57f.js} +4 -4
  115. package/dist/{textarea-component.entry-be870b8f.cjs → textarea-component.entry-788eb37a.cjs} +1 -1
  116. package/dist/{time-period-selector.entry-d1a8470b.js → time-period-selector.entry-112c0b64.js} +6 -6
  117. package/dist/{time-period-selector.entry-fc7d61c6.cjs → time-period-selector.entry-1e0b720b.cjs} +1 -1
  118. package/dist/{translate-icon.entry-b91a0449.js → translate-icon.entry-a4df3c16.js} +4 -4
  119. package/dist/{translate-icon.entry-3ae0ddae.cjs → translate-icon.entry-c701b391.cjs} +1 -1
  120. package/dist/{warning-icon.entry-54127f45.cjs → warning-icon.entry-bda0aafa.cjs} +1 -1
  121. package/dist/{warning-icon.entry-acdc811b.js → warning-icon.entry-d1703715.js} +7 -7
  122. package/package.json +3 -3
  123. package/dist/add-circle-icon_2.entry-29cc2385.cjs +0 -1
  124. package/dist/arrow-icon.entry-19f00716.js +0 -15
  125. package/dist/calendar-agenda-fill-icon_40.entry-62c66fce.cjs +0 -10
  126. package/dist/close-icon.entry-cf9f0a69.js +0 -15
  127. package/dist/close-icon.entry-e24af309.cjs +0 -1
  128. package/dist/document-refresh-icon.entry-582ac233.cjs +0 -1
  129. package/dist/google-logo-icon_4.entry-e9be320c.cjs +0 -1
  130. package/dist/google-logo-icon_4.entry-eae19fc8.js +0 -637
  131. package/dist/index-53420959-82a5306f.cjs +0 -1
  132. package/dist/index-53420959-9b1699ec.js +0 -5
  133. package/dist/loading-icon.entry-2f15a09f.cjs +0 -1
  134. package/dist/loading-icon.entry-fc9bc740.js +0 -15
  135. package/dist/nylas-booked-event-card_10.entry-4da23b61.cjs +0 -1
  136. package/dist/nylas-custom-booking-flow.entry-0e16973b.js +0 -106
  137. package/dist/nylas-custom-booking-flow.entry-338b0a8f.cjs +0 -1
  138. package/dist/nylas-scheduling.entry-3ce8c52f.cjs +0 -1
@@ -0,0 +1,748 @@
1
+ import { r as N, h as t, c as w, d as c, H as q, g as K, z as He, A as G } from "./index-a15916e5.js";
2
+ import { R as Q } from "./register-component-592986c5-d5d210a8.js";
3
+ import { D as Fe } from "./constants-12bd3c98-26c75011.js";
4
+ import "react";
5
+ import "react-dom";
6
+ const Ee = ".sc-google-logo-icon-h{display:flex}", Be = Ee, Pe = class {
7
+ constructor(e) {
8
+ N(this, e), this.width = "24", this.height = "24";
9
+ }
10
+ render() {
11
+ return t("svg", { key: "1d8c7ecd21b0ed36e49e1054f58d3ca7fed9a349", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, t("g", { key: "40cbdd9176ef43ba0612b091b18a085681fc64a9", "clip-path": "url(#clip0_959_12452)" }, t("path", { key: "a2dd6514041e159035e79a3a07920dec65bf33b5", d: "M23.745 12.27C23.745 11.48 23.675 10.73 23.555 10H12.255V14.51H18.725C18.435 15.99 17.585 17.24 16.325 18.09V21.09H20.185C22.445 19 23.745 15.92 23.745 12.27Z", fill: "#4285F4" }), t("path", { key: "4a5413075eee0849afb689ae7d13b64ea08523d1", d: "M12.255 24C15.495 24 18.205 22.92 20.185 21.09L16.325 18.09C15.245 18.81 13.875 19.25 12.255 19.25C9.12504 19.25 6.47505 17.14 5.52505 14.29H1.54504V17.38C3.51504 21.3 7.56504 24 12.255 24Z", fill: "#34A853" }), t("path", { key: "c944b7612fdc201c7199095911dd077a8a401d85", d: "M5.52501 14.2901C5.27501 13.5701 5.145 12.8001 5.145 12.0001C5.145 11.2001 5.28501 10.4301 5.52501 9.71012V6.62012H1.545C0.725004 8.24012 0.255005 10.0601 0.255005 12.0001C0.255005 13.9401 0.725004 15.7601 1.545 17.3801L5.52501 14.2901Z", fill: "#FBBC05" }), t("path", { key: "46ed9d774d7dcb2694bb44226f9b136bfd38ff74", d: "M12.255 4.75C14.025 4.75 15.605 5.36 16.855 6.55L20.275 3.13C18.205 1.19 15.495 0 12.255 0C7.56504 0 3.51504 2.7 1.54504 6.62L5.52505 9.71C6.47505 6.86 9.12504 4.75 12.255 4.75Z", fill: "#EA4335" })), t("defs", { key: "4d531967607e72490963d525edc750d3a11ba468" }, t("clipPath", { key: "f9935de12e3add4b525d1e19878852df6fae82f9", id: "clip0_959_12452" }, t("rect", { key: "5a609aab9388969074380dd660e5f6736e322be7", width: 24, height: 24, fill: "white" }))));
12
+ }
13
+ };
14
+ Pe.style = Be;
15
+ const Ne = ".sc-microsoft-logo-icon-h{display:flex}", Re = Ne, ze = class {
16
+ constructor(e) {
17
+ N(this, e), this.width = "22", this.height = "22";
18
+ }
19
+ render() {
20
+ return t("svg", { key: "485f75133b08cb6657f14baf540721c4f22c1c6c", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "3a0292b4518ace2c62fb8d27de67df3a31386124", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), t("path", { key: "cd9f1cca76e2ce12ebfb79ca575996da7f87400c", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), t("path", { key: "ad7a106422f8a774cc3e1c3b290d32e7e9e690b5", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), t("path", { key: "f7f84eac1bedf74460b744d3d2ce57dcc1943e06", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
21
+ }
22
+ };
23
+ ze.style = Re;
24
+ const Ie = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:inherit}.nylas-booking-type{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-booking-type .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-booking-type .header h3{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-booking-type .nylas-booking-type__dropdown{padding:1rem;display:flex;flex-direction:column;gap:4px}.nylas-booking-type .nylas-booking-type__dropdown span.nylas-booking-type__dropdown-label{display:flex;align-items:center;gap:4px;color:var(--nylas-base-800);margin:0.25rem 0 0 0;font-size:14px;font-weight:400;line-height:20px;text-align:left}.nylas-booking-type .nylas-booking-type__dropdown span.nylas-booking-type__dropdown-label tooltip-component{display:flex}.nylas-booking-type .nylas-booking-type__dropdown select-dropdown::part(sd_dropdown){width:100%}.nylas-booking-type .nylas-booking-type__dropdown select-dropdown::part(sd_dropdown-content){width:100%;max-width:unset}.nylas-booking-type .nylas-booking-type__dropdown select-dropdown::part(sd_dropdown-button){width:100%;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.nylas-booking-type .nylas-booking-type__dropdown select-dropdown::part(sd_dropdown-button-selected-label){max-width:calc(100% - 2rem);font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', Me = Ie;
25
+ var Ue = function(e, i, n, o) {
26
+ var r = arguments.length, a = r < 3 ? i : o === null ? o = Object.getOwnPropertyDescriptor(i, n) : o, l;
27
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
28
+ a = Reflect.decorate(e, i, n, o);
29
+ else
30
+ for (var s = e.length - 1; s >= 0; s--)
31
+ (l = e[s]) && (a = (r < 3 ? l(a) : r > 3 ? l(i, n, a) : l(i, n)) || a);
32
+ return r > 3 && a && Object.defineProperty(i, n, a), a;
33
+ }, Z = function(e, i) {
34
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
35
+ return Reflect.metadata(e, i);
36
+ };
37
+ const Le = class {
38
+ constructor(e) {
39
+ N(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "availability-method", this.selectedConfiguration = void 0, this.participantOptions = void 0, this.selectedBookingType = "";
40
+ }
41
+ connectedCallback() {
42
+ c("nylas-booking-type", "connectedCallback");
43
+ }
44
+ disconnectedCallback() {
45
+ c("nylas-booking-type", "disconnectedCallback");
46
+ }
47
+ componentWillLoad() {
48
+ c("nylas-booking-type", "componentWillLoad"), this.host.setAttribute("name", this.name);
49
+ }
50
+ componentDidLoad() {
51
+ var i, n, o, r;
52
+ c("nylas-booking-type", "componentDidLoad");
53
+ const e = (r = (o = (n = (i = this.selectedConfiguration) == null ? void 0 : i.availability) == null ? void 0 : n.availability_rules) == null ? void 0 : o.availability_method) == null ? void 0 : r.toString();
54
+ e && typeof this.internals.setFormValue == "function" && this.internals.setFormValue(e, "booking-calendar"), this.selectedBookingType = e || "collective", this.valueChanged.emit({ value: this.selectedBookingType, name: this.name });
55
+ }
56
+ componentWillUpdate() {
57
+ c("nylas-booking-type", "componentWillUpdate");
58
+ }
59
+ componentDidUpdate() {
60
+ c("nylas-booking-type", "componentDidUpdate");
61
+ }
62
+ componentWillRender() {
63
+ c("nylas-booking-type", "componentWillRender");
64
+ }
65
+ componentDidRender() {
66
+ c("nylas-booking-type", "componentDidRender");
67
+ }
68
+ elementNameChangedHandler(e) {
69
+ c("nylas-booking-type", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
70
+ }
71
+ nylasFormDropdownChangedHandler(e) {
72
+ c("nylas-booking-type", "nylasFormDropdownChangedHandler", e.detail);
73
+ const i = (n) => {
74
+ const { value: o } = n.detail;
75
+ o && (this.selectedBookingType = o, this.internals.setFormValue(o, this.name));
76
+ };
77
+ this.valueChanged.emit({ value: e.detail.value, name: this.name, valueChanged: i });
78
+ }
79
+ render() {
80
+ var o, r, a, l, s;
81
+ const e = [
82
+ { label: "Standard booking", value: "collective" },
83
+ { label: "Round-robin maximize fairness", value: "max-fairness" },
84
+ { label: "Round-robin maximize availability", value: "max-availability" }
85
+ ], i = (l = (a = (r = (o = this.selectedConfiguration) == null ? void 0 : o.availability) == null ? void 0 : r.availability_rules) == null ? void 0 : a.availability_method) == null ? void 0 : l.toString(), n = this.participantOptions && ((s = this.participantOptions) == null ? void 0 : s.length) > 0 && !!this.participantOptions[0].email && !!this.participantOptions[0].name && !!this.participantOptions[0].calendars && this.participantOptions[0].calendars.length > 0;
86
+ return i || !n ? null : t(q, null, t("div", { class: "nylas-booking-type", part: "nbcp" }, t("div", { class: "header", part: "nbcp__header" }, t("h3", null, "Booking type")), t("div", { class: "nylas-booking-type__dropdown" }, t("span", { class: "nylas-booking-type__dropdown-label" }, "Choose what type of booking is used for this scheduler page.", t("tooltip-component", null, t("info-icon", { slot: "tooltip-icon" }), t("span", { slot: "tooltip-content" }, t("strong", null, "Standard Booking"), t("br", null), "- Allows for 1:1 bookings, or n:1 bookings with additional or collective participants.", t("br", null), t("br", null), t("strong", null, "Round-Robin Maximize Fairness"), t("br", null), "- Rotates through the list of participants you select, displaying the participant with the least bookings.", t("br", null), t("br", null), t("strong", null, "Round-Robin Maximize Availability"), t("br", null), "- Rotates through the list of participants you select, prioritizing participants with the least bookings, but filling up as many time-slots as possible.", t("br", null)))), t("select-dropdown", { name: "booking-calendar", options: e, withSearch: !1, exportparts: "sd_dropdown: nbcp__dropdown, sd_dropdown-button: nbcp__dropdown-button, sd_dropdown-content: nbcp__dropdown-content", defaultSelectedOption: e.find((p) => p.value == i) ?? e[0] }))));
87
+ }
88
+ static get formAssociated() {
89
+ return !0;
90
+ }
91
+ get host() {
92
+ return K(this);
93
+ }
94
+ static get watchers() {
95
+ return {
96
+ name: ["elementNameChangedHandler"]
97
+ };
98
+ }
99
+ };
100
+ Ue([
101
+ Q({
102
+ name: "nylas-booking-type",
103
+ stateToProps: /* @__PURE__ */ new Map([
104
+ ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
105
+ ["schedulerConfig.additionalParticipants", "participantOptions"]
106
+ ]),
107
+ eventToProps: {
108
+ valueChanged: async (e, i) => {
109
+ const { valueChanged: n } = e.detail;
110
+ n && n(e);
111
+ }
112
+ },
113
+ fireRegisterEvent: !0
114
+ }),
115
+ Z("design:type", Function),
116
+ Z("design:paramtypes", []),
117
+ Z("design:returntype", void 0)
118
+ ], Le.prototype, "render", null);
119
+ Le.style = Me;
120
+ function je({ id: e, formState: i, activeTab: n, calendars: o, currentUser: r }) {
121
+ var a, l;
122
+ switch (n) {
123
+ case "eventInfo":
124
+ const s = i.title, p = i.description, f = parseInt(i.duration), C = i.location, S = i.conferencing;
125
+ return t(
126
+ "div",
127
+ { key: e },
128
+ t(
129
+ "nylas-event-info",
130
+ null,
131
+ t(
132
+ "div",
133
+ { slot: "inputs" },
134
+ t("nylas-event-title", { name: "title", eventTitle: s, exportparts: "net, net__title, net__dropdown-content" }),
135
+ t("nylas-event-duration", { name: "duration", eventDurationMinutes: f, exportparts: "ned, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content" }),
136
+ t("nylas-event-location", { name: "location", eventLocation: C, eventConferencing: S, userProvider: r.provider, exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
137
+ t("nylas-event-description", { name: "description", eventDescription: p, exportparts: "nedesc, nedesc__textarea" })
138
+ )
139
+ )
140
+ );
141
+ case "availability":
142
+ const T = i.availability.openHours, F = i.availability.timezone ? i.availability.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone;
143
+ return t(
144
+ "div",
145
+ { key: e },
146
+ t("nylas-participant-booking-calendars", { name: "participant-booking-calendars", participants: i.participants, calendars: o }),
147
+ t("nylas-connected-calendars", { name: "connected-calendars", participants: i.participants }),
148
+ t("nylas-availability-picker", { name: "availability", openHours: T, defaultTimezone: F, exportparts: "nap__header, nap__select-timezone, nap__select-timezone-button, nap__select-timezone-dropdown-content, nap__availability, nap__day, nap__time-ranges, nap__time-range, nap__add-time-range, nap__time-picker-container, nap__time-picker-input, nap__time-picker-times" })
149
+ );
150
+ case "bookingOptions":
151
+ return t(
152
+ "div",
153
+ { key: e },
154
+ t(
155
+ "nylas-custom-booking-flow",
156
+ null,
157
+ t(
158
+ "div",
159
+ { slot: "inputs" },
160
+ t("nylas-booking-confirmation-redirect", { name: "confirmation-redirect", redirectUrl: i.redirectUrl, exportparts: "nbcr, nbcr__header, nbcr__dropdown, nbcr__dropdown-button, nbcr__dropdown-content, nbcr__input-textfield" })
161
+ )
162
+ ),
163
+ t("nylas-buffer-time", { name: "buffer-time", buffer: i.buffer, exportparts: "nbt, nbt__header, nbt__body, nbt__dropdown-before, nbt__dropdown-button-before, nbt__dropdown-content-before, nbt__dropdown-after, nbt__dropdown-button-after, nbt__dropdown-content-after, nbt__preview" }),
164
+ t(
165
+ "nylas-event-limits",
166
+ null,
167
+ t(
168
+ "div",
169
+ { slot: "inputs" },
170
+ t("nylas-min-booking-notice", { name: "min-booking-notice", minBookingNotice: i.minBookingNotice, exportparts: "nmbn, nmbn__number-dropdown, nmbn__number-dropdown-button, nmbn__number-dropdown-content, nmbn__period-dropdown, nmbn__period-dropdown-button, nmbn__period-dropdown-content" }),
171
+ t("nylas-limit-future-bookings", { name: "limit-future-bookings", availableDaysInFuture: i.availableDaysInFuture, exportparts: "nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content" }),
172
+ t("nylas-min-cancellation-notice", { name: "min-cancellation-notice", minCancellationNotice: i.minCancellationNotice, exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" }),
173
+ t("nylas-cancellation-policy", { name: "cancellation-policy", cancellationPolicy: i.cancellationPolicy, exportparts: "ncpolicy, ncpolicy__textarea" })
174
+ )
175
+ ),
176
+ t("nylas-timeslot-interval", { name: "timeslot-interval", eventDurationMinutes: parseInt(i.duration), exportparts: "nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content" }),
177
+ t("nylas-customize-booking-settings", { name: "customize-booking-settings", exportparts: "ncbs, ncbs__header, ncbs__settings, ncbs__settings-div, ncbs__additional_guests, ncbs__cancellation_options, ncbs__rescheduling_options" })
178
+ );
179
+ case "communications":
180
+ return t(
181
+ "div",
182
+ { key: e },
183
+ t(
184
+ "div",
185
+ { class: "tab-header" },
186
+ t("h3", null, "Event communications"),
187
+ t("p", null, "Set up automatic communications for your events.")
188
+ ),
189
+ t("nylas-confirmation-email", { name: "confirmation-email-template", confirmationEmailTemplate: i.emailTemplate, isOpen: !((l = (a = i.reminders) == null ? void 0 : a.overrides) != null && l.length), participants: i.participants, exportparts: "nce, nce__tab-heading, nce__header, nce__body, nce__confirmation-email-toggle--container, nce__summary, nce__reminder-input_dropdown, nce__reminder-input_dropdown-input, nce__reminder-input_dropdown-content" })
190
+ );
191
+ case "participants":
192
+ return t(
193
+ "div",
194
+ { key: e },
195
+ t("nylas-additional-participants", { name: "participants", eventParticipants: i.participants, exportparts: "nap__title, nap__subtitle, nap__content, nap__input_group, nap__input_wrapper, nap__input, nap__remove-participant" }),
196
+ t("nylas-participants-custom-availability", { name: "participant-custom-availability", participants: i.participants, exportparts: "npca, npca__header, npca__content, npca__participant-container, npca__participant-title, npca__participant-toggle--container, npca__toggle-label, npca__toggle-input, npca__toggle-slider" })
197
+ );
198
+ case "bookingForm":
199
+ const L = Object.entries(i.additionalFields).map(([O, g]) => ({ key: O, ...g }));
200
+ return t(
201
+ "div",
202
+ { key: e },
203
+ t("nylas-booking-form-config", { name: "additional-fields", additonalFields: L })
204
+ );
205
+ }
206
+ }
207
+ const Ae = '.sc-nylas-editor-tabs-h{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:554px;display:grid;grid-template-columns:minmax(224px, 25%) 1fr}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{display:table-column-group;height:auto}}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs{display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;color:var(--nylas-base-900);background:var(--nylas-base-0);border:none;height:56px;font-family:var(--nylas-font-family);font-size:16px;font-weight:500;line-height:24px;cursor:pointer}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.active.sc-nylas-editor-tabs{font-weight:600;background:var(--nylas-base-0);color:var(--nylas-primary);border-left:4px solid var(--nylas-primary);box-shadow:0px 1px 2px 0px rgba(0, 0, 0, 0.0588235294);box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1019607843)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.hide.sc-nylas-editor-tabs{display:none}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px;overflow-y:auto}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs{width:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs{display:flex;flex-direction:column;gap:1rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs{display:flex;flex-direction:column;margin:1rem 1rem 0.5rem;row-gap:4px}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs h3.sc-nylas-editor-tabs{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs .tab-header.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{margin:0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.footer.sc-nylas-editor-tabs{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs{flex-direction:column;height:auto}}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .preview.sc-nylas-editor-tabs{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{max-width:524px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.unsaved-changes.sc-nylas-editor-tabs{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.saved-changes.sc-nylas-editor-tabs{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error.sc-nylas-editor-tabs{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error-full-width.sc-nylas-editor-tabs{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button-component.sc-nylas-editor-tabs{width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs span.sc-nylas-editor-tabs{display:flex;align-items:center;justify-content:center;gap:0.5rem}', $e = Ae;
208
+ var Ve = function(e, i, n, o) {
209
+ var r = arguments.length, a = r < 3 ? i : o === null ? o = Object.getOwnPropertyDescriptor(i, n) : o, l;
210
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
211
+ a = Reflect.decorate(e, i, n, o);
212
+ else
213
+ for (var s = e.length - 1; s >= 0; s--)
214
+ (l = e[s]) && (a = (r < 3 ? l(a) : r > 3 ? l(i, n, a) : l(i, n)) || a);
215
+ return r > 3 && a && Object.defineProperty(i, n, a), a;
216
+ }, J = function(e, i) {
217
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
218
+ return Reflect.metadata(e, i);
219
+ };
220
+ const Oe = class {
221
+ constructor(e) {
222
+ N(this, e), this.schedulerConfigChanged = w(this, "schedulerConfigChanged", 7), this.cancelButtonClick = w(this, "cancelButtonClick", 7), this.formSubmitted = w(this, "formSubmitted", 7), this.previewButtonClicked = w(this, "previewButtonClicked", 7), this.schedulerEditorFormUpdated = w(this, "schedulerEditorFormUpdated", 7), this.setError = (i) => {
223
+ this.error = i.message;
224
+ }, this.formSubmissionHandler = async (i) => {
225
+ var X, Y, ee, te, ie, ne, ae, oe, se, re, le, de, ce, be, pe, he;
226
+ if (i.preventDefault(), this.formSubmitted.emit(), !this.formRef.checkValidity()) {
227
+ this.error = this.formRef.validationMessage || "Please fix the form errors.";
228
+ return;
229
+ }
230
+ this.isLoading = !0, this.hasUnsavedChanges = !1;
231
+ const o = this.updateFormState(), { title: r, description: a, duration: l, availability: s, bookingCalendar: p, location: f, bookingType: C, buffer: S, availableDaysInFuture: T, minCancellationNotice: F, minBookingNotice: L, cancellationPolicy: O, timeslotInterval: g, additionalGuestsHidden: R, hideCancellationOptions: z, hideReschedulingOptions: I, participants: _, participantOpenHours: h, additionalFields: M, participantCalendars: m, conferencing: U, participantBookingCalendars: u, reminders: j, emailTemplate: A, redirectUrl: $, availabilityMethod: H } = o, b = ((Y = (X = this.selectedConfiguration) == null ? void 0 : X.participants) == null ? void 0 : Y.find((d) => d.is_organizer)) || (_ == null ? void 0 : _.find((d) => d.is_organizer)), k = m && (b != null && b.email) ? m[b == null ? void 0 : b.email] : [], E = ((ee = b == null ? void 0 : b.booking) == null ? void 0 : ee.calendar_id) || p, B = l ? parseInt(l) : 30, D = _ && (_ == null ? void 0 : _.length) > 0 ? _ : [
232
+ {
233
+ name: (b == null ? void 0 : b.name) ?? ((te = this.currentUser) == null ? void 0 : te.name) ?? "",
234
+ email: (b == null ? void 0 : b.email) ?? ((ie = this.currentUser) == null ? void 0 : ie.email) ?? "",
235
+ is_organizer: !0,
236
+ timezone: (s == null ? void 0 : s.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
237
+ availability: {
238
+ calendar_ids: k.length ? k : ["primary"],
239
+ open_hours: []
240
+ },
241
+ booking: {
242
+ calendar_id: p && p !== "" ? p : "primary"
243
+ }
244
+ }
245
+ ], P = {
246
+ ...((ne = this.selectedConfiguration) == null ? void 0 : ne.id) && { id: this.selectedConfiguration.id },
247
+ version: ((ae = this.selectedConfiguration) == null ? void 0 : ae.version) ?? "1.0.0",
248
+ availability: {
249
+ duration_minutes: B,
250
+ interval_minutes: (g == null ? void 0 : g.interval) ?? B,
251
+ round_to: g == null ? void 0 : g.roundTo,
252
+ availability_rules: {
253
+ availability_method: H || (((re = (se = (oe = this.selectedConfiguration) == null ? void 0 : oe.availability) == null ? void 0 : se.availability_rules) == null ? void 0 : re.availability_method) ?? "collective"),
254
+ buffer: S || { before: 0, after: 0 },
255
+ default_open_hours: (s == null ? void 0 : s.openHours) ?? ((ce = (de = (le = this.selectedConfiguration) == null ? void 0 : le.availability) == null ? void 0 : de.availability_rules) == null ? void 0 : ce.default_open_hours) ?? Fe,
256
+ round_robin_group_id: ((he = (pe = (be = this.selectedConfiguration) == null ? void 0 : be.availability) == null ? void 0 : pe.availability_rules) == null ? void 0 : he.round_robin_group_id) ?? ""
257
+ }
258
+ },
259
+ participants: [
260
+ ...D == null ? void 0 : D.map((d) => {
261
+ var ue, ye, me, fe, ge, _e, ve, we, ke, Ce, xe, Se, Te;
262
+ return d.is_organizer ? {
263
+ name: d.name ?? "",
264
+ email: d.email,
265
+ is_organizer: !0,
266
+ timezone: ((ye = (ue = h == null ? void 0 : h[d.email]) == null ? void 0 : ue[0]) == null ? void 0 : ye.timezone) ?? ((ge = (fe = (me = d.availability) == null ? void 0 : me.open_hours) == null ? void 0 : fe[0]) == null ? void 0 : ge.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
267
+ availability: {
268
+ calendar_ids: m != null && m[d.email] ? m == null ? void 0 : m[d.email] : k != null && k.length ? k : ["primary"],
269
+ open_hours: (h == null ? void 0 : h[d.email]) ?? ((_e = d.availability) == null ? void 0 : _e.open_hours) ?? []
270
+ },
271
+ booking: {
272
+ calendar_id: u != null && u[d.email] ? u == null ? void 0 : u[d.email] : E || "primary"
273
+ }
274
+ } : {
275
+ ...d,
276
+ timezone: ((we = (ve = h == null ? void 0 : h[d.email]) == null ? void 0 : ve[0]) == null ? void 0 : we.timezone) ?? ((xe = (Ce = (ke = d.availability) == null ? void 0 : ke.open_hours) == null ? void 0 : Ce[0]) == null ? void 0 : xe.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
277
+ availability: d.availability ? {
278
+ calendar_ids: (m == null ? void 0 : m[d.email]) ?? ((Se = d.availability) == null ? void 0 : Se.calendar_ids) ?? ["primary"],
279
+ open_hours: (h == null ? void 0 : h[d.email]) ?? ((Te = d.availability) == null ? void 0 : Te.open_hours) ?? []
280
+ } : void 0,
281
+ booking: u != null && u[d.email] ? { calendar_id: u == null ? void 0 : u[d.email] } : (d == null ? void 0 : d.booking) ?? void 0
282
+ };
283
+ })
284
+ ],
285
+ event_booking: {
286
+ title: (r == null ? void 0 : r.toString()) ?? "",
287
+ description: (a == null ? void 0 : a.toString()) ?? "",
288
+ location: (f == null ? void 0 : f.toString()) ?? "",
289
+ booking_type: (C == null ? void 0 : C.toString()) ?? "booking",
290
+ timezone: (s == null ? void 0 : s.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
291
+ conferencing: U,
292
+ reminders: j
293
+ },
294
+ scheduler: {
295
+ cancellation_policy: O ?? "",
296
+ available_days_in_future: T ?? 30,
297
+ min_cancellation_notice: F ?? 0,
298
+ min_booking_notice: L ?? 60,
299
+ hide_additional_guests: R ?? !1,
300
+ hide_cancellation_options: z ?? !1,
301
+ hide_rescheduling_options: I ?? !1,
302
+ additional_fields: M,
303
+ email_template: A,
304
+ confirmation_redirect_url: $
305
+ }
306
+ }, v = He(P, this.selectedConfiguration), y = this.action === "create" ? v : P;
307
+ this.isConfigRoundRobin(y) && (y.participants = y.participants.map((d) => ({ ...d, is_organizer: void 0 })));
308
+ const x = (d) => {
309
+ this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
310
+ this.changesSaved = !1;
311
+ }, 5e3);
312
+ };
313
+ this.checkForClientSideErrors(y) || this.schedulerConfigChanged.emit({ config: y, resetLoadingState: x, setError: this.setError, action: this.action });
314
+ }, this.isConfigRoundRobin = (i) => {
315
+ var n, o, r, a;
316
+ return ((o = (n = i.availability) == null ? void 0 : n.availability_rules) == null ? void 0 : o.availability_method) === "max-availability" || ((a = (r = i.availability) == null ? void 0 : r.availability_rules) == null ? void 0 : a.availability_method) === "max-fairness";
317
+ }, this.checkForClientSideErrors = (i) => {
318
+ var a;
319
+ let n = !1, o = "";
320
+ const r = (a = i.scheduler) == null ? void 0 : a.additional_fields;
321
+ return r && (o = "Booking form error: ", Object.entries(r).forEach((l) => {
322
+ const s = l[1];
323
+ if (s.label === "") {
324
+ o += `Label is required for field of type ${s.type}.`, n = !0;
325
+ return;
326
+ }
327
+ if (s.options) {
328
+ for (const p of s.options)
329
+ if (p === "") {
330
+ o += `Empty option detected inside ${s.label} of type ${s.type}.`, n = !0;
331
+ break;
332
+ }
333
+ }
334
+ })), n && (this.isLoading = !1, this.setError(new Error(o))), n;
335
+ }, this.calendars = void 0, this.selectedConfiguration = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.hideEditorTabs = [], this.action = "create", this.activeTab = "eventInfo", this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
336
+ }
337
+ configChangedHandler(e) {
338
+ c("[nylas-editor-tabs]", "configChangedHandler", e, this.selectedConfiguration), this.formState = {
339
+ ...this.getFormStateFromConfig(e)
340
+ }, e.id ? this.action = "edit" : this.action = "create";
341
+ }
342
+ userChangedHandler(e) {
343
+ c("[nylas-editor-tabs]", "userChangedHandler", e), e && (this.formState = {
344
+ ...this.getFormStateFromConfig(this.selectedConfiguration)
345
+ });
346
+ }
347
+ connectedCallback() {
348
+ c("[nylas-editor-tabs]", "connectedCallback");
349
+ }
350
+ componentWillLoad() {
351
+ c("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
352
+ }
353
+ componentDidLoad() {
354
+ var i;
355
+ c("[nylas-editor-tabs]", "componentDidLoad");
356
+ const e = (i = this.host.querySelector("button.tab:not(.hide)")) == null ? void 0 : i.name;
357
+ e && (this.activeTab = e);
358
+ }
359
+ disconnectedCallback() {
360
+ c("[nylas-editor-tabs]", "disconnectedCallback");
361
+ }
362
+ handleValueChanged(e) {
363
+ c("[nylas-editor-tabs]", "handleValueChanged", e);
364
+ const { name: i, value: n } = e.detail;
365
+ this.setFormState(n, i), this.formState = { ...this.formState }, this.hasUnsavedChanges = !0, this.error = "", this.schedulerEditorFormUpdated.emit({
366
+ value: e.detail.value,
367
+ name: e.detail.name
368
+ });
369
+ }
370
+ getFormStateFromConfig(e) {
371
+ var n, o, r, a, l, s, p, f, C, S, T, F, L, O, g, R, z, I, _, h, M, m, U, u, j, A, $, H, b, k, E, B, D, P;
372
+ let i = (n = e == null ? void 0 : e.participants) == null ? void 0 : n.find((v) => v.is_organizer);
373
+ return !i && ((r = (o = e == null ? void 0 : e.availability) == null ? void 0 : o.availability_rules) == null ? void 0 : r.availability_method) !== "collective" && (i = (a = e == null ? void 0 : e.participants) == null ? void 0 : a.find((v) => {
374
+ var y;
375
+ return v.email === ((y = this.currentUser) == null ? void 0 : y.email);
376
+ }), i && (i.is_organizer = !0)), {
377
+ title: ((l = e == null ? void 0 : e.event_booking) == null ? void 0 : l.title) ?? "",
378
+ description: ((s = e == null ? void 0 : e.event_booking) == null ? void 0 : s.description) ?? "",
379
+ duration: ((f = (p = e == null ? void 0 : e.availability) == null ? void 0 : p.duration_minutes) == null ? void 0 : f.toString()) ?? "30",
380
+ availability: {
381
+ timezone: ((C = e == null ? void 0 : e.event_booking) == null ? void 0 : C.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
382
+ openHours: ((T = (S = e == null ? void 0 : e.availability) == null ? void 0 : S.availability_rules) == null ? void 0 : T.default_open_hours) ?? Fe
383
+ },
384
+ additionalFields: ((F = e == null ? void 0 : e.scheduler) == null ? void 0 : F.additional_fields) ?? {},
385
+ conferencing: ((L = e == null ? void 0 : e.event_booking) == null ? void 0 : L.conferencing) ?? {},
386
+ calendarIds: ((O = i == null ? void 0 : i.availability) == null ? void 0 : O.calendar_ids) ?? [],
387
+ participants: (e == null ? void 0 : e.participants) ?? [],
388
+ bookingCalendar: ((g = i == null ? void 0 : i.booking) == null ? void 0 : g.calendar_id) ?? (i == null ? void 0 : i.email) ?? "",
389
+ location: ((R = e == null ? void 0 : e.event_booking) == null ? void 0 : R.location) ?? "",
390
+ bookingType: ((z = e == null ? void 0 : e.event_booking) == null ? void 0 : z.booking_type) ?? "booking",
391
+ buffer: ((_ = (I = e == null ? void 0 : e.availability) == null ? void 0 : I.availability_rules) == null ? void 0 : _.buffer) ?? { before: 0, after: 0 },
392
+ cancellationPolicy: ((h = e == null ? void 0 : e.scheduler) == null ? void 0 : h.cancellation_policy) ?? "",
393
+ availableDaysInFuture: ((M = e == null ? void 0 : e.scheduler) == null ? void 0 : M.available_days_in_future) ?? 30,
394
+ minCancellationNotice: ((m = e == null ? void 0 : e.scheduler) == null ? void 0 : m.min_cancellation_notice) ?? 0,
395
+ minBookingNotice: ((U = e == null ? void 0 : e.scheduler) == null ? void 0 : U.min_booking_notice) ?? 60,
396
+ timeslotInterval: {
397
+ interval: ((u = e == null ? void 0 : e.availability) == null ? void 0 : u.interval_minutes) ?? ((j = e == null ? void 0 : e.availability) == null ? void 0 : j.duration_minutes),
398
+ roundTo: (A = e == null ? void 0 : e.availability) == null ? void 0 : A.round_to
399
+ },
400
+ additionalGuestsHidden: (($ = e == null ? void 0 : e.scheduler) == null ? void 0 : $.hide_additional_guests) ?? !1,
401
+ hideCancellationOptions: ((H = e == null ? void 0 : e.scheduler) == null ? void 0 : H.hide_cancellation_options) ?? !1,
402
+ hideReschedulingOptions: ((b = e == null ? void 0 : e.scheduler) == null ? void 0 : b.hide_rescheduling_options) ?? !1,
403
+ participantBookingCalendars: ((k = e == null ? void 0 : e.participants) == null ? void 0 : k.reduce((v, y) => {
404
+ var x, V;
405
+ return (x = y.booking) != null && x.calendar_id && (v[y.email] = (V = y.booking) == null ? void 0 : V.calendar_id), v;
406
+ })) ?? {},
407
+ participantCalendars: ((E = e == null ? void 0 : e.participants) == null ? void 0 : E.reduce((v, y) => {
408
+ var x;
409
+ return v[y.email] = (x = y.availability) == null ? void 0 : x.calendar_ids, v;
410
+ }, {})) ?? {},
411
+ reminders: (B = e == null ? void 0 : e.event_booking) == null ? void 0 : B.reminders,
412
+ emailTemplate: (D = e == null ? void 0 : e.scheduler) == null ? void 0 : D.email_template,
413
+ redirectUrl: (P = e == null ? void 0 : e.scheduler) == null ? void 0 : P.confirmation_redirect_url
414
+ };
415
+ }
416
+ setFormState(e, i) {
417
+ switch (i) {
418
+ case "title":
419
+ this.formState.title = e.toString();
420
+ break;
421
+ case "description":
422
+ this.formState.description = e.toString();
423
+ break;
424
+ case "duration":
425
+ this.formState.duration = e.toString();
426
+ break;
427
+ case "availability":
428
+ this.formState.availability = JSON.parse(e.toString());
429
+ break;
430
+ case "participants":
431
+ this.formState.participants = JSON.parse(e.toString());
432
+ break;
433
+ case "booking-calendar":
434
+ this.formState.bookingCalendar = e.toString();
435
+ break;
436
+ case "participant-booking-calendars":
437
+ this.formState.participantBookingCalendars = JSON.parse(e.toString());
438
+ break;
439
+ case "location":
440
+ this.formState.location = e.toString();
441
+ break;
442
+ case "conference":
443
+ this.formState.conferencing = JSON.parse(e.toString());
444
+ break;
445
+ case "booking-type":
446
+ this.formState.bookingType = e.toString();
447
+ break;
448
+ case "buffer-time":
449
+ this.formState.buffer = JSON.parse(e.toString());
450
+ break;
451
+ case "limit-future-bookings":
452
+ this.formState.availableDaysInFuture = parseInt(e.toString());
453
+ break;
454
+ case "min-cancellation-notice":
455
+ this.formState.minCancellationNotice = parseInt(e.toString());
456
+ break;
457
+ case "min-booking-notice":
458
+ this.formState.minBookingNotice = parseInt(e.toString());
459
+ break;
460
+ case "cancellation-policy":
461
+ this.formState.cancellationPolicy = e.toString();
462
+ break;
463
+ case "timeslot-interval":
464
+ this.formState.timeslotInterval = JSON.parse(e.toString());
465
+ break;
466
+ case "customize-booking-settings":
467
+ const n = JSON.parse(e.toString());
468
+ this.formState.additionalGuestsHidden = n.additionalGuestsHidden, this.formState.hideCancellationOptions = n.hideCancellationOptions, this.formState.hideReschedulingOptions = n.hideReschedulingOptions;
469
+ break;
470
+ case "participant-custom-availability":
471
+ const o = JSON.parse(e.toString());
472
+ this.formState.participantOpenHours = o;
473
+ break;
474
+ case "additional-fields":
475
+ this.formState.additionalFields = e;
476
+ break;
477
+ case "connected-calendars":
478
+ this.formState.participantCalendars = JSON.parse(e.toString());
479
+ break;
480
+ case "confirmation-email-template":
481
+ this.formState.emailTemplate = JSON.parse(e.toString());
482
+ break;
483
+ case "reminder-overrides":
484
+ this.formState.reminders = { overrides: JSON.parse(e.toString()) };
485
+ break;
486
+ case "confirmation-redirect":
487
+ this.formState.redirectUrl = e.toString();
488
+ break;
489
+ case "availability-method":
490
+ this.formState.availabilityMethod = e.toString();
491
+ break;
492
+ }
493
+ this.schedulerEditorFormUpdated.emit({
494
+ value: e,
495
+ name: i
496
+ });
497
+ }
498
+ updateFormState() {
499
+ return new FormData(this.formRef).forEach((i, n) => {
500
+ this.setFormState(i, n);
501
+ }), this.formState = { ...this.formState }, this.formState;
502
+ }
503
+ setActiveTab(e, i) {
504
+ e.preventDefault(), this.updateFormState(), this.activeTab = i;
505
+ }
506
+ hideTab(e) {
507
+ var i;
508
+ return ((i = this.hideEditorTabs) == null ? void 0 : i.includes(e)) || !1;
509
+ }
510
+ render() {
511
+ var e, i;
512
+ return c("[nylas-editor-tabs]", "render", this.formState), t(q, { key: "5f7372d88ae1d3dacfffbb620a9de2e79adda2b6" }, t("form", { key: "8be826e8178f6667455bece8f950613c0456fc12", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (n) => this.formRef = n, noValidate: !0 }, this.mode === "app" ? t("div", { class: "form-contents" }, t("div", { class: "tabs" }, t("button", { name: "eventInfo", class: { tab: !0, active: this.activeTab == "eventInfo", hide: this.hideTab("eventInfo") }, part: "editortab__event-info", onClick: (n) => this.setActiveTab(n, "eventInfo") }, t("calendar-info-icon", { width: "16", height: "16" }), "Event info"), t("button", { name: "availability", class: { tab: !0, active: this.activeTab == "availability", hide: this.hideTab("availability") }, part: "editortab__availability", onClick: (n) => this.setActiveTab(n, "availability") }, t("calendar-patterns-icon", { width: "16", height: "16" }), "Availability"), t("button", { name: "participants", class: { tab: !0, active: this.activeTab == "participants", hide: this.hideTab("participants") }, part: "editortab__participants", onClick: (n) => this.setActiveTab(n, "participants") }, t("people-icon", { width: "16", height: "16" }), "Participants"), t("button", { name: "bookingOptions", class: { tab: !0, active: this.activeTab == "bookingOptions", hide: this.hideTab("bookingOptions") }, part: "editortab__booking-options", onClick: (n) => this.setActiveTab(n, "bookingOptions") }, t("flow-icon", { width: "16", height: "16" }), "Booking options"), t("button", { name: "bookingForm", class: { tab: !0, active: this.activeTab == "bookingForm", hide: this.hideTab("bookingForm") }, part: "editortab__booking-form", onClick: (n) => this.setActiveTab(n, "bookingForm") }, this.activeTab == "bookingForm" ? t("calendar-agenda-fill-icon", { width: "16", height: "16" }) : t("calendar-agenda-icon", { width: "16", height: "16" }), "Booking form"), t("button", { name: "communications", class: { tab: !0, active: this.activeTab == "communications" }, onClick: (n) => this.setActiveTab(n, "communications") }, this.activeTab == "communications" ? t("envelope-fill-icon", { width: "16", height: "16" }) : t("envelope-icon", { width: "16", height: "16" }), "Communications")), t("div", { class: "tab-content" }, t(je, { formState: this.formState, activeTab: this.activeTab, currentUser: this.currentUser, calendars: this.calendars, id: ((e = this.selectedConfiguration) == null ? void 0 : e.id) ?? "new" }))) : t("div", { key: (i = this.selectedConfiguration) == null ? void 0 : i.id }, t("slot", null)), t("div", { key: "6cf0a5f270552a0fb91b9ead274c93b1bfc086a3", class: "footer", part: "editor__footer" }, t("div", { key: "73c5f3708e16589f8546692a1b7df791cc53363b", class: "preview", part: "editor__footer-preview" }, this.schedulerPreviewLink !== "" && this.action === "edit" && t("button-component", { type: "button", disabled: this.isLoading, clickHandler: (n) => {
513
+ n.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(G(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
514
+ }, variant: "basic" }, "Preview")), t("div", { key: "8a4ef95bc9779438601c853d117b588a586606f5", class: "buttons", part: "editor__footer-buttons" }, t("p", { key: "5e09184856da0e5eb851e34d673addc921c6bc85", class: {
515
+ "unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
516
+ "saved-changes": this.changesSaved,
517
+ error: this.error !== "",
518
+ "error-full-width": this.error !== "" && this.action === "create"
519
+ } }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.error == "" && this.changesSaved ? "Changes saved!" : ""), t("button-component", { key: "f1e201a19bef90ff09cd274d4cee79457b7dfd81", type: "button", disabled: this.isLoading, clickHandler: (n) => {
520
+ n.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
521
+ }, variant: "basic", part: "editor__footer-cancel" }, "Back"), t("button-component", { key: "7f37733c28d27f9f202a917ec155d2b3b0b53b2a", type: "submit", disabled: this.isLoading, part: "editor__footer-cta" }, this.isLoading ? t("span", null, "Saving", t("loading-icon", null), " ") : this.action == "create" ? "Create" : "Save changes")))));
522
+ }
523
+ get host() {
524
+ return K(this);
525
+ }
526
+ static get watchers() {
527
+ return {
528
+ selectedConfiguration: ["configChangedHandler"],
529
+ currentUser: ["userChangedHandler"]
530
+ };
531
+ }
532
+ };
533
+ Ve([
534
+ Q({
535
+ name: "nylas-editor-tabs",
536
+ stateToProps: /* @__PURE__ */ new Map([
537
+ ["schedulerConfig.calendars", "calendars"],
538
+ ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
539
+ ["schedulerConfig.currentUser", "currentUser"],
540
+ ["schedulerConfig.hideEditorTabs", "hideEditorTabs"]
541
+ ]),
542
+ eventToProps: {
543
+ schedulerConfigChanged: async (e, i) => {
544
+ const { resetLoadingState: n, setError: o, action: r, config: a } = e.detail, l = (s) => {
545
+ const [p, f] = s;
546
+ !p && f && o && o(f), n && n(e);
547
+ };
548
+ if (r === "edit") {
549
+ const s = await i.schedulerConfig.updateConfiguration(a);
550
+ l(s);
551
+ } else {
552
+ const s = await i.schedulerConfig.createConfiguration(a);
553
+ l(s);
554
+ }
555
+ },
556
+ cancelButtonClick: async (e, i) => {
557
+ i.schedulerConfigStore.state.action = null;
558
+ },
559
+ previewButtonClicked: async (e, i) => {
560
+ c("[nylas-editor-tabs]", "previewButtonClicked", i);
561
+ },
562
+ formSubmitted: async (e, i) => {
563
+ c("[nylas-editor-tabs]", "formSubmitted", i);
564
+ },
565
+ schedulerEditorFormUpdated: async (e, i) => {
566
+ c("[nylas-editor-tabs]", "schedulerEditorFormUpdated", e);
567
+ }
568
+ },
569
+ localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
570
+ fireRegisterEvent: !0
571
+ }),
572
+ J("design:type", Function),
573
+ J("design:paramtypes", []),
574
+ J("design:returntype", void 0)
575
+ ], Oe.prototype, "render", null);
576
+ Oe.style = $e;
577
+ const Ze = ':host{display:grid;grid-auto-flow:row;width:100%;font-family:inherit;font-optical-sizing:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;gap:1rem}@media screen and (max-width: 768px){.header{flex-direction:column;gap:0.5rem;align-items:unset}}.header h2{margin:0;font-size:1.25rem;color:var(--nylas-base-900);font-weight:600}.header p{margin:0;font-size:1rem;color:var(--nylas-base-700)}.header .actions{justify-self:end}@media screen and (max-width: 768px){.header .actions{width:100%}}.configurations{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-0);height:100%;display:flex;flex-direction:column;position:relative;overflow-y:auto}.configurations table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations table.no-configurations{height:100%}.configurations table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations table tr.hide{display:none}.configurations table th{font-weight:600;text-transform:uppercase;font-size:14px;line-height:20px}.configurations table th.actions-header{text-align:right}.configurations table tr.no-configurations td>div{display:flex;height:100%;justify-content:center;align-items:center;flex-direction:column;padding:var(--nylas-border-radius-3x)}.configurations table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations table th,.configurations table td{text-align:left;padding:1rem;font-family:inherit}.configurations table .actions{text-align:right}.configurations table .actions{display:flex;justify-content:flex-end;gap:1rem}@media screen and (max-width: 768px){.configurations table .actions{flex-direction:column;gap:0.5rem}}.configurations table .title{width:100%;max-width:300px}@media screen and (max-width: 768px){.configurations table .title{max-width:96px}}.configurations table .title div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.configurations table .title div.config-event-title{font-weight:600}.configurations table .title div.config-event-description{font-size:0.75rem}.configurations .pagination{padding:1rem;position:sticky;top:100%;display:flex;justify-content:flex-end;gap:0.5rem;background:white;width:calc(100% - 2rem);z-index:2}.configurations .pagination td.arrows{display:flex;justify-content:flex-end;gap:0.5rem}.configurations .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);border:1px solid var(--nylas-base-300);background-color:transparent;color:var(--nylas-base-800);cursor:pointer}.configurations .pagination button:hover:not(:disabled){border:1px solid var(--nylas-primary)}.configurations .pagination button:active{border:1px solid var(--nylas-base-800)}.configurations .pagination button:disabled{border:1px solid var(--nylas-base-100);background-color:transparent;color:var(--nylas-base-300);cursor:not-allowed}.configurations .pagination button.right{transform:rotate(180deg)}.error-container{margin-top:1.5rem}.error-container .error{color:var(--nylas-error);padding:0.5rem 0;margin:1rem 0 0}button-component#copy button{width:108px}select-dropdown{width:auto}select-dropdown::part(sd_dropdown-button){display:block;height:48px;padding:0px 16px 8px}@media screen and (max-width: 768px){select-dropdown::part(sd_dropdown-button){width:92px}}select-dropdown::part(sd_dropdown-content){width:120px;right:0}select-dropdown::part(sd_dropdown-labelhtml){display:flex;gap:0.5rem;align-items:center;color:var(--nylas-base-900)}select-dropdown::part(sd_dropdown-labelhtml):hover{color:var(--nylas-primary)}', Je = Ze;
578
+ var We = function(e, i, n, o) {
579
+ var r = arguments.length, a = r < 3 ? i : o === null ? o = Object.getOwnPropertyDescriptor(i, n) : o, l;
580
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
581
+ a = Reflect.decorate(e, i, n, o);
582
+ else
583
+ for (var s = e.length - 1; s >= 0; s--)
584
+ (l = e[s]) && (a = (r < 3 ? l(a) : r > 3 ? l(i, n, a) : l(i, n)) || a);
585
+ return r > 3 && a && Object.defineProperty(i, n, a), a;
586
+ }, W = function(e, i) {
587
+ if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
588
+ return Reflect.metadata(e, i);
589
+ };
590
+ const De = class {
591
+ constructor(e) {
592
+ N(this, e), this.initListConfigurations = w(this, "initListConfigurations", 7), this.createButtonClick = w(this, "createButtonClick", 7), this.editButtonClick = w(this, "editButtonClick", 7), this.deleteButtonClick = w(this, "deleteButtonClick", 7), this.configurations = [], this.schedulerPreviewLink = "", this.listConfigurationsNextCursor = void 0, this.state = "loading", this.error = "", this.currentCursor = null, this.previousCursors = [], this.disableNextPageButton = !1;
593
+ }
594
+ listConfigurationsNextCursorChangedHandler(e, i) {
595
+ if (!e || e === i) {
596
+ e === null && (this.disableNextPageButton = !0);
597
+ return;
598
+ }
599
+ this.disableNextPageButton = !1, this.currentCursor = e;
600
+ }
601
+ connectedCallback() {
602
+ c("[nylas-list-configurations]", "connectedCallback");
603
+ }
604
+ componentWillLoad() {
605
+ c("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
606
+ }
607
+ componentDidLoad() {
608
+ c("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit({
609
+ host: this.host
610
+ });
611
+ }
612
+ disconnectedCallback() {
613
+ c("[nylas-list-configurations]", "disconnectedCallback");
614
+ }
615
+ async handleNylasFormDropdownChanged(e) {
616
+ c("[nylas-list-configurations]", "handleNylasFormDropdownChanged", e.detail);
617
+ const { value: i } = e.detail, [n, o] = i.split("-");
618
+ switch (e.preventDefault(), n) {
619
+ case "delete":
620
+ this.deleteButtonClick.emit({ host: this.host, configuration: this.configurations[o] });
621
+ break;
622
+ case "preview":
623
+ window.open(G(this.schedulerPreviewLink, this.configurations[o]), "_blank");
624
+ break;
625
+ case "copy":
626
+ await navigator.clipboard.writeText(G(this.schedulerPreviewLink, this.configurations[o]));
627
+ break;
628
+ }
629
+ }
630
+ async getState() {
631
+ return this.state;
632
+ }
633
+ async setState(e) {
634
+ this.state = e;
635
+ }
636
+ async setError(e) {
637
+ this.error = e;
638
+ }
639
+ getDurationString(e) {
640
+ const i = Math.floor(e / 60), n = e % 60;
641
+ return `${i || ""} ${i ? `${i > 1 ? "hours" : "hour"}` : ""} ${n || ""} ${n ? `${n > 1 ? "mins" : "min"}` : ""}`;
642
+ }
643
+ getActionLabelHTML(e) {
644
+ const i = {
645
+ display: "inline-flex",
646
+ alignItems: "center",
647
+ gap: "0.5rem"
648
+ }, n = {
649
+ color: "var(--nylas-error)"
650
+ };
651
+ switch (e) {
652
+ case "preview":
653
+ return t("span", { style: i }, t("eye-icon", { width: "16", height: "16" }), "Preview");
654
+ case "copy":
655
+ return t("span", { style: i }, t("copy-icon", { width: "16", height: "16" }), "Copy");
656
+ case "delete":
657
+ return t("span", { style: { ...i, ...n } }, t("delete-icon", { width: "15", height: "17" }), "Delete");
658
+ default:
659
+ return "";
660
+ }
661
+ }
662
+ previousPageClickedHandler() {
663
+ if (this.previousCursors.length === 0)
664
+ return;
665
+ this.currentCursor = this.previousCursors.pop() || null;
666
+ const e = this.previousCursors[this.previousCursors.length - 1] || void 0;
667
+ this.initListConfigurations.emit({
668
+ host: this.host,
669
+ cursor: e
670
+ });
671
+ }
672
+ nextPageClickedHandler() {
673
+ this.currentCursor && (this.previousCursors = [...this.previousCursors, this.currentCursor], this.initListConfigurations.emit({
674
+ host: this.host,
675
+ cursor: this.currentCursor
676
+ }));
677
+ }
678
+ render() {
679
+ return t(q, null, t("div", { class: "header" }, t("div", { class: "description" }, t("h2", null, "All scheduling pages"), t("p", null, "Create, edit and manage all your scheduling pages.")), this.configurations && this.configurations.length > 0 && t("div", { class: "actions" }, t("button-component", { clickHandler: () => {
680
+ this.createButtonClick.emit(this.host);
681
+ } }, "Create new"))), t("div", { class: "configurations" }, t("table", { class: {
682
+ "no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
683
+ } }, t("tr", { class: {
684
+ hide: this.state === "loading" || this.configurations && this.configurations.length === 0
685
+ } }, t("th", null, "Scheduling page title"), t("th", null, "Duration"), t("th", { class: "actions-header" }, "Actions")), this.state === "loading" && t("tr", { class: "no-configurations" }, t("td", { colSpan: 3 }, t("div", null, t("h3", null, "Loading..."), t("p", null, "Please wait while we fetch the scheduling pages")))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && t("tr", { class: "no-configurations" }, t("td", { colSpan: 3 }, t("div", null, t("calendar-icon", { width: "48", height: "48" }), t("h3", null, "No scheduling pages found"), t("p", null, "Get started with creating your first scheduling page"), t("button-component", { clickHandler: () => {
686
+ this.createButtonClick.emit(this.host);
687
+ } }, "Create new")))), this.state !== "loading" && this.configurations.map((e, i) => t("tr", { key: e.id }, t("td", null, t("div", { class: "title" }, t("div", { class: "config-event-title", title: e.event_booking.title }, e.event_booking.title), t("div", { class: "config-event-description" }, e.event_booking.description))), t("td", null, t("div", { class: "duration" }, this.getDurationString(e.availability.duration_minutes))), t("td", null, t("div", { class: "actions" }, t("button-component", { variant: "basic", key: `edit-${i}`, clickHandler: (n) => {
688
+ n.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: e });
689
+ } }, t("edit-icon", { width: "16", height: "16" }), "Edit"), t("select-dropdown", { name: "actions", options: [
690
+ { value: `preview-${i}`, label: "Preview", labelHTML: this.getActionLabelHTML("preview") },
691
+ { value: `copy-${i}`, label: "Copy link", labelHTML: this.getActionLabelHTML("copy") },
692
+ { value: `delete-${i}`, label: "Delete", labelHTML: this.getActionLabelHTML("delete") }
693
+ ], defaultSelectedOption: { value: "", label: "" }, dropdownButtonText: "...", withSearch: !1, withChevron: !1, exportparts: "sd_dropdown: actions__dropdown, sd_dropdown-button: actions__dropdown-button, sd_dropdown-content: actions__dropdown-content" })))))), t("div", { class: "pagination" }, t("button", { class: "arrow left", onClick: () => this.previousPageClickedHandler(), disabled: this.previousCursors.length <= 0 }, t("chevron-icon", null)), t("button", { class: "arrow right", onClick: () => this.nextPageClickedHandler(), disabled: this.disableNextPageButton }, t("chevron-icon", null)))), this.state === "error" && t("div", { class: "error-container" }, t("p", { class: "error" }, this.error)));
694
+ }
695
+ get host() {
696
+ return K(this);
697
+ }
698
+ static get watchers() {
699
+ return {
700
+ listConfigurationsNextCursor: ["listConfigurationsNextCursorChangedHandler"]
701
+ };
702
+ }
703
+ };
704
+ We([
705
+ Q({
706
+ name: "nylas-list-configurations",
707
+ stateToProps: /* @__PURE__ */ new Map([
708
+ ["schedulerConfig.configurations", "configurations"],
709
+ ["schedulerConfig.listConfigurationsNextCursor", "listConfigurationsNextCursor"]
710
+ ]),
711
+ localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
712
+ eventToProps: {
713
+ initListConfigurations: async (e, i) => {
714
+ const { host: n, cursor: o } = e.detail;
715
+ await n.setState("loading");
716
+ const [r, a] = await i.schedulerConfig.getConfigurations(o);
717
+ if (!r && a && a.message) {
718
+ await n.setState("error"), await n.setError(a.message);
719
+ return;
720
+ }
721
+ await n.setState("loaded");
722
+ },
723
+ createButtonClick: async (e, i) => {
724
+ i.schedulerConfigStore.resetSelectedConfiguration(), i.schedulerConfigStore.state.action = "create";
725
+ },
726
+ deleteButtonClick: async (e, i) => {
727
+ const { host: n, configuration: o } = e.detail, [r, a] = await i.schedulerConfig.deleteConfiguration(o.id);
728
+ !r && a && a.message && (await n.setState("error"), await n.setError(a.message));
729
+ },
730
+ editButtonClick: async (e, i) => {
731
+ const { configuration: n } = e.detail;
732
+ i.schedulerConfigStore.state.selectedConfiguration = n, i.schedulerConfigStore.state.action = "edit";
733
+ }
734
+ },
735
+ fireRegisterEvent: !0
736
+ }),
737
+ W("design:type", Function),
738
+ W("design:paramtypes", []),
739
+ W("design:returntype", void 0)
740
+ ], De.prototype, "render", null);
741
+ De.style = Je;
742
+ export {
743
+ Pe as google_logo_icon,
744
+ ze as microsoft_logo_icon,
745
+ Le as nylas_booking_type,
746
+ Oe as nylas_editor_tabs,
747
+ De as nylas_list_configurations
748
+ };