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

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 (145) hide show
  1. package/dist/add-circle-icon_2.entry-29cc2385.cjs +1 -0
  2. package/dist/add-circle-icon_2.entry-b8d6df60.js +69 -0
  3. package/dist/{archive-icon_7.entry-2f418a3e.js → archive-icon_7.entry-3830776a.js} +18 -18
  4. package/dist/{archive-icon_7.entry-eb90a353.cjs → archive-icon_7.entry-afaef817.cjs} +1 -1
  5. package/dist/{arrow-icon.entry-753eb942.js → arrow-icon.entry-19f00716.js} +1 -1
  6. package/dist/{arrow-icon.entry-ac5e1a47.cjs → arrow-icon.entry-460cdd9f.cjs} +1 -1
  7. package/dist/{bold-icon_3.entry-4fff7400.cjs → bold-icon_3.entry-1893eeec.cjs} +1 -1
  8. package/dist/{bold-icon_3.entry-18507c82.js → bold-icon_3.entry-80abafbb.js} +3 -3
  9. package/dist/button-component.entry-36137536.js +16 -0
  10. package/dist/button-component.entry-b78dc39e.cjs +1 -0
  11. package/dist/calendar-agenda-fill-icon_40.entry-62c66fce.cjs +10 -0
  12. package/dist/{calendar-agenda-fill-icon_35.entry-db989ce0.js → calendar-agenda-fill-icon_40.entry-f19d6ad7.js} +1469 -1076
  13. package/dist/{calendar-cancel-icon.entry-d2e10dfc.cjs → calendar-cancel-icon.entry-0d83ee82.cjs} +1 -1
  14. package/dist/{calendar-cancel-icon.entry-31caeae1.js → calendar-cancel-icon.entry-1fae00c5.js} +1 -1
  15. package/dist/{calendar-check-icon_2.entry-7f67c003.js → calendar-check-icon_2.entry-159c38af.js} +1 -1
  16. package/dist/{calendar-check-icon_2.entry-d32551e9.cjs → calendar-check-icon_2.entry-e01c9028.cjs} +1 -1
  17. package/dist/{calendar-icon.entry-f3f1c623.cjs → calendar-icon.entry-2e701aab.cjs} +1 -1
  18. package/dist/{calendar-icon.entry-6e89816b.js → calendar-icon.entry-3af9cb76.js} +1 -1
  19. package/dist/checkbox-component_2.entry-5eee51f6.js +56 -0
  20. package/dist/checkbox-component_2.entry-9ff2c85b.cjs +1 -0
  21. package/dist/checkmark-icon.entry-0749b942.js +15 -0
  22. package/dist/checkmark-icon.entry-f96f1117.cjs +1 -0
  23. package/dist/{chevron-icon_3.entry-2e20a83e.js → chevron-icon_3.entry-2e9eebbc.js} +10 -10
  24. package/dist/{chevron-icon_3.entry-3be68846.cjs → chevron-icon_3.entry-c3989df2.cjs} +1 -1
  25. package/dist/clock-icon_4.entry-9395d0cb.js +45 -0
  26. package/dist/clock-icon_4.entry-d4563931.cjs +1 -0
  27. package/dist/close-icon.entry-cf9f0a69.js +15 -0
  28. package/dist/close-icon.entry-e24af309.cjs +1 -0
  29. package/dist/{constants-7ce66b44-3952e81c.js → constants-67de2eec-b17f5b96.js} +37 -17
  30. package/dist/{constants-7ce66b44-a6b777d4.cjs → constants-67de2eec-e3b50fc6.cjs} +5 -5
  31. package/dist/{copy-icon_4.entry-187edab9.js → copy-icon_3.entry-7b276fa2.js} +9 -19
  32. package/dist/copy-icon_3.entry-7de3667f.cjs +1 -0
  33. package/dist/document-refresh-icon.entry-582ac233.cjs +1 -0
  34. package/dist/{document-refresh-icon.entry-9d7900d7.js → document-refresh-icon.entry-6dd65cb6.js} +2 -2
  35. package/dist/elements/index.d.ts +8 -0
  36. package/dist/{elements-dc5b338e-edf63aa6.cjs → elements-dc5b338e-158dce67.cjs} +1 -1
  37. package/dist/{elements-dc5b338e-e6271e48.js → elements-dc5b338e-5e8a704b.js} +1 -1
  38. package/dist/{focus-visible-e8093c16-84e41b3b.cjs → focus-visible-e8093c16-5883a317.cjs} +1 -1
  39. package/dist/{focus-visible-e8093c16-4c45967c.js → focus-visible-e8093c16-9d88e8ee.js} +1 -1
  40. package/dist/{forward-icon_6.entry-4cb6eb63.cjs → forward-icon_6.entry-a59dada5.cjs} +3 -3
  41. package/dist/{forward-icon_6.entry-949d0cfb.js → forward-icon_6.entry-acdf04ad.js} +7 -7
  42. package/dist/{globe-icon.entry-04b35395.js → globe-icon.entry-389c0391.js} +2 -2
  43. package/dist/{globe-icon.entry-741f8ad4.cjs → globe-icon.entry-eef27331.cjs} +1 -1
  44. package/dist/google-logo-icon_4.entry-e9be320c.cjs +1 -0
  45. package/dist/google-logo-icon_4.entry-eae19fc8.js +637 -0
  46. package/dist/index-53420959-82a5306f.cjs +1 -0
  47. package/dist/index-53420959-9b1699ec.js +5 -0
  48. package/dist/{index-6d9eeb53-8b16e3b5.cjs → index-6d9eeb53-15c69801.cjs} +1 -1
  49. package/dist/{index-6d9eeb53-b15263de.js → index-6d9eeb53-c70fc8a7.js} +2 -2
  50. package/dist/index-db48e0b6.cjs +42 -0
  51. package/dist/index-f8317a8e.js +7638 -0
  52. package/dist/{index.es-9cc0eb3c-e6c5dd2d.js → index.es-b16d0cf5-386496a9.js} +1 -1
  53. package/dist/{index.es-9cc0eb3c-2e0f7d11.cjs → index.es-b16d0cf5-d7f30c4a.cjs} +1 -1
  54. package/dist/{info-icon_2.entry-c3468951.cjs → info-icon_2.entry-63914227.cjs} +1 -1
  55. package/dist/{info-icon_2.entry-d0270899.js → info-icon_2.entry-97d75550.js} +5 -5
  56. package/dist/input-dropdown.entry-4d29246a.js +132 -0
  57. package/dist/input-dropdown.entry-629d7b54.cjs +1 -0
  58. package/dist/loading-icon.entry-2f15a09f.cjs +1 -0
  59. package/dist/loading-icon.entry-fc9bc740.js +15 -0
  60. package/dist/{mailbox-store-64b4ef7c-c609ac6d.cjs → mailbox-store-f11de360-02a6de93.cjs} +1 -1
  61. package/dist/{mailbox-store-64b4ef7c-7c793d9a.js → mailbox-store-f11de360-d781fd36.js} +2 -2
  62. package/dist/{multi-select-dropdown.entry-f298ca2c.cjs → multi-select-dropdown.entry-68fcca98.cjs} +1 -1
  63. package/dist/{multi-select-dropdown.entry-2ca73c71.js → multi-select-dropdown.entry-8e14e9af.js} +2 -2
  64. package/dist/nylas-booked-event-card_10.entry-4da23b61.cjs +1 -0
  65. package/dist/{nylas-booked-event-card_10.entry-2b01df7e.js → nylas-booked-event-card_10.entry-9487941d.js} +357 -316
  66. package/dist/{nylas-custom-booking-flow.entry-66beff43.js → nylas-custom-booking-flow.entry-0e16973b.js} +32 -32
  67. package/dist/{nylas-custom-booking-flow.entry-05b9522a.cjs → nylas-custom-booking-flow.entry-338b0a8f.cjs} +1 -1
  68. package/dist/nylas-form-card.entry-ca669dea.cjs +1 -0
  69. package/dist/{nylas-form-card.entry-3de9f477.js → nylas-form-card.entry-ccfa5692.js} +10 -10
  70. package/dist/{nylas-if-state.entry-a0689083.js → nylas-if-state.entry-93935670.js} +2 -2
  71. package/dist/{nylas-if-state.entry-a734df46.cjs → nylas-if-state.entry-faa11bb6.cjs} +1 -1
  72. package/dist/{nylas-list-folders.entry-4fb9d4c2.js → nylas-list-folders.entry-14fc1fe8.js} +4 -4
  73. package/dist/{nylas-list-folders.entry-74a56187.cjs → nylas-list-folders.entry-e7e179ea.cjs} +1 -1
  74. package/dist/{nylas-list-threads.entry-9a6d4c33.js → nylas-list-threads.entry-2118b146.js} +3 -3
  75. package/dist/{nylas-list-threads.entry-0addc621.cjs → nylas-list-threads.entry-3f52fc06.cjs} +1 -1
  76. package/dist/{nylas-login.entry-beb6e0d9.js → nylas-login.entry-87a902d6.js} +7 -7
  77. package/dist/{nylas-login.entry-bdac29c0.cjs → nylas-login.entry-915f0284.cjs} +1 -1
  78. package/dist/{nylas-mailbox-pagination.entry-c5d07bbe.cjs → nylas-mailbox-pagination.entry-9aa8a606.cjs} +1 -1
  79. package/dist/{nylas-mailbox-pagination.entry-1d71850a.js → nylas-mailbox-pagination.entry-eedbf796.js} +2 -2
  80. package/dist/{nylas-mailbox-toolbar-button.entry-882c97a0.js → nylas-mailbox-toolbar-button.entry-40b75810.js} +2 -2
  81. package/dist/{nylas-mailbox-toolbar-button.entry-7d9d6293.cjs → nylas-mailbox-toolbar-button.entry-ba5b826e.cjs} +1 -1
  82. package/dist/{nylas-mailbox.entry-d810adba.js → nylas-mailbox.entry-179e5a5c.js} +3 -3
  83. package/dist/{nylas-mailbox.entry-94eb97ec.cjs → nylas-mailbox.entry-31de7f8f.cjs} +1 -1
  84. package/dist/{nylas-provider.entry-5a4bb86e.cjs → nylas-provider.entry-46fe01b6.cjs} +1 -1
  85. package/dist/{nylas-provider.entry-fcaf9e1c.js → nylas-provider.entry-7b70bbdc.js} +36 -36
  86. package/dist/{nylas-scheduler-editor.entry-30597812.cjs → nylas-scheduler-editor.entry-76b68f66.cjs} +2 -2
  87. package/dist/{nylas-scheduler-editor.entry-1ca566d3.js → nylas-scheduler-editor.entry-f1f80de1.js} +7 -10
  88. package/dist/{nylas-scheduling.entry-aefefe3d.js → nylas-scheduling.entry-31d13205.js} +83 -70
  89. package/dist/nylas-scheduling.entry-3ce8c52f.cjs +1 -0
  90. package/dist/{nylas-threads-refresh.entry-a85222e2.js → nylas-threads-refresh.entry-a3ea46aa.js} +2 -2
  91. package/dist/{nylas-threads-refresh.entry-f3b9fdf2.cjs → nylas-threads-refresh.entry-c9f9db8c.cjs} +1 -1
  92. package/dist/{nylas-threads-search.entry-b1bf455b.js → nylas-threads-search.entry-01482ddf.js} +8 -8
  93. package/dist/{nylas-threads-search.entry-2c8ac7dc.cjs → nylas-threads-search.entry-a4ab0d47.cjs} +1 -1
  94. package/dist/{nylas-time-window-picker.entry-3a34b29b.cjs → nylas-time-window-picker.entry-5a3bb0b7.cjs} +1 -1
  95. package/dist/{nylas-time-window-picker.entry-6d664a05.js → nylas-time-window-picker.entry-5f063b2b.js} +18 -18
  96. package/dist/{nylas-view-thread.entry-bf6cab2a.cjs → nylas-view-thread.entry-82e78b82.cjs} +1 -1
  97. package/dist/{nylas-view-thread.entry-ddcb042f.js → nylas-view-thread.entry-cb057b9e.js} +6 -6
  98. package/dist/person-icon.entry-3e30c63c.js +15 -0
  99. package/dist/person-icon.entry-78cdc7f9.cjs +1 -0
  100. package/dist/play-icon_2.entry-4fb1938c.cjs +1 -0
  101. package/dist/play-icon_2.entry-71eaad5c.js +25 -0
  102. package/dist/react.cjs +1 -1
  103. package/dist/react.js +116 -108
  104. package/dist/{refresh-icon.entry-99761cb6.cjs → refresh-icon.entry-3570353d.cjs} +1 -1
  105. package/dist/{refresh-icon.entry-0fdcb7af.js → refresh-icon.entry-db85d14d.js} +4 -4
  106. package/dist/{register-component-a5a9ca5d-ddae10b3.js → register-component-b2a51b20-8a262dcf.js} +1 -1
  107. package/dist/{register-component-a5a9ca5d-4439e573.cjs → register-component-b2a51b20-9a913603.cjs} +1 -1
  108. package/dist/{scheduler-config-store-9ccfba4d-b774bfee.cjs → scheduler-config-store-9ccfba4d-6806e3cb.cjs} +1 -1
  109. package/dist/{scheduler-config-store-9ccfba4d-84025740.js → scheduler-config-store-9ccfba4d-a6745ccc.js} +1 -1
  110. package/dist/{scheduler-store-8a400448-8ab7b63e.js → scheduler-store-db06b30a-1e63b67f.js} +119 -116
  111. package/dist/scheduler-store-db06b30a-d5e6b6c3.cjs +1 -0
  112. package/dist/{textarea-component.entry-359e4665.cjs → textarea-component.entry-be870b8f.cjs} +1 -1
  113. package/dist/{textarea-component.entry-193d29fd.js → textarea-component.entry-f5f402a1.js} +4 -4
  114. package/dist/time-period-selector.entry-d1a8470b.js +93 -0
  115. package/dist/time-period-selector.entry-fc7d61c6.cjs +1 -0
  116. package/dist/{translate-icon.entry-32ec36de.cjs → translate-icon.entry-3ae0ddae.cjs} +1 -1
  117. package/dist/{translate-icon.entry-22a3e72e.js → translate-icon.entry-b91a0449.js} +2 -2
  118. package/dist/{warning-icon.entry-b8d483e1.cjs → warning-icon.entry-54127f45.cjs} +1 -1
  119. package/dist/{warning-icon.entry-8d9b59c0.js → warning-icon.entry-acdc811b.js} +5 -5
  120. package/package.json +3 -3
  121. package/dist/add-circle-icon_2.entry-5cefae99.js +0 -25
  122. package/dist/add-circle-icon_2.entry-85523420.cjs +0 -1
  123. package/dist/button-component_4.entry-3c508e3b.js +0 -115
  124. package/dist/button-component_4.entry-f8ab53dc.cjs +0 -1
  125. package/dist/calendar-agenda-fill-icon_35.entry-b56841a0.cjs +0 -7
  126. package/dist/clock-icon_2.entry-074eb053.cjs +0 -1
  127. package/dist/clock-icon_2.entry-bc938936.js +0 -25
  128. package/dist/copy-icon_4.entry-f704b2f1.cjs +0 -1
  129. package/dist/document-refresh-icon.entry-ea0e1ab9.cjs +0 -1
  130. package/dist/google-logo-icon_4.entry-8e87cf66.cjs +0 -1
  131. package/dist/google-logo-icon_4.entry-f50de25f.js +0 -598
  132. package/dist/index-53420959-507f0a27.js +0 -5
  133. package/dist/index-53420959-e6c2e510.cjs +0 -1
  134. package/dist/index-a4831dfe.cjs +0 -42
  135. package/dist/index-a68236be.js +0 -5011
  136. package/dist/input-dropdown_2.entry-2485dcc3.cjs +0 -1
  137. package/dist/input-dropdown_2.entry-2cd6cfc7.js +0 -220
  138. package/dist/loading-icon.entry-5ed52afe.cjs +0 -1
  139. package/dist/loading-icon.entry-96d9d1be.js +0 -15
  140. package/dist/nylas-booked-event-card_10.entry-97977ac7.cjs +0 -1
  141. package/dist/nylas-form-card.entry-3e1331c9.cjs +0 -1
  142. package/dist/nylas-scheduling.entry-00c418c8.cjs +0 -1
  143. package/dist/play-icon_2.entry-4f316c3d.cjs +0 -1
  144. package/dist/play-icon_2.entry-d55a018a.js +0 -25
  145. package/dist/scheduler-store-8a400448-eaa566fa.cjs +0 -1
