@nylas/react 1.1.0-canary.8 → 1.1.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 (156) hide show
  1. package/README.md +110 -2
  2. package/dist/add-circle-icon_2.entry-7165bd0e.js +25 -0
  3. package/dist/add-circle-icon_2.entry-f1ddca18.cjs +1 -0
  4. package/dist/{archive-icon_7.entry-e2954750.js → archive-icon_7.entry-7411c224.js} +16 -16
  5. package/dist/archive-icon_7.entry-e3df60ed.cjs +1 -0
  6. package/dist/{arrow-icon.entry-548b027e.cjs → arrow-icon.entry-280e18b0.cjs} +1 -1
  7. package/dist/{arrow-icon.entry-03a85113.js → arrow-icon.entry-38949317.js} +4 -4
  8. package/dist/{bold-icon_3.entry-70ffa7f0.js → bold-icon_3.entry-5963945c.js} +4 -4
  9. package/dist/{bold-icon_3.entry-9a7b1869.cjs → bold-icon_3.entry-5dffbedd.cjs} +1 -1
  10. package/dist/button-component_2.entry-237733b4.js +26 -0
  11. package/dist/button-component_2.entry-b29d2873.cjs +1 -0
  12. package/dist/calendar-agenda-fill-icon_48.entry-9afba869.js +5105 -0
  13. package/dist/calendar-agenda-fill-icon_48.entry-d3830dbb.cjs +7 -0
  14. package/dist/{calendar-cancel-icon.entry-45388fdc.cjs → calendar-cancel-icon.entry-77ccf227.cjs} +1 -1
  15. package/dist/{calendar-cancel-icon.entry-6bbc119f.js → calendar-cancel-icon.entry-780723a6.js} +5 -5
  16. package/dist/{calendar-check-icon_2.entry-f633f7a6.js → calendar-check-icon_2.entry-2c89c230.js} +7 -7
  17. package/dist/{calendar-check-icon_2.entry-6628456c.cjs → calendar-check-icon_2.entry-b37ac7f0.cjs} +1 -1
  18. package/dist/{calendar-icon.entry-62b82c27.js → calendar-icon.entry-02dd3990.js} +4 -4
  19. package/dist/{calendar-icon.entry-379b1fa1.cjs → calendar-icon.entry-ffc93569.cjs} +1 -1
  20. package/dist/checkbox-component_2.entry-00b6a1e9.cjs +1 -0
  21. package/dist/checkbox-component_2.entry-ee9d0e6c.js +56 -0
  22. package/dist/chevron-icon_3.entry-468abc26.cjs +1 -0
  23. package/dist/chevron-icon_3.entry-f62e9ef1.js +129 -0
  24. package/dist/clock-icon_4.entry-766a1b23.js +45 -0
  25. package/dist/clock-icon_4.entry-7dc2cc4a.cjs +1 -0
  26. package/dist/{constants-f34b9c6e-95a17764.js → constants-50c3e067-8a40a5fe.js} +885 -751
  27. package/dist/{constants-f34b9c6e-e7137e51.cjs → constants-50c3e067-9f2a6372.cjs} +5 -5
  28. package/dist/copy-icon.entry-2a841508.js +15 -0
  29. package/dist/copy-icon.entry-e5251410.cjs +1 -0
  30. package/dist/delete-icon_2.entry-1a5c39dc.cjs +1 -0
  31. package/dist/delete-icon_2.entry-64555a2f.js +25 -0
  32. package/dist/{document-refresh-icon.entry-32c75418.js → document-refresh-icon.entry-4bf6398b.js} +4 -4
  33. package/dist/document-refresh-icon.entry-fdc7ddda.cjs +1 -0
  34. package/dist/elements/index.d.ts +47 -1
  35. package/dist/{elements-dc5b338e-62fe1cf3.js → elements-dc5b338e-2da1fe61.js} +1 -1
  36. package/dist/{elements-dc5b338e-1f23530f.cjs → elements-dc5b338e-c8016c3d.cjs} +1 -1
  37. package/dist/{focus-visible-e8093c16-f0f05815.cjs → focus-visible-e8093c16-0a38a184.cjs} +1 -1
  38. package/dist/{focus-visible-e8093c16-1f664070.js → focus-visible-e8093c16-9d0c98c0.js} +1 -1
  39. package/dist/{forward-icon_6.entry-7fab04d7.js → forward-icon_6.entry-390ef70a.js} +9 -9
  40. package/dist/{forward-icon_6.entry-ef5e2e0f.cjs → forward-icon_6.entry-7238ef38.cjs} +3 -3
  41. package/dist/{globe-icon.entry-398a9826.cjs → globe-icon.entry-81f42f89.cjs} +1 -1
  42. package/dist/{globe-icon.entry-b8e1efae.js → globe-icon.entry-8d106260.js} +5 -5
  43. package/dist/google-logo-icon_4.entry-aabd3886.js +680 -0
  44. package/dist/google-logo-icon_4.entry-fa2b8999.cjs +1 -0
  45. package/dist/index-53420959-5fc8ad2b.js +5 -0
  46. package/dist/index-53420959-fcf45780.cjs +1 -0
  47. package/dist/index-5ccfd9df.js +7859 -0
  48. package/dist/index-6d9eeb53-58c8980a.js +4971 -0
  49. package/dist/index-6d9eeb53-b2a6d09f.cjs +41 -0
  50. package/dist/index-eb33703c.cjs +42 -0
  51. package/dist/{index.es-df564f87-b773d34f.js → index.es-c9454237-00ccd1e6.js} +6 -8
  52. package/dist/{index.es-df564f87-e4a4092a.cjs → index.es-c9454237-b64161d1.cjs} +6 -6
  53. package/dist/{info-icon_2.entry-2eb70f49.cjs → info-icon_2.entry-b2e11336.cjs} +1 -1
  54. package/dist/{info-icon_2.entry-6bbfa6dc.js → info-icon_2.entry-bb8ed71c.js} +3 -3
  55. package/dist/input-component.entry-378b1ccc.cjs +1 -0
  56. package/dist/input-component.entry-cb86170f.js +65 -0
  57. package/dist/input-dropdown.entry-98954c93.cjs +1 -0
  58. package/dist/input-dropdown.entry-a76c339e.js +134 -0
  59. package/dist/{mailbox-store-69c5c5f6-631eddb5.cjs → mailbox-store-edc386fc-156b7236.cjs} +1 -1
  60. package/dist/{mailbox-store-69c5c5f6-8ab4670b.js → mailbox-store-edc386fc-8bc7558b.js} +2 -2
  61. package/dist/multi-select-dropdown.entry-40b855e1.cjs +1 -0
  62. package/dist/multi-select-dropdown.entry-6b686695.js +91 -0
  63. package/dist/nylas-booked-event-card_12.entry-9d693125.cjs +1 -0
  64. package/dist/nylas-booked-event-card_12.entry-e861bb16.js +1134 -0
  65. package/dist/nylas-form-card.entry-b158d789.js +57 -0
  66. package/dist/nylas-form-card.entry-ca4a8746.cjs +1 -0
  67. package/dist/{nylas-if-state.entry-f8abd025.js → nylas-if-state.entry-8e4d922c.js} +8 -8
  68. package/dist/{nylas-if-state.entry-276d61ad.cjs → nylas-if-state.entry-95fac42d.cjs} +1 -1
  69. package/dist/{nylas-list-folders.entry-78cc680e.js → nylas-list-folders.entry-83c39684.js} +8 -8
  70. package/dist/{nylas-list-folders.entry-afe02f0e.cjs → nylas-list-folders.entry-8a22e0c8.cjs} +1 -1
  71. package/dist/{nylas-list-threads.entry-6395c12f.cjs → nylas-list-threads.entry-54c582af.cjs} +1 -1
  72. package/dist/{nylas-list-threads.entry-217088de.js → nylas-list-threads.entry-7ea370e1.js} +4 -4
  73. package/dist/{nylas-login.entry-e4d57589.js → nylas-login.entry-9115fd81.js} +7 -7
  74. package/dist/{nylas-login.entry-ec81e21b.cjs → nylas-login.entry-fb627e40.cjs} +1 -1
  75. package/dist/{nylas-mailbox-pagination.entry-d4d929f1.cjs → nylas-mailbox-pagination.entry-04626d27.cjs} +1 -1
  76. package/dist/{nylas-mailbox-pagination.entry-069673aa.js → nylas-mailbox-pagination.entry-3ff02cf9.js} +2 -2
  77. package/dist/{nylas-mailbox-toolbar-button.entry-2b9e4431.cjs → nylas-mailbox-toolbar-button.entry-8d00c789.cjs} +1 -1
  78. package/dist/{nylas-mailbox-toolbar-button.entry-03c5f5c8.js → nylas-mailbox-toolbar-button.entry-f752e925.js} +4 -4
  79. package/dist/{nylas-mailbox.entry-7e6b4791.js → nylas-mailbox.entry-99c27b6c.js} +4 -4
  80. package/dist/{nylas-mailbox.entry-1342178d.cjs → nylas-mailbox.entry-b3974f4e.cjs} +1 -1
  81. package/dist/{nylas-provider.entry-0ae8e70a.cjs → nylas-provider.entry-a3ad02a5.cjs} +1 -1
  82. package/dist/{nylas-provider.entry-498a7be9.js → nylas-provider.entry-c206aa32.js} +39 -39
  83. package/dist/nylas-reminder-emails.entry-414ce6fe.js +129 -0
  84. package/dist/nylas-reminder-emails.entry-59c07bfe.cjs +4 -0
  85. package/dist/nylas-reminder-time_2.entry-197d83a0.js +105 -0
  86. package/dist/nylas-reminder-time_2.entry-d79dcd85.cjs +1 -0
  87. package/dist/nylas-scheduler-editor.entry-7f389982.js +1447 -0
  88. package/dist/nylas-scheduler-editor.entry-f1c6964a.cjs +2 -0
  89. package/dist/nylas-scheduling.entry-1a8bd6fc.cjs +1 -0
  90. package/dist/nylas-scheduling.entry-4fa5381d.js +345 -0
  91. package/dist/{nylas-threads-refresh.entry-fc2d8028.js → nylas-threads-refresh.entry-20602e7b.js} +4 -4
  92. package/dist/{nylas-threads-refresh.entry-d020c89e.cjs → nylas-threads-refresh.entry-56b53449.cjs} +1 -1
  93. package/dist/{nylas-threads-search.entry-f92f7e30.js → nylas-threads-search.entry-8872473c.js} +12 -12
  94. package/dist/{nylas-threads-search.entry-0abcbc10.cjs → nylas-threads-search.entry-8e0ec3ae.cjs} +1 -1
  95. package/dist/nylas-time-window-picker.entry-9ac542b7.js +316 -0
  96. package/dist/nylas-time-window-picker.entry-ca47f721.cjs +1 -0
  97. package/dist/{nylas-view-thread.entry-56080c89.cjs → nylas-view-thread.entry-1f758e43.cjs} +1 -1
  98. package/dist/{nylas-view-thread.entry-2f1474cf.js → nylas-view-thread.entry-dcd3d5be.js} +6 -6
  99. package/dist/person-icon.entry-63b28ace.cjs +1 -0
  100. package/dist/person-icon.entry-93130c05.js +15 -0
  101. package/dist/{play-icon_2.entry-24ffa01f.js → play-icon_2.entry-6a99c32d.js} +6 -6
  102. package/dist/play-icon_2.entry-b67fb649.cjs +1 -0
  103. package/dist/react.cjs +1 -1
  104. package/dist/react.js +136 -90
  105. package/dist/{refresh-icon.entry-8395104b.js → refresh-icon.entry-84783c91.js} +4 -4
  106. package/dist/{refresh-icon.entry-cf4416b8.cjs → refresh-icon.entry-b49792fc.cjs} +1 -1
  107. package/dist/{register-component-b9cfcbaf-d40e1f3c.cjs → register-component-887199a9-003f96c5.cjs} +1 -1
  108. package/dist/{register-component-b9cfcbaf-c0147194.js → register-component-887199a9-b41dfa7a.js} +1 -1
  109. package/dist/scheduler-config-store-2a3b403d-73610089.js +27 -0
  110. package/dist/scheduler-config-store-2a3b403d-a5e3433a.cjs +1 -0
  111. package/dist/scheduler-store-fe281404-bddb1b6a.js +469 -0
  112. package/dist/scheduler-store-fe281404-c3e477f6.cjs +1 -0
  113. package/dist/textarea-component.entry-28c4bc05.cjs +1 -0
  114. package/dist/textarea-component.entry-40e959e5.js +36 -0
  115. package/dist/time-period-selector.entry-af71523a.cjs +1 -0
  116. package/dist/time-period-selector.entry-da5d8652.js +93 -0
  117. package/dist/{translate-icon.entry-d847f706.js → translate-icon.entry-92b83635.js} +5 -5
  118. package/dist/{translate-icon.entry-66533238.cjs → translate-icon.entry-a2ed4f76.cjs} +1 -1
  119. package/dist/warning-icon.entry-19f721c3.js +15 -0
  120. package/dist/warning-icon.entry-3ab9a59e.cjs +1 -0
  121. package/package.json +3 -3
  122. package/dist/add-circle-icon_22.entry-080abc71.cjs +0 -1
  123. package/dist/add-circle-icon_22.entry-bda9be31.js +0 -1818
  124. package/dist/archive-icon_7.entry-ca20da59.cjs +0 -1
  125. package/dist/chevron-icon_3.entry-74425e1f.js +0 -117
  126. package/dist/chevron-icon_3.entry-7ff803ad.cjs +0 -1
  127. package/dist/close-icon.entry-18e140ed.cjs +0 -1
  128. package/dist/close-icon.entry-6a8ea4a7.js +0 -15
  129. package/dist/document-refresh-icon.entry-f15f795a.cjs +0 -1
  130. package/dist/google-logo-icon_4.entry-38d5c2f2.cjs +0 -1
  131. package/dist/google-logo-icon_4.entry-5eca9538.js +0 -381
  132. package/dist/index-93c50de4.cjs +0 -37
  133. package/dist/index-f93f6948.js +0 -4006
  134. package/dist/loading-icon.entry-b563b2e6.js +0 -15
  135. package/dist/loading-icon.entry-fb04b893.cjs +0 -1
  136. package/dist/nylas-additional-participants.entry-33a45477.cjs +0 -1
  137. package/dist/nylas-additional-participants.entry-4b214308.js +0 -81
  138. package/dist/nylas-booked-event-card_10.entry-3e225025.cjs +0 -1
  139. package/dist/nylas-booked-event-card_10.entry-e93bc290.js +0 -782
  140. package/dist/nylas-form-card.entry-0748fdd5.js +0 -54
  141. package/dist/nylas-form-card.entry-eb3607bc.cjs +0 -1
  142. package/dist/nylas-scheduler-editor.entry-4de2bb97.js +0 -2275
  143. package/dist/nylas-scheduler-editor.entry-72c91b7d.cjs +0 -7
  144. package/dist/nylas-scheduling.entry-1a004916.cjs +0 -1
  145. package/dist/nylas-scheduling.entry-4e18ab43.js +0 -235
  146. package/dist/people-icon.entry-431e5044.cjs +0 -1
  147. package/dist/people-icon.entry-b4778e15.js +0 -15
  148. package/dist/play-icon_2.entry-f97db395.cjs +0 -1
  149. package/dist/scheduler-config-store-07d98279-0610e42f.cjs +0 -1
  150. package/dist/scheduler-config-store-07d98279-3b70606c.js +0 -24
  151. package/dist/scheduler-store-24fd0e91-2dba20c2.cjs +0 -1
  152. package/dist/scheduler-store-24fd0e91-47098841.js +0 -302
  153. package/dist/time-period-selector.entry-1e849c2e.js +0 -76
  154. package/dist/time-period-selector.entry-d8f3462f.cjs +0 -1
  155. package/dist/warning-icon.entry-1f0f00ed.cjs +0 -1
  156. package/dist/warning-icon.entry-b5db0151.js +0 -15
