@nylas/react 1.0.2-prealpha1 → 1.1.0-canary.4

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 (133) hide show
  1. package/dist/add-circle-icon_22.entry-077661c3.cjs +1 -0
  2. package/dist/add-circle-icon_22.entry-f699d91e.js +1733 -0
  3. package/dist/{archive-icon_7.entry-91aaa1aa.js → archive-icon_7.entry-40b7ef3b.js} +20 -20
  4. package/dist/{archive-icon_7.entry-84d70dbf.cjs → archive-icon_7.entry-e8630de9.cjs} +1 -1
  5. package/dist/arrow-icon.entry-58246303.js +15 -0
  6. package/dist/{arrow-icon.entry-400a08fa.cjs → arrow-icon.entry-ffa53114.cjs} +1 -1
  7. package/dist/{bold-icon_3.entry-9ad35153.cjs → bold-icon_3.entry-106a4e77.cjs} +1 -1
  8. package/dist/{bold-icon_3.entry-4b2798a8.js → bold-icon_3.entry-f5f1643d.js} +4 -4
  9. package/dist/{calendar-cancel-icon.entry-fcb66929.cjs → calendar-cancel-icon.entry-6ae0fd0f.cjs} +1 -1
  10. package/dist/{calendar-cancel-icon.entry-83ba884a.js → calendar-cancel-icon.entry-75b15b19.js} +4 -4
  11. package/dist/calendar-check-icon_2.entry-57339318.js +25 -0
  12. package/dist/calendar-check-icon_2.entry-c57f83f3.cjs +1 -0
  13. package/dist/{calendar-icon.entry-8f38af4a.js → calendar-icon.entry-2069fec6.js} +2 -2
  14. package/dist/{calendar-icon.entry-7bae38d7.cjs → calendar-icon.entry-492c2630.cjs} +1 -1
  15. package/dist/chevron-icon_3.entry-83df50c3.js +117 -0
  16. package/dist/chevron-icon_3.entry-878ff6df.cjs +1 -0
  17. package/dist/close-icon.entry-480c199d.js +15 -0
  18. package/dist/close-icon.entry-8015ca05.cjs +1 -0
  19. package/dist/{nylas-booked-event-card_10.entry-7e66a648.js → constants-6ee60d6d-4cd16450.js} +1656 -2374
  20. package/dist/{nylas-booked-event-card_10.entry-ed515326.cjs → constants-6ee60d6d-6c0540db.cjs} +6 -6
  21. package/dist/document-refresh-icon.entry-06f7972b.cjs +1 -0
  22. package/dist/document-refresh-icon.entry-09870b14.js +15 -0
  23. package/dist/elements/index.d.ts +31 -2
  24. package/dist/{forward-icon_6.entry-b60fcb35.js → forward-icon_6.entry-8bb201eb.js} +127 -127
  25. package/dist/{forward-icon_6.entry-3345af84.cjs → forward-icon_6.entry-eeecf2a2.cjs} +3 -3
  26. package/dist/{globe-icon.entry-8325e73e.cjs → globe-icon.entry-a690028c.cjs} +1 -1
  27. package/dist/{globe-icon.entry-e3fd373f.js → globe-icon.entry-d515cbfa.js} +4 -4
  28. package/dist/google-logo-icon_3.entry-2164cec1.js +258 -0
  29. package/dist/google-logo-icon_3.entry-b2b85284.cjs +1 -0
  30. package/dist/index-2b8437d6.cjs +30 -0
  31. package/dist/index-db0c5017.js +1824 -0
  32. package/dist/index.d.ts +3 -1
  33. package/dist/index.es-2578c6a5-098d48d0.cjs +7 -0
  34. package/dist/{index-b30d446a-a90f84b2.js → index.es-2578c6a5-71441142.js} +833 -933
  35. package/dist/info-icon_2.entry-300ef196.js +34 -0
  36. package/dist/info-icon_2.entry-e286aaa5.cjs +1 -0
  37. package/dist/{loading-icon.entry-27410cf8.js → loading-icon.entry-6d8adaa4.js} +4 -4
  38. package/dist/{loading-icon.entry-b2096d2b.cjs → loading-icon.entry-dc40e97d.cjs} +1 -1
  39. package/dist/{mailbox-store-19f0c6c9-e3e8b4e5.js → mailbox-store-bb21512c-649a374c.js} +17 -16
  40. package/dist/mailbox-store-bb21512c-fc3c8c03.cjs +1 -0
  41. package/dist/nylas-additional-participants.entry-4afba192.js +83 -0
  42. package/dist/nylas-additional-participants.entry-db05e510.cjs +1 -0
  43. package/dist/nylas-booked-event-card_10.entry-1ebbe0c0.js +784 -0
  44. package/dist/nylas-booked-event-card_10.entry-6b6fdfae.cjs +1 -0
  45. package/dist/nylas-form-card.entry-70b20571.cjs +1 -0
  46. package/dist/nylas-form-card.entry-7bc23695.js +56 -0
  47. package/dist/nylas-if-state.entry-3829cb3d.js +96 -0
  48. package/dist/nylas-if-state.entry-ebeffe22.cjs +1 -0
  49. package/dist/nylas-list-folders.entry-191688f2.cjs +1 -0
  50. package/dist/{nylas-list-folders.entry-a5437201.js → nylas-list-folders.entry-7347e78d.js} +9 -8
  51. package/dist/{nylas-list-threads.entry-fd6cda61.js → nylas-list-threads.entry-432a8d8c.js} +5 -4
  52. package/dist/nylas-list-threads.entry-44658578.cjs +1 -0
  53. package/dist/nylas-login.entry-5311f0a7.js +75 -0
  54. package/dist/nylas-login.entry-db17a3d2.cjs +1 -0
  55. package/dist/{nylas-mailbox-pagination.entry-988214bc.js → nylas-mailbox-pagination.entry-20150fb2.js} +4 -3
  56. package/dist/nylas-mailbox-pagination.entry-9d3f5baa.cjs +1 -0
  57. package/dist/nylas-mailbox-toolbar-button.entry-6c0f7299.cjs +1 -0
  58. package/dist/{nylas-mailbox-toolbar-button.entry-c720e22a.js → nylas-mailbox-toolbar-button.entry-eec426d5.js} +11 -10
  59. package/dist/nylas-mailbox.entry-b6c758b9.js +136 -0
  60. package/dist/nylas-mailbox.entry-d41401e0.cjs +1 -0
  61. package/dist/{nylas-provider.entry-70721009.js → nylas-provider.entry-271cafd2.js} +46 -33
  62. package/dist/nylas-provider.entry-6173b721.cjs +1 -0
  63. package/dist/nylas-scheduler-editor.entry-0c75d39e.cjs +7 -0
  64. package/dist/nylas-scheduler-editor.entry-b51ad4b1.js +2192 -0
  65. package/dist/nylas-scheduling.entry-081c8825.cjs +1 -0
  66. package/dist/nylas-scheduling.entry-0a8d1da8.js +237 -0
  67. package/dist/{nylas-threads-refresh.entry-b7f9e93f.js → nylas-threads-refresh.entry-72dd854e.js} +6 -5
  68. package/dist/nylas-threads-refresh.entry-c3509e6a.cjs +1 -0
  69. package/dist/nylas-threads-search.entry-16a59ef6.cjs +1 -0
  70. package/dist/{nylas-threads-search.entry-95afea9c.js → nylas-threads-search.entry-4750a187.js} +15 -14
  71. package/dist/nylas-view-thread.entry-27df3349.cjs +1 -0
  72. package/dist/{nylas-view-thread.entry-165173b1.js → nylas-view-thread.entry-c6adce43.js} +5 -4
  73. package/dist/people-icon.entry-342be0c8.js +15 -0
  74. package/dist/people-icon.entry-35252ca9.cjs +1 -0
  75. package/dist/play-icon_2.entry-0787352c.js +25 -0
  76. package/dist/play-icon_2.entry-f83fa92a.cjs +1 -0
  77. package/dist/react.cjs +1 -1
  78. package/dist/react.js +92 -61
  79. package/dist/{refresh-icon.entry-e48a338f.js → refresh-icon.entry-8fbabfe7.js} +2 -2
  80. package/dist/{refresh-icon.entry-601cac89.cjs → refresh-icon.entry-ddbc5446.cjs} +1 -1
  81. package/dist/{register-component-152c6ad2-a06f58c2.js → register-component-dc659dc3-e43e8fae.js} +2 -2
  82. package/dist/{register-component-152c6ad2-0df7215b.cjs → register-component-dc659dc3-fb85ee68.cjs} +1 -1
  83. package/dist/scheduler-config-store-51ee4f42-66f8c2ac.js +14 -0
  84. package/dist/scheduler-config-store-51ee4f42-d7d9c25d.cjs +1 -0
  85. package/dist/scheduler-store-72116723-ce4c7a69.cjs +1 -0
  86. package/dist/{scheduler-store-7d48e682-0c0c3991.js → scheduler-store-72116723-e5f87122.js} +100 -95
  87. package/dist/time-period-selector.entry-333942a8.js +78 -0
  88. package/dist/time-period-selector.entry-78d5b3c2.cjs +1 -0
  89. package/dist/translate-icon.entry-87a62108.js +15 -0
  90. package/dist/translate-icon.entry-cb19864c.cjs +1 -0
  91. package/dist/utils-c00bdc3c-89ab163d.js +2111 -0
  92. package/dist/utils-c00bdc3c-94b9c3b6.cjs +8 -0
  93. package/dist/warning-icon.entry-50755d91.cjs +1 -0
  94. package/dist/warning-icon.entry-7a72e24a.js +15 -0
  95. package/package.json +7 -4
  96. package/dist/add-circle-icon.entry-2ccb238b.cjs +0 -1
  97. package/dist/add-circle-icon.entry-35d6aa07.js +0 -15
  98. package/dist/arrow-icon.entry-8b2e96a6.js +0 -15
  99. package/dist/calendar-check-icon_3.entry-903e2d82.js +0 -35
  100. package/dist/calendar-check-icon_3.entry-a16ce05e.cjs +0 -1
  101. package/dist/chevron-icon.entry-58366662.cjs +0 -1
  102. package/dist/chevron-icon.entry-5e11cef5.js +0 -15
  103. package/dist/close-icon_2.entry-011d9cf4.js +0 -25
  104. package/dist/close-icon_2.entry-83088b9a.cjs +0 -1
  105. package/dist/document-refresh-icon.entry-071ffd66.cjs +0 -1
  106. package/dist/document-refresh-icon.entry-9083a2e9.js +0 -15
  107. package/dist/duration-bddc4a13-05d3e3e2.cjs +0 -1
  108. package/dist/duration-bddc4a13-179ce826.js +0 -41
  109. package/dist/index-3b6f5cd5.cjs +0 -30
  110. package/dist/index-630f4e87.js +0 -1498
  111. package/dist/index-b30d446a-cbbef925.cjs +0 -7
  112. package/dist/mailbox-store-19f0c6c9-a0cbfa97.cjs +0 -1
  113. package/dist/nylas-if-state_3.entry-504be976.cjs +0 -1
  114. package/dist/nylas-if-state_3.entry-e96d01f1.js +0 -291
  115. package/dist/nylas-list-folders.entry-866361cc.cjs +0 -1
  116. package/dist/nylas-list-threads.entry-04989295.cjs +0 -1
  117. package/dist/nylas-mailbox-pagination.entry-e0bd4aef.cjs +0 -1
  118. package/dist/nylas-mailbox-toolbar-button.entry-3d772b26.cjs +0 -1
  119. package/dist/nylas-open-hours-picker.entry-6bdc7c73.js +0 -186
  120. package/dist/nylas-open-hours-picker.entry-881b6db7.cjs +0 -1
  121. package/dist/nylas-provider.entry-8d9a844b.cjs +0 -1
  122. package/dist/nylas-scheduler.entry-7321e18f.js +0 -230
  123. package/dist/nylas-scheduler.entry-e82977fb.cjs +0 -1
  124. package/dist/nylas-threads-refresh.entry-477e68e4.cjs +0 -1
  125. package/dist/nylas-threads-search.entry-c5854641.cjs +0 -1
  126. package/dist/nylas-view-thread.entry-8b72cbdb.cjs +0 -1
  127. package/dist/play-icon_2.entry-ed5877e3.js +0 -25
  128. package/dist/play-icon_2.entry-f23ed6c1.cjs +0 -1
  129. package/dist/scheduler-store-7d48e682-674705ef.cjs +0 -1
  130. package/dist/search-icon_3.entry-292138c3.js +0 -101
  131. package/dist/search-icon_3.entry-8e555357.cjs +0 -1
  132. package/dist/utils-5074a070-ce33ee6b.js +0 -119
  133. package/dist/utils-5074a070-d5ba6add.cjs +0 -2