@@ -1,598 +0,0 @@
1
- import { r as A, h as i, c as C, x as St, d as u, y as Z, H as vt, g as wt } from "./index-a68236be.js";
2
- import { R as Ct } from "./register-component-a5a9ca5d-ddae10b3.js";
3
- import { D as _t } from "./constants-7ce66b44-3952e81c.js";
4
- import "react";
5
- import "react-dom";
6
- const Lt = ".sc-google-logo-icon-h{display:flex}", Tt = Lt, Ft = class {
7
- constructor(t) {
8
- A(this, t), this.width = "24", this.height = "24";
9
- }
10
- render() {
11
- return i("svg", { key: "555521f048f2f287de7572071b43a53efeae7a10", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("g", { key: "2613493e10c2c2bd60da54b6c5ec674ae56d4bb0", "clip-path": "url(#clip0_959_12452)" }, i("path", { key: "8467e8ba5977837e472bec1d8a2bec6ed08bbb8f", 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" }), i("path", { key: "0a575c6bc170567883e793eebca58942de623a13", 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" }), i("path", { key: "4c4e6d0e4d8555fd3f7dedc24ccc27a5ac3209ea", 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" }), i("path", { key: "d6dca8d2887f09a6d7a95b84238ec7615e3530c3", 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" })), i("defs", { key: "5ea0838d988413517f09c07e413d97db3b942375" }, i("clipPath", { key: "dd0a31b400e699406e194711fcbc949d5f3c8304", id: "clip0_959_12452" }, i("rect", { key: "86cb4fe6ed9cada88e94516cf76ddaa3a2d62311", width: 24, height: 24, fill: "white" }))));
12
- }
13
- };
14
- Ft.style = Tt;
15
- const Ht = ".sc-microsoft-logo-icon-h{display:flex}", Bt = Ht, Dt = class {
16
- constructor(t) {
17
- A(this, t), this.width = "22", this.height = "22";
18
- }
19
- render() {
20
- return i("svg", { key: "da59f9b8e18c52e2ca12e97ce694b7abc30aea0d", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, i("path", { key: "ef4d02c0f11fd9df3a3e1a781d2379526404c469", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), i("path", { key: "9799ab150bbdee2cf4ec6275b2388fe2c00dd85e", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), i("path", { key: "65f7ee7dedd27844e342d2f1e7065814c6012c46", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), i("path", { key: "a21de9dcc8252feec5b07059371eba058b2d071c", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
21
- }
22
- };
23
- Dt.style = Bt;
24
- function Pt({ id: t, formState: e, activeTab: a, calendars: s, currentUser: r }) {
25
- switch (a) {
26
- case "eventInfo":
27
- const n = e.title, l = e.description, o = parseInt(e.duration), p = e.location, y = e.conferencing;
28
- return i(
29
- "div",
30
- { key: t },
31
- i(
32
- "nylas-event-info",
33
- null,
34
- i(
35
- "div",
36
- { slot: "inputs" },
37
- i("nylas-event-title", { name: "title", eventTitle: n, exportparts: "net, net__title, net__dropdown-content" }),
38
- i("nylas-event-duration", { name: "duration", eventDurationMinutes: o, exportparts: "ned, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content" }),
39
- i("nylas-event-location", { name: "location", eventLocation: p, eventConferencing: y, userProvider: r.provider, exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
40
- i("nylas-event-description", { name: "description", eventDescription: l, exportparts: "nedesc, nedesc__textarea" })
41
- )
42
- )
43
- );
44
- case "availability":
45
- const _ = e.availability.openHours, x = e.availability.timezone ? e.availability.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone;
46
- return i(
47
- "div",
48
- { key: t },
49
- i("nylas-participant-booking-calendars", { name: "participant-booking-calendars", participants: e.participants, calendars: s }),
50
- i("nylas-connected-calendars", { name: "connected-calendars", participants: e.participants }),
51
- i("nylas-availability-picker", { name: "availability", openHours: _, defaultTimezone: x, 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" })
52
- );
53
- case "bookingOptions":
54
- return i(
55
- "div",
56
- { key: t },
57
- i("nylas-buffer-time", { name: "buffer-time", buffer: e.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" }),
58
- i(
59
- "nylas-event-limits",
60
- null,
61
- i(
62
- "div",
63
- { slot: "inputs" },
64
- i("nylas-min-booking-notice", { name: "min-booking-notice", minBookingNotice: e.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" }),
65
- i("nylas-limit-future-bookings", { name: "limit-future-bookings", availableDaysInFuture: e.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" }),
66
- i("nylas-min-cancellation-notice", { name: "min-cancellation-notice", minCancellationNotice: e.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" }),
67
- i("nylas-cancellation-policy", { name: "cancellation-policy", cancellationPolicy: e.cancellationPolicy, exportparts: "ncpolicy, ncpolicy__textarea" })
68
- )
69
- ),
70
- i("nylas-timeslot-interval", { name: "timeslot-interval", eventDurationMinutes: parseInt(e.duration), exportparts: "nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content" }),
71
- i("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" })
72
- );
73
- case "participants":
74
- return i(
75
- "div",
76
- { key: t },
77
- i("nylas-additional-participants", { name: "participants", eventParticipants: e.participants, exportparts: "nap__title, nap__subtitle, nap__content, nap__input_group, nap__input_wrapper, nap__input, nap__remove-participant" }),
78
- i("nylas-participants-custom-availability", { name: "participant-custom-availability", participants: e.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" })
79
- );
80
- case "bookingForm":
81
- const S = Object.entries(e.additionalFields).map(([L, T]) => ({ key: L, ...T }));
82
- return i(
83
- "div",
84
- { key: t },
85
- i("nylas-booking-form-config", { name: "additional-fields", additonalFields: S })
86
- );
87
- }
88
- }
89
- const Nt = '.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}.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 = Nt;
90
- var Ot = function(t, e, a, s) {
91
- var r = arguments.length, n = r < 3 ? e : s === null ? s = Object.getOwnPropertyDescriptor(e, a) : s, l;
92
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
93
- n = Reflect.decorate(t, e, a, s);
94
- else
95
- for (var o = t.length - 1; o >= 0; o--)
96
- (l = t[o]) && (n = (r < 3 ? l(n) : r > 3 ? l(e, a, n) : l(e, a)) || n);
97
- return r > 3 && n && Object.defineProperty(e, a, n), n;
98
- }, U = function(t, e) {
99
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
100
- return Reflect.metadata(t, e);
101
- };
102
- const kt = class {
103
- constructor(t) {
104
- A(this, t), this.schedulerConfigChanged = C(this, "schedulerConfigChanged", 7), this.cancelButtonClick = C(this, "cancelButtonClick", 7), this.formSubmitted = C(this, "formSubmitted", 7), this.previewButtonClicked = C(this, "previewButtonClicked", 7), this.setError = (e) => {
105
- this.error = e.message;
106
- }, this.formSubmissionHandler = async (e) => {
107
- var N, V, J, G, W, q, K, Q, X, Y, tt, et, it, at, nt, st;
108
- if (e.preventDefault(), this.formSubmitted.emit(), !this.formRef.checkValidity()) {
109
- this.error = this.formRef.validationMessage || "Please fix the form errors.";
110
- return;
111
- }
112
- this.isLoading = !0, this.hasUnsavedChanges = !1;
113
- const s = this.updateFormState(), { title: r, description: n, duration: l, availability: o, bookingCalendar: p, location: y, bookingType: _, buffer: x, availableDaysInFuture: S, minCancellationNotice: L, minBookingNotice: T, cancellationPolicy: E, timeslotInterval: m, additionalGuestsHidden: O, hideCancellationOptions: I, hideReschedulingOptions: R, participants: v, participantOpenHours: b, additionalFields: M, participantCalendars: w, conferencing: z, participantBookingCalendars: g } = s, c = (V = (N = this.selectedConfiguration) == null ? void 0 : N.participants) == null ? void 0 : V.find((d) => d.is_organizer), k = w && (c != null && c.email) ? w[c == null ? void 0 : c.email] : [], B = ((J = c == null ? void 0 : c.booking) == null ? void 0 : J.calendar_id) || p, D = l ? parseInt(l) : 30, F = v && (v == null ? void 0 : v.length) > 0 ? v : [
114
- {
115
- name: (c == null ? void 0 : c.name) ?? ((G = this.currentUser) == null ? void 0 : G.name) ?? "",
116
- email: (c == null ? void 0 : c.email) ?? ((W = this.currentUser) == null ? void 0 : W.email) ?? "",
117
- is_organizer: !0,
118
- timezone: (o == null ? void 0 : o.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
119
- availability: {
120
- calendar_ids: k.length ? k : ["primary"],
121
- open_hours: []
122
- },
123
- booking: {
124
- calendar_id: p && p !== "" ? p : "primary"
125
- }
126
- }
127
- ], P = {
128
- ...((q = this.selectedConfiguration) == null ? void 0 : q.id) && { id: this.selectedConfiguration.id },
129
- version: ((K = this.selectedConfiguration) == null ? void 0 : K.version) ?? "1.0.0",
130
- availability: {
131
- duration_minutes: D,
132
- interval_minutes: (m == null ? void 0 : m.interval) ?? D,
133
- round_to: m == null ? void 0 : m.roundTo,
134
- availability_rules: {
135
- availability_method: ((Y = (X = (Q = this.selectedConfiguration) == null ? void 0 : Q.availability) == null ? void 0 : X.availability_rules) == null ? void 0 : Y.availability_method) ?? "collective",
136
- buffer: x || { before: 0, after: 0 },
137
- default_open_hours: (o == null ? void 0 : o.openHours) ?? ((it = (et = (tt = this.selectedConfiguration) == null ? void 0 : tt.availability) == null ? void 0 : et.availability_rules) == null ? void 0 : it.default_open_hours) ?? _t,
138
- round_robin_group_id: ((st = (nt = (at = this.selectedConfiguration) == null ? void 0 : at.availability) == null ? void 0 : nt.availability_rules) == null ? void 0 : st.round_robin_group_id) ?? ""
139
- }
140
- },
141
- participants: [
142
- ...F == null ? void 0 : F.map((d) => {
143
- var ot, rt, lt, dt, ct, bt, ht, ut, pt, yt, ft, mt, gt;
144
- return d.is_organizer ? {
145
- name: d.name ?? "",
146
- email: d.email,
147
- is_organizer: !0,
148
- timezone: ((rt = (ot = b == null ? void 0 : b[d.email]) == null ? void 0 : ot[0]) == null ? void 0 : rt.timezone) ?? ((ct = (dt = (lt = d.availability) == null ? void 0 : lt.open_hours) == null ? void 0 : dt[0]) == null ? void 0 : ct.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
149
- availability: {
150
- calendar_ids: k.length ? k : ["primary"],
151
- open_hours: (b == null ? void 0 : b[d.email]) ?? ((bt = d.availability) == null ? void 0 : bt.open_hours) ?? []
152
- },
153
- booking: {
154
- calendar_id: B || "primary"
155
- }
156
- } : {
157
- ...d,
158
- timezone: ((ut = (ht = b == null ? void 0 : b[d.email]) == null ? void 0 : ht[0]) == null ? void 0 : ut.timezone) ?? ((ft = (yt = (pt = d.availability) == null ? void 0 : pt.open_hours) == null ? void 0 : yt[0]) == null ? void 0 : ft.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
159
- availability: d.availability ? {
160
- calendar_ids: (w == null ? void 0 : w[d.email]) ?? ((mt = d.availability) == null ? void 0 : mt.calendar_ids) ?? ["primary"],
161
- open_hours: (b == null ? void 0 : b[d.email]) ?? ((gt = d.availability) == null ? void 0 : gt.open_hours) ?? []
162
- } : void 0,
163
- booking: g != null && g[d.email] ? { calendar_id: g == null ? void 0 : g[d.email] } : void 0
164
- };
165
- })
166
- ],
167
- event_booking: {
168
- title: (r == null ? void 0 : r.toString()) ?? "",
169
- description: (n == null ? void 0 : n.toString()) ?? "",
170
- location: (y == null ? void 0 : y.toString()) ?? "",
171
- booking_type: (_ == null ? void 0 : _.toString()) ?? "booking",
172
- timezone: (o == null ? void 0 : o.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
173
- conferencing: z
174
- },
175
- scheduler: {
176
- cancellation_policy: E ?? "",
177
- available_days_in_future: S ?? 30,
178
- min_cancellation_notice: L ?? 0,
179
- min_booking_notice: T ?? 60,
180
- hide_additional_guests: O ?? !1,
181
- hide_cancellation_options: I ?? !1,
182
- hide_rescheduling_options: R ?? !1,
183
- additional_fields: M
184
- }
185
- }, j = St(P, this.selectedConfiguration), h = this.action === "create" ? j : P;
186
- this.isConfigRoundRobin(h) && (h.participants = h.participants.map((d) => ({ ...d, is_organizer: void 0 })));
187
- const f = (d) => {
188
- this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
189
- this.changesSaved = !1;
190
- }, 5e3);
191
- };
192
- this.checkForClientSideErrors(h) || this.schedulerConfigChanged.emit({ config: h, resetLoadingState: f, setError: this.setError, action: this.action });
193
- }, this.isConfigRoundRobin = (e) => {
194
- var a, s, r, n;
195
- return ((s = (a = e.availability) == null ? void 0 : a.availability_rules) == null ? void 0 : s.availability_method) === "max-availability" || ((n = (r = e.availability) == null ? void 0 : r.availability_rules) == null ? void 0 : n.availability_method) === "max-fairness";
196
- }, this.checkForClientSideErrors = (e) => {
197
- var n;
198
- let a = !1, s = "";
199
- const r = (n = e.scheduler) == null ? void 0 : n.additional_fields;
200
- return r && (s = "Booking form error: ", Object.entries(r).forEach((l) => {
201
- const o = l[1];
202
- if (o.label === "") {
203
- s += `Label is required for field of type ${o.type}.`, a = !0;
204
- return;
205
- }
206
- if (o.options) {
207
- for (const p of o.options)
208
- if (p === "") {
209
- s += `Empty option detected inside ${o.label} of type ${o.type}.`, a = !0;
210
- break;
211
- }
212
- }
213
- })), a && (this.isLoading = !1, this.setError(new Error(s))), a;
214
- }, 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 = "";
215
- }
216
- configChangedHandler(t) {
217
- u("[nylas-editor-tabs]", "configChangedHandler", t, this.selectedConfiguration), this.formState = {
218
- ...this.getFormStateFromConfig(t)
219
- }, t.id ? this.action = "edit" : this.action = "create";
220
- }
221
- userChangedHandler(t) {
222
- u("[nylas-editor-tabs]", "userChangedHandler", t), t && (this.formState = {
223
- ...this.getFormStateFromConfig(this.selectedConfiguration)
224
- });
225
- }
226
- connectedCallback() {
227
- u("[nylas-editor-tabs]", "connectedCallback");
228
- }
229
- componentWillLoad() {
230
- u("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
231
- }
232
- componentDidLoad() {
233
- u("[nylas-editor-tabs]", "componentDidLoad");
234
- }
235
- disconnectedCallback() {
236
- u("[nylas-editor-tabs]", "disconnectedCallback");
237
- }
238
- handleValueChanged(t) {
239
- u("[nylas-editor-tabs]", "handleValueChanged", t);
240
- const { name: e, value: a } = t.detail;
241
- this.setFormState(a, e), this.formState = { ...this.formState }, this.hasUnsavedChanges = !0, this.error = "";
242
- }
243
- getFormStateFromConfig(t) {
244
- var a, s, r, n, l, o, p, y, _, x, S, L, T, E, m, O, I, R, v, b, M, w, z, g, c, k, B, D, F, P, j;
245
- let e = (a = t == null ? void 0 : t.participants) == null ? void 0 : a.find((h) => h.is_organizer);
246
- return !e && ((r = (s = t == null ? void 0 : t.availability) == null ? void 0 : s.availability_rules) == null ? void 0 : r.availability_method) !== "collective" && (e = (n = t == null ? void 0 : t.participants) == null ? void 0 : n.find((h) => {
247
- var f;
248
- return h.email === ((f = this.currentUser) == null ? void 0 : f.email);
249
- }), e && (e.is_organizer = !0)), {
250
- title: ((l = t == null ? void 0 : t.event_booking) == null ? void 0 : l.title) ?? "",
251
- description: ((o = t == null ? void 0 : t.event_booking) == null ? void 0 : o.description) ?? "",
252
- duration: ((y = (p = t == null ? void 0 : t.availability) == null ? void 0 : p.duration_minutes) == null ? void 0 : y.toString()) ?? "30",
253
- availability: {
254
- timezone: ((_ = t == null ? void 0 : t.event_booking) == null ? void 0 : _.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
255
- openHours: ((S = (x = t == null ? void 0 : t.availability) == null ? void 0 : x.availability_rules) == null ? void 0 : S.default_open_hours) ?? _t
256
- },
257
- additionalFields: ((L = t == null ? void 0 : t.scheduler) == null ? void 0 : L.additional_fields) ?? {},
258
- conferencing: ((T = t == null ? void 0 : t.event_booking) == null ? void 0 : T.conferencing) ?? {},
259
- calendarIds: ((E = e == null ? void 0 : e.availability) == null ? void 0 : E.calendar_ids) ?? [],
260
- participants: (t == null ? void 0 : t.participants) ?? [],
261
- bookingCalendar: ((m = e == null ? void 0 : e.booking) == null ? void 0 : m.calendar_id) ?? (e == null ? void 0 : e.email) ?? "",
262
- location: ((O = t == null ? void 0 : t.event_booking) == null ? void 0 : O.location) ?? "",
263
- bookingType: ((I = t == null ? void 0 : t.event_booking) == null ? void 0 : I.booking_type) ?? "booking",
264
- buffer: ((v = (R = t == null ? void 0 : t.availability) == null ? void 0 : R.availability_rules) == null ? void 0 : v.buffer) ?? { before: 0, after: 0 },
265
- cancellationPolicy: ((b = t == null ? void 0 : t.scheduler) == null ? void 0 : b.cancellation_policy) ?? "",
266
- availableDaysInFuture: ((M = t == null ? void 0 : t.scheduler) == null ? void 0 : M.available_days_in_future) ?? 30,
267
- minCancellationNotice: ((w = t == null ? void 0 : t.scheduler) == null ? void 0 : w.min_cancellation_notice) ?? 0,
268
- minBookingNotice: ((z = t == null ? void 0 : t.scheduler) == null ? void 0 : z.min_booking_notice) ?? 60,
269
- timeslotInterval: {
270
- interval: ((g = t == null ? void 0 : t.availability) == null ? void 0 : g.interval_minutes) ?? ((c = t == null ? void 0 : t.availability) == null ? void 0 : c.duration_minutes),
271
- roundTo: (k = t == null ? void 0 : t.availability) == null ? void 0 : k.round_to
272
- },
273
- additionalGuestsHidden: ((B = t == null ? void 0 : t.scheduler) == null ? void 0 : B.hide_additional_guests) ?? !1,
274
- hideCancellationOptions: ((D = t == null ? void 0 : t.scheduler) == null ? void 0 : D.hide_cancellation_options) ?? !1,
275
- hideReschedulingOptions: ((F = t == null ? void 0 : t.scheduler) == null ? void 0 : F.hide_rescheduling_options) ?? !1,
276
- participantBookingCalendars: ((P = t == null ? void 0 : t.participants) == null ? void 0 : P.reduce((h, f) => {
277
- var H, N;
278
- return (H = f.booking) != null && H.calendar_id && (h[f.email] = (N = f.booking) == null ? void 0 : N.calendar_id), h;
279
- })) ?? {},
280
- participantCalendars: ((j = t == null ? void 0 : t.participants) == null ? void 0 : j.reduce((h, f) => {
281
- var H;
282
- return h[f.email] = (H = f.availability) == null ? void 0 : H.calendar_ids, h;
283
- }, {})) ?? {}
284
- };
285
- }
286
- setFormState(t, e) {
287
- switch (e) {
288
- case "title":
289
- this.formState.title = t.toString();
290
- break;
291
- case "description":
292
- this.formState.description = t.toString();
293
- break;
294
- case "duration":
295
- this.formState.duration = t.toString();
296
- break;
297
- case "availability":
298
- this.formState.availability = JSON.parse(t.toString());
299
- break;
300
- case "participants":
301
- this.formState.participants = JSON.parse(t.toString());
302
- break;
303
- case "booking-calendar":
304
- this.formState.bookingCalendar = t.toString();
305
- break;
306
- case "participant-booking-calendars":
307
- this.formState.participantBookingCalendars = JSON.parse(t.toString());
308
- break;
309
- case "location":
310
- this.formState.location = t.toString();
311
- break;
312
- case "conference":
313
- this.formState.conferencing = JSON.parse(t.toString());
314
- break;
315
- case "booking-type":
316
- this.formState.bookingType = t.toString();
317
- break;
318
- case "buffer-time":
319
- this.formState.buffer = JSON.parse(t.toString());
320
- break;
321
- case "limit-future-bookings":
322
- this.formState.availableDaysInFuture = parseInt(t.toString());
323
- break;
324
- case "min-cancellation-notice":
325
- this.formState.minCancellationNotice = parseInt(t.toString());
326
- break;
327
- case "min-booking-notice":
328
- this.formState.minBookingNotice = parseInt(t.toString());
329
- break;
330
- case "cancellation-policy":
331
- this.formState.cancellationPolicy = t.toString();
332
- break;
333
- case "timeslot-interval":
334
- this.formState.timeslotInterval = JSON.parse(t.toString());
335
- break;
336
- case "customize-booking-settings":
337
- const a = JSON.parse(t.toString());
338
- this.formState.additionalGuestsHidden = a.additionalGuestsHidden, this.formState.hideCancellationOptions = a.hideCancellationOptions, this.formState.hideReschedulingOptions = a.hideReschedulingOptions;
339
- break;
340
- case "participant-custom-availability":
341
- const s = JSON.parse(t.toString());
342
- this.formState.participantOpenHours = s;
343
- break;
344
- case "additional-fields":
345
- this.formState.additionalFields = t;
346
- break;
347
- case "connected-calendars":
348
- this.formState.participantCalendars = JSON.parse(t.toString());
349
- break;
350
- }
351
- }
352
- updateFormState() {
353
- return new FormData(this.formRef).forEach((e, a) => {
354
- this.setFormState(e, a);
355
- }), this.formState = { ...this.formState }, this.formState;
356
- }
357
- setActiveTab(t, e) {
358
- t.preventDefault(), this.updateFormState(), this.activeTab = e;
359
- }
360
- hideTab(t) {
361
- var e;
362
- return ((e = this.hideEditorTabs) == null ? void 0 : e.includes(t)) || !1;
363
- }
364
- render() {
365
- var t;
366
- return u("[nylas-editor-tabs]", "render", this.formState), i(vt, { key: "8910be39d85bb9f663d86272d170927489970d83" }, i("form", { key: "51a1bc5e0d186aed0a3b24b5285a86dcfc06ff23", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (e) => this.formRef = e, noValidate: !0 }, this.mode === "app" ? i("div", { class: "form-contents" }, i("div", { class: "tabs" }, i("button", { class: { tab: !0, active: this.activeTab == "eventInfo", hide: this.hideTab("eventInfo") }, part: "editortab__event-info", onClick: (e) => this.setActiveTab(e, "eventInfo") }, i("calendar-info-icon", { width: "16", height: "16" }), "Event info"), i("button", { class: { tab: !0, active: this.activeTab == "availability", hide: this.hideTab("availability") }, part: "editortab__availability", onClick: (e) => this.setActiveTab(e, "availability") }, i("calendar-patterns-icon", { width: "16", height: "16" }), "Availability"), i("button", { class: { tab: !0, active: this.activeTab == "participants", hide: this.hideTab("participants") }, part: "editortab__participants", onClick: (e) => this.setActiveTab(e, "participants") }, i("people-icon", { width: "16", height: "16" }), "Participants"), i("button", { class: { tab: !0, active: this.activeTab == "bookingOptions", hide: this.hideTab("bookingOptions") }, part: "editortab__booking-options", onClick: (e) => this.setActiveTab(e, "bookingOptions") }, i("flow-icon", { width: "16", height: "16" }), "Booking options"), i("button", { class: { tab: !0, active: this.activeTab == "bookingForm", hide: this.hideTab("bookingForm") }, part: "editortab__booking-form", onClick: (e) => this.setActiveTab(e, "bookingForm") }, this.activeTab == "bookingForm" ? i("calendar-agenda-fill-icon", { width: "16", height: "16" }) : i("calendar-agenda-icon", { width: "16", height: "16" }), "Booking form")), i("div", { class: "tab-content" }, i(Pt, { formState: this.formState, activeTab: this.activeTab, currentUser: this.currentUser, calendars: this.calendars, id: ((t = this.selectedConfiguration) == null ? void 0 : t.id) ?? "new" }))) : i("slot", null), i("div", { key: "ba21b8b6dd0da3d2e7770693428771da98ae12b7", class: "footer" }, i("div", { key: "a6ba70fe5a29ebc4565c3483cfdb9451c8feb45b", class: "preview" }, this.schedulerPreviewLink !== "" && this.action === "edit" && i("button-component", { type: "button", disabled: this.isLoading, clickHandler: (e) => {
367
- e.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(Z(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
368
- }, variant: "basic" }, "Preview")), i("div", { key: "f3c639c62c31b9717bca42f67ea8d11cead03c15", class: "buttons" }, i("p", { key: "a45a7d9c0d473b81d792547a1fe819686d7a93f3", class: {
369
- "unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
370
- "saved-changes": this.changesSaved,
371
- error: this.error !== "",
372
- "error-full-width": this.error !== "" && this.action === "create"
373
- } }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.error == "" && this.changesSaved ? "Changes saved!" : ""), i("button-component", { key: "61f8b4845edc4c84fb1fa11c00c2b798b543d86c", type: "button", disabled: this.isLoading, clickHandler: (e) => {
374
- e.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
375
- }, variant: "basic" }, "Back"), i("button-component", { key: "cc1d668a38e6823cb63c2a127d6c51688c285a35", type: "submit", disabled: this.isLoading }, this.isLoading ? i("span", null, "Saving", i("loading-icon", null), " ") : this.action == "create" ? "Create" : "Save changes")))));
376
- }
377
- get host() {
378
- return wt(this);
379
- }
380
- static get watchers() {
381
- return {
382
- selectedConfiguration: ["configChangedHandler"],
383
- currentUser: ["userChangedHandler"]
384
- };
385
- }
386
- };
387
- Ot([
388
- Ct({
389
- name: "nylas-editor-tabs",
390
- stateToProps: /* @__PURE__ */ new Map([
391
- ["schedulerConfig.calendars", "calendars"],
392
- ["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
393
- ["schedulerConfig.currentUser", "currentUser"],
394
- ["schedulerConfig.hideEditorTabs", "hideEditorTabs"]
395
- ]),
396
- eventToProps: {
397
- schedulerConfigChanged: async (t, e) => {
398
- const { resetLoadingState: a, setError: s, action: r, config: n } = t.detail, l = (o) => {
399
- const [p, y] = o;
400
- !p && y && s && s(y), a && a(t);
401
- };
402
- if (r === "edit") {
403
- const o = await e.schedulerConfig.updateConfiguration(n);
404
- l(o);
405
- } else {
406
- const o = await e.schedulerConfig.createConfiguration(n);
407
- l(o);
408
- }
409
- },
410
- cancelButtonClick: async (t, e) => {
411
- e.schedulerConfigStore.state.action = null;
412
- },
413
- previewButtonClicked: async (t, e) => {
414
- u("[nylas-editor-tabs]", "previewButtonClicked", e);
415
- },
416
- formSubmitted: async (t, e) => {
417
- u("[nylas-editor-tabs]", "formSubmitted", e);
418
- }
419
- },
420
- localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
421
- fireRegisterEvent: !0
422
- }),
423
- U("design:type", Function),
424
- U("design:paramtypes", []),
425
- U("design:returntype", void 0)
426
- ], kt.prototype, "render", null);
427
- kt.style = Et;
428
- const It = ':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{display:flex;flex-direction:column}.configurations table .title .config-event-title{font-weight:600}.configurations table .title .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)}', Rt = It;
429
- var Mt = function(t, e, a, s) {
430
- var r = arguments.length, n = r < 3 ? e : s === null ? s = Object.getOwnPropertyDescriptor(e, a) : s, l;
431
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
432
- n = Reflect.decorate(t, e, a, s);
433
- else
434
- for (var o = t.length - 1; o >= 0; o--)
435
- (l = t[o]) && (n = (r < 3 ? l(n) : r > 3 ? l(e, a, n) : l(e, a)) || n);
436
- return r > 3 && n && Object.defineProperty(e, a, n), n;
437
- }, $ = function(t, e) {
438
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
439
- return Reflect.metadata(t, e);
440
- };
441
- const xt = class {
442
- constructor(t) {
443
- A(this, t), this.initListConfigurations = C(this, "initListConfigurations", 7), this.createButtonClick = C(this, "createButtonClick", 7), this.editButtonClick = C(this, "editButtonClick", 7), this.deleteButtonClick = C(this, "deleteButtonClick", 7), this.configurations = [], this.schedulerPreviewLink = "", this.listConfigurationsNextCursor = void 0, this.state = "loading", this.error = "", this.currentCursor = null, this.previousCursors = [], this.disableNextPageButton = !1;
444
- }
445
- listConfigurationsNextCursorChangedHandler(t, e) {
446
- if (!t || t === e) {
447
- t === null && (this.disableNextPageButton = !0);
448
- return;
449
- }
450
- this.disableNextPageButton = !1, this.currentCursor = t;
451
- }
452
- connectedCallback() {
453
- u("[nylas-list-configurations]", "connectedCallback");
454
- }
455
- componentWillLoad() {
456
- u("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
457
- }
458
- componentDidLoad() {
459
- u("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit({
460
- host: this.host
461
- });
462
- }
463
- disconnectedCallback() {
464
- u("[nylas-list-configurations]", "disconnectedCallback");
465
- }
466
- async handleNylasFormDropdownChanged(t) {
467
- u("[nylas-list-configurations]", "handleNylasFormDropdownChanged", t.detail);
468
- const { value: e } = t.detail, [a, s] = e.split("-");
469
- switch (t.preventDefault(), a) {
470
- case "delete":
471
- this.deleteButtonClick.emit({ host: this.host, configuration: this.configurations[s] });
472
- break;
473
- case "preview":
474
- window.open(Z(this.schedulerPreviewLink, this.configurations[s]), "_blank");
475
- break;
476
- case "copy":
477
- await navigator.clipboard.writeText(Z(this.schedulerPreviewLink, this.configurations[s]));
478
- break;
479
- }
480
- }
481
- async getState() {
482
- return this.state;
483
- }
484
- async setState(t) {
485
- this.state = t;
486
- }
487
- async setError(t) {
488
- this.error = t;
489
- }
490
- getDurationString(t) {
491
- const e = Math.floor(t / 60), a = t % 60;
492
- return `${e || ""} ${e ? `${e > 1 ? "hours" : "hour"}` : ""} ${a || ""} ${a ? `${a > 1 ? "mins" : "min"}` : ""}`;
493
- }
494
- getActionLabelHTML(t) {
495
- const e = {
496
- display: "inline-flex",
497
- alignItems: "center",
498
- gap: "0.5rem"
499
- }, a = {
500
- color: "var(--nylas-error)"
501
- };
502
- switch (t) {
503
- case "preview":
504
- return i("span", { style: e }, i("eye-icon", { width: "16", height: "16" }), "Preview");
505
- case "copy":
506
- return i("span", { style: e }, i("copy-icon", { width: "16", height: "16" }), "Copy");
507
- case "delete":
508
- return i("span", { style: { ...e, ...a } }, i("delete-icon", { width: "15", height: "17" }), "Delete");
509
- default:
510
- return "";
511
- }
512
- }
513
- previousPageClickedHandler() {
514
- if (this.previousCursors.length === 0)
515
- return;
516
- this.currentCursor = this.previousCursors.pop() || null;
517
- const t = this.previousCursors[this.previousCursors.length - 1] || void 0;
518
- this.initListConfigurations.emit({
519
- host: this.host,
520
- cursor: t
521
- });
522
- }
523
- nextPageClickedHandler() {
524
- this.currentCursor && (this.previousCursors = [...this.previousCursors, this.currentCursor], this.initListConfigurations.emit({
525
- host: this.host,
526
- cursor: this.currentCursor
527
- }));
528
- }
529
- render() {
530
- return i(vt, null, i("div", { class: "header" }, i("div", { class: "description" }, i("h2", null, "All scheduling pages"), i("p", null, "Create, edit and manage all your scheduling pages.")), this.configurations && this.configurations.length > 0 && i("div", { class: "actions" }, i("button-component", { clickHandler: () => {
531
- this.createButtonClick.emit(this.host);
532
- } }, "Create new"))), i("div", { class: "configurations" }, i("table", { class: {
533
- "no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
534
- } }, i("tr", { class: {
535
- hide: this.state === "loading" || this.configurations && this.configurations.length === 0
536
- } }, i("th", null, "Scheduling page title"), i("th", null, "Duration"), i("th", { class: "actions-header" }, "Actions")), this.state === "loading" && i("tr", { class: "no-configurations" }, i("td", { colSpan: 3 }, i("div", null, i("h3", null, "Loading..."), i("p", null, "Please wait while we fetch the scheduling pages")))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && i("tr", { class: "no-configurations" }, i("td", { colSpan: 3 }, i("div", null, i("calendar-icon", { width: "48", height: "48" }), i("h3", null, "No scheduling pages found"), i("p", null, "Get started with creating your first scheduling page"), i("button-component", { clickHandler: () => {
537
- this.createButtonClick.emit(this.host);
538
- } }, "Create new")))), this.state !== "loading" && this.configurations.map((t, e) => i("tr", { key: t.id }, i("td", null, i("div", { class: "title" }, i("span", { class: "config-event-title" }, t.event_booking.title), i("span", { class: "config-event-description" }, t.event_booking.description))), i("td", null, i("div", null, this.getDurationString(t.availability.duration_minutes))), i("td", null, i("div", { class: "actions" }, i("button-component", { variant: "basic", key: `edit-${e}`, clickHandler: (a) => {
539
- a.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: t });
540
- } }, i("edit-icon", { width: "16", height: "16" }), "Edit"), i("select-dropdown", { name: "actions", options: [
541
- { value: `preview-${e}`, label: "Preview", labelHTML: this.getActionLabelHTML("preview") },
542
- { value: `copy-${e}`, label: "Copy link", labelHTML: this.getActionLabelHTML("copy") },
543
- { value: `delete-${e}`, label: "Delete", labelHTML: this.getActionLabelHTML("delete") }
544
- ], 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" })))))), i("div", { class: "pagination" }, i("button", { class: "arrow left", onClick: () => this.previousPageClickedHandler(), disabled: this.previousCursors.length <= 0 }, i("chevron-icon", null)), i("button", { class: "arrow right", onClick: () => this.nextPageClickedHandler(), disabled: this.disableNextPageButton }, i("chevron-icon", null)))), this.state === "error" && i("div", { class: "error-container" }, i("p", { class: "error" }, this.error)));
545
- }
546
- get host() {
547
- return wt(this);
548
- }
549
- static get watchers() {
550
- return {
551
- listConfigurationsNextCursor: ["listConfigurationsNextCursorChangedHandler"]
552
- };
553
- }
554
- };
555
- Mt([
556
- Ct({
557
- name: "nylas-list-configurations",
558
- stateToProps: /* @__PURE__ */ new Map([
559
- ["schedulerConfig.configurations", "configurations"],
560
- ["schedulerConfig.listConfigurationsNextCursor", "listConfigurationsNextCursor"]
561
- ]),
562
- localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
563
- eventToProps: {
564
- initListConfigurations: async (t, e) => {
565
- const { host: a, cursor: s } = t.detail;
566
- await a.setState("loading");
567
- const [r, n] = await e.schedulerConfig.getConfigurations(s);
568
- if (!r && n && n.message) {
569
- await a.setState("error"), await a.setError(n.message);
570
- return;
571
- }
572
- await a.setState("loaded");
573
- },
574
- createButtonClick: async (t, e) => {
575
- e.schedulerConfigStore.resetSelectedConfiguration(), e.schedulerConfigStore.state.action = "create";
576
- },
577
- deleteButtonClick: async (t, e) => {
578
- const { host: a, configuration: s } = t.detail, [r, n] = await e.schedulerConfig.deleteConfiguration(s.id);
579
- !r && n && n.message && (await a.setState("error"), await a.setError(n.message));
580
- },
581
- editButtonClick: async (t, e) => {
582
- const { configuration: a } = t.detail;
583
- e.schedulerConfigStore.state.selectedConfiguration = a, e.schedulerConfigStore.state.action = "edit";
584
- }
585
- },
586
- fireRegisterEvent: !0
587
- }),
588
- $("design:type", Function),
589
- $("design:paramtypes", []),
590
- $("design:returntype", void 0)
591
- ], xt.prototype, "render", null);
592
- xt.style = Rt;
593
- export {
594
- Ft as google_logo_icon,
595
- Dt as microsoft_logo_icon,
596
- kt as nylas_editor_tabs,
597
- xt as nylas_list_configurations
598
- };
@@ -1,5 +0,0 @@
1
- import { i as o } from "./index-a68236be.js";
2
- var r = o.process;
3
- export {
4
- r as p
5
- };
@@ -1 +0,0 @@
1
- "use strict";const s=require("./index-a4831dfe.cjs");var e=s.commonjsGlobal.process;exports.process=e;