@nylas/react 1.1.4 → 1.1.5
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/add-circle-icon_2.entry-1e899552.js +25 -0
- package/dist/add-circle-icon_2.entry-31acee1d.cjs +1 -0
- package/dist/archive-icon.entry-b5f307e8.js +15 -0
- package/dist/archive-icon.entry-e932c9e6.cjs +1 -0
- package/dist/{arrow-icon.entry-20b50784.js → arrow-icon.entry-aae2e22d.js} +2 -2
- package/dist/{arrow-icon.entry-83c3105b.cjs → arrow-icon.entry-e35a6cad.cjs} +1 -1
- package/dist/{bold-icon.entry-0e3d84e1.cjs → bold-icon.entry-1e3c9b1f.cjs} +1 -1
- package/dist/{bold-icon.entry-34b18d0d.js → bold-icon.entry-d5d86b3f.js} +2 -2
- package/dist/{button-component_2.entry-8a5e99da.js → button-component_2.entry-5284316e.js} +6 -6
- package/dist/{button-component_2.entry-54101987.cjs → button-component_2.entry-a86f8dca.cjs} +1 -1
- package/dist/{calendar-agenda-fill-icon_51.entry-a351dca5.js → calendar-agenda-fill-icon_54.entry-5672c589.js} +1943 -1638
- package/dist/calendar-agenda-fill-icon_54.entry-702b29cc.cjs +10 -0
- package/dist/{calendar-cancel-icon.entry-f83e9b41.js → calendar-cancel-icon.entry-7f81de9d.js} +4 -4
- package/dist/{calendar-cancel-icon.entry-00756264.cjs → calendar-cancel-icon.entry-e9792eaa.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-1817540c.js → calendar-check-icon_2.entry-84db1700.js} +7 -7
- package/dist/{calendar-check-icon_2.entry-6ac948fc.cjs → calendar-check-icon_2.entry-ad055b37.cjs} +1 -1
- package/dist/{calendar-icon.entry-68e53f52.cjs → calendar-icon.entry-019f7feb.cjs} +1 -1
- package/dist/{calendar-icon.entry-362428bf.js → calendar-icon.entry-45db1630.js} +2 -2
- package/dist/{checkbox-component_2.entry-5ce9807d.cjs → checkbox-component_2.entry-8325ff88.cjs} +1 -1
- package/dist/{checkbox-component_2.entry-0d7c1916.js → checkbox-component_2.entry-84a053ff.js} +3 -3
- package/dist/{chevron-icon_3.entry-89c52603.cjs → chevron-icon_3.entry-0edde2a6.cjs} +1 -1
- package/dist/{chevron-icon_3.entry-37c087a7.js → chevron-icon_3.entry-ec894a13.js} +6 -6
- package/dist/{clock-icon_4.entry-2e78febe.js → clock-icon_4.entry-8ec9c29b.js} +8 -8
- package/dist/{clock-icon_4.entry-496058ef.cjs → clock-icon_4.entry-935fe48d.cjs} +1 -1
- package/dist/constants-c549b12b-7ea4c7f5.js +763 -0
- package/dist/constants-c549b12b-c85413b1.cjs +1 -0
- package/dist/copy-icon.entry-5a2030da.cjs +1 -0
- package/dist/{copy-icon.entry-6d4e05b0.js → copy-icon.entry-d9405510.js} +7 -7
- package/dist/{delete-icon.entry-ea06b42a.js → delete-icon.entry-1b0a3ba4.js} +7 -7
- package/dist/{delete-icon.entry-e98b336e.cjs → delete-icon.entry-3f3d1ffb.cjs} +1 -1
- package/dist/document-refresh-icon.entry-59a18097.cjs +1 -0
- package/dist/document-refresh-icon.entry-fab58d33.js +15 -0
- package/dist/{feedbackSync-ab657d65-e8b7c001.js → feedbackSync-b56b29ed-7a1f1f75.js} +1 -1
- package/dist/{feedbackSync-ab657d65-e650e46d.cjs → feedbackSync-b56b29ed-b6f352f3.cjs} +1 -1
- package/dist/{folder-icon.entry-6096fbf4.js → folder-icon.entry-b5a123d0.js} +2 -2
- package/dist/{folder-icon.entry-5c3f4e8f.cjs → folder-icon.entry-e85383b6.cjs} +1 -1
- package/dist/{forward-icon.entry-4089e3bb.cjs → forward-icon.entry-7c8ed4c3.cjs} +1 -1
- package/dist/forward-icon.entry-88ab1a85.js +15 -0
- package/dist/{globe-icon.entry-59f4c2f9.js → globe-icon.entry-6fb414ca.js} +4 -4
- package/dist/{globe-icon.entry-e8ca972e.cjs → globe-icon.entry-b1253516.cjs} +1 -1
- package/dist/google-logo-icon_4.entry-ae09d065.cjs +1 -0
- package/dist/{google-logo-icon_4.entry-d4b8926f.js → google-logo-icon_4.entry-fe627741.js} +213 -199
- package/dist/inbox-icon.entry-7dce836e.cjs +1 -0
- package/dist/{inbox-icon.entry-70dae5ec.js → inbox-icon.entry-cec35da1.js} +2 -2
- package/dist/{index-e475e0c0.js → index-3fd31877.js} +3236 -3090
- package/dist/index-bd6fdc8c.cjs +81 -0
- package/dist/{index.es-b475d61f-68a74a28.cjs → index.es-c7ca1bad-0a324dca.cjs} +1 -1
- package/dist/{index.es-b475d61f-bfa2cba2.js → index.es-c7ca1bad-b895d84b.js} +1 -1
- package/dist/{info-icon_2.entry-f1b1dfba.cjs → info-icon_2.entry-1dab6311.cjs} +1 -1
- package/dist/{info-icon_2.entry-2bb60213.js → info-icon_2.entry-f7e6b4aa.js} +5 -5
- package/dist/{input-color-picker.entry-5ae45a9e.js → input-color-picker.entry-30cda4e2.js} +3 -3
- package/dist/{input-color-picker.entry-b669f7fb.cjs → input-color-picker.entry-b6e53c29.cjs} +1 -1
- package/dist/{input-component.entry-eeb95361.cjs → input-component.entry-1f1f8e00.cjs} +1 -1
- package/dist/{input-component.entry-cb958501.js → input-component.entry-7a04bc8b.js} +3 -3
- package/dist/{input-dropdown.entry-0b458f68.cjs → input-dropdown.entry-5e5b67be.cjs} +1 -1
- package/dist/{input-dropdown.entry-962605f8.js → input-dropdown.entry-abf134a8.js} +4 -4
- package/dist/italic-icon.entry-4631c594.js +15 -0
- package/dist/italic-icon.entry-c793243b.cjs +1 -0
- package/dist/{multi-select-dropdown.entry-a66408a2.cjs → multi-select-dropdown.entry-2b8728d5.cjs} +1 -1
- package/dist/{multi-select-dropdown.entry-3084e1fc.js → multi-select-dropdown.entry-9a93da56.js} +2 -2
- package/dist/nylas-booked-event-card_12.entry-8d502a3c.cjs +1 -0
- package/dist/{nylas-booked-event-card_12.entry-29e2a4b1.js → nylas-booked-event-card_12.entry-f13f3f54.js} +299 -294
- package/dist/{nylas-form-card.entry-33b4c295.js → nylas-form-card.entry-862519b4.js} +16 -16
- package/dist/{nylas-form-card.entry-8465eccf.cjs → nylas-form-card.entry-af179b96.cjs} +1 -1
- package/dist/{nylas-if-state.entry-9d96fc87.js → nylas-if-state.entry-8803a762.js} +3 -3
- package/dist/{nylas-if-state.entry-adb6103a.cjs → nylas-if-state.entry-c1c1282d.cjs} +1 -1
- package/dist/{nylas-login.entry-3f7c195e.js → nylas-login.entry-3e12f747.js} +7 -7
- package/dist/{nylas-login.entry-78b968d1.cjs → nylas-login.entry-65f8f046.cjs} +1 -1
- package/dist/{nylas-provider.entry-b918d0f6.cjs → nylas-provider.entry-9626b113.cjs} +1 -1
- package/dist/{nylas-provider.entry-19635620.js → nylas-provider.entry-e3501bd1.js} +5 -5
- package/dist/{nylas-scheduler-editor.entry-cfed7ae2.cjs → nylas-scheduler-editor.entry-17cd1514.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-e848771f.js → nylas-scheduler-editor.entry-6df45b05.js} +25 -25
- package/dist/{nylas-scheduling.entry-da987c02.js → nylas-scheduling.entry-08051ba3.js} +138 -126
- package/dist/nylas-scheduling.entry-b1fafd91.cjs +1 -0
- package/dist/{nylas-time-window-picker.entry-1f76b577.cjs → nylas-time-window-picker.entry-4989d421.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-3c6b29d9.js → nylas-time-window-picker.entry-bdc8c6ea.js} +13 -13
- package/dist/{person-icon.entry-79fcd9fb.js → person-icon.entry-d62a16b4.js} +2 -2
- package/dist/{person-icon.entry-82bbb87c.cjs → person-icon.entry-fb7efa8f.cjs} +1 -1
- package/dist/play-icon.entry-01b95392.js +15 -0
- package/dist/{play-icon.entry-3f357ea4.cjs → play-icon.entry-f485a2c8.cjs} +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +9 -9
- package/dist/{refresh-icon.entry-1427a5e6.js → refresh-icon.entry-1ff4b39f.js} +2 -2
- package/dist/{refresh-icon.entry-7ce5ec90.cjs → refresh-icon.entry-5f997e86.cjs} +1 -1
- package/dist/{register-component-679c1308-de697ecb.js → register-component-3444af44-854971ad.js} +1 -1
- package/dist/{register-component-679c1308-b5a96acf.cjs → register-component-3444af44-9053e8c3.cjs} +1 -1
- package/dist/{reply-all-icon.entry-cf8114db.cjs → reply-all-icon.entry-1dad6514.cjs} +1 -1
- package/dist/{reply-all-icon.entry-f1165660.js → reply-all-icon.entry-cbafb8a0.js} +2 -2
- package/dist/reply-icon.entry-162d9945.cjs +1 -0
- package/dist/reply-icon.entry-a43bc252.js +15 -0
- package/dist/{scheduler-config-store-2a3b403d-e5210f72.js → scheduler-config-store-ed4a8dfd-22db9285.js} +1 -2
- package/dist/scheduler-config-store-ed4a8dfd-eeaeaa50.cjs +1 -0
- package/dist/{scheduler-store-908886c8-b0f43cb9.js → scheduler-store-d4784b24-9a5f5734.js} +134 -126
- package/dist/scheduler-store-d4784b24-aed474e8.cjs +1 -0
- package/dist/sent-icon.entry-a05486d5.js +15 -0
- package/dist/sent-icon.entry-a1aec7e9.cjs +1 -0
- package/dist/spam-icon.entry-473f11af.js +15 -0
- package/dist/spam-icon.entry-b481a04b.cjs +1 -0
- package/dist/{star-icon.entry-b15601ca.js → star-icon.entry-12fdc345.js} +5 -5
- package/dist/{star-icon.entry-88501c8b.cjs → star-icon.entry-6b1fe3cf.cjs} +1 -1
- package/dist/stop-icon.entry-4bd609f7.js +15 -0
- package/dist/{stop-icon.entry-3475e257.cjs → stop-icon.entry-72481153.cjs} +1 -1
- package/dist/{textarea-component.entry-d1f4dd9a.js → textarea-component.entry-47e1b2e6.js} +2 -2
- package/dist/{textarea-component.entry-683c2959.cjs → textarea-component.entry-f330a755.cjs} +1 -1
- package/dist/{time-period-selector.entry-e97f86fd.js → time-period-selector.entry-a4899368.js} +2 -2
- package/dist/{time-period-selector.entry-8cfdf750.cjs → time-period-selector.entry-c7611563.cjs} +1 -1
- package/dist/{translate-icon.entry-5757c37c.cjs → translate-icon.entry-40dfa8c9.cjs} +1 -1
- package/dist/{translate-icon.entry-09c5574f.js → translate-icon.entry-4517838d.js} +4 -4
- package/dist/trash-fill-icon.entry-86ca3055.cjs +1 -0
- package/dist/{trash-fill-icon.entry-470ec1ff.js → trash-fill-icon.entry-d7e960eb.js} +3 -3
- package/dist/{underline-icon.entry-9fe74ba7.js → underline-icon.entry-352970f5.js} +2 -2
- package/dist/{underline-icon.entry-6d729068.cjs → underline-icon.entry-f16d4943.cjs} +1 -1
- package/dist/{warning-icon.entry-d924f8f9.js → warning-icon.entry-63987dad.js} +5 -5
- package/dist/{warning-icon.entry-c1d48318.cjs → warning-icon.entry-79ef75b2.cjs} +1 -1
- package/package.json +3 -3
- package/dist/add-circle-icon_2.entry-6753bd65.js +0 -25
- package/dist/add-circle-icon_2.entry-cd9a7f37.cjs +0 -1
- package/dist/archive-icon.entry-434d1696.js +0 -15
- package/dist/archive-icon.entry-7cb1c265.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_51.entry-1920adc2.cjs +0 -7
- package/dist/constants-c31dccfe-04b9cd8a.js +0 -3883
- package/dist/constants-c31dccfe-1a739653.cjs +0 -15
- package/dist/copy-icon.entry-a1baee33.cjs +0 -1
- package/dist/document-refresh-icon.entry-09750b52.cjs +0 -1
- package/dist/document-refresh-icon.entry-afae6621.js +0 -15
- package/dist/forward-icon.entry-da319c05.js +0 -15
- package/dist/google-logo-icon_4.entry-e2001f83.cjs +0 -1
- package/dist/inbox-icon.entry-80ee9082.cjs +0 -1
- package/dist/index-6b9d4b01.cjs +0 -81
- package/dist/italic-icon.entry-4a89e289.cjs +0 -1
- package/dist/italic-icon.entry-5be07509.js +0 -15
- package/dist/nylas-booked-event-card_12.entry-227ccf31.cjs +0 -1
- package/dist/nylas-reminder-emails.entry-ec79b757.js +0 -168
- package/dist/nylas-reminder-emails.entry-ee76db24.cjs +0 -4
- package/dist/nylas-reminder-time_2.entry-105de2d0.js +0 -108
- package/dist/nylas-reminder-time_2.entry-83ecc1d4.cjs +0 -1
- package/dist/nylas-scheduling.entry-e989cf9e.cjs +0 -1
- package/dist/play-icon.entry-97b40470.js +0 -15
- package/dist/reply-icon.entry-3a601cff.js +0 -15
- package/dist/reply-icon.entry-3db337c9.cjs +0 -1
- package/dist/scheduler-config-store-2a3b403d-e6f5bcab.cjs +0 -1
- package/dist/scheduler-store-908886c8-62d14677.cjs +0 -1
- package/dist/sent-icon.entry-2c7bd48e.js +0 -15
- package/dist/sent-icon.entry-708b9a2b.cjs +0 -1
- package/dist/spam-icon.entry-3106ed3d.js +0 -15
- package/dist/spam-icon.entry-fa8b80c6.cjs +0 -1
- package/dist/stop-icon.entry-f926a8db.js +0 -15
- package/dist/trash-fill-icon.entry-4bbfabcc.cjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-6b9d4b01.cjs"),f=require("./register-component-679c1308-b5a96acf.cjs"),m=require("./constants-c31dccfe-1a739653.cjs");require("react");require("react-dom");const y=':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-reminder-time{display:flex;flex-direction:column;gap:4px}.nylas-reminder-time label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:16px;font-style:normal;font-weight:400;line-height:150%;}.nylas-reminder-time label span.required{color:var(--nylas-error, #cc4841)}.nylas-reminder-time label span.label-icon{margin-left:4px}.nylas-reminder-time label span.label-icon tooltip-component{display:flex}.nylas-reminder-time__wrapper{display:flex;align-items:center;gap:0.5rem}.nylas-reminder-time__wrapper input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family);font-size:16px;line-height:24px;width:48px}.nylas-reminder-time__wrapper input-dropdown::part(id_dropdown-input){border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:14px 16px;width:50px}.nylas-reminder-time__wrapper input-dropdown::part(id_dropdown-content){width:100%;min-width:unset;height:160px}.nylas-reminder-time__wrapper select-dropdown{width:120px}@media screen and (max-width: 768px){.nylas-reminder-time__wrapper select-dropdown{width:100%}}.nylas-reminder-time__wrapper select-dropdown::part(sd_dropdown-button){border:1px solid var(--nylas-base-200)}',b=y;var T=function(e,i,t,s){var a=arguments.length,r=a<3?i:s===null?s=Object.getOwnPropertyDescriptor(i,t):s,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(e,i,t,s);else for(var l=e.length-1;l>=0;l--)(d=e[l])&&(r=(a<3?d(r):a>3?d(i,t,r):d(i,t))||r);return a>3&&r&&Object.defineProperty(i,t,r),r},o=function(e,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,i)};function p(e){return e?e>=60*24?e/(60*24):e>=90||e===60?e/60:e:30}function h(e){return e?e>=60*24?60*24:e>=90||e===60?60:1:30}const c=class{constructor(e){n.registerInstance(this,e),this.valueChanged=n.createEvent(this,"valueChanged",7),e.$hostElement$["s-ei"]?this.internals=e.$hostElement$["s-ei"]:(this.internals=e.$hostElement$.attachInternals(),e.$hostElement$["s-ei"]=this.internals),this.name="reminder-time",this.eventReminderTimeMinutes=void 0,this.reminderTime=p(this.eventReminderTimeMinutes),this.reminderTimeMinutes=this.eventReminderTimeMinutes??30,this.reminderTimeincrement=h(this.eventReminderTimeMinutes),this.reminderTimeMinutesOptions=m.REMINDER_MINUTE_OPTIONS}elementNameChangedHandler(e){n.debug("nylas-reminder-time","elementNameChangedHandler",e),this.host.setAttribute("name",e)}eventReminderTimeMinutesChangedHandler(e,i){n.debug("nylas-reminder-time","eventReminderTimeMinutesChangedHandler",e),e!==i&&(this.reminderTime=p(e),this.reminderTimeincrement=h(e),this.reminderTimeMinutes=e)}reminderTimeMinutesChangedHandler(e,i){n.debug("nylas-reminder-time","reminderTimeMinutesChangedHandler",e),e!==i&&this.valueChanged.emit({value:e.toString(),name:this.name})}connectedCallback(){n.debug("nylas-reminder-time","connectedCallback")}componentWillLoad(){n.debug("nylas-reminder-time","componentWillLoad"),this.host.setAttribute("name",this.name),this.setReminderTimeMinuteOptions()}componentDidLoad(){n.debug("nylas-reminder-time","componentDidLoad")}disconnectedCallback(){n.debug("nylas-reminder-time","disconnectedCallback")}setReminderTimeMinuteOptions(){return this.reminderTimeincrement===1?this.reminderTimeMinutesOptions=m.REMINDER_MINUTE_OPTIONS:this.reminderTimeincrement===60?this.reminderTimeMinutesOptions=m.REMINDER_HOUR_OPTIONS:this.reminderTimeMinutesOptions=m.REMINDER_DAY_OPTIONS,this.reminderTimeMinutesOptions}nylasFormDropdownChangedHandler(e){n.debug("nylas-calendar-picker","nylasFormDropdownChangedHandler",e.detail);const{value:i}=e.detail;this.reminderTimeincrement=parseInt(i),this.reminderTimeincrement===1?this.reminderTime=60:this.reminderTime=1,this.setReminderTimeMinuteOptions(),this.reminderTimeMinutes=this.reminderTime*this.reminderTimeincrement,this.internals.setFormValue(this.reminderTimeMinutes.toString(),this.name)}inputOptionChangedHandler(e){n.debug("nylas-calendar-picker","inputOptionChangedHandler",e.detail);const{value:i}=e.detail;this.reminderTime=i,this.reminderTimeMinutes=this.reminderTime*this.reminderTimeincrement,this.internals.setFormValue(this.reminderTimeMinutes.toString(),this.name)}render(){const e=[{value:1,label:"minute"},{value:60,label:"hour"},{value:1440,label:"day"}];return n.h(n.Host,{key:"d08ccb2f53caf574942db1bc7f805927ad5a2b9a"},n.h("div",{key:"7a2969e3256bfc79d28686c3ade4c981b7425300",class:"nylas-reminder-time",part:"nrt"},n.h("div",{key:"625bb82d848d490b65463cc2102ddb5f1cdaaad8",class:"nylas-reminder-time__wrapper"},n.h("input-dropdown",{key:"5cf299dee023154ae01545f55c5c3a126ff08cc0",name:"reminder-time",options:this.reminderTimeMinutesOptions,inputValue:this.reminderTime.toString(),exportparts:"id_dropdown: nrt__input_dropdown, id_dropdown-input: nrt__input_dropdown-input, id_dropdown-content: nrt__input_dropdown-content",defaultInputOption:this.reminderTimeMinutesOptions.find(i=>i.value==this.reminderTime)??e[0]}),n.h("select-dropdown",{key:"95ef5eae4f8fc8b73ed8efc4601cac5e0303c858",name:"reminder-time-unit",options:e,pluralizedLabel:this.reminderTime>1?"s":"",exportparts:"sd_dropdown: nrt__dropdown, sd_dropdown-button: nrt__dropdown-button, sd_dropdown-content: nrt__dropdown-content",defaultSelectedOption:e.find(i=>i.value==this.reminderTimeincrement)??e[0],withSearch:!1}))))}static get formAssociated(){return!0}get host(){return n.getElement(this)}static get watchers(){return{name:["elementNameChangedHandler"],eventReminderTimeMinutes:["eventReminderTimeMinutesChangedHandler"],reminderTimeMinutes:["reminderTimeMinutesChangedHandler"]}}};T([f.RegisterComponent({name:"nylas-reminder-time",eventToProps:{},fireRegisterEvent:!0}),o("design:type",Function),o("design:paramtypes",[]),o("design:returntype",void 0)],c.prototype,"render",null);c.style=b;const g=".sc-trash-icon-h{display:flex}",_=g,u=class{constructor(e){n.registerInstance(this,e),this.width="20",this.height="21"}render(){return n.h("svg",{key:"a2388fd5adfdf9cc72ace3f37609cac599f9d5f2",width:this.width,height:this.height,viewBox:"0 0 20 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n.h("path",{key:"f25ec7d671b53f59f83b250205f5a399f36daba4",d:"M10 0.25C11.733 0.25 13.1492 1.60645 13.2449 3.31558L13.25 3.5H18.5C18.9142 3.5 19.25 3.83579 19.25 4.25C19.25 4.6297 18.9678 4.94349 18.6018 4.99315L18.5 5H17.704L16.4239 18.0192C16.2912 19.3683 15.1984 20.41 13.8626 20.4945L13.6871 20.5H6.31293C4.95734 20.5 3.81365 19.5145 3.59883 18.1934L3.57614 18.0192L2.295 5H1.5C1.1203 5 0.806509 4.71785 0.756847 4.35177L0.75 4.25C0.75 3.8703 1.03215 3.55651 1.39823 3.50685L1.5 3.5H6.75C6.75 1.70507 8.20507 0.25 10 0.25ZM16.197 5H3.802L5.06893 17.8724C5.12768 18.4696 5.60033 18.9343 6.18585 18.9936L6.31293 19H13.6871C14.2872 19 14.7959 18.5751 14.9123 17.9982L14.9311 17.8724L16.197 5ZM11.75 7.75C12.1297 7.75 12.4435 8.03215 12.4932 8.39823L12.5 8.5V15.5C12.5 15.9142 12.1642 16.25 11.75 16.25C11.3703 16.25 11.0565 15.9678 11.0068 15.6018L11 15.5V8.5C11 8.08579 11.3358 7.75 11.75 7.75ZM8.25 7.75C8.6297 7.75 8.94349 8.03215 8.99315 8.39823L9 8.5V15.5C9 15.9142 8.66421 16.25 8.25 16.25C7.8703 16.25 7.55651 15.9678 7.50685 15.6018L7.5 15.5V8.5C7.5 8.08579 7.83579 7.75 8.25 7.75ZM10 1.75C9.08183 1.75 8.32881 2.45711 8.2558 3.35647L8.25 3.5H11.75C11.75 2.5335 10.9665 1.75 10 1.75Z",fill:"currentColor"}))}};u.style=_;exports.nylas_reminder_time=c;exports.trash_icon=u;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-6b9d4b01.cjs"),E=require("./index.es-b475d61f-68a74a28.cjs"),D=require("./scheduler-store-908886c8-62d14677.cjs"),A=require("./constants-c31dccfe-1a739653.cjs"),x=require("./feedbackSync-ab657d65-e650e46d.cjs");require("react");require("react-dom");class q{constructor({schedulerAPIURL:t,nylasSchedulerStore:i,sessionId:a,configId:s,slug:d,clientId:r}){if(!t)throw new Error("schedulerAPIURL is required");if(!i)throw new Error("nylasSchedulerStore is required");if(!a&&!s&&!(d||r))throw new Error("sessionId is required for private configs. If using public config either pass a configurationId or a combination of slug and clientId.");t==="/"&&(t=new URL(window.location.href).origin),this.configId=s,this.sessionId=a,this.schedulerAPIURL=t,this.nylasSchedulerStore=i,this.slug=d,this.clientId=r}init(){e.debug("NylasConnector init")}get schedulerStore(){return this.nylasSchedulerStore}get scheduler(){return this._schedulerAPIConnector?this._schedulerAPIConnector:(this._schedulerAPIConnector=new D.NylaSchedulerAPIConnector({schedulerAPIURL:this.schedulerAPIURL,schedulerStore:this.schedulerStore,sessionId:this.sessionId,configId:this.configId,slug:this.slug,clientId:this.clientId}),this._schedulerAPIConnector)}resetStores(){this.nylasSchedulerStore.reset()}}const w=(n,t)=>{const i=n.isLoading,a=n.showNotification,s=n.nylasBranding;return e.h(e.Fragment,null,a&&e.h("nylas-notification",null),i&&e.h("div",{class:"loading"},e.h("div",{class:"left"},e.h("div",{class:"skeleton"})),e.h("div",{class:"right"},e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}),e.h("div",{class:"skeleton"}))),!i&&t,e.h("div",{class:"footer"},s&&e.h(e.Fragment,null,"Powered by ",e.h("nylas-logo",null))))},N=(n,t)=>e.h("div",{class:"message-banner"},t),W=':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-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;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{padding:0.5rem 4px 0;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}}.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;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 svg{fill:var(--nylas-base-500)}.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}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}',$=W,M={title:e.instance.t("genericErrorTitle"),type:E.nr.Error,category:D.ErrorCategory.Component},j=class{constructor(n){e.registerInstance(this,n),this.init=e.createEvent(this,"init",7),this.schedulerWillLoad=e.createEvent(this,"schedulerWillLoad",7),this.schedulerDidLoad=e.createEvent(this,"schedulerDidLoad",7),this.nylasSchedulerError=e.createEvent(this,"nylasSchedulerError",7),this.configSettingsLoaded=e.createEvent(this,"configSettingsLoaded",7),this.bookingRefExtracted=e.createEvent(this,"bookingRefExtracted",7),this.bookedEventInfo=e.createEvent(this,"bookedEventInfo",7),this.mode="app",this.defaultSchedulerState=void 0,this.sessionId=void 0,this.schedulerApiUrl="https://api.us.nylas.com",this.bookingInfo=void 0,this.rescheduleBookingRef=void 0,this.cancelBookingRef=void 0,this.organizerConfirmationBookingRef=void 0,this.configurationId=void 0,this.slug=void 0,this.clientId=void 0,this.nylasBranding=!0,this.eventOverrides={},this.isLoading=void 0,this.themeConfig=void 0,this.localization=void 0,this.showNotification=!0,this.enableUserFeedback=!0,this.automaticComponentRegistration=!0,this.selectedDateLabel=new Date().toLocaleDateString(void 0,{dateStyle:"full"})||`${e.instance.t("noDateSelected")}`,this.refConfigId=void 0,this.language=navigator.language,this.showFeedbackModal=!1}connectedCallback(){e.debug("[nylas-scheduler] connectedCallback")}async componentWillLoad(){var s,d;e.debug("[nylas-scheduler] Component will load"),this.enableUserFeedback&&!x.isInitialized()&&x.init({dsn:"https://9d5731f1c77ca84c9ed3fb9b3ccf7ee1@o74852.ingest.us.sentry.io/4507889638178816",release:"1.1.4",integrations:r=>[...r.filter(o=>!1),x.feedbackSyncIntegration({colorScheme:"system",autoInject:!1})],autoSessionTracking:!1,beforeSend:()=>null});const n=this.schedulerWillLoad.emit(this.host);if("schedulerWillLoad"in this.eventOverrides&&(await this.eventOverrides.schedulerWillLoad(n,this.nylasSchedulerConnector),n.defaultPrevented))return;this.stores={scheduler:D.CreateNylasSchedulerStore({bookingInfo:this.bookingInfo,nylasBranding:this.nylasBranding,...this.defaultSchedulerState})},this.baseProvider=new E.NylasBaseProvider(this.host,this.stores,this.automaticComponentRegistration,this.eventOverrides),this.refConfigId=this.configurationId;let t;if(this.rescheduleBookingRef){const[r,o,c]=e.compactStringToUUIDs(this.rescheduleBookingRef);this.refConfigId=r,this.stores.scheduler.set("rescheduleBookingId",o),t=this.bookingRefExtracted.emit({configurationId:r,bookingId:o})}else if(this.cancelBookingRef){const[r,o,c]=e.compactStringToUUIDs(this.cancelBookingRef);this.refConfigId=r,this.stores.scheduler.set("cancelBookingId",o),t=this.bookingRefExtracted.emit({configurationId:r,bookingId:o})}else if(this.organizerConfirmationBookingRef){const[r,o,c]=e.compactStringToUUIDs(this.organizerConfirmationBookingRef);this.refConfigId=r,this.stores.scheduler.set("organizerConfirmationBookingId",o),this.stores.scheduler.set("organizerConfirmationSalt",c),t=this.bookingRefExtracted.emit({configurationId:r,bookingId:o,salt:c})}if("bookingRefExtracted"in this.eventOverrides&&(await this.eventOverrides.bookingRefExtracted(t,this.nylasSchedulerConnector),t.defaultPrevented)||!this.checkIfSessionIdOrConfigIdExists())return;const i=(s=this.baseProvider)==null?void 0:s.getStore("scheduler");this.nylasSchedulerConnector=new q({schedulerAPIURL:this.schedulerApiUrl,sessionId:this.sessionId,configId:this.refConfigId,slug:this.slug,clientId:this.clientId,nylasSchedulerStore:i});const a=this.init.emit(this.host);"init"in this.eventOverrides&&(await this.eventOverrides.init(a,this.nylasSchedulerConnector),a.defaultPrevented)||((d=this.baseProvider)==null||d.componentWillLoad(this.nylasSchedulerConnector),this.applyThemeConfig(this.themeConfig))}async componentDidLoad(){var c,k,b,g,m,f,u,_;(c=this.baseProvider)==null||c.componentDidLoad();const n=this.schedulerDidLoad.emit(this.host);if("schedulerDidLoad"in this.eventOverrides&&(await this.eventOverrides.schedulerDidLoad(n,this.nylasSchedulerConnector),n.defaultPrevented)||!this.checkIfSessionIdOrConfigIdExists())return;this.localizationChanged(this.localization);const t=await((k=this.nylasSchedulerConnector)==null?void 0:k.scheduler.getUISettings());if(!t||"error"in t){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(t==null?void 0:t.error)},host:this.host});return}else{"data"in t&&((b=t.data)!=null&&b.appearance)&&console.info("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 h=this.configSettingsLoaded.emit({settings:t});if("configSettingsLoaded"in this.eventOverrides&&(await this.eventOverrides.configSettingsLoaded(h,this.nylasSchedulerConnector),h.defaultPrevented))return}const i=(g=this.baseProvider)==null?void 0:g.getStore("scheduler"),a=(f=(m=i==null?void 0:i.get("configSettings"))==null?void 0:m.scheduler)==null?void 0:f.available_days_in_future,s=i==null?void 0:i.get("selectedTimeslot");if(s&&(s!=null&&s.start_time)){if(!this.isTimeslotValid(s))return;if(i!=null&&i.get("showBookingForm")){i==null||i.set("selectedDate",s.start_time);return}}const d=i==null?void 0:i.get("selectedDate"),r=i==null?void 0:i.get("availability");let o;if(!(r&&r.length>0)){if(d){const{startTime:h,endTime:l,endTimeForAvailableDaysInFuture:v}=this.validateAvailableDaysInFuture(d,a||30);d.getTime()<v*1e3&&(o=await((_=this.nylasSchedulerConnector)==null?void 0:_.scheduler.getAvailability(h,l)))}else{const h=new Date,{startTime:l,endTime:v,endTimeForAvailableDaysInFuture:C}=this.validateAvailableDaysInFuture(h,a||30);h.getTime()<C*1e3&&(o=await((u=this.nylasSchedulerConnector)==null?void 0:u.scheduler.getAvailability(l,v)))}if((!o||"error"in o)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(o==null?void 0:o.error)},host:this.host}),!d){let h=new Date;const l=i==null?void 0:i.get("availability").find(v=>new Date(v.start_time)>new Date);l&&(h=l.start_time),i==null||i.set("selectedDate",h)}}}componentDisconnected(){var n;(n=this.baseProvider)==null||n.componentDisconnected()}bookingInfoChanged(n){var t;(t=this.stores)==null||t.scheduler.set("bookingInfo",n)}rescheduleBookingRefChanged(n){var t,i;if(n){const[a,s]=e.compactStringToUUIDs(n);(t=this.stores)==null||t.scheduler.set("rescheduleBookingId",s),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}cancelBookingRefChanged(n){var t,i;if(n){const[a,s]=e.compactStringToUUIDs(n);(t=this.stores)==null||t.scheduler.set("cancelBookingId",s),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}organizerConfirmationBookingRefChanged(n){var t,i;if(n){const[a,s]=e.compactStringToUUIDs(n);(t=this.stores)==null||t.scheduler.set("organizerConfirmationBookingId",s),this.refConfigId=a,(i=this.nylasSchedulerConnector)==null||i.scheduler.setConfigId(a)}}localizationChanged(n){n&&Object.keys(n).forEach(t=>{t in A.LANGUAGE_CODE&&(e.instance.addResourceBundle(t,"translation",n[t],!1,!0),this.language=this.language)})}themeConfigChanged(n){this.applyThemeConfig(n)}languageChanged(n){const t=n.detail;this.language=t,e.instance.changeLanguage(t)}async registerComponentHandler(n){var t;(t=this.baseProvider)==null||t.registerComponent(n.detail)}async unregisterComponentHandler(n){var t;(t=this.baseProvider)==null||t.unregisterComponent(n.detail)}async monthChangedHandler(n){var r,o,c,k,b,g,m;const t=n.detail,i=(k=(c=(o=(r=this.nylasSchedulerConnector)==null?void 0:r.schedulerStore)==null?void 0:o.get("configSettings"))==null?void 0:c.scheduler)==null?void 0:k.available_days_in_future,{startTime:a,endTime:s,endTimeForAvailableDaysInFuture:d}=this.validateAvailableDaysInFuture(t,i||30);if(a<d&&t.getTime()<d*1e3){const f=await((b=this.nylasSchedulerConnector)==null?void 0:b.scheduler.getAvailability(a,s));(!f||"error"in f)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(f==null?void 0:f.error)},host:this.host});const u=(g=this.stores)==null?void 0:g.scheduler.get("selectableDates");u&&u.length>0&&((m=this.stores)==null||m.scheduler.set("selectedDate",u[0]))}}mapToBookingData(n){var r,o,c;const t=(r=this.stores)==null?void 0:r.scheduler.get("selectedTimeslot"),i=(o=this.stores)==null?void 0:o.scheduler.get("selectedLanguage"),a=(c=this.stores)==null?void 0:c.scheduler.get("selectedTimezone"),s=t!=null&&t.start_time?new Date(t==null?void 0:t.start_time).getTime()/1e3:"",d=t!=null&&t.end_time?new Date(t==null?void 0:t.end_time).getTime()/1e3:"";return{additional_guests:n.guests,guest:n.primaryParticipant,additional_fields:n.additionalFields,start_time:s,end_time:d,email_language:i,timezone:a}}async bookButtonClickedHandler(n){var b,g,m,f,u,_,h;const t=n.detail,i=this.mapToBookingData(t),s={...(g=(b=this.nylasSchedulerConnector)==null?void 0:b.schedulerStore)==null?void 0:g.get("bookingInfo"),...t};(m=this.stores)==null||m.scheduler.set("bookingInfo",s);const r=(u=(f=this.nylasSchedulerConnector)==null?void 0:f.schedulerStore)==null?void 0:u.get("rescheduleBookingId");if(r){const l=await((_=this.nylasSchedulerConnector)==null?void 0:_.scheduler.rescheduleBooking(r,t));(!l||"error"in l)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(l==null?void 0:l.error)},host:this.host});const v=l==null?void 0:l.data,C=this.bookedEventInfo.emit({...l,data:{...v,...i}});"bookedEventInfo"in this.eventOverrides&&await this.eventOverrides.bookedEventInfo(C,this.nylasSchedulerConnector);return}const o=await((h=this.nylasSchedulerConnector)==null?void 0:h.scheduler.bookTimeslot(t));(!o||"error"in o)&&this.nylasSchedulerError.emit({notification:{...this.getErrorObject(o==null?void 0:o.error)},host:this.host});const c=o==null?void 0:o.data,k=this.bookedEventInfo.emit({...o,data:{...c,...i}});"bookedEventInfo"in this.eventOverrides&&await this.eventOverrides.bookedEventInfo(k,this.nylasSchedulerConnector)}dateSelectedHandler(n){const t=n.detail;this.selectedDateLabel=t?t.toLocaleDateString(void 0,{dateStyle:"full"}):`${e.instance.t("noDateSelected")}`}cancelBookedEventErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}cancelBookedEventValidationErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}rescheduleBookedEventErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}confirmBookingErrorHandler(n){this.nylasSchedulerError.emit({notification:{...this.getErrorObject(n.detail.error)},host:this.host})}feedbackModalClosedHandler(){this.showFeedbackModal=!1}feedbackSubmittedHandler(n){const i={eventId:x.captureMessage("Scheduling Page User Feedback"),message:n.detail.feedback};x.captureFeedback(i,{includeReplay:!0,captureContext:{tags:{"nylas-web-element":"nylas-schduling","nylas-web-element-version":"1.1.4"},extra:{configId:this.configurationId,slug:this.slug}}}),this.showFeedbackModal=!1}async getNylasSchedulerStore(){var n;return(n=this.baseProvider)==null?void 0:n.getStore("scheduler")}async getNylasSchedulerConnector(){return this.nylasSchedulerConnector}async getRef(){return this.host}getErrorObject(n){return{title:(n==null?void 0:n.title)||M.title,category:(n==null?void 0:n.category)||M.category,type:E.nr.Error,description:(n==null?void 0:n.message)||"",id:new Date().getTime().toString(),ttl:"none"}}checkIfSessionIdOrConfigIdExists(){if(!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)){let n="";return this.sessionId||(n+=e.instance.t("sessionIdRequiredErrorMessage")),!this.sessionId&&!this.refConfigId&&!(this.slug&&this.clientId)&&(n=e.instance.t("sessionIdRequiredErrorMessage")+" "+e.instance.t("publicConfigErrorMessage")),this.nylasSchedulerError.emit({notification:{title:e.instance.t("schedulingComponentErrorTitle"),category:D.ErrorCategory.Component,type:E.nr.Error,description:n,id:new Date().getTime().toString(),ttl:"none"},host:this.host}),!1}return!0}isTimeslotValid(n){return new Date(n.start_time)<new Date?(this.nylasSchedulerError.emit({notification:{title:e.instance.t("invalidTimeslotErrorTitle"),category:D.ErrorCategory.Component,type:E.nr.Error,description:e.instance.t("invalidTimeslotErrorMessage"),id:new Date().getTime().toString(),ttl:"none"},host:this.host}),!1):!0}validateAvailableDaysInFuture(n,t){const i=new Date,a=new Date(n.getFullYear(),n.getMonth(),1).getTime()/1e3,s=new Date(n.getFullYear(),n.getMonth()+1,1).getTime()/1e3,d=Math.floor(e.addDaysToCurrentDate(i,t).getTime()/1e3),r=Math.min(d,s);return{startTime:a<i.getTime()/1e3?Math.floor(i.getTime()/1e3):a,endTime:r,endTimeForAvailableDaysInFuture:d}}applyThemeConfig(n){if(n)for(const[t,i]of Object.entries(n))this.host.style.setProperty(`${t}`,i)}onFeedbackClick(){this.showFeedbackModal=!0}render(){var u,_,h,l,v,C,T,L,F,S,z;const n=this.mode==="app",t=(u=this.baseProvider)==null?void 0:u.getStore("scheduler"),i=t==null?void 0:t.get("eventInfo"),a=t==null?void 0:t.get("showBookingForm"),s=t==null?void 0:t.get("cancelledEventInfo"),d=t==null?void 0:t.get("cancelBookingId"),r=t==null?void 0:t.get("selectedTimeslot"),o=t==null?void 0:t.get("rescheduleBookingId"),c=t==null?void 0:t.get("organizerConfirmationBookingId"),k=t==null?void 0:t.get("rejectBookingId"),b=t==null?void 0:t.get("confirmedEventInfo"),g=(t==null?void 0:t.get("nylasBranding"))||this.nylasBranding,m=t==null?void 0:t.get("selectedDate"),f=(h=(_=t==null?void 0:t.get("configSettings"))==null?void 0:_.scheduler)==null?void 0:h.confirmation_redirect_url;if(this.selectedDateLabel=m&&this.language?e.capitalizeFirstLetter(m.toLocaleDateString(A.LANGUAGE_CODE_MAP[this.language],{dateStyle:"full"})):`${e.instance.t("noDateSelected")}`,n&&(d||k)&&!s)return e.h(e.Host,null,e.h(w,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"cancel-flow-page",part:"cancel-flow-page"},e.h("nylas-cancel-booking-form",{selectedTimeslot:r,cancelBookingId:d,rejectBookingId:k,exportparts:"ncbf, ncbf__icon, ncbf__title, ncbf__description, ncbf__reason-textarea, ncbf__button-cta, ncbf__button-outline, ncbf__card"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:()=>this.onFeedbackClick()},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&c)return e.h(e.Host,null,e.h(w,null,e.h("div",{class:"manual-confirmation-page",part:"manual-confirmation-page"},e.h("nylas-organizer-confirmation-card",{organizerConfirmationBookingId:c,exportparts:"nmcc, nmcc__title, nmcc__description, nmcc__button-cta, nmcc__button-outline"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:()=>this.onFeedbackClick()},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&s)return e.h(e.Host,null,e.h(w,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"cancelled-event-page",part:"cancelled-event-page"},e.h("nylas-cancelled-event-card",{cancelledEventInfo:s,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:()=>this.onFeedbackClick()},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&b)return e.h(e.Host,null,e.h(w,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"cancelled-event-page",part:"confirmed-event-page"},e.h("nylas-confirmed-event-card",{confirmedEventInfo:b,exportparts:"ncec, ncec__icon, ncec__title, ncec__description, ncec__button-outline, ncec__card"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:()=>this.onFeedbackClick()},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&i&&f){const y=(v=(l=this.stores)==null?void 0:l.scheduler.get("bookingInfo"))==null?void 0:v.primaryParticipant,R=(T=(C=this.stores)==null?void 0:C.scheduler.get("bookingInfo"))==null?void 0:T.additionalFields,I=(L=this.stores)==null?void 0:L.scheduler.get("selectedTimeslot"),O=(F=this.stores)==null?void 0:F.scheduler.get("selectedTimezone"),P=(S=this.stores)==null?void 0:S.scheduler.get("selectedLanguage"),B=(z=this.stores)==null?void 0:z.scheduler.get("configSettings"),U=this.configurationId?this.configurationId:B==null?void 0:B.configuration_id,H=window.location.search,p=new URLSearchParams(H);p.set("booking_id",i.booking_id),y!=null&&y.name&&p.set("name",y.name),y!=null&&y.email&&p.set("email",y.email),I!=null&&I.start_time&&p.set("start_time",(new Date(I.start_time).getTime()/1e3).toString()),I!=null&&I.end_time&&p.set("end_time",(new Date(I.end_time).getTime()/1e3).toString()),O&&p.set("tz",O),P&&p.set("language",P),R&&p.set("additional_values",JSON.stringify(R)),this.slug&&p.set("page_slug",this.slug),U&&p.set("config_id",U),window.location.assign(`${f}?${p.toString()}`);return}if(n&&i)return e.h(e.Host,null,e.h(w,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},e.h("div",{class:"booked-event-page",part:"booked-event-page"},e.h("nylas-booked-event-card",{selectedTimeslot:r,eventInfo:i,exportparts:"nbec, nbec__title, nbec__card, nbec__description, nbec__button-outline, nbec__cancel-cta, nbec__reschedule-cta"}))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:()=>this.onFeedbackClick()},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null));if(n&&(!i||o)&&!a){const y=this.host.querySelector('[slot="timeslot-picker-cta-label"]');return e.h(e.Host,null,e.h(w,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},o&&e.h(N,null,`${e.instance.t("rescheduleTitle")}`),e.h("div",{class:"select-date-page",part:"select-date-page"},e.h("div",{class:"left-panel"},e.h("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.h("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.h("div",{class:`right-panel ${o?"reschedule":""}`},e.h("h2",null,e.h("calendar-icon",null),e.h("span",{id:"selectedDate"},this.selectedDateLabel)),e.h("nylas-timeslot-picker",{exportparts:"ntp, ntp__timeslot, ntp__timeslot--selected, ntp__button-primary"},y&&e.h("span",{slot:"timeslot-picker-cta-label"},e.h("slot",{name:"timeslot-picker-cta-label"})))))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:()=>this.onFeedbackClick()},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null))}return n&&!i&&a?e.h(e.Host,null,e.h(w,{nylasBranding:g,isLoading:this.isLoading,showNotification:this.showNotification},o&&e.h(N,null,`${e.instance.t("rescheduleTitle")}`),e.h("div",{class:"additional-data-page",part:"additional-data-page"},e.h("div",{class:"left-panel"},e.h("div",{class:"wrapper"},e.h("nylas-selected-event-card",{exportparts:"nsec, nsec__card, nsec__icon, nsec__date, nsec__time, nsec__timezone"}))),e.h("div",{class:`right-panel ${o?"reschedule":""}`},e.h("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"})))),this.enableUserFeedback&&e.h("button-component",{id:"report-issue",variant:"basic",onClick:()=>this.onFeedbackClick()},e.h("feedback-icon",null)),this.showFeedbackModal&&e.h("nylas-feedback-form",null)):e.h(e.Host,null,e.h("slot",null))}get host(){return e.getElement(this)}static get watchers(){return{bookingInfo:["bookingInfoChanged"],rescheduleBookingRef:["rescheduleBookingRefChanged"],cancelBookingRef:["cancelBookingRefChanged"],organizerConfirmationBookingRef:["organizerConfirmationBookingRefChanged"],localization:["localizationChanged"],themeConfig:["themeConfigChanged"]}}};j.style=$;exports.nylas_scheduling=j;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { r as o, h as t } from "./index-e475e0c0.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
const e = ".sc-play-icon-h{display:flex}", i = e, r = class {
|
|
5
|
-
constructor(s) {
|
|
6
|
-
o(this, s), this.width = "15", this.height = "15";
|
|
7
|
-
}
|
|
8
|
-
render() {
|
|
9
|
-
return t("svg", { key: "1ddd0443515a158f09d0c4e8fd7c79d0645f8540", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "11bd5ae0c5df52b1d51a80f7ec5723b949089fdb", d: "M21 12L3 21V3L21 12Z", stroke: "auto", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }));
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
r.style = i;
|
|
13
|
-
export {
|
|
14
|
-
r as play_icon
|
|
15
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { r as s, h as e } from "./index-e475e0c0.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
const c = ".sc-reply-icon-h{display:flex}", i = c, h = class {
|
|
5
|
-
constructor(t) {
|
|
6
|
-
s(this, t), this.width = "15", this.height = "15";
|
|
7
|
-
}
|
|
8
|
-
render() {
|
|
9
|
-
return e("svg", { key: "ff9ce6eae8940b2b906b6447b9cca4041bbce563", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 1920 1920", xmlns: "http://www.w3.org/2000/svg" }, e("path", { key: "e1d7626352bb59a4d86272c3aadfbc1bc5245ed1", d: "M835.942 632.563H244.966l478.08-478.08-90.496-90.496L-.026 696.563 632.55 1329.14l90.496-90.496-478.08-478.08h590.976c504.448 0 914.816 410.368 914.816 914.816v109.184h128V1675.38c0-574.976-467.84-1042.816-1042.816-1042.816", "fill-rule": "evenodd" }));
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
h.style = i;
|
|
13
|
-
export {
|
|
14
|
-
h as reply_icon
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-6b9d4b01.cjs");require("react");require("react-dom");const c=".sc-reply-icon-h{display:flex}",s=c,t=class{constructor(i){e.registerInstance(this,i),this.width="15",this.height="15"}render(){return e.h("svg",{key:"ff9ce6eae8940b2b906b6447b9cca4041bbce563",fill:"auto",width:this.width,height:this.height,viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"e1d7626352bb59a4d86272c3aadfbc1bc5245ed1",d:"M835.942 632.563H244.966l478.08-478.08-90.496-90.496L-.026 696.563 632.55 1329.14l90.496-90.496-478.08-478.08h590.976c504.448 0 914.816 410.368 914.816 914.816v109.184h128V1675.38c0-574.976-467.84-1042.816-1042.816-1042.816","fill-rule":"evenodd"}))}};t.style=s;exports.reply_icon=t;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const o=require("./index-6b9d4b01.cjs");function s(n={}){const r={selectedConfiguration:{},configurations:[],listConfigurationsNextCursor:null,calendars:[],currentUser:null,action:null,additionalParticipants:[],hideEditorTabs:[],requiresSlug:!1,...n},e=o.createStore(r);function t(){e.set("selectedConfiguration",{...n.selectedConfiguration})}return e.onChange("action",async i=>{i||t()}),{...e,resetSelectedConfiguration:t}}exports.CreateNylasSchedulerConfigStore=s;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const l=require("./index-6b9d4b01.cjs");exports.ErrorCategory=void 0;(function(a){a.Component="component",a.Api="api",a.Auth="auth"})(exports.ErrorCategory||(exports.ErrorCategory={}));var B;(function(a){a.endtime_not_in_future="endtime_not_in_future",a.no_booking_info="no_booking_info",a.no_timeslot_selected="no_timeslot_selected",a.no_timezone_selected="no_timezone_selected",a.no_booking_id="no_booking_id",a.no_salt="no_salt",a.invalid_start_time="invalid_start_time",a.invalid_end_time="invalid_end_time",a.invalid_timezone="invalid_timezone"})(B||(B={}));var E;(function(a){a.invalid_session="invalid_session",a.general_error="general_error",a.internal_error="internal_error",a.invalid_request_error="invalid_request_error",a.timeslot_not_available="timeslot_not_available",a.provider_error="provider_error",a.not_found_error="not_found_error"})(E||(E={}));class C{constructor(){this.component=e=>{const t=exports.ErrorCategory.Component,s=`${e} Error`;return{endtime_not_in_future:(i='"endtime" can not be in the future')=>({title:s,message:i,category:t}),no_booking_info:(i="No booking info provided")=>({title:s,message:i,category:t}),no_timeslot_selected:(i="No timeslot selected")=>({title:s,message:i,category:t}),no_timezone_selected:(i="No timezone selected")=>({title:s,message:i,category:t}),no_booking_id:(i="No booking id provided")=>({title:s,message:i,category:t}),no_salt:(i="No salt provided")=>({title:s,message:i,category:t}),invalid_start_time:(i="Invalid start time")=>({title:s,message:i,category:t}),invalid_end_time:(i="Invalid end time")=>({title:s,message:i,category:t}),invalid_timezone:(i="Invalid timezone")=>({title:s,message:i,category:t})}},this.api=e=>{const t=exports.ErrorCategory.Api,s=`${e} Error`;return{invalid_session:i=>({title:s,message:i,category:t}),general_error:i=>({title:s,message:i,category:t}),internal_error:i=>({title:s,message:i,category:t}),invalid_request_error:i=>({title:s,message:i,category:t}),timeslot_not_available:i=>({title:s,message:i,category:t}),provider_error:i=>({title:s,message:i,category:t}),not_found_error:i=>({title:s,message:i,category:t})}}}}class M{constructor({schedulerAPIURL:e,schedulerStore:t,sessionId:s,configId:i,slug:n,clientId:r}){this.errors=new C,this.schedulerStore=t,this.schedulerAPIURL=e,this.sessionId=s,this.configId=i,this.slug=n,this.clientId=r}getHeaders(){return this.sessionId?{Authorization:`Bearer ${this.sessionId}`}:{}}async makeAPIRequest(e,t,s,i={}){try{const n=new URL(this.schedulerAPIURL);return n.pathname=e,await(await fetch(decodeURIComponent(n.toString()),{method:t,headers:{"Content-Type":"application/json",Origin:window.location.origin,...i},body:s})).json()}catch(n){return{error:{message:n.message,title:"API request failed",type:"api"}}}}getErrorMessage(e){var s,i,n,r;let t=(e==null?void 0:e.message)||(e==null?void 0:e.title)||"Something went wrong";return(e==null?void 0:e.type)==="provider_error"&&(t=((i=(s=e==null?void 0:e.provider_error)==null?void 0:s.error)==null?void 0:i.message)||((r=(n=e==null?void 0:e.provider_error)==null?void 0:n.error)==null?void 0:r.title)||"Something went wrong"),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),l.instance.changeLanguage(e)}async toggleAdditionalData(e){e||await this.refetchAvailability(),this.schedulerStore.set("showBookingForm",e)}setParticipantName(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t==null?void 0:t.primaryParticipant,name:e}})}setParticipantEmail(e){const{bookingInfo:t}=this.schedulerStore.state;this.schedulerStore.set("bookingInfo",{...t,primaryParticipant:{...t==null?void 0:t.primaryParticipant,email:e}})}async refetchAvailability(){const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1).getTime()/1e3,s=t<e.getTime()/1e3?Math.floor(e.getTime()/1e3):t,i=new Date(e.getFullYear(),e.getMonth()+1,1).getTime()/1e3;return await this.getAvailability(s,i)}async resetStoreStateAndFetchAvailability(){const e=new Date,t=await this.refetchAvailability(),s=this.schedulerStore.get("availability").find(n=>new Date(n.start_time)>new Date);let i=e;return s&&(i=s.start_time),this.schedulerStore.set("selectedDate",i),this.schedulerStore.set("eventInfo",null),this.schedulerStore.set("showBookingForm",!1),this.schedulerStore.set("selectedTimeslot",null),t}async setReschedule(e){this.schedulerStore.set("isLoading",!0);const t=this.schedulerStore.state.eventInfo;return t&&this.schedulerStore.set("reschedulingEventInfo",t),this.schedulerStore.set("rescheduleBookingId",e),await this.resetStoreStateAndFetchAvailability().finally(()=>{this.schedulerStore.set("isLoading",!1)})}async setCancel(e){this.schedulerStore.set("cancelBookingId",e)}async setReject(e){this.schedulerStore.set("rejectBookingId",e)}async resetCancel(){const e=await this.resetStoreStateAndFetchAvailability();return this.schedulerStore.set("cancelBookingId",""),this.schedulerStore.set("rejectBookingId",""),this.schedulerStore.set("cancelledEventInfo",null),e}async goBack(){this.schedulerStore.set("cancelBookingId","")}async resetConfirm(){const e=await this.resetStoreStateAndFetchAvailability();return this.schedulerStore.set("organizerConfirmationBookingId",""),this.schedulerStore.set("confirmedEventInfo",void 0),e}async bookTimeslot(e){var I;this.schedulerStore.set("isLoading",!0);const{selectedTimeslot:t,selectedTimezone:s,bookingInfo:i,selectedLanguage:n}=this.schedulerStore.state;if(!e&&!i)return{error:this.errors.component(l.instance.t("createBookingErrorTitle")).no_booking_info()};const r=(e==null?void 0:e.timeslot)||t;if(!r)return{error:this.errors.component(l.instance.t("createBookingErrorTitle")).no_timeslot_selected()};const o=e&&(e!=null&&e.timezone)?e==null?void 0:e.timezone:s;if(!o)return{error:this.errors.component(l.instance.t("createBookingErrorTitle")).no_timezone_selected()};const u=this.schedulerStore.get("availabilityOrderEmails");let m="";if(u.length>0){const S=(r==null?void 0:r.emails)||[];for(let h=0;h<u.length;h++)if(S.includes(u[h])){m=u[h];break}}const d=e?e==null?void 0:e.primaryParticipant:i==null?void 0:i.primaryParticipant,g=e?(e==null?void 0:e.guests)||[]:(i==null?void 0:i.guests)||[],f=e?e==null?void 0:e.additionalFields:i==null?void 0:i.additionalFields,_=this.getHeaders(),v=`/v3/scheduling/bookings${!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:""}`,c=await this.makeAPIRequest(decodeURIComponent(v),"POST",JSON.stringify({participants:m?[{email:m}]:void 0,additional_fields:f,additional_guests:g,guest:{...d},start_time:r.start_time.getTime()/1e3,end_time:r.end_time.getTime()/1e3,timezone:o,email_language:this.getTwoLetterLanguageCode(n)}),_);if("error"in c){this.schedulerStore.set("isLoading",!1);const S=(I=c.error)==null?void 0:I.type;let h=c.error;if(S&&S in this.errors.api("Create Booking")){const T=this.getErrorMessage(h);h=this.errors.api("Create Booking")[S](T)}return{error:h}}return"data"in c&&this.schedulerStore.set("eventInfo",c==null?void 0:c.data),this.schedulerStore.set("isLoading",!1),c}async getUISettings(){var n;this.schedulerStore.set("isLoading",!0);const e=this.getHeaders(),s=`/v3/scheduling/ui-settings${!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:""}`,i=await this.makeAPIRequest(s,"GET",void 0,e);if("error"in i){this.schedulerStore.set("isLoading",!1);const r=(n=i.error)==null?void 0:n.type;let o=i.error;return r&&r in this.errors.api(l.instance.t("getUISettingErrorTitle"))&&(o=this.errors.api(l.instance.t("getUISettingErrorTitle"))[r]((o==null?void 0:o.message)||(o==null?void 0:o.title)||"Something went wrong")),{error:o}}return"data"in i&&this.schedulerStore.set("configSettings",i.data),this.schedulerStore.set("isLoading",!1),i}getTwoLetterLanguageCode(e){return e.split("-")[0]}getStartTimeWithMinBookingNotice(e){var n;const t=(n=this.schedulerStore.get("configSettings"))==null?void 0:n.scheduler,s=t==null?void 0:t.min_booking_notice;if(!s)return e;const i=new Date().getTime();return e<(i+s*60*1e3)/1e3?Math.floor((i+s*60*1e3)/1e3):e}getEndTimeForAvailableDaysInFuture(e){var r,o;const t=new Date,s=(o=(r=this.schedulerStore.get("configSettings"))==null?void 0:r.scheduler)==null?void 0:o.available_days_in_future,i=Math.floor(l.addDaysToCurrentDate(t,s).getTime()/1e3);return Math.min(i,e)}async getAvailability(e=0,t=0){var f,_,p,v;this.schedulerStore.set("isLoading",!0);const s=new URLSearchParams,i=new Date,n=i.getTime();if(t&&t<n/1e3)return this.schedulerStore.set("isLoading",!1),{error:this.errors.component(l.instance.t("getAvailabilityErrorTitle")).endtime_not_in_future()};if(!e){const c=new Date(i.getFullYear(),i.getMonth(),1);e=Math.floor(c.getTime()/1e3)}if(!t){const c=new Date(i.getFullYear(),i.getMonth()+1,0);t=Math.floor(c.getTime()/1e3)}t=this.getEndTimeForAvailableDaysInFuture(t);const r=this.getStartTimeWithMinBookingNotice(e);e=r,t=r>t?r+1:t,s.append("start_time",encodeURIComponent(e.toString())),s.append("end_time",encodeURIComponent(t.toString())),this.configId&&!this.sessionId?s.append("configuration_id",encodeURIComponent(this.configId)):this.slug&&this.clientId&&!this.sessionId&&(s.append("slug",encodeURIComponent(this.slug)),s.append("client_id",encodeURIComponent(this.clientId)));const o=this.schedulerStore.get("rescheduleBookingId");o&&s.append("booking_id",encodeURIComponent(o));const u=s.toString(),m=`/v3/scheduling/availability${u?`?${u}`:""}`,d=this.getHeaders(),g=await this.makeAPIRequest(decodeURIComponent(m),"GET",void 0,d);if("error"in g){this.schedulerStore.set("availability",[]),this.schedulerStore.set("isLoading",!1);const c=(f=g.error)==null?void 0:f.type;let I=g.error;if(c&&c in this.errors.api(l.instance.t("getAvailabilityErrorTitle"))){const S=this.getErrorMessage(I);I=this.errors.api(l.instance.t("getAvailabilityErrorTitle"))[c](S)}return{error:I}}if("data"in g){const I=(((p=(_=g.data)==null?void 0:_.time_slots)==null?void 0:p.map(h=>({...h,start_time:new Date(h.start_time*1e3),end_time:new Date(h.end_time*1e3)})))||[]).filter(h=>h.start_time.getTime()>n);this.schedulerStore.set("availability",I);const S=((v=g.data)==null?void 0:v.order)||[];this.schedulerStore.set("availabilityOrderEmails",S)}return this.schedulerStore.set("isLoading",!1),g}async cancelBooking(e,t){var o;if(this.schedulerStore.set("isLoading",!0),!e)return{error:this.errors.component(l.instance.t("cancelBookingErrorTitle")).no_booking_id()};const s=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"",i=`/v3/scheduling/bookings/${e}${s}`,n=this.getHeaders(),r=await this.makeAPIRequest(decodeURIComponent(i),"DELETE",JSON.stringify({action:"cancel",cancellation_reason:t}),n);if("error"in r){this.schedulerStore.set("isLoading",!1);const u=(o=r.error)==null?void 0:o.type;let m=r.error;if(u&&u in this.errors.api(l.instance.t("cancelBookingErrorTitle"))){const d=this.getErrorMessage(m);m=this.errors.api(l.instance.t("cancelBookingErrorTitle"))[u](d)}return{error:m}}return this.schedulerStore.set("cancelledEventInfo",{booking_id:e}),this.schedulerStore.set("rescheduleBookingId",""),this.schedulerStore.set("isLoading",!1),r}async rescheduleBooking(e,t){var L;if(this.schedulerStore.set("isLoading",!0),!e)return{error:this.errors.component(l.instance.t("rescheduleBookingErrorTitle")).no_booking_id()};const s=this.errors.api(l.instance.t("rescheduleBookingErrorTitle")),i=this.errors.component(l.instance.t("rescheduleBookingErrorTitle")),{bookingInfo:n,selectedTimeslot:r,selectedTimezone:o,selectedLanguage:u}=this.schedulerStore.state,{startTime:m,endTime:d,timezone:g}=t,f=m||(r==null?void 0:r.start_time);if(!f)return{error:i.invalid_start_time('Please pass "startTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const _=d||(r==null?void 0:r.end_time);if(!_)return{error:i.invalid_end_time('Please pass "endTime" in data or set "selectedTimeslot" in the defaultSchedulerState.')};const p=this.schedulerStore.get("availabilityOrderEmails");let v="";if(p.length>0){const b=(r==null?void 0:r.emails)||[];for(let k=0;k<p.length;k++)if(b.includes(p[k])){v=p[k];break}}const c=g||o;if(!c)return{error:i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')};const I=t?t==null?void 0:t.primaryParticipant:n==null?void 0:n.primaryParticipant,S=t?(t==null?void 0:t.guests)||[]:(n==null?void 0:n.guests)||[],h=t?t==null?void 0:t.additionalFields:n==null?void 0:n.additionalFields,T=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"",D=`/v3/scheduling/bookings/${e}${T}`,A=this.getHeaders(),y=await this.makeAPIRequest(decodeURIComponent(D),"PATCH",JSON.stringify({start_time:f.getTime()/1e3,end_time:_.getTime()/1e3,timezone:c,additional_fields:h,guest:{...I},additional_guests:S,participants:v?[{email:v}]:void 0,email_language:this.getTwoLetterLanguageCode(u)}),A);if("error"in y){this.schedulerStore.set("isLoading",!1);const b=(L=y.error)==null?void 0:L.type;let k=y.error;if(b&&b in s){const P=this.getErrorMessage(k);k=s[b](P)}return{error:k}}const w=this.schedulerStore.get("reschedulingEventInfo");if("data"in y)this.schedulerStore.set("eventInfo",y==null?void 0:y.data);else if(w)this.schedulerStore.set("eventInfo",w);else{const b={booking_id:e};this.schedulerStore.set("eventInfo",b)}return this.schedulerStore.set("isLoading",!1),y}async updateBooking(e){var g;this.schedulerStore.set("isLoading",!0);const{bookingId:t,status:s,reason:i}=e,n=this.schedulerStore.get("organizerConfirmationSalt"),r=s==="confirmed"?l.instance.t("confirmBookingErrorTitle"):l.instance.t("rejectBookingErrorTitle");if(!t)return{error:this.errors.component(r).no_booking_id()};if(!n)return{error:this.errors.component(r).no_salt()};const o=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"",u=`/v3/scheduling/bookings/${t}${o}`,m=this.getHeaders(),d=await this.makeAPIRequest(decodeURIComponent(u),"PUT",JSON.stringify({status:s,cancellation_reason:i,salt:n}),m);if("error"in d){this.schedulerStore.set("isLoading",!1);const f=(g=d.error)==null?void 0:g.type;let _=d.error;if(f&&f in this.errors.api(r)){const p=this.getErrorMessage(_);_=this.errors.api(r)[f](p)}return{error:_}}return"data"in d&&s==="confirmed"?this.schedulerStore.set("confirmedEventInfo",d==null?void 0:d.data):"request_id"in d&&s==="cancelled"&&this.schedulerStore.set("cancelledEventInfo",{booking_id:t}),this.schedulerStore.set("organizerConfirmationBookingId",""),this.schedulerStore.set("isLoading",!1),d}}function z(a={}){const e={selectedDate:null,selectedLanguage:navigator.language,selectedTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone,selectedTimeslot:null,showBookingForm:!1,availabilityOrderEmails:[],selectableDates:null,availability:[],eventDuration:0,state:"ready",eventInfo:null,cancelledEventInfo:null,isLoading:!1,nylasBranding:!0,...a};l.debug("[defaultNylasStoreState]: ",e);const t=l.createStore(e);return t.onChange("availability",s=>{l.debug("[availability]: ",s);const i=s.map(o=>o.start_time);l.debug("[selectableDates]: ",i),t.set("selectableDates",i);const n=s[0];if(!n)return;const r=Math.floor((n.end_time.getTime()-n.start_time.getTime())/6e4);l.debug("[durationMinutes]: ",r),t.set("eventDuration",r)}),t.reset=()=>{for(const s in e){const i=e[s];t.set(s,i)}},t}exports.CreateNylasSchedulerStore=z;exports.NylaSchedulerAPIConnector=M;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { r as s, h as t } from "./index-e475e0c0.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
const o = ".sc-sent-icon-h{display:flex}", c = o, i = class {
|
|
5
|
-
constructor(e) {
|
|
6
|
-
s(this, e), this.width = "15", this.height = "15";
|
|
7
|
-
}
|
|
8
|
-
render() {
|
|
9
|
-
return t("svg", { key: "ec136b89f7f2b0197afb45c484bfa3522d4ae1d5", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "17bc4373136f93e96aec9b21889b45b10af6a2ab", d: "M21.5 12L3.5 3.5L3.5 20.5L21.5 12Z", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "e31a3e42fcf8e7cd579909e0b3098e7cbf42a2e1", d: "M3.5 3.5L12 10.5", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "1420a9f87c9f9c607873ce49cb4cb0d714595f61", d: "M3.5 20.5L12 13.5", stroke: "auto", "stroke-width": "1.5" }));
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
i.style = c;
|
|
13
|
-
export {
|
|
14
|
-
i as sent_icon
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-6b9d4b01.cjs");require("react");require("react-dom");const c=".sc-sent-icon-h{display:flex}",i=c,t=class{constructor(s){e.registerInstance(this,s),this.width="15",this.height="15"}render(){return e.h("svg",{key:"ec136b89f7f2b0197afb45c484bfa3522d4ae1d5",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"17bc4373136f93e96aec9b21889b45b10af6a2ab",d:"M21.5 12L3.5 3.5L3.5 20.5L21.5 12Z",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"e31a3e42fcf8e7cd579909e0b3098e7cbf42a2e1",d:"M3.5 3.5L12 10.5",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"1420a9f87c9f9c607873ce49cb4cb0d714595f61",d:"M3.5 20.5L12 13.5",stroke:"auto","stroke-width":"1.5"}))}};t.style=i;exports.sent_icon=t;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { r as s, h as t } from "./index-e475e0c0.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
const o = ".sc-spam-icon-h{display:flex}", i = o, c = class {
|
|
5
|
-
constructor(e) {
|
|
6
|
-
s(this, e), this.width = "15", this.height = "15";
|
|
7
|
-
}
|
|
8
|
-
render() {
|
|
9
|
-
return t("svg", { key: "1f4df1b1d3841e97d630b22f2864201ccf7ee47e", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "62e5cd0142dbc10bec2e8c9705e43672462fd80d", d: "M20 3H4C2.89543 3 2 3.89543 2 5V19C2 20.1046 2.89543 21 4 21H20C21.1046 21 22 20.1046 22 19V5C22 3.89543 21.1046 3 20 3Z", stroke: "auto", "stroke-width": "1.5" }), t("path", { key: "9cf678259d1915733df9058ec36222a6f2362526", d: "M2 5L12 12.5L22 5", stroke: "auto", "stroke-width": "1.5" }));
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
c.style = i;
|
|
13
|
-
export {
|
|
14
|
-
c as spam_icon
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-6b9d4b01.cjs");require("react");require("react-dom");const i=".sc-spam-icon-h{display:flex}",c=i,t=class{constructor(s){e.registerInstance(this,s),this.width="15",this.height="15"}render(){return e.h("svg",{key:"1f4df1b1d3841e97d630b22f2864201ccf7ee47e",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"62e5cd0142dbc10bec2e8c9705e43672462fd80d",d:"M20 3H4C2.89543 3 2 3.89543 2 5V19C2 20.1046 2.89543 21 4 21H20C21.1046 21 22 20.1046 22 19V5C22 3.89543 21.1046 3 20 3Z",stroke:"auto","stroke-width":"1.5"}),e.h("path",{key:"9cf678259d1915733df9058ec36222a6f2362526",d:"M2 5L12 12.5L22 5",stroke:"auto","stroke-width":"1.5"}))}};t.style=c;exports.spam_icon=t;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { r as s, h as t } from "./index-e475e0c0.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
const e = ".sc-stop-icon-h{display:flex}", i = e, r = class {
|
|
5
|
-
constructor(o) {
|
|
6
|
-
s(this, o), this.width = "15", this.height = "15";
|
|
7
|
-
}
|
|
8
|
-
render() {
|
|
9
|
-
return t("svg", { key: "8dc33a36013bcef79884e72b0a428412f4383d17", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "af351dc81bca13956fb98e2a0471315d4006375b", d: "M4 4H20V20H4V4Z", stroke: "auto", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }));
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
r.style = i;
|
|
13
|
-
export {
|
|
14
|
-
r as stop_icon
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-6b9d4b01.cjs");require("react");require("react-dom");const a=".sc-trash-fill-icon-h{display:flex}",h=a,e=class{constructor(s){t.registerInstance(this,s),this.width="15",this.height="15"}render(){return t.h("svg",{key:"fa42597d2824f074e00eefcb4ac01f58e82aa1d8",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},t.h("path",{key:"d72d225c13f6d9420c992c92e488a0d2dc6d60a8",d:"M3 6H5H21",stroke:"auto","stroke-width":"1.5"}),t.h("path",{key:"7397871bc2e8b3ba3d319cd2a19100c12efa9923",d:"M8 6V4C8 3.46957 8.21071 2.96086 8.58579 2.58579C8.96086 2.21071 9.46957 2 10 2H14C14.5304 2 15.0391 2.21071 15.4142 2.58579C15.7893 2.96086 16 3.46957 16 4V6M19 6V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V6H19Z",stroke:"auto","stroke-width":"1.5"}),t.h("path",{key:"348496189df96b006058895794b637afd3acf9d5",d:"M10 11V17",stroke:"auto","stroke-width":"1.5"}),t.h("path",{key:"2d9a75862b915cbfc9faeea470f6500121a8a66d",d:"M14 11V17",stroke:"auto","stroke-width":"1.5"}))}};e.style=h;exports.trash_fill_icon=e;
|