@nylas/web-elements 1.3.2 → 1.3.3

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 (210) hide show
  1. package/dist/cdn/checkbox-component/checkbox-component.es.js +48 -38
  2. package/dist/cdn/multi-select-dropdown/multi-select-dropdown.es.js +554 -535
  3. package/dist/cdn/nylas-additional-participants/nylas-additional-participants.es.js +2 -2
  4. package/dist/cdn/nylas-booking-form/nylas-booking-form.es.js +25 -9
  5. package/dist/cdn/nylas-booking-form-config/nylas-booking-form-config.es.js +2182 -2171
  6. package/dist/cdn/nylas-buffer-time/nylas-buffer-time.es.js +13 -14
  7. package/dist/cdn/nylas-calendar-picker/nylas-calendar-picker.es.js +571 -552
  8. package/dist/cdn/nylas-connected-calendars/nylas-connected-calendars.es.js +26 -7
  9. package/dist/cdn/nylas-customize-booking-settings/nylas-customize-booking-settings.es.js +12 -2
  10. package/dist/cdn/nylas-date-component/nylas-date-component.es.js +13 -7
  11. package/dist/cdn/nylas-editor-tabs/nylas-editor-tabs.es.js +3550 -3473
  12. package/dist/cdn/nylas-event-location/nylas-event-location.es.js +633 -621
  13. package/dist/cdn/nylas-limit-future-bookings/nylas-limit-future-bookings.es.js +25 -2
  14. package/dist/cdn/nylas-min-booking-notice/nylas-min-booking-notice.es.js +25 -2
  15. package/dist/cdn/nylas-min-cancellation-notice/nylas-min-cancellation-notice.es.js +163 -140
  16. package/dist/cdn/nylas-page-styling/nylas-page-styling.es.js +5 -3
  17. package/dist/cdn/nylas-participants-custom-availability/nylas-participants-custom-availability.es.js +4 -3
  18. package/dist/cdn/nylas-provider/nylas-provider.es.js +1 -1
  19. package/dist/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +173 -96
  20. package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +28 -12
  21. package/dist/cdn/scheduler-store/scheduler-store.es.js +1 -1
  22. package/dist/cdn/time-period-selector/time-period-selector.es.js +25 -2
  23. package/dist/cjs/calendar-agenda-fill-icon_53.cjs.entry.js +88 -57
  24. package/dist/cjs/calendar-agenda-fill-icon_53.cjs.entry.js.map +1 -1
  25. package/dist/cjs/checkbox-component.cjs.entry.js +9 -1
  26. package/dist/cjs/checkbox-component.cjs.entry.js.map +1 -1
  27. package/dist/cjs/checkbox-component_3.cjs.entry.js +21 -8
  28. package/dist/cjs/checkbox-component_3.cjs.entry.js.map +1 -1
  29. package/dist/cjs/google-logo-icon_4.cjs.entry.js +2 -2
  30. package/dist/cjs/loader.cjs.js +1 -1
  31. package/dist/cjs/multi-select-dropdown.cjs.entry.js +19 -1
  32. package/dist/cjs/multi-select-dropdown.cjs.entry.js.map +1 -1
  33. package/dist/cjs/nylas-additional-participants.cjs.entry.js +1 -1
  34. package/dist/cjs/nylas-additional-participants.cjs.entry.js.map +1 -1
  35. package/dist/cjs/nylas-booking-form-config.cjs.entry.js +34 -27
  36. package/dist/cjs/nylas-booking-form-config.cjs.entry.js.map +1 -1
  37. package/dist/cjs/nylas-buffer-time.cjs.entry.js +13 -12
  38. package/dist/cjs/nylas-buffer-time.cjs.entry.js.map +1 -1
  39. package/dist/cjs/nylas-connected-calendars.cjs.entry.js +2 -2
  40. package/dist/cjs/nylas-connected-calendars.cjs.entry.js.map +1 -1
  41. package/dist/cjs/nylas-date-component.cjs.entry.js +12 -7
  42. package/dist/cjs/nylas-date-component.cjs.entry.js.map +1 -1
  43. package/dist/cjs/nylas-editor-tabs.cjs.entry.js +2 -2
  44. package/dist/cjs/nylas-event-location.cjs.entry.js +32 -11
  45. package/dist/cjs/nylas-event-location.cjs.entry.js.map +1 -1
  46. package/dist/cjs/nylas-page-styling.cjs.entry.js +3 -2
  47. package/dist/cjs/nylas-page-styling.cjs.entry.js.map +1 -1
  48. package/dist/cjs/nylas-participants-custom-availability.cjs.entry.js +3 -2
  49. package/dist/cjs/nylas-participants-custom-availability.cjs.entry.js.map +1 -1
  50. package/dist/cjs/nylas-provider.cjs.entry.js +1 -1
  51. package/dist/cjs/nylas-scheduling.cjs.entry.js +3 -3
  52. package/dist/cjs/nylas-web-elements.cjs.js +1 -1
  53. package/dist/cjs/{scheduler-store-37a0e152.js → scheduler-store-2cd220d1.js} +2 -2
  54. package/dist/cjs/{scheduler-store-37a0e152.js.map → scheduler-store-2cd220d1.js.map} +1 -1
  55. package/dist/cjs/{scheduler-store-373adf03.js → scheduler-store-70af2279.js} +2 -2
  56. package/dist/cjs/{scheduler-store-373adf03.js.map → scheduler-store-70af2279.js.map} +1 -1
  57. package/dist/cjs/time-period-selector.cjs.entry.js +21 -1
  58. package/dist/cjs/time-period-selector.cjs.entry.js.map +1 -1
  59. package/dist/collection/components/design-system/checkbox-component/checkbox-component.js +12 -1
  60. package/dist/collection/components/design-system/checkbox-component/checkbox-component.js.map +1 -1
  61. package/dist/collection/components/design-system/multi-select-dropdown/multi-select-dropdown.js +22 -1
  62. package/dist/collection/components/design-system/multi-select-dropdown/multi-select-dropdown.js.map +1 -1
  63. package/dist/collection/components/design-system/nylas-date-component/nylas-date-component.js +14 -8
  64. package/dist/collection/components/design-system/nylas-date-component/nylas-date-component.js.map +1 -1
  65. package/dist/collection/components/design-system/nylas-date-component/test/nylas-date-component.spec.js +39 -0
  66. package/dist/collection/components/design-system/nylas-date-component/test/nylas-date-component.spec.js.map +1 -0
  67. package/dist/collection/components/design-system/time-period-selector/time-period-selector.js +28 -1
  68. package/dist/collection/components/design-system/time-period-selector/time-period-selector.js.map +1 -1
  69. package/dist/collection/components/scheduler/nylas-date-picker/test/nylas-date-picker.spec.js +3 -1
  70. package/dist/collection/components/scheduler/nylas-date-picker/test/nylas-date-picker.spec.js.map +1 -1
  71. package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js +1 -1
  72. package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js.map +1 -1
  73. package/dist/collection/components/scheduler-editor/nylas-booking-form-config/nylas-booking-form-config.js +36 -27
  74. package/dist/collection/components/scheduler-editor/nylas-booking-form-config/nylas-booking-form-config.js.map +1 -1
  75. package/dist/collection/components/scheduler-editor/nylas-booking-form-config/test/nylas-booking-form-config.spec.js +23 -0
  76. package/dist/collection/components/scheduler-editor/nylas-booking-form-config/test/nylas-booking-form-config.spec.js.map +1 -1
  77. package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.js +13 -12
  78. package/dist/collection/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.js.map +1 -1
  79. package/dist/collection/components/scheduler-editor/nylas-calendar-picker/test/nylas-calendar-picker.spec.js +13 -0
  80. package/dist/collection/components/scheduler-editor/nylas-calendar-picker/test/nylas-calendar-picker.spec.js.map +1 -1
  81. package/dist/collection/components/scheduler-editor/nylas-connected-calendars/nylas-connected-calendars.js +2 -2
  82. package/dist/collection/components/scheduler-editor/nylas-connected-calendars/nylas-connected-calendars.js.map +1 -1
  83. package/dist/collection/components/scheduler-editor/nylas-event-location/nylas-event-location.js +35 -10
  84. package/dist/collection/components/scheduler-editor/nylas-event-location/nylas-event-location.js.map +1 -1
  85. package/dist/collection/components/scheduler-editor/nylas-page-styling/nylas-page-styling.js +4 -1
  86. package/dist/collection/components/scheduler-editor/nylas-page-styling/nylas-page-styling.js.map +1 -1
  87. package/dist/collection/components/scheduler-editor/nylas-participants-custom-availability/nylas-participants-custom-availability.js +3 -2
  88. package/dist/collection/components/scheduler-editor/nylas-participants-custom-availability/nylas-participants-custom-availability.js.map +1 -1
  89. package/dist/components/checkbox-component2.js +12 -2
  90. package/dist/components/checkbox-component2.js.map +1 -1
  91. package/dist/components/multi-select-dropdown2.js +22 -2
  92. package/dist/components/multi-select-dropdown2.js.map +1 -1
  93. package/dist/components/nylas-additional-participants2.js +1 -1
  94. package/dist/components/nylas-additional-participants2.js.map +1 -1
  95. package/dist/components/nylas-booking-form-config2.js +35 -27
  96. package/dist/components/nylas-booking-form-config2.js.map +1 -1
  97. package/dist/components/nylas-buffer-time2.js +13 -12
  98. package/dist/components/nylas-buffer-time2.js.map +1 -1
  99. package/dist/components/nylas-connected-calendars2.js +2 -2
  100. package/dist/components/nylas-connected-calendars2.js.map +1 -1
  101. package/dist/components/nylas-date-component2.js +14 -8
  102. package/dist/components/nylas-date-component2.js.map +1 -1
  103. package/dist/components/nylas-editor-tabs2.js +2 -2
  104. package/dist/components/nylas-event-location2.js +35 -12
  105. package/dist/components/nylas-event-location2.js.map +1 -1
  106. package/dist/components/nylas-page-styling2.js +5 -3
  107. package/dist/components/nylas-page-styling2.js.map +1 -1
  108. package/dist/components/nylas-participants-custom-availability2.js +3 -2
  109. package/dist/components/nylas-participants-custom-availability2.js.map +1 -1
  110. package/dist/components/nylas-scheduling.js +2 -2
  111. package/dist/components/scheduler-store.js +1 -1
  112. package/dist/components/time-period-selector2.js +26 -2
  113. package/dist/components/time-period-selector2.js.map +1 -1
  114. package/dist/esm/calendar-agenda-fill-icon_53.entry.js +88 -57
  115. package/dist/esm/calendar-agenda-fill-icon_53.entry.js.map +1 -1
  116. package/dist/esm/checkbox-component.entry.js +9 -1
  117. package/dist/esm/checkbox-component.entry.js.map +1 -1
  118. package/dist/esm/checkbox-component_3.entry.js +21 -8
  119. package/dist/esm/checkbox-component_3.entry.js.map +1 -1
  120. package/dist/esm/google-logo-icon_4.entry.js +2 -2
  121. package/dist/esm/loader.js +1 -1
  122. package/dist/esm/multi-select-dropdown.entry.js +19 -1
  123. package/dist/esm/multi-select-dropdown.entry.js.map +1 -1
  124. package/dist/esm/nylas-additional-participants.entry.js +1 -1
  125. package/dist/esm/nylas-additional-participants.entry.js.map +1 -1
  126. package/dist/esm/nylas-booking-form-config.entry.js +34 -27
  127. package/dist/esm/nylas-booking-form-config.entry.js.map +1 -1
  128. package/dist/esm/nylas-buffer-time.entry.js +13 -12
  129. package/dist/esm/nylas-buffer-time.entry.js.map +1 -1
  130. package/dist/esm/nylas-connected-calendars.entry.js +2 -2
  131. package/dist/esm/nylas-connected-calendars.entry.js.map +1 -1
  132. package/dist/esm/nylas-date-component.entry.js +12 -7
  133. package/dist/esm/nylas-date-component.entry.js.map +1 -1
  134. package/dist/esm/nylas-editor-tabs.entry.js +2 -2
  135. package/dist/esm/nylas-event-location.entry.js +32 -11
  136. package/dist/esm/nylas-event-location.entry.js.map +1 -1
  137. package/dist/esm/nylas-page-styling.entry.js +3 -2
  138. package/dist/esm/nylas-page-styling.entry.js.map +1 -1
  139. package/dist/esm/nylas-participants-custom-availability.entry.js +3 -2
  140. package/dist/esm/nylas-participants-custom-availability.entry.js.map +1 -1
  141. package/dist/esm/nylas-provider.entry.js +1 -1
  142. package/dist/esm/nylas-scheduling.entry.js +3 -3
  143. package/dist/esm/nylas-web-elements.js +1 -1
  144. package/dist/esm/{scheduler-store-20151a77.js → scheduler-store-3acf4d70.js} +2 -2
  145. package/dist/esm/{scheduler-store-20151a77.js.map → scheduler-store-3acf4d70.js.map} +1 -1
  146. package/dist/esm/{scheduler-store-b6d12f40.js → scheduler-store-79dc16cc.js} +2 -2
  147. package/dist/esm/{scheduler-store-b6d12f40.js.map → scheduler-store-79dc16cc.js.map} +1 -1
  148. package/dist/esm/time-period-selector.entry.js +21 -1
  149. package/dist/esm/time-period-selector.entry.js.map +1 -1
  150. package/dist/nylas-web-elements/checkbox-component.entry.js +9 -1
  151. package/dist/nylas-web-elements/checkbox-component.entry.js.map +1 -1
  152. package/dist/nylas-web-elements/multi-select-dropdown.entry.js +19 -1
  153. package/dist/nylas-web-elements/multi-select-dropdown.entry.js.map +1 -1
  154. package/dist/nylas-web-elements/nylas-additional-participants.entry.js +1 -1
  155. package/dist/nylas-web-elements/nylas-additional-participants.entry.js.map +1 -1
  156. package/dist/nylas-web-elements/nylas-booking-form-config.entry.js +34 -27
  157. package/dist/nylas-web-elements/nylas-booking-form-config.entry.js.map +1 -1
  158. package/dist/nylas-web-elements/nylas-buffer-time.entry.js +13 -12
  159. package/dist/nylas-web-elements/nylas-buffer-time.entry.js.map +1 -1
  160. package/dist/nylas-web-elements/nylas-connected-calendars.entry.js +2 -2
  161. package/dist/nylas-web-elements/nylas-connected-calendars.entry.js.map +1 -1
  162. package/dist/nylas-web-elements/nylas-date-component.entry.js +12 -7
  163. package/dist/nylas-web-elements/nylas-date-component.entry.js.map +1 -1
  164. package/dist/nylas-web-elements/nylas-editor-tabs.entry.js +2 -2
  165. package/dist/nylas-web-elements/nylas-event-location.entry.js +32 -11
  166. package/dist/nylas-web-elements/nylas-event-location.entry.js.map +1 -1
  167. package/dist/nylas-web-elements/nylas-page-styling.entry.js +3 -2
  168. package/dist/nylas-web-elements/nylas-page-styling.entry.js.map +1 -1
  169. package/dist/nylas-web-elements/nylas-participants-custom-availability.entry.js +3 -2
  170. package/dist/nylas-web-elements/nylas-participants-custom-availability.entry.js.map +1 -1
  171. package/dist/nylas-web-elements/nylas-provider.entry.js +1 -1
  172. package/dist/nylas-web-elements/nylas-scheduling.entry.js +3 -3
  173. package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
  174. package/dist/nylas-web-elements/p-040b8553.entry.js +2 -0
  175. package/dist/nylas-web-elements/p-040b8553.entry.js.map +1 -0
  176. package/dist/nylas-web-elements/p-13a83f9a.entry.js +8 -0
  177. package/dist/nylas-web-elements/p-13a83f9a.entry.js.map +1 -0
  178. package/dist/nylas-web-elements/p-1a9fc29a.entry.js +2 -0
  179. package/dist/nylas-web-elements/p-1a9fc29a.entry.js.map +1 -0
  180. package/dist/nylas-web-elements/{p-e543a827.entry.js → p-1dedce7c.entry.js} +2 -2
  181. package/dist/nylas-web-elements/{p-284c14bb.js → p-53f7b360.js} +2 -2
  182. package/dist/nylas-web-elements/p-7f100474.entry.js +2 -0
  183. package/dist/nylas-web-elements/p-7f100474.entry.js.map +1 -0
  184. package/dist/nylas-web-elements/{p-70d36207.entry.js → p-84e69241.entry.js} +2 -2
  185. package/dist/nylas-web-elements/{p-36c73819.entry.js → p-ad7f8831.entry.js} +2 -2
  186. package/dist/nylas-web-elements/{scheduler-store-b6d12f40.js → scheduler-store-79dc16cc.js} +2 -2
  187. package/dist/nylas-web-elements/{scheduler-store-b6d12f40.js.map → scheduler-store-79dc16cc.js.map} +1 -1
  188. package/dist/nylas-web-elements/time-period-selector.entry.js +21 -1
  189. package/dist/nylas-web-elements/time-period-selector.entry.js.map +1 -1
  190. package/dist/types/components/design-system/checkbox-component/checkbox-component.d.ts +1 -0
  191. package/dist/types/components/design-system/multi-select-dropdown/multi-select-dropdown.d.ts +2 -0
  192. package/dist/types/components/design-system/nylas-date-component/nylas-date-component.d.ts +1 -0
  193. package/dist/types/components/design-system/time-period-selector/time-period-selector.d.ts +3 -0
  194. package/dist/types/components/scheduler-editor/nylas-booking-form-config/nylas-booking-form-config.d.ts +2 -0
  195. package/dist/types/components/scheduler-editor/nylas-buffer-time/nylas-buffer-time.d.ts +2 -0
  196. package/dist/types/components/scheduler-editor/nylas-event-location/nylas-event-location.d.ts +3 -0
  197. package/dist/types/components/scheduler-editor/nylas-participants-custom-availability/nylas-participants-custom-availability.d.ts +2 -2
  198. package/package.json +1 -1
  199. package/dist/nylas-web-elements/p-2fa604d7.entry.js +0 -2
  200. package/dist/nylas-web-elements/p-2fa604d7.entry.js.map +0 -1
  201. package/dist/nylas-web-elements/p-52b9c0cb.entry.js +0 -2
  202. package/dist/nylas-web-elements/p-52b9c0cb.entry.js.map +0 -1
  203. package/dist/nylas-web-elements/p-9db69aed.entry.js +0 -2
  204. package/dist/nylas-web-elements/p-9db69aed.entry.js.map +0 -1
  205. package/dist/nylas-web-elements/p-a1a75dc7.entry.js +0 -8
  206. package/dist/nylas-web-elements/p-a1a75dc7.entry.js.map +0 -1
  207. /package/dist/nylas-web-elements/{p-e543a827.entry.js.map → p-1dedce7c.entry.js.map} +0 -0
  208. /package/dist/nylas-web-elements/{p-284c14bb.js.map → p-53f7b360.js.map} +0 -0
  209. /package/dist/nylas-web-elements/{p-70d36207.entry.js.map → p-84e69241.entry.js.map} +0 -0
  210. /package/dist/nylas-web-elements/{p-36c73819.entry.js.map → p-ad7f8831.entry.js.map} +0 -0