@@ -1,381 +0,0 @@
1
- import { r as L, h as e, c as p, d as f, s as N, H as U, g as A } from "./index-f93f6948.js";
2
- import { R as Z } from "./register-component-b9cfcbaf-c0147194.js";
3
- import { D as G } from "./constants-f34b9c6e-95a17764.js";
4
- import "react";
5
- import "react-dom";
6
- const J = ".sc-google-logo-icon-h{display:flex}", $ = J, q = class {
7
- constructor(n) {
8
- L(this, n), this.width = "24", this.height = "24";
9
- }
10
- render() {
11
- return e("svg", { key: "2445589627197f9af06e10891e1772c17b140c0a", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("g", { key: "b84ea9a0cc741b646d9a63113404d34c5e155fc8", "clip-path": "url(#clip0_959_12452)" }, e("path", { key: "9c774266fb43cf807ea64846b71eb27c6272b17d", 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" }), e("path", { key: "ff0fe8133c31fc75ecf3e9fedecbbaef2e35dd54", 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" }), e("path", { key: "5851b3de9ee71263668f65e2e86f0dfab3039c83", 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" }), e("path", { key: "2a79a335e1b8d03747b5f879a75deb5544e5cf63", 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" })), e("defs", { key: "f3b4d8d363cc9ac066b92de2354b9210d7190b46" }, e("clipPath", { key: "270b05e06d87d998c7525254f4f2ae3d5a0ab835", id: "clip0_959_12452" }, e("rect", { key: "de0df984a8f12ccdd0c655968c4f8b2049996968", width: 24, height: 24, fill: "white" }))));
12
- }
13
- };
14
- q.style = $;
15
- const K = ".sc-microsoft-logo-icon-h{display:flex}", Q = K, X = class {
16
- constructor(n) {
17
- L(this, n), this.width = "22", this.height = "22";
18
- }
19
- render() {
20
- return e("svg", { key: "de39bfb3167fbd60d21025e74c1bc19cdd7d4dc9", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, e("path", { key: "0f80864e892ff36e6e76ef03f5f36d62007d99ee", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), e("path", { key: "ab0e85f803a3cf2e32055ebeff1b0705edebe048", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), e("path", { key: "b6359dcb76ade260f2a9e9bdf1be21ba84b77b79", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), e("path", { key: "cf38a555c09aaef94a15fd26b0951e2642eaad6d", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
21
- }
22
- };
23
- X.style = Q;
24
- function Y({ id: n, formState: t, activeTab: a, calendars: r }) {
25
- var s;
26
- switch (a) {
27
- case "eventInfo":
28
- const i = t.title, l = t.description, o = parseInt(t.duration), d = t.location;
29
- return e(
30
- "div",
31
- { key: n },
32
- e(
33
- "nylas-event-info",
34
- null,
35
- e(
36
- "div",
37
- { slot: "inputs" },
38
- e("nylas-event-title", { name: "title", eventTitle: i, exportparts: "net, net__title, net__dropdown-content" }),
39
- e("nylas-event-duration", { name: "duration", eventDurationMinutes: o, exportparts: "ned, ned__input, ned__dropdown, ned__dropdown-button, ned__dropdown-content" }),
40
- e("nylas-location-component", { name: "location", eventLocation: d, exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
41
- e("nylas-event-description", { name: "description", eventDescription: l, exportparts: "nedesc, nedesc__textarea" })
42
- )
43
- )
44
- );
45
- case "availability":
46
- const b = t.availability.openHours, h = t.availability.timezone ? t.availability.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone, u = (s = t.participants) == null ? void 0 : s.find((c) => c.is_organizer), y = (u == null ? void 0 : u.email) ?? "primary", g = t.calendarIds.length > 0 ? t.calendarIds : [y], m = t.bookingCalendar == "primary" ? y : t.bookingCalendar;
47
- return e(
48
- "div",
49
- { key: n },
50
- e("nylas-booking-calendar-picker", { name: "booking-calendar", calendars: r ?? [], defaultBookingCalendar: m, exportparts: "nbcp, nbcp__header, nbcp__input-label, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content" }),
51
- e("nylas-calendar-picker", { name: "calendars", calendars: r ?? [], defaultSelectedCalendars: g, exportparts: "ncp ncp__header, ncp__dropdown, ncp__dropdown-button, ncp__dropdown-content" }),
52
- e("nylas-availability-picker", { name: "availability", openHours: b, defaultTimezone: h, 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" })
53
- );
54
- case "bookingOptions":
55
- return e(
56
- "div",
57
- { key: n },
58
- e("nylas-buffer-time", { name: "buffer-time", buffer: t.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" }),
59
- e("nylas-custom-booking-flow", { name: "booking-type", bookingType: t.bookingType, exportparts: "ncbf, ncbf__header, ncbf__dropdown, ncbf__dropdown-button, ncbf__dropdown-content" }),
60
- e(
61
- "nylas-event-limits",
62
- null,
63
- e(
64
- "div",
65
- { slot: "inputs" },
66
- e("nylas-limit-future-bookings", { name: "limit-future-bookings", availableDaysInFuture: t.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" }),
67
- e("nylas-min-cancellation-notice", { name: "min-cancellation-notice", minCancellationNotice: t.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" })
68
- )
69
- )
70
- );
71
- }
72
- }
73
- const tt = '.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{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}}.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 .tab-content.sc-nylas-editor-tabs{max-width:692px}.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}.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}', et = tt;
74
- var nt = function(n, t, a, r) {
75
- var s = arguments.length, i = s < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, l;
76
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
77
- i = Reflect.decorate(n, t, a, r);
78
- else
79
- for (var o = n.length - 1; o >= 0; o--)
80
- (l = n[o]) && (i = (s < 3 ? l(i) : s > 3 ? l(t, a, i) : l(t, a)) || i);
81
- return s > 3 && i && Object.defineProperty(t, a, i), i;
82
- }, D = function(n, t) {
83
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
84
- return Reflect.metadata(n, t);
85
- };
86
- const z = class {
87
- constructor(n) {
88
- L(this, n), this.schedulerConfigChanged = p(this, "schedulerConfigChanged", 7), this.cancelButtonClick = p(this, "cancelButtonClick", 7), this.formSubmitted = p(this, "formSubmitted", 7), this.previewButtonClicked = p(this, "previewButtonClicked", 7), this.setError = (t) => {
89
- this.error = t.message;
90
- }, this.formSubmissionHandler = async (t) => {
91
- var v, _, w, C, S, T, B, F, I, E, P, R, O, j, V;
92
- if (t.preventDefault(), this.formSubmitted.emit(), !this.formRef.checkValidity())
93
- return;
94
- this.isLoading = !0, this.hasUnsavedChanges = !1;
95
- const r = this.updateFormState(), { title: s, description: i, duration: l, availability: o, calendarIds: d, bookingCalendar: b, location: h, bookingType: u, buffer: y, availableDaysInFuture: g, minCancellationNotice: m } = r, c = (_ = (v = this.selectedConfiguration) == null ? void 0 : v.participants) == null ? void 0 : _.find((M) => M.is_organizer), k = {
96
- ...this.selectedConfiguration,
97
- version: ((w = this.selectedConfiguration) == null ? void 0 : w.version) ?? "1.0.0",
98
- availability: {
99
- duration_minutes: l ? parseInt(l) : 0,
100
- availability_rules: {
101
- availability_method: ((T = (S = (C = this.selectedConfiguration) == null ? void 0 : C.availability) == null ? void 0 : S.availability_rules) == null ? void 0 : T.availability_method) ?? "collective",
102
- buffer: y || { before: 0, after: 0 },
103
- default_open_hours: ((I = (F = (B = this.selectedConfiguration) == null ? void 0 : B.availability) == null ? void 0 : F.availability_rules) == null ? void 0 : I.default_open_hours) ?? G,
104
- round_robin_group_id: ((R = (P = (E = this.selectedConfiguration) == null ? void 0 : E.availability) == null ? void 0 : P.availability_rules) == null ? void 0 : R.round_robin_group_id) ?? ""
105
- }
106
- },
107
- participants: [
108
- {
109
- name: (c == null ? void 0 : c.name) ?? (c == null ? void 0 : c.email) ?? ((O = this.currentUser) == null ? void 0 : O.name) ?? ((j = this.currentUser) == null ? void 0 : j.email) ?? "",
110
- email: (c == null ? void 0 : c.email) ?? ((V = this.currentUser) == null ? void 0 : V.email) ?? "",
111
- is_organizer: !0,
112
- availability: {
113
- calendar_ids: d != null && d.length ? d : ["primary"],
114
- open_hours: (o == null ? void 0 : o.openHours) ?? []
115
- },
116
- booking: {
117
- calendar_id: b && b !== "" ? b : "primary"
118
- }
119
- }
120
- ],
121
- event_booking: {
122
- title: (s == null ? void 0 : s.toString()) ?? "",
123
- description: (i == null ? void 0 : i.toString()) ?? "",
124
- location: (h == null ? void 0 : h.toString()) ?? "",
125
- booking_type: (u == null ? void 0 : u.toString()) ?? "booking",
126
- timezone: (o == null ? void 0 : o.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone
127
- },
128
- scheduler: {
129
- available_days_in_future: g ?? 30,
130
- min_cancellation_notice: m ?? 0
131
- }
132
- }, x = (M) => {
133
- this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
134
- this.changesSaved = !1;
135
- }, 5e3);
136
- };
137
- this.schedulerConfigChanged.emit({ config: k, resetLoadingState: x, setError: this.setError, action: this.action });
138
- }, this.calendars = void 0, this.selectedConfiguration = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.action = "create", this.mode = "app", this.activeTab = "eventInfo", this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
139
- }
140
- configChangedHandler(n) {
141
- f("[nylas-editor-tabs]", "configChangedHandler", n, this.selectedConfiguration), this.formState = {
142
- ...this.getFormStateFromConfig(n)
143
- }, n.id ? this.action = "edit" : this.action = "create";
144
- }
145
- connectedCallback() {
146
- f("[nylas-editor-tabs]", "connectedCallback");
147
- }
148
- componentWillLoad() {
149
- f("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
150
- }
151
- componentDidLoad() {
152
- f("[nylas-editor-tabs]", "componentDidLoad");
153
- }
154
- disconnectedCallback() {
155
- f("[nylas-editor-tabs]", "disconnectedCallback");
156
- }
157
- handleValueChanged(n) {
158
- f("[nylas-editor-tabs]", "handleValueChanged", n);
159
- const { name: t, value: a } = n.detail;
160
- this.formState = { ...this.formState, [t]: a }, this.hasUnsavedChanges = !0, this.error = "";
161
- }
162
- getFormStateFromConfig(n) {
163
- var a, r, s, i, l, o, d, b, h, u, y, g, m, c, k, x, v, _, w, C;
164
- const t = (a = n == null ? void 0 : n.participants) == null ? void 0 : a.find((S) => S.is_organizer);
165
- return {
166
- title: ((r = n == null ? void 0 : n.event_booking) == null ? void 0 : r.title) ?? "",
167
- description: ((s = n == null ? void 0 : n.event_booking) == null ? void 0 : s.description) ?? "",
168
- duration: ((l = (i = n == null ? void 0 : n.availability) == null ? void 0 : i.duration_minutes) == null ? void 0 : l.toString()) ?? "10",
169
- availability: {
170
- timezone: ((o = n == null ? void 0 : n.event_booking) == null ? void 0 : o.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
171
- open_hours: ((d = t == null ? void 0 : t.availability) == null ? void 0 : d.open_hours) ?? void 0
172
- },
173
- calendarIds: ((b = t == null ? void 0 : t.availability) == null ? void 0 : b.calendar_ids) ?? [],
174
- participants: (n == null ? void 0 : n.participants) ?? [],
175
- bookingCalendar: ((h = t == null ? void 0 : t.booking) == null ? void 0 : h.calendar_id) ?? (t == null ? void 0 : t.email) ?? "",
176
- location: ((y = (u = this.selectedConfiguration) == null ? void 0 : u.event_booking) == null ? void 0 : y.location) ?? "",
177
- bookingType: ((m = (g = this.selectedConfiguration) == null ? void 0 : g.event_booking) == null ? void 0 : m.booking_type) ?? "booking",
178
- buffer: ((x = (k = (c = this.selectedConfiguration) == null ? void 0 : c.availability) == null ? void 0 : k.availability_rules) == null ? void 0 : x.buffer) ?? { before: 0, after: 0 },
179
- availableDaysInFuture: ((_ = (v = this.selectedConfiguration) == null ? void 0 : v.scheduler) == null ? void 0 : _.available_days_in_future) ?? 30,
180
- minCancellationNotice: ((C = (w = this.selectedConfiguration) == null ? void 0 : w.scheduler) == null ? void 0 : C.min_cancellation_notice) ?? 0
181
- };
182
- }
183
- updateFormState() {
184
- return new FormData(this.formRef).forEach((t, a) => {
185
- switch (a) {
186
- case "title":
187
- this.formState.title = t.toString();
188
- break;
189
- case "description":
190
- this.formState.description = t.toString();
191
- break;
192
- case "duration":
193
- this.formState.duration = t.toString();
194
- break;
195
- case "availability":
196
- this.formState.availability = JSON.parse(t.toString());
197
- break;
198
- case "participants":
199
- this.formState.participants = JSON.parse(t.toString());
200
- break;
201
- case "calendars":
202
- this.formState.calendarIds = t.toString().split(",");
203
- break;
204
- case "booking-calendar":
205
- this.formState.bookingCalendar = t.toString();
206
- break;
207
- case "location":
208
- this.formState.location = t.toString();
209
- break;
210
- case "booking-type":
211
- this.formState.bookingType = t.toString();
212
- break;
213
- case "buffer-time":
214
- this.formState.buffer = JSON.parse(t.toString());
215
- break;
216
- case "limit-future-bookings":
217
- this.formState.availableDaysInFuture = parseInt(t.toString());
218
- break;
219
- case "min-cancellation-notice":
220
- this.formState.minCancellationNotice = parseInt(t.toString());
221
- break;
222
- }
223
- }), this.formState = { ...this.formState }, this.formState;
224
- }
225
- setActiveTab(n, t) {
226
- n.preventDefault(), this.updateFormState(), this.activeTab = t;
227
- }
228
- render() {
229
- var n;
230
- return f("[nylas-editor-tabs]", "render", this.formState), e(U, { key: "c1e6e9d2cfe242e407a909281063767a0985245e" }, e("form", { key: "4baaac0129e8a357b78980636bd32b3818ec0820", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (t) => this.formRef = t, noValidate: !0 }, this.mode === "app" ? e("div", { class: "form-contents" }, e("div", { class: "tabs" }, e("button", { class: { tab: !0, active: this.activeTab == "eventInfo" }, onClick: (t) => this.setActiveTab(t, "eventInfo") }, e("calendar-info-icon", { width: "16", height: "16" }), "Event Info"), e("button", { class: { tab: !0, active: this.activeTab == "availability" }, onClick: (t) => this.setActiveTab(t, "availability") }, e("calendar-patterns-icon", { width: "16", height: "16" }), "Availability"), e("button", { class: { tab: !0, active: this.activeTab == "bookingOptions" }, onClick: (t) => this.setActiveTab(t, "bookingOptions") }, e("flow-icon", { width: "16", height: "16" }), "Booking Options")), e("div", { class: "tab-content" }, e(Y, { formState: this.formState, activeTab: this.activeTab, calendars: this.calendars, id: ((n = this.selectedConfiguration) == null ? void 0 : n.id) ?? "new" }))) : e("slot", null), e("div", { key: "38bdcdd7283d98ea54c7594a52cc16b85b3b776a", class: "footer" }, e("div", { key: "5543e3f7eb2fa9f2f3bbe6053fde7d0ea13c3bc0", class: "preview" }, this.schedulerPreviewLink !== "" && this.action === "edit" && e("button-component", { type: "button", disabled: this.isLoading, clickHandler: (t) => {
231
- t.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(N(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
232
- }, variant: "basic" }, "Preview")), e("div", { key: "62470cdbc7c4670e6ff03e9979ca803f81482b15", class: "buttons" }, e("p", { key: "5ecdfa1082650aab2f8fef8ed7beeb11fedb381c", class: {
233
- "unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
234
- "saved-changes": this.changesSaved,
235
- error: this.error !== "",
236
- "error-full-width": this.error !== "" && this.action === "create"
237
- } }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.error == "" && this.changesSaved ? "Changes saved!" : ""), e("button-component", { key: "1bb3af5cc04c49e311267fb43ac326267acdaa1d", type: "button", disabled: this.isLoading, clickHandler: (t) => {
238
- t.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
239
- }, variant: "basic" }, "Cancel"), e("button-component", { key: "28c9725c69104d1849b2ab3068b61a269370f016", type: "submit", disabled: this.isLoading }, this.isLoading ? e("span", null, "Saving", e("loading-icon", null), " ") : this.action == "create" ? "Create" : "Save changes")))));
240
- }
241
- get host() {
242
- return A(this);
243
- }
244
- static get watchers() {
245
- return {
246
- selectedConfiguration: ["configChangedHandler"]
247
- };
248
- }
249
- };
250
- nt([
251
- Z({
252
- name: "nylas-editor-tabs",
253
- stateToProps: /* @__PURE__ */ new Map([
254
- ["schedulerConfig.calendars", "calendars"],
255
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
256
- ["schedulerConfig.currentUser", "currentUser"]
257
- ]),
258
- eventToProps: {
259
- schedulerConfigChanged: async (n, t) => {
260
- const { resetLoadingState: a, setError: r, action: s, config: i } = n.detail, l = (o) => {
261
- const [d, b] = o;
262
- !d && b && r && r(b), a && a(n);
263
- };
264
- if (s === "edit") {
265
- const o = await t.schedulerConfig.updateConfiguration(i);
266
- l(o);
267
- } else {
268
- const o = await t.schedulerConfig.createConfiguration(i);
269
- l(o);
270
- }
271
- },
272
- cancelButtonClick: async (n, t) => {
273
- t.schedulerConfigStore.state.action = null;
274
- }
275
- },
276
- localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
277
- fireRegisterEvent: !0
278
- }),
279
- D("design:type", Function),
280
- D("design:paramtypes", []),
281
- D("design:returntype", void 0)
282
- ], z.prototype, "render", null);
283
- z.style = et;
284
- const at = ':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:2rem;gap:1rem}@media screen and (max-width: 768px){.header{flex-direction:column}}.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);overflow-x:auto}.configurations table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit}.configurations table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations table tr:last-of-type{border-bottom:0}.configurations table tr.hide{display:none}.configurations table th{font-weight:600;text-transform:uppercase}.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}.configurations table .title{display:flex;flex-direction:column}.configurations table .title .config-event-title{font-weight:600}.configurations table .title .config-event-description{font-size:0.75rem}.error-container{margin-top:1.5rem}.error-container .error{color:var(--nylas-error);padding:0.5rem 0;margin:1rem 0 0}', it = at;
285
- var st = function(n, t, a, r) {
286
- var s = arguments.length, i = s < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, a) : r, l;
287
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
288
- i = Reflect.decorate(n, t, a, r);
289
- else
290
- for (var o = n.length - 1; o >= 0; o--)
291
- (l = n[o]) && (i = (s < 3 ? l(i) : s > 3 ? l(t, a, i) : l(t, a)) || i);
292
- return s > 3 && i && Object.defineProperty(t, a, i), i;
293
- }, H = function(n, t) {
294
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
295
- return Reflect.metadata(n, t);
296
- };
297
- const W = class {
298
- constructor(n) {
299
- L(this, n), this.initListConfigurations = p(this, "initListConfigurations", 7), this.createButtonClick = p(this, "createButtonClick", 7), this.editButtonClick = p(this, "editButtonClick", 7), this.deleteButtonClick = p(this, "deleteButtonClick", 7), this.configurations = [], this.schedulerPreviewLink = "", this.state = "loading", this.error = "";
300
- }
301
- connectedCallback() {
302
- f("[nylas-list-configurations]", "connectedCallback");
303
- }
304
- componentWillLoad() {
305
- f("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
306
- }
307
- componentDidLoad() {
308
- f("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit(this.host);
309
- }
310
- disconnectedCallback() {
311
- f("[nylas-list-configurations]", "disconnectedCallback");
312
- }
313
- async getState() {
314
- return this.state;
315
- }
316
- async setState(n) {
317
- this.state = n;
318
- }
319
- async setError(n) {
320
- this.error = n;
321
- }
322
- render() {
323
- return e(U, null, e("div", { class: "header" }, e("div", { class: "description" }, e("h2", null, "All scheduling pages"), e("p", null, "Create, edit and manage all your scheduling pages.")), this.configurations && this.configurations.length > 0 && e("div", { class: "actions" }, e("button-component", { clickHandler: () => {
324
- this.createButtonClick.emit(this.host);
325
- } }, "Create new"))), e("div", { class: "configurations" }, e("table", null, e("tr", { class: {
326
- hide: this.state === "loading" || this.configurations && this.configurations.length === 0
327
- } }, e("th", null, "Scheduling page event title"), e("th", null, "Duration"), e("th", { class: "actions" }, "Actions")), this.state === "loading" && e("tr", { class: "no-configurations" }, e("td", { colSpan: 3 }, e("div", null, e("h3", null, "Loading..."), e("p", null, "Please wait while we fetch the scheduling pages")))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && e("tr", { class: "no-configurations" }, e("td", { colSpan: 3 }, e("div", null, e("calendar-icon", { width: "48", height: "48" }), e("h3", null, "No scheduling pages found"), e("p", null, "Get started with creating your first scheduling page"), e("button-component", { clickHandler: () => {
328
- this.createButtonClick.emit(this.host);
329
- } }, "Create new")))), this.state !== "loading" && this.configurations.map((n) => e("tr", { key: n.id }, e("td", null, e("div", { class: "title" }, e("span", { class: "config-event-title" }, n.event_booking.title), e("span", { class: "config-event-description" }, n.event_booking.description))), e("td", null, e("div", null, n.availability.duration_minutes, " mins")), e("td", null, e("div", { class: "actions" }, e("button-component", { variant: "basic", clickHandler: (t) => {
330
- t.preventDefault(), window.open(N(this.schedulerPreviewLink, n), "_blank");
331
- } }, "Preview"), e("button-component", { variant: "basic", clickHandler: (t) => {
332
- t.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: n });
333
- } }, "Edit"), e("button-component", { variant: "basic", clickHandler: (t) => {
334
- t.preventDefault(), this.deleteButtonClick.emit({ host: this.host, configuration: n });
335
- } }, "Delete"))))))), e("div", { class: "error-container" }, e("p", { class: "error" }, this.state === "error" && this.error)));
336
- }
337
- get host() {
338
- return A(this);
339
- }
340
- };
341
- st([
342
- Z({
343
- name: "nylas-list-configurations",
344
- stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.configurations", "configurations"]]),
345
- localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
346
- eventToProps: {
347
- initListConfigurations: async (n, t) => {
348
- const a = n.detail;
349
- await a.setState("loading");
350
- const [r, s] = await t.schedulerConfig.getConfigurations();
351
- if (!r && s && s.message) {
352
- await a.setState("error"), await a.setError(s.message);
353
- return;
354
- }
355
- await a.setState("loaded");
356
- },
357
- createButtonClick: async (n, t) => {
358
- t.schedulerConfigStore.resetSelectedConfiguration(), t.schedulerConfigStore.state.action = "create";
359
- },
360
- deleteButtonClick: async (n, t) => {
361
- const { host: a, configuration: r } = n.detail, [s, i] = await t.schedulerConfig.deleteConfiguration(r.id);
362
- !s && i && i.message && (await a.setState("error"), await a.setError(i.message));
363
- },
364
- editButtonClick: async (n, t) => {
365
- const { configuration: a } = n.detail;
366
- t.schedulerConfigStore.state.selectedConfiguration = a, t.schedulerConfigStore.state.action = "edit";
367
- }
368
- },
369
- fireRegisterEvent: !0
370
- }),
371
- H("design:type", Function),
372
- H("design:paramtypes", []),
373
- H("design:returntype", void 0)
374
- ], W.prototype, "render", null);
375
- W.style = it;
376
- export {
377
- q as google_logo_icon,
378
- X as microsoft_logo_icon,
379
- z as nylas_editor_tabs,
380
- W as nylas_list_configurations
381
- };