package/dist/react.js CHANGED
@@ -1,66 +1,97 @@
1
+ import { A as n, e as l, f as c, B as i, i as t, C as r, j as y, k as N, l as I, m as d, n as C, o as m, p, D as f, q as h, t as u, v as k, G as g, w as S, I as E, x as P, y as T, L as v, z as L, E as B, M as w, J as b, K as F, O as M, P as x, Q as A, R as D, S as R, T as G, U as W, V as q, W as z, X as V, Y as j, Z as O, _ as U, $ as H, a0 as J, a1 as K, a2 as Q, a3 as X, N as Y, a4 as Z, a5 as _, a6 as $, a7 as aa, a8 as sa, a9 as oa, aa as ea, ab as na, ac as la, ad as ca, ae as ia, af as ta, ag as ra, ah as ya, ai as Na, aj as Ia, ak as da, al as Ca, am as ma, an as pa, ao as fa, ap as ha, aq as ua, ar as ka, as as ga, at as Sa, au as Ea, av as Pa, aw as Ta, ax as va, ay as La, az as Ba, aA as wa, aB as ba, aC as Fa, aD as Ma, aE as xa, aF as Aa, aG as Da, aH as Ra, aI as Ga, b as Wa, d as qa, s as za, u as Va } from "./index-db0c5017.js";
1
2
  import "react";
2
- import { A as l, e as n, i as c, B as r, C as i, j as I, k as y, l as t, m as N, n as d, D as C, o as m, p as h, G as p, I as S, q as k, L as b, N as u, s as P, t as T, v as f, w as g, x as v, y as w, z as x, E as B, J as E, K as L, M, O as R, P as A, Q as F, R as D, S as V, T as z, U as G, V as O, W as U, X as W, Y as j, Z as q, _ as H, $ as J, a0 as K, a1 as Q, a2 as X, a3 as Y, a4 as Z, a5 as _, a6 as $, a7 as aa, a8 as sa, a9 as oa, aa as ea, ab as la, ac as na, ad as ca, ae as ra, b as ia, d as Ia, u as ya } from "./index-630f4e87.js";
3
3
  import "react-dom";
