@nylas/web-elements 2.3.2 → 2.3.3-canary-20260206145315
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.
- package/dist/cdn/input-color-picker/input-color-picker.es.js +1 -1
- package/dist/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +11 -11
- package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +8 -8
- package/dist/cjs/calendar-agenda-fill-icon_39.cjs.entry.js +1 -1
- package/dist/cjs/calendar-agenda-fill-icon_39.cjs.entry.js.map +1 -1
- package/dist/cjs/checkbox-component.cjs.entry.js +1 -1
- package/dist/cjs/checkbox-component.cjs.entry.js.map +1 -1
- package/dist/cjs/checkbox-component.entry.cjs.js.map +1 -1
- package/dist/cjs/checkmark-icon_15.cjs.entry.js +3 -3
- package/dist/cjs/checkmark-icon_15.cjs.entry.js.map +1 -1
- package/dist/cjs/chevron-icon.search-icon.select-dropdown.entry.cjs.js.map +1 -1
- package/dist/cjs/chevron-icon_3.cjs.entry.js +1 -1
- package/dist/cjs/chevron-icon_3.cjs.entry.js.map +1 -1
- package/dist/cjs/globe-icon.nylas-date-component.nylas-time-window-picker.entry.cjs.js.map +1 -1
- package/dist/cjs/globe-icon_3.cjs.entry.js +1 -1
- package/dist/cjs/globe-icon_3.cjs.entry.js.map +1 -1
- package/dist/cjs/google-logo-icon_6.cjs.entry.js +1 -1
- package/dist/cjs/input-component.cjs.entry.js +1 -1
- package/dist/cjs/input-component.cjs.entry.js.map +1 -1
- package/dist/cjs/input-component.entry.cjs.js.map +1 -1
- package/dist/cjs/nylas-booked-event-card_11.cjs.entry.js +1 -1
- package/dist/cjs/nylas-booked-event-card_11.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js +1 -1
- package/dist/cjs/radio-button-group.cjs.entry.js +1 -1
- package/dist/cjs/radio-button-group.cjs.entry.js.map +1 -1
- package/dist/cjs/radio-button-group.entry.cjs.js.map +1 -1
- package/dist/cjs/textarea-component.cjs.entry.js +1 -1
- package/dist/cjs/textarea-component.cjs.entry.js.map +1 -1
- package/dist/cjs/textarea-component.entry.cjs.js.map +1 -1
- package/dist/cjs/{version-DUyFnawM.js → version-CwWnMgnL.js} +3 -3
- package/dist/cjs/{version-DUyFnawM.js.map → version-CwWnMgnL.js.map} +1 -1
- package/dist/collection/components/design-system/checkbox-component/checkbox-component.css +2 -0
- package/dist/collection/components/design-system/input-color-picker/input-color-picker.css +2 -0
- package/dist/collection/components/design-system/input-component/input-component.css +2 -0
- package/dist/collection/components/design-system/nylas-date-component/nylas-date-component.css +2 -0
- package/dist/collection/components/design-system/radio-button-group/radio-button-group.css +4 -0
- package/dist/collection/components/design-system/select-dropdown/select-dropdown.css +2 -0
- package/dist/collection/components/design-system/textarea-component/textarea-component.css +2 -0
- package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.css +2 -0
- package/dist/collection/components/scheduler-editor/nylas-booking-form-config/nylas-booking-form-config.css +2 -0
- package/dist/collection/components/scheduler-editor/nylas-event-description/nylas-event-description.css +2 -0
- package/dist/collection/components/scheduler-editor/nylas-event-title/nylas-event-title.css +2 -0
- package/dist/collection/version.js +1 -1
- package/dist/collection/version.js.map +1 -1
- package/dist/components/checkbox-component.js +1 -1
- package/dist/components/checkbox-group.js +1 -1
- package/dist/components/input-color-picker.js +1 -1
- package/dist/components/input-component.js +1 -1
- package/dist/components/input-image-url.js +1 -1
- package/dist/components/nylas-additional-participants.js +1 -1
- package/dist/components/nylas-availability-picker.js +1 -1
- package/dist/components/nylas-booking-calendar-picker.js +1 -1
- package/dist/components/nylas-booking-confirmation-redirect.js +1 -1
- package/dist/components/nylas-booking-confirmation-type.js +1 -1
- package/dist/components/nylas-booking-form-config.js +1 -1
- package/dist/components/nylas-booking-form.js +1 -1
- package/dist/components/nylas-buffer-time.js +1 -1
- package/dist/components/nylas-cancel-booking-form.js +1 -1
- package/dist/components/nylas-confirmation-email.js +1 -1
- package/dist/components/nylas-custom-event-slug.js +1 -1
- package/dist/components/nylas-customize-booking-settings.js +1 -1
- package/dist/components/nylas-date-component.js +1 -1
- package/dist/components/nylas-disable-emails.js +1 -1
- package/dist/components/nylas-editor-tabs-group.js +1 -1
- package/dist/components/nylas-editor-tabs.js +1 -1
- package/dist/components/nylas-event-calendar.js +1 -1
- package/dist/components/nylas-event-capacity.js +1 -1
- package/dist/components/nylas-event-description.js +1 -1
- package/dist/components/nylas-event-duration.js +1 -1
- package/dist/components/nylas-event-location.js +1 -1
- package/dist/components/nylas-event-timeslot.js +1 -1
- package/dist/components/nylas-event-title.js +1 -1
- package/dist/components/nylas-feedback-form.js +1 -1
- package/dist/components/nylas-limit-future-bookings.js +1 -1
- package/dist/components/nylas-list-configurations.js +1 -1
- package/dist/components/nylas-locale-switch.js +1 -1
- package/dist/components/nylas-min-booking-notice.js +1 -1
- package/dist/components/nylas-min-cancellation-notice.js +1 -1
- package/dist/components/nylas-notetaker-config.js +1 -1
- package/dist/components/nylas-page-name.js +1 -1
- package/dist/components/nylas-page-styling.js +1 -1
- package/dist/components/nylas-participant-booking-calendars.js +1 -1
- package/dist/components/nylas-participants-custom-availability.js +1 -1
- package/dist/components/nylas-reminder-emails.js +1 -1
- package/dist/components/nylas-reminder-time.js +1 -1
- package/dist/components/nylas-scheduler-editor.js +46 -46
- package/dist/components/nylas-scheduling-method.js +1 -1
- package/dist/components/nylas-scheduling.js +11 -11
- package/dist/components/nylas-specific-time-availability-picker.js +1 -1
- package/dist/components/nylas-timeslot-interval.js +1 -1
- package/dist/components/{p-CdjkLYNh.js → p-1FY06fQD.js} +34 -34
- package/dist/components/{p-CdjkLYNh.js.map → p-1FY06fQD.js.map} +1 -1
- package/dist/components/{p-C1X9fzID.js → p-9PlaXlCB.js} +3 -3
- package/dist/components/{p-C1X9fzID.js.map → p-9PlaXlCB.js.map} +1 -1
- package/dist/components/{p-p2By8R7Z.js → p-B-xvNL5X.js} +3 -3
- package/dist/components/{p-p2By8R7Z.js.map → p-B-xvNL5X.js.map} +1 -1
- package/dist/components/{p-DZJAqRR0.js → p-B4C1SvsK.js} +3 -3
- package/dist/components/{p-DZJAqRR0.js.map → p-B4C1SvsK.js.map} +1 -1
- package/dist/components/{p-FyWR7wsG.js → p-B4WU6Ddk.js} +3 -3
- package/dist/components/{p-FyWR7wsG.js.map → p-B4WU6Ddk.js.map} +1 -1
- package/dist/components/{p-a4aWyy2J.js → p-BCNq-vH8.js} +4 -4
- package/dist/components/{p-a4aWyy2J.js.map → p-BCNq-vH8.js.map} +1 -1
- package/dist/components/{p-ClRazYdc.js → p-BGel3qwa.js} +4 -4
- package/dist/components/{p-ClRazYdc.js.map → p-BGel3qwa.js.map} +1 -1
- package/dist/components/{p-BMS02R_Z.js → p-BJ6nYqW1.js} +3 -3
- package/dist/components/{p-BMS02R_Z.js.map → p-BJ6nYqW1.js.map} +1 -1
- package/dist/components/{p-BA8j6G8I.js → p-BJHGQK2p.js} +3 -3
- package/dist/components/{p-BA8j6G8I.js.map → p-BJHGQK2p.js.map} +1 -1
- package/dist/components/{p-Di7xtAN8.js → p-BWgGjFXi.js} +3 -3
- package/dist/components/{p-Di7xtAN8.js.map → p-BWgGjFXi.js.map} +1 -1
- package/dist/components/{p-B4ta0tDN.js → p-BZ_muELE.js} +3 -3
- package/dist/components/{p-B4ta0tDN.js.map → p-BZ_muELE.js.map} +1 -1
- package/dist/components/{p-DDBe0PRD.js → p-B_ZbZ5lK.js} +3 -3
- package/dist/components/{p-DDBe0PRD.js.map → p-B_ZbZ5lK.js.map} +1 -1
- package/dist/components/{p-BBkyE1MS.js → p-BdQ9iWW4.js} +6 -6
- package/dist/components/{p-BBkyE1MS.js.map → p-BdQ9iWW4.js.map} +1 -1
- package/dist/components/{p-DDM3ZlW1.js → p-BdQA_uHk.js} +3 -3
- package/dist/components/{p-DDM3ZlW1.js.map → p-BdQA_uHk.js.map} +1 -1
- package/dist/components/{p-44_g1hcc.js → p-BeGM4wbq.js} +3 -3
- package/dist/components/{p-44_g1hcc.js.map → p-BeGM4wbq.js.map} +1 -1
- package/dist/components/{p-DM_4oTsI.js → p-BjynTcY9.js} +4 -4
- package/dist/components/{p-DM_4oTsI.js.map → p-BjynTcY9.js.map} +1 -1
- package/dist/components/{p-Bz1eTXD6.js → p-BsMclINV.js} +4 -4
- package/dist/components/{p-Bz1eTXD6.js.map → p-BsMclINV.js.map} +1 -1
- package/dist/components/{p-BdG2pZat.js → p-BvCTseDu.js} +5 -5
- package/dist/components/{p-BdG2pZat.js.map → p-BvCTseDu.js.map} +1 -1
- package/dist/components/{p-lLGrGYYy.js → p-C4s3qYGu.js} +3 -3
- package/dist/components/{p-lLGrGYYy.js.map → p-C4s3qYGu.js.map} +1 -1
- package/dist/components/{p-Dkp7GkzI.js → p-CEvUNENN.js} +3 -3
- package/dist/components/{p-Dkp7GkzI.js.map → p-CEvUNENN.js.map} +1 -1
- package/dist/components/{p-BJACsIxp.js → p-CHQ9sLls.js} +6 -6
- package/dist/components/{p-BJACsIxp.js.map → p-CHQ9sLls.js.map} +1 -1
- package/dist/components/{p-CXvH8gEB.js → p-CIm8sd7h.js} +4 -4
- package/dist/components/{p-CXvH8gEB.js.map → p-CIm8sd7h.js.map} +1 -1
- package/dist/components/{p-eMdkzfgI.js → p-CVnhRnUq.js} +6 -6
- package/dist/components/{p-eMdkzfgI.js.map → p-CVnhRnUq.js.map} +1 -1
- package/dist/components/{p-DzNdcHoB.js → p-CZllU8ii.js} +3 -3
- package/dist/components/{p-DzNdcHoB.js.map → p-CZllU8ii.js.map} +1 -1
- package/dist/components/{p-FGJR3D9_.js → p-Ci9dxGLY.js} +5 -5
- package/dist/components/{p-FGJR3D9_.js.map → p-Ci9dxGLY.js.map} +1 -1
- package/dist/components/{p-CfqEi00L.js → p-D13lTN27.js} +4 -4
- package/dist/components/{p-CfqEi00L.js.map → p-D13lTN27.js.map} +1 -1
- package/dist/components/{p-DsJUpcxE.js → p-DAr02cfd.js} +3 -3
- package/dist/components/{p-DsJUpcxE.js.map → p-DAr02cfd.js.map} +1 -1
- package/dist/components/{p-D0JQ_-Qx.js → p-DDceIF1-.js} +3 -3
- package/dist/components/{p-D0JQ_-Qx.js.map → p-DDceIF1-.js.map} +1 -1
- package/dist/components/{p-CowteGon.js → p-DICXD6Cy.js} +3 -3
- package/dist/components/{p-CowteGon.js.map → p-DICXD6Cy.js.map} +1 -1
- package/dist/components/{p-Dy7hoKyo.js → p-DMltEU-a.js} +4 -4
- package/dist/components/{p-Dy7hoKyo.js.map → p-DMltEU-a.js.map} +1 -1
- package/dist/components/{p-OADv0FUZ.js → p-DNm8Z4AY.js} +3 -3
- package/dist/components/{p-OADv0FUZ.js.map → p-DNm8Z4AY.js.map} +1 -1
- package/dist/components/{p-Dd9ZfJbD.js → p-DTF0fIhr.js} +3 -3
- package/dist/components/p-DTF0fIhr.js.map +1 -0
- package/dist/components/{p-6i8K_2Bl.js → p-DVTv2Hp1.js} +3 -3
- package/dist/components/{p-6i8K_2Bl.js.map → p-DVTv2Hp1.js.map} +1 -1
- package/dist/components/{p-DdroMDi7.js → p-DWCPI1lK.js} +3 -3
- package/dist/components/{p-DdroMDi7.js.map → p-DWCPI1lK.js.map} +1 -1
- package/dist/components/{p-P01mLKOx.js → p-Dary9zXr.js} +3 -3
- package/dist/components/{p-P01mLKOx.js.map → p-Dary9zXr.js.map} +1 -1
- package/dist/components/{p-BmXUSpFE.js → p-DgfDGATC.js} +3 -3
- package/dist/components/{p-BmXUSpFE.js.map → p-DgfDGATC.js.map} +1 -1
- package/dist/components/{p-pgYRW1Gn.js → p-Ey-jPikW.js} +3 -3
- package/dist/components/{p-pgYRW1Gn.js.map → p-Ey-jPikW.js.map} +1 -1
- package/dist/components/{p-BYAaHapV.js → p-FFI2InLT.js} +3 -3
- package/dist/components/{p-BYAaHapV.js.map → p-FFI2InLT.js.map} +1 -1
- package/dist/components/{p-C9c9Tc-Q.js → p-FrLX9pVa.js} +6 -6
- package/dist/components/{p-C9c9Tc-Q.js.map → p-FrLX9pVa.js.map} +1 -1
- package/dist/components/{p-EBvHC_aS.js → p-Gyins0o7.js} +9 -9
- package/dist/components/{p-EBvHC_aS.js.map → p-Gyins0o7.js.map} +1 -1
- package/dist/components/{p-Et75ok2y.js → p-MMkYQKuh.js} +3 -3
- package/dist/components/{p-Et75ok2y.js.map → p-MMkYQKuh.js.map} +1 -1
- package/dist/components/{p-ybLp3dGv.js → p-QKc1T_NS.js} +3 -3
- package/dist/components/{p-ybLp3dGv.js.map → p-QKc1T_NS.js.map} +1 -1
- package/dist/components/{p-D2DM2um3.js → p-UahFYa1w.js} +3 -3
- package/dist/components/{p-D2DM2um3.js.map → p-UahFYa1w.js.map} +1 -1
- package/dist/components/{p-Cqcd_0tY.js → p-cylqcpvp.js} +41 -41
- package/dist/components/{p-Cqcd_0tY.js.map → p-cylqcpvp.js.map} +1 -1
- package/dist/components/{p-kRlkh0g-.js → p-idvnK5Rl.js} +3 -3
- package/dist/components/{p-kRlkh0g-.js.map → p-idvnK5Rl.js.map} +1 -1
- package/dist/components/{p-Bho2Hb_A.js → p-keUQQIah.js} +4 -4
- package/dist/components/{p-Bho2Hb_A.js.map → p-keUQQIah.js.map} +1 -1
- package/dist/components/{p-DAAGx7-h.js → p-pLqfEMSB.js} +3 -3
- package/dist/components/{p-DAAGx7-h.js.map → p-pLqfEMSB.js.map} +1 -1
- package/dist/components/{p-BAZ-jMiz.js → p-pRwtuoW0.js} +4 -4
- package/dist/components/{p-BAZ-jMiz.js.map → p-pRwtuoW0.js.map} +1 -1
- package/dist/components/{p-CJ3feL4K.js → p-whoa2mmo.js} +14 -14
- package/dist/components/{p-CJ3feL4K.js.map → p-whoa2mmo.js.map} +1 -1
- package/dist/components/radio-button-group.js +1 -1
- package/dist/components/select-dropdown.js +1 -1
- package/dist/components/textarea-component.js +1 -1
- package/dist/components/time-period-selector.js +1 -1
- package/dist/esm/calendar-agenda-fill-icon_39.entry.js +1 -1
- package/dist/esm/calendar-agenda-fill-icon_39.entry.js.map +1 -1
- package/dist/esm/checkbox-component.entry.js +1 -1
- package/dist/esm/checkbox-component.entry.js.map +1 -1
- package/dist/esm/checkmark-icon_15.entry.js +3 -3
- package/dist/esm/checkmark-icon_15.entry.js.map +1 -1
- package/dist/esm/chevron-icon.search-icon.select-dropdown.entry.js.map +1 -1
- package/dist/esm/chevron-icon_3.entry.js +1 -1
- package/dist/esm/chevron-icon_3.entry.js.map +1 -1
- package/dist/esm/globe-icon.nylas-date-component.nylas-time-window-picker.entry.js.map +1 -1
- package/dist/esm/globe-icon_3.entry.js +1 -1
- package/dist/esm/globe-icon_3.entry.js.map +1 -1
- package/dist/esm/google-logo-icon_6.entry.js +1 -1
- package/dist/esm/input-component.entry.js +1 -1
- package/dist/esm/input-component.entry.js.map +1 -1
- package/dist/esm/nylas-booked-event-card_11.entry.js +1 -1
- package/dist/esm/nylas-booked-event-card_11.entry.js.map +1 -1
- package/dist/esm/nylas-scheduler-editor.entry.js +1 -1
- package/dist/esm/nylas-scheduling.entry.js +1 -1
- package/dist/esm/radio-button-group.entry.js +1 -1
- package/dist/esm/radio-button-group.entry.js.map +1 -1
- package/dist/esm/textarea-component.entry.js +1 -1
- package/dist/esm/textarea-component.entry.js.map +1 -1
- package/dist/esm/{version-BxqBxG4o.js → version-DM0y_1NQ.js} +3 -3
- package/dist/esm/{version-BxqBxG4o.js.map → version-DM0y_1NQ.js.map} +1 -1
- package/dist/nylas-web-elements/checkbox-component.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/chevron-icon.search-icon.select-dropdown.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/globe-icon.nylas-date-component.nylas-time-window-picker.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/input-component.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/p-23df6f78.entry.js +8 -0
- package/dist/nylas-web-elements/p-23df6f78.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-34c4bf5b.entry.js +2 -0
- package/dist/nylas-web-elements/{p-2bff143d.entry.js.map → p-34c4bf5b.entry.js.map} +1 -1
- package/dist/nylas-web-elements/p-52a66db6.entry.js +2 -0
- package/dist/nylas-web-elements/{p-1ba901b1.entry.js.map → p-52a66db6.entry.js.map} +1 -1
- package/dist/nylas-web-elements/p-5b01e519.entry.js +2 -0
- package/dist/nylas-web-elements/p-5b01e519.entry.js.map +1 -0
- package/dist/nylas-web-elements/p-9a5b1cfb.entry.js +2 -0
- package/dist/nylas-web-elements/{p-ab80b127.entry.js.map → p-9a5b1cfb.entry.js.map} +1 -1
- package/dist/nylas-web-elements/p-9c264d62.entry.js +2 -0
- package/dist/nylas-web-elements/{p-7655eeb0.entry.js.map → p-9c264d62.entry.js.map} +1 -1
- package/dist/nylas-web-elements/p-DM0y_1NQ.js +2 -0
- package/dist/nylas-web-elements/{p-BxqBxG4o.js.map → p-DM0y_1NQ.js.map} +1 -1
- package/dist/nylas-web-elements/p-b0306d35.entry.js +2 -0
- package/dist/nylas-web-elements/{p-70762abf.entry.js.map → p-b0306d35.entry.js.map} +1 -1
- package/dist/nylas-web-elements/{p-9c78baa7.entry.js → p-b2c497eb.entry.js} +2 -2
- package/dist/nylas-web-elements/p-b2c497eb.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-70614faf.entry.js → p-b90acc64.entry.js} +2 -2
- package/dist/nylas-web-elements/p-c91eb1ba.entry.js +2 -0
- package/dist/nylas-web-elements/{p-e042747e.entry.js.map → p-c91eb1ba.entry.js.map} +1 -1
- package/dist/nylas-web-elements/{p-2d23ef5e.entry.js → p-daf5083c.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-428a7363.entry.js → p-dbad0a98.entry.js} +2 -2
- package/dist/nylas-web-elements/radio-button-group.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/textarea-component.entry.esm.js.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/p-Dd9ZfJbD.js.map +0 -1
- package/dist/nylas-web-elements/p-1ba901b1.entry.js +0 -2
- package/dist/nylas-web-elements/p-2bff143d.entry.js +0 -2
- package/dist/nylas-web-elements/p-70762abf.entry.js +0 -2
- package/dist/nylas-web-elements/p-7655eeb0.entry.js +0 -2
- package/dist/nylas-web-elements/p-88112606.entry.js +0 -8
- package/dist/nylas-web-elements/p-88112606.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-9c78baa7.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-BxqBxG4o.js +0 -2
- package/dist/nylas-web-elements/p-ab80b127.entry.js +0 -2
- package/dist/nylas-web-elements/p-e042747e.entry.js +0 -2
- package/dist/nylas-web-elements/p-e82826b8.entry.js +0 -2
- package/dist/nylas-web-elements/p-e82826b8.entry.js.map +0 -1
- /package/dist/nylas-web-elements/{p-70614faf.entry.js.map → p-b90acc64.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-2d23ef5e.entry.js.map → p-daf5083c.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-428a7363.entry.js.map → p-dbad0a98.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as e,F as t,r as n,c as i,H as s,a as o}from"./p-0EQQA0nE.js";import{N as a}from"./p-BS9pAWHt.js";import{i as r,c as l,a as c,f as d,h}from"./p-D7AODx4L.js";import{E as g,i as f,a as u,f as p,c as m,b}from"./p-CquJ7U5v.js";import{v as _,u as y}from"./p-BxqBxG4o.js";import{c as w}from"./p-_i6H-yQH.js";import{L as v,a as k}from"./p-COJy29df.js";class I{constructor(){this.component=e=>{const t=g.Component;const n=`${e} Error`;return{endtime_not_in_future:(e='"endtime" can not be in the future')=>({title:n,message:e,category:t}),no_booking_info:(e="No booking info provided")=>({title:n,message:e,category:t}),no_timeslot_selected:(e="No timeslot selected")=>({title:n,message:e,category:t}),no_timezone_selected:(e="No timezone selected")=>({title:n,message:e,category:t}),no_booking_id:(e="No booking id provided")=>({title:n,message:e,category:t}),no_salt:(e="No salt provided")=>({title:n,message:e,category:t}),invalid_start_time:(e="Invalid start time")=>({title:n,message:e,category:t}),invalid_end_time:(e="Invalid end time")=>({title:n,message:e,category:t}),invalid_timezone:(e="Invalid timezone")=>({title:n,message:e,category:t}),no_config_id:(e="No configuration id provided")=>({title:n,message:e,category:t})}};this.api=e=>{const t=g.Api;const n=`${e} Error`;return{invalid_session:e=>({title:n,message:e,category:t}),general_error:e=>({title:n,message:e,category:t}),internal_error:e=>({title:n,message:e,category:t}),invalid_request_error:e=>({title:n,message:e,category:t}),timeslot_not_available:e=>({title:n,message:e,category:t}),provider_error:e=>({title:n,message:e,category:t}),not_found_error:e=>({title:n,message:e,category:t})}}}}class x{constructor({schedulerAPIURL:e,schedulerStore:t,sessionId:n,configId:i,slug:s,clientId:o}){this.errors=new I;this.schedulerStore=t;this.schedulerAPIURL=e;this.sessionId=n;this.configId=i;this.slug=s;this.clientId=o}getHeaders(){return this.sessionId?{Authorization:`Bearer ${this.sessionId}`}:{}}async makeAPIRequest(e,t,n,i={}){try{const s=new URL(this.schedulerAPIURL);s.pathname=e;const o=await fetch(decodeURIComponent(s.toString()),{method:t,headers:{"Content-Type":"application/json",Origin:window.location.origin,"X-Source":"nylas-scheduling","X-Nylas-Web-Elements-Version":_,...this.clientId&&{"X-Nylas-Application-Public-Id":this.clientId},...i},body:n});const a=await o.json();return a}catch(e){return{error:{message:e.message,title:"API request failed",type:"api"}}}}getErrorMessage(e){let t=e?.message||e?.title||"Something went wrong";if(e?.type==="provider_error"){t=e?.provider_error?.error?.message||e?.provider_error?.error?.title||"Something went wrong"}return t}setConfigId(e){this.configId=e}selectDate(e){this.schedulerStore.set("selectedDate",e);this.schedulerStore.set("selectedTimeslot",null)}selectTime(e){this.schedulerStore.set("selectedTimeslot",e)}selectTimezone(e){this.schedulerStore.set("selectedTimezone",e)}selectLanguage(e){this.schedulerStore.set("selectedLanguage",e);r.changeLanguage(e)}async toggleAdditionalData(e){if(!e){await this.refetchAvailability()}this.schedulerStore.set("showBookingForm",e)}setParticipantName(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t?.primaryParticipant,name:e}})}setParticipantEmail(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t?.primaryParticipant,email:e}})}async refetchAvailability(){const e=new Date;const t=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3;const n=t<e.getTime()/1e3?Math.floor(e.getTime()/1e3):t;const i=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3;const s=await this.getAvailability(n,i);return s}async resetStoreStateAndFetchAvailability(){const e=new Date;const t=await this.refetchAvailability();const n=this.schedulerStore.get("availability").find((e=>new Date(e.start_time)>new Date));let i=e;if(n){i=n.start_time}this.schedulerStore.set("selectedDate",i);this.schedulerStore.set("eventInfo",null);this.schedulerStore.set("showBookingForm",false);this.schedulerStore.set("selectedTimeslot",null);return t}async setReschedule(e){this.schedulerStore.set("isLoading",true);const t=this.schedulerStore.state.eventInfo;if(t){this.schedulerStore.set("reschedulingEventInfo",t)}this.schedulerStore.set("rescheduleBookingId",e);await this.getUISettings();const n=await this.resetStoreStateAndFetchAvailability().finally((()=>{this.schedulerStore.set("isLoading",false)}));return n}async setCancel(e){this.schedulerStore.set("cancelBookingId",e)}async setReject(e){this.schedulerStore.set("rejectBookingId",e)}async resetCancel(){const e=await this.resetStoreStateAndFetchAvailability();this.schedulerStore.set("cancelBookingId","");this.schedulerStore.set("rejectBookingId","");this.schedulerStore.set("cancelledEventInfo",null);return e}async goBack(){this.schedulerStore.set("cancelBookingId","");return}async resetConfirm(){const e=await this.resetStoreStateAndFetchAvailability();this.schedulerStore.set("organizerConfirmationBookingId","");this.schedulerStore.set("confirmedEventInfo",undefined);return e}async bookTimeslot(e){this.schedulerStore.set("isLoading",true);const{selectedTimeslot:t,selectedTimezone:n,bookingInfo:i,selectedLanguage:s}=this.schedulerStore.state;if(!e&&!i){return{error:this.errors.component(r.t("createBookingErrorTitle")).no_booking_info()}}const o=e?.timeslot||t;if(!o){return{error:this.errors.component(r.t("createBookingErrorTitle")).no_timeslot_selected()}}const a=e&&e?.timezone?e?.timezone:n;const l=s||"en-US";if(!a){return{error:this.errors.component(r.t("createBookingErrorTitle")).no_timezone_selected()}}const c=[...this.schedulerStore.get("availabilityOrderEmails")];let d="";const h=o?.emails||[];const g={};Object.entries(i?.additionalFields||{}).forEach((([e,t])=>{g[e]=t.value}));const f=e?e?.primaryParticipant:i?.primaryParticipant;const u=e?e?.guests||[]:i?.guests||[];const p=e?e?.additionalFields:g;const m=this.getHeaders();const b=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const _=`/v3/scheduling/bookings${b}`;if(c.length===0){const e=await this.makeAPIRequest(decodeURIComponent(_),"POST",JSON.stringify({additional_fields:p,additional_guests:u,guest:{...f},start_time:o.start_time.getTime()/1e3,end_time:o.end_time.getTime()/1e3,timezone:a,event_id:o?.event_id||undefined,master_id:o?.master_id||undefined,calendar_id:o?.calendar_id||undefined,email_language:this.getTwoLetterLanguageCode(l)}),m);this.schedulerStore.set("isLoading",false);if("data"in e){this.schedulerStore.set("eventInfo",e.data);return e}return{error:e.error}}while(c.length>0){d=c.shift();if(!h.includes(d)){continue}const e=await this.makeAPIRequest(decodeURIComponent(_),"POST",JSON.stringify({participants:d?[{email:d}]:undefined,additional_fields:p,additional_guests:u,guest:{...f},start_time:o.start_time.getTime()/1e3,end_time:o.end_time.getTime()/1e3,timezone:a,email_language:this.getTwoLetterLanguageCode(l)}),m);if("data"in e){this.schedulerStore.set("isLoading",false);this.schedulerStore.set("eventInfo",e?.data);return e}else if(e.error?.message?.startsWith("The selected timeslot is unavailable")){continue}else{this.schedulerStore.set("isLoading",false);const t=e.error?.type;let n=e.error;if(t&&t in this.errors.api(r.t("createBookingErrorTitle"))){const e=this.getErrorMessage(n);n=this.errors.api(r.t("createBookingErrorTitle"))[t](e)}return{error:n}}}this.schedulerStore.set("isLoading",false);return{error:this.errors.api(r.t("createBookingErrorTitle")).timeslot_not_available("The selected timeslot is unavailable")}}async getUISettings(){this.schedulerStore.set("isLoading",true);const e=this.schedulerStore.get("rescheduleBookingId");const t=this.getHeaders();let n=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";if(e&&!!n){n+=`&booking_id=${e}`}else if(e){n+=`?booking_id=${e}`}const i=`/v3/scheduling/ui-settings${n}`;const s=await this.makeAPIRequest(i,"GET",undefined,t);if("error"in s){this.schedulerStore.set("isLoading",false);const e=s.error?.type;let t=s.error;if(e&&e in this.errors.api(r.t("getUISettingErrorTitle"))){t=this.errors.api(r.t("getUISettingErrorTitle"))[e](t?.message||t?.title||"Something went wrong")}return{error:t}}if("data"in s){this.schedulerStore.set("configSettings",s.data);this.clientId=s.data.app_client_id||this.clientId}this.schedulerStore.set("isLoading",false);return s}getTwoLetterLanguageCode(e){return e.split("-")[0]}getStartTimeWithMinBookingNotice(e){const t=this.schedulerStore.get("configSettings")?.scheduler;const n=t?.min_booking_notice;if(!n){return e}const i=(new Date).getTime();if(e<(i+n*60*1e3)/1e3){return Math.floor((i+n*60*1e3)/1e3)}else{return e}}getEndTimeForAvailableDaysInFuture(e){const t=new Date;const n=this.schedulerStore.get("configSettings")?.scheduler?.available_days_in_future;const i=Math.floor(l(t,n).getTime()/1e3);const s=Math.min(i,e);return s}async getAvailability(e=0,t=0){this.schedulerStore.set("isLoading",true);const n=new URLSearchParams;const i=new Date;const s=i.getTime();if(t&&t<s/1e3){this.schedulerStore.set("isLoading",false);const e=this.errors.component(r.t("getAvailabilityErrorTitle")).endtime_not_in_future();return{error:e}}if(!e){const t=new Date(i.getFullYear(),i.getMonth(),1);e=Math.floor(t.getTime()/1e3)}if(!t){const e=new Date(i.getFullYear(),i.getMonth()+1,0);t=Math.floor(e.getTime()/1e3)}t=this.getEndTimeForAvailableDaysInFuture(t);const o=this.getStartTimeWithMinBookingNotice(e);e=o;t=o>t?o+1:t;n.append("start_time",encodeURIComponent(e.toString()));n.append("end_time",encodeURIComponent(t.toString()));if(this.configId&&!this.sessionId){n.append("configuration_id",encodeURIComponent(this.configId))}else if(this.slug&&this.clientId&&!this.sessionId){n.append("slug",encodeURIComponent(this.slug));n.append("client_id",encodeURIComponent(this.clientId))}const a=this.schedulerStore.get("rescheduleBookingId");if(a){n.append("booking_id",encodeURIComponent(a))}const l=n.toString();const c=`/v3/scheduling/availability${l?`?${l}`:""}`;const d=this.getHeaders();const h=await this.makeAPIRequest(decodeURIComponent(c),"GET",undefined,d);if("error"in h){this.schedulerStore.set("availability",[]);this.schedulerStore.set("isLoading",false);const e=h.error?.type;let t=h.error;if(t?.message?.toLowerCase().includes("Failed to find a valid Grant")){const e=r.t("invalidGrantError");return{error:{title:r.t("invalidGrantErrorTitle"),message:e,category:g.Api}}}if(e&&e in this.errors.api(r.t("getAvailabilityErrorTitle"))){const n=this.getErrorMessage(t);t=this.errors.api(r.t("getAvailabilityErrorTitle"))[e](n)}return{error:t}}if("data"in h){const e=h.data?.time_slots?.map((e=>({...e,start_time:new Date(e.start_time*1e3),end_time:new Date(e.end_time*1e3)})))||[];const t=e.filter((e=>e.start_time.getTime()>s));const n=t.sort(((e,t)=>e.start_time.getTime()-t.start_time.getTime()));this.schedulerStore.set("availability",n);const i=h.data?.order||[];this.schedulerStore.set("availabilityOrderEmails",i)}this.schedulerStore.set("isLoading",false);return h}async cancelBooking(e,t){this.schedulerStore.set("isLoading",true);if(!e){return{error:this.errors.component(r.t("cancelBookingErrorTitle")).no_booking_id()}}const n=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const i=`/v3/scheduling/bookings/${e}${n}`;const s=this.getHeaders();const o=await this.makeAPIRequest(decodeURIComponent(i),"DELETE",JSON.stringify({action:"cancel",cancellation_reason:t}),s);if("error"in o){this.schedulerStore.set("isLoading",false);const e=o.error?.type;let t=o.error;if(e&&e in this.errors.api(r.t("cancelBookingErrorTitle"))){const n=this.getErrorMessage(t);t=this.errors.api(r.t("cancelBookingErrorTitle"))[e](n)}return{error:t}}this.schedulerStore.set("cancelledEventInfo",{booking_id:e});this.schedulerStore.set("rescheduleBookingId","");this.schedulerStore.set("isLoading",false);return o}async rescheduleBooking(e,t){this.schedulerStore.set("isLoading",true);if(!e){return{error:this.errors.component(r.t("rescheduleBookingErrorTitle")).no_booking_id()}}const n=this.errors.api(r.t("rescheduleBookingErrorTitle"));const i=this.errors.component(r.t("rescheduleBookingErrorTitle"));const{bookingInfo:s,selectedTimeslot:o,selectedTimezone:a,selectedLanguage:l}=this.schedulerStore.state;const{startTime:c,endTime:d,timezone:h}=t;const g=c||o?.start_time;if(!g){return{error:i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')}}const f=d||o?.end_time;if(!f){return{error:i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')}}const u=this.schedulerStore.get("availabilityOrderEmails");let p="";if(u.length>0){const e=o?.emails||[];for(let t=0;t<u.length;t++){if(e.includes(u[t])){p=u[t];break}}}const m=h||a;if(!m){return{error:i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')}}const b=o?.event_id||undefined;const _=o?.master_id||undefined;const y=o?.calendar_id||undefined;const w={};Object.entries(s?.additionalFields||{}).forEach((([e,t])=>{w[e]=t.value}));const v=t?t?.primaryParticipant:s?.primaryParticipant;const k=t?t?.guests||[]:s?.guests||[];const I=t?t?.additionalFields:w;const x=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const T=`/v3/scheduling/bookings/${e}${x}`;const C=this.getHeaders();const E=await this.makeAPIRequest(decodeURIComponent(T),"PATCH",JSON.stringify({start_time:g.getTime()/1e3,end_time:f.getTime()/1e3,timezone:m,additional_fields:I,guest:{...v},additional_guests:k,participants:p?[{email:p}]:undefined,email_language:this.getTwoLetterLanguageCode(l),event_id:b,master_id:_,calendar_id:y}),C);if("error"in E){this.schedulerStore.set("isLoading",false);const e=E.error?.type;let t=E.error;if(e&&e in n){const i=this.getErrorMessage(t);t=n[e](i)}return{error:t}}const S=this.schedulerStore.get("reschedulingEventInfo");if("data"in E){this.schedulerStore.set("eventInfo",E?.data)}else if(S){this.schedulerStore.set("eventInfo",S)}else{const t={booking_id:e};this.schedulerStore.set("eventInfo",t)}this.schedulerStore.set("isLoading",false);return E}async updateBooking(e){this.schedulerStore.set("isLoading",true);const{bookingId:t,status:n,reason:i}=e;const s=this.schedulerStore.get("organizerConfirmationSalt");const o=n==="confirmed"?r.t("confirmBookingErrorTitle"):r.t("rejectBookingErrorTitle");if(!t){return{error:this.errors.component(o).no_booking_id()}}if(!s){return{error:this.errors.component(o).no_salt()}}const a=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const l=`/v3/scheduling/bookings/${t}${a}`;const c=this.getHeaders();const d=await this.makeAPIRequest(decodeURIComponent(l),"PUT",JSON.stringify({status:n,cancellation_reason:i,salt:s}),c);if("error"in d){this.schedulerStore.set("isLoading",false);const e=d.error?.type;let t=d.error;if(e&&e in this.errors.api(o)){const n=this.getErrorMessage(t);t=this.errors.api(o)[e](n)}return{error:t}}if("data"in d&&n==="confirmed"){this.schedulerStore.set("confirmedEventInfo",d?.data)}else if("request_id"in d&&n==="cancelled"){this.schedulerStore.set("cancelledEventInfo",{booking_id:t})}this.schedulerStore.set("organizerConfirmationBookingId","");this.schedulerStore.set("isLoading",false);return d}async validateGroupEventTimeslot(e){this.schedulerStore.set("isLoading",true);const t=this.schedulerStore.get("configSettings")?.configuration_id;if(!t){return{error:this.errors.component(r.t("validateTimeslotErrorTitle")).no_config_id()}}const n=this.getHeaders();const i=`/v3/scheduling/configurations/${t}/group-events/validate-timeslot`;const s=await this.makeAPIRequest(decodeURIComponent(i),"POST",JSON.stringify({...e,start_time:e.start_time.getTime()/1e3,end_time:e.end_time.getTime()/1e3}),n);if("error"in s){this.schedulerStore.set("isLoading",false);const e=s.error?.type;let t=s.error;if(e&&e in this.errors.api(r.t("validateTimeslotErrorTitle"))){const n=this.getErrorMessage(t);t=this.errors.api(r.t("validateTimeslotErrorTitle"))[e](n)}this.refetchAvailability();return{error:t}}this.schedulerStore.set("selectedTimeslot",e);this.schedulerStore.set("showBookingForm",true);this.schedulerStore.set("isLoading",false);return s}}class T{constructor({schedulerAPIURL:e,nylasSchedulerStore:t,sessionId:n,configId:i,slug:s,clientId:o}){if(!e){throw new Error("schedulerAPIURL is required")}if(!t){throw new Error("nylasSchedulerStore is required")}if(!n&&!i&&!(s||o)){throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.")}if(e==="/"){const t=new URL(window.location.href);e=t.origin}this.configId=i;this.sessionId=n;this.schedulerAPIURL=e;this.nylasSchedulerStore=t;this.slug=s;this.clientId=o}init(){c("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){if(this._schedulerAPIConnector){return this._schedulerAPIConnector}this._schedulerAPIConnector=new x({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId,slug:this.slug,clientId:this.clientId});return this._schedulerAPIConnector}resetStores(){this.nylasSchedulerStore.reset()}}function C(e={}){const t={selectedDate:null,selectedLanguage:navigator.language,selectedTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,selectedTimeslot:null,showBookingForm:false,availabilityOrderEmails:[],selectableDates:null,availability:[],eventDuration:0,state:"ready",eventInfo:null,cancelledEventInfo:null,isLoading:false,nylasBranding:true,...e};c(`[defaultNylasStoreState]: `,t);const n=w(t);n.onChange("availability",(e=>{c(`[availability]: `,e);const t=e.map((e=>e.start_time));c(`[selectableDates]: `,t);n.set("selectableDates",t);const i=e[0];if(!i)return;const s=Math.floor((i.end_time.getTime()-i.start_time.getTime())/6e4);c(`[durationMinutes]: `,s);n.set("eventDuration",s)}));n.reset=()=>{for(const e in t){const i=t[e];n.set(e,i)}};return n}const E=(n,i)=>{const s=n.isLoading;const o=n.showNotification;const a=n.nylasBranding;const r=n.version;return e(t,null,o&&e("nylas-notification",null),s&&e("div",{class:"loading"},e("div",{class:"left"},e("div",{class:"skeleton"})),e("div",{class:"right"},e("div",{class:"skeleton"}),e("div",{class:"skeleton"}),e("div",{class:"skeleton"}),e("div",{class:"skeleton"}),e("div",{class:"skeleton"}))),!s&&i,e("div",{class:"footer"},a&&e("a",{href:"https://scheduler.nylas.com?utm_source=powered-by-nylas-logoutm_medium=link&utm_campaign=get-scheduler&utm_id=get-scheduler",class:"powered-by-nylas",target:"_blank",rel:"noreferrer noopener"},"Powered by ",e("span",{class:"sr-only"},"Nylas"),e("nylas-logo",{"aria-hidden":true})),e("tooltip-component",null,e("info-icon",{slot:"tooltip-icon"}),e("span",{slot:"tooltip-content"},r))))};const S=(t,n)=>e("div",{class:"message-banner"},n);const B=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto;border-left:none}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer .powered-by-nylas{display:flex;align-items:center;text-decoration:none;color:var(--nylas-base-500)}.footer .powered-by-nylas:hover{color:var(--nylas-base-800)}.footer svg{fill:var(--nylas-base-500)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}button-component#report-issue{width:auto;position:absolute;bottom:4px;left:16px}.language-feedback-container{width:auto;position:absolute;bottom:4px;left:16px;display:flex;gap:8px;align-items:center}.language-feedback-container button-component#report-issue{position:initial}nylas-feedback-form{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}';const L={title:r.t("genericErrorTitle"),category:g.Component};const D=class{constructor(e){n(this,e);this.init=i(this,"init",7);this.schedulerWillLoad=i(this,"schedulerWillLoad",7);this.schedulerDidLoad=i(this,"schedulerDidLoad",7);this.nylasSchedulerError=i(this,"nylasSchedulerError",7);this.nylasSchedulerInfo=i(this,"nylasSchedulerInfo",7);this.configSettingsLoaded=i(this,"configSettingsLoaded",7);this.bookingRefExtracted=i(this,"bookingRefExtracted",7);this.bookedEventInfo=i(this,"bookedEventInfo",7);this.mode="app";this.schedulerApiUrl="https://api.us.nylas.com";this.nylasBranding=true;this.eventOverrides={};this.showNotification=true;this.enableUserFeedback=true;this.automaticComponentRegistration=true;this.selectedDateLabel=(new Date).toLocaleDateString(navigator.language,{dateStyle:"full"})||`${r.t("noDateSelected")}`;this.language=navigator.language;this.showFeedbackModal=false;this.bookingInfoConfirmed=null;this.version=_}connectedCallback(){c(`[nylas-scheduler] connectedCallback`)}async componentWillLoad(){c(`[nylas-scheduler] Component will load`);this.version=_;if(this.enableUserFeedback&&!f()){u({dsn:"https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",release:this.version,integrations:e=>[...e.filter((e=>false)),p({colorScheme:"system",autoInject:false})],autoSessionTracking:false,beforeSend:()=>null})}const e=this.schedulerWillLoad.emit(this.host);if("schedulerWillLoad"in this.eventOverrides){await this.eventOverrides.schedulerWillLoad(e,this.nylasSchedulerConnector);if(e.defaultPrevented){return}}const t=new URLSearchParams(window.location.search);const n=t.get("lang");const i=n&&Object.values(v).includes(n)?n:null;this.stores={scheduler:C({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,themeConfig:this.themeConfig,hour12:this.hour12,selectedLanguage:i||this.defaultLanguage||this.bookingInfo?.language||v.en,...this.defaultSchedulerState})};this.baseProvider=new a(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);this.refConfigId=this.configurationId;let s;if(this.rescheduleBookingRef){const[e,t,n]=d(this.rescheduleBookingRef);this.refConfigId=e;this.stores.scheduler.set("rescheduleBookingId",t);s=this.bookingRefExtracted.emit({configurationId:e,bookingId:t})}else if(this.cancelBookingRef){const[e,t,n]=d(this.cancelBookingRef);this.refConfigId=e;this.stores.scheduler.set("cancelBookingId",t);s=this.bookingRefExtracted.emit({configurationId:e,bookingId:t})}else if(this.organizerConfirmationBookingRef){const[e,t,n]=d(this.organizerConfirmationBookingRef);this.refConfigId=e;this.stores.scheduler.set("organizerConfirmationBookingId",t);this.stores.scheduler.set("organizerConfirmationSalt",n);s=this.bookingRefExtracted.emit({configurationId:e,bookingId:t,salt:n})}this.applyThemeConfig(this.themeConfig);if("bookingRefExtracted"in this.eventOverrides){await this.eventOverrides.bookingRefExtracted(s,this.nylasSchedulerConnector);if(s.defaultPrevented){return}}if(!this.checkIfSessionIdOrConfigIdExists()){return}const o=this.baseProvider?.getStore("scheduler");this.nylasSchedulerConnector=new T({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,slug:this.slug,clientId:this.clientId,nylasSchedulerStore:o});const r=this.init.emit(this.host);if("init"in this.eventOverrides){await this.eventOverrides.init(r,this.nylasSchedulerConnector);if(r.defaultPrevented){return}}this.baseProvider?.componentWillLoad(this.nylasSchedulerConnector)}async componentDidLoad(){this.baseProvider?.componentDidLoad();await Promise.resolve();const e=this.schedulerDidLoad.emit(this.host);if("schedulerDidLoad"in this.eventOverrides){await this.eventOverrides.schedulerDidLoad(e,this.nylasSchedulerConnector);if(e.defaultPrevented){return}}if(!this.checkIfSessionIdOrConfigIdExists()){return}this.localizationChanged(this.localization);const t=await(this.nylasSchedulerConnector?.scheduler.getUISettings());if(!t||"error"in t){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(t?.error)},host:this.host});return}else{if("data"in t&&t.data?.appearance){c("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.")}const e=this.configSettingsLoaded.emit({settings:t});if("configSettingsLoaded"in this.eventOverrides){await this.eventOverrides.configSettingsLoaded(e,this.nylasSchedulerConnector);if(e.defaultPrevented){return}}}const n=this.baseProvider?.getStore("scheduler");const i=n?.get("configSettings")?.scheduler?.available_days_in_future;const s=n?.get("selectedTimeslot");if(s&&s?.start_time){if(!this.isTimeslotValid(s)){return}if(n?.get("showBookingForm")){n?.set("selectedDate",s.start_time);return}}const o=n?.get("selectedDate");const a=n?.get("availability");let r;if(a&&a.length>0){return}if(!o){const e=new Date;const{startTime:t,endTime:n,endTimeForAvailableDaysInFuture:s}=this.validateAvailableDaysInFuture(e,i||30);if(e.getTime()<s*1e3){r=await(this.nylasSchedulerConnector?.scheduler.getAvailability(t,n))}}else{const{startTime:e,endTime:t,endTimeForAvailableDaysInFuture:n}=this.validateAvailableDaysInFuture(o,i||30);if(o.getTime()<n*1e3){r=await(this.nylasSchedulerConnector?.scheduler.getAvailability(e,t))}}if(!r||"error"in r){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(r?.error)},host:this.host})}if(!o){let e=new Date;const t=n?.get("availability").find((e=>new Date(e.start_time)>new Date));if(t){e=t.start_time}n?.set("selectedDate",e)}}componentDisconnected(){this.baseProvider?.componentDisconnected()}bookingInfoChanged(e){this.stores?.scheduler.set("bookingInfo",e);if(e?.language&&!this.defaultLanguage){this.stores?.scheduler.set("selectedLanguage",e.language)}}rescheduleBookingRefChanged(e){if(e){const[t,n]=d(e);this.stores?.scheduler.set("rescheduleBookingId",n);this.refConfigId=t;this.nylasSchedulerConnector?.scheduler.setConfigId(t)}}cancelBookingRefChanged(e){if(e){const[t,n]=d(e);this.stores?.scheduler.set("cancelBookingId",n);this.refConfigId=t;this.nylasSchedulerConnector?.scheduler.setConfigId(t)}}organizerConfirmationBookingRefChanged(e){if(e){const[t,n]=d(e);this.stores?.scheduler.set("organizerConfirmationBookingId",n);this.refConfigId=t;this.nylasSchedulerConnector?.scheduler.setConfigId(t)}}localizationChanged(e){if(!e){return}Object.keys(e).forEach((t=>{if(!(t in v)){return}r.addResourceBundle(t,"translation",e[t],false,true)}))}defaultLanguageChanged(e){if(e){this.stores?.scheduler.set("selectedLanguage",e);r.changeLanguage(e)}}themeConfigChanged(e){this.baseProvider?.getStore("scheduler")?.set("themeConfig",e);this.applyThemeConfig(e)}languageChanged(e){const t=e.detail;this.language=t;r.changeLanguage(t)}async registerComponentHandler(e){this.baseProvider?.registerComponent(e.detail)}async unregisterComponentHandler(e){this.baseProvider?.unregisterComponent(e.detail)}async monthChangedHandler(e){const t=e.detail;const n=this.nylasSchedulerConnector?.schedulerStore?.get("configSettings")?.scheduler?.available_days_in_future;const{startTime:i,endTime:s,endTimeForAvailableDaysInFuture:o}=this.validateAvailableDaysInFuture(t,n||30);if(e.defaultPrevented){return}if(i<o&&t.getTime()<o*1e3){const e=await(this.nylasSchedulerConnector?.scheduler.getAvailability(i,s));if(!e||"error"in e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e?.error)},host:this.host})}const t=this.stores?.scheduler.get("selectableDates");if(t&&t.length>0){this.stores?.scheduler.set("selectedDate",t[0])}}}mapToBookingData(e){const t=this.stores?.scheduler.get("selectedTimeslot");const n=this.stores?.scheduler.get("selectedLanguage");const i=this.stores?.scheduler.get("selectedTimezone");const s=t?.start_time?new Date(t?.start_time).getTime()/1e3:"";const o=t?.end_time?new Date(t?.end_time).getTime()/1e3:"";return{additional_guests:e.guests,guest:{...e.primaryParticipant},additional_fields:{...e.additionalFields},start_time:s,end_time:o,email_language:n,timezone:i}}async bookButtonClickedHandler(e){if(e.defaultPrevented){return}const t=e.detail;const n=this.mapToBookingData(t);this.bookingInfoConfirmed=t;const i=this.nylasSchedulerConnector?.schedulerStore?.get("rescheduleBookingId");const s=i;if(s){const e=await(this.nylasSchedulerConnector?.scheduler.rescheduleBooking(s,t));if(!e||"error"in e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e?.error)},host:this.host})}const i=e?.data;const o=this.bookedEventInfo.emit({...e,data:{...i,...n}});this.bookingInfoConfirmed={...this.bookingInfoConfirmed,...i};if("bookedEventInfo"in this.eventOverrides){await this.eventOverrides.bookedEventInfo(o,this.nylasSchedulerConnector)}return}const o=await(this.nylasSchedulerConnector?.scheduler.bookTimeslot(t));if(!o||"error"in o){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(o?.error)},host:this.host})}const a=o?.data;const r=this.bookedEventInfo.emit({...o,data:{...a,...n}});this.bookingInfoConfirmed={...this.bookingInfoConfirmed,...a};if("bookedEventInfo"in this.eventOverrides){await this.eventOverrides.bookedEventInfo(r,this.nylasSchedulerConnector)}}dateSelectedHandler(e){const t=e.detail;this.selectedDateLabel=t?t.toLocaleDateString(this.language,{dateStyle:"full"}):`${r.t("noDateSelected")}`}cancelBookedEventErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}cancelBookedEventValidationErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}rescheduleBookedEventErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}confirmBookingErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}feedbackModalClosedHandler(){this.showFeedbackModal=false}eventIsFullHandler(e){const t=e.detail.error;const n=e.detail.type;if(n==="error"){this.nylasSchedulerError.emit({notification:{...this.getErrorObject({message:t})},host:this.host})}else{this.nylasSchedulerInfo.emit({notification:{title:"Event is full",category:g.Component,type:y.Info,description:"The event you selected is full. Please try a different time.",id:(new Date).getTime().toString(),ttl:3e3},host:this.host})}}feedbackSubmittedHandler(e){m("Scheduling Page User Feedback",{extra:{configId:this.configurationId,slug:this.slug}});const t={message:e.detail.feedback};b(t,{includeReplay:true,captureContext:{tags:{"nylas-web-element":"nylas-scheduling","nylas-web-element-version":this.version,"nylas-config-id":this.configurationId,"nylas-slug":this.slug,"host-url":window.location.href},extra:{configId:this.configurationId,slug:this.slug,version:this.version}}});this.showFeedbackModal=false}async getNylasSchedulerStore(){return this.baseProvider?.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(e){return{title:e?.title||L.title,category:e?.category||L.category,type:y.Error,description:e?.message||"",id:(new Date).getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){let e="";if(!this.sessionId){e+=r.t("sessionIdRequiredErrorMessage")}if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){e=r.t("sessionIdRequiredErrorMessage")+" "+r.t("publicConfigErrorMessage")}this.nylasSchedulerError.emit({notification:{title:r.t("schedulingComponentErrorTitle"),category:g.Component,type:y.Error,description:e,id:(new Date).getTime().toString(),ttl:"none"},host:this.host});return false}return true}isTimeslotValid(e){const t=new Date(e.start_time);if(t<new Date){this.nylasSchedulerError.emit({notification:{title:r.t("invalidTimeslotErrorTitle"),category:g.Component,type:y.Error,description:r.t("invalidTimeslotErrorMessage"),id:(new Date).getTime().toString(),ttl:"none"},host:this.host});return false}return true}validateAvailableDaysInFuture(e,t){const n=new Date;const i=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3;const s=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3;const o=Math.floor(l(n,t).getTime()/1e3);const a=Math.min(o,s);const r=i<n.getTime()/1e3?Math.floor(n.getTime()/1e3):i;return{startTime:r,endTime:a,endTimeForAvailableDaysInFuture:o}}applyThemeConfig(e){if(e){for(const[t,n]of Object.entries(e)){this.host.style.setProperty(`${t}`,n)}}}onFeedbackClick(e){e.preventDefault();this.showFeedbackModal=true}redirectToCustomUrl(e){window.location.assign(e)}nylasFormDropdownChangedHandler(e){const{name:t,value:n}=e.detail;if(t==="language"){const e=v[n];r.changeLanguage(e);this.stores?.scheduler?.set("selectedLanguage",e)}}render(){const t=this.mode==="app";const n=this.baseProvider?.getStore("scheduler");const i=n?.get("eventInfo");const o=n?.get("showBookingForm");const a=n?.get("cancelledEventInfo");const l=n?.get("cancelBookingId");const c=n?.get("selectedTimeslot");const d=n?.get("rescheduleBookingId");const g=n?.get("organizerConfirmationBookingId");const f=n?.get("rejectBookingId");const u=n?.get("confirmedEventInfo");const p=n?.get("nylasBranding")||this.nylasBranding;const m=n?.get("selectedDate");const b=n?.get("configSettings")?.scheduler?.confirmation_redirect_url;this.selectedDateLabel=m&&this.language?h(m.toLocaleDateString(this.language,{dateStyle:"full"})):`${r.t("noDateSelected")}`;const _=Object.keys(k).map((e=>({label:k[e],value:e})));const y=n?.get("selectedLanguage")||this.defaultLanguage||navigator.language||v.en;if(t&&(l||f)&&!a){return e(s,null,e(E,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancel-flow-page",part:"cancel-flow-page"},e("nylas-cancel-booking-form",{selectedTimeslot:c,cancelBookingId:l,rejectBookingId:f,exportparts:"ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:r.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==y)),exportparts:"sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label"},e("span",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&g){return e(s,null,e(E,null,e("div",{class:"manual-confirmation-page",part:"manual-confirmation-page"},e("nylas-organizer-confirmation-card",{organizerConfirmationBookingId:g,exportparts:"nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:r.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==y)),exportparts:"sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label"},e("span",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&a){return e(s,null,e(E,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancelled-event-page",part:"cancelled-event-page"},e("nylas-cancelled-event-card",{cancelledEventInfo:a,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:r.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==y)),exportparts:"sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label"},e("span",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&u){return e(s,null,e(E,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancelled-event-page",part:"confirmed-event-page"},e("nylas-confirmed-event-card",{confirmedEventInfo:u,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:r.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==y)),exportparts:"sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label"},e("span",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&i&&b){const e=this.bookingInfoConfirmed?.primaryParticipant;const t=this.bookingInfoConfirmed?.location;const n=this.bookingInfoConfirmed?.booking_ref;const s=this.bookingInfoConfirmed?.additionalFields||{};if(this.bookingInfo&&typeof this.bookingInfo?.additionalFields!=="undefined"){const e=this.bookingInfo.additionalFields;Object.keys(e).forEach((t=>{if(!s[t]&&e?.[t]){s[t]=e[t].value}}))}const o=this.stores?.scheduler.get("selectedTimeslot");const a=this.stores?.scheduler.get("selectedTimezone");const r=this.stores?.scheduler.get("selectedLanguage");const l=this.stores?.scheduler.get("configSettings");const c=this.configurationId?this.configurationId:l?.configuration_id;const d=window.location.search;const h=new URLSearchParams(d);h.set("booking_id",i.booking_id);e?.name&&h.set("name",e.name);e?.email&&h.set("email",e.email);o?.start_time&&h.set("start_time",(new Date(o.start_time).getTime()/1e3).toString());o?.end_time&&h.set("end_time",(new Date(o.end_time).getTime()/1e3).toString());a&&h.set("tz",a);r&&h.set("language",r);s&&h.set("additional_values",JSON.stringify(s));this.slug&&h.set("page_slug",this.slug);c&&h.set("config_id",c);t&&h.set("location",t);n&&h.set("booking_ref",n);this.redirectToCustomUrl(`${b}?${h.toString()}`);return}if(t&&i){return e(s,null,e(E,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"booked-event-page",part:"booked-event-page ns_booked-event-page"},e("nylas-booked-event-card",{selectedTimeslot:c,eventInfo:i,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:r.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==y)),exportparts:"sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label"},e("span",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&(!i||!!d)&&!o){const t=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return e(s,null,e(E,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},d&&e(S,null,`${r.t("rescheduleTitle")}`),e("div",{class:"select-date-page",part:"select-date-page ns_select-date-page"},e("div",{class:"left-panel",part:"ns_left-panel"},e("nylas-date-picker",{exportparts:"ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),e("nylas-locale-switch",{exportparts:"nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label"})),e("div",{class:`right-panel ${d?"reschedule":""}`,part:`ns_right-panel ${d?"ns_reschedule":""}`},e("h2",{part:"ns_right-panel__title"},e("calendar-icon",{part:"ns_right-panel__calendar-icon"}),e("span",{id:"selectedDate",part:"ns_right-panel__selected-date"},this.selectedDateLabel)),e("nylas-timeslot-picker",{exportparts:"ntp, ntp__time-picker-wrapper, ntp__timeslots, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},t&&e("span",{slot:"timeslot-picker-cta-label"},e("slot",{name:"timeslot-picker-cta-label"})))))),this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&!i&&o){return e(s,null,e(E,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},d&&e(S,null,`${r.t("rescheduleTitle")}`),e("div",{class:"additional-data-page",part:"additional-data-page ns_additional-data-page"},e("div",{class:"left-panel ns_left-panel",part:"ns_left-panel"},e("div",{class:"wrapper",part:"ns_left-panel__wrapper"},e("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone"}))),e("div",{class:`right-panel ${d?"reschedule":""}`,part:`ns_right-panel ${d?"ns_reschedule":""}`},e("nylas-booking-form",{exportparts:"nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content"})))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:r.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==y)),exportparts:"sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label"},e("span",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}return e(s,null,e("slot",null))}get host(){return o(this)}static get watchers(){return{bookingInfo:["bookingInfoChanged"],rescheduleBookingRef:["rescheduleBookingRefChanged"],cancelBookingRef:["cancelBookingRefChanged"],organizerConfirmationBookingRef:["organizerConfirmationBookingRefChanged"],localization:["localizationChanged"],defaultLanguage:["defaultLanguageChanged"],themeConfig:["themeConfigChanged"]}}};D.style=B;export{D as nylas_scheduling};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{h as e,F as t,r as n,c as i,H as s,a as o}from"./p-0EQQA0nE.js";import{N as a}from"./p-BS9pAWHt.js";import{i as r,c as l,a as c,f as d,h}from"./p-D7AODx4L.js";import{E as g,i as f,a as u,f as p,c as m,b}from"./p-CquJ7U5v.js";import{v as _,u as y}from"./p-DM0y_1NQ.js";import{c as w}from"./p-_i6H-yQH.js";import{L as v,a as k}from"./p-COJy29df.js";class I{constructor(){this.component=e=>{const t=g.Component;const n=`${e} Error`;return{endtime_not_in_future:(e='"endtime" can not be in the future')=>({title:n,message:e,category:t}),no_booking_info:(e="No booking info provided")=>({title:n,message:e,category:t}),no_timeslot_selected:(e="No timeslot selected")=>({title:n,message:e,category:t}),no_timezone_selected:(e="No timezone selected")=>({title:n,message:e,category:t}),no_booking_id:(e="No booking id provided")=>({title:n,message:e,category:t}),no_salt:(e="No salt provided")=>({title:n,message:e,category:t}),invalid_start_time:(e="Invalid start time")=>({title:n,message:e,category:t}),invalid_end_time:(e="Invalid end time")=>({title:n,message:e,category:t}),invalid_timezone:(e="Invalid timezone")=>({title:n,message:e,category:t}),no_config_id:(e="No configuration id provided")=>({title:n,message:e,category:t})}};this.api=e=>{const t=g.Api;const n=`${e} Error`;return{invalid_session:e=>({title:n,message:e,category:t}),general_error:e=>({title:n,message:e,category:t}),internal_error:e=>({title:n,message:e,category:t}),invalid_request_error:e=>({title:n,message:e,category:t}),timeslot_not_available:e=>({title:n,message:e,category:t}),provider_error:e=>({title:n,message:e,category:t}),not_found_error:e=>({title:n,message:e,category:t})}}}}class x{constructor({schedulerAPIURL:e,schedulerStore:t,sessionId:n,configId:i,slug:s,clientId:o}){this.errors=new I;this.schedulerStore=t;this.schedulerAPIURL=e;this.sessionId=n;this.configId=i;this.slug=s;this.clientId=o}getHeaders(){return this.sessionId?{Authorization:`Bearer ${this.sessionId}`}:{}}async makeAPIRequest(e,t,n,i={}){try{const s=new URL(this.schedulerAPIURL);s.pathname=e;const o=await fetch(decodeURIComponent(s.toString()),{method:t,headers:{"Content-Type":"application/json",Origin:window.location.origin,"X-Source":"nylas-scheduling","X-Nylas-Web-Elements-Version":_,...this.clientId&&{"X-Nylas-Application-Public-Id":this.clientId},...i},body:n});const a=await o.json();return a}catch(e){return{error:{message:e.message,title:"API request failed",type:"api"}}}}getErrorMessage(e){let t=e?.message||e?.title||"Something went wrong";if(e?.type==="provider_error"){t=e?.provider_error?.error?.message||e?.provider_error?.error?.title||"Something went wrong"}return t}setConfigId(e){this.configId=e}selectDate(e){this.schedulerStore.set("selectedDate",e);this.schedulerStore.set("selectedTimeslot",null)}selectTime(e){this.schedulerStore.set("selectedTimeslot",e)}selectTimezone(e){this.schedulerStore.set("selectedTimezone",e)}selectLanguage(e){this.schedulerStore.set("selectedLanguage",e);r.changeLanguage(e)}async toggleAdditionalData(e){if(!e){await this.refetchAvailability()}this.schedulerStore.set("showBookingForm",e)}setParticipantName(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t?.primaryParticipant,name:e}})}setParticipantEmail(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t?.primaryParticipant,email:e}})}async refetchAvailability(){const e=new Date;const t=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3;const n=t<e.getTime()/1e3?Math.floor(e.getTime()/1e3):t;const i=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3;const s=await this.getAvailability(n,i);return s}async resetStoreStateAndFetchAvailability(){const e=new Date;const t=await this.refetchAvailability();const n=this.schedulerStore.get("availability").find((e=>new Date(e.start_time)>new Date));let i=e;if(n){i=n.start_time}this.schedulerStore.set("selectedDate",i);this.schedulerStore.set("eventInfo",null);this.schedulerStore.set("showBookingForm",false);this.schedulerStore.set("selectedTimeslot",null);return t}async setReschedule(e){this.schedulerStore.set("isLoading",true);const t=this.schedulerStore.state.eventInfo;if(t){this.schedulerStore.set("reschedulingEventInfo",t)}this.schedulerStore.set("rescheduleBookingId",e);await this.getUISettings();const n=await this.resetStoreStateAndFetchAvailability().finally((()=>{this.schedulerStore.set("isLoading",false)}));return n}async setCancel(e){this.schedulerStore.set("cancelBookingId",e)}async setReject(e){this.schedulerStore.set("rejectBookingId",e)}async resetCancel(){const e=await this.resetStoreStateAndFetchAvailability();this.schedulerStore.set("cancelBookingId","");this.schedulerStore.set("rejectBookingId","");this.schedulerStore.set("cancelledEventInfo",null);return e}async goBack(){this.schedulerStore.set("cancelBookingId","");return}async resetConfirm(){const e=await this.resetStoreStateAndFetchAvailability();this.schedulerStore.set("organizerConfirmationBookingId","");this.schedulerStore.set("confirmedEventInfo",undefined);return e}async bookTimeslot(e){this.schedulerStore.set("isLoading",true);const{selectedTimeslot:t,selectedTimezone:n,bookingInfo:i,selectedLanguage:s}=this.schedulerStore.state;if(!e&&!i){return{error:this.errors.component(r.t("createBookingErrorTitle")).no_booking_info()}}const o=e?.timeslot||t;if(!o){return{error:this.errors.component(r.t("createBookingErrorTitle")).no_timeslot_selected()}}const a=e&&e?.timezone?e?.timezone:n;const l=s||"en-US";if(!a){return{error:this.errors.component(r.t("createBookingErrorTitle")).no_timezone_selected()}}const c=[...this.schedulerStore.get("availabilityOrderEmails")];let d="";const h=o?.emails||[];const g={};Object.entries(i?.additionalFields||{}).forEach((([e,t])=>{g[e]=t.value}));const f=e?e?.primaryParticipant:i?.primaryParticipant;const u=e?e?.guests||[]:i?.guests||[];const p=e?e?.additionalFields:g;const m=this.getHeaders();const b=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const _=`/v3/scheduling/bookings${b}`;if(c.length===0){const e=await this.makeAPIRequest(decodeURIComponent(_),"POST",JSON.stringify({additional_fields:p,additional_guests:u,guest:{...f},start_time:o.start_time.getTime()/1e3,end_time:o.end_time.getTime()/1e3,timezone:a,event_id:o?.event_id||undefined,master_id:o?.master_id||undefined,calendar_id:o?.calendar_id||undefined,email_language:this.getTwoLetterLanguageCode(l)}),m);this.schedulerStore.set("isLoading",false);if("data"in e){this.schedulerStore.set("eventInfo",e.data);return e}return{error:e.error}}while(c.length>0){d=c.shift();if(!h.includes(d)){continue}const e=await this.makeAPIRequest(decodeURIComponent(_),"POST",JSON.stringify({participants:d?[{email:d}]:undefined,additional_fields:p,additional_guests:u,guest:{...f},start_time:o.start_time.getTime()/1e3,end_time:o.end_time.getTime()/1e3,timezone:a,email_language:this.getTwoLetterLanguageCode(l)}),m);if("data"in e){this.schedulerStore.set("isLoading",false);this.schedulerStore.set("eventInfo",e?.data);return e}else if(e.error?.message?.startsWith("The selected timeslot is unavailable")){continue}else{this.schedulerStore.set("isLoading",false);const t=e.error?.type;let n=e.error;if(t&&t in this.errors.api(r.t("createBookingErrorTitle"))){const e=this.getErrorMessage(n);n=this.errors.api(r.t("createBookingErrorTitle"))[t](e)}return{error:n}}}this.schedulerStore.set("isLoading",false);return{error:this.errors.api(r.t("createBookingErrorTitle")).timeslot_not_available("The selected timeslot is unavailable")}}async getUISettings(){this.schedulerStore.set("isLoading",true);const e=this.schedulerStore.get("rescheduleBookingId");const t=this.getHeaders();let n=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";if(e&&!!n){n+=`&booking_id=${e}`}else if(e){n+=`?booking_id=${e}`}const i=`/v3/scheduling/ui-settings${n}`;const s=await this.makeAPIRequest(i,"GET",undefined,t);if("error"in s){this.schedulerStore.set("isLoading",false);const e=s.error?.type;let t=s.error;if(e&&e in this.errors.api(r.t("getUISettingErrorTitle"))){t=this.errors.api(r.t("getUISettingErrorTitle"))[e](t?.message||t?.title||"Something went wrong")}return{error:t}}if("data"in s){this.schedulerStore.set("configSettings",s.data);this.clientId=s.data.app_client_id||this.clientId}this.schedulerStore.set("isLoading",false);return s}getTwoLetterLanguageCode(e){return e.split("-")[0]}getStartTimeWithMinBookingNotice(e){const t=this.schedulerStore.get("configSettings")?.scheduler;const n=t?.min_booking_notice;if(!n){return e}const i=(new Date).getTime();if(e<(i+n*60*1e3)/1e3){return Math.floor((i+n*60*1e3)/1e3)}else{return e}}getEndTimeForAvailableDaysInFuture(e){const t=new Date;const n=this.schedulerStore.get("configSettings")?.scheduler?.available_days_in_future;const i=Math.floor(l(t,n).getTime()/1e3);const s=Math.min(i,e);return s}async getAvailability(e=0,t=0){this.schedulerStore.set("isLoading",true);const n=new URLSearchParams;const i=new Date;const s=i.getTime();if(t&&t<s/1e3){this.schedulerStore.set("isLoading",false);const e=this.errors.component(r.t("getAvailabilityErrorTitle")).endtime_not_in_future();return{error:e}}if(!e){const t=new Date(i.getFullYear(),i.getMonth(),1);e=Math.floor(t.getTime()/1e3)}if(!t){const e=new Date(i.getFullYear(),i.getMonth()+1,0);t=Math.floor(e.getTime()/1e3)}t=this.getEndTimeForAvailableDaysInFuture(t);const o=this.getStartTimeWithMinBookingNotice(e);e=o;t=o>t?o+1:t;n.append("start_time",encodeURIComponent(e.toString()));n.append("end_time",encodeURIComponent(t.toString()));if(this.configId&&!this.sessionId){n.append("configuration_id",encodeURIComponent(this.configId))}else if(this.slug&&this.clientId&&!this.sessionId){n.append("slug",encodeURIComponent(this.slug));n.append("client_id",encodeURIComponent(this.clientId))}const a=this.schedulerStore.get("rescheduleBookingId");if(a){n.append("booking_id",encodeURIComponent(a))}const l=n.toString();const c=`/v3/scheduling/availability${l?`?${l}`:""}`;const d=this.getHeaders();const h=await this.makeAPIRequest(decodeURIComponent(c),"GET",undefined,d);if("error"in h){this.schedulerStore.set("availability",[]);this.schedulerStore.set("isLoading",false);const e=h.error?.type;let t=h.error;if(t?.message?.toLowerCase().includes("Failed to find a valid Grant")){const e=r.t("invalidGrantError");return{error:{title:r.t("invalidGrantErrorTitle"),message:e,category:g.Api}}}if(e&&e in this.errors.api(r.t("getAvailabilityErrorTitle"))){const n=this.getErrorMessage(t);t=this.errors.api(r.t("getAvailabilityErrorTitle"))[e](n)}return{error:t}}if("data"in h){const e=h.data?.time_slots?.map((e=>({...e,start_time:new Date(e.start_time*1e3),end_time:new Date(e.end_time*1e3)})))||[];const t=e.filter((e=>e.start_time.getTime()>s));const n=t.sort(((e,t)=>e.start_time.getTime()-t.start_time.getTime()));this.schedulerStore.set("availability",n);const i=h.data?.order||[];this.schedulerStore.set("availabilityOrderEmails",i)}this.schedulerStore.set("isLoading",false);return h}async cancelBooking(e,t){this.schedulerStore.set("isLoading",true);if(!e){return{error:this.errors.component(r.t("cancelBookingErrorTitle")).no_booking_id()}}const n=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const i=`/v3/scheduling/bookings/${e}${n}`;const s=this.getHeaders();const o=await this.makeAPIRequest(decodeURIComponent(i),"DELETE",JSON.stringify({action:"cancel",cancellation_reason:t}),s);if("error"in o){this.schedulerStore.set("isLoading",false);const e=o.error?.type;let t=o.error;if(e&&e in this.errors.api(r.t("cancelBookingErrorTitle"))){const n=this.getErrorMessage(t);t=this.errors.api(r.t("cancelBookingErrorTitle"))[e](n)}return{error:t}}this.schedulerStore.set("cancelledEventInfo",{booking_id:e});this.schedulerStore.set("rescheduleBookingId","");this.schedulerStore.set("isLoading",false);return o}async rescheduleBooking(e,t){this.schedulerStore.set("isLoading",true);if(!e){return{error:this.errors.component(r.t("rescheduleBookingErrorTitle")).no_booking_id()}}const n=this.errors.api(r.t("rescheduleBookingErrorTitle"));const i=this.errors.component(r.t("rescheduleBookingErrorTitle"));const{bookingInfo:s,selectedTimeslot:o,selectedTimezone:a,selectedLanguage:l}=this.schedulerStore.state;const{startTime:c,endTime:d,timezone:h}=t;const g=c||o?.start_time;if(!g){return{error:i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')}}const f=d||o?.end_time;if(!f){return{error:i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')}}const u=this.schedulerStore.get("availabilityOrderEmails");let p="";if(u.length>0){const e=o?.emails||[];for(let t=0;t<u.length;t++){if(e.includes(u[t])){p=u[t];break}}}const m=h||a;if(!m){return{error:i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')}}const b=o?.event_id||undefined;const _=o?.master_id||undefined;const y=o?.calendar_id||undefined;const w={};Object.entries(s?.additionalFields||{}).forEach((([e,t])=>{w[e]=t.value}));const v=t?t?.primaryParticipant:s?.primaryParticipant;const k=t?t?.guests||[]:s?.guests||[];const I=t?t?.additionalFields:w;const x=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const T=`/v3/scheduling/bookings/${e}${x}`;const C=this.getHeaders();const E=await this.makeAPIRequest(decodeURIComponent(T),"PATCH",JSON.stringify({start_time:g.getTime()/1e3,end_time:f.getTime()/1e3,timezone:m,additional_fields:I,guest:{...v},additional_guests:k,participants:p?[{email:p}]:undefined,email_language:this.getTwoLetterLanguageCode(l),event_id:b,master_id:_,calendar_id:y}),C);if("error"in E){this.schedulerStore.set("isLoading",false);const e=E.error?.type;let t=E.error;if(e&&e in n){const i=this.getErrorMessage(t);t=n[e](i)}return{error:t}}const S=this.schedulerStore.get("reschedulingEventInfo");if("data"in E){this.schedulerStore.set("eventInfo",E?.data)}else if(S){this.schedulerStore.set("eventInfo",S)}else{const t={booking_id:e};this.schedulerStore.set("eventInfo",t)}this.schedulerStore.set("isLoading",false);return E}async updateBooking(e){this.schedulerStore.set("isLoading",true);const{bookingId:t,status:n,reason:i}=e;const s=this.schedulerStore.get("organizerConfirmationSalt");const o=n==="confirmed"?r.t("confirmBookingErrorTitle"):r.t("rejectBookingErrorTitle");if(!t){return{error:this.errors.component(o).no_booking_id()}}if(!s){return{error:this.errors.component(o).no_salt()}}const a=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"";const l=`/v3/scheduling/bookings/${t}${a}`;const c=this.getHeaders();const d=await this.makeAPIRequest(decodeURIComponent(l),"PUT",JSON.stringify({status:n,cancellation_reason:i,salt:s}),c);if("error"in d){this.schedulerStore.set("isLoading",false);const e=d.error?.type;let t=d.error;if(e&&e in this.errors.api(o)){const n=this.getErrorMessage(t);t=this.errors.api(o)[e](n)}return{error:t}}if("data"in d&&n==="confirmed"){this.schedulerStore.set("confirmedEventInfo",d?.data)}else if("request_id"in d&&n==="cancelled"){this.schedulerStore.set("cancelledEventInfo",{booking_id:t})}this.schedulerStore.set("organizerConfirmationBookingId","");this.schedulerStore.set("isLoading",false);return d}async validateGroupEventTimeslot(e){this.schedulerStore.set("isLoading",true);const t=this.schedulerStore.get("configSettings")?.configuration_id;if(!t){return{error:this.errors.component(r.t("validateTimeslotErrorTitle")).no_config_id()}}const n=this.getHeaders();const i=`/v3/scheduling/configurations/${t}/group-events/validate-timeslot`;const s=await this.makeAPIRequest(decodeURIComponent(i),"POST",JSON.stringify({...e,start_time:e.start_time.getTime()/1e3,end_time:e.end_time.getTime()/1e3}),n);if("error"in s){this.schedulerStore.set("isLoading",false);const e=s.error?.type;let t=s.error;if(e&&e in this.errors.api(r.t("validateTimeslotErrorTitle"))){const n=this.getErrorMessage(t);t=this.errors.api(r.t("validateTimeslotErrorTitle"))[e](n)}this.refetchAvailability();return{error:t}}this.schedulerStore.set("selectedTimeslot",e);this.schedulerStore.set("showBookingForm",true);this.schedulerStore.set("isLoading",false);return s}}class T{constructor({schedulerAPIURL:e,nylasSchedulerStore:t,sessionId:n,configId:i,slug:s,clientId:o}){if(!e){throw new Error("schedulerAPIURL is required")}if(!t){throw new Error("nylasSchedulerStore is required")}if(!n&&!i&&!(s||o)){throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.")}if(e==="/"){const t=new URL(window.location.href);e=t.origin}this.configId=i;this.sessionId=n;this.schedulerAPIURL=e;this.nylasSchedulerStore=t;this.slug=s;this.clientId=o}init(){c("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){if(this._schedulerAPIConnector){return this._schedulerAPIConnector}this._schedulerAPIConnector=new x({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId,slug:this.slug,clientId:this.clientId});return this._schedulerAPIConnector}resetStores(){this.nylasSchedulerStore.reset()}}function C(e={}){const t={selectedDate:null,selectedLanguage:navigator.language,selectedTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,selectedTimeslot:null,showBookingForm:false,availabilityOrderEmails:[],selectableDates:null,availability:[],eventDuration:0,state:"ready",eventInfo:null,cancelledEventInfo:null,isLoading:false,nylasBranding:true,...e};c(`[defaultNylasStoreState]: `,t);const n=w(t);n.onChange("availability",(e=>{c(`[availability]: `,e);const t=e.map((e=>e.start_time));c(`[selectableDates]: `,t);n.set("selectableDates",t);const i=e[0];if(!i)return;const s=Math.floor((i.end_time.getTime()-i.start_time.getTime())/6e4);c(`[durationMinutes]: `,s);n.set("eventDuration",s)}));n.reset=()=>{for(const e in t){const i=t[e];n.set(e,i)}};return n}const E=(n,i)=>{const s=n.isLoading;const o=n.showNotification;const a=n.nylasBranding;const r=n.version;return e(t,null,o&&e("nylas-notification",null),s&&e("div",{class:"loading"},e("div",{class:"left"},e("div",{class:"skeleton"})),e("div",{class:"right"},e("div",{class:"skeleton"}),e("div",{class:"skeleton"}),e("div",{class:"skeleton"}),e("div",{class:"skeleton"}),e("div",{class:"skeleton"}))),!s&&i,e("div",{class:"footer"},a&&e("a",{href:"https://scheduler.nylas.com?utm_source=powered-by-nylas-logoutm_medium=link&utm_campaign=get-scheduler&utm_id=get-scheduler",class:"powered-by-nylas",target:"_blank",rel:"noreferrer noopener"},"Powered by ",e("span",{class:"sr-only"},"Nylas"),e("nylas-logo",{"aria-hidden":true})),e("tooltip-component",null,e("info-icon",{slot:"tooltip-icon"}),e("span",{slot:"tooltip-content"},r))))};const S=(t,n)=>e("div",{class:"message-banner"},n);const B=':host{display:flex;flex-direction:column;overflow:visible;border-radius:var(--nylas-border-radius-2x);width:fit-content;background:var(--nylas-base-0);position:relative;box-shadow:0px 4px 8px 2px rgba(0, 0, 0, 0.05), 0px 8px 16px -2px rgba(0, 0, 0, 0.1);--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;font-family:var(--nylas-font-family);font-optical-sizing:auto;font-style:normal;font-variation-settings:"slnt" 0}@media screen and (max-width: 768px){:host{width:auto;min-width:325px}}:root{font-family:inherit}.error{padding:8rem 12rem;color:var(--nylas-base-0);background-color:var(--nylas-error);margin:1.5rem;border-radius:var(--nylas-border-radius-2x)}.message-banner{text-align:right;color:var(--nylas-base-800);padding:1rem;border-bottom:1px solid var(--nylas-color-primary-200);margin:0}.loading{margin:1.5rem;display:flex;gap:1rem}.loading .skeleton{border-radius:var(--nylas-border-radius-2x);animation:pulsate 1.5s infinite}.loading .skeleton:nth-child(2){animation-delay:-100ms}.loading .skeleton:nth-child(3){animation-delay:-200ms}.loading .skeleton:nth-child(4){animation-delay:-300ms}.loading .skeleton:nth-child(5){animation-delay:-400ms}.loading .left .skeleton{height:100%;width:400px}.loading .right .skeleton{height:5rem;width:300px;margin-bottom:1rem}.loading .right .skeleton:last-child{margin-bottom:0}@keyframes pulsate{0%{background-color:var(--nylas-base-50)}50%{background-color:var(--nylas-base-100)}100%{background-color:var(--nylas-base-50)}}.select-date-page,.additional-data-page,.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{border-top-left-radius:var(--nylas-border-radius-2x);border-top-right-radius:var(--nylas-border-radius-2x)}.select-date-page,.additional-data-page{display:flex}@media screen and (max-width: 768px){.select-date-page,.additional-data-page{flex-direction:column}}.booked-event-page,.manual-confirmation-page{background-color:var(--nylas-base-50)}.cancelled-event-page,.manual-confirmation-page,.cancel-flow-page{padding:1rem;height:496px;display:flex;justify-content:center;align-items:center}.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:784px;background:var(--nylas-base-50)}@media screen and (max-width: 768px){.booked-event-page,.manual-confirmation-page,.cancelled-event-page,.cancel-flow-page{min-width:90%}}.left-panel{display:flex;flex-direction:column;min-width:424px;border-top-left-radius:inherit;background:var(--nylas-base-0);position:relative;padding:1rem 0 0 0;height:624px}@media screen and (max-width: 768px){.left-panel{border-top-right-radius:inherit;min-width:unset;height:auto}}@media screen and (max-width: 768px){.select-date-page .left-panel{height:624px}}.border{margin-left:-20px;margin-right:-20px;border-top-width:1px;height:0.5px;background-color:var(--nylas-base-200)}@media screen and (max-width: 768px){.border{display:none}}.right-panel{min-width:360px;width:360px;background-color:var(--nylas-base-50);height:624px;padding-top:16px;border-left:1px solid var(--nylas-base-200);border-top-right-radius:inherit}.right-panel.reschedule{border-top-right-radius:0px}@media screen and (max-width: 768px){.right-panel{border-top-right-radius:0px;width:inherit;min-width:unset;height:auto;border-left:none}}.right-panel h2{display:flex;margin:0;height:48px;gap:0.5rem;justify-content:center;align-items:center;width:auto;font-size:1.125rem;line-height:1.5rem;font-weight:500;text-align:center;color:var(--nylas-base-800)}.additional-data-page .left-panel{background-color:var(--nylas-base-50)}.additional-data-page .right-panel{background-color:var(--nylas-base-0)}nylas-selected-event-card{height:604px;padding:0 1rem}@media screen and (max-width: 768px){nylas-selected-event-card{height:250px}}.footer{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:16px;font-size:14px;font-weight:300;color:var(--nylas-base-500);border-top:1px solid var(--nylas-base-200);min-height:24px}.footer .powered-by-nylas{display:flex;align-items:center;text-decoration:none;color:var(--nylas-base-500)}.footer .powered-by-nylas:hover{color:var(--nylas-base-800)}.footer svg{fill:var(--nylas-base-500)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.footer svg{margin-top:1px}nylas-selected-event-card::part(nsec__timezone){position:absolute;bottom:0}nylas-notification{margin:1.5rem;width:-webkit-fill-available;width:-moz-available;position:absolute}nylas-locale-switch{position:absolute;padding:18px 20px;bottom:0;width:-webkit-fill-available;width:-moz-available;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){nylas-locale-switch{height:auto}}nylas-date-picker{padding:0 20px}button-component#report-issue{width:auto;position:absolute;bottom:4px;left:16px}.language-feedback-container{width:auto;position:absolute;bottom:4px;left:16px;display:flex;gap:8px;align-items:center}.language-feedback-container button-component#report-issue{position:initial}nylas-feedback-form{position:absolute;top:0;height:100%;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;background:rgba(0, 0, 0, 0.6);z-index:2;border-radius:inherit}';const L={title:r.t("genericErrorTitle"),category:g.Component};const D=class{constructor(e){n(this,e);this.init=i(this,"init",7);this.schedulerWillLoad=i(this,"schedulerWillLoad",7);this.schedulerDidLoad=i(this,"schedulerDidLoad",7);this.nylasSchedulerError=i(this,"nylasSchedulerError",7);this.nylasSchedulerInfo=i(this,"nylasSchedulerInfo",7);this.configSettingsLoaded=i(this,"configSettingsLoaded",7);this.bookingRefExtracted=i(this,"bookingRefExtracted",7);this.bookedEventInfo=i(this,"bookedEventInfo",7);this.mode="app";this.schedulerApiUrl="https://api.us.nylas.com";this.nylasBranding=true;this.eventOverrides={};this.showNotification=true;this.enableUserFeedback=true;this.automaticComponentRegistration=true;this.selectedDateLabel=(new Date).toLocaleDateString(navigator.language,{dateStyle:"full"})||`${r.t("noDateSelected")}`;this.language=navigator.language;this.showFeedbackModal=false;this.bookingInfoConfirmed=null;this.version=_}connectedCallback(){c(`[nylas-scheduler] connectedCallback`)}async componentWillLoad(){c(`[nylas-scheduler] Component will load`);this.version=_;if(this.enableUserFeedback&&!f()){u({dsn:"https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",release:this.version,integrations:e=>[...e.filter((e=>false)),p({colorScheme:"system",autoInject:false})],autoSessionTracking:false,beforeSend:()=>null})}const e=this.schedulerWillLoad.emit(this.host);if("schedulerWillLoad"in this.eventOverrides){await this.eventOverrides.schedulerWillLoad(e,this.nylasSchedulerConnector);if(e.defaultPrevented){return}}const t=new URLSearchParams(window.location.search);const n=t.get("lang");const i=n&&Object.values(v).includes(n)?n:null;this.stores={scheduler:C({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,themeConfig:this.themeConfig,hour12:this.hour12,selectedLanguage:i||this.defaultLanguage||this.bookingInfo?.language||v.en,...this.defaultSchedulerState})};this.baseProvider=new a(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides);this.refConfigId=this.configurationId;let s;if(this.rescheduleBookingRef){const[e,t,n]=d(this.rescheduleBookingRef);this.refConfigId=e;this.stores.scheduler.set("rescheduleBookingId",t);s=this.bookingRefExtracted.emit({configurationId:e,bookingId:t})}else if(this.cancelBookingRef){const[e,t,n]=d(this.cancelBookingRef);this.refConfigId=e;this.stores.scheduler.set("cancelBookingId",t);s=this.bookingRefExtracted.emit({configurationId:e,bookingId:t})}else if(this.organizerConfirmationBookingRef){const[e,t,n]=d(this.organizerConfirmationBookingRef);this.refConfigId=e;this.stores.scheduler.set("organizerConfirmationBookingId",t);this.stores.scheduler.set("organizerConfirmationSalt",n);s=this.bookingRefExtracted.emit({configurationId:e,bookingId:t,salt:n})}this.applyThemeConfig(this.themeConfig);if("bookingRefExtracted"in this.eventOverrides){await this.eventOverrides.bookingRefExtracted(s,this.nylasSchedulerConnector);if(s.defaultPrevented){return}}if(!this.checkIfSessionIdOrConfigIdExists()){return}const o=this.baseProvider?.getStore("scheduler");this.nylasSchedulerConnector=new T({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,slug:this.slug,clientId:this.clientId,nylasSchedulerStore:o});const r=this.init.emit(this.host);if("init"in this.eventOverrides){await this.eventOverrides.init(r,this.nylasSchedulerConnector);if(r.defaultPrevented){return}}this.baseProvider?.componentWillLoad(this.nylasSchedulerConnector)}async componentDidLoad(){this.baseProvider?.componentDidLoad();await Promise.resolve();const e=this.schedulerDidLoad.emit(this.host);if("schedulerDidLoad"in this.eventOverrides){await this.eventOverrides.schedulerDidLoad(e,this.nylasSchedulerConnector);if(e.defaultPrevented){return}}if(!this.checkIfSessionIdOrConfigIdExists()){return}this.localizationChanged(this.localization);const t=await(this.nylasSchedulerConnector?.scheduler.getUISettings());if(!t||"error"in t){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(t?.error)},host:this.host});return}else{if("data"in t&&t.data?.appearance){c("Appearance settings have been returned from the configuration used byt his scheduling page; please remember to grab them from the configSettingsLoaded event and apply them as desired.")}const e=this.configSettingsLoaded.emit({settings:t});if("configSettingsLoaded"in this.eventOverrides){await this.eventOverrides.configSettingsLoaded(e,this.nylasSchedulerConnector);if(e.defaultPrevented){return}}}const n=this.baseProvider?.getStore("scheduler");const i=n?.get("configSettings")?.scheduler?.available_days_in_future;const s=n?.get("selectedTimeslot");if(s&&s?.start_time){if(!this.isTimeslotValid(s)){return}if(n?.get("showBookingForm")){n?.set("selectedDate",s.start_time);return}}const o=n?.get("selectedDate");const a=n?.get("availability");let r;if(a&&a.length>0){return}if(!o){const e=new Date;const{startTime:t,endTime:n,endTimeForAvailableDaysInFuture:s}=this.validateAvailableDaysInFuture(e,i||30);if(e.getTime()<s*1e3){r=await(this.nylasSchedulerConnector?.scheduler.getAvailability(t,n))}}else{const{startTime:e,endTime:t,endTimeForAvailableDaysInFuture:n}=this.validateAvailableDaysInFuture(o,i||30);if(o.getTime()<n*1e3){r=await(this.nylasSchedulerConnector?.scheduler.getAvailability(e,t))}}if(!r||"error"in r){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(r?.error)},host:this.host})}if(!o){let e=new Date;const t=n?.get("availability").find((e=>new Date(e.start_time)>new Date));if(t){e=t.start_time}n?.set("selectedDate",e)}}componentDisconnected(){this.baseProvider?.componentDisconnected()}bookingInfoChanged(e){this.stores?.scheduler.set("bookingInfo",e);if(e?.language&&!this.defaultLanguage){this.stores?.scheduler.set("selectedLanguage",e.language)}}rescheduleBookingRefChanged(e){if(e){const[t,n]=d(e);this.stores?.scheduler.set("rescheduleBookingId",n);this.refConfigId=t;this.nylasSchedulerConnector?.scheduler.setConfigId(t)}}cancelBookingRefChanged(e){if(e){const[t,n]=d(e);this.stores?.scheduler.set("cancelBookingId",n);this.refConfigId=t;this.nylasSchedulerConnector?.scheduler.setConfigId(t)}}organizerConfirmationBookingRefChanged(e){if(e){const[t,n]=d(e);this.stores?.scheduler.set("organizerConfirmationBookingId",n);this.refConfigId=t;this.nylasSchedulerConnector?.scheduler.setConfigId(t)}}localizationChanged(e){if(!e){return}Object.keys(e).forEach((t=>{if(!(t in v)){return}r.addResourceBundle(t,"translation",e[t],false,true)}))}defaultLanguageChanged(e){if(e){this.stores?.scheduler.set("selectedLanguage",e);r.changeLanguage(e)}}themeConfigChanged(e){this.baseProvider?.getStore("scheduler")?.set("themeConfig",e);this.applyThemeConfig(e)}languageChanged(e){const t=e.detail;this.language=t;r.changeLanguage(t)}async registerComponentHandler(e){this.baseProvider?.registerComponent(e.detail)}async unregisterComponentHandler(e){this.baseProvider?.unregisterComponent(e.detail)}async monthChangedHandler(e){const t=e.detail;const n=this.nylasSchedulerConnector?.schedulerStore?.get("configSettings")?.scheduler?.available_days_in_future;const{startTime:i,endTime:s,endTimeForAvailableDaysInFuture:o}=this.validateAvailableDaysInFuture(t,n||30);if(e.defaultPrevented){return}if(i<o&&t.getTime()<o*1e3){const e=await(this.nylasSchedulerConnector?.scheduler.getAvailability(i,s));if(!e||"error"in e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e?.error)},host:this.host})}const t=this.stores?.scheduler.get("selectableDates");if(t&&t.length>0){this.stores?.scheduler.set("selectedDate",t[0])}}}mapToBookingData(e){const t=this.stores?.scheduler.get("selectedTimeslot");const n=this.stores?.scheduler.get("selectedLanguage");const i=this.stores?.scheduler.get("selectedTimezone");const s=t?.start_time?new Date(t?.start_time).getTime()/1e3:"";const o=t?.end_time?new Date(t?.end_time).getTime()/1e3:"";return{additional_guests:e.guests,guest:{...e.primaryParticipant},additional_fields:{...e.additionalFields},start_time:s,end_time:o,email_language:n,timezone:i}}async bookButtonClickedHandler(e){if(e.defaultPrevented){return}const t=e.detail;const n=this.mapToBookingData(t);this.bookingInfoConfirmed=t;const i=this.nylasSchedulerConnector?.schedulerStore?.get("rescheduleBookingId");const s=i;if(s){const e=await(this.nylasSchedulerConnector?.scheduler.rescheduleBooking(s,t));if(!e||"error"in e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e?.error)},host:this.host})}const i=e?.data;const o=this.bookedEventInfo.emit({...e,data:{...i,...n}});this.bookingInfoConfirmed={...this.bookingInfoConfirmed,...i};if("bookedEventInfo"in this.eventOverrides){await this.eventOverrides.bookedEventInfo(o,this.nylasSchedulerConnector)}return}const o=await(this.nylasSchedulerConnector?.scheduler.bookTimeslot(t));if(!o||"error"in o){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(o?.error)},host:this.host})}const a=o?.data;const r=this.bookedEventInfo.emit({...o,data:{...a,...n}});this.bookingInfoConfirmed={...this.bookingInfoConfirmed,...a};if("bookedEventInfo"in this.eventOverrides){await this.eventOverrides.bookedEventInfo(r,this.nylasSchedulerConnector)}}dateSelectedHandler(e){const t=e.detail;this.selectedDateLabel=t?t.toLocaleDateString(this.language,{dateStyle:"full"}):`${r.t("noDateSelected")}`}cancelBookedEventErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}cancelBookedEventValidationErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}rescheduleBookedEventErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}confirmBookingErrorHandler(e){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(e.detail.error)},host:this.host})}feedbackModalClosedHandler(){this.showFeedbackModal=false}eventIsFullHandler(e){const t=e.detail.error;const n=e.detail.type;if(n==="error"){this.nylasSchedulerError.emit({notification:{...this.getErrorObject({message:t})},host:this.host})}else{this.nylasSchedulerInfo.emit({notification:{title:"Event is full",category:g.Component,type:y.Info,description:"The event you selected is full. Please try a different time.",id:(new Date).getTime().toString(),ttl:3e3},host:this.host})}}feedbackSubmittedHandler(e){m("Scheduling Page User Feedback",{extra:{configId:this.configurationId,slug:this.slug}});const t={message:e.detail.feedback};b(t,{includeReplay:true,captureContext:{tags:{"nylas-web-element":"nylas-scheduling","nylas-web-element-version":this.version,"nylas-config-id":this.configurationId,"nylas-slug":this.slug,"host-url":window.location.href},extra:{configId:this.configurationId,slug:this.slug,version:this.version}}});this.showFeedbackModal=false}async getNylasSchedulerStore(){return this.baseProvider?.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(e){return{title:e?.title||L.title,category:e?.category||L.category,type:y.Error,description:e?.message||"",id:(new Date).getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){let e="";if(!this.sessionId){e+=r.t("sessionIdRequiredErrorMessage")}if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){e=r.t("sessionIdRequiredErrorMessage")+" "+r.t("publicConfigErrorMessage")}this.nylasSchedulerError.emit({notification:{title:r.t("schedulingComponentErrorTitle"),category:g.Component,type:y.Error,description:e,id:(new Date).getTime().toString(),ttl:"none"},host:this.host});return false}return true}isTimeslotValid(e){const t=new Date(e.start_time);if(t<new Date){this.nylasSchedulerError.emit({notification:{title:r.t("invalidTimeslotErrorTitle"),category:g.Component,type:y.Error,description:r.t("invalidTimeslotErrorMessage"),id:(new Date).getTime().toString(),ttl:"none"},host:this.host});return false}return true}validateAvailableDaysInFuture(e,t){const n=new Date;const i=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3;const s=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3;const o=Math.floor(l(n,t).getTime()/1e3);const a=Math.min(o,s);const r=i<n.getTime()/1e3?Math.floor(n.getTime()/1e3):i;return{startTime:r,endTime:a,endTimeForAvailableDaysInFuture:o}}applyThemeConfig(e){if(e){for(const[t,n]of Object.entries(e)){this.host.style.setProperty(`${t}`,n)}}}onFeedbackClick(e){e.preventDefault();this.showFeedbackModal=true}redirectToCustomUrl(e){window.location.assign(e)}nylasFormDropdownChangedHandler(e){const{name:t,value:n}=e.detail;if(t==="language"){const e=v[n];r.changeLanguage(e);this.stores?.scheduler?.set("selectedLanguage",e)}}render(){const t=this.mode==="app";const n=this.baseProvider?.getStore("scheduler");const i=n?.get("eventInfo");const o=n?.get("showBookingForm");const a=n?.get("cancelledEventInfo");const l=n?.get("cancelBookingId");const c=n?.get("selectedTimeslot");const d=n?.get("rescheduleBookingId");const g=n?.get("organizerConfirmationBookingId");const f=n?.get("rejectBookingId");const u=n?.get("confirmedEventInfo");const p=n?.get("nylasBranding")||this.nylasBranding;const m=n?.get("selectedDate");const b=n?.get("configSettings")?.scheduler?.confirmation_redirect_url;this.selectedDateLabel=m&&this.language?h(m.toLocaleDateString(this.language,{dateStyle:"full"})):`${r.t("noDateSelected")}`;const _=Object.keys(k).map((e=>({label:k[e],value:e})));const y=n?.get("selectedLanguage")||this.defaultLanguage||navigator.language||v.en;if(t&&(l||f)&&!a){return e(s,null,e(E,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancel-flow-page",part:"cancel-flow-page"},e("nylas-cancel-booking-form",{selectedTimeslot:c,cancelBookingId:l,rejectBookingId:f,exportparts:"ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:r.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==y)),exportparts:"sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label"},e("span",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&g){return e(s,null,e(E,null,e("div",{class:"manual-confirmation-page",part:"manual-confirmation-page"},e("nylas-organizer-confirmation-card",{organizerConfirmationBookingId:g,exportparts:"nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:r.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==y)),exportparts:"sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label"},e("span",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&a){return e(s,null,e(E,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancelled-event-page",part:"cancelled-event-page"},e("nylas-cancelled-event-card",{cancelledEventInfo:a,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:r.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==y)),exportparts:"sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label"},e("span",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&u){return e(s,null,e(E,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"cancelled-event-page",part:"confirmed-event-page"},e("nylas-confirmed-event-card",{confirmedEventInfo:u,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:r.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==y)),exportparts:"sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label"},e("span",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&i&&b){const e=this.bookingInfoConfirmed?.primaryParticipant;const t=this.bookingInfoConfirmed?.location;const n=this.bookingInfoConfirmed?.booking_ref;const s=this.bookingInfoConfirmed?.additionalFields||{};if(this.bookingInfo&&typeof this.bookingInfo?.additionalFields!=="undefined"){const e=this.bookingInfo.additionalFields;Object.keys(e).forEach((t=>{if(!s[t]&&e?.[t]){s[t]=e[t].value}}))}const o=this.stores?.scheduler.get("selectedTimeslot");const a=this.stores?.scheduler.get("selectedTimezone");const r=this.stores?.scheduler.get("selectedLanguage");const l=this.stores?.scheduler.get("configSettings");const c=this.configurationId?this.configurationId:l?.configuration_id;const d=window.location.search;const h=new URLSearchParams(d);h.set("booking_id",i.booking_id);e?.name&&h.set("name",e.name);e?.email&&h.set("email",e.email);o?.start_time&&h.set("start_time",(new Date(o.start_time).getTime()/1e3).toString());o?.end_time&&h.set("end_time",(new Date(o.end_time).getTime()/1e3).toString());a&&h.set("tz",a);r&&h.set("language",r);s&&h.set("additional_values",JSON.stringify(s));this.slug&&h.set("page_slug",this.slug);c&&h.set("config_id",c);t&&h.set("location",t);n&&h.set("booking_ref",n);this.redirectToCustomUrl(`${b}?${h.toString()}`);return}if(t&&i){return e(s,null,e(E,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},e("div",{class:"booked-event-page",part:"booked-event-page ns_booked-event-page"},e("nylas-booked-event-card",{selectedTimeslot:c,eventInfo:i,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:r.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==y)),exportparts:"sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label"},e("span",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&(!i||!!d)&&!o){const t=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return e(s,null,e(E,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},d&&e(S,null,`${r.t("rescheduleTitle")}`),e("div",{class:"select-date-page",part:"select-date-page ns_select-date-page"},e("div",{class:"left-panel",part:"ns_left-panel"},e("nylas-date-picker",{exportparts:"ndp, ndp__title, ndp__month-header, ndp__month-button, ndp__day, ndp__date, ndp__date--disabled, ndp__date--selected, ndp__date--current-day, ndp__date--current-month"}),e("nylas-locale-switch",{exportparts:"nls, nls__timezone, nls__timezone-dropdown, nls__timezone-drop-button, nls__timezone-drop-button-selected-label, nls__timezone-drop-content, nls__timezone-drop-label, nls__language, nls__language-dropdown, nls__language-drop-button, nls__language-drop-content, nls__language-drop-label"})),e("div",{class:`right-panel ${d?"reschedule":""}`,part:`ns_right-panel ${d?"ns_reschedule":""}`},e("h2",{part:"ns_right-panel__title"},e("calendar-icon",{part:"ns_right-panel__calendar-icon"}),e("span",{id:"selectedDate",part:"ns_right-panel__selected-date"},this.selectedDateLabel)),e("nylas-timeslot-picker",{exportparts:"ntp, ntp__time-picker-wrapper, ntp__timeslots, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},t&&e("span",{slot:"timeslot-picker-cta-label"},e("slot",{name:"timeslot-picker-cta-label"})))))),this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),this.showFeedbackModal&&e("nylas-feedback-form",null))}if(t&&!i&&o){return e(s,null,e(E,{version:this.version,nylasBranding:p,isLoading:this.isLoading,showNotification:this.showNotification},d&&e(S,null,`${r.t("rescheduleTitle")}`),e("div",{class:"additional-data-page",part:"additional-data-page ns_additional-data-page"},e("div",{class:"left-panel ns_left-panel",part:"ns_left-panel"},e("div",{class:"wrapper",part:"ns_left-panel__wrapper"},e("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone"}))),e("div",{class:`right-panel ${d?"reschedule":""}`,part:`ns_right-panel ${d?"ns_reschedule":""}`},e("nylas-booking-form",{exportparts:"nbf, nbf__input-textfield, nbf__button-ghost, nbf__button-outline, nbf__button-primary, nbf__input-wrapper, nbf__checkbox-component, nbf__radio-button-group, nbf__textarea-component, nbf__dropdown, nbf__dropdown-button, nbf__dropdown-content"})))),e("div",{class:"language-feedback-container"},this.enableUserFeedback&&e("button-component",{id:"report-issue",variant:"basic",onClick:e=>this.onFeedbackClick(e)},e("feedback-icon",null)),e("select-dropdown",{name:"language",searchPlaceholder:r.t("search"),options:_,withChevron:false,themeConfig:this.themeConfig,defaultSelectedOption:_.find((e=>e.value==y)),exportparts:"sd_dropdown: nse__language-dropdown, sd_dropdown-button: nse__language-drop-button, sd_dropdown-content: nse__language-drop-content, sd_dropdown_label: nse__language-drop-label"},e("span",{slot:"select-icon"},e("translate-icon",{width:"20",height:"20"})))),this.showFeedbackModal&&e("nylas-feedback-form",null))}return e(s,null,e("slot",null))}get host(){return o(this)}static get watchers(){return{bookingInfo:["bookingInfoChanged"],rescheduleBookingRef:["rescheduleBookingRefChanged"],cancelBookingRef:["cancelBookingRefChanged"],organizerConfirmationBookingRef:["organizerConfirmationBookingRefChanged"],localization:["localizationChanged"],defaultLanguage:["defaultLanguageChanged"],themeConfig:["themeConfigChanged"]}}};D.style=B;export{D as nylas_scheduling};
|
|
2
|
+
//# sourceMappingURL=p-dbad0a98.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-button-group.entry.esm.js","sources":["src/components/design-system/radio-button-group/radio-button-group.scss?tag=radio-button-group&encapsulation=shadow","src/components/design-system/radio-button-group/radio-button-group.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n@use '../../../common/mixins/inputs' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: 100%;\n}\n\n.radio-group {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n\n slot[name='label'] {\n @include input-label;\n font-size: 16px;\n\n p {\n margin: 0;\n\n &.error {\n color: var(--nylas-error);\n }\n }\n\n .error {\n color: var(--nylas-error);\n }\n }\n\n span.error {\n color: var(--nylas-error);\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n font-family: var(--nylas-font-family);\n }\n\n label {\n display: flex;\n\n font-family: var(--nylas-font-family);\n cursor: pointer;\n\n .radio-option {\n display: flex;\n align-items: flex-start;\n gap: 0.5rem;\n\n input[type='radio'] {\n cursor: pointer;\n }\n\n input[type='radio' i] {\n width: 20px;\n height: 20px;\n color: var(--nylas-primary);\n }\n\n p {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin: 0;\n\n .title {\n font-size: 16px;\n font-weight: 500;\n line-height: 20px;\n color: var(--nylas-base-800);\n }\n\n .description {\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n }\n }\n }\n }\n}\n","// src/components/radio-group/radio-group.tsx\nimport { ThemeConfig } from '@nylas/core';\nimport { Component, h, Prop, State, Event, EventEmitter, Listen, Element, Watch } from '@stencil/core';\n\n/**\n * The `radio-button-group` component is a UI component that allows users to select a single option from a list of options.\n * This component is used in the scheduling form to input radio button type inputs.\n */\n@Component({\n tag: 'radio-button-group',\n styleUrl: 'radio-button-group.scss',\n shadow: true,\n})\nexport class RadioButtonGroup {\n @Element() el!: HTMLElement;\n private readonly componentType: string = 'radio-group';\n\n /**\n * The name of the radio group. This is used to identify the radio group when submitting a form.\n */\n @Prop() name: string = 'radio-group';\n /**\n * The list of options in the radio group.\n * Each option has a label and a value and an optional description.\n */\n @Prop() options: { label: string; value: string; description?: string }[] = [];\n /**\n * The default selected value of the radio group.\n */\n @Prop({ attribute: 'default-selected-value' }) defaultSelectedValue: string = '';\n /**\n * The label of the radio group. This is displayed above the radio group.\n * Label is optional. You can also use the slot 'label' to add a label.\n */\n @Prop() label?: string;\n /**\n * Whether the radio group is required. If true, the radio group must have a value when submitting a form.\n * Default is false. If the radio group is required and the value is empty, an error message is displayed.\n */\n @Prop() required: boolean = false;\n /**\n * The property to make the radio group read-only. If true, the radio group cannot be edited.\n */\n @Prop() readOnly: boolean = false;\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n /**\n * Error message to display when the radio group is required and no value is selected.\n */\n @Prop() errorMessage: string = '';\n /**\n * The selected value of the radio group.\n */\n @State() selectedValue!: string;\n /**\n * The error message state.\n */\n @State() error: string = '';\n /**\n * This event is fired when the selected value changes.\n */\n @Event() nylasFormRadioChanged!: EventEmitter<{\n value: string;\n name: string;\n label?: string;\n }>;\n\n @Watch('defaultSelectedValue')\n handleDefaultSelectedValueChange(newValue: string) {\n this.selectedValue = newValue;\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.el.style.setProperty(`${key}`, value);\n }\n }\n }\n\n // Lifecycle methods\n connectedCallback() {\n // Use queueMicrotask to defer theme application until after React has set props.\n // This fixes the timing issue where connectedCallback fires before React sets themeConfig.\n queueMicrotask(() => {\n if (this.themeConfig) {\n this.applyThemeConfig(this.themeConfig);\n this.el.setAttribute('data-themed', '');\n }\n });\n }\n\n componentDidLoad() {\n this.selectedValue = this.defaultSelectedValue;\n }\n\n // Event listeners\n /**\n * Listen for the bookingFormSubmitted event to validate the input value when the form is submitted.\n */\n @Listen('bookingFormSubmitted', { target: 'document' })\n handleBookingFormSubmitted(event: CustomEvent) {\n if (this.required && !this.selectedValue) {\n this.error = this.errorMessage || `${this.label} is required.`;\n return;\n }\n if (this.error) {\n event.preventDefault();\n }\n }\n\n componentWillLoad() {\n this.el.setAttribute('component-type', this.componentType);\n }\n\n handleChange(value: string) {\n this.error = '';\n this.selectedValue = value;\n this.nylasFormRadioChanged.emit({\n value,\n name: this.name,\n label: this.label,\n });\n }\n\n render() {\n return (\n <div class=\"radio-group\">\n <slot name=\"label\">\n {this.label && (\n <p class={{ error: !!this.error }}>\n <span class=\"label\">{this.label}</span>\n {this.required && <span class=\"required\">*</span>}\n </p>\n )}\n </slot>\n {this.options.map(option => (\n <label>\n <div class=\"radio-option\">\n <input\n type=\"radio\"\n disabled={this.readOnly}\n readOnly={this.readOnly}\n title={this.readOnly ? 'read-only field' : undefined}\n name={this.name}\n value={option.value}\n checked={this.selectedValue === option.value}\n onChange={() => this.handleChange(option.value)}\n />\n <p>\n <span class=\"title\">{option.label}</span>\n <span class=\"description\">{option.description}</span>\n </p>\n </div>\n </label>\n ))}\n {this.error && <span class=\"error help-text\">{this.error}</span>}\n </div>\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,mBAAmB,GAAG,k/GAAk/G;;MCajgH,gBAAgB,GAAA,MAAA;AAL7B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAOmB,QAAA,IAAa,CAAA,aAAA,GAAW,aAAa;AAK9C,QAAA,IAAI,CAAA,IAAA,GAAW,aAAa;AAK5B,QAAA,IAAO,CAAA,OAAA,GAA6D,EAAE;AAI/B,QAAA,IAAoB,CAAA,oBAAA,GAAW,EAAE;AAUxE,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAIzB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAQzB,QAAA,IAAY,CAAA,YAAA,GAAW,EAAE;AAQxB,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;AA6G5B;AAlGC,IAAA,gCAAgC,CAAC,QAAgB,EAAA;AAC/C,QAAA,IAAI,CAAC,aAAa,GAAG,QAAQ;;IAI/B,yBAAyB,CAAC,MAAmB,EAAE,MAAmB,EAAA;QAChE,IAAI,MAAM,KAAK,MAAM;YAAE;AACvB,QAAA,IAAI,CAAC,gBAAgB,C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,CAAA,CAAA,GAAA,EAAA,IAAA,EACE,CAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,OAAO,IAAE,MAAM,CAAC,KAAK,CAAQ,EACzC,CAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,aAAa,EAAA,EAAE,MAAM,CAAC,WAAW,CAAQ,CACnD,CACA,CACA,CACT,CAAC,EACD,IAAI,CAAC,KAAK,IAAI,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,iBAAiB,EAAE,EAAA,IAAI,CAAC,KAAK,CAAQ,CAC5D;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"radio-button-group.entry.esm.js","sources":["src/components/design-system/radio-button-group/radio-button-group.scss?tag=radio-button-group&encapsulation=shadow","src/components/design-system/radio-button-group/radio-button-group.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n@use '../../../common/mixins/inputs' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: 100%;\n}\n\n.radio-group {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n\n slot[name='label'] {\n @include input-label;\n font-size: 16px;\n\n p {\n margin: 0;\n\n &.error {\n color: var(--nylas-error);\n }\n }\n\n .error {\n color: var(--nylas-error);\n }\n }\n\n span.error {\n color: var(--nylas-error);\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n font-family: var(--nylas-font-family);\n }\n\n label {\n display: flex;\n\n font-family: var(--nylas-font-family);\n cursor: pointer;\n\n .radio-option {\n display: flex;\n align-items: flex-start;\n gap: 0.5rem;\n\n input[type='radio'] {\n cursor: pointer;\n }\n\n input[type='radio' i] {\n width: 20px;\n height: 20px;\n color: var(--nylas-primary);\n }\n\n p {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin: 0;\n\n .title {\n font-size: 16px;\n font-weight: 500;\n line-height: 20px;\n color: var(--nylas-base-800);\n word-break: break-word;\n overflow-wrap: break-word;\n }\n\n .description {\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n }\n }\n }\n }\n}\n","// src/components/radio-group/radio-group.tsx\nimport { ThemeConfig } from '@nylas/core';\nimport { Component, h, Prop, State, Event, EventEmitter, Listen, Element, Watch } from '@stencil/core';\n\n/**\n * The `radio-button-group` component is a UI component that allows users to select a single option from a list of options.\n * This component is used in the scheduling form to input radio button type inputs.\n */\n@Component({\n tag: 'radio-button-group',\n styleUrl: 'radio-button-group.scss',\n shadow: true,\n})\nexport class RadioButtonGroup {\n @Element() el!: HTMLElement;\n private readonly componentType: string = 'radio-group';\n\n /**\n * The name of the radio group. This is used to identify the radio group when submitting a form.\n */\n @Prop() name: string = 'radio-group';\n /**\n * The list of options in the radio group.\n * Each option has a label and a value and an optional description.\n */\n @Prop() options: { label: string; value: string; description?: string }[] = [];\n /**\n * The default selected value of the radio group.\n */\n @Prop({ attribute: 'default-selected-value' }) defaultSelectedValue: string = '';\n /**\n * The label of the radio group. This is displayed above the radio group.\n * Label is optional. You can also use the slot 'label' to add a label.\n */\n @Prop() label?: string;\n /**\n * Whether the radio group is required. If true, the radio group must have a value when submitting a form.\n * Default is false. If the radio group is required and the value is empty, an error message is displayed.\n */\n @Prop() required: boolean = false;\n /**\n * The property to make the radio group read-only. If true, the radio group cannot be edited.\n */\n @Prop() readOnly: boolean = false;\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n /**\n * Error message to display when the radio group is required and no value is selected.\n */\n @Prop() errorMessage: string = '';\n /**\n * The selected value of the radio group.\n */\n @State() selectedValue!: string;\n /**\n * The error message state.\n */\n @State() error: string = '';\n /**\n * This event is fired when the selected value changes.\n */\n @Event() nylasFormRadioChanged!: EventEmitter<{\n value: string;\n name: string;\n label?: string;\n }>;\n\n @Watch('defaultSelectedValue')\n handleDefaultSelectedValueChange(newValue: string) {\n this.selectedValue = newValue;\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.el.style.setProperty(`${key}`, value);\n }\n }\n }\n\n // Lifecycle methods\n connectedCallback() {\n // Use queueMicrotask to defer theme application until after React has set props.\n // This fixes the timing issue where connectedCallback fires before React sets themeConfig.\n queueMicrotask(() => {\n if (this.themeConfig) {\n this.applyThemeConfig(this.themeConfig);\n this.el.setAttribute('data-themed', '');\n }\n });\n }\n\n componentDidLoad() {\n this.selectedValue = this.defaultSelectedValue;\n }\n\n // Event listeners\n /**\n * Listen for the bookingFormSubmitted event to validate the input value when the form is submitted.\n */\n @Listen('bookingFormSubmitted', { target: 'document' })\n handleBookingFormSubmitted(event: CustomEvent) {\n if (this.required && !this.selectedValue) {\n this.error = this.errorMessage || `${this.label} is required.`;\n return;\n }\n if (this.error) {\n event.preventDefault();\n }\n }\n\n componentWillLoad() {\n this.el.setAttribute('component-type', this.componentType);\n }\n\n handleChange(value: string) {\n this.error = '';\n this.selectedValue = value;\n this.nylasFormRadioChanged.emit({\n value,\n name: this.name,\n label: this.label,\n });\n }\n\n render() {\n return (\n <div class=\"radio-group\">\n <slot name=\"label\">\n {this.label && (\n <p class={{ error: !!this.error }}>\n <span class=\"label\">{this.label}</span>\n {this.required && <span class=\"required\">*</span>}\n </p>\n )}\n </slot>\n {this.options.map(option => (\n <label>\n <div class=\"radio-option\">\n <input\n type=\"radio\"\n disabled={this.readOnly}\n readOnly={this.readOnly}\n title={this.readOnly ? 'read-only field' : undefined}\n name={this.name}\n value={option.value}\n checked={this.selectedValue === option.value}\n onChange={() => this.handleChange(option.value)}\n />\n <p>\n <span class=\"title\">{option.label}</span>\n <span class=\"description\">{option.description}</span>\n </p>\n </div>\n </label>\n ))}\n {this.error && <span class=\"error help-text\">{this.error}</span>}\n </div>\n );\n }\n}\n"],"names":[],"mappings":";;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AM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,UAAU,EAAA,EAAA,GAAA,CAAS,CAC/C,CACL,CACI,EACN,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,KACtB,CAAA,CAAA,OAAA,EAAA,IAAA,EACE,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,cAAc,EAAA,EACvB,CAAA,CAAA,OAAA,EAAA,EACE,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,KAAK,EAAE,IAAI,CAAC,QAAQ,GAAG,iBAAiB,GAAG,SAAS,EACpD,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,OAAO,EAAE,IAAI,CAAC,aAAa,KAAK,MAAM,CAAC,KAAK,EAC5C,QAAQ,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,EAC/C,CAAA,EACF,CAAA,CAAA,GAAA,EAAA,IAAA,EACE,CAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,OAAO,IAAE,MAAM,CAAC,KAAK,CAAQ,EACzC,CAAA,CAAA,MAAA,EAAA,EAAM,KAAK,EAAC,aAAa,EAAA,EAAE,MAAM,CAAC,WAAW,CAAQ,CACnD,CACA,CACA,CACT,CAAC,EACD,IAAI,CAAC,KAAK,IAAI,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,iBAAiB,EAAE,EAAA,IAAI,CAAC,KAAK,CAAQ,CAC5D;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea-component.entry.esm.js","sources":["src/components/design-system/textarea-component/textarea-component.scss?tag=textarea-component&encapsulation=shadow","src/components/design-system/textarea-component/textarea-component.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n@use '../../../common/mixins/inputs' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: 100%;\n}\n\nlabel {\n @include input-label;\n flex-direction: column;\n gap: 4px;\n font-family: var(--nylas-font-family);\n font-size: 16px;\n color: var(--nylas-base-800);\n\n p {\n margin: 0;\n display: flex;\n gap: 4px;\n align-items: center;\n }\n\n .error {\n color: var(--nylas-error);\n }\n}\n\ntextarea {\n @include textfield;\n padding: 12px 16px;\n border-width: 1;\n resize: vertical;\n border-radius: 8px;\n font-family: var(--nylas-font-family);\n font-size: 16px;\n line-height: 24px;\n\n &::-webkit-resizer {\n display: none;\n }\n}\n\ntextarea:read-only {\n background-color: var(--nylas-base-100);\n cursor: not-allowed;\n}\n","import { sanitize } from '@/utils/utils';\nimport { ThemeConfig } from '@nylas/core';\nimport { Component, h, Prop, State, Event, EventEmitter, Listen, Watch, Element } from '@stencil/core';\n\n/**\n * `textarea-component` allows users to enter multiline text.\n * It is ideal for larger inputs like comments or messages in a form.\n * This component is used in the scheduling form to input multiline text.\n *\n * @part tc__label - The label for the textarea.\n * @part tc__textarea - The textarea element.\n */\n@Component({\n tag: 'textarea-component',\n styleUrl: 'textarea-component.scss',\n shadow: true,\n})\nexport class TextareaComponent {\n @Element() el!: HTMLElement;\n\n /**\n * The name of the textarea, important for form submissions.\n */\n @Prop() name: string = 'textarea';\n\n /**\n * The default value of the textarea, appearing when the component first renders.\n */\n @Prop() defaultValue?: string;\n\n /**\n * The label for the textarea, displayed above it.\n */\n @Prop() label: string = '';\n\n /**\n * Placeholder text shown in the textarea when it is empty.\n */\n @Prop() placeholder: string = '';\n\n /**\n * Specifies if the textarea is required for form submission.\n * If true, an error message shows if left empty.\n */\n @Prop() required: boolean = false;\n\n /**\n * If true, the textarea cannot be edited by the user.\n */\n @Prop() readOnly: boolean = false;\n\n /**\n * Automatically focus the textarea when the component loads.\n */\n @Prop() autoFocus: boolean = false;\n\n /**\n * The maximum number of characters allowed in the textarea.\n */\n @Prop() maxLength: number = 255;\n\n /**\n * The type\n */\n @Prop() type: string = 'multi_line_text';\n\n /**\n * The content of the label's tooltip\n */\n @Prop() tooltip: string = '';\n\n /**\n * Error message to display when the textarea is required and empty.\n */\n @Prop() errorMessage: string = '';\n\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * State for the current value of the textarea.\n */\n @State() value: string = '';\n\n /**\n * State for managing the display of any error messages.\n */\n @State() error: string = '';\n\n /**\n * Event emitted when the value of the textarea changes.\n * Useful for parent components to capture user input.\n */\n @Event() nylasFormInputChanged!: EventEmitter<{ value: string; name: string; error: string; label: string; type: string }>;\n\n connectedCallback() {\n // Use queueMicrotask to defer theme application until after React has set props.\n // This fixes the timing issue where connectedCallback fires before React sets themeConfig.\n queueMicrotask(() => {\n if (this.themeConfig) {\n this.applyThemeConfig(this.themeConfig);\n this.el.setAttribute('data-themed', '');\n }\n });\n }\n\n /**\n * Lifecycle method that runs before the component loads.\n * It sets the initial value and cleans it using sanitize-html.\n */\n componentDidLoad() {\n this.value = sanitize(this.defaultValue || '');\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.el.style.setProperty(`${key}`, value);\n }\n }\n }\n\n // Event listeners\n /**\n * Listen for the bookingFormSubmitted event to validate the input value when the form is submitted.\n */\n @Listen('bookingFormSubmitted', { target: 'document' })\n handleBookingFormSubmitted(event: CustomEvent) {\n this.validate(this.value);\n if (this.error) {\n event.preventDefault();\n }\n }\n\n @Listen('triggerValidation', { target: 'document' })\n handletriggerValidation(event: CustomEvent) {\n this.validate(this.value);\n if (this.error) {\n event.preventDefault();\n }\n }\n\n /**\n * Handles user input in the textarea, updating the value and emitting an event.\n */\n handleInput(e: Event) {\n this.error = '';\n const inputElement = e.target as HTMLTextAreaElement;\n this.value = sanitize(inputElement.value);\n this.nylasFormInputChanged.emit({\n value: this.value,\n name: this.name,\n error: this.error,\n label: this.label,\n type: this.type,\n });\n }\n\n /**\n * Validates the textarea value based on the required prop and maxLength.\n * If the value is invalid, an error message is displayed.\n */\n validate(value: string) {\n if (this.required && !value) {\n this.error = this.errorMessage || `${this.label} is required.`;\n } else if (value.length > this.maxLength) {\n this.error = `${this.label} cannot exceed ${this.maxLength} characters.`;\n } else {\n this.error = '';\n }\n }\n\n /**\n * Renders the component UI including the label, textarea, and any error messages.\n */\n render() {\n return (\n <label part=\"tc__label\" class={{ error: !!this.error }}>\n <p>\n <span class=\"label\">{this.label}</span>\n {this.required && <span class=\"required\">*</span>}\n {this.tooltip && (\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{this.tooltip}</span>\n </tooltip-component>\n )}\n </p>\n <textarea\n name={this.name}\n title={this.readOnly ? 'read-only field' : undefined}\n placeholder={this.placeholder}\n readOnly={this.readOnly}\n autoFocus={this.autoFocus}\n value={this.value}\n maxLength={this.maxLength}\n onInput={e => this.handleInput(e)}\n class={{ error: !!this.error }}\n part=\"tc__textarea\"\n />\n {this.error && <span class=\"error help-text\">{this.error}</span>}\n </label>\n );\n }\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,oBAAoB,GAAG,+7GAA+7G;;MCiB/8G,iBAAiB,GAAA,MAAA;AAL9B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAWU,QAAA,IAAI,CAAA,IAAA,GAAW,UAAU;AAUzB,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;AAKlB,QAAA,IAAW,CAAA,WAAA,GAAW,EAAE;AAMxB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAKzB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAKzB,QAAA,IAAS,CAAA,SAAA,GAAY,KAAK;AAK1B,QAAA,IA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file":"textarea-component.entry.esm.js","sources":["src/components/design-system/textarea-component/textarea-component.scss?tag=textarea-component&encapsulation=shadow","src/components/design-system/textarea-component/textarea-component.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n@use '../../../common/mixins/inputs' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: 100%;\n}\n\nlabel {\n @include input-label;\n flex-direction: column;\n gap: 4px;\n font-family: var(--nylas-font-family);\n font-size: 16px;\n color: var(--nylas-base-800);\n\n p {\n margin: 0;\n display: flex;\n gap: 4px;\n align-items: center;\n }\n\n .error {\n color: var(--nylas-error);\n }\n}\n\ntextarea {\n @include textfield;\n padding: 12px 16px;\n border-width: 1;\n resize: vertical;\n border-radius: 8px;\n font-family: var(--nylas-font-family);\n font-size: 16px;\n line-height: 24px;\n\n &::-webkit-resizer {\n display: none;\n }\n}\n\ntextarea:read-only {\n background-color: var(--nylas-base-100);\n cursor: not-allowed;\n}\n","import { sanitize } from '@/utils/utils';\nimport { ThemeConfig } from '@nylas/core';\nimport { Component, h, Prop, State, Event, EventEmitter, Listen, Watch, Element } from '@stencil/core';\n\n/**\n * `textarea-component` allows users to enter multiline text.\n * It is ideal for larger inputs like comments or messages in a form.\n * This component is used in the scheduling form to input multiline text.\n *\n * @part tc__label - The label for the textarea.\n * @part tc__textarea - The textarea element.\n */\n@Component({\n tag: 'textarea-component',\n styleUrl: 'textarea-component.scss',\n shadow: true,\n})\nexport class TextareaComponent {\n @Element() el!: HTMLElement;\n\n /**\n * The name of the textarea, important for form submissions.\n */\n @Prop() name: string = 'textarea';\n\n /**\n * The default value of the textarea, appearing when the component first renders.\n */\n @Prop() defaultValue?: string;\n\n /**\n * The label for the textarea, displayed above it.\n */\n @Prop() label: string = '';\n\n /**\n * Placeholder text shown in the textarea when it is empty.\n */\n @Prop() placeholder: string = '';\n\n /**\n * Specifies if the textarea is required for form submission.\n * If true, an error message shows if left empty.\n */\n @Prop() required: boolean = false;\n\n /**\n * If true, the textarea cannot be edited by the user.\n */\n @Prop() readOnly: boolean = false;\n\n /**\n * Automatically focus the textarea when the component loads.\n */\n @Prop() autoFocus: boolean = false;\n\n /**\n * The maximum number of characters allowed in the textarea.\n */\n @Prop() maxLength: number = 255;\n\n /**\n * The type\n */\n @Prop() type: string = 'multi_line_text';\n\n /**\n * The content of the label's tooltip\n */\n @Prop() tooltip: string = '';\n\n /**\n * Error message to display when the textarea is required and empty.\n */\n @Prop() errorMessage: string = '';\n\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n\n /**\n * State for the current value of the textarea.\n */\n @State() value: string = '';\n\n /**\n * State for managing the display of any error messages.\n */\n @State() error: string = '';\n\n /**\n * Event emitted when the value of the textarea changes.\n * Useful for parent components to capture user input.\n */\n @Event() nylasFormInputChanged!: EventEmitter<{ value: string; name: string; error: string; label: string; type: string }>;\n\n connectedCallback() {\n // Use queueMicrotask to defer theme application until after React has set props.\n // This fixes the timing issue where connectedCallback fires before React sets themeConfig.\n queueMicrotask(() => {\n if (this.themeConfig) {\n this.applyThemeConfig(this.themeConfig);\n this.el.setAttribute('data-themed', '');\n }\n });\n }\n\n /**\n * Lifecycle method that runs before the component loads.\n * It sets the initial value and cleans it using sanitize-html.\n */\n componentDidLoad() {\n this.value = sanitize(this.defaultValue || '');\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.el.style.setProperty(`${key}`, value);\n }\n }\n }\n\n // Event listeners\n /**\n * Listen for the bookingFormSubmitted event to validate the input value when the form is submitted.\n */\n @Listen('bookingFormSubmitted', { target: 'document' })\n handleBookingFormSubmitted(event: CustomEvent) {\n this.validate(this.value);\n if (this.error) {\n event.preventDefault();\n }\n }\n\n @Listen('triggerValidation', { target: 'document' })\n handletriggerValidation(event: CustomEvent) {\n this.validate(this.value);\n if (this.error) {\n event.preventDefault();\n }\n }\n\n /**\n * Handles user input in the textarea, updating the value and emitting an event.\n */\n handleInput(e: Event) {\n this.error = '';\n const inputElement = e.target as HTMLTextAreaElement;\n this.value = sanitize(inputElement.value);\n this.nylasFormInputChanged.emit({\n value: this.value,\n name: this.name,\n error: this.error,\n label: this.label,\n type: this.type,\n });\n }\n\n /**\n * Validates the textarea value based on the required prop and maxLength.\n * If the value is invalid, an error message is displayed.\n */\n validate(value: string) {\n if (this.required && !value) {\n this.error = this.errorMessage || `${this.label} is required.`;\n } else if (value.length > this.maxLength) {\n this.error = `${this.label} cannot exceed ${this.maxLength} characters.`;\n } else {\n this.error = '';\n }\n }\n\n /**\n * Renders the component UI including the label, textarea, and any error messages.\n */\n render() {\n return (\n <label part=\"tc__label\" class={{ error: !!this.error }}>\n <p>\n <span class=\"label\">{this.label}</span>\n {this.required && <span class=\"required\">*</span>}\n {this.tooltip && (\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">{this.tooltip}</span>\n </tooltip-component>\n )}\n </p>\n <textarea\n name={this.name}\n title={this.readOnly ? 'read-only field' : undefined}\n placeholder={this.placeholder}\n readOnly={this.readOnly}\n autoFocus={this.autoFocus}\n value={this.value}\n maxLength={this.maxLength}\n onInput={e => this.handleInput(e)}\n class={{ error: !!this.error }}\n part=\"tc__textarea\"\n />\n {this.error && <span class=\"error help-text\">{this.error}</span>}\n </label>\n );\n }\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,oBAAoB,GAAG,8+GAA8+G;;MCiB9/G,iBAAiB,GAAA,MAAA;AAL9B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAWU,QAAA,IAAI,CAAA,IAAA,GAAW,UAAU;AAUzB,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;AAKlB,QAAA,IAAW,CAAA,WAAA,GAAW,EAAE;AAMxB,QAAA,IAAQ,CAAA,Q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EAAA,0CAAA,EAAM,KAAK,EAAC,iBAAiB,EAAE,EAAA,IAAI,CAAC,KAAK,CAAQ,CAC1D;;;;;;;;;;;"}
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.3.
|
|
1
|
+
export declare const version = "2.3.3-canary-20260206145315";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-Dd9ZfJbD.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,k/GAAk/G;;MCajgH,gBAAgB,GAAAA,kBAAA,CAAA,MAAA,gBAAA,SAAAC,CAAA,CAAA;AAL7B,IAAA,WAAA,GAAA;;;;;AAOmB,QAAA,IAAa,CAAA,aAAA,GAAW,aAAa;AAK9C,QAAA,IAAI,CAAA,IAAA,GAAW,aAAa;AAK5B,QAAA,IAAO,CAAA,OAAA,GAA6D,EAAE;AAI/B,QAAA,IAAoB,CAAA,oBAAA,GAAW,EAAE;AAUxE,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAIzB,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAQzB,QAAA,IAAY,CAAA,YAAA,GAAW,EAAE;AAQxB,QAAA,IAAK,CAAA,KAAA,GAAW,EAAE;AA6G5B;AAlGC,IAAA,gCAAgC,CAAC,QAAgB,EAAA;AAC/C,QAAA,IAAI,CAAC,aAAa,GAAG,QAAQ;;IAI/B,yBAAyB,CAAC,MAAmB,EAAE,MAAmB,EAAA;QAChE,IAAI,MAAM,KAAK,MAAM;YAAE;AACvB,QAAA,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC;;AAG/B,IAAA,gBAAgB,CAAC,WAAyB,EAAA;QACxC,IAAI,WAAW,EAAE;AACf,YAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;AACtD,gBAAA,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,WA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D,IAAI,CAAC,KAAK,IAAI,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,KAAK,EAAC,iBAAiB,EAAE,EAAA,IAAI,CAAC,KAAK,CAAQ,CAC5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/design-system/radio-button-group/radio-button-group.scss?tag=radio-button-group&encapsulation=shadow","src/components/design-system/radio-button-group/radio-button-group.tsx"],"sourcesContent":["@use '../../../common/styles/variables' as *;\n@use '../../../common/mixins/inputs' as *;\n\n:host {\n display: block;\n @include default-css-variables;\n width: 100%;\n}\n\n.radio-group {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n\n slot[name='label'] {\n @include input-label;\n font-size: 16px;\n\n p {\n margin: 0;\n\n &.error {\n color: var(--nylas-error);\n }\n }\n\n .error {\n color: var(--nylas-error);\n }\n }\n\n span.error {\n color: var(--nylas-error);\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n font-family: var(--nylas-font-family);\n }\n\n label {\n display: flex;\n\n font-family: var(--nylas-font-family);\n cursor: pointer;\n\n .radio-option {\n display: flex;\n align-items: flex-start;\n gap: 0.5rem;\n\n input[type='radio'] {\n cursor: pointer;\n }\n\n input[type='radio' i] {\n width: 20px;\n height: 20px;\n color: var(--nylas-primary);\n }\n\n p {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin: 0;\n\n .title {\n font-size: 16px;\n font-weight: 500;\n line-height: 20px;\n color: var(--nylas-base-800);\n }\n\n .description {\n font-size: 14px;\n font-weight: 400;\n line-height: 20px;\n color: var(--nylas-base-600);\n }\n }\n }\n }\n}\n","// src/components/radio-group/radio-group.tsx\nimport { ThemeConfig } from '@nylas/core';\nimport { Component, h, Prop, State, Event, EventEmitter, Listen, Element, Watch } from '@stencil/core';\n\n/**\n * The `radio-button-group` component is a UI component that allows users to select a single option from a list of options.\n * This component is used in the scheduling form to input radio button type inputs.\n */\n@Component({\n tag: 'radio-button-group',\n styleUrl: 'radio-button-group.scss',\n shadow: true,\n})\nexport class RadioButtonGroup {\n @Element() el!: HTMLElement;\n private readonly componentType: string = 'radio-group';\n\n /**\n * The name of the radio group. This is used to identify the radio group when submitting a form.\n */\n @Prop() name: string = 'radio-group';\n /**\n * The list of options in the radio group.\n * Each option has a label and a value and an optional description.\n */\n @Prop() options: { label: string; value: string; description?: string }[] = [];\n /**\n * The default selected value of the radio group.\n */\n @Prop({ attribute: 'default-selected-value' }) defaultSelectedValue: string = '';\n /**\n * The label of the radio group. This is displayed above the radio group.\n * Label is optional. You can also use the slot 'label' to add a label.\n */\n @Prop() label?: string;\n /**\n * Whether the radio group is required. If true, the radio group must have a value when submitting a form.\n * Default is false. If the radio group is required and the value is empty, an error message is displayed.\n */\n @Prop() required: boolean = false;\n /**\n * The property to make the radio group read-only. If true, the radio group cannot be edited.\n */\n @Prop() readOnly: boolean = false;\n /**\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: ThemeConfig;\n /**\n * Error message to display when the radio group is required and no value is selected.\n */\n @Prop() errorMessage: string = '';\n /**\n * The selected value of the radio group.\n */\n @State() selectedValue!: string;\n /**\n * The error message state.\n */\n @State() error: string = '';\n /**\n * This event is fired when the selected value changes.\n */\n @Event() nylasFormRadioChanged!: EventEmitter<{\n value: string;\n name: string;\n label?: string;\n }>;\n\n @Watch('defaultSelectedValue')\n handleDefaultSelectedValueChange(newValue: string) {\n this.selectedValue = newValue;\n }\n\n @Watch('themeConfig')\n themeConfigChangedHandler(newVal: ThemeConfig, oldVal: ThemeConfig) {\n if (newVal === oldVal) return;\n this.applyThemeConfig(newVal);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.el.style.setProperty(`${key}`, value);\n }\n }\n }\n\n // Lifecycle methods\n connectedCallback() {\n // Use queueMicrotask to defer theme application until after React has set props.\n // This fixes the timing issue where connectedCallback fires before React sets themeConfig.\n queueMicrotask(() => {\n if (this.themeConfig) {\n this.applyThemeConfig(this.themeConfig);\n this.el.setAttribute('data-themed', '');\n }\n });\n }\n\n componentDidLoad() {\n this.selectedValue = this.defaultSelectedValue;\n }\n\n // Event listeners\n /**\n * Listen for the bookingFormSubmitted event to validate the input value when the form is submitted.\n */\n @Listen('bookingFormSubmitted', { target: 'document' })\n handleBookingFormSubmitted(event: CustomEvent) {\n if (this.required && !this.selectedValue) {\n this.error = this.errorMessage || `${this.label} is required.`;\n return;\n }\n if (this.error) {\n event.preventDefault();\n }\n }\n\n componentWillLoad() {\n this.el.setAttribute('component-type', this.componentType);\n }\n\n handleChange(value: string) {\n this.error = '';\n this.selectedValue = value;\n this.nylasFormRadioChanged.emit({\n value,\n name: this.name,\n label: this.label,\n });\n }\n\n render() {\n return (\n <div class=\"radio-group\">\n <slot name=\"label\">\n {this.label && (\n <p class={{ error: !!this.error }}>\n <span class=\"label\">{this.label}</span>\n {this.required && <span class=\"required\">*</span>}\n </p>\n )}\n </slot>\n {this.options.map(option => (\n <label>\n <div class=\"radio-option\">\n <input\n type=\"radio\"\n disabled={this.readOnly}\n readOnly={this.readOnly}\n title={this.readOnly ? 'read-only field' : undefined}\n name={this.name}\n value={option.value}\n checked={this.selectedValue === option.value}\n onChange={() => this.handleChange(option.value)}\n />\n <p>\n <span class=\"title\">{option.label}</span>\n <span class=\"description\">{option.description}</span>\n </p>\n </div>\n </label>\n ))}\n {this.error && <span class=\"error help-text\">{this.error}</span>}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,h as s,c as o,a}from"./p-0EQQA0nE.js";const t=".sc-chevron-icon-h{display:flex}";const r=class{constructor(s){e(this,s);this.width="24";this.height="24"}render(){return s("svg",{key:"60dd2df5199cd3641409db56d39337e87b3dee1c",xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"none"},s("path",{key:"828c6f650110c7806b1bd2cf69499d1fb3d75c71",fill:"currentColor",d:"M15.53 4.22a.75.75 0 0 1 0 1.06L8.81 12l6.72 6.72a.75.75 0 1 1-1.06 1.06l-7.25-7.25a.75.75 0 0 1 0-1.06l7.25-7.25a.75.75 0 0 1 1.06 0Z"}))}};r.style=t;const n=".sc-search-icon-h{display:flex}";const l=class{constructor(s){e(this,s);this.width="15";this.height="15"}render(){return s("svg",{key:"0a6b4e463cc466a6e13e812e7e280e3645d0138e",width:this.width,height:this.height,fill:"none",xmlns:"http://www.w3.org/2000/svg"},s("path",{key:"268559536f75c26bb912e48705eb8496e3fcb60c",fill:"currentColor",d:"M5.5 0C8.53757 0 11 2.46243 11 5.5C11 6.83879 10.5217 8.06586 9.72656 9.01962L13.8536 13.1464C14.0488 13.3417 14.0488 13.6583 13.8536 13.8536C13.68 14.0271 13.4106 14.0464 13.2157 13.9114L13.1464 13.8536L9.01962 9.72656C8.06586 10.5217 6.83879 11 5.5 11C2.46243 11 0 8.53757 0 5.5C0 2.46243 2.46243 0 5.5 0ZM5.5 1C3.01472 1 1 3.01472 1 5.5C1 7.98528 3.01472 10 5.5 10C7.98528 10 10 7.98528 10 5.5C10 3.01472 7.98528 1 5.5 1Z"}))}};l.style=n;const i=':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:100%}@media screen and (max-width: 768px){:host{position:unset}}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}.dropdown{display:inline-block;width:inherit}.dropbtn{color:var(--nylas-base-800);padding:14px;font-size:16px;font-family:var(--nylas-font-family);cursor:pointer;display:flex;justify-content:space-between;gap:0.5rem;background:var(--nylas-base-0);border:1px solid var(--nylas-base-300);border-radius:var(--nylas-border-radius-2x)}.dropbtn.error{border:1px solid var(--nylas-error)}.dropbtn:hover,.dropbtn:active{outline:1px solid var(--nylas-primary)}.dropbtn:active{outline:2px solid var(--nylas-primary)}.dropbtn:disabled{cursor:not-allowed;background:var(--nylas-base-100)}.dropbtn span.chevron{display:flex;align-self:center}.dropbtn span.open{transform:rotate(90deg)}.dropbtn span.closed{transform:rotate(270deg)}.dropbtn span.selected-option{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:144px;font-size:14px;line-height:20px;color:inherit}@media screen and (max-width: 768px){.dropbtn span.selected-option{max-width:124px;font-size:16px}}.dropdown-content{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1);scrollbar-width:thin;scrollbar-color:var(--nylas-base-300) var(--nylas-base-50)}.dropdown-content::-webkit-scrollbar{width:8px}.dropdown-content::-webkit-scrollbar-track{background:var(--nylas-base-50);border-radius:4px}.dropdown-content::-webkit-scrollbar-thumb{background:var(--nylas-base-300);border-radius:4px;transition:background-color 0.2s ease}.dropdown-content::-webkit-scrollbar-thumb:hover{background:var(--nylas-base-400)}.dropdown-content::-webkit-scrollbar-thumb:active{background:var(--nylas-base-500)}@media screen and (max-width: 768px){.dropdown-content{right:0;width:325px;max-width:unset}}.search-box{border-bottom:1px solid var(--nylas-base-200);padding:10px;position:sticky;top:0;background:var(--nylas-base-0)}.search-box .icon{position:absolute;top:1.25rem;left:1.25rem;color:var(--nylas-base-300)}.dropdown-content ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.dropdown-content ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.dropdown-content ul li:hover,.dropdown-content ul li:focus{background-color:var(--nylas-base-100)}.dropdown-content .selected{background-color:#e7e7e7}input[type=text]{width:-webkit-fill-available;padding:inherit;border:1px solid var(--nylas-base-200);border-radius:4px;position:sticky;background:no-repeat scroll 7px 7px;padding-left:30px;background-size:16px 16px;color:var(--nylas-base-800)}';const d=class{constructor(s){e(this,s);this.nylasFormDropdownChanged=o(this,"nylasFormDropdownChanged",7);this.nylasFormDropdownDefaultSelected=o(this,"nylasFormDropdownDefaultSelected",7);this.componentType="select-dropdown";this.options=[];this.defaultSelectedOption=null;this.withSearch=true;this.searchPlaceholder="Search";this.required=false;this.readOnly=false;this.pluralizedLabel="";this.withChevron=true;this.emptyValue="Select an option";this.errorMessage="";this.isOpen=false;this.searchValue="";this.filteredOptions=[...this.options];this.ariaActivedescendant="";this.error=""}optionsChangedHandler(e,s){if(e===s){return}this.filteredOptions=e}defaultSelectedOptionChangedHandler(e,s){if(typeof e==="undefined"||e?.label===s?.label){return}this.selectedOption=e;this.nylasFormDropdownDefaultSelected.emit({value:e?.value||"",name:this.name,error:this.error,label:this.label})}themeConfigChangedHandler(e,s){if(e===s)return;this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[s,o]of Object.entries(e)){this.el.style.setProperty(`${s}`,o)}}}connectedCallback(){queueMicrotask((()=>{if(this.themeConfig){this.applyThemeConfig(this.themeConfig);this.el.setAttribute("data-themed","")}}))}componentWillLoad(){this.el.setAttribute("component-type",this.componentType);this.filteredOptions=this.options;this.selectedOption=this.defaultSelectedOption;if(!this.selectedOption&&this.options.length>0){this.selectedOption=this.options[0]}}componentDidLoad(){this.nylasFormDropdownDefaultSelected.emit({value:this.selectedOption?.value||"",name:this.name,error:this.error,label:this.label})}handleBookingFormSubmitted(e){this.validate(this.selectedOption?.value||"");if(this.error){e.preventDefault()}}handleFormSubmitted(e){this.validate(this.selectedOption?.value||"");if(this.error){e.preventDefault()}}validate(e){if(this.required&&!e){this.error=this.errorMessage||`${this.label} is required.`}else{this.error=""}}toggleDropdown(){this.isOpen=!this.isOpen}filterOptions(e){const s=e.target.value;this.searchValue=s;this.filteredOptions=this.options.filter((e=>e.label.toLowerCase().includes(s.toLowerCase())))}selectOption(e){this.error="";this.selectedOption=e;this.toggleDropdown();if(e.value!==this.emptyValue){this.nylasFormDropdownChanged.emit({value:e.value,name:this.name,error:this.error,label:this.label})}}handleSelectButtonKeyDown(e){switch(e.key){case"ArrowDown":case"Enter":e.preventDefault();if(!this.isOpen){this.toggleDropdown()}this.inputRef?.focus();break;case"Escape":this.isOpen=false;break}}handleListboxKeydown(e){const s=this.filteredOptions;const o=s.findIndex((e=>e.value===this.ariaActivedescendant));if(e.key==="ArrowDown"||e.key==="Tab"&&!e.shiftKey){e.preventDefault();if(o===s.length-1){this.ariaActivedescendant="";this.inputRef?.focus();return}const a=o+1<s.length?o+1:0;this.ariaActivedescendant=s[a].value;this.focusOption(a)}else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey){e.preventDefault();if(o===0){this.ariaActivedescendant="";this.inputRef?.focus();return}const a=o-1>=0?o-1:s.length-1;this.ariaActivedescendant=s[a].value;this.focusOption(a)}else if(e.key==="Enter"){e.preventDefault();if(this.ariaActivedescendant){this.selectOption(s[o])}}else if(e.key==="Escape"){this.isOpen=false}}focusOption(e){const s=this.filteredOptions[e];if(!s)return;const o=s.value;const a=this.el.shadowRoot?.getElementById(o);if(a){a.focus();a.scrollIntoView({behavior:"smooth",block:"nearest"})}}handleComboboxKeyDown(e){if(e.key==="ArrowDown"||e.key=="Tab"&&!e.shiftKey){e.preventDefault();this.ariaActivedescendant=this.filteredOptions[0].value;this.focusOption(0)}else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey){e.preventDefault();this.ariaActivedescendant=this.filteredOptions[this.filteredOptions.length-1].value;this.focusOption(this.filteredOptions.length-1)}else if(e.key==="Escape"){this.isOpen=false}}generateButtonText(e,s){if(s){return s}return e?.label?`${this.pluralizedLabel?this.pluralizedLabel:e?.label}`:this.emptyValue}handleOutsideClick(e){const s=e.composedPath();const o=s.includes(this.el);if(!o&&this.isOpen){this.isOpen=false}}render(){const e=this.generateButtonText(this.selectedOption,this.dropdownButtonText);return s("div",{key:"6f974060e4e092ab163d8cba8d13beed4c80ee6c",class:"dropdown",part:"sd_dropdown"},s("label",{key:"47bf2db1b675fcb25ba723509d4ee2f6b6873b3e",part:"sd_dropdown_label",class:{error:!!this.error}},this.label&&s("p",{key:"3202c4809f7b33363d27d995620a2923d4fbd5b1"},s("span",{key:"a8b6b7fd5cb9d3dddf5d6cc69f7b4cd39f159555",class:"label"},this.label),this.required&&s("span",{key:"bd2c064c68d81b3a8d21efb2e0fa5059c45dfa4b",class:"required"},"*")),s("button",{key:"f2ba9d78534eb655a25a055d525a26d980741f2e",part:"sd_dropdown-button",class:{dropbtn:true,open:this.isOpen,error:!!this.error},onClick:()=>this.toggleDropdown(),disabled:this.readOnly,"aria-haspopup":"listbox",title:this.readOnly?"read-only field":e,"aria-expanded":this.isOpen?"true":"false","aria-label":this.name,onKeyDown:e=>this.handleSelectButtonKeyDown(e)},s("slot",{key:"6709c73804aac1b22effc765bb25c47a7bfbdf92",name:"select-icon","aria-hidden":"true"}),s("span",{key:"0f2d118a3d3b9c6b7a98a52a4767293fd184ea23",class:"selected-option",part:"sd_dropdown-button-selected-label"},e),this.withChevron&&s("span",{key:"3eee942a71eb7cb6c28b675ab6fd02b6d7c2a04b",class:{open:this.isOpen,closed:!this.isOpen,chevron:true},"aria-hidden":"true"},s("chevron-icon",{key:"d9024867805061ae81e052dc72432f9143073f85",width:"16",height:"16"}))),this.error&&s("span",{key:"b4085dac463b6efb94b1555b0effe7ab33dc6f97",class:"error help-text"},this.error)),this.isOpen?s("div",{class:"dropdown-content",part:"sd_dropdown-content"},this.withSearch&&s("div",{class:{"search-box":true,open:this.isOpen}},s("search-icon",{width:"15",height:"15",class:"icon"}),s("input",{type:"text",role:"combobox",placeholder:this.searchPlaceholder,value:this.searchValue,ref:e=>this.inputRef=e,onInput:e=>this.filterOptions(e),onKeyDown:e=>this.handleComboboxKeyDown(e)})),s("ul",{tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant,onKeyDown:e=>this.handleListboxKeydown(e)},this.filteredOptions.map((e=>e.value.toString()?s("li",{tabindex:"0",key:e.value,id:e.value,part:`${this.name}-${e.label}`,onClick:()=>this.selectOption(e),role:"option"},e.labelHTML?s("div",{part:"sd_dropdown-labelhtml"},e.labelHTML):e.label):null)))):null)}get el(){return a(this)}static get watchers(){return{options:["optionsChangedHandler"],defaultSelectedOption:["defaultSelectedOptionChangedHandler"],themeConfig:["themeConfigChangedHandler"]}}};d.style=i;export{r as chevron_icon,l as search_icon,d as select_dropdown};
|
|
2
|
-
//# sourceMappingURL=p-1ba901b1.entry.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,h as s,c as a,a as i,H as t}from"./p-0EQQA0nE.js";import{o as r,d as l,i as o,N as n,O as c,C as h,P as f,Q as d,D as y}from"./p-D7AODx4L.js";import{L as b}from"./p-COJy29df.js";import{c as p}from"./p-D0rHpZDF.js";const u=".sc-globe-icon-h{display:flex}";const m=class{constructor(s){e(this,s);this.width="16";this.height="16"}render(){return s("svg",{key:"56a194e3418b638e1249285506c2ee261f00f11e",xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height,viewBox:"0 0 16 16",fill:"none"},s("path",{key:"fcf8257e3a1aff210330b15c20dd3bb23aa59034",d:"M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14ZM8 3C8.37372 3 8.87543 3.35608 9.31258 4.31781C9.4073 4.52619 9.49448 4.75446 9.57265 5H6.42735C6.50552 4.75446 6.5927 4.52619 6.68742 4.31781C7.12457 3.35608 7.62628 3 8 3ZM5.77705 3.90401C5.62614 4.23601 5.49428 4.6038 5.38411 5H3.99963C4.52341 4.30269 5.22525 3.74677 6.03766 3.39978C5.94287 3.56117 5.85596 3.7304 5.77705 3.90401ZM5.16299 6C5.05694 6.6275 5 7.30146 5 8C5 8.69854 5.05694 9.3725 5.16299 10H3.41604C3.14845 9.38754 3 8.7111 3 8C3 7.2889 3.14845 6.61246 3.41604 6H5.16299ZM5.38411 11C5.49428 11.3962 5.62614 11.764 5.77705 12.096C5.85596 12.2696 5.94287 12.4388 6.03766 12.6002C5.22525 12.2532 4.52341 11.6973 3.99963 11H5.38411ZM6.42735 11H9.57265C9.49448 11.2455 9.4073 11.4738 9.31258 11.6822C8.87543 12.6439 8.37372 13 8 13C7.62628 13 7.12457 12.6439 6.68742 11.6822C6.5927 11.4738 6.50552 11.2455 6.42735 11ZM9.82134 10H6.17866C6.06438 9.3892 6 8.71396 6 8C6 7.28604 6.06438 6.6108 6.17866 6H9.82134C9.93562 6.6108 10 7.28604 10 8C10 8.71396 9.93562 9.3892 9.82134 10ZM10.6159 11H12.0004C11.4766 11.6973 10.7747 12.2532 9.96234 12.6002C10.0571 12.4388 10.144 12.2696 10.2229 12.096C10.3739 11.764 10.5057 11.3962 10.6159 11ZM12.584 10H10.837C10.9431 9.3725 11 8.69854 11 8C11 7.30146 10.9431 6.6275 10.837 6H12.584C12.8516 6.61246 13 7.2889 13 8C13 8.7111 12.8516 9.38754 12.584 10ZM9.96234 3.39978C10.7747 3.74677 11.4766 4.30269 12.0004 5H10.6159C10.5057 4.6038 10.3739 4.23601 10.2229 3.90401C10.144 3.7304 10.0571 3.56117 9.96234 3.39978Z",fill:"currentColor"}))}};m.style=u;const g=':host{display:block;height:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error);border-color:var(--nylas-error)}.input_wrapper{display:flex;align-items:center;gap:1rem}input[type=date]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;width:100%;width:-moz-available;width:-webkit-fill-available;font-family:var(--nylas-font-family);padding:0 8px;cursor:pointer}input[type=date]:focus{outline-color:var(--nylas-primary)}input[type=date].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=date].error::placeholder{font-weight:400}input[type=date]::placeholder{color:var(--nylas-base-300)}input[type=date]::-webkit-calendar-picker-indicator{filter:invert(37%) sepia(51%) saturate(6324%) hue-rotate(215deg) brightness(94%) contrast(95%);cursor:pointer}input:read-only{background-color:var(--nylas-base-100);cursor:not-allowed}';const k={date:"YYYY-MM-DD"};const x=class{constructor(s){e(this,s);this.nylasFormInputChanged=a(this,"nylasFormInputChanged",7);this.nylasFormInputFocused=a(this,"nylasFormInputFocused",7);this.nylasFormInputBlurred=a(this,"nylasFormInputBlurred",7);this.name="input";this.label="";this.placeholder=k["date"];this.required=false;this.readOnly=false;this.autoFocus=false;this.maxLength=255;this.patternError="";this.requiredError="";this.errorMessage="";this.hasError=false;this.error="";this.isDateValid=true}handleDefaultValueChange(e){this.value=r(e);if(this.value){this.validatePattern(this.value,true)}}themeConfigChangedHandler(e,s){if(e===s)return;this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[s,a]of Object.entries(e)){this.el.style.setProperty(`${s}`,a)}}}connectedCallback(){queueMicrotask((()=>{if(this.themeConfig){this.applyThemeConfig(this.themeConfig);this.el.setAttribute("data-themed","")}}))}componentDidLoad(){this.value=r(this.defaultValue||"");if(this.value){this.validatePattern(this.value,true)}}handleBookingFormSubmitted(e){this.validatePattern(this.value);if(this.error){e.preventDefault()}}async handleFormSubmitted(e){this.validatePattern(this.value);if(this.error){e.preventDefault()}}handleInput(e){this.error="";const s=e.target;this.value=r(s.value);this.isDateValid=s.validity.valid;this.nylasFormInputChanged.emit({value:this.value,name:this.name,label:this.label,error:this.error,type:"date"})}handleBlur(){this.nylasFormInputBlurred.emit({value:this.value,name:this.name})}handleFocus(){this.nylasFormInputFocused.emit({value:this.value,name:this.name})}validatePattern(e,s=false){this.error="";if(!s&&(this.required&&!this.isDateValid||this.minDate&&new Date(this.minDate)>new Date(e))){this.error=this.errorMessage||"Please enter a valid date";this.nylasFormInputChanged.emit({value:this.value,name:this.name,label:this.label,error:this.error,type:"date"});return}if(this.required&&!e){this.error=this.requiredError||"This field is required.";return}if(!this.pattern||!e&&!this.required)return;if(this.pattern.test(e)){this.error=""}else{this.error=this.patternError||"Invalid format."}}render(){return s("label",{key:"cbe14199da81af538dbb83985a8eb452165cc666",part:"ic__label",class:{error:!!this.error||this.hasError}},this.label&&s("p",{key:"44243eced08cadeb43ba11faa4833eeba19fb21a"},s("span",{key:"cb9a4ce6da6db49dc88ad465144bad9074ccf4c7",class:"label"},this.label),this.required&&s("span",{key:"d7f6d15d0f791504726afa69df5f277437ed2004",class:"required"},"*")),s("div",{key:"d7f83a7de404023da5d173574ab03f425694155c",part:"ic__input_wrapper",class:"input_wrapper"},s("input",{key:"6908faeae193668e66840b3ae0d9ddf2faa86a6c",type:"date",min:this.minDate,value:this.value,name:this.name,part:"ic__date",title:this.readOnly?"read-only field":undefined,readOnly:this.readOnly,autoFocus:this.autoFocus,maxLength:this.maxLength,placeholder:this.placeholder,class:{error:!!this.error||this.hasError},onInput:e=>this.handleInput(e),onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur()}),s("slot",{key:"b770600413c67fef7bcbf291de3dce3e40844cff",name:"additional-input"})),this.error&&s("span",{key:"7defdbfdd33331a5cfc0f40effb29a2ef29896c6",class:"error help-text"},this.error))}get el(){return i(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"],themeConfig:["themeConfigChangedHandler"]}}};x.style=g;const w=':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff}.time-picker{display:inline-block;width:150px;font-family:var(--nylas-font-family);position:relative}@media screen and (max-width: 768px){.time-picker{width:auto}}.time-picker input{width:150px;height:48px;text-align:center;font-size:16px;font-family:inherit;color:var(--nylas-base-900);cursor:pointer;background:var(--nylas-base-0);border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.time-picker input{width:88px}}@media screen and (max-width: 504px){.time-picker input{width:68px;font-size:15px}}.time-picker input.focus{background:var(--nylas-base-0)}.time-picker input:hover,.time-picker input:active{border:1px solid var(--nylas-primary)}.time-picker input:active{outline:2px solid var(--nylas-primary)}.time-picker input span.open{transform:rotate(90deg)}.time-picker input span.closed{transform:rotate(270deg)}.time-picker input.error{border:1px solid var(--nylas-error)}.time-picker p.error{color:var(--nylas-error);font-size:0.875rem;margin:0}.times{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.times ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.times ul li{padding:16px, 12px, 16px, 12px;color:var(--nylas-base-900);padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:center;cursor:pointer}.times ul li.focused{background-color:var(--nylas-base-100)}.times ul li:hover,.times ul li:focus{background-color:var(--nylas-base-100)}.times ul li label{display:flex;align-items:center;gap:0.5rem}.times ul li label input{margin:0}';l.extend(p);const v=class{constructor(s){e(this,s);this.timeChange=a(this,"timeChange",7);this.timeWindowFormError=a(this,"timeWindowFormError",7);this.minimumStartTime=null;this.placeholder="hh:mmam/pm";this.hasError=false;this.language=b.en;this.err="";this.showTimes=false;this.ariaActivedescendant="";this.times=this.generateTimes();this.shouldAutoScroll=false}handleOutsideClick(e){const s=e.composedPath();const a=s.includes(this.el);if(!a&&this.showTimes){this.showTimes=false}}timeChangedHandler(){this.validateTimeAgainstMinimum()}minimumStartTimeChangedHandler(){this.validateTimeAgainstMinimum()}themeConfigChangedHandler(e,s){this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[s,a]of Object.entries(e)){this.el.style.setProperty(`${s}`,a)}}}validateTimeAgainstMinimum(){if(this.minimumStartTime){const e=l(this.minimumStartTime,"hh:mma");const s=l(this.time,"hh:mma");this.times=this.generateTimes();const a=o.t("nylasTimeWindowPicker.errors.invalid");if(s.isBefore(e)){this.err=a;this.timeWindowFormError.emit({key:this.el.id,message:a})}else{this.err="";this.timeWindowFormError.emit({key:this.el.id,message:""})}}else{this.err="";this.timeWindowFormError.emit({key:this.el.id,message:""})}}connectedCallback(){queueMicrotask((()=>{if(this.themeConfig){this.applyThemeConfig(this.themeConfig);this.el.setAttribute("data-themed","")}}))}componentWillLoad(){}componentDidLoad(){this.validateTimeAgainstMinimum()}componentDidRender(){if(this.showTimes&&this.shouldAutoScroll){const e=n(this.time);const s=this.times.findIndex((s=>s.value===e));if(s>-1){this.shouldAutoScroll=false;this.scrollToViewWithinParent(s)}return}}handleTimeChange(e,s){const a=s.split(":");if(a[0]==="00"&&a[1].slice(-2)=="pm"){const e=o.t("nylasTimeWindowPicker.errors.invalid");this.err=e;this.timeWindowFormError.emit({key:this.el.id,message:e})}if(!c(s)){const e=o.t("nylasTimeWindowPicker.errors.invalid");this.err=e;this.timeWindowFormError.emit({key:this.el.id,message:e})}else{this.err="";this.timeWindowFormError.emit({key:this.el.id,message:""})}if(this.err){return}this.timeChange.emit({key:this.el.id,value:s})}handleTimeAutocomplete(e){const s=e.target?.value;const a=this.language!==b.en?h(s):s;const i=o.t("nylasTimeWindowPicker.errors.invalid");if(!c(a)){this.err=i;this.timeWindowFormError.emit({key:this.el.id,message:i});return}if(a===""){const e=f().format("hh:mma");this.timeChange.emit({key:this.el.id,value:e});return}if(!d(a)){const e=n(a);this.timeChange.emit({key:this.el.id,value:e});return}this.timeChange.emit({key:this.el.id,value:a})}handleOnInput(e){const s=e.target?.value;if(!c(s)){return}if(s===""){const e=f().format("hh:mma");const s=this.times.findIndex((s=>s.value===e));if(s>-1){this.scrollToViewWithinParent(s)}return}if(!d(s)){const e=n(s);const a=this.times.findIndex((s=>s.value===e));if(a>-1){this.scrollToViewWithinParent(a)}return}}generateTimes(){const e=[];let s=l().set("hour",0).set("minute",0).set("second",0);if(this.minimumStartTime){s=l(this.minimumStartTime,"hh:mma")}const a=s.endOf("day").diff(s,"minutes");const i=Math.round(a/15);for(let a=0;a<i+1;a++){const t=s.add(a*15,"minute");if(a==i&&t.format("hh:mma").includes("am")){break}e.push({id:a,value:t.format("hh:mma")})}return e}handleComboboxKeyDown(e){if(e.key==="ArrowDown"){e.preventDefault();if(!this.showTimes){this.showTimes=true;this.shouldAutoScroll=true;return}if(this.ariaActivedescendant===""){this.ariaActivedescendant=this.times[0].id.toString();this.focusOption(0)}else{const e=this.times.findIndex((e=>e.id.toString()===this.ariaActivedescendant));const s=e+1<this.times.length?e+1:0;this.ariaActivedescendant=this.times[s].id.toString();this.focusOption(s)}}else if(e.key==="ArrowUp"){e.preventDefault();if(this.ariaActivedescendant===""){this.ariaActivedescendant=this.times[this.times.length-1].id.toString();this.focusOption(this.times.length-1)}else{const e=this.times.findIndex((e=>e.id.toString()===this.ariaActivedescendant));const s=e-1>=0?e-1:this.times.length-1;this.ariaActivedescendant=this.times[s].id.toString();this.focusOption(s)}}else if(e.key==="Escape"){this.showTimes=false;this.timeInput.focus()}}handleListboxKeydown(e){const s=this.times;const a=s.findIndex((e=>e.id.toString()===this.ariaActivedescendant));if(e.key==="ArrowDown"||e.key==="Tab"&&!e.shiftKey){e.preventDefault();const i=a+1<s.length?a+1:0;this.ariaActivedescendant=s[i].id.toString();this.focusOption(i)}else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey){e.preventDefault();const i=a-1>=0?a-1:s.length-1;this.ariaActivedescendant=s[i].id.toString();this.focusOption(i)}else if(e.key==="Enter"){e.preventDefault();if(this.ariaActivedescendant){const i=s[a];this.handleTimeChange(e,i.value);this.showTimes=false;this.ariaActivedescendant="";this.timeInput.focus()}}else if(e.key==="Escape"){this.showTimes=false;this.timeInput.focus()}}scrollToViewWithinParent(e){const s=this.times[e];const a=this.el.shadowRoot?.getElementById(s.id.toString());const i=this.timeMenu;this.ariaActivedescendant=s.id.toString();const t=a.getBoundingClientRect();const r=i.getBoundingClientRect();if(t.top<r.top){i.scrollTop-=r.top-t.top}else if(t.bottom>r.bottom){i.scrollTop+=t.bottom-r.bottom}if(t.left<r.left){i.scrollLeft-=r.left-t.left}else if(t.right>r.right){i.scrollLeft+=t.right-r.right}}focusOption(e){const s=this.times[e];if(!s)return;const a=s.id.toString();const i=this.el.shadowRoot?.getElementById(a);if(i){i.focus();i.scrollIntoView({behavior:"smooth",block:"nearest"})}}render(){const e=this.language===b.en?false:true;return s(t,{key:"0403cfa3797f932534b4cebc405a20290213e998"},s("div",{key:"8ccffc9783e64048de39e57c319e4293ebdc2a01",class:"time-picker",part:"time-picker"},s("input",{key:"a3b973a69652beea3c5f0edf92d1392531eb2cd4",type:"text",name:this.name,id:this.name,part:"time-input",class:{"time-input":true,error:!!this.err||this.hasError},ref:e=>this.timeInput=e,value:e?y(this.time):this.time,onClick:()=>{this.showTimes=!this.showTimes;this.shouldAutoScroll=true},"aria-haspopup":"listbox","aria-label":this.name,"aria-expanded":this.showTimes?"true":"false",placeholder:this.placeholder,onKeyDown:e=>this.handleComboboxKeyDown(e),onInput:e=>this.handleOnInput(e),onBlur:e=>this.handleTimeAutocomplete(e)}),this.err&&s("div",{key:"d7385a33724b5d41e39bd805f9d71481a6703372",class:"invalid-time-icon"}),this.showTimes&&s("div",{key:"eb865058bed72b5ff418948ed6c98731d52b6f7e",class:"times",part:"times",ref:e=>this.timeMenu=e},s("ul",{key:"e59880009b3c3b854bee6556b04aabe95cc7be69",tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant,onKeyDown:e=>this.handleListboxKeydown(e)},this.times.map((a=>s("li",{tabindex:"0",key:a.id,id:a.id.toString(),class:{focused:this.ariaActivedescendant===a.id.toString()},onClick:e=>{this.handleTimeChange(e,a.value);this.showTimes=false;this.timeInput.focus()},role:"option"},`${e?y(a.value):a.value}`))))),!this.showTimes&&this.err&&s("p",{key:"5391705ea7e8a3a366889ef8976760383e8f6fe5",class:"error",id:"email-error"},this.err)))}get el(){return i(this)}static get watchers(){return{time:["timeChangedHandler"],minimumStartTime:["minimumStartTimeChangedHandler"],themeConfig:["themeConfigChangedHandler"]}}};v.style=w;export{m as globe_icon,x as nylas_date_component,v as nylas_time_window_picker};
|
|
2
|
-
//# sourceMappingURL=p-2bff143d.entry.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,c as a,h as l,a as r}from"./p-0EQQA0nE.js";import{o as s}from"./p-D7AODx4L.js";const o=':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0;display:flex;gap:4px;align-items:center}label .error{color:var(--nylas-error)}textarea{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}textarea:focus{outline-color:var(--nylas-primary)}textarea.error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}textarea.error::placeholder{font-weight:400}textarea::placeholder{color:var(--nylas-base-300)}textarea::-webkit-resizer{display:none}textarea:read-only{background-color:var(--nylas-base-100);cursor:not-allowed}';const n=class{constructor(l){e(this,l);this.nylasFormInputChanged=a(this,"nylasFormInputChanged",7);this.name="textarea";this.label="";this.placeholder="";this.required=false;this.readOnly=false;this.autoFocus=false;this.maxLength=255;this.type="multi_line_text";this.tooltip="";this.errorMessage="";this.value="";this.error=""}connectedCallback(){queueMicrotask((()=>{if(this.themeConfig){this.applyThemeConfig(this.themeConfig);this.el.setAttribute("data-themed","")}}))}componentDidLoad(){this.value=s(this.defaultValue||"")}themeConfigChangedHandler(e,a){if(e===a)return;this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[a,l]of Object.entries(e)){this.el.style.setProperty(`${a}`,l)}}}handleBookingFormSubmitted(e){this.validate(this.value);if(this.error){e.preventDefault()}}handletriggerValidation(e){this.validate(this.value);if(this.error){e.preventDefault()}}handleInput(e){this.error="";const a=e.target;this.value=s(a.value);this.nylasFormInputChanged.emit({value:this.value,name:this.name,error:this.error,label:this.label,type:this.type})}validate(e){if(this.required&&!e){this.error=this.errorMessage||`${this.label} is required.`}else if(e.length>this.maxLength){this.error=`${this.label} cannot exceed ${this.maxLength} characters.`}else{this.error=""}}render(){return l("label",{key:"58f9f02cc38215f110491371babf2b95d5866721",part:"tc__label",class:{error:!!this.error}},l("p",{key:"cc06bf464fd9b96a9bc3092682ce3bdf7e79bdcc"},l("span",{key:"9fb43cbc9ebc0d3fcfd0e7df8a8879850e9feb8f",class:"label"},this.label),this.required&&l("span",{key:"ab60d5aa035688add974dc56e632025964727f07",class:"required"},"*"),this.tooltip&&l("tooltip-component",{key:"5d6c07f774f1a5c54d65f6daa919534435bcd5d0"},l("info-icon",{key:"b8ab0802db6137e330e0e9ddba0bff36196f82fb",slot:"tooltip-icon"}),l("span",{key:"973c47a049105a8a44de86ae19b18a99306c0077",slot:"tooltip-content"},this.tooltip))),l("textarea",{key:"8b0c18830cfc09b6c59b0c10859297762c97bcdb",name:this.name,title:this.readOnly?"read-only field":undefined,placeholder:this.placeholder,readOnly:this.readOnly,autoFocus:this.autoFocus,value:this.value,maxLength:this.maxLength,onInput:e=>this.handleInput(e),class:{error:!!this.error},part:"tc__textarea"}),this.error&&l("span",{key:"7c157600c92196ed333c82b12315d2528346204f",class:"error help-text"},this.error))}get el(){return r(this)}static get watchers(){return{themeConfig:["themeConfigChangedHandler"]}}};n.style=o;export{n as textarea_component};
|
|
2
|
-
//# sourceMappingURL=p-70762abf.entry.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e,c as a,h as s,a as l}from"./p-0EQQA0nE.js";import{o as r}from"./p-D7AODx4L.js";const t=':host{display:block;height:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-50:#ffeae8;--nylas-error-100:#ffc5bf;--nylas-error-200:#fecaca;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-color-blue-100:#e0e6f9;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;--nylas-color-black:#000000;--nylas-color-grey-900:#2c2c2c;--nylas-color-grey-800:#4b4b4b;--nylas-color-grey-700:#6e6e6e;--nylas-color-grey-600:#8e8e8e;--nylas-color-grey-500:#b3b3b3;--nylas-color-grey-400:#cacaca;--nylas-color-grey-300:#e1e1e1;--nylas-color-grey-200:#eaeaea;--nylas-color-grey-100:#f5f5f5;--nylas-color-grey-50:#fbfcfe;--nylas-color-white:#ffffff;--nylas-color-red-900:#992222;--nylas-color-red-700:#cc4841;--nylas-color-red-500:#ff786a;--nylas-color-red-300:#ffa79e;--nylas-color-red-100:#ffc5bf;--nylas-color-red-50:#ffeae8;--nylas-color-blue-900:#213571;--nylas-color-blue-700:#314fa9;--nylas-color-blue-500:#4169e1;--nylas-color-blue-300:#bdccf9;--nylas-color-blue-100:#e0e6f9;--nylas-color-blue-50:#f6f8fd;--nylas-color-yellow-900:#7c6506;--nylas-color-yellow-700:#c29f09;--nylas-color-yellow-500:#f7c90b;--nylas-color-yellow-300:#f9de70;--nylas-color-yellow-100:#fceba9;--nylas-color-yellow-50:#fdf4ce;--nylas-color-green-900:#0e6b60;--nylas-color-green-700:#16a392;--nylas-color-green-500:#17c3b2;--nylas-color-green-300:#74dbd1;--nylas-color-green-100:#a2e7e0;--nylas-color-green-50:#d1f3f0;--nylas-color-purple-900:#643554;--nylas-color-purple-700:#954f7d;--nylas-color-purple-500:#c769a7;--nylas-color-purple-300:#dda5ca;--nylas-color-purple-100:#e0bdd6;--nylas-color-purple-50:#e9dde5;--nylas-color-sky-900:#20698f;--nylas-color-sky-700:#2b8fc2;--nylas-color-sky-500:#6dceff;--nylas-color-sky-300:#8fdaff;--nylas-color-sky-100:#b8e7ff;--nylas-color-sky-50:#d9f2ff;width:100%}label{display:flex;color:var(--nylas-base-800, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;flex-direction:column;gap:4px;font-family:var(--nylas-font-family);font-size:16px;color:var(--nylas-base-800)}label.error{color:var(--nylas-error)}label span.required{color:var(--nylas-error);padding:0 0.25rem}label p{margin:0}label .error{color:var(--nylas-error)}.input_wrapper{display:flex;align-items:center;gap:1rem}input[type=text],input[type=number],input[type=email],input[type=phone_number]{display:flex;height:48px;padding-left:16px;align-items:center;gap:8px;align-self:stretch;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-300);background:var(--nylas-base-0);width:-webkit-fill-available;color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:400;line-height:150%;width:-moz-available;width:-webkit-fill-available}input[type=text]:focus,input[type=number]:focus,input[type=email]:focus,input[type=phone_number]:focus{outline-color:var(--nylas-primary)}input[type=text].error,input[type=number].error,input[type=email].error,input[type=phone_number].error{border-radius:var(--nylas-border-radius-2x);font-weight:600;border-color:var(--nylas-error);border-width:2px}input[type=text].error::placeholder,input[type=number].error::placeholder,input[type=email].error::placeholder,input[type=phone_number].error::placeholder{font-weight:400}input[type=text]::placeholder,input[type=number]::placeholder,input[type=email]::placeholder,input[type=phone_number]::placeholder{color:var(--nylas-base-300)}input:read-only{background-color:var(--nylas-base-100);cursor:not-allowed}';const n={email:/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,phone_number:/^\+?\d{1,15}$/};const i={email:"name@example.com",phone_number:"1234567890"};const o=class{constructor(s){e(this,s);this.nylasFormInputChanged=a(this,"nylasFormInputChanged",7);this.nylasFormInputFocused=a(this,"nylasFormInputFocused",7);this.nylasFormInputBlurred=a(this,"nylasFormInputBlurred",7);this.name="input";this.label="";this.type="text";this.placeholder=i[this.type];this.required=false;this.readOnly=false;this.autoFocus=false;this.maxLength=255;this.patternError="";this.requiredError="";this.error=""}handleDefaultValueChange(e){this.value=r(e);if(this.value){this.validatePattern(this.value)}}themeConfigChangedHandler(e,a){if(e===a)return;this.applyThemeConfig(e)}applyThemeConfig(e){if(e){for(const[a,s]of Object.entries(e)){this.el.style.setProperty(`${a}`,s)}}}connectedCallback(){queueMicrotask((()=>{if(this.themeConfig){this.applyThemeConfig(this.themeConfig);this.el.setAttribute("data-themed","")}}))}componentWillLoad(){}componentDidLoad(){this.value=r(this.defaultValue||"");if(this.type!=="text"&&!this.pattern){this.pattern=n[this.type]}if(this.value){this.validatePattern(this.value)}}handleBookingFormSubmitted(e){this.validatePattern(this.value);if(this.error){e.preventDefault()}}async handleFormSubmitted(e){if(this.el?.getAttribute("data-page-styling")){this.validatePattern(this.value);if(this.error){e.preventDefault()}}}handleInput(e){this.error="";const a=e.target.value;if(this.type==="number"){const e=parseFloat(a);if(this.maxValue!==undefined&&e>this.maxValue||this.minValue!==undefined&&e<this.minValue){if(this.minValue===undefined){this.error=`Value must be less than ${this.maxValue}`}else if(this.maxValue===undefined){this.error=`Value must be greater than ${this.minValue}`}else{this.error=`Value must be between ${this.minValue} and ${this.maxValue}`}}else if(isNaN(e)){this.error=this.patternError||"Invalid format."}}this.value=r(a);this.nylasFormInputChanged.emit({value:this.value,name:this.name,label:this.label,error:this.error,type:this.type})}handleBlur(){this.nylasFormInputBlurred.emit({value:this.value,name:this.name})}handleFocus(){this.nylasFormInputFocused.emit({value:this.value,name:this.name})}validatePattern(e){this.error="";if(this.required&&!e){this.error=this.requiredError||"This field is required.";return}if(this.type==="number"&&e){const a=parseFloat(e);if(this.maxValue!==undefined&&a>this.maxValue||this.minValue!==undefined&&a<this.minValue){this.error=`Value must be between ${this.minValue} and ${this.maxValue}`;return}}if(this.pattern&&e&&!this.pattern.test(e)){this.error=this.patternError||"Invalid format."}}render(){return s("label",{key:"a42cf1c62df9da49e94105ad445bac228da4c71f",part:this.error?"ic__label ic__label--error":"ic__label",class:{error:!!this.error}},this.label&&s("p",{key:"4323a02744309c5cfed355ec57f9efda98743d5e"},s("span",{key:"9186ea21fb968ffdbc42fb634c250a705e241062",class:"label"},this.label),this.required&&s("span",{key:"a27c132a43ce5c1d66589935758d7a97c405bb05",class:"required"},"*")),s("div",{key:"5a5d23687f23aad3ae064d40373b911d46dd9238",part:"ic__input_wrapper",class:"input_wrapper"},s("input",{key:"c7120081aaf188536e73b7900e255ffeb5102d8b",type:this.type,name:this.name,part:this.error?"ic__input ic__input--error":"ic__input",title:this.readOnly?"read-only field":undefined,readOnly:this.readOnly,autoFocus:this.autoFocus,value:this.value,maxLength:this.maxLength,max:this.type==="number"?this.maxValue:undefined,min:this.type==="number"?this.minValue:undefined,placeholder:this.placeholder,class:{error:!!this.error},onInput:e=>this.handleInput(e),onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur()}),s("slot",{key:"07bf4e931fc872171aa8d5e31ea52a5e031e2bed",name:"additional-input"})),this.error&&s("span",{key:"cda24302b383b17b346ff32261a8f5345eddc6c2",class:"error help-text",part:"ic__error_message"},this.error))}get el(){return l(this)}static get watchers(){return{defaultValue:["handleDefaultValueChange"],themeConfig:["themeConfigChangedHandler"]}}};o.style=t;export{o as input_component};
|
|
2
|
-
//# sourceMappingURL=p-7655eeb0.entry.js.map
|