@nylas/react 1.1.0-canary.23 → 1.1.0-canary.24
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-4a6b44be.js +25 -0
- package/dist/add-circle-icon_2.entry-b0e8cb94.cjs +1 -0
- package/dist/{archive-icon_7.entry-3dcc4a66.js → archive-icon_7.entry-0d379e81.js} +14 -14
- package/dist/{archive-icon_7.entry-2ec9b077.cjs → archive-icon_7.entry-464293d2.cjs} +1 -1
- package/dist/{arrow-icon.entry-2cf3e94d.js → arrow-icon.entry-3c2e4e0d.js} +2 -2
- package/dist/{arrow-icon.entry-175e8181.cjs → arrow-icon.entry-4e6fe7be.cjs} +1 -1
- package/dist/{bold-icon_3.entry-9fc74a39.js → bold-icon_3.entry-5f0eedfe.js} +4 -4
- package/dist/{bold-icon_3.entry-a3e61ad8.cjs → bold-icon_3.entry-ba65ceeb.cjs} +1 -1
- package/dist/button-component_2.entry-1290a222.js +26 -0
- package/dist/button-component_2.entry-ae5e68ec.cjs +1 -0
- package/dist/{calendar-agenda-fill-icon_39.entry-493e91f6.js → calendar-agenda-fill-icon_48.entry-4ae8cc76.js} +1966 -1396
- package/dist/calendar-agenda-fill-icon_48.entry-eaa36515.cjs +7 -0
- package/dist/{calendar-cancel-icon.entry-c9c7e3b3.cjs → calendar-cancel-icon.entry-6506440a.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-3ca731f9.js → calendar-cancel-icon.entry-d2f0c9e0.js} +4 -4
- package/dist/{calendar-check-icon_2.entry-5b8f8a75.cjs → calendar-check-icon_2.entry-0f70758f.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-7c409a91.js → calendar-check-icon_2.entry-5212c5b3.js} +9 -9
- package/dist/{calendar-icon.entry-0589697f.js → calendar-icon.entry-b7626be4.js} +7 -7
- package/dist/{calendar-icon.entry-acd00f6f.cjs → calendar-icon.entry-f10bd734.cjs} +1 -1
- package/dist/{checkbox-component_2.entry-538fd8ec.js → checkbox-component_2.entry-7ce6d945.js} +3 -3
- package/dist/{checkbox-component_2.entry-0aa252b9.cjs → checkbox-component_2.entry-879250a5.cjs} +1 -1
- package/dist/{chevron-icon_3.entry-80e03257.js → chevron-icon_3.entry-8c9ca484.js} +14 -14
- package/dist/{chevron-icon_3.entry-7076e105.cjs → chevron-icon_3.entry-a2f9e9ba.cjs} +1 -1
- package/dist/{clock-icon_4.entry-db3fbda1.js → clock-icon_4.entry-3d9d8690.js} +16 -16
- package/dist/{clock-icon_4.entry-d6901afd.cjs → clock-icon_4.entry-7ecb071a.cjs} +1 -1
- package/dist/{constants-12bd3c98-26c75011.js → constants-50c3e067-8cc8e601.js} +618 -605
- package/dist/{constants-12bd3c98-22fd56f2.cjs → constants-50c3e067-da2d4786.cjs} +5 -5
- package/dist/copy-icon.entry-0a80a55e.cjs +1 -0
- package/dist/copy-icon.entry-38cfea6b.js +15 -0
- package/dist/delete-icon_2.entry-9e7cf99e.cjs +1 -0
- package/dist/delete-icon_2.entry-f9a43051.js +25 -0
- package/dist/{document-refresh-icon.entry-a3326831.cjs → document-refresh-icon.entry-5d6c4a99.cjs} +1 -1
- package/dist/{document-refresh-icon.entry-149f2a3b.js → document-refresh-icon.entry-827975fd.js} +5 -5
- package/dist/elements/index.d.ts +9 -1
- package/dist/{elements-dc5b338e-e07600d4.js → elements-dc5b338e-0f8b5d33.js} +1 -1
- package/dist/{elements-dc5b338e-211879a3.cjs → elements-dc5b338e-3a7e1134.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-cb97634f.cjs → focus-visible-e8093c16-088a527d.cjs} +1 -1
- package/dist/{focus-visible-e8093c16-284cefe0.js → focus-visible-e8093c16-40f0c20e.js} +1 -1
- package/dist/{forward-icon_6.entry-751fdd4e.cjs → forward-icon_6.entry-a8f80871.cjs} +3 -3
- package/dist/{forward-icon_6.entry-554b0722.js → forward-icon_6.entry-f984a68b.js} +9 -9
- package/dist/{globe-icon.entry-e3dd58bc.js → globe-icon.entry-a78c8ea8.js} +5 -5
- package/dist/{globe-icon.entry-63eb510d.cjs → globe-icon.entry-c50fc96c.cjs} +1 -1
- package/dist/google-logo-icon_4.entry-14d75c66.cjs +1 -0
- package/dist/google-logo-icon_4.entry-710632b6.js +680 -0
- package/dist/index-53420959-78cc8138.cjs +1 -0
- package/dist/index-53420959-da9158f8.js +5 -0
- package/dist/{index-6d9eeb53-cc42c6f1.js → index-6d9eeb53-407c797a.js} +2 -2
- package/dist/{index-6d9eeb53-81e5b798.cjs → index-6d9eeb53-cac6eaea.cjs} +1 -1
- package/dist/index-a3051853.cjs +42 -0
- package/dist/index-eca7f3e2.js +7859 -0
- package/dist/{index.es-5355a265-f8853ce4.js → index.es-17b386f4-856af8bb.js} +1 -1
- package/dist/{index.es-5355a265-e701a627.cjs → index.es-17b386f4-c6a8cc2a.cjs} +1 -1
- package/dist/{info-icon_2.entry-9559cf3b.cjs → info-icon_2.entry-c08c459c.cjs} +1 -1
- package/dist/{info-icon_2.entry-3b349f01.js → info-icon_2.entry-ffd39ba3.js} +5 -5
- package/dist/input-component.entry-35e6e399.cjs +1 -0
- package/dist/input-component.entry-c09124d3.js +65 -0
- package/dist/{input-dropdown.entry-9bc68630.js → input-dropdown.entry-83f2c378.js} +8 -6
- package/dist/input-dropdown.entry-9ac3e157.cjs +1 -0
- package/dist/{mailbox-store-31d55036-c8618c0b.cjs → mailbox-store-2e401c7f-66a87143.cjs} +1 -1
- package/dist/{mailbox-store-31d55036-1106efe2.js → mailbox-store-2e401c7f-9d607fd1.js} +2 -2
- package/dist/{multi-select-dropdown.entry-36074a81.js → multi-select-dropdown.entry-2c2125e3.js} +2 -2
- package/dist/{multi-select-dropdown.entry-e5ed9285.cjs → multi-select-dropdown.entry-8710acb4.cjs} +1 -1
- package/dist/nylas-booked-event-card_12.entry-009a11e3.cjs +1 -0
- package/dist/nylas-booked-event-card_12.entry-5821b0c4.js +1134 -0
- package/dist/{nylas-form-card.entry-6e45c873.js → nylas-form-card.entry-0ce9dd7d.js} +18 -18
- package/dist/{nylas-form-card.entry-03a31218.cjs → nylas-form-card.entry-951163a1.cjs} +1 -1
- package/dist/{nylas-if-state.entry-61d7ebc5.cjs → nylas-if-state.entry-16aabbff.cjs} +1 -1
- package/dist/{nylas-if-state.entry-092f4e1a.js → nylas-if-state.entry-474cfdcd.js} +3 -3
- package/dist/{nylas-list-folders.entry-ab9e1c2c.js → nylas-list-folders.entry-a9e53520.js} +7 -7
- package/dist/{nylas-list-folders.entry-1abbb401.cjs → nylas-list-folders.entry-f0a4d566.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-2faaa2bb.js → nylas-list-threads.entry-5af74949.js} +3 -3
- package/dist/{nylas-list-threads.entry-dfc87aca.cjs → nylas-list-threads.entry-7fc8b71d.cjs} +1 -1
- package/dist/{nylas-login.entry-243ae09e.js → nylas-login.entry-acbdf23c.js} +7 -7
- package/dist/{nylas-login.entry-d1cac0a1.cjs → nylas-login.entry-d0fcf7c4.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-b8225a3e.js → nylas-mailbox-pagination.entry-01f32d0c.js} +2 -2
- package/dist/{nylas-mailbox-pagination.entry-c27af71c.cjs → nylas-mailbox-pagination.entry-a70e4777.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-b66d597d.cjs → nylas-mailbox-toolbar-button.entry-208b2667.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-22347d22.js → nylas-mailbox-toolbar-button.entry-a8166cf0.js} +3 -3
- package/dist/{nylas-mailbox.entry-cb80f58c.cjs → nylas-mailbox.entry-7a3562b6.cjs} +1 -1
- package/dist/{nylas-mailbox.entry-9e6e1b4d.js → nylas-mailbox.entry-bbd33bb0.js} +6 -6
- package/dist/{nylas-provider.entry-196dd5da.js → nylas-provider.entry-7e8aedea.js} +39 -39
- package/dist/{nylas-provider.entry-28c12448.cjs → nylas-provider.entry-9cce7730.cjs} +1 -1
- package/dist/{nylas-reminder-emails.entry-47ef5a9d.cjs → nylas-reminder-emails.entry-287316b6.cjs} +2 -2
- package/dist/{nylas-reminder-emails.entry-b655d888.js → nylas-reminder-emails.entry-a1b49b18.js} +9 -9
- package/dist/{nylas-reminder-time_2.entry-0f3747fb.cjs → nylas-reminder-time_2.entry-0a480ab7.cjs} +1 -1
- package/dist/{nylas-reminder-time_2.entry-9d8f7436.js → nylas-reminder-time_2.entry-6f6067f9.js} +6 -6
- package/dist/{nylas-scheduler-editor.entry-feb7a7db.js → nylas-scheduler-editor.entry-625d597e.js} +63 -45
- package/dist/{nylas-scheduler-editor.entry-504e8ed3.cjs → nylas-scheduler-editor.entry-6be8e9c6.cjs} +2 -2
- package/dist/nylas-scheduling.entry-1678be21.cjs +1 -0
- package/dist/nylas-scheduling.entry-fa471c9e.js +340 -0
- package/dist/{nylas-threads-refresh.entry-e637161b.cjs → nylas-threads-refresh.entry-77015d63.cjs} +1 -1
- package/dist/{nylas-threads-refresh.entry-91af9af3.js → nylas-threads-refresh.entry-da68039b.js} +11 -11
- package/dist/{nylas-threads-search.entry-5457dcec.js → nylas-threads-search.entry-27472aef.js} +4 -4
- package/dist/{nylas-threads-search.entry-b944f95a.cjs → nylas-threads-search.entry-8f765c67.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-134ef726.cjs → nylas-time-window-picker.entry-a59d7be6.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-a6fd216b.js → nylas-time-window-picker.entry-e8842700.js} +10 -10
- package/dist/{nylas-view-thread.entry-9296a505.cjs → nylas-view-thread.entry-16cc4066.cjs} +1 -1
- package/dist/{nylas-view-thread.entry-6fdd6cb1.js → nylas-view-thread.entry-322a9890.js} +3 -3
- package/dist/{person-icon.entry-4a695727.js → person-icon.entry-b62da62d.js} +4 -4
- package/dist/{person-icon.entry-1cdb4dc2.cjs → person-icon.entry-fd56c344.cjs} +1 -1
- package/dist/{play-icon_2.entry-fb013b17.js → play-icon_2.entry-d0a67f7b.js} +7 -7
- package/dist/play-icon_2.entry-d17c9937.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +108 -100
- package/dist/{refresh-icon.entry-9dbb04ba.cjs → refresh-icon.entry-5427ec8d.cjs} +1 -1
- package/dist/{refresh-icon.entry-46c92605.js → refresh-icon.entry-99d7fbcb.js} +4 -4
- package/dist/{register-component-592986c5-d5d210a8.js → register-component-4487ac6f-4b0c1c53.js} +1 -1
- package/dist/{register-component-592986c5-5edf5835.cjs → register-component-4487ac6f-b29bf135.cjs} +1 -1
- package/dist/scheduler-config-store-2a3b403d-51c51cff.cjs +1 -0
- package/dist/{scheduler-config-store-9ccfba4d-b08031b5.js → scheduler-config-store-2a3b403d-810ef774.js} +5 -4
- package/dist/scheduler-store-55107657-25845a8b.cjs +1 -0
- package/dist/{scheduler-store-fd0d11a5-313e8592.js → scheduler-store-55107657-6c0c5de4.js} +179 -132
- package/dist/{textarea-component.entry-788eb37a.cjs → textarea-component.entry-8bdfbcc9.cjs} +1 -1
- package/dist/{textarea-component.entry-0cd3b57f.js → textarea-component.entry-9803d3c3.js} +4 -4
- package/dist/{time-period-selector.entry-112c0b64.js → time-period-selector.entry-a6c6aefd.js} +41 -41
- package/dist/time-period-selector.entry-d7792301.cjs +1 -0
- package/dist/{translate-icon.entry-c701b391.cjs → translate-icon.entry-4970d886.cjs} +1 -1
- package/dist/{translate-icon.entry-a4df3c16.js → translate-icon.entry-d65cfcea.js} +6 -6
- package/dist/{warning-icon.entry-bda0aafa.cjs → warning-icon.entry-870059cb.cjs} +1 -1
- package/dist/{warning-icon.entry-d1703715.js → warning-icon.entry-eb7da408.js} +5 -5
- package/package.json +3 -3
- package/dist/add-circle-icon_3.entry-37a88ff3.js +0 -79
- package/dist/add-circle-icon_3.entry-4f8f1cbf.cjs +0 -1
- package/dist/button-component.entry-7fdb3bca.cjs +0 -1
- package/dist/button-component.entry-861637f2.js +0 -16
- package/dist/calendar-agenda-fill-icon_39.entry-3c21a3ec.cjs +0 -7
- package/dist/checkmark-icon.entry-0a184b31.cjs +0 -1
- package/dist/checkmark-icon.entry-56302db0.js +0 -15
- package/dist/copy-icon_3.entry-33e89a37.cjs +0 -1
- package/dist/copy-icon_3.entry-9670b9f9.js +0 -35
- package/dist/google-logo-icon_5.entry-bccce7f4.cjs +0 -1
- package/dist/google-logo-icon_5.entry-e462e091.js +0 -748
- package/dist/index-53420959-02fe58ef.js +0 -5
- package/dist/index-53420959-0b9c205e.cjs +0 -1
- package/dist/index-8a536089.cjs +0 -42
- package/dist/index-a15916e5.js +0 -7653
- package/dist/input-dropdown.entry-d454f6bc.cjs +0 -1
- package/dist/loading-icon.entry-1d49e471.js +0 -15
- package/dist/loading-icon.entry-a68da48b.cjs +0 -1
- package/dist/nylas-booked-event-card_10.entry-38d2fd2e.js +0 -954
- package/dist/nylas-booked-event-card_10.entry-e530a8db.cjs +0 -1
- package/dist/nylas-booking-confirmation-type.entry-2fea82f9.js +0 -106
- package/dist/nylas-booking-confirmation-type.entry-5857a863.cjs +0 -1
- package/dist/nylas-scheduling.entry-8c8f8e35.cjs +0 -1
- package/dist/nylas-scheduling.entry-d35efa9a.js +0 -286
- package/dist/play-icon_2.entry-10fd617e.cjs +0 -1
- package/dist/scheduler-config-store-9ccfba4d-3ec35859.cjs +0 -1
- package/dist/scheduler-store-fd0d11a5-b180b3b7.cjs +0 -1
- package/dist/time-period-selector.entry-1e0b720b.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-8a536089.cjs"),w=require("./register-component-592986c5-5edf5835.cjs");require("react");require("react-dom");function f(t,a,s,o,r){if(!o||!s||s.children.length>0)return;e.debug("[nylas-view-thread] Rendering email",{message:t,attachments:a,viewEmailElement:o});const n=o.cloneNode(!0);n.message=t.data,n.parent=r,s.appendChild(n)}const c=({viewEmailElement:t,message:a,attachments:s,onMessageClick:o,onShowContactDataClick:r,parent:n})=>{var l,i,d,g,u,v,y;return e.h(e.Fragment,null,e.h("div",{key:a.id,class:"message"},e.h("div",{class:"sub-header","data-id":a.data.id,onClick:o},e.h("div",{class:"avatar"},a.data.from&&((l=a.data.from[0])==null?void 0:l.name)&&((d=(i=a.data.from[0])==null?void 0:i.name[0])==null?void 0:d.toUpperCase())),e.h("div",{class:"from"},e.h("span",{class:"name"},a.data.from&&((g=a.data.from[0])==null?void 0:g.name))," ",e.h("span",{class:"email"},a.data.from&&((u=a.data.from[0])==null?void 0:u.email))),e.h("div",{class:"date"},new Date(a.data.date*1e3).toLocaleTimeString(void 0,{timeStyle:"short"})," ","(",e.formatTimeAgo(new Date(a.data.date*1e3)),")"),e.h("sp-button-group",{class:"buttons"},e.h("nylas-summarize-message-button",{message:a.data})),a.collapse&&e.h("div",{class:"snippet"},a.data.snippet),!a.collapse&&a.data.to&&e.h("div",{class:"to"},e.h("span",null,"to")," ",e.formatParticipants(a.data.to)," ",e.h("button",{type:"button",value:a.data.id,onClick:r,class:{expand:!0,"expand--showContactData":a.showContactData}},e.h("chevron-icon",null)))),a.showContactData&&e.h("div",{class:"address-info"},e.h("div",{class:"label"},"From"),e.h("div",{class:"value"},e.formatRecipient((v=a.data)!=null&&v.from?(y=a==null?void 0:a.data)==null?void 0:y.from[0]:{name:"",email:""})),a.data.to&&e.h(e.Fragment,null,e.h("div",{class:"label"},"To"),e.h("div",{class:"value"},a.data.to.map(h=>e.h("div",null,e.formatRecipient(h))))),typeof a.data.cc<"u"&&a.data.cc.length>0&&e.h(e.Fragment,null,e.h("div",{class:"label"},"CC"),e.h("div",{class:"value"},a.data.cc.map(h=>e.h("div",null,e.formatRecipient(h)))))),!a.collapse&&t&&e.h("div",{key:a.id,ref:h=>f(a,s,h,t,n)}),!a.collapse&&!t&&e.h("nylas-view-email",{key:a.id,message:a.data,parent:n})),e.h("hr",null))},b=':host{display:block;font-size:inherit}.avatar{z-index:1;border-radius:100%;background-color:var(--nylas-color-primary-200);height:40px;width:40px;align-items:center;display:flex;justify-content:center;border:1px solid var(--nylas-color-primary-200)}.view-thread{display:grid;grid-auto-flow:row;width:100%}.view-thread .header{display:grid;grid-gap:1rem;align-items:center;margin-bottom:1rem}.view-thread .header .subject{font-size:1.25rem;font-weight:600;line-height:1.5rem}.view-thread .header .folders{display:grid;grid-auto-flow:column;grid-auto-columns:min-content;overflow-x:auto;gap:1rem}.view-thread .header .folders .folder{padding:0 0.5rem;font-size:0.9rem;color:var(--nylas-color-primary-900);background-color:var(--nylas-color-primary-300)}.view-thread .messages{display:grid;gap:1rem}.view-thread .messages hr{margin:0;width:100%;border:1px solid var(--nylas-color-primary-200)}.view-thread .messages hr:last-of-type{display:none}.view-thread .messages .message{display:grid;grid-auto-flow:row;gap:1rem}.view-thread .messages .message:last-of-type .sub-header{cursor:default}.view-thread .messages .message .sub-header{display:grid;grid-template:"avatar from date buttons" "avatar to to buttons";grid-column-gap:1rem;grid-template-columns:auto 1fr auto auto;cursor:pointer}.view-thread .messages .message .sub-header>*{pointer-events:none}.view-thread .messages .message .sub-header .avatar{grid-area:avatar}.view-thread .messages .message .sub-header .from{grid-area:from}.view-thread .messages .message .sub-header .from span.email{display:none;color:var(--nylas-color-primary-400);font-weight:600}.view-thread .messages .message .sub-header .buttons{grid-area:buttons;align-self:center}.view-thread .messages .message .sub-header .buttons *{pointer-events:all}.view-thread .messages .message .sub-header .date{grid-area:date;align-self:center;color:var(--nylas-color-primary-400)}.view-thread .messages .message .sub-header .snippet{width:90%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--nylas-color-primary-600)}.view-thread .messages .message .sub-header .to{grid-area:to;color:var(--nylas-color-primary-400)}.view-thread .messages .message .sub-header .to>span{color:var(--nylas-color-primary-400)}.view-thread .messages .message .sub-header .to button{border:0;background-color:transparent;cursor:pointer;pointer-events:all;padding:0;margin:0}.view-thread .messages .message .sub-header .to button>*{pointer-events:none}.view-thread .messages .message .sub-header .to button chevron-icon{display:inline-table;fill:var(--nylas-color-primary-400);width:15px;height:15px;vertical-align:middle}.view-thread .messages .message .sub-header .to button chevron-icon svg{width:15px;height:15px;transform:rotate(90deg)}.view-thread .messages .message .sub-header .to button.expand--showContactData chevron-icon svg{transform:rotate(270deg)}.view-thread .messages .message .address-info{display:grid;column-gap:1rem;row-gap:0.5rem;grid-template-columns:auto 1fr;grid-template-rows:1fr;padding:1rem 2rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-color-primary-200);align-items:flex-start;color:var(--nylas-color-primary-600)}.view-thread .messages .message .address-info .label{color:var(--nylas-color-primary-400);font-weight:600}.show-more{position:relative;display:flex;width:100%}.show-more .sr-only{display:none}.show-more button{position:relative;display:inline-flex;width:100%;padding:0;border:0;background-color:transparent;cursor:pointer;text-align:left;overflow:hidden}.show-more button span{border:1px solid var(--nylas-color-primary-400)}.show-more button:hover span{background-color:var(--nylas-color-primary-700)}.show-more button::after{border-top:1px solid rgba(100, 121, 143, 0.122);border-bottom:1px solid rgba(100, 121, 143, 0.122);content:"";height:4px;width:100%;position:absolute;top:50%}.loading{position:absolute;width:100%;height:100%;background-color:var(--loading__background-color);top:0;bottom:0;left:0;z-index:1;display:grid;justify-content:center;align-items:center;font-weight:600;overflow:hidden}.reply-buttons{display:grid;grid-auto-flow:column;grid-auto-columns:min-content;gap:1rem;margin-top:1rem}.reply-buttons sp-button{border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-400);color:var(--nylas-color-primary-900);fill:var(--nylas-color-primary-900)}.reply-buttons sp-button:hover{background-color:var(--nylas-color-primary-500)}.reply-buttons sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}.reply-buttons sp-button chevron-icon{display:inline-block}@media only screen and (min-width: 768px){.view-thread .messages .message .sub-header .from span.email{display:inline}}',C=b;var k=function(t,a,s,o){var r=arguments.length,n=r<3?a:o===null?o=Object.getOwnPropertyDescriptor(a,s):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,a,s,o);else for(var i=t.length-1;i>=0;i--)(l=t[i])&&(n=(r<3?l(n):r>3?l(a,s,n):l(a,s))||n);return r>3&&n&&Object.defineProperty(a,s,n),n},m=function(t,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,a)};const p=class{constructor(t){e.registerInstance(this,t),this.threadSelected=e.createEvent(this,"threadSelected",7),this.showContactDataClicked=e.createEvent(this,"showContactDataClicked",7),this.messageClicked=e.createEvent(this,"messageClicked",7),this.nylasViewEmailElement=null,this.nylasComposerElement=null,this.onShowContactDataClick=a=>{a.stopPropagation();const o=a.target.value,r=this.internalMessages.find(l=>l.data.id===o);if(!r){e.debug(`[nylas-view-thread] Could not find message ${o}`);return}this.showContactDataClicked.emit(r.data).defaultPrevented||(r.showContactData=!r.showContactData,this.internalMessages=[...this.internalMessages]),e.debug(`[nylas-view-thread] show contact data clicked ${o} ${r.showContactData?"collapsed":"expanded"}`)},this.onMessageClick=a=>{var l;const o=a.target.dataset.id,r=this.internalMessages.find(i=>i.data.id===o);if(!r){e.debug(`[nylas-view-thread] Could not find message ${o}`);return}this.messageClicked.emit(r.data).defaultPrevented||(r.id!==((l=this.internalMessages[this.internalMessages.length-1])==null?void 0:l.id)&&(r.collapse=!r.collapse,r.collapse&&(r.showContactData=!1)),this.internalMessages=[...this.internalMessages]),e.debug(`[nylas-view-thread] message clicked ${o} ${r.collapse?"collapsed":"expanded"}`)},this.onShowAllEmailsClick=()=>{this.showAllEmails=!this.showAllEmails},this.showComposerClick=()=>{this.showComposer=!this.showComposer},this.draft=void 0,this.thread=void 0,this.messages=[],this.attachments=[],this.state="loading",this.internalMessages=[],this.showAllEmails=!1,this.showComposer=!1}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){e.debug("[nylas-view-thread] Component will load"),this.updateInternalMessages(this.messages);const t=this.host.querySelector("template.nylas-view-email");if(!t){e.debug("[nylas-view-thread] Could not find template");return}const a=document.importNode(t.content,!0);this.nylasViewEmailElement=a.querySelector("nylas-view-email");const s=this.host.querySelector("template.nylas-composer");if(!s){e.debug("[nylas-view-thread] Could not find composer template");return}const o=document.importNode(s.content,!0);this.nylasComposerElement=o.querySelector("nylas-composer")}async componentDidLoad(){e.debug("[nylas-view-thread] Component did load")}async threadChanged(t){e.debug("[nylas-view-thread] Thread changed",{thread:t}),this.internalMessages=[],this.threadSelected.emit(t).defaultPrevented||e.debug("[nylas-view-thread] Default event not prevented, initializing")}updateInternalMessages(t){e.debug("[nylas-view-thread] Updating internal messages",{messages:t});const a=t.sort((s,o)=>s.date>o.date?1:-1).map((s,o)=>({id:s.id,data:s,collapse:o!==t.length-1,showContactData:!1}));this.internalMessages=a}render(){var r,n,l;const t=this.internalMessages.length>2?this.internalMessages[0]:null,a=this.internalMessages.slice(this.internalMessages.length-2,this.internalMessages.length),s=this.internalMessages.slice(1,this.internalMessages.length-2),o=this.internalMessages[this.internalMessages.length-1];return e.h(e.Host,{key:"b6f11037f7d3e698cfe912431d2bb9dac014c703"},e.h("sp-theme",{key:"81bcd19740f21b78aa23d7c048af83f4332ec829",scale:"medium",color:"dark"},e.h("div",{key:"3ca6a1a85a28b2435c2fc1f0f9efec4c9a692686",class:"view-thread"},e.h("div",{key:"d3a6fe1b099687a28ebc0307a5c1c44ce23e8f4c",class:"header"},e.h("div",{key:"ee7eb035b739c3f12f0e987612a217837325b18a",class:"subject"},(r=this.thread)==null?void 0:r.subject),e.h("div",{key:"e2cef333ba703c6845346a772365068b3fe66258",class:"folders"},(l=(n=this.thread)==null?void 0:n.folders)==null?void 0:l.map(i=>e.h("sp-tag",{size:"s"},e.toTitleCase(i.replace("CATEGORY_","").replace("_"," ")))))),e.h("div",{key:"61f714a579fb653b50328dedaf1e44312801c27d",class:"messages"},t&&e.h(c,{message:t,attachments:this.attachments.filter(i=>i.messageId===t.id),onMessageClick:this.onMessageClick,onShowContactDataClick:this.onShowContactDataClick,parent:this.host,viewEmailElement:this.nylasViewEmailElement,composerElement:this.nylasComposerElement}),s.length>0&&this.messages.length>1&&!this.showAllEmails&&a.length>0&&e.h(e.Fragment,null,e.h("div",{class:"show-more"},e.h("button",{type:"button",onClick:this.onShowAllEmailsClick},e.h("span",{class:"avatar"},s.length)," ",e.h("span",{class:"sr-only"},"Show ",s.length," more emails"))),e.h("hr",null)),s.length>0&&this.showAllEmails&&this.messages.length>2&&s.map(i=>e.h(c,{message:i,attachments:this.attachments.filter(d=>d.messageId===(t==null?void 0:t.id)),onMessageClick:this.onMessageClick,onShowContactDataClick:this.onShowContactDataClick,parent:this.host,viewEmailElement:this.nylasViewEmailElement,composerElement:this.nylasComposerElement})),a.length>0&&a.map(i=>e.h(c,{message:i,attachments:this.attachments.filter(d=>d.messageId===(t==null?void 0:t.id)),onMessageClick:this.onMessageClick,onShowContactDataClick:this.onShowContactDataClick,parent:this.host,viewEmailElement:this.nylasViewEmailElement,composerElement:this.nylasComposerElement}))),!(this.showComposer&&o)&&e.h("div",{class:"reply-buttons"},e.h("sp-button",{variant:"cta",type:"button",onClick:this.showComposerClick},e.h("span",{slot:"icon"},e.h("reply-icon",null)),e.h("span",null,"Reply")),e.h("sp-button",{variant:"cta",type:"button"},e.h("span",{slot:"icon"},e.h("reply-all-icon",null)),e.h("span",null,"Reply All")),e.h("sp-button",{variant:"cta",type:"button"},e.h("span",{slot:"icon"},e.h("forward-icon",null)),e.h("span",null,"Forward"))),this.showComposer&&o&&e.h("div",{class:"composer"},e.h("nylas-composer",{message:o.data,onClose:this.showComposerClick,onSend:i=>{e.debug("[nylas-view-thread] Send event",{message:i.detail.message,replyBody:i.detail.replyBody})}})))))}get host(){return e.getElement(this)}static get watchers(){return{thread:["threadChanged"],messages:["updateInternalMessages"]}}};k([w.RegisterComponent({name:"nylas-view-thread",stateToProps:new Map([["mailbox.selectedThread","thread"],["mailbox.messages","messages"],["mailbox.state","state"]]),eventToProps:{threadSelected:async(t,a)=>{e.debug("[nylas-view-thread] Nylas init event. Fetching thread messages.",{event:t});const s=t.detail;s&&s.id&&await a.messages.getThreadMessages(s.id)}},fireRegisterEvent:!0}),m("design:type",Function),m("design:paramtypes",[]),m("design:returntype",void 0)],p.prototype,"render",null);p.style=C;exports.nylas_view_thread=p;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-a3051853.cjs"),w=require("./register-component-4487ac6f-b29bf135.cjs");require("react");require("react-dom");function b(t,a,s,o,r){if(!o||!s||s.children.length>0)return;e.debug("[nylas-view-thread] Rendering email",{message:t,attachments:a,viewEmailElement:o});const n=o.cloneNode(!0);n.message=t.data,n.parent=r,s.appendChild(n)}const c=({viewEmailElement:t,message:a,attachments:s,onMessageClick:o,onShowContactDataClick:r,parent:n})=>{var l,i,d,g,u,v,y;return e.h(e.Fragment,null,e.h("div",{key:a.id,class:"message"},e.h("div",{class:"sub-header","data-id":a.data.id,onClick:o},e.h("div",{class:"avatar"},a.data.from&&((l=a.data.from[0])==null?void 0:l.name)&&((d=(i=a.data.from[0])==null?void 0:i.name[0])==null?void 0:d.toUpperCase())),e.h("div",{class:"from"},e.h("span",{class:"name"},a.data.from&&((g=a.data.from[0])==null?void 0:g.name))," ",e.h("span",{class:"email"},a.data.from&&((u=a.data.from[0])==null?void 0:u.email))),e.h("div",{class:"date"},new Date(a.data.date*1e3).toLocaleTimeString(void 0,{timeStyle:"short"})," ","(",e.formatTimeAgo(new Date(a.data.date*1e3)),")"),e.h("sp-button-group",{class:"buttons"},e.h("nylas-summarize-message-button",{message:a.data})),a.collapse&&e.h("div",{class:"snippet"},a.data.snippet),!a.collapse&&a.data.to&&e.h("div",{class:"to"},e.h("span",null,"to")," ",e.formatParticipants(a.data.to)," ",e.h("button",{type:"button",value:a.data.id,onClick:r,class:{expand:!0,"expand--showContactData":a.showContactData}},e.h("chevron-icon",null)))),a.showContactData&&e.h("div",{class:"address-info"},e.h("div",{class:"label"},"From"),e.h("div",{class:"value"},e.formatRecipient((v=a.data)!=null&&v.from?(y=a==null?void 0:a.data)==null?void 0:y.from[0]:{name:"",email:""})),a.data.to&&e.h(e.Fragment,null,e.h("div",{class:"label"},"To"),e.h("div",{class:"value"},a.data.to.map(h=>e.h("div",null,e.formatRecipient(h))))),typeof a.data.cc<"u"&&a.data.cc.length>0&&e.h(e.Fragment,null,e.h("div",{class:"label"},"CC"),e.h("div",{class:"value"},a.data.cc.map(h=>e.h("div",null,e.formatRecipient(h)))))),!a.collapse&&t&&e.h("div",{key:a.id,ref:h=>b(a,s,h,t,n)}),!a.collapse&&!t&&e.h("nylas-view-email",{key:a.id,message:a.data,parent:n})),e.h("hr",null))},f=':host{display:block;font-size:inherit}.avatar{z-index:1;border-radius:100%;background-color:var(--nylas-color-primary-200);height:40px;width:40px;align-items:center;display:flex;justify-content:center;border:1px solid var(--nylas-color-primary-200)}.view-thread{display:grid;grid-auto-flow:row;width:100%}.view-thread .header{display:grid;grid-gap:1rem;align-items:center;margin-bottom:1rem}.view-thread .header .subject{font-size:1.25rem;font-weight:600;line-height:1.5rem}.view-thread .header .folders{display:grid;grid-auto-flow:column;grid-auto-columns:min-content;overflow-x:auto;gap:1rem}.view-thread .header .folders .folder{padding:0 0.5rem;font-size:0.9rem;color:var(--nylas-color-primary-900);background-color:var(--nylas-color-primary-300)}.view-thread .messages{display:grid;gap:1rem}.view-thread .messages hr{margin:0;width:100%;border:1px solid var(--nylas-color-primary-200)}.view-thread .messages hr:last-of-type{display:none}.view-thread .messages .message{display:grid;grid-auto-flow:row;gap:1rem}.view-thread .messages .message:last-of-type .sub-header{cursor:default}.view-thread .messages .message .sub-header{display:grid;grid-template:"avatar from date buttons" "avatar to to buttons";grid-column-gap:1rem;grid-template-columns:auto 1fr auto auto;cursor:pointer}.view-thread .messages .message .sub-header>*{pointer-events:none}.view-thread .messages .message .sub-header .avatar{grid-area:avatar}.view-thread .messages .message .sub-header .from{grid-area:from}.view-thread .messages .message .sub-header .from span.email{display:none;color:var(--nylas-color-primary-400);font-weight:600}.view-thread .messages .message .sub-header .buttons{grid-area:buttons;align-self:center}.view-thread .messages .message .sub-header .buttons *{pointer-events:all}.view-thread .messages .message .sub-header .date{grid-area:date;align-self:center;color:var(--nylas-color-primary-400)}.view-thread .messages .message .sub-header .snippet{width:90%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--nylas-color-primary-600)}.view-thread .messages .message .sub-header .to{grid-area:to;color:var(--nylas-color-primary-400)}.view-thread .messages .message .sub-header .to>span{color:var(--nylas-color-primary-400)}.view-thread .messages .message .sub-header .to button{border:0;background-color:transparent;cursor:pointer;pointer-events:all;padding:0;margin:0}.view-thread .messages .message .sub-header .to button>*{pointer-events:none}.view-thread .messages .message .sub-header .to button chevron-icon{display:inline-table;fill:var(--nylas-color-primary-400);width:15px;height:15px;vertical-align:middle}.view-thread .messages .message .sub-header .to button chevron-icon svg{width:15px;height:15px;transform:rotate(90deg)}.view-thread .messages .message .sub-header .to button.expand--showContactData chevron-icon svg{transform:rotate(270deg)}.view-thread .messages .message .address-info{display:grid;column-gap:1rem;row-gap:0.5rem;grid-template-columns:auto 1fr;grid-template-rows:1fr;padding:1rem 2rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-color-primary-200);align-items:flex-start;color:var(--nylas-color-primary-600)}.view-thread .messages .message .address-info .label{color:var(--nylas-color-primary-400);font-weight:600}.show-more{position:relative;display:flex;width:100%}.show-more .sr-only{display:none}.show-more button{position:relative;display:inline-flex;width:100%;padding:0;border:0;background-color:transparent;cursor:pointer;text-align:left;overflow:hidden}.show-more button span{border:1px solid var(--nylas-color-primary-400)}.show-more button:hover span{background-color:var(--nylas-color-primary-700)}.show-more button::after{border-top:1px solid rgba(100, 121, 143, 0.122);border-bottom:1px solid rgba(100, 121, 143, 0.122);content:"";height:4px;width:100%;position:absolute;top:50%}.loading{position:absolute;width:100%;height:100%;background-color:var(--loading__background-color);top:0;bottom:0;left:0;z-index:1;display:grid;justify-content:center;align-items:center;font-weight:600;overflow:hidden}.reply-buttons{display:grid;grid-auto-flow:column;grid-auto-columns:min-content;gap:1rem;margin-top:1rem}.reply-buttons sp-button{border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-400);color:var(--nylas-color-primary-900);fill:var(--nylas-color-primary-900)}.reply-buttons sp-button:hover{background-color:var(--nylas-color-primary-500)}.reply-buttons sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}.reply-buttons sp-button chevron-icon{display:inline-block}@media only screen and (min-width: 768px){.view-thread .messages .message .sub-header .from span.email{display:inline}}',C=f;var k=function(t,a,s,o){var r=arguments.length,n=r<3?a:o===null?o=Object.getOwnPropertyDescriptor(a,s):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,a,s,o);else for(var i=t.length-1;i>=0;i--)(l=t[i])&&(n=(r<3?l(n):r>3?l(a,s,n):l(a,s))||n);return r>3&&n&&Object.defineProperty(a,s,n),n},m=function(t,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,a)};const p=class{constructor(t){e.registerInstance(this,t),this.threadSelected=e.createEvent(this,"threadSelected",7),this.showContactDataClicked=e.createEvent(this,"showContactDataClicked",7),this.messageClicked=e.createEvent(this,"messageClicked",7),this.nylasViewEmailElement=null,this.nylasComposerElement=null,this.onShowContactDataClick=a=>{a.stopPropagation();const o=a.target.value,r=this.internalMessages.find(l=>l.data.id===o);if(!r){e.debug(`[nylas-view-thread] Could not find message ${o}`);return}this.showContactDataClicked.emit(r.data).defaultPrevented||(r.showContactData=!r.showContactData,this.internalMessages=[...this.internalMessages]),e.debug(`[nylas-view-thread] show contact data clicked ${o} ${r.showContactData?"collapsed":"expanded"}`)},this.onMessageClick=a=>{var l;const o=a.target.dataset.id,r=this.internalMessages.find(i=>i.data.id===o);if(!r){e.debug(`[nylas-view-thread] Could not find message ${o}`);return}this.messageClicked.emit(r.data).defaultPrevented||(r.id!==((l=this.internalMessages[this.internalMessages.length-1])==null?void 0:l.id)&&(r.collapse=!r.collapse,r.collapse&&(r.showContactData=!1)),this.internalMessages=[...this.internalMessages]),e.debug(`[nylas-view-thread] message clicked ${o} ${r.collapse?"collapsed":"expanded"}`)},this.onShowAllEmailsClick=()=>{this.showAllEmails=!this.showAllEmails},this.showComposerClick=()=>{this.showComposer=!this.showComposer},this.draft=void 0,this.thread=void 0,this.messages=[],this.attachments=[],this.state="loading",this.internalMessages=[],this.showAllEmails=!1,this.showComposer=!1}connectedCallback(){}disconnectedCallback(){}async componentWillLoad(){e.debug("[nylas-view-thread] Component will load"),this.updateInternalMessages(this.messages);const t=this.host.querySelector("template.nylas-view-email");if(!t){e.debug("[nylas-view-thread] Could not find template");return}const a=document.importNode(t.content,!0);this.nylasViewEmailElement=a.querySelector("nylas-view-email");const s=this.host.querySelector("template.nylas-composer");if(!s){e.debug("[nylas-view-thread] Could not find composer template");return}const o=document.importNode(s.content,!0);this.nylasComposerElement=o.querySelector("nylas-composer")}async componentDidLoad(){e.debug("[nylas-view-thread] Component did load")}async threadChanged(t){e.debug("[nylas-view-thread] Thread changed",{thread:t}),this.internalMessages=[],this.threadSelected.emit(t).defaultPrevented||e.debug("[nylas-view-thread] Default event not prevented, initializing")}updateInternalMessages(t){e.debug("[nylas-view-thread] Updating internal messages",{messages:t});const a=t.sort((s,o)=>s.date>o.date?1:-1).map((s,o)=>({id:s.id,data:s,collapse:o!==t.length-1,showContactData:!1}));this.internalMessages=a}render(){var r,n,l;const t=this.internalMessages.length>2?this.internalMessages[0]:null,a=this.internalMessages.slice(this.internalMessages.length-2,this.internalMessages.length),s=this.internalMessages.slice(1,this.internalMessages.length-2),o=this.internalMessages[this.internalMessages.length-1];return e.h(e.Host,{key:"0e996b90d53dc0bc89090a8e72499a70334bf792"},e.h("sp-theme",{key:"2b454c728fc3cf023e9a61bf6823b52de8aca2da",scale:"medium",color:"dark"},e.h("div",{key:"1d904b456825693214740562a05e77561a95c9ea",class:"view-thread"},e.h("div",{key:"4994b59792d79a10ace6e7cbd3f355449bf08c3b",class:"header"},e.h("div",{key:"c96bdcef5ee57190f0aa8fef833b5f71b7e63b98",class:"subject"},(r=this.thread)==null?void 0:r.subject),e.h("div",{key:"3c5d82d1f983741a08e4adc85bad688ad8656833",class:"folders"},(l=(n=this.thread)==null?void 0:n.folders)==null?void 0:l.map(i=>e.h("sp-tag",{size:"s"},e.toTitleCase(i.replace("CATEGORY_","").replace("_"," ")))))),e.h("div",{key:"c13161cff5e5a023533335804e8edb7dd58c9dd1",class:"messages"},t&&e.h(c,{message:t,attachments:this.attachments.filter(i=>i.messageId===t.id),onMessageClick:this.onMessageClick,onShowContactDataClick:this.onShowContactDataClick,parent:this.host,viewEmailElement:this.nylasViewEmailElement,composerElement:this.nylasComposerElement}),s.length>0&&this.messages.length>1&&!this.showAllEmails&&a.length>0&&e.h(e.Fragment,null,e.h("div",{class:"show-more"},e.h("button",{type:"button",onClick:this.onShowAllEmailsClick},e.h("span",{class:"avatar"},s.length)," ",e.h("span",{class:"sr-only"},"Show ",s.length," more emails"))),e.h("hr",null)),s.length>0&&this.showAllEmails&&this.messages.length>2&&s.map(i=>e.h(c,{message:i,attachments:this.attachments.filter(d=>d.messageId===(t==null?void 0:t.id)),onMessageClick:this.onMessageClick,onShowContactDataClick:this.onShowContactDataClick,parent:this.host,viewEmailElement:this.nylasViewEmailElement,composerElement:this.nylasComposerElement})),a.length>0&&a.map(i=>e.h(c,{message:i,attachments:this.attachments.filter(d=>d.messageId===(t==null?void 0:t.id)),onMessageClick:this.onMessageClick,onShowContactDataClick:this.onShowContactDataClick,parent:this.host,viewEmailElement:this.nylasViewEmailElement,composerElement:this.nylasComposerElement}))),!(this.showComposer&&o)&&e.h("div",{class:"reply-buttons"},e.h("sp-button",{variant:"cta",type:"button",onClick:this.showComposerClick},e.h("span",{slot:"icon"},e.h("reply-icon",null)),e.h("span",null,"Reply")),e.h("sp-button",{variant:"cta",type:"button"},e.h("span",{slot:"icon"},e.h("reply-all-icon",null)),e.h("span",null,"Reply All")),e.h("sp-button",{variant:"cta",type:"button"},e.h("span",{slot:"icon"},e.h("forward-icon",null)),e.h("span",null,"Forward"))),this.showComposer&&o&&e.h("div",{class:"composer"},e.h("nylas-composer",{message:o.data,onClose:this.showComposerClick,onSend:i=>{e.debug("[nylas-view-thread] Send event",{message:i.detail.message,replyBody:i.detail.replyBody})}})))))}get host(){return e.getElement(this)}static get watchers(){return{thread:["threadChanged"],messages:["updateInternalMessages"]}}};k([w.RegisterComponent({name:"nylas-view-thread",stateToProps:new Map([["mailbox.selectedThread","thread"],["mailbox.messages","messages"],["mailbox.state","state"]]),eventToProps:{threadSelected:async(t,a)=>{e.debug("[nylas-view-thread] Nylas init event. Fetching thread messages.",{event:t});const s=t.detail;s&&s.id&&await a.messages.getThreadMessages(s.id)}},fireRegisterEvent:!0}),m("design:type",Function),m("design:paramtypes",[]),m("design:returntype",void 0)],p.prototype,"render",null);p.style=C;exports.nylas_view_thread=p;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as k, c as p, d, h as a, t as M, F as m, H as x, g as E, q as D, a as S, s as g } from "./index-
|
|
2
|
-
import { R as T } from "./register-component-
|
|
1
|
+
import { r as k, c as p, d, h as a, t as M, F as m, H as x, g as E, q as D, a as S, s as g } from "./index-eca7f3e2.js";
|
|
2
|
+
import { R as T } from "./register-component-4487ac6f-4b0c1c53.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
function R(t, e, s, o, r) {
|
|
@@ -162,7 +162,7 @@ const C = class {
|
|
|
162
162
|
render() {
|
|
163
163
|
var r, n, l;
|
|
164
164
|
const t = this.internalMessages.length > 2 ? this.internalMessages[0] : null, e = this.internalMessages.slice(this.internalMessages.length - 2, this.internalMessages.length), s = this.internalMessages.slice(1, this.internalMessages.length - 2), o = this.internalMessages[this.internalMessages.length - 1];
|
|
165
|
-
return a(x, { key: "
|
|
165
|
+
return a(x, { key: "0e996b90d53dc0bc89090a8e72499a70334bf792" }, a("sp-theme", { key: "2b454c728fc3cf023e9a61bf6823b52de8aca2da", scale: "medium", color: "dark" }, a("div", { key: "1d904b456825693214740562a05e77561a95c9ea", class: "view-thread" }, a("div", { key: "4994b59792d79a10ace6e7cbd3f355449bf08c3b", class: "header" }, a("div", { key: "c96bdcef5ee57190f0aa8fef833b5f71b7e63b98", class: "subject" }, (r = this.thread) == null ? void 0 : r.subject), a("div", { key: "3c5d82d1f983741a08e4adc85bad688ad8656833", class: "folders" }, (l = (n = this.thread) == null ? void 0 : n.folders) == null ? void 0 : l.map((i) => a("sp-tag", { size: "s" }, M(i.replace("CATEGORY_", "").replace("_", " ")))))), a("div", { key: "c13161cff5e5a023533335804e8edb7dd58c9dd1", class: "messages" }, t && a(u, { message: t, attachments: this.attachments.filter((i) => i.messageId === t.id), onMessageClick: this.onMessageClick, onShowContactDataClick: this.onShowContactDataClick, parent: this.host, viewEmailElement: this.nylasViewEmailElement, composerElement: this.nylasComposerElement }), s.length > 0 && this.messages.length > 1 && !this.showAllEmails && e.length > 0 && a(m, null, a("div", { class: "show-more" }, a("button", { type: "button", onClick: this.onShowAllEmailsClick }, a("span", { class: "avatar" }, s.length), " ", a("span", { class: "sr-only" }, "Show ", s.length, " more emails"))), a("hr", null)), s.length > 0 && this.showAllEmails && this.messages.length > 2 && s.map((i) => a(u, { message: i, attachments: this.attachments.filter((c) => c.messageId === (t == null ? void 0 : t.id)), onMessageClick: this.onMessageClick, onShowContactDataClick: this.onShowContactDataClick, parent: this.host, viewEmailElement: this.nylasViewEmailElement, composerElement: this.nylasComposerElement })), e.length > 0 && e.map((i) => a(u, { message: i, attachments: this.attachments.filter((c) => c.messageId === (t == null ? void 0 : t.id)), onMessageClick: this.onMessageClick, onShowContactDataClick: this.onShowContactDataClick, parent: this.host, viewEmailElement: this.nylasViewEmailElement, composerElement: this.nylasComposerElement }))), !(this.showComposer && o) && a("div", { class: "reply-buttons" }, a("sp-button", { variant: "cta", type: "button", onClick: this.showComposerClick }, a("span", { slot: "icon" }, a("reply-icon", null)), a("span", null, "Reply")), a("sp-button", { variant: "cta", type: "button" }, a("span", { slot: "icon" }, a("reply-all-icon", null)), a("span", null, "Reply All")), a("sp-button", { variant: "cta", type: "button" }, a("span", { slot: "icon" }, a("forward-icon", null)), a("span", null, "Forward"))), this.showComposer && o && a("div", { class: "composer" }, a("nylas-composer", { message: o.data, onClose: this.showComposerClick, onSend: (i) => {
|
|
166
166
|
d("[nylas-view-thread] Send event", { message: i.detail.message, replyBody: i.detail.replyBody });
|
|
167
167
|
} })))));
|
|
168
168
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { r as
|
|
1
|
+
import { r as e, h as t } from "./index-eca7f3e2.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
const o = ".sc-person-icon-h{display:flex}", r = o, C = class {
|
|
5
|
-
constructor(
|
|
6
|
-
|
|
5
|
+
constructor(s) {
|
|
6
|
+
e(this, s), this.width = "14", this.height = "16";
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return t("svg", { key: "
|
|
9
|
+
return t("svg", { key: "1024ab44233699ed105418dffc80d34b8086628d", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "f36edc38994a9a42d674c7061a69944c0c545773", d: "M7 0C4.79086 0 3 1.79086 3 4C3 6.20914 4.79086 8 7 8C9.20914 8 11 6.20914 11 4C11 1.79086 9.20914 0 7 0ZM4 4C4 2.34315 5.34315 1 7 1C8.65685 1 10 2.34315 10 4C10 5.65685 8.65685 7 7 7C5.34315 7 4 5.65685 4 4ZM2.00873 9C0.903151 9 0 9.88687 0 11C0 12.6912 0.83281 13.9663 2.13499 14.7966C3.41697 15.614 5.14526 16 7 16C8.85474 16 10.583 15.614 11.865 14.7966C13.1672 13.9663 14 12.6912 14 11C14 9.89557 13.1045 9.00001 12 9.00001L2.00873 9ZM1 11C1 10.4467 1.44786 10 2.00873 10L12 10C12.5522 10 13 10.4478 13 11C13 12.3088 12.3777 13.2837 11.3274 13.9534C10.2568 14.636 8.73511 15 7 15C5.26489 15 3.74318 14.636 2.67262 13.9534C1.62226 13.2837 1 12.3088 1 11Z", fill: "currentColor" }));
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
C.style = r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-a3051853.cjs");require("react");require("react-dom");const r=".sc-person-icon-h{display:flex}",i=r,t=class{constructor(s){e.registerInstance(this,s),this.width="14",this.height="16"}render(){return e.h("svg",{key:"1024ab44233699ed105418dffc80d34b8086628d",width:this.width,height:this.height,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"f36edc38994a9a42d674c7061a69944c0c545773",d:"M7 0C4.79086 0 3 1.79086 3 4C3 6.20914 4.79086 8 7 8C9.20914 8 11 6.20914 11 4C11 1.79086 9.20914 0 7 0ZM4 4C4 2.34315 5.34315 1 7 1C8.65685 1 10 2.34315 10 4C10 5.65685 8.65685 7 7 7C5.34315 7 4 5.65685 4 4ZM2.00873 9C0.903151 9 0 9.88687 0 11C0 12.6912 0.83281 13.9663 2.13499 14.7966C3.41697 15.614 5.14526 16 7 16C8.85474 16 10.583 15.614 11.865 14.7966C13.1672 13.9663 14 12.6912 14 11C14 9.89557 13.1045 9.00001 12 9.00001L2.00873 9ZM1 11C1 10.4467 1.44786 10 2.00873 10L12 10C12.5522 10 13 10.4478 13 11C13 12.3088 12.3777 13.2837 11.3274 13.9534C10.2568 14.636 8.73511 15 7 15C5.26489 15 3.74318 14.636 2.67262 13.9534C1.62226 13.2837 1 12.3088 1 11Z",fill:"currentColor"}))}};t.style=i;exports.person_icon=t;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { r as
|
|
1
|
+
import { r as s, h as t } from "./index-eca7f3e2.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
const o = ".sc-play-icon-h{display:flex}", i = o, c = class {
|
|
5
|
-
constructor(
|
|
6
|
-
|
|
5
|
+
constructor(e) {
|
|
6
|
+
s(this, e), this.width = "15", this.height = "15";
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return t("svg", { key: "
|
|
9
|
+
return t("svg", { key: "0e372faff6ee857780d411ccef0b40f3c7544bb3", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "4d49567650b061eefad8ee0a3213f62ce66e5c2f", d: "M21 12L3 21V3L21 12Z", stroke: "auto", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }));
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
c.style = i;
|
|
13
13
|
const h = ".sc-stop-icon-h{display:flex}", n = h, r = class {
|
|
14
|
-
constructor(
|
|
15
|
-
|
|
14
|
+
constructor(e) {
|
|
15
|
+
s(this, e), this.width = "15", this.height = "15";
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
|
-
return t("svg", { key: "
|
|
18
|
+
return t("svg", { key: "76a7aba6d720e7c148bc772c74cefd2e83d28e09", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "auto", xmlns: "http://www.w3.org/2000/svg" }, t("path", { key: "8ae55f21d0a3f2eef8dcbd675e940f949e82a445", d: "M4 4H20V20H4V4Z", stroke: "auto", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }));
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
r.style = n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-a3051853.cjs");require("react");require("react-dom");const o=".sc-play-icon-h{display:flex}",n=o,s=class{constructor(t){e.registerInstance(this,t),this.width="15",this.height="15"}render(){return e.h("svg",{key:"0e372faff6ee857780d411ccef0b40f3c7544bb3",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"4d49567650b061eefad8ee0a3213f62ce66e5c2f",d:"M21 12L3 21V3L21 12Z",stroke:"auto","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}};s.style=n;const c=".sc-stop-icon-h{display:flex}",h=c,i=class{constructor(t){e.registerInstance(this,t),this.width="15",this.height="15"}render(){return e.h("svg",{key:"76a7aba6d720e7c148bc772c74cefd2e83d28e09",width:this.width,height:this.height,viewBox:"0 0 24 24",fill:"auto",xmlns:"http://www.w3.org/2000/svg"},e.h("path",{key:"8ae55f21d0a3f2eef8dcbd675e940f949e82a445",d:"M4 4H20V20H4V4Z",stroke:"auto","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}))}};i.style=h;exports.play_icon=s;exports.stop_icon=i;
|
package/dist/react.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-a3051853.cjs");require("react");require("react-dom");exports.AddCircleIcon=o.AddCircleIcon;exports.ArchiveIcon=o.ArchiveIcon;exports.ArrowIcon=o.ArrowIcon;exports.BoldIcon=o.BoldIcon;exports.ButtonComponent=o.ButtonComponent;exports.CalendarAgendaFillIcon=o.CalendarAgendaFillIcon;exports.CalendarAgendaIcon=o.CalendarAgendaIcon;exports.CalendarCancelIcon=o.CalendarCancelIcon;exports.CalendarCheckIcon=o.CalendarCheckIcon;exports.CalendarIcon=o.CalendarIcon;exports.CalendarInfoIcon=o.CalendarInfoIcon;exports.CalendarPatternsIcon=o.CalendarPatternsIcon;exports.CheckboxComponent=o.CheckboxComponent;exports.CheckmarkCircleIcon=o.CheckmarkCircleIcon;exports.CheckmarkIcon=o.CheckmarkIcon;exports.ChevronIcon=o.ChevronIcon;exports.ClockIcon=o.ClockIcon;exports.CloseIcon=o.CloseIcon;exports.CopyIcon=o.CopyIcon;exports.DeleteIcon=o.DeleteIcon;exports.DocumentRefreshIcon=o.DocumentRefreshIcon;exports.DragableIcon=o.DragableIcon;exports.EditIcon=o.EditIcon;exports.EnvelopeFillIcon=o.EnvelopeFillIcon;exports.EnvelopeIcon=o.EnvelopeIcon;exports.EyeIcon=o.EyeIcon;exports.FlowIcon=o.FlowIcon;exports.FolderIcon=o.FolderIcon;exports.ForwardIcon=o.ForwardIcon;exports.GlobeIcon=o.GlobeIcon;exports.GoogleLogoIcon=o.GoogleLogoIcon;exports.GoogleMeetIcon=o.GoogleMeetIcon;exports.InboxIcon=o.InboxIcon;exports.InfoIcon=o.InfoIcon;exports.InputColorPicker=o.InputColorPicker;exports.InputComponent=o.InputComponent;exports.InputDropdown=o.InputDropdown;exports.ItalicIcon=o.ItalicIcon;exports.LoadingIcon=o.LoadingIcon;exports.LocationIcon=o.LocationIcon;exports.LocationOffIcon=o.LocationOffIcon;exports.MicrosoftLogoIcon=o.MicrosoftLogoIcon;exports.MicrosoftTeamsIcon=o.MicrosoftTeamsIcon;exports.MultiSelectDropdown=o.MultiSelectDropdown;exports.NylasAdditionalParticipants=o.NylasAdditionalParticipants;exports.NylasAvailabilityPicker=o.NylasAvailabilityPicker;exports.NylasBookedEventCard=o.NylasBookedEventCard;exports.NylasBookingCalendarPicker=o.NylasBookingCalendarPicker;exports.NylasBookingConfirmationRedirect=o.NylasBookingConfirmationRedirect;exports.NylasBookingConfirmationType=o.NylasBookingConfirmationType;exports.NylasBookingForm=o.NylasBookingForm;exports.NylasBookingFormConfig=o.NylasBookingFormConfig;exports.NylasBufferTime=o.NylasBufferTime;exports.NylasCalendarPicker=o.NylasCalendarPicker;exports.NylasCancelBookingForm=o.NylasCancelBookingForm;exports.NylasCancellationPolicy=o.NylasCancellationPolicy;exports.NylasCancelledEventCard=o.NylasCancelledEventCard;exports.NylasComposer=o.NylasComposer;exports.NylasConfirmationEmail=o.NylasConfirmationEmail;exports.NylasConfirmedEventCard=o.NylasConfirmedEventCard;exports.NylasConnectedCalendars=o.NylasConnectedCalendars;exports.NylasCustomBookingFlow=o.NylasCustomBookingFlow;exports.NylasCustomEventSlug=o.NylasCustomEventSlug;exports.NylasCustomizeBookingSettings=o.NylasCustomizeBookingSettings;exports.NylasDatePicker=o.NylasDatePicker;exports.NylasEditorTabs=o.NylasEditorTabs;exports.NylasEventDescription=o.NylasEventDescription;exports.NylasEventDuration=o.NylasEventDuration;exports.NylasEventInfo=o.NylasEventInfo;exports.NylasEventLimits=o.NylasEventLimits;exports.NylasEventLocation=o.NylasEventLocation;exports.NylasEventTitle=o.NylasEventTitle;exports.NylasFormCard=o.NylasFormCard;exports.NylasIdentityRequestWrapper=o.NylasIdentityRequestWrapper;exports.NylasIfState=o.NylasIfState;exports.NylasLimitFutureBookings=o.NylasLimitFutureBookings;exports.NylasListConfigurations=o.NylasListConfigurations;exports.NylasListFolders=o.NylasListFolders;exports.NylasListThreads=o.NylasListThreads;exports.NylasLocaleSwitch=o.NylasLocaleSwitch;exports.NylasLogin=o.NylasLogin;exports.NylasLogo=o.NylasLogo;exports.NylasMailbox=o.NylasMailbox;exports.NylasMailboxPagination=o.NylasMailboxPagination;exports.NylasMailboxToolbarButton=o.NylasMailboxToolbarButton;exports.NylasMinBookingNotice=o.NylasMinBookingNotice;exports.NylasMinCancellationNotice=o.NylasMinCancellationNotice;exports.NylasNotification=o.NylasNotification;exports.NylasOrganizerConfirmationCard=o.NylasOrganizerConfirmationCard;exports.NylasPageName=o.NylasPageName;exports.NylasPageStyling=o.NylasPageStyling;exports.NylasParticipantBookingCalendars=o.NylasParticipantBookingCalendars;exports.NylasParticipantsCustomAvailability=o.NylasParticipantsCustomAvailability;exports.NylasProvider=o.NylasProvider;exports.NylasReminderEmails=o.NylasReminderEmails;exports.NylasReminderTime=o.NylasReminderTime;exports.NylasSchedulerEditor=o.NylasSchedulerEditor;exports.NylasScheduling=o.NylasScheduling;exports.NylasSchedulingMethod=o.NylasSchedulingMethod;exports.NylasSelectedEventCard=o.NylasSelectedEventCard;exports.NylasSummarizeMessageButton=o.NylasSummarizeMessageButton;exports.NylasThreadsRefresh=o.NylasThreadsRefresh;exports.NylasThreadsSearch=o.NylasThreadsSearch;exports.NylasTimeWindowPicker=o.NylasTimeWindowPicker;exports.NylasTimeslotInterval=o.NylasTimeslotInterval;exports.NylasTimeslotPicker=o.NylasTimeslotPicker;exports.NylasViewEmail=o.NylasViewEmail;exports.NylasViewThread=o.NylasViewThread;exports.PaintbrushFillIcon=o.PaintbrushFillIcon;exports.PaintbrushIcon=o.PaintbrushIcon;exports.PeopleIcon=o.PeopleIcon;exports.PersonClipboardIcon=o.PersonClipboardIcon;exports.PersonIcon=o.PersonIcon;exports.PlayIcon=o.PlayIcon;exports.PlusIcon=o.PlusIcon;exports.RadioButtonGroup=o.RadioButtonGroup;exports.RefreshIcon=o.RefreshIcon;exports.ReplyAllIcon=o.ReplyAllIcon;exports.ReplyIcon=o.ReplyIcon;exports.SearchIcon=o.SearchIcon;exports.SelectDropdown=o.SelectDropdown;exports.SentIcon=o.SentIcon;exports.SpamIcon=o.SpamIcon;exports.StarIcon=o.StarIcon;exports.StopIcon=o.StopIcon;exports.TextareaComponent=o.TextareaComponent;exports.TimePeriodSelector=o.TimePeriodSelector;exports.ToggleSwitch=o.ToggleSwitch;exports.TooltipComponent=o.TooltipComponent;exports.TranslateIcon=o.TranslateIcon;exports.TrashFillIcon=o.TrashFillIcon;exports.TrashIcon=o.TrashIcon;exports.UnderlineIcon=o.UnderlineIcon;exports.WarningIcon=o.WarningIcon;exports.ZoomIcon=o.ZoomIcon;exports.applyPolyfills=o.applyPolyfills;exports.defineCustomElements=o.defineCustomElements;exports.setNonce=o.setNonce;exports.useNylasMailboxElement=o.useNylasMailboxElement;
|
package/dist/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a3 as e, a4 as l, a5 as i, a6 as c, a7 as t, a8 as r, a9 as b, aa as y, ab as N, ac as I, ad as d, ae as C, af as m, ag as g, ah as p, ai as u, aj as k, ak as h, al as P, am as f, an as E, ao as T, ap as S, aq as v, ar as B, as as F, at as L, au as w, av as M, aw as R, ax as A, ay as D, az as x, aA as G, aB as z, aC as W, aD as O, aE as V, aF as q, aG as U, aH as Z, aI as $, aJ as j, aK as H, aL as J, aM as K, aN as Q, aO as X, aP as Y, aQ as _, aR as aa, aS as sa, aT as oa, aU as na, aV as ea, aW as la, aX as ia, aY as ca, aZ as ta, a_ as ra, a$ as ba, b0 as ya, b1 as Na, b2 as Ia, b3 as da, b4 as Ca, b5 as ma, b6 as ga, b7 as pa, b8 as ua, b9 as ka, ba as ha, bb as Pa, N as fa, bc as Ea, bd as Ta, be as Sa, bf as va, bg as Ba, bh as Fa, bi as La, bj as wa, bk as Ma, bl as Ra, bm as Aa, bn as Da, bo as xa, bp as Ga, bq as za, br as Wa, bs as Oa, bt as Va, bu as qa, bv as Ua, bw as Za, bx as $a, by as ja, bz as Ha, bA as Ja, bB as Ka, bC as Qa, bD as Xa, bE as Ya, bF as _a, bG as as, bH as ss, bI as os, bJ as ns, bK as es, bL as ls, bM as is, bN as cs, bO as ts, bP as rs, bQ as bs, bR as ys, bS as Ns, bT as Is, bU as ds, bV as Cs, bW as ms, bX as gs, bY as ps, bZ as us, b_ as ks, b$ as hs, c0 as Ps, c1 as fs, c2 as Es, c3 as Ts, c4 as Ss, c5 as vs, c6 as Bs, c7 as Fs, c8 as Ls, a0 as ws, a1 as Ms, a2 as Rs, $ as As } from "./index-eca7f3e2.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
export {
|
|
@@ -10,25 +10,25 @@ export {
|
|
|
10
10
|
r as CalendarAgendaFillIcon,
|
|
11
11
|
b as CalendarAgendaIcon,
|
|
12
12
|
y as CalendarCancelIcon,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
N as CalendarCheckIcon,
|
|
14
|
+
I as CalendarIcon,
|
|
15
15
|
d as CalendarInfoIcon,
|
|
16
16
|
C as CalendarPatternsIcon,
|
|
17
17
|
m as CheckboxComponent,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
g as CheckmarkCircleIcon,
|
|
19
|
+
p as CheckmarkIcon,
|
|
20
|
+
u as ChevronIcon,
|
|
21
|
+
k as ClockIcon,
|
|
22
|
+
h as CloseIcon,
|
|
23
|
+
P as CopyIcon,
|
|
24
|
+
f as DeleteIcon,
|
|
25
25
|
E as DocumentRefreshIcon,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
T as DragableIcon,
|
|
27
|
+
S as EditIcon,
|
|
28
28
|
v as EnvelopeFillIcon,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
B as EnvelopeIcon,
|
|
30
|
+
F as EyeIcon,
|
|
31
|
+
L as FlowIcon,
|
|
32
32
|
w as FolderIcon,
|
|
33
33
|
M as ForwardIcon,
|
|
34
34
|
R as GlobeIcon,
|
|
@@ -36,24 +36,24 @@ export {
|
|
|
36
36
|
D as GoogleMeetIcon,
|
|
37
37
|
x as InboxIcon,
|
|
38
38
|
G as InfoIcon,
|
|
39
|
+
z as InputColorPicker,
|
|
39
40
|
W as InputComponent,
|
|
40
|
-
|
|
41
|
+
O as InputDropdown,
|
|
41
42
|
V as ItalicIcon,
|
|
42
43
|
q as LoadingIcon,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
sa as NylasBookingType,
|
|
44
|
+
U as LocationIcon,
|
|
45
|
+
Z as LocationOffIcon,
|
|
46
|
+
$ as MicrosoftLogoIcon,
|
|
47
|
+
j as MicrosoftTeamsIcon,
|
|
48
|
+
H as MultiSelectDropdown,
|
|
49
|
+
J as NylasAdditionalParticipants,
|
|
50
|
+
K as NylasAvailabilityPicker,
|
|
51
|
+
Q as NylasBookedEventCard,
|
|
52
|
+
X as NylasBookingCalendarPicker,
|
|
53
|
+
Y as NylasBookingConfirmationRedirect,
|
|
54
|
+
_ as NylasBookingConfirmationType,
|
|
55
|
+
aa as NylasBookingForm,
|
|
56
|
+
sa as NylasBookingFormConfig,
|
|
57
57
|
oa as NylasBufferTime,
|
|
58
58
|
na as NylasCalendarPicker,
|
|
59
59
|
ea as NylasCancelBookingForm,
|
|
@@ -61,76 +61,84 @@ export {
|
|
|
61
61
|
ia as NylasCancelledEventCard,
|
|
62
62
|
ca as NylasComposer,
|
|
63
63
|
ta as NylasConfirmationEmail,
|
|
64
|
-
ra as
|
|
65
|
-
ba as
|
|
66
|
-
ya as
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
da as
|
|
70
|
-
Ca as
|
|
71
|
-
ma as
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
ra as NylasConfirmedEventCard,
|
|
65
|
+
ba as NylasConnectedCalendars,
|
|
66
|
+
ya as NylasCustomBookingFlow,
|
|
67
|
+
Na as NylasCustomEventSlug,
|
|
68
|
+
Ia as NylasCustomizeBookingSettings,
|
|
69
|
+
da as NylasDatePicker,
|
|
70
|
+
Ca as NylasEditorTabs,
|
|
71
|
+
ma as NylasEventDescription,
|
|
72
|
+
ga as NylasEventDuration,
|
|
73
|
+
pa as NylasEventInfo,
|
|
74
|
+
ua as NylasEventLimits,
|
|
75
|
+
ka as NylasEventLocation,
|
|
76
|
+
ha as NylasEventTitle,
|
|
77
|
+
Pa as NylasFormCard,
|
|
76
78
|
fa as NylasIdentityRequestWrapper,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
Ea as NylasIfState,
|
|
80
|
+
Ta as NylasLimitFutureBookings,
|
|
81
|
+
Sa as NylasListConfigurations,
|
|
82
|
+
va as NylasListFolders,
|
|
81
83
|
Ba as NylasListThreads,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
fs as
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
Bs as
|
|
84
|
+
Fa as NylasLocaleSwitch,
|
|
85
|
+
La as NylasLogin,
|
|
86
|
+
wa as NylasLogo,
|
|
87
|
+
Ma as NylasMailbox,
|
|
88
|
+
Ra as NylasMailboxPagination,
|
|
89
|
+
Aa as NylasMailboxToolbarButton,
|
|
90
|
+
Da as NylasMinBookingNotice,
|
|
91
|
+
xa as NylasMinCancellationNotice,
|
|
92
|
+
Ga as NylasNotification,
|
|
93
|
+
za as NylasOrganizerConfirmationCard,
|
|
94
|
+
Wa as NylasPageName,
|
|
95
|
+
Oa as NylasPageStyling,
|
|
96
|
+
Va as NylasParticipantBookingCalendars,
|
|
97
|
+
qa as NylasParticipantsCustomAvailability,
|
|
98
|
+
Ua as NylasProvider,
|
|
99
|
+
Za as NylasReminderEmails,
|
|
100
|
+
$a as NylasReminderTime,
|
|
101
|
+
ja as NylasSchedulerEditor,
|
|
102
|
+
Ha as NylasScheduling,
|
|
103
|
+
Ja as NylasSchedulingMethod,
|
|
104
|
+
Ka as NylasSelectedEventCard,
|
|
105
|
+
Qa as NylasSummarizeMessageButton,
|
|
106
|
+
Xa as NylasThreadsRefresh,
|
|
107
|
+
Ya as NylasThreadsSearch,
|
|
108
|
+
_a as NylasTimeWindowPicker,
|
|
109
|
+
as as NylasTimeslotInterval,
|
|
110
|
+
ss as NylasTimeslotPicker,
|
|
111
|
+
os as NylasViewEmail,
|
|
112
|
+
ns as NylasViewThread,
|
|
113
|
+
es as PaintbrushFillIcon,
|
|
114
|
+
ls as PaintbrushIcon,
|
|
115
|
+
is as PeopleIcon,
|
|
116
|
+
cs as PersonClipboardIcon,
|
|
117
|
+
ts as PersonIcon,
|
|
118
|
+
rs as PlayIcon,
|
|
119
|
+
bs as PlusIcon,
|
|
120
|
+
ys as RadioButtonGroup,
|
|
121
|
+
Ns as RefreshIcon,
|
|
122
|
+
Is as ReplyAllIcon,
|
|
123
|
+
ds as ReplyIcon,
|
|
124
|
+
Cs as SearchIcon,
|
|
125
|
+
ms as SelectDropdown,
|
|
126
|
+
gs as SentIcon,
|
|
127
|
+
ps as SpamIcon,
|
|
128
|
+
us as StarIcon,
|
|
129
|
+
ks as StopIcon,
|
|
130
|
+
hs as TextareaComponent,
|
|
131
|
+
Ps as TimePeriodSelector,
|
|
132
|
+
fs as ToggleSwitch,
|
|
133
|
+
Es as TooltipComponent,
|
|
134
|
+
Ts as TranslateIcon,
|
|
135
|
+
Ss as TrashFillIcon,
|
|
136
|
+
vs as TrashIcon,
|
|
137
|
+
Bs as UnderlineIcon,
|
|
138
|
+
Fs as WarningIcon,
|
|
139
|
+
Ls as ZoomIcon,
|
|
140
|
+
ws as applyPolyfills,
|
|
141
|
+
Ms as defineCustomElements,
|
|
142
|
+
Rs as setNonce,
|
|
143
|
+
As as useNylasMailboxElement
|
|
136
144
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-a3051853.cjs");require("react");require("react-dom");const t=".sc-refresh-icon-h{display:flex}",i=t,e=class{constructor(s){c.registerInstance(this,s),this.width="15",this.height="15"}render(){return c.h("svg",{key:"69fb186da1ef36bd7c78215ff7023e9d5b6aa60a",fill:"auto",width:this.width,height:this.height,viewBox:"0 0 32 32",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},c.h("path",{key:"c00aa9f611c0b73ebca4e1f49d219a10ca37dac8",d:"M15.544 28.080c-0.002-0.006-0.008-0.010-0.012-0.015l-2.873-4.489c-0.204-0.335-0.646-0.454-0.992-0.266l-0.256 0.157c-0.344 0.188-0.337 0.673-0.133 1.008l1.841 2.857c-0.157-0.035-0.316-0.063-0.471-0.103-3.224-0.843-5.953-3.026-7.485-5.988-1.448-2.797-1.72-5.99-0.766-8.992s3.118-5.452 5.915-6.899c0.476-0.247 0.662-0.832 0.416-1.308-0.246-0.477-0.832-0.663-1.308-0.416-3.258 1.686-5.763 4.54-6.874 8.036s-0.794 7.215 0.892 10.473c1.786 3.448 4.963 5.989 8.72 6.973 0.043 0.011 0.087 0.017 0.13 0.028l-2.541 1.288c-0.344 0.189-0.458 0.613-0.254 0.948l0.098 0.256c0.205 0.335 0.557 0.454 0.9 0.266l4.651-2.381c0.006-0.004 0.012-0.003 0.018-0.007l0.312-0.171c0.172-0.095 0.287-0.249 0.332-0.422 0.047-0.172 0.025-0.364-0.076-0.531zM28.559 10.025c-1.783-3.447-4.862-5.988-8.618-6.972-0.267-0.070-0.541-0.124-0.814-0.179l2.494-1.265c0.344-0.189 0.549-0.614 0.345-0.949l-0.099-0.255c-0.205-0.336-0.648-0.454-0.991-0.267l-4.651 2.381c-0.006 0.003-0.012 0.002-0.018 0.006l-0.312 0.171c-0.173 0.095-0.287 0.249-0.332 0.422-0.047 0.172-0.025 0.364 0.077 0.53l0.185 0.304c0.003 0.006 0.008 0.010 0.012 0.016l2.873 4.489c0.203 0.335 0.646 0.454 0.991 0.266l0.226-0.157c0.344-0.188 0.366-0.673 0.163-1.008l-1.85-2.87c0.407 0.063 0.811 0.138 1.207 0.242 3.226 0.845 5.856 3.027 7.387 5.986 1.448 2.797 1.72 5.99 0.765 8.991s-3.020 5.451-5.818 6.901c-0.476 0.247-0.662 0.831-0.415 1.308 0.172 0.332 0.511 0.524 0.863 0.524 0.15 0 0.302-0.035 0.446-0.109 3.259-1.686 5.664-4.54 6.776-8.035 1.111-3.497 0.794-7.217-0.893-10.473z"}))}};e.style=i;exports.refresh_icon=e;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { r as
|
|
1
|
+
import { r as e, h as c } from "./index-eca7f3e2.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
const t = ".sc-refresh-icon-h{display:flex}", l = t, h = class {
|
|
5
|
-
constructor(
|
|
6
|
-
|
|
5
|
+
constructor(s) {
|
|
6
|
+
e(this, s), this.width = "15", this.height = "15";
|
|
7
7
|
}
|
|
8
8
|
render() {
|
|
9
|
-
return c("svg", { key: "
|
|
9
|
+
return c("svg", { key: "69fb186da1ef36bd7c78215ff7023e9d5b6aa60a", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 32 32", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, c("path", { key: "c00aa9f611c0b73ebca4e1f49d219a10ca37dac8", d: "M15.544 28.080c-0.002-0.006-0.008-0.010-0.012-0.015l-2.873-4.489c-0.204-0.335-0.646-0.454-0.992-0.266l-0.256 0.157c-0.344 0.188-0.337 0.673-0.133 1.008l1.841 2.857c-0.157-0.035-0.316-0.063-0.471-0.103-3.224-0.843-5.953-3.026-7.485-5.988-1.448-2.797-1.72-5.99-0.766-8.992s3.118-5.452 5.915-6.899c0.476-0.247 0.662-0.832 0.416-1.308-0.246-0.477-0.832-0.663-1.308-0.416-3.258 1.686-5.763 4.54-6.874 8.036s-0.794 7.215 0.892 10.473c1.786 3.448 4.963 5.989 8.72 6.973 0.043 0.011 0.087 0.017 0.13 0.028l-2.541 1.288c-0.344 0.189-0.458 0.613-0.254 0.948l0.098 0.256c0.205 0.335 0.557 0.454 0.9 0.266l4.651-2.381c0.006-0.004 0.012-0.003 0.018-0.007l0.312-0.171c0.172-0.095 0.287-0.249 0.332-0.422 0.047-0.172 0.025-0.364-0.076-0.531zM28.559 10.025c-1.783-3.447-4.862-5.988-8.618-6.972-0.267-0.070-0.541-0.124-0.814-0.179l2.494-1.265c0.344-0.189 0.549-0.614 0.345-0.949l-0.099-0.255c-0.205-0.336-0.648-0.454-0.991-0.267l-4.651 2.381c-0.006 0.003-0.012 0.002-0.018 0.006l-0.312 0.171c-0.173 0.095-0.287 0.249-0.332 0.422-0.047 0.172-0.025 0.364 0.077 0.53l0.185 0.304c0.003 0.006 0.008 0.010 0.012 0.016l2.873 4.489c0.203 0.335 0.646 0.454 0.991 0.266l0.226-0.157c0.344-0.188 0.366-0.673 0.163-1.008l-1.85-2.87c0.407 0.063 0.811 0.138 1.207 0.242 3.226 0.845 5.856 3.027 7.387 5.986 1.448 2.797 1.72 5.99 0.765 8.991s-3.020 5.451-5.818 6.901c-0.476 0.247-0.662 0.831-0.415 1.308 0.172 0.332 0.511 0.524 0.863 0.524 0.15 0 0.302-0.035 0.446-0.109 3.259-1.686 5.664-4.54 6.776-8.035 1.111-3.497 0.794-7.217-0.893-10.473z" }));
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
h.style = l;
|
package/dist/{register-component-592986c5-5edf5835.cjs → register-component-4487ac6f-b29bf135.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("./index-
|
|
1
|
+
"use strict";const s=require("./index-a3051853.cjs");function m(e,o,u="registerComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function P(e,o,u="unregisterComponent"){return new CustomEvent(u,{bubbles:!0,composed:!0,detail:o})}function b(e){return(o,u)=>{const r=e.name;s.debug(`[${r}] Registering component ${r} being called on ${u}`);const l=o.componentWillLoad;if(!l){s.error(`[${r}] componentWillLoad lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const p=o.connectedCallback;if(!p){s.error(`[${r}] connectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}const a=o.disconnectedCallback;if(!a){s.error(`[${r}] disconnectedCallback lifecycle method in ${r} missing. Required for RegisterComponent decorator.`);return}if(e.storeToProps&&e.stateToProps){const n=Array.from(e.storeToProps.values()),t=Array.from(e.stateToProps.values()),i=n.filter(c=>t.includes(c));if(i.length>0){s.error(`[${r}] Overlapping prop keys detected in ${r} for storeToProps and stateToProps. Make sure to only define them once. Overlapping keys: ${i.join(", ")}`);return}}const d=new Map;e.eventToProps&&Object.keys(e.eventToProps).forEach(n=>{var t;d.set(n,(t=e.eventToProps)==null?void 0:t[n])}),o.connectedCallback=function(){s.debug(`[~${r}] connectedCallback called`);const n=p==null?void 0:p.call(this),t=s.getElement(this);return t.dataset.nylasId||(Object.defineProperty(t,"registerNylasComponent",{get(){return!0},enumerable:!0}),Object.defineProperty(t,"stateToProps",{get(){return e.stateToProps},enumerable:!0}),Object.defineProperty(t,"getStoresToProp",{get(){return e.getStoresToProp},enumerable:!0}),Object.defineProperty(t,"storeToProps",{get(){return e.storeToProps},enumerable:!0}),Object.defineProperty(t,"eventToProps",{get(){return d},enumerable:!0}),Object.defineProperty(t,"authToProp",{get(){return e.authToProp},enumerable:!0}),Object.defineProperty(t,"connectorToProp",{get(){return e.connectorToProp},enumerable:!0}),Object.defineProperty(t,"localPropsToProp",{get(){return e.localPropsToProp},enumerable:!0})),n},e.fireRegisterEvent&&(o.componentWillLoad=function(){const n=l==null?void 0:l.call(this),t=s.getElement(this),i={element:t,...e,eventToProps:d},c=m(o,i,e.registrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired registration event`),n},o.disconnectedCallback=function(){const n=a==null?void 0:a.call(this),t=s.getElement(this),i={element:t,...e,eventToProps:d},c=P(o,i,e.unregistrationEventName);return t.dispatchEvent(c)&&s.debug(`[${r}] Component ${r} successfully fired unregistration event`),n})}}exports.RegisterComponent=b;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("./index-a3051853.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,4 +1,4 @@
|
|
|
1
|
-
import { e as
|
|
1
|
+
import { e as i } from "./index-eca7f3e2.js";
|
|
2
2
|
function s(n = {}) {
|
|
3
3
|
const o = {
|
|
4
4
|
selectedConfiguration: {},
|
|
@@ -9,13 +9,14 @@ function s(n = {}) {
|
|
|
9
9
|
action: null,
|
|
10
10
|
additionalParticipants: [],
|
|
11
11
|
hideEditorTabs: [],
|
|
12
|
+
requiresSlug: !1,
|
|
12
13
|
...n
|
|
13
|
-
}, e =
|
|
14
|
+
}, e = i(o);
|
|
14
15
|
function t() {
|
|
15
16
|
e.set("selectedConfiguration", { ...n.selectedConfiguration });
|
|
16
17
|
}
|
|
17
|
-
return e.onChange("action", async (
|
|
18
|
-
|
|
18
|
+
return e.onChange("action", async (r) => {
|
|
19
|
+
r || t();
|
|
19
20
|
}), {
|
|
20
21
|
...e,
|
|
21
22
|
resetSelectedConfiguration: t
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("./index-a3051853.cjs");exports.ErrorCategory=void 0;(function(a){a.Component="component",a.Api="api",a.Auth="auth"})(exports.ErrorCategory||(exports.ErrorCategory={}));var E;(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"})(E||(E={}));var B;(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"})(B||(B={}));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 z{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),c.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 v;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(c.instance.t("createBookingErrorTitle")).no_booking_info()};const r=(e==null?void 0:e.timeslot)||t;if(!r)return{error:this.errors.component(c.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(c.instance.t("createBookingErrorTitle")).no_timezone_selected()};const u=this.schedulerStore.get("availabilityOrderEmails");let g="";if(u.length>0){const m=r.emails;for(let p=0;p<u.length;p++)if(m.includes(u[p])){g=u[p];break}}const l=e?e==null?void 0:e.primaryParticipant:i==null?void 0:i.primaryParticipant,I=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(),h=`/v3/scheduling/bookings${!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:""}`,d=await this.makeAPIRequest(decodeURIComponent(h),"POST",JSON.stringify({participants:g?[{email:g}]:void 0,additional_fields:f,additional_guests:I,guest:{...l},start_time:r.start_time.getTime()/1e3,end_time:r.end_time.getTime()/1e3,timezone:o,email_language:this.getTwoLetterLanguageCode(n)}),_);if("error"in d){this.schedulerStore.set("isLoading",!1);const m=(v=d.error)==null?void 0:v.type;let p=d.error;if(m&&m in this.errors.api("Create Booking")){const b=this.getErrorMessage(p);p=this.errors.api("Create Booking")[m](b)}return{error:p}}return"data"in d&&this.schedulerStore.set("eventInfo",d==null?void 0:d.data),this.schedulerStore.set("isLoading",!1),d}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(c.instance.t("getUISettingErrorTitle"))&&(o=this.errors.api(c.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 i;const t=(i=this.schedulerStore.get("configSettings"))==null?void 0:i.scheduler,s=t==null?void 0:t.min_booking_notice;return s?e+s*60: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(c.addDaysToCurrentDate(t,s).getTime()/1e3);return Math.min(i,e)}async getAvailability(e=0,t=0){var I,f,_,S;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(c.instance.t("getAvailabilityErrorTitle")).endtime_not_in_future()};if(!e){const h=new Date(i.getFullYear(),i.getMonth(),1);e=Math.floor(h.getTime()/1e3)}if(e=this.getStartTimeWithMinBookingNotice(e),!t){const h=new Date(i.getFullYear(),i.getMonth()+1,0);t=Math.floor(h.getTime()/1e3)}t=this.getEndTimeForAvailableDaysInFuture(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 r=this.schedulerStore.get("rescheduleBookingId");r&&s.append("booking_id",encodeURIComponent(r));const o=s.toString(),u=`/v3/scheduling/availability${o?`?${o}`:""}`,g=this.getHeaders(),l=await this.makeAPIRequest(decodeURIComponent(u),"GET",void 0,g);if("error"in l){this.schedulerStore.set("availability",[]),this.schedulerStore.set("isLoading",!1);const h=(I=l.error)==null?void 0:I.type;let d=l.error;if(h&&h in this.errors.api(c.instance.t("getAvailabilityErrorTitle"))){const v=this.getErrorMessage(d);d=this.errors.api(c.instance.t("getAvailabilityErrorTitle"))[h](v)}return{error:d}}if("data"in l){const d=(((_=(f=l.data)==null?void 0:f.time_slots)==null?void 0:_.map(m=>({...m,start_time:new Date(m.start_time*1e3),end_time:new Date(m.end_time*1e3)})))||[]).filter(m=>m.start_time.getTime()>n);this.schedulerStore.set("availability",d);const v=((S=l.data)==null?void 0:S.order)||[];this.schedulerStore.set("availabilityOrderEmails",v)}return this.schedulerStore.set("isLoading",!1),l}async cancelBooking(e,t){var o;if(this.schedulerStore.set("isLoading",!0),!e)return{error:this.errors.component(c.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 g=r.error;if(u&&u in this.errors.api(c.instance.t("cancelBookingErrorTitle"))){const l=this.getErrorMessage(g);g=this.errors.api(c.instance.t("cancelBookingErrorTitle"))[u](l)}return{error:g}}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(c.instance.t("rescheduleBookingErrorTitle")).no_booking_id()};const s=this.errors.api(c.instance.t("rescheduleBookingErrorTitle")),i=this.errors.component(c.instance.t("rescheduleBookingErrorTitle")),{bookingInfo:n,selectedTimeslot:r,selectedTimezone:o,selectedLanguage:u}=this.schedulerStore.state,{startTime:g,endTime:l,timezone:I}=t,f=g||(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 _=l||(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 S=this.schedulerStore.get("availabilityOrderEmails");let h="";if(S.length>0){const T=(r==null?void 0:r.emails)||[];for(let k=0;k<S.length;k++)if(T.includes(S[k])){h=S[k];break}}const d=I||o;if(!d)return{error:i.invalid_timezone('Please pass "timezone" in data or set "selectedTimezone" in the defaultSchedulerState.')};const v=t?t==null?void 0:t.primaryParticipant:n==null?void 0:n.primaryParticipant,m=t?(t==null?void 0:t.guests)||[]:(n==null?void 0:n.guests)||[],p=t?t==null?void 0:t.additionalFields:n==null?void 0:n.additionalFields,b=!this.sessionId&&this.configId?`?configuration_id=${this.configId}`:!this.sessionId&&this.slug&&this.clientId?`?slug=${this.slug}&client_id=${this.clientId}`:"",A=`/v3/scheduling/bookings/${e}${b}`,D=this.getHeaders(),y=await this.makeAPIRequest(decodeURIComponent(A),"PATCH",JSON.stringify({start_time:f.getTime()/1e3,end_time:_.getTime()/1e3,timezone:d,additional_fields:p,guest:{...v},additional_guests:m,participants:h?[{email:h}]:void 0,email_language:this.getTwoLetterLanguageCode(u)}),D);if("error"in y){this.schedulerStore.set("isLoading",!1);const T=(L=y.error)==null?void 0:L.type;let k=y.error;if(T&&T in s){const P=this.getErrorMessage(k);k=s[T](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 T={booking_id:e};this.schedulerStore.set("eventInfo",T)}return this.schedulerStore.set("isLoading",!1),y}async updateBooking(e){var I;this.schedulerStore.set("isLoading",!0);const{bookingId:t,status:s,reason:i}=e,n=this.schedulerStore.get("organizerConfirmationSalt"),r=s==="confirmed"?c.instance.t("confirmBookingErrorTitle"):c.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}`,g=this.getHeaders(),l=await this.makeAPIRequest(decodeURIComponent(u),"PUT",JSON.stringify({status:s,cancellation_reason:i,salt:n}),g);if("error"in l){this.schedulerStore.set("isLoading",!1);const f=(I=l.error)==null?void 0:I.type;let _=l.error;if(f&&f in this.errors.api(r)){const S=this.getErrorMessage(_);_=this.errors.api(r)[f](S)}return{error:_}}return"data"in l&&s==="confirmed"?this.schedulerStore.set("confirmedEventInfo",l==null?void 0:l.data):"request_id"in l&&s==="cancelled"&&this.schedulerStore.set("cancelledEventInfo",{booking_id:t}),this.schedulerStore.set("organizerConfirmationBookingId",""),this.schedulerStore.set("isLoading",!1),l}}function M(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};c.debug("[defaultNylasStoreState]: ",e);const t=c.createStore(e);return t.onChange("availability",s=>{c.debug("[availability]: ",s);const i=s.map(o=>o.start_time);c.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);c.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=M;exports.NylaSchedulerAPIConnector=z;
|