4
4
  export {
5
- l as AddCircleIcon,
6
- n as ArchiveIcon,
5
+ n as AddCircleIcon,
6
+ l as ArchiveIcon,
7
7
  c as ArrowIcon,
8
- r as BoldIcon,
9
- i as CalendarCancelIcon,
10
- I as CalendarCheckIcon,
11
- y as CalendarIcon,
12
- t as CheckmarkCircleIcon,
13
- N as ChevronIcon,
14
- d as CloseIcon,
15
- C as DocumentRefreshIcon,
16
- m as FolderIcon,
17
- h as ForwardIcon,
18
- p as GlobeIcon,
19
- S as InboxIcon,
20
- k as ItalicIcon,
21
- b as LoadingIcon,
22
- u as NylasBookedEventCard,
23
- P as NylasBookingForm,
24
- T as NylasCancelBookingForm,
25
- f as NylasCancelledEventCard,
26
- g as NylasComposer,
27
- v as NylasDatePicker,
28
- w as NylasIfState,
29
- x as NylasListFolders,
30
- B as NylasListThreads,
31
- E as NylasLocaleSwitch,
32
- L as NylasLogin,
33
- M as NylasLogo,
34
- R as NylasMailbox,
35
- A as NylasMailboxPagination,
36
- F as NylasMailboxToolbarButton,
37
- D as NylasNotification,
38
- V as NylasOpenHoursPicker,
39
- z as NylasProvider,
40
- G as NylasScheduler,
41
- O as NylasSelectedEventCard,
42
- U as NylasSummarizeMessageButton,
43
- W as NylasThreadsRefresh,
44
- j as NylasThreadsSearch,
45
- q as NylasTimeslotPicker,
46
- H as NylasViewEmail,
47
- J as NylasViewThread,
48
- K as PeopleIcon,
49
- Q as PlayIcon,
50
- X as RefreshIcon,
51
- Y as ReplyAllIcon,
52
- Z as ReplyIcon,
53
- _ as SearchIcon,
54
- $ as SelectDropdown,
55
- aa as SentIcon,
56
- sa as SpamIcon,
57
- oa as StarIcon,
58
- ea as StopIcon,
59
- la as TranslateIcon,
60
- na as TrashIcon,
61
- ca as UnderlineIcon,
62
- ra as WarningIcon,
63
- ia as applyPolyfills,
64
- Ia as defineCustomElements,
65
- ya as useNylasMailboxElement
8
+ i as BoldIcon,
9
+ t as ButtonComponent,
10
+ r as CalendarCancelIcon,
11
+ y as CalendarCheckIcon,
12
+ N as CalendarIcon,
13
+ I as CalendarInfoIcon,
14
+ d as CalendarPatternsIcon,
15
+ C as CheckmarkCircleIcon,
16
+ m as ChevronIcon,
17
+ p as CloseIcon,
18
+ f as DocumentRefreshIcon,
19
+ h as FlowIcon,
20
+ u as FolderIcon,
21
+ k as ForwardIcon,
22
+ g as GlobeIcon,
23
+ S as GoogleLogoIcon,
24
+ E as InboxIcon,
25
+ P as InfoIcon,
26
+ T as ItalicIcon,
27
+ v as LoadingIcon,
28
+ L as LocationIcon,
29
+ B as LocationOffIcon,
30
+ w as MicrosoftLogoIcon,
31
+ b as MultiSelectDropdown,
32
+ F as NylasAdditionalParticipants,
33
+ M as NylasAvailabilityPicker,
34
+ x as NylasBookedEventCard,
35
+ A as NylasBookingCalendarPicker,
36
+ D as NylasBookingForm,
37
+ R as NylasBufferTime,
38
+ G as NylasCalendarPicker,
39
+ W as NylasCancelBookingForm,
40
+ q as NylasCancelledEventCard,
41
+ z as NylasComposer,
42
+ V as NylasCustomBookingFlow,
43
+ j as NylasDatePicker,
44
+ O as NylasEditorTabs,
45
+ U as NylasEventDescription,
46
+ H as NylasEventDuration,
47
+ J as NylasEventInfo,
48
+ K as NylasEventLimits,
49
+ Q as NylasEventTitle,
50
+ X as NylasFormCard,
51
+ Y as NylasIdentityRequestWrapper,
52
+ Z as NylasIfState,
53
+ _ as NylasLimitFutureBookings,
54
+ $ as NylasListFolders,
55
+ aa as NylasListThreads,
56
+ sa as NylasLocaleSwitch,
57
+ oa as NylasLocationComponent,
58
+ ea as NylasLogin,
59
+ na as NylasLogo,
60
+ la as NylasMailbox,
61
+ ca as NylasMailboxPagination,
62
+ ia as NylasMailboxToolbarButton,
63
+ ta as NylasMinCancellationNotice,
64
+ ra as NylasNotification,
65
+ ya as NylasProvider,
66
+ Na as NylasSchedulerEditor,
67
+ Ia as NylasScheduling,
68
+ da as NylasSelectedEventCard,
69
+ Ca as NylasSummarizeMessageButton,
70
+ ma as NylasThreadsRefresh,
71
+ pa as NylasThreadsSearch,
72
+ fa as NylasTimeWindowPicker,
73
+ ha as NylasTimeslotPicker,
74
+ ua as NylasViewEmail,
75
+ ka as NylasViewThread,
76
+ ga as PeopleIcon,
77
+ Sa as PlayIcon,
78
+ Ea as RefreshIcon,
79
+ Pa as ReplyAllIcon,
80
+ Ta as ReplyIcon,
81
+ va as SearchIcon,
82
+ La as SelectDropdown,
83
+ Ba as SentIcon,
84
+ wa as SpamIcon,
85
+ ba as StarIcon,
86
+ Fa as StopIcon,
87
+ Ma as TimePeriodSelector,
88
+ xa as TooltipComponent,
89
+ Aa as TranslateIcon,
90
+ Da as TrashIcon,
91
+ Ra as UnderlineIcon,
92
+ Ga as WarningIcon,
93
+ Wa as applyPolyfills,
94
+ qa as defineCustomElements,
95
+ za as setNonce,
96
+ Va as useNylasMailboxElement
66
97
  };
@@ -1,4 +1,4 @@
1
- import { r as t, h as c } from "./index-630f4e87.js";
1
+ import { r as t, h as c } from "./index-db0c5017.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  const e = ".sc-refresh-icon-h{display:flex}", l = e, h = class {
@@ -6,7 +6,7 @@ const e = ".sc-refresh-icon-h{display:flex}", l = e, h = class {
6
6
  t(this, s), this.width = "15", this.height = "15";
7
7
  }