@@ -410,10 +410,10 @@ const NylasAdditionalParticipants = class {
410
410
  componentWillLoad() {
411
411
  debug('nylas-additional-participants', 'componentWillLoad');
412
412
  this.host.setAttribute('name', this.name);
413
- this.updateState(this.selectedConfiguration, this.currentUser);
414
413
  }
415
414
  componentDidLoad() {
416
415
  debug('nylas-additional-participants', 'componentDidLoad');
416
+ this.updateState(this.selectedConfiguration, this.currentUser);
417
417
  }
418
418
  disconnectedCallback() {
419
419
  debug('nylas-additional-participants', 'disconnectedCallback');
@@ -3998,6 +3998,28 @@ var __metadata$q = (undefined && undefined.__metadata) || function (k, v) {
3998
3998
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3999
3999
  return Reflect.metadata(k, v);
4000
4000
  };
4001
+ const staticFields = [
4002
+ {
4003
+ type: 'text',
4004
+ label: 'Your name',
4005
+ key: 'your_name',
4006
+ typeLabel: 'Short text',
4007
+ readonly: true,
4008
+ required: true,
4009
+ isOpen: false,
4010
+ order: 0,
4011
+ },
4012
+ {
4013
+ type: 'email',
4014
+ label: 'Your Email',
4015
+ key: 'your_email',
4016
+ typeLabel: 'Email',
4017
+ readonly: true,
4018
+ isOpen: false,
4019
+ required: true,
4020
+ order: 1,
4021
+ },
4022
+ ];
4001
4023
  const NylasBookingFormConfig = class {
4002
4024
  constructor(hostRef) {
4003
4025
  registerInstance(this, hostRef);
@@ -4018,6 +4040,9 @@ const NylasBookingFormConfig = class {
4018
4040
  debug('nylas-calendar-picker', 'elementNameChangedHandler', newValue);
4019
4041
  this.host.setAttribute('name', newValue);
4020
4042
  }
4043
+ selectedConfigurationChangedHandler(newValue) {
4044
+ this.updateFormFields(newValue);
4045
+ }
4021
4046
  connectedCallback() {
4022
4047
  debug('nylas-booking-form-config', 'connectedCallback');
4023
4048
  }
@@ -4027,37 +4052,18 @@ const NylasBookingFormConfig = class {
4027
4052
  componentWillLoad() {
4028
4053
  debug('nylas-booking-form-config', 'componentWillLoad');
4029
4054
  this.host.setAttribute('name', this.name);
4030
- const staticFields = [
4031
- {
4032
- type: 'text',
4033
- label: 'Your name',
4034
- key: 'your_name',
4035
- typeLabel: 'Short text',
4036
- readonly: true,
4037
- required: true,
4038
- isOpen: false,
4039
- order: 0,
4040
- },
4041
- {
4042
- type: 'email',
4043
- label: 'Your Email',
4044
- key: 'your_email',
4045
- typeLabel: 'Email',
4046
- readonly: true,
4047
- isOpen: false,
4048
- required: true,
4049
- order: 1,
4050
- },
4051
- ];
4052
4055
  this.formFields = [...staticFields];
4053
4056
  }
4054
4057
  componentDidLoad() {
4055
4058
  debug('nylas-booking-form-config', 'componentDidLoad');
4056
- const additionalFields = Object.entries(this.selectedConfiguration?.scheduler?.additional_fields || {}).map(([id, field]) => ({ ...field, key: id })) ||
4057
- this.additionalFields ||
4058
- [];
4059
+ if (this.selectedConfiguration) {
4060
+ this.updateFormFields(this.selectedConfiguration);
4061
+ }
4062
+ }
4063
+ updateFormFields(config) {
4064
+ const additionalFields = Object.entries(config?.scheduler?.additional_fields || {}).map(([id, field]) => ({ ...field, key: id })) || this.additionalFields || [];
4059
4065
  this.formFields = [
4060
- ...this.formFields,
4066
+ ...staticFields,
4061
4067
  ...additionalFields
4062
4068
  .sort((a, b) => a.order - b.order)
4063
4069
  .map((f, i) => {
@@ -4265,7 +4271,7 @@ const NylasBookingFormConfig = class {
4265
4271
  });
4266
4272
  }
4267
4273
  render() {
4268
- return (h(Host, { key: '632d9bd6cc0162efdb7e83b78b23935f04569fcb' }, h("div", { key: 'dae8d7f52a658b121a992f9cd73cd766e2c16cec', class: "nylas-booking-form-config", part: "nbfc" }, h("div", { key: '4f02c7163dfecd29df48da9b163e12e9a6c9c357', class: "header", part: "nbfc__header" }, h("div", { key: '169cfa3f8d4dd519dd0621d032d3e7a13384b8c7', class: "header_text" }, h("h3", { key: '66e50347bae8fca4c3344030d4d3caf4158244e2' }, "Booking form"), h("p", { key: '883886b2c841acdbd44e6cb1c18a860a51c52412' }, "Add custom fields to the booking form.")), h("div", { key: 'e307526fa6d75c4aaaa71c5658006d9e7417c0f0', class: "header_action" }, h("select-dropdown", { key: '4b16dd221f5740b21cde95488e2609730e08ea54', name: "add-field", exportparts: "sd_dropdown: nbfc__add_field, sd_dropdown-button: nbfc__add_field-button, sd_dropdown-content: nbfc__add_field-dropdown-content", options: DEFAULT_FORM_FIELD_TYPES, withSearch: false, withChevron: false, dropdownButtonText: "Add new field" }, h("span", { key: '5ccd949bb563f32f1682b9432759828f086b46e3', slot: "select-icon" }, h("plus-icon", { key: 'b77ac5dd297071ec6e16c3728db1a7b096e83e74', width: "15", height: "15" }))))), h("div", { key: 'a7499ce8959d027f0540b086c3393353c3993452', class: "content" }, h("div", { key: 'ff24161e13beba123ca46c814515704bf06d4259', id: "fields", class: "additional_fields", part: "nbfc__additional_fields" }, this.formFields.map((field, i) => {
4274
+ return (h(Host, { key: 'bd832f2b9a02ce53187e4f633e4c0388e6e65a03' }, h("div", { key: 'fcf79fe131d8e0a99312286b15f228b997d8c0be', class: "nylas-booking-form-config", part: "nbfc" }, h("div", { key: '07cd086a8af8145f5a8c6676e360fa5f919040f3', class: "header", part: "nbfc__header" }, h("div", { key: 'f703982061b36b7f4b792f4deff59cc4256b7c25', class: "header_text" }, h("h3", { key: 'a7cba135c527592a000c296ceaf68bb91c9ddcf4' }, "Booking form"), h("p", { key: '62acf8b4a583145e2bc300b1b351799dec1ff438' }, "Add custom fields to the booking form.")), h("div", { key: '574ef9a02aa06ad29ac0b08c22aa749a844d32d8', class: "header_action" }, h("select-dropdown", { key: 'c2a83f721237dc1032af5e55e17438e1060b2e58', name: "add-field", exportparts: "sd_dropdown: nbfc__add_field, sd_dropdown-button: nbfc__add_field-button, sd_dropdown-content: nbfc__add_field-dropdown-content", options: DEFAULT_FORM_FIELD_TYPES, withSearch: false, withChevron: false, dropdownButtonText: "Add new field" }, h("span", { key: 'e0aaa33a3bd04b79499310c3904984269eaecbf3', slot: "select-icon" }, h("plus-icon", { key: '06bf29f2b3d0dca74d660db8791a47bc2474652b', width: "15", height: "15" }))))), h("div", { key: 'b33cfae9a876be328d795366802a1791e22ca164', class: "content" }, h("div", { key: '0df453e1fc129a13b90b33c6e267ecd9dd149c56', id: "fields", class: "additional_fields", part: "nbfc__additional_fields" }, this.formFields.map((field, i) => {
4269
4275
  return (h("div", { class: `form-field draggable ${field.readonly && 'fixed'}`, part: "nbfc__form_field", key: i }, h("div", { class: "form-field_header", part: "nbfc__form_field-header" }, h("span", { class: "dragable" }, h("dragable-icon", { width: "24", height: "25" })), h("div", { class: "form-field_header_text" }, h("h4", null, field.label), h("p", null, field.typeLabel)), h("div", { class: "form-field_header_actions" }, h("span", { class: `is-required` }, field.required ? 'Required' : 'Optional'), !field.readonly && (h("button", { onClick: () => {
4270
4276
  this.fieldRemove(i);
4271
4277
  } }, h("close-icon", null))), h("span", { class: `chevron ${field.isOpen ? 'open' : 'closed'}`, onClick: () => {
@@ -4285,6 +4291,7 @@ const NylasBookingFormConfig = class {
4285
4291
  get host() { return getElement(this); }
4286
4292
  static get watchers() { return {
4287
4293
  "name": ["elementNameChangedHandler"],
4294
+ "selectedConfiguration": ["selectedConfigurationChangedHandler"],
4288
4295
  "formFields": ["watchHandler"]
4289
4296
  }; }
4290
4297
  };
@@ -4354,14 +4361,8 @@ const NylasBufferTime = class {
4354
4361
  this.selectedBeforeBufferTime = this.buffer.before;
4355
4362
  this.selectedAfterBufferTime = this.buffer.after;
4356
4363
  }
4364
+ this.updateFormValue();
4357
4365
  this.componentLoaded = true;
4358
- if (typeof this.internals.setFormValue === 'function') {
4359
- const bufferTime = {
4360
- before: this.selectedBeforeBufferTime,
4361
- after: this.selectedAfterBufferTime,
4362
- };
4363
- this.internals.setFormValue(JSON.stringify(bufferTime), this.name);
4364
- }
4365
4366
  }
4366
4367
  componentWillUpdate() {
4367
4368
  debug('nylas-buffer-time', 'componentWillUpdate');
@@ -4384,6 +4385,7 @@ const NylasBufferTime = class {
4384
4385
  const buffer = newValue?.availability?.availability_rules?.buffer;
4385
4386
  this.selectedAfterBufferTime = buffer?.after ? buffer.after : this.buffer.after;
4386
4387
  this.selectedBeforeBufferTime = buffer?.before ? buffer.before : this.buffer.before;
4388
+ this.updateFormValue();
4387
4389
  }
4388
4390
  nylasFormDropdownChangedHandler(event) {
4389
4391
  debug('nylas-buffer-time', 'nylasFormDropdownChangedHandler', event.detail);
@@ -4395,14 +4397,20 @@ const NylasBufferTime = class {
4395
4397
  else if (name === 'after-buffer-time') {
4396
4398
  this.selectedAfterBufferTime = parseInt(value);
4397
4399
  }
4398
- const bufferTime = {
4399
- before: this.selectedBeforeBufferTime,
4400
- after: this.selectedAfterBufferTime,
4401
- };
4402
- this.internals.setFormValue(JSON.stringify(bufferTime), 'booking-calendar');
4400
+ this.updateFormValue();
4403
4401
  };
4404
4402
  this.valueChanged.emit({ ...event.detail, valueChanged });
4405
4403
  }
4404
+ get isInternalsAvailable() {
4405
+ return this.internals !== undefined && typeof this.internals.setFormValue === 'function';
4406
+ }
4407
+ updateFormValue() {
4408
+ const bufferTime = {
4409
+ before: this.selectedBeforeBufferTime,
4410
+ after: this.selectedAfterBufferTime,
4411
+ };
4412
+ this.isInternalsAvailable && this.internals.setFormValue(JSON.stringify(bufferTime), this.name);
4413
+ }
4406
4414
  renderPreview() {
4407
4415
  const totalSlots = 4;
4408
4416
  const slotHeight = 10;
@@ -5016,14 +5024,14 @@ const NylasConnectedCalendars = class {
5016
5024
  selectedParticipants[participant.email] = {
5017
5025
  isOpen: isOpen,
5018
5026
  name: participant.name || participant.email,
5019
- availability: participant.availability,
5027
+ calendars: participant.availability?.calendar_ids,
5020
5028
  };
5021
5029
  }
5022
5030
  });
5023
5031
  return selectedParticipants;
5024
5032
  }
5025
5033
  render() {
5026
- return (h(Host, { key: '32710fe762bdf90e238c62695957a9fca31db258' }, h("div", { key: 'a5ebf4adb7eb8e1b8a065bc05733738da06fbac3', class: "nylas-connected-calendars", part: "nccals" }, h("div", { key: 'f3c820bcde922a7b852630d86145b1e6e1bf0e25', class: "header", part: "nccals__header" }, h("h3", { key: 'e2b68d05d416c322b22f969d8d8c890a09812154' }, "Connected Calendars"), h("p", { key: '4dd41d10a6043fec1c0f4943371c312a29e1d489' }, "Select the calendars to use for checking your availability.", h("tooltip-component", { key: '6a8ec009fd879e1ed6b6fb65be75a88255adba17' }, h("info-icon", { key: '0d4a99eaee064ecee1c82ee5b13f3ab87a1d5d93', slot: "tooltip-icon" }), h("span", { key: 'de3779efce64d7a14dbc3f7759c827005f92ed50', slot: "tooltip-content" }, "Check availability across one or more calendars. If you select multiple calendars for a participant, the participant must be available across all of their calendars to be considered available.")))), h("div", { key: '720267110636c1dc06ac67b7e715515f56737b73', class: "content", part: "nccals__content" }, h("form", { key: 'f295ba327aa302ea186dbf2daef3a9c30f96ee5f', ref: el => (this.connectedCalendarsFormRef = el) }, Object.keys(this.participantCalendars).map((key, index) => {
5034
+ return (h(Host, { key: '4b8cfcfa751c2790968049f6f10a06193f9adc70' }, h("div", { key: 'ffbcde80612886bc09b4419bc1cc47d585834fac', class: "nylas-connected-calendars", part: "nccals" }, h("div", { key: 'd00c14cd0ab8107a2ba609ba58b596a7d3e1e69f', class: "header", part: "nccals__header" }, h("h3", { key: 'cb0ad20533c33a3778d0b89fe5d51aa4c15864a8' }, "Connected Calendars"), h("p", { key: 'b3488e835534f477d2585be0a60b5800d42cbaac' }, "Select the calendars to use for checking your availability.", h("tooltip-component", { key: '6acbd37df60566fa8a3fb8676fe3b3f4287d5c06' }, h("info-icon", { key: 'f1eb4a75f869b09bee95c074c8d180449654a49f', slot: "tooltip-icon" }), h("span", { key: 'e8aca8b29c7a89fe7b6eea0635761bdde19349e2', slot: "tooltip-content" }, "Check availability across one or more calendars. If you select multiple calendars for a participant, the participant must be available across all of their calendars to be considered available.")))), h("div", { key: '844803e9ea3270bfcedbc212990c0038a74dd663', class: "content", part: "nccals__content" }, h("form", { key: '2970ec7cec45d2582b987cbfab8949c1ece02499', ref: el => (this.connectedCalendarsFormRef = el) }, Object.keys(this.participantCalendars).map((key, index) => {
5027
5035
  const participant = this.selectedCalendars[key];
5028
5036
  const participantCalendars = this.participantCalendars[key];
5029
5037
  if (!participant || !participant.name)
@@ -5843,6 +5851,18 @@ const NylasEventLocation = class {
5843
5851
  this.location = '';
5844
5852
  }
5845
5853
  }
5854
+ currentUserChangedHandler(newValue) {
5855
+ debug('nylas-custom-booking-flow', 'currentUserChangedHandler', newValue);
5856
+ if (newValue?.provider) {
5857
+ this.userProviderState = newValue?.provider;
5858
+ this.setLocationOptionsForProvider(this.userProviderState);
5859
+ }
5860
+ }
5861
+ conferenceProvidersChanged(newValue) {
5862
+ if (newValue?.['zoom'] && !this.locationOptions.some(option => option.value === 'zoom')) {
5863
+ this.locationOptions.push({ value: 'zoom', label: labels['zoom'], labelHTML: this.getLabelHTML('zoom') });
5864
+ }
5865
+ }
5846
5866
  connectedCallback() {
5847
5867
  debug('nylas-event-location', 'connectedCallback');
5848
5868
  }
@@ -5859,15 +5879,8 @@ const NylasEventLocation = class {
5859
5879
  this.selectedLocationOption = this.setDefaultLocationOption(this.eventConferencing || null, this.eventLocation ?? '');
5860
5880
  }
5861
5881
  this.userProviderState = this.userProvider ?? this.currentUser?.provider ?? '';
5862
- switch (this.userProviderState) {
5863
- case 'google':
5864
- this.locationOptions.push({ value: 'google', label: labels['google'], labelHTML: this.getLabelHTML('google') });
5865
- break;
5866
- case 'microsoft':
5867
- this.locationOptions.push({ value: 'microsoft', label: labels['microsoft'], labelHTML: this.getLabelHTML('microsoft') });
5868
- break;
5869
- }
5870
- if (this.conferenceProviders?.['zoom']) {
5882
+ this.setLocationOptionsForProvider(this.userProviderState);
5883
+ if (this.conferenceProviders?.['zoom'] && !this.locationOptions.some(option => option.value === 'zoom')) {
5871
5884
  this.locationOptions.push({ value: 'zoom', label: labels['zoom'], labelHTML: this.getLabelHTML('zoom') });
5872
5885
  }
5873
5886
  }
@@ -5934,6 +5947,20 @@ const NylasEventLocation = class {
5934
5947
  break;
5935
5948
  }
5936
5949
  }
5950
+ setLocationOptionsForProvider(provider) {
5951
+ switch (provider) {
5952
+ case 'google':
5953
+ if (!this.locationOptions.some(option => option.value === 'google')) {
5954
+ this.locationOptions.push({ value: 'google', label: labels['google'], labelHTML: this.getLabelHTML('google') });
5955
+ }
5956
+ break;
5957
+ case 'microsoft':
5958
+ if (!this.locationOptions.some(option => option.value === 'microsoft')) {
5959
+ this.locationOptions.push({ value: 'microsoft', label: labels['microsoft'], labelHTML: this.getLabelHTML('microsoft') });
5960
+ }
5961
+ break;
5962
+ }
5963
+ }
5937
5964
  setDefaultLocationOption(eventConferencing, eventLocation) {
5938
5965
  if (eventConferencing != null && eventConferencing?.provider != null && eventConferencing?.autocreate != null) {
5939
5966
  return CONFERENCE_PROVIDER_MAP[eventConferencing?.provider];
@@ -5984,13 +6011,15 @@ const NylasEventLocation = class {
5984
6011
  }
5985
6012
  render() {
5986
6013
  const defaultOption = typeof this.selectedLocationOption !== 'undefined' ? this.locationOptions.find(i => i.value == this.selectedLocationOption) : null;
5987
- return (h(Host, { key: '6869d3c2f6316dc482becc022bc973783332658f' }, h("div", { key: 'e17b95b15e181f73efd5c666ff0074bcd5467b65', class: "nylas-event-location", part: "nel" }, h("label", { key: '9370ab01f5f730099dd5061ccf39ca3b53132244', htmlFor: "location" }, "Event meeting or location", h("span", { key: 'acd558f22ad18afc63b93456450a5aa946916fd4', class: "label-icon" }, h("tooltip-component", { key: 'bd2ea171a9eef9e9a377a0be2dc4a16b91bb1359' }, h("info-icon", { key: '745289e658441e9aadb245c94da890cdb3119179', slot: "tooltip-icon" }), h("span", { key: 'ffa4a9597a7d63e33b639dafd736a654a97589c9', slot: "tooltip-content" }, "Select a conferencing option or add a custom location.")))), h("div", { key: '59f930e30b758b740128b42a855608a02ee1a739', class: "location-input" }, defaultOption && defaultOption?.label && (h("select-dropdown", { withSearch: false, name: "location", options: this.locationOptions, defaultSelectedOption: defaultOption, exportparts: "sd_dropdown: nel__dropdown, sd_dropdown-button: nel__dropdown-button, sd_dropdown-content: nel__dropdown-content" }, h("span", { slot: "select-icon" }, this.getIcon(this.selectedLocationOption)))), this.selectedLocationOption === 'custom' && (h("input", { type: "text", part: "nel__location", id: "location", name: "location", maxlength: "1024", value: this.location, onInput: e => this.handleChange(e) }))))));
6014
+ return (h(Host, { key: 'c91ef22df2a83a3c2ac66ca9011ad8633a085b9e' }, h("div", { key: '9e6823ce704cf4870f99936a39371b255b165afb', class: "nylas-event-location", part: "nel" }, h("label", { key: '2d1a71a258d0576460acd68a93cbace4a5c9254c', htmlFor: "location" }, "Event meeting or location", h("span", { key: '9dd7df66eec4e35a8659c88d4f26be99093e815a', class: "label-icon" }, h("tooltip-component", { key: '9299313bad5724106fa7108d0874e760945bcb30' }, h("info-icon", { key: '2490fbc28caa2547d8a3cecc747dc94254c59df3', slot: "tooltip-icon" }), h("span", { key: 'd6c73fef100e4f962507d58b4ed24a1bd19599c2', slot: "tooltip-content" }, "Select a conferencing option or add a custom location.")))), h("div", { key: '726f78440a3e65e379368b0a849bee94b2839dfd', class: "location-input" }, defaultOption && defaultOption?.label && (h("select-dropdown", { withSearch: false, name: "location", options: this.locationOptions, defaultSelectedOption: defaultOption, exportparts: "sd_dropdown: nel__dropdown, sd_dropdown-button: nel__dropdown-button, sd_dropdown-content: nel__dropdown-content" }, h("span", { slot: "select-icon" }, this.getIcon(this.selectedLocationOption)))), this.selectedLocationOption === 'custom' && (h("input", { type: "text", part: "nel__location", id: "location", name: "location", maxlength: "1024", value: this.location, onInput: e => this.handleChange(e) }))))));
5988
6015
  }
5989
6016
  static get formAssociated() { return true; }
5990
6017
  get host() { return getElement(this); }
5991
6018
  static get watchers() { return {
5992
6019
  "name": ["elementNameChangedHandler"],
5993
- "selectedConfiguration": ["selectedConfigurationChangedHandler"]
6020
+ "selectedConfiguration": ["selectedConfigurationChangedHandler"],
6021
+ "currentUser": ["currentUserChangedHandler"],
6022
+ "conferenceProviders": ["conferenceProvidersChanged"]
5994
6023
  }; }
5995
6024
  };
5996
6025
  __decorate$d([
@@ -7250,12 +7279,13 @@ const NylasPageStyling = class {
7250
7279
  this.isOpen = !this.isOpen;
7251
7280
  }
7252
7281
  render() {
7253
- return (h(Host, { key: '1601b88e8e7e2c500cb105f237949faa4e9d8dbd' }, h("div", { key: '2a3072bc409f07961da51439a0f45f930d0725de', part: "nps", class: { 'nylas-page-styling': true, 'no-border': !this.customInputsSlot } }, this.customInputsSlot ? (h("div", { class: "header", part: "nps__header" }, h("div", null, h("h3", null, "Page styling and customization")), h("div", { class: "drawer-toggle", part: "nps__drawer-toggle--container" }, h("span", { class: `chevron ${this.isOpen ? 'open' : 'closed'} `, onClick: () => this.toggleConfirmationEmail() }, h("chevron-icon", { width: "24", height: "24" }))))) : null, h("div", { key: '404727336fdf8d0de2d8e769df1dcc21ae69f34b', id: "nylas-page-styling__body", class: "nylas-page-styling__body", part: "nps__body" }, h("div", { key: '2e7da0539b197347719a1202e04c1f7b238cdc9d', class: { 'nylas-page-styling__section': true, 'no-padding': !this.customInputsSlot } }, h("div", { key: '55ba3e932216f073238b8385071defa9139ca0f9', class: "nylas-page-styling__row" }, h("div", { key: '333576450039ea7f76bfb548c5947609bc813837', class: { subsection: true, hide: !this.isOpen } })))))));
7282
+ return (h(Host, { key: 'c2ffa8ae940e9594f254903d45abc3f7c01d7d41' }, h("div", { key: '1813654e2aaa9c66d5a535186f227968b434654c', part: "nps", class: { 'nylas-page-styling': true, 'no-border': !this.customInputsSlot } }, this.customInputsSlot ? (h("div", { class: "header", part: "nps__header" }, h("div", null, h("h3", null, "Page styling and customization")), h("div", { class: "drawer-toggle", part: "nps__drawer-toggle--container" }, h("span", { class: `chevron ${this.isOpen ? 'open' : 'closed'} `, onClick: () => this.toggleConfirmationEmail() }, h("chevron-icon", { width: "24", height: "24" }))))) : null, h("div", { key: 'cff4891eeb1a958feb2a6b20623b97f908721c60', id: "nylas-page-styling__body", class: "nylas-page-styling__body", part: "nps__body" }, h("div", { key: '16b2398f10b6d7703d02bbbf5c43e3e229499b2d', class: { 'nylas-page-styling__section': true, 'no-padding': !this.customInputsSlot } }, h("div", { key: 'fd09434076ea4626ee9d7b2710ec8418325aa117', class: "nylas-page-styling__row" }, h("div", { key: '16a29cabadc4f1a4ba9f389fe232ea22125cfe36', class: { subsection: true, hide: !this.isOpen } })))))));
7254
7283
  }
7255
7284
  static get formAssociated() { return true; }
7256
7285
  get host() { return getElement(this); }
7257
7286
  static get watchers() { return {
7258
- "name": ["elementNameChangedHandler"]
7287
+ "name": ["elementNameChangedHandler"],
7288
+ "selectedConfiguration": ["selectedConfigurationChangedHandler"]
7259
7289
  }; }
7260
7290
  };
7261
7291
  __decorate$6([
@@ -7599,8 +7629,9 @@ const NylasParticipantsCustomAvailability = class {
7599
7629
  return this.internals !== undefined && typeof this.internals.setFormValue === 'function' && typeof this.internals.setValidity === 'function';
7600
7630
  }
7601
7631
  render() {
7602
- return (h(Host, { key: '5034211537411e732ffee5f7420884e5908cc4e5' }, h("div", { key: '6d016a9b8a3dd204521d9f63de90cd848e9c49e7', class: "nylas-participants-custom-availability", part: "npca" }, h("div", { key: 'fff77ce67f19e5b0bdc7a8b491ff38b1b7d9af55', class: "header", part: "npca__header" }, h("h3", { key: '656016ac8ee26636fad2e725237b1bb538563864' }, "Participant open hours"), h("p", { key: '87ab243b9f3402150c6dae36fc702d7f675350c3' }, "If not set, the default open hours will be used to calculate availability for this participant.")), h("div", { key: 'ba6c30fbb85fc26d6471494716b18f7f815900ec', class: "content", part: "npca__content" }, h("form", { key: '7cc553b6730ead929fc45efa67b29b56e41f022e', ref: el => (this.participantFormRef = el) }, Object.keys(this.selectedParticipants).map((key, index) => {
7632
+ return (h(Host, { key: '64198b8231e1739484f81d02167d7b5f456eda69' }, h("div", { key: '68eb8279c510ef937e19dec06960867c98a5b02a', class: "nylas-participants-custom-availability", part: "npca" }, h("div", { key: '9622d8a7fbc124723cb7135a3a3846fad0e4e458', class: "header", part: "npca__header" }, h("h3", { key: '6424eeeb937ce2225a63d76482ec633efacd9e7a' }, "Participant open hours"), h("p", { key: 'ac021fef4d4b0de03d5e2ca335563ec4f328156c' }, "If not set, the default open hours will be used to calculate availability for this participant.")), h("div", { key: 'e9412e214011b575954196e39ea265dcf86801ec', class: "content", part: "npca__content" }, h("form", { key: 'ab5b4239f2d2b31fcd69d0f2e2d61a8a13003739', ref: el => (this.participantFormRef = el) }, Object.keys(this.selectedParticipants).map((key, index) => {
7603
7633
  const participant = this.selectedParticipants[key];
7634
+ const participantOpenHours = participant.availability?.open_hours || [];
7604
7635
  if (!participant || !participant.name || !participant.availability)
7605
7636
  return;
7606
7637
  return (h("div", { class: "participant-container", part: "npca__participant-container", key: `participant-conatiner-${index}` }, h("div", { class: "participant-title", part: "npca__participant-title" }, h("p", null, participant.name, "'s open hours"), h("div", { class: "participant-toggle", part: "npca__participant-toggle--container" }, h("toggle-switch", { exportparts: "ts_label: npca__toggle-label, ts_input: npca_toggle-input, ts_slider: npca_toggle-slider", name: key, checked: !!participant?.openHours && participant?.openHours.length > 0 }), h("span", { class: `chevron ${participant.isOpen ? 'open' : 'closed'} ${participant.setCustom ? '' : 'disabled'}`, onClick: () => {
@@ -7608,7 +7639,7 @@ const NylasParticipantsCustomAvailability = class {
7608
7639
  return;
7609
7640
  this.selectedParticipants[key].isOpen = !participant.isOpen;
7610
7641
  this.selectedParticipants = { ...this.selectedParticipants };
7611
- } }, h("chevron-icon", { width: "24", height: "24" })))), participant.isOpen && (h("nylas-availability-picker", { key: index, name: `participant-${index}-${key}`, openHours: participant.openHours, defaultTimezone: participant.timezone, hideHeader: true }))));
7642
+ } }, h("chevron-icon", { width: "24", height: "24" })))), participant.isOpen && (h("nylas-availability-picker", { key: index, name: `participant-${index}-${key}`, openHours: participantOpenHours, defaultTimezone: participant.timezone, hideHeader: true }))));
7612
7643
  }))))));
7613
7644
  }
7614
7645
  static get formAssociated() { return true; }