8
8
  render() {
9
- return c("svg", { key: "5c8bfa4356d9458c719cb472c6dc864167bb1722", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 32 32", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, c("path", { key: "dba9b730da0b63de8b1548275fc1bea14a416cd2", d: "M15.544 28.080c-0.002-0.006-0.008-0.010-0.012-0.015l-2.873-4.489c-0.204-0.335-0.646-0.454-0.992-0.266l-0.256 0.157c-0.344 0.188-0.337 0.673-0.133 1.008l1.841 2.857c-0.157-0.035-0.316-0.063-0.471-0.103-3.224-0.843-5.953-3.026-7.485-5.988-1.448-2.797-1.72-5.99-0.766-8.992s3.118-5.452 5.915-6.899c0.476-0.247 0.662-0.832 0.416-1.308-0.246-0.477-0.832-0.663-1.308-0.416-3.258 1.686-5.763 4.54-6.874 8.036s-0.794 7.215 0.892 10.473c1.786 3.448 4.963 5.989 8.72 6.973 0.043 0.011 0.087 0.017 0.13 0.028l-2.541 1.288c-0.344 0.189-0.458 0.613-0.254 0.948l0.098 0.256c0.205 0.335 0.557 0.454 0.9 0.266l4.651-2.381c0.006-0.004 0.012-0.003 0.018-0.007l0.312-0.171c0.172-0.095 0.287-0.249 0.332-0.422 0.047-0.172 0.025-0.364-0.076-0.531zM28.559 10.025c-1.783-3.447-4.862-5.988-8.618-6.972-0.267-0.070-0.541-0.124-0.814-0.179l2.494-1.265c0.344-0.189 0.549-0.614 0.345-0.949l-0.099-0.255c-0.205-0.336-0.648-0.454-0.991-0.267l-4.651 2.381c-0.006 0.003-0.012 0.002-0.018 0.006l-0.312 0.171c-0.173 0.095-0.287 0.249-0.332 0.422-0.047 0.172-0.025 0.364 0.077 0.53l0.185 0.304c0.003 0.006 0.008 0.010 0.012 0.016l2.873 4.489c0.203 0.335 0.646 0.454 0.991 0.266l0.226-0.157c0.344-0.188 0.366-0.673 0.163-1.008l-1.85-2.87c0.407 0.063 0.811 0.138 1.207 0.242 3.226 0.845 5.856 3.027 7.387 5.986 1.448 2.797 1.72 5.99 0.765 8.991s-3.020 5.451-5.818 6.901c-0.476 0.247-0.662 0.831-0.415 1.308 0.172 0.332 0.511 0.524 0.863 0.524 0.15 0 0.302-0.035 0.446-0.109 3.259-1.686 5.664-4.54 6.776-8.035 1.111-3.497 0.794-7.217-0.893-10.473z" }));
9
+ return c("svg", { key: "6f08ec538071d37d3ff537182375dd582350bb8e", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 32 32", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, c("path", { key: "dbaaf840fa4825f6df0b9fd8f5f9d81ef1b6c7ad", d: "M15.544 28.080c-0.002-0.006-0.008-0.010-0.012-0.015l-2.873-4.489c-0.204-0.335-0.646-0.454-0.992-0.266l-0.256 0.157c-0.344 0.188-0.337 0.673-0.133 1.008l1.841 2.857c-0.157-0.035-0.316-0.063-0.471-0.103-3.224-0.843-5.953-3.026-7.485-5.988-1.448-2.797-1.72-5.99-0.766-8.992s3.118-5.452 5.915-6.899c0.476-0.247 0.662-0.832 0.416-1.308-0.246-0.477-0.832-0.663-1.308-0.416-3.258 1.686-5.763 4.54-6.874 8.036s-0.794 7.215 0.892 10.473c1.786 3.448 4.963 5.989 8.72 6.973 0.043 0.011 0.087 0.017 0.13 0.028l-2.541 1.288c-0.344 0.189-0.458 0.613-0.254 0.948l0.098 0.256c0.205 0.335 0.557 0.454 0.9 0.266l4.651-2.381c0.006-0.004 0.012-0.003 0.018-0.007l0.312-0.171c0.172-0.095 0.287-0.249 0.332-0.422 0.047-0.172 0.025-0.364-0.076-0.531zM28.559 10.025c-1.783-3.447-4.862-5.988-8.618-6.972-0.267-0.070-0.541-0.124-0.814-0.179l2.494-1.265c0.344-0.189 0.549-0.614 0.345-0.949l-0.099-0.255c-0.205-0.336-0.648-0.454-0.991-0.267l-4.651 2.381c-0.006 0.003-0.012 0.002-0.018 0.006l-0.312 0.171c-0.173 0.095-0.287 0.249-0.332 0.422-0.047 0.172-0.025 0.364 0.077 0.53l0.185 0.304c0.003 0.006 0.008 0.010 0.012 0.016l2.873 4.489c0.203 0.335 0.646 0.454 0.991 0.266l0.226-0.157c0.344-0.188 0.366-0.673 0.163-1.008l-1.85-2.87c0.407 0.063 0.811 0.138 1.207 0.242 3.226 0.845 5.856 3.027 7.387 5.986 1.448 2.797 1.72 5.99 0.765 8.991s-3.020 5.451-5.818 6.901c-0.476 0.247-0.662 0.831-0.415 1.308 0.172 0.332 0.511 0.524 0.863 0.524 0.15 0 0.302-0.035 0.446-0.109 3.259-1.686 5.664-4.54 6.776-8.035 1.111-3.497 0.794-7.217-0.893-10.473z" }));
10
10
  }
11
11
  };
12
12
  h.style = l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-3b6f5cd5.cjs");require("react");require("react-dom");const t=".sc-refresh-icon-h{display:flex}",i=t,e=class{constructor(s){c.registerInstance(this,s),this.width="15",this.height="15"}render(){return c.h("svg",{key:"5c8bfa4356d9458c719cb472c6dc864167bb1722",fill:"auto",width:this.width,height:this.height,viewBox:"0 0 32 32",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},c.h("path",{key:"dba9b730da0b63de8b1548275fc1bea14a416cd2",d:"M15.544 28.080c-0.002-0.006-0.008-0.010-0.012-0.015l-2.873-4.489c-0.204-0.335-0.646-0.454-0.992-0.266l-0.256 0.157c-0.344 0.188-0.337 0.673-0.133 1.008l1.841 2.857c-0.157-0.035-0.316-0.063-0.471-0.103-3.224-0.843-5.953-3.026-7.485-5.988-1.448-2.797-1.72-5.99-0.766-8.992s3.118-5.452 5.915-6.899c0.476-0.247 0.662-0.832 0.416-1.308-0.246-0.477-0.832-0.663-1.308-0.416-3.258 1.686-5.763 4.54-6.874 8.036s-0.794 7.215 0.892 10.473c1.786 3.448 4.963 5.989 8.72 6.973 0.043 0.011 0.087 0.017 0.13 0.028l-2.541 1.288c-0.344 0.189-0.458 0.613-0.254 0.948l0.098 0.256c0.205 0.335 0.557 0.454 0.9 0.266l4.651-2.381c0.006-0.004 0.012-0.003 0.018-0.007l0.312-0.171c0.172-0.095 0.287-0.249 0.332-0.422 0.047-0.172 0.025-0.364-0.076-0.531zM28.559 10.025c-1.783-3.447-4.862-5.988-8.618-6.972-0.267-0.070-0.541-0.124-0.814-0.179l2.494-1.265c0.344-0.189 0.549-0.614 0.345-0.949l-0.099-0.255c-0.205-0.336-0.648-0.454-0.991-0.267l-4.651 2.381c-0.006 0.003-0.012 0.002-0.018 0.006l-0.312 0.171c-0.173 0.095-0.287 0.249-0.332 0.422-0.047 0.172-0.025 0.364 0.077 0.53l0.185 0.304c0.003 0.006 0.008 0.010 0.012 0.016l2.873 4.489c0.203 0.335 0.646 0.454 0.991 0.266l0.226-0.157c0.344-0.188 0.366-0.673 0.163-1.008l-1.85-2.87c0.407 0.063 0.811 0.138 1.207 0.242 3.226 0.845 5.856 3.027 7.387 5.986 1.448 2.797 1.72 5.99 0.765 8.991s-3.020 5.451-5.818 6.901c-0.476 0.247-0.662 0.831-0.415 1.308 0.172 0.332 0.511 0.524 0.863 0.524 0.15 0 0.302-0.035 0.446-0.109 3.259-1.686 5.664-4.54 6.776-8.035 1.111-3.497 0.794-7.217-0.893-10.473z"}))}};e.style=i;exports.refresh_icon=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-2b8437d6.cjs");require("react");require("react-dom");const t=".sc-refresh-icon-h{display:flex}",i=t,c=class{constructor(s){e.registerInstance(this,s),this.width="15",this.height="15"}render(){return e.h("svg",{key:"6f08ec538071d37d3ff537182375dd582350bb8e",fill:"auto",width:this.width,height:this.height,viewBox:"0 0 32 32",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"dbaaf840fa4825f6df0b9fd8f5f9d81ef1b6c7ad",d:"M15.544 28.080c-0.002-0.006-0.008-0.010-0.012-0.015l-2.873-4.489c-0.204-0.335-0.646-0.454-0.992-0.266l-0.256 0.157c-0.344 0.188-0.337 0.673-0.133 1.008l1.841 2.857c-0.157-0.035-0.316-0.063-0.471-0.103-3.224-0.843-5.953-3.026-7.485-5.988-1.448-2.797-1.72-5.99-0.766-8.992s3.118-5.452 5.915-6.899c0.476-0.247 0.662-0.832 0.416-1.308-0.246-0.477-0.832-0.663-1.308-0.416-3.258 1.686-5.763 4.54-6.874 8.036s-0.794 7.215 0.892 10.473c1.786 3.448 4.963 5.989 8.72 6.973 0.043 0.011 0.087 0.017 0.13 0.028l-2.541 1.288c-0.344 0.189-0.458 0.613-0.254 0.948l0.098 0.256c0.205 0.335 0.557 0.454 0.9 0.266l4.651-2.381c0.006-0.004 0.012-0.003 0.018-0.007l0.312-0.171c0.172-0.095 0.287-0.249 0.332-0.422 0.047-0.172 0.025-0.364-0.076-0.531zM28.559 10.025c-1.783-3.447-4.862-5.988-8.618-6.972-0.267-0.070-0.541-0.124-0.814-0.179l2.494-1.265c0.344-0.189 0.549-0.614 0.345-0.949l-0.099-0.255c-0.205-0.336-0.648-0.454-0.991-0.267l-4.651 2.381c-0.006 0.003-0.012 0.002-0.018 0.006l-0.312 0.171c-0.173 0.095-0.287 0.249-0.332 0.422-0.047 0.172-0.025 0.364 0.077 0.53l0.185 0.304c0.003 0.006 0.008 0.010 0.012 0.016l2.873 4.489c0.203 0.335 0.646 0.454 0.991 0.266l0.226-0.157c0.344-0.188 0.366-0.673 0.163-1.008l-1.85-2.87c0.407 0.063 0.811 0.138 1.207 0.242 3.226 0.845 5.856 3.027 7.387 5.986 1.448 2.797 1.72 5.99 0.765 8.991s-3.020 5.451-5.818 6.901c-0.476 0.247-0.662 0.831-0.415 1.308 0.172 0.332 0.511 0.524 0.863 0.524 0.15 0 0.302-0.035 0.446-0.109 3.259-1.686 5.664-4.54 6.776-8.035 1.111-3.497 0.794-7.217-0.893-10.473z"}))}};c.style=i;exports.refresh_icon=c;
@@ -1,5 +1,5 @@
1
- import { d, r as m } from "./utils-5074a070-ce33ee6b.js";
2
- import { g as P } from "./index-630f4e87.js";
1
+ import { d, B as m } from "./utils-c00bdc3c-89ab163d.js";
2
+ import { g as P } from "./index-db0c5017.js";
3
3
  function b(e, r, i = "registerComponent") {
4
4
  return new CustomEvent(i, {
5
5
  bubbles: !0,
@@ -1 +1 @@
1
- "use strict";const s=require("./utils-5074a070-d5ba6add.cjs"),m=require("./index-3b6f5cd5.cjs");function P(e,o,u="registerComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function b(e,o,u="unregisterComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function T(e){return(o,u)=>{const r=e.name;s.debug(`[${r}] Registering component ${r} being called on ${u}`);const l=o.componentWillLoad;if(!l){s.error(`[${r}] componentWillLoad lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const p=o.connectedCallback;if(!p){s.error(`[${r}] connectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const a=o.disconnectedCallback;if(!a){s.error(`[${r}] disconnectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}if(e.storeToProps&&e.stateToProps){const n=Array.from(e.storeToProps.values()),t=Array.from(e.stateToProps.values()),i=n.filter(c=>t.includes(c));if(i.length>0){s.error(`[${r}] Overlapping prop keys detected in ${r} for storeToProps and stateToProps. Make sure to only define them once. Overlapping keys: ${i.join(", ")}`);return}}const d=new Map;e.eventToProps&&Object.keys(e.eventToProps).forEach(n=>{var t;d.set(n,(t=e.eventToProps)==null?void 0:t[n])}),o.connectedCallback=function(){s.debug(`[~${r}] connectedCallback called`);const n=p==null?void 0:p.call(this),t=m.getElement(this);return t.dataset.nylasId||(Object.defineProperty(t,"registerNylasComponent",{get(){return!0},enumerable:!0}),Object.defineProperty(t,"stateToProps",{get(){return e.stateToProps},enumerable:!0}),Object.defineProperty(t,"getStoresToProp",{get(){return e.getStoresToProp},enumerable:!0}),Object.defineProperty(t,"storeToProps",{get(){return e.storeToProps},enumerable:!0}),Object.defineProperty(t,"eventToProps",{get(){return d},enumerable:!0}),Object.defineProperty(t,"authToProp",{get(){return e.authToProp},enumerable:!0}),Object.defineProperty(t,"connectorToProp",{get(){return e.connectorToProp},enumerable:!0})),n},e.fireRegisterEvent&&(o.componentWillLoad=function(){const n=l==null?void 0:l.call(this),t=m.getElement(this),i={element:t,...e,eventToProps:d},c=P(o,i,e.registrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired registration event`),n},o.disconnectedCallback=function(){const n=a==null?void 0:a.call(this),t=m.getElement(this),i={element:t,...e,eventToProps:d},c=b(o,i,e.unregistrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired unregistration event`),n})}}exports.RegisterComponent=T;
1
+ "use strict";const s=require("./utils-c00bdc3c-94b9c3b6.cjs"),m=require("./index-2b8437d6.cjs");function P(e,o,u="registerComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function b(e,o,u="unregisterComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function T(e){return(o,u)=>{const r=e.name;s.debug(`[${r}] Registering component ${r} being called on ${u}`);const l=o.componentWillLoad;if(!l){s.error(`[${r}] componentWillLoad lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const p=o.connectedCallback;if(!p){s.error(`[${r}] connectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const a=o.disconnectedCallback;if(!a){s.error(`[${r}] disconnectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}if(e.storeToProps&&e.stateToProps){const n=Array.from(e.storeToProps.values()),t=Array.from(e.stateToProps.values()),i=n.filter(c=>t.includes(c));if(i.length>0){s.error(`[${r}] Overlapping prop keys detected in ${r} for storeToProps and stateToProps. Make sure to only define them once. Overlapping keys: ${i.join(", ")}`);return}}const d=new Map;e.eventToProps&&Object.keys(e.eventToProps).forEach(n=>{var t;d.set(n,(t=e.eventToProps)==null?void 0:t[n])}),o.connectedCallback=function(){s.debug(`[~${r}] connectedCallback called`);const n=p==null?void 0:p.call(this),t=m.getElement(this);return t.dataset.nylasId||(Object.defineProperty(t,"registerNylasComponent",{get(){return!0},enumerable:!0}),Object.defineProperty(t,"stateToProps",{get(){return e.stateToProps},enumerable:!0}),Object.defineProperty(t,"getStoresToProp",{get(){return e.getStoresToProp},enumerable:!0}),Object.defineProperty(t,"storeToProps",{get(){return e.storeToProps},enumerable:!0}),Object.defineProperty(t,"eventToProps",{get(){return d},enumerable:!0}),Object.defineProperty(t,"authToProp",{get(){return e.authToProp},enumerable:!0}),Object.defineProperty(t,"connectorToProp",{get(){return e.connectorToProp},enumerable:!0})),n},e.fireRegisterEvent&&(o.componentWillLoad=function(){const n=l==null?void 0:l.call(this),t=m.getElement(this),i={element:t,...e,eventToProps:d},c=P(o,i,e.registrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired registration event`),n},o.disconnectedCallback=function(){const n=a==null?void 0:a.call(this),t=m.getElement(this),i={element:t,...e,eventToProps:d},c=b(o,i,e.unregistrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired unregistration event`),n})}}exports.RegisterComponent=T;
@@ -0,0 +1,14 @@
1
+ import { a as t } from "./index-db0c5017.js";
2
+ function a(e = {}) {
3
+ const r = {
4
+ config: {},
5
+ configurations: [],
6
+ calendars: [],
7
+ currentUser: null,
8
+ ...e
9
+ };
10
+ return t(r);
11
+ }
12
+ export {
13
+ a as C
14
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("./index-2b8437d6.cjs");function n(e={}){const r={config:{},configurations:[],calendars:[],currentUser:null,...e};return t.createStore(r)}exports.CreateNylasSchedulerConfigStore=n;
@@ -0,0 +1 @@
1
+ "use strict";const v=require("./utils-c00bdc3c-94b9c3b6.cjs"),C=require("./index-2b8437d6.cjs");exports.ErrorCategory=void 0;(function(n){n.Component="component",n.Api="api",n.Auth="auth"})(exports.ErrorCategory||(exports.ErrorCategory={}));var w;(function(n){n.endtime_not_in_future="endtime_not_in_future",n.no_booking_info="no_booking_info",n.no_timeslot_selected="no_timeslot_selected",n.no_booking_id="no_booking_id",n.invalid_start_time="invalid_start_time",n.invalid_end_time="invalid_end_time",n.invalid_timezone="invalid_timezone"})(w||(w={}));var b;(function(n){n.invalid_session="invalid_session",n.general_error="general_error",n.internal_error="internal_error",n.invalid_request_error="invalid_request_error",n.timeslot_not_available="timeslot_not_available"})(b||(b={}));class D{constructor(){this.component=t=>{const e=exports.ErrorCategory.Component,s=`${t} error`;return{endtime_not_in_future:(i='"endtime" can not be in the future')=>({title:s,message:i,category:e}),no_booking_info:(i="No booking info provided")=>({title:s,message:i,category:e}),no_timeslot_selected:(i="No timeslot selected")=>({title:s,message:i,category:e}),no_booking_id:(i="No booking id provided")=>({title:s,message:i,category:e}),invalid_start_time:(i="Invalid start time")=>({title:s,message:i,category:e}),invalid_end_time:(i="Invalid end time")=>({title:s,message:i,category:e}),invalid_timezone:(i="Invalid timezone")=>({title:s,message:i,category:e})}},this.api=t=>{const e=exports.ErrorCategory.Api,s=`${t} error`;return{invalid_session:i=>({title:s,message:i,category:e}),general_error:i=>({title:s,message:i,category:e}),internal_error:i=>({title:s,message:i,category:e}),invalid_request_error:i=>({title:s,message:i,category:e}),timeslot_not_available:i=>({title:s,message:i,category:e})}}}}class R{constructor({schedulerAPIURL:t,schedulerStore:e,sessionId:s,configId:i}){this.errors=new D,this.schedulerStore=e,this.schedulerAPIURL=t,this.sessionId=s,this.configId=i}getHeaders(){return this.configId?{}:{Authorization:`Bearer ${this.sessionId}`}}async makeAPIRequest(t,e,s,i={}){try{const r=new URL(this.schedulerAPIURL);return r.pathname=t,await(await fetch(decodeURIComponent(r.toString()),{method:e,headers:{"Content-Type":"application/json",...i},body:s})).json()}catch(r){return{error:{message:r.message,title:"API request failed",type:"api"}}}}selectDate(t){this.schedulerStore.set("selectedDate",t),this.schedulerStore.set("selectedTimeslot",null)}selectTime(t){this.schedulerStore.set("selectedTimeslot",t)}selectTimezone(t){this.schedulerStore.set("selectedTimezone",t)}toggleAdditionalData(t){this.schedulerStore.set("showBookingForm",t)}setParticipantName(t){const{bookingInfo:e}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...e,primaryParticipant:{...e==null?void 0:e.primaryParticipant,name:t}})}setParticipantEmail(t){const{bookingInfo:e}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...e,primaryParticipant:{...e==null?void 0:e.primaryParticipant,email:t}})}async setReschedule(t){const e=new Date;this.schedulerStore.set("rescheduleBookingId",t),this.schedulerStore.set("selectedTimeslot",null),this.schedulerStore.set("eventInfo",null),this.schedulerStore.set("showBookingForm",!1);const s=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3,i=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3,r=await this.getAvailability(s,i),a=this.schedulerStore.get("availability").find(l=>new Date(l.start_time)>new Date);let u=e;return a&&(u=a.start_time),this.schedulerStore.set("selectedDate",u),r}async setCancel(t){this.schedulerStore.set("cancelBookingId",t)}async bookTimeslot(t){var g;this.schedulerStore.set("isLoading",!0);const{selectedTimeslot:e,bookingInfo:s}=this.schedulerStore.state;if(!t&&!s)return{error:this.errors.component("Booking").no_booking_info()};const i=(t==null?void 0:t.timeslot)||e;if(!i)return{error:this.errors.component("Create Booking").no_timeslot_selected()};const r=t?t==null?void 0:t.primaryParticipant:s==null?void 0:s.primaryParticipant,a=t?(t==null?void 0:t.guests)||[]:(s==null?void 0:s.guests)||[],u=t?{...t==null?void 0:t.additionalFields,guests:a}:{...s==null?void 0:s.additionalFields,guests:a},l=this.getHeaders(),p=`/v3/scheduling/bookings${this.configId?`?configuration_id=${this.configId}`:""}`,d=await this.makeAPIRequest(decodeURIComponent(p),"POST",JSON.stringify({additional_fields:u,guest:{...r},start_time:i.start_time.getTime()/1e3,end_time:i.end_time.getTime()/1e3}),l);if("error"in d){this.schedulerStore.set("isLoading",!1);const c=(g=d.error)==null?void 0:g.type;let o=d.error;return c&&c in this.errors.api("Create Booking")&&(o=this.errors.api("Create Booking")[c]((o==null?void 0:o.message)||(o==null?void 0:o.title)||"Something went wrong")),{error:o}}return"data"in d&&this.schedulerStore.set("eventInfo",d==null?void 0:d.data),this.schedulerStore.set("isLoading",!1),d}async getAvailability(t=0,e=0){var p,d,g;this.schedulerStore.set("isLoading",!0);const s=new URLSearchParams,i=new Date,r=i.getTime();if(e&&e<r/1e3)return this.schedulerStore.set("isLoading",!1),{error:this.errors.component("Get Availability").endtime_not_in_future()};if(!t){const c=new Date(i.getFullYear(),i.getMonth(),1);t=Math.floor(c.getTime()/1e3)}if(!e){const c=new Date(i.getFullYear(),i.getMonth()+1,0);e=Math.floor(c.getTime()/1e3)}s.append("start_time",encodeURIComponent(t.toString())),s.append("end_time",encodeURIComponent(e.toString())),this.configId&&s.append("configuration_id",encodeURIComponent(this.configId));const a=s.toString(),u=`/v3/scheduling/availability${a?`?${a}`:""}`,l=this.getHeaders(),h=await this.makeAPIRequest(decodeURIComponent(u),"GET",void 0,l);if("error"in h){this.schedulerStore.set("availability",[]),this.schedulerStore.set("isLoading",!1);const c=(p=h.error)==null?void 0:p.type;let o=h.error;return c&&c in this.errors.api("Get Availability")&&(o=this.errors.api("Get Availability")[c]((o==null?void 0:o.message)||(o==null?void 0:o.title)||"Something went wrong")),{error:o}}if("data"in h){const o=(((g=(d=h.data)==null?void 0:d.time_slots)==null?void 0:g.map(m=>({...m,start_time:new Date(m.start_time*1e3),end_time:new Date(m.end_time*1e3)})))||[]).filter(m=>m.start_time.getTime()>r);this.schedulerStore.set("availability",o)}return this.schedulerStore.set("isLoading",!1),h}async cancelBooking(t){var a;if(this.schedulerStore.set("isLoading",!0),!t)return{error:this.errors.component("Cancel Booking").no_booking_id()};const e=this.configId?`?configuration_id=${this.configId}`:"",s=`/v3/scheduling/bookings/${t}${e}`,i=this.getHeaders(),r=await this.makeAPIRequest(decodeURIComponent(s),"DELETE",JSON.stringify({action:"cancel"}),i);if("error"in r){this.schedulerStore.set("isLoading",!1);const u=(a=r.error)==null?void 0:a.type;let l=r.error;return u&&u in this.errors.api("Cancel Booking")&&(l=this.errors.api("Cancel Booking")[u]((l==null?void 0:l.message)||(l==null?void 0:l.title)||"Something went wrong")),{error:l}}return this.schedulerStore.set("cancelledEventInfo",{booking_id:t}),this.schedulerStore.set("isLoading",!1),r}async rescheduleBooking(t,e){var y;if(this.schedulerStore.set("isLoading",!0),!t)return{error:this.errors.component("Reschedule Booking").no_booking_id()};const s=this.errors.api("Reschedule Booking"),i=this.errors.component("Reschedule Booking"),{bookingInfo:r,selectedTimeslot:a,selectedTimezone:u}=this.schedulerStore.state,{startTime:l,endTime:h,timezone:p}=e,d=l||(a==null?void 0:a.start_time);if(!d)return{error:i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const g=h||(a==null?void 0:a.end_time);if(!g)return{error:i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const c=p||u;if(!c)return{error:i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')};const o=e?e==null?void 0:e.primaryParticipant:r==null?void 0:r.primaryParticipant,m=e?(e==null?void 0:e.guests)||[]:(r==null?void 0:r.guests)||[],I=e?{...e==null?void 0:e.additionalFields,guests:m}:{...r==null?void 0:r.additionalFields,guests:m},P=this.configId?`?configuration_id=${this.configId}`:"",k=`/v3/scheduling/bookings/${t}${P}`,T=this.getHeaders(),_=await this.makeAPIRequest(decodeURIComponent(k),"PATCH",JSON.stringify({start_time:d.getTime()/1e3,end_time:g.getTime()/1e3,time_zone:c,additional_fields:I,guest:{...o}}),T);if("error"in _){this.schedulerStore.set("isLoading",!1);const S=(y=_.error)==null?void 0:y.type;let f=_.error;S&&S in s&&(f=s[S]((f==null?void 0:f.message)||(f==null?void 0:f.title)||"Something went wrong"))}return"data"in _&&this.schedulerStore.set("eventInfo",_==null?void 0:_.data),this.schedulerStore.set("isLoading",!1),_}}function L(n={}){const t={selectedDate:null,selectedLanguage:navigator.language,selectedTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,selectedTimeslot:null,showBookingForm:!1,selectableDates:null,availability:[],state:"ready",eventInfo:null,cancelledEventInfo:null,isLoading:!1,nylasBranding:!0,...n};v.debug("[defaultNylasStoreState]: ",t);const e=C.createStore(t);return e.onChange("availability",s=>{v.debug("[availability]: ",s);const i=s.map(r=>r.start_time);v.debug("[selectableDates]: ",i),e.set("selectableDates",i)}),e.reset=()=>{for(const s in t){const i=t[s];e.set(s,i)}},e}exports.CreateNylasSchedulerStore=L;exports.NylaSchedulerAPIConnector=R;
@@ -1,21 +1,21 @@
1
- import { d as y } from "./utils-5074a070-ce33ee6b.js";
2
- import { c as A } from "./index-b30d446a-a90f84b2.js";
3
- var f;
4
- (function(n) {
5
- n.Component = "component", n.Api = "api", n.Auth = "auth";
6
- })(f || (f = {}));
7
- var k;
8
- (function(n) {
9
- n.endtime_not_in_future = "endtime_not_in_future", n.no_booking_info = "no_booking_info", n.no_timeslot_selected = "no_timeslot_selected", n.no_booking_id = "no_booking_id", n.invalid_start_time = "invalid_start_time", n.invalid_end_time = "invalid_end_time", n.invalid_timezone = "invalid_timezone";
10
- })(k || (k = {}));
11
- var b;
12
- (function(n) {
13
- n.invalid_session = "invalid_session", n.general_error = "general_error", n.internal_error = "internal_error", n.invalid_request_error = "invalid_request_error", n.timeslot_not_available = "timeslot_not_available";
14
- })(b || (b = {}));
15
- class R {
1
+ import { d as y } from "./utils-c00bdc3c-89ab163d.js";
2
+ import { a as R } from "./index-db0c5017.js";
3
+ var S;
4
+ (function(r) {
5
+ r.Component = "component", r.Api = "api", r.Auth = "auth";
6
+ })(S || (S = {}));
7
+ var I;
8
+ (function(r) {
9
+ r.endtime_not_in_future = "endtime_not_in_future", r.no_booking_info = "no_booking_info", r.no_timeslot_selected = "no_timeslot_selected", r.no_booking_id = "no_booking_id", r.invalid_start_time = "invalid_start_time", r.invalid_end_time = "invalid_end_time", r.invalid_timezone = "invalid_timezone";
10
+ })(I || (I = {}));
11
+ var P;
12
+ (function(r) {
13
+ r.invalid_session = "invalid_session", r.general_error = "general_error", r.internal_error = "internal_error", r.invalid_request_error = "invalid_request_error", r.timeslot_not_available = "timeslot_not_available";
14
+ })(P || (P = {}));
15
+ class L {
16
16
  constructor() {
17
17
  this.component = (t) => {
18
- const e = f.Component, s = `${t} error`;
18
+ const e = S.Component, s = `${t} error`;
19
19
  return {
20
20
  endtime_not_in_future: (i = '"endtime" can not be in the future') => ({
21
21
  title: s,
@@ -54,7 +54,7 @@ class R {
54
54
  })
55
55
  };
56
56
  }, this.api = (t) => {
57
- const e = f.Api, s = `${t} error`;
57
+ const e = S.Api, s = `${t} error`;
58
58
  return {
59
59
  invalid_session: (i) => ({
60
60
  title: s,
@@ -85,14 +85,19 @@ class R {
85
85
  };
86
86
  }
87
87
  }
88
- class z {
89
- constructor({ schedulerAPIURL: t, schedulerStore: e, sessionId: s }) {
90
- this.errors = new R(), this.schedulerStore = e, this.schedulerAPIURL = t, this.sessionId = s;
88
+ class C {
89
+ constructor({ schedulerAPIURL: t, schedulerStore: e, sessionId: s, configId: i }) {
90
+ this.errors = new L(), this.schedulerStore = e, this.schedulerAPIURL = t, this.sessionId = s, this.configId = i;
91
+ }
92
+ getHeaders() {
93
+ return this.configId ? {} : {
94
+ Authorization: `Bearer ${this.sessionId}`
95
+ };
91
96
  }
92
97
  async makeAPIRequest(t, e, s, i = {}) {
93
98
  try {
94
- const r = new URL(this.schedulerAPIURL);
95
- return r.pathname = t, await (await fetch(decodeURIComponent(r.toString()), {
99
+ const n = new URL(this.schedulerAPIURL);
100
+ return n.pathname = t, await (await fetch(decodeURIComponent(n.toString()), {
96
101
  method: e,
97
102
  headers: {
98
103
  "Content-Type": "application/json",
@@ -100,10 +105,10 @@ class z {
100
105
  },
101
106
  body: s
102
107
  })).json();
103
- } catch (r) {
108
+ } catch (n) {
104
109
  return {
105
110
  error: {
106
- message: r.message,
111
+ message: n.message,
107
112
  title: "API request failed",
108
113
  type: "api"
109
114
  }
@@ -144,10 +149,10 @@ class z {
144
149
  }
145
150
  async setReschedule(t) {
146
151
  const e = /* @__PURE__ */ new Date();
147
- this.schedulerStore.set("rescheduleBookingId", t), this.schedulerStore.set("selectedTimeslot", null), this.schedulerStore.set("showThankYouMessage", !1), this.schedulerStore.set("showBookingForm", !1);
148
- const s = new Date(e.getFullYear(), e.getMonth(), 1).getTime() / 1e3, i = new Date(e.getFullYear(), e.getMonth() + 1, 1).getTime() / 1e3, r = await this.getAvailability(s, i), o = this.schedulerStore.get("availability").find((g) => new Date(g.start_time) > /* @__PURE__ */ new Date());
149
- let a = e;
150
- return o && (a = o.start_time), this.schedulerStore.set("selectedDate", a), r;
152
+ this.schedulerStore.set("rescheduleBookingId", t), this.schedulerStore.set("selectedTimeslot", null), this.schedulerStore.set("eventInfo", null), this.schedulerStore.set("showBookingForm", !1);
153
+ const s = new Date(e.getFullYear(), e.getMonth(), 1).getTime() / 1e3, i = new Date(e.getFullYear(), e.getMonth() + 1, 1).getTime() / 1e3, n = await this.getAvailability(s, i), a = this.schedulerStore.get("availability").find((l) => new Date(l.start_time) > /* @__PURE__ */ new Date());
154
+ let h = e;
155
+ return a && (h = a.start_time), this.schedulerStore.set("selectedDate", h), n;
151
156
  }
152
157
  async setCancel(t) {
153
158
  this.schedulerStore.set("cancelBookingId", t);
@@ -161,120 +166,120 @@ class z {
161
166
  const i = (t == null ? void 0 : t.timeslot) || e;
162
167
  if (!i)
163
168
  return { error: this.errors.component("Create Booking").no_timeslot_selected() };
164
- const r = t ? t == null ? void 0 : t.primaryParticipant : s == null ? void 0 : s.primaryParticipant, o = t ? (t == null ? void 0 : t.guests) || [] : (s == null ? void 0 : s.guests) || [], a = t ? { ...t == null ? void 0 : t.additionalFields } : { ...s == null ? void 0 : s.additionalFields }, g = {
165
- Authorization: `Bearer ${this.sessionId}`
166
- }, u = "/schedule/bookings", c = await this.makeAPIRequest(decodeURIComponent(u), "POST", JSON.stringify({
167
- participants: [r, ...o],
168
- additional_fields: a,
169
+ const n = t ? t == null ? void 0 : t.primaryParticipant : s == null ? void 0 : s.primaryParticipant, a = t ? (t == null ? void 0 : t.guests) || [] : (s == null ? void 0 : s.guests) || [], h = t ? { ...t == null ? void 0 : t.additionalFields, guests: a } : { ...s == null ? void 0 : s.additionalFields, guests: a }, l = this.getHeaders(), p = `/v3/scheduling/bookings${this.configId ? `?configuration_id=${this.configId}` : ""}`, d = await this.makeAPIRequest(decodeURIComponent(p), "POST", JSON.stringify({
170
+ additional_fields: h,
171
+ guest: { ...n },
169
172
  start_time: i.start_time.getTime() / 1e3,
170
173
  end_time: i.end_time.getTime() / 1e3
171
- }), g);
172
- if ("error" in c) {
174
+ }), l);
175
+ if ("error" in d) {
173
176
  this.schedulerStore.set("isLoading", !1);
174
- const h = (m = c.error) == null ? void 0 : m.type;
175
- let l = c.error;
176
- return h && h in this.errors.api("Create Booking") && (l = this.errors.api("Create Booking")[h]((l == null ? void 0 : l.message) || (l == null ? void 0 : l.title) || "Something went wrong")), { error: l };
177
+ const c = (m = d.error) == null ? void 0 : m.type;
178
+ let o = d.error;
179
+ return c && c in this.errors.api("Create Booking") && (o = this.errors.api("Create Booking")[c]((o == null ? void 0 : o.message) || (o == null ? void 0 : o.title) || "Something went wrong")), { error: o };
177
180
  }
178
- return "data" in c && this.schedulerStore.set("eventInfo", c == null ? void 0 : c.data), this.schedulerStore.set("isLoading", !1), c;
181
+ return "data" in d && this.schedulerStore.set("eventInfo", d == null ? void 0 : d.data), this.schedulerStore.set("isLoading", !1), d;
179
182
  }
180
183
  async getAvailability(t = 0, e = 0) {
181
- var c, m, h;
184
+ var p, d, m;
182
185
  this.schedulerStore.set("isLoading", !0);
183
- const s = new URLSearchParams(), r = (/* @__PURE__ */ new Date()).getTime();
184
- if (e && e < r / 1e3)
186
+ const s = new URLSearchParams(), i = /* @__PURE__ */ new Date(), n = i.getTime();
187
+ if (e && e < n / 1e3)
185
188
  return this.schedulerStore.set("isLoading", !1), { error: this.errors.component("Get Availability").endtime_not_in_future() };
186
- t && s.append("start_time", encodeURIComponent(t)), e && s.append("end_time", encodeURIComponent(e));
187
- const o = s.toString(), a = `/schedule/availability${o ? `?${o}` : ""}`, g = {
188
- Authorization: `Bearer ${this.sessionId}`
189
- }, u = await this.makeAPIRequest(decodeURIComponent(a), "GET", void 0, g);
189
+ if (!t) {
190
+ const c = new Date(i.getFullYear(), i.getMonth(), 1);
191
+ t = Math.floor(c.getTime() / 1e3);
192
+ }
193
+ if (!e) {
194
+ const c = new Date(i.getFullYear(), i.getMonth() + 1, 0);
195
+ e = Math.floor(c.getTime() / 1e3);
196
+ }
197
+ s.append("start_time", encodeURIComponent(t.toString())), s.append("end_time", encodeURIComponent(e.toString())), this.configId && s.append("configuration_id", encodeURIComponent(this.configId));
198
+ const a = s.toString(), h = `/v3/scheduling/availability${a ? `?${a}` : ""}`, l = this.getHeaders(), u = await this.makeAPIRequest(decodeURIComponent(h), "GET", void 0, l);
190
199
  if ("error" in u) {
191
200
  this.schedulerStore.set("availability", []), this.schedulerStore.set("isLoading", !1);
192
- const l = (c = u.error) == null ? void 0 : c.type;
193
- let d = u.error;
194
- return l && l in this.errors.api("Get Availability") && (d = this.errors.api("Get Availability")[l]((d == null ? void 0 : d.message) || (d == null ? void 0 : d.title) || "Something went wrong")), { error: d };
201
+ const c = (p = u.error) == null ? void 0 : p.type;
202
+ let o = u.error;
203
+ return c && c in this.errors.api("Get Availability") && (o = this.errors.api("Get Availability")[c]((o == null ? void 0 : o.message) || (o == null ? void 0 : o.title) || "Something went wrong")), { error: o };
195
204
  }
196
205
  if ("data" in u) {
197
- const d = (((h = (m = u.data) == null ? void 0 : m.time_slots) == null ? void 0 : h.map((p) => ({
198
- ...p,
199
- start_time: new Date(p.start_time * 1e3),
200
- end_time: new Date(p.end_time * 1e3)
201
- }))) || []).filter((p) => p.start_time.getTime() > r);
202
- this.schedulerStore.set("availability", d);
206
+ const o = (((m = (d = u.data) == null ? void 0 : d.time_slots) == null ? void 0 : m.map((g) => ({
207
+ ...g,
208
+ start_time: new Date(g.start_time * 1e3),
209
+ end_time: new Date(g.end_time * 1e3)
210
+ }))) || []).filter((g) => g.start_time.getTime() > n);
211
+ this.schedulerStore.set("availability", o);
203
212
  }
204
213
  return this.schedulerStore.set("isLoading", !1), u;
205
214
  }
206
215
  async cancelBooking(t) {
207
- var r;
216
+ var a;
208
217
  if (this.schedulerStore.set("isLoading", !0), !t)
209
218
  return { error: this.errors.component("Cancel Booking").no_booking_id() };
210
- const e = `/schedule/bookings/${t}`, s = {
211
- Authorization: `Bearer ${this.sessionId}`
212
- }, i = await this.makeAPIRequest(decodeURIComponent(e), "PUT", JSON.stringify({
219
+ const e = this.configId ? `?configuration_id=${this.configId}` : "", s = `/v3/scheduling/bookings/${t}${e}`, i = this.getHeaders(), n = await this.makeAPIRequest(decodeURIComponent(s), "DELETE", JSON.stringify({
213
220
  action: "cancel"
214
- }), s);
215
- if ("error" in i) {
221
+ }), i);
222
+ if ("error" in n) {
216
223
  this.schedulerStore.set("isLoading", !1);
217
- const o = (r = i.error) == null ? void 0 : r.type;
218
- let a = i.error;
219
- return o && o in this.errors.api("Cancel Booking") && (a = this.errors.api("Cancel Booking")[o]((a == null ? void 0 : a.message) || (a == null ? void 0 : a.title) || "Something went wrong")), { error: a };
224
+ const h = (a = n.error) == null ? void 0 : a.type;
225
+ let l = n.error;
226
+ return h && h in this.errors.api("Cancel Booking") && (l = this.errors.api("Cancel Booking")[h]((l == null ? void 0 : l.message) || (l == null ? void 0 : l.title) || "Something went wrong")), { error: l };
220
227
  }
221
- return "data" in i && this.schedulerStore.set("cancelledEvent", i == null ? void 0 : i.data), this.schedulerStore.set("isLoading", !1), i;
228
+ return this.schedulerStore.set("cancelledEventInfo", {
229
+ booking_id: t
230
+ }), this.schedulerStore.set("isLoading", !1), n;
222
231
  }
223
232
  async rescheduleBooking(t, e) {
224
233
  var w;
225
234
  if (this.schedulerStore.set("isLoading", !0), !t)
226
235
  return { error: this.errors.component("Reschedule Booking").no_booking_id() };
227
- const s = this.errors.api("Reschedule Booking"), i = this.errors.component("Reschedule Booking"), { bookingInfo: r, selectedTimeslot: o, selectedTimezone: a } = this.schedulerStore.state, { startTime: g, endTime: u, timezone: c } = e, m = g || (o == null ? void 0 : o.start_time);
236
+ const s = this.errors.api("Reschedule Booking"), i = this.errors.component("Reschedule Booking"), { bookingInfo: n, selectedTimeslot: a, selectedTimezone: h } = this.schedulerStore.state, { startTime: l, endTime: u, timezone: p } = e, d = l || (a == null ? void 0 : a.start_time);
237
+ if (!d)
238
+ return { error: i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
239
+ const m = u || (a == null ? void 0 : a.end_time);
228
240
  if (!m)
229
- return { error: i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerStoreState.') };
230
- const h = u || (o == null ? void 0 : o.end_time);
231
- if (!h)
232
- return { error: i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerStoreState.') };
233
- const l = c || a;
234
- if (!l)
235
- return { error: i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerStoreState.') };
236
- const d = e ? e == null ? void 0 : e.primaryParticipant : r == null ? void 0 : r.primaryParticipant, p = e ? (e == null ? void 0 : e.guests) || [] : (r == null ? void 0 : r.guests) || [], T = e ? { ...e == null ? void 0 : e.additionalFields } : { ...r == null ? void 0 : r.additionalFields }, P = `/schedule/bookings/${t}`, B = {
237
- Authorization: `Bearer ${this.sessionId}`
238
- }, _ = await this.makeAPIRequest(decodeURIComponent(P), "PATCH", JSON.stringify({
239
- start_time: m.getTime() / 1e3,
240
- end_time: h.getTime() / 1e3,
241
- time_zone: l,
242
- participants: [d, ...p],
243
- additional_fields: T
244
- }), B);
241
+ return { error: i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.') };
242
+ const c = p || h;
243
+ if (!c)
244
+ return { error: i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.') };
245
+ const o = e ? e == null ? void 0 : e.primaryParticipant : n == null ? void 0 : n.primaryParticipant, g = e ? (e == null ? void 0 : e.guests) || [] : (n == null ? void 0 : n.guests) || [], b = e ? { ...e == null ? void 0 : e.additionalFields, guests: g } : { ...n == null ? void 0 : n.additionalFields, guests: g }, k = this.configId ? `?configuration_id=${this.configId}` : "", T = `/v3/scheduling/bookings/${t}${k}`, D = this.getHeaders(), _ = await this.makeAPIRequest(decodeURIComponent(T), "PATCH", JSON.stringify({
246
+ start_time: d.getTime() / 1e3,
247
+ end_time: m.getTime() / 1e3,
248
+ time_zone: c,
249
+ additional_fields: b,
250
+ guest: { ...o }
251
+ }), D);
245
252
  if ("error" in _) {
246
253
  this.schedulerStore.set("isLoading", !1);
247
254
  const v = (w = _.error) == null ? void 0 : w.type;
248
- let S = _.error;
249
- v && v in s && (S = s[v]((S == null ? void 0 : S.message) || (S == null ? void 0 : S.title) || "Something went wrong"));
255
+ let f = _.error;
256
+ v && v in s && (f = s[v]((f == null ? void 0 : f.message) || (f == null ? void 0 : f.title) || "Something went wrong"));
250
257
  }
251
258
  return "data" in _ && this.schedulerStore.set("eventInfo", _ == null ? void 0 : _.data), this.schedulerStore.set("isLoading", !1), _;
252
259
  }
253
260
  }
254
- function C(n = {}) {
261
+ function z(r = {}) {
255
262
  const t = {
256
263
  selectedDate: null,
257
264
  selectedLanguage: navigator.language,
258
265
  selectedTimezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
259
266
  selectedTimeslot: null,
260
267
  showBookingForm: !1,
261
- showThankYouMessage: !1,
262
268
  selectableDates: null,
263
269
  availability: [],
264
270
  state: "ready",
265
271
  eventInfo: null,
266
- cancelledEvent: null,
272
+ cancelledEventInfo: null,
267
273
  isLoading: !1,
268
- ...n
274
+ nylasBranding: !0,
275
+ ...r
269
276
  };
270
277
  y("[defaultNylasStoreState]: ", t);
271
- const e = A(t);
278
+ const e = R(t);
272
279
  return e.onChange("availability", (s) => {
273
280
  y("[availability]: ", s);
274
- const i = s.map((r) => r.start_time);
281
+ const i = s.map((n) => n.start_time);
275
282
  y("[selectableDates]: ", i), e.set("selectableDates", i);
276
- }), e.onChange("rescheduleBookingId", (s) => {
277
- s ? e.set("bookingFlow", "rescheduling") : e.set("bookingFlow", "booking");
278
283
  }), e.reset = () => {
279
284
  for (const s in t) {
280
285
  const i = t[s];
@@ -283,7 +288,7 @@ function C(n = {}) {
283
288
  }, e;
284
289
  }
285
290
  export {
286
- C,
287
- f as E,
288
- z as N
291
+ z as C,
292
+ S as E,
293
+ C as N
289
294